@galaxy-io/dls 2.4.1 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/beacons/Beacon.d.ts +6 -6
  2. package/dist/beacons/Beacon.js +22 -19
  3. package/dist/buttons/Button.d.ts +6 -0
  4. package/dist/buttons/Button.js +3 -2
  5. package/dist/charts/BarChart.d.ts +2 -2
  6. package/dist/charts/ChartLegend.js +2 -1
  7. package/dist/charts/LineChart.js +1 -0
  8. package/dist/charts/PieChart.js +1 -0
  9. package/dist/charts/Sparkline.d.ts +5 -4
  10. package/dist/charts/Sparkline.js +21 -18
  11. package/dist/charts/barChartGeometry.d.ts +2 -2
  12. package/dist/charts/barChartLegend.js +2 -0
  13. package/dist/charts/chartPalette.d.ts +9 -5
  14. package/dist/charts/chartPalette.js +8 -2
  15. package/dist/charts/types.d.ts +7 -5
  16. package/dist/charts/useSeriesColorResolver.d.ts +2 -1
  17. package/dist/chips/Chip.d.ts +6 -5
  18. package/dist/chips/Chip.js +24 -21
  19. package/dist/feedback/EmptyState.d.ts +29 -3
  20. package/dist/feedback/EmptyState.js +39 -13
  21. package/dist/feedback/ProgressBar.d.ts +5 -4
  22. package/dist/feedback/ProgressBar.js +25 -22
  23. package/dist/feedback/ProgressCircle.d.ts +5 -4
  24. package/dist/feedback/ProgressCircle.js +25 -22
  25. package/dist/inputs/CheckboxGroup.d.ts +5 -1
  26. package/dist/inputs/CheckboxGroup.js +4 -2
  27. package/dist/inputs/ColorInput.d.ts +6 -2
  28. package/dist/inputs/ColorInput.js +4 -2
  29. package/dist/inputs/CopyInput.d.ts +6 -2
  30. package/dist/inputs/CopyInput.js +1 -1
  31. package/dist/inputs/CronInput.d.ts +6 -2
  32. package/dist/inputs/CronInput.js +4 -2
  33. package/dist/inputs/DateInput.d.ts +6 -2
  34. package/dist/inputs/DateInput.js +4 -2
  35. package/dist/inputs/DurationInput.d.ts +6 -2
  36. package/dist/inputs/DurationInput.js +4 -2
  37. package/dist/inputs/FileInput.d.ts +5 -1
  38. package/dist/inputs/FileInput.js +4 -2
  39. package/dist/inputs/Input.d.ts +7 -1
  40. package/dist/inputs/Input.js +7 -4
  41. package/dist/inputs/KeyValueInput.d.ts +6 -2
  42. package/dist/inputs/KeyValueInput.js +4 -2
  43. package/dist/inputs/MultiSelectInput.d.ts +5 -1
  44. package/dist/inputs/NumberInput.js +2 -1
  45. package/dist/inputs/PasswordInput.js +2 -1
  46. package/dist/inputs/PinInput.d.ts +6 -2
  47. package/dist/inputs/PinInput.js +4 -2
  48. package/dist/inputs/RadioGroup.d.ts +5 -1
  49. package/dist/inputs/RadioGroup.js +4 -2
  50. package/dist/inputs/SelectInput.d.ts +5 -1
  51. package/dist/inputs/SelectInput.js +4 -2
  52. package/dist/inputs/SliderInput.d.ts +6 -2
  53. package/dist/inputs/SliderInput.js +4 -2
  54. package/dist/inputs/TagInput.d.ts +6 -2
  55. package/dist/inputs/TagInput.js +4 -2
  56. package/dist/inputs/TextAreaInput.d.ts +6 -2
  57. package/dist/inputs/TextAreaInput.js +6 -3
  58. package/dist/inputs/ToggleInput.d.ts +5 -1
  59. package/dist/inputs/ToggleInput.js +4 -2
  60. package/dist/inputs/internal/ownField.d.ts +10 -5
  61. package/dist/inputs/internal/ownField.js +14 -9
  62. package/dist/layout/Box.d.ts +1 -1
  63. package/dist/layout/Box.js +20 -27
  64. package/dist/layout/Flex.d.ts +24 -1
  65. package/dist/layout/Flex.js +25 -5
  66. package/dist/layout/FlexItem.d.ts +24 -1
  67. package/dist/layout/FlexItem.js +22 -3
  68. package/dist/layout/internal/surface.d.ts +13 -0
  69. package/dist/layout/internal/surface.js +28 -0
  70. package/dist/lists/DescriptionList.d.ts +6 -0
  71. package/dist/lists/DescriptionList.js +13 -11
  72. package/dist/modal/ConfirmDialog.d.ts +4 -0
  73. package/dist/modal/ConfirmDialog.js +14 -12
  74. package/dist/shapes/Circle.d.ts +6 -5
  75. package/dist/shapes/Circle.js +21 -18
  76. package/dist/shapes/Square.d.ts +6 -5
  77. package/dist/shapes/Square.js +21 -18
  78. package/dist/styles.css +1 -1
  79. package/dist/table/TableCore.js +3 -2
  80. package/dist/text/MarkdownText.js +1 -1
  81. package/dist/theme/enums.d.ts +1 -1
  82. package/dist/theme/enums.js +1 -1
  83. package/dist/theme/tokens/palette.d.ts +5 -1
  84. package/dist/theme/tokens/palette.js +9 -1
  85. package/dist/theme/tokens/types.d.ts +9 -1
  86. package/dist/timeline/Timeline.d.ts +6 -5
  87. package/dist/timeline/Timeline.js +20 -17
  88. package/dist/toast/ToastProvider.js +1 -1
  89. package/dist/toast/useToast.d.ts +1 -1
  90. package/package.json +1 -1
@@ -8,7 +8,7 @@ import { t } from "../theme/tokens/t.js";
8
8
  import Icon, { IconVariant } from "../icons/Icon.js";
9
9
  import Rotate from "../transform/Rotate.js";
10
10
  import Button, { ButtonSize, ButtonVariant } from "../buttons/Button.js";
11
- import EmptyState, { EmptyStateSize } from "../feedback/EmptyState.js";
11
+ import EmptyState, { EmptyStateSize, EmptyStateVariant } from "../feedback/EmptyState.js";
12
12
  import { useElementClientSize } from "../hooks/useElementClientSize.js";
13
13
  import { formatNumber } from "../utils/format.js";
14
14
  import ResizeHandle from "../layout/ResizeHandle.js";
@@ -945,7 +945,8 @@ function TableFrame({ metrics, columnLayout, leadingHeaders, trailingHeader, has
945
945
  icon: WarningCircleIcon,
946
946
  header: "Couldn't load data",
947
947
  description: error,
948
- size: metrics.emptyStateSize
948
+ size: metrics.emptyStateSize,
949
+ variant: EmptyStateVariant.ERROR
949
950
  })
950
951
  }) : emptyState ?? /* @__PURE__ */ jsx(EmptyState, {
951
952
  header: "No results",
@@ -5,8 +5,8 @@ import Divider from "../layout/Divider.js";
5
5
  import Icon, { IconVariant } from "../icons/Icon.js";
6
6
  import Span from "./Span.js";
7
7
  import Link, { LinkVariant } from "../links/Link.js";
8
- import Bold from "./Bold.js";
9
8
  import Code from "./Code.js";
9
+ import Bold from "./Bold.js";
10
10
  import CodeBlock, { CodeBlockLanguage } from "./CodeBlock.js";
11
11
  /* empty css */
12
12
  import { styled } from "@linaria/react";
@@ -106,7 +106,7 @@ export type SpaceShorthand = Space | [Space, Space] | [Space, Space, Space] | [S
106
106
  export declare const CANONICAL_SIZE_MEMBERS: readonly ["X_SMALL", "SMALL", "MEDIUM", "LARGE", "X_LARGE"];
107
107
  /**
108
108
  * Color set: members a color-role `<Component>Variant` may use (Constitution V, V-A). Meaning
109
- * only: categorical hues are the `color?: PaletteColor` prop. There is no accent: Galaxy is
109
+ * only: categorical hues are the `color?: RoleColor` prop. There is no accent: Galaxy is
110
110
  * monochrome.
111
111
  */
112
112
  export declare const CANONICAL_COLOR_MEMBERS: readonly ["PRIMARY", "SECONDARY", "TERTIARY", "SUCCESS", "WARNING", "ERROR", "DISABLED", "INHERIT"];
@@ -116,7 +116,7 @@ var CANONICAL_SIZE_MEMBERS = [
116
116
  ];
117
117
  /**
118
118
  * Color set: members a color-role `<Component>Variant` may use (Constitution V, V-A). Meaning
119
- * only: categorical hues are the `color?: PaletteColor` prop. There is no accent: Galaxy is
119
+ * only: categorical hues are the `color?: RoleColor` prop. There is no accent: Galaxy is
120
120
  * monochrome.
121
121
  */
122
122
  var CANONICAL_COLOR_MEMBERS = [
@@ -5,9 +5,13 @@
5
5
  * style with `t.palette.<family>[<step>]`, and import `PALETTE` only for JS logic (canvas, WebGL).
6
6
  * The theme roles (`t.color.<property>.<family>`) are derived from these steps (dark.ts, light.ts).
7
7
  */
8
- import type { PaletteColor, PaletteStep } from "./types.js";
8
+ import type { PaletteColor, PaletteStep, RoleColor, StatusColor } from "./types.js";
9
+ /** The three status roles, in severity order. */
10
+ export declare const STATUS_COLORS: readonly StatusColor[];
9
11
  /** Every palette family in hue order, red → rose. */
10
12
  export declare const PALETTE_COLORS: readonly PaletteColor[];
13
+ /** Every name a mark's `color` takes: the status roles first, then the palette families. */
14
+ export declare const ROLE_COLORS: readonly RoleColor[];
11
15
  /** Every step of a family, lightest first. */
12
16
  export declare const PALETTE_STEPS: readonly PaletteStep[];
13
17
  /** Family → step → hex. */
@@ -1,4 +1,10 @@
1
1
  //#region src/theme/tokens/palette.ts
2
+ /** The three status roles, in severity order. */
3
+ var STATUS_COLORS = [
4
+ "success",
5
+ "warning",
6
+ "error"
7
+ ];
2
8
  /** Every palette family in hue order, red → rose. */
3
9
  var PALETTE_COLORS = [
4
10
  "red",
@@ -19,6 +25,8 @@ var PALETTE_COLORS = [
19
25
  "pink",
20
26
  "rose"
21
27
  ];
28
+ /** Every name a mark's `color` takes: the status roles first, then the palette families. */
29
+ var ROLE_COLORS = [...STATUS_COLORS, ...PALETTE_COLORS];
22
30
  /** Every step of a family, lightest first. */
23
31
  var PALETTE_STEPS = [
24
32
  100,
@@ -150,4 +158,4 @@ var PALETTE = {
150
158
  }
151
159
  };
152
160
  //#endregion
153
- export { PALETTE, PALETTE_COLORS, PALETTE_STEPS };
161
+ export { PALETTE, PALETTE_COLORS, PALETTE_STEPS, ROLE_COLORS, STATUS_COLORS };
@@ -21,8 +21,16 @@ export type PaletteStep = 100 | 300 | 500 | 700 | 900;
21
21
  * palette family): a green, a warm amber and a red that never read alike.
22
22
  */
23
23
  export type StatusColor = "success" | "warning" | "error";
24
+ /**
25
+ * A color name a mark can be keyed by: a palette family (a category) or a status role used as a
26
+ * category (a run status map where "completed" is `success` and "running" is `blue`). What the
27
+ * `color` prop of `Square`, `Circle`, `Chip`, `Beacon`, `Sparkline`, `Timeline`, `ProgressBar`,
28
+ * `ProgressCircle` and a chart series takes. Every color property (`text`, `background`,
29
+ * `border`, `solid`) has one value per name.
30
+ */
31
+ export type RoleColor = StatusColor | PaletteColor;
24
32
  /** One value per meaning role and per palette family. */
25
- type RoleColors = Record<StatusColor | PaletteColor, string>;
33
+ type RoleColors = Record<RoleColor, string>;
26
34
  /** A strong fill: its background, the text and icons drawn on it, and its two states. */
27
35
  export type SolidColor = {
28
36
  /** The fill. */
@@ -1,6 +1,6 @@
1
1
  import type { Icon as PhosphorIcon } from "@phosphor-icons/react";
2
2
  import { type AriaAttributes, type CSSProperties, type ReactNode } from "react";
3
- import type { PaletteColor } from "../theme/tokens/types.js";
3
+ import type { RoleColor } from "../theme/tokens/types.js";
4
4
  /** Canonical rungs (subset); the member names the type step of the event text. */
5
5
  export declare enum TimelineSize {
6
6
  /** body_sm text, 16px box, 4px dot, 10px icon, 12px between events. */
@@ -78,11 +78,12 @@ interface TimelineItemColorProps {
78
78
  */
79
79
  variant?: undefined;
80
80
  /**
81
- * Categorical palette family (`"blue"`, `"violet"`, …): the dot or icon takes `text.<family>`
82
- * and the box `border.<family>`, the way a status variant renders. For an event's category (a source, a team); meanings take
83
- * `variant`. Not with `variant`.
81
+ * Categorical palette family (`"blue"`, `"violet"`, …) or a status role as a string
82
+ * (`"success"`, `"error"`): the dot or icon takes `text.<name>` and the box `border.<name>`, the
83
+ * way a status variant renders. For an event's category or data-driven color (a source, a team,
84
+ * a run status map); a status that is meaning takes `variant`. Not with `variant`.
84
85
  */
85
- color: PaletteColor;
86
+ color: RoleColor;
86
87
  }
87
88
  /** One event on the timeline. Passing both `variant` and `color` is a type error. */
88
89
  export type TimelineItem = TimelineItemBase & (TimelineItemVariantProps | TimelineItemColorProps);
@@ -213,23 +213,26 @@ var TIMELINE_VARIANT_TO_CSS_MAP = {
213
213
  * takes, and `border.<family>` and the `background.<family>` fill on the box.
214
214
  */
215
215
  var TIMELINE_COLOR_TO_CSS_MAP = {
216
- red: "gx-Timeline-red-r1khc5e9",
217
- orange: "gx-Timeline-orange-oob0jun",
218
- amber: "gx-Timeline-amber-acpz10x",
219
- yellow: "gx-Timeline-yellow-y1arc1uv",
220
- lime: "gx-Timeline-lime-l1x7dvj6",
221
- green: "gx-Timeline-green-g1fx1m3c",
222
- emerald: "gx-Timeline-emerald-e1gy5gqm",
223
- teal: "gx-Timeline-teal-ttyv4re",
224
- cyan: "gx-Timeline-cyan-c1506u15",
225
- sky: "gx-Timeline-sky-s2f8n55",
226
- blue: "gx-Timeline-blue-b1bza0tc",
227
- indigo: "gx-Timeline-indigo-i1vbt6lr",
228
- violet: "gx-Timeline-violet-vjtm0e",
229
- purple: "gx-Timeline-purple-pek3kdh",
230
- fuchsia: "gx-Timeline-fuchsia-f13hn3pe",
231
- pink: "gx-Timeline-pink-pdf3rdi",
232
- rose: "gx-Timeline-rose-rjv99mk"
216
+ success: "gx-Timeline-success-s1khc5e9",
217
+ warning: "gx-Timeline-warning-wob0jun",
218
+ error: "gx-Timeline-error-ecpz10x",
219
+ red: "gx-Timeline-red-r1arc1uv",
220
+ orange: "gx-Timeline-orange-o1x7dvj6",
221
+ amber: "gx-Timeline-amber-a1fx1m3c",
222
+ yellow: "gx-Timeline-yellow-y1gy5gqm",
223
+ lime: "gx-Timeline-lime-ltyv4re",
224
+ green: "gx-Timeline-green-g1506u15",
225
+ emerald: "gx-Timeline-emerald-e2f8n55",
226
+ teal: "gx-Timeline-teal-t1bza0tc",
227
+ cyan: "gx-Timeline-cyan-c1vbt6lr",
228
+ sky: "gx-Timeline-sky-sjtm0e",
229
+ blue: "gx-Timeline-blue-bek3kdh",
230
+ indigo: "gx-Timeline-indigo-i13hn3pe",
231
+ violet: "gx-Timeline-violet-vdf3rdi",
232
+ purple: "gx-Timeline-purple-pjv99mk",
233
+ fuchsia: "gx-Timeline-fuchsia-f4wvpbo",
234
+ pink: "gx-Timeline-pink-p1qqjpue",
235
+ rose: "gx-Timeline-rose-r183jhdd"
233
236
  };
234
237
  /** A vertical list of events with dot or icon markers (boxed or bare) on a hairline rail. */
235
238
  var Timeline = forwardRef(function Timeline({ items, size = "MEDIUM", markerShape = "SQUARE", isFilled = false, className, style, ...rest }, ref) {
@@ -37,7 +37,7 @@ var TOAST_VARIANT_TO_POLITENESS_MAP = {
37
37
  ERROR: "assertive"
38
38
  };
39
39
  /** How long a toast stays, by default. */
40
- var TOAST_DEFAULT_DURATION_MS = 5e3;
40
+ var TOAST_DEFAULT_DURATION_MS = 3e3;
41
41
  /** Open toasts per region; a sixth dismisses the oldest. */
42
42
  var TOAST_MAX_PER_PLACEMENT = 5;
43
43
  /** How long a dismissed toast stays in the queue so its ScaleFade exit can run: `duration.base`. */
@@ -27,7 +27,7 @@ export interface ToastOptions {
27
27
  action?: ToastAction;
28
28
  /** Spinner in place of the icon; the toast does not time out while loading. @default false */
29
29
  isLoading?: boolean;
30
- /** Milliseconds the toast stays, counted while it is not paused. @default 5000 */
30
+ /** Milliseconds the toast stays, counted while it is not paused. @default 3000 */
31
31
  duration?: number;
32
32
  /** Stay until dismissed; `duration` is ignored. @default false */
33
33
  isPersistent?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galaxy-io/dls",
3
- "version": "2.4.1",
3
+ "version": "2.5.1",
4
4
  "description": "Galaxy Design Language System",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",