@trellixio/roaster-react 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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":"DescriptiveListItem.js","sources":["../../../../src/components/DescriptiveList/DescriptiveListItem.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport interface DescriptiveListItemProps {\n /** Title of the item */\n title: React.ReactNode;\n /** Item content */\n children?: React.ReactNode;\n}\n\nexport function DescriptiveListItem({ title, children }: DescriptiveListItemProps) {\n return (\n <>\n <dt>{title}</dt>\n {/* Only a missing value shows a dash: 0 is a value. */}\n <dd>{children == null || children === '' ? '-' : children}</dd>\n </>\n );\n}\n"],"names":[],"mappings":";;;AACO,SAAS,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;AACzD,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,kBAAkB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,IAAI,IAAI,IAAI,QAAQ,KAAK,EAAE,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC;AACjO;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
const DropdownCardContext = React.createContext(null);
|
|
5
|
+
const DropdownCardProvider = DropdownCardContext.Provider;
|
|
6
|
+
const useDropdownCardContext = () => {
|
|
7
|
+
const context = React.useContext(DropdownCardContext);
|
|
8
|
+
if (context == null) {
|
|
9
|
+
throw new Error("DropdownCard components must be wrapped in <DropdownCard />");
|
|
10
|
+
}
|
|
11
|
+
return context;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { DropdownCardContext, DropdownCardProvider, useDropdownCardContext };
|
|
15
|
+
//# sourceMappingURL=DropdownCard.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownCard.context.js","sources":["../../../../src/components/DropdownCard/DropdownCard.context.ts"],"sourcesContent":["import * as React from 'react';\nimport { useDropdown } from '@/utils';\n\ntype DropdownCardContextType = ReturnType<typeof useDropdown> | null;\n\nexport const DropdownCardContext = React.createContext<DropdownCardContextType>(null);\nexport const DropdownCardProvider = DropdownCardContext.Provider;\n\nexport const useDropdownCardContext = () => {\n const context = React.useContext(DropdownCardContext);\n\n if (context == null) {\n throw new Error('DropdownCard components must be wrapped in <DropdownCard />');\n }\n\n return context;\n};\n"],"names":[],"mappings":";;;AACY,MAAC,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI;AAC/C,MAAC,oBAAoB,GAAG,mBAAmB,CAAC;AAC5C,MAAC,sBAAsB,GAAG,MAAM;AAC5C,EAAE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC;AACvD,EAAE,IAAI,OAAO,IAAI,IAAI,EAAE;AACvB,IAAI,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC;AAClF,EAAE;AACF,EAAE,OAAO,OAAO;AAChB;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { DropdownCardTrigger } from './components/DropdownCardTrigger.js';
|
|
4
|
+
import { DropdownCardActions } from './components/DropdownCardActions.js';
|
|
5
|
+
import { DropdownCardContent } from './components/DropdownCardContent.js';
|
|
6
|
+
import { DropdownCardDropdown } from './components/DropdownCardDropdown.js';
|
|
7
|
+
import { DropdownCardProvider } from './DropdownCard.context.js';
|
|
8
|
+
import { useDropdown } from '../../utils/useDropdown/index.js';
|
|
9
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
10
|
+
|
|
11
|
+
const DropdownCard = (({ children, className, ...restOptions }) => {
|
|
12
|
+
const dropdown = useDropdown({ ...restOptions });
|
|
13
|
+
return /* @__PURE__ */ React.createElement(DropdownCardProvider, { value: dropdown }, /* @__PURE__ */ React.createElement("div", { className: classNames("card-dropdown-container", className) }, children));
|
|
14
|
+
});
|
|
15
|
+
DropdownCard.Trigger = DropdownCardTrigger;
|
|
16
|
+
DropdownCard.Content = DropdownCardContent;
|
|
17
|
+
DropdownCard.Dropdown = DropdownCardDropdown;
|
|
18
|
+
DropdownCard.Actions = DropdownCardActions;
|
|
19
|
+
|
|
20
|
+
export { DropdownCard };
|
|
21
|
+
//# sourceMappingURL=DropdownCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownCard.js","sources":["../../../../src/components/DropdownCard/DropdownCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ForwardRefWithStaticComponents } from '@/types';\nimport { UseDropdownOptions, classNames, useDropdown } from '@/utils';\nimport { DropdownCardTrigger, DropdownCardContent, DropdownCardDropdown, DropdownCardActions } from './components';\nimport { DropdownCardProvider } from './DropdownCard.context';\n\nexport interface DropdownCardProps extends UseDropdownOptions {\n children: React.ReactNode;\n className?: string;\n}\n\ntype DropdownCardComponent = ForwardRefWithStaticComponents<\n DropdownCardProps,\n {\n Trigger: typeof DropdownCardTrigger;\n Content: typeof DropdownCardContent;\n Dropdown: typeof DropdownCardDropdown;\n Actions: typeof DropdownCardActions;\n }\n>;\n\n/**\n * A card that opens under a trigger button, for filters, sorting and similar forms. Compose it with\n * DropdownCard.Trigger, Dropdown, Content and Actions.\n */\nexport const DropdownCard: DropdownCardComponent = (({ children, className, ...restOptions }: DropdownCardProps) => {\n const dropdown = useDropdown({ ...restOptions });\n return (\n <DropdownCardProvider value={dropdown}>\n <div className={classNames('card-dropdown-container', className)}>{children}</div>\n </DropdownCardProvider>\n );\n}) as any;\n\nDropdownCard.Trigger = DropdownCardTrigger;\nDropdownCard.Content = DropdownCardContent;\nDropdownCard.Dropdown = DropdownCardDropdown;\nDropdownCard.Actions = DropdownCardActions;\n"],"names":[],"mappings":";;;;;;;;;;AAIY,MAAC,YAAY,IAAI,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,KAAK;AAC1E,EAAE,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC;AAClD,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC9M,CAAC;AACD,YAAY,CAAC,OAAO,GAAG,mBAAmB;AAC1C,YAAY,CAAC,OAAO,GAAG,mBAAmB;AAC1C,YAAY,CAAC,QAAQ,GAAG,oBAAoB;AAC5C,YAAY,CAAC,OAAO,GAAG,mBAAmB;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
function DropdownCardActions({ className, children }) {
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames("actions", className) }, children);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { DropdownCardActions };
|
|
10
|
+
//# sourceMappingURL=DropdownCardActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownCardActions.js","sources":["../../../../../src/components/DropdownCard/components/DropdownCardActions.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface DropdownCardActionsProps {\n className?: string;\n children: React.ReactNode;\n}\n\nexport function DropdownCardActions({ className, children }: DropdownCardActionsProps) {\n return <div className={classNames('actions', className)}>{children}</div>;\n}\n"],"names":["React"],"mappings":";;;;AAEO,SAAS,mBAAmB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;AAC7D,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC;AAC9G;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
function DropdownCardContent({ className, children }) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames("content", className) }, children);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { DropdownCardContent };
|
|
10
|
+
//# sourceMappingURL=DropdownCardContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownCardContent.js","sources":["../../../../../src/components/DropdownCard/components/DropdownCardContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface DropdownCardContentProps {\n className?: string;\n children: React.ReactNode;\n}\n\nexport function DropdownCardContent({ className, children }: DropdownCardContentProps) {\n return <div className={classNames('content', className)}>{children}</div>;\n}\n"],"names":[],"mappings":";;;;AAEO,SAAS,mBAAmB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;AAC7D,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC;AAC9G;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useMergeRefs, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
4
|
+
import { useDropdownCardContext } from '../DropdownCard.context.js';
|
|
5
|
+
import { classNames } from '../../../utils/classNames/index.js';
|
|
6
|
+
|
|
7
|
+
const DropdownCardDropdown = React.forwardRef(
|
|
8
|
+
({ width, className, style, children, ...props }, propRef) => {
|
|
9
|
+
const { context: floatingContext, ...context } = useDropdownCardContext();
|
|
10
|
+
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
11
|
+
return /* @__PURE__ */ React.createElement(FloatingPortal, null, context.open && /* @__PURE__ */ React.createElement(FloatingFocusManager, { context: floatingContext, modal: true }, /* @__PURE__ */ React.createElement(
|
|
12
|
+
"article",
|
|
13
|
+
{
|
|
14
|
+
ref,
|
|
15
|
+
...context.getFloatingProps(props),
|
|
16
|
+
style: {
|
|
17
|
+
...style,
|
|
18
|
+
position: context.strategy,
|
|
19
|
+
top: (context.y ?? 0) - 8,
|
|
20
|
+
left: context.x ?? 0
|
|
21
|
+
},
|
|
22
|
+
className: classNames("card-dropdown visible", width, className)
|
|
23
|
+
},
|
|
24
|
+
children
|
|
25
|
+
)));
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
DropdownCardDropdown.displayName = "DropdownCardDropdown";
|
|
29
|
+
|
|
30
|
+
export { DropdownCardDropdown };
|
|
31
|
+
//# sourceMappingURL=DropdownCardDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownCardDropdown.js","sources":["../../../../../src/components/DropdownCard/components/DropdownCardDropdown.tsx"],"sourcesContent":["import * as React from 'react';\nimport { FloatingFocusManager, FloatingPortal, useMergeRefs } from '@floating-ui/react';\nimport { useDropdownCardContext } from '../DropdownCard.context';\nimport { classNames } from '@/utils';\n\nexport interface DropdownCardDropdownProps extends React.HTMLProps<HTMLDivElement> {\n width?: 'small' | 'large';\n}\n\nexport const DropdownCardDropdown = React.forwardRef<HTMLDivElement, DropdownCardDropdownProps>(\n ({ width, className, style, children, ...props }, propRef) => {\n const { context: floatingContext, ...context } = useDropdownCardContext();\n const ref = useMergeRefs([context.refs.setFloating, propRef]);\n return (\n <FloatingPortal>\n {context.open && (\n <FloatingFocusManager context={floatingContext} modal>\n <article\n ref={ref}\n {...context.getFloatingProps(props as React.HTMLProps<HTMLElement>)}\n // After the spread, so a caller's className and style add to these instead of replacing them.\n style={{\n ...style,\n position: context.strategy,\n top: (context.y ?? 0) - 8,\n left: context.x ?? 0,\n }}\n className={classNames('card-dropdown visible', width, className)}\n >\n {children}\n </article>\n </FloatingFocusManager>\n )}\n </FloatingPortal>\n );\n }\n);\n\nDropdownCardDropdown.displayName = 'DropdownCardDropdown';\n"],"names":[],"mappings":";;;;;;AAIY,MAAC,oBAAoB,GAAG,KAAK,CAAC,UAAU;AACpD,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,OAAO,KAAK;AAChE,IAAI,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,EAAE,GAAG,sBAAsB,EAAE;AAC7E,IAAI,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACjE,IAAI,uBAAuB,KAAK,CAAC,aAAa,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,oBAAoB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,KAAK,CAAC,aAAa;AAC7N,MAAM,SAAS;AACf,MAAM;AACN,QAAQ,GAAG;AACX,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC;AAC1C,QAAQ,KAAK,EAAE;AACf,UAAU,GAAG,KAAK;AAClB,UAAU,QAAQ,EAAE,OAAO,CAAC,QAAQ;AACpC,UAAU,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AACnC,UAAU,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI;AAC7B,SAAS;AACT,QAAQ,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,KAAK,EAAE,SAAS;AACvE,OAAO;AACP,MAAM;AACN,KAAK,CAAC,CAAC;AACP,EAAE;AACF;AACA,oBAAoB,CAAC,WAAW,GAAG,sBAAsB;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useMergeRefs } from '@floating-ui/react';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useDropdownCardContext } from '../DropdownCard.context.js';
|
|
5
|
+
|
|
6
|
+
const DropdownCardTrigger = React.forwardRef(({ children, ...props }, propRef) => {
|
|
7
|
+
const context = useDropdownCardContext();
|
|
8
|
+
const childrenRef = children.ref;
|
|
9
|
+
const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);
|
|
10
|
+
if (!React.isValidElement(children)) {
|
|
11
|
+
throw new Error(
|
|
12
|
+
"DropdownCard.Trigger component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
return React.cloneElement(
|
|
16
|
+
children,
|
|
17
|
+
context.getReferenceProps({
|
|
18
|
+
ref,
|
|
19
|
+
...props,
|
|
20
|
+
...children.props
|
|
21
|
+
})
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
DropdownCardTrigger.displayName = "DropdownCardTrigger";
|
|
25
|
+
|
|
26
|
+
export { DropdownCardTrigger };
|
|
27
|
+
//# sourceMappingURL=DropdownCardTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownCardTrigger.js","sources":["../../../../../src/components/DropdownCard/components/DropdownCardTrigger.tsx"],"sourcesContent":["import { useMergeRefs } from '@floating-ui/react';\nimport * as React from 'react';\nimport { useDropdownCardContext } from '../DropdownCard.context';\n\nexport interface DropdownCardTriggerProps {\n /** child elements to be rendered as trigger should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported */\n children: React.ReactNode;\n}\n\nexport const DropdownCardTrigger = React.forwardRef<\n HTMLElement,\n React.HTMLProps<HTMLElement> & DropdownCardTriggerProps\n>(({ children, ...props }, propRef) => {\n const context = useDropdownCardContext();\n const childrenRef = (children as any).ref;\n const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);\n\n if (!React.isValidElement(children)) {\n throw new Error(\n 'DropdownCard.Trigger component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported'\n );\n }\n\n return React.cloneElement(\n children,\n context.getReferenceProps({\n ref,\n ...props,\n ...children.props,\n })\n );\n});\n\nDropdownCardTrigger.displayName = 'DropdownCardTrigger';\n"],"names":[],"mappings":";;;;;AAGY,MAAC,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,OAAO,KAAK;AACzF,EAAE,MAAM,OAAO,GAAG,sBAAsB,EAAE;AAC1C,EAAE,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG;AAClC,EAAE,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AAC7E,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;AACvC,IAAI,MAAM,IAAI,KAAK;AACnB,MAAM;AACN,KAAK;AACL,EAAE;AACF,EAAE,OAAO,KAAK,CAAC,YAAY;AAC3B,IAAI,QAAQ;AACZ,IAAI,OAAO,CAAC,iBAAiB,CAAC;AAC9B,MAAM,GAAG;AACT,MAAM,GAAG,KAAK;AACd,MAAM,GAAG,QAAQ,CAAC;AAClB,KAAK;AACL,GAAG;AACH,CAAC;AACD,mBAAmB,CAAC,WAAW,GAAG,qBAAqB;;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 EmptyMarkupPlaceholder({ type, defaultValue }) {
|
|
7
|
+
if (type === "file")
|
|
8
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("i", { className: "fa-regular fa-file-csv" }), /* @__PURE__ */ React.createElement("span", { className: "filename" }, "No file added"));
|
|
9
|
+
if (defaultValue) {
|
|
10
|
+
return /* @__PURE__ */ React.createElement("img", { src: defaultValue, alt: "" });
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ React.createElement("div", { className: "image-placeholder" }, /* @__PURE__ */ React.createElement("i", { className: "fa-regular fa-image" }));
|
|
13
|
+
}
|
|
14
|
+
function Preview({ type, file }) {
|
|
15
|
+
const [imageUrl, setImageUrl] = React.useState();
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (type !== "image" || !file) return void 0;
|
|
18
|
+
const url = URL.createObjectURL(file);
|
|
19
|
+
setImageUrl(url);
|
|
20
|
+
return () => URL.revokeObjectURL(url);
|
|
21
|
+
}, [type, file]);
|
|
22
|
+
if (type === "image" && file) {
|
|
23
|
+
return imageUrl ? /* @__PURE__ */ React.createElement("img", { src: imageUrl, alt: file.name }) : null;
|
|
24
|
+
}
|
|
25
|
+
return /* @__PURE__ */ React.createElement("span", { className: "filename" }, file?.name);
|
|
26
|
+
}
|
|
27
|
+
const FileField = React.forwardRef((props, ref) => {
|
|
28
|
+
const {
|
|
29
|
+
id,
|
|
30
|
+
label,
|
|
31
|
+
name,
|
|
32
|
+
disabled,
|
|
33
|
+
helpText,
|
|
34
|
+
inputClassName,
|
|
35
|
+
onChange,
|
|
36
|
+
type = "image",
|
|
37
|
+
accept = type === "image" ? "image/*" : ".csv, .xls",
|
|
38
|
+
size = "small",
|
|
39
|
+
defaultValue,
|
|
40
|
+
...others
|
|
41
|
+
} = props;
|
|
42
|
+
const uid = useUid(id);
|
|
43
|
+
const [value, setValue] = React.useState(null);
|
|
44
|
+
const handleChange = (event) => {
|
|
45
|
+
setValue(event.currentTarget.files?.[0] || null);
|
|
46
|
+
onChange?.(event.currentTarget.files?.[0] || null);
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ React.createElement("label", { htmlFor: uid }, /* @__PURE__ */ React.createElement("p", null, label), /* @__PURE__ */ React.createElement("div", { className: classNames("file-uploader", size, { uploaded: value }) }, /* @__PURE__ */ React.createElement("div", { className: classNames({ "file-preview": type === "file", "image-preview": type === "image" }) }, !value && /* @__PURE__ */ React.createElement(EmptyMarkupPlaceholder, { type, defaultValue }), value && /* @__PURE__ */ React.createElement(Preview, { type, file: value })), /* @__PURE__ */ React.createElement("div", { className: "file-input" }, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("i", { className: "fa-regular fa-arrow-up-from-bracket" }), " Upload a file"), /* @__PURE__ */ React.createElement(
|
|
49
|
+
"input",
|
|
50
|
+
{
|
|
51
|
+
...others,
|
|
52
|
+
id: uid,
|
|
53
|
+
name,
|
|
54
|
+
ref,
|
|
55
|
+
type: "file",
|
|
56
|
+
disabled,
|
|
57
|
+
accept,
|
|
58
|
+
onChange: handleChange,
|
|
59
|
+
className: inputClassName
|
|
60
|
+
}
|
|
61
|
+
))), /* @__PURE__ */ React.createElement("small", null, helpText));
|
|
62
|
+
});
|
|
63
|
+
FileField.displayName = "FileField";
|
|
64
|
+
|
|
65
|
+
export { FileField };
|
|
66
|
+
//# sourceMappingURL=FileField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileField.js","sources":["../../../../src/components/FileField/FileField.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\n\n/** Every native `<input>` prop (`multiple`, `aria-*`, `data-*`, ...) is accepted and forwarded to the file input. */\nexport interface FileFieldProps extends Omit<\n React.ComponentPropsWithoutRef<'input'>,\n 'onChange' | 'type' | 'size' | 'defaultValue' | 'value'\n> {\n /** The HTML ID attribute to be applied to the file upload field input element (optional). */\n id?: string;\n /** The name attribute to be applied to the file upload field input element (optional). */\n name?: string;\n /**\n * The accept attribute to be applied to the file upload field input element (optional).\n * Specifies the types of accepted files.\n */\n accept?: string;\n /**\n * The size of the file upload field (optional).\n * - 'small': render a smaller file upload field\n * - 'medium': render a larger file upload field\n */\n size?: 'small' | 'medium';\n /** Whether the file upload field should be disabled (optional). */\n disabled?: boolean;\n /** The default value of the file upload field input (used to display a preview image when type is image). */\n defaultValue?: string | null;\n /**\n * A function to be called when the value of the file upload field changes (optional).\n * The function receives the new file value of the input as a `File` object, or `null` if no file is selected.\n */\n onChange?(value: File | null): void;\n /** The label to be displayed above the file upload field (optional). */\n label?: React.ReactNode;\n /**\n * The type of file to be uploaded (optional).\n * - 'image': upload an image file\n * - 'file': upload any file type\n */\n type?: 'image' | 'file';\n /** Help text to be displayed below the file upload field (optional). */\n helpText?: React.ReactNode;\n /** CSS class names to be applied to the file upload field input element (optional). */\n inputClassName?: string;\n}\n\nfunction EmptyMarkupPlaceholder({ type, defaultValue }: { type: 'image' | 'file'; defaultValue?: string | null }) {\n if (type === 'file')\n return (\n <>\n <i className=\"fa-regular fa-file-csv\" />\n <span className=\"filename\">No file added</span>\n </>\n );\n\n if (defaultValue) {\n return <img src={defaultValue} alt=\"\" />;\n }\n\n return (\n <div className=\"image-placeholder\">\n <i className=\"fa-regular fa-image\" />\n </div>\n );\n}\n\nfunction Preview({ type, file }: { type: string; file: File }) {\n const [imageUrl, setImageUrl] = React.useState<string>();\n\n // One object URL per file, released when the file changes or the preview goes away, so it doesn't leak memory.\n React.useEffect(() => {\n if (type !== 'image' || !file) return undefined;\n const url = URL.createObjectURL(file);\n setImageUrl(url);\n return () => URL.revokeObjectURL(url);\n }, [type, file]);\n\n if (type === 'image' && file) {\n return imageUrl ? <img src={imageUrl} alt={file.name} /> : null;\n }\n\n return <span className=\"filename\">{file?.name}</span>;\n}\n\n/** A file upload field with a preview for images and the file name for other files. */\nexport const FileField = React.forwardRef<HTMLInputElement, FileFieldProps>((props, ref) => {\n const {\n id,\n label,\n name,\n disabled,\n helpText,\n inputClassName,\n onChange,\n type = 'image',\n accept = type === 'image' ? 'image/*' : '.csv, .xls',\n size = 'small',\n defaultValue,\n ...others\n } = props;\n const uid = useUid(id);\n const [value, setValue] = React.useState<File | null>(null);\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n setValue(event.currentTarget.files?.[0] || null);\n onChange?.(event.currentTarget.files?.[0] || null);\n };\n\n return (\n <label htmlFor={uid}>\n <p>{label}</p>\n <div className={classNames('file-uploader', size, { uploaded: value })}>\n <div className={classNames({ 'file-preview': type === 'file', 'image-preview': type === 'image' })}>\n {!value && <EmptyMarkupPlaceholder type={type} defaultValue={defaultValue} />}\n {value && <Preview type={type} file={value} />}\n </div>\n <div className=\"file-input\">\n <span>\n <i className=\"fa-regular fa-arrow-up-from-bracket\" /> Upload a file\n </span>\n <input\n {...others}\n id={uid}\n name={name}\n ref={ref}\n type=\"file\"\n disabled={disabled}\n accept={accept}\n onChange={handleChange}\n className={inputClassName}\n />\n </div>\n </div>\n <small>{helpText}</small>\n </label>\n );\n});\n\nFileField.displayName = 'FileField';\n"],"names":[],"mappings":";;;;;AAEA,SAAS,sBAAsB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE;AACxD,EAAE,IAAI,IAAI,KAAK,MAAM;AACrB,IAAI,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,eAAe,CAAC,CAAC;AAChP,EAAE,IAAI,YAAY,EAAE;AACpB,IAAI,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;AACrF,EAAE;AACF,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACvK;AACA,SAAS,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;AACjC,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE;AAClD,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;AACxB,IAAI,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,MAAM;AAChD,IAAI,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC;AACzC,IAAI,WAAW,CAAC,GAAG,CAAC;AACpB,IAAI,OAAO,MAAM,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC;AACzC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAClB,EAAE,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,EAAE;AAChC,IAAI,OAAO,QAAQ,mBAAmB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;AAC1G,EAAE;AACF,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC;AAC3F;AACY,MAAC,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AAC1D,EAAE,MAAM;AACR,IAAI,EAAE;AACN,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,cAAc;AAClB,IAAI,QAAQ;AACZ,IAAI,IAAI,GAAG,OAAO;AAClB,IAAI,MAAM,GAAG,IAAI,KAAK,OAAO,GAAG,SAAS,GAAG,YAAY;AACxD,IAAI,IAAI,GAAG,OAAO;AAClB,IAAI,YAAY;AAChB,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAChD,EAAE,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AAClC,IAAI,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;AACpD,IAAI,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;AACtD,EAAE,CAAC;AACH,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,cAAc,EAAE,IAAI,KAAK,MAAM,EAAE,eAAe,EAAE,IAAI,KAAK,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,oBAAoB,KAAK,CAAC,aAAa,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,oBAAoB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,qCAAqC,EAAE,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,KAAK,CAAC,aAAa;AAC7zB,IAAI,OAAO;AACX,IAAI;AACJ,MAAM,GAAG,MAAM;AACf,MAAM,EAAE,EAAE,GAAG;AACb,MAAM,IAAI;AACV,MAAM,GAAG;AACT,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,QAAQ,EAAE,YAAY;AAC5B,MAAM,SAAS,EAAE;AACjB;AACA,GAAG,CAAC,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AACpE,CAAC;AACD,SAAS,CAAC,WAAW,GAAG,WAAW;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
const HyperlinkCardImpl = React__default.forwardRef((({ component, children, className, ...restProps }, ref) => {
|
|
6
|
+
const Component = component ?? "a";
|
|
7
|
+
return /* @__PURE__ */ React__default.createElement(Component, { className: classNames("card-hyperlink", className), ...restProps, ref }, children);
|
|
8
|
+
}));
|
|
9
|
+
HyperlinkCardImpl.displayName = "HyperlinkCard";
|
|
10
|
+
const HyperlinkCard = HyperlinkCardImpl;
|
|
11
|
+
|
|
12
|
+
export { HyperlinkCard };
|
|
13
|
+
//# sourceMappingURL=HyperlinkCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HyperlinkCard.js","sources":["../../../../src/components/HyperlinkCard/HyperlinkCard.tsx"],"sourcesContent":["import React from 'react';\nimport { PolymorphicComponentPropWithRef, PolymorphicRef } from '@/types';\nimport { classNames } from '@/utils';\n\nexport type HyperlinkCardProps<C extends React.ElementType> = PolymorphicComponentPropWithRef<\n C,\n {\n /** HyperlinkCard content */\n children?: React.ReactNode;\n }\n>;\n\ntype HyperlinkCardComponent = <C extends React.ElementType = 'a'>(\n props: HyperlinkCardProps<C>\n) => React.ReactElement | null;\n\nconst HyperlinkCardImpl = React.forwardRef(((\n { component, children, className, ...restProps }: HyperlinkCardProps<React.ElementType>,\n ref?: PolymorphicRef<React.ElementType>\n) => {\n const Component = component ?? 'a';\n\n return (\n <Component className={classNames('card-hyperlink', className)} {...restProps} ref={ref}>\n {children}\n </Component>\n );\n}) as React.ForwardRefRenderFunction<unknown, HyperlinkCardProps<React.ElementType>>);\n\nHyperlinkCardImpl.displayName = 'HyperlinkCard';\n\n/** Turns a card, such as an ActionCard, into a link. */\nexport const HyperlinkCard = HyperlinkCardImpl as unknown as HyperlinkCardComponent;\n"],"names":["React"],"mappings":";;;;AAEA,MAAM,iBAAiB,GAAGA,cAAK,CAAC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAK;AACvG,EAAE,MAAM,SAAS,GAAG,SAAS,IAAI,GAAG;AACpC,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,EAAE,GAAG,EAAE,EAAE,QAAQ,CAAC;AAC5I,CAAC,EAAE;AACH,iBAAiB,CAAC,WAAW,GAAG,eAAe;AACnC,MAAC,aAAa,GAAG;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
const Icon = React.forwardRef((props, ref) => {
|
|
6
|
+
const { color, children, small, hasTooltip, className, ...otherProps } = props;
|
|
7
|
+
return /* @__PURE__ */ React.createElement(
|
|
8
|
+
"span",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
className: classNames("icon", color, { small }, hasTooltip ? "has-tooltip" : "", className),
|
|
12
|
+
...otherProps
|
|
13
|
+
},
|
|
14
|
+
children
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
Icon.displayName = "Icon";
|
|
18
|
+
|
|
19
|
+
export { Icon };
|
|
20
|
+
//# sourceMappingURL=Icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\n/** This type defines the different background possible for the icon */\nexport type IconColor = 'primary' | 'info' | 'success' | 'danger';\n\nexport interface IconProps extends React.ComponentProps<'span'> {\n /** The content to be displayed within the icon */\n children: React.ReactNode;\n /** The background color of the icon */\n color?: IconColor;\n /** If `true`, the icon will have a smaller size. */\n small?: boolean;\n /** If `true`, the icon will display a tooltip on hoover */\n hasTooltip?: boolean;\n}\n\n/** A rounded badge around an icon or an image, in the default color or a status color. */\nexport const Icon = React.forwardRef<HTMLSpanElement, IconProps>((props: IconProps, ref) => {\n const { color, children, small, hasTooltip, className, ...otherProps } = props;\n\n return (\n <span\n ref={ref}\n className={classNames('icon', color, { small }, hasTooltip ? 'has-tooltip' : '', className)}\n {...otherProps}\n >\n {children}\n </span>\n );\n});\n\nIcon.displayName = 'Icon';\n"],"names":[],"mappings":";;;;AAEY,MAAC,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACrD,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK;AAChF,EAAE,uBAAuB,KAAK,CAAC,aAAa;AAC5C,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,UAAU,GAAG,aAAa,GAAG,EAAE,EAAE,SAAS,CAAC;AACjG,MAAM,GAAG;AACT,KAAK;AACL,IAAI;AACJ,GAAG;AACH,CAAC;AACD,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
4
|
+
|
|
5
|
+
function Loader({ percentage = 30, className }) {
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames("loader-container", className) }, /* @__PURE__ */ React__default.createElement("figure", { className: "loader" }, /* @__PURE__ */ React__default.createElement("span", { className: "loading-level", style: { "--percent": `${percentage}%` } })));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { Loader };
|
|
10
|
+
//# sourceMappingURL=Loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader.js","sources":["../../../../src/components/Loader/Loader.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@/utils';\nimport { ProgressCSSProperties } from '@/types';\n\nexport interface LoaderProps {\n percentage?: number;\n className?: string;\n}\n\n/** A loading bar that fills to the given percentage. */\nexport function Loader({ percentage = 30, className }: LoaderProps) {\n return (\n <div className={classNames('loader-container', className)}>\n <figure className=\"loader\">\n <span className=\"loading-level\" style={{ '--percent': `${percentage}%` } as ProgressCSSProperties} />\n </figure>\n </div>\n );\n}\n"],"names":["React"],"mappings":";;;;AAEO,SAAS,MAAM,CAAC,EAAE,UAAU,GAAG,EAAE,EAAE,SAAS,EAAE,EAAE;AACvD,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE,SAAS,CAAC,EAAE,kBAAkBA,cAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkBA,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC5S;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ButtonIcon } from '../ButtonIcon/ButtonIcon.js';
|
|
4
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
5
|
+
|
|
6
|
+
function Modal({ className, opened, title, onClose, children, size = "small", footer }) {
|
|
7
|
+
if (!opened) return null;
|
|
8
|
+
return /* @__PURE__ */ React.createElement("section", { className: "modal visible" }, /* @__PURE__ */ React.createElement("div", { className: "background-overlay", onClick: onClose }), /* @__PURE__ */ React.createElement("div", { className: classNames("modal-popup", size, className) }, /* @__PURE__ */ React.createElement("div", { className: "modal-header" }, /* @__PURE__ */ React.createElement("h3", null, title), /* @__PURE__ */ React.createElement(ButtonIcon, { variant: "close-modal", onClick: onClose }, /* @__PURE__ */ React.createElement("i", { className: "fa-regular fa-xmark" }))), /* @__PURE__ */ React.createElement("div", { className: "modal-body" }, children), footer && /* @__PURE__ */ React.createElement("div", { className: "modal-footer" }, footer)));
|
|
9
|
+
}
|
|
10
|
+
Modal.displayName = "Modal";
|
|
11
|
+
|
|
12
|
+
export { Modal };
|
|
13
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../../src/components/Modal/Modal.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 { classNames } from '@/utils';\nimport { ModalProps } from './types';\nimport { ButtonIcon } from '../ButtonIcon';\n\n/**\n * A dialog over the page with a title, content and an optional footer. Open it with the opened prop, or with\n * openModal() through ModalProvider.\n */\nexport function Modal({ className, opened, title, onClose, children, size = 'small', footer }: ModalProps) {\n if (!opened) return null;\n\n return (\n <section className=\"modal visible\">\n <div className=\"background-overlay\" onClick={onClose} />\n <div className={classNames('modal-popup', size, className)}>\n <div className=\"modal-header\">\n <h3>{title}</h3>\n <ButtonIcon variant=\"close-modal\" onClick={onClose}>\n <i className=\"fa-regular fa-xmark\" />\n </ButtonIcon>\n </div>\n <div className=\"modal-body\">{children}</div>\n {footer && <div className=\"modal-footer\">{footer}</div>}\n </div>\n </section>\n );\n}\n\nModal.displayName = 'Modal';\n"],"names":[],"mappings":";;;;;AAGO,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAG,OAAO,EAAE,MAAM,EAAE,EAAE;AAC/F,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI;AAC1B,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,CAAC,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM,oBAAoB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AACnwB;AACA,KAAK,CAAC,WAAW,GAAG,OAAO;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { Button } from '../../Button/Button.js';
|
|
4
|
+
import { useModal } from '../utils/useModal.js';
|
|
5
|
+
|
|
6
|
+
function ModalProviderFooter({
|
|
7
|
+
cancelProps,
|
|
8
|
+
confirmProps,
|
|
9
|
+
labels = { confirm: "Confirm", cancel: "Cancel" },
|
|
10
|
+
closeOnConfirm = true,
|
|
11
|
+
closeOnCancel = true,
|
|
12
|
+
onCancel,
|
|
13
|
+
onConfirm
|
|
14
|
+
}) {
|
|
15
|
+
const { cancel: cancelLabel, confirm: confirmLabel } = labels;
|
|
16
|
+
const ctx = useModal();
|
|
17
|
+
const handleCancel = (event) => {
|
|
18
|
+
typeof cancelProps?.onClick === "function" && cancelProps?.onClick(event);
|
|
19
|
+
typeof onCancel === "function" && onCancel();
|
|
20
|
+
closeOnCancel && ctx.closeModal();
|
|
21
|
+
};
|
|
22
|
+
const handleConfirm = (event) => {
|
|
23
|
+
typeof confirmProps?.onClick === "function" && confirmProps?.onClick(event);
|
|
24
|
+
typeof onConfirm === "function" && onConfirm();
|
|
25
|
+
closeOnConfirm && ctx.closeModal();
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Button, { variant: "primary", color: "danger", ...cancelProps, onClick: handleCancel }, cancelProps?.children || cancelLabel), /* @__PURE__ */ React__default.createElement(Button, { variant: "primary", color: "success", ...confirmProps, onClick: handleConfirm }, confirmProps?.children || confirmLabel));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { ModalProviderFooter };
|
|
31
|
+
//# sourceMappingURL=ModalProviderFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalProviderFooter.js","sources":["../../../../../src/components/Modal/ModalProvider/ModalProviderFooter.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-expressions */\nimport React from 'react';\nimport { Button } from '@/components/Button';\nimport { ModalProviderFooterProps } from '../types';\nimport { useModal } from '../utils/useModal';\n\nexport function ModalProviderFooter({\n cancelProps,\n confirmProps,\n labels = { confirm: 'Confirm', cancel: 'Cancel' },\n closeOnConfirm = true,\n closeOnCancel = true,\n onCancel,\n onConfirm,\n}: ModalProviderFooterProps) {\n const { cancel: cancelLabel, confirm: confirmLabel } = labels;\n const ctx = useModal();\n\n const handleCancel = (event: React.MouseEvent<HTMLButtonElement>) => {\n typeof cancelProps?.onClick === 'function' && cancelProps?.onClick(event);\n typeof onCancel === 'function' && onCancel();\n closeOnCancel && ctx.closeModal();\n };\n\n const handleConfirm = (event: React.MouseEvent<HTMLButtonElement>) => {\n typeof confirmProps?.onClick === 'function' && confirmProps?.onClick(event);\n typeof onConfirm === 'function' && onConfirm();\n closeOnConfirm && ctx.closeModal();\n };\n\n return (\n <>\n <Button variant=\"primary\" color=\"danger\" {...cancelProps} onClick={handleCancel}>\n {cancelProps?.children || cancelLabel}\n </Button>\n\n <Button variant=\"primary\" color=\"success\" {...confirmProps} onClick={handleConfirm}>\n {confirmProps?.children || confirmLabel}\n </Button>\n </>\n );\n}\n"],"names":["React"],"mappings":";;;;;AAGO,SAAS,mBAAmB,CAAC;AACpC,EAAE,WAAW;AACb,EAAE,YAAY;AACd,EAAE,MAAM,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE;AACnD,EAAE,cAAc,GAAG,IAAI;AACvB,EAAE,aAAa,GAAG,IAAI;AACtB,EAAE,QAAQ;AACV,EAAE;AACF,CAAC,EAAE;AACH,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM;AAC/D,EAAE,MAAM,GAAG,GAAG,QAAQ,EAAE;AACxB,EAAE,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AAClC,IAAI,OAAO,WAAW,EAAE,OAAO,KAAK,UAAU,IAAI,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC;AAC7E,IAAI,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,EAAE;AAChD,IAAI,aAAa,IAAI,GAAG,CAAC,UAAU,EAAE;AACrC,EAAE,CAAC;AACH,EAAE,MAAM,aAAa,GAAG,CAAC,KAAK,KAAK;AACnC,IAAI,OAAO,YAAY,EAAE,OAAO,KAAK,UAAU,IAAI,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC;AAC/E,IAAI,OAAO,SAAS,KAAK,UAAU,IAAI,SAAS,EAAE;AAClD,IAAI,cAAc,IAAI,GAAG,CAAC,UAAU,EAAE;AACtC,EAAE,CAAC;AACH,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAACA,cAAK,CAAC,QAAQ,EAAE,IAAI,kBAAkBA,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,QAAQ,IAAI,WAAW,CAAC,kBAAkBA,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,YAAY,EAAE,QAAQ,IAAI,YAAY,CAAC,CAAC;AAC7Y;;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Modal } from '../Modal.js';
|
|
4
|
+
import { useModalEvents } from '../utils/events.js';
|
|
5
|
+
import { modalReducer, getModalProviderFooterProps } from '../utils/reducer.js';
|
|
6
|
+
import { ModalContextProvider } from '../utils/useModal.js';
|
|
7
|
+
import { ModalProviderFooter } from './ModalProviderFooter.js';
|
|
8
|
+
|
|
9
|
+
function ModalProvider({ children, modalProps: sharedProps }) {
|
|
10
|
+
const [state, dispatch] = React.useReducer(modalReducer, null);
|
|
11
|
+
const stateRef = React.useRef(state);
|
|
12
|
+
stateRef.current = state;
|
|
13
|
+
const openModal = React.useCallback(
|
|
14
|
+
({ ...props }) => {
|
|
15
|
+
dispatch({
|
|
16
|
+
type: "OPEN",
|
|
17
|
+
modal: {
|
|
18
|
+
props
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
[dispatch]
|
|
23
|
+
);
|
|
24
|
+
const closeModal = React.useCallback(() => {
|
|
25
|
+
stateRef.current?.props.onClose?.();
|
|
26
|
+
dispatch({ type: "CLOSE" });
|
|
27
|
+
}, [stateRef, dispatch]);
|
|
28
|
+
const ctx = React.useMemo(
|
|
29
|
+
() => ({
|
|
30
|
+
modal: state,
|
|
31
|
+
openModal,
|
|
32
|
+
closeModal
|
|
33
|
+
}),
|
|
34
|
+
[state, openModal, closeModal]
|
|
35
|
+
);
|
|
36
|
+
useModalEvents({
|
|
37
|
+
openModal,
|
|
38
|
+
closeModal
|
|
39
|
+
});
|
|
40
|
+
const getModalProps = () => {
|
|
41
|
+
const modalState = stateRef.current?.props;
|
|
42
|
+
if (modalState) {
|
|
43
|
+
const { modalProps: modalProps2, footerProps } = getModalProviderFooterProps(modalState);
|
|
44
|
+
return {
|
|
45
|
+
modalProps: { ...modalProps2 },
|
|
46
|
+
children: modalState.children,
|
|
47
|
+
footer: /* @__PURE__ */ React.createElement(ModalProviderFooter, { ...footerProps, labels: modalState.labels || footerProps.labels })
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
modalProps: {},
|
|
52
|
+
children: null
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
const { modalProps, footer, children: modalChildren } = getModalProps();
|
|
56
|
+
return /* @__PURE__ */ React.createElement(ModalContextProvider, { value: ctx }, /* @__PURE__ */ React.createElement(
|
|
57
|
+
Modal,
|
|
58
|
+
{
|
|
59
|
+
footer,
|
|
60
|
+
...sharedProps,
|
|
61
|
+
...modalProps,
|
|
62
|
+
opened: modalChildren != null,
|
|
63
|
+
onClose: () => closeModal()
|
|
64
|
+
},
|
|
65
|
+
modalChildren
|
|
66
|
+
), children);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { ModalProvider };
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/Modal/ModalProvider/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Modal } from '../Modal';\nimport { ModalContextProps, ModalSettings, ModalProviderProps, ModalState } from '../types';\nimport { getModalProviderFooterProps, modalReducer, ModalContextProvider, useModalEvents } from '../utils';\nimport { ModalProviderFooter } from './ModalProviderFooter';\n\nexport function ModalProvider({ children, modalProps: sharedProps }: ModalProviderProps) {\n // `null` while no modal is open. The shared props are applied to every modal when rendering it, below.\n const [state, dispatch] = React.useReducer(modalReducer, null as ModalState | null);\n const stateRef = React.useRef(state);\n stateRef.current = state;\n\n const openModal = React.useCallback(\n ({ ...props }: ModalSettings) => {\n dispatch({\n type: 'OPEN',\n modal: {\n props,\n },\n });\n },\n [dispatch]\n );\n\n const closeModal = React.useCallback(() => {\n // Called here rather than in the reducer: React runs reducers twice in StrictMode, which called onClose twice.\n stateRef.current?.props.onClose?.();\n dispatch({ type: 'CLOSE' });\n }, [stateRef, dispatch]);\n\n const ctx: ModalContextProps = React.useMemo(\n () => ({\n modal: state,\n openModal,\n closeModal,\n }),\n [state, openModal, closeModal]\n );\n useModalEvents({\n openModal,\n closeModal,\n });\n\n const getModalProps = () => {\n const modalState = stateRef.current?.props;\n\n if (modalState) {\n const { modalProps, footerProps } = getModalProviderFooterProps(modalState);\n\n return {\n modalProps: { ...modalProps },\n children: modalState.children,\n footer: <ModalProviderFooter {...footerProps} labels={modalState.labels || footerProps.labels} />,\n };\n }\n\n return {\n modalProps: {},\n children: null as React.ReactNode,\n };\n };\n\n const { modalProps, footer, children: modalChildren } = getModalProps();\n\n return (\n <ModalContextProvider value={ctx}>\n <Modal\n footer={footer}\n {...sharedProps}\n {...modalProps}\n opened={modalChildren != null}\n onClose={() => closeModal()}\n >\n {modalChildren}\n </Modal>\n\n {children}\n </ModalContextProvider>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAIO,SAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE;AACrE,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC;AAChE,EAAE,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AACtC,EAAE,QAAQ,CAAC,OAAO,GAAG,KAAK;AAC1B,EAAE,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW;AACrC,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,KAAK;AACtB,MAAM,QAAQ,CAAC;AACf,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,KAAK,EAAE;AACf,UAAU;AACV;AACA,OAAO,CAAC;AACR,IAAI,CAAC;AACL,IAAI,CAAC,QAAQ;AACb,GAAG;AACH,EAAE,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM;AAC7C,IAAI,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI;AACvC,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC/B,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC1B,EAAE,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO;AAC3B,IAAI,OAAO;AACX,MAAM,KAAK,EAAE,KAAK;AAClB,MAAM,SAAS;AACf,MAAM;AACN,KAAK,CAAC;AACN,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU;AACjC,GAAG;AACH,EAAE,cAAc,CAAC;AACjB,IAAI,SAAS;AACb,IAAI;AACJ,GAAG,CAAC;AACJ,EAAE,MAAM,aAAa,GAAG,MAAM;AAC9B,IAAI,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,EAAE,KAAK;AAC9C,IAAI,IAAI,UAAU,EAAE;AACpB,MAAM,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,2BAA2B,CAAC,UAAU,CAAC;AAC9F,MAAM,OAAO;AACb,QAAQ,UAAU,EAAE,EAAE,GAAG,WAAW,EAAE;AACtC,QAAQ,QAAQ,EAAE,UAAU,CAAC,QAAQ;AACrC,QAAQ,MAAM,kBAAkB,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE;AAC5I,OAAO;AACP,IAAI;AACJ,IAAI,OAAO;AACX,MAAM,UAAU,EAAE,EAAE;AACpB,MAAM,QAAQ,EAAE;AAChB,KAAK;AACL,EAAE,CAAC;AACH,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE;AACzE,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,kBAAkB,KAAK,CAAC,aAAa;AACtH,IAAI,KAAK;AACT,IAAI;AACJ,MAAM,MAAM;AACZ,MAAM,GAAG,WAAW;AACpB,MAAM,GAAG,UAAU;AACnB,MAAM,MAAM,EAAE,aAAa,IAAI,IAAI;AACnC,MAAM,OAAO,EAAE,MAAM,UAAU;AAC/B,KAAK;AACL,IAAI;AACJ,GAAG,EAAE,QAAQ,CAAC;AACd;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createUseExternalEvents } from '../../../utils/createUseExternalEvents/index.js';
|
|
3
|
+
|
|
4
|
+
const [useModalEvents, createModalEvent] = createUseExternalEvents("roaster-modal");
|
|
5
|
+
const openModal = createModalEvent("openModal");
|
|
6
|
+
const closeModal = createModalEvent("closeModal");
|
|
7
|
+
const modals = {
|
|
8
|
+
open: openModal,
|
|
9
|
+
close: closeModal
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { closeModal, createModalEvent, modals, openModal, useModalEvents };
|
|
13
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sources":["../../../../../src/components/Modal/utils/events.ts"],"sourcesContent":["import { createUseExternalEvents } from '@/utils';\nimport { ModalEvents } from '../types';\n\nexport const [useModalEvents, createModalEvent] = createUseExternalEvents<ModalEvents>('roaster-modal');\n\nexport const openModal = createModalEvent('openModal');\nexport const closeModal = createModalEvent('closeModal');\n\nexport const modals = {\n open: openModal,\n close: closeModal,\n};\n"],"names":[],"mappings":";;;AACY,MAAC,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG,uBAAuB,CAAC,eAAe;AAC7E,MAAC,SAAS,GAAG,gBAAgB,CAAC,WAAW;AACzC,MAAC,UAAU,GAAG,gBAAgB,CAAC,YAAY;AAC3C,MAAC,MAAM,GAAG;AACtB,EAAE,IAAI,EAAE,SAAS;AACjB,EAAE,KAAK,EAAE;AACT;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
function modalReducer(state, action) {
|
|
3
|
+
switch (action.type) {
|
|
4
|
+
case "OPEN": {
|
|
5
|
+
return {
|
|
6
|
+
...action.modal
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
case "CLOSE": {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
default: {
|
|
13
|
+
return state;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function getModalProviderFooterProps(props) {
|
|
18
|
+
if (!props) {
|
|
19
|
+
return { footerProps: {}, modalProps: {} };
|
|
20
|
+
}
|
|
21
|
+
const { onCancel, onConfirm, closeOnConfirm, closeOnCancel, cancelProps, confirmProps, labels, ...others } = props;
|
|
22
|
+
return {
|
|
23
|
+
footerProps: {
|
|
24
|
+
onCancel,
|
|
25
|
+
onConfirm,
|
|
26
|
+
closeOnConfirm,
|
|
27
|
+
closeOnCancel,
|
|
28
|
+
cancelProps,
|
|
29
|
+
confirmProps,
|
|
30
|
+
labels
|
|
31
|
+
},
|
|
32
|
+
modalProps: {
|
|
33
|
+
...others
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { getModalProviderFooterProps, modalReducer };
|
|
39
|
+
//# sourceMappingURL=reducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.js","sources":["../../../../../src/components/Modal/utils/reducer.ts"],"sourcesContent":["import { ModalProviderFooterProps, ModalState } from '../types';\n\ninterface OpenAction {\n type: 'OPEN';\n modal: ModalState;\n}\n\ninterface CloseAction {\n type: 'CLOSE';\n}\n\n/** Keep this function pure: React may call it twice. Side effects such as `onClose` belong to the provider. */\nexport function modalReducer(state: ModalState | null, action: OpenAction | CloseAction): ModalState | null {\n switch (action.type) {\n case 'OPEN': {\n return {\n ...action.modal,\n };\n }\n case 'CLOSE': {\n return null;\n }\n\n default: {\n return state;\n }\n }\n}\n\nexport function getModalProviderFooterProps(props: ModalProviderFooterProps) {\n if (!props) {\n return { footerProps: {}, modalProps: {} };\n }\n\n const { onCancel, onConfirm, closeOnConfirm, closeOnCancel, cancelProps, confirmProps, labels, ...others } = props;\n\n return {\n footerProps: {\n onCancel,\n onConfirm,\n closeOnConfirm,\n closeOnCancel,\n cancelProps,\n confirmProps,\n labels,\n },\n modalProps: {\n ...others,\n },\n };\n}\n"],"names":[],"mappings":";AAAO,SAAS,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE;AAC5C,EAAE,QAAQ,MAAM,CAAC,IAAI;AACrB,IAAI,KAAK,MAAM,EAAE;AACjB,MAAM,OAAO;AACb,QAAQ,GAAG,MAAM,CAAC;AAClB,OAAO;AACP,IAAI;AACJ,IAAI,KAAK,OAAO,EAAE;AAClB,MAAM,OAAO,IAAI;AACjB,IAAI;AACJ,IAAI,SAAS;AACb,MAAM,OAAO,KAAK;AAClB,IAAI;AACJ;AACA;AACO,SAAS,2BAA2B,CAAC,KAAK,EAAE;AACnD,EAAE,IAAI,CAAC,KAAK,EAAE;AACd,IAAI,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;AAC9C,EAAE;AACF,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AACpH,EAAE,OAAO;AACT,IAAI,WAAW,EAAE;AACjB,MAAM,QAAQ;AACd,MAAM,SAAS;AACf,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,WAAW;AACjB,MAAM,YAAY;AAClB,MAAM;AACN,KAAK;AACL,IAAI,UAAU,EAAE;AAChB,MAAM,GAAG;AACT;AACA,GAAG;AACH;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
const ModalContext = React.createContext(null);
|
|
5
|
+
const ModalContextProvider = ModalContext.Provider;
|
|
6
|
+
function useModal() {
|
|
7
|
+
const ctx = React.useContext(ModalContext);
|
|
8
|
+
if (!ctx) {
|
|
9
|
+
throw new Error("useModal hook was called outside of context, wrap your app with ModalProvider component");
|
|
10
|
+
}
|
|
11
|
+
return ctx;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { ModalContext, ModalContextProvider, useModal };
|
|
15
|
+
//# sourceMappingURL=useModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useModal.js","sources":["../../../../../src/components/Modal/utils/useModal.ts"],"sourcesContent":["import * as React from 'react';\nimport { ModalContextProps } from '../types';\n\nexport const ModalContext = React.createContext<ModalContextProps>(null as unknown as ModalContextProps);\nexport const ModalContextProvider = ModalContext.Provider;\n\nexport function useModal() {\n const ctx = React.useContext(ModalContext);\n\n if (!ctx) {\n throw new Error('useModal hook was called outside of context, wrap your app with ModalProvider component');\n }\n\n return ctx;\n}\n"],"names":[],"mappings":";;;AACY,MAAC,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI;AACxC,MAAC,oBAAoB,GAAG,YAAY,CAAC;AAC1C,SAAS,QAAQ,GAAG;AAC3B,EAAE,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC;AAC5C,EAAE,IAAI,CAAC,GAAG,EAAE;AACZ,IAAI,MAAM,IAAI,KAAK,CAAC,yFAAyF,CAAC;AAC9G,EAAE;AACF,EAAE,OAAO,GAAG;AACZ;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Spinner } from '../Spinner/Spinner.js';
|
|
4
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
5
|
+
|
|
6
|
+
function Page({
|
|
7
|
+
title,
|
|
8
|
+
className,
|
|
9
|
+
size = "medium",
|
|
10
|
+
children,
|
|
11
|
+
breadcrumbs,
|
|
12
|
+
primaryAction,
|
|
13
|
+
secondaryAction,
|
|
14
|
+
loading
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ React.createElement("main", { className: classNames(size, className) }, /* @__PURE__ */ React.createElement("section", { className: "page-header" }, breadcrumbs != null && breadcrumbs.length > 0 ? /* @__PURE__ */ React.createElement("nav", { className: "breadcrumbs" }, breadcrumbs.map(({ component, content, ...restProps }) => {
|
|
17
|
+
const Component = component || "a";
|
|
18
|
+
return /* @__PURE__ */ React.createElement(Component, { key: `breadcrumb-${content}`, ...restProps }, /* @__PURE__ */ React.createElement("span", null, content));
|
|
19
|
+
})) : null, /* @__PURE__ */ React.createElement("div", { className: "title-wrapper" }, /* @__PURE__ */ React.createElement("h2", null, title), loading && /* @__PURE__ */ React.createElement(Spinner, null), (secondaryAction || primaryAction) && /* @__PURE__ */ React.createElement("div", { className: "items-group" }, primaryAction, secondaryAction))), children);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { Page };
|
|
23
|
+
//# sourceMappingURL=Page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.js","sources":["../../../../src/components/Page/Page.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { Spinner } from '../Spinner';\nimport { PolymorphicComponentPropWithRef } from '@/types';\n\nexport type BreadcrumbsItem<C extends React.ElementType> = PolymorphicComponentPropWithRef<\n C,\n {\n /** Additional CSS classes added to the BreadcrumbItem root element */\n className?: string;\n /** Menu BreadcrumbItem content */\n content: React.ReactNode;\n }\n>;\n\nexport interface PageProps {\n /** The title of the page (required). */\n title: string;\n /** The child elements to be rendered within the page (optional). */\n children?: React.ReactNode;\n /**\n * An array of breadcrumb items to be displayed at the top of the page (optional).\n * Each breadcrumb item should have a `content` and a `url` property.\n */\n breadcrumbs?: BreadcrumbsItem<any>[];\n /** The primary action element to be displayed in the header of the page (optional). */\n primaryAction?: React.ReactNode;\n /** The secondary action element to be displayed in the header of the page (optional). */\n secondaryAction?: React.ReactNode;\n /** CSS class names to be applied to the page element (optional). */\n className?: string;\n /**\n * The size of the page (optional).\n * - 'full': render the page in full width\n * - 'medium': render the page at most 768px wide\n * - 'large': render the page at most 1128px wide\n */\n size?: 'full' | 'medium' | 'large';\n /** Indicate if loading spinner should be displayed aside the page title */\n loading?: boolean;\n}\n\n/**\n * The frame of a page: title, breadcrumbs, primary and secondary actions, and the page content. Renders a main\n * element.\n */\nexport function Page({\n title,\n className,\n size = 'medium',\n children,\n breadcrumbs,\n primaryAction,\n secondaryAction,\n loading,\n}: PageProps) {\n return (\n <main className={classNames(size, className)}>\n <section className=\"page-header\">\n {breadcrumbs != null && breadcrumbs.length > 0 ? (\n <nav className=\"breadcrumbs\">\n {breadcrumbs.map(({ component, content, ...restProps }) => {\n const Component = component || 'a';\n return (\n <Component key={`breadcrumb-${content}`} {...restProps}>\n <span>{content}</span>\n </Component>\n );\n })}\n </nav>\n ) : null}\n <div className=\"title-wrapper\">\n <h2>{title}</h2>\n {loading && <Spinner />}\n {(secondaryAction || primaryAction) && (\n <div className=\"items-group\">\n {primaryAction}\n {secondaryAction}\n </div>\n )}\n </div>\n </section>\n {children}\n </main>\n );\n}\n"],"names":[],"mappings":";;;;;AAGO,SAAS,IAAI,CAAC;AACrB,EAAE,KAAK;AACP,EAAE,SAAS;AACX,EAAE,IAAI,GAAG,QAAQ;AACjB,EAAE,QAAQ;AACV,EAAE,WAAW;AACb,EAAE,aAAa;AACf,EAAE,eAAe;AACjB,EAAE;AACF,CAAC,EAAE;AACH,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,WAAW,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,mBAAmB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,KAAK;AACjW,IAAI,MAAM,SAAS,GAAG,SAAS,IAAI,GAAG;AACtC,IAAI,uBAAuB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACrK,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,oBAAoB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,eAAe,IAAI,aAAa,qBAAqB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC;AAC3W;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Button } from '../Button/Button.js';
|
|
4
|
+
import { classNames } from '../../utils/classNames/index.js';
|
|
5
|
+
|
|
6
|
+
function Pagination({
|
|
7
|
+
onNext,
|
|
8
|
+
onPrevious,
|
|
9
|
+
hasNext,
|
|
10
|
+
hasPrevious,
|
|
11
|
+
previousButtonProps,
|
|
12
|
+
nextButtonProps,
|
|
13
|
+
className
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ React.createElement("nav", { className: classNames("pagination", className) }, /* @__PURE__ */ React.createElement(Button, { variant: "secondary", disabled: !hasPrevious, onClick: () => onPrevious?.(), ...previousButtonProps }, /* @__PURE__ */ React.createElement("i", { className: "fa-regular fa-chevron-left" })), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", disabled: !hasNext, onClick: () => onNext?.(), ...nextButtonProps }, /* @__PURE__ */ React.createElement("i", { className: "fa-regular fa-chevron-right" })));
|
|
16
|
+
}
|
|
17
|
+
Pagination.displayName = "Pagination";
|
|
18
|
+
|
|
19
|
+
export { Pagination };
|
|
20
|
+
//# sourceMappingURL=Pagination.js.map
|