kaze-design-system 0.4.2 → 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.
Files changed (68) hide show
  1. package/README.md +95 -32
  2. package/components.css +73 -34
  3. package/dist/components/Alert/Alert.js +7 -16
  4. package/dist/components/Badge/Badge.js +1 -6
  5. package/dist/components/BarChart/BarChart.js +19 -15
  6. package/dist/components/BarList/BarList.js +2 -16
  7. package/dist/components/Card/Card.js +5 -3
  8. package/dist/components/Checkbox/Checkbox.js +1 -10
  9. package/dist/components/CommandPalette/CommandPalette.js +3 -9
  10. package/dist/components/DescriptionList/DescriptionList.js +11 -14
  11. package/dist/components/Dialog/Dialog.js +1 -10
  12. package/dist/components/Disclosure/Disclosure.js +18 -7
  13. package/dist/components/DonutChart/DonutChart.js +54 -50
  14. package/dist/components/Dropdown/Dropdown.js +2 -16
  15. package/dist/components/FAQ/FAQ.js +36 -46
  16. package/dist/components/FeatureGrid/FeatureGrid.js +1 -5
  17. package/dist/components/FilterPill/FilterPill.js +1 -5
  18. package/dist/components/FormField/FormField.js +2 -15
  19. package/dist/components/Grid/Grid.js +1 -9
  20. package/dist/components/HelpButton/HelpButton.js +1 -9
  21. package/dist/components/LPFooter/LPFooter.js +1 -10
  22. package/dist/components/List/List.js +2 -15
  23. package/dist/components/Logo/Logo.js +1 -10
  24. package/dist/components/Meter/Meter.js +1 -4
  25. package/dist/components/Metric/Metric.js +2 -17
  26. package/dist/components/Navbar/Navbar.js +2 -10
  27. package/dist/components/NumberField/NumberField.js +30 -7
  28. package/dist/components/Pagination/Pagination.js +37 -46
  29. package/dist/components/Pricing/Pricing.js +2 -17
  30. package/dist/components/Progress/Progress.js +3 -18
  31. package/dist/components/Radio/Radio.js +2 -14
  32. package/dist/components/Search/Search.js +10 -1
  33. package/dist/components/Section/Section.js +4 -12
  34. package/dist/components/Sidebar/Sidebar.js +7 -31
  35. package/dist/components/SplitSection/SplitSection.js +1 -5
  36. package/dist/components/StatusBadge/StatusBadge.js +1 -11
  37. package/dist/components/Stepper/Stepper.js +29 -27
  38. package/dist/components/Table/Table.js +5 -3
  39. package/dist/components/Tabs/Tabs.js +29 -36
  40. package/dist/components/Testimonial/Testimonial.js +19 -23
  41. package/dist/components/Text/Text.js +1 -11
  42. package/dist/components/Toast/Toast.js +103 -97
  43. package/dist/components/Tooltip/Tooltip.js +89 -92
  44. package/dist/components/TopBar/TopBar.js +4 -12
  45. package/dist/hooks/useLegendToggle.js +1 -4
  46. package/dist/hooks/useTheme.js +1 -4
  47. package/dist/marketing.js +33 -0
  48. package/dist/tokens.js +12 -0
  49. package/dist/types/components/Alert/Alert.d.ts +1 -1
  50. package/dist/types/components/Badge/Badge.d.ts +1 -1
  51. package/dist/types/components/Dialog/Dialog.d.ts +1 -1
  52. package/dist/types/components/Dropdown/Dropdown.d.ts +2 -3
  53. package/dist/types/components/Grid/Grid.d.ts +4 -4
  54. package/dist/types/components/Hero/Hero.d.ts +2 -2
  55. package/dist/types/components/Icon/Icon.d.ts +10 -5
  56. package/dist/types/components/Icon/index.d.ts +1 -1
  57. package/dist/types/components/NumberField/NumberField.d.ts +1 -1
  58. package/dist/types/components/Sidebar/index.d.ts +1 -1
  59. package/dist/types/components/Tabs/Tabs.d.ts +1 -1
  60. package/dist/types/components/Toast/Toast.d.ts +2 -2
  61. package/dist/types/components/index.d.ts +2 -2
  62. package/dist/types/components/marketing.d.ts +22 -0
  63. package/dist/types/hooks/useTheme.d.ts +1 -1
  64. package/dist/types/lib/utils.d.ts +1 -1
  65. package/dist/types/tokens/tokens.d.ts +13 -0
  66. package/package.json +23 -10
  67. package/tokens.css +72 -2
  68. package/utilities.css +5 -0
@@ -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) ref.current = innerRef.current;
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("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("line", { x1: "2", y1: "6", x2: "10", y2: "6" }) })
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("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
160
- /* @__PURE__ */ jsx("line", { x1: "6", y1: "2", x2: "6", y2: "10" }),
161
- /* @__PURE__ */ jsx("line", { x1: "2", y1: "6", x2: "10", y2: "6" })
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
- "nav",
30
- {
31
- ref,
32
- "aria-label": label,
33
- className: cn("pagination", className),
34
- ...rest,
35
- children: [
36
- /* @__PURE__ */ jsx(
37
- "button",
38
- {
39
- className: "pagination__btn",
40
- disabled: currentPage <= 1,
41
- onClick: () => onPageChange?.(currentPage - 1),
42
- "aria-label": prevLabel,
43
- children: "‹"
44
- }
45
- ),
46
- pages.map(
47
- (page, i) => page === "..." ? /* @__PURE__ */ jsx("span", { className: "pagination__ellipsis", children: "…" }, `e${i}`) : /* @__PURE__ */ jsx(
48
- "button",
49
- {
50
- className: cn(
51
- "pagination__btn",
52
- page === currentPage && "pagination__btn--active"
53
- ),
54
- onClick: () => onPageChange?.(page),
55
- "aria-current": page === currentPage ? "page" : void 0,
56
- children: page
57
- },
58
- page
59
- )
60
- ),
61
- /* @__PURE__ */ jsx(
62
- "button",
63
- {
64
- className: "pagination__btn",
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
- ({ placeholder = "Search...", shortcut, onSearch, value: valueProp, onChange: onChangeProp, "aria-label": ariaLabel, className, ...rest }, ref) => {
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
- "div",
27
- {
28
- ref,
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
- "aside",
8
- {
9
- ref,
10
- className: cn("sidebar", className),
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("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" }) });
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
- "div",
12
- {
13
- className: cn(
14
- "stepper__step",
15
- isActive && "stepper__step--active"
16
- ),
17
- children: [
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("span", { className: "stepper__label", children: step.label })
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(({ className, children, ...rest }, ref) => {
20
- return /* @__PURE__ */ jsx("thead", { ref, className, ...rest, children });
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
- (e) => {
17
- const target = e.target;
18
- if (target.getAttribute("role") !== "tab") return;
19
- const tabs = Array.from(
20
- e.currentTarget.querySelectorAll(
21
- '[role="tab"]:not([disabled])'
22
- )
23
- );
24
- const currentIndex = tabs.indexOf(target);
25
- if (currentIndex === -1) return;
26
- let nextIndex = null;
27
- if (e.key === "ArrowRight") {
28
- nextIndex = (currentIndex + 1) % tabs.length;
29
- } else if (e.key === "ArrowLeft") {
30
- nextIndex = (currentIndex - 1 + tabs.length) % tabs.length;
31
- } else if (e.key === "Home") {
32
- nextIndex = 0;
33
- } else if (e.key === "End") {
34
- nextIndex = tabs.length - 1;
35
- }
36
- if (nextIndex !== null) {
37
- const nextTab = tabs[nextIndex];
38
- if (nextTab) {
39
- e.preventDefault();
40
- nextTab.focus();
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
@@ -2,31 +2,27 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { cn } from "../../lib/utils.js";
4
4
  import { Avatar } from "../Avatar/Avatar.js";
5
- const TestimonialGrid = forwardRef(({ className, children, ...rest }, ref) => {
6
- return /* @__PURE__ */ jsx(
7
- "div",
8
- {
9
- ref,
10
- className: cn("testimonial-grid", className),
11
- ...rest,
12
- children
13
- }
14
- );
15
- });
5
+ const TestimonialGrid = forwardRef(
6
+ ({ className, children, ...rest }, ref) => {
7
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("testimonial-grid", className), ...rest, children });
8
+ }
9
+ );
16
10
  TestimonialGrid.displayName = "TestimonialGrid";
17
- const TestimonialCard = forwardRef(({ quote, authorName, authorRole, authorImage, showIcon, className, ...rest }, ref) => {
18
- const initials = authorName.split(/\s+/).map((w) => w[0]).join("").slice(0, 2);
19
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("testimonial", className), ...rest, children: [
20
- /* @__PURE__ */ jsx("blockquote", { className: "testimonial__quote", children: quote }),
21
- /* @__PURE__ */ jsxs("div", { className: "testimonial__author", children: [
22
- showIcon && (authorImage ? /* @__PURE__ */ jsx(Avatar, { size: "sm", src: authorImage, alt: authorName }) : /* @__PURE__ */ jsx("span", { className: "testimonial__icon", children: initials })),
23
- /* @__PURE__ */ jsxs("div", { children: [
24
- /* @__PURE__ */ jsx("span", { className: "testimonial__name", children: authorName }),
25
- authorRole && /* @__PURE__ */ jsx("span", { className: "testimonial__role", children: authorRole })
11
+ const TestimonialCard = forwardRef(
12
+ ({ quote, authorName, authorRole, authorImage, showIcon, className, ...rest }, ref) => {
13
+ const initials = authorName.split(/\s+/).map((w) => w[0]).join("").slice(0, 2);
14
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("testimonial", className), ...rest, children: [
15
+ /* @__PURE__ */ jsx("blockquote", { className: "testimonial__quote", children: quote }),
16
+ /* @__PURE__ */ jsxs("div", { className: "testimonial__author", children: [
17
+ showIcon && (authorImage ? /* @__PURE__ */ jsx(Avatar, { size: "sm", src: authorImage, alt: authorName }) : /* @__PURE__ */ jsx("span", { className: "testimonial__icon", children: initials })),
18
+ /* @__PURE__ */ jsxs("div", { children: [
19
+ /* @__PURE__ */ jsx("span", { className: "testimonial__name", children: authorName }),
20
+ authorRole && /* @__PURE__ */ jsx("span", { className: "testimonial__role", children: authorRole })
21
+ ] })
26
22
  ] })
27
- ] })
28
- ] });
29
- });
23
+ ] });
24
+ }
25
+ );
30
26
  TestimonialCard.displayName = "TestimonialCard";
31
27
  export {
32
28
  TestimonialCard,
@@ -1,17 +1,7 @@
1
1
  import { forwardRef, createElement } from "react";
2
2
  import { cn } from "../../lib/utils.js";
3
3
  const Text = forwardRef(
4
- ({
5
- variant = "body",
6
- size,
7
- weight,
8
- color,
9
- align,
10
- as = "p",
11
- className,
12
- children,
13
- ...rest
14
- }, ref) => {
4
+ ({ variant = "body", size, weight, color, align, as = "p", className, children, ...rest }, ref) => {
15
5
  return createElement(
16
6
  as,
17
7
  {