@threadlabs/looma 0.37.4 → 0.37.5

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 (124) hide show
  1. package/components/shared/active-item-reveal.js +74 -0
  2. package/components/shared/menu-navigation.js +3 -1
  3. package/components/ui-button/ui-button.html +13 -0
  4. package/components/ui-combobox/ui-combobox.js +3 -1
  5. package/components/ui-context-menu/ui-context-menu.js +4 -1
  6. package/components/ui-editor-link-form/ui-editor-link-form.js +3 -1
  7. package/components/ui-editor-mention-menu/ui-editor-mention-menu.js +12 -5
  8. package/components/ui-editor-slash-menu/ui-editor-slash-menu.js +12 -5
  9. package/components/ui-listbox/ui-listbox.js +3 -1
  10. package/components/ui-menu/ui-menu.js +5 -1
  11. package/components/ui-pagination/ui-pagination.html +74 -0
  12. package/components/ui-pagination/ui-pagination.js +19 -0
  13. package/components/ui-search-shell/ui-search-shell.js +7 -4
  14. package/dist/index.js +20 -19
  15. package/docs/catalog.json +323 -1
  16. package/docs/examples/ui-pagination/examples/01-numbered.behavior.js +11 -0
  17. package/package.json +1 -1
  18. package/styles/ui-button.css +12 -0
  19. package/styles/ui-pagination.css +1 -0
  20. package/vanilla/UiButton.d.ts +1 -0
  21. package/vanilla/UiButton.js +31 -31
  22. package/vanilla/UiPagination.d.ts +35 -0
  23. package/vanilla/UiPagination.js +202 -0
  24. package/vanilla/index.js +1 -0
  25. package/vue/UiButton.d.ts +6 -0
  26. package/vue/UiButton.vue +34 -0
  27. package/vue/UiPagination.d.ts +115 -0
  28. package/vue/UiPagination.js +2 -0
  29. package/vue/UiPagination.vue +598 -0
  30. package/vue/chunks/UiActionBar.js +1 -1
  31. package/vue/chunks/UiAffordanceScope.js +1 -1
  32. package/vue/chunks/UiAvatar.js +1 -1
  33. package/vue/chunks/UiAvatarGroup.js +1 -1
  34. package/vue/chunks/UiBadge.js +1 -1
  35. package/vue/chunks/UiBreadcrumbItem.js +1 -1
  36. package/vue/chunks/UiBreadcrumbs.js +1 -1
  37. package/vue/chunks/UiButton.js +30 -2
  38. package/vue/chunks/UiCallout.js +1 -1
  39. package/vue/chunks/UiCard.js +1 -1
  40. package/vue/chunks/UiCheckbox.js +1 -1
  41. package/vue/chunks/UiCluster.js +1 -1
  42. package/vue/chunks/UiColorPicker.js +1 -1
  43. package/vue/chunks/UiCombobox.js +1 -1
  44. package/vue/chunks/UiContainer.js +1 -1
  45. package/vue/chunks/UiContextMenu.js +1 -1
  46. package/vue/chunks/UiCover.js +1 -1
  47. package/vue/chunks/UiCurveEditor.js +1 -1
  48. package/vue/chunks/UiCycleButton.js +1 -1
  49. package/vue/chunks/UiDescriptionItem.js +1 -1
  50. package/vue/chunks/UiDescriptionList.js +1 -1
  51. package/vue/chunks/UiDialog.js +1 -1
  52. package/vue/chunks/UiDisclosure.js +1 -1
  53. package/vue/chunks/UiEditable.js +1 -1
  54. package/vue/chunks/UiEditorBlockActions.js +1 -1
  55. package/vue/chunks/UiEditorChipEditor.js +1 -1
  56. package/vue/chunks/UiEditorCodeLanguage.js +1 -1
  57. package/vue/chunks/UiEditorFootnoteEditor.js +1 -1
  58. package/vue/chunks/UiEditorImageToolbar.js +1 -1
  59. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  60. package/vue/chunks/UiEditorLinkCard.js +1 -1
  61. package/vue/chunks/UiEditorLinkForm.js +1 -1
  62. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  63. package/vue/chunks/UiEditorMentionMenuItem.js +1 -1
  64. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  65. package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
  66. package/vue/chunks/UiEditorSlashMenuItem.js +1 -1
  67. package/vue/chunks/UiEditorSurface.js +1 -1
  68. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  69. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  70. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  71. package/vue/chunks/UiEditorToolbar.js +1 -1
  72. package/vue/chunks/UiFloatingActionButton.js +1 -1
  73. package/vue/chunks/UiFormField.js +1 -1
  74. package/vue/chunks/UiGrid.js +1 -1
  75. package/vue/chunks/UiIcon.js +1 -1
  76. package/vue/chunks/UiIconButton.js +1 -1
  77. package/vue/chunks/UiImage.js +1 -1
  78. package/vue/chunks/UiInput.js +1 -1
  79. package/vue/chunks/UiInputGroup.js +1 -1
  80. package/vue/chunks/UiLightEditor.js +1 -1
  81. package/vue/chunks/UiList.js +1 -1
  82. package/vue/chunks/UiListItem.js +1 -1
  83. package/vue/chunks/UiListbox.js +1 -1
  84. package/vue/chunks/UiMenu.js +1 -1
  85. package/vue/chunks/UiMenuGroup.js +1 -1
  86. package/vue/chunks/UiMenuItem.js +1 -1
  87. package/vue/chunks/UiMeter.js +1 -1
  88. package/vue/chunks/UiNavItem.js +1 -1
  89. package/vue/chunks/UiNumberInput.js +1 -1
  90. package/vue/chunks/UiPageHeader.js +1 -1
  91. package/vue/chunks/UiPagination.js +551 -0
  92. package/vue/chunks/UiPopover.js +1 -1
  93. package/vue/chunks/UiRadio.js +1 -1
  94. package/vue/chunks/UiRadioGroup.js +1 -1
  95. package/vue/chunks/UiReel.js +1 -1
  96. package/vue/chunks/UiScrollArea.js +1 -1
  97. package/vue/chunks/UiSearchResultRow.js +1 -1
  98. package/vue/chunks/UiSearchShell.js +1 -1
  99. package/vue/chunks/UiSection.js +1 -1
  100. package/vue/chunks/UiSelect.js +1 -1
  101. package/vue/chunks/UiSeparator.js +1 -1
  102. package/vue/chunks/UiSidebar.js +1 -1
  103. package/vue/chunks/UiSlider.js +1 -1
  104. package/vue/chunks/UiSpinner.js +1 -1
  105. package/vue/chunks/UiStack.js +1 -1
  106. package/vue/chunks/UiStatusMessage.js +1 -1
  107. package/vue/chunks/UiSwatch.js +1 -1
  108. package/vue/chunks/UiSwitch.js +1 -1
  109. package/vue/chunks/UiSwitcher.js +1 -1
  110. package/vue/chunks/UiTable.js +1 -1
  111. package/vue/chunks/UiTabs.js +1 -1
  112. package/vue/chunks/UiText.js +1 -1
  113. package/vue/chunks/UiTextarea.js +1 -1
  114. package/vue/chunks/UiToast.js +1 -1
  115. package/vue/chunks/UiToastRegion.js +1 -1
  116. package/vue/chunks/UiTooltip.js +1 -1
  117. package/vue/chunks/UiTopBar.js +1 -1
  118. package/vue/chunks/UiTree.js +1 -1
  119. package/vue/chunks/UiTreeItem.js +1 -1
  120. package/vue/chunks/_plugin-vue_export-helper.js +27 -2
  121. package/vue/components.css +22 -0
  122. package/vue/editor/index.js +139 -35
  123. package/vue/index.d.ts +1 -0
  124. package/vue/index.js +2 -1
@@ -25,20 +25,20 @@ const T18 = ["",[]];
25
25
  const T19 = ["",[]];
26
26
  let P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19;
27
27
  const S = { n: ["appearance","colorTone"], t: ["?","?"], f: import.meta.url, g: "ui-button", k: 0, r: readonlyView, a: (host, I) => C(host, I), b: generatedInputs };
28
- const A = [["a",{},[],"",[],["data-ui-button-state","data-ui-button-prop-align","data-ui-button-prop-as","data-ui-button-prop-disabled","data-ui-button-prop-href","data-ui-button-prop-loading","data-ui-button-prop-pending","data-ui-button-prop-preset","data-ui-button-prop-rel","data-ui-button-prop-shape","data-ui-button-prop-size","data-ui-button-prop-stretch","data-ui-button-prop-target","data-ui-button-prop-tone","data-ui-button-prop-type","data-ui-button-prop-variant","data-appearance","data-tone","href","target","rel","aria-disabled","aria-busy","tabindex"]],["button",{},[],"",[],["data-ui-button-state","data-ui-button-prop-align","data-ui-button-prop-as","data-ui-button-prop-disabled","data-ui-button-prop-href","data-ui-button-prop-loading","data-ui-button-prop-pending","data-ui-button-prop-preset","data-ui-button-prop-rel","data-ui-button-prop-shape","data-ui-button-prop-size","data-ui-button-prop-stretch","data-ui-button-prop-target","data-ui-button-prop-tone","data-ui-button-prop-type","data-ui-button-prop-variant","data-appearance","data-tone","type","disabled","aria-disabled","aria-busy"]],["a",{},[],"",[],["data-ui-button-state","data-ui-button-prop-align","data-ui-button-prop-as","data-ui-button-prop-disabled","data-ui-button-prop-href","data-ui-button-prop-loading","data-ui-button-prop-pending","data-ui-button-prop-preset","data-ui-button-prop-rel","data-ui-button-prop-shape","data-ui-button-prop-size","data-ui-button-prop-stretch","data-ui-button-prop-target","data-ui-button-prop-tone","data-ui-button-prop-type","data-ui-button-prop-variant","data-appearance","data-tone","href","target","rel","aria-disabled","aria-busy","tabindex"]],["button",{},[],"",[],["data-ui-button-state","data-ui-button-prop-align","data-ui-button-prop-as","data-ui-button-prop-disabled","data-ui-button-prop-href","data-ui-button-prop-loading","data-ui-button-prop-pending","data-ui-button-prop-preset","data-ui-button-prop-rel","data-ui-button-prop-shape","data-ui-button-prop-size","data-ui-button-prop-stretch","data-ui-button-prop-target","data-ui-button-prop-tone","data-ui-button-prop-type","data-ui-button-prop-variant","data-appearance","data-tone","type","disabled","aria-disabled","aria-busy"]]];
28
+ const A = [["a",{},[],"",[],["data-ui-button-state","data-ui-button-prop-align","data-ui-button-prop-as","data-ui-button-prop-disabled","data-ui-button-prop-href","data-ui-button-prop-loading","data-ui-button-prop-pending","data-ui-button-prop-preset","data-ui-button-prop-rel","data-ui-button-prop-shape","data-ui-button-prop-size","data-ui-button-prop-square","data-ui-button-prop-stretch","data-ui-button-prop-target","data-ui-button-prop-tone","data-ui-button-prop-type","data-ui-button-prop-variant","data-appearance","data-tone","href","target","rel","aria-disabled","aria-busy","tabindex"]],["button",{},[],"",[],["data-ui-button-state","data-ui-button-prop-align","data-ui-button-prop-as","data-ui-button-prop-disabled","data-ui-button-prop-href","data-ui-button-prop-loading","data-ui-button-prop-pending","data-ui-button-prop-preset","data-ui-button-prop-rel","data-ui-button-prop-shape","data-ui-button-prop-size","data-ui-button-prop-square","data-ui-button-prop-stretch","data-ui-button-prop-target","data-ui-button-prop-tone","data-ui-button-prop-type","data-ui-button-prop-variant","data-appearance","data-tone","type","disabled","aria-disabled","aria-busy"]],["a",{},[],"",[],["data-ui-button-state","data-ui-button-prop-align","data-ui-button-prop-as","data-ui-button-prop-disabled","data-ui-button-prop-href","data-ui-button-prop-loading","data-ui-button-prop-pending","data-ui-button-prop-preset","data-ui-button-prop-rel","data-ui-button-prop-shape","data-ui-button-prop-size","data-ui-button-prop-square","data-ui-button-prop-stretch","data-ui-button-prop-target","data-ui-button-prop-tone","data-ui-button-prop-type","data-ui-button-prop-variant","data-appearance","data-tone","href","target","rel","aria-disabled","aria-busy","tabindex"]],["button",{},[],"",[],["data-ui-button-state","data-ui-button-prop-align","data-ui-button-prop-as","data-ui-button-prop-disabled","data-ui-button-prop-href","data-ui-button-prop-loading","data-ui-button-prop-pending","data-ui-button-prop-preset","data-ui-button-prop-rel","data-ui-button-prop-shape","data-ui-button-prop-size","data-ui-button-prop-square","data-ui-button-prop-stretch","data-ui-button-prop-target","data-ui-button-prop-tone","data-ui-button-prop-type","data-ui-button-prop-variant","data-appearance","data-tone","type","disabled","aria-disabled","aria-busy"]]];
29
29
  const Q = [[],[],[],[]];
30
- const D = { g: "ui-button", props: { "align": { "required":false,"values":["center","start"],"default":"center", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "as": { "required":false,"values":["button","a"],"default":"button", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "href": { "required":false, c: checkString, t: "string", j: 0, m: "s" }, "loading": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "pending": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "preset": { "required":false,"values":["none","primary","standard","quiet","destructive"],"default":"none", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "rel": { "required":false, c: checkString, t: "string", j: 0, m: "s" }, "shape": { "required":false,"values":["rounded","pill"],"default":"rounded", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "size": { "required":false,"values":["xs","sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "stretch": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "target": { "required":false, c: checkString, t: "string", j: 0, m: "s" }, "tone": { "required":false,"values":["accent","neutral","danger","success","warning","info"],"default":"accent", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "type": { "required":false,"values":["button","submit","reset"],"default":"button", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "variant": { "required":false,"values":["outline","solid","danger","ghost","link","card","field"],"default":"outline", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
30
+ const D = { g: "ui-button", props: { "align": { "required":false,"values":["center","start"],"default":"center", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "as": { "required":false,"values":["button","a"],"default":"button", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "href": { "required":false, c: checkString, t: "string", j: 0, m: "s" }, "loading": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "pending": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "preset": { "required":false,"values":["none","primary","standard","quiet","destructive"],"default":"none", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "rel": { "required":false, c: checkString, t: "string", j: 0, m: "s" }, "shape": { "required":false,"values":["rounded","pill"],"default":"rounded", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "size": { "required":false,"values":["xs","sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "square": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "stretch": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "target": { "required":false, c: checkString, t: "string", j: 0, m: "s" }, "tone": { "required":false,"values":["accent","neutral","danger","success","warning","info"],"default":"accent", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "type": { "required":false,"values":["button","submit","reset"],"default":"button", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "variant": { "required":false,"values":["outline","solid","danger","ghost","link","card","field"],"default":"outline", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
31
31
  const C = (host) => activateModule(controller, host);
32
32
 
33
33
  export function createUiButton(options = {}, html) {
34
34
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
35
- const v = [undefined, undefined, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null];
35
+ const v = [undefined, undefined, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null];
36
36
  let B = acceptProps(undefined, D, S.n, v, componentProps, [], html);
37
37
  const CS = [];
38
- const inputStatus = (j) => { if (j >= 0 && j < 2) { g(j); return CS[j] ?? UNRESOLVED_INPUT; } if (j === 2) return awaitInput(B, "align", true); if (j === 3) return awaitInput(B, "as", true); if (j === 4) return awaitInput(B, "disabled", true); if (j === 5) return awaitInput(B, "href", true); if (j === 6) return awaitInput(B, "loading", true); if (j === 7) return awaitInput(B, "pending", true); if (j === 8) return awaitInput(B, "preset", true); if (j === 9) return awaitInput(B, "rel", true); if (j === 10) return awaitInput(B, "shape", true); if (j === 11) return awaitInput(B, "size", true); if (j === 12) return awaitInput(B, "stretch", true); if (j === 13) return awaitInput(B, "target", true); if (j === 14) return awaitInput(B, "tone", true); if (j === 15) return awaitInput(B, "type", true); if (j === 16) return awaitInput(B, "variant", true); return v[j] === undefined ? UNRESOLVED_INPUT : READY_INPUT; };
38
+ const inputStatus = (j) => { if (j >= 0 && j < 2) { g(j); return CS[j] ?? UNRESOLVED_INPUT; } if (j === 2) return awaitInput(B, "align", true); if (j === 3) return awaitInput(B, "as", true); if (j === 4) return awaitInput(B, "disabled", true); if (j === 5) return awaitInput(B, "href", true); if (j === 6) return awaitInput(B, "loading", true); if (j === 7) return awaitInput(B, "pending", true); if (j === 8) return awaitInput(B, "preset", true); if (j === 9) return awaitInput(B, "rel", true); if (j === 10) return awaitInput(B, "shape", true); if (j === 11) return awaitInput(B, "size", true); if (j === 12) return awaitInput(B, "square", true); if (j === 13) return awaitInput(B, "stretch", true); if (j === 14) return awaitInput(B, "target", true); if (j === 15) return awaitInput(B, "tone", true); if (j === 16) return awaitInput(B, "type", true); if (j === 17) return awaitInput(B, "variant", true); return v[j] === undefined ? UNRESOLVED_INPUT : READY_INPUT; };
39
39
  const X = { e: 0, g: (j) => g(j), w: new Set(), a: CS, i: inputStatus };
40
40
  const ke = [];
41
- const K = [() => readIndex({ "none": inputRead(v[16], inputStatus(16)), "primary": "solid", "standard": "solid", "quiet": "ghost", "destructive": "solid" }, inputRead(v[8], inputStatus(8))), () => readIndex(recordValue(["none","primary","standard","quiet","destructive"], [readIndex({ "true": "danger", "false": inputRead(v[14], inputStatus(14)) }, textCall("concat", [(inputRead(v[16], inputStatus(16)) === "danger")])), "accent", "neutral", "neutral", "danger"]), inputRead(v[8], inputStatus(8)))];
41
+ const K = [() => readIndex({ "none": inputRead(v[17], inputStatus(17)), "primary": "solid", "standard": "solid", "quiet": "ghost", "destructive": "solid" }, inputRead(v[8], inputStatus(8))), () => readIndex(recordValue(["none","primary","standard","quiet","destructive"], [readIndex({ "true": "danger", "false": inputRead(v[15], inputStatus(15)) }, textCall("concat", [(inputRead(v[17], inputStatus(17)) === "danger")])), "accent", "neutral", "neutral", "danger"]), inputRead(v[8], inputStatus(8)))];
42
42
  const g = (j) => {
43
43
  const i = j - 0;
44
44
  if (ke[i] === X.e) return v[j];
@@ -233,12 +233,12 @@ export function createUiButton(options = {}, html) {
233
233
  return r;
234
234
  };
235
235
  const p0 = (r, c, d) => {
236
- if (c & 1073807616) {
236
+ if (c & 1073873152) {
237
237
  const x0 = g(0);
238
238
  const s0 = toAttribute(x0, "data-appearance");
239
239
  if (s0 !== r.v0) writeAttribute(r.n, "data-appearance", r.v0 = s0);
240
240
  }
241
- if (c & 1073824000) {
241
+ if (c & 1073905920) {
242
242
  const x1 = g(1);
243
243
  if (x1 !== NONCONFORMING) {
244
244
  const s1 = toAttribute(x1, "data-tone");
@@ -252,8 +252,8 @@ export function createUiButton(options = {}, html) {
252
252
  if (s2 !== r.v2) writeUrlAttribute(r.n, "href", r.v2 = s2);
253
253
  }
254
254
  }
255
- if (c & 8192) {
256
- const x3 = v[13];
255
+ if (c & 16384) {
256
+ const x3 = v[14];
257
257
  const s3 = toAttribute(x3, "target");
258
258
  if (s3 !== r.v3) writeAttribute(r.n, "target", r.v3 = s3);
259
259
  }
@@ -281,8 +281,8 @@ export function createUiButton(options = {}, html) {
281
281
  if (s7 !== r.v7) writeAttribute(r.n, "tabindex", r.v7 = s7);
282
282
  }
283
283
  }
284
- if (c & 7364) {
285
- const x8 = hostState(["align","stretch","size","shape","loading","pending"], [v[2], v[12], v[11], v[10], v[6], v[7]]);
284
+ if (c & 15556) {
285
+ const x8 = hostState(["align","stretch","size","shape","square","loading","pending"], [v[2], v[13], v[11], v[10], v[12], v[6], v[7]]);
286
286
  const s8 = x8;
287
287
  if (s8 !== r.v8) writeAttribute(r.n, "data-ui-button-state", (r.v8 = s8) === "" ? null : s8);
288
288
  }
@@ -315,20 +315,20 @@ export function createUiButton(options = {}, html) {
315
315
  return r;
316
316
  };
317
317
  const p6 = (r, c, d) => {
318
- if (c & 1073807616) {
318
+ if (c & 1073873152) {
319
319
  const x0 = g(0);
320
320
  const s0 = toAttribute(x0, "data-appearance");
321
321
  if (s0 !== r.v0) writeAttribute(r.n, "data-appearance", r.v0 = s0);
322
322
  }
323
- if (c & 1073824000) {
323
+ if (c & 1073905920) {
324
324
  const x1 = g(1);
325
325
  if (x1 !== NONCONFORMING) {
326
326
  const s1 = toAttribute(x1, "data-tone");
327
327
  if (s1 !== r.v1) writeAttribute(r.n, "data-tone", r.v1 = s1);
328
328
  }
329
329
  }
330
- if (c & 1073774592) {
331
- const x2 = v[15];
330
+ if (c & 1073807360) {
331
+ const x2 = v[16];
332
332
  const s2 = toAttribute(x2, "type");
333
333
  if (s2 !== r.v2) writeAttribute(r.n, "type", r.v2 = s2);
334
334
  }
@@ -349,8 +349,8 @@ export function createUiButton(options = {}, html) {
349
349
  const s5 = toAttribute(x5, "aria-busy");
350
350
  if (s5 !== r.v5) writeAttribute(r.n, "aria-busy", r.v5 = s5);
351
351
  }
352
- if (c & 7364) {
353
- const x6 = hostState(["align","stretch","size","shape","loading","pending"], [v[2], v[12], v[11], v[10], v[6], v[7]]);
352
+ if (c & 15556) {
353
+ const x6 = hostState(["align","stretch","size","shape","square","loading","pending"], [v[2], v[13], v[11], v[10], v[12], v[6], v[7]]);
354
354
  const s6 = x6;
355
355
  if (s6 !== r.v6) writeAttribute(r.n, "data-ui-button-state", (r.v6 = s6) === "" ? null : s6);
356
356
  }
@@ -379,12 +379,12 @@ export function createUiButton(options = {}, html) {
379
379
  return r;
380
380
  };
381
381
  const p12 = (r, c, d) => {
382
- if (c & 1073807616) {
382
+ if (c & 1073873152) {
383
383
  const x0 = g(0);
384
384
  const s0 = toAttribute(x0, "data-appearance");
385
385
  if (s0 !== r.v0) writeAttribute(r.n, "data-appearance", r.v0 = s0);
386
386
  }
387
- if (c & 1073824000) {
387
+ if (c & 1073905920) {
388
388
  const x1 = g(1);
389
389
  if (x1 !== NONCONFORMING) {
390
390
  const s1 = toAttribute(x1, "data-tone");
@@ -398,8 +398,8 @@ export function createUiButton(options = {}, html) {
398
398
  if (s2 !== r.v2) writeUrlAttribute(r.n, "href", r.v2 = s2);
399
399
  }
400
400
  }
401
- if (c & 8192) {
402
- const x3 = v[13];
401
+ if (c & 16384) {
402
+ const x3 = v[14];
403
403
  const s3 = toAttribute(x3, "target");
404
404
  if (s3 !== r.v3) writeAttribute(r.n, "target", r.v3 = s3);
405
405
  }
@@ -427,8 +427,8 @@ export function createUiButton(options = {}, html) {
427
427
  if (s7 !== r.v7) writeAttribute(r.n, "tabindex", r.v7 = s7);
428
428
  }
429
429
  }
430
- if (c & 7364) {
431
- const x8 = hostState(["align","stretch","size","shape","loading","pending"], [v[2], v[12], v[11], v[10], v[6], v[7]]);
430
+ if (c & 15556) {
431
+ const x8 = hostState(["align","stretch","size","shape","square","loading","pending"], [v[2], v[13], v[11], v[10], v[12], v[6], v[7]]);
432
432
  const s8 = x8;
433
433
  if (s8 !== r.v8) writeAttribute(r.n, "data-ui-button-state", (r.v8 = s8) === "" ? null : s8);
434
434
  }
@@ -453,20 +453,20 @@ export function createUiButton(options = {}, html) {
453
453
  return r;
454
454
  };
455
455
  const p16 = (r, c, d) => {
456
- if (c & 1073807616) {
456
+ if (c & 1073873152) {
457
457
  const x0 = g(0);
458
458
  const s0 = toAttribute(x0, "data-appearance");
459
459
  if (s0 !== r.v0) writeAttribute(r.n, "data-appearance", r.v0 = s0);
460
460
  }
461
- if (c & 1073824000) {
461
+ if (c & 1073905920) {
462
462
  const x1 = g(1);
463
463
  if (x1 !== NONCONFORMING) {
464
464
  const s1 = toAttribute(x1, "data-tone");
465
465
  if (s1 !== r.v1) writeAttribute(r.n, "data-tone", r.v1 = s1);
466
466
  }
467
467
  }
468
- if (c & 1073774592) {
469
- const x2 = v[15];
468
+ if (c & 1073807360) {
469
+ const x2 = v[16];
470
470
  const s2 = toAttribute(x2, "type");
471
471
  if (s2 !== r.v2) writeAttribute(r.n, "type", r.v2 = s2);
472
472
  }
@@ -487,8 +487,8 @@ export function createUiButton(options = {}, html) {
487
487
  const s5 = toAttribute(x5, "aria-busy");
488
488
  if (s5 !== r.v5) writeAttribute(r.n, "aria-busy", r.v5 = s5);
489
489
  }
490
- if (c & 7364) {
491
- const x6 = hostState(["align","stretch","size","shape","loading","pending"], [v[2], v[12], v[11], v[10], v[6], v[7]]);
490
+ if (c & 15556) {
491
+ const x6 = hostState(["align","stretch","size","shape","square","loading","pending"], [v[2], v[13], v[11], v[10], v[12], v[6], v[7]]);
492
492
  const s6 = x6;
493
493
  if (s6 !== r.v6) writeAttribute(r.n, "data-ui-button-state", (r.v6 = s6) === "" ? null : s6);
494
494
  }
@@ -508,7 +508,7 @@ export function createUiButton(options = {}, html) {
508
508
  const p = (c, d) => {
509
509
  if (R === null) return;
510
510
  if (R === undefined) { R = M[a](element, d); return; }
511
- if (c & 1073807624) {
511
+ if (c & 1073873160) {
512
512
  const t = (((g(0) === "card") && (v[3] === "a")) ? 0 : (g(0) === "card") ? 1 : (v[3] === "a") ? 2 : 3);
513
513
  if (t !== a) {
514
514
  dispose(R);
@@ -530,4 +530,4 @@ export function createUiButton(options = {}, html) {
530
530
  manageProps(I);
531
531
  return element;
532
532
  }
533
- defineComponent("ui-button", createUiButton, ["align","as","disabled","href","loading","pending","preset","rel","shape","size","stretch","target","tone","type","variant"]);
533
+ defineComponent("ui-button", createUiButton, ["align","as","disabled","href","loading","pending","preset","rel","shape","size","square","stretch","target","tone","type","variant"]);
@@ -0,0 +1,35 @@
1
+ // Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
2
+ export interface UiPaginationEventMap {
3
+ navigate: CustomEvent<{ readonly page: number; readonly previousPage: number; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
4
+ }
5
+ export interface UiPaginationElement extends HTMLElement {
6
+ addEventListener<K extends keyof UiPaginationEventMap>(type: K, listener: (this: UiPaginationElement, event: UiPaginationEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
7
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiPaginationElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
8
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
9
+ removeEventListener<K extends keyof UiPaginationEventMap>(type: K, listener: (this: UiPaginationElement, event: UiPaginationEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
10
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiPaginationElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
11
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
12
+ }
13
+ export interface UiPaginationProps {
14
+ disabled?: boolean | null;
15
+ hasNext?: boolean | null;
16
+ hasPrevious?: boolean | null;
17
+ label?: string | null;
18
+ nextHref?: string | null;
19
+ nextLabel?: string | null;
20
+ page?: number | null;
21
+ pageLabel?: string | null;
22
+ pages?: readonly ({ readonly value: number; readonly href?: string | null })[] | null;
23
+ previousHref?: string | null;
24
+ previousLabel?: string | null;
25
+ size?: "sm" | "md" | "lg" | null;
26
+ attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
27
+ children?: readonly (string | Node)[];
28
+ slots?: Readonly<Record<string, readonly (string | Node)[]>>;
29
+ }
30
+ export declare function createUiPagination(props?: UiPaginationProps): UiPaginationElement;
31
+ declare global {
32
+ interface ComponentTagMap {
33
+ "ui-pagination": { element: UiPaginationElement; props: Omit<UiPaginationProps, "attributes" | "children" | "slots"> };
34
+ }
35
+ }
@@ -0,0 +1,202 @@
1
+ // Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
2
+ import { attachGeneratedController, binaryValue, buildTemplate, clearRegion, defaultValue, formatCall, NONCONFORMING, readIndex, readMember, textCall, toAttribute, toText, trackContainer, truthy, writeAttribute, writeUrlAttribute, dispatchDeclared, detailCheck, dispose, formatOf, keywordFormat, acceptProps, manageProps, generatedInputs, project, fillSlot, RangedPositionalList, checkBoolean, checkConstrained, checkFormat, checkList, checkNumber, checkObject, checkString, defineComponent, activateModule, add, subtract } from "@nextwebwg/html-next/generated-runtime";
3
+ import * as controller from "../components/ui-pagination/ui-pagination.js";
4
+ import "../styles/ui-pagination.css";
5
+
6
+ const T0 = ["",[],"\n ",["ui-cluster",["gap","xs"],["ui-button",["square","","variant","ghost","tone","neutral"],["ui-icon",["name","chevron-left"]]],"\n ",2,"\n ",["ui-button",["square","","variant","ghost","tone","neutral"],["ui-icon",["name","chevron-right"]]],"\n ",4],"\n "];
7
+ const T1 = ["",[],"\n ",1,"\n ",["ui-button",["square",""],0],"\n "];
8
+ const T2 = ["span",["aria-hidden","true"],"…"];
9
+ const T3 = ["",[]];
10
+ let P0, P1, P2, P3;
11
+ const E = new Map();
12
+ const S = { n: [], t: [], f: import.meta.url, g: "ui-pagination", d: { "navigate": [detailCheck(checkObject([["page", checkNumber, false], ["previousPage", checkNumber, false], ["trigger", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["keyboard","pointer","programmatic"]}), false]], false)), true, true, false] }, x: dispatchDeclared, a: (host, I) => C(host, I), b: generatedInputs };
13
+ const D = { g: "ui-pagination", props: { "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "hasNext": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "hasPrevious": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "label": { "required":false,"default":"Results pages", c: checkString, t: "string", j: 0, m: "s" }, "nextHref": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "nextLabel": { "required":false,"default":"Next", c: checkString, t: "string", j: 0, m: "s" }, "page": { "required":false,"default":1, c: checkNumber, t: "number", j: 0, m: "n" }, "pageLabel": { "required":false,"default":"Page", c: checkString, t: "string", j: 0, m: "s" }, "pages": { "required":false,"default":[], c: checkList(checkObject([["value", checkNumber, false], ["href", checkString, true]], false)), j: 1, m: ["l",["o",["value","n","href","s"]]] }, "previousHref": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "previousLabel": { "required":false,"default":"Previous", c: checkString, t: "string", j: 0, m: "s" }, "size": { "required":false,"values":["sm","md","lg"],"default":"sm", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
14
+ const C = (host) => activateModule(controller, host);
15
+
16
+ export function createUiPagination(options = {}, html) {
17
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
18
+ const element = document.createElement("nav");
19
+ for (const [name, value] of Object.entries(attributes)) {
20
+ if (value === null || value === undefined || value === false) continue;
21
+ element.setAttribute(name, value === true ? "" : String(value));
22
+ }
23
+ element.setAttribute("data-component", "ui-pagination");
24
+ element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
25
+ const v = [null, null, null, null, null, null, null, null, null, null, null, null];
26
+ const B = acceptProps(element, D, S.n, v, componentProps, [], html);
27
+ const m1 = (o, j, l) => {
28
+ const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
29
+ const t0 = n.firstChild.nextSibling;
30
+ const t1 = t0.nextSibling.nextSibling.nextSibling;
31
+ const t2 = t1.firstChild;
32
+ const s = document.createComment("html-next:item-start"), t = document.createComment("html-next:item-end");
33
+ n.prepend(s);
34
+ n.append(t);
35
+ const r = { k: undefined, i: o, n: s, t, x: 0, y: 0, j, l, a1: t1, a2: t2, w: 0, v0: null, v1: null, v2: null, v3: null, v4: null, v5: null, v6: null, v7: null, v8: null, v9: "", a0: t0, e0: t0.nextSibling, b0: undefined };
36
+ p1(r, -1, E);
37
+ return r;
38
+ };
39
+ const p1 = (r, c, d) => {
40
+ const o = r.i;
41
+ if (c & 1073741824) r.w = 0;
42
+ if (c & 1073741888) {
43
+ const x0 = trackContainer(r, readIndex({ "true": "solid", "false": "ghost" }, textCall("concat", [(readMember(o, "value") === v[6])])));
44
+ if (x0 !== NONCONFORMING) {
45
+ const s0 = toAttribute(x0, "variant");
46
+ if (s0 !== r.v0) writeAttribute(r.a1, "variant", r.v0 = s0);
47
+ }
48
+ const x1 = trackContainer(r, readIndex({ "true": "accent", "false": "neutral" }, textCall("concat", [(readMember(o, "value") === v[6])])));
49
+ if (x1 !== NONCONFORMING) {
50
+ const s1 = toAttribute(x1, "tone");
51
+ if (s1 !== r.v1) writeAttribute(r.a1, "tone", r.v1 = s1);
52
+ }
53
+ }
54
+ if (c & 1073743872) {
55
+ const x2 = v[11];
56
+ const s2 = toAttribute(x2, "size");
57
+ if (s2 !== r.v2) writeAttribute(r.a1, "size", r.v2 = s2);
58
+ }
59
+ if (c & 1) {
60
+ const x3 = v[0];
61
+ const s3 = toAttribute(x3, "disabled");
62
+ if (s3 !== r.v3) writeAttribute(r.a1, "disabled", r.v3 = s3);
63
+ }
64
+ if (c & 1073741824) {
65
+ const x4 = trackContainer(r, readIndex({ "true": "a", "false": "button" }, textCall("concat", [(defaultValue(readMember(o, "href"), "") !== "")])));
66
+ if (x4 !== NONCONFORMING) {
67
+ const s4 = toAttribute(x4, "as");
68
+ if (s4 !== r.v4) writeAttribute(r.a1, "as", r.v4 = s4);
69
+ }
70
+ const x5 = trackContainer(r, readMember(o, "href"));
71
+ const s5 = toAttribute(x5, "href");
72
+ if (s5 !== r.v5) writeUrlAttribute(r.a1, "href", r.v5 = s5);
73
+ const x6 = trackContainer(r, readMember(o, "value"));
74
+ const s6 = toAttribute(x6, "data-pagination-page");
75
+ if (s6 !== r.v6) writeAttribute(r.a1, "data-pagination-page", r.v6 = s6);
76
+ const x7 = formatCall("format", [trackContainer(r, readMember(o, "value")), "number"], "number");
77
+ if (x7 !== NONCONFORMING) {
78
+ const s9 = toText(x7);
79
+ if (s9 !== r.v9) r.a2.data = r.v9 = s9;
80
+ }
81
+ }
82
+ if (c & 1073741952) {
83
+ const x8 = textCall("concat", [v[7], " ", formatCall("format", [trackContainer(r, readMember(o, "value")), "number"], "number")]);
84
+ if (x8 !== NONCONFORMING) {
85
+ const s7 = toAttribute(x8, "aria-label");
86
+ if (s7 !== r.v7) writeAttribute(r.a1, "aria-label", r.v7 = s7);
87
+ }
88
+ }
89
+ if (c & 1073741888) {
90
+ const x9 = trackContainer(r, readIndex({ "true": "page", "false": null }, textCall("concat", [(readMember(o, "value") === v[6])])));
91
+ if (x9 !== NONCONFORMING) {
92
+ const s8 = toAttribute(x9, "aria-current");
93
+ if (s8 !== r.v8) writeAttribute(r.a1, "aria-current", r.v8 = s8);
94
+ }
95
+ }
96
+ if (c & -1073741568 && !((truthy(binaryValue(">", r.j, 0)) && truthy(binaryValue(">", readMember(o, "value"), binaryValue("+", readMember(readIndex(v[8], binaryValue("-", r.j, 1, undefined, undefined, subtract)), "value"), 1, undefined, undefined, add))))) !== !r.b0) {
97
+ if (r.b0) { r.b0 = undefined; clearRegion(r.a0, r.e0); }
98
+ else { r.b0 = m2(d); r.e0.before(r.b0.n); }
99
+ } else if (r.b0 !== undefined) p2(r.b0, c, d);
100
+ };
101
+ const m2 = (d) => {
102
+ const n = (P2 ??= buildTemplate(T2)).cloneNode(true);
103
+ const r = { n };
104
+ p2(r, -1, d);
105
+ return r;
106
+ };
107
+ const p2 = (r, c, d) => {
108
+ };
109
+ const m3 = (d) => {
110
+ const n = (P3 ??= buildTemplate(T3)).cloneNode(true);
111
+ const r = { n };
112
+ p3(r, -1, d);
113
+ return r;
114
+ };
115
+ const p3 = (r, c, d) => {
116
+ };
117
+ const p0 = (r, c, d) => {
118
+ if (c & 8) {
119
+ const x0 = v[3];
120
+ const s0 = toAttribute(x0, "aria-label");
121
+ if (s0 !== r.v0) writeAttribute(r.n, "aria-label", r.v0 = s0);
122
+ }
123
+ if (c & 1073743872) {
124
+ const x1 = v[11];
125
+ const s1 = toAttribute(x1, "size");
126
+ if (s1 !== r.v1) writeAttribute(r.a1, "size", r.v1 = s1);
127
+ const s7 = toAttribute(x1, "size");
128
+ if (s7 !== r.v7) writeAttribute(r.a3, "size", r.v7 = s7);
129
+ }
130
+ if (c & 69) {
131
+ const x2 = ((truthy(v[0]) || !truthy(v[2])) || truthy(binaryValue("<=", v[6], 1)));
132
+ const s2 = toAttribute(x2, "disabled");
133
+ if (s2 !== r.v2) writeAttribute(r.a1, "disabled", r.v2 = s2);
134
+ }
135
+ if (c & 1073742336) {
136
+ const x3 = readIndex({ "true": "a", "false": "button" }, textCall("concat", [(v[9] !== "")]));
137
+ if (x3 !== NONCONFORMING) {
138
+ const s3 = toAttribute(x3, "as");
139
+ if (s3 !== r.v3) writeAttribute(r.a1, "as", r.v3 = s3);
140
+ }
141
+ }
142
+ if (c & 512) {
143
+ const x4 = v[9];
144
+ const s4 = toAttribute(x4, "href");
145
+ if (s4 !== r.v4) writeUrlAttribute(r.a1, "href", r.v4 = s4);
146
+ }
147
+ if (c & 1024) {
148
+ const x5 = v[10];
149
+ const s5 = toAttribute(x5, "aria-label");
150
+ if (s5 !== r.v5) writeAttribute(r.a1, "aria-label", r.v5 = s5);
151
+ }
152
+ if (c & 64) {
153
+ const x6 = binaryValue("-", v[6], 1, undefined, undefined, subtract);
154
+ const s6 = toAttribute(x6, "data-pagination-page");
155
+ if (s6 !== r.v6) writeAttribute(r.a1, "data-pagination-page", r.v6 = s6);
156
+ }
157
+ if (c & 3) {
158
+ const x7 = (truthy(v[0]) || !truthy(v[1]));
159
+ const s8 = toAttribute(x7, "disabled");
160
+ if (s8 !== r.v8) writeAttribute(r.a3, "disabled", r.v8 = s8);
161
+ }
162
+ if (c & 1073741840) {
163
+ const x8 = readIndex({ "true": "a", "false": "button" }, textCall("concat", [(v[4] !== "")]));
164
+ if (x8 !== NONCONFORMING) {
165
+ const s9 = toAttribute(x8, "as");
166
+ if (s9 !== r.v9) writeAttribute(r.a3, "as", r.v9 = s9);
167
+ }
168
+ }
169
+ if (c & 16) {
170
+ const x9 = v[4];
171
+ const s10 = toAttribute(x9, "href");
172
+ if (s10 !== r.v10) writeUrlAttribute(r.a3, "href", r.v10 = s10);
173
+ }
174
+ if (c & 32) {
175
+ const x10 = v[5];
176
+ const s11 = toAttribute(x10, "aria-label");
177
+ if (s11 !== r.v11) writeAttribute(r.a3, "aria-label", r.v11 = s11);
178
+ }
179
+ if (c & 64) {
180
+ const x11 = binaryValue("+", v[6], 1, undefined, undefined, add);
181
+ const s12 = toAttribute(x11, "data-pagination-page");
182
+ if (s12 !== r.v12) writeAttribute(r.a3, "data-pagination-page", r.v12 = s12);
183
+ }
184
+ if (c & 1073742080) r.L0.update(v[8], d, c);
185
+ if (c !== -1 && c & 1073744321) r.L0.each(c, d);
186
+ if (r.f1 === undefined) { r.f1 = 1; const at = fillSlot(r.a4, r.e1, "", J, false, undefined, d);
187
+ if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b1 = m3(d); at.before(r.b1.n); } }
188
+ else if (r.b1 !== undefined) p3(r.b1, c, d);
189
+ };
190
+ const t0 = element.firstChild.nextSibling;
191
+ const t1 = t0.firstChild;
192
+ const t2 = t1.nextSibling.nextSibling;
193
+ const t3 = t2.nextSibling.nextSibling.nextSibling;
194
+ const t4 = t3.nextSibling.nextSibling;
195
+ const R = { n: element, a1: t1, a3: t3, v0: undefined, v1: null, v2: null, v3: null, v4: null, v5: null, v6: null, v7: null, v8: null, v9: null, v10: null, v11: null, v12: null, L0: new RangedPositionalList(t2, t2.nextSibling, m1, p1, (o) => readMember(o, "value"), "item"), a4: t4, e1: t4.nextSibling, b1: undefined, f1: undefined };
196
+ const I = { B };
197
+ const J = project(I, children, slots);
198
+ attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), undefined, undefined, I);
199
+ manageProps(I);
200
+ return element;
201
+ }
202
+ defineComponent("ui-pagination", createUiPagination, ["disabled","hasNext","hasPrevious","label","nextHref","nextLabel","page","pageLabel","pages","previousHref","previousLabel","size"]);
package/vanilla/index.js CHANGED
@@ -59,6 +59,7 @@ export * from "./UiMeter.js";
59
59
  export * from "./UiNavItem.js";
60
60
  export * from "./UiNumberInput.js";
61
61
  export * from "./UiPageHeader.js";
62
+ export * from "./UiPagination.js";
62
63
  export * from "./UiPopover.js";
63
64
  export * from "./UiRadio.js";
64
65
  export * from "./UiRadioGroup.js";
package/vue/UiButton.d.ts CHANGED
@@ -53,6 +53,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
53
53
  size: {
54
54
  type: PropType<"xs" | "sm" | "md" | "lg" | null>;
55
55
  };
56
+ square: {
57
+ type: PropType<boolean | null>;
58
+ };
56
59
  stretch: {
57
60
  type: PropType<boolean | null>;
58
61
  };
@@ -102,6 +105,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
102
105
  size: {
103
106
  type: PropType<"xs" | "sm" | "md" | "lg" | null>;
104
107
  };
108
+ square: {
109
+ type: PropType<boolean | null>;
110
+ };
105
111
  stretch: {
106
112
  type: PropType<boolean | null>;
107
113
  };
package/vue/UiButton.vue CHANGED
@@ -117,6 +117,14 @@ const propValidityContract = {
117
117
  values: ['xs', 'sm', 'md', 'lg'],
118
118
  default: 'md',
119
119
  },
120
+ square: {
121
+ type: { kind: 'terminal', name: 'boolean' },
122
+ required: false,
123
+ target: { attribute: 'square' },
124
+ description:
125
+ 'Gives short labels and icons the same square minimum footprint at each size. Longer labels grow naturally. Applies to boxed actions; link and card variants\n keep their normal layout.',
126
+ default: false,
127
+ },
120
128
  stretch: {
121
129
  type: { kind: 'terminal', name: 'boolean' },
122
130
  required: false,
@@ -174,6 +182,7 @@ const props = defineProps({
174
182
  rel: { type: null as unknown as PropType<string | null> },
175
183
  shape: { type: null as unknown as PropType<'rounded' | 'pill' | null> },
176
184
  size: { type: null as unknown as PropType<'xs' | 'sm' | 'md' | 'lg' | null> },
185
+ square: { type: null as unknown as PropType<boolean | null> },
177
186
  stretch: { type: null as unknown as PropType<boolean | null> },
178
187
  target: { type: null as unknown as PropType<string | null> },
179
188
  tone: {
@@ -200,6 +209,7 @@ const acceptedProps: Record<string, unknown> = {
200
209
  rel: null,
201
210
  shape: 'rounded',
202
211
  size: 'md',
212
+ square: false,
203
213
  stretch: false,
204
214
  target: null,
205
215
  tone: 'accent',
@@ -215,6 +225,7 @@ const inputTracking = vuePropInputs(acceptedProps, {
215
225
  preset: 'none',
216
226
  shape: 'rounded',
217
227
  size: 'md',
228
+ square: false,
218
229
  stretch: false,
219
230
  tone: 'accent',
220
231
  type: 'button',
@@ -241,6 +252,8 @@ const inputTracking = vuePropInputs(acceptedProps, {
241
252
  return checkPropInput(value, { kind: 'terminal', name: 'keyword' }, true, true)
242
253
  case 'size':
243
254
  return checkPropInput(value, { kind: 'terminal', name: 'keyword' }, true, true)
255
+ case 'square':
256
+ return checkPropInput(value, { kind: 'terminal', name: 'boolean' }, true, true)
244
257
  case 'stretch':
245
258
  return checkPropInput(value, { kind: 'terminal', name: 'boolean' }, true, true)
246
259
  case 'target':
@@ -301,6 +314,11 @@ const checkedProps = computed(() => {
301
314
  props['size'],
302
315
  props[BINDING_INPUTS_PROP],
303
316
  ) as 'xs' | 'sm' | 'md' | 'lg',
317
+ square: propInputs.value<boolean | null>(
318
+ 'square',
319
+ props['square'],
320
+ props[BINDING_INPUTS_PROP],
321
+ ) as boolean,
304
322
  stretch: propInputs.value<boolean | null>(
305
323
  'stretch',
306
324
  props['stretch'],
@@ -703,6 +721,7 @@ const hostState = computed(() =>
703
721
  checkedProps.value.size != null && `size=${encodeURIComponent(checkedProps.value.size)}`,
704
722
  checkedProps.value.shape && 'shape',
705
723
  checkedProps.value.shape != null && `shape=${encodeURIComponent(checkedProps.value.shape)}`,
724
+ checkedProps.value.square && 'square',
706
725
  checkedProps.value.loading && 'loading',
707
726
  checkedProps.value.pending && 'pending',
708
727
  ].filter(Boolean).join(' ')
@@ -739,6 +758,7 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
739
758
  'rel',
740
759
  'shape',
741
760
  'size',
761
+ 'square',
742
762
  'stretch',
743
763
  'target',
744
764
  'tone',
@@ -778,6 +798,7 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
778
798
  :data-ui-button-prop-rel="reflectedProp('rel', 'rel', checkedProps.rel, undefined, false)"
779
799
  :data-ui-button-prop-shape="reflectedProp('shape', 'shape', checkedProps.shape, undefined, false)"
780
800
  :data-ui-button-prop-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
801
+ :data-ui-button-prop-square="reflectedProp('square', 'square', checkedProps.square, undefined, false)"
781
802
  :data-ui-button-prop-stretch="reflectedProp('stretch', 'stretch', checkedProps.stretch, undefined, false)"
782
803
  :data-ui-button-prop-target="reflectedProp('target', 'target', checkedProps.target, undefined, false)"
783
804
  :data-ui-button-prop-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
@@ -822,6 +843,7 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
822
843
  :data-ui-button-prop-rel="reflectedProp('rel', 'rel', checkedProps.rel, undefined, false)"
823
844
  :data-ui-button-prop-shape="reflectedProp('shape', 'shape', checkedProps.shape, undefined, false)"
824
845
  :data-ui-button-prop-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
846
+ :data-ui-button-prop-square="reflectedProp('square', 'square', checkedProps.square, undefined, false)"
825
847
  :data-ui-button-prop-stretch="reflectedProp('stretch', 'stretch', checkedProps.stretch, undefined, false)"
826
848
  :data-ui-button-prop-target="reflectedProp('target', 'target', checkedProps.target, undefined, false)"
827
849
  :data-ui-button-prop-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
@@ -870,6 +892,7 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
870
892
  :data-ui-button-prop-rel="reflectedProp('rel', 'rel', checkedProps.rel, undefined, false)"
871
893
  :data-ui-button-prop-shape="reflectedProp('shape', 'shape', checkedProps.shape, undefined, false)"
872
894
  :data-ui-button-prop-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
895
+ :data-ui-button-prop-square="reflectedProp('square', 'square', checkedProps.square, undefined, false)"
873
896
  :data-ui-button-prop-stretch="reflectedProp('stretch', 'stretch', checkedProps.stretch, undefined, false)"
874
897
  :data-ui-button-prop-target="reflectedProp('target', 'target', checkedProps.target, undefined, false)"
875
898
  :data-ui-button-prop-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
@@ -908,6 +931,7 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
908
931
  :data-ui-button-prop-rel="reflectedProp('rel', 'rel', checkedProps.rel, undefined, false)"
909
932
  :data-ui-button-prop-shape="reflectedProp('shape', 'shape', checkedProps.shape, undefined, false)"
910
933
  :data-ui-button-prop-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
934
+ :data-ui-button-prop-square="reflectedProp('square', 'square', checkedProps.square, undefined, false)"
911
935
  :data-ui-button-prop-stretch="reflectedProp('stretch', 'stretch', checkedProps.stretch, undefined, false)"
912
936
  :data-ui-button-prop-target="reflectedProp('target', 'target', checkedProps.target, undefined, false)"
913
937
  :data-ui-button-prop-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
@@ -1007,6 +1031,8 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1007
1031
  /* A count is an adornment, not another line of label text. Keep the standard control height
1008
1032
  with enough inset for a 24px mark; large content can still grow the button naturally. */
1009
1033
 
1034
+ /* Short numeric and icon actions share a minimum box; large values remain readable. */
1035
+
1010
1036
  /* Card actions inherit Button's palette and behavior; only their shared layout changes.
1011
1037
  The icon may contain any decorative composition. Empty icons remove their column. */
1012
1038
 
@@ -1103,6 +1129,7 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1103
1129
  }
1104
1130
 
1105
1131
  :global(:scope:where([data-hn-ui-button])) {
1132
+ --_button-square-size: var(--ui-button-min-block-size, var(--ui-control-size-md));
1106
1133
  appearance: none;
1107
1134
  min-block-size: var(--ui-button-min-block-size, var(--ui-control-size-md));
1108
1135
  border-style: solid;
@@ -1163,6 +1190,7 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1163
1190
  }
1164
1191
 
1165
1192
  :global(:scope[data-ui-button-state~="size=xs"]:where([data-hn-ui-button])) {
1193
+ --_button-square-size: 1.5rem;
1166
1194
  min-block-size: 1.5rem;
1167
1195
  padding: calc(var(--ui-space-0-5) * 1.5) calc(var(--ui-space-1) * 1.25) !important;
1168
1196
  font-size: var(--ui-font-size-xs);
@@ -1173,6 +1201,7 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1173
1201
  }
1174
1202
 
1175
1203
  :global(:scope[data-ui-button-state~="size=sm"]:where([data-hn-ui-button])) {
1204
+ --_button-square-size: var(--ui-control-size-sm);
1176
1205
  min-block-size: var(--ui-control-size-sm);
1177
1206
  padding: var(--ui-control-inset-block-sm, var(--ui-space-1))
1178
1207
  var(--ui-action-inset-sm, var(--ui-space-2)) !important;
@@ -1180,11 +1209,16 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1180
1209
  }
1181
1210
 
1182
1211
  :global(:scope[data-ui-button-state~="size=lg"]:where([data-hn-ui-button])) {
1212
+ --_button-square-size: var(--ui-control-size-lg);
1183
1213
  min-block-size: var(--ui-control-size-lg);
1184
1214
  padding: var(--ui-control-inset-block-lg, var(--ui-space-3))
1185
1215
  var(--ui-action-inset-lg, var(--ui-space-4)) !important;
1186
1216
  font-size: var(--ui-font-size-md);
1187
1217
  }
1218
+ :global(:scope[data-ui-button-state~="square"]:not([data-appearance="link"], [data-appearance="card"]):where([data-hn-ui-button])) {
1219
+ min-inline-size: var(--_button-square-size);
1220
+ padding-inline: var(--ui-space-1) !important;
1221
+ }
1188
1222
  :global(:scope[data-appearance="card"]:where([data-hn-ui-button])) {
1189
1223
  display: grid !important;
1190
1224
  grid-template-columns: auto minmax(0, 1fr) auto;