@webority/theme 0.149.0 → 0.152.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 +9 -0
- package/css-import.d.ts +2 -0
- package/dist/postcss/forced-states.d.mts +11 -0
- package/dist/postcss/forced-states.mjs +1 -1
- package/dist/purge-safelist.json +24 -1
- package/dist/runtime/index.d.mts +6 -0
- package/dist/runtime/productTheme.d.mts +25 -0
- package/dist/runtime.mjs +2 -2
- package/dist/webority-theme.css +1 -1
- package/dist/webority-tokens.css +1 -1
- package/package.json +34 -11
- package/scss/_bootstrap.generated.scss +1 -1
- package/scss/_components.scss +139 -52
- package/scss/_marketing.scss +10 -10
- package/scss/_tokens.generated.scss +26 -1
- package/scss/wui/_calendar.scss +6 -6
- package/scss/wui/_card.scss +3 -3
- package/scss/wui/_carousel.scss +3 -3
- package/scss/wui/_chart-card.scss +33 -1
- package/scss/wui/_chart.scss +4 -4
- package/scss/wui/_choice.scss +48 -43
- package/scss/wui/_command-palette.scss +2 -2
- package/scss/wui/_comment-thread.scss +2 -2
- package/scss/wui/_compare-table.scss +27 -0
- package/scss/wui/_controls.scss +54 -48
- package/scss/wui/_data.scss +26 -16
- package/scss/wui/_dialog-motion.scss +4 -4
- package/scss/wui/_disclosure.scss +4 -4
- package/scss/wui/_display.scss +61 -26
- package/scss/wui/_dock.scss +6 -6
- package/scss/wui/_drawer.scss +2 -2
- package/scss/wui/_field-busy.scss +1 -1
- package/scss/wui/_field-floor.scss +2 -1
- package/scss/wui/_file-viewer.scss +3 -3
- package/scss/wui/_flow.scss +15 -13
- package/scss/wui/_inline-edit.scss +2 -2
- package/scss/wui/_interaction.scss +1 -2
- package/scss/wui/_kanban.scss +16 -6
- package/scss/wui/_lightbox.scss +2 -2
- package/scss/wui/_media.scss +48 -48
- package/scss/wui/_modal-remote.scss +1 -1
- package/scss/wui/_navigation-menu.scss +1 -1
- package/scss/wui/_navigation.scss +68 -18
- package/scss/wui/_notification-center.scss +3 -3
- package/scss/wui/_onboarding-checklist.scss +1 -1
- package/scss/wui/_overlays.scss +28 -40
- package/scss/wui/_pagination.scss +4 -4
- package/scss/wui/_rating.scss +1 -1
- package/scss/wui/_resizable.scss +1 -1
- package/scss/wui/_rich-text.scss +4 -4
- package/scss/wui/_score-scale.scss +3 -3
- package/scss/wui/_sections.scss +2 -2
- package/scss/wui/_shell-parts.scss +53 -5
- package/scss/wui/_shell.scss +56 -57
- package/scss/wui/_sortable.scss +2 -2
- package/scss/wui/_split-view.scss +2 -2
- package/scss/wui/_support.scss +1 -1
- package/scss/wui/_table-server.scss +1 -1
- package/scss/wui/_theme-toggle.scss +1 -1
- package/scss/wui/_toolbar.scss +7 -7
- package/scss/wui/_tree.scss +3 -3
- package/scss/wui/_utilities.scss +29 -11
- package/scss/wui/_workspace.scss +2 -2
- package/scss/wui/tour/_end.scss +1 -1
- package/scss/wui/tour/_motion.scss +4 -4
- package/token-meanings.json +2 -0
package/README.md
CHANGED
|
@@ -130,6 +130,15 @@ every component in a product's design language.
|
|
|
130
130
|
- Each product serves its file at `/theme/tokens.json` with `Access-Control-Allow-Origin` for the showcase host.
|
|
131
131
|
- A font the token file names renders only when the page has its face: the theme's own families do.
|
|
132
132
|
|
|
133
|
+
## Sizing the top bar brand
|
|
134
|
+
|
|
135
|
+
With `nav="top"` the shell draws the `brand` node in the top bar, inside `.wui-shell-top-brand`. Two variables size it:
|
|
136
|
+
|
|
137
|
+
- `--wui-shell-top-brand-height`: the brand's height from `md` up. Default `32px`.
|
|
138
|
+
- `--wui-shell-top-brand-height-phone`: the brand's height below `md` (768px). Default `28px`.
|
|
139
|
+
|
|
140
|
+
Set them on any ancestor of the shell, such as `:root` or `.app-shell`. The shell resolves the one for the current width into `--wui-shell-top-brand-size`, which your own brand node reads (`height: var(--wui-shell-top-brand-size)`). A `.wui-brand-logo` or `.wui-brand-mark` image inside the slot takes that height with no further CSS.
|
|
141
|
+
|
|
133
142
|
## Forced interaction states
|
|
134
143
|
|
|
135
144
|
The classes `wui-force-hover`, `wui-force-focus` and `wui-force-active` make an element show its hover, focus or
|
package/css-import.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Plugin, type Root } from "postcss";
|
|
2
|
+
export declare function rewriteRoot(root: Root): {
|
|
3
|
+
rewritten: number;
|
|
4
|
+
carrying: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function addForcedStates(css: string): string;
|
|
7
|
+
export declare function forcedStatesPlugin(): Plugin;
|
|
8
|
+
export declare namespace forcedStatesPlugin {
|
|
9
|
+
var _a: boolean;
|
|
10
|
+
export { _a as postcss };
|
|
11
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FORCED_STATE_CLASSES as e}from"../runtime.mjs";import t from"postcss";import n from"postcss-selector-parser";var r=/* @__PURE__ */ new Map([[`:hover`,e.hover],[`:focus`,e.focus],[`:focus-visible`,e.focus],[`:focus-within`,e.focus],[`:active`,e.active]]),i=new Set(Object.values(e)),a=n();function o(e){for(let t=e.parent;t;t=t.parent)if(t
|
|
1
|
+
import{FORCED_STATE_CLASSES as e}from"../runtime.mjs";import t from"postcss";import n from"postcss-selector-parser";var r=/* @__PURE__ */ new Map([[`:hover`,e.hover],[`:focus`,e.focus],[`:focus-visible`,e.focus],[`:focus-within`,e.focus],[`:active`,e.active]]),i=new Set(Object.values(e)),a=n();function o(e){return e.type===`atrule`}function s(e){for(let t=e.parent;t;t=t.parent)if(o(t)&&/keyframes$/i.test(t.name))return!0;return!1}function c(e,t){let n=e.parent?.parent;return n?.type!==`pseudo`||n.value.toLowerCase()!==`:is`?!1:n.nodes.some(e=>e.type===`selector`&&e.nodes.some(e=>e.type===`class`&&e.value===t))}function l(e){for(let t=e.prev();t&&t.type!==`combinator`;t=t.prev())if(t.type===`pseudo`&&t.value.startsWith(`::`))return!0;return!1}function u(e){let t=[];e.walkPseudos(e=>{let n=r.get(e.value.toLowerCase());n&&!c(e,n)&&!l(e)&&t.push({pseudo:e,cls:n})});for(let{pseudo:e,cls:r}of t){let t=n.selector({value:``});t.append(e.clone());let i=n.selector({value:``});i.append(n.className({value:r}));let a=n.pseudo({value:`:is`});a.append(t),a.append(i),e.replaceWith(a)}return t.length}function d(e){let t=!1;return e.walkClasses(e=>{t||=i.has(e.value)}),t}function f(e){let t=0,n=0;return e.walkRules(e=>{if(s(e))return;let r=a.astSync(e.selector),i=!1;for(let e of r.nodes)u(e)>0&&(t++,i=!0),d(e)&&n++;i&&(e.selector=r.toString())}),{rewritten:t,carrying:n}}function p(e){let n=t.parse(e);return f(n),n.toString()}function m(){return{postcssPlugin:`wui-forced-states`,OnceExit(e){f(e)}}}m.postcss=!0;export{p as addForcedStates,m as forcedStatesPlugin,f as rewriteRoot};
|
package/dist/purge-safelist.json
CHANGED
|
@@ -101,7 +101,6 @@
|
|
|
101
101
|
"badge",
|
|
102
102
|
"badge-dot",
|
|
103
103
|
"bg-light",
|
|
104
|
-
"bg-primary",
|
|
105
104
|
"blockquote",
|
|
106
105
|
"border",
|
|
107
106
|
"border-bottom",
|
|
@@ -128,6 +127,7 @@
|
|
|
128
127
|
"btn-sm",
|
|
129
128
|
"btn-soft-primary",
|
|
130
129
|
"btn-static",
|
|
130
|
+
"btn-xl",
|
|
131
131
|
"card",
|
|
132
132
|
"card-accent",
|
|
133
133
|
"card-body",
|
|
@@ -549,6 +549,7 @@
|
|
|
549
549
|
"slider-track",
|
|
550
550
|
"slider-value",
|
|
551
551
|
"small",
|
|
552
|
+
"sort-icon",
|
|
552
553
|
"sortable",
|
|
553
554
|
"spinner-border",
|
|
554
555
|
"spinner-border-sm",
|
|
@@ -745,6 +746,7 @@
|
|
|
745
746
|
"wui-bell-title",
|
|
746
747
|
"wui-bell-trigger",
|
|
747
748
|
"wui-bell-when",
|
|
749
|
+
"wui-bordered",
|
|
748
750
|
"wui-brand-dark",
|
|
749
751
|
"wui-brand-has-mark",
|
|
750
752
|
"wui-brand-light",
|
|
@@ -753,6 +755,10 @@
|
|
|
753
755
|
"wui-brand-mark",
|
|
754
756
|
"wui-brand-mark-only",
|
|
755
757
|
"wui-brand-themed",
|
|
758
|
+
"wui-breadcrumb-collapse",
|
|
759
|
+
"wui-breadcrumb-collapsible",
|
|
760
|
+
"wui-breadcrumb-more",
|
|
761
|
+
"wui-breadcrumb-more-toggle",
|
|
756
762
|
"wui-btn-group",
|
|
757
763
|
"wui-btn-group-full",
|
|
758
764
|
"wui-btn-pin-end",
|
|
@@ -904,6 +910,7 @@
|
|
|
904
910
|
"wui-compare-group",
|
|
905
911
|
"wui-compare-group-row",
|
|
906
912
|
"wui-compare-nowrap",
|
|
913
|
+
"wui-compare-plain",
|
|
907
914
|
"wui-compare-relaxed",
|
|
908
915
|
"wui-compare-scroll",
|
|
909
916
|
"wui-compare-scroll-table",
|
|
@@ -952,6 +959,11 @@
|
|
|
952
959
|
"wui-crop-zoom",
|
|
953
960
|
"wui-crop-zoombtn",
|
|
954
961
|
"wui-dashboard-cell",
|
|
962
|
+
"wui-dashboard-cell-3",
|
|
963
|
+
"wui-dashboard-cell-4",
|
|
964
|
+
"wui-dashboard-cell-6",
|
|
965
|
+
"wui-dashboard-cell-8",
|
|
966
|
+
"wui-dashboard-cell-fifth",
|
|
955
967
|
"wui-dashboard-grid",
|
|
956
968
|
"wui-daterange-main",
|
|
957
969
|
"wui-daterange-pop--presets",
|
|
@@ -980,8 +992,14 @@
|
|
|
980
992
|
"wui-drawer-title",
|
|
981
993
|
"wui-drawer-title-ic",
|
|
982
994
|
"wui-drop-tray",
|
|
995
|
+
"wui-dropdown-empty",
|
|
983
996
|
"wui-dropdown-form",
|
|
997
|
+
"wui-dropdown-item-body",
|
|
998
|
+
"wui-dropdown-item-desc",
|
|
984
999
|
"wui-dropdown-item-disabled",
|
|
1000
|
+
"wui-dropdown-menu-searchable",
|
|
1001
|
+
"wui-dropdown-search",
|
|
1002
|
+
"wui-dropdown-search-input",
|
|
985
1003
|
"wui-dropdown-trigger",
|
|
986
1004
|
"wui-dropdown-trigger-neutral",
|
|
987
1005
|
"wui-due-date",
|
|
@@ -995,6 +1013,7 @@
|
|
|
995
1013
|
"wui-error-summary-list",
|
|
996
1014
|
"wui-error-summary-title",
|
|
997
1015
|
"wui-expand-cell",
|
|
1016
|
+
"wui-expand-toggle",
|
|
998
1017
|
"wui-field-busy",
|
|
999
1018
|
"wui-field-message",
|
|
1000
1019
|
"wui-file-busy",
|
|
@@ -1486,6 +1505,7 @@
|
|
|
1486
1505
|
"wui-show-more",
|
|
1487
1506
|
"wui-show-more-body",
|
|
1488
1507
|
"wui-show-more-toggle",
|
|
1508
|
+
"wui-sidebar-foot-links",
|
|
1489
1509
|
"wui-skeleton-cell",
|
|
1490
1510
|
"wui-skeleton-lines",
|
|
1491
1511
|
"wui-skip-link",
|
|
@@ -1610,9 +1630,11 @@
|
|
|
1610
1630
|
"wui-topsearch-hit-sub",
|
|
1611
1631
|
"wui-topsearch-hit-text",
|
|
1612
1632
|
"wui-topsearch-hit-title",
|
|
1633
|
+
"wui-topsearch-host",
|
|
1613
1634
|
"wui-topsearch-open",
|
|
1614
1635
|
"wui-topsearch-panel",
|
|
1615
1636
|
"wui-topsearch-results",
|
|
1637
|
+
"wui-topsearch-row",
|
|
1616
1638
|
"wui-tour-actions",
|
|
1617
1639
|
"wui-tour-arrow",
|
|
1618
1640
|
"wui-tour-back",
|
|
@@ -1705,6 +1727,7 @@
|
|
|
1705
1727
|
"^card-pad-",
|
|
1706
1728
|
"^col-",
|
|
1707
1729
|
"^color-field-",
|
|
1730
|
+
"^column-",
|
|
1708
1731
|
"^descs-",
|
|
1709
1732
|
"^descs-col-",
|
|
1710
1733
|
"^dropdown-",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type Mode = "light" | "dark";
|
|
2
|
+
type Declarations = Record<string, unknown>;
|
|
3
|
+
export type TokenFile = {
|
|
4
|
+
format?: string;
|
|
5
|
+
source?: {
|
|
6
|
+
brand?: string;
|
|
7
|
+
};
|
|
8
|
+
colors?: Partial<Record<Mode, Declarations>>;
|
|
9
|
+
space?: Declarations;
|
|
10
|
+
radius?: Declarations;
|
|
11
|
+
text?: Record<string, {
|
|
12
|
+
size: unknown;
|
|
13
|
+
}>;
|
|
14
|
+
fonts?: Record<string, {
|
|
15
|
+
family: string;
|
|
16
|
+
fallback: string;
|
|
17
|
+
}>;
|
|
18
|
+
shadow?: Declarations;
|
|
19
|
+
};
|
|
20
|
+
export declare function parseTokenFile(value: unknown): TokenFile;
|
|
21
|
+
/** Validates a parsed token file and returns the stylesheet text that applies it. */
|
|
22
|
+
export declare function productThemeCss(file: TokenFile | null | undefined): string;
|
|
23
|
+
/** Applies a token file (already parsed) to the page and returns its product name. */
|
|
24
|
+
export declare function applyProductTheme(file: TokenFile): string;
|
|
25
|
+
export {};
|
package/dist/runtime.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={palette:`--wui-`,color:`--color-`,effect:`--wui-`,space:`--wui-space-`,radius:`--wui-radius-`,text:`--wui-fs-`,weight:`--wui-fw-`,leading:`--wui-lh-`,"letter-spacing":`--wui-letter-spacing-`,font:`--wui-font-`,shadow:`--wui-shadow-`,motion:`--wui-`,section:`--wui-section-`,size:`--wui-`,z:`--wui-z-`,component:`--wui-`};function t(t,n){let r=e[t];if(r===void 0)throw Error(`webority-tokens: ${t} is not a token group; add it to PREFIX in names.
|
|
2
|
-
`)}function
|
|
1
|
+
var e={palette:`--wui-`,color:`--color-`,effect:`--wui-`,space:`--wui-space-`,radius:`--wui-radius-`,text:`--wui-fs-`,weight:`--wui-fw-`,leading:`--wui-lh-`,"letter-spacing":`--wui-letter-spacing-`,font:`--wui-font-`,shadow:`--wui-shadow-`,motion:`--wui-`,section:`--wui-section-`,size:`--wui-`,z:`--wui-z-`,component:`--wui-`};function t(t,n){let r=e[t];if(r===void 0)throw Error(`webority-tokens: ${t} is not a token group; add it to PREFIX in names.ts.`);return`${r}${n}`}var n=`webority-theme-tokens/2`,r=`wui-product-theme`,i=/^--[A-Za-z0-9_-]+$/,a=/[;{}<>\\]|url\s*\(|@import|expression\s*\(/i,o=500;function s(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function c(){return/* @__PURE__ */ Error(`it is not a ${n} file`)}function l(e){if(!s(e))throw c();return{...e}}function u(e){if(!s(e))throw c();if(e.brand===void 0)return{};if(typeof e.brand!=`string`)throw c();return{brand:e.brand}}function d(e){if(!s(e))throw c();let t={};return e.light!==void 0&&(t.light=l(e.light)),e.dark!==void 0&&(t.dark=l(e.dark)),t}function f(e){if(!s(e))throw c();let t={};for(let[n,r]of Object.entries(e)){if(!s(r)||!(`size`in r))throw c();t[n]={size:r.size}}return t}function p(e){if(!s(e))throw c();let t={};for(let[n,r]of Object.entries(e)){if(!s(r)||typeof r.family!=`string`||typeof r.fallback!=`string`)throw c();t[n]={family:r.family,fallback:r.fallback}}return t}function m(e){if(!s(e)||e.format!==n)throw c();let t={format:n};return e.source!==void 0&&(t.source=u(e.source)),e.colors!==void 0&&(t.colors=d(e.colors)),e.space!==void 0&&(t.space=l(e.space)),e.radius!==void 0&&(t.radius=l(e.radius)),e.text!==void 0&&(t.text=f(e.text)),e.fonts!==void 0&&(t.fonts=p(e.fonts)),e.shadow!==void 0&&(t.shadow=l(e.shadow)),t}function h(e,t){let n=Object.entries(t).map(([e,t])=>`${e}: ${t};`).join(``);return n?`${e}{${n}}`:``}function g(e,t){if(typeof e!=`object`||Array.isArray(e))throw Error(`its "${t}" section is not a list of values`);for(let[t,n]of Object.entries(e)){if(!i.test(t))throw Error(`"${t}" is not a CSS custom property`);if(typeof n!=`string`||n.length>o||a.test(n))throw Error(`the value of ${t} is not allowed`)}return e}function _(e,t){if(typeof e!=`string`||!/^#[0-9a-fA-F]{6}$/.test(e))throw Error(`the ${t} colour is not a 6-digit hex value`);return[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)).join(`, `)}function v(e,t){let n=e[t]??{};if(typeof n!=`object`||Array.isArray(n))throw Error(`its "${t}" section is not a list of values`);return Object.entries(n)}function y(e,n){let r={};for(let[i,a]of v(e.colors??{},n))r[t(`color`,i)]=a;if(n!==`light`)return r;for(let[n,i]of v(e,`space`))r[t(`space`,n)]=`${i}px`;for(let[n,i]of Object.entries(e.radius??{}))r[t(`radius`,n)]=`${i}px`;for(let[n,i]of Object.entries(e.text??{}))r[t(`text`,n)]=`${i.size}px`;for(let[n,i]of Object.entries(e.fonts??{})){if(typeof i.fallback!=`string`)throw Error(`the font "${n}" has no fallback`);r[t(`font`,n)]=`${i.family.includes(` `)?`"${i.family}"`:i.family}, ${i.fallback}`}for(let[n,i]of Object.entries(e.shadow??{}))r[t(`shadow`,n)]=i;return r}function b(e,t){let n=e.colors?.[t]?.primary,r=e.colors?.[t]?.link;if(!n)throw Error(`it has no primary colour`);if(!r)throw Error(`it has no link colour`);return{"--bs-primary":n,"--bs-primary-rgb":_(n,`primary`),"--bs-link-color-rgb":_(r,`link`)}}function x(e){if(!e||e.format!==n)throw Error(`it is not a ${n} file`);let t=g({...y(e,`light`),...b(e,`light`)},`light`),r=g(y(e,`dark`),`dark`),i=g(b(e,`dark`),`dark`);return[h(`:root`,t),h(`:root[data-theme="dark"],:root[data-bs-theme="dark"]`,r),h(`[data-bs-theme="dark"]`,i)].join(`
|
|
2
|
+
`)}function S(e){let t=x(e),n=document.getElementById(r);return n||(n=document.createElement(`style`),n.id=r,document.head.appendChild(n)),n.textContent=t,document.documentElement.setAttribute(`data-product-theme`,e.source?.brand??`file`),e.source?.brand??`file`}var C=Object.freeze({hover:`wui-force-hover`,focus:`wui-force-focus`,active:`wui-force-active`});export{C as FORCED_STATE_CLASSES,S as applyProductTheme,m as parseTokenFile,x as productThemeCss};
|