@galaxy-io/dls 1.4.9 → 1.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) 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.js +3 -1
  20. package/dist/charts/ChartFrame.js +5 -7
  21. package/dist/charts/ChartLegend.js +1 -5
  22. package/dist/charts/ChartPrimitives.d.ts +1 -14
  23. package/dist/charts/ChartPrimitives.js +50 -69
  24. package/dist/charts/DashboardProvider.d.ts +47 -0
  25. package/dist/charts/DashboardProvider.js +52 -0
  26. package/dist/charts/LineChart.js +1 -0
  27. package/dist/charts/ProgressBar.d.ts +13 -1
  28. package/dist/charts/ProgressBar.js +7 -0
  29. package/dist/charts/StatChart.d.ts +10 -1
  30. package/dist/charts/StatChart.js +5 -0
  31. package/dist/charts/constants.d.ts +4 -18
  32. package/dist/charts/constants.js +5 -19
  33. package/dist/charts/useChartInteraction.d.ts +25 -8
  34. package/dist/charts/useChartInteraction.js +61 -6
  35. package/dist/chips/Chip.d.ts +20 -1
  36. package/dist/chips/Chip.js +9 -1
  37. package/dist/containers/FlexItem.d.ts +14 -12
  38. package/dist/containers/FlexItem.js +4 -0
  39. package/dist/containers/FlexWrapper.d.ts +29 -96
  40. package/dist/containers/FlexWrapper.js +12 -0
  41. package/dist/containers/GridWrapper.d.ts +25 -66
  42. package/dist/containers/GridWrapper.js +8 -0
  43. package/dist/containers/Spacing.d.ts +10 -0
  44. package/dist/containers/Spacing.js +7 -0
  45. package/dist/containers/Wrapper.d.ts +11 -1
  46. package/dist/containers/Wrapper.js +4 -0
  47. package/dist/dividers/HorizontalDivider.d.ts +2 -0
  48. package/dist/dividers/HorizontalDivider.js +1 -0
  49. package/dist/dividers/VerticalDivider.d.ts +4 -0
  50. package/dist/dividers/VerticalDivider.js +4 -0
  51. package/dist/drawer/Drawer.d.ts +11 -4
  52. package/dist/drawer/Drawer.js +7 -0
  53. package/dist/dropdown/Dropdown.d.ts +24 -0
  54. package/dist/dropdown/Dropdown.js +9 -0
  55. package/dist/editor/CodeEditor.d.ts +23 -42
  56. package/dist/editor/CodeEditor.js +9 -1
  57. package/dist/hooks/useDismiss.d.ts +6 -0
  58. package/dist/hooks/useDismiss.js +6 -0
  59. package/dist/hooks/useElementClientSize.d.ts +2 -2
  60. package/dist/hooks/useResize.d.ts +5 -2
  61. package/dist/icons/GalaxyLogomark.d.ts +9 -1
  62. package/dist/icons/GalaxyLogomark.js +7 -1
  63. package/dist/icons/GalaxyLogomark3D.d.ts +15 -0
  64. package/dist/icons/GalaxyLogomark3D.js +9 -0
  65. package/dist/icons/GalaxyLogomarkAnimation.d.ts +10 -0
  66. package/dist/icons/GalaxyLogomarkAnimation.js +7 -1
  67. package/dist/icons/GalaxyWordmark.d.ts +7 -1
  68. package/dist/icons/GalaxyWordmark.js +5 -1
  69. package/dist/icons/Icon.d.ts +10 -0
  70. package/dist/icons/Icon.js +5 -0
  71. package/dist/inputs/CheckboxInput.d.ts +13 -0
  72. package/dist/inputs/CheckboxInput.js +8 -0
  73. package/dist/inputs/ColorInput.d.ts +15 -0
  74. package/dist/inputs/ColorInput.js +6 -0
  75. package/dist/inputs/CopyInput.d.ts +9 -0
  76. package/dist/inputs/CopyInput.js +4 -0
  77. package/dist/inputs/DateInput.d.ts +13 -0
  78. package/dist/inputs/DateInput.js +5 -0
  79. package/dist/inputs/Input.d.ts +37 -0
  80. package/dist/inputs/Input.js +13 -0
  81. package/dist/inputs/MultiSelectInput.d.ts +26 -0
  82. package/dist/inputs/MultiSelectInput.js +6 -0
  83. package/dist/inputs/MultiTextInput.d.ts +16 -0
  84. package/dist/inputs/MultiTextInput.js +9 -0
  85. package/dist/inputs/NumberInput.d.ts +8 -2
  86. package/dist/inputs/NumberInput.js +7 -1
  87. package/dist/inputs/PasswordInput.d.ts +9 -1
  88. package/dist/inputs/PasswordInput.js +4 -0
  89. package/dist/inputs/RadioInput.d.ts +13 -0
  90. package/dist/inputs/RadioInput.js +8 -0
  91. package/dist/inputs/SelectInput.d.ts +30 -0
  92. package/dist/inputs/SelectInput.js +8 -0
  93. package/dist/inputs/SliderInput.d.ts +15 -0
  94. package/dist/inputs/SliderInput.js +6 -0
  95. package/dist/inputs/SwitcherInput.d.ts +10 -1
  96. package/dist/inputs/SwitcherInput.js +4 -0
  97. package/dist/inputs/TextAreaInput.d.ts +24 -0
  98. package/dist/inputs/TextAreaInput.js +9 -0
  99. package/dist/inputs/TextInput.d.ts +8 -1
  100. package/dist/inputs/TextInput.js +6 -0
  101. package/dist/inputs/ToggleInput.d.ts +11 -0
  102. package/dist/inputs/ToggleInput.js +6 -0
  103. package/dist/lists/BulletedList.d.ts +4 -0
  104. package/dist/lists/BulletedList.js +2 -0
  105. package/dist/modal/Modal.d.ts +8 -0
  106. package/dist/modal/Modal.js +6 -0
  107. package/dist/overlay/OverlayProvider.d.ts +11 -0
  108. package/dist/overlay/OverlayProvider.js +7 -0
  109. package/dist/overlay/constants.d.ts +1 -0
  110. package/dist/overlay/constants.js +1 -0
  111. package/dist/overlay/useOverlay.d.ts +11 -0
  112. package/dist/overlay/useOverlay.js +9 -0
  113. package/dist/resizable/HorizontalResizeHandle.d.ts +8 -1
  114. package/dist/resizable/HorizontalResizeHandle.js +6 -0
  115. package/dist/resizable/VerticalResizeHandle.d.ts +8 -1
  116. package/dist/resizable/VerticalResizeHandle.js +6 -0
  117. package/dist/shapes/Circle.d.ts +4 -1
  118. package/dist/shapes/Circle.js +1 -0
  119. package/dist/shapes/Square.d.ts +4 -1
  120. package/dist/shapes/Square.js +1 -0
  121. package/dist/styles.css +20 -21
  122. package/dist/table/InfiniteSpreadsheet.d.ts +7 -0
  123. package/dist/table/InfiniteSpreadsheet.js +7 -0
  124. package/dist/table/InfiniteTable.d.ts +8 -0
  125. package/dist/table/InfiniteTable.js +8 -0
  126. package/dist/table/VirtualizedInfiniteTable.d.ts +7 -0
  127. package/dist/table/VirtualizedInfiniteTable.js +7 -0
  128. package/dist/text/Bold.d.ts +4 -0
  129. package/dist/text/Bold.js +4 -0
  130. package/dist/text/Code.d.ts +4 -0
  131. package/dist/text/Code.js +4 -0
  132. package/dist/text/EditableText.d.ts +10 -1
  133. package/dist/text/EditableText.js +7 -0
  134. package/dist/text/Ellipsis.d.ts +6 -4
  135. package/dist/text/Ellipsis.js +4 -0
  136. package/dist/text/HotKeys.d.ts +10 -0
  137. package/dist/text/HotKeys.js +6 -0
  138. package/dist/text/MarkdownText.d.ts +9 -1
  139. package/dist/text/MarkdownText.js +6 -0
  140. package/dist/text/Paragraph.d.ts +17 -0
  141. package/dist/text/Paragraph.js +7 -0
  142. package/dist/text/RequiredMarker.d.ts +3 -1
  143. package/dist/text/RequiredMarker.js +1 -0
  144. package/dist/text/Selectable.d.ts +4 -0
  145. package/dist/text/Selectable.js +4 -0
  146. package/dist/text/Text.d.ts +19 -0
  147. package/dist/text/Text.js +10 -0
  148. package/dist/text/TextShimmer.d.ts +7 -0
  149. package/dist/text/TextShimmer.js +4 -0
  150. package/dist/theme/GalaxyTheme.d.ts +35 -4
  151. package/dist/theme/GalaxyTheme.js +13 -1
  152. package/dist/theme/constants.d.ts +1 -6
  153. package/dist/theme/constants.js +10 -15
  154. package/dist/theme/index.js +2 -1
  155. package/dist/theme/types.d.ts +21 -0
  156. package/dist/theme/types.js +10 -0
  157. package/dist/toast/Toast.d.ts +11 -0
  158. package/dist/toast/Toast.js +5 -0
  159. package/dist/toast/ToastProvider.d.ts +9 -0
  160. package/dist/toast/ToastProvider.js +4 -0
  161. package/dist/toast/useToast.d.ts +7 -0
  162. package/dist/toast/useToast.js +7 -0
  163. package/dist/tooltip/Tooltip.d.ts +19 -1
  164. package/dist/tooltip/Tooltip.js +9 -0
  165. package/dist/transform/Fade.d.ts +7 -0
  166. package/dist/transform/Fade.js +6 -0
  167. package/dist/transform/Flash.d.ts +4 -0
  168. package/dist/transform/Flash.js +4 -0
  169. package/dist/transform/Rotate.d.ts +7 -0
  170. package/dist/transform/Rotate.js +4 -0
  171. package/dist/transform/ScaleFade.d.ts +7 -0
  172. package/dist/transform/ScaleFade.js +6 -0
  173. package/dist/transform/Spin.d.ts +7 -0
  174. package/dist/transform/Spin.js +5 -0
  175. package/dist/widget/Widget.d.ts +18 -1
  176. package/dist/widget/Widget.js +5 -0
  177. package/package.json +1 -1
@@ -1,7 +1,10 @@
1
1
  import type { PropsWithChildren } from "react";
2
+ /** A length. A number is px; a string is used as-is ("1rem", "auto"). */
2
3
  export type SpacingSize = string | number;
3
4
  export interface SpacingProps {
5
+ /** CSS margin shorthand. An array joins with spaces: `[8, 16]` → `8px 16px`. */
4
6
  margin?: SpacingSize | SpacingSize[];
7
+ /** Single-side margin. Ignored when `margin` is set. */
5
8
  top?: SpacingSize;
6
9
  right?: SpacingSize;
7
10
  bottom?: SpacingSize;
@@ -9,5 +12,12 @@ export interface SpacingProps {
9
12
  fillWidth?: boolean;
10
13
  fillHeight?: boolean;
11
14
  }
15
+ /**
16
+ * Applies margin to its children. Legacy escape hatch — DLS layouts space with
17
+ * `gap` and `padding`, so prefer `FlexWrapper`/`GridWrapper` for new work.
18
+ *
19
+ * `margin` and the per-side props are mutually exclusive: setting `margin` makes
20
+ * `top`/`right`/`bottom`/`left` no-ops.
21
+ */
12
22
  declare const Spacing: ({ children, margin, top, right, bottom, left, fillWidth, fillHeight, }: PropsWithChildren<SpacingProps>) => import("react").JSX.Element;
13
23
  export default Spacing;
@@ -31,6 +31,13 @@ var StyledSpacing = /*#__PURE__*/ styled("div")({
31
31
  "s2h3guw-6": [_exp7()]
32
32
  }
33
33
  });
34
+ /**
35
+ * Applies margin to its children. Legacy escape hatch — DLS layouts space with
36
+ * `gap` and `padding`, so prefer `FlexWrapper`/`GridWrapper` for new work.
37
+ *
38
+ * `margin` and the per-side props are mutually exclusive: setting `margin` makes
39
+ * `top`/`right`/`bottom`/`left` no-ops.
40
+ */
34
41
  var Spacing = ({ children, margin, top, right, bottom, left, fillWidth, fillHeight }) => {
35
42
  if (margin !== void 0) return /* @__PURE__ */ jsx(StyledSpacing, {
36
43
  $margin: getSpacingSizeValueFromShorthand(margin),
@@ -1,16 +1,26 @@
1
1
  import type { PropsWithChildren } from "react";
2
- interface WrapperProps {
2
+ export interface WrapperProps {
3
+ /** @default "static" */
3
4
  position?: React.CSSProperties["position"];
4
5
  minWidth?: number | string;
6
+ /** Doubles as the width when `fillWidth` is off. A number is px. */
5
7
  maxWidth?: number | string;
8
+ /** `width: 100%`. Takes precedence over `maxWidth`. */
6
9
  fillWidth?: boolean;
10
+ /** `height: 100%`. */
7
11
  fillHeight?: boolean;
12
+ /** @default "visible" */
8
13
  overflow?: React.CSSProperties["overflow"];
9
14
  padding?: React.CSSProperties["padding"];
15
+ /** Offset — only applies once `position` is not `static`. */
10
16
  top?: React.CSSProperties["top"];
11
17
  right?: React.CSSProperties["right"];
12
18
  bottom?: React.CSSProperties["bottom"];
13
19
  left?: React.CSSProperties["left"];
14
20
  }
21
+ /**
22
+ * A plain `div` with positioning and sizing props — the escape hatch for when
23
+ * you need a positioned box without flex or grid layout on it.
24
+ */
15
25
  declare const Wrapper: ({ children, position, minWidth, maxWidth, fillWidth, fillHeight, overflow, padding, top, right, bottom, left, }: PropsWithChildren<WrapperProps>) => import("react").JSX.Element;
16
26
  export default Wrapper;
@@ -30,6 +30,10 @@ var StyledWrapper = /*#__PURE__*/ styled("div")({
30
30
  "sck44b4-9": [_exp0()]
31
31
  }
32
32
  });
33
+ /**
34
+ * A plain `div` with positioning and sizing props — the escape hatch for when
35
+ * you need a positioned box without flex or grid layout on it.
36
+ */
33
37
  var Wrapper = ({ children, position, minWidth, maxWidth, fillWidth, fillHeight, overflow, padding, top, right, bottom, left }) => {
34
38
  return /* @__PURE__ */ jsx(StyledWrapper, {
35
39
  $position: position,
@@ -1,5 +1,7 @@
1
1
  export interface HorizontalDividerProps {
2
+ /** Caption centered in a break in the rule. Omit for an unbroken line. */
2
3
  label?: string;
3
4
  }
5
+ /** A full-width 0.5px hairline rule. Borders, not shadows — this is the separator. */
4
6
  declare const HorizontalDivider: ({ label }: HorizontalDividerProps) => import("react").JSX.Element;
5
7
  export default HorizontalDivider;
@@ -22,6 +22,7 @@ var LabeledDividerWrapper = /*#__PURE__*/ styled("div")({
22
22
  class: "l44ah51",
23
23
  propsAsIs: false
24
24
  });
25
+ /** A full-width 0.5px hairline rule. Borders, not shadows — this is the separator. */
25
26
  var HorizontalDivider = ({ label }) => {
26
27
  if (!label) return /* @__PURE__ */ jsx(HorizontalDividerLine, {});
27
28
  return /* @__PURE__ */ jsxs(LabeledDividerWrapper, { children: [
@@ -1,2 +1,6 @@
1
+ /**
2
+ * A 0.5px hairline rule for separating items in a row. Stretches to the height
3
+ * of its flex parent, so it needs one — it has no height of its own.
4
+ */
1
5
  declare const VerticalDivider: () => import("react").JSX.Element;
2
6
  export default VerticalDivider;
@@ -10,6 +10,10 @@ var VerticalDividerWrapper = withTheme(/*#__PURE__*/ styled("div")({
10
10
  propsAsIs: false,
11
11
  vars: { "v1f76t13-0": [_exp()] }
12
12
  }));
13
+ /**
14
+ * A 0.5px hairline rule for separating items in a row. Stretches to the height
15
+ * of its flex parent, so it needs one — it has no height of its own.
16
+ */
13
17
  var VerticalDivider = () => {
14
18
  return /* @__PURE__ */ jsx(VerticalDividerWrapper, {});
15
19
  };
@@ -1,13 +1,20 @@
1
1
  import { type PropsWithChildren } from "react";
2
2
  export interface DrawerProps {
3
+ /** Controlled visibility. The drawer has no open state of its own. */
3
4
  open: boolean;
5
+ /** Called on Escape, and on backdrop click when `closeOnClickOutside` is set. */
4
6
  onClose: () => void;
7
+ /** Panel width. A number is px. @default "60%" */
5
8
  width?: number | string;
6
- /**
7
- * Whether clicking outside the drawer should close it
8
- * @default false
9
- */
9
+ /** Close when the backdrop is clicked. @default false */
10
10
  closeOnClickOutside?: boolean;
11
11
  }
12
+ /**
13
+ * A panel that slides in from the right over a dimmed backdrop. Fully
14
+ * controlled — you own `open`.
15
+ *
16
+ * Stacking and Escape handling come from `OverlayProvider`, so only the topmost
17
+ * overlay closes on Escape. Wrap your app in that provider.
18
+ */
12
19
  declare const Drawer: ({ open, onClose, width, closeOnClickOutside, children, }: PropsWithChildren<DrawerProps>) => import("react").ReactPortal;
13
20
  export default Drawer;
@@ -43,6 +43,13 @@ var DrawerWrapperContentBody = withTheme(/*#__PURE__*/ styled("div")({
43
43
  "d410s14-2": [_exp5()]
44
44
  }
45
45
  }));
46
+ /**
47
+ * A panel that slides in from the right over a dimmed backdrop. Fully
48
+ * controlled — you own `open`.
49
+ *
50
+ * Stacking and Escape handling come from `OverlayProvider`, so only the topmost
51
+ * overlay closes on Escape. Wrap your app in that provider.
52
+ */
46
53
  var Drawer = ({ open, onClose, width, closeOnClickOutside = false, children }) => {
47
54
  const { zIndex, isTopmost } = useOverlay(onClose, open, { layer: OverlayLayer.DRAWER });
48
55
  const handleContentClick = useCallback((e) => {
@@ -1,4 +1,5 @@
1
1
  import { type PropsWithChildren, type ReactNode } from "react";
2
+ /** Surface treatment of the dropdown panel. */
2
3
  export declare enum DropdownVariant {
3
4
  TRANSPARENT = "TRANSPARENT",
4
5
  BASE = "BASE",
@@ -6,6 +7,7 @@ export declare enum DropdownVariant {
6
7
  SECONDARY = "SECONDARY",
7
8
  TERTIARY = "TERTIARY"
8
9
  }
10
+ /** Placement relative to the trigger. The `AUTO_*` values pick a side that fits. */
9
11
  export declare enum DropdownPosition {
10
12
  TOP = "top",
11
13
  BOTTOM = "bottom",
@@ -23,6 +25,7 @@ export declare enum DropdownPosition {
23
25
  AUTO_START = "auto-start",
24
26
  AUTO_END = "auto-end"
25
27
  }
28
+ /** What opens the panel. `MANUAL` hands control entirely to `isOpen`. */
26
29
  export declare enum DropdownTrigger {
27
30
  CLICK = "click",
28
31
  HOVER = "hover",
@@ -30,22 +33,43 @@ export declare enum DropdownTrigger {
30
33
  MANUAL = "manual"
31
34
  }
32
35
  export interface DropdownProps {
36
+ /** @default DropdownVariant.BASE */
33
37
  variant?: DropdownVariant;
38
+ /** Pinned above the scrolling body. */
34
39
  header?: ReactNode;
40
+ /** Panel content. */
35
41
  body: ReactNode;
42
+ /** Pinned below the scrolling body. */
36
43
  footer?: ReactNode;
44
+ /** @default DropdownPosition.BOTTOM_START */
37
45
  position?: DropdownPosition;
46
+ /** `[skidding, distance]` in px from the trigger. @default [0, 6] */
38
47
  offset?: [number, number];
48
+ /** @default DropdownTrigger.CLICK */
39
49
  trigger?: DropdownTrigger;
50
+ /** A number is px. */
40
51
  width?: number | string;
52
+ /** Controlled open state. Pass it together with `onClose`. */
41
53
  isOpen?: boolean;
54
+ /** Called when the panel dismisses itself — Escape, or a click outside. */
42
55
  onClose?: () => void;
43
56
  minWidth?: number | string;
57
+ /** Also clips overflowing content. A number is px. */
44
58
  maxWidth?: number | string;
59
+ /** Stretch the trigger wrapper to the parent's width. */
45
60
  fillWidth?: boolean;
61
+ /** Drop the 4px inset — for panels that host their own layout. */
46
62
  noPadding?: boolean;
63
+ /** Drop the hairline border. */
47
64
  noBorder?: boolean;
65
+ /** Render children bare, with no dropdown at all. */
48
66
  isDisabled?: boolean;
49
67
  }
68
+ /**
69
+ * A panel anchored to a trigger. Children are the trigger.
70
+ *
71
+ * Uncontrolled by default. Pass `isOpen` *and* `onClose` to drive it yourself —
72
+ * useful when a selection inside the body should close it.
73
+ */
50
74
  declare const Dropdown: ({ children, variant, header, body, footer, position, offset, minWidth, maxWidth, isOpen: controlledIsOpen, onClose, noPadding, noBorder, fillWidth, isDisabled, }: PropsWithChildren<DropdownProps>) => import("react").JSX.Element;
51
75
  export default Dropdown;
@@ -7,6 +7,7 @@ import { useState } from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import Tippy from "@tippyjs/react";
9
9
  //#region src/dropdown/Dropdown.tsx
10
+ /** Surface treatment of the dropdown panel. */
10
11
  var DropdownVariant = /* @__PURE__ */ function(DropdownVariant) {
11
12
  DropdownVariant["TRANSPARENT"] = "TRANSPARENT";
12
13
  DropdownVariant["BASE"] = "BASE";
@@ -15,6 +16,7 @@ var DropdownVariant = /* @__PURE__ */ function(DropdownVariant) {
15
16
  DropdownVariant["TERTIARY"] = "TERTIARY";
16
17
  return DropdownVariant;
17
18
  }({});
19
+ /** Placement relative to the trigger. The `AUTO_*` values pick a side that fits. */
18
20
  var DropdownPosition = /* @__PURE__ */ function(DropdownPosition) {
19
21
  DropdownPosition["TOP"] = "top";
20
22
  DropdownPosition["BOTTOM"] = "bottom";
@@ -33,6 +35,7 @@ var DropdownPosition = /* @__PURE__ */ function(DropdownPosition) {
33
35
  DropdownPosition["AUTO_END"] = "auto-end";
34
36
  return DropdownPosition;
35
37
  }({});
38
+ /** What opens the panel. `MANUAL` hands control entirely to `isOpen`. */
36
39
  var DropdownTrigger = /* @__PURE__ */ function(DropdownTrigger) {
37
40
  DropdownTrigger["CLICK"] = "click";
38
41
  DropdownTrigger["HOVER"] = "hover";
@@ -79,6 +82,12 @@ var DropdownTriggerWrapper = /*#__PURE__*/ styled("span")({
79
82
  "dfdzgmt-2": [_exp0()]
80
83
  }
81
84
  });
85
+ /**
86
+ * A panel anchored to a trigger. Children are the trigger.
87
+ *
88
+ * Uncontrolled by default. Pass `isOpen` *and* `onClose` to drive it yourself —
89
+ * useful when a selection inside the body should close it.
90
+ */
82
91
  var Dropdown = ({ children, variant = "BASE", header, body, footer, position = "bottom-start", offset = [0, 6], minWidth, maxWidth, isOpen: controlledIsOpen, onClose, noPadding = false, noBorder = false, fillWidth = false, isDisabled = false }) => {
83
92
  const [internalIsOpen, setInternalIsOpen] = useState(false);
84
93
  const isControlled = controlledIsOpen !== void 0;
@@ -1,68 +1,49 @@
1
1
  import { Extension } from "@codemirror/state";
2
2
  import { LanguageName } from "@uiw/codemirror-extensions-langs";
3
- import { GalaxyTheme } from "../theme/constants";
4
- import { Theme } from "../theme/types";
3
+ import { GalaxyTheme, Theme } from "../theme/types";
4
+ /** Background treatment of the editor surface. */
5
5
  export declare enum CodeEditorVariant {
6
6
  BASE = "BASE",
7
7
  PRIMARY = "PRIMARY",
8
8
  SECONDARY = "SECONDARY",
9
9
  TERTIARY = "TERTIARY"
10
10
  }
11
+ /** A CodeMirror language name — "sql", "json", "python", … */
11
12
  export type CodeEditorLanguage = LanguageName;
12
- type CodeEditorProps = {
13
- /**
14
- * The content of the code editor.
15
- */
13
+ export type CodeEditorProps = {
14
+ /** Editor contents. Controlled — pair it with `onChange`. */
16
15
  content: string;
17
- /**
18
- * The placeholder of the code editor.
19
- */
16
+ /** Shown when `content` is empty. */
20
17
  placeholder?: string;
21
- /**
22
- * The content type of the code editor.
23
- */
18
+ /** Syntax highlighting mode. Plain text when unset. */
24
19
  lang?: CodeEditorLanguage;
25
- /**
26
- * Whether the code editor is read only.
27
- */
20
+ /** Render contents without allowing edits. */
28
21
  isReadOnly?: boolean;
29
- /**
30
- * Whether to show line numbers.
31
- */
22
+ /** Hide the line-number gutter. */
32
23
  noLineNumbers?: boolean;
33
- /**
34
- * Custom CodeMirror extensions to add to the editor.
35
- * Use this for template decorations, custom keymaps, etc.
36
- */
24
+ /** Extra CodeMirror extensions — decorations, keymaps, autocomplete sources. */
37
25
  customExtensions?: Extension[];
38
- /**
39
- * Callback fired when the content changes.
40
- */
26
+ /** Called with the full document on every keystroke. */
41
27
  onChange?: (value: string) => void;
42
- /**
43
- * Callback fired when Cmd/Ctrl+Enter is pressed.
44
- */
28
+ /** Called on Cmd/Ctrl+Enter — the "run this" shortcut. */
45
29
  onExecute?: () => void;
46
- /**
47
- * Border radius for the editor wrapper.
48
- */
30
+ /** A number is px. */
49
31
  borderRadius?: string | number;
50
- /**
51
- * Whether to show a border around the editor.
52
- */
32
+ /** Drop the hairline border. */
53
33
  noBorder?: boolean;
54
- /**
55
- * Sets the padding inside the code editor content area.
56
- * Can be a number (for pixels) or a string (for other units).
57
- */
34
+ /** Inset around the content area. A number is px. */
58
35
  padding?: React.CSSProperties["padding"];
59
- /**
60
- * The background color variant of the code editor.
61
- * Defaults to PRIMARY.
62
- */
36
+ /** @default CodeEditorVariant.PRIMARY */
63
37
  variant?: CodeEditorVariant;
64
38
  };
65
39
  export declare function createSearchPanelThemeExtension(theme: Theme): Extension;
66
40
  export declare function createCodeMirrorThemeExtension(theme: Theme, activeTheme: Exclude<GalaxyTheme, GalaxyTheme.SYSTEM>, variant: CodeEditorVariant, isReadOnly?: boolean): Extension;
41
+ /**
42
+ * A CodeMirror 6 editor themed to match DLS — Berkeley Mono, theme-aware syntax
43
+ * colors, hairline border.
44
+ *
45
+ * Controlled: `content` is the document and `onChange` fires per keystroke.
46
+ * Extend it through `customExtensions` rather than forking the component.
47
+ */
67
48
  declare const CodeEditor: ({ content, placeholder, lang, customExtensions, onChange, onExecute, borderRadius, noBorder, isReadOnly, noLineNumbers, padding, variant, }: CodeEditorProps) => import("react").JSX.Element;
68
49
  export default CodeEditor;
@@ -1,4 +1,4 @@
1
- import { GalaxyTheme } from "../theme/constants.js";
1
+ import { GalaxyTheme } from "../theme/types.js";
2
2
  import { useGalaxyTheme, withTheme } from "../theme/GalaxyTheme.js";
3
3
  import { getCssSizeValue } from "../utils/linaria.js";
4
4
  /* empty css */
@@ -12,6 +12,7 @@ import { langs, loadLanguage } from "@uiw/codemirror-extensions-langs";
12
12
  import { createTheme } from "@uiw/codemirror-themes";
13
13
  import CodeMirror from "@uiw/react-codemirror";
14
14
  //#region src/editor/CodeEditor.tsx
15
+ /** Background treatment of the editor surface. */
15
16
  var CodeEditorVariant = /* @__PURE__ */ function(CodeEditorVariant) {
16
17
  CodeEditorVariant["BASE"] = "BASE";
17
18
  CodeEditorVariant["PRIMARY"] = "PRIMARY";
@@ -365,6 +366,13 @@ function createCodeMirrorThemeExtension(theme, activeTheme, variant, isReadOnly)
365
366
  ]
366
367
  });
367
368
  }
369
+ /**
370
+ * A CodeMirror 6 editor themed to match DLS — Berkeley Mono, theme-aware syntax
371
+ * colors, hairline border.
372
+ *
373
+ * Controlled: `content` is the document and `onChange` fires per keystroke.
374
+ * Extend it through `customExtensions` rather than forking the component.
375
+ */
368
376
  var CodeEditor = ({ content, placeholder, lang, customExtensions = [], onChange, onExecute, borderRadius, noBorder, isReadOnly, noLineNumbers, padding, variant = "PRIMARY" }) => {
369
377
  const { theme, activeTheme } = useGalaxyTheme();
370
378
  const codeMirrorTheme = useMemo(() => createCodeMirrorThemeExtension(theme, activeTheme, variant, isReadOnly), [
@@ -24,4 +24,10 @@ export interface UseDismissOptions {
24
24
  */
25
25
  onDismiss?: () => void;
26
26
  }
27
+ /**
28
+ * Closes a floating element on Escape or a click outside it. Returns the ref to
29
+ * attach to the element you want to keep open.
30
+ *
31
+ * Accepts either a bare handler or an options object as the first argument.
32
+ */
27
33
  export declare const useDismiss: <T extends HTMLElement = HTMLElement>(handlerOrOptions: (() => void) | UseDismissOptions, options?: UseDismissOptions) => RefObject<T>;
@@ -1,6 +1,12 @@
1
1
  import { useEffect, useRef } from "react";
2
2
  import { useHotkeys } from "react-hotkeys-hook";
3
3
  //#region src/hooks/useDismiss.ts
4
+ /**
5
+ * Closes a floating element on Escape or a click outside it. Returns the ref to
6
+ * attach to the element you want to keep open.
7
+ *
8
+ * Accepts either a bare handler or an options object as the first argument.
9
+ */
4
10
  var useDismiss = (handlerOrOptions, options) => {
5
11
  const isOptionsOnly = typeof handlerOrOptions !== "function";
6
12
  const handler = isOptionsOnly ? void 0 : handlerOrOptions;
@@ -1,4 +1,5 @@
1
- interface ElementClientSize {
1
+ /** Measured client size. Both fields are `undefined` before the first measurement. */
2
+ export interface ElementClientSize {
2
3
  width: number | undefined;
3
4
  height: number | undefined;
4
5
  }
@@ -17,4 +18,3 @@ interface ElementClientSize {
17
18
  * first measurement
18
19
  */
19
20
  export declare const useElementClientSize: (ref: React.RefObject<HTMLElement | null>) => ElementClientSize;
20
- export {};
@@ -1,5 +1,9 @@
1
+ /**
2
+ * Which edge or corner stays put while dragging. Edge anchors resize one
3
+ * dimension; corner anchors resize both.
4
+ */
1
5
  export type ResizeAnchor = "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
2
- interface UseResizeProps {
6
+ export interface UseResizeProps {
3
7
  /**
4
8
  * Current width of the element
5
9
  */
@@ -80,4 +84,3 @@ interface UseResizeProps {
80
84
  * });
81
85
  */
82
86
  export declare const useResize: ({ currentWidth, currentHeight, onWidthChange, onHeightChange, onSizeChange, minWidth, maxWidth, minHeight, maxHeight, anchor, }: UseResizeProps) => (e: React.MouseEvent) => void;
83
- export {};
@@ -1,5 +1,13 @@
1
- declare const GalaxyLogomark: ({ height, isDark }: {
1
+ /**
2
+ * The Galaxy mark, in the variant that reads against the active theme.
3
+ *
4
+ * `isDark` pins it to the dark-surface artwork regardless of theme — for a
5
+ * mark sitting on a surface that doesn't follow the theme.
6
+ */
7
+ declare const GalaxyLogomark: ({ height, isDark, }: {
8
+ /** Rendered height in px. Width follows the aspect ratio. */
2
9
  height: number;
10
+ /** Force the dark-surface artwork instead of following the theme. */
3
11
  isDark?: boolean;
4
12
  }) => import("react").JSX.Element;
5
13
  export default GalaxyLogomark;
@@ -1,4 +1,4 @@
1
- import { GalaxyTheme } from "../theme/constants.js";
1
+ import { GalaxyTheme } from "../theme/types.js";
2
2
  import { useGalaxyTheme } from "../theme/GalaxyTheme.js";
3
3
  import SvgGalaxyLogomarkDark from "../assets/components/GalaxyLogomarkDark.js";
4
4
  import SvgGalaxyLogomarkLight from "../assets/components/GalaxyLogomarkLight.js";
@@ -6,6 +6,12 @@ import { match } from "ts-pattern";
6
6
  import { useMemo } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  //#region src/icons/GalaxyLogomark.tsx
9
+ /**
10
+ * The Galaxy mark, in the variant that reads against the active theme.
11
+ *
12
+ * `isDark` pins it to the dark-surface artwork regardless of theme — for a
13
+ * mark sitting on a surface that doesn't follow the theme.
14
+ */
9
15
  var GalaxyLogomark = ({ height, isDark }) => {
10
16
  const { activeTheme } = useGalaxyTheme();
11
17
  return useMemo(() => {
@@ -17,11 +17,17 @@ export interface MaterialConfig {
17
17
  sheenColor?: string;
18
18
  }
19
19
  interface GalaxyLogomark3DProps {
20
+ /** Square canvas size. A number is px. */
20
21
  height: number | string;
22
+ /** Force the dark-surface material instead of following the theme. */
21
23
  isDark?: boolean;
24
+ /** Spin continuously. */
22
25
  isAutoRotate?: boolean;
26
+ /** Let the user drag to orbit the mesh. */
23
27
  isInteractive?: boolean;
28
+ /** React to hover. */
24
29
  isHoverable?: boolean;
30
+ /** Rotation rate. */
25
31
  speed?: number;
26
32
  /** Backlight configuration (enables dramatic mode when provided) */
27
33
  backlight?: LightConfig;
@@ -36,6 +42,15 @@ interface GalaxyLogomark3DProps {
36
42
  /** Environment preset (default: 'studio', or 'night' in dramatic mode) */
37
43
  environmentPreset?: PresetsType;
38
44
  }
45
+ /**
46
+ * The Galaxy mark as an interactive 3D mesh, rendered with react-three-fiber.
47
+ *
48
+ * The heaviest thing in the library — it pulls in three.js and a ~3MB model.
49
+ * Reserve it for hero moments; use `GalaxyLogomark` everywhere else.
50
+ *
51
+ * Passing any of `backlight`, `spotlight` or `fillLight` switches it into the
52
+ * dramatic lighting preset.
53
+ */
39
54
  declare const GalaxyLogomark3D: ({ height, isDark, isAutoRotate, isInteractive, isHoverable, speed, backlight, spotlight, fillLight, material, color: colorOverride, environmentPreset, }: GalaxyLogomark3DProps) => import("react").JSX.Element;
40
55
  export default GalaxyLogomark3D;
41
56
  export type { GalaxyLogomark3DProps };
@@ -252,6 +252,15 @@ function Scene({ color, isDark, isAutoRotate, isInteractive, isHoverable, isHove
252
252
  })
253
253
  ] });
254
254
  }
255
+ /**
256
+ * The Galaxy mark as an interactive 3D mesh, rendered with react-three-fiber.
257
+ *
258
+ * The heaviest thing in the library — it pulls in three.js and a ~3MB model.
259
+ * Reserve it for hero moments; use `GalaxyLogomark` everywhere else.
260
+ *
261
+ * Passing any of `backlight`, `spotlight` or `fillLight` switches it into the
262
+ * dramatic lighting preset.
263
+ */
255
264
  var GalaxyLogomark3D = ({ height, isDark = false, isAutoRotate = false, isInteractive = false, isHoverable = false, speed = 2, backlight, spotlight, fillLight, material, color: colorOverride, environmentPreset }) => {
256
265
  const [isHovered, setIsHovered] = useState(false);
257
266
  const { theme } = useGalaxyTheme();
@@ -1,8 +1,18 @@
1
1
  export interface GalaxyLogomarkAnimationProps {
2
+ /** Square size. A number is px. @default 32 */
2
3
  height?: number | string;
4
+ /** Force the dark-surface fill instead of following the theme. */
3
5
  isDark?: boolean;
6
+ /** Freeze on the first frame. Also stops it looping. @default false */
4
7
  isPaused?: boolean;
8
+ /** Playback rate. @default 1 */
5
9
  speed?: number;
6
10
  }
11
+ /**
12
+ * The Galaxy mark as a looping Lottie animation, tinted from the theme.
13
+ *
14
+ * Ships a ~700kB animation payload — reach for the static `GalaxyLogomark` for
15
+ * ordinary chrome and save this for splash and loading moments.
16
+ */
7
17
  declare const GalaxyLogomarkAnimation: ({ height, isDark, isPaused, speed, }: GalaxyLogomarkAnimationProps) => import("react").JSX.Element;
8
18
  export default GalaxyLogomarkAnimation;
@@ -1,4 +1,4 @@
1
- import { GalaxyTheme } from "../theme/constants.js";
1
+ import { GalaxyTheme } from "../theme/types.js";
2
2
  import { useGalaxyTheme } from "../theme/GalaxyTheme.js";
3
3
  import { getCssSizeValue } from "../utils/linaria.js";
4
4
  import galaxy_animation_default from "../assets/models/galaxy-animation.js";
@@ -20,6 +20,12 @@ var GalaxyLogomarkAnimationWrapper = /*#__PURE__*/ styled("div")({
20
20
  "gm80o9u-1": [_exp3()]
21
21
  }
22
22
  });
23
+ /**
24
+ * The Galaxy mark as a looping Lottie animation, tinted from the theme.
25
+ *
26
+ * Ships a ~700kB animation payload — reach for the static `GalaxyLogomark` for
27
+ * ordinary chrome and save this for splash and loading moments.
28
+ */
23
29
  var GalaxyLogomarkAnimation = ({ height = 32, isDark, isPaused = false, speed = 1 }) => {
24
30
  const lottieRef = useRef(null);
25
31
  const { theme, activeTheme } = useGalaxyTheme();
@@ -1,5 +1,11 @@
1
- declare const GalaxyWordmark: ({ height, isDark }: {
1
+ /**
2
+ * The Galaxy wordmark, in the variant that reads against the active theme.
3
+ * Use `GalaxyLogomark` when you need just the mark without the word.
4
+ */
5
+ declare const GalaxyWordmark: ({ height, isDark, }: {
6
+ /** Rendered height in px. Width follows the aspect ratio. */
2
7
  height: number;
8
+ /** Force the light artwork instead of following the theme. */
3
9
  isDark?: boolean;
4
10
  }) => import("react").JSX.Element;
5
11
  export default GalaxyWordmark;
@@ -1,4 +1,4 @@
1
- import { GalaxyTheme } from "../theme/constants.js";
1
+ import { GalaxyTheme } from "../theme/types.js";
2
2
  import { useGalaxyTheme } from "../theme/GalaxyTheme.js";
3
3
  import SvgGalaxyWordmarkDark from "../assets/components/GalaxyWordmarkDark.js";
4
4
  import SvgGalaxyWordmarkLight from "../assets/components/GalaxyWordmarkLight.js";
@@ -6,6 +6,10 @@ import { match } from "ts-pattern";
6
6
  import { useMemo } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  //#region src/icons/GalaxyWordmark.tsx
9
+ /**
10
+ * The Galaxy wordmark, in the variant that reads against the active theme.
11
+ * Use `GalaxyLogomark` when you need just the mark without the word.
12
+ */
9
13
  var GalaxyWordmark = ({ height, isDark }) => {
10
14
  const { activeTheme } = useGalaxyTheme();
11
15
  return useMemo(() => {
@@ -1,4 +1,5 @@
1
1
  import type { Icon as PhosphorIcon, IconWeight as PhosphorIconWeight } from "@phosphor-icons/react";
2
+ /** Icon color role. Resolves to a `theme.color.icon.*` token in both themes. */
2
3
  export declare enum IconVariant {
3
4
  PRIMARY = "PRIMARY",
4
5
  PRIMARY_ALT = "PRIMARY_ALT",
@@ -31,11 +32,20 @@ export declare enum IconWeight {
31
32
  DUOTONE = "duotone"
32
33
  }
33
34
  export interface IconProps {
35
+ /** Phosphor icon *component* — pass `PlusIcon`, not `<PlusIcon />`. */
34
36
  component: PhosphorIcon;
37
+ /** Square size in px. @default 16 */
35
38
  size?: number;
39
+ /** Stroke weight. @default IconWeight.BOLD */
36
40
  weight?: PhosphorIconWeight;
41
+ /** Color role. @default IconVariant.PRIMARY */
37
42
  variant?: IconVariant;
43
+ /** Accessible label. Set it when the icon is the only content. */
38
44
  alt?: string;
39
45
  }
46
+ /**
47
+ * Wraps a Phosphor icon so its color comes from a theme token rather than a
48
+ * hardcoded `color` prop. Never render a Phosphor icon bare.
49
+ */
40
50
  declare const Icon: ({ component: IconComponent, variant, size, weight, alt, }: IconProps) => import("react").JSX.Element;
41
51
  export default Icon;
@@ -2,6 +2,7 @@ import { useGalaxyTheme } from "../theme/GalaxyTheme.js";
2
2
  import { match } from "ts-pattern";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  //#region src/icons/Icon.tsx
5
+ /** Icon color role. Resolves to a `theme.color.icon.*` token in both themes. */
5
6
  var IconVariant = /* @__PURE__ */ function(IconVariant) {
6
7
  IconVariant["PRIMARY"] = "PRIMARY";
7
8
  IconVariant["PRIMARY_ALT"] = "PRIMARY_ALT";
@@ -38,6 +39,10 @@ var IconWeight = /* @__PURE__ */ function(IconWeight) {
38
39
  function getIconColor(variant, theme) {
39
40
  return match(variant).with("PRIMARY", () => theme.color.icon.primary).with("PRIMARY_ALT", () => theme.color.icon.primaryAlt).with("SECONDARY", () => theme.color.icon.secondary).with("SECONDARY_ALT", () => theme.color.icon.secondaryAlt).with("TERTIARY", () => theme.color.icon.tertiary).with("TERTIARY_ALT", () => theme.color.icon.tertiaryAlt).with("SUCCESS", () => theme.color.icon.success).with("ERROR", () => theme.color.icon.error).with("WARNING", () => theme.color.icon.warning).with("LOADING", () => theme.color.icon.primary).with("LIME", () => theme.color.icon.lime).with("BLUE", () => theme.color.icon.blue).with("TEAL", () => theme.color.icon.teal).with("YELLOW", () => theme.color.icon.yellow).with("ORANGE", () => theme.color.icon.orange).with("PURPLE", () => theme.color.icon.purple).with("PINK", () => theme.color.icon.pink).with("DISABLED", () => theme.color.text.disabled).with(void 0, () => theme.color.icon.primary).exhaustive();
40
41
  }
42
+ /**
43
+ * Wraps a Phosphor icon so its color comes from a theme token rather than a
44
+ * hardcoded `color` prop. Never render a Phosphor icon bare.
45
+ */
41
46
  var Icon = ({ component: IconComponent, variant = "PRIMARY", size = 16, weight = "bold", alt }) => {
42
47
  const { theme } = useGalaxyTheme();
43
48
  return /* @__PURE__ */ jsx(IconComponent, {