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