analytica-frontend-lib 1.0.22 → 1.0.24
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/chunk-CETSS3RA.mjs +52 -0
- package/dist/chunk-GSEO6POW.mjs +93 -0
- package/dist/chunk-IB4IJ3GF.mjs +60 -0
- package/dist/chunk-IH5TEC64.mjs +35 -0
- package/dist/chunk-JNPCNN67.mjs +86 -0
- package/dist/chunk-KT6HNGRV.mjs +241 -0
- package/dist/chunk-LYOJCBOM.mjs +195 -0
- package/dist/chunk-MI5FIRHM.mjs +75 -0
- package/dist/chunk-NWGRQN6R.mjs +108 -0
- package/dist/chunk-QODEDLAX.mjs +142 -0
- package/dist/chunk-QOFMTSHE.mjs +44 -0
- package/dist/chunk-RPYPJ5O5.mjs +55 -0
- package/dist/chunk-SESX5OEP.mjs +57 -0
- package/dist/chunk-TT3VCQGR.mjs +53 -0
- package/dist/chunk-WIOCQOM7.mjs +20 -0
- package/dist/client-components.d.mts +9 -0
- package/dist/client-components.d.ts +9 -0
- package/dist/client-components.js +755 -0
- package/dist/client-components.mjs +39 -0
- package/dist/components/Alert/Alert.d.mts +13 -0
- package/dist/components/Alert/Alert.d.ts +13 -0
- package/dist/components/Alert/Alert.js +158 -0
- package/dist/components/Alert/Alert.mjs +7 -0
- package/dist/components/Badge/Badge.d.mts +47 -0
- package/dist/components/Badge/Badge.d.ts +47 -0
- package/dist/components/Badge/Badge.js +117 -0
- package/dist/components/Badge/Badge.mjs +6 -0
- package/dist/components/Button/Button.d.mts +46 -0
- package/dist/components/Button/Button.d.ts +46 -0
- package/dist/components/Button/Button.js +84 -0
- package/dist/components/Button/Button.mjs +6 -0
- package/dist/components/CheckBox/CheckBox.d.mts +74 -0
- package/dist/components/CheckBox/CheckBox.d.ts +74 -0
- package/dist/components/CheckBox/CheckBox.js +264 -0
- package/dist/components/CheckBox/CheckBox.mjs +8 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.mts +29 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +29 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +262 -0
- package/dist/components/DropdownMenu/DropdownMenu.mjs +17 -0
- package/dist/components/IconButton/IconButton.d.mts +77 -0
- package/dist/components/IconButton/IconButton.d.ts +77 -0
- package/dist/components/IconButton/IconButton.js +79 -0
- package/dist/components/IconButton/IconButton.mjs +6 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.d.mts +35 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.d.ts +35 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.js +68 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.mjs +6 -0
- package/dist/components/NavButton/NavButton.d.mts +58 -0
- package/dist/components/NavButton/NavButton.d.ts +58 -0
- package/dist/components/NavButton/NavButton.js +76 -0
- package/dist/components/NavButton/NavButton.mjs +6 -0
- package/dist/components/SelectionButton/SelectionButton.d.mts +58 -0
- package/dist/components/SelectionButton/SelectionButton.d.ts +58 -0
- package/dist/components/SelectionButton/SelectionButton.js +81 -0
- package/dist/components/SelectionButton/SelectionButton.mjs +6 -0
- package/dist/components/Table/Table.d.mts +17 -0
- package/dist/components/Table/Table.d.ts +17 -0
- package/dist/components/Table/Table.js +139 -0
- package/dist/components/Table/Table.mjs +20 -0
- package/dist/components/Text/Text.d.mts +59 -0
- package/dist/components/Text/Text.d.ts +59 -0
- package/dist/components/Text/Text.js +77 -0
- package/dist/components/Text/Text.mjs +6 -0
- package/dist/components/TextArea/TextArea.d.mts +69 -0
- package/dist/components/TextArea/TextArea.d.ts +69 -0
- package/dist/components/TextArea/TextArea.js +211 -0
- package/dist/components/TextArea/TextArea.mjs +8 -0
- package/dist/components/Toast/Toast.d.mts +17 -0
- package/dist/components/Toast/Toast.d.ts +17 -0
- package/dist/components/Toast/Toast.js +100 -0
- package/dist/components/Toast/Toast.mjs +7 -0
- package/dist/components/Toast/utils/ToastStore.d.mts +19 -0
- package/dist/components/Toast/utils/ToastStore.d.ts +19 -0
- package/dist/components/Toast/utils/ToastStore.js +44 -0
- package/dist/components/Toast/utils/ToastStore.mjs +6 -0
- package/dist/components/Toast/utils/Toaster.d.mts +11 -0
- package/dist/components/Toast/utils/Toaster.d.ts +11 -0
- package/dist/components/Toast/utils/Toaster.js +145 -0
- package/dist/components/Toast/utils/Toaster.mjs +11 -0
- package/dist/index.d.mts +168 -355
- package/dist/index.d.ts +168 -355
- package/dist/index.js +341 -936
- package/dist/index.mjs +340 -941
- package/dist/server-components.d.mts +11 -0
- package/dist/server-components.d.ts +11 -0
- package/dist/server-components.js +629 -0
- package/dist/server-components.mjs +52 -0
- package/package.json +76 -3
package/dist/index.mjs
CHANGED
|
@@ -1,157 +1,5 @@
|
|
|
1
|
-
// src/components/Button/Button.tsx
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
var VARIANT_ACTION_CLASSES = {
|
|
4
|
-
solid: {
|
|
5
|
-
primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
6
|
-
positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
7
|
-
negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
8
|
-
},
|
|
9
|
-
outline: {
|
|
10
|
-
primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
11
|
-
positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
12
|
-
negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
13
|
-
},
|
|
14
|
-
link: {
|
|
15
|
-
primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
16
|
-
positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
17
|
-
negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var SIZE_CLASSES = {
|
|
21
|
-
"extra-small": "text-xs px-3.5 py-2",
|
|
22
|
-
small: "text-sm px-4 py-2.5",
|
|
23
|
-
medium: "text-md px-5 py-2.5",
|
|
24
|
-
large: "text-lg px-6 py-3",
|
|
25
|
-
"extra-large": "text-lg px-7 py-3.5"
|
|
26
|
-
};
|
|
27
|
-
var Button = ({
|
|
28
|
-
children,
|
|
29
|
-
iconLeft,
|
|
30
|
-
iconRight,
|
|
31
|
-
size = "medium",
|
|
32
|
-
variant = "solid",
|
|
33
|
-
action = "primary",
|
|
34
|
-
className = "",
|
|
35
|
-
disabled,
|
|
36
|
-
type = "button",
|
|
37
|
-
...props
|
|
38
|
-
}) => {
|
|
39
|
-
const sizeClasses = SIZE_CLASSES[size];
|
|
40
|
-
const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
|
|
41
|
-
const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
|
|
42
|
-
return /* @__PURE__ */ jsxs(
|
|
43
|
-
"button",
|
|
44
|
-
{
|
|
45
|
-
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
46
|
-
disabled,
|
|
47
|
-
type,
|
|
48
|
-
...props,
|
|
49
|
-
children: [
|
|
50
|
-
iconLeft && /* @__PURE__ */ jsx("span", { className: "mr-2 flex items-center", children: iconLeft }),
|
|
51
|
-
children,
|
|
52
|
-
iconRight && /* @__PURE__ */ jsx("span", { className: "ml-2 flex items-center", children: iconRight })
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// src/components/IconRoundedButton/IconRoundedButton.tsx
|
|
59
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
60
|
-
var IconRoundedButton = ({
|
|
61
|
-
icon,
|
|
62
|
-
className = "",
|
|
63
|
-
disabled,
|
|
64
|
-
...props
|
|
65
|
-
}) => {
|
|
66
|
-
const baseClasses = [
|
|
67
|
-
"inline-flex",
|
|
68
|
-
"items-center",
|
|
69
|
-
"justify-center",
|
|
70
|
-
"w-8",
|
|
71
|
-
"h-8",
|
|
72
|
-
"rounded-full",
|
|
73
|
-
"cursor-pointer",
|
|
74
|
-
"border",
|
|
75
|
-
"border-background-200",
|
|
76
|
-
"bg-background",
|
|
77
|
-
"text-text-950",
|
|
78
|
-
"hover:shadow-hard-shadow-1",
|
|
79
|
-
"focus-visible:outline-none",
|
|
80
|
-
"focus-visible:shadow-hard-shadow-1",
|
|
81
|
-
"focus-visible:ring-2",
|
|
82
|
-
"focus-visible:ring-indicator-info",
|
|
83
|
-
"focus-visible:ring-offset-0",
|
|
84
|
-
"disabled:opacity-50",
|
|
85
|
-
"disabled:cursor-not-allowed"
|
|
86
|
-
].join(" ");
|
|
87
|
-
return /* @__PURE__ */ jsx2(
|
|
88
|
-
"button",
|
|
89
|
-
{
|
|
90
|
-
type: "button",
|
|
91
|
-
className: `${baseClasses} ${className}`,
|
|
92
|
-
disabled,
|
|
93
|
-
...props,
|
|
94
|
-
children: /* @__PURE__ */ jsx2("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// src/components/SelectionButton/SelectionButton.tsx
|
|
100
|
-
import { forwardRef } from "react";
|
|
101
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
102
|
-
var SelectionButton = forwardRef(
|
|
103
|
-
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
104
|
-
const baseClasses = [
|
|
105
|
-
"inline-flex",
|
|
106
|
-
"items-center",
|
|
107
|
-
"justify-start",
|
|
108
|
-
"gap-2",
|
|
109
|
-
"p-4",
|
|
110
|
-
"rounded-xl",
|
|
111
|
-
"cursor-pointer",
|
|
112
|
-
"border",
|
|
113
|
-
"border-border-50",
|
|
114
|
-
"bg-background",
|
|
115
|
-
"text-sm",
|
|
116
|
-
"text-text-700",
|
|
117
|
-
"font-bold",
|
|
118
|
-
"shadow-soft-shadow-1",
|
|
119
|
-
"hover:bg-background-100",
|
|
120
|
-
"focus-visible:outline-none",
|
|
121
|
-
"focus-visible:ring-2",
|
|
122
|
-
"focus-visible:ring-indicator-info",
|
|
123
|
-
"focus-visible:ring-offset-0",
|
|
124
|
-
"focus-visible:shadow-none",
|
|
125
|
-
"active:ring-2",
|
|
126
|
-
"active:ring-primary-950",
|
|
127
|
-
"active:ring-offset-0",
|
|
128
|
-
"active:shadow-none",
|
|
129
|
-
"disabled:opacity-50",
|
|
130
|
-
"disabled:cursor-not-allowed"
|
|
131
|
-
];
|
|
132
|
-
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
133
|
-
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
134
|
-
return /* @__PURE__ */ jsxs2(
|
|
135
|
-
"button",
|
|
136
|
-
{
|
|
137
|
-
ref,
|
|
138
|
-
type: "button",
|
|
139
|
-
className: `${allClasses} ${className}`,
|
|
140
|
-
disabled,
|
|
141
|
-
"aria-pressed": selected,
|
|
142
|
-
...props,
|
|
143
|
-
children: [
|
|
144
|
-
/* @__PURE__ */ jsx3("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
145
|
-
/* @__PURE__ */ jsx3("span", { children: label })
|
|
146
|
-
]
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
SelectionButton.displayName = "SelectionButton";
|
|
152
|
-
|
|
153
1
|
// src/components/Text/Text.tsx
|
|
154
|
-
import { jsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
155
3
|
var Text = ({
|
|
156
4
|
children,
|
|
157
5
|
size = "md",
|
|
@@ -190,7 +38,7 @@ var Text = ({
|
|
|
190
38
|
weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
|
|
191
39
|
const baseClasses = "font-primary";
|
|
192
40
|
const Component = as ?? "p";
|
|
193
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
194
42
|
Component,
|
|
195
43
|
{
|
|
196
44
|
className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
|
|
@@ -200,144 +48,66 @@ var Text = ({
|
|
|
200
48
|
);
|
|
201
49
|
};
|
|
202
50
|
|
|
203
|
-
// src/components/
|
|
204
|
-
import {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
var SIZE_CLASSES2 = {
|
|
211
|
-
small: {
|
|
212
|
-
container: "w-72",
|
|
213
|
-
// 288px width
|
|
214
|
-
textarea: "h-24 text-sm",
|
|
215
|
-
// 96px height, 14px font
|
|
216
|
-
textSize: "sm"
|
|
217
|
-
},
|
|
218
|
-
medium: {
|
|
219
|
-
container: "w-72",
|
|
220
|
-
// 288px width
|
|
221
|
-
textarea: "h-24 text-base",
|
|
222
|
-
// 96px height, 16px font
|
|
223
|
-
textSize: "md"
|
|
51
|
+
// src/components/Button/Button.tsx
|
|
52
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
53
|
+
var VARIANT_ACTION_CLASSES = {
|
|
54
|
+
solid: {
|
|
55
|
+
primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
56
|
+
positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
57
|
+
negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
224
58
|
},
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
// 96px height, 18px font
|
|
230
|
-
textSize: "lg"
|
|
59
|
+
outline: {
|
|
60
|
+
primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
61
|
+
positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
62
|
+
negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
231
63
|
},
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
// 96px height, 20px font
|
|
237
|
-
textSize: "xl"
|
|
64
|
+
link: {
|
|
65
|
+
primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
66
|
+
positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
67
|
+
negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
238
68
|
}
|
|
239
69
|
};
|
|
240
|
-
var
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
hovered: {
|
|
248
|
-
base: "border-border-400 bg-background text-text-600",
|
|
249
|
-
hover: "",
|
|
250
|
-
focus: "focus:border-border-500"
|
|
251
|
-
},
|
|
252
|
-
focused: {
|
|
253
|
-
base: "border-2 border-primary-950 bg-background text-text-900",
|
|
254
|
-
hover: "",
|
|
255
|
-
focus: ""
|
|
256
|
-
},
|
|
257
|
-
invalid: {
|
|
258
|
-
base: "border-2 border-red-700 bg-white text-gray-800",
|
|
259
|
-
hover: "hover:border-red-700",
|
|
260
|
-
focus: "focus:border-red-700"
|
|
261
|
-
},
|
|
262
|
-
disabled: {
|
|
263
|
-
base: "border-border-300 bg-background text-text-600 cursor-not-allowed opacity-40",
|
|
264
|
-
hover: "",
|
|
265
|
-
focus: ""
|
|
266
|
-
}
|
|
70
|
+
var SIZE_CLASSES = {
|
|
71
|
+
"extra-small": "text-xs px-3.5 py-2",
|
|
72
|
+
small: "text-sm px-4 py-2.5",
|
|
73
|
+
medium: "text-md px-5 py-2.5",
|
|
74
|
+
large: "text-lg px-6 py-3",
|
|
75
|
+
"extra-large": "text-lg px-7 py-3.5"
|
|
267
76
|
};
|
|
268
|
-
var
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
props.onBlur?.(event);
|
|
296
|
-
};
|
|
297
|
-
let currentState = disabled ? "disabled" : state;
|
|
298
|
-
if (isFocused && currentState !== "invalid" && currentState !== "disabled") {
|
|
299
|
-
currentState = "focused";
|
|
77
|
+
var Button = ({
|
|
78
|
+
children,
|
|
79
|
+
iconLeft,
|
|
80
|
+
iconRight,
|
|
81
|
+
size = "medium",
|
|
82
|
+
variant = "solid",
|
|
83
|
+
action = "primary",
|
|
84
|
+
className = "",
|
|
85
|
+
disabled,
|
|
86
|
+
type = "button",
|
|
87
|
+
...props
|
|
88
|
+
}) => {
|
|
89
|
+
const sizeClasses = SIZE_CLASSES[size];
|
|
90
|
+
const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
|
|
91
|
+
const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
|
|
92
|
+
return /* @__PURE__ */ jsxs(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
96
|
+
disabled,
|
|
97
|
+
type,
|
|
98
|
+
...props,
|
|
99
|
+
children: [
|
|
100
|
+
iconLeft && /* @__PURE__ */ jsx2("span", { className: "mr-2 flex items-center", children: iconLeft }),
|
|
101
|
+
children,
|
|
102
|
+
iconRight && /* @__PURE__ */ jsx2("span", { className: "ml-2 flex items-center", children: iconRight })
|
|
103
|
+
]
|
|
300
104
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
|
|
304
|
-
return /* @__PURE__ */ jsxs3("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
|
|
305
|
-
label && /* @__PURE__ */ jsx5(
|
|
306
|
-
Text,
|
|
307
|
-
{
|
|
308
|
-
as: "label",
|
|
309
|
-
htmlFor: inputId,
|
|
310
|
-
size: sizeClasses.textSize,
|
|
311
|
-
weight: "medium",
|
|
312
|
-
color: "text-text-950",
|
|
313
|
-
className: `mb-1.5 ${labelClassName}`,
|
|
314
|
-
children: label
|
|
315
|
-
}
|
|
316
|
-
),
|
|
317
|
-
/* @__PURE__ */ jsx5(
|
|
318
|
-
"textarea",
|
|
319
|
-
{
|
|
320
|
-
ref,
|
|
321
|
-
id: inputId,
|
|
322
|
-
disabled,
|
|
323
|
-
onChange: handleChange,
|
|
324
|
-
onFocus: handleFocus,
|
|
325
|
-
onBlur: handleBlur,
|
|
326
|
-
className: textareaClasses,
|
|
327
|
-
placeholder,
|
|
328
|
-
...props
|
|
329
|
-
}
|
|
330
|
-
),
|
|
331
|
-
errorMessage && /* @__PURE__ */ jsx5(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
|
|
332
|
-
helperMessage && !errorMessage && /* @__PURE__ */ jsx5(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
|
|
333
|
-
] });
|
|
334
|
-
}
|
|
335
|
-
);
|
|
336
|
-
TextArea.displayName = "TextArea";
|
|
105
|
+
);
|
|
106
|
+
};
|
|
337
107
|
|
|
338
108
|
// src/components/Badge/Badge.tsx
|
|
339
109
|
import { Bell } from "phosphor-react";
|
|
340
|
-
import { jsx as
|
|
110
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
341
111
|
var VARIANT_ACTION_CLASSES2 = {
|
|
342
112
|
solid: {
|
|
343
113
|
error: "bg-error text-error-700 focus-visible:outline-none",
|
|
@@ -365,7 +135,7 @@ var VARIANT_ACTION_CLASSES2 = {
|
|
|
365
135
|
},
|
|
366
136
|
notification: "text-primary"
|
|
367
137
|
};
|
|
368
|
-
var
|
|
138
|
+
var SIZE_CLASSES2 = {
|
|
369
139
|
small: "text-2xs px-2 py-1",
|
|
370
140
|
medium: "text-xs px-2 py-1",
|
|
371
141
|
large: "text-sm px-2 py-1"
|
|
@@ -386,21 +156,21 @@ var Badge = ({
|
|
|
386
156
|
notificationActive = false,
|
|
387
157
|
...props
|
|
388
158
|
}) => {
|
|
389
|
-
const sizeClasses =
|
|
159
|
+
const sizeClasses = SIZE_CLASSES2[size];
|
|
390
160
|
const sizeClassesIcon = SIZE_CLASSES_ICON[size];
|
|
391
161
|
const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
|
|
392
162
|
const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
|
|
393
163
|
const baseClasses = "inline-flex items-center justify-center rounded-xs font-medium gap-1 relative";
|
|
394
164
|
const baseClassesIcon = "flex items-center";
|
|
395
165
|
if (variant === "notification") {
|
|
396
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ jsxs2(
|
|
397
167
|
"div",
|
|
398
168
|
{
|
|
399
169
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
400
170
|
...props,
|
|
401
171
|
children: [
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
notificationActive && /* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ jsx3(Bell, { size: 24, className: "text-primary-950" }),
|
|
173
|
+
notificationActive && /* @__PURE__ */ jsx3(
|
|
404
174
|
"span",
|
|
405
175
|
{
|
|
406
176
|
"data-testid": "notification-dot",
|
|
@@ -411,543 +181,196 @@ var Badge = ({
|
|
|
411
181
|
}
|
|
412
182
|
);
|
|
413
183
|
}
|
|
414
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ jsxs2(
|
|
415
185
|
"div",
|
|
416
186
|
{
|
|
417
187
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
418
188
|
...props,
|
|
419
189
|
children: [
|
|
420
|
-
iconLeft && /* @__PURE__ */
|
|
190
|
+
iconLeft && /* @__PURE__ */ jsx3("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
|
|
421
191
|
children,
|
|
422
|
-
iconRight && /* @__PURE__ */
|
|
192
|
+
iconRight && /* @__PURE__ */ jsx3("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
|
|
423
193
|
]
|
|
424
194
|
}
|
|
425
195
|
);
|
|
426
196
|
};
|
|
427
197
|
|
|
428
|
-
// src/components/
|
|
429
|
-
import {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
checkbox: "w-4 h-4",
|
|
439
|
-
// 16px x 16px
|
|
440
|
-
textSize: "sm",
|
|
441
|
-
spacing: "gap-1.5",
|
|
442
|
-
// 6px
|
|
443
|
-
borderWidth: "border-2",
|
|
444
|
-
iconSize: 14,
|
|
445
|
-
// pixels for Phosphor icons
|
|
446
|
-
labelHeight: "h-[21px]"
|
|
447
|
-
},
|
|
448
|
-
medium: {
|
|
449
|
-
checkbox: "w-5 h-5",
|
|
450
|
-
// 20px x 20px
|
|
451
|
-
textSize: "md",
|
|
452
|
-
spacing: "gap-2",
|
|
453
|
-
// 8px
|
|
454
|
-
borderWidth: "border-2",
|
|
455
|
-
iconSize: 16,
|
|
456
|
-
// pixels for Phosphor icons
|
|
457
|
-
labelHeight: "h-6"
|
|
198
|
+
// src/components/Alert/Alert.tsx
|
|
199
|
+
import { CheckCircle, Info, WarningCircle, XCircle } from "phosphor-react";
|
|
200
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
201
|
+
var VARIANT_ACTION_CLASSES3 = {
|
|
202
|
+
solid: {
|
|
203
|
+
default: "bg-background-50 border-transparent",
|
|
204
|
+
info: "bg-info border-transparent",
|
|
205
|
+
success: "bg-success border-transparent",
|
|
206
|
+
warning: "bg-warning border-transparent",
|
|
207
|
+
error: "bg-error border-transparent"
|
|
458
208
|
},
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
borderWidth: "border-[3px]",
|
|
466
|
-
// 3px border
|
|
467
|
-
iconSize: 20,
|
|
468
|
-
// pixels for Phosphor icons
|
|
469
|
-
labelHeight: "h-[27px]"
|
|
209
|
+
outline: {
|
|
210
|
+
default: "bg-background border border-border-100",
|
|
211
|
+
info: "bg-background border border-border-100",
|
|
212
|
+
success: "bg-background border border-border-100",
|
|
213
|
+
warning: "bg-background border border-border-100",
|
|
214
|
+
error: "bg-background border border-border-100"
|
|
470
215
|
}
|
|
471
216
|
};
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
hovered: {
|
|
479
|
-
unchecked: "border-border-500 bg-background",
|
|
480
|
-
checked: "border-primary-800 bg-primary-800 text-text"
|
|
481
|
-
},
|
|
482
|
-
focused: {
|
|
483
|
-
unchecked: "border-indicator-info bg-background ring-2 ring-indicator-info/20",
|
|
484
|
-
checked: "border-indicator-info bg-primary-950 text-text ring-2 ring-indicator-info/20"
|
|
485
|
-
},
|
|
486
|
-
invalid: {
|
|
487
|
-
unchecked: "border-error-700 bg-background hover:border-error-600",
|
|
488
|
-
checked: "border-error-700 bg-primary-950 text-text"
|
|
489
|
-
},
|
|
490
|
-
disabled: {
|
|
491
|
-
unchecked: "border-border-400 bg-background cursor-not-allowed opacity-40",
|
|
492
|
-
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
493
|
-
}
|
|
217
|
+
var COLOR_CLASSES = {
|
|
218
|
+
default: "text-text-950",
|
|
219
|
+
info: "text-info-800",
|
|
220
|
+
success: "text-success-800",
|
|
221
|
+
warning: "text-warning-800",
|
|
222
|
+
error: "text-error-800"
|
|
494
223
|
};
|
|
495
|
-
var
|
|
496
|
-
({
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
if (!isControlled) {
|
|
518
|
-
setInternalChecked(event.target.checked);
|
|
519
|
-
}
|
|
520
|
-
onChange?.(event);
|
|
521
|
-
};
|
|
522
|
-
const currentState = disabled ? "disabled" : state;
|
|
523
|
-
const sizeClasses = SIZE_CLASSES4[size];
|
|
524
|
-
const checkVariant = checked || indeterminate ? "checked" : "unchecked";
|
|
525
|
-
const stylingClasses = STATE_CLASSES2[currentState][checkVariant];
|
|
526
|
-
const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
|
|
527
|
-
const checkboxClasses = `${BASE_CHECKBOX_CLASSES} ${sizeClasses.checkbox} ${borderWidthClass} ${stylingClasses} ${className}`;
|
|
528
|
-
const renderIcon = () => {
|
|
529
|
-
if (indeterminate) {
|
|
530
|
-
return /* @__PURE__ */ jsx7(
|
|
531
|
-
Minus,
|
|
532
|
-
{
|
|
533
|
-
size: sizeClasses.iconSize,
|
|
534
|
-
weight: "bold",
|
|
535
|
-
color: "currentColor"
|
|
536
|
-
}
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
if (checked) {
|
|
540
|
-
return /* @__PURE__ */ jsx7(
|
|
541
|
-
Check,
|
|
542
|
-
{
|
|
543
|
-
size: sizeClasses.iconSize,
|
|
544
|
-
weight: "bold",
|
|
545
|
-
color: "currentColor"
|
|
546
|
-
}
|
|
547
|
-
);
|
|
548
|
-
}
|
|
549
|
-
return null;
|
|
550
|
-
};
|
|
551
|
-
return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col", children: [
|
|
552
|
-
/* @__PURE__ */ jsxs5(
|
|
553
|
-
"div",
|
|
554
|
-
{
|
|
555
|
-
className: `flex flex-row items-center ${sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
|
|
556
|
-
children: [
|
|
557
|
-
/* @__PURE__ */ jsx7(
|
|
558
|
-
"input",
|
|
559
|
-
{
|
|
560
|
-
ref,
|
|
561
|
-
type: "checkbox",
|
|
562
|
-
id: inputId,
|
|
563
|
-
checked,
|
|
564
|
-
disabled,
|
|
565
|
-
onChange: handleChange,
|
|
566
|
-
className: "sr-only",
|
|
567
|
-
...props
|
|
568
|
-
}
|
|
569
|
-
),
|
|
570
|
-
/* @__PURE__ */ jsx7("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
571
|
-
label && /* @__PURE__ */ jsx7(
|
|
572
|
-
"div",
|
|
573
|
-
{
|
|
574
|
-
className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
|
|
575
|
-
children: /* @__PURE__ */ jsx7(
|
|
576
|
-
Text,
|
|
577
|
-
{
|
|
578
|
-
as: "label",
|
|
579
|
-
htmlFor: inputId,
|
|
580
|
-
size: sizeClasses.textSize,
|
|
581
|
-
weight: "normal",
|
|
582
|
-
className: `cursor-pointer select-none leading-[150%] flex items-center font-roboto ${labelClassName}`,
|
|
583
|
-
children: label
|
|
584
|
-
}
|
|
585
|
-
)
|
|
586
|
-
}
|
|
587
|
-
)
|
|
588
|
-
]
|
|
589
|
-
}
|
|
590
|
-
),
|
|
591
|
-
errorMessage && /* @__PURE__ */ jsx7(
|
|
592
|
-
Text,
|
|
593
|
-
{
|
|
594
|
-
size: "sm",
|
|
595
|
-
weight: "normal",
|
|
596
|
-
className: "mt-1.5",
|
|
597
|
-
color: "text-error-600",
|
|
598
|
-
children: errorMessage
|
|
599
|
-
}
|
|
600
|
-
),
|
|
601
|
-
helperText && !errorMessage && /* @__PURE__ */ jsx7(
|
|
602
|
-
Text,
|
|
603
|
-
{
|
|
604
|
-
size: "sm",
|
|
605
|
-
weight: "normal",
|
|
606
|
-
className: "mt-1.5",
|
|
607
|
-
color: "text-text-500",
|
|
608
|
-
children: helperText
|
|
609
|
-
}
|
|
610
|
-
)
|
|
611
|
-
] });
|
|
612
|
-
}
|
|
613
|
-
);
|
|
614
|
-
CheckBox.displayName = "CheckBox";
|
|
615
|
-
|
|
616
|
-
// src/components/Table/Table.tsx
|
|
617
|
-
import { forwardRef as forwardRef4 } from "react";
|
|
618
|
-
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
619
|
-
var Table = forwardRef4(
|
|
620
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx8("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ jsxs6(
|
|
621
|
-
"table",
|
|
224
|
+
var ICONS = {
|
|
225
|
+
default: /* @__PURE__ */ jsx4(CheckCircle, { size: 18 }),
|
|
226
|
+
info: /* @__PURE__ */ jsx4(Info, { size: 18 }),
|
|
227
|
+
success: /* @__PURE__ */ jsx4(CheckCircle, { size: 18 }),
|
|
228
|
+
warning: /* @__PURE__ */ jsx4(WarningCircle, { size: 18 }),
|
|
229
|
+
error: /* @__PURE__ */ jsx4(XCircle, { size: 18 })
|
|
230
|
+
};
|
|
231
|
+
var Alert = ({
|
|
232
|
+
variant = "solid",
|
|
233
|
+
title,
|
|
234
|
+
description,
|
|
235
|
+
action = "default",
|
|
236
|
+
className,
|
|
237
|
+
...props
|
|
238
|
+
}) => {
|
|
239
|
+
const baseClasses = "alert-wrapper flex items-start gap-2 w-[384px] py-3 px-4 font-inherit rounded-md";
|
|
240
|
+
const variantClasses = VARIANT_ACTION_CLASSES3[variant][action];
|
|
241
|
+
const variantColor = COLOR_CLASSES[action];
|
|
242
|
+
const variantIcon = ICONS[action];
|
|
243
|
+
const hasHeading = Boolean(title);
|
|
244
|
+
return /* @__PURE__ */ jsxs3(
|
|
245
|
+
"div",
|
|
622
246
|
{
|
|
623
|
-
|
|
624
|
-
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
247
|
+
className: `${baseClasses} ${variantClasses} ${className ?? ""}`,
|
|
625
248
|
...props,
|
|
626
249
|
children: [
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
children
|
|
250
|
+
/* @__PURE__ */ jsx4("span", { className: `mt-0.5 ${variantColor}`, children: variantIcon }),
|
|
251
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
252
|
+
hasHeading && /* @__PURE__ */ jsx4(
|
|
253
|
+
Text,
|
|
254
|
+
{
|
|
255
|
+
size: "md",
|
|
256
|
+
weight: "medium",
|
|
257
|
+
color: variantColor,
|
|
258
|
+
className: "mb-0.5",
|
|
259
|
+
children: title
|
|
260
|
+
}
|
|
261
|
+
),
|
|
262
|
+
/* @__PURE__ */ jsx4(
|
|
263
|
+
Text,
|
|
264
|
+
{
|
|
265
|
+
size: hasHeading ? "sm" : "md",
|
|
266
|
+
weight: "normal",
|
|
267
|
+
color: !hasHeading ? variantColor : "text-text-700",
|
|
268
|
+
children: description
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
] })
|
|
629
272
|
]
|
|
630
273
|
}
|
|
631
|
-
)
|
|
632
|
-
);
|
|
633
|
-
Table.displayName = "Table";
|
|
634
|
-
var TableHeader = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
635
|
-
"thead",
|
|
636
|
-
{
|
|
637
|
-
ref,
|
|
638
|
-
className: `[&_tr:first-child]:border-0 ${className}`,
|
|
639
|
-
...props
|
|
640
|
-
}
|
|
641
|
-
));
|
|
642
|
-
TableHeader.displayName = "TableHeader";
|
|
643
|
-
var TableBody = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
644
|
-
"tbody",
|
|
645
|
-
{
|
|
646
|
-
ref,
|
|
647
|
-
className: `[&_tr:last-child]:border-0 border-t border-border-200 ${className}`,
|
|
648
|
-
...props
|
|
649
|
-
}
|
|
650
|
-
));
|
|
651
|
-
TableBody.displayName = "TableBody";
|
|
652
|
-
var TableFooter = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
653
|
-
"tfoot",
|
|
654
|
-
{
|
|
655
|
-
ref,
|
|
656
|
-
className: `border-t bg-background-50 border-border-200 font-medium [&>tr]:last:border-b-0 px-6 py-3.5 ${className}`,
|
|
657
|
-
...props
|
|
658
|
-
}
|
|
659
|
-
));
|
|
660
|
-
TableFooter.displayName = "TableFooter";
|
|
661
|
-
var VARIANT_STATES_ROW = {
|
|
662
|
-
default: "border-b border-border-200",
|
|
663
|
-
selected: "border-b-2 border-indicator-primary",
|
|
664
|
-
invalid: "border-b-2 border-indicator-error",
|
|
665
|
-
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
274
|
+
);
|
|
666
275
|
};
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
276
|
+
|
|
277
|
+
// src/components/IconButton/IconButton.tsx
|
|
278
|
+
import { forwardRef } from "react";
|
|
279
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
280
|
+
var IconButton = forwardRef(
|
|
281
|
+
({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
|
|
282
|
+
const baseClasses = [
|
|
283
|
+
"inline-flex",
|
|
284
|
+
"items-center",
|
|
285
|
+
"justify-center",
|
|
286
|
+
"rounded-lg",
|
|
287
|
+
"font-medium",
|
|
288
|
+
"bg-transparent",
|
|
289
|
+
"text-text-950",
|
|
290
|
+
"cursor-pointer",
|
|
291
|
+
"hover:bg-primary-600",
|
|
292
|
+
"hover:text-text",
|
|
293
|
+
"focus-visible:outline-none",
|
|
294
|
+
"focus-visible:ring-2",
|
|
295
|
+
"focus-visible:ring-offset-0",
|
|
296
|
+
"focus-visible:ring-indicator-info",
|
|
297
|
+
"disabled:opacity-50",
|
|
298
|
+
"disabled:cursor-not-allowed",
|
|
299
|
+
"disabled:pointer-events-none"
|
|
300
|
+
];
|
|
301
|
+
const sizeClasses = {
|
|
302
|
+
sm: ["w-6", "h-6", "text-sm"],
|
|
303
|
+
md: ["w-10", "h-10", "text-base"]
|
|
304
|
+
};
|
|
305
|
+
const activeClasses = active ? ["!bg-primary-50", "!text-primary-950", "hover:!bg-primary-100"] : [];
|
|
306
|
+
const allClasses = [
|
|
307
|
+
...baseClasses,
|
|
308
|
+
...sizeClasses[size],
|
|
309
|
+
...activeClasses
|
|
310
|
+
].join(" ");
|
|
311
|
+
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
312
|
+
return /* @__PURE__ */ jsx5(
|
|
313
|
+
"button",
|
|
671
314
|
{
|
|
672
315
|
ref,
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
"
|
|
680
|
-
...props
|
|
316
|
+
type: "button",
|
|
317
|
+
className: `${allClasses} ${className}`,
|
|
318
|
+
disabled,
|
|
319
|
+
"aria-pressed": active,
|
|
320
|
+
"aria-label": ariaLabel,
|
|
321
|
+
...props,
|
|
322
|
+
children: /* @__PURE__ */ jsx5("span", { className: "flex items-center justify-center", children: icon })
|
|
681
323
|
}
|
|
682
324
|
);
|
|
683
325
|
}
|
|
684
326
|
);
|
|
685
|
-
|
|
686
|
-
var TableHead = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
687
|
-
"th",
|
|
688
|
-
{
|
|
689
|
-
ref,
|
|
690
|
-
className: `h-10 px-6 py-3.5 bg-bg-secondary bg-muted/50 text-left align-middle font-bold text-text-800 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] ${className}`,
|
|
691
|
-
...props
|
|
692
|
-
}
|
|
693
|
-
));
|
|
694
|
-
TableHead.displayName = "TableHead";
|
|
695
|
-
var TableCell = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
696
|
-
"td",
|
|
697
|
-
{
|
|
698
|
-
ref,
|
|
699
|
-
className: `p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-md text-text-800 px-6 py-3.5 ${className}`,
|
|
700
|
-
...props
|
|
701
|
-
}
|
|
702
|
-
));
|
|
703
|
-
TableCell.displayName = "TableCell";
|
|
704
|
-
var TableCaption = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
705
|
-
"caption",
|
|
706
|
-
{
|
|
707
|
-
ref,
|
|
708
|
-
className: `border-t border-border-200 text-sm text-text-800 px-6 py-3.5 ${className}`,
|
|
709
|
-
...props
|
|
710
|
-
}
|
|
711
|
-
));
|
|
712
|
-
TableCaption.displayName = "TableCaption";
|
|
327
|
+
IconButton.displayName = "IconButton";
|
|
713
328
|
|
|
714
|
-
// src/components/
|
|
715
|
-
import {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
event.preventDefault();
|
|
745
|
-
const items = Array.from(
|
|
746
|
-
menuContent.querySelectorAll(
|
|
747
|
-
'[role="menuitem"]:not([aria-disabled="true"])'
|
|
748
|
-
)
|
|
749
|
-
).filter((el) => el instanceof HTMLElement);
|
|
750
|
-
if (items.length === 0) return;
|
|
751
|
-
const focusedItem = document.activeElement;
|
|
752
|
-
const currentIndex = items.findIndex((item) => item === focusedItem);
|
|
753
|
-
let nextIndex;
|
|
754
|
-
if (event.key === "ArrowDown") {
|
|
755
|
-
nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;
|
|
756
|
-
} else {
|
|
757
|
-
nextIndex = currentIndex === -1 ? items.length - 1 : (currentIndex - 1 + items.length) % items.length;
|
|
758
|
-
}
|
|
759
|
-
items[nextIndex]?.focus();
|
|
760
|
-
}
|
|
761
|
-
};
|
|
762
|
-
const handleDownkey = (event) => {
|
|
763
|
-
if (event.key === "Escape") {
|
|
764
|
-
setOpen(false);
|
|
765
|
-
} else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
766
|
-
handleArrowDownOrArrowUp(event);
|
|
767
|
-
}
|
|
768
|
-
};
|
|
769
|
-
const handleClickOutside = (event) => {
|
|
770
|
-
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
771
|
-
setOpen(false);
|
|
772
|
-
}
|
|
773
|
-
};
|
|
774
|
-
useEffect(() => {
|
|
775
|
-
if (currentOpen) {
|
|
776
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
777
|
-
document.addEventListener("keydown", handleDownkey);
|
|
778
|
-
}
|
|
779
|
-
return () => {
|
|
780
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
781
|
-
document.removeEventListener("keydown", handleDownkey);
|
|
782
|
-
};
|
|
783
|
-
}, [currentOpen]);
|
|
784
|
-
const value = useMemo(
|
|
785
|
-
() => ({ open: currentOpen, setOpen }),
|
|
786
|
-
[currentOpen, setOpen]
|
|
787
|
-
);
|
|
788
|
-
return /* @__PURE__ */ jsx9(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ jsx9("div", { className: "relative", ref: menuRef, children }) });
|
|
789
|
-
};
|
|
790
|
-
var DropdownMenuTrigger = forwardRef5(({ className, children, onClick, ...props }, ref) => {
|
|
791
|
-
const context = useContext(DropdownMenuContext);
|
|
792
|
-
if (!context)
|
|
793
|
-
throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
|
|
794
|
-
const { open, setOpen } = context;
|
|
795
|
-
return /* @__PURE__ */ jsx9(
|
|
329
|
+
// src/components/IconRoundedButton/IconRoundedButton.tsx
|
|
330
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
331
|
+
var IconRoundedButton = ({
|
|
332
|
+
icon,
|
|
333
|
+
className = "",
|
|
334
|
+
disabled,
|
|
335
|
+
...props
|
|
336
|
+
}) => {
|
|
337
|
+
const baseClasses = [
|
|
338
|
+
"inline-flex",
|
|
339
|
+
"items-center",
|
|
340
|
+
"justify-center",
|
|
341
|
+
"w-8",
|
|
342
|
+
"h-8",
|
|
343
|
+
"rounded-full",
|
|
344
|
+
"cursor-pointer",
|
|
345
|
+
"border",
|
|
346
|
+
"border-background-200",
|
|
347
|
+
"bg-background",
|
|
348
|
+
"text-text-950",
|
|
349
|
+
"hover:shadow-hard-shadow-1",
|
|
350
|
+
"focus-visible:outline-none",
|
|
351
|
+
"focus-visible:shadow-hard-shadow-1",
|
|
352
|
+
"focus-visible:ring-2",
|
|
353
|
+
"focus-visible:ring-indicator-info",
|
|
354
|
+
"focus-visible:ring-offset-0",
|
|
355
|
+
"disabled:opacity-50",
|
|
356
|
+
"disabled:cursor-not-allowed"
|
|
357
|
+
].join(" ");
|
|
358
|
+
return /* @__PURE__ */ jsx6(
|
|
796
359
|
"button",
|
|
797
360
|
{
|
|
798
|
-
|
|
799
|
-
className:
|
|
800
|
-
|
|
801
|
-
e.stopPropagation();
|
|
802
|
-
setOpen(!open);
|
|
803
|
-
if (onClick) onClick(e);
|
|
804
|
-
},
|
|
805
|
-
"aria-expanded": open,
|
|
361
|
+
type: "button",
|
|
362
|
+
className: `${baseClasses} ${className}`,
|
|
363
|
+
disabled,
|
|
806
364
|
...props,
|
|
807
|
-
children
|
|
365
|
+
children: /* @__PURE__ */ jsx6("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
|
|
808
366
|
}
|
|
809
367
|
);
|
|
810
|
-
});
|
|
811
|
-
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
812
|
-
var ITEM_SIZE_CLASSES = {
|
|
813
|
-
small: "text-sm",
|
|
814
|
-
medium: "text-md"
|
|
815
|
-
};
|
|
816
|
-
var SIDE_CLASSES = {
|
|
817
|
-
top: "bottom-full",
|
|
818
|
-
right: "top-full",
|
|
819
|
-
bottom: "top-full",
|
|
820
|
-
left: "top-full"
|
|
821
368
|
};
|
|
822
|
-
var ALIGN_CLASSES = {
|
|
823
|
-
start: "left-0",
|
|
824
|
-
center: "left-1/2 -translate-x-1/2",
|
|
825
|
-
end: "right-0"
|
|
826
|
-
};
|
|
827
|
-
var MenuLabel = forwardRef5(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
828
|
-
"fieldset",
|
|
829
|
-
{
|
|
830
|
-
ref,
|
|
831
|
-
role: "group",
|
|
832
|
-
className: `text-sm w-full ${inset ? "pl-8" : ""} ${className ?? ""}`,
|
|
833
|
-
...props
|
|
834
|
-
}
|
|
835
|
-
));
|
|
836
|
-
MenuLabel.displayName = "MenuLabel";
|
|
837
|
-
var MenuContent = forwardRef5(
|
|
838
|
-
({
|
|
839
|
-
className,
|
|
840
|
-
align = "start",
|
|
841
|
-
side = "bottom",
|
|
842
|
-
sideOffset = 4,
|
|
843
|
-
children,
|
|
844
|
-
...props
|
|
845
|
-
}, ref) => {
|
|
846
|
-
const { open } = useContext(DropdownMenuContext);
|
|
847
|
-
const [isVisible, setIsVisible] = useState3(open);
|
|
848
|
-
useEffect(() => {
|
|
849
|
-
if (open) {
|
|
850
|
-
setIsVisible(true);
|
|
851
|
-
} else {
|
|
852
|
-
const timer = setTimeout(() => setIsVisible(false), 200);
|
|
853
|
-
return () => clearTimeout(timer);
|
|
854
|
-
}
|
|
855
|
-
}, [open]);
|
|
856
|
-
if (!isVisible) return null;
|
|
857
|
-
const getPositionClasses = () => {
|
|
858
|
-
const vertical = SIDE_CLASSES[side];
|
|
859
|
-
const horizontal = ALIGN_CLASSES[align];
|
|
860
|
-
return `absolute ${vertical} ${horizontal}`;
|
|
861
|
-
};
|
|
862
|
-
return /* @__PURE__ */ jsx9(
|
|
863
|
-
"div",
|
|
864
|
-
{
|
|
865
|
-
ref,
|
|
866
|
-
role: "menu",
|
|
867
|
-
className: `
|
|
868
|
-
bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md border-border-100
|
|
869
|
-
${open ? "animate-in fade-in-0 zoom-in-95" : "animate-out fade-out-0 zoom-out-95"}
|
|
870
|
-
${getPositionClasses()}
|
|
871
|
-
${className}
|
|
872
|
-
`,
|
|
873
|
-
style: {
|
|
874
|
-
marginTop: side === "bottom" ? sideOffset : void 0,
|
|
875
|
-
marginBottom: side === "top" ? sideOffset : void 0,
|
|
876
|
-
marginLeft: side === "right" ? sideOffset : void 0,
|
|
877
|
-
marginRight: side === "left" ? sideOffset : void 0
|
|
878
|
-
},
|
|
879
|
-
...props,
|
|
880
|
-
children
|
|
881
|
-
}
|
|
882
|
-
);
|
|
883
|
-
}
|
|
884
|
-
);
|
|
885
|
-
MenuContent.displayName = "MenuContent";
|
|
886
|
-
var MenuItem = forwardRef5(
|
|
887
|
-
({
|
|
888
|
-
className,
|
|
889
|
-
inset,
|
|
890
|
-
size = "small",
|
|
891
|
-
children,
|
|
892
|
-
iconRight,
|
|
893
|
-
iconLeft,
|
|
894
|
-
disabled = false,
|
|
895
|
-
onClick,
|
|
896
|
-
...props
|
|
897
|
-
}, ref) => {
|
|
898
|
-
const sizeClasses = ITEM_SIZE_CLASSES[size];
|
|
899
|
-
const handleClick = (e) => {
|
|
900
|
-
if (disabled) {
|
|
901
|
-
e.preventDefault();
|
|
902
|
-
e.stopPropagation();
|
|
903
|
-
return;
|
|
904
|
-
}
|
|
905
|
-
onClick?.(e);
|
|
906
|
-
};
|
|
907
|
-
return /* @__PURE__ */ jsxs7(
|
|
908
|
-
"div",
|
|
909
|
-
{
|
|
910
|
-
ref,
|
|
911
|
-
role: "menuitem",
|
|
912
|
-
"aria-disabled": disabled,
|
|
913
|
-
className: `
|
|
914
|
-
focus-visible:bg-background-50
|
|
915
|
-
relative flex select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0
|
|
916
|
-
${inset && "pl-8"}
|
|
917
|
-
${sizeClasses}
|
|
918
|
-
${className}
|
|
919
|
-
${disabled ? "cursor-not-allowed text-text-400" : "cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
|
|
920
|
-
`,
|
|
921
|
-
onClick: handleClick,
|
|
922
|
-
onKeyDown: (e) => {
|
|
923
|
-
if (e.key === "Enter" || e.key === " ") handleClick(e);
|
|
924
|
-
},
|
|
925
|
-
tabIndex: disabled ? -1 : 0,
|
|
926
|
-
...props,
|
|
927
|
-
children: [
|
|
928
|
-
iconLeft,
|
|
929
|
-
children,
|
|
930
|
-
iconRight
|
|
931
|
-
]
|
|
932
|
-
}
|
|
933
|
-
);
|
|
934
|
-
}
|
|
935
|
-
);
|
|
936
|
-
MenuItem.displayName = "MenuItem";
|
|
937
|
-
var MenuSeparator = forwardRef5(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
938
|
-
"div",
|
|
939
|
-
{
|
|
940
|
-
ref,
|
|
941
|
-
className: `my-1 h-px bg-border-200 ${className}`,
|
|
942
|
-
...props
|
|
943
|
-
}
|
|
944
|
-
));
|
|
945
|
-
MenuSeparator.displayName = "MenuSeparator";
|
|
946
369
|
|
|
947
370
|
// src/components/NavButton/NavButton.tsx
|
|
948
|
-
import { forwardRef as
|
|
949
|
-
import { jsx as
|
|
950
|
-
var NavButton =
|
|
371
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
372
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
373
|
+
var NavButton = forwardRef2(
|
|
951
374
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
952
375
|
const baseClasses = [
|
|
953
376
|
"flex",
|
|
@@ -974,7 +397,7 @@ var NavButton = forwardRef6(
|
|
|
974
397
|
];
|
|
975
398
|
const stateClasses = selected ? ["bg-primary-50", "text-primary-950"] : [];
|
|
976
399
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
977
|
-
return /* @__PURE__ */
|
|
400
|
+
return /* @__PURE__ */ jsxs4(
|
|
978
401
|
"button",
|
|
979
402
|
{
|
|
980
403
|
ref,
|
|
@@ -984,8 +407,8 @@ var NavButton = forwardRef6(
|
|
|
984
407
|
"aria-pressed": selected,
|
|
985
408
|
...props,
|
|
986
409
|
children: [
|
|
987
|
-
/* @__PURE__ */
|
|
988
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ jsx7("span", { className: "flex items-center justify-center w-5 h-5", children: icon }),
|
|
411
|
+
/* @__PURE__ */ jsx7("span", { className: "whitespace-nowrap", children: label })
|
|
989
412
|
]
|
|
990
413
|
}
|
|
991
414
|
);
|
|
@@ -993,182 +416,163 @@ var NavButton = forwardRef6(
|
|
|
993
416
|
);
|
|
994
417
|
NavButton.displayName = "NavButton";
|
|
995
418
|
|
|
996
|
-
// src/components/
|
|
997
|
-
import { forwardRef as
|
|
998
|
-
import { jsx as
|
|
999
|
-
var
|
|
1000
|
-
({ icon,
|
|
419
|
+
// src/components/SelectionButton/SelectionButton.tsx
|
|
420
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
421
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
422
|
+
var SelectionButton = forwardRef3(
|
|
423
|
+
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
1001
424
|
const baseClasses = [
|
|
1002
425
|
"inline-flex",
|
|
1003
426
|
"items-center",
|
|
1004
|
-
"justify-
|
|
1005
|
-
"
|
|
1006
|
-
"
|
|
1007
|
-
"
|
|
1008
|
-
"text-text-950",
|
|
427
|
+
"justify-start",
|
|
428
|
+
"gap-2",
|
|
429
|
+
"p-4",
|
|
430
|
+
"rounded-xl",
|
|
1009
431
|
"cursor-pointer",
|
|
1010
|
-
"
|
|
1011
|
-
"
|
|
432
|
+
"border",
|
|
433
|
+
"border-border-50",
|
|
434
|
+
"bg-background",
|
|
435
|
+
"text-sm",
|
|
436
|
+
"text-text-700",
|
|
437
|
+
"font-bold",
|
|
438
|
+
"shadow-soft-shadow-1",
|
|
439
|
+
"hover:bg-background-100",
|
|
1012
440
|
"focus-visible:outline-none",
|
|
1013
441
|
"focus-visible:ring-2",
|
|
1014
|
-
"focus-visible:ring-offset-0",
|
|
1015
442
|
"focus-visible:ring-indicator-info",
|
|
443
|
+
"focus-visible:ring-offset-0",
|
|
444
|
+
"focus-visible:shadow-none",
|
|
445
|
+
"active:ring-2",
|
|
446
|
+
"active:ring-primary-950",
|
|
447
|
+
"active:ring-offset-0",
|
|
448
|
+
"active:shadow-none",
|
|
1016
449
|
"disabled:opacity-50",
|
|
1017
|
-
"disabled:cursor-not-allowed"
|
|
1018
|
-
"disabled:pointer-events-none"
|
|
450
|
+
"disabled:cursor-not-allowed"
|
|
1019
451
|
];
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
};
|
|
1024
|
-
const activeClasses = active ? ["!bg-primary-50", "!text-primary-950", "hover:!bg-primary-100"] : [];
|
|
1025
|
-
const allClasses = [
|
|
1026
|
-
...baseClasses,
|
|
1027
|
-
...sizeClasses[size],
|
|
1028
|
-
...activeClasses
|
|
1029
|
-
].join(" ");
|
|
1030
|
-
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
1031
|
-
return /* @__PURE__ */ jsx11(
|
|
452
|
+
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
453
|
+
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
454
|
+
return /* @__PURE__ */ jsxs5(
|
|
1032
455
|
"button",
|
|
1033
456
|
{
|
|
1034
457
|
ref,
|
|
1035
458
|
type: "button",
|
|
1036
459
|
className: `${allClasses} ${className}`,
|
|
1037
460
|
disabled,
|
|
1038
|
-
"aria-pressed":
|
|
1039
|
-
"aria-label": ariaLabel,
|
|
461
|
+
"aria-pressed": selected,
|
|
1040
462
|
...props,
|
|
1041
|
-
children:
|
|
463
|
+
children: [
|
|
464
|
+
/* @__PURE__ */ jsx8("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
465
|
+
/* @__PURE__ */ jsx8("span", { children: label })
|
|
466
|
+
]
|
|
1042
467
|
}
|
|
1043
468
|
);
|
|
1044
469
|
}
|
|
1045
470
|
);
|
|
1046
|
-
|
|
471
|
+
SelectionButton.displayName = "SelectionButton";
|
|
1047
472
|
|
|
1048
|
-
// src/components/
|
|
1049
|
-
import {
|
|
1050
|
-
import { jsx as
|
|
1051
|
-
var
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
success: "bg-success text-success-800 border-none focus-visible:outline-none",
|
|
1055
|
-
info: "bg-info text-info-800 border-none focus-visible:outline-none"
|
|
1056
|
-
},
|
|
1057
|
-
outlined: {
|
|
1058
|
-
warning: "bg-warning text-warning-800 border border-warning-200 focus-visible:outline-none",
|
|
1059
|
-
success: "bg-success text-success-800 border border-success-200 focus-visible:outline-none",
|
|
1060
|
-
info: "bg-info text-info-800 border border-info-200 focus-visible:outline-none"
|
|
1061
|
-
}
|
|
1062
|
-
};
|
|
1063
|
-
var iconMap = {
|
|
1064
|
-
success: CheckCircle,
|
|
1065
|
-
info: Info,
|
|
1066
|
-
warning: WarningCircle
|
|
1067
|
-
};
|
|
1068
|
-
var Toast = ({
|
|
1069
|
-
variant = "outlined",
|
|
1070
|
-
action = "success",
|
|
1071
|
-
className = "",
|
|
1072
|
-
onClose,
|
|
1073
|
-
title,
|
|
1074
|
-
description,
|
|
1075
|
-
position = "default",
|
|
1076
|
-
...props
|
|
1077
|
-
}) => {
|
|
1078
|
-
const variantClasses = VARIANT_ACTION_CLASSES3[variant][action];
|
|
1079
|
-
const positionClasses = {
|
|
1080
|
-
"top-left": "fixed top-4 left-4",
|
|
1081
|
-
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
1082
|
-
"top-right": "fixed top-4 right-4",
|
|
1083
|
-
"bottom-left": "fixed bottom-4 left-4",
|
|
1084
|
-
"bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
|
|
1085
|
-
"bottom-right": "fixed bottom-4 right-4",
|
|
1086
|
-
default: ""
|
|
1087
|
-
};
|
|
1088
|
-
const IconAction = iconMap[action] || iconMap["success"];
|
|
1089
|
-
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
1090
|
-
return /* @__PURE__ */ jsxs9(
|
|
1091
|
-
"div",
|
|
473
|
+
// src/components/Table/Table.tsx
|
|
474
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
475
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
476
|
+
var Table = forwardRef4(
|
|
477
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx9("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ jsxs6(
|
|
478
|
+
"table",
|
|
1092
479
|
{
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
"aria-atomic": "true",
|
|
1096
|
-
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
480
|
+
ref,
|
|
481
|
+
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
1097
482
|
...props,
|
|
1098
483
|
children: [
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
|
|
1101
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col items-start justify-start", children: [
|
|
1102
|
-
/* @__PURE__ */ jsx12("p", { className: "font-semibold text-md", children: title }),
|
|
1103
|
-
description && /* @__PURE__ */ jsx12("p", { className: "text-md text-text-900", children: description })
|
|
1104
|
-
] })
|
|
1105
|
-
] }),
|
|
1106
|
-
/* @__PURE__ */ jsx12(
|
|
1107
|
-
"button",
|
|
1108
|
-
{
|
|
1109
|
-
onClick: onClose,
|
|
1110
|
-
"aria-label": "Dismiss notification",
|
|
1111
|
-
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1112
|
-
children: /* @__PURE__ */ jsx12(X, {})
|
|
1113
|
-
}
|
|
1114
|
-
)
|
|
484
|
+
/* @__PURE__ */ jsx9("caption", { className: "sr-only", children: "My Table" }),
|
|
485
|
+
children
|
|
1115
486
|
]
|
|
1116
487
|
}
|
|
1117
|
-
)
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
set((state) => ({
|
|
1127
|
-
toasts: [...state.toasts, { id, ...toast }]
|
|
1128
|
-
}));
|
|
1129
|
-
},
|
|
1130
|
-
removeToast: (id) => {
|
|
1131
|
-
set((state) => ({
|
|
1132
|
-
toasts: state.toasts.filter((t) => t.id !== id)
|
|
1133
|
-
}));
|
|
488
|
+
) })
|
|
489
|
+
);
|
|
490
|
+
Table.displayName = "Table";
|
|
491
|
+
var TableHeader = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
492
|
+
"thead",
|
|
493
|
+
{
|
|
494
|
+
ref,
|
|
495
|
+
className: `[&_tr:first-child]:border-0 ${className}`,
|
|
496
|
+
...props
|
|
1134
497
|
}
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
var
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
498
|
+
));
|
|
499
|
+
TableHeader.displayName = "TableHeader";
|
|
500
|
+
var TableBody = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
501
|
+
"tbody",
|
|
502
|
+
{
|
|
503
|
+
ref,
|
|
504
|
+
className: `[&_tr:last-child]:border-0 border-t border-border-200 ${className}`,
|
|
505
|
+
...props
|
|
506
|
+
}
|
|
507
|
+
));
|
|
508
|
+
TableBody.displayName = "TableBody";
|
|
509
|
+
var TableFooter = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
510
|
+
"tfoot",
|
|
511
|
+
{
|
|
512
|
+
ref,
|
|
513
|
+
className: `border-t bg-background-50 border-border-200 font-medium [&>tr]:last:border-b-0 px-6 py-3.5 ${className}`,
|
|
514
|
+
...props
|
|
515
|
+
}
|
|
516
|
+
));
|
|
517
|
+
TableFooter.displayName = "TableFooter";
|
|
518
|
+
var VARIANT_STATES_ROW = {
|
|
519
|
+
default: "border-b border-border-200",
|
|
520
|
+
selected: "border-b-2 border-indicator-primary",
|
|
521
|
+
invalid: "border-b-2 border-indicator-error",
|
|
522
|
+
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
1159
523
|
};
|
|
524
|
+
var TableRow = forwardRef4(
|
|
525
|
+
({ state = "default", className, ...props }, ref) => {
|
|
526
|
+
return /* @__PURE__ */ jsx9(
|
|
527
|
+
"tr",
|
|
528
|
+
{
|
|
529
|
+
ref,
|
|
530
|
+
className: `
|
|
531
|
+
transition-colors
|
|
532
|
+
${state !== "disabled" ? "hover:bg-muted/50" : ""}
|
|
533
|
+
${VARIANT_STATES_ROW[state]}
|
|
534
|
+
${className}
|
|
535
|
+
`,
|
|
536
|
+
"aria-disabled": state === "disabled",
|
|
537
|
+
...props
|
|
538
|
+
}
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
TableRow.displayName = "TableRow";
|
|
543
|
+
var TableHead = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
544
|
+
"th",
|
|
545
|
+
{
|
|
546
|
+
ref,
|
|
547
|
+
className: `h-10 px-6 py-3.5 bg-bg-secondary bg-muted/50 text-left align-middle font-bold text-text-800 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] ${className}`,
|
|
548
|
+
...props
|
|
549
|
+
}
|
|
550
|
+
));
|
|
551
|
+
TableHead.displayName = "TableHead";
|
|
552
|
+
var TableCell = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
553
|
+
"td",
|
|
554
|
+
{
|
|
555
|
+
ref,
|
|
556
|
+
className: `p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-md text-text-800 px-6 py-3.5 ${className}`,
|
|
557
|
+
...props
|
|
558
|
+
}
|
|
559
|
+
));
|
|
560
|
+
TableCell.displayName = "TableCell";
|
|
561
|
+
var TableCaption = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
562
|
+
"caption",
|
|
563
|
+
{
|
|
564
|
+
ref,
|
|
565
|
+
className: `border-t border-border-200 text-sm text-text-800 px-6 py-3.5 ${className}`,
|
|
566
|
+
...props
|
|
567
|
+
}
|
|
568
|
+
));
|
|
569
|
+
TableCaption.displayName = "TableCaption";
|
|
1160
570
|
export {
|
|
571
|
+
Alert,
|
|
1161
572
|
Badge,
|
|
1162
573
|
Button,
|
|
1163
|
-
CheckBox,
|
|
1164
|
-
DropdownMenu,
|
|
1165
|
-
DropdownMenuTrigger,
|
|
1166
574
|
IconButton,
|
|
1167
575
|
IconRoundedButton,
|
|
1168
|
-
MenuContent,
|
|
1169
|
-
MenuItem,
|
|
1170
|
-
MenuLabel,
|
|
1171
|
-
MenuSeparator,
|
|
1172
576
|
NavButton,
|
|
1173
577
|
SelectionButton,
|
|
1174
578
|
Table,
|
|
@@ -1179,10 +583,5 @@ export {
|
|
|
1179
583
|
TableHead,
|
|
1180
584
|
TableHeader,
|
|
1181
585
|
TableRow,
|
|
1182
|
-
Text
|
|
1183
|
-
TextArea,
|
|
1184
|
-
Toast,
|
|
1185
|
-
Toaster,
|
|
1186
|
-
useToast,
|
|
1187
|
-
useToastStore
|
|
586
|
+
Text
|
|
1188
587
|
};
|