@spaced-out/ui-design-system 0.5.7-beta.0 → 0.5.7-beta.1
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/.cspell/custom-words.txt +2 -0
- package/.github/CODEOWNERS +0 -5
- package/.github/workflows/pull_request_checks.yml +4 -4
- package/.storybook/public/component-parent-levels.json +95 -0
- package/.type-coverage +13 -0
- package/CHANGELOG.md +41 -0
- package/cspell.json +0 -1
- package/design-tokens/size/base-size.json +3 -0
- package/eslint.config.mjs +62 -29
- package/lib/components/AIPromptFlow/AIPromptFlow.stories.d.ts.map +1 -1
- package/lib/components/Accordion/Accordion.d.ts +2 -2
- package/lib/components/Accordion/Accordion.d.ts.map +1 -1
- package/lib/components/Accordion/AccordionGroup.d.ts +2 -2
- package/lib/components/Accordion/AccordionGroup.d.ts.map +1 -1
- package/lib/components/Accordion/AccordionGroup.stories.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts +5 -5
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +4 -13
- package/lib/components/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/lib/components/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.js +27 -14
- package/lib/components/Badge/Badge.d.ts +7 -8
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Badge/Badge.stories.d.ts.map +1 -1
- package/lib/components/BadgedIcon/BadgedIcon.d.ts +2 -2
- package/lib/components/BadgedIcon/BadgedIcon.d.ts.map +1 -1
- package/lib/components/BadgedIcon/BadgedIcon.js +1 -4
- package/lib/components/Banner/Banner.d.ts +2 -3
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.d.ts +2 -3
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.js +2 -4
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +5 -6
- package/lib/components/Button/Button.d.ts +7 -8
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +7 -21
- package/lib/components/ButtonDropdown/ButtonDropdown.d.ts +3 -4
- package/lib/components/ButtonDropdown/ButtonDropdown.d.ts.map +1 -1
- package/lib/components/ButtonDropdown/ButtonDropdown.js +4 -14
- package/lib/components/ButtonDropdown/ButtonDropdown.stories.d.ts +70 -70
- package/lib/components/ButtonDropdown/ButtonDropdown.stories.d.ts.map +1 -1
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.d.ts +5 -6
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.d.ts.map +1 -1
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.js +1 -9
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.stories.d.ts +109 -109
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.stories.d.ts.map +1 -1
- package/lib/components/ButtonTabs/ButtonTab/ButtonTab.d.ts +2 -2
- package/lib/components/ButtonTabs/ButtonTab/ButtonTab.d.ts.map +1 -1
- package/lib/components/ButtonTabs/ButtonTabDropdown.d.ts +2 -3
- package/lib/components/ButtonTabs/ButtonTabDropdown.d.ts.map +1 -1
- package/lib/components/ButtonTabs/ButtonTabDropdown.js +5 -14
- package/lib/components/ButtonTabs/ButtonTabs.d.ts +2 -2
- package/lib/components/ButtonTabs/ButtonTabs.d.ts.map +1 -1
- package/lib/components/ButtonTabs/ButtonTabs.js +2 -3
- package/lib/components/Card/Card.d.ts +9 -7
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js +2 -7
- package/lib/components/Charts/ChartWrapper/ChartWrapper.d.ts +9 -4
- package/lib/components/Charts/ChartWrapper/ChartWrapper.d.ts.map +1 -1
- package/lib/components/Charts/ChartWrapper/ChartWrapper.js +5 -7
- package/lib/components/Charts/ColumnChart/ColumnChart.d.ts +8 -5
- package/lib/components/Charts/ColumnChart/ColumnChart.d.ts.map +1 -1
- package/lib/components/Charts/ColumnChart/ColumnChart.js +16 -10
- package/lib/components/Charts/DonutChart/DonutChart.d.ts +4 -5
- package/lib/components/Charts/DonutChart/DonutChart.d.ts.map +1 -1
- package/lib/components/Charts/DonutChart/DonutChart.js +1 -2
- package/lib/components/Charts/FunnelChart/FunnelChart.d.ts +4 -5
- package/lib/components/Charts/FunnelChart/FunnelChart.d.ts.map +1 -1
- package/lib/components/Charts/LineChart/LineChart.d.ts +4 -5
- package/lib/components/Charts/LineChart/LineChart.d.ts.map +1 -1
- package/lib/components/Charts/SankeyChart/SankeyChart.d.ts +2 -3
- package/lib/components/Charts/SankeyChart/SankeyChart.d.ts.map +1 -1
- package/lib/components/Charts/SpiderChart/SpiderChart.d.ts +4 -5
- package/lib/components/Charts/SpiderChart/SpiderChart.d.ts.map +1 -1
- package/lib/components/Charts/StackedBarChart/StackedBarChart.d.ts +4 -5
- package/lib/components/Charts/StackedBarChart/StackedBarChart.d.ts.map +1 -1
- package/lib/components/ChatBubble/ChatBubble.d.ts +14 -14
- package/lib/components/ChatBubble/ChatBubble.d.ts.map +1 -1
- package/lib/components/ChatBubble/ChatBubble.js +11 -4
- package/lib/components/Checkbox/Checkbox.d.ts +2 -3
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -2
- package/lib/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/lib/components/Checkbox/CheckboxGroup.d.ts +2 -2
- package/lib/components/Checkbox/CheckboxGroup.d.ts.map +1 -1
- package/lib/components/Checkbox/CheckboxGroup.js +8 -12
- package/lib/components/Checkbox/CheckboxGroup.stories.d.ts +2 -3
- package/lib/components/Checkbox/CheckboxGroup.stories.d.ts.map +1 -1
- package/lib/components/Chip/Chip.d.ts +10 -11
- package/lib/components/Chip/Chip.d.ts.map +1 -1
- package/lib/components/Chip/Chip.js +7 -13
- package/lib/components/CircularLoader/CircularLoader.d.ts +2 -2
- package/lib/components/CircularLoader/CircularLoader.d.ts.map +1 -1
- package/lib/components/CollapsibleCard/CollapsibleCard.d.ts +6 -6
- package/lib/components/CollapsibleCard/CollapsibleCard.d.ts.map +1 -1
- package/lib/components/Combobox/Combobox.d.ts +16 -16
- package/lib/components/Combobox/Combobox.d.ts.map +1 -1
- package/lib/components/Combobox/Combobox.js +16 -19
- package/lib/components/Combobox/Combobox.stories.d.ts.map +1 -1
- package/lib/components/Combobox/helper.d.ts.map +1 -1
- package/lib/components/Combobox/helper.js +0 -1
- package/lib/components/ConditionalWrapper/ConditionalWrapper.d.ts +2 -2
- package/lib/components/ConditionalWrapper/ConditionalWrapper.d.ts.map +1 -1
- package/lib/components/DateRangePicker/Calendar.d.ts +3 -3
- package/lib/components/DateRangePicker/Calendar.d.ts.map +1 -1
- package/lib/components/DateRangePicker/Calendar.js +2 -6
- package/lib/components/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/lib/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateRangePicker/DateRangePicker.stories.d.ts.map +1 -1
- package/lib/components/DateRangePicker/DateRangeWrapper.d.ts +2 -2
- package/lib/components/DateRangePicker/DateRangeWrapper.d.ts.map +1 -1
- package/lib/components/DateRangePicker/DateRangeWrapper.js +6 -14
- package/lib/components/DateRangePicker/Day.d.ts +2 -2
- package/lib/components/DateRangePicker/Day.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts +10 -11
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Disclaimer/Disclaimer.d.ts.map +1 -1
- package/lib/components/Disclaimer/Disclaimer.js +0 -1
- package/lib/components/Dropdown/Dropdown.d.ts +3 -4
- package/lib/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/Dropdown/Dropdown.js +17 -18
- package/lib/components/Dropdown/Dropdown.stories.d.ts.map +1 -1
- package/lib/components/Dropdown/SimpleDropdown.d.ts +5 -6
- package/lib/components/Dropdown/SimpleDropdown.d.ts.map +1 -1
- package/lib/components/Dropdown/SimpleDropdown.js +1 -7
- package/lib/components/Dropdown/SimpleDropdown.stories.d.ts.map +1 -1
- package/lib/components/EmptyState/EmptyState.d.ts +2 -2
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/lib/components/ErrorMessage/ErrorMessage.d.ts +2 -2
- package/lib/components/ErrorMessage/ErrorMessage.d.ts.map +1 -1
- package/lib/components/FileUpload/FileBlock/FileBlock.d.ts +2 -2
- package/lib/components/FileUpload/FileBlock/FileBlock.d.ts.map +1 -1
- package/lib/components/FileUpload/FileUpload.d.ts +14 -13
- package/lib/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/lib/components/FileUpload/FileUpload.js +2 -7
- package/lib/components/FileUpload/FileUpload.stories.d.ts +2 -1
- package/lib/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.d.ts +3 -4
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.d.ts.map +1 -1
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.js +1 -9
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.stories.d.ts.map +1 -1
- package/lib/components/FocusManager/FocusManager.d.ts +2 -2
- package/lib/components/FocusManager/FocusManager.d.ts.map +1 -1
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.d.ts +4 -5
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.d.ts.map +1 -1
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.js +21 -17
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.stories.d.ts.map +1 -1
- package/lib/components/FormTitleWrapper/FormTitleWrapper.d.ts +2 -2
- package/lib/components/FormTitleWrapper/FormTitleWrapper.d.ts.map +1 -1
- package/lib/components/Grid/Col.stories.d.ts +1 -1
- package/lib/components/Grid/Grid.d.ts +7 -7
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.js +6 -13
- package/lib/components/Grid/GridPatterns.stories.d.ts +1 -1
- package/lib/components/Grid/GridPatterns.stories.d.ts.map +1 -1
- package/lib/components/Grid/Row.stories.d.ts +1 -1
- package/lib/components/Icon/ClickableIcon.d.ts +6 -6
- package/lib/components/Icon/ClickableIcon.d.ts.map +1 -1
- package/lib/components/Icon/ClickableIcon.js +1 -1
- package/lib/components/Icon/Icon.d.ts +3 -3
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +1 -3
- package/lib/components/Icon/Icon.stories.d.ts +2 -2
- package/lib/components/Icon/Icon.stories.d.ts.map +1 -1
- package/lib/components/Icon/SemanticIcon.d.ts +2 -3
- package/lib/components/Icon/SemanticIcon.d.ts.map +1 -1
- package/lib/components/InContextAlert/InContextAlert.d.ts +4 -5
- package/lib/components/InContextAlert/InContextAlert.d.ts.map +1 -1
- package/lib/components/InContextAlert/InContextAlert.js +8 -6
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts +3 -4
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts.map +1 -1
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.js +7 -6
- package/lib/components/InfinitePagination/InfinitePagination.d.ts.map +1 -1
- package/lib/components/InfinitePagination/InfinitePagination.js +10 -11
- package/lib/components/InfinitePagination/InfinitePagination.stories.d.ts.map +1 -1
- package/lib/components/InlineDropdown/InlineDropdown.d.ts +3 -4
- package/lib/components/InlineDropdown/InlineDropdown.d.ts.map +1 -1
- package/lib/components/InlineDropdown/InlineDropdown.js +9 -14
- package/lib/components/InlineDropdown/InlineDropdown.stories.d.ts +45 -45
- package/lib/components/InlineDropdown/InlineDropdown.stories.d.ts.map +1 -1
- package/lib/components/InlineDropdown/SimpleInlineDropdown.d.ts +5 -6
- package/lib/components/InlineDropdown/SimpleInlineDropdown.d.ts.map +1 -1
- package/lib/components/InlineDropdown/SimpleInlineDropdown.js +2 -11
- package/lib/components/InlineDropdown/SimpleInlineDropdown.stories.d.ts +83 -83
- package/lib/components/InlineDropdown/SimpleInlineDropdown.stories.d.ts.map +1 -1
- package/lib/components/Input/Input.d.ts +17 -16
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +7 -20
- package/lib/components/KPIBox/KPIBox.d.ts +2 -2
- package/lib/components/KPIBox/KPIBox.d.ts.map +1 -1
- package/lib/components/LinearLoader/LinearLoader.d.ts +2 -2
- package/lib/components/LinearLoader/LinearLoader.d.ts.map +1 -1
- package/lib/components/LinearLoader/LinearLoader.js +2 -2
- package/lib/components/Link/Link.d.ts +5 -6
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +4 -13
- package/lib/components/Menu/Menu.d.ts +12 -12
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +3 -5
- package/lib/components/Menu/Menu.stories.d.ts.map +1 -1
- package/lib/components/Menu/MenuOptionButton.d.ts +2 -3
- package/lib/components/Menu/MenuOptionButton.d.ts.map +1 -1
- package/lib/components/Menu/MenuOptionButton.js +0 -1
- package/lib/components/Modal/Modal.d.ts +12 -30
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +5 -8
- package/lib/components/Notification/Notification.d.ts +6 -7
- package/lib/components/Notification/Notification.d.ts.map +1 -1
- package/lib/components/Notification/Notification.js +7 -4
- package/lib/components/OptionButton/OptionButton.d.ts +6 -7
- package/lib/components/OptionButton/OptionButton.d.ts.map +1 -1
- package/lib/components/OptionButton/OptionButton.js +2 -2
- package/lib/components/OptionButton/OptionButton.stories.d.ts.map +1 -1
- package/lib/components/OptionButton/SimpleOptionButton.d.ts +6 -7
- package/lib/components/OptionButton/SimpleOptionButton.d.ts.map +1 -1
- package/lib/components/OptionButton/SimpleOptionButton.js +1 -7
- package/lib/components/OptionButton/SimpleOptionButton.stories.d.ts +55 -55
- package/lib/components/OptionButton/SimpleOptionButton.stories.d.ts.map +1 -1
- package/lib/components/PageTitle/PageTitle.d.ts +9 -8
- package/lib/components/PageTitle/PageTitle.d.ts.map +1 -1
- package/lib/components/PageTitle/PageTitle.js +15 -10
- package/lib/components/PageTitle/PageTitle.stories.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +10 -12
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.stories.d.ts +1 -9
- package/lib/components/Pagination/Pagination.stories.d.ts.map +1 -1
- package/lib/components/Pagination/PaginationItem.d.ts.map +1 -1
- package/lib/components/Pagination/PaginationItem.js +0 -3
- package/lib/components/Panel/Panel.d.ts +9 -10
- package/lib/components/Panel/Panel.d.ts.map +1 -1
- package/lib/components/Panel/Panel.stories.d.ts.map +1 -1
- package/lib/components/ProgressDonut/ProgressDonut.d.ts +2 -2
- package/lib/components/ProgressDonut/ProgressDonut.d.ts.map +1 -1
- package/lib/components/ProgressDonut/ProgressDonut.js +2 -3
- package/lib/components/PromptChip/PromptChip.d.ts.map +1 -1
- package/lib/components/PromptChip/PromptChip.js +6 -5
- package/lib/components/PromptInput/PromptInput.d.ts +7 -7
- package/lib/components/PromptInput/PromptInput.d.ts.map +1 -1
- package/lib/components/PromptInput/PromptInput.js +0 -7
- package/lib/components/RadioButton/RadioButton.d.ts +2 -3
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.js +1 -2
- package/lib/components/RadioButton/RadioButton.stories.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioGroup.d.ts +2 -2
- package/lib/components/RadioButton/RadioGroup.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioGroup.js +2 -1
- package/lib/components/RadioButton/RadioGroup.stories.d.ts.map +1 -1
- package/lib/components/RadioTile/RadioTile.d.ts +2 -2
- package/lib/components/RadioTile/RadioTile.d.ts.map +1 -1
- package/lib/components/RadioTile/RadioTile.js +1 -3
- package/lib/components/RadioTile/RadioTile.stories.d.ts.map +1 -1
- package/lib/components/RangeSlider/RangeSlider.d.ts +2 -2
- package/lib/components/RangeSlider/RangeSlider.d.ts.map +1 -1
- package/lib/components/RangeSlider/RangeSlider.js +0 -3
- package/lib/components/Rating/Rating.d.ts +2 -2
- package/lib/components/Rating/Rating.d.ts.map +1 -1
- package/lib/components/ScoreBar/ScoreBar.d.ts +2 -2
- package/lib/components/ScoreBar/ScoreBar.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +2 -3
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/Separator/Separator.d.ts +2 -2
- package/lib/components/Separator/Separator.d.ts.map +1 -1
- package/lib/components/Shimmer/Shimmer.d.ts +6 -6
- package/lib/components/Shimmer/Shimmer.d.ts.map +1 -1
- package/lib/components/Shimmer/Shimmer.js +1 -3
- package/lib/components/SideMenuLink/SideMenuLink.d.ts +2 -2
- package/lib/components/SideMenuLink/SideMenuLink.d.ts.map +1 -1
- package/lib/components/SideMenuLink/SideMenuLink.js +3 -9
- package/lib/components/SideMenuLink/SideMenuLink.stories.d.ts.map +1 -1
- package/lib/components/StatusIndicator/StatusIndicator.d.ts +2 -2
- package/lib/components/StatusIndicator/StatusIndicator.d.ts.map +1 -1
- package/lib/components/Stepper/Step/Step.d.ts +2 -2
- package/lib/components/Stepper/Step/Step.d.ts.map +1 -1
- package/lib/components/Stepper/Step/Step.js +13 -10
- package/lib/components/Stepper/Step/StepContent.d.ts +2 -2
- package/lib/components/Stepper/Step/StepContent.d.ts.map +1 -1
- package/lib/components/Stepper/Step/StepLabel.d.ts +2 -2
- package/lib/components/Stepper/Step/StepLabel.d.ts.map +1 -1
- package/lib/components/Stepper/Stepper.d.ts +2 -2
- package/lib/components/Stepper/Stepper.d.ts.map +1 -1
- package/lib/components/Stepper/Stepper.js +23 -8
- package/lib/components/Stepper/Stepper.stories.d.ts.map +1 -1
- package/lib/components/StickyBar/StickyBar.d.ts +4 -4
- package/lib/components/StickyBar/StickyBar.d.ts.map +1 -1
- package/lib/components/SubMenu/SubMenu.d.ts +2 -2
- package/lib/components/SubMenu/SubMenu.d.ts.map +1 -1
- package/lib/components/SubMenu/SubMenuGroup.d.ts +2 -2
- package/lib/components/SubMenu/SubMenuGroup.d.ts.map +1 -1
- package/lib/components/SubMenu/SubMenuGroup.js +14 -11
- package/lib/components/SubMenu/SubMenuItem.d.ts +8 -8
- package/lib/components/SubMenu/SubMenuItem.d.ts.map +1 -1
- package/lib/components/SubMenu/SubMenuItem.js +16 -24
- package/lib/components/SubMenu/SubMenuLink.d.ts +3 -3
- package/lib/components/SubMenu/SubMenuLink.d.ts.map +1 -1
- package/lib/components/SubMenu/SubMenuLink.js +4 -8
- package/lib/components/Table/BasicTable.stories.d.ts +6 -6
- package/lib/components/Table/BasicTable.stories.d.ts.map +1 -1
- package/lib/components/Table/BulkActions.stories.d.ts.map +1 -1
- package/lib/components/Table/Cell.d.ts +3 -3
- package/lib/components/Table/Cell.d.ts.map +1 -1
- package/lib/components/Table/Cell.js +3 -7
- package/lib/components/Table/DefaultRow.d.ts +4 -4
- package/lib/components/Table/DefaultRow.d.ts.map +1 -1
- package/lib/components/Table/DefaultTableHeader.d.ts +4 -4
- package/lib/components/Table/DefaultTableHeader.d.ts.map +1 -1
- package/lib/components/Table/DefaultTableHeader.js +2 -9
- package/lib/components/Table/InlineEdit.stories.d.ts.map +1 -1
- package/lib/components/Table/StaticTable.d.ts.map +1 -1
- package/lib/components/Table/StaticTable.js +13 -56
- package/lib/components/Table/Table.d.ts +7 -7
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.js +2 -24
- package/lib/components/Table/TableActionBar.d.ts +2 -2
- package/lib/components/Table/TableActionBar.d.ts.map +1 -1
- package/lib/components/Table/TableBottomBar.d.ts +2 -2
- package/lib/components/Table/TableBottomBar.d.ts.map +1 -1
- package/lib/components/Table/TableTopBar.d.ts +2 -2
- package/lib/components/Table/TableTopBar.d.ts.map +1 -1
- package/lib/components/Table/hooks.d.ts.map +1 -1
- package/lib/components/Table/hooks.js +4 -12
- package/lib/components/Tabs/Tab/Tab.d.ts +6 -4
- package/lib/components/Tabs/Tab/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab/Tab.js +28 -8
- package/lib/components/Tabs/TabList/TabDropdown.d.ts +2 -2
- package/lib/components/Tabs/TabList/TabDropdown.d.ts.map +1 -1
- package/lib/components/Tabs/TabList/TabDropdown.js +3 -9
- package/lib/components/Tabs/TabList/TabList.d.ts +4 -3
- package/lib/components/Tabs/TabList/TabList.d.ts.map +1 -1
- package/lib/components/Tabs/TabList/TabList.js +40 -50
- package/lib/components/Tabs/TabList/TabList.stories.d.ts +22 -0
- package/lib/components/Tabs/TabList/TabList.stories.d.ts.map +1 -1
- package/lib/components/Text/Text.d.ts +4 -4
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.js +0 -1
- package/lib/components/TextTile/TextTile.d.ts +2 -2
- package/lib/components/TextTile/TextTile.d.ts.map +1 -1
- package/lib/components/Textarea/Textarea.d.ts +6 -7
- package/lib/components/Textarea/Textarea.d.ts.map +1 -1
- package/lib/components/Textarea/Textarea.js +7 -17
- package/lib/components/Timeline/Timeline.d.ts +2 -2
- package/lib/components/Timeline/Timeline.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.js +20 -14
- package/lib/components/Timeline/TimelineItem/TimelineItem.d.ts +2 -2
- package/lib/components/Timeline/TimelineItem/TimelineItem.d.ts.map +1 -1
- package/lib/components/Timeline/TimelineItem/TimelineItem.js +2 -9
- package/lib/components/Timeline/TimelineItem/TimelineItem.stories.d.ts.map +1 -1
- package/lib/components/Toast/Toast.d.ts +8 -8
- package/lib/components/Toast/Toast.d.ts.map +1 -1
- package/lib/components/Toast/Toast.js +31 -24
- package/lib/components/Toast/ToastContainer.d.ts.map +1 -1
- package/lib/components/Toast/ToastContainer.js +7 -6
- package/lib/components/Toast/ToastManager.d.ts +5 -5
- package/lib/components/Toast/ToastManager.d.ts.map +1 -1
- package/lib/components/Toast/ToastManager.js +1 -2
- package/lib/components/Toggle/Toggle.d.ts +2 -2
- package/lib/components/Toggle/Toggle.d.ts.map +1 -1
- package/lib/components/Toggle/Toggle.js +2 -6
- package/lib/components/Toggle/Toggle.stories.d.ts.map +1 -1
- package/lib/components/TokenListInput/TokenListInput.d.ts +13 -11
- package/lib/components/TokenListInput/TokenListInput.d.ts.map +1 -1
- package/lib/components/TokenListInput/TokenListInput.js +24 -38
- package/lib/components/TokenListInput/TokenListInput.stories.d.ts +3 -4
- package/lib/components/TokenListInput/TokenListInput.stories.d.ts.map +1 -1
- package/lib/components/TokenListInput/TokenValueChips.d.ts +4 -4
- package/lib/components/TokenListInput/TokenValueChips.d.ts.map +1 -1
- package/lib/components/TokenListInput/TokenValueChips.js +14 -17
- package/lib/components/Tooltip/Tooltip.d.ts +5 -6
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +10 -9
- package/lib/components/Truncate/Truncate.d.ts +2 -2
- package/lib/components/Truncate/Truncate.d.ts.map +1 -1
- package/lib/components/Truncate/Truncate.js +4 -5
- package/lib/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.d.ts +3 -3
- package/lib/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.d.ts.map +1 -1
- package/lib/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.js +19 -10
- package/lib/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.stories.d.ts +1 -1
- package/lib/components/Typeahead/SimpleTypeahead.d.ts +5 -6
- package/lib/components/Typeahead/SimpleTypeahead.d.ts.map +1 -1
- package/lib/components/Typeahead/SimpleTypeahead.js +1 -5
- package/lib/components/Typeahead/SimpleTypeahead.stories.d.ts.map +1 -1
- package/lib/components/Typeahead/Typeahead.d.ts +5 -6
- package/lib/components/Typeahead/Typeahead.d.ts.map +1 -1
- package/lib/components/Typeahead/Typeahead.js +14 -11
- package/lib/components/Typeahead/Typeahead.stories.d.ts.map +1 -1
- package/lib/components/WeekdayPicker/WeekdayPicker.d.ts +4 -4
- package/lib/components/WeekdayPicker/WeekdayPicker.d.ts.map +1 -1
- package/lib/components/WeekdayPicker/WeekdayPicker.stories.d.ts.map +1 -1
- package/lib/devtools/DependencyGraph/DependencyGraph.stories.d.ts.map +1 -1
- package/lib/flow-to-typescript-codemod.d.ts +1 -21
- package/lib/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.d.ts +2 -2
- package/lib/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.d.ts.map +1 -1
- package/lib/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.stories.d.ts.map +1 -1
- package/lib/hooks/useFileUpload/useFileUpload.d.ts +2 -2
- package/lib/hooks/useFileUpload/useFileUpload.d.ts.map +1 -1
- package/lib/hooks/useFileUpload/useFileUpload.stories.d.ts.map +1 -1
- package/lib/hooks/useFilteredOptions/useFilteredOptions.d.ts +4 -4
- package/lib/hooks/useFilteredOptions/useFilteredOptions.d.ts.map +1 -1
- package/lib/hooks/useFilteredOptions/useFilteredOptions.stories.d.ts.map +1 -1
- package/lib/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +2 -2
- package/lib/hooks/useInfiniteScroll/useInfiniteScroll.d.ts.map +1 -1
- package/lib/hooks/useInputState/useInputState.d.ts.map +1 -1
- package/lib/hooks/useLockedBody/useLockedBody.d.ts.map +1 -1
- package/lib/hooks/useModal/useModal.d.ts +13 -5
- package/lib/hooks/useModal/useModal.d.ts.map +1 -1
- package/lib/hooks/useToastPortal/useToastPortal.d.ts +2 -2
- package/lib/hooks/useToastPortal/useToastPortal.d.ts.map +1 -1
- package/lib/hooks/useToggle/useToggle.d.ts.map +1 -1
- package/lib/hooks/useWindowSize/useWindowSize.d.ts +2 -2
- package/lib/hooks/useWindowSize/useWindowSize.d.ts.map +1 -1
- package/lib/stories/Border/Border.stories.d.ts.map +1 -1
- package/lib/stories/Color/Color.stories.d.ts.map +1 -1
- package/lib/stories/Elevation/Elevation.stories.d.ts.map +1 -1
- package/lib/stories/Motion/Motion.stories.d.ts.map +1 -1
- package/lib/stories/Opacity/Opacity.stories.d.ts.map +1 -1
- package/lib/stories/Shadow/Shadow.stories.d.ts.map +1 -1
- package/lib/stories/Size/Size.stories.d.ts.map +1 -1
- package/lib/stories/Space/Space.stories.d.ts.map +1 -1
- package/lib/stories/Tokens/index.d.ts.map +1 -1
- package/lib/styles/index.css +2 -0
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/index.d.ts.map +1 -1
- package/lib/styles/index.js +2 -1
- package/lib/styles/variables/_size.css +2 -0
- package/lib/styles/variables/_size.d.ts +1 -0
- package/lib/styles/variables/_size.d.ts.map +1 -1
- package/lib/styles/variables/_size.js +2 -1
- package/lib/types/charts.d.ts +35 -31
- package/lib/types/charts.d.ts.map +1 -1
- package/lib/types/date-range-picker.d.ts +8 -9
- package/lib/types/date-range-picker.d.ts.map +1 -1
- package/lib/types/menu.d.ts +2 -2
- package/lib/types/menu.d.ts.map +1 -1
- package/lib/types/toast.d.ts +9 -10
- package/lib/types/toast.d.ts.map +1 -1
- package/lib/utils/charts/charts.d.ts +1 -1
- package/lib/utils/charts/charts.d.ts.map +1 -1
- package/lib/utils/charts/donutChart.d.ts +2 -2
- package/lib/utils/charts/donutChart.d.ts.map +1 -1
- package/lib/utils/charts/donutChart.js +2 -0
- package/lib/utils/charts/funnelChart.d.ts.map +1 -1
- package/lib/utils/charts/helpers.d.ts +1 -1
- package/lib/utils/charts/helpers.d.ts.map +1 -1
- package/lib/utils/charts/sankeyChart.d.ts +2 -2
- package/lib/utils/charts/sankeyChart.d.ts.map +1 -1
- package/lib/utils/click-away/click-away.d.ts +11 -13
- package/lib/utils/click-away/click-away.d.ts.map +1 -1
- package/lib/utils/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/lib/utils/dom/dom.d.ts +2 -2
- package/lib/utils/dom/dom.d.ts.map +1 -1
- package/lib/utils/helpers/helpers.d.ts.map +1 -1
- package/lib/utils/makeClassNameComponent/makeClassNameComponent.d.ts.map +1 -1
- package/lib/utils/merge-refs/merge-refs.d.ts +2 -3
- package/lib/utils/merge-refs/merge-refs.d.ts.map +1 -1
- package/lib/utils/merge-refs/merge-refs.js +13 -7
- package/lib/utils/merge-refs/merge-refs.stories.d.ts.map +1 -1
- package/lib/utils/token-list-input/token-list-input.d.ts +5 -5
- package/lib/utils/token-list-input/token-list-input.d.ts.map +1 -1
- package/lib/utils/tokens/tokens.d.ts +7 -6
- package/lib/utils/tokens/tokens.d.ts.map +1 -1
- package/package.json +18 -10
- package/tsconfig.json +1 -1
|
@@ -21,6 +21,15 @@ const TOAST_SEMANTIC = exports.TOAST_SEMANTIC = Object.freeze({
|
|
|
21
21
|
danger: 'danger',
|
|
22
22
|
primary: 'primary'
|
|
23
23
|
});
|
|
24
|
+
|
|
25
|
+
// Define the expected props for button elements in ToastFooter
|
|
26
|
+
|
|
27
|
+
// Type for a button element that can be cloned
|
|
28
|
+
|
|
29
|
+
// Define the expected props for toast child elements
|
|
30
|
+
|
|
31
|
+
// Type for toast child elements that can be cloned
|
|
32
|
+
|
|
24
33
|
const ToastIcon = _ref => {
|
|
25
34
|
let {
|
|
26
35
|
semantic
|
|
@@ -66,8 +75,7 @@ const ToastIcon = _ref => {
|
|
|
66
75
|
const ToastTitle = exports.ToastTitle = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
67
76
|
let {
|
|
68
77
|
children,
|
|
69
|
-
|
|
70
|
-
semantic = '',
|
|
78
|
+
semantic = TOAST_SEMANTIC.information,
|
|
71
79
|
className,
|
|
72
80
|
...props
|
|
73
81
|
} = _ref2;
|
|
@@ -100,31 +108,28 @@ const ToastFooter = _ref4 => {
|
|
|
100
108
|
const footerActions = React.Children.map(children, (child, index) => {
|
|
101
109
|
const isLast = index === arrayChildren.length - 1;
|
|
102
110
|
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
103
|
-
//
|
|
111
|
+
// Cast to our typed button element
|
|
112
|
+
const buttonElement = child;
|
|
113
|
+
const buttonProps = buttonElement.props;
|
|
104
114
|
const {
|
|
105
115
|
onClick
|
|
106
|
-
} =
|
|
116
|
+
} = buttonProps;
|
|
107
117
|
const buttonClickHandler = e => {
|
|
108
|
-
onClose
|
|
109
|
-
onClick
|
|
118
|
+
onClose?.();
|
|
119
|
+
onClick?.(e);
|
|
110
120
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (child?.type?.displayName === 'Button' && isLast) {
|
|
114
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
121
|
+
if (buttonElement?.type?.displayName === 'Button' && isLast) {
|
|
122
|
+
return /*#__PURE__*/React.cloneElement(buttonElement, {
|
|
115
123
|
size: 'small',
|
|
116
124
|
type: 'primary',
|
|
117
|
-
|
|
118
|
-
...child.props,
|
|
125
|
+
...buttonProps,
|
|
119
126
|
onClick: buttonClickHandler
|
|
120
127
|
});
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
128
|
+
} else if (buttonElement?.type?.displayName === 'Button') {
|
|
129
|
+
return /*#__PURE__*/React.cloneElement(buttonElement, {
|
|
124
130
|
size: 'small',
|
|
125
131
|
type: 'tertiary',
|
|
126
|
-
|
|
127
|
-
...child.props,
|
|
132
|
+
...buttonProps,
|
|
128
133
|
onClick: buttonClickHandler
|
|
129
134
|
});
|
|
130
135
|
}
|
|
@@ -159,12 +164,15 @@ const Toast = _ref5 => {
|
|
|
159
164
|
if (childrenArray.length) {
|
|
160
165
|
const nodes = [];
|
|
161
166
|
for (const child of childrenArray) {
|
|
162
|
-
//
|
|
163
|
-
if (child
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
167
|
+
// Type guard to ensure child is a ReactElement
|
|
168
|
+
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
169
|
+
// Cast to our typed toast child element
|
|
170
|
+
const toastChildElement = child;
|
|
171
|
+
if (toastChildElement?.type?.displayName === comp) {
|
|
172
|
+
nodes.push(/*#__PURE__*/React.cloneElement(toastChildElement, {
|
|
173
|
+
semantic
|
|
174
|
+
}));
|
|
175
|
+
}
|
|
168
176
|
}
|
|
169
177
|
}
|
|
170
178
|
return nodes.length > 1 ? nodes : nodes[0];
|
|
@@ -172,7 +180,6 @@ const Toast = _ref5 => {
|
|
|
172
180
|
return null;
|
|
173
181
|
};
|
|
174
182
|
const footer = getComp('ToastFooter');
|
|
175
|
-
// @ts-ignore - TS2769 - No overload matches this call.
|
|
176
183
|
const footerWithClose = footer ? /*#__PURE__*/React.cloneElement(footer, {
|
|
177
184
|
onClose
|
|
178
185
|
}) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/ToastContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ToastContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/ToastContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAoD3D,eAAO,MAAM,cAAc,QAAO,IAAI,GAAG,KAAK,CAAC,WAyE9C,CAAC"}
|
|
@@ -12,6 +12,8 @@ var _ = require("./");
|
|
|
12
12
|
var _ToastContainerModule = _interopRequireDefault(require("./ToastContainer.module.css"));
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
// Type definitions for toast content props
|
|
16
|
+
|
|
15
17
|
const ADD = 'ADD';
|
|
16
18
|
const REMOVE = 'REMOVE';
|
|
17
19
|
const reducer = (state, action) => {
|
|
@@ -94,10 +96,8 @@ const ToastContainer = () => {
|
|
|
94
96
|
content,
|
|
95
97
|
id
|
|
96
98
|
} = _ref2;
|
|
97
|
-
|
|
98
|
-
/*#__PURE__*/
|
|
99
|
-
// @ts-ignore - TS2769 - No overload matches this call.
|
|
100
|
-
_react.default.cloneElement(content, {
|
|
99
|
+
if (/*#__PURE__*/_react.default.isValidElement(content)) {
|
|
100
|
+
return /*#__PURE__*/_react.default.cloneElement(content, {
|
|
101
101
|
key: id,
|
|
102
102
|
onClose: () => dispatch({
|
|
103
103
|
type: REMOVE,
|
|
@@ -105,8 +105,9 @@ const ToastContainer = () => {
|
|
|
105
105
|
id
|
|
106
106
|
}
|
|
107
107
|
})
|
|
108
|
-
})
|
|
109
|
-
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return content;
|
|
110
111
|
});
|
|
111
112
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
112
113
|
key: position.toString(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CallbackFuncTypes, ContentTypes, ToastOptions } from '../../types/toast';
|
|
2
2
|
export declare const POSITIONS: {
|
|
3
3
|
readonly TOP_CENTER: "topCenter";
|
|
4
4
|
readonly TOP_LEFT: "topLeft";
|
|
@@ -12,12 +12,12 @@ export declare const ACTIONS: {
|
|
|
12
12
|
readonly REMOVE: "REMOVE";
|
|
13
13
|
};
|
|
14
14
|
export declare const toastManager: {
|
|
15
|
-
add(content:
|
|
16
|
-
remove(id: string)
|
|
17
|
-
subscribe(callback:
|
|
15
|
+
add: (content: ContentTypes, options?: ToastOptions) => string;
|
|
16
|
+
remove: (id: string) => boolean;
|
|
17
|
+
subscribe: (callback: CallbackFuncTypes) => void;
|
|
18
18
|
};
|
|
19
19
|
export declare const toastApi: {
|
|
20
|
-
readonly show: (content:
|
|
20
|
+
readonly show: (content: ContentTypes, options?: ToastOptions) => string;
|
|
21
21
|
readonly remove: (id: string) => boolean;
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=ToastManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastManager.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/ToastManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACb,MAAM,mBAAmB,CAAC;AAM3B,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAQX,eAAO,MAAM,YAAY,EAAE;IACzB,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"ToastManager.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/ToastManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACb,MAAM,mBAAmB,CAAC;AAM3B,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAQX,eAAO,MAAM,YAAY,EAAE;IACzB,GAAG,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;IAC/D,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IAChC,SAAS,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAuB/C,CAAC;AAEL,eAAO,MAAM,QAAQ;6BACH,YAAY,YAAY,YAAY,KAAG,MAAM;0BAEhD,MAAM,KAAG,OAAO;CACrB,CAAC"}
|
|
@@ -27,7 +27,6 @@ const defaultOptions = {
|
|
|
27
27
|
const toastManager = exports.toastManager = (() => {
|
|
28
28
|
let callbackFn;
|
|
29
29
|
const manager = {
|
|
30
|
-
// @ts-ignore - TS2355 - A function whose declared type is neither 'void' nor 'any' must return a value.
|
|
31
30
|
subscribe(callback) {
|
|
32
31
|
callbackFn = callback;
|
|
33
32
|
},
|
|
@@ -37,7 +36,7 @@ const toastManager = exports.toastManager = (() => {
|
|
|
37
36
|
...options
|
|
38
37
|
};
|
|
39
38
|
const toastId = (0, _helpers.uuid)();
|
|
40
|
-
callbackFn
|
|
39
|
+
callbackFn?.(ACTIONS.ADD, content, {
|
|
41
40
|
...mergedOptions,
|
|
42
41
|
id: toastId
|
|
43
42
|
});
|
|
@@ -10,7 +10,7 @@ type ClassNames = Readonly<{
|
|
|
10
10
|
wrapper?: string;
|
|
11
11
|
label?: string;
|
|
12
12
|
}>;
|
|
13
|
-
export
|
|
13
|
+
export interface ToggleProps {
|
|
14
14
|
name?: string;
|
|
15
15
|
classNames?: ClassNames;
|
|
16
16
|
children?: React.ReactNode;
|
|
@@ -24,7 +24,7 @@ export type ToggleProps = {
|
|
|
24
24
|
value?: string;
|
|
25
25
|
ariaLabel?: string;
|
|
26
26
|
labelPosition?: 'left' | 'right';
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
export declare const Toggle: Flow.AbstractComponent<ToggleProps, HTMLInputElement>;
|
|
29
29
|
export {};
|
|
30
30
|
//# sourceMappingURL=Toggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAMrD;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAMrD;;;;;GAKG;AACH,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,KAAK,OAAO,CAAC;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,MAAM,EAAE,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,gBAAgB,CAoFtE,CAAC"}
|
|
@@ -32,11 +32,10 @@ const Toggle = exports.Toggle = /*#__PURE__*/React.forwardRef((_ref, forwardRef)
|
|
|
32
32
|
...props
|
|
33
33
|
} = _ref;
|
|
34
34
|
const toggleInput = /*#__PURE__*/React.createRef();
|
|
35
|
-
// @ts-ignore - TS2322 - Type 'HTMLInputElement | null' is not assignable to type 'HTMLInputElement'.
|
|
36
35
|
React.useImperativeHandle(forwardRef, () => toggleInput.current);
|
|
37
36
|
const handleOnChange = () => {
|
|
38
37
|
if (!disabled) {
|
|
39
|
-
onChange
|
|
38
|
+
onChange?.({
|
|
40
39
|
value,
|
|
41
40
|
checked: !checked
|
|
42
41
|
});
|
|
@@ -77,7 +76,4 @@ const Toggle = exports.Toggle = /*#__PURE__*/React.forwardRef((_ref, forwardRef)
|
|
|
77
76
|
className: (0, _classify.default)(_ToggleModule.default.toggleLabel, classNames?.label)
|
|
78
77
|
}, children));
|
|
79
78
|
});
|
|
80
|
-
|
|
81
|
-
// @ts-ignore - TS2339 - Property 'name' does not exist on type 'unknown'.
|
|
82
|
-
// @ts-ignore - TS2339 - Property 'displayName' does not exist on type 'unknown'.
|
|
83
|
-
Toggle.name = Toggle.displayName = 'Toggle';
|
|
79
|
+
Toggle.displayName = 'Toggle';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Toggle.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM1C,wBAgGE;AAEF,eAAO,MAAM,OAAO;WAAU,WAAW;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Toggle.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Toggle.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM1C,wBAgGE;AAEF,eAAO,MAAM,OAAO;WAAU,WAAW;;;;;;;;;;CAkBxC,CAAC;AAYF,eAAO,MAAM,aAAa;WAAU,WAAW;;;;;;;;;;;CAiC9C,CAAC"}
|
|
@@ -10,20 +10,22 @@ type ClassNames = Readonly<{
|
|
|
10
10
|
box?: string;
|
|
11
11
|
input?: string;
|
|
12
12
|
}>;
|
|
13
|
-
export
|
|
13
|
+
export interface TokenListMenuOptionTypes<T> {
|
|
14
14
|
options?: Array<T>;
|
|
15
15
|
groupTitleOptions?: Array<TokenGroupTitleOption<T>>;
|
|
16
16
|
resolveLabel?: (option: T) => string;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
17
|
+
}
|
|
18
|
+
export interface TokenGroupTitleOption<T> {
|
|
19
19
|
groupTitle?: React.ReactNode;
|
|
20
20
|
options?: Array<T>;
|
|
21
21
|
showLineDivider?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export
|
|
24
|
-
|
|
22
|
+
}
|
|
23
|
+
export interface TokenListMenuProps<T> extends Omit<BaseMenuProps, 'resolveLabel'>, TokenListMenuOptionTypes<T> {
|
|
24
|
+
resolveLabel?: (option: T) => string;
|
|
25
|
+
}
|
|
26
|
+
export interface Props<T> {
|
|
25
27
|
classNames?: ClassNames;
|
|
26
|
-
clickAwayRef?: ClickAwayRefType
|
|
28
|
+
clickAwayRef?: React.RefObject<ClickAwayRefType | null>;
|
|
27
29
|
disabled?: boolean;
|
|
28
30
|
error?: boolean;
|
|
29
31
|
errorText?: string;
|
|
@@ -35,9 +37,9 @@ export type Props<T> = {
|
|
|
35
37
|
isLoading?: boolean;
|
|
36
38
|
locked?: boolean;
|
|
37
39
|
onChange: (values: Array<T>) => unknown;
|
|
38
|
-
onInputBlur?:
|
|
40
|
+
onInputBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
39
41
|
onInputChange?: (value: string) => unknown;
|
|
40
|
-
onInputFocus?:
|
|
42
|
+
onInputFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
41
43
|
placeholder?: string;
|
|
42
44
|
size?: 'medium' | 'small';
|
|
43
45
|
tabIndex?: number;
|
|
@@ -46,9 +48,9 @@ export type Props<T> = {
|
|
|
46
48
|
onMenuOpen?: () => unknown;
|
|
47
49
|
onMenuClose?: () => unknown;
|
|
48
50
|
resolveTokenValue?: (arg1: ResolveTokenValueProps<T>) => React.ReactNode;
|
|
49
|
-
inputProps?: InputProps
|
|
51
|
+
inputProps?: Omit<InputProps, 'size'>;
|
|
50
52
|
elevation?: ElevationType;
|
|
51
|
-
}
|
|
53
|
+
}
|
|
52
54
|
export declare function TokenListInput<T>(props: Props<T>): React.JSX.Element;
|
|
53
55
|
export declare namespace TokenListInput {
|
|
54
56
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenListInput.d.ts","sourceRoot":"","sources":["../../../src/components/TokenListInput/TokenListInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AASxE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAG3C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAG9C,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"TokenListInput.d.ts","sourceRoot":"","sources":["../../../src/components/TokenListInput/TokenListInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AASxE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAG3C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAG9C,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AAa9D,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACnB,iBAAiB,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,CACnC,SAAQ,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,EACzC,wBAAwB,CAAC,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;IACxC,WAAW,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACxD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,YAAY,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,IAAI,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACzE,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,qBAgThD;yBAhTe,cAAc"}
|
|
@@ -26,10 +26,9 @@ var _TokenListInputModule = _interopRequireDefault(require("./TokenListInput.mod
|
|
|
26
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
27
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
28
28
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// TODO: use Generics with Constraints when we have typescript.
|
|
29
|
+
// Type definition for token objects with expected properties
|
|
32
30
|
|
|
31
|
+
const DEFAULT_LIMIT_VALUE = exports.DEFAULT_LIMIT_VALUE = 100;
|
|
33
32
|
function TokenListInput(props) {
|
|
34
33
|
const {
|
|
35
34
|
classNames,
|
|
@@ -68,17 +67,12 @@ function TokenListInput(props) {
|
|
|
68
67
|
context
|
|
69
68
|
} = (0, _react2.useFloating)({
|
|
70
69
|
open: true,
|
|
71
|
-
// @ts-ignore - TS2322 - Type 'string' is not assignable to type 'Strategy | undefined'.
|
|
72
70
|
strategy: _ButtonDropdown.STRATEGY_TYPE.absolute,
|
|
73
|
-
// @ts-ignore - TS2322 - Type 'string' is not assignable to type 'Placement | undefined'.
|
|
74
71
|
placement: _ButtonDropdown.ANCHOR_POSITION_TYPE.bottomStart,
|
|
75
72
|
whileElementsMounted: _react2.autoUpdate,
|
|
76
73
|
middleware: [(0, _react2.flip)(), (0, _react2.offset)(parseInt(_space.spaceXXSmall))]
|
|
77
74
|
});
|
|
78
|
-
|
|
79
|
-
// @ts-ignore - TS2554 - Expected 1 arguments, but got 0.
|
|
80
|
-
const inputRef = React.useRef();
|
|
81
|
-
// @ts-ignore - TS2345 - Argument of type '(ReferenceType & ReferenceType) | null' is not assignable to parameter of type 'HTMLElement | null | undefined'.
|
|
75
|
+
const inputRef = React.useRef(null);
|
|
82
76
|
const dropdownWidth = (0, _hooks.useReferenceElementWidth)(refs.reference?.current);
|
|
83
77
|
const onOpenToggle = isOpen => {
|
|
84
78
|
if (isOpen) {
|
|
@@ -95,24 +89,30 @@ function TokenListInput(props) {
|
|
|
95
89
|
}
|
|
96
90
|
}, [focusOnMount]);
|
|
97
91
|
const addValue = value => {
|
|
98
|
-
//
|
|
99
|
-
|
|
92
|
+
// Type assertion to access expected properties
|
|
93
|
+
const valueWithProps = value;
|
|
94
|
+
if (locked || !value || valueWithProps.disabled) {
|
|
100
95
|
return; // Prevent adding values when disabled or locked
|
|
101
96
|
}
|
|
102
97
|
onInputChange?.('');
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
const existingToken = values.find(token => {
|
|
99
|
+
const tokenWithProps = token;
|
|
100
|
+
return tokenWithProps.key === valueWithProps.key;
|
|
101
|
+
});
|
|
105
102
|
if (!existingToken) {
|
|
106
103
|
onChange([...values, value]);
|
|
107
104
|
}
|
|
108
105
|
setTimeout(() => {
|
|
109
|
-
inputRef
|
|
106
|
+
inputRef?.current?.focus();
|
|
110
107
|
}, 0);
|
|
111
108
|
};
|
|
112
109
|
const removeValue = value => {
|
|
113
|
-
!disabled && !locked
|
|
110
|
+
if (!disabled && !locked) {
|
|
111
|
+
// prevent removing values when disabled or locked
|
|
112
|
+
onChange((0, _without.default)(values, value));
|
|
113
|
+
}
|
|
114
114
|
setTimeout(() => {
|
|
115
|
-
inputRef
|
|
115
|
+
inputRef?.current?.focus();
|
|
116
116
|
}, 0);
|
|
117
117
|
};
|
|
118
118
|
const hideInput = values.length >= limit || disabled || locked;
|
|
@@ -127,14 +127,11 @@ function TokenListInput(props) {
|
|
|
127
127
|
event.preventDefault();
|
|
128
128
|
let firstOption = null;
|
|
129
129
|
if (menu?.options && menu.options.length > 0) {
|
|
130
|
-
// @ts-ignore - TS2345 - Argument of type 'T[]' is not assignable to parameter of type 'V[]'.
|
|
131
130
|
firstOption = (0, _tokenListInput.getFirstOption)(menu.options);
|
|
132
131
|
} else if (menu?.groupTitleOptions && menu.groupTitleOptions.length > 0) {
|
|
133
|
-
// @ts-ignore - TS2345 - Argument of type 'TokenGroupTitleOption<T>[]' is not assignable to parameter of type 'Group<V>[]'.
|
|
134
132
|
firstOption = (0, _tokenListInput.getFirstOptionFromGroup)(menu.groupTitleOptions);
|
|
135
133
|
}
|
|
136
134
|
if (firstOption) {
|
|
137
|
-
// @ts-ignore - TS2345 - Argument of type 'V' is not assignable to parameter of type 'T'.
|
|
138
135
|
addValue(firstOption);
|
|
139
136
|
}
|
|
140
137
|
}
|
|
@@ -145,7 +142,7 @@ function TokenListInput(props) {
|
|
|
145
142
|
} else if (key === 'Escape') {
|
|
146
143
|
event.preventDefault();
|
|
147
144
|
setTimeout(() => {
|
|
148
|
-
inputRef
|
|
145
|
+
inputRef?.current?.blur();
|
|
149
146
|
}, 0);
|
|
150
147
|
}
|
|
151
148
|
};
|
|
@@ -181,11 +178,9 @@ function TokenListInput(props) {
|
|
|
181
178
|
if (!isOpen) {
|
|
182
179
|
onOpen();
|
|
183
180
|
}
|
|
184
|
-
// @ts-ignore - TS2345 - Argument of type 'FocusEvent<HTMLDivElement, Element>' is not assignable to parameter of type 'SyntheticEvent<HTMLInputElement, Event>'.
|
|
185
181
|
onInputFocus?.(e);
|
|
186
182
|
},
|
|
187
183
|
onBlur: e => {
|
|
188
|
-
// @ts-ignore - TS2345 - Argument of type 'FocusEvent<HTMLDivElement, Element>' is not assignable to parameter of type 'SyntheticEvent<HTMLInputElement, Event>'.
|
|
189
184
|
onInputBlur?.(e);
|
|
190
185
|
},
|
|
191
186
|
className: (0, _classify.default)(_TokenListInputModule.default.box, {
|
|
@@ -194,9 +189,7 @@ function TokenListInput(props) {
|
|
|
194
189
|
[_TokenListInputModule.default.small]: size === 'small',
|
|
195
190
|
[_TokenListInputModule.default.withError]: error,
|
|
196
191
|
[_TokenListInputModule.default.inputLocked]: locked
|
|
197
|
-
}, classNames?.box)
|
|
198
|
-
// @ts-ignore - TS2322 - Type '((node: ReferenceType | null) => void) & ((node: ReferenceType | null) => void)' is not assignable to type '{ current: HTMLElement | null | undefined; }'.
|
|
199
|
-
,
|
|
192
|
+
}, classNames?.box),
|
|
200
193
|
ref: (0, _mergeRefs.mergeRefs)([refs.setReference, triggerRef])
|
|
201
194
|
}, /*#__PURE__*/React.createElement(_TokenValueChips.TokenValueChips, {
|
|
202
195
|
values: values,
|
|
@@ -204,11 +197,7 @@ function TokenListInput(props) {
|
|
|
204
197
|
disabled: disabled,
|
|
205
198
|
locked: locked,
|
|
206
199
|
onDismiss: removeValue
|
|
207
|
-
}), !hideInput &&
|
|
208
|
-
/*#__PURE__*/
|
|
209
|
-
// @ts-ignore - TS2345 - Argument of type 'InputProps' is not assignable to parameter of type 'InputProps'.
|
|
210
|
-
React.createElement("input", _extends({}, inputProps, {
|
|
211
|
-
// @ts-ignore - TS2322 - Type 'RefObject<HTMLInputElement | null | undefined>' is not assignable to type 'Ref<HTMLInputElement> | undefined'.
|
|
200
|
+
}), !hideInput && /*#__PURE__*/React.createElement("input", _extends({}, inputProps, {
|
|
212
201
|
ref: inputRef,
|
|
213
202
|
type: "text",
|
|
214
203
|
readOnly: locked,
|
|
@@ -216,7 +205,9 @@ function TokenListInput(props) {
|
|
|
216
205
|
placeholder: values.length === 0 ? placeholder || inputPlaceholder : inputPlaceholder,
|
|
217
206
|
onChange: event => {
|
|
218
207
|
onInputChange?.(event.target.value);
|
|
219
|
-
!isOpen
|
|
208
|
+
if (!isOpen) {
|
|
209
|
+
onOpen();
|
|
210
|
+
}
|
|
220
211
|
},
|
|
221
212
|
disabled: disabled || locked,
|
|
222
213
|
tabIndex: tabIndex,
|
|
@@ -246,14 +237,10 @@ function TokenListInput(props) {
|
|
|
246
237
|
}, helperText) : helperText), !locked && isOpen && menu && /*#__PURE__*/React.createElement(_react2.FloatingPortal, null, /*#__PURE__*/React.createElement(_react2.FloatingFocusManager, {
|
|
247
238
|
modal: false,
|
|
248
239
|
context: context,
|
|
249
|
-
returnFocus: false
|
|
250
|
-
// @ts-ignore - TS2322 - Type 'MutableRefObject<ReferenceType | null> & MutableRefObject<ReferenceType | null>' is not assignable to type 'number | MutableRefObject<HTMLElement | null> | undefined'.
|
|
251
|
-
,
|
|
240
|
+
returnFocus: false,
|
|
252
241
|
initialFocus: refs.reference
|
|
253
242
|
}, /*#__PURE__*/React.createElement("div", {
|
|
254
|
-
className: _TokenListInputModule.default.menuWrapper
|
|
255
|
-
// @ts-ignore - TS2322 - Type '((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void)' is not assignable to type '{ current: HTMLElement | null | undefined; }'.
|
|
256
|
-
,
|
|
243
|
+
className: _TokenListInputModule.default.menuWrapper,
|
|
257
244
|
ref: (0, _mergeRefs.mergeRefs)([refs.setFloating, boundaryRef]),
|
|
258
245
|
style: {
|
|
259
246
|
position: strategy,
|
|
@@ -274,7 +261,6 @@ function TokenListInput(props) {
|
|
|
274
261
|
if (values.length >= limit) {
|
|
275
262
|
return;
|
|
276
263
|
}
|
|
277
|
-
// @ts-ignore - TS2345 - Argument of type 'MenuOption' is not assignable to parameter of type 'T'.
|
|
278
264
|
addValue(option);
|
|
279
265
|
clickAway();
|
|
280
266
|
inputRef.current?.focus();
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Over } from '../../types/utils';
|
|
3
2
|
import type { MenuOption } from '../Menu';
|
|
4
3
|
import type { Props } from './TokenListInput';
|
|
5
4
|
import { TokenListInput } from './TokenListInput';
|
|
5
|
+
interface TokenListOption extends Omit<MenuOption, 'arbitrary'> {
|
|
6
|
+
arbitrary?: boolean;
|
|
7
|
+
}
|
|
6
8
|
declare const _default: {
|
|
7
9
|
tags: string[];
|
|
8
10
|
title: string;
|
|
@@ -312,9 +314,6 @@ declare const _default: {
|
|
|
312
314
|
};
|
|
313
315
|
};
|
|
314
316
|
export default _default;
|
|
315
|
-
type TokenListOption = Over<MenuOption, {
|
|
316
|
-
arbitrary?: boolean;
|
|
317
|
-
}>;
|
|
318
317
|
export declare const _TokenListInput: {
|
|
319
318
|
(args: Props<TokenListOption>): React.JSX.Element;
|
|
320
319
|
args: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenListInput.stories.d.ts","sourceRoot":"","sources":["../../../src/components/TokenListInput/TokenListInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TokenListInput.stories.d.ts","sourceRoot":"","sources":["../../../src/components/TokenListInput/TokenListInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAQxC,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAKhD,UAAU,eAAgB,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBD,wBAgQE;AAEF,eAAO,MAAM,eAAe;WAAU,KAAK,CAAC,eAAe,CAAC;;;;;;CA0B3D,CAAC;AAMF,eAAO,MAAM,wBAAwB,GAAI,MAAM,KAAK,CAAC,eAAe,CAAC,sBAuCpE,CAAC;AAEF,eAAO,MAAM,qBAAqB;WAAU,KAAK,CAAC,eAAe,CAAC;;;;CAsBjE,CAAC;AAMF,eAAO,MAAM,uBAAuB;WAAU,KAAK,CAAC,eAAe,CAAC;;;;;;;CAsBnE,CAAC;AAoDF,eAAO,MAAM,oBAAoB;WAAU,KAAK,CAAC,eAAe,CAAC;;;;;;;;;;;;;4BA+CpD,KAAK,CAAC,SAAS;;;;;;;;;CA7C3B,CAAC;AAqIF,eAAO,MAAM,2BAA2B,GAAI,MAAM,KAAK,CAAC,eAAe,CAAC,sBAEvE,CAAC;AAEF,eAAO,MAAM,qBAAqB;WAAU,KAAK,CAAC,eAAe,CAAC;;;;;;;;;;;CAkFjE,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
interface Props<T> {
|
|
3
3
|
values: Array<T>;
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
locked?: boolean;
|
|
6
6
|
onDismiss: (arg1: T) => unknown;
|
|
7
7
|
resolveTokenValue?: (arg1: ResolveTokenValueProps<T>) => React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export
|
|
8
|
+
}
|
|
9
|
+
export interface ResolveTokenValueProps<T> {
|
|
10
10
|
token: T;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
onDismiss?: (arg1: T) => unknown;
|
|
13
13
|
locked?: boolean;
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
export declare function TokenValueChips<T>(props: Props<T>): (string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined)[];
|
|
16
16
|
export declare namespace TokenValueChips {
|
|
17
17
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenValueChips.d.ts","sourceRoot":"","sources":["../../../src/components/TokenListInput/TokenValueChips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TokenValueChips.d.ts","sourceRoot":"","sources":["../../../src/components/TokenListInput/TokenValueChips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,UAAU,KAAK,CAAC,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CAC1E;AAED,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAyBD,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,uSAkBjD;yBAlBe,eAAe"}
|
|
@@ -5,32 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TokenValueChips = TokenValueChips;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _elevation = require("../../styles/variables/_elevation");
|
|
9
8
|
var _Chip = require("../Chip");
|
|
10
9
|
var _Tooltip = require("../Tooltip");
|
|
11
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
|
+
// Type definition for token objects with expected properties
|
|
12
|
+
|
|
12
13
|
function defaultResolveTokenValue(_ref) {
|
|
13
14
|
let {
|
|
14
15
|
token,
|
|
15
16
|
disabled,
|
|
16
17
|
onDismiss
|
|
17
18
|
} = _ref;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
semantic: 'primary',
|
|
31
|
-
disabled: disabled
|
|
32
|
-
}, token?.label))
|
|
33
|
-
);
|
|
19
|
+
// Type assertion to access expected properties
|
|
20
|
+
const tokenWithProps = token;
|
|
21
|
+
return /*#__PURE__*/React.createElement(_Tooltip.Tooltip, {
|
|
22
|
+
body: tokenWithProps?.label,
|
|
23
|
+
elevation: "menu"
|
|
24
|
+
}, /*#__PURE__*/React.createElement(_Chip.Chip, {
|
|
25
|
+
key: tokenWithProps?.key,
|
|
26
|
+
onDismiss: _ => onDismiss?.(token),
|
|
27
|
+
dismissable: true,
|
|
28
|
+
semantic: 'primary',
|
|
29
|
+
disabled: disabled
|
|
30
|
+
}, tokenWithProps?.label));
|
|
34
31
|
}
|
|
35
32
|
function TokenValueChips(props) {
|
|
36
33
|
const {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Over } from '../../types/utils';
|
|
3
2
|
type ClassNames = Readonly<{
|
|
4
3
|
tooltip?: string;
|
|
5
4
|
title?: string;
|
|
@@ -25,7 +24,7 @@ export declare const ELEVATION_TYPES: Readonly<{
|
|
|
25
24
|
}>;
|
|
26
25
|
export type ElevationType = (typeof ELEVATION_TYPES)[keyof typeof ELEVATION_TYPES];
|
|
27
26
|
export type PlacementType = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right';
|
|
28
|
-
export
|
|
27
|
+
export interface BaseTooltipProps {
|
|
29
28
|
classNames?: ClassNames;
|
|
30
29
|
title?: string | React.ReactNode;
|
|
31
30
|
body?: string | React.ReactNode;
|
|
@@ -35,10 +34,10 @@ export type BaseTooltipProps = {
|
|
|
35
34
|
delayMotionDuration?: DelayMotionDurationType;
|
|
36
35
|
hidden?: boolean;
|
|
37
36
|
elevation?: ElevationType;
|
|
38
|
-
}
|
|
39
|
-
export
|
|
40
|
-
children:
|
|
41
|
-
}
|
|
37
|
+
}
|
|
38
|
+
export interface TooltipProps extends Omit<BaseTooltipProps, 'children'> {
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
}
|
|
42
41
|
export declare const getElevationValue: (elevation: string) => string;
|
|
43
42
|
export declare const Tooltip: ({ classNames, children, title, body, placement, bodyMaxLines, titleMaxLines, delayMotionDuration, elevation, hidden, }: TooltipProps) => React.JSX.Element;
|
|
44
43
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA0B/B,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;EAOtC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,CAAC;AAEjF,eAAO,MAAM,eAAe;;;;;;;;EAQ1B,CAAC;AAEH,MAAM,MAAM,aAAa,GACvB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEzD,MAAM,MAAM,aAAa,GACrB,KAAK,GACL,WAAW,GACX,SAAS,GACT,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,OAAO,CAAC;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;IACtE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM,KAAG,MAIrD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,wHAWrB,YAAY,sBAyGd,CAAC"}
|