canny-ui-react 4.0.0 → 6.0.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 (61) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +20 -1
  2. package/dist/components/Alert/Alert.types.d.ts +7 -0
  3. package/dist/components/Autocomplete/Autocomplete.types.d.ts +11 -1
  4. package/dist/components/Avatar/Avatar.types.d.ts +7 -0
  5. package/dist/components/Badge/Badge.d.ts +7 -0
  6. package/dist/components/Breadcrumb/Breadcrumb.d.ts +7 -0
  7. package/dist/components/Button/Button.types.d.ts +7 -0
  8. package/dist/components/Button/ToggleButton.d.ts +7 -4
  9. package/dist/components/Card/Card.types.d.ts +7 -0
  10. package/dist/components/Charts/BarChart.d.ts +11 -1
  11. package/dist/components/Charts/LineChart.d.ts +10 -0
  12. package/dist/components/Charts/PieChart.d.ts +11 -1
  13. package/dist/components/Charts/ResponsiveContainer.d.ts +11 -2
  14. package/dist/components/Checkbox/Checkbox.d.ts +8 -0
  15. package/dist/components/Chip/Chip.d.ts +7 -0
  16. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +12 -2
  17. package/dist/components/DataTable/DataTable.d.ts +11 -1
  18. package/dist/components/DatePicker/DatePicker.types.d.ts +8 -0
  19. package/dist/components/Dialog/Dialog.d.ts +20 -2
  20. package/dist/components/Drawer/Drawer.d.ts +20 -2
  21. package/dist/components/Field/Field.d.ts +9 -1
  22. package/dist/components/FileUploader/FileUploader.d.ts +10 -1
  23. package/dist/components/FileUploader/useFileDrop.d.ts +29 -29
  24. package/dist/components/Input/Input.types.d.ts +8 -0
  25. package/dist/components/Layout/AspectRatio.d.ts +3 -0
  26. package/dist/components/Layout/Box.d.ts +1 -0
  27. package/dist/components/Layout/Divider.d.ts +3 -0
  28. package/dist/components/Layout/Grid.d.ts +18 -2
  29. package/dist/components/Layout/Spacer.d.ts +5 -1
  30. package/dist/components/Layout/index.d.ts +2 -0
  31. package/dist/components/Layout/layout.types.d.ts +10 -0
  32. package/dist/components/Layout/sx.d.ts +31 -0
  33. package/dist/components/List/List.d.ts +7 -0
  34. package/dist/components/Menu/Menu.d.ts +49 -6
  35. package/dist/components/MultiSelect/MultiSelect.d.ts +12 -2
  36. package/dist/components/Navbar/Navbar.types.d.ts +7 -0
  37. package/dist/components/Pagination/Pagination.d.ts +9 -0
  38. package/dist/components/PanelGroup/PanelGroup.d.ts +7 -0
  39. package/dist/components/Popover/Popover.d.ts +16 -1
  40. package/dist/components/Progress/Progress.types.d.ts +13 -0
  41. package/dist/components/Radio/Radio.d.ts +8 -0
  42. package/dist/components/Scroll/Scroll.types.d.ts +7 -0
  43. package/dist/components/Select/Select.d.ts +21 -5
  44. package/dist/components/Sidebar/Sidebar.types.d.ts +7 -0
  45. package/dist/components/Skeleton/Skeleton.types.d.ts +7 -0
  46. package/dist/components/Slider/Slider.d.ts +32 -2
  47. package/dist/components/Stepper/Stepper.d.ts +7 -0
  48. package/dist/components/Switch/Switch.d.ts +8 -0
  49. package/dist/components/Tabs/Tabs.d.ts +28 -5
  50. package/dist/components/Text/Text.d.ts +7 -0
  51. package/dist/components/Textarea/Textarea.d.ts +7 -0
  52. package/dist/components/Timeline/Timeline.d.ts +7 -0
  53. package/dist/components/Toast/Toast.types.d.ts +8 -0
  54. package/dist/components/Tooltip/Tooltip.d.ts +10 -0
  55. package/dist/components/TreeView/TreeView.d.ts +8 -0
  56. package/dist/index.cjs +45 -45
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.js +7427 -6914
  59. package/dist/index.js.map +1 -1
  60. package/dist/utils/withSx.d.ts +22 -0
  61. package/package.json +3 -3
@@ -45,17 +45,17 @@ export declare function useFileDrop(options?: UseFileDropOptions): {
45
45
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
46
46
  autoFocus?: boolean | undefined;
47
47
  className?: string | undefined;
48
- contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
48
+ contentEditable?: (boolean | "false" | "true") | "inherit" | "plaintext-only" | undefined;
49
49
  contextMenu?: string | undefined;
50
50
  dir?: string | undefined;
51
- draggable?: (boolean | "true" | "false") | undefined;
51
+ draggable?: (boolean | "false" | "true") | undefined;
52
52
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
53
53
  hidden?: boolean | undefined;
54
54
  id?: string | undefined;
55
55
  lang?: string | undefined;
56
56
  nonce?: string | undefined;
57
57
  slot?: string | undefined;
58
- spellCheck?: (boolean | "true" | "false") | undefined;
58
+ spellCheck?: (boolean | "false" | "true") | undefined;
59
59
  style?: import("react").CSSProperties | undefined;
60
60
  title?: string | undefined;
61
61
  translate?: "yes" | "no" | undefined;
@@ -91,11 +91,11 @@ export declare function useFileDrop(options?: UseFileDropOptions): {
91
91
  exportparts?: string | undefined;
92
92
  part?: string | undefined;
93
93
  "aria-activedescendant"?: string | undefined;
94
- "aria-atomic"?: (boolean | "true" | "false") | undefined;
94
+ "aria-atomic"?: (boolean | "false" | "true") | undefined;
95
95
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
96
96
  "aria-braillelabel"?: string | undefined;
97
97
  "aria-brailleroledescription"?: string | undefined;
98
- "aria-busy"?: (boolean | "true" | "false") | undefined;
98
+ "aria-busy"?: (boolean | "false" | "true") | undefined;
99
99
  "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
100
100
  "aria-colcount"?: number | undefined;
101
101
  "aria-colindex"?: number | undefined;
@@ -108,34 +108,34 @@ export declare function useFileDrop(options?: UseFileDropOptions): {
108
108
  "aria-details"?: string | undefined;
109
109
  "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
110
110
  "aria-errormessage"?: string | undefined;
111
- "aria-expanded"?: (boolean | "true" | "false") | undefined;
111
+ "aria-expanded"?: (boolean | "false" | "true") | undefined;
112
112
  "aria-flowto"?: string | undefined;
113
- "aria-grabbed"?: (boolean | "true" | "false") | undefined;
113
+ "aria-grabbed"?: (boolean | "false" | "true") | undefined;
114
114
  "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
115
- "aria-hidden"?: (boolean | "true" | "false") | undefined;
115
+ "aria-hidden"?: (boolean | "false" | "true") | undefined;
116
116
  "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
117
117
  "aria-keyshortcuts"?: string | undefined;
118
118
  "aria-label"?: string | undefined;
119
119
  "aria-labelledby"?: string | undefined;
120
120
  "aria-level"?: number | undefined;
121
121
  "aria-live"?: "off" | "assertive" | "polite" | undefined;
122
- "aria-modal"?: (boolean | "true" | "false") | undefined;
123
- "aria-multiline"?: (boolean | "true" | "false") | undefined;
124
- "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
122
+ "aria-modal"?: (boolean | "false" | "true") | undefined;
123
+ "aria-multiline"?: (boolean | "false" | "true") | undefined;
124
+ "aria-multiselectable"?: (boolean | "false" | "true") | undefined;
125
125
  "aria-orientation"?: "horizontal" | "vertical" | undefined;
126
126
  "aria-owns"?: string | undefined;
127
127
  "aria-placeholder"?: string | undefined;
128
128
  "aria-posinset"?: number | undefined;
129
129
  "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
130
- "aria-readonly"?: (boolean | "true" | "false") | undefined;
130
+ "aria-readonly"?: (boolean | "false" | "true") | undefined;
131
131
  "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
132
- "aria-required"?: (boolean | "true" | "false") | undefined;
132
+ "aria-required"?: (boolean | "false" | "true") | undefined;
133
133
  "aria-roledescription"?: string | undefined;
134
134
  "aria-rowcount"?: number | undefined;
135
135
  "aria-rowindex"?: number | undefined;
136
136
  "aria-rowindextext"?: string | undefined;
137
137
  "aria-rowspan"?: number | undefined;
138
- "aria-selected"?: (boolean | "true" | "false") | undefined;
138
+ "aria-selected"?: (boolean | "false" | "true") | undefined;
139
139
  "aria-setsize"?: number | undefined;
140
140
  "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
141
141
  "aria-valuemax"?: number | undefined;
@@ -353,17 +353,17 @@ export declare function useFileDrop(options?: UseFileDropOptions): {
353
353
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
354
354
  autoFocus?: boolean | undefined;
355
355
  className?: string | undefined;
356
- contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
356
+ contentEditable?: (boolean | "false" | "true") | "inherit" | "plaintext-only" | undefined;
357
357
  contextMenu?: string | undefined;
358
358
  dir?: string | undefined;
359
- draggable?: (boolean | "true" | "false") | undefined;
359
+ draggable?: (boolean | "false" | "true") | undefined;
360
360
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
361
361
  hidden?: boolean | undefined;
362
362
  id?: string | undefined;
363
363
  lang?: string | undefined;
364
364
  nonce?: string | undefined;
365
365
  slot?: string | undefined;
366
- spellCheck?: (boolean | "true" | "false") | undefined;
366
+ spellCheck?: (boolean | "false" | "true") | undefined;
367
367
  tabIndex?: number | undefined;
368
368
  title?: string | undefined;
369
369
  translate?: "yes" | "no" | undefined;
@@ -400,11 +400,11 @@ export declare function useFileDrop(options?: UseFileDropOptions): {
400
400
  exportparts?: string | undefined;
401
401
  part?: string | undefined;
402
402
  "aria-activedescendant"?: string | undefined;
403
- "aria-atomic"?: (boolean | "true" | "false") | undefined;
403
+ "aria-atomic"?: (boolean | "false" | "true") | undefined;
404
404
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
405
405
  "aria-braillelabel"?: string | undefined;
406
406
  "aria-brailleroledescription"?: string | undefined;
407
- "aria-busy"?: (boolean | "true" | "false") | undefined;
407
+ "aria-busy"?: (boolean | "false" | "true") | undefined;
408
408
  "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
409
409
  "aria-colcount"?: number | undefined;
410
410
  "aria-colindex"?: number | undefined;
@@ -415,37 +415,37 @@ export declare function useFileDrop(options?: UseFileDropOptions): {
415
415
  "aria-describedby"?: string | undefined;
416
416
  "aria-description"?: string | undefined;
417
417
  "aria-details"?: string | undefined;
418
- "aria-disabled"?: (boolean | "true" | "false") | undefined;
418
+ "aria-disabled"?: (boolean | "false" | "true") | undefined;
419
419
  "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
420
420
  "aria-errormessage"?: string | undefined;
421
- "aria-expanded"?: (boolean | "true" | "false") | undefined;
421
+ "aria-expanded"?: (boolean | "false" | "true") | undefined;
422
422
  "aria-flowto"?: string | undefined;
423
- "aria-grabbed"?: (boolean | "true" | "false") | undefined;
423
+ "aria-grabbed"?: (boolean | "false" | "true") | undefined;
424
424
  "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
425
- "aria-hidden"?: (boolean | "true" | "false") | undefined;
425
+ "aria-hidden"?: (boolean | "false" | "true") | undefined;
426
426
  "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
427
427
  "aria-keyshortcuts"?: string | undefined;
428
428
  "aria-label"?: string | undefined;
429
429
  "aria-labelledby"?: string | undefined;
430
430
  "aria-level"?: number | undefined;
431
431
  "aria-live"?: "off" | "assertive" | "polite" | undefined;
432
- "aria-modal"?: (boolean | "true" | "false") | undefined;
433
- "aria-multiline"?: (boolean | "true" | "false") | undefined;
434
- "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
432
+ "aria-modal"?: (boolean | "false" | "true") | undefined;
433
+ "aria-multiline"?: (boolean | "false" | "true") | undefined;
434
+ "aria-multiselectable"?: (boolean | "false" | "true") | undefined;
435
435
  "aria-orientation"?: "horizontal" | "vertical" | undefined;
436
436
  "aria-owns"?: string | undefined;
437
437
  "aria-placeholder"?: string | undefined;
438
438
  "aria-posinset"?: number | undefined;
439
439
  "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
440
- "aria-readonly"?: (boolean | "true" | "false") | undefined;
440
+ "aria-readonly"?: (boolean | "false" | "true") | undefined;
441
441
  "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
442
- "aria-required"?: (boolean | "true" | "false") | undefined;
442
+ "aria-required"?: (boolean | "false" | "true") | undefined;
443
443
  "aria-roledescription"?: string | undefined;
444
444
  "aria-rowcount"?: number | undefined;
445
445
  "aria-rowindex"?: number | undefined;
446
446
  "aria-rowindextext"?: string | undefined;
447
447
  "aria-rowspan"?: number | undefined;
448
- "aria-selected"?: (boolean | "true" | "false") | undefined;
448
+ "aria-selected"?: (boolean | "false" | "true") | undefined;
449
449
  "aria-setsize"?: number | undefined;
450
450
  "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
451
451
  "aria-valuemax"?: number | undefined;
@@ -1,4 +1,5 @@
1
1
  import type { InputHTMLAttributes, ReactNode } from 'react';
2
+ import type { SxProp } from '../Layout/sx';
2
3
  export type InputColor = 'primary' | 'danger' | 'warning' | 'success';
3
4
  export type InputSize = 'sm' | 'md' | 'lg';
4
5
  export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
@@ -15,4 +16,11 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
15
16
  onClear?: () => void;
16
17
  /** Show a password-visibility toggle. Forces `type="password"` when hidden. */
17
18
  showPasswordToggle?: boolean;
19
+ /**
20
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
21
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
22
+ * merges into inline style; responsive sx injects a scoped class.
23
+ * Applied to the outer affix wrapper, or the input itself when no affixes.
24
+ */
25
+ sx?: SxProp;
18
26
  }
@@ -1,7 +1,10 @@
1
1
  import type { HTMLAttributes, ReactNode } from 'react';
2
+ import type { SxProp } from './sx';
2
3
  export interface AspectRatioProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
3
4
  /** Ratio = width / height. e.g. 16/9, 4/3, 1, 21/9. Default 16/9. */
4
5
  ratio?: number;
6
+ /** One-off CSS (scalar or responsive breakpoint map), like `Box`'s `sx`. */
7
+ sx?: SxProp;
5
8
  children?: ReactNode;
6
9
  }
7
10
  /**
@@ -13,6 +13,7 @@ export type BoxProps<E extends ElementType = 'div'> = LayoutProps & Omit<Compone
13
13
  * @example
14
14
  * <Box p={4} gap={2} direction="column">...</Box>
15
15
  * <Box as="section" py={6} px={4}>...</Box>
16
+ * <Box sx={{ gridTemplateColumns: { base: '1fr', lg: '3fr 1fr' } }}>...</Box>
16
17
  */
17
18
  export declare const Box: <E extends ElementType = "div">(props: BoxProps<E> & {
18
19
  ref?: ForwardedRef<Element>;
@@ -1,7 +1,10 @@
1
1
  import type { HTMLAttributes } from 'react';
2
+ import type { SxProp } from './sx';
2
3
  export interface DividerProps extends Omit<HTMLAttributes<HTMLHRElement | HTMLSpanElement>, 'role'> {
3
4
  /** Axis. Default: `'horizontal'`. */
4
5
  orientation?: 'horizontal' | 'vertical';
6
+ /** One-off CSS (scalar or responsive breakpoint map), like `Box`'s `sx`. */
7
+ sx?: SxProp;
5
8
  }
6
9
  /**
7
10
  * Hairline divider. Renders `<hr>` when horizontal (no accessible name needed)
@@ -1,16 +1,32 @@
1
1
  import type { ElementType, ForwardedRef, ReactElement } from 'react';
2
2
  import type { BoxProps } from './Box';
3
+ import type { Breakpoint } from './sx';
3
4
  type GridCols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
5
+ /** Column weights, e.g. `[3, 1]` → `minmax(0,3fr) minmax(0,1fr)`. */
6
+ type Ratio = number[];
7
+ /** A ratio, or a per-breakpoint map for responsive tracks (e.g. `{ base: [1], lg: [3, 1] }`). */
8
+ type ResponsiveRatio = Ratio | Partial<Record<Breakpoint, Ratio>>;
4
9
  export type GridProps<E extends ElementType = 'div'> = Omit<BoxProps<E>, 'display' | 'direction'> & {
5
- /** Fixed column count. Maps to `.grid-cols-{n}` utility. Ignored if `minColWidth` is set. */
10
+ /** Fixed column count. Maps to `.grid-cols-{n}` utility. Ignored if another track prop is set. */
6
11
  cols?: GridCols;
7
12
  /**
8
13
  * Auto-fit responsive grid: `repeat(auto-fit, minmax(minColWidth, 1fr))`.
9
14
  * Pass a CSS length (e.g. `'240px'`, `'18rem'`).
10
15
  */
11
16
  minColWidth?: string;
17
+ /**
18
+ * Asymmetric tracks via column weights. `[3, 1]` → a 75/25 split. Responsive
19
+ * with a breakpoint map: `ratio={{ base: [1], lg: [3, 1] }}` stacks below `lg`
20
+ * and splits 3:1 at/above it — no custom CSS needed.
21
+ */
22
+ ratio?: ResponsiveRatio;
23
+ /** Explicit `grid-template-columns` string (e.g. `'200px 1fr auto'`). */
24
+ template?: string;
12
25
  };
13
- /** CSS Grid container. Use `cols` for fixed tracks, or `minColWidth` for responsive auto-fit. */
26
+ /**
27
+ * CSS Grid container. Choose one track model: `cols` (equal), `minColWidth`
28
+ * (auto-fit), `ratio` (asymmetric, responsive), or `template` (explicit).
29
+ */
14
30
  export declare const Grid: <E extends ElementType = "div">(props: GridProps<E> & {
15
31
  ref?: ForwardedRef<Element>;
16
32
  }) => ReactElement;
@@ -1,4 +1,8 @@
1
1
  import type { HTMLAttributes } from 'react';
2
- export type SpacerProps = HTMLAttributes<HTMLSpanElement>;
2
+ import type { SxProp } from './sx';
3
+ export interface SpacerProps extends HTMLAttributes<HTMLSpanElement> {
4
+ /** One-off CSS (scalar or responsive breakpoint map), like `Box`'s `sx`. */
5
+ sx?: SxProp;
6
+ }
3
7
  /** Flexible filler — `flex: 1 1 auto`. Use inside a `<Row>` or `<Stack>`. */
4
8
  export declare const Spacer: import("react").ForwardRefExoticComponent<SpacerProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -17,3 +17,5 @@ export type { AspectRatioProps } from './AspectRatio';
17
17
  export type { CenterProps } from './Center';
18
18
  export type { GroupProps } from './Group';
19
19
  export type { Space, Align, Justify, Direction, Display, LayoutProps } from './layout.types';
20
+ export type { SxProp, Breakpoint } from './sx';
21
+ export { BREAKPOINTS, resolveSx } from './sx';
@@ -1,4 +1,5 @@
1
1
  import type { ElementType, ReactNode } from 'react';
2
+ import type { SxProp } from './sx';
2
3
  /** Spacing scale token — maps 1:1 to `.p-{n}`, `.m-{n}`, `.gap-{n}` utilities. */
3
4
  export type Space = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16;
4
5
  export type Align = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
@@ -32,6 +33,15 @@ export interface LayoutProps {
32
33
  wrap?: boolean;
33
34
  w?: 'full' | 'auto' | 'fit';
34
35
  h?: 'full' | 'auto' | 'fit';
36
+ /** Grow to fill remaining space along the parent flex axis (`flex: 1 1 0`). */
37
+ grow?: boolean;
38
+ /**
39
+ * MUI-like escape hatch for one-off CSS. Each value may be a scalar or a
40
+ * responsive map keyed by breakpoint (base/sm/md/lg/xl), e.g.
41
+ * `sx={{ p: 8, gridTemplateColumns: { base: '1fr', lg: '3fr 1fr' } }}`.
42
+ * Scalar-only sx becomes inline style; responsive sx injects a scoped class.
43
+ */
44
+ sx?: SxProp;
35
45
  children?: ReactNode;
36
46
  }
37
47
  /** Maps layout props to the utility class names emitted by core. */
@@ -0,0 +1,31 @@
1
+ import type { CSSProperties } from 'react';
2
+ /** Responsive breakpoint keys. `base` has no media query (applies at all widths). */
3
+ export type Breakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl';
4
+ /** Mobile-first min-width breakpoints (px). Mirrors the common sm/md/lg/xl scale. */
5
+ export declare const BREAKPOINTS: Record<Exclude<Breakpoint, 'base'>, number>;
6
+ type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
7
+ /**
8
+ * MUI-like style object: any CSS property, each value either a scalar or a
9
+ * responsive map keyed by breakpoint, e.g.
10
+ * `sx={{ padding: 8, gridTemplateColumns: { base: '1fr', lg: '3fr 1fr' } }}`.
11
+ */
12
+ export type SxProp = {
13
+ [K in keyof CSSProperties]?: Responsive<CSSProperties[K]>;
14
+ };
15
+ export interface SxResult {
16
+ /** Inline style for all-scalar sx. */
17
+ style?: CSSProperties;
18
+ /** Generated class for responsive sx. */
19
+ className?: string;
20
+ /** CSS text (base rules + min-width @media blocks) to inject in a <style>. */
21
+ css?: string;
22
+ }
23
+ /**
24
+ * Resolve an `sx` object into what a component needs to render:
25
+ * - All-scalar sx → merged into inline `style` (no <style> element needed).
26
+ * - Any responsive value → a deterministic hashed class plus a `css` string of
27
+ * base rules and min-width @media blocks. The hash is content-derived, so SSR
28
+ * and client output match exactly.
29
+ */
30
+ export declare function resolveSx(sx: SxProp): SxResult;
31
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { ElementType, HTMLAttributes, ReactNode, MouseEventHandler } from 'react';
2
+ import type { SxProp } from '../Layout/sx';
2
3
  export type ListVariant = 'plain' | 'bordered' | 'dividers';
3
4
  export type ListSize = 'sm' | 'md' | 'lg';
4
5
  export interface ListProps extends HTMLAttributes<HTMLUListElement> {
@@ -9,6 +10,12 @@ export interface ListProps extends HTMLAttributes<HTMLUListElement> {
9
10
  /** Use this when items have explicit dividers via `<ListSeparator>` to
10
11
  * disable automatic divider rendering. */
11
12
  dense?: boolean;
13
+ /**
14
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
15
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
16
+ * merges into inline style; responsive sx injects a scoped class.
17
+ */
18
+ sx?: SxProp;
12
19
  }
13
20
  export declare const List: import("react").ForwardRefExoticComponent<ListProps & import("react").RefAttributes<HTMLUListElement>>;
14
21
  export interface ListItemProps {
@@ -1,11 +1,26 @@
1
1
  import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  import * as RadixMenu from '@radix-ui/react-dropdown-menu';
3
+ import type { SxProp } from '../Layout/sx';
3
4
  export declare const Menu: import("react").FC<RadixMenu.DropdownMenuProps>;
4
5
  export declare const MenuTrigger: import("react").ForwardRefExoticComponent<RadixMenu.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
5
- export interface MenuContentProps extends ComponentPropsWithoutRef<typeof RadixMenu.Content> {
6
+ export interface MenuContentProps extends ComponentPropsWithoutRef<'div'> {
6
7
  className?: string;
8
+ /** Preferred side of the trigger to render against. */
9
+ side?: 'top' | 'right' | 'bottom' | 'left';
10
+ /** Distance in px from the trigger. Default: 6. */
11
+ sideOffset?: number;
12
+ /** Alignment against the trigger. */
13
+ align?: 'start' | 'center' | 'end';
14
+ /** Offset in px from the aligned edge. */
15
+ alignOffset?: number;
7
16
  /** Visual size — controls padding + font size. Default: `md`. */
8
17
  size?: 'sm' | 'md';
18
+ /**
19
+ * One-off CSS for the menu content panel, same as `Box`'s `sx`: each value
20
+ * may be a scalar or a responsive breakpoint map (`{ base, sm, md, lg, xl }`).
21
+ * Scalar-only sx merges into inline style; responsive sx injects a scoped class.
22
+ */
23
+ sx?: SxProp;
9
24
  }
10
25
  /**
11
26
  * The popup panel. Wrap in `<Menu>` and pair with `<MenuTrigger>`.
@@ -21,7 +36,13 @@ export interface MenuContentProps extends ComponentPropsWithoutRef<typeof RadixM
21
36
  * </Menu>
22
37
  */
23
38
  export declare const MenuContent: import("react").ForwardRefExoticComponent<MenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
24
- export interface MenuItemProps extends ComponentPropsWithoutRef<typeof RadixMenu.Item> {
39
+ export interface MenuItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
40
+ /** Disable selecting this item. */
41
+ disabled?: boolean;
42
+ /** Fires when the item is selected (click or Enter). */
43
+ onSelect?: (event: Event) => void;
44
+ /** Optional text used for typeahead matching. */
45
+ textValue?: string;
25
46
  /** Leading icon. */
26
47
  icon?: ReactNode;
27
48
  /** Right-aligned shortcut hint (e.g. `⌘C`). */
@@ -30,21 +51,43 @@ export interface MenuItemProps extends ComponentPropsWithoutRef<typeof RadixMenu
30
51
  destructive?: boolean;
31
52
  }
32
53
  export declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
33
- export interface MenuCheckboxItemProps extends ComponentPropsWithoutRef<typeof RadixMenu.CheckboxItem> {
54
+ export interface MenuCheckboxItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
55
+ /** Controlled checked state. */
56
+ checked?: boolean;
57
+ /** Fires when the checked state changes. */
58
+ onCheckedChange?: (checked: boolean) => void;
59
+ /** Disable selecting this item. */
60
+ disabled?: boolean;
61
+ /** Fires when the item is selected (click or Enter). */
62
+ onSelect?: (event: Event) => void;
63
+ /** Optional text used for typeahead matching. */
64
+ textValue?: string;
34
65
  shortcut?: ReactNode;
35
66
  }
36
67
  export declare const MenuCheckboxItem: import("react").ForwardRefExoticComponent<MenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
37
68
  export declare const MenuRadioGroup: import("react").ForwardRefExoticComponent<RadixMenu.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
38
- export interface MenuRadioItemProps extends ComponentPropsWithoutRef<typeof RadixMenu.RadioItem> {
69
+ export interface MenuRadioItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
70
+ /** The value of this radio item within its group. */
71
+ value: string;
72
+ /** Disable selecting this item. */
73
+ disabled?: boolean;
74
+ /** Fires when the item is selected (click or Enter). */
75
+ onSelect?: (event: Event) => void;
76
+ /** Optional text used for typeahead matching. */
77
+ textValue?: string;
39
78
  shortcut?: ReactNode;
40
79
  }
41
80
  export declare const MenuRadioItem: import("react").ForwardRefExoticComponent<MenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>>;
42
- export interface MenuLabelProps extends ComponentPropsWithoutRef<typeof RadixMenu.Label> {
81
+ export interface MenuLabelProps extends ComponentPropsWithoutRef<'div'> {
43
82
  }
44
83
  export declare const MenuLabel: import("react").ForwardRefExoticComponent<MenuLabelProps & import("react").RefAttributes<HTMLDivElement>>;
45
84
  export declare const MenuSeparator: import("react").ForwardRefExoticComponent<Omit<RadixMenu.DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
46
85
  export declare const MenuSub: import("react").FC<RadixMenu.DropdownMenuSubProps>;
47
- export interface MenuSubTriggerProps extends ComponentPropsWithoutRef<typeof RadixMenu.SubTrigger> {
86
+ export interface MenuSubTriggerProps extends ComponentPropsWithoutRef<'div'> {
87
+ /** Disable opening this submenu. */
88
+ disabled?: boolean;
89
+ /** Optional text used for typeahead matching. */
90
+ textValue?: string;
48
91
  icon?: ReactNode;
49
92
  }
50
93
  export declare const MenuSubTrigger: import("react").ForwardRefExoticComponent<MenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,5 @@
1
- import type { ReactNode } from 'react';
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+ import type { SxProp } from '../Layout/sx';
2
3
  export type MultiSelectOption = {
3
4
  value: string;
4
5
  label: string;
@@ -45,10 +46,19 @@ export interface MultiSelectProps {
45
46
  'aria-label'?: string;
46
47
  /** Extra class on the trigger. */
47
48
  className?: string;
49
+ /** Inline style applied to the trigger (the inline field). */
50
+ style?: CSSProperties;
51
+ /**
52
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
53
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Applied to the
54
+ * trigger. Scalar-only sx merges into inline style; responsive sx injects
55
+ * a scoped class.
56
+ */
57
+ sx?: SxProp;
48
58
  }
49
59
  /**
50
60
  * MultiSelect — a combobox with a searchable list and chip tokens for
51
61
  * the selected values. Built on @radix-ui/react-popover (positioning +
52
62
  * focus management) and cmdk (search + filtering).
53
63
  */
54
- export declare function MultiSelect({ options, value, defaultValue, onValueChange, placeholder, searchPlaceholder, emptyText, maxItems, size, color, disabled, id, className, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
64
+ export declare function MultiSelect({ options, value, defaultValue, onValueChange, placeholder, searchPlaceholder, emptyText, maxItems, size, color, disabled, id, className, style, sx, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,13 @@
1
1
  import type { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
2
+ import type { SxProp } from '../Layout/sx';
2
3
  export interface NavbarProps extends HTMLAttributes<HTMLElement> {
3
4
  solid?: boolean;
5
+ /**
6
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
7
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
8
+ * merges into inline style; responsive sx injects a scoped class.
9
+ */
10
+ sx?: SxProp;
4
11
  children: ReactNode;
5
12
  }
6
13
  export interface NavbarBrandProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
@@ -1,3 +1,5 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { SxProp } from '../Layout/sx';
1
3
  export interface PaginationProps {
2
4
  /** Current page (1-based). */
3
5
  page: number;
@@ -13,6 +15,13 @@ export interface PaginationProps {
13
15
  hideControls?: boolean;
14
16
  size?: 'sm' | 'md' | 'lg';
15
17
  className?: string;
18
+ style?: CSSProperties;
19
+ /**
20
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
21
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
22
+ * merges into inline style; responsive sx injects a scoped class.
23
+ */
24
+ sx?: SxProp;
16
25
  'aria-label'?: string;
17
26
  }
18
27
  /**
@@ -1,4 +1,5 @@
1
1
  import type { HTMLAttributes, PointerEvent } from 'react';
2
+ import type { SxProp } from '../Layout/sx';
2
3
  export type PanelDirection = 'horizontal' | 'vertical';
3
4
  export interface PanelProps extends HTMLAttributes<HTMLDivElement> {
4
5
  /** Initial size as a percentage of the group. */
@@ -26,6 +27,12 @@ export declare const PanelResizeHandle: import("react").ForwardRefExoticComponen
26
27
  export interface PanelGroupProps extends HTMLAttributes<HTMLDivElement> {
27
28
  /** Layout axis. Default `'horizontal'`. */
28
29
  direction?: PanelDirection;
30
+ /**
31
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
32
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
33
+ * merges into inline style; responsive sx injects a scoped class.
34
+ */
35
+ sx?: SxProp;
29
36
  }
30
37
  export declare const PanelGroup: import("react").ForwardRefExoticComponent<PanelGroupProps & import("react").RefAttributes<HTMLDivElement>>;
31
38
  /** No-op kept for drop-in compatibility with `react-resizable-panels`. */
@@ -1,5 +1,6 @@
1
1
  import type { ComponentPropsWithoutRef } from 'react';
2
2
  import * as RadixPopover from '@radix-ui/react-popover';
3
+ import type { SxProp } from '../Layout/sx';
3
4
  /**
4
5
  * Popover root. Controlled (`open` + `onOpenChange`) or uncontrolled.
5
6
  * Wrap a `<PopoverTrigger>` and `<PopoverContent>`.
@@ -16,9 +17,23 @@ export declare const Popover: import("react").FC<RadixPopover.PopoverProps>;
16
17
  export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<RadixPopover.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
17
18
  export declare const PopoverAnchor: import("react").ForwardRefExoticComponent<RadixPopover.PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
18
19
  export declare const PopoverClose: import("react").ForwardRefExoticComponent<RadixPopover.PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
19
- export interface PopoverContentProps extends ComponentPropsWithoutRef<typeof RadixPopover.Content> {
20
+ export interface PopoverContentProps extends ComponentPropsWithoutRef<'div'> {
20
21
  className?: string;
21
22
  /** Render the small directional arrow on the popover. Default: false. */
22
23
  withArrow?: boolean;
24
+ /** Preferred side of the trigger to render against. */
25
+ side?: 'top' | 'right' | 'bottom' | 'left';
26
+ /** Distance in px from the trigger. Default: 8. */
27
+ sideOffset?: number;
28
+ /** Alignment against the trigger. */
29
+ align?: 'start' | 'center' | 'end';
30
+ /** Offset in px from the aligned edge. */
31
+ alignOffset?: number;
32
+ /**
33
+ * One-off CSS for the popover content panel, same as `Box`'s `sx`: each value
34
+ * may be a scalar or a responsive breakpoint map (`{ base, sm, md, lg, xl }`).
35
+ * Scalar-only sx merges into inline style; responsive sx injects a scoped class.
36
+ */
37
+ sx?: SxProp;
23
38
  }
24
39
  export declare const PopoverContent: import("react").ForwardRefExoticComponent<PopoverContentProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,12 +1,25 @@
1
1
  import type { HTMLAttributes } from 'react';
2
+ import type { SxProp } from '../Layout/sx';
2
3
  export type ProgressColor = 'primary' | 'danger' | 'warning' | 'success' | 'info';
3
4
  export interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
4
5
  value?: number;
5
6
  color?: ProgressColor;
6
7
  indeterminate?: boolean;
8
+ /**
9
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
10
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
11
+ * merges into inline style; responsive sx injects a scoped class.
12
+ */
13
+ sx?: SxProp;
7
14
  }
8
15
  export interface ProgressRingProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
9
16
  value: number;
10
17
  size?: 'md' | 'lg';
11
18
  showLabel?: boolean;
19
+ /**
20
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
21
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
22
+ * merges into inline style; responsive sx injects a scoped class.
23
+ */
24
+ sx?: SxProp;
12
25
  }
@@ -1,5 +1,6 @@
1
1
  import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  import * as RadixRadio from '@radix-ui/react-radio-group';
3
+ import type { SxProp } from '../Layout/sx';
3
4
  type RadioGroupProps = ComponentPropsWithoutRef<typeof RadixRadio.Root>;
4
5
  type RadioItemProps = ComponentPropsWithoutRef<typeof RadixRadio.Item>;
5
6
  export interface RadioGroupRootProps extends RadioGroupProps {
@@ -9,6 +10,13 @@ export interface RadioGroupRootProps extends RadioGroupProps {
9
10
  export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupRootProps & import("react").RefAttributes<HTMLDivElement>>;
10
11
  export interface RadioProps extends Omit<RadioItemProps, 'children'> {
11
12
  children?: ReactNode;
13
+ /**
14
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
15
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
16
+ * merges into inline style; responsive sx injects a scoped class. Applied to
17
+ * the outer label wrapper, or the radio itself when there is no label.
18
+ */
19
+ sx?: SxProp;
12
20
  }
13
21
  export declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLButtonElement>>;
14
22
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { HTMLAttributes, ReactNode } from 'react';
2
+ import type { SxProp } from '../Layout/sx';
2
3
  export type ScrollVariant = 'default' | 'thin' | 'subtle' | 'overlay' | 'expand';
3
4
  export type ScrollTone = 'neutral' | 'primary';
4
5
  export type ScrollAxis = 'both' | 'x' | 'y';
@@ -9,5 +10,11 @@ export interface ScrollProps extends HTMLAttributes<HTMLDivElement> {
9
10
  maxHeight?: number | string;
10
11
  maxWidth?: number | string;
11
12
  region?: boolean;
13
+ /**
14
+ * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
15
+ * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
16
+ * merges into inline style; responsive sx injects a scoped class.
17
+ */
18
+ sx?: SxProp;
12
19
  children: ReactNode;
13
20
  }