@platned/ui 0.1.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.
- package/README.md +68 -0
- package/dist/index.cjs +1351 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +293 -0
- package/dist/index.d.ts +293 -0
- package/dist/index.js +1284 -0
- package/dist/index.js.map +1 -0
- package/dist/sidebar.cjs +402 -0
- package/dist/sidebar.cjs.map +1 -0
- package/dist/sidebar.d.cts +13 -0
- package/dist/sidebar.d.ts +13 -0
- package/dist/sidebar.js +367 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +69 -0
- package/tailwind-preset.js +77 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1351 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.tsx
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
Avatar: () => Avatar,
|
|
34
|
+
AvatarGroup: () => AvatarGroup,
|
|
35
|
+
Button: () => Button,
|
|
36
|
+
ButtonGroup: () => ButtonGroup,
|
|
37
|
+
DataTable: () => DataTable,
|
|
38
|
+
DocumentRow: () => DocumentRow,
|
|
39
|
+
FileDropZone: () => FileDropZone,
|
|
40
|
+
FormCard: () => FormCard,
|
|
41
|
+
FormCardFooter: () => FormCardFooter,
|
|
42
|
+
FormCardHeader: () => FormCardHeader,
|
|
43
|
+
IconButton: () => IconButton,
|
|
44
|
+
Input: () => Input,
|
|
45
|
+
MetricCard: () => MetricCard,
|
|
46
|
+
Modal: () => Modal,
|
|
47
|
+
MultiSelectCard: () => MultiSelectCard,
|
|
48
|
+
NavItem: () => NavItem,
|
|
49
|
+
Panel: () => Panel,
|
|
50
|
+
ROLE_COMBO_OPTIONS: () => ROLE_COMBO_OPTIONS,
|
|
51
|
+
RoleBadge: () => RoleBadge,
|
|
52
|
+
RoleComboBox: () => RoleComboBox,
|
|
53
|
+
SectionHeading: () => SectionHeading,
|
|
54
|
+
Select: () => Select,
|
|
55
|
+
SentimentBadge: () => SentimentBadge,
|
|
56
|
+
SeverityBadge: () => SeverityBadge,
|
|
57
|
+
StatTile: () => StatTile,
|
|
58
|
+
Stepper: () => Stepper,
|
|
59
|
+
TableCellBadge: () => TableCellBadge,
|
|
60
|
+
TableCellLeadText: () => TableCellLeadText,
|
|
61
|
+
TableCellProgress: () => TableCellProgress,
|
|
62
|
+
TableCellStatusPill: () => TableCellStatusPill,
|
|
63
|
+
TableCellText: () => TableCellText,
|
|
64
|
+
Textarea: () => Textarea,
|
|
65
|
+
Toggle: () => Toggle
|
|
66
|
+
});
|
|
67
|
+
module.exports = __toCommonJS(src_exports);
|
|
68
|
+
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
69
|
+
|
|
70
|
+
// src/components/button.tsx
|
|
71
|
+
var import_clsx = __toESM(require("clsx"), 1);
|
|
72
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
73
|
+
var variantStyles = {
|
|
74
|
+
primary: (0, import_clsx.default)(
|
|
75
|
+
"bg-background-brand border border-border-brand text-text-brand-on-brand",
|
|
76
|
+
"hover:bg-background-brand-hover",
|
|
77
|
+
"disabled:bg-background-disabled disabled:border-border-disabled disabled:text-text-disabled-on-disabled"
|
|
78
|
+
),
|
|
79
|
+
neutral: (0, import_clsx.default)(
|
|
80
|
+
"bg-background-default border border-border-default text-text-default",
|
|
81
|
+
"hover:bg-background-default-hover",
|
|
82
|
+
"disabled:bg-background-disabled disabled:border-border-disabled disabled:text-text-disabled-on-disabled"
|
|
83
|
+
),
|
|
84
|
+
subtle: (0, import_clsx.default)(
|
|
85
|
+
"bg-transparent text-text-neutral",
|
|
86
|
+
"hover:bg-background-neutral-tertiary",
|
|
87
|
+
"disabled:bg-background-disabled disabled:border disabled:border-border-disabled disabled:text-text-disabled-on-disabled"
|
|
88
|
+
),
|
|
89
|
+
danger: (0, import_clsx.default)(
|
|
90
|
+
"bg-background-danger border border-border-danger-secondary text-text-danger-on-danger",
|
|
91
|
+
"hover:bg-background-danger-hover",
|
|
92
|
+
"disabled:bg-background-disabled disabled:border-border-disabled disabled:text-text-disabled-on-disabled"
|
|
93
|
+
),
|
|
94
|
+
"danger-subtle": (0, import_clsx.default)(
|
|
95
|
+
"bg-transparent text-text-danger",
|
|
96
|
+
"hover:bg-background-danger-tertiary",
|
|
97
|
+
"disabled:bg-background-disabled disabled:border disabled:border-border-disabled disabled:text-text-disabled-on-disabled"
|
|
98
|
+
)
|
|
99
|
+
};
|
|
100
|
+
var sizeStyles = {
|
|
101
|
+
lg: "h-12 px-3 gap-1 rounded-2xl text-body font-semibold [&_svg]:size-5",
|
|
102
|
+
md: "h-9 px-2 gap-0.5 rounded-lg text-body-sm font-semibold [&_svg]:size-5",
|
|
103
|
+
sm: "h-6 px-1.5 pt-0.5 gap-0 rounded-full text-body-tiny font-semibold [&_svg]:size-4"
|
|
104
|
+
};
|
|
105
|
+
function Button({
|
|
106
|
+
variant = "primary",
|
|
107
|
+
size = "md",
|
|
108
|
+
leadingIcon,
|
|
109
|
+
trailingIcon,
|
|
110
|
+
children,
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}) {
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
115
|
+
"button",
|
|
116
|
+
{
|
|
117
|
+
className: (0, import_clsx.default)(
|
|
118
|
+
"inline-flex items-center justify-center whitespace-nowrap transition-colors",
|
|
119
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-brand focus-visible:ring-offset-1",
|
|
120
|
+
"disabled:cursor-not-allowed",
|
|
121
|
+
variantStyles[variant],
|
|
122
|
+
sizeStyles[size],
|
|
123
|
+
className
|
|
124
|
+
),
|
|
125
|
+
...props,
|
|
126
|
+
children: [
|
|
127
|
+
leadingIcon,
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-1", children }),
|
|
129
|
+
trailingIcon
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/components/icon-button.tsx
|
|
136
|
+
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
137
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
138
|
+
var variantStyles2 = {
|
|
139
|
+
primary: (0, import_clsx2.default)(
|
|
140
|
+
"bg-background-brand border border-border-brand text-text-brand-on-brand",
|
|
141
|
+
"hover:bg-background-brand-hover",
|
|
142
|
+
"disabled:bg-background-disabled disabled:border-border-disabled disabled:text-text-disabled-on-disabled"
|
|
143
|
+
),
|
|
144
|
+
// Neutral uses secondary background (light gray) for visual weight without a text label
|
|
145
|
+
neutral: (0, import_clsx2.default)(
|
|
146
|
+
"bg-background-default-secondary border border-border-default text-text-default",
|
|
147
|
+
"hover:bg-background-default-secondary-hover",
|
|
148
|
+
"disabled:bg-background-disabled disabled:border-border-disabled disabled:text-text-disabled-on-disabled"
|
|
149
|
+
),
|
|
150
|
+
subtle: (0, import_clsx2.default)(
|
|
151
|
+
"bg-transparent text-text-neutral",
|
|
152
|
+
"hover:bg-background-neutral-tertiary",
|
|
153
|
+
"disabled:bg-background-disabled disabled:border disabled:border-border-disabled disabled:text-text-disabled-on-disabled"
|
|
154
|
+
)
|
|
155
|
+
};
|
|
156
|
+
var sizeStyles2 = {
|
|
157
|
+
lg: "size-12 rounded-2xl [&_svg]:size-5",
|
|
158
|
+
md: "size-9 rounded-lg [&_svg]:size-5",
|
|
159
|
+
sm: "size-6 rounded-full [&_svg]:size-4"
|
|
160
|
+
};
|
|
161
|
+
function IconButton({
|
|
162
|
+
variant = "primary",
|
|
163
|
+
size = "md",
|
|
164
|
+
icon,
|
|
165
|
+
className,
|
|
166
|
+
...props
|
|
167
|
+
}) {
|
|
168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
169
|
+
"button",
|
|
170
|
+
{
|
|
171
|
+
className: (0, import_clsx2.default)(
|
|
172
|
+
"inline-flex shrink-0 items-center justify-center transition-colors",
|
|
173
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-brand focus-visible:ring-offset-1",
|
|
174
|
+
"disabled:cursor-not-allowed",
|
|
175
|
+
variantStyles2[variant],
|
|
176
|
+
sizeStyles2[size],
|
|
177
|
+
className
|
|
178
|
+
),
|
|
179
|
+
...props,
|
|
180
|
+
children: icon
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// src/components/button-group.tsx
|
|
186
|
+
var import_clsx3 = __toESM(require("clsx"), 1);
|
|
187
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
188
|
+
var containerStyles = {
|
|
189
|
+
primary: "bg-background-neutral-tertiary p-1 rounded-2xl",
|
|
190
|
+
neutral: "bg-background-neutral-tertiary p-1 rounded-2xl",
|
|
191
|
+
filter: "bg-background-default border border-border-default p-1 rounded-xl"
|
|
192
|
+
};
|
|
193
|
+
var selectedStyles = {
|
|
194
|
+
primary: (0, import_clsx3.default)(
|
|
195
|
+
"bg-background-brand border border-border-brand text-text-brand-on-brand",
|
|
196
|
+
"hover:bg-background-brand-hover"
|
|
197
|
+
),
|
|
198
|
+
neutral: (0, import_clsx3.default)(
|
|
199
|
+
"bg-background-default border border-border-default text-text-default",
|
|
200
|
+
"hover:bg-background-default-hover"
|
|
201
|
+
),
|
|
202
|
+
filter: (0, import_clsx3.default)(
|
|
203
|
+
"bg-background-brand text-text-brand-on-brand",
|
|
204
|
+
"hover:bg-background-brand-hover"
|
|
205
|
+
)
|
|
206
|
+
};
|
|
207
|
+
var unselectedStyles = {
|
|
208
|
+
primary: (0, import_clsx3.default)("bg-transparent text-text-neutral", "hover:bg-background-neutral-tertiary-hover"),
|
|
209
|
+
neutral: (0, import_clsx3.default)("bg-transparent text-text-neutral", "hover:bg-background-neutral-tertiary-hover"),
|
|
210
|
+
filter: (0, import_clsx3.default)("text-text-default-secondary", "hover:text-text-default")
|
|
211
|
+
};
|
|
212
|
+
var itemSizeStyles = {
|
|
213
|
+
lg: "h-12 px-3 gap-1 rounded-2xl text-body font-semibold [&_svg]:size-5",
|
|
214
|
+
md: "h-9 px-2 gap-0.5 rounded-lg text-body-sm font-semibold [&_svg]:size-5",
|
|
215
|
+
sm: "h-6 px-1.5 pt-0.5 gap-0 rounded-full text-body-tiny font-semibold [&_svg]:size-4"
|
|
216
|
+
};
|
|
217
|
+
var containerAlignStyles = {
|
|
218
|
+
justify: "flex flex-row items-center",
|
|
219
|
+
start: "flex flex-row items-center justify-start",
|
|
220
|
+
end: "flex flex-row items-center justify-end",
|
|
221
|
+
center: "flex flex-row items-center justify-center",
|
|
222
|
+
stack: "flex flex-col items-center"
|
|
223
|
+
};
|
|
224
|
+
function ButtonGroup({
|
|
225
|
+
items,
|
|
226
|
+
value,
|
|
227
|
+
onChange,
|
|
228
|
+
variant = "primary",
|
|
229
|
+
size = "md",
|
|
230
|
+
align = "start",
|
|
231
|
+
className,
|
|
232
|
+
"aria-label": ariaLabel
|
|
233
|
+
}) {
|
|
234
|
+
const isJustify = align === "justify";
|
|
235
|
+
const isStack = align === "stack";
|
|
236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
237
|
+
"div",
|
|
238
|
+
{
|
|
239
|
+
role: "group",
|
|
240
|
+
"aria-label": ariaLabel,
|
|
241
|
+
className: (0, import_clsx3.default)(
|
|
242
|
+
containerStyles[variant],
|
|
243
|
+
containerAlignStyles[align],
|
|
244
|
+
className
|
|
245
|
+
),
|
|
246
|
+
children: items.map((item) => {
|
|
247
|
+
const isSelected = item.value === value;
|
|
248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
249
|
+
"div",
|
|
250
|
+
{
|
|
251
|
+
className: (0, import_clsx3.default)(isJustify && "flex-1 min-w-0", isStack && "w-full"),
|
|
252
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
253
|
+
"button",
|
|
254
|
+
{
|
|
255
|
+
type: "button",
|
|
256
|
+
"aria-pressed": isSelected,
|
|
257
|
+
disabled: item.disabled,
|
|
258
|
+
onClick: () => onChange(item.value),
|
|
259
|
+
className: (0, import_clsx3.default)(
|
|
260
|
+
"inline-flex items-center justify-center whitespace-nowrap transition-colors",
|
|
261
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-brand focus-visible:ring-offset-1",
|
|
262
|
+
"disabled:cursor-not-allowed disabled:text-text-disabled",
|
|
263
|
+
(isJustify || isStack) && "w-full",
|
|
264
|
+
itemSizeStyles[size],
|
|
265
|
+
isSelected ? selectedStyles[variant] : unselectedStyles[variant]
|
|
266
|
+
),
|
|
267
|
+
children: [
|
|
268
|
+
item.leadingIcon,
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "px-1", children: item.label }),
|
|
270
|
+
item.trailingIcon
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
},
|
|
275
|
+
item.value
|
|
276
|
+
);
|
|
277
|
+
})
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// src/components/avatar.tsx
|
|
283
|
+
var import_clsx4 = __toESM(require("clsx"), 1);
|
|
284
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
285
|
+
var sizeStyles3 = {
|
|
286
|
+
lg: "size-10",
|
|
287
|
+
md: "size-8",
|
|
288
|
+
sm: "size-6"
|
|
289
|
+
};
|
|
290
|
+
var initialTextStyles = {
|
|
291
|
+
lg: "text-body font-semibold",
|
|
292
|
+
md: "text-body-xs font-semibold",
|
|
293
|
+
sm: "text-body-tiny font-semibold"
|
|
294
|
+
};
|
|
295
|
+
var shapeStyles = {
|
|
296
|
+
circle: "rounded-full",
|
|
297
|
+
square: "rounded-lg"
|
|
298
|
+
};
|
|
299
|
+
function Avatar(props) {
|
|
300
|
+
const { size = "lg", shape = "circle", className } = props;
|
|
301
|
+
const base = (0, import_clsx4.default)(
|
|
302
|
+
"shrink-0 overflow-hidden",
|
|
303
|
+
sizeStyles3[size],
|
|
304
|
+
shapeStyles[shape],
|
|
305
|
+
className
|
|
306
|
+
);
|
|
307
|
+
if (props.type === "image") {
|
|
308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: base, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
309
|
+
"img",
|
|
310
|
+
{
|
|
311
|
+
src: props.src,
|
|
312
|
+
alt: props.alt ?? "",
|
|
313
|
+
className: "size-full object-cover"
|
|
314
|
+
}
|
|
315
|
+
) });
|
|
316
|
+
}
|
|
317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
318
|
+
"div",
|
|
319
|
+
{
|
|
320
|
+
className: (0, import_clsx4.default)(base, "flex items-center justify-center"),
|
|
321
|
+
style: {
|
|
322
|
+
background: "linear-gradient(135deg, var(--color-graphic-blue) 30%, var(--color-graphic-red) 100%)"
|
|
323
|
+
},
|
|
324
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
325
|
+
"span",
|
|
326
|
+
{
|
|
327
|
+
className: (0, import_clsx4.default)(
|
|
328
|
+
"select-none leading-none text-text-brand-on-brand",
|
|
329
|
+
initialTextStyles[size]
|
|
330
|
+
),
|
|
331
|
+
children: props.initial.charAt(0).toUpperCase()
|
|
332
|
+
}
|
|
333
|
+
)
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// src/components/avatar-group.tsx
|
|
339
|
+
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
340
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
341
|
+
function AvatarGroup({
|
|
342
|
+
children,
|
|
343
|
+
overflow,
|
|
344
|
+
spacing = "spaced",
|
|
345
|
+
className
|
|
346
|
+
}) {
|
|
347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
348
|
+
"div",
|
|
349
|
+
{
|
|
350
|
+
className: (0, import_clsx5.default)(
|
|
351
|
+
"flex items-center",
|
|
352
|
+
spacing === "spaced" ? "gap-1" : "-space-x-2 isolate",
|
|
353
|
+
className
|
|
354
|
+
),
|
|
355
|
+
children: [
|
|
356
|
+
children,
|
|
357
|
+
overflow !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
358
|
+
"div",
|
|
359
|
+
{
|
|
360
|
+
className: (0, import_clsx5.default)(
|
|
361
|
+
"flex items-center justify-center",
|
|
362
|
+
"min-w-6 h-6 px-1 rounded-lg",
|
|
363
|
+
"bg-background-default-secondary text-text-default-secondary text-body-sm",
|
|
364
|
+
spacing === "overlap" && "drop-shadow-sm"
|
|
365
|
+
),
|
|
366
|
+
children: [
|
|
367
|
+
"+",
|
|
368
|
+
overflow
|
|
369
|
+
]
|
|
370
|
+
}
|
|
371
|
+
)
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// src/components/nav-item.tsx
|
|
378
|
+
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
379
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
380
|
+
function NavItem({
|
|
381
|
+
icon,
|
|
382
|
+
label,
|
|
383
|
+
isActive = false,
|
|
384
|
+
indicator = false,
|
|
385
|
+
collapsed = false,
|
|
386
|
+
className
|
|
387
|
+
}) {
|
|
388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
389
|
+
"span",
|
|
390
|
+
{
|
|
391
|
+
className: (0, import_clsx6.default)(
|
|
392
|
+
"relative flex h-11 w-full items-center gap-3 rounded-xl px-3.5 py-2.5 transition-colors",
|
|
393
|
+
collapsed && "justify-center",
|
|
394
|
+
isActive ? "bg-background-brand text-text-brand-on-brand" : [
|
|
395
|
+
"border border-border-default bg-background-default text-text-default-secondary",
|
|
396
|
+
"hover:bg-background-brand-tertiary-hover hover:border-border-brand-tertiary hover:text-text-brand"
|
|
397
|
+
],
|
|
398
|
+
className
|
|
399
|
+
),
|
|
400
|
+
children: [
|
|
401
|
+
icon !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "shrink-0 [&_svg]:size-4", children: icon }),
|
|
402
|
+
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "flex-1 min-w-0 truncate text-body-sm font-regular leading-snug", children: label }),
|
|
403
|
+
indicator && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "absolute -right-px -top-px size-2 rounded-full bg-background-danger" })
|
|
404
|
+
]
|
|
405
|
+
}
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// src/components/input.tsx
|
|
410
|
+
var import_react = require("react");
|
|
411
|
+
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
412
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
413
|
+
var wrapGap = {
|
|
414
|
+
lg: "gap-2",
|
|
415
|
+
// 8px
|
|
416
|
+
md: "gap-1",
|
|
417
|
+
// 4px
|
|
418
|
+
sm: "gap-0.5"
|
|
419
|
+
// 2px
|
|
420
|
+
};
|
|
421
|
+
var labelText = {
|
|
422
|
+
lg: "text-body",
|
|
423
|
+
md: "text-body-sm",
|
|
424
|
+
sm: "text-body-tiny"
|
|
425
|
+
};
|
|
426
|
+
var inputBase = {
|
|
427
|
+
lg: "h-12 px-4 py-3.5 text-body",
|
|
428
|
+
md: "h-9 px-3 py-2.5 text-body-sm",
|
|
429
|
+
sm: "h-6 px-2 py-[5px] text-body-tiny"
|
|
430
|
+
};
|
|
431
|
+
var leadingPad = {
|
|
432
|
+
lg: "pl-10",
|
|
433
|
+
md: "pl-8",
|
|
434
|
+
sm: "pl-6"
|
|
435
|
+
};
|
|
436
|
+
var trailingPad = {
|
|
437
|
+
lg: "pr-10",
|
|
438
|
+
md: "pr-8",
|
|
439
|
+
sm: "pr-6"
|
|
440
|
+
};
|
|
441
|
+
var iconWrap = {
|
|
442
|
+
lg: { left: "left-4", right: "right-4", size: "size-5" },
|
|
443
|
+
md: { left: "left-3", right: "right-3", size: "size-4" },
|
|
444
|
+
sm: { left: "left-2", right: "right-2", size: "size-3" }
|
|
445
|
+
};
|
|
446
|
+
var Input = (0, import_react.forwardRef)(function Input2({ label, description, error, hint, size = "md", leadingIcon, trailingIcon, className, disabled, id, ...props }, ref) {
|
|
447
|
+
const hasError = !!error;
|
|
448
|
+
const iw = iconWrap[size];
|
|
449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx7.default)("flex flex-col", wrapGap[size], className), children: [
|
|
450
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
451
|
+
"label",
|
|
452
|
+
{
|
|
453
|
+
htmlFor: id,
|
|
454
|
+
className: (0, import_clsx7.default)(labelText[size], disabled ? "text-text-disabled" : "text-text-default"),
|
|
455
|
+
children: label
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: (0, import_clsx7.default)(labelText[size], disabled ? "text-text-disabled" : "text-text-default-secondary"), children: description }),
|
|
459
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative flex items-center", children: [
|
|
460
|
+
leadingIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: (0, import_clsx7.default)("pointer-events-none absolute", iw.left, iw.size, "flex items-center justify-center text-icon-default-secondary"), children: leadingIcon }),
|
|
461
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
462
|
+
"input",
|
|
463
|
+
{
|
|
464
|
+
ref,
|
|
465
|
+
id,
|
|
466
|
+
disabled,
|
|
467
|
+
className: (0, import_clsx7.default)(
|
|
468
|
+
"w-full rounded-lg border outline-none transition-colors",
|
|
469
|
+
"bg-background-default text-text-default",
|
|
470
|
+
"placeholder:text-text-default-tertiary",
|
|
471
|
+
inputBase[size],
|
|
472
|
+
leadingIcon && leadingPad[size],
|
|
473
|
+
trailingIcon && trailingPad[size],
|
|
474
|
+
disabled ? "cursor-not-allowed bg-background-disabled border-border-disabled text-text-disabled placeholder:text-text-disabled" : hasError ? "border-border-danger-secondary focus:border-border-danger-secondary focus:ring-1 focus:ring-border-danger-secondary" : "border-border-default focus:border-border-brand-tertiary focus:ring-1 focus:ring-border-brand-tertiary"
|
|
475
|
+
),
|
|
476
|
+
...props
|
|
477
|
+
}
|
|
478
|
+
),
|
|
479
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: (0, import_clsx7.default)("pointer-events-none absolute", iw.right, iw.size, "flex items-center justify-center text-icon-default-secondary"), children: trailingIcon })
|
|
480
|
+
] }),
|
|
481
|
+
hasError && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: (0, import_clsx7.default)(labelText[size], "text-text-danger"), children: error }),
|
|
482
|
+
!hasError && hint && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: (0, import_clsx7.default)(labelText[size], "text-text-default-secondary"), children: hint })
|
|
483
|
+
] });
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
// src/components/textarea.tsx
|
|
487
|
+
var import_react2 = require("react");
|
|
488
|
+
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
489
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
490
|
+
var wrapGap2 = {
|
|
491
|
+
lg: "gap-2",
|
|
492
|
+
md: "gap-1",
|
|
493
|
+
sm: "gap-0.5"
|
|
494
|
+
};
|
|
495
|
+
var labelText2 = {
|
|
496
|
+
lg: "text-body",
|
|
497
|
+
md: "text-body-sm",
|
|
498
|
+
sm: "text-body-tiny"
|
|
499
|
+
};
|
|
500
|
+
var textareaBase = {
|
|
501
|
+
lg: "min-h-20 px-4 py-3.5 text-body",
|
|
502
|
+
md: "min-h-[68px] px-3 py-2.5 text-body-sm",
|
|
503
|
+
sm: "min-h-[52px] px-2 py-[5px] text-body-tiny"
|
|
504
|
+
};
|
|
505
|
+
var Textarea = (0, import_react2.forwardRef)(function Textarea2({ label, description, error, hint, size = "md", className, disabled, id, ...props }, ref) {
|
|
506
|
+
const hasError = !!error;
|
|
507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx8.default)("flex flex-col", wrapGap2[size], className), children: [
|
|
508
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
509
|
+
"label",
|
|
510
|
+
{
|
|
511
|
+
htmlFor: id,
|
|
512
|
+
className: (0, import_clsx8.default)(labelText2[size], disabled ? "text-text-disabled" : "text-text-default"),
|
|
513
|
+
children: label
|
|
514
|
+
}
|
|
515
|
+
),
|
|
516
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: (0, import_clsx8.default)(labelText2[size], disabled ? "text-text-disabled" : "text-text-default-secondary"), children: description }),
|
|
517
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
518
|
+
"textarea",
|
|
519
|
+
{
|
|
520
|
+
ref,
|
|
521
|
+
id,
|
|
522
|
+
disabled,
|
|
523
|
+
className: (0, import_clsx8.default)(
|
|
524
|
+
"w-full rounded-lg border outline-none transition-colors resize-y",
|
|
525
|
+
"bg-background-default text-text-default",
|
|
526
|
+
"placeholder:text-text-default-tertiary",
|
|
527
|
+
textareaBase[size],
|
|
528
|
+
disabled ? "cursor-not-allowed bg-background-disabled border-border-disabled text-text-disabled placeholder:text-text-disabled resize-none" : hasError ? "border-border-danger-secondary focus:border-border-danger-secondary focus:ring-1 focus:ring-border-danger-secondary" : "border-border-default focus:border-border-brand-tertiary focus:ring-1 focus:ring-border-brand-tertiary"
|
|
529
|
+
),
|
|
530
|
+
...props
|
|
531
|
+
}
|
|
532
|
+
),
|
|
533
|
+
hasError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: (0, import_clsx8.default)(labelText2[size], "text-text-danger"), children: error }),
|
|
534
|
+
!hasError && hint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: (0, import_clsx8.default)(labelText2[size], "text-text-default-secondary"), children: hint })
|
|
535
|
+
] });
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
// src/components/select.tsx
|
|
539
|
+
var import_react3 = require("react");
|
|
540
|
+
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
541
|
+
var import_lu = require("react-icons/lu");
|
|
542
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
543
|
+
var wrapGap3 = {
|
|
544
|
+
lg: "gap-2",
|
|
545
|
+
md: "gap-1",
|
|
546
|
+
sm: "gap-0.5"
|
|
547
|
+
};
|
|
548
|
+
var labelText3 = {
|
|
549
|
+
lg: "text-body",
|
|
550
|
+
md: "text-body-sm",
|
|
551
|
+
sm: "text-body-tiny"
|
|
552
|
+
};
|
|
553
|
+
var selectBase = {
|
|
554
|
+
lg: "h-12 pl-4 pr-9 text-body",
|
|
555
|
+
// right-4 (16) + size-5 (20) = 36px
|
|
556
|
+
md: "h-9 pl-3 pr-7 text-body-sm",
|
|
557
|
+
// right-3 (12) + size-4 (16) = 28px
|
|
558
|
+
sm: "h-6 pl-2 pr-5 text-body-tiny"
|
|
559
|
+
// right-2 (8) + size-3 (12) = 20px
|
|
560
|
+
};
|
|
561
|
+
var chevronPos = {
|
|
562
|
+
lg: { right: "right-4", size: "size-5" },
|
|
563
|
+
md: { right: "right-3", size: "size-4" },
|
|
564
|
+
sm: { right: "right-2", size: "size-3" }
|
|
565
|
+
};
|
|
566
|
+
var Select = (0, import_react3.forwardRef)(function Select2({ label, description, error, hint, size = "md", options, placeholder, className, disabled, id, ...props }, ref) {
|
|
567
|
+
const hasError = !!error;
|
|
568
|
+
const cp = chevronPos[size];
|
|
569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_clsx9.default)("flex flex-col", wrapGap3[size], className), children: [
|
|
570
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
571
|
+
"label",
|
|
572
|
+
{
|
|
573
|
+
htmlFor: id,
|
|
574
|
+
className: (0, import_clsx9.default)(labelText3[size], disabled ? "text-text-disabled" : "text-text-default"),
|
|
575
|
+
children: label
|
|
576
|
+
}
|
|
577
|
+
),
|
|
578
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: (0, import_clsx9.default)(labelText3[size], disabled ? "text-text-disabled" : "text-text-default-secondary"), children: description }),
|
|
579
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative flex items-center", children: [
|
|
580
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
581
|
+
"select",
|
|
582
|
+
{
|
|
583
|
+
ref,
|
|
584
|
+
id,
|
|
585
|
+
disabled,
|
|
586
|
+
className: (0, import_clsx9.default)(
|
|
587
|
+
"w-full appearance-none rounded-lg border outline-none transition-colors pt-0.5",
|
|
588
|
+
"bg-background-default text-text-default",
|
|
589
|
+
selectBase[size],
|
|
590
|
+
disabled ? "cursor-not-allowed bg-background-disabled border-border-disabled text-text-disabled" : hasError ? "border-border-danger-secondary focus:border-border-danger-secondary focus:ring-1 focus:ring-border-danger-secondary" : "border-border-default focus:border-border-brand-tertiary focus:ring-1 focus:ring-border-brand-tertiary"
|
|
591
|
+
),
|
|
592
|
+
...props,
|
|
593
|
+
children: [
|
|
594
|
+
placeholder && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "", disabled: true, children: placeholder }),
|
|
595
|
+
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
),
|
|
599
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
600
|
+
"span",
|
|
601
|
+
{
|
|
602
|
+
className: (0, import_clsx9.default)(
|
|
603
|
+
"pointer-events-none absolute",
|
|
604
|
+
cp.right,
|
|
605
|
+
cp.size,
|
|
606
|
+
"flex items-center justify-center",
|
|
607
|
+
disabled ? "text-icon-disabled" : "text-icon-default-secondary"
|
|
608
|
+
),
|
|
609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lu.LuChevronDown, { className: "size-full" })
|
|
610
|
+
}
|
|
611
|
+
)
|
|
612
|
+
] }),
|
|
613
|
+
hasError && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: (0, import_clsx9.default)(labelText3[size], "text-text-danger"), children: error }),
|
|
614
|
+
!hasError && hint && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: (0, import_clsx9.default)(labelText3[size], "text-text-default-secondary"), children: hint })
|
|
615
|
+
] });
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
// src/components/stepper.tsx
|
|
619
|
+
var import_clsx10 = __toESM(require("clsx"), 1);
|
|
620
|
+
var import_lu2 = require("react-icons/lu");
|
|
621
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
622
|
+
function StepIndicator({ status }) {
|
|
623
|
+
if (status === "complete") {
|
|
624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex size-5 shrink-0 items-center justify-center rounded-full bg-background-brand text-white", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lu2.LuCheck, { size: 11, "aria-hidden": true }) });
|
|
625
|
+
}
|
|
626
|
+
if (status === "active") {
|
|
627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex size-5 shrink-0 items-center justify-center rounded-full border-2 border-background-brand", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "size-2.5 rounded-full bg-background-brand" }) });
|
|
628
|
+
}
|
|
629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "size-5 shrink-0 rounded-full border-2 border-border-disabled", "aria-hidden": "true" });
|
|
630
|
+
}
|
|
631
|
+
function ChevronSeparator() {
|
|
632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lu2.LuChevronRight, { className: "mx-1 size-4 shrink-0 text-text-default-tertiary", "aria-hidden": true });
|
|
633
|
+
}
|
|
634
|
+
var labelClass = {
|
|
635
|
+
complete: "text-text-brand font-semibold",
|
|
636
|
+
active: "text-text-brand font-semibold",
|
|
637
|
+
upcoming: "text-text-disabled font-regular"
|
|
638
|
+
};
|
|
639
|
+
function Stepper({ steps, className }) {
|
|
640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
641
|
+
"ol",
|
|
642
|
+
{
|
|
643
|
+
className: (0, import_clsx10.default)("flex items-center overflow-x-auto", className),
|
|
644
|
+
"aria-label": "Progress",
|
|
645
|
+
children: steps.map((step, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
646
|
+
"li",
|
|
647
|
+
{
|
|
648
|
+
className: "flex items-center",
|
|
649
|
+
"aria-current": step.status === "active" ? "step" : void 0,
|
|
650
|
+
children: [
|
|
651
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
652
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(StepIndicator, { status: step.status }),
|
|
653
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: (0, import_clsx10.default)("text-body-xs whitespace-nowrap", labelClass[step.status]), children: step.label })
|
|
654
|
+
] }),
|
|
655
|
+
i < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChevronSeparator, {})
|
|
656
|
+
]
|
|
657
|
+
},
|
|
658
|
+
i
|
|
659
|
+
))
|
|
660
|
+
}
|
|
661
|
+
);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
// src/components/multiselect-card.tsx
|
|
665
|
+
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
666
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
667
|
+
function MultiSelectCard({
|
|
668
|
+
icon,
|
|
669
|
+
title,
|
|
670
|
+
description,
|
|
671
|
+
selected,
|
|
672
|
+
onToggle,
|
|
673
|
+
className
|
|
674
|
+
}) {
|
|
675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
676
|
+
"button",
|
|
677
|
+
{
|
|
678
|
+
type: "button",
|
|
679
|
+
role: "checkbox",
|
|
680
|
+
"aria-checked": selected,
|
|
681
|
+
onClick: onToggle,
|
|
682
|
+
className: (0, import_clsx11.default)(
|
|
683
|
+
"relative w-full rounded-2xl border-2 p-4 text-left transition-all",
|
|
684
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-brand focus-visible:ring-offset-1",
|
|
685
|
+
selected ? "border-border-brand bg-background-brand-tertiary" : "border-border-default bg-background-default hover:border-border-default-secondary",
|
|
686
|
+
className
|
|
687
|
+
),
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
690
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
691
|
+
"span",
|
|
692
|
+
{
|
|
693
|
+
className: (0, import_clsx11.default)(
|
|
694
|
+
"flex size-10 shrink-0 items-center justify-center rounded-xl",
|
|
695
|
+
selected ? "bg-background-brand" : "bg-background-brand-tertiary"
|
|
696
|
+
),
|
|
697
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: (0, import_clsx11.default)("size-5", selected ? "text-icon-brand-on-brand" : "text-icon-brand"), children: icon })
|
|
698
|
+
}
|
|
699
|
+
),
|
|
700
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex size-5 shrink-0 items-center justify-center rounded-full bg-background-brand", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "11", height: "8", viewBox: "0 0 11 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
701
|
+
"path",
|
|
702
|
+
{
|
|
703
|
+
d: "M1 4L3.9 7L10 1",
|
|
704
|
+
stroke: "white",
|
|
705
|
+
strokeWidth: "1.5",
|
|
706
|
+
strokeLinecap: "round",
|
|
707
|
+
strokeLinejoin: "round"
|
|
708
|
+
}
|
|
709
|
+
) }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
710
|
+
"span",
|
|
711
|
+
{
|
|
712
|
+
className: "size-5 shrink-0 rounded-full border-2 border-border-default",
|
|
713
|
+
"aria-hidden": "true"
|
|
714
|
+
}
|
|
715
|
+
)
|
|
716
|
+
] }),
|
|
717
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "mt-3", children: [
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
719
|
+
"p",
|
|
720
|
+
{
|
|
721
|
+
className: (0, import_clsx11.default)(
|
|
722
|
+
"text-body-sm font-semibold",
|
|
723
|
+
selected ? "text-text-brand" : "text-text-default"
|
|
724
|
+
),
|
|
725
|
+
children: title
|
|
726
|
+
}
|
|
727
|
+
),
|
|
728
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "mt-0.5 text-body-xs text-text-default-secondary", children: description })
|
|
729
|
+
] })
|
|
730
|
+
]
|
|
731
|
+
}
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
// src/components/data-table.tsx
|
|
736
|
+
var import_clsx12 = __toESM(require("clsx"), 1);
|
|
737
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
738
|
+
function DataTable({
|
|
739
|
+
columns,
|
|
740
|
+
rows,
|
|
741
|
+
getRowKey,
|
|
742
|
+
className,
|
|
743
|
+
onRowClick
|
|
744
|
+
}) {
|
|
745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
746
|
+
"div",
|
|
747
|
+
{
|
|
748
|
+
className: (0, import_clsx12.default)(
|
|
749
|
+
"overflow-hidden rounded-xl border border-border-default bg-background-default",
|
|
750
|
+
className
|
|
751
|
+
),
|
|
752
|
+
children: [
|
|
753
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex items-center bg-background-default-secondary px-4 py-3", children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_clsx12.default)("overflow-hidden", col.grow ? "flex-1 min-w-0" : "shrink-0"), style: col.grow ? { minWidth: col.width } : { width: col.width }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-body-xs font-medium text-text-default-secondary whitespace-nowrap", children: col.header }) }, col.key)) }),
|
|
754
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
755
|
+
"div",
|
|
756
|
+
{
|
|
757
|
+
className: (0, import_clsx12.default)(
|
|
758
|
+
"flex items-center px-4 py-[14px] transition-colors hover:bg-background-default-secondary/50",
|
|
759
|
+
i > 0 && "border-t border-[#ececec]",
|
|
760
|
+
onRowClick && "cursor-pointer"
|
|
761
|
+
),
|
|
762
|
+
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
763
|
+
children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_clsx12.default)("overflow-hidden", col.grow ? "flex-1 min-w-0" : "shrink-0"), style: col.grow ? { minWidth: col.width } : { width: col.width }, children: col.render(row) }, col.key))
|
|
764
|
+
},
|
|
765
|
+
getRowKey(row, i)
|
|
766
|
+
)) })
|
|
767
|
+
]
|
|
768
|
+
}
|
|
769
|
+
);
|
|
770
|
+
}
|
|
771
|
+
function TableCellLeadText({
|
|
772
|
+
primary,
|
|
773
|
+
secondary
|
|
774
|
+
}) {
|
|
775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-body-sm font-medium text-text-default leading-snug", children: primary }),
|
|
777
|
+
secondary && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-body-xs font-normal text-text-default-secondary leading-tight", children: secondary })
|
|
778
|
+
] });
|
|
779
|
+
}
|
|
780
|
+
function TableCellText({
|
|
781
|
+
children,
|
|
782
|
+
muted = true
|
|
783
|
+
}) {
|
|
784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
785
|
+
"span",
|
|
786
|
+
{
|
|
787
|
+
className: (0, import_clsx12.default)(
|
|
788
|
+
"text-body-xs font-normal leading-snug whitespace-nowrap",
|
|
789
|
+
muted ? "text-text-default-secondary" : "text-text-default"
|
|
790
|
+
),
|
|
791
|
+
children
|
|
792
|
+
}
|
|
793
|
+
);
|
|
794
|
+
}
|
|
795
|
+
function TableCellBadge({ label }) {
|
|
796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "inline-flex items-center rounded-md border border-border-default bg-background-default-secondary px-2 py-0.5 text-body-tiny font-medium text-text-default-secondary whitespace-nowrap", children: label });
|
|
797
|
+
}
|
|
798
|
+
function TableCellStatusPill({
|
|
799
|
+
label,
|
|
800
|
+
dotColor,
|
|
801
|
+
backgroundColor,
|
|
802
|
+
textColor
|
|
803
|
+
}) {
|
|
804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
805
|
+
"span",
|
|
806
|
+
{
|
|
807
|
+
className: "inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-body-xs font-medium leading-tight whitespace-nowrap",
|
|
808
|
+
style: { backgroundColor, color: textColor },
|
|
809
|
+
children: [
|
|
810
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "size-1.5 shrink-0 rounded-full", style: { backgroundColor: dotColor } }),
|
|
811
|
+
label
|
|
812
|
+
]
|
|
813
|
+
}
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
function TableCellProgress({
|
|
817
|
+
percent,
|
|
818
|
+
barColor
|
|
819
|
+
}) {
|
|
820
|
+
const color = barColor ?? "#0c2d58";
|
|
821
|
+
const clamped = Math.min(100, Math.max(0, percent));
|
|
822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
823
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "h-1.5 w-16 overflow-hidden rounded-full bg-background-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
824
|
+
"div",
|
|
825
|
+
{
|
|
826
|
+
className: "h-full rounded-full transition-all",
|
|
827
|
+
style: { width: `${clamped}%`, backgroundColor: color }
|
|
828
|
+
}
|
|
829
|
+
) }),
|
|
830
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "text-body-tiny text-text-default-secondary leading-none", children: [
|
|
831
|
+
percent,
|
|
832
|
+
"%"
|
|
833
|
+
] })
|
|
834
|
+
] });
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
// src/components/stat-tile.tsx
|
|
838
|
+
var import_clsx13 = __toESM(require("clsx"), 1);
|
|
839
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
840
|
+
function StatTile({ label, value, dotColor, className }) {
|
|
841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
842
|
+
"div",
|
|
843
|
+
{
|
|
844
|
+
className: (0, import_clsx13.default)(
|
|
845
|
+
"flex flex-col gap-2 rounded-xl border border-border-default bg-background-default p-4",
|
|
846
|
+
className
|
|
847
|
+
),
|
|
848
|
+
children: [
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
850
|
+
dotColor && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "size-2 shrink-0 rounded-full", style: { backgroundColor: dotColor } }),
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-body-xs font-medium text-text-default-secondary whitespace-nowrap", children: label })
|
|
852
|
+
] }),
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-heading font-semibold text-text-default leading-none", children: value })
|
|
854
|
+
]
|
|
855
|
+
}
|
|
856
|
+
);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// src/components/toggle.tsx
|
|
860
|
+
var import_clsx14 = __toESM(require("clsx"), 1);
|
|
861
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
862
|
+
function Toggle({ checked, onChange, label, disabled = false }) {
|
|
863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
864
|
+
"button",
|
|
865
|
+
{
|
|
866
|
+
type: "button",
|
|
867
|
+
role: "switch",
|
|
868
|
+
"aria-checked": checked,
|
|
869
|
+
disabled,
|
|
870
|
+
onClick: () => onChange(!checked),
|
|
871
|
+
className: (0, import_clsx14.default)(
|
|
872
|
+
"flex items-center gap-2",
|
|
873
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-brand focus-visible:ring-offset-1",
|
|
874
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
875
|
+
),
|
|
876
|
+
children: [
|
|
877
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
878
|
+
"span",
|
|
879
|
+
{
|
|
880
|
+
className: (0, import_clsx14.default)(
|
|
881
|
+
"relative inline-flex h-6 w-10 shrink-0 rounded-full transition-colors",
|
|
882
|
+
checked ? "bg-background-brand" : "border border-border-default bg-background-neutral-tertiary"
|
|
883
|
+
),
|
|
884
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
885
|
+
"span",
|
|
886
|
+
{
|
|
887
|
+
className: (0, import_clsx14.default)(
|
|
888
|
+
"absolute left-0.5 top-0.5 size-5 rounded-full bg-white shadow-sm transition-transform",
|
|
889
|
+
checked ? "translate-x-4" : "translate-x-0"
|
|
890
|
+
)
|
|
891
|
+
}
|
|
892
|
+
)
|
|
893
|
+
}
|
|
894
|
+
),
|
|
895
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-body-xs text-text-default", children: label })
|
|
896
|
+
]
|
|
897
|
+
}
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// src/components/file-drop-zone.tsx
|
|
902
|
+
var import_react4 = require("react");
|
|
903
|
+
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
904
|
+
var import_lu3 = require("react-icons/lu");
|
|
905
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
906
|
+
function FileDropZone({ className }) {
|
|
907
|
+
const inputRef = (0, import_react4.useRef)(null);
|
|
908
|
+
const [isDragging, setIsDragging] = (0, import_react4.useState)(false);
|
|
909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
911
|
+
"input",
|
|
912
|
+
{
|
|
913
|
+
ref: inputRef,
|
|
914
|
+
type: "file",
|
|
915
|
+
accept: ".pdf,.jpg,.jpeg,.png",
|
|
916
|
+
className: "sr-only",
|
|
917
|
+
tabIndex: -1
|
|
918
|
+
}
|
|
919
|
+
),
|
|
920
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
921
|
+
"div",
|
|
922
|
+
{
|
|
923
|
+
role: "button",
|
|
924
|
+
tabIndex: 0,
|
|
925
|
+
onClick: () => inputRef.current?.click(),
|
|
926
|
+
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && inputRef.current?.click(),
|
|
927
|
+
onDragOver: (e) => {
|
|
928
|
+
e.preventDefault();
|
|
929
|
+
setIsDragging(true);
|
|
930
|
+
},
|
|
931
|
+
onDragEnter: (e) => {
|
|
932
|
+
e.preventDefault();
|
|
933
|
+
setIsDragging(true);
|
|
934
|
+
},
|
|
935
|
+
onDragLeave: () => setIsDragging(false),
|
|
936
|
+
onDrop: (e) => {
|
|
937
|
+
e.preventDefault();
|
|
938
|
+
setIsDragging(false);
|
|
939
|
+
},
|
|
940
|
+
className: (0, import_clsx15.default)(
|
|
941
|
+
"flex flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed py-4 px-4 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-brand focus-visible:ring-offset-1",
|
|
942
|
+
isDragging ? "border-border-brand bg-background-brand-tertiary" : "border-border-default bg-background-default-secondary hover:border-border-brand hover:bg-background-brand-tertiary",
|
|
943
|
+
className
|
|
944
|
+
),
|
|
945
|
+
children: [
|
|
946
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: isDragging ? "text-text-brand" : "text-text-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lu3.LuUpload, { size: 20 }) }),
|
|
947
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-body-sm font-medium text-text-default", children: "Upload file" }),
|
|
948
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-body-xs text-text-default-secondary text-center", children: "Drag & drop or browse \xB7 PDF, JPG, PNG \xB7 up to 10 MB" })
|
|
949
|
+
]
|
|
950
|
+
}
|
|
951
|
+
)
|
|
952
|
+
] });
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
// src/components/form-card.tsx
|
|
956
|
+
var import_clsx16 = __toESM(require("clsx"), 1);
|
|
957
|
+
var import_lu4 = require("react-icons/lu");
|
|
958
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
959
|
+
function FormCard({
|
|
960
|
+
children,
|
|
961
|
+
className
|
|
962
|
+
}) {
|
|
963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
964
|
+
"div",
|
|
965
|
+
{
|
|
966
|
+
className: (0, import_clsx16.default)(
|
|
967
|
+
"overflow-hidden rounded-xl border border-border-default bg-background-default",
|
|
968
|
+
className
|
|
969
|
+
),
|
|
970
|
+
children
|
|
971
|
+
}
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
function FormCardHeader({ title, subtitle }) {
|
|
975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "border-b border-border-default px-7 py-6", children: [
|
|
976
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { className: "text-heading-sm font-semibold text-text-default leading-snug", children: title }),
|
|
977
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-1 text-body-xs text-text-default-secondary", children: subtitle })
|
|
978
|
+
] });
|
|
979
|
+
}
|
|
980
|
+
function FormCardFooter({
|
|
981
|
+
onSaveDraft,
|
|
982
|
+
onBack,
|
|
983
|
+
onContinue,
|
|
984
|
+
continueLabel = "Continue",
|
|
985
|
+
backDisabled = false
|
|
986
|
+
}) {
|
|
987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default px-7 py-5", children: [
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "neutral", size: "md", onClick: onSaveDraft, children: "Save as draft" }),
|
|
989
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
990
|
+
!backDisabled && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "neutral", size: "md", leadingIcon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lu4.LuArrowLeft, { size: 16 }), onClick: onBack, children: "Back" }),
|
|
991
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "primary", size: "md", trailingIcon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lu4.LuArrowRight, { size: 16 }), onClick: onContinue, children: continueLabel })
|
|
992
|
+
] })
|
|
993
|
+
] });
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
// src/components/document-row.tsx
|
|
997
|
+
var import_clsx17 = __toESM(require("clsx"), 1);
|
|
998
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
999
|
+
var STATUS_CONFIG = {
|
|
1000
|
+
uploaded: { label: "\u2713 Uploaded", style: "bg-[#e6f4ea] text-[#1f7a3d]" },
|
|
1001
|
+
"under-review": { label: "\u25CF Under review", style: "bg-[#fbe6cf] text-[#9a6206]" },
|
|
1002
|
+
processing: { label: "\u25CF Processing", style: "bg-[#e9eff7] text-[#0c2d58]" },
|
|
1003
|
+
missing: { label: "Missing", style: "bg-[#fee2e2] text-[#b91c1c]" },
|
|
1004
|
+
"not-provided": { label: "Not provided", style: "bg-background-default-secondary text-text-default-secondary" }
|
|
1005
|
+
};
|
|
1006
|
+
function FileTypeBadge({ type }) {
|
|
1007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-md bg-background-brand-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-body-tiny font-semibold text-text-brand", children: type }) });
|
|
1008
|
+
}
|
|
1009
|
+
function DocumentRow({
|
|
1010
|
+
title,
|
|
1011
|
+
required,
|
|
1012
|
+
description,
|
|
1013
|
+
status,
|
|
1014
|
+
fileName,
|
|
1015
|
+
fileSize,
|
|
1016
|
+
fileType = "PDF"
|
|
1017
|
+
}) {
|
|
1018
|
+
const hasFile = (status === "uploaded" || status === "under-review" || status === "processing") && !!fileName;
|
|
1019
|
+
const cfg = STATUS_CONFIG[status];
|
|
1020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-3 py-4", children: [
|
|
1021
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
1023
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-body-sm font-semibold text-text-default truncate", children: title }),
|
|
1024
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "shrink-0 rounded-md border border-border-default bg-background-default-secondary px-2 py-0.5 text-body-tiny font-medium text-text-default-secondary", children: required ? "Required" : "Optional" })
|
|
1025
|
+
] }),
|
|
1026
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1027
|
+
"span",
|
|
1028
|
+
{
|
|
1029
|
+
className: (0, import_clsx17.default)(
|
|
1030
|
+
"shrink-0 rounded-full px-2.5 py-0.5 text-body-tiny font-medium whitespace-nowrap",
|
|
1031
|
+
cfg.style
|
|
1032
|
+
),
|
|
1033
|
+
children: cfg.label
|
|
1034
|
+
}
|
|
1035
|
+
)
|
|
1036
|
+
] }),
|
|
1037
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-body-xs text-text-default-secondary", children: description }),
|
|
1038
|
+
hasFile ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 rounded-lg border border-border-default bg-background-default px-3 py-2.5", children: [
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FileTypeBadge, { type: fileType }),
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
1041
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "truncate text-body-sm font-medium text-text-default", children: fileName }),
|
|
1042
|
+
fileSize && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-body-xs text-text-default-secondary", children: fileSize })
|
|
1043
|
+
] }),
|
|
1044
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex shrink-0 items-center gap-4", children: [
|
|
1045
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1046
|
+
"button",
|
|
1047
|
+
{
|
|
1048
|
+
type: "button",
|
|
1049
|
+
className: "text-body-xs font-medium text-text-brand hover:underline",
|
|
1050
|
+
children: "Replace"
|
|
1051
|
+
}
|
|
1052
|
+
),
|
|
1053
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1054
|
+
"button",
|
|
1055
|
+
{
|
|
1056
|
+
type: "button",
|
|
1057
|
+
className: "text-body-xs font-medium text-text-danger hover:underline",
|
|
1058
|
+
children: "Remove"
|
|
1059
|
+
}
|
|
1060
|
+
)
|
|
1061
|
+
] })
|
|
1062
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FileDropZone, {})
|
|
1063
|
+
] });
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
// src/components/modal.tsx
|
|
1067
|
+
var import_clsx18 = __toESM(require("clsx"), 1);
|
|
1068
|
+
var import_lu5 = require("react-icons/lu");
|
|
1069
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1070
|
+
function Modal({ isOpen, onClose, title, subtitle, children, footer, maxWidth = "max-w-[540px]" }) {
|
|
1071
|
+
if (!isOpen) return null;
|
|
1072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1073
|
+
"div",
|
|
1074
|
+
{
|
|
1075
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80",
|
|
1076
|
+
onClick: (e) => {
|
|
1077
|
+
if (e.target === e.currentTarget) onClose();
|
|
1078
|
+
},
|
|
1079
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: (0, import_clsx18.default)("w-full mx-4 rounded-2xl bg-white shadow-xl", maxWidth), children: [
|
|
1080
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-start justify-between px-6 py-5", children: [
|
|
1081
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
1082
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h2", { className: "text-heading-sm font-semibold text-text-default", children: title }),
|
|
1083
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-0.5 text-body-xs text-text-default-secondary", children: subtitle })
|
|
1084
|
+
] }),
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1086
|
+
IconButton,
|
|
1087
|
+
{
|
|
1088
|
+
variant: "subtle",
|
|
1089
|
+
size: "sm",
|
|
1090
|
+
"aria-label": "Close dialog",
|
|
1091
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lu5.LuX, { size: 16 }),
|
|
1092
|
+
onClick: onClose
|
|
1093
|
+
}
|
|
1094
|
+
)
|
|
1095
|
+
] }),
|
|
1096
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", { className: "border-border-default" }),
|
|
1097
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "px-6 py-5", children }),
|
|
1098
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
1099
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", { className: "border-border-default" }),
|
|
1100
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex items-center justify-end gap-2 px-6 py-4", children: footer })
|
|
1101
|
+
] })
|
|
1102
|
+
] })
|
|
1103
|
+
}
|
|
1104
|
+
);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
// src/components/role-badge.tsx
|
|
1108
|
+
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
1109
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1110
|
+
var ROLE_COLORS = {
|
|
1111
|
+
"Super Admin": { bg: "#e9eff7", text: "#0c2d58" },
|
|
1112
|
+
"Admin": { bg: "#e9eff7", text: "#0c2d58" },
|
|
1113
|
+
"Compliance Lead": { bg: "#ece6f7", text: "#5b3da8" },
|
|
1114
|
+
"Reviewer": { bg: "#dbeafe", text: "#1d4ed8" },
|
|
1115
|
+
"Requester": { bg: "#e6f4ea", text: "#1f7a3d" },
|
|
1116
|
+
"Entity Manager": { bg: "#fbe6cf", text: "#9a6206" },
|
|
1117
|
+
"Intelligence Analyst": { bg: "#fde2e7", text: "#a3284a" },
|
|
1118
|
+
"Auditor": { bg: "#f5f5f5", text: "#757575" },
|
|
1119
|
+
"Viewer": { bg: "#f5f5f5", text: "#757575" },
|
|
1120
|
+
"User": { bg: "#e9eff7", text: "#0c2d58" }
|
|
1121
|
+
};
|
|
1122
|
+
var FALLBACK = { bg: "#f5f5f5", text: "#757575" };
|
|
1123
|
+
function RoleBadge({ role, size = "sm" }) {
|
|
1124
|
+
const colors = ROLE_COLORS[role] ?? FALLBACK;
|
|
1125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1126
|
+
"span",
|
|
1127
|
+
{
|
|
1128
|
+
className: (0, import_clsx19.default)(
|
|
1129
|
+
"inline-flex items-center rounded-full font-medium whitespace-nowrap",
|
|
1130
|
+
size === "sm" ? "px-2 py-0.5 text-body-tiny" : "px-3 py-1 text-body-xs"
|
|
1131
|
+
),
|
|
1132
|
+
style: { backgroundColor: colors.bg, color: colors.text },
|
|
1133
|
+
children: role
|
|
1134
|
+
}
|
|
1135
|
+
);
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
// src/components/role-combo-box.tsx
|
|
1139
|
+
var import_react5 = require("react");
|
|
1140
|
+
var import_lu6 = require("react-icons/lu");
|
|
1141
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1142
|
+
var ROLE_COMBO_OPTIONS = [
|
|
1143
|
+
{ role: "Reviewer", description: "Reviews onboarding requests" },
|
|
1144
|
+
{ role: "Admin", description: "Full org control" },
|
|
1145
|
+
{ role: "Compliance Lead", description: "Owns compliance" },
|
|
1146
|
+
{ role: "Requester", description: "Creates onboarding requests" },
|
|
1147
|
+
{ role: "Viewer", description: "Read-only access" },
|
|
1148
|
+
{ role: "User", description: "Default user access" }
|
|
1149
|
+
];
|
|
1150
|
+
function RoleComboBox({ value, onChange, options = ROLE_COMBO_OPTIONS }) {
|
|
1151
|
+
const [open, setOpen] = (0, import_react5.useState)(false);
|
|
1152
|
+
const [query, setQuery] = (0, import_react5.useState)("");
|
|
1153
|
+
const containerRef = (0, import_react5.useRef)(null);
|
|
1154
|
+
const inputRef = (0, import_react5.useRef)(null);
|
|
1155
|
+
(0, import_react5.useEffect)(() => {
|
|
1156
|
+
if (!open) return;
|
|
1157
|
+
function onClickOutside(e) {
|
|
1158
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1159
|
+
setOpen(false);
|
|
1160
|
+
setQuery("");
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
document.addEventListener("mousedown", onClickOutside);
|
|
1164
|
+
return () => document.removeEventListener("mousedown", onClickOutside);
|
|
1165
|
+
}, [open]);
|
|
1166
|
+
function openDropdown() {
|
|
1167
|
+
setOpen(true);
|
|
1168
|
+
setQuery("");
|
|
1169
|
+
setTimeout(() => inputRef.current?.focus(), 0);
|
|
1170
|
+
}
|
|
1171
|
+
function select(role) {
|
|
1172
|
+
onChange(role);
|
|
1173
|
+
setOpen(false);
|
|
1174
|
+
setQuery("");
|
|
1175
|
+
}
|
|
1176
|
+
const selectedEntry = options.find((o) => o.role === value);
|
|
1177
|
+
const otherOptions = options.filter(
|
|
1178
|
+
(o) => o.role !== value && o.role.toLowerCase().includes(query.toLowerCase())
|
|
1179
|
+
);
|
|
1180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative", ref: containerRef, children: [
|
|
1181
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1182
|
+
"div",
|
|
1183
|
+
{
|
|
1184
|
+
role: "combobox",
|
|
1185
|
+
"aria-expanded": open,
|
|
1186
|
+
"aria-haspopup": "listbox",
|
|
1187
|
+
onClick: openDropdown,
|
|
1188
|
+
className: `flex h-11 cursor-pointer items-center gap-2 rounded-lg border-[1.5px] pl-2.5 pr-3 transition-colors ${open ? "border-blue-500" : "border-border-default hover:border-border-brand-tertiary"}`,
|
|
1189
|
+
children: [
|
|
1190
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-1 min-w-0 items-center gap-1.5 overflow-hidden", children: [
|
|
1191
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RoleBadge, { role: value, size: "sm" }),
|
|
1192
|
+
value === "User" && !open && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "rounded border border-border-default bg-background-default-secondary px-1.5 py-0.5 text-body-tiny font-medium text-text-default-secondary", children: "DEFAULT" }),
|
|
1193
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1194
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1195
|
+
"input",
|
|
1196
|
+
{
|
|
1197
|
+
ref: inputRef,
|
|
1198
|
+
type: "text",
|
|
1199
|
+
value: query,
|
|
1200
|
+
onChange: (e) => setQuery(e.target.value),
|
|
1201
|
+
onClick: (e) => e.stopPropagation(),
|
|
1202
|
+
className: "min-w-0 flex-1 bg-transparent text-body-xs text-text-default outline-none",
|
|
1203
|
+
"aria-label": "Search roles"
|
|
1204
|
+
}
|
|
1205
|
+
),
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "mx-0.5 h-[18px] w-px shrink-0 bg-text-default", "aria-hidden": true })
|
|
1207
|
+
] })
|
|
1208
|
+
] }),
|
|
1209
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "shrink-0 text-text-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lu6.LuChevronDown, { size: 14 }) })
|
|
1210
|
+
]
|
|
1211
|
+
}
|
|
1212
|
+
),
|
|
1213
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1214
|
+
"div",
|
|
1215
|
+
{
|
|
1216
|
+
role: "listbox",
|
|
1217
|
+
className: "absolute left-0 right-0 top-full z-20 mt-1 flex max-h-64 flex-col gap-0.5 overflow-y-auto rounded-xl border border-border-default bg-white p-1.5 shadow-lg",
|
|
1218
|
+
children: [
|
|
1219
|
+
selectedEntry && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1220
|
+
"div",
|
|
1221
|
+
{
|
|
1222
|
+
role: "option",
|
|
1223
|
+
"aria-selected": true,
|
|
1224
|
+
className: "flex cursor-pointer items-center gap-2.5 rounded-md bg-blue-50 px-2.5 py-2",
|
|
1225
|
+
onClick: () => select(selectedEntry.role),
|
|
1226
|
+
children: [
|
|
1227
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RoleBadge, { role: selectedEntry.role, size: "sm" }),
|
|
1228
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "flex-1 text-body-xs text-text-default-secondary", children: selectedEntry.description }),
|
|
1229
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "shrink-0 text-sm font-bold text-blue-600", children: "\u2713" })
|
|
1230
|
+
]
|
|
1231
|
+
}
|
|
1232
|
+
),
|
|
1233
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "h-px bg-border-default" }),
|
|
1234
|
+
otherOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "px-2.5 pb-1 pt-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-body-tiny font-semibold uppercase tracking-wide text-text-default-secondary", children: "Other roles" }) }),
|
|
1236
|
+
otherOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1237
|
+
"div",
|
|
1238
|
+
{
|
|
1239
|
+
role: "option",
|
|
1240
|
+
"aria-selected": false,
|
|
1241
|
+
className: "flex cursor-pointer items-center gap-2.5 rounded-md px-2.5 py-2 hover:bg-background-default-secondary",
|
|
1242
|
+
onClick: () => select(opt.role),
|
|
1243
|
+
children: [
|
|
1244
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RoleBadge, { role: opt.role, size: "sm" }),
|
|
1245
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-body-xs text-text-default-secondary", children: opt.description })
|
|
1246
|
+
]
|
|
1247
|
+
},
|
|
1248
|
+
opt.role
|
|
1249
|
+
))
|
|
1250
|
+
] }),
|
|
1251
|
+
otherOptions.length === 0 && query && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "px-2.5 py-2 text-body-xs text-text-default-secondary", children: [
|
|
1252
|
+
'No roles match "',
|
|
1253
|
+
query,
|
|
1254
|
+
'"'
|
|
1255
|
+
] })
|
|
1256
|
+
]
|
|
1257
|
+
}
|
|
1258
|
+
)
|
|
1259
|
+
] });
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
// src/index.tsx
|
|
1263
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1264
|
+
function Panel({
|
|
1265
|
+
children,
|
|
1266
|
+
className
|
|
1267
|
+
}) {
|
|
1268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("section", { className: (0, import_clsx20.default)("rounded-3xl border border-white/70 bg-white/90 p-6 shadow-panel backdrop-blur", className), children });
|
|
1269
|
+
}
|
|
1270
|
+
function MetricCard({
|
|
1271
|
+
label,
|
|
1272
|
+
value,
|
|
1273
|
+
tone = "default"
|
|
1274
|
+
}) {
|
|
1275
|
+
const tones = {
|
|
1276
|
+
default: "from-white to-slate-50 text-text-default",
|
|
1277
|
+
signal: "from-background-brand-tertiary to-cyan-50 text-text-brand",
|
|
1278
|
+
ember: "from-amber-50 to-orange-50 text-text-danger",
|
|
1279
|
+
moss: "from-emerald-50 to-lime-50 text-text-positive"
|
|
1280
|
+
};
|
|
1281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Panel, { className: (0, import_clsx20.default)("bg-gradient-to-br", tones[tone]), children: [
|
|
1282
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-sm uppercase tracking-[0.2em] text-slate-500", children: label }),
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "mt-3 text-3xl font-semibold", children: value })
|
|
1284
|
+
] });
|
|
1285
|
+
}
|
|
1286
|
+
function SeverityBadge({ severity }) {
|
|
1287
|
+
const styles = {
|
|
1288
|
+
critical: "bg-red-100 text-red-700",
|
|
1289
|
+
high: "bg-orange-100 text-orange-700",
|
|
1290
|
+
medium: "bg-amber-100 text-amber-700",
|
|
1291
|
+
low: "bg-slate-100 text-slate-700"
|
|
1292
|
+
};
|
|
1293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: (0, import_clsx20.default)("inline-flex rounded-full px-3 py-1 text-xs font-semibold uppercase tracking-wide", styles[severity ?? "low"]), children: severity ?? "unknown" });
|
|
1294
|
+
}
|
|
1295
|
+
function SentimentBadge({ sentiment }) {
|
|
1296
|
+
const styles = {
|
|
1297
|
+
positive: "bg-emerald-100 text-emerald-700",
|
|
1298
|
+
neutral: "bg-slate-100 text-slate-700",
|
|
1299
|
+
negative: "bg-rose-100 text-rose-700",
|
|
1300
|
+
concerning: "bg-amber-100 text-amber-700"
|
|
1301
|
+
};
|
|
1302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: (0, import_clsx20.default)("inline-flex rounded-full px-3 py-1 text-xs font-semibold capitalize", styles[sentiment ?? "neutral"] ?? styles.neutral), children: sentiment ?? "unknown" });
|
|
1303
|
+
}
|
|
1304
|
+
function SectionHeading({
|
|
1305
|
+
eyebrow,
|
|
1306
|
+
title,
|
|
1307
|
+
detail
|
|
1308
|
+
}) {
|
|
1309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
1310
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs uppercase tracking-[0.25em] text-text-brand", children: eyebrow }),
|
|
1311
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "mt-2 text-2xl font-semibold text-text-default", children: title }),
|
|
1312
|
+
detail ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "mt-2 max-w-2xl text-sm text-slate-600", children: detail }) : null
|
|
1313
|
+
] });
|
|
1314
|
+
}
|
|
1315
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1316
|
+
0 && (module.exports = {
|
|
1317
|
+
Avatar,
|
|
1318
|
+
AvatarGroup,
|
|
1319
|
+
Button,
|
|
1320
|
+
ButtonGroup,
|
|
1321
|
+
DataTable,
|
|
1322
|
+
DocumentRow,
|
|
1323
|
+
FileDropZone,
|
|
1324
|
+
FormCard,
|
|
1325
|
+
FormCardFooter,
|
|
1326
|
+
FormCardHeader,
|
|
1327
|
+
IconButton,
|
|
1328
|
+
Input,
|
|
1329
|
+
MetricCard,
|
|
1330
|
+
Modal,
|
|
1331
|
+
MultiSelectCard,
|
|
1332
|
+
NavItem,
|
|
1333
|
+
Panel,
|
|
1334
|
+
ROLE_COMBO_OPTIONS,
|
|
1335
|
+
RoleBadge,
|
|
1336
|
+
RoleComboBox,
|
|
1337
|
+
SectionHeading,
|
|
1338
|
+
Select,
|
|
1339
|
+
SentimentBadge,
|
|
1340
|
+
SeverityBadge,
|
|
1341
|
+
StatTile,
|
|
1342
|
+
Stepper,
|
|
1343
|
+
TableCellBadge,
|
|
1344
|
+
TableCellLeadText,
|
|
1345
|
+
TableCellProgress,
|
|
1346
|
+
TableCellStatusPill,
|
|
1347
|
+
TableCellText,
|
|
1348
|
+
Textarea,
|
|
1349
|
+
Toggle
|
|
1350
|
+
});
|
|
1351
|
+
//# sourceMappingURL=index.cjs.map
|