@react-fabric/core 1.0.0-beta.4 → 1.0.0-beta.41
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/{src/components/actionLabel/ActionLabel.module.css → css/components/_actionLabel.css} +4 -4
- package/{src/overlays/alert/Alert.module.css → css/components/_alert.css} +3 -3
- package/{src/components/animations/Animations.module.css → css/components/_animations.css} +9 -9
- package/{src/components/avatar/Avatar.module.css → css/components/_avatar.css} +11 -11
- package/{src/components/badge/Badge.module.css → css/components/_badge.css} +19 -17
- package/{src/components/breadcrumbs/Breadcrumbs.module.css → css/components/_breadcrumbs.css} +49 -44
- package/{src/components/button/Button.module.css → css/components/_button.css} +68 -78
- package/{src/components/card/Card.module.css → css/components/_card.css} +32 -28
- package/{src/components/chip/Chip.module.css → css/components/_chip.css} +15 -11
- package/{src/components/collapsable/Collapsable.module.css → css/components/_collapsable.css} +3 -3
- package/css/components/_divider.css +32 -0
- package/{src/components/dropdown/Dropdown.module.css → css/components/_dropdown.css} +2 -2
- package/{src/overlays/flyout/Flyout.module.css → css/components/_flyout.css} +6 -6
- package/{src/components/icon/Icon.module.css → css/components/_icon.css} +8 -5
- package/{src/components/media/Media.module.css → css/components/_media.css} +17 -17
- package/{src/components/menu/Menu.module.css → css/components/_menu.css} +15 -16
- package/{src/overlays/message/Message.module.css → css/components/_message.css} +2 -2
- package/{src/components/meter/Meter.module.css → css/components/_meter.css} +10 -10
- package/{src/overlays/modal/Modal.module.css → css/components/_modal.css} +6 -6
- package/{src/components/panel/Panel.module.css → css/components/_panel.css} +17 -17
- package/{src/components/progress/Progress.module.css → css/components/_progress.css} +7 -10
- package/{src/components/tabpanel/TabPanel.module.css → css/components/_tabPanel.css} +73 -84
- package/{src/overlays/toast/Toast.module.css → css/components/_toast.css} +2 -2
- package/css/components/_tooltip.css +29 -0
- package/{src/core/content/Content.module.css → css/components/index.css} +25 -18
- package/{src/core/aside/Aside.module.css → css/core/_aside.css} +42 -42
- package/{src/core/section/Section.module.css → css/core/_content.css} +5 -3
- package/{src/core/boundary/ErrorBoundary.module.css → css/core/_errorboundary.css} +9 -9
- package/{src/core/headfoot/HeadFoot.module.css → css/core/_headfoot.css} +4 -10
- package/{src/core/page/Page.module.css → css/core/_page.css} +10 -14
- package/{src/core/responsive/Responsive.module.css → css/core/_responsive.css} +10 -10
- package/css/core/_section.css +28 -0
- package/{src/core/theme/Theme.module.css → css/core/_theme.css} +3 -3
- package/{src/typography/Typography.module.css → css/core/_typography.css} +14 -12
- package/{src/core/viewport/Viewport.module.css → css/core/_viewport.css} +7 -3
- package/css/core/index.css +33 -0
- package/css/reset/_gradients.css +8 -8
- package/css/reset/_reset.css +41 -223
- package/css/reset/_text.css +14 -29
- package/css/reset/_theme.css +315 -32
- package/css/reset/index.css +4 -4
- package/css/styles.css +7 -6
- package/css/theme/_colors.css +320 -0
- package/css/theme/_utilities.css +530 -0
- package/css/theme/index.css +44 -0
- package/dist/cjs/components/actionLabel/ActionLabel.js +3 -3
- package/dist/cjs/components/animations/Animations.js +29 -18
- package/dist/cjs/components/avatar/Avatar.js +10 -13
- package/dist/cjs/components/avatar/AvatarGroup.js +3 -3
- package/dist/cjs/components/badge/Badge.js +5 -5
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +10 -8
- package/dist/cjs/components/button/Button.js +18 -14
- package/dist/cjs/components/button/ButtonGroup.js +4 -3
- package/dist/cjs/components/button/ConfirmButton.js +7 -2
- package/dist/cjs/components/button/ToggleButtonGroup.js +3 -3
- package/dist/cjs/components/callout/Callout.js +15 -4
- package/dist/cjs/components/card/Card.js +8 -7
- package/dist/cjs/components/card/CardCover.js +10 -5
- package/dist/cjs/components/chip/Chip.js +11 -7
- package/dist/cjs/components/collapsable/Collapsable.js +5 -5
- package/dist/cjs/components/divider/Divider.js +10 -7
- package/dist/cjs/components/dropdown/Dropdown.js +5 -4
- package/dist/cjs/components/dropdown/DropdownTool.js +4 -3
- package/dist/cjs/components/empty/EmptyContent.js +6 -3
- package/dist/cjs/components/icon/Icon.js +15 -14
- package/dist/cjs/components/media/Media.js +116 -75
- package/dist/cjs/components/menu/ContextMenu.js +30 -10
- package/dist/cjs/components/menu/Menu.js +39 -20
- package/dist/cjs/components/menu/MenuItem.js +30 -16
- package/dist/cjs/components/meter/Meter.js +2 -3
- package/dist/cjs/components/navigator/Navigator.js +16 -9
- package/dist/cjs/components/panel/Panel.js +10 -9
- package/dist/cjs/components/panel/PanelGroup.js +1 -2
- package/dist/cjs/components/progress/ProgressBar.js +6 -5
- package/dist/cjs/components/progress/ProgressCircle.js +6 -4
- package/dist/cjs/components/tabpanel/Tab.js +58 -38
- package/dist/cjs/components/tabpanel/TabPanel.js +20 -16
- package/dist/cjs/core/aside/Aside.js +11 -10
- package/dist/cjs/core/boundary/ErrorBoundary.js +6 -7
- package/dist/cjs/core/boundary/ErrorIcon.js +1 -2
- package/dist/cjs/core/content/Content.js +9 -7
- package/dist/cjs/core/headfoot/HeadFoot.js +2 -20
- package/dist/cjs/core/page/Page.js +3 -3
- package/dist/cjs/core/responsive/Responsive.js +3 -4
- package/dist/cjs/core/section/Section.js +1 -2
- package/dist/cjs/core/theme/ThemeProvider.js +7 -8
- package/dist/cjs/core/viewport/Viewport.js +4 -2
- package/dist/cjs/hooks/useNavigator.js +6 -4
- package/dist/cjs/hotkeys/HotKeyLabel.js +1 -1
- package/dist/cjs/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/overlays/alert/Alert.js +19 -13
- package/dist/cjs/overlays/flyout/Flyout.js +49 -60
- package/dist/cjs/overlays/message/Message.js +6 -3
- package/dist/cjs/overlays/modal/Modal.js +11 -11
- package/dist/cjs/overlays/toast/Toast.js +17 -9
- package/dist/cjs/overlays/tooltip/Tooltip.js +20 -8
- package/dist/cjs/types/icons.js +4 -0
- package/dist/cjs/typography/Abbr.js +2 -3
- package/dist/cjs/typography/{Link.js → Anchor.js} +5 -4
- package/dist/cjs/typography/Mark.js +2 -3
- package/dist/cjs/typography/Text.js +3 -4
- package/dist/cjs/typography/Title.js +3 -3
- package/dist/cjs/utils/cloneElement.js +44 -0
- package/dist/cjs/utils/getColor.js +1 -18
- package/dist/esm/components/actionLabel/ActionLabel.js +3 -3
- package/dist/esm/components/animations/Animations.js +30 -19
- package/dist/esm/components/avatar/Avatar.js +11 -14
- package/dist/esm/components/avatar/AvatarGroup.js +3 -3
- package/dist/esm/components/badge/Badge.js +5 -5
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +10 -8
- package/dist/esm/components/button/Button.js +18 -14
- package/dist/esm/components/button/ButtonGroup.js +5 -4
- package/dist/esm/components/button/ConfirmButton.js +7 -2
- package/dist/esm/components/button/ToggleButtonGroup.js +4 -4
- package/dist/esm/components/callout/Callout.js +15 -4
- package/dist/esm/components/card/Card.js +8 -7
- package/dist/esm/components/card/CardCover.js +10 -5
- package/dist/esm/components/chip/Chip.js +12 -8
- package/dist/esm/components/collapsable/Collapsable.js +5 -5
- package/dist/esm/components/divider/Divider.js +11 -8
- package/dist/esm/components/dropdown/Dropdown.js +5 -4
- package/dist/esm/components/dropdown/DropdownTool.js +4 -3
- package/dist/esm/components/empty/EmptyContent.js +6 -3
- package/dist/esm/components/icon/Icon.js +15 -14
- package/dist/esm/components/media/Media.js +117 -76
- package/dist/esm/components/menu/ContextMenu.js +32 -12
- package/dist/esm/components/menu/Menu.js +41 -22
- package/dist/esm/components/menu/MenuItem.js +24 -10
- package/dist/esm/components/meter/Meter.js +2 -3
- package/dist/esm/components/navigator/Navigator.js +16 -9
- package/dist/esm/components/panel/Panel.js +10 -9
- package/dist/esm/components/panel/PanelGroup.js +1 -2
- package/dist/esm/components/progress/ProgressBar.js +6 -5
- package/dist/esm/components/progress/ProgressCircle.js +6 -4
- package/dist/esm/components/tabpanel/Tab.js +59 -39
- package/dist/esm/components/tabpanel/TabPanel.js +20 -16
- package/dist/esm/core/aside/Aside.js +11 -10
- package/dist/esm/core/boundary/ErrorBoundary.js +6 -7
- package/dist/esm/core/boundary/ErrorIcon.js +1 -2
- package/dist/esm/core/content/Content.js +9 -7
- package/dist/esm/core/headfoot/HeadFoot.js +2 -20
- package/dist/esm/core/page/Page.js +3 -3
- package/dist/esm/core/responsive/Responsive.js +3 -4
- package/dist/esm/core/section/Section.js +1 -2
- package/dist/esm/core/theme/ThemeProvider.js +7 -8
- package/dist/esm/core/viewport/Viewport.js +4 -2
- package/dist/esm/hooks/useNavigator.js +7 -5
- package/dist/esm/hotkeys/HotKeyLabel.js +1 -1
- package/dist/esm/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/overlays/alert/Alert.js +20 -14
- package/dist/esm/overlays/flyout/Flyout.js +52 -63
- package/dist/esm/overlays/message/Message.js +7 -4
- package/dist/esm/overlays/modal/Modal.js +12 -12
- package/dist/esm/overlays/toast/Toast.js +18 -10
- package/dist/esm/overlays/tooltip/Tooltip.js +20 -8
- package/dist/esm/types/icons.js +4 -0
- package/dist/esm/typography/Abbr.js +2 -3
- package/dist/esm/typography/{Link.js → Anchor.js} +6 -5
- package/dist/esm/typography/Mark.js +2 -3
- package/dist/esm/typography/Text.js +4 -5
- package/dist/esm/typography/Title.js +4 -4
- package/dist/esm/utils/cloneElement.js +44 -0
- package/dist/esm/utils/getColor.js +2 -16
- package/dist/types/components/actionLabel/ActionLabel.d.ts +2 -2
- package/dist/types/components/animations/Animations.d.ts +5 -5
- package/dist/types/components/avatar/Avatar.d.ts +3 -3
- package/dist/types/components/badge/Badge.d.ts +5 -1
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/types/components/button/Button.d.ts +7 -5
- package/dist/types/components/button/ButtonGroup.d.ts +2 -2
- package/dist/types/components/button/ConfirmButton.d.ts +6 -1
- package/dist/types/components/callout/Callout.d.ts +2 -2
- package/dist/types/components/card/Card.d.ts +3 -3
- package/dist/types/components/chip/Chip.d.ts +3 -3
- package/dist/types/components/collapsable/Collapsable.d.ts +5 -1
- package/dist/types/components/divider/Divider.d.ts +7 -3
- package/dist/types/components/dropdown/DropdownTool.d.ts +2 -1
- package/dist/types/components/empty/EmptyContent.d.ts +6 -2
- package/dist/types/components/icon/Icon.d.ts +3 -3
- package/dist/types/components/media/Media.d.ts +2 -2
- package/dist/types/components/menu/ContextMenu.d.ts +2 -1
- package/dist/types/components/menu/MenuItem.d.ts +1 -1
- package/dist/types/components/menu/types.d.ts +2 -2
- package/dist/types/components/navigator/Navigator.d.ts +4 -4
- package/dist/types/components/progress/ProgressBar.d.ts +2 -2
- package/dist/types/components/progress/ProgressCircle.d.ts +2 -2
- package/dist/types/components/tabpanel/Tab.d.ts +5 -5
- package/dist/types/components/tabpanel/TabPanel.d.ts +10 -1
- package/dist/types/core/content/Content.d.ts +3 -2
- package/dist/types/core/headfoot/HeadFoot.d.ts +1 -9
- package/dist/types/core/responsive/Responsive.d.ts +1 -1
- package/dist/types/core/theme/ThemeProvider.d.ts +4 -4
- package/dist/types/hooks/useOverlayService.d.ts +3 -5
- package/dist/types/index.d.ts +3 -0
- package/dist/types/overlays/alert/Alert.d.ts +2 -2
- package/dist/types/overlays/flyout/Flyout.d.ts +3 -2
- package/dist/types/overlays/message/Message.d.ts +2 -2
- package/dist/types/overlays/modal/Modal.d.ts +4 -3
- package/dist/types/overlays/toast/Toast.d.ts +2 -2
- package/dist/types/overlays/tooltip/Tooltip.d.ts +1 -1
- package/dist/types/types/icons.d.ts +4 -0
- package/dist/types/types/index.d.ts +18 -6
- package/dist/types/typography/Abbr.d.ts +6 -2
- package/dist/types/typography/Anchor.d.ts +25 -0
- package/dist/types/typography/Mark.d.ts +2 -2
- package/dist/types/typography/index.d.ts +1 -1
- package/dist/types/utils/cloneElement.d.ts +2 -0
- package/dist/types/utils/getColor.d.ts +1 -4
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +7 -9
- package/src/components/actionLabel/ActionLabel.tsx +15 -6
- package/src/components/animations/Animations.tsx +29 -23
- package/src/components/avatar/Avatar.tsx +74 -88
- package/src/components/avatar/AvatarGroup.tsx +4 -4
- package/src/components/badge/Badge.tsx +11 -7
- package/src/components/breadcrumbs/Breadcrumbs.tsx +13 -9
- package/src/components/button/Button.tsx +27 -22
- package/src/components/button/ButtonGroup.tsx +7 -7
- package/src/components/button/ConfirmButton.tsx +15 -5
- package/src/components/button/ToggleButtonGroup.tsx +5 -5
- package/src/components/callout/Callout.tsx +26 -11
- package/src/components/card/Card.tsx +10 -7
- package/src/components/card/CardCover.tsx +11 -6
- package/src/components/chip/Chip.tsx +17 -13
- package/src/components/collapsable/Collapsable.tsx +9 -4
- package/src/components/divider/Divider.tsx +15 -10
- package/src/components/dropdown/Dropdown.tsx +5 -5
- package/src/components/dropdown/DropdownTool.tsx +5 -3
- package/src/components/empty/EmptyContent.tsx +17 -2
- package/src/components/icon/Icon.tsx +55 -67
- package/src/components/media/Media.tsx +141 -106
- package/src/components/menu/ContextMenu.tsx +36 -11
- package/src/components/menu/Menu.tsx +51 -30
- package/src/components/menu/MenuItem.tsx +19 -9
- package/src/components/menu/types.ts +2 -2
- package/src/components/meter/Meter.tsx +2 -3
- package/src/components/navigator/Navigator.tsx +19 -5
- package/src/components/panel/Panel.tsx +10 -9
- package/src/components/panel/PanelGroup.tsx +1 -2
- package/src/components/progress/ProgressBar.tsx +8 -9
- package/src/components/progress/ProgressCircle.tsx +6 -9
- package/src/components/tabpanel/Tab.tsx +81 -64
- package/src/components/tabpanel/TabPanel.tsx +34 -12
- package/src/core/aside/Aside.tsx +11 -10
- package/src/core/boundary/ErrorBoundary.tsx +8 -7
- package/src/core/boundary/ErrorIcon.tsx +1 -2
- package/src/core/content/Content.tsx +17 -12
- package/src/core/headfoot/HeadFoot.tsx +2 -35
- package/src/core/page/Page.tsx +3 -3
- package/src/core/responsive/Responsive.tsx +8 -7
- package/src/core/section/Section.tsx +1 -2
- package/src/core/theme/ThemeProvider.tsx +11 -12
- package/src/core/viewport/Viewport.tsx +1 -2
- package/src/hooks/useNavigator.tsx +10 -5
- package/src/hooks/useOverlayService.tsx +12 -6
- package/src/hotkeys/HotKeyLabel.tsx +1 -1
- package/src/hotkeys/HotKeyWrapper.tsx +3 -1
- package/src/index.ts +4 -0
- package/src/overlays/alert/Alert.tsx +25 -31
- package/src/overlays/flyout/Flyout.tsx +71 -84
- package/src/overlays/message/Message.tsx +10 -7
- package/src/overlays/modal/Modal.tsx +20 -15
- package/src/overlays/toast/Toast.tsx +18 -27
- package/src/overlays/tooltip/Tooltip.tsx +30 -9
- package/src/types/icons.ts +9 -0
- package/src/types/index.ts +251 -27
- package/src/typography/Abbr.tsx +15 -9
- package/src/typography/{Link.tsx → Anchor.tsx} +8 -13
- package/src/typography/Mark.tsx +4 -9
- package/src/typography/Text.tsx +4 -12
- package/src/typography/Title.tsx +2 -6
- package/src/typography/index.ts +1 -1
- package/src/utils/cloneElement.ts +44 -0
- package/src/utils/getColor.ts +1 -17
- package/src/utils/index.ts +1 -0
- package/css/index.js +0 -250
- package/css/tailwind/colors.ts +0 -158
- package/dist/cjs/components/actionLabel/ActionLabel.module.css +0 -1
- package/dist/cjs/components/animations/Animations.module.css +0 -1
- package/dist/cjs/components/avatar/Avatar.module.css +0 -1
- package/dist/cjs/components/badge/Badge.module.css +0 -1
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.module.css +0 -1
- package/dist/cjs/components/button/Button.module.css +0 -1
- package/dist/cjs/components/card/Card.module.css +0 -1
- package/dist/cjs/components/chip/Chip.module.css +0 -1
- package/dist/cjs/components/collapsable/Collapsable.module.css +0 -1
- package/dist/cjs/components/dropdown/Dropdown.module.css +0 -1
- package/dist/cjs/components/icon/Icon.module.css +0 -1
- package/dist/cjs/components/media/Media.module.css +0 -1
- package/dist/cjs/components/menu/Menu.module.css +0 -1
- package/dist/cjs/components/meter/Meter.module.css +0 -1
- package/dist/cjs/components/panel/Panel.module.css +0 -1
- package/dist/cjs/components/progress/Progress.module.css +0 -1
- package/dist/cjs/components/tabpanel/TabPanel.module.css +0 -1
- package/dist/cjs/core/aside/Aside.module.css +0 -1
- package/dist/cjs/core/boundary/ErrorBoundary.module.css +0 -1
- package/dist/cjs/core/content/Content.module.css +0 -1
- package/dist/cjs/core/headfoot/HeadFoot.module.css +0 -1
- package/dist/cjs/core/page/Page.module.css +0 -1
- package/dist/cjs/core/responsive/Responsive.module.css +0 -1
- package/dist/cjs/core/section/Section.module.css +0 -1
- package/dist/cjs/core/theme/Theme.module.css +0 -1
- package/dist/cjs/core/viewport/Viewport.module.css +0 -1
- package/dist/cjs/overlays/alert/Alert.module.css +0 -1
- package/dist/cjs/overlays/flyout/Flyout.module.css +0 -1
- package/dist/cjs/overlays/message/Message.module.css +0 -1
- package/dist/cjs/overlays/modal/Modal.module.css +0 -1
- package/dist/cjs/overlays/toast/Toast.module.css +0 -1
- package/dist/cjs/overlays/tooltip/Tooltip.module.css +0 -1
- package/dist/cjs/typography/Typography.module.css +0 -1
- package/dist/esm/components/actionLabel/ActionLabel.module.css +0 -1
- package/dist/esm/components/animations/Animations.module.css +0 -1
- package/dist/esm/components/avatar/Avatar.module.css +0 -1
- package/dist/esm/components/badge/Badge.module.css +0 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.module.css +0 -1
- package/dist/esm/components/button/Button.module.css +0 -1
- package/dist/esm/components/card/Card.module.css +0 -1
- package/dist/esm/components/chip/Chip.module.css +0 -1
- package/dist/esm/components/collapsable/Collapsable.module.css +0 -1
- package/dist/esm/components/dropdown/Dropdown.module.css +0 -1
- package/dist/esm/components/icon/Icon.module.css +0 -1
- package/dist/esm/components/media/Media.module.css +0 -1
- package/dist/esm/components/menu/Menu.module.css +0 -1
- package/dist/esm/components/meter/Meter.module.css +0 -1
- package/dist/esm/components/panel/Panel.module.css +0 -1
- package/dist/esm/components/progress/Progress.module.css +0 -1
- package/dist/esm/components/tabpanel/TabPanel.module.css +0 -1
- package/dist/esm/core/aside/Aside.module.css +0 -1
- package/dist/esm/core/boundary/ErrorBoundary.module.css +0 -1
- package/dist/esm/core/content/Content.module.css +0 -1
- package/dist/esm/core/headfoot/HeadFoot.module.css +0 -1
- package/dist/esm/core/page/Page.module.css +0 -1
- package/dist/esm/core/responsive/Responsive.module.css +0 -1
- package/dist/esm/core/section/Section.module.css +0 -1
- package/dist/esm/core/theme/Theme.module.css +0 -1
- package/dist/esm/core/viewport/Viewport.module.css +0 -1
- package/dist/esm/overlays/alert/Alert.module.css +0 -1
- package/dist/esm/overlays/flyout/Flyout.module.css +0 -1
- package/dist/esm/overlays/message/Message.module.css +0 -1
- package/dist/esm/overlays/modal/Modal.module.css +0 -1
- package/dist/esm/overlays/toast/Toast.module.css +0 -1
- package/dist/esm/overlays/tooltip/Tooltip.module.css +0 -1
- package/dist/esm/typography/Typography.module.css +0 -1
- package/dist/types/typography/Link.d.ts +0 -25
- package/src/overlays/tooltip/Tooltip.module.css +0 -53
|
@@ -29,22 +29,23 @@ import {
|
|
|
29
29
|
type ChildrenProp,
|
|
30
30
|
type ColorType,
|
|
31
31
|
type CssProp,
|
|
32
|
+
type PaletteType,
|
|
32
33
|
type PolymorphicProps,
|
|
33
34
|
type RefProp,
|
|
34
35
|
type SizeType,
|
|
35
36
|
} from "../types";
|
|
36
|
-
import {
|
|
37
|
+
import { getColor } from "../utils";
|
|
37
38
|
import { TextSizeMap } from "./types";
|
|
38
39
|
|
|
39
|
-
export interface
|
|
40
|
+
export interface AnchorProps extends ChildrenProp, CssProp, RefProp, AriaProps {
|
|
40
41
|
/**
|
|
41
42
|
* link background (CSS color / tailwind color)
|
|
42
43
|
*/
|
|
43
|
-
bg?: ColorType | string;
|
|
44
|
+
bg?: ColorType | PaletteType | string;
|
|
44
45
|
/**
|
|
45
46
|
* link color (CSS color / tailwind color)
|
|
46
47
|
*/
|
|
47
|
-
color?: ColorType | string;
|
|
48
|
+
color?: ColorType | PaletteType | string;
|
|
48
49
|
/**
|
|
49
50
|
* link size
|
|
50
51
|
*/
|
|
@@ -60,7 +61,7 @@ export interface LinkProps extends ChildrenProp, CssProp, RefProp, AriaProps {
|
|
|
60
61
|
/**
|
|
61
62
|
* Typography link component
|
|
62
63
|
*/
|
|
63
|
-
export const
|
|
64
|
+
export const Anchor = <Tag extends React.ElementType = "a">({
|
|
64
65
|
ref,
|
|
65
66
|
as,
|
|
66
67
|
children,
|
|
@@ -70,7 +71,7 @@ export const Link = <Tag extends React.ElementType = "a">({
|
|
|
70
71
|
family,
|
|
71
72
|
size,
|
|
72
73
|
...aria
|
|
73
|
-
}:
|
|
74
|
+
}: AnchorProps & PolymorphicProps<Tag>) => {
|
|
74
75
|
/** ***************** style map *******************/
|
|
75
76
|
const styles = useMemoDebugger(
|
|
76
77
|
() => {
|
|
@@ -96,13 +97,7 @@ export const Link = <Tag extends React.ElementType = "a">({
|
|
|
96
97
|
const E = as ?? "a";
|
|
97
98
|
return (
|
|
98
99
|
<E
|
|
99
|
-
className={classNames(
|
|
100
|
-
"link",
|
|
101
|
-
className,
|
|
102
|
-
family && `font-${family}`,
|
|
103
|
-
bg && getBgClass(bg),
|
|
104
|
-
color && getColorClass(color),
|
|
105
|
-
)}
|
|
100
|
+
className={classNames("link", className, family && `font-${family}`)}
|
|
106
101
|
style={styles}
|
|
107
102
|
ref={ref as AnyObject}
|
|
108
103
|
{...aria}
|
package/src/typography/Mark.tsx
CHANGED
|
@@ -25,9 +25,8 @@ import { isEmpty, isString, tokenize } from "@react-fabric/utilities";
|
|
|
25
25
|
import classNames from "classnames";
|
|
26
26
|
import { Fragment, useCallback } from "react";
|
|
27
27
|
import { useMemoDebugger } from "../hooks/useEffectDebugger";
|
|
28
|
-
import { type ChildProp, type ColorType } from "../types";
|
|
29
|
-
import {
|
|
30
|
-
import classes from "./Typography.module.css";
|
|
28
|
+
import { type ChildProp, type ColorType, type PaletteType } from "../types";
|
|
29
|
+
import { getColor } from "../utils";
|
|
31
30
|
|
|
32
31
|
interface MarkTextProps {
|
|
33
32
|
children: string;
|
|
@@ -37,11 +36,7 @@ interface MarkTextProps {
|
|
|
37
36
|
const MarkText = ({ color, children }: MarkTextProps) => {
|
|
38
37
|
return (
|
|
39
38
|
<mark
|
|
40
|
-
className={classNames(
|
|
41
|
-
classes.mark,
|
|
42
|
-
"whitespace-nowrap",
|
|
43
|
-
color && getBgClass(color),
|
|
44
|
-
)}
|
|
39
|
+
className={classNames("fabric-mark", "whitespace-nowrap")}
|
|
45
40
|
style={
|
|
46
41
|
color ? ({ "--mark-color": getColor(color) } as AnyObject) : undefined
|
|
47
42
|
}
|
|
@@ -57,7 +52,7 @@ export interface MarkProps extends ChildProp<string> {
|
|
|
57
52
|
*
|
|
58
53
|
* [textPart, color (class name or color string)]
|
|
59
54
|
*/
|
|
60
|
-
mark: Array<[textPart: string, color?: ColorType | string]>;
|
|
55
|
+
mark: Array<[textPart: string, color?: ColorType | PaletteType | string]>;
|
|
61
56
|
/**
|
|
62
57
|
* renderer callback
|
|
63
58
|
*/
|
package/src/typography/Text.tsx
CHANGED
|
@@ -38,13 +38,7 @@ import {
|
|
|
38
38
|
type SizeType,
|
|
39
39
|
type TestProps,
|
|
40
40
|
} from "../types";
|
|
41
|
-
import {
|
|
42
|
-
calculateTextHeight,
|
|
43
|
-
getBgClass,
|
|
44
|
-
getColor,
|
|
45
|
-
getColorClass,
|
|
46
|
-
} from "../utils";
|
|
47
|
-
import classes from "./Typography.module.css";
|
|
41
|
+
import { calculateTextHeight, getColor } from "../utils";
|
|
48
42
|
import { TextSizeMap } from "./types";
|
|
49
43
|
|
|
50
44
|
export interface TextProps extends ChildrenProp, CssProp, AriaProps, TestProps {
|
|
@@ -164,11 +158,9 @@ export const Text = ({
|
|
|
164
158
|
>
|
|
165
159
|
<div
|
|
166
160
|
className={classNames(
|
|
167
|
-
|
|
168
|
-
"
|
|
161
|
+
"fabric-text",
|
|
162
|
+
"mixed-lang px-[2px] whitespace-pre-wrap",
|
|
169
163
|
family && `font-${family}`,
|
|
170
|
-
bg && getBgClass(bg),
|
|
171
|
-
color && getColorClass(color),
|
|
172
164
|
clamp && "line-clamp-1",
|
|
173
165
|
)}
|
|
174
166
|
style={styles}
|
|
@@ -178,7 +170,7 @@ export const Text = ({
|
|
|
178
170
|
</div>
|
|
179
171
|
</div>
|
|
180
172
|
{clipped && (
|
|
181
|
-
<div className={
|
|
173
|
+
<div className={"fabric-moreLink"}>
|
|
182
174
|
<span
|
|
183
175
|
role="link"
|
|
184
176
|
tabIndex={0}
|
package/src/typography/Title.tsx
CHANGED
|
@@ -35,9 +35,8 @@ import {
|
|
|
35
35
|
type CssProp,
|
|
36
36
|
type SizeType,
|
|
37
37
|
} from "../types";
|
|
38
|
-
import {
|
|
38
|
+
import { getColor } from "../utils";
|
|
39
39
|
import { TitleSizeMap } from "./types";
|
|
40
|
-
import classes from "./Typography.module.css";
|
|
41
40
|
|
|
42
41
|
export interface TitleProps extends ChildrenProp, CssProp, AriaProps {
|
|
43
42
|
as?: ElementType<
|
|
@@ -109,13 +108,10 @@ export const Title = ({
|
|
|
109
108
|
return (
|
|
110
109
|
<E
|
|
111
110
|
className={classNames(
|
|
112
|
-
|
|
113
|
-
"px-[2px] py-1 truncate whitespace-pre-wrap",
|
|
111
|
+
"fabric-title",
|
|
114
112
|
className,
|
|
115
113
|
family && `font-${family}`,
|
|
116
114
|
!as && "text-lg",
|
|
117
|
-
bg && getBgClass(bg),
|
|
118
|
-
color && getColorClass(color),
|
|
119
115
|
)}
|
|
120
116
|
style={styles}
|
|
121
117
|
{...aria}
|
package/src/typography/index.ts
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
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 { type ReactNode, Children, isValidElement } from "react";
|
|
25
|
+
import { Fragment } from "react/jsx-runtime";
|
|
26
|
+
|
|
27
|
+
export const cloneChildren = (
|
|
28
|
+
children: ReactNode,
|
|
29
|
+
callback: (child: ReactNode, index: number) => ReactNode,
|
|
30
|
+
): ReactNode => {
|
|
31
|
+
return Children.map(children, (c: ReactNode) => {
|
|
32
|
+
if (isValidElement(c)) {
|
|
33
|
+
if (c.type === Fragment) {
|
|
34
|
+
// just compare to `Fragment`
|
|
35
|
+
return cloneChildren(c.props?.children, callback);
|
|
36
|
+
}
|
|
37
|
+
return c;
|
|
38
|
+
}
|
|
39
|
+
return c;
|
|
40
|
+
})
|
|
41
|
+
?.flat()
|
|
42
|
+
.filter(Boolean)
|
|
43
|
+
.map(callback);
|
|
44
|
+
};
|
package/src/utils/getColor.ts
CHANGED
|
@@ -29,21 +29,5 @@ export const getColor = (color: string) => {
|
|
|
29
29
|
if (color && isColor(color)) {
|
|
30
30
|
return color;
|
|
31
31
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const getBgClass = (bg: string) => {
|
|
35
|
-
if (bg && !isColor(bg)) {
|
|
36
|
-
return `bg-${bg}`;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const getColorClass = (color: string) => {
|
|
41
|
-
if (color && !isColor(color)) {
|
|
42
|
-
return `text-${color}`;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
export const getBorderClass = (color: string) => {
|
|
46
|
-
if (color && !isColor(color)) {
|
|
47
|
-
return `border-${color}`;
|
|
48
|
-
}
|
|
32
|
+
return `var(--color-${color})`;
|
|
49
33
|
};
|
package/src/utils/index.ts
CHANGED
package/css/index.js
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
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
|
-
import {
|
|
26
|
-
backgroundColor,
|
|
27
|
-
borderColor,
|
|
28
|
-
colors,
|
|
29
|
-
textColor,
|
|
30
|
-
} from "./tailwind/colors";
|
|
31
|
-
const plugin = require("tailwindcss/plugin");
|
|
32
|
-
|
|
33
|
-
module.exports = plugin(
|
|
34
|
-
({ addUtilities, matchUtilities, addBase, theme }) => {
|
|
35
|
-
matchUtilities({
|
|
36
|
-
area: (value) => ({
|
|
37
|
-
gridArea: value,
|
|
38
|
-
}),
|
|
39
|
-
});
|
|
40
|
-
addUtilities({
|
|
41
|
-
".z-1": { "z-index": 1 },
|
|
42
|
-
".z-2": { "z-index": 2 },
|
|
43
|
-
".z-3": { "z-index": 3 },
|
|
44
|
-
".z-4": { "z-index": 4 },
|
|
45
|
-
".z-5": { "z-index": 5 },
|
|
46
|
-
".area-content": { "grid-area": "content" },
|
|
47
|
-
".area-head": { "grid-area": "head" },
|
|
48
|
-
".area-foot": { "grid-area": "foot" },
|
|
49
|
-
".area-side-s": { "grid-area": "side-s" },
|
|
50
|
-
".area-side-e": { "grid-area": "side-e" },
|
|
51
|
-
".area-body": { "grid-area": "body" },
|
|
52
|
-
".overflow-wrap": {
|
|
53
|
-
"overflow-wrap": "anywhere",
|
|
54
|
-
"word-break": "normal",
|
|
55
|
-
"text-wrap": "wrap",
|
|
56
|
-
},
|
|
57
|
-
".fixed-numbers": {
|
|
58
|
-
"font-variant-numeric": "tabular-nums",
|
|
59
|
-
},
|
|
60
|
-
".mixed-lang": {},
|
|
61
|
-
".bg-alternate": {},
|
|
62
|
-
".scroll-thin": {},
|
|
63
|
-
".scroll-hide": {},
|
|
64
|
-
...Object.fromEntries(
|
|
65
|
-
Object.entries(theme("spacing")).map(([key, size]) => [
|
|
66
|
-
`.gap-${key}`,
|
|
67
|
-
{ gap: size, "--gutter": size },
|
|
68
|
-
]),
|
|
69
|
-
),
|
|
70
|
-
".span-1": { flex: "0 1 calc((1 / 12) * 100% - var(--gutter, 0px))" },
|
|
71
|
-
".span-2": { flex: "0 1 calc((2 / 12) * 100% - var(--gutter, 0px))" },
|
|
72
|
-
".span-3": { flex: "0 1 calc((3 / 12) * 100% - var(--gutter, 0px))" },
|
|
73
|
-
".span-4": { flex: "0 1 calc((4 / 12) * 100% - var(--gutter, 0px))" },
|
|
74
|
-
".span-5": { flex: "0 1 calc((5 / 12) * 100% - var(--gutter, 0px))" },
|
|
75
|
-
".span-6": { flex: "0 1 calc((6 / 12) * 100% - var(--gutter, 0px))" },
|
|
76
|
-
".span-7": { flex: "0 1 calc((7 / 12) * 100% - var(--gutter, 0px))" },
|
|
77
|
-
".span-8": { flex: "0 1 calc((8 / 12) * 100% - var(--gutter, 0px))" },
|
|
78
|
-
".span-9": { flex: "0 1 calc((9 / 12) * 100% - var(--gutter, 0px))" },
|
|
79
|
-
".span-10": { flex: "0 1 calc((10 / 12) * 100% - var(--gutter, 0px))" },
|
|
80
|
-
".span-11": { flex: "0 1 calc((11 / 12) * 100% - var(--gutter, 0px))" },
|
|
81
|
-
".span-12": { flex: "0 1 calc((12 / 12) * 100% - var(--gutter, 0px))" },
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
darkMode: ["selector", '[data-color-scheme="dark"]'],
|
|
86
|
-
safelist: [
|
|
87
|
-
"font-san",
|
|
88
|
-
"font-serif",
|
|
89
|
-
"font-mono",
|
|
90
|
-
"object-fit",
|
|
91
|
-
"object-cover",
|
|
92
|
-
"object-contain",
|
|
93
|
-
"self-start",
|
|
94
|
-
"self-center",
|
|
95
|
-
"self-end",
|
|
96
|
-
"self-stretch",
|
|
97
|
-
"items-start",
|
|
98
|
-
"items-center",
|
|
99
|
-
"items-end",
|
|
100
|
-
"items-stretch",
|
|
101
|
-
"justify-start",
|
|
102
|
-
"justify-center",
|
|
103
|
-
"justify-end",
|
|
104
|
-
"justify-between",
|
|
105
|
-
"animate-spin",
|
|
106
|
-
"animate-pulse",
|
|
107
|
-
"animate-bounce",
|
|
108
|
-
"animate-progress",
|
|
109
|
-
{
|
|
110
|
-
pattern:
|
|
111
|
-
/bg-(black|white|base|dimmed|muted|dark|light|invert|silver|steel|olive|sand|info|danger|success|warning|scarlet|pumpkin|marigold|avacado|jade|denim|iris|lilac|coral|wood|primary|accent|tint)(-\d*)?/,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
pattern:
|
|
115
|
-
/text-(black|white|base|dimmed|muted|dark|light|invert|silver|steel|olive|sand|info|danger|success|warning|scarlet|pumpkin|marigold|avacado|jade|denim|iris|lilac|coral|wood|primary|accent|tint)(-\d*)?/,
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
pattern:
|
|
119
|
-
/ring-(info|danger|success|warning|primary|accent|tint)(-\d*)?/,
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
pattern:
|
|
123
|
-
/border-(black|white|base|dimmed|muted|dark|light|invert|silver|steel|olive|sand|info|danger|success|warning|scarlet|pumpkin|marigold|avacado|jade|denim|iris|lilac|coral|wood|primary|accent|tint)(-\d*)?/,
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
theme: {
|
|
127
|
-
fontFamily: {
|
|
128
|
-
sans: [
|
|
129
|
-
"Avenir Next",
|
|
130
|
-
"Avenir",
|
|
131
|
-
"Noto Sans",
|
|
132
|
-
"Roboto",
|
|
133
|
-
"Helvetica Neue",
|
|
134
|
-
"Segoe UI",
|
|
135
|
-
"Arial",
|
|
136
|
-
"sans-serif",
|
|
137
|
-
"BlinkMacSystemFont",
|
|
138
|
-
"Apple Color Emoji",
|
|
139
|
-
"Segoe UI Emoji",
|
|
140
|
-
"Segoe UI Symbol",
|
|
141
|
-
"Noto Color Emoji",
|
|
142
|
-
],
|
|
143
|
-
serif: [
|
|
144
|
-
"Noto Serif",
|
|
145
|
-
"Georgia",
|
|
146
|
-
"Cambria",
|
|
147
|
-
"Times New Roman",
|
|
148
|
-
"Times",
|
|
149
|
-
"serif",
|
|
150
|
-
],
|
|
151
|
-
mono: [
|
|
152
|
-
"Noto Sans Mono",
|
|
153
|
-
"Menlo",
|
|
154
|
-
"Monaco",
|
|
155
|
-
"Consolas",
|
|
156
|
-
"Liberation Mono",
|
|
157
|
-
"Courier New",
|
|
158
|
-
"monospace",
|
|
159
|
-
],
|
|
160
|
-
},
|
|
161
|
-
colors,
|
|
162
|
-
gap: {},
|
|
163
|
-
fontSize: {
|
|
164
|
-
xs: ["0.75rem", { lineHeight: "1rem" }],
|
|
165
|
-
sm: ["0.875rem", { lineHeight: "1.25rem" }],
|
|
166
|
-
reset: ["1rem", { lineHeight: "1.5rem" }],
|
|
167
|
-
md: ["1.125rem", { lineHeight: "1.5rem" }],
|
|
168
|
-
lg: ["1.25rem", { lineHeight: "1.75rem" }],
|
|
169
|
-
xl: ["1.5rem", { lineHeight: "2rem" }],
|
|
170
|
-
"2xl": ["1.75rem", { lineHeight: "2.25rem" }],
|
|
171
|
-
"3xl": ["1.875rem", { lineHeight: "2.25rem" }],
|
|
172
|
-
"4xl": ["2.25rem", { lineHeight: "2.5rem" }],
|
|
173
|
-
"5xl": ["3rem", { lineHeight: "1" }],
|
|
174
|
-
"6xl": ["3.75rem", { lineHeight: "1" }],
|
|
175
|
-
"7xl": ["4.5rem", { lineHeight: "1" }],
|
|
176
|
-
"8xl": ["6rem", { lineHeight: "1" }],
|
|
177
|
-
"9xl": ["8rem", { lineHeight: "1" }],
|
|
178
|
-
},
|
|
179
|
-
extend: {
|
|
180
|
-
backgroundColor,
|
|
181
|
-
borderColor,
|
|
182
|
-
stroke: borderColor,
|
|
183
|
-
outlineColor: borderColor,
|
|
184
|
-
textColor,
|
|
185
|
-
fill: backgroundColor,
|
|
186
|
-
screens: {
|
|
187
|
-
xs: "320px",
|
|
188
|
-
},
|
|
189
|
-
keyframes: {
|
|
190
|
-
cardpulse: {
|
|
191
|
-
"50%": { opacity: 0.5 },
|
|
192
|
-
},
|
|
193
|
-
bgprogress: {
|
|
194
|
-
"0%": {
|
|
195
|
-
"background-position-x": 0,
|
|
196
|
-
},
|
|
197
|
-
"100%": {
|
|
198
|
-
"background-position-x": "1rem",
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
animation: {
|
|
203
|
-
pulse: "cardpulse 2s cubic-bezier(.4,0,.6,1) infinite",
|
|
204
|
-
progress: "bgprogress 750ms linear infinite",
|
|
205
|
-
},
|
|
206
|
-
aspectRatio: {
|
|
207
|
-
screen: "4 / 3",
|
|
208
|
-
portrait: "3 / 4",
|
|
209
|
-
},
|
|
210
|
-
flex: {
|
|
211
|
-
full: "1 1 100%",
|
|
212
|
-
content: "0 0 auto",
|
|
213
|
-
},
|
|
214
|
-
maxWidth: {
|
|
215
|
-
screen: "100vw",
|
|
216
|
-
},
|
|
217
|
-
minWidth: {
|
|
218
|
-
screen: "100vw",
|
|
219
|
-
},
|
|
220
|
-
borderRadius: {
|
|
221
|
-
capped: "var(--rounding-cap)",
|
|
222
|
-
DEFAULT: "var(--rounding)",
|
|
223
|
-
},
|
|
224
|
-
boxShadow: {
|
|
225
|
-
1: "0 0 0 1px var(--tw-shadow-color)",
|
|
226
|
-
xs: "0 1px 1px 0 var(--tw-shadow-color)",
|
|
227
|
-
sm: "0 1px 2px 0 var(--tw-shadow-color)",
|
|
228
|
-
DEFAULT:
|
|
229
|
-
"0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color)",
|
|
230
|
-
md: "0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color)",
|
|
231
|
-
lg: "0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color)",
|
|
232
|
-
xl: "0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color)",
|
|
233
|
-
"2xl": "0 25px 50px -12px var(--tw-shadow-color)",
|
|
234
|
-
inset: "inset 0 0 2px var(--tw-shadow-color)",
|
|
235
|
-
inner: "inset 0 2px 4px 0 var(--tw-shadow-color)",
|
|
236
|
-
paper: "0 1px 3px 0 var(--tw-shadow-color)",
|
|
237
|
-
none: "none",
|
|
238
|
-
},
|
|
239
|
-
boxShadowColor: {
|
|
240
|
-
...borderColor,
|
|
241
|
-
DEFAULT: "var(--fabric-shadow)",
|
|
242
|
-
base: "var(--fabric-shadow)",
|
|
243
|
-
},
|
|
244
|
-
ringOffsetColor: {
|
|
245
|
-
base: "var(--fabric-bg)",
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
);
|
package/css/tailwind/colors.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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)}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer comp{@keyframes l2{0%,25%{background-position:0 50%,0 calc(50% - 2px),0 calc(50% + 2px),50% 50%,50% calc(50% - 2px),50% calc(50% + 2px),100% 50%,100% calc(50% - 2px),100% calc(50% + 2px);background-size:8px 0,8px 4px,8px 4px,8px 0,8px 4px,8px 4px,8px 0,8px 4px,8px 4px}50%{background-position:0 50%,0 -2px,0 calc(100% + 2px),50% 50%,50% calc(50% - 2px),50% calc(50% + 2px),100% 50%,100% calc(50% - 2px),100% calc(50% + 2px);background-size:8px 100%,8px 4px,8px 4px,8px 0,8px 4px,8px 4px,8px 0,8px 4px,8px 4px}75%{background-position:0 50%,0 -2px,0 calc(100% + 2px),50% 50%,50% -2px,50% calc(100% + 2px),100% 50%,100% calc(50% - 2px),100% calc(50% + 2px);background-size:8px 100%,8px 4px,8px 4px,8px 100%,8px 4px,8px 4px,8px 0,8px 4px,8px 4px}95%,to{background-position:0 50%,0 -2px,0 calc(100% + 2px),50% 50%,50% -2px,50% calc(100% + 2px),100% 50%,100% -2px,100% calc(100% + 2px);background-size:8px 100%,8px 4px,8px 4px,8px 100%,8px 4px,8px 4px,8px 100%,8px 4px,8px 4px}}.bars{--c:linear-gradient(currentcolor 0 0);--r1:radial-gradient(farthest-side at bottom,currentcolor 93%,#0000);--r2:radial-gradient(farthest-side at top,currentcolor 93%,#0000);animation:l2 1s infinite alternate;aspect-ratio:1;background:var(--c),var(--r1),var(--r2),var(--c),var(--r1),var(--r2),var(--c),var(--r1),var(--r2);background-repeat:no-repeat}@keyframes l4{to{transform:rotate(1turn)}}.spinner{--b:8px;animation:l4 2s steps(10) infinite;aspect-ratio:1;background:conic-gradient(#0000 10%,currentcolor) content-box;border-radius:50%;mask:repeating-conic-gradient(#0000 0deg,#000 1deg 20deg,#0000 21deg 36deg),radial-gradient(farthest-side,#0000 calc(100% - var(--b) - 1px),#000 calc(100% - var(--b)));mask-composite:destination-in;mask-composite:intersect}@keyframes loader{0%{transform:translateX(calc(-100%*var(--multiplier)))}to{transform:translateX(calc(100%*var(--multiplier)))}}.loader{--multiplier:1;&>div{height:calc(.125rem + 2px);&:after{animation:loader 1s cubic-bezier(.65,0,.45,1) infinite}}:global([dir=rtl]) &{--multiplier:-1}}@keyframes check-stroke{to{stroke-dashoffset:0}}@keyframes check-scale{0%,to{transform:none}50%{transform:scale3d(1.1,1.1,1)}}@keyframes check-fill{to{box-shadow:inset 0 0 0 1em currentcolor}}.checkAnimation{box-shadow:inset 0 0 0 currentcolor;color:theme(colors.primary.DEFAULT);height:1.5em;width:1.5em;fill:transparent;stroke-miterlimit:10;stroke-width:4px;animation:check-fill .4s ease-in-out .4s forwards,check-scale .3s ease-in-out .9s both;animation-delay:.75s;& .circlePart{fill:transparent;stroke:currentcolor;stroke-dasharray:166;stroke-dashoffset:166;stroke-miterlimit:10;stroke-width:8px;animation:check-stroke .6s cubic-bezier(.65,0,.45,1) forwards;animation-delay:.25s}& .iconPart{transform-origin:50% 50%;stroke:currentcolor;stroke-dasharray:48;stroke-dashoffset:48;animation:check-stroke .3s cubic-bezier(.65,0,.45,1) .8s forwards;animation-delay:.75s}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer comp{.avatar{border-radius:var(--rounding);box-shadow:0 0 1px theme(borderColor.base);height:1em;vertical-align:-.125em;width:1em;&>i,&>img,&>svg{background-color:theme(backgroundColor.dimmed);border-radius:inherit;display:block;height:1em;line-height:1;object-fit:cover;overflow:hidden;pointer-events:none;width:1em;fill:currentcolor}&>i:before{line-height:1}&>.imagePlaceholder{z-index:-1}}.avatarGroup{&>.avatar{box-shadow:0 0 0 1px theme(borderColor.muted),0 0 0 .125em var(--fabric-bg);&:not(:first-child){margin-inline-start:-.125em}}& .avatarGroup--extra{border-radius:inherit;font-size:inherit;height:1em;width:1em}}}@layer util{.avatarGroup{&>.avatar{border-radius:inherit;font-size:inherit}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer comp{@keyframes pinger{0%{opacity:.7;transform:scale(1)}to{opacity:0;transform:scale(3)}}.badge{--tw-bg-opacity:1;background-color:theme(colors.tint.200/var(--tw-bg-opacity));box-sizing:content-box;color:theme(textColor.base);outline:.5px solid theme(backgroundColor.base);&>span{font-size:.625em;font-weight:500;line-height:1;vertical-align:.125em}&[data-ping=true]{--translate:50%;&:before{animation:pinger 1s linear infinite;background-color:inherit;border-radius:999px;content:"";inset:0;position:absolute;z-index:-1}}&:not([data-ping=true]){--translate:0.75rem;min-width:1em}&[data-placement=top]{left:50%;top:0;transform:translate(-50%,-50%)}&[data-placement=top-start]{inset-inline-start:0;top:0;:global([dir=ltr]) &{transform:translate(calc(var(--translate)*-1),-50%)}:global([dir=rtl]) &{transform:translate(calc(var(--translate)*1),-50%)}}&[data-placement=top-end]{inset-inline-end:0;top:0;:global([dir=ltr]) &{transform:translate(calc(var(--translate)*1),-50%)}:global([dir=rtl]) &{transform:translate(calc(var(--translate)*-1),-50%)}}&[data-placement=bottom]{bottom:0;left:50%;transform:translate(-50%,50%)}&[data-placement=bottom-start]{bottom:0;inset-inline-start:0;:global([dir=ltr]) &{transform:translate(calc(var(--translate)*-1),-50%)}:global([dir=rtl]) &{transform:translate(calc(var(--translate)*1),-50%)}}&[data-placement=bottom-end]{bottom:0;inset-inline-end:0;:global([dir=ltr]) &{transform:translate(calc(var(--translate)*1),-50%)}:global([dir=rtl]) &{transform:translate(calc(var(--translate)*-1),-50%)}}&[data-placement=start]{inset-inline-start:0;top:50%;:global([dir=ltr]) &{transform:translate(-50%,-50%)}:global([dir=rtl]) &{transform:translate(50%,-50%)}}&[data-placement=end]{inset-inline-end:0;top:50%;:global([dir=ltr]) &{transform:translate(50%,-50%)}:global([dir=rtl]) &{transform:translate(-50%,-50%)}}}}
|