@mdwrk/ui-tokens 1.0.1 → 1.2.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
@@ -9,6 +9,7 @@ Shared CSS tokens, root variables, markdown/editor class names, and theme mappin
9
9
  - token and class-name re-exports aligned to `mdwrk/theme-contract`
10
10
  - theme CSS generation helpers for first-party and third-party consumers
11
11
  - renderer/editor bridge variable helpers
12
+ - the Phase 9 rhythm/layout token surfaces used by editor gutters, preview heading rhythm, and responsive shell width
12
13
 
13
14
  ## CSS entry points
14
15
 
@@ -54,3 +55,5 @@ const rendererCss = renderThemeBridgeCssVariables(
54
55
  ## Contract alignment
55
56
 
56
57
  The exported token names, theme classes, and bridge definitions align with `mdwrk/theme-contract`. That keeps the implemented styling primitives aligned with the normative contract package.
58
+
59
+ Phase 9 expands that alignment to include editor/preview rhythm tokens and the mobile-width token surfaces consumed by the active client responsive shell.
package/dist/tokens.d.ts CHANGED
@@ -3,7 +3,7 @@ export { MARKDOWN_WORKSPACE_THEME_TOKEN_NAMES, MARKDOWN_WORKSPACE_THEME_TOKENS,
3
3
  export type MarkdownWorkspaceUiTokenName = MarkdownWorkspaceThemeTokenName;
4
4
  export type MarkdownWorkspaceUiTokenMap = MarkdownWorkspaceThemeTokenMap;
5
5
  export type UiTokenDefinition = ThemeTokenDefinition;
6
- export declare const MARKDOWN_WORKSPACE_UI_TOKEN_NAMES: readonly ["ui-scale", "header-height", "rail-width", "rail-height", "sidebar-width", "status-height", "tab-height", "panel-header-height", "rail-btn-size", "bg-app", "bg-panel", "bg-inset", "border-color", "border-width", "fg-primary", "fg-secondary", "fg-muted", "accent", "table-header-bg", "table-header-fg", "table-row-primary-bg", "table-row-secondary-bg", "status-ok", "status-warn", "status-error", "app-gap", "texture-opacity", "editor-padding", "file-indent-base", "file-indent-unit", "c-explorer-hover", "c-explorer-selected", "c-explorer-selected-text", "c-explorer-drag-bg", "font-ui", "font-mono", "font-head"];
6
+ export declare const MARKDOWN_WORKSPACE_UI_TOKEN_NAMES: readonly ["ui-scale", "header-height", "rail-width", "rail-height", "sidebar-width", "status-height", "tab-height", "panel-header-height", "rail-btn-size", "bg-app", "bg-panel", "bg-inset", "border-color", "border-width", "fg-primary", "fg-secondary", "fg-muted", "accent", "table-header-bg", "table-header-fg", "table-row-primary-bg", "table-row-secondary-bg", "status-ok", "status-warn", "status-error", "app-gap", "texture-opacity", "editor-padding", "editor-line-height", "editor-line-rhythm", "markdown-line-height", "markdown-heading-line-height", "line-number-gutter-width", "mobile-rail-expanded-width", "mobile-expandable-rail-width", "file-indent-base", "file-indent-unit", "c-explorer-hover", "c-explorer-selected", "c-explorer-selected-text", "c-explorer-drag-bg", "font-ui", "font-mono", "font-head"];
7
7
  export declare const MARKDOWN_WORKSPACE_UI_TOKENS: readonly [{
8
8
  readonly name: "ui-scale";
9
9
  readonly cssCustomProperty: "--ui-scale";
@@ -200,6 +200,55 @@ export declare const MARKDOWN_WORKSPACE_UI_TOKENS: readonly [{
200
200
  readonly description: "Editor inner padding.";
201
201
  readonly defaultValue: "calc(24px * var(--ui-scale))";
202
202
  readonly stability: "stable";
203
+ }, {
204
+ readonly name: "editor-line-height";
205
+ readonly cssCustomProperty: "--editor-line-height";
206
+ readonly category: "typography";
207
+ readonly description: "Base editor line height.";
208
+ readonly defaultValue: "calc(1.5rem * var(--ui-scale))";
209
+ readonly stability: "stable";
210
+ }, {
211
+ readonly name: "editor-line-rhythm";
212
+ readonly cssCustomProperty: "--editor-line-rhythm";
213
+ readonly category: "typography";
214
+ readonly description: "Shared editor line rhythm used by the textarea and gutter.";
215
+ readonly defaultValue: "var(--editor-line-height)";
216
+ readonly stability: "stable";
217
+ }, {
218
+ readonly name: "markdown-line-height";
219
+ readonly cssCustomProperty: "--markdown-line-height";
220
+ readonly category: "typography";
221
+ readonly description: "Base Markdown body line height.";
222
+ readonly defaultValue: "var(--editor-line-rhythm)";
223
+ readonly stability: "stable";
224
+ }, {
225
+ readonly name: "markdown-heading-line-height";
226
+ readonly cssCustomProperty: "--markdown-heading-line-height";
227
+ readonly category: "typography";
228
+ readonly description: "Markdown heading line height.";
229
+ readonly defaultValue: "calc(1.1 + ((var(--ui-scale) - 1) * 0.35))";
230
+ readonly stability: "stable";
231
+ }, {
232
+ readonly name: "line-number-gutter-width";
233
+ readonly cssCustomProperty: "--line-number-gutter-width";
234
+ readonly category: "layout";
235
+ readonly description: "Width of the editor line-number gutter.";
236
+ readonly defaultValue: "calc(30px * var(--ui-scale))";
237
+ readonly stability: "stable";
238
+ }, {
239
+ readonly name: "mobile-rail-expanded-width";
240
+ readonly cssCustomProperty: "--mobile-rail-expanded-width";
241
+ readonly category: "layout";
242
+ readonly description: "Expanded width for the rail on narrow mobile layouts.";
243
+ readonly defaultValue: "100vw";
244
+ readonly stability: "stable";
245
+ }, {
246
+ readonly name: "mobile-expandable-rail-width";
247
+ readonly cssCustomProperty: "--mobile-expandable-rail-width";
248
+ readonly category: "layout";
249
+ readonly description: "Token used by responsive layouts for expandable rail width.";
250
+ readonly defaultValue: "var(--mobile-rail-expanded-width)";
251
+ readonly stability: "stable";
203
252
  }, {
204
253
  readonly name: "file-indent-base";
205
254
  readonly cssCustomProperty: "--file-indent-base";
@@ -264,6 +313,6 @@ export declare const MARKDOWN_WORKSPACE_UI_TOKENS: readonly [{
264
313
  readonly defaultValue: "'Inter', sans-serif";
265
314
  readonly stability: "stable";
266
315
  }];
267
- export declare const MARKDOWN_WORKSPACE_TOKEN_DEFAULTS: Readonly<Readonly<Record<"ui-scale" | "header-height" | "rail-width" | "rail-height" | "sidebar-width" | "status-height" | "tab-height" | "panel-header-height" | "rail-btn-size" | "bg-app" | "bg-panel" | "bg-inset" | "border-color" | "border-width" | "fg-primary" | "fg-secondary" | "fg-muted" | "accent" | "table-header-bg" | "table-header-fg" | "table-row-primary-bg" | "table-row-secondary-bg" | "status-ok" | "status-warn" | "status-error" | "app-gap" | "texture-opacity" | "editor-padding" | "file-indent-base" | "file-indent-unit" | "c-explorer-hover" | "c-explorer-selected" | "c-explorer-selected-text" | "c-explorer-drag-bg" | "font-ui" | "font-mono" | "font-head", string>>>;
316
+ export declare const MARKDOWN_WORKSPACE_TOKEN_DEFAULTS: Readonly<Readonly<Record<"ui-scale" | "header-height" | "rail-width" | "rail-height" | "sidebar-width" | "status-height" | "tab-height" | "panel-header-height" | "rail-btn-size" | "bg-app" | "bg-panel" | "bg-inset" | "border-color" | "border-width" | "fg-primary" | "fg-secondary" | "fg-muted" | "accent" | "table-header-bg" | "table-header-fg" | "table-row-primary-bg" | "table-row-secondary-bg" | "status-ok" | "status-warn" | "status-error" | "app-gap" | "texture-opacity" | "editor-padding" | "editor-line-height" | "editor-line-rhythm" | "markdown-line-height" | "markdown-heading-line-height" | "line-number-gutter-width" | "mobile-rail-expanded-width" | "mobile-expandable-rail-width" | "file-indent-base" | "file-indent-unit" | "c-explorer-hover" | "c-explorer-selected" | "c-explorer-selected-text" | "c-explorer-drag-bg" | "font-ui" | "font-mono" | "font-head", string>>>;
268
317
  export declare const MARKDOWN_WORKSPACE_TOKEN_CSS_CUSTOM_PROPERTIES: readonly ThemeTokenDefinition["cssCustomProperty"][];
269
318
  //# sourceMappingURL=tokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,oCAAoC,EACpC,+BAA+B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,GAC1B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,4BAA4B,GAAG,+BAA+B,CAAC;AAC3E,MAAM,MAAM,2BAA2B,GAAG,8BAA8B,CAAC;AACzE,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAEr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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkC,CAAC;AAE5E,eAAO,MAAM,iCAAiC,m3BAI7C,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAEtD,SAAS,oBAAoB,CAAC,mBAAmB,CAAC,EAAE,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const UI_TOKENS_PACKAGE_VERSION: "1.0.1";
1
+ export declare const UI_TOKENS_VERSION = "1.2.0-rc.1";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,EAAG,OAAgB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,eAAe,CAAC"}
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const UI_TOKENS_PACKAGE_VERSION = "1.0.1";
1
+ export const UI_TOKENS_VERSION = "1.2.0-rc.1";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAgB,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.1",
2
+ "version": "1.2.0",
3
3
  "type": "module",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
@@ -26,7 +26,7 @@
26
26
  "themes"
27
27
  ],
28
28
  "dependencies": {
29
- "@mdwrk/theme-contract": "^1.0.0"
29
+ "@mdwrk/theme-contract": "^1.1.0"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsc -p tsconfig.json",
@@ -3,7 +3,7 @@
3
3
  /* MARKDOWN STYLES (Scoped) */
4
4
  .markdown-body {
5
5
  font-family: var(--font-ui);
6
- line-height: 1.6;
6
+ line-height: var(--markdown-line-height);
7
7
  font-size: calc(0.95rem * var(--ui-scale));
8
8
  color: var(--fg-primary);
9
9
  overflow-wrap: anywhere;
@@ -18,9 +18,10 @@
18
18
  .markdown-body h6 {
19
19
  font-family: var(--font-head);
20
20
  color: var(--fg-primary);
21
- margin-top: 1.5em;
21
+ margin-top: 0.25em;
22
22
  margin-bottom: 0.5em;
23
23
  font-weight: 700;
24
+ line-height: var(--markdown-heading-line-height);
24
25
  }
25
26
 
26
27
  .markdown-body h1 { font-size: calc(2em * var(--ui-scale)); border-bottom: 1px solid var(--border-color); padding-bottom: 0.3em; }
@@ -148,6 +149,82 @@
148
149
  bottom: -0.2em;
149
150
  }
150
151
 
152
+ .markdown-body .md-footnote-reference {
153
+ margin-left: 0.1em;
154
+ }
155
+
156
+ .markdown-body .md-footnotes {
157
+ margin-top: 2rem;
158
+ padding-top: 1rem;
159
+ border-top: 1px solid var(--border-color);
160
+ color: var(--fg-secondary);
161
+ font-size: calc(0.9rem * var(--ui-scale));
162
+ }
163
+
164
+ .markdown-body .md-footnotes ol {
165
+ padding-left: 1.5rem;
166
+ }
167
+
168
+ .markdown-body .md-footnote-backlink {
169
+ margin-left: 0.5rem;
170
+ font-size: 0.9em;
171
+ }
172
+
173
+ .markdown-body .md-definition-list {
174
+ display: grid;
175
+ grid-template-columns: minmax(10rem, 16rem) 1fr;
176
+ gap: 0.5rem 1rem;
177
+ margin: 1rem 0 1.25rem;
178
+ }
179
+
180
+ .markdown-body .md-definition-term {
181
+ font-weight: 700;
182
+ }
183
+
184
+ .markdown-body .md-definition-description {
185
+ margin: 0;
186
+ }
187
+
188
+ .markdown-body .md-definition-description > *:first-child {
189
+ margin-top: 0;
190
+ }
191
+
192
+ .markdown-body .md-math-inline code,
193
+ .markdown-body .md-math-block code {
194
+ font-family: var(--font-mono);
195
+ }
196
+
197
+ .markdown-body .md-math-inline {
198
+ display: inline-flex;
199
+ align-items: center;
200
+ padding: 0 0.2em;
201
+ border-radius: 4px;
202
+ background: color-mix(in srgb, var(--accent) 10%, transparent);
203
+ }
204
+
205
+ .markdown-body .md-math-block {
206
+ margin: 1rem 0;
207
+ padding: 0.75rem 1rem;
208
+ border: 1px solid var(--border-color);
209
+ border-radius: 6px;
210
+ background: var(--bg-inset);
211
+ }
212
+
213
+ .markdown-body .md-math-block pre {
214
+ margin: 0;
215
+ padding: 0;
216
+ border: none;
217
+ background: transparent;
218
+ }
219
+
220
+ .markdown-body .md-citation {
221
+ font-style: normal;
222
+ color: var(--fg-secondary);
223
+ background: color-mix(in srgb, var(--fg-secondary) 12%, transparent);
224
+ border-radius: 4px;
225
+ padding: 0 0.25em;
226
+ }
227
+
151
228
  /* Table Styles */
152
229
  .markdown-body table,
153
230
  .markdown-body .md-table {
@@ -39,6 +39,13 @@
39
39
  --app-gap: calc(4px * var(--ui-scale));
40
40
  --texture-opacity: 0.05;
41
41
  --editor-padding: calc(24px * var(--ui-scale));
42
+ --editor-line-height: calc(1.5rem * var(--ui-scale));
43
+ --editor-line-rhythm: var(--editor-line-height);
44
+ --markdown-line-height: var(--editor-line-rhythm);
45
+ --markdown-heading-line-height: calc(1.1 + ((var(--ui-scale) - 1) * 0.35));
46
+ --line-number-gutter-width: calc(30px * var(--ui-scale));
47
+ --mobile-rail-expanded-width: 100vw;
48
+ --mobile-expandable-rail-width: var(--mobile-rail-expanded-width);
42
49
  --file-indent-base: calc(12px * var(--ui-scale));
43
50
  --file-indent-unit: calc(12px * var(--ui-scale));
44
51
  --c-explorer-hover: rgba(0, 0, 0, 0.06);