Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default styling for the porting embed #7

Merged
merged 1 commit into from Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions .storybook/preview.ts → .storybook/preview.tsx
@@ -1,6 +1,18 @@
import React from 'react'
import type { Preview } from '@storybook/preact'

import './styles.css'
import '../lib/PortingEmbed/styles.css'

const preview: Preview = {
decorators: [
(Story) => (
<div className="GigsEmbeds-root">
{/* @ts-expect-error */}
{Story()}
</div>
),
],
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
Expand Down
12 changes: 12 additions & 0 deletions .storybook/styles.css
@@ -0,0 +1,12 @@
@import '../lib/styles/preflight.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

.GigsEmbeds-root {
button[type='submit'] {
@apply mt-4;
@apply rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600;
}
}
2 changes: 1 addition & 1 deletion lib/PortingEmbed/PortingEmbed.tsx
Expand Up @@ -24,7 +24,7 @@ export function PortingEmbed({
}: PortingEmbedProps) {
return (
<OptionsContext.Provider value={options || {}}>
<div className="__ge_portingRoot">
<div className="__ge_portingRoot GigsEmbeds-root">
<PortingForm
porting={porting}
onValidationChange={onValidationChange}
Expand Down
22 changes: 12 additions & 10 deletions lib/PortingEmbed/StepDonorProviderApprovalForm.tsx
Expand Up @@ -66,16 +66,18 @@ export function StepDonorProviderApprovalForm({
>
{(field, props) => (
<EmbedField of={field}>
<EmbedFieldInput
{...props}
of={field}
type="checkbox"
checked={field.value}
/>
<EmbedFieldLabel of={field}>
I have notified my current provider of the number porting and got
the approval that the number can be ported
</EmbedFieldLabel>
<div className="GigsEmbeds GigsPortingEmbed GigsEmbeds-checkbox">
<EmbedFieldInput
{...props}
of={field}
type="checkbox"
checked={field.value}
/>
<EmbedFieldLabel of={field}>
I have notified my current provider of the number porting and
got the approval that the number can be ported
</EmbedFieldLabel>
</div>
<EmbedFieldError of={field} />
</EmbedField>
)}
Expand Down
2 changes: 2 additions & 0 deletions lib/index.ts
@@ -1,2 +1,4 @@
import './styles/styles.css'

export { WelcomeEmbed } from './WelcomeEmbed'
export { PortingEmbed } from './PortingEmbed'