@galaxy-io/dls 1.4.10 → 1.4.12

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 (184) hide show
  1. package/dist/accordion/Accordion.d.ts +19 -2
  2. package/dist/accordion/Accordion.js +8 -0
  3. package/dist/avatar/Avatar.d.ts +9 -0
  4. package/dist/avatar/Avatar.js +4 -0
  5. package/dist/avatar/AvatarShimmer.d.ts +2 -0
  6. package/dist/avatar/AvatarShimmer.js +1 -0
  7. package/dist/backgrounds/CellGridBackground.d.ts +12 -1
  8. package/dist/backgrounds/CellGridBackground.js +5 -0
  9. package/dist/backgrounds/CrossGridBackground.d.ts +13 -1
  10. package/dist/backgrounds/CrossGridBackground.js +4 -0
  11. package/dist/backgrounds/DotGridBackground.d.ts +12 -1
  12. package/dist/backgrounds/DotGridBackground.js +4 -0
  13. package/dist/badge/Badge.d.ts +12 -0
  14. package/dist/badge/Badge.js +7 -0
  15. package/dist/beacons/Beacon.d.ts +7 -13
  16. package/dist/beacons/Beacon.js +3 -0
  17. package/dist/buttons/Button.d.ts +18 -0
  18. package/dist/buttons/Button.js +10 -1
  19. package/dist/charts/BarChart.d.ts +4 -1
  20. package/dist/charts/BarChart.js +17 -8
  21. package/dist/charts/ChartCategoryTargets.d.ts +5 -12
  22. package/dist/charts/ChartCategoryTargets.js +1 -2
  23. package/dist/charts/ChartFrame.d.ts +3 -4
  24. package/dist/charts/ChartFrame.js +10 -25
  25. package/dist/charts/ChartLegend.js +26 -23
  26. package/dist/charts/ChartPrimitives.d.ts +38 -17
  27. package/dist/charts/ChartPrimitives.js +74 -73
  28. package/dist/charts/DashboardProvider.d.ts +57 -0
  29. package/dist/charts/DashboardProvider.js +30 -0
  30. package/dist/charts/LineChart.js +2 -1
  31. package/dist/charts/PieChart.js +1 -1
  32. package/dist/charts/ProgressBar.d.ts +13 -1
  33. package/dist/charts/ProgressBar.js +7 -0
  34. package/dist/charts/StatChart.d.ts +10 -1
  35. package/dist/charts/StatChart.js +5 -0
  36. package/dist/charts/constants.d.ts +20 -24
  37. package/dist/charts/constants.js +21 -25
  38. package/dist/charts/types.d.ts +10 -2
  39. package/dist/charts/types.js +9 -1
  40. package/dist/charts/useChartInteraction.d.ts +37 -10
  41. package/dist/charts/useChartInteraction.js +72 -12
  42. package/dist/chips/Chip.d.ts +20 -1
  43. package/dist/chips/Chip.js +9 -1
  44. package/dist/containers/FlexItem.d.ts +14 -12
  45. package/dist/containers/FlexItem.js +4 -0
  46. package/dist/containers/FlexWrapper.d.ts +29 -96
  47. package/dist/containers/FlexWrapper.js +12 -0
  48. package/dist/containers/GridWrapper.d.ts +25 -66
  49. package/dist/containers/GridWrapper.js +8 -0
  50. package/dist/containers/Spacing.d.ts +10 -0
  51. package/dist/containers/Spacing.js +7 -0
  52. package/dist/containers/Wrapper.d.ts +11 -1
  53. package/dist/containers/Wrapper.js +4 -0
  54. package/dist/dividers/HorizontalDivider.d.ts +2 -0
  55. package/dist/dividers/HorizontalDivider.js +1 -0
  56. package/dist/dividers/VerticalDivider.d.ts +4 -0
  57. package/dist/dividers/VerticalDivider.js +4 -0
  58. package/dist/drawer/Drawer.d.ts +11 -4
  59. package/dist/drawer/Drawer.js +7 -0
  60. package/dist/dropdown/Dropdown.d.ts +24 -0
  61. package/dist/dropdown/Dropdown.js +9 -0
  62. package/dist/editor/CodeEditor.d.ts +23 -42
  63. package/dist/editor/CodeEditor.js +9 -1
  64. package/dist/hooks/useDismiss.d.ts +6 -0
  65. package/dist/hooks/useDismiss.js +6 -0
  66. package/dist/hooks/useElementClientSize.d.ts +2 -2
  67. package/dist/hooks/useResize.d.ts +5 -2
  68. package/dist/icons/GalaxyLogomark.d.ts +9 -1
  69. package/dist/icons/GalaxyLogomark.js +7 -1
  70. package/dist/icons/GalaxyLogomark3D.d.ts +15 -0
  71. package/dist/icons/GalaxyLogomark3D.js +9 -0
  72. package/dist/icons/GalaxyLogomarkAnimation.d.ts +10 -0
  73. package/dist/icons/GalaxyLogomarkAnimation.js +7 -1
  74. package/dist/icons/GalaxyWordmark.d.ts +7 -1
  75. package/dist/icons/GalaxyWordmark.js +5 -1
  76. package/dist/icons/Icon.d.ts +10 -0
  77. package/dist/icons/Icon.js +5 -0
  78. package/dist/inputs/CheckboxInput.d.ts +13 -0
  79. package/dist/inputs/CheckboxInput.js +8 -0
  80. package/dist/inputs/ColorInput.d.ts +15 -0
  81. package/dist/inputs/ColorInput.js +6 -0
  82. package/dist/inputs/CopyInput.d.ts +9 -0
  83. package/dist/inputs/CopyInput.js +4 -0
  84. package/dist/inputs/DateInput.d.ts +13 -0
  85. package/dist/inputs/DateInput.js +5 -0
  86. package/dist/inputs/Input.d.ts +37 -0
  87. package/dist/inputs/Input.js +13 -0
  88. package/dist/inputs/MultiSelectInput.d.ts +26 -0
  89. package/dist/inputs/MultiSelectInput.js +6 -0
  90. package/dist/inputs/MultiTextInput.d.ts +16 -0
  91. package/dist/inputs/MultiTextInput.js +9 -0
  92. package/dist/inputs/NumberInput.d.ts +7 -1
  93. package/dist/inputs/NumberInput.js +5 -0
  94. package/dist/inputs/PasswordInput.d.ts +9 -1
  95. package/dist/inputs/PasswordInput.js +4 -0
  96. package/dist/inputs/RadioInput.d.ts +13 -0
  97. package/dist/inputs/RadioInput.js +8 -0
  98. package/dist/inputs/SelectInput.d.ts +30 -0
  99. package/dist/inputs/SelectInput.js +8 -0
  100. package/dist/inputs/SliderInput.d.ts +15 -0
  101. package/dist/inputs/SliderInput.js +6 -0
  102. package/dist/inputs/SwitcherInput.d.ts +10 -1
  103. package/dist/inputs/SwitcherInput.js +4 -0
  104. package/dist/inputs/TextAreaInput.d.ts +24 -0
  105. package/dist/inputs/TextAreaInput.js +9 -0
  106. package/dist/inputs/TextInput.d.ts +8 -1
  107. package/dist/inputs/TextInput.js +6 -0
  108. package/dist/inputs/ToggleInput.d.ts +11 -0
  109. package/dist/inputs/ToggleInput.js +6 -0
  110. package/dist/lists/BulletedList.d.ts +4 -0
  111. package/dist/lists/BulletedList.js +2 -0
  112. package/dist/modal/Modal.d.ts +8 -0
  113. package/dist/modal/Modal.js +6 -0
  114. package/dist/overlay/OverlayProvider.d.ts +11 -0
  115. package/dist/overlay/OverlayProvider.js +7 -0
  116. package/dist/overlay/constants.d.ts +1 -0
  117. package/dist/overlay/constants.js +1 -0
  118. package/dist/overlay/useOverlay.d.ts +11 -0
  119. package/dist/overlay/useOverlay.js +9 -0
  120. package/dist/resizable/HorizontalResizeHandle.d.ts +8 -1
  121. package/dist/resizable/HorizontalResizeHandle.js +6 -0
  122. package/dist/resizable/VerticalResizeHandle.d.ts +8 -1
  123. package/dist/resizable/VerticalResizeHandle.js +6 -0
  124. package/dist/shapes/Circle.d.ts +4 -1
  125. package/dist/shapes/Circle.js +1 -0
  126. package/dist/shapes/Square.d.ts +4 -1
  127. package/dist/shapes/Square.js +1 -0
  128. package/dist/styles.css +14 -14
  129. package/dist/table/InfiniteSpreadsheet.d.ts +7 -0
  130. package/dist/table/InfiniteSpreadsheet.js +7 -0
  131. package/dist/table/InfiniteTable.d.ts +8 -0
  132. package/dist/table/InfiniteTable.js +8 -0
  133. package/dist/table/VirtualizedInfiniteTable.d.ts +7 -0
  134. package/dist/table/VirtualizedInfiniteTable.js +7 -0
  135. package/dist/text/Bold.d.ts +4 -0
  136. package/dist/text/Bold.js +4 -0
  137. package/dist/text/Code.d.ts +4 -0
  138. package/dist/text/Code.js +4 -0
  139. package/dist/text/EditableText.d.ts +10 -1
  140. package/dist/text/EditableText.js +7 -0
  141. package/dist/text/Ellipsis.d.ts +6 -4
  142. package/dist/text/Ellipsis.js +4 -0
  143. package/dist/text/HotKeys.d.ts +10 -0
  144. package/dist/text/HotKeys.js +6 -0
  145. package/dist/text/MarkdownText.d.ts +9 -1
  146. package/dist/text/MarkdownText.js +6 -0
  147. package/dist/text/Paragraph.d.ts +17 -0
  148. package/dist/text/Paragraph.js +7 -0
  149. package/dist/text/RequiredMarker.d.ts +3 -1
  150. package/dist/text/RequiredMarker.js +1 -0
  151. package/dist/text/Selectable.d.ts +4 -0
  152. package/dist/text/Selectable.js +4 -0
  153. package/dist/text/Text.d.ts +19 -0
  154. package/dist/text/Text.js +10 -0
  155. package/dist/text/TextShimmer.d.ts +7 -0
  156. package/dist/text/TextShimmer.js +4 -0
  157. package/dist/theme/GalaxyTheme.d.ts +35 -4
  158. package/dist/theme/GalaxyTheme.js +13 -1
  159. package/dist/theme/constants.d.ts +1 -6
  160. package/dist/theme/constants.js +10 -15
  161. package/dist/theme/index.js +2 -1
  162. package/dist/theme/types.d.ts +21 -0
  163. package/dist/theme/types.js +10 -0
  164. package/dist/toast/Toast.d.ts +11 -0
  165. package/dist/toast/Toast.js +5 -0
  166. package/dist/toast/ToastProvider.d.ts +9 -0
  167. package/dist/toast/ToastProvider.js +4 -0
  168. package/dist/toast/useToast.d.ts +7 -0
  169. package/dist/toast/useToast.js +7 -0
  170. package/dist/tooltip/Tooltip.d.ts +19 -1
  171. package/dist/tooltip/Tooltip.js +9 -0
  172. package/dist/transform/Fade.d.ts +7 -0
  173. package/dist/transform/Fade.js +6 -0
  174. package/dist/transform/Flash.d.ts +4 -0
  175. package/dist/transform/Flash.js +4 -0
  176. package/dist/transform/Rotate.d.ts +7 -0
  177. package/dist/transform/Rotate.js +4 -0
  178. package/dist/transform/ScaleFade.d.ts +7 -0
  179. package/dist/transform/ScaleFade.js +6 -0
  180. package/dist/transform/Spin.d.ts +7 -0
  181. package/dist/transform/Spin.js +5 -0
  182. package/dist/widget/Widget.d.ts +18 -1
  183. package/dist/widget/Widget.js +5 -0
  184. package/package.json +1 -1
@@ -2,10 +2,17 @@ import { type Ref } from "react";
2
2
  import { type Icon as PhosphorIcon } from "@phosphor-icons/react";
3
3
  export interface InputLabelProps {
4
4
  label: string;
5
+ /** Adds an info icon beside the label with this content on hover. */
5
6
  labelTooltip?: string | React.ReactNode;
7
+ /** Appends the red required asterisk. */
6
8
  isRequired?: boolean;
7
9
  }
10
+ /**
11
+ * The label row every input renders above itself. Exported for building custom
12
+ * inputs that should match — the stock inputs render it from their own props.
13
+ */
8
14
  export declare const InputLabel: ({ label, labelTooltip, isRequired }: InputLabelProps) => import("react").JSX.Element;
15
+ /** Field height — 24 / 28 / 32px, matching `ButtonSize` so they line up in a row. */
9
16
  export declare enum InputSize {
10
17
  SMALL = "SMALL",
11
18
  MEDIUM = "MEDIUM",
@@ -55,39 +62,69 @@ export declare const StyledInput: import("react").ComponentType<Pick<import("rea
55
62
  } & {
56
63
  as?: React.ElementType;
57
64
  }>, {}>;
65
+ /** What an `Input` can hold. Narrowed by each wrapper — `string`, `number`, … */
58
66
  export type InputValue = string | number | readonly string[] | undefined;
67
+ /**
68
+ * The shared prop surface for every text-like input. The concrete wrappers
69
+ * (`TextInput`, `PasswordInput`, `NumberInput`, …) are `Omit`s of this, so their
70
+ * props are documented here.
71
+ */
59
72
  export interface InputProps<T> {
73
+ /** Coerces the raw string from the DOM into `T` before `onChange`. Wrappers set it. */
60
74
  parse: (value: T) => T;
75
+ /** Called with the parsed value on every keystroke. */
61
76
  onChange: (value: T) => void;
77
+ /** @default InputSize.MEDIUM */
62
78
  size?: InputSize;
79
+ /** The underlying `<input type>`. Wrappers set it. */
63
80
  type: HTMLInputElement["type"];
81
+ /** Controlled value. */
64
82
  value?: T;
65
83
  placeholder?: string;
84
+ /** Decorative icon inside the left edge. Give it `onClick` to make it a button. */
66
85
  leading?: {
67
86
  icon: PhosphorIcon;
68
87
  onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
69
88
  };
89
+ /** Action button inside the right edge — clear, reveal, copy. */
70
90
  trailing?: {
71
91
  icon: PhosphorIcon;
72
92
  onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
73
93
  isDisabled?: boolean;
74
94
  };
95
+ /** Label rendered above the field. */
75
96
  label?: string;
97
+ /** Adds an info icon beside the label with this content on hover. */
76
98
  labelTooltip?: string | React.ReactNode;
99
+ /** Message shown under the field; also switches the border to the error color. */
77
100
  error?: string;
101
+ /** Appends the red required asterisk to the label. */
78
102
  isRequired?: boolean;
79
103
  isDisabled?: boolean;
80
104
  autoFocus?: boolean;
105
+ /** Numeric bounds — only meaningful when `type` is "number". */
81
106
  min?: number;
82
107
  max?: number;
108
+ /** Stepper increment. Only meaningful when `type` is "number". */
83
109
  step?: number;
84
110
  onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
85
111
  onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
86
112
  onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
113
+ /** A number is px. Ignored when `fillWidth` is set. */
87
114
  width?: number | string;
115
+ /** Stretch to the parent's width. */
88
116
  fillWidth?: boolean;
117
+ /** Render the value in the mono family — for IDs, keys, and code. */
89
118
  isMonospace?: boolean;
90
119
  }
120
+ /**
121
+ * The generic text field every typed input wraps. Renders the label, the field,
122
+ * the leading/trailing affordances and the error line.
123
+ *
124
+ * Prefer a concrete wrapper — `TextInput`, `PasswordInput`, `NumberInput` — which
125
+ * pin `type` and `parse` for you. Use this directly only for a value type none of
126
+ * them cover.
127
+ */
91
128
  declare const Input: <T extends InputValue>(props: InputProps<T> & {
92
129
  ref?: Ref<HTMLInputElement>;
93
130
  }) => React.ReactElement;
@@ -13,6 +13,10 @@ import { forwardRef } from "react";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
14
  import { InfoIcon } from "@phosphor-icons/react";
15
15
  //#region src/inputs/Input.tsx
16
+ /**
17
+ * The label row every input renders above itself. Exported for building custom
18
+ * inputs that should match — the stock inputs render it from their own props.
19
+ */
16
20
  var InputLabel = ({ label, labelTooltip, isRequired }) => {
17
21
  return /* @__PURE__ */ jsxs(FlexWrapper, {
18
22
  alignItems: AlignItems.CENTER,
@@ -38,6 +42,7 @@ var InputLabel = ({ label, labelTooltip, isRequired }) => {
38
42
  ]
39
43
  });
40
44
  };
45
+ /** Field height — 24 / 28 / 32px, matching `ButtonSize` so they line up in a row. */
41
46
  var InputSize = /* @__PURE__ */ function(InputSize) {
42
47
  InputSize["SMALL"] = "SMALL";
43
48
  InputSize["MEDIUM"] = "MEDIUM";
@@ -127,6 +132,14 @@ var INPUT_SIZE_TO_ICON_SIZE_MAP = {
127
132
  ["MEDIUM"]: 14,
128
133
  ["LARGE"]: 14
129
134
  };
135
+ /**
136
+ * The generic text field every typed input wraps. Renders the label, the field,
137
+ * the leading/trailing affordances and the error line.
138
+ *
139
+ * Prefer a concrete wrapper — `TextInput`, `PasswordInput`, `NumberInput` — which
140
+ * pin `type` and `parse` for you. Use this directly only for a value type none of
141
+ * them cover.
142
+ */
130
143
  var Input = forwardRef(({ parse, onChange, size = "MEDIUM", type, value, label, labelTooltip, error, placeholder, leading, trailing, isRequired, isDisabled, autoFocus, min, max, step, onFocus, onBlur, onKeyDown, width, fillWidth, isMonospace }, ref) => {
131
144
  const handleChange = (e) => {
132
145
  onChange(parse(e.target.value));
@@ -6,34 +6,60 @@ import { SelectInputVariant, type SelectInputOption } from "./SelectInput";
6
6
  export interface PinnedOptions {
7
7
  id: string;
8
8
  label: string;
9
+ /** The `SelectInputOption.id`s this shortcut selects, all at once. */
9
10
  optionIds: string[];
10
11
  }
11
12
  export interface MultiSelectInputProps {
12
13
  label?: string;
14
+ /** Phosphor icon *component* on the trigger. */
13
15
  icon?: PhosphorIcon;
16
+ /** @default SelectInputVariant.PRIMARY */
14
17
  variant?: SelectInputVariant;
18
+ /** @default InputSize.MEDIUM */
15
19
  size?: InputSize;
20
+ /** Every choice. Order is preserved. */
16
21
  options: SelectInputOption[];
22
+ /** Controlled selection. Empty array shows the placeholder. */
17
23
  value: SelectInputOption[];
18
24
  placeholder?: string;
25
+ /** Trigger width. A number is px. */
19
26
  width?: number | string;
20
27
  fillWidth?: boolean;
28
+ /** Panel width. Defaults to matching the trigger. */
21
29
  dropdownWidth?: number | string;
30
+ /** Where the panel opens relative to the trigger. */
22
31
  dropdownPlacement?: DropdownPosition;
32
+ /** Called with the full next selection, not a delta. */
23
33
  onChange?: (value: SelectInputOption[]) => void;
24
34
  isDisabled?: boolean;
25
35
  isRequired?: boolean;
36
+ /** Controlled open state. Pair it with `onOpenChange`. */
26
37
  isOpen?: boolean;
38
+ /** Render `icon` after the label instead of before. */
27
39
  isIconTrailing?: boolean;
28
40
  onOpenChange?: (isOpen: boolean) => void;
41
+ /** Adds a clear button to the trigger. */
29
42
  onReset?: () => void;
43
+ /** Shortcut rows that select several options at once. */
30
44
  pinnedOptions?: PinnedOptions[];
45
+ /** How many selections to name before collapsing to "+N more". */
31
46
  maxDisplayItems?: number;
47
+ /** Replace the trigger's summary string. */
32
48
  renderSelectedText?: (selectedOptions: SelectInputOption[], placeholder: string) => string;
49
+ /** Replace the trigger's summary entirely — chips, avatars, whatever. */
33
50
  renderSelectedContent?: (selectedOptions: SelectInputOption[], placeholder: string) => ReactNode;
51
+ /** Message under the field; also switches the border to the error color. */
34
52
  error?: string;
53
+ /** Supplying this turns the trigger into a search box. Return the filtered list. */
35
54
  onSearch?: (searchTerm: string, options: SelectInputOption[]) => SelectInputOption[];
55
+ /** Debounce before `onSearch` fires, in ms. @default 300 */
36
56
  debounceMs?: number;
37
57
  }
58
+ /**
59
+ * Multi-choice dropdown. Same option shape and search contract as `SelectInput`,
60
+ * but the panel stays open across picks and the trigger summarizes what's chosen.
61
+ *
62
+ * Controlled: `onChange` hands back the complete next selection, not a delta.
63
+ */
38
64
  declare const MultiSelectInput: ({ label, icon, variant, size, options, value, placeholder, onChange, width, fillWidth, dropdownWidth, dropdownPlacement, isDisabled, isRequired, isOpen: controlledIsOpen, isIconTrailing, onOpenChange, onReset, pinnedOptions, maxDisplayItems, renderSelectedText, renderSelectedContent, error, onSearch, debounceMs, }: MultiSelectInputProps) => import("react").JSX.Element;
39
65
  export default MultiSelectInput;
@@ -131,6 +131,12 @@ var SELECT_INPUT_VARIANT_TO_CHECKBOX_INPUT_VARIANT = {
131
131
  [SelectInputVariant.SECONDARY]: CheckboxInputVariant.SECONDARY,
132
132
  [SelectInputVariant.TERTIARY]: CheckboxInputVariant.PRIMARY
133
133
  };
134
+ /**
135
+ * Multi-choice dropdown. Same option shape and search contract as `SelectInput`,
136
+ * but the panel stays open across picks and the trigger summarizes what's chosen.
137
+ *
138
+ * Controlled: `onChange` hands back the complete next selection, not a delta.
139
+ */
134
140
  var MultiSelectInput = ({ label, icon, variant = SelectInputVariant.PRIMARY, size = InputSize.MEDIUM, options, value, placeholder = "Select options...", onChange, width, fillWidth, dropdownWidth, dropdownPlacement = DropdownPosition.BOTTOM_START, isDisabled = false, isRequired = false, isOpen: controlledIsOpen, isIconTrailing, onOpenChange, onReset, pinnedOptions = [], maxDisplayItems = 3, renderSelectedText, renderSelectedContent, error, onSearch, debounceMs = 300 }) => {
135
141
  const isSearchable = !!onSearch;
136
142
  const [isHovered, setIsHovered] = useState(false);
@@ -1,27 +1,43 @@
1
+ /** Field height. */
1
2
  export declare enum MultiTextInputSize {
2
3
  SMALL = "SMALL",
3
4
  MEDIUM = "MEDIUM",
4
5
  LARGE = "LARGE"
5
6
  }
7
+ /** Color of the chips created from entered values. */
6
8
  export declare enum MultiTextInputVariant {
7
9
  PRIMARY = "PRIMARY",
8
10
  SECONDARY = "SECONDARY",
9
11
  TERTIARY = "TERTIARY"
10
12
  }
11
13
  export interface MultiTextInputProps {
14
+ /** Controlled list of entered values, one chip each. */
12
15
  value: string[];
16
+ /** Called with the full next list, not a delta. */
13
17
  onChange: (value: string[]) => void;
18
+ /** @default MultiTextInputVariant.PRIMARY */
14
19
  variant?: MultiTextInputVariant;
20
+ /** @default MultiTextInputSize.MEDIUM */
15
21
  size?: MultiTextInputSize;
16
22
  placeholder?: string;
17
23
  label?: string;
24
+ /** Message under the field; also switches the border to the error color. */
18
25
  error?: string;
19
26
  isRequired?: boolean;
20
27
  isDisabled?: boolean;
21
28
  autoFocus?: boolean;
29
+ /** A number is px. Ignored when `fillWidth` is set. */
22
30
  width?: number | string;
23
31
  fillWidth?: boolean;
32
+ /** Typing this character commits the draft as a chip. @default "," */
24
33
  separator?: string;
25
34
  }
35
+ /**
36
+ * A free-text field that turns each entry into a removable chip — tags, emails,
37
+ * arbitrary lists. Commit with Enter or the `separator` character.
38
+ *
39
+ * The in-progress draft is internal state and is *not* part of `value`; it only
40
+ * lands there once committed.
41
+ */
26
42
  declare const MultiTextInput: import("react").ForwardRefExoticComponent<MultiTextInputProps & import("react").RefAttributes<HTMLInputElement>>;
27
43
  export default MultiTextInput;
@@ -10,12 +10,14 @@ import { match } from "ts-pattern";
10
10
  import { forwardRef, useCallback, useRef, useState } from "react";
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
  //#region src/inputs/MultiTextInput.tsx
13
+ /** Field height. */
13
14
  var MultiTextInputSize = /* @__PURE__ */ function(MultiTextInputSize) {
14
15
  MultiTextInputSize["SMALL"] = "SMALL";
15
16
  MultiTextInputSize["MEDIUM"] = "MEDIUM";
16
17
  MultiTextInputSize["LARGE"] = "LARGE";
17
18
  return MultiTextInputSize;
18
19
  }({});
20
+ /** Color of the chips created from entered values. */
19
21
  var MultiTextInputVariant = /* @__PURE__ */ function(MultiTextInputVariant) {
20
22
  MultiTextInputVariant["PRIMARY"] = "PRIMARY";
21
23
  MultiTextInputVariant["SECONDARY"] = "SECONDARY";
@@ -76,6 +78,13 @@ var StyledInput = withTheme(/*#__PURE__*/ styled("input")({
76
78
  "s190irv4-5": [_exp12()]
77
79
  }
78
80
  }));
81
+ /**
82
+ * A free-text field that turns each entry into a removable chip — tags, emails,
83
+ * arbitrary lists. Commit with Enter or the `separator` character.
84
+ *
85
+ * The in-progress draft is internal state and is *not* part of `value`; it only
86
+ * lands there once committed.
87
+ */
79
88
  var MultiTextInput = forwardRef(({ value, onChange, variant = "PRIMARY", size = "MEDIUM", placeholder, label, error, isRequired, isDisabled, autoFocus, width, fillWidth, separator = "," }, ref) => {
80
89
  const [inputValue, setInputValue] = useState("");
81
90
  const [isFocused, setIsFocused] = useState(false);
@@ -1,4 +1,10 @@
1
1
  import { type InputProps } from "./Input";
2
- type NumberInputProps = Omit<InputProps<number>, "type" | "parse">;
2
+ /** Every `InputProps` field except `type` and `parse`, which are fixed to number. */
3
+ export type NumberInputProps = Omit<InputProps<number>, "type" | "parse">;
4
+ /**
5
+ * A numeric field. `min`/`max` are a real numeric range here (unlike `TextInput`,
6
+ * where they bound character count) and values outside it are clamped, not
7
+ * rejected — `onChange` only ever sees an in-range number.
8
+ */
3
9
  declare const NumberInput: ({ value, placeholder, label, size, leading, trailing, isRequired, isDisabled, min, max, step, onChange, width, fillWidth, }: NumberInputProps) => import("react").JSX.Element;
4
10
  export default NumberInput;
@@ -2,6 +2,11 @@ import Input from "./Input.js";
2
2
  import { useCallback } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  //#region src/inputs/NumberInput.tsx
5
+ /**
6
+ * A numeric field. `min`/`max` are a real numeric range here (unlike `TextInput`,
7
+ * where they bound character count) and values outside it are clamped, not
8
+ * rejected — `onChange` only ever sees an in-range number.
9
+ */
5
10
  var NumberInput = ({ value, placeholder, label, size, leading, trailing, isRequired, isDisabled, min, max, step, onChange, width, fillWidth }) => {
6
11
  return /* @__PURE__ */ jsx(Input, {
7
12
  type: "number",
@@ -1,4 +1,12 @@
1
1
  import { type InputProps } from "./Input";
2
- type PasswordInputProps = Omit<InputProps<string>, "type" | "parse" | "action">;
2
+ /**
3
+ * Every `InputProps` field except `type` and `parse`, which are fixed. The
4
+ * trailing slot is used by the reveal toggle, so passing `trailing` has no effect.
5
+ */
6
+ export type PasswordInputProps = Omit<InputProps<string>, "type" | "parse" | "action">;
7
+ /**
8
+ * A masked text field with a built-in reveal toggle in the trailing slot.
9
+ * Toggling only flips the DOM `type` — the value is never transformed.
10
+ */
3
11
  declare const PasswordInput: import("react").ForwardRefExoticComponent<PasswordInputProps & import("react").RefAttributes<HTMLInputElement>>;
4
12
  export default PasswordInput;
@@ -4,6 +4,10 @@ import { jsx } from "react/jsx-runtime";
4
4
  import { EyeIcon, EyeSlashIcon } from "@phosphor-icons/react";
5
5
  //#region src/inputs/PasswordInput.tsx
6
6
  var DEFAULT_STATE = { showPassword: false };
7
+ /**
8
+ * A masked text field with a built-in reveal toggle in the trailing slot.
9
+ * Toggling only flips the DOM `type` — the value is never transformed.
10
+ */
7
11
  var PasswordInput = forwardRef(({ size = InputSize.MEDIUM, value, placeholder, label, leading, error, isRequired, isDisabled, autoFocus, onChange, width, fillWidth, onKeyDown, onBlur, onFocus }, ref) => {
8
12
  const [state, setState] = useState(DEFAULT_STATE);
9
13
  return /* @__PURE__ */ jsx(Input, {
@@ -1,20 +1,33 @@
1
+ /** Fill color of the dot when selected. */
1
2
  export declare enum RadioInputVariant {
2
3
  PRIMARY = "PRIMARY",
3
4
  SECONDARY = "SECONDARY"
4
5
  }
6
+ /** Circle size. Two steps only — this is a hit target, not a type scale. */
5
7
  export declare enum RadioInputSize {
6
8
  SMALL = "SMALL",
7
9
  MEDIUM = "MEDIUM"
8
10
  }
9
11
  export interface RadioInputProps {
12
+ /** @default RadioInputVariant.PRIMARY */
10
13
  variant?: RadioInputVariant;
14
+ /** @default RadioInputSize.MEDIUM */
11
15
  size?: RadioInputSize;
16
+ /** Controlled state. The radio holds none of its own. */
12
17
  isSelected: boolean;
18
+ /** Text beside the circle. */
13
19
  label?: string;
20
+ /** Adds an info icon beside the label with this content on hover. */
14
21
  labelTooltip?: string | React.ReactNode;
15
22
  isRequired?: boolean;
16
23
  isDisabled?: boolean;
17
24
  onChange: (selected: boolean) => void;
18
25
  }
26
+ /**
27
+ * A single radio button with an optional label. Fully controlled.
28
+ *
29
+ * There is no group component — render several and enforce single-selection in
30
+ * your own state.
31
+ */
19
32
  declare const RadioInput: ({ variant, size, isSelected, label, labelTooltip, isRequired, isDisabled, onChange, }: RadioInputProps) => import("react").JSX.Element;
20
33
  export default RadioInput;
@@ -11,11 +11,13 @@ import { match } from "ts-pattern";
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import { InfoIcon } from "@phosphor-icons/react";
13
13
  //#region src/inputs/RadioInput.tsx
14
+ /** Fill color of the dot when selected. */
14
15
  var RadioInputVariant = /* @__PURE__ */ function(RadioInputVariant) {
15
16
  RadioInputVariant["PRIMARY"] = "PRIMARY";
16
17
  RadioInputVariant["SECONDARY"] = "SECONDARY";
17
18
  return RadioInputVariant;
18
19
  }({});
20
+ /** Circle size. Two steps only — this is a hit target, not a type scale. */
19
21
  var RadioInputSize = /* @__PURE__ */ function(RadioInputSize) {
20
22
  RadioInputSize["SMALL"] = "SMALL";
21
23
  RadioInputSize["MEDIUM"] = "MEDIUM";
@@ -68,6 +70,12 @@ var RadioDot = withTheme(/*#__PURE__*/ styled("div")({
68
70
  "r137y8ev-3": [_exp10()]
69
71
  }
70
72
  }));
73
+ /**
74
+ * A single radio button with an optional label. Fully controlled.
75
+ *
76
+ * There is no group component — render several and enforce single-selection in
77
+ * your own state.
78
+ */
71
79
  var RadioInput = ({ variant = "PRIMARY", size = "MEDIUM", isSelected, label, labelTooltip, isRequired = false, isDisabled = false, onChange }) => {
72
80
  const handleClick = () => {
73
81
  if (!isDisabled) onChange(!isSelected);
@@ -1,47 +1,77 @@
1
1
  import { IconVariant } from "../icons/Icon";
2
2
  import { TextSize, TextVariant } from "../text/Text";
3
3
  import { InputSize } from "./Input";
4
+ /** Surface treatment of the closed trigger. Shared with `MultiSelectInput`. */
4
5
  export declare enum SelectInputVariant {
5
6
  BASE = "BASE",
6
7
  PRIMARY = "PRIMARY",
7
8
  SECONDARY = "SECONDARY",
8
9
  TERTIARY = "TERTIARY"
9
10
  }
11
+ /** One choice in a select. */
10
12
  export interface SelectInputOption {
13
+ /** Stable identity — selection is matched on this, not on `value`. */
11
14
  id: string;
15
+ /** What the user reads. */
12
16
  label: string;
17
+ /** Your payload. Never inspected by the component. */
13
18
  value: unknown;
19
+ /** Leading graphic, rendered as-is. */
14
20
  icon?: React.ReactNode;
21
+ /** Color role for the label — for status-coded options. */
15
22
  variant?: TextVariant;
16
23
  }
24
+ /** A shortcut row pinned above the option list. */
17
25
  export interface PinnedOption {
18
26
  id: string;
19
27
  label: string;
28
+ /** The `SelectInputOption.id` this shortcut selects. */
20
29
  optionId: string;
21
30
  }
22
31
  export interface SelectInputProps {
23
32
  label?: string;
33
+ /** @default SelectInputVariant.PRIMARY */
24
34
  variant?: SelectInputVariant;
35
+ /** @default InputSize.MEDIUM */
25
36
  size?: InputSize;
37
+ /** Every choice. Order is preserved. */
26
38
  options: SelectInputOption[];
39
+ /** Controlled selection. `null` shows the placeholder. */
27
40
  value?: SelectInputOption | null;
41
+ /** @default "Select an option..." */
28
42
  placeholder?: string;
43
+ /** Called with the whole option, not just its id. */
29
44
  onChange?: (value: SelectInputOption) => void;
45
+ /** Trigger width. A number is px. */
30
46
  width?: number | string;
31
47
  fillWidth?: boolean;
48
+ /** Panel width. Defaults to matching the trigger. */
32
49
  dropdownWidth?: number | string;
33
50
  isDisabled?: boolean;
34
51
  isRequired?: boolean;
52
+ /** Controlled open state. Pair it with `onOpenChange`. */
35
53
  isOpen?: boolean;
36
54
  onOpenChange?: (isOpen: boolean) => void;
55
+ /** Adds a clear button to the trigger. Omit and the selection can't be cleared. */
37
56
  onReset?: () => void;
57
+ /** Shortcut rows above the list — "All", "None", a recent choice. */
38
58
  pinnedOptions?: PinnedOption[];
59
+ /** Message under the field; also switches the border to the error color. */
39
60
  error?: string;
61
+ /** Supplying this turns the trigger into a search box. Return the filtered list. */
40
62
  onSearch?: (searchTerm: string, options: SelectInputOption[]) => SelectInputOption[];
63
+ /** Debounce before `onSearch` fires, in ms. @default 300 */
41
64
  debounceMs?: number;
42
65
  }
43
66
  export declare const SELECT_INPUT_VARIANT_TO_ICON_VARIANT_MAP: Record<SelectInputVariant, IconVariant>;
44
67
  export declare const SELECT_INPUT_SIZE_TO_ICON_SIZE: Record<InputSize, number>;
45
68
  export declare const SELECT_INPUT_SIZE_TO_TEXT_SIZE_MAP: Record<InputSize, TextSize>;
69
+ /**
70
+ * Single-choice dropdown with keyboard navigation and optional search.
71
+ *
72
+ * Controlled: `value` is the selected option and `onChange` hands you the whole
73
+ * option back. Passing `onSearch` turns the trigger into a search box — you own
74
+ * the filtering, so it works equally well against a local list or a server.
75
+ */
46
76
  declare const SelectInput: ({ label, variant, size, options, value, placeholder, onChange, width, fillWidth, dropdownWidth, isDisabled, isRequired, isOpen: controlledIsOpen, onOpenChange, onReset, pinnedOptions, error, onSearch, debounceMs, }: SelectInputProps) => import("react").JSX.Element;
47
77
  export default SelectInput;
@@ -18,6 +18,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
18
18
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
19
19
  import { ArrowCounterClockwiseIcon, CaretDownIcon, CheckIcon } from "@phosphor-icons/react";
20
20
  //#region src/inputs/SelectInput.tsx
21
+ /** Surface treatment of the closed trigger. Shared with `MultiSelectInput`. */
21
22
  var SelectInputVariant = /* @__PURE__ */ function(SelectInputVariant) {
22
23
  SelectInputVariant["BASE"] = "BASE";
23
24
  SelectInputVariant["PRIMARY"] = "PRIMARY";
@@ -153,6 +154,13 @@ var SELECT_INPUT_SIZE_TO_TEXT_SIZE_MAP = {
153
154
  [InputSize.MEDIUM]: TextSize.BODY_MD,
154
155
  [InputSize.LARGE]: TextSize.BODY_MD
155
156
  };
157
+ /**
158
+ * Single-choice dropdown with keyboard navigation and optional search.
159
+ *
160
+ * Controlled: `value` is the selected option and `onChange` hands you the whole
161
+ * option back. Passing `onSearch` turns the trigger into a search box — you own
162
+ * the filtering, so it works equally well against a local list or a server.
163
+ */
156
164
  var SelectInput = ({ label, variant = "PRIMARY", size = InputSize.MEDIUM, options, value, placeholder = "Select an option...", onChange, width, fillWidth, dropdownWidth, isDisabled = false, isRequired = false, isOpen: controlledIsOpen, onOpenChange, onReset, pinnedOptions = [], error, onSearch, debounceMs = 300 }) => {
157
165
  const isSearchable = !!onSearch;
158
166
  const [isHovered, setIsHovered] = useState(false);
@@ -1,16 +1,31 @@
1
1
  export interface SliderInputProps {
2
2
  label?: string;
3
+ /** Adds an info icon beside the label with this content on hover. */
3
4
  labelTooltip?: string | React.ReactNode;
5
+ /** Controlled value. Clamped into `[min, max]`. */
4
6
  value: number;
7
+ /** Fires continuously while dragging, not just on release. */
5
8
  onChange: (value: number) => void;
9
+ /** Drag started — useful for pausing an expensive live preview. */
6
10
  onInteractionStart?: () => void;
11
+ /** Drag finished — commit the value here if `onChange` is too chatty. */
7
12
  onInteractionEnd?: () => void;
13
+ /** @default 0 */
8
14
  min?: number;
15
+ /** @default 100 */
9
16
  max?: number;
17
+ /** Increment the thumb snaps to. @default 1 */
10
18
  step?: number;
11
19
  isDisabled?: boolean;
20
+ /** A number is px. */
12
21
  width?: number | string;
13
22
  fillWidth?: boolean;
14
23
  }
24
+ /**
25
+ * A drag-to-set numeric slider. Fully controlled.
26
+ *
27
+ * `onChange` fires on every pointer move. When each change is expensive, drive
28
+ * a preview from it and commit on `onInteractionEnd`.
29
+ */
15
30
  declare const SliderInput: ({ label, labelTooltip, value, onChange, onInteractionStart, onInteractionEnd, min, max, step, isDisabled, width, fillWidth, }: SliderInputProps) => import("react").JSX.Element;
16
31
  export default SliderInput;
@@ -58,6 +58,12 @@ var HiddenInput = /*#__PURE__*/ styled("input")({
58
58
  class: "h1trli0w",
59
59
  propsAsIs: false
60
60
  });
61
+ /**
62
+ * A drag-to-set numeric slider. Fully controlled.
63
+ *
64
+ * `onChange` fires on every pointer move. When each change is expensive, drive
65
+ * a preview from it and commit on `onInteractionEnd`.
66
+ */
61
67
  var SliderInput = ({ label, labelTooltip, value, onChange, onInteractionStart, onInteractionEnd, min = 0, max = 100, step = 1, isDisabled = false, width, fillWidth }) => {
62
68
  const [isDragging, setIsDragging] = useState(false);
63
69
  const sliderRef = useRef(null);
@@ -1,13 +1,22 @@
1
1
  import { InputSize } from "./Input";
2
2
  export interface SwitcherInputItem {
3
+ /** Matched against `selectedId` to decide which segment is active. */
3
4
  id: string;
4
5
  label: string;
6
+ /** Called when this segment is clicked. Update `selectedId` yourself. */
5
7
  onClick: () => void;
6
8
  }
7
- interface SwitcherInputProps {
9
+ export interface SwitcherInputProps {
10
+ /** @default InputSize.MEDIUM */
8
11
  size?: InputSize;
12
+ /** Segments, left to right. */
9
13
  items: SwitcherInputItem[];
14
+ /** The `id` of the active segment. Controlled — nothing moves until this changes. */
10
15
  selectedId: string;
11
16
  }
17
+ /**
18
+ * A segmented control for switching between a few mutually exclusive views.
19
+ * Each item carries its own `onClick`, so there is no top-level change handler.
20
+ */
12
21
  declare const SwitcherInput: ({ size, items, selectedId }: SwitcherInputProps) => import("react").JSX.Element;
13
22
  export default SwitcherInput;
@@ -40,6 +40,10 @@ var StyledSwitcherInputItem = withTheme(/*#__PURE__*/ styled("div")({
40
40
  "s1pe4aqp-2": [_exp7()]
41
41
  }
42
42
  }));
43
+ /**
44
+ * A segmented control for switching between a few mutually exclusive views.
45
+ * Each item carries its own `onClick`, so there is no top-level change handler.
46
+ */
43
47
  var SwitcherInput = ({ size = InputSize.MEDIUM, items, selectedId }) => {
44
48
  return /* @__PURE__ */ jsx(StyledSwitcherInput, {
45
49
  $size: size,
@@ -1,8 +1,10 @@
1
+ /** Text size and inset density. Row count comes from `lines`, not from this. */
1
2
  export declare enum TextAreaSize {
2
3
  SMALL = "SMALL",
3
4
  MEDIUM = "MEDIUM",
4
5
  LARGE = "LARGE"
5
6
  }
7
+ /** Background treatment. `TRANSPARENT` is for embedding in an existing surface. */
6
8
  export declare enum TextAreaVariant {
7
9
  TRANSPARENT = "TRANSPARENT",
8
10
  BASE = "BASE",
@@ -11,30 +13,52 @@ export declare enum TextAreaVariant {
11
13
  TERTIARY = "TERTIARY"
12
14
  }
13
15
  export interface TextAreaInputProps {
16
+ /** Controlled value. */
14
17
  value?: string;
15
18
  onChange: (value: string) => void;
19
+ /** @default TextAreaVariant.PRIMARY */
16
20
  variant?: TextAreaVariant;
21
+ /** @default TextAreaSize.MEDIUM */
17
22
  size?: TextAreaSize;
23
+ /** Visible rows before scrolling. @default 3 */
18
24
  lines?: number;
19
25
  placeholder?: string;
20
26
  label?: string;
27
+ /** Adds an info icon beside the label with this content on hover. */
21
28
  labelTooltip?: string | React.ReactNode;
29
+ /** Message under the field; also switches the border to the error color. */
22
30
  error?: string;
31
+ /** Appends the red required asterisk. Note: `required`, not `isRequired`. */
23
32
  required?: boolean;
33
+ /** Note: `disabled`, not `isDisabled` — this input predates the `is` convention. */
24
34
  disabled?: boolean;
25
35
  autoFocus?: boolean;
36
+ /** Character-count bounds, validated on blur. Not a numeric range. */
26
37
  min?: number;
27
38
  max?: number;
28
39
  onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
29
40
  onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
30
41
  onKeyDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
42
+ /** A number is px. */
31
43
  width?: number | string;
44
+ /** A number is px. Overrides the height implied by `lines`. */
32
45
  height?: number | string;
33
46
  fillWidth?: boolean;
47
+ /** Grow to the parent's height. Pairs with a flex parent. */
34
48
  fillHeight?: boolean;
49
+ /** Drop the hairline border. */
35
50
  noBorder?: boolean;
51
+ /** Collapse the inset to 0. */
36
52
  noPadding?: boolean;
53
+ /** Swap the field for a shimmer placeholder. */
37
54
  isLoading?: boolean;
38
55
  }
56
+ /**
57
+ * A multi-line text field. Not resizable by the user — size it with `lines`,
58
+ * `height`, or `fillHeight`.
59
+ *
60
+ * Note this one takes `required`/`disabled` rather than the `isRequired`/
61
+ * `isDisabled` the other inputs use.
62
+ */
39
63
  declare const TextAreaInput: import("react").ForwardRefExoticComponent<TextAreaInputProps & import("react").RefAttributes<HTMLTextAreaElement>>;
40
64
  export default TextAreaInput;