@rehagro/ui 1.0.1 → 1.0.3
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 +51 -4
- package/dist/index.d.ts +51 -4
- package/dist/index.js +213 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +213 -16
- 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 +166 -10
- package/dist/native.js.map +1 -1
- package/dist/native.mjs +166 -11
- package/dist/native.mjs.map +1 -1
- package/dist/styles.css +2 -2
- package/package.json +2 -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";
|
|
@@ -85,7 +86,11 @@ type RehagroTheme = {
|
|
|
85
86
|
danger?: string;
|
|
86
87
|
dangerHover?: string;
|
|
87
88
|
warning?: string;
|
|
89
|
+
warningHover?: string;
|
|
88
90
|
success?: string;
|
|
91
|
+
successHover?: string;
|
|
92
|
+
info?: string;
|
|
93
|
+
infoHover?: string;
|
|
89
94
|
/** Semantic colors */
|
|
90
95
|
text?: string;
|
|
91
96
|
textMuted?: string;
|
|
@@ -132,6 +137,10 @@ type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
132
137
|
size?: ButtonSize;
|
|
133
138
|
/** Border radius */
|
|
134
139
|
radius?: ButtonRadius;
|
|
140
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
141
|
+
color?: ButtonColor;
|
|
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)" */
|
|
143
|
+
hoverColor?: string;
|
|
135
144
|
/** Shows loading state and disables interaction */
|
|
136
145
|
loading?: boolean;
|
|
137
146
|
/** Icon rendered to the left of children (hidden when loading) */
|
|
@@ -146,6 +155,10 @@ declare const Button: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttrib
|
|
|
146
155
|
size?: ButtonSize;
|
|
147
156
|
/** Border radius */
|
|
148
157
|
radius?: ButtonRadius;
|
|
158
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
159
|
+
color?: ButtonColor;
|
|
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)" */
|
|
161
|
+
hoverColor?: string;
|
|
149
162
|
/** Shows loading state and disables interaction */
|
|
150
163
|
loading?: boolean;
|
|
151
164
|
/** Icon rendered to the left of children (hidden when loading) */
|
|
@@ -157,7 +170,7 @@ declare const Button: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttrib
|
|
|
157
170
|
type IconButtonVariant = "solid" | "outline" | "ghost";
|
|
158
171
|
type IconButtonSize = "sm" | "md" | "lg";
|
|
159
172
|
type IconButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
160
|
-
type IconButtonColor =
|
|
173
|
+
type IconButtonColor = ButtonColor;
|
|
161
174
|
type IconButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
162
175
|
/** Visual style variant */
|
|
163
176
|
variant?: IconButtonVariant;
|
|
@@ -165,7 +178,7 @@ type IconButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
165
178
|
size?: IconButtonSize;
|
|
166
179
|
/** Border radius */
|
|
167
180
|
radius?: IconButtonRadius;
|
|
168
|
-
/** Color scheme */
|
|
181
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
169
182
|
color?: IconButtonColor;
|
|
170
183
|
/** Shows loading state and disables interaction */
|
|
171
184
|
loading?: boolean;
|
|
@@ -177,7 +190,7 @@ declare const IconButton: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAt
|
|
|
177
190
|
size?: IconButtonSize;
|
|
178
191
|
/** Border radius */
|
|
179
192
|
radius?: IconButtonRadius;
|
|
180
|
-
/** Color scheme */
|
|
193
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
181
194
|
color?: IconButtonColor;
|
|
182
195
|
/** Shows loading state and disables interaction */
|
|
183
196
|
loading?: boolean;
|
|
@@ -363,6 +376,40 @@ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttribu
|
|
|
363
376
|
variant?: AvatarVariant;
|
|
364
377
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
365
378
|
|
|
379
|
+
type TagSize = "sm" | "md" | "lg";
|
|
380
|
+
type TagProps = React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
381
|
+
/** Tag color — preset name or custom CSS color (e.g., "#c3c3c3", "rgb(...)") */
|
|
382
|
+
color?: PresetColor | (string & {});
|
|
383
|
+
/** Tag size */
|
|
384
|
+
size?: TagSize;
|
|
385
|
+
/** Active (selected) state */
|
|
386
|
+
active?: boolean;
|
|
387
|
+
/** Tag label text */
|
|
388
|
+
title: string;
|
|
389
|
+
/** Optional icon rendered on the left side */
|
|
390
|
+
leftIcon?: React$1.ReactNode;
|
|
391
|
+
/** Optional icon rendered on the right side */
|
|
392
|
+
rightIcon?: React$1.ReactNode;
|
|
393
|
+
/** Disabled state */
|
|
394
|
+
disabled?: boolean;
|
|
395
|
+
};
|
|
396
|
+
declare const Tag: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
397
|
+
/** Tag color — preset name or custom CSS color (e.g., "#c3c3c3", "rgb(...)") */
|
|
398
|
+
color?: PresetColor | (string & {});
|
|
399
|
+
/** Tag size */
|
|
400
|
+
size?: TagSize;
|
|
401
|
+
/** Active (selected) state */
|
|
402
|
+
active?: boolean;
|
|
403
|
+
/** Tag label text */
|
|
404
|
+
title: string;
|
|
405
|
+
/** Optional icon rendered on the left side */
|
|
406
|
+
leftIcon?: React$1.ReactNode;
|
|
407
|
+
/** Optional icon rendered on the right side */
|
|
408
|
+
rightIcon?: React$1.ReactNode;
|
|
409
|
+
/** Disabled state */
|
|
410
|
+
disabled?: boolean;
|
|
411
|
+
} & React$1.RefAttributes<HTMLSpanElement>>;
|
|
412
|
+
|
|
366
413
|
type ContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
|
|
367
414
|
/**
|
|
368
415
|
* Remove o padding horizontal lateral.
|
|
@@ -464,4 +511,4 @@ declare const NeutralIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
|
464
511
|
|
|
465
512
|
declare const CloseIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
466
513
|
|
|
467
|
-
export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, 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, 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 };
|
|
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";
|
|
@@ -85,7 +86,11 @@ type RehagroTheme = {
|
|
|
85
86
|
danger?: string;
|
|
86
87
|
dangerHover?: string;
|
|
87
88
|
warning?: string;
|
|
89
|
+
warningHover?: string;
|
|
88
90
|
success?: string;
|
|
91
|
+
successHover?: string;
|
|
92
|
+
info?: string;
|
|
93
|
+
infoHover?: string;
|
|
89
94
|
/** Semantic colors */
|
|
90
95
|
text?: string;
|
|
91
96
|
textMuted?: string;
|
|
@@ -132,6 +137,10 @@ type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
132
137
|
size?: ButtonSize;
|
|
133
138
|
/** Border radius */
|
|
134
139
|
radius?: ButtonRadius;
|
|
140
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
141
|
+
color?: ButtonColor;
|
|
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)" */
|
|
143
|
+
hoverColor?: string;
|
|
135
144
|
/** Shows loading state and disables interaction */
|
|
136
145
|
loading?: boolean;
|
|
137
146
|
/** Icon rendered to the left of children (hidden when loading) */
|
|
@@ -146,6 +155,10 @@ declare const Button: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttrib
|
|
|
146
155
|
size?: ButtonSize;
|
|
147
156
|
/** Border radius */
|
|
148
157
|
radius?: ButtonRadius;
|
|
158
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
159
|
+
color?: ButtonColor;
|
|
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)" */
|
|
161
|
+
hoverColor?: string;
|
|
149
162
|
/** Shows loading state and disables interaction */
|
|
150
163
|
loading?: boolean;
|
|
151
164
|
/** Icon rendered to the left of children (hidden when loading) */
|
|
@@ -157,7 +170,7 @@ declare const Button: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttrib
|
|
|
157
170
|
type IconButtonVariant = "solid" | "outline" | "ghost";
|
|
158
171
|
type IconButtonSize = "sm" | "md" | "lg";
|
|
159
172
|
type IconButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
160
|
-
type IconButtonColor =
|
|
173
|
+
type IconButtonColor = ButtonColor;
|
|
161
174
|
type IconButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
162
175
|
/** Visual style variant */
|
|
163
176
|
variant?: IconButtonVariant;
|
|
@@ -165,7 +178,7 @@ type IconButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
165
178
|
size?: IconButtonSize;
|
|
166
179
|
/** Border radius */
|
|
167
180
|
radius?: IconButtonRadius;
|
|
168
|
-
/** Color scheme */
|
|
181
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
169
182
|
color?: IconButtonColor;
|
|
170
183
|
/** Shows loading state and disables interaction */
|
|
171
184
|
loading?: boolean;
|
|
@@ -177,7 +190,7 @@ declare const IconButton: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAt
|
|
|
177
190
|
size?: IconButtonSize;
|
|
178
191
|
/** Border radius */
|
|
179
192
|
radius?: IconButtonRadius;
|
|
180
|
-
/** Color scheme */
|
|
193
|
+
/** Color scheme — preset name or any CSS color (e.g., "#c3c3c3", "red", "rgb(...)") */
|
|
181
194
|
color?: IconButtonColor;
|
|
182
195
|
/** Shows loading state and disables interaction */
|
|
183
196
|
loading?: boolean;
|
|
@@ -363,6 +376,40 @@ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttribu
|
|
|
363
376
|
variant?: AvatarVariant;
|
|
364
377
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
365
378
|
|
|
379
|
+
type TagSize = "sm" | "md" | "lg";
|
|
380
|
+
type TagProps = React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
381
|
+
/** Tag color — preset name or custom CSS color (e.g., "#c3c3c3", "rgb(...)") */
|
|
382
|
+
color?: PresetColor | (string & {});
|
|
383
|
+
/** Tag size */
|
|
384
|
+
size?: TagSize;
|
|
385
|
+
/** Active (selected) state */
|
|
386
|
+
active?: boolean;
|
|
387
|
+
/** Tag label text */
|
|
388
|
+
title: string;
|
|
389
|
+
/** Optional icon rendered on the left side */
|
|
390
|
+
leftIcon?: React$1.ReactNode;
|
|
391
|
+
/** Optional icon rendered on the right side */
|
|
392
|
+
rightIcon?: React$1.ReactNode;
|
|
393
|
+
/** Disabled state */
|
|
394
|
+
disabled?: boolean;
|
|
395
|
+
};
|
|
396
|
+
declare const Tag: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLSpanElement> & {
|
|
397
|
+
/** Tag color — preset name or custom CSS color (e.g., "#c3c3c3", "rgb(...)") */
|
|
398
|
+
color?: PresetColor | (string & {});
|
|
399
|
+
/** Tag size */
|
|
400
|
+
size?: TagSize;
|
|
401
|
+
/** Active (selected) state */
|
|
402
|
+
active?: boolean;
|
|
403
|
+
/** Tag label text */
|
|
404
|
+
title: string;
|
|
405
|
+
/** Optional icon rendered on the left side */
|
|
406
|
+
leftIcon?: React$1.ReactNode;
|
|
407
|
+
/** Optional icon rendered on the right side */
|
|
408
|
+
rightIcon?: React$1.ReactNode;
|
|
409
|
+
/** Disabled state */
|
|
410
|
+
disabled?: boolean;
|
|
411
|
+
} & React$1.RefAttributes<HTMLSpanElement>>;
|
|
412
|
+
|
|
366
413
|
type ContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
|
|
367
414
|
/**
|
|
368
415
|
* Remove o padding horizontal lateral.
|
|
@@ -464,4 +511,4 @@ declare const NeutralIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
|
464
511
|
|
|
465
512
|
declare const CloseIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
466
513
|
|
|
467
|
-
export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, 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, 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 };
|
|
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
|
@@ -19,7 +19,11 @@ var TOKEN_MAP = {
|
|
|
19
19
|
danger: { var: "--rh-danger", isColor: true },
|
|
20
20
|
dangerHover: { var: "--rh-danger-hover", isColor: true },
|
|
21
21
|
warning: { var: "--rh-warning", isColor: true },
|
|
22
|
+
warningHover: { var: "--rh-warning-hover", isColor: true },
|
|
22
23
|
success: { var: "--rh-success", isColor: true },
|
|
24
|
+
successHover: { var: "--rh-success-hover", isColor: true },
|
|
25
|
+
info: { var: "--rh-info", isColor: true },
|
|
26
|
+
infoHover: { var: "--rh-info-hover", isColor: true },
|
|
23
27
|
text: { var: "--rh-text", isColor: true },
|
|
24
28
|
textMuted: { var: "--rh-text-muted", isColor: true },
|
|
25
29
|
surface: { var: "--rh-surface", isColor: true },
|
|
@@ -619,11 +623,62 @@ function RehagroProvider({ theme, toastPosition, children }) {
|
|
|
619
623
|
}, [theme]);
|
|
620
624
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-root", style, children: /* @__PURE__ */ jsxRuntime.jsx(ToastProvider, { position: toastPosition, children }) });
|
|
621
625
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
+
function toRgbTriplet2(value) {
|
|
627
|
+
if (value.startsWith("#")) {
|
|
628
|
+
const h = value.replace("#", "");
|
|
629
|
+
const full = h.length === 3 ? h.split("").map((c) => c + c).join("") : h;
|
|
630
|
+
const r = parseInt(full.slice(0, 2), 16);
|
|
631
|
+
const g = parseInt(full.slice(2, 4), 16);
|
|
632
|
+
const b = parseInt(full.slice(4, 6), 16);
|
|
633
|
+
if ([r, g, b].some(Number.isNaN)) return void 0;
|
|
634
|
+
return `${r} ${g} ${b}`;
|
|
635
|
+
}
|
|
636
|
+
const m = value.match(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i);
|
|
637
|
+
if (m) return `${m[1]} ${m[2]} ${m[3]}`;
|
|
638
|
+
const parts = value.trim().split(/\s+/);
|
|
639
|
+
if (parts.length === 3 && parts.every((p) => !Number.isNaN(Number(p)))) return value.trim();
|
|
640
|
+
return void 0;
|
|
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);
|
|
651
|
+
var variantColorClasses = {
|
|
652
|
+
solid: {
|
|
653
|
+
primary: "rh-bg-primary rh-text-surface rh-border-primary hover:rh-bg-primary-hover hover:rh-border-primary-hover",
|
|
654
|
+
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary hover:rh-bg-secondary-hover hover:rh-border-secondary-hover",
|
|
655
|
+
danger: "rh-bg-danger rh-text-surface rh-border-danger hover:rh-bg-danger-hover hover:rh-border-danger-hover",
|
|
656
|
+
warning: "rh-bg-warning rh-text-surface rh-border-warning hover:rh-bg-warning-hover hover:rh-border-warning-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"
|
|
659
|
+
},
|
|
660
|
+
outline: {
|
|
661
|
+
primary: "rh-bg-transparent rh-text-primary rh-border-primary hover:rh-bg-primary hover:rh-text-surface",
|
|
662
|
+
secondary: "rh-bg-transparent rh-text-secondary rh-border-secondary hover:rh-bg-secondary hover:rh-text-surface",
|
|
663
|
+
danger: "rh-bg-transparent rh-text-danger rh-border-danger hover:rh-bg-danger hover:rh-text-surface",
|
|
664
|
+
warning: "rh-bg-transparent rh-text-warning rh-border-warning hover:rh-bg-warning 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"
|
|
667
|
+
},
|
|
668
|
+
ghost: {
|
|
669
|
+
primary: "rh-bg-transparent rh-text-primary rh-border-transparent hover:rh-bg-primary/10",
|
|
670
|
+
secondary: "rh-bg-transparent rh-text-secondary rh-border-transparent hover:rh-bg-secondary/10",
|
|
671
|
+
danger: "rh-bg-transparent rh-text-danger rh-border-transparent hover:rh-bg-danger/10",
|
|
672
|
+
warning: "rh-bg-transparent rh-text-warning rh-border-transparent hover:rh-bg-warning/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"
|
|
675
|
+
}
|
|
626
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
|
+
}
|
|
627
682
|
var sizeClasses = {
|
|
628
683
|
sm: "rh-text-sm rh-px-3 rh-py-1.5",
|
|
629
684
|
md: "rh-text-sm rh-px-4 rh-py-2",
|
|
@@ -643,27 +698,40 @@ var Button = React8.forwardRef(function Button2({
|
|
|
643
698
|
variant = "solid",
|
|
644
699
|
size = "md",
|
|
645
700
|
radius = "sm",
|
|
701
|
+
color = "primary",
|
|
702
|
+
hoverColor,
|
|
646
703
|
loading = false,
|
|
647
704
|
disabled,
|
|
648
705
|
leftIcon,
|
|
649
706
|
rightIcon,
|
|
650
707
|
className = "",
|
|
708
|
+
style,
|
|
651
709
|
children,
|
|
652
710
|
...rest
|
|
653
711
|
}, ref) {
|
|
654
712
|
const isDisabled = React8__default.default.useMemo(() => disabled || loading, [disabled, loading]);
|
|
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]);
|
|
655
722
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
656
723
|
"button",
|
|
657
724
|
{
|
|
658
725
|
ref,
|
|
659
726
|
disabled: isDisabled,
|
|
660
727
|
"aria-busy": loading || void 0,
|
|
728
|
+
style: computedStyle,
|
|
661
729
|
className: [
|
|
662
730
|
"rh-inline-flex rh-items-center rh-justify-center rh-gap-2",
|
|
663
731
|
"rh-border rh-font-sans rh-font-medium",
|
|
664
732
|
"rh-transition-colors rh-duration-150",
|
|
665
733
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
|
|
666
|
-
|
|
734
|
+
preset ? variantColorClasses[variant][color] : "hover:rh-brightness-90",
|
|
667
735
|
sizeClasses[size],
|
|
668
736
|
radiusClasses[radius],
|
|
669
737
|
isDisabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -709,29 +777,46 @@ var Button = React8.forwardRef(function Button2({
|
|
|
709
777
|
}
|
|
710
778
|
);
|
|
711
779
|
});
|
|
712
|
-
var
|
|
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);
|
|
789
|
+
var variantColorClasses2 = {
|
|
713
790
|
solid: {
|
|
714
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",
|
|
715
793
|
danger: "rh-bg-danger rh-text-surface rh-border-danger hover:rh-bg-danger-hover hover:rh-border-danger-hover",
|
|
716
794
|
warning: "rh-bg-warning rh-text-surface rh-border-warning hover:rh-bg-warning-hover hover:rh-border-warning-hover",
|
|
717
795
|
success: "rh-bg-success rh-text-surface rh-border-success hover:rh-bg-success-hover hover:rh-border-success-hover",
|
|
718
|
-
|
|
796
|
+
info: "rh-bg-info rh-text-surface rh-border-info hover:rh-bg-info-hover hover:rh-border-info-hover"
|
|
719
797
|
},
|
|
720
798
|
outline: {
|
|
721
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",
|
|
722
801
|
danger: "rh-bg-transparent rh-text-danger rh-border-danger hover:rh-bg-danger hover:rh-text-surface",
|
|
723
802
|
warning: "rh-bg-transparent rh-text-warning rh-border-warning hover:rh-bg-warning hover:rh-text-surface",
|
|
724
803
|
success: "rh-bg-transparent rh-text-success rh-border-success hover:rh-bg-success hover:rh-text-surface",
|
|
725
|
-
|
|
804
|
+
info: "rh-bg-transparent rh-text-info rh-border-info hover:rh-bg-info hover:rh-text-surface"
|
|
726
805
|
},
|
|
727
806
|
ghost: {
|
|
728
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",
|
|
729
809
|
danger: "rh-bg-transparent rh-text-danger rh-border-transparent hover:rh-bg-danger/10",
|
|
730
810
|
warning: "rh-bg-transparent rh-text-warning rh-border-transparent hover:rh-bg-warning/10",
|
|
731
811
|
success: "rh-bg-transparent rh-text-success rh-border-transparent hover:rh-bg-success/10",
|
|
732
|
-
|
|
812
|
+
info: "rh-bg-transparent rh-text-info rh-border-transparent hover:rh-bg-info/10"
|
|
733
813
|
}
|
|
734
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
|
+
}
|
|
735
820
|
var sizeClasses2 = {
|
|
736
821
|
sm: "rh-h-8 rh-w-8 rh-text-sm",
|
|
737
822
|
md: "rh-h-10 rh-w-10 rh-text-base",
|
|
@@ -755,22 +840,29 @@ var IconButton = React8.forwardRef(function IconButton2({
|
|
|
755
840
|
loading = false,
|
|
756
841
|
disabled,
|
|
757
842
|
className = "",
|
|
843
|
+
style,
|
|
758
844
|
children,
|
|
759
845
|
...rest
|
|
760
846
|
}, ref) {
|
|
761
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
|
+
);
|
|
762
853
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
763
854
|
"button",
|
|
764
855
|
{
|
|
765
856
|
ref,
|
|
766
857
|
disabled: isDisabled,
|
|
767
858
|
"aria-busy": loading || void 0,
|
|
859
|
+
style: computedStyle,
|
|
768
860
|
className: [
|
|
769
861
|
"rh-inline-flex rh-items-center rh-justify-center",
|
|
770
862
|
"rh-border rh-font-sans",
|
|
771
863
|
"rh-transition-colors rh-duration-150",
|
|
772
864
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
|
|
773
|
-
|
|
865
|
+
preset ? variantColorClasses2[variant][color] : "hover:rh-brightness-90",
|
|
774
866
|
sizeClasses2[size],
|
|
775
867
|
radiusClasses2[radius],
|
|
776
868
|
isDisabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -1470,7 +1562,7 @@ var Select = React8.forwardRef(
|
|
|
1470
1562
|
);
|
|
1471
1563
|
}
|
|
1472
1564
|
);
|
|
1473
|
-
var
|
|
1565
|
+
var variantClasses = {
|
|
1474
1566
|
light: "rh-bg-surface rh-text-text rh-border rh-border-border rh-shadow-md",
|
|
1475
1567
|
default: "rh-bg-primary/10 rh-text-text rh-border rh-border-primary/20 rh-shadow-md",
|
|
1476
1568
|
dark: "rh-bg-primary rh-text-surface rh-shadow-md"
|
|
@@ -1610,7 +1702,7 @@ var Tooltip = React8.forwardRef(
|
|
|
1610
1702
|
className: [
|
|
1611
1703
|
"rh-absolute rh-z-50 rh-w-max rh-max-w-xs rh-rounded-xs",
|
|
1612
1704
|
tooltipPlacementClasses[placement],
|
|
1613
|
-
|
|
1705
|
+
variantClasses[variant],
|
|
1614
1706
|
sizeClasses6[size],
|
|
1615
1707
|
className
|
|
1616
1708
|
].filter(Boolean).join(" "),
|
|
@@ -1697,7 +1789,7 @@ var imageSizeClasses = {
|
|
|
1697
1789
|
lg: "rh-w-12 rh-h-12",
|
|
1698
1790
|
xl: "rh-w-16 rh-h-16"
|
|
1699
1791
|
};
|
|
1700
|
-
var
|
|
1792
|
+
var variantClasses2 = {
|
|
1701
1793
|
circle: "rh-rounded-full",
|
|
1702
1794
|
square: "rh-rounded-sm"
|
|
1703
1795
|
};
|
|
@@ -1715,7 +1807,7 @@ var Avatar = React8.forwardRef(function Avatar2({ src, alt = "", initials, size
|
|
|
1715
1807
|
"rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
|
|
1716
1808
|
"rh-bg-primary rh-text-surface rh-font-sans rh-font-medium rh-select-none",
|
|
1717
1809
|
sizeClasses7[size],
|
|
1718
|
-
|
|
1810
|
+
variantClasses2[variant],
|
|
1719
1811
|
className
|
|
1720
1812
|
].filter(Boolean).join(" "),
|
|
1721
1813
|
...rest,
|
|
@@ -1724,13 +1816,118 @@ var Avatar = React8.forwardRef(function Avatar2({ src, alt = "", initials, size
|
|
|
1724
1816
|
{
|
|
1725
1817
|
src,
|
|
1726
1818
|
alt,
|
|
1727
|
-
className: [imageSizeClasses[size],
|
|
1819
|
+
className: [imageSizeClasses[size], variantClasses2[variant], "rh-object-cover"].join(" "),
|
|
1728
1820
|
onError: () => setImgError(true)
|
|
1729
1821
|
}
|
|
1730
1822
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: fallbackLabel })
|
|
1731
1823
|
}
|
|
1732
1824
|
);
|
|
1733
1825
|
});
|
|
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);
|
|
1835
|
+
var activePresetClasses = {
|
|
1836
|
+
primary: "rh-bg-primary rh-text-surface rh-border-primary",
|
|
1837
|
+
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary",
|
|
1838
|
+
danger: "rh-bg-danger rh-text-surface rh-border-danger",
|
|
1839
|
+
warning: "rh-bg-warning rh-text-surface rh-border-warning",
|
|
1840
|
+
success: "rh-bg-success rh-text-surface rh-border-success",
|
|
1841
|
+
info: "rh-bg-info rh-text-surface rh-border-info"
|
|
1842
|
+
};
|
|
1843
|
+
var inactivePresetClasses = {
|
|
1844
|
+
primary: "rh-bg-primary/10 rh-text-primary rh-border-primary/30",
|
|
1845
|
+
secondary: "rh-bg-secondary/10 rh-text-secondary rh-border-secondary/30",
|
|
1846
|
+
danger: "rh-bg-danger/10 rh-text-danger rh-border-danger/30",
|
|
1847
|
+
warning: "rh-bg-warning/10 rh-text-warning rh-border-warning/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"
|
|
1866
|
+
};
|
|
1867
|
+
var sizeClasses8 = {
|
|
1868
|
+
sm: "rh-text-xs rh-px-2 rh-py-0.5 rh-gap-1",
|
|
1869
|
+
md: "rh-text-sm rh-px-2.5 rh-py-1 rh-gap-1.5",
|
|
1870
|
+
lg: "rh-text-sm rh-px-3 rh-py-1.5 rh-gap-1.5"
|
|
1871
|
+
};
|
|
1872
|
+
function getCustomColorStyles(color, active) {
|
|
1873
|
+
if (active) {
|
|
1874
|
+
return { backgroundColor: color, borderColor: color, color: "#fff" };
|
|
1875
|
+
}
|
|
1876
|
+
return {
|
|
1877
|
+
backgroundColor: `color-mix(in srgb, ${color} 10%, transparent)`,
|
|
1878
|
+
borderColor: `color-mix(in srgb, ${color} 30%, transparent)`,
|
|
1879
|
+
color
|
|
1880
|
+
};
|
|
1881
|
+
}
|
|
1882
|
+
var Tag = React8.forwardRef(function Tag2({
|
|
1883
|
+
color = "primary",
|
|
1884
|
+
size = "md",
|
|
1885
|
+
active = false,
|
|
1886
|
+
title,
|
|
1887
|
+
leftIcon,
|
|
1888
|
+
rightIcon,
|
|
1889
|
+
className = "",
|
|
1890
|
+
disabled,
|
|
1891
|
+
style,
|
|
1892
|
+
children,
|
|
1893
|
+
...rest
|
|
1894
|
+
}, ref) {
|
|
1895
|
+
const preset = isPresetColor3(color);
|
|
1896
|
+
const clickable = !!rest.onClick && !disabled;
|
|
1897
|
+
const colorClasses = preset ? active ? activePresetClasses[color] : inactivePresetClasses[color] : "";
|
|
1898
|
+
const hoverClasses = clickable && preset ? active ? hoverActivePresetClasses[color] : hoverInactivePresetClasses[color] : clickable ? "hover:rh-brightness-95" : "";
|
|
1899
|
+
const customStyles = preset ? {} : getCustomColorStyles(color, active);
|
|
1900
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1901
|
+
"span",
|
|
1902
|
+
{
|
|
1903
|
+
ref,
|
|
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,
|
|
1908
|
+
className: [
|
|
1909
|
+
"rh-inline-flex rh-items-center rh-font-sans rh-font-medium rh-rounded-full",
|
|
1910
|
+
"rh-border rh-whitespace-nowrap rh-select-none",
|
|
1911
|
+
"rh-transition-colors rh-duration-150",
|
|
1912
|
+
"rh-cursor-pointer",
|
|
1913
|
+
clickable ? "rh-cursor-pointer" : "",
|
|
1914
|
+
sizeClasses8[size],
|
|
1915
|
+
colorClasses,
|
|
1916
|
+
hoverClasses,
|
|
1917
|
+
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
1918
|
+
className
|
|
1919
|
+
].filter(Boolean).join(" "),
|
|
1920
|
+
style: { ...customStyles, ...style },
|
|
1921
|
+
...rest,
|
|
1922
|
+
children: [
|
|
1923
|
+
leftIcon,
|
|
1924
|
+
title,
|
|
1925
|
+
children,
|
|
1926
|
+
rightIcon
|
|
1927
|
+
]
|
|
1928
|
+
}
|
|
1929
|
+
);
|
|
1930
|
+
});
|
|
1734
1931
|
var Container = React8.forwardRef(
|
|
1735
1932
|
function Container2({ fluid = false, className = "", children, ...rest }, ref) {
|
|
1736
1933
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1918,6 +2115,7 @@ exports.RehagroProvider = RehagroProvider;
|
|
|
1918
2115
|
exports.SearchIcon = SearchIcon;
|
|
1919
2116
|
exports.Select = Select;
|
|
1920
2117
|
exports.SuccessIcon = SuccessIcon;
|
|
2118
|
+
exports.Tag = Tag;
|
|
1921
2119
|
exports.TextInput = TextInput;
|
|
1922
2120
|
exports.Toast = Toast;
|
|
1923
2121
|
exports.ToastContainer = ToastContainer;
|