@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,86 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
+
import { isString, isEmpty, tokenize } from '@react-fabric/utilities';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { useCallback, Fragment } from 'react';
|
|
8
|
+
import { useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
9
|
+
import { getBgClass, getColor } from '../utils/getColor.js';
|
|
10
|
+
import classes from './Typography.module.css';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
var MarkText = function MarkText(_ref) {
|
|
16
|
+
var color = _ref.color,
|
|
17
|
+
children = _ref.children;
|
|
18
|
+
return /*#__PURE__*/jsx("mark", {
|
|
19
|
+
className: classNames(classes.mark, "whitespace-nowrap", color && getBgClass(color)),
|
|
20
|
+
style: color ? {
|
|
21
|
+
"--mark-color": getColor(color)
|
|
22
|
+
} : undefined,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Typography mark component to wrap text parts in `mark`
|
|
28
|
+
*/
|
|
29
|
+
var Mark = function Mark(_ref2) {
|
|
30
|
+
var children = _ref2.children,
|
|
31
|
+
mark = _ref2.mark,
|
|
32
|
+
renderer = _ref2.renderer;
|
|
33
|
+
/** ***************** abbr text renderer *******************/
|
|
34
|
+
var abbrRender = useCallback(function (text) {
|
|
35
|
+
var _renderer;
|
|
36
|
+
var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
37
|
+
return /*#__PURE__*/jsx(MarkText, {
|
|
38
|
+
color: color,
|
|
39
|
+
children: (_renderer = renderer === null || renderer === void 0 ? void 0 : renderer([text, color])) !== null && _renderer !== void 0 ? _renderer : text
|
|
40
|
+
});
|
|
41
|
+
}, [renderer]);
|
|
42
|
+
|
|
43
|
+
/** ***************** tokenize text with abbr list *******************/
|
|
44
|
+
var inner = useMemoDebugger(function () {
|
|
45
|
+
if (isString(children)) {
|
|
46
|
+
if (!isEmpty(mark)) {
|
|
47
|
+
var tokens = tokenize(children, mark.map(function (_ref3) {
|
|
48
|
+
var _ref4 = _slicedToArray(_ref3, 1),
|
|
49
|
+
keyword = _ref4[0];
|
|
50
|
+
return keyword;
|
|
51
|
+
}));
|
|
52
|
+
var titles = mark.reduce(function (t, _ref5) {
|
|
53
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
54
|
+
a = _ref6[0],
|
|
55
|
+
_ref6$ = _ref6[1],
|
|
56
|
+
color = _ref6$ === void 0 ? "" : _ref6$;
|
|
57
|
+
return _objectSpread(_objectSpread({}, t), {}, _defineProperty({}, a.toLowerCase(), {
|
|
58
|
+
color: color
|
|
59
|
+
}));
|
|
60
|
+
}, {});
|
|
61
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
62
|
+
children: tokens.map(function (_ref7, i) {
|
|
63
|
+
var _titles$text$toLowerC;
|
|
64
|
+
var _ref8 = _slicedToArray(_ref7, 2),
|
|
65
|
+
start = _ref8[0],
|
|
66
|
+
text = _ref8[1];
|
|
67
|
+
var _ref9 = (_titles$text$toLowerC = titles[text.toLowerCase()]) !== null && _titles$text$toLowerC !== void 0 ? _titles$text$toLowerC : {},
|
|
68
|
+
_ref9$color = _ref9.color,
|
|
69
|
+
color = _ref9$color === void 0 ? "" : _ref9$color;
|
|
70
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
71
|
+
children: [start, text ? abbrRender(text, color) : null]
|
|
72
|
+
}, i);
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return children;
|
|
78
|
+
}, [children, mark, abbrRender], "TextMark inner");
|
|
79
|
+
|
|
80
|
+
/** ***************** component *******************/
|
|
81
|
+
return /*#__PURE__*/jsx("span", {
|
|
82
|
+
children: inner
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { Mark };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
|
+
import { isNumber } from '@react-fabric/utilities';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import { useRef, useState, useCallback } from 'react';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { useLayoutEffectDebugger, useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
11
|
+
import { usePropToggle } from '../hooks/usePropToggle.js';
|
|
12
|
+
import { calculateTextHeight } from '../utils/calculateDimensions.js';
|
|
13
|
+
import { getColor, getBgClass, getColorClass } from '../utils/getColor.js';
|
|
14
|
+
import classes from './Typography.module.css';
|
|
15
|
+
import { TextSizeMap } from './types.js';
|
|
16
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
var _excluded = ["children", "className", "inline", "bg", "color", "family", "size", "clamp", "align"];
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
/**
|
|
22
|
+
* Typography text component
|
|
23
|
+
*/
|
|
24
|
+
var Text = function Text(_ref) {
|
|
25
|
+
var children = _ref.children,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
inline = _ref.inline,
|
|
28
|
+
bg = _ref.bg,
|
|
29
|
+
color = _ref.color,
|
|
30
|
+
family = _ref.family,
|
|
31
|
+
size = _ref.size,
|
|
32
|
+
clamp = _ref.clamp,
|
|
33
|
+
align = _ref.align,
|
|
34
|
+
aria = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
var _useTranslation = useTranslation("core"),
|
|
36
|
+
t = _useTranslation.t;
|
|
37
|
+
var refContainer = useRef(null);
|
|
38
|
+
var _useState = useState(false),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
clipped = _useState2[0],
|
|
41
|
+
setClipped = _useState2[1];
|
|
42
|
+
var _usePropToggle = usePropToggle(false),
|
|
43
|
+
_usePropToggle2 = _slicedToArray(_usePropToggle, 3),
|
|
44
|
+
showMore = _usePropToggle2[0],
|
|
45
|
+
toggleShowMore = _usePropToggle2[1],
|
|
46
|
+
refShowMore = _usePropToggle2[2];
|
|
47
|
+
|
|
48
|
+
/** ***************** check text height if clip enabled *******************/
|
|
49
|
+
var checkHeight = useCallback(function () {
|
|
50
|
+
var el = refContainer.current;
|
|
51
|
+
if (el && isNumber(clamp) && clamp > 0 && !refShowMore.current) {
|
|
52
|
+
setClipped(calculateTextHeight(el.firstElementChild, el) > el.offsetHeight);
|
|
53
|
+
}
|
|
54
|
+
}, [clamp]);
|
|
55
|
+
|
|
56
|
+
/** ***************** observe element resize to recalculate height *******************/
|
|
57
|
+
useLayoutEffectDebugger(function () {
|
|
58
|
+
if (refContainer.current) {
|
|
59
|
+
var ob = new ResizeObserver(checkHeight);
|
|
60
|
+
ob.observe(refContainer.current);
|
|
61
|
+
checkHeight();
|
|
62
|
+
return function () {
|
|
63
|
+
ob.disconnect();
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}, [children, checkHeight], "Text check height");
|
|
67
|
+
|
|
68
|
+
/** ***************** style map *******************/
|
|
69
|
+
var styles = useMemoDebugger(function () {
|
|
70
|
+
var s = {};
|
|
71
|
+
if (bg) {
|
|
72
|
+
s.backgroundColor = getColor(bg);
|
|
73
|
+
}
|
|
74
|
+
if (color) {
|
|
75
|
+
s.color = getColor(color);
|
|
76
|
+
}
|
|
77
|
+
if (align) {
|
|
78
|
+
s.textAlign = align;
|
|
79
|
+
}
|
|
80
|
+
if (size && !(size in TextSizeMap)) {
|
|
81
|
+
s.fontSize = size;
|
|
82
|
+
}
|
|
83
|
+
if (size && size in TextSizeMap) {
|
|
84
|
+
s.fontSize = TextSizeMap[size];
|
|
85
|
+
}
|
|
86
|
+
return s;
|
|
87
|
+
}, [bg, color, size, align, family], "Text styles");
|
|
88
|
+
return inline ? /*#__PURE__*/jsx("span", _objectSpread(_objectSpread({
|
|
89
|
+
className: className,
|
|
90
|
+
style: styles
|
|
91
|
+
}, aria), {}, {
|
|
92
|
+
children: children
|
|
93
|
+
})) : /*#__PURE__*/jsxs("article", {
|
|
94
|
+
className: className,
|
|
95
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
96
|
+
ref: refContainer,
|
|
97
|
+
style: {
|
|
98
|
+
"--text-clamp": showMore ? "unset" : clamp !== null && clamp !== void 0 ? clamp : "unset"
|
|
99
|
+
},
|
|
100
|
+
children: /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
101
|
+
className: classNames(classes.text, "text-reset mixed-lang px-[2px] whitespace-pre-wrap", family && "font-".concat(family), bg && getBgClass(bg), color && getColorClass(color), clamp && "line-clamp-1"),
|
|
102
|
+
style: styles
|
|
103
|
+
}, aria), {}, {
|
|
104
|
+
children: children
|
|
105
|
+
}))
|
|
106
|
+
}), clipped && /*#__PURE__*/jsx("div", {
|
|
107
|
+
className: classes.moreLink,
|
|
108
|
+
children: /*#__PURE__*/jsxs("span", {
|
|
109
|
+
role: "link",
|
|
110
|
+
tabIndex: 0,
|
|
111
|
+
"data-inner-clickable": true,
|
|
112
|
+
onClick: function onClick(e) {
|
|
113
|
+
return [e.stopPropagation(), toggleShowMore()];
|
|
114
|
+
},
|
|
115
|
+
children: ["...", t("action.".concat(showMore ? "less" : "more"))]
|
|
116
|
+
})
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export { Text };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
7
|
+
import { getColor, getBgClass, getColorClass } from '../utils/getColor.js';
|
|
8
|
+
import '@react-fabric/utilities';
|
|
9
|
+
import { TitleSizeMap } from './types.js';
|
|
10
|
+
import classes from './Typography.module.css';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
var _excluded = ["children", "className", "as", "bg", "color", "size", "align", "family"];
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
/**
|
|
17
|
+
* Typography title component
|
|
18
|
+
*/
|
|
19
|
+
var Title = function Title(_ref) {
|
|
20
|
+
var children = _ref.children,
|
|
21
|
+
className = _ref.className,
|
|
22
|
+
as = _ref.as,
|
|
23
|
+
bg = _ref.bg,
|
|
24
|
+
color = _ref.color,
|
|
25
|
+
size = _ref.size,
|
|
26
|
+
align = _ref.align,
|
|
27
|
+
family = _ref.family,
|
|
28
|
+
aria = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
/** ***************** style map *******************/
|
|
30
|
+
var styles = useMemoDebugger(function () {
|
|
31
|
+
var s = {};
|
|
32
|
+
if (bg) {
|
|
33
|
+
s.backgroundColor = getColor(bg);
|
|
34
|
+
}
|
|
35
|
+
if (color) {
|
|
36
|
+
s.color = getColor(color);
|
|
37
|
+
}
|
|
38
|
+
if (align) {
|
|
39
|
+
s.textAlign = align;
|
|
40
|
+
}
|
|
41
|
+
if (size && !(size in TitleSizeMap)) {
|
|
42
|
+
s.fontSize = size;
|
|
43
|
+
}
|
|
44
|
+
if (size && size in TitleSizeMap) {
|
|
45
|
+
s.fontSize = TitleSizeMap[size];
|
|
46
|
+
}
|
|
47
|
+
return s;
|
|
48
|
+
}, [bg, color, size, align], "Title styles");
|
|
49
|
+
var E = as !== null && as !== void 0 ? as : "p";
|
|
50
|
+
return /*#__PURE__*/jsx(E, _objectSpread(_objectSpread({
|
|
51
|
+
className: classNames(classes.title, "px-[2px] py-1 truncate whitespace-pre-wrap", className, family && "font-".concat(family), !as && "text-lg", bg && getBgClass(bg), color && getColorClass(color)),
|
|
52
|
+
style: styles
|
|
53
|
+
}, aria), {}, {
|
|
54
|
+
children: children
|
|
55
|
+
}));
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { Title };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer comp{.title{line-height:1.125}.moreLink{margin:-.25rem 0 1rem;text-align:end;&>span{color:theme(colors.accent.700);cursor:pointer;font-size:.75rem;user-select:none;&:hover{color:theme(colors.accent.500);text-decoration:underline;text-underline-offset:2px}}}}@layer util{.text{-webkit-line-clamp:var(--text-clamp)}.abbr{--abbr-color:var(--accent);color:color-mix(in lab,var(--abbr-color) 50%,var(--fabric-text))}.mark{--mark-color:var(--accent);background-color:color-mix(in lab,var(--mark-color) 25%,var(--fabric-bg))}}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* React Fabric
|
|
5
|
+
* @version: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
10
|
+
*
|
|
11
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
12
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
13
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
14
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
15
|
+
* subject to the following conditions:
|
|
16
|
+
*
|
|
17
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
18
|
+
* portions of the Software.
|
|
19
|
+
*
|
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
21
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
22
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
23
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
var TitleSizeMap = {
|
|
27
|
+
xs: "0.875rem",
|
|
28
|
+
sm: "1.125rem",
|
|
29
|
+
md: "1.5rem",
|
|
30
|
+
lg: "1.75rem",
|
|
31
|
+
xl: "2rem"
|
|
32
|
+
};
|
|
33
|
+
var TextSizeMap = {
|
|
34
|
+
xs: "0.75rem",
|
|
35
|
+
sm: "0.875rem",
|
|
36
|
+
md: "1.125rem",
|
|
37
|
+
lg: "1.5rem",
|
|
38
|
+
xl: "1.75rem"
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { TextSizeMap, TitleSizeMap };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* React Fabric
|
|
5
|
+
* @version: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
10
|
+
*
|
|
11
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
12
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
13
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
14
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
15
|
+
* subject to the following conditions:
|
|
16
|
+
*
|
|
17
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
18
|
+
* portions of the Software.
|
|
19
|
+
*
|
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
21
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
22
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
23
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/* istanbul ignore file */
|
|
27
|
+
|
|
28
|
+
/** ***************** get css style property value *******************/
|
|
29
|
+
var getCssStyle = function getCssStyle(element, property) {
|
|
30
|
+
return getComputedStyle(element).getPropertyValue(property);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** ***************** calculate full height for given element *******************/
|
|
34
|
+
var calculateTextHeight = function calculateTextHeight(element, styleRoot) {
|
|
35
|
+
var clone = element.cloneNode(true);
|
|
36
|
+
clone.style.font = getCssStyle(styleRoot !== null && styleRoot !== void 0 ? styleRoot : element, "font");
|
|
37
|
+
clone.style.width = "".concat(element.offsetWidth, "px");
|
|
38
|
+
clone.style.padding = getCssStyle(styleRoot !== null && styleRoot !== void 0 ? styleRoot : element, "padding");
|
|
39
|
+
clone.style.lineHeight = getCssStyle(styleRoot !== null && styleRoot !== void 0 ? styleRoot : element, "line-height");
|
|
40
|
+
clone.style.letterSpacing = getCssStyle(styleRoot !== null && styleRoot !== void 0 ? styleRoot : element, "letter-spacing");
|
|
41
|
+
clone.style.webkitLineClamp = "unset";
|
|
42
|
+
clone.style.position = "absolute";
|
|
43
|
+
clone.style.left = "-10000%";
|
|
44
|
+
document.body.appendChild(clone);
|
|
45
|
+
var height = clone.offsetHeight;
|
|
46
|
+
clone.remove();
|
|
47
|
+
return height;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { calculateTextHeight, getCssStyle };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { isColor } from '@react-fabric/utilities';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* React Fabric
|
|
7
|
+
* @version: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* The MIT License (MIT)
|
|
11
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
14
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
15
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
16
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
+
* subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
20
|
+
* portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
23
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
24
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
25
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
var getColor = function getColor(color) {
|
|
29
|
+
if (color && isColor(color)) {
|
|
30
|
+
return color;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var getBgClass = function getBgClass(bg) {
|
|
34
|
+
if (bg && !isColor(bg)) {
|
|
35
|
+
return "bg-".concat(bg);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var getColorClass = function getColorClass(color) {
|
|
39
|
+
if (color && !isColor(color)) {
|
|
40
|
+
return "text-".concat(color);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var getBorderClass = function getBorderClass(color) {
|
|
44
|
+
if (color && !isColor(color)) {
|
|
45
|
+
return "border-".concat(color);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { getBgClass, getBorderClass, getColor, getColorClass };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { isObject } from '@react-fabric/utilities';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* React Fabric
|
|
7
|
+
* @version: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* The MIT License (MIT)
|
|
11
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
14
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
15
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
16
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
+
* subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
20
|
+
* portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
23
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
24
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
25
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
var nodeCheck = function nodeCheck(node) {
|
|
29
|
+
for (var _len = arguments.length, types = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
30
|
+
types[_key - 1] = arguments[_key];
|
|
31
|
+
}
|
|
32
|
+
return isObject(node) && "type" in node && types.includes(node.type);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { nodeCheck };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { type AriaProps, type ChildProp, type CssProp } from "../../types";
|
|
3
|
+
export interface ActionLabelProps extends AriaProps, CssProp, ChildProp {
|
|
4
|
+
/**
|
|
5
|
+
* action buttons aligment
|
|
6
|
+
*/
|
|
7
|
+
align?: "start" | "end";
|
|
8
|
+
/**
|
|
9
|
+
* disable actions
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* buttons
|
|
14
|
+
*/
|
|
15
|
+
actions: ReactElement[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A simple label component with additional actions (like a button or icon) that becomes visible only when the user hovers over the label,
|
|
19
|
+
* useful in interfaces where space is limited or where it's important to keep the UI clean and focused
|
|
20
|
+
*/
|
|
21
|
+
export declare const ActionLabel: ({ children, className, align, actions, disabled, ...rest }: ActionLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AriaProps, type ColorType, type CssProp, type PaletteType } from "../../types";
|
|
2
|
+
export interface AnimationProps extends CssProp, AriaProps {
|
|
3
|
+
type?: "info" | "check" | "cross" | "question" | "exclaim";
|
|
4
|
+
/**
|
|
5
|
+
* icon color
|
|
6
|
+
*/
|
|
7
|
+
color?: ColorType | PaletteType;
|
|
8
|
+
/**
|
|
9
|
+
* icon mark color
|
|
10
|
+
*/
|
|
11
|
+
strokeColor?: ColorType | PaletteType;
|
|
12
|
+
}
|
|
13
|
+
export declare const AnimationIndicator: ({ className, color, strokeColor, type, ...aria }: AnimationProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const AnimationBars: ({ color, size, }: {
|
|
15
|
+
color?: ColorType | string;
|
|
16
|
+
size?: number | string;
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const AnimationSpinner: ({ color, size, }: {
|
|
19
|
+
color?: ColorType | string;
|
|
20
|
+
size?: number | string;
|
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const Skeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type AriaProps, type ColorType, type CssProp, type RefProp, type SizeType, type TestProps } from "../../types";
|
|
3
|
+
export interface AvatarProps extends CssProp, AriaProps, TestProps, RefProp {
|
|
4
|
+
/**
|
|
5
|
+
* avatar name for generated fallback
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* svg path
|
|
10
|
+
*/
|
|
11
|
+
fallbackIcon?: string;
|
|
12
|
+
/**
|
|
13
|
+
* avatar image url
|
|
14
|
+
*/
|
|
15
|
+
avatar?: string;
|
|
16
|
+
/**
|
|
17
|
+
* avatar variant
|
|
18
|
+
*/
|
|
19
|
+
variant?: "text" | "beam" | "pixel" | "bauhaus";
|
|
20
|
+
/**
|
|
21
|
+
* background color (CSS color / tailwind color)
|
|
22
|
+
*/
|
|
23
|
+
bg?: ColorType | string;
|
|
24
|
+
/**
|
|
25
|
+
* icon color (CSS color / tailwind color)
|
|
26
|
+
*/
|
|
27
|
+
color?: ColorType | string;
|
|
28
|
+
/**
|
|
29
|
+
* icon size
|
|
30
|
+
*/
|
|
31
|
+
size?: SizeType | number | string;
|
|
32
|
+
/**
|
|
33
|
+
* viewbox for svg path (default 24)
|
|
34
|
+
*/
|
|
35
|
+
viewBox?: string;
|
|
36
|
+
/**
|
|
37
|
+
* rounded icon
|
|
38
|
+
*/
|
|
39
|
+
rounded?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* click handler
|
|
42
|
+
*/
|
|
43
|
+
onClick?: React.MouseEventHandler;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* An avatar is a graphical representation of a user's identity.
|
|
47
|
+
*/
|
|
48
|
+
export declare const Avatar: ({ ref, name, avatar, fallbackIcon, bg, color, size, rounded, variant, className, viewBox, onClick, ...aria }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { type AriaProps, type CssProp, type RefProp, type SizeType } from "../../types";
|
|
3
|
+
import { type AvatarProps } from "./Avatar";
|
|
4
|
+
type AvatarChild = ReactElement<Omit<AvatarProps, "size" | "rounded">> | false | undefined;
|
|
5
|
+
export interface AvatarGroupProps extends CssProp, RefProp, AriaProps {
|
|
6
|
+
children: AvatarChild | AvatarChild[];
|
|
7
|
+
/**
|
|
8
|
+
* rounded icon
|
|
9
|
+
*/
|
|
10
|
+
rounded?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* icon size
|
|
13
|
+
*/
|
|
14
|
+
size?: SizeType | number | string;
|
|
15
|
+
/**
|
|
16
|
+
* max count
|
|
17
|
+
*/
|
|
18
|
+
totalCount?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Group multiple avatars together
|
|
22
|
+
*/
|
|
23
|
+
export declare const AvatarGroup: ({ ref, children, className, totalCount, rounded, size, ...aria }: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type BadgeType, type ChildProp, type CssProp, type IconProps, type RefProp } from "../../types";
|
|
2
|
+
export interface BadgeProps extends CssProp, RefProp, IconProps, Partial<ChildProp> {
|
|
3
|
+
/**
|
|
4
|
+
* make wrapper a block element
|
|
5
|
+
*/
|
|
6
|
+
block?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* badge value
|
|
9
|
+
*/
|
|
10
|
+
value?: number | string;
|
|
11
|
+
/**
|
|
12
|
+
* max value for number display
|
|
13
|
+
*/
|
|
14
|
+
max?: number;
|
|
15
|
+
/**
|
|
16
|
+
* ping animation
|
|
17
|
+
*/
|
|
18
|
+
ping?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* badge placement
|
|
21
|
+
*/
|
|
22
|
+
placement?: "top-start" | "top-end" | "bottom-start" | "bottom-end" | "top" | "bottom" | "start" | "end";
|
|
23
|
+
}
|
|
24
|
+
export declare const getBadgeProps: (badge?: string | number | BadgeType) => AnyObject;
|
|
25
|
+
export declare const Badge: ({ ref, className, value, max, ping, block, placement, children, forButton, icon, iconBg, iconColor, rtlFlip, ...rest }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type AriaProps, type ChildrenProp, type CssProp } from "../../types";
|
|
2
|
+
import { Link } from "../../typography/Link";
|
|
3
|
+
export interface BreadcrumbProps extends CssProp, AriaProps, ChildrenProp<typeof Link> {
|
|
4
|
+
/**
|
|
5
|
+
* breadcrumb styling
|
|
6
|
+
*/
|
|
7
|
+
variant?: "classic" | "modern";
|
|
8
|
+
/**
|
|
9
|
+
* classic breadcrumb spearator
|
|
10
|
+
*/
|
|
11
|
+
separator?: string;
|
|
12
|
+
/**
|
|
13
|
+
* breadcrumb color
|
|
14
|
+
*/
|
|
15
|
+
color?: "primary" | "accent";
|
|
16
|
+
}
|
|
17
|
+
export declare const Breadcrumbs: ({ variant, className, separator, children, color, ...aria }: BreadcrumbProps) => import("react/jsx-runtime").JSX.Element;
|