ooxml-ui 0.11.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 +23 -2
- package/dist/{chunk-YZ2JQNHX.js → chunk-4NUKVNSJ.js} +1 -1
- package/dist/{chunk-EY266IK3.js → chunk-D6EREKYF.js} +5 -3
- package/dist/{chunk-KM7DN2LV.js → chunk-JROJGF7A.js} +360 -346
- package/dist/{chunk-H4KFVIGT.js → chunk-LI6OV55P.js} +15 -15
- package/dist/chunk-MDW2Y5UN.js +187 -0
- package/dist/{chunk-RLPL7Q6J.js → chunk-NOQAM6ZS.js} +8 -7
- package/dist/{chunk-KJV76AB7.js → chunk-SDFQ7U2I.js} +4 -3
- package/dist/controls.js +5 -4
- package/dist/document-notices.d.ts +1 -1
- package/dist/icons.js +3 -2
- package/dist/index.js +11 -10
- package/dist/presence.js +3 -2
- package/dist/smartart.js +3 -2
- package/dist/styles.d.ts +1 -1
- package/dist/theme.d.ts +2 -1
- package/dist/theme.js +2 -1
- package/dist/tokens.d.ts +185 -0
- package/package.json +1 -1
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`).
|
|
108
|
-
|
|
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,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
|
|
64
|
-
:host { --office-target-size:
|
|
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:
|
|
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}
|