@galaxy-io/dls 2.3.1 → 2.4.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 (40) hide show
  1. package/biome/plugins/no-inline-style.grit +6 -3
  2. package/biome/plugins/warn/no-inline-style.grit +3 -1
  3. package/dist/beacons/Beacon.d.ts +7 -6
  4. package/dist/beacons/Beacon.js +21 -14
  5. package/dist/brand/GalaxyFilamentWordmark.js +10 -11
  6. package/dist/brand/GalaxyLogomark.js +8 -14
  7. package/dist/{three → brand}/GalaxyLogomark3D.d.ts +1 -6
  8. package/dist/{three → brand}/GalaxyLogomark3D.js +16 -17
  9. package/dist/brand/GalaxyWordmark.js +10 -36
  10. package/dist/{three → brand}/assets/galaxy-logomark.js +1 -1
  11. package/dist/{three → brand/internal}/galaxyLogomark3DScene.d.ts +1 -3
  12. package/dist/{three → brand/internal}/galaxyLogomark3DScene.js +45 -50
  13. package/dist/brand/internal/svg/GalaxyFilamentWordmarkSvg.d.ts +13 -0
  14. package/dist/brand/internal/svg/GalaxyFilamentWordmarkSvg.js +26 -0
  15. package/dist/brand/internal/svg/GalaxyLogomarkSvg.d.ts +13 -0
  16. package/dist/brand/internal/svg/GalaxyLogomarkSvg.js +30 -0
  17. package/dist/brand/internal/svg/GalaxyWordmarkSvg.d.ts +13 -0
  18. package/dist/brand/internal/svg/GalaxyWordmarkSvg.js +36 -0
  19. package/dist/charts/BarChart.js +3 -5
  20. package/dist/charts/ChartFrame.d.ts +4 -7
  21. package/dist/charts/ChartFrame.js +5 -5
  22. package/dist/charts/ChartLegend.d.ts +2 -9
  23. package/dist/charts/ChartLegend.js +4 -12
  24. package/dist/charts/ChartTooltip.d.ts +2 -3
  25. package/dist/charts/ChartTooltip.js +3 -3
  26. package/dist/charts/Heatmap.js +3 -4
  27. package/dist/charts/LineChart.d.ts +1 -1
  28. package/dist/charts/LineChart.js +3 -4
  29. package/dist/charts/PieChart.js +3 -4
  30. package/dist/charts/types.d.ts +12 -0
  31. package/dist/charts/types.js +9 -1
  32. package/dist/inputs/NumberInput.d.ts +1 -1
  33. package/dist/inputs/PasswordInput.d.ts +1 -1
  34. package/dist/inputs/SearchInput.d.ts +1 -1
  35. package/dist/inputs/ToggleInput.d.ts +9 -9
  36. package/dist/inputs/ToggleInput.js +40 -25
  37. package/dist/styles.css +1 -1
  38. package/dist/theme/tokens/light.js +2 -2
  39. package/dist/tokens.css +2 -2
  40. package/package.json +11 -10
@@ -1,12 +1,15 @@
1
1
  // DLS: no inline `style={{ … }}` except to set CSS custom properties (Constitution IV.1).
2
- // `style={{ "--gx-x": value, ["--gx-y"]: value, ...style }}` is fine; `style={{ color: … }}`,
3
- // `style={{ color }}` (shorthand) and `style={{ [key]: … }}` (non-`--` computed key) are not.
2
+ // `style={{ "--gx-x": value, ["--gx-y"]: value, [GRID_BACKGROUND_COLOR_VAR]: value, ...style }}` is
3
+ // fine (a computed key named `*_VAR` is an exported custom-property constant); `style={{ color: … }}`,
4
+ // `style={{ color }}` (shorthand) and `style={{ [key]: … }}` (any other computed key) are not.
4
5
  language js
5
6
 
6
7
  JsxAttribute(name=$name, initializer=$value) where {
7
8
  $name <: "style",
8
9
  $value <: contains or {
9
- JsPropertyObjectMember(name=$key) as $member where { $key <: not r"(?s)(?:\[\s*)?[\"'`]--.*" },
10
+ JsPropertyObjectMember(name=$key) as $member where {
11
+ $key <: not r"(?s)(?:(?:\[\s*)?[\"'`]--.*|\[\s*[A-Z][A-Z0-9_]*_VAR\s*\])"
12
+ },
10
13
  JsShorthandPropertyObjectMember() as $member
11
14
  },
12
15
  register_diagnostic(span=$member, message="DLS: inline style may only set CSS custom properties (`--gx-*`). Style with Linaria.", severity="error")
@@ -6,7 +6,9 @@ language js
6
6
  JsxAttribute(name=$name, initializer=$value) where {
7
7
  $name <: "style",
8
8
  $value <: contains or {
9
- JsPropertyObjectMember(name=$key) as $member where { $key <: not r"(?s)(?:\[\s*)?[\"'`]--.*" },
9
+ JsPropertyObjectMember(name=$key) as $member where {
10
+ $key <: not r"(?s)(?:(?:\[\s*)?[\"'`]--.*|\[\s*[A-Z][A-Z0-9_]*_VAR\s*\])"
11
+ },
10
12
  JsShorthandPropertyObjectMember() as $member
11
13
  },
12
14
  register_diagnostic(span=$member, message="DLS: inline style may only set CSS custom properties (`--gx-*`). Style with Linaria.", severity="warn")
@@ -13,7 +13,7 @@ export declare enum BeaconSize {
13
13
  /** 10px, beside `body_lg` (20px line); a label is `body_lg` with an 8px gap. */
14
14
  X_LARGE = "X_LARGE"
15
15
  }
16
- /** Dot color role (Constitution V-A color set). Resolves to `color.text.*`. */
16
+ /** Dot color role (Constitution V-A color set). Neutral steps resolve to `color.text.*`; statuses fill with `color.solid.<status>.background` and label with `color.text.<status>`. */
17
17
  export declare enum BeaconVariant {
18
18
  /** `text.primary`. The default (1.x `BASE` / `PRIMARY`). */
19
19
  PRIMARY = "PRIMARY",
@@ -25,11 +25,11 @@ export declare enum BeaconVariant {
25
25
  DISABLED = "DISABLED",
26
26
  /** The parent's color (`currentColor`). */
27
27
  INHERIT = "INHERIT",
28
- /** Status: success, `text.success`. */
28
+ /** Status: success. Dot `solid.success.background`, label `text.success`. */
29
29
  SUCCESS = "SUCCESS",
30
- /** Status: warning, `text.warning`. */
30
+ /** Status: warning. Dot `solid.warning.background`, label `text.warning`. */
31
31
  WARNING = "WARNING",
32
- /** Status: error, `text.error`. */
32
+ /** Status: error. Dot `solid.error.background`, label `text.error`. */
33
33
  ERROR = "ERROR"
34
34
  }
35
35
  interface BeaconBaseProps extends AriaAttributes {
@@ -85,8 +85,9 @@ interface BeaconColorProps {
85
85
  */
86
86
  variant?: undefined;
87
87
  /**
88
- * Categorical palette family (`"blue"`, `"violet"`, …): the dot, ring and label take
89
- * `text.<family>`, the way a status variant renders. For categories; meanings take `variant`.
88
+ * Categorical palette family (`"blue"`, `"violet"`, …): the dot and ring take
89
+ * `solid.<family>.background` and the label `text.<family>`, the way a status variant renders.
90
+ * For categories; meanings take `variant`.
90
91
  * Not with `variant`.
91
92
  */
92
93
  color: PaletteColor;
@@ -18,10 +18,13 @@ import { cx } from "@linaria/core";
18
18
  * lands on the root, so `<Tooltip body={reason}><Beacon label="Failed" … /></Tooltip>` works.
19
19
  *
20
20
  * Color is CSS, not JS: `BEACON_VARIANT_TO_CSS_MAP` (or `BEACON_COLOR_TO_CSS_MAP` for a categorical
21
- * `color`) sets `color` from `color.text.*` and the fill
22
- * reads `currentColor` (the Icon and Circle pattern), so `INHERIT` and `hex` share one path and a
23
- * theme switch needs no re-render. `hex` is set as the `--gx-beacon-hex` custom property
24
- * in `style` and read by a block switched on only when the prop is set.
21
+ * `color`) sets `color` from `color.text.*` for the label and `--gx-beacon-fill` from
22
+ * `color.solid.*.background` for the dot and its ring. A small solid fill is not text: the `text`
23
+ * roles are tuned for 4.5:1 copy on the canvas, which in Light makes a dark, muddy dot, while the
24
+ * `solid` fills are the strong, mode-stable fills the Button and Chip draw. The neutral steps have
25
+ * no solid fill, so they and `INHERIT` fill with `currentColor` (the Icon and Circle pattern); a
26
+ * theme switch needs no re-render. `hex` is set as the `--gx-beacon-hex` custom property in
27
+ * `style` and read by a block, switched on only when the prop is set, that routes it to both.
25
28
  *
26
29
  * `isPulse` repeats an expanding ring (the root's `::after`, in the dot's own color) to say "this is
27
30
  * happening now". It stops under `prefers-reduced-motion` and `GalaxyProvider reducedMotion`. Not a
@@ -42,7 +45,7 @@ var BeaconSize = /* @__PURE__ */ function(BeaconSize) {
42
45
  BeaconSize["X_LARGE"] = "X_LARGE";
43
46
  return BeaconSize;
44
47
  }({});
45
- /** Dot color role (Constitution V-A color set). Resolves to `color.text.*`. */
48
+ /** Dot color role (Constitution V-A color set). Neutral steps resolve to `color.text.*`; statuses fill with `color.solid.<status>.background` and label with `color.text.<status>`. */
46
49
  var BeaconVariant = /* @__PURE__ */ function(BeaconVariant) {
47
50
  /** `text.primary`. The default (1.x `BASE` / `PRIMARY`). */
48
51
  BeaconVariant["PRIMARY"] = "PRIMARY";
@@ -54,18 +57,19 @@ var BeaconVariant = /* @__PURE__ */ function(BeaconVariant) {
54
57
  BeaconVariant["DISABLED"] = "DISABLED";
55
58
  /** The parent's color (`currentColor`). */
56
59
  BeaconVariant["INHERIT"] = "INHERIT";
57
- /** Status: success, `text.success`. */
60
+ /** Status: success. Dot `solid.success.background`, label `text.success`. */
58
61
  BeaconVariant["SUCCESS"] = "SUCCESS";
59
- /** Status: warning, `text.warning`. */
62
+ /** Status: warning. Dot `solid.warning.background`, label `text.warning`. */
60
63
  BeaconVariant["WARNING"] = "WARNING";
61
- /** Status: error, `text.error`. */
64
+ /** Status: error. Dot `solid.error.background`, label `text.error`. */
62
65
  BeaconVariant["ERROR"] = "ERROR";
63
66
  return BeaconVariant;
64
67
  }({});
65
68
  /**
66
69
  * The root is the dot: phrasing content, so it is valid inside `Text`, a `<button>` or a `<label>`.
67
- * The fill is `currentColor`; `forced-color-adjust: none` keeps it visible in high contrast. The
68
- * pulse ring is `::after`, invisible at rest.
70
+ * The fill is `--gx-beacon-fill` (a `solid` fill for a status or family), falling back to
71
+ * `currentColor` for the neutral steps and `INHERIT`; `forced-color-adjust: none` keeps it visible
72
+ * in high contrast. The pulse ring is `::after`, invisible at rest, in the same fill.
69
73
  */
70
74
  var Root = /*#__PURE__*/ styled("span")({
71
75
  name: "Root",
@@ -105,7 +109,10 @@ var BEACON_SIZE_TO_TEXT_SIZE_MAP = {
105
109
  ["LARGE"]: TextSize.BODY_LG,
106
110
  ["X_LARGE"]: TextSize.BODY_LG
107
111
  };
108
- /** Sets `color`; the dot and ring read it. Block for block the same as `ICON_VARIANT_TO_CSS_MAP`. */
112
+ /**
113
+ * Sets `color` (the label; the neutral dots) and, for a status, `--gx-beacon-fill` (the dot and
114
+ * ring). The color blocks are block for block the same as `ICON_VARIANT_TO_CSS_MAP`.
115
+ */
109
116
  var BEACON_VARIANT_TO_CSS_MAP = {
110
117
  ["PRIMARY"]: "gx-Beacon-PRIMARY-piy6lav",
111
118
  ["SECONDARY"]: "gx-Beacon-SECONDARY-sm47yol",
@@ -116,7 +123,7 @@ var BEACON_VARIANT_TO_CSS_MAP = {
116
123
  ["WARNING"]: "gx-Beacon-WARNING-w1d27vzd",
117
124
  ["ERROR"]: "gx-Beacon-ERROR-eshtlvu"
118
125
  };
119
- /** Categorical `color`: `text.<family>`, the way a status variant renders. */
126
+ /** Categorical `color`: the label `text.<family>`, the dot `solid.<family>.background`, the way a status variant renders. */
120
127
  var BEACON_COLOR_TO_CSS_MAP = {
121
128
  red: "gx-Beacon-red-r1nxs4in",
122
129
  orange: "gx-Beacon-orange-o1dc3rbq",
@@ -136,11 +143,11 @@ var BEACON_COLOR_TO_CSS_MAP = {
136
143
  pink: "gx-Beacon-pink-p1tc1xnc",
137
144
  rose: "gx-Beacon-rose-rgzv1cm"
138
145
  };
139
- /** Declared after the variant and color maps so `hex` wins over them. */
146
+ /** Declared after the variant and color maps so `hex` wins over them: the label and the dot both take it. */
140
147
  var HEX_CSS = "gx-Beacon-HEX_CSS-h1marsuc";
141
148
  /**
142
149
  * One pulse every thirteen `duration.base` steps (1.95s, the 1.x 2s default), linear, forever: the
143
- * ring grows from the dot's edge to 2.5× while it fades from 0.5 to 0. Paint-only (`transform`), so
150
+ * ring, in the dot's fill, grows from the dot's edge to 2.5× while it fades from 0.5 to 0. Paint-only (`transform`), so
144
151
  * the line box never moves. The keyframes are global, so the name is `gx-` prefixed.
145
152
  * `REDUCED_MOTION` stops it and the ring falls back to its resting `opacity: 0`.
146
153
  */
@@ -1,4 +1,5 @@
1
1
  import { BRAND_MARK_INVERSE_CSS, BRAND_MARK_NEUTRAL_CSS, BRAND_MARK_SVG_CSS, brandMarkAriaProps } from "./brandMark.js";
2
+ import GalaxyFilamentWordmarkSvg, { GALAXY_FILAMENT_WORDMARK_VIEW_BOX } from "./internal/svg/GalaxyFilamentWordmarkSvg.js";
2
3
  import { forwardRef } from "react";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  import { cx } from "@linaria/core";
@@ -6,32 +7,30 @@ import { cx } from "@linaria/core";
6
7
  /**
7
8
  * Filament's product wordmark: the word "filament" in the slanted Galaxy display lettering, as one
8
9
  * inline SVG. It behaves exactly like `GalaxyWordmark`: it paints `text.primary`, reads only CSS
9
- * variables, and is SSR-safe. 1.x swapped a dark
10
- * and a light svgr asset by reading the theme in JS (and its JSDoc called it "The Galaxy wordmark").
10
+ * variables, and is SSR-safe.
11
+ *
12
+ * The artwork is `src/brand/assets/galaxy-filament-wordmark.svg`, compiled by `pnpm assets` into
13
+ * the private `GalaxyFilamentWordmarkSvg`; the aspect ratio comes from its
14
+ * `GALAXY_FILAMENT_WORDMARK_VIEW_BOX`.
11
15
  */
12
- /** Width ÷ height of the artwork (its viewBox, `0 0 4513 1200`). */
13
- var GALAXY_FILAMENT_WORDMARK_ASPECT_RATIO = 4513 / 1200;
14
- /** The `d` of the single `<path>` of the 1.x `galaxy-filament-wordmark-dark.svg`, verbatim. */
15
- var GALAXY_FILAMENT_WORDMARK_PATH = "M181.814 1141.98L159.701 1200L0 985.717L292.377 210.999L363.136 151.659H701.801L660.525 253.856H517.432L468.053 385.708H617.534L579.697 487.246H429.725L181.814 1141.98ZM720.432 336.273L766.622 212.318H1005.44L958.942 336.273H720.432ZM505.694 910.552L701.758 384.404H941.065L745.001 910.552H505.694ZM825.912 910.552L1109.45 151.659L1131.06 92.978L1290.77 307.262L1065.71 910.552H825.912ZM1452.44 720.004L1419.51 808.356H1510.91L1544.32 720.004H1452.44ZM1582.16 617.808L1630.81 487.259H1539.41L1510.41 563.743H1271.11L1316.32 443.085L1359.56 384.404H1864.71L1886.33 443.085L1711.4 910.552H1185.61L1163.99 851.872L1250.96 617.808H1582.16ZM2016.67 910.552H1788.05L1983.62 385.063H2742.33L2763.95 443.085L2590 910.552H2361.38L2519.61 487.259H2457.44L2299.21 910.552H2082.28L2240.01 487.259H2173.91L2016.67 910.552ZM2998.33 664.621L2943.8 808.356H3034.7L3075 703.522H3314.3L3258.29 852.531L3215.04 910.552H2709.9L2688.27 852.531L2840.6 443.085L2883.84 385.063H3388.99L3410.62 443.085L3330.03 665.281H3090.23V664.621H2998.33ZM3128.07 563.083L3155.09 487.259H3063.2L3035.68 563.083H3128.07ZM3553.12 910.552H3313.32L3508.9 385.063H4033.2L4054.83 443.085L3880.38 910.552H3640.59L3798.81 487.259H3710.36L3553.12 910.552ZM4120.38 481.326L4158.22 379.788L4243.72 149.681L4265.34 91L4425.04 304.625L4397.53 379.788H4513L4470.74 481.326H4359.69L4237.83 808.356H4343.2L4299.17 910.552H4197.24H4003.92L3980.82 854.51L4120.38 481.326Z";
16
+ /** Width ÷ height of the artwork, from its viewBox. */
17
+ var GALAXY_FILAMENT_WORDMARK_ASPECT_RATIO = GALAXY_FILAMENT_WORDMARK_VIEW_BOX.width / GALAXY_FILAMENT_WORDMARK_VIEW_BOX.height;
16
18
  /** Filament's product wordmark, painted `text.primary`. Labelled "Filament" unless `ariaLabel=""`. */
17
19
  var GalaxyFilamentWordmark = forwardRef(function GalaxyFilamentWordmark({ size = 20, isInverse = false, ariaLabel = "Filament", id, className, style, ...rest }, ref) {
18
20
  const aria = brandMarkAriaProps(ariaLabel);
19
- return /* @__PURE__ */ jsx("svg", {
21
+ return /* @__PURE__ */ jsx(GalaxyFilamentWordmarkSvg, {
20
22
  ref,
21
23
  id,
22
24
  role: aria.role,
23
25
  "aria-label": aria["aria-label"],
24
26
  "aria-hidden": aria["aria-hidden"],
25
27
  ...rest,
26
- xmlns: "http://www.w3.org/2000/svg",
27
- viewBox: "0 0 4513 1200",
28
28
  width: size * GALAXY_FILAMENT_WORDMARK_ASPECT_RATIO,
29
29
  height: size,
30
30
  fill: "currentColor",
31
31
  focusable: "false",
32
32
  className: cx(BRAND_MARK_SVG_CSS, isInverse ? BRAND_MARK_INVERSE_CSS : BRAND_MARK_NEUTRAL_CSS, className),
33
- style,
34
- children: /* @__PURE__ */ jsx("path", { d: GALAXY_FILAMENT_WORDMARK_PATH })
33
+ style
35
34
  });
36
35
  });
37
36
  GalaxyFilamentWordmark.displayName = "GalaxyFilamentWordmark";
@@ -1,39 +1,33 @@
1
1
  import { BRAND_MARK_CSS, BRAND_MARK_INVERSE_CSS, BRAND_MARK_SVG_CSS, brandMarkAriaProps } from "./brandMark.js";
2
+ import GalaxyLogomarkSvg from "./internal/svg/GalaxyLogomarkSvg.js";
2
3
  import { forwardRef } from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { jsx } from "react/jsx-runtime";
4
5
  import { cx } from "@linaria/core";
5
6
  //#region src/brand/GalaxyLogomark.tsx
6
7
  /**
7
8
  * The Galaxy brand mark: the two-circle, one-ribbon glyph as one inline SVG. It paints with the
8
9
  * monochrome fill (`color.solid.primary.background`, which is `text.primary`: the 1.x look). Color
9
- * is CSS (`fill="currentColor"`), so it is SSR-safe and a theme switch needs no re-render. 1.x swapped a dark and a light svgr asset by reading the theme in JS.
10
+ * is CSS (`fill="currentColor"`), so it is SSR-safe and a theme switch needs no re-render.
11
+ *
12
+ * The artwork is `src/brand/assets/galaxy-logomark.svg`, compiled by `pnpm assets` into the private
13
+ * `GalaxyLogomarkSvg`; this component only names, sizes and colors it.
10
14
  */
11
- /**
12
- * The two circles (top left, bottom right): the `d` of the first two `<path>`s of the 1.x
13
- * `galaxy-logomark-dark.svg`, verbatim, joined (each starts with its own `M`).
14
- */
15
- var GALAXY_LOGOMARK_CIRCLES_PATH = "M239.88,479.75c132.27,0,239.88-107.61,239.88-239.88S372.14,0,239.88,0,0,107.61,0,239.88s107.61,239.88,239.88,239.88M840.12,600.25c-132.27,0-239.88,107.61-239.88,239.88s107.61,239.88,239.88,239.88,239.88-107.61,239.88-239.88-107.61-239.88-239.88-239.88";
16
- /** The ribbon joining them: the `d` of the third `<path>` of the 1.x asset, verbatim. */
17
- var GALAXY_LOGOMARK_RIBBON_PATH = "M473.59,894.23c27.96-103.95.03-195.9,112.41-308.28,112.37-112.38,204.13-84.39,308.07-112.32,8.08-1.87,16.02-4.15,23.77-6.81.07-.02.13-.04.19-.06h.01c94.13-32.43,161.95-121.88,161.95-226.88C1080,107.61,972.39,0,840.12,0,735.12,0,645.68,67.82,613.25,161.95h-.01c-.03.1-.05.18-.08.26-2.65,7.72-4.92,15.61-6.78,23.67-27.93,103.9-.72,196.5-112.24,308.02-111.53,111.52-204.35,84.54-308.26,112.48-8.06,1.86-15.95,4.13-23.67,6.78-.08.02-.16.05-.25.08h-.01C67.82,645.68,0,735.13,0,840.13,0,972.39,107.61,1079.99,239.88,1079.99c105,0,194.46-67.82,226.88-161.95,0,0,0,0,0,0,0-.02,0-.04.01-.06,1.66-4.8,3.16-9.67,4.51-14.6.83-3.02,1.59-6.07,2.3-9.14";
18
15
  /** The Galaxy brand mark, painted `text.primary`. Decorative unless `ariaLabel` is set. */
19
16
  var GalaxyLogomark = forwardRef(function GalaxyLogomark({ size = 20, isInverse = false, ariaLabel, id, className, style, ...rest }, ref) {
20
17
  const aria = brandMarkAriaProps(ariaLabel ?? rest["aria-label"]);
21
- return /* @__PURE__ */ jsxs("svg", {
18
+ return /* @__PURE__ */ jsx(GalaxyLogomarkSvg, {
22
19
  ref,
23
20
  id,
24
21
  role: aria.role,
25
22
  "aria-label": aria["aria-label"],
26
23
  "aria-hidden": aria["aria-hidden"],
27
24
  ...rest,
28
- xmlns: "http://www.w3.org/2000/svg",
29
- viewBox: "0 0 1080 1080",
30
25
  width: size,
31
26
  height: size,
32
27
  fill: "currentColor",
33
28
  focusable: "false",
34
29
  className: cx(BRAND_MARK_SVG_CSS, isInverse ? BRAND_MARK_INVERSE_CSS : BRAND_MARK_CSS, className),
35
- style,
36
- children: [/* @__PURE__ */ jsx("path", { d: GALAXY_LOGOMARK_CIRCLES_PATH }), /* @__PURE__ */ jsx("path", { d: GALAXY_LOGOMARK_RIBBON_PATH })]
30
+ style
37
31
  });
38
32
  });
39
33
  GalaxyLogomark.displayName = "GalaxyLogomark";
@@ -21,12 +21,7 @@ export interface GalaxyLogomark3DProps extends AriaAttributes {
21
21
  */
22
22
  isInteractive?: boolean;
23
23
  /**
24
- * Do a quick double flip on random axes when the pointer enters.
25
- * @default false
26
- */
27
- isHoverable?: boolean;
28
- /**
29
- * Auto-rotation rate in radians per second. The hover flip lasts `0.5 / speed` seconds.
24
+ * Auto-rotation rate in radians per second.
30
25
  * @default 2
31
26
  */
32
27
  speed?: number;
@@ -1,21 +1,23 @@
1
1
  import { useGalaxyTheme } from "../theme/useGalaxyTheme.js";
2
- import { brandMarkAriaProps } from "../brand/brandMark.js";
3
- import GalaxyLogomark from "../brand/GalaxyLogomark.js";
2
+ import { brandMarkAriaProps } from "./brandMark.js";
3
+ import GalaxyLogomark from "./GalaxyLogomark.js";
4
4
  import { usePrefersReducedMotion } from "../hooks/usePrefersReducedMotion.js";
5
5
  /* empty css */
6
6
  import { styled } from "@linaria/react";
7
7
  import { forwardRef, useEffect, useRef, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { cx } from "@linaria/core";
10
- //#region src/three/GalaxyLogomark3D.tsx
10
+ //#region src/brand/GalaxyLogomark3D.tsx
11
11
  /**
12
12
  * The Galaxy mark as a lit, glossy 3D object for hero moments (a landing hero, a sign-in splash).
13
- * It can spin slowly, flip when the pointer arrives, and be dragged to orbit. Its material takes
14
- * the monochrome fill (`solid.primary.background`, read as resolved hex from `useGalaxyTheme()`
15
- * because WebGL needs a number, not a CSS variable). It always starts as the flat `GalaxyLogomark`: the server and first
13
+ * It can spin slowly and be dragged to orbit. Its material takes the monochrome fill
14
+ * (`solid.primary.background`, read as resolved hex from `useGalaxyTheme()` because WebGL needs a
15
+ * number, not a CSS variable). It always starts as the flat `GalaxyLogomark`: the server and first
16
16
  * client render are the static mark; after mount, if WebGL is available and motion is not reduced,
17
- * three.js (an optional peer) and the model load lazily and the 3D mark replaces the flat one in
18
- * the same box. This module imports nothing from three.js; the scene lives behind one `import()`.
17
+ * three.js (an optional peer) and the model (`src/brand/assets/galaxy-logomark.obj`) load lazily
18
+ * and the 3D mark replaces the flat one in the same box. This module imports nothing from
19
+ * three.js; the scene lives behind one `import()`, like the Lottie player behind
20
+ * `GalaxyLogomarkAnimation`.
19
21
  */
20
22
  /**
21
23
  * At the 1.x camera (z = 4, fov 45°, mesh scale 0.088) the resting mesh spans ≈ 76% of the
@@ -25,15 +27,15 @@ var FALLBACK_SCALE = .76;
25
27
  /** The box: a square of the requested size; the flat mark centers in it, the canvas covers it. */
26
28
  var Root = /*#__PURE__*/ styled("span")({
27
29
  name: "Root",
28
- class: "gx-GalaxyLogomark3D-r1dn73it",
30
+ class: "gx-GalaxyLogomark3D-r1kglu6n",
29
31
  propsAsIs: false
30
32
  });
31
33
  /** `isInteractive`: the grab cursor while orbiting is possible. */
32
- var INTERACTIVE_CSS = "gx-GalaxyLogomark3D-INTERACTIVE_CSS-i13nzb8h";
34
+ var INTERACTIVE_CSS = "gx-GalaxyLogomark3D-INTERACTIVE_CSS-it2gejs";
33
35
  /** The WebGL canvas fills the box. */
34
- var CANVAS_CSS = "gx-GalaxyLogomark3D-CANVAS_CSS-c11hevag";
36
+ var CANVAS_CSS = "gx-GalaxyLogomark3D-CANVAS_CSS-cxuzirs";
35
37
  /** Until the first frame is drawn, the canvas is laid out but not shown. */
36
- var CANVAS_HIDDEN_CSS = "gx-GalaxyLogomark3D-CANVAS_HIDDEN_CSS-c1eyhbl2";
38
+ var CANVAS_HIDDEN_CSS = "gx-GalaxyLogomark3D-CANVAS_HIDDEN_CSS-cfz0w5z";
37
39
  /** Whether this browser can create a WebGL context. Called in an effect, never at import. */
38
40
  function isWebGLSupported() {
39
41
  try {
@@ -44,7 +46,7 @@ function isWebGLSupported() {
44
46
  }
45
47
  }
46
48
  /** The Galaxy mark in 3D, painted `text.primary`. Decorative unless `ariaLabel` is set. */
47
- var GalaxyLogomark3D = forwardRef(function GalaxyLogomark3D({ size = 128, isInverse = false, isAutoRotate = false, isInteractive = false, isHoverable = false, speed = 2, ariaLabel, id, className, style, ...rest }, ref) {
49
+ var GalaxyLogomark3D = forwardRef(function GalaxyLogomark3D({ size = 128, isInverse = false, isAutoRotate = false, isInteractive = false, speed = 2, ariaLabel, id, className, style, ...rest }, ref) {
48
50
  const { theme } = useGalaxyTheme();
49
51
  const prefersReducedMotion = usePrefersReducedMotion();
50
52
  const [isWebGLAvailable, setIsWebGLAvailable] = useState(false);
@@ -57,7 +59,6 @@ var GalaxyLogomark3D = forwardRef(function GalaxyLogomark3D({ size = 128, isInve
57
59
  color,
58
60
  isAutoRotate,
59
61
  isInteractive,
60
- isHoverable,
61
62
  speed
62
63
  };
63
64
  const optionsRef = useRef(options);
@@ -72,7 +73,7 @@ var GalaxyLogomark3D = forwardRef(function GalaxyLogomark3D({ size = 128, isInve
72
73
  let isCancelled = false;
73
74
  const onContextLost = () => setIsReady(false);
74
75
  canvas.addEventListener("webglcontextlost", onContextLost);
75
- import("./galaxyLogomark3DScene.js").then(({ mountGalaxyLogomark3DScene }) => {
76
+ import("./internal/galaxyLogomark3DScene.js").then(({ mountGalaxyLogomark3DScene }) => {
76
77
  if (isCancelled) return;
77
78
  try {
78
79
  sceneRef.current = mountGalaxyLogomark3DScene(canvas, optionsRef.current, () => {
@@ -94,7 +95,6 @@ var GalaxyLogomark3D = forwardRef(function GalaxyLogomark3D({ size = 128, isInve
94
95
  color,
95
96
  isAutoRotate,
96
97
  isInteractive,
97
- isHoverable,
98
98
  speed
99
99
  });
100
100
  }, [
@@ -102,7 +102,6 @@ var GalaxyLogomark3D = forwardRef(function GalaxyLogomark3D({ size = 128, isInve
102
102
  color,
103
103
  isAutoRotate,
104
104
  isInteractive,
105
- isHoverable,
106
105
  speed
107
106
  ]);
108
107
  const aria = brandMarkAriaProps(ariaLabel ?? rest["aria-label"]);
@@ -1,61 +1,35 @@
1
1
  import { BRAND_MARK_INVERSE_CSS, BRAND_MARK_NEUTRAL_CSS, BRAND_MARK_SVG_CSS, brandMarkAriaProps } from "./brandMark.js";
2
+ import GalaxyWordmarkSvg, { GALAXY_WORDMARK_VIEW_BOX } from "./internal/svg/GalaxyWordmarkSvg.js";
2
3
  import { forwardRef } from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { jsx } from "react/jsx-runtime";
4
5
  import { cx } from "@linaria/core";
5
6
  //#region src/brand/GalaxyWordmark.tsx
6
7
  /**
7
8
  * The word "galaxy" in the Galaxy brand lettering, as one inline SVG. It is type, so it paints
8
9
  * with the monochrome hierarchy (`text.primary`), like the `GalaxyLogomark` beside it. Color is
9
- * CSS (`fill="currentColor"`), so it is SSR-safe and follows the theme with no re-render. 1.x swapped a dark and a light svgr
10
- * asset by reading the theme in JS.
10
+ * CSS (`fill="currentColor"`), so it is SSR-safe and follows the theme with no re-render.
11
+ *
12
+ * The artwork is `src/brand/assets/galaxy-wordmark.svg`, compiled by `pnpm assets` into the private
13
+ * `GalaxyWordmarkSvg`; the aspect ratio comes from its `GALAXY_WORDMARK_VIEW_BOX`.
11
14
  */
12
- /** Width ÷ height of the artwork (its viewBox, `0 0 1080 355.84`). */
13
- var GALAXY_WORDMARK_ASPECT_RATIO = 1080 / 355.84;
14
- /** "g". */
15
- var GALAXY_WORDMARK_G_PATH = "M55.16,176.18c0,40.12,20.28,53.2,46.88,53.2s46.01-13.08,46.01-53.2-19.41-53.2-46.01-53.2-46.88,13.08-46.88,53.2M98.34,355.84c-63.01,0-98.34-22.68-98.34-74.13h61.05c-.87,25.95,15.26,30.96,40.99,30.96s45.35-6.98,45.35-37.72v-17.66c-11.56,11.34-28.56,18.97-50.58,18.97C37.5,276.26,0,243.55,0,176.18s38.81-102.26,90.92-102.26c22.68,0,42.3,8.94,56.47,22.02v-18.53h55.6v197.54c0,58.22-37.29,80.89-104.66,80.89";
16
- /** The first "a". */
17
- var GALAXY_WORDMARK_FIRST_A_PATH = "M300.69,231.56c19.62,0,37.94-8.07,46.01-27.47v-31.4c-9.59,10.25-21.59,17.88-40.77,21.8l-10.9,2.18c-14.83,3.05-20.93,7.41-20.93,17.88s10.47,17.01,26.6,17.01M346.69,255.11c-15.26,15.7-32.71,23.33-59.09,23.33-41.65,0-71.08-23.77-71.08-63.89,0-32.71,17.88-48.62,74.79-58.22l31.18-5.23c19.19-3.27,24.2-7.2,24.2-15.92s-3.49-14.83-32.05-14.83c-21.37,0-37.94,6.11-35.76,26.6h-57.56c-3.93-53.2,45.57-73.04,92.89-73.04,55.6,0,87.87,21.59,87.87,72.82v128.21h-55.38v-19.84Z";
18
- /** "l": `<rect x width height>`. */
19
- var GALAXY_WORDMARK_L_RECT = {
20
- x: "419.1",
21
- width: "55.6",
22
- height: "274.95"
23
- };
24
- /** The second "a". */
25
- var GALAXY_WORDMARK_SECOND_A_PATH = "M572.39,231.56c19.62,0,37.94-8.07,46.01-27.47v-31.4c-9.59,10.25-21.59,17.88-40.77,21.8l-10.9,2.18c-14.83,3.05-20.93,7.41-20.93,17.88s10.47,17.01,26.6,17.01M618.39,255.11c-15.26,15.7-32.7,23.33-59.09,23.33-41.65,0-71.08-23.77-71.08-63.89,0-32.71,17.88-48.62,74.79-58.22l31.18-5.23c19.19-3.27,24.2-7.2,24.2-15.92s-3.49-14.83-32.05-14.83c-21.37,0-37.94,6.11-35.76,26.6h-57.56c-3.93-53.2,45.57-73.04,92.89-73.04,55.6,0,87.87,21.59,87.87,72.82v128.21h-55.38v-19.84Z";
26
- /** "x": `<polygon points>`. */
27
- var GALAXY_WORDMARK_X_POINTS = "776.09 221.75 739.25 274.95 672.53 274.95 742.3 176.61 673.62 77.4 740.12 77.4 776.75 131.26 813.38 77.4 879.01 77.4 809.24 176.39 878.57 274.95 812.29 274.95 776.09 221.75";
28
- /** "y". */
29
- var GALAXY_WORDMARK_Y_PATH = "M1080,77.4l-82.85,226.98c-10.25,27.91-20.93,51.46-52.55,51.46-13.08,0-27.47-3.05-41.43-7.2v-50.37l10.03,3.05c20.06,6.11,29,1.31,34.01-12.65l5.45-15.26-75.44-196.02h60.83l41.21,120.58,42.74-120.58h58Z";
15
+ /** Width ÷ height of the artwork, from its viewBox. */
16
+ var GALAXY_WORDMARK_ASPECT_RATIO = GALAXY_WORDMARK_VIEW_BOX.width / GALAXY_WORDMARK_VIEW_BOX.height;
30
17
  /** The Galaxy wordmark, painted `text.primary`. Labelled "Galaxy" unless `ariaLabel=""`. */
31
18
  var GalaxyWordmark = forwardRef(function GalaxyWordmark({ size = 20, isInverse = false, ariaLabel = "Galaxy", id, className, style, ...rest }, ref) {
32
19
  const aria = brandMarkAriaProps(ariaLabel);
33
- return /* @__PURE__ */ jsxs("svg", {
20
+ return /* @__PURE__ */ jsx(GalaxyWordmarkSvg, {
34
21
  ref,
35
22
  id,
36
23
  role: aria.role,
37
24
  "aria-label": aria["aria-label"],
38
25
  "aria-hidden": aria["aria-hidden"],
39
26
  ...rest,
40
- xmlns: "http://www.w3.org/2000/svg",
41
- viewBox: "0 0 1080 355.84",
42
27
  width: size * GALAXY_WORDMARK_ASPECT_RATIO,
43
28
  height: size,
44
29
  fill: "currentColor",
45
30
  focusable: "false",
46
31
  className: cx(BRAND_MARK_SVG_CSS, isInverse ? BRAND_MARK_INVERSE_CSS : BRAND_MARK_NEUTRAL_CSS, className),
47
- style,
48
- children: [
49
- /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("path", { d: GALAXY_WORDMARK_G_PATH }), /* @__PURE__ */ jsx("path", { d: GALAXY_WORDMARK_FIRST_A_PATH })] }),
50
- /* @__PURE__ */ jsx("rect", {
51
- x: GALAXY_WORDMARK_L_RECT.x,
52
- width: GALAXY_WORDMARK_L_RECT.width,
53
- height: GALAXY_WORDMARK_L_RECT.height
54
- }),
55
- /* @__PURE__ */ jsx("path", { d: GALAXY_WORDMARK_SECOND_A_PATH }),
56
- /* @__PURE__ */ jsx("polygon", { points: GALAXY_WORDMARK_X_POINTS }),
57
- /* @__PURE__ */ jsx("path", { d: GALAXY_WORDMARK_Y_PATH })
58
- ]
32
+ style
59
33
  });
60
34
  });
61
35
  GalaxyWordmark.displayName = "GalaxyWordmark";