@galaxy-io/dls 2.9.0 → 2.10.0

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 (101) hide show
  1. package/dist/beacons/Beacon.d.ts +1 -1
  2. package/dist/beacons/Beacon.js +12 -28
  3. package/dist/brand/GalaxyAlchemyWordmark.d.ts +4 -1
  4. package/dist/brand/GalaxyAlchemyWordmark.js +7 -1
  5. package/dist/brand/GalaxyFilamentWordmark.d.ts +5 -2
  6. package/dist/brand/GalaxyFilamentWordmark.js +9 -2
  7. package/dist/brand/GalaxyLogomark.js +3 -0
  8. package/dist/brand/PoweredBy.d.ts +27 -0
  9. package/dist/brand/PoweredBy.js +96 -0
  10. package/dist/brand/internal/svg/GalaxyFilamentWordmarkSvg.d.ts +1 -1
  11. package/dist/brand/internal/svg/GalaxyFilamentWordmarkSvg.js +2 -2
  12. package/dist/charts/Heatmap.js +25 -9
  13. package/dist/charts/Sparkline.d.ts +1 -1
  14. package/dist/charts/Sparkline.js +10 -26
  15. package/dist/charts/chartFormat.d.ts +1 -1
  16. package/dist/charts/chartFormat.js +2 -2
  17. package/dist/charts/heatmapGeometry.d.ts +14 -0
  18. package/dist/charts/heatmapGeometry.js +17 -1
  19. package/dist/chips/Chip.d.ts +2 -2
  20. package/dist/chips/Chip.js +15 -31
  21. package/dist/drawer/Drawer.d.ts +2 -2
  22. package/dist/drawer/Drawer.js +1 -1
  23. package/dist/editor/CodeEditor.d.ts +1 -1
  24. package/dist/editor/CodeEditor.js +2 -1
  25. package/dist/feedback/Alert.d.ts +36 -9
  26. package/dist/feedback/Alert.js +26 -8
  27. package/dist/feedback/ProgressBar.d.ts +4 -1
  28. package/dist/feedback/ProgressBar.js +17 -30
  29. package/dist/feedback/ProgressCircle.d.ts +1 -1
  30. package/dist/feedback/ProgressCircle.js +14 -30
  31. package/dist/hooks/useEndReached.d.ts +40 -0
  32. package/dist/hooks/useEndReached.js +69 -0
  33. package/dist/icons/Icon.d.ts +36 -8
  34. package/dist/icons/Icon.js +14 -7
  35. package/dist/inputs/CronInput.js +114 -78
  36. package/dist/inputs/DateInput.d.ts +1 -1
  37. package/dist/inputs/DateInput.js +10 -10
  38. package/dist/inputs/MultiSelectInput.d.ts +3 -1
  39. package/dist/inputs/MultiSelectInput.js +8 -3
  40. package/dist/inputs/SelectInput.d.ts +8 -1
  41. package/dist/inputs/SelectInput.js +52 -25
  42. package/dist/inputs/internal/selectAll.d.ts +11 -0
  43. package/dist/inputs/internal/selectAll.js +28 -0
  44. package/dist/json/JsonViewer.js +7 -6
  45. package/dist/layout/AppFrame.d.ts +20 -0
  46. package/dist/layout/AppFrame.js +71 -0
  47. package/dist/layout/EmptyLayout.d.ts +53 -0
  48. package/dist/layout/EmptyLayout.js +59 -0
  49. package/dist/layout/ErrorLayout.d.ts +42 -0
  50. package/dist/layout/ErrorLayout.js +60 -0
  51. package/dist/layout/PageLayout.d.ts +26 -0
  52. package/dist/layout/PageLayout.js +116 -0
  53. package/dist/layout/PendingLayout.d.ts +30 -0
  54. package/dist/layout/PendingLayout.js +57 -0
  55. package/dist/layout/internal/errorState.d.ts +14 -0
  56. package/dist/layout/internal/errorState.js +49 -0
  57. package/dist/layout/internal/region.d.ts +10 -0
  58. package/dist/layout/internal/region.js +24 -0
  59. package/dist/lists/DescriptionList.js +1 -0
  60. package/dist/menu/Menu.d.ts +2 -2
  61. package/dist/menu/Menu.js +6 -13
  62. package/dist/modal/Modal.d.ts +2 -2
  63. package/dist/modal/Modal.js +1 -1
  64. package/dist/navigation/CommandPalette.js +4 -11
  65. package/dist/navigation/SidebarNav.d.ts +5 -0
  66. package/dist/navigation/SidebarNav.js +41 -22
  67. package/dist/navigation/Topbar.js +4 -0
  68. package/dist/shapes/Circle.d.ts +1 -1
  69. package/dist/shapes/Circle.js +10 -26
  70. package/dist/shapes/Square.d.ts +1 -1
  71. package/dist/shapes/Square.js +10 -26
  72. package/dist/styles/internal/roleColor.d.ts +3 -0
  73. package/dist/styles/internal/roleColor.js +42 -0
  74. package/dist/styles/mixins.js +1 -1
  75. package/dist/styles.css +1 -1
  76. package/dist/table/InfiniteSpreadsheet.js +6 -6
  77. package/dist/table/InfiniteTable.d.ts +52 -20
  78. package/dist/table/InfiniteTable.js +3 -2
  79. package/dist/table/TableCore.d.ts +7 -1
  80. package/dist/table/TableCore.js +93 -83
  81. package/dist/table/VirtualizedInfiniteTable.d.ts +53 -21
  82. package/dist/table/VirtualizedInfiniteTable.js +7 -5
  83. package/dist/table/useInfiniteScrollSentinel.d.ts +13 -13
  84. package/dist/table/useInfiniteScrollSentinel.js +7 -51
  85. package/dist/theme/tokens/dark.js +1 -1
  86. package/dist/theme/tokens/light.js +4 -3
  87. package/dist/theme/tokens/types.d.ts +7 -7
  88. package/dist/timeline/Timeline.d.ts +1 -1
  89. package/dist/timeline/Timeline.js +6 -24
  90. package/dist/tokens.css +1 -1
  91. package/dist/utils/format.d.ts +35 -10
  92. package/dist/utils/format.js +60 -12
  93. package/dist/utils/search.d.ts +15 -0
  94. package/dist/utils/search.js +24 -0
  95. package/dist/vite/index.d.ts +16 -2
  96. package/dist/vite/index.js +28 -19
  97. package/dist/vite/internal/themeBoot.d.ts +25 -0
  98. package/dist/vite/internal/themeBoot.js +44 -0
  99. package/dist/vite/internal/wywOptions.d.ts +46 -0
  100. package/dist/vite/internal/wywOptions.js +44 -0
  101. package/package.json +34 -1
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @internal What `galaxyDls()` injects into `index.html` so the first paint is already in the
3
+ * right theme: one inline script that sets `data-gx-theme` on `<html>`, and one `<style>` that
4
+ * paints the canvas per theme. Private on purpose (an `internal/` module: built, never a package
5
+ * export).
6
+ *
7
+ * The script resolves the theme exactly as `GalaxyProvider` does on mount, so nothing flips when
8
+ * React takes over: a valid stored choice (`DARK`, `LIGHT` or `SYSTEM` under `storageKey`) wins
9
+ * over the configured `theme`; `SYSTEM` reads `prefers-color-scheme`, and falls back to dark where
10
+ * `matchMedia` is missing (the provider's default). It reads storage and never writes it, and any
11
+ * error leaves the page as the server sent it.
12
+ *
13
+ * The background is a `<style>` keyed off the attribute, never an inline `style` on `<html>`: an
14
+ * inline background would stay the boot theme after a runtime switch, because nothing removes it.
15
+ * Its values come from the token modules, so they are `background.base` in each theme.
16
+ */
17
+ import { GalaxyTheme } from "../../theme/enums.js";
18
+ /** @internal The provider's default storage key; the boot script must read the same one. */
19
+ export declare const DEFAULT_THEME_STORAGE_KEY = "galaxy:theme";
20
+ /** @internal The boot script's source: resolves the theme and sets `data-gx-theme`. */
21
+ export declare function themeBootScript(theme: GalaxyTheme, storageKey: string): string;
22
+ /** @internal The canvas per theme, keyed off the attribute the script (then the provider) sets. */
23
+ export declare function themeBackgroundStyle(): string;
24
+ /** @internal The themes `galaxyDls({ theme })` accepts. */
25
+ export declare const BOOT_THEMES: readonly string[];
@@ -0,0 +1,44 @@
1
+ import { GalaxyTheme } from "../../theme/enums.js";
2
+ import { DARK_THEME } from "../../theme/tokens/dark.js";
3
+ import { LIGHT_THEME } from "../../theme/tokens/light.js";
4
+ //#region src/vite/internal/themeBoot.ts
5
+ /**
6
+ * @internal What `galaxyDls()` injects into `index.html` so the first paint is already in the
7
+ * right theme: one inline script that sets `data-gx-theme` on `<html>`, and one `<style>` that
8
+ * paints the canvas per theme. Private on purpose (an `internal/` module: built, never a package
9
+ * export).
10
+ *
11
+ * The script resolves the theme exactly as `GalaxyProvider` does on mount, so nothing flips when
12
+ * React takes over: a valid stored choice (`DARK`, `LIGHT` or `SYSTEM` under `storageKey`) wins
13
+ * over the configured `theme`; `SYSTEM` reads `prefers-color-scheme`, and falls back to dark where
14
+ * `matchMedia` is missing (the provider's default). It reads storage and never writes it, and any
15
+ * error leaves the page as the server sent it.
16
+ *
17
+ * The background is a `<style>` keyed off the attribute, never an inline `style` on `<html>`: an
18
+ * inline background would stay the boot theme after a runtime switch, because nothing removes it.
19
+ * Its values come from the token modules, so they are `background.base` in each theme.
20
+ */
21
+ /** @internal The provider's default storage key; the boot script must read the same one. */
22
+ var DEFAULT_THEME_STORAGE_KEY = "galaxy:theme";
23
+ /** A JSON string literal that is also safe inside a `<script>` element (no `<\/script>` break-out). */
24
+ var toScriptLiteral = (value) => JSON.stringify(value).replace(/</g, "\\u003c");
25
+ /** @internal The boot script's source: resolves the theme and sets `data-gx-theme`. */
26
+ function themeBootScript(theme, storageKey) {
27
+ return [
28
+ "(function(){",
29
+ `var t=${toScriptLiteral(theme)},s=null;`,
30
+ `try{s=window.localStorage.getItem(${toScriptLiteral(storageKey)})}catch(e){}`,
31
+ "if(s===\"DARK\"||s===\"LIGHT\"||s===\"SYSTEM\")t=s;",
32
+ "if(t===\"SYSTEM\"){t=\"DARK\";try{if(!window.matchMedia(\"(prefers-color-scheme: dark)\").matches)t=\"LIGHT\"}catch(e){}}",
33
+ "document.documentElement.setAttribute(\"data-gx-theme\",t===\"LIGHT\"?\"light\":\"dark\")",
34
+ "})();"
35
+ ].join("");
36
+ }
37
+ /** @internal The canvas per theme, keyed off the attribute the script (then the provider) sets. */
38
+ function themeBackgroundStyle() {
39
+ return [`html[data-gx-theme="dark"]{background:${DARK_THEME.color.background.base}}`, `html[data-gx-theme="light"]{background:${LIGHT_THEME.color.background.base}}`].join("");
40
+ }
41
+ /** @internal The themes `galaxyDls({ theme })` accepts. */
42
+ var BOOT_THEMES = Object.values(GalaxyTheme);
43
+ //#endregion
44
+ export { BOOT_THEMES, DEFAULT_THEME_STORAGE_KEY, themeBackgroundStyle, themeBootScript };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @internal The one class-name and compile config for Linaria (wyw-in-js), shared by the DLS's own
3
+ * build and Storybook (`wyw.config.ts`) and by the app preset (`galaxyDls()`), so a DLS class and
4
+ * an app class are named and emitted the same way. Private on purpose (an `internal/` module:
5
+ * built, never a package export). Each caller adds only what differs: its `include` / `exclude`,
6
+ * and how it resolves the Babel presets.
7
+ *
8
+ * Class names read `<prefix>-<Component>-<Part>-<hash>` (`gx-Button-Label-1a2b3c`); a styled root
9
+ * named `Root` drops the part (`gx-Button-1a2b3c`), so the inspector names the component.
10
+ */
11
+ /** The DLS class prefix; also the default app prefix. */
12
+ export declare const DLS_CLASS_PREFIX = "gx";
13
+ /** What wyw passes the slug function besides the hash and the styled name. */
14
+ interface SlugArgs {
15
+ name: string;
16
+ }
17
+ /** @internal The class-name slug for a prefix: `<prefix>-<Component>-<Part>-<hash>`, `Root` unnamed. */
18
+ export declare function classNameSlug(prefix: string): (hash: string, title: string, { name }: SlugArgs) => string;
19
+ /**
20
+ * @internal The options every caller shares, for a class prefix: the slug, no vendor prefixes,
21
+ * and the React import overrides.
22
+ *
23
+ * `prefixer: false`: every browser the DLS targets reads the unprefixed properties, and the stylis
24
+ * prefixer would add about 1,300 `-webkit-` declarations and duplicate every keyframe. Apps get
25
+ * the same, so their CSS and the DLS's match.
26
+ *
27
+ * React is reached while wyw evaluates `styled` components at build time; loading it as-is is
28
+ * expected, so the "unknown import reached during eval" warning is silenced for it (the dev
29
+ * runtime too, for an app's dev server).
30
+ */
31
+ export declare function sharedWywOptions(prefix: string): {
32
+ readonly classNameSlug: (hash: string, title: string, { name }: SlugArgs) => string;
33
+ readonly prefixer: false;
34
+ readonly importOverrides: {
35
+ readonly react: {
36
+ readonly unknown: "allow";
37
+ };
38
+ readonly "react/jsx-runtime": {
39
+ readonly unknown: "allow";
40
+ };
41
+ readonly "react/jsx-dev-runtime": {
42
+ readonly unknown: "allow";
43
+ };
44
+ };
45
+ };
46
+ export {};
@@ -0,0 +1,44 @@
1
+ //#region src/vite/internal/wywOptions.ts
2
+ /**
3
+ * @internal The one class-name and compile config for Linaria (wyw-in-js), shared by the DLS's own
4
+ * build and Storybook (`wyw.config.ts`) and by the app preset (`galaxyDls()`), so a DLS class and
5
+ * an app class are named and emitted the same way. Private on purpose (an `internal/` module:
6
+ * built, never a package export). Each caller adds only what differs: its `include` / `exclude`,
7
+ * and how it resolves the Babel presets.
8
+ *
9
+ * Class names read `<prefix>-<Component>-<Part>-<hash>` (`gx-Button-Label-1a2b3c`); a styled root
10
+ * named `Root` drops the part (`gx-Button-1a2b3c`), so the inspector names the component.
11
+ */
12
+ /** The DLS class prefix; also the default app prefix. */
13
+ var DLS_CLASS_PREFIX = "gx";
14
+ /** The styled root's name; its class drops the part segment. */
15
+ var ROOT_PART = "Root";
16
+ /** @internal The class-name slug for a prefix: `<prefix>-<Component>-<Part>-<hash>`, `Root` unnamed. */
17
+ function classNameSlug(prefix) {
18
+ return (hash, title, { name }) => `${prefix}-${name}${title === ROOT_PART ? "" : `-${title}`}-${hash}`;
19
+ }
20
+ /**
21
+ * @internal The options every caller shares, for a class prefix: the slug, no vendor prefixes,
22
+ * and the React import overrides.
23
+ *
24
+ * `prefixer: false`: every browser the DLS targets reads the unprefixed properties, and the stylis
25
+ * prefixer would add about 1,300 `-webkit-` declarations and duplicate every keyframe. Apps get
26
+ * the same, so their CSS and the DLS's match.
27
+ *
28
+ * React is reached while wyw evaluates `styled` components at build time; loading it as-is is
29
+ * expected, so the "unknown import reached during eval" warning is silenced for it (the dev
30
+ * runtime too, for an app's dev server).
31
+ */
32
+ function sharedWywOptions(prefix) {
33
+ return {
34
+ classNameSlug: classNameSlug(prefix),
35
+ prefixer: false,
36
+ importOverrides: {
37
+ react: { unknown: "allow" },
38
+ "react/jsx-runtime": { unknown: "allow" },
39
+ "react/jsx-dev-runtime": { unknown: "allow" }
40
+ }
41
+ };
42
+ }
43
+ //#endregion
44
+ export { DLS_CLASS_PREFIX, classNameSlug, sharedWywOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galaxy-io/dls",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "Galaxy Design Language System",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -69,6 +69,10 @@
69
69
  "types": "./dist/brand/GalaxyWordmark.d.ts",
70
70
  "import": "./dist/brand/GalaxyWordmark.js"
71
71
  },
72
+ "./brand/PoweredBy": {
73
+ "types": "./dist/brand/PoweredBy.d.ts",
74
+ "import": "./dist/brand/PoweredBy.js"
75
+ },
72
76
  "./brand/brandMark": {
73
77
  "types": "./dist/brand/brandMark.d.ts",
74
78
  "import": "./dist/brand/brandMark.js"
@@ -297,6 +301,10 @@
297
301
  "types": "./dist/hooks/useElementWidth.d.ts",
298
302
  "import": "./dist/hooks/useElementWidth.js"
299
303
  },
304
+ "./hooks/useEndReached": {
305
+ "types": "./dist/hooks/useEndReached.d.ts",
306
+ "import": "./dist/hooks/useEndReached.js"
307
+ },
300
308
  "./hooks/useField": {
301
309
  "types": "./dist/hooks/useField.d.ts",
302
310
  "import": "./dist/hooks/useField.js"
@@ -441,6 +449,10 @@
441
449
  "types": "./dist/json/JsonViewer.d.ts",
442
450
  "import": "./dist/json/JsonViewer.js"
443
451
  },
452
+ "./layout/AppFrame": {
453
+ "types": "./dist/layout/AppFrame.d.ts",
454
+ "import": "./dist/layout/AppFrame.js"
455
+ },
444
456
  "./layout/Box": {
445
457
  "types": "./dist/layout/Box.d.ts",
446
458
  "import": "./dist/layout/Box.js"
@@ -449,6 +461,14 @@
449
461
  "types": "./dist/layout/Divider.d.ts",
450
462
  "import": "./dist/layout/Divider.js"
451
463
  },
464
+ "./layout/EmptyLayout": {
465
+ "types": "./dist/layout/EmptyLayout.d.ts",
466
+ "import": "./dist/layout/EmptyLayout.js"
467
+ },
468
+ "./layout/ErrorLayout": {
469
+ "types": "./dist/layout/ErrorLayout.d.ts",
470
+ "import": "./dist/layout/ErrorLayout.js"
471
+ },
452
472
  "./layout/Flex": {
453
473
  "types": "./dist/layout/Flex.d.ts",
454
474
  "import": "./dist/layout/Flex.js"
@@ -461,6 +481,14 @@
461
481
  "types": "./dist/layout/Grid.d.ts",
462
482
  "import": "./dist/layout/Grid.js"
463
483
  },
484
+ "./layout/PageLayout": {
485
+ "types": "./dist/layout/PageLayout.d.ts",
486
+ "import": "./dist/layout/PageLayout.js"
487
+ },
488
+ "./layout/PendingLayout": {
489
+ "types": "./dist/layout/PendingLayout.d.ts",
490
+ "import": "./dist/layout/PendingLayout.js"
491
+ },
464
492
  "./layout/Portal": {
465
493
  "types": "./dist/layout/Portal.d.ts",
466
494
  "import": "./dist/layout/Portal.js"
@@ -757,6 +785,10 @@
757
785
  "types": "./dist/utils/format.d.ts",
758
786
  "import": "./dist/utils/format.js"
759
787
  },
788
+ "./utils/search": {
789
+ "types": "./dist/utils/search.d.ts",
790
+ "import": "./dist/utils/search.js"
791
+ },
760
792
  "./vite": {
761
793
  "types": "./dist/vite/index.d.ts",
762
794
  "import": "./dist/vite/index.js"
@@ -946,6 +978,7 @@
946
978
  "d3-scale": "^4.0.2",
947
979
  "d3-shape": "^3.2.0",
948
980
  "glob": "^13.0.6",
981
+ "happy-dom": "20.10.2",
949
982
  "lottie-react": "^2.4.1",
950
983
  "publint": "^0.3.25",
951
984
  "react": "^18.3.1",