@automattic/vip-design-system 1.2.1 → 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 +7 -16
- 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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { makeDecorator } from '@storybook/addons';
|
|
3
|
+
import { Box, Heading } from '../../src/system';
|
|
4
|
+
|
|
5
|
+
export default makeDecorator( {
|
|
6
|
+
name: 'withBoundingBox',
|
|
7
|
+
parameterName: 'colorMode2',
|
|
8
|
+
wrapper: storyFn => {
|
|
9
|
+
return <Box sx={ { p: 3 } }>{ storyFn() }</Box>;
|
|
10
|
+
},
|
|
11
|
+
} );
|
|
@@ -7,10 +7,6 @@ export default makeDecorator( {
|
|
|
7
7
|
name: 'withThemeProvider',
|
|
8
8
|
parameterName: 'themeUi',
|
|
9
9
|
wrapper: ( storyFn, context ) => {
|
|
10
|
-
return (
|
|
11
|
-
<ThemeUIProvider theme={ theme }>
|
|
12
|
-
<Box sx={ { height: '100vh' } }>{ storyFn( context ) }</Box>
|
|
13
|
-
</ThemeUIProvider>
|
|
14
|
-
);
|
|
10
|
+
return <ThemeUIProvider theme={ theme }>{ storyFn( context ) }</ThemeUIProvider>;
|
|
15
11
|
},
|
|
16
12
|
} );
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import axe from '@axe-core/react';
|
|
4
2
|
import withBoundingBox from './decorators/withBoundingBox';
|
|
5
3
|
import withColorMode, { backgrounds } from './decorators/withColorMode';
|
|
6
4
|
import withThemeProvider from './decorators/withThemeProvider';
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
import { Title, Subtitle, Description, Controls, Stories } from '@storybook/blocks';
|
|
9
7
|
|
|
10
8
|
export const decorators = [ withBoundingBox, withColorMode, withThemeProvider ];
|
|
11
9
|
|
|
@@ -13,6 +11,17 @@ export const parameters = {
|
|
|
13
11
|
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
14
12
|
controls: { expanded: true },
|
|
15
13
|
backgrounds,
|
|
14
|
+
docs: {
|
|
15
|
+
page: () => (
|
|
16
|
+
<>
|
|
17
|
+
<Title />
|
|
18
|
+
<Subtitle />
|
|
19
|
+
<Description />
|
|
20
|
+
<Controls />
|
|
21
|
+
<Stories />
|
|
22
|
+
</>
|
|
23
|
+
),
|
|
24
|
+
},
|
|
16
25
|
options: {
|
|
17
26
|
storySort: {
|
|
18
27
|
method: 'alphabetical',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
/**
|
|
3
|
+
* External dependencies
|
|
4
|
+
*/
|
|
5
|
+
import React, { ReactNode } from 'react';
|
|
6
|
+
import { Argument } from 'classnames';
|
|
7
|
+
import { ThemeUIStyleObject } from 'theme-ui';
|
|
8
|
+
import { HeadingProps } from '../Heading/Heading';
|
|
9
|
+
interface AccordionItemProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
interface TriggerProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
headingVariant?: HeadingProps['variant'];
|
|
16
|
+
sx?: ThemeUIStyleObject;
|
|
17
|
+
}
|
|
18
|
+
interface TriggerWithIconProps {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
icon: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
interface ContentProps {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
sx?: ThemeUIStyleObject;
|
|
25
|
+
}
|
|
26
|
+
interface RootProps {
|
|
27
|
+
caption?: string;
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
className?: Argument;
|
|
30
|
+
sx?: ThemeUIStyleObject;
|
|
31
|
+
defaultValue?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const Item: {
|
|
34
|
+
({ children, ...props }: AccordionItemProps): React.JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const Trigger: React.ForwardRefExoticComponent<TriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
export declare const TriggerWithIcon: React.ForwardRefExoticComponent<TriggerWithIconProps & React.RefAttributes<HTMLButtonElement>>;
|
|
39
|
+
export declare const Content: React.ForwardRefExoticComponent<ContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
export {};
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.TriggerWithIcon = exports.Trigger = exports.Root = exports.Item = exports.Content = void 0;
|
|
5
5
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
6
|
var _md = require("react-icons/md");
|
|
8
7
|
var AccordionPrimitive = _interopRequireWildcard(require("@radix-ui/react-accordion"));
|
|
9
8
|
var _react2 = require("@emotion/react");
|
|
@@ -43,7 +42,10 @@ var slideUp = (0, _react2.keyframes)({
|
|
|
43
42
|
height: 0
|
|
44
43
|
}
|
|
45
44
|
});
|
|
46
|
-
|
|
45
|
+
|
|
46
|
+
// temporary solution while we converte the theme to TS
|
|
47
|
+
|
|
48
|
+
var Item = exports.Item = function Item(_ref) {
|
|
47
49
|
var children = _ref.children,
|
|
48
50
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
49
51
|
return (0, _jsxRuntime.jsx)(AccordionPrimitive.Item, _extends({}, props, {
|
|
@@ -68,12 +70,8 @@ var Item = function Item(_ref) {
|
|
|
68
70
|
children: children
|
|
69
71
|
}));
|
|
70
72
|
};
|
|
71
|
-
exports.Item = Item;
|
|
72
73
|
Item.displayName = 'Accordion.Item';
|
|
73
|
-
|
|
74
|
-
children: _propTypes["default"].node.isRequired
|
|
75
|
-
};
|
|
76
|
-
var Trigger = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, forwardedRef) {
|
|
74
|
+
var Trigger = exports.Trigger = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, forwardedRef) {
|
|
77
75
|
var children = _ref2.children,
|
|
78
76
|
_ref2$headingVariant = _ref2.headingVariant,
|
|
79
77
|
headingVariant = _ref2$headingVariant === void 0 ? 'h3' : _ref2$headingVariant,
|
|
@@ -132,14 +130,8 @@ var Trigger = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, forward
|
|
|
132
130
|
}))
|
|
133
131
|
});
|
|
134
132
|
});
|
|
135
|
-
exports.Trigger = Trigger;
|
|
136
133
|
Trigger.displayName = 'Accordion.Trigger';
|
|
137
|
-
|
|
138
|
-
children: _propTypes["default"].node.isRequired,
|
|
139
|
-
headingVariant: _propTypes["default"].string,
|
|
140
|
-
sx: _propTypes["default"].object
|
|
141
|
-
};
|
|
142
|
-
var TriggerWithIcon = /*#__PURE__*/_react["default"].forwardRef(function (_ref3, forwardedRef) {
|
|
134
|
+
var TriggerWithIcon = exports.TriggerWithIcon = /*#__PURE__*/_react["default"].forwardRef(function (_ref3, forwardedRef) {
|
|
143
135
|
var children = _ref3.children,
|
|
144
136
|
icon = _ref3.icon,
|
|
145
137
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
@@ -162,13 +154,8 @@ var TriggerWithIcon = /*#__PURE__*/_react["default"].forwardRef(function (_ref3,
|
|
|
162
154
|
})]
|
|
163
155
|
}));
|
|
164
156
|
});
|
|
165
|
-
exports.TriggerWithIcon = TriggerWithIcon;
|
|
166
157
|
TriggerWithIcon.displayName = 'Accordion.TriggerWithIcon';
|
|
167
|
-
|
|
168
|
-
children: _propTypes["default"].node.isRequired,
|
|
169
|
-
icon: _propTypes["default"].node.isRequired
|
|
170
|
-
};
|
|
171
|
-
var Content = /*#__PURE__*/_react["default"].forwardRef(function (_ref4, forwardedRef) {
|
|
158
|
+
var Content = exports.Content = /*#__PURE__*/_react["default"].forwardRef(function (_ref4, forwardedRef) {
|
|
172
159
|
var children = _ref4.children,
|
|
173
160
|
_ref4$sx = _ref4.sx,
|
|
174
161
|
sx = _ref4$sx === void 0 ? {} : _ref4$sx,
|
|
@@ -193,13 +180,8 @@ var Content = /*#__PURE__*/_react["default"].forwardRef(function (_ref4, forward
|
|
|
193
180
|
children: children
|
|
194
181
|
}));
|
|
195
182
|
});
|
|
196
|
-
exports.Content = Content;
|
|
197
183
|
Content.displayName = 'Accordion.Content';
|
|
198
|
-
|
|
199
|
-
children: _propTypes["default"].node.isRequired,
|
|
200
|
-
sx: _propTypes["default"].object
|
|
201
|
-
};
|
|
202
|
-
var Root = /*#__PURE__*/_react["default"].forwardRef(function (_ref5, forwardRef) {
|
|
184
|
+
var Root = exports.Root = /*#__PURE__*/_react["default"].forwardRef(function (_ref5, forwardRef) {
|
|
203
185
|
var _ref5$sx = _ref5.sx,
|
|
204
186
|
sx = _ref5$sx === void 0 ? {} : _ref5$sx,
|
|
205
187
|
children = _ref5.children,
|
|
@@ -208,6 +190,7 @@ var Root = /*#__PURE__*/_react["default"].forwardRef(function (_ref5, forwardRef
|
|
|
208
190
|
return (0, _jsxRuntime.jsx)(AccordionPrimitive.Root, _extends({
|
|
209
191
|
className: (0, _classnames["default"])('vip-accordion-component', className),
|
|
210
192
|
collapsible: true,
|
|
193
|
+
type: "single",
|
|
211
194
|
ref: forwardRef,
|
|
212
195
|
sx: _extends({
|
|
213
196
|
borderRadius: 6
|
|
@@ -216,12 +199,4 @@ var Root = /*#__PURE__*/_react["default"].forwardRef(function (_ref5, forwardRef
|
|
|
216
199
|
children: children
|
|
217
200
|
}));
|
|
218
201
|
});
|
|
219
|
-
|
|
220
|
-
Root.displayName = 'Accordion';
|
|
221
|
-
Root.propTypes = {
|
|
222
|
-
children: _propTypes["default"].node,
|
|
223
|
-
className: _propTypes["default"].any,
|
|
224
|
-
defaultValue: _propTypes["default"].any,
|
|
225
|
-
sx: _propTypes["default"].object,
|
|
226
|
-
type: _propTypes["default"].oneOf(['single', 'multiple'])
|
|
227
|
-
};
|
|
202
|
+
Root.displayName = 'Accordion';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
/**
|
|
4
|
+
* Internal dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { Accordion } from '..';
|
|
7
|
+
declare const _default: {
|
|
8
|
+
title: string;
|
|
9
|
+
component: typeof Accordion;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const Default: () => import("react").JSX.Element;
|
|
13
|
+
export declare const WithLargeText: () => import("react").JSX.Element;
|
|
@@ -13,11 +13,10 @@ var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
-
var _default = {
|
|
16
|
+
var _default = exports["default"] = {
|
|
17
17
|
title: 'Accordion',
|
|
18
18
|
component: _.Accordion
|
|
19
19
|
};
|
|
20
|
-
exports["default"] = _default;
|
|
21
20
|
var ExampleContent = function ExampleContent() {
|
|
22
21
|
return (0, _jsxRuntime.jsxs)(_.Box, {
|
|
23
22
|
children: [(0, _jsxRuntime.jsx)("p", {
|
|
@@ -68,11 +67,10 @@ var ExampleAccordion = function ExampleAccordion() {
|
|
|
68
67
|
})]
|
|
69
68
|
});
|
|
70
69
|
};
|
|
71
|
-
var Default = function Default() {
|
|
70
|
+
var Default = exports.Default = function Default() {
|
|
72
71
|
return (0, _jsxRuntime.jsx)(ExampleAccordion, {});
|
|
73
72
|
};
|
|
74
|
-
exports.
|
|
75
|
-
var WithLargeText = function WithLargeText() {
|
|
73
|
+
var WithLargeText = exports.WithLargeText = function WithLargeText() {
|
|
76
74
|
return (0, _jsxRuntime.jsx)(_.Box, {
|
|
77
75
|
sx: {
|
|
78
76
|
'.vip-heading-component > button': {
|
|
@@ -81,5 +79,4 @@ var WithLargeText = function WithLargeText() {
|
|
|
81
79
|
},
|
|
82
80
|
children: (0, _jsxRuntime.jsx)(ExampleAccordion, {})
|
|
83
81
|
});
|
|
84
|
-
};
|
|
85
|
-
exports.WithLargeText = WithLargeText;
|
|
82
|
+
};
|
|
@@ -8,7 +8,7 @@ var _ = require("../");
|
|
|
8
8
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
9
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
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
11
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
12
12
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
13
13
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } /** @jsxImportSource theme-ui */ /**
|
|
14
14
|
* External dependencies
|
|
@@ -62,9 +62,8 @@ describe('<Accordion />', function () {
|
|
|
62
62
|
return (0, _jestAxe.axe)(container);
|
|
63
63
|
case 6:
|
|
64
64
|
_context.t1 = _context.sent;
|
|
65
|
-
_context.
|
|
66
|
-
|
|
67
|
-
case 9:
|
|
65
|
+
(0, _context.t0)(_context.t1).toHaveNoViolations();
|
|
66
|
+
case 8:
|
|
68
67
|
case "end":
|
|
69
68
|
return _context.stop();
|
|
70
69
|
}
|
|
@@ -92,9 +91,8 @@ describe('<Accordion />', function () {
|
|
|
92
91
|
return (0, _jestAxe.axe)(container);
|
|
93
92
|
case 7:
|
|
94
93
|
_context2.t1 = _context2.sent;
|
|
95
|
-
_context2.
|
|
96
|
-
|
|
97
|
-
case 10:
|
|
94
|
+
(0, _context2.t0)(_context2.t1).toHaveNoViolations();
|
|
95
|
+
case 9:
|
|
98
96
|
case "end":
|
|
99
97
|
return _context2.stop();
|
|
100
98
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ImageProps } from 'theme-ui';
|
|
3
|
+
import { Argument } from 'classnames';
|
|
4
|
+
export interface AvatarProps {
|
|
5
|
+
isVIP?: boolean;
|
|
6
|
+
size?: number;
|
|
7
|
+
src?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
className?: Argument;
|
|
10
|
+
}
|
|
11
|
+
type AvatarImageProps = AvatarProps & ImageProps;
|
|
12
|
+
export declare const Avatar: import("react").ForwardRefExoticComponent<Omit<AvatarImageProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
13
|
+
export {};
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.Avatar = void 0;
|
|
5
|
-
var _react =
|
|
6
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
5
|
+
var _react = require("react");
|
|
7
6
|
var _themeUi = require("theme-ui");
|
|
8
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
8
|
var _ = require("..");
|
|
10
9
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
11
10
|
var _excluded = ["isVIP", "name", "size", "src", "className"];
|
|
12
|
-
/** @jsxImportSource theme-ui */
|
|
13
11
|
/**
|
|
14
12
|
* External dependencies
|
|
15
13
|
*/
|
|
@@ -19,17 +17,14 @@ var _excluded = ["isVIP", "name", "size", "src", "className"];
|
|
|
19
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20
18
|
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); }
|
|
21
19
|
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; }
|
|
22
|
-
var Avatar = /*#__PURE__*/_react
|
|
20
|
+
var Avatar = exports.Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
23
21
|
var _ref$isVIP = _ref.isVIP,
|
|
24
22
|
isVIP = _ref$isVIP === void 0 ? false : _ref$isVIP,
|
|
25
|
-
|
|
26
|
-
name = _ref$name === void 0 ? null : _ref$name,
|
|
23
|
+
name = _ref.name,
|
|
27
24
|
_ref$size = _ref.size,
|
|
28
25
|
size = _ref$size === void 0 ? 32 : _ref$size,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_ref$className = _ref.className,
|
|
32
|
-
className = _ref$className === void 0 ? null : _ref$className,
|
|
26
|
+
src = _ref.src,
|
|
27
|
+
className = _ref.className,
|
|
33
28
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
34
29
|
return (0, _jsxRuntime.jsx)(_.Box, _extends({
|
|
35
30
|
sx: {
|
|
@@ -51,7 +46,7 @@ var Avatar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRe
|
|
|
51
46
|
},
|
|
52
47
|
className: (0, _classnames["default"])('vip-avatar-component', className),
|
|
53
48
|
"aria-hidden": "true",
|
|
54
|
-
ref:
|
|
49
|
+
ref: ref
|
|
55
50
|
}, props, {
|
|
56
51
|
children: src ? (0, _jsxRuntime.jsx)(_themeUi.Image, {
|
|
57
52
|
src: src,
|
|
@@ -74,12 +69,4 @@ var Avatar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRe
|
|
|
74
69
|
})
|
|
75
70
|
}));
|
|
76
71
|
});
|
|
77
|
-
|
|
78
|
-
Avatar.displayName = 'Avatar';
|
|
79
|
-
Avatar.propTypes = {
|
|
80
|
-
isVIP: _propTypes["default"].bool,
|
|
81
|
-
size: _propTypes["default"].number,
|
|
82
|
-
src: _propTypes["default"].string,
|
|
83
|
-
name: _propTypes["default"].string,
|
|
84
|
-
className: _propTypes["default"].any
|
|
85
|
-
};
|
|
72
|
+
Avatar.displayName = 'Avatar';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* External dependencies
|
|
4
|
+
*/
|
|
5
|
+
import type { StoryObj } from '@storybook/react';
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { Avatar } from '..';
|
|
10
|
+
declare const _default: {
|
|
11
|
+
title: string;
|
|
12
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("./Avatar").AvatarProps & import("theme-ui").ImageProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
type Story = StoryObj<typeof Avatar>;
|
|
16
|
+
export declare const Default: Story;
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = exports.Default = void 0;
|
|
5
5
|
var _ = require("..");
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* External dependencies
|
|
8
|
+
*/
|
|
7
9
|
/**
|
|
8
10
|
* Internal dependencies
|
|
9
11
|
*/
|
|
10
|
-
var _default = {
|
|
12
|
+
var _default = exports["default"] = {
|
|
11
13
|
title: 'Avatar',
|
|
12
14
|
component: _.Avatar
|
|
13
15
|
};
|
|
14
|
-
exports
|
|
15
|
-
var Default = function Default() {
|
|
16
|
-
return (0, _jsxRuntime.jsx)(_.Avatar, {});
|
|
17
|
-
};
|
|
18
|
-
exports.Default = Default;
|
|
16
|
+
var Default = exports.Default = {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,7 @@ var _react = require("@testing-library/react");
|
|
|
4
4
|
var _jestAxe = require("jest-axe");
|
|
5
5
|
var _Avatar = require("./Avatar");
|
|
6
6
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
7
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
7
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
9
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } /**
|
|
10
10
|
* External dependencies
|
|
@@ -28,9 +28,8 @@ describe('<Avatar />', function () {
|
|
|
28
28
|
return (0, _jestAxe.axe)(container);
|
|
29
29
|
case 5:
|
|
30
30
|
_context.t1 = _context.sent;
|
|
31
|
-
_context.
|
|
32
|
-
|
|
33
|
-
case 8:
|
|
31
|
+
(0, _context.t0)(_context.t1).toHaveNoViolations();
|
|
32
|
+
case 7:
|
|
34
33
|
case "end":
|
|
35
34
|
return _context.stop();
|
|
36
35
|
}
|
|
@@ -53,9 +52,8 @@ describe('<Avatar />', function () {
|
|
|
53
52
|
return (0, _jestAxe.axe)(container);
|
|
54
53
|
case 5:
|
|
55
54
|
_context2.t1 = _context2.sent;
|
|
56
|
-
_context2.
|
|
57
|
-
|
|
58
|
-
case 8:
|
|
55
|
+
(0, _context2.t0)(_context2.t1).toHaveNoViolations();
|
|
56
|
+
case 7:
|
|
59
57
|
case "end":
|
|
60
58
|
return _context2.stop();
|
|
61
59
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TextProps as ThemeTextProps } from 'theme-ui';
|
|
3
|
+
export interface BadgeProps extends ThemeTextProps {
|
|
4
|
+
variant?: 'blue' | 'gold' | 'gray' | 'green' | 'orange' | 'red' | 'salmon' | 'yellow';
|
|
5
|
+
}
|
|
6
|
+
export declare const Badge: import("react").ForwardRefExoticComponent<BadgeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.Badge = void 0;
|
|
5
|
-
var _react =
|
|
5
|
+
var _react = require("react");
|
|
6
6
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
7
|
-
var
|
|
8
|
-
var _ = require("../");
|
|
7
|
+
var _ = require("..");
|
|
9
8
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
10
9
|
var _excluded = ["variant", "sx", "className"];
|
|
11
|
-
/** @jsxImportSource theme-ui */
|
|
12
10
|
/**
|
|
13
11
|
* External dependencies
|
|
14
12
|
*/
|
|
@@ -18,12 +16,11 @@ var _excluded = ["variant", "sx", "className"];
|
|
|
18
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
17
|
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); }
|
|
20
18
|
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; }
|
|
21
|
-
var Badge = /*#__PURE__*/_react
|
|
19
|
+
var Badge = exports.Badge = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
22
20
|
var _ref$variant = _ref.variant,
|
|
23
21
|
variant = _ref$variant === void 0 ? 'blue' : _ref$variant,
|
|
24
22
|
sx = _ref.sx,
|
|
25
|
-
|
|
26
|
-
className = _ref$className === void 0 ? null : _ref$className,
|
|
23
|
+
className = _ref.className,
|
|
27
24
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
28
25
|
return (0, _jsxRuntime.jsx)(_.Text, _extends({
|
|
29
26
|
as: "span",
|
|
@@ -49,13 +46,7 @@ var Badge = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef
|
|
|
49
46
|
}
|
|
50
47
|
}, sx),
|
|
51
48
|
className: (0, _classnames["default"])('vip-badge-component', className),
|
|
52
|
-
ref:
|
|
49
|
+
ref: ref
|
|
53
50
|
}, props));
|
|
54
51
|
});
|
|
55
|
-
|
|
56
|
-
Badge.displayName = 'Badge';
|
|
57
|
-
Badge.propTypes = {
|
|
58
|
-
variant: _propTypes["default"].string,
|
|
59
|
-
sx: _propTypes["default"].object,
|
|
60
|
-
className: _propTypes["default"].any
|
|
61
|
-
};
|
|
52
|
+
Badge.displayName = 'Badge';
|