@assure-one/design-system 1.33.0 → 1.34.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.
@@ -176,11 +176,18 @@ function installDomPolyfills(options = {}) {
176
176
 
177
177
  // src/testing/toast-recorder.ts
178
178
  var REGION = '[role="region"][aria-live]';
179
+ var TITLE_CLASS = "ds:font-semibold";
180
+ var LOADING_CLASS = "ds:animate-spin";
179
181
  var VARIANT_CLASSES = [
180
- ["bg-success-bg", "success"],
181
- ["bg-warning-bg", "warning"],
182
- ["bg-info/12", "info"]
182
+ ["ds:bg-success-bg", "success"],
183
+ ["ds:bg-warning-bg", "warning"],
184
+ ["ds:bg-info/12", "info"]
183
185
  ];
186
+ function hasClass(root, cls) {
187
+ if (!root) return false;
188
+ if (root.classList.contains(cls)) return true;
189
+ return Array.from(root.querySelectorAll("*")).some((el) => el.classList.contains(cls));
190
+ }
184
191
  function text(node) {
185
192
  return (node?.textContent ?? "").replace(/\s+/g, " ").trim();
186
193
  }
@@ -202,12 +209,12 @@ function read(el) {
202
209
  const chip = el.querySelector('span[aria-hidden="true"]');
203
210
  const body = chip?.nextElementSibling ?? null;
204
211
  const paragraphs = Array.from(body?.querySelectorAll(":scope > p") ?? []);
205
- const title = paragraphs.find((p) => p.classList.contains("font-semibold"));
212
+ const title = paragraphs.find((p) => p.classList.contains(TITLE_CLASS));
206
213
  const description = paragraphs.find((p) => p !== title);
207
214
  const action = body?.querySelector(":scope > button") ?? null;
208
215
  let variant = "default";
209
216
  if (role === "alert") variant = "destructive";
210
- else if (chip?.querySelector(".animate-spin")) variant = "loading";
217
+ else if (hasClass(chip, LOADING_CLASS)) variant = "loading";
211
218
  else {
212
219
  for (const [cls, v] of VARIANT_CLASSES) if (chip?.classList.contains(cls)) variant = v;
213
220
  }
@@ -174,11 +174,18 @@ function installDomPolyfills(options = {}) {
174
174
 
175
175
  // src/testing/toast-recorder.ts
176
176
  var REGION = '[role="region"][aria-live]';
177
+ var TITLE_CLASS = "ds:font-semibold";
178
+ var LOADING_CLASS = "ds:animate-spin";
177
179
  var VARIANT_CLASSES = [
178
- ["bg-success-bg", "success"],
179
- ["bg-warning-bg", "warning"],
180
- ["bg-info/12", "info"]
180
+ ["ds:bg-success-bg", "success"],
181
+ ["ds:bg-warning-bg", "warning"],
182
+ ["ds:bg-info/12", "info"]
181
183
  ];
184
+ function hasClass(root, cls) {
185
+ if (!root) return false;
186
+ if (root.classList.contains(cls)) return true;
187
+ return Array.from(root.querySelectorAll("*")).some((el) => el.classList.contains(cls));
188
+ }
182
189
  function text(node) {
183
190
  return (node?.textContent ?? "").replace(/\s+/g, " ").trim();
184
191
  }
@@ -200,12 +207,12 @@ function read(el) {
200
207
  const chip = el.querySelector('span[aria-hidden="true"]');
201
208
  const body = chip?.nextElementSibling ?? null;
202
209
  const paragraphs = Array.from(body?.querySelectorAll(":scope > p") ?? []);
203
- const title = paragraphs.find((p) => p.classList.contains("font-semibold"));
210
+ const title = paragraphs.find((p) => p.classList.contains(TITLE_CLASS));
204
211
  const description = paragraphs.find((p) => p !== title);
205
212
  const action = body?.querySelector(":scope > button") ?? null;
206
213
  let variant = "default";
207
214
  if (role === "alert") variant = "destructive";
208
- else if (chip?.querySelector(".animate-spin")) variant = "loading";
215
+ else if (hasClass(chip, LOADING_CLASS)) variant = "loading";
209
216
  else {
210
217
  for (const [cls, v] of VARIANT_CLASSES) if (chip?.classList.contains(cls)) variant = v;
211
218
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assure-one/design-system",
3
- "version": "1.33.0",
3
+ "version": "1.34.0",
4
4
  "description": "Assure One design system — tokens, primitives, and patterns for the Assure Suite.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -155,7 +155,9 @@
155
155
  "scripts": {
156
156
  "prebuild": "pnpm tokens:build",
157
157
  "build": "tsup && pnpm build:testing && pnpm build:css && pnpm build:css:entries",
158
- "build:css": "tailwindcss -i ./src/tokens/consumer.css -o ./dist/styles.css --minify",
158
+ "build:css": "tailwindcss -i ./src/tokens/consumer.css -o ./dist/styles.css --minify && node scripts/css/compat.mjs",
159
+ "class-flip": "node scripts/class-flip/run.mjs",
160
+ "class-flip:check": "node scripts/class-flip/run.mjs --check",
159
161
  "build:css:entries": "node scripts/build-css-entries.mjs",
160
162
  "build:testing": "tsup --config tsup.testing.config.ts",
161
163
  "dev": "tsup --watch",