@trellixio/roaster-react 1.1.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -23
- package/cjs/components/ActionCard/ActionCard.js +20 -4
- package/cjs/components/ActionCard/ActionCard.js.map +1 -1
- package/cjs/components/ActionCard/ActionCardGroup.js +42 -0
- package/cjs/components/ActionCard/ActionCardGroup.js.map +1 -0
- package/cjs/components/ActionList/ActionList.context.js.map +1 -1
- package/cjs/components/ActionList/ActionList.js +20 -23
- package/cjs/components/ActionList/ActionList.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListDivider.js +6 -3
- package/cjs/components/ActionList/components/ActionListDivider.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListDropdown.js +30 -15
- package/cjs/components/ActionList/components/ActionListDropdown.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListGroup.js +25 -4
- package/cjs/components/ActionList/components/ActionListGroup.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListItem.js +54 -4
- package/cjs/components/ActionList/components/ActionListItem.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListSearch.js +67 -0
- package/cjs/components/ActionList/components/ActionListSearch.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListSubmenu.js +125 -0
- package/cjs/components/ActionList/components/ActionListSubmenu.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListSwitchItem.js +64 -0
- package/cjs/components/ActionList/components/ActionListSwitchItem.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListTrigger.js +2 -36
- package/cjs/components/ActionList/components/ActionListTrigger.js.map +1 -1
- package/cjs/components/Alert/Alert.js +19 -2
- package/cjs/components/Alert/Alert.js.map +1 -1
- package/cjs/components/AppFrame/AppFrame.js +56 -0
- package/cjs/components/AppFrame/AppFrame.js.map +1 -0
- package/cjs/components/Avatar/Avatar.js +31 -8
- package/cjs/components/Avatar/Avatar.js.map +1 -1
- package/cjs/components/BlockCard/BlockCard.js +98 -4
- package/cjs/components/BlockCard/BlockCard.js.map +1 -1
- package/cjs/components/Button/Button.js +36 -15
- package/cjs/components/Button/Button.js.map +1 -1
- package/cjs/components/ButtonIcon/ButtonIcon.js +8 -9
- package/cjs/components/ButtonIcon/ButtonIcon.js.map +1 -1
- package/cjs/components/Chart/Chart.js +185 -0
- package/cjs/components/Chart/Chart.js.map +1 -0
- package/cjs/components/Checkbox/Checkbox.js +65 -38
- package/cjs/components/Checkbox/Checkbox.js.map +1 -1
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js.map +1 -1
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.js +45 -11
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/cjs/components/Checkbox/ChoiceText.js +49 -0
- package/cjs/components/Checkbox/ChoiceText.js.map +1 -0
- package/cjs/components/ColorField/ColorField.js +69 -18
- package/cjs/components/ColorField/ColorField.js.map +1 -1
- package/cjs/components/DatePicker/DatePicker.js +86 -48
- package/cjs/components/DatePicker/DatePicker.js.map +1 -1
- package/cjs/components/DatePicker/components/Calendar/Calendar.js +65 -35
- package/cjs/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
- package/cjs/components/DatePicker/components/Day/Day.js +16 -31
- package/cjs/components/DatePicker/components/Day/Day.js.map +1 -1
- package/cjs/components/DatePicker/components/Month/Month.js +92 -29
- package/cjs/components/DatePicker/components/Month/Month.js.map +1 -1
- package/cjs/components/DatePicker/components/MonthGrid/MonthGrid.js +97 -0
- package/cjs/components/DatePicker/components/MonthGrid/MonthGrid.js.map +1 -0
- package/cjs/components/DatePicker/components/Weekday/Weekday.js +3 -15
- package/cjs/components/DatePicker/components/Weekday/Weekday.js.map +1 -1
- package/cjs/components/DatePicker/utils/index.js +43 -25
- package/cjs/components/DatePicker/utils/index.js.map +1 -1
- package/cjs/components/DescriptiveList/DescriptiveList.js +14 -5
- package/cjs/components/DescriptiveList/DescriptiveList.js.map +1 -1
- package/cjs/components/DescriptiveList/DescriptiveListItem.js +15 -3
- package/cjs/components/DescriptiveList/DescriptiveListItem.js.map +1 -1
- package/cjs/components/DropdownCard/DropdownCard.context.js.map +1 -1
- package/cjs/components/DropdownCard/DropdownCard.js +17 -22
- package/cjs/components/DropdownCard/DropdownCard.js.map +1 -1
- package/cjs/components/DropdownCard/components/DropdownCardActions.js +5 -3
- package/cjs/components/DropdownCard/components/DropdownCardActions.js.map +1 -1
- package/cjs/components/DropdownCard/components/DropdownCardContent.js +5 -3
- package/cjs/components/DropdownCard/components/DropdownCardContent.js.map +1 -1
- package/cjs/components/DropdownCard/components/DropdownCardDropdown.js +18 -13
- package/cjs/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -1
- package/cjs/components/DropdownCard/components/DropdownCardTabs.js +136 -0
- package/cjs/components/DropdownCard/components/DropdownCardTabs.js.map +1 -0
- package/cjs/components/DropdownCard/components/DropdownCardTrigger.js +2 -34
- package/cjs/components/DropdownCard/components/DropdownCardTrigger.js.map +1 -1
- package/cjs/components/Field/Field.js +27 -0
- package/cjs/components/Field/Field.js.map +1 -0
- package/cjs/components/FileField/FileField.js +64 -24
- package/cjs/components/FileField/FileField.js.map +1 -1
- package/cjs/components/FormActions/FormActions.js +27 -0
- package/cjs/components/FormActions/FormActions.js.map +1 -0
- package/cjs/components/HyperlinkCard/HyperlinkCard.js +22 -6
- package/cjs/components/HyperlinkCard/HyperlinkCard.js.map +1 -1
- package/cjs/components/Icon/Icon.js +10 -12
- package/cjs/components/Icon/Icon.js.map +1 -1
- package/cjs/components/IconBadge/IconBadge.js +40 -0
- package/cjs/components/IconBadge/IconBadge.js.map +1 -0
- package/cjs/components/Loader/Loader.js +35 -2
- package/cjs/components/Loader/Loader.js.map +1 -1
- package/cjs/components/Modal/Modal.js +91 -4
- package/cjs/components/Modal/Modal.js.map +1 -1
- package/cjs/components/Modal/ModalProvider/ModalProviderFooter.js +7 -4
- package/cjs/components/Modal/ModalProvider/ModalProviderFooter.js.map +1 -1
- package/cjs/components/Modal/ModalProvider/index.js +16 -17
- package/cjs/components/Modal/ModalProvider/index.js.map +1 -1
- package/cjs/components/Modal/utils/reducer.js +4 -1
- package/cjs/components/Modal/utils/reducer.js.map +1 -1
- package/cjs/components/Modal/utils/useModal.js +1 -1
- package/cjs/components/Modal/utils/useModal.js.map +1 -1
- package/cjs/components/Page/Breadcrumbs.js +43 -0
- package/cjs/components/Page/Breadcrumbs.js.map +1 -0
- package/cjs/components/Page/Page.js +73 -8
- package/cjs/components/Page/Page.js.map +1 -1
- package/cjs/components/Pagination/Pagination.js +23 -12
- package/cjs/components/Pagination/Pagination.js.map +1 -1
- package/cjs/components/Progress/Progress.js +48 -3
- package/cjs/components/Progress/Progress.js.map +1 -1
- package/cjs/components/Radio/Radio.js +35 -25
- package/cjs/components/Radio/Radio.js.map +1 -1
- package/cjs/components/Radio/RadioGroup/RadioGroup.context.js.map +1 -1
- package/cjs/components/Radio/RadioGroup/RadioGroup.js +37 -24
- package/cjs/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
- package/cjs/components/RangeField/RangeField.js +31 -27
- package/cjs/components/RangeField/RangeField.js.map +1 -1
- package/cjs/components/Select/Select.js +75 -31
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Sidebar/Sidebar.js +122 -110
- package/cjs/components/Sidebar/Sidebar.js.map +1 -1
- package/cjs/components/Sidebar/components/Back.js +38 -0
- package/cjs/components/Sidebar/components/Back.js.map +1 -0
- package/cjs/components/Sidebar/components/Menu.js +17 -6
- package/cjs/components/Sidebar/components/Menu.js.map +1 -1
- package/cjs/components/Sidebar/components/MenuItem.js +37 -6
- package/cjs/components/Sidebar/components/MenuItem.js.map +1 -1
- package/cjs/components/Sidebar/components/Section.js +15 -3
- package/cjs/components/Sidebar/components/Section.js.map +1 -1
- package/cjs/components/Sidebar/components/SubMenu.js +15 -2
- package/cjs/components/Sidebar/components/SubMenu.js.map +1 -1
- package/cjs/components/Spinner/Spinner.js +20 -2
- package/cjs/components/Spinner/Spinner.js.map +1 -1
- package/cjs/components/StatCard/StatCard.js +47 -10
- package/cjs/components/StatCard/StatCard.js.map +1 -1
- package/cjs/components/Switch/Switch.js +42 -20
- package/cjs/components/Switch/Switch.js.map +1 -1
- package/cjs/components/Table/Table.js +95 -31
- package/cjs/components/Table/Table.js.map +1 -1
- package/cjs/components/Table/components/Checkbox/index.js +8 -8
- package/cjs/components/Table/components/Checkbox/index.js.map +1 -1
- package/cjs/components/Table/components/TableBody.js +3 -3
- package/cjs/components/Table/components/TableBody.js.map +1 -1
- package/cjs/components/Table/components/TableCell.js +3 -4
- package/cjs/components/Table/components/TableCell.js.map +1 -1
- package/cjs/components/Table/components/TableGroup.js +30 -0
- package/cjs/components/Table/components/TableGroup.js.map +1 -0
- package/cjs/components/Table/components/TableHead.js +19 -16
- package/cjs/components/Table/components/TableHead.js.map +1 -1
- package/cjs/components/Table/components/TableHeadCell.js +23 -5
- package/cjs/components/Table/components/TableHeadCell.js.map +1 -1
- package/cjs/components/Table/components/TablePagination.js +6 -16
- package/cjs/components/Table/components/TablePagination.js.map +1 -1
- package/cjs/components/Table/components/TableProvider/TableProvider.js +4 -4
- package/cjs/components/Table/components/TableProvider/TableProvider.js.map +1 -1
- package/cjs/components/Table/components/TableRow.js +12 -9
- package/cjs/components/Table/components/TableRow.js.map +1 -1
- package/cjs/components/Table/labels.js +34 -0
- package/cjs/components/Table/labels.js.map +1 -0
- package/cjs/components/Table/utils/rows/context.js.map +1 -1
- package/cjs/components/Table/utils/table/context.js.map +1 -1
- package/cjs/components/Table/utils/table/hooks.js +3 -3
- package/cjs/components/Table/utils/table/hooks.js.map +1 -1
- package/cjs/components/Table/utils/table/types.js +0 -7
- package/cjs/components/Table/utils/table/types.js.map +1 -1
- package/cjs/components/Table/utils/useSelectableResourceState/index.js +4 -5
- package/cjs/components/Table/utils/useSelectableResourceState/index.js.map +1 -1
- package/cjs/components/Tag/Tag.js +36 -5
- package/cjs/components/Tag/Tag.js.map +1 -1
- package/cjs/components/Tag/TagGroup.js +3 -2
- package/cjs/components/Tag/TagGroup.js.map +1 -1
- package/cjs/components/TextField/TextField.js +41 -38
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/Textarea/Textarea.js +10 -26
- package/cjs/components/Textarea/Textarea.js.map +1 -1
- package/cjs/components/Thumbnail/Thumbnail.js +22 -8
- package/cjs/components/Thumbnail/Thumbnail.js.map +1 -1
- package/cjs/components/Timeline/Timeline.js +40 -0
- package/cjs/components/Timeline/Timeline.js.map +1 -0
- package/cjs/components/Timeline/TimelineGroup.js +42 -0
- package/cjs/components/Timeline/TimelineGroup.js.map +1 -0
- package/cjs/components/Timeline/TimelineItem.js +38 -0
- package/cjs/components/Timeline/TimelineItem.js.map +1 -0
- package/cjs/components/Toast/Toast.js +18 -2
- package/cjs/components/Toast/Toast.js.map +1 -1
- package/cjs/components/Toast/Toasts.context.js +31 -3
- package/cjs/components/Toast/Toasts.context.js.map +1 -1
- package/cjs/components/Toast/ToastsContainer/index.js +43 -19
- package/cjs/components/Toast/ToastsContainer/index.js.map +1 -1
- package/cjs/components/Toast/ToastsProvider/index.js +11 -15
- package/cjs/components/Toast/ToastsProvider/index.js.map +1 -1
- package/cjs/components/Toast/store.js +49 -0
- package/cjs/components/Toast/store.js.map +1 -0
- package/cjs/components/Tooltip/Tooltip.js +34 -53
- package/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/cjs/components/Tooltip/TooltipCallout.js +60 -0
- package/cjs/components/Tooltip/TooltipCallout.js.map +1 -0
- package/cjs/components/Tooltip/useTooltip.js +11 -45
- package/cjs/components/Tooltip/useTooltip.js.map +1 -1
- package/cjs/components/Visualizer/Visualizer.js +70 -10
- package/cjs/components/Visualizer/Visualizer.js.map +1 -1
- package/cjs/index.js +68 -66
- package/cjs/index.js.map +1 -1
- package/cjs/tokens/tokens.js +1532 -0
- package/cjs/tokens/tokens.js.map +1 -0
- package/cjs/utils/Slot/index.js +52 -0
- package/cjs/utils/Slot/index.js.map +1 -0
- package/cjs/utils/classNames/index.js +3 -3
- package/cjs/utils/classNames/index.js.map +1 -1
- package/cjs/utils/getElementRef/index.js +16 -0
- package/cjs/utils/getElementRef/index.js.map +1 -0
- package/cjs/utils/guid/index.js.map +1 -1
- package/cjs/utils/toPercent/index.js +9 -0
- package/cjs/utils/toPercent/index.js.map +1 -0
- package/cjs/utils/useControllableState/index.js +39 -0
- package/cjs/utils/useControllableState/index.js.map +1 -0
- package/cjs/utils/useDropdown/DropdownTrigger.js +33 -0
- package/cjs/utils/useDropdown/DropdownTrigger.js.map +1 -0
- package/cjs/utils/useDropdown/index.js +54 -23
- package/cjs/utils/useDropdown/index.js.map +1 -1
- package/cjs/utils/useImageFallback/index.js +26 -0
- package/cjs/utils/useImageFallback/index.js.map +1 -0
- package/cjs/utils/useUid/index.js.map +1 -1
- package/esm/components/ActionCard/ActionCard.js +20 -4
- package/esm/components/ActionCard/ActionCard.js.map +1 -1
- package/esm/components/ActionCard/ActionCardGroup.js +26 -0
- package/esm/components/ActionCard/ActionCardGroup.js.map +1 -0
- package/esm/components/ActionList/ActionList.context.js.map +1 -1
- package/esm/components/ActionList/ActionList.js +21 -11
- package/esm/components/ActionList/ActionList.js.map +1 -1
- package/esm/components/ActionList/components/ActionListDivider.js +6 -3
- package/esm/components/ActionList/components/ActionListDivider.js.map +1 -1
- package/esm/components/ActionList/components/ActionListDropdown.js +31 -16
- package/esm/components/ActionList/components/ActionListDropdown.js.map +1 -1
- package/esm/components/ActionList/components/ActionListGroup.js +24 -3
- package/esm/components/ActionList/components/ActionListGroup.js.map +1 -1
- package/esm/components/ActionList/components/ActionListItem.js +53 -3
- package/esm/components/ActionList/components/ActionListItem.js.map +1 -1
- package/esm/components/ActionList/components/ActionListSearch.js +52 -0
- package/esm/components/ActionList/components/ActionListSearch.js.map +1 -0
- package/esm/components/ActionList/components/ActionListSubmenu.js +110 -0
- package/esm/components/ActionList/components/ActionListSubmenu.js.map +1 -0
- package/esm/components/ActionList/components/ActionListSwitchItem.js +49 -0
- package/esm/components/ActionList/components/ActionListSwitchItem.js.map +1 -0
- package/esm/components/ActionList/components/ActionListTrigger.js +2 -23
- package/esm/components/ActionList/components/ActionListTrigger.js.map +1 -1
- package/esm/components/Alert/Alert.js +19 -2
- package/esm/components/Alert/Alert.js.map +1 -1
- package/esm/components/AppFrame/AppFrame.js +37 -0
- package/esm/components/AppFrame/AppFrame.js.map +1 -0
- package/esm/components/Avatar/Avatar.js +31 -8
- package/esm/components/Avatar/Avatar.js.map +1 -1
- package/esm/components/BlockCard/BlockCard.js +98 -4
- package/esm/components/BlockCard/BlockCard.js.map +1 -1
- package/esm/components/Button/Button.js +36 -15
- package/esm/components/Button/Button.js.map +1 -1
- package/esm/components/ButtonIcon/ButtonIcon.js +8 -9
- package/esm/components/ButtonIcon/ButtonIcon.js.map +1 -1
- package/esm/components/Chart/Chart.js +170 -0
- package/esm/components/Chart/Chart.js.map +1 -0
- package/esm/components/Checkbox/Checkbox.js +64 -37
- package/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js.map +1 -1
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.js +45 -11
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/esm/components/Checkbox/ChoiceText.js +33 -0
- package/esm/components/Checkbox/ChoiceText.js.map +1 -0
- package/esm/components/ColorField/ColorField.js +69 -18
- package/esm/components/ColorField/ColorField.js.map +1 -1
- package/esm/components/DatePicker/DatePicker.js +86 -48
- package/esm/components/DatePicker/DatePicker.js.map +1 -1
- package/esm/components/DatePicker/components/Calendar/Calendar.js +60 -18
- package/esm/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
- package/esm/components/DatePicker/components/Day/Day.js +18 -20
- package/esm/components/DatePicker/components/Day/Day.js.map +1 -1
- package/esm/components/DatePicker/components/Month/Month.js +93 -30
- package/esm/components/DatePicker/components/Month/Month.js.map +1 -1
- package/esm/components/DatePicker/components/MonthGrid/MonthGrid.js +82 -0
- package/esm/components/DatePicker/components/MonthGrid/MonthGrid.js.map +1 -0
- package/esm/components/DatePicker/components/Weekday/Weekday.js +4 -3
- package/esm/components/DatePicker/components/Weekday/Weekday.js.map +1 -1
- package/esm/components/DatePicker/utils/index.js +37 -25
- package/esm/components/DatePicker/utils/index.js.map +1 -1
- package/esm/components/DescriptiveList/DescriptiveList.js +14 -5
- package/esm/components/DescriptiveList/DescriptiveList.js.map +1 -1
- package/esm/components/DescriptiveList/DescriptiveListItem.js +15 -3
- package/esm/components/DescriptiveList/DescriptiveListItem.js.map +1 -1
- package/esm/components/DropdownCard/DropdownCard.context.js.map +1 -1
- package/esm/components/DropdownCard/DropdownCard.js +18 -10
- package/esm/components/DropdownCard/DropdownCard.js.map +1 -1
- package/esm/components/DropdownCard/components/DropdownCardActions.js +5 -3
- package/esm/components/DropdownCard/components/DropdownCardActions.js.map +1 -1
- package/esm/components/DropdownCard/components/DropdownCardContent.js +5 -3
- package/esm/components/DropdownCard/components/DropdownCardContent.js.map +1 -1
- package/esm/components/DropdownCard/components/DropdownCardDropdown.js +19 -14
- package/esm/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -1
- package/esm/components/DropdownCard/components/DropdownCardTabs.js +118 -0
- package/esm/components/DropdownCard/components/DropdownCardTabs.js.map +1 -0
- package/esm/components/DropdownCard/components/DropdownCardTrigger.js +2 -21
- package/esm/components/DropdownCard/components/DropdownCardTrigger.js.map +1 -1
- package/esm/components/Field/Field.js +24 -0
- package/esm/components/Field/Field.js.map +1 -0
- package/esm/components/FileField/FileField.js +64 -24
- package/esm/components/FileField/FileField.js.map +1 -1
- package/esm/components/FormActions/FormActions.js +12 -0
- package/esm/components/FormActions/FormActions.js.map +1 -0
- package/esm/components/HyperlinkCard/HyperlinkCard.js +10 -7
- package/esm/components/HyperlinkCard/HyperlinkCard.js.map +1 -1
- package/esm/components/Icon/Icon.js +10 -12
- package/esm/components/Icon/Icon.js.map +1 -1
- package/esm/components/IconBadge/IconBadge.js +25 -0
- package/esm/components/IconBadge/IconBadge.js.map +1 -0
- package/esm/components/Loader/Loader.js +24 -4
- package/esm/components/Loader/Loader.js.map +1 -1
- package/esm/components/Modal/Modal.js +90 -3
- package/esm/components/Modal/Modal.js.map +1 -1
- package/esm/components/Modal/ModalProvider/ModalProviderFooter.js +7 -4
- package/esm/components/Modal/ModalProvider/ModalProviderFooter.js.map +1 -1
- package/esm/components/Modal/ModalProvider/index.js +16 -17
- package/esm/components/Modal/ModalProvider/index.js.map +1 -1
- package/esm/components/Modal/utils/reducer.js +4 -1
- package/esm/components/Modal/utils/reducer.js.map +1 -1
- package/esm/components/Modal/utils/useModal.js +1 -1
- package/esm/components/Modal/utils/useModal.js.map +1 -1
- package/esm/components/Page/Breadcrumbs.js +28 -0
- package/esm/components/Page/Breadcrumbs.js.map +1 -0
- package/esm/components/Page/Page.js +73 -9
- package/esm/components/Page/Page.js.map +1 -1
- package/esm/components/Pagination/Pagination.js +23 -12
- package/esm/components/Pagination/Pagination.js.map +1 -1
- package/esm/components/Progress/Progress.js +35 -3
- package/esm/components/Progress/Progress.js.map +1 -1
- package/esm/components/Radio/Radio.js +35 -25
- package/esm/components/Radio/Radio.js.map +1 -1
- package/esm/components/Radio/RadioGroup/RadioGroup.context.js.map +1 -1
- package/esm/components/Radio/RadioGroup/RadioGroup.js +37 -24
- package/esm/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
- package/esm/components/RangeField/RangeField.js +31 -27
- package/esm/components/RangeField/RangeField.js.map +1 -1
- package/esm/components/Select/Select.js +75 -31
- package/esm/components/Select/Select.js.map +1 -1
- package/esm/components/Sidebar/Sidebar.js +121 -109
- package/esm/components/Sidebar/Sidebar.js.map +1 -1
- package/esm/components/Sidebar/components/Back.js +23 -0
- package/esm/components/Sidebar/components/Back.js.map +1 -0
- package/esm/components/Sidebar/components/Menu.js +5 -7
- package/esm/components/Sidebar/components/Menu.js.map +1 -1
- package/esm/components/Sidebar/components/MenuItem.js +25 -7
- package/esm/components/Sidebar/components/MenuItem.js.map +1 -1
- package/esm/components/Sidebar/components/Section.js +4 -5
- package/esm/components/Sidebar/components/Section.js.map +1 -1
- package/esm/components/Sidebar/components/SubMenu.js +4 -4
- package/esm/components/Sidebar/components/SubMenu.js.map +1 -1
- package/esm/components/Spinner/Spinner.js +9 -4
- package/esm/components/Spinner/Spinner.js.map +1 -1
- package/esm/components/StatCard/StatCard.js +46 -10
- package/esm/components/StatCard/StatCard.js.map +1 -1
- package/esm/components/Switch/Switch.js +42 -20
- package/esm/components/Switch/Switch.js.map +1 -1
- package/esm/components/Table/Table.js +95 -31
- package/esm/components/Table/Table.js.map +1 -1
- package/esm/components/Table/components/Checkbox/index.js +8 -8
- package/esm/components/Table/components/Checkbox/index.js.map +1 -1
- package/esm/components/Table/components/TableBody.js +3 -3
- package/esm/components/Table/components/TableBody.js.map +1 -1
- package/esm/components/Table/components/TableCell.js +3 -4
- package/esm/components/Table/components/TableCell.js.map +1 -1
- package/esm/components/Table/components/TableGroup.js +15 -0
- package/esm/components/Table/components/TableGroup.js.map +1 -0
- package/esm/components/Table/components/TableHead.js +19 -16
- package/esm/components/Table/components/TableHead.js.map +1 -1
- package/esm/components/Table/components/TableHeadCell.js +23 -6
- package/esm/components/Table/components/TableHeadCell.js.map +1 -1
- package/esm/components/Table/components/TablePagination.js +6 -3
- package/esm/components/Table/components/TablePagination.js.map +1 -1
- package/esm/components/Table/components/TableProvider/TableProvider.js +5 -5
- package/esm/components/Table/components/TableProvider/TableProvider.js.map +1 -1
- package/esm/components/Table/components/TableRow.js +11 -8
- package/esm/components/Table/components/TableRow.js.map +1 -1
- package/esm/components/Table/labels.js +18 -0
- package/esm/components/Table/labels.js.map +1 -0
- package/esm/components/Table/utils/rows/context.js.map +1 -1
- package/esm/components/Table/utils/table/context.js.map +1 -1
- package/esm/components/Table/utils/table/hooks.js +4 -4
- package/esm/components/Table/utils/table/hooks.js.map +1 -1
- package/esm/components/Table/utils/table/types.js +1 -7
- package/esm/components/Table/utils/table/types.js.map +1 -1
- package/esm/components/Table/utils/useSelectableResourceState/index.js +4 -5
- package/esm/components/Table/utils/useSelectableResourceState/index.js.map +1 -1
- package/esm/components/Tag/Tag.js +36 -5
- package/esm/components/Tag/Tag.js.map +1 -1
- package/esm/components/Tag/TagGroup.js +3 -2
- package/esm/components/Tag/TagGroup.js.map +1 -1
- package/esm/components/TextField/TextField.js +41 -38
- package/esm/components/TextField/TextField.js.map +1 -1
- package/esm/components/Textarea/Textarea.js +10 -26
- package/esm/components/Textarea/Textarea.js.map +1 -1
- package/esm/components/Thumbnail/Thumbnail.js +22 -8
- package/esm/components/Thumbnail/Thumbnail.js.map +1 -1
- package/esm/components/Timeline/Timeline.js +25 -0
- package/esm/components/Timeline/Timeline.js.map +1 -0
- package/esm/components/Timeline/TimelineGroup.js +27 -0
- package/esm/components/Timeline/TimelineGroup.js.map +1 -0
- package/esm/components/Timeline/TimelineItem.js +23 -0
- package/esm/components/Timeline/TimelineItem.js.map +1 -0
- package/esm/components/Toast/Toast.js +18 -2
- package/esm/components/Toast/Toast.js.map +1 -1
- package/esm/components/Toast/Toasts.context.js +17 -4
- package/esm/components/Toast/Toasts.context.js.map +1 -1
- package/esm/components/Toast/ToastsContainer/index.js +44 -20
- package/esm/components/Toast/ToastsContainer/index.js.map +1 -1
- package/esm/components/Toast/ToastsProvider/index.js +10 -14
- package/esm/components/Toast/ToastsProvider/index.js.map +1 -1
- package/esm/components/Toast/store.js +47 -0
- package/esm/components/Toast/store.js.map +1 -0
- package/esm/components/Tooltip/Tooltip.js +34 -53
- package/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/esm/components/Tooltip/TooltipCallout.js +45 -0
- package/esm/components/Tooltip/TooltipCallout.js.map +1 -0
- package/esm/components/Tooltip/useTooltip.js +12 -33
- package/esm/components/Tooltip/useTooltip.js.map +1 -1
- package/esm/components/Visualizer/Visualizer.js +69 -9
- package/esm/components/Visualizer/Visualizer.js.map +1 -1
- package/esm/index.js +31 -27
- package/esm/index.js.map +1 -1
- package/esm/tokens/tokens.js +1530 -0
- package/esm/tokens/tokens.js.map +1 -0
- package/esm/utils/Slot/index.js +37 -0
- package/esm/utils/Slot/index.js.map +1 -0
- package/esm/utils/classNames/index.js +3 -3
- package/esm/utils/classNames/index.js.map +1 -1
- package/esm/utils/getElementRef/index.js +14 -0
- package/esm/utils/getElementRef/index.js.map +1 -0
- package/esm/utils/guid/index.js.map +1 -1
- package/esm/utils/toPercent/index.js +7 -0
- package/esm/utils/toPercent/index.js.map +1 -0
- package/esm/utils/useControllableState/index.js +24 -0
- package/esm/utils/useControllableState/index.js.map +1 -0
- package/esm/utils/useDropdown/DropdownTrigger.js +18 -0
- package/esm/utils/useDropdown/DropdownTrigger.js.map +1 -0
- package/esm/utils/useDropdown/index.js +55 -25
- package/esm/utils/useDropdown/index.js.map +1 -1
- package/esm/utils/useImageFallback/index.js +11 -0
- package/esm/utils/useImageFallback/index.js.map +1 -0
- package/esm/utils/useUid/index.js.map +1 -1
- package/fonts/dm-sans/LICENSE +93 -0
- package/fonts/dm-sans/dm-sans-latin-400-italic.woff2 +0 -0
- package/fonts/dm-sans/dm-sans-latin-400-normal.woff2 +0 -0
- package/fonts/dm-sans/dm-sans-latin-700-italic.woff2 +0 -0
- package/fonts/dm-sans/dm-sans-latin-700-normal.woff2 +0 -0
- package/fonts/inter/LICENSE +93 -0
- package/fonts/inter/inter-latin-opsz-italic.woff2 +0 -0
- package/fonts/inter/inter-latin-opsz-normal.woff2 +0 -0
- package/fonts/jetbrains-mono/LICENSE +93 -0
- package/fonts/jetbrains-mono/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/fonts/roboto-mono/LICENSE +93 -0
- package/fonts/roboto-mono/roboto-mono-latin-wght-normal.woff2 +0 -0
- package/lib/components/ActionCard/ActionCard.d.ts +14 -13
- package/lib/components/ActionCard/ActionCard.d.ts.map +1 -1
- package/lib/components/ActionCard/ActionCardGroup.d.ts +22 -0
- package/lib/components/ActionCard/ActionCardGroup.d.ts.map +1 -0
- package/lib/components/ActionCard/index.d.ts +1 -0
- package/lib/components/ActionCard/index.d.ts.map +1 -1
- package/lib/components/ActionList/ActionList.context.d.ts +6 -3
- package/lib/components/ActionList/ActionList.context.d.ts.map +1 -1
- package/lib/components/ActionList/ActionList.d.ts +18 -18
- package/lib/components/ActionList/ActionList.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListDivider.d.ts +4 -5
- package/lib/components/ActionList/components/ActionListDivider.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListDropdown.d.ts +4 -1
- package/lib/components/ActionList/components/ActionListDropdown.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListGroup.d.ts +7 -5
- package/lib/components/ActionList/components/ActionListGroup.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListItem.d.ts +32 -7
- package/lib/components/ActionList/components/ActionListItem.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListSearch.d.ts +21 -0
- package/lib/components/ActionList/components/ActionListSearch.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListSubmenu.d.ts +22 -0
- package/lib/components/ActionList/components/ActionListSubmenu.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListSwitchItem.d.ts +17 -0
- package/lib/components/ActionList/components/ActionListSwitchItem.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListTrigger.d.ts +4 -6
- package/lib/components/ActionList/components/ActionListTrigger.d.ts.map +1 -1
- package/lib/components/Alert/Alert.d.ts +25 -11
- package/lib/components/Alert/Alert.d.ts.map +1 -1
- package/lib/components/AppFrame/AppFrame.d.ts +48 -0
- package/lib/components/AppFrame/AppFrame.d.ts.map +1 -0
- package/lib/components/AppFrame/index.d.ts +3 -0
- package/lib/components/AppFrame/index.d.ts.map +1 -0
- package/lib/components/Avatar/Avatar.d.ts +20 -8
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/BlockCard/BlockCard.d.ts +77 -11
- package/lib/components/BlockCard/BlockCard.d.ts.map +1 -1
- package/lib/components/BlockCard/index.d.ts +1 -1
- package/lib/components/BlockCard/index.d.ts.map +1 -1
- package/lib/components/Button/Button.d.ts +45 -26
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/ButtonIcon/ButtonIcon.d.ts +18 -17
- package/lib/components/ButtonIcon/ButtonIcon.d.ts.map +1 -1
- package/lib/components/Chart/Chart.d.ts +142 -0
- package/lib/components/Chart/Chart.d.ts.map +1 -0
- package/lib/components/Chart/index.d.ts +3 -0
- package/lib/components/Chart/index.d.ts.map +1 -0
- package/lib/components/Checkbox/Checkbox.d.ts +25 -33
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.context.d.ts +2 -0
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.context.d.ts.map +1 -1
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +23 -5
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
- package/lib/components/Checkbox/ChoiceText.d.ts +17 -0
- package/lib/components/Checkbox/ChoiceText.d.ts.map +1 -0
- package/lib/components/Checkbox/index.d.ts +0 -1
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/ColorField/ColorField.d.ts +15 -13
- package/lib/components/ColorField/ColorField.d.ts.map +1 -1
- package/lib/components/ColorField/index.d.ts +1 -1
- package/lib/components/ColorField/index.d.ts.map +1 -1
- package/lib/components/DatePicker/DatePicker.d.ts +13 -5
- package/lib/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/components/DatePicker/components/Calendar/Calendar.d.ts +24 -3
- package/lib/components/DatePicker/components/Calendar/Calendar.d.ts.map +1 -1
- package/lib/components/DatePicker/components/Day/Day.d.ts +11 -10
- package/lib/components/DatePicker/components/Day/Day.d.ts.map +1 -1
- package/lib/components/DatePicker/components/Month/Month.d.ts +21 -17
- package/lib/components/DatePicker/components/Month/Month.d.ts.map +1 -1
- package/lib/components/DatePicker/components/MonthGrid/MonthGrid.d.ts +32 -0
- package/lib/components/DatePicker/components/MonthGrid/MonthGrid.d.ts.map +1 -0
- package/lib/components/DatePicker/components/MonthGrid/index.d.ts +3 -0
- package/lib/components/DatePicker/components/MonthGrid/index.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Weekday/Weekday.d.ts +4 -3
- package/lib/components/DatePicker/components/Weekday/Weekday.d.ts.map +1 -1
- package/lib/components/DatePicker/components/index.d.ts +1 -0
- package/lib/components/DatePicker/components/index.d.ts.map +1 -1
- package/lib/components/DatePicker/utils/index.d.ts +339 -17
- package/lib/components/DatePicker/utils/index.d.ts.map +1 -1
- package/lib/components/DatePicker/utils/types.d.ts +4 -2
- package/lib/components/DatePicker/utils/types.d.ts.map +1 -1
- package/lib/components/DescriptiveList/DescriptiveList.d.ts +10 -11
- package/lib/components/DescriptiveList/DescriptiveList.d.ts.map +1 -1
- package/lib/components/DescriptiveList/DescriptiveListItem.d.ts +10 -4
- package/lib/components/DescriptiveList/DescriptiveListItem.d.ts.map +1 -1
- package/lib/components/DropdownCard/DropdownCard.context.d.ts +5 -2
- package/lib/components/DropdownCard/DropdownCard.context.d.ts.map +1 -1
- package/lib/components/DropdownCard/DropdownCard.d.ts +15 -13
- package/lib/components/DropdownCard/DropdownCard.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/DropdownCardActions.d.ts +4 -3
- package/lib/components/DropdownCard/components/DropdownCardActions.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/DropdownCardContent.d.ts +4 -3
- package/lib/components/DropdownCard/components/DropdownCardContent.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/DropdownCardDropdown.d.ts +12 -3
- package/lib/components/DropdownCard/components/DropdownCardDropdown.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/DropdownCardTabs.d.ts +44 -0
- package/lib/components/DropdownCard/components/DropdownCardTabs.d.ts.map +1 -0
- package/lib/components/DropdownCard/components/DropdownCardTrigger.d.ts +4 -6
- package/lib/components/DropdownCard/components/DropdownCardTrigger.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/index.d.ts +1 -0
- package/lib/components/DropdownCard/components/index.d.ts.map +1 -1
- package/lib/components/Field/Field.d.ts +47 -0
- package/lib/components/Field/Field.d.ts.map +1 -0
- package/lib/components/Field/index.d.ts +3 -0
- package/lib/components/Field/index.d.ts.map +1 -0
- package/lib/components/FileField/FileField.d.ts +20 -11
- package/lib/components/FileField/FileField.d.ts.map +1 -1
- package/lib/components/FileField/index.d.ts +1 -1
- package/lib/components/FileField/index.d.ts.map +1 -1
- package/lib/components/FormActions/FormActions.d.ts +9 -0
- package/lib/components/FormActions/FormActions.d.ts.map +1 -0
- package/lib/components/FormActions/index.d.ts +3 -0
- package/lib/components/FormActions/index.d.ts.map +1 -0
- package/lib/components/HyperlinkCard/HyperlinkCard.d.ts +11 -8
- package/lib/components/HyperlinkCard/HyperlinkCard.d.ts.map +1 -1
- package/lib/components/Icon/Icon.d.ts +14 -13
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/IconBadge/IconBadge.d.ts +24 -0
- package/lib/components/IconBadge/IconBadge.d.ts.map +1 -0
- package/lib/components/IconBadge/index.d.ts +3 -0
- package/lib/components/IconBadge/index.d.ts.map +1 -0
- package/lib/components/Loader/Loader.d.ts +17 -6
- package/lib/components/Loader/Loader.d.ts.map +1 -1
- package/lib/components/Loader/index.d.ts +1 -1
- package/lib/components/Loader/index.d.ts.map +1 -1
- package/lib/components/Modal/Modal.d.ts +4 -6
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/ModalProvider/ModalProviderFooter.d.ts.map +1 -1
- package/lib/components/Modal/ModalProvider/index.d.ts.map +1 -1
- package/lib/components/Modal/index.d.ts +1 -1
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/types/index.d.ts +36 -15
- package/lib/components/Modal/types/index.d.ts.map +1 -1
- package/lib/components/Modal/utils/index.d.ts +0 -1
- package/lib/components/Modal/utils/index.d.ts.map +1 -1
- package/lib/components/Modal/utils/reducer.d.ts +286 -6
- package/lib/components/Modal/utils/reducer.d.ts.map +1 -1
- package/lib/components/Modal/utils/useModal.d.ts +3 -2
- package/lib/components/Modal/utils/useModal.d.ts.map +1 -1
- package/lib/components/Page/Breadcrumbs.d.ts +20 -0
- package/lib/components/Page/Breadcrumbs.d.ts.map +1 -0
- package/lib/components/Page/Page.d.ts +61 -27
- package/lib/components/Page/Page.d.ts.map +1 -1
- package/lib/components/Page/index.d.ts +3 -1
- package/lib/components/Page/index.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +22 -20
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/Pagination/index.d.ts.map +1 -1
- package/lib/components/Progress/Progress.d.ts +29 -6
- package/lib/components/Progress/Progress.d.ts.map +1 -1
- package/lib/components/Progress/index.d.ts +1 -1
- package/lib/components/Progress/index.d.ts.map +1 -1
- package/lib/components/Radio/Radio.d.ts +19 -33
- package/lib/components/Radio/Radio.d.ts.map +1 -1
- package/lib/components/Radio/RadioGroup/RadioGroup.context.d.ts +2 -0
- package/lib/components/Radio/RadioGroup/RadioGroup.context.d.ts.map +1 -1
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +22 -18
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/lib/components/RangeField/RangeField.d.ts +8 -15
- package/lib/components/RangeField/RangeField.d.ts.map +1 -1
- package/lib/components/Select/Select.d.ts +45 -43
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Sidebar/Sidebar.d.ts +48 -25
- package/lib/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/components/Sidebar/components/Back.d.ts +14 -0
- package/lib/components/Sidebar/components/Back.d.ts.map +1 -0
- package/lib/components/Sidebar/components/Menu.d.ts +9 -14
- package/lib/components/Sidebar/components/Menu.d.ts.map +1 -1
- package/lib/components/Sidebar/components/MenuItem.d.ts +18 -15
- package/lib/components/Sidebar/components/MenuItem.d.ts.map +1 -1
- package/lib/components/Sidebar/components/Section.d.ts +6 -6
- package/lib/components/Sidebar/components/Section.d.ts.map +1 -1
- package/lib/components/Sidebar/components/SubMenu.d.ts +6 -8
- package/lib/components/Sidebar/components/SubMenu.d.ts.map +1 -1
- package/lib/components/Sidebar/index.d.ts +1 -1
- package/lib/components/Sidebar/index.d.ts.map +1 -1
- package/lib/components/Spinner/Spinner.d.ts +12 -5
- package/lib/components/Spinner/Spinner.d.ts.map +1 -1
- package/lib/components/Spinner/index.d.ts +1 -1
- package/lib/components/Spinner/index.d.ts.map +1 -1
- package/lib/components/StatCard/StatCard.d.ts +31 -11
- package/lib/components/StatCard/StatCard.d.ts.map +1 -1
- package/lib/components/StatCard/index.d.ts +1 -1
- package/lib/components/StatCard/index.d.ts.map +1 -1
- package/lib/components/Switch/Switch.d.ts +14 -15
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Table/Table.d.ts +54 -25
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.types.d.ts +1 -1
- package/lib/components/Table/Table.types.d.ts.map +1 -1
- package/lib/components/Table/components/Checkbox/index.d.ts +7 -3
- package/lib/components/Table/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Table/components/TableBody.d.ts +2 -2
- package/lib/components/Table/components/TableBody.d.ts.map +1 -1
- package/lib/components/Table/components/TableCell.d.ts +7 -3
- package/lib/components/Table/components/TableCell.d.ts.map +1 -1
- package/lib/components/Table/components/TableGroup.d.ts +16 -0
- package/lib/components/Table/components/TableGroup.d.ts.map +1 -0
- package/lib/components/Table/components/TableHead.d.ts +8 -2
- package/lib/components/Table/components/TableHead.d.ts.map +1 -1
- package/lib/components/Table/components/TableHeadCell.d.ts +24 -5
- package/lib/components/Table/components/TableHeadCell.d.ts.map +1 -1
- package/lib/components/Table/components/TablePagination.d.ts +3 -1
- package/lib/components/Table/components/TablePagination.d.ts.map +1 -1
- package/lib/components/Table/components/TableProvider/TableProvider.d.ts +1 -2
- package/lib/components/Table/components/TableProvider/TableProvider.d.ts.map +1 -1
- package/lib/components/Table/components/TableRow.d.ts +8 -2
- package/lib/components/Table/components/TableRow.d.ts.map +1 -1
- package/lib/components/Table/index.d.ts +3 -3
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/labels.d.ts +23 -0
- package/lib/components/Table/labels.d.ts.map +1 -0
- package/lib/components/Table/utils/table/types.d.ts +6 -11
- package/lib/components/Table/utils/table/types.d.ts.map +1 -1
- package/lib/components/Table/utils/useSelectableResourceState/index.d.ts +1 -2
- package/lib/components/Table/utils/useSelectableResourceState/index.d.ts.map +1 -1
- package/lib/components/Tag/Tag.d.ts +42 -15
- package/lib/components/Tag/Tag.d.ts.map +1 -1
- package/lib/components/Tag/TagGroup.d.ts +3 -3
- package/lib/components/Tag/TagGroup.d.ts.map +1 -1
- package/lib/components/Tag/index.d.ts +1 -1
- package/lib/components/Tag/index.d.ts.map +1 -1
- package/lib/components/TextField/TextField.d.ts +11 -27
- package/lib/components/TextField/TextField.d.ts.map +1 -1
- package/lib/components/Textarea/Textarea.d.ts +10 -26
- package/lib/components/Textarea/Textarea.d.ts.map +1 -1
- package/lib/components/Thumbnail/Thumbnail.d.ts +11 -7
- package/lib/components/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.d.ts +26 -0
- package/lib/components/Timeline/Timeline.d.ts.map +1 -0
- package/lib/components/Timeline/TimelineGroup.d.ts +15 -0
- package/lib/components/Timeline/TimelineGroup.d.ts.map +1 -0
- package/lib/components/Timeline/TimelineItem.d.ts +19 -0
- package/lib/components/Timeline/TimelineItem.d.ts.map +1 -0
- package/lib/components/Timeline/index.d.ts +5 -0
- package/lib/components/Timeline/index.d.ts.map +1 -0
- package/lib/components/Toast/Toast.d.ts +20 -10
- package/lib/components/Toast/Toast.d.ts.map +1 -1
- package/lib/components/Toast/Toasts.context.d.ts +15 -2
- package/lib/components/Toast/Toasts.context.d.ts.map +1 -1
- package/lib/components/Toast/ToastsContainer/index.d.ts.map +1 -1
- package/lib/components/Toast/ToastsProvider/index.d.ts +1 -3
- package/lib/components/Toast/ToastsProvider/index.d.ts.map +1 -1
- package/lib/components/Toast/index.d.ts +3 -5
- package/lib/components/Toast/index.d.ts.map +1 -1
- package/lib/components/Toast/store.d.ts +30 -0
- package/lib/components/Toast/store.d.ts.map +1 -0
- package/lib/components/Toast/types.d.ts +8 -5
- package/lib/components/Toast/types.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +29 -23
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/TooltipCallout.d.ts +31 -0
- package/lib/components/Tooltip/TooltipCallout.d.ts.map +1 -0
- package/lib/components/Tooltip/useTooltip.d.ts +16 -27
- package/lib/components/Tooltip/useTooltip.d.ts.map +1 -1
- package/lib/components/Visualizer/Visualizer.d.ts +19 -8
- package/lib/components/Visualizer/Visualizer.d.ts.map +1 -1
- package/lib/components/Visualizer/index.d.ts +1 -1
- package/lib/components/Visualizer/index.d.ts.map +1 -1
- package/lib/index.d.ts +134 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/showcase/chartData.d.ts +29 -0
- package/lib/showcase/chartData.d.ts.map +1 -0
- package/lib/tokens/tokens.d.ts +1528 -0
- package/lib/tokens/tokens.d.ts.map +1 -0
- package/lib/types.d.ts +4 -29
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/Slot/index.d.ts +11 -0
- package/lib/utils/Slot/index.d.ts.map +1 -0
- package/lib/utils/classNames/index.d.ts +3 -1
- package/lib/utils/classNames/index.d.ts.map +1 -1
- package/lib/utils/getElementRef/index.d.ts +9 -0
- package/lib/utils/getElementRef/index.d.ts.map +1 -0
- package/lib/utils/index.d.ts +4 -7
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/toPercent/index.d.ts +3 -0
- package/lib/utils/toPercent/index.d.ts.map +1 -0
- package/lib/utils/useControllableState/index.d.ts +19 -0
- package/lib/utils/useControllableState/index.d.ts.map +1 -0
- package/lib/utils/useDropdown/DropdownTrigger.d.ts +12 -0
- package/lib/utils/useDropdown/DropdownTrigger.d.ts.map +1 -0
- package/lib/utils/useDropdown/index.d.ts +30 -6
- package/lib/utils/useDropdown/index.d.ts.map +1 -1
- package/lib/utils/useImageFallback/index.d.ts +15 -0
- package/lib/utils/useImageFallback/index.d.ts.map +1 -0
- package/package.json +23 -11
- package/roaster.css +1 -0
- package/roaster.css.d.ts +2 -0
- package/themes/azoth.css +1 -0
- package/themes/azoth.css.d.ts +2 -0
- package/themes/coffee.css +1 -0
- package/themes/coffee.css.d.ts +2 -0
- package/themes/scalar.css +1 -0
- package/themes/scalar.css.d.ts +2 -0
- package/cjs/components/ActionList/useDropdown.js +0 -47
- package/cjs/components/ActionList/useDropdown.js.map +0 -1
- package/cjs/components/Modal/utils/events.js +0 -19
- package/cjs/components/Modal/utils/events.js.map +0 -1
- package/cjs/components/Toast/ToastsProvider/useToastsState/useToastsState.js +0 -55
- package/cjs/components/Toast/ToastsProvider/useToastsState/useToastsState.js.map +0 -1
- package/cjs/components/Toast/events.js +0 -20
- package/cjs/components/Toast/events.js.map +0 -1
- package/cjs/components/Visualizer/Visualizer.context.js +0 -12
- package/cjs/components/Visualizer/Visualizer.context.js.map +0 -1
- package/cjs/components/Visualizer/VisualizerMobileOpener.js +0 -28
- package/cjs/components/Visualizer/VisualizerMobileOpener.js.map +0 -1
- package/cjs/utils/createUseExternalEvents/index.js +0 -32
- package/cjs/utils/createUseExternalEvents/index.js.map +0 -1
- package/cjs/utils/useIsomorphicEffect/index.js +0 -22
- package/cjs/utils/useIsomorphicEffect/index.js.map +0 -1
- package/cjs/utils/useQueue/index.js +0 -36
- package/cjs/utils/useQueue/index.js.map +0 -1
- package/cjs/utils/useUncontrolled/index.js +0 -25
- package/cjs/utils/useUncontrolled/index.js.map +0 -1
- package/esm/components/ActionList/useDropdown.js +0 -45
- package/esm/components/ActionList/useDropdown.js.map +0 -1
- package/esm/components/Modal/utils/events.js +0 -13
- package/esm/components/Modal/utils/events.js.map +0 -1
- package/esm/components/Toast/ToastsProvider/useToastsState/useToastsState.js +0 -51
- package/esm/components/Toast/ToastsProvider/useToastsState/useToastsState.js.map +0 -1
- package/esm/components/Toast/events.js +0 -12
- package/esm/components/Toast/events.js.map +0 -1
- package/esm/components/Visualizer/Visualizer.context.js +0 -9
- package/esm/components/Visualizer/Visualizer.context.js.map +0 -1
- package/esm/components/Visualizer/VisualizerMobileOpener.js +0 -13
- package/esm/components/Visualizer/VisualizerMobileOpener.js.map +0 -1
- package/esm/utils/createUseExternalEvents/index.js +0 -30
- package/esm/utils/createUseExternalEvents/index.js.map +0 -1
- package/esm/utils/useIsomorphicEffect/index.js +0 -7
- package/esm/utils/useIsomorphicEffect/index.js.map +0 -1
- package/esm/utils/useQueue/index.js +0 -34
- package/esm/utils/useQueue/index.js.map +0 -1
- package/esm/utils/useUncontrolled/index.js +0 -23
- package/esm/utils/useUncontrolled/index.js.map +0 -1
- package/lib/components/ActionList/useDropdown.d.ts +0 -57
- package/lib/components/ActionList/useDropdown.d.ts.map +0 -1
- package/lib/components/CodeBlock/CodeBlock.d.ts +0 -16
- package/lib/components/CodeBlock/CodeBlock.d.ts.map +0 -1
- package/lib/components/CodeBlock/index.d.ts +0 -2
- package/lib/components/CodeBlock/index.d.ts.map +0 -1
- package/lib/components/Modal/utils/events.d.ts +0 -9
- package/lib/components/Modal/utils/events.d.ts.map +0 -1
- package/lib/components/Toast/ToastsProvider/useToastsState/useToastsState.d.ts +0 -13
- package/lib/components/Toast/ToastsProvider/useToastsState/useToastsState.d.ts.map +0 -1
- package/lib/components/Toast/events.d.ts +0 -37
- package/lib/components/Toast/events.d.ts.map +0 -1
- package/lib/components/Visualizer/Visualizer.context.d.ts +0 -14
- package/lib/components/Visualizer/Visualizer.context.d.ts.map +0 -1
- package/lib/components/Visualizer/VisualizerMobileOpener.d.ts +0 -7
- package/lib/components/Visualizer/VisualizerMobileOpener.d.ts.map +0 -1
- package/lib/components/index.d.ts +0 -36
- package/lib/components/index.d.ts.map +0 -1
- package/lib/utils/createUseExternalEvents/index.d.ts +0 -14
- package/lib/utils/createUseExternalEvents/index.d.ts.map +0 -1
- package/lib/utils/useDidUpdate/index.d.ts +0 -30
- package/lib/utils/useDidUpdate/index.d.ts.map +0 -1
- package/lib/utils/useEventListener/index.d.ts +0 -7
- package/lib/utils/useEventListener/index.d.ts.map +0 -1
- package/lib/utils/useForceUpdate/index.d.ts +0 -28
- package/lib/utils/useForceUpdate/index.d.ts.map +0 -1
- package/lib/utils/useIsomorphicEffect/index.d.ts +0 -21
- package/lib/utils/useIsomorphicEffect/index.d.ts.map +0 -1
- package/lib/utils/useQueue/index.d.ts +0 -65
- package/lib/utils/useQueue/index.d.ts.map +0 -1
- package/lib/utils/useUncontrolled/index.d.ts +0 -38
- package/lib/utils/useUncontrolled/index.d.ts.map +0 -1
- package/theme.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/utils/useDropdown/index.ts"],"sourcesContent":["import {\n useFloating,\n shift,\n flip,\n offset,\n Placement,\n autoUpdate,\n useInteractions,\n useClick,\n useDismiss,\n useRole,\n} from '@floating-ui/react';\nimport React from 'react';\n\nexport interface UseDropdownOptions {\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/utils/useDropdown/index.ts"],"sourcesContent":["import {\n useFloating,\n shift,\n flip,\n offset,\n Placement,\n autoUpdate,\n useInteractions,\n useClick,\n useDismiss,\n useRole,\n useListNavigation,\n useTypeahead,\n} from '@floating-ui/react';\nimport React from 'react';\nimport { useControllableState } from '../useControllableState';\n\nexport interface UseDropdownOptions {\n /**\n * Where the dropdown goes relative to its trigger. It moves to the other side when there is no room.\n * @defaultValue 'bottom-end'\n */\n placement?: Placement;\n /** Whether the dropdown is open, when the parent controls it. */\n open?: boolean;\n /**\n * Whether the dropdown starts open, when it is not controlled.\n * @defaultValue false\n */\n defaultOpen?: boolean;\n /** Called when the trigger, Escape or a click outside opens or closes the dropdown, controlled or not. */\n onOpenChange?: (open: boolean) => void;\n}\n\ninterface UseDropdownSettings extends UseDropdownOptions {\n /** The ARIA role of the dropdown: a menu of items (with arrow keys and typeahead), or a dialog. */\n role?: 'menu' | 'dialog';\n /** The theme token of its distance from the trigger, such as `--roaster-action-list-offset`. */\n offsetToken?: string;\n}\n\n/** Without a theme (or outside a browser), the distance from the trigger. */\nconst DEFAULT_OFFSET = 8;\n\n/**\n * A length token of the theme, read on the element, in pixels: `px` as is, `rem` from the root's font size, `em` from\n * the element's. `fallback` when the token is missing or isn't a length.\n */\nexport function readLengthToken(element: Element, token: string, fallback: number): number {\n const value = getComputedStyle(element).getPropertyValue(token).trim();\n const match = /^(-?[\\d.]+)(px|rem|em)?$/.exec(value);\n if (!match) return fallback;\n const number = Number(match[1]);\n if (match[2] === 'rem') return number * parseFloat(getComputedStyle(document.documentElement).fontSize);\n if (match[2] === 'em') return number * parseFloat(getComputedStyle(element).fontSize);\n return number;\n}\n\n/** A dropdown that opens from a trigger, positioned with Floating UI. Shared by ActionList and DropdownCard. */\nexport function useDropdown({\n placement = 'bottom-end',\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n role = 'dialog',\n offsetToken,\n}: UseDropdownSettings = {}) {\n const [open, setOpen] = useControllableState({ value: openProp, defaultValue: defaultOpen, onChange: onOpenChange });\n const isMenu = role === 'menu';\n // The menu's items, in order, and their text for typeahead (ActionList.Dropdown fills them with FloatingList).\n const elementsRef = React.useRef<Array<HTMLElement | null>>([]);\n const labelsRef = React.useRef<Array<string | null>>([]);\n const [activeIndex, setActiveIndex] = React.useState<number | null>(null);\n\n const data = useFloating({\n placement,\n // Fixed, so a parent's overflow (a table, a card) doesn't cut the dropdown. Placed by its top and left rather than a\n // transform, which would make it the frame of a submenu's own fixed position.\n strategy: 'fixed',\n transform: false,\n open,\n onOpenChange: setOpen,\n whileElementsMounted: autoUpdate,\n middleware: [\n // The theme's distance, such as 4px in Azoth.\n offset(({ elements }) =>\n offsetToken ? readLengthToken(elements.floating, offsetToken, DEFAULT_OFFSET) : DEFAULT_OFFSET\n ),\n flip({ fallbackAxisSideDirection: 'end' }),\n shift({ padding: 8 }),\n ],\n });\n\n const { context } = data;\n const interactions = useInteractions([\n useClick(context),\n useDismiss(context),\n useRole(context, { role }),\n useListNavigation(context, {\n enabled: isMenu,\n listRef: elementsRef,\n activeIndex,\n onNavigate: setActiveIndex,\n loop: true,\n // The first item takes the focus when the menu opens, by pointer too (WAI-ARIA menu button).\n focusItemOnOpen: true,\n }),\n useTypeahead(context, {\n enabled: isMenu,\n listRef: labelsRef,\n activeIndex,\n onMatch: open ? setActiveIndex : undefined,\n }),\n ]);\n\n return React.useMemo(\n () => ({ open, setOpen, activeIndex, elementsRef, labelsRef, ...interactions, ...data }),\n [open, setOpen, activeIndex, interactions, data]\n );\n}\n"],"names":["useControllableState","useFloating","autoUpdate","offset","flip","shift","useInteractions","useClick","useDismiss","useRole","useListNavigation","useTypeahead"],"mappings":";;;;;;;AAgBA,MAAM,cAAc,GAAG,CAAC;AACjB,SAAS,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE;AAC1D,EAAE,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;AACxE,EAAE,MAAM,KAAK,GAAG,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC;AACtD,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,QAAQ;AAC7B,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACjC,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,OAAO,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC;AACzG,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;AACvF,EAAE,OAAO,MAAM;AACf;AACO,SAAS,WAAW,CAAC;AAC5B,EAAE,SAAS,GAAG,YAAY;AAC1B,EAAE,IAAI,EAAE,QAAQ;AAChB,EAAE,WAAW,GAAG,KAAK;AACrB,EAAE,YAAY;AACd,EAAE,IAAI,GAAG,QAAQ;AACjB,EAAE;AACF,CAAC,GAAG,EAAE,EAAE;AACR,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAGA,0BAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AACtH,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,MAAM;AAChC,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;AACtC,EAAE,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;AACpC,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC5D,EAAE,MAAM,IAAI,GAAGC,iBAAW,CAAC;AAC3B,IAAI,SAAS;AACb;AACA;AACA,IAAI,QAAQ,EAAE,OAAO;AACrB,IAAI,SAAS,EAAE,KAAK;AACpB,IAAI,IAAI;AACR,IAAI,YAAY,EAAE,OAAO;AACzB,IAAI,oBAAoB,EAAEC,gBAAU;AACpC,IAAI,UAAU,EAAE;AAChB;AACA,MAAMC,YAAM;AACZ,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,GAAG;AAC1G,OAAO;AACP,MAAMC,UAAI,CAAC,EAAE,yBAAyB,EAAE,KAAK,EAAE,CAAC;AAChD,MAAMC,WAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE;AAC1B;AACA,GAAG,CAAC;AACJ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI;AAC1B,EAAE,MAAM,YAAY,GAAGC,qBAAe,CAAC;AACvC,IAAIC,cAAQ,CAAC,OAAO,CAAC;AACrB,IAAIC,gBAAU,CAAC,OAAO,CAAC;AACvB,IAAIC,aAAO,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC;AAC9B,IAAIC,uBAAiB,CAAC,OAAO,EAAE;AAC/B,MAAM,OAAO,EAAE,MAAM;AACrB,MAAM,OAAO,EAAE,WAAW;AAC1B,MAAM,WAAW;AACjB,MAAM,UAAU,EAAE,cAAc;AAChC,MAAM,IAAI,EAAE,IAAI;AAChB;AACA,MAAM,eAAe,EAAE;AACvB,KAAK,CAAC;AACN,IAAIC,kBAAY,CAAC,OAAO,EAAE;AAC1B,MAAM,OAAO,EAAE,MAAM;AACrB,MAAM,OAAO,EAAE,SAAS;AACxB,MAAM,WAAW;AACjB,MAAM,OAAO,EAAE,IAAI,GAAG,cAAc,GAAG;AACvC,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,OAAO,KAAK,CAAC,OAAO;AACtB,IAAI,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC;AAC5F,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI;AACnD,GAAG;AACH;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
for (var k in e) {
|
|
10
|
+
n[k] = e[k];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
n.default = e;
|
|
14
|
+
return Object.freeze(n);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
18
|
+
|
|
19
|
+
function useImageFallback(src) {
|
|
20
|
+
const [failedSrc, setFailedSrc] = React__namespace.useState(null);
|
|
21
|
+
const onError = React__namespace.useCallback(() => setFailedSrc(src ?? null), [src]);
|
|
22
|
+
return { showFallback: !src || failedSrc === src, onError };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.useImageFallback = useImageFallback;
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/utils/useImageFallback/index.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Whether to show a fallback instead of an image: when there is no `src`, or the browser failed to load it. A new `src`\n * is tried again.\n *\n * @example\n * ```tsx\n * const { showFallback, onError } = useImageFallback(src);\n * return showFallback ? <span>A</span> : <img src={src} onError={onError} alt=\"\" />;\n * ```\n */\nexport function useImageFallback(src: string | null | undefined) {\n // The src that failed, so a new src gets its own try without an effect to reset the state.\n const [failedSrc, setFailedSrc] = React.useState<string | null>(null);\n const onError = React.useCallback(() => setFailedSrc(src ?? null), [src]);\n\n return { showFallback: !src || failedSrc === src, onError };\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;AAEO,SAAS,gBAAgB,CAAC,GAAG,EAAE;AACtC,EAAE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,gBAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AACxD,EAAE,MAAM,OAAO,GAAGA,gBAAK,CAAC,WAAW,CAAC,MAAM,YAAY,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAC3E,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,OAAO,EAAE;AAC7D;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/utils/useUid/index.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * A custom React hook that returns the given ID, or a stable generated ID prefixed with `roaster-`.\n * The generated ID comes from `React.useId`, so it is set on the first render and matches between server and client.\n *\n * @param staticId - The static ID to be used, if provided. An empty string counts as none: it is not a valid ID, and\n * a label pointing at it would label nothing.\n * @returns A unique ID string.\n */\nexport function useUid(staticId?: string) {\n // Always call the hook, so the hook order never depends on whether an ID was passed.\n const generatedId = React.useId();\n return staticId ? staticId : `roaster-${generatedId.replace(/[^a-zA-Z0-9_-]/g, '')}`;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/utils/useUid/index.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * A custom React hook that returns the given ID, or a stable generated ID prefixed with `roaster-`.\n * The generated ID comes from `React.useId`, so it is set on the first render and matches between server and client.\n *\n * @param staticId - The static ID to be used, if provided. An empty string counts as none: it is not a valid ID, and\n * a label pointing at it would label nothing.\n * @returns A unique ID string.\n */\nexport function useUid(staticId?: string) {\n // Always call the hook, so the hook order never depends on whether an ID was passed.\n const generatedId = React.useId();\n return staticId ? staticId : `roaster-${generatedId.replace(/[^a-zA-Z0-9_-]/g, '')}`;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;AAEO,SAAS,MAAM,CAAC,QAAQ,EAAE;AACjC,EAAE,MAAM,WAAW,GAAGA,gBAAK,CAAC,KAAK,EAAE;AACnC,EAAE,OAAO,QAAQ,GAAG,QAAQ,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,CAAC;AACtF;;"}
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
4
|
+
import { ActionCardGroupContext, ActionCardGroup } from './ActionCardGroup.js';
|
|
3
5
|
import { classNames } from '../../utils/classNames/index.js';
|
|
4
6
|
|
|
5
|
-
const
|
|
6
|
-
const { actions, children, icon, className,
|
|
7
|
-
|
|
7
|
+
const ActionCardBase = React.forwardRef((props, ref) => {
|
|
8
|
+
const { actions, children, icon, raised, className, ...others } = props;
|
|
9
|
+
const Element = React.useContext(ActionCardGroupContext) ? "li" : "article";
|
|
10
|
+
return /* @__PURE__ */ jsxs(
|
|
11
|
+
Element,
|
|
12
|
+
{
|
|
13
|
+
...others,
|
|
14
|
+
ref,
|
|
15
|
+
className: classNames("roaster-action-card", { "roaster-action-card--raised": raised }, className),
|
|
16
|
+
children: [
|
|
17
|
+
icon && /* @__PURE__ */ jsx("span", { className: "roaster-action-card__icon", children: icon }),
|
|
18
|
+
/* @__PURE__ */ jsx("div", { className: "roaster-action-card__content", children }),
|
|
19
|
+
actions && /* @__PURE__ */ jsx("div", { className: "roaster-action-card__actions", children: actions })
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
);
|
|
8
23
|
});
|
|
9
|
-
|
|
24
|
+
ActionCardBase.displayName = "ActionCard";
|
|
25
|
+
const ActionCard = Object.assign(ActionCardBase, { Group: ActionCardGroup });
|
|
10
26
|
|
|
11
27
|
export { ActionCard };
|
|
12
28
|
//# sourceMappingURL=ActionCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionCard.js","sources":["../../../../src/components/ActionCard/ActionCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface ActionCardProps {\n /**
|
|
1
|
+
{"version":3,"file":"ActionCard.js","sources":["../../../../src/components/ActionCard/ActionCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { ActionCardGroup, ActionCardGroupContext } from './ActionCardGroup';\n\n/** Every native `<article>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface ActionCardProps extends React.ComponentPropsWithoutRef<'article'> {\n /** The icon, at the start, such as an IconBadge. */\n icon?: React.ReactNode;\n /**\n * The content: a title (`<h2 className=\"roaster-action-card__title\">`, or any heading) and a short description. In an\n * ActionCard.Group, the row's text, and a paragraph for a quieter line under it.\n */\n children: React.ReactNode;\n /** Buttons at the end of the card. */\n actions?: React.ReactNode;\n /** The shadow of a clickable card, on a card the page sets apart (the theme may give other cards none). */\n raised?: boolean;\n}\n\n/**\n * A card with an icon, a title and a short description, used to start an action or to link to a page. Wrap it in\n * HyperlinkCard to make it a link. In an ActionCard.Group, it is a row of the list (an `<li>`).\n */\nconst ActionCardBase = React.forwardRef<HTMLElement, ActionCardProps>((props, ref) => {\n const { actions, children, icon, raised, className, ...others } = props;\n const Element = React.useContext(ActionCardGroupContext) ? 'li' : 'article';\n\n return (\n <Element\n {...others}\n ref={ref as React.Ref<HTMLLIElement>}\n className={classNames('roaster-action-card', { 'roaster-action-card--raised': raised }, className)}\n >\n {icon && <span className=\"roaster-action-card__icon\">{icon}</span>}\n <div className=\"roaster-action-card__content\">{children}</div>\n {actions && <div className=\"roaster-action-card__actions\">{actions}</div>}\n </Element>\n );\n});\n\nActionCardBase.displayName = 'ActionCard';\n\n/** An action card, and ActionCard.Group, which lays cards out as the rows of a list. */\nexport const ActionCard = Object.assign(ActionCardBase, { Group: ActionCardGroup });\n"],"names":[],"mappings":";;;;;;AAKA,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACxD,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AACzE,EAAE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,sBAAsB,CAAC,GAAG,IAAI,GAAG,SAAS;AAC7E,EAAE,uBAAuB,IAAI;AAC7B,IAAI,OAAO;AACX,IAAI;AACJ,MAAM,GAAG,MAAM;AACf,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,EAAE,6BAA6B,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC;AACxG,MAAM,QAAQ,EAAE;AAChB,QAAQ,IAAI,oBAAoB,GAAG,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACvG,wBAAwB,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,8BAA8B,EAAE,QAAQ,EAAE,CAAC;AAC3F,QAAQ,OAAO,oBAAoB,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,8BAA8B,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC9G;AACA;AACA,GAAG;AACH,CAAC,CAAC;AACF,cAAc,CAAC,WAAW,GAAG,YAAY;AAC7B,MAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
5
|
+
|
|
6
|
+
const ActionCardGroupContext = React.createContext(false);
|
|
7
|
+
const ActionCardGroup = React.forwardRef((props, ref) => {
|
|
8
|
+
const { children, framed, variant = "default", className, ...others } = props;
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
"ul",
|
|
11
|
+
{
|
|
12
|
+
...others,
|
|
13
|
+
ref,
|
|
14
|
+
className: classNames(
|
|
15
|
+
"roaster-action-card-group",
|
|
16
|
+
{ "roaster-action-card-group--framed": framed, "roaster-action-card-group--plain": variant === "plain" },
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
children: /* @__PURE__ */ jsx(ActionCardGroupContext.Provider, { value: true, children })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
ActionCardGroup.displayName = "ActionCard.Group";
|
|
24
|
+
|
|
25
|
+
export { ActionCardGroup, ActionCardGroupContext };
|
|
26
|
+
//# sourceMappingURL=ActionCardGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionCardGroup.js","sources":["../../../../src/components/ActionCard/ActionCardGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\n/** Every native `<ul>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface ActionCardGroupProps extends React.ComponentPropsWithoutRef<'ul'> {\n /** The rows: ActionCard. */\n children: React.ReactNode;\n /** Draws an edge around the list. */\n framed?: boolean;\n /**\n * `plain` makes the cards notes rather than rows, such as a report's findings: no lines between them, a small icon\n * before each title.\n * @defaultValue 'default'\n */\n variant?: 'default' | 'plain';\n}\n\n/** Whether an ActionCard is a row of a group, so that it renders as a list item. */\nexport const ActionCardGroupContext = React.createContext(false);\n\n/**\n * Action cards as the rows of one list, split by lines, such as an account's addresses with their actions. Its cards\n * render as list items; an IconBadge in a row takes the group's icon size.\n */\nexport const ActionCardGroup = React.forwardRef<HTMLUListElement, ActionCardGroupProps>((props, ref) => {\n const { children, framed, variant = 'default', className, ...others } = props;\n return (\n <ul\n {...others}\n ref={ref}\n className={classNames(\n 'roaster-action-card-group',\n { 'roaster-action-card-group--framed': framed, 'roaster-action-card-group--plain': variant === 'plain' },\n className\n )}\n >\n <ActionCardGroupContext.Provider value>{children}</ActionCardGroupContext.Provider>\n </ul>\n );\n});\n\nActionCardGroup.displayName = 'ActionCard.Group';\n"],"names":[],"mappings":";;;;;AAIY,MAAC,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK;AACnD,MAAC,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AAChE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAG,SAAS,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AAC/E,EAAE,uBAAuB,GAAG;AAC5B,IAAI,IAAI;AACR,IAAI;AACJ,MAAM,GAAG,MAAM;AACf,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU;AAC3B,QAAQ,2BAA2B;AACnC,QAAQ,EAAE,mCAAmC,EAAE,MAAM,EAAE,kCAAkC,EAAE,OAAO,KAAK,OAAO,EAAE;AAChH,QAAQ;AACR,OAAO;AACP,MAAM,QAAQ,kBAAkB,GAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC9F;AACA,GAAG;AACH,CAAC;AACD,eAAe,CAAC,WAAW,GAAG,kBAAkB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionList.context.js","sources":["../../../../src/components/ActionList/ActionList.context.ts"],"sourcesContent":["import * as React from 'react';\nimport { useDropdown } from '
|
|
1
|
+
{"version":3,"file":"ActionList.context.js","sources":["../../../../src/components/ActionList/ActionList.context.ts"],"sourcesContent":["import * as React from 'react';\nimport { useDropdown } from '@/utils';\n\ntype ActionListContextType = ReturnType<typeof useDropdown> | null;\n\nexport const ActionListContext = React.createContext<ActionListContextType>(null);\nexport const ActionListProvider = ActionListContext.Provider;\n\nexport const useActionListContext = () => {\n const context = React.useContext(ActionListContext);\n\n if (context == null) {\n throw new Error('ActionList components must be wrapped in <ActionList />');\n }\n\n return context;\n};\n"],"names":[],"mappings":";;;AAEY,MAAC,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI;AAC7C,MAAC,kBAAkB,GAAG,iBAAiB,CAAC;AACxC,MAAC,oBAAoB,GAAG,MAAM;AAC1C,EAAE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC;AACrD,EAAE,IAAI,OAAO,IAAI,IAAI,EAAE;AACvB,IAAI,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC;AAC9E,EAAE;AACF,EAAE,OAAO,OAAO;AAChB;;"}
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { ActionListProvider } from './ActionList.context.js';
|
|
4
4
|
import { ActionListDropdown } from './components/ActionListDropdown.js';
|
|
5
5
|
import { ActionListTrigger } from './components/ActionListTrigger.js';
|
|
6
|
-
import { useDropdown } from './useDropdown.js';
|
|
7
6
|
import { ActionListDivider } from './components/ActionListDivider.js';
|
|
8
7
|
import { ActionListItem } from './components/ActionListItem.js';
|
|
9
8
|
import { ActionListGroup } from './components/ActionListGroup.js';
|
|
9
|
+
import { ActionListSubmenu } from './components/ActionListSubmenu.js';
|
|
10
|
+
import { ActionListSwitchItem } from './components/ActionListSwitchItem.js';
|
|
11
|
+
import { ActionListSearch } from './components/ActionListSearch.js';
|
|
12
|
+
import { useDropdown } from '../../utils/useDropdown/index.js';
|
|
10
13
|
|
|
11
|
-
const ActionList = (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const ActionList = Object.assign(
|
|
15
|
+
function ActionList2({ children, ...options }) {
|
|
16
|
+
const dropdown = useDropdown({ ...options, role: "menu", offsetToken: "--roaster-action-list-offset" });
|
|
17
|
+
return /* @__PURE__ */ jsx(ActionListProvider, { value: dropdown, children });
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
Trigger: ActionListTrigger,
|
|
21
|
+
Dropdown: ActionListDropdown,
|
|
22
|
+
Group: ActionListGroup,
|
|
23
|
+
Divider: ActionListDivider,
|
|
24
|
+
Item: ActionListItem,
|
|
25
|
+
SwitchItem: ActionListSwitchItem,
|
|
26
|
+
Submenu: ActionListSubmenu,
|
|
27
|
+
Search: ActionListSearch
|
|
28
|
+
}
|
|
29
|
+
);
|
|
20
30
|
|
|
21
31
|
export { ActionList };
|
|
22
32
|
//# sourceMappingURL=ActionList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionList.js","sources":["../../../../src/components/ActionList/ActionList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"ActionList.js","sources":["../../../../src/components/ActionList/ActionList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ActionListProvider } from './ActionList.context';\nimport { ActionListDropdown } from './components/ActionListDropdown';\nimport { ActionListTrigger } from './components/ActionListTrigger';\nimport { useDropdown, UseDropdownOptions } from '@/utils';\nimport { ActionListDivider } from './components/ActionListDivider';\nimport { ActionListItem } from './components/ActionListItem';\nimport { ActionListGroup } from './components/ActionListGroup';\nimport { ActionListSubmenu } from './components/ActionListSubmenu';\nimport { ActionListSwitchItem } from './components/ActionListSwitchItem';\nimport { ActionListSearch } from './components/ActionListSearch';\n\nexport interface ActionListProps extends UseDropdownOptions {\n /** The trigger and the dropdown. */\n children: React.ReactNode;\n}\n\n/**\n * A menu of actions (`role=\"menu\"`) that opens under a trigger button. Arrow keys, Home and End move between items,\n * typing a letter moves to the next item starting with it, Escape and a click outside close it, and choosing an item\n * closes it. Compose it with ActionList.Trigger, ActionList.Dropdown, ActionList.Group, ActionList.Divider and\n * ActionList.Item; ActionList.SwitchItem for an on/off setting, ActionList.Submenu for an item with choices of its own,\n * ActionList.Search for a search row at the top of a long menu.\n * `placement=\"bottom-start\"` aligns its left edge with the trigger's, for a trigger at the start of a row.\n */\nexport const ActionList = Object.assign(\n function ActionList({ children, ...options }: ActionListProps) {\n const dropdown = useDropdown({ ...options, role: 'menu', offsetToken: '--roaster-action-list-offset' });\n return <ActionListProvider value={dropdown}>{children}</ActionListProvider>;\n },\n {\n Trigger: ActionListTrigger,\n Dropdown: ActionListDropdown,\n Group: ActionListGroup,\n Divider: ActionListDivider,\n Item: ActionListItem,\n SwitchItem: ActionListSwitchItem,\n Submenu: ActionListSubmenu,\n Search: ActionListSearch,\n }\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;AAYY,MAAC,UAAU,GAAG,MAAM,CAAC,MAAM;AACvC,EAAE,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,EAAE;AACjD,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;AAC3G,IAAI,uBAAuB,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACjF,EAAE,CAAC;AACH,EAAE;AACF,IAAI,OAAO,EAAE,iBAAiB;AAC9B,IAAI,QAAQ,EAAE,kBAAkB;AAChC,IAAI,KAAK,EAAE,eAAe;AAC1B,IAAI,OAAO,EAAE,iBAAiB;AAC9B,IAAI,IAAI,EAAE,cAAc;AACxB,IAAI,UAAU,EAAE,oBAAoB;AACpC,IAAI,OAAO,EAAE,iBAAiB;AAC9B,IAAI,MAAM,EAAE;AACZ;AACA;;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
4
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
const ActionListDivider = React.forwardRef(
|
|
7
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("hr", { ...props, ref, className: classNames("roaster-action-list__divider", className) })
|
|
8
|
+
);
|
|
9
|
+
ActionListDivider.displayName = "ActionListDivider";
|
|
7
10
|
|
|
8
11
|
export { ActionListDivider };
|
|
9
12
|
//# sourceMappingURL=ActionListDivider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListDivider.js","sources":["../../../../../src/components/ActionList/components/ActionListDivider.tsx"],"sourcesContent":["import * as React from 'react';\
|
|
1
|
+
{"version":3,"file":"ActionListDivider.js","sources":["../../../../../src/components/ActionList/components/ActionListDivider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\n/** Every native `<hr>` prop is accepted and forwarded to it. */\nexport type ActionListDividerProps = React.ComponentPropsWithoutRef<'hr'>;\n\n/** A line between two groups of items (a separator). */\nexport const ActionListDivider = React.forwardRef<HTMLHRElement, ActionListDividerProps>(\n ({ className, ...props }, ref) => (\n <hr {...props} ref={ref} className={classNames('roaster-action-list__divider', className)} />\n )\n);\nActionListDivider.displayName = 'ActionListDivider';\n"],"names":[],"mappings":";;;;;AAIY,MAAC,iBAAiB,GAAG,KAAK,CAAC,UAAU;AACjD,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,qBAAqB,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,8BAA8B,EAAE,SAAS,CAAC,EAAE;AACjJ;AACA,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useMergeRefs, FloatingFocusManager, FloatingList } from '@floating-ui/react';
|
|
3
4
|
import * as React from 'react';
|
|
5
|
+
import { flushSync } from 'react-dom';
|
|
4
6
|
import { useActionListContext } from '../ActionList.context.js';
|
|
5
7
|
import { classNames } from '../../../utils/classNames/index.js';
|
|
6
8
|
|
|
@@ -8,21 +10,34 @@ const ActionListDropdown = React.forwardRef(
|
|
|
8
10
|
({ className, style, children, ...props }, propRef) => {
|
|
9
11
|
const { context: floatingContext, ...context } = useActionListContext();
|
|
10
12
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
const [returnFocus, setReturnFocus] = React.useState(true);
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
if (context.open) setReturnFocus(true);
|
|
16
|
+
}, [context.open]);
|
|
17
|
+
if (!context.open) return null;
|
|
18
|
+
return (
|
|
19
|
+
// The list navigation moves the focus to the first item.
|
|
20
|
+
/* @__PURE__ */ jsx(FloatingFocusManager, { context: floatingContext, modal: false, initialFocus: -1, returnFocus, children: /* @__PURE__ */ jsx(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
...context.getFloatingProps({
|
|
25
|
+
...props,
|
|
26
|
+
onKeyDown(event) {
|
|
27
|
+
props.onKeyDown?.(event);
|
|
28
|
+
if (event.key === "Tab") {
|
|
29
|
+
flushSync(() => setReturnFocus(false));
|
|
30
|
+
context.refs.domReference.current?.focus();
|
|
31
|
+
context.setOpen(false);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
className: classNames("roaster-action-list", "roaster-action-list--floating", className),
|
|
36
|
+
style: { ...context.floatingStyles, ...style },
|
|
37
|
+
children: /* @__PURE__ */ jsx(FloatingList, { elementsRef: context.elementsRef, labelsRef: context.labelsRef, children })
|
|
38
|
+
}
|
|
39
|
+
) })
|
|
40
|
+
);
|
|
26
41
|
}
|
|
27
42
|
);
|
|
28
43
|
ActionListDropdown.displayName = "ActionListDropdown";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListDropdown.js","sources":["../../../../../src/components/ActionList/components/ActionListDropdown.tsx"],"sourcesContent":["import { FloatingFocusManager, useMergeRefs } from '@floating-ui/react';\nimport * as React from 'react';\nimport { classNames } from '@/utils';\nimport { useActionListContext } from '../ActionList.context';\n\nexport const ActionListDropdown = React.forwardRef<HTMLDivElement,
|
|
1
|
+
{"version":3,"file":"ActionListDropdown.js","sources":["../../../../../src/components/ActionList/components/ActionListDropdown.tsx"],"sourcesContent":["import { FloatingFocusManager, FloatingList, useMergeRefs } from '@floating-ui/react';\nimport * as React from 'react';\nimport { flushSync } from 'react-dom';\nimport { classNames } from '@/utils';\nimport { useActionListContext } from '../ActionList.context';\n\n/** Every native `<div>` prop (`aria-label`, `className`, `style`...) is accepted and forwarded to the menu. */\nexport type ActionListDropdownProps = React.ComponentPropsWithoutRef<'div'>;\n\n/** The menu: its groups, dividers and items. Rendered while the action list is open. */\nexport const ActionListDropdown = React.forwardRef<HTMLDivElement, ActionListDropdownProps>(\n ({ className, style, children, ...props }, propRef) => {\n const { context: floatingContext, ...context } = useActionListContext();\n const ref = useMergeRefs([context.refs.setFloating, propRef]);\n // Closing gives the focus back to the trigger, except when tabbing away: then it moves on from the trigger.\n const [returnFocus, setReturnFocus] = React.useState(true);\n React.useEffect(() => {\n if (context.open) setReturnFocus(true);\n }, [context.open]);\n if (!context.open) return null;\n\n return (\n // The list navigation moves the focus to the first item.\n <FloatingFocusManager context={floatingContext} modal={false} initialFocus={-1} returnFocus={returnFocus}>\n <div\n ref={ref}\n {...context.getFloatingProps({\n ...props,\n onKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n props.onKeyDown?.(event);\n // Tabbing away closes the menu, and Tab moves on from the trigger, as if the menu weren't there.\n if (event.key === 'Tab') {\n flushSync(() => setReturnFocus(false));\n (context.refs.domReference.current as HTMLElement | null)?.focus();\n context.setOpen(false);\n }\n },\n })}\n // After the spread, so a caller's className and style add to these instead of replacing them.\n className={classNames('roaster-action-list', 'roaster-action-list--floating', className)}\n style={{ ...context.floatingStyles, ...style }}\n >\n <FloatingList elementsRef={context.elementsRef} labelsRef={context.labelsRef}>\n {children}\n </FloatingList>\n </div>\n </FloatingFocusManager>\n );\n }\n);\n\nActionListDropdown.displayName = 'ActionListDropdown';\n"],"names":[],"mappings":";;;;;;;;AAOY,MAAC,kBAAkB,GAAG,KAAK,CAAC,UAAU;AAClD,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,OAAO,KAAK;AACzD,IAAI,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,EAAE,GAAG,oBAAoB,EAAE;AAC3E,IAAI,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACjE,IAAI,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC9D,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM;AAC1B,MAAM,IAAI,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC;AAC5C,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACtB,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,IAAI;AAClC,IAAI;AACJ;AACA,sBAAsB,GAAG,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,kBAAkB,GAAG;AACtJ,QAAQ,KAAK;AACb,QAAQ;AACR,UAAU,GAAG;AACb,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACtC,YAAY,GAAG,KAAK;AACpB,YAAY,SAAS,CAAC,KAAK,EAAE;AAC7B,cAAc,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;AACtC,cAAc,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,EAAE;AACvC,gBAAgB,SAAS,CAAC,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;AACtD,gBAAgB,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE;AAC1D,gBAAgB,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;AACtC,cAAc;AACd,YAAY;AACZ,WAAW,CAAC;AACZ,UAAU,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,+BAA+B,EAAE,SAAS,CAAC;AAClG,UAAU,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,GAAG,KAAK,EAAE;AACxD,UAAU,QAAQ,kBAAkB,GAAG,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE;AAClI;AACA,OAAO,EAAE;AACT;AACA,EAAE;AACF;AACA,kBAAkB,CAAC,WAAW,GAAG,oBAAoB;;"}
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
4
|
+
import { useUid } from '../../../utils/useUid/index.js';
|
|
3
5
|
import { classNames } from '../../../utils/classNames/index.js';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
7
|
+
const ActionListGroup = React.forwardRef(
|
|
8
|
+
({ className, children, label, id, ...rest }, ref) => {
|
|
9
|
+
const labelId = `${useUid(id)}-label`;
|
|
10
|
+
const labelled = label != null && label !== false && label !== "";
|
|
11
|
+
return /* @__PURE__ */ jsxs(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
role: "group",
|
|
15
|
+
"aria-labelledby": labelled ? labelId : void 0,
|
|
16
|
+
...rest,
|
|
17
|
+
id,
|
|
18
|
+
ref,
|
|
19
|
+
className: classNames("roaster-action-list__group", className),
|
|
20
|
+
children: [
|
|
21
|
+
labelled && /* @__PURE__ */ jsx("div", { className: "roaster-action-list__label", id: labelId, children: label }),
|
|
22
|
+
children
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
ActionListGroup.displayName = "ActionListGroup";
|
|
8
29
|
|
|
9
30
|
export { ActionListGroup };
|
|
10
31
|
//# sourceMappingURL=ActionListGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListGroup.js","sources":["../../../../../src/components/ActionList/components/ActionListGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface ActionListGroupProps extends React.
|
|
1
|
+
{"version":3,"file":"ActionListGroup.js","sources":["../../../../../src/components/ActionList/components/ActionListGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\n\n/** Every native `<div>` prop (`aria-label`, ...) is accepted and forwarded to it. */\nexport interface ActionListGroupProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The items of the group. */\n children: React.ReactNode;\n /** A label over the items, such as \"Labels\" in a list of filters; it names the group. */\n label?: React.ReactNode;\n}\n\n/** A group of items (`role=\"group\"`), padded, optionally under a label; separate groups with ActionList.Divider. */\nexport const ActionListGroup = React.forwardRef<HTMLDivElement, ActionListGroupProps>(\n ({ className, children, label, id, ...rest }, ref) => {\n const labelId = `${useUid(id)}-label`;\n const labelled = label != null && label !== false && label !== '';\n return (\n <div\n role=\"group\"\n aria-labelledby={labelled ? labelId : undefined}\n {...rest}\n id={id}\n ref={ref}\n className={classNames('roaster-action-list__group', className)}\n >\n {labelled && (\n <div className=\"roaster-action-list__label\" id={labelId}>\n {label}\n </div>\n )}\n {children}\n </div>\n );\n }\n);\nActionListGroup.displayName = 'ActionListGroup';\n"],"names":[],"mappings":";;;;;;AAIY,MAAC,eAAe,GAAG,KAAK,CAAC,UAAU;AAC/C,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAK;AACxD,IAAI,MAAM,OAAO,GAAG,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;AACzC,IAAI,MAAM,QAAQ,GAAG,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,EAAE;AACrE,IAAI,uBAAuB,IAAI;AAC/B,MAAM,KAAK;AACX,MAAM;AACN,QAAQ,IAAI,EAAE,OAAO;AACrB,QAAQ,iBAAiB,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM;AACtD,QAAQ,GAAG,IAAI;AACf,QAAQ,EAAE;AACV,QAAQ,GAAG;AACX,QAAQ,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,SAAS,CAAC;AACtE,QAAQ,QAAQ,EAAE;AAClB,UAAU,QAAQ,oBAAoB,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,4BAA4B,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC3H,UAAU;AACV;AACA;AACA,KAAK;AACL,EAAE;AACF;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;;"}
|
|
@@ -1,10 +1,60 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useListItem, useMergeRefs } from '@floating-ui/react';
|
|
2
4
|
import * as React from 'react';
|
|
5
|
+
import { Icon } from '../../Icon/Icon.js';
|
|
6
|
+
import { useActionListContext } from '../ActionList.context.js';
|
|
7
|
+
import { Slot } from '../../../utils/Slot/index.js';
|
|
3
8
|
import { classNames } from '../../../utils/classNames/index.js';
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
const ActionListItem = React.forwardRef(
|
|
11
|
+
({
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
tone,
|
|
15
|
+
detail,
|
|
16
|
+
checked,
|
|
17
|
+
multiple,
|
|
18
|
+
checkMark,
|
|
19
|
+
asChild = false,
|
|
20
|
+
onClick,
|
|
21
|
+
type = "button",
|
|
22
|
+
...rest
|
|
23
|
+
}, propRef) => {
|
|
24
|
+
const context = useActionListContext();
|
|
25
|
+
const item = useListItem();
|
|
26
|
+
const ref = useMergeRefs([item.ref, propRef]);
|
|
27
|
+
const Component = asChild ? Slot : "button";
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
Component,
|
|
30
|
+
{
|
|
31
|
+
...asChild ? {} : { type },
|
|
32
|
+
role: checked === void 0 ? "menuitem" : multiple ? "menuitemcheckbox" : "menuitemradio",
|
|
33
|
+
"aria-checked": checked,
|
|
34
|
+
...context.getItemProps({
|
|
35
|
+
...rest,
|
|
36
|
+
onClick(event) {
|
|
37
|
+
onClick?.(event);
|
|
38
|
+
if (!event.defaultPrevented) context.setOpen(false);
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
ref,
|
|
42
|
+
tabIndex: context.activeIndex === item.index ? 0 : -1,
|
|
43
|
+
className: classNames(
|
|
44
|
+
"roaster-action-list__item",
|
|
45
|
+
{ "roaster-action-list__item--danger": tone === "danger" },
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
+
children,
|
|
50
|
+
checkMark && /* @__PURE__ */ jsx(Icon, { name: "check", className: "roaster-action-list__check" }),
|
|
51
|
+
detail != null && detail !== false && /* @__PURE__ */ jsx("span", { className: "roaster-action-list__detail", children: detail })
|
|
52
|
+
] })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
ActionListItem.displayName = "ActionListItem";
|
|
8
58
|
|
|
9
59
|
export { ActionListItem };
|
|
10
60
|
//# sourceMappingURL=ActionListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListItem.js","sources":["../../../../../src/components/ActionList/components/ActionListItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface ActionListItemProps extends React.
|
|
1
|
+
{"version":3,"file":"ActionListItem.js","sources":["../../../../../src/components/ActionList/components/ActionListItem.tsx"],"sourcesContent":["import { useListItem, useMergeRefs } from '@floating-ui/react';\nimport * as React from 'react';\nimport { classNames, Slot } from '@/utils';\nimport { Icon } from '../../Icon';\nimport { useActionListContext } from '../ActionList.context';\n\n/** Every native `<button>` prop (`onClick`, `disabled`, ...) is accepted and forwarded to the item. */\nexport interface ActionListItemProps extends React.ComponentPropsWithoutRef<'button'> {\n /** The text of the item, with an optional icon. */\n children: React.ReactNode;\n /** `danger` for a destructive action, such as deleting or logging out. */\n tone?: 'danger';\n /** A short text at the item's end, such as the current choice of a setting. With `asChild`, write it in the child. */\n detail?: React.ReactNode;\n /**\n * Makes the item one of a set of choices (`role=\"menuitemradio\"`), chosen when `true`, such as a sort order. Its\n * icon takes the primary color while it is chosen.\n */\n checked?: boolean;\n /**\n * One of several choices that can be chosen together (`role=\"menuitemcheckbox\"`), such as labels, instead of one of a\n * set. With `checked`.\n */\n multiple?: boolean;\n /**\n * Shows a check at the item's end while it is chosen, such as in a picker whose items carry icons of their own (a\n * status, an avatar). With `checked`.\n */\n checkMark?: boolean;\n /**\n * Renders the child element (such as a link, or a router's Link) as the item, instead of a `<button>`.\n * @defaultValue false\n */\n asChild?: boolean;\n}\n\n/**\n * An item of the menu (`role=\"menuitem\"`, or `menuitemradio` with `checked`): a button, or with `asChild` its child,\n * such as a link. Choosing it closes the menu, after its own `onClick`, unless that calls `event.preventDefault()`.\n */\nexport const ActionListItem = React.forwardRef<HTMLButtonElement, ActionListItemProps>(\n (\n {\n className,\n children,\n tone,\n detail,\n checked,\n multiple,\n checkMark,\n asChild = false,\n onClick,\n type = 'button',\n ...rest\n },\n propRef\n ) => {\n const context = useActionListContext();\n const item = useListItem();\n const ref = useMergeRefs([item.ref, propRef]);\n const Component = asChild ? Slot : 'button';\n\n return (\n <Component\n {...(asChild ? {} : { type })}\n role={checked === undefined ? 'menuitem' : multiple ? 'menuitemcheckbox' : 'menuitemradio'}\n aria-checked={checked}\n {...context.getItemProps({\n ...rest,\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n if (!event.defaultPrevented) context.setOpen(false);\n },\n })}\n ref={ref}\n tabIndex={context.activeIndex === item.index ? 0 : -1}\n className={classNames(\n 'roaster-action-list__item',\n { 'roaster-action-list__item--danger': tone === 'danger' },\n className\n )}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n {checkMark && <Icon name=\"check\" className=\"roaster-action-list__check\" />}\n {detail != null && detail !== false && <span className=\"roaster-action-list__detail\">{detail}</span>}\n </>\n )}\n </Component>\n );\n }\n);\nActionListItem.displayName = 'ActionListItem';\n"],"names":[],"mappings":";;;;;;;;;AAOY,MAAC,cAAc,GAAG,KAAK,CAAC,UAAU;AAC9C,EAAE,CAAC;AACH,IAAI,SAAS;AACb,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,MAAM;AACV,IAAI,OAAO;AACX,IAAI,QAAQ;AACZ,IAAI,SAAS;AACb,IAAI,OAAO,GAAG,KAAK;AACnB,IAAI,OAAO;AACX,IAAI,IAAI,GAAG,QAAQ;AACnB,IAAI,GAAG;AACP,GAAG,EAAE,OAAO,KAAK;AACjB,IAAI,MAAM,OAAO,GAAG,oBAAoB,EAAE;AAC1C,IAAI,MAAM,IAAI,GAAG,WAAW,EAAE;AAC9B,IAAI,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACjD,IAAI,MAAM,SAAS,GAAG,OAAO,GAAG,IAAI,GAAG,QAAQ;AAC/C,IAAI,uBAAuB,GAAG;AAC9B,MAAM,SAAS;AACf,MAAM;AACN,QAAQ,GAAG,OAAO,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE;AAClC,QAAQ,IAAI,EAAE,OAAO,KAAK,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,kBAAkB,GAAG,eAAe;AAC/F,QAAQ,cAAc,EAAE,OAAO;AAC/B,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;AAChC,UAAU,GAAG,IAAI;AACjB,UAAU,OAAO,CAAC,KAAK,EAAE;AACzB,YAAY,OAAO,GAAG,KAAK,CAAC;AAC5B,YAAY,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;AAC/D,UAAU;AACV,SAAS,CAAC;AACV,QAAQ,GAAG;AACX,QAAQ,QAAQ,EAAE,OAAO,CAAC,WAAW,KAAK,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,EAAE;AAC7D,QAAQ,SAAS,EAAE,UAAU;AAC7B,UAAU,2BAA2B;AACrC,UAAU,EAAE,mCAAmC,EAAE,IAAI,KAAK,QAAQ,EAAE;AACpE,UAAU;AACV,SAAS;AACT,QAAQ,QAAQ,EAAE,OAAO,GAAG,QAAQ,mBAAmB,IAAI,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE;AAClF,UAAU,QAAQ;AAClB,UAAU,SAAS,oBAAoB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,CAAC;AAC5G,UAAU,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,KAAK,oBAAoB,GAAG,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,6BAA6B,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC1I,SAAS,EAAE;AACX;AACA,KAAK;AACL,EAAE;AACF;AACA,cAAc,CAAC,WAAW,GAAG,gBAAgB;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useMergeRefs } from '@floating-ui/react';
|
|
5
|
+
import { useActionListContext } from '../ActionList.context.js';
|
|
6
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
7
|
+
|
|
8
|
+
const ActionListSearch = React.forwardRef(
|
|
9
|
+
({ onValueChange, onChange, onKeyDown, shortcut, className, style, autoFocus = true, ...rest }, propRef) => {
|
|
10
|
+
const context = useActionListContext();
|
|
11
|
+
const inputRef = React.useRef(null);
|
|
12
|
+
const ref = useMergeRefs([inputRef, propRef]);
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
if (!autoFocus) return void 0;
|
|
15
|
+
let inner = 0;
|
|
16
|
+
const outer = requestAnimationFrame(() => {
|
|
17
|
+
inner = requestAnimationFrame(() => inputRef.current?.focus());
|
|
18
|
+
});
|
|
19
|
+
return () => {
|
|
20
|
+
cancelAnimationFrame(outer);
|
|
21
|
+
cancelAnimationFrame(inner);
|
|
22
|
+
};
|
|
23
|
+
}, [autoFocus]);
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames("roaster-action-list__search", className), style, children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
"input",
|
|
27
|
+
{
|
|
28
|
+
...rest,
|
|
29
|
+
ref,
|
|
30
|
+
type: "search",
|
|
31
|
+
onChange: (event) => {
|
|
32
|
+
onChange?.(event);
|
|
33
|
+
onValueChange?.(event.currentTarget.value);
|
|
34
|
+
},
|
|
35
|
+
onKeyDown: (event) => {
|
|
36
|
+
onKeyDown?.(event);
|
|
37
|
+
if (event.key === "ArrowDown" && !event.defaultPrevented) {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
context.elementsRef.current.find((element) => element && !element.hidden)?.focus();
|
|
40
|
+
}
|
|
41
|
+
event.stopPropagation();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
shortcut != null && shortcut !== false && /* @__PURE__ */ jsx("kbd", { children: shortcut })
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
ActionListSearch.displayName = "ActionListSearch";
|
|
50
|
+
|
|
51
|
+
export { ActionListSearch };
|
|
52
|
+
//# sourceMappingURL=ActionListSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionListSearch.js","sources":["../../../../../src/components/ActionList/components/ActionListSearch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMergeRefs } from '@floating-ui/react';\nimport { classNames } from '@/utils';\nimport { useActionListContext } from '../ActionList.context';\n\n/**\n * Every native `<input>` prop (`value`, `onChange`, `placeholder`, ...) is accepted and forwarded to the search field,\n * with the ref. `className` and `style` go to its row.\n */\nexport interface ActionListSearchProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'type' | 'style'> {\n /** The search field's name, read by screen readers, such as \"Find a filter\". */\n 'aria-label': string;\n /** Called with the text as the user types: hide the items that don't match it. */\n onValueChange?(value: string): void;\n /** A key hint at the row's end, such as the shortcut that opens the menu. */\n shortcut?: React.ReactNode;\n /** Styles added to the row. */\n style?: React.CSSProperties;\n}\n\n/**\n * A search row at the top of a long menu, such as a list of filters: it takes the focus when the menu opens, and the\n * down arrow goes on to the items. Filter the items from its value.\n */\nexport const ActionListSearch = React.forwardRef<HTMLInputElement, ActionListSearchProps>(\n ({ onValueChange, onChange, onKeyDown, shortcut, className, style, autoFocus = true, ...rest }, propRef) => {\n const context = useActionListContext();\n const inputRef = React.useRef<HTMLInputElement>(null);\n const ref = useMergeRefs([inputRef, propRef]);\n // The menu gives the focus to its first item a frame after it opens; the search takes it back after that.\n React.useEffect(() => {\n if (!autoFocus) return undefined;\n let inner = 0;\n const outer = requestAnimationFrame(() => {\n inner = requestAnimationFrame(() => inputRef.current?.focus());\n });\n return () => {\n cancelAnimationFrame(outer);\n cancelAnimationFrame(inner);\n };\n }, [autoFocus]);\n return (\n <div className={classNames('roaster-action-list__search', className)} style={style}>\n <input\n {...rest}\n ref={ref}\n type=\"search\"\n onChange={(event) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n // The menu's own keys move between its items; from the search field, the down arrow goes to the first.\n if (event.key === 'ArrowDown' && !event.defaultPrevented) {\n event.preventDefault();\n context.elementsRef.current.find((element) => element && !element.hidden)?.focus();\n }\n // Typing a letter moves between items elsewhere in the menu; here it is the search.\n event.stopPropagation();\n }}\n />\n {shortcut != null && shortcut !== false && <kbd>{shortcut}</kbd>}\n </div>\n );\n }\n);\nActionListSearch.displayName = 'ActionListSearch';\n"],"names":[],"mappings":";;;;;;;AAMY,MAAC,gBAAgB,GAAG,KAAK,CAAC,UAAU;AAChD,EAAE,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,OAAO,KAAK;AAC9G,IAAI,MAAM,OAAO,GAAG,oBAAoB,EAAE;AAC1C,IAAI,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AACvC,IAAI,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACjD,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM;AAC1B,MAAM,IAAI,CAAC,SAAS,EAAE,OAAO,MAAM;AACnC,MAAM,IAAI,KAAK,GAAG,CAAC;AACnB,MAAM,MAAM,KAAK,GAAG,qBAAqB,CAAC,MAAM;AAChD,QAAQ,KAAK,GAAG,qBAAqB,CAAC,MAAM,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;AACtE,MAAM,CAAC,CAAC;AACR,MAAM,OAAO,MAAM;AACnB,QAAQ,oBAAoB,CAAC,KAAK,CAAC;AACnC,QAAQ,oBAAoB,CAAC,KAAK,CAAC;AACnC,MAAM,CAAC;AACP,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;AACnB,IAAI,uBAAuB,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,6BAA6B,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;AAC3H,sBAAsB,GAAG;AACzB,QAAQ,OAAO;AACf,QAAQ;AACR,UAAU,GAAG,IAAI;AACjB,UAAU,GAAG;AACb,UAAU,IAAI,EAAE,QAAQ;AACxB,UAAU,QAAQ,EAAE,CAAC,KAAK,KAAK;AAC/B,YAAY,QAAQ,GAAG,KAAK,CAAC;AAC7B,YAAY,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;AACtD,UAAU,CAAC;AACX,UAAU,SAAS,EAAE,CAAC,KAAK,KAAK;AAChC,YAAY,SAAS,GAAG,KAAK,CAAC;AAC9B,YAAY,IAAI,KAAK,CAAC,GAAG,KAAK,WAAW,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;AACtE,cAAc,KAAK,CAAC,cAAc,EAAE;AACpC,cAAc,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE;AAChG,YAAY;AACZ,YAAY,KAAK,CAAC,eAAe,EAAE;AACnC,UAAU;AACV;AACA,OAAO;AACP,MAAM,QAAQ,IAAI,IAAI,IAAI,QAAQ,KAAK,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACjG,KAAK,EAAE,CAAC;AACR,EAAE;AACF;AACA,gBAAgB,CAAC,WAAW,GAAG,kBAAkB;;"}
|