@react-fabric/core 1.0.0-beta.36 → 1.0.0-beta.37
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} +2 -2
- 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} +63 -80
- package/{src/components/card/Card.module.css → css/components/_card.css} +32 -28
- package/{src/components/chip/Chip.module.css → css/components/_chip.css} +11 -10
- package/{src/components/collapsable/Collapsable.module.css → css/components/_collapsable.css} +3 -3
- package/{src/components/divider/Divider.module.css → css/components/_divider.css} +3 -3
- 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 -4
- 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} +43 -43
- package/{src/overlays/toast/Toast.module.css → css/components/_toast.css} +2 -2
- package/css/components/_tooltip.css +29 -0
- package/css/components/index.css +47 -0
- package/{src/core/aside/Aside.module.css → css/core/_aside.css} +42 -42
- package/{src/core/content/Content.module.css → css/core/_content.css} +9 -5
- 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 -4
- package/{src/core/page/Page.module.css → css/core/_page.css} +12 -8
- package/{src/core/responsive/Responsive.module.css → css/core/_responsive.css} +10 -10
- package/{src/core/section/Section.module.css → css/core/_section.css} +2 -2
- package/{src/core/theme/Theme.module.css → css/core/_theme.css} +3 -3
- package/{src/typography/Typography.module.css → css/core/_typography.css} +12 -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 +314 -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 +512 -0
- package/css/theme/index.css +44 -0
- package/dist/cjs/components/actionLabel/ActionLabel.js +2 -3
- package/dist/cjs/components/animations/Animations.js +14 -10
- package/dist/cjs/components/avatar/Avatar.js +2 -3
- package/dist/cjs/components/avatar/AvatarGroup.js +2 -3
- package/dist/cjs/components/badge/Badge.js +2 -3
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +5 -6
- package/dist/cjs/components/button/Button.js +13 -10
- package/dist/cjs/components/button/ButtonGroup.js +1 -2
- package/dist/cjs/components/button/ToggleButtonGroup.js +1 -2
- package/dist/cjs/components/callout/Callout.js +11 -5
- package/dist/cjs/components/card/Card.js +3 -4
- package/dist/cjs/components/card/CardCover.js +9 -4
- package/dist/cjs/components/chip/Chip.js +4 -5
- package/dist/cjs/components/collapsable/Collapsable.js +3 -4
- package/dist/cjs/components/divider/Divider.js +9 -7
- package/dist/cjs/components/dropdown/Dropdown.js +2 -3
- package/dist/cjs/components/dropdown/DropdownTool.js +1 -1
- package/dist/cjs/components/icon/Icon.js +1 -2
- package/dist/cjs/components/media/Media.js +15 -11
- package/dist/cjs/components/menu/Menu.js +1 -1
- package/dist/cjs/components/menu/MenuItem.js +2 -3
- package/dist/cjs/components/meter/Meter.js +2 -3
- package/dist/cjs/components/navigator/Navigator.js +1 -1
- package/dist/cjs/components/panel/Panel.js +7 -8
- package/dist/cjs/components/panel/PanelGroup.js +1 -2
- package/dist/cjs/components/progress/ProgressBar.js +4 -4
- package/dist/cjs/components/progress/ProgressCircle.js +4 -3
- package/dist/cjs/components/tabpanel/Tab.js +1 -2
- package/dist/cjs/components/tabpanel/TabPanel.js +3 -4
- package/dist/cjs/core/aside/Aside.js +9 -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 +1 -2
- package/dist/cjs/core/headfoot/HeadFoot.js +2 -21
- package/dist/cjs/core/page/Page.js +2 -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/overlays/alert/Alert.js +14 -8
- package/dist/cjs/overlays/flyout/Flyout.js +4 -5
- package/dist/cjs/overlays/message/Message.js +5 -2
- package/dist/cjs/overlays/modal/Modal.js +4 -5
- package/dist/cjs/overlays/toast/Toast.js +16 -8
- package/dist/cjs/overlays/tooltip/Tooltip.js +19 -7
- package/dist/cjs/typography/Abbr.js +1 -2
- package/dist/cjs/typography/Anchor.js +1 -1
- package/dist/cjs/typography/Mark.js +1 -2
- package/dist/cjs/typography/Text.js +2 -3
- package/dist/cjs/typography/Title.js +1 -2
- package/dist/cjs/utils/getColor.js +1 -18
- package/dist/esm/components/actionLabel/ActionLabel.js +2 -3
- package/dist/esm/components/animations/Animations.js +15 -11
- package/dist/esm/components/avatar/Avatar.js +3 -4
- package/dist/esm/components/avatar/AvatarGroup.js +2 -3
- package/dist/esm/components/badge/Badge.js +2 -3
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +5 -6
- package/dist/esm/components/button/Button.js +13 -10
- package/dist/esm/components/button/ButtonGroup.js +1 -2
- package/dist/esm/components/button/ToggleButtonGroup.js +1 -2
- package/dist/esm/components/callout/Callout.js +11 -5
- package/dist/esm/components/card/Card.js +3 -4
- package/dist/esm/components/card/CardCover.js +9 -4
- package/dist/esm/components/chip/Chip.js +5 -6
- package/dist/esm/components/collapsable/Collapsable.js +3 -4
- package/dist/esm/components/divider/Divider.js +10 -8
- package/dist/esm/components/dropdown/Dropdown.js +2 -3
- package/dist/esm/components/dropdown/DropdownTool.js +1 -1
- package/dist/esm/components/icon/Icon.js +2 -3
- package/dist/esm/components/media/Media.js +15 -11
- package/dist/esm/components/menu/Menu.js +1 -1
- package/dist/esm/components/menu/MenuItem.js +2 -3
- package/dist/esm/components/meter/Meter.js +2 -3
- package/dist/esm/components/navigator/Navigator.js +1 -1
- package/dist/esm/components/panel/Panel.js +7 -8
- package/dist/esm/components/panel/PanelGroup.js +1 -2
- package/dist/esm/components/progress/ProgressBar.js +5 -5
- package/dist/esm/components/progress/ProgressCircle.js +5 -4
- package/dist/esm/components/tabpanel/Tab.js +1 -2
- package/dist/esm/components/tabpanel/TabPanel.js +3 -4
- package/dist/esm/core/aside/Aside.js +9 -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 +1 -2
- package/dist/esm/core/headfoot/HeadFoot.js +2 -21
- package/dist/esm/core/page/Page.js +2 -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/overlays/alert/Alert.js +15 -9
- package/dist/esm/overlays/flyout/Flyout.js +4 -5
- package/dist/esm/overlays/message/Message.js +6 -3
- package/dist/esm/overlays/modal/Modal.js +4 -5
- package/dist/esm/overlays/toast/Toast.js +17 -9
- package/dist/esm/overlays/tooltip/Tooltip.js +19 -7
- package/dist/esm/typography/Abbr.js +2 -3
- package/dist/esm/typography/Anchor.js +2 -2
- package/dist/esm/typography/Mark.js +2 -3
- package/dist/esm/typography/Text.js +3 -4
- package/dist/esm/typography/Title.js +2 -3
- package/dist/esm/utils/getColor.js +2 -16
- package/dist/types/components/animations/Animations.d.ts +4 -4
- package/dist/types/components/avatar/Avatar.d.ts +3 -3
- package/dist/types/components/button/Button.d.ts +2 -2
- package/dist/types/components/button/ButtonGroup.d.ts +2 -2
- package/dist/types/components/callout/Callout.d.ts +2 -2
- package/dist/types/components/chip/Chip.d.ts +2 -2
- package/dist/types/components/divider/Divider.d.ts +7 -3
- package/dist/types/components/icon/Icon.d.ts +3 -3
- package/dist/types/components/menu/types.d.ts +2 -2
- package/dist/types/components/navigator/Navigator.d.ts +2 -2
- 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 +2 -2
- package/dist/types/core/headfoot/HeadFoot.d.ts +1 -9
- package/dist/types/core/theme/ThemeProvider.d.ts +3 -3
- package/dist/types/overlays/alert/Alert.d.ts +2 -2
- package/dist/types/overlays/message/Message.d.ts +2 -2
- package/dist/types/overlays/toast/Toast.d.ts +2 -2
- package/dist/types/overlays/tooltip/Tooltip.d.ts +1 -1
- package/dist/types/types/index.d.ts +10 -5
- package/dist/types/typography/Abbr.d.ts +6 -2
- package/dist/types/typography/Anchor.d.ts +3 -3
- package/dist/types/typography/Mark.d.ts +2 -2
- package/dist/types/utils/getColor.d.ts +1 -4
- package/package.json +16 -7
- package/src/components/actionLabel/ActionLabel.tsx +2 -3
- package/src/components/animations/Animations.tsx +19 -19
- package/src/components/avatar/Avatar.tsx +6 -8
- package/src/components/avatar/AvatarGroup.tsx +3 -4
- package/src/components/badge/Badge.tsx +3 -4
- package/src/components/breadcrumbs/Breadcrumbs.tsx +5 -6
- package/src/components/button/Button.tsx +15 -13
- package/src/components/button/ButtonGroup.tsx +4 -5
- package/src/components/button/ToggleButtonGroup.tsx +2 -3
- package/src/components/callout/Callout.tsx +14 -8
- package/src/components/card/Card.tsx +6 -7
- package/src/components/card/CardCover.tsx +11 -6
- package/src/components/chip/Chip.tsx +9 -10
- package/src/components/collapsable/Collapsable.tsx +3 -4
- package/src/components/divider/Divider.tsx +15 -11
- package/src/components/dropdown/Dropdown.tsx +2 -3
- package/src/components/dropdown/DropdownTool.tsx +1 -1
- package/src/components/icon/Icon.tsx +7 -9
- package/src/components/media/Media.tsx +19 -14
- package/src/components/menu/Menu.tsx +1 -1
- package/src/components/menu/MenuItem.tsx +5 -6
- package/src/components/menu/types.ts +2 -2
- package/src/components/meter/Meter.tsx +2 -3
- package/src/components/navigator/Navigator.tsx +4 -3
- package/src/components/panel/Panel.tsx +7 -8
- 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 +3 -4
- package/src/components/tabpanel/TabPanel.tsx +3 -4
- package/src/core/aside/Aside.tsx +9 -10
- package/src/core/boundary/ErrorBoundary.tsx +8 -7
- package/src/core/boundary/ErrorIcon.tsx +1 -2
- package/src/core/content/Content.tsx +1 -2
- package/src/core/headfoot/HeadFoot.tsx +1 -34
- package/src/core/page/Page.tsx +2 -3
- package/src/core/responsive/Responsive.tsx +4 -5
- package/src/core/section/Section.tsx +1 -2
- package/src/core/theme/ThemeProvider.tsx +10 -11
- package/src/core/viewport/Viewport.tsx +1 -2
- package/src/overlays/alert/Alert.tsx +19 -27
- package/src/overlays/flyout/Flyout.tsx +4 -5
- package/src/overlays/message/Message.tsx +10 -7
- package/src/overlays/modal/Modal.tsx +4 -5
- package/src/overlays/toast/Toast.tsx +18 -27
- package/src/overlays/tooltip/Tooltip.tsx +28 -7
- package/src/types/index.ts +230 -18
- package/src/typography/Abbr.tsx +15 -9
- package/src/typography/Anchor.tsx +5 -10
- package/src/typography/Mark.tsx +4 -9
- package/src/typography/Text.tsx +3 -11
- package/src/typography/Title.tsx +2 -5
- package/src/utils/getColor.ts +1 -17
- 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/divider/Divider.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/divider/Divider.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/src/overlays/tooltip/Tooltip.module.css +0 -53
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type
|
|
2
|
+
import { type ColorState, type Elements, type IconProps } from "../../types";
|
|
3
3
|
export interface AlertProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
4
4
|
/**
|
|
5
5
|
* toast type
|
|
@@ -16,7 +16,7 @@ export interface AlertProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
|
16
16
|
/**
|
|
17
17
|
* theme color
|
|
18
18
|
*/
|
|
19
|
-
color?:
|
|
19
|
+
color?: ColorState;
|
|
20
20
|
/**
|
|
21
21
|
* extra action button
|
|
22
22
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type
|
|
2
|
+
import { type ColorState, type Elements, type IconProps } from "../../types";
|
|
3
3
|
export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
4
4
|
/**
|
|
5
5
|
* message title
|
|
@@ -12,7 +12,7 @@ export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
|
12
12
|
/**
|
|
13
13
|
* theme color
|
|
14
14
|
*/
|
|
15
|
-
color?:
|
|
15
|
+
color?: ColorState;
|
|
16
16
|
/**
|
|
17
17
|
* extra action button
|
|
18
18
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type
|
|
2
|
+
import { type ColorState, type Elements, type IconProps } from "../../types";
|
|
3
3
|
export interface ToastProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
4
4
|
/**
|
|
5
5
|
* toast type
|
|
@@ -16,7 +16,7 @@ export interface ToastProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
|
16
16
|
/**
|
|
17
17
|
* theme color
|
|
18
18
|
*/
|
|
19
|
-
color?:
|
|
19
|
+
color?: ColorState;
|
|
20
20
|
/**
|
|
21
21
|
* extra action button
|
|
22
22
|
*/
|
|
@@ -15,4 +15,4 @@ export interface TooltipProps extends TooltipType, RefProp {
|
|
|
15
15
|
export declare const getTooltipProps: (tooltip?: string | TooltipType, innerRef?: AnyObject) => (TooltipType & {
|
|
16
16
|
ref: AnyObject;
|
|
17
17
|
}) | undefined;
|
|
18
|
-
export declare const Tooltip: ({ ref, children, color, content, open, copyContent, disabled, placement: _placement, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const Tooltip: ({ ref, children, color, textColor, content, open, copyContent, disabled, placement: _placement, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,8 +5,9 @@ export type ModalProps<P = unknown> = P & {
|
|
|
5
5
|
};
|
|
6
6
|
export type SizeType = "xs" | "sm" | "md" | "lg" | "xl";
|
|
7
7
|
export type SizeTypeWithZero = "xs" | "sm" | "md" | "lg" | "xl" | 0;
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
8
|
+
export type ColorState = "primary" | "accent" | "info" | "danger" | "success" | "warning";
|
|
9
|
+
export type ColorType = "primary-50" | "accent-50" | "info-50" | "danger-50" | "success-50" | "warning-50" | "primary-100" | "accent-100" | "info-100" | "danger-100" | "success-100" | "warning-100" | "primary-200" | "accent-200" | "info-200" | "danger-200" | "success-200" | "warning-200" | "primary-300" | "accent-300" | "info-300" | "danger-300" | "success-300" | "warning-300" | "primary-400" | "accent-400" | "info-400" | "danger-400" | "success-400" | "warning-400" | "primary-500" | "accent-500" | "info-500" | "danger-500" | "success-500" | "warning-500" | "primary-600" | "accent-600" | "info-600" | "danger-600" | "success-600" | "warning-600" | "primary-700" | "accent-700" | "info-700" | "danger-700" | "success-700" | "warning-700" | "primary-800" | "accent-800" | "info-800" | "danger-800" | "success-800" | "warning-800" | "primary-900" | "accent-900" | "info-900" | "danger-900" | "success-900" | "warning-900" | "primary-950" | "accent-950" | "info-950" | "danger-950" | "success-950" | "warning-950";
|
|
10
|
+
export type PaletteType = "scarlet-50" | "pumpkin-50" | "marigold-50" | "avacado-50" | "jade-50" | "denim-50" | "iris-50" | "lilac-50" | "coral-50" | "wood-50" | "silver-50" | "steel-50" | "olive-50" | "sand-50" | "scarlet-100" | "pumpkin-100" | "marigold-100" | "avacado-100" | "jade-100" | "denim-100" | "iris-100" | "lilac-100" | "coral-100" | "wood-100" | "silver-100" | "steel-100" | "olive-100" | "sand-100" | "scarlet-200" | "pumpkin-200" | "marigold-200" | "avacado-200" | "jade-200" | "denim-200" | "iris-200" | "lilac-200" | "coral-200" | "wood-200" | "silver-200" | "steel-200" | "olive-200" | "sand-200" | "scarlet-300" | "pumpkin-300" | "marigold-300" | "avacado-300" | "jade-300" | "denim-300" | "iris-300" | "lilac-300" | "coral-300" | "wood-300" | "silver-300" | "steel-300" | "olive-300" | "sand-300" | "scarlet-400" | "pumpkin-400" | "marigold-400" | "avacado-400" | "jade-400" | "denim-400" | "iris-400" | "lilac-400" | "coral-400" | "wood-400" | "silver-400" | "steel-400" | "olive-400" | "sand-400" | "scarlet-500" | "pumpkin-500" | "marigold-500" | "avacado-500" | "jade-500" | "denim-500" | "iris-500" | "lilac-500" | "coral-500" | "wood-500" | "silver-500" | "steel-500" | "olive-500" | "sand-500" | "scarlet-600" | "pumpkin-600" | "marigold-600" | "avacado-600" | "jade-600" | "denim-600" | "iris-600" | "lilac-600" | "coral-600" | "wood-600" | "silver-600" | "steel-600" | "olive-600" | "sand-600" | "scarlet-700" | "pumpkin-700" | "marigold-700" | "avacado-700" | "jade-700" | "denim-700" | "iris-700" | "lilac-700" | "coral-700" | "wood-700" | "silver-700" | "steel-700" | "olive-700" | "sand-700" | "scarlet-800" | "pumpkin-800" | "marigold-800" | "avacado-800" | "jade-800" | "denim-800" | "iris-800" | "lilac-800" | "coral-800" | "wood-800" | "silver-800" | "steel-800" | "olive-800" | "sand-800" | "scarlet-900" | "pumpkin-900" | "marigold-900" | "avacado-900" | "jade-900" | "denim-900" | "iris-900" | "lilac-900" | "coral-900" | "wood-900" | "silver-900" | "steel-900" | "olive-900" | "sand-900" | "scarlet-950" | "pumpkin-950" | "marigold-950" | "avacado-950" | "jade-950" | "denim-950" | "iris-950" | "lilac-950" | "coral-950" | "wood-950" | "silver-950" | "steel-950" | "olive-950" | "sand-950";
|
|
10
11
|
export type ColorWithGrays = ColorType | "invert" | "dimmed" | "muted";
|
|
11
12
|
export declare const ThemeColors: string[];
|
|
12
13
|
export interface TooltipType {
|
|
@@ -17,7 +18,11 @@ export interface TooltipType {
|
|
|
17
18
|
/**
|
|
18
19
|
* tooltip color
|
|
19
20
|
*/
|
|
20
|
-
color?: ColorType;
|
|
21
|
+
color?: ColorType | PaletteType | string;
|
|
22
|
+
/**
|
|
23
|
+
* text color
|
|
24
|
+
*/
|
|
25
|
+
textColor?: ColorType | PaletteType | string;
|
|
21
26
|
/**
|
|
22
27
|
* tooltip placement
|
|
23
28
|
*/
|
|
@@ -87,11 +92,11 @@ export interface IconProps {
|
|
|
87
92
|
/**
|
|
88
93
|
* icon background color
|
|
89
94
|
*/
|
|
90
|
-
iconBg?: ColorType | string;
|
|
95
|
+
iconBg?: ColorType | PaletteType | string;
|
|
91
96
|
/**
|
|
92
97
|
* icon color
|
|
93
98
|
*/
|
|
94
|
-
iconColor?: ColorType | string;
|
|
99
|
+
iconColor?: ColorType | PaletteType | string;
|
|
95
100
|
}
|
|
96
101
|
export interface CollapseProps {
|
|
97
102
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type ChildProp, type ColorType, type CssProp } from "../types";
|
|
2
|
+
import { type ChildProp, type ColorType, type CssProp, type PaletteType } from "../types";
|
|
3
3
|
export interface AbbrProps extends ChildProp<string>, CssProp {
|
|
4
4
|
/**
|
|
5
5
|
* content to copy using the tooltip copy action
|
|
@@ -10,7 +10,11 @@ export interface AbbrProps extends ChildProp<string>, CssProp {
|
|
|
10
10
|
*
|
|
11
11
|
* [textPart, tooltip, color (class name or color string)]
|
|
12
12
|
*/
|
|
13
|
-
abbr: Array<[
|
|
13
|
+
abbr: Array<[
|
|
14
|
+
textPart: string,
|
|
15
|
+
tooltip: string,
|
|
16
|
+
color?: ColorType | PaletteType | string
|
|
17
|
+
]>;
|
|
14
18
|
/**
|
|
15
19
|
* renderer callback
|
|
16
20
|
*/
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { type MouseEventHandler } from "react";
|
|
2
|
-
import { type AriaProps, type ChildrenProp, type ColorType, type CssProp, type PolymorphicProps, type RefProp, type SizeType } from "../types";
|
|
2
|
+
import { type AriaProps, type ChildrenProp, type ColorType, type CssProp, type PaletteType, type PolymorphicProps, type RefProp, type SizeType } from "../types";
|
|
3
3
|
export interface AnchorProps extends ChildrenProp, CssProp, RefProp, AriaProps {
|
|
4
4
|
/**
|
|
5
5
|
* link background (CSS color / tailwind color)
|
|
6
6
|
*/
|
|
7
|
-
bg?: ColorType | string;
|
|
7
|
+
bg?: ColorType | PaletteType | string;
|
|
8
8
|
/**
|
|
9
9
|
* link color (CSS color / tailwind color)
|
|
10
10
|
*/
|
|
11
|
-
color?: ColorType | string;
|
|
11
|
+
color?: ColorType | PaletteType | string;
|
|
12
12
|
/**
|
|
13
13
|
* link size
|
|
14
14
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type ChildProp, type ColorType } from "../types";
|
|
2
|
+
import { type ChildProp, type ColorType, type PaletteType } from "../types";
|
|
3
3
|
export interface MarkProps extends ChildProp<string> {
|
|
4
4
|
/**
|
|
5
5
|
* texts to match and abbreviate within
|
|
6
6
|
*
|
|
7
7
|
* [textPart, color (class name or color string)]
|
|
8
8
|
*/
|
|
9
|
-
mark: Array<[textPart: string, color?: ColorType | string]>;
|
|
9
|
+
mark: Array<[textPart: string, color?: ColorType | PaletteType | string]>;
|
|
10
10
|
/**
|
|
11
11
|
* renderer callback
|
|
12
12
|
*/
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export declare const getColor: (color: string) => string
|
|
2
|
-
export declare const getBgClass: (bg: string) => string | undefined;
|
|
3
|
-
export declare const getColorClass: (color: string) => string | undefined;
|
|
4
|
-
export declare const getBorderClass: (color: string) => string | undefined;
|
|
1
|
+
export declare const getColor: (color: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.37",
|
|
4
4
|
"description": "RUF: Core package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,6 +19,17 @@
|
|
|
19
19
|
"src",
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"default": "./dist/esm/index.js",
|
|
25
|
+
"import": "./dist/esm/index.js",
|
|
26
|
+
"require": "./dist/cjs/index.js",
|
|
27
|
+
"types": "./dist/types/index.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./styles": "./css/styles.css",
|
|
30
|
+
"./flags.rect": "./css/flags.rect.css",
|
|
31
|
+
"./flags.wavy": "./css/flags.wavy.css"
|
|
32
|
+
},
|
|
22
33
|
"publishConfig": {
|
|
23
34
|
"access": "public",
|
|
24
35
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,15 +47,13 @@
|
|
|
36
47
|
},
|
|
37
48
|
"dependencies": {
|
|
38
49
|
"@floating-ui/react": "^0.26.24",
|
|
39
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
40
|
-
"@tailwindcss/
|
|
41
|
-
"@tailwindcss/forms": "^0.5.7",
|
|
42
|
-
"@tailwindcss/typography": "^0.5.13",
|
|
50
|
+
"@react-fabric/utilities": "^1.0.0-beta.37",
|
|
51
|
+
"@tailwindcss/postcss": "~4.0.14",
|
|
43
52
|
"boring-avatars": "^1.10.2",
|
|
44
53
|
"classnames": "^2.5.1",
|
|
45
54
|
"color": "^4.2.3",
|
|
46
55
|
"resize-observer-polyfill": "^1.5.1",
|
|
47
|
-
"tailwindcss": "^
|
|
56
|
+
"tailwindcss": "^4.0.14"
|
|
48
57
|
},
|
|
49
58
|
"peerDependencies": {
|
|
50
59
|
"i18next": "^23.15.1",
|
|
@@ -56,5 +65,5 @@
|
|
|
56
65
|
"node": ">=18.12.0",
|
|
57
66
|
"npm": ">=8.19.0"
|
|
58
67
|
},
|
|
59
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "9b737229bf24ebe986540ee2c4b8904ebc4a5a9b"
|
|
60
69
|
}
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
type TestProps,
|
|
31
31
|
} from "../../types";
|
|
32
32
|
import { ButtonGroup } from "../button/ButtonGroup";
|
|
33
|
-
import classes from "./ActionLabel.module.css";
|
|
34
33
|
|
|
35
34
|
export interface ActionLabelProps
|
|
36
35
|
extends AriaProps,
|
|
@@ -84,7 +83,7 @@ export const ActionLabel = ({
|
|
|
84
83
|
<div
|
|
85
84
|
className={classNames(
|
|
86
85
|
className,
|
|
87
|
-
|
|
86
|
+
"fabric-actionLabel",
|
|
88
87
|
"flex overflow-hidden gap-1 items-center cursor-default select-none",
|
|
89
88
|
)}
|
|
90
89
|
data-disabled={disabled}
|
|
@@ -94,7 +93,7 @@ export const ActionLabel = ({
|
|
|
94
93
|
ref={calculateBasis}
|
|
95
94
|
data-inner-clickable
|
|
96
95
|
className={classNames(
|
|
97
|
-
|
|
96
|
+
"fabric-actions",
|
|
98
97
|
"overflow-hidden flex-content",
|
|
99
98
|
align === "end" && "order-2",
|
|
100
99
|
)}
|
|
@@ -30,19 +30,18 @@ import {
|
|
|
30
30
|
type CssProp,
|
|
31
31
|
type PaletteType,
|
|
32
32
|
} from "../../types";
|
|
33
|
-
import { getColor
|
|
34
|
-
import classes from "./Animations.module.css";
|
|
33
|
+
import { getColor } from "../../utils";
|
|
35
34
|
|
|
36
35
|
export interface AnimationProps extends CssProp, AriaProps {
|
|
37
36
|
type?: "info" | "check" | "cross" | "question" | "exclaim";
|
|
38
37
|
/**
|
|
39
38
|
* icon color
|
|
40
39
|
*/
|
|
41
|
-
color?: ColorType | PaletteType;
|
|
40
|
+
color?: ColorType | PaletteType | string;
|
|
42
41
|
/**
|
|
43
42
|
* icon mark color
|
|
44
43
|
*/
|
|
45
|
-
strokeColor?: ColorType | PaletteType;
|
|
44
|
+
strokeColor?: ColorType | PaletteType | string;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
export const AnimationIndicator = ({
|
|
@@ -80,10 +79,9 @@ export const AnimationIndicator = ({
|
|
|
80
79
|
<svg
|
|
81
80
|
data-ref="animated-indicator"
|
|
82
81
|
className={classNames(
|
|
83
|
-
|
|
82
|
+
"fabric-checkAnimation",
|
|
84
83
|
className,
|
|
85
84
|
"inline-block rounded-full",
|
|
86
|
-
color && getColorClass(color),
|
|
87
85
|
)}
|
|
88
86
|
style={styles}
|
|
89
87
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -91,12 +89,14 @@ export const AnimationIndicator = ({
|
|
|
91
89
|
aria-hidden="true"
|
|
92
90
|
{...aria}
|
|
93
91
|
>
|
|
94
|
-
<circle className={
|
|
92
|
+
<circle className={"fabric-circlePart"} cx="26" cy="26" r="25" />
|
|
95
93
|
<path
|
|
96
|
-
className={classNames(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
className={classNames("fabric-iconPart")}
|
|
95
|
+
style={{
|
|
96
|
+
color: strokeColor
|
|
97
|
+
? getColor(strokeColor)
|
|
98
|
+
: "var(--text-color-invert)",
|
|
99
|
+
}}
|
|
100
100
|
d={path}
|
|
101
101
|
/>
|
|
102
102
|
</svg>
|
|
@@ -104,10 +104,10 @@ export const AnimationIndicator = ({
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
export const AnimationBars = ({
|
|
107
|
-
color = "tint",
|
|
107
|
+
color = "tint-500",
|
|
108
108
|
size = "2rem",
|
|
109
109
|
}: {
|
|
110
|
-
color?: ColorType | string;
|
|
110
|
+
color?: ColorType | PaletteType | string;
|
|
111
111
|
size?: number | string;
|
|
112
112
|
}) => {
|
|
113
113
|
return (
|
|
@@ -122,8 +122,8 @@ export const AnimationBars = ({
|
|
|
122
122
|
)}
|
|
123
123
|
>
|
|
124
124
|
<div
|
|
125
|
-
className={classNames(
|
|
126
|
-
style={{ width: size }}
|
|
125
|
+
className={classNames("fabric-bars")}
|
|
126
|
+
style={{ width: size, color: getColor(color) }}
|
|
127
127
|
/>
|
|
128
128
|
</div>
|
|
129
129
|
</div>
|
|
@@ -134,7 +134,7 @@ export const AnimationSpinner = ({
|
|
|
134
134
|
color = "tint-700",
|
|
135
135
|
size = "2rem",
|
|
136
136
|
}: {
|
|
137
|
-
color?: ColorType | string;
|
|
137
|
+
color?: ColorType | PaletteType | string;
|
|
138
138
|
size?: number | string;
|
|
139
139
|
}) => {
|
|
140
140
|
return (
|
|
@@ -150,8 +150,8 @@ export const AnimationSpinner = ({
|
|
|
150
150
|
)}
|
|
151
151
|
>
|
|
152
152
|
<div
|
|
153
|
-
className={classNames(
|
|
154
|
-
style={{ width: size }}
|
|
153
|
+
className={classNames("fabric-spinner")}
|
|
154
|
+
style={{ width: size, color: getColor(color) }}
|
|
155
155
|
/>
|
|
156
156
|
</div>
|
|
157
157
|
</div>
|
|
@@ -162,7 +162,7 @@ export const Loading = () => {
|
|
|
162
162
|
return (
|
|
163
163
|
<div
|
|
164
164
|
className={classNames(
|
|
165
|
-
|
|
165
|
+
"fabric-loader",
|
|
166
166
|
"area-[loader] relative overflow-x-clip",
|
|
167
167
|
)}
|
|
168
168
|
data-ref="loading"
|
|
@@ -26,6 +26,7 @@ import BoringAvatar from "boring-avatars";
|
|
|
26
26
|
import classNames from "classnames";
|
|
27
27
|
import { useMemo, useState } from "react";
|
|
28
28
|
import {
|
|
29
|
+
type PaletteType,
|
|
29
30
|
type AriaProps,
|
|
30
31
|
type ColorType,
|
|
31
32
|
type CssProp,
|
|
@@ -33,8 +34,7 @@ import {
|
|
|
33
34
|
type SizeType,
|
|
34
35
|
type TestProps,
|
|
35
36
|
} from "../../types";
|
|
36
|
-
import {
|
|
37
|
-
import classes from "./Avatar.module.css";
|
|
37
|
+
import { getColor } from "../../utils";
|
|
38
38
|
|
|
39
39
|
export interface AvatarProps extends CssProp, AriaProps, TestProps, RefProp {
|
|
40
40
|
/**
|
|
@@ -56,11 +56,11 @@ export interface AvatarProps extends CssProp, AriaProps, TestProps, RefProp {
|
|
|
56
56
|
/**
|
|
57
57
|
* background color (CSS color / tailwind color)
|
|
58
58
|
*/
|
|
59
|
-
bg?: ColorType | string;
|
|
59
|
+
bg?: ColorType | PaletteType | string;
|
|
60
60
|
/**
|
|
61
61
|
* icon color (CSS color / tailwind color)
|
|
62
62
|
*/
|
|
63
|
-
color?: ColorType | string;
|
|
63
|
+
color?: ColorType | PaletteType | string;
|
|
64
64
|
/**
|
|
65
65
|
* icon size
|
|
66
66
|
*/
|
|
@@ -133,7 +133,7 @@ export const Avatar = ({
|
|
|
133
133
|
<div className="contents">
|
|
134
134
|
<div
|
|
135
135
|
className={classNames(
|
|
136
|
-
|
|
136
|
+
"fabric-imgPlaceholder",
|
|
137
137
|
"absolute inset-0 bg-gray animate-pulse",
|
|
138
138
|
)}
|
|
139
139
|
/>
|
|
@@ -185,11 +185,9 @@ export const Avatar = ({
|
|
|
185
185
|
<dfn
|
|
186
186
|
role="presentation"
|
|
187
187
|
className={classNames(
|
|
188
|
-
|
|
188
|
+
"fabric-avatar",
|
|
189
189
|
className,
|
|
190
190
|
"select-none relative overflow-hidden inline-block box-content leading-none not-italic text-center",
|
|
191
|
-
bg && getBgClass(bg),
|
|
192
|
-
color && getColorClass(color),
|
|
193
191
|
!rounded && "rounded",
|
|
194
192
|
rounded && "rounded-full",
|
|
195
193
|
)}
|
|
@@ -31,7 +31,6 @@ import {
|
|
|
31
31
|
type SizeType,
|
|
32
32
|
} from "../../types";
|
|
33
33
|
import { type AvatarProps } from "./Avatar";
|
|
34
|
-
import classes from "./Avatar.module.css";
|
|
35
34
|
|
|
36
35
|
type AvatarChild =
|
|
37
36
|
| ReactElement<Omit<AvatarProps, "size" | "rounded">>
|
|
@@ -104,7 +103,7 @@ export const AvatarGroup = ({
|
|
|
104
103
|
{...aria}
|
|
105
104
|
ref={ref as AnyObject}
|
|
106
105
|
className={classNames(
|
|
107
|
-
|
|
106
|
+
"fabric-avatarGroup",
|
|
108
107
|
className,
|
|
109
108
|
"inline-flex flex-nowrap",
|
|
110
109
|
!rounded && "rounded",
|
|
@@ -117,9 +116,9 @@ export const AvatarGroup = ({
|
|
|
117
116
|
<dfn
|
|
118
117
|
data-ref="avatarCount"
|
|
119
118
|
className={classNames(
|
|
120
|
-
|
|
119
|
+
"fabric-avatar",
|
|
121
120
|
"select-none relative overflow-hidden inline-block box-content leading-none not-italic text-center",
|
|
122
|
-
|
|
121
|
+
"fabric-avatarGroup--extra",
|
|
123
122
|
)}
|
|
124
123
|
>
|
|
125
124
|
<svg>
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
type RefProp,
|
|
33
33
|
} from "../../types";
|
|
34
34
|
import { Icon } from "../icon/Icon";
|
|
35
|
-
import classes from "./Badge.module.css";
|
|
36
35
|
|
|
37
36
|
export interface BadgeProps
|
|
38
37
|
extends CssProp,
|
|
@@ -125,8 +124,8 @@ export const Badge = ({
|
|
|
125
124
|
return (
|
|
126
125
|
<div
|
|
127
126
|
className={classNames(
|
|
128
|
-
forButton || inline ? "contents" : "
|
|
129
|
-
|
|
127
|
+
forButton || inline ? "contents" : block ? "block" : "inline-block",
|
|
128
|
+
forButton || inline ? "" : "relative",
|
|
130
129
|
)}
|
|
131
130
|
>
|
|
132
131
|
{children &&
|
|
@@ -140,7 +139,7 @@ export const Badge = ({
|
|
|
140
139
|
data-ping={ping}
|
|
141
140
|
data-placement={placement}
|
|
142
141
|
className={classNames(
|
|
143
|
-
|
|
142
|
+
"fabric-badge",
|
|
144
143
|
className,
|
|
145
144
|
"inline-block p-px min-w-2 min-h-2 text-center select-none rounded-full leading-none z-2 pointer-events-none",
|
|
146
145
|
(forButton && !placement) || inline ? "relative" : "absolute",
|
|
@@ -26,7 +26,6 @@ import { Children, useMemo } from "react";
|
|
|
26
26
|
import { type AriaProps, type ChildrenProp, type CssProp } from "../../types";
|
|
27
27
|
import { Anchor } from "../../typography/Anchor";
|
|
28
28
|
import { Dropdown } from "../dropdown/Dropdown";
|
|
29
|
-
import classes from "./Breadcrumbs.module.css";
|
|
30
29
|
|
|
31
30
|
export interface BreadcrumbProps
|
|
32
31
|
extends CssProp,
|
|
@@ -68,7 +67,7 @@ export const Breadcrumbs = ({
|
|
|
68
67
|
data-color={color}
|
|
69
68
|
data-variant={variant}
|
|
70
69
|
className={classNames(
|
|
71
|
-
|
|
70
|
+
"fabric-breadcrumbs",
|
|
72
71
|
className,
|
|
73
72
|
"flex flex-nowrap items-center",
|
|
74
73
|
)}
|
|
@@ -77,7 +76,7 @@ export const Breadcrumbs = ({
|
|
|
77
76
|
{start.map((link, idx) => (
|
|
78
77
|
<li
|
|
79
78
|
key={idx}
|
|
80
|
-
className={
|
|
79
|
+
className={"fabric-breadcrumbLink"}
|
|
81
80
|
data-separator={separator}
|
|
82
81
|
>
|
|
83
82
|
{link}
|
|
@@ -86,7 +85,7 @@ export const Breadcrumbs = ({
|
|
|
86
85
|
{overflow && (
|
|
87
86
|
<Dropdown closeOnClick showArrow>
|
|
88
87
|
<li
|
|
89
|
-
className={
|
|
88
|
+
className={"fabric-breadcrumbLink"}
|
|
90
89
|
data-separator={separator}
|
|
91
90
|
data-ref="breadcrumbOverflow"
|
|
92
91
|
>
|
|
@@ -94,7 +93,7 @@ export const Breadcrumbs = ({
|
|
|
94
93
|
</li>
|
|
95
94
|
<div
|
|
96
95
|
data-color={color}
|
|
97
|
-
className={classNames(
|
|
96
|
+
className={classNames("fabric-breadcrumbOverflow", "flex flex-col")}
|
|
98
97
|
>
|
|
99
98
|
{overflow}
|
|
100
99
|
</div>
|
|
@@ -103,7 +102,7 @@ export const Breadcrumbs = ({
|
|
|
103
102
|
{end?.map((link, idx) => (
|
|
104
103
|
<li
|
|
105
104
|
key={idx}
|
|
106
|
-
className={
|
|
105
|
+
className={"fabric-breadcrumbLink"}
|
|
107
106
|
data-separator={separator}
|
|
108
107
|
>
|
|
109
108
|
{link}
|
|
@@ -26,12 +26,12 @@ import classNames from "classnames";
|
|
|
26
26
|
import {
|
|
27
27
|
Fragment,
|
|
28
28
|
isValidElement,
|
|
29
|
-
type MouseEventHandler,
|
|
30
29
|
useCallback,
|
|
31
30
|
useEffect,
|
|
32
31
|
useMemo,
|
|
33
32
|
useRef,
|
|
34
33
|
useState,
|
|
34
|
+
type MouseEventHandler,
|
|
35
35
|
type WheelEventHandler,
|
|
36
36
|
} from "react";
|
|
37
37
|
import { useEffectDebugger } from "../../hooks/useEffectDebugger";
|
|
@@ -39,10 +39,10 @@ import { HotKey } from "../../hotkeys/HotKey";
|
|
|
39
39
|
import { HotKeyLabel } from "../../hotkeys/HotKeyLabel";
|
|
40
40
|
import { Tooltip } from "../../overlays/tooltip/Tooltip";
|
|
41
41
|
import {
|
|
42
|
+
type ColorState,
|
|
42
43
|
type AriaProps,
|
|
43
44
|
type BadgeType,
|
|
44
45
|
type CallbackReturn,
|
|
45
|
-
type ColorType,
|
|
46
46
|
type CssProp,
|
|
47
47
|
type IconProps,
|
|
48
48
|
type PolymorphicProps,
|
|
@@ -51,10 +51,10 @@ import {
|
|
|
51
51
|
type TestProps,
|
|
52
52
|
type TooltipType,
|
|
53
53
|
} from "../../types";
|
|
54
|
+
import { getColor } from "../../utils";
|
|
54
55
|
import { AnimationIndicator } from "../animations/Animations";
|
|
55
56
|
import { Badge, getBadgeProps } from "../badge/Badge";
|
|
56
57
|
import { Icon } from "../icon/Icon";
|
|
57
|
-
import classes from "./Button.module.css";
|
|
58
58
|
|
|
59
59
|
export interface BaseProps
|
|
60
60
|
extends CssProp,
|
|
@@ -77,7 +77,7 @@ export interface BaseProps
|
|
|
77
77
|
/**
|
|
78
78
|
* button color
|
|
79
79
|
*/
|
|
80
|
-
color?:
|
|
80
|
+
color?: ColorState;
|
|
81
81
|
/**
|
|
82
82
|
* button type
|
|
83
83
|
*/
|
|
@@ -234,7 +234,7 @@ export const Button = <Tag extends React.ElementType = "button">({
|
|
|
234
234
|
return {
|
|
235
235
|
content: actionMessage,
|
|
236
236
|
placement: "top",
|
|
237
|
-
color
|
|
237
|
+
color: `${color}-100`,
|
|
238
238
|
open: true,
|
|
239
239
|
} as TooltipType;
|
|
240
240
|
}
|
|
@@ -252,7 +252,7 @@ export const Button = <Tag extends React.ElementType = "button">({
|
|
|
252
252
|
return (
|
|
253
253
|
<div
|
|
254
254
|
className={classNames(
|
|
255
|
-
|
|
255
|
+
"fabric-buttonWrapper",
|
|
256
256
|
className,
|
|
257
257
|
"relative align-text-top select-none focus-within:z-1",
|
|
258
258
|
fullWidth ? "block w-full" : "inline-block",
|
|
@@ -268,12 +268,12 @@ export const Button = <Tag extends React.ElementType = "button">({
|
|
|
268
268
|
ref={mergeRefs(ref, refEl)}
|
|
269
269
|
role="button"
|
|
270
270
|
className={classNames(
|
|
271
|
-
|
|
271
|
+
"fabric-button",
|
|
272
272
|
"pointer-events-auto cursor-pointer select-none flex flex-nowrap w-full h-full items-center border-0 -outline-offset-1 justify-center max-w-72 p-0 font-sans font-medium appearance-none",
|
|
273
273
|
`focus-visible:ring-2 focus-visible:ring-offset-2 buttonInner`,
|
|
274
274
|
fullWidth && "max-w-full w-full",
|
|
275
275
|
rounded && "rounded-full",
|
|
276
|
-
spinOnHover &&
|
|
276
|
+
spinOnHover && "fabric-spinOnHover",
|
|
277
277
|
)}
|
|
278
278
|
type={type}
|
|
279
279
|
disabled={disabled}
|
|
@@ -287,7 +287,7 @@ export const Button = <Tag extends React.ElementType = "button">({
|
|
|
287
287
|
>
|
|
288
288
|
{icon && (
|
|
289
289
|
<Icon
|
|
290
|
-
className={
|
|
290
|
+
className={"fabric-buttonIcon"}
|
|
291
291
|
icon={icon}
|
|
292
292
|
bg={iconBg}
|
|
293
293
|
color={iconColor}
|
|
@@ -296,11 +296,11 @@ export const Button = <Tag extends React.ElementType = "button">({
|
|
|
296
296
|
/>
|
|
297
297
|
)}
|
|
298
298
|
{isValidElement(children) && (
|
|
299
|
-
<div className={
|
|
299
|
+
<div className={"fabric-buttonChild"}>{children}</div>
|
|
300
300
|
)}
|
|
301
301
|
{isString(children) && (
|
|
302
302
|
<label
|
|
303
|
-
className={classNames(
|
|
303
|
+
className={classNames("fabric-buttonLabel", "truncate")}
|
|
304
304
|
data-colored-icon={!!iconBg}
|
|
305
305
|
>
|
|
306
306
|
{children}
|
|
@@ -309,7 +309,7 @@ export const Button = <Tag extends React.ElementType = "button">({
|
|
|
309
309
|
{!isNil(badge) && <Badge {...badgeProps} />}
|
|
310
310
|
{hotKey && <HotKeyLabel keyCombo={hotKey} />}
|
|
311
311
|
{altIcon && (
|
|
312
|
-
<Icon className={
|
|
312
|
+
<Icon className={"fabric-altIcon"} icon={altIcon} rtlFlip />
|
|
313
313
|
)}
|
|
314
314
|
</E>
|
|
315
315
|
</TooltipWrapper>
|
|
@@ -317,9 +317,11 @@ export const Button = <Tag extends React.ElementType = "button">({
|
|
|
317
317
|
<div
|
|
318
318
|
className={classNames(
|
|
319
319
|
"absolute inset-0 overflow-hidden flex justify-center items-center",
|
|
320
|
-
`bg-${color}-300`,
|
|
321
320
|
rounded ? "rounded-full" : "rounded",
|
|
322
321
|
)}
|
|
322
|
+
style={{
|
|
323
|
+
backgroundColor: getColor(`${color}-300`),
|
|
324
|
+
}}
|
|
323
325
|
>
|
|
324
326
|
<AnimationIndicator type="check" color={color} />
|
|
325
327
|
</div>
|