@luxfi/ui 7.4.10 → 7.4.11

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 (78) hide show
  1. package/dist/accordion.cjs +107 -166
  2. package/dist/accordion.d.cts +18 -51
  3. package/dist/accordion.d.ts +18 -51
  4. package/dist/accordion.js +109 -166
  5. package/dist/chrome.cjs +193 -379
  6. package/dist/chrome.js +195 -379
  7. package/dist/collapsible.cjs +35 -26
  8. package/dist/collapsible.d.cts +2 -1
  9. package/dist/collapsible.d.ts +2 -1
  10. package/dist/collapsible.js +34 -24
  11. package/dist/dialog.d.cts +1 -1
  12. package/dist/dialog.d.ts +1 -1
  13. package/dist/drawer.cjs +92 -115
  14. package/dist/drawer.d.cts +43 -10
  15. package/dist/drawer.d.ts +43 -10
  16. package/dist/drawer.js +94 -115
  17. package/dist/field.cjs +60 -109
  18. package/dist/field.d.cts +0 -1
  19. package/dist/field.d.ts +0 -1
  20. package/dist/field.js +61 -109
  21. package/dist/heading.cjs +10 -17
  22. package/dist/heading.d.cts +0 -2
  23. package/dist/heading.d.ts +0 -2
  24. package/dist/heading.js +10 -17
  25. package/dist/icon-button.cjs +82 -82
  26. package/dist/icon-button.d.cts +16 -12
  27. package/dist/icon-button.d.ts +16 -12
  28. package/dist/icon-button.js +82 -82
  29. package/dist/index.cjs +1073 -1419
  30. package/dist/index.d.cts +1 -5
  31. package/dist/index.d.ts +1 -5
  32. package/dist/index.js +1075 -1414
  33. package/dist/input-group.cjs +11 -12
  34. package/dist/input-group.js +11 -12
  35. package/dist/input.cjs +27 -27
  36. package/dist/input.d.cts +21 -1
  37. package/dist/input.d.ts +21 -1
  38. package/dist/input.js +25 -28
  39. package/dist/menu.cjs +160 -271
  40. package/dist/menu.d.cts +41 -57
  41. package/dist/menu.d.ts +41 -57
  42. package/dist/menu.js +161 -251
  43. package/dist/popover.cjs +1 -1
  44. package/dist/popover.js +1 -1
  45. package/dist/select.cjs +40 -39
  46. package/dist/select.d.cts +35 -4
  47. package/dist/select.d.ts +35 -4
  48. package/dist/select.js +40 -38
  49. package/dist/separator.cjs +8 -33
  50. package/dist/separator.js +8 -33
  51. package/dist/tabs.cjs +108 -197
  52. package/dist/tabs.d.cts +16 -60
  53. package/dist/tabs.d.ts +16 -60
  54. package/dist/tabs.js +109 -196
  55. package/dist/textarea.cjs +56 -27
  56. package/dist/textarea.js +57 -28
  57. package/dist/toaster.cjs +97 -79
  58. package/dist/toaster.d.cts +7 -8
  59. package/dist/toaster.d.ts +7 -8
  60. package/dist/toaster.js +78 -80
  61. package/package.json +2 -16
  62. package/src/accordion.tsx +173 -227
  63. package/src/collapsible.tsx +55 -52
  64. package/src/drawer.tsx +123 -115
  65. package/src/field.tsx +68 -124
  66. package/src/heading.tsx +22 -26
  67. package/src/icon-button.tsx +134 -141
  68. package/src/ink.tsx +37 -0
  69. package/src/input-group.tsx +21 -12
  70. package/src/input.tsx +41 -32
  71. package/src/menu.tsx +224 -397
  72. package/src/popover.tsx +1 -1
  73. package/src/select.tsx +80 -59
  74. package/src/separator.tsx +13 -34
  75. package/src/tabs.tsx +166 -296
  76. package/src/textarea.tsx +19 -29
  77. package/src/toaster.tsx +118 -86
  78. package/tokens.css +61 -0
@@ -1,10 +1,8 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var AccordionPrimitive = require('@radix-ui/react-accordion');
4
+ var gui = require('@hanzo/gui');
5
5
  var React = require('react');
6
- var clsx = require('clsx');
7
- var tailwindMerge = require('tailwind-merge');
8
6
  var jsxRuntime = require('react/jsx-runtime');
9
7
 
10
8
  function _interopNamespace(e) {
@@ -25,185 +23,128 @@ function _interopNamespace(e) {
25
23
  return Object.freeze(n);
26
24
  }
27
25
 
28
- var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
29
26
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
30
27
 
31
28
  // src/accordion.tsx
32
- function cn(...inputs) {
33
- return tailwindMerge.twMerge(clsx.clsx(inputs));
34
- }
35
- var IndicatorIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
36
- var AccordionRoot = React__namespace.forwardRef(
37
- function AccordionRoot2(props, ref) {
38
- const {
39
- multiple: _multiple,
40
- value,
41
- defaultValue,
42
- onValueChange,
43
- variant,
44
- size,
45
- noAnimation: _noAnimation,
46
- lazyMount: _lazyMount,
47
- className,
48
- children,
49
- position: _position,
50
- w: _w,
51
- bgColor: _bgColor,
52
- borderRadius: _borderRadius,
53
- ...rest
54
- } = props;
55
- const handleValueChange = React__namespace.useCallback(
56
- (next) => {
57
- onValueChange?.({ value: next });
58
- },
59
- [onValueChange]
60
- );
61
- return /* @__PURE__ */ jsxRuntime.jsx(
62
- AccordionPrimitive__namespace.Root,
63
- {
64
- ref,
65
- type: "multiple",
66
- value,
67
- defaultValue,
68
- onValueChange: handleValueChange,
69
- className: cn(
70
- "w-full",
71
- variant === "faq" && "accordion-faq",
72
- size === "sm" && "accordion-sm",
73
- className
74
- ),
75
- "data-variant": variant,
76
- "data-size": size,
77
- ...rest,
78
- children
79
- }
80
- );
29
+ var ink = (children, Wrap = gui.Text, props = {}) => {
30
+ let hasText = false;
31
+ React.Children.forEach(children, (child) => {
32
+ if (typeof child === "string" || typeof child === "number") hasText = true;
33
+ });
34
+ if (!hasText) return children;
35
+ return React.Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? React.createElement(Wrap, props, child) : child);
36
+ };
37
+ var IndicatorIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
38
+ var BAR = "var(--color-text-primary)";
39
+ var Indicator = ({ open, variant }) => variant === "faq" ? /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { width: 12, height: 12, flexShrink: 0, alignItems: "center", justifyContent: "center", position: "relative", children: [
40
+ /* @__PURE__ */ jsxRuntime.jsx(gui.View, { position: "absolute", width: "100%", height: 2, borderRadius: 2, backgroundColor: BAR }),
41
+ /* @__PURE__ */ jsxRuntime.jsx(
42
+ gui.View,
43
+ {
44
+ position: "absolute",
45
+ width: 2,
46
+ height: "100%",
47
+ borderRadius: 2,
48
+ backgroundColor: BAR,
49
+ rotate: open ? "90deg" : "0deg"
50
+ }
51
+ )
52
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { flexShrink: 0, alignItems: "center", rotate: open ? "270deg" : "180deg", children: /* @__PURE__ */ jsxRuntime.jsx(IndicatorIcon, {}) });
53
+ var Variant = React__namespace.createContext(void 0);
54
+ var AccordionRoot = ({
55
+ value,
56
+ defaultValue,
57
+ onValueChange,
58
+ variant,
59
+ size,
60
+ children,
61
+ ...rest
62
+ }) => /* @__PURE__ */ jsxRuntime.jsx(Variant.Provider, { value: variant, children: /* @__PURE__ */ jsxRuntime.jsx(
63
+ gui.Accordion,
64
+ {
65
+ unstyled: true,
66
+ type: "multiple",
67
+ width: "100%",
68
+ value,
69
+ defaultValue,
70
+ onValueChange: onValueChange ? (next) => onValueChange({ value: next }) : void 0,
71
+ "data-variant": variant,
72
+ "data-size": size,
73
+ ...rest,
74
+ children
81
75
  }
82
- );
83
- var AccordionItem = React__namespace.forwardRef(
84
- function AccordionItem2(props, ref) {
85
- const { className, as: _as, _first, _last, display: _display, ...rest } = props;
86
- return /* @__PURE__ */ jsxRuntime.jsx(
87
- AccordionPrimitive__namespace.Item,
88
- {
89
- ref,
90
- className: cn(
91
- "border-b border-[var(--color-border-divider)]",
92
- className
93
- ),
94
- ...rest
95
- }
96
- );
76
+ ) });
77
+ var AccordionItem = (props) => /* @__PURE__ */ jsxRuntime.jsx(
78
+ gui.Accordion.Item,
79
+ {
80
+ unstyled: true,
81
+ borderBottomWidth: 1,
82
+ borderColor: "var(--color-border-divider)",
83
+ ...props
97
84
  }
98
85
  );
99
- var AccordionItemTrigger = React__namespace.forwardRef(function AccordionItemTrigger2(props, ref) {
100
- const {
101
- children,
102
- indicatorPlacement: indicatorPlacementProp,
103
- variant,
104
- noIndicator,
105
- className,
106
- // Strip Chakra style props
107
- px: _px,
108
- py: _py,
109
- _hover,
110
- wordBreak: _wordBreak,
111
- textAlign: _textAlign,
112
- cursor: _cursor,
113
- display: _display,
114
- alignItems: _alignItems,
115
- columnGap: _columnGap,
116
- ...rest
117
- } = props;
118
- const indicatorPlacement = variant === "faq" ? "start" : indicatorPlacementProp ?? "end";
119
- const indicator = variant === "faq" ? /* @__PURE__ */ jsxRuntime.jsx(
120
- "span",
121
- {
122
- className: cn(
123
- "relative inline-block h-3 w-3 shrink-0",
124
- // horizontal bar (always visible)
125
- "before:absolute before:left-0 before:top-1/2 before:block before:h-[2px] before:w-full before:-translate-y-1/2 before:rounded-[2px] before:bg-current",
126
- // vertical bar (rotates to 0 when open)
127
- "after:absolute after:left-1/2 after:top-0 after:block after:h-full after:w-[2px]",
128
- "after:-translate-x-1/2 after:rounded-[2px] after:bg-current",
129
- "after:transition-transform after:duration-200 after:ease-in-out",
130
- // When parent trigger has data-state="open", rotate vertical bar
131
- "group-data-[state=open]/trigger:after:rotate-90"
132
- )
133
- }
134
- ) : /* @__PURE__ */ jsxRuntime.jsx(
135
- "span",
136
- {
137
- className: cn(
138
- "inline-flex shrink-0 transition-transform duration-200",
139
- "rotate-180",
140
- "group-data-[state=open]/trigger:rotate-[270deg]"
141
- ),
142
- children: /* @__PURE__ */ jsxRuntime.jsx(IndicatorIcon, { className: "h-5 w-5" })
143
- }
144
- );
145
- return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(
146
- AccordionPrimitive__namespace.Trigger,
86
+ var AccordionItemTrigger = ({
87
+ children,
88
+ indicatorPlacement: placementProp,
89
+ variant: variantProp,
90
+ noIndicator,
91
+ headingLevel = 3,
92
+ ...rest
93
+ }) => {
94
+ const variant = variantProp ?? React__namespace.useContext(Variant);
95
+ const placement = variant === "faq" ? "start" : placementProp ?? "end";
96
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Accordion.Header, { unstyled: true, render: `h${headingLevel}`, "aria-level": headingLevel, display: "flex", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
97
+ gui.Accordion.Trigger,
147
98
  {
148
- ref,
149
- className: cn(
150
- "group/trigger flex w-full cursor-pointer items-center gap-2 py-3 text-left text-[var(--color-text-primary)]",
151
- "hover:text-[var(--color-hover)]",
152
- "focus-visible:outline-none",
153
- className
154
- ),
99
+ unstyled: true,
100
+ type: "button",
101
+ width: "100%",
102
+ flexDirection: "row",
103
+ alignItems: "center",
104
+ gap: 8,
105
+ paddingVertical: 12,
106
+ paddingHorizontal: 0,
107
+ borderWidth: 0,
108
+ backgroundColor: "transparent",
109
+ cursor: "pointer",
110
+ className: "lux-accordion-trigger",
155
111
  ...rest,
156
- children: [
157
- indicatorPlacement === "start" && !noIndicator && indicator,
158
- children,
159
- indicatorPlacement === "end" && !noIndicator && indicator
160
- ]
112
+ children: (({ open }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
113
+ placement === "start" && !noIndicator && /* @__PURE__ */ jsxRuntime.jsx(Indicator, { open, variant }),
114
+ ink(children, void 0, { color: "inherit", textAlign: "left" }),
115
+ placement === "end" && !noIndicator && /* @__PURE__ */ jsxRuntime.jsx(Indicator, { open, variant })
116
+ ] }))
161
117
  }
162
- ) }) });
163
- });
164
- var AccordionItemContent = React__namespace.forwardRef(function AccordionItemContent2(props, ref) {
165
- const { className, children, pb: _pb, pr: _pr, pl: _pl, w: _w, display: _display, flexDir: _flexDir, rowGap: _rowGap, ...rest } = props;
166
- return /* @__PURE__ */ jsxRuntime.jsx(
167
- AccordionPrimitive__namespace.Content,
168
- {
169
- ref,
170
- className: cn(
171
- "overflow-hidden text-[var(--color-text-primary)]",
172
- "data-[state=open]:animate-accordion-down",
173
- "data-[state=closed]:animate-accordion-up",
174
- className
175
- ),
176
- ...rest,
177
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-3", children })
178
- }
179
- );
180
- });
118
+ ) });
119
+ };
120
+ var AccordionItemContent = ({ children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
121
+ gui.Accordion.Content,
122
+ {
123
+ unstyled: true,
124
+ overflow: "hidden",
125
+ paddingBottom: 12,
126
+ backgroundColor: "transparent",
127
+ ...rest,
128
+ children: ink(children, void 0, { color: "var(--color-text-primary)" })
129
+ }
130
+ );
181
131
  function useAccordion(items) {
182
132
  const [value, setValue] = React__namespace.useState([]);
183
- const onValueChange = React__namespace.useCallback(({ value: value2 }) => {
184
- setValue(value2);
133
+ const onValueChange = React__namespace.useCallback(({ value: next }) => {
134
+ setValue(next);
185
135
  }, []);
186
136
  const scrollToItemFromUrl = React__namespace.useCallback(() => {
187
137
  const hash = window.location.hash.replace("#", "");
188
- if (!hash) {
189
- return;
190
- }
138
+ if (!hash) return;
191
139
  const itemToScroll = items.find((item) => item.id === hash);
192
- if (itemToScroll) {
193
- const el = document.getElementById(itemToScroll.id);
194
- if (el) {
195
- el.scrollIntoView({ behavior: "smooth", block: "start" });
196
- }
197
- setValue([itemToScroll.id]);
198
- }
140
+ if (!itemToScroll) return;
141
+ document.getElementById(itemToScroll.id)?.scrollIntoView({ behavior: "smooth", block: "start" });
142
+ setValue([itemToScroll.id]);
199
143
  }, [items]);
200
- return React__namespace.useMemo(() => {
201
- return {
202
- value,
203
- onValueChange,
204
- scrollToItemFromUrl
205
- };
206
- }, [value, onValueChange, scrollToItemFromUrl]);
144
+ return React__namespace.useMemo(
145
+ () => ({ value, onValueChange, scrollToItemFromUrl }),
146
+ [value, onValueChange, scrollToItemFromUrl]
147
+ );
207
148
  }
208
149
 
209
150
  exports.AccordionItem = AccordionItem;
@@ -1,74 +1,41 @@
1
- import * as AccordionPrimitive from '@radix-ui/react-accordion';
1
+ import { Accordion } from '@hanzo/gui';
2
2
  import * as React from 'react';
3
3
 
4
- interface AccordionRootProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'dir'> {
5
- /** Open multiple items simultaneously. Defaults to true. */
6
- readonly multiple?: boolean;
7
- /** Controlled open items (array of `value` strings). */
4
+ interface AccordionRootProps extends Omit<React.ComponentProps<typeof Accordion>, 'type' | 'value' | 'defaultValue' | 'onValueChange' | 'size'> {
5
+ /** Controlled open items. */
8
6
  readonly value?: Array<string>;
9
7
  /** Uncontrolled initial open items. */
10
8
  readonly defaultValue?: Array<string>;
11
- /**
12
- * Called when open items change.
13
- * Wraps the value in `{ value }` to stay compatible with the Chakra callback shape
14
- * that consumers already rely on.
15
- */
9
+ /** Fires with the full set of open items. */
16
10
  readonly onValueChange?: (details: {
17
11
  value: Array<string>;
18
12
  }) => void;
19
13
  readonly variant?: 'outline' | 'faq';
20
14
  readonly size?: 'sm' | 'md';
21
- /** Accepted for compatibility; not applied visually. */
22
- readonly noAnimation?: boolean;
23
- /** Accepted for compatibility; Radix defers rendering internally. */
24
- readonly lazyMount?: boolean;
25
- readonly children?: React.ReactNode;
26
- readonly position?: string;
27
- readonly w?: string;
28
- readonly bgColor?: string | Record<string, string>;
29
- readonly borderRadius?: string;
30
15
  }
31
- declare const AccordionRoot: React.ForwardRefExoticComponent<AccordionRootProps & React.RefAttributes<HTMLDivElement>>;
32
- interface AccordionItemProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {
33
- as?: string;
34
- _first?: Record<string, unknown>;
35
- _last?: Record<string, unknown>;
36
- display?: string;
37
- }
38
- declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
39
- interface AccordionItemTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>, 'dir'> {
16
+ declare const AccordionRoot: ({ value, defaultValue, onValueChange, variant, size, children, ...rest }: AccordionRootProps) => React.ReactElement;
17
+ type AccordionItemProps = React.ComponentProps<typeof Accordion.Item>;
18
+ declare const AccordionItem: (props: AccordionItemProps) => React.ReactElement;
19
+ type AccordionItemTriggerProps = React.ComponentProps<typeof Accordion.Trigger> & {
40
20
  readonly indicatorPlacement?: 'start' | 'end';
41
21
  readonly noIndicator?: boolean;
42
22
  readonly variant?: 'outline' | 'faq';
43
- px?: number | string;
44
- py?: number | string;
45
- _hover?: Record<string, string>;
46
- wordBreak?: string;
47
- textAlign?: string;
48
- cursor?: string;
49
- display?: string;
50
- alignItems?: string;
51
- columnGap?: number | string;
52
- }
53
- declare const AccordionItemTrigger: React.ForwardRefExoticComponent<AccordionItemTriggerProps & React.RefAttributes<HTMLButtonElement>>;
54
- interface AccordionItemContentProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> {
55
- pb?: number | string;
56
- pr?: number | string;
57
- pl?: string;
58
- w?: string;
59
- display?: string;
60
- flexDir?: string;
61
- rowGap?: number | string;
62
- }
63
- declare const AccordionItemContent: React.ForwardRefExoticComponent<AccordionItemContentProps & React.RefAttributes<HTMLDivElement>>;
23
+ readonly headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
24
+ /** The DOM button type — see (3) above. Defaults to `button`, not submit. */
25
+ readonly type?: 'button' | 'submit' | 'reset';
26
+ };
27
+ declare const AccordionItemTrigger: ({ children, indicatorPlacement: placementProp, variant: variantProp, noIndicator, headingLevel, ...rest }: AccordionItemTriggerProps) => React.ReactElement;
28
+ type AccordionItemContentProps = React.ComponentProps<typeof Accordion.Content>;
29
+ declare const AccordionItemContent: ({ children, ...rest }: AccordionItemContentProps) => React.ReactElement;
30
+ /** Open state for an accordion whose items are addressable by URL fragment. */
64
31
  declare function useAccordion(items: Array<{
65
32
  id: string;
66
33
  }>): {
67
34
  value: string[];
68
- onValueChange: ({ value }: {
35
+ onValueChange: ({ value: next }: {
69
36
  value: Array<string>;
70
37
  }) => void;
71
38
  scrollToItemFromUrl: () => void;
72
39
  };
73
40
 
74
- export { AccordionItem, AccordionItemContent, type AccordionItemContentProps, AccordionItemTrigger, AccordionRoot, useAccordion };
41
+ export { AccordionItem, AccordionItemContent, type AccordionItemContentProps, type AccordionItemProps, AccordionItemTrigger, type AccordionItemTriggerProps, AccordionRoot, type AccordionRootProps, useAccordion };
@@ -1,74 +1,41 @@
1
- import * as AccordionPrimitive from '@radix-ui/react-accordion';
1
+ import { Accordion } from '@hanzo/gui';
2
2
  import * as React from 'react';
3
3
 
4
- interface AccordionRootProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'dir'> {
5
- /** Open multiple items simultaneously. Defaults to true. */
6
- readonly multiple?: boolean;
7
- /** Controlled open items (array of `value` strings). */
4
+ interface AccordionRootProps extends Omit<React.ComponentProps<typeof Accordion>, 'type' | 'value' | 'defaultValue' | 'onValueChange' | 'size'> {
5
+ /** Controlled open items. */
8
6
  readonly value?: Array<string>;
9
7
  /** Uncontrolled initial open items. */
10
8
  readonly defaultValue?: Array<string>;
11
- /**
12
- * Called when open items change.
13
- * Wraps the value in `{ value }` to stay compatible with the Chakra callback shape
14
- * that consumers already rely on.
15
- */
9
+ /** Fires with the full set of open items. */
16
10
  readonly onValueChange?: (details: {
17
11
  value: Array<string>;
18
12
  }) => void;
19
13
  readonly variant?: 'outline' | 'faq';
20
14
  readonly size?: 'sm' | 'md';
21
- /** Accepted for compatibility; not applied visually. */
22
- readonly noAnimation?: boolean;
23
- /** Accepted for compatibility; Radix defers rendering internally. */
24
- readonly lazyMount?: boolean;
25
- readonly children?: React.ReactNode;
26
- readonly position?: string;
27
- readonly w?: string;
28
- readonly bgColor?: string | Record<string, string>;
29
- readonly borderRadius?: string;
30
15
  }
31
- declare const AccordionRoot: React.ForwardRefExoticComponent<AccordionRootProps & React.RefAttributes<HTMLDivElement>>;
32
- interface AccordionItemProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {
33
- as?: string;
34
- _first?: Record<string, unknown>;
35
- _last?: Record<string, unknown>;
36
- display?: string;
37
- }
38
- declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
39
- interface AccordionItemTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>, 'dir'> {
16
+ declare const AccordionRoot: ({ value, defaultValue, onValueChange, variant, size, children, ...rest }: AccordionRootProps) => React.ReactElement;
17
+ type AccordionItemProps = React.ComponentProps<typeof Accordion.Item>;
18
+ declare const AccordionItem: (props: AccordionItemProps) => React.ReactElement;
19
+ type AccordionItemTriggerProps = React.ComponentProps<typeof Accordion.Trigger> & {
40
20
  readonly indicatorPlacement?: 'start' | 'end';
41
21
  readonly noIndicator?: boolean;
42
22
  readonly variant?: 'outline' | 'faq';
43
- px?: number | string;
44
- py?: number | string;
45
- _hover?: Record<string, string>;
46
- wordBreak?: string;
47
- textAlign?: string;
48
- cursor?: string;
49
- display?: string;
50
- alignItems?: string;
51
- columnGap?: number | string;
52
- }
53
- declare const AccordionItemTrigger: React.ForwardRefExoticComponent<AccordionItemTriggerProps & React.RefAttributes<HTMLButtonElement>>;
54
- interface AccordionItemContentProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> {
55
- pb?: number | string;
56
- pr?: number | string;
57
- pl?: string;
58
- w?: string;
59
- display?: string;
60
- flexDir?: string;
61
- rowGap?: number | string;
62
- }
63
- declare const AccordionItemContent: React.ForwardRefExoticComponent<AccordionItemContentProps & React.RefAttributes<HTMLDivElement>>;
23
+ readonly headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
24
+ /** The DOM button type — see (3) above. Defaults to `button`, not submit. */
25
+ readonly type?: 'button' | 'submit' | 'reset';
26
+ };
27
+ declare const AccordionItemTrigger: ({ children, indicatorPlacement: placementProp, variant: variantProp, noIndicator, headingLevel, ...rest }: AccordionItemTriggerProps) => React.ReactElement;
28
+ type AccordionItemContentProps = React.ComponentProps<typeof Accordion.Content>;
29
+ declare const AccordionItemContent: ({ children, ...rest }: AccordionItemContentProps) => React.ReactElement;
30
+ /** Open state for an accordion whose items are addressable by URL fragment. */
64
31
  declare function useAccordion(items: Array<{
65
32
  id: string;
66
33
  }>): {
67
34
  value: string[];
68
- onValueChange: ({ value }: {
35
+ onValueChange: ({ value: next }: {
69
36
  value: Array<string>;
70
37
  }) => void;
71
38
  scrollToItemFromUrl: () => void;
72
39
  };
73
40
 
74
- export { AccordionItem, AccordionItemContent, type AccordionItemContentProps, AccordionItemTrigger, AccordionRoot, useAccordion };
41
+ export { AccordionItem, AccordionItemContent, type AccordionItemContentProps, type AccordionItemProps, AccordionItemTrigger, type AccordionItemTriggerProps, AccordionRoot, type AccordionRootProps, useAccordion };