@react-fabric/core 1.0.0-beta.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 +21 -0
- package/README.md +10 -0
- package/css/flags.rect.css +1607 -0
- package/css/flags.wavy.css +1606 -0
- package/css/index.js +250 -0
- package/css/reset/_gradients.css +51 -0
- package/css/reset/_reset.css +407 -0
- package/css/reset/_text.css +179 -0
- package/css/reset/_theme.css +110 -0
- package/css/reset/index.css +27 -0
- package/css/styles.css +31 -0
- package/css/tailwind/colors.ts +158 -0
- package/dist/cjs/components/actionLabel/ActionLabel.js +56 -0
- package/dist/cjs/components/actionLabel/ActionLabel.module.css +1 -0
- package/dist/cjs/components/animations/Animations.js +135 -0
- package/dist/cjs/components/animations/Animations.module.css +1 -0
- package/dist/cjs/components/avatar/Avatar.js +144 -0
- package/dist/cjs/components/avatar/Avatar.module.css +1 -0
- package/dist/cjs/components/avatar/AvatarGroup.js +74 -0
- package/dist/cjs/components/badge/Badge.js +82 -0
- package/dist/cjs/components/badge/Badge.module.css +1 -0
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +71 -0
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.module.css +1 -0
- package/dist/cjs/components/button/Button.js +170 -0
- package/dist/cjs/components/button/Button.module.css +1 -0
- package/dist/cjs/components/button/ButtonGroup.js +41 -0
- package/dist/cjs/components/button/ConfirmButton.js +166 -0
- package/dist/cjs/components/button/ToggleButtonGroup.js +68 -0
- package/dist/cjs/components/callout/Callout.js +54 -0
- package/dist/cjs/components/card/Card.js +62 -0
- package/dist/cjs/components/card/Card.module.css +1 -0
- package/dist/cjs/components/card/CardCover.js +48 -0
- package/dist/cjs/components/chip/Chip.js +94 -0
- package/dist/cjs/components/chip/Chip.module.css +1 -0
- package/dist/cjs/components/collapsable/Collapsable.js +84 -0
- package/dist/cjs/components/collapsable/Collapsable.module.css +1 -0
- package/dist/cjs/components/divider/Divider.js +65 -0
- package/dist/cjs/components/dropdown/Dropdown.js +180 -0
- package/dist/cjs/components/dropdown/Dropdown.module.css +1 -0
- package/dist/cjs/components/dropdown/DropdownTool.js +26 -0
- package/dist/cjs/components/empty/EmptyContent.js +92 -0
- package/dist/cjs/components/icon/Icon.js +106 -0
- package/dist/cjs/components/icon/Icon.module.css +1 -0
- package/dist/cjs/components/media/Media.js +149 -0
- package/dist/cjs/components/media/Media.module.css +1 -0
- package/dist/cjs/components/menu/ContextMenu.js +84 -0
- package/dist/cjs/components/menu/Menu.js +204 -0
- package/dist/cjs/components/menu/Menu.module.css +1 -0
- package/dist/cjs/components/menu/MenuItem.js +119 -0
- package/dist/cjs/components/meter/Meter.js +41 -0
- package/dist/cjs/components/meter/Meter.module.css +1 -0
- package/dist/cjs/components/navigator/Navigator.js +54 -0
- package/dist/cjs/components/panel/Panel.js +125 -0
- package/dist/cjs/components/panel/Panel.module.css +1 -0
- package/dist/cjs/components/panel/PanelGroup.js +50 -0
- package/dist/cjs/components/panel/PanelStack.js +85 -0
- package/dist/cjs/components/progress/Progress.module.css +1 -0
- package/dist/cjs/components/progress/ProgressBar.js +62 -0
- package/dist/cjs/components/progress/ProgressCircle.js +96 -0
- package/dist/cjs/components/tabpanel/Tab.js +78 -0
- package/dist/cjs/components/tabpanel/TabPanel.js +77 -0
- package/dist/cjs/components/tabpanel/TabPanel.module.css +1 -0
- package/dist/cjs/context/Global.js +169 -0
- package/dist/cjs/context/NotificationCenter.js +254 -0
- package/dist/cjs/core/aside/Aside.js +152 -0
- package/dist/cjs/core/aside/Aside.module.css +1 -0
- package/dist/cjs/core/boundary/ErrorBoundary.js +140 -0
- package/dist/cjs/core/boundary/ErrorBoundary.module.css +1 -0
- package/dist/cjs/core/boundary/ErrorIcon.js +51 -0
- package/dist/cjs/core/content/Content.js +70 -0
- package/dist/cjs/core/content/Content.module.css +1 -0
- package/dist/cjs/core/headfoot/HeadFoot.js +62 -0
- package/dist/cjs/core/headfoot/HeadFoot.module.css +1 -0
- package/dist/cjs/core/page/Page.js +65 -0
- package/dist/cjs/core/page/Page.module.css +1 -0
- package/dist/cjs/core/responsive/Responsive.js +64 -0
- package/dist/cjs/core/responsive/Responsive.module.css +1 -0
- package/dist/cjs/core/section/Section.js +44 -0
- package/dist/cjs/core/section/Section.module.css +1 -0
- package/dist/cjs/core/theme/Theme.module.css +1 -0
- package/dist/cjs/core/theme/ThemeProvider.js +74 -0
- package/dist/cjs/core/viewport/Viewport.js +39 -0
- package/dist/cjs/core/viewport/Viewport.module.css +1 -0
- package/dist/cjs/hooks/useClientService.js +30 -0
- package/dist/cjs/hooks/useControlledValue.js +22 -0
- package/dist/cjs/hooks/useDebounce.js +56 -0
- package/dist/cjs/hooks/useEffectDebugger.js +113 -0
- package/dist/cjs/hooks/useIsDark.js +33 -0
- package/dist/cjs/hooks/useIsRtl.js +27 -0
- package/dist/cjs/hooks/useNavigator.js +36 -0
- package/dist/cjs/hooks/useOverlayService.js +55 -0
- package/dist/cjs/hooks/usePropToggle.js +40 -0
- package/dist/cjs/hooks/useResize.js +75 -0
- package/dist/cjs/hooks/useResizeObserver.js +38 -0
- package/dist/cjs/hooks/useStorage.js +44 -0
- package/dist/cjs/hotkeys/HotKey.js +47 -0
- package/dist/cjs/hotkeys/HotKeyLabel.js +52 -0
- package/dist/cjs/hotkeys/HotKeyWrapper.js +98 -0
- package/dist/cjs/hotkeys/commons.js +56 -0
- package/dist/cjs/i18n/ar.json.js +31 -0
- package/dist/cjs/i18n/en.json.js +46 -0
- package/dist/cjs/i18n/index.js +55 -0
- package/dist/cjs/index.js +162 -0
- package/dist/cjs/overlays/alert/Alert.js +163 -0
- package/dist/cjs/overlays/alert/Alert.module.css +1 -0
- package/dist/cjs/overlays/flyout/Flyout.js +152 -0
- package/dist/cjs/overlays/flyout/Flyout.module.css +1 -0
- package/dist/cjs/overlays/message/Message.js +84 -0
- package/dist/cjs/overlays/message/Message.module.css +1 -0
- package/dist/cjs/overlays/modal/Modal.js +132 -0
- package/dist/cjs/overlays/modal/Modal.module.css +1 -0
- package/dist/cjs/overlays/toast/Toast.js +166 -0
- package/dist/cjs/overlays/toast/Toast.module.css +1 -0
- package/dist/cjs/overlays/tooltip/Tooltip.js +133 -0
- package/dist/cjs/overlays/tooltip/Tooltip.module.css +1 -0
- package/dist/cjs/types/icons.js +197 -0
- package/dist/cjs/typography/Abbr.js +108 -0
- package/dist/cjs/typography/Copy.js +59 -0
- package/dist/cjs/typography/Link.js +55 -0
- package/dist/cjs/typography/Mark.js +86 -0
- package/dist/cjs/typography/Text.js +121 -0
- package/dist/cjs/typography/Title.js +58 -0
- package/dist/cjs/typography/Typography.module.css +1 -0
- package/dist/cjs/typography/types.js +42 -0
- package/dist/cjs/utils/calculateDimensions.js +51 -0
- package/dist/cjs/utils/getColor.js +52 -0
- package/dist/cjs/utils/nodeCheck.js +35 -0
- package/dist/esm/components/actionLabel/ActionLabel.js +56 -0
- package/dist/esm/components/actionLabel/ActionLabel.module.css +1 -0
- package/dist/esm/components/animations/Animations.js +131 -0
- package/dist/esm/components/animations/Animations.module.css +1 -0
- package/dist/esm/components/avatar/Avatar.js +144 -0
- package/dist/esm/components/avatar/Avatar.module.css +1 -0
- package/dist/esm/components/avatar/AvatarGroup.js +74 -0
- package/dist/esm/components/badge/Badge.js +81 -0
- package/dist/esm/components/badge/Badge.module.css +1 -0
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +71 -0
- package/dist/esm/components/breadcrumbs/Breadcrumbs.module.css +1 -0
- package/dist/esm/components/button/Button.js +170 -0
- package/dist/esm/components/button/Button.module.css +1 -0
- package/dist/esm/components/button/ButtonGroup.js +41 -0
- package/dist/esm/components/button/ConfirmButton.js +166 -0
- package/dist/esm/components/button/ToggleButtonGroup.js +68 -0
- package/dist/esm/components/callout/Callout.js +54 -0
- package/dist/esm/components/card/Card.js +62 -0
- package/dist/esm/components/card/Card.module.css +1 -0
- package/dist/esm/components/card/CardCover.js +48 -0
- package/dist/esm/components/chip/Chip.js +94 -0
- package/dist/esm/components/chip/Chip.module.css +1 -0
- package/dist/esm/components/collapsable/Collapsable.js +84 -0
- package/dist/esm/components/collapsable/Collapsable.module.css +1 -0
- package/dist/esm/components/divider/Divider.js +65 -0
- package/dist/esm/components/dropdown/Dropdown.js +179 -0
- package/dist/esm/components/dropdown/Dropdown.module.css +1 -0
- package/dist/esm/components/dropdown/DropdownTool.js +26 -0
- package/dist/esm/components/empty/EmptyContent.js +92 -0
- package/dist/esm/components/icon/Icon.js +106 -0
- package/dist/esm/components/icon/Icon.module.css +1 -0
- package/dist/esm/components/media/Media.js +148 -0
- package/dist/esm/components/media/Media.module.css +1 -0
- package/dist/esm/components/menu/ContextMenu.js +84 -0
- package/dist/esm/components/menu/Menu.js +204 -0
- package/dist/esm/components/menu/Menu.module.css +1 -0
- package/dist/esm/components/menu/MenuItem.js +119 -0
- package/dist/esm/components/meter/Meter.js +41 -0
- package/dist/esm/components/meter/Meter.module.css +1 -0
- package/dist/esm/components/navigator/Navigator.js +54 -0
- package/dist/esm/components/panel/Panel.js +125 -0
- package/dist/esm/components/panel/Panel.module.css +1 -0
- package/dist/esm/components/panel/PanelGroup.js +50 -0
- package/dist/esm/components/panel/PanelStack.js +85 -0
- package/dist/esm/components/progress/Progress.module.css +1 -0
- package/dist/esm/components/progress/ProgressBar.js +62 -0
- package/dist/esm/components/progress/ProgressCircle.js +96 -0
- package/dist/esm/components/tabpanel/Tab.js +78 -0
- package/dist/esm/components/tabpanel/TabPanel.js +77 -0
- package/dist/esm/components/tabpanel/TabPanel.module.css +1 -0
- package/dist/esm/context/Global.js +165 -0
- package/dist/esm/context/NotificationCenter.js +254 -0
- package/dist/esm/core/aside/Aside.js +152 -0
- package/dist/esm/core/aside/Aside.module.css +1 -0
- package/dist/esm/core/boundary/ErrorBoundary.js +140 -0
- package/dist/esm/core/boundary/ErrorBoundary.module.css +1 -0
- package/dist/esm/core/boundary/ErrorIcon.js +51 -0
- package/dist/esm/core/content/Content.js +70 -0
- package/dist/esm/core/content/Content.module.css +1 -0
- package/dist/esm/core/headfoot/HeadFoot.js +61 -0
- package/dist/esm/core/headfoot/HeadFoot.module.css +1 -0
- package/dist/esm/core/page/Page.js +65 -0
- package/dist/esm/core/page/Page.module.css +1 -0
- package/dist/esm/core/responsive/Responsive.js +62 -0
- package/dist/esm/core/responsive/Responsive.module.css +1 -0
- package/dist/esm/core/section/Section.js +44 -0
- package/dist/esm/core/section/Section.module.css +1 -0
- package/dist/esm/core/theme/Theme.module.css +1 -0
- package/dist/esm/core/theme/ThemeProvider.js +74 -0
- package/dist/esm/core/viewport/Viewport.js +39 -0
- package/dist/esm/core/viewport/Viewport.module.css +1 -0
- package/dist/esm/hooks/useClientService.js +30 -0
- package/dist/esm/hooks/useControlledValue.js +22 -0
- package/dist/esm/hooks/useDebounce.js +56 -0
- package/dist/esm/hooks/useEffectDebugger.js +111 -0
- package/dist/esm/hooks/useIsDark.js +33 -0
- package/dist/esm/hooks/useIsRtl.js +27 -0
- package/dist/esm/hooks/useNavigator.js +36 -0
- package/dist/esm/hooks/useOverlayService.js +55 -0
- package/dist/esm/hooks/usePropToggle.js +40 -0
- package/dist/esm/hooks/useResize.js +75 -0
- package/dist/esm/hooks/useResizeObserver.js +38 -0
- package/dist/esm/hooks/useStorage.js +43 -0
- package/dist/esm/hotkeys/HotKey.js +47 -0
- package/dist/esm/hotkeys/HotKeyLabel.js +52 -0
- package/dist/esm/hotkeys/HotKeyWrapper.js +96 -0
- package/dist/esm/hotkeys/commons.js +56 -0
- package/dist/esm/i18n/ar.json.js +27 -0
- package/dist/esm/i18n/en.json.js +41 -0
- package/dist/esm/i18n/index.js +55 -0
- package/dist/esm/index.js +75 -0
- package/dist/esm/overlays/alert/Alert.js +163 -0
- package/dist/esm/overlays/alert/Alert.module.css +1 -0
- package/dist/esm/overlays/flyout/Flyout.js +152 -0
- package/dist/esm/overlays/flyout/Flyout.module.css +1 -0
- package/dist/esm/overlays/message/Message.js +84 -0
- package/dist/esm/overlays/message/Message.module.css +1 -0
- package/dist/esm/overlays/modal/Modal.js +132 -0
- package/dist/esm/overlays/modal/Modal.module.css +1 -0
- package/dist/esm/overlays/toast/Toast.js +166 -0
- package/dist/esm/overlays/toast/Toast.module.css +1 -0
- package/dist/esm/overlays/tooltip/Tooltip.js +132 -0
- package/dist/esm/overlays/tooltip/Tooltip.module.css +1 -0
- package/dist/esm/types/icons.js +199 -0
- package/dist/esm/typography/Abbr.js +108 -0
- package/dist/esm/typography/Copy.js +59 -0
- package/dist/esm/typography/Link.js +55 -0
- package/dist/esm/typography/Mark.js +86 -0
- package/dist/esm/typography/Text.js +121 -0
- package/dist/esm/typography/Title.js +58 -0
- package/dist/esm/typography/Typography.module.css +1 -0
- package/dist/esm/typography/types.js +41 -0
- package/dist/esm/utils/calculateDimensions.js +50 -0
- package/dist/esm/utils/getColor.js +49 -0
- package/dist/esm/utils/nodeCheck.js +35 -0
- package/dist/types/components/actionLabel/ActionLabel.d.ts +21 -0
- package/dist/types/components/animations/Animations.d.ts +23 -0
- package/dist/types/components/avatar/Avatar.d.ts +48 -0
- package/dist/types/components/avatar/AvatarGroup.d.ts +24 -0
- package/dist/types/components/badge/Badge.d.ts +25 -0
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +17 -0
- package/dist/types/components/button/Button.d.ts +94 -0
- package/dist/types/components/button/ButtonGroup.d.ts +34 -0
- package/dist/types/components/button/ConfirmButton.d.ts +27 -0
- package/dist/types/components/button/ToggleButtonGroup.d.ts +56 -0
- package/dist/types/components/callout/Callout.d.ts +28 -0
- package/dist/types/components/card/Card.d.ts +39 -0
- package/dist/types/components/card/CardCover.d.ts +16 -0
- package/dist/types/components/chip/Chip.d.ts +41 -0
- package/dist/types/components/collapsable/Collapsable.d.ts +43 -0
- package/dist/types/components/divider/Divider.d.ts +20 -0
- package/dist/types/components/dropdown/Dropdown.d.ts +50 -0
- package/dist/types/components/dropdown/DropdownTool.d.ts +8 -0
- package/dist/types/components/empty/EmptyContent.d.ts +21 -0
- package/dist/types/components/icon/Icon.d.ts +44 -0
- package/dist/types/components/index.d.ts +33 -0
- package/dist/types/components/media/Media.d.ts +37 -0
- package/dist/types/components/menu/ContextMenu.d.ts +7 -0
- package/dist/types/components/menu/Menu.d.ts +2 -0
- package/dist/types/components/menu/MenuItem.d.ts +4 -0
- package/dist/types/components/menu/types.d.ts +59 -0
- package/dist/types/components/meter/Meter.d.ts +12 -0
- package/dist/types/components/navigator/Navigator.d.ts +12 -0
- package/dist/types/components/panel/Panel.d.ts +59 -0
- package/dist/types/components/panel/PanelGroup.d.ts +12 -0
- package/dist/types/components/panel/PanelStack.d.ts +16 -0
- package/dist/types/components/progress/ProgressBar.d.ts +24 -0
- package/dist/types/components/progress/ProgressCircle.d.ts +16 -0
- package/dist/types/components/tabpanel/Tab.d.ts +41 -0
- package/dist/types/components/tabpanel/TabPanel.d.ts +41 -0
- package/dist/types/context/Global.d.ts +81 -0
- package/dist/types/context/NotificationCenter.d.ts +11 -0
- package/dist/types/core/aside/Aside.d.ts +52 -0
- package/dist/types/core/boundary/ErrorBoundary.d.ts +26 -0
- package/dist/types/core/boundary/ErrorIcon.d.ts +1 -0
- package/dist/types/core/content/Content.d.ts +15 -0
- package/dist/types/core/headfoot/HeadFoot.d.ts +24 -0
- package/dist/types/core/index.d.ts +9 -0
- package/dist/types/core/page/Page.d.ts +23 -0
- package/dist/types/core/responsive/Responsive.d.ts +53 -0
- package/dist/types/core/section/Section.d.ts +7 -0
- package/dist/types/core/theme/ThemeProvider.d.ts +37 -0
- package/dist/types/core/viewport/Viewport.d.ts +5 -0
- package/dist/types/hooks/useClientService.d.ts +1 -0
- package/dist/types/hooks/useControlledValue.d.ts +5 -0
- package/dist/types/hooks/useDebounce.d.ts +4 -0
- package/dist/types/hooks/useEffectDebugger.d.ts +4 -0
- package/dist/types/hooks/useIsDark.d.ts +1 -0
- package/dist/types/hooks/useIsRtl.d.ts +1 -0
- package/dist/types/hooks/useNavigator.d.ts +7 -0
- package/dist/types/hooks/useOverlayService.d.ts +10 -0
- package/dist/types/hooks/usePropToggle.d.ts +9 -0
- package/dist/types/hooks/useResize.d.ts +27 -0
- package/dist/types/hooks/useResizeObserver.d.ts +3 -0
- package/dist/types/hooks/useStorage.d.ts +2 -0
- package/dist/types/hotkeys/HotKey.d.ts +2 -0
- package/dist/types/hotkeys/HotKeyLabel.d.ts +2 -0
- package/dist/types/hotkeys/HotKeyWrapper.d.ts +11 -0
- package/dist/types/hotkeys/commons.d.ts +28 -0
- package/dist/types/i18n/index.d.ts +6 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/overlays/alert/Alert.d.ts +33 -0
- package/dist/types/overlays/flyout/Flyout.d.ts +57 -0
- package/dist/types/overlays/index.d.ts +6 -0
- package/dist/types/overlays/message/Message.d.ts +21 -0
- package/dist/types/overlays/modal/Modal.d.ts +53 -0
- package/dist/types/overlays/toast/Toast.d.ts +33 -0
- package/dist/types/overlays/tooltip/Tooltip.d.ts +18 -0
- package/dist/types/types/icons.d.ts +194 -0
- package/dist/types/types/index.d.ts +140 -0
- package/dist/types/typography/Abbr.d.ts +22 -0
- package/dist/types/typography/Copy.d.ts +9 -0
- package/dist/types/typography/Link.d.ts +24 -0
- package/dist/types/typography/Mark.d.ts +18 -0
- package/dist/types/typography/Text.d.ts +35 -0
- package/dist/types/typography/Title.d.ts +29 -0
- package/dist/types/typography/index.d.ts +6 -0
- package/dist/types/typography/types.d.ts +2 -0
- package/dist/types/utils/calculateDimensions.d.ts +6 -0
- package/dist/types/utils/getColor.d.ts +4 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/nodeCheck.d.ts +2 -0
- package/package.json +60 -0
- package/src/components/actionLabel/ActionLabel.module.css +38 -0
- package/src/components/actionLabel/ActionLabel.tsx +97 -0
- package/src/components/animations/Animations.module.css +253 -0
- package/src/components/animations/Animations.tsx +190 -0
- package/src/components/avatar/Avatar.module.css +90 -0
- package/src/components/avatar/Avatar.tsx +218 -0
- package/src/components/avatar/AvatarGroup.tsx +140 -0
- package/src/components/badge/Badge.module.css +165 -0
- package/src/components/badge/Badge.tsx +148 -0
- package/src/components/breadcrumbs/Breadcrumbs.module.css +189 -0
- package/src/components/breadcrumbs/Breadcrumbs.tsx +109 -0
- package/src/components/button/Button.module.css +375 -0
- package/src/components/button/Button.tsx +323 -0
- package/src/components/button/ButtonGroup.tsx +112 -0
- package/src/components/button/ConfirmButton.tsx +221 -0
- package/src/components/button/ToggleButtonGroup.tsx +161 -0
- package/src/components/callout/Callout.tsx +104 -0
- package/src/components/card/Card.module.css +152 -0
- package/src/components/card/Card.tsx +154 -0
- package/src/components/card/CardCover.tsx +87 -0
- package/src/components/chip/Chip.module.css +118 -0
- package/src/components/chip/Chip.tsx +201 -0
- package/src/components/collapsable/Collapsable.module.css +30 -0
- package/src/components/collapsable/Collapsable.tsx +153 -0
- package/src/components/divider/Divider.tsx +105 -0
- package/src/components/dropdown/Dropdown.module.css +39 -0
- package/src/components/dropdown/Dropdown.tsx +307 -0
- package/src/components/dropdown/DropdownTool.tsx +56 -0
- package/src/components/empty/EmptyContent.tsx +141 -0
- package/src/components/icon/Icon.module.css +71 -0
- package/src/components/icon/Icon.tsx +188 -0
- package/src/components/index.ts +61 -0
- package/src/components/media/Media.module.css +112 -0
- package/src/components/media/Media.tsx +224 -0
- package/src/components/menu/ContextMenu.tsx +116 -0
- package/src/components/menu/Menu.module.css +109 -0
- package/src/components/menu/Menu.tsx +278 -0
- package/src/components/menu/MenuItem.tsx +162 -0
- package/src/components/menu/types.ts +100 -0
- package/src/components/meter/Meter.module.css +116 -0
- package/src/components/meter/Meter.tsx +80 -0
- package/src/components/navigator/Navigator.tsx +77 -0
- package/src/components/panel/Panel.module.css +86 -0
- package/src/components/panel/Panel.tsx +254 -0
- package/src/components/panel/PanelGroup.tsx +99 -0
- package/src/components/panel/PanelStack.tsx +133 -0
- package/src/components/progress/Progress.module.css +70 -0
- package/src/components/progress/ProgressBar.tsx +122 -0
- package/src/components/progress/ProgressCircle.tsx +118 -0
- package/src/components/tabpanel/Tab.tsx +175 -0
- package/src/components/tabpanel/TabPanel.module.css +200 -0
- package/src/components/tabpanel/TabPanel.tsx +155 -0
- package/src/context/Global.tsx +241 -0
- package/src/context/NotificationCenter.tsx +223 -0
- package/src/core/aside/Aside.module.css +231 -0
- package/src/core/aside/Aside.tsx +262 -0
- package/src/core/boundary/ErrorBoundary.module.css +65 -0
- package/src/core/boundary/ErrorBoundary.tsx +146 -0
- package/src/core/boundary/ErrorIcon.tsx +50 -0
- package/src/core/content/Content.module.css +40 -0
- package/src/core/content/Content.tsx +91 -0
- package/src/core/headfoot/HeadFoot.module.css +38 -0
- package/src/core/headfoot/HeadFoot.tsx +114 -0
- package/src/core/index.ts +32 -0
- package/src/core/page/Page.module.css +46 -0
- package/src/core/page/Page.tsx +100 -0
- package/src/core/responsive/Responsive.module.css +85 -0
- package/src/core/responsive/Responsive.tsx +172 -0
- package/src/core/section/Section.module.css +28 -0
- package/src/core/section/Section.tsx +48 -0
- package/src/core/theme/Theme.module.css +30 -0
- package/src/core/theme/ThemeProvider.tsx +112 -0
- package/src/core/viewport/Viewport.module.css +32 -0
- package/src/core/viewport/Viewport.tsx +43 -0
- package/src/hooks/useClientService.tsx +29 -0
- package/src/hooks/useControlledValue.tsx +43 -0
- package/src/hooks/useDebounce.ts +52 -0
- package/src/hooks/useEffectDebugger.ts +154 -0
- package/src/hooks/useIsDark.ts +50 -0
- package/src/hooks/useIsRtl.ts +46 -0
- package/src/hooks/useNavigator.tsx +54 -0
- package/src/hooks/useOverlayService.tsx +51 -0
- package/src/hooks/usePropToggle.ts +61 -0
- package/src/hooks/useResize.ts +90 -0
- package/src/hooks/useResizeObserver.ts +55 -0
- package/src/hooks/useStorage.ts +76 -0
- package/src/hotkeys/HotKey.tsx +39 -0
- package/src/hotkeys/HotKeyLabel.tsx +61 -0
- package/src/hotkeys/HotKeyWrapper.tsx +137 -0
- package/src/hotkeys/commons.ts +74 -0
- package/src/i18n/ar.json +21 -0
- package/src/i18n/en.json +34 -0
- package/src/i18n/index.ts +50 -0
- package/src/index.ts +51 -0
- package/src/overlays/alert/Alert.module.css +44 -0
- package/src/overlays/alert/Alert.tsx +229 -0
- package/src/overlays/flyout/Flyout.module.css +52 -0
- package/src/overlays/flyout/Flyout.tsx +283 -0
- package/src/overlays/index.ts +29 -0
- package/src/overlays/message/Message.module.css +37 -0
- package/src/overlays/message/Message.tsx +107 -0
- package/src/overlays/modal/Modal.module.css +53 -0
- package/src/overlays/modal/Modal.tsx +244 -0
- package/src/overlays/toast/Toast.module.css +37 -0
- package/src/overlays/toast/Toast.tsx +216 -0
- package/src/overlays/tooltip/Tooltip.module.css +53 -0
- package/src/overlays/tooltip/Tooltip.tsx +200 -0
- package/src/types/global.d.ts +83 -0
- package/src/types/icons.ts +420 -0
- package/src/types/index.ts +238 -0
- package/src/typography/Abbr.tsx +152 -0
- package/src/typography/Copy.tsx +61 -0
- package/src/typography/Link.tsx +110 -0
- package/src/typography/Mark.tsx +122 -0
- package/src/typography/Text.tsx +194 -0
- package/src/typography/Title.tsx +126 -0
- package/src/typography/Typography.module.css +68 -0
- package/src/typography/index.ts +29 -0
- package/src/typography/types.ts +38 -0
- package/src/utils/calculateDimensions.ts +72 -0
- package/src/utils/getColor.ts +49 -0
- package/src/utils/index.ts +28 -0
- package/src/utils/nodeCheck.ts +34 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
export { ActionLabel } from './components/actionLabel/ActionLabel.js';
|
|
4
|
+
export { AnimationBars, AnimationIndicator, AnimationSpinner, Skeleton } from './components/animations/Animations.js';
|
|
5
|
+
export { Avatar } from './components/avatar/Avatar.js';
|
|
6
|
+
export { AvatarGroup } from './components/avatar/AvatarGroup.js';
|
|
7
|
+
export { Badge, getBadgeProps } from './components/badge/Badge.js';
|
|
8
|
+
export { Breadcrumbs } from './components/breadcrumbs/Breadcrumbs.js';
|
|
9
|
+
export { Button } from './components/button/Button.js';
|
|
10
|
+
export { ButtonGroup } from './components/button/ButtonGroup.js';
|
|
11
|
+
export { ConfirmButton } from './components/button/ConfirmButton.js';
|
|
12
|
+
export { ToggleButtonGroup } from './components/button/ToggleButtonGroup.js';
|
|
13
|
+
export { Callout } from './components/callout/Callout.js';
|
|
14
|
+
export { Card } from './components/card/Card.js';
|
|
15
|
+
export { CardCover } from './components/card/CardCover.js';
|
|
16
|
+
export { Chip } from './components/chip/Chip.js';
|
|
17
|
+
export { Collapsable } from './components/collapsable/Collapsable.js';
|
|
18
|
+
export { Divider } from './components/divider/Divider.js';
|
|
19
|
+
export { Dropdown, DropdownDismiss } from './components/dropdown/Dropdown.js';
|
|
20
|
+
export { DropdownTool } from './components/dropdown/DropdownTool.js';
|
|
21
|
+
export { EmptyContent } from './components/empty/EmptyContent.js';
|
|
22
|
+
export { Icon } from './components/icon/Icon.js';
|
|
23
|
+
export { Image, Video } from './components/media/Media.js';
|
|
24
|
+
export { ContextMenu } from './components/menu/ContextMenu.js';
|
|
25
|
+
export { Menu } from './components/menu/Menu.js';
|
|
26
|
+
export { MenuItem } from './components/menu/MenuItem.js';
|
|
27
|
+
export { Meter } from './components/meter/Meter.js';
|
|
28
|
+
export { Navigator } from './components/navigator/Navigator.js';
|
|
29
|
+
export { Panel } from './components/panel/Panel.js';
|
|
30
|
+
export { PanelGroup } from './components/panel/PanelGroup.js';
|
|
31
|
+
export { PanelStack } from './components/panel/PanelStack.js';
|
|
32
|
+
export { ProgressBar } from './components/progress/ProgressBar.js';
|
|
33
|
+
export { ProgressCircle } from './components/progress/ProgressCircle.js';
|
|
34
|
+
export { Tab } from './components/tabpanel/Tab.js';
|
|
35
|
+
export { TabPanel } from './components/tabpanel/TabPanel.js';
|
|
36
|
+
export { Aside } from './core/aside/Aside.js';
|
|
37
|
+
export { ErrorBoundary } from './core/boundary/ErrorBoundary.js';
|
|
38
|
+
export { Content } from './core/content/Content.js';
|
|
39
|
+
export { Footer, Header } from './core/headfoot/HeadFoot.js';
|
|
40
|
+
export { Page } from './core/page/Page.js';
|
|
41
|
+
export { Col, Container, Row } from './core/responsive/Responsive.js';
|
|
42
|
+
export { Section } from './core/section/Section.js';
|
|
43
|
+
export { ThemeProvider } from './core/theme/ThemeProvider.js';
|
|
44
|
+
export { Viewport } from './core/viewport/Viewport.js';
|
|
45
|
+
export { addTranslationBundle } from './i18n/index.js';
|
|
46
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
47
|
+
import '@floating-ui/react';
|
|
48
|
+
import 'classnames';
|
|
49
|
+
import 'react';
|
|
50
|
+
import 'react-i18next';
|
|
51
|
+
export { CoreIcons } from './types/icons.js';
|
|
52
|
+
export { Title } from './typography/Title.js';
|
|
53
|
+
import '@react-fabric/utilities';
|
|
54
|
+
import 'react/jsx-runtime';
|
|
55
|
+
export { Flyout } from './overlays/flyout/Flyout.js';
|
|
56
|
+
export { Modal } from './overlays/modal/Modal.js';
|
|
57
|
+
export { Tooltip } from './overlays/tooltip/Tooltip.js';
|
|
58
|
+
export { Abbr } from './typography/Abbr.js';
|
|
59
|
+
export { Copy } from './typography/Copy.js';
|
|
60
|
+
export { Link } from './typography/Link.js';
|
|
61
|
+
export { Mark } from './typography/Mark.js';
|
|
62
|
+
export { Text } from './typography/Text.js';
|
|
63
|
+
export { useClientService } from './hooks/useClientService.js';
|
|
64
|
+
export { useDebounce } from './hooks/useDebounce.js';
|
|
65
|
+
export { useEffectDebugger, useLayoutEffectDebugger, useMemoDebugger } from './hooks/useEffectDebugger.js';
|
|
66
|
+
export { useIsDark } from './hooks/useIsDark.js';
|
|
67
|
+
export { useIsRtl } from './hooks/useIsRtl.js';
|
|
68
|
+
export { useNavigator } from './hooks/useNavigator.js';
|
|
69
|
+
export { useOverlayService } from './hooks/useOverlayService.js';
|
|
70
|
+
export { useResize } from './hooks/useResize.js';
|
|
71
|
+
export { useResizeObserver } from './hooks/useResizeObserver.js';
|
|
72
|
+
export { useLocalStorage, useSessionStorage } from './hooks/useStorage.js';
|
|
73
|
+
export { HotKey } from './hotkeys/HotKey.js';
|
|
74
|
+
export { HotKeyLabel } from './hotkeys/HotKeyLabel.js';
|
|
75
|
+
export { ApplicationProvider, useApplicationContext, useGlobals, useNotificationService } from './context/Global.js';
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, FloatingOverlay, FloatingFocusManager } from '@floating-ui/react';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { useMemo, useCallback, useLayoutEffect } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { AnimationIndicator } from '../../components/animations/Animations.js';
|
|
9
|
+
import { Button } from '../../components/button/Button.js';
|
|
10
|
+
import { Icon } from '../../components/icon/Icon.js';
|
|
11
|
+
import { CoreIcons } from '../../types/icons.js';
|
|
12
|
+
import { Title } from '../../typography/Title.js';
|
|
13
|
+
import { getColorClass, getBorderClass } from '../../utils/getColor.js';
|
|
14
|
+
import '@react-fabric/utilities';
|
|
15
|
+
import classes from './Alert.module.css';
|
|
16
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
|
+
var Alert = function Alert(_ref) {
|
|
21
|
+
var title = _ref.title,
|
|
22
|
+
message = _ref.message,
|
|
23
|
+
_ref$color = _ref.color,
|
|
24
|
+
color = _ref$color === void 0 ? "primary" : _ref$color,
|
|
25
|
+
icon = _ref.icon,
|
|
26
|
+
rtlFlip = _ref.rtlFlip,
|
|
27
|
+
actions = _ref.actions,
|
|
28
|
+
onClose = _ref.onClose,
|
|
29
|
+
type = _ref.type,
|
|
30
|
+
okLabel = _ref.okLabel,
|
|
31
|
+
cancelLabel = _ref.cancelLabel;
|
|
32
|
+
var _useTranslation = useTranslation("core"),
|
|
33
|
+
t = _useTranslation.t;
|
|
34
|
+
var _useFloating = useFloating({
|
|
35
|
+
open: true,
|
|
36
|
+
onOpenChange: function onOpenChange() {
|
|
37
|
+
handleClose(false);
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
refs = _useFloating.refs,
|
|
41
|
+
context = _useFloating.context;
|
|
42
|
+
var dismiss = useDismiss(context, {
|
|
43
|
+
outsidePressEvent: "mousedown",
|
|
44
|
+
escapeKey: true
|
|
45
|
+
});
|
|
46
|
+
var role = useRole(context);
|
|
47
|
+
|
|
48
|
+
// Merge all the interactions into prop getters
|
|
49
|
+
var _useInteractions = useInteractions([dismiss, role]),
|
|
50
|
+
getFloatingProps = _useInteractions.getFloatingProps;
|
|
51
|
+
var iconType = useMemo(function () {
|
|
52
|
+
if (icon) return /*#__PURE__*/jsx(Icon, {
|
|
53
|
+
icon: icon,
|
|
54
|
+
size: "md",
|
|
55
|
+
rtlFlip: rtlFlip,
|
|
56
|
+
color: color + "-600"
|
|
57
|
+
});
|
|
58
|
+
switch (color) {
|
|
59
|
+
case "danger":
|
|
60
|
+
return /*#__PURE__*/jsx(AnimationIndicator, {
|
|
61
|
+
type: "cross",
|
|
62
|
+
className: getColorClass(color + "-600")
|
|
63
|
+
});
|
|
64
|
+
case "success":
|
|
65
|
+
return /*#__PURE__*/jsx(AnimationIndicator, {
|
|
66
|
+
type: "check",
|
|
67
|
+
className: getColorClass(color + "-600")
|
|
68
|
+
});
|
|
69
|
+
case "warning":
|
|
70
|
+
return /*#__PURE__*/jsx(AnimationIndicator, {
|
|
71
|
+
type: "exclaim",
|
|
72
|
+
className: getColorClass(color + "-600")
|
|
73
|
+
});
|
|
74
|
+
default:
|
|
75
|
+
return /*#__PURE__*/jsx(AnimationIndicator, {
|
|
76
|
+
type: type === "confirm" ? "question" : "info",
|
|
77
|
+
className: getColorClass(color + "-600")
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}, [color, type, icon]);
|
|
81
|
+
var handleClose = useCallback(function (ret) {
|
|
82
|
+
refs.floating.current && (refs.floating.current.dataset.show = "false");
|
|
83
|
+
setTimeout(function () {
|
|
84
|
+
onClose(ret);
|
|
85
|
+
}, 250);
|
|
86
|
+
}, [onClose]);
|
|
87
|
+
useLayoutEffect(function () {
|
|
88
|
+
setTimeout(function () {
|
|
89
|
+
return refs.floating.current && (refs.floating.current.dataset.show = "true");
|
|
90
|
+
}, 100);
|
|
91
|
+
}, []);
|
|
92
|
+
return /*#__PURE__*/jsx(FloatingPortal, {
|
|
93
|
+
children: /*#__PURE__*/jsx(FloatingOverlay, {
|
|
94
|
+
lockScroll: true,
|
|
95
|
+
style: {
|
|
96
|
+
zIndex: "var(--z-overlay-mask)"
|
|
97
|
+
},
|
|
98
|
+
className: "bg-base/50 backdrop-blur-sm grid place-items-center",
|
|
99
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
100
|
+
context: context,
|
|
101
|
+
children: /*#__PURE__*/jsxs("dialog", _objectSpread(_objectSpread({
|
|
102
|
+
role: "alertdialog",
|
|
103
|
+
className: classNames(classes.alert, getBorderClass(color + "-300"), "grid bg-base border-2 pointer-events-auto overflow-hidden rounded-capped select-none", "min-w-72 max-w-sm p-6 relative outline-0 shadow-lg"),
|
|
104
|
+
ref: refs.setFloating
|
|
105
|
+
}, getFloatingProps()), {}, {
|
|
106
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
107
|
+
className: classNames("area-[icon] text-lg py-2"),
|
|
108
|
+
children: iconType
|
|
109
|
+
}), /*#__PURE__*/jsx(Title, {
|
|
110
|
+
className: "font-medium area-[title]",
|
|
111
|
+
children: title
|
|
112
|
+
}), /*#__PURE__*/jsx("p", {
|
|
113
|
+
className: "area-[message] py-4",
|
|
114
|
+
children: message
|
|
115
|
+
}), /*#__PURE__*/jsx("div", {
|
|
116
|
+
className: "area-[message]",
|
|
117
|
+
children: message
|
|
118
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
119
|
+
className: "flex gap-1 justify-center flex-nowrap pt-2 area-[actions]",
|
|
120
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
121
|
+
className: "contents",
|
|
122
|
+
onClickCapture: function onClickCapture(e) {
|
|
123
|
+
return handleClose(e.target.value);
|
|
124
|
+
},
|
|
125
|
+
children: actions
|
|
126
|
+
}), type === "confirm" && /*#__PURE__*/jsx(Button, {
|
|
127
|
+
size: "sm",
|
|
128
|
+
variant: "link",
|
|
129
|
+
color: color,
|
|
130
|
+
onClick: function onClick() {
|
|
131
|
+
return handleClose(false);
|
|
132
|
+
},
|
|
133
|
+
children: cancelLabel !== null && cancelLabel !== void 0 ? cancelLabel : t("action.cancel", "Cancel")
|
|
134
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
135
|
+
size: "sm",
|
|
136
|
+
variant: "solid",
|
|
137
|
+
color: color,
|
|
138
|
+
onClick: function onClick() {
|
|
139
|
+
return handleClose(true);
|
|
140
|
+
},
|
|
141
|
+
children: okLabel !== null && okLabel !== void 0 ? okLabel : t("action.ok", "OK")
|
|
142
|
+
})]
|
|
143
|
+
}), /*#__PURE__*/jsx("div", {
|
|
144
|
+
className: "absolute top-2 end-2",
|
|
145
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
146
|
+
size: "sm",
|
|
147
|
+
variant: "link",
|
|
148
|
+
className: "m-0",
|
|
149
|
+
color: color,
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
return handleClose(false);
|
|
152
|
+
},
|
|
153
|
+
icon: CoreIcons.close,
|
|
154
|
+
"aria-label": "close"
|
|
155
|
+
})
|
|
156
|
+
})]
|
|
157
|
+
}))
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export { Alert };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer comp{.alert{gap:.5rem 1rem;grid-template:"icon title" auto "icon message" auto "input input" auto "actions actions" auto/auto 1fr;margin-top:-100%;opacity:0;transition:margin .4s,opacity .3s .2s;z-index:var(--z-overlay);&[data-show=true]{margin-top:0;opacity:1}}}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
+
import { useFloating, useDismiss, useRole, useInteractions, FloatingOverlay, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { useCallback, useEffect, Fragment } from 'react';
|
|
8
|
+
import { Loading } from '../../components/animations/Animations.js';
|
|
9
|
+
import { Icon } from '../../components/icon/Icon.js';
|
|
10
|
+
import { Header } from '../../core/headfoot/HeadFoot.js';
|
|
11
|
+
import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
|
|
12
|
+
import { CoreIcons } from '../../types/icons.js';
|
|
13
|
+
import classes from './Flyout.module.css';
|
|
14
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
15
|
+
|
|
16
|
+
var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "closeOnClick", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "size", "width", "minWidth", "hideMask", "align"];
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
var Flyout = function Flyout(_ref) {
|
|
20
|
+
var icon = _ref.icon,
|
|
21
|
+
iconBg = _ref.iconBg,
|
|
22
|
+
iconColor = _ref.iconColor,
|
|
23
|
+
iconClassName = _ref.iconClassName,
|
|
24
|
+
rtlFlip = _ref.rtlFlip,
|
|
25
|
+
title = _ref.title,
|
|
26
|
+
actions = _ref.actions,
|
|
27
|
+
closeOnClick = _ref.closeOnClick,
|
|
28
|
+
headerClassName = _ref.headerClassName,
|
|
29
|
+
onClose = _ref.onClose,
|
|
30
|
+
onBeforeClose = _ref.onBeforeClose,
|
|
31
|
+
children = _ref.children,
|
|
32
|
+
loading = _ref.loading,
|
|
33
|
+
size = _ref.size,
|
|
34
|
+
width = _ref.width,
|
|
35
|
+
minWidth = _ref.minWidth,
|
|
36
|
+
hideMask = _ref.hideMask,
|
|
37
|
+
_ref$align = _ref.align,
|
|
38
|
+
align = _ref$align === void 0 ? "start" : _ref$align,
|
|
39
|
+
aria = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
+
var _useFloating = useFloating({
|
|
41
|
+
open: true,
|
|
42
|
+
onOpenChange: function onOpenChange() {
|
|
43
|
+
handleClose(false);
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
refs = _useFloating.refs,
|
|
47
|
+
context = _useFloating.context;
|
|
48
|
+
var dismiss = useDismiss(context, {
|
|
49
|
+
outsidePressEvent: "mousedown",
|
|
50
|
+
escapeKey: true
|
|
51
|
+
});
|
|
52
|
+
var role = useRole(context);
|
|
53
|
+
|
|
54
|
+
// Merge all the interactions into prop getters
|
|
55
|
+
var _useInteractions = useInteractions([dismiss, role]),
|
|
56
|
+
getFloatingProps = _useInteractions.getFloatingProps;
|
|
57
|
+
var handleClose = useCallback(function () {
|
|
58
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
59
|
+
args[_key] = arguments[_key];
|
|
60
|
+
}
|
|
61
|
+
void Promise.resolve(onBeforeClose === null || onBeforeClose === void 0 ? void 0 : onBeforeClose.apply(void 0, args)).then(function (ret) {
|
|
62
|
+
if (ret !== false) {
|
|
63
|
+
refs.floating.current && (refs.floating.current.dataset.show = "false");
|
|
64
|
+
setTimeout(function () {
|
|
65
|
+
onClose === null || onClose === void 0 || onClose.apply(void 0, args);
|
|
66
|
+
}, 250);
|
|
67
|
+
}
|
|
68
|
+
ret === false && setTimeout(function () {
|
|
69
|
+
var _refs$floating$curren;
|
|
70
|
+
return (_refs$floating$curren = refs.floating.current) === null || _refs$floating$curren === void 0 || (_refs$floating$curren = _refs$floating$curren.querySelector('[role="dialog"]')) === null || _refs$floating$curren === void 0 ? void 0 : _refs$floating$curren.focus();
|
|
71
|
+
}, 50);
|
|
72
|
+
});
|
|
73
|
+
}, [onBeforeClose, onClose]);
|
|
74
|
+
useEffect(function () {
|
|
75
|
+
setTimeout(function () {
|
|
76
|
+
var _refs$floating$curren2;
|
|
77
|
+
refs.floating.current && (refs.floating.current.dataset.show = "true");
|
|
78
|
+
(_refs$floating$curren2 = refs.floating.current) === null || _refs$floating$curren2 === void 0 || (_refs$floating$curren2 = _refs$floating$curren2.querySelector('[role="dialog"]')) === null || _refs$floating$curren2 === void 0 || _refs$floating$curren2.focus();
|
|
79
|
+
}, 50);
|
|
80
|
+
}, []);
|
|
81
|
+
var tryClosing = useCallback(function (e) {
|
|
82
|
+
if (!!closeOnClick || e.target.closest("[data-flyout-dismiss='true']")) {
|
|
83
|
+
setTimeout(function () {
|
|
84
|
+
handleClose();
|
|
85
|
+
}, 100);
|
|
86
|
+
}
|
|
87
|
+
}, [closeOnClick, handleClose]);
|
|
88
|
+
var Wrapper = useCallback(function (_ref2) {
|
|
89
|
+
var children = _ref2.children;
|
|
90
|
+
if (hideMask) return /*#__PURE__*/jsx(Fragment, {
|
|
91
|
+
children: children
|
|
92
|
+
});
|
|
93
|
+
return /*#__PURE__*/jsx(FloatingOverlay, {
|
|
94
|
+
lockScroll: true,
|
|
95
|
+
style: {
|
|
96
|
+
zIndex: "var(--z-overlay-mask)"
|
|
97
|
+
},
|
|
98
|
+
className: "bg-base/10 backdrop-blur-sm transition-all",
|
|
99
|
+
children: children
|
|
100
|
+
});
|
|
101
|
+
}, [hideMask, handleClose]);
|
|
102
|
+
return /*#__PURE__*/jsx(FloatingPortal, {
|
|
103
|
+
children: /*#__PURE__*/jsx(Wrapper, {
|
|
104
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
105
|
+
context: context,
|
|
106
|
+
children: /*#__PURE__*/jsx(Wrapper, {
|
|
107
|
+
children: /*#__PURE__*/jsx("div", _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
108
|
+
"data-align": align,
|
|
109
|
+
className: classNames(classes.flyout, "fixed inset-y-0 overflow-hidden flex flex-col flex-nowrap pointer-events-auto shadow-xl", align === "start" ? "start-0" : "end-0", size === "sm" && "w-[20rem]", size === "md" && "w-[40rem]", size === "lg" && "w-[60vw]", size === "xl" && "w-[80vw]"),
|
|
110
|
+
style: {
|
|
111
|
+
width: width,
|
|
112
|
+
minWidth: minWidth
|
|
113
|
+
},
|
|
114
|
+
onMouseUpCapture: tryClosing,
|
|
115
|
+
ref: refs.setFloating
|
|
116
|
+
}, getFloatingProps()), aria), aria), {}, {
|
|
117
|
+
children: /*#__PURE__*/jsxs(HotKeyWrapper, {
|
|
118
|
+
children: [/*#__PURE__*/jsxs(Header, {
|
|
119
|
+
flex: true,
|
|
120
|
+
className: classNames(classes.flyoutHeader, headerClassName),
|
|
121
|
+
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
122
|
+
icon: icon,
|
|
123
|
+
bg: iconBg,
|
|
124
|
+
color: iconColor,
|
|
125
|
+
className: classNames(iconClassName, "p-1"),
|
|
126
|
+
rtlFlip: rtlFlip
|
|
127
|
+
}), /*#__PURE__*/jsx("label", {
|
|
128
|
+
className: "flex-1 truncate py-2 px-1",
|
|
129
|
+
children: title
|
|
130
|
+
}), actions, /*#__PURE__*/jsx(Icon, {
|
|
131
|
+
"data-ref": "panelClose",
|
|
132
|
+
className: classNames(classes.panelAction, "cursor-pointer p-1 text-xl self-stretch"),
|
|
133
|
+
icon: CoreIcons.close,
|
|
134
|
+
onClick: function onClick() {
|
|
135
|
+
return handleClose(false);
|
|
136
|
+
}
|
|
137
|
+
})]
|
|
138
|
+
}), loading && /*#__PURE__*/jsx(Loading, {}), /*#__PURE__*/jsx("div", {
|
|
139
|
+
role: "dialog",
|
|
140
|
+
className: classNames(classes.flyoutBody, "flex-1 grid overflow-hidden"),
|
|
141
|
+
tabIndex: 0,
|
|
142
|
+
children: children
|
|
143
|
+
})]
|
|
144
|
+
})
|
|
145
|
+
}))
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export { Flyout };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer comp{.flyout{max-width:70vw;transition:margin .5s;width:32rem;z-index:var(--z-overlay);& .flyoutHeader{background-color:theme(backgroundColor.base);border-bottom:.5px solid theme(borderColor.dimmed)}& .flyoutBody{grid-template:"head head head" auto ". loader ." auto "side-s content side-e" 1fr "foot foot foot" auto/auto 1fr auto}&[data-align=start]{margin-inline-start:-100%}&[data-align=end]{margin-inline-end:-100%}&[data-show=true]{margin:0}}}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { useRef, useCallback, useLayoutEffect } from 'react';
|
|
5
|
+
import { Icon } from '../../components/icon/Icon.js';
|
|
6
|
+
import { getBgClass, getColorClass } from '../../utils/getColor.js';
|
|
7
|
+
import '@react-fabric/utilities';
|
|
8
|
+
import classes from './Message.module.css';
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* React Fabric
|
|
13
|
+
* @version: 1.0.0
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
* The MIT License (MIT)
|
|
17
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
18
|
+
*
|
|
19
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
20
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
21
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
22
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
23
|
+
* subject to the following conditions:
|
|
24
|
+
*
|
|
25
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
26
|
+
* portions of the Software.
|
|
27
|
+
*
|
|
28
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
29
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
30
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
31
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
var Message = function Message(_ref) {
|
|
35
|
+
var title = _ref.title,
|
|
36
|
+
message = _ref.message,
|
|
37
|
+
color = _ref.color,
|
|
38
|
+
icon = _ref.icon,
|
|
39
|
+
rtlFlip = _ref.rtlFlip,
|
|
40
|
+
actions = _ref.actions,
|
|
41
|
+
onClose = _ref.onClose;
|
|
42
|
+
var elRef = useRef(null);
|
|
43
|
+
var handleClose = useCallback(function (ret) {
|
|
44
|
+
elRef.current && (elRef.current.dataset.show = "false");
|
|
45
|
+
setTimeout(function () {
|
|
46
|
+
onClose(ret);
|
|
47
|
+
}, 250);
|
|
48
|
+
}, [onClose]);
|
|
49
|
+
useLayoutEffect(function () {
|
|
50
|
+
setTimeout(function () {
|
|
51
|
+
return elRef.current && (elRef.current.dataset.show = "true");
|
|
52
|
+
}, 100);
|
|
53
|
+
}, []);
|
|
54
|
+
return /*#__PURE__*/jsxs("div", {
|
|
55
|
+
className: classNames(classes.message, color ? getBgClass(color + "-300") : "bg-invert", color ? getColorClass(color + "-900") : "text-invert", "flex flex-nowrap gap-1 px-8 relative justify-center max-w-md pointer-events-auto rounded mb-2 select-none"),
|
|
56
|
+
ref: elRef,
|
|
57
|
+
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
58
|
+
icon: icon,
|
|
59
|
+
size: "md",
|
|
60
|
+
rtlFlip: rtlFlip
|
|
61
|
+
}), title && /*#__PURE__*/jsx("div", {
|
|
62
|
+
className: "font-medium",
|
|
63
|
+
children: title
|
|
64
|
+
}), /*#__PURE__*/jsx("div", {
|
|
65
|
+
className: "truncate flex-initial",
|
|
66
|
+
children: message
|
|
67
|
+
}), actions && /*#__PURE__*/jsx("div", {
|
|
68
|
+
className: "flex gap-1 flex-nowrap",
|
|
69
|
+
onClickCapture: function onClickCapture(e) {
|
|
70
|
+
return handleClose(e.target.value);
|
|
71
|
+
},
|
|
72
|
+
children: actions
|
|
73
|
+
}), /*#__PURE__*/jsx("div", {
|
|
74
|
+
role: "none",
|
|
75
|
+
className: "cursor-pointer opacity-65 absolute end-1 hover:opacity-90",
|
|
76
|
+
onClick: function onClick() {
|
|
77
|
+
return handleClose();
|
|
78
|
+
},
|
|
79
|
+
children: "\xD7"
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { Message };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer comp{.message{margin-top:-100%;opacity:0;transition:margin .4s,opacity .3s .2s;&[data-show=true]{margin-top:0;opacity:1}}}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
+
import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, FloatingOverlay, FloatingFocusManager } from '@floating-ui/react';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { useCallback, useEffect } from 'react';
|
|
8
|
+
import { Loading } from '../../components/animations/Animations.js';
|
|
9
|
+
import { Icon } from '../../components/icon/Icon.js';
|
|
10
|
+
import { Header } from '../../core/headfoot/HeadFoot.js';
|
|
11
|
+
import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
|
|
12
|
+
import { CoreIcons } from '../../types/icons.js';
|
|
13
|
+
import classes from './Modal.module.css';
|
|
14
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
15
|
+
|
|
16
|
+
var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "size", "width", "height", "minHeight", "minWidth"];
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
var Modal = function Modal(_ref) {
|
|
20
|
+
var icon = _ref.icon,
|
|
21
|
+
iconBg = _ref.iconBg,
|
|
22
|
+
iconColor = _ref.iconColor,
|
|
23
|
+
iconClassName = _ref.iconClassName,
|
|
24
|
+
rtlFlip = _ref.rtlFlip,
|
|
25
|
+
title = _ref.title,
|
|
26
|
+
actions = _ref.actions,
|
|
27
|
+
headerClassName = _ref.headerClassName,
|
|
28
|
+
onClose = _ref.onClose,
|
|
29
|
+
onBeforeClose = _ref.onBeforeClose,
|
|
30
|
+
children = _ref.children,
|
|
31
|
+
loading = _ref.loading,
|
|
32
|
+
size = _ref.size,
|
|
33
|
+
width = _ref.width,
|
|
34
|
+
height = _ref.height,
|
|
35
|
+
minHeight = _ref.minHeight,
|
|
36
|
+
minWidth = _ref.minWidth,
|
|
37
|
+
aria = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
var _useFloating = useFloating({
|
|
39
|
+
open: true,
|
|
40
|
+
onOpenChange: function onOpenChange() {
|
|
41
|
+
handleClose(false);
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
refs = _useFloating.refs,
|
|
45
|
+
context = _useFloating.context;
|
|
46
|
+
var dismiss = useDismiss(context, {
|
|
47
|
+
outsidePressEvent: "mousedown",
|
|
48
|
+
escapeKey: true
|
|
49
|
+
});
|
|
50
|
+
var role = useRole(context);
|
|
51
|
+
|
|
52
|
+
// Merge all the interactions into prop getters
|
|
53
|
+
var _useInteractions = useInteractions([dismiss, role]),
|
|
54
|
+
getFloatingProps = _useInteractions.getFloatingProps;
|
|
55
|
+
var handleClose = useCallback(function () {
|
|
56
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
57
|
+
args[_key] = arguments[_key];
|
|
58
|
+
}
|
|
59
|
+
void Promise.resolve(onBeforeClose === null || onBeforeClose === void 0 ? void 0 : onBeforeClose.apply(void 0, args)).then(function (ret) {
|
|
60
|
+
if (ret !== false) {
|
|
61
|
+
refs.floating.current && (refs.floating.current.dataset.show = "false");
|
|
62
|
+
setTimeout(function () {
|
|
63
|
+
onClose === null || onClose === void 0 || onClose.apply(void 0, args);
|
|
64
|
+
}, 250);
|
|
65
|
+
}
|
|
66
|
+
ret === false && setTimeout(function () {
|
|
67
|
+
var _refs$floating$curren;
|
|
68
|
+
return (_refs$floating$curren = refs.floating.current) === null || _refs$floating$curren === void 0 || (_refs$floating$curren = _refs$floating$curren.querySelector("[role='dialog']")) === null || _refs$floating$curren === void 0 ? void 0 : _refs$floating$curren.focus();
|
|
69
|
+
}, 50);
|
|
70
|
+
});
|
|
71
|
+
}, [onBeforeClose, onClose]);
|
|
72
|
+
useEffect(function () {
|
|
73
|
+
setTimeout(function () {
|
|
74
|
+
var _refs$floating$curren2;
|
|
75
|
+
refs.floating.current && (refs.floating.current.dataset.show = "true");
|
|
76
|
+
(_refs$floating$curren2 = refs.floating.current) === null || _refs$floating$curren2 === void 0 || (_refs$floating$curren2 = _refs$floating$curren2.querySelector("[role='dialog']")) === null || _refs$floating$curren2 === void 0 || _refs$floating$curren2.focus();
|
|
77
|
+
}, 50);
|
|
78
|
+
}, []);
|
|
79
|
+
return /*#__PURE__*/jsx(FloatingPortal, {
|
|
80
|
+
children: /*#__PURE__*/jsx(FloatingOverlay, {
|
|
81
|
+
lockScroll: true,
|
|
82
|
+
style: {
|
|
83
|
+
zIndex: "var(--z-overlay-mask)"
|
|
84
|
+
},
|
|
85
|
+
className: "bg-base/50 backdrop-blur-sm grid place-items-center",
|
|
86
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
87
|
+
context: context,
|
|
88
|
+
children: /*#__PURE__*/jsx("dialog", _objectSpread(_objectSpread(_objectSpread({
|
|
89
|
+
className: classNames(classes.modal, "rounded-capped relative overflow-hidden flex flex-col flex-nowrap", "ring-1 ring-tint-100 ring-offset-1 focus-within:ring-primary-300 shadow-xl", size === "sm" && "w-[20rem]", size === "md" && "w-[40rem]", size === "lg" && "w-[60vw]", size === "xl" && "w-[80vw]", size === "screen" && "w-screen h-screen"),
|
|
90
|
+
style: {
|
|
91
|
+
width: width,
|
|
92
|
+
height: height,
|
|
93
|
+
minHeight: minHeight,
|
|
94
|
+
minWidth: minWidth
|
|
95
|
+
},
|
|
96
|
+
ref: refs.setFloating
|
|
97
|
+
}, getFloatingProps()), aria), {}, {
|
|
98
|
+
children: /*#__PURE__*/jsxs(HotKeyWrapper, {
|
|
99
|
+
children: [/*#__PURE__*/jsxs(Header, {
|
|
100
|
+
flex: true,
|
|
101
|
+
className: classNames(classes.modalHeader, headerClassName),
|
|
102
|
+
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
103
|
+
icon: icon,
|
|
104
|
+
bg: iconBg,
|
|
105
|
+
color: iconColor,
|
|
106
|
+
className: classNames(iconClassName, "p-1"),
|
|
107
|
+
rtlFlip: rtlFlip
|
|
108
|
+
}), /*#__PURE__*/jsx("label", {
|
|
109
|
+
className: "flex-1 truncate py-2 px-1",
|
|
110
|
+
children: title
|
|
111
|
+
}), actions, /*#__PURE__*/jsx(Icon, {
|
|
112
|
+
"data-ref": "panelClose",
|
|
113
|
+
className: classNames(classes.panelAction, "cursor-pointer p-1 text-xl self-stretch"),
|
|
114
|
+
icon: CoreIcons.close,
|
|
115
|
+
onClick: function onClick() {
|
|
116
|
+
return handleClose(false);
|
|
117
|
+
}
|
|
118
|
+
})]
|
|
119
|
+
}), loading && /*#__PURE__*/jsx(Loading, {}), /*#__PURE__*/jsx("div", {
|
|
120
|
+
role: "dialog",
|
|
121
|
+
className: classNames(classes.modalBody, "flex-1 grid overflow-hidden"),
|
|
122
|
+
tabIndex: 0,
|
|
123
|
+
children: children
|
|
124
|
+
})]
|
|
125
|
+
})
|
|
126
|
+
}))
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export { Modal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer comp{.modal{margin-top:-100%;max-height:90vh;max-width:90vw;opacity:0;transition:margin .4s,opacity .3s .2s;width:32rem;z-index:var(--z-overlay);&[data-show=true]{margin-top:0;opacity:1}& .modalHeader{background-color:theme(backgroundColor.base);border-bottom:.5px solid theme(borderColor.dimmed)}& .modalBody{grid-template:"head head head" auto ". loader ." auto "side-s content side-e" 1fr "foot foot foot" auto/auto 1fr auto}}}
|