@digigov/ui 2.0.0-rc.21 → 2.0.0-rc.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/Header/__stories__/WithServiceNameAndLogo/index.js +2 -2
- package/app/Header/__stories__/WithServiceNameAndLogo.js.map +2 -2
- package/app/Loader/index.d.ts +1 -1
- package/app/Loader/index.js +1 -1
- package/app/Loader/index.js.map +1 -1
- package/app/Loader/index.native/index.js +102 -0
- package/{api/fetchAPI → app/Loader/index.native}/package.json +1 -1
- package/app/Loader/index.native.d.ts +3 -0
- package/app/Loader/index.native.js.map +7 -0
- package/app/Loader/index.web/index.js +2 -0
- package/{api/APIProvider → app/Loader/index.web}/package.json +1 -1
- package/app/Loader/index.web.d.ts +1 -0
- package/app/Loader/index.web.js.map +7 -0
- package/app/Masthead/Masthead.stories/index.js +2 -0
- package/app/Masthead/Masthead.stories.d.ts +1 -0
- package/app/Masthead/Masthead.stories.js.map +2 -2
- package/app/Masthead/__stories__/Secondary/index.js +13 -0
- package/app/Masthead/__stories__/Secondary/package.json +6 -0
- package/app/Masthead/__stories__/Secondary.d.ts +3 -0
- package/app/Masthead/__stories__/Secondary.js.map +7 -0
- package/app/QrCodeScanner/index.js.map +2 -2
- package/cjs/app/Header/__stories__/WithServiceNameAndLogo.js.map +3 -3
- package/cjs/app/Loader/index.js +3 -3
- package/cjs/app/Loader/index.js.map +2 -2
- package/cjs/app/Loader/index.native/index.js +135 -0
- package/cjs/app/Loader/index.native.js.map +7 -0
- package/cjs/app/Loader/index.web/index.js +22 -0
- package/cjs/app/Loader/index.web.js.map +7 -0
- package/cjs/app/Masthead/Masthead.stories/index.js +3 -0
- package/cjs/app/Masthead/Masthead.stories.js.map +2 -2
- package/cjs/app/Masthead/__stories__/Secondary/index.js +46 -0
- package/cjs/app/Masthead/__stories__/Secondary.js.map +7 -0
- package/cjs/app/QrCodeScanner/index.js.map +2 -2
- package/cjs/content/Table/Table.stories/index.js +3 -3
- package/cjs/content/Table/Table.stories.js.map +2 -2
- package/cjs/content/Table/__stories__/{Densed → Dense}/index.js +9 -9
- package/cjs/content/Table/__stories__/{Densed.js.map → Dense.js.map} +3 -3
- package/cjs/feedback/CopyToClipboard/__stories__/Default/index.js +1 -1
- package/cjs/feedback/CopyToClipboard/__stories__/Default.js.map +2 -2
- package/cjs/form/DateInputContainer/__stories__/MultipleQuestions/index.js +1 -1
- package/cjs/form/DateInputContainer/__stories__/MultipleQuestions.js.map +1 -1
- package/cjs/{api/APIErrors → form/SearchContainer/SearchContainer.stories}/index.js +15 -43
- package/cjs/form/SearchContainer/SearchContainer.stories.js.map +7 -0
- package/cjs/{api/APIProvider → form/SearchContainer/__stories__/Default}/index.js +12 -27
- package/cjs/form/SearchContainer/__stories__/Default.js.map +7 -0
- package/cjs/i18n/locales/el/index.js +7 -1
- package/cjs/i18n/locales/el.js.map +2 -2
- package/cjs/layouts/Basic/Bottom/__stories__/Default/index.js +7 -5
- package/cjs/layouts/Basic/Bottom/__stories__/Default.js.map +3 -3
- package/cjs/layouts/Basic/Container/__stories__/Default/index.js +6 -4
- package/cjs/layouts/Basic/Container/__stories__/Default.js.map +3 -3
- package/cjs/layouts/Basic/Main/__stories__/Default/index.js +6 -4
- package/cjs/layouts/Basic/Main/__stories__/Default.js.map +3 -3
- package/cjs/layouts/Basic/Top/__stories__/Default/index.js +6 -4
- package/cjs/layouts/Basic/Top/__stories__/Default.js.map +3 -3
- package/cjs/lazy/index.js +4 -5
- package/cjs/lazy.js.map +2 -2
- package/cjs/navigation/Breadcrumbs/Breadcrumbs.stories/index.js +6 -0
- package/cjs/navigation/Breadcrumbs/Breadcrumbs.stories.js.map +2 -2
- package/cjs/navigation/Breadcrumbs/__stories__/Auto/index.js +201 -0
- package/cjs/navigation/Breadcrumbs/__stories__/Auto.js.map +7 -0
- package/cjs/navigation/Breadcrumbs/__stories__/WithHook/index.js +208 -0
- package/cjs/navigation/Breadcrumbs/__stories__/WithHook.js.map +7 -0
- package/cjs/navigation/Breadcrumbs/auto/index.js +79 -0
- package/cjs/navigation/Breadcrumbs/auto.js.map +7 -0
- package/cjs/navigation/Breadcrumbs/hooks/index.js +74 -0
- package/cjs/navigation/Breadcrumbs/hooks.js.map +7 -0
- package/cjs/navigation/Breadcrumbs/index.js +3 -1
- package/cjs/navigation/Breadcrumbs/index.js.map +2 -2
- package/cjs/navigation/Breadcrumbs/slug/index.js +120 -0
- package/cjs/navigation/Breadcrumbs/slug.js.map +7 -0
- package/cjs/navigation/Breadcrumbs/utils/index.js +52 -0
- package/cjs/navigation/Breadcrumbs/utils.js.map +7 -0
- package/cjs/navigation/Drawer/__stories__/Auto/index.js +3 -1
- package/cjs/navigation/Drawer/__stories__/Auto.js.map +2 -2
- package/cjs/navigation/Drawer/__stories__/Default/index.js +2 -2
- package/cjs/navigation/Drawer/__stories__/Default.js.map +3 -3
- package/cjs/navigation/NavList/__stories__/UsingNavListAuto/index.js +22 -22
- package/cjs/navigation/NavList/__stories__/UsingNavListAuto.js.map +2 -2
- package/cjs/navigation/NavList/__stories__/Vertical/index.js +25 -17
- package/cjs/navigation/NavList/__stories__/Vertical.js.map +2 -2
- package/cjs/registry/index.js +12 -16
- package/cjs/registry.js.map +2 -2
- package/content/Table/Table.stories/index.js +2 -2
- package/content/Table/Table.stories.d.ts +1 -1
- package/content/Table/Table.stories.js.map +2 -2
- package/content/Table/__stories__/{Densed → Dense}/index.js +5 -5
- package/content/Table/__stories__/Dense/package.json +6 -0
- package/content/Table/__stories__/Dense.d.ts +3 -0
- package/content/Table/__stories__/{Densed.js.map → Dense.js.map} +3 -3
- package/feedback/CopyToClipboard/__stories__/Default/index.js +1 -1
- package/feedback/CopyToClipboard/__stories__/Default.js.map +2 -2
- package/form/DateInputContainer/__stories__/MultipleQuestions/index.js +1 -1
- package/form/DateInputContainer/__stories__/MultipleQuestions.js.map +1 -1
- package/form/SearchContainer/SearchContainer.stories/index.js +13 -0
- package/form/SearchContainer/SearchContainer.stories/package.json +6 -0
- package/form/SearchContainer/SearchContainer.stories.d.ts +9 -0
- package/form/SearchContainer/SearchContainer.stories.js.map +7 -0
- package/form/SearchContainer/__stories__/Default/index.js +11 -0
- package/form/SearchContainer/__stories__/Default/package.json +6 -0
- package/form/SearchContainer/__stories__/Default.d.ts +3 -0
- package/form/SearchContainer/__stories__/Default.js.map +7 -0
- package/form/SearchContainer/index.test.d.ts +1 -0
- package/i18n/locales/el/index.js +7 -1
- package/i18n/locales/el.d.ts +6 -0
- package/i18n/locales/el.js.map +2 -2
- package/index.js +1 -1
- package/layouts/Basic/Bottom/__stories__/Default/index.js +7 -5
- package/layouts/Basic/Bottom/__stories__/Default.js.map +2 -2
- package/layouts/Basic/Container/__stories__/Default/index.js +6 -4
- package/layouts/Basic/Container/__stories__/Default.js.map +2 -2
- package/layouts/Basic/Main/__stories__/Default/index.js +6 -4
- package/layouts/Basic/Main/__stories__/Default.js.map +2 -2
- package/layouts/Basic/Top/__stories__/Default/index.js +6 -4
- package/layouts/Basic/Top/__stories__/Default.js.map +2 -2
- package/lazy/index.js +4 -5
- package/lazy.d.ts +4 -5
- package/lazy.js.map +2 -2
- package/navigation/Breadcrumbs/Breadcrumbs.stories/index.js +4 -0
- package/navigation/Breadcrumbs/Breadcrumbs.stories.d.ts +2 -0
- package/navigation/Breadcrumbs/Breadcrumbs.stories.js.map +2 -2
- package/navigation/Breadcrumbs/__stories__/Auto/index.js +172 -0
- package/navigation/Breadcrumbs/__stories__/Auto/package.json +6 -0
- package/navigation/Breadcrumbs/__stories__/Auto.d.ts +3 -0
- package/navigation/Breadcrumbs/__stories__/Auto.js.map +7 -0
- package/navigation/Breadcrumbs/__stories__/WithHook/index.js +179 -0
- package/navigation/Breadcrumbs/__stories__/WithHook/package.json +6 -0
- package/navigation/Breadcrumbs/__stories__/WithHook.d.ts +3 -0
- package/navigation/Breadcrumbs/__stories__/WithHook.js.map +7 -0
- package/navigation/Breadcrumbs/auto/index.js +49 -0
- package/{api → navigation/Breadcrumbs/auto}/package.json +1 -1
- package/navigation/Breadcrumbs/auto.d.ts +16 -0
- package/navigation/Breadcrumbs/auto.js.map +7 -0
- package/navigation/Breadcrumbs/hooks/index.js +51 -0
- package/navigation/Breadcrumbs/hooks/package.json +6 -0
- package/navigation/Breadcrumbs/hooks.d.ts +11 -0
- package/navigation/Breadcrumbs/hooks.js.map +7 -0
- package/navigation/Breadcrumbs/index.d.ts +1 -0
- package/navigation/Breadcrumbs/index.js +1 -0
- package/navigation/Breadcrumbs/index.js.map +2 -2
- package/navigation/Breadcrumbs/slug/index.js +97 -0
- package/{api/APIErrors → navigation/Breadcrumbs/slug}/package.json +1 -1
- package/navigation/Breadcrumbs/slug.d.ts +1 -0
- package/navigation/Breadcrumbs/slug.js.map +7 -0
- package/navigation/Breadcrumbs/utils/index.js +29 -0
- package/navigation/Breadcrumbs/utils/package.json +6 -0
- package/navigation/Breadcrumbs/utils.d.ts +1 -0
- package/navigation/Breadcrumbs/utils.js.map +7 -0
- package/navigation/Drawer/__stories__/Auto/index.js +3 -1
- package/navigation/Drawer/__stories__/Auto.d.ts +1 -0
- package/navigation/Drawer/__stories__/Auto.js.map +2 -2
- package/navigation/Drawer/__stories__/Default/index.js +1 -1
- package/navigation/Drawer/__stories__/Default.js.map +2 -2
- package/navigation/NavList/__stories__/UsingNavListAuto/index.js +23 -23
- package/navigation/NavList/__stories__/UsingNavListAuto.js.map +2 -2
- package/navigation/NavList/__stories__/Vertical/index.js +25 -17
- package/navigation/NavList/__stories__/Vertical.js.map +2 -2
- package/package.json +5 -6
- package/registry/index.js +12 -16
- package/registry.d.ts +7 -8
- package/registry.js.map +2 -2
- package/src/app/Footer/{index.mdx → doc.mdx} +7 -23
- package/src/app/Header/__snapshots__/index.spec.tsx.snap +42 -36
- package/src/app/Header/__stories__/WithServiceNameAndLogo.tsx +2 -2
- package/src/app/Header/doc.mdx +32 -0
- package/src/app/Loader/index.native.tsx +98 -0
- package/src/app/Loader/index.tsx +1 -1
- package/src/app/Loader/index.web.tsx +1 -0
- package/src/app/Masthead/Masthead.stories.js +1 -0
- package/src/app/Masthead/__stories__/Secondary.tsx +26 -0
- package/src/app/Masthead/{index.mdx → doc.mdx} +13 -1
- package/src/app/Masthead/index.test.tsx +4 -0
- package/src/app/Modal/{index.mdx → doc.mdx} +9 -6
- package/src/app/NotFound/{index.mdx → doc.mdx} +2 -4
- package/src/app/Panel/{index.mdx → doc.mdx} +3 -1
- package/src/app/PhaseBannerHeader/{index.mdx → doc.mdx} +3 -5
- package/src/app/QrCodeScanner/__snapshots__/index.spec.tsx.snap +6 -10
- package/src/app/QrCodeScanner/index.tsx +1 -0
- package/src/app/QrCodeViewer/{index.mdx → doc.mdx} +4 -12
- package/src/app/Skeleton/doc.mdx +42 -0
- package/src/content/Accordion/__snapshots__/index.spec.tsx.snap +48 -147
- package/src/content/Accordion/{index.mdx → doc.mdx} +2 -13
- package/src/content/Blockquote/__snapshots__/index.spec.tsx.snap +6 -9
- package/src/content/Blockquote/{index.mdx → doc.mdx} +5 -5
- package/src/content/Card/doc.mdx +71 -0
- package/src/content/Chip/doc.mdx +34 -0
- package/src/content/Details/__snapshots__/index.spec.tsx.snap +32 -69
- package/src/content/Details/{index.mdx → doc.mdx} +1 -5
- package/src/content/List/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/content/List/doc.mdx +28 -0
- package/src/content/StepNav/{index.mdx → doc.mdx} +5 -19
- package/src/content/SummaryList/__snapshots__/index.spec.tsx.snap +37 -89
- package/src/content/SummaryList/{index.mdx → doc.mdx} +6 -18
- package/src/content/Table/Table.stories.js +1 -1
- package/src/content/Table/__stories__/{Densed.tsx → Dense.tsx} +2 -2
- package/src/content/Table/doc.mdx +81 -0
- package/src/content/Table/index.test.tsx +3 -3
- package/src/content/TaskList/{index.mdx → doc.mdx} +4 -6
- package/src/content/Timeline/{index.mdx → doc.mdx} +4 -6
- package/src/feedback/CopyToClipboard/__stories__/Default.tsx +1 -1
- package/src/feedback/CopyToClipboard/doc.mdx +22 -0
- package/src/feedback/ErrorSummary/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/feedback/ErrorSummary/{index.mdx → doc.mdx} +6 -22
- package/src/feedback/NotificationBanner/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/feedback/NotificationBanner/{index.mdx → doc.mdx} +8 -19
- package/src/feedback/PhaseBanner/{index.mdx → doc.mdx} +2 -12
- package/src/feedback/WarningText/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/feedback/WarningText/{index.mdx → doc.mdx} +8 -6
- package/src/form/AutoComplete/doc.mdx +50 -0
- package/src/form/Button/__snapshots__/index.spec.tsx.snap +6 -10
- package/src/form/Button/{index.mdx → doc.mdx} +12 -27
- package/src/form/Checkbox/{index.mdx → doc.mdx} +10 -36
- package/src/form/DateInputContainer/__stories__/MultipleQuestions.tsx +1 -1
- package/src/form/DateInputContainer/{index.mdx → doc.mdx} +7 -21
- package/src/form/ErrorMessage/{index.mdx → doc.mdx} +1 -5
- package/src/form/FileUpload/{index.mdx → doc.mdx} +2 -10
- package/src/form/RadioContainer/{index.mdx → doc.mdx} +10 -36
- package/src/form/SearchContainer/SearchContainer.stories.js +9 -0
- package/src/form/SearchContainer/__stories__/Default.tsx +13 -0
- package/src/form/SearchContainer/doc.mdx +16 -0
- package/src/form/SearchContainer/index.test.tsx +20 -0
- package/src/form/SelectContainer/{index.mdx → doc.mdx} +3 -19
- package/src/form/SingleCharacterInputs/{index.mdx → doc.mdx} +3 -11
- package/src/form/TextArea/doc.mdx +48 -0
- package/src/form/TextInput/{index.mdx → doc.mdx} +12 -44
- package/src/i18n/locales/el.ts +15 -8
- package/src/layouts/Basic/Bottom/__stories__/Default.tsx +13 -9
- package/src/layouts/Basic/Bottom/{index.mdx → doc.mdx} +1 -5
- package/src/layouts/Basic/Container/__stories__/Default.tsx +15 -8
- package/src/layouts/Basic/Container/{index.mdx → doc.mdx} +1 -6
- package/src/layouts/Basic/Main/__stories__/Default.tsx +15 -8
- package/src/layouts/Basic/Main/{index.mdx → doc.mdx} +3 -5
- package/src/layouts/Basic/Top/__stories__/Default.tsx +13 -6
- package/src/layouts/Basic/Top/doc.mdx +19 -0
- package/src/layouts/Basic/__snapshots__/index.spec.tsx.snap +30 -102
- package/src/layouts/Basic/{index.mdx → doc.mdx} +7 -18
- package/src/layouts/Grid/doc.mdx +26 -0
- package/src/layouts/Stack/doc.mdx +38 -0
- package/src/lazy.js +5 -6
- package/src/navigation/BackLink/{index.mdx → doc.mdx} +1 -5
- package/src/navigation/Breadcrumbs/Breadcrumbs.stories.js +2 -0
- package/src/navigation/Breadcrumbs/__stories__/Auto.tsx +200 -0
- package/src/navigation/Breadcrumbs/__stories__/WithHook.tsx +217 -0
- package/src/navigation/Breadcrumbs/auto.tsx +72 -0
- package/src/navigation/Breadcrumbs/{index.mdx → doc.mdx} +5 -5
- package/src/navigation/Breadcrumbs/hooks.ts +66 -0
- package/src/navigation/Breadcrumbs/index.test.tsx +8 -0
- package/src/navigation/Breadcrumbs/index.tsx +3 -0
- package/src/navigation/Breadcrumbs/interaction.test.tsx +28 -4
- package/src/navigation/Breadcrumbs/slug.ts +141 -0
- package/src/navigation/Breadcrumbs/utils.ts +39 -0
- package/src/navigation/Drawer/__stories__/Auto.tsx +3 -1
- package/src/navigation/Drawer/__stories__/Default.tsx +2 -2
- package/src/navigation/Drawer/{index.mdx → doc.mdx} +5 -1
- package/src/navigation/Dropdown/{index.mdx → doc.mdx} +3 -15
- package/src/navigation/Link/__snapshots__/index.spec.tsx.snap +16 -30
- package/src/navigation/Link/{index.mdx → doc.mdx} +7 -19
- package/src/navigation/NavList/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/navigation/NavList/__stories__/UsingNavListAuto.tsx +26 -27
- package/src/navigation/NavList/__stories__/Vertical.tsx +16 -12
- package/src/navigation/NavList/{index.mdx → doc.mdx} +19 -22
- package/src/navigation/Pagination/doc.mdx +32 -0
- package/src/navigation/Tabs/doc.mdx +47 -0
- package/src/registry.js +12 -16
- package/src/typography/CodeBlock/doc.mdx +30 -0
- package/src/typography/Heading/{index.mdx → doc.mdx} +3 -5
- package/src/typography/HeadingCaption/{index.mdx → doc.mdx} +5 -5
- package/src/typography/Hint/{index.mdx → doc.mdx} +4 -10
- package/src/typography/NormalText/doc.mdx +30 -0
- package/src/typography/Paragraph/doc.mdx +34 -0
- package/src/typography/Typography/doc.mdx +14 -0
- package/src/utils/VisuallyHidden/{index.mdx → doc.mdx} +3 -6
- package/api/APIErrors/index.js +0 -40
- package/api/APIErrors.d.ts +0 -23
- package/api/APIErrors.js.map +0 -7
- package/api/APIProvider/index.js +0 -24
- package/api/APIProvider.d.ts +0 -16
- package/api/APIProvider.js.map +0 -7
- package/api/fetchAPI/index.js +0 -29
- package/api/fetchAPI.d.ts +0 -14
- package/api/fetchAPI.js.map +0 -7
- package/api/index.d.ts +0 -8
- package/api/index.js +0 -12
- package/api/index.js.map +0 -7
- package/api/index.spec.d.ts +0 -1
- package/api/useResource/index.js +0 -79
- package/api/useResource/package.json +0 -6
- package/api/useResource.d.ts +0 -11
- package/api/useResource.js.map +0 -7
- package/api/useResourceAction/index.js +0 -74
- package/api/useResourceAction/package.json +0 -6
- package/api/useResourceAction.d.ts +0 -2
- package/api/useResourceAction.js.map +0 -7
- package/api/useResourceQuery/index.js +0 -149
- package/api/useResourceQuery/package.json +0 -6
- package/api/useResourceQuery.d.ts +0 -18
- package/api/useResourceQuery.js.map +0 -7
- package/api/utils/index.js +0 -131
- package/api/utils/package.json +0 -6
- package/api/utils.d.ts +0 -10
- package/api/utils.js.map +0 -7
- package/cjs/api/APIErrors.js.map +0 -7
- package/cjs/api/APIProvider.js.map +0 -7
- package/cjs/api/fetchAPI/index.js +0 -49
- package/cjs/api/fetchAPI.js.map +0 -7
- package/cjs/api/index.js +0 -41
- package/cjs/api/index.js.map +0 -7
- package/cjs/api/useResource/index.js +0 -102
- package/cjs/api/useResource.js.map +0 -7
- package/cjs/api/useResourceAction/index.js +0 -97
- package/cjs/api/useResourceAction.js.map +0 -7
- package/cjs/api/useResourceQuery/index.js +0 -173
- package/cjs/api/useResourceQuery.js.map +0 -7
- package/cjs/api/utils/index.js +0 -157
- package/cjs/api/utils.js.map +0 -7
- package/content/Table/__stories__/Densed/package.json +0 -6
- package/content/Table/__stories__/Densed.d.ts +0 -3
- package/src/api/APIErrors.tsx +0 -46
- package/src/api/APIProvider.tsx +0 -31
- package/src/api/fetchAPI.ts +0 -43
- package/src/api/index.spec.tsx +0 -417
- package/src/api/index.tsx +0 -9
- package/src/api/introduction.md +0 -6
- package/src/api/useResource.tsx +0 -96
- package/src/api/useResourceAction.tsx +0 -80
- package/src/api/useResourceQuery.tsx +0 -178
- package/src/api/utils.tsx +0 -162
- package/src/app/Header/index.mdx +0 -49
- package/src/content/Card/index.mdx +0 -103
- package/src/content/Chip/index.mdx +0 -53
- package/src/content/List/index.mdx +0 -40
- package/src/content/Table/index.mdx +0 -111
- package/src/feedback/CopyToClipboard/index.mdx +0 -28
- package/src/form/AutoComplete/index.mdx +0 -70
- package/src/form/TextArea/index.mdx +0 -74
- package/src/govgr/Footer/index.mdx +0 -101
- package/src/layouts/Basic/Top/index.mdx +0 -23
- package/src/layouts/Grid/index.mdx +0 -39
- package/src/navigation/Pagination/index.mdx +0 -48
- package/src/navigation/Tabs/index.mdx +0 -31
- package/src/typography/NormalText/index.mdx +0 -44
- package/src/typography/Paragraph/index.mdx +0 -32
- package/src/typography/Typography/index.mdx +0 -12
- /package/src/utils/Base/{index.mdx → doc.mdx} +0 -0
|
@@ -14,57 +14,41 @@ application or saving their information.
|
|
|
14
14
|
|
|
15
15
|
Use a default button for the main call to action on a page.
|
|
16
16
|
|
|
17
|
-
<
|
|
17
|
+
<code src="@digigov/ui/form/Button/__stories__/Primary.tsx" />
|
|
18
18
|
|
|
19
19
|
### Start buttons
|
|
20
20
|
|
|
21
21
|
Use a start button for the main call to action on your service’s start page. Start buttons do not submit form data, so they use a link tag rather than a button tag.
|
|
22
22
|
|
|
23
|
-
<
|
|
24
|
-
packageName="@digigov/ui"
|
|
25
|
-
component="form/Button"
|
|
26
|
-
story="CallToActionButton.tsx"
|
|
27
|
-
/>
|
|
23
|
+
<code src="@digigov/ui/form/Button/__stories__/CallToActionButton.tsx" />
|
|
28
24
|
|
|
29
25
|
### Secondary buttons
|
|
30
26
|
|
|
31
27
|
Use secondary buttons for secondary calls to action on a page.
|
|
32
28
|
|
|
33
|
-
<
|
|
34
|
-
packageName="@digigov/ui"
|
|
35
|
-
component="form/Button"
|
|
36
|
-
story="Secondary.tsx"
|
|
37
|
-
/>
|
|
29
|
+
<code src="@digigov/ui/form/Button/__stories__/Secondary.tsx" />
|
|
38
30
|
|
|
39
31
|
### Warning buttons
|
|
40
32
|
|
|
41
33
|
Warning buttons are designed to make users think carefully before they use them. They only work if used very sparingly. Most services should not need one.
|
|
42
34
|
|
|
43
|
-
<
|
|
35
|
+
<code src="@digigov/ui/form/Button/__stories__/Warning.tsx" />
|
|
44
36
|
|
|
45
37
|
### Disable buttons
|
|
46
38
|
|
|
47
39
|
Disabled buttons have poor contrast and can confuse some users, so avoid them if possible.
|
|
48
40
|
|
|
49
|
-
<
|
|
41
|
+
<code src="@digigov/ui/form/Button/__stories__/Disabled.tsx" />
|
|
50
42
|
|
|
51
43
|
### Grouping buttons
|
|
52
44
|
|
|
53
45
|
Use a button group when two or more buttons are placed together.
|
|
54
46
|
|
|
55
|
-
<
|
|
56
|
-
packageName="@digigov/ui"
|
|
57
|
-
component="form/Button"
|
|
58
|
-
story="GroupingButtons.tsx"
|
|
59
|
-
/>
|
|
47
|
+
<code src="@digigov/ui/form/Button/__stories__/GroupingButtons.tsx" />
|
|
60
48
|
|
|
61
49
|
Any links within a button group will automatically align with the buttons.
|
|
62
50
|
|
|
63
|
-
<
|
|
64
|
-
packageName="@digigov/ui"
|
|
65
|
-
component="form/Button"
|
|
66
|
-
story="GroupingButtonsAndLinks.tsx"
|
|
67
|
-
/>
|
|
51
|
+
<code src="@digigov/ui/form/Button/__stories__/GroupingButtonsAndLinks.tsx" />
|
|
68
52
|
|
|
69
53
|
Write button text in sentence case, describing the action it performs. For
|
|
70
54
|
example:
|
|
@@ -91,14 +75,12 @@ Align the primary action button to the left edge of your form.
|
|
|
91
75
|
|
|
92
76
|
Use a default button for the main call to action on a page.
|
|
93
77
|
|
|
78
|
+
<code src="@digigov/ui/form/Button/__stories__/Primary.tsx" />
|
|
79
|
+
|
|
94
80
|
Avoid using multiple default buttons on a single page. Having more than on main
|
|
95
81
|
call to action reduces their impact, and makes it harder for users to know what
|
|
96
82
|
to do next.
|
|
97
83
|
|
|
98
|
-
## API Docs
|
|
99
|
-
|
|
100
|
-
Read more about [how to use the React types](/docs/api/Button).
|
|
101
|
-
|
|
102
84
|
## Accessibility
|
|
103
85
|
|
|
104
86
|
You can read more about the accessibility patterns used in our Button
|
|
@@ -106,6 +88,9 @@ implementation in the ARIA Authoring Practices Guide (APG) at [button](https://w
|
|
|
106
88
|
|
|
107
89
|
## API
|
|
108
90
|
|
|
91
|
+
Read more about [how to use the React types](/docs/api/Button).
|
|
92
|
+
|
|
109
93
|
See below for a complete reference to all of the props available to the components mentioned here.
|
|
110
94
|
|
|
111
95
|
<ComponentProps componentName={["Button","ButtonLink","CallToAction","ButtonGroup"]} />
|
|
96
|
+
|
|
@@ -7,57 +7,35 @@ title: Checkbox
|
|
|
7
7
|
|
|
8
8
|
## How to use
|
|
9
9
|
|
|
10
|
-
<
|
|
11
|
-
packageName="@digigov/ui"
|
|
12
|
-
component="form/Checkbox"
|
|
13
|
-
story="Default.tsx"
|
|
14
|
-
/>
|
|
10
|
+
<code src="@digigov/ui/form/Checkbox/__stories__/Default.tsx" />
|
|
15
11
|
|
|
16
|
-
###
|
|
12
|
+
### For multiple questions
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
story="MultipleQuestions.tsx"
|
|
22
|
-
/>
|
|
14
|
+
If you’re asking more than one question on the page, you can display the question's title using `<FieldsetLegend size="sm">`.
|
|
15
|
+
|
|
16
|
+
<code src="@digigov/ui/form/Checkbox/__stories__/MultipleQuestions.tsx" />
|
|
23
17
|
|
|
24
18
|
### Checkbox items with hints
|
|
25
19
|
|
|
26
20
|
You can add hints to checkbox items to provide additional information about the options.
|
|
27
21
|
|
|
28
|
-
<
|
|
29
|
-
packageName="@digigov/ui"
|
|
30
|
-
component="form/Checkbox"
|
|
31
|
-
story="WithHint.tsx"
|
|
32
|
-
/>
|
|
22
|
+
<code src="@digigov/ui/form/Checkbox/__stories__/WithHint.tsx" />
|
|
33
23
|
|
|
34
24
|
### Add an option for ‘none’
|
|
35
25
|
|
|
36
26
|
When ‘none’ would be a valid answer, give users the option to check a box to say none of the other options apply to them — without this option, users would have to leave all of the boxes unchecked. Giving users this option also makes sure they do not skip the question by accident.
|
|
37
27
|
|
|
38
|
-
<
|
|
39
|
-
packageName="@digigov/ui"
|
|
40
|
-
component="form/Checkbox"
|
|
41
|
-
story="NoneAnswer.tsx"
|
|
42
|
-
/>
|
|
28
|
+
<code src="@digigov/ui/form/Checkbox/__stories__/NoneAnswer.tsx" />
|
|
43
29
|
|
|
44
30
|
If JavaScript is unavailable, and a user selects both the ‘none’ checkbox and another checkbox, display an error message.
|
|
45
31
|
|
|
46
|
-
<
|
|
47
|
-
packageName="@digigov/ui"
|
|
48
|
-
component="form/Checkbox"
|
|
49
|
-
story="NoneAnswerWithError.tsx"
|
|
50
|
-
/>
|
|
32
|
+
<code src="@digigov/ui/form/Checkbox/__stories__/NoneAnswerWithError.tsx" />
|
|
51
33
|
|
|
52
34
|
### Error messages
|
|
53
35
|
|
|
54
36
|
Error messages should be styled like this:
|
|
55
37
|
|
|
56
|
-
<
|
|
57
|
-
packageName="@digigov/ui"
|
|
58
|
-
component="form/Checkbox"
|
|
59
|
-
story="WithErrorMessage.tsx"
|
|
60
|
-
/>
|
|
38
|
+
<code src="@digigov/ui/form/Checkbox/__stories__/WithErrorMessage.tsx" />
|
|
61
39
|
|
|
62
40
|
## Conditionally revealing a related question
|
|
63
41
|
|
|
@@ -65,11 +43,7 @@ You can ask the user a related question when they select a particular checkbox,
|
|
|
65
43
|
|
|
66
44
|
This might make 2 related questions easier to answer by grouping them on the same page. For example, you could reveal a phone number input when the user selects the ‘Contact me by phone’ option.
|
|
67
45
|
|
|
68
|
-
<
|
|
69
|
-
packageName="@digigov/ui"
|
|
70
|
-
component="form/Checkbox"
|
|
71
|
-
story="ConditionalReveal.tsx"
|
|
72
|
-
/>
|
|
46
|
+
<code src="@digigov/ui/form/Checkbox/__stories__/ConditionalReveal.tsx" />
|
|
73
47
|
|
|
74
48
|
## Accessibility
|
|
75
49
|
|
|
@@ -16,7 +16,7 @@ import { Hint } from '@digigov/ui/typography/Hint';
|
|
|
16
16
|
export const MultipleQuestions = () => (
|
|
17
17
|
<FieldContainer aria-describedby="passport-hint">
|
|
18
18
|
<Fieldset>
|
|
19
|
-
<FieldsetLegend size="
|
|
19
|
+
<FieldsetLegend size="sm">
|
|
20
20
|
Πότε εκδόθηκε το διαβατήριό σας;
|
|
21
21
|
</FieldsetLegend>
|
|
22
22
|
<Hint id="passport-hint">Για παράδειγμα, 05 11 2020</Hint>
|
|
@@ -7,37 +7,23 @@ title: DateInputContainer
|
|
|
7
7
|
|
|
8
8
|
## How to use
|
|
9
9
|
|
|
10
|
-
<
|
|
11
|
-
packageName="@digigov/ui"
|
|
12
|
-
component="form/DateInputContainer"
|
|
13
|
-
story="Default.tsx"
|
|
14
|
-
/>
|
|
10
|
+
<code src="@digigov/ui/form/DateInputContainer/__stories__/Default.tsx" />
|
|
15
11
|
|
|
16
|
-
###
|
|
12
|
+
### For multiple questions
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
story="MultipleQuestions.tsx"
|
|
22
|
-
/>
|
|
14
|
+
If you’re asking more than one question on the page, you can display the question's title using `<FieldsetLegend size="sm">`.
|
|
15
|
+
|
|
16
|
+
<code src="@digigov/ui/form/DateInputContainer/__stories__/MultipleQuestions.tsx" />
|
|
23
17
|
|
|
24
18
|
### Error message
|
|
25
19
|
|
|
26
20
|
If you’re highlighting the whole date, style all the fields like this:
|
|
27
21
|
|
|
28
|
-
<
|
|
29
|
-
packageName="@digigov/ui"
|
|
30
|
-
component="form/DateInputContainer"
|
|
31
|
-
story="WithErrorMessage.tsx"
|
|
32
|
-
/>
|
|
22
|
+
<code src="@digigov/ui/form/DateInputContainer/__stories__/WithErrorMessage.tsx" />
|
|
33
23
|
|
|
34
24
|
If you’re highlighting just one field - either the day, month or year - only style the field that has an error. The error message must say which field has an error, like this:
|
|
35
25
|
|
|
36
|
-
<
|
|
37
|
-
packageName="@digigov/ui"
|
|
38
|
-
component="form/DateInputContainer"
|
|
39
|
-
story="WithErrorMessageForSingleField.tsx"
|
|
40
|
-
/>
|
|
26
|
+
<code src="@digigov/ui/form/DateInputContainer/__stories__/WithErrorMessageForSingleField.tsx" />
|
|
41
27
|
|
|
42
28
|
## API
|
|
43
29
|
|
|
@@ -10,11 +10,7 @@ In the error message explain what went wrong and how to fix it.
|
|
|
10
10
|
|
|
11
11
|
## How to use
|
|
12
12
|
|
|
13
|
-
<
|
|
14
|
-
packageName="@digigov/ui"
|
|
15
|
-
component="form/ErrorMessage"
|
|
16
|
-
story="Default.tsx"
|
|
17
|
-
/>
|
|
13
|
+
<code src="@digigov/ui/form/ErrorMessage/__stories__/Default.tsx" />
|
|
18
14
|
|
|
19
15
|
## API
|
|
20
16
|
|
|
@@ -7,21 +7,13 @@ title: FileUpload
|
|
|
7
7
|
|
|
8
8
|
## How to use
|
|
9
9
|
|
|
10
|
-
<
|
|
11
|
-
packageName="@digigov/ui"
|
|
12
|
-
component="form/FileUpload"
|
|
13
|
-
story="Default.tsx"
|
|
14
|
-
/>
|
|
10
|
+
<code src="@digigov/ui/form/FileUpload/__stories__/Default.tsx" />
|
|
15
11
|
|
|
16
12
|
### Error message
|
|
17
13
|
|
|
18
14
|
Error messages should be styled like this:
|
|
19
15
|
|
|
20
|
-
<
|
|
21
|
-
packageName="@digigov/ui"
|
|
22
|
-
component="form/FileUpload"
|
|
23
|
-
story="WithErrorMessage.tsx"
|
|
24
|
-
/>
|
|
16
|
+
<code src="@digigov/ui/form/FileUpload/__stories__/WithErrorMessage.tsx" />
|
|
25
17
|
|
|
26
18
|
## API
|
|
27
19
|
|
|
@@ -7,48 +7,30 @@ title: RadioContainer
|
|
|
7
7
|
|
|
8
8
|
## How to use
|
|
9
9
|
|
|
10
|
-
<
|
|
11
|
-
packageName="@digigov/ui"
|
|
12
|
-
component="form/RadioContainer"
|
|
13
|
-
story="Default.tsx"
|
|
14
|
-
/>
|
|
10
|
+
<code src="@digigov/ui/form/RadioContainer/__stories__/Default.tsx" />
|
|
15
11
|
|
|
16
|
-
###
|
|
12
|
+
### For multiple questions
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
story="MultipleQuestions.tsx"
|
|
22
|
-
/>
|
|
14
|
+
If you’re asking more than one question on the page, you can display the question's title using `<FieldsetLegend size="sm">`.
|
|
15
|
+
|
|
16
|
+
<code src="@digigov/ui/form/RadioContainer/__stories__/MultipleQuestions.tsx" />
|
|
23
17
|
|
|
24
18
|
### Inline radios
|
|
25
19
|
|
|
26
|
-
<
|
|
27
|
-
packageName="@digigov/ui"
|
|
28
|
-
component="form/RadioContainer"
|
|
29
|
-
story="Inline.tsx"
|
|
30
|
-
/>
|
|
20
|
+
<code src="@digigov/ui/form/RadioContainer/__stories__/Inline.tsx" />
|
|
31
21
|
|
|
32
22
|
### Checkbox items with hints
|
|
33
23
|
|
|
34
24
|
You can add hints to checkbox items to provide additional information about the options.
|
|
35
25
|
|
|
36
|
-
<
|
|
37
|
-
packageName="@digigov/ui"
|
|
38
|
-
component="form/RadioContainer"
|
|
39
|
-
story="WithHints.tsx"
|
|
40
|
-
/>
|
|
26
|
+
<code src="@digigov/ui/form/RadioContainer/__stories__/WithHints.tsx" />
|
|
41
27
|
|
|
42
28
|
### RadioContainer items with a text divider
|
|
43
29
|
|
|
44
30
|
If one or more of your radio options is different from the others, it can help users if you separate them using a text divider.
|
|
45
31
|
The text is usually the word ‘or’.
|
|
46
32
|
|
|
47
|
-
<
|
|
48
|
-
packageName="@digigov/ui"
|
|
49
|
-
component="form/RadioContainer"
|
|
50
|
-
story="NoneAnswer.tsx"
|
|
51
|
-
/>
|
|
33
|
+
<code src="@digigov/ui/form/RadioContainer/__stories__/NoneAnswer.tsx" />
|
|
52
34
|
|
|
53
35
|
## Conditionally revealing a related question
|
|
54
36
|
|
|
@@ -56,21 +38,13 @@ You can ask the user a related question when they select a particular checkbox,
|
|
|
56
38
|
|
|
57
39
|
This might make 2 related questions easier to answer by grouping them on the same page. For example, you could reveal a phone number input when the user selects the ‘Contact me by phone’ option.
|
|
58
40
|
|
|
59
|
-
<
|
|
60
|
-
packageName="@digigov/ui"
|
|
61
|
-
component="form/RadioContainer"
|
|
62
|
-
story="ConditionalReveal.tsx"
|
|
63
|
-
/>
|
|
41
|
+
<code src="@digigov/ui/form/RadioContainer/__stories__/ConditionalReveal.tsx" />
|
|
64
42
|
|
|
65
43
|
### Error messages
|
|
66
44
|
|
|
67
45
|
Error messages should be styled like this:
|
|
68
46
|
|
|
69
|
-
<
|
|
70
|
-
packageName="@digigov/ui"
|
|
71
|
-
component="form/RadioContainer"
|
|
72
|
-
story="WithErrorMessage.tsx"
|
|
73
|
-
/>
|
|
47
|
+
<code src="@digigov/ui/form/RadioContainer/__stories__/WithErrorMessage.tsx" />
|
|
74
48
|
|
|
75
49
|
## Accessibility
|
|
76
50
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import SearchContainer from '@digigov/ui/form/SearchContainer';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Digigov UI/form/SearchContainer',
|
|
4
|
+
description:
|
|
5
|
+
'The SearchContainer component encapsulates the TextInput and SearchButton, providing a comprehensive search functionality.',
|
|
6
|
+
component: SearchContainer,
|
|
7
|
+
displayName: 'SearchContainer',
|
|
8
|
+
};
|
|
9
|
+
export { Default } from '@digigov/ui/form/SearchContainer/__stories__/Default';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SearchContainer } from '@digigov/ui/form/SearchContainer';
|
|
3
|
+
import { SearchButton } from '@digigov/ui/form/SearchContainer';
|
|
4
|
+
import { TextInput } from '@digigov/ui/form/TextInput';
|
|
5
|
+
|
|
6
|
+
export const Default = () => (
|
|
7
|
+
<SearchContainer>
|
|
8
|
+
<TextInput />
|
|
9
|
+
<SearchButton />
|
|
10
|
+
</SearchContainer>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default Default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: search-container
|
|
3
|
+
title: SearchContainer
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SearchContainer
|
|
7
|
+
|
|
8
|
+
## How to use
|
|
9
|
+
|
|
10
|
+
<code src="@digigov/ui/form/SearchContainer/__stories__/Default.tsx" />
|
|
11
|
+
|
|
12
|
+
## API
|
|
13
|
+
|
|
14
|
+
See below for a complete reference to all of the props available to the components mentioned here.
|
|
15
|
+
|
|
16
|
+
<ComponentProps componentName={["SearchContainer","SearchButton"]} />
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { test, expect } from '@playwright/experimental-ct-react';
|
|
3
|
+
import TestVariant from '@digigov/ui/utils/TestVariant'
|
|
4
|
+
import { Default } from '@digigov/ui/form/SearchContainer/__stories__/Default';
|
|
5
|
+
|
|
6
|
+
test('renders the All SearchContainer variants', async ({ mount, page }) => {
|
|
7
|
+
await mount(
|
|
8
|
+
|
|
9
|
+
<div>
|
|
10
|
+
<TestVariant title="Default">
|
|
11
|
+
<Default />
|
|
12
|
+
</TestVariant>
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
await page.evaluate(() => document.fonts.ready);
|
|
16
|
+
|
|
17
|
+
const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
|
|
18
|
+
expect(screenshot).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
|
|
@@ -5,37 +5,21 @@ title: SelectContainer
|
|
|
5
5
|
|
|
6
6
|
# SelectContainer
|
|
7
7
|
|
|
8
|
-
```bash
|
|
9
|
-
import SelectContainer from '@digigov/ui/form/SelectContainer';
|
|
10
|
-
```
|
|
11
|
-
|
|
12
8
|
## How to use
|
|
13
9
|
|
|
14
|
-
<
|
|
15
|
-
packageName="@digigov/ui"
|
|
16
|
-
component="form/SelectContainer"
|
|
17
|
-
story="Default.tsx"
|
|
18
|
-
/>
|
|
10
|
+
<code src="@digigov/ui/form/SelectContainer/__stories__/Default.tsx" />
|
|
19
11
|
|
|
20
12
|
### SelectContainer with hints
|
|
21
13
|
|
|
22
14
|
You can add hints to select items to provide additional information about the options.
|
|
23
15
|
|
|
24
|
-
<
|
|
25
|
-
packageName="@digigov/ui"
|
|
26
|
-
component="form/SelectContainer"
|
|
27
|
-
story="WithHint.tsx"
|
|
28
|
-
/>
|
|
16
|
+
<code src="@digigov/ui/form/SelectContainer/__stories__/WithHint.tsx" />
|
|
29
17
|
|
|
30
18
|
### Disabled input
|
|
31
19
|
|
|
32
20
|
Error messages should be styled like this:
|
|
33
21
|
|
|
34
|
-
<
|
|
35
|
-
packageName="@digigov/ui"
|
|
36
|
-
component="form/SelectContainer"
|
|
37
|
-
story="DisabledInput.tsx"
|
|
38
|
-
/>
|
|
22
|
+
<code src="@digigov/ui/form/SelectContainer/__stories__/DisabledInput.tsx" />
|
|
39
23
|
|
|
40
24
|
## Accessibility
|
|
41
25
|
|
|
@@ -7,21 +7,13 @@ title: SingleCharacterInputs
|
|
|
7
7
|
|
|
8
8
|
## How to use
|
|
9
9
|
|
|
10
|
-
<
|
|
11
|
-
packageName="@digigov/ui"
|
|
12
|
-
component="form/SingleCharacterInputs"
|
|
13
|
-
story="Default.tsx"
|
|
14
|
-
/>
|
|
10
|
+
<code src="@digigov/ui/form/SingleCharacterInputs/__stories__/Default.tsx" />
|
|
15
11
|
|
|
16
12
|
### Error message
|
|
17
13
|
|
|
18
|
-
If you’re highlighting the
|
|
14
|
+
If you’re highlighting all the digits of the password, style the fields like this:
|
|
19
15
|
|
|
20
|
-
<
|
|
21
|
-
packageName="@digigov/ui"
|
|
22
|
-
component="form/SingleCharacterInputs"
|
|
23
|
-
story="WithDefaultError.tsx"
|
|
24
|
-
/>
|
|
16
|
+
<code src="@digigov/ui/form/SingleCharacterInputs/__stories__/WithDefaultError.tsx" />
|
|
25
17
|
|
|
26
18
|
## API
|
|
27
19
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: text-area
|
|
3
|
+
title: TextArea
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TextArea
|
|
7
|
+
|
|
8
|
+
## How to use
|
|
9
|
+
|
|
10
|
+
<code src="@digigov/ui/form/TextArea/__stories__/Default.tsx" />
|
|
11
|
+
|
|
12
|
+
### Use appropriately-sized textarea inputs
|
|
13
|
+
|
|
14
|
+
<code src="@digigov/ui/form/TextArea/__stories__/WithDeclaredRows.tsx" />
|
|
15
|
+
|
|
16
|
+
### For multiple questions
|
|
17
|
+
|
|
18
|
+
If you’re asking more than one question on the page, you can display directly the question's title without using the component `LabelTitle`.
|
|
19
|
+
|
|
20
|
+
<code src="@digigov/ui/form/TextArea/__stories__/MultipleQuestions.tsx" />
|
|
21
|
+
|
|
22
|
+
### Limiting the number of characters
|
|
23
|
+
|
|
24
|
+
If there’s a good reason to limit the number of characters users can enter, you can use the character count component.
|
|
25
|
+
|
|
26
|
+
<code src="@digigov/ui/form/TextArea/__stories__/LimitedCharacters.tsx" />
|
|
27
|
+
|
|
28
|
+
### Hint text
|
|
29
|
+
|
|
30
|
+
Use hint text for help that’s relevant to the majority of users, like how their information will be used, or where to find it.
|
|
31
|
+
|
|
32
|
+
<code src="@digigov/ui/form/TextArea/__stories__/WithHint.tsx" />
|
|
33
|
+
|
|
34
|
+
### Error message
|
|
35
|
+
|
|
36
|
+
Error messages should be styled like this:
|
|
37
|
+
|
|
38
|
+
<code src="@digigov/ui/form/TextArea/__stories__/WithErrorMessage.tsx" />
|
|
39
|
+
|
|
40
|
+
### Disabled input
|
|
41
|
+
|
|
42
|
+
<code src="@digigov/ui/form/TextArea/__stories__/DisabledInput.tsx" />
|
|
43
|
+
|
|
44
|
+
## API
|
|
45
|
+
|
|
46
|
+
See below for a complete reference to all of the props available to the components mentioned here.
|
|
47
|
+
|
|
48
|
+
<ComponentProps componentName={["TextArea"]} />
|
|
@@ -7,19 +7,13 @@ title: TextInput
|
|
|
7
7
|
|
|
8
8
|
## How to use
|
|
9
9
|
|
|
10
|
-
<
|
|
11
|
-
packageName="@digigov/ui"
|
|
12
|
-
component="form/TextInput"
|
|
13
|
-
story="Default.tsx"
|
|
14
|
-
/>
|
|
10
|
+
<code src="@digigov/ui/form/TextInput/__stories__/Default.tsx" />
|
|
15
11
|
|
|
16
|
-
###
|
|
12
|
+
### For multiple questions
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
story="MultipleQuestions.tsx"
|
|
22
|
-
/>
|
|
14
|
+
If you’re asking more than one question on the page, you can display directly the question's title without using the component `LabelTitle`.
|
|
15
|
+
|
|
16
|
+
<code src="@digigov/ui/form/TextInput/__stories__/MultipleQuestions.tsx" />
|
|
23
17
|
|
|
24
18
|
### Fixed width inputs
|
|
25
19
|
|
|
@@ -29,59 +23,33 @@ The widths are designed for specific character lengths and to be consistent acro
|
|
|
29
23
|
|
|
30
24
|
On fixed width inputs, the width will remain fixed on all screens unless it is wider than the viewport, in which case it will shrink to fit.
|
|
31
25
|
|
|
32
|
-
<
|
|
33
|
-
packageName="@digigov/ui"
|
|
34
|
-
component="form/TextInput"
|
|
35
|
-
story="FixedWidths.tsx"
|
|
36
|
-
/>
|
|
26
|
+
<code src="@digigov/ui/form/TextInput/__stories__/FixedWidths.tsx" />
|
|
37
27
|
|
|
38
28
|
### Fluid width inputs
|
|
39
29
|
|
|
40
30
|
Fluid width inputs will resize with the viewport.
|
|
41
31
|
|
|
42
|
-
<
|
|
43
|
-
packageName="@digigov/ui"
|
|
44
|
-
component="form/TextInput"
|
|
45
|
-
story="FluidWidths.tsx"
|
|
46
|
-
/>
|
|
32
|
+
<code src="@digigov/ui/form/TextInput/__stories__/FluidWidths.tsx" />
|
|
47
33
|
|
|
48
34
|
### Hint text
|
|
49
35
|
|
|
50
36
|
Use hint text for help that’s relevant to the majority of users, like how their information will be used, or where to find it.
|
|
51
37
|
|
|
52
|
-
<
|
|
53
|
-
packageName="@digigov/ui"
|
|
54
|
-
component="form/TextInput"
|
|
55
|
-
story="WithHint.tsx"
|
|
56
|
-
/>
|
|
57
|
-
|
|
58
|
-
## Numbers
|
|
38
|
+
<code src="@digigov/ui/form/TextInput/__stories__/WithHint.tsx" />
|
|
59
39
|
|
|
60
|
-
### Asking for
|
|
40
|
+
### Asking for numbers
|
|
61
41
|
|
|
62
|
-
<
|
|
63
|
-
packageName="@digigov/ui"
|
|
64
|
-
component="form/TextInput"
|
|
65
|
-
story="AskingForNumbers.tsx"
|
|
66
|
-
/>
|
|
42
|
+
<code src="@digigov/ui/form/TextInput/__stories__/AskingForNumbers.tsx" />
|
|
67
43
|
|
|
68
44
|
### Error message
|
|
69
45
|
|
|
70
46
|
Error messages should be styled like this:
|
|
71
47
|
|
|
72
|
-
<
|
|
73
|
-
packageName="@digigov/ui"
|
|
74
|
-
component="form/TextInput"
|
|
75
|
-
story="WithErrorMessage.tsx"
|
|
76
|
-
/>
|
|
48
|
+
<code src="@digigov/ui/form/TextInput/__stories__/WithErrorMessage.tsx" />
|
|
77
49
|
|
|
78
50
|
### Disabled input
|
|
79
51
|
|
|
80
|
-
<
|
|
81
|
-
packageName="@digigov/ui"
|
|
82
|
-
component="form/TextInput"
|
|
83
|
-
story="DisabledInput.tsx"
|
|
84
|
-
/>
|
|
52
|
+
<code src="@digigov/ui/form/TextInput/__stories__/DisabledInput.tsx" />
|
|
85
53
|
|
|
86
54
|
## API
|
|
87
55
|
|