@automattic/vip-design-system 1.2.0 → 1.2.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/.storybook/decorators/withBoundingBox.tsx +11 -0
- package/.storybook/decorators/{withThemeProvider.jsx → withThemeProvider.tsx} +1 -5
- package/.storybook/{preview.js → preview.tsx} +12 -3
- package/build/declaration.d.js +1 -0
- package/build/system/Accordion/Accordion.d.ts +41 -0
- package/build/system/Accordion/Accordion.js +10 -35
- package/build/system/Accordion/Accordion.stories.d.ts +13 -0
- package/build/system/Accordion/Accordion.stories.js +4 -7
- package/build/system/Accordion/Accordion.test.d.ts +2 -0
- package/build/system/Accordion/Accordion.test.js +5 -7
- package/build/system/Accordion/index.d.ts +5 -0
- package/build/system/Avatar/Avatar.d.ts +13 -0
- package/build/system/Avatar/Avatar.js +7 -20
- package/build/system/Avatar/Avatar.stories.d.ts +16 -0
- package/build/system/Avatar/Avatar.stories.js +5 -7
- package/build/system/Avatar/Avatar.test.d.ts +1 -0
- package/build/system/Avatar/Avatar.test.js +5 -7
- package/build/system/Avatar/index.d.ts +4 -0
- package/build/system/Avatar/index.js +1 -0
- package/build/system/Badge/Badge.d.ts +6 -0
- package/build/system/Badge/Badge.js +6 -15
- package/build/system/Badge/Badge.stories.d.ts +18 -0
- package/build/system/Badge/Badge.stories.js +70 -71
- package/build/system/Badge/Badge.test.d.ts +1 -0
- package/build/system/Badge/Badge.test.js +6 -8
- package/build/system/Badge/index.d.ts +4 -0
- package/build/system/Badge/index.js +1 -0
- package/build/system/Box/Box.d.ts +3 -0
- package/build/system/{Form/Label.stories.js → Box/Box.js} +15 -31
- package/build/system/Box/Box.stories.d.ts +16 -0
- package/build/system/Box/Box.stories.js +21 -0
- package/build/system/Box/index.d.ts +2 -0
- package/build/system/Box/index.js +5 -4
- package/build/system/Button/Button.d.ts +12 -0
- package/build/system/Button/Button.js +10 -18
- package/build/system/Button/Button.stories.d.ts +30 -0
- package/build/system/Button/Button.stories.js +10 -20
- package/build/system/Button/Button.test.d.ts +1 -0
- package/build/system/Button/Button.test.js +45 -74
- package/build/system/Button/ButtonSubmit.d.ts +2 -0
- package/build/system/Button/ButtonSubmit.js +60 -70
- package/build/system/Button/ButtonSubmit.stories.d.ts +38 -0
- package/build/system/Button/ButtonSubmit.stories.jsx +40 -0
- package/build/system/Button/ButtonSubmit.test.d.ts +1 -0
- package/build/system/Button/ButtonSubmit.test.js +32 -60
- package/build/system/Button/index.d.ts +3 -0
- package/build/system/Button/index.js +7 -6
- package/build/system/Button/variants.d.ts +2 -0
- package/build/system/Button/variants.js +1 -6
- package/build/system/Card/Card.d.ts +9 -0
- package/build/system/Card/Card.js +2 -10
- package/build/system/Card/Card.stories.d.ts +7 -0
- package/build/system/Card/Card.stories.js +4 -6
- package/build/system/Card/Card.test.d.ts +1 -0
- package/build/system/Card/Card.test.js +5 -7
- package/build/system/Card/index.d.ts +4 -0
- package/build/system/Card/index.js +1 -0
- package/build/system/Code/Code.d.ts +15 -0
- package/build/system/Code/Code.js +14 -21
- package/build/system/Code/Code.stories.d.ts +18 -0
- package/build/system/Code/Code.stories.js +31 -23
- package/build/system/Code/Code.test.d.ts +1 -0
- package/build/system/Code/Code.test.js +10 -11
- package/build/system/Code/index.d.ts +4 -0
- package/build/system/Code/index.js +1 -0
- package/build/system/ConfirmationDialog/ConfirmationDialog.d.ts +35 -0
- package/build/system/ConfirmationDialog/ConfirmationDialog.js +68 -94
- package/build/system/ConfirmationDialog/ConfirmationDialog.stories.d.ts +7 -0
- package/build/system/ConfirmationDialog/ConfirmationDialog.stories.jsx +29 -0
- package/build/system/ConfirmationDialog/index.d.ts +3 -0
- package/build/system/ConfirmationDialog/index.js +5 -5
- package/build/system/Dialog/Dialog.d.ts +18 -0
- package/build/system/Dialog/Dialog.js +81 -94
- package/build/system/Dialog/Dialog.stories.d.ts +7 -0
- package/build/system/Dialog/Dialog.stories.jsx +60 -0
- package/build/system/Dialog/DialogButton.d.ts +16 -0
- package/build/system/Dialog/DialogButton.js +51 -66
- package/build/system/Dialog/DialogContent.d.ts +18 -0
- package/build/system/Dialog/DialogContent.js +142 -137
- package/build/system/Dialog/DialogDivider.d.ts +5 -0
- package/build/system/Dialog/DialogDivider.js +5 -16
- package/build/system/Dialog/DialogMenu.d.ts +5 -0
- package/build/system/Dialog/DialogMenu.js +5 -18
- package/build/system/Dialog/DialogMenuItem.d.ts +13 -0
- package/build/system/Dialog/DialogMenuItem.js +64 -71
- package/build/system/Dialog/DialogTrigger.d.ts +1 -0
- package/build/system/Dialog/DialogTrigger.js +10 -16
- package/build/system/Dialog/index.d.ts +8 -0
- package/build/system/Dialog/index.js +19 -16
- package/build/system/Dropdown/Dropdown.d.ts +37 -0
- package/build/system/Dropdown/Dropdown.js +96 -93
- package/build/system/Dropdown/Dropdown.stories.d.ts +34 -0
- package/build/system/Dropdown/Dropdown.stories.jsx +170 -0
- package/build/system/Dropdown/Dropdown.test.d.ts +1 -0
- package/build/system/Dropdown/Dropdown.test.js +30 -52
- package/build/system/Dropdown/DropdownContent.d.ts +11 -0
- package/build/system/Dropdown/DropdownContent.js +40 -49
- package/build/system/Dropdown/DropdownItem.d.ts +32 -0
- package/build/system/Dropdown/DropdownItem.js +91 -95
- package/build/system/Dropdown/DropdownLabel.d.ts +8 -0
- package/build/system/Dropdown/DropdownLabel.js +24 -33
- package/build/system/Dropdown/DropdownSeparator.d.ts +7 -0
- package/build/system/Dropdown/DropdownSeparator.js +23 -32
- package/build/system/Dropdown/index.d.ts +40 -0
- package/build/system/Dropdown/index.js +49 -37
- package/build/system/Flex/Flex.d.ts +2 -0
- package/build/system/Flex/Flex.js +6 -8
- package/build/system/Flex/Flex.stories.d.ts +7 -0
- package/build/system/Flex/Flex.stories.js +3 -5
- package/build/system/Flex/index.d.ts +4 -0
- package/build/system/Flex/index.js +1 -0
- package/build/system/Form/Checkbox.d.ts +10 -0
- package/build/system/Form/Checkbox.js +61 -62
- package/build/system/Form/Checkbox.stories.d.ts +7 -0
- package/build/system/Form/Checkbox.stories.jsx +54 -0
- package/build/system/Form/Input.d.ts +2 -0
- package/build/system/Form/Input.js +70 -69
- package/build/system/Form/Input.stories.d.ts +5 -0
- package/build/system/Form/Input.stories.jsx +38 -0
- package/build/system/Form/Input.styles.d.ts +32 -0
- package/build/system/Form/Input.styles.js +29 -40
- package/build/system/Form/InputWithCopyButton.d.ts +2 -0
- package/build/system/Form/InputWithCopyButton.js +109 -105
- package/build/system/Form/InputWithCopyButton.stories.d.ts +5 -0
- package/build/system/Form/InputWithCopyButton.stories.jsx +30 -0
- package/build/system/Form/Label.d.ts +9 -0
- package/build/system/Form/Label.js +41 -47
- package/build/system/Form/Label.stories.d.ts +6 -0
- package/build/system/Form/Label.stories.jsx +36 -0
- package/build/system/Form/Radio.d.ts +2 -0
- package/build/system/Form/Radio.js +185 -169
- package/build/system/Form/Radio.stories.d.ts +7 -0
- package/build/system/Form/Radio.stories.jsx +100 -0
- package/build/system/Form/RadioBoxGroup.d.ts +2 -0
- package/build/system/Form/RadioBoxGroup.js +193 -187
- package/build/system/Form/RadioBoxGroup.stories.d.ts +8 -0
- package/build/system/Form/RadioBoxGroup.stories.jsx +60 -0
- package/build/system/Form/RequiredLabel.d.ts +5 -0
- package/build/system/Form/RequiredLabel.js +7 -17
- package/build/system/Form/Textarea.d.ts +2 -0
- package/build/system/Form/Textarea.js +18 -20
- package/build/system/Form/Textarea.stories.d.ts +34 -0
- package/build/system/Form/Textarea.stories.jsx +40 -0
- package/build/system/Form/Toggle.d.ts +2 -0
- package/build/system/Form/Toggle.js +67 -81
- package/build/system/Form/Toggle.stories.d.ts +19 -0
- package/build/system/Form/Toggle.stories.jsx +96 -0
- package/build/system/Form/Toggle.test.d.ts +1 -0
- package/build/system/Form/Toggle.test.js +21 -39
- package/build/system/Form/ToggleRow.d.ts +22 -0
- package/build/system/Form/ToggleRow.js +66 -95
- package/build/system/Form/Validation.d.ts +14 -0
- package/build/system/Form/Validation.js +33 -42
- package/build/system/Form/index.d.ts +11 -0
- package/build/system/Form/index.js +25 -22
- package/build/system/Grid/Grid.d.ts +6 -0
- package/build/system/Grid/Grid.js +4 -5
- package/build/system/Grid/Grid.stories.d.ts +7 -0
- package/build/system/Grid/Grid.stories.js +3 -5
- package/build/system/Grid/index.d.ts +4 -0
- package/build/system/Grid/index.js +1 -0
- package/build/system/Heading/Heading.d.ts +6 -0
- package/build/system/Heading/Heading.js +33 -0
- package/build/system/Heading/Heading.stories.d.ts +7 -0
- package/build/system/Heading/Heading.stories.js +33 -0
- package/build/system/Heading/index.d.ts +2 -0
- package/build/system/Heading/index.js +5 -4
- package/build/system/Link/Link.d.ts +6 -0
- package/build/system/Link/Link.js +5 -12
- package/build/system/Link/Link.stories.d.ts +16 -0
- package/build/system/Link/Link.stories.js +12 -13
- package/build/system/Link/index.d.ts +4 -0
- package/build/system/Link/index.js +1 -0
- package/build/system/NewConfirmationDialog/NewConfirmationDialog.d.ts +23 -0
- package/build/system/NewConfirmationDialog/NewConfirmationDialog.js +86 -99
- package/build/system/NewConfirmationDialog/NewConfirmationDialog.stories.d.ts +8 -0
- package/build/system/NewConfirmationDialog/NewConfirmationDialog.stories.jsx +34 -0
- package/build/system/NewConfirmationDialog/NewConfirmationDialog.test.d.ts +1 -0
- package/build/system/NewConfirmationDialog/NewConfirmationDialog.test.js +43 -66
- package/build/system/NewConfirmationDialog/index.d.ts +2 -0
- package/build/system/NewConfirmationDialog/index.js +5 -4
- package/build/system/NewDialog/DialogClose.d.ts +6 -0
- package/build/system/NewDialog/DialogClose.js +50 -69
- package/build/system/NewDialog/DialogClose.test.d.ts +1 -0
- package/build/system/NewDialog/DialogClose.test.js +29 -46
- package/build/system/NewDialog/DialogContent.d.ts +18 -0
- package/build/system/NewDialog/DialogContent.js +14 -21
- package/build/system/NewDialog/DialogDescription.d.ts +5 -0
- package/build/system/NewDialog/DialogDescription.js +31 -38
- package/build/system/NewDialog/DialogDescription.test.d.ts +1 -0
- package/build/system/NewDialog/DialogDescription.test.js +44 -67
- package/build/system/NewDialog/DialogOverlay.d.ts +2 -0
- package/build/system/NewDialog/DialogOverlay.js +28 -32
- package/build/system/NewDialog/DialogOverlay.test.d.ts +1 -0
- package/build/system/NewDialog/DialogOverlay.test.js +26 -42
- package/build/system/NewDialog/DialogTitle.d.ts +11 -0
- package/build/system/NewDialog/DialogTitle.js +19 -34
- package/build/system/NewDialog/DialogTitle.test.d.ts +1 -0
- package/build/system/NewDialog/DialogTitle.test.js +44 -67
- package/build/system/NewDialog/NewDialog.d.ts +29 -0
- package/build/system/NewDialog/NewDialog.js +74 -89
- package/build/system/NewDialog/NewDialog.stories.d.ts +38 -0
- package/build/system/NewDialog/NewDialog.stories.jsx +192 -0
- package/build/system/NewDialog/index.d.ts +31 -0
- package/build/system/NewDialog/index.js +9 -13
- package/build/system/NewForm/Fieldset.d.ts +2 -0
- package/build/system/NewForm/Fieldset.js +38 -43
- package/build/system/NewForm/Form.d.ts +2 -0
- package/build/system/NewForm/Form.js +21 -28
- package/build/system/NewForm/FormAutocomplete.d.ts +2 -0
- package/build/system/NewForm/FormAutocomplete.js +386 -381
- package/build/system/NewForm/FormAutocomplete.stories.d.ts +156 -0
- package/build/system/NewForm/FormAutocomplete.stories.jsx +159 -0
- package/build/system/NewForm/FormAutocomplete.test.d.ts +1 -0
- package/build/system/NewForm/FormAutocomplete.test.js +40 -73
- package/build/system/NewForm/FormAutocompleteMultiselect.d.ts +2 -0
- package/build/system/NewForm/FormAutocompleteMultiselect.js +456 -468
- package/build/system/NewForm/FormAutocompleteMultiselect.stories.d.ts +45 -0
- package/build/system/NewForm/FormAutocompleteMultiselect.stories.jsx +162 -0
- package/build/system/NewForm/FormAutocompleteMultiselect.test.d.ts +1 -0
- package/build/system/NewForm/FormAutocompleteMultiselect.test.js +37 -73
- package/build/system/NewForm/FormSelect.d.ts +2 -0
- package/build/system/NewForm/FormSelect.js +159 -140
- package/build/system/NewForm/FormSelect.stories.d.ts +137 -0
- package/build/system/NewForm/FormSelect.stories.jsx +138 -0
- package/build/system/NewForm/FormSelect.test.d.ts +1 -0
- package/build/system/NewForm/FormSelect.test.js +131 -227
- package/build/system/NewForm/FormSelectArrow.d.ts +2 -0
- package/build/system/NewForm/FormSelectArrow.js +35 -35
- package/build/system/NewForm/FormSelectContent.d.ts +2 -0
- package/build/system/NewForm/FormSelectContent.js +27 -34
- package/build/system/NewForm/FormSelectInline.d.ts +30 -0
- package/build/system/NewForm/FormSelectInline.js +41 -38
- package/build/system/NewForm/FormSelectLoading.d.ts +2 -0
- package/build/system/NewForm/FormSelectLoading.js +36 -45
- package/build/system/NewForm/FormSelectSearch.d.ts +2 -0
- package/build/system/NewForm/FormSelectSearch.js +23 -25
- package/build/system/NewForm/Legend.d.ts +2 -0
- package/build/system/NewForm/Legend.js +32 -37
- package/build/system/NewForm/index.d.ts +12 -0
- package/build/system/NewForm/index.js +30 -30
- package/build/system/Notice/Notice.d.ts +18 -0
- package/build/system/Notice/Notice.js +41 -55
- package/build/system/Notice/Notice.stories.d.ts +13 -0
- package/build/system/Notice/Notice.stories.js +3 -5
- package/build/system/Notice/index.d.ts +5 -0
- package/build/system/OptionRow/OptionRow.d.ts +2 -0
- package/build/system/OptionRow/OptionRow.js +146 -159
- package/build/system/OptionRow/OptionRow.stories.d.ts +8 -0
- package/build/system/OptionRow/OptionRow.stories.jsx +53 -0
- package/build/system/OptionRow/OptionRow.test.d.ts +1 -0
- package/build/system/OptionRow/OptionRow.test.js +38 -67
- package/build/system/OptionRow/index.d.ts +2 -0
- package/build/system/OptionRow/index.js +5 -4
- package/build/system/Progress/Progress.d.ts +2 -0
- package/build/system/Progress/Progress.js +69 -84
- package/build/system/Progress/Progress.stories.d.ts +8 -0
- package/build/system/Progress/Progress.stories.jsx +25 -0
- package/build/system/Progress/index.d.ts +2 -0
- package/build/system/Progress/index.js +5 -4
- package/build/system/ScreenReaderText/ScreenReader.test.d.ts +1 -0
- package/build/system/ScreenReaderText/ScreenReader.test.js +21 -25
- package/build/system/ScreenReaderText/ScreenReaderText.d.ts +14 -0
- package/build/system/ScreenReaderText/ScreenReaderText.js +13 -21
- package/build/system/ScreenReaderText/index.d.ts +3 -0
- package/build/system/ScreenReaderText/index.js +6 -8
- package/build/system/Spinner/Spinner.d.ts +9 -0
- package/build/system/Spinner/Spinner.js +12 -19
- package/build/system/Spinner/Spinner.stories.d.ts +7 -0
- package/build/system/Spinner/Spinner.stories.js +3 -5
- package/build/system/Spinner/Spinner.test.d.ts +1 -0
- package/build/system/Spinner/Spinner.test.js +59 -0
- package/build/system/Spinner/index.d.ts +1 -0
- package/build/system/Spinner/index.js +1 -0
- package/build/system/Table/Table.d.ts +14 -0
- package/build/system/Table/Table.js +7 -21
- package/build/system/Table/Table.stories.d.ts +9 -0
- package/build/system/Table/Table.stories.js +5 -12
- package/build/system/Table/TableCell.d.ts +15 -0
- package/build/system/Table/TableCell.js +13 -18
- package/build/system/Table/TableRow.d.ts +14 -0
- package/build/system/Table/TableRow.js +19 -24
- package/build/system/Table/index.d.ts +6 -0
- package/build/system/Table/index.js +1 -0
- package/build/system/Tabs/Tabs.d.ts +5 -0
- package/build/system/Tabs/Tabs.js +40 -38
- package/build/system/Tabs/Tabs.stories.d.ts +9 -0
- package/build/system/Tabs/Tabs.stories.jsx +69 -0
- package/build/system/Tabs/TabsContent.d.ts +16 -0
- package/build/system/Tabs/TabsContent.js +23 -30
- package/build/system/Tabs/TabsList.d.ts +15 -0
- package/build/system/Tabs/TabsList.js +24 -32
- package/build/system/Tabs/TabsTrigger.d.ts +2 -0
- package/build/system/Tabs/TabsTrigger.js +58 -66
- package/build/system/Tabs/index.d.ts +5 -0
- package/build/system/Tabs/index.js +8 -10
- package/build/system/Text/Text.d.ts +2 -0
- package/build/system/Text/Text.js +5 -13
- package/build/system/Text/Text.stories.d.ts +8 -0
- package/build/system/Text/Text.stories.js +4 -5
- package/build/system/Text/index.d.ts +4 -0
- package/build/system/Text/index.js +1 -0
- package/build/system/Tooltip/Tooltip.css +96 -0
- package/build/system/Tooltip/Tooltip.d.ts +15 -0
- package/build/system/Tooltip/Tooltip.js +23 -93
- package/build/system/Tooltip/Tooltip.stories.d.ts +15 -0
- package/build/system/Tooltip/Tooltip.stories.js +83 -21
- package/build/system/Tooltip/index.d.ts +5 -0
- package/build/system/Wizard/Wizard.d.ts +2 -0
- package/build/system/Wizard/Wizard.js +94 -103
- package/build/system/Wizard/Wizard.stories.d.ts +9 -0
- package/build/system/Wizard/Wizard.stories.jsx +145 -0
- package/build/system/Wizard/WizardStep.d.ts +2 -0
- package/build/system/Wizard/WizardStep.js +188 -198
- package/build/system/Wizard/WizardStepHorizontal.d.ts +2 -0
- package/build/system/Wizard/WizardStepHorizontal.js +43 -55
- package/build/system/Wizard/index.d.ts +4 -0
- package/build/system/Wizard/index.js +7 -8
- package/build/system/index.d.ts +51 -0
- package/build/system/index.js +104 -86
- package/build/system/theme/colors.d.ts +2 -0
- package/build/system/theme/colors.js +7 -12
- package/build/system/theme/getColor.d.ts +8 -0
- package/build/system/theme/getColor.js +47 -46
- package/build/system/theme/index.d.ts +322 -0
- package/build/system/theme/index.js +494 -396
- package/build/system/theme/textStyles.d.ts +71 -0
- package/build/system/theme/textStyles.js +45 -50
- package/build/system/utils/random.d.ts +1 -0
- package/build/system/utils/random.js +3 -7
- package/package.json +31 -37
- package/src/declaration.d.ts +1 -0
- package/src/system/Accordion/{Accordion.test.js → Accordion.test.tsx} +2 -2
- package/src/system/Accordion/{Accordion.js → Accordion.tsx} +87 -80
- package/src/system/Avatar/Avatar.stories.tsx +18 -0
- package/src/system/Avatar/{Avatar.test.js → Avatar.test.tsx} +2 -2
- package/src/system/Avatar/{Avatar.js → Avatar.tsx} +17 -19
- package/src/system/Avatar/index.ts +4 -0
- package/src/system/Badge/Badge.stories.tsx +57 -0
- package/src/system/Badge/{Badge.test.js → Badge.test.tsx} +3 -3
- package/src/system/Badge/{Badge.js → Badge.tsx} +10 -15
- package/src/system/Badge/index.ts +4 -0
- package/src/system/Box/Box.stories.tsx +13 -1
- package/src/system/Box/Box.tsx +4 -8
- package/src/system/Button/Button.stories.tsx +110 -0
- package/src/system/Button/Button.tsx +67 -0
- package/src/system/Card/{Card.stories.jsx → Card.stories.tsx} +1 -1
- package/src/system/Card/{Card.test.js → Card.test.tsx} +2 -2
- package/src/system/Card/Card.tsx +40 -0
- package/src/system/Card/index.ts +4 -0
- package/src/system/Code/Code.stories.tsx +44 -0
- package/src/system/Code/{Code.test.js → Code.test.tsx} +6 -4
- package/src/system/Code/{Code.js → Code.tsx} +27 -22
- package/src/system/Code/index.ts +4 -0
- package/src/system/Flex/Flex.tsx +11 -0
- package/src/system/Flex/index.ts +4 -0
- package/src/system/Grid/Grid.tsx +11 -0
- package/src/system/Grid/index.ts +4 -0
- package/src/system/Heading/Heading.tsx +8 -17
- package/src/system/Link/Link.stories.tsx +23 -0
- package/src/system/Link/Link.tsx +43 -0
- package/src/system/Link/index.ts +4 -0
- package/src/system/NewForm/FormAutocomplete.js +2 -2
- package/src/system/Notice/Notice.tsx +129 -0
- package/src/system/OptionRow/OptionRow.test.js +1 -1
- package/src/system/ScreenReaderText/ScreenReaderText.tsx +40 -0
- package/src/system/Spinner/Spinner.test.tsx +30 -0
- package/src/system/Spinner/Spinner.tsx +34 -0
- package/src/system/Spinner/index.ts +1 -0
- package/src/system/Table/{Table.stories.jsx → Table.stories.tsx} +6 -6
- package/src/system/Table/{Table.js → Table.tsx} +14 -18
- package/src/system/Table/{TableCell.js → TableCell.tsx} +14 -12
- package/src/system/Table/TableRow.tsx +63 -0
- package/src/system/Table/index.ts +6 -0
- package/src/system/Text/{Text.stories.jsx → Text.stories.tsx} +1 -0
- package/src/system/Text/Text.tsx +25 -0
- package/src/system/Text/index.ts +4 -0
- package/src/system/Tooltip/Tooltip.css +96 -0
- package/src/system/Tooltip/Tooltip.stories.tsx +133 -0
- package/src/system/Tooltip/Tooltip.tsx +39 -0
- package/src/system/index.js +1 -2
- package/src/system/theme/index.js +21 -1
- package/test/fileMock.ts +1 -0
- package/test/setupAfterEnv.ts +5 -0
- package/tsconfig.definition.json +12 -0
- package/.storybook/decorators/withBoundingBox.jsx +0 -22
- package/build/system/Box/Box.stories.tsx +0 -11
- package/build/system/Box/Box.tsx +0 -22
- package/build/system/Button/ButtonSubmit.stories.js +0 -58
- package/build/system/ConfirmationDialog/ConfirmationDialog.stories.js +0 -42
- package/build/system/Dialog/Dialog.stories.js +0 -70
- package/build/system/Dropdown/Dropdown.stories.js +0 -197
- package/build/system/Form/Checkbox.stories.js +0 -73
- package/build/system/Form/Input.stories.js +0 -51
- package/build/system/Form/InputWithCopyButton.stories.js +0 -39
- package/build/system/Form/Radio.stories.js +0 -115
- package/build/system/Form/RadioBoxGroup.stories.js +0 -62
- package/build/system/Form/Textarea.stories.js +0 -59
- package/build/system/Form/Toggle.stories.js +0 -104
- package/build/system/Heading/Heading.stories.tsx +0 -19
- package/build/system/Heading/Heading.tsx +0 -38
- package/build/system/NewConfirmationDialog/NewConfirmationDialog.stories.js +0 -46
- package/build/system/NewDialog/NewDialog.stories.js +0 -247
- package/build/system/NewForm/FormAutocomplete.stories.js +0 -220
- package/build/system/NewForm/FormAutocompleteMultiselect.stories.js +0 -231
- package/build/system/NewForm/FormSelect.stories.js +0 -171
- package/build/system/Notification/Notification.js +0 -97
- package/build/system/Notification/Notification.stories.js +0 -29
- package/build/system/Notification/index.js +0 -5
- package/build/system/OptionRow/OptionRow.stories.js +0 -64
- package/build/system/Progress/Progress.stories.js +0 -36
- package/build/system/Tabs/Tabs.stories.js +0 -113
- package/build/system/Wizard/Wizard.stories.js +0 -182
- package/src/system/Avatar/Avatar.stories.jsx +0 -11
- package/src/system/Avatar/index.js +0 -6
- package/src/system/Badge/Badge.stories.jsx +0 -43
- package/src/system/Badge/index.js +0 -6
- package/src/system/Button/Button.js +0 -63
- package/src/system/Button/Button.stories.jsx +0 -87
- package/src/system/Card/Card.js +0 -39
- package/src/system/Card/index.js +0 -6
- package/src/system/Code/Code.stories.jsx +0 -37
- package/src/system/Code/index.js +0 -6
- package/src/system/Flex/Flex.js +0 -15
- package/src/system/Flex/index.js +0 -6
- package/src/system/Grid/Grid.js +0 -16
- package/src/system/Grid/index.js +0 -6
- package/src/system/Link/Link.js +0 -42
- package/src/system/Link/Link.stories.jsx +0 -15
- package/src/system/Link/index.js +0 -6
- package/src/system/Notice/Notice.js +0 -136
- package/src/system/Notification/Notification.js +0 -66
- package/src/system/Notification/Notification.stories.jsx +0 -16
- package/src/system/Notification/index.js +0 -6
- package/src/system/ScreenReaderText/ScreenReaderText.js +0 -39
- package/src/system/Spinner/Spinner.js +0 -34
- package/src/system/Spinner/index.js +0 -6
- package/src/system/Table/TableRow.js +0 -50
- package/src/system/Table/index.js +0 -8
- package/src/system/Text/Text.js +0 -33
- package/src/system/Text/index.js +0 -6
- package/src/system/Tooltip/Tooltip.js +0 -79
- package/src/system/Tooltip/Tooltip.stories.jsx +0 -22
- package/test/fileMock.js +0 -1
- package/test/setupAfterEnv.js +0 -13
- package/test/setupTests.js +0 -4
- /package/.storybook/decorators/{withColorMode.jsx → withColorMode.tsx} +0 -0
- /package/src/system/Accordion/{Accordion.stories.jsx → Accordion.stories.tsx} +0 -0
- /package/src/system/Accordion/{index.js → index.ts} +0 -0
- /package/src/system/Flex/{Flex.stories.jsx → Flex.stories.tsx} +0 -0
- /package/src/system/Grid/{Grid.stories.jsx → Grid.stories.tsx} +0 -0
- /package/src/system/Notice/{Notice.stories.jsx → Notice.stories.tsx} +0 -0
- /package/src/system/Notice/{index.js → index.ts} +0 -0
- /package/src/system/Spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +0 -0
- /package/src/system/Tooltip/{index.js → index.ts} +0 -0
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.Table = void 0;
|
|
5
|
-
var _react =
|
|
6
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
5
|
+
var _react = require("react");
|
|
7
6
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
7
|
var _ScreenReaderText = require("../ScreenReaderText/ScreenReaderText");
|
|
9
8
|
var _ = require("../");
|
|
@@ -11,6 +10,7 @@ var _random = require("../utils/random");
|
|
|
11
10
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
12
11
|
var _excluded = ["sx", "className", "children", "caption"];
|
|
13
12
|
/** @jsxImportSource theme-ui */
|
|
13
|
+
// we'll need jsxImportSource for the sx prop when used with html elements
|
|
14
14
|
/**
|
|
15
15
|
* External dependencies
|
|
16
16
|
*/
|
|
@@ -18,16 +18,13 @@ var _excluded = ["sx", "className", "children", "caption"];
|
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
21
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
24
22
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
-
var Table = /*#__PURE__*/_react
|
|
23
|
+
var Table = exports.Table = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
26
24
|
var sx = _ref.sx,
|
|
27
25
|
className = _ref.className,
|
|
28
26
|
children = _ref.children,
|
|
29
|
-
|
|
30
|
-
caption = _ref$caption === void 0 ? null : _ref$caption,
|
|
27
|
+
caption = _ref.caption,
|
|
31
28
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
32
29
|
if (!caption) {
|
|
33
30
|
// eslint-disable-next-line no-console
|
|
@@ -43,11 +40,7 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef
|
|
|
43
40
|
overflowX: 'auto'
|
|
44
41
|
},
|
|
45
42
|
role: "region",
|
|
46
|
-
"aria-labelledby": captionId
|
|
47
|
-
// Because this container is scrollable, it needs to be focusable.
|
|
48
|
-
// A tabIndex value of 0 makes it focusable by keyboard and does not
|
|
49
|
-
// interfere with the tab order.
|
|
50
|
-
,
|
|
43
|
+
"aria-labelledby": captionId,
|
|
51
44
|
tabIndex: 0,
|
|
52
45
|
children: (0, _jsxRuntime.jsxs)("table", _extends({
|
|
53
46
|
sx: _extends({
|
|
@@ -56,7 +49,7 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef
|
|
|
56
49
|
borderSpacing: 0
|
|
57
50
|
}, sx),
|
|
58
51
|
className: (0, _classnames["default"])('vip-table-component-element', className),
|
|
59
|
-
ref:
|
|
52
|
+
ref: ref
|
|
60
53
|
}, props, {
|
|
61
54
|
children: [caption && (0, _jsxRuntime.jsx)("caption", {
|
|
62
55
|
id: captionId,
|
|
@@ -66,11 +59,4 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef
|
|
|
66
59
|
}))
|
|
67
60
|
});
|
|
68
61
|
});
|
|
69
|
-
|
|
70
|
-
Table.displayName = 'Table';
|
|
71
|
-
Table.propTypes = {
|
|
72
|
-
sx: _propTypes["default"].object,
|
|
73
|
-
className: _propTypes["default"].any,
|
|
74
|
-
children: _propTypes["default"].any,
|
|
75
|
-
caption: _propTypes["default"].string.isRequired
|
|
76
|
-
};
|
|
62
|
+
Table.displayName = 'Table';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").ForwardRefExoticComponent<import("./Table").TableProps & import("react").RefAttributes<HTMLTableElement>>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: () => import("react").JSX.Element;
|
|
9
|
+
export declare const WithHorizontalScroll: () => import("react").JSX.Element;
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = exports.WithHorizontalScroll = exports.Default = void 0;
|
|
5
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
5
|
var _ = require("..");
|
|
7
6
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
7
|
/** @jsxImportSource theme-ui */
|
|
8
|
+
// we'll need jsxImportSource for the sx prop when used with html elements
|
|
10
9
|
/**
|
|
11
10
|
* External dependencies
|
|
12
11
|
*/
|
|
13
12
|
/**
|
|
14
13
|
* Internal dependencies
|
|
15
14
|
*/
|
|
16
|
-
var _default = {
|
|
15
|
+
var _default = exports["default"] = {
|
|
17
16
|
title: 'Table',
|
|
18
17
|
component: _.Table
|
|
19
18
|
};
|
|
20
|
-
exports["default"] = _default;
|
|
21
19
|
var ExampleTable = function ExampleTable(_ref) {
|
|
22
20
|
var caption = _ref.caption;
|
|
23
21
|
return (0, _jsxRuntime.jsxs)(_.Table, {
|
|
@@ -70,16 +68,12 @@ var ExampleTable = function ExampleTable(_ref) {
|
|
|
70
68
|
})]
|
|
71
69
|
});
|
|
72
70
|
};
|
|
73
|
-
|
|
74
|
-
caption: _propTypes["default"].string.isRequired
|
|
75
|
-
};
|
|
76
|
-
var Default = function Default() {
|
|
71
|
+
var Default = exports.Default = function Default() {
|
|
77
72
|
return (0, _jsxRuntime.jsx)(ExampleTable, {
|
|
78
73
|
caption: "Example Table"
|
|
79
74
|
});
|
|
80
75
|
};
|
|
81
|
-
exports.
|
|
82
|
-
var WithHorizontalScroll = function WithHorizontalScroll() {
|
|
76
|
+
var WithHorizontalScroll = exports.WithHorizontalScroll = function WithHorizontalScroll() {
|
|
83
77
|
return (0, _jsxRuntime.jsx)("div", {
|
|
84
78
|
sx: {
|
|
85
79
|
maxWidth: '800px'
|
|
@@ -88,5 +82,4 @@ var WithHorizontalScroll = function WithHorizontalScroll() {
|
|
|
88
82
|
caption: "Horizontal Scroll Example"
|
|
89
83
|
})
|
|
90
84
|
});
|
|
91
|
-
};
|
|
92
|
-
exports.WithHorizontalScroll = WithHorizontalScroll;
|
|
85
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
/**
|
|
3
|
+
* External dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { ThemeUIStyleObject } from 'theme-ui';
|
|
7
|
+
export interface TableCellProps extends React.HTMLProps<HTMLTableCellElement> {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
head?: boolean;
|
|
10
|
+
sx?: ThemeUIStyleObject;
|
|
11
|
+
}
|
|
12
|
+
export declare const TableCell: {
|
|
13
|
+
({ children, head, sx, ...rest }: TableCellProps): import("react").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.TableCell = void 0;
|
|
5
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
5
|
var _ = require("../");
|
|
7
6
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
8
|
-
var _excluded = ["head", "
|
|
7
|
+
var _excluded = ["children", "head", "sx"];
|
|
9
8
|
/** @jsxImportSource theme-ui */
|
|
9
|
+
// we'll need jsxImportSource for the sx prop when used with html elements
|
|
10
10
|
/**
|
|
11
11
|
* External dependencies
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
-
var TableCell = function TableCell(_ref) {
|
|
20
|
-
var
|
|
21
|
-
|
|
18
|
+
var TableCell = exports.TableCell = function TableCell(_ref) {
|
|
19
|
+
var children = _ref.children,
|
|
20
|
+
head = _ref.head,
|
|
21
|
+
sx = _ref.sx,
|
|
22
22
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
23
|
-
var
|
|
23
|
+
var style = _extends({
|
|
24
24
|
borderBottom: '1px solid',
|
|
25
25
|
borderTop: head ? '1px solid' : 'none',
|
|
26
26
|
// borderColor should come after borderTop so it can override it
|
|
@@ -29,12 +29,11 @@ var TableCell = function TableCell(_ref) {
|
|
|
29
29
|
px: 3,
|
|
30
30
|
py: 2,
|
|
31
31
|
textAlign: 'left'
|
|
32
|
-
},
|
|
33
|
-
return (0, _jsxRuntime.jsx)(_.Box, _extends({
|
|
34
|
-
as: head ? 'th' : 'td'
|
|
35
|
-
|
|
36
|
-
sx:
|
|
37
|
-
}), {
|
|
32
|
+
}, sx);
|
|
33
|
+
return (0, _jsxRuntime.jsx)(_.Box, _extends({}, rest, {
|
|
34
|
+
as: head ? 'th' : 'td',
|
|
35
|
+
ref: undefined,
|
|
36
|
+
sx: style,
|
|
38
37
|
children: head ? (0, _jsxRuntime.jsx)("span", {
|
|
39
38
|
sx: {
|
|
40
39
|
mb: 0,
|
|
@@ -46,8 +45,4 @@ var TableCell = function TableCell(_ref) {
|
|
|
46
45
|
}) : children
|
|
47
46
|
}));
|
|
48
47
|
};
|
|
49
|
-
|
|
50
|
-
TableCell.propTypes = {
|
|
51
|
-
children: _propTypes["default"].node,
|
|
52
|
-
head: _propTypes["default"].bool
|
|
53
|
-
};
|
|
48
|
+
TableCell.displayName = 'TableCell';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
/**
|
|
3
|
+
* External dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { ThemeUIStyleObject } from 'theme-ui';
|
|
7
|
+
export interface TableRowProps extends React.HTMLProps<HTMLTableRowElement> {
|
|
8
|
+
cells?: ReactNode[];
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
head?: boolean;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
sx?: ThemeUIStyleObject;
|
|
13
|
+
}
|
|
14
|
+
export declare const TableRow: ({ onClick, head, cells, children, sx, ...rest }: TableRowProps) => import("react").JSX.Element;
|
|
@@ -2,56 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.TableRow = void 0;
|
|
5
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
5
|
var _TableCell = require("./TableCell");
|
|
7
6
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
8
|
-
|
|
7
|
+
var _excluded = ["onClick", "head", "cells", "children", "sx"];
|
|
9
8
|
/** @jsxImportSource theme-ui */
|
|
10
|
-
|
|
9
|
+
// we'll need jsxImportSource for the sx prop when used with html elements
|
|
11
10
|
/**
|
|
12
11
|
* External dependencies
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
13
|
/**
|
|
16
14
|
* Internal dependencies
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
|
-
var
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
+
var TableRow = exports.TableRow = function TableRow(_ref) {
|
|
20
19
|
var onClick = _ref.onClick,
|
|
21
20
|
_ref$head = _ref.head,
|
|
22
21
|
head = _ref$head === void 0 ? false : _ref$head,
|
|
23
22
|
_ref$cells = _ref.cells,
|
|
24
23
|
cells = _ref$cells === void 0 ? [] : _ref$cells,
|
|
25
|
-
children = _ref.children
|
|
26
|
-
|
|
24
|
+
children = _ref.children,
|
|
25
|
+
sx = _ref.sx,
|
|
26
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
27
|
+
var hoverStyles = _extends({
|
|
27
28
|
cursor: 'pointer',
|
|
28
29
|
'&:hover': {
|
|
29
30
|
bg: 'hover',
|
|
30
31
|
borderRadius: 2
|
|
31
32
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (
|
|
33
|
+
}, sx);
|
|
34
|
+
function handleKeyPress(evt) {
|
|
35
|
+
if (onClick && evt.key === 'Enter') {
|
|
35
36
|
onClick();
|
|
36
37
|
}
|
|
37
|
-
}
|
|
38
|
-
return (0, _jsxRuntime.jsxs)("tr", {
|
|
39
|
-
sx: hoverStyles,
|
|
38
|
+
}
|
|
39
|
+
return (0, _jsxRuntime.jsxs)("tr", _extends({
|
|
40
|
+
sx: onClick ? hoverStyles : sx,
|
|
40
41
|
onClick: onClick,
|
|
41
|
-
tabIndex: onClick ? 0 :
|
|
42
|
-
onKeyDown: handleKeyPress
|
|
42
|
+
tabIndex: onClick ? 0 : undefined,
|
|
43
|
+
onKeyDown: handleKeyPress
|
|
44
|
+
}, rest, {
|
|
43
45
|
children: [cells.map(function (cell, index) {
|
|
44
46
|
return (0, _jsxRuntime.jsx)(_TableCell.TableCell, {
|
|
45
47
|
head: head,
|
|
46
48
|
children: cell
|
|
47
49
|
}, index);
|
|
48
50
|
}), children]
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
exports.TableRow = TableRow;
|
|
52
|
-
TableRow.propTypes = {
|
|
53
|
-
cells: _propTypes["default"].array,
|
|
54
|
-
children: _propTypes["default"].node,
|
|
55
|
-
head: _propTypes["default"].bool,
|
|
56
|
-
onClick: _propTypes["default"].func
|
|
51
|
+
}));
|
|
57
52
|
};
|
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.Tabs = void 0;
|
|
5
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
6
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
-
var TabsPrimitive = _interopRequireWildcard(require("@radix-ui/react-tabs"));
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
1
|
/** @jsxImportSource theme-ui */
|
|
14
2
|
|
|
15
3
|
/**
|
|
16
4
|
* External dependencies
|
|
17
5
|
*/
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
9
|
+
import React from 'react';
|
|
18
10
|
|
|
19
11
|
/**
|
|
20
12
|
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const Tabs = React.forwardRef(
|
|
16
|
+
(
|
|
17
|
+
{
|
|
18
|
+
children,
|
|
19
|
+
onValueChange = undefined,
|
|
20
|
+
defaultValue = undefined,
|
|
21
|
+
value = undefined,
|
|
22
|
+
className = null,
|
|
23
|
+
},
|
|
24
|
+
ref
|
|
25
|
+
) => {
|
|
26
|
+
return (
|
|
27
|
+
<TabsPrimitive.Root
|
|
28
|
+
ref={ ref }
|
|
29
|
+
value={ value }
|
|
30
|
+
defaultValue={ defaultValue }
|
|
31
|
+
onValueChange={ onValueChange }
|
|
32
|
+
className={ classNames( 'vip-tabs-component', className ) }
|
|
33
|
+
>
|
|
34
|
+
{ children }
|
|
35
|
+
</TabsPrimitive.Root>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
|
|
41
40
|
Tabs.propTypes = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
className: PropTypes.any,
|
|
42
|
+
defaultValue: PropTypes.node,
|
|
43
|
+
value: PropTypes.node,
|
|
44
|
+
onValueChange: PropTypes.func,
|
|
45
|
+
children: PropTypes.node.isRequired,
|
|
47
46
|
};
|
|
48
|
-
|
|
47
|
+
|
|
48
|
+
Tabs.displayName = 'Tabs';
|
|
49
|
+
|
|
50
|
+
export { Tabs };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let title: string;
|
|
3
|
+
export { Tabs as component };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): React.JSX.Element;
|
|
7
|
+
export function SetActiveTab(): React.JSX.Element;
|
|
8
|
+
import { Tabs } from '..';
|
|
9
|
+
import React from 'react';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* External dependencies
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { Tabs, TabsTrigger, TabsList, TabsContent, Text, Link, Button } from '..';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Tabs',
|
|
15
|
+
component: Tabs,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const Default = () => (
|
|
19
|
+
<Tabs defaultValue="all">
|
|
20
|
+
<TabsList title="See all the content">
|
|
21
|
+
<TabsTrigger value="all">All (5)</TabsTrigger>
|
|
22
|
+
<TabsTrigger value="live">Live (2)</TabsTrigger>
|
|
23
|
+
<TabsTrigger value="dev">In Development (3)</TabsTrigger>
|
|
24
|
+
<TabsTrigger value="protect" disabled>
|
|
25
|
+
Not accessible
|
|
26
|
+
</TabsTrigger>
|
|
27
|
+
</TabsList>
|
|
28
|
+
<TabsContent value="all">
|
|
29
|
+
<Text>
|
|
30
|
+
All content <Link href="https://google.com">https://google.com</Link>
|
|
31
|
+
</Text>
|
|
32
|
+
</TabsContent>
|
|
33
|
+
<TabsContent value="live">Live content</TabsContent>
|
|
34
|
+
<TabsContent value="dev">
|
|
35
|
+
<Text>
|
|
36
|
+
In Development content <Button variant="secondary">Hey I am a button</Button>{ ' ' }
|
|
37
|
+
</Text>
|
|
38
|
+
</TabsContent>
|
|
39
|
+
</Tabs>
|
|
40
|
+
);
|
|
41
|
+
export const SetActiveTab = () => {
|
|
42
|
+
const [ activeTab, setActiveTab ] = React.useState( 'all' );
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Tabs value={ activeTab } onValueChange={ val => setActiveTab( val ) }>
|
|
46
|
+
<TabsList title="See all the content">
|
|
47
|
+
<TabsTrigger value="all">All (5)</TabsTrigger>
|
|
48
|
+
<TabsTrigger value="live">Live (2)</TabsTrigger>
|
|
49
|
+
<TabsTrigger value="dev">In Development (3)</TabsTrigger>
|
|
50
|
+
<TabsTrigger value="protect" disabled={ true }>
|
|
51
|
+
Not accessible
|
|
52
|
+
</TabsTrigger>
|
|
53
|
+
</TabsList>
|
|
54
|
+
<TabsContent value="all">
|
|
55
|
+
<Text>
|
|
56
|
+
<button type="button" onClick={ () => setActiveTab( 'live' ) }>
|
|
57
|
+
Switch to live tab
|
|
58
|
+
</button>
|
|
59
|
+
</Text>
|
|
60
|
+
</TabsContent>
|
|
61
|
+
<TabsContent value="live">Live content</TabsContent>
|
|
62
|
+
<TabsContent value="dev">
|
|
63
|
+
<Text>
|
|
64
|
+
In Development content <button type="button">Hey I am a button</button>{ ' ' }
|
|
65
|
+
</Text>
|
|
66
|
+
</TabsContent>
|
|
67
|
+
</Tabs>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
export function TabsContent({ value, children, className }: {
|
|
5
|
+
value: any;
|
|
6
|
+
children: any;
|
|
7
|
+
className?: null | undefined;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export namespace TabsContent {
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
let className: PropTypes.Requireable<string>;
|
|
12
|
+
let value: PropTypes.Requireable<string>;
|
|
13
|
+
let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.TabsContent = void 0;
|
|
5
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
-
var TabsPrimitive = _interopRequireWildcard(require("@radix-ui/react-tabs"));
|
|
7
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
-
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
9
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
1
|
/** @jsxImportSource theme-ui */
|
|
13
2
|
|
|
14
3
|
/**
|
|
15
4
|
* External dependencies
|
|
16
5
|
*/
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
8
|
+
import classNames from 'classnames';
|
|
17
9
|
|
|
18
10
|
/**
|
|
19
11
|
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
exports.TabsContent = TabsContent;
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const TabsContent = ( { value, children, className = null } ) => (
|
|
15
|
+
<TabsPrimitive.Content
|
|
16
|
+
className={ classNames( 'vip-tabs-content', `vip-tabs-content-${ value }`, className ) }
|
|
17
|
+
value={ value }
|
|
18
|
+
sx={ {
|
|
19
|
+
mt: 4,
|
|
20
|
+
} }
|
|
21
|
+
>
|
|
22
|
+
{ children }
|
|
23
|
+
</TabsPrimitive.Content>
|
|
24
|
+
);
|
|
25
|
+
|
|
35
26
|
TabsContent.propTypes = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
27
|
+
className: PropTypes.string,
|
|
28
|
+
value: PropTypes.string,
|
|
29
|
+
children: PropTypes.node.isRequired,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { TabsContent };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
export function TabsList({ children, title, ...props }: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
children: any;
|
|
7
|
+
title: any;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export namespace TabsList {
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
let title: PropTypes.Validator<string>;
|
|
12
|
+
let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
import PropTypes from 'prop-types';
|