@syscore/ui-library 1.8.0 → 1.9.0

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/index.es.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import React__default, { useState, useEffect, useCallback, useRef } from "react";
4
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
5
- import { ChevronDown, GripVertical, X as X$1, PanelLeft, Check, Circle, Dot, ChevronLeft, ChevronRight, XIcon, Search, MoreHorizontal, ArrowLeft, ArrowRight } from "lucide-react";
4
+ import { motion, AnimatePresence } from "motion/react";
6
5
  import { clsx } from "clsx";
7
6
  import { twMerge } from "tailwind-merge";
8
- import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
9
7
  import { cva } from "class-variance-authority";
8
+ import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
10
9
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
11
10
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
11
+ import { GripVertical, X as X$1, PanelLeft, Check, Circle, Dot, ChevronLeft, ChevronRight, XIcon, Search, MoreHorizontal, ChevronDown, ArrowLeft, ArrowRight } from "lucide-react";
12
12
  import * as ResizablePrimitive from "react-resizable-panels";
13
13
  import { Slot } from "@radix-ui/react-slot";
14
14
  import * as SheetPrimitive from "@radix-ui/react-dialog";
@@ -28,7 +28,6 @@ import * as ProgressPrimitive from "@radix-ui/react-progress";
28
28
  import { DayPicker } from "react-day-picker";
29
29
  import { Command as Command$1 } from "cmdk";
30
30
  import * as TabsPrimitive from "@radix-ui/react-tabs";
31
- import { AnimatePresence, motion } from "motion/react";
32
31
  import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
33
32
  import * as MenubarPrimitive from "@radix-ui/react-menubar";
34
33
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
@@ -49,39 +48,366 @@ function capitalize(str) {
49
48
  if (!str) return str;
50
49
  return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
51
50
  }
52
- const Accordion = AccordionPrimitive.Root;
53
- const AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
54
- AccordionPrimitive.Item,
51
+ const buttonVariants = cva(
52
+ "button",
55
53
  {
56
- ref,
57
- className: cn("accordion-item", className),
54
+ variants: {
55
+ variant: {
56
+ // CTA variants
57
+ clear: "button--clear",
58
+ default: "button--default",
59
+ "primary-gradient": "button--primary-gradient",
60
+ "primary-dark": "button--primary-dark",
61
+ "secondary-light": "button--secondary-light",
62
+ "tertiary-light": "button--tertiary-light",
63
+ // Utility variants
64
+ "general-primary": "button--general-primary",
65
+ "general-secondary": "button--general-secondary",
66
+ "general-tertiary": "button--general-tertiary",
67
+ "transparent-tertiary": "button--transparent-tertiary",
68
+ "tooltip-primary": "button--tooltip-primary",
69
+ "tooltip-secondary": "button--tooltip-secondary"
70
+ },
71
+ size: {
72
+ xlarge: "button--xlarge",
73
+ large: "button--large",
74
+ utility: "button--utility",
75
+ icon: "button--icon"
76
+ }
77
+ },
78
+ defaultVariants: {
79
+ variant: "default",
80
+ size: "large"
81
+ }
82
+ }
83
+ );
84
+ const sizeTextClasses = {
85
+ xlarge: "body-large",
86
+ large: "body-base",
87
+ utility: "body-small",
88
+ icon: ""
89
+ };
90
+ const Button = React.forwardRef(
91
+ ({ className, variant: variant2, size, ftMadeFont, mazzardSoftFont, children, style, ...props }, ref) => {
92
+ const textClass = sizeTextClasses[size || "large"];
93
+ return /* @__PURE__ */ jsx(
94
+ "button",
95
+ {
96
+ className: cn(
97
+ buttonVariants({ variant: variant2, size }),
98
+ ftMadeFont && "font-ftMade",
99
+ mazzardSoftFont && "font-mazzardSoft",
100
+ className
101
+ ),
102
+ style,
103
+ ref,
104
+ ...props,
105
+ children: size === "icon" ? children : /* @__PURE__ */ jsx("span", { className: cn("button-text", textClass), children })
106
+ }
107
+ );
108
+ }
109
+ );
110
+ Button.displayName = "Button";
111
+ const UtilityChevronDown = ({
112
+ className
113
+ }) => {
114
+ return /* @__PURE__ */ jsx(
115
+ "div",
116
+ {
117
+ className: cn(
118
+ "size-4 flex items-center justify-center text-gray-500",
119
+ className
120
+ ),
121
+ children: /* @__PURE__ */ jsx(
122
+ "svg",
123
+ {
124
+ xmlns: "http://www.w3.org/2000/svg",
125
+ width: "12",
126
+ height: "6",
127
+ viewBox: "0 0 12 6",
128
+ fill: "none",
129
+ className: cn("text-inherit"),
130
+ children: /* @__PURE__ */ jsx(
131
+ "path",
132
+ {
133
+ d: "M11 0.75L6 5.25L1 0.75",
134
+ stroke: "currentColor",
135
+ strokeWidth: "1.5",
136
+ strokeLinecap: "round",
137
+ strokeLinejoin: "round"
138
+ }
139
+ )
140
+ }
141
+ )
142
+ }
143
+ );
144
+ };
145
+ const AccordionContext = React.createContext(
146
+ null
147
+ );
148
+ const AccordionItemContext = React.createContext(null);
149
+ function useAccordion() {
150
+ const context = React.useContext(AccordionContext);
151
+ if (!context) {
152
+ throw new Error("Accordion components must be used within <Accordion>");
153
+ }
154
+ return context;
155
+ }
156
+ function useAccordionItem() {
157
+ const context = React.useContext(AccordionItemContext);
158
+ if (!context) {
159
+ throw new Error(
160
+ "AccordionTrigger and AccordionContent must be used within <AccordionItem>"
161
+ );
162
+ }
163
+ return context;
164
+ }
165
+ function useAccordionState(options = {}) {
166
+ const { allowMultiple = false, defaultExpanded } = options;
167
+ const getInitialExpanded = () => {
168
+ if (!defaultExpanded) return /* @__PURE__ */ new Set();
169
+ if (Array.isArray(defaultExpanded)) return new Set(defaultExpanded);
170
+ return /* @__PURE__ */ new Set([defaultExpanded]);
171
+ };
172
+ const [expandedValues, setExpandedValues] = React.useState(getInitialExpanded);
173
+ const [isAllExpanded, setIsAllExpanded] = React.useState(false);
174
+ const hasAnyExpanded = React.useMemo(
175
+ () => isAllExpanded || expandedValues.size > 0,
176
+ [isAllExpanded, expandedValues]
177
+ );
178
+ const toggleAll = React.useCallback(() => {
179
+ if (hasAnyExpanded) {
180
+ setIsAllExpanded(false);
181
+ setExpandedValues(/* @__PURE__ */ new Set());
182
+ } else {
183
+ setIsAllExpanded(true);
184
+ setExpandedValues(/* @__PURE__ */ new Set());
185
+ }
186
+ }, [hasAnyExpanded]);
187
+ return {
188
+ expandedValues,
189
+ setExpandedValues,
190
+ hasAnyExpanded,
191
+ toggleAll
192
+ };
193
+ }
194
+ const Accordion = React.forwardRef(
195
+ ({
196
+ allowMultiple = false,
197
+ defaultExpanded,
198
+ expandedValues: controlledExpandedValues,
199
+ onExpandedChange,
200
+ children,
201
+ className,
58
202
  ...props
203
+ }, ref) => {
204
+ const getInitialExpanded = () => {
205
+ if (!defaultExpanded) return /* @__PURE__ */ new Set();
206
+ if (Array.isArray(defaultExpanded)) return new Set(defaultExpanded);
207
+ return /* @__PURE__ */ new Set([defaultExpanded]);
208
+ };
209
+ const [uncontrolledExpandedValues, setUncontrolledExpandedValues] = React.useState(getInitialExpanded);
210
+ const [isAllExpanded, setIsAllExpanded] = React.useState(false);
211
+ const isControlled = controlledExpandedValues !== void 0;
212
+ const expandedValues = isControlled ? controlledExpandedValues : uncontrolledExpandedValues;
213
+ const hasAnyExpanded = React.useMemo(
214
+ () => isAllExpanded || expandedValues.size > 0,
215
+ [isAllExpanded, expandedValues]
216
+ );
217
+ const isExpanded = React.useCallback(
218
+ (value) => isAllExpanded || expandedValues.has(value),
219
+ [isAllExpanded, expandedValues]
220
+ );
221
+ const toggle = React.useCallback(
222
+ (value) => {
223
+ const newValues = new Set(expandedValues);
224
+ if (newValues.has(value)) {
225
+ newValues.delete(value);
226
+ } else {
227
+ if (!allowMultiple) {
228
+ newValues.clear();
229
+ }
230
+ newValues.add(value);
231
+ }
232
+ if (!isControlled) {
233
+ setUncontrolledExpandedValues(newValues);
234
+ }
235
+ onExpandedChange == null ? void 0 : onExpandedChange(newValues);
236
+ setIsAllExpanded(false);
237
+ },
238
+ [allowMultiple, expandedValues, isControlled, onExpandedChange]
239
+ );
240
+ const expandAll = React.useCallback(() => {
241
+ setIsAllExpanded(true);
242
+ const emptySet = /* @__PURE__ */ new Set();
243
+ if (!isControlled) {
244
+ setUncontrolledExpandedValues(emptySet);
245
+ }
246
+ onExpandedChange == null ? void 0 : onExpandedChange(emptySet);
247
+ }, [isControlled, onExpandedChange]);
248
+ const collapseAll = React.useCallback(() => {
249
+ setIsAllExpanded(false);
250
+ const emptySet = /* @__PURE__ */ new Set();
251
+ if (!isControlled) {
252
+ setUncontrolledExpandedValues(emptySet);
253
+ }
254
+ onExpandedChange == null ? void 0 : onExpandedChange(emptySet);
255
+ }, [isControlled, onExpandedChange]);
256
+ const contextValue = React.useMemo(
257
+ () => ({
258
+ expandedValues,
259
+ isExpanded,
260
+ toggle,
261
+ expandAll,
262
+ collapseAll,
263
+ hasAnyExpanded,
264
+ allowMultiple
265
+ }),
266
+ [
267
+ expandedValues,
268
+ isExpanded,
269
+ toggle,
270
+ expandAll,
271
+ collapseAll,
272
+ hasAnyExpanded,
273
+ allowMultiple
274
+ ]
275
+ );
276
+ return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { ref, className: cn(className), ...props, children }) });
59
277
  }
60
- ));
278
+ );
279
+ Accordion.displayName = "Accordion";
280
+ const AccordionSectionHeader = React.forwardRef(({ title, hasExpanded, onToggleAll, className }, ref) => {
281
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn(className), children: [
282
+ /* @__PURE__ */ jsx("h2", { children: title }),
283
+ onToggleAll && /* @__PURE__ */ jsx(
284
+ motion.div,
285
+ {
286
+ animate: { rotate: hasExpanded ? 180 : 0 },
287
+ transition: { duration: 0.2 },
288
+ children: /* @__PURE__ */ jsx(Button, { size: "icon", onClick: onToggleAll, children: /* @__PURE__ */ jsx(UtilityChevronDown, {}) })
289
+ }
290
+ )
291
+ ] });
292
+ });
293
+ AccordionSectionHeader.displayName = "AccordionSectionHeader";
294
+ const AccordionHeaderRow = React.forwardRef(({ title, className }, ref) => {
295
+ const { hasAnyExpanded, expandAll, collapseAll } = useAccordion();
296
+ const handleToggleAll = React.useCallback(() => {
297
+ if (hasAnyExpanded) {
298
+ collapseAll();
299
+ } else {
300
+ expandAll();
301
+ }
302
+ }, [hasAnyExpanded, collapseAll, expandAll]);
303
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn(className), children: [
304
+ /* @__PURE__ */ jsx("h2", { children: title }),
305
+ /* @__PURE__ */ jsx(
306
+ motion.div,
307
+ {
308
+ animate: { rotate: hasAnyExpanded ? 180 : 0 },
309
+ transition: { duration: 0.2 },
310
+ style: { willChange: "transform" },
311
+ children: /* @__PURE__ */ jsx(Button, { size: "icon", onClick: handleToggleAll, children: /* @__PURE__ */ jsx(UtilityChevronDown, {}) })
312
+ }
313
+ )
314
+ ] });
315
+ });
316
+ AccordionHeaderRow.displayName = "AccordionHeaderRow";
317
+ const AccordionItem = React.forwardRef(
318
+ ({ value, children, className, ...props }, ref) => {
319
+ const { isExpanded: isExpandedFn } = useAccordion();
320
+ const isExpanded = isExpandedFn(value);
321
+ const itemContextValue = React.useMemo(
322
+ () => ({ value, isExpanded }),
323
+ [value, isExpanded]
324
+ );
325
+ return /* @__PURE__ */ jsx(AccordionItemContext.Provider, { value: itemContextValue, children: /* @__PURE__ */ jsx("div", { ref, className: cn(className), ...props, children }) });
326
+ }
327
+ );
61
328
  AccordionItem.displayName = "AccordionItem";
62
- const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "accordion-header", children: /* @__PURE__ */ jsxs(
63
- AccordionPrimitive.Trigger,
64
- {
65
- ref,
66
- className: cn("accordion-trigger", className),
67
- ...props,
68
- children: [
69
- children,
70
- /* @__PURE__ */ jsx(ChevronDown, { className: "accordion-chevron" })
71
- ]
329
+ const AccordionHeader = React.forwardRef(
330
+ ({ children, className, onClick, ...props }, ref) => {
331
+ return /* @__PURE__ */ jsx("div", { ref, onClick, className: cn(className), ...props, children });
72
332
  }
73
- ) }));
74
- AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
75
- const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
76
- AccordionPrimitive.Content,
77
- {
78
- ref,
79
- className: "accordion-content",
80
- ...props,
81
- children: /* @__PURE__ */ jsx("div", { className: cn("accordion-content-inner", className), children })
333
+ );
334
+ AccordionHeader.displayName = "AccordionHeader";
335
+ const AccordionTrigger = React.forwardRef(({ className, onClick, ...props }, ref) => {
336
+ const { toggle } = useAccordion();
337
+ const { value, isExpanded } = useAccordionItem();
338
+ const handleClick = React.useCallback(
339
+ (e) => {
340
+ e.stopPropagation();
341
+ toggle(value);
342
+ onClick == null ? void 0 : onClick(e);
343
+ },
344
+ [toggle, value, onClick]
345
+ );
346
+ return /* @__PURE__ */ jsx(
347
+ motion.div,
348
+ {
349
+ animate: { rotate: isExpanded ? 180 : 0 },
350
+ transition: { duration: 0.2 },
351
+ style: { willChange: "transform" },
352
+ children: /* @__PURE__ */ jsx(
353
+ Button,
354
+ {
355
+ ref,
356
+ size: "icon",
357
+ variant: "clear",
358
+ onClick: handleClick,
359
+ className: cn(className),
360
+ ...props,
361
+ children: /* @__PURE__ */ jsx(UtilityChevronDown, {})
362
+ }
363
+ )
364
+ }
365
+ );
366
+ });
367
+ AccordionTrigger.displayName = "AccordionTrigger";
368
+ const AccordionContent = React.forwardRef(
369
+ ({ children, className, ...props }, ref) => {
370
+ const { isExpanded } = useAccordionItem();
371
+ return /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isExpanded && /* @__PURE__ */ jsx(
372
+ motion.div,
373
+ {
374
+ initial: { height: 0, opacity: 0 },
375
+ animate: { height: "auto", opacity: 1 },
376
+ exit: { height: 0, opacity: 0 },
377
+ transition: { duration: 0.3, ease: [0.25, 0.46, 0.45, 0.94] },
378
+ className: cn(className),
379
+ style: { willChange: "opacity" },
380
+ children: /* @__PURE__ */ jsx("div", { ref, ...props, children })
381
+ }
382
+ ) });
82
383
  }
83
- ));
84
- AccordionContent.displayName = AccordionPrimitive.Content.displayName;
384
+ );
385
+ AccordionContent.displayName = "AccordionContent";
386
+ const AccordionListRow = React.forwardRef(
387
+ ({
388
+ icon,
389
+ badge,
390
+ title,
391
+ titleClassName,
392
+ rightContent,
393
+ onClick,
394
+ className,
395
+ variant: variant2 = "default",
396
+ ...props
397
+ }, ref) => {
398
+ return /* @__PURE__ */ jsxs("div", { ref, onClick, className: cn(className), ...props, children: [
399
+ icon,
400
+ badge,
401
+ /* @__PURE__ */ jsx("span", { className: cn(titleClassName), children: title }),
402
+ rightContent
403
+ ] });
404
+ }
405
+ );
406
+ AccordionListRow.displayName = "AccordionListRow";
407
+ const AccordionContainer = React.forwardRef(({ children, className, ...props }, ref) => {
408
+ return /* @__PURE__ */ jsx("section", { ref, className: cn(className), ...props, children });
409
+ });
410
+ AccordionContainer.displayName = "AccordionContainer";
85
411
  const AspectRatio = AspectRatioPrimitive.Root;
86
412
  const typographyVariants = cva("", {
87
413
  variants: {
@@ -389,66 +715,6 @@ function useIsMobile() {
389
715
  }, []);
390
716
  return !!isMobile;
391
717
  }
392
- const buttonVariants = cva(
393
- "button",
394
- {
395
- variants: {
396
- variant: {
397
- // CTA variants
398
- clear: "button--clear",
399
- default: "button--default",
400
- "primary-gradient": "button--primary-gradient",
401
- "primary-dark": "button--primary-dark",
402
- "secondary-light": "button--secondary-light",
403
- "tertiary-light": "button--tertiary-light",
404
- // Utility variants
405
- "general-primary": "button--general-primary",
406
- "general-secondary": "button--general-secondary",
407
- "general-tertiary": "button--general-tertiary",
408
- "transparent-tertiary": "button--transparent-tertiary",
409
- "tooltip-primary": "button--tooltip-primary",
410
- "tooltip-secondary": "button--tooltip-secondary"
411
- },
412
- size: {
413
- xlarge: "button--xlarge",
414
- large: "button--large",
415
- utility: "button--utility",
416
- icon: "button--icon"
417
- }
418
- },
419
- defaultVariants: {
420
- variant: "default",
421
- size: "large"
422
- }
423
- }
424
- );
425
- const sizeTextClasses = {
426
- xlarge: "body-large",
427
- large: "body-base",
428
- utility: "body-small",
429
- icon: ""
430
- };
431
- const Button = React.forwardRef(
432
- ({ className, variant: variant2, size, ftMadeFont, mazzardSoftFont, children, style, ...props }, ref) => {
433
- const textClass = sizeTextClasses[size || "large"];
434
- return /* @__PURE__ */ jsx(
435
- "button",
436
- {
437
- className: cn(
438
- buttonVariants({ variant: variant2, size }),
439
- ftMadeFont && "font-ftMade",
440
- mazzardSoftFont && "font-mazzardSoft",
441
- className
442
- ),
443
- style,
444
- ref,
445
- ...props,
446
- children: size === "icon" ? children : /* @__PURE__ */ jsx("span", { className: cn("button-text", textClass), children })
447
- }
448
- );
449
- }
450
- );
451
- Button.displayName = "Button";
452
718
  const Input = React.forwardRef(
453
719
  ({ className, type, startIcon, endIcon, ...props }, ref) => {
454
720
  const isReadOnly = props.readOnly;
@@ -1279,9 +1545,12 @@ const Label = React.forwardRef(({ className, children, ...props }, ref) => /* @_
1279
1545
  LabelPrimitive.Root,
1280
1546
  {
1281
1547
  ref,
1282
- className: cn(labelVariants(), "overline-medium", className),
1548
+ className: cn(labelVariants(), className),
1283
1549
  ...props,
1284
- children
1550
+ children: /* @__PURE__ */ jsxs("div", { className: "overline-medium", children: [
1551
+ " ",
1552
+ children
1553
+ ] })
1285
1554
  }
1286
1555
  ));
1287
1556
  Label.displayName = LabelPrimitive.Root.displayName;
@@ -1377,52 +1646,18 @@ const InputOTPSlot = React.forwardRef(({ index, className, ...props }, ref) => {
1377
1646
  "input-otp-slot",
1378
1647
  isActive && "input-otp-slot--active",
1379
1648
  className
1380
- ),
1381
- ...props,
1382
- children: [
1383
- char,
1384
- hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "input-otp-caret", children: /* @__PURE__ */ jsx("div", { className: "input-otp-caret-line" }) })
1385
- ]
1386
- }
1387
- );
1388
- });
1389
- InputOTPSlot.displayName = "InputOTPSlot";
1390
- const InputOTPSeparator = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx(Dot, {}) }));
1391
- InputOTPSeparator.displayName = "InputOTPSeparator";
1392
- const UtilityChevronDown = ({
1393
- className
1394
- }) => {
1395
- return /* @__PURE__ */ jsx(
1396
- "div",
1397
- {
1398
- className: cn(
1399
- "size-4 flex items-center justify-center text-gray-500",
1400
- className
1401
- ),
1402
- children: /* @__PURE__ */ jsx(
1403
- "svg",
1404
- {
1405
- xmlns: "http://www.w3.org/2000/svg",
1406
- width: "12",
1407
- height: "6",
1408
- viewBox: "0 0 12 6",
1409
- fill: "none",
1410
- className: cn("text-inherit"),
1411
- children: /* @__PURE__ */ jsx(
1412
- "path",
1413
- {
1414
- d: "M11 0.75L6 5.25L1 0.75",
1415
- stroke: "currentColor",
1416
- strokeWidth: "1.5",
1417
- strokeLinecap: "round",
1418
- strokeLinejoin: "round"
1419
- }
1420
- )
1421
- }
1422
- )
1649
+ ),
1650
+ ...props,
1651
+ children: [
1652
+ char,
1653
+ hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "input-otp-caret", children: /* @__PURE__ */ jsx("div", { className: "input-otp-caret-line" }) })
1654
+ ]
1423
1655
  }
1424
1656
  );
1425
- };
1657
+ });
1658
+ InputOTPSlot.displayName = "InputOTPSlot";
1659
+ const InputOTPSeparator = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx(Dot, {}) }));
1660
+ InputOTPSeparator.displayName = "InputOTPSeparator";
1426
1661
  const Select = SelectPrimitive.Root;
1427
1662
  const SelectGroup = SelectPrimitive.Group;
1428
1663
  const SelectValue = SelectPrimitive.Value;
@@ -2314,32 +2549,48 @@ const SearchField = ({
2314
2549
  ) })
2315
2550
  ] });
2316
2551
  };
2317
- const getStatusClass = (status, variant2 = "light") => {
2318
- return `status-tag tag--${variant2}-${status}`;
2552
+ const getStatusClass = (status, colorScheme = "light") => {
2553
+ return `status-tag tag--${colorScheme}-${status}`;
2319
2554
  };
2320
2555
  const Tag = React.forwardRef(
2321
2556
  ({
2322
2557
  children,
2558
+ variant: variant2 = "text",
2323
2559
  active = false,
2324
2560
  status,
2325
- variant: variant2 = "light",
2561
+ colorScheme = "light",
2326
2562
  className,
2563
+ style,
2327
2564
  onClick,
2328
2565
  ...props
2329
2566
  }, ref) => {
2330
2567
  if (status) {
2331
- const statusClass = getStatusClass(status, variant2);
2568
+ const statusClass = getStatusClass(status, colorScheme);
2332
2569
  return /* @__PURE__ */ jsx(
2333
2570
  "button",
2334
2571
  {
2335
2572
  ref,
2336
2573
  onClick,
2337
2574
  className: cn("overline-medium", statusClass, className),
2575
+ style,
2338
2576
  ...props,
2339
2577
  children
2340
2578
  }
2341
2579
  );
2342
2580
  }
2581
+ if (variant2 === "code") {
2582
+ return /* @__PURE__ */ jsx(
2583
+ "button",
2584
+ {
2585
+ ref,
2586
+ onClick,
2587
+ className: cn("tag-code", className),
2588
+ style,
2589
+ ...props,
2590
+ children: /* @__PURE__ */ jsx("span", { className: "number-small font-semibold", style: { color: "inherit" }, children })
2591
+ }
2592
+ );
2593
+ }
2343
2594
  return /* @__PURE__ */ jsx(
2344
2595
  "button",
2345
2596
  {
@@ -2350,6 +2601,7 @@ const Tag = React.forwardRef(
2350
2601
  active ? "tag-general--active" : "tag-general--inactive",
2351
2602
  className
2352
2603
  ),
2604
+ style,
2353
2605
  ...props,
2354
2606
  children
2355
2607
  }
@@ -3668,18 +3920,6 @@ function getPayloadConfigFromPayload(config, payload, key) {
3668
3920
  }
3669
3921
  return configLabelKey in config ? config[configLabelKey] : config[key];
3670
3922
  }
3671
- const CodeBadge = ({ code, className, style }) => {
3672
- return /* @__PURE__ */ jsx(
3673
- "div",
3674
- {
3675
- className: cn("code-badge", className),
3676
- style: {
3677
- ...style
3678
- },
3679
- children: /* @__PURE__ */ jsx("span", { className: "number-small font-semibold", style: { color: "inherit" }, children: code })
3680
- }
3681
- );
3682
- };
3683
3923
  const PageHeader = React.forwardRef(
3684
3924
  ({ children, className, ...props }, ref) => {
3685
3925
  return /* @__PURE__ */ jsx("header", { ref, className: cn("page-header", className), ...props, children });
@@ -3747,296 +3987,6 @@ const PageHeaderDescription = React.forwardRef(({ children, className, ...props
3747
3987
  );
3748
3988
  });
3749
3989
  PageHeaderDescription.displayName = "PageHeaderDescription";
3750
- const StandardTableContext = React.createContext(null);
3751
- const StandardTableRowContext = React.createContext(null);
3752
- function useStandardTable() {
3753
- const context = React.useContext(StandardTableContext);
3754
- if (!context) {
3755
- throw new Error(
3756
- "StandardTable components must be used within <StandardTable>"
3757
- );
3758
- }
3759
- return context;
3760
- }
3761
- function useStandardTableRow() {
3762
- const context = React.useContext(StandardTableRowContext);
3763
- if (!context) {
3764
- throw new Error(
3765
- "StandardTableTrigger and StandardTableContent must be used within <StandardTableRow>"
3766
- );
3767
- }
3768
- return context;
3769
- }
3770
- const StandardTable = React.forwardRef(
3771
- ({
3772
- allowMultiple = false,
3773
- defaultExpanded,
3774
- expandedValues: controlledExpandedValues,
3775
- onExpandedChange,
3776
- children,
3777
- className,
3778
- ...props
3779
- }, ref) => {
3780
- const getInitialExpanded = () => {
3781
- if (!defaultExpanded) return /* @__PURE__ */ new Set();
3782
- if (Array.isArray(defaultExpanded)) return new Set(defaultExpanded);
3783
- return /* @__PURE__ */ new Set([defaultExpanded]);
3784
- };
3785
- const [uncontrolledExpandedValues, setUncontrolledExpandedValues] = React.useState(getInitialExpanded);
3786
- const [isAllExpanded, setIsAllExpanded] = React.useState(false);
3787
- const isControlled = controlledExpandedValues !== void 0;
3788
- const expandedValues = isControlled ? controlledExpandedValues : uncontrolledExpandedValues;
3789
- const hasAnyExpanded = React.useMemo(
3790
- () => isAllExpanded || expandedValues.size > 0,
3791
- [isAllExpanded, expandedValues]
3792
- );
3793
- const isExpanded = React.useCallback(
3794
- (value) => isAllExpanded || expandedValues.has(value),
3795
- [isAllExpanded, expandedValues]
3796
- );
3797
- const toggle = React.useCallback(
3798
- (value) => {
3799
- const newValues = new Set(expandedValues);
3800
- if (newValues.has(value)) {
3801
- newValues.delete(value);
3802
- } else {
3803
- if (!allowMultiple) {
3804
- newValues.clear();
3805
- }
3806
- newValues.add(value);
3807
- }
3808
- if (!isControlled) {
3809
- setUncontrolledExpandedValues(newValues);
3810
- }
3811
- onExpandedChange == null ? void 0 : onExpandedChange(newValues);
3812
- setIsAllExpanded(false);
3813
- },
3814
- [allowMultiple, expandedValues, isControlled, onExpandedChange]
3815
- );
3816
- const expandAll = React.useCallback(() => {
3817
- setIsAllExpanded(true);
3818
- const emptySet = /* @__PURE__ */ new Set();
3819
- if (!isControlled) {
3820
- setUncontrolledExpandedValues(emptySet);
3821
- }
3822
- onExpandedChange == null ? void 0 : onExpandedChange(emptySet);
3823
- }, [isControlled, onExpandedChange]);
3824
- const collapseAll = React.useCallback(() => {
3825
- setIsAllExpanded(false);
3826
- const emptySet = /* @__PURE__ */ new Set();
3827
- if (!isControlled) {
3828
- setUncontrolledExpandedValues(emptySet);
3829
- }
3830
- onExpandedChange == null ? void 0 : onExpandedChange(emptySet);
3831
- }, [isControlled, onExpandedChange]);
3832
- const contextValue = React.useMemo(
3833
- () => ({
3834
- expandedValues,
3835
- isExpanded,
3836
- toggle,
3837
- expandAll,
3838
- collapseAll,
3839
- hasAnyExpanded,
3840
- allowMultiple
3841
- }),
3842
- [
3843
- expandedValues,
3844
- isExpanded,
3845
- toggle,
3846
- expandAll,
3847
- collapseAll,
3848
- hasAnyExpanded,
3849
- allowMultiple
3850
- ]
3851
- );
3852
- return /* @__PURE__ */ jsx(StandardTableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
3853
- "div",
3854
- {
3855
- ref,
3856
- className: cn(
3857
- "border border-blue-200 rounded-xl overflow-hidden",
3858
- className
3859
- ),
3860
- ...props,
3861
- children
3862
- }
3863
- ) });
3864
- }
3865
- );
3866
- StandardTable.displayName = "StandardTable";
3867
- const StandardTableHeader = React.forwardRef(({ title, hasExpanded, onToggleAll, className }, ref) => {
3868
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("standard-table-header", className), children: [
3869
- /* @__PURE__ */ jsx("h2", { className: "standard-table-header__title body-large", children: title }),
3870
- onToggleAll && /* @__PURE__ */ jsx(
3871
- motion.div,
3872
- {
3873
- animate: { rotate: hasExpanded ? 180 : 0 },
3874
- transition: { duration: 0.2 },
3875
- className: "mx-6",
3876
- children: /* @__PURE__ */ jsx(Button, { size: "icon", onClick: onToggleAll, children: /* @__PURE__ */ jsx(UtilityChevronDown, {}) })
3877
- }
3878
- )
3879
- ] });
3880
- });
3881
- StandardTableHeader.displayName = "StandardTableHeader";
3882
- const StandardTableHeaderRow = React.forwardRef(({ title, className }, ref) => {
3883
- const { hasAnyExpanded, expandAll, collapseAll } = useStandardTable();
3884
- const handleToggleAll = React.useCallback(() => {
3885
- if (hasAnyExpanded) {
3886
- collapseAll();
3887
- } else {
3888
- expandAll();
3889
- }
3890
- }, [hasAnyExpanded, collapseAll, expandAll]);
3891
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("standard-table-header", className), children: [
3892
- /* @__PURE__ */ jsx("h2", { className: "standard-table-header__title body-large", children: title }),
3893
- /* @__PURE__ */ jsx(
3894
- motion.div,
3895
- {
3896
- animate: { rotate: hasAnyExpanded ? 180 : 0 },
3897
- transition: { duration: 0.2 },
3898
- style: { willChange: "transform" },
3899
- children: /* @__PURE__ */ jsx(Button, { size: "icon", onClick: handleToggleAll, children: /* @__PURE__ */ jsx(UtilityChevronDown, {}) })
3900
- }
3901
- )
3902
- ] });
3903
- });
3904
- StandardTableHeaderRow.displayName = "StandardTableHeaderRow";
3905
- const StandardTableRow = React.forwardRef(({ value, children, className, ...props }, ref) => {
3906
- const { isExpanded: isExpandedFn } = useStandardTable();
3907
- const isExpanded = isExpandedFn(value);
3908
- const rowContextValue = React.useMemo(
3909
- () => ({ value, isExpanded }),
3910
- [value, isExpanded]
3911
- );
3912
- return /* @__PURE__ */ jsx(StandardTableRowContext.Provider, { value: rowContextValue, children: /* @__PURE__ */ jsx("div", { ref, className: cn("standard-table-row", className), ...props, children }) });
3913
- });
3914
- StandardTableRow.displayName = "StandardTableRow";
3915
- const StandardTableRowHeader = React.forwardRef(({ children, className, onClick, ...props }, ref) => {
3916
- return /* @__PURE__ */ jsx(
3917
- "div",
3918
- {
3919
- ref,
3920
- onClick,
3921
- className: cn("standard-table-row-header", className),
3922
- ...props,
3923
- children
3924
- }
3925
- );
3926
- });
3927
- StandardTableRowHeader.displayName = "StandardTableRowHeader";
3928
- const StandardTableTrigger = React.forwardRef(({ className, onClick, ...props }, ref) => {
3929
- const { toggle } = useStandardTable();
3930
- const { value, isExpanded } = useStandardTableRow();
3931
- const handleClick = React.useCallback(
3932
- (e) => {
3933
- e.stopPropagation();
3934
- toggle(value);
3935
- onClick == null ? void 0 : onClick(e);
3936
- },
3937
- [toggle, value, onClick]
3938
- );
3939
- return /* @__PURE__ */ jsx(
3940
- motion.div,
3941
- {
3942
- animate: { rotate: isExpanded ? 180 : 0 },
3943
- transition: { duration: 0.2 },
3944
- style: { willChange: "transform" },
3945
- children: /* @__PURE__ */ jsx(
3946
- Button,
3947
- {
3948
- ref,
3949
- size: "icon",
3950
- variant: "clear",
3951
- onClick: handleClick,
3952
- className: cn("standard-table-trigger", className),
3953
- ...props,
3954
- children: /* @__PURE__ */ jsx(UtilityChevronDown, {})
3955
- }
3956
- )
3957
- }
3958
- );
3959
- });
3960
- StandardTableTrigger.displayName = "StandardTableTrigger";
3961
- const StandardTableContent = React.forwardRef(({ children, className, ...props }, ref) => {
3962
- const { isExpanded } = useStandardTableRow();
3963
- return /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isExpanded && /* @__PURE__ */ jsx(
3964
- motion.div,
3965
- {
3966
- initial: { height: 0, opacity: 0 },
3967
- animate: { height: "auto", opacity: 1 },
3968
- exit: { height: 0, opacity: 0 },
3969
- transition: { duration: 0.3, ease: [0.25, 0.46, 0.45, 0.94] },
3970
- className: cn("standard-table-content", className),
3971
- style: { willChange: "opacity" },
3972
- children: /* @__PURE__ */ jsx(
3973
- "div",
3974
- {
3975
- ref,
3976
- className: "standard-table-content__inner",
3977
- ...props,
3978
- children
3979
- }
3980
- )
3981
- }
3982
- ) });
3983
- });
3984
- StandardTableContent.displayName = "StandardTableContent";
3985
- const StandardTableListRow = React.forwardRef(
3986
- ({
3987
- icon,
3988
- badge,
3989
- title,
3990
- titleClassName,
3991
- rightContent,
3992
- onClick,
3993
- className,
3994
- variant: variant2 = "default",
3995
- ...props
3996
- }, ref) => {
3997
- return /* @__PURE__ */ jsxs(
3998
- "div",
3999
- {
4000
- ref,
4001
- onClick,
4002
- className: cn(
4003
- "standard-table-list-row",
4004
- variant2 === "default" ? "standard-table-list-row--default" : "standard-table-list-row--nested",
4005
- className
4006
- ),
4007
- ...props,
4008
- children: [
4009
- icon,
4010
- badge,
4011
- /* @__PURE__ */ jsx(
4012
- "span",
4013
- {
4014
- className: cn(
4015
- "standard-table-list-row__title",
4016
- titleClassName || "body-large"
4017
- ),
4018
- children: title
4019
- }
4020
- ),
4021
- rightContent
4022
- ]
4023
- }
4024
- );
4025
- }
4026
- );
4027
- StandardTableListRow.displayName = "StandardTableListRow";
4028
- const StandardTableContainer = React.forwardRef(({ children, className, ...props }, ref) => {
4029
- return /* @__PURE__ */ jsx(
4030
- "section",
4031
- {
4032
- ref,
4033
- className: cn("standard-table-container", className),
4034
- ...props,
4035
- children
4036
- }
4037
- );
4038
- });
4039
- StandardTableContainer.displayName = "StandardTableContainer";
4040
3990
  const NavLogo = ({ dark = false }) => {
4041
3991
  return /* @__PURE__ */ jsxs(
4042
3992
  "svg",
@@ -9587,8 +9537,13 @@ function AlphaIcon({ dark = false }) {
9587
9537
  }
9588
9538
  export {
9589
9539
  Accordion,
9540
+ AccordionContainer,
9590
9541
  AccordionContent,
9542
+ AccordionHeader,
9543
+ AccordionHeaderRow,
9591
9544
  AccordionItem,
9545
+ AccordionListRow,
9546
+ AccordionSectionHeader,
9592
9547
  AccordionTrigger,
9593
9548
  Alert,
9594
9549
  AlertDescription,
@@ -9639,7 +9594,6 @@ export {
9639
9594
  ChartTooltip,
9640
9595
  ChartTooltipContent,
9641
9596
  Checkbox,
9642
- CodeBadge,
9643
9597
  Collapsible,
9644
9598
  CollapsibleContent,
9645
9599
  CollapsibleTrigger,
@@ -9834,15 +9788,6 @@ export {
9834
9788
  Toaster as Sonner,
9835
9789
  StandardLogo,
9836
9790
  StandardNavigation,
9837
- StandardTable,
9838
- StandardTableContainer,
9839
- StandardTableContent,
9840
- StandardTableHeader,
9841
- StandardTableHeaderRow,
9842
- StandardTableListRow,
9843
- StandardTableRow,
9844
- StandardTableRowHeader,
9845
- StandardTableTrigger,
9846
9791
  Switch,
9847
9792
  Table,
9848
9793
  TableBody,
@@ -9907,6 +9852,9 @@ export {
9907
9852
  cn,
9908
9853
  conceptColors,
9909
9854
  navigationMenuTriggerStyle,
9855
+ useAccordion,
9856
+ useAccordionItem,
9857
+ useAccordionState,
9910
9858
  useIsMobile,
9911
9859
  useSegmentedControl,
9912
9860
  useTabs,