@rehagro/ui 1.0.2 → 1.0.4
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/dist/colors.types-7nLOoy6r.d.mts +4 -0
- package/dist/colors.types-7nLOoy6r.d.ts +4 -0
- package/dist/index.d.mts +15 -11
- package/dist/index.d.ts +15 -11
- package/dist/index.js +102 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +102 -23
- package/dist/index.mjs.map +1 -1
- package/dist/native.d.mts +50 -4
- package/dist/native.d.ts +50 -4
- package/dist/native.js +169 -12
- package/dist/native.js.map +1 -1
- package/dist/native.mjs +169 -13
- package/dist/native.mjs.map +1 -1
- package/dist/styles.css +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1 from 'react';
|
|
3
|
+
import { B as ButtonColor, P as PresetColor } from './colors.types-7nLOoy6r.mjs';
|
|
3
4
|
|
|
4
5
|
type ToastVariant = "info" | "warning" | "success" | "error" | "neutral";
|
|
5
6
|
type ToastAppearance = "solid" | "light" | "outline";
|
|
@@ -88,6 +89,8 @@ type RehagroTheme = {
|
|
|
88
89
|
warningHover?: string;
|
|
89
90
|
success?: string;
|
|
90
91
|
successHover?: string;
|
|
92
|
+
info?: string;
|
|
93
|
+
infoHover?: string;
|
|
91
94
|
/** Semantic colors */
|
|
92
95
|
text?: string;
|
|
93
96
|
textMuted?: string;
|
|
@@ -127,7 +130,6 @@ declare function RehagroProvider({ theme, toastPosition, children }: RehagroProv
|
|
|
127
130
|
type ButtonVariant = "solid" | "outline" | "ghost";
|
|
128
131
|
type ButtonSize = "sm" | "md" | "lg";
|
|
129
132
|
type ButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
130
|
-
type ButtonColor = "primary" | "secondary" | "danger" | "warning" | "success";
|
|
131
133
|
type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
132
134
|
/** Visual style variant */
|
|
133
135
|
variant?: ButtonVariant;
|
|
@@ -135,9 +137,9 @@ type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
135
137
|
size?: ButtonSize;
|
|
136
138
|
/** Border radius */
|
|
137
139
|
radius?: ButtonRadius;
|
|
138
|
-
/** Color scheme */
|
|
140
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
139
141
|
color?: ButtonColor;
|
|
140
|
-
/** Custom hover color — overrides the token for this button only. Accepts "#RRGGBB", "r g b", or "rgb(r,g,b)" */
|
|
142
|
+
/** Custom hover color — overrides the token for this button only. Only applies to preset colors. Accepts "#RRGGBB", "r g b", or "rgb(r,g,b)" */
|
|
141
143
|
hoverColor?: string;
|
|
142
144
|
/** Shows loading state and disables interaction */
|
|
143
145
|
loading?: boolean;
|
|
@@ -153,9 +155,9 @@ declare const Button: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttrib
|
|
|
153
155
|
size?: ButtonSize;
|
|
154
156
|
/** Border radius */
|
|
155
157
|
radius?: ButtonRadius;
|
|
156
|
-
/** Color scheme */
|
|
158
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
157
159
|
color?: ButtonColor;
|
|
158
|
-
/** Custom hover color — overrides the token for this button only. Accepts "#RRGGBB", "r g b", or "rgb(r,g,b)" */
|
|
160
|
+
/** Custom hover color — overrides the token for this button only. Only applies to preset colors. Accepts "#RRGGBB", "r g b", or "rgb(r,g,b)" */
|
|
159
161
|
hoverColor?: string;
|
|
160
162
|
/** Shows loading state and disables interaction */
|
|
161
163
|
loading?: boolean;
|
|
@@ -168,7 +170,7 @@ declare const Button: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttrib
|
|
|
168
170
|
type IconButtonVariant = "solid" | "outline" | "ghost";
|
|
169
171
|
type IconButtonSize = "sm" | "md" | "lg";
|
|
170
172
|
type IconButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
171
|
-
type IconButtonColor =
|
|
173
|
+
type IconButtonColor = ButtonColor;
|
|
172
174
|
type IconButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
173
175
|
/** Visual style variant */
|
|
174
176
|
variant?: IconButtonVariant;
|
|
@@ -176,7 +178,7 @@ type IconButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
176
178
|
size?: IconButtonSize;
|
|
177
179
|
/** Border radius */
|
|
178
180
|
radius?: IconButtonRadius;
|
|
179
|
-
/** Color scheme */
|
|
181
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
180
182
|
color?: IconButtonColor;
|
|
181
183
|
/** Shows loading state and disables interaction */
|
|
182
184
|
loading?: boolean;
|
|
@@ -188,7 +190,7 @@ declare const IconButton: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAt
|
|
|
188
190
|
size?: IconButtonSize;
|
|
189
191
|
/** Border radius */
|
|
190
192
|
radius?: IconButtonRadius;
|
|
191
|
-
/** Color scheme */
|
|
193
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
192
194
|
color?: IconButtonColor;
|
|
193
195
|
/** Shows loading state and disables interaction */
|
|
194
196
|
loading?: boolean;
|
|
@@ -374,8 +376,6 @@ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttribu
|
|
|
374
376
|
variant?: AvatarVariant;
|
|
375
377
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
376
378
|
|
|
377
|
-
type PresetColor = "primary" | "secondary" | "danger" | "warning" | "success";
|
|
378
|
-
|
|
379
379
|
type TagSize = "sm" | "md" | "lg";
|
|
380
380
|
type TagProps = React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
381
381
|
/** Tag color — preset name or custom CSS color (e.g., "#c3c3c3", "rgb(...)") */
|
|
@@ -390,6 +390,8 @@ type TagProps = React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
|
390
390
|
leftIcon?: React$1.ReactNode;
|
|
391
391
|
/** Optional icon rendered on the right side */
|
|
392
392
|
rightIcon?: React$1.ReactNode;
|
|
393
|
+
/** Disabled state */
|
|
394
|
+
disabled?: boolean;
|
|
393
395
|
};
|
|
394
396
|
declare const Tag: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
395
397
|
/** Tag color — preset name or custom CSS color (e.g., "#c3c3c3", "rgb(...)") */
|
|
@@ -404,6 +406,8 @@ declare const Tag: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTML
|
|
|
404
406
|
leftIcon?: React$1.ReactNode;
|
|
405
407
|
/** Optional icon rendered on the right side */
|
|
406
408
|
rightIcon?: React$1.ReactNode;
|
|
409
|
+
/** Disabled state */
|
|
410
|
+
disabled?: boolean;
|
|
407
411
|
} & React$1.RefAttributes<HTMLSpanElement>>;
|
|
408
412
|
|
|
409
413
|
type ContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -507,4 +511,4 @@ declare const NeutralIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
|
507
511
|
|
|
508
512
|
declare const CloseIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
509
513
|
|
|
510
|
-
export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button,
|
|
514
|
+
export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, ButtonColor, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, type CheckboxSize, CloseIcon, Container, type ContainerProps, DeleteIcon, EditIcon, ErrorIcon, GridContainer, type GridContainerProps, GridItem, type GridItemProps, type GridSpan, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, type IconProps, InfoIcon, type MobileSpan, NeutralIcon, PlusIcon, RehagroProvider, type RehagroProviderProps, type RehagroTheme, SearchIcon, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, SuccessIcon, Tag, type TagProps, type TagSize, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, Toast, type ToastAppearance, ToastContainer, type ToastFn, type ToastItem, type ToastLink, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, type TooltipSize, type TooltipVariant, WarningIcon, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1 from 'react';
|
|
3
|
+
import { B as ButtonColor, P as PresetColor } from './colors.types-7nLOoy6r.js';
|
|
3
4
|
|
|
4
5
|
type ToastVariant = "info" | "warning" | "success" | "error" | "neutral";
|
|
5
6
|
type ToastAppearance = "solid" | "light" | "outline";
|
|
@@ -88,6 +89,8 @@ type RehagroTheme = {
|
|
|
88
89
|
warningHover?: string;
|
|
89
90
|
success?: string;
|
|
90
91
|
successHover?: string;
|
|
92
|
+
info?: string;
|
|
93
|
+
infoHover?: string;
|
|
91
94
|
/** Semantic colors */
|
|
92
95
|
text?: string;
|
|
93
96
|
textMuted?: string;
|
|
@@ -127,7 +130,6 @@ declare function RehagroProvider({ theme, toastPosition, children }: RehagroProv
|
|
|
127
130
|
type ButtonVariant = "solid" | "outline" | "ghost";
|
|
128
131
|
type ButtonSize = "sm" | "md" | "lg";
|
|
129
132
|
type ButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
130
|
-
type ButtonColor = "primary" | "secondary" | "danger" | "warning" | "success";
|
|
131
133
|
type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
132
134
|
/** Visual style variant */
|
|
133
135
|
variant?: ButtonVariant;
|
|
@@ -135,9 +137,9 @@ type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
135
137
|
size?: ButtonSize;
|
|
136
138
|
/** Border radius */
|
|
137
139
|
radius?: ButtonRadius;
|
|
138
|
-
/** Color scheme */
|
|
140
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
139
141
|
color?: ButtonColor;
|
|
140
|
-
/** Custom hover color — overrides the token for this button only. Accepts "#RRGGBB", "r g b", or "rgb(r,g,b)" */
|
|
142
|
+
/** Custom hover color — overrides the token for this button only. Only applies to preset colors. Accepts "#RRGGBB", "r g b", or "rgb(r,g,b)" */
|
|
141
143
|
hoverColor?: string;
|
|
142
144
|
/** Shows loading state and disables interaction */
|
|
143
145
|
loading?: boolean;
|
|
@@ -153,9 +155,9 @@ declare const Button: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttrib
|
|
|
153
155
|
size?: ButtonSize;
|
|
154
156
|
/** Border radius */
|
|
155
157
|
radius?: ButtonRadius;
|
|
156
|
-
/** Color scheme */
|
|
158
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
157
159
|
color?: ButtonColor;
|
|
158
|
-
/** Custom hover color — overrides the token for this button only. Accepts "#RRGGBB", "r g b", or "rgb(r,g,b)" */
|
|
160
|
+
/** Custom hover color — overrides the token for this button only. Only applies to preset colors. Accepts "#RRGGBB", "r g b", or "rgb(r,g,b)" */
|
|
159
161
|
hoverColor?: string;
|
|
160
162
|
/** Shows loading state and disables interaction */
|
|
161
163
|
loading?: boolean;
|
|
@@ -168,7 +170,7 @@ declare const Button: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttrib
|
|
|
168
170
|
type IconButtonVariant = "solid" | "outline" | "ghost";
|
|
169
171
|
type IconButtonSize = "sm" | "md" | "lg";
|
|
170
172
|
type IconButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
171
|
-
type IconButtonColor =
|
|
173
|
+
type IconButtonColor = ButtonColor;
|
|
172
174
|
type IconButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
173
175
|
/** Visual style variant */
|
|
174
176
|
variant?: IconButtonVariant;
|
|
@@ -176,7 +178,7 @@ type IconButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
176
178
|
size?: IconButtonSize;
|
|
177
179
|
/** Border radius */
|
|
178
180
|
radius?: IconButtonRadius;
|
|
179
|
-
/** Color scheme */
|
|
181
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
180
182
|
color?: IconButtonColor;
|
|
181
183
|
/** Shows loading state and disables interaction */
|
|
182
184
|
loading?: boolean;
|
|
@@ -188,7 +190,7 @@ declare const IconButton: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAt
|
|
|
188
190
|
size?: IconButtonSize;
|
|
189
191
|
/** Border radius */
|
|
190
192
|
radius?: IconButtonRadius;
|
|
191
|
-
/** Color scheme */
|
|
193
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
192
194
|
color?: IconButtonColor;
|
|
193
195
|
/** Shows loading state and disables interaction */
|
|
194
196
|
loading?: boolean;
|
|
@@ -374,8 +376,6 @@ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttribu
|
|
|
374
376
|
variant?: AvatarVariant;
|
|
375
377
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
376
378
|
|
|
377
|
-
type PresetColor = "primary" | "secondary" | "danger" | "warning" | "success";
|
|
378
|
-
|
|
379
379
|
type TagSize = "sm" | "md" | "lg";
|
|
380
380
|
type TagProps = React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
381
381
|
/** Tag color — preset name or custom CSS color (e.g., "#c3c3c3", "rgb(...)") */
|
|
@@ -390,6 +390,8 @@ type TagProps = React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
|
390
390
|
leftIcon?: React$1.ReactNode;
|
|
391
391
|
/** Optional icon rendered on the right side */
|
|
392
392
|
rightIcon?: React$1.ReactNode;
|
|
393
|
+
/** Disabled state */
|
|
394
|
+
disabled?: boolean;
|
|
393
395
|
};
|
|
394
396
|
declare const Tag: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
395
397
|
/** Tag color — preset name or custom CSS color (e.g., "#c3c3c3", "rgb(...)") */
|
|
@@ -404,6 +406,8 @@ declare const Tag: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTML
|
|
|
404
406
|
leftIcon?: React$1.ReactNode;
|
|
405
407
|
/** Optional icon rendered on the right side */
|
|
406
408
|
rightIcon?: React$1.ReactNode;
|
|
409
|
+
/** Disabled state */
|
|
410
|
+
disabled?: boolean;
|
|
407
411
|
} & React$1.RefAttributes<HTMLSpanElement>>;
|
|
408
412
|
|
|
409
413
|
type ContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -507,4 +511,4 @@ declare const NeutralIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
|
507
511
|
|
|
508
512
|
declare const CloseIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
509
513
|
|
|
510
|
-
export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button,
|
|
514
|
+
export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, ButtonColor, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, type CheckboxSize, CloseIcon, Container, type ContainerProps, DeleteIcon, EditIcon, ErrorIcon, GridContainer, type GridContainerProps, GridItem, type GridItemProps, type GridSpan, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, type IconProps, InfoIcon, type MobileSpan, NeutralIcon, PlusIcon, RehagroProvider, type RehagroProviderProps, type RehagroTheme, SearchIcon, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, SuccessIcon, Tag, type TagProps, type TagSize, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, Toast, type ToastAppearance, ToastContainer, type ToastFn, type ToastItem, type ToastLink, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, type TooltipSize, type TooltipVariant, WarningIcon, useToast };
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,8 @@ var TOKEN_MAP = {
|
|
|
22
22
|
warningHover: { var: "--rh-warning-hover", isColor: true },
|
|
23
23
|
success: { var: "--rh-success", isColor: true },
|
|
24
24
|
successHover: { var: "--rh-success-hover", isColor: true },
|
|
25
|
+
info: { var: "--rh-info", isColor: true },
|
|
26
|
+
infoHover: { var: "--rh-info-hover", isColor: true },
|
|
25
27
|
text: { var: "--rh-text", isColor: true },
|
|
26
28
|
textMuted: { var: "--rh-text-muted", isColor: true },
|
|
27
29
|
surface: { var: "--rh-surface", isColor: true },
|
|
@@ -637,29 +639,46 @@ function toRgbTriplet2(value) {
|
|
|
637
639
|
if (parts.length === 3 && parts.every((p) => !Number.isNaN(Number(p)))) return value.trim();
|
|
638
640
|
return void 0;
|
|
639
641
|
}
|
|
642
|
+
var PRESET_COLORS = /* @__PURE__ */ new Set([
|
|
643
|
+
"primary",
|
|
644
|
+
"secondary",
|
|
645
|
+
"danger",
|
|
646
|
+
"warning",
|
|
647
|
+
"success",
|
|
648
|
+
"info"
|
|
649
|
+
]);
|
|
650
|
+
var isPresetColor = (c) => PRESET_COLORS.has(c);
|
|
640
651
|
var variantColorClasses = {
|
|
641
652
|
solid: {
|
|
642
653
|
primary: "rh-bg-primary rh-text-surface rh-border-primary hover:rh-bg-primary-hover hover:rh-border-primary-hover",
|
|
643
654
|
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary hover:rh-bg-secondary-hover hover:rh-border-secondary-hover",
|
|
644
655
|
danger: "rh-bg-danger rh-text-surface rh-border-danger hover:rh-bg-danger-hover hover:rh-border-danger-hover",
|
|
645
656
|
warning: "rh-bg-warning rh-text-surface rh-border-warning hover:rh-bg-warning-hover hover:rh-border-warning-hover",
|
|
646
|
-
success: "rh-bg-success rh-text-surface rh-border-success hover:rh-bg-success-hover hover:rh-border-success-hover"
|
|
657
|
+
success: "rh-bg-success rh-text-surface rh-border-success hover:rh-bg-success-hover hover:rh-border-success-hover",
|
|
658
|
+
info: "rh-bg-info rh-text-surface rh-border-info hover:rh-bg-info-hover hover:rh-border-info-hover"
|
|
647
659
|
},
|
|
648
660
|
outline: {
|
|
649
661
|
primary: "rh-bg-transparent rh-text-primary rh-border-primary hover:rh-bg-primary hover:rh-text-surface",
|
|
650
662
|
secondary: "rh-bg-transparent rh-text-secondary rh-border-secondary hover:rh-bg-secondary hover:rh-text-surface",
|
|
651
663
|
danger: "rh-bg-transparent rh-text-danger rh-border-danger hover:rh-bg-danger hover:rh-text-surface",
|
|
652
664
|
warning: "rh-bg-transparent rh-text-warning rh-border-warning hover:rh-bg-warning hover:rh-text-surface",
|
|
653
|
-
success: "rh-bg-transparent rh-text-success rh-border-success hover:rh-bg-success hover:rh-text-surface"
|
|
665
|
+
success: "rh-bg-transparent rh-text-success rh-border-success hover:rh-bg-success hover:rh-text-surface",
|
|
666
|
+
info: "rh-bg-transparent rh-text-info rh-border-info hover:rh-bg-info hover:rh-text-surface"
|
|
654
667
|
},
|
|
655
668
|
ghost: {
|
|
656
669
|
primary: "rh-bg-transparent rh-text-primary rh-border-transparent hover:rh-bg-primary/10",
|
|
657
670
|
secondary: "rh-bg-transparent rh-text-secondary rh-border-transparent hover:rh-bg-secondary/10",
|
|
658
671
|
danger: "rh-bg-transparent rh-text-danger rh-border-transparent hover:rh-bg-danger/10",
|
|
659
672
|
warning: "rh-bg-transparent rh-text-warning rh-border-transparent hover:rh-bg-warning/10",
|
|
660
|
-
success: "rh-bg-transparent rh-text-success rh-border-transparent hover:rh-bg-success/10"
|
|
673
|
+
success: "rh-bg-transparent rh-text-success rh-border-transparent hover:rh-bg-success/10",
|
|
674
|
+
info: "rh-bg-transparent rh-text-info rh-border-transparent hover:rh-bg-info/10"
|
|
661
675
|
}
|
|
662
676
|
};
|
|
677
|
+
function getArbitraryColorStyle(variant, color) {
|
|
678
|
+
if (variant === "solid") return { backgroundColor: color, borderColor: color, color: "#fff" };
|
|
679
|
+
if (variant === "outline") return { borderColor: color, color };
|
|
680
|
+
return { color, borderColor: "transparent" };
|
|
681
|
+
}
|
|
663
682
|
var sizeClasses = {
|
|
664
683
|
sm: "rh-text-sm rh-px-3 rh-py-1.5",
|
|
665
684
|
md: "rh-text-sm rh-px-4 rh-py-2",
|
|
@@ -691,24 +710,28 @@ var Button = React8.forwardRef(function Button2({
|
|
|
691
710
|
...rest
|
|
692
711
|
}, ref) {
|
|
693
712
|
const isDisabled = React8__default.default.useMemo(() => disabled || loading, [disabled, loading]);
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
713
|
+
const preset = isPresetColor(color);
|
|
714
|
+
const computedStyle = React8__default.default.useMemo(() => {
|
|
715
|
+
if (preset) {
|
|
716
|
+
if (!hoverColor) return style ?? {};
|
|
717
|
+
const triplet = toRgbTriplet2(hoverColor);
|
|
718
|
+
return { ...style, [`--rh-${color}-hover`]: triplet ?? hoverColor };
|
|
719
|
+
}
|
|
720
|
+
return { ...style, ...getArbitraryColorStyle(variant, color) };
|
|
721
|
+
}, [preset, color, variant, hoverColor, style]);
|
|
699
722
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
700
723
|
"button",
|
|
701
724
|
{
|
|
702
725
|
ref,
|
|
703
726
|
disabled: isDisabled,
|
|
704
727
|
"aria-busy": loading || void 0,
|
|
705
|
-
style:
|
|
728
|
+
style: computedStyle,
|
|
706
729
|
className: [
|
|
707
730
|
"rh-inline-flex rh-items-center rh-justify-center rh-gap-2",
|
|
708
731
|
"rh-border rh-font-sans rh-font-medium",
|
|
709
732
|
"rh-transition-colors rh-duration-150",
|
|
710
733
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
|
|
711
|
-
variantColorClasses[variant][color],
|
|
734
|
+
preset ? variantColorClasses[variant][color] : "hover:rh-brightness-90",
|
|
712
735
|
sizeClasses[size],
|
|
713
736
|
radiusClasses[radius],
|
|
714
737
|
isDisabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -754,29 +777,46 @@ var Button = React8.forwardRef(function Button2({
|
|
|
754
777
|
}
|
|
755
778
|
);
|
|
756
779
|
});
|
|
780
|
+
var PRESET_COLORS2 = /* @__PURE__ */ new Set([
|
|
781
|
+
"primary",
|
|
782
|
+
"secondary",
|
|
783
|
+
"danger",
|
|
784
|
+
"warning",
|
|
785
|
+
"success",
|
|
786
|
+
"info"
|
|
787
|
+
]);
|
|
788
|
+
var isPresetColor2 = (c) => PRESET_COLORS2.has(c);
|
|
757
789
|
var variantColorClasses2 = {
|
|
758
790
|
solid: {
|
|
759
791
|
primary: "rh-bg-primary rh-text-surface rh-border-primary hover:rh-bg-primary-hover hover:rh-border-primary-hover",
|
|
792
|
+
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary hover:rh-bg-secondary-hover hover:rh-border-secondary-hover",
|
|
760
793
|
danger: "rh-bg-danger rh-text-surface rh-border-danger hover:rh-bg-danger-hover hover:rh-border-danger-hover",
|
|
761
794
|
warning: "rh-bg-warning rh-text-surface rh-border-warning hover:rh-bg-warning-hover hover:rh-border-warning-hover",
|
|
762
795
|
success: "rh-bg-success rh-text-surface rh-border-success hover:rh-bg-success-hover hover:rh-border-success-hover",
|
|
763
|
-
|
|
796
|
+
info: "rh-bg-info rh-text-surface rh-border-info hover:rh-bg-info-hover hover:rh-border-info-hover"
|
|
764
797
|
},
|
|
765
798
|
outline: {
|
|
766
799
|
primary: "rh-bg-transparent rh-text-primary rh-border-primary hover:rh-bg-primary hover:rh-text-surface",
|
|
800
|
+
secondary: "rh-bg-transparent rh-text-secondary rh-border-secondary hover:rh-bg-secondary hover:rh-text-surface",
|
|
767
801
|
danger: "rh-bg-transparent rh-text-danger rh-border-danger hover:rh-bg-danger hover:rh-text-surface",
|
|
768
802
|
warning: "rh-bg-transparent rh-text-warning rh-border-warning hover:rh-bg-warning hover:rh-text-surface",
|
|
769
803
|
success: "rh-bg-transparent rh-text-success rh-border-success hover:rh-bg-success hover:rh-text-surface",
|
|
770
|
-
|
|
804
|
+
info: "rh-bg-transparent rh-text-info rh-border-info hover:rh-bg-info hover:rh-text-surface"
|
|
771
805
|
},
|
|
772
806
|
ghost: {
|
|
773
807
|
primary: "rh-bg-transparent rh-text-primary rh-border-transparent hover:rh-bg-primary/10",
|
|
808
|
+
secondary: "rh-bg-transparent rh-text-secondary rh-border-transparent hover:rh-bg-secondary/10",
|
|
774
809
|
danger: "rh-bg-transparent rh-text-danger rh-border-transparent hover:rh-bg-danger/10",
|
|
775
810
|
warning: "rh-bg-transparent rh-text-warning rh-border-transparent hover:rh-bg-warning/10",
|
|
776
811
|
success: "rh-bg-transparent rh-text-success rh-border-transparent hover:rh-bg-success/10",
|
|
777
|
-
|
|
812
|
+
info: "rh-bg-transparent rh-text-info rh-border-transparent hover:rh-bg-info/10"
|
|
778
813
|
}
|
|
779
814
|
};
|
|
815
|
+
function getArbitraryColorStyle2(variant, color) {
|
|
816
|
+
if (variant === "solid") return { backgroundColor: color, borderColor: color, color: "#fff" };
|
|
817
|
+
if (variant === "outline") return { borderColor: color, color };
|
|
818
|
+
return { color, borderColor: "transparent" };
|
|
819
|
+
}
|
|
780
820
|
var sizeClasses2 = {
|
|
781
821
|
sm: "rh-h-8 rh-w-8 rh-text-sm",
|
|
782
822
|
md: "rh-h-10 rh-w-10 rh-text-base",
|
|
@@ -800,22 +840,29 @@ var IconButton = React8.forwardRef(function IconButton2({
|
|
|
800
840
|
loading = false,
|
|
801
841
|
disabled,
|
|
802
842
|
className = "",
|
|
843
|
+
style,
|
|
803
844
|
children,
|
|
804
845
|
...rest
|
|
805
846
|
}, ref) {
|
|
806
847
|
const isDisabled = disabled || loading;
|
|
848
|
+
const preset = isPresetColor2(color);
|
|
849
|
+
const computedStyle = React8__default.default.useMemo(
|
|
850
|
+
() => preset ? style ?? {} : { ...style, ...getArbitraryColorStyle2(variant, color) },
|
|
851
|
+
[preset, color, variant, style]
|
|
852
|
+
);
|
|
807
853
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
808
854
|
"button",
|
|
809
855
|
{
|
|
810
856
|
ref,
|
|
811
857
|
disabled: isDisabled,
|
|
812
858
|
"aria-busy": loading || void 0,
|
|
859
|
+
style: computedStyle,
|
|
813
860
|
className: [
|
|
814
861
|
"rh-inline-flex rh-items-center rh-justify-center",
|
|
815
862
|
"rh-border rh-font-sans",
|
|
816
863
|
"rh-transition-colors rh-duration-150",
|
|
817
864
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
|
|
818
|
-
variantColorClasses2[variant][color],
|
|
865
|
+
preset ? variantColorClasses2[variant][color] : "hover:rh-brightness-90",
|
|
819
866
|
sizeClasses2[size],
|
|
820
867
|
radiusClasses2[radius],
|
|
821
868
|
isDisabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -1776,21 +1823,46 @@ var Avatar = React8.forwardRef(function Avatar2({ src, alt = "", initials, size
|
|
|
1776
1823
|
}
|
|
1777
1824
|
);
|
|
1778
1825
|
});
|
|
1779
|
-
var
|
|
1780
|
-
|
|
1826
|
+
var PRESET_COLORS3 = /* @__PURE__ */ new Set([
|
|
1827
|
+
"primary",
|
|
1828
|
+
"secondary",
|
|
1829
|
+
"danger",
|
|
1830
|
+
"warning",
|
|
1831
|
+
"success",
|
|
1832
|
+
"info"
|
|
1833
|
+
]);
|
|
1834
|
+
var isPresetColor3 = (color) => PRESET_COLORS3.has(color);
|
|
1781
1835
|
var activePresetClasses = {
|
|
1782
1836
|
primary: "rh-bg-primary rh-text-surface rh-border-primary",
|
|
1783
1837
|
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary",
|
|
1784
1838
|
danger: "rh-bg-danger rh-text-surface rh-border-danger",
|
|
1785
1839
|
warning: "rh-bg-warning rh-text-surface rh-border-warning",
|
|
1786
|
-
success: "rh-bg-success rh-text-surface rh-border-success"
|
|
1840
|
+
success: "rh-bg-success rh-text-surface rh-border-success",
|
|
1841
|
+
info: "rh-bg-info rh-text-surface rh-border-info"
|
|
1787
1842
|
};
|
|
1788
1843
|
var inactivePresetClasses = {
|
|
1789
1844
|
primary: "rh-bg-primary/10 rh-text-primary rh-border-primary/30",
|
|
1790
1845
|
secondary: "rh-bg-secondary/10 rh-text-secondary rh-border-secondary/30",
|
|
1791
1846
|
danger: "rh-bg-danger/10 rh-text-danger rh-border-danger/30",
|
|
1792
1847
|
warning: "rh-bg-warning/10 rh-text-warning rh-border-warning/30",
|
|
1793
|
-
success: "rh-bg-success/10 rh-text-success rh-border-success/30"
|
|
1848
|
+
success: "rh-bg-success/10 rh-text-success rh-border-success/30",
|
|
1849
|
+
info: "rh-bg-info/10 rh-text-info rh-border-info/30"
|
|
1850
|
+
};
|
|
1851
|
+
var hoverActivePresetClasses = {
|
|
1852
|
+
primary: "hover:rh-bg-primary-hover hover:rh-border-primary-hover",
|
|
1853
|
+
secondary: "hover:rh-bg-secondary-hover hover:rh-border-secondary-hover",
|
|
1854
|
+
danger: "hover:rh-bg-danger-hover hover:rh-border-danger-hover",
|
|
1855
|
+
warning: "hover:rh-bg-warning-hover hover:rh-border-warning-hover",
|
|
1856
|
+
success: "hover:rh-bg-success-hover hover:rh-border-success-hover",
|
|
1857
|
+
info: "hover:rh-bg-info-hover hover:rh-border-info-hover"
|
|
1858
|
+
};
|
|
1859
|
+
var hoverInactivePresetClasses = {
|
|
1860
|
+
primary: "hover:rh-bg-primary/20 hover:rh-border-primary/50",
|
|
1861
|
+
secondary: "hover:rh-bg-secondary/20 hover:rh-border-secondary/50",
|
|
1862
|
+
danger: "hover:rh-bg-danger/20 hover:rh-border-danger/50",
|
|
1863
|
+
warning: "hover:rh-bg-warning/20 hover:rh-border-warning/50",
|
|
1864
|
+
success: "hover:rh-bg-success/20 hover:rh-border-success/50",
|
|
1865
|
+
info: "hover:rh-bg-info/20 hover:rh-border-info/50"
|
|
1794
1866
|
};
|
|
1795
1867
|
var sizeClasses8 = {
|
|
1796
1868
|
sm: "rh-text-xs rh-px-2 rh-py-0.5 rh-gap-1",
|
|
@@ -1815,27 +1887,34 @@ var Tag = React8.forwardRef(function Tag2({
|
|
|
1815
1887
|
leftIcon,
|
|
1816
1888
|
rightIcon,
|
|
1817
1889
|
className = "",
|
|
1890
|
+
disabled,
|
|
1818
1891
|
style,
|
|
1819
1892
|
children,
|
|
1820
1893
|
...rest
|
|
1821
1894
|
}, ref) {
|
|
1822
|
-
const preset =
|
|
1895
|
+
const preset = isPresetColor3(color);
|
|
1896
|
+
const clickable = !!rest.onClick && !disabled;
|
|
1823
1897
|
const colorClasses = preset ? active ? activePresetClasses[color] : inactivePresetClasses[color] : "";
|
|
1898
|
+
const hoverClasses = clickable && preset ? active ? hoverActivePresetClasses[color] : hoverInactivePresetClasses[color] : clickable ? "hover:rh-brightness-95" : "";
|
|
1824
1899
|
const customStyles = preset ? {} : getCustomColorStyles(color, active);
|
|
1825
1900
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1826
1901
|
"span",
|
|
1827
1902
|
{
|
|
1828
1903
|
ref,
|
|
1829
|
-
role:
|
|
1830
|
-
tabIndex:
|
|
1831
|
-
"aria-pressed":
|
|
1904
|
+
role: clickable ? "button" : void 0,
|
|
1905
|
+
tabIndex: clickable ? 0 : void 0,
|
|
1906
|
+
"aria-pressed": clickable ? active : void 0,
|
|
1907
|
+
"aria-disabled": disabled || void 0,
|
|
1832
1908
|
className: [
|
|
1833
1909
|
"rh-inline-flex rh-items-center rh-font-sans rh-font-medium rh-rounded-full",
|
|
1834
1910
|
"rh-border rh-whitespace-nowrap rh-select-none",
|
|
1835
1911
|
"rh-transition-colors rh-duration-150",
|
|
1836
|
-
|
|
1912
|
+
"rh-cursor-pointer",
|
|
1913
|
+
clickable ? "rh-cursor-pointer" : "",
|
|
1837
1914
|
sizeClasses8[size],
|
|
1838
1915
|
colorClasses,
|
|
1916
|
+
hoverClasses,
|
|
1917
|
+
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
1839
1918
|
className
|
|
1840
1919
|
].filter(Boolean).join(" "),
|
|
1841
1920
|
style: { ...customStyles, ...style },
|