@trellixio/roaster-react 1.1.1 → 2.0.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 +31 -17
- 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/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 +19 -11
- package/theme.css +1 -1
- package/theme.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
|
@@ -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 WEEKDAYS,\n} from '../../utils';\nimport { Day } from '../Day';\nimport { Weekday } from '../Weekday';\n\nexport interface MonthProps {\n /** The currently selected date to be highlighted in the month view (optional). */\n selected?: Date;\n /**\n * The month to be displayed (required).\n * Note that this should be a number between 0 and 11, where 0 represents January and 11 represents December.\n */\n month: number;\n /** The year to be displayed (required). */\n year: number;\n /** The earliest selectable date for the calendar (optional). */\n minDate?: Date;\n /** The latest selectable date for the calendar (optional). */\n maxDate?: Date;\n /**\n * An array of specific dates to disable in the calendar (optional).\n * Dates should be provided in the format of an array of Date objects.\n */\n disableSpecificDates?: Date[];\n /**\n * A function to be called when the selected date in the calendar changes (optional).\n * The function receives the new selected date as a Date object.\n */\n onChange?(date: Date): void;\n}\n\nexport function Month({ selected, minDate, maxDate, disableSpecificDates, onChange = noop, month, year }: MonthProps) {\n const weeks = React.useMemo(() => getWeeksForMonth(month, year), [month, year]);\n const weekdays = WEEKDAYS.map((weekday) => <Weekday key={weekday} title={weekdayName(weekday)} />);\n\n const handleDateClick = React.useCallback(\n (selectedDate: Date) => {\n onChange(selectedDate);\n },\n [onChange, selected]\n );\n\n function renderWeek(day: Date | null, dayIndex: number) {\n if (day == null) {\n return <Day key={dayIndex} />;\n }\n const disabled =\n (minDate && isDateBefore(day, minDate)) ||\n (maxDate && isDateAfter(day, maxDate)) ||\n (disableSpecificDates && isDateDisabled(day, disableSpecificDates));\n\n return (\n <Day\n day={day}\n key={dayIndex}\n onClick={handleDateClick}\n selected={selected != null && dateIsSelected(day, selected)}\n disabled={disabled}\n />\n );\n }\n\n const weeksMarkup = weeks.map((week) => {\n const anchor = week.find((d) => d)?.toISOString() ?? '';\n return <tr key={`week-${anchor}`}>{week.map(renderWeek)}</tr>;\n });\n\n return (\n <table className=\"date\">\n <thead>\n <tr>{weekdays}</tr>\n </thead>\n <tbody>{weeksMarkup}</tbody>\n </table>\n );\n}\n"],"names":["noop","React","getWeeksForMonth","WEEKDAYS","Weekday","weekdayName","Day","isDateBefore","isDateAfter","isDateDisabled","dateIsSelected"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaO,SAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,GAAGA,UAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;AAC1G,EAAE,MAAM,KAAK,GAAGC,gBAAK,CAAC,OAAO,CAAC,MAAMC,sBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACjF,EAAE,MAAM,QAAQ,GAAGC,cAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,qBAAqBF,gBAAK,CAAC,aAAa,CAACG,eAAO,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAEC,iBAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACzI,EAAE,MAAM,eAAe,GAAGJ,gBAAK,CAAC,WAAW;AAC3C,IAAI,CAAC,YAAY,KAAK;AACtB,MAAM,QA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E,MAAM,EAAE,kBAAkBA,gBAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,kBAAkBA,gBAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,kBAAkBA,gBAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AAC5P;;"}
|
|
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":["noop","React","getWeeksForMonth","isDateBefore","isDateAfter","isDateDisabled","addDays","startOfWeek","endOfWeek","addMonths","jsxs","monthTitle","jsx","weekdaysFrom","Weekday","weekdayName","index","Day","isSameDay","dateIsSelected"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC7C,EAAE,MAAM,OAAO,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI;AAC5F,EAAE,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,QAAQ;AACxC,EAAE,MAAM,KAAK,mBAAmB,IAAI,IAAI,EAAE;AAC1C,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,QAA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AQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,qBAAqBA,cAAG,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG;AACnH,UAAU,CAAC,GAAG,EAAEI,OAAK,KAAK,GAAG,IAAI,IAAI,mBAAmBJ,cAAG,CAACK,OAAG,EAAE,EAAE,EAAE,CAAC,MAAM,EAAED,OAAK,CAAC,CAAC,CAAC,mBAAmBJ,cAAG;AAC5G,YAAYK,OAAG;AACf,YAAY;AACZ,cAAc,GAAG;AACjB,cAAc,MAAM;AACpB,cAAc,OAAO,EAAEC,eAAS,CAAC,GAAG,EAAE,OAAO,CAAC;AAC9C,cAAc,QAAQ,EAAE,QAAQ,IAAI,IAAI,IAAIC,oBAAc,CAAC,GAAG,EAAE,QAAQ,CAAC;AACzE,cAAc,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC;AACvC,cAAc,QAAQ,EAAE,CAAC,MAAM,KAAK;AACpC,gBAAgB,UAAU,CAAC,MAAM,CAAC;AAClC,gBAAgB,QAAQ,CAAC,MAAM,CAAC;AAChC,cAAc;AACd,aAAa;AACb,YAAY,GAAG,CAAC,YAAY;AAC5B;AACA,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;AACvE;AACA;AACA,GAAG;AACH;;"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var index = require('../../../../utils/useControllableState/index.js');
|
|
7
|
+
var index$1 = require('../../../../utils/classNames/index.js');
|
|
8
|
+
|
|
9
|
+
function _interopNamespaceDefault(e) {
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
for (var k in e) {
|
|
13
|
+
n[k] = e[k];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
n.default = e;
|
|
17
|
+
return Object.freeze(n);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
21
|
+
|
|
22
|
+
const monthIndex = (date) => date.getFullYear() * 12 + date.getMonth();
|
|
23
|
+
const rangeOf = (first, last) => ({
|
|
24
|
+
start: new Date(Math.floor(first / 12), first % 12, 1),
|
|
25
|
+
end: new Date(Math.floor(last / 12), last % 12 + 1, 0)
|
|
26
|
+
});
|
|
27
|
+
const MonthGrid = React__namespace.forwardRef(
|
|
28
|
+
({ year, value, defaultValue, onValueChange, minDate, maxDate, locale = "en-US", className, ...rest }, ref) => {
|
|
29
|
+
const [range, setRange] = index.useControllableState({
|
|
30
|
+
value,
|
|
31
|
+
defaultValue: defaultValue ?? null,
|
|
32
|
+
onChange: (next) => {
|
|
33
|
+
if (next) onValueChange?.(next);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const [anchor, setAnchor] = React__namespace.useState(null);
|
|
37
|
+
const short = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
38
|
+
const long = new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" });
|
|
39
|
+
const first = range ? monthIndex(range.start) : null;
|
|
40
|
+
const last = range ? monthIndex(range.end) : null;
|
|
41
|
+
const choose = (month) => {
|
|
42
|
+
if (anchor === null) {
|
|
43
|
+
setAnchor(month);
|
|
44
|
+
setRange(rangeOf(month, month));
|
|
45
|
+
} else {
|
|
46
|
+
setAnchor(null);
|
|
47
|
+
setRange(rangeOf(Math.min(anchor, month), Math.max(anchor, month)));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const rows = [0, 1, 2, 3].map((row) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: [0, 1, 2].map((column) => {
|
|
51
|
+
const date = new Date(year, row * 3 + column, 1);
|
|
52
|
+
const month = monthIndex(date);
|
|
53
|
+
const inRange = first !== null && last !== null && month >= first && month <= last;
|
|
54
|
+
const disabled = minDate !== void 0 && month < monthIndex(minDate) || maxDate !== void 0 && month > monthIndex(maxDate);
|
|
55
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
+
"td",
|
|
57
|
+
{
|
|
58
|
+
"aria-selected": month === first || month === last,
|
|
59
|
+
className: index$1.classNames("roaster-date-picker__cell", {
|
|
60
|
+
"roaster-date-picker__cell--in-range": inRange,
|
|
61
|
+
"roaster-date-picker__cell--range-start": month === first,
|
|
62
|
+
"roaster-date-picker__cell--range-end": month === last
|
|
63
|
+
}),
|
|
64
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
"button",
|
|
66
|
+
{
|
|
67
|
+
className: "roaster-date-picker__day",
|
|
68
|
+
type: "button",
|
|
69
|
+
"aria-label": long.format(date),
|
|
70
|
+
disabled,
|
|
71
|
+
onClick: () => choose(month),
|
|
72
|
+
children: short.format(date)
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
},
|
|
76
|
+
column
|
|
77
|
+
);
|
|
78
|
+
}) }, row));
|
|
79
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
80
|
+
"table",
|
|
81
|
+
{
|
|
82
|
+
role: "grid",
|
|
83
|
+
...rest,
|
|
84
|
+
ref,
|
|
85
|
+
className: index$1.classNames("roaster-date-picker__grid", "roaster-date-picker__grid--months", className),
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsx("caption", { className: "roaster-date-picker__year", children: year }),
|
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: rows })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
MonthGrid.displayName = "MonthGrid";
|
|
95
|
+
|
|
96
|
+
exports.MonthGrid = MonthGrid;
|
|
97
|
+
//# 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":["React","useControllableState","jsx","classNames","jsxs"],"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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
9
|
-
for (var k in e) {
|
|
10
|
-
n[k] = e[k];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
n.default = e;
|
|
14
|
-
return Object.freeze(n);
|
|
6
|
+
function Weekday({ title, fullName }) {
|
|
7
|
+
return /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", abbr: fullName, children: title });
|
|
15
8
|
}
|
|
16
9
|
|
|
17
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
18
|
-
|
|
19
|
-
const Weekday = React__namespace.memo(({ title }) => /* @__PURE__ */ React__namespace.createElement("th", null, title));
|
|
20
|
-
Weekday.displayName = "Weekday";
|
|
21
|
-
|
|
22
10
|
exports.Weekday = Weekday;
|
|
23
11
|
//# 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":["jsx"],"mappings":";;;;;AAEO,SAAS,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;AAC7C,EAAE,uBAAuBA,cAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACrF;;"}
|
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
const WEEK_LENGTH = 7;
|
|
5
5
|
const WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];
|
|
6
|
-
function
|
|
6
|
+
function weekdaysFrom(weekStartsOn = 0) {
|
|
7
|
+
return WEEKDAYS.map((weekday) => (weekday + weekStartsOn) % WEEK_LENGTH);
|
|
8
|
+
}
|
|
9
|
+
function getWeeksForMonth(month, year, weekStartsOn = 0) {
|
|
7
10
|
const firstOfMonth = new Date(year, month, 1);
|
|
8
|
-
const firstDayOfWeek = firstOfMonth.getDay();
|
|
9
11
|
const weeks = [[]];
|
|
10
12
|
let currentWeek = weeks[0];
|
|
11
13
|
let currentDate = firstOfMonth;
|
|
12
|
-
|
|
14
|
+
const leadingDays = (firstOfMonth.getDay() - weekStartsOn + WEEK_LENGTH) % WEEK_LENGTH;
|
|
15
|
+
for (let i = 0; i < leadingDays; i += 1) {
|
|
13
16
|
currentWeek.push(null);
|
|
14
17
|
}
|
|
15
18
|
const fillMonth = () => {
|
|
@@ -68,24 +71,11 @@ function isDateDisabled(date, datesToCompare) {
|
|
|
68
71
|
return date.getTime() === dateToCompare.getTime();
|
|
69
72
|
});
|
|
70
73
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"April",
|
|
77
|
-
"May",
|
|
78
|
-
"June",
|
|
79
|
-
"July",
|
|
80
|
-
"August",
|
|
81
|
-
"September",
|
|
82
|
-
"October",
|
|
83
|
-
"November",
|
|
84
|
-
"December"
|
|
85
|
-
][month];
|
|
86
|
-
}
|
|
87
|
-
function weekdayName(weekday) {
|
|
88
|
-
return ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"][weekday];
|
|
74
|
+
function monthTitle(month, year, locale = "en-US") {
|
|
75
|
+
return new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }).format(new Date(year, month, 1));
|
|
76
|
+
}
|
|
77
|
+
function weekdayName(weekday, locale = "en-US", width = "short") {
|
|
78
|
+
return new Intl.DateTimeFormat(locale, { weekday: width }).format(new Date(2e3, 0, 2 + weekday));
|
|
89
79
|
}
|
|
90
80
|
const formatDate = (date, separator = "-", dateFormat = "YYYY MM DD") => {
|
|
91
81
|
const year = date.getFullYear();
|
|
@@ -141,8 +131,10 @@ function pickCalendarProps(props) {
|
|
|
141
131
|
dateFormat = "YYYY MM DD",
|
|
142
132
|
separator = "-",
|
|
143
133
|
defaultValue,
|
|
144
|
-
|
|
134
|
+
onValueChange = noop,
|
|
145
135
|
onMonthChange,
|
|
136
|
+
locale,
|
|
137
|
+
weekStartsOn,
|
|
146
138
|
...others
|
|
147
139
|
} = props;
|
|
148
140
|
return {
|
|
@@ -156,17 +148,41 @@ function pickCalendarProps(props) {
|
|
|
156
148
|
separator,
|
|
157
149
|
defaultValue,
|
|
158
150
|
disableSpecificDates,
|
|
159
|
-
|
|
151
|
+
onValueChange,
|
|
160
152
|
onInputError,
|
|
161
|
-
onMonthChange
|
|
153
|
+
onMonthChange,
|
|
154
|
+
locale,
|
|
155
|
+
weekStartsOn
|
|
162
156
|
},
|
|
163
157
|
others
|
|
164
158
|
};
|
|
165
159
|
}
|
|
160
|
+
function addDays(date, days) {
|
|
161
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);
|
|
162
|
+
}
|
|
163
|
+
function addMonths(date, months) {
|
|
164
|
+
const lastDay = new Date(date.getFullYear(), date.getMonth() + months + 1, 0).getDate();
|
|
165
|
+
return new Date(date.getFullYear(), date.getMonth() + months, Math.min(date.getDate(), lastDay));
|
|
166
|
+
}
|
|
167
|
+
function startOfWeek(date, weekStartsOn = 0) {
|
|
168
|
+
return addDays(date, -((date.getDay() - weekStartsOn + WEEK_LENGTH) % WEEK_LENGTH));
|
|
169
|
+
}
|
|
170
|
+
function endOfWeek(date, weekStartsOn = 0) {
|
|
171
|
+
return addDays(startOfWeek(date, weekStartsOn), WEEK_LENGTH - 1);
|
|
172
|
+
}
|
|
173
|
+
function dayLabel(date, locale = "en-US") {
|
|
174
|
+
return new Intl.DateTimeFormat(locale, { weekday: "long", day: "numeric", month: "long", year: "numeric" }).format(
|
|
175
|
+
date
|
|
176
|
+
);
|
|
177
|
+
}
|
|
166
178
|
|
|
167
179
|
exports.WEEKDAYS = WEEKDAYS;
|
|
180
|
+
exports.addDays = addDays;
|
|
181
|
+
exports.addMonths = addMonths;
|
|
168
182
|
exports.dateIsSelected = dateIsSelected;
|
|
169
183
|
exports.dateStringParser = dateStringParser;
|
|
184
|
+
exports.dayLabel = dayLabel;
|
|
185
|
+
exports.endOfWeek = endOfWeek;
|
|
170
186
|
exports.formatDate = formatDate;
|
|
171
187
|
exports.getNextDisplayMonth = getNextDisplayMonth;
|
|
172
188
|
exports.getNextDisplayYear = getNextDisplayYear;
|
|
@@ -179,8 +195,10 @@ exports.isDateBefore = isDateBefore;
|
|
|
179
195
|
exports.isDateDisabled = isDateDisabled;
|
|
180
196
|
exports.isDateValid = isDateValid;
|
|
181
197
|
exports.isSameDay = isSameDay;
|
|
182
|
-
exports.
|
|
198
|
+
exports.monthTitle = monthTitle;
|
|
183
199
|
exports.noop = noop;
|
|
184
200
|
exports.pickCalendarProps = pickCalendarProps;
|
|
201
|
+
exports.startOfWeek = startOfWeek;
|
|
185
202
|
exports.weekdayName = weekdayName;
|
|
203
|
+
exports.weekdaysFrom = weekdaysFrom;
|
|
186
204
|
//# 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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AM,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,CAAC;AACT,MAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACrC,SAAS,YAAY,CAAC,YAAY,GAAG,CAAC,EAAE;AAC/C,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,GAAG,YAAY,IAAI,WAAW,CAAC;AAC1E;AACO,SAAS,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,GAAG,CAAC,EAAE;AAChE,EAAE,MAAM,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/C,EAAE,MAAM,KAAK,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
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var DescriptiveListItem = require('./DescriptiveListItem.js');
|
|
6
7
|
var index = require('../../utils/classNames/index.js');
|
|
@@ -18,11 +19,19 @@ function _interopNamespaceDefault(e) {
|
|
|
18
19
|
|
|
19
20
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
20
21
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const DescriptiveListBase = React__namespace.forwardRef(
|
|
23
|
+
({ className, children, variant, ...others }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
+
"dl",
|
|
25
|
+
{
|
|
26
|
+
...others,
|
|
27
|
+
ref,
|
|
28
|
+
className: index.classNames("roaster-descriptive-list", variant && `roaster-descriptive-list--${variant}`, className),
|
|
29
|
+
children
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
DescriptiveListBase.displayName = "DescriptiveList";
|
|
34
|
+
const DescriptiveList = Object.assign(DescriptiveListBase, { Item: DescriptiveListItem.DescriptiveListItem });
|
|
26
35
|
|
|
27
36
|
exports.DescriptiveList = DescriptiveList;
|
|
28
37
|
//# sourceMappingURL=DescriptiveList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptiveList.js","sources":["../../../../src/components/DescriptiveList/DescriptiveList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"DescriptiveList.js","sources":["../../../../src/components/DescriptiveList/DescriptiveList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { DescriptiveListItem } from './DescriptiveListItem';\n\n/** Every native `<dl>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface DescriptiveListProps extends React.ComponentPropsWithoutRef<'dl'> {\n /** The items: DescriptiveList.Item. */\n children: React.ReactNode;\n /** `settings` puts each item in a row of its own, under a line, its title in a wide column: a page of settings. */\n variant?: 'settings';\n}\n\nconst DescriptiveListBase = React.forwardRef<HTMLDListElement, DescriptiveListProps>(\n ({ className, children, variant, ...others }, ref) => (\n <dl\n {...others}\n ref={ref}\n className={classNames('roaster-descriptive-list', variant && `roaster-descriptive-list--${variant}`, className)}\n >\n {children}\n </dl>\n )\n);\nDescriptiveListBase.displayName = 'DescriptiveList';\n\n/**\n * A list of titled values (title on one side, value on the other) to show the details of a record, or with\n * `variant=\"settings\"` the rows of a settings page. Items are DescriptiveList.Item.\n */\nexport const DescriptiveList = Object.assign(DescriptiveListBase, { Item: DescriptiveListItem });\n"],"names":["React","jsx","classNames","DescriptiveListItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,mBAAmB,GAAGA,gBAAK,CAAC,UAAU;AAC5C,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,qBAAqBC,cAAG;AAC3E,IAAI,IAAI;AACR,IAAI;AACJ,MAAM,GAAG,MAAM;AACf,MAAM,GAAG;AACT,MAAM,SAAS,EAAEC,gBAAU,CAAC,0BAA0B,EAAE,OAAO,IAAI,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC;AACrH,MAAM;AACN;AACA;AACA,CAAC;AACD,mBAAmB,CAAC,WAAW,GAAG,iBAAiB;AACvC,MAAC,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAEC,uCAAmB,EAAE;;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var React = require('react');
|
|
6
|
+
var index = require('../../utils/classNames/index.js');
|
|
5
7
|
|
|
6
8
|
function _interopNamespaceDefault(e) {
|
|
7
9
|
var n = Object.create(null);
|
|
@@ -16,9 +18,19 @@ function _interopNamespaceDefault(e) {
|
|
|
16
18
|
|
|
17
19
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const DescriptiveListItem = React__namespace.forwardRef(
|
|
22
|
+
({ title, description, actions, children, className, ...others }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { ...others, ref, className: index.classNames("roaster-descriptive-list__item", className), children: [
|
|
23
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dt", { children: [
|
|
24
|
+
title,
|
|
25
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "roaster-descriptive-list__description", children: description })
|
|
26
|
+
] }),
|
|
27
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dd", { children: [
|
|
28
|
+
children == null || children === "" ? "-" : children,
|
|
29
|
+
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "roaster-descriptive-list__actions", children: actions })
|
|
30
|
+
] })
|
|
31
|
+
] })
|
|
32
|
+
);
|
|
33
|
+
DescriptiveListItem.displayName = "DescriptiveListItem";
|
|
22
34
|
|
|
23
35
|
exports.DescriptiveListItem = DescriptiveListItem;
|
|
24
36
|
//# sourceMappingURL=DescriptiveListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptiveListItem.js","sources":["../../../../src/components/DescriptiveList/DescriptiveListItem.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport interface DescriptiveListItemProps {\n /**
|
|
1
|
+
{"version":3,"file":"DescriptiveListItem.js","sources":["../../../../src/components/DescriptiveList/DescriptiveListItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\n/** Every native `<div>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to the item. */\nexport interface DescriptiveListItemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> {\n /** The title of the value. */\n title: React.ReactNode;\n /** A line under the title, such as what a setting is for. */\n description?: React.ReactNode;\n /** Actions on the value, under it, such as an \"Edit\" link. */\n actions?: React.ReactNode;\n /** The value. A missing one (`null`, `undefined` or `''`) shows a dash; 0 is a value. */\n children?: React.ReactNode;\n}\n\n/** A title and its value: a `<dt>` and a `<dd>`, grouped in a `<div>`, with an optional description and actions. */\nexport const DescriptiveListItem = React.forwardRef<HTMLDivElement, DescriptiveListItemProps>(\n ({ title, description, actions, children, className, ...others }, ref) => (\n <div {...others} ref={ref} className={classNames('roaster-descriptive-list__item', className)}>\n <dt>\n {title}\n {description && <span className=\"roaster-descriptive-list__description\">{description}</span>}\n </dt>\n <dd>\n {children == null || children === '' ? '-' : children}\n {actions && <div className=\"roaster-descriptive-list__actions\">{actions}</div>}\n </dd>\n </div>\n )\n);\nDescriptiveListItem.displayName = 'DescriptiveListItem';\n"],"names":["React","jsxs","classNames","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIY,MAAC,mBAAmB,GAAGA,gBAAK,CAAC,UAAU;AACnD,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,qBAAqBC,eAAI,CAAC,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAEC,gBAAU,CAAC,gCAAgC,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE;AACxM,oBAAoBD,eAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE;AAC3C,MAAM,KAAK;AACX,MAAM,WAAW,oBAAoBE,cAAG,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,uCAAuC,EAAE,QAAQ,EAAE,WAAW,EAAE;AAC9H,KAAK,EAAE,CAAC;AACR,oBAAoBF,eAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE;AAC3C,MAAM,QAAQ,IAAI,IAAI,IAAI,QAAQ,KAAK,EAAE,GAAG,GAAG,GAAG,QAAQ;AAC1D,MAAM,OAAO,oBAAoBE,cAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,mCAAmC,EAAE,QAAQ,EAAE,OAAO,EAAE;AACjH,KAAK,EAAE;AACP,GAAG,EAAE;AACL;AACA,mBAAmB,CAAC,WAAW,GAAG,qBAAqB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownCard.context.js","sources":["../../../../src/components/DropdownCard/DropdownCard.context.ts"],"sourcesContent":["import * as React from 'react';\nimport { useDropdown } from '@/utils';\n\ntype DropdownCardContextType = ReturnType<typeof useDropdown> | null;\n\nexport const DropdownCardContext = React.createContext<DropdownCardContextType>(null);\nexport const DropdownCardProvider = DropdownCardContext.Provider;\n\nexport const useDropdownCardContext = () => {\n const context = React.useContext(DropdownCardContext);\n\n if (context == null) {\n throw new Error('DropdownCard components must be wrapped in <DropdownCard />');\n }\n\n return context;\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DropdownCard.context.js","sources":["../../../../src/components/DropdownCard/DropdownCard.context.ts"],"sourcesContent":["import * as React from 'react';\nimport { useDropdown } from '@/utils';\n\ntype DropdownCardContextType = ReturnType<typeof useDropdown> | null;\n\nexport const DropdownCardContext = React.createContext<DropdownCardContextType>(null);\nexport const DropdownCardProvider = DropdownCardContext.Provider;\n\nexport const useDropdownCardContext = () => {\n const context = React.useContext(DropdownCardContext);\n\n if (context == null) {\n throw new Error('DropdownCard components must be wrapped in <DropdownCard />');\n }\n\n return context;\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;AAEY,MAAC,mBAAmB,GAAGA,gBAAK,CAAC,aAAa,CAAC,IAAI;AAC/C,MAAC,oBAAoB,GAAG,mBAAmB,CAAC;AAC5C,MAAC,sBAAsB,GAAG,MAAM;AAC5C,EAAE,MAAM,OAAO,GAAGA,gBAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC;AACvD,EAAE,IAAI,OAAO,IAAI,IAAI,EAAE;AACvB,IAAI,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC;AAClF,EAAE;AACF,EAAE,OAAO,OAAO;AAChB;;;;"}
|
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var DropdownCardTrigger = require('./components/DropdownCardTrigger.js');
|
|
6
6
|
var DropdownCardActions = require('./components/DropdownCardActions.js');
|
|
7
7
|
var DropdownCardContent = require('./components/DropdownCardContent.js');
|
|
8
8
|
var DropdownCardDropdown = require('./components/DropdownCardDropdown.js');
|
|
9
|
+
var DropdownCardTabs = require('./components/DropdownCardTabs.js');
|
|
9
10
|
var DropdownCard_context = require('./DropdownCard.context.js');
|
|
10
11
|
var index = require('../../utils/useDropdown/index.js');
|
|
11
|
-
var index$1 = require('../../utils/classNames/index.js');
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const DropdownCard = Object.assign(
|
|
14
|
+
function DropdownCard2({ children, ...options }) {
|
|
15
|
+
const dropdown = index.useDropdown({ ...options, role: "dialog", offsetToken: "--roaster-dropdown-card-offset" });
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownCard_context.DropdownCardProvider, { value: dropdown, children });
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
Trigger: DropdownCardTrigger.DropdownCardTrigger,
|
|
20
|
+
Content: DropdownCardContent.DropdownCardContent,
|
|
21
|
+
Dropdown: DropdownCardDropdown.DropdownCardDropdown,
|
|
22
|
+
Actions: DropdownCardActions.DropdownCardActions,
|
|
23
|
+
Tabs: DropdownCardTabs.DropdownCardTabs,
|
|
24
|
+
TabList: DropdownCardTabs.DropdownCardTabList,
|
|
25
|
+
Tab: DropdownCardTabs.DropdownCardTab,
|
|
26
|
+
Panel: DropdownCardTabs.DropdownCardPanel
|
|
19
27
|
}
|
|
20
|
-
|
|
21
|
-
return Object.freeze(n);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
25
|
-
|
|
26
|
-
const DropdownCard = (({ children, className, ...restOptions }) => {
|
|
27
|
-
const dropdown = index.useDropdown({ ...restOptions });
|
|
28
|
-
return /* @__PURE__ */ React__namespace.createElement(DropdownCard_context.DropdownCardProvider, { value: dropdown }, /* @__PURE__ */ React__namespace.createElement("div", { className: index$1.classNames("card-dropdown-container", className) }, children));
|
|
29
|
-
});
|
|
30
|
-
DropdownCard.Trigger = DropdownCardTrigger.DropdownCardTrigger;
|
|
31
|
-
DropdownCard.Content = DropdownCardContent.DropdownCardContent;
|
|
32
|
-
DropdownCard.Dropdown = DropdownCardDropdown.DropdownCardDropdown;
|
|
33
|
-
DropdownCard.Actions = DropdownCardActions.DropdownCardActions;
|
|
28
|
+
);
|
|
34
29
|
|
|
35
30
|
exports.DropdownCard = DropdownCard;
|
|
36
31
|
//# sourceMappingURL=DropdownCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownCard.js","sources":["../../../../src/components/DropdownCard/DropdownCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"DropdownCard.js","sources":["../../../../src/components/DropdownCard/DropdownCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { UseDropdownOptions, useDropdown } from '@/utils';\nimport {\n DropdownCardTrigger,\n DropdownCardContent,\n DropdownCardDropdown,\n DropdownCardActions,\n DropdownCardTabs,\n DropdownCardTabList,\n DropdownCardTab,\n DropdownCardPanel,\n} from './components';\nimport { DropdownCardProvider } from './DropdownCard.context';\n\nexport interface DropdownCardProps extends UseDropdownOptions {\n /** The trigger and the dropdown. */\n children: React.ReactNode;\n}\n\n/**\n * A card that opens under a trigger button (a non-modal dialog), for filters, sorting and similar forms. Escape and a\n * click outside close it. Compose it with DropdownCard.Trigger, Dropdown, Content and Actions; with Tabs, TabList, Tab\n * and Panel for a card of several panels. `placement=\"bottom-start\"` aligns its left edge with the trigger's.\n */\nexport const DropdownCard = Object.assign(\n function DropdownCard({ children, ...options }: DropdownCardProps) {\n const dropdown = useDropdown({ ...options, role: 'dialog', offsetToken: '--roaster-dropdown-card-offset' });\n return <DropdownCardProvider value={dropdown}>{children}</DropdownCardProvider>;\n },\n {\n Trigger: DropdownCardTrigger,\n Content: DropdownCardContent,\n Dropdown: DropdownCardDropdown,\n Actions: DropdownCardActions,\n Tabs: DropdownCardTabs,\n TabList: DropdownCardTabList,\n Tab: DropdownCardTab,\n Panel: DropdownCardPanel,\n }\n);\n"],"names":["useDropdown","jsx","DropdownCardProvider","DropdownCardTrigger","DropdownCardContent","DropdownCardDropdown","DropdownCardActions","DropdownCardTabs","DropdownCardTabList","DropdownCardTab","DropdownCardPanel"],"mappings":";;;;;;;;;;;;AAcY,MAAC,YAAY,GAAG,MAAM,CAAC,MAAM;AACzC,EAAE,SAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,EAAE;AACnD,IAAI,MAAM,QAAQ,GAAGA,iBAAW,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;AAC/G,IAAI,uBAAuBC,cAAG,CAACC,yCAAoB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACnF,EAAE,CAAC;AACH,EAAE;AACF,IAAI,OAAO,EAAEC,uCAAmB;AAChC,IAAI,OAAO,EAAEC,uCAAmB;AAChC,IAAI,QAAQ,EAAEC,yCAAoB;AAClC,IAAI,OAAO,EAAEC,uCAAmB;AAChC,IAAI,IAAI,EAAEC,iCAAgB;AAC1B,IAAI,OAAO,EAAEC,oCAAmB;AAChC,IAAI,GAAG,EAAEC,gCAAe;AACxB,IAAI,KAAK,EAAEC;AACX;AACA;;"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var index = require('../../../utils/classNames/index.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const DropdownCardActions = React.forwardRef(
|
|
9
|
+
({ className, children, ...others }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...others, ref, className: index.classNames("roaster-dropdown-card__actions", className), children })
|
|
10
|
+
);
|
|
11
|
+
DropdownCardActions.displayName = "DropdownCardActions";
|
|
10
12
|
|
|
11
13
|
exports.DropdownCardActions = DropdownCardActions;
|
|
12
14
|
//# sourceMappingURL=DropdownCardActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownCardActions.js","sources":["../../../../../src/components/DropdownCard/components/DropdownCardActions.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface DropdownCardActionsProps {\n
|
|
1
|
+
{"version":3,"file":"DropdownCardActions.js","sources":["../../../../../src/components/DropdownCard/components/DropdownCardActions.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@/utils';\n\n/** Every native `<div>` prop is accepted and forwarded to it. */\nexport interface DropdownCardActionsProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The buttons of the card, at its bottom, such as Reset and Apply. */\n children: React.ReactNode;\n}\n\nexport const DropdownCardActions = React.forwardRef<HTMLDivElement, DropdownCardActionsProps>(\n ({ className, children, ...others }, ref) => (\n <div {...others} ref={ref} className={classNames('roaster-dropdown-card__actions', className)}>\n {children}\n </div>\n )\n);\nDropdownCardActions.displayName = 'DropdownCardActions';\n"],"names":["jsx","classNames"],"mappings":";;;;;;;AAIY,MAAC,mBAAmB,GAAG,KAAK,CAAC,UAAU;AACnD,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,qBAAqBA,cAAG,CAAC,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAEC,gBAAU,CAAC,gCAAgC,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE;AAC1K;AACA,mBAAmB,CAAC,WAAW,GAAG,qBAAqB;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var index = require('../../../utils/classNames/index.js');
|
|
6
7
|
|
|
@@ -17,9 +18,10 @@ function _interopNamespaceDefault(e) {
|
|
|
17
18
|
|
|
18
19
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const DropdownCardContent = React__namespace.forwardRef(
|
|
22
|
+
({ className, children, ...others }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...others, ref, className: index.classNames("roaster-dropdown-card__content", className), children })
|
|
23
|
+
);
|
|
24
|
+
DropdownCardContent.displayName = "DropdownCardContent";
|
|
23
25
|
|
|
24
26
|
exports.DropdownCardContent = DropdownCardContent;
|
|
25
27
|
//# sourceMappingURL=DropdownCardContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownCardContent.js","sources":["../../../../../src/components/DropdownCard/components/DropdownCardContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface DropdownCardContentProps {\n
|
|
1
|
+
{"version":3,"file":"DropdownCardContent.js","sources":["../../../../../src/components/DropdownCard/components/DropdownCardContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\n/** Every native `<div>` prop is accepted and forwarded to it. */\nexport interface DropdownCardContentProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The fields of the card. It scrolls when the card is taller than the window. */\n children: React.ReactNode;\n}\n\nexport const DropdownCardContent = React.forwardRef<HTMLDivElement, DropdownCardContentProps>(\n ({ className, children, ...others }, ref) => (\n <div {...others} ref={ref} className={classNames('roaster-dropdown-card__content', className)}>\n {children}\n </div>\n )\n);\nDropdownCardContent.displayName = 'DropdownCardContent';\n"],"names":["React","jsx","classNames"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIY,MAAC,mBAAmB,GAAGA,gBAAK,CAAC,UAAU;AACnD,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,qBAAqBC,cAAG,CAAC,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAEC,gBAAU,CAAC,gCAAgC,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE;AAC1K;AACA,mBAAmB,CAAC,WAAW,GAAG,qBAAqB;;"}
|