kaze-design-system 0.6.0 → 0.6.1
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/components/Alert/Alert.js +7 -16
- package/dist/components/Badge/Badge.js +1 -6
- package/dist/components/BarChart/BarChart.js +19 -15
- package/dist/components/BarList/BarList.js +2 -16
- package/dist/components/Card/Card.js +5 -3
- package/dist/components/Checkbox/Checkbox.js +1 -10
- package/dist/components/CommandPalette/CommandPalette.js +3 -9
- package/dist/components/DescriptionList/DescriptionList.js +11 -14
- package/dist/components/Dialog/Dialog.js +1 -10
- package/dist/components/Disclosure/Disclosure.js +1 -4
- package/dist/components/DonutChart/DonutChart.js +54 -50
- package/dist/components/Dropdown/Dropdown.js +2 -11
- package/dist/components/FAQ/FAQ.js +36 -46
- package/dist/components/FeatureGrid/FeatureGrid.js +1 -5
- package/dist/components/FilterPill/FilterPill.js +1 -5
- package/dist/components/FormField/FormField.js +2 -15
- package/dist/components/Grid/Grid.js +1 -9
- package/dist/components/HelpButton/HelpButton.js +1 -9
- package/dist/components/LPFooter/LPFooter.js +1 -10
- package/dist/components/List/List.js +2 -15
- package/dist/components/Logo/Logo.js +1 -10
- package/dist/components/Meter/Meter.js +1 -4
- package/dist/components/Metric/Metric.js +2 -17
- package/dist/components/Navbar/Navbar.js +2 -10
- package/dist/components/NumberField/NumberField.js +30 -7
- package/dist/components/Pagination/Pagination.js +37 -46
- package/dist/components/Pricing/Pricing.js +2 -17
- package/dist/components/Progress/Progress.js +3 -18
- package/dist/components/Radio/Radio.js +2 -14
- package/dist/components/Search/Search.js +10 -1
- package/dist/components/Section/Section.js +4 -12
- package/dist/components/Sidebar/Sidebar.js +7 -31
- package/dist/components/SplitSection/SplitSection.js +1 -5
- package/dist/components/StatusBadge/StatusBadge.js +1 -11
- package/dist/components/Stepper/Stepper.js +29 -27
- package/dist/components/Table/Table.js +5 -3
- package/dist/components/Tabs/Tabs.js +29 -36
- package/dist/components/Testimonial/Testimonial.js +19 -23
- package/dist/components/Text/Text.js +1 -11
- package/dist/components/Toast/Toast.js +103 -116
- package/dist/components/Tooltip/Tooltip.js +89 -92
- package/dist/components/TopBar/TopBar.js +4 -12
- package/dist/hooks/useLegendToggle.js +1 -4
- package/dist/hooks/useTheme.js +1 -4
- package/dist/types/components/Dropdown/Dropdown.d.ts +2 -3
- package/dist/types/components/Sidebar/index.d.ts +1 -1
- package/dist/types/components/Toast/Toast.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/hooks/useTheme.d.ts +1 -1
- package/dist/types/lib/utils.d.ts +1 -1
- package/package.json +6 -2
|
@@ -35,10 +35,7 @@ const Meter = forwardRef(
|
|
|
35
35
|
/* @__PURE__ */ jsxs(
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
|
-
className: cn(
|
|
39
|
-
"meter__track",
|
|
40
|
-
size !== "md" && `meter__track--${size}`
|
|
41
|
-
),
|
|
38
|
+
className: cn("meter__track", size !== "md" && `meter__track--${size}`),
|
|
42
39
|
role: "meter",
|
|
43
40
|
"aria-valuenow": value,
|
|
44
41
|
"aria-valuemin": min,
|
|
@@ -5,23 +5,8 @@ const Metric = forwardRef(
|
|
|
5
5
|
({ label, value, large, change, className, ...rest }, ref) => {
|
|
6
6
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("metric", className), ...rest, children: [
|
|
7
7
|
/* @__PURE__ */ jsx("span", { className: "metric__label", children: label }),
|
|
8
|
-
/* @__PURE__ */ jsx(
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
className: cn("metric__value", large && "metric__value--lg"),
|
|
12
|
-
children: value
|
|
13
|
-
}
|
|
14
|
-
),
|
|
15
|
-
change && /* @__PURE__ */ jsx(
|
|
16
|
-
"span",
|
|
17
|
-
{
|
|
18
|
-
className: cn(
|
|
19
|
-
"metric__change",
|
|
20
|
-
`metric__change--${change.trend}`
|
|
21
|
-
),
|
|
22
|
-
children: change.value
|
|
23
|
-
}
|
|
24
|
-
)
|
|
8
|
+
/* @__PURE__ */ jsx("span", { className: cn("metric__value", large && "metric__value--lg"), children: value }),
|
|
9
|
+
change && /* @__PURE__ */ jsx("span", { className: cn("metric__change", `metric__change--${change.trend}`), children: change.value })
|
|
25
10
|
] });
|
|
26
11
|
}
|
|
27
12
|
);
|
|
@@ -7,11 +7,7 @@ const Navbar = forwardRef(
|
|
|
7
7
|
"nav",
|
|
8
8
|
{
|
|
9
9
|
ref,
|
|
10
|
-
className: cn(
|
|
11
|
-
"navbar",
|
|
12
|
-
transparent && "navbar--transparent",
|
|
13
|
-
className
|
|
14
|
-
),
|
|
10
|
+
className: cn("navbar", transparent && "navbar--transparent", className),
|
|
15
11
|
...rest,
|
|
16
12
|
children: [
|
|
17
13
|
/* @__PURE__ */ jsxs("div", { className: "navbar__left", children: [
|
|
@@ -37,11 +33,7 @@ const NavbarLink = forwardRef(
|
|
|
37
33
|
Component,
|
|
38
34
|
{
|
|
39
35
|
ref,
|
|
40
|
-
className: cn(
|
|
41
|
-
"navbar__link",
|
|
42
|
-
active && "navbar__link--active",
|
|
43
|
-
className
|
|
44
|
-
),
|
|
36
|
+
className: cn("navbar__link", active && "navbar__link--active", className),
|
|
45
37
|
...rest,
|
|
46
38
|
children
|
|
47
39
|
}
|
|
@@ -23,7 +23,7 @@ function formatNumber(value, locale, currency) {
|
|
|
23
23
|
function parseLocaleNumber(str) {
|
|
24
24
|
const cleaned = str.replace(/[^\d.\-,]/g, "").replace(/,/g, "");
|
|
25
25
|
const num = Number(cleaned);
|
|
26
|
-
return isNaN(num) ? null : num;
|
|
26
|
+
return Number.isNaN(num) ? null : num;
|
|
27
27
|
}
|
|
28
28
|
const NumberField = forwardRef(
|
|
29
29
|
({
|
|
@@ -108,7 +108,8 @@ const NumberField = forwardRef(
|
|
|
108
108
|
};
|
|
109
109
|
useEffect(() => {
|
|
110
110
|
if (typeof ref === "function") ref(innerRef.current);
|
|
111
|
-
else if (ref)
|
|
111
|
+
else if (ref)
|
|
112
|
+
ref.current = innerRef.current;
|
|
112
113
|
});
|
|
113
114
|
const displayValue = editing ? editValue : value != null ? formatNumber(value, locale, currency) : "";
|
|
114
115
|
return /* @__PURE__ */ jsxs("div", { className: cn("number-field", error && "number-field--error", className), children: [
|
|
@@ -123,7 +124,18 @@ const NumberField = forwardRef(
|
|
|
123
124
|
disabled: disabled || min !== void 0 && (value ?? 0) <= min,
|
|
124
125
|
tabIndex: -1,
|
|
125
126
|
"aria-label": decrementLabel,
|
|
126
|
-
children: /* @__PURE__ */ jsx(
|
|
127
|
+
children: /* @__PURE__ */ jsx(
|
|
128
|
+
"svg",
|
|
129
|
+
{
|
|
130
|
+
width: "12",
|
|
131
|
+
height: "12",
|
|
132
|
+
viewBox: "0 0 12 12",
|
|
133
|
+
fill: "none",
|
|
134
|
+
stroke: "currentColor",
|
|
135
|
+
strokeWidth: "2",
|
|
136
|
+
children: /* @__PURE__ */ jsx("line", { x1: "2", y1: "6", x2: "10", y2: "6" })
|
|
137
|
+
}
|
|
138
|
+
)
|
|
127
139
|
}
|
|
128
140
|
),
|
|
129
141
|
resolvedPrefix && /* @__PURE__ */ jsx("span", { className: "number-field__affix", children: resolvedPrefix }),
|
|
@@ -156,10 +168,21 @@ const NumberField = forwardRef(
|
|
|
156
168
|
disabled: disabled || max !== void 0 && (value ?? 0) >= max,
|
|
157
169
|
tabIndex: -1,
|
|
158
170
|
"aria-label": incrementLabel,
|
|
159
|
-
children: /* @__PURE__ */ jsxs(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
171
|
+
children: /* @__PURE__ */ jsxs(
|
|
172
|
+
"svg",
|
|
173
|
+
{
|
|
174
|
+
width: "12",
|
|
175
|
+
height: "12",
|
|
176
|
+
viewBox: "0 0 12 12",
|
|
177
|
+
fill: "none",
|
|
178
|
+
stroke: "currentColor",
|
|
179
|
+
strokeWidth: "2",
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ jsx("line", { x1: "6", y1: "2", x2: "6", y2: "10" }),
|
|
182
|
+
/* @__PURE__ */ jsx("line", { x1: "2", y1: "6", x2: "10", y2: "6" })
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
)
|
|
163
186
|
}
|
|
164
187
|
)
|
|
165
188
|
] }),
|
|
@@ -25,52 +25,43 @@ const Pagination = forwardRef(
|
|
|
25
25
|
...rest
|
|
26
26
|
}, ref) => {
|
|
27
27
|
const pages = getPages(currentPage, totalPages, siblingCount);
|
|
28
|
-
return /* @__PURE__ */ jsxs(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
disabled: currentPage >= totalPages,
|
|
66
|
-
onClick: () => onPageChange?.(currentPage + 1),
|
|
67
|
-
"aria-label": nextLabel,
|
|
68
|
-
children: "›"
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
);
|
|
28
|
+
return /* @__PURE__ */ jsxs("nav", { ref, "aria-label": label, className: cn("pagination", className), ...rest, children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
type: "button",
|
|
33
|
+
className: "pagination__btn",
|
|
34
|
+
disabled: currentPage <= 1,
|
|
35
|
+
onClick: () => onPageChange?.(currentPage - 1),
|
|
36
|
+
"aria-label": prevLabel,
|
|
37
|
+
children: "‹"
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
pages.map(
|
|
41
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx("span", { className: "pagination__ellipsis", children: "…" }, `e${i}`) : /* @__PURE__ */ jsx(
|
|
42
|
+
"button",
|
|
43
|
+
{
|
|
44
|
+
type: "button",
|
|
45
|
+
className: cn("pagination__btn", page === currentPage && "pagination__btn--active"),
|
|
46
|
+
onClick: () => onPageChange?.(page),
|
|
47
|
+
"aria-current": page === currentPage ? "page" : void 0,
|
|
48
|
+
children: page
|
|
49
|
+
},
|
|
50
|
+
page
|
|
51
|
+
)
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
type: "button",
|
|
57
|
+
className: "pagination__btn",
|
|
58
|
+
disabled: currentPage >= totalPages,
|
|
59
|
+
onClick: () => onPageChange?.(currentPage + 1),
|
|
60
|
+
"aria-label": nextLabel,
|
|
61
|
+
children: "›"
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] });
|
|
74
65
|
}
|
|
75
66
|
);
|
|
76
67
|
Pagination.displayName = "Pagination";
|
|
@@ -8,27 +8,12 @@ const PricingGrid = forwardRef(
|
|
|
8
8
|
);
|
|
9
9
|
PricingGrid.displayName = "PricingGrid";
|
|
10
10
|
const PricingCard = forwardRef(
|
|
11
|
-
({
|
|
12
|
-
name,
|
|
13
|
-
description,
|
|
14
|
-
price,
|
|
15
|
-
period,
|
|
16
|
-
features,
|
|
17
|
-
featured,
|
|
18
|
-
badge,
|
|
19
|
-
className,
|
|
20
|
-
children,
|
|
21
|
-
...rest
|
|
22
|
-
}, ref) => {
|
|
11
|
+
({ name, description, price, period, features, featured, badge, className, children, ...rest }, ref) => {
|
|
23
12
|
return /* @__PURE__ */ jsxs(
|
|
24
13
|
"div",
|
|
25
14
|
{
|
|
26
15
|
ref,
|
|
27
|
-
className: cn(
|
|
28
|
-
"pricing-card",
|
|
29
|
-
featured && "pricing-card--featured",
|
|
30
|
-
className
|
|
31
|
-
),
|
|
16
|
+
className: cn("pricing-card", featured && "pricing-card--featured", className),
|
|
32
17
|
...rest,
|
|
33
18
|
children: [
|
|
34
19
|
badge && /* @__PURE__ */ jsx("span", { className: "pricing-card__badge", children: badge }),
|
|
@@ -2,16 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { cn } from "../../lib/utils.js";
|
|
4
4
|
const Progress = forwardRef(
|
|
5
|
-
({
|
|
6
|
-
value,
|
|
7
|
-
max = 100,
|
|
8
|
-
label,
|
|
9
|
-
showValue,
|
|
10
|
-
color = "default",
|
|
11
|
-
size = "md",
|
|
12
|
-
className,
|
|
13
|
-
...rest
|
|
14
|
-
}, ref) => {
|
|
5
|
+
({ value, max = 100, label, showValue, color = "default", size = "md", className, ...rest }, ref) => {
|
|
15
6
|
const pct = Math.min(100, Math.max(0, value / max * 100));
|
|
16
7
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("progress", className), ...rest, children: [
|
|
17
8
|
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "progress__label-row", children: [
|
|
@@ -24,10 +15,7 @@ const Progress = forwardRef(
|
|
|
24
15
|
/* @__PURE__ */ jsx(
|
|
25
16
|
"div",
|
|
26
17
|
{
|
|
27
|
-
className: cn(
|
|
28
|
-
"progress__track",
|
|
29
|
-
size !== "md" && `progress__track--${size}`
|
|
30
|
-
),
|
|
18
|
+
className: cn("progress__track", size !== "md" && `progress__track--${size}`),
|
|
31
19
|
role: "progressbar",
|
|
32
20
|
"aria-label": label,
|
|
33
21
|
"aria-valuenow": value,
|
|
@@ -36,10 +24,7 @@ const Progress = forwardRef(
|
|
|
36
24
|
children: /* @__PURE__ */ jsx(
|
|
37
25
|
"div",
|
|
38
26
|
{
|
|
39
|
-
className: cn(
|
|
40
|
-
"progress__fill",
|
|
41
|
-
color !== "default" && `progress__fill--${color}`
|
|
42
|
-
),
|
|
27
|
+
className: cn("progress__fill", color !== "default" && `progress__fill--${color}`),
|
|
43
28
|
style: { width: `${pct}%` }
|
|
44
29
|
}
|
|
45
30
|
)
|
|
@@ -24,24 +24,12 @@ const Radio = forwardRef(
|
|
|
24
24
|
);
|
|
25
25
|
Radio.displayName = "Radio";
|
|
26
26
|
const RadioGroup = forwardRef(
|
|
27
|
-
({
|
|
28
|
-
label,
|
|
29
|
-
orientation = "vertical",
|
|
30
|
-
error,
|
|
31
|
-
errorMessage,
|
|
32
|
-
className,
|
|
33
|
-
children,
|
|
34
|
-
...rest
|
|
35
|
-
}, ref) => {
|
|
27
|
+
({ label, orientation = "vertical", error, errorMessage, className, children, ...rest }, ref) => {
|
|
36
28
|
return /* @__PURE__ */ jsxs(
|
|
37
29
|
"fieldset",
|
|
38
30
|
{
|
|
39
31
|
ref,
|
|
40
|
-
className: cn(
|
|
41
|
-
"radio-group",
|
|
42
|
-
`radio-group--${orientation}`,
|
|
43
|
-
className
|
|
44
|
-
),
|
|
32
|
+
className: cn("radio-group", `radio-group--${orientation}`, className),
|
|
45
33
|
"aria-invalid": error || void 0,
|
|
46
34
|
...rest,
|
|
47
35
|
children: [
|
|
@@ -3,7 +3,16 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { forwardRef, useState, useCallback } from "react";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const Search = forwardRef(
|
|
6
|
-
({
|
|
6
|
+
({
|
|
7
|
+
placeholder = "Search...",
|
|
8
|
+
shortcut,
|
|
9
|
+
onSearch,
|
|
10
|
+
value: valueProp,
|
|
11
|
+
onChange: onChangeProp,
|
|
12
|
+
"aria-label": ariaLabel,
|
|
13
|
+
className,
|
|
14
|
+
...rest
|
|
15
|
+
}, ref) => {
|
|
7
16
|
const [internalValue, setInternalValue] = useState("");
|
|
8
17
|
const isControlled = valueProp !== void 0;
|
|
9
18
|
const currentValue = isControlled ? valueProp : internalValue;
|
|
@@ -22,18 +22,10 @@ const Section = forwardRef(
|
|
|
22
22
|
Section.displayName = "Section";
|
|
23
23
|
const SectionHeader = forwardRef(
|
|
24
24
|
({ title, description, className, ...rest }, ref) => {
|
|
25
|
-
return /* @__PURE__ */ jsxs(
|
|
26
|
-
"
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
className: cn("section-header", className),
|
|
30
|
-
...rest,
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ jsx("h2", { className: "section-header__title", children: title }),
|
|
33
|
-
description && /* @__PURE__ */ jsx("p", { className: "section-header__description", children: description })
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
);
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("section-header", className), ...rest, children: [
|
|
26
|
+
/* @__PURE__ */ jsx("h2", { className: "section-header__title", children: title }),
|
|
27
|
+
description && /* @__PURE__ */ jsx("p", { className: "section-header__description", children: description })
|
|
28
|
+
] });
|
|
37
29
|
}
|
|
38
30
|
);
|
|
39
31
|
SectionHeader.displayName = "SectionHeader";
|
|
@@ -3,19 +3,11 @@ import { forwardRef } from "react";
|
|
|
3
3
|
import { cn } from "../../lib/utils.js";
|
|
4
4
|
const Sidebar = forwardRef(
|
|
5
5
|
({ children, logo, footer, className, ...rest }, ref) => {
|
|
6
|
-
return /* @__PURE__ */ jsxs(
|
|
7
|
-
"
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...rest,
|
|
12
|
-
children: [
|
|
13
|
-
logo && /* @__PURE__ */ jsx("div", { className: "sidebar__logo", children: logo }),
|
|
14
|
-
/* @__PURE__ */ jsx("nav", { className: "sidebar__nav", children }),
|
|
15
|
-
footer && /* @__PURE__ */ jsx("div", { className: "sidebar__footer", children: footer })
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
);
|
|
6
|
+
return /* @__PURE__ */ jsxs("aside", { ref, className: cn("sidebar", className), ...rest, children: [
|
|
7
|
+
logo && /* @__PURE__ */ jsx("div", { className: "sidebar__logo", children: logo }),
|
|
8
|
+
/* @__PURE__ */ jsx("nav", { className: "sidebar__nav", children }),
|
|
9
|
+
footer && /* @__PURE__ */ jsx("div", { className: "sidebar__footer", children: footer })
|
|
10
|
+
] });
|
|
19
11
|
}
|
|
20
12
|
);
|
|
21
13
|
Sidebar.displayName = "Sidebar";
|
|
@@ -40,29 +32,13 @@ const NavItem = forwardRef(
|
|
|
40
32
|
NavItem.displayName = "NavItem";
|
|
41
33
|
const SidebarGroupLabel = forwardRef(
|
|
42
34
|
({ className, children, ...rest }, ref) => {
|
|
43
|
-
return /* @__PURE__ */ jsx(
|
|
44
|
-
"div",
|
|
45
|
-
{
|
|
46
|
-
ref,
|
|
47
|
-
className: cn("sidebar__group-label", className),
|
|
48
|
-
...rest,
|
|
49
|
-
children
|
|
50
|
-
}
|
|
51
|
-
);
|
|
35
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("sidebar__group-label", className), ...rest, children });
|
|
52
36
|
}
|
|
53
37
|
);
|
|
54
38
|
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
55
39
|
const SidebarDivider = forwardRef(
|
|
56
40
|
({ className, ...rest }, ref) => {
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
ref,
|
|
61
|
-
className: cn("sidebar__divider", className),
|
|
62
|
-
role: "separator",
|
|
63
|
-
...rest
|
|
64
|
-
}
|
|
65
|
-
);
|
|
41
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("sidebar__divider", className), role: "separator", ...rest });
|
|
66
42
|
}
|
|
67
43
|
);
|
|
68
44
|
SidebarDivider.displayName = "SidebarDivider";
|
|
@@ -10,11 +10,7 @@ const SplitSection = forwardRef(
|
|
|
10
10
|
"section",
|
|
11
11
|
{
|
|
12
12
|
ref,
|
|
13
|
-
className: cn(
|
|
14
|
-
"split-section",
|
|
15
|
-
reverse && "split-section--reverse",
|
|
16
|
-
className
|
|
17
|
-
),
|
|
13
|
+
className: cn("split-section", reverse && "split-section--reverse", className),
|
|
18
14
|
...rest,
|
|
19
15
|
children: [
|
|
20
16
|
mediaSlot,
|
|
@@ -12,17 +12,7 @@ const StatusBadge = forwardRef(
|
|
|
12
12
|
({ status, label, dot = true, live, ...rest }, ref) => {
|
|
13
13
|
const config = STATUS_CONFIG[status];
|
|
14
14
|
const isLive = live ?? (status === "live" || status === "loading");
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
16
|
-
Badge,
|
|
17
|
-
{
|
|
18
|
-
ref,
|
|
19
|
-
variant: config.variant,
|
|
20
|
-
dot,
|
|
21
|
-
live: isLive,
|
|
22
|
-
...rest,
|
|
23
|
-
children: label ?? config.label
|
|
24
|
-
}
|
|
25
|
-
);
|
|
15
|
+
return /* @__PURE__ */ jsx(Badge, { ref, variant: config.variant, dot, live: isLive, ...rest, children: label ?? config.label });
|
|
26
16
|
}
|
|
27
17
|
);
|
|
28
18
|
StatusBadge.displayName = "StatusBadge";
|
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { cn } from "../../lib/utils.js";
|
|
4
|
-
const CheckIcon = () => /* @__PURE__ */ jsx(
|
|
4
|
+
const CheckIcon = () => /* @__PURE__ */ jsx(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
"aria-hidden": "true",
|
|
8
|
+
width: "14",
|
|
9
|
+
height: "14",
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
strokeWidth: "3",
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
5
19
|
const Stepper = forwardRef(
|
|
6
20
|
({ steps, currentStep, className, ...rest }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("stepper", className), ...rest, children: steps.map((step, i) => {
|
|
7
21
|
const isCompleted = i < currentStep;
|
|
8
22
|
const isActive = i === currentStep;
|
|
9
23
|
return /* @__PURE__ */ jsxs("div", { style: { display: "contents" }, children: [
|
|
10
|
-
/* @__PURE__ */ jsxs(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */ jsx(
|
|
19
|
-
"span",
|
|
20
|
-
{
|
|
21
|
-
className: cn(
|
|
22
|
-
"stepper__circle",
|
|
23
|
-
isActive && "stepper__circle--active",
|
|
24
|
-
isCompleted && "stepper__circle--completed"
|
|
25
|
-
),
|
|
26
|
-
children: isCompleted ? /* @__PURE__ */ jsx(CheckIcon, {}) : i + 1
|
|
27
|
-
}
|
|
24
|
+
/* @__PURE__ */ jsxs("div", { className: cn("stepper__step", isActive && "stepper__step--active"), children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
"span",
|
|
27
|
+
{
|
|
28
|
+
className: cn(
|
|
29
|
+
"stepper__circle",
|
|
30
|
+
isActive && "stepper__circle--active",
|
|
31
|
+
isCompleted && "stepper__circle--completed"
|
|
28
32
|
),
|
|
29
|
-
/* @__PURE__ */ jsx(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
children: isCompleted ? /* @__PURE__ */ jsx(CheckIcon, {}) : i + 1
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ jsx("span", { className: "stepper__label", children: step.label })
|
|
37
|
+
] }),
|
|
33
38
|
i < steps.length - 1 && /* @__PURE__ */ jsx(
|
|
34
39
|
"span",
|
|
35
40
|
{
|
|
36
|
-
className: cn(
|
|
37
|
-
"stepper__connector",
|
|
38
|
-
isCompleted && "stepper__connector--completed"
|
|
39
|
-
)
|
|
41
|
+
className: cn("stepper__connector", isCompleted && "stepper__connector--completed")
|
|
40
42
|
}
|
|
41
43
|
)
|
|
42
44
|
] }, i);
|
|
@@ -16,9 +16,11 @@ const Table = forwardRef(
|
|
|
16
16
|
}
|
|
17
17
|
);
|
|
18
18
|
Table.displayName = "Table";
|
|
19
|
-
const TableHeader = forwardRef(
|
|
20
|
-
|
|
21
|
-
});
|
|
19
|
+
const TableHeader = forwardRef(
|
|
20
|
+
({ className, children, ...rest }, ref) => {
|
|
21
|
+
return /* @__PURE__ */ jsx("thead", { ref, className, ...rest, children });
|
|
22
|
+
}
|
|
23
|
+
);
|
|
22
24
|
TableHeader.displayName = "TableHeader";
|
|
23
25
|
const TableBody = forwardRef(
|
|
24
26
|
({ className, children, ...rest }, ref) => {
|
|
@@ -12,48 +12,41 @@ const TabGroup = forwardRef(
|
|
|
12
12
|
TabGroup.displayName = "TabGroup";
|
|
13
13
|
const Tabs = forwardRef(
|
|
14
14
|
({ variant = "default", className, children, ...rest }, ref) => {
|
|
15
|
-
const handleKeyDown = useCallback(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
nextTab.click();
|
|
42
|
-
}
|
|
15
|
+
const handleKeyDown = useCallback((e) => {
|
|
16
|
+
const target = e.target;
|
|
17
|
+
if (target.getAttribute("role") !== "tab") return;
|
|
18
|
+
const tabs = Array.from(
|
|
19
|
+
e.currentTarget.querySelectorAll(
|
|
20
|
+
'[role="tab"]:not([disabled])'
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
const currentIndex = tabs.indexOf(target);
|
|
24
|
+
if (currentIndex === -1) return;
|
|
25
|
+
let nextIndex = null;
|
|
26
|
+
if (e.key === "ArrowRight") {
|
|
27
|
+
nextIndex = (currentIndex + 1) % tabs.length;
|
|
28
|
+
} else if (e.key === "ArrowLeft") {
|
|
29
|
+
nextIndex = (currentIndex - 1 + tabs.length) % tabs.length;
|
|
30
|
+
} else if (e.key === "Home") {
|
|
31
|
+
nextIndex = 0;
|
|
32
|
+
} else if (e.key === "End") {
|
|
33
|
+
nextIndex = tabs.length - 1;
|
|
34
|
+
}
|
|
35
|
+
if (nextIndex !== null) {
|
|
36
|
+
const nextTab = tabs[nextIndex];
|
|
37
|
+
if (nextTab) {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
nextTab.focus();
|
|
40
|
+
nextTab.click();
|
|
43
41
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
);
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
47
44
|
return /* @__PURE__ */ jsx(
|
|
48
45
|
"div",
|
|
49
46
|
{
|
|
50
47
|
ref,
|
|
51
48
|
role: "tablist",
|
|
52
|
-
className: cn(
|
|
53
|
-
"tabs",
|
|
54
|
-
variant === "pills" && "tabs--pills",
|
|
55
|
-
className
|
|
56
|
-
),
|
|
49
|
+
className: cn("tabs", variant === "pills" && "tabs--pills", className),
|
|
57
50
|
onKeyDown: handleKeyDown,
|
|
58
51
|
...rest,
|
|
59
52
|
children
|