@innovaccer/design-system 2.5.0-4 → 2.6.0
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/.all-contributorsrc +1 -1
- package/.eslintrc.json +53 -0
- package/.github/workflows/jira.yml +1 -2
- package/.github/workflows/main.yml +2 -2
- package/.github/workflows/pull_request.yml +1 -1
- package/.github/workflows/test.yml +1 -1
- package/.husky/commit-msg +4 -0
- package/.prettierrc +2 -2
- package/CHANGELOG.md +38 -88
- package/CONTRIBUTING.md +173 -97
- package/README.md +1 -1
- package/commitlint.config.js +1 -0
- package/core/accessibility/utils/index.ts +5 -0
- package/core/accessibility/utils/isEnterKey.ts +5 -0
- package/core/accessibility/utils/isSpaceKey.ts +5 -0
- package/core/accessibility/utils/useAccessibilityProps.ts +31 -0
- package/core/components/atoms/_chip/__tests__/__snapshots__/_chip.test.tsx.snap +8 -0
- package/core/components/atoms/_chip/index.tsx +2 -0
- package/core/components/atoms/button/__stories__/Alert.story.tsx +8 -1
- package/core/components/atoms/button/__stories__/Cancel.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/IconButtonGroup.story.tsx +12 -3
- package/core/components/atoms/button/__stories__/IconButtonSecondary.story.tsx +6 -1
- package/core/components/atoms/button/__stories__/IconLeftSecondary.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/IconRightSecondary.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/IconTransparent.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/LabelButtonGroup.story.tsx +14 -3
- package/core/components/atoms/button/__stories__/LargeIconExpanded.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/LoadingPrimary.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/Primary.story.tsx +5 -2
- package/core/components/atoms/button/__stories__/SplitButton.story.tsx +6 -1
- package/core/components/atoms/button/__stories__/Transparent.story.tsx +8 -1
- package/core/components/atoms/button/__stories__/index.story.tsx +11 -1
- package/core/components/atoms/button/__stories__/variants/Appearance.story.tsx +4 -0
- package/core/components/atoms/button/__stories__/variants/Expanded.story.tsx +4 -0
- package/core/components/atoms/button/__stories__/variants/Size.story.tsx +4 -0
- package/core/components/atoms/button/__stories__/variants/icon/Icon.story.tsx +15 -0
- package/core/components/atoms/button/__stories__/variants/icon/IconLeft.story.tsx +4 -0
- package/core/components/atoms/button/__stories__/variants/icon/IconRight.story.tsx +4 -0
- package/core/components/atoms/button/__stories__/variants/state/Alert.story.tsx +7 -17
- package/core/components/atoms/button/__stories__/variants/state/Basic.story.tsx +9 -17
- package/core/components/atoms/button/__stories__/variants/state/Primary.story.tsx +7 -17
- package/core/components/atoms/button/__stories__/variants/state/Success.story.tsx +7 -17
- package/core/components/atoms/button/__stories__/variants/state/Transparent.story.tsx +13 -17
- package/core/components/atoms/chipGroup/__tests__/__snapshots__/chipGroup.test.tsx.snap +6 -0
- package/core/components/atoms/collapsible/__stories__/index.story.tsx +2 -2
- package/core/components/atoms/collapsible/__tests__/__snapshots__/Collapsible.test.tsx.snap +8 -0
- package/core/components/atoms/divider/Divider.tsx +44 -0
- package/core/components/atoms/divider/__stories__/BasicDividerInCard.story.tsx +74 -0
- package/core/components/atoms/divider/__stories__/HeaderDividerInCard.story.tsx +35 -0
- package/core/components/atoms/divider/__stories__/IndentedDivider.story.tsx +49 -0
- package/core/components/atoms/divider/__stories__/Vertical.story.tsx +51 -0
- package/core/components/atoms/divider/__stories__/index.story.tsx +91 -0
- package/core/components/atoms/divider/__stories__/variants/HorizontalDivider.story.tsx +27 -0
- package/core/components/atoms/divider/__tests__/Divider.test.tsx +50 -0
- package/core/components/atoms/divider/__tests__/__snapshots__/Divider.test.tsx.snap +53 -0
- package/core/components/atoms/divider/index.tsx +2 -0
- package/core/components/atoms/dropdown/DropdownList.tsx +8 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/MultiSelect.story.tsx +27 -17
- package/core/components/atoms/dropdown/option/DefaultOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/IconOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/IconWithMetaOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/MetaOption.tsx +3 -0
- package/core/components/atoms/editable/Editable.tsx +3 -0
- package/core/components/atoms/icon/Icon.tsx +14 -3
- package/core/components/atoms/icon/__stories__/variants/Image.story.tsx +6 -1
- package/core/components/atoms/icon/__tests__/__snapshots__/Icon.test.tsx.snap +74 -0
- package/core/components/atoms/input/Input.tsx +14 -4
- package/core/components/atoms/input/__stories__/BasicInput.story.tsx +2 -1
- package/core/components/atoms/input/__stories__/InputWithCaption.story.tsx +29 -9
- package/core/components/atoms/input/__stories__/InputWithLabel.story.tsx +11 -3
- package/core/components/atoms/input/__stories__/LabelPosition.story.tsx +8 -4
- package/core/components/atoms/input/__stories__/RequiredVsOptional.story.tsx +12 -8
- package/core/components/atoms/input/__tests__/__snapshots__/Input.test.tsx.snap +19 -0
- package/core/components/atoms/legend/Legend.tsx +3 -0
- package/core/components/atoms/message/__stories__/CustomDescription.tsx +25 -0
- package/core/components/atoms/metricInput/MetricInput.tsx +12 -2
- package/core/components/atoms/metricInput/__stories__/DefaultMetric.story.tsx +8 -2
- package/core/components/atoms/metricInput/__stories__/WithPrefix.story.tsx +6 -2
- package/core/components/atoms/metricInput/__stories__/index.story.tsx +1 -0
- package/core/components/atoms/metricInput/__stories__/variants/Controlled.story.tsx +2 -0
- package/core/components/atoms/metricInput/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/metricInput/__stories__/withSuffix.story.tsx +6 -2
- package/core/components/atoms/metricInput/__tests__/__snapshots__/MetricInput.test.tsx.snap +20 -4
- package/core/components/atoms/multiSlider/Handle.tsx +3 -0
- package/core/components/atoms/multiSlider/index.tsx +6 -0
- package/core/components/atoms/outsideClick/__stories__/index.story.tsx +1 -1
- package/core/components/atoms/statusHint/StatusHint.tsx +3 -0
- package/core/components/atoms/switchInput/Switch.tsx +10 -4
- package/core/components/atoms/switchInput/__stories__/DefaultSwitch.story.tsx +4 -1
- package/core/components/atoms/switchInput/__stories__/OffState.story.tsx +4 -1
- package/core/components/atoms/switchInput/__stories__/index.story.tsx +26 -3
- package/core/components/atoms/switchInput/__stories__/variants/Size.story.tsx +10 -1
- package/core/components/atoms/switchInput/__stories__/variants/State.story.tsx +9 -2
- package/core/components/atoms/textarea/__stories__/TextareaWithCaption.story.tsx +9 -3
- package/core/components/atoms/textarea/__stories__/defaultTextarea.story.tsx +10 -2
- package/core/components/atoms/textarea/__stories__/index.story.tsx +1 -0
- package/core/components/atoms/textarea/__stories__/variants/Disable.story.tsx +1 -0
- package/core/components/atoms/toast/__tests__/__snapshots__/Toast.test.tsx.snap +30 -0
- package/core/components/css-utilities/Align/Align.story.tsx +1 -1
- package/core/components/css-utilities/Background/Background.story.tsx +1 -1
- package/core/components/css-utilities/Border/Border.story.tsx +1 -1
- package/core/components/css-utilities/Display/Display.story.tsx +1 -1
- package/core/components/css-utilities/Flex/Flex.story.tsx +1 -1
- package/core/components/css-utilities/Miscellaneous/Miscellaneous.story.tsx +1 -1
- package/core/components/css-utilities/Overflow/Overflow.story.tsx +1 -1
- package/core/components/css-utilities/Position/Position.story.tsx +1 -1
- package/core/components/css-utilities/Sizing/Sizing.story.tsx +1 -1
- package/core/components/css-utilities/Spacing/Spacing.story.tsx +1 -1
- package/core/components/molecules/chatMessage/Box.tsx +3 -0
- package/core/components/molecules/chipInput/ChipInput.tsx +3 -0
- package/core/components/molecules/chipInput/__tests__/__snapshots__/ChipInput.test.tsx.snap +12 -0
- package/core/components/molecules/dropzone/Dropzone.tsx +3 -0
- package/core/components/molecules/dropzone/FileSelectorUtils.tsx +1 -1
- package/core/components/molecules/editableChipInput/EditableChipInput.tsx +9 -5
- package/core/components/molecules/editableChipInput/__stories__/Uncontrolled.story.tsx +1 -1
- package/core/components/molecules/editableChipInput/__tests__/__snapshots__/EditableChipInput.test.tsx.snap +8 -0
- package/core/components/molecules/editableDropdown/EditableDropdown.tsx +2 -2
- package/core/components/molecules/editableInput/EditableInput.tsx +13 -4
- package/core/components/molecules/emptyState/EmptyState.tsx +5 -1
- package/core/components/molecules/fileList/FileListItem.tsx +2 -0
- package/core/components/molecules/fileUploader/FileUploaderItem.tsx +2 -0
- package/core/components/molecules/fileUploader/__stories__/index.story.tsx +156 -21
- package/core/components/molecules/inputMask/InputMask.tsx +1 -1
- package/core/components/molecules/inputMask/__tests__/__snapshots__/InputMask.test.tsx.snap +1 -0
- package/core/components/molecules/pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +5 -1
- package/core/components/molecules/stepper/Step.tsx +2 -0
- package/core/components/molecules/tabs/Tabs.tsx +2 -0
- package/core/components/molecules/tabs/TabsWrapper.tsx +2 -0
- package/core/components/molecules/tabs/__stories__/CustomLabels.story.tsx +1 -1
- package/core/components/molecules/verificationCodeInput/VerificationCodeInput.tsx +8 -4
- package/core/components/molecules/verificationCodeInput/__stories__/index.story.tsx +3 -1
- package/core/components/molecules/verificationCodeInput/__tests__/__snapshots__/VerificationCodeInput.test.tsx.snap +1 -0
- package/core/components/organisms/calendar/Calendar.tsx +130 -8
- package/core/components/organisms/calendar/__tests__/Calendar.test.tsx +27 -0
- package/core/components/organisms/choiceList/ChoiceList.tsx +1 -1
- package/core/components/organisms/datePicker/DatePicker.tsx +30 -15
- package/core/components/organisms/datePicker/__tests__/DatePicker.test.tsx +136 -46
- package/core/components/organisms/datePicker/__tests__/__snapshots__/DatePicker.test.tsx.snap +4388 -1857
- package/core/components/organisms/dateRangePicker/__tests__/__snapshots__/DateRangePicker.test.tsx.snap +112 -40
- package/core/components/organisms/grid/Cell.tsx +4 -0
- package/core/components/organisms/grid/GridRow.tsx +4 -0
- package/core/components/organisms/grid/__stories__/_common_/fetchData.ts +2 -2
- package/core/components/organisms/horizontalNav/HorizontalNav.tsx +2 -0
- package/core/components/organisms/inlineMessage/InlineMessage.tsx +3 -5
- package/core/components/organisms/inlineMessage/__tests__/__snapshots__/InlineMessage.test.tsx.snap +30 -40
- package/core/components/organisms/navigation/VerticalNavigation.tsx +4 -0
- package/core/components/organisms/table/Table.tsx +1 -0
- package/core/components/organisms/table/__stories__/NestedTableWithNestedCard.story.tsx +4 -1
- package/core/components/organisms/table/__stories__/ResourceTable.story.tsx +3 -2
- package/core/components/organisms/table/__stories__/Selection.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/TableAsOptionList.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/syncTable.story.tsx +14 -6
- package/core/components/organisms/table/__stories__/variants/nestedRows.story.tsx +5 -2
- package/core/components/organisms/table/__stories__/variants/withHeader.story.tsx +0 -2
- package/core/components/organisms/timePicker/TimePicker.tsx +1 -1
- package/core/components/organisms/timePicker/__tests__/__snapshots__/TimePicker.test.tsx.snap +14 -2
- package/core/components/organisms/verticalNav/MenuItem.tsx +2 -0
- package/core/components/patterns/datePicker/datePickerWithPresets.story.tsx +126 -0
- package/core/components/patterns/dateRangePicker/withCustomPopover.story.tsx +8 -8
- package/core/components/patterns/forms/CreatePassword.story.tsx +1 -1
- package/core/components/patterns/forms/VerificationCodeInput.story.tsx +2 -2
- package/core/components/patterns/table/Table with Header/tableWithHeader.story.jsx +7 -7
- package/core/index.tsx +1 -0
- package/core/index.type.tsx +1 -0
- package/core/utils/Keys.ts +4 -0
- package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +544 -536
- package/core/utils/docPage/index.tsx +22 -17
- package/core/utils/testHelper.ts +1 -1
- package/core/utils/validators.ts +37 -34
- package/css/dist/index.css +1523 -1402
- package/css/dist/index.css.map +1 -1
- package/css/src/components/Legend.css +7 -7
- package/css/src/components/ProgressBar.css +1 -1
- package/css/src/components/avatarGroup.css +1 -1
- package/css/src/components/backdrop.css +12 -6
- package/css/src/components/badge.css +52 -52
- package/css/src/components/button.css +99 -94
- package/css/src/components/calendar.css +137 -126
- package/css/src/components/card.css +0 -1
- package/css/src/components/cardSubdued.css +3 -5
- package/css/src/components/chat.css +1 -1
- package/css/src/components/checkbox.css +71 -70
- package/css/src/components/chip.css +14 -13
- package/css/src/components/chipGroup.css +5 -5
- package/css/src/components/chipInput.css +1 -1
- package/css/src/components/choiceList.css +4 -4
- package/css/src/components/dateRangePicker.css +13 -13
- package/css/src/components/divider.css +20 -0
- package/css/src/components/dropdown.css +61 -61
- package/css/src/components/dropdownButton.css +36 -36
- package/css/src/components/dropzone.css +16 -20
- package/css/src/components/editableChipInput.css +10 -9
- package/css/src/components/editableDropdown.css +1 -1
- package/css/src/components/editableInput.css +1 -1
- package/css/src/components/emptyState.css +15 -15
- package/css/src/components/fileList.css +44 -45
- package/css/src/components/grid.css +217 -199
- package/css/src/components/horizontalNav.css +0 -1
- package/css/src/components/icon.css +1 -7
- package/css/src/components/inlineMessage.css +2 -1
- package/css/src/components/input.css +62 -62
- package/css/src/components/link.css +1 -1
- package/css/src/components/list.css +10 -10
- package/css/src/components/message.css +69 -70
- package/css/src/components/metaList.css +26 -26
- package/css/src/components/metricInput.css +3 -4
- package/css/src/components/modal.css +1 -1
- package/css/src/components/navigation.css +3 -3
- package/css/src/components/pageHeader.css +1 -2
- package/css/src/components/pagination.css +36 -36
- package/css/src/components/pills.css +19 -19
- package/css/src/components/placeholder.css +10 -5
- package/css/src/components/popover.css +2 -2
- package/css/src/components/progressRing.css +1 -1
- package/css/src/components/radio.css +74 -74
- package/css/src/components/slider.css +5 -5
- package/css/src/components/statusHints.css +15 -15
- package/css/src/components/switch.css +45 -41
- package/css/src/components/table.css +15 -15
- package/css/src/components/tabs.css +53 -53
- package/css/src/components/textarea.css +1 -1
- package/css/src/components/toast.css +53 -53
- package/css/src/components/verificationCodeInput.css +5 -6
- package/css/src/components/verticalNav.css +1 -2
- package/css/src/core/base.css +3 -0
- package/css/src/core/typography.css +1 -1
- package/css/src/core/utilities.css +1 -1
- package/css/src/tokens/index.css +63 -63
- package/css/src/utils/align.css +1 -1
- package/css/src/utils/background.css +1 -1
- package/css/src/utils/cursor.css +1 -1
- package/css/src/utils/display.css +1 -1
- package/css/src/utils/flex.css +1 -1
- package/css/src/utils/grid.css +1 -1
- package/css/src/utils/overflow.css +1 -1
- package/css/src/utils/position.css +1 -1
- package/css/src/utils/spacing.css +1 -1
- package/css/src/utils/utility.css +13 -13
- package/css/src/variables/index.css +1 -1
- package/dist/core/accessibility/utils/index.d.ts +4 -0
- package/dist/core/accessibility/utils/isEnterKey.d.ts +3 -0
- package/dist/core/accessibility/utils/isSpaceKey.d.ts +3 -0
- package/dist/core/accessibility/utils/useAccessibilityProps.d.ts +15 -0
- package/dist/core/components/atoms/divider/Divider.d.ts +15 -0
- package/dist/core/components/atoms/divider/index.d.ts +2 -0
- package/dist/core/components/atoms/icon/Icon.d.ts +3 -1
- package/dist/core/components/atoms/input/Input.d.ts +1 -1
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +50 -49
- package/dist/core/components/atoms/switchInput/Switch.d.ts +2 -1
- package/dist/core/components/organisms/calendar/Calendar.d.ts +31 -0
- package/dist/core/components/organisms/datePicker/DatePicker.d.ts +2 -0
- package/dist/core/components/patterns/datePicker/datePickerWithPresets.story.d.ts +15 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.type.d.ts +1 -0
- package/dist/index.esm.js +829 -495
- package/dist/index.js +313 -144
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/package.json +17 -14
- package/.husky/prepare-commit-msg +0 -6
- package/tslint.json +0 -30
|
@@ -3,6 +3,7 @@ import { select, boolean } from '@storybook/addon-knobs';
|
|
|
3
3
|
import { action } from '@storybook/addon-actions';
|
|
4
4
|
import { updateKnob } from '@/utils/storybookEventEmitter';
|
|
5
5
|
import Switch from '../index';
|
|
6
|
+
import { Label } from '@/index';
|
|
6
7
|
|
|
7
8
|
// CSF format story
|
|
8
9
|
export const all = () => {
|
|
@@ -18,13 +19,35 @@ export const all = () => {
|
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
22
|
+
<form>
|
|
23
|
+
<Label htmlFor="vaccination-status">Have you been vaccinated ?</Label>
|
|
24
|
+
<div>
|
|
25
|
+
<Switch id="vaccination-status" disabled={disabled} checked={checked} size={size} onChange={onChangeHandler} />
|
|
26
|
+
</div>
|
|
27
|
+
</form>
|
|
24
28
|
);
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
export default {
|
|
28
32
|
title: 'Components/Switch/All',
|
|
29
33
|
component: Switch,
|
|
34
|
+
parameters: {
|
|
35
|
+
docs: {
|
|
36
|
+
docPage: {
|
|
37
|
+
a11yProps: `
|
|
38
|
+
**htmlFor:**
|
|
39
|
+
<br/>
|
|
40
|
+
-Add \`htmlFor='vaccination-status'\` to label to programmatically associated it with switch
|
|
41
|
+
which has \`id='vaccination-status'\`.
|
|
42
|
+
<br/>
|
|
43
|
+
-This means that,a screen reader will read out the label when the user is focused on the switch,
|
|
44
|
+
making it easier for an assistive technology user to understand
|
|
45
|
+
what data should be entered.
|
|
46
|
+
<br/>
|
|
47
|
+
-When a user clicks or touches/taps a label, the browser passes the focus to its associated switch. That increased hit
|
|
48
|
+
area for focusing the input provides an advantage to anyone trying to activate it.
|
|
49
|
+
`,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
30
53
|
};
|
|
@@ -12,7 +12,7 @@ export const size = () => {
|
|
|
12
12
|
return (
|
|
13
13
|
<div key={ind} className="mr-9">
|
|
14
14
|
<div className="h-50">
|
|
15
|
-
<Switch defaultChecked={true} size={SwitchSize} />
|
|
15
|
+
<Switch aria-label={`Switch ${SwitchSize}`} defaultChecked={true} size={SwitchSize} />
|
|
16
16
|
</div>
|
|
17
17
|
<br />
|
|
18
18
|
<Text weight="strong">{SwitchSize.charAt(0).toUpperCase() + SwitchSize.slice(1)}</Text>
|
|
@@ -30,6 +30,15 @@ export default {
|
|
|
30
30
|
docs: {
|
|
31
31
|
docPage: {
|
|
32
32
|
title: 'Switch',
|
|
33
|
+
a11yProps: `
|
|
34
|
+
**aria-label:**
|
|
35
|
+
<br/>
|
|
36
|
+
- Add \`aria-label='Switch tiny'\` on switch with *Tiny* text to describe the action of switch.
|
|
37
|
+
<br/>
|
|
38
|
+
- Add \`aria-label='Switch regular'\` on switch with *regular* text to describe the action of switch.
|
|
39
|
+
<br/>
|
|
40
|
+
- Add \`aria-label='Switch large'\` on switch with *Large* text to describe the action of switch.
|
|
41
|
+
`,
|
|
33
42
|
},
|
|
34
43
|
},
|
|
35
44
|
},
|
|
@@ -7,12 +7,12 @@ export const state = () => {
|
|
|
7
7
|
return (
|
|
8
8
|
<div className="d-flex">
|
|
9
9
|
<div className="mr-9">
|
|
10
|
-
<Switch defaultChecked={true} disabled={false} />
|
|
10
|
+
<Switch aria-label="Switch enabled" defaultChecked={true} disabled={false} />
|
|
11
11
|
<br />
|
|
12
12
|
<Text weight="strong">Enabled</Text>
|
|
13
13
|
</div>
|
|
14
14
|
<div>
|
|
15
|
-
<Switch disabled={true} defaultChecked={true} />
|
|
15
|
+
<Switch aria-label="Switch disabled" disabled={true} defaultChecked={true} />
|
|
16
16
|
<br />
|
|
17
17
|
<Text weight="strong">Disabled</Text>
|
|
18
18
|
</div>
|
|
@@ -27,6 +27,13 @@ export default {
|
|
|
27
27
|
docs: {
|
|
28
28
|
docPage: {
|
|
29
29
|
title: 'Switch',
|
|
30
|
+
a11yProps: `
|
|
31
|
+
**aria-label:**
|
|
32
|
+
<br/>
|
|
33
|
+
- Add \`aria-label='Switch enabled'\` on switch with *Enabled* text to describe the action of switch.
|
|
34
|
+
<br/>
|
|
35
|
+
- Add \`aria-label='Switch disabled'\` on switch with *Disabled* text to describe the action of switch.
|
|
36
|
+
`,
|
|
30
37
|
},
|
|
31
38
|
},
|
|
32
39
|
},
|
|
@@ -6,15 +6,19 @@ export const textareaWithCaption = () => {
|
|
|
6
6
|
|
|
7
7
|
return (
|
|
8
8
|
<>
|
|
9
|
-
<Label withInput={true}
|
|
9
|
+
<Label withInput={true} htmlFor="notes">
|
|
10
|
+
Confirmation Notes
|
|
11
|
+
</Label>
|
|
10
12
|
<Textarea
|
|
11
|
-
name="
|
|
13
|
+
name="notes"
|
|
12
14
|
className="w-50"
|
|
13
15
|
value={value}
|
|
14
16
|
onChange={(e) => {
|
|
15
17
|
setValue(e.target.value);
|
|
16
18
|
}}
|
|
17
19
|
placeholder="Enter your comments here"
|
|
20
|
+
aria-labelledby="Confirmation Notes"
|
|
21
|
+
id="notes"
|
|
18
22
|
/>
|
|
19
23
|
<Caption withInput={true}>This note will be automatically pinned for export.</Caption>
|
|
20
24
|
</>
|
|
@@ -26,13 +30,15 @@ const customCode = `() => {
|
|
|
26
30
|
|
|
27
31
|
return (
|
|
28
32
|
<>
|
|
29
|
-
<Label withInput={true}>Confirmation Notes</Label>
|
|
33
|
+
<Label withInput={true} htmlFor="notes">Confirmation Notes</Label>
|
|
30
34
|
<Textarea
|
|
31
35
|
name="Textarea"
|
|
32
36
|
className="w-50"
|
|
33
37
|
value={value}
|
|
34
38
|
onChange={e => { setValue(e.target.value); }}
|
|
35
39
|
placeholder="Enter your comments here"
|
|
40
|
+
aria-labelledby="Confirmation Notes"
|
|
41
|
+
id="notes"
|
|
36
42
|
/>
|
|
37
43
|
<Caption withInput={true}>This note will be automatically pinned for export.</Caption>
|
|
38
44
|
</>
|
|
@@ -3,8 +3,16 @@ import { Textarea, Label } from '@/index';
|
|
|
3
3
|
|
|
4
4
|
export const defaultTextarea = () => (
|
|
5
5
|
<>
|
|
6
|
-
<Label withInput={true}>
|
|
7
|
-
|
|
6
|
+
<Label withInput={true} htmlFor="comments">
|
|
7
|
+
Comments
|
|
8
|
+
</Label>
|
|
9
|
+
<Textarea
|
|
10
|
+
name="comments"
|
|
11
|
+
id="comments"
|
|
12
|
+
aria-labelledby="Comments"
|
|
13
|
+
className="w-25"
|
|
14
|
+
placeholder="Enter your comments here"
|
|
15
|
+
/>
|
|
8
16
|
</>
|
|
9
17
|
);
|
|
10
18
|
|
|
@@ -28,7 +28,9 @@ exports[`Toast component
|
|
|
28
28
|
</h5>
|
|
29
29
|
<i
|
|
30
30
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--alert"
|
|
31
|
+
role="button"
|
|
31
32
|
style="font-size: 16px; width: 16px;"
|
|
33
|
+
tabindex="0"
|
|
32
34
|
>
|
|
33
35
|
close_round
|
|
34
36
|
</i>
|
|
@@ -61,7 +63,9 @@ exports[`Toast component
|
|
|
61
63
|
</h5>
|
|
62
64
|
<i
|
|
63
65
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--default"
|
|
66
|
+
role="button"
|
|
64
67
|
style="font-size: 16px; width: 16px;"
|
|
68
|
+
tabindex="0"
|
|
65
69
|
>
|
|
66
70
|
close_round
|
|
67
71
|
</i>
|
|
@@ -100,7 +104,9 @@ exports[`Toast component
|
|
|
100
104
|
</h5>
|
|
101
105
|
<i
|
|
102
106
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--info"
|
|
107
|
+
role="button"
|
|
103
108
|
style="font-size: 16px; width: 16px;"
|
|
109
|
+
tabindex="0"
|
|
104
110
|
>
|
|
105
111
|
close_round
|
|
106
112
|
</i>
|
|
@@ -139,7 +145,9 @@ exports[`Toast component
|
|
|
139
145
|
</h5>
|
|
140
146
|
<i
|
|
141
147
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--success"
|
|
148
|
+
role="button"
|
|
142
149
|
style="font-size: 16px; width: 16px;"
|
|
150
|
+
tabindex="0"
|
|
143
151
|
>
|
|
144
152
|
close_round
|
|
145
153
|
</i>
|
|
@@ -178,7 +186,9 @@ exports[`Toast component
|
|
|
178
186
|
</h5>
|
|
179
187
|
<i
|
|
180
188
|
class="material-icons material-icons-round Icon Icon--default Toast-icon Toast-icon--right Toast-icon--warning"
|
|
189
|
+
role="button"
|
|
181
190
|
style="font-size: 16px; width: 16px;"
|
|
191
|
+
tabindex="0"
|
|
182
192
|
>
|
|
183
193
|
close_round
|
|
184
194
|
</i>
|
|
@@ -217,7 +227,9 @@ exports[`Toast component
|
|
|
217
227
|
</h5>
|
|
218
228
|
<i
|
|
219
229
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--alert"
|
|
230
|
+
role="button"
|
|
220
231
|
style="font-size: 16px; width: 16px;"
|
|
232
|
+
tabindex="0"
|
|
221
233
|
>
|
|
222
234
|
close_round
|
|
223
235
|
</i>
|
|
@@ -262,7 +274,9 @@ exports[`Toast component
|
|
|
262
274
|
</h5>
|
|
263
275
|
<i
|
|
264
276
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--alert"
|
|
277
|
+
role="button"
|
|
265
278
|
style="font-size: 16px; width: 16px;"
|
|
279
|
+
tabindex="0"
|
|
266
280
|
>
|
|
267
281
|
close_round
|
|
268
282
|
</i>
|
|
@@ -315,7 +329,9 @@ exports[`Toast component
|
|
|
315
329
|
</h5>
|
|
316
330
|
<i
|
|
317
331
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--default"
|
|
332
|
+
role="button"
|
|
318
333
|
style="font-size: 16px; width: 16px;"
|
|
334
|
+
tabindex="0"
|
|
319
335
|
>
|
|
320
336
|
close_round
|
|
321
337
|
</i>
|
|
@@ -354,7 +370,9 @@ exports[`Toast component
|
|
|
354
370
|
</h5>
|
|
355
371
|
<i
|
|
356
372
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--default"
|
|
373
|
+
role="button"
|
|
357
374
|
style="font-size: 16px; width: 16px;"
|
|
375
|
+
tabindex="0"
|
|
358
376
|
>
|
|
359
377
|
close_round
|
|
360
378
|
</i>
|
|
@@ -413,7 +431,9 @@ exports[`Toast component
|
|
|
413
431
|
</h5>
|
|
414
432
|
<i
|
|
415
433
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--info"
|
|
434
|
+
role="button"
|
|
416
435
|
style="font-size: 16px; width: 16px;"
|
|
436
|
+
tabindex="0"
|
|
417
437
|
>
|
|
418
438
|
close_round
|
|
419
439
|
</i>
|
|
@@ -458,7 +478,9 @@ exports[`Toast component
|
|
|
458
478
|
</h5>
|
|
459
479
|
<i
|
|
460
480
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--info"
|
|
481
|
+
role="button"
|
|
461
482
|
style="font-size: 16px; width: 16px;"
|
|
483
|
+
tabindex="0"
|
|
462
484
|
>
|
|
463
485
|
close_round
|
|
464
486
|
</i>
|
|
@@ -517,7 +539,9 @@ exports[`Toast component
|
|
|
517
539
|
</h5>
|
|
518
540
|
<i
|
|
519
541
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--success"
|
|
542
|
+
role="button"
|
|
520
543
|
style="font-size: 16px; width: 16px;"
|
|
544
|
+
tabindex="0"
|
|
521
545
|
>
|
|
522
546
|
close_round
|
|
523
547
|
</i>
|
|
@@ -562,7 +586,9 @@ exports[`Toast component
|
|
|
562
586
|
</h5>
|
|
563
587
|
<i
|
|
564
588
|
class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--success"
|
|
589
|
+
role="button"
|
|
565
590
|
style="font-size: 16px; width: 16px;"
|
|
591
|
+
tabindex="0"
|
|
566
592
|
>
|
|
567
593
|
close_round
|
|
568
594
|
</i>
|
|
@@ -621,7 +647,9 @@ exports[`Toast component
|
|
|
621
647
|
</h5>
|
|
622
648
|
<i
|
|
623
649
|
class="material-icons material-icons-round Icon Icon--default Toast-icon Toast-icon--right Toast-icon--warning"
|
|
650
|
+
role="button"
|
|
624
651
|
style="font-size: 16px; width: 16px;"
|
|
652
|
+
tabindex="0"
|
|
625
653
|
>
|
|
626
654
|
close_round
|
|
627
655
|
</i>
|
|
@@ -666,7 +694,9 @@ exports[`Toast component
|
|
|
666
694
|
</h5>
|
|
667
695
|
<i
|
|
668
696
|
class="material-icons material-icons-round Icon Icon--default Toast-icon Toast-icon--right Toast-icon--warning"
|
|
697
|
+
role="button"
|
|
669
698
|
style="font-size: 16px; width: 16px;"
|
|
699
|
+
tabindex="0"
|
|
670
700
|
>
|
|
671
701
|
close_round
|
|
672
702
|
</i>
|
|
@@ -33,11 +33,14 @@ export const Box = (props: InternalBoxProps) => {
|
|
|
33
33
|
className
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
+
/* TODO(a11y): fix accessibility */
|
|
37
|
+
/* eslint-disable */
|
|
36
38
|
return (
|
|
37
39
|
<div {...baseProps} className={MessageClass} onClick={onClick} data-test="DesignSystem-ChatMessage--Box">
|
|
38
40
|
{children}
|
|
39
41
|
</div>
|
|
40
42
|
);
|
|
43
|
+
/* eslint-enable */
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
Box.displayName = 'Box';
|
|
@@ -190,6 +190,8 @@ export const ChipInput = (props: ChipInputProps) => {
|
|
|
190
190
|
});
|
|
191
191
|
|
|
192
192
|
return (
|
|
193
|
+
/* TODO(a11y): fix accessibility */
|
|
194
|
+
/* eslint-disable */
|
|
193
195
|
<div data-test="DesignSystem-ChipInput" {...baseProps} className={ChipInputClass} onClick={onClickHandler}>
|
|
194
196
|
<div className="ChipInput-wrapper">
|
|
195
197
|
{chips && chips.length > 0 && chipComponents}
|
|
@@ -206,6 +208,7 @@ export const ChipInput = (props: ChipInputProps) => {
|
|
|
206
208
|
onChange={onInputChangeHandler}
|
|
207
209
|
onKeyDown={onKeyDownHandler}
|
|
208
210
|
/>
|
|
211
|
+
{/* eslint-enable */}
|
|
209
212
|
</div>
|
|
210
213
|
{chips.length > 0 && (
|
|
211
214
|
<Icon
|
|
@@ -25,7 +25,9 @@ exports[`ChipInput component
|
|
|
25
25
|
<i
|
|
26
26
|
class="material-icons material-icons-round Icon Icon--subtle Chip-icon Chip-icon--right cursor-pointer"
|
|
27
27
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
28
|
+
role="button"
|
|
28
29
|
style="font-size: 16px; width: 16px;"
|
|
30
|
+
tabindex="0"
|
|
29
31
|
>
|
|
30
32
|
clear_round
|
|
31
33
|
</i>
|
|
@@ -43,7 +45,9 @@ exports[`ChipInput component
|
|
|
43
45
|
<i
|
|
44
46
|
class="material-icons material-icons-round Icon Icon--subtle Chip-icon Chip-icon--right cursor-pointer"
|
|
45
47
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
48
|
+
role="button"
|
|
46
49
|
style="font-size: 16px; width: 16px;"
|
|
50
|
+
tabindex="0"
|
|
47
51
|
>
|
|
48
52
|
clear_round
|
|
49
53
|
</i>
|
|
@@ -58,7 +62,9 @@ exports[`ChipInput component
|
|
|
58
62
|
<i
|
|
59
63
|
class="material-icons material-icons-round Icon Icon--subtle ChipInput-icon"
|
|
60
64
|
data-test="DesignSystem-ChipInput--Icon"
|
|
65
|
+
role="button"
|
|
61
66
|
style="font-size: 16px; width: 16px;"
|
|
67
|
+
tabindex="0"
|
|
62
68
|
>
|
|
63
69
|
close_round
|
|
64
70
|
</i>
|
|
@@ -92,7 +98,9 @@ exports[`ChipInput component
|
|
|
92
98
|
<i
|
|
93
99
|
class="material-icons material-icons-round Icon Icon--disabled Chip-icon Chip-icon--right"
|
|
94
100
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
101
|
+
role="button"
|
|
95
102
|
style="font-size: 16px; width: 16px;"
|
|
103
|
+
tabindex="0"
|
|
96
104
|
>
|
|
97
105
|
clear_round
|
|
98
106
|
</i>
|
|
@@ -110,7 +118,9 @@ exports[`ChipInput component
|
|
|
110
118
|
<i
|
|
111
119
|
class="material-icons material-icons-round Icon Icon--disabled Chip-icon Chip-icon--right"
|
|
112
120
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
121
|
+
role="button"
|
|
113
122
|
style="font-size: 16px; width: 16px;"
|
|
123
|
+
tabindex="0"
|
|
114
124
|
>
|
|
115
125
|
clear_round
|
|
116
126
|
</i>
|
|
@@ -126,7 +136,9 @@ exports[`ChipInput component
|
|
|
126
136
|
<i
|
|
127
137
|
class="material-icons material-icons-round Icon Icon--subtle ChipInput-icon"
|
|
128
138
|
data-test="DesignSystem-ChipInput--Icon"
|
|
139
|
+
role="button"
|
|
129
140
|
style="font-size: 16px; width: 16px;"
|
|
141
|
+
tabindex="0"
|
|
130
142
|
>
|
|
131
143
|
close_round
|
|
132
144
|
</i>
|
|
@@ -70,6 +70,8 @@ export const Dropzone = (props: DropzoneProps) => {
|
|
|
70
70
|
<Text size="large" weight="strong" className="mr-2" appearance={disabled ? 'disabled' : 'default'}>
|
|
71
71
|
Drag your files here or
|
|
72
72
|
</Text>
|
|
73
|
+
{/* TODO(a11y): fix accessibility */}
|
|
74
|
+
{/* eslint-disable */}
|
|
73
75
|
<span className="cursor-pointer" onClick={open}>
|
|
74
76
|
<Text size="large" weight="strong" appearance={disabled ? 'disabled' : 'link'}>
|
|
75
77
|
browse files
|
|
@@ -77,6 +79,7 @@ export const Dropzone = (props: DropzoneProps) => {
|
|
|
77
79
|
</span>
|
|
78
80
|
<input {...getInputProps()} />
|
|
79
81
|
</span>
|
|
82
|
+
{/* eslint-enable */}
|
|
80
83
|
{formatLabel && <Text appearance={disabled ? 'disabled' : 'subtle'}>{formatLabel}</Text>}
|
|
81
84
|
{sizeLabel && <Text appearance={disabled ? 'disabled' : 'subtle'}>{sizeLabel}</Text>}
|
|
82
85
|
{sampleFileLink && <div className="mt-5">{sampleFileLink}</div>}
|
|
@@ -87,13 +87,17 @@ export const EditableChipInput = (props: EditableChipInputProps) => {
|
|
|
87
87
|
|
|
88
88
|
const onChangeHandler = (eventType: string) => {
|
|
89
89
|
switch (eventType) {
|
|
90
|
-
case 'edit':
|
|
90
|
+
case 'edit': {
|
|
91
91
|
setShowComponent(true);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
case '
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
case 'hover': {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
case 'default': {
|
|
95
98
|
setShowComponent(false);
|
|
96
|
-
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
97
101
|
}
|
|
98
102
|
};
|
|
99
103
|
|
|
@@ -26,7 +26,7 @@ export const uncontrolled = () => {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const customCode = `() => {
|
|
29
|
-
const onClick = (item) => console.log(
|
|
29
|
+
const onClick = (item) => console.log(\`onClick: \${item}\`);
|
|
30
30
|
const chipOptions = { onClick, clearButton: true };
|
|
31
31
|
const chipInputOptions = {
|
|
32
32
|
chipOptions,
|
|
@@ -32,7 +32,9 @@ exports[`EditableChipInput component
|
|
|
32
32
|
<i
|
|
33
33
|
class="material-icons material-icons-round Icon Icon--subtle Chip-icon Chip-icon--right cursor-pointer"
|
|
34
34
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
35
|
+
role="button"
|
|
35
36
|
style="font-size: 16px; width: 16px;"
|
|
37
|
+
tabindex="0"
|
|
36
38
|
>
|
|
37
39
|
clear_round
|
|
38
40
|
</i>
|
|
@@ -50,7 +52,9 @@ exports[`EditableChipInput component
|
|
|
50
52
|
<i
|
|
51
53
|
class="material-icons material-icons-round Icon Icon--subtle Chip-icon Chip-icon--right cursor-pointer"
|
|
52
54
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
55
|
+
role="button"
|
|
53
56
|
style="font-size: 16px; width: 16px;"
|
|
57
|
+
tabindex="0"
|
|
54
58
|
>
|
|
55
59
|
clear_round
|
|
56
60
|
</i>
|
|
@@ -94,7 +98,9 @@ exports[`EditableChipInput component
|
|
|
94
98
|
<i
|
|
95
99
|
class="material-icons material-icons-round Icon Icon--subtle Chip-icon Chip-icon--right cursor-pointer"
|
|
96
100
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
101
|
+
role="button"
|
|
97
102
|
style="font-size: 16px; width: 16px;"
|
|
103
|
+
tabindex="0"
|
|
98
104
|
>
|
|
99
105
|
clear_round
|
|
100
106
|
</i>
|
|
@@ -112,7 +118,9 @@ exports[`EditableChipInput component
|
|
|
112
118
|
<i
|
|
113
119
|
class="material-icons material-icons-round Icon Icon--subtle Chip-icon Chip-icon--right cursor-pointer"
|
|
114
120
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
121
|
+
role="button"
|
|
115
122
|
style="font-size: 16px; width: 16px;"
|
|
123
|
+
tabindex="0"
|
|
116
124
|
>
|
|
117
125
|
clear_round
|
|
118
126
|
</i>
|
|
@@ -57,12 +57,12 @@ export const EditableDropdown = (props: EditableDropdownProps) => {
|
|
|
57
57
|
switch (eventType) {
|
|
58
58
|
case 'edit':
|
|
59
59
|
setEditing(true);
|
|
60
|
+
break;
|
|
60
61
|
case 'hover':
|
|
61
62
|
setShowComponent(true);
|
|
62
|
-
|
|
63
|
+
break;
|
|
63
64
|
case 'default':
|
|
64
65
|
setShowComponent(false);
|
|
65
|
-
return;
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
|