@streamoid/ui 0.6.57 → 0.6.58

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.
@@ -230,10 +230,14 @@ routes work, don't pass both.
230
230
  DOM class list literally contains `undefined`. Harmless in the browser, but it
231
231
  shows up in snapshot tests — don't assert on the exact class string.
232
232
 
233
- **9. jsdom tests need a stub.** Importing from the `@streamoid/ui` barrel pulls
234
- `ScButton`, which touches `CSS.registerProperty` at module load. Both host repos
235
- `vi.mock("@streamoid/ui")` with a div that surfaces `state` and forwards `onClick`
236
- (see `catalogix/dashboard app/tests/formControls.test.jsx`).
233
+ **9. jsdom tests no longer need a stub (0.6.58+).** Importing from the
234
+ `@streamoid/ui` barrel pulls `ScButton`, which touches `CSS.registerProperty` at
235
+ module load. Its guard used to reach for `CSS` as soon as `window` existed —
236
+ and jsdom defines `window` but NOT `CSS`, so the whole barrel threw on import.
237
+ Hosts worked around it with `vi.mock("@streamoid/ui")` and a hand-written stub
238
+ (see `catalogix/dashboard app/tests/formControls.test.jsx`). The guard now
239
+ checks `typeof CSS` first, so the real component renders in jsdom and those
240
+ mocks can go as each host gets to them.
237
241
 
238
242
  ---
239
243
 
@@ -193,10 +193,12 @@ handler even though the switch ignores it.
193
193
  **9. No transition.** ON and OFF are two different SVG trees, so React swaps them —
194
194
  the knob teleports. Don't promise a sliding animation in a spec.
195
195
 
196
- **10. jsdom tests need a stub.** Host repos mock `@streamoid/ui` (see
197
- `catalogix/dashboard app/tests/formControls.test.jsx`, which stubs
198
- `ScToggleSwitch` with a div exposing `data-checked`) because the barrel import
199
- touches `CSS.registerProperty`.
196
+ **10. jsdom tests no longer need a stub (0.6.58+).** Host repos mocked
197
+ `@streamoid/ui` (see `catalogix/dashboard app/tests/formControls.test.jsx`,
198
+ which stubs `ScToggleSwitch` with a div exposing `data-checked`) because the
199
+ barrel import touched `CSS.registerProperty` where jsdom provides `window` but
200
+ no `CSS`. The guard now checks `typeof CSS` first, so the real component
201
+ renders and those mocks can go as each host gets to them.
200
202
 
201
203
  ---
202
204
 
package/dist/index.js CHANGED
@@ -1752,7 +1752,7 @@ var ScButton_default = {
1752
1752
  var import_icons7 = require("@streamoid/icons");
1753
1753
  var import_react6 = require("react");
1754
1754
  var import_jsx_runtime16 = require("react/jsx-runtime");
1755
- if (typeof window !== "undefined" && CSS.registerProperty) {
1755
+ if (typeof window !== "undefined" && typeof CSS !== "undefined" && typeof CSS.registerProperty === "function") {
1756
1756
  const props = [
1757
1757
  { name: "--x-0", val: "72%" },
1758
1758
  { name: "--y-0", val: "90%" },
package/dist/index.mjs CHANGED
@@ -1553,7 +1553,7 @@ var ScButton_default = {
1553
1553
  import { SiconHome as SiconHome2 } from "@streamoid/icons";
1554
1554
  import { useState as useState4, useEffect as useEffect2, isValidElement, cloneElement } from "react";
1555
1555
  import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1556
- if (typeof window !== "undefined" && CSS.registerProperty) {
1556
+ if (typeof window !== "undefined" && typeof CSS !== "undefined" && typeof CSS.registerProperty === "function") {
1557
1557
  const props = [
1558
1558
  { name: "--x-0", val: "72%" },
1559
1559
  { name: "--y-0", val: "90%" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/ui",
3
- "version": "0.6.57",
3
+ "version": "0.6.58",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -22,7 +22,8 @@
22
22
  "dev": "sh -c 'npm run watch:js & npm run watch:dts & wait'",
23
23
  "lint": "eslint src/",
24
24
  "test:panel-resize": "npm run build:js && node --test tests/panel-resize.test.mjs",
25
- "test:search-shortcut": "npm run build:js && node --test tests/search-shortcut.test.mjs"
25
+ "test:search-shortcut": "npm run build:js && node --test tests/search-shortcut.test.mjs",
26
+ "test:barrel-import": "npm run build:js && node --test tests/barrel-import-in-jsdom.test.mjs"
26
27
  },
27
28
  "peerDependencies": {
28
29
  "react": "^18.0.0 || ^19.0.0",