@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,11 +1,65 @@
1
1
  import { ChartMarkState } from "./types.js";
2
- import { useCallback, useMemo, useState } from "react";
2
+ import { DashboardContext } from "./DashboardProvider.js";
3
+ import { useCallback, useContext, useEffect, useId, useMemo, useState } from "react";
3
4
  //#region src/charts/useChartInteraction.ts
4
- function useChartInteraction({ categoryCount, seriesKeys, disabled = false, isLoading = false }) {
5
+ function useChartInteraction({ categoryCount, seriesKeys, categoryKeys, disabled = false, isLoading = false }) {
5
6
  const [hoveredIndex, setHoveredIndex] = useState(null);
6
7
  const [hoveredSeriesKey, setHoveredSeriesKey] = useState(null);
8
+ const sync = useContext(DashboardContext);
9
+ const syncId = useId();
10
+ const canSync = sync !== null && categoryKeys !== void 0;
11
+ const setActive = sync?.setActive;
12
+ const clearActive = sync?.clearActive;
7
13
  const safeHovered = hoveredIndex !== null && hoveredIndex < categoryCount ? hoveredIndex : null;
8
14
  const safeHoveredSeries = hoveredSeriesKey !== null && (seriesKeys === void 0 || seriesKeys.includes(hoveredSeriesKey)) ? hoveredSeriesKey : null;
15
+ /**
16
+ * Publish this chart's hover to the sync group.
17
+ *
18
+ * An effect over the derived label rather than calls inside the pointer
19
+ * handlers, so three edge cases collapse into one place: data shrinking
20
+ * under a resting pointer (the `safeHovered` guard nulls the key → clears),
21
+ * the label at the resting index changing (republishes what is now under
22
+ * the pointer), and unmount while source (the cleanup effect below).
23
+ * Source-only writes still hold — `localKey` derives from `safeHovered`,
24
+ * which only this chart's own pointer sets.
25
+ */
26
+ const localKey = canSync && safeHovered !== null ? categoryKeys[safeHovered] ?? null : null;
27
+ useEffect(() => {
28
+ if (!setActive || !clearActive) return;
29
+ if (localKey !== null) setActive({
30
+ sourceId: syncId,
31
+ categoryKey: localKey
32
+ });
33
+ else clearActive(syncId);
34
+ }, [
35
+ setActive,
36
+ clearActive,
37
+ syncId,
38
+ localKey
39
+ ]);
40
+ useEffect(() => () => clearActive?.(syncId), [clearActive, syncId]);
41
+ /**
42
+ * The category a sibling is hovering, resolved to this chart's own index.
43
+ *
44
+ * `isLoading` blocks following — the marks are force-muted anyway, but
45
+ * without the guard LineChart would still draw its cursor and dots through
46
+ * a loading plot. An unmatched label resolves to no crosshair at all, which
47
+ * is how charts with partially overlapping categories degrade.
48
+ */
49
+ const followedIndex = useMemo(() => {
50
+ if (!canSync || isLoading) return null;
51
+ const entry = sync.activeEntry;
52
+ if (entry === null || entry.sourceId === syncId) return null;
53
+ const index = categoryKeys.indexOf(entry.categoryKey);
54
+ return index === -1 ? null : index;
55
+ }, [
56
+ canSync,
57
+ isLoading,
58
+ sync?.activeEntry,
59
+ syncId,
60
+ categoryKeys
61
+ ]);
62
+ const effectiveIndex = safeHovered ?? followedIndex;
9
63
  const onCategoryEnter = useCallback((categoryIndex) => {
10
64
  if (disabled) return;
11
65
  setHoveredIndex(categoryIndex);
@@ -22,22 +76,23 @@ function useChartInteraction({ categoryCount, seriesKeys, disabled = false, isLo
22
76
  }, []);
23
77
  const getMarkState = useCallback(({ categoryIndex, seriesKey }) => {
24
78
  if (isLoading) return ChartMarkState.MUTED;
25
- return categoryIndex !== void 0 && safeHovered !== null && categoryIndex !== safeHovered || seriesKey !== void 0 && safeHoveredSeries !== null && seriesKey !== safeHoveredSeries ? ChartMarkState.MUTED : ChartMarkState.ACTIVE;
79
+ return categoryIndex !== void 0 && effectiveIndex !== null && categoryIndex !== effectiveIndex || seriesKey !== void 0 && safeHoveredSeries !== null && seriesKey !== safeHoveredSeries ? ChartMarkState.MUTED : ChartMarkState.ACTIVE;
26
80
  }, [
27
81
  isLoading,
28
- safeHovered,
82
+ effectiveIndex,
29
83
  safeHoveredSeries
30
84
  ]);
31
85
  return useMemo(() => ({
32
- activeIndex: safeHovered,
86
+ activeIndex: effectiveIndex,
87
+ hasLocalHover: safeHovered !== null,
33
88
  hoveredSeriesKey: safeHoveredSeries,
34
- isEngaged: safeHovered !== null || safeHoveredSeries !== null,
35
89
  getMarkState,
36
90
  onCategoryEnter,
37
91
  onCategoryLeave,
38
92
  onSeriesEnter,
39
93
  onSeriesLeave
40
94
  }), [
95
+ effectiveIndex,
41
96
  safeHovered,
42
97
  safeHoveredSeries,
43
98
  getMarkState,
@@ -1,4 +1,5 @@
1
1
  import type { Icon as PhosphorIcon } from "@phosphor-icons/react";
2
+ /** Chip color. Tints the background, border and label together. */
2
3
  export declare enum ChipVariant {
3
4
  PRIMARY = "PRIMARY",
4
5
  PRIMARY_ALT = "PRIMARY_ALT",
@@ -15,25 +16,43 @@ export declare enum ChipVariant {
15
16
  PURPLE = "PURPLE",
16
17
  TEAL = "TEAL"
17
18
  }
19
+ /** Chip height. Also drives label and icon size. */
18
20
  export declare enum ChipSize {
19
21
  SMALL = "SMALL",
20
22
  MEDIUM = "MEDIUM",
21
23
  LARGE = "LARGE"
22
24
  }
23
25
  export interface ChipProps {
26
+ /** Chip text. Required unless `icon` is set — with neither, nothing renders. */
24
27
  label?: string | number;
28
+ /** @default ChipVariant.SECONDARY */
25
29
  variant?: ChipVariant;
30
+ /** @default ChipSize.MEDIUM */
26
31
  size?: ChipSize;
32
+ /** Custom leading graphic. Takes precedence over `icon`. */
27
33
  svg?: React.ReactNode;
34
+ /** Phosphor icon *component* — pass `TagIcon`, not `<TagIcon />`. */
28
35
  icon?: PhosphorIcon;
36
+ /** Adds a trailing × button. Omit and the chip isn't dismissible. */
29
37
  onDismiss?: () => void;
38
+ /** Also flips the cursor to `pointer`. */
30
39
  onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
40
+ /** Fully rounded ends instead of the default small radius. */
31
41
  isPill?: boolean;
42
+ /** Drop the fill and keep only the border. */
32
43
  noBackground?: boolean;
44
+ /** Swap the label for a shimmer placeholder. */
33
45
  isLoading?: boolean;
46
+ /** Truncate a long label with an ellipsis. Needs a width-bounded parent. */
34
47
  isEllipsis?: boolean;
35
- /** When true, shows active/selected styling with variant-colored border */
48
+ /** Selected styling border picks up the variant color. */
36
49
  isActive?: boolean;
37
50
  }
51
+ /**
52
+ * A compact tag for a value, filter, or status.
53
+ *
54
+ * Renders `null` when neither `label` nor `icon` is set. Adding `onDismiss`
55
+ * appends a × button; adding `onClick` makes the whole chip clickable.
56
+ */
38
57
  declare const Chip: ({ label, variant, size, svg, icon, onDismiss, onClick, isPill, noBackground, isLoading, isEllipsis, isActive, }: ChipProps) => import("react").JSX.Element | null;
39
58
  export default Chip;
@@ -12,6 +12,7 @@ import { match } from "ts-pattern";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  import { XIcon } from "@phosphor-icons/react";
14
14
  //#region src/chips/Chip.tsx
15
+ /** Chip color. Tints the background, border and label together. */
15
16
  var ChipVariant = /* @__PURE__ */ function(ChipVariant) {
16
17
  ChipVariant["PRIMARY"] = "PRIMARY";
17
18
  ChipVariant["PRIMARY_ALT"] = "PRIMARY_ALT";
@@ -29,6 +30,7 @@ var ChipVariant = /* @__PURE__ */ function(ChipVariant) {
29
30
  ChipVariant["TEAL"] = "TEAL";
30
31
  return ChipVariant;
31
32
  }({});
33
+ /** Chip height. Also drives label and icon size. */
32
34
  var ChipSize = /* @__PURE__ */ function(ChipSize) {
33
35
  ChipSize["SMALL"] = "SMALL";
34
36
  ChipSize["MEDIUM"] = "MEDIUM";
@@ -40,7 +42,7 @@ var _exp2 = () => ({ $size }) => {
40
42
  return match($size).with("SMALL", () => "18px").with("MEDIUM", () => "20px").with("LARGE", () => "24px").exhaustive();
41
43
  };
42
44
  var _exp3 = () => ({ $size }) => {
43
- return match($size).with("SMALL", () => "0 4px").with("MEDIUM", () => "0 6px").with("LARGE", () => "0 8px").exhaustive();
45
+ return match($size).with("SMALL", () => "0 5px").with("MEDIUM", () => "0 6px").with("LARGE", () => "0 8px").exhaustive();
44
46
  };
45
47
  var _exp4 = () => ({ theme, $variant, $noBackground }) => {
46
48
  if ($noBackground) return "transparent";
@@ -111,6 +113,12 @@ var CHIP_SIZE_TO_TEXT_SIZE = {
111
113
  ["MEDIUM"]: TextSize.BODY_MD,
112
114
  ["LARGE"]: TextSize.BODY_LG
113
115
  };
116
+ /**
117
+ * A compact tag for a value, filter, or status.
118
+ *
119
+ * Renders `null` when neither `label` nor `icon` is set. Adding `onDismiss`
120
+ * appends a × button; adding `onClick` makes the whole chip clickable.
121
+ */
114
122
  var Chip = ({ label, variant = "SECONDARY", size = "MEDIUM", svg, icon, onDismiss, onClick, isPill, noBackground, isLoading, isEllipsis, isActive }) => {
115
123
  if (!label && !icon) return null;
116
124
  if (isLoading) return /* @__PURE__ */ jsxs(StyledChip, {
@@ -1,27 +1,24 @@
1
1
  import { type CSSProperties } from "react";
2
2
  import { AlignItems, JustifyContent } from "./FlexWrapper";
3
- interface FlexItemProps {
3
+ export interface FlexItemProps {
4
+ /** @default "static" */
4
5
  position?: CSSProperties["position"];
5
- /**
6
- * flex-grow of this item within its parent flex container.
7
- * Defaults to 0 (content-sized), matching the CSS default.
8
- */
6
+ /** flex-grow within the parent flex container. @default 0 */
9
7
  grow?: number;
10
- /**
11
- * flex-shrink of this item within its parent flex container.
12
- * Defaults to 1, matching the CSS default.
13
- */
8
+ /** flex-shrink within the parent flex container. @default 1 */
14
9
  shrink?: number;
15
- /**
16
- * flex-basis of this item. Defaults to auto.
17
- */
10
+ /** flex-basis. A number is px. @default "auto" */
18
11
  basis?: number | string;
19
12
  overflow?: CSSProperties["overflow"];
20
13
  whiteSpace?: CSSProperties["whiteSpace"];
21
14
  textOverflow?: CSSProperties["textOverflow"];
15
+ /** A number is px. */
22
16
  width?: number | string;
17
+ /** A number is px. */
23
18
  height?: number | string;
19
+ /** `width: 100%`. Takes precedence over `width`. */
24
20
  fillWidth?: boolean;
21
+ /** `height: 100%`. Takes precedence over `height`. */
25
22
  fillHeight?: boolean;
26
23
  /**
27
24
  * Defaults to "flex" (not "block"): a FlexItem is itself a flex container,
@@ -40,8 +37,13 @@ interface FlexItemProps {
40
37
  maxWidth?: number | string;
41
38
  maxHeight?: number | string;
42
39
  padding?: CSSProperties["padding"];
40
+ /** Also flips the cursor to `pointer`. */
43
41
  onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
44
42
  }
43
+ /**
44
+ * A single child of a `FlexWrapper`, for when one item needs its own grow,
45
+ * shrink, or sizing rules. Reach for it only when the wrapper can't express it.
46
+ */
45
47
  declare const FlexItem: import("react").ForwardRefExoticComponent<FlexItemProps & {
46
48
  children?: import("react").ReactNode | undefined;
47
49
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -55,6 +55,10 @@ var StyledFlexItem = /*#__PURE__*/ styled("div")({
55
55
  "s1he36jx-17": [_exp16()]
56
56
  }
57
57
  });
58
+ /**
59
+ * A single child of a `FlexWrapper`, for when one item needs its own grow,
60
+ * shrink, or sizing rules. Reach for it only when the wrapper can't express it.
61
+ */
58
62
  var FlexItem = forwardRef(({ children, position, grow, shrink, basis, overflow, whiteSpace, textOverflow, width, height, fillWidth, fillHeight, display, alignItems, justifyContent, minWidth, minHeight, maxWidth, maxHeight, padding, onClick }, ref) => {
59
63
  return /* @__PURE__ */ jsx(StyledFlexItem, {
60
64
  ref,
@@ -1,9 +1,11 @@
1
+ /** Main-axis direction of the flex container. */
1
2
  export declare enum FlexDirection {
2
3
  ROW = "row",
3
4
  COLUMN = "column",
4
5
  ROW_REVERSE = "row-reverse",
5
6
  COLUMN_REVERSE = "column-reverse"
6
7
  }
8
+ /** Cross-axis alignment of children (`align-items`). */
7
9
  export declare enum AlignItems {
8
10
  START = "start",
9
11
  CENTER = "center",
@@ -11,6 +13,7 @@ export declare enum AlignItems {
11
13
  BASELINE = "baseline",
12
14
  STRETCH = "stretch"
13
15
  }
16
+ /** Main-axis distribution of children (`justify-content`). */
14
17
  export declare enum JustifyContent {
15
18
  START = "start",
16
19
  CENTER = "center",
@@ -19,11 +22,13 @@ export declare enum JustifyContent {
19
22
  SPACE_AROUND = "space-around",
20
23
  SPACE_EVENLY = "space-evenly"
21
24
  }
25
+ /** Wrapping behavior when children overflow the main axis. */
22
26
  export declare enum FlexWrap {
23
27
  NOWRAP = "nowrap",
24
28
  WRAP = "wrap",
25
29
  WRAP_REVERSE = "wrap-reverse"
26
30
  }
31
+ /** Named steps on the spacing scale. `gap` also accepts a raw number of px. */
27
32
  export declare enum FlexGap {
28
33
  NONE = "0",
29
34
  XXSMALL = "2px",
@@ -34,129 +39,57 @@ export declare enum FlexGap {
34
39
  XLARGE = "24px",
35
40
  XXLARGE = "32px"
36
41
  }
37
- interface FlexWrapperProps {
38
- /**
39
- * Sets the direction of the flex container
40
- * - ROW: Items are placed in a row (default)
41
- * - COLUMN: Items are placed in a column
42
- * - ROW_REVERSE: Items are placed in a row, from right to left
43
- * - COLUMN_REVERSE: Items are placed in a column, from bottom to top
44
- */
42
+ export interface FlexWrapperProps {
43
+ /** @default FlexDirection.ROW */
45
44
  direction?: FlexDirection;
46
- /**
47
- * Defines how flex items are aligned along the cross axis
48
- * - START: Items are aligned at the start (default)
49
- * - CENTER: Items are centered
50
- * - END: Items are aligned at the end
51
- * - BASELINE: Items are aligned at their baselines
52
- * - STRETCH: Items are stretched to fill the container
53
- */
45
+ /** @default AlignItems.START */
54
46
  alignItems?: AlignItems;
55
- /**
56
- * Defines how flex items are aligned along the main axis
57
- * - START: Items are aligned at the start (default)
58
- * - CENTER: Items are centered
59
- * - END: Items are aligned at the end
60
- * - SPACE_BETWEEN: Items are evenly distributed with equal space between them
61
- * - SPACE_AROUND: Items are evenly distributed with equal space around them
62
- * - SPACE_EVENLY: Items are evenly distributed with equal space between and around them
63
- */
47
+ /** @default JustifyContent.START */
64
48
  justifyContent?: JustifyContent;
65
- /**
66
- * Controls whether flex items should wrap when there isn't enough space
67
- * - NOWRAP: Items will not wrap (default)
68
- * - WRAP: Items will wrap onto multiple lines if needed
69
- * - WRAP_REVERSE: Items will wrap onto multiple lines in reverse order
70
- */
49
+ /** @default FlexWrap.NOWRAP */
71
50
  wrap?: FlexWrap;
72
- /**
73
- * Sets the gap between flex items in pixels or string (for other units)
74
- */
51
+ /** Space between children. A number is px; use `FlexGap` for the scale. */
75
52
  gap?: number | string;
76
53
  /**
77
- * flex-grow of this wrapper when it is itself a child of a flex container.
78
- * Defaults to the CSS initial value (0). Saves wrapping in a FlexItem just
79
- * to control how the wrapper flexes.
54
+ * flex-grow / -shrink / -basis of the wrapper itself, for when it is also a
55
+ * child of another flex container. Saves nesting it in a FlexItem.
80
56
  */
81
57
  grow?: number;
82
- /**
83
- * flex-shrink of this wrapper when it is itself a child of a flex container.
84
- * Defaults to the CSS initial value (1).
85
- */
86
58
  shrink?: number;
87
- /**
88
- * flex-basis of this wrapper when it is itself a child of a flex container.
89
- * Defaults to the CSS initial value (auto).
90
- */
91
59
  basis?: number | string;
92
- /**
93
- * Sets the width of the flex container in pixels
94
- */
60
+ /** A number is px. @default "auto" */
95
61
  width?: number | string;
96
- /**
97
- * Sets the height of the flex container in pixels
98
- */
62
+ /** A number is px. @default "auto" */
99
63
  height?: number | string;
100
- /**
101
- * Sets the minimum width of the flex container in pixels
102
- */
64
+ /** Pass `0` to let this shrink below its content so nested text can ellipsize. */
103
65
  minWidth?: number | string;
104
- /**
105
- * Sets the maximum width of the flex container in pixels
106
- */
107
66
  maxWidth?: number | string;
108
- /**
109
- * Sets the minimum height of the flex container in pixels
110
- */
111
67
  minHeight?: number | string;
112
- /**
113
- * Sets the maximum height of the flex container in pixels
114
- */
115
68
  maxHeight?: number | string;
116
- /**
117
- * When true, the container will fill its parent's width (equivalent to width: 100%)
118
- */
69
+ /** `width: 100%`. Takes precedence over `width`. */
119
70
  fillWidth?: boolean;
120
- /**
121
- * When true, the container will fill its parent's height (equivalent to height: 100%)
122
- */
71
+ /** `height: 100%`. Takes precedence over `height`. */
123
72
  fillHeight?: boolean;
124
- /**
125
- * Controls how content that overflows the container should be handled
126
- * Default is 'visible'
127
- */
73
+ /** @default "visible" */
128
74
  overflow?: React.CSSProperties["overflow"];
129
- /**
130
- * Sets the padding inside the container
131
- * Can be a number (for pixels) or a string (for other units)
132
- */
75
+ /** Inner spacing. Use this rather than `margin` — DLS spaces with gap and padding. */
133
76
  padding?: React.CSSProperties["padding"];
134
- /**
135
- * Sets the margin inside the container
136
- * Can be a number (for pixels) or a string (for other units)
137
- */
77
+ /** Escape hatch. DLS spaces with `gap` and `padding` — reach for those first. */
138
78
  margin?: React.CSSProperties["margin"];
139
- /**
140
- * Optional click handler for the flex container
141
- */
79
+ /** Also flips the cursor to `pointer`. */
142
80
  onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
143
- /**
144
- * Optional mousedown handler for the flex container
145
- */
146
81
  onMouseDown?: (event: React.MouseEvent<HTMLDivElement>) => void;
147
- /**
148
- * Optional mouseenter handler for the flex container
149
- */
150
82
  onMouseEnter?: (event: React.MouseEvent<HTMLDivElement>) => void;
151
- /**
152
- * Optional mouseleave handler for the flex container
153
- */
154
83
  onMouseLeave?: (event: React.MouseEvent<HTMLDivElement>) => void;
155
- /**
156
- * Optional scroll handler for the flex container
157
- */
158
84
  onScroll?: (event: React.UIEvent<HTMLDivElement>) => void;
159
85
  }
86
+ /**
87
+ * The layout workhorse — a `display: flex` div with every flex and sizing knob
88
+ * as a prop. Compose UI out of these plus whitespace rather than decorating.
89
+ *
90
+ * Sizing props respect an explicit `0`, so `minWidth={0}` works as the standard
91
+ * fix for letting a flex child shrink enough for nested text to ellipsize.
92
+ */
160
93
  declare const FlexWrapper: import("react").ForwardRefExoticComponent<FlexWrapperProps & {
161
94
  children?: import("react").ReactNode | undefined;
162
95
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -4,6 +4,7 @@ import { styled } from "@linaria/react";
4
4
  import { forwardRef } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region src/containers/FlexWrapper.tsx
7
+ /** Main-axis direction of the flex container. */
7
8
  var FlexDirection = /* @__PURE__ */ function(FlexDirection) {
8
9
  FlexDirection["ROW"] = "row";
9
10
  FlexDirection["COLUMN"] = "column";
@@ -11,6 +12,7 @@ var FlexDirection = /* @__PURE__ */ function(FlexDirection) {
11
12
  FlexDirection["COLUMN_REVERSE"] = "column-reverse";
12
13
  return FlexDirection;
13
14
  }({});
15
+ /** Cross-axis alignment of children (`align-items`). */
14
16
  var AlignItems = /* @__PURE__ */ function(AlignItems) {
15
17
  AlignItems["START"] = "start";
16
18
  AlignItems["CENTER"] = "center";
@@ -19,6 +21,7 @@ var AlignItems = /* @__PURE__ */ function(AlignItems) {
19
21
  AlignItems["STRETCH"] = "stretch";
20
22
  return AlignItems;
21
23
  }({});
24
+ /** Main-axis distribution of children (`justify-content`). */
22
25
  var JustifyContent = /* @__PURE__ */ function(JustifyContent) {
23
26
  JustifyContent["START"] = "start";
24
27
  JustifyContent["CENTER"] = "center";
@@ -28,12 +31,14 @@ var JustifyContent = /* @__PURE__ */ function(JustifyContent) {
28
31
  JustifyContent["SPACE_EVENLY"] = "space-evenly";
29
32
  return JustifyContent;
30
33
  }({});
34
+ /** Wrapping behavior when children overflow the main axis. */
31
35
  var FlexWrap = /* @__PURE__ */ function(FlexWrap) {
32
36
  FlexWrap["NOWRAP"] = "nowrap";
33
37
  FlexWrap["WRAP"] = "wrap";
34
38
  FlexWrap["WRAP_REVERSE"] = "wrap-reverse";
35
39
  return FlexWrap;
36
40
  }({});
41
+ /** Named steps on the spacing scale. `gap` also accepts a raw number of px. */
37
42
  var FlexGap = /* @__PURE__ */ function(FlexGap) {
38
43
  FlexGap["NONE"] = "0";
39
44
  FlexGap["XXSMALL"] = "2px";
@@ -96,6 +101,13 @@ var StyledFlexWrapper = /*#__PURE__*/ styled("div")({
96
101
  "s12krdms-17": [_exp16()]
97
102
  }
98
103
  });
104
+ /**
105
+ * The layout workhorse — a `display: flex` div with every flex and sizing knob
106
+ * as a prop. Compose UI out of these plus whitespace rather than decorating.
107
+ *
108
+ * Sizing props respect an explicit `0`, so `minWidth={0}` works as the standard
109
+ * fix for letting a flex child shrink enough for nested text to ellipsize.
110
+ */
99
111
  var FlexWrapper = forwardRef(({ children, direction, alignItems, justifyContent, wrap, gap, grow, shrink, basis, width, height, minWidth, maxWidth, minHeight, maxHeight, fillWidth = false, fillHeight = false, overflow, padding, margin, onClick, onMouseDown, onMouseEnter, onMouseLeave, onScroll }, ref) => {
100
112
  return /* @__PURE__ */ jsx(StyledFlexWrapper, {
101
113
  ref,
@@ -1,16 +1,19 @@
1
1
  import type { PropsWithChildren } from "react";
2
+ /** Block-axis alignment of each item inside its own grid area (`align-items`). */
2
3
  export declare enum GridAlignItems {
3
4
  START = "START",
4
5
  CENTER = "CENTER",
5
6
  END = "END",
6
7
  STRETCH = "STRETCH"
7
8
  }
9
+ /** Inline-axis alignment of each item inside its own grid area (`justify-items`). */
8
10
  export declare enum GridJustifyItems {
9
11
  START = "START",
10
12
  CENTER = "CENTER",
11
13
  END = "END",
12
14
  STRETCH = "STRETCH"
13
15
  }
16
+ /** Inline-axis distribution of the whole grid when it's narrower than its container. */
14
17
  export declare enum GridJustifyContent {
15
18
  START = "START",
16
19
  CENTER = "CENTER",
@@ -20,6 +23,7 @@ export declare enum GridJustifyContent {
20
23
  SPACE_EVENLY = "SPACE_EVENLY",
21
24
  STRETCH = "STRETCH"
22
25
  }
26
+ /** Block-axis distribution of the whole grid when it's shorter than its container. */
23
27
  export declare enum GridAlignContent {
24
28
  START = "START",
25
29
  CENTER = "CENTER",
@@ -29,92 +33,47 @@ export declare enum GridAlignContent {
29
33
  SPACE_EVENLY = "SPACE_EVENLY",
30
34
  STRETCH = "STRETCH"
31
35
  }
32
- interface GridWrapperProps {
33
- /**
34
- * Number of columns in the grid, or a custom grid-template-columns value
35
- * - number: Creates that many equal-width columns using repeat(n, 1fr)
36
- * - string: Used directly as grid-template-columns value (e.g., "200px 1fr 1fr")
37
- */
36
+ export interface GridWrapperProps {
37
+ /** A number becomes `repeat(n, 1fr)`; a string is used as-is ("200px 1fr"). @default 1 */
38
38
  columns?: number | string;
39
- /**
40
- * Number of rows in the grid, or a custom grid-template-rows value
41
- * - number: Creates that many equal-height rows using repeat(n, 1fr)
42
- * - string: Used directly as grid-template-rows value
43
- */
39
+ /** A number becomes `repeat(n, 1fr)`; a string is used as-is. @default "auto" */
44
40
  rows?: number | string;
45
- /**
46
- * Gap between grid items (both row and column gap)
47
- * Can be a number (pixels) or string (e.g., "1rem")
48
- */
41
+ /** Space between items on both axes. A number is px. */
49
42
  gap?: number | string;
50
- /**
51
- * Gap between rows only
52
- */
43
+ /** Overrides `gap` on the row axis only. */
53
44
  rowGap?: number | string;
54
- /**
55
- * Gap between columns only
56
- */
45
+ /** Overrides `gap` on the column axis only. */
57
46
  columnGap?: number | string;
58
- /**
59
- * Aligns grid items along the block (column) axis within their grid area
60
- */
47
+ /** @default GridAlignItems.STRETCH */
61
48
  alignItems?: GridAlignItems;
62
- /**
63
- * Aligns grid items along the inline (row) axis within their grid area
64
- */
49
+ /** @default GridJustifyItems.STRETCH */
65
50
  justifyItems?: GridJustifyItems;
66
- /**
67
- * Aligns the grid along the block (column) axis when grid is smaller than container
68
- */
51
+ /** @default GridAlignContent.START */
69
52
  alignContent?: GridAlignContent;
70
- /**
71
- * Aligns the grid along the inline (row) axis when grid is smaller than container
72
- */
53
+ /** @default GridJustifyContent.START */
73
54
  justifyContent?: GridJustifyContent;
74
- /**
75
- * Sets the width of the grid container
76
- */
55
+ /** A number is px. @default "auto" */
77
56
  width?: number | string;
78
- /**
79
- * Sets the height of the grid container
80
- */
57
+ /** A number is px. @default "auto" */
81
58
  height?: number | string;
82
- /**
83
- * Sets the minimum width of the grid container
84
- */
85
59
  minWidth?: number | string;
86
- /**
87
- * Sets the maximum width of the grid container
88
- */
89
60
  maxWidth?: number | string;
90
- /**
91
- * Sets the minimum height of the grid container
92
- */
93
61
  minHeight?: number | string;
94
- /**
95
- * Sets the maximum height of the grid container
96
- */
97
62
  maxHeight?: number | string;
98
- /**
99
- * When true, the container will fill its parent's width (width: 100%)
100
- */
63
+ /** `width: 100%`. Takes precedence over `width`. */
101
64
  fillWidth?: boolean;
102
- /**
103
- * When true, the container will fill its parent's height (height: 100%)
104
- */
65
+ /** `height: 100%`. Takes precedence over `height`. */
105
66
  fillHeight?: boolean;
106
- /**
107
- * Sets the padding inside the container
108
- */
67
+ /** Inner spacing. A number is px. */
109
68
  padding?: number | string;
110
- /**
111
- * Sets the margin outside the container
112
- */
69
+ /** Escape hatch. DLS spaces with `gap` and `padding` — reach for those first. */
113
70
  margin?: number | string;
114
- /**
115
- * Controls overflow behavior
116
- */
71
+ /** @default "visible" */
117
72
  overflow?: React.CSSProperties["overflow"];
118
73
  }
74
+ /**
75
+ * A `display: grid` container. Use it when children need to line up across both
76
+ * axes; for a single row or column `FlexWrapper` is the lighter choice.
77
+ */
119
78
  declare const GridWrapper: ({ children, columns, rows, gap, rowGap, columnGap, alignItems, justifyItems, alignContent, justifyContent, width, height, minWidth, maxWidth, minHeight, maxHeight, fillWidth, fillHeight, padding, margin, overflow, }: PropsWithChildren<GridWrapperProps>) => import("react").JSX.Element;
120
79
  export default GridWrapper;
@@ -3,6 +3,7 @@ import { getCssSizeValue } from "../utils/linaria.js";
3
3
  import { styled } from "@linaria/react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/containers/GridWrapper.tsx
6
+ /** Block-axis alignment of each item inside its own grid area (`align-items`). */
6
7
  var GridAlignItems = /* @__PURE__ */ function(GridAlignItems) {
7
8
  GridAlignItems["START"] = "START";
8
9
  GridAlignItems["CENTER"] = "CENTER";
@@ -10,6 +11,7 @@ var GridAlignItems = /* @__PURE__ */ function(GridAlignItems) {
10
11
  GridAlignItems["STRETCH"] = "STRETCH";
11
12
  return GridAlignItems;
12
13
  }({});
14
+ /** Inline-axis alignment of each item inside its own grid area (`justify-items`). */
13
15
  var GridJustifyItems = /* @__PURE__ */ function(GridJustifyItems) {
14
16
  GridJustifyItems["START"] = "START";
15
17
  GridJustifyItems["CENTER"] = "CENTER";
@@ -17,6 +19,7 @@ var GridJustifyItems = /* @__PURE__ */ function(GridJustifyItems) {
17
19
  GridJustifyItems["STRETCH"] = "STRETCH";
18
20
  return GridJustifyItems;
19
21
  }({});
22
+ /** Inline-axis distribution of the whole grid when it's narrower than its container. */
20
23
  var GridJustifyContent = /* @__PURE__ */ function(GridJustifyContent) {
21
24
  GridJustifyContent["START"] = "START";
22
25
  GridJustifyContent["CENTER"] = "CENTER";
@@ -27,6 +30,7 @@ var GridJustifyContent = /* @__PURE__ */ function(GridJustifyContent) {
27
30
  GridJustifyContent["STRETCH"] = "STRETCH";
28
31
  return GridJustifyContent;
29
32
  }({});
33
+ /** Block-axis distribution of the whole grid when it's shorter than its container. */
30
34
  var GridAlignContent = /* @__PURE__ */ function(GridAlignContent) {
31
35
  GridAlignContent["START"] = "START";
32
36
  GridAlignContent["CENTER"] = "CENTER";
@@ -88,6 +92,10 @@ var StyledGridWrapper = /*#__PURE__*/ styled("div")({
88
92
  "s40bxfr-17": [_exp16()]
89
93
  }
90
94
  });
95
+ /**
96
+ * A `display: grid` container. Use it when children need to line up across both
97
+ * axes; for a single row or column `FlexWrapper` is the lighter choice.
98
+ */
91
99
  var GridWrapper = ({ children, columns, rows, gap, rowGap, columnGap, alignItems, justifyItems, alignContent, justifyContent, width, height, minWidth, maxWidth, minHeight, maxHeight, fillWidth = false, fillHeight = false, padding, margin, overflow }) => {
92
100
  return /* @__PURE__ */ jsx(StyledGridWrapper, {
93
101
  columns,