ooxml-ui 0.12.0 → 0.13.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
@@ -104,8 +104,29 @@ Elements with intent events read their event name and test-id prefix from static
104
104
 
105
105
  Setting a property never emits an event; only user activation does. Controls honour
106
106
  `prefers-color-scheme`, `forced-colors: active` (system colours and a visible focus ring) and
107
- coarse pointers (44px targets through `--office-target-size`). Tokens are the `--office-*`
108
- custom properties in `THEME_CSS`; override them on `:root` or any container.
107
+ coarse pointers (44px targets through `--office-target-size`).
108
+
109
+ ## Design tokens
110
+
111
+ Every control is token based: no colour, length, radius, font size, shadow, duration or layer
112
+ is written literally. `OFFICE_TOKENS` (from `ooxml-ui/theme`) is the single table of
113
+ `--office-*` tokens and their defaults; controls read them through `tok(name)`, which expands to
114
+ `var(--office-…, <default>)`, so they render correctly with or without the installed theme.
115
+ `THEME_CSS` declares every default on `:root`, plus dark-mode and forced-colours values. Override
116
+ any token on `:root` or on any container to retheme or resize the suite:
117
+
118
+ - semantic colours: `--office-foreground`, `-background`, `-surface`, `-selected`, `-border`,
119
+ `-accent`, `-accent-foreground`, `-ring`, `-danger`, `-warning`, `-info`, `-popover`, `-overlay`,
120
+ `-notice-*`, `-paper`;
121
+ - scales: `--office-space-*`, `--office-radius-*`, `--office-font-size-*`, `--office-icon-size-*`,
122
+ `--office-control-height-*`, `--office-shadow-*`, `--office-duration-*`, `--office-z-*`;
123
+ - component tokens that default to the scales, for example `--office-checkbox-size`,
124
+ `--office-switch-width`, `--office-ribbon-tab-height`, `--office-backstage-nav-width` and
125
+ `--office-dialog-max-width`.
126
+
127
+ Only the two layout breakpoints (`COMPACT`, `TOUCH`) are literal, because CSS does not allow
128
+ custom properties in media queries. A test fails when any control's stylesheet contains a raw
129
+ colour or length outside a token, or references an undeclared token.
109
130
 
110
131
  `office-ui-smartart` shows the drawing the producing application cached; it never lays out a
111
132
  diagram itself. Preset outlines it cannot draw are rendered as rectangles, gradient and pattern
@@ -1,4 +1,4 @@
1
- import { definer, attachStyles, controlCss } from './chunk-EY266IK3.js';
1
+ import { definer, attachStyles, controlCss } from './chunk-D6EREKYF.js';
2
2
 
3
3
  // src/icons.ts
4
4
  var registry = /* @__PURE__ */ new Map();
@@ -1,3 +1,5 @@
1
+ import { TOUCH, tok } from './chunk-MDW2Y5UN.js';
2
+
1
3
  // src/registry.ts
2
4
  var CONTRACT_REVISION = 1;
3
5
  var CONTRACT_KEY = /* @__PURE__ */ Symbol.for("office-ui.web-control-contract");
@@ -60,11 +62,11 @@ function attachStyles(root, css) {
60
62
  }
61
63
  var COMMON_CONTROL_CSS = `
62
64
  :host([hidden]) { display: none !important; }
63
- @media (pointer: coarse), (max-width: 767px) {
64
- :host { --office-target-size: 44px; }
65
+ @media ${TOUCH} {
66
+ :host { --office-target-size: ${tok("--office-target-size-touch")}; }
65
67
  }
66
68
  @media (forced-colors: active) {
67
- :host(:focus-visible), :focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
69
+ :host(:focus-visible), :focus-visible { outline: ${tok("--office-focus-width")} solid Highlight; outline-offset: ${tok("--office-focus-offset")}; }
68
70
  }
69
71
  `;
70
72
  var controlCss = (css) => `${COMMON_CONTROL_CSS}