@threadlabs/looma 0.53.10 → 0.53.12

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.
Files changed (46) hide show
  1. package/components/ui-button/ui-button.html +1 -0
  2. package/components/ui-checkbox/ui-checkbox.html +1 -0
  3. package/components/ui-color-picker/ui-color-picker.html +1 -1
  4. package/components/ui-combobox/ui-combobox.html +5 -2
  5. package/components/ui-disclosure/ui-disclosure.html +3 -2
  6. package/components/ui-form-field/ui-form-field.html +1 -1
  7. package/components/ui-input/ui-input.html +1 -0
  8. package/components/ui-list-item/ui-list-item.html +3 -3
  9. package/components/ui-listbox/ui-listbox.html +1 -0
  10. package/components/ui-menu/ui-menu.html +1 -1
  11. package/components/ui-menu-item/ui-menu-item.html +1 -1
  12. package/components/ui-nav-item/ui-nav-item.html +2 -2
  13. package/components/ui-radio/ui-radio.html +1 -0
  14. package/components/ui-radio-group/ui-radio-group.html +1 -0
  15. package/components/ui-segmented-control/ui-segmented-control.html +3 -2
  16. package/components/ui-select/ui-select.html +4 -1
  17. package/components/ui-switch/ui-switch.html +1 -0
  18. package/components/ui-textarea/ui-textarea.html +5 -2
  19. package/dist/index.js +1 -1
  20. package/docs/catalog.json +32 -29
  21. package/editor/chunks/extensions.js +2 -2
  22. package/editor/components.css +7 -3
  23. package/editor/extensions/preset.d.ts +2 -0
  24. package/editor/heading-link.d.ts +9 -0
  25. package/editor/index.js +121 -0
  26. package/editor/node-views/heading.d.ts +3 -0
  27. package/package.json +1 -1
  28. package/styles/ui-button.css +1 -0
  29. package/styles/ui-checkbox.css +1 -0
  30. package/styles/ui-color-picker.css +2 -2
  31. package/styles/ui-combobox.css +8 -4
  32. package/styles/ui-disclosure.css +2 -1
  33. package/styles/ui-form-field.css +1 -1
  34. package/styles/ui-input.css +1 -0
  35. package/styles/ui-list-item.css +3 -3
  36. package/styles/ui-listbox.css +2 -0
  37. package/styles/ui-menu-item.css +1 -1
  38. package/styles/ui-nav-item.css +1 -1
  39. package/styles/ui-radio-group.css +1 -0
  40. package/styles/ui-radio.css +1 -0
  41. package/styles/ui-segmented-control.css +3 -2
  42. package/styles/ui-select.css +4 -1
  43. package/styles/ui-switch.css +1 -0
  44. package/styles/ui-textarea.css +5 -2
  45. package/theme-system.css +3 -2
  46. package/tokens.css +1 -1
package/docs/catalog.json CHANGED
@@ -780,7 +780,7 @@
780
780
  ],
781
781
  "schemaVersion": 1,
782
782
  "package": "@threadlabs/looma",
783
- "version": "0.53.10",
783
+ "version": "0.53.12",
784
784
  "groups": [
785
785
  {
786
786
  "id": "layout",
@@ -8186,7 +8186,7 @@
8186
8186
  {
8187
8187
  "name": "--ui-combobox-label-font-size",
8188
8188
  "fallbacks": [
8189
- "var(--ui-field-label-font-size, var(--ui-font-size-md))"
8189
+ "var(--ui-field-label-font-size, var(--ui-font-size-sm))"
8190
8190
  ]
8191
8191
  },
8192
8192
  {
@@ -8344,7 +8344,7 @@
8344
8344
  {
8345
8345
  "name": "--ui-field-label-font-size",
8346
8346
  "fallbacks": [
8347
- "var(--ui-font-size-md)"
8347
+ "var(--ui-font-size-sm)"
8348
8348
  ]
8349
8349
  },
8350
8350
  {
@@ -17052,9 +17052,6 @@
17052
17052
  {
17053
17053
  "name": "--ui-font-semibold"
17054
17054
  },
17055
- {
17056
- "name": "--ui-font-size-md"
17057
- },
17058
17055
  {
17059
17056
  "name": "--ui-font-size-sm"
17060
17057
  },
@@ -17139,7 +17136,7 @@
17139
17136
  {
17140
17137
  "name": "density",
17141
17138
  "property": "density",
17142
- "description": "Compact trades padding and type size for rows that fit more on screen.",
17139
+ "description": "Compact reduces row spacing while keeping the shared UI text size.",
17143
17140
  "type": "keyword",
17144
17141
  "valueType": {
17145
17142
  "kind": "terminal",
@@ -17247,7 +17244,7 @@
17247
17244
  "properties": [
17248
17245
  {
17249
17246
  "name": "density",
17250
- "description": "Compact trades padding and type size for rows that fit more on screen.",
17247
+ "description": "Compact reduces row spacing while keeping the shared UI text size.",
17251
17248
  "type": "\"comfortable\" | \"compact\"",
17252
17249
  "default": "comfortable",
17253
17250
  "options": [
@@ -18921,7 +18918,7 @@
18921
18918
  {
18922
18919
  "name": "--ui-form-field-label-font-size",
18923
18920
  "fallbacks": [
18924
- "var(--ui-field-label-font-size, var(--ui-font-size-md))"
18921
+ "var(--ui-field-label-font-size, var(--ui-font-size-sm))"
18925
18922
  ]
18926
18923
  },
18927
18924
  {
@@ -18950,12 +18947,9 @@
18950
18947
  {
18951
18948
  "name": "--ui-field-label-font-size",
18952
18949
  "fallbacks": [
18953
- "var(--ui-font-size-md)"
18950
+ "var(--ui-font-size-sm)"
18954
18951
  ]
18955
18952
  },
18956
- {
18957
- "name": "--ui-font-size-md"
18958
- },
18959
18953
  {
18960
18954
  "name": "--ui-font-size-sm"
18961
18955
  },
@@ -22666,10 +22660,10 @@
22666
22660
  "name": "--ui-font-size-lg"
22667
22661
  },
22668
22662
  {
22669
- "name": "--ui-font-size-md"
22663
+ "name": "--ui-font-size-sm"
22670
22664
  },
22671
22665
  {
22672
- "name": "--ui-font-size-sm"
22666
+ "name": "--ui-line-height"
22673
22667
  },
22674
22668
  {
22675
22669
  "name": "--ui-line-height-tight"
@@ -23019,6 +23013,9 @@
23019
23013
  {
23020
23014
  "name": "--ui-focus-width"
23021
23015
  },
23016
+ {
23017
+ "name": "--ui-font-size-sm"
23018
+ },
23022
23019
  {
23023
23020
  "name": "--ui-line-height-md"
23024
23021
  },
@@ -23419,7 +23416,7 @@
23419
23416
  {
23420
23417
  "name": "density",
23421
23418
  "property": "density",
23422
- "description": "Compact trades padding and type size for rows that fit more on screen.",
23419
+ "description": "Compact reduces row spacing while keeping the shared UI text size.",
23423
23420
  "type": "keyword",
23424
23421
  "valueType": {
23425
23422
  "kind": "terminal",
@@ -23505,7 +23502,7 @@
23505
23502
  "properties": [
23506
23503
  {
23507
23504
  "name": "density",
23508
- "description": "Compact trades padding and type size for rows that fit more on screen.",
23505
+ "description": "Compact reduces row spacing while keeping the shared UI text size.",
23509
23506
  "type": "\"comfortable\" | \"compact\"",
23510
23507
  "default": "comfortable",
23511
23508
  "options": [
@@ -23861,7 +23858,7 @@
23861
23858
  {
23862
23859
  "name": "--ui-menu-item-font-size",
23863
23860
  "fallbacks": [
23864
- "var(--ui-font-size-md)"
23861
+ "var(--ui-font-size-sm)"
23865
23862
  ]
23866
23863
  },
23867
23864
  {
@@ -23938,9 +23935,6 @@
23938
23935
  {
23939
23936
  "name": "--ui-font-normal"
23940
23937
  },
23941
- {
23942
- "name": "--ui-font-size-md"
23943
- },
23944
23938
  {
23945
23939
  "name": "--ui-font-size-sm"
23946
23940
  },
@@ -24668,9 +24662,6 @@
24668
24662
  {
24669
24663
  "name": "--ui-font-normal"
24670
24664
  },
24671
- {
24672
- "name": "--ui-font-size-md"
24673
- },
24674
24665
  {
24675
24666
  "name": "--ui-font-size-sm"
24676
24667
  },
@@ -24776,7 +24767,7 @@
24776
24767
  {
24777
24768
  "name": "density",
24778
24769
  "property": "density",
24779
- "description": "Compact uses smaller type and row spacing to sit alongside a compact tree; comfortable keeps the regular navigation row.",
24770
+ "description": "Compact reduces row spacing to sit alongside a compact tree; both densities keep the shared UI text size.",
24780
24771
  "type": "keyword",
24781
24772
  "valueType": {
24782
24773
  "kind": "terminal",
@@ -24860,7 +24851,7 @@
24860
24851
  },
24861
24852
  {
24862
24853
  "name": "density",
24863
- "description": "Compact uses smaller type and row spacing to sit alongside a compact tree; comfortable keeps the regular navigation row.",
24854
+ "description": "Compact reduces row spacing to sit alongside a compact tree; both densities keep the shared UI text size.",
24864
24855
  "type": "\"comfortable\" | \"compact\"",
24865
24856
  "default": "comfortable",
24866
24857
  "options": [
@@ -26805,9 +26796,18 @@
26805
26796
  "var(--ui-danger-solid)"
26806
26797
  ]
26807
26798
  },
26799
+ {
26800
+ "name": "--ui-field-label-font-size",
26801
+ "fallbacks": [
26802
+ "var(--ui-font-size-sm)"
26803
+ ]
26804
+ },
26808
26805
  {
26809
26806
  "name": "--ui-font-medium"
26810
26807
  },
26808
+ {
26809
+ "name": "--ui-font-size-sm"
26810
+ },
26811
26811
  {
26812
26812
  "name": "--ui-space-2"
26813
26813
  },
@@ -28407,6 +28407,12 @@
28407
28407
  "var(--ui-danger-solid)"
28408
28408
  ]
28409
28409
  },
28410
+ {
28411
+ "name": "--ui-field-label-font-size",
28412
+ "fallbacks": [
28413
+ "var(--ui-font-size-sm)"
28414
+ ]
28415
+ },
28410
28416
  {
28411
28417
  "name": "--ui-field-radius",
28412
28418
  "fallbacks": [
@@ -28422,9 +28428,6 @@
28422
28428
  {
28423
28429
  "name": "--ui-font-medium"
28424
28430
  },
28425
- {
28426
- "name": "--ui-font-size-lg"
28427
- },
28428
28431
  {
28429
28432
  "name": "--ui-font-size-md"
28430
28433
  },
@@ -10432,7 +10432,7 @@ function getLoomaTableExtensions() {
10432
10432
  * the code and explicit language stay in the document schema.
10433
10433
  */
10434
10434
  function getDefaultEditorExtensions(options = {}) {
10435
- const { placeholder = "Type “/” for commands, or start writing…", linkOpenOnClick = false, linkBaseUrl, imageInline = false, imageNodeView, inlineImageNodeView, dividerNodeView, mention = createLoomaMentionExtension(), disableHighlight = false, codeLanguages, codeLowlight, codeBlockNodeView, tableOfContentsNodeView, expandNodeView, calloutNodeView } = options;
10435
+ const { placeholder = "Type “/” for commands, or start writing…", linkOpenOnClick = false, linkBaseUrl, imageInline = false, imageNodeView, inlineImageNodeView, dividerNodeView, headingNodeView, mention = createLoomaMentionExtension(), disableHighlight = false, codeLanguages, codeLowlight, codeBlockNodeView, tableOfContentsNodeView, expandNodeView, calloutNodeView } = options;
10436
10436
  const image = LoomaImage.configure({ inline: imageInline });
10437
10437
  const codeBlock = LoomaCodeBlock.configure({ lowlight: codeLowlight ?? createLowlight(codeLanguages) });
10438
10438
  return [
@@ -10450,7 +10450,7 @@ function getDefaultEditorExtensions(options = {}) {
10450
10450
  Italic,
10451
10451
  Strike,
10452
10452
  Underline,
10453
- LoomaHeading.configure({ levels: [
10453
+ (headingNodeView ? LoomaHeading.extend({ addNodeView: () => documentContentNodeView(headingNodeView) }) : LoomaHeading).configure({ levels: [
10454
10454
  1,
10455
10455
  2,
10456
10456
  3,
@@ -89,6 +89,7 @@
89
89
  background-color: var(--ui-button-surface, oklch(from var(--_tone) l c h / calc(5% * var(--ui-tonal-opacity, 1))));
90
90
  color: var(--ui-button-text, var(--_tone-text));
91
91
  font: inherit;
92
+ font-size: var(--ui-font-size-sm);
92
93
  font-weight: var(--ui-font-medium);
93
94
  text-decoration: none;
94
95
  /* Unset, a button wraps as its container does. */
@@ -987,7 +988,7 @@
987
988
 
988
989
  .label {
989
990
  color: var(--_ui-form-field-label-text, var(--ui-text-secondary));
990
- font-size: var(--_ui-form-field-label-font-size, var(--ui-field-label-font-size, var(--ui-font-size-md)));
991
+ font-size: var(--_ui-form-field-label-font-size, var(--ui-field-label-font-size, var(--ui-font-size-sm)));
991
992
  }
992
993
 
993
994
  /* A label action, such as a small help button, sits after the label text in a box one line
@@ -2028,7 +2029,7 @@
2028
2029
  text-align: left;
2029
2030
  border-radius: var(--ui-menu-item-radius, var(--_ui-default-menu-item-radius, var(--ui-selection-radius)));
2030
2031
  color: var(--ui-text-primary);
2031
- font-size: var(--ui-menu-item-font-size, var(--_ui-default-menu-item-font-size, var(--ui-font-size-md)));
2032
+ font-size: var(--ui-menu-item-font-size, var(--_ui-default-menu-item-font-size, var(--ui-font-size-sm)));
2032
2033
  font-weight: var(--ui-font-medium);
2033
2034
  text-decoration: none;
2034
2035
  cursor: pointer;
@@ -2909,6 +2910,7 @@
2909
2910
  gap: var(--ui-checkbox-gap, var(--ui-space-2)) !important;
2910
2911
  max-inline-size: 100%;
2911
2912
  color: var(--ui-text-primary);
2913
+ font-size: var(--ui-font-size-sm);
2912
2914
  line-height: var(--ui-line-height-md) !important;
2913
2915
  cursor: pointer;
2914
2916
  }
@@ -3211,6 +3213,7 @@
3211
3213
  background: transparent;
3212
3214
  color: inherit;
3213
3215
  font: inherit;
3216
+ font-size: var(--ui-font-size-sm);
3214
3217
  font-weight: var(--ui-font-semibold);
3215
3218
  text-align: start;
3216
3219
  cursor: pointer;
@@ -3317,7 +3320,7 @@
3317
3320
  min-block-size: var(--ui-nav-min-block-size);
3318
3321
  padding-block: var(--ui-nav-padding-block) !important;
3319
3322
  border-radius: var(--ui-selection-radius);
3320
- font-size: var(--ui-font-size-md);
3323
+ font-size: var(--ui-font-size-sm);
3321
3324
  font-weight: var(--ui-font-normal);
3322
3325
  color: var(--ui-text-secondary);
3323
3326
  }
@@ -3410,6 +3413,7 @@
3410
3413
  background-image: var(--_ui-default-input-highlight, var(--ui-surface-highlight, none));
3411
3414
  color: var(--ui-text-primary);
3412
3415
  font: inherit;
3416
+ font-size: var(--ui-font-size-sm);
3413
3417
  line-height: var(--ui-line-height-tight);
3414
3418
  box-shadow: var(--ui-input-shadow, var(--_ui-default-input-shadow, var(--ui-control-inset)));
3415
3419
  transition:
@@ -29,6 +29,8 @@ export interface DefaultEditorExtensionsOptions {
29
29
  inlineImageNodeView?: NodeViewRenderer;
30
30
  /** Optional selected-state UI for document dividers. */
31
31
  dividerNodeView?: NodeViewRenderer;
32
+ /** Optional copy-link presentation for headings with document anchors. */
33
+ headingNodeView?: NodeViewRenderer;
32
34
  /** Custom mention extension, the Looma default, or false to omit mentions. */
33
35
  mention?: AnyExtension | false;
34
36
  /**
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copy affordance for an existing heading anchor.
3
+ * @ownership The caller appends `dom` beside heading content and calls `destroy` on removal.
4
+ * The current ID and page URL are read at activation, so edits and client navigation cannot leave a stale link.
5
+ */
6
+ export declare function createHeadingLink(heading: HTMLElement): {
7
+ dom: HTMLElement;
8
+ destroy(): void;
9
+ };
package/editor/index.js CHANGED
@@ -11930,6 +11930,126 @@ var tableOfContentsNodeView = ({ editor, node, getPos }) => {
11930
11930
  };
11931
11931
  };
11932
11932
  //#endregion
11933
+ //#region src/editor/heading-link.ts
11934
+ var sequence = 0;
11935
+ /**
11936
+ * Copy affordance for an existing heading anchor.
11937
+ * @ownership The caller appends `dom` beside heading content and calls `destroy` on removal.
11938
+ * The current ID and page URL are read at activation, so edits and client navigation cannot leave a stale link.
11939
+ */
11940
+ function createHeadingLink(heading) {
11941
+ const id = `looma-heading-link-${++sequence}`;
11942
+ const icon = element(createUiIcon({
11943
+ name: "link",
11944
+ attributes: { "aria-hidden": "true" }
11945
+ }));
11946
+ const button = element(createUiIconButton({
11947
+ label: "Copy link",
11948
+ size: "sm",
11949
+ variant: "ghost",
11950
+ tone: "neutral",
11951
+ anticipatory: true,
11952
+ attributes: { id },
11953
+ children: [icon]
11954
+ }));
11955
+ const label = heading.ownerDocument.createTextNode("Copy link");
11956
+ const tooltip = element(createUiTooltip({
11957
+ for: id,
11958
+ children: [label],
11959
+ attributes: { "aria-live": "polite" }
11960
+ }));
11961
+ const dom = element(createUiAffordanceScope({
11962
+ guide: "none",
11963
+ attributes: {
11964
+ contenteditable: "false",
11965
+ "data-looma-heading-link": ""
11966
+ },
11967
+ children: [button, tooltip]
11968
+ }));
11969
+ let timer;
11970
+ let destroyed = false;
11971
+ let copying = false;
11972
+ const reveal = () => componentRegistry.update(button, { revealed: true });
11973
+ const conceal = () => componentRegistry.update(button, { revealed: false });
11974
+ const feedback = (copied) => {
11975
+ const text = copied ? "Link copied" : "Could not copy link";
11976
+ label.textContent = text;
11977
+ componentRegistry.update(button, { label: text });
11978
+ componentRegistry.update(icon, { name: copied ? "check" : "link" });
11979
+ componentRegistry.update(tooltip, { open: true });
11980
+ clearTimeout(timer);
11981
+ timer = setTimeout(() => {
11982
+ label.textContent = "Copy link";
11983
+ componentRegistry.update(button, { label: "Copy link" });
11984
+ componentRegistry.update(icon, { name: "link" });
11985
+ componentRegistry.update(tooltip, { open: false });
11986
+ }, 2e3);
11987
+ };
11988
+ const copy = async (event) => {
11989
+ event.preventDefault();
11990
+ event.stopPropagation();
11991
+ if (copying || !heading.id) return;
11992
+ copying = true;
11993
+ try {
11994
+ const url = new URL(heading.ownerDocument.defaultView.location.href);
11995
+ url.hash = encodeURIComponent(heading.id);
11996
+ await heading.ownerDocument.defaultView.navigator.clipboard.writeText(url.href);
11997
+ if (!destroyed) feedback(true);
11998
+ } catch {
11999
+ if (!destroyed) feedback(false);
12000
+ } finally {
12001
+ copying = false;
12002
+ }
12003
+ };
12004
+ const preserveSelection = (event) => event.preventDefault();
12005
+ heading.addEventListener("pointerenter", reveal);
12006
+ heading.addEventListener("pointerleave", conceal);
12007
+ button.addEventListener("pointerdown", preserveSelection);
12008
+ button.addEventListener("click", copy);
12009
+ return {
12010
+ dom,
12011
+ destroy() {
12012
+ destroyed = true;
12013
+ clearTimeout(timer);
12014
+ heading.removeEventListener("pointerenter", reveal);
12015
+ heading.removeEventListener("pointerleave", conceal);
12016
+ button.removeEventListener("pointerdown", preserveSelection);
12017
+ button.removeEventListener("click", copy);
12018
+ }
12019
+ };
12020
+ }
12021
+ //#endregion
12022
+ //#region src/editor/node-views/heading.ts
12023
+ /** The content span belongs to ProseMirror; the copy control never enters saved HTML or JSON. */
12024
+ var headingNodeView = ({ node }) => {
12025
+ let current = node;
12026
+ const dom = document.createElement(`h${node.attrs.level}`);
12027
+ const contentDOM = document.createElement("span");
12028
+ const link = createHeadingLink(dom);
12029
+ const updateAnchor = () => {
12030
+ if (current.attrs.id) dom.id = String(current.attrs.id);
12031
+ else dom.removeAttribute("id");
12032
+ if (current.attrs.align) dom.setAttribute("align", String(current.attrs.align));
12033
+ else dom.removeAttribute("align");
12034
+ link.dom.hidden = !current.attrs.id;
12035
+ };
12036
+ updateAnchor();
12037
+ dom.append(contentDOM, link.dom);
12038
+ return {
12039
+ dom,
12040
+ contentDOM,
12041
+ update(next) {
12042
+ if (next.type !== current.type || next.attrs.level !== current.attrs.level) return false;
12043
+ current = next;
12044
+ updateAnchor();
12045
+ return true;
12046
+ },
12047
+ stopEvent: (event) => event.target instanceof Node && link.dom.contains(event.target),
12048
+ ignoreMutation: (mutation) => mutation.type !== "selection" && link.dom.contains(mutation.target),
12049
+ destroy: link.destroy
12050
+ };
12051
+ };
12052
+ //#endregion
11933
12053
  //#region components/shared/form-reset.js
11934
12054
  /**
11935
12055
  * Calls back once a form reset has restored `control`'s form to its defaults. The browser restores
@@ -15651,6 +15771,7 @@ function createDocumentEditorSession(props, options) {
15651
15771
  codeLanguages: props.codeLanguages ?? void 0,
15652
15772
  codeLowlight: highlighting.lowlight,
15653
15773
  tableOfContentsNodeView,
15774
+ headingNodeView,
15654
15775
  expandNodeView,
15655
15776
  dividerNodeView,
15656
15777
  calloutNodeView,
@@ -0,0 +1,3 @@
1
+ import type { NodeViewRenderer } from "@tiptap/core";
2
+ /** The content span belongs to ProseMirror; the copy control never enters saved HTML or JSON. */
3
+ export declare const headingNodeView: NodeViewRenderer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.53.10",
3
+ "version": "0.53.12",
4
4
  "type": "module",
5
5
  "description": "HTML Next UI components, native DOM support and design tokens.",
6
6
  "license": "MIT",
@@ -89,6 +89,7 @@
89
89
  background-color: var(--ui-button-surface, oklch(from var(--_tone) l c h / calc(5% * var(--ui-tonal-opacity, 1))));
90
90
  color: var(--ui-button-text, var(--_tone-text));
91
91
  font: inherit;
92
+ font-size: var(--ui-font-size-sm);
92
93
  font-weight: var(--ui-font-medium);
93
94
  text-decoration: none;
94
95
  /* Unset, a button wraps as its container does. */
@@ -21,6 +21,7 @@
21
21
  gap: var(--ui-checkbox-gap, var(--ui-space-2)) !important;
22
22
  max-inline-size: 100%;
23
23
  color: var(--ui-text-primary);
24
+ font-size: var(--ui-font-size-sm);
24
25
  line-height: var(--ui-line-height-md) !important;
25
26
  cursor: pointer;
26
27
  }
@@ -13,7 +13,7 @@
13
13
  margin: 0 !important;
14
14
  padding: 0 !important;
15
15
  --_size: var(--ui-control-size-md);
16
- --_font: 1em;
16
+ --_font: var(--ui-font-size-sm);
17
17
  --_padding: var(--ui-control-inset-block-md, var(--ui-space-2));
18
18
  }
19
19
  :scope:where(:is([component~="ui-color-picker"]:not(template), [data-component~="ui-color-picker"]:not([component])))[data-ui-color-picker-state~="size=sm"] {
@@ -114,7 +114,7 @@
114
114
  margin: 0 !important;
115
115
  padding: 0 !important;
116
116
  --_size: var(--ui-control-size-md);
117
- --_font: 1em;
117
+ --_font: var(--ui-font-size-sm);
118
118
  --_padding: var(--ui-control-inset-block-md, var(--ui-space-2));
119
119
  }
120
120
  :where(:is([component~="ui-color-picker"]:not(template), [data-component~="ui-color-picker"]:not([component])))[data-ui-color-picker-state~="size=sm"]:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-color-picker"]))) {
@@ -32,10 +32,11 @@
32
32
  min-inline-size: 0;
33
33
  color: var(--ui-text-primary);
34
34
  font: inherit;
35
+ font-size: var(--ui-font-size-sm);
35
36
  }
36
37
  label {
37
38
  color: var(--_ui-combobox-label-text, var(--ui-text-primary));
38
- font-size: var(--_ui-combobox-label-font-size, var(--ui-field-label-font-size, var(--ui-font-size-md)));
39
+ font-size: var(--_ui-combobox-label-font-size, var(--ui-field-label-font-size, var(--ui-font-size-sm)));
39
40
  font-weight: 500;
40
41
  }
41
42
  /* The field and anything that annotates it sit on one row; the help button is beside the box,
@@ -267,7 +268,9 @@
267
268
  white-space: nowrap;
268
269
  }
269
270
  @media (pointer: coarse) {
270
- :scope:where(:is([component~="ui-combobox"]:not(template), [data-component~="ui-combobox"]:not([component])))[data-ui-combobox-state~="size=sm"] input {
271
+ :scope:where(:is([component~="ui-combobox"]:not(template), [data-component~="ui-combobox"]:not([component]))) input,
272
+ :scope:where(:is([component~="ui-combobox"]:not(template), [data-component~="ui-combobox"]:not([component])))[data-ui-combobox-state~="size=sm"] input,
273
+ :scope:where(:is([component~="ui-combobox"]:not(template), [data-component~="ui-combobox"]:not([component])))[data-ui-combobox-state~="size=lg"] input {
271
274
  font-size: var(--ui-font-size-md);
272
275
  }
273
276
  }
@@ -409,10 +412,11 @@
409
412
  min-inline-size: 0;
410
413
  color: var(--ui-text-primary);
411
414
  font: inherit;
415
+ font-size: var(--ui-font-size-sm);
412
416
  }
413
417
  label:where(:scope, :scope *) {
414
418
  color: var(--_ui-combobox-label-text, var(--ui-text-primary));
415
- font-size: var(--_ui-combobox-label-font-size, var(--ui-field-label-font-size, var(--ui-font-size-md)));
419
+ font-size: var(--_ui-combobox-label-font-size, var(--ui-field-label-font-size, var(--ui-font-size-sm)));
416
420
  font-weight: 500;
417
421
  }
418
422
  /* The field and anything that annotates it sit on one row; the help button is beside the box,
@@ -641,7 +645,7 @@
641
645
  white-space: nowrap;
642
646
  }
643
647
  @media (pointer: coarse) {
644
- :where(:is([component~="ui-combobox"]:not(template), [data-component~="ui-combobox"]:not([component])))[data-ui-combobox-state~="size=sm"] input:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-combobox"]))) {
648
+ :where(:is([component~="ui-combobox"]:not(template), [data-component~="ui-combobox"]:not([component]))) input:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-combobox"]))), :where(:is([component~="ui-combobox"]:not(template), [data-component~="ui-combobox"]:not([component])))[data-ui-combobox-state~="size=sm"] input:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-combobox"]))), :where(:is([component~="ui-combobox"]:not(template), [data-component~="ui-combobox"]:not([component])))[data-ui-combobox-state~="size=lg"] input:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-combobox"]))) {
645
649
  font-size: var(--ui-font-size-md);
646
650
  }
647
651
  }
@@ -47,6 +47,7 @@
47
47
  background: transparent;
48
48
  color: inherit;
49
49
  font: inherit;
50
+ font-size: var(--ui-font-size-sm);
50
51
  font-weight: var(--ui-font-semibold);
51
52
  text-align: start;
52
53
  cursor: pointer;
@@ -153,7 +154,7 @@
153
154
  min-block-size: var(--ui-nav-min-block-size);
154
155
  padding-block: var(--ui-nav-padding-block) !important;
155
156
  border-radius: var(--ui-selection-radius);
156
- font-size: var(--ui-font-size-md);
157
+ font-size: var(--ui-font-size-sm);
157
158
  font-weight: var(--ui-font-normal);
158
159
  color: var(--ui-text-secondary);
159
160
  }
@@ -33,7 +33,7 @@
33
33
 
34
34
  .label {
35
35
  color: var(--_ui-form-field-label-text, var(--ui-text-secondary));
36
- font-size: var(--_ui-form-field-label-font-size, var(--ui-field-label-font-size, var(--ui-font-size-md)));
36
+ font-size: var(--_ui-form-field-label-font-size, var(--ui-field-label-font-size, var(--ui-font-size-sm)));
37
37
  }
38
38
 
39
39
  /* A label action, such as a small help button, sits after the label text in a box one line
@@ -35,6 +35,7 @@
35
35
  background-image: var(--_ui-default-input-highlight, var(--ui-surface-highlight, none));
36
36
  color: var(--ui-text-primary);
37
37
  font: inherit;
38
+ font-size: var(--ui-font-size-sm);
38
39
  line-height: var(--ui-line-height-tight);
39
40
  box-shadow: var(--ui-input-shadow, var(--_ui-default-input-shadow, var(--ui-control-inset)));
40
41
  transition:
@@ -121,9 +121,9 @@
121
121
  }
122
122
 
123
123
  .title {
124
- font-size: var(--ui-font-size-md);
124
+ font-size: var(--ui-font-size-sm);
125
125
  font-weight: var(--_ui-list-item-title-weight, var(--ui-font-medium));
126
- line-height: var(--ui-line-height-tight);
126
+ line-height: var(--ui-line-height);
127
127
  }
128
128
 
129
129
  /* Keep identity and disclosure marks beside the first line, even with a long description. */
@@ -133,7 +133,7 @@
133
133
 
134
134
  :scope:where(:is([component~="ui-list-item"]:not(template), [data-component~="ui-list-item"]:not([component])))[data-ui-list-item-state~="align=title"] .leading,
135
135
  :scope:where(:is([component~="ui-list-item"]:not(template), [data-component~="ui-list-item"]:not([component])))[data-ui-list-item-state~="align=title"] .trailing {
136
- min-block-size: calc(var(--ui-font-size-md) * var(--ui-line-height-tight));
136
+ min-block-size: calc(var(--ui-font-size-sm) * var(--ui-line-height));
137
137
  }
138
138
 
139
139
  .description {
@@ -20,6 +20,7 @@
20
20
  background: var(--ui-listbox-surface, var(--ui-control-surface));
21
21
  color: var(--ui-text-primary);
22
22
  font: inherit;
23
+ font-size: var(--ui-font-size-sm);
23
24
  line-height: var(--ui-line-height-md);
24
25
  box-shadow: var(--ui-control-inset);
25
26
  outline: none;
@@ -99,6 +100,7 @@
99
100
  background: var(--ui-listbox-surface, var(--ui-control-surface));
100
101
  color: var(--ui-text-primary);
101
102
  font: inherit;
103
+ font-size: var(--ui-font-size-sm);
102
104
  line-height: var(--ui-line-height-md);
103
105
  box-shadow: var(--ui-control-inset);
104
106
  outline: none;
@@ -18,7 +18,7 @@
18
18
  text-align: left;
19
19
  border-radius: var(--ui-menu-item-radius, var(--_ui-default-menu-item-radius, var(--ui-selection-radius)));
20
20
  color: var(--ui-text-primary);
21
- font-size: var(--ui-menu-item-font-size, var(--_ui-default-menu-item-font-size, var(--ui-font-size-md)));
21
+ font-size: var(--ui-menu-item-font-size, var(--_ui-default-menu-item-font-size, var(--ui-font-size-sm)));
22
22
  font-weight: var(--ui-font-medium);
23
23
  text-decoration: none;
24
24
  cursor: pointer;
@@ -122,7 +122,7 @@
122
122
  }
123
123
 
124
124
  .label {
125
- font-size: var(--ui-font-size-md);
125
+ font-size: var(--ui-font-size-sm);
126
126
  line-height: var(--ui-line-height-tight);
127
127
  }
128
128
 
@@ -24,6 +24,7 @@
24
24
  margin: 0 0 var(--ui-space-2) !important;
25
25
  padding: 0 !important;
26
26
  color: var(--ui-text-primary);
27
+ font-size: var(--ui-field-label-font-size, var(--ui-font-size-sm));
27
28
  font-weight: var(--ui-font-medium);
28
29
  }
29
30
 
@@ -20,6 +20,7 @@
20
20
  gap: var(--ui-radio-gap, var(--ui-space-2)) !important;
21
21
  max-inline-size: 100%;
22
22
  color: var(--ui-text-primary);
23
+ font-size: var(--ui-font-size-sm);
23
24
  cursor: pointer;
24
25
  }
25
26