@grupor5/raya 0.2.1 → 0.2.2

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.
Files changed (180) hide show
  1. package/README.md +47 -4
  2. package/dist/atoms/avatar/index.d.mts +12 -0
  3. package/dist/atoms/avatar/index.d.ts +12 -0
  4. package/dist/atoms/avatar/index.js +99 -0
  5. package/dist/atoms/avatar/index.mjs +76 -0
  6. package/dist/atoms/badge/index.d.mts +16 -0
  7. package/dist/atoms/badge/index.d.ts +16 -0
  8. package/dist/atoms/badge/index.js +149 -0
  9. package/dist/atoms/badge/index.mjs +146 -0
  10. package/dist/atoms/button/index.d.mts +11 -0
  11. package/dist/atoms/button/index.d.ts +11 -0
  12. package/dist/atoms/button/index.js +307 -0
  13. package/dist/atoms/button/index.mjs +301 -0
  14. package/dist/atoms/checkbox/index.d.mts +6 -0
  15. package/dist/atoms/checkbox/index.d.ts +6 -0
  16. package/dist/atoms/checkbox/index.js +98 -0
  17. package/dist/atoms/checkbox/index.mjs +75 -0
  18. package/dist/atoms/input/index.d.mts +12 -0
  19. package/dist/atoms/input/index.d.ts +12 -0
  20. package/dist/atoms/input/index.js +104 -0
  21. package/dist/atoms/input/index.mjs +82 -0
  22. package/dist/atoms/label/index.d.mts +8 -0
  23. package/dist/atoms/label/index.d.ts +8 -0
  24. package/dist/atoms/label/index.js +77 -0
  25. package/dist/atoms/label/index.mjs +54 -0
  26. package/dist/atoms/radio/index.d.mts +7 -0
  27. package/dist/atoms/radio/index.d.ts +7 -0
  28. package/dist/atoms/radio/index.js +97 -0
  29. package/dist/atoms/radio/index.mjs +73 -0
  30. package/dist/atoms/switch/index.d.mts +6 -0
  31. package/dist/atoms/switch/index.d.ts +6 -0
  32. package/dist/atoms/switch/index.js +97 -0
  33. package/dist/atoms/switch/index.mjs +74 -0
  34. package/dist/atoms/tag/index.d.mts +14 -0
  35. package/dist/atoms/tag/index.d.ts +14 -0
  36. package/dist/atoms/tag/index.js +128 -0
  37. package/dist/atoms/tag/index.mjs +122 -0
  38. package/dist/atoms/textarea/index.d.mts +11 -0
  39. package/dist/atoms/textarea/index.d.ts +11 -0
  40. package/dist/atoms/textarea/index.js +125 -0
  41. package/dist/atoms/textarea/index.mjs +103 -0
  42. package/dist/atoms/typography/index.d.mts +20 -0
  43. package/dist/atoms/typography/index.d.ts +20 -0
  44. package/dist/atoms/typography/index.js +140 -0
  45. package/dist/atoms/typography/index.mjs +115 -0
  46. package/dist/hooks/index.d.mts +1 -0
  47. package/dist/hooks/index.d.ts +1 -0
  48. package/dist/hooks/index.js +17 -0
  49. package/dist/hooks/index.mjs +15 -0
  50. package/dist/hooks/use-pagination.d.mts +10 -0
  51. package/dist/hooks/use-pagination.d.ts +10 -0
  52. package/dist/hooks/use-pagination.js +54 -0
  53. package/dist/hooks/use-pagination.mjs +51 -0
  54. package/dist/hooks/use-toast.d.mts +2 -0
  55. package/dist/hooks/use-toast.d.ts +2 -0
  56. package/dist/hooks/use-toast.js +2 -0
  57. package/dist/hooks/use-toast.mjs +1 -0
  58. package/dist/hooks/useModal.d.mts +7 -0
  59. package/dist/hooks/useModal.d.ts +7 -0
  60. package/dist/hooks/useModal.js +17 -0
  61. package/dist/hooks/useModal.mjs +15 -0
  62. package/dist/index.d.mts +50 -1298
  63. package/dist/index.d.ts +50 -1298
  64. package/dist/molecules/accordion/index.d.mts +17 -0
  65. package/dist/molecules/accordion/index.d.ts +17 -0
  66. package/dist/molecules/accordion/index.js +154 -0
  67. package/dist/molecules/accordion/index.mjs +128 -0
  68. package/dist/molecules/alert/index.d.mts +14 -0
  69. package/dist/molecules/alert/index.d.ts +14 -0
  70. package/dist/molecules/alert/index.js +425 -0
  71. package/dist/molecules/alert/index.mjs +402 -0
  72. package/dist/molecules/card/index.d.mts +10 -0
  73. package/dist/molecules/card/index.d.ts +10 -0
  74. package/dist/molecules/card/index.js +128 -0
  75. package/dist/molecules/card/index.mjs +101 -0
  76. package/dist/molecules/chart/index.d.mts +80 -0
  77. package/dist/molecules/chart/index.d.ts +80 -0
  78. package/dist/molecules/chart/index.js +300 -0
  79. package/dist/molecules/chart/index.mjs +272 -0
  80. package/dist/molecules/data-table/index.d.mts +57 -0
  81. package/dist/molecules/data-table/index.d.ts +57 -0
  82. package/dist/molecules/data-table/index.js +1456 -0
  83. package/dist/molecules/data-table/index.mjs +1430 -0
  84. package/dist/molecules/date-picker/index.d.mts +12 -0
  85. package/dist/molecules/date-picker/index.d.ts +12 -0
  86. package/dist/molecules/date-picker/index.js +756 -0
  87. package/dist/molecules/date-picker/index.mjs +734 -0
  88. package/dist/molecules/dropdown/index.d.mts +21 -0
  89. package/dist/molecules/dropdown/index.d.ts +21 -0
  90. package/dist/molecules/dropdown/index.js +221 -0
  91. package/dist/molecules/dropdown/index.mjs +198 -0
  92. package/dist/molecules/form/index.d.mts +19 -0
  93. package/dist/molecules/form/index.d.ts +19 -0
  94. package/dist/molecules/form/index.js +139 -0
  95. package/dist/molecules/form/index.mjs +114 -0
  96. package/dist/molecules/pagination/index.d.mts +15 -0
  97. package/dist/molecules/pagination/index.d.ts +15 -0
  98. package/dist/molecules/pagination/index.js +605 -0
  99. package/dist/molecules/pagination/index.mjs +583 -0
  100. package/dist/molecules/progress-bar/index.d.mts +15 -0
  101. package/dist/molecules/progress-bar/index.d.ts +15 -0
  102. package/dist/molecules/progress-bar/index.js +166 -0
  103. package/dist/molecules/progress-bar/index.mjs +144 -0
  104. package/dist/molecules/select/index.d.mts +15 -0
  105. package/dist/molecules/select/index.d.ts +15 -0
  106. package/dist/molecules/select/index.js +201 -0
  107. package/dist/molecules/select/index.mjs +169 -0
  108. package/dist/molecules/stepper/index.d.mts +67 -0
  109. package/dist/molecules/stepper/index.d.ts +67 -0
  110. package/dist/molecules/stepper/index.js +287 -0
  111. package/dist/molecules/stepper/index.mjs +260 -0
  112. package/dist/molecules/tabs/index.d.mts +9 -0
  113. package/dist/molecules/tabs/index.d.ts +9 -0
  114. package/dist/molecules/tabs/index.js +112 -0
  115. package/dist/molecules/tabs/index.mjs +86 -0
  116. package/dist/tokens/badge.d.mts +39 -0
  117. package/dist/tokens/badge.d.ts +39 -0
  118. package/dist/tokens/badge.js +61 -0
  119. package/dist/tokens/badge.mjs +59 -0
  120. package/dist/tokens/buttons.d.mts +277 -0
  121. package/dist/tokens/buttons.d.ts +277 -0
  122. package/dist/tokens/buttons.js +191 -0
  123. package/dist/tokens/buttons.mjs +173 -0
  124. package/dist/tokens/colors.d.mts +65 -0
  125. package/dist/tokens/colors.d.ts +65 -0
  126. package/dist/tokens/colors.js +68 -0
  127. package/dist/tokens/colors.mjs +66 -0
  128. package/dist/tokens/effects.d.mts +124 -0
  129. package/dist/tokens/effects.d.ts +124 -0
  130. package/dist/tokens/effects.js +130 -0
  131. package/dist/tokens/effects.mjs +115 -0
  132. package/dist/tokens/grids.d.mts +331 -0
  133. package/dist/tokens/grids.d.ts +331 -0
  134. package/dist/tokens/grids.js +305 -0
  135. package/dist/tokens/grids.mjs +292 -0
  136. package/dist/tokens/icons.d.mts +134 -0
  137. package/dist/tokens/icons.d.ts +134 -0
  138. package/dist/tokens/icons.js +108 -0
  139. package/dist/tokens/icons.mjs +97 -0
  140. package/dist/tokens/index.d.mts +6 -0
  141. package/dist/tokens/index.d.ts +6 -0
  142. package/dist/tokens/index.js +775 -0
  143. package/dist/tokens/index.mjs +743 -0
  144. package/dist/tokens/progress-bar.d.mts +31 -0
  145. package/dist/tokens/progress-bar.d.ts +31 -0
  146. package/dist/tokens/progress-bar.js +70 -0
  147. package/dist/tokens/progress-bar.mjs +68 -0
  148. package/dist/tokens/spacing.d.mts +90 -0
  149. package/dist/tokens/spacing.d.ts +90 -0
  150. package/dist/tokens/spacing.js +120 -0
  151. package/dist/tokens/spacing.mjs +109 -0
  152. package/dist/tokens/stroke.d.mts +292 -0
  153. package/dist/tokens/stroke.d.ts +292 -0
  154. package/dist/tokens/stroke.js +202 -0
  155. package/dist/tokens/stroke.mjs +186 -0
  156. package/dist/tokens/tab.d.mts +31 -0
  157. package/dist/tokens/tab.d.ts +31 -0
  158. package/dist/tokens/tab.js +48 -0
  159. package/dist/tokens/tab.mjs +46 -0
  160. package/dist/tokens/tag.d.mts +53 -0
  161. package/dist/tokens/tag.d.ts +53 -0
  162. package/dist/tokens/tag.js +80 -0
  163. package/dist/tokens/tag.mjs +78 -0
  164. package/dist/tokens/typography.d.mts +394 -0
  165. package/dist/tokens/typography.d.ts +394 -0
  166. package/dist/tokens/typography.js +302 -0
  167. package/dist/tokens/typography.mjs +292 -0
  168. package/dist/utils/classNames.d.mts +3 -0
  169. package/dist/utils/classNames.d.ts +3 -0
  170. package/dist/utils/classNames.js +8 -0
  171. package/dist/utils/classNames.mjs +6 -0
  172. package/dist/utils/cn.d.mts +5 -0
  173. package/dist/utils/cn.d.ts +5 -0
  174. package/dist/utils/cn.js +11 -0
  175. package/dist/utils/cn.mjs +9 -0
  176. package/dist/utils/index.d.mts +3 -0
  177. package/dist/utils/index.d.ts +3 -0
  178. package/dist/utils/index.js +15 -0
  179. package/dist/utils/index.mjs +12 -0
  180. package/package.json +34 -1
@@ -0,0 +1,402 @@
1
+ import * as React2 from 'react';
2
+ import React2__default, { forwardRef, useMemo } from 'react';
3
+ import { cva } from 'class-variance-authority';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { clsx } from 'clsx';
6
+ import { twMerge } from 'tailwind-merge';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
8
+ import { CloseCircleIcon } from '@grupor5/raya-icons';
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __defProps = Object.defineProperties;
12
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
13
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
16
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17
+ var __spreadValues = (a, b) => {
18
+ for (var prop in b || (b = {}))
19
+ if (__hasOwnProp.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ if (__getOwnPropSymbols)
22
+ for (var prop of __getOwnPropSymbols(b)) {
23
+ if (__propIsEnum.call(b, prop))
24
+ __defNormalProp(a, prop, b[prop]);
25
+ }
26
+ return a;
27
+ };
28
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29
+ var __objRest = (source, exclude) => {
30
+ var target = {};
31
+ for (var prop in source)
32
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
33
+ target[prop] = source[prop];
34
+ if (source != null && __getOwnPropSymbols)
35
+ for (var prop of __getOwnPropSymbols(source)) {
36
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
37
+ target[prop] = source[prop];
38
+ }
39
+ return target;
40
+ };
41
+ function cn(...inputs) {
42
+ return twMerge(clsx(inputs));
43
+ }
44
+
45
+ // src/tokens/buttons.ts
46
+ var buttonSizeClasses = {
47
+ sm: {
48
+ base: "h-8 px-2 py-1 text-sm rounded-[10px]",
49
+ icon: "h-8 w-8 rounded-[10px]",
50
+ iconSize: "w-4 h-4"
51
+ },
52
+ md: {
53
+ base: "h-10 px-4 py-2 text-base rounded-xl",
54
+ icon: "h-10 w-10 rounded-xl",
55
+ iconSize: "w-5 h-5"
56
+ },
57
+ lg: {
58
+ base: "h-12 px-6 py-3 text-lg rounded-2xl",
59
+ icon: "h-12 w-12 rounded-2xl",
60
+ iconSize: "w-[22px] h-[22px]"
61
+ }
62
+ };
63
+ var buttonVariantClasses = {
64
+ // Primary variants
65
+ primary: {
66
+ primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-[hsl(var(--primary-pressed))] disabled:bg-neutral-300 disabled:text-neutral-500",
67
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90 active:bg-secondary/80 disabled:bg-neutral-300 disabled:text-neutral-500",
68
+ success: "bg-emerald-600 text-white shadow-sm hover:bg-emerald-700 active:bg-emerald-800 disabled:bg-neutral-300 disabled:text-neutral-500",
69
+ warning: "bg-amber-600 text-white shadow-sm hover:bg-amber-700 active:bg-amber-800 disabled:bg-neutral-300 disabled:text-neutral-500",
70
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80 disabled:bg-neutral-300 disabled:text-neutral-500",
71
+ neutral: "bg-neutral-700 text-white shadow-sm hover:bg-neutral-800 active:bg-neutral-900 disabled:bg-neutral-300 disabled:text-neutral-500"
72
+ },
73
+ // Secondary variants (outlined)
74
+ secondary: {
75
+ primary: "border border-primary text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
76
+ secondary: "border border-secondary text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
77
+ success: "border border-emerald-600 text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
78
+ warning: "border border-amber-600 text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
79
+ destructive: "border border-destructive text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
80
+ neutral: "border border-neutral-700 text-neutral-700 bg-transparent hover:bg-neutral-50 active:bg-neutral-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent"
81
+ },
82
+ // Ghost variants (text only)
83
+ ghost: {
84
+ primary: "text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:text-neutral-500 disabled:bg-transparent",
85
+ secondary: "text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:text-neutral-500 disabled:bg-transparent",
86
+ success: "text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:text-neutral-500 disabled:bg-transparent",
87
+ warning: "text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:text-neutral-500 disabled:bg-transparent",
88
+ destructive: "text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:text-neutral-500 disabled:bg-transparent",
89
+ neutral: "text-neutral-700 bg-transparent hover:bg-neutral-100 active:bg-neutral-200 disabled:text-neutral-500 disabled:bg-transparent"
90
+ }
91
+ };
92
+ var buttonBaseClasses = "inline-flex items-center justify-center gap-2 whitespace-nowrap font-regular transition-all duration-200 focus-visible:outline-none disabled:pointer-events-none disabled:cursor-not-allowed focus-visible:border-2 focus-visible:border-[--stroke-color-focus-border]";
93
+ var buttonLoadingClasses = {
94
+ spinner: "animate-spin",
95
+ container: "flex items-center justify-center gap-2",
96
+ text: "opacity-70"
97
+ };
98
+ var getButtonSizeClasses = (size, isIcon) => {
99
+ return isIcon ? buttonSizeClasses[size].icon : buttonSizeClasses[size].base;
100
+ };
101
+ var getButtonVariantClasses = (variant, color) => {
102
+ var _a;
103
+ if (variant === "icon") {
104
+ return buttonVariantClasses.ghost[color];
105
+ }
106
+ return ((_a = buttonVariantClasses[variant]) == null ? void 0 : _a[color]) || "";
107
+ };
108
+ var getButtonIconSize = (size) => {
109
+ return buttonSizeClasses[size].iconSize;
110
+ };
111
+ var defaultButtonConfig = {
112
+ variant: "primary",
113
+ size: "md",
114
+ color: "primary",
115
+ type: "button"
116
+ };
117
+ var LoadingSpinner = ({
118
+ size,
119
+ className
120
+ }) => {
121
+ const sizeClasses = {
122
+ sm: "w-4 h-4",
123
+ md: "w-5 h-5",
124
+ lg: "w-6 h-6"
125
+ };
126
+ return /* @__PURE__ */ jsx("div", { className: cn(buttonLoadingClasses.spinner, sizeClasses[size], className), children: /* @__PURE__ */ jsxs("svg", { fill: "none", viewBox: "0 0 24 24", className: "w-full h-full", children: [
127
+ /* @__PURE__ */ jsx(
128
+ "circle",
129
+ {
130
+ className: "opacity-25",
131
+ cx: "12",
132
+ cy: "12",
133
+ r: "10",
134
+ stroke: "currentColor"
135
+ }
136
+ ),
137
+ /* @__PURE__ */ jsx(
138
+ "path",
139
+ {
140
+ className: "opacity-75",
141
+ fill: "currentColor",
142
+ d: "m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
143
+ }
144
+ )
145
+ ] }) });
146
+ };
147
+ var Button = forwardRef((_a, ref) => {
148
+ var _b = _a, {
149
+ variant = defaultButtonConfig.variant,
150
+ size = defaultButtonConfig.size,
151
+ color = defaultButtonConfig.color,
152
+ disabled = false,
153
+ loading = false,
154
+ loadingText,
155
+ icon,
156
+ iconLeft,
157
+ iconRight,
158
+ className,
159
+ children,
160
+ type = defaultButtonConfig.type,
161
+ "aria-label": ariaLabel,
162
+ "aria-describedby": ariaDescribedBy,
163
+ asChild = false,
164
+ onClick
165
+ } = _b, props = __objRest(_b, [
166
+ "variant",
167
+ "size",
168
+ "color",
169
+ "disabled",
170
+ "loading",
171
+ "loadingText",
172
+ "icon",
173
+ "iconLeft",
174
+ "iconRight",
175
+ "className",
176
+ "children",
177
+ "type",
178
+ "aria-label",
179
+ "aria-describedby",
180
+ "asChild",
181
+ "onClick"
182
+ ]);
183
+ const isIconOnly = variant === "icon" || !!(!children && (icon || iconLeft || iconRight));
184
+ const buttonClasses = useMemo(() => {
185
+ const sizeClasses = getButtonSizeClasses(size, isIconOnly);
186
+ const variantClasses = getButtonVariantClasses(variant, color);
187
+ return cn(
188
+ buttonBaseClasses,
189
+ sizeClasses,
190
+ variantClasses,
191
+ className
192
+ );
193
+ }, [variant, size, color, isIconOnly, className]);
194
+ const buttonContent = useMemo(() => {
195
+ if (loading) {
196
+ return /* @__PURE__ */ jsxs("div", { className: buttonLoadingClasses.container, children: [
197
+ /* @__PURE__ */ jsx(LoadingSpinner, { size }),
198
+ loadingText && /* @__PURE__ */ jsx("span", { className: buttonLoadingClasses.text, children: loadingText })
199
+ ] });
200
+ }
201
+ const iconSizeClass = getButtonIconSize(size);
202
+ const renderIcon = (iconNode) => {
203
+ if (React2__default.isValidElement(iconNode)) {
204
+ return React2__default.cloneElement(iconNode, {
205
+ className: cn(iconSizeClass, iconNode.props.className),
206
+ "aria-hidden": true
207
+ });
208
+ }
209
+ return iconNode;
210
+ };
211
+ if (isIconOnly) {
212
+ return renderIcon(icon || iconLeft || iconRight);
213
+ }
214
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center justify-center gap-2", children: [
215
+ iconLeft && renderIcon(iconLeft),
216
+ children && /* @__PURE__ */ jsx("span", { children }),
217
+ iconRight && renderIcon(iconRight)
218
+ ] });
219
+ }, [loading, loadingText, isIconOnly, icon, iconLeft, iconRight, children, size]);
220
+ const accessibilityProps = useMemo(() => {
221
+ const props2 = {};
222
+ if (isIconOnly && !ariaLabel) {
223
+ console.warn("Icon-only buttons should have an aria-label for accessibility");
224
+ }
225
+ if (ariaLabel) {
226
+ props2["aria-label"] = ariaLabel;
227
+ }
228
+ if (ariaDescribedBy) {
229
+ props2["aria-describedby"] = ariaDescribedBy;
230
+ }
231
+ if (loading) {
232
+ props2["aria-busy"] = true;
233
+ props2["aria-disabled"] = true;
234
+ }
235
+ if (disabled || loading) {
236
+ props2["aria-disabled"] = true;
237
+ }
238
+ return props2;
239
+ }, [isIconOnly, ariaLabel, ariaDescribedBy, loading, disabled]);
240
+ const handleClick = (event) => {
241
+ if (disabled || loading) {
242
+ event.preventDefault();
243
+ return;
244
+ }
245
+ onClick == null ? void 0 : onClick(event);
246
+ };
247
+ if (asChild) {
248
+ return /* @__PURE__ */ jsx(
249
+ Slot,
250
+ __spreadProps(__spreadValues(__spreadValues({
251
+ ref,
252
+ className: buttonClasses
253
+ }, accessibilityProps), props), {
254
+ children
255
+ })
256
+ );
257
+ }
258
+ return /* @__PURE__ */ jsxs(
259
+ "button",
260
+ __spreadProps(__spreadValues(__spreadValues({
261
+ ref,
262
+ type,
263
+ className: buttonClasses,
264
+ disabled: disabled || loading,
265
+ onClick: handleClick
266
+ }, accessibilityProps), props), {
267
+ children: [
268
+ loading && /* @__PURE__ */ jsxs(
269
+ "svg",
270
+ {
271
+ className: "animate-spin -ml-1 mr-3 h-5 w-5 text-white",
272
+ xmlns: "http://www.w3.org/2000/svg",
273
+ fill: "none",
274
+ viewBox: "0 0 24 24",
275
+ children: [
276
+ /* @__PURE__ */ jsx(
277
+ "circle",
278
+ {
279
+ className: "opacity-25",
280
+ cx: "12",
281
+ cy: "12",
282
+ r: "10",
283
+ stroke: "currentColor"
284
+ }
285
+ ),
286
+ /* @__PURE__ */ jsx(
287
+ "path",
288
+ {
289
+ className: "opacity-75",
290
+ fill: "currentColor",
291
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
292
+ }
293
+ )
294
+ ]
295
+ }
296
+ ),
297
+ loading && loadingText ? /* @__PURE__ */ jsx("span", { className: buttonLoadingClasses.text, children: loadingText }) : buttonContent
298
+ ]
299
+ })
300
+ );
301
+ });
302
+ Button.displayName = "Button";
303
+ var alertVariants = cva(
304
+ "relative w-full rounded-lg px-6 py-2 flex items-center justify-between",
305
+ {
306
+ variants: {
307
+ variant: {
308
+ default: "bg-background",
309
+ danger: "bg-red-100",
310
+ success: "bg-green-100",
311
+ warning: "bg-yellow-100"
312
+ }
313
+ },
314
+ defaultVariants: {
315
+ variant: "default"
316
+ }
317
+ }
318
+ );
319
+ var AlertContext = React2.createContext(null);
320
+ var useAlertContext = () => {
321
+ const context = React2.useContext(AlertContext);
322
+ if (!context) {
323
+ throw new Error("useAlertContext must be used inside an Alert");
324
+ }
325
+ return context;
326
+ };
327
+ var Alert = React2.forwardRef((_a, ref) => {
328
+ var _b = _a, { className, variant, children, isClosable, actions } = _b, props = __objRest(_b, ["className", "variant", "children", "isClosable", "actions"]);
329
+ const [isVisible, setIsVisible] = React2.useState(true);
330
+ if (!isVisible) {
331
+ return null;
332
+ }
333
+ return /* @__PURE__ */ jsx(AlertContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsxs(
334
+ "div",
335
+ __spreadProps(__spreadValues({
336
+ ref,
337
+ role: "alert",
338
+ className: cn(alertVariants({ variant }), className)
339
+ }, props), {
340
+ children: [
341
+ /* @__PURE__ */ jsx("div", { className: "flex-grow", children }),
342
+ isClosable ? /* @__PURE__ */ jsx(
343
+ Button,
344
+ {
345
+ size: "sm",
346
+ variant: "ghost",
347
+ onClick: () => setIsVisible(false),
348
+ "aria-label": "Cerrar",
349
+ className: "border p-2 !rounded-[8px] border-primary-500 text-primary-1200 h-6 w-6",
350
+ children: /* @__PURE__ */ jsx(CloseCircleIcon, { size: 16 })
351
+ }
352
+ ) : actions
353
+ ]
354
+ })
355
+ ) });
356
+ });
357
+ Alert.displayName = "Alert";
358
+ var AlertTitle = React2.forwardRef((_a, ref) => {
359
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
360
+ const { variant } = useAlertContext();
361
+ return /* @__PURE__ */ jsx(
362
+ "h5",
363
+ __spreadValues({
364
+ ref,
365
+ className: cn(
366
+ "mb-1 font-medium leading-none tracking-tight",
367
+ {
368
+ "text-red-600": variant === "danger",
369
+ "text-primary-1200": ["success", "warning"].includes(
370
+ variant
371
+ ),
372
+ "text-foreground": variant === "default" || !variant
373
+ },
374
+ className
375
+ )
376
+ }, props)
377
+ );
378
+ });
379
+ AlertTitle.displayName = "AlertTitle";
380
+ var AlertDescription = React2.forwardRef((_a, ref) => {
381
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
382
+ const { variant } = useAlertContext();
383
+ return /* @__PURE__ */ jsx(
384
+ "div",
385
+ __spreadValues({
386
+ ref,
387
+ className: cn(
388
+ "text-sm [&_p]:leading-relaxed",
389
+ {
390
+ "text-primary-1200": ["success", "warning", "danger"].includes(
391
+ variant
392
+ ),
393
+ "text-foreground": variant === "default" || !variant
394
+ },
395
+ className
396
+ )
397
+ }, props)
398
+ );
399
+ });
400
+ AlertDescription.displayName = "AlertDescription";
401
+
402
+ export { Alert, AlertDescription, AlertTitle };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+
3
+ declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
6
+ declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
9
+
10
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+
3
+ declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
6
+ declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
9
+
10
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -0,0 +1,128 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var clsx = require('clsx');
5
+ var tailwindMerge = require('tailwind-merge');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
+
28
+ var __defProp = Object.defineProperty;
29
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
30
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
31
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
32
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
33
+ var __spreadValues = (a, b) => {
34
+ for (var prop in b || (b = {}))
35
+ if (__hasOwnProp.call(b, prop))
36
+ __defNormalProp(a, prop, b[prop]);
37
+ if (__getOwnPropSymbols)
38
+ for (var prop of __getOwnPropSymbols(b)) {
39
+ if (__propIsEnum.call(b, prop))
40
+ __defNormalProp(a, prop, b[prop]);
41
+ }
42
+ return a;
43
+ };
44
+ var __objRest = (source, exclude) => {
45
+ var target = {};
46
+ for (var prop in source)
47
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
48
+ target[prop] = source[prop];
49
+ if (source != null && __getOwnPropSymbols)
50
+ for (var prop of __getOwnPropSymbols(source)) {
51
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
52
+ target[prop] = source[prop];
53
+ }
54
+ return target;
55
+ };
56
+ function cn(...inputs) {
57
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
58
+ }
59
+ var Card = React__namespace.forwardRef((_a, ref) => {
60
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
61
+ return /* @__PURE__ */ jsxRuntime.jsx(
62
+ "div",
63
+ __spreadValues({
64
+ ref,
65
+ className: cn(
66
+ "rounded-xl border bg-card text-card-foreground shadow",
67
+ className
68
+ )
69
+ }, props)
70
+ );
71
+ });
72
+ Card.displayName = "Card";
73
+ var CardHeader = React__namespace.forwardRef((_a, ref) => {
74
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
75
+ return /* @__PURE__ */ jsxRuntime.jsx(
76
+ "div",
77
+ __spreadValues({
78
+ ref,
79
+ className: cn("flex flex-col space-y-1.5 p-6", className)
80
+ }, props)
81
+ );
82
+ });
83
+ CardHeader.displayName = "CardHeader";
84
+ var CardTitle = React__namespace.forwardRef((_a, ref) => {
85
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
86
+ return /* @__PURE__ */ jsxRuntime.jsx(
87
+ "div",
88
+ __spreadValues({
89
+ ref,
90
+ className: cn("font-semibold leading-none tracking-tight", className)
91
+ }, props)
92
+ );
93
+ });
94
+ CardTitle.displayName = "CardTitle";
95
+ var CardDescription = React__namespace.forwardRef((_a, ref) => {
96
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
97
+ return /* @__PURE__ */ jsxRuntime.jsx(
98
+ "div",
99
+ __spreadValues({
100
+ ref,
101
+ className: cn("text-sm text-muted-foreground", className)
102
+ }, props)
103
+ );
104
+ });
105
+ CardDescription.displayName = "CardDescription";
106
+ var CardContent = React__namespace.forwardRef((_a, ref) => {
107
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
108
+ return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadValues({ ref, className: cn("p-6 pt-0", className) }, props));
109
+ });
110
+ CardContent.displayName = "CardContent";
111
+ var CardFooter = React__namespace.forwardRef((_a, ref) => {
112
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
113
+ return /* @__PURE__ */ jsxRuntime.jsx(
114
+ "div",
115
+ __spreadValues({
116
+ ref,
117
+ className: cn("flex items-center p-6 pt-0", className)
118
+ }, props)
119
+ );
120
+ });
121
+ CardFooter.displayName = "CardFooter";
122
+
123
+ exports.Card = Card;
124
+ exports.CardContent = CardContent;
125
+ exports.CardDescription = CardDescription;
126
+ exports.CardFooter = CardFooter;
127
+ exports.CardHeader = CardHeader;
128
+ exports.CardTitle = CardTitle;
@@ -0,0 +1,101 @@
1
+ import * as React from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { twMerge } from 'tailwind-merge';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __objRest = (source, exclude) => {
23
+ var target = {};
24
+ for (var prop in source)
25
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
26
+ target[prop] = source[prop];
27
+ if (source != null && __getOwnPropSymbols)
28
+ for (var prop of __getOwnPropSymbols(source)) {
29
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
30
+ target[prop] = source[prop];
31
+ }
32
+ return target;
33
+ };
34
+ function cn(...inputs) {
35
+ return twMerge(clsx(inputs));
36
+ }
37
+ var Card = React.forwardRef((_a, ref) => {
38
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
39
+ return /* @__PURE__ */ jsx(
40
+ "div",
41
+ __spreadValues({
42
+ ref,
43
+ className: cn(
44
+ "rounded-xl border bg-card text-card-foreground shadow",
45
+ className
46
+ )
47
+ }, props)
48
+ );
49
+ });
50
+ Card.displayName = "Card";
51
+ var CardHeader = React.forwardRef((_a, ref) => {
52
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
53
+ return /* @__PURE__ */ jsx(
54
+ "div",
55
+ __spreadValues({
56
+ ref,
57
+ className: cn("flex flex-col space-y-1.5 p-6", className)
58
+ }, props)
59
+ );
60
+ });
61
+ CardHeader.displayName = "CardHeader";
62
+ var CardTitle = React.forwardRef((_a, ref) => {
63
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
64
+ return /* @__PURE__ */ jsx(
65
+ "div",
66
+ __spreadValues({
67
+ ref,
68
+ className: cn("font-semibold leading-none tracking-tight", className)
69
+ }, props)
70
+ );
71
+ });
72
+ CardTitle.displayName = "CardTitle";
73
+ var CardDescription = React.forwardRef((_a, ref) => {
74
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
75
+ return /* @__PURE__ */ jsx(
76
+ "div",
77
+ __spreadValues({
78
+ ref,
79
+ className: cn("text-sm text-muted-foreground", className)
80
+ }, props)
81
+ );
82
+ });
83
+ CardDescription.displayName = "CardDescription";
84
+ var CardContent = React.forwardRef((_a, ref) => {
85
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
86
+ return /* @__PURE__ */ jsx("div", __spreadValues({ ref, className: cn("p-6 pt-0", className) }, props));
87
+ });
88
+ CardContent.displayName = "CardContent";
89
+ var CardFooter = React.forwardRef((_a, ref) => {
90
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
91
+ return /* @__PURE__ */ jsx(
92
+ "div",
93
+ __spreadValues({
94
+ ref,
95
+ className: cn("flex items-center p-6 pt-0", className)
96
+ }, props)
97
+ );
98
+ });
99
+ CardFooter.displayName = "CardFooter";
100
+
101
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };