@chances-ai/design-system 21.0.0 → 24.2.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.
Files changed (95) hide show
  1. package/dist/cn.d.ts +11 -0
  2. package/dist/cn.d.ts.map +1 -0
  3. package/dist/cn.js +14 -0
  4. package/dist/cn.js.map +1 -0
  5. package/dist/diff/change-bar.d.ts +30 -0
  6. package/dist/diff/change-bar.d.ts.map +1 -0
  7. package/dist/diff/change-bar.js +55 -0
  8. package/dist/diff/change-bar.js.map +1 -0
  9. package/dist/diff/monaco-theme.d.ts +32 -0
  10. package/dist/diff/monaco-theme.d.ts.map +1 -0
  11. package/dist/diff/monaco-theme.js +70 -0
  12. package/dist/diff/monaco-theme.js.map +1 -0
  13. package/dist/heroui-theme.d.ts +37 -0
  14. package/dist/heroui-theme.d.ts.map +1 -0
  15. package/dist/heroui-theme.js +77 -0
  16. package/dist/heroui-theme.js.map +1 -0
  17. package/dist/icon/icon.d.ts +41 -0
  18. package/dist/icon/icon.d.ts.map +1 -0
  19. package/dist/icon/icon.js +41 -0
  20. package/dist/icon/icon.js.map +1 -0
  21. package/dist/icon/sprite-sheet.d.ts +13 -0
  22. package/dist/icon/sprite-sheet.d.ts.map +1 -0
  23. package/dist/icon/sprite-sheet.js +8 -0
  24. package/dist/icon/sprite-sheet.js.map +1 -0
  25. package/dist/icon/sprite.d.ts +42 -0
  26. package/dist/icon/sprite.d.ts.map +1 -0
  27. package/dist/icon/sprite.js +23 -0
  28. package/dist/icon/sprite.js.map +1 -0
  29. package/dist/index.d.ts +25 -7
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +38 -7
  32. package/dist/index.js.map +1 -1
  33. package/dist/motion/animated.d.ts +34 -0
  34. package/dist/motion/animated.d.ts.map +1 -0
  35. package/dist/motion/animated.js +39 -0
  36. package/dist/motion/animated.js.map +1 -0
  37. package/dist/primitives/button.d.ts +52 -0
  38. package/dist/primitives/button.d.ts.map +1 -0
  39. package/dist/primitives/button.js +20 -0
  40. package/dist/primitives/button.js.map +1 -0
  41. package/dist/primitives/card.d.ts +7 -0
  42. package/dist/primitives/card.d.ts.map +1 -0
  43. package/dist/primitives/card.js +10 -0
  44. package/dist/primitives/card.js.map +1 -0
  45. package/dist/primitives/scroll-area.d.ts +7 -0
  46. package/dist/primitives/scroll-area.d.ts.map +1 -0
  47. package/dist/primitives/scroll-area.js +10 -0
  48. package/dist/primitives/scroll-area.js.map +1 -0
  49. package/dist/primitives/stack.d.ts +9 -0
  50. package/dist/primitives/stack.d.ts.map +1 -0
  51. package/dist/primitives/stack.js +14 -0
  52. package/dist/primitives/stack.js.map +1 -0
  53. package/dist/primitives/status-badge.d.ts +42 -0
  54. package/dist/primitives/status-badge.d.ts.map +1 -0
  55. package/dist/primitives/status-badge.js +23 -0
  56. package/dist/primitives/status-badge.js.map +1 -0
  57. package/dist/primitives/surface.d.ts +201 -0
  58. package/dist/primitives/surface.d.ts.map +1 -0
  59. package/dist/primitives/surface.js +39 -0
  60. package/dist/primitives/surface.js.map +1 -0
  61. package/dist/primitives/tabs.d.ts +31 -0
  62. package/dist/primitives/tabs.d.ts.map +1 -0
  63. package/dist/primitives/tabs.js +70 -0
  64. package/dist/primitives/tabs.js.map +1 -0
  65. package/dist/primitives/text.d.ts +124 -0
  66. package/dist/primitives/text.d.ts.map +1 -0
  67. package/dist/primitives/text.js +36 -0
  68. package/dist/primitives/text.js.map +1 -0
  69. package/dist/theme-vars.d.ts +25 -0
  70. package/dist/theme-vars.d.ts.map +1 -0
  71. package/dist/theme-vars.js +24 -0
  72. package/dist/theme-vars.js.map +1 -0
  73. package/dist/widgets/filter-autocomplete.d.ts +21 -0
  74. package/dist/widgets/filter-autocomplete.d.ts.map +1 -0
  75. package/dist/widgets/filter-autocomplete.js +30 -0
  76. package/dist/widgets/filter-autocomplete.js.map +1 -0
  77. package/dist/widgets/index.d.ts +17 -0
  78. package/dist/widgets/index.d.ts.map +1 -0
  79. package/dist/widgets/index.js +17 -0
  80. package/dist/widgets/index.js.map +1 -0
  81. package/package.json +67 -7
  82. package/src/heroui-theme.css +42 -0
  83. package/src/tokens.css +147 -0
  84. package/dist/tamagui.config.d.ts +0 -117
  85. package/dist/tamagui.config.d.ts.map +0 -1
  86. package/dist/tamagui.config.js +0 -35
  87. package/dist/tamagui.config.js.map +0 -1
  88. package/dist/themes.d.ts +0 -5
  89. package/dist/themes.d.ts.map +0 -1
  90. package/dist/themes.js +0 -35
  91. package/dist/themes.js.map +0 -1
  92. package/dist/tokens.d.ts +0 -90
  93. package/dist/tokens.d.ts.map +0 -1
  94. package/dist/tokens.js +0 -34
  95. package/dist/tokens.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.js","sourceRoot":"","sources":["../../src/primitives/surface.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,EAAE,EAAqB,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC;IACxB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE;QACR,SAAS,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE;QAClD,KAAK,EAAE;YACL,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,mBAAmB;YAC3B,KAAK,EAAE,kBAAkB;SAC1B;QACD,MAAM,EAAE;YACN,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,2BAA2B;YACjC,MAAM,EAAE,6BAA6B;SACtC;QACD,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE;QAChG,OAAO,EAAE,EAAE,IAAI,EAAE,EAA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AI,EAAE,QAAQ,EAAE,CAAC,EAC3F,SAAS,CACV,KACG,IAAI,YAEP,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * (7.3 / task 03 — followup) `Tabs` — the self-built LIGHTWEIGHT tab control
3
+ * `[11.1]` (design §3.2: "Tabs 自建轻量;重 Tabs 用 HeroUI"). For simple segmented
4
+ * views that don't need HeroUI's full overlay/collection machinery — a panel
5
+ * switcher with correct ARIA (`tablist`/`tab`/`tabpanel`, `aria-selected`,
6
+ * `aria-controls`, roving `tabIndex` + ←/→/Home/End keyboard nav) so it clears
7
+ * the a11y gate. Controlled (`selectedId`) or uncontrolled (`defaultSelectedId`).
8
+ * `transition-colors` on the tabs ([11.8] CSS-transition tier). Browser-safe.
9
+ *
10
+ * Reach for the HeroUI `Tabs` (./widgets) when you need its richer collection /
11
+ * orientation / disabled-key behavior; this stays deliberately small.
12
+ */
13
+ import { type ReactNode } from "react";
14
+ export interface TabItem {
15
+ id: string;
16
+ label: ReactNode;
17
+ /** Panel content; rendered only for the active tab. */
18
+ content?: ReactNode;
19
+ }
20
+ export interface TabsProps {
21
+ items: readonly TabItem[];
22
+ /** Controlled active tab id. Omit + use `defaultSelectedId` for uncontrolled. */
23
+ selectedId?: string;
24
+ defaultSelectedId?: string;
25
+ onSelect?: (id: string) => void;
26
+ /** Required: the tablist has no visible label of its own. */
27
+ "aria-label": string;
28
+ className?: string;
29
+ }
30
+ export declare function Tabs({ items, selectedId, defaultSelectedId, onSelect, "aria-label": ariaLabel, className }: TabsProps): import("react/jsx-runtime").JSX.Element;
31
+ //# sourceMappingURL=tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/primitives/tabs.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAA4D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjG,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,uDAAuD;IACvD,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAeD,wBAAgB,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,SAAS,2CAwErH"}
@@ -0,0 +1,70 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * (7.3 / task 03 — followup) `Tabs` — the self-built LIGHTWEIGHT tab control
4
+ * `[11.1]` (design §3.2: "Tabs 自建轻量;重 Tabs 用 HeroUI"). For simple segmented
5
+ * views that don't need HeroUI's full overlay/collection machinery — a panel
6
+ * switcher with correct ARIA (`tablist`/`tab`/`tabpanel`, `aria-selected`,
7
+ * `aria-controls`, roving `tabIndex` + ←/→/Home/End keyboard nav) so it clears
8
+ * the a11y gate. Controlled (`selectedId`) or uncontrolled (`defaultSelectedId`).
9
+ * `transition-colors` on the tabs ([11.8] CSS-transition tier). Browser-safe.
10
+ *
11
+ * Reach for the HeroUI `Tabs` (./widgets) when you need its richer collection /
12
+ * orientation / disabled-key behavior; this stays deliberately small.
13
+ */
14
+ import { useCallback, useId, useRef, useState } from "react";
15
+ import { tv } from "tailwind-variants";
16
+ import { cn } from "../cn.js";
17
+ const tab = tv({
18
+ base: "relative px-3 py-1.5 text-sm font-medium transition-colors outline-none border-b-2 -mb-px focus-visible:ring-2 focus-visible:ring-border-focus rounded-t-sm",
19
+ variants: {
20
+ // Inactive tabs use text-weak (now AA-normal in every theme after the
21
+ // neutral-scale repair, §11) for the proper de-emphasis; active adds weight +
22
+ // the accent underline. Both clear WCAG AA at this sm size.
23
+ active: {
24
+ true: "text-text-base border-accent font-semibold",
25
+ false: "text-text-weak border-transparent hover:text-text-base hover:border-border-base",
26
+ },
27
+ },
28
+ });
29
+ export function Tabs({ items, selectedId, defaultSelectedId, onSelect, "aria-label": ariaLabel, className }) {
30
+ const baseId = useId();
31
+ const isControlled = selectedId != null;
32
+ const [internal, setInternal] = useState(defaultSelectedId ?? items[0]?.id ?? "");
33
+ const active = isControlled ? selectedId : internal;
34
+ const tabRefs = useRef({});
35
+ const select = useCallback((id) => {
36
+ if (!isControlled)
37
+ setInternal(id);
38
+ onSelect?.(id);
39
+ }, [isControlled, onSelect]);
40
+ const onKeyDown = (e) => {
41
+ const idx = items.findIndex((it) => it.id === active);
42
+ if (idx < 0)
43
+ return;
44
+ let next = idx;
45
+ if (e.key === "ArrowRight")
46
+ next = (idx + 1) % items.length;
47
+ else if (e.key === "ArrowLeft")
48
+ next = (idx - 1 + items.length) % items.length;
49
+ else if (e.key === "Home")
50
+ next = 0;
51
+ else if (e.key === "End")
52
+ next = items.length - 1;
53
+ else
54
+ return;
55
+ e.preventDefault();
56
+ const nextId = items[next]?.id;
57
+ if (nextId == null)
58
+ return;
59
+ select(nextId);
60
+ tabRefs.current[nextId]?.focus();
61
+ };
62
+ const activeItem = items.find((it) => it.id === active);
63
+ return (_jsxs("div", { className: cn("flex flex-col", className), children: [_jsx("div", { role: "tablist", "aria-label": ariaLabel, className: "flex flex-row border-b border-border-base", children: items.map((it) => {
64
+ const isActive = it.id === active;
65
+ return (_jsx("button", { ref: (el) => {
66
+ tabRefs.current[it.id] = el;
67
+ }, role: "tab", type: "button", id: `${baseId}-tab-${it.id}`, "aria-selected": isActive, "aria-controls": `${baseId}-panel-${it.id}`, tabIndex: isActive ? 0 : -1, className: tab({ active: isActive }), onClick: () => select(it.id), onKeyDown: onKeyDown, children: it.label }, it.id));
68
+ }) }), activeItem && (_jsx("div", { role: "tabpanel", id: `${baseId}-panel-${activeItem.id}`, "aria-labelledby": `${baseId}-tab-${activeItem.id}`, tabIndex: 0, className: "pt-3 outline-none animate-in fade-in duration-150", children: activeItem.content }))] }));
69
+ }
70
+ //# sourceMappingURL=tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/primitives/tabs.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AACjG,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAoB9B,MAAM,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,EAAE,6JAA6J;IACnK,QAAQ,EAAE;QACR,sEAAsE;QACtE,8EAA8E;QAC9E,4DAA4D;QAC5D,MAAM,EAAE;YACN,IAAI,EAAE,4CAA4C;YAClD,KAAK,EAAE,iFAAiF;SACzF;KACF;CACF,CAAC,CAAC;AAEH,MAAM,UAAU,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAa;IACpH,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IACvB,MAAM,YAAY,GAAG,UAAU,IAAI,IAAI,CAAC;IACxC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAS,iBAAiB,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1F,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAA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EACX,SAAS,EAAC,mDAAmD,YAE5D,UAAU,CAAC,OAAO,GACf,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,124 @@
1
+ /**
2
+ * (7.3 / task 03 — W2) `Text` — the typography primitive `[11.11]`, the
3
+ * tailwind-variants replacement for the inline-style `Txt` (retired in W4).
4
+ * `tone` maps to the seed-engine text/state color utilities; `as` picks the
5
+ * element (span default, or h1–h4/p/code/div). One-off colors → `style`.
6
+ * Browser-safe.
7
+ */
8
+ import type { CSSProperties, ReactNode } from "react";
9
+ import { type VariantProps } from "tailwind-variants";
10
+ export declare const text: import("tailwind-variants").TVReturnType<{
11
+ tone: {
12
+ base: string;
13
+ weak: string;
14
+ weaker: string;
15
+ strong: string;
16
+ accent: string;
17
+ success: string;
18
+ error: string;
19
+ warning: string;
20
+ permission: string;
21
+ inherit: string;
22
+ };
23
+ size: {
24
+ xs: string;
25
+ sm: string;
26
+ md: string;
27
+ lg: string;
28
+ xl: string;
29
+ };
30
+ weight: {
31
+ normal: string;
32
+ medium: string;
33
+ semibold: string;
34
+ bold: string;
35
+ };
36
+ mono: {
37
+ true: string;
38
+ false: string;
39
+ };
40
+ truncate: {
41
+ true: string;
42
+ false: string;
43
+ };
44
+ }, undefined, "", {
45
+ tone: {
46
+ base: string;
47
+ weak: string;
48
+ weaker: string;
49
+ strong: string;
50
+ accent: string;
51
+ success: string;
52
+ error: string;
53
+ warning: string;
54
+ permission: string;
55
+ inherit: string;
56
+ };
57
+ size: {
58
+ xs: string;
59
+ sm: string;
60
+ md: string;
61
+ lg: string;
62
+ xl: string;
63
+ };
64
+ weight: {
65
+ normal: string;
66
+ medium: string;
67
+ semibold: string;
68
+ bold: string;
69
+ };
70
+ mono: {
71
+ true: string;
72
+ false: string;
73
+ };
74
+ truncate: {
75
+ true: string;
76
+ false: string;
77
+ };
78
+ }, undefined, import("tailwind-variants").TVReturnType<{
79
+ tone: {
80
+ base: string;
81
+ weak: string;
82
+ weaker: string;
83
+ strong: string;
84
+ accent: string;
85
+ success: string;
86
+ error: string;
87
+ warning: string;
88
+ permission: string;
89
+ inherit: string;
90
+ };
91
+ size: {
92
+ xs: string;
93
+ sm: string;
94
+ md: string;
95
+ lg: string;
96
+ xl: string;
97
+ };
98
+ weight: {
99
+ normal: string;
100
+ medium: string;
101
+ semibold: string;
102
+ bold: string;
103
+ };
104
+ mono: {
105
+ true: string;
106
+ false: string;
107
+ };
108
+ truncate: {
109
+ true: string;
110
+ false: string;
111
+ };
112
+ }, undefined, "", unknown, unknown, undefined>>;
113
+ export type TextVariants = VariantProps<typeof text>;
114
+ type TextElement = "span" | "p" | "div" | "code" | "h1" | "h2" | "h3" | "h4" | "label" | "strong";
115
+ export interface TextProps extends TextVariants {
116
+ as?: TextElement;
117
+ children?: ReactNode;
118
+ className?: string;
119
+ style?: CSSProperties;
120
+ title?: string;
121
+ }
122
+ export declare function Text({ as, tone, size, weight, mono, truncate, className, children, ...rest }: TextProps): import("react/jsx-runtime").JSX.Element;
123
+ export {};
124
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/primitives/text.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG1D,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA2Bf,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;AAErD,KAAK,WAAW,GAAG,MAAM,GAAG,GAAG,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,CAAC;AAElG,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,2CAOhH"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { tv } from "tailwind-variants";
3
+ import { cn } from "../cn.js";
4
+ export const text = tv({
5
+ base: "",
6
+ variants: {
7
+ // CONTRAST CONTRACT (engine-measured, see ui-core engine.test WCAG gate):
8
+ // base/weak/strong → WCAG AA-normal (≥4.5) — safe for body copy at any size.
9
+ // weaker → AA-large (≥3.0) — distinguishable secondary/dim text.
10
+ // Guaranteed across every built-in theme × mode by the neutral-scale repair
11
+ // (§11): the text segment is monotonic + meets these floors even in light mode.
12
+ // The Storybook axe gate (scripts/a11y-stories.ts) still backstops misuse.
13
+ tone: {
14
+ base: "text-text-base",
15
+ weak: "text-text-weak",
16
+ weaker: "text-text-weaker",
17
+ strong: "text-text-strong",
18
+ accent: "text-accent",
19
+ success: "text-success",
20
+ error: "text-error",
21
+ warning: "text-warning",
22
+ permission: "text-permission",
23
+ inherit: "",
24
+ },
25
+ size: { xs: "text-xs", sm: "text-sm", md: "text-base", lg: "text-lg", xl: "text-xl" },
26
+ weight: { normal: "font-normal", medium: "font-medium", semibold: "font-semibold", bold: "font-bold" },
27
+ mono: { true: "font-mono", false: "" },
28
+ truncate: { true: "truncate", false: "" },
29
+ },
30
+ defaultVariants: { tone: "base", mono: false, truncate: false },
31
+ });
32
+ export function Text({ as = "span", tone, size, weight, mono, truncate, className, children, ...rest }) {
33
+ const Comp = as;
34
+ return (_jsx(Comp, { className: cn(text({ tone, size, weight, mono, truncate }), className), ...rest, children: children }));
35
+ }
36
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/primitives/text.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,EAAE,EAAqB,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;IACrB,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE;QACR,0EAA0E;QAC1E,+EAA+E;QAC/E,6EAA6E;QAC7E,4EAA4E;QAC5E,gFAAgF;QAChF,2EAA2E;QAC3E,IAAI,EAAE;YACJ,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,gBAAgB;YACtB,MAAM,EAAE,kBAAkB;YAC1B,MAAM,EAAE,kBAAkB;YAC1B,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE,cAAc;YACvB,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,cAAc;YACvB,UAAU,EAAE,iBAAiB;YAC7B,OAAO,EAAE,EAAE;SACZ;QACD,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE;QACrF,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;QACtG,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE;QACtC,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE;KAC1C;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;CAChE,CAAC,CAAC;AAcH,MAAM,UAAU,IAAI,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAa;IAC/G,MAAM,IAAI,GAAG,EAAE,CAAC;IAChB,OAAO,CACL,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,KAAM,IAAI,YACnF,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * (7.3 / task 03 — W1) The runtime half of the `@theme` bridge `[11.4]`/`[11.5]`.
3
+ * `tokens.css` statically binds each Tailwind color utility to a `--ch-*` var
4
+ * (`--color-accent: var(--ch-accent)`); THIS module sets the per-theme VALUES of
5
+ * those `--ch-*` vars at runtime, so switching theme = swapping one set of custom
6
+ * properties (the subtree recomputes). Engine-backed (ui-core `resolveThemeTokens`
7
+ * + `toCssVars`). Browser-safe; the DOM helper is optional (pure `themeVars` for
8
+ * SSR / inline-style spread).
9
+ */
10
+ import { type ThemeMode } from "@chances-ai/ui-core";
11
+ /** The full `--ch-*` value set for a theme + mode (spread onto a panel root's
12
+ * inline `style`, or fed to {@link applyThemeVars}). */
13
+ export declare function themeVars(themeId: string, mode: ThemeMode): Record<`--${string}`, string>;
14
+ /** Minimal element shape {@link applyThemeVars} writes to — a real `HTMLElement`
15
+ * satisfies it; keeps this testable without a DOM and `@types/dom`-free at call
16
+ * sites that pass a stub. */
17
+ export interface StyleTarget {
18
+ style: {
19
+ setProperty(name: string, value: string): void;
20
+ };
21
+ }
22
+ /** Imperatively write a theme's `--ch-*` vars onto an element (e.g. the panel
23
+ * root / `document.documentElement`). Returns the var set that was applied. */
24
+ export declare function applyThemeVars(el: StyleTarget, themeId: string, mode: ThemeMode): Record<`--${string}`, string>;
25
+ //# sourceMappingURL=theme-vars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-vars.d.ts","sourceRoot":"","sources":["../src/theme-vars.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEpF;yDACyD;AACzD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,MAAM,CAAC,CAEzF;AAED;;8BAE8B;AAC9B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE;QAAE,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAC3D;AAED;gFACgF;AAChF,wBAAgB,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,MAAM,CAAC,CAI/G"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * (7.3 / task 03 — W1) The runtime half of the `@theme` bridge `[11.4]`/`[11.5]`.
3
+ * `tokens.css` statically binds each Tailwind color utility to a `--ch-*` var
4
+ * (`--color-accent: var(--ch-accent)`); THIS module sets the per-theme VALUES of
5
+ * those `--ch-*` vars at runtime, so switching theme = swapping one set of custom
6
+ * properties (the subtree recomputes). Engine-backed (ui-core `resolveThemeTokens`
7
+ * + `toCssVars`). Browser-safe; the DOM helper is optional (pure `themeVars` for
8
+ * SSR / inline-style spread).
9
+ */
10
+ import { resolveThemeTokens, toCssVars } from "@chances-ai/ui-core";
11
+ /** The full `--ch-*` value set for a theme + mode (spread onto a panel root's
12
+ * inline `style`, or fed to {@link applyThemeVars}). */
13
+ export function themeVars(themeId, mode) {
14
+ return toCssVars(resolveThemeTokens(themeId, mode));
15
+ }
16
+ /** Imperatively write a theme's `--ch-*` vars onto an element (e.g. the panel
17
+ * root / `document.documentElement`). Returns the var set that was applied. */
18
+ export function applyThemeVars(el, themeId, mode) {
19
+ const vars = themeVars(themeId, mode);
20
+ for (const [name, value] of Object.entries(vars))
21
+ el.style.setProperty(name, value);
22
+ return vars;
23
+ }
24
+ //# sourceMappingURL=theme-vars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-vars.js","sourceRoot":"","sources":["../src/theme-vars.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAkB,MAAM,qBAAqB,CAAC;AAEpF;yDACyD;AACzD,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,IAAe;IACxD,OAAO,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AASD;gFACgF;AAChF,MAAM,UAAU,cAAc,CAAC,EAAe,EAAE,OAAe,EAAE,IAAe;IAC9E,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACtC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpF,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,21 @@
1
+ export interface FilterAutocompleteProps<T extends object> {
2
+ /** The full option set; filtering happens client-side over `getLabel`. */
3
+ items: readonly T[];
4
+ /** The currently selected option's key, or null when nothing is chosen. */
5
+ selectedKey: string | null;
6
+ getKey: (item: T) => string;
7
+ getLabel: (item: T) => string;
8
+ onSelect: (item: T) => void;
9
+ isDisabled?: boolean;
10
+ /** Trigger text shown when nothing is selected. */
11
+ placeholder?: string;
12
+ /** Placeholder inside the filter search box. */
13
+ searchPlaceholder?: string;
14
+ /** Shown when the filter matches nothing. */
15
+ emptyLabel?: string;
16
+ /** Required for a11y (the picker has no visible label). */
17
+ "aria-label": string;
18
+ className?: string;
19
+ }
20
+ export declare function FilterAutocomplete<T extends object>({ items, selectedKey, getKey, getLabel, onSelect, isDisabled, placeholder, searchPlaceholder, emptyLabel, "aria-label": ariaLabel, className, }: FilterAutocompleteProps<T>): import("react/jsx-runtime").JSX.Element;
21
+ //# sourceMappingURL=filter-autocomplete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-autocomplete.d.ts","sourceRoot":"","sources":["../../src/widgets/filter-autocomplete.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,MAAM;IACvD,0EAA0E;IAC1E,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IACpB,2EAA2E;IAC3E,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,EACnD,KAAK,EACL,WAAW,EACX,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,WAAuB,EACvB,iBAA6B,EAC7B,UAAuB,EACvB,YAAY,EAAE,SAAS,EACvB,SAAS,GACV,EAAE,uBAAuB,CAAC,CAAC,CAAC,2CAuC5B"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * (7.3 / task 03 — W3a) `FilterAutocomplete` — the composed, generic substrate
4
+ * that retires the bespoke web `model-picker.tsx` `[11.2]` (design §3.3). It
5
+ * folds HeroUI v3's `Autocomplete` compound boilerplate (Trigger → Value →
6
+ * Popover → Filter → SearchField + ListBox) into a single typed component: the
7
+ * caller passes `items`, the selected key, and `getKey`/`getLabel`/`onSelect`.
8
+ *
9
+ * Client-side filtering uses a plain `contains` predicate (RAC's `filter` prop
10
+ * is just `(textValue, inputValue) => boolean`), so no `useFilter` dependency.
11
+ * The W4 client migration builds its `ModelPicker` on this; the pure
12
+ * `filterModels` test stays, and real keyboard/filter interaction is covered by
13
+ * the Storybook browser-mode pass (design §4). Theme comes from the panel's
14
+ * `.chances-theme` scope (see heroui-theme.ts). Requires the optional
15
+ * `@heroui/react` peer — only this `./widgets` entry pulls it in.
16
+ */
17
+ import { Autocomplete, EmptyState, ListBox, ListBoxItem, SearchField } from "@heroui/react";
18
+ import { cn } from "../cn.js";
19
+ const contains = (textValue, inputValue) => textValue.toLowerCase().includes(inputValue.trim().toLowerCase());
20
+ export function FilterAutocomplete({ items, selectedKey, getKey, getLabel, onSelect, isDisabled, placeholder = "select…", searchPlaceholder = "filter…", emptyLabel = "no match", "aria-label": ariaLabel, className, }) {
21
+ const selected = selectedKey == null ? null : (items.find((it) => getKey(it) === selectedKey) ?? null);
22
+ return (_jsxs(Autocomplete, { "aria-label": ariaLabel, selectedKey: selectedKey, isDisabled: isDisabled, onSelectionChange: (key) => {
23
+ if (key == null)
24
+ return;
25
+ const item = items.find((it) => getKey(it) === String(key));
26
+ if (item)
27
+ onSelect(item);
28
+ }, className: cn("inline-flex", className), children: [_jsxs(Autocomplete.Trigger, { children: [_jsx(Autocomplete.Value, { children: selected ? getLabel(selected) : placeholder }), _jsx(Autocomplete.Indicator, {})] }), _jsx(Autocomplete.Popover, { children: _jsxs(Autocomplete.Filter, { filter: contains, children: [_jsx(SearchField, { autoFocus: true, "aria-label": `filter ${ariaLabel}`, children: _jsxs(SearchField.Group, { children: [_jsx(SearchField.SearchIcon, {}), _jsx(SearchField.Input, { placeholder: searchPlaceholder }), _jsx(SearchField.ClearButton, {})] }) }), _jsx(ListBox, { "aria-label": ariaLabel, items: items, renderEmptyState: () => _jsx(EmptyState, { children: emptyLabel }), children: (item) => (_jsx(ListBoxItem, { id: getKey(item), textValue: getLabel(item), children: getLabel(item) })) })] }) })] }));
29
+ }
30
+ //# sourceMappingURL=filter-autocomplete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-autocomplete.js","sourceRoot":"","sources":["../../src/widgets/filter-autocomplete.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAsB9B,MAAM,QAAQ,GAAG,CAAC,SAAiB,EAAE,UAAkB,EAAW,EAAE,CAClE,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AAEpE,MAAM,UAAU,kBAAkB,CAAmB,EACnD,KAAK,EACL,WAAW,EACX,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,WAAW,GAAG,SAAS,EACvB,iBAAiB,GAAG,SAAS,EAC7B,UAAU,GAAG,UAAU,EACvB,YAAY,EAAE,SAAS,EACvB,SAAS,GACkB;IAC3B,MAAM,QAAQ,GAAG,WAAW,IAAI,IAAI,CA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AAU,GAAc,YACxG,CAAC,IAAO,EAAE,EAAE,CAAC,CACZ,KAAC,WAAW,IAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,YACrD,QAAQ,CAAC,IAAI,CAAC,GACH,CACf,GACO,IACU,GACD,IACV,CAChB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * (7.3 / task 03 — W3a) `@chances-ai/design-system/widgets` — the HeroUI v3
3
+ * "rich widget" tier `[11.2]`. This is the ONLY design-system entry that pulls
4
+ * the optional `@heroui/react` peer, so the main barrel stays HeroUI-free (and
5
+ * `bun --compile` clean for the CLI, which never imports widgets).
6
+ *
7
+ * We re-export the blessed HeroUI compound components through one seam — apps
8
+ * import them from design-system, not `@heroui/react` directly, so the
9
+ * integration point (theme wiring via `.chances-theme`, version pinning) is
10
+ * centralized. Heavy behavior (focus-trap, react-aria keyboard nav, overlay
11
+ * positioning) is HeroUI's; we add only `FilterAutocomplete` (the composed
12
+ * model-picker substrate). Self-built chrome (Surface/Text/Button/…) lives in
13
+ * the main barrel — NOT here — per the two-tier split (design §3.2/§3.3).
14
+ */
15
+ export { Autocomplete, Select, Modal, Drawer, Popover, Menu, Dropdown, Tabs, Tooltip, DatePicker, Calendar, Toast, ToastProvider, toast, ListBox, ListBoxItem, ListBoxSection, SearchField, EmptyState, Label, Separator, Spinner, } from "@heroui/react";
16
+ export { FilterAutocomplete, type FilterAutocompleteProps } from "./filter-autocomplete.js";
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,QAAQ,EACR,KAAK,EACL,aAAa,EACb,KAAK,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,KAAK,EACL,SAAS,EACT,OAAO,GACR,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * (7.3 / task 03 — W3a) `@chances-ai/design-system/widgets` — the HeroUI v3
3
+ * "rich widget" tier `[11.2]`. This is the ONLY design-system entry that pulls
4
+ * the optional `@heroui/react` peer, so the main barrel stays HeroUI-free (and
5
+ * `bun --compile` clean for the CLI, which never imports widgets).
6
+ *
7
+ * We re-export the blessed HeroUI compound components through one seam — apps
8
+ * import them from design-system, not `@heroui/react` directly, so the
9
+ * integration point (theme wiring via `.chances-theme`, version pinning) is
10
+ * centralized. Heavy behavior (focus-trap, react-aria keyboard nav, overlay
11
+ * positioning) is HeroUI's; we add only `FilterAutocomplete` (the composed
12
+ * model-picker substrate). Self-built chrome (Surface/Text/Button/…) lives in
13
+ * the main barrel — NOT here — per the two-tier split (design §3.2/§3.3).
14
+ */
15
+ export { Autocomplete, Select, Modal, Drawer, Popover, Menu, Dropdown, Tabs, Tooltip, DatePicker, Calendar, Toast, ToastProvider, toast, ListBox, ListBoxItem, ListBoxSection, SearchField, EmptyState, Label, Separator, Spinner, } from "@heroui/react";
16
+ export { FilterAutocomplete } from "./filter-autocomplete.js";
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,QAAQ,EACR,KAAK,EACL,aAAa,EACb,KAAK,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,KAAK,EACL,SAAS,EACT,OAAO,GACR,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,kBAAkB,EAAgC,MAAM,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chances-ai/design-system",
3
- "version": "21.0.0",
3
+ "version": "24.2.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -8,21 +8,81 @@
8
8
  ".": {
9
9
  "types": "./dist/index.d.ts",
10
10
  "import": "./dist/index.js"
11
- }
11
+ },
12
+ "./widgets": {
13
+ "types": "./dist/widgets/index.d.ts",
14
+ "import": "./dist/widgets/index.js"
15
+ },
16
+ "./motion": {
17
+ "types": "./dist/motion/animated.d.ts",
18
+ "import": "./dist/motion/animated.js"
19
+ },
20
+ "./styles": "./src/tokens.css",
21
+ "./heroui-theme.css": "./src/heroui-theme.css"
12
22
  },
13
23
  "files": [
14
- "dist"
24
+ "dist",
25
+ "src/tokens.css",
26
+ "src/heroui-theme.css"
15
27
  ],
16
28
  "dependencies": {
17
- "@chances-ai/ui-core": "21.0.0",
18
- "@tamagui/core": "^2.1.0"
29
+ "@chances-ai/ui-core": "24.2.0",
30
+ "clsx": "^2.1.1",
31
+ "lucide-react": "1.17.0",
32
+ "motion": "12.40.0",
33
+ "tailwind-merge": "^3.4.0",
34
+ "tailwind-variants": "^3.2.2"
19
35
  },
20
36
  "peerDependencies": {
21
- "react": "^19.2"
37
+ "@heroui/react": "^3.1.0",
38
+ "react": "^19.2",
39
+ "react-dom": "^19.2",
40
+ "tailwindcss": "^4.0.0"
41
+ },
42
+ "peerDependenciesMeta": {
43
+ "@heroui/react": {
44
+ "optional": true
45
+ },
46
+ "react": {
47
+ "optional": true
48
+ },
49
+ "react-dom": {
50
+ "optional": true
51
+ },
52
+ "tailwindcss": {
53
+ "optional": true
54
+ }
55
+ },
56
+ "devDependencies": {
57
+ "@heroui/react": "^3.1.0",
58
+ "@storybook/addon-a11y": "10.4.1",
59
+ "@storybook/addon-vitest": "10.4.1",
60
+ "@storybook/react-vite": "10.4.1",
61
+ "@tailwindcss/vite": "^4.0.0",
62
+ "@vitejs/plugin-react": "^4.3.4",
63
+ "@vitest/browser": "3.2.6",
64
+ "@vitest/expect": "3.2.6",
65
+ "@vitest/runner": "3.2.6",
66
+ "@vitest/snapshot": "3.2.6",
67
+ "@vitest/spy": "3.2.6",
68
+ "@vitest/utils": "3.2.6",
69
+ "playwright": "^1.60.0",
70
+ "react": "^19.2",
71
+ "react-dom": "^19.2",
72
+ "storybook": "10.4.1",
73
+ "tailwindcss": "^4.0.0",
74
+ "vite": "^6.0.0",
75
+ "vitest": "3.2.6"
22
76
  },
23
77
  "scripts": {
24
78
  "build": "tsc -b",
25
79
  "check": "tsc -b",
26
- "test": "bun test"
80
+ "test": "bun test --timeout 30000",
81
+ "test:stories": "vitest run",
82
+ "test:a11y": "bun run scripts/a11y-stories.ts",
83
+ "storybook": "storybook dev -p 6006 --no-open --disable-telemetry",
84
+ "build:storybook": "storybook build --disable-telemetry",
85
+ "gen:theme": "bun ../../scripts/gen-theme-css.ts",
86
+ "gen:sprite": "bun scripts/gen-sprite.ts"
27
87
  }
28
88
  }
@@ -0,0 +1,42 @@
1
+ /* (7.3 / task 03 — W3a) HeroUI v3 theme bridge — generated-shape, kept in sync
2
+ with `heroui-theme.ts` `HEROUI_BASE_VAR_MAP` (the test enforces parity).
3
+
4
+ UNLAYERED ON PURPOSE: HeroUI declares its variables inside `@layer base`, and
5
+ in the CSS cascade an unlayered rule beats any layered rule regardless of
6
+ source order — so these overrides win without `!important`. We override only
7
+ HeroUI's BASE variables; its "calculated" vars (--surface-hover, --*-soft,
8
+ --border-secondary, …) recompute automatically via `color-mix()` from these.
9
+
10
+ Usage: put `chances-theme` + a mode class (`dark`/`light`) on the panel root,
11
+ and set the `--ch-*` values on that same element (design-system `themeVars` /
12
+ `applyThemeVars`). Then every HeroUI widget rendered inside the panel adopts
13
+ the seed palette. See `heroUiThemeClassName(mode)`. */
14
+ .chances-theme {
15
+ --background: var(--ch-bg-base);
16
+ --foreground: var(--ch-text-base);
17
+ --surface: var(--ch-surface-base);
18
+ --surface-foreground: var(--ch-text-base);
19
+ --surface-secondary: var(--ch-surface-raised);
20
+ --surface-secondary-foreground: var(--ch-text-base);
21
+ --surface-tertiary: var(--ch-bg-weak);
22
+ --surface-tertiary-foreground: var(--ch-text-base);
23
+ --overlay: var(--ch-surface-raised);
24
+ --overlay-foreground: var(--ch-text-base);
25
+ --muted: var(--ch-text-weak);
26
+ --default: var(--ch-bg-weak);
27
+ --default-foreground: var(--ch-text-base);
28
+ --accent: var(--ch-interactive);
29
+ --accent-foreground: var(--ch-text-on-interactive);
30
+ --success: var(--ch-success);
31
+ --success-foreground: var(--ch-text-on-success);
32
+ --warning: var(--ch-warning);
33
+ --warning-foreground: var(--ch-text-on-warning);
34
+ --danger: var(--ch-error);
35
+ --danger-foreground: var(--ch-text-on-error);
36
+ --border: var(--ch-border-base);
37
+ --separator: var(--ch-border-weak);
38
+ --field-background: var(--ch-input-base);
39
+ --field-foreground: var(--ch-text-base);
40
+ --segment: var(--ch-surface-raised);
41
+ --segment-foreground: var(--ch-text-base);
42
+ }