@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
@@ -1,29 +1,46 @@
1
1
  import React, { type PropsWithChildren } from "react";
2
2
  import type { Icon as PhosphorIcon } from "@phosphor-icons/react";
3
+ /** Surface treatment of the accordion shell. */
3
4
  export declare enum AccordionVariant {
4
5
  PRIMARY = "PRIMARY",
5
6
  SECONDARY = "SECONDARY",
6
7
  TERTIARY = "TERTIARY"
7
8
  }
9
+ /** Header density — drives header padding and text size. */
8
10
  export declare enum AccordionSize {
9
11
  SMALL = "SMALL",
10
12
  MEDIUM = "MEDIUM",
11
13
  LARGE = "LARGE"
12
14
  }
13
15
  export interface AccordionProps {
16
+ /** @default AccordionVariant.PRIMARY */
14
17
  variant?: AccordionVariant;
18
+ /** @default AccordionSize.MEDIUM */
15
19
  size?: AccordionSize;
20
+ /** Phosphor icon *component* shown before the header. */
16
21
  icon?: PhosphorIcon;
22
+ /** Header text. Always visible; clicking it toggles the panel. */
17
23
  header: string;
24
+ /** Secondary line under the header. */
18
25
  subheader?: string;
26
+ /** Trailing content in the header — a count, a badge, a status. */
19
27
  metric?: React.ReactNode;
28
+ /** A number is px. */
20
29
  borderRadius?: number | string;
30
+ /** Inset for the body. @default "12px" */
21
31
  padding?: string | number;
32
+ /** Starting state in uncontrolled mode. Ignored once `isOpen` is passed. */
22
33
  isOpenInitial?: boolean;
23
- /** Controlled mode: external open state */
34
+ /** Controlled open state. Pass it together with `onToggle`. */
24
35
  isOpen?: boolean;
25
- /** Controlled mode: callback when toggle is clicked */
36
+ /** Called when the header is clicked. Required for controlled mode. */
26
37
  onToggle?: () => void;
27
38
  }
39
+ /**
40
+ * A collapsible section with a persistent header.
41
+ *
42
+ * Uncontrolled by default — it tracks its own state from `isOpenInitial`. Pass
43
+ * `isOpen` *and* `onToggle` together to drive it from outside instead.
44
+ */
28
45
  declare const Accordion: ({ children, variant, size, icon, header, subheader, metric, borderRadius, padding, isOpenInitial, isOpen: controlledIsOpen, onToggle: controlledOnToggle, }: PropsWithChildren<AccordionProps>) => React.JSX.Element;
29
46
  export default Accordion;
@@ -13,12 +13,14 @@ import { useState } from "react";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
14
  import { CaretDownIcon } from "@phosphor-icons/react";
15
15
  //#region src/accordion/Accordion.tsx
16
+ /** Surface treatment of the accordion shell. */
16
17
  var AccordionVariant = /* @__PURE__ */ function(AccordionVariant) {
17
18
  AccordionVariant["PRIMARY"] = "PRIMARY";
18
19
  AccordionVariant["SECONDARY"] = "SECONDARY";
19
20
  AccordionVariant["TERTIARY"] = "TERTIARY";
20
21
  return AccordionVariant;
21
22
  }({});
23
+ /** Header density — drives header padding and text size. */
22
24
  var AccordionSize = /* @__PURE__ */ function(AccordionSize) {
23
25
  AccordionSize["SMALL"] = "SMALL";
24
26
  AccordionSize["MEDIUM"] = "MEDIUM";
@@ -65,6 +67,12 @@ var AccordionContentInner = withTheme(/*#__PURE__*/ styled("div")({
65
67
  class: "a1f5gwwu",
66
68
  propsAsIs: false
67
69
  }));
70
+ /**
71
+ * A collapsible section with a persistent header.
72
+ *
73
+ * Uncontrolled by default — it tracks its own state from `isOpenInitial`. Pass
74
+ * `isOpen` *and* `onToggle` together to drive it from outside instead.
75
+ */
68
76
  var Accordion = ({ children, variant = "PRIMARY", size = "MEDIUM", icon, header, subheader, metric, borderRadius, padding = "12px", isOpenInitial = false, isOpen: controlledIsOpen, onToggle: controlledOnToggle }) => {
69
77
  const [internalIsOpen, setInternalIsOpen] = useState(isOpenInitial);
70
78
  const isControlled = controlledIsOpen !== void 0;
@@ -1,9 +1,18 @@
1
1
  export interface AvatarProps {
2
+ /** Image URL. Falls back to the generated pattern when null or missing. */
2
3
  img?: string | null;
4
+ /** Render the shimmer placeholder instead. */
3
5
  isLoading?: boolean;
6
+ /** Square size in px. @default 16 */
4
7
  size?: number;
8
+ /** Override the generated pattern's color. */
5
9
  hex?: string;
10
+ /** Input to the generated pattern — same seed always yields the same avatar. */
6
11
  seed?: string;
7
12
  }
13
+ /**
14
+ * A user or entity avatar. Falls back to a dot pattern derived from `seed` when
15
+ * there's no image, so the same user is always recognizable without one.
16
+ */
8
17
  declare const Avatar: ({ img, isLoading, size, hex, seed }: AvatarProps) => import("react").JSX.Element;
9
18
  export default Avatar;
@@ -51,6 +51,10 @@ var seededRandom = (seed) => {
51
51
  return hash / 2147483647;
52
52
  };
53
53
  };
54
+ /**
55
+ * A user or entity avatar. Falls back to a dot pattern derived from `seed` when
56
+ * there's no image, so the same user is always recognizable without one.
57
+ */
54
58
  var Avatar = ({ img, isLoading, size = 16, hex, seed }) => {
55
59
  const { theme } = useGalaxyTheme();
56
60
  const [failedSrc, setFailedSrc] = useState(null);
@@ -1,4 +1,5 @@
1
1
  export interface AvatarShimmerProps {
2
+ /** Square size in px. Match the `Avatar` it stands in for. @default 16 */
2
3
  size?: number;
3
4
  }
4
5
  export declare const StyledAvatarShimmer: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
@@ -24,5 +25,6 @@ export declare const StyledAvatarShimmer: import("react").ComponentType<Pick<imp
24
25
  } & {
25
26
  as?: React.ElementType;
26
27
  }>, {}>;
28
+ /** Loading placeholder for an `Avatar`. `Avatar` renders it itself when `isLoading`. */
27
29
  declare const AvatarShimmer: ({ size }: AvatarShimmerProps) => import("react").JSX.Element;
28
30
  export default AvatarShimmer;
@@ -14,6 +14,7 @@ var StyledAvatarShimmer = withTheme(/*#__PURE__*/ styled("div")({
14
14
  "s1o6ak6r-1": [_exp3(), "px"]
15
15
  }
16
16
  }));
17
+ /** Loading placeholder for an `Avatar`. `Avatar` renders it itself when `isLoading`. */
17
18
  var AvatarShimmer = ({ size }) => {
18
19
  return /* @__PURE__ */ jsx(StyledAvatarShimmer, { $size: size });
19
20
  };
@@ -1,13 +1,24 @@
1
1
  import type { ReactNode } from "react";
2
2
  import { ThemeBackgroundColor } from "../theme/types";
3
- interface CellGridBackgroundProps {
3
+ export interface CellGridBackgroundProps {
4
+ /** Side length of one cell in px. @default 24 */
4
5
  cellSize?: number;
6
+ /** Line width in px. @default 1 */
5
7
  strokeWidth?: number;
8
+ /** Grid line color. @default theme.color.border.primary */
6
9
  lineColor?: string;
10
+ /** Surface behind the grid. Pass a token. @default theme.color.background.base */
7
11
  backgroundColor?: ThemeBackgroundColor[keyof ThemeBackgroundColor];
12
+ /** Line opacity, 0–1. @default 0.5 */
8
13
  lineOpacity?: number;
14
+ /** Fill the parent instead of sizing to children. @default true */
9
15
  fillContainer?: boolean;
10
16
  children?: ReactNode;
11
17
  }
18
+ /**
19
+ * Ruled graph-paper surface. Centers its children; the pattern is an inline SVG
20
+ * data URI, so it costs no request. Unlike the dot and cross grids it has no
21
+ * `borderRadius` prop — wrap it if you need clipped corners.
22
+ */
12
23
  declare const CellGridBackground: ({ cellSize, strokeWidth, lineColor, backgroundColor, lineOpacity, fillContainer, children, }: CellGridBackgroundProps) => import("react").JSX.Element;
13
24
  export default CellGridBackground;
@@ -25,6 +25,11 @@ var generateCellSvg = (cellSize, strokeWidth, color, opacity) => {
25
25
  </svg>`;
26
26
  return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
27
27
  };
28
+ /**
29
+ * Ruled graph-paper surface. Centers its children; the pattern is an inline SVG
30
+ * data URI, so it costs no request. Unlike the dot and cross grids it has no
31
+ * `borderRadius` prop — wrap it if you need clipped corners.
32
+ */
28
33
  var CellGridBackground = ({ cellSize = 24, strokeWidth = 1, lineColor, backgroundColor, lineOpacity = .5, fillContainer = true, children }) => {
29
34
  const { theme } = useGalaxyTheme();
30
35
  return /* @__PURE__ */ jsx(StyledCellGridBackground, {
@@ -1,14 +1,26 @@
1
1
  import type { PropsWithChildren } from "react";
2
2
  import { ThemeBackgroundColor } from "../theme/types";
3
- interface CrossGridBackgroundProps {
3
+ export interface CrossGridBackgroundProps {
4
+ /** Arm length of each cross in px. @default 8 */
4
5
  crossSize?: number;
6
+ /** Grid pitch in px — the distance between cross centers. @default 24 */
5
7
  spacing?: number;
8
+ /** Stroke width of each arm in px. @default 1 */
6
9
  strokeWidth?: number;
10
+ /** Cross color. @default theme.color.border.primary */
7
11
  crossColor?: string;
12
+ /** Surface behind the crosses. Pass a token. @default theme.color.background.base */
8
13
  backgroundColor?: ThemeBackgroundColor[keyof ThemeBackgroundColor];
14
+ /** Cross opacity, 0–1. @default 0.5 */
9
15
  crossOpacity?: number;
16
+ /** Fill the parent instead of sizing to children. @default true */
10
17
  fillContainer?: boolean;
18
+ /** A number is px. @default 0 */
11
19
  borderRadius?: string | number;
12
20
  }
21
+ /**
22
+ * Grid surface marked with small crosses at each intersection. Centers its
23
+ * children; the pattern is an inline SVG data URI, so it costs no request.
24
+ */
13
25
  declare const CrossGridBackground: ({ crossSize, spacing, strokeWidth, crossColor, backgroundColor, crossOpacity, fillContainer, borderRadius, children, }: PropsWithChildren<CrossGridBackgroundProps>) => import("react").JSX.Element;
14
26
  export default CrossGridBackground;
@@ -30,6 +30,10 @@ var generateCrossSvg = (crossSize, spacing, strokeWidth, color, opacity) => {
30
30
  </svg>`;
31
31
  return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
32
32
  };
33
+ /**
34
+ * Grid surface marked with small crosses at each intersection. Centers its
35
+ * children; the pattern is an inline SVG data URI, so it costs no request.
36
+ */
33
37
  var CrossGridBackground = ({ crossSize = 8, spacing = 24, strokeWidth = 1, crossColor, backgroundColor, crossOpacity = .5, fillContainer = true, borderRadius, children }) => {
34
38
  const { theme } = useGalaxyTheme();
35
39
  return /* @__PURE__ */ jsx(StyledCrossGridBackground, {
@@ -1,13 +1,24 @@
1
1
  import type { PropsWithChildren } from "react";
2
2
  import { ThemeBackgroundColor } from "../theme/types";
3
- interface DotGridBackgroundProps {
3
+ export interface DotGridBackgroundProps {
4
+ /** Dot diameter in px. @default 3 */
4
5
  dotSize?: number;
6
+ /** Grid pitch in px — the distance between dot centers. @default 24 */
5
7
  spacing?: number;
8
+ /** Dot color. @default theme.color.border.primary */
6
9
  dotColor?: string;
10
+ /** Surface behind the dots. Pass a token. @default theme.color.background.base */
7
11
  backgroundColor?: ThemeBackgroundColor[keyof ThemeBackgroundColor];
12
+ /** Dot opacity, 0–1. @default 0.5 */
8
13
  dotOpacity?: number;
14
+ /** Fill the parent instead of sizing to children. @default true */
9
15
  fillContainer?: boolean;
16
+ /** A number is px. @default 0 */
10
17
  borderRadius?: string | number;
11
18
  }
19
+ /**
20
+ * Dotted grid surface. Centers its children and paints the pattern as an inline
21
+ * SVG data URI, so it costs no network request and scales with `spacing`.
22
+ */
12
23
  declare const DotGridBackground: ({ dotSize, spacing, dotColor, backgroundColor, dotOpacity, fillContainer, borderRadius, children, }: PropsWithChildren<DotGridBackgroundProps>) => import("react").JSX.Element;
13
24
  export default DotGridBackground;
@@ -28,6 +28,10 @@ var generateDotSvg = (size, dotSize, color, opacity) => {
28
28
  </svg>`;
29
29
  return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
30
30
  };
31
+ /**
32
+ * Dotted grid surface. Centers its children and paints the pattern as an inline
33
+ * SVG data URI, so it costs no network request and scales with `spacing`.
34
+ */
31
35
  var DotGridBackground = ({ dotSize = 3, spacing = 24, dotColor, backgroundColor, dotOpacity = .5, fillContainer = true, borderRadius, children }) => {
32
36
  const { theme } = useGalaxyTheme();
33
37
  return /* @__PURE__ */ jsx(StyledDotGridBackground, {
@@ -1,3 +1,4 @@
1
+ /** Badge color. Signals what the count *means* — errors, warnings, neutral totals. */
1
2
  export declare enum BadgeVariant {
2
3
  PRIMARY = "PRIMARY",
3
4
  PRIMARY_ALT = "PRIMARY_ALT",
@@ -14,17 +15,28 @@ export declare enum BadgeVariant {
14
15
  PURPLE = "PURPLE",
15
16
  TEAL = "TEAL"
16
17
  }
18
+ /** Badge height. Match the control it annotates. */
17
19
  export declare enum BadgeSize {
18
20
  SMALL = "SMALL",
19
21
  MEDIUM = "MEDIUM",
20
22
  LARGE = "LARGE"
21
23
  }
22
24
  export interface BadgeProps {
25
+ /** The number shown. A count of 0 renders nothing at all. */
23
26
  count: number;
27
+ /** @default BadgeVariant.PRIMARY */
24
28
  variant?: BadgeVariant;
29
+ /** @default BadgeSize.MEDIUM */
25
30
  size?: BadgeSize;
31
+ /** Counts above this show as "N+". @default 99 */
26
32
  max?: number;
33
+ /** Also flips the cursor to `pointer`. */
27
34
  onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
28
35
  }
36
+ /**
37
+ * A numeric count pill — unread items, pending actions.
38
+ *
39
+ * Renders `null` when `count` is 0, so you don't need to guard it yourself.
40
+ */
29
41
  declare const Badge: ({ count, variant, size, max, onClick, }: BadgeProps) => import("react").JSX.Element | null;
30
42
  export default Badge;
@@ -5,6 +5,7 @@ import { styled } from "@linaria/react";
5
5
  import { match } from "ts-pattern";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  //#region src/badge/Badge.tsx
8
+ /** Badge color. Signals what the count *means* — errors, warnings, neutral totals. */
8
9
  var BadgeVariant = /* @__PURE__ */ function(BadgeVariant) {
9
10
  BadgeVariant["PRIMARY"] = "PRIMARY";
10
11
  BadgeVariant["PRIMARY_ALT"] = "PRIMARY_ALT";
@@ -22,6 +23,7 @@ var BadgeVariant = /* @__PURE__ */ function(BadgeVariant) {
22
23
  BadgeVariant["TEAL"] = "TEAL";
23
24
  return BadgeVariant;
24
25
  }({});
26
+ /** Badge height. Match the control it annotates. */
25
27
  var BadgeSize = /* @__PURE__ */ function(BadgeSize) {
26
28
  BadgeSize["SMALL"] = "SMALL";
27
29
  BadgeSize["MEDIUM"] = "MEDIUM";
@@ -73,6 +75,11 @@ var StyledBadge = withTheme(/*#__PURE__*/ styled("div")({
73
75
  "s6s20zd-3": [_exp5()]
74
76
  }
75
77
  }));
78
+ /**
79
+ * A numeric count pill — unread items, pending actions.
80
+ *
81
+ * Renders `null` when `count` is 0, so you don't need to guard it yourself.
82
+ */
76
83
  var Badge = ({ count, variant = "PRIMARY", size = "MEDIUM", max = 99, onClick }) => {
77
84
  if (count === 0) return null;
78
85
  const displayValue = count > max ? `${max}+` : count;
@@ -1,8 +1,10 @@
1
+ /** Dot diameter. */
1
2
  export declare enum BeaconSize {
2
3
  SMALL = "SMALL",
3
4
  MEDIUM = "MEDIUM",
4
5
  LARGE = "LARGE"
5
6
  }
7
+ /** Dot color — the status being signalled. Also colors the pulse ring. */
6
8
  export declare enum BeaconVariant {
7
9
  BASE = "BASE",
8
10
  PRIMARY = "PRIMARY",
@@ -21,23 +23,15 @@ export declare enum BeaconVariant {
21
23
  DISABLED = "DISABLED"
22
24
  }
23
25
  export interface BeaconProps {
24
- /**
25
- * The size of the Beacon.
26
- */
26
+ /** @default BeaconSize.MEDIUM */
27
27
  size?: BeaconSize;
28
- /**
29
- * The color of the Beacon.
30
- */
28
+ /** @default BeaconVariant.BASE */
31
29
  variant?: BeaconVariant;
32
- /**
33
- * The speed of the pulse animation in seconds.
34
- * @default 2
35
- */
30
+ /** Duration of one pulse cycle in seconds. @default 2 */
36
31
  speed?: number;
37
- /**
38
- * Whether to show the pulse animation.
39
- */
32
+ /** Add an expanding ring around the dot. Off means a static dot. */
40
33
  isPulse?: boolean;
41
34
  }
35
+ /** A status dot, optionally pulsing. Live connections, unread state, health. */
42
36
  declare const Beacon: ({ variant, size, speed, isPulse, }: BeaconProps) => import("react").JSX.Element;
43
37
  export default Beacon;
@@ -4,12 +4,14 @@ import { styled } from "@linaria/react";
4
4
  import { match } from "ts-pattern";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/beacons/Beacon.tsx
7
+ /** Dot diameter. */
7
8
  var BeaconSize = /* @__PURE__ */ function(BeaconSize) {
8
9
  BeaconSize["SMALL"] = "SMALL";
9
10
  BeaconSize["MEDIUM"] = "MEDIUM";
10
11
  BeaconSize["LARGE"] = "LARGE";
11
12
  return BeaconSize;
12
13
  }({});
14
+ /** Dot color — the status being signalled. Also colors the pulse ring. */
13
15
  var BeaconVariant = /* @__PURE__ */ function(BeaconVariant) {
14
16
  BeaconVariant["BASE"] = "BASE";
15
17
  BeaconVariant["PRIMARY"] = "PRIMARY";
@@ -57,6 +59,7 @@ var BeaconDot = withTheme(/*#__PURE__*/ styled("span")({
57
59
  propsAsIs: false,
58
60
  vars: { "bv9nmr4-0": [_exp5()] }
59
61
  }));
62
+ /** A status dot, optionally pulsing. Live connections, unread state, health. */
60
63
  var Beacon = ({ variant = "BASE", size = "MEDIUM", speed, isPulse }) => /* @__PURE__ */ jsxs(BeaconWrapper, {
61
64
  $size: size,
62
65
  children: [isPulse && /* @__PURE__ */ jsx(BeaconPulse, {
@@ -1,17 +1,26 @@
1
1
  import type { Icon as PhosphorIcon } from "@phosphor-icons/react";
2
2
  export interface ButtonProps {
3
+ /** Button text. Omit for an icon-only button and set `ariaLabel` instead. */
3
4
  label?: string;
5
+ /** Phosphor icon *component* — pass `PlusIcon`, not `<PlusIcon />`. */
4
6
  icon?: PhosphorIcon;
7
+ /** @default ButtonVariant.PRIMARY */
5
8
  variant?: ButtonVariant;
9
+ /** @default ButtonSize.MEDIUM */
6
10
  size?: ButtonSize;
7
11
  onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
8
12
  onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement>) => void;
9
13
  onMouseLeave?: (e: React.MouseEvent<HTMLButtonElement>) => void;
14
+ /** Blocks `onClick` and disables the button. Renders no spinner. */
10
15
  isLoading?: boolean;
11
16
  isDisabled?: boolean;
17
+ /** Render the icon after the label instead of before. */
12
18
  isIconTrailing?: boolean;
19
+ /** Use the icon's filled weight instead of bold. */
13
20
  isIconFilled?: boolean;
21
+ /** Truncate a long label with an ellipsis instead of growing the button. */
14
22
  isEllipsis?: boolean;
23
+ /** Stretch to the parent's width. */
15
24
  fillWidth?: boolean;
16
25
  cursor?: React.CSSProperties["cursor"];
17
26
  /** Accessible name — required when the button renders an icon with no label. */
@@ -20,6 +29,7 @@ export interface ButtonProps {
20
29
  ariaControls?: string;
21
30
  ariaHasPopup?: boolean;
22
31
  }
32
+ /** Visual weight. One PRIMARY per view; TERTIARY is the transparent variant. */
23
33
  export declare enum ButtonVariant {
24
34
  PRIMARY = "PRIMARY",
25
35
  PRIMARY_ALT = "PRIMARY_ALT",
@@ -28,10 +38,18 @@ export declare enum ButtonVariant {
28
38
  SUCCESS = "SUCCESS",
29
39
  ERROR = "ERROR"
30
40
  }
41
+ /** Control height — 24 / 28 / 32px. Also drives label and icon size. */
31
42
  export declare enum ButtonSize {
32
43
  SMALL = "SMALL",
33
44
  MEDIUM = "MEDIUM",
34
45
  LARGE = "LARGE"
35
46
  }
47
+ /**
48
+ * The standard action control. Renders a label, an icon, or both.
49
+ *
50
+ * `isLoading` and `isDisabled` behave identically at the DOM level — both set
51
+ * `disabled` on the `<button>` and swallow `onClick`. Loading is a lockout, not
52
+ * a spinner; render your own indicator alongside if you need one.
53
+ */
36
54
  declare const Button: ({ label, icon, variant, size, onClick, onMouseEnter, onMouseLeave, fillWidth, isLoading, isDisabled, isIconTrailing, isIconFilled, isEllipsis, cursor, ariaLabel, ariaExpanded, ariaControls, ariaHasPopup, }: ButtonProps) => import("react").JSX.Element;
37
55
  export default Button;
@@ -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 Text, { TextSize, TextVariant, TextWeight } from "../text/Text.js";
4
4
  import FlexItem from "../containers/FlexItem.js";
@@ -9,6 +9,7 @@ import { match } from "ts-pattern";
9
9
  import { useCallback } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  //#region src/buttons/Button.tsx
12
+ /** Visual weight. One PRIMARY per view; TERTIARY is the transparent variant. */
12
13
  var ButtonVariant = /* @__PURE__ */ function(ButtonVariant) {
13
14
  ButtonVariant["PRIMARY"] = "PRIMARY";
14
15
  ButtonVariant["PRIMARY_ALT"] = "PRIMARY_ALT";
@@ -18,6 +19,7 @@ var ButtonVariant = /* @__PURE__ */ function(ButtonVariant) {
18
19
  ButtonVariant["ERROR"] = "ERROR";
19
20
  return ButtonVariant;
20
21
  }({});
22
+ /** Control height — 24 / 28 / 32px. Also drives label and icon size. */
21
23
  var ButtonSize = /* @__PURE__ */ function(ButtonSize) {
22
24
  ButtonSize["SMALL"] = "SMALL";
23
25
  ButtonSize["MEDIUM"] = "MEDIUM";
@@ -98,6 +100,13 @@ var BUTTON_SIZE_TO_ICON_SIZE_MAP = {
98
100
  ["MEDIUM"]: 14,
99
101
  ["LARGE"]: 16
100
102
  };
103
+ /**
104
+ * The standard action control. Renders a label, an icon, or both.
105
+ *
106
+ * `isLoading` and `isDisabled` behave identically at the DOM level — both set
107
+ * `disabled` on the `<button>` and swallow `onClick`. Loading is a lockout, not
108
+ * a spinner; render your own indicator alongside if you need one.
109
+ */
101
110
  var Button = ({ label, icon, variant = "PRIMARY", size = "MEDIUM", onClick, onMouseEnter, onMouseLeave, fillWidth, isLoading, isDisabled, isIconTrailing, isIconFilled, isEllipsis, cursor, ariaLabel, ariaExpanded, ariaControls, ariaHasPopup }) => {
102
111
  const { activeTheme } = useGalaxyTheme();
103
112
  const handleClick = useCallback((e) => {
@@ -13,6 +13,9 @@ export type BarChartProps<TMetric extends string, TComponentKey extends string =
13
13
  groups: BarChartGroupDatum<NoInfer<TMetric>, NoInfer<TComponentKey>>[];
14
14
  /** @default BarChartNormalization.NONE */
15
15
  normalization?: BarChartNormalization;
16
+ /** Tint the active category's full band, marking the hover position even
17
+ * where there is no data. @default true */
18
+ showCursor?: boolean;
16
19
  };
17
20
  /**
18
21
  * Bar chart with a three-level data model.
@@ -21,5 +24,5 @@ export type BarChartProps<TMetric extends string, TComponentKey extends string =
21
24
  * `bars` in a group render side by side, several `components` in a bar stack,
22
25
  * and a chart doing both at once needs no extra configuration.
23
26
  */
24
- declare const BarChart: <TMetric extends string, TComponentKey extends string = string>({ series, groups, width, height, fillWidth, fillHeight, aspectRatio, margin, normalization, valueUnit, valueFormatter, labelFormatter, valueDomain, categoryLabelMode, categoryAxisTitle, valueAxisTitle, showGrid, showLegend, legendMaxItems, noTooltip, tooltipRenderer, isLoading, contentWhenEmpty, ariaLabel, ariaDescription, }: BarChartProps<TMetric, TComponentKey>) => import("react").JSX.Element;
27
+ declare const BarChart: <TMetric extends string, TComponentKey extends string = string>({ series, groups, width, height, fillWidth, fillHeight, aspectRatio, margin, normalization, showCursor, valueUnit, valueFormatter, labelFormatter, valueDomain, categoryLabelMode, categoryAxisTitle, valueAxisTitle, showGrid, showLegend, legendMaxItems, noTooltip, tooltipRenderer, isLoading, contentWhenEmpty, ariaLabel, ariaDescription, }: BarChartProps<TMetric, TComponentKey>) => import("react").JSX.Element;
25
28
  export default BarChart;
@@ -1,10 +1,10 @@
1
- import { BarChartNormalization, ChartKind, ChartTargetShape } from "./types.js";
1
+ import { BarChartNormalization, ChartKind, ChartMarkState, ChartTargetShape } from "./types.js";
2
2
  import { useSeriesColorResolver } from "./useSeriesColorResolver.js";
3
3
  import { useChartInteraction } from "./useChartInteraction.js";
4
4
  import { useCartesianChartLayout } from "./useCartesianChartLayout.js";
5
5
  import { getBarLegendItems } from "./barChartLegend.js";
6
6
  import { buildBarChartGeometry, getBarValueDomain, roundedRectPath } from "./barChartGeometry.js";
7
- import { ChartBarPath } from "./ChartPrimitives.js";
7
+ import { ChartBarPath, ChartCursorBand } from "./ChartPrimitives.js";
8
8
  import ChartFrame from "./ChartFrame.js";
9
9
  import { ChartCategoryAxis, ChartValueAxis } from "./ChartAxis.js";
10
10
  import { useCallback, useMemo, useRef } from "react";
@@ -17,7 +17,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
17
17
  * `bars` in a group render side by side, several `components` in a bar stack,
18
18
  * and a chart doing both at once needs no extra configuration.
19
19
  */
20
- var BarChart = ({ series, groups, width, height, fillWidth, fillHeight, aspectRatio, margin, normalization = BarChartNormalization.NONE, valueUnit, valueFormatter, labelFormatter, valueDomain, categoryLabelMode, categoryAxisTitle, valueAxisTitle, showGrid = true, showLegend = true, legendMaxItems, noTooltip = false, tooltipRenderer, isLoading = false, contentWhenEmpty, ariaLabel, ariaDescription }) => {
20
+ var BarChart = ({ series, groups, width, height, fillWidth, fillHeight, aspectRatio, margin, normalization = BarChartNormalization.NONE, showCursor = true, valueUnit, valueFormatter, labelFormatter, valueDomain, categoryLabelMode, categoryAxisTitle, valueAxisTitle, showGrid = true, showLegend = true, legendMaxItems, noTooltip = false, tooltipRenderer, isLoading = false, contentWhenEmpty, ariaLabel, ariaDescription }) => {
21
21
  const containerRef = useRef(null);
22
22
  const colors = useSeriesColorResolver(series);
23
23
  /**
@@ -101,12 +101,16 @@ var BarChart = ({ series, groups, width, height, fillWidth, fillHeight, aspectRa
101
101
  colors
102
102
  ]);
103
103
  const legendKeys = useMemo(() => legendItems.map((item) => item.key), [legendItems]);
104
+ const categoryKeys = useMemo(() => groups.map((group) => group.label), [groups]);
104
105
  const interaction = useChartInteraction({
105
106
  categoryCount: geometry.bands.length,
106
107
  seriesKeys: legendKeys,
107
- disabled: noTooltip || isLoading || isEmpty,
108
+ categoryKeys,
109
+ categoryMuteState: ChartMarkState.DIMMED,
110
+ isDisabled: noTooltip || isLoading || isEmpty,
108
111
  isLoading
109
112
  });
113
+ const activeBand = interaction.activeIndex === null ? null : geometry.bands[interaction.activeIndex] ?? null;
110
114
  const buildCategoryTooltip = useCallback((index) => {
111
115
  const band = geometry.bands[index];
112
116
  const group = groups[index];
@@ -140,7 +144,7 @@ var BarChart = ({ series, groups, width, height, fillWidth, fillHeight, aspectRa
140
144
  width: band.width,
141
145
  height: band.height
142
146
  })), [geometry.bands]);
143
- return /* @__PURE__ */ jsx(ChartFrame, {
147
+ return /* @__PURE__ */ jsxs(ChartFrame, {
144
148
  containerRef,
145
149
  dimensions,
146
150
  fillWidth,
@@ -160,7 +164,7 @@ var BarChart = ({ series, groups, width, height, fillWidth, fillHeight, aspectRa
160
164
  showGrid,
161
165
  title: valueAxisTitle
162
166
  }), /* @__PURE__ */ jsx(ChartCategoryAxis, {
163
- labels: groups.map((group) => group.label),
167
+ labels: categoryKeys,
164
168
  positions: categoryPositions,
165
169
  step: categoryStep,
166
170
  plotWidth,
@@ -180,14 +184,19 @@ var BarChart = ({ series, groups, width, height, fillWidth, fillHeight, aspectRa
180
184
  showLegend,
181
185
  legendItems,
182
186
  legendMaxItems,
183
- children: geometry.rects.map((rect) => /* @__PURE__ */ jsx(ChartBarPath, {
187
+ children: [showCursor && activeBand && /* @__PURE__ */ jsx(ChartCursorBand, {
188
+ x: activeBand.x,
189
+ y: activeBand.y,
190
+ width: activeBand.width,
191
+ height: activeBand.height
192
+ }), geometry.rects.map((rect) => /* @__PURE__ */ jsx(ChartBarPath, {
184
193
  d: roundedRectPath(rect.x, rect.y, rect.width, rect.height, rect.radius, rect.corners),
185
194
  fill: rect.color,
186
195
  "data-state": interaction.getMarkState({
187
196
  categoryIndex: rect.groupIndex,
188
197
  seriesKey: isStacked ? rect.componentKey : rect.metric
189
198
  })
190
- }, rect.id))
199
+ }, rect.id))]
191
200
  });
192
201
  };
193
202
  //#endregion
@@ -7,21 +7,14 @@ import type { ChartInteraction } from "./useChartInteraction";
7
7
  * roles and no tab stops — the plot is `role="img"` and its accessible story is
8
8
  * the frame's label and description, while pointer users get the tooltip.
9
9
  *
10
- * A category with nothing to show gets no target at all: hovering an all-zero
11
- * bar group or an all-null line column must not open a tooltip with a heading
12
- * and no rows, so the empty stretch of plot is simply not hoverable.
10
+ * Every category is hoverable, including one with nothing to show: the cursor
11
+ * still marks where the pointer is over an empty stretch of axis, and the
12
+ * frame's rowless guard is what keeps a heading-only tooltip from opening
13
+ * there.
13
14
  */
14
15
  interface ChartCategoryTargetsProps {
15
16
  targets: ChartCategoryTarget[];
16
17
  interaction: ChartInteraction;
17
- /**
18
- * Category indices whose tooltip would have no rows.
19
- *
20
- * Skipped entirely rather than rendered inert, so the pointer falls through
21
- * to nothing. Indexing is unaffected: `targets.map` still passes the true
22
- * category index for every target that does render.
23
- */
24
- inertIndices?: ReadonlySet<number>;
25
18
  }
26
- declare const ChartCategoryTargets: ({ targets, interaction, inertIndices, }: ChartCategoryTargetsProps) => import("react").JSX.Element;
19
+ declare const ChartCategoryTargets: ({ targets, interaction }: ChartCategoryTargetsProps) => import("react").JSX.Element;
27
20
  export default ChartCategoryTargets;
@@ -3,8 +3,7 @@ import { ChartHitTarget, ChartHitTargetPath } from "./ChartPrimitives.js";
3
3
  import { match } from "ts-pattern";
4
4
  import { Fragment, jsx } from "react/jsx-runtime";
5
5
  //#region src/charts/ChartCategoryTargets.tsx
6
- var ChartCategoryTargets = ({ targets, interaction, inertIndices }) => /* @__PURE__ */ jsx(Fragment, { children: targets.map((target, index) => {
7
- if (inertIndices?.has(index)) return null;
6
+ var ChartCategoryTargets = ({ targets, interaction }) => /* @__PURE__ */ jsx(Fragment, { children: targets.map((target, index) => {
8
7
  const shared = {
9
8
  onMouseEnter: () => interaction.onCategoryEnter(index),
10
9
  onMouseLeave: () => interaction.onCategoryLeave()
@@ -70,10 +70,9 @@ export interface ChartFrameProps {
70
70
  /**
71
71
  * Builds one category's tooltip, in plot coordinates.
72
72
  *
73
- * Taken as a function rather than a finished model because the frame needs it
74
- * twice: once for the category under the pointer, and once per category to
75
- * decide which categories are inert. Deriving both from the same builder is
76
- * what makes "no tooltip rows" and "not hoverable" the same fact.
73
+ * A rowless model means "no data here": the category stays hoverable the
74
+ * cursor should still mark the pointer over an empty stretch of axis but
75
+ * no tooltip opens.
77
76
  *
78
77
  * Must be stable; memoize it at the call site.
79
78
  */