@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":"Calendar.js","sources":["../../../../../../src/components/DatePicker/components/Calendar/Calendar.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Calendar.js","sources":["../../../../../../src/components/DatePicker/components/Calendar/Calendar.tsx"],"sourcesContent":["import { Button } from '@/components/Button';\nimport {\n getNextDisplayMonth,\n getNextDisplayYear,\n getPreviousDisplayMonth,\n getPreviousDisplayYear,\n monthTitle,\n type WeekStartsOn,\n noop,\n} from '../../utils';\n\nimport { Month } from '../Month';\nimport { Icon } from '@/components/Icon';\n\nexport interface CalendarProps {\n /**\n * The language of the month and weekday names, as a BCP 47 tag such as `fr-FR`.\n * @defaultValue 'en-US'\n */\n locale?: string;\n /**\n * The day the week starts on: 0 is Sunday, 1 Monday ... 6 Saturday.\n * @defaultValue 0\n */\n weekStartsOn?: WeekStartsOn;\n /** Mounts Calendar if true */\n isOpen?: boolean;\n /** Callback to close the calendar. */\n onClose?(): void;\n /** The selected date */\n selected?: Date;\n /** The month to show, from 0 to 11. 0 is January, 1 is February ... 11 is December */\n month: number;\n /** The year to show */\n year: number;\n /** Disable selecting dates before this. */\n minDate?: Date;\n /** Disable selecting dates after this. */\n maxDate?: Date;\n /** Disable specific dates. */\n disableSpecificDates?: Date[];\n /** Callback when date is selected. */\n handleDateSelection?(date: Date): void;\n /** Callback when month is changed. */\n onMonthChange?(month: number, year: number): void;\n}\n\n/** The text of the calendar, for other languages. */\nexport interface CalendarLabels {\n /** The name of the calendar, read by screen readers. */\n calendar: string;\n /** The name of the previous month button. */\n previousMonth: string;\n /** The name of the next month button. */\n nextMonth: string;\n}\n\nexport const defaultCalendarLabels: CalendarLabels = {\n calendar: 'Choose a date',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n};\n\nexport function Calendar({\n selected,\n month,\n year,\n minDate,\n maxDate,\n disableSpecificDates,\n onMonthChange,\n handleDateSelection = noop,\n isOpen = false,\n onClose,\n locale,\n weekStartsOn,\n labels,\n}: CalendarProps & { labels?: Partial<CalendarLabels> }) {\n const text = { ...defaultCalendarLabels, ...labels };\n const showNextYear = getNextDisplayYear(month, year);\n const showNextMonth = getNextDisplayMonth(month);\n\n const showPreviousYear = getPreviousDisplayYear(month, year);\n const showPreviousMonth = getPreviousDisplayMonth(month);\n\n if (!isOpen) return null;\n\n return (\n // A click in the calendar leaves the focus where it is: Safari doesn't focus a clicked button, so the click would\n // otherwise blur the input and close the calendar. Not an interaction of its own: the buttons inside are.\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div className=\"roaster-date-picker__popup\" onMouseDown={(event) => event.preventDefault()}>\n <div className=\"roaster-date-picker__calendar\" role=\"dialog\" aria-label={text.calendar}>\n <div className=\"roaster-date-picker__nav\">\n <Button\n variant=\"secondary\"\n iconOnly\n aria-label={text.previousMonth}\n onClick={() => onMonthChange?.(showPreviousMonth, showPreviousYear)}\n >\n <Icon name=\"arrow-left\" />\n </Button>\n <span className=\"roaster-date-picker__month\" aria-live=\"polite\">\n {monthTitle(month, year, locale)}\n </span>\n <Button\n variant=\"secondary\"\n iconOnly\n aria-label={text.nextMonth}\n onClick={() => onMonthChange?.(showNextMonth, showNextYear)}\n >\n <Icon name=\"arrow-right\" />\n </Button>\n </div>\n <Month\n month={month}\n year={year}\n selected={selected}\n onChange={handleDateSelection}\n onMonthChange={onMonthChange}\n onEscape={onClose}\n minDate={minDate}\n maxDate={maxDate}\n disableSpecificDates={disableSpecificDates}\n locale={locale}\n weekStartsOn={weekStartsOn}\n />\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;AAaY,MAAC,qBAAqB,GAAG;AACrC,EAAE,QAAQ,EAAE,eAAe;AAC3B,EAAE,aAAa,EAAE,gBAAgB;AACjC,EAAE,SAAS,EAAE;AACb;AACO,SAAS,QAAQ,CAAC;AACzB,EAAE,QAAQ;AACV,EAAE,KAAK;AACP,EAAE,IAAI;AACN,EAAE,OAAO;AACT,EAAE,OAAO;AACT,EAAE,oBAAoB;AACtB,EAAE,aAAa;AACf,EAAE,mBAAmB,GAAG,IAAI;AAC5B,EAAE,MAAM,GAAG,KAAK;AAChB,EAAE,OAAO;AACT,EAAE,MAAM;AACR,EAAE,YAAY;AACd,EAAE;AACF,CAAC,EAAE;AACH,EAAE,MAAM,IAAI,GAAG,EAAE,GAAG,qBAAqB,EAAE,GAAG,MAAM,EAAE;AACtD,EAAE,MAAM,YAAY,GAAG,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC;AACtD,EAAE,MAAM,aAAa,GAAG,mBAAmB,CAAC,KAAK,CAAC;AAClD,EAAE,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC;AAC9D,EAAE,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,KAAK,CAAC;AAC1D,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI;AAC1B,EAAE;AACF;AACA;AACA;AACA,oBAAoB,GAA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ACR,UAAU,KAAK;AACf,UAAU,IAAI;AACd,UAAU,QAAQ;AAClB,UAAU,QAAQ,EAAE,mBAAmB;AACvC,UAAU,aAAa;AACvB,UAAU,QAAQ,EAAE,OAAO;AAC3B,UAAU,OAAO;AACjB,UAAU,OAAO;AACjB,UAAU,oBAAoB;AAC9B,UAAU,MAAM;AAChB,UAAU;AACV;AACA;AACA,KAAK,EAAE,CAAC,EAAE;AACV;AACA;;"}
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { classNames } from '../../../../utils/classNames/index.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { isSameDay, dayLabel } from '../../utils/index.js';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
if (!day) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const handleClick = onClick && !disabled ? onClick.bind(null, day) : noop;
|
|
11
|
-
const isToday = isSameDay(/* @__PURE__ */ new Date(), day);
|
|
12
|
-
const date = day.getDate();
|
|
13
|
-
return /* @__PURE__ */ React.createElement(
|
|
14
|
-
"td",
|
|
5
|
+
function Day({ day, selected, disabled, focused, locale, onSelect }) {
|
|
6
|
+
if (!day) return /* @__PURE__ */ jsx("td", { className: "roaster-date-picker__cell" });
|
|
7
|
+
return /* @__PURE__ */ jsx("td", { className: "roaster-date-picker__cell", "aria-selected": selected || void 0, children: /* @__PURE__ */ jsx(
|
|
8
|
+
"button",
|
|
15
9
|
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
type: "button",
|
|
11
|
+
className: "roaster-date-picker__day",
|
|
12
|
+
"data-date": day.toDateString(),
|
|
13
|
+
tabIndex: focused ? 0 : -1,
|
|
14
|
+
disabled,
|
|
15
|
+
"aria-label": dayLabel(day, locale),
|
|
16
|
+
"aria-current": isSameDay(/* @__PURE__ */ new Date(), day) ? "date" : void 0,
|
|
17
|
+
onClick: () => onSelect?.(day),
|
|
18
|
+
children: day.getDate()
|
|
19
|
+
}
|
|
20
|
+
) });
|
|
21
|
+
}
|
|
24
22
|
|
|
25
23
|
export { Day };
|
|
26
24
|
//# sourceMappingURL=Day.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Day.js","sources":["../../../../../../src/components/DatePicker/components/Day/Day.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Day.js","sources":["../../../../../../src/components/DatePicker/components/Day/Day.tsx"],"sourcesContent":["import { dayLabel, isSameDay } from '../../utils';\n\nexport interface DayProps {\n /** The day the cell shows; an empty cell pads the first and last weeks. */\n day?: Date;\n /** Whether it is the chosen day. */\n selected?: boolean;\n /** Whether it can't be chosen, being outside the limits or disabled. */\n disabled?: boolean;\n /** Whether it is the day the keyboard is on: the one tab stop of the grid. */\n focused?: boolean;\n /** The language of the day's full name, read by screen readers. */\n locale?: string;\n /** Called with the day when it is chosen. */\n onSelect?(day: Date): void;\n}\n\n/** One day of the calendar grid: a button in a grid cell. */\nexport function Day({ day, selected, disabled, focused, locale, onSelect }: DayProps) {\n if (!day) return <td className=\"roaster-date-picker__cell\" />;\n\n return (\n <td className=\"roaster-date-picker__cell\" aria-selected={selected || undefined}>\n <button\n type=\"button\"\n className=\"roaster-date-picker__day\"\n data-date={day.toDateString()}\n tabIndex={focused ? 0 : -1}\n disabled={disabled}\n aria-label={dayLabel(day, locale)}\n aria-current={isSameDay(new Date(), day) ? 'date' : undefined}\n onClick={() => onSelect?.(day)}\n >\n {day.getDate()}\n </button>\n </td>\n );\n}\n"],"names":[],"mappings":";;;;AAGO,SAAS,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;AAC5E,EAAE,IAAI,CAAC,GAAG,EAAE,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE,CAAC;AACxF,EAAE,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE,eAAe,EAAE,QAAQ,IAAI,MAAM,EAAE,QAAQ,kBAAkB,GAAG;AAC/I,IAAI,QAAQ;AACZ,IAAI;AACJ,MAAM,IAAI,EAAE,QAAQ;AACpB,MAAM,SAAS,EAAE,0BAA0B;AAC3C,MAAM,WAAW,EAAE,GAAG,CAAC,YAAY,EAAE;AACrC,MAAM,QAAQ,EAAE,OAAO,GAAG,CAAC,GAAG,EAAE;AAChC,MAAM,QAAQ;AACd,MAAM,YAAY,EAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;AACzC,MAAM,cAAc,EAAE,SAAS,iBAAiB,IAAI,IAAI,EAAE,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,MAAM;AAClF,MAAM,OAAO,EAAE,MAAM,QAAQ,GAAG,GAAG,CAAC;AACpC,MAAM,QAAQ,EAAE,GAAG,CAAC,OAAO;AAC3B;AACA,GAAG,EAAE,CAAC;AACN;;"}
|
|
@@ -1,39 +1,102 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import { getWeeksForMonth, noop, isDateBefore, isDateAfter, isDateDisabled,
|
|
4
|
+
import { getWeeksForMonth, weekdaysFrom, weekdayName, noop, dateIsSelected, isSameDay, monthTitle, isDateBefore, isDateAfter, isDateDisabled, addMonths, endOfWeek, startOfWeek, addDays } from '../../utils/index.js';
|
|
4
5
|
import { Day } from '../Day/Day.js';
|
|
5
6
|
import { Weekday } from '../Weekday/Weekday.js';
|
|
6
7
|
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
function initialFocus(month, year, selected) {
|
|
9
|
+
const inMonth = (date) => date && date.getMonth() === month && date.getFullYear() === year;
|
|
10
|
+
if (inMonth(selected)) return selected;
|
|
11
|
+
const today = /* @__PURE__ */ new Date();
|
|
12
|
+
return inMonth(today) ? new Date(today.getFullYear(), today.getMonth(), today.getDate()) : new Date(year, month, 1);
|
|
13
|
+
}
|
|
14
|
+
function Month({
|
|
15
|
+
selected,
|
|
16
|
+
minDate,
|
|
17
|
+
maxDate,
|
|
18
|
+
disableSpecificDates,
|
|
19
|
+
onChange = noop,
|
|
20
|
+
onMonthChange,
|
|
21
|
+
onEscape,
|
|
22
|
+
month,
|
|
23
|
+
year,
|
|
24
|
+
locale,
|
|
25
|
+
weekStartsOn = 0
|
|
26
|
+
}) {
|
|
27
|
+
const weeks = React.useMemo(() => getWeeksForMonth(month, year, weekStartsOn), [month, year, weekStartsOn]);
|
|
28
|
+
const [focused, setFocused] = React.useState(() => initialFocus(month, year, selected));
|
|
29
|
+
const gridRef = React.useRef(null);
|
|
30
|
+
const moveFocus = React.useRef(false);
|
|
31
|
+
const focusInMonth = focused.getMonth() === month && focused.getFullYear() === year;
|
|
32
|
+
const tabStop = focusInMonth ? focused : initialFocus(month, year, selected);
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
if (!moveFocus.current) return;
|
|
35
|
+
moveFocus.current = false;
|
|
36
|
+
gridRef.current?.querySelector(`[data-date="${tabStop.toDateString()}"]`)?.focus();
|
|
35
37
|
});
|
|
36
|
-
|
|
38
|
+
const isDisabled = (day) => minDate && isDateBefore(day, minDate) || maxDate && isDateAfter(day, maxDate) || disableSpecificDates && isDateDisabled(day, disableSpecificDates) || false;
|
|
39
|
+
const handleKeyDown = (event) => {
|
|
40
|
+
const moves = {
|
|
41
|
+
ArrowLeft: (day) => addDays(day, -1),
|
|
42
|
+
ArrowRight: (day) => addDays(day, 1),
|
|
43
|
+
ArrowUp: (day) => addDays(day, -7),
|
|
44
|
+
ArrowDown: (day) => addDays(day, 7),
|
|
45
|
+
Home: (day) => startOfWeek(day, weekStartsOn),
|
|
46
|
+
End: (day) => endOfWeek(day, weekStartsOn),
|
|
47
|
+
PageUp: (day) => addMonths(day, event.shiftKey ? -12 : -1),
|
|
48
|
+
PageDown: (day) => addMonths(day, event.shiftKey ? 12 : 1)
|
|
49
|
+
};
|
|
50
|
+
if (event.key === "Escape") {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
onEscape?.();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const move = moves[event.key];
|
|
56
|
+
if (!move) return;
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
const next = move(tabStop);
|
|
59
|
+
moveFocus.current = true;
|
|
60
|
+
setFocused(next);
|
|
61
|
+
if (next.getMonth() !== month || next.getFullYear() !== year) onMonthChange?.(next.getMonth(), next.getFullYear());
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ jsxs(
|
|
64
|
+
"table",
|
|
65
|
+
{
|
|
66
|
+
ref: gridRef,
|
|
67
|
+
className: "roaster-date-picker__grid",
|
|
68
|
+
role: "grid",
|
|
69
|
+
"aria-label": monthTitle(month, year, locale),
|
|
70
|
+
onKeyDown: handleKeyDown,
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: weekdaysFrom(weekStartsOn).map((weekday) => /* @__PURE__ */ jsx(
|
|
73
|
+
Weekday,
|
|
74
|
+
{
|
|
75
|
+
title: weekdayName(weekday, locale),
|
|
76
|
+
fullName: weekdayName(weekday, locale, "long")
|
|
77
|
+
},
|
|
78
|
+
weekday
|
|
79
|
+
)) }) }),
|
|
80
|
+
/* @__PURE__ */ jsx("tbody", { children: weeks.map((week) => /* @__PURE__ */ jsx("tr", { children: week.map(
|
|
81
|
+
(day, index) => day == null ? /* @__PURE__ */ jsx(Day, {}, `empty-${index}`) : /* @__PURE__ */ jsx(
|
|
82
|
+
Day,
|
|
83
|
+
{
|
|
84
|
+
day,
|
|
85
|
+
locale,
|
|
86
|
+
focused: isSameDay(day, tabStop),
|
|
87
|
+
selected: selected != null && dateIsSelected(day, selected),
|
|
88
|
+
disabled: isDisabled(day),
|
|
89
|
+
onSelect: (chosen) => {
|
|
90
|
+
setFocused(chosen);
|
|
91
|
+
onChange(chosen);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
day.toDateString()
|
|
95
|
+
)
|
|
96
|
+
) }, `week-${week.find((day) => day)?.toISOString() ?? ""}`)) })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
);
|
|
37
100
|
}
|
|
38
101
|
|
|
39
102
|
export { Month };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Month.js","sources":["../../../../../../src/components/DatePicker/components/Month/Month.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n dateIsSelected,\n getWeeksForMonth,\n isDateAfter,\n isDateBefore,\n isDateDisabled,\n noop,\n weekdayName,\n
|
|
1
|
+
{"version":3,"file":"Month.js","sources":["../../../../../../src/components/DatePicker/components/Month/Month.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n addDays,\n addMonths,\n dateIsSelected,\n endOfWeek,\n getWeeksForMonth,\n isDateAfter,\n isDateBefore,\n isDateDisabled,\n isSameDay,\n monthTitle,\n noop,\n startOfWeek,\n weekdayName,\n weekdaysFrom,\n type WeekStartsOn,\n} from '../../utils';\nimport { Day } from '../Day';\nimport { Weekday } from '../Weekday';\n\nexport interface MonthProps {\n /** The chosen day, highlighted. */\n selected?: Date;\n /** The month shown, from 0 (January) to 11. */\n month: number;\n /** The year shown. */\n year: number;\n /** The days before it can't be chosen. */\n minDate?: Date;\n /** The days after it can't be chosen. */\n maxDate?: Date;\n /** Days that can't be chosen. */\n disableSpecificDates?: Date[];\n /** The language of the weekday and day names. */\n locale?: string;\n /** The day the week starts on: 0 is Sunday, 1 Monday. */\n weekStartsOn?: WeekStartsOn;\n /** Called with the day the user chooses. */\n onChange?(date: Date): void;\n /** Called when the keyboard moves to a day of another month, which the calendar then shows. */\n onMonthChange?(month: number, year: number): void;\n /** Called on Escape, to close the calendar. */\n onEscape?(): void;\n}\n\n/** The first day the grid's tab stop is on: the chosen day if shown, otherwise today if shown, otherwise the 1st. */\nfunction initialFocus(month: number, year: number, selected?: Date) {\n const inMonth = (date?: Date) => date && date.getMonth() === month && date.getFullYear() === year;\n if (inMonth(selected)) return selected as Date;\n const today = new Date();\n return inMonth(today) ? new Date(today.getFullYear(), today.getMonth(), today.getDate()) : new Date(year, month, 1);\n}\n\n/**\n * A month as a keyboard-navigable grid (WAI-ARIA date grid): one tab stop, arrow keys to move by day and week, Home\n * and End to the ends of the week, Page Up and Page Down by month, Enter or Space to choose.\n */\nexport function Month({\n selected,\n minDate,\n maxDate,\n disableSpecificDates,\n onChange = noop,\n onMonthChange,\n onEscape,\n month,\n year,\n locale,\n weekStartsOn = 0,\n}: MonthProps) {\n const weeks = React.useMemo(() => getWeeksForMonth(month, year, weekStartsOn), [month, year, weekStartsOn]);\n const [focused, setFocused] = React.useState(() => initialFocus(month, year, selected));\n const gridRef = React.useRef<HTMLTableElement>(null);\n // Set by a key press, so the new day takes the focus once rendered; a click or a month button doesn't move it.\n const moveFocus = React.useRef(false);\n\n // Another month shown (the month buttons, or the keyboard): keep the tab stop inside it.\n const focusInMonth = focused.getMonth() === month && focused.getFullYear() === year;\n const tabStop = focusInMonth ? focused : initialFocus(month, year, selected);\n\n React.useEffect(() => {\n if (!moveFocus.current) return;\n moveFocus.current = false;\n gridRef.current?.querySelector<HTMLButtonElement>(`[data-date=\"${tabStop.toDateString()}\"]`)?.focus();\n });\n\n const isDisabled = (day: Date) =>\n (minDate && isDateBefore(day, minDate)) ||\n (maxDate && isDateAfter(day, maxDate)) ||\n (disableSpecificDates && isDateDisabled(day, disableSpecificDates)) ||\n false;\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n const moves: Record<string, (day: Date) => Date> = {\n ArrowLeft: (day) => addDays(day, -1),\n ArrowRight: (day) => addDays(day, 1),\n ArrowUp: (day) => addDays(day, -7),\n ArrowDown: (day) => addDays(day, 7),\n Home: (day) => startOfWeek(day, weekStartsOn),\n End: (day) => endOfWeek(day, weekStartsOn),\n PageUp: (day) => addMonths(day, event.shiftKey ? -12 : -1),\n PageDown: (day) => addMonths(day, event.shiftKey ? 12 : 1),\n };\n if (event.key === 'Escape') {\n event.preventDefault();\n onEscape?.();\n return;\n }\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n const next = move(tabStop);\n moveFocus.current = true;\n setFocused(next);\n if (next.getMonth() !== month || next.getFullYear() !== year) onMonthChange?.(next.getMonth(), next.getFullYear());\n };\n\n return (\n <table\n ref={gridRef}\n className=\"roaster-date-picker__grid\"\n role=\"grid\"\n aria-label={monthTitle(month, year, locale)}\n onKeyDown={handleKeyDown}\n >\n <thead>\n <tr>\n {weekdaysFrom(weekStartsOn).map((weekday) => (\n <Weekday\n key={weekday}\n title={weekdayName(weekday, locale)}\n fullName={weekdayName(weekday, locale, 'long')}\n />\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week) => (\n <tr key={`week-${week.find((day) => day)?.toISOString() ?? ''}`}>\n {week.map((day, index) =>\n day == null ? (\n <Day key={`empty-${index}`} />\n ) : (\n <Day\n key={day.toDateString()}\n day={day}\n locale={locale}\n focused={isSameDay(day, tabStop)}\n selected={selected != null && dateIsSelected(day, selected)}\n disabled={isDisabled(day)}\n onSelect={(chosen) => {\n setFocused(chosen);\n onChange(chosen);\n }}\n />\n )\n )}\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n"],"names":[],"mappings":";;;;;;;AAqB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AAC,CAAC,CAAC,EAAE;AACvE;AACA;AACA,GAAG;AACH;;"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useControllableState } from '../../../../utils/useControllableState/index.js';
|
|
5
|
+
import { classNames } from '../../../../utils/classNames/index.js';
|
|
6
|
+
|
|
7
|
+
const monthIndex = (date) => date.getFullYear() * 12 + date.getMonth();
|
|
8
|
+
const rangeOf = (first, last) => ({
|
|
9
|
+
start: new Date(Math.floor(first / 12), first % 12, 1),
|
|
10
|
+
end: new Date(Math.floor(last / 12), last % 12 + 1, 0)
|
|
11
|
+
});
|
|
12
|
+
const MonthGrid = React.forwardRef(
|
|
13
|
+
({ year, value, defaultValue, onValueChange, minDate, maxDate, locale = "en-US", className, ...rest }, ref) => {
|
|
14
|
+
const [range, setRange] = useControllableState({
|
|
15
|
+
value,
|
|
16
|
+
defaultValue: defaultValue ?? null,
|
|
17
|
+
onChange: (next) => {
|
|
18
|
+
if (next) onValueChange?.(next);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const [anchor, setAnchor] = React.useState(null);
|
|
22
|
+
const short = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
23
|
+
const long = new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" });
|
|
24
|
+
const first = range ? monthIndex(range.start) : null;
|
|
25
|
+
const last = range ? monthIndex(range.end) : null;
|
|
26
|
+
const choose = (month) => {
|
|
27
|
+
if (anchor === null) {
|
|
28
|
+
setAnchor(month);
|
|
29
|
+
setRange(rangeOf(month, month));
|
|
30
|
+
} else {
|
|
31
|
+
setAnchor(null);
|
|
32
|
+
setRange(rangeOf(Math.min(anchor, month), Math.max(anchor, month)));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const rows = [0, 1, 2, 3].map((row) => /* @__PURE__ */ jsx("tr", { children: [0, 1, 2].map((column) => {
|
|
36
|
+
const date = new Date(year, row * 3 + column, 1);
|
|
37
|
+
const month = monthIndex(date);
|
|
38
|
+
const inRange = first !== null && last !== null && month >= first && month <= last;
|
|
39
|
+
const disabled = minDate !== void 0 && month < monthIndex(minDate) || maxDate !== void 0 && month > monthIndex(maxDate);
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
"td",
|
|
42
|
+
{
|
|
43
|
+
"aria-selected": month === first || month === last,
|
|
44
|
+
className: classNames("roaster-date-picker__cell", {
|
|
45
|
+
"roaster-date-picker__cell--in-range": inRange,
|
|
46
|
+
"roaster-date-picker__cell--range-start": month === first,
|
|
47
|
+
"roaster-date-picker__cell--range-end": month === last
|
|
48
|
+
}),
|
|
49
|
+
children: /* @__PURE__ */ jsx(
|
|
50
|
+
"button",
|
|
51
|
+
{
|
|
52
|
+
className: "roaster-date-picker__day",
|
|
53
|
+
type: "button",
|
|
54
|
+
"aria-label": long.format(date),
|
|
55
|
+
disabled,
|
|
56
|
+
onClick: () => choose(month),
|
|
57
|
+
children: short.format(date)
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
},
|
|
61
|
+
column
|
|
62
|
+
);
|
|
63
|
+
}) }, row));
|
|
64
|
+
return /* @__PURE__ */ jsxs(
|
|
65
|
+
"table",
|
|
66
|
+
{
|
|
67
|
+
role: "grid",
|
|
68
|
+
...rest,
|
|
69
|
+
ref,
|
|
70
|
+
className: classNames("roaster-date-picker__grid", "roaster-date-picker__grid--months", className),
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx("caption", { className: "roaster-date-picker__year", children: year }),
|
|
73
|
+
/* @__PURE__ */ jsx("tbody", { children: rows })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
MonthGrid.displayName = "MonthGrid";
|
|
80
|
+
|
|
81
|
+
export { MonthGrid };
|
|
82
|
+
//# sourceMappingURL=MonthGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonthGrid.js","sources":["../../../../../../src/components/DatePicker/components/MonthGrid/MonthGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useControllableState } from '@/utils';\n\n/** A range of whole months: from the first day of its first month to the last day of its last. */\nexport interface MonthRange {\n start: Date;\n end: Date;\n}\n\n/** Every native `<table>` prop (`aria-*`, `data-*`, ...) is accepted and forwarded to the grid. */\nexport interface MonthGridProps extends Omit<React.ComponentPropsWithoutRef<'table'>, 'defaultValue' | 'children'> {\n /** The year whose months are shown. */\n year: number;\n /** The chosen range, for a controlled grid. */\n value?: MonthRange | null;\n /** The range chosen at first, for an uncontrolled grid. */\n defaultValue?: MonthRange | null;\n /** Called with the range when the user chooses a month: one month after a first click, the range after a second. */\n onValueChange?(range: MonthRange): void;\n /** Months before this date's month can't be chosen. */\n minDate?: Date;\n /** Months after this date's month can't be chosen. */\n maxDate?: Date;\n /**\n * The language of the months' names.\n * @defaultValue 'en-US'\n */\n locale?: string;\n}\n\nconst monthIndex = (date: Date) => date.getFullYear() * 12 + date.getMonth();\nconst rangeOf = (first: number, last: number): MonthRange => ({\n start: new Date(Math.floor(first / 12), first % 12, 1),\n end: new Date(Math.floor(last / 12), (last % 12) + 1, 0),\n});\n\n/**\n * A year's months, three a row, to choose a range of them in two clicks, one for each end, such as a report's period.\n * The range's months are banded, its ends chosen.\n */\nexport const MonthGrid = React.forwardRef<HTMLTableElement, MonthGridProps>(\n ({ year, value, defaultValue, onValueChange, minDate, maxDate, locale = 'en-US', className, ...rest }, ref) => {\n const [range, setRange] = useControllableState<MonthRange | null>({\n value,\n defaultValue: defaultValue ?? null,\n onChange: (next) => {\n if (next) onValueChange?.(next);\n },\n });\n // The month of a first click, until the second chooses the other end.\n const [anchor, setAnchor] = React.useState<number | null>(null);\n const short = new Intl.DateTimeFormat(locale, { month: 'short' });\n const long = new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' });\n\n const first = range ? monthIndex(range.start) : null;\n const last = range ? monthIndex(range.end) : null;\n const choose = (month: number) => {\n if (anchor === null) {\n setAnchor(month);\n setRange(rangeOf(month, month));\n } else {\n setAnchor(null);\n setRange(rangeOf(Math.min(anchor, month), Math.max(anchor, month)));\n }\n };\n\n const rows = [0, 1, 2, 3].map((row) => (\n <tr key={row}>\n {[0, 1, 2].map((column) => {\n const date = new Date(year, row * 3 + column, 1);\n const month = monthIndex(date);\n const inRange = first !== null && last !== null && month >= first && month <= last;\n const disabled =\n (minDate !== undefined && month < monthIndex(minDate)) ||\n (maxDate !== undefined && month > monthIndex(maxDate));\n return (\n <td\n key={column}\n aria-selected={month === first || month === last}\n className={classNames('roaster-date-picker__cell', {\n 'roaster-date-picker__cell--in-range': inRange,\n 'roaster-date-picker__cell--range-start': month === first,\n 'roaster-date-picker__cell--range-end': month === last,\n })}\n >\n <button\n className=\"roaster-date-picker__day\"\n type=\"button\"\n aria-label={long.format(date)}\n disabled={disabled}\n onClick={() => choose(month)}\n >\n {short.format(date)}\n </button>\n </td>\n );\n })}\n </tr>\n ));\n\n return (\n <table\n role=\"grid\"\n {...rest}\n ref={ref}\n className={classNames('roaster-date-picker__grid', 'roaster-date-picker__grid--months', className)}\n >\n <caption className=\"roaster-date-picker__year\">{year}</caption>\n <tbody>{rows}</tbody>\n </table>\n );\n }\n);\nMonthGrid.displayName = 'MonthGrid';\n"],"names":[],"mappings":";;;;;;AAIA,MAAM,UAAU,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;AACtE,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,IAAI,MAAM;AAClC,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,CAAC,CAAC;AACxD,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,C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AY,sCAAsC,EAAE,KAAK,KAAK;AAC9D,WAAW,CAAC;AACZ,UAAU,QAAQ,kBAAkB,GAAG;AACvC,YAAY,QAAQ;AACpB,YAAY;AACZ,cAAc,SAAS,EAAE,0BAA0B;AACnD,cAAc,IAAI,EAAE,QAAQ;AAC5B,cAAc,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AAC7C,cAAc,QAAQ;AACtB,cAAc,OAAO,EAAE,MAAM,MAAM,CAAC,KAAK,CAAC;AAC1C,cAAc,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;AACzC;AACA;AACA,SAAS;AACT,QAAQ;AACR,OAAO;AACP,IAAI,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AACf,IAAI,uBAAuB,IAAI;AAC/B,MAAM,OAAO;AACb,MAAM;AACN,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,GAAG,IAAI;AACf,QAAQ,GAAG;AACX,QAAQ,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,mCAAmC,EAAE,SAAS,CAAC;AAC1G,QAAQ,QAAQ,EAAE;AAClB,0BAA0B,GAAG,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACpG,0BAA0B,GAAG,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;AACzD;AACA;AACA,KAAK;AACL,EAAE;AACF;AACA,SAAS,CAAC,WAAW,GAAG,WAAW;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
function Weekday({ title, fullName }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("th", { scope: "col", abbr: fullName, children: title });
|
|
6
|
+
}
|
|
6
7
|
|
|
7
8
|
export { Weekday };
|
|
8
9
|
//# sourceMappingURL=Weekday.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Weekday.js","sources":["../../../../../../src/components/DatePicker/components/Weekday/Weekday.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Weekday.js","sources":["../../../../../../src/components/DatePicker/components/Weekday/Weekday.tsx"],"sourcesContent":["export interface WeekdayProps {\n /** The short name shown, such as \"Mon\". */\n title: string;\n /** The full name, read by screen readers, such as \"Monday\". */\n fullName: string;\n}\n\nexport function Weekday({ title, fullName }: WeekdayProps) {\n return (\n <th scope=\"col\" abbr={fullName}>\n {title}\n </th>\n );\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;AAC7C,EAAE,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACrF;;"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
const WEEK_LENGTH = 7;
|
|
3
3
|
const WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];
|
|
4
|
-
function
|
|
4
|
+
function weekdaysFrom(weekStartsOn = 0) {
|
|
5
|
+
return WEEKDAYS.map((weekday) => (weekday + weekStartsOn) % WEEK_LENGTH);
|
|
6
|
+
}
|
|
7
|
+
function getWeeksForMonth(month, year, weekStartsOn = 0) {
|
|
5
8
|
const firstOfMonth = new Date(year, month, 1);
|
|
6
|
-
const firstDayOfWeek = firstOfMonth.getDay();
|
|
7
9
|
const weeks = [[]];
|
|
8
10
|
let currentWeek = weeks[0];
|
|
9
11
|
let currentDate = firstOfMonth;
|
|
10
|
-
|
|
12
|
+
const leadingDays = (firstOfMonth.getDay() - weekStartsOn + WEEK_LENGTH) % WEEK_LENGTH;
|
|
13
|
+
for (let i = 0; i < leadingDays; i += 1) {
|
|
11
14
|
currentWeek.push(null);
|
|
12
15
|
}
|
|
13
16
|
const fillMonth = () => {
|
|
@@ -66,24 +69,11 @@ function isDateDisabled(date, datesToCompare) {
|
|
|
66
69
|
return date.getTime() === dateToCompare.getTime();
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"April",
|
|
75
|
-
"May",
|
|
76
|
-
"June",
|
|
77
|
-
"July",
|
|
78
|
-
"August",
|
|
79
|
-
"September",
|
|
80
|
-
"October",
|
|
81
|
-
"November",
|
|
82
|
-
"December"
|
|
83
|
-
][month];
|
|
84
|
-
}
|
|
85
|
-
function weekdayName(weekday) {
|
|
86
|
-
return ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"][weekday];
|
|
72
|
+
function monthTitle(month, year, locale = "en-US") {
|
|
73
|
+
return new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }).format(new Date(year, month, 1));
|
|
74
|
+
}
|
|
75
|
+
function weekdayName(weekday, locale = "en-US", width = "short") {
|
|
76
|
+
return new Intl.DateTimeFormat(locale, { weekday: width }).format(new Date(2e3, 0, 2 + weekday));
|
|
87
77
|
}
|
|
88
78
|
const formatDate = (date, separator = "-", dateFormat = "YYYY MM DD") => {
|
|
89
79
|
const year = date.getFullYear();
|
|
@@ -139,8 +129,10 @@ function pickCalendarProps(props) {
|
|
|
139
129
|
dateFormat = "YYYY MM DD",
|
|
140
130
|
separator = "-",
|
|
141
131
|
defaultValue,
|
|
142
|
-
|
|
132
|
+
onValueChange = noop,
|
|
143
133
|
onMonthChange,
|
|
134
|
+
locale,
|
|
135
|
+
weekStartsOn,
|
|
144
136
|
...others
|
|
145
137
|
} = props;
|
|
146
138
|
return {
|
|
@@ -154,13 +146,33 @@ function pickCalendarProps(props) {
|
|
|
154
146
|
separator,
|
|
155
147
|
defaultValue,
|
|
156
148
|
disableSpecificDates,
|
|
157
|
-
|
|
149
|
+
onValueChange,
|
|
158
150
|
onInputError,
|
|
159
|
-
onMonthChange
|
|
151
|
+
onMonthChange,
|
|
152
|
+
locale,
|
|
153
|
+
weekStartsOn
|
|
160
154
|
},
|
|
161
155
|
others
|
|
162
156
|
};
|
|
163
157
|
}
|
|
158
|
+
function addDays(date, days) {
|
|
159
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);
|
|
160
|
+
}
|
|
161
|
+
function addMonths(date, months) {
|
|
162
|
+
const lastDay = new Date(date.getFullYear(), date.getMonth() + months + 1, 0).getDate();
|
|
163
|
+
return new Date(date.getFullYear(), date.getMonth() + months, Math.min(date.getDate(), lastDay));
|
|
164
|
+
}
|
|
165
|
+
function startOfWeek(date, weekStartsOn = 0) {
|
|
166
|
+
return addDays(date, -((date.getDay() - weekStartsOn + WEEK_LENGTH) % WEEK_LENGTH));
|
|
167
|
+
}
|
|
168
|
+
function endOfWeek(date, weekStartsOn = 0) {
|
|
169
|
+
return addDays(startOfWeek(date, weekStartsOn), WEEK_LENGTH - 1);
|
|
170
|
+
}
|
|
171
|
+
function dayLabel(date, locale = "en-US") {
|
|
172
|
+
return new Intl.DateTimeFormat(locale, { weekday: "long", day: "numeric", month: "long", year: "numeric" }).format(
|
|
173
|
+
date
|
|
174
|
+
);
|
|
175
|
+
}
|
|
164
176
|
|
|
165
|
-
export { WEEKDAYS, dateIsSelected, dateStringParser, formatDate, getNextDisplayMonth, getNextDisplayYear, getPreviousDisplayMonth, getPreviousDisplayYear, getSeparatorIndex, getWeeksForMonth, isDateAfter, isDateBefore, isDateDisabled, isDateValid, isSameDay,
|
|
177
|
+
export { WEEKDAYS, addDays, addMonths, dateIsSelected, dateStringParser, dayLabel, endOfWeek, formatDate, getNextDisplayMonth, getNextDisplayYear, getPreviousDisplayMonth, getPreviousDisplayYear, getSeparatorIndex, getWeeksForMonth, isDateAfter, isDateBefore, isDateDisabled, isDateValid, isSameDay, monthTitle, noop, pickCalendarProps, startOfWeek, weekdayName, weekdaysFrom };
|
|
166
178
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/DatePicker/utils/index.ts"],"sourcesContent":["import { DateFormat, DateSeparator, IsDateValid, Week } from './types';\n\nconst WEEK_LENGTH = 7;\nexport const WEEKDAYS: number[] = [0, 1, 2, 3, 4, 5, 6];\n\nexport function getWeeksForMonth(month: number, year: number): Week[] {\n const firstOfMonth = new Date(year, month, 1);\n const firstDayOfWeek = firstOfMonth.getDay();\n const weeks: Week[] = [[]];\n\n let currentWeek = weeks[0];\n let currentDate = firstOfMonth;\n\n for (let i = 0; i < WEEKDAYS.indexOf(firstDayOfWeek); i += 1) {\n currentWeek.push(null);\n }\n\n const fillMonth = () => {\n if (currentWeek.length === WEEK_LENGTH) {\n currentWeek = [];\n weeks.push(currentWeek);\n }\n\n currentWeek.push(currentDate);\n currentDate = new Date(year, month, currentDate.getDate() + 1);\n\n if (currentDate.getMonth() === month) fillMonth();\n };\n\n fillMonth();\n return weeks;\n}\n\nexport function isSameDay(day1: Date, day2: Date) {\n return (\n day1.getDate() === day2.getDate() &&\n day1.getMonth() === day2.getMonth() &&\n day1.getFullYear() === day2.getFullYear()\n );\n}\n\nexport function dateIsSelected(day: Date | null, date: Date) {\n if (day == null) {\n return false;\n }\n return isSameDay(date, day);\n}\n\nexport function getNextDisplayMonth(month: number): number {\n if (month === 11) {\n return 0;\n }\n return month + 1;\n}\n\nexport function getNextDisplayYear(month: number, year: number): number {\n if (month === 11) {\n return year + 1;\n }\n return year;\n}\n\nexport function getPreviousDisplayMonth(month: number): number {\n if (month === 0) {\n return 11;\n }\n return month - 1;\n}\n\nexport function getPreviousDisplayYear(month: number, year: number): number {\n if (month === 0) {\n return year - 1;\n }\n return year;\n}\n\nexport function isDateAfter(date: Date, dateToCompare: Date) {\n return date.getTime() > dateToCompare.getTime();\n}\n\nexport function isDateBefore(date: Date, dateToCompare: Date) {\n return date.getTime() < dateToCompare.getTime();\n}\n\nexport function isDateDisabled(date: Date, datesToCompare: Date[]) {\n return datesToCompare.some((dateToCompare) => {\n return date.getTime() === dateToCompare.getTime();\n });\n}\n\nexport function monthName(month: number) {\n return [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ][month];\n}\n\nexport function weekdayName(weekday: number) {\n return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'][weekday];\n}\n\nexport const parseDate = (date: Date) =>\n `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date\n .getDate()\n .toString()\n .padStart(2, '0')}`;\n\nexport const formatDate = (date: Date, separator: DateSeparator = '-', dateFormat: DateFormat = 'YYYY MM DD') => {\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n\n if (dateFormat === 'DD MM YYYY') {\n return `${day}${separator}${month}${separator}${year}`;\n }\n return `${year}${separator}${month}${separator}${day}`;\n};\n\nexport function isDateValid({ date, maxDate, minDate }: IsDateValid) {\n if (date == null) {\n return false;\n }\n\n if (Number.isNaN(date.getTime())) {\n return false;\n }\n\n if (maxDate && isDateAfter(date, maxDate)) {\n return false;\n }\n\n if (minDate && isDateBefore(date, minDate)) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Reads a date typed in `dateFormat`, as a local date at midnight. Returns `null` when the text is not a date that\n * exists, such as `2024-02-30`.\n *\n * `new Date(text)` is not used: it doesn't know the `DD MM YYYY` order, and it reads `YYYY-MM-DD` as UTC, which is the\n * previous day west of UTC.\n */\nexport function dateStringParser(\n dateString: string,\n dateFormat: DateFormat = 'YYYY MM DD',\n separator: DateSeparator = '-'\n) {\n const parts = dateString.split(separator);\n if (parts.length !== 3 || parts.some((part) => !/^\\d+$/.test(part))) {\n return null;\n }\n\n const [year, month, day] = (dateFormat === 'DD MM YYYY' ? [parts[2], parts[1], parts[0]] : parts).map(Number);\n const date = new Date(year, month - 1, day);\n\n // The Date constructor rolls overflowing values into the next month (Feb 30 becomes Mar 1): reject those.\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return null;\n }\n\n return date;\n}\n\nexport function getSeparatorIndex(dateFormat: DateFormat) {\n if (dateFormat === 'DD MM YYYY') return { first: 2, second: 5 };\n return { first: 4, second: 7 };\n}\n\nexport function noop() {}\n\nexport function pickCalendarProps<T extends Record<string, any>>(props: T) {\n const {\n value,\n month = new Date().getMonth(),\n year = new Date().getFullYear(),\n onInputError,\n minDate,\n maxDate,\n disableSpecificDates,\n dateFormat = 'YYYY MM DD',\n separator = '-',\n defaultValue,\n onChange = noop,\n onMonthChange,\n ...others\n } = props;\n\n return {\n calendarProps: {\n value,\n month,\n maxDate,\n minDate,\n year,\n dateFormat,\n separator,\n defaultValue,\n disableSpecificDates,\n onChange,\n onInputError,\n onMonthChange,\n },\n others,\n };\n}\n"],"names":[],"mappings":";AAAA,MAAM,WAAW,GAAG,CAAC;AACT,MAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACrC,SAAS,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE;AAC9C,EAAE,MAAM,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/C,EAAE,MAAM,cAAc,GAAG,YAAY,CAAC,MAAM,EAAE;AAC9C,EAAE,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC;AACpB,EAAE,IAAI,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC;AAC5B,EAAE,IAAI,WAAW,GAAG,YAAY;AAChC,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;AAChE,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CA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,GAAG,iBAAiB,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE;AACnD,IAAI,IAAI,GAAG,iBAAiB,IAAI,IAAI,EAAE,EAAE,WAAW,EAAE;AACrD,IAAI,YAAY;AAChB,IAAI,OAAO;AACX,IAAI,OAAO;AACX,IAAI,oBAAoB;AACxB,IAAI,UAAU,GAAG,YAAY;AAC7B,IAAI,SAAS,GAAG,GAAG;AACnB,IAAI,YAAY;AAChB,IAAI,QAAQ,GAAG,IAAI;AACnB,IAAI,aAAa;AACjB,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,OAAO;AACT,IAAI,aAAa,EAAE;AACnB,MAAM,KAAK;AACX,MAAM,KAAK;AACX,MAAM,OAAO;AACb,MAAM,OAAO;AACb,MAAM,IAAI;AACV,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAM,YAAY;AAClB,MAAM,oBAAoB;AAC1B,MAAM,QAAQ;AACd,MAAM,YAAY;AAClB,MAAM;AACN,KAAK;AACL,IAAI;AACJ,GAAG;AACH;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/DatePicker/utils/index.ts"],"sourcesContent":["import type { DatePickerProps } from '../DatePicker';\nimport { DateFormat, DateSeparator, IsDateValid, Week } from './types';\n\nconst WEEK_LENGTH = 7;\nexport const WEEKDAYS: number[] = [0, 1, 2, 3, 4, 5, 6];\n\n/** The day a week starts on: 0 is Sunday, 1 Monday, ... 6 Saturday. */\nexport type WeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\n/** The days of a week in display order, as `Date.getDay()` numbers. */\nexport function weekdaysFrom(weekStartsOn: WeekStartsOn = 0) {\n return WEEKDAYS.map((weekday) => (weekday + weekStartsOn) % WEEK_LENGTH);\n}\n\nexport function getWeeksForMonth(month: number, year: number, weekStartsOn: WeekStartsOn = 0): Week[] {\n const firstOfMonth = new Date(year, month, 1);\n const weeks: Week[] = [[]];\n\n let currentWeek = weeks[0];\n let currentDate = firstOfMonth;\n\n // Empty days before the 1st, counted from the day the week starts on.\n const leadingDays = (firstOfMonth.getDay() - weekStartsOn + WEEK_LENGTH) % WEEK_LENGTH;\n for (let i = 0; i < leadingDays; i += 1) {\n currentWeek.push(null);\n }\n\n const fillMonth = () => {\n if (currentWeek.length === WEEK_LENGTH) {\n currentWeek = [];\n weeks.push(currentWeek);\n }\n\n currentWeek.push(currentDate);\n currentDate = new Date(year, month, currentDate.getDate() + 1);\n\n if (currentDate.getMonth() === month) fillMonth();\n };\n\n fillMonth();\n return weeks;\n}\n\nexport function isSameDay(day1: Date, day2: Date) {\n return (\n day1.getDate() === day2.getDate() &&\n day1.getMonth() === day2.getMonth() &&\n day1.getFullYear() === day2.getFullYear()\n );\n}\n\nexport function dateIsSelected(day: Date | null, date: Date) {\n if (day == null) {\n return false;\n }\n return isSameDay(date, day);\n}\n\nexport function getNextDisplayMonth(month: number): number {\n if (month === 11) {\n return 0;\n }\n return month + 1;\n}\n\nexport function getNextDisplayYear(month: number, year: number): number {\n if (month === 11) {\n return year + 1;\n }\n return year;\n}\n\nexport function getPreviousDisplayMonth(month: number): number {\n if (month === 0) {\n return 11;\n }\n return month - 1;\n}\n\nexport function getPreviousDisplayYear(month: number, year: number): number {\n if (month === 0) {\n return year - 1;\n }\n return year;\n}\n\nexport function isDateAfter(date: Date, dateToCompare: Date) {\n return date.getTime() > dateToCompare.getTime();\n}\n\nexport function isDateBefore(date: Date, dateToCompare: Date) {\n return date.getTime() < dateToCompare.getTime();\n}\n\nexport function isDateDisabled(date: Date, datesToCompare: Date[]) {\n return datesToCompare.some((dateToCompare) => {\n return date.getTime() === dateToCompare.getTime();\n });\n}\n\n/** The month and year as the calendar's title, in the locale's words: \"December 2024\", \"décembre 2024\". */\nexport function monthTitle(month: number, year: number, locale = 'en-US') {\n return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' }).format(new Date(year, month, 1));\n}\n\n/** The name of a weekday (a `Date.getDay()` number) in the locale's words: \"Sun\", \"dim.\" (`long`: \"Sunday\"). */\nexport function weekdayName(weekday: number, locale = 'en-US', width: 'short' | 'long' = 'short') {\n // 2 January 2000 was a Sunday.\n return new Intl.DateTimeFormat(locale, { weekday: width }).format(new Date(2000, 0, 2 + weekday));\n}\n\nexport const parseDate = (date: Date) =>\n `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date\n .getDate()\n .toString()\n .padStart(2, '0')}`;\n\nexport const formatDate = (date: Date, separator: DateSeparator = '-', dateFormat: DateFormat = 'YYYY MM DD') => {\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n\n if (dateFormat === 'DD MM YYYY') {\n return `${day}${separator}${month}${separator}${year}`;\n }\n return `${year}${separator}${month}${separator}${day}`;\n};\n\nexport function isDateValid({ date, maxDate, minDate }: IsDateValid) {\n if (date == null) {\n return false;\n }\n\n if (Number.isNaN(date.getTime())) {\n return false;\n }\n\n if (maxDate && isDateAfter(date, maxDate)) {\n return false;\n }\n\n if (minDate && isDateBefore(date, minDate)) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Reads a date typed in `dateFormat`, as a local date at midnight. Returns `null` when the text is not a date that\n * exists, such as `2024-02-30`.\n *\n * `new Date(text)` is not used: it doesn't know the `DD MM YYYY` order, and it reads `YYYY-MM-DD` as UTC, which is the\n * previous day west of UTC.\n */\nexport function dateStringParser(\n dateString: string,\n dateFormat: DateFormat = 'YYYY MM DD',\n separator: DateSeparator = '-'\n) {\n const parts = dateString.split(separator);\n if (parts.length !== 3 || parts.some((part) => !/^\\d+$/.test(part))) {\n return null;\n }\n\n const [year, month, day] = (dateFormat === 'DD MM YYYY' ? [parts[2], parts[1], parts[0]] : parts).map(Number);\n const date = new Date(year, month - 1, day);\n\n // The Date constructor rolls overflowing values into the next month (Feb 30 becomes Mar 1): reject those.\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return null;\n }\n\n return date;\n}\n\nexport function getSeparatorIndex(dateFormat: DateFormat) {\n if (dateFormat === 'DD MM YYYY') return { first: 2, second: 5 };\n return { first: 4, second: 7 };\n}\n\nexport function noop() {}\n\n/** Splits the DatePicker's own props from the ones forwarded to its input. */\nexport function pickCalendarProps(props: DatePickerProps) {\n const {\n value,\n month = new Date().getMonth(),\n year = new Date().getFullYear(),\n onInputError,\n minDate,\n maxDate,\n disableSpecificDates,\n dateFormat = 'YYYY MM DD',\n separator = '-',\n defaultValue,\n onValueChange = noop,\n onMonthChange,\n locale,\n weekStartsOn,\n ...others\n } = props;\n\n return {\n calendarProps: {\n value,\n month,\n maxDate,\n minDate,\n year,\n dateFormat,\n separator,\n defaultValue,\n disableSpecificDates,\n onValueChange,\n onInputError,\n onMonthChange,\n locale,\n weekStartsOn,\n },\n others,\n };\n}\n\n/** The same day, `days` later (or earlier, when negative), at midnight. */\nexport function addDays(date: Date, days: number) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);\n}\n\n/** The same day of the month, `months` later or earlier, kept inside the target month (31 January + 1 = 28 February). */\nexport function addMonths(date: Date, months: number) {\n const lastDay = new Date(date.getFullYear(), date.getMonth() + months + 1, 0).getDate();\n return new Date(date.getFullYear(), date.getMonth() + months, Math.min(date.getDate(), lastDay));\n}\n\n/** The first day of the week `date` is in. */\nexport function startOfWeek(date: Date, weekStartsOn: WeekStartsOn = 0) {\n return addDays(date, -((date.getDay() - weekStartsOn + WEEK_LENGTH) % WEEK_LENGTH));\n}\n\n/** The last day of the week `date` is in. */\nexport function endOfWeek(date: Date, weekStartsOn: WeekStartsOn = 0) {\n return addDays(startOfWeek(date, weekStartsOn), WEEK_LENGTH - 1);\n}\n\n/** The full date, for screen readers: \"Sunday, 15 December 2024\". */\nexport function dayLabel(date: Date, locale = 'en-US') {\n return new Intl.DateTimeFormat(locale, { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }).format(\n date\n );\n}\n"],"names":[],"mappings":";AACA,MAAM,WAAW,GAAG,CA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AE;AAClD,EAAE,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC;AAClE;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE;AACjD,EAAE,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM;AACpH,IAAI;AACJ,GAAG;AACH;;"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { DescriptiveListItem } from './DescriptiveListItem.js';
|
|
4
5
|
import { classNames } from '../../utils/classNames/index.js';
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const DescriptiveListBase = React.forwardRef(
|
|
8
|
+
({ className, children, variant, ...others }, ref) => /* @__PURE__ */ jsx(
|
|
9
|
+
"dl",
|
|
10
|
+
{
|
|
11
|
+
...others,
|
|
12
|
+
ref,
|
|
13
|
+
className: classNames("roaster-descriptive-list", variant && `roaster-descriptive-list--${variant}`, className),
|
|
14
|
+
children
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
DescriptiveListBase.displayName = "DescriptiveList";
|
|
19
|
+
const DescriptiveList = Object.assign(DescriptiveListBase, { Item: DescriptiveListItem });
|
|
11
20
|
|
|
12
21
|
export { DescriptiveList };
|
|
13
22
|
//# sourceMappingURL=DescriptiveList.js.map
|