@visulima/tui-kit 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/accordion.d.ts +25 -32
  3. package/dist/alert.d.ts +9 -13
  4. package/dist/animate-presence.d.ts +9 -11
  5. package/dist/approval-prompt.d.ts +28 -38
  6. package/dist/area-chart.d.ts +29 -39
  7. package/dist/badge.d.ts +8 -11
  8. package/dist/bar-chart.d.ts +29 -38
  9. package/dist/big-text.d.ts +42 -52
  10. package/dist/blink-dot.d.ts +16 -21
  11. package/dist/breadcrumb.d.ts +11 -15
  12. package/dist/button.d.ts +18 -25
  13. package/dist/calendar.d.ts +31 -43
  14. package/dist/card.d.ts +22 -32
  15. package/dist/checkbox-group.d.ts +21 -30
  16. package/dist/checkbox.d.ts +19 -27
  17. package/dist/code.d.ts +24 -31
  18. package/dist/collapsible.d.ts +21 -30
  19. package/dist/color-picker.d.ts +29 -41
  20. package/dist/command-block.d.ts +19 -27
  21. package/dist/command-palette.d.ts +36 -45
  22. package/dist/confirm-dialog.d.ts +35 -47
  23. package/dist/confirm-input.d.ts +17 -23
  24. package/dist/console-overlay.d.ts +28 -35
  25. package/dist/content-switcher.d.ts +22 -30
  26. package/dist/controlled-scroll-view.d.ts +1 -1
  27. package/dist/data-grid.d.ts +18 -24
  28. package/dist/date-picker.d.ts +27 -38
  29. package/dist/definition-list.d.ts +16 -22
  30. package/dist/dialog.d.ts +58 -74
  31. package/dist/diff-view.d.ts +41 -54
  32. package/dist/digits.d.ts +13 -17
  33. package/dist/directory-tree.d.ts +20 -27
  34. package/dist/divider.d.ts +20 -28
  35. package/dist/drawer.d.ts +24 -32
  36. package/dist/file-change.d.ts +18 -24
  37. package/dist/file-picker-entry.d.ts +1 -1
  38. package/dist/form.d.ts +34 -41
  39. package/dist/gauge.d.ts +40 -51
  40. package/dist/gradient.d.ts +21 -25
  41. package/dist/grid.d.ts +19 -25
  42. package/dist/heading.d.ts +12 -17
  43. package/dist/heatmap.d.ts +27 -37
  44. package/dist/help.d.ts +27 -34
  45. package/dist/histogram.d.ts +27 -37
  46. package/dist/image.d.ts +11 -14
  47. package/dist/index.d.ts +6 -6
  48. package/dist/json.d.ts +23 -30
  49. package/dist/kbd.d.ts +14 -18
  50. package/dist/line-chart.d.ts +40 -49
  51. package/dist/link.d.ts +24 -28
  52. package/dist/loading-indicator.d.ts +11 -15
  53. package/dist/log.d.ts +14 -19
  54. package/dist/markdown.d.ts +22 -27
  55. package/dist/masked-input.d.ts +23 -31
  56. package/dist/menu.d.ts +32 -40
  57. package/dist/message-bubble.d.ts +16 -23
  58. package/dist/model-badge.d.ts +16 -22
  59. package/dist/model-selector.d.ts +19 -26
  60. package/dist/multi-progress.d.ts +22 -29
  61. package/dist/multi-select.d.ts +25 -35
  62. package/dist/notification-badge.d.ts +21 -28
  63. package/dist/number-input.d.ts +38 -52
  64. package/dist/operation-tree.d.ts +22 -25
  65. package/dist/option-list.d.ts +17 -23
  66. package/dist/ordered-list.d.ts +9 -11
  67. package/dist/packem_shared/{controlled-scroll-view.d-vF4wevEJ.d.ts → controlled-scroll-view.d-D3kZZzjI.d.ts} +8 -19
  68. package/dist/packem_shared/file-picker.d-CH7pccC7.d.ts +92 -0
  69. package/dist/packem_shared/{scroll-bar-box.d-DSBbBsRc.d.ts → scroll-bar-box.d-CpTYEcTZ.d.ts} +1 -18
  70. package/dist/packem_shared/{scroll-list.d-BP0UZSY4.d.ts → scroll-list.d-CPCF0RwC.d.ts} +1 -1
  71. package/dist/packem_shared/scroll-view.d-GZcgAHl4.d.ts +98 -0
  72. package/dist/packem_shared/{use-tree-view.d-dXTKoDPM.d.ts → use-tree-view.d-DeMQ6G2r.d.ts} +115 -151
  73. package/dist/paginator.d.ts +28 -38
  74. package/dist/paragraph.d.ts +15 -21
  75. package/dist/path-input.d.ts +29 -40
  76. package/dist/pie-chart.d.ts +21 -27
  77. package/dist/placeholder.d.ts +26 -34
  78. package/dist/popover.d.ts +20 -27
  79. package/dist/progress-bar.d.ts +25 -33
  80. package/dist/progress-circle.d.ts +27 -36
  81. package/dist/qr-code.d.ts +21 -27
  82. package/dist/radio-group.d.ts +30 -41
  83. package/dist/scatter-plot.d.ts +5 -16
  84. package/dist/scroll-bar-box.d.ts +1 -1
  85. package/dist/scroll-list.d.ts +2 -2
  86. package/dist/scroll-view.d.ts +1 -1
  87. package/dist/search-input.d.ts +23 -32
  88. package/dist/select-input-indicator.d.ts +15 -19
  89. package/dist/select-input-item.d.ts +18 -24
  90. package/dist/select-input.d.ts +49 -62
  91. package/dist/shimmer-text.d.ts +24 -30
  92. package/dist/sidebar.d.ts +21 -28
  93. package/dist/slider.d.ts +50 -66
  94. package/dist/sparkline.d.ts +19 -25
  95. package/dist/spinner.d.ts +7 -9
  96. package/dist/status-line.d.ts +14 -20
  97. package/dist/status-message.d.ts +7 -10
  98. package/dist/stepper.d.ts +18 -24
  99. package/dist/stopwatch.d.ts +24 -31
  100. package/dist/streaming-text.d.ts +20 -27
  101. package/dist/switch.d.ts +23 -32
  102. package/dist/tab.d.ts +8 -10
  103. package/dist/table.d.ts +40 -41
  104. package/dist/tabs.d.ts +50 -61
  105. package/dist/tag-input.d.ts +30 -42
  106. package/dist/tag.d.ts +14 -19
  107. package/dist/text-input.d.ts +21 -29
  108. package/dist/textarea.d.ts +32 -43
  109. package/dist/thinking-block.d.ts +25 -34
  110. package/dist/time-picker.d.ts +27 -37
  111. package/dist/timer.d.ts +28 -37
  112. package/dist/toast.d.ts +20 -28
  113. package/dist/token-usage.d.ts +23 -30
  114. package/dist/tool-call.d.ts +14 -19
  115. package/dist/tooltip.d.ts +19 -25
  116. package/dist/transition.d.ts +40 -48
  117. package/dist/tree-select.d.ts +25 -35
  118. package/dist/tree-view-entry.d.ts +1 -1
  119. package/dist/unordered-list.d.ts +12 -15
  120. package/dist/use-linked-scroll.d.ts +27 -27
  121. package/package.json +2 -2
  122. package/dist/packem_shared/file-picker.d-Cie6aAMD.d.ts +0 -104
  123. package/dist/packem_shared/scroll-view.d-BqKpI-F-.d.ts +0 -119
@@ -8,26 +8,22 @@ type BreadcrumbItem = {
8
8
  };
9
9
  type Props = {
10
10
  /**
11
- * Color applied to the trailing (current) item.
12
- * @default "blue"
13
- */
11
+ * Color applied to the trailing (current) item.
12
+ * @default "blue"
13
+ */
14
14
  readonly currentColor?: LiteralUnion<AnsiColors, string>;
15
15
  /**
16
- * Items to display from root to current page.
17
- */
16
+ * Items to display from root to current page.
17
+ */
18
18
  readonly items: ReadonlyArray<BreadcrumbItem>;
19
19
  /**
20
- * Glyph rendered between adjacent items.
21
- * @default "›" (right single angle quote)
22
- */
20
+ * Glyph rendered between adjacent items.
21
+ * @default "›" (right single angle quote)
22
+ */
23
23
  readonly separator?: string;
24
24
  };
25
25
  /**
26
- * Render a breadcrumb trail (last item is highlighted).
27
- */
28
- declare function Breadcrumb({
29
- currentColor,
30
- items,
31
- separator
32
- }: Props): ReactElement;
26
+ * Render a breadcrumb trail (last item is highlighted).
27
+ */
28
+ declare function Breadcrumb({ currentColor, items, separator }: Props): ReactElement;
33
29
  export { Breadcrumb, BreadcrumbItem, type Props as BreadcrumbProps, Props, Breadcrumb as default };
package/dist/button.d.ts CHANGED
@@ -4,42 +4,35 @@ import { LiteralUnion } from 'type-fest';
4
4
  type ButtonVariant = "ghost" | "outline" | "primary" | "secondary";
5
5
  type Props = {
6
6
  /**
7
- * Accent color used when the button is focused.
8
- * @default "blue"
9
- */
7
+ * Accent color used when the button is focused.
8
+ * @default "blue"
9
+ */
10
10
  readonly accentColor?: LiteralUnion<AnsiColors, string>;
11
11
  /**
12
- * Focus this button when mounted if nothing else is focused.
13
- */
12
+ * Focus this button when mounted if nothing else is focused.
13
+ */
14
14
  readonly autoFocus?: boolean;
15
15
  /**
16
- * Button label.
17
- */
16
+ * Button label.
17
+ */
18
18
  readonly children: ReactNode;
19
19
  /**
20
- * When true, the button ignores input and is rendered dim.
21
- */
20
+ * When true, the button ignores input and is rendered dim.
21
+ */
22
22
  readonly isDisabled?: boolean;
23
23
  /**
24
- * Called when the user presses Enter or Space while the button has focus.
25
- */
24
+ * Called when the user presses Enter or Space while the button has focus.
25
+ */
26
26
  readonly onPress?: () => void;
27
27
  /**
28
- * Visual style.
29
- * @default "primary"
30
- */
28
+ * Visual style.
29
+ * @default "primary"
30
+ */
31
31
  readonly variant?: ButtonVariant;
32
32
  };
33
33
  /**
34
- * Focusable button. Triggers `onPress` on Enter / Space.
35
- * @returns A `ReactElement` rendering the button (bordered or ghost variant).
36
- */
37
- declare function Button({
38
- accentColor,
39
- autoFocus,
40
- children,
41
- isDisabled,
42
- onPress,
43
- variant
44
- }: Props): ReactElement;
34
+ * Focusable button. Triggers `onPress` on Enter / Space.
35
+ * @returns A `ReactElement` rendering the button (bordered or ghost variant).
36
+ */
37
+ declare function Button({ accentColor, autoFocus, children, isDisabled, onPress, variant }: Props): ReactElement;
45
38
  export { Button, type Props as ButtonProps, ButtonVariant, Props, Button as default };
@@ -3,70 +3,58 @@ import { ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Accent color for today / the focused cell.
7
- * @default "blue"
8
- */
6
+ * Accent color for today / the focused cell.
7
+ * @default "blue"
8
+ */
9
9
  readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
10
  /**
11
- * Auto-focus the grid on mount.
12
- */
11
+ * Auto-focus the grid on mount.
12
+ */
13
13
  readonly autoFocus?: boolean;
14
14
  /**
15
- * Initial focused day when uncontrolled. Defaults to `value` or today.
16
- */
15
+ * Initial focused day when uncontrolled. Defaults to `value` or today.
16
+ */
17
17
  readonly defaultValue?: Date;
18
18
  /**
19
- * First day of the week: 0 = Sunday, 1 = Monday.
20
- * @default 1
21
- */
19
+ * First day of the week: 0 = Sunday, 1 = Monday.
20
+ * @default 1
21
+ */
22
22
  readonly firstDayOfWeek?: 0 | 1;
23
23
  /**
24
- * When true, disable input and render the grid dim.
25
- */
24
+ * When true, disable input and render the grid dim.
25
+ */
26
26
  readonly isDisabled?: boolean;
27
27
  /**
28
- * Upper bound; days after `maxDate` cannot be selected.
29
- */
28
+ * Upper bound; days after `maxDate` cannot be selected.
29
+ */
30
30
  readonly maxDate?: Date;
31
31
  /**
32
- * Lower bound; days before `minDate` cannot be selected.
33
- */
32
+ * Lower bound; days before `minDate` cannot be selected.
33
+ */
34
34
  readonly minDate?: Date;
35
35
  /**
36
- * Called whenever the user navigates or selects a day.
37
- */
36
+ * Called whenever the user navigates or selects a day.
37
+ */
38
38
  readonly onChange?: (date: Date) => void;
39
39
  /**
40
- * Called when the user presses Enter.
41
- */
40
+ * Called when the user presses Enter.
41
+ */
42
42
  readonly onSubmit?: (date: Date) => void;
43
43
  /**
44
- * Color used to mark the currently selected day.
45
- * @default "green"
46
- */
44
+ * Color used to mark the currently selected day.
45
+ * @default "green"
46
+ */
47
47
  readonly selectedColor?: LiteralUnion<AnsiColors, string>;
48
48
  /**
49
- * Controlled selected date.
50
- */
49
+ * Controlled selected date.
50
+ */
51
51
  readonly value?: Date;
52
52
  };
53
53
  /**
54
- * Month-grid date picker. Arrow keys move focus by one day, page up/down move
55
- * by month. Enter submits; Space or Enter selects.
56
- * @returns A bordered `ReactElement` containing the month header, weekday
57
- * labels, and the day grid.
58
- */
59
- declare function Calendar({
60
- accentColor,
61
- autoFocus,
62
- defaultValue,
63
- firstDayOfWeek,
64
- isDisabled,
65
- maxDate,
66
- minDate,
67
- onChange,
68
- onSubmit,
69
- selectedColor,
70
- value
71
- }: Props): ReactElement;
54
+ * Month-grid date picker. Arrow keys move focus by one day, page up/down move
55
+ * by month. Enter submits; Space or Enter selects.
56
+ * @returns A bordered `ReactElement` containing the month header, weekday
57
+ * labels, and the day grid.
58
+ */
59
+ declare function Calendar({ accentColor, autoFocus, defaultValue, firstDayOfWeek, isDisabled, maxDate, minDate, onChange, onSubmit, selectedColor, value }: Props): ReactElement;
72
60
  export { Calendar, type Props as CalendarProps, Props, Calendar as default };
package/dist/card.d.ts CHANGED
@@ -3,55 +3,45 @@ import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Border color.
7
- */
6
+ * Border color.
7
+ */
8
8
  readonly borderColor?: LiteralUnion<AnsiColors, string>;
9
9
  /**
10
- * Border style name, passed through to `Box`.
11
- * @default "round"
12
- */
10
+ * Border style name, passed through to `Box`.
11
+ * @default "round"
12
+ */
13
13
  readonly borderStyle?: "arrow" | "bold" | "classic" | "double" | "doubleSingle" | "round" | "single" | "singleDouble";
14
14
  /**
15
- * Card body.
16
- */
15
+ * Card body.
16
+ */
17
17
  readonly children: ReactNode;
18
18
  /**
19
- * Optional footer rendered below body with a dim divider.
20
- */
19
+ * Optional footer rendered below body with a dim divider.
20
+ */
21
21
  readonly footer?: ReactNode;
22
22
  /**
23
- * Optional content rendered after the title on the same row.
24
- */
23
+ * Optional content rendered after the title on the same row.
24
+ */
25
25
  readonly headerRight?: ReactNode;
26
26
  /**
27
- * Optional subtitle rendered below the title.
28
- */
27
+ * Optional subtitle rendered below the title.
28
+ */
29
29
  readonly subtitle?: string;
30
30
  /**
31
- * Optional title rendered in the header area.
32
- */
31
+ * Optional title rendered in the header area.
32
+ */
33
33
  readonly title?: string;
34
34
  /**
35
- * Color applied to the title.
36
- */
35
+ * Color applied to the title.
36
+ */
37
37
  readonly titleColor?: LiteralUnion<AnsiColors, string>;
38
38
  /**
39
- * Fix the card width. When omitted the card grows to fill its parent.
40
- */
39
+ * Fix the card width. When omitted the card grows to fill its parent.
40
+ */
41
41
  readonly width?: number | string;
42
42
  };
43
43
  /**
44
- * Bordered container with optional title, subtitle, and footer.
45
- */
46
- declare function Card({
47
- borderColor,
48
- borderStyle,
49
- children,
50
- footer,
51
- headerRight,
52
- subtitle,
53
- title,
54
- titleColor,
55
- width
56
- }: Props): ReactElement;
44
+ * Bordered container with optional title, subtitle, and footer.
45
+ */
46
+ declare function Card({ borderColor, borderStyle, children, footer, headerRight, subtitle, title, titleColor, width }: Props): ReactElement;
57
47
  export { Card, type Props as CardProps, Props, Card as default };
@@ -9,51 +9,42 @@ type CheckboxOption = {
9
9
  };
10
10
  type Props = {
11
11
  /**
12
- * Accent color for the focused row and checked marks.
13
- * @default "blue"
14
- */
12
+ * Accent color for the focused row and checked marks.
13
+ * @default "blue"
14
+ */
15
15
  readonly accentColor?: LiteralUnion<AnsiColors, string>;
16
16
  /**
17
- * Auto-focus on mount.
18
- */
17
+ * Auto-focus on mount.
18
+ */
19
19
  readonly autoFocus?: boolean;
20
20
  /**
21
- * Checked values when uncontrolled.
22
- */
21
+ * Checked values when uncontrolled.
22
+ */
23
23
  readonly defaultValue?: ReadonlyArray<string>;
24
24
  /**
25
- * Disable the whole group.
26
- */
25
+ * Disable the whole group.
26
+ */
27
27
  readonly isDisabled?: boolean;
28
28
  /**
29
- * Fires whenever the set of checked values changes.
30
- */
29
+ * Fires whenever the set of checked values changes.
30
+ */
31
31
  readonly onChange?: (values: ReadonlyArray<string>) => void;
32
32
  /**
33
- * Fires on Enter with the current checked values.
34
- */
33
+ * Fires on Enter with the current checked values.
34
+ */
35
35
  readonly onSubmit?: (values: ReadonlyArray<string>) => void;
36
36
  /**
37
- * The options to render.
38
- */
37
+ * The options to render.
38
+ */
39
39
  readonly options: ReadonlyArray<CheckboxOption>;
40
40
  /**
41
- * Controlled checked values. When provided, `defaultValue` is ignored.
42
- */
41
+ * Controlled checked values. When provided, `defaultValue` is ignored.
42
+ */
43
43
  readonly value?: ReadonlyArray<string>;
44
44
  };
45
45
  /**
46
- * A vertical list of checkboxes. ↑/↓ move focus, Space toggles the focused
47
- * option, `a` toggles all, and Enter submits.
48
- */
49
- declare function CheckboxGroup({
50
- accentColor,
51
- autoFocus,
52
- defaultValue,
53
- isDisabled,
54
- onChange,
55
- onSubmit,
56
- options,
57
- value: controlledValue
58
- }: Props): ReactElement;
46
+ * A vertical list of checkboxes. ↑/↓ move focus, Space toggles the focused
47
+ * option, `a` toggles all, and Enter submits.
48
+ */
49
+ declare function CheckboxGroup({ accentColor, autoFocus, defaultValue, isDisabled, onChange, onSubmit, options, value: controlledValue }: Props): ReactElement;
59
50
  export { CheckboxGroup, type Props as CheckboxGroupProps, CheckboxOption, Props, CheckboxGroup as default };
@@ -3,46 +3,38 @@ import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Accent color when focused.
7
- * @default "blue"
8
- */
6
+ * Accent color when focused.
7
+ * @default "blue"
8
+ */
9
9
  readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
10
  /**
11
- * Auto-focus when mounted if nothing else is focused.
12
- */
11
+ * Auto-focus when mounted if nothing else is focused.
12
+ */
13
13
  readonly autoFocus?: boolean;
14
14
  /**
15
- * Label rendered next to the checkbox.
16
- */
15
+ * Label rendered next to the checkbox.
16
+ */
17
17
  readonly children?: ReactNode;
18
18
  /**
19
- * Initial checked state when uncontrolled.
20
- * @default false
21
- */
19
+ * Initial checked state when uncontrolled.
20
+ * @default false
21
+ */
22
22
  readonly defaultChecked?: boolean;
23
23
  /**
24
- * Controlled checked state. When provided, `onChange` should update the parent.
25
- */
24
+ * Controlled checked state. When provided, `onChange` should update the parent.
25
+ */
26
26
  readonly isChecked?: boolean;
27
27
  /**
28
- * Disable input and dim the label.
29
- */
28
+ * Disable input and dim the label.
29
+ */
30
30
  readonly isDisabled?: boolean;
31
31
  /**
32
- * Fired when the checkbox toggles.
33
- */
32
+ * Fired when the checkbox toggles.
33
+ */
34
34
  readonly onChange?: (checked: boolean) => void;
35
35
  };
36
36
  /**
37
- * Focusable checkbox. Toggles with Space or Enter.
38
- */
39
- declare function Checkbox({
40
- accentColor,
41
- autoFocus,
42
- children,
43
- defaultChecked,
44
- isChecked,
45
- isDisabled,
46
- onChange
47
- }: Props): ReactElement;
37
+ * Focusable checkbox. Toggles with Space or Enter.
38
+ */
39
+ declare function Checkbox({ accentColor, autoFocus, children, defaultChecked, isChecked, isDisabled, onChange }: Props): ReactElement;
48
40
  export { Checkbox, type Props as CheckboxProps, Props, Checkbox as default };
package/dist/code.d.ts CHANGED
@@ -1,48 +1,41 @@
1
1
  import { ReactElement } from 'react';
2
2
  type Props = {
3
3
  /**
4
- * The source code string to highlight.
5
- */
4
+ * The source code string to highlight.
5
+ */
6
6
  readonly code: string;
7
7
  /**
8
- * Set of line numbers to visually emphasize.
9
- */
8
+ * Set of line numbers to visually emphasize.
9
+ */
10
10
  readonly highlightLines?: ReadonlySet<number>;
11
11
  /**
12
- * Programming language for syntax highlighting.
13
- * Falls back to plain text if the language is unknown.
14
- */
12
+ * Programming language for syntax highlighting.
13
+ * Falls back to plain text if the language is unknown.
14
+ */
15
15
  readonly language?: string;
16
16
  /**
17
- * Whether to show line numbers in the gutter.
18
- * @default false
19
- */
17
+ * Whether to show line numbers in the gutter.
18
+ * @default false
19
+ */
20
20
  readonly showLineNumbers?: boolean;
21
21
  /**
22
- * Starting line number (useful for code excerpts).
23
- * @default 1
24
- */
22
+ * Starting line number (useful for code excerpts).
23
+ * @default 1
24
+ */
25
25
  readonly startLine?: number;
26
26
  /**
27
- * Shiki theme name.
28
- * @default "github-dark-default"
29
- */
27
+ * Shiki theme name.
28
+ * @default "github-dark-default"
29
+ */
30
30
  readonly theme?: string;
31
31
  };
32
32
  /**
33
- * Render source code with syntax highlighting.
34
- *
35
- * ```tsx
36
- * &lt;Code code="const x = 42;" language="typescript" />
37
- * &lt;Code code={source} language="python" showLineNumbers />
38
- * ```
39
- */
40
- declare function Code({
41
- code,
42
- highlightLines,
43
- language,
44
- showLineNumbers,
45
- startLine,
46
- theme
47
- }: Props): ReactElement;
33
+ * Render source code with syntax highlighting.
34
+ *
35
+ * ```tsx
36
+ * &lt;Code code="const x = 42;" language="typescript" />
37
+ * &lt;Code code={source} language="python" showLineNumbers />
38
+ * ```
39
+ */
40
+ declare function Code({ code, highlightLines, language, showLineNumbers, startLine, theme }: Props): ReactElement;
48
41
  export { Code, type Props as CodeProps, Props, Code as default };
@@ -3,51 +3,42 @@ import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Accent color when the header is focused.
7
- * @default "blue"
8
- */
6
+ * Accent color when the header is focused.
7
+ * @default "blue"
8
+ */
9
9
  readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
10
  /**
11
- * Auto-focus the collapsible on mount.
12
- */
11
+ * Auto-focus the collapsible on mount.
12
+ */
13
13
  readonly autoFocus?: boolean;
14
14
  /**
15
- * Child content rendered when open.
16
- */
15
+ * Child content rendered when open.
16
+ */
17
17
  readonly children: ReactNode;
18
18
  /**
19
- * Whether the section starts expanded.
20
- * @default false
21
- */
19
+ * Whether the section starts expanded.
20
+ * @default false
21
+ */
22
22
  readonly defaultOpen?: boolean;
23
23
  /**
24
- * Disable interaction.
25
- */
24
+ * Disable interaction.
25
+ */
26
26
  readonly isDisabled?: boolean;
27
27
  /**
28
- * Controlled open state.
29
- */
28
+ * Controlled open state.
29
+ */
30
30
  readonly isOpen?: boolean;
31
31
  /**
32
- * Called when the user toggles the section.
33
- */
32
+ * Called when the user toggles the section.
33
+ */
34
34
  readonly onToggle?: (isOpen: boolean) => void;
35
35
  /**
36
- * Header label.
37
- */
36
+ * Header label.
37
+ */
38
38
  readonly title: ReactNode;
39
39
  };
40
40
  /**
41
- * Focusable section that can be expanded or collapsed.
42
- */
43
- declare function Collapsible({
44
- accentColor,
45
- autoFocus,
46
- children,
47
- defaultOpen,
48
- isDisabled,
49
- isOpen,
50
- onToggle,
51
- title
52
- }: Props): ReactElement;
41
+ * Focusable section that can be expanded or collapsed.
42
+ */
43
+ declare function Collapsible({ accentColor, autoFocus, children, defaultOpen, isDisabled, isOpen, onToggle, title }: Props): ReactElement;
53
44
  export { Collapsible, type Props as CollapsibleProps, Props, Collapsible as default };
@@ -4,68 +4,56 @@ import { LiteralUnion } from 'type-fest';
4
4
  type Color = LiteralUnion<AnsiColors, string>;
5
5
  type Props = {
6
6
  /**
7
- * Accent color for the focused-cell outline.
8
- * @default "blue"
9
- */
7
+ * Accent color for the focused-cell outline.
8
+ * @default "blue"
9
+ */
10
10
  readonly accentColor?: Color;
11
11
  /**
12
- * Auto-focus on mount.
13
- */
12
+ * Auto-focus on mount.
13
+ */
14
14
  readonly autoFocus?: boolean;
15
15
  /**
16
- * Number of swatches per row.
17
- * @default 8
18
- */
16
+ * Number of swatches per row.
17
+ * @default 8
18
+ */
19
19
  readonly columns?: number;
20
20
  /**
21
- * Selected color when uncontrolled.
22
- */
21
+ * Selected color when uncontrolled.
22
+ */
23
23
  readonly defaultValue?: Color;
24
24
  /**
25
- * Disable input and dim the grid.
26
- */
25
+ * Disable input and dim the grid.
26
+ */
27
27
  readonly isDisabled?: boolean;
28
28
  /**
29
- * Fires when the highlighted swatch changes.
30
- */
29
+ * Fires when the highlighted swatch changes.
30
+ */
31
31
  readonly onChange?: (color: Color) => void;
32
32
  /**
33
- * Fires on Enter with the highlighted swatch.
34
- */
33
+ * Fires on Enter with the highlighted swatch.
34
+ */
35
35
  readonly onSubmit?: (color: Color) => void;
36
36
  /**
37
- * Colors to offer. Defaults to the 16 standard ANSI colors.
38
- */
37
+ * Colors to offer. Defaults to the 16 standard ANSI colors.
38
+ */
39
39
  readonly palette?: ReadonlyArray<Color>;
40
40
  /**
41
- * Render the highlighted color's name beneath the grid.
42
- * @default true
43
- */
41
+ * Render the highlighted color's name beneath the grid.
42
+ * @default true
43
+ */
44
44
  readonly showName?: boolean;
45
45
  /**
46
- * The two-cell glyph filled with each palette color (default `"██"`).
47
- */
46
+ * The two-cell glyph filled with each palette color (default `"██"`).
47
+ */
48
48
  readonly swatch?: string;
49
49
  /**
50
- * Controlled selected color. When provided, `defaultValue` is ignored.
51
- */
50
+ * Controlled selected color. When provided, `defaultValue` is ignored.
51
+ */
52
52
  readonly value?: Color;
53
53
  };
54
54
  /**
55
- * A grid of color swatches. Arrow keys move the highlight, Enter selects. The
56
- * highlighted swatch's name is shown below the grid by default.
57
- */
58
- declare function ColorPicker({
59
- accentColor,
60
- autoFocus,
61
- columns,
62
- defaultValue,
63
- isDisabled,
64
- onChange,
65
- onSubmit,
66
- palette,
67
- showName,
68
- swatch,
69
- value: controlledValue
70
- }: Props): ReactElement;
55
+ * A grid of color swatches. Arrow keys move the highlight, Enter selects. The
56
+ * highlighted swatch's name is shown below the grid by default.
57
+ */
58
+ declare function ColorPicker({ accentColor, autoFocus, columns, defaultValue, isDisabled, onChange, onSubmit, palette, showName, swatch, value: controlledValue }: Props): ReactElement;
71
59
  export { ColorPicker, type Props as ColorPickerProps, Props, ColorPicker as default };