@madecki/ui 1.5.0 → 2.1.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/CHANGELOG.md +30 -0
- package/README.md +99 -12
- package/cursor-rule-template.md +1 -1
- package/dist/index.cjs +362 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +79 -8
- package/dist/index.d.ts +79 -8
- package/dist/index.js +361 -69
- package/dist/index.js.map +1 -1
- package/llm-context.md +31 -13
- package/package.json +5 -2
package/dist/index.cjs
CHANGED
|
@@ -101,7 +101,9 @@ var Button = ({
|
|
|
101
101
|
label,
|
|
102
102
|
disabled,
|
|
103
103
|
className = "",
|
|
104
|
-
type = "button"
|
|
104
|
+
type = "button",
|
|
105
|
+
role,
|
|
106
|
+
ariaChecked
|
|
105
107
|
}) => {
|
|
106
108
|
if (typeof isActive === "boolean" && id === void 0) {
|
|
107
109
|
throw Error("If button has isActive props, it must have id props too");
|
|
@@ -118,6 +120,8 @@ var Button = ({
|
|
|
118
120
|
"button",
|
|
119
121
|
{
|
|
120
122
|
type,
|
|
123
|
+
role,
|
|
124
|
+
"aria-checked": ariaChecked,
|
|
121
125
|
className: surfaceClassName,
|
|
122
126
|
onClick: () => {
|
|
123
127
|
if (isActive === true) {
|
|
@@ -254,27 +258,106 @@ var GradientButton = ({
|
|
|
254
258
|
}
|
|
255
259
|
);
|
|
256
260
|
};
|
|
261
|
+
var sizeStyles = {
|
|
262
|
+
xs: "text-xs",
|
|
263
|
+
sm: "text-sm",
|
|
264
|
+
md: "text-md",
|
|
265
|
+
lg: "text-lg"
|
|
266
|
+
};
|
|
267
|
+
var weightStyles = {
|
|
268
|
+
normal: "font-normal",
|
|
269
|
+
medium: "font-medium",
|
|
270
|
+
semibold: "font-semibold",
|
|
271
|
+
bold: "font-bold"
|
|
272
|
+
};
|
|
273
|
+
var colorStyles = {
|
|
274
|
+
default: "text-white dark:text-white",
|
|
275
|
+
muted: "text-lightgray dark:text-lightgray",
|
|
276
|
+
primary: "text-primary dark:text-white",
|
|
277
|
+
success: "text-success",
|
|
278
|
+
warning: "text-warning",
|
|
279
|
+
danger: "text-danger"
|
|
280
|
+
};
|
|
281
|
+
var Text = ({
|
|
282
|
+
children,
|
|
283
|
+
id,
|
|
284
|
+
size = "md",
|
|
285
|
+
weight = "normal",
|
|
286
|
+
color = "default",
|
|
287
|
+
as: Tag2 = "p",
|
|
288
|
+
className = ""
|
|
289
|
+
}) => {
|
|
290
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
291
|
+
Tag2,
|
|
292
|
+
{
|
|
293
|
+
id,
|
|
294
|
+
className: `${sizeStyles[size]} ${weightStyles[weight]} ${colorStyles[color]} ${className}`,
|
|
295
|
+
children
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
};
|
|
299
|
+
function FormFieldLabel({
|
|
300
|
+
label,
|
|
301
|
+
labelVisibility,
|
|
302
|
+
id
|
|
303
|
+
}) {
|
|
304
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
305
|
+
Text,
|
|
306
|
+
{
|
|
307
|
+
as: "span",
|
|
308
|
+
id,
|
|
309
|
+
size: "sm",
|
|
310
|
+
weight: "medium",
|
|
311
|
+
color: "muted",
|
|
312
|
+
className: labelVisibility === "sr-only" ? "sr-only" : "mb-2 block",
|
|
313
|
+
children: label
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
}
|
|
257
317
|
var RadioButtons = ({
|
|
318
|
+
label,
|
|
319
|
+
labelVisibility = "visible",
|
|
258
320
|
items,
|
|
259
321
|
onChange,
|
|
260
322
|
size = "md",
|
|
261
323
|
className = ""
|
|
262
324
|
}) => {
|
|
325
|
+
const labelId = react.useId();
|
|
263
326
|
const [selectedButton, setSelectedButton] = react.useState();
|
|
264
327
|
const onButtonClick = (id) => {
|
|
265
328
|
setSelectedButton(id);
|
|
266
329
|
onChange(id ?? "");
|
|
267
330
|
};
|
|
268
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
331
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
|
|
332
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
333
|
+
FormFieldLabel,
|
|
334
|
+
{
|
|
335
|
+
id: labelId,
|
|
336
|
+
label,
|
|
337
|
+
labelVisibility
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
341
|
+
"div",
|
|
342
|
+
{
|
|
343
|
+
role: "radiogroup",
|
|
344
|
+
"aria-labelledby": labelId,
|
|
345
|
+
className: "flex flex-wrap gap-2",
|
|
346
|
+
children: items.map((item) => /* @__PURE__ */ react.createElement(
|
|
347
|
+
Button,
|
|
348
|
+
{
|
|
349
|
+
...item,
|
|
350
|
+
size,
|
|
351
|
+
key: item.id,
|
|
352
|
+
role: "radio",
|
|
353
|
+
ariaChecked: selectedButton === item.id,
|
|
354
|
+
isActive: selectedButton === item.id,
|
|
355
|
+
onClick: onButtonClick
|
|
356
|
+
}
|
|
357
|
+
))
|
|
358
|
+
}
|
|
359
|
+
)
|
|
360
|
+
] });
|
|
278
361
|
};
|
|
279
362
|
var Tag = ({
|
|
280
363
|
variant,
|
|
@@ -306,6 +389,7 @@ var Input = ({
|
|
|
306
389
|
defaultValue,
|
|
307
390
|
placeholder,
|
|
308
391
|
label,
|
|
392
|
+
labelVisibility = "visible",
|
|
309
393
|
variant = "primary",
|
|
310
394
|
type = "text",
|
|
311
395
|
maxLength,
|
|
@@ -319,6 +403,7 @@ var Input = ({
|
|
|
319
403
|
icon,
|
|
320
404
|
testId
|
|
321
405
|
}) => {
|
|
406
|
+
const labelId = react.useId();
|
|
322
407
|
const isControlled = valueProp !== void 0;
|
|
323
408
|
const [internalValue, setInternalValue] = react.useState(() => defaultValue ?? "");
|
|
324
409
|
const [isFocused, setIsFocused] = react.useState(false);
|
|
@@ -354,8 +439,15 @@ var Input = ({
|
|
|
354
439
|
}
|
|
355
440
|
onChange?.(next);
|
|
356
441
|
};
|
|
357
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: name, children: [
|
|
358
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
442
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: name, className: "block", children: [
|
|
443
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
444
|
+
FormFieldLabel,
|
|
445
|
+
{
|
|
446
|
+
id: labelId,
|
|
447
|
+
label,
|
|
448
|
+
labelVisibility
|
|
449
|
+
}
|
|
450
|
+
),
|
|
359
451
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: inputWrapperClassNames.join(" "), children: [
|
|
360
452
|
icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center pl-4", children: icon }),
|
|
361
453
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -375,7 +467,7 @@ var Input = ({
|
|
|
375
467
|
required,
|
|
376
468
|
pattern,
|
|
377
469
|
title,
|
|
378
|
-
"aria-label": ariaLabel
|
|
470
|
+
"aria-label": ariaLabel,
|
|
379
471
|
spellCheck,
|
|
380
472
|
disabled,
|
|
381
473
|
"data-testid": testId
|
|
@@ -384,6 +476,94 @@ var Input = ({
|
|
|
384
476
|
] })
|
|
385
477
|
] }) });
|
|
386
478
|
};
|
|
479
|
+
var Textarea = ({
|
|
480
|
+
name,
|
|
481
|
+
onChange,
|
|
482
|
+
value: valueProp,
|
|
483
|
+
defaultValue,
|
|
484
|
+
placeholder,
|
|
485
|
+
label,
|
|
486
|
+
labelVisibility = "visible",
|
|
487
|
+
variant = "primary",
|
|
488
|
+
rows = 4,
|
|
489
|
+
maxLength,
|
|
490
|
+
required = false,
|
|
491
|
+
ariaLabel,
|
|
492
|
+
spellCheck,
|
|
493
|
+
disabled = false,
|
|
494
|
+
className = "",
|
|
495
|
+
testId
|
|
496
|
+
}) => {
|
|
497
|
+
const labelId = react.useId();
|
|
498
|
+
const isControlled = valueProp !== void 0;
|
|
499
|
+
const [internalValue, setInternalValue] = react.useState(() => defaultValue ?? "");
|
|
500
|
+
const [isFocused, setIsFocused] = react.useState(false);
|
|
501
|
+
const value = isControlled ? valueProp : internalValue;
|
|
502
|
+
const fieldClassNames = [
|
|
503
|
+
"min-h-[6rem] resize-y rounded-sm font-sans z-10 w-full"
|
|
504
|
+
];
|
|
505
|
+
const spacings = "py-4 px-5";
|
|
506
|
+
const outline = "outline-hidden";
|
|
507
|
+
fieldClassNames.push(spacings, outline);
|
|
508
|
+
const inputWrapperClassNames = ["rounded-smb p-px w-full"];
|
|
509
|
+
if (isFocused) {
|
|
510
|
+
inputWrapperClassNames.push("bg-gradient");
|
|
511
|
+
} else if (variant === "primary" || variant === "tertiary") {
|
|
512
|
+
inputWrapperClassNames.push("bg-lightgray");
|
|
513
|
+
}
|
|
514
|
+
switch (variant) {
|
|
515
|
+
case "primary":
|
|
516
|
+
fieldClassNames.push("text-primary bg-neutral");
|
|
517
|
+
break;
|
|
518
|
+
case "secondary":
|
|
519
|
+
fieldClassNames.push("text-neutral bg-neutral dark:bg-gray");
|
|
520
|
+
break;
|
|
521
|
+
case "tertiary":
|
|
522
|
+
fieldClassNames.push("text-neutral bg-neutral dark:bg-primary");
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
if (disabled) {
|
|
526
|
+
fieldClassNames.push("cursor-not-allowed opacity-50");
|
|
527
|
+
}
|
|
528
|
+
const onFieldChange = (event) => {
|
|
529
|
+
const next = event.target.value;
|
|
530
|
+
if (!isControlled) {
|
|
531
|
+
setInternalValue(next);
|
|
532
|
+
}
|
|
533
|
+
onChange?.(next);
|
|
534
|
+
};
|
|
535
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: name, className: "block", children: [
|
|
536
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
537
|
+
FormFieldLabel,
|
|
538
|
+
{
|
|
539
|
+
id: labelId,
|
|
540
|
+
label,
|
|
541
|
+
labelVisibility
|
|
542
|
+
}
|
|
543
|
+
),
|
|
544
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: inputWrapperClassNames.join(" "), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
545
|
+
"textarea",
|
|
546
|
+
{
|
|
547
|
+
id: name,
|
|
548
|
+
name,
|
|
549
|
+
rows,
|
|
550
|
+
placeholder,
|
|
551
|
+
value,
|
|
552
|
+
className: fieldClassNames.join(" "),
|
|
553
|
+
autoComplete: "off",
|
|
554
|
+
onChange: onFieldChange,
|
|
555
|
+
onFocus: () => setIsFocused(true),
|
|
556
|
+
onBlur: () => setIsFocused(false),
|
|
557
|
+
maxLength,
|
|
558
|
+
required,
|
|
559
|
+
"aria-label": ariaLabel,
|
|
560
|
+
spellCheck,
|
|
561
|
+
disabled,
|
|
562
|
+
"data-testid": testId
|
|
563
|
+
}
|
|
564
|
+
) })
|
|
565
|
+
] }) });
|
|
566
|
+
};
|
|
387
567
|
function optionTestSlug(value) {
|
|
388
568
|
return value.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
389
569
|
}
|
|
@@ -468,6 +648,7 @@ function Select(props) {
|
|
|
468
648
|
const {
|
|
469
649
|
name,
|
|
470
650
|
label,
|
|
651
|
+
labelVisibility = "visible",
|
|
471
652
|
options,
|
|
472
653
|
placeholder = "Select\u2026",
|
|
473
654
|
variant = "primary",
|
|
@@ -475,6 +656,7 @@ function Select(props) {
|
|
|
475
656
|
className = "",
|
|
476
657
|
testId: testIdProp
|
|
477
658
|
} = props;
|
|
659
|
+
const labelId = react.useId();
|
|
478
660
|
const isMulti = props.multi === true;
|
|
479
661
|
const singleValueProp = !isMulti ? props.value : void 0;
|
|
480
662
|
const multiValueProp = isMulti ? props.value : void 0;
|
|
@@ -670,8 +852,15 @@ function Select(props) {
|
|
|
670
852
|
const activeDescendant = open && filteredOptions[highlightIndex] ? `${name}-option-${optionTestSlug(filteredOptions[highlightIndex].value)}` : void 0;
|
|
671
853
|
const listboxClass = "absolute left-0 right-0 top-full z-50 mt-1 max-h-60 overflow-auto rounded-sm border border-lightgray bg-neutral py-1 shadow-lg dark:border-gray dark:bg-gray dark:text-white";
|
|
672
854
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: `relative ${className}`.trim(), children: [
|
|
673
|
-
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: name, children: [
|
|
674
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
855
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: name, className: "block", children: [
|
|
856
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
857
|
+
FormFieldLabel,
|
|
858
|
+
{
|
|
859
|
+
id: labelId,
|
|
860
|
+
label,
|
|
861
|
+
labelVisibility
|
|
862
|
+
}
|
|
863
|
+
),
|
|
675
864
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: inputWrapperClassNames.join(" "), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: innerFieldClassNames.join(" "), children: [
|
|
676
865
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
677
866
|
"input",
|
|
@@ -685,7 +874,6 @@ function Select(props) {
|
|
|
685
874
|
disabled,
|
|
686
875
|
placeholder,
|
|
687
876
|
value: inputValue,
|
|
688
|
-
"aria-label": label,
|
|
689
877
|
"aria-expanded": open,
|
|
690
878
|
"aria-haspopup": "listbox",
|
|
691
879
|
"aria-controls": listboxId,
|
|
@@ -710,7 +898,7 @@ function Select(props) {
|
|
|
710
898
|
id: listboxId,
|
|
711
899
|
role: "listbox",
|
|
712
900
|
"aria-multiselectable": isMulti,
|
|
713
|
-
"aria-
|
|
901
|
+
"aria-labelledby": labelId,
|
|
714
902
|
"data-testid": `${baseTestId}-listbox`,
|
|
715
903
|
tabIndex: -1,
|
|
716
904
|
className: listboxClass,
|
|
@@ -826,6 +1014,93 @@ var SpinnerOverlay = ({
|
|
|
826
1014
|
}
|
|
827
1015
|
);
|
|
828
1016
|
};
|
|
1017
|
+
|
|
1018
|
+
// src/components/contentBoxVariants.ts
|
|
1019
|
+
var contentBoxVariantBorderClasses = {
|
|
1020
|
+
info: "border-blue",
|
|
1021
|
+
warning: "border-warning",
|
|
1022
|
+
success: "border-success",
|
|
1023
|
+
danger: "border-danger"
|
|
1024
|
+
};
|
|
1025
|
+
var placementClassNames = {
|
|
1026
|
+
"top-left": "top-5 left-5",
|
|
1027
|
+
"top-right": "top-5 right-5",
|
|
1028
|
+
"bottom-left": "bottom-5 left-5",
|
|
1029
|
+
"bottom-right": "bottom-5 right-5"
|
|
1030
|
+
};
|
|
1031
|
+
function CloseIcon({ className = "" }) {
|
|
1032
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1033
|
+
"svg",
|
|
1034
|
+
{
|
|
1035
|
+
width: 16,
|
|
1036
|
+
height: 16,
|
|
1037
|
+
viewBox: "0 0 16 16",
|
|
1038
|
+
fill: "none",
|
|
1039
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1040
|
+
className,
|
|
1041
|
+
"aria-hidden": true,
|
|
1042
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1043
|
+
"path",
|
|
1044
|
+
{
|
|
1045
|
+
d: "M4 4L12 12M12 4L4 12",
|
|
1046
|
+
stroke: "currentColor",
|
|
1047
|
+
strokeWidth: "2",
|
|
1048
|
+
strokeLinecap: "round"
|
|
1049
|
+
}
|
|
1050
|
+
)
|
|
1051
|
+
}
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1054
|
+
var Toast = ({
|
|
1055
|
+
children,
|
|
1056
|
+
variant = "info",
|
|
1057
|
+
placement = "bottom-right",
|
|
1058
|
+
autoCloseMs = 5e3,
|
|
1059
|
+
onClose,
|
|
1060
|
+
className = ""
|
|
1061
|
+
}) => {
|
|
1062
|
+
const [open, setOpen] = react.useState(true);
|
|
1063
|
+
const onCloseRef = react.useRef(onClose);
|
|
1064
|
+
onCloseRef.current = onClose;
|
|
1065
|
+
const dismiss = react.useCallback(() => {
|
|
1066
|
+
setOpen(false);
|
|
1067
|
+
onCloseRef.current?.();
|
|
1068
|
+
}, []);
|
|
1069
|
+
react.useEffect(() => {
|
|
1070
|
+
if (!open || autoCloseMs <= 0) {
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
const id = window.setTimeout(dismiss, autoCloseMs);
|
|
1074
|
+
return () => window.clearTimeout(id);
|
|
1075
|
+
}, [open, autoCloseMs, dismiss]);
|
|
1076
|
+
if (!open) {
|
|
1077
|
+
return null;
|
|
1078
|
+
}
|
|
1079
|
+
const border = contentBoxVariantBorderClasses[variant];
|
|
1080
|
+
const live = variant === "danger" ? "assertive" : "polite";
|
|
1081
|
+
const role = variant === "danger" ? "alert" : "status";
|
|
1082
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1083
|
+
"div",
|
|
1084
|
+
{
|
|
1085
|
+
role,
|
|
1086
|
+
"aria-live": live,
|
|
1087
|
+
className: `fixed z-50 flex max-w-sm gap-3 rounded-md border-2 bg-darkgray p-5 text-md text-white shadow-lg dark:bg-gray ${placementClassNames[placement]} ${border} ${className}`,
|
|
1088
|
+
children: [
|
|
1089
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children }),
|
|
1090
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1091
|
+
"button",
|
|
1092
|
+
{
|
|
1093
|
+
type: "button",
|
|
1094
|
+
onClick: dismiss,
|
|
1095
|
+
className: "shrink-0 rounded-sm p-2 text-icongray transition-colors hover:bg-white/10 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue",
|
|
1096
|
+
"aria-label": "Close",
|
|
1097
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {})
|
|
1098
|
+
}
|
|
1099
|
+
)
|
|
1100
|
+
]
|
|
1101
|
+
}
|
|
1102
|
+
);
|
|
1103
|
+
};
|
|
829
1104
|
var BlockQuote = ({ children, className = "" }) => {
|
|
830
1105
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
831
1106
|
"blockquote",
|
|
@@ -839,12 +1114,6 @@ var Hr = ({ className = "" }) => {
|
|
|
839
1114
|
const defaultClassNames = "border border-gray my-4";
|
|
840
1115
|
return /* @__PURE__ */ jsxRuntime.jsx("hr", { className: `${defaultClassNames} ${className}` });
|
|
841
1116
|
};
|
|
842
|
-
var variantStyles = {
|
|
843
|
-
info: "border-blue",
|
|
844
|
-
warning: "border-warning",
|
|
845
|
-
success: "border-success",
|
|
846
|
-
danger: "border-danger"
|
|
847
|
-
};
|
|
848
1117
|
var ContentBox = ({
|
|
849
1118
|
children,
|
|
850
1119
|
variant = "info",
|
|
@@ -854,7 +1123,7 @@ var ContentBox = ({
|
|
|
854
1123
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
855
1124
|
"div",
|
|
856
1125
|
{
|
|
857
|
-
className: `relative border rounded-md my-9 ${
|
|
1126
|
+
className: `relative border rounded-md my-9 ${contentBoxVariantBorderClasses[variant]} ${className}`,
|
|
858
1127
|
children: [
|
|
859
1128
|
icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute flex items-center justify-center p-3 -top-6 right-8 bg-primary border border-darkgray", children: icon }),
|
|
860
1129
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "m-7", children })
|
|
@@ -862,7 +1131,66 @@ var ContentBox = ({
|
|
|
862
1131
|
}
|
|
863
1132
|
);
|
|
864
1133
|
};
|
|
865
|
-
|
|
1134
|
+
function ChevronDown2({ className = "" }) {
|
|
1135
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1136
|
+
"svg",
|
|
1137
|
+
{
|
|
1138
|
+
width: 20,
|
|
1139
|
+
height: 20,
|
|
1140
|
+
viewBox: "0 0 20 20",
|
|
1141
|
+
fill: "none",
|
|
1142
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1143
|
+
className,
|
|
1144
|
+
"aria-hidden": true,
|
|
1145
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1146
|
+
"path",
|
|
1147
|
+
{
|
|
1148
|
+
d: "M5 7.5L10 12.5L15 7.5",
|
|
1149
|
+
stroke: "currentColor",
|
|
1150
|
+
strokeWidth: "1.5",
|
|
1151
|
+
strokeLinecap: "round",
|
|
1152
|
+
strokeLinejoin: "round"
|
|
1153
|
+
}
|
|
1154
|
+
)
|
|
1155
|
+
}
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
var DetailsPanel = ({
|
|
1159
|
+
summary,
|
|
1160
|
+
children,
|
|
1161
|
+
variant = "info",
|
|
1162
|
+
icon,
|
|
1163
|
+
defaultOpen = false,
|
|
1164
|
+
className = "",
|
|
1165
|
+
id
|
|
1166
|
+
}) => {
|
|
1167
|
+
const border = contentBoxVariantBorderClasses[variant];
|
|
1168
|
+
const [open, setOpen] = react.useState(defaultOpen);
|
|
1169
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1170
|
+
"details",
|
|
1171
|
+
{
|
|
1172
|
+
id,
|
|
1173
|
+
className: `group relative border rounded-md my-9 ${border} ${className}`,
|
|
1174
|
+
open,
|
|
1175
|
+
onToggle: (e) => setOpen(e.currentTarget.open),
|
|
1176
|
+
children: [
|
|
1177
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1178
|
+
"summary",
|
|
1179
|
+
{
|
|
1180
|
+
className: "flex cursor-pointer list-none items-center gap-3 p-7 text-white outline-none transition-colors hover:bg-darkgray/40 dark:hover:bg-white/5 focus-visible:ring-2 focus-visible:ring-blue group-open:pb-3 [&::-webkit-details-marker]:hidden",
|
|
1181
|
+
children: [
|
|
1182
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown2, { className: "size-5 shrink-0 text-icongray transition-transform group-open:rotate-180" }),
|
|
1183
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center", children: icon }) : null,
|
|
1184
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 text-md font-medium text-white dark:text-white", children: summary })
|
|
1185
|
+
]
|
|
1186
|
+
}
|
|
1187
|
+
),
|
|
1188
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-gray px-7 pb-7 pt-3 dark:border-gray", children })
|
|
1189
|
+
]
|
|
1190
|
+
}
|
|
1191
|
+
);
|
|
1192
|
+
};
|
|
1193
|
+
var sizeStyles2 = {
|
|
866
1194
|
sm: "max-w-screen-sm",
|
|
867
1195
|
md: "max-w-screen-md",
|
|
868
1196
|
lg: "max-w-screen-lg",
|
|
@@ -879,7 +1207,7 @@ var Container = ({
|
|
|
879
1207
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
880
1208
|
"div",
|
|
881
1209
|
{
|
|
882
|
-
className: `w-full px-5 ${
|
|
1210
|
+
className: `w-full px-5 ${sizeStyles2[size]} ${centeredClass} ${className}`,
|
|
883
1211
|
children
|
|
884
1212
|
}
|
|
885
1213
|
);
|
|
@@ -974,7 +1302,7 @@ var GridItem = ({
|
|
|
974
1302
|
}) => {
|
|
975
1303
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${colSpanStyles[colSpan]} ${className}`, children });
|
|
976
1304
|
};
|
|
977
|
-
var
|
|
1305
|
+
var sizeStyles3 = {
|
|
978
1306
|
xs: "text-xs",
|
|
979
1307
|
sm: "text-sm",
|
|
980
1308
|
md: "text-md",
|
|
@@ -984,13 +1312,13 @@ var sizeStyles2 = {
|
|
|
984
1312
|
"3xl": "text-3xl",
|
|
985
1313
|
"4xl": "text-4xl"
|
|
986
1314
|
};
|
|
987
|
-
var
|
|
1315
|
+
var weightStyles2 = {
|
|
988
1316
|
normal: "font-normal",
|
|
989
1317
|
medium: "font-medium",
|
|
990
1318
|
semibold: "font-semibold",
|
|
991
1319
|
bold: "font-bold"
|
|
992
1320
|
};
|
|
993
|
-
var
|
|
1321
|
+
var colorStyles2 = {
|
|
994
1322
|
default: "text-white dark:text-white",
|
|
995
1323
|
muted: "text-lightgray dark:text-lightgray",
|
|
996
1324
|
primary: "text-primary dark:text-white",
|
|
@@ -1019,47 +1347,11 @@ var Heading = ({
|
|
|
1019
1347
|
return react.createElement(
|
|
1020
1348
|
tag,
|
|
1021
1349
|
{
|
|
1022
|
-
className: `${
|
|
1350
|
+
className: `${sizeStyles3[resolvedSize]} ${weightStyles2[weight]} ${colorStyles2[color]} ${className}`
|
|
1023
1351
|
},
|
|
1024
1352
|
children
|
|
1025
1353
|
);
|
|
1026
1354
|
};
|
|
1027
|
-
var sizeStyles3 = {
|
|
1028
|
-
xs: "text-xs",
|
|
1029
|
-
sm: "text-sm",
|
|
1030
|
-
md: "text-md",
|
|
1031
|
-
lg: "text-lg"
|
|
1032
|
-
};
|
|
1033
|
-
var weightStyles2 = {
|
|
1034
|
-
normal: "font-normal",
|
|
1035
|
-
medium: "font-medium",
|
|
1036
|
-
semibold: "font-semibold",
|
|
1037
|
-
bold: "font-bold"
|
|
1038
|
-
};
|
|
1039
|
-
var colorStyles2 = {
|
|
1040
|
-
default: "text-white dark:text-white",
|
|
1041
|
-
muted: "text-lightgray dark:text-lightgray",
|
|
1042
|
-
primary: "text-primary dark:text-white",
|
|
1043
|
-
success: "text-success",
|
|
1044
|
-
warning: "text-warning",
|
|
1045
|
-
danger: "text-danger"
|
|
1046
|
-
};
|
|
1047
|
-
var Text = ({
|
|
1048
|
-
children,
|
|
1049
|
-
size = "md",
|
|
1050
|
-
weight = "normal",
|
|
1051
|
-
color = "default",
|
|
1052
|
-
as: Tag2 = "p",
|
|
1053
|
-
className = ""
|
|
1054
|
-
}) => {
|
|
1055
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1056
|
-
Tag2,
|
|
1057
|
-
{
|
|
1058
|
-
className: `${sizeStyles3[size]} ${weightStyles2[weight]} ${colorStyles2[color]} ${className}`,
|
|
1059
|
-
children
|
|
1060
|
-
}
|
|
1061
|
-
);
|
|
1062
|
-
};
|
|
1063
1355
|
var Heart = ({
|
|
1064
1356
|
variant = "outline",
|
|
1065
1357
|
className = "",
|
|
@@ -1435,6 +1727,7 @@ exports.Button = Button;
|
|
|
1435
1727
|
exports.ButtonTransparent = ButtonTransparent;
|
|
1436
1728
|
exports.Container = Container;
|
|
1437
1729
|
exports.ContentBox = ContentBox;
|
|
1730
|
+
exports.DetailsPanel = DetailsPanel;
|
|
1438
1731
|
exports.GradientButton = GradientButton;
|
|
1439
1732
|
exports.Grid = Grid;
|
|
1440
1733
|
exports.GridItem = GridItem;
|
|
@@ -1455,6 +1748,8 @@ exports.Stack = Stack;
|
|
|
1455
1748
|
exports.Tabs = Tabs;
|
|
1456
1749
|
exports.Tag = Tag;
|
|
1457
1750
|
exports.Text = Text;
|
|
1751
|
+
exports.Textarea = Textarea;
|
|
1752
|
+
exports.Toast = Toast;
|
|
1458
1753
|
exports.TwitterIcon = TwitterIcon;
|
|
1459
1754
|
exports.Warning = Warning;
|
|
1460
1755
|
//# sourceMappingURL=index.cjs.map
|