@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,179 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* React Fabric
|
|
3
|
+
* @version: 1.0.0
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* The MIT License (MIT)
|
|
7
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
10
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
11
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
12
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
+
* subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
16
|
+
* portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@layer comp {
|
|
25
|
+
h1 {
|
|
26
|
+
font-size: 2.5rem;
|
|
27
|
+
font-weight: 500;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
h2 {
|
|
31
|
+
font-size: 2rem;
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h3 {
|
|
36
|
+
font-size: 1.75rem;
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
h4 {
|
|
41
|
+
font-size: 1.5rem;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
h5 {
|
|
46
|
+
font-size: 1.25rem;
|
|
47
|
+
font-weight: 500;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
h6 {
|
|
51
|
+
font-size: 1rem;
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
p {
|
|
56
|
+
line-height: 1.5;
|
|
57
|
+
|
|
58
|
+
& + p,
|
|
59
|
+
& + article {
|
|
60
|
+
margin-top: 1rem;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
article {
|
|
65
|
+
& + p,
|
|
66
|
+
& + article {
|
|
67
|
+
margin-top: 1rem;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
ul,
|
|
72
|
+
ol {
|
|
73
|
+
margin: 0;
|
|
74
|
+
padding-inline-start: 2em;
|
|
75
|
+
list-style-position: outside;
|
|
76
|
+
|
|
77
|
+
& > li {
|
|
78
|
+
padding: 0 2px;
|
|
79
|
+
line-height: 2;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
ul {
|
|
84
|
+
list-style: disc;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
ol {
|
|
88
|
+
list-style: decimal;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
dl {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-flow: row wrap;
|
|
94
|
+
margin: 0 0 1rem;
|
|
95
|
+
line-height: 1.5em;
|
|
96
|
+
|
|
97
|
+
dt {
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
flex: 0 0 33.3%;
|
|
100
|
+
|
|
101
|
+
min-width: 6em;
|
|
102
|
+
max-width: 12em;
|
|
103
|
+
padding-inline: 1em;
|
|
104
|
+
|
|
105
|
+
font-size: 0.875em;
|
|
106
|
+
color: theme(textColor.dimmed);
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
dd {
|
|
112
|
+
flex: 1 1 66.6%;
|
|
113
|
+
margin: 0;
|
|
114
|
+
padding: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.align-end > dt {
|
|
118
|
+
text-align: end;
|
|
119
|
+
|
|
120
|
+
&::after {
|
|
121
|
+
content: ": ";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&.bg-alternate {
|
|
126
|
+
& > dt:nth-of-type(odd),
|
|
127
|
+
& > dd:nth-of-type(odd) {
|
|
128
|
+
background-color: color-mix(in lab, var(--fabric-bg) 99%, var(--tint));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
& > dt:nth-of-type(even),
|
|
132
|
+
& > dd:nth-of-type(even) {
|
|
133
|
+
background-color: color-mix(in lab, var(--fabric-bg) 92%, var(--tint));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
abbr {
|
|
139
|
+
cursor: help;
|
|
140
|
+
|
|
141
|
+
display: inline-block;
|
|
142
|
+
|
|
143
|
+
padding: 0 2px;
|
|
144
|
+
|
|
145
|
+
color: theme(colors.accent.700);
|
|
146
|
+
text-decoration: underline dashed 1px;
|
|
147
|
+
|
|
148
|
+
background-color: color-mix(in lab, currentcolor 10%, var(--fabric-bg));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
mark {
|
|
152
|
+
display: inline-block;
|
|
153
|
+
color: var(--fabric-text);
|
|
154
|
+
background-color: theme(colors.accent.100);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.link {
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
user-select: none;
|
|
160
|
+
|
|
161
|
+
font-weight: 500;
|
|
162
|
+
color: theme(colors.accent.600);
|
|
163
|
+
text-decoration: underline dotted;
|
|
164
|
+
|
|
165
|
+
&:hover {
|
|
166
|
+
text-decoration: underline solid;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.bg-odd,
|
|
171
|
+
.bg-alternate > :nth-child(odd) {
|
|
172
|
+
background-color: color-mix(in lab, var(--fabric-bg) 99%, var(--tint));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.bg-even,
|
|
176
|
+
.bg-alternate > :nth-child(even) {
|
|
177
|
+
background-color: color-mix(in lab, var(--fabric-bg) 92%, var(--tint));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* React Fabric
|
|
3
|
+
* @version: 1.0.0
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* The MIT License (MIT)
|
|
7
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
10
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
11
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
12
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
+
* subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
16
|
+
* portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@layer colors {
|
|
25
|
+
[data-color-scheme="light"] {
|
|
26
|
+
--fabric-bg: theme(colors.white);
|
|
27
|
+
--fabric-text: theme(colors.black);
|
|
28
|
+
--fabric-input: color-mix(in lab, var(--fabric-bg) 90%, #fff);
|
|
29
|
+
--fabric-input-focus: #fff;
|
|
30
|
+
--fabric-shadow: #8ba0b0;
|
|
31
|
+
|
|
32
|
+
color-scheme: light;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-color-scheme="dark"] {
|
|
36
|
+
--fabric-bg: theme(colors.black);
|
|
37
|
+
--fabric-text: theme(colors.white);
|
|
38
|
+
--fabric-input: color-mix(in lab, var(--fabric-bg) 80%, #0a1218);
|
|
39
|
+
--fabric-input-focus: color-mix(in lab, var(--fabric-bg) 60%, #0a1218);
|
|
40
|
+
--fabric-shadow: #010101;
|
|
41
|
+
|
|
42
|
+
color-scheme: dark;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@layer reset {
|
|
47
|
+
:root {
|
|
48
|
+
--black: theme(colors.black);
|
|
49
|
+
--white: theme(colors.white);
|
|
50
|
+
--scarlet: theme(colors.scarlet.DEFAULT);
|
|
51
|
+
--pumpkin: theme(colors.pumpkin.DEFAULT);
|
|
52
|
+
--marigold: theme(colors.marigold.DEFAULT);
|
|
53
|
+
--avacado: theme(colors.avacado.DEFAULT);
|
|
54
|
+
--jade: theme(colors.jade.DEFAULT);
|
|
55
|
+
--denim: theme(colors.denim.DEFAULT);
|
|
56
|
+
--iris: theme(colors.iris.DEFAULT);
|
|
57
|
+
--lilac: theme(colors.lilac.DEFAULT);
|
|
58
|
+
--coral: theme(colors.coral.DEFAULT);
|
|
59
|
+
--wood: theme(colors.wood.DEFAULT);
|
|
60
|
+
--silver: theme(colors.silver.DEFAULT);
|
|
61
|
+
--steel: theme(colors.steel.DEFAULT);
|
|
62
|
+
--olive: theme(colors.olive.DEFAULT);
|
|
63
|
+
--sand: theme(colors.sand.DEFAULT);
|
|
64
|
+
--info: theme(colors.info.DEFAULT);
|
|
65
|
+
--danger: theme(colors.danger.DEFAULT);
|
|
66
|
+
--success: theme(colors.success.DEFAULT);
|
|
67
|
+
--warning: theme(colors.warning.DEFAULT);
|
|
68
|
+
|
|
69
|
+
/* app default primary */
|
|
70
|
+
--primary: theme(colors.denim.DEFAULT);
|
|
71
|
+
--accent: theme(colors.jade.DEFAULT);
|
|
72
|
+
--tint: theme(colors.silver.DEFAULT);
|
|
73
|
+
|
|
74
|
+
/* default rounding */
|
|
75
|
+
--rounding: 0.25rem;
|
|
76
|
+
--rounding-cap: 0.25rem;
|
|
77
|
+
--gutter: 0.5rem;
|
|
78
|
+
|
|
79
|
+
/* z levels */
|
|
80
|
+
--z-overlay-mask: 25;
|
|
81
|
+
--z-overlay: 30;
|
|
82
|
+
--z-popover-mask: 45;
|
|
83
|
+
--z-popover: 50;
|
|
84
|
+
--z-tooltip: 60;
|
|
85
|
+
--z-notifications: 60;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-color-scheme] {
|
|
89
|
+
color: color-mix(in lab, var(--fabric-text) 95%, var(--tint));
|
|
90
|
+
background-color: color-mix(in lab, var(--fabric-bg) 92%, var(--tint));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-rounding="sm"] {
|
|
94
|
+
/* default rounding */
|
|
95
|
+
--rounding: 2px;
|
|
96
|
+
--rounding-cap: 2px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-rounding="md"] {
|
|
100
|
+
/* default rounding */
|
|
101
|
+
--rounding: 0.5rem;
|
|
102
|
+
--rounding-cap: 0.5rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-rounding="full"] {
|
|
106
|
+
/* default rounding */
|
|
107
|
+
--rounding: 9999px;
|
|
108
|
+
--rounding-cap: 0.5rem;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* React Fabric
|
|
3
|
+
* @version: 1.0.0
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* The MIT License (MIT)
|
|
7
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
10
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
11
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
12
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
+
* subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
16
|
+
* portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@import url("./_theme.css");
|
|
25
|
+
@import url("./_reset.css");
|
|
26
|
+
@import url("./_text.css");
|
|
27
|
+
@import url("./_gradients.css");
|
package/css/styles.css
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* React Fabric
|
|
3
|
+
* @version: 1.0.0
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* The MIT License (MIT)
|
|
7
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
10
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
11
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
12
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
+
* subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
16
|
+
* portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@layer colors, reset, comp, util, var;
|
|
25
|
+
|
|
26
|
+
@import url("tailwindcss/base") layer(reset);
|
|
27
|
+
@import url("tailwindcss/components") layer(comp);
|
|
28
|
+
@import url("tailwindcss/utilities") layer(util);
|
|
29
|
+
@import url("tailwindcss/variants") layer(var);
|
|
30
|
+
|
|
31
|
+
@import url("./reset/index.css");
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* React Fabric
|
|
3
|
+
* @version: 1.0.0
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* The MIT License (MIT)
|
|
7
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
10
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
11
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
12
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
+
* subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
16
|
+
* portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
/* istanbul ignore file */
|
|
24
|
+
|
|
25
|
+
const COlORS = {
|
|
26
|
+
silver: "#989da5",
|
|
27
|
+
steel: "#7c99af",
|
|
28
|
+
olive: "#769b8d",
|
|
29
|
+
sand: "#9b9789",
|
|
30
|
+
info: "#00bfff",
|
|
31
|
+
danger: "#f24c3d",
|
|
32
|
+
success: "#44bc69",
|
|
33
|
+
warning: "#edaa00",
|
|
34
|
+
scarlet: "#e5484d",
|
|
35
|
+
pumpkin: "#f76a15",
|
|
36
|
+
marigold: "#ffc100",
|
|
37
|
+
avacado: "#46a758",
|
|
38
|
+
jade: "#29a383",
|
|
39
|
+
denim: "#0190ff",
|
|
40
|
+
iris: "#5b5bd6",
|
|
41
|
+
lilac: "#8e4ec6",
|
|
42
|
+
coral: "#e93d82",
|
|
43
|
+
wood: "#ad7f58",
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const colorMix = (color: string, shader: string, percent: number) =>
|
|
47
|
+
`color-mix(in lab, ${applyAlpha(color)} ${percent}%, ${applyAlpha(shader)})`;
|
|
48
|
+
|
|
49
|
+
const applyAlpha = (color: string) =>
|
|
50
|
+
`color(from ${color} srgb r g b / <alpha-value>)`;
|
|
51
|
+
|
|
52
|
+
export const colors = {
|
|
53
|
+
black: "#191a1b",
|
|
54
|
+
white: "#fefdfc",
|
|
55
|
+
bg: `${applyAlpha("var(--fabric-bg)")}`,
|
|
56
|
+
text: `${applyAlpha("var(--fabric-text)")}`,
|
|
57
|
+
primary: {
|
|
58
|
+
DEFAULT: "var(--primary)",
|
|
59
|
+
50: colorMix("var(--primary)", "var(--fabric-bg)", 10),
|
|
60
|
+
100: colorMix("var(--primary)", "var(--fabric-bg)", 27),
|
|
61
|
+
200: colorMix("var(--primary)", "var(--fabric-bg)", 45),
|
|
62
|
+
300: colorMix("var(--primary)", "var(--fabric-bg)", 62),
|
|
63
|
+
400: colorMix("var(--primary)", "var(--fabric-bg)", 80),
|
|
64
|
+
500: applyAlpha("var(--primary)"),
|
|
65
|
+
600: colorMix("var(--primary)", "var(--fabric-text)", 80),
|
|
66
|
+
700: colorMix("var(--primary)", "var(--fabric-text)", 62),
|
|
67
|
+
800: colorMix("var(--primary)", "var(--fabric-text)", 45),
|
|
68
|
+
900: colorMix("var(--primary)", "var(--fabric-text)", 27),
|
|
69
|
+
950: colorMix("var(--primary)", "var(--fabric-text)", 10),
|
|
70
|
+
},
|
|
71
|
+
accent: {
|
|
72
|
+
DEFAULT: "var(--accent)",
|
|
73
|
+
50: colorMix("var(--accent)", "var(--fabric-bg)", 10),
|
|
74
|
+
100: colorMix("var(--accent)", "var(--fabric-bg)", 27),
|
|
75
|
+
200: colorMix("var(--accent)", "var(--fabric-bg)", 45),
|
|
76
|
+
300: colorMix("var(--accent)", "var(--fabric-bg)", 62),
|
|
77
|
+
400: colorMix("var(--accent)", "var(--fabric-bg)", 80),
|
|
78
|
+
500: applyAlpha("var(--accent)"),
|
|
79
|
+
600: colorMix("var(--accent)", "var(--fabric-text)", 80),
|
|
80
|
+
700: colorMix("var(--accent)", "var(--fabric-text)", 62),
|
|
81
|
+
800: colorMix("var(--accent)", "var(--fabric-text)", 45),
|
|
82
|
+
900: colorMix("var(--accent)", "var(--fabric-text)", 27),
|
|
83
|
+
950: colorMix("var(--accent)", "var(--fabric-text)", 10),
|
|
84
|
+
},
|
|
85
|
+
tint: {
|
|
86
|
+
DEFAULT: "var(--tint)",
|
|
87
|
+
50: colorMix("var(--tint)", "var(--fabric-bg)", 10),
|
|
88
|
+
100: colorMix("var(--tint)", "var(--fabric-bg)", 27),
|
|
89
|
+
200: colorMix("var(--tint)", "var(--fabric-bg)", 45),
|
|
90
|
+
300: colorMix("var(--tint)", "var(--fabric-bg)", 62),
|
|
91
|
+
400: colorMix("var(--tint)", "var(--fabric-bg)", 80),
|
|
92
|
+
500: applyAlpha("var(--tint)"),
|
|
93
|
+
600: colorMix("var(--tint)", "var(--fabric-text)", 80),
|
|
94
|
+
700: colorMix("var(--tint)", "var(--fabric-text)", 62),
|
|
95
|
+
800: colorMix("var(--tint)", "var(--fabric-text)", 45),
|
|
96
|
+
900: colorMix("var(--tint)", "var(--fabric-text)", 27),
|
|
97
|
+
950: colorMix("var(--tint)", "var(--fabric-text)", 10),
|
|
98
|
+
},
|
|
99
|
+
...Object.entries(COlORS).reduce(
|
|
100
|
+
(ret, [key, color]) => ({
|
|
101
|
+
...ret,
|
|
102
|
+
[key]: {
|
|
103
|
+
DEFAULT: color,
|
|
104
|
+
50: colorMix(color, "var(--fabric-bg)", 10),
|
|
105
|
+
100: colorMix(color, "var(--fabric-bg)", 27),
|
|
106
|
+
200: colorMix(color, "var(--fabric-bg)", 45),
|
|
107
|
+
300: colorMix(color, "var(--fabric-bg)", 62),
|
|
108
|
+
400: colorMix(color, "var(--fabric-bg)", 80),
|
|
109
|
+
500: applyAlpha(color),
|
|
110
|
+
600: colorMix(color, "var(--fabric-text)", 80),
|
|
111
|
+
700: colorMix(color, "var(--fabric-text)", 62),
|
|
112
|
+
800: colorMix(color, "var(--fabric-text)", 45),
|
|
113
|
+
900: colorMix(color, "var(--fabric-text)", 27),
|
|
114
|
+
950: colorMix(color, "var(--fabric-text)", 10),
|
|
115
|
+
},
|
|
116
|
+
}),
|
|
117
|
+
{},
|
|
118
|
+
),
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const backgroundColor = {
|
|
122
|
+
inherit: "inherit",
|
|
123
|
+
current: "currentColor",
|
|
124
|
+
transparent: "transparent",
|
|
125
|
+
DEFAULT: colorMix("var(--fabric-bg)", "var(--tint)", 99),
|
|
126
|
+
base: colorMix("var(--fabric-bg)", "var(--tint)", 99),
|
|
127
|
+
dimmed: colorMix("var(--fabric-bg)", "var(--tint)", 90),
|
|
128
|
+
muted: colorMix("var(--fabric-bg)", "var(--tint)", 80),
|
|
129
|
+
gray: colorMix("var(--fabric-bg)", "var(--tint)", 50),
|
|
130
|
+
dark: colorMix("var(--black)", "var(--tint)", 90),
|
|
131
|
+
light: colorMix("var(--white)", "var(--tint)", 90),
|
|
132
|
+
invert: colorMix("var(--fabric-bg)", "var(--fabric-text)", 5),
|
|
133
|
+
};
|
|
134
|
+
export const textColor = {
|
|
135
|
+
inherit: "inherit",
|
|
136
|
+
current: "currentColor",
|
|
137
|
+
transparent: "transparent",
|
|
138
|
+
DEFAULT: colorMix("var(--fabric-text)", "var(--tint)", 95),
|
|
139
|
+
base: colorMix("var(--fabric-text)", "var(--tint)", 95),
|
|
140
|
+
dimmed: colorMix("var(--fabric-text)", "var(--tint)", 65),
|
|
141
|
+
muted: colorMix("var(--fabric-text)", "var(--tint)", 45),
|
|
142
|
+
gray: colorMix("var(--fabric-text)", "var(--tint)", 50),
|
|
143
|
+
dark: colorMix("var(--black)", "var(--tint)", 75),
|
|
144
|
+
light: colorMix("var(--white)", "var(--tint)", 75),
|
|
145
|
+
invert: colorMix("var(--fabric-text)", "var(--fabric-bg)", 5),
|
|
146
|
+
};
|
|
147
|
+
export const borderColor = {
|
|
148
|
+
inherit: "inherit",
|
|
149
|
+
current: "currentColor",
|
|
150
|
+
transparent: "transparent",
|
|
151
|
+
DEFAULT: colorMix("var(--fabric-bg)", "var(--tint)", 65),
|
|
152
|
+
base: colorMix("var(--fabric-bg)", "var(--tint)", 65),
|
|
153
|
+
dimmed: colorMix("var(--fabric-bg)", "var(--tint)", 72),
|
|
154
|
+
muted: colorMix("var(--fabric-bg)", "var(--tint)", 80),
|
|
155
|
+
gray: applyAlpha("var(--tint)"),
|
|
156
|
+
dark: colorMix("var(--black)", "var(--tint)", 75),
|
|
157
|
+
light: colorMix("var(--white)", "var(--tint)", 75),
|
|
158
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
+
var classNames = require('classnames');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var ButtonGroup = require('../button/ButtonGroup.js');
|
|
8
|
+
var ActionLabel_module = require('./ActionLabel.module.css');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
|
|
11
|
+
var _excluded = ["children", "className", "align", "actions", "disabled"];
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
/**
|
|
15
|
+
* A simple label component with additional actions (like a button or icon) that becomes visible only when the user hovers over the label,
|
|
16
|
+
* useful in interfaces where space is limited or where it's important to keep the UI clean and focused
|
|
17
|
+
*/
|
|
18
|
+
var ActionLabel = function ActionLabel(_ref) {
|
|
19
|
+
var children = _ref.children,
|
|
20
|
+
className = _ref.className,
|
|
21
|
+
align = _ref.align,
|
|
22
|
+
actions = _ref.actions,
|
|
23
|
+
disabled = _ref.disabled,
|
|
24
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
/**
|
|
26
|
+
* calculate the width of the action box, width will be used for a delayed transition on hover
|
|
27
|
+
*/
|
|
28
|
+
var calculateBasis = react.useCallback(function (el) {
|
|
29
|
+
if (el) {
|
|
30
|
+
var clone = el.cloneNode(true);
|
|
31
|
+
clone.className = "";
|
|
32
|
+
clone.style.left = "-200%";
|
|
33
|
+
clone.style.overflow = "hidden";
|
|
34
|
+
clone.style.position = "absolute";
|
|
35
|
+
clone.style.whiteSpace = "nowrap";
|
|
36
|
+
document.body.appendChild(clone);
|
|
37
|
+
el.style.setProperty("--width", "".concat(clone.offsetWidth, "px"));
|
|
38
|
+
clone.remove();
|
|
39
|
+
}
|
|
40
|
+
}, []);
|
|
41
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
|
|
42
|
+
className: classNames(className, ActionLabel_module.actionLabel, "flex overflow-hidden gap-1 items-center cursor-default select-none"),
|
|
43
|
+
"data-disabled": disabled
|
|
44
|
+
}, rest), {}, {
|
|
45
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ButtonGroup.ButtonGroup, {
|
|
46
|
+
ref: calculateBasis,
|
|
47
|
+
className: classNames(ActionLabel_module.actions, "overflow-hidden flex-content", align === "end" && "order-2"),
|
|
48
|
+
children: actions
|
|
49
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
50
|
+
className: "flex-initial truncate",
|
|
51
|
+
children: children
|
|
52
|
+
})]
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.ActionLabel = ActionLabel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer comp{.actionLabel{&>.actions{--width:4rem;width:0}&:not([data-disabled=true]):hover>.actions{transition:all .1s cubic-bezier(.215,.61,.355,1);transition-delay:.5s;width:var(--width)}}}
|