@smwb/ui-solid 1.0.0 → 2.1.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.
Files changed (213) hide show
  1. package/README.md +115 -0
  2. package/dist/assets/styles/less/components/appBar/appBar.entry.css +1 -1
  3. package/dist/assets/styles/less/components/avatar/avatar.entry.css +1 -1
  4. package/dist/assets/styles/less/components/badge/badge.entry.css +1 -1
  5. package/dist/assets/styles/less/components/breadcrumbs/breadcrumbs.entry.css +1 -1
  6. package/dist/assets/styles/less/components/button/button.entry.css +1 -1
  7. package/dist/assets/styles/less/components/buttonGroup/buttonGroup.entry.css +1 -1
  8. package/dist/assets/styles/less/components/dagView/dagView.entry.css +1 -1
  9. package/dist/assets/styles/less/components/meter/meter.entry.css +1 -1
  10. package/dist/assets/styles/less/components/screenDivider/screenDivider.entry.css +1 -1
  11. package/dist/assets/styles/less/components/sheet/sheet.entry.css +1 -1
  12. package/dist/assets/styles/less/components/statusDot/statusDot.entry.css +1 -1
  13. package/dist/assets/styles/less/components/tabGroups/tabGroups.entry.css +1 -1
  14. package/dist/assets/styles/less/components/tabs/tab/tab.entry.css +1 -1
  15. package/dist/assets/styles/less/components/toggle/toggle.entry.css +1 -1
  16. package/dist/assets/styles/less/components/treeView/treeView.entry.css +1 -1
  17. package/dist/assets/styles/less/tokens.entry.css +1 -1
  18. package/dist/components/dataDisplay/avatar/avatar.d.ts +5 -2
  19. package/dist/components/dataDisplay/avatar/avatar.js +9 -9
  20. package/dist/components/dataDisplay/avatar/avatar.js.map +1 -1
  21. package/dist/components/dataDisplay/badge/badge.d.ts +2 -1
  22. package/dist/components/dataDisplay/badge/badge.js.map +1 -1
  23. package/dist/components/dataDisplay/chart/chart.d.ts +16 -8
  24. package/dist/components/dataDisplay/chart/chartFull.d.ts +14 -0
  25. package/dist/components/dataDisplay/chart/core.d.ts +19 -0
  26. package/dist/components/dataDisplay/chart/index.d.ts +1 -1
  27. package/dist/components/dataDisplay/dagView/dagView.d.ts +4 -0
  28. package/dist/components/dataDisplay/dagView/dagView.js +124 -123
  29. package/dist/components/dataDisplay/dagView/dagView.js.map +1 -1
  30. package/dist/components/dataDisplay/dagView/index.d.ts +1 -1
  31. package/dist/components/dataDisplay/meter/index.d.ts +1 -1
  32. package/dist/components/dataDisplay/meter/meter.d.ts +14 -0
  33. package/dist/components/dataDisplay/meter/meter.js +32 -30
  34. package/dist/components/dataDisplay/meter/meter.js.map +1 -1
  35. package/dist/components/dataDisplay/statusDot/index.d.ts +1 -1
  36. package/dist/components/dataDisplay/statusDot/statusDot.d.ts +10 -1
  37. package/dist/components/dataDisplay/statusDot/statusDot.js +20 -11
  38. package/dist/components/dataDisplay/statusDot/statusDot.js.map +1 -1
  39. package/dist/components/dataDisplay/treeView/treeView.d.ts +18 -2
  40. package/dist/components/dataDisplay/treeView/treeView.js +140 -121
  41. package/dist/components/dataDisplay/treeView/treeView.js.map +1 -1
  42. package/dist/components/inputs/button/button.d.ts +7 -0
  43. package/dist/components/inputs/button/button.js +57 -51
  44. package/dist/components/inputs/button/button.js.map +1 -1
  45. package/dist/components/inputs/toggle/toggle.d.ts +6 -0
  46. package/dist/components/inputs/toggle/toggle.js +23 -23
  47. package/dist/components/inputs/toggle/toggle.js.map +1 -1
  48. package/dist/components/layout/appLayout/appLayout.d.ts +6 -1
  49. package/dist/components/layout/appLayout/appLayout.js +49 -42
  50. package/dist/components/layout/appLayout/appLayout.js.map +1 -1
  51. package/dist/components/layout/screenDivider/screenDivider.d.ts +12 -0
  52. package/dist/components/layout/screenDivider/screenDivider.js +87 -46
  53. package/dist/components/layout/screenDivider/screenDivider.js.map +1 -1
  54. package/dist/components/layout/sheet/sheet.d.ts +11 -0
  55. package/dist/components/layout/sheet/sheet.js +122 -102
  56. package/dist/components/layout/sheet/sheet.js.map +1 -1
  57. package/dist/components/layout/tabGroups/index.d.ts +1 -1
  58. package/dist/components/layout/tabGroups/tabGroups.d.ts +44 -1
  59. package/dist/components/layout/tabGroups/tabGroups.js +500 -460
  60. package/dist/components/layout/tabGroups/tabGroups.js.map +1 -1
  61. package/dist/components/layout/tabGroups/tabGroupsFocus.d.ts +16 -0
  62. package/dist/components/layout/tabGroups/tabGroupsFocus.js +102 -70
  63. package/dist/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
  64. package/dist/components/navigation/appBar/appBar.d.ts +12 -0
  65. package/dist/components/navigation/appBar/appBar.js.map +1 -1
  66. package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +9 -0
  67. package/dist/components/navigation/breadcrumbs/breadcrumbs.js +47 -31
  68. package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  69. package/dist/components/navigation/tabs/tab/tab.js +71 -68
  70. package/dist/components/navigation/tabs/tab/tab.js.map +1 -1
  71. package/dist/components/navigation/tabs/tabs.d.ts +15 -1
  72. package/dist/components/navigation/tabs/tabs.js +19 -16
  73. package/dist/components/navigation/tabs/tabs.js.map +1 -1
  74. package/dist/components/navigation/tabs/tabsContext.d.ts +2 -0
  75. package/dist/components/navigation/tabs/tabsContext.js.map +1 -1
  76. package/dist/headless/components/dataDisplay/avatar/avatar.js +9 -9
  77. package/dist/headless/components/dataDisplay/avatar/avatar.js.map +1 -1
  78. package/dist/headless/components/dataDisplay/badge/badge.js.map +1 -1
  79. package/dist/headless/components/dataDisplay/dagView/dagView.js +133 -132
  80. package/dist/headless/components/dataDisplay/dagView/dagView.js.map +1 -1
  81. package/dist/headless/components/dataDisplay/meter/meter.js +32 -30
  82. package/dist/headless/components/dataDisplay/meter/meter.js.map +1 -1
  83. package/dist/headless/components/dataDisplay/statusDot/statusDot.js +19 -10
  84. package/dist/headless/components/dataDisplay/statusDot/statusDot.js.map +1 -1
  85. package/dist/headless/components/dataDisplay/treeView/treeView.js +139 -120
  86. package/dist/headless/components/dataDisplay/treeView/treeView.js.map +1 -1
  87. package/dist/headless/components/inputs/button/button.js +57 -51
  88. package/dist/headless/components/inputs/button/button.js.map +1 -1
  89. package/dist/headless/components/inputs/toggle/toggle.js +23 -23
  90. package/dist/headless/components/inputs/toggle/toggle.js.map +1 -1
  91. package/dist/headless/components/layout/appLayout/appLayout.js +52 -45
  92. package/dist/headless/components/layout/appLayout/appLayout.js.map +1 -1
  93. package/dist/headless/components/layout/screenDivider/screenDivider.js +88 -47
  94. package/dist/headless/components/layout/screenDivider/screenDivider.js.map +1 -1
  95. package/dist/headless/components/layout/sheet/sheet.js +124 -104
  96. package/dist/headless/components/layout/sheet/sheet.js.map +1 -1
  97. package/dist/headless/components/layout/tabGroups/tabGroups.js +500 -460
  98. package/dist/headless/components/layout/tabGroups/tabGroups.js.map +1 -1
  99. package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js +102 -70
  100. package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
  101. package/dist/headless/components/navigation/appBar/appBar.js.map +1 -1
  102. package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js +46 -30
  103. package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  104. package/dist/headless/components/navigation/tabs/tab/tab.js +70 -67
  105. package/dist/headless/components/navigation/tabs/tab/tab.js.map +1 -1
  106. package/dist/headless/components/navigation/tabs/tabs.js +19 -16
  107. package/dist/headless/components/navigation/tabs/tabs.js.map +1 -1
  108. package/dist/headless/components/navigation/tabs/tabsContext.js.map +1 -1
  109. package/dist/headless/primitives/publishHeaderOffset.js +19 -0
  110. package/dist/headless/primitives/publishHeaderOffset.js.map +1 -0
  111. package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx +1 -0
  112. package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
  113. package/dist/headless/source/components/dataDisplay/badge/badge.jsx.map +1 -1
  114. package/dist/headless/source/components/dataDisplay/chart/chart.jsx +14 -12
  115. package/dist/headless/source/components/dataDisplay/chart/chart.jsx.map +1 -1
  116. package/dist/headless/source/components/dataDisplay/chart/chartFull.js +12 -0
  117. package/dist/headless/source/components/dataDisplay/chart/chartFull.js.map +7 -0
  118. package/dist/headless/source/components/dataDisplay/chart/core.js +11 -0
  119. package/dist/headless/source/components/dataDisplay/chart/core.js.map +7 -0
  120. package/dist/headless/source/components/dataDisplay/chart/index.js +1 -1
  121. package/dist/headless/source/components/dataDisplay/chart/index.js.map +1 -1
  122. package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx +2 -1
  123. package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
  124. package/dist/headless/source/components/dataDisplay/dagView/index.js.map +2 -2
  125. package/dist/headless/source/components/dataDisplay/meter/index.js.map +1 -1
  126. package/dist/headless/source/components/dataDisplay/meter/meter.jsx +14 -2
  127. package/dist/headless/source/components/dataDisplay/meter/meter.jsx.map +1 -1
  128. package/dist/headless/source/components/dataDisplay/statusDot/index.js.map +1 -1
  129. package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
  130. package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
  131. package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx +16 -3
  132. package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
  133. package/dist/headless/source/components/inputs/button/button.jsx +26 -1
  134. package/dist/headless/source/components/inputs/button/button.jsx.map +1 -1
  135. package/dist/headless/source/components/inputs/toggle/toggle.jsx +9 -2
  136. package/dist/headless/source/components/inputs/toggle/toggle.jsx.map +1 -1
  137. package/dist/headless/source/components/layout/appLayout/appLayout.jsx +14 -2
  138. package/dist/headless/source/components/layout/appLayout/appLayout.jsx.map +1 -1
  139. package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx +102 -18
  140. package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
  141. package/dist/headless/source/components/layout/sheet/sheet.jsx +14 -1
  142. package/dist/headless/source/components/layout/sheet/sheet.jsx.map +1 -1
  143. package/dist/headless/source/components/layout/tabGroups/index.js.map +1 -1
  144. package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx +55 -1
  145. package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
  146. package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
  147. package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
  148. package/dist/headless/source/components/navigation/appBar/appBar.jsx.map +1 -1
  149. package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
  150. package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
  151. package/dist/headless/source/components/navigation/tabs/tab/tab.jsx +7 -1
  152. package/dist/headless/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
  153. package/dist/headless/source/components/navigation/tabs/tabs.jsx +5 -1
  154. package/dist/headless/source/components/navigation/tabs/tabs.jsx.map +1 -1
  155. package/dist/headless/source/components/navigation/tabs/tabsContext.js.map +2 -2
  156. package/dist/headless/source/index.js +8 -1
  157. package/dist/headless/source/index.js.map +2 -2
  158. package/dist/headless/source/primitives/publishHeaderOffset.js +34 -0
  159. package/dist/headless/source/primitives/publishHeaderOffset.js.map +7 -0
  160. package/dist/index.d.ts +5 -5
  161. package/dist/primitives/publishHeaderOffset.d.ts +7 -0
  162. package/dist/primitives/publishHeaderOffset.js +19 -0
  163. package/dist/primitives/publishHeaderOffset.js.map +1 -0
  164. package/dist/source/components/dataDisplay/avatar/avatar.jsx +1 -0
  165. package/dist/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
  166. package/dist/source/components/dataDisplay/badge/badge.jsx.map +1 -1
  167. package/dist/source/components/dataDisplay/chart/chart.jsx +14 -12
  168. package/dist/source/components/dataDisplay/chart/chart.jsx.map +1 -1
  169. package/dist/source/components/dataDisplay/chart/chartFull.js +12 -0
  170. package/dist/source/components/dataDisplay/chart/chartFull.js.map +7 -0
  171. package/dist/source/components/dataDisplay/chart/core.js +11 -0
  172. package/dist/source/components/dataDisplay/chart/core.js.map +7 -0
  173. package/dist/source/components/dataDisplay/chart/index.js +1 -1
  174. package/dist/source/components/dataDisplay/chart/index.js.map +1 -1
  175. package/dist/source/components/dataDisplay/dagView/dagView.jsx +2 -1
  176. package/dist/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
  177. package/dist/source/components/dataDisplay/dagView/index.js.map +2 -2
  178. package/dist/source/components/dataDisplay/meter/index.js.map +1 -1
  179. package/dist/source/components/dataDisplay/meter/meter.jsx +14 -2
  180. package/dist/source/components/dataDisplay/meter/meter.jsx.map +1 -1
  181. package/dist/source/components/dataDisplay/statusDot/index.js.map +1 -1
  182. package/dist/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
  183. package/dist/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
  184. package/dist/source/components/dataDisplay/treeView/treeView.jsx +16 -3
  185. package/dist/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
  186. package/dist/source/components/inputs/button/button.jsx +26 -1
  187. package/dist/source/components/inputs/button/button.jsx.map +1 -1
  188. package/dist/source/components/inputs/toggle/toggle.jsx +9 -2
  189. package/dist/source/components/inputs/toggle/toggle.jsx.map +1 -1
  190. package/dist/source/components/layout/appLayout/appLayout.jsx +14 -2
  191. package/dist/source/components/layout/appLayout/appLayout.jsx.map +1 -1
  192. package/dist/source/components/layout/screenDivider/screenDivider.jsx +102 -18
  193. package/dist/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
  194. package/dist/source/components/layout/sheet/sheet.jsx +14 -1
  195. package/dist/source/components/layout/sheet/sheet.jsx.map +1 -1
  196. package/dist/source/components/layout/tabGroups/index.js.map +1 -1
  197. package/dist/source/components/layout/tabGroups/tabGroups.jsx +55 -1
  198. package/dist/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
  199. package/dist/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
  200. package/dist/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
  201. package/dist/source/components/navigation/appBar/appBar.jsx.map +1 -1
  202. package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
  203. package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
  204. package/dist/source/components/navigation/tabs/tab/tab.jsx +7 -1
  205. package/dist/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
  206. package/dist/source/components/navigation/tabs/tabs.jsx +5 -1
  207. package/dist/source/components/navigation/tabs/tabs.jsx.map +1 -1
  208. package/dist/source/components/navigation/tabs/tabsContext.js.map +2 -2
  209. package/dist/source/index.js +8 -1
  210. package/dist/source/index.js.map +2 -2
  211. package/dist/source/primitives/publishHeaderOffset.js +34 -0
  212. package/dist/source/primitives/publishHeaderOffset.js.map +7 -0
  213. package/package.json +9 -3
@@ -1,32 +1,46 @@
1
- import { use as $, spread as C, mergeProps as v, insert as n, createComponent as d, template as s, effect as w, setAttribute as A, delegateEvents as B } from "solid-js/web";
1
+ import { use as w, spread as E, mergeProps as W, insert as u, createComponent as p, template as d, effect as v, setAttribute as _, delegateEvents as A } from "solid-js/web";
2
2
  import '../../../assets/styles/less/components/breadcrumbs/breadcrumbs.entry.css';import '../../../assets/styles/less/tokens.entry.css';/* empty css */
3
3
  /* empty css */
4
- import { mergeProps as E, splitProps as P, children as y, For as I, Show as L } from "solid-js";
5
- import S from "clsx";
6
- import { createControllableState as k } from "../../../primitives/createControllableState.js";
7
- import { mergeRefs as F } from "../../../primitives/mergeRefs.js";
8
- var R = /* @__PURE__ */ s("<button type=button class=smwb-breadcrumbs__expand>…"), V = /* @__PURE__ */ s("<nav><ol class=smwb-breadcrumbs__list>"), j = /* @__PURE__ */ s("<li class=smwb-breadcrumbs__item>"), q = /* @__PURE__ */ s("<li class=smwb-breadcrumbs__separator aria-hidden=true>");
9
- function N(c) {
10
- const i = E({
4
+ import { mergeProps as L, splitProps as B, children as y, For as P, Show as S, createSignal as I } from "solid-js";
5
+ import M from "clsx";
6
+ import { createControllableState as T } from "../../../primitives/createControllableState.js";
7
+ import { mergeRefs as k } from "../../../primitives/mergeRefs.js";
8
+ var F = /* @__PURE__ */ d("<li class=smwb-breadcrumbs__item>"), H = /* @__PURE__ */ d("<button type=button class=smwb-breadcrumbs__expand>…"), R = /* @__PURE__ */ d("<nav><ol class=smwb-breadcrumbs__list>"), V = /* @__PURE__ */ d("<li class=smwb-breadcrumbs__separator aria-hidden=true>");
9
+ function g(a) {
10
+ return a.scrollWidth > a.clientWidth;
11
+ }
12
+ function j(a) {
13
+ const [c, e] = I(void 0), o = (r) => {
14
+ const s = r.currentTarget, n = g(s) || Array.from(s.children).some((i) => i instanceof HTMLElement && g(i));
15
+ e(a.noWrap && n ? s.textContent ?? void 0 : void 0);
16
+ }, m = () => e(void 0);
17
+ return (() => {
18
+ var r = F();
19
+ return r.addEventListener("mouseleave", m), r.addEventListener("mouseenter", o), u(r, () => a.children), v(() => _(r, "title", a.noWrap ? c() : void 0)), r;
20
+ })();
21
+ }
22
+ function O(a) {
23
+ const c = L({
11
24
  separator: "/",
12
25
  maxItems: 8,
13
26
  itemsBeforeCollapse: 1,
14
27
  itemsAfterCollapse: 1,
15
- expandLabel: "Show path"
16
- }, c), [e, o] = P(i, ["class", "separator", "maxItems", "itemsBeforeCollapse", "itemsAfterCollapse", "expanded", "onExpand", "expandLabel", "children", "ref", "data-testid"]), [u, b] = k({
28
+ expandLabel: "Show path",
29
+ noWrap: !1
30
+ }, a), [e, o] = B(c, ["class", "separator", "maxItems", "itemsBeforeCollapse", "itemsAfterCollapse", "expanded", "onExpand", "expandLabel", "noWrap", "children", "ref", "data-testid"]), [m, r] = T({
17
31
  value: () => e.expanded,
18
32
  defaultValue: !1,
19
33
  onChange: () => e.onExpand?.()
20
- }), f = y(() => e.children), l = () => f.toArray(), h = () => !u() && l().length > e.maxItems && e.itemsBeforeCollapse + e.itemsAfterCollapse < l().length, _ = () => b(!0), m = () => {
21
- const r = l();
22
- return h() ? [...r.slice(0, e.itemsBeforeCollapse), (() => {
23
- var t = R();
24
- return t.$$click = _, w(() => A(t, "aria-label", e.expandLabel)), t;
25
- })(), ...r.slice(r.length - e.itemsAfterCollapse)] : r;
34
+ }), s = y(() => e.children), n = () => s.toArray(), i = () => !m() && n().length > e.maxItems && e.itemsBeforeCollapse + e.itemsAfterCollapse < n().length, x = () => r(!0), b = () => {
35
+ const t = n();
36
+ return i() ? [...t.slice(0, e.itemsBeforeCollapse), (() => {
37
+ var l = H();
38
+ return l.$$click = x, v(() => _(l, "aria-label", e.expandLabel)), l;
39
+ })(), ...t.slice(t.length - e.itemsAfterCollapse)] : t;
26
40
  };
27
41
  return (() => {
28
- var r = V(), t = r.firstChild, p = F(e.ref);
29
- return typeof p == "function" && $(p, r), C(r, v(o, {
42
+ var t = R(), l = t.firstChild, f = k(e.ref);
43
+ return typeof f == "function" && w(f, t), E(t, W(o, {
30
44
  get "data-testid"() {
31
45
  return e["data-testid"] ?? "breadcrumbs";
32
46
  },
@@ -34,29 +48,31 @@ function N(c) {
34
48
  return o["aria-label"] ?? "breadcrumb";
35
49
  },
36
50
  get class() {
37
- return S("smwb-breadcrumbs", e.class);
51
+ return M("smwb-breadcrumbs", e.noWrap && "smwb-breadcrumbs--no-wrap", e.class);
38
52
  }
39
- }), !1, !0), n(t, d(I, {
53
+ }), !1, !0), u(l, p(P, {
40
54
  get each() {
41
- return m();
55
+ return b();
42
56
  },
43
- children: (g, x) => [(() => {
44
- var a = j();
45
- return n(a, g), a;
46
- })(), d(L, {
57
+ children: (C, $) => [p(j, {
58
+ get noWrap() {
59
+ return e.noWrap;
60
+ },
61
+ children: C
62
+ }), p(S, {
47
63
  get when() {
48
- return x() < m().length - 1;
64
+ return $() < b().length - 1;
49
65
  },
50
66
  get children() {
51
- var a = q();
52
- return n(a, () => e.separator), a;
67
+ var h = V();
68
+ return u(h, () => e.separator), h;
53
69
  }
54
70
  })]
55
- })), r;
71
+ })), t;
56
72
  })();
57
73
  }
58
- B(["click"]);
74
+ A(["click"]);
59
75
  export {
60
- N as Breadcrumbs
76
+ O as Breadcrumbs
61
77
  };
62
78
  //# sourceMappingURL=breadcrumbs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.js","sources":["../../../../src/components/navigation/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["import { type JSX, type ParentProps, For, Show, children as resolveChildren, mergeProps, splitProps } from \"solid-js\";\nimport cn from \"clsx\";\nimport { createControllableState } from \"../../../primitives/createControllableState\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\n\nexport interface BreadcrumbsProps extends JSX.HTMLAttributes<HTMLElement> {\n /** Node placed between every crumb. */\n separator?: JSX.Element;\n /** Collapse the middle of the trail when there are more than `maxItems` crumbs. */\n maxItems?: number;\n /** How many leading crumbs to keep when collapsed. */\n itemsBeforeCollapse?: number;\n /** How many trailing crumbs to keep when collapsed. */\n itemsAfterCollapse?: number;\n /** Controlled expanded state. */\n expanded?: boolean;\n /** Fired when the user activates the expand control. */\n onExpand?: () => void;\n /** Accessible label for the expand button. */\n expandLabel?: string;\n /** Test id of the root `<nav>`; `breadcrumbs` unless given. */\n \"data-testid\"?: string | undefined;\n ref?: Ref<HTMLElement>;\n}\n\nexport function Breadcrumbs(props: ParentProps<BreadcrumbsProps>): JSX.Element {\n const merged = mergeProps(\n { separator: \"/\" as JSX.Element, maxItems: 8, itemsBeforeCollapse: 1, itemsAfterCollapse: 1, expandLabel: \"Show path\" },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"separator\",\n \"maxItems\",\n \"itemsBeforeCollapse\",\n \"itemsAfterCollapse\",\n \"expanded\",\n \"onExpand\",\n \"expandLabel\",\n \"children\",\n \"ref\",\n \"data-testid\",\n ]);\n\n const [expanded, setExpanded] = createControllableState<boolean>({\n value: () => local.expanded,\n defaultValue: false,\n onChange: () => local.onExpand?.(),\n });\n\n const resolved = resolveChildren(() => local.children);\n const crumbs = (): unknown[] => resolved.toArray();\n\n const collapsed = (): boolean =>\n !expanded() &&\n crumbs().length > local.maxItems &&\n local.itemsBeforeCollapse + local.itemsAfterCollapse < crumbs().length;\n\n const handleExpand = (): void => setExpanded(true);\n\n const rendered = (): unknown[] => {\n const all = crumbs();\n if (!collapsed()) return all;\n return [\n ...all.slice(0, local.itemsBeforeCollapse),\n (\n <button type=\"button\" class=\"smwb-breadcrumbs__expand\" aria-label={local.expandLabel} onClick={handleExpand}>\n …\n </button>\n ),\n ...all.slice(all.length - local.itemsAfterCollapse),\n ];\n };\n\n return (\n <nav\n {...rest}\n ref={mergeRefs(local.ref)}\n data-testid={local[\"data-testid\"] ?? \"breadcrumbs\"}\n // A default the caller's own replaces, to name it in their language; an\n // explicit undefined keeps it.\n aria-label={rest[\"aria-label\"] ?? \"breadcrumb\"}\n class={cn(\"smwb-breadcrumbs\", local.class)}\n >\n <ol class=\"smwb-breadcrumbs__list\">\n <For each={rendered()}>\n {(crumb, index) => (\n <>\n <li class=\"smwb-breadcrumbs__item\">{crumb as JSX.Element}</li>\n <Show when={index() < rendered().length - 1}>\n <li class=\"smwb-breadcrumbs__separator\" aria-hidden=\"true\">\n {local.separator}\n </li>\n </Show>\n </>\n )}\n </For>\n </ol>\n </nav>\n );\n}\n\nexport default Breadcrumbs;\n"],"names":["Breadcrumbs","props","merged","mergeProps","separator","maxItems","itemsBeforeCollapse","itemsAfterCollapse","expandLabel","local","rest","splitProps","expanded","setExpanded","createControllableState","value","defaultValue","onChange","onExpand","resolved","resolveChildren","children","crumbs","toArray","collapsed","length","handleExpand","rendered","all","slice","_el$","_tmpl$","$$click","_$effect","_$setAttribute","_el$2","_tmpl$2","_el$3","firstChild","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","_$insert","_$createComponent","For","each","crumb","index","_el$4","_tmpl$3","Show","when","_el$5","_tmpl$4","_$delegateEvents"],"mappings":";;;;;;;;AA2BO,SAASA,EAAYC,GAAmD;AAC7E,QAAMC,IAASC,EACb;AAAA,IAAEC,WAAW;AAAA,IAAoBC,UAAU;AAAA,IAAGC,qBAAqB;AAAA,IAAGC,oBAAoB;AAAA,IAAGC,aAAa;AAAA,EAAA,GAC1GP,CACF,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eACvCmC,EAAG,oBAAoBpC,EAAMqC,KAAK;AAAA,MAAC;AAAA,IAAA,CAAA,GAAA,IAAA,EAAA,GAAAC,EAAAV,GAAAW,EAGvCC,GAAG;AAAA,MAAA,IAACC,OAAI;AAAA,eAAEvB,EAAAA;AAAAA,MAAU;AAAA,MAAAN,UAClBA,CAAC8B,GAAOC,MAAK,EAAA,MAAA;AAAA,YAAAC,IAAAC,EAAAA;AAAAP,eAAAA,EAAAM,GAE0BF,CAAoB,GAAAE;AAAAA,MAAA,GAAA,GAAAL,EACvDO,GAAI;AAAA,QAAA,IAACC,OAAI;AAAA,iBAAEJ,EAAAA,IAAUzB,EAAAA,EAAWF,SAAS;AAAA,QAAC;AAAA,QAAA,IAAAJ,WAAA;AAAA,cAAAoC,IAAAC,EAAAA;AAAAX,iBAAAA,EAAAU,GAAA,MAEtChD,EAAML,SAAS,GAAAqD;AAAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA,CAIvB,CAAA,GAAAtB;AAAAA,EAAA,GAAA;AAKX;AAE2BwB,EAAA,CAAA,OAAA,CAAA;"}
1
+ {"version":3,"file":"breadcrumbs.js","sources":["../../../../src/components/navigation/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["import {\n type JSX,\n type ParentProps,\n For,\n Show,\n children as resolveChildren,\n createSignal,\n mergeProps,\n splitProps,\n} from \"solid-js\";\nimport cn from \"clsx\";\nimport { createControllableState } from \"../../../primitives/createControllableState\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\n\nexport interface BreadcrumbsProps extends JSX.HTMLAttributes<HTMLElement> {\n /** Node placed between every crumb. */\n separator?: JSX.Element;\n /** Collapse the middle of the trail when there are more than `maxItems` crumbs. */\n maxItems?: number;\n /** How many leading crumbs to keep when collapsed. */\n itemsBeforeCollapse?: number;\n /** How many trailing crumbs to keep when collapsed. */\n itemsAfterCollapse?: number;\n /** Controlled expanded state. */\n expanded?: boolean;\n /** Fired when the user activates the expand control. */\n onExpand?: () => void;\n /** Accessible label for the expand button. */\n expandLabel?: string;\n /**\n * Keep the trail on one line: the crumbs do not wrap, they shrink and cut their text with an ellipsis, the last one\n * giving way last, and a cut crumb shows its full text as a `title` on hover. Plain text and a block child (a heading,\n * `Typography`) are cut with an ellipsis; a crumb laid out as a row (an icon with a label, say) is clipped as far as\n * its own layout allows. A leading crumb is never narrower than `@breadcrumbsLeadingMinWidth`, so a one- or\n * two-letter one takes that width even when everything fits, and the last one is never narrower than\n * `@breadcrumbsLastMinWidth`: in a box smaller than those floors the trail runs past it instead of shrinking further.\n */\n noWrap?: boolean;\n /** Test id of the root `<nav>`; `breadcrumbs` unless given. */\n \"data-testid\"?: string | undefined;\n ref?: Ref<HTMLElement>;\n}\n\n/** A box whose content runs past it: the crumb itself, or the block it holds (a heading cuts itself). */\nfunction isCut(element: HTMLElement): boolean {\n return element.scrollWidth > element.clientWidth;\n}\n\n/** One `<li>` of the trail; with `noWrap` it names itself by its full text while that text is cut. */\nfunction Crumb(props: ParentProps<{ noWrap: boolean }>): JSX.Element {\n const [title, setTitle] = createSignal<string | undefined>(undefined);\n\n // Measured on every entry: the width the crumb has changes with its container.\n const handleMouseEnter: JSX.EventHandler<HTMLLIElement, MouseEvent> = (event) => {\n const item = event.currentTarget;\n const cut = isCut(item) || Array.from(item.children).some((child) => child instanceof HTMLElement && isCut(child));\n setTitle(props.noWrap && cut ? (item.textContent ?? undefined) : undefined);\n };\n // The title is for the pointer that is over the crumb: it does not outlive it.\n const handleMouseLeave = (): void => setTitle(undefined);\n\n return (\n <li\n class=\"smwb-breadcrumbs__item\"\n title={props.noWrap ? title() : undefined}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {props.children}\n </li>\n );\n}\n\nexport function Breadcrumbs(props: ParentProps<BreadcrumbsProps>): JSX.Element {\n const merged = mergeProps(\n {\n separator: \"/\" as JSX.Element,\n maxItems: 8,\n itemsBeforeCollapse: 1,\n itemsAfterCollapse: 1,\n expandLabel: \"Show path\",\n noWrap: false,\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"separator\",\n \"maxItems\",\n \"itemsBeforeCollapse\",\n \"itemsAfterCollapse\",\n \"expanded\",\n \"onExpand\",\n \"expandLabel\",\n \"noWrap\",\n \"children\",\n \"ref\",\n \"data-testid\",\n ]);\n\n const [expanded, setExpanded] = createControllableState<boolean>({\n value: () => local.expanded,\n defaultValue: false,\n onChange: () => local.onExpand?.(),\n });\n\n const resolved = resolveChildren(() => local.children);\n const crumbs = (): unknown[] => resolved.toArray();\n\n const collapsed = (): boolean =>\n !expanded() &&\n crumbs().length > local.maxItems &&\n local.itemsBeforeCollapse + local.itemsAfterCollapse < crumbs().length;\n\n const handleExpand = (): void => setExpanded(true);\n\n const rendered = (): unknown[] => {\n const all = crumbs();\n if (!collapsed()) return all;\n return [\n ...all.slice(0, local.itemsBeforeCollapse),\n (\n <button type=\"button\" class=\"smwb-breadcrumbs__expand\" aria-label={local.expandLabel} onClick={handleExpand}>\n …\n </button>\n ),\n ...all.slice(all.length - local.itemsAfterCollapse),\n ];\n };\n\n return (\n <nav\n {...rest}\n ref={mergeRefs(local.ref)}\n data-testid={local[\"data-testid\"] ?? \"breadcrumbs\"}\n // A default the caller's own replaces, to name it in their language; an\n // explicit undefined keeps it.\n aria-label={rest[\"aria-label\"] ?? \"breadcrumb\"}\n class={cn(\"smwb-breadcrumbs\", local.noWrap && \"smwb-breadcrumbs--no-wrap\", local.class)}\n >\n <ol class=\"smwb-breadcrumbs__list\">\n <For each={rendered()}>\n {(crumb, index) => (\n <>\n <Crumb noWrap={local.noWrap}>{crumb as JSX.Element}</Crumb>\n <Show when={index() < rendered().length - 1}>\n <li class=\"smwb-breadcrumbs__separator\" aria-hidden=\"true\">\n {local.separator}\n </li>\n </Show>\n </>\n )}\n </For>\n </ol>\n </nav>\n );\n}\n\nexport default Breadcrumbs;\n"],"names":["isCut","element","scrollWidth","clientWidth","Crumb","props","title","setTitle","createSignal","undefined","handleMouseEnter","event","item","currentTarget","cut","Array","from","children","some","child","HTMLElement","noWrap","textContent","handleMouseLeave","_el$","_tmpl$","addEventListener","_$insert","_$effect","_$setAttribute","Breadcrumbs","merged","mergeProps","separator","maxItems","itemsBeforeCollapse","itemsAfterCollapse","expandLabel","local","rest","splitProps","expanded","setExpanded","createControllableState","value","defaultValue","onChange","onExpand","resolved","resolveChildren","crumbs","toArray","collapsed","length","handleExpand","rendered","all","slice","_el$2","_tmpl$2","$$click","_el$3","_tmpl$3","_el$4","firstChild","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","_$createComponent","For","each","crumb","index","Show","when","_el$5","_tmpl$4","_$delegateEvents"],"mappings":";;;;;;;;AA8CA,SAASA,EAAMC,GAA+B;AAC5C,SAAOA,EAAQC,cAAcD,EAAQE;AACvC;AAGA,SAASC,EAAMC,GAAsD;AACnE,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAiCC,MAAS,GAG9DC,IAAiEC,CAAAA,MAAU;AAC/E,UAAMC,IAAOD,EAAME,eACbC,IAAMd,EAAMY,CAAI,KAAKG,MAAMC,KAAKJ,EAAKK,QAAQ,EAAEC,KAAMC,CAAAA,MAAUA,aAAiBC,eAAepB,EAAMmB,CAAK,CAAC;AACjHZ,IAAAA,EAASF,EAAMgB,UAAUP,IAAOF,EAAKU,eAAeb,SAAaA,MAAS;AAAA,EAC5E,GAEMc,IAAmBA,MAAYhB,EAASE,MAAS;AAEvD,UAAA,MAAA;AAAA,QAAAe,IAAAC,EAAAA;AAAAD,WAAAA,EAAAE,iBAAA,cAKkBH,CAAgB,GAAAC,EAAAE,iBAAA,cADhBhB,CAAgB,GAAAiB,EAAAH,GAAA,MAG7BnB,EAAMY,QAAQ,GAAAW,EAAA,MAAAC,EAAAL,GAAA,SAJRnB,EAAMgB,SAASf,MAAUG,MAAS,CAAA,GAAAe;AAAAA,EAAA,GAAA;AAO/C;AAEO,SAASM,EAAYzB,GAAmD;AAC7E,QAAM0B,IAAS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,IAAA,gBAAA;AAAA,eAEKD,EAAM,aAAa,KAAK;AAAA,MAAa;AAAA,MAAA,IAAA,eAAA;AAAA,eAGtCC,EAAK,YAAY,KAAK;AAAA,MAAY;AAAA,MAAA,IAAA,QAAA;AAAA,eACvCgC,EAAG,oBAAoBjC,EAAMjB,UAAU,6BAA6BiB,EAAMkC,KAAK;AAAA,MAAC;AAAA,IAAA,CAAA,GAAA,IAAA,EAAA,GAAA7C,EAAAoC,GAAAU,EAGpFC,GAAG;AAAA,MAAA,IAACC,OAAI;AAAA,eAAEpB,EAAAA;AAAAA,MAAU;AAAA,MAAAtC,UAClBA,CAAC2D,GAAOC,MAAK,CAAAJ,EAETrE,GAAK;AAAA,QAAA,IAACiB,SAAM;AAAA,iBAAEiB,EAAMjB;AAAAA,QAAM;AAAA,QAAAJ,UAAG2D;AAAAA,MAAAA,CAAoB,GAAAH,EACjDK,GAAI;AAAA,QAAA,IAACC,OAAI;AAAA,iBAAEF,EAAAA,IAAUtB,EAAAA,EAAWF,SAAS;AAAA,QAAC;AAAA,QAAA,IAAApC,WAAA;AAAA,cAAA+D,IAAAC,EAAAA;AAAAtD,iBAAAA,EAAAqD,GAAA,MAEtC1C,EAAML,SAAS,GAAA+C;AAAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA,CAIvB,CAAA,GAAAnB;AAAAA,EAAA,GAAA;AAKX;AAE2BqB,EAAA,CAAA,OAAA,CAAA;"}
@@ -1,17 +1,17 @@
1
- import { createComponent as i, insert as n, effect as A, setAttribute as P, className as z, template as c, Dynamic as H, mergeProps as U, use as R, memo as k, delegateEvents as J } from "solid-js/web";
1
+ import { createComponent as n, insert as i, effect as v, setAttribute as _, className as H, template as c, Dynamic as U, mergeProps as J, use as P, memo as D, delegateEvents as Q } from "solid-js/web";
2
2
  import '../../../../assets/styles/less/components/tabs/tab/tab.entry.css';import '../../../../assets/styles/less/tokens.entry.css';/* empty css */
3
3
  /* empty css */
4
- import { createSignal as Q, mergeProps as V, splitProps as X, children as _, Show as u } from "solid-js";
5
- import T from "clsx";
6
- import { useTabsContext as Y } from "../tabsContext.js";
4
+ import { createSignal as V, mergeProps as X, splitProps as Y, children as C, Show as u } from "solid-js";
5
+ import R from "clsx";
6
+ import { useTabsContext as Z } from "../tabsContext.js";
7
7
  import { mergeRefs as B } from "../../../../primitives/mergeRefs.js";
8
8
  import { callHandler as p } from "../../../../primitives/callHandler.js";
9
- import { Icon as Z } from "../../../base/icon/icon.js";
10
- import { Ripple as ee } from "../../../base/ripple/ripple.js";
11
- var te = /* @__PURE__ */ c("<span class=smwb-tab__icon aria-hidden=true>"), oe = /* @__PURE__ */ c("<span class=smwb-tab__text-label>"), re = /* @__PURE__ */ c("<span class=smwb-tab__content>"), ae = /* @__PURE__ */ c("<span class=smwb-tab__actions>"), le = /* @__PURE__ */ c("<button type=button class=smwb-tab__close tabindex=-1>"), ne = /* @__PURE__ */ c("<div>");
12
- const ie = (a) => a.button !== 0 || a.ctrlKey || a.metaKey || a.shiftKey || a.altKey, se = (a) => a.ctrlKey || a.metaKey || a.altKey || a.shiftKey, ce = 'button:not(:disabled), a[href], [role="button"]:not([aria-disabled="true"]), [tabindex]', de = '[role^="menuitem"]:not([aria-disabled="true"])', be = (a) => {
9
+ import { Icon as ee } from "../../../base/icon/icon.js";
10
+ import { Ripple as te } from "../../../base/ripple/ripple.js";
11
+ var oe = /* @__PURE__ */ c("<span class=smwb-tab__icon aria-hidden=true>"), re = /* @__PURE__ */ c("<span class=smwb-tab__text-label>"), ae = /* @__PURE__ */ c("<span class=smwb-tab__content>"), le = /* @__PURE__ */ c("<span class=smwb-tab__actions>"), ie = /* @__PURE__ */ c("<button type=button class=smwb-tab__close tabindex=-1>"), ne = /* @__PURE__ */ c("<div>");
12
+ const se = (a) => a.button !== 0 || a.ctrlKey || a.metaKey || a.shiftKey || a.altKey, ce = (a) => a.ctrlKey || a.metaKey || a.altKey || a.shiftKey, de = 'button:not(:disabled), a[href], [role="button"]:not([aria-disabled="true"]), [tabindex]', be = '[role^="menuitem"]:not([aria-disabled="true"])', ue = (a) => {
13
13
  for (const l of a.getAttribute("aria-controls")?.split(/\s+/) ?? []) {
14
- const f = l ? a.ownerDocument.getElementById(l)?.querySelector(de) : null;
14
+ const f = l ? a.ownerDocument.getElementById(l)?.querySelector(be) : null;
15
15
  if (f) {
16
16
  f.focus({
17
17
  preventScroll: !0
@@ -20,12 +20,12 @@ const ie = (a) => a.button !== 0 || a.ctrlKey || a.metaKey || a.shiftKey || a.al
20
20
  }
21
21
  }
22
22
  };
23
- function ve(a) {
24
- const l = Y(), [f, I] = Q(), E = V({
23
+ function De(a) {
24
+ const l = Z(), [f, I] = V(), E = X({
25
25
  isActive: !1,
26
26
  stacked: !1,
27
27
  closeLabel: "Close tab"
28
- }, a), [t, q] = X(E, [
28
+ }, a), [t, q] = Y(E, [
29
29
  "class",
30
30
  "label",
31
31
  "isActive",
@@ -58,37 +58,40 @@ function ve(a) {
58
58
  disabled: () => !!t.disabled || a["aria-disabled"] === !0 || a["aria-disabled"] === "true",
59
59
  closable: () => !!t.closable,
60
60
  requestClose: (e) => d(e, "key")
61
- }) : () => -1, v = _(() => t.icon), D = _(() => t.label), F = {
61
+ }) : () => -1, S = C(() => t.icon), h = C(() => t.label), F = () => {
62
+ const e = h();
63
+ return l?.fit?.() && a.title === void 0 && typeof e == "string" && e !== "" ? e : void 0;
64
+ }, L = {
62
65
  close: (e) => d(e, "actions")
63
- }, h = _(() => {
66
+ }, y = C(() => {
64
67
  const e = t.actions;
65
- return typeof e == "function" ? e(F) : e;
66
- }), y = () => h.toArray().length > 0;
67
- let C, w;
68
- const m = () => l ? l.value() === s() : t.isActive, g = () => t.tag ?? (t.href !== void 0 ? "a" : "button"), S = () => !!t.disabled && g() !== "button", L = (e) => {
69
- if (S()) {
68
+ return typeof e == "function" ? e(L) : e;
69
+ }), w = () => y.toArray().length > 0;
70
+ let $, k;
71
+ const m = () => l ? l.value() === s() : t.isActive, g = () => t.tag ?? (t.href !== void 0 ? "a" : "button"), x = () => !!t.disabled && g() !== "button", N = (e) => {
72
+ if (x()) {
70
73
  e.preventDefault();
71
74
  return;
72
75
  }
73
- p(t.onClick, e), !(t.href !== void 0 && ie(e)) && l?.onChange(e, s());
76
+ p(t.onClick, e), !(t.href !== void 0 && se(e)) && l?.onChange(e, s());
74
77
  }, d = (e, o) => {
75
78
  l?.closing(s(), o), t.onClose?.(e, o);
76
- }, N = (e) => {
79
+ }, G = (e) => {
77
80
  if (p(t.onKeyDown, e), !(t.disabled || e.defaultPrevented || e.target !== e.currentTarget)) {
78
81
  if (g() !== "button" && e.key === " ")
79
82
  e.preventDefault(), e.currentTarget.click();
80
- else if (t.closable && (e.key === "Delete" || e.key === "Backspace") && !se(e))
83
+ else if (t.closable && (e.key === "Delete" || e.key === "Backspace") && !ce(e))
81
84
  e.preventDefault(), d(e, "key");
82
- else if (y() && (e.key === "ContextMenu" || e.key === "F10" && e.shiftKey)) {
83
- const o = w?.querySelector(ce);
84
- o && (e.preventDefault(), o.focus(), o.getAttribute("aria-expanded") !== "true" && o.click(), be(o));
85
+ else if (w() && (e.key === "ContextMenu" || e.key === "F10" && e.shiftKey)) {
86
+ const o = k?.querySelector(de);
87
+ o && (e.preventDefault(), o.focus(), o.getAttribute("aria-expanded") !== "true" && o.click(), ue(o));
85
88
  }
86
89
  }
87
- }, G = (e) => {
88
- p(t.onPointerDown, e), C?.onRipple(e);
89
90
  }, O = (e) => {
91
+ p(t.onPointerDown, e), $?.onRipple(e);
92
+ }, W = (e) => {
90
93
  p(t.onMouseDown, e), e.button === 1 && t.closable && !t.disabled && (e.preventDefault(), d(e, "middleClick"));
91
- }, W = () => l ? l.tabStop(s()) : t.tabStop ?? m(), j = () => [a["aria-keyshortcuts"], !t.disabled && t.closable ? "Delete Backspace" : void 0, !t.disabled && y() ? "Shift+F10 ContextMenu" : void 0, !t.disabled && t.closable ? "Meta+W Control+W" : void 0, t.disabled ? void 0 : "Meta+Shift+[ Control+Shift+[ Meta+Shift+] Control+Shift+]"].filter(Boolean).join(" ") || void 0, $ = () => t.closable !== void 0 || h() !== void 0, K = () => l?.reorderable() && !t.disabled && a["aria-disabled"] !== !0 && a["aria-disabled"] !== "true" ? !0 : void 0, M = () => i(H, U({
94
+ }, j = () => l ? l.tabStop(s()) : t.tabStop ?? m(), z = () => [a["aria-keyshortcuts"], !t.disabled && t.closable ? "Delete Backspace" : void 0, !t.disabled && w() ? "Shift+F10 ContextMenu" : void 0, !t.disabled && t.closable ? "Meta+W Control+W" : void 0, t.disabled ? void 0 : "Meta+Shift+[ Control+Shift+[ Meta+Shift+] Control+Shift+]"].filter(Boolean).join(" ") || void 0, K = () => t.closable !== void 0 || y() !== void 0, M = () => l?.reorderable() && !t.disabled && a["aria-disabled"] !== !0 && a["aria-disabled"] !== "true" ? !0 : void 0, A = () => n(U, J({
92
95
  get component() {
93
96
  return g();
94
97
  }
@@ -98,7 +101,7 @@ function ve(a) {
98
101
  typeof o == "function" && o(e);
99
102
  },
100
103
  get class() {
101
- return T("smwb-tab", t.class, {
104
+ return R("smwb-tab", t.class, {
102
105
  "smwb-tab--active": m(),
103
106
  "smwb-tab--stacked": t.stacked,
104
107
  "smwb-tab--disabled": t.disabled
@@ -111,15 +114,15 @@ function ve(a) {
111
114
  return t["aria-controls"] ?? (l?.hasPanels() ? l.panelId(s()) : void 0);
112
115
  },
113
116
  get href() {
114
- return k(() => !!S())() ? void 0 : t.href;
117
+ return D(() => !!x())() ? void 0 : t.href;
115
118
  },
116
119
  get draggable() {
117
- return k(() => !!$())() ? void 0 : K();
120
+ return D(() => !!K())() ? void 0 : M();
118
121
  },
119
- onClick: L,
120
- onKeyDown: N,
121
- onPointerDown: G,
122
- onMouseDown: O,
122
+ onClick: N,
123
+ onKeyDown: G,
124
+ onPointerDown: O,
125
+ onMouseDown: W,
123
126
  role: "tab",
124
127
  get "aria-selected"() {
125
128
  return m();
@@ -128,82 +131,82 @@ function ve(a) {
128
131
  return t.disabled || void 0;
129
132
  },
130
133
  get "aria-keyshortcuts"() {
131
- return j();
134
+ return z();
132
135
  },
133
136
  get tabindex() {
134
- return W() ? 0 : -1;
137
+ return j() ? 0 : -1;
135
138
  },
136
139
  get disabled() {
137
- return k(() => g() === "button")() ? t.disabled : void 0;
140
+ return D(() => g() === "button")() ? t.disabled : void 0;
138
141
  },
139
142
  get children() {
140
143
  return [(() => {
141
- var e = re(), o = B(t.contentRef);
142
- return typeof o == "function" && R(o, e), n(e, i(u, {
144
+ var e = ae(), o = B(t.contentRef);
145
+ return typeof o == "function" && P(o, e), i(e, n(u, {
143
146
  get when() {
144
- return v();
147
+ return S();
145
148
  },
146
149
  get children() {
147
- var r = te();
148
- return n(r, v), r;
150
+ var r = oe();
151
+ return i(r, S), r;
149
152
  }
150
- }), null), n(e, i(u, {
153
+ }), null), i(e, n(u, {
151
154
  get when() {
152
- return D();
155
+ return h();
153
156
  },
154
157
  get children() {
155
- var r = oe();
156
- return n(r, D), r;
158
+ var r = re();
159
+ return i(r, h), v(() => _(r, "title", F())), r;
157
160
  }
158
161
  }), null), e;
159
- })(), i(ee, {
160
- actionRef: (e) => C = e,
162
+ })(), n(te, {
163
+ actionRef: (e) => $ = e,
161
164
  classes: {
162
165
  child: "tab__ripple-child"
163
166
  }
164
167
  })];
165
168
  }
166
169
  }));
167
- return i(u, {
170
+ return n(u, {
168
171
  get when() {
169
- return $();
172
+ return K();
170
173
  },
171
174
  get fallback() {
172
- return M();
175
+ return A();
173
176
  },
174
177
  get children() {
175
178
  var e = ne();
176
- return n(e, M, null), n(e, i(u, {
179
+ return i(e, A, null), i(e, n(u, {
177
180
  get when() {
178
- return y();
181
+ return w();
179
182
  },
180
183
  get children() {
181
- var o = ae(), r = w;
182
- return typeof r == "function" ? R(r, o) : w = o, n(o, h), o;
184
+ var o = le(), r = k;
185
+ return typeof r == "function" ? P(r, o) : k = o, i(o, y), o;
183
186
  }
184
- }), null), n(e, i(u, {
187
+ }), null), i(e, n(u, {
185
188
  get when() {
186
189
  return t.closable;
187
190
  },
188
191
  get children() {
189
- var o = le();
190
- return o.$$click = (r) => d(r, "button"), o.$$mousedown = (r) => r.preventDefault(), n(o, i(Z, {
192
+ var o = ie();
193
+ return o.$$click = (r) => d(r, "button"), o.$$mousedown = (r) => r.preventDefault(), i(o, n(ee, {
191
194
  name: "close",
192
195
  size: 16
193
- })), A((r) => {
194
- var b = t.closeLabel, x = !!t.disabled;
195
- return b !== r.e && P(o, "aria-label", r.e = b), x !== r.t && (o.disabled = r.t = x), r;
196
+ })), v((r) => {
197
+ var b = t.closeLabel, T = !!t.disabled;
198
+ return b !== r.e && _(o, "aria-label", r.e = b), T !== r.t && (o.disabled = r.t = T), r;
196
199
  }, {
197
200
  e: void 0,
198
201
  t: void 0
199
202
  }), o;
200
203
  }
201
- }), null), A((o) => {
202
- var r = T("smwb-tab-item", {
204
+ }), null), v((o) => {
205
+ var r = R("smwb-tab-item", {
203
206
  "smwb-tab-item--active": m(),
204
207
  "smwb-tab-item--disabled": t.disabled
205
- }), b = K();
206
- return r !== o.e && z(e, o.e = r), b !== o.t && P(e, "draggable", o.t = b), o;
208
+ }), b = M();
209
+ return r !== o.e && H(e, o.e = r), b !== o.t && _(e, "draggable", o.t = b), o;
207
210
  }, {
208
211
  e: void 0,
209
212
  t: void 0
@@ -211,8 +214,8 @@ function ve(a) {
211
214
  }
212
215
  });
213
216
  }
214
- J(["mousedown", "click"]);
217
+ Q(["mousedown", "click"]);
215
218
  export {
216
- ve as Tab
219
+ De as Tab
217
220
  };
218
221
  //# sourceMappingURL=tab.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tab.js","sources":["../../../../../src/components/navigation/tabs/tab/tab.tsx"],"sourcesContent":["import { type JSX, type ParentProps, Show, children, createSignal, mergeProps, splitProps } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport cn from \"clsx\";\nimport { Ripple, type RippleActionsRef } from \"../../../base/ripple\";\nimport { Icon } from \"../../../base/icon\";\nimport { useTabsContext, type TabCloseReason } from \"../tabsContext\";\nimport { mergeRefs, type Ref } from \"../../../../primitives/mergeRefs\";\nimport { callHandler } from \"../../../../primitives/callHandler\";\n\nexport type { TabCloseReason };\n\n/** What a function given as `actions` receives. */\nexport interface TabActionsApi {\n /**\n * Ask for the tab to close, as its close button does: `onClose` is called with this event and the\n * reason \"actions\", and `Tabs` moves focus on to the neighbour once the tab goes, even though focus\n * is in a menu drawn outside the row. Call it from the item that closes the tab (\"Terminate\"), with\n * that item's event. It works on a tab that is not `closable`.\n */\n close: (event: Event) => void;\n}\n\n// `onClose` is the close button's, not the element's `close` event handler.\nexport interface TabProps extends Omit<JSX.HTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, \"onClose\"> {\n label?: JSX.Element;\n isActive?: boolean;\n /**\n * Whether the tab is the one in the page's Tab order (`tabindex` 0, the others -1). `Tabs` sets\n * it: the focused tab while focus is in the row, the selected one otherwise. On its own a tab\n * is the stop while `isActive`.\n */\n tabStop?: boolean;\n contentRef?: Ref<HTMLSpanElement>;\n /**\n * A decorative status marker drawn left of the label (a running/done/failed icon). Its\n * wrapper renders `aria-hidden=\"true\"`, so the tab's accessible name stays the label\n * alone: the icon is not announced on top of it. To have the status read out, put it\n * in the `label` itself.\n */\n icon?: JSX.Element;\n stacked?: boolean;\n /** The element to render. A tab with an `href` is an `a` unless you say otherwise. */\n tag?: string;\n /**\n * Navigation mode: where the tab goes. The tab is then a real link (`<a href role=\"tab\">`, with\n * no `target`: a tab never opens another window), so it opens in place and middle click, copy\n * link and the like work. A router takes over the plain click in `onClick` with\n * `event.preventDefault()`; `Tabs` still calls `onChange` for it. A modified or non-primary click\n * (Ctrl, Meta, Shift or Alt held, or a button other than the main one) is the browser's, as\n * \"open in a new tab\": the router must let it through, and `Tabs` does not call `onChange`.\n * The one exception is a middle press on a `closable` tab: it closes the tab instead, as in an\n * editor, and its default is prevented so nothing opens.\n */\n href?: string;\n disabled?: boolean;\n /**\n * Draw a close button after the tab, and let Delete or Backspace on the focused tab close it too\n * (Backspace because a Mac has no Delete key); the tab lists them in `aria-keyshortcuts`. A\n * middle click on the tab closes it as well (`reason` \"middleClick\"): the browser's own\n * middle-click action (autoscroll, opening a link tab in a new window) is suppressed, and the\n * click never selects. The tab does not close itself: `onClose` asks for it and the owner\n * removes the `Tab`. The button is a sibling of the tab, not inside its `role=\"tab\"`, so the\n * tab's accessible name is its label alone.\n * It is out of the Tab order (`tabindex` -1), so the row keeps one tab stop, and a press on it takes\n * no focus and never selects the tab. When the tab that has focus closes, `Tabs` moves focus to the\n * tab that takes its place (the previous one if it was last), skipping disabled tabs. A disabled tab\n * has a disabled button.\n *\n * The button stays in the accessibility tree, named by `closeLabel`: it is how a screen reader user\n * who cannot press Delete, as on a touch screen, closes the tab. It sits in the tab list beside its\n * tab, though, and ARIA 1.2 lets a `tablist` own only `tab`s: a linter that applies that strictly\n * (axe `aria-required-children`) can flag the button, and whatever `actions` holds.\n *\n * To switch it off on a tab, pass `false` rather than leaving it out: a tab given `closable` or\n * `actions` is wrapped in an item with them, a tab given neither is not, and moving between the two\n * recreates the tab and drops its focus.\n */\n closable?: boolean;\n /**\n * Asks for the tab to close, and receives what asked for it: the close button's click (`reason`\n * \"button\"), the key press of Delete or Backspace on the tab (`reason` \"key\", its default is\n * prevented), the middle press on the tab (`reason` \"middleClick\", its default is prevented too),\n * or the event passed to `close` by the tab's `actions` (`reason` \"actions\"). The owner removes\n * the `Tab`.\n */\n onClose?: (event: Event, reason: TabCloseReason) => void;\n /** Accessible label of the close button. English by default; set it to localise, or to name the tab (\"Close Terminal 1\"). */\n closeLabel?: string;\n /**\n * Content after the tab, before the close button: a trigger with a `Menu` (\"Rename\", \"Terminate\"),\n * or any control. Give a function to get `{ close }` (see `TabActionsApi`); it is called once.\n * Like the close button the content is a sibling of the tab, so it is not part of the tab's name;\n * the tab's own `ref`, `class` and handlers stay on the `role=\"tab\"` element. It stays in the\n * accessibility tree as written, inside the tab list (see `closable`).\n *\n * The row has one tab stop, so give the trigger `tabindex={-1}`. Shift+F10 or the Menu key on the\n * focused tab, which the tab lists in `aria-keyshortcuts`, focuses the first control in `actions`\n * and clicks it, unless that control says `aria-expanded=\"true\"` (it is already open). If the\n * control names its popup in `aria-controls`, the first enabled `menuitem` in that element then\n * takes focus, as the WAI-ARIA menu button pattern asks: ArrowDown moves on, Enter chooses, and\n * Escape hands focus back to the trigger. Without `aria-controls` focus stays on the trigger.\n *\n * The row clips what overflows it: draw the menu in a `Portal`, anchored to the trigger and with\n * the `id` the trigger names. A choice that removes the tab (\"Terminate\") should call `close` with\n * its event, so that `onClose` removes the tab and `Tabs` moves focus on to the neighbour; a tab\n * removed some other way leaves focus on the page.\n */\n actions?: JSX.Element | ((api: TabActionsApi) => JSX.Element);\n ref?: Ref<HTMLButtonElement | HTMLAnchorElement>;\n}\n\n/** A click that asks the browser for something else than \"go here\": a new tab, a new window, a download. */\nconst isModifiedClick = (event: MouseEvent): boolean =>\n event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;\n\nconst hasModifier = (event: KeyboardEvent): boolean => event.ctrlKey || event.metaKey || event.altKey || event.shiftKey;\n\n/** What the Menu key and Shift+F10 stand for: the actions' trigger. */\nconst ACTIONS_TRIGGER = 'button:not(:disabled), a[href], [role=\"button\"]:not([aria-disabled=\"true\"]), [tabindex]';\n\n/** The item of an opened menu that takes focus first. */\nconst FIRST_MENU_ITEM = '[role^=\"menuitem\"]:not([aria-disabled=\"true\"])';\n\n/** Focus the first item of the popup `trigger` names in `aria-controls`, if it is there. */\nconst focusPopupOf = (trigger: HTMLElement): void => {\n for (const id of trigger.getAttribute(\"aria-controls\")?.split(/\\s+/) ?? []) {\n const item = id ? trigger.ownerDocument.getElementById(id)?.querySelector<HTMLElement>(FIRST_MENU_ITEM) : null;\n if (item) {\n // The menu may not be placed yet: a scroll to it would jump to the corner it starts in.\n item.focus({ preventScroll: true });\n return;\n }\n }\n};\n\nexport function Tab(props: ParentProps<TabProps>): JSX.Element {\n const ctx = useTabsContext();\n const [root, setRoot] = createSignal<HTMLButtonElement | HTMLAnchorElement>();\n const merged = mergeProps({ isActive: false, stacked: false, closeLabel: \"Close tab\" }, props);\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"label\",\n \"isActive\",\n \"contentRef\",\n \"icon\",\n \"stacked\",\n \"tag\",\n \"href\",\n \"tabStop\",\n \"disabled\",\n // `Tabs` owns this: it is the item that drags, not the tab. The caller's value\n // is dropped, as in the React `Tab`.\n \"draggable\",\n \"closable\",\n \"onClose\",\n \"closeLabel\",\n \"actions\",\n \"id\",\n \"aria-controls\",\n // A tab opens in place: a caller's target is dropped, not passed on.\n \"target\" as keyof TabProps,\n \"onClick\",\n \"onKeyDown\",\n \"ref\",\n // The tab sets this on its root too; its own handler calls the caller's first.\n \"onPointerDown\",\n \"onMouseDown\",\n ]);\n\n // The tab's position in the tab list: it follows the tab when tabs around it\n // are added, removed or reordered.\n const index = ctx\n ? ctx.registerTab(root, {\n id: () => local.id,\n disabled: () =>\n Boolean(local.disabled) || props[\"aria-disabled\"] === true || props[\"aria-disabled\"] === \"true\",\n closable: () => Boolean(local.closable),\n requestClose: (event) => close(event, \"key\"),\n })\n : () => -1;\n\n // Read the icon and the label once: markup passed as a prop is created anew on\n // every read, and during hydration the copy made for the <Show> test has no\n // server DOM node to adopt (\"Unable to find DOM nodes for hydration key\").\n const icon = children(() => local.icon);\n const label = children(() => local.label);\n // The actions are drawn whenever they are given, so reading them here, once, is safe. A function\n // is the tab's to call, with its api: `children` would call it with nothing.\n const actionsApi: TabActionsApi = { close: (event) => close(event, \"actions\") };\n const actions = children(() => {\n const given = local.actions;\n return typeof given === \"function\" ? (given as (api: TabActionsApi) => JSX.Element)(actionsApi) : given;\n });\n const hasActions = (): boolean => actions.toArray().length > 0;\n\n let rippleActions: RippleActionsRef | undefined;\n let actionsEl: HTMLSpanElement | undefined;\n\n const active = (): boolean => (ctx ? ctx.value() === index() : local.isActive);\n\n const tag = (): string => local.tag ?? (local.href !== undefined ? \"a\" : \"button\");\n // Anything but a button is not disabled by the attribute: its clicks are swallowed here.\n const inert = (): boolean => Boolean(local.disabled) && tag() !== \"button\";\n\n const onClick: JSX.EventHandler<HTMLButtonElement | HTMLAnchorElement, MouseEvent> = (event) => {\n if (inert()) {\n event.preventDefault();\n return;\n }\n // Inside Tabs too the caller's onClick runs first, then the tab list picks the tab.\n callHandler(local.onClick, event);\n // A link tab opens elsewhere on a modified click: the browser's, not a selection here.\n if (local.href !== undefined && isModifiedClick(event)) return;\n ctx?.onChange(event, index());\n };\n\n const close = (event: Event, reason: TabCloseReason): void => {\n // The row notes which tab is closing before the owner removes it.\n ctx?.closing(index(), reason);\n local.onClose?.(event, reason);\n };\n\n // A button clicks on Enter and Space by itself, a link on Enter only: Space does it here.\n const onKeyDown: JSX.EventHandler<HTMLButtonElement | HTMLAnchorElement, KeyboardEvent> = (event) => {\n callHandler(local.onKeyDown, event);\n if (local.disabled || event.defaultPrevented || event.target !== event.currentTarget) return;\n if (tag() !== \"button\" && event.key === \" \") {\n event.preventDefault();\n event.currentTarget.click();\n } else if (local.closable && (event.key === \"Delete\" || event.key === \"Backspace\") && !hasModifier(event)) {\n event.preventDefault();\n close(event, \"key\");\n } else if (hasActions() && (event.key === \"ContextMenu\" || (event.key === \"F10\" && event.shiftKey))) {\n // The Menu key, or Shift+F10: the keyboard's right click. The trigger takes focus first, so\n // the menu it opens hands focus back to it on Escape.\n const trigger = actionsEl?.querySelector<HTMLElement>(ACTIONS_TRIGGER);\n if (trigger) {\n event.preventDefault();\n trigger.focus();\n // The keys mean \"open\": a menu that already is open is not toggled shut.\n if (trigger.getAttribute(\"aria-expanded\") !== \"true\") {\n trigger.click();\n }\n focusPopupOf(trigger);\n }\n }\n };\n\n const onPointerDown: JSX.EventHandler<HTMLButtonElement | HTMLAnchorElement, PointerEvent> = (event) => {\n callHandler(local.onPointerDown, event);\n rippleActions?.onRipple(event);\n };\n\n // Middle click on a closable tab closes it, IDE-style: the browser's own middle-click\n // action (autoscroll, opening a link tab in a new window) is suppressed and the tab is\n // never selected. A middle click on a tab that is not closable is the browser's, untouched.\n const onMouseDown: JSX.EventHandler<HTMLButtonElement | HTMLAnchorElement, MouseEvent> = (event) => {\n callHandler(local.onMouseDown, event);\n if (event.button === 1 && local.closable && !local.disabled) {\n event.preventDefault();\n close(event, \"middleClick\");\n }\n };\n\n // Inside Tabs the row decides, whatever the caller passed.\n const tabStop = (): boolean => (ctx ? ctx.tabStop(index()) : (local.tabStop ?? active()));\n\n // What the tab answers to, for assistive technology; the caller's own list is kept.\n // The chords are best-effort: browsers reserve Mod+W and Mod+Shift+[/] in a page of\n // their own tabs, and they bite only in an embedded webview.\n const keyshortcuts = (): string | undefined =>\n [\n props[\"aria-keyshortcuts\"],\n !local.disabled && local.closable ? \"Delete Backspace\" : undefined,\n !local.disabled && hasActions() ? \"Shift+F10 ContextMenu\" : undefined,\n !local.disabled && local.closable ? \"Meta+W Control+W\" : undefined,\n !local.disabled ? \"Meta+Shift+[ Control+Shift+[ Meta+Shift+] Control+Shift+]\" : undefined,\n ]\n .filter(Boolean)\n .join(\" \") || undefined;\n\n // A tab given neither `closable` nor `actions` is the bare element, as it always was.\n const wrapped = (): boolean => local.closable !== undefined || actions() !== undefined;\n\n // Only a reorderable row makes its items draggable, and a disabled tab never — the same\n // contract as the registration's `disabled`. Rendered on the item (the wrapper, or the\n // bare tab when there is none), so `draggable` is in the server markup, as in React.\n const draggable = (): boolean | undefined =>\n ctx?.reorderable() && !local.disabled && props[\"aria-disabled\"] !== true && props[\"aria-disabled\"] !== \"true\"\n ? true\n : undefined;\n\n const renderTab = (): JSX.Element => (\n <Dynamic\n component={tag()}\n {...rest}\n ref={mergeRefs(local.ref, setRoot)}\n class={cn(\"smwb-tab\", local.class, {\n \"smwb-tab--active\": active(),\n \"smwb-tab--stacked\": local.stacked,\n \"smwb-tab--disabled\": local.disabled,\n })}\n id={local.id ?? ctx?.tabId(index())}\n aria-controls={local[\"aria-controls\"] ?? (ctx?.hasPanels() ? ctx.panelId(index()) : undefined)}\n // A disabled link has no href, so it is no link to follow or to focus.\n href={inert() ? undefined : local.href}\n draggable={wrapped() ? undefined : draggable()}\n onClick={onClick}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n onMouseDown={onMouseDown}\n // The role, the selection and the roving tabindex belong to the tab list:\n // they win over the caller's. A tab that is not disabled keeps the\n // caller's aria-disabled.\n role=\"tab\"\n aria-selected={active()}\n aria-disabled={local.disabled || undefined}\n aria-keyshortcuts={keyshortcuts()}\n tabindex={tabStop() ? 0 : -1}\n disabled={tag() === \"button\" ? local.disabled : undefined}\n >\n <span class=\"smwb-tab__content\" ref={mergeRefs(local.contentRef)}>\n <Show when={icon()}>\n <span class=\"smwb-tab__icon\" aria-hidden=\"true\">\n {icon()}\n </span>\n </Show>\n <Show when={label()}>\n <span class=\"smwb-tab__text-label\">{label()}</span>\n </Show>\n </span>\n <Ripple actionRef={(api) => (rippleActions = api)} classes={{ child: \"tab__ripple-child\" }} />\n </Dynamic>\n );\n\n return (\n <Show when={wrapped()} fallback={renderTab()}>\n <div\n class={cn(\"smwb-tab-item\", {\n \"smwb-tab-item--active\": active(),\n \"smwb-tab-item--disabled\": local.disabled,\n })}\n draggable={draggable()}\n >\n {renderTab()}\n <Show when={hasActions()}>\n <span class=\"smwb-tab__actions\" ref={actionsEl}>\n {actions()}\n </span>\n </Show>\n <Show when={local.closable}>\n <button\n type=\"button\"\n class=\"smwb-tab__close\"\n // Out of the Tab order, so the row keeps its one tab stop; Delete on the tab closes it.\n tabindex={-1}\n aria-label={local.closeLabel}\n disabled={Boolean(local.disabled)}\n // A press does not take focus from where it is: from the tab being closed, or the page.\n onMouseDown={(event) => event.preventDefault()}\n onClick={(event) => close(event, \"button\")}\n >\n <Icon name=\"close\" size={16} />\n </button>\n </Show>\n </div>\n </Show>\n );\n}\n\nexport default Tab;\n"],"names":["isModifiedClick","event","button","ctrlKey","metaKey","shiftKey","altKey","hasModifier","ACTIONS_TRIGGER","FIRST_MENU_ITEM","focusPopupOf","trigger","id","getAttribute","split","item","ownerDocument","getElementById","querySelector","focus","preventScroll","Tab","props","ctx","useTabsContext","root","setRoot","createSignal","merged","mergeProps","isActive","stacked","closeLabel","local","rest","splitProps","index","registerTab","disabled","Boolean","closable","requestClose","close","icon","children","label","actionsApi","actions","given","hasActions","toArray","length","rippleActions","actionsEl","active","value","tag","href","undefined","inert","onClick","preventDefault","callHandler","onChange","reason","closing","onClose","onKeyDown","defaultPrevented","target","currentTarget","key","click","onPointerDown","onRipple","onMouseDown","tabStop","keyshortcuts","filter","join","wrapped","draggable","reorderable","renderTab","_$createComponent","Dynamic","_$mergeProps","component","ref","r$","_ref$","mergeRefs","cn","class","tabId","hasPanels","panelId","_$memo","role","tabindex","_el$","_tmpl$3","_ref$2","contentRef","_$use","_$insert","Show","when","_el$2","_tmpl$","_el$3","_tmpl$2","Ripple","actionRef","api","classes","child","fallback","_el$4","_tmpl$6","_el$5","_tmpl$4","_ref$3","_el$6","_tmpl$5","$$click","$$mousedown","Icon","name","size","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","_v$3","_v$4","_$className","_$delegateEvents"],"mappings":";;;;;;;;;;;AAkHA,MAAMA,KAAkBA,CAACC,MACvBA,EAAMC,WAAW,KAAKD,EAAME,WAAWF,EAAMG,WAAWH,EAAMI,YAAYJ,EAAMK,QAE5EC,KAAcA,CAACN,MAAkCA,EAAME,WAAWF,EAAMG,WAAWH,EAAMK,UAAUL,EAAMI,UAGzGG,KAAkB,2FAGlBC,KAAkB,kDAGlBC,KAAeA,CAACC,MAA+B;AACnD,aAAWC,KAAMD,EAAQE,aAAa,eAAe,GAAGC,MAAM,KAAK,KAAK,IAAI;AAC1E,UAAMC,IAAOH,IAAKD,EAAQK,cAAcC,eAAeL,CAAE,GAAGM,cAA2BT,EAAe,IAAI;AAC1G,QAAIM,GAAM;AAERA,MAAAA,EAAKI,MAAM;AAAA,QAAEC,eAAe;AAAA,MAAA,CAAM;AAClC;AAAA,IACF;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,CAAA;AA0B9B;AAEmBsB,EAAA,CAAA,aAAA,OAAA,CAAA;"}
1
+ {"version":3,"file":"tab.js","sources":["../../../../../src/components/navigation/tabs/tab/tab.tsx"],"sourcesContent":["import { type JSX, type ParentProps, Show, children, createSignal, mergeProps, splitProps } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport cn from \"clsx\";\nimport { Ripple, type RippleActionsRef } from \"../../../base/ripple\";\nimport { Icon } from \"../../../base/icon\";\nimport { useTabsContext, type TabCloseReason } from \"../tabsContext\";\nimport { mergeRefs, type Ref } from \"../../../../primitives/mergeRefs\";\nimport { callHandler } from \"../../../../primitives/callHandler\";\n\nexport type { TabCloseReason };\n\n/** What a function given as `actions` receives. */\nexport interface TabActionsApi {\n /**\n * Ask for the tab to close, as its close button does: `onClose` is called with this event and the\n * reason \"actions\", and `Tabs` moves focus on to the neighbour once the tab goes, even though focus\n * is in a menu drawn outside the row. Call it from the item that closes the tab (\"Terminate\"), with\n * that item's event. It works on a tab that is not `closable`.\n */\n close: (event: Event) => void;\n}\n\n// `onClose` is the close button's, not the element's `close` event handler.\nexport interface TabProps extends Omit<JSX.HTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, \"onClose\"> {\n label?: JSX.Element;\n isActive?: boolean;\n /**\n * Whether the tab is the one in the page's Tab order (`tabindex` 0, the others -1). `Tabs` sets\n * it: the focused tab while focus is in the row, the selected one otherwise. On its own a tab\n * is the stop while `isActive`.\n */\n tabStop?: boolean;\n contentRef?: Ref<HTMLSpanElement>;\n /**\n * A decorative status marker drawn left of the label (a running/done/failed icon). Its\n * wrapper renders `aria-hidden=\"true\"`, so the tab's accessible name stays the label\n * alone: the icon is not announced on top of it. To have the status read out, put it\n * in the `label` itself.\n */\n icon?: JSX.Element;\n stacked?: boolean;\n /** The element to render. A tab with an `href` is an `a` unless you say otherwise. */\n tag?: string;\n /**\n * Navigation mode: where the tab goes. The tab is then a real link (`<a href role=\"tab\">`, with\n * no `target`: a tab never opens another window), so it opens in place and middle click, copy\n * link and the like work. A router takes over the plain click in `onClick` with\n * `event.preventDefault()`; `Tabs` still calls `onChange` for it. A modified or non-primary click\n * (Ctrl, Meta, Shift or Alt held, or a button other than the main one) is the browser's, as\n * \"open in a new tab\": the router must let it through, and `Tabs` does not call `onChange`.\n * The one exception is a middle press on a `closable` tab: it closes the tab instead, as in an\n * editor, and its default is prevented so nothing opens.\n */\n href?: string;\n disabled?: boolean;\n /**\n * Draw a close button after the tab, and let Delete or Backspace on the focused tab close it too\n * (Backspace because a Mac has no Delete key); the tab lists them in `aria-keyshortcuts`. A\n * middle click on the tab closes it as well (`reason` \"middleClick\"): the browser's own\n * middle-click action (autoscroll, opening a link tab in a new window) is suppressed, and the\n * click never selects. The tab does not close itself: `onClose` asks for it and the owner\n * removes the `Tab`. The button is a sibling of the tab, not inside its `role=\"tab\"`, so the\n * tab's accessible name is its label alone.\n * It is out of the Tab order (`tabindex` -1), so the row keeps one tab stop, and a press on it takes\n * no focus and never selects the tab. When the tab that has focus closes, `Tabs` moves focus to the\n * tab that takes its place (the previous one if it was last), skipping disabled tabs. A disabled tab\n * has a disabled button.\n *\n * The button stays in the accessibility tree, named by `closeLabel`: it is how a screen reader user\n * who cannot press Delete, as on a touch screen, closes the tab. It sits in the tab list beside its\n * tab, though, and ARIA 1.2 lets a `tablist` own only `tab`s: a linter that applies that strictly\n * (axe `aria-required-children`) can flag the button, and whatever `actions` holds.\n *\n * To switch it off on a tab, pass `false` rather than leaving it out: a tab given `closable` or\n * `actions` is wrapped in an item with them, a tab given neither is not, and moving between the two\n * recreates the tab and drops its focus.\n */\n closable?: boolean;\n /**\n * Asks for the tab to close, and receives what asked for it: the close button's click (`reason`\n * \"button\"), the key press of Delete or Backspace on the tab (`reason` \"key\", its default is\n * prevented), the middle press on the tab (`reason` \"middleClick\", its default is prevented too),\n * or the event passed to `close` by the tab's `actions` (`reason` \"actions\"). The owner removes\n * the `Tab`.\n */\n onClose?: (event: Event, reason: TabCloseReason) => void;\n /** Accessible label of the close button. English by default; set it to localise, or to name the tab (\"Close Terminal 1\"). */\n closeLabel?: string;\n /**\n * Content after the tab, before the close button: a trigger with a `Menu` (\"Rename\", \"Terminate\"),\n * or any control. Give a function to get `{ close }` (see `TabActionsApi`); it is called once.\n * Like the close button the content is a sibling of the tab, so it is not part of the tab's name;\n * the tab's own `ref`, `class` and handlers stay on the `role=\"tab\"` element. It stays in the\n * accessibility tree as written, inside the tab list (see `closable`).\n *\n * The row has one tab stop, so give the trigger `tabindex={-1}`. Shift+F10 or the Menu key on the\n * focused tab, which the tab lists in `aria-keyshortcuts`, focuses the first control in `actions`\n * and clicks it, unless that control says `aria-expanded=\"true\"` (it is already open). If the\n * control names its popup in `aria-controls`, the first enabled `menuitem` in that element then\n * takes focus, as the WAI-ARIA menu button pattern asks: ArrowDown moves on, Enter chooses, and\n * Escape hands focus back to the trigger. Without `aria-controls` focus stays on the trigger.\n *\n * The row clips what overflows it: draw the menu in a `Portal`, anchored to the trigger and with\n * the `id` the trigger names. A choice that removes the tab (\"Terminate\") should call `close` with\n * its event, so that `onClose` removes the tab and `Tabs` moves focus on to the neighbour; a tab\n * removed some other way leaves focus on the page.\n */\n actions?: JSX.Element | ((api: TabActionsApi) => JSX.Element);\n ref?: Ref<HTMLButtonElement | HTMLAnchorElement>;\n}\n\n/** A click that asks the browser for something else than \"go here\": a new tab, a new window, a download. */\nconst isModifiedClick = (event: MouseEvent): boolean =>\n event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;\n\nconst hasModifier = (event: KeyboardEvent): boolean => event.ctrlKey || event.metaKey || event.altKey || event.shiftKey;\n\n/** What the Menu key and Shift+F10 stand for: the actions' trigger. */\nconst ACTIONS_TRIGGER = 'button:not(:disabled), a[href], [role=\"button\"]:not([aria-disabled=\"true\"]), [tabindex]';\n\n/** The item of an opened menu that takes focus first. */\nconst FIRST_MENU_ITEM = '[role^=\"menuitem\"]:not([aria-disabled=\"true\"])';\n\n/** Focus the first item of the popup `trigger` names in `aria-controls`, if it is there. */\nconst focusPopupOf = (trigger: HTMLElement): void => {\n for (const id of trigger.getAttribute(\"aria-controls\")?.split(/\\s+/) ?? []) {\n const item = id ? trigger.ownerDocument.getElementById(id)?.querySelector<HTMLElement>(FIRST_MENU_ITEM) : null;\n if (item) {\n // The menu may not be placed yet: a scroll to it would jump to the corner it starts in.\n item.focus({ preventScroll: true });\n return;\n }\n }\n};\n\nexport function Tab(props: ParentProps<TabProps>): JSX.Element {\n const ctx = useTabsContext();\n const [root, setRoot] = createSignal<HTMLButtonElement | HTMLAnchorElement>();\n const merged = mergeProps({ isActive: false, stacked: false, closeLabel: \"Close tab\" }, props);\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"label\",\n \"isActive\",\n \"contentRef\",\n \"icon\",\n \"stacked\",\n \"tag\",\n \"href\",\n \"tabStop\",\n \"disabled\",\n // `Tabs` owns this: it is the item that drags, not the tab. The caller's value\n // is dropped, as in the React `Tab`.\n \"draggable\",\n \"closable\",\n \"onClose\",\n \"closeLabel\",\n \"actions\",\n \"id\",\n \"aria-controls\",\n // A tab opens in place: a caller's target is dropped, not passed on.\n \"target\" as keyof TabProps,\n \"onClick\",\n \"onKeyDown\",\n \"ref\",\n // The tab sets this on its root too; its own handler calls the caller's first.\n \"onPointerDown\",\n \"onMouseDown\",\n ]);\n\n // The tab's position in the tab list: it follows the tab when tabs around it\n // are added, removed or reordered.\n const index = ctx\n ? ctx.registerTab(root, {\n id: () => local.id,\n disabled: () =>\n Boolean(local.disabled) || props[\"aria-disabled\"] === true || props[\"aria-disabled\"] === \"true\",\n closable: () => Boolean(local.closable),\n requestClose: (event) => close(event, \"key\"),\n })\n : () => -1;\n\n // Read the icon and the label once: markup passed as a prop is created anew on\n // every read, and during hydration the copy made for the <Show> test has no\n // server DOM node to adopt (\"Unable to find DOM nodes for hydration key\").\n const icon = children(() => local.icon);\n const label = children(() => local.label);\n // A content-width row cuts a long label with an ellipsis, so a string label is its own title there\n // and the full text shows on hover. It sits on the label, not on the tab: a title on the tab is\n // read as its description, next to a name that says the same. A title the caller gave the tab is\n // the tooltip instead, and the label does not shadow it; a label that is not a string has no text\n // to give.\n const fitTitle = (): string | undefined => {\n const text = label();\n return ctx?.fit?.() && props.title === undefined && typeof text === \"string\" && text !== \"\" ? text : undefined;\n };\n // The actions are drawn whenever they are given, so reading them here, once, is safe. A function\n // is the tab's to call, with its api: `children` would call it with nothing.\n const actionsApi: TabActionsApi = { close: (event) => close(event, \"actions\") };\n const actions = children(() => {\n const given = local.actions;\n return typeof given === \"function\" ? (given as (api: TabActionsApi) => JSX.Element)(actionsApi) : given;\n });\n const hasActions = (): boolean => actions.toArray().length > 0;\n\n let rippleActions: RippleActionsRef | undefined;\n let actionsEl: HTMLSpanElement | undefined;\n\n const active = (): boolean => (ctx ? ctx.value() === index() : local.isActive);\n\n const tag = (): string => local.tag ?? (local.href !== undefined ? \"a\" : \"button\");\n // Anything but a button is not disabled by the attribute: its clicks are swallowed here.\n const inert = (): boolean => Boolean(local.disabled) && tag() !== \"button\";\n\n const onClick: JSX.EventHandler<HTMLButtonElement | HTMLAnchorElement, MouseEvent> = (event) => {\n if (inert()) {\n event.preventDefault();\n return;\n }\n // Inside Tabs too the caller's onClick runs first, then the tab list picks the tab.\n callHandler(local.onClick, event);\n // A link tab opens elsewhere on a modified click: the browser's, not a selection here.\n if (local.href !== undefined && isModifiedClick(event)) return;\n ctx?.onChange(event, index());\n };\n\n const close = (event: Event, reason: TabCloseReason): void => {\n // The row notes which tab is closing before the owner removes it.\n ctx?.closing(index(), reason);\n local.onClose?.(event, reason);\n };\n\n // A button clicks on Enter and Space by itself, a link on Enter only: Space does it here.\n const onKeyDown: JSX.EventHandler<HTMLButtonElement | HTMLAnchorElement, KeyboardEvent> = (event) => {\n callHandler(local.onKeyDown, event);\n if (local.disabled || event.defaultPrevented || event.target !== event.currentTarget) return;\n if (tag() !== \"button\" && event.key === \" \") {\n event.preventDefault();\n event.currentTarget.click();\n } else if (local.closable && (event.key === \"Delete\" || event.key === \"Backspace\") && !hasModifier(event)) {\n event.preventDefault();\n close(event, \"key\");\n } else if (hasActions() && (event.key === \"ContextMenu\" || (event.key === \"F10\" && event.shiftKey))) {\n // The Menu key, or Shift+F10: the keyboard's right click. The trigger takes focus first, so\n // the menu it opens hands focus back to it on Escape.\n const trigger = actionsEl?.querySelector<HTMLElement>(ACTIONS_TRIGGER);\n if (trigger) {\n event.preventDefault();\n trigger.focus();\n // The keys mean \"open\": a menu that already is open is not toggled shut.\n if (trigger.getAttribute(\"aria-expanded\") !== \"true\") {\n trigger.click();\n }\n focusPopupOf(trigger);\n }\n }\n };\n\n const onPointerDown: JSX.EventHandler<HTMLButtonElement | HTMLAnchorElement, PointerEvent> = (event) => {\n callHandler(local.onPointerDown, event);\n rippleActions?.onRipple(event);\n };\n\n // Middle click on a closable tab closes it, IDE-style: the browser's own middle-click\n // action (autoscroll, opening a link tab in a new window) is suppressed and the tab is\n // never selected. A middle click on a tab that is not closable is the browser's, untouched.\n const onMouseDown: JSX.EventHandler<HTMLButtonElement | HTMLAnchorElement, MouseEvent> = (event) => {\n callHandler(local.onMouseDown, event);\n if (event.button === 1 && local.closable && !local.disabled) {\n event.preventDefault();\n close(event, \"middleClick\");\n }\n };\n\n // Inside Tabs the row decides, whatever the caller passed.\n const tabStop = (): boolean => (ctx ? ctx.tabStop(index()) : (local.tabStop ?? active()));\n\n // What the tab answers to, for assistive technology; the caller's own list is kept.\n // The chords are best-effort: browsers reserve Mod+W and Mod+Shift+[/] in a page of\n // their own tabs, and they bite only in an embedded webview.\n const keyshortcuts = (): string | undefined =>\n [\n props[\"aria-keyshortcuts\"],\n !local.disabled && local.closable ? \"Delete Backspace\" : undefined,\n !local.disabled && hasActions() ? \"Shift+F10 ContextMenu\" : undefined,\n !local.disabled && local.closable ? \"Meta+W Control+W\" : undefined,\n !local.disabled ? \"Meta+Shift+[ Control+Shift+[ Meta+Shift+] Control+Shift+]\" : undefined,\n ]\n .filter(Boolean)\n .join(\" \") || undefined;\n\n // A tab given neither `closable` nor `actions` is the bare element, as it always was.\n const wrapped = (): boolean => local.closable !== undefined || actions() !== undefined;\n\n // Only a reorderable row makes its items draggable, and a disabled tab never — the same\n // contract as the registration's `disabled`. Rendered on the item (the wrapper, or the\n // bare tab when there is none), so `draggable` is in the server markup, as in React.\n const draggable = (): boolean | undefined =>\n ctx?.reorderable() && !local.disabled && props[\"aria-disabled\"] !== true && props[\"aria-disabled\"] !== \"true\"\n ? true\n : undefined;\n\n const renderTab = (): JSX.Element => (\n <Dynamic\n component={tag()}\n {...rest}\n ref={mergeRefs(local.ref, setRoot)}\n class={cn(\"smwb-tab\", local.class, {\n \"smwb-tab--active\": active(),\n \"smwb-tab--stacked\": local.stacked,\n \"smwb-tab--disabled\": local.disabled,\n })}\n id={local.id ?? ctx?.tabId(index())}\n aria-controls={local[\"aria-controls\"] ?? (ctx?.hasPanels() ? ctx.panelId(index()) : undefined)}\n // A disabled link has no href, so it is no link to follow or to focus.\n href={inert() ? undefined : local.href}\n draggable={wrapped() ? undefined : draggable()}\n onClick={onClick}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n onMouseDown={onMouseDown}\n // The role, the selection and the roving tabindex belong to the tab list:\n // they win over the caller's. A tab that is not disabled keeps the\n // caller's aria-disabled.\n role=\"tab\"\n aria-selected={active()}\n aria-disabled={local.disabled || undefined}\n aria-keyshortcuts={keyshortcuts()}\n tabindex={tabStop() ? 0 : -1}\n disabled={tag() === \"button\" ? local.disabled : undefined}\n >\n <span class=\"smwb-tab__content\" ref={mergeRefs(local.contentRef)}>\n <Show when={icon()}>\n <span class=\"smwb-tab__icon\" aria-hidden=\"true\">\n {icon()}\n </span>\n </Show>\n <Show when={label()}>\n <span class=\"smwb-tab__text-label\" title={fitTitle()}>\n {label()}\n </span>\n </Show>\n </span>\n <Ripple actionRef={(api) => (rippleActions = api)} classes={{ child: \"tab__ripple-child\" }} />\n </Dynamic>\n );\n\n return (\n <Show when={wrapped()} fallback={renderTab()}>\n <div\n class={cn(\"smwb-tab-item\", {\n \"smwb-tab-item--active\": active(),\n \"smwb-tab-item--disabled\": local.disabled,\n })}\n draggable={draggable()}\n >\n {renderTab()}\n <Show when={hasActions()}>\n <span class=\"smwb-tab__actions\" ref={actionsEl}>\n {actions()}\n </span>\n </Show>\n <Show when={local.closable}>\n <button\n type=\"button\"\n class=\"smwb-tab__close\"\n // Out of the Tab order, so the row keeps its one tab stop; Delete on the tab closes it.\n tabindex={-1}\n aria-label={local.closeLabel}\n disabled={Boolean(local.disabled)}\n // A press does not take focus from where it is: from the tab being closed, or the page.\n onMouseDown={(event) => event.preventDefault()}\n onClick={(event) => close(event, \"button\")}\n >\n <Icon name=\"close\" size={16} />\n </button>\n </Show>\n </div>\n </Show>\n );\n}\n\nexport default Tab;\n"],"names":["isModifiedClick","event","button","ctrlKey","metaKey","shiftKey","altKey","hasModifier","ACTIONS_TRIGGER","FIRST_MENU_ITEM","focusPopupOf","trigger","id","getAttribute","split","item","ownerDocument","getElementById","querySelector","focus","preventScroll","Tab","props","ctx","useTabsContext","root","setRoot","createSignal","merged","mergeProps","isActive","stacked","closeLabel","local","rest","splitProps","index","registerTab","disabled","Boolean","closable","requestClose","close","icon","children","label","fitTitle","text","fit","title","undefined","actionsApi","actions","given","hasActions","toArray","length","rippleActions","actionsEl","active","value","tag","href","inert","onClick","preventDefault","callHandler","onChange","reason","closing","onClose","onKeyDown","defaultPrevented","target","currentTarget","key","click","onPointerDown","onRipple","onMouseDown","tabStop","keyshortcuts","filter","join","wrapped","draggable","reorderable","renderTab","_$createComponent","Dynamic","_$mergeProps","component","ref","r$","_ref$","mergeRefs","cn","class","tabId","hasPanels","panelId","_$memo","role","tabindex","_el$","_tmpl$3","_ref$2","contentRef","_$use","_$insert","Show","when","_el$2","_tmpl$","_el$3","_tmpl$2","_$effect","_$setAttribute","Ripple","actionRef","api","classes","child","fallback","_el$4","_tmpl$6","_el$5","_tmpl$4","_ref$3","_el$6","_tmpl$5","$$click","$$mousedown","Icon","name","size","_p$","_v$","_v$2","e","t","_v$3","_v$4","_$className","_$delegateEvents"],"mappings":";;;;;;;;;;;AAkHA,MAAMA,KAAkBA,CAACC,MACvBA,EAAMC,WAAW,KAAKD,EAAME,WAAWF,EAAMG,WAAWH,EAAMI,YAAYJ,EAAMK,QAE5EC,KAAcA,CAACN,MAAkCA,EAAME,WAAWF,EAAMG,WAAWH,EAAMK,UAAUL,EAAMI,UAGzGG,KAAkB,2FAGlBC,KAAkB,kDAGlBC,KAAeA,CAACC,MAA+B;AACnD,aAAWC,KAAMD,EAAQE,aAAa,eAAe,GAAGC,MAAM,KAAK,KAAK,IAAI;AAC1E,UAAMC,IAAOH,IAAKD,EAAQK,cAAcC,eAAeL,CAAE,GAAGM,cAA2BT,EAAe,IAAI;AAC1G,QAAIM,GAAM;AAERA,MAAAA,EAAKI,MAAM;AAAA,QAAEC,eAAe;AAAA,MAAA,CAAM;AAClC;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAASC,GAAIC,GAA2C;AAC7D,QAAMC,IAAMC,EAAAA,GACN,CAACC,GAAMC,CAAO,IAAIC,EAAAA,GAClBC,IAASC,EAAW;AAAA,IAAEC,UAAU;AAAA,IAAOC,SAAS;AAAA,IAAOC,YAAY;AAAA,EAAA,GAAeV,CAAK,GACvF,CAACW,GAAOC,CAAI,IAAIC,EAAWP,GAAQ;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,EAAA,CACD,GAIKQ,IAAQb,IACVA,EAAIc,YAAYZ,GAAM;AAAA,IACpBb,IAAIA,MAAMqB,EAAMrB;AA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B,EAAAoB,CAAAA,MAAA;AAAA,gBAAAC,IANfxG,EAAMD,YAAU0G,IAClBnG,EAAQN,EAAMK;AAASmG,mBAAAA,MAAAD,EAAAG,KAAAtB,EAAAY,GAAA,cAAAO,EAAAG,IAAAF,CAAA,GAAAC,MAAAF,EAAAI,MAAAX,EAAA3F,WAAAkG,EAAAI,IAAAF,IAAAF;AAAAA,UAAA,GAAA;AAAA,YAAAG,GAAAzF;AAAAA,YAAA0F,GAAA1F;AAAAA,UAAAA,CAAA,GAAA+E;AAAAA,QAAA;AAAA,MAAA,CAAA,GAAA,IAAA,GAAAb,EAAAoB,CAAAA,MAAA;AAAA,YAAAK,IAnB9B7C,EAAG,iBAAiB;AAAA,UACzB,yBAAyBrC,EAAAA;AAAAA,UACzB,2BAA2B1B,EAAMK;AAAAA,QAAAA,CAClC,GAACwG,IACSzD,EAAAA;AAAWwD,eAAAA,MAAAL,EAAAG,KAAAI,EAAAnB,GAAAY,EAAAG,IAAAE,CAAA,GAAAC,MAAAN,EAAAI,KAAAvB,EAAAO,GAAA,aAAAY,EAAAI,IAAAE,CAAA,GAAAN;AAAAA,MAAA,GAAA;AAAA,QAAAG,GAAAzF;AAAAA,QAAA0F,GAAA1F;AAAAA,MAAAA,CAAA,GAAA0E;AAAAA,IAAA;AAAA,EAAA,CAAA;AA0B9B;AAEmBoB,EAAA,CAAA,aAAA,OAAA,CAAA;"}
@@ -92,8 +92,22 @@ export interface TabsProps {
92
92
  overflowMenu?: boolean;
93
93
  /** Accessible label of the overflow-menu trigger. English by default; set it to localise. */
94
94
  overflowMenuAriaLabel?: string;
95
- /** Compact tabs: labels as written (no capitals, no letter spacing) and less padding. */
95
+ /**
96
+ * Compact tabs: a shorter row — `--smui-tabDenseHeight` (36px) — with labels as written (no
97
+ * capitals, no letter spacing) and less padding.
98
+ */
96
99
  dense?: boolean;
100
+ /**
101
+ * Content-width tabs: each tab is as wide as what it holds (marker, label, close button) and the
102
+ * row does not stretch them, so what is left of the row stays empty; a plain row shares its whole
103
+ * width between its tabs. A tab stays between `--smui-tabFitMinWidth` (80px) and
104
+ * `--smui-tabFitMaxWidth` (256px), set in the theme; a longer label is cut with an ellipsis, and a
105
+ * string `label` is also the label's `title`, so the full text shows on hover (a `Tab` whose label
106
+ * is not a string takes a `title` of its own, which is the tooltip of the whole tab). The indicator, `scrollable`, `scrollButtons`, the
107
+ * overflow menu and the close button need nothing more. Dropping a dragged tab on the row's empty
108
+ * part does nothing.
109
+ */
110
+ fit?: boolean;
97
111
  /** Accessible label of the button that scrolls back. */
98
112
  scrollBackAriaLabel?: string;
99
113
  /** Accessible label of the button that scrolls forward. */