@trellixio/roaster-react 0.0.0-stage → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +4 -0
- package/README.md +101 -2
- package/cjs/components/ActionCard/ActionCard.js +27 -0
- package/cjs/components/ActionCard/ActionCard.js.map +1 -0
- package/cjs/components/ActionList/ActionList.context.js +32 -0
- package/cjs/components/ActionList/ActionList.context.js.map +1 -0
- package/cjs/components/ActionList/ActionList.js +37 -0
- package/cjs/components/ActionList/ActionList.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListDivider.js +24 -0
- package/cjs/components/ActionList/components/ActionListDivider.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListDropdown.js +46 -0
- package/cjs/components/ActionList/components/ActionListDropdown.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListGroup.js +25 -0
- package/cjs/components/ActionList/components/ActionListGroup.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListItem.js +25 -0
- package/cjs/components/ActionList/components/ActionListItem.js.map +1 -0
- package/cjs/components/ActionList/components/ActionListTrigger.js +44 -0
- package/cjs/components/ActionList/components/ActionListTrigger.js.map +1 -0
- package/cjs/components/ActionList/useDropdown.js +47 -0
- package/cjs/components/ActionList/useDropdown.js.map +1 -0
- package/cjs/components/Alert/Alert.js +28 -0
- package/cjs/components/Alert/Alert.js.map +1 -0
- package/cjs/components/Avatar/Avatar.js +30 -0
- package/cjs/components/Avatar/Avatar.js.map +1 -0
- package/cjs/components/BlockCard/BlockCard.js +27 -0
- package/cjs/components/BlockCard/BlockCard.js.map +1 -0
- package/cjs/components/Button/Button.js +50 -0
- package/cjs/components/Button/Button.js.map +1 -0
- package/cjs/components/ButtonIcon/ButtonIcon.js +38 -0
- package/cjs/components/ButtonIcon/ButtonIcon.js.map +1 -0
- package/cjs/components/Checkbox/Checkbox.js +77 -0
- package/cjs/components/Checkbox/Checkbox.js.map +1 -0
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js +12 -0
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js.map +1 -0
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.js +48 -0
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/cjs/components/ColorField/ColorField.js +50 -0
- package/cjs/components/ColorField/ColorField.js.map +1 -0
- package/cjs/components/DatePicker/DatePicker.js +144 -0
- package/cjs/components/DatePicker/DatePicker.js.map +1 -0
- package/cjs/components/DatePicker/components/Calendar/Calendar.js +56 -0
- package/cjs/components/DatePicker/components/Calendar/Calendar.js.map +1 -0
- package/cjs/components/DatePicker/components/Day/Day.js +41 -0
- package/cjs/components/DatePicker/components/Day/Day.js.map +1 -0
- package/cjs/components/DatePicker/components/Month/Month.js +55 -0
- package/cjs/components/DatePicker/components/Month/Month.js.map +1 -0
- package/cjs/components/DatePicker/components/Weekday/Weekday.js +23 -0
- package/cjs/components/DatePicker/components/Weekday/Weekday.js.map +1 -0
- package/cjs/components/DatePicker/utils/index.js +186 -0
- package/cjs/components/DatePicker/utils/index.js.map +1 -0
- package/cjs/components/DescriptiveList/DescriptiveList.js +28 -0
- package/cjs/components/DescriptiveList/DescriptiveList.js.map +1 -0
- package/cjs/components/DescriptiveList/DescriptiveListItem.js +24 -0
- package/cjs/components/DescriptiveList/DescriptiveListItem.js.map +1 -0
- package/cjs/components/DropdownCard/DropdownCard.context.js +32 -0
- package/cjs/components/DropdownCard/DropdownCard.context.js.map +1 -0
- package/cjs/components/DropdownCard/DropdownCard.js +36 -0
- package/cjs/components/DropdownCard/DropdownCard.js.map +1 -0
- package/cjs/components/DropdownCard/components/DropdownCardActions.js +12 -0
- package/cjs/components/DropdownCard/components/DropdownCardActions.js.map +1 -0
- package/cjs/components/DropdownCard/components/DropdownCardContent.js +25 -0
- package/cjs/components/DropdownCard/components/DropdownCardContent.js.map +1 -0
- package/cjs/components/DropdownCard/components/DropdownCardDropdown.js +46 -0
- package/cjs/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -0
- package/cjs/components/DropdownCard/components/DropdownCardTrigger.js +42 -0
- package/cjs/components/DropdownCard/components/DropdownCardTrigger.js.map +1 -0
- package/cjs/components/FileField/FileField.js +81 -0
- package/cjs/components/FileField/FileField.js.map +1 -0
- package/cjs/components/HyperlinkCard/HyperlinkCard.js +15 -0
- package/cjs/components/HyperlinkCard/HyperlinkCard.js.map +1 -0
- package/cjs/components/Icon/Icon.js +35 -0
- package/cjs/components/Icon/Icon.js.map +1 -0
- package/cjs/components/Loader/Loader.js +12 -0
- package/cjs/components/Loader/Loader.js.map +1 -0
- package/cjs/components/Modal/Modal.js +28 -0
- package/cjs/components/Modal/Modal.js.map +1 -0
- package/cjs/components/Modal/ModalProvider/ModalProviderFooter.js +33 -0
- package/cjs/components/Modal/ModalProvider/ModalProviderFooter.js.map +1 -0
- package/cjs/components/Modal/ModalProvider/index.js +85 -0
- package/cjs/components/Modal/ModalProvider/index.js.map +1 -0
- package/cjs/components/Modal/utils/events.js +19 -0
- package/cjs/components/Modal/utils/events.js.map +1 -0
- package/cjs/components/Modal/utils/reducer.js +42 -0
- package/cjs/components/Modal/utils/reducer.js.map +1 -0
- package/cjs/components/Modal/utils/useModal.js +32 -0
- package/cjs/components/Modal/utils/useModal.js.map +1 -0
- package/cjs/components/Page/Page.js +38 -0
- package/cjs/components/Page/Page.js.map +1 -0
- package/cjs/components/Pagination/Pagination.js +35 -0
- package/cjs/components/Pagination/Pagination.js.map +1 -0
- package/cjs/components/Progress/Progress.js +13 -0
- package/cjs/components/Progress/Progress.js.map +1 -0
- package/cjs/components/Radio/Radio.js +65 -0
- package/cjs/components/Radio/Radio.js.map +1 -0
- package/cjs/components/Radio/RadioGroup/RadioGroup.context.js +12 -0
- package/cjs/components/Radio/RadioGroup/RadioGroup.context.js.map +1 -0
- package/cjs/components/Radio/RadioGroup/RadioGroup.js +58 -0
- package/cjs/components/Radio/RadioGroup/RadioGroup.js.map +1 -0
- package/cjs/components/RangeField/RangeField.js +76 -0
- package/cjs/components/RangeField/RangeField.js.map +1 -0
- package/cjs/components/Select/Select.js +72 -0
- package/cjs/components/Select/Select.js.map +1 -0
- package/cjs/components/Sidebar/Sidebar.js +144 -0
- package/cjs/components/Sidebar/Sidebar.js.map +1 -0
- package/cjs/components/Sidebar/components/Menu.js +17 -0
- package/cjs/components/Sidebar/components/Menu.js.map +1 -0
- package/cjs/components/Sidebar/components/MenuItem.js +15 -0
- package/cjs/components/Sidebar/components/MenuItem.js.map +1 -0
- package/cjs/components/Sidebar/components/Section.js +12 -0
- package/cjs/components/Sidebar/components/Section.js.map +1 -0
- package/cjs/components/Sidebar/components/SubMenu.js +12 -0
- package/cjs/components/Sidebar/components/SubMenu.js.map +1 -0
- package/cjs/components/Spinner/Spinner.js +12 -0
- package/cjs/components/Spinner/Spinner.js.map +1 -0
- package/cjs/components/StatCard/StatCard.js +36 -0
- package/cjs/components/StatCard/StatCard.js.map +1 -0
- package/cjs/components/Switch/Switch.js +63 -0
- package/cjs/components/Switch/Switch.js.map +1 -0
- package/cjs/components/Table/Table.js +93 -0
- package/cjs/components/Table/Table.js.map +1 -0
- package/cjs/components/Table/components/Checkbox/index.js +40 -0
- package/cjs/components/Table/components/Checkbox/index.js.map +1 -0
- package/cjs/components/Table/components/TableBody.js +24 -0
- package/cjs/components/Table/components/TableBody.js.map +1 -0
- package/cjs/components/Table/components/TableCell.js +25 -0
- package/cjs/components/Table/components/TableCell.js.map +1 -0
- package/cjs/components/Table/components/TableHead.js +43 -0
- package/cjs/components/Table/components/TableHead.js.map +1 -0
- package/cjs/components/Table/components/TableHeadCell.js +32 -0
- package/cjs/components/Table/components/TableHeadCell.js.map +1 -0
- package/cjs/components/Table/components/TablePagination.js +26 -0
- package/cjs/components/Table/components/TablePagination.js.map +1 -0
- package/cjs/components/Table/components/TableProvider/TableProvider.js +42 -0
- package/cjs/components/Table/components/TableProvider/TableProvider.js.map +1 -0
- package/cjs/components/Table/components/TableRow.js +46 -0
- package/cjs/components/Table/components/TableRow.js.map +1 -0
- package/cjs/components/Table/utils/rows/context.js +9 -0
- package/cjs/components/Table/utils/rows/context.js.map +1 -0
- package/cjs/components/Table/utils/table/context.js +13 -0
- package/cjs/components/Table/utils/table/context.js.map +1 -0
- package/cjs/components/Table/utils/table/hooks.js +64 -0
- package/cjs/components/Table/utils/table/hooks.js.map +1 -0
- package/cjs/components/Table/utils/table/types.js +14 -0
- package/cjs/components/Table/utils/table/types.js.map +1 -0
- package/cjs/components/Table/utils/useSelectableResourceState/index.js +85 -0
- package/cjs/components/Table/utils/useSelectableResourceState/index.js.map +1 -0
- package/cjs/components/Tag/Tag.js +31 -0
- package/cjs/components/Tag/Tag.js.map +1 -0
- package/cjs/components/Tag/TagGroup.js +27 -0
- package/cjs/components/Tag/TagGroup.js.map +1 -0
- package/cjs/components/TextField/TextField.js +85 -0
- package/cjs/components/TextField/TextField.js.map +1 -0
- package/cjs/components/Textarea/Textarea.js +60 -0
- package/cjs/components/Textarea/Textarea.js.map +1 -0
- package/cjs/components/Thumbnail/Thumbnail.js +30 -0
- package/cjs/components/Thumbnail/Thumbnail.js.map +1 -0
- package/cjs/components/Toast/Toast.js +28 -0
- package/cjs/components/Toast/Toast.js.map +1 -0
- package/cjs/components/Toast/Toasts.context.js +10 -0
- package/cjs/components/Toast/Toasts.context.js.map +1 -0
- package/cjs/components/Toast/ToastsContainer/index.js +47 -0
- package/cjs/components/Toast/ToastsContainer/index.js.map +1 -0
- package/cjs/components/Toast/ToastsProvider/index.js +39 -0
- package/cjs/components/Toast/ToastsProvider/index.js.map +1 -0
- package/cjs/components/Toast/ToastsProvider/useToastsState/useToastsState.js +55 -0
- package/cjs/components/Toast/ToastsProvider/useToastsState/useToastsState.js.map +1 -0
- package/cjs/components/Toast/events.js +20 -0
- package/cjs/components/Toast/events.js.map +1 -0
- package/cjs/components/Tooltip/Tooltip.js +81 -0
- package/cjs/components/Tooltip/Tooltip.js.map +1 -0
- package/cjs/components/Tooltip/useTooltip.js +63 -0
- package/cjs/components/Tooltip/useTooltip.js.map +1 -0
- package/cjs/components/Visualizer/Visualizer.context.js +12 -0
- package/cjs/components/Visualizer/Visualizer.context.js.map +1 -0
- package/cjs/components/Visualizer/Visualizer.js +36 -0
- package/cjs/components/Visualizer/Visualizer.js.map +1 -0
- package/cjs/components/Visualizer/VisualizerMobileOpener.js +28 -0
- package/cjs/components/Visualizer/VisualizerMobileOpener.js.map +1 -0
- package/cjs/index.js +106 -0
- package/cjs/index.js.map +1 -0
- package/cjs/utils/classNames/index.js +28 -0
- package/cjs/utils/classNames/index.js.map +1 -0
- package/cjs/utils/createUseExternalEvents/index.js +32 -0
- package/cjs/utils/createUseExternalEvents/index.js.map +1 -0
- package/cjs/utils/guid/index.js +12 -0
- package/cjs/utils/guid/index.js.map +1 -0
- package/cjs/utils/useDropdown/index.js +47 -0
- package/cjs/utils/useDropdown/index.js.map +1 -0
- package/cjs/utils/useIsomorphicEffect/index.js +22 -0
- package/cjs/utils/useIsomorphicEffect/index.js.map +1 -0
- package/cjs/utils/useQueue/index.js +36 -0
- package/cjs/utils/useQueue/index.js.map +1 -0
- package/cjs/utils/useUid/index.js +25 -0
- package/cjs/utils/useUid/index.js.map +1 -0
- package/cjs/utils/useUncontrolled/index.js +25 -0
- package/cjs/utils/useUncontrolled/index.js.map +1 -0
- package/esm/components/ActionCard/ActionCard.js +12 -0
- package/esm/components/ActionCard/ActionCard.js.map +1 -0
- package/esm/components/ActionList/ActionList.context.js +15 -0
- package/esm/components/ActionList/ActionList.context.js.map +1 -0
- package/esm/components/ActionList/ActionList.js +22 -0
- package/esm/components/ActionList/ActionList.js.map +1 -0
- package/esm/components/ActionList/components/ActionListDivider.js +9 -0
- package/esm/components/ActionList/components/ActionListDivider.js.map +1 -0
- package/esm/components/ActionList/components/ActionListDropdown.js +31 -0
- package/esm/components/ActionList/components/ActionListDropdown.js.map +1 -0
- package/esm/components/ActionList/components/ActionListGroup.js +10 -0
- package/esm/components/ActionList/components/ActionListGroup.js.map +1 -0
- package/esm/components/ActionList/components/ActionListItem.js +10 -0
- package/esm/components/ActionList/components/ActionListItem.js.map +1 -0
- package/esm/components/ActionList/components/ActionListTrigger.js +29 -0
- package/esm/components/ActionList/components/ActionListTrigger.js.map +1 -0
- package/esm/components/ActionList/useDropdown.js +45 -0
- package/esm/components/ActionList/useDropdown.js.map +1 -0
- package/esm/components/Alert/Alert.js +13 -0
- package/esm/components/Alert/Alert.js.map +1 -0
- package/esm/components/Avatar/Avatar.js +15 -0
- package/esm/components/Avatar/Avatar.js.map +1 -0
- package/esm/components/BlockCard/BlockCard.js +12 -0
- package/esm/components/BlockCard/BlockCard.js.map +1 -0
- package/esm/components/Button/Button.js +35 -0
- package/esm/components/Button/Button.js.map +1 -0
- package/esm/components/ButtonIcon/ButtonIcon.js +23 -0
- package/esm/components/ButtonIcon/ButtonIcon.js.map +1 -0
- package/esm/components/Checkbox/Checkbox.js +62 -0
- package/esm/components/Checkbox/Checkbox.js.map +1 -0
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js +9 -0
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js.map +1 -0
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.js +33 -0
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/esm/components/ColorField/ColorField.js +35 -0
- package/esm/components/ColorField/ColorField.js.map +1 -0
- package/esm/components/DatePicker/DatePicker.js +129 -0
- package/esm/components/DatePicker/DatePicker.js.map +1 -0
- package/esm/components/DatePicker/components/Calendar/Calendar.js +41 -0
- package/esm/components/DatePicker/components/Calendar/Calendar.js.map +1 -0
- package/esm/components/DatePicker/components/Day/Day.js +26 -0
- package/esm/components/DatePicker/components/Day/Day.js.map +1 -0
- package/esm/components/DatePicker/components/Month/Month.js +40 -0
- package/esm/components/DatePicker/components/Month/Month.js.map +1 -0
- package/esm/components/DatePicker/components/Weekday/Weekday.js +8 -0
- package/esm/components/DatePicker/components/Weekday/Weekday.js.map +1 -0
- package/esm/components/DatePicker/utils/index.js +166 -0
- package/esm/components/DatePicker/utils/index.js.map +1 -0
- package/esm/components/DescriptiveList/DescriptiveList.js +13 -0
- package/esm/components/DescriptiveList/DescriptiveList.js.map +1 -0
- package/esm/components/DescriptiveList/DescriptiveListItem.js +9 -0
- package/esm/components/DescriptiveList/DescriptiveListItem.js.map +1 -0
- package/esm/components/DropdownCard/DropdownCard.context.js +15 -0
- package/esm/components/DropdownCard/DropdownCard.context.js.map +1 -0
- package/esm/components/DropdownCard/DropdownCard.js +21 -0
- package/esm/components/DropdownCard/DropdownCard.js.map +1 -0
- package/esm/components/DropdownCard/components/DropdownCardActions.js +10 -0
- package/esm/components/DropdownCard/components/DropdownCardActions.js.map +1 -0
- package/esm/components/DropdownCard/components/DropdownCardContent.js +10 -0
- package/esm/components/DropdownCard/components/DropdownCardContent.js.map +1 -0
- package/esm/components/DropdownCard/components/DropdownCardDropdown.js +31 -0
- package/esm/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -0
- package/esm/components/DropdownCard/components/DropdownCardTrigger.js +27 -0
- package/esm/components/DropdownCard/components/DropdownCardTrigger.js.map +1 -0
- package/esm/components/FileField/FileField.js +66 -0
- package/esm/components/FileField/FileField.js.map +1 -0
- package/esm/components/HyperlinkCard/HyperlinkCard.js +13 -0
- package/esm/components/HyperlinkCard/HyperlinkCard.js.map +1 -0
- package/esm/components/Icon/Icon.js +20 -0
- package/esm/components/Icon/Icon.js.map +1 -0
- package/esm/components/Loader/Loader.js +10 -0
- package/esm/components/Loader/Loader.js.map +1 -0
- package/esm/components/Modal/Modal.js +13 -0
- package/esm/components/Modal/Modal.js.map +1 -0
- package/esm/components/Modal/ModalProvider/ModalProviderFooter.js +31 -0
- package/esm/components/Modal/ModalProvider/ModalProviderFooter.js.map +1 -0
- package/esm/components/Modal/ModalProvider/index.js +70 -0
- package/esm/components/Modal/ModalProvider/index.js.map +1 -0
- package/esm/components/Modal/utils/events.js +13 -0
- package/esm/components/Modal/utils/events.js.map +1 -0
- package/esm/components/Modal/utils/reducer.js +39 -0
- package/esm/components/Modal/utils/reducer.js.map +1 -0
- package/esm/components/Modal/utils/useModal.js +15 -0
- package/esm/components/Modal/utils/useModal.js.map +1 -0
- package/esm/components/Page/Page.js +23 -0
- package/esm/components/Page/Page.js.map +1 -0
- package/esm/components/Pagination/Pagination.js +20 -0
- package/esm/components/Pagination/Pagination.js.map +1 -0
- package/esm/components/Progress/Progress.js +11 -0
- package/esm/components/Progress/Progress.js.map +1 -0
- package/esm/components/Radio/Radio.js +50 -0
- package/esm/components/Radio/Radio.js.map +1 -0
- package/esm/components/Radio/RadioGroup/RadioGroup.context.js +9 -0
- package/esm/components/Radio/RadioGroup/RadioGroup.context.js.map +1 -0
- package/esm/components/Radio/RadioGroup/RadioGroup.js +43 -0
- package/esm/components/Radio/RadioGroup/RadioGroup.js.map +1 -0
- package/esm/components/RangeField/RangeField.js +61 -0
- package/esm/components/RangeField/RangeField.js.map +1 -0
- package/esm/components/Select/Select.js +57 -0
- package/esm/components/Select/Select.js.map +1 -0
- package/esm/components/Sidebar/Sidebar.js +129 -0
- package/esm/components/Sidebar/Sidebar.js.map +1 -0
- package/esm/components/Sidebar/components/Menu.js +15 -0
- package/esm/components/Sidebar/components/Menu.js.map +1 -0
- package/esm/components/Sidebar/components/MenuItem.js +13 -0
- package/esm/components/Sidebar/components/MenuItem.js.map +1 -0
- package/esm/components/Sidebar/components/Section.js +10 -0
- package/esm/components/Sidebar/components/Section.js.map +1 -0
- package/esm/components/Sidebar/components/SubMenu.js +10 -0
- package/esm/components/Sidebar/components/SubMenu.js.map +1 -0
- package/esm/components/Spinner/Spinner.js +10 -0
- package/esm/components/Spinner/Spinner.js.map +1 -0
- package/esm/components/StatCard/StatCard.js +21 -0
- package/esm/components/StatCard/StatCard.js.map +1 -0
- package/esm/components/Switch/Switch.js +48 -0
- package/esm/components/Switch/Switch.js.map +1 -0
- package/esm/components/Table/Table.js +78 -0
- package/esm/components/Table/Table.js.map +1 -0
- package/esm/components/Table/components/Checkbox/index.js +25 -0
- package/esm/components/Table/components/Checkbox/index.js.map +1 -0
- package/esm/components/Table/components/TableBody.js +9 -0
- package/esm/components/Table/components/TableBody.js.map +1 -0
- package/esm/components/Table/components/TableCell.js +10 -0
- package/esm/components/Table/components/TableCell.js.map +1 -0
- package/esm/components/Table/components/TableHead.js +28 -0
- package/esm/components/Table/components/TableHead.js.map +1 -0
- package/esm/components/Table/components/TableHeadCell.js +17 -0
- package/esm/components/Table/components/TableHeadCell.js.map +1 -0
- package/esm/components/Table/components/TablePagination.js +11 -0
- package/esm/components/Table/components/TablePagination.js.map +1 -0
- package/esm/components/Table/components/TableProvider/TableProvider.js +40 -0
- package/esm/components/Table/components/TableProvider/TableProvider.js.map +1 -0
- package/esm/components/Table/components/TableRow.js +31 -0
- package/esm/components/Table/components/TableRow.js.map +1 -0
- package/esm/components/Table/utils/rows/context.js +7 -0
- package/esm/components/Table/utils/rows/context.js.map +1 -0
- package/esm/components/Table/utils/table/context.js +9 -0
- package/esm/components/Table/utils/table/context.js.map +1 -0
- package/esm/components/Table/utils/table/hooks.js +58 -0
- package/esm/components/Table/utils/table/hooks.js.map +1 -0
- package/esm/components/Table/utils/table/types.js +11 -0
- package/esm/components/Table/utils/table/types.js.map +1 -0
- package/esm/components/Table/utils/useSelectableResourceState/index.js +70 -0
- package/esm/components/Table/utils/useSelectableResourceState/index.js.map +1 -0
- package/esm/components/Tag/Tag.js +16 -0
- package/esm/components/Tag/Tag.js.map +1 -0
- package/esm/components/Tag/TagGroup.js +12 -0
- package/esm/components/Tag/TagGroup.js.map +1 -0
- package/esm/components/TextField/TextField.js +70 -0
- package/esm/components/TextField/TextField.js.map +1 -0
- package/esm/components/Textarea/Textarea.js +45 -0
- package/esm/components/Textarea/Textarea.js.map +1 -0
- package/esm/components/Thumbnail/Thumbnail.js +15 -0
- package/esm/components/Thumbnail/Thumbnail.js.map +1 -0
- package/esm/components/Toast/Toast.js +13 -0
- package/esm/components/Toast/Toast.js.map +1 -0
- package/esm/components/Toast/Toasts.context.js +8 -0
- package/esm/components/Toast/Toasts.context.js.map +1 -0
- package/esm/components/Toast/ToastsContainer/index.js +44 -0
- package/esm/components/Toast/ToastsContainer/index.js.map +1 -0
- package/esm/components/Toast/ToastsProvider/index.js +24 -0
- package/esm/components/Toast/ToastsProvider/index.js.map +1 -0
- package/esm/components/Toast/ToastsProvider/useToastsState/useToastsState.js +51 -0
- package/esm/components/Toast/ToastsProvider/useToastsState/useToastsState.js.map +1 -0
- package/esm/components/Toast/events.js +12 -0
- package/esm/components/Toast/events.js.map +1 -0
- package/esm/components/Tooltip/Tooltip.js +66 -0
- package/esm/components/Tooltip/Tooltip.js.map +1 -0
- package/esm/components/Tooltip/useTooltip.js +48 -0
- package/esm/components/Tooltip/useTooltip.js.map +1 -0
- package/esm/components/Visualizer/Visualizer.context.js +9 -0
- package/esm/components/Visualizer/Visualizer.context.js.map +1 -0
- package/esm/components/Visualizer/Visualizer.js +21 -0
- package/esm/components/Visualizer/Visualizer.js.map +1 -0
- package/esm/components/Visualizer/VisualizerMobileOpener.js +13 -0
- package/esm/components/Visualizer/VisualizerMobileOpener.js.map +1 -0
- package/esm/index.js +46 -0
- package/esm/index.js.map +1 -0
- package/esm/package.json +3 -0
- package/esm/utils/classNames/index.js +26 -0
- package/esm/utils/classNames/index.js.map +1 -0
- package/esm/utils/createUseExternalEvents/index.js +30 -0
- package/esm/utils/createUseExternalEvents/index.js.map +1 -0
- package/esm/utils/guid/index.js +10 -0
- package/esm/utils/guid/index.js.map +1 -0
- package/esm/utils/useDropdown/index.js +45 -0
- package/esm/utils/useDropdown/index.js.map +1 -0
- package/esm/utils/useIsomorphicEffect/index.js +7 -0
- package/esm/utils/useIsomorphicEffect/index.js.map +1 -0
- package/esm/utils/useQueue/index.js +34 -0
- package/esm/utils/useQueue/index.js.map +1 -0
- package/esm/utils/useUid/index.js +10 -0
- package/esm/utils/useUid/index.js.map +1 -0
- package/esm/utils/useUncontrolled/index.js +23 -0
- package/esm/utils/useUncontrolled/index.js.map +1 -0
- package/lib/components/ActionCard/ActionCard.d.ts +19 -0
- package/lib/components/ActionCard/ActionCard.d.ts.map +1 -0
- package/lib/components/ActionCard/index.d.ts +3 -0
- package/lib/components/ActionCard/index.d.ts.map +1 -0
- package/lib/components/ActionList/ActionList.context.d.ts +53 -0
- package/lib/components/ActionList/ActionList.context.d.ts.map +1 -0
- package/lib/components/ActionList/ActionList.d.ts +25 -0
- package/lib/components/ActionList/ActionList.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListDivider.d.ts +7 -0
- package/lib/components/ActionList/components/ActionListDivider.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListDropdown.d.ts +3 -0
- package/lib/components/ActionList/components/ActionListDropdown.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListGroup.d.ts +9 -0
- package/lib/components/ActionList/components/ActionListGroup.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListItem.d.ts +11 -0
- package/lib/components/ActionList/components/ActionListItem.d.ts.map +1 -0
- package/lib/components/ActionList/components/ActionListTrigger.d.ts +7 -0
- package/lib/components/ActionList/components/ActionListTrigger.d.ts.map +1 -0
- package/lib/components/ActionList/index.d.ts +3 -0
- package/lib/components/ActionList/index.d.ts.map +1 -0
- package/lib/components/ActionList/useDropdown.d.ts +57 -0
- package/lib/components/ActionList/useDropdown.d.ts.map +1 -0
- package/lib/components/Alert/Alert.d.ts +16 -0
- package/lib/components/Alert/Alert.d.ts.map +1 -0
- package/lib/components/Alert/index.d.ts +3 -0
- package/lib/components/Alert/index.d.ts.map +1 -0
- package/lib/components/Avatar/Avatar.d.ts +14 -0
- package/lib/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/components/Avatar/index.d.ts +3 -0
- package/lib/components/Avatar/index.d.ts.map +1 -0
- package/lib/components/BlockCard/BlockCard.d.ts +20 -0
- package/lib/components/BlockCard/BlockCard.d.ts.map +1 -0
- package/lib/components/BlockCard/index.d.ts +3 -0
- package/lib/components/BlockCard/index.d.ts.map +1 -0
- package/lib/components/Button/Button.d.ts +37 -0
- package/lib/components/Button/Button.d.ts.map +1 -0
- package/lib/components/Button/index.d.ts +3 -0
- package/lib/components/Button/index.d.ts.map +1 -0
- package/lib/components/ButtonIcon/ButtonIcon.d.ts +24 -0
- package/lib/components/ButtonIcon/ButtonIcon.d.ts.map +1 -0
- package/lib/components/ButtonIcon/index.d.ts +3 -0
- package/lib/components/ButtonIcon/index.d.ts.map +1 -0
- package/lib/components/Checkbox/Checkbox.d.ts +42 -0
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.context.d.ts +7 -0
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.context.d.ts.map +1 -0
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +12 -0
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts.map +1 -0
- package/lib/components/Checkbox/index.d.ts +4 -0
- package/lib/components/Checkbox/index.d.ts.map +1 -0
- package/lib/components/CodeBlock/CodeBlock.d.ts +16 -0
- package/lib/components/CodeBlock/CodeBlock.d.ts.map +1 -0
- package/lib/components/CodeBlock/index.d.ts +2 -0
- package/lib/components/CodeBlock/index.d.ts.map +1 -0
- package/lib/components/ColorField/ColorField.d.ts +28 -0
- package/lib/components/ColorField/ColorField.d.ts.map +1 -0
- package/lib/components/ColorField/index.d.ts +3 -0
- package/lib/components/ColorField/index.d.ts.map +1 -0
- package/lib/components/DatePicker/DatePicker.d.ts +25 -0
- package/lib/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Calendar/Calendar.d.ts +26 -0
- package/lib/components/DatePicker/components/Calendar/Calendar.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Calendar/index.d.ts +2 -0
- package/lib/components/DatePicker/components/Calendar/index.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Day/Day.d.ts +16 -0
- package/lib/components/DatePicker/components/Day/Day.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Day/index.d.ts +2 -0
- package/lib/components/DatePicker/components/Day/index.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Month/Month.d.ts +28 -0
- package/lib/components/DatePicker/components/Month/Month.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Month/index.d.ts +2 -0
- package/lib/components/DatePicker/components/Month/index.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Weekday/Weekday.d.ts +7 -0
- package/lib/components/DatePicker/components/Weekday/Weekday.d.ts.map +1 -0
- package/lib/components/DatePicker/components/Weekday/index.d.ts +2 -0
- package/lib/components/DatePicker/components/Weekday/index.d.ts.map +1 -0
- package/lib/components/DatePicker/components/index.d.ts +5 -0
- package/lib/components/DatePicker/components/index.d.ts.map +1 -0
- package/lib/components/DatePicker/index.d.ts +2 -0
- package/lib/components/DatePicker/index.d.ts.map +1 -0
- package/lib/components/DatePicker/utils/index.d.ts +48 -0
- package/lib/components/DatePicker/utils/index.d.ts.map +1 -0
- package/lib/components/DatePicker/utils/types.d.ts +10 -0
- package/lib/components/DatePicker/utils/types.d.ts.map +1 -0
- package/lib/components/DescriptiveList/DescriptiveList.d.ts +17 -0
- package/lib/components/DescriptiveList/DescriptiveList.d.ts.map +1 -0
- package/lib/components/DescriptiveList/DescriptiveListItem.d.ts +9 -0
- package/lib/components/DescriptiveList/DescriptiveListItem.d.ts.map +1 -0
- package/lib/components/DescriptiveList/index.d.ts +3 -0
- package/lib/components/DescriptiveList/index.d.ts.map +1 -0
- package/lib/components/DropdownCard/DropdownCard.context.d.ts +53 -0
- package/lib/components/DropdownCard/DropdownCard.context.d.ts.map +1 -0
- package/lib/components/DropdownCard/DropdownCard.d.ts +21 -0
- package/lib/components/DropdownCard/DropdownCard.d.ts.map +1 -0
- package/lib/components/DropdownCard/components/DropdownCardActions.d.ts +7 -0
- package/lib/components/DropdownCard/components/DropdownCardActions.d.ts.map +1 -0
- package/lib/components/DropdownCard/components/DropdownCardContent.d.ts +7 -0
- package/lib/components/DropdownCard/components/DropdownCardContent.d.ts.map +1 -0
- package/lib/components/DropdownCard/components/DropdownCardDropdown.d.ts +6 -0
- package/lib/components/DropdownCard/components/DropdownCardDropdown.d.ts.map +1 -0
- package/lib/components/DropdownCard/components/DropdownCardTrigger.d.ts +7 -0
- package/lib/components/DropdownCard/components/DropdownCardTrigger.d.ts.map +1 -0
- package/lib/components/DropdownCard/components/index.d.ts +5 -0
- package/lib/components/DropdownCard/components/index.d.ts.map +1 -0
- package/lib/components/DropdownCard/index.d.ts +3 -0
- package/lib/components/DropdownCard/index.d.ts.map +1 -0
- package/lib/components/FileField/FileField.d.ts +43 -0
- package/lib/components/FileField/FileField.d.ts.map +1 -0
- package/lib/components/FileField/index.d.ts +3 -0
- package/lib/components/FileField/index.d.ts.map +1 -0
- package/lib/components/HyperlinkCard/HyperlinkCard.d.ts +11 -0
- package/lib/components/HyperlinkCard/HyperlinkCard.d.ts.map +1 -0
- package/lib/components/HyperlinkCard/index.d.ts +3 -0
- package/lib/components/HyperlinkCard/index.d.ts.map +1 -0
- package/lib/components/Icon/Icon.d.ts +16 -0
- package/lib/components/Icon/Icon.d.ts.map +1 -0
- package/lib/components/Icon/index.d.ts +3 -0
- package/lib/components/Icon/index.d.ts.map +1 -0
- package/lib/components/Loader/Loader.d.ts +8 -0
- package/lib/components/Loader/Loader.d.ts.map +1 -0
- package/lib/components/Loader/index.d.ts +3 -0
- package/lib/components/Loader/index.d.ts.map +1 -0
- package/lib/components/Modal/Modal.d.ts +11 -0
- package/lib/components/Modal/Modal.d.ts.map +1 -0
- package/lib/components/Modal/ModalProvider/ModalProviderFooter.d.ts +4 -0
- package/lib/components/Modal/ModalProvider/ModalProviderFooter.d.ts.map +1 -0
- package/lib/components/Modal/ModalProvider/index.d.ts +4 -0
- package/lib/components/Modal/ModalProvider/index.d.ts.map +1 -0
- package/lib/components/Modal/index.d.ts +5 -0
- package/lib/components/Modal/index.d.ts.map +1 -0
- package/lib/components/Modal/types/index.d.ts +56 -0
- package/lib/components/Modal/types/index.d.ts.map +1 -0
- package/lib/components/Modal/utils/events.d.ts +9 -0
- package/lib/components/Modal/utils/events.d.ts.map +1 -0
- package/lib/components/Modal/utils/index.d.ts +4 -0
- package/lib/components/Modal/utils/index.d.ts.map +1 -0
- package/lib/components/Modal/utils/reducer.d.ts +37 -0
- package/lib/components/Modal/utils/reducer.d.ts.map +1 -0
- package/lib/components/Modal/utils/useModal.d.ts +6 -0
- package/lib/components/Modal/utils/useModal.d.ts.map +1 -0
- package/lib/components/Page/Page.d.ts +40 -0
- package/lib/components/Page/Page.d.ts.map +1 -0
- package/lib/components/Page/index.d.ts +3 -0
- package/lib/components/Page/index.d.ts.map +1 -0
- package/lib/components/Pagination/Pagination.d.ts +24 -0
- package/lib/components/Pagination/Pagination.d.ts.map +1 -0
- package/lib/components/Pagination/index.d.ts +3 -0
- package/lib/components/Pagination/index.d.ts.map +1 -0
- package/lib/components/Progress/Progress.d.ts +11 -0
- package/lib/components/Progress/Progress.d.ts.map +1 -0
- package/lib/components/Progress/index.d.ts +3 -0
- package/lib/components/Progress/index.d.ts.map +1 -0
- package/lib/components/Radio/Radio.d.ts +39 -0
- package/lib/components/Radio/Radio.d.ts.map +1 -0
- package/lib/components/Radio/RadioGroup/RadioGroup.context.d.ts +15 -0
- package/lib/components/Radio/RadioGroup/RadioGroup.context.d.ts.map +1 -0
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +28 -0
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/lib/components/Radio/index.d.ts +4 -0
- package/lib/components/Radio/index.d.ts.map +1 -0
- package/lib/components/RangeField/RangeField.d.ts +36 -0
- package/lib/components/RangeField/RangeField.d.ts.map +1 -0
- package/lib/components/RangeField/index.d.ts +3 -0
- package/lib/components/RangeField/index.d.ts.map +1 -0
- package/lib/components/Select/Select.d.ts +56 -0
- package/lib/components/Select/Select.d.ts.map +1 -0
- package/lib/components/Select/index.d.ts +3 -0
- package/lib/components/Select/index.d.ts.map +1 -0
- package/lib/components/Sidebar/Sidebar.d.ts +40 -0
- package/lib/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/lib/components/Sidebar/components/Menu.d.ts +17 -0
- package/lib/components/Sidebar/components/Menu.d.ts.map +1 -0
- package/lib/components/Sidebar/components/MenuItem.d.ts +18 -0
- package/lib/components/Sidebar/components/MenuItem.d.ts.map +1 -0
- package/lib/components/Sidebar/components/Section.d.ts +9 -0
- package/lib/components/Sidebar/components/Section.d.ts.map +1 -0
- package/lib/components/Sidebar/components/SubMenu.d.ts +11 -0
- package/lib/components/Sidebar/components/SubMenu.d.ts.map +1 -0
- package/lib/components/Sidebar/index.d.ts +3 -0
- package/lib/components/Sidebar/index.d.ts.map +1 -0
- package/lib/components/Spinner/Spinner.d.ts +7 -0
- package/lib/components/Spinner/Spinner.d.ts.map +1 -0
- package/lib/components/Spinner/index.d.ts +3 -0
- package/lib/components/Spinner/index.d.ts.map +1 -0
- package/lib/components/StatCard/StatCard.d.ts +20 -0
- package/lib/components/StatCard/StatCard.d.ts.map +1 -0
- package/lib/components/StatCard/index.d.ts +3 -0
- package/lib/components/StatCard/index.d.ts.map +1 -0
- package/lib/components/Switch/Switch.d.ts +33 -0
- package/lib/components/Switch/Switch.d.ts.map +1 -0
- package/lib/components/Switch/index.d.ts +3 -0
- package/lib/components/Switch/index.d.ts.map +1 -0
- package/lib/components/Table/Table.d.ts +85 -0
- package/lib/components/Table/Table.d.ts.map +1 -0
- package/lib/components/Table/Table.types.d.ts +3 -0
- package/lib/components/Table/Table.types.d.ts.map +1 -0
- package/lib/components/Table/components/Checkbox/index.d.ts +11 -0
- package/lib/components/Table/components/Checkbox/index.d.ts.map +1 -0
- package/lib/components/Table/components/TableBody.d.ts +6 -0
- package/lib/components/Table/components/TableBody.d.ts.map +1 -0
- package/lib/components/Table/components/TableCell.d.ts +8 -0
- package/lib/components/Table/components/TableCell.d.ts.map +1 -0
- package/lib/components/Table/components/TableHead.d.ts +6 -0
- package/lib/components/Table/components/TableHead.d.ts.map +1 -0
- package/lib/components/Table/components/TableHeadCell.d.ts +19 -0
- package/lib/components/Table/components/TableHeadCell.d.ts.map +1 -0
- package/lib/components/Table/components/TablePagination.d.ts +7 -0
- package/lib/components/Table/components/TablePagination.d.ts.map +1 -0
- package/lib/components/Table/components/TableProvider/TableProvider.d.ts +4 -0
- package/lib/components/Table/components/TableProvider/TableProvider.d.ts.map +1 -0
- package/lib/components/Table/components/TableProvider/index.d.ts +2 -0
- package/lib/components/Table/components/TableProvider/index.d.ts.map +1 -0
- package/lib/components/Table/components/TableRow.d.ts +9 -0
- package/lib/components/Table/components/TableRow.d.ts.map +1 -0
- package/lib/components/Table/index.d.ts +6 -0
- package/lib/components/Table/index.d.ts.map +1 -0
- package/lib/components/Table/utils/rows/context.d.ts +16 -0
- package/lib/components/Table/utils/rows/context.d.ts.map +1 -0
- package/lib/components/Table/utils/rows/hooks.d.ts +2 -0
- package/lib/components/Table/utils/rows/hooks.d.ts.map +1 -0
- package/lib/components/Table/utils/rows/index.d.ts +3 -0
- package/lib/components/Table/utils/rows/index.d.ts.map +1 -0
- package/lib/components/Table/utils/table/context.d.ts +29 -0
- package/lib/components/Table/utils/table/context.d.ts.map +1 -0
- package/lib/components/Table/utils/table/hooks.d.ts +11 -0
- package/lib/components/Table/utils/table/hooks.d.ts.map +1 -0
- package/lib/components/Table/utils/table/index.d.ts +4 -0
- package/lib/components/Table/utils/table/index.d.ts.map +1 -0
- package/lib/components/Table/utils/table/types.d.ts +53 -0
- package/lib/components/Table/utils/table/types.d.ts.map +1 -0
- package/lib/components/Table/utils/useSelectableResourceState/index.d.ts +20 -0
- package/lib/components/Table/utils/useSelectableResourceState/index.d.ts.map +1 -0
- package/lib/components/Tag/Tag.d.ts +22 -0
- package/lib/components/Tag/Tag.d.ts.map +1 -0
- package/lib/components/Tag/TagGroup.d.ts +9 -0
- package/lib/components/Tag/TagGroup.d.ts.map +1 -0
- package/lib/components/Tag/index.d.ts +3 -0
- package/lib/components/Tag/index.d.ts.map +1 -0
- package/lib/components/TextField/TextField.d.ts +42 -0
- package/lib/components/TextField/TextField.d.ts.map +1 -0
- package/lib/components/TextField/index.d.ts +3 -0
- package/lib/components/TextField/index.d.ts.map +1 -0
- package/lib/components/Textarea/Textarea.d.ts +31 -0
- package/lib/components/Textarea/Textarea.d.ts.map +1 -0
- package/lib/components/Textarea/index.d.ts +3 -0
- package/lib/components/Textarea/index.d.ts.map +1 -0
- package/lib/components/Thumbnail/Thumbnail.d.ts +14 -0
- package/lib/components/Thumbnail/Thumbnail.d.ts.map +1 -0
- package/lib/components/Thumbnail/index.d.ts +3 -0
- package/lib/components/Thumbnail/index.d.ts.map +1 -0
- package/lib/components/Toast/Toast.d.ts +23 -0
- package/lib/components/Toast/Toast.d.ts.map +1 -0
- package/lib/components/Toast/Toasts.context.d.ts +3 -0
- package/lib/components/Toast/Toasts.context.d.ts.map +1 -0
- package/lib/components/Toast/ToastsContainer/index.d.ts +23 -0
- package/lib/components/Toast/ToastsContainer/index.d.ts.map +1 -0
- package/lib/components/Toast/ToastsProvider/index.d.ts +22 -0
- package/lib/components/Toast/ToastsProvider/index.d.ts.map +1 -0
- package/lib/components/Toast/ToastsProvider/useToastsState/useToastsState.d.ts +13 -0
- package/lib/components/Toast/ToastsProvider/useToastsState/useToastsState.d.ts.map +1 -0
- package/lib/components/Toast/events.d.ts +37 -0
- package/lib/components/Toast/events.d.ts.map +1 -0
- package/lib/components/Toast/index.d.ts +11 -0
- package/lib/components/Toast/index.d.ts.map +1 -0
- package/lib/components/Toast/types.d.ts +12 -0
- package/lib/components/Toast/types.d.ts.map +1 -0
- package/lib/components/Tooltip/Tooltip.d.ts +34 -0
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/lib/components/Tooltip/index.d.ts +3 -0
- package/lib/components/Tooltip/index.d.ts.map +1 -0
- package/lib/components/Tooltip/useTooltip.d.ts +39 -0
- package/lib/components/Tooltip/useTooltip.d.ts.map +1 -0
- package/lib/components/Visualizer/Visualizer.context.d.ts +14 -0
- package/lib/components/Visualizer/Visualizer.context.d.ts.map +1 -0
- package/lib/components/Visualizer/Visualizer.d.ts +12 -0
- package/lib/components/Visualizer/Visualizer.d.ts.map +1 -0
- package/lib/components/Visualizer/VisualizerMobileOpener.d.ts +7 -0
- package/lib/components/Visualizer/VisualizerMobileOpener.d.ts.map +1 -0
- package/lib/components/Visualizer/index.d.ts +3 -0
- package/lib/components/Visualizer/index.d.ts.map +1 -0
- package/lib/components/index.d.ts +36 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/types.d.ts +44 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/utils/classNames/index.d.ts +38 -0
- package/lib/utils/classNames/index.d.ts.map +1 -0
- package/lib/utils/createUseExternalEvents/index.d.ts +14 -0
- package/lib/utils/createUseExternalEvents/index.d.ts.map +1 -0
- package/lib/utils/guid/index.d.ts +10 -0
- package/lib/utils/guid/index.d.ts.map +1 -0
- package/lib/utils/index.d.ts +12 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/useDidUpdate/index.d.ts +30 -0
- package/lib/utils/useDidUpdate/index.d.ts.map +1 -0
- package/lib/utils/useDropdown/index.d.ts +57 -0
- package/lib/utils/useDropdown/index.d.ts.map +1 -0
- package/lib/utils/useEventListener/index.d.ts +7 -0
- package/lib/utils/useEventListener/index.d.ts.map +1 -0
- package/lib/utils/useForceUpdate/index.d.ts +28 -0
- package/lib/utils/useForceUpdate/index.d.ts.map +1 -0
- package/lib/utils/useIsomorphicEffect/index.d.ts +21 -0
- package/lib/utils/useIsomorphicEffect/index.d.ts.map +1 -0
- package/lib/utils/useQueue/index.d.ts +65 -0
- package/lib/utils/useQueue/index.d.ts.map +1 -0
- package/lib/utils/useUid/index.d.ts +10 -0
- package/lib/utils/useUid/index.d.ts.map +1 -0
- package/lib/utils/useUncontrolled/index.d.ts +38 -0
- package/lib/utils/useUncontrolled/index.d.ts.map +1 -0
- package/package.json +47 -3
- package/theme.css +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Button, ButtonProps } from '../Button';\nimport { classNames } from '@/utils';\n\nexport interface PaginationProps {\n /** Callback when next button is clicked */\n onNext?: () => void;\n /** Callback when previous button is clicked */\n onPrevious?: () => void;\n /** Whether there is a next page to show */\n hasNext?: boolean;\n /** Whether there is a previous page to show */\n hasPrevious?: boolean;\n /** props for the previous button */\n previousButtonProps?: Partial<ButtonProps>;\n /** props for the next button */\n nextButtonProps?: Partial<ButtonProps>;\n /** Additional class names for the root element. */\n className?: string;\n}\n\n/** Previous and next buttons to move through pages of results. */\nexport function Pagination({\n onNext,\n onPrevious,\n hasNext,\n hasPrevious,\n previousButtonProps,\n nextButtonProps,\n className,\n}: PaginationProps) {\n return (\n <nav className={classNames('pagination', className)}>\n <Button variant=\"secondary\" disabled={!hasPrevious} onClick={() => onPrevious?.()} {...previousButtonProps}>\n <i className=\"fa-regular fa-chevron-left\" />\n </Button>\n <Button variant=\"secondary\" disabled={!hasNext} onClick={() => onNext?.()} {...nextButtonProps}>\n <i className=\"fa-regular fa-chevron-right\" />\n </Button>\n </nav>\n );\n}\n\nPagination.displayName = 'Pagination';\n"],"names":[],"mappings":";;;;;AAGO,SAAS,UAAU,CAAC;AAC3B,EAAE,MAAM;AACR,EAAE,UAAU;AACZ,EAAE,OAAO;AACT,EAAE,WAAW;AACb,EAAE,mBAAmB;AACrB,EAAE,eAAe;AACjB,EAAE;AACF,CAAC,EAAE;AACH,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,UAAU,IAAI,EAAE,GAAG,mBAAmB,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,4BAA4B,EAAE,CAAC,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,IAAI,EAAE,GAAG,eAAe,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC,CAAC,CAAC;AACtjB;AACA,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
const Progress = forwardRef(({ className, value, color, label }, ref) => {
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames("progress-container", className), ref }, /* @__PURE__ */ React__default.createElement("figure", { className: classNames("progress", color) }, /* @__PURE__ */ React__default.createElement("span", { className: "progress-level", style: { width: `${value}%` } })), /* @__PURE__ */ React__default.createElement("p", { "data-role": "progress-value" }, label));
|
|
7
|
+
});
|
|
8
|
+
Progress.displayName = "Progress";
|
|
9
|
+
|
|
10
|
+
export { Progress };
|
|
11
|
+
//# sourceMappingURL=Progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.js","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { classNames } from '@/utils';\n\nexport interface ProgressProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Percent of filled bar (0-100) */\n value: number;\n /* Progress color */\n color: 'primary' | 'success' | 'danger';\n /** Text to be placed aside the progress bar */\n label?: string;\n}\n\n/** A progress bar for a value between 0 and 100, in a status color, with a label. */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(({ className, value, color, label }, ref) => {\n return (\n <div className={classNames('progress-container', className)} ref={ref}>\n <figure className={classNames('progress', color)}>\n <span className=\"progress-level\" style={{ width: `${value}%` }} />\n </figure>\n <p data-role=\"progress-value\">{label}</p>\n </div>\n );\n});\n\nProgress.displayName = 'Progress';\n"],"names":["React"],"mappings":";;;;AAEY,MAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,GAAG,KAAK;AAChF,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,kBAAkBA,cAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,kBAAkBA,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,kBAAkBA,cAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAC;AAClZ,CAAC;AACD,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { RadioGroup } from './RadioGroup/RadioGroup.js';
|
|
4
|
+
import { useRadioGroupContext } from './RadioGroup/RadioGroup.context.js';
|
|
5
|
+
import { useUid } from '../../utils/useUid/index.js';
|
|
6
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
7
|
+
|
|
8
|
+
const Radio = React.forwardRef((props, ref) => {
|
|
9
|
+
const {
|
|
10
|
+
id,
|
|
11
|
+
label,
|
|
12
|
+
name,
|
|
13
|
+
disabled,
|
|
14
|
+
value,
|
|
15
|
+
labelClassName,
|
|
16
|
+
inputClassName,
|
|
17
|
+
isRichSelector,
|
|
18
|
+
checked,
|
|
19
|
+
onChange,
|
|
20
|
+
...others
|
|
21
|
+
} = props;
|
|
22
|
+
const ctx = useRadioGroupContext();
|
|
23
|
+
const uid = useUid(id);
|
|
24
|
+
const inputProps = ctx ? {
|
|
25
|
+
name: name ?? ctx.name,
|
|
26
|
+
checked: ctx.value === value,
|
|
27
|
+
onChange: ctx.onChange
|
|
28
|
+
} : {
|
|
29
|
+
name,
|
|
30
|
+
checked,
|
|
31
|
+
onChange: (event) => {
|
|
32
|
+
onChange?.(event.currentTarget.value);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ React.createElement(
|
|
36
|
+
"label",
|
|
37
|
+
{
|
|
38
|
+
htmlFor: uid,
|
|
39
|
+
className: classNames(labelClassName, { selector: isRichSelector, selected: inputProps.checked })
|
|
40
|
+
},
|
|
41
|
+
/* @__PURE__ */ React.createElement("input", { ...others, value, ref, type: "radio", id: uid, disabled, ...inputProps }),
|
|
42
|
+
/* @__PURE__ */ React.createElement("span", { className: classNames("input-radio", inputClassName) }),
|
|
43
|
+
/* @__PURE__ */ React.createElement("div", { className: "content" }, label)
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
Radio.displayName = "Radio";
|
|
47
|
+
Radio.Group = RadioGroup;
|
|
48
|
+
|
|
49
|
+
export { Radio };
|
|
50
|
+
//# sourceMappingURL=Radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ForwardRefWithStaticComponents } from '@/types';\nimport { classNames, useUid } from '@/utils';\nimport { RadioGroup } from './RadioGroup/RadioGroup';\nimport { useRadioGroupContext } from './RadioGroup/RadioGroup.context';\n\n/** Every native `<input>` prop (`aria-*`, `data-*`, ...) is accepted and forwarded to the radio input. */\nexport interface RadioProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'onChange' | 'type' | 'value'> {\n /** The HTML ID attribute to be applied to the radio input element (optional). */\n id?: string;\n /** The name attribute to be applied to the radio input element (optional). */\n name?: string;\n /** Whether the radio input field should be disabled (optional). */\n disabled?: boolean;\n /** The value of the radio input field (optional). */\n value?: string;\n /** The label to be displayed next to the radio input field (optional). */\n label?: React.ReactNode;\n /** CSS class names to be applied to the label element (optional). */\n labelClassName?: string;\n /** CSS class names to be applied to the radio input element (optional). */\n inputClassName?: string;\n /** Whether the radio input field should be displayed as a rich selector (optional). */\n isRichSelector?: boolean;\n /** Whether the radio is selected. Only used outside a `Radio.Group`, which owns the selection otherwise (optional). */\n checked?: boolean;\n /**\n * Called with the radio's value when it is selected.\n * Only used outside a `Radio.Group`; inside one, use the group's `onChange` (optional).\n */\n onChange?(value: string): void;\n}\n\ntype RadioComponent = ForwardRefWithStaticComponents<RadioProps, { Group: typeof RadioGroup }>;\n\n/**\n * A radio button with a label. Use Radio.Group to manage the selected value, or use it on its own with checked and\n * onChange.\n */\nexport const Radio: RadioComponent = React.forwardRef<HTMLInputElement, RadioProps>((props, ref) => {\n const {\n id,\n label,\n name,\n disabled,\n value,\n labelClassName,\n inputClassName,\n isRichSelector,\n checked,\n onChange,\n ...others\n } = props;\n const ctx = useRadioGroupContext();\n const uid = useUid(id);\n\n const inputProps = ctx\n ? {\n name: name ?? ctx.name,\n checked: ctx.value === value,\n onChange: ctx.onChange,\n }\n : {\n name,\n checked,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(event.currentTarget.value);\n },\n };\n\n return (\n <label\n htmlFor={uid}\n className={classNames(labelClassName, { selector: isRichSelector, selected: inputProps.checked })}\n >\n <input {...others} value={value} ref={ref} type=\"radio\" id={uid} disabled={disabled} {...inputProps} />\n <span className={classNames('input-radio', inputClassName)} />\n <div className=\"content\">{label}</div>\n </label>\n );\n}) as any;\n\nRadio.displayName = 'Radio';\nRadio.Group = RadioGroup;\n"],"names":[],"mappings":";;;;;;;AAIY,MAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACtD,EAAE,MAAM;AACR,IAAI,EAAE;AACN,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,QAAQ;AACZ,IAAI,KAAK;AACT,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,IAAI,OAAO;AACX,IAAI,QAAQ;AACZ,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,MAAM,GAAG,GAAG,oBAAoB,EAAE;AACpC,EAAE,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,EAAE,MAAM,UAAU,GAAG,GAAG,GAAG;AAC3B,IAAI,IAAI,EAAE,IAAI,IAAI,GAAG,CAAC,IAAI;AAC1B,IAAI,OAAO,EAAE,GAAG,CAAC,KAAK,KAAK,KAAK;AAChC,IAAI,QAAQ,EAAE,GAAG,CAAC;AAClB,GAAG,GAAG;AACN,IAAI,IAAI;AACR,IAAI,OAAO;AACX,IAAI,QAAQ,EAAE,CAAC,KAAK,KAAK;AACzB,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;AAC3C,IAAI;AACJ,GAAG;AACH,EAAE,uBAAuB,KAAK,CAAC,aAAa;AAC5C,IAAI,OAAO;AACX,IAAI;AACJ,MAAM,OAAO,EAAE,GAAG;AAClB,MAAM,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,CAAC,OAAO,EAAE;AACtG,KAAK;AACL,oBAAoB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,CAAC;AAC5H,oBAAoB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,EAAE,CAAC;AACzG,oBAAoB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,KAAK;AAC9E,GAAG;AACH,CAAC;AACD,KAAK,CAAC,WAAW,GAAG,OAAO;AAC3B,KAAK,CAAC,KAAK,GAAG,UAAU;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
|
|
4
|
+
const RadioGroupContext = createContext(null);
|
|
5
|
+
const RadioGroupProvider = RadioGroupContext.Provider;
|
|
6
|
+
const useRadioGroupContext = () => useContext(RadioGroupContext);
|
|
7
|
+
|
|
8
|
+
export { RadioGroupProvider, useRadioGroupContext };
|
|
9
|
+
//# sourceMappingURL=RadioGroup.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.context.js","sources":["../../../../../src/components/Radio/RadioGroup/RadioGroup.context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\ninterface RadioGroupContextValue {\n /** The value of the currently selected radio input field. */\n value: string;\n /**\n * A function that is called when the value of the radio input field changes.\n * This function accepts a React `ChangeEvent` object as input.\n */\n onChange(event: React.ChangeEvent<HTMLInputElement>): void;\n /** The name attribute of the radio input fields in the radio group. */\n name: string;\n}\n\n/** `null` when a Radio is rendered outside of a `Radio.Group`. */\nconst RadioGroupContext = createContext<RadioGroupContextValue | null>(null);\nexport const RadioGroupProvider = RadioGroupContext.Provider;\nexport const useRadioGroupContext = () => useContext(RadioGroupContext);\n"],"names":[],"mappings":";;;AACA,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC;AACjC,MAAC,kBAAkB,GAAG,iBAAiB,CAAC;AACxC,MAAC,oBAAoB,GAAG,MAAM,UAAU,CAAC,iBAAiB;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { RadioGroupProvider } from './RadioGroup.context.js';
|
|
4
|
+
import { useUid } from '../../../utils/useUid/index.js';
|
|
5
|
+
import { useUncontrolled } from '../../../utils/useUncontrolled/index.js';
|
|
6
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
7
|
+
|
|
8
|
+
const RadioGroup = React.forwardRef((props, ref) => {
|
|
9
|
+
const { onChange, name, value, defaultValue, className, children, title, orientation = "vertical" } = props;
|
|
10
|
+
const groupName = useUid(name);
|
|
11
|
+
const [internalValue, setInternalValue] = useUncontrolled({
|
|
12
|
+
value,
|
|
13
|
+
defaultValue,
|
|
14
|
+
finalValue: "",
|
|
15
|
+
onChange
|
|
16
|
+
});
|
|
17
|
+
const handleChange = (event) => {
|
|
18
|
+
setInternalValue(event.currentTarget.value);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ React.createElement(
|
|
21
|
+
RadioGroupProvider,
|
|
22
|
+
{
|
|
23
|
+
value: {
|
|
24
|
+
value: internalValue,
|
|
25
|
+
onChange: handleChange,
|
|
26
|
+
name: groupName
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
/* @__PURE__ */ React.createElement("p", null, title),
|
|
30
|
+
/* @__PURE__ */ React.createElement(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
ref,
|
|
34
|
+
className: classNames("option-list radio", { "items-group": orientation === "horizontal" }, className)
|
|
35
|
+
},
|
|
36
|
+
children
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
RadioGroup.displayName = "RadioGroup";
|
|
41
|
+
|
|
42
|
+
export { RadioGroup };
|
|
43
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sources":["../../../../../src/components/Radio/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid, useUncontrolled } from '@/utils';\nimport { RadioGroupProvider } from './RadioGroup.context';\n\nexport interface RadioGroupProps {\n /** The child elements to be rendered within the radio group (required). */\n children: React.ReactNode;\n /** The value of the selected radio input field (optional). */\n value?: string;\n /** The default value of the selected radio input field (optional). */\n defaultValue?: string;\n /**\n * A function that is called when the value of the selected radio input field changes (optional).\n * This function accepts the new value of the selected radio input field as input.\n */\n onChange?(value: string): void;\n /** CSS class names to be applied to the radio group container element (optional). */\n className?: string;\n /** The name attribute to be applied to the radio input fields in the radio group (optional). */\n name?: string;\n /** The title to be displayed above the radio group (optional). */\n title?: string;\n /**\n * The orientation of the radio input fields in the radio group (optional).\n * - 'horizontal': display the radio input fields horizontally\n * - 'vertical': display the radio input fields vertically\n */\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>((props: RadioGroupProps, ref) => {\n const { onChange, name, value, defaultValue, className, children, title, orientation = 'vertical' } = props;\n const groupName = useUid(name);\n\n const [internalValue, setInternalValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: '',\n onChange,\n });\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n setInternalValue(event.currentTarget.value);\n };\n\n return (\n <RadioGroupProvider\n value={{\n value: internalValue,\n onChange: handleChange,\n name: groupName,\n }}\n >\n <p>{title}</p>\n <div\n ref={ref}\n className={classNames('option-list radio', { 'items-group': orientation === 'horizontal' }, className)}\n >\n {children}\n </div>\n </RadioGroupProvider>\n );\n});\n\nRadioGroup.displayName = 'RadioGroup';\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AAC3D,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,GAAG,UAAU,EAAE,GAAG,KAAK;AAC7G,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC;AAChC,EAAE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,eAAe,CAAC;AAC5D,IAAI,KAAK;AACT,IAAI,YAAY;AAChB,IAAI,UAAU,EAAE,EAAE;AAClB,IAAI;AACJ,GAAG,CAAC;AACJ,EAAE,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AAClC,IAAI,gBAAgB,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;AAC/C,EAAE,CAAC;AACH,EAAE,uBAAuB,KAAK,CAAC,aAAa;AAC5C,IAAI,kBAAkB;AACtB,IAAI;AACJ,MAAM,KAAK,EAAE;AACb,QAAQ,KAAK,EAAE,aAAa;AAC5B,QAAQ,QAAQ,EAAE,YAAY;AAC9B,QAAQ,IAAI,EAAE;AACd;AACA,KAAK;AACL,oBAAoB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC;AACzD,oBAAoB,KAAK,CAAC,aAAa;AACvC,MAAM,KAAK;AACX,MAAM;AACN,QAAQ,GAAG;AACX,QAAQ,SAAS,EAAE,UAAU,CAAC,mBAAmB,EAAE,EAAE,aAAa,EAAE,WAAW,KAAK,YAAY,EAAE,EAAE,SAAS;AAC7G,OAAO;AACP,MAAM;AACN;AACA,GAAG;AACH,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useUncontrolled } from '../../utils/useUncontrolled/index.js';
|
|
4
|
+
import { useUid } from '../../utils/useUid/index.js';
|
|
5
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
6
|
+
|
|
7
|
+
const RangeField = React.forwardRef((props, ref) => {
|
|
8
|
+
const {
|
|
9
|
+
id,
|
|
10
|
+
name,
|
|
11
|
+
label,
|
|
12
|
+
value,
|
|
13
|
+
min = 0,
|
|
14
|
+
helpText,
|
|
15
|
+
disabled,
|
|
16
|
+
onChange,
|
|
17
|
+
step = 1,
|
|
18
|
+
max = 100,
|
|
19
|
+
inputStyle,
|
|
20
|
+
labelClassName,
|
|
21
|
+
defaultValue = 0,
|
|
22
|
+
...others
|
|
23
|
+
} = props;
|
|
24
|
+
const [internalValue, setInternalValue] = useUncontrolled({
|
|
25
|
+
value,
|
|
26
|
+
defaultValue,
|
|
27
|
+
finalValue: defaultValue,
|
|
28
|
+
onChange
|
|
29
|
+
});
|
|
30
|
+
const uid = useUid(id);
|
|
31
|
+
const current = Math.min(Math.max(Number(internalValue), min), max);
|
|
32
|
+
const range = max - min;
|
|
33
|
+
const fillPercentage = range > 0 ? 100 * (current - min) / range : 0;
|
|
34
|
+
const handleChange = (event) => {
|
|
35
|
+
setInternalValue(Number(event.currentTarget.value));
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ React.createElement("label", { htmlFor: uid }, /* @__PURE__ */ React.createElement("p", { className: labelClassName }, label), /* @__PURE__ */ React.createElement("div", { className: classNames("merged-inputs") }, /* @__PURE__ */ React.createElement(
|
|
38
|
+
"input",
|
|
39
|
+
{
|
|
40
|
+
...others,
|
|
41
|
+
id: uid,
|
|
42
|
+
ref,
|
|
43
|
+
min,
|
|
44
|
+
max,
|
|
45
|
+
name,
|
|
46
|
+
step,
|
|
47
|
+
type: "range",
|
|
48
|
+
disabled,
|
|
49
|
+
value: current,
|
|
50
|
+
onChange: handleChange,
|
|
51
|
+
style: {
|
|
52
|
+
...inputStyle,
|
|
53
|
+
backgroundImage: `linear-gradient(to right, rgb(0 0 0), rgb(0 0 0) ${fillPercentage}%, rgb(209 209 209) ${fillPercentage}%)`
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
), /* @__PURE__ */ React.createElement("span", { "data-role": "input-value" }, current)), /* @__PURE__ */ React.createElement("small", null, helpText));
|
|
57
|
+
});
|
|
58
|
+
RangeField.displayName = "RangeField";
|
|
59
|
+
|
|
60
|
+
export { RangeField };
|
|
61
|
+
//# sourceMappingURL=RangeField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeField.js","sources":["../../../../src/components/RangeField/RangeField.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid, useUncontrolled } from '@/utils';\n\n/** Every native `<input>` prop (`aria-*`, `data-*`, ...) is accepted and forwarded to the range input. */\nexport interface RangeFieldProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'onChange' | 'type'> {\n /** The HTML ID attribute to be applied to the range input element (optional). */\n id?: string;\n /** The minimum value of the range input field (optional). */\n min?: number;\n /** The maximum value of the range input field (optional). */\n max?: number;\n /** The step value of the range input field (optional). */\n step?: number;\n /** The name attribute to be applied to the range input element (optional). */\n name?: string;\n /** The value of the range input field (optional). */\n value?: number;\n /** Whether the range input field should be disabled (optional). */\n disabled?: boolean;\n /** The default value of the range input field (optional). */\n defaultValue?: number;\n /** CSS class names to be applied to the label element (optional). */\n labelClassName?: string;\n /** The label to be displayed next to the range input field (optional). */\n label?: React.ReactNode;\n /** The help text to be displayed below the range input field (optional). */\n helpText?: React.ReactNode;\n /**\n * A function that is called when the value of the range input field changes (optional).\n * This function accepts the new value of the range input field as input.\n */\n onChange?(value: number): void;\n /** Inline styles to be applied to the range input element (optional). */\n inputStyle?: React.CSSProperties;\n}\n\n/** A slider to pick a number between a minimum and a maximum, with its current value shown. */\nexport const RangeField = React.forwardRef<HTMLInputElement, RangeFieldProps>((props, ref) => {\n const {\n id,\n name,\n label,\n value,\n min = 0,\n helpText,\n disabled,\n onChange,\n step = 1,\n max = 100,\n inputStyle,\n labelClassName,\n defaultValue = 0,\n ...others\n } = props;\n\n const [internalValue, setInternalValue] = useUncontrolled<number>({\n value,\n defaultValue,\n finalValue: defaultValue,\n onChange,\n });\n const uid = useUid(id);\n\n // The browser clamps what the slider shows; clamp what we display and fill with the same number.\n const current = Math.min(Math.max(Number(internalValue), min), max);\n const range = max - min;\n const fillPercentage = range > 0 ? (100 * (current - min)) / range : 0;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n setInternalValue(Number(event.currentTarget.value));\n };\n\n return (\n <label htmlFor={uid}>\n <p className={labelClassName}>{label}</p>\n <div className={classNames('merged-inputs')}>\n <input\n {...others}\n id={uid}\n ref={ref}\n min={min}\n max={max}\n name={name}\n step={step}\n type=\"range\"\n disabled={disabled}\n value={current}\n onChange={handleChange}\n style={{\n ...inputStyle,\n backgroundImage: `linear-gradient(to right, rgb(0 0 0), rgb(0 0 0) ${fillPercentage}%, rgb(209 209 209) ${fillPercentage}%)`,\n }}\n />\n <span data-role=\"input-value\">{current}</span>\n </div>\n <small>{helpText}</small>\n </label>\n );\n});\n\nRangeField.displayName = 'RangeField';\n"],"names":[],"mappings":";;;;;;AAEY,MAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AAC3D,EAAE,MAAM;AACR,IAAI,EAAE;AACN,IAAI,IAAI;AACR,IAAI,KAAK;AACT,IAAI,KAAK;AACT,IAAI,GAAG,GAAG,CAAC;AACX,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,IAAI,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,GAAG;AACb,IAAI,UAAU;AACd,IAAI,cAAc;AAClB,IAAI,YAAY,GAAG,CAAC;AACpB,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,eAAe,CAAC;AAC5D,IAAI,KAAK;AACT,IAAI,YAAY;AAChB,IAA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oBAAoB,EAAE,cAAc,CAAC,EAAE;AACnI;AACA;AACA,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AACzJ,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useUid } from '../../utils/useUid/index.js';
|
|
4
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
5
|
+
|
|
6
|
+
function defaultOptionResolver(option) {
|
|
7
|
+
if (typeof option === "string") {
|
|
8
|
+
return { label: option, value: option };
|
|
9
|
+
}
|
|
10
|
+
if ("id" in option && ("name" in option || "title" in option)) {
|
|
11
|
+
return { label: option.name || option.title, value: option.id };
|
|
12
|
+
}
|
|
13
|
+
return option;
|
|
14
|
+
}
|
|
15
|
+
const Select = React.forwardRef((props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
label,
|
|
18
|
+
data,
|
|
19
|
+
helpText,
|
|
20
|
+
prefix,
|
|
21
|
+
prefixWidth = prefix ? 24 : 12,
|
|
22
|
+
onChange,
|
|
23
|
+
disabled,
|
|
24
|
+
id,
|
|
25
|
+
selectClassName,
|
|
26
|
+
labelClassName,
|
|
27
|
+
error,
|
|
28
|
+
optionResolver = defaultOptionResolver,
|
|
29
|
+
defaultValue,
|
|
30
|
+
style,
|
|
31
|
+
...others
|
|
32
|
+
} = props;
|
|
33
|
+
const uid = useUid(id);
|
|
34
|
+
const normalizedData = data.map(optionResolver);
|
|
35
|
+
const options = normalizedData.map((item) => /* @__PURE__ */ React.createElement("option", { key: item.value, value: item.value, disabled: item.disabled }, item.label));
|
|
36
|
+
const handleChange = (event) => {
|
|
37
|
+
onChange?.(event.currentTarget.value);
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ React.createElement("label", { htmlFor: uid, className: classNames({ error }, labelClassName) }, /* @__PURE__ */ React.createElement("p", null, label), /* @__PURE__ */ React.createElement("div", { className: classNames({ "prefixed-input-container": prefix }) }, prefix && /* @__PURE__ */ React.createElement("span", { className: "input-prefix" }, prefix), /* @__PURE__ */ React.createElement(
|
|
40
|
+
"select",
|
|
41
|
+
{
|
|
42
|
+
...others,
|
|
43
|
+
id: uid,
|
|
44
|
+
ref,
|
|
45
|
+
className: classNames({ prefixed: prefix }, selectClassName),
|
|
46
|
+
disabled,
|
|
47
|
+
defaultValue,
|
|
48
|
+
style: { paddingLeft: prefixWidth, ...style },
|
|
49
|
+
onChange: handleChange
|
|
50
|
+
},
|
|
51
|
+
options
|
|
52
|
+
)), /* @__PURE__ */ React.createElement("small", null, error || helpText));
|
|
53
|
+
});
|
|
54
|
+
Select.displayName = "Select";
|
|
55
|
+
|
|
56
|
+
export { Select };
|
|
57
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\n\n/**\n * The `SelectItem` type extends the built-in `Record` type, which allows for arbitrary key-value pairs.\n */\nexport type SelectItem = Record<string, any>;\n\n/**\n * A function that takes a `SelectItem` object as input and returns an object containing a `value` and a `label` property.\n * - `value`: the value to be passed as the `value` prop to the select component\n * - `label`: the label to be displayed for the option in the select component\n * - `disabled`: whether the option should be disabled (optional)\n */\ntype OptionResolver = (option: string | SelectItem) => {\n value: string;\n label: string;\n disabled?: boolean;\n};\n\nfunction defaultOptionResolver(option: SelectItem | string) {\n if (typeof option === 'string') {\n return { label: option, value: option };\n }\n\n if ('id' in option && ('name' in option || 'title' in option)) {\n return { label: option.name || option.title, value: option.id };\n }\n\n return option;\n}\n/** Every native `<select>` prop (`name`, `value`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface SelectProps extends Omit<React.ComponentPropsWithoutRef<'select'>, 'onChange' | 'prefix'> {\n /** The HTML ID attribute to be applied to the select element (optional). */\n id?: string;\n /** The label to be displayed above the select field (optional). */\n label?: React.ReactNode;\n /** The error message to be displayed below the select field (optional). */\n error?: string;\n /** The help text to be displayed below the select field (optional). */\n helpText?: React.ReactNode;\n /** An array of strings or `SelectItem` objects that represent the options in the select field (required). */\n data: (string | SelectItem)[];\n /** Whether the select field should be disabled (optional). */\n disabled?: boolean;\n /** The default value of the select field (optional). */\n defaultValue?: string;\n /** The element to be displayed to the left of the select field (optional). */\n prefix?: React.ReactNode;\n /** The width of the prefix element (optional). */\n prefixWidth?: number;\n /**\n * A function that is called when the value of the select field changes (optional).\n * This function accepts the new value of the select field as input.\n */\n onChange?(value: string): void;\n\n /**\n * A function that takes a `SelectItem` object as input and returns an object containing a `value` and a `label` property (optional).\n * This function is used to map the `SelectItem` objects in the `data` array to option objects that are used to render the select field.\n * If this prop is not provided, the `value` and `label` properties of the `SelectItem` objects will be used.\n */\n optionResolver?: OptionResolver;\n\n /** CSS class names to be applied to the select element (optional). */\n selectClassName?: string;\n /** CSS class names to be applied to the label element (optional). */\n labelClassName?: string;\n}\n\n/** A dropdown to choose one option, from a list of strings or objects, with an optional prefix. */\nexport const Select = React.forwardRef<HTMLSelectElement, SelectProps>((props, ref) => {\n const {\n label,\n data,\n helpText,\n prefix,\n prefixWidth = prefix ? 24 : 12,\n onChange,\n disabled,\n id,\n selectClassName,\n labelClassName,\n error,\n optionResolver = defaultOptionResolver,\n defaultValue,\n style,\n ...others\n } = props;\n const uid = useUid(id);\n const normalizedData = data.map(optionResolver);\n\n const options = normalizedData.map((item) => (\n <option key={item.value} value={item.value} disabled={item.disabled}>\n {item.label}\n </option>\n ));\n\n const handleChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onChange?.(event.currentTarget.value);\n };\n\n return (\n <label htmlFor={uid} className={classNames({ error }, labelClassName)}>\n <p>{label}</p>\n <div className={classNames({ 'prefixed-input-container': prefix })}>\n {prefix && <span className=\"input-prefix\">{prefix}</span>}\n <select\n {...others}\n id={uid}\n ref={ref}\n className={classNames({ prefixed: prefix }, selectClassName)}\n disabled={disabled}\n defaultValue={defaultValue}\n style={{ paddingLeft: prefixWidth, ...style }}\n onChange={handleChange}\n >\n {options}\n </select>\n </div>\n <small>{error || helpText}</small>\n </label>\n );\n});\n\nSelect.displayName = 'Select';\n"],"names":[],"mappings":";;;;;AAEA,SAAS,qBAAqB,CAAC,MAAM,EAAE;AACvC,EAAE,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAClC,IAAI,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAC3C,EAAE;AACF,EAAE,IAAI,IAAI,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,IAAI,OAAO,IAAI,MAAM,CAAC,EAAE;AACjE,IAAI,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE;AACnE,EAAE;AACF,EAAE,OAAO,MAAM;AACf;AACY,MAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACvD,EAAE,MAAM;AACR,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,WAAW,GAAG,MAAM,GAAG,EAAE,GAAG,EAAE;AAClC,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,EAAE;AACN,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,KAAK;AACT,IAAI,cAAc,GAAG,qBAAqB;AAC1C,IAAI,YAAY;AAChB,IAAI,KAAK;AACT,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC;AAC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QAAQ,EAAE;AAChB,KAAK;AACL,IAAI;AACJ,GAAG,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,QAAQ,CAAC,CAAC;AAC5E,CAAC;AACD,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Section } from './components/Section.js';
|
|
4
|
+
import { Button } from '../Button/Button.js';
|
|
5
|
+
import { Menu } from './components/Menu.js';
|
|
6
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
7
|
+
|
|
8
|
+
const Sidebar = React.forwardRef((props, ref) => {
|
|
9
|
+
const [visible, setVisible] = React.useState(false);
|
|
10
|
+
const { mobileHeader, header, footer, activePath, onMenuItemClick, items, className } = props;
|
|
11
|
+
const [activeSubMenu, setActiveSubMenu] = React.useState({
|
|
12
|
+
expanded: true,
|
|
13
|
+
pathname: activePath
|
|
14
|
+
});
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
setActiveSubMenu((currentSubMenu) => ({
|
|
17
|
+
expanded: currentSubMenu.expanded,
|
|
18
|
+
pathname: activePath
|
|
19
|
+
}));
|
|
20
|
+
}, [activePath]);
|
|
21
|
+
function handleClick(itemId) {
|
|
22
|
+
if (itemId !== void 0) onMenuItemClick?.({ itemId });
|
|
23
|
+
}
|
|
24
|
+
function handleSubMenuExpand(item) {
|
|
25
|
+
if (activeSubMenu.expanded) {
|
|
26
|
+
const currentItemOrSubMenuItemIsOpen = (
|
|
27
|
+
// either the parent item is expanded already
|
|
28
|
+
item.pathname === activeSubMenu.pathname || // or one of its expandable children is selected
|
|
29
|
+
item.subMenu && item.subMenu.some((subMenuItem) => subMenuItem.pathname === activeSubMenu.pathname) || false
|
|
30
|
+
);
|
|
31
|
+
setActiveSubMenu({
|
|
32
|
+
expanded: item.subMenu && item.subMenu.length > 0 ? !currentItemOrSubMenuItemIsOpen : false,
|
|
33
|
+
pathname: item.pathname
|
|
34
|
+
});
|
|
35
|
+
} else {
|
|
36
|
+
setActiveSubMenu({
|
|
37
|
+
expanded: !!(item.subMenu && item.subMenu.length > 0),
|
|
38
|
+
pathname: item.pathname
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function getMenuItemsProps(item) {
|
|
43
|
+
const { pathname, subMenu, icon, label, ...rest } = item;
|
|
44
|
+
const isItemSelected = pathname === activeSubMenu.pathname;
|
|
45
|
+
const isExpanded = (
|
|
46
|
+
// item is expanded and
|
|
47
|
+
activeSubMenu.expanded && // either the current expandable section is selected
|
|
48
|
+
(isItemSelected || // or some item in the expandable section of the current item is selected or active
|
|
49
|
+
subMenu && subMenu.some((subMenuItem) => subMenuItem.pathname === activeSubMenu.pathname) || false)
|
|
50
|
+
);
|
|
51
|
+
return { isExpanded, pathname, subMenu, icon, label, otherProps: rest };
|
|
52
|
+
}
|
|
53
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("section", { className: "appnav-opener-mobile" }, /* @__PURE__ */ React.createElement(Button, { variant: "", isIconButton: true, onClick: () => setVisible(!visible) }, /* @__PURE__ */ React.createElement("i", { className: "fa-regular fa-bars" })), mobileHeader), /* @__PURE__ */ React.createElement("aside", { className: classNames("appnav-container", className, { visible }), ref }, /* @__PURE__ */ React.createElement("div", { className: "background-overlay", onClick: () => setVisible(!visible) }), /* @__PURE__ */ React.createElement("nav", { className: "appnav" }, /* @__PURE__ */ React.createElement(Section, { className: "header" }, header), /* @__PURE__ */ React.createElement(Section, null, items.map((item) => {
|
|
54
|
+
if (Array.isArray(item)) {
|
|
55
|
+
const groupKey = item[0]?.pathname ?? item[0]?.label ?? "";
|
|
56
|
+
return /* @__PURE__ */ React.createElement(Menu, { key: `menu-group-${groupKey}` }, item.map((menuItem) => {
|
|
57
|
+
const { isExpanded: isExpanded2, pathname: pathname2, subMenu: subMenu2, icon: icon2, label: label2, otherProps: otherProps2 } = getMenuItemsProps(menuItem);
|
|
58
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, { key: pathname2 ?? label2 }, /* @__PURE__ */ React.createElement(
|
|
59
|
+
Menu.Item,
|
|
60
|
+
{
|
|
61
|
+
icon: icon2,
|
|
62
|
+
active: isExpanded2,
|
|
63
|
+
onClick: () => {
|
|
64
|
+
handleClick(pathname2);
|
|
65
|
+
handleSubMenuExpand(menuItem);
|
|
66
|
+
},
|
|
67
|
+
...otherProps2
|
|
68
|
+
},
|
|
69
|
+
label2
|
|
70
|
+
), subMenu2 && subMenu2.length > 0 && isExpanded2 && /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement(Menu.SubMenu, { expanded: isExpanded2 }, subMenu2.map((subMenuItem, subMenuIndex) => {
|
|
71
|
+
const {
|
|
72
|
+
icon: subMenuIcon,
|
|
73
|
+
pathname: subMenuItemPathname,
|
|
74
|
+
label: subMenuItemLabel,
|
|
75
|
+
...subMenuItemRest
|
|
76
|
+
} = subMenuItem;
|
|
77
|
+
return /* @__PURE__ */ React.createElement(
|
|
78
|
+
Menu.Item,
|
|
79
|
+
{
|
|
80
|
+
icon: subMenuIcon,
|
|
81
|
+
key: subMenuItemPathname ?? subMenuIndex,
|
|
82
|
+
onClick: () => handleClick(subMenuItemPathname),
|
|
83
|
+
...subMenuItemRest
|
|
84
|
+
},
|
|
85
|
+
subMenuItemLabel
|
|
86
|
+
);
|
|
87
|
+
}))));
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
const { isExpanded, pathname, subMenu, icon, label, otherProps } = getMenuItemsProps(item);
|
|
91
|
+
return /* @__PURE__ */ React.createElement(Menu, { key: `menu-item-${pathname ?? label}` }, /* @__PURE__ */ React.createElement(
|
|
92
|
+
Menu.Item,
|
|
93
|
+
{
|
|
94
|
+
key: label,
|
|
95
|
+
icon,
|
|
96
|
+
active: isExpanded,
|
|
97
|
+
onClick: () => {
|
|
98
|
+
handleClick(pathname);
|
|
99
|
+
handleSubMenuExpand(item);
|
|
100
|
+
},
|
|
101
|
+
...otherProps
|
|
102
|
+
},
|
|
103
|
+
label
|
|
104
|
+
), subMenu && subMenu.length > 0 && isExpanded && /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement(Menu.SubMenu, { expanded: isExpanded }, subMenu.map((subMenuItem, subMenuIndex) => {
|
|
105
|
+
const {
|
|
106
|
+
icon: subMenuIcon,
|
|
107
|
+
pathname: subMenuItemPathname,
|
|
108
|
+
label: subMenuItemLabel,
|
|
109
|
+
...subMenuItemRest
|
|
110
|
+
} = subMenuItem;
|
|
111
|
+
return /* @__PURE__ */ React.createElement(
|
|
112
|
+
Menu.Item,
|
|
113
|
+
{
|
|
114
|
+
icon: subMenuIcon,
|
|
115
|
+
key: subMenuItemPathname ?? subMenuIndex,
|
|
116
|
+
onClick: () => handleClick(subMenuItemPathname),
|
|
117
|
+
...subMenuItemRest
|
|
118
|
+
},
|
|
119
|
+
subMenuItemLabel
|
|
120
|
+
);
|
|
121
|
+
}))));
|
|
122
|
+
})), /* @__PURE__ */ React.createElement(Section, { className: "footer" }, footer))));
|
|
123
|
+
});
|
|
124
|
+
Sidebar.Section = Section;
|
|
125
|
+
Sidebar.Menu = Menu;
|
|
126
|
+
Sidebar.displayName = "Sidebar";
|
|
127
|
+
|
|
128
|
+
export { Sidebar };
|
|
129
|
+
//# sourceMappingURL=Sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.js","sources":["../../../../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport * as React from 'react';\nimport { ForwardRefWithStaticComponents } from '@/types';\nimport { Section } from './components/Section';\nimport { classNames } from '@/utils';\nimport { Button } from '../Button';\nimport { Menu } from './components/Menu';\nimport { MenuItemProps } from './components/MenuItem';\n\nexport interface SidebarItemProps extends MenuItemProps<any> {\n /** The path of the menu entry. */\n pathname?: string;\n /** The list of submenu items. */\n subMenu?: SidebarItemProps[];\n}\n\nexport interface SidebarProps {\n /** The Sidebar header. */\n header?: React.ReactNode;\n /** The Sidebar footer. */\n footer?: React.ReactNode;\n /** The default active path */\n activePath?: string;\n /** The content to display along with the Burger icon button on mobile when the sibar is collapsed. */\n mobileHeader?: React.ReactNode;\n /** The list of menu items. */\n items: SidebarItemProps[];\n /** Called when a menu item is clicked. */\n onMenuItemClick?: ({ itemId }: { itemId: string }) => void;\n /** Additional CSS classes added to the Sidebar root element */\n className?: string;\n}\n\ntype SidebarComponent = ForwardRefWithStaticComponents<SidebarProps, { Section: typeof Section; Menu: typeof Menu }>;\n\n/**\n * The navigation of an application: a header, groups of menu items with sub-menus, and a footer. It collapses\n * behind a burger button on mobile.\n */\nexport const Sidebar: SidebarComponent = React.forwardRef<HTMLElement, SidebarProps>((props, ref) => {\n const [visible, setVisible] = React.useState(false);\n const { mobileHeader, header, footer, activePath, onMenuItemClick, items, className } = props;\n\n const [activeSubMenu, setActiveSubMenu] = React.useState({\n expanded: true,\n pathname: activePath,\n });\n\n React.useEffect(() => {\n setActiveSubMenu((currentSubMenu) => ({\n expanded: currentSubMenu.expanded,\n pathname: activePath,\n }));\n }, [activePath]);\n\n function handleClick(itemId: string | undefined): void {\n if (itemId !== undefined) onMenuItemClick?.({ itemId });\n }\n\n function handleSubMenuExpand(item: SidebarItemProps): void {\n if (activeSubMenu.expanded) {\n const currentItemOrSubMenuItemIsOpen: boolean =\n // either the parent item is expanded already\n item.pathname === activeSubMenu.pathname ||\n // or one of its expandable children is selected\n (item.subMenu && item.subMenu.some((subMenuItem) => subMenuItem.pathname === activeSubMenu.pathname)) ||\n false;\n\n setActiveSubMenu({\n expanded: item.subMenu && item.subMenu.length > 0 ? !currentItemOrSubMenuItemIsOpen : false,\n pathname: item.pathname,\n });\n } else {\n setActiveSubMenu({\n expanded: !!(item.subMenu && item.subMenu.length > 0),\n pathname: item.pathname,\n });\n }\n }\n\n function getMenuItemsProps(item: SidebarItemProps) {\n const { pathname, subMenu, icon, label, ...rest } = item;\n const isItemSelected: boolean = pathname === activeSubMenu.pathname;\n const isExpanded: boolean =\n // item is expanded and\n activeSubMenu.expanded &&\n // either the current expandable section is selected\n (isItemSelected ||\n // or some item in the expandable section of the current item is selected or active\n (subMenu && subMenu.some((subMenuItem) => subMenuItem.pathname === activeSubMenu.pathname)) ||\n false);\n\n return { isExpanded, pathname, subMenu, icon, label, otherProps: rest };\n }\n\n return (\n <>\n <section className=\"appnav-opener-mobile\">\n <Button variant=\"\" isIconButton onClick={() => setVisible(!visible)}>\n <i className=\"fa-regular fa-bars\" />\n </Button>\n {mobileHeader}\n </section>\n\n <aside className={classNames('appnav-container', className, { visible })} ref={ref}>\n <div className=\"background-overlay\" onClick={() => setVisible(!visible)} />\n <nav className=\"appnav\">\n <Section className=\"header\">{header}</Section>\n <Section>\n {items.map((item) => {\n if (Array.isArray(item)) {\n const groupKey = item[0]?.pathname ?? item[0]?.label ?? '';\n return (\n <Menu key={`menu-group-${groupKey}`}>\n {item.map((menuItem) => {\n const { isExpanded, pathname, subMenu, icon, label, otherProps } = getMenuItemsProps(menuItem);\n\n return (\n <React.Fragment key={pathname ?? label}>\n <Menu.Item\n icon={icon}\n active={isExpanded}\n onClick={() => {\n handleClick(pathname);\n handleSubMenuExpand(menuItem);\n }}\n {...otherProps}\n >\n {label}\n </Menu.Item>\n {subMenu && subMenu.length > 0 && isExpanded && (\n <li>\n <Menu.SubMenu expanded={isExpanded}>\n {subMenu.map((subMenuItem, subMenuIndex) => {\n const {\n icon: subMenuIcon,\n pathname: subMenuItemPathname,\n label: subMenuItemLabel,\n ...subMenuItemRest\n } = subMenuItem;\n return (\n <Menu.Item\n icon={subMenuIcon}\n key={subMenuItemPathname ?? subMenuIndex}\n onClick={() => handleClick(subMenuItemPathname)}\n {...subMenuItemRest}\n >\n {subMenuItemLabel}\n </Menu.Item>\n );\n })}\n </Menu.SubMenu>\n </li>\n )}\n </React.Fragment>\n );\n })}\n </Menu>\n );\n }\n\n const { isExpanded, pathname, subMenu, icon, label, otherProps } = getMenuItemsProps(item);\n\n return (\n <Menu key={`menu-item-${pathname ?? label}`}>\n <Menu.Item\n key={label}\n icon={icon}\n active={isExpanded}\n onClick={() => {\n handleClick(pathname);\n handleSubMenuExpand(item);\n }}\n {...otherProps}\n >\n {label}\n </Menu.Item>\n {subMenu && subMenu.length > 0 && isExpanded && (\n <li>\n <Menu.SubMenu expanded={isExpanded}>\n {subMenu.map((subMenuItem, subMenuIndex) => {\n const {\n icon: subMenuIcon,\n pathname: subMenuItemPathname,\n label: subMenuItemLabel,\n ...subMenuItemRest\n } = subMenuItem;\n return (\n <Menu.Item\n icon={subMenuIcon}\n key={subMenuItemPathname ?? subMenuIndex}\n onClick={() => handleClick(subMenuItemPathname)}\n {...subMenuItemRest}\n >\n {subMenuItemLabel}\n </Menu.Item>\n );\n })}\n </Menu.SubMenu>\n </li>\n )}\n </Menu>\n );\n })}\n </Section>\n <Section className=\"footer\">{footer}</Section>\n </nav>\n </aside>\n </>\n );\n}) as any;\n\nSidebar.Section = Section;\nSidebar.Menu = Menu;\nSidebar.displayName = 'Sidebar';\n"],"names":[],"mappings":";;;;;;;AAKY,MAAC,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACxD,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AACrD,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK;AAC/F,EAAE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC;AAC3D,IAAI,QAAQ,EAAE,IAAI;AAClB,IAAI,QAAQ,EAAE;AACd,GAAG,CAAC;AACJ,EAA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AC;AACT,QAAQ,GAAG;AACX,OAAO;AACP,MAAM;AACN,KAAK,EAAE,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,oBAAoB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,kBAAkB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,YAAY,KAAK;AAC7N,MAAM,MAAM;AACZ,QAAQ,IAAI,EAAE,WAAW;AACzB,QAAQ,QAAQ,EAAE,mBAAmB;AACrC,QAAQ,KAAK,EAAE,gBAAgB;AAC/B,QAAQ,GAAG;AACX,OAAO,GAAG,WAAW;AACrB,MAAM,uBAAuB,KAAK,CAAC,aAAa;AAChD,QAAQ,IAAI,CAAC,IAAI;AACjB,QAAQ;AACR,UAAU,IAAI,EAAE,WAAW;AAC3B,UAAU,GAAG,EAAE,mBAAmB,IAAI,YAAY;AAClD,UAAU,OAAO,EAAE,MAAM,WAAW,CAAC,mBAAmB,CAAC;AACzD,UAAU,GAAG;AACb,SAAS;AACT,QAAQ;AACR,OAAO;AACP,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACT,EAAE,CAAC,CAAC,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AACvF,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,OAAO;AACzB,OAAO,CAAC,IAAI,GAAG,IAAI;AACnB,OAAO,CAAC,WAAW,GAAG,SAAS;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { MenuItem } from './MenuItem.js';
|
|
4
|
+
import { SubMenu } from './SubMenu.js';
|
|
5
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
6
|
+
|
|
7
|
+
const Menu = React__default.forwardRef(({ className, children }, ref) => {
|
|
8
|
+
return /* @__PURE__ */ React__default.createElement("ul", { ref, className: classNames("menu", className) }, children);
|
|
9
|
+
});
|
|
10
|
+
Menu.displayName = "Menu";
|
|
11
|
+
Menu.Item = MenuItem;
|
|
12
|
+
Menu.SubMenu = SubMenu;
|
|
13
|
+
|
|
14
|
+
export { Menu };
|
|
15
|
+
//# sourceMappingURL=Menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.js","sources":["../../../../../src/components/Sidebar/components/Menu.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@/utils';\nimport { ForwardRefWithStaticComponents } from '@/types';\nimport { MenuItem } from './MenuItem';\nimport { SubMenu } from './SubMenu';\n\nexport interface MenuProps {\n /** Additional CSS classes added to the Menu root element */\n className?: string;\n /** Menu content */\n children?: React.ReactNode;\n}\n\ntype MenuComponent = ForwardRefWithStaticComponents<MenuProps, { Item: typeof MenuItem; SubMenu: typeof SubMenu }>;\n\nexport const Menu: MenuComponent = React.forwardRef<HTMLUListElement, MenuProps>(({ className, children }, ref) => {\n return (\n <ul ref={ref} className={classNames('menu', className)}>\n {children}\n </ul>\n );\n}) as any;\n\nMenu.displayName = 'Menu';\nMenu.Item = MenuItem;\nMenu.SubMenu = SubMenu;\n"],"names":["React"],"mappings":";;;;;;AAIY,MAAC,IAAI,GAAGA,cAAK,CAAC,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAK;AACvE,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC;AAC/G,CAAC;AACD,IAAI,CAAC,WAAW,GAAG,MAAM;AACzB,IAAI,CAAC,IAAI,GAAG,QAAQ;AACpB,IAAI,CAAC,OAAO,GAAG,OAAO;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
const MenuItemImpl = React__default.forwardRef((({ component, icon, action, children, active, className, ...restProps }, ref) => {
|
|
6
|
+
const Component = component ?? "a";
|
|
7
|
+
return /* @__PURE__ */ React__default.createElement("li", { ref }, /* @__PURE__ */ React__default.createElement(Component, { className: classNames("menu-item", className, { active }), ...restProps }, icon, children, action && /* @__PURE__ */ React__default.createElement("form", null, action)));
|
|
8
|
+
}));
|
|
9
|
+
MenuItemImpl.displayName = "MenuItem";
|
|
10
|
+
const MenuItem = MenuItemImpl;
|
|
11
|
+
|
|
12
|
+
export { MenuItem };
|
|
13
|
+
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../../../src/components/Sidebar/components/MenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport { PolymorphicComponentPropWithRef, PolymorphicRef } from '@/types';\nimport { classNames } from '@/utils';\n\nexport type MenuItemProps<C extends React.ElementType> = PolymorphicComponentPropWithRef<\n C,\n {\n /** Additional CSS classes added to the MenuItem root element */\n className?: string;\n /** Menu item content */\n children?: React.ReactNode;\n /** Menu item action put on the right side of the item */\n action?: React.ReactNode;\n /** Set the MenuItem to active */\n active?: boolean;\n /** Left icon */\n icon?: React.ReactNode;\n }\n>;\n\ntype MenuComponent = <C extends React.ElementType = 'a'>(props: MenuItemProps<C>) => React.ReactElement | null;\n\nconst MenuItemImpl = React.forwardRef(((\n { component, icon, action, children, active, className, ...restProps }: MenuItemProps<React.ElementType>,\n ref?: PolymorphicRef<React.ElementType>\n) => {\n const Component = component ?? 'a';\n\n return (\n <li ref={ref}>\n <Component className={classNames('menu-item', className, { active })} {...restProps}>\n {icon}\n {children}\n {action && <form>{action}</form>}\n </Component>\n </li>\n );\n}) as React.ForwardRefRenderFunction<unknown, MenuItemProps<React.ElementType>>);\n\nMenuItemImpl.displayName = 'MenuItem';\n\nexport const MenuItem = MenuItemImpl as unknown as MenuComponent;\n"],"names":["React"],"mappings":";;;;AAEA,MAAM,YAAY,GAAGA,cAAK,CAAC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAK;AACxH,EAAE,MAAM,SAAS,GAAG,SAAS,IAAI,GAAG;AACpC,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,kBAAkBA,cAAK,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,oBAAoBA,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAC7Q,CAAC,EAAE;AACH,YAAY,CAAC,WAAW,GAAG,UAAU;AACzB,MAAC,QAAQ,GAAG;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
function Section({ className, children }) {
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames("appnav-section", className) }, children);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { Section };
|
|
10
|
+
//# sourceMappingURL=Section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.js","sources":["../../../../../src/components/Sidebar/components/Section.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface SectionProps {\n /** Additional CSS classes added to the Section root element */\n className?: string;\n /** Section content */\n children: React.ReactNode;\n}\n\nexport function Section({ className, children }: SectionProps) {\n return <div className={classNames('appnav-section', className)}>{children}</div>;\n}\n"],"names":["React"],"mappings":";;;;AAEO,SAAS,OAAO,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;AACjD,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC;AACrH;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
function SubMenu({ children, expanded, className }) {
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("ul", { className: classNames("submenu", className, { visible: expanded }) }, children);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { SubMenu };
|
|
10
|
+
//# sourceMappingURL=SubMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubMenu.js","sources":["../../../../../src/components/Sidebar/components/SubMenu.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface SubMenuProps {\n /** SubMenu content */\n children: React.ReactNode;\n /** Additional CSS classes added to the SubMenu root element */\n className?: string;\n /** Flag indicating if the SubMenu is expanded or not */\n expanded?: boolean;\n}\n\nexport function SubMenu({ children, expanded, className }: SubMenuProps) {\n return <ul className={classNames('submenu', className, { visible: expanded })}>{children}</ul>;\n}\n"],"names":["React"],"mappings":";;;;AAEO,SAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;AAC3D,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC;AACpI;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
function Spinner({ className }) {
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames("spinner-container", className) }, /* @__PURE__ */ React__default.createElement("figure", { className: "spinner" }, /* @__PURE__ */ React__default.createElement("span", { className: "spinner" })));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { Spinner };
|
|
10
|
+
//# sourceMappingURL=Spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.js","sources":["../../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface SpinnerProps {\n className?: string;\n}\n\n/** A spinning indicator for content that is loading. */\nexport function Spinner({ className }: SpinnerProps) {\n return (\n <div className={classNames('spinner-container', className)}>\n <figure className=\"spinner\">\n <span className=\"spinner\" />\n </figure>\n </div>\n );\n}\n"],"names":["React"],"mappings":";;;;AAEO,SAAS,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE;AACvC,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAAE,kBAAkBA,cAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkBA,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AAC9P;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
4
|
+
import { Icon } from '../Icon/Icon.js';
|
|
5
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
6
|
+
|
|
7
|
+
const StatCard = React.forwardRef((props, ref) => {
|
|
8
|
+
const { title, value, description, progressValue, progressLabel, className, style } = props;
|
|
9
|
+
return /* @__PURE__ */ React.createElement("article", { ref, className: classNames("card-stat", className), style }, /* @__PURE__ */ React.createElement("div", { className: "title-wrapper" }, /* @__PURE__ */ React.createElement("p", { className: "stat-title" }, /* @__PURE__ */ React.createElement("span", null, title), description && /* @__PURE__ */ React.createElement(Tooltip, { inline: true, label: description }, /* @__PURE__ */ React.createElement(Icon, { className: "has-tooltip" }, /* @__PURE__ */ React.createElement("i", { className: "fa-regular fa-circle-info" }))))), /* @__PURE__ */ React.createElement("div", { className: "content" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { className: "stat-value" }, value), /* @__PURE__ */ React.createElement("small", null, progressLabel)), progressValue !== void 0 && progressValue >= 0 && /* @__PURE__ */ React.createElement("div", { className: "progress-container" }, /* @__PURE__ */ React.createElement("figure", { className: "progress circular" }, /* @__PURE__ */ React.createElement(
|
|
10
|
+
"span",
|
|
11
|
+
{
|
|
12
|
+
className: "progress-level",
|
|
13
|
+
"data-percent": value,
|
|
14
|
+
style: { "--percent": progressValue }
|
|
15
|
+
}
|
|
16
|
+
)))));
|
|
17
|
+
});
|
|
18
|
+
StatCard.displayName = "StatCard";
|
|
19
|
+
|
|
20
|
+
export { StatCard };
|
|
21
|
+
//# sourceMappingURL=StatCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatCard.js","sources":["../../../../src/components/StatCard/StatCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { ProgressCSSProperties } from '@/types';\nimport { Tooltip } from '../Tooltip';\nimport { Icon } from '../Icon';\n\nexport interface StatCardProps {\n /** The title of the statistic. */\n title: React.ReactNode;\n /** The value of the statistic. */\n value: React.ReactNode;\n /** The description of the statistic. */\n description?: React.ReactNode;\n /** The progress value of the statistic (optional). */\n progressValue?: number;\n /** The label for the progress value (optional). */\n progressLabel?: string;\n /** Additional CSS class name for custom styling (optional). */\n className?: string;\n /** Inline styles for the StatCard (optional). */\n style?: React.CSSProperties;\n}\n\n/** A card showing one statistic: a title, a value, a description and an optional progress bar. */\nexport const StatCard = React.forwardRef<HTMLDivElement, StatCardProps>((props, ref) => {\n const { title, value, description, progressValue, progressLabel, className, style } = props;\n return (\n <article ref={ref} className={classNames('card-stat', className)} style={style}>\n <div className=\"title-wrapper\">\n <p className=\"stat-title\">\n <span>{title}</span>\n {description && (\n <Tooltip inline label={description}>\n <Icon className=\"has-tooltip\">\n <i className=\"fa-regular fa-circle-info\" />\n </Icon>\n </Tooltip>\n )}\n </p>\n </div>\n\n <div className=\"content\">\n <div>\n <span className=\"stat-value\">{value}</span>\n <small>{progressLabel}</small>\n </div>\n\n {progressValue !== undefined && progressValue >= 0 && (\n <div className=\"progress-container\">\n <figure className=\"progress circular\">\n <span\n className=\"progress-level\"\n data-percent={value}\n style={{ '--percent': progressValue } as ProgressCSSProperties}\n />\n </figure>\n </div>\n )}\n </div>\n </article>\n );\n});\n\nStatCard.displayName = 'StatCard';\n"],"names":[],"mappings":";;;;;;AAIY,MAAC,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACzD,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK;AAC7F,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG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