@intility/bifrost-experimental 0.2.0 → 0.3.1-next.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,23 @@
1
1
  # @intility/bifrost-experimental
2
2
 
3
- ## 0.2.0
3
+ ## 0.3.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6ea3508]
8
+ - Updated dependencies [71b282c]
9
+ - Updated dependencies [a9ac56c]
10
+ - Updated dependencies [9918e2b]
11
+ - Updated dependencies [d434618]
12
+ - @intility/bifrost-react@7.0.0-next.0
13
+
14
+ ## 0.3.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 7ed86c6: `TwinkleBackground` now covers the top 35% of the viewport height instead of the top 40% of its container, so it looks the same on every front page, however tall the page is, but at least 240px. If the container is shorter than that, the dots cover the whole container. The first row of dots now always sits 8px from the top, where it before moved between 8px and 16px depending on the height. `fill` is unchanged. You can remove any CSS that overrides the height of the canvas.
19
+
20
+ ## 0.2.0 - 2026-10-28
4
21
 
5
22
  ### Minor Changes
6
23
 
@@ -97,7 +97,13 @@ overlap the title. */
97
97
 
98
98
  /* A canvas is a replaced element, so inset alone doesn't stretch it */
99
99
  width: 100%;
100
- height: 40%;
100
+
101
+ /* 35% of the viewport, not of the container, so every front page looks the
102
+ same however tall it is. svh and not dvh: the dvh changes while a mobile
103
+ browser's toolbar shows and hides, which would lay the dots out again while
104
+ scrolling. At least 240px, so a short viewport still gets a fade that reads
105
+ as one. 100% keeps it inside a container shorter than that. */
106
+ height: min(max(35svh, 240px), 100%);
101
107
  z-index: -1;
102
108
  pointer-events: none;
103
109
 
@@ -7,8 +7,9 @@ export type TwinkleBackgroundProps = {
7
7
  color?: "theme" | "teal" | "purple" | "pink" | "yellow" | "red" | "green";
8
8
  /**
9
9
  * Fills the whole container with evenly spread dots, with no fade, for a
10
- * background inside a card or a `Box`. By default the dots cover the top 40%
11
- * of the container and fade out down the page.
10
+ * background inside a card or a `Box`. By default the dots cover the top 35%
11
+ * of the viewport height, at least 240px, or the whole container if that is
12
+ * shorter, and fade out down the page.
12
13
  * @default false
13
14
  */
14
15
  fill?: boolean;
@@ -17,9 +18,10 @@ export type TwinkleBackgroundProps = {
17
18
  * Animated dot grid in the Bifrost theme color, for the front page of a
18
19
  * Platform Manager module. It fades out down the page and reacts to hover and
19
20
  * clicks. Render it as the first child of a container with
20
- * `position: relative` and `isolation: isolate`; it fills the top 40% of that
21
- * container, behind its content, or all of it with `fill`. No dot is cut off
22
- * by the edge of the container. Experimental: AI-generated, not reviewed line
21
+ * `position: relative` and `isolation: isolate`; it covers the top 35% of the
22
+ * viewport height, at least 240px (the whole container if that is shorter),
23
+ * behind its content, or all of the container with `fill`. No dot is cut off by the edge
24
+ * of the container. Experimental: AI-generated, not reviewed line
23
25
  * by line.
24
26
  *
25
27
  * @see https://bifrost.intility.com/react/experimental/twinkle-background
@@ -47,9 +47,10 @@ const within = (rect, x, y) => x >= 0 && x <= rect.width && y >= 0 && y <= rect.
47
47
  * Animated dot grid in the Bifrost theme color, for the front page of a
48
48
  * Platform Manager module. It fades out down the page and reacts to hover and
49
49
  * clicks. Render it as the first child of a container with
50
- * `position: relative` and `isolation: isolate`; it fills the top 40% of that
51
- * container, behind its content, or all of it with `fill`. No dot is cut off
52
- * by the edge of the container. Experimental: AI-generated, not reviewed line
50
+ * `position: relative` and `isolation: isolate`; it covers the top 35% of the
51
+ * viewport height, at least 240px (the whole container if that is shorter),
52
+ * behind its content, or all of the container with `fill`. No dot is cut off by the edge
53
+ * of the container. Experimental: AI-generated, not reviewed line
53
54
  * by line.
54
55
  *
55
56
  * @see https://bifrost.intility.com/react/experimental/twinkle-background
@@ -231,7 +232,7 @@ const TwinkleBackground = t0 => {
231
232
  const rows = Math.max(1, Math.floor(h / SPACING));
232
233
  span = (rows - 1) * SPACING;
233
234
  offsetX = (w - (cols - 1) * SPACING) / 2;
234
- offsetY = (h - span) / 2;
235
+ offsetY = fill ? (h - span) / 2 : SPACING / 2;
235
236
  rand = Float32Array.from({
236
237
  length: cols * rows * 2
237
238
  }, (_, i_1) => noise((i_1 >> 1) % cols, Math.floor(i_1 / 2 / cols), i_1 & 1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intility/bifrost-experimental",
3
- "version": "0.2.0",
3
+ "version": "0.3.1-next.0",
4
4
  "description": "Experimental, AI-generated React components for Intility's design system, Bifrost.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -42,12 +42,12 @@
42
42
  "access": "public"
43
43
  },
44
44
  "peerDependencies": {
45
- "@intility/bifrost-react": "^6",
45
+ "@intility/bifrost-react": "^7.0.0-next.0",
46
46
  "react": "^17 || ^18 || ^19",
47
47
  "react-dom": "^17 || ^18 || ^19"
48
48
  },
49
49
  "devDependencies": {
50
- "@intility/bifrost-react": "^6.23.0"
50
+ "@intility/bifrost-react": "^7.0.0-next.0"
51
51
  },
52
52
  "dependencies": {
53
53
  "react-compiler-runtime": "^1.0.0"