@webority/theme 0.171.3 → 0.172.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/README.md CHANGED
@@ -246,6 +246,21 @@ Set `dir="rtl"` on `<html>` and the theme follows. There is no option, provider
246
246
 
247
247
  Product code writes `ms-*` and `me-*`, `text-start` and `text-end`, and `float-start` and `float-end`, never `ml-*`, `mr-*`, `text-left`, `text-right`, `float-left` or `float-right`.
248
248
 
249
+ ### Your own CSS
250
+
251
+ A product that writes physical sides (`left`, `margin-right`, `border-left`) in its own stylesheets can run the same pass on them. Add `rtlMirrorPlugin`, imported from `@webority/theme/postcss/rtl-mirror`, with the option `wholeSheet: true`:
252
+
253
+ ```js
254
+ // postcss.config.mjs
255
+ import { rtlMirrorPlugin } from "@webority/theme/postcss/rtl-mirror";
256
+
257
+ export default {
258
+ plugins: [rtlMirrorPlugin({ wholeSheet: true })],
259
+ };
260
+ ```
261
+
262
+ The pass rewrites the whole sheet, with no Bootstrap markers needed. Keyframes and popper rules are skipped. The theme's own build keeps the marker mode, so the theme output does not change.
263
+
249
264
  ## Print and high contrast are opt-in
250
265
 
251
266
  One extra file, the modes file, holds the print rules, the high contrast rules and the token values both
@@ -1,9 +1,12 @@
1
1
  import { type Plugin, type Root } from "postcss";
2
- export declare function rewriteRoot(root: Root): {
2
+ export type RtlMirrorOptions = {
3
+ wholeSheet?: boolean;
4
+ };
5
+ export declare function rewriteRoot(root: Root, options?: RtlMirrorOptions): {
3
6
  converted: number;
4
7
  twinned: number;
5
8
  };
6
- export declare function rtlMirrorPlugin(): Plugin;
9
+ export declare function rtlMirrorPlugin(options?: RtlMirrorOptions): Plugin;
7
10
  export declare namespace rtlMirrorPlugin {
8
11
  var _a: boolean;
9
12
  export { _a as postcss };
@@ -1 +1 @@
1
- import e from"postcss";var t=`rtl-mirror: Bootstrap markers not found; the pass must see the /*! Bootstrap */ banner and /*! wui-bootstrap-end */.`,n=/^!\s*wui-bootstrap-end$/,r=[`data-popper-placement`,`bs-popover-`,`bs-tooltip-`,`[data-bs-popper]`],i=/\btranslate(X)?\(\s*-50%/,a=/\btranslate(X)?\(/g,o=/^(left|right)(?=\s|$)/i,s=/\b(left|right)\b/gi,c=/::[\w-]+(\([^)]*\))?$/,l=/^[+-]?0*(\.0*)?(px|%|r?em|vw|vh|deg)?$/i,u=/* @__PURE__ */ new Map([[`left`,`inset-inline-start`],[`right`,`inset-inline-end`],[`margin-left`,`margin-inline-start`],[`margin-right`,`margin-inline-end`],[`padding-left`,`padding-inline-start`],[`padding-right`,`padding-inline-end`],[`border-top-left-radius`,`border-start-start-radius`],[`border-top-right-radius`,`border-start-end-radius`],[`border-bottom-left-radius`,`border-end-start-radius`],[`border-bottom-right-radius`,`border-end-end-radius`]]),d=/* @__PURE__ */ new Map([[`left`,`start`],[`right`,`end`]]),f=/* @__PURE__ */ new Map([[`left`,`inline-start`],[`right`,`inline-end`]]);function p(e){return e.type===`comment`}function m(e){return e.type===`decl`}function h(e){return e.type===`atrule`}function g(e){for(let t=e.parent;t;t=t.parent)if(h(t)&&/keyframes$/i.test(t.name))return!0;return!1}function _(e){return r.some(t=>e.selector.includes(t))}function v(e){return e.nodes.some(e=>m(e)&&e.prop===`transform`&&i.test(e.value))}function y(e,t){let n=[],r=0,i=``;for(let a of e)a===`(`?r++:a===`)`&&r--,r===0&&t(a)?(n.push(i),i=``):i+=a;return n.push(i),n}function b(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`(`)n++;else if(e[r]===`)`&&(n--,n===0))return r;return-1}function x(e){return l.test(e)}function S(e){return x(e)?e:e.startsWith(`-`)?e.slice(1):e.startsWith(`calc(`)&&b(e,4)===e.length-1?`calc(-1 * (${e.slice(5,-1)}))`:/^[\d.]/.test(e)?`-${e}`:`calc(-1 * (${e}))`}function C(e){let t=``,n=0,r=!1;for(let i of e.matchAll(a)){let a=(i.index??0)+i[0].length-1,o=b(e,a);if(o<0)throw Error(`rtl-mirror: unbalanced parentheses in transform: ${e}`);let[s=``,...c]=y(e.slice(a+1,o),e=>e===`,`),l=s.trim();x(l)||(r=!0),t+=e.slice(n,a+1)+[S(l),...c].join(`,`),n=o}return{value:t+e.slice(n),nonZero:r}}function w(e){return e.replace(s,e=>e.toLowerCase()===`left`?`right`:`left`)}function T(e){let t=e.trim(),n=c.exec(t);return n?`${t.slice(0,n.index)}:dir(rtl)${t.slice(n.index)}`:`${t}:dir(rtl)`}function E(e){let t=y(e.value,e=>/\s/.test(e)).filter(Boolean);if(t.length!==4||t[1]===t[3])return!1;let[n=``,r=``,i=``,a=``]=t,o=e.prop;return e.prop=`${o}-block`,e.value=`${n} ${i}`,e.after(e.clone({prop:`${o}-inline`,value:`${a} ${r}`})),!0}function D(e){let t=e.value.trim().toLowerCase(),n=d.get(t);if(e.prop===`text-align`&&n)return e.value=n,!0;let r=f.get(t);if((e.prop===`float`||e.prop===`clear`)&&r)return e.value=r,!0;if(e.prop===`margin`||e.prop===`padding`)return E(e);let i=u.get(e.prop)??O(e.prop);return i?(e.prop=i,!0):!1}function O(e){let t=/^border-(left|right)(-(width|style|color))?$/.exec(e);if(t)return`border-${t[1]===`left`?`inline-start`:`inline-end`}${t[2]??``}`}function k(r){let i=[],a=/* @__PURE__ */ new Map;r.walk(e=>{a.set(e,i.length),i.push(e)});let s=i.filter(p),c=s.find(e=>e.text.startsWith(`!`)&&e.text.includes(`Bootstrap`)),l=s.find(e=>n.test(e.text));if(!c||!l)throw Error(t);let u=a.get(c)??-1,d=a.get(l)??-1;if(d<u)throw Error(t);l.remove();let f=[];r.walkRules(e=>{let t=a.get(e)??-1;t>u&&t<d&&!g(e)&&!_(e)&&f.push(e)});let h=0,y=0;for(let t of f){let n=v(t),r=[];for(let e of t.nodes.filter(m))if(e.prop===`transform`){if(!n){let t=C(e.value);t.nonZero&&r.push({prop:`transform`,value:t.value,important:e.important})}}else e.prop===`background-position`&&o.test(e.value.trim())?r.push({prop:`background-position`,value:w(e.value.trim()),important:e.important}):n&&e.value.trim()===`50%`||D(e)&&h++;if(r.length===0)continue;let i=t.selectors.map(T).join(`, `),a=t;for(let t of r){let n=e.rule({selector:i});n.append(e.decl({prop:t.prop,value:t.value,important:t.important})),a.after(n),a=n,y++}}return{converted:h,twinned:y}}function A(){return{postcssPlugin:`wui-rtl-mirror`,OnceExit(e){k(e)}}}A.postcss=!0;export{k as rewriteRoot,A as rtlMirrorPlugin};
1
+ import e from"postcss";var t=`rtl-mirror: Bootstrap markers not found; the pass must see the /*! Bootstrap */ banner and /*! wui-bootstrap-end */.`,n=/^!\s*wui-bootstrap-end$/,r=[`data-popper-placement`,`bs-popover-`,`bs-tooltip-`,`[data-bs-popper]`],i=/\btranslate(X)?\(\s*-50%/,a=/\btranslate(X)?\(/g,o=/^(left|right)(?=\s|$)/i,s=/\b(left|right)\b/gi,c=/::[\w-]+(\([^)]*\))?$/,l=/^[+-]?0*(\.0*)?(px|%|r?em|vw|vh|deg)?$/i,u=/* @__PURE__ */ new Map([[`left`,`inset-inline-start`],[`right`,`inset-inline-end`],[`margin-left`,`margin-inline-start`],[`margin-right`,`margin-inline-end`],[`padding-left`,`padding-inline-start`],[`padding-right`,`padding-inline-end`],[`border-top-left-radius`,`border-start-start-radius`],[`border-top-right-radius`,`border-start-end-radius`],[`border-bottom-left-radius`,`border-end-start-radius`],[`border-bottom-right-radius`,`border-end-end-radius`]]),d=/* @__PURE__ */ new Map([[`left`,`start`],[`right`,`end`]]),f=/* @__PURE__ */ new Map([[`left`,`inline-start`],[`right`,`inline-end`]]);function p(e){return e.type===`comment`}function m(e){return e.type===`decl`}function h(e){return e.type===`atrule`}function g(e){for(let t=e.parent;t;t=t.parent)if(h(t)&&/keyframes$/i.test(t.name))return!0;return!1}function _(e){return r.some(t=>e.selector.includes(t))}function v(e){return e.nodes.some(e=>m(e)&&e.prop===`transform`&&i.test(e.value))}function y(e,t){let n=[],r=0,i=``;for(let a of e)a===`(`?r++:a===`)`&&r--,r===0&&t(a)?(n.push(i),i=``):i+=a;return n.push(i),n}function b(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`(`)n++;else if(e[r]===`)`&&(n--,n===0))return r;return-1}function x(e){return l.test(e)}function S(e){return x(e)?e:e.startsWith(`-`)?e.slice(1):e.startsWith(`calc(`)&&b(e,4)===e.length-1?`calc(-1 * (${e.slice(5,-1)}))`:/^[\d.]/.test(e)?`-${e}`:`calc(-1 * (${e}))`}function C(e){let t=``,n=0,r=!1;for(let i of e.matchAll(a)){let a=(i.index??0)+i[0].length-1,o=b(e,a);if(o<0)throw Error(`rtl-mirror: unbalanced parentheses in transform: ${e}`);let[s=``,...c]=y(e.slice(a+1,o),e=>e===`,`),l=s.trim();x(l)||(r=!0),t+=e.slice(n,a+1)+[S(l),...c].join(`,`),n=o}return{value:t+e.slice(n),nonZero:r}}function w(e){return e.replace(s,e=>e.toLowerCase()===`left`?`right`:`left`)}function T(e){let t=e.trim(),n=c.exec(t);return n?`${t.slice(0,n.index)}:dir(rtl)${t.slice(n.index)}`:`${t}:dir(rtl)`}function E(e){let t=y(e.value,e=>/\s/.test(e)).filter(Boolean);if(t.length!==4||t[1]===t[3])return!1;let[n=``,r=``,i=``,a=``]=t,o=e.prop;return e.prop=`${o}-block`,e.value=`${n} ${i}`,e.after(e.clone({prop:`${o}-inline`,value:`${a} ${r}`})),!0}function D(e){let t=e.value.trim().toLowerCase(),n=d.get(t);if(e.prop===`text-align`&&n)return e.value=n,!0;let r=f.get(t);if((e.prop===`float`||e.prop===`clear`)&&r)return e.value=r,!0;if(e.prop===`margin`||e.prop===`padding`)return E(e);let i=u.get(e.prop)??O(e.prop);return i?(e.prop=i,!0):!1}function O(e){let t=/^border-(left|right)(-(width|style|color))?$/.exec(e);if(t)return`border-${t[1]===`left`?`inline-start`:`inline-end`}${t[2]??``}`}function k(r,i={}){let a=[],s=/* @__PURE__ */ new Map;r.walk(e=>{s.set(e,a.length),a.push(e)});let c=-1,l=1/0;if(!i.wholeSheet){let e=a.filter(p),r=e.find(e=>e.text.startsWith(`!`)&&e.text.includes(`Bootstrap`)),i=e.find(e=>n.test(e.text));if(!r||!i||(c=s.get(r)??-1,l=s.get(i)??-1,l<c))throw Error(t);i.remove()}let u=[];r.walkRules(e=>{let t=s.get(e)??-1;t>c&&t<l&&!g(e)&&!_(e)&&u.push(e)});let d=0,f=0;for(let t of u){let n=v(t),r=[];for(let e of t.nodes.filter(m))if(e.prop===`transform`){if(!n){let t=C(e.value);t.nonZero&&r.push({prop:`transform`,value:t.value,important:e.important})}}else e.prop===`background-position`&&o.test(e.value.trim())?r.push({prop:`background-position`,value:w(e.value.trim()),important:e.important}):n&&e.value.trim()===`50%`||D(e)&&d++;if(r.length===0)continue;let i=t.selectors.map(T).join(`, `),a=t;for(let t of r){let n=e.rule({selector:i});n.append(e.decl({prop:t.prop,value:t.value,important:t.important})),a.after(n),a=n,f++}}return{converted:d,twinned:f}}function A(e={}){return{postcssPlugin:`wui-rtl-mirror`,OnceExit(t){k(t,e)}}}A.postcss=!0;export{k as rewriteRoot,A as rtlMirrorPlugin};
@@ -342,6 +342,7 @@
342
342
  "is-animated",
343
343
  "is-collapsed",
344
344
  "is-compact",
345
+ "is-current",
345
346
  "is-disabled",
346
347
  "is-dragging",
347
348
  "is-drop-over",
@@ -971,6 +972,7 @@
971
972
  "wui-descs-col-4",
972
973
  "wui-descs-emphasis",
973
974
  "wui-descs-icon",
975
+ "wui-descs-labels-start",
974
976
  "wui-descs-link",
975
977
  "wui-descs-list",
976
978
  "wui-descs-summary",
@@ -1252,6 +1254,7 @@
1252
1254
  "wui-kpi-delta--danger",
1253
1255
  "wui-kpi-delta--neutral",
1254
1256
  "wui-kpi-delta--success",
1257
+ "wui-kpi-picked",
1255
1258
  "wui-lightbox",
1256
1259
  "wui-lightbox-bar",
1257
1260
  "wui-lightbox-btn",
@@ -1337,6 +1340,7 @@
1337
1340
  "wui-nav-list-item",
1338
1341
  "wui-nav-list-label",
1339
1342
  "wui-nav-menu-chevron",
1343
+ "wui-nav-menu-group",
1340
1344
  "wui-nav-menu-item",
1341
1345
  "wui-nav-menu-link",
1342
1346
  "wui-nav-menu-link-desc",
@@ -1644,11 +1648,15 @@
1644
1648
  "wui-tabbar-icon",
1645
1649
  "wui-tabbar-item",
1646
1650
  "wui-tabbar-label",
1651
+ "wui-table-actions-column",
1652
+ "wui-table-actions-menu",
1647
1653
  "wui-table-compact",
1648
1654
  "wui-table-cozy",
1655
+ "wui-table-density",
1649
1656
  "wui-table-empty",
1650
1657
  "wui-table-equal-actions",
1651
1658
  "wui-table-error",
1659
+ "wui-table-export",
1652
1660
  "wui-table-flush",
1653
1661
  "wui-table-link-first",
1654
1662
  "wui-table-pager",
@@ -1769,6 +1777,7 @@
1769
1777
  "wui-usermenu-trigger",
1770
1778
  "wui-usermenu-trigger-outlined",
1771
1779
  "wui-usermenu-who",
1780
+ "wui-valid",
1772
1781
  "wui-virtual-off",
1773
1782
  "wui-virtual-spacer",
1774
1783
  "wui-whats-new",
@@ -1851,6 +1860,7 @@
1851
1860
  "^wui-hidden-from-",
1852
1861
  "^wui-hover-card-",
1853
1862
  "^wui-input-",
1863
+ "^wui-kpi-icon-chart-",
1854
1864
  "^wui-mention-",
1855
1865
  "^wui-metric-strip-cols-",
1856
1866
  "^wui-metric-tone-",