@dashspec/renderer 0.1.13 → 0.1.14

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/dist/index.js CHANGED
@@ -116,7 +116,7 @@ import {
116
116
  translator,
117
117
  validateDocument,
118
118
  widgetChecks
119
- } from "./chunk-42YQDK6L.js";
119
+ } from "./chunk-LPALJPKV.js";
120
120
  import {
121
121
  createStateProxy,
122
122
  getPath,
@@ -1702,8 +1702,9 @@ ${Object.entries(vars).filter(([k, v]) => SAFE_NAME.test(k) && !UNSAFE_CSS.test(
1702
1702
  function widgetThemeCss(theme, scope2) {
1703
1703
  const out = [];
1704
1704
  for (const [kind, w] of Object.entries(theme.widgets ?? {})) {
1705
- if (!/^[A-Za-z][\w.-]*$/.test(kind) || !w) continue;
1706
- const sel = `${scope2} .ds-panel[data-kind="${kind}"]`;
1705
+ const m = /^([A-Za-z][\w.-]*)(?::([A-Za-z][\w-]*))?$/.exec(kind);
1706
+ if (!m || !w) continue;
1707
+ const sel = `${scope2} .ds-panel[data-kind="${m[1]}"]${m[2] ? `[data-variant="${m[2]}"]` : ""}`;
1707
1708
  const vars = Object.entries(w.vars ?? {}).filter(([k, v]) => SAFE_NAME.test(k) && !UNSAFE_CSS.test(String(v)));
1708
1709
  if (vars.length) out.push(`${sel} { ${vars.map(([k, v]) => `${k}: ${v};`).join(" ")} }`);
1709
1710
  if (w.css && !/<\/?\s*style/i.test(w.css))
@@ -4180,6 +4181,7 @@ function PanelFrameInner({ id, nested }) {
4180
4181
  "data-tone": tone2,
4181
4182
  "data-panel": id,
4182
4183
  "data-kind": def.kind,
4184
+ "data-variant": def.style?.variant || void 0,
4183
4185
  "data-selected": selected || void 0,
4184
4186
  "data-nested": nested || void 0,
4185
4187
  "aria-label": title ?? id,