@digigov/ui 0.32.0 → 0.32.2
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/CHANGELOG.md +16 -1
- package/admin/AccessibilityMenu/index.d.ts +6 -0
- package/admin/AccessibilityMenu/index.js +85 -30
- package/admin/AutoComplete/index.mdx +8 -30
- package/admin/CopyToClipboard/index.mdx +1 -5
- package/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
- package/admin/Dropdown/__stories__/AlignRight.js +1 -2
- package/admin/Dropdown/__stories__/Default.js +1 -3
- package/admin/Dropdown/__stories__/PlacementTop.js +1 -2
- package/admin/Dropdown/index.mdx +3 -15
- package/admin/Modal/Modal.stories.playwright.json +37 -0
- package/admin/Modal/__stories__/AlertDialog.js +36 -12
- package/admin/Modal/__stories__/Default.js +34 -10
- package/admin/Modal/index.mdx +1 -5
- package/app/Footer/Footer.mdx +3 -14
- package/app/Header/index.mdx +3 -16
- package/app/QrCodeViewer/index.mdx +1 -5
- package/core/Accordion/index.d.ts +5 -1
- package/core/Accordion/index.js +46 -13
- package/core/Accordion/index.mdx +2 -10
- package/core/Button/__stories__/GroupingButtons.d.ts +1 -0
- package/core/Button/__stories__/GroupingButtons.js +4 -2
- package/core/Button/__stories__/GroupingButtonsAndLinks.d.ts +1 -0
- package/core/Button/__stories__/GroupingButtonsAndLinks.js +4 -2
- package/core/Button/__stories__/Warning.d.ts +1 -0
- package/core/Button/__stories__/Warning.js +4 -2
- package/core/Button/index.mdx +4 -20
- package/core/Card/card.mdx +7 -35
- package/core/Checkbox/checkbox.mdx +6 -30
- package/core/DateInputContainer/index.mdx +4 -20
- package/core/ErrorSummary/index.mdx +3 -15
- package/core/FileUpload/index.mdx +1 -5
- package/core/Link/link.mdx +4 -20
- package/core/List/index.mdx +1 -5
- package/core/NavList/index.mdx +1 -5
- package/core/NotificationBanner/index.mdx +1 -5
- package/core/PhaseBanner/index.mdx +1 -4
- package/core/RadioContainer/index.mdx +6 -30
- package/core/SelectContainer/index.mdx +3 -15
- package/core/SingleCharacterInputContainer/index.mdx +7 -10
- package/core/SummaryList/index.mdx +2 -10
- package/core/Table/index.mdx +6 -30
- package/core/TextArea/index.mdx +6 -30
- package/core/TextInput/index.mdx +6 -30
- package/core/index.d.ts +1 -0
- package/core/index.js +13 -0
- package/es/admin/AccessibilityMenu/index.js +49 -0
- package/es/admin/AutoComplete/index.mdx +8 -30
- package/es/admin/CopyToClipboard/index.mdx +1 -5
- package/es/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
- package/es/admin/Dropdown/__stories__/AlignRight.js +1 -2
- package/es/admin/Dropdown/__stories__/Default.js +1 -3
- package/es/admin/Dropdown/__stories__/PlacementTop.js +1 -2
- package/es/admin/Dropdown/index.mdx +3 -15
- package/es/admin/Modal/Modal.stories.playwright.json +37 -0
- package/es/admin/Modal/__stories__/AlertDialog.js +29 -12
- package/es/admin/Modal/__stories__/Default.js +27 -10
- package/es/admin/Modal/index.mdx +1 -5
- package/es/app/Footer/Footer.mdx +3 -14
- package/es/app/Header/index.mdx +3 -16
- package/es/app/QrCodeViewer/index.mdx +1 -5
- package/es/core/Accordion/index.js +40 -6
- package/es/core/Accordion/index.mdx +2 -10
- package/es/core/Button/__stories__/GroupingButtons.js +2 -1
- package/es/core/Button/__stories__/GroupingButtonsAndLinks.js +2 -1
- package/es/core/Button/__stories__/Warning.js +2 -1
- package/es/core/Button/index.mdx +4 -20
- package/es/core/Card/card.mdx +7 -35
- package/es/core/Checkbox/checkbox.mdx +6 -30
- package/es/core/DateInputContainer/index.mdx +4 -20
- package/es/core/ErrorSummary/index.mdx +3 -15
- package/es/core/FileUpload/index.mdx +1 -5
- package/es/core/Link/link.mdx +4 -20
- package/es/core/List/index.mdx +1 -5
- package/es/core/NavList/index.mdx +1 -5
- package/es/core/NotificationBanner/index.mdx +1 -5
- package/es/core/PhaseBanner/index.mdx +1 -4
- package/es/core/RadioContainer/index.mdx +6 -30
- package/es/core/SelectContainer/index.mdx +3 -15
- package/es/core/SingleCharacterInputContainer/index.mdx +7 -10
- package/es/core/SummaryList/index.mdx +2 -10
- package/es/core/Table/index.mdx +6 -30
- package/es/core/TextArea/index.mdx +6 -30
- package/es/core/TextInput/index.mdx +6 -30
- package/es/core/index.js +1 -0
- package/es/typography/HeadingCaption/index.mdx +1 -5
- package/es/typography/Hint/index.mdx +1 -5
- package/es/typography/NormalText/index.mdx +3 -15
- package/es/typography/Paragraph/index.mdx +3 -15
- package/esm/admin/AccessibilityMenu/index.js +49 -0
- package/esm/admin/AutoComplete/index.mdx +8 -30
- package/esm/admin/CopyToClipboard/index.mdx +1 -5
- package/esm/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
- package/esm/admin/Dropdown/__stories__/AlignRight.js +1 -2
- package/esm/admin/Dropdown/__stories__/Default.js +1 -3
- package/esm/admin/Dropdown/__stories__/PlacementTop.js +1 -2
- package/esm/admin/Dropdown/index.mdx +3 -15
- package/esm/admin/Modal/Modal.stories.playwright.json +37 -0
- package/esm/admin/Modal/__stories__/AlertDialog.js +29 -12
- package/esm/admin/Modal/__stories__/Default.js +27 -10
- package/esm/admin/Modal/index.mdx +1 -5
- package/esm/app/Footer/Footer.mdx +3 -14
- package/esm/app/Header/index.mdx +3 -16
- package/esm/app/QrCodeViewer/index.mdx +1 -5
- package/esm/core/Accordion/index.js +40 -6
- package/esm/core/Accordion/index.mdx +2 -10
- package/esm/core/Button/__stories__/GroupingButtons.js +2 -1
- package/esm/core/Button/__stories__/GroupingButtonsAndLinks.js +2 -1
- package/esm/core/Button/__stories__/Warning.js +2 -1
- package/esm/core/Button/index.mdx +4 -20
- package/esm/core/Card/card.mdx +7 -35
- package/esm/core/Checkbox/checkbox.mdx +6 -30
- package/esm/core/DateInputContainer/index.mdx +4 -20
- package/esm/core/ErrorSummary/index.mdx +3 -15
- package/esm/core/FileUpload/index.mdx +1 -5
- package/esm/core/Link/link.mdx +4 -20
- package/esm/core/List/index.mdx +1 -5
- package/esm/core/NavList/index.mdx +1 -5
- package/esm/core/NotificationBanner/index.mdx +1 -5
- package/esm/core/PhaseBanner/index.mdx +1 -4
- package/esm/core/RadioContainer/index.mdx +6 -30
- package/esm/core/SelectContainer/index.mdx +3 -15
- package/esm/core/SingleCharacterInputContainer/index.mdx +7 -10
- package/esm/core/SummaryList/index.mdx +2 -10
- package/esm/core/Table/index.mdx +6 -30
- package/esm/core/TextArea/index.mdx +6 -30
- package/esm/core/TextInput/index.mdx +6 -30
- package/esm/core/index.js +1 -0
- package/esm/index.js +1 -1
- package/esm/typography/HeadingCaption/index.mdx +1 -5
- package/esm/typography/Hint/index.mdx +1 -5
- package/esm/typography/NormalText/index.mdx +3 -15
- package/esm/typography/Paragraph/index.mdx +3 -15
- package/package.json +3 -3
- package/src/admin/AccessibilityMenu/index.tsx +52 -0
- package/src/admin/AutoComplete/index.mdx +8 -30
- package/src/admin/CopyToClipboard/index.mdx +1 -5
- package/src/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
- package/src/admin/Dropdown/__stories__/AlignRight.tsx +1 -1
- package/src/admin/Dropdown/__stories__/Default.tsx +1 -1
- package/src/admin/Dropdown/__stories__/PlacementTop.tsx +1 -1
- package/src/admin/Dropdown/index.mdx +3 -15
- package/src/admin/Modal/Modal.stories.playwright.json +37 -0
- package/src/admin/Modal/__stories__/AlertDialog.tsx +18 -3
- package/src/admin/Modal/__stories__/Default.tsx +18 -3
- package/src/admin/Modal/index.mdx +1 -5
- package/src/app/Footer/Footer.mdx +3 -14
- package/src/app/Header/index.mdx +3 -16
- package/src/app/QrCodeViewer/index.mdx +1 -5
- package/src/core/Accordion/index.mdx +2 -10
- package/src/core/Accordion/index.tsx +38 -4
- package/src/core/Button/__stories__/GroupingButtons.tsx +1 -0
- package/src/core/Button/__stories__/GroupingButtonsAndLinks.tsx +1 -0
- package/src/core/Button/__stories__/Warning.tsx +1 -0
- package/src/core/Button/index.mdx +4 -20
- package/src/core/Card/card.mdx +7 -35
- package/src/core/Checkbox/checkbox.mdx +6 -30
- package/src/core/DateInputContainer/index.mdx +4 -20
- package/src/core/ErrorSummary/index.mdx +3 -15
- package/src/core/FileUpload/index.mdx +1 -5
- package/src/core/Link/link.mdx +4 -20
- package/src/core/List/index.mdx +1 -5
- package/src/core/NavList/index.mdx +1 -5
- package/src/core/NotificationBanner/index.mdx +1 -5
- package/src/core/PhaseBanner/index.mdx +1 -4
- package/src/core/RadioContainer/index.mdx +6 -30
- package/src/core/SelectContainer/index.mdx +3 -15
- package/src/core/SingleCharacterInputContainer/index.mdx +7 -10
- package/src/core/SummaryList/index.mdx +2 -10
- package/src/core/Table/index.mdx +6 -30
- package/src/core/TextArea/index.mdx +6 -30
- package/src/core/TextInput/index.mdx +6 -30
- package/src/core/index.ts +1 -0
- package/src/typography/HeadingCaption/index.mdx +1 -5
- package/src/typography/Hint/index.mdx +1 -5
- package/src/typography/NormalText/index.mdx +3 -15
- package/src/typography/Paragraph/index.mdx +3 -15
- package/typography/HeadingCaption/index.mdx +1 -5
- package/typography/Hint/index.mdx +1 -5
- package/typography/NormalText/index.mdx +3 -15
- package/typography/Paragraph/index.mdx +3 -15
|
@@ -11,48 +11,28 @@ import RadioContainer from '@digigov/ui/core/RadioContainer';
|
|
|
11
11
|
|
|
12
12
|
## How to use
|
|
13
13
|
|
|
14
|
-
<Story
|
|
15
|
-
packageName="@digigov/ui"
|
|
16
|
-
component="core/RadioContainer"
|
|
17
|
-
story="Default.tsx"
|
|
18
|
-
/>
|
|
14
|
+
<Story packageName="@digigov/ui" component="core/RadioContainer" story="Default.tsx" />
|
|
19
15
|
|
|
20
16
|
### If you’re asking more than one question on the page
|
|
21
17
|
|
|
22
|
-
<Story
|
|
23
|
-
packageName="@digigov/ui"
|
|
24
|
-
component="core/RadioContainer"
|
|
25
|
-
story="MultipleQuestions.tsx"
|
|
26
|
-
/>
|
|
18
|
+
<Story packageName="@digigov/ui" component="core/RadioContainer" story="MultipleQuestions.tsx" />
|
|
27
19
|
|
|
28
20
|
### Inline radios
|
|
29
21
|
|
|
30
|
-
<Story
|
|
31
|
-
packageName="@digigov/ui"
|
|
32
|
-
component="core/RadioContainer"
|
|
33
|
-
story="Inline.tsx"
|
|
34
|
-
/>
|
|
22
|
+
<Story packageName="@digigov/ui" component="core/RadioContainer" story="Inline.tsx" />
|
|
35
23
|
|
|
36
24
|
### Checkbox items with hints
|
|
37
25
|
|
|
38
26
|
You can add hints to checkbox items to provide additional information about the options.
|
|
39
27
|
|
|
40
|
-
<Story
|
|
41
|
-
packageName="@digigov/ui"
|
|
42
|
-
component="core/RadioContainer"
|
|
43
|
-
story="WithHints.tsx"
|
|
44
|
-
/>
|
|
28
|
+
<Story packageName="@digigov/ui" component="core/RadioContainer" story="WithHints.tsx" />
|
|
45
29
|
|
|
46
30
|
### RadioContainer items with a text divider
|
|
47
31
|
|
|
48
32
|
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.
|
|
49
33
|
The text is usually the word ‘or’.
|
|
50
34
|
|
|
51
|
-
<Story
|
|
52
|
-
packageName="@digigov/ui"
|
|
53
|
-
component="core/RadioContainer"
|
|
54
|
-
story="NoneAnswer.tsx"
|
|
55
|
-
/>
|
|
35
|
+
<Story packageName="@digigov/ui" component="core/RadioContainer" story="NoneAnswer.tsx" />
|
|
56
36
|
|
|
57
37
|
## Conditionally revealing a related question
|
|
58
38
|
|
|
@@ -60,11 +40,7 @@ You can ask the user a related question when they select a particular checkbox,
|
|
|
60
40
|
|
|
61
41
|
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.
|
|
62
42
|
|
|
63
|
-
<Story
|
|
64
|
-
packageName="@digigov/ui"
|
|
65
|
-
component="core/RadioContainer"
|
|
66
|
-
story="ConditionalReveal.tsx"
|
|
67
|
-
/>
|
|
43
|
+
<Story packageName="@digigov/ui" component="core/RadioContainer" story="ConditionalReveal.tsx" />
|
|
68
44
|
|
|
69
45
|
### Error messages
|
|
70
46
|
|
|
@@ -11,31 +11,19 @@ import SelectContainer from '@digigov/ui/core/SelectContainer';
|
|
|
11
11
|
|
|
12
12
|
## How to use
|
|
13
13
|
|
|
14
|
-
<Story
|
|
15
|
-
packageName="@digigov/ui"
|
|
16
|
-
component="core/SelectContainer"
|
|
17
|
-
story="Default.tsx"
|
|
18
|
-
/>
|
|
14
|
+
<Story packageName="@digigov/ui" component="core/SelectContainer" story="Default.tsx" />
|
|
19
15
|
|
|
20
16
|
### SelectContainer with hints
|
|
21
17
|
|
|
22
18
|
You can add hints to select items to provide additional information about the options.
|
|
23
19
|
|
|
24
|
-
<Story
|
|
25
|
-
packageName="@digigov/ui"
|
|
26
|
-
component="core/SelectContainer"
|
|
27
|
-
story="WithHint.tsx"
|
|
28
|
-
/>
|
|
20
|
+
<Story packageName="@digigov/ui" component="core/SelectContainer" story="WithHint.tsx" />
|
|
29
21
|
|
|
30
22
|
### Disabled input
|
|
31
23
|
|
|
32
24
|
Error messages should be styled like this:
|
|
33
25
|
|
|
34
|
-
<Story
|
|
35
|
-
packageName="@digigov/ui"
|
|
36
|
-
component="core/SelectContainer"
|
|
37
|
-
story="DisabledInput.tsx"
|
|
38
|
-
/>
|
|
26
|
+
<Story packageName="@digigov/ui" component="core/SelectContainer" story="DisabledInput.tsx" />
|
|
39
27
|
|
|
40
28
|
You can read more about the accessibility patterns used in our SelectContainer
|
|
41
29
|
implementation in the ARIA Authoring Practices Guide (APG) at
|
|
@@ -11,19 +11,16 @@ import SingleCharacterInputContainer from '@digigov/ui/core/SingleCharacterInput
|
|
|
11
11
|
|
|
12
12
|
## How to use
|
|
13
13
|
|
|
14
|
-
<Story
|
|
15
|
-
packageName="@digigov/ui"
|
|
16
|
-
component="core/SingleCharacterInputContainer"
|
|
17
|
-
story="Default.tsx"
|
|
18
|
-
/>
|
|
14
|
+
<Story packageName="@digigov/ui" component="core/SingleCharacterInputContainer" story="Default.tsx" />
|
|
19
15
|
|
|
20
16
|
|
|
21
17
|
### Error message
|
|
22
18
|
|
|
23
19
|
If you’re highlighting the whole date, style all the fields like this:
|
|
24
20
|
|
|
25
|
-
<Story
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/>
|
|
21
|
+
<Story packageName="@digigov/ui" component="core/SingleCharacterInputContainer" story="WithDefaultError.tsx" />
|
|
22
|
+
|
|
23
|
+
## API
|
|
24
|
+
|
|
25
|
+
<PropTypes packageName="@digigov/ui" component="SingleCharacterInputContainer" />
|
|
26
|
+
<PropTypes packageName="@digigov/ui" component="SingleCharacterInputItem" />
|
|
@@ -13,11 +13,7 @@ import SummaryList from '@digigov/ui/core/SummaryList';
|
|
|
13
13
|
|
|
14
14
|
## How to use
|
|
15
15
|
|
|
16
|
-
<Story
|
|
17
|
-
packageName="@digigov/ui"
|
|
18
|
-
component="core/SummaryList"
|
|
19
|
-
story="Default.tsx"
|
|
20
|
-
/>
|
|
16
|
+
<Story packageName="@digigov/ui" component="core/SummaryList" story="Default.tsx" />
|
|
21
17
|
|
|
22
18
|
### Summary list with actions
|
|
23
19
|
|
|
@@ -25,11 +21,7 @@ Assistive technology users, like those who use a screen reader, may hear the lin
|
|
|
25
21
|
To give more context, add visually hidden text to the links.
|
|
26
22
|
This means a screen reader user will hear a meaningful action, like ‘Αλλαγή ονόματος’ or ‘Αλλαγή ημερομηνίας γέννησης’.
|
|
27
23
|
|
|
28
|
-
<Story
|
|
29
|
-
packageName="@digigov/ui"
|
|
30
|
-
component="core/SummaryList"
|
|
31
|
-
story="WithActions.tsx"
|
|
32
|
-
/>
|
|
24
|
+
<Story packageName="@digigov/ui" component="core/SummaryList" story="WithActions.tsx" />
|
|
33
25
|
|
|
34
26
|
### Summary list without borders
|
|
35
27
|
|
package/core/Table/index.mdx
CHANGED
|
@@ -24,29 +24,17 @@ import {
|
|
|
24
24
|
|
|
25
25
|
### Table with dark header
|
|
26
26
|
|
|
27
|
-
<Story
|
|
28
|
-
packageName="@digigov/ui"
|
|
29
|
-
component="core/Table"
|
|
30
|
-
story="DarkVariant.tsx"
|
|
31
|
-
/>
|
|
27
|
+
<Story packageName="@digigov/ui" component="core/Table" story="DarkVariant.tsx" />
|
|
32
28
|
|
|
33
29
|
### Table captions
|
|
34
30
|
|
|
35
31
|
Use the `<TableCaption>` element to describe a table in the same way you would use a heading. A caption helps users find, navigate and understand tables.
|
|
36
32
|
|
|
37
|
-
<Story
|
|
38
|
-
packageName="@digigov/ui"
|
|
39
|
-
component="core/Table"
|
|
40
|
-
story="TableCaptions.tsx"
|
|
41
|
-
/>
|
|
33
|
+
<Story packageName="@digigov/ui" component="core/Table" story="TableCaptions.tsx" />
|
|
42
34
|
|
|
43
35
|
### Numbers in a table
|
|
44
36
|
|
|
45
|
-
<Story
|
|
46
|
-
packageName="@digigov/ui"
|
|
47
|
-
component="core/Table"
|
|
48
|
-
story="NumericDataType.tsx"
|
|
49
|
-
/>
|
|
37
|
+
<Story packageName="@digigov/ui" component="core/Table" story="NumericDataType.tsx" />
|
|
50
38
|
|
|
51
39
|
### Zebra rows
|
|
52
40
|
|
|
@@ -54,11 +42,7 @@ Use the `<TableCaption>` element to describe a table in the same way you would u
|
|
|
54
42
|
|
|
55
43
|
### Vertical lines
|
|
56
44
|
|
|
57
|
-
<Story
|
|
58
|
-
packageName="@digigov/ui"
|
|
59
|
-
component="core/Table"
|
|
60
|
-
story="VerticalBorders.tsx"
|
|
61
|
-
/>
|
|
45
|
+
<Story packageName="@digigov/ui" component="core/Table" story="VerticalBorders.tsx" />
|
|
62
46
|
|
|
63
47
|
### Dense tables
|
|
64
48
|
|
|
@@ -66,11 +50,7 @@ Use the `<TableCaption>` element to describe a table in the same way you would u
|
|
|
66
50
|
|
|
67
51
|
### Custom column widths
|
|
68
52
|
|
|
69
|
-
<Story
|
|
70
|
-
packageName="@digigov/ui"
|
|
71
|
-
component="core/Table"
|
|
72
|
-
story="DefinedWidth.tsx"
|
|
73
|
-
/>
|
|
53
|
+
<Story packageName="@digigov/ui" component="core/Table" story="DefinedWidth.tsx" />
|
|
74
54
|
|
|
75
55
|
### No data
|
|
76
56
|
|
|
@@ -78,11 +58,7 @@ Use the `<TableCaption>` element to describe a table in the same way you would u
|
|
|
78
58
|
|
|
79
59
|
### Using loader
|
|
80
60
|
|
|
81
|
-
<Story
|
|
82
|
-
packageName="@digigov/ui"
|
|
83
|
-
component="core/Table"
|
|
84
|
-
story="WithLoader.tsx"
|
|
85
|
-
/>
|
|
61
|
+
<Story packageName="@digigov/ui" component="core/Table" story="WithLoader.tsx" />
|
|
86
62
|
|
|
87
63
|
## Accessibility
|
|
88
64
|
|
package/core/TextArea/index.mdx
CHANGED
|
@@ -11,57 +11,33 @@ import TextArea from '@digigov/ui/core/TextArea';
|
|
|
11
11
|
|
|
12
12
|
## How to use
|
|
13
13
|
|
|
14
|
-
<Story
|
|
15
|
-
packageName="@digigov/ui"
|
|
16
|
-
component="core/TextArea"
|
|
17
|
-
story="Default.tsx"
|
|
18
|
-
/>
|
|
14
|
+
<Story packageName="@digigov/ui" component="core/TextArea" story="Default.tsx" />
|
|
19
15
|
|
|
20
16
|
### Use appropriately-sized textareas
|
|
21
17
|
|
|
22
|
-
<Story
|
|
23
|
-
packageName="@digigov/ui"
|
|
24
|
-
component="core/TextArea"
|
|
25
|
-
story="WithDeclaredRows.tsx"
|
|
26
|
-
/>
|
|
18
|
+
<Story packageName="@digigov/ui" component="core/TextArea" story="WithDeclaredRows.tsx" />
|
|
27
19
|
|
|
28
20
|
### If you’re asking more than one question on the page
|
|
29
21
|
|
|
30
|
-
<Story
|
|
31
|
-
packageName="@digigov/ui"
|
|
32
|
-
component="core/TextArea"
|
|
33
|
-
story="MultipleQuestions.tsx"
|
|
34
|
-
/>
|
|
22
|
+
<Story packageName="@digigov/ui" component="core/TextArea" story="MultipleQuestions.tsx" />
|
|
35
23
|
|
|
36
24
|
### Limiting the number of characters
|
|
37
25
|
|
|
38
26
|
If there’s a good reason to limit the number of characters users can enter, you can use the character count component.
|
|
39
27
|
|
|
40
|
-
<Story
|
|
41
|
-
packageName="@digigov/ui"
|
|
42
|
-
component="core/TextArea"
|
|
43
|
-
story="LimitedCharacters.tsx"
|
|
44
|
-
/>
|
|
28
|
+
<Story packageName="@digigov/ui" component="core/TextArea" story="LimitedCharacters.tsx" />
|
|
45
29
|
|
|
46
30
|
### Hint text
|
|
47
31
|
|
|
48
32
|
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.
|
|
49
33
|
|
|
50
|
-
<Story
|
|
51
|
-
packageName="@digigov/ui"
|
|
52
|
-
component="core/TextArea"
|
|
53
|
-
story="WithHint.tsx"
|
|
54
|
-
/>
|
|
34
|
+
<Story packageName="@digigov/ui" component="core/TextArea" story="WithHint.tsx" />
|
|
55
35
|
|
|
56
36
|
### Error message
|
|
57
37
|
|
|
58
38
|
Error messages should be styled like this:
|
|
59
39
|
|
|
60
|
-
<Story
|
|
61
|
-
packageName="@digigov/ui"
|
|
62
|
-
component="core/TextArea"
|
|
63
|
-
story="WithErrorMessage.tsx"
|
|
64
|
-
/>
|
|
40
|
+
<Story packageName="@digigov/ui" component="core/TextArea" story="WithErrorMessage.tsx" />
|
|
65
41
|
|
|
66
42
|
### Disabled input
|
|
67
43
|
|
package/core/TextInput/index.mdx
CHANGED
|
@@ -11,19 +11,11 @@ import TextInput from '@digigov/ui/core/TextInput';
|
|
|
11
11
|
|
|
12
12
|
## How to use
|
|
13
13
|
|
|
14
|
-
<Story
|
|
15
|
-
packageName="@digigov/ui"
|
|
16
|
-
component="core/TextInput"
|
|
17
|
-
story="Default.tsx"
|
|
18
|
-
/>
|
|
14
|
+
<Story packageName="@digigov/ui" component="core/TextInput" story="Default.tsx" />
|
|
19
15
|
|
|
20
16
|
### If you’re asking more than one question on the page
|
|
21
17
|
|
|
22
|
-
<Story
|
|
23
|
-
packageName="@digigov/ui"
|
|
24
|
-
component="core/TextInput"
|
|
25
|
-
story="MultipleQuestions.tsx"
|
|
26
|
-
/>
|
|
18
|
+
<Story packageName="@digigov/ui" component="core/TextInput" story="MultipleQuestions.tsx" />
|
|
27
19
|
|
|
28
20
|
### Fixed width inputs
|
|
29
21
|
|
|
@@ -33,31 +25,19 @@ The widths are designed for specific character lengths and to be consistent acro
|
|
|
33
25
|
|
|
34
26
|
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.
|
|
35
27
|
|
|
36
|
-
<Story
|
|
37
|
-
packageName="@digigov/ui"
|
|
38
|
-
component="core/TextInput"
|
|
39
|
-
story="FixedWidths.tsx"
|
|
40
|
-
/>
|
|
28
|
+
<Story packageName="@digigov/ui" component="core/TextInput" story="FixedWidths.tsx" />
|
|
41
29
|
|
|
42
30
|
### Fluid width inputs
|
|
43
31
|
|
|
44
32
|
Fluid width inputs will resize with the viewport.
|
|
45
33
|
|
|
46
|
-
<Story
|
|
47
|
-
packageName="@digigov/ui"
|
|
48
|
-
component="core/TextInput"
|
|
49
|
-
story="FluidWidths.tsx"
|
|
50
|
-
/>
|
|
34
|
+
<Story packageName="@digigov/ui" component="core/TextInput" story="FluidWidths.tsx" />
|
|
51
35
|
|
|
52
36
|
### Hint text
|
|
53
37
|
|
|
54
38
|
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.
|
|
55
39
|
|
|
56
|
-
<Story
|
|
57
|
-
packageName="@digigov/ui"
|
|
58
|
-
component="core/TextInput"
|
|
59
|
-
story="WithHint.tsx"
|
|
60
|
-
/>
|
|
40
|
+
<Story packageName="@digigov/ui" component="core/TextInput" story="WithHint.tsx" />
|
|
61
41
|
|
|
62
42
|
## Numbers
|
|
63
43
|
|
|
@@ -73,11 +53,7 @@ Use hint text for help that’s relevant to the majority of users, like how thei
|
|
|
73
53
|
|
|
74
54
|
Error messages should be styled like this:
|
|
75
55
|
|
|
76
|
-
<Story
|
|
77
|
-
packageName="@digigov/ui"
|
|
78
|
-
component="core/TextInput"
|
|
79
|
-
story="WithErrorMessage.tsx"
|
|
80
|
-
/>
|
|
56
|
+
<Story packageName="@digigov/ui" component="core/TextInput" story="WithErrorMessage.tsx" />
|
|
81
57
|
|
|
82
58
|
### Disabled input
|
|
83
59
|
|
package/core/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from '@digigov/ui/core/PhaseBanner';
|
|
|
26
26
|
export * from '@digigov/ui/core/RadioContainer';
|
|
27
27
|
export * from '@digigov/ui/core/SectionBreak';
|
|
28
28
|
export * from '@digigov/ui/core/SelectContainer';
|
|
29
|
+
export * from '@digigov/ui/core/SingleCharacterInputContainer';
|
|
29
30
|
export * from '@digigov/ui/core/SummaryList';
|
|
30
31
|
export * from '@digigov/ui/core/ServiceBadge';
|
|
31
32
|
export * from '@digigov/ui/core/Table';
|
package/core/index.js
CHANGED
|
@@ -355,6 +355,19 @@ Object.keys(_SelectContainer).forEach(function (key) {
|
|
|
355
355
|
});
|
|
356
356
|
});
|
|
357
357
|
|
|
358
|
+
var _SingleCharacterInputContainer = require("@digigov/ui/core/SingleCharacterInputContainer");
|
|
359
|
+
|
|
360
|
+
Object.keys(_SingleCharacterInputContainer).forEach(function (key) {
|
|
361
|
+
if (key === "default" || key === "__esModule") return;
|
|
362
|
+
if (key in exports && exports[key] === _SingleCharacterInputContainer[key]) return;
|
|
363
|
+
Object.defineProperty(exports, key, {
|
|
364
|
+
enumerable: true,
|
|
365
|
+
get: function get() {
|
|
366
|
+
return _SingleCharacterInputContainer[key];
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
|
|
358
371
|
var _SummaryList = require("@digigov/ui/core/SummaryList");
|
|
359
372
|
|
|
360
373
|
Object.keys(_SummaryList).forEach(function (key) {
|
|
@@ -1,3 +1,52 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import AccessibilityMenuOptionButtonBase from '@digigov/react-extensions/admin/AccessibilityMenuOptionButton';
|
|
3
|
+
import AccessibilityMenuSteps from '@digigov/react-extensions/admin/AccessibilityMenuSteps';
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
export var AccessibilityMenuOptionButton = /*#__PURE__*/React.forwardRef(function AccessibilityMenuOptionButton(_ref, ref) {
|
|
6
|
+
var _ref$steps = _ref.steps,
|
|
7
|
+
steps = _ref$steps === void 0 ? 0 : _ref$steps,
|
|
8
|
+
children = _ref.children;
|
|
9
|
+
|
|
10
|
+
var _useState = useState(false),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
selected = _useState2[0],
|
|
13
|
+
setSelected = _useState2[1];
|
|
14
|
+
|
|
15
|
+
var _useState3 = useState(0),
|
|
16
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
17
|
+
activeStep = _useState4[0],
|
|
18
|
+
setActiveStep = _useState4[1];
|
|
19
|
+
|
|
20
|
+
var handleClick = function handleClick() {
|
|
21
|
+
if (!selected) {
|
|
22
|
+
setSelected(true);
|
|
23
|
+
|
|
24
|
+
if (steps > 0) {
|
|
25
|
+
setActiveStep(activeStep + 1);
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
if (steps > 0) {
|
|
29
|
+
if (steps > activeStep) {
|
|
30
|
+
setActiveStep(activeStep + 1);
|
|
31
|
+
} else {
|
|
32
|
+
setActiveStep(0);
|
|
33
|
+
setSelected(false);
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
setSelected(false);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return /*#__PURE__*/React.createElement(AccessibilityMenuOptionButtonBase, {
|
|
42
|
+
onClick: handleClick,
|
|
43
|
+
ref: ref,
|
|
44
|
+
selected: selected
|
|
45
|
+
}, children, /*#__PURE__*/React.createElement(AccessibilityMenuSteps, {
|
|
46
|
+
steps: steps,
|
|
47
|
+
activeStep: activeStep
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
1
50
|
export * from '@digigov/react-extensions/admin/AccessibilityMenu';
|
|
2
51
|
export * from '@digigov/react-extensions/admin/AccessibilityMenuButton';
|
|
3
52
|
export * from '@digigov/react-extensions/admin/AccessibilityMenuContent';
|
|
@@ -16,51 +16,29 @@ import AutoComplete from '@digigov/ui/admin/AutoComplete';
|
|
|
16
16
|
|
|
17
17
|
### AutoComplete
|
|
18
18
|
|
|
19
|
-
<Story
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
story="Default.tsx"
|
|
23
|
-
/>
|
|
19
|
+
<Story packageName="@digigov/ui"
|
|
20
|
+
component="admin/AutoComplete"
|
|
21
|
+
story="Default.tsx" />
|
|
24
22
|
|
|
25
23
|
### AutoComplete with auto select
|
|
26
24
|
|
|
27
|
-
<Story
|
|
28
|
-
packageName="@digigov/ui"
|
|
29
|
-
component="admin/AutoComplete"
|
|
30
|
-
story="WithAutoSelect.tsx"
|
|
31
|
-
/>
|
|
25
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithAutoSelect.tsx" />
|
|
32
26
|
|
|
33
27
|
### AutoComplete with inline style
|
|
34
28
|
|
|
35
|
-
<Story
|
|
36
|
-
packageName="@digigov/ui"
|
|
37
|
-
component="admin/AutoComplete"
|
|
38
|
-
story="WithInLine.tsx"
|
|
39
|
-
/>
|
|
29
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithInLine.tsx" />
|
|
40
30
|
|
|
41
31
|
### AutoComplete with default value
|
|
42
32
|
|
|
43
|
-
<Story
|
|
44
|
-
packageName="@digigov/ui"
|
|
45
|
-
component="admin/AutoComplete"
|
|
46
|
-
story="WithDefaultValue.tsx"
|
|
47
|
-
/>
|
|
33
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithDefaultValue.tsx" />
|
|
48
34
|
|
|
49
35
|
### AutoComplete with placeholder
|
|
50
36
|
|
|
51
|
-
<Story
|
|
52
|
-
packageName="@digigov/ui"
|
|
53
|
-
component="admin/AutoComplete"
|
|
54
|
-
story="WithPlaceHolder.tsx"
|
|
55
|
-
/>
|
|
37
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithPlaceHolder.tsx" />
|
|
56
38
|
|
|
57
39
|
### AutoComplete with all option's values
|
|
58
40
|
|
|
59
|
-
<Story
|
|
60
|
-
packageName="@digigov/ui"
|
|
61
|
-
component="admin/AutoComplete"
|
|
62
|
-
story="WithShowAllValues.tsx"
|
|
63
|
-
/>
|
|
41
|
+
<Story packageName="@digigov/ui" component="admin/AutoComplete" story="WithShowAllValues.tsx" />
|
|
64
42
|
|
|
65
43
|
### AutoComplete with min length
|
|
66
44
|
|
|
@@ -11,11 +11,7 @@ import CopyToClipboard from '@digigov/ui/admin/CopyToClipboard';
|
|
|
11
11
|
|
|
12
12
|
### Default
|
|
13
13
|
|
|
14
|
-
<Story
|
|
15
|
-
packageName="@digigov/ui"
|
|
16
|
-
component="admin/CopyToClipboard"
|
|
17
|
-
story="Default.tsx"
|
|
18
|
-
/>
|
|
14
|
+
<Story packageName="@digigov/ui" component="admin/CopyToClipboard" story="Default.tsx" />
|
|
19
15
|
|
|
20
16
|
### Banner
|
|
21
17
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "4",
|
|
3
|
+
"stories": {
|
|
4
|
+
"digigov-ui-admin-dropdown--align-right": {
|
|
5
|
+
"actionSets": [
|
|
6
|
+
{
|
|
7
|
+
"actions": [
|
|
8
|
+
{
|
|
9
|
+
"name": "click",
|
|
10
|
+
"args": {
|
|
11
|
+
"selector": "html>body>div:nth-child(5)>div>details>summary"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"id": "lWuaZaRFFDje",
|
|
16
|
+
"title": "Align right action"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"digigov-ui-admin-dropdown--default": {
|
|
21
|
+
"actionSets": [
|
|
22
|
+
{
|
|
23
|
+
"actions": [
|
|
24
|
+
{
|
|
25
|
+
"name": "click",
|
|
26
|
+
"args": {
|
|
27
|
+
"selector": "html>body>div:nth-child(5)>details>summary"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"id": "jCwDDNP3O4e8",
|
|
32
|
+
"title": "Open dropdown action"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"digigov-ui-admin-dropdown--placement-top": {
|
|
37
|
+
"actionSets": [
|
|
38
|
+
{
|
|
39
|
+
"actions": [
|
|
40
|
+
{
|
|
41
|
+
"name": "click",
|
|
42
|
+
"args": {
|
|
43
|
+
"selector": "html>body>div:nth-child(5)>div>details>summary"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"id": "w6MaGKfzgKOG",
|
|
48
|
+
"title": "Placement top action"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -10,8 +10,7 @@ import { NavVerticalItem } from '@digigov/ui/core/NavList/NavVerticalItem';
|
|
|
10
10
|
import { Button } from '@digigov/ui/core/Button';
|
|
11
11
|
|
|
12
12
|
var _ref = /*#__PURE__*/React.createElement(Dropdown, {
|
|
13
|
-
align: "right"
|
|
14
|
-
open: true
|
|
13
|
+
align: "right"
|
|
15
14
|
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
16
15
|
role: "button",
|
|
17
16
|
"aria-haspopup": "true",
|
|
@@ -9,9 +9,7 @@ import { TextInput } from '@digigov/ui/core/TextInput';
|
|
|
9
9
|
import { NavVerticalItem } from '@digigov/ui/core/NavList/NavVerticalItem';
|
|
10
10
|
import { Button } from '@digigov/ui/core/Button';
|
|
11
11
|
|
|
12
|
-
var _ref = /*#__PURE__*/React.createElement(Dropdown, {
|
|
13
|
-
open: true
|
|
14
|
-
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
12
|
+
var _ref = /*#__PURE__*/React.createElement(Dropdown, null, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
15
13
|
role: "button",
|
|
16
14
|
"aria-haspopup": "true",
|
|
17
15
|
"aria-controls": "menu2",
|
|
@@ -10,8 +10,7 @@ import { NavVerticalItem } from '@digigov/ui/core/NavList/NavVerticalItem';
|
|
|
10
10
|
import { Button } from '@digigov/ui/core/Button';
|
|
11
11
|
|
|
12
12
|
var _ref = /*#__PURE__*/React.createElement(Dropdown, {
|
|
13
|
-
placement: "top"
|
|
14
|
-
open: true
|
|
13
|
+
placement: "top"
|
|
15
14
|
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
16
15
|
role: "button",
|
|
17
16
|
"aria-haspopup": "true",
|
|
@@ -11,31 +11,19 @@ import Dropdown from '@digigov/ui/admin/Dropdown';
|
|
|
11
11
|
|
|
12
12
|
## How to use
|
|
13
13
|
|
|
14
|
-
<Story
|
|
15
|
-
packageName="@digigov/ui"
|
|
16
|
-
component="admin/Dropdown"
|
|
17
|
-
story="Default.tsx"
|
|
18
|
-
/>
|
|
14
|
+
<Story packageName="@digigov/ui" component="admin/Dropdown" story="Default.tsx" />
|
|
19
15
|
|
|
20
16
|
### Dropdown with align right
|
|
21
17
|
|
|
22
18
|
You can display the dropdown menu to the right side of the `Dropdown` button.
|
|
23
19
|
|
|
24
|
-
<Story
|
|
25
|
-
packageName="@digigov/ui"
|
|
26
|
-
component="admin/Dropdown"
|
|
27
|
-
story="AlignRight.tsx"
|
|
28
|
-
/>
|
|
20
|
+
<Story packageName="@digigov/ui" component="admin/Dropdown" story="AlignRight.tsx" />
|
|
29
21
|
|
|
30
22
|
### Dropdown with placement top
|
|
31
23
|
|
|
32
24
|
You can display the dropdown menu to the top of the `Dropdown` button.
|
|
33
25
|
|
|
34
|
-
<Story
|
|
35
|
-
packageName="@digigov/ui"
|
|
36
|
-
component="admin/Dropdown"
|
|
37
|
-
story="PlacementTop.tsx"
|
|
38
|
-
/>
|
|
26
|
+
<Story packageName="@digigov/ui" component="admin/Dropdown" story="PlacementTop.tsx" />
|
|
39
27
|
|
|
40
28
|
You can read more about the accessibility patterns used in our Dropdown
|
|
41
29
|
implementation in the ARIA Authoring Practices Guide (APG) at
|