@trellixio/roaster-react 1.1.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -23
- package/cjs/components/ActionCard/ActionCard.js +20 -4
- package/cjs/components/ActionCard/ActionCard.js.map +1 -1
- package/cjs/components/ActionCard/ActionCardGroup.js +42 -0
- package/cjs/components/ActionCard/ActionCardGroup.js.map +1 -0
- package/cjs/components/ActionList/ActionList.context.js.map +1 -1
- package/cjs/components/ActionList/ActionList.js +20 -23
- package/cjs/components/ActionList/ActionList.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListDivider.js +6 -3
- package/cjs/components/ActionList/components/ActionListDivider.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListDropdown.js +30 -15
- package/cjs/components/ActionList/components/ActionListDropdown.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListGroup.js +25 -4
- package/cjs/components/ActionList/components/ActionListGroup.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListItem.js +54 -4
- package/cjs/components/ActionList/components/ActionListItem.js.map +1 -1
- package/cjs/components/ActionList/components/ActionListSearch.js +67 -0
- package/cjs/components/ActionList/components/ActionListSearch.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListSubmenu.js +125 -0
- package/cjs/components/ActionList/components/ActionListSubmenu.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListSwitchItem.js +64 -0
- package/cjs/components/ActionList/components/ActionListSwitchItem.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListTrigger.js +2 -36
- package/cjs/components/ActionList/components/ActionListTrigger.js.map +1 -1
- package/cjs/components/Alert/Alert.js +19 -2
- package/cjs/components/Alert/Alert.js.map +1 -1
- package/cjs/components/AppFrame/AppFrame.js +56 -0
- package/cjs/components/AppFrame/AppFrame.js.map +1 -0
- package/cjs/components/Avatar/Avatar.js +31 -8
- package/cjs/components/Avatar/Avatar.js.map +1 -1
- package/cjs/components/BlockCard/BlockCard.js +98 -4
- package/cjs/components/BlockCard/BlockCard.js.map +1 -1
- package/cjs/components/Button/Button.js +36 -15
- package/cjs/components/Button/Button.js.map +1 -1
- package/cjs/components/ButtonIcon/ButtonIcon.js +8 -9
- package/cjs/components/ButtonIcon/ButtonIcon.js.map +1 -1
- package/cjs/components/Chart/Chart.js +185 -0
- package/cjs/components/Chart/Chart.js.map +1 -0
- package/cjs/components/Checkbox/Checkbox.js +65 -38
- package/cjs/components/Checkbox/Checkbox.js.map +1 -1
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js.map +1 -1
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.js +45 -11
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/cjs/components/Checkbox/ChoiceText.js +49 -0
- package/cjs/components/Checkbox/ChoiceText.js.map +1 -0
- package/cjs/components/ColorField/ColorField.js +69 -18
- package/cjs/components/ColorField/ColorField.js.map +1 -1
- package/cjs/components/DatePicker/DatePicker.js +86 -48
- package/cjs/components/DatePicker/DatePicker.js.map +1 -1
- package/cjs/components/DatePicker/components/Calendar/Calendar.js +65 -35
- package/cjs/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
- package/cjs/components/DatePicker/components/Day/Day.js +16 -31
- package/cjs/components/DatePicker/components/Day/Day.js.map +1 -1
- package/cjs/components/DatePicker/components/Month/Month.js +92 -29
- package/cjs/components/DatePicker/components/Month/Month.js.map +1 -1
- package/cjs/components/DatePicker/components/MonthGrid/MonthGrid.js +97 -0
- package/cjs/components/DatePicker/components/MonthGrid/MonthGrid.js.map +1 -0
- package/cjs/components/DatePicker/components/Weekday/Weekday.js +3 -15
- package/cjs/components/DatePicker/components/Weekday/Weekday.js.map +1 -1
- package/cjs/components/DatePicker/utils/index.js +43 -25
- package/cjs/components/DatePicker/utils/index.js.map +1 -1
- package/cjs/components/DescriptiveList/DescriptiveList.js +14 -5
- package/cjs/components/DescriptiveList/DescriptiveList.js.map +1 -1
- package/cjs/components/DescriptiveList/DescriptiveListItem.js +15 -3
- package/cjs/components/DescriptiveList/DescriptiveListItem.js.map +1 -1
- package/cjs/components/DropdownCard/DropdownCard.context.js.map +1 -1
- package/cjs/components/DropdownCard/DropdownCard.js +17 -22
- package/cjs/components/DropdownCard/DropdownCard.js.map +1 -1
- package/cjs/components/DropdownCard/components/DropdownCardActions.js +5 -3
- package/cjs/components/DropdownCard/components/DropdownCardActions.js.map +1 -1
- package/cjs/components/DropdownCard/components/DropdownCardContent.js +5 -3
- package/cjs/components/DropdownCard/components/DropdownCardContent.js.map +1 -1
- package/cjs/components/DropdownCard/components/DropdownCardDropdown.js +18 -13
- package/cjs/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -1
- package/cjs/components/DropdownCard/components/DropdownCardTabs.js +136 -0
- package/cjs/components/DropdownCard/components/DropdownCardTabs.js.map +1 -0
- package/cjs/components/DropdownCard/components/DropdownCardTrigger.js +2 -34
- package/cjs/components/DropdownCard/components/DropdownCardTrigger.js.map +1 -1
- package/cjs/components/Field/Field.js +27 -0
- package/cjs/components/Field/Field.js.map +1 -0
- package/cjs/components/FileField/FileField.js +64 -24
- package/cjs/components/FileField/FileField.js.map +1 -1
- package/cjs/components/FormActions/FormActions.js +27 -0
- package/cjs/components/FormActions/FormActions.js.map +1 -0
- package/cjs/components/HyperlinkCard/HyperlinkCard.js +22 -6
- package/cjs/components/HyperlinkCard/HyperlinkCard.js.map +1 -1
- package/cjs/components/Icon/Icon.js +10 -12
- package/cjs/components/Icon/Icon.js.map +1 -1
- package/cjs/components/IconBadge/IconBadge.js +40 -0
- package/cjs/components/IconBadge/IconBadge.js.map +1 -0
- package/cjs/components/Loader/Loader.js +35 -2
- package/cjs/components/Loader/Loader.js.map +1 -1
- package/cjs/components/Modal/Modal.js +91 -4
- package/cjs/components/Modal/Modal.js.map +1 -1
- package/cjs/components/Modal/ModalProvider/ModalProviderFooter.js +7 -4
- package/cjs/components/Modal/ModalProvider/ModalProviderFooter.js.map +1 -1
- package/cjs/components/Modal/ModalProvider/index.js +16 -17
- package/cjs/components/Modal/ModalProvider/index.js.map +1 -1
- package/cjs/components/Modal/utils/reducer.js +4 -1
- package/cjs/components/Modal/utils/reducer.js.map +1 -1
- package/cjs/components/Modal/utils/useModal.js +1 -1
- package/cjs/components/Modal/utils/useModal.js.map +1 -1
- package/cjs/components/Page/Breadcrumbs.js +43 -0
- package/cjs/components/Page/Breadcrumbs.js.map +1 -0
- package/cjs/components/Page/Page.js +73 -8
- package/cjs/components/Page/Page.js.map +1 -1
- package/cjs/components/Pagination/Pagination.js +23 -12
- package/cjs/components/Pagination/Pagination.js.map +1 -1
- package/cjs/components/Progress/Progress.js +48 -3
- package/cjs/components/Progress/Progress.js.map +1 -1
- package/cjs/components/Radio/Radio.js +35 -25
- package/cjs/components/Radio/Radio.js.map +1 -1
- package/cjs/components/Radio/RadioGroup/RadioGroup.context.js.map +1 -1
- package/cjs/components/Radio/RadioGroup/RadioGroup.js +37 -24
- package/cjs/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
- package/cjs/components/RangeField/RangeField.js +31 -27
- package/cjs/components/RangeField/RangeField.js.map +1 -1
- package/cjs/components/Select/Select.js +75 -31
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Sidebar/Sidebar.js +122 -110
- package/cjs/components/Sidebar/Sidebar.js.map +1 -1
- package/cjs/components/Sidebar/components/Back.js +38 -0
- package/cjs/components/Sidebar/components/Back.js.map +1 -0
- package/cjs/components/Sidebar/components/Menu.js +17 -6
- package/cjs/components/Sidebar/components/Menu.js.map +1 -1
- package/cjs/components/Sidebar/components/MenuItem.js +37 -6
- package/cjs/components/Sidebar/components/MenuItem.js.map +1 -1
- package/cjs/components/Sidebar/components/Section.js +15 -3
- package/cjs/components/Sidebar/components/Section.js.map +1 -1
- package/cjs/components/Sidebar/components/SubMenu.js +15 -2
- package/cjs/components/Sidebar/components/SubMenu.js.map +1 -1
- package/cjs/components/Spinner/Spinner.js +20 -2
- package/cjs/components/Spinner/Spinner.js.map +1 -1
- package/cjs/components/StatCard/StatCard.js +47 -10
- package/cjs/components/StatCard/StatCard.js.map +1 -1
- package/cjs/components/Switch/Switch.js +42 -20
- package/cjs/components/Switch/Switch.js.map +1 -1
- package/cjs/components/Table/Table.js +95 -31
- package/cjs/components/Table/Table.js.map +1 -1
- package/cjs/components/Table/components/Checkbox/index.js +8 -8
- package/cjs/components/Table/components/Checkbox/index.js.map +1 -1
- package/cjs/components/Table/components/TableBody.js +3 -3
- package/cjs/components/Table/components/TableBody.js.map +1 -1
- package/cjs/components/Table/components/TableCell.js +3 -4
- package/cjs/components/Table/components/TableCell.js.map +1 -1
- package/cjs/components/Table/components/TableGroup.js +30 -0
- package/cjs/components/Table/components/TableGroup.js.map +1 -0
- package/cjs/components/Table/components/TableHead.js +19 -16
- package/cjs/components/Table/components/TableHead.js.map +1 -1
- package/cjs/components/Table/components/TableHeadCell.js +23 -5
- package/cjs/components/Table/components/TableHeadCell.js.map +1 -1
- package/cjs/components/Table/components/TablePagination.js +6 -16
- package/cjs/components/Table/components/TablePagination.js.map +1 -1
- package/cjs/components/Table/components/TableProvider/TableProvider.js +4 -4
- package/cjs/components/Table/components/TableProvider/TableProvider.js.map +1 -1
- package/cjs/components/Table/components/TableRow.js +12 -9
- package/cjs/components/Table/components/TableRow.js.map +1 -1
- package/cjs/components/Table/labels.js +34 -0
- package/cjs/components/Table/labels.js.map +1 -0
- package/cjs/components/Table/utils/rows/context.js.map +1 -1
- package/cjs/components/Table/utils/table/context.js.map +1 -1
- package/cjs/components/Table/utils/table/hooks.js +3 -3
- package/cjs/components/Table/utils/table/hooks.js.map +1 -1
- package/cjs/components/Table/utils/table/types.js +0 -7
- package/cjs/components/Table/utils/table/types.js.map +1 -1
- package/cjs/components/Table/utils/useSelectableResourceState/index.js +4 -5
- package/cjs/components/Table/utils/useSelectableResourceState/index.js.map +1 -1
- package/cjs/components/Tag/Tag.js +36 -5
- package/cjs/components/Tag/Tag.js.map +1 -1
- package/cjs/components/Tag/TagGroup.js +3 -2
- package/cjs/components/Tag/TagGroup.js.map +1 -1
- package/cjs/components/TextField/TextField.js +41 -38
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/Textarea/Textarea.js +10 -26
- package/cjs/components/Textarea/Textarea.js.map +1 -1
- package/cjs/components/Thumbnail/Thumbnail.js +22 -8
- package/cjs/components/Thumbnail/Thumbnail.js.map +1 -1
- package/cjs/components/Timeline/Timeline.js +40 -0
- package/cjs/components/Timeline/Timeline.js.map +1 -0
- package/cjs/components/Timeline/TimelineGroup.js +42 -0
- package/cjs/components/Timeline/TimelineGroup.js.map +1 -0
- package/cjs/components/Timeline/TimelineItem.js +38 -0
- package/cjs/components/Timeline/TimelineItem.js.map +1 -0
- package/cjs/components/Toast/Toast.js +18 -2
- package/cjs/components/Toast/Toast.js.map +1 -1
- package/cjs/components/Toast/Toasts.context.js +31 -3
- package/cjs/components/Toast/Toasts.context.js.map +1 -1
- package/cjs/components/Toast/ToastsContainer/index.js +43 -19
- package/cjs/components/Toast/ToastsContainer/index.js.map +1 -1
- package/cjs/components/Toast/ToastsProvider/index.js +11 -15
- package/cjs/components/Toast/ToastsProvider/index.js.map +1 -1
- package/cjs/components/Toast/store.js +49 -0
- package/cjs/components/Toast/store.js.map +1 -0
- package/cjs/components/Tooltip/Tooltip.js +34 -53
- package/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/cjs/components/Tooltip/TooltipCallout.js +60 -0
- package/cjs/components/Tooltip/TooltipCallout.js.map +1 -0
- package/cjs/components/Tooltip/useTooltip.js +11 -45
- package/cjs/components/Tooltip/useTooltip.js.map +1 -1
- package/cjs/components/Visualizer/Visualizer.js +70 -10
- package/cjs/components/Visualizer/Visualizer.js.map +1 -1
- package/cjs/index.js +68 -66
- package/cjs/index.js.map +1 -1
- package/cjs/tokens/tokens.js +1532 -0
- package/cjs/tokens/tokens.js.map +1 -0
- package/cjs/utils/Slot/index.js +52 -0
- package/cjs/utils/Slot/index.js.map +1 -0
- package/cjs/utils/classNames/index.js +3 -3
- package/cjs/utils/classNames/index.js.map +1 -1
- package/cjs/utils/getElementRef/index.js +16 -0
- package/cjs/utils/getElementRef/index.js.map +1 -0
- package/cjs/utils/guid/index.js.map +1 -1
- package/cjs/utils/toPercent/index.js +9 -0
- package/cjs/utils/toPercent/index.js.map +1 -0
- package/cjs/utils/useControllableState/index.js +39 -0
- package/cjs/utils/useControllableState/index.js.map +1 -0
- package/cjs/utils/useDropdown/DropdownTrigger.js +33 -0
- package/cjs/utils/useDropdown/DropdownTrigger.js.map +1 -0
- package/cjs/utils/useDropdown/index.js +54 -23
- package/cjs/utils/useDropdown/index.js.map +1 -1
- package/cjs/utils/useImageFallback/index.js +26 -0
- package/cjs/utils/useImageFallback/index.js.map +1 -0
- package/cjs/utils/useUid/index.js.map +1 -1
- package/esm/components/ActionCard/ActionCard.js +20 -4
- package/esm/components/ActionCard/ActionCard.js.map +1 -1
- package/esm/components/ActionCard/ActionCardGroup.js +26 -0
- package/esm/components/ActionCard/ActionCardGroup.js.map +1 -0
- package/esm/components/ActionList/ActionList.context.js.map +1 -1
- package/esm/components/ActionList/ActionList.js +21 -11
- package/esm/components/ActionList/ActionList.js.map +1 -1
- package/esm/components/ActionList/components/ActionListDivider.js +6 -3
- package/esm/components/ActionList/components/ActionListDivider.js.map +1 -1
- package/esm/components/ActionList/components/ActionListDropdown.js +31 -16
- package/esm/components/ActionList/components/ActionListDropdown.js.map +1 -1
- package/esm/components/ActionList/components/ActionListGroup.js +24 -3
- package/esm/components/ActionList/components/ActionListGroup.js.map +1 -1
- package/esm/components/ActionList/components/ActionListItem.js +53 -3
- package/esm/components/ActionList/components/ActionListItem.js.map +1 -1
- package/esm/components/ActionList/components/ActionListSearch.js +52 -0
- package/esm/components/ActionList/components/ActionListSearch.js.map +1 -0
- package/esm/components/ActionList/components/ActionListSubmenu.js +110 -0
- package/esm/components/ActionList/components/ActionListSubmenu.js.map +1 -0
- package/esm/components/ActionList/components/ActionListSwitchItem.js +49 -0
- package/esm/components/ActionList/components/ActionListSwitchItem.js.map +1 -0
- package/esm/components/ActionList/components/ActionListTrigger.js +2 -23
- package/esm/components/ActionList/components/ActionListTrigger.js.map +1 -1
- package/esm/components/Alert/Alert.js +19 -2
- package/esm/components/Alert/Alert.js.map +1 -1
- package/esm/components/AppFrame/AppFrame.js +37 -0
- package/esm/components/AppFrame/AppFrame.js.map +1 -0
- package/esm/components/Avatar/Avatar.js +31 -8
- package/esm/components/Avatar/Avatar.js.map +1 -1
- package/esm/components/BlockCard/BlockCard.js +98 -4
- package/esm/components/BlockCard/BlockCard.js.map +1 -1
- package/esm/components/Button/Button.js +36 -15
- package/esm/components/Button/Button.js.map +1 -1
- package/esm/components/ButtonIcon/ButtonIcon.js +8 -9
- package/esm/components/ButtonIcon/ButtonIcon.js.map +1 -1
- package/esm/components/Chart/Chart.js +170 -0
- package/esm/components/Chart/Chart.js.map +1 -0
- package/esm/components/Checkbox/Checkbox.js +64 -37
- package/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js.map +1 -1
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.js +45 -11
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/esm/components/Checkbox/ChoiceText.js +33 -0
- package/esm/components/Checkbox/ChoiceText.js.map +1 -0
- package/esm/components/ColorField/ColorField.js +69 -18
- package/esm/components/ColorField/ColorField.js.map +1 -1
- package/esm/components/DatePicker/DatePicker.js +86 -48
- package/esm/components/DatePicker/DatePicker.js.map +1 -1
- package/esm/components/DatePicker/components/Calendar/Calendar.js +60 -18
- package/esm/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
- package/esm/components/DatePicker/components/Day/Day.js +18 -20
- package/esm/components/DatePicker/components/Day/Day.js.map +1 -1
- package/esm/components/DatePicker/components/Month/Month.js +93 -30
- package/esm/components/DatePicker/components/Month/Month.js.map +1 -1
- package/esm/components/DatePicker/components/MonthGrid/MonthGrid.js +82 -0
- package/esm/components/DatePicker/components/MonthGrid/MonthGrid.js.map +1 -0
- package/esm/components/DatePicker/components/Weekday/Weekday.js +4 -3
- package/esm/components/DatePicker/components/Weekday/Weekday.js.map +1 -1
- package/esm/components/DatePicker/utils/index.js +37 -25
- package/esm/components/DatePicker/utils/index.js.map +1 -1
- package/esm/components/DescriptiveList/DescriptiveList.js +14 -5
- package/esm/components/DescriptiveList/DescriptiveList.js.map +1 -1
- package/esm/components/DescriptiveList/DescriptiveListItem.js +15 -3
- package/esm/components/DescriptiveList/DescriptiveListItem.js.map +1 -1
- package/esm/components/DropdownCard/DropdownCard.context.js.map +1 -1
- package/esm/components/DropdownCard/DropdownCard.js +18 -10
- package/esm/components/DropdownCard/DropdownCard.js.map +1 -1
- package/esm/components/DropdownCard/components/DropdownCardActions.js +5 -3
- package/esm/components/DropdownCard/components/DropdownCardActions.js.map +1 -1
- package/esm/components/DropdownCard/components/DropdownCardContent.js +5 -3
- package/esm/components/DropdownCard/components/DropdownCardContent.js.map +1 -1
- package/esm/components/DropdownCard/components/DropdownCardDropdown.js +19 -14
- package/esm/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -1
- package/esm/components/DropdownCard/components/DropdownCardTabs.js +118 -0
- package/esm/components/DropdownCard/components/DropdownCardTabs.js.map +1 -0
- package/esm/components/DropdownCard/components/DropdownCardTrigger.js +2 -21
- package/esm/components/DropdownCard/components/DropdownCardTrigger.js.map +1 -1
- package/esm/components/Field/Field.js +24 -0
- package/esm/components/Field/Field.js.map +1 -0
- package/esm/components/FileField/FileField.js +64 -24
- package/esm/components/FileField/FileField.js.map +1 -1
- package/esm/components/FormActions/FormActions.js +12 -0
- package/esm/components/FormActions/FormActions.js.map +1 -0
- package/esm/components/HyperlinkCard/HyperlinkCard.js +10 -7
- package/esm/components/HyperlinkCard/HyperlinkCard.js.map +1 -1
- package/esm/components/Icon/Icon.js +10 -12
- package/esm/components/Icon/Icon.js.map +1 -1
- package/esm/components/IconBadge/IconBadge.js +25 -0
- package/esm/components/IconBadge/IconBadge.js.map +1 -0
- package/esm/components/Loader/Loader.js +24 -4
- package/esm/components/Loader/Loader.js.map +1 -1
- package/esm/components/Modal/Modal.js +90 -3
- package/esm/components/Modal/Modal.js.map +1 -1
- package/esm/components/Modal/ModalProvider/ModalProviderFooter.js +7 -4
- package/esm/components/Modal/ModalProvider/ModalProviderFooter.js.map +1 -1
- package/esm/components/Modal/ModalProvider/index.js +16 -17
- package/esm/components/Modal/ModalProvider/index.js.map +1 -1
- package/esm/components/Modal/utils/reducer.js +4 -1
- package/esm/components/Modal/utils/reducer.js.map +1 -1
- package/esm/components/Modal/utils/useModal.js +1 -1
- package/esm/components/Modal/utils/useModal.js.map +1 -1
- package/esm/components/Page/Breadcrumbs.js +28 -0
- package/esm/components/Page/Breadcrumbs.js.map +1 -0
- package/esm/components/Page/Page.js +73 -9
- package/esm/components/Page/Page.js.map +1 -1
- package/esm/components/Pagination/Pagination.js +23 -12
- package/esm/components/Pagination/Pagination.js.map +1 -1
- package/esm/components/Progress/Progress.js +35 -3
- package/esm/components/Progress/Progress.js.map +1 -1
- package/esm/components/Radio/Radio.js +35 -25
- package/esm/components/Radio/Radio.js.map +1 -1
- package/esm/components/Radio/RadioGroup/RadioGroup.context.js.map +1 -1
- package/esm/components/Radio/RadioGroup/RadioGroup.js +37 -24
- package/esm/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
- package/esm/components/RangeField/RangeField.js +31 -27
- package/esm/components/RangeField/RangeField.js.map +1 -1
- package/esm/components/Select/Select.js +75 -31
- package/esm/components/Select/Select.js.map +1 -1
- package/esm/components/Sidebar/Sidebar.js +121 -109
- package/esm/components/Sidebar/Sidebar.js.map +1 -1
- package/esm/components/Sidebar/components/Back.js +23 -0
- package/esm/components/Sidebar/components/Back.js.map +1 -0
- package/esm/components/Sidebar/components/Menu.js +5 -7
- package/esm/components/Sidebar/components/Menu.js.map +1 -1
- package/esm/components/Sidebar/components/MenuItem.js +25 -7
- package/esm/components/Sidebar/components/MenuItem.js.map +1 -1
- package/esm/components/Sidebar/components/Section.js +4 -5
- package/esm/components/Sidebar/components/Section.js.map +1 -1
- package/esm/components/Sidebar/components/SubMenu.js +4 -4
- package/esm/components/Sidebar/components/SubMenu.js.map +1 -1
- package/esm/components/Spinner/Spinner.js +9 -4
- package/esm/components/Spinner/Spinner.js.map +1 -1
- package/esm/components/StatCard/StatCard.js +46 -10
- package/esm/components/StatCard/StatCard.js.map +1 -1
- package/esm/components/Switch/Switch.js +42 -20
- package/esm/components/Switch/Switch.js.map +1 -1
- package/esm/components/Table/Table.js +95 -31
- package/esm/components/Table/Table.js.map +1 -1
- package/esm/components/Table/components/Checkbox/index.js +8 -8
- package/esm/components/Table/components/Checkbox/index.js.map +1 -1
- package/esm/components/Table/components/TableBody.js +3 -3
- package/esm/components/Table/components/TableBody.js.map +1 -1
- package/esm/components/Table/components/TableCell.js +3 -4
- package/esm/components/Table/components/TableCell.js.map +1 -1
- package/esm/components/Table/components/TableGroup.js +15 -0
- package/esm/components/Table/components/TableGroup.js.map +1 -0
- package/esm/components/Table/components/TableHead.js +19 -16
- package/esm/components/Table/components/TableHead.js.map +1 -1
- package/esm/components/Table/components/TableHeadCell.js +23 -6
- package/esm/components/Table/components/TableHeadCell.js.map +1 -1
- package/esm/components/Table/components/TablePagination.js +6 -3
- package/esm/components/Table/components/TablePagination.js.map +1 -1
- package/esm/components/Table/components/TableProvider/TableProvider.js +5 -5
- package/esm/components/Table/components/TableProvider/TableProvider.js.map +1 -1
- package/esm/components/Table/components/TableRow.js +11 -8
- package/esm/components/Table/components/TableRow.js.map +1 -1
- package/esm/components/Table/labels.js +18 -0
- package/esm/components/Table/labels.js.map +1 -0
- package/esm/components/Table/utils/rows/context.js.map +1 -1
- package/esm/components/Table/utils/table/context.js.map +1 -1
- package/esm/components/Table/utils/table/hooks.js +4 -4
- package/esm/components/Table/utils/table/hooks.js.map +1 -1
- package/esm/components/Table/utils/table/types.js +1 -7
- package/esm/components/Table/utils/table/types.js.map +1 -1
- package/esm/components/Table/utils/useSelectableResourceState/index.js +4 -5
- package/esm/components/Table/utils/useSelectableResourceState/index.js.map +1 -1
- package/esm/components/Tag/Tag.js +36 -5
- package/esm/components/Tag/Tag.js.map +1 -1
- package/esm/components/Tag/TagGroup.js +3 -2
- package/esm/components/Tag/TagGroup.js.map +1 -1
- package/esm/components/TextField/TextField.js +41 -38
- package/esm/components/TextField/TextField.js.map +1 -1
- package/esm/components/Textarea/Textarea.js +10 -26
- package/esm/components/Textarea/Textarea.js.map +1 -1
- package/esm/components/Thumbnail/Thumbnail.js +22 -8
- package/esm/components/Thumbnail/Thumbnail.js.map +1 -1
- package/esm/components/Timeline/Timeline.js +25 -0
- package/esm/components/Timeline/Timeline.js.map +1 -0
- package/esm/components/Timeline/TimelineGroup.js +27 -0
- package/esm/components/Timeline/TimelineGroup.js.map +1 -0
- package/esm/components/Timeline/TimelineItem.js +23 -0
- package/esm/components/Timeline/TimelineItem.js.map +1 -0
- package/esm/components/Toast/Toast.js +18 -2
- package/esm/components/Toast/Toast.js.map +1 -1
- package/esm/components/Toast/Toasts.context.js +17 -4
- package/esm/components/Toast/Toasts.context.js.map +1 -1
- package/esm/components/Toast/ToastsContainer/index.js +44 -20
- package/esm/components/Toast/ToastsContainer/index.js.map +1 -1
- package/esm/components/Toast/ToastsProvider/index.js +10 -14
- package/esm/components/Toast/ToastsProvider/index.js.map +1 -1
- package/esm/components/Toast/store.js +47 -0
- package/esm/components/Toast/store.js.map +1 -0
- package/esm/components/Tooltip/Tooltip.js +34 -53
- package/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/esm/components/Tooltip/TooltipCallout.js +45 -0
- package/esm/components/Tooltip/TooltipCallout.js.map +1 -0
- package/esm/components/Tooltip/useTooltip.js +12 -33
- package/esm/components/Tooltip/useTooltip.js.map +1 -1
- package/esm/components/Visualizer/Visualizer.js +69 -9
- package/esm/components/Visualizer/Visualizer.js.map +1 -1
- package/esm/index.js +31 -27
- package/esm/index.js.map +1 -1
- package/esm/tokens/tokens.js +1530 -0
- package/esm/tokens/tokens.js.map +1 -0
- package/esm/utils/Slot/index.js +37 -0
- package/esm/utils/Slot/index.js.map +1 -0
- package/esm/utils/classNames/index.js +3 -3
- package/esm/utils/classNames/index.js.map +1 -1
- package/esm/utils/getElementRef/index.js +14 -0
- package/esm/utils/getElementRef/index.js.map +1 -0
- package/esm/utils/guid/index.js.map +1 -1
- package/esm/utils/toPercent/index.js +7 -0
- package/esm/utils/toPercent/index.js.map +1 -0
- package/esm/utils/useControllableState/index.js +24 -0
- package/esm/utils/useControllableState/index.js.map +1 -0
- package/esm/utils/useDropdown/DropdownTrigger.js +18 -0
- package/esm/utils/useDropdown/DropdownTrigger.js.map +1 -0
- package/esm/utils/useDropdown/index.js +55 -25
- package/esm/utils/useDropdown/index.js.map +1 -1
- package/esm/utils/useImageFallback/index.js +11 -0
- package/esm/utils/useImageFallback/index.js.map +1 -0
- package/esm/utils/useUid/index.js.map +1 -1
- package/fonts/dm-sans/LICENSE +93 -0
- package/fonts/dm-sans/dm-sans-latin-400-italic.woff2 +0 -0
- package/fonts/dm-sans/dm-sans-latin-400-normal.woff2 +0 -0
- package/fonts/dm-sans/dm-sans-latin-700-italic.woff2 +0 -0
- package/fonts/dm-sans/dm-sans-latin-700-normal.woff2 +0 -0
- package/fonts/inter/LICENSE +93 -0
- package/fonts/inter/inter-latin-opsz-italic.woff2 +0 -0
- package/fonts/inter/inter-latin-opsz-normal.woff2 +0 -0
- package/fonts/jetbrains-mono/LICENSE +93 -0
- package/fonts/jetbrains-mono/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/fonts/roboto-mono/LICENSE +93 -0
- package/fonts/roboto-mono/roboto-mono-latin-wght-normal.woff2 +0 -0
- package/lib/components/ActionCard/ActionCard.d.ts +14 -13
- package/lib/components/ActionCard/ActionCard.d.ts.map +1 -1
- package/lib/components/ActionCard/ActionCardGroup.d.ts +22 -0
- package/lib/components/ActionCard/ActionCardGroup.d.ts.map +1 -0
- package/lib/components/ActionCard/index.d.ts +1 -0
- package/lib/components/ActionCard/index.d.ts.map +1 -1
- package/lib/components/ActionList/ActionList.context.d.ts +6 -3
- package/lib/components/ActionList/ActionList.context.d.ts.map +1 -1
- package/lib/components/ActionList/ActionList.d.ts +18 -18
- package/lib/components/ActionList/ActionList.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListDivider.d.ts +4 -5
- package/lib/components/ActionList/components/ActionListDivider.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListDropdown.d.ts +4 -1
- package/lib/components/ActionList/components/ActionListDropdown.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListGroup.d.ts +7 -5
- package/lib/components/ActionList/components/ActionListGroup.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListItem.d.ts +32 -7
- package/lib/components/ActionList/components/ActionListItem.d.ts.map +1 -1
- package/lib/components/ActionList/components/ActionListSearch.d.ts +21 -0
- package/lib/components/ActionList/components/ActionListSearch.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListSubmenu.d.ts +22 -0
- package/lib/components/ActionList/components/ActionListSubmenu.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListSwitchItem.d.ts +17 -0
- package/lib/components/ActionList/components/ActionListSwitchItem.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListTrigger.d.ts +4 -6
- package/lib/components/ActionList/components/ActionListTrigger.d.ts.map +1 -1
- package/lib/components/Alert/Alert.d.ts +25 -11
- package/lib/components/Alert/Alert.d.ts.map +1 -1
- package/lib/components/AppFrame/AppFrame.d.ts +48 -0
- package/lib/components/AppFrame/AppFrame.d.ts.map +1 -0
- package/lib/components/AppFrame/index.d.ts +3 -0
- package/lib/components/AppFrame/index.d.ts.map +1 -0
- package/lib/components/Avatar/Avatar.d.ts +20 -8
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/BlockCard/BlockCard.d.ts +77 -11
- package/lib/components/BlockCard/BlockCard.d.ts.map +1 -1
- package/lib/components/BlockCard/index.d.ts +1 -1
- package/lib/components/BlockCard/index.d.ts.map +1 -1
- package/lib/components/Button/Button.d.ts +45 -26
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/ButtonIcon/ButtonIcon.d.ts +18 -17
- package/lib/components/ButtonIcon/ButtonIcon.d.ts.map +1 -1
- package/lib/components/Chart/Chart.d.ts +142 -0
- package/lib/components/Chart/Chart.d.ts.map +1 -0
- package/lib/components/Chart/index.d.ts +3 -0
- package/lib/components/Chart/index.d.ts.map +1 -0
- package/lib/components/Checkbox/Checkbox.d.ts +25 -33
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.context.d.ts +2 -0
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.context.d.ts.map +1 -1
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +23 -5
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
- package/lib/components/Checkbox/ChoiceText.d.ts +17 -0
- package/lib/components/Checkbox/ChoiceText.d.ts.map +1 -0
- package/lib/components/Checkbox/index.d.ts +0 -1
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/ColorField/ColorField.d.ts +15 -13
- package/lib/components/ColorField/ColorField.d.ts.map +1 -1
- package/lib/components/ColorField/index.d.ts +1 -1
- package/lib/components/ColorField/index.d.ts.map +1 -1
- package/lib/components/DatePicker/DatePicker.d.ts +13 -5
- package/lib/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/components/DatePicker/components/Calendar/Calendar.d.ts +24 -3
- package/lib/components/DatePicker/components/Calendar/Calendar.d.ts.map +1 -1
- package/lib/components/DatePicker/components/Day/Day.d.ts +11 -10
- package/lib/components/DatePicker/components/Day/Day.d.ts.map +1 -1
- package/lib/components/DatePicker/components/Month/Month.d.ts +21 -17
- package/lib/components/DatePicker/components/Month/Month.d.ts.map +1 -1
- package/lib/components/DatePicker/components/MonthGrid/MonthGrid.d.ts +32 -0
- package/lib/components/DatePicker/components/MonthGrid/MonthGrid.d.ts.map +1 -0
- package/lib/components/DatePicker/components/MonthGrid/index.d.ts +3 -0
- package/lib/components/DatePicker/components/MonthGrid/index.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Weekday/Weekday.d.ts +4 -3
- package/lib/components/DatePicker/components/Weekday/Weekday.d.ts.map +1 -1
- package/lib/components/DatePicker/components/index.d.ts +1 -0
- package/lib/components/DatePicker/components/index.d.ts.map +1 -1
- package/lib/components/DatePicker/utils/index.d.ts +339 -17
- package/lib/components/DatePicker/utils/index.d.ts.map +1 -1
- package/lib/components/DatePicker/utils/types.d.ts +4 -2
- package/lib/components/DatePicker/utils/types.d.ts.map +1 -1
- package/lib/components/DescriptiveList/DescriptiveList.d.ts +10 -11
- package/lib/components/DescriptiveList/DescriptiveList.d.ts.map +1 -1
- package/lib/components/DescriptiveList/DescriptiveListItem.d.ts +10 -4
- package/lib/components/DescriptiveList/DescriptiveListItem.d.ts.map +1 -1
- package/lib/components/DropdownCard/DropdownCard.context.d.ts +5 -2
- package/lib/components/DropdownCard/DropdownCard.context.d.ts.map +1 -1
- package/lib/components/DropdownCard/DropdownCard.d.ts +15 -13
- package/lib/components/DropdownCard/DropdownCard.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/DropdownCardActions.d.ts +4 -3
- package/lib/components/DropdownCard/components/DropdownCardActions.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/DropdownCardContent.d.ts +4 -3
- package/lib/components/DropdownCard/components/DropdownCardContent.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/DropdownCardDropdown.d.ts +12 -3
- package/lib/components/DropdownCard/components/DropdownCardDropdown.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/DropdownCardTabs.d.ts +44 -0
- package/lib/components/DropdownCard/components/DropdownCardTabs.d.ts.map +1 -0
- package/lib/components/DropdownCard/components/DropdownCardTrigger.d.ts +4 -6
- package/lib/components/DropdownCard/components/DropdownCardTrigger.d.ts.map +1 -1
- package/lib/components/DropdownCard/components/index.d.ts +1 -0
- package/lib/components/DropdownCard/components/index.d.ts.map +1 -1
- package/lib/components/Field/Field.d.ts +47 -0
- package/lib/components/Field/Field.d.ts.map +1 -0
- package/lib/components/Field/index.d.ts +3 -0
- package/lib/components/Field/index.d.ts.map +1 -0
- package/lib/components/FileField/FileField.d.ts +20 -11
- package/lib/components/FileField/FileField.d.ts.map +1 -1
- package/lib/components/FileField/index.d.ts +1 -1
- package/lib/components/FileField/index.d.ts.map +1 -1
- package/lib/components/FormActions/FormActions.d.ts +9 -0
- package/lib/components/FormActions/FormActions.d.ts.map +1 -0
- package/lib/components/FormActions/index.d.ts +3 -0
- package/lib/components/FormActions/index.d.ts.map +1 -0
- package/lib/components/HyperlinkCard/HyperlinkCard.d.ts +11 -8
- package/lib/components/HyperlinkCard/HyperlinkCard.d.ts.map +1 -1
- package/lib/components/Icon/Icon.d.ts +14 -13
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/IconBadge/IconBadge.d.ts +24 -0
- package/lib/components/IconBadge/IconBadge.d.ts.map +1 -0
- package/lib/components/IconBadge/index.d.ts +3 -0
- package/lib/components/IconBadge/index.d.ts.map +1 -0
- package/lib/components/Loader/Loader.d.ts +17 -6
- package/lib/components/Loader/Loader.d.ts.map +1 -1
- package/lib/components/Loader/index.d.ts +1 -1
- package/lib/components/Loader/index.d.ts.map +1 -1
- package/lib/components/Modal/Modal.d.ts +4 -6
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/ModalProvider/ModalProviderFooter.d.ts.map +1 -1
- package/lib/components/Modal/ModalProvider/index.d.ts.map +1 -1
- package/lib/components/Modal/index.d.ts +1 -1
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/types/index.d.ts +36 -15
- package/lib/components/Modal/types/index.d.ts.map +1 -1
- package/lib/components/Modal/utils/index.d.ts +0 -1
- package/lib/components/Modal/utils/index.d.ts.map +1 -1
- package/lib/components/Modal/utils/reducer.d.ts +286 -6
- package/lib/components/Modal/utils/reducer.d.ts.map +1 -1
- package/lib/components/Modal/utils/useModal.d.ts +3 -2
- package/lib/components/Modal/utils/useModal.d.ts.map +1 -1
- package/lib/components/Page/Breadcrumbs.d.ts +20 -0
- package/lib/components/Page/Breadcrumbs.d.ts.map +1 -0
- package/lib/components/Page/Page.d.ts +61 -27
- package/lib/components/Page/Page.d.ts.map +1 -1
- package/lib/components/Page/index.d.ts +3 -1
- package/lib/components/Page/index.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +22 -20
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/Pagination/index.d.ts.map +1 -1
- package/lib/components/Progress/Progress.d.ts +29 -6
- package/lib/components/Progress/Progress.d.ts.map +1 -1
- package/lib/components/Progress/index.d.ts +1 -1
- package/lib/components/Progress/index.d.ts.map +1 -1
- package/lib/components/Radio/Radio.d.ts +19 -33
- package/lib/components/Radio/Radio.d.ts.map +1 -1
- package/lib/components/Radio/RadioGroup/RadioGroup.context.d.ts +2 -0
- package/lib/components/Radio/RadioGroup/RadioGroup.context.d.ts.map +1 -1
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +22 -18
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/lib/components/RangeField/RangeField.d.ts +8 -15
- package/lib/components/RangeField/RangeField.d.ts.map +1 -1
- package/lib/components/Select/Select.d.ts +45 -43
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Sidebar/Sidebar.d.ts +48 -25
- package/lib/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/components/Sidebar/components/Back.d.ts +14 -0
- package/lib/components/Sidebar/components/Back.d.ts.map +1 -0
- package/lib/components/Sidebar/components/Menu.d.ts +9 -14
- package/lib/components/Sidebar/components/Menu.d.ts.map +1 -1
- package/lib/components/Sidebar/components/MenuItem.d.ts +18 -15
- package/lib/components/Sidebar/components/MenuItem.d.ts.map +1 -1
- package/lib/components/Sidebar/components/Section.d.ts +6 -6
- package/lib/components/Sidebar/components/Section.d.ts.map +1 -1
- package/lib/components/Sidebar/components/SubMenu.d.ts +6 -8
- package/lib/components/Sidebar/components/SubMenu.d.ts.map +1 -1
- package/lib/components/Sidebar/index.d.ts +1 -1
- package/lib/components/Sidebar/index.d.ts.map +1 -1
- package/lib/components/Spinner/Spinner.d.ts +12 -5
- package/lib/components/Spinner/Spinner.d.ts.map +1 -1
- package/lib/components/Spinner/index.d.ts +1 -1
- package/lib/components/Spinner/index.d.ts.map +1 -1
- package/lib/components/StatCard/StatCard.d.ts +31 -11
- package/lib/components/StatCard/StatCard.d.ts.map +1 -1
- package/lib/components/StatCard/index.d.ts +1 -1
- package/lib/components/StatCard/index.d.ts.map +1 -1
- package/lib/components/Switch/Switch.d.ts +14 -15
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Table/Table.d.ts +54 -25
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.types.d.ts +1 -1
- package/lib/components/Table/Table.types.d.ts.map +1 -1
- package/lib/components/Table/components/Checkbox/index.d.ts +7 -3
- package/lib/components/Table/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Table/components/TableBody.d.ts +2 -2
- package/lib/components/Table/components/TableBody.d.ts.map +1 -1
- package/lib/components/Table/components/TableCell.d.ts +7 -3
- package/lib/components/Table/components/TableCell.d.ts.map +1 -1
- package/lib/components/Table/components/TableGroup.d.ts +16 -0
- package/lib/components/Table/components/TableGroup.d.ts.map +1 -0
- package/lib/components/Table/components/TableHead.d.ts +8 -2
- package/lib/components/Table/components/TableHead.d.ts.map +1 -1
- package/lib/components/Table/components/TableHeadCell.d.ts +24 -5
- package/lib/components/Table/components/TableHeadCell.d.ts.map +1 -1
- package/lib/components/Table/components/TablePagination.d.ts +3 -1
- package/lib/components/Table/components/TablePagination.d.ts.map +1 -1
- package/lib/components/Table/components/TableProvider/TableProvider.d.ts +1 -2
- package/lib/components/Table/components/TableProvider/TableProvider.d.ts.map +1 -1
- package/lib/components/Table/components/TableRow.d.ts +8 -2
- package/lib/components/Table/components/TableRow.d.ts.map +1 -1
- package/lib/components/Table/index.d.ts +3 -3
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/labels.d.ts +23 -0
- package/lib/components/Table/labels.d.ts.map +1 -0
- package/lib/components/Table/utils/table/types.d.ts +6 -11
- package/lib/components/Table/utils/table/types.d.ts.map +1 -1
- package/lib/components/Table/utils/useSelectableResourceState/index.d.ts +1 -2
- package/lib/components/Table/utils/useSelectableResourceState/index.d.ts.map +1 -1
- package/lib/components/Tag/Tag.d.ts +42 -15
- package/lib/components/Tag/Tag.d.ts.map +1 -1
- package/lib/components/Tag/TagGroup.d.ts +3 -3
- package/lib/components/Tag/TagGroup.d.ts.map +1 -1
- package/lib/components/Tag/index.d.ts +1 -1
- package/lib/components/Tag/index.d.ts.map +1 -1
- package/lib/components/TextField/TextField.d.ts +11 -27
- package/lib/components/TextField/TextField.d.ts.map +1 -1
- package/lib/components/Textarea/Textarea.d.ts +10 -26
- package/lib/components/Textarea/Textarea.d.ts.map +1 -1
- package/lib/components/Thumbnail/Thumbnail.d.ts +11 -7
- package/lib/components/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.d.ts +26 -0
- package/lib/components/Timeline/Timeline.d.ts.map +1 -0
- package/lib/components/Timeline/TimelineGroup.d.ts +15 -0
- package/lib/components/Timeline/TimelineGroup.d.ts.map +1 -0
- package/lib/components/Timeline/TimelineItem.d.ts +19 -0
- package/lib/components/Timeline/TimelineItem.d.ts.map +1 -0
- package/lib/components/Timeline/index.d.ts +5 -0
- package/lib/components/Timeline/index.d.ts.map +1 -0
- package/lib/components/Toast/Toast.d.ts +20 -10
- package/lib/components/Toast/Toast.d.ts.map +1 -1
- package/lib/components/Toast/Toasts.context.d.ts +15 -2
- package/lib/components/Toast/Toasts.context.d.ts.map +1 -1
- package/lib/components/Toast/ToastsContainer/index.d.ts.map +1 -1
- package/lib/components/Toast/ToastsProvider/index.d.ts +1 -3
- package/lib/components/Toast/ToastsProvider/index.d.ts.map +1 -1
- package/lib/components/Toast/index.d.ts +3 -5
- package/lib/components/Toast/index.d.ts.map +1 -1
- package/lib/components/Toast/store.d.ts +30 -0
- package/lib/components/Toast/store.d.ts.map +1 -0
- package/lib/components/Toast/types.d.ts +8 -5
- package/lib/components/Toast/types.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +29 -23
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/TooltipCallout.d.ts +31 -0
- package/lib/components/Tooltip/TooltipCallout.d.ts.map +1 -0
- package/lib/components/Tooltip/useTooltip.d.ts +16 -27
- package/lib/components/Tooltip/useTooltip.d.ts.map +1 -1
- package/lib/components/Visualizer/Visualizer.d.ts +19 -8
- package/lib/components/Visualizer/Visualizer.d.ts.map +1 -1
- package/lib/components/Visualizer/index.d.ts +1 -1
- package/lib/components/Visualizer/index.d.ts.map +1 -1
- package/lib/index.d.ts +134 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/showcase/chartData.d.ts +29 -0
- package/lib/showcase/chartData.d.ts.map +1 -0
- package/lib/tokens/tokens.d.ts +1528 -0
- package/lib/tokens/tokens.d.ts.map +1 -0
- package/lib/types.d.ts +4 -29
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/Slot/index.d.ts +11 -0
- package/lib/utils/Slot/index.d.ts.map +1 -0
- package/lib/utils/classNames/index.d.ts +3 -1
- package/lib/utils/classNames/index.d.ts.map +1 -1
- package/lib/utils/getElementRef/index.d.ts +9 -0
- package/lib/utils/getElementRef/index.d.ts.map +1 -0
- package/lib/utils/index.d.ts +4 -7
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/toPercent/index.d.ts +3 -0
- package/lib/utils/toPercent/index.d.ts.map +1 -0
- package/lib/utils/useControllableState/index.d.ts +19 -0
- package/lib/utils/useControllableState/index.d.ts.map +1 -0
- package/lib/utils/useDropdown/DropdownTrigger.d.ts +12 -0
- package/lib/utils/useDropdown/DropdownTrigger.d.ts.map +1 -0
- package/lib/utils/useDropdown/index.d.ts +30 -6
- package/lib/utils/useDropdown/index.d.ts.map +1 -1
- package/lib/utils/useImageFallback/index.d.ts +15 -0
- package/lib/utils/useImageFallback/index.d.ts.map +1 -0
- package/package.json +23 -11
- package/roaster.css +1 -0
- package/roaster.css.d.ts +2 -0
- package/themes/azoth.css +1 -0
- package/themes/azoth.css.d.ts +2 -0
- package/themes/coffee.css +1 -0
- package/themes/coffee.css.d.ts +2 -0
- package/themes/scalar.css +1 -0
- package/themes/scalar.css.d.ts +2 -0
- package/cjs/components/ActionList/useDropdown.js +0 -47
- package/cjs/components/ActionList/useDropdown.js.map +0 -1
- package/cjs/components/Modal/utils/events.js +0 -19
- package/cjs/components/Modal/utils/events.js.map +0 -1
- package/cjs/components/Toast/ToastsProvider/useToastsState/useToastsState.js +0 -55
- package/cjs/components/Toast/ToastsProvider/useToastsState/useToastsState.js.map +0 -1
- package/cjs/components/Toast/events.js +0 -20
- package/cjs/components/Toast/events.js.map +0 -1
- package/cjs/components/Visualizer/Visualizer.context.js +0 -12
- package/cjs/components/Visualizer/Visualizer.context.js.map +0 -1
- package/cjs/components/Visualizer/VisualizerMobileOpener.js +0 -28
- package/cjs/components/Visualizer/VisualizerMobileOpener.js.map +0 -1
- package/cjs/utils/createUseExternalEvents/index.js +0 -32
- package/cjs/utils/createUseExternalEvents/index.js.map +0 -1
- package/cjs/utils/useIsomorphicEffect/index.js +0 -22
- package/cjs/utils/useIsomorphicEffect/index.js.map +0 -1
- package/cjs/utils/useQueue/index.js +0 -36
- package/cjs/utils/useQueue/index.js.map +0 -1
- package/cjs/utils/useUncontrolled/index.js +0 -25
- package/cjs/utils/useUncontrolled/index.js.map +0 -1
- package/esm/components/ActionList/useDropdown.js +0 -45
- package/esm/components/ActionList/useDropdown.js.map +0 -1
- package/esm/components/Modal/utils/events.js +0 -13
- package/esm/components/Modal/utils/events.js.map +0 -1
- package/esm/components/Toast/ToastsProvider/useToastsState/useToastsState.js +0 -51
- package/esm/components/Toast/ToastsProvider/useToastsState/useToastsState.js.map +0 -1
- package/esm/components/Toast/events.js +0 -12
- package/esm/components/Toast/events.js.map +0 -1
- package/esm/components/Visualizer/Visualizer.context.js +0 -9
- package/esm/components/Visualizer/Visualizer.context.js.map +0 -1
- package/esm/components/Visualizer/VisualizerMobileOpener.js +0 -13
- package/esm/components/Visualizer/VisualizerMobileOpener.js.map +0 -1
- package/esm/utils/createUseExternalEvents/index.js +0 -30
- package/esm/utils/createUseExternalEvents/index.js.map +0 -1
- package/esm/utils/useIsomorphicEffect/index.js +0 -7
- package/esm/utils/useIsomorphicEffect/index.js.map +0 -1
- package/esm/utils/useQueue/index.js +0 -34
- package/esm/utils/useQueue/index.js.map +0 -1
- package/esm/utils/useUncontrolled/index.js +0 -23
- package/esm/utils/useUncontrolled/index.js.map +0 -1
- package/lib/components/ActionList/useDropdown.d.ts +0 -57
- package/lib/components/ActionList/useDropdown.d.ts.map +0 -1
- package/lib/components/CodeBlock/CodeBlock.d.ts +0 -16
- package/lib/components/CodeBlock/CodeBlock.d.ts.map +0 -1
- package/lib/components/CodeBlock/index.d.ts +0 -2
- package/lib/components/CodeBlock/index.d.ts.map +0 -1
- package/lib/components/Modal/utils/events.d.ts +0 -9
- package/lib/components/Modal/utils/events.d.ts.map +0 -1
- package/lib/components/Toast/ToastsProvider/useToastsState/useToastsState.d.ts +0 -13
- package/lib/components/Toast/ToastsProvider/useToastsState/useToastsState.d.ts.map +0 -1
- package/lib/components/Toast/events.d.ts +0 -37
- package/lib/components/Toast/events.d.ts.map +0 -1
- package/lib/components/Visualizer/Visualizer.context.d.ts +0 -14
- package/lib/components/Visualizer/Visualizer.context.d.ts.map +0 -1
- package/lib/components/Visualizer/VisualizerMobileOpener.d.ts +0 -7
- package/lib/components/Visualizer/VisualizerMobileOpener.d.ts.map +0 -1
- package/lib/components/index.d.ts +0 -36
- package/lib/components/index.d.ts.map +0 -1
- package/lib/utils/createUseExternalEvents/index.d.ts +0 -14
- package/lib/utils/createUseExternalEvents/index.d.ts.map +0 -1
- package/lib/utils/useDidUpdate/index.d.ts +0 -30
- package/lib/utils/useDidUpdate/index.d.ts.map +0 -1
- package/lib/utils/useEventListener/index.d.ts +0 -7
- package/lib/utils/useEventListener/index.d.ts.map +0 -1
- package/lib/utils/useForceUpdate/index.d.ts +0 -28
- package/lib/utils/useForceUpdate/index.d.ts.map +0 -1
- package/lib/utils/useIsomorphicEffect/index.d.ts +0 -21
- package/lib/utils/useIsomorphicEffect/index.d.ts.map +0 -1
- package/lib/utils/useQueue/index.d.ts +0 -65
- package/lib/utils/useQueue/index.d.ts.map +0 -1
- package/lib/utils/useUncontrolled/index.d.ts +0 -38
- package/lib/utils/useUncontrolled/index.d.ts.map +0 -1
- package/theme.css +0 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useListItem, useFloating, autoUpdate, offset, flip, shift, useInteractions, useClick, useRole, useDismiss, useListNavigation, useTypeahead, useMergeRefs, FloatingFocusManager, FloatingList } from '@floating-ui/react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { Icon } from '../../Icon/Icon.js';
|
|
6
|
+
import { useActionListContext, ActionListProvider } from '../ActionList.context.js';
|
|
7
|
+
import { readLengthToken } from '../../../utils/useDropdown/index.js';
|
|
8
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
9
|
+
|
|
10
|
+
const ActionListSubmenu = React.forwardRef(
|
|
11
|
+
({ label, detail, children, placement = "right-start", className, type = "button", ...rest }, propRef) => {
|
|
12
|
+
const parent = useActionListContext();
|
|
13
|
+
const item = useListItem();
|
|
14
|
+
const [open, setOpen] = React.useState(false);
|
|
15
|
+
const elementsRef = React.useRef([]);
|
|
16
|
+
const labelsRef = React.useRef([]);
|
|
17
|
+
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
18
|
+
const data = useFloating({
|
|
19
|
+
placement,
|
|
20
|
+
strategy: "fixed",
|
|
21
|
+
transform: false,
|
|
22
|
+
open,
|
|
23
|
+
onOpenChange: setOpen,
|
|
24
|
+
whileElementsMounted: autoUpdate,
|
|
25
|
+
middleware: [
|
|
26
|
+
// As far from its item as the menu is from its button, past the menu's padding.
|
|
27
|
+
offset(
|
|
28
|
+
({ elements }) => readLengthToken(elements.floating, "--roaster-action-list-offset", 8) + readLengthToken(elements.floating, "--roaster-action-list-padding", 0)
|
|
29
|
+
),
|
|
30
|
+
flip(),
|
|
31
|
+
shift({ padding: 8 })
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
const { context } = data;
|
|
35
|
+
const interactions = useInteractions([
|
|
36
|
+
useClick(context),
|
|
37
|
+
useRole(context, { role: "menu" }),
|
|
38
|
+
useDismiss(context),
|
|
39
|
+
useListNavigation(context, {
|
|
40
|
+
listRef: elementsRef,
|
|
41
|
+
activeIndex,
|
|
42
|
+
onNavigate: setActiveIndex,
|
|
43
|
+
loop: true,
|
|
44
|
+
nested: true,
|
|
45
|
+
focusItemOnOpen: true
|
|
46
|
+
}),
|
|
47
|
+
useTypeahead(context, { listRef: labelsRef, activeIndex, onMatch: open ? setActiveIndex : void 0 })
|
|
48
|
+
]);
|
|
49
|
+
const parentSetOpen = parent.setOpen;
|
|
50
|
+
const submenu = React.useMemo(
|
|
51
|
+
() => ({
|
|
52
|
+
...data,
|
|
53
|
+
...interactions,
|
|
54
|
+
open,
|
|
55
|
+
activeIndex,
|
|
56
|
+
elementsRef,
|
|
57
|
+
labelsRef,
|
|
58
|
+
setOpen: (next) => {
|
|
59
|
+
const value = typeof next === "function" ? next(open) : next;
|
|
60
|
+
setOpen(value);
|
|
61
|
+
if (!value) parentSetOpen(false);
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
[data, interactions, open, activeIndex, parentSetOpen]
|
|
65
|
+
);
|
|
66
|
+
const triggerRef = useMergeRefs([item.ref, data.refs.setReference, propRef]);
|
|
67
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsxs(
|
|
69
|
+
"button",
|
|
70
|
+
{
|
|
71
|
+
...parent.getItemProps(interactions.getReferenceProps(rest)),
|
|
72
|
+
ref: triggerRef,
|
|
73
|
+
type,
|
|
74
|
+
role: "menuitem",
|
|
75
|
+
"aria-haspopup": "menu",
|
|
76
|
+
tabIndex: parent.activeIndex === item.index ? 0 : -1,
|
|
77
|
+
className: classNames("roaster-action-list__item", className),
|
|
78
|
+
children: [
|
|
79
|
+
label,
|
|
80
|
+
detail != null && detail !== false && /* @__PURE__ */ jsx("span", { className: "roaster-action-list__detail", children: detail }),
|
|
81
|
+
/* @__PURE__ */ jsx(Icon, { name: "chevron-right" })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
open && /* @__PURE__ */ jsx(FloatingFocusManager, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
ref: data.refs.setFloating,
|
|
89
|
+
...interactions.getFloatingProps({
|
|
90
|
+
onKeyDown(event) {
|
|
91
|
+
if (event.key === "Tab") return;
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
if (event.key === "Escape") {
|
|
94
|
+
setOpen(false);
|
|
95
|
+
data.refs.domReference.current?.focus();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
className: "roaster-action-list roaster-action-list--submenu roaster-action-list--floating",
|
|
100
|
+
style: data.floatingStyles,
|
|
101
|
+
children: /* @__PURE__ */ jsx(ActionListProvider, { value: submenu, children: /* @__PURE__ */ jsx(FloatingList, { elementsRef, labelsRef, children }) })
|
|
102
|
+
}
|
|
103
|
+
) })
|
|
104
|
+
] });
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
ActionListSubmenu.displayName = "ActionListSubmenu";
|
|
108
|
+
|
|
109
|
+
export { ActionListSubmenu };
|
|
110
|
+
//# sourceMappingURL=ActionListSubmenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionListSubmenu.js","sources":["../../../../../src/components/ActionList/components/ActionListSubmenu.tsx"],"sourcesContent":["import {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n offset,\n type Placement,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useRole,\n useTypeahead,\n} from '@floating-ui/react';\nimport * as React from 'react';\nimport { classNames, readLengthToken } from '@/utils';\nimport { Icon } from '../../Icon';\nimport { ActionListProvider, useActionListContext } from '../ActionList.context';\n\n/** Every native `<button>` prop is accepted and forwarded to the item that opens the submenu. */\nexport interface ActionListSubmenuProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'children'> {\n /** The item that opens the submenu: its text, with an optional icon. */\n label: React.ReactNode;\n /** A short text before the item's chevron, such as the current choice. */\n detail?: React.ReactNode;\n /** The submenu's groups, dividers and items, as in ActionList.Dropdown. */\n children: React.ReactNode;\n /**\n * Where the submenu opens. It moves to the other side when there is no room.\n * @defaultValue 'right-start'\n */\n placement?: Placement;\n}\n\n/**\n * An item that opens a submenu beside it, such as a setting's choices: on click, Enter, or the right arrow (the left\n * arrow and Escape close it). The item names the submenu. Choosing an item of the submenu closes it and its menu.\n */\nexport const ActionListSubmenu = React.forwardRef<HTMLButtonElement, ActionListSubmenuProps>(\n ({ label, detail, children, placement = 'right-start', className, type = 'button', ...rest }, propRef) => {\n const parent = useActionListContext();\n const item = useListItem();\n const [open, setOpen] = React.useState(false);\n const elementsRef = React.useRef<Array<HTMLElement | null>>([]);\n const labelsRef = React.useRef<Array<string | null>>([]);\n const [activeIndex, setActiveIndex] = React.useState<number | null>(null);\n\n const data = useFloating({\n placement,\n strategy: 'fixed',\n transform: false,\n open,\n onOpenChange: setOpen,\n whileElementsMounted: autoUpdate,\n middleware: [\n // As far from its item as the menu is from its button, past the menu's padding.\n offset(\n ({ elements }) =>\n readLengthToken(elements.floating, '--roaster-action-list-offset', 8) +\n readLengthToken(elements.floating, '--roaster-action-list-padding', 0)\n ),\n flip(),\n shift({ padding: 8 }),\n ],\n });\n const { context } = data;\n const interactions = useInteractions([\n useClick(context),\n useRole(context, { role: 'menu' }),\n useDismiss(context),\n useListNavigation(context, {\n listRef: elementsRef,\n activeIndex,\n onNavigate: setActiveIndex,\n loop: true,\n nested: true,\n focusItemOnOpen: true,\n }),\n useTypeahead(context, { listRef: labelsRef, activeIndex, onMatch: open ? setActiveIndex : undefined }),\n ]);\n\n // The submenu's items close it and the menu it came from.\n const parentSetOpen = parent.setOpen;\n const submenu = React.useMemo(\n () => ({\n ...data,\n ...interactions,\n open,\n activeIndex,\n elementsRef,\n labelsRef,\n setOpen: (next: boolean | ((previous: boolean) => boolean)) => {\n const value = typeof next === 'function' ? next(open) : next;\n setOpen(value);\n if (!value) parentSetOpen(false);\n },\n }),\n [data, interactions, open, activeIndex, parentSetOpen]\n );\n\n const triggerRef = useMergeRefs([item.ref, data.refs.setReference, propRef]);\n\n return (\n <>\n <button\n {...parent.getItemProps(interactions.getReferenceProps(rest))}\n ref={triggerRef}\n type={type}\n role=\"menuitem\"\n aria-haspopup=\"menu\"\n tabIndex={parent.activeIndex === item.index ? 0 : -1}\n className={classNames('roaster-action-list__item', className)}\n >\n {label}\n {detail != null && detail !== false && <span className=\"roaster-action-list__detail\">{detail}</span>}\n <Icon name=\"chevron-right\" />\n </button>\n {open && (\n <FloatingFocusManager context={context} modal={false} initialFocus={-1}>\n <div\n ref={data.refs.setFloating}\n {...interactions.getFloatingProps({\n onKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n // Its keys are its own: the menu around it doesn't move, nor close on Escape, which closes only\n // the submenu. Tab goes on to close both.\n if (event.key === 'Tab') return;\n event.stopPropagation();\n if (event.key === 'Escape') {\n setOpen(false);\n (data.refs.domReference.current as HTMLElement | null)?.focus();\n }\n },\n })}\n className=\"roaster-action-list roaster-action-list--submenu roaster-action-list--floating\"\n style={data.floatingStyles}\n >\n <ActionListProvider value={submenu}>\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {children}\n </FloatingList>\n </ActionListProvider>\n </div>\n </FloatingFocusManager>\n )}\n </>\n );\n }\n);\nActionListSubmenu.displayName = 'ActionListSubmenu';\n"],"names":[],"mappings":";;;;;;;;;AAuBY,MAAC,iBAAiB,GAAG,KAAK,CAAC,UAAU;AACjD,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,aAAa,EAAE,SAAS,EAAE,IAAI,GAAG,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,OAAO,KAAK;AAC5G,IAAI,MAAM,MAAM,GAAG,oBAAoB,EAAE;AACzC,IAAI,MAAM,IAAI,GAAG,WAAW,EAAE;AAC9B,IAAI,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AACjD,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;AACxC,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;AACtC,IAAI,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC9D,IAAI,MAAM,IAAI,GAAG,WAAW,CAAC;AAC7B,MAAM,SAAS;AACf,MAAM,QAAQ,EAAE,OAAO;AACvB,MAAM,SAAS,EAAE,KAAK;AACtB,MAAM,IAAI;AACV,MAAM,YAAY,EAAE,OAAO;AAC3B,MAAM,oBAAoB,EAAE,UAAU;AACtC,MAAM,UAAU,EAAE;AAClB;AACA,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,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,kBAAkB,GAAG;AAChI,QAAQ,KAAK;AACb,QAAQ;AACR,UAAU,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW;AACpC,UAAU,GAAG,YAAY,CAAC,gBAAgB,CAAC;AAC3C,YAAY,SAAS,CAAC,KAAK,EAAE;AAC7B,cAAc,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,EAAE;AACvC,cAAc,KAAK,CAAC,eAAe,EAAE;AACrC,cAAc,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE;AAC1C,gBAAgB,OAAO,CAAC,KAAK,CAAC;AAC9B,gBAAgB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE;AACvD,cAAc;AACd,YAAY;AACZ,WAAW,CAAC;AACZ,UAAU,SAAS,EAAE,gFAAgF;AACrG,UAAU,KAAK,EAAE,IAAI,CAAC,cAAc;AACpC,UAAU,QAAQ,kBAAkB,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,kBAAkB,GAAG,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE;AACjK;AACA,OAAO,EAAE;AACT,KAAK,EAAE,CAAC;AACR,EAAE;AACF;AACA,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useListItem, useMergeRefs } from '@floating-ui/react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useActionListContext } from '../ActionList.context.js';
|
|
6
|
+
import { useControllableState } from '../../../utils/useControllableState/index.js';
|
|
7
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
8
|
+
|
|
9
|
+
const ActionListSwitchItem = React.forwardRef(
|
|
10
|
+
({ children, checked, defaultChecked, onChange, onCheckedChange, className, style, ...rest }, propRef) => {
|
|
11
|
+
const context = useActionListContext();
|
|
12
|
+
const item = useListItem();
|
|
13
|
+
const ref = useMergeRefs([item.ref, propRef]);
|
|
14
|
+
const [on, setOn] = useControllableState({
|
|
15
|
+
value: checked,
|
|
16
|
+
defaultValue: defaultChecked ?? false,
|
|
17
|
+
onChange: onCheckedChange
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ jsxs("label", { className: classNames("roaster-action-list__item", className), style, children: [
|
|
20
|
+
children,
|
|
21
|
+
/* @__PURE__ */ jsxs("span", { className: "roaster-switch", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
"input",
|
|
24
|
+
{
|
|
25
|
+
...context.getItemProps({
|
|
26
|
+
...rest,
|
|
27
|
+
onChange(event) {
|
|
28
|
+
onChange?.(event);
|
|
29
|
+
setOn(event.target.checked);
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
ref,
|
|
33
|
+
type: "checkbox",
|
|
34
|
+
role: "menuitemcheckbox",
|
|
35
|
+
checked: on,
|
|
36
|
+
"aria-checked": on,
|
|
37
|
+
tabIndex: context.activeIndex === item.index ? 0 : -1,
|
|
38
|
+
className: "roaster-switch__input"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsx("span", { className: "roaster-switch__track" })
|
|
42
|
+
] })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
ActionListSwitchItem.displayName = "ActionListSwitchItem";
|
|
47
|
+
|
|
48
|
+
export { ActionListSwitchItem };
|
|
49
|
+
//# sourceMappingURL=ActionListSwitchItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionListSwitchItem.js","sources":["../../../../../src/components/ActionList/components/ActionListSwitchItem.tsx"],"sourcesContent":["import { useListItem, useMergeRefs } from '@floating-ui/react';\nimport * as React from 'react';\nimport { classNames, useControllableState } from '@/utils';\nimport { useActionListContext } from '../ActionList.context';\n\n/**\n * Every native `<input>` prop (`name`, `aria-*`, ...) is accepted and forwarded to the switch, with the ref.\n * `className` and `style` go to the item.\n */\nexport interface ActionListSwitchItemProps extends Omit<\n React.ComponentPropsWithoutRef<'input'>,\n 'type' | 'children' | 'role'\n> {\n /** The setting's name, with an optional icon before it. */\n children: React.ReactNode;\n /** Called with the new state when the user turns the setting on or off. */\n onCheckedChange?(checked: boolean): void;\n}\n\n/**\n * An on/off setting in the menu (`role=\"menuitemcheckbox\"`), drawn as a switch at the item's end, such as showing a\n * chart. Turning it on or off leaves the menu open.\n */\nexport const ActionListSwitchItem = React.forwardRef<HTMLInputElement, ActionListSwitchItemProps>(\n ({ children, checked, defaultChecked, onChange, onCheckedChange, className, style, ...rest }, propRef) => {\n const context = useActionListContext();\n const item = useListItem();\n const ref = useMergeRefs([item.ref, propRef]);\n const [on, setOn] = useControllableState({\n value: checked,\n defaultValue: defaultChecked ?? false,\n onChange: onCheckedChange,\n });\n\n return (\n <label className={classNames('roaster-action-list__item', className)} style={style}>\n {children}\n <span className=\"roaster-switch\">\n <input\n {...context.getItemProps({\n ...rest,\n onChange(event: React.ChangeEvent<HTMLInputElement>) {\n onChange?.(event);\n setOn(event.target.checked);\n },\n })}\n ref={ref}\n type=\"checkbox\"\n role=\"menuitemcheckbox\"\n checked={on}\n aria-checked={on}\n tabIndex={context.activeIndex === item.index ? 0 : -1}\n className=\"roaster-switch__input\"\n />\n <span className=\"roaster-switch__track\" />\n </span>\n </label>\n );\n }\n);\nActionListSwitchItem.displayName = 'ActionListSwitchItem';\n"],"names":[],"mappings":";;;;;;;;AAMY,MAAC,oBAAoB,GAAG,KAAK,CAAC,UAAU;AACpD,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,OAAO,KAAK;AAC5G,IAAI,MAAM,OAA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T,KAAK,EAAE,CAAC;AACR,EAAE;AACF;AACA,oBAAoB,CAAC,WAAW,GAAG,sBAAsB;;"}
|
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import * as React from 'react';
|
|
2
|
+
import { createDropdownTrigger } from '../../../utils/useDropdown/DropdownTrigger.js';
|
|
4
3
|
import { useActionListContext } from '../ActionList.context.js';
|
|
5
4
|
|
|
6
|
-
const ActionListTrigger =
|
|
7
|
-
({ children, ...props }, propRef) => {
|
|
8
|
-
const context = useActionListContext();
|
|
9
|
-
const childrenRef = children.ref;
|
|
10
|
-
const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);
|
|
11
|
-
if (!React.isValidElement(children)) {
|
|
12
|
-
throw new Error(
|
|
13
|
-
"ActionList.Trigger component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
return React.cloneElement(
|
|
17
|
-
children,
|
|
18
|
-
context.getReferenceProps({
|
|
19
|
-
ref,
|
|
20
|
-
...props,
|
|
21
|
-
...children.props
|
|
22
|
-
})
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
ActionListTrigger.displayName = "ActionListTrigger";
|
|
5
|
+
const ActionListTrigger = createDropdownTrigger("ActionList", useActionListContext);
|
|
27
6
|
|
|
28
7
|
export { ActionListTrigger };
|
|
29
8
|
//# sourceMappingURL=ActionListTrigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListTrigger.js","sources":["../../../../../src/components/ActionList/components/ActionListTrigger.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ActionListTrigger.js","sources":["../../../../../src/components/ActionList/components/ActionListTrigger.tsx"],"sourcesContent":["import { createDropdownTrigger, type DropdownTriggerProps } from '@/utils/useDropdown/DropdownTrigger';\nimport { useActionListContext } from '../ActionList.context';\n\nexport type ActionListTriggerProps = DropdownTriggerProps;\n\n/** The element that opens the action list, such as a Button. */\nexport const ActionListTrigger = createDropdownTrigger('ActionList', useActionListContext);\n"],"names":[],"mappings":";;;;AAGY,MAAC,iBAAiB,GAAG,qBAAqB,CAAC,YAAY,EAAE,oBAAoB;;"}
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { ButtonIcon } from '../ButtonIcon/ButtonIcon.js';
|
|
5
|
+
import { Icon } from '../Icon/Icon.js';
|
|
4
6
|
import { classNames } from '../../utils/classNames/index.js';
|
|
5
7
|
|
|
8
|
+
const defaultAlertLabels = { close: "Close" };
|
|
6
9
|
const Alert = React.forwardRef((props, ref) => {
|
|
7
|
-
const {
|
|
8
|
-
|
|
10
|
+
const { children, closable = false, tone = "info", icon, onClose, labels, className, ...others } = props;
|
|
11
|
+
const text = { ...defaultAlertLabels, ...labels };
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
role: tone === "danger" || tone === "warning" ? "alert" : "status",
|
|
16
|
+
...others,
|
|
17
|
+
ref,
|
|
18
|
+
className: classNames("roaster-alert", `roaster-alert--${tone}`, className),
|
|
19
|
+
children: [
|
|
20
|
+
icon && /* @__PURE__ */ jsx("span", { className: "roaster-alert__icon", children: icon }),
|
|
21
|
+
/* @__PURE__ */ jsx("div", { className: "roaster-alert__content", children }),
|
|
22
|
+
closable && /* @__PURE__ */ jsx(ButtonIcon, { className: "roaster-alert__close", "aria-label": text.close, onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "xmark" }) })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
9
26
|
});
|
|
10
27
|
Alert.displayName = "Alert";
|
|
11
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { ButtonIcon } from '../ButtonIcon';\n\n/**
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Icon } from '@/components/Icon';\n\n/** The tones of an alert: its color, icon, and how urgently screen readers announce it. */\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger' | 'primary';\n\n/** The text of the alert, for other languages. */\nexport interface AlertLabels {\n /** The name of the close button, read by screen readers. */\n close: string;\n}\n\nconst defaultAlertLabels: AlertLabels = { close: 'Close' };\n\n/** Every native `<div>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface AlertProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The message: text, links, or blocks such as a list. */\n children: React.ReactNode;\n /**\n * The tone. `danger` and `warning` are announced at once (`role=\"alert\"`), `info`, `success` and `primary`\n * politely (`role=\"status\"`). `primary` is a prompt that asks for a decision, with its buttons in the message.\n * @defaultValue 'info'\n */\n tone?: AlertTone;\n /** An icon in place of the tone's, such as an `Icon`. */\n icon?: React.ReactNode;\n /** Shows a close button, which calls `onClose`. */\n closable?: boolean;\n /** Called when the close button is clicked. */\n onClose?(): void;\n /** The text of the alert, in English by default. */\n labels?: Partial<AlertLabels>;\n}\n\n/** A message banner in a tone (info, success, warning, danger, or primary for a prompt), with an optional close button. */\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>((props, ref) => {\n const { children, closable = false, tone = 'info', icon, onClose, labels, className, ...others } = props;\n const text = { ...defaultAlertLabels, ...labels };\n\n return (\n <div\n role={tone === 'danger' || tone === 'warning' ? 'alert' : 'status'}\n {...others}\n ref={ref}\n className={classNames('roaster-alert', `roaster-alert--${tone}`, className)}\n >\n {icon && <span className=\"roaster-alert__icon\">{icon}</span>}\n <div className=\"roaster-alert__content\">{children}</div>\n {closable && (\n <ButtonIcon className=\"roaster-alert__close\" aria-label={text.close} onClick={onClose}>\n <Icon name=\"xmark\" />\n </ButtonIcon>\n )}\n </div>\n );\n});\n\nAlert.displayName = 'Alert';\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;AACjC,MAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACtD,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AAC1G,EAAE,MAAM,IAAI,GAAG,EAAE,GAAG,kBAAkB,EAAE,GAAG,MAAM,EAAE;AACnD,EAAE,uBAAuB,IAAI;AAC7B,IAAI,KAAK;AACT,IAAI;AACJ,MAAM,IAAI,EAAE,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,GAAG,OAAO,GAAG,QAAQ;AACxE,MAAM,GAAG,MAAM;AACf,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC;AACjF,MAAM,QAAQ,EAAE;AAChB,QAAQ,IAAI,oBAAoB,GAAG,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjG,wBAAwB,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,QAAQ,EAAE,CAAC;AACrF,QAAQ,QAAQ,oBAAoB,GAAG,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,sBAAsB,EAAE,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;AAC7L;AACA;AACA,GAAG;AACH,CAAC;AACD,KAAK,CAAC,WAAW,GAAG,OAAO;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
5
|
+
|
|
6
|
+
const Layout = React.forwardRef(({ className, ...others }, ref) => /* @__PURE__ */ jsx("div", { ...others, ref, className: classNames("roaster-layout", className) }));
|
|
7
|
+
Layout.displayName = "Layout";
|
|
8
|
+
const Mainframe = React.forwardRef(
|
|
9
|
+
({ children, alerts, grid = false, className, ...others }, ref) => /* @__PURE__ */ jsxs(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
...others,
|
|
13
|
+
ref,
|
|
14
|
+
className: classNames("roaster-mainframe", { "roaster-mainframe--grid": grid }, className),
|
|
15
|
+
children: [
|
|
16
|
+
alerts && /* @__PURE__ */ jsx("section", { className: "roaster-mainframe__alerts", children: alerts }),
|
|
17
|
+
children
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
Mainframe.displayName = "Mainframe";
|
|
23
|
+
const HeaderMenu = React.forwardRef(({ className, ...others }, ref) => /* @__PURE__ */ jsx("header", { ...others, ref, className: classNames("roaster-header-menu", className) }));
|
|
24
|
+
HeaderMenu.displayName = "HeaderMenu";
|
|
25
|
+
const TopBar = React.forwardRef(
|
|
26
|
+
({ className, children, title, actions, ...others }, ref) => /* @__PURE__ */ jsxs("header", { ...others, ref, className: classNames("roaster-top-bar", className), children: [
|
|
27
|
+
title != null && title !== false && /* @__PURE__ */ jsx("h1", { className: "roaster-top-bar__title", children: title }),
|
|
28
|
+
children,
|
|
29
|
+
actions && /* @__PURE__ */ jsx("div", { className: "roaster-top-bar__actions", children: actions })
|
|
30
|
+
] })
|
|
31
|
+
);
|
|
32
|
+
TopBar.displayName = "TopBar";
|
|
33
|
+
const Footer = React.forwardRef(({ className, ...others }, ref) => /* @__PURE__ */ jsx("footer", { ...others, ref, className: classNames("roaster-footer", className) }));
|
|
34
|
+
Footer.displayName = "Footer";
|
|
35
|
+
|
|
36
|
+
export { Footer, HeaderMenu, Layout, Mainframe, TopBar };
|
|
37
|
+
//# sourceMappingURL=AppFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppFrame.js","sources":["../../../../src/components/AppFrame/AppFrame.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\n/** Every native `<div>` prop is accepted and forwarded to it. */\nexport type LayoutProps = React.ComponentPropsWithoutRef<'div'>;\n\n/** The page's layout wrapper: it holds the Sidebar (or a HeaderMenu) and the Mainframe. */\nexport const Layout = React.forwardRef<HTMLDivElement, LayoutProps>(({ className, ...others }, ref) => (\n <div {...others} ref={ref} className={classNames('roaster-layout', className)} />\n));\nLayout.displayName = 'Layout';\n\n/** Every native `<div>` prop is accepted and forwarded to it. */\nexport interface MainframeProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The content: the Page, and a Visualizer beside it when `grid` is set. */\n children?: React.ReactNode;\n /** Alerts about the whole app, above the page, such as an outdated payment. */\n alerts?: React.ReactNode;\n /**\n * Makes room for a Visualizer beside the page.\n * @defaultValue false\n */\n grid?: boolean;\n}\n\n/** The frame beside the sidebar: app-wide alerts, then the page (and a Visualizer, with `grid`). */\nexport const Mainframe = React.forwardRef<HTMLDivElement, MainframeProps>(\n ({ children, alerts, grid = false, className, ...others }, ref) => (\n <div\n {...others}\n ref={ref}\n className={classNames('roaster-mainframe', { 'roaster-mainframe--grid': grid }, className)}\n >\n {alerts && <section className=\"roaster-mainframe__alerts\">{alerts}</section>}\n {children}\n </div>\n )\n);\nMainframe.displayName = 'Mainframe';\n\n/** Every native `<header>` prop is accepted and forwarded to it. */\nexport interface HeaderMenuProps extends React.ComponentPropsWithoutRef<'header'> {\n /** The bar's content: a way back (breadcrumbs), the logo, the account menu. */\n children?: React.ReactNode;\n}\n\n/** The sticky bar at the top of pages without a sidebar. */\nexport const HeaderMenu = React.forwardRef<HTMLElement, HeaderMenuProps>(({ className, ...others }, ref) => (\n <header {...others} ref={ref} className={classNames('roaster-header-menu', className)} />\n));\nHeaderMenu.displayName = 'HeaderMenu';\n\n/** Every native `<header>` prop is accepted and forwarded to it. */\nexport interface TopBarProps extends Omit<React.ComponentPropsWithoutRef<'header'>, 'title'> {\n /** The start of the bar, such as a search button (with `className=\"roaster-top-bar__search\"`), or a `Breadcrumbs`. */\n children?: React.ReactNode;\n /**\n * The page's name, on a page without a title of its own: an `<h1>`, with an optional icon before it, at the bar's\n * start, before `children`.\n */\n title?: React.ReactNode;\n /** The end of the bar: buttons, and the account, a `<button className=\"roaster-top-bar__account\">` with an `Avatar`. */\n actions?: React.ReactNode;\n}\n\n/** The bar at the top of the main frame, beside the sidebar: a search, then actions and the account. */\nexport const TopBar = React.forwardRef<HTMLElement, TopBarProps>(\n ({ className, children, title, actions, ...others }, ref) => (\n <header {...others} ref={ref} className={classNames('roaster-top-bar', className)}>\n {title != null && title !== false && <h1 className=\"roaster-top-bar__title\">{title}</h1>}\n {children}\n {actions && <div className=\"roaster-top-bar__actions\">{actions}</div>}\n </header>\n )\n);\nTopBar.displayName = 'TopBar';\n\n/** Every native `<footer>` prop is accepted and forwarded to it. */\nexport interface FooterProps extends React.ComponentPropsWithoutRef<'footer'> {\n /** The bar's content, such as the store's name in `<span className=\"roaster-footer__store\">`. */\n children?: React.ReactNode;\n}\n\n/** The fixed bar at the bottom of the page. */\nexport const Footer = React.forwardRef<HTMLElement, FooterProps>(({ className, ...others }, ref) => (\n <footer {...others} ref={ref} className={classNames('roaster-footer', className)} />\n));\nFooter.displayName = 'Footer';\n"],"names":[],"mappings":";;;;;AAIY,MAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,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AAM,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE;AAC/K,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,KAAK,oBAAoB,GAAG,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC3H,IAAI,QAAQ;AACZ,IAAI,OAAO,oBAAoB,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,0BAA0B,EAAE,QAAQ,EAAE,OAAO,EAAE;AACtG,GAAG,EAAE;AACL;AACA,MAAM,CAAC,WAAW,GAAG,QAAQ;AACjB,MAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,qBAAqB,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,CAAC;AAC/K,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
|
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
4
|
+
import { useImageFallback } from '../../utils/useImageFallback/index.js';
|
|
5
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
3
6
|
|
|
4
|
-
const Avatar = React.forwardRef(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const Avatar = React.forwardRef(
|
|
8
|
+
({ src, alt, name, size, initials, tint, icon, badge, className, style, ...others }, ref) => {
|
|
9
|
+
const { showFallback, onError } = useImageFallback(src);
|
|
10
|
+
const label = alt ?? name;
|
|
11
|
+
const fallbackProps = label ? { role: "img", "aria-label": label } : { "aria-hidden": true };
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
13
|
+
"span",
|
|
14
|
+
{
|
|
15
|
+
...showFallback ? fallbackProps : {},
|
|
16
|
+
...others,
|
|
17
|
+
ref,
|
|
18
|
+
className: classNames(
|
|
19
|
+
"roaster-avatar",
|
|
20
|
+
{
|
|
21
|
+
[`roaster-avatar--${tint === "neutral" ? "neutral" : `tint-${tint}`}`]: tint !== void 0,
|
|
22
|
+
"roaster-avatar--small": size === "small"
|
|
23
|
+
},
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
style: { ...typeof size === "number" && { width: size, height: size }, ...style },
|
|
27
|
+
children: [
|
|
28
|
+
icon ? icon : showFallback ? (initials ?? name.charAt(0)).toUpperCase() : /* @__PURE__ */ jsx("img", { src: src ?? void 0, alt: label, onError }),
|
|
29
|
+
badge != null && /* @__PURE__ */ jsx("span", { className: "roaster-avatar__badge", children: badge })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
12
35
|
Avatar.displayName = "Avatar";
|
|
13
36
|
|
|
14
37
|
export { Avatar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport interface AvatarProps {\n /** The URL of the avatar
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useImageFallback } from '@/utils';\n\n/** Every native `<span>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface AvatarProps extends React.ComponentPropsWithoutRef<'span'> {\n /** The URL of the picture. Without it, or when it fails to load, the avatar shows the initial of `name`. */\n src?: string | null;\n /**\n * What the avatar says to screen readers. `''` when the name is already written next to it.\n * @defaultValue `name`\n */\n alt?: string;\n /** The name of the person or store. */\n name: string;\n /** The width and height, in pixels, or `small` (28px, such as in a list's rows). */\n size?: number | 'small';\n /** The letters shown without a picture, such as two initials. The first letter of `name` by default. */\n initials?: string;\n /** Fills the initials in one of seven colors, so that neighbors differ, or in gray (`neutral`), for no one. */\n tint?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 'neutral';\n /** An icon in place of the picture and the initials, such as an arrow to a list's other items. */\n icon?: React.ReactNode;\n /** A small mark on the avatar's corner, such as an `Icon` for a linked account. */\n badge?: React.ReactNode;\n}\n\n/** A round picture of a person or a store, showing the initial of the name when there is no picture. */\nexport const Avatar = React.forwardRef<HTMLSpanElement, AvatarProps>(\n ({ src, alt, name, size, initials, tint, icon, badge, className, style, ...others }, ref) => {\n const { showFallback, onError } = useImageFallback(src);\n const label = alt ?? name;\n // The initial is a picture of the name: named like one, or hidden when it is decorative.\n const fallbackProps = label ? { role: 'img', 'aria-label': label } : { 'aria-hidden': true };\n\n return (\n <span\n {...(showFallback ? fallbackProps : {})}\n {...others}\n ref={ref}\n className={classNames(\n 'roaster-avatar',\n {\n [`roaster-avatar--${tint === 'neutral' ? 'neutral' : `tint-${tint}`}`]: tint !== undefined,\n 'roaster-avatar--small': size === 'small',\n },\n className\n )}\n style={{ ...(typeof size === 'number' && { width: size, height: size }), ...style }}\n >\n {icon ? (\n icon\n ) : showFallback ? (\n (initials ?? name.charAt(0)).toUpperCase()\n ) : (\n <img src={src ?? undefined} alt={label} onError={onError} />\n )}\n {badge != null && <span className=\"roaster-avatar__badge\">{badge}</span>}\n </span>\n );\n }\n);\n\nAvatar.displayName = 'Avatar';\n"],"names":[],"mappings":";;;;;;AAIY,MAAC,MAAM,GAAG,KAAK,CAAC,UAAU;AACtC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AAC/F,IAAI,MAAM,EA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;AACL,EAAE;AACF;AACA,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
|
|
@@ -1,12 +1,106 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { classNames } from '../../utils/classNames/index.js';
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
-
const {
|
|
7
|
-
|
|
6
|
+
const BlockCardBase = React.forwardRef((props, ref) => {
|
|
7
|
+
const {
|
|
8
|
+
title,
|
|
9
|
+
label,
|
|
10
|
+
headingLevel = 2,
|
|
11
|
+
description,
|
|
12
|
+
figure,
|
|
13
|
+
figureSize = "medium",
|
|
14
|
+
children,
|
|
15
|
+
actions,
|
|
16
|
+
raised,
|
|
17
|
+
compact,
|
|
18
|
+
plain,
|
|
19
|
+
className,
|
|
20
|
+
...others
|
|
21
|
+
} = props;
|
|
22
|
+
const Heading = `h${headingLevel}`;
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
"article",
|
|
25
|
+
{
|
|
26
|
+
...others,
|
|
27
|
+
ref,
|
|
28
|
+
className: classNames(
|
|
29
|
+
"roaster-block-card",
|
|
30
|
+
{
|
|
31
|
+
"roaster-block-card--raised": raised,
|
|
32
|
+
"roaster-block-card--compact": compact,
|
|
33
|
+
"roaster-block-card--plain": plain
|
|
34
|
+
},
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
(title || label || description || figure != null || actions) && /* @__PURE__ */ jsxs("div", { className: "roaster-block-card__header", children: [
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
40
|
+
title && /* @__PURE__ */ jsx(Heading, { className: "roaster-block-card__title", children: title }),
|
|
41
|
+
label && /* @__PURE__ */ jsx(Heading, { className: "roaster-block-card__label", children: label }),
|
|
42
|
+
description && /* @__PURE__ */ jsx("p", { className: "roaster-block-card__description", children: description }),
|
|
43
|
+
figure != null && /* @__PURE__ */ jsx(
|
|
44
|
+
"p",
|
|
45
|
+
{
|
|
46
|
+
className: classNames("roaster-block-card__figure", {
|
|
47
|
+
"roaster-block-card__figure--large": figureSize === "large"
|
|
48
|
+
}),
|
|
49
|
+
children: figure
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] }),
|
|
53
|
+
actions && /* @__PURE__ */ jsx("div", { className: "roaster-block-card__actions", children: actions })
|
|
54
|
+
] }),
|
|
55
|
+
children
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
BlockCardBase.displayName = "BlockCard";
|
|
61
|
+
const BlockCardSection = React.forwardRef(({ className, ...others }, ref) => /* @__PURE__ */ jsx("div", { ...others, ref, className: classNames("roaster-block-card__section", className) }));
|
|
62
|
+
BlockCardSection.displayName = "BlockCard.Section";
|
|
63
|
+
const BlockCardStats = React.forwardRef(
|
|
64
|
+
({ ruled, className, ...others }, ref) => /* @__PURE__ */ jsx(
|
|
65
|
+
"dl",
|
|
66
|
+
{
|
|
67
|
+
...others,
|
|
68
|
+
ref,
|
|
69
|
+
className: classNames("roaster-block-card__stats", { "roaster-block-card__section": ruled }, className)
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
BlockCardStats.displayName = "BlockCard.Stats";
|
|
74
|
+
const BlockCardStat = React.forwardRef(
|
|
75
|
+
({ term, icon, children, ...others }, ref) => /* @__PURE__ */ jsxs("div", { ...others, ref, children: [
|
|
76
|
+
/* @__PURE__ */ jsxs("dt", { children: [
|
|
77
|
+
icon,
|
|
78
|
+
term
|
|
79
|
+
] }),
|
|
80
|
+
/* @__PURE__ */ jsx("dd", { children })
|
|
81
|
+
] })
|
|
82
|
+
);
|
|
83
|
+
BlockCardStat.displayName = "BlockCard.Stat";
|
|
84
|
+
const BlockCardList = React.forwardRef(({ className, ...others }, ref) => /* @__PURE__ */ jsx("ul", { ...others, ref, className: classNames("roaster-block-card__list", className) }));
|
|
85
|
+
BlockCardList.displayName = "BlockCard.List";
|
|
86
|
+
const BlockCardItem = React.forwardRef(
|
|
87
|
+
({ children, avatar, end, className, ...others }, ref) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("a", { ...others, ref, className: classNames("roaster-block-card__item", className), children: [
|
|
88
|
+
avatar,
|
|
89
|
+
/* @__PURE__ */ jsx("span", { children }),
|
|
90
|
+
end != null && /* @__PURE__ */ jsx("span", { className: "roaster-block-card__end", children: end })
|
|
91
|
+
] }) })
|
|
92
|
+
);
|
|
93
|
+
BlockCardItem.displayName = "BlockCard.Item";
|
|
94
|
+
const BlockCardFooter = React.forwardRef(({ className, ...others }, ref) => /* @__PURE__ */ jsx("div", { ...others, ref, className: classNames("roaster-block-card__footer", className) }));
|
|
95
|
+
BlockCardFooter.displayName = "BlockCard.Footer";
|
|
96
|
+
const BlockCard = Object.assign(BlockCardBase, {
|
|
97
|
+
Section: BlockCardSection,
|
|
98
|
+
Stats: BlockCardStats,
|
|
99
|
+
Stat: BlockCardStat,
|
|
100
|
+
List: BlockCardList,
|
|
101
|
+
Item: BlockCardItem,
|
|
102
|
+
Footer: BlockCardFooter
|
|
8
103
|
});
|
|
9
|
-
BlockCard.displayName = "BlockCard";
|
|
10
104
|
|
|
11
105
|
export { BlockCard };
|
|
12
106
|
//# sourceMappingURL=BlockCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockCard.js","sources":["../../../../src/components/BlockCard/BlockCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface BlockCardProps {\n /** The child elements to be rendered within the BlockCard (required) */\n children: React.ReactNode;\n /** The title of the BlockCard (optional) */\n title?: React.ReactNode;\n /** The description of the BlockCard (optional) */\n description?: React.ReactNode;\n /** The action elements to be rendered at top right of the BlockCard (optional) */\n actions?: React.ReactNode;\n /** CSS class name(s) to be applied to the BlockCard root element (optional) */\n className?: string;\n /** The inline style object to be applied to the card element (optional) */\n style?: React.CSSProperties;\n}\n\n/**\n * A white card that groups related content, with an optional title, description and actions in its header.\n */\nexport const BlockCard = React.forwardRef<HTMLDivElement, BlockCardProps>((props, ref) => {\n const { title, description, children, actions, className, style } = props;\n\n return (\n <article ref={ref} className={classNames('card-block', className)} style={style}>\n {(title || description || actions) && (\n <div className=\"title-wrapper\">\n <div>\n {title && <h4>{title}</h4>}\n {description && <p className=\"text-secondary\">{description}</p>}\n </div>\n {actions && <div className=\"items-group\">{actions}</div>}\n </div>\n )}\n\n {children}\n </article>\n );\n});\n\nBlockCard.displayName = 'BlockCard';\n"],"names":[],"mappings":";;;;AAEY,MAAC,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AAC1D,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK;AAC3E,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,WAAW,IAAI,OAAO,qBAAqB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,oBAAoB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,WAAW,oBAAoB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,OAAO,oBAAoB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC;AAC1iB,CAAC;AACD,SAAS,CAAC,WAAW,GAAG,WAAW;;"}
|
|
1
|
+
{"version":3,"file":"BlockCard.js","sources":["../../../../src/components/BlockCard/BlockCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\n/** Every native `<article>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface BlockCardProps extends Omit<React.ComponentPropsWithoutRef<'article'>, 'title'> {\n /** The content of the card: its own parts (`BlockCard.Section`, `Stats`, `List`, `Footer`) or anything else. */\n children: React.ReactNode;\n /** The title, in the header. */\n title?: React.ReactNode;\n /**\n * A quiet name, in place of the title, for a card that leads with its figure, such as an account's balance on a\n * dashboard. A link in it keeps the text's color.\n */\n label?: React.ReactNode;\n /**\n * The heading level of the title or the label. It looks the same at any level.\n * @defaultValue 2\n */\n headingLevel?: 2 | 3 | 4;\n /** A line under the title. */\n description?: React.ReactNode;\n /** The amount the card leads with, under its label, its cents in a `<sup>`: `<>$12,505<sup>.87</sup></>`. */\n figure?: React.ReactNode;\n /**\n * `large` for the page's main figure.\n * @defaultValue 'medium'\n */\n figureSize?: 'medium' | 'large';\n /** Buttons at the end of the header. */\n actions?: React.ReactNode;\n /** The shadow of a clickable card, on a card the page sets apart (the theme may give other cards none). */\n raised?: boolean;\n /**\n * A small card, such as one in a page's side column: less room, smaller text, a quiet title, and a descriptive list\n * in it without a frame.\n */\n compact?: boolean;\n /** No frame at all, such as a section of a page's side column. */\n plain?: boolean;\n}\n\nconst BlockCardBase = React.forwardRef<HTMLElement, BlockCardProps>((props, ref) => {\n const {\n title,\n label,\n headingLevel = 2,\n description,\n figure,\n figureSize = 'medium',\n children,\n actions,\n raised,\n compact,\n plain,\n className,\n ...others\n } = props;\n const Heading = `h${headingLevel}` as 'h2' | 'h3' | 'h4';\n\n return (\n <article\n {...others}\n ref={ref}\n className={classNames(\n 'roaster-block-card',\n {\n 'roaster-block-card--raised': raised,\n 'roaster-block-card--compact': compact,\n 'roaster-block-card--plain': plain,\n },\n className\n )}\n >\n {(title || label || description || figure != null || actions) && (\n <div className=\"roaster-block-card__header\">\n <div>\n {title && <Heading className=\"roaster-block-card__title\">{title}</Heading>}\n {label && <Heading className=\"roaster-block-card__label\">{label}</Heading>}\n {description && <p className=\"roaster-block-card__description\">{description}</p>}\n {figure != null && (\n <p\n className={classNames('roaster-block-card__figure', {\n 'roaster-block-card__figure--large': figureSize === 'large',\n })}\n >\n {figure}\n </p>\n )}\n </div>\n {actions && <div className=\"roaster-block-card__actions\">{actions}</div>}\n </div>\n )}\n\n {children}\n </article>\n );\n});\n\nBlockCardBase.displayName = 'BlockCard';\n\n/** Every native `<div>` prop is accepted and forwarded to it. */\nexport type BlockCardSectionProps = React.ComponentPropsWithoutRef<'div'>;\n\n/** A part of the card ruled off from the next, such as a usage bar and its legend. */\nconst BlockCardSection = React.forwardRef<HTMLDivElement, BlockCardSectionProps>(({ className, ...others }, ref) => (\n <div {...others} ref={ref} className={classNames('roaster-block-card__section', className)} />\n));\nBlockCardSection.displayName = 'BlockCard.Section';\n\n/** Every native `<dl>` prop is accepted and forwarded to it. */\nexport interface BlockCardStatsProps extends React.ComponentPropsWithoutRef<'dl'> {\n /** The figures: `BlockCard.Stat`. */\n children: React.ReactNode;\n /** Ruled off from what follows, as a `BlockCard.Section` is. */\n ruled?: boolean;\n}\n\n/** Figures side by side, each a term over its value, as many columns as figures. */\nconst BlockCardStats = React.forwardRef<HTMLDListElement, BlockCardStatsProps>(\n ({ ruled, className, ...others }, ref) => (\n <dl\n {...others}\n ref={ref}\n className={classNames('roaster-block-card__stats', { 'roaster-block-card__section': ruled }, className)}\n />\n )\n);\nBlockCardStats.displayName = 'BlockCard.Stats';\n\n/** Every native `<div>` prop is accepted and forwarded to the term and its value's wrapper. */\nexport interface BlockCardStatProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n /** What the figure is, such as \"Overdue\". */\n term: React.ReactNode;\n /** An icon before the term. */\n icon?: React.ReactNode;\n /** The figure, such as \"4 · $950.00\". A link in it reads as the figure. */\n children: React.ReactNode;\n}\n\n/** One figure of `BlockCard.Stats`: its term over its value. */\nconst BlockCardStat = React.forwardRef<HTMLDivElement, BlockCardStatProps>(\n ({ term, icon, children, ...others }, ref) => (\n <div {...others} ref={ref}>\n <dt>\n {icon}\n {term}\n </dt>\n <dd>{children}</dd>\n </div>\n )\n);\nBlockCardStat.displayName = 'BlockCard.Stat';\n\n/** Every native `<ul>` prop is accepted and forwarded to it. */\nexport interface BlockCardListProps extends React.ComponentPropsWithoutRef<'ul'> {\n /** The rows: `BlockCard.Item`. */\n children: React.ReactNode;\n}\n\n/** The things the card leads to, such as accounts or top recipients, a little wider than its content. */\nconst BlockCardList = React.forwardRef<HTMLUListElement, BlockCardListProps>(({ className, ...others }, ref) => (\n <ul {...others} ref={ref} className={classNames('roaster-block-card__list', className)} />\n));\nBlockCardList.displayName = 'BlockCard.List';\n\n/** Every native `<a>` prop (`href`, ...) is accepted and forwarded to the row's link. */\nexport interface BlockCardItemProps extends React.ComponentPropsWithoutRef<'a'> {\n /** The row's name. */\n children: React.ReactNode;\n /** Its picture, first: an `Avatar` (`size=\"small\"`). */\n avatar?: React.ReactNode;\n /** What ends the row, such as an amount, its cents in a `<sup>`. */\n end?: React.ReactNode;\n}\n\n/** A row of `BlockCard.List`: a link with an avatar, a name and what ends it. */\nconst BlockCardItem = React.forwardRef<HTMLAnchorElement, BlockCardItemProps>(\n ({ children, avatar, end, className, ...others }, ref) => (\n <li>\n <a {...others} ref={ref} className={classNames('roaster-block-card__item', className)}>\n {avatar}\n <span>{children}</span>\n {end != null && <span className=\"roaster-block-card__end\">{end}</span>}\n </a>\n </li>\n )\n);\nBlockCardItem.displayName = 'BlockCard.Item';\n\n/** Every native `<div>` prop is accepted and forwarded to it. */\nexport type BlockCardFooterProps = React.ComponentPropsWithoutRef<'div'>;\n\n/** The card's last band, ruled off across its width, such as an average and its small chart. */\nconst BlockCardFooter = React.forwardRef<HTMLDivElement, BlockCardFooterProps>(({ className, ...others }, ref) => (\n <div {...others} ref={ref} className={classNames('roaster-block-card__footer', className)} />\n));\nBlockCardFooter.displayName = 'BlockCard.Footer';\n\n/**\n * A white card that groups related content, with an optional header: a title (an `<h2>` by default) or a quiet\n * label, a description, a figure and actions. Its parts lay out a dashboard's card: `BlockCard.Section`, `Stats`\n * (of `Stat`), `List` (of `Item`) and `Footer`. A `Chart` that ends it reaches its edges.\n */\nexport const BlockCard = Object.assign(BlockCardBase, {\n Section: BlockCardSection,\n Stats: BlockCardStats,\n Stat: BlockCardStat,\n List: BlockCardList,\n Item: BlockCardItem,\n Footer: BlockCardFooter,\n});\n"],"names":[],"mappings":";;;;;AAIA,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACvD,EAAE,MAAM;AACR,IAAI,KAAK;AACT,IAAI,KAAK;AACT,IAAI,YAAY,GAAG,CAAC;AACpB,IAAI,WAAW;AACf,IAAI,MAAM;AACV,IAAI,UAAU,GAAG,QAAQ;AACzB,IAAI,QAAQ;AACZ,IAAI,OAAO;AACX,IAAI,MAAM;AACV,IAAI,OAAO;AACX,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AACpC,EAAE,uBAAuB,IAAI;AAC7B,IAAI,SAAS;AACb,IAAI;AACJ,MAAM,GAAG,MAAM;AACf,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU;AAC3B,QAAQ,oBAAoB;AAC5B,QAAQ;AACR,UAAU,4BAA4B,EAAE,MAAM;AAC9C,UAAU,6BAA6B,EAAE,OAAO;AAChD,UAAU,2BAA2B,EAAE;AACvC,SAAS;AACT,QAAQ;AACR,OAAO;AACP,MAAM,QAAQ,EAAE;AAChB,QAAQ,CAAC,KAAK,IAAI,KAAK,IAAI,WAAW,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,q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