@viasat/beam-web-components 2.0.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 (316) hide show
  1. package/Accordion/Accordion.d.ts +56 -0
  2. package/Accordion/Accordion.js +12 -0
  3. package/Accordion/AccordionGroup.context.d.ts +10 -0
  4. package/Accordion/AccordionGroup.context.js +8 -0
  5. package/Accordion/AccordionGroup.d.ts +33 -0
  6. package/Accordion/AccordionGroup.js +79 -0
  7. package/Accordion/index.d.ts +3 -0
  8. package/Accordion/index.js +6 -0
  9. package/Alert/Alert.d.ts +64 -0
  10. package/Alert/Alert.js +300 -0
  11. package/Alert/index.d.ts +2 -0
  12. package/Alert/index.js +4 -0
  13. package/Avatar/Avatar.d.ts +60 -0
  14. package/Avatar/Avatar.js +12 -0
  15. package/Avatar/AvatarGroup.context.d.ts +11 -0
  16. package/Avatar/AvatarGroup.context.js +8 -0
  17. package/Avatar/AvatarGroup.d.ts +43 -0
  18. package/Avatar/AvatarGroup.js +181 -0
  19. package/Avatar/index.d.ts +3 -0
  20. package/Avatar/index.js +6 -0
  21. package/Badge/Badge.d.ts +40 -0
  22. package/Badge/Badge.js +125 -0
  23. package/Badge/index.d.ts +2 -0
  24. package/Badge/index.js +4 -0
  25. package/BadgeDot/BadgeDot.d.ts +38 -0
  26. package/BadgeDot/BadgeDot.js +59 -0
  27. package/BadgeDot/index.d.ts +2 -0
  28. package/BadgeDot/index.js +4 -0
  29. package/Box/Box.d.ts +99 -0
  30. package/Box/Box.js +115 -0
  31. package/Box/index.d.ts +2 -0
  32. package/Box/index.js +4 -0
  33. package/Breadcrumbs/Breadcrumbs.context.d.ts +10 -0
  34. package/Breadcrumbs/Breadcrumbs.context.js +8 -0
  35. package/Breadcrumbs/Breadcrumbs.d.ts +38 -0
  36. package/Breadcrumbs/Breadcrumbs.js +115 -0
  37. package/Breadcrumbs/BreadcrumbsItem.d.ts +39 -0
  38. package/Breadcrumbs/BreadcrumbsItem.js +13 -0
  39. package/Breadcrumbs/index.d.ts +3 -0
  40. package/Breadcrumbs/index.js +6 -0
  41. package/Button/Button.d.ts +73 -0
  42. package/Button/Button.js +125 -0
  43. package/Button/index.d.ts +2 -0
  44. package/Button/index.js +4 -0
  45. package/CloseButton/CloseButton.d.ts +25 -0
  46. package/CloseButton/CloseButton.js +60 -0
  47. package/CloseButton/index.d.ts +2 -0
  48. package/CloseButton/index.js +4 -0
  49. package/Divider/Divider.d.ts +56 -0
  50. package/Divider/Divider.js +111 -0
  51. package/Divider/index.d.ts +2 -0
  52. package/Divider/index.js +4 -0
  53. package/EmptyState/EmptyState.d.ts +36 -0
  54. package/EmptyState/EmptyState.js +56 -0
  55. package/EmptyState/index.d.ts +2 -0
  56. package/EmptyState/index.js +4 -0
  57. package/HelperText/HelperText.d.ts +45 -0
  58. package/HelperText/HelperText.js +11 -0
  59. package/HelperText/index.d.ts +2 -0
  60. package/HelperText/index.js +4 -0
  61. package/Icon/Icon.d.ts +35 -0
  62. package/Icon/Icon.js +62 -0
  63. package/Icon/index.d.ts +2 -0
  64. package/Icon/index.js +4 -0
  65. package/InputChoiceGroup/InputChoiceGroup.context.d.ts +13 -0
  66. package/InputChoiceGroup/InputChoiceGroup.context.js +8 -0
  67. package/InputChoiceGroup/InputChoiceGroup.d.ts +87 -0
  68. package/InputChoiceGroup/InputChoiceGroup.js +205 -0
  69. package/InputChoiceGroup/index.d.ts +2 -0
  70. package/InputChoiceGroup/index.js +4 -0
  71. package/Link/Link.d.ts +48 -0
  72. package/Link/Link.js +77 -0
  73. package/Link/index.d.ts +2 -0
  74. package/Link/index.js +4 -0
  75. package/List/List.context.d.ts +15 -0
  76. package/List/List.context.js +8 -0
  77. package/List/List.d.ts +43 -0
  78. package/List/List.js +101 -0
  79. package/List/ListItem.d.ts +23 -0
  80. package/List/ListItem.js +90 -0
  81. package/List/index.d.ts +3 -0
  82. package/List/index.js +6 -0
  83. package/ProgressBar/ProgressBar.d.ts +52 -0
  84. package/ProgressBar/ProgressBar.js +128 -0
  85. package/ProgressBar/index.d.ts +2 -0
  86. package/ProgressBar/index.js +4 -0
  87. package/README.md +360 -0
  88. package/SegmentedControl/SegmentedControl.context.d.ts +16 -0
  89. package/SegmentedControl/SegmentedControl.context.js +8 -0
  90. package/SegmentedControl/SegmentedControl.d.ts +41 -0
  91. package/SegmentedControl/SegmentedControl.js +103 -0
  92. package/SegmentedControl/SegmentedControlItem.d.ts +54 -0
  93. package/SegmentedControl/SegmentedControlItem.js +284 -0
  94. package/SegmentedControl/SegmentedControlList.d.ts +23 -0
  95. package/SegmentedControl/SegmentedControlList.js +61 -0
  96. package/SegmentedControl/SegmentedControlPanel.d.ts +21 -0
  97. package/SegmentedControl/SegmentedControlPanel.js +43 -0
  98. package/SegmentedControl/index.d.ts +5 -0
  99. package/SegmentedControl/index.js +10 -0
  100. package/Spinner/Spinner.d.ts +50 -0
  101. package/Spinner/Spinner.js +186 -0
  102. package/Spinner/index.d.ts +2 -0
  103. package/Spinner/index.js +4 -0
  104. package/StateLayer/StateLayer.d.ts +17 -0
  105. package/StateLayer/StateLayer.js +6 -0
  106. package/StateLayer/index.d.ts +2 -0
  107. package/StateLayer/index.js +5 -0
  108. package/Text/Text.d.ts +85 -0
  109. package/Text/Text.js +103 -0
  110. package/Text/index.d.ts +2 -0
  111. package/Text/index.js +4 -0
  112. package/Tooltip/Tooltip.d.ts +139 -0
  113. package/Tooltip/Tooltip.js +1827 -0
  114. package/Tooltip/index.d.ts +2 -0
  115. package/Tooltip/index.js +5 -0
  116. package/chunks/Accordion.DYD3XcAx.js +161 -0
  117. package/chunks/Avatar.C2rfzUGP.js +174 -0
  118. package/chunks/BreadcrumbsItem.4ZR6wbMz.js +121 -0
  119. package/chunks/CSSLookup.BdqZ5Li9.js +106 -0
  120. package/chunks/HelperText.CcVVOtA3.js +108 -0
  121. package/chunks/Upload.B9YEyp7b.js +12 -0
  122. package/chunks/WarningOutlined.DPfQnPPj.js +12 -0
  123. package/chunks/classNames.Cq_tbDRp.js +94 -0
  124. package/chunks/constants.jOWREYQE.js +30 -0
  125. package/chunks/delegate.baxDQosr.js +63 -0
  126. package/chunks/dom.C98AFbJh.js +22 -0
  127. package/chunks/fileUpload.module.kN6o64aL.js +4 -0
  128. package/chunks/globals.Bz4SVF2g.js +4 -0
  129. package/chunks/helpers.AwJwaZvv.js +53 -0
  130. package/chunks/list.module.CZRPBLzy.js +4 -0
  131. package/chunks/register-custom-element.DHGKOhmA.js +17 -0
  132. package/chunks/segmentedControl.module.BPXEWodj.js +4 -0
  133. package/chunks/tokens.CTW8Tt94.js +9 -0
  134. package/custom-elements.json +11341 -0
  135. package/local/Accordion/Accordion.js +12 -0
  136. package/local/Accordion/AccordionGroup.context.js +8 -0
  137. package/local/Accordion/AccordionGroup.js +78 -0
  138. package/local/Accordion/index.js +6 -0
  139. package/local/Alert/Alert.js +301 -0
  140. package/local/Alert/index.js +4 -0
  141. package/local/Avatar/Avatar.js +11 -0
  142. package/local/Avatar/AvatarGroup.context.js +8 -0
  143. package/local/Avatar/AvatarGroup.js +180 -0
  144. package/local/Avatar/index.js +6 -0
  145. package/local/Badge/Badge.js +123 -0
  146. package/local/Badge/index.js +4 -0
  147. package/local/BadgeDot/BadgeDot.js +57 -0
  148. package/local/BadgeDot/index.js +4 -0
  149. package/local/Box/Box.js +113 -0
  150. package/local/Box/index.js +4 -0
  151. package/local/Breadcrumbs/Breadcrumbs.context.js +8 -0
  152. package/local/Breadcrumbs/Breadcrumbs.js +113 -0
  153. package/local/Breadcrumbs/BreadcrumbsItem.js +13 -0
  154. package/local/Breadcrumbs/index.js +6 -0
  155. package/local/Button/Button.js +154 -0
  156. package/local/Button/index.js +4 -0
  157. package/local/CloseButton/CloseButton.js +58 -0
  158. package/local/CloseButton/index.js +4 -0
  159. package/local/Divider/Divider.js +111 -0
  160. package/local/Divider/index.js +4 -0
  161. package/local/EmptyState/EmptyState.js +54 -0
  162. package/local/EmptyState/index.js +4 -0
  163. package/local/HelperText/HelperText.js +9 -0
  164. package/local/HelperText/index.js +4 -0
  165. package/local/Icon/Icon.js +60 -0
  166. package/local/Icon/index.js +4 -0
  167. package/local/InputChoiceGroup/InputChoiceGroup.context.js +8 -0
  168. package/local/InputChoiceGroup/InputChoiceGroup.js +205 -0
  169. package/local/InputChoiceGroup/index.js +4 -0
  170. package/local/Link/Link.js +75 -0
  171. package/local/Link/index.js +4 -0
  172. package/local/List/List.context.js +8 -0
  173. package/local/List/List.js +101 -0
  174. package/local/List/ListItem.js +90 -0
  175. package/local/List/index.js +6 -0
  176. package/local/ProgressBar/ProgressBar.js +126 -0
  177. package/local/ProgressBar/index.js +4 -0
  178. package/local/SegmentedControl/SegmentedControl.context.js +8 -0
  179. package/local/SegmentedControl/SegmentedControl.js +103 -0
  180. package/local/SegmentedControl/SegmentedControlItem.js +284 -0
  181. package/local/SegmentedControl/SegmentedControlList.js +59 -0
  182. package/local/SegmentedControl/SegmentedControlPanel.js +41 -0
  183. package/local/SegmentedControl/index.js +10 -0
  184. package/local/Spinner/Spinner.js +185 -0
  185. package/local/Spinner/index.js +4 -0
  186. package/local/StateLayer/StateLayer.js +6 -0
  187. package/local/StateLayer/index.js +5 -0
  188. package/local/Text/Text.js +121 -0
  189. package/local/Text/index.js +4 -0
  190. package/local/Tooltip/Tooltip.js +1826 -0
  191. package/local/Tooltip/index.js +5 -0
  192. package/local/chunks/Accordion.PGU7OILE.js +161 -0
  193. package/local/chunks/Avatar.CvTOzaRT.js +172 -0
  194. package/local/chunks/BreadcrumbsItem.GM6sBp_o.js +121 -0
  195. package/local/chunks/CSSLookup.BdqZ5Li9.js +106 -0
  196. package/local/chunks/Upload.B9YEyp7b.js +12 -0
  197. package/local/chunks/WarningOutlined.DPfQnPPj.js +12 -0
  198. package/local/chunks/base.D76d76ww.js +9 -0
  199. package/local/chunks/classNames.C6fNrXWF.js +106 -0
  200. package/local/chunks/constants.jOWREYQE.js +30 -0
  201. package/local/chunks/consume.Ce9k1-wN.js +47 -0
  202. package/local/chunks/context-request-event.Bl9Vpkzl.js +13 -0
  203. package/local/chunks/create-context.DS1OG3vJ.js +11 -0
  204. package/local/chunks/delegate.baxDQosr.js +63 -0
  205. package/local/chunks/directive.kLG6oqUu.js +27 -0
  206. package/local/chunks/dom.C98AFbJh.js +22 -0
  207. package/local/chunks/fileUpload.module.kN6o64aL.js +4 -0
  208. package/local/chunks/globals.Bz4SVF2g.js +4 -0
  209. package/local/chunks/helpers.BWcXAteC.js +53 -0
  210. package/local/chunks/index.Bz1Jq4c2.js +106 -0
  211. package/local/chunks/list.module.CZRPBLzy.js +4 -0
  212. package/local/chunks/lit-element.CJtt9wj5.js +557 -0
  213. package/local/chunks/provide.i2FlUkOu.js +110 -0
  214. package/local/chunks/query-assigned-elements.Drkgpk9q.js +19 -0
  215. package/local/chunks/query-assigned-nodes.Dgvsf6BR.js +19 -0
  216. package/local/chunks/query.lbpOn5CD.js +20 -0
  217. package/local/chunks/ref.B7e1Hu4F.js +107 -0
  218. package/local/chunks/register-custom-element.vod7zfGv.js +51 -0
  219. package/local/chunks/segmentedControl.module.BPXEWodj.js +4 -0
  220. package/local/chunks/state.CqiuSzAl.js +12 -0
  221. package/local/chunks/tokens.CTW8Tt94.js +9 -0
  222. package/local/chunks/unsafe-html.BzhXEygn.js +27 -0
  223. package/local/chunks/unsafe-svg.HSGf1NCU.js +14 -0
  224. package/local/wip/Checkbox/Checkbox.js +102 -0
  225. package/local/wip/Checkbox/CheckboxGroup/CheckboxGroup.js +27 -0
  226. package/local/wip/Checkbox/index.js +6 -0
  227. package/local/wip/FileUpload/FileUpload.Button.js +75 -0
  228. package/local/wip/FileUpload/FileUpload.Dropzone.js +149 -0
  229. package/local/wip/FileUpload/FileUpload.List.Item.js +201 -0
  230. package/local/wip/FileUpload/FileUpload.List.js +105 -0
  231. package/local/wip/FileUpload/FileUpload.js +452 -0
  232. package/local/wip/FileUpload/FileUploadContext.js +8 -0
  233. package/local/wip/FileUpload/FileUploadListContext.js +8 -0
  234. package/local/wip/FileUpload/index.js +13 -0
  235. package/local/wip/Form/Form.context.js +20 -0
  236. package/local/wip/Form/Form.decorator.js +145 -0
  237. package/local/wip/Form/Form.js +288 -0
  238. package/local/wip/Form/Form.utils.js +8 -0
  239. package/local/wip/Form/index.js +7 -0
  240. package/local/wip/Label/Label.js +86 -0
  241. package/local/wip/Label/index.js +4 -0
  242. package/local/wip/NativeSelect/NativeSelect.js +162 -0
  243. package/local/wip/NativeSelect/index.js +4 -0
  244. package/local/wip/RadioButton/RadioButton.js +123 -0
  245. package/local/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.js +96 -0
  246. package/local/wip/RadioButton/index.js +6 -0
  247. package/local/wip/Switch/Switch.js +153 -0
  248. package/local/wip/Switch/SwitchGroup/SwitchGroup.js +15 -0
  249. package/local/wip/Switch/index.js +6 -0
  250. package/local/wip/TextArea/TextArea.js +192 -0
  251. package/local/wip/TextArea/index.js +4 -0
  252. package/local/wip/TextField/TextField.js +169 -0
  253. package/local/wip/TextField/index.js +4 -0
  254. package/package.json +78 -0
  255. package/vscode.css-custom-data.json +6 -0
  256. package/vscode.html-custom-data.json +2704 -0
  257. package/wip/Checkbox/Checkbox.d.ts +55 -0
  258. package/wip/Checkbox/Checkbox.js +104 -0
  259. package/wip/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +11 -0
  260. package/wip/Checkbox/CheckboxGroup/CheckboxGroup.js +27 -0
  261. package/wip/Checkbox/index.d.ts +3 -0
  262. package/wip/Checkbox/index.js +6 -0
  263. package/wip/FileUpload/FileUpload.Button.d.ts +36 -0
  264. package/wip/FileUpload/FileUpload.Button.js +77 -0
  265. package/wip/FileUpload/FileUpload.Dropzone.d.ts +55 -0
  266. package/wip/FileUpload/FileUpload.Dropzone.js +150 -0
  267. package/wip/FileUpload/FileUpload.List.Item.d.ts +62 -0
  268. package/wip/FileUpload/FileUpload.List.Item.js +203 -0
  269. package/wip/FileUpload/FileUpload.List.d.ts +46 -0
  270. package/wip/FileUpload/FileUpload.List.js +106 -0
  271. package/wip/FileUpload/FileUpload.d.ts +101 -0
  272. package/wip/FileUpload/FileUpload.js +451 -0
  273. package/wip/FileUpload/FileUploadContext.d.ts +5 -0
  274. package/wip/FileUpload/FileUploadContext.js +8 -0
  275. package/wip/FileUpload/FileUploadListContext.d.ts +5 -0
  276. package/wip/FileUpload/FileUploadListContext.js +8 -0
  277. package/wip/FileUpload/index.d.ts +6 -0
  278. package/wip/FileUpload/index.js +13 -0
  279. package/wip/Form/Form.context.d.ts +19 -0
  280. package/wip/Form/Form.context.js +20 -0
  281. package/wip/Form/Form.d.ts +50 -0
  282. package/wip/Form/Form.decorator.d.ts +47 -0
  283. package/wip/Form/Form.decorator.js +144 -0
  284. package/wip/Form/Form.js +288 -0
  285. package/wip/Form/Form.utils.d.ts +2 -0
  286. package/wip/Form/Form.utils.js +8 -0
  287. package/wip/Form/index.d.ts +3 -0
  288. package/wip/Form/index.js +7 -0
  289. package/wip/Label/Label.d.ts +43 -0
  290. package/wip/Label/Label.js +87 -0
  291. package/wip/Label/index.d.ts +2 -0
  292. package/wip/Label/index.js +4 -0
  293. package/wip/NativeSelect/NativeSelect.d.ts +69 -0
  294. package/wip/NativeSelect/NativeSelect.js +163 -0
  295. package/wip/NativeSelect/index.d.ts +2 -0
  296. package/wip/NativeSelect/index.js +4 -0
  297. package/wip/RadioButton/RadioButton.d.ts +56 -0
  298. package/wip/RadioButton/RadioButton.js +125 -0
  299. package/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.d.ts +23 -0
  300. package/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.js +96 -0
  301. package/wip/RadioButton/index.d.ts +3 -0
  302. package/wip/RadioButton/index.js +6 -0
  303. package/wip/Switch/Switch.d.ts +62 -0
  304. package/wip/Switch/Switch.js +155 -0
  305. package/wip/Switch/SwitchGroup/SwitchGroup.d.ts +15 -0
  306. package/wip/Switch/SwitchGroup/SwitchGroup.js +15 -0
  307. package/wip/Switch/index.d.ts +3 -0
  308. package/wip/Switch/index.js +6 -0
  309. package/wip/TextArea/TextArea.d.ts +89 -0
  310. package/wip/TextArea/TextArea.js +193 -0
  311. package/wip/TextArea/index.d.ts +2 -0
  312. package/wip/TextArea/index.js +4 -0
  313. package/wip/TextField/TextField.d.ts +70 -0
  314. package/wip/TextField/TextField.js +169 -0
  315. package/wip/TextField/index.d.ts +2 -0
  316. package/wip/TextField/index.js +4 -0
@@ -0,0 +1,8 @@
1
+ import { n as o } from "../chunks/create-context.DS1OG3vJ.js";
2
+ import { p as t } from "../chunks/constants.jOWREYQE.js";
3
+ const n = o(
4
+ Symbol(`${t}segmented-control-group-context`)
5
+ );
6
+ export {
7
+ n as segmentedControlContext
8
+ };
@@ -0,0 +1,103 @@
1
+ import { e as S } from "../chunks/provide.i2FlUkOu.js";
2
+ import { r as x, a as b, x as w } from "../chunks/lit-element.CJtt9wj5.js";
3
+ import { n as c, c as E } from "../chunks/register-custom-element.vod7zfGv.js";
4
+ import { r as z } from "../chunks/state.CqiuSzAl.js";
5
+ import { g as B } from "../chunks/classNames.C6fNrXWF.js";
6
+ import "../chunks/constants.jOWREYQE.js";
7
+ import { s as I } from "../chunks/segmentedControl.module.BPXEWodj.js";
8
+ import { segmentedControlContext as O } from "./SegmentedControl.context.js";
9
+ import "./SegmentedControlItem.js";
10
+ import "./SegmentedControlList.js";
11
+ import "./SegmentedControlPanel.js";
12
+ var V = Object.defineProperty, A = Object.getOwnPropertyDescriptor, C = (e) => {
13
+ throw TypeError(e);
14
+ }, a = (e, t, i, h) => {
15
+ for (var n = h > 1 ? void 0 : h ? A(t, i) : t, p = e.length - 1, f; p >= 0; p--)
16
+ (f = e[p]) && (n = (h ? f(t, i, n) : f(n)) || n);
17
+ return h && n && V(t, i, n), n;
18
+ }, _ = (e, t, i) => t.has(e) || C("Cannot " + i), m = (e, t, i) => (_(e, t, "read from private field"), t.get(e)), g = (e, t, i) => t.has(e) ? C("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, i), o = (e, t, i) => (_(e, t, "access private method"), i), l, s, y, u, v, d;
19
+ const { baseClassNamePrefix: M } = B("segmented-control");
20
+ let r = class extends b {
21
+ constructor() {
22
+ super(), g(this, s), g(this, l, /* @__PURE__ */ new Set()), this.segmentedControlContext = {
23
+ disabled: void 0,
24
+ size: void 0,
25
+ selectedValue: void 0,
26
+ initialSelection: void 0,
27
+ fluid: void 0,
28
+ register: (e) => o(this, s, u).call(this, e),
29
+ unregister: (e) => o(this, s, v).call(this, e),
30
+ registeredItems: Array.from(m(this, l))
31
+ }, this.addEventListener("bm-selected", o(this, s, y));
32
+ }
33
+ firstUpdated() {
34
+ o(this, s, d).call(this);
35
+ }
36
+ willUpdate(e) {
37
+ (e.has("disabled") || e.has("size") || e.has("initialSelection") || e.has("fluid")) && o(this, s, d).call(this);
38
+ }
39
+ render() {
40
+ return w`
41
+ <div class=${M}>
42
+ <slot></slot>
43
+ </div>
44
+ `;
45
+ }
46
+ };
47
+ l = /* @__PURE__ */ new WeakMap();
48
+ s = /* @__PURE__ */ new WeakSet();
49
+ y = function(e) {
50
+ const { value: t } = e.detail;
51
+ e.target.focus(), this.segmentedControlContext = {
52
+ ...this.segmentedControlContext,
53
+ selectedValue: t
54
+ }, this.dispatchEvent(
55
+ new CustomEvent("bm-change", {
56
+ detail: { value: t },
57
+ bubbles: !0,
58
+ composed: !0
59
+ })
60
+ );
61
+ };
62
+ u = function(e) {
63
+ m(this, l).add(e), o(this, s, d).call(this);
64
+ };
65
+ v = function(e) {
66
+ m(this, l).delete(e), o(this, s, d).call(this);
67
+ };
68
+ d = function() {
69
+ var e;
70
+ this.segmentedControlContext = {
71
+ disabled: this.disabled || !1,
72
+ size: this.size || "md",
73
+ selectedValue: ((e = this.segmentedControlContext) == null ? void 0 : e.selectedValue) ?? this.initialSelection,
74
+ initialSelection: this.initialSelection,
75
+ fluid: this.fluid || !1,
76
+ register: (t) => o(this, s, u).call(this, t),
77
+ unregister: (t) => o(this, s, v).call(this, t),
78
+ registeredItems: Array.from(m(this, l))
79
+ };
80
+ };
81
+ r.styles = x(I);
82
+ a([
83
+ c({ type: Boolean })
84
+ ], r.prototype, "disabled", 2);
85
+ a([
86
+ c({ type: String })
87
+ ], r.prototype, "size", 2);
88
+ a([
89
+ c({ type: String })
90
+ ], r.prototype, "initialSelection", 2);
91
+ a([
92
+ c({ type: Boolean })
93
+ ], r.prototype, "fluid", 2);
94
+ a([
95
+ S({ context: O }),
96
+ z()
97
+ ], r.prototype, "segmentedControlContext", 2);
98
+ r = a([
99
+ E("bm-segmented-control")
100
+ ], r);
101
+ export {
102
+ r as BmSegmentedControl
103
+ };
@@ -0,0 +1,284 @@
1
+ import { c as v } from "../chunks/consume.Ce9k1-wN.js";
2
+ import { r as w, i as x, E as p, x as u, a as _ } from "../chunks/lit-element.CJtt9wj5.js";
3
+ import { n as m, c as y } from "../chunks/register-custom-element.vod7zfGv.js";
4
+ import { r as C } from "../chunks/state.CqiuSzAl.js";
5
+ import { e as O } from "../chunks/query.lbpOn5CD.js";
6
+ import { b as T, c as b, g as $ } from "../chunks/classNames.C6fNrXWF.js";
7
+ import { a as E } from "../chunks/constants.jOWREYQE.js";
8
+ import { r as S } from "../chunks/dom.C98AFbJh.js";
9
+ import { s as A } from "../chunks/segmentedControl.module.BPXEWodj.js";
10
+ import { g as I } from "../chunks/helpers.BWcXAteC.js";
11
+ import "../Tooltip/Tooltip.js";
12
+ import { stateLayerStyles as D, stateLayerClassName as N } from "../StateLayer/StateLayer.js";
13
+ import { segmentedControlContext as k } from "./SegmentedControl.context.js";
14
+ const L = (t) => {
15
+ class e extends t {
16
+ getTooltipElement() {
17
+ var s;
18
+ return (s = this.shadowRoot) == null ? void 0 : s.querySelector("bm-tooltip");
19
+ }
20
+ handleTooltipFocus() {
21
+ const s = this.getTooltipElement(), o = this.hasAttribute("disabled");
22
+ s && !o && this.shouldShowTooltip() && s.setAttribute("open", "");
23
+ }
24
+ handleTooltipBlur() {
25
+ const s = this.getTooltipElement();
26
+ s && s.removeAttribute("open");
27
+ }
28
+ handleTooltipMouseEnter() {
29
+ const s = this.getTooltipElement(), o = this.hasAttribute("disabled");
30
+ s && !o && this.shouldShowTooltip() && s.setAttribute("open", "");
31
+ }
32
+ handleTooltipMouseLeave() {
33
+ const s = this.getTooltipElement();
34
+ s && s.removeAttribute("open");
35
+ }
36
+ updateTooltipForItem(s, o) {
37
+ var l;
38
+ if (!s || s.hasAttribute("disabled")) return;
39
+ const i = (l = s.shadowRoot) == null ? void 0 : l.querySelector("bm-tooltip");
40
+ i && (o ? i.setAttribute("open", "") : i.removeAttribute("open"));
41
+ }
42
+ shouldShowTooltip() {
43
+ return !this.hasAttribute("disabled");
44
+ }
45
+ getTooltipText() {
46
+ return this.getAttribute("aria-label") || "";
47
+ }
48
+ }
49
+ return e;
50
+ };
51
+ class R {
52
+ constructor(e, n) {
53
+ this._element = e, this._callback = n, this.setup();
54
+ }
55
+ setup() {
56
+ this._element && (this._debouncedCheckOverflow = T(() => {
57
+ if (this._element) {
58
+ const e = this._element.scrollWidth > this._element.clientWidth;
59
+ this._callback(e);
60
+ }
61
+ }, E), this._observer = new ResizeObserver(this._debouncedCheckOverflow), this._observer.observe(this._element), this._debouncedCheckOverflow());
62
+ }
63
+ disconnect() {
64
+ this._observer && this._observer.disconnect(), this._debouncedCheckOverflow && this._debouncedCheckOverflow.cancel();
65
+ }
66
+ }
67
+ var V = Object.defineProperty, q = Object.getOwnPropertyDescriptor, c = (t, e, n, s) => {
68
+ for (var o = s > 1 ? void 0 : s ? q(e, n) : e, i = t.length - 1, l; i >= 0; i--)
69
+ (l = t[i]) && (o = (s ? l(e, n, o) : l(o)) || o);
70
+ return s && o && V(e, n, o), o;
71
+ };
72
+ const { subElementClassPrefix: P } = $("segmented-control"), r = `${P}item`;
73
+ let h = class extends L(_) {
74
+ constructor() {
75
+ super(...arguments), this.value = "", this.disabled = !1, this.isDisabled = () => {
76
+ var t;
77
+ return this.disabled || ((t = this.segmentedControlContext) == null ? void 0 : t.disabled) === !0;
78
+ }, this.hasDefaultSlotContent = () => Array.from(this.childNodes).some(
79
+ (t) => t.nodeType === Node.ELEMENT_NODE && !t.hasAttribute("slot")
80
+ ), this.getDefaultSlotElement = () => Array.from(this.childNodes).find(
81
+ (t) => t.nodeType === Node.ELEMENT_NODE && !t.hasAttribute("slot")
82
+ ), this.selected = !1, this.isContentOverflowing = !1, this.hasIcon = !1, this.hasContent = !1;
83
+ }
84
+ firstUpdated() {
85
+ this.setupOverflowObserver();
86
+ }
87
+ connectedCallback() {
88
+ var t, e;
89
+ super.connectedCallback(), (e = (t = this.segmentedControlContext) == null ? void 0 : t.register) == null || e.call(t, this);
90
+ }
91
+ disconnectedCallback() {
92
+ var t, e;
93
+ super.disconnectedCallback(), this.cleanupOverflowObserver(), (e = (t = this.segmentedControlContext) == null ? void 0 : t.unregister) == null || e.call(t, this);
94
+ }
95
+ willUpdate(t) {
96
+ var e, n, s;
97
+ if (t.has("segmentedControlContext")) {
98
+ const o = this.selected, i = ((e = this.segmentedControlContext) == null ? void 0 : e.selectedValue) === this.value;
99
+ this.selected = i, !o && i && ((n = this.segmentedControlContext) != null && n.selectedValue) && ((s = t.get("segmentedControlContext")) == null ? void 0 : s.selectedValue) !== void 0 && this.updateComplete.then(() => {
100
+ var a, d;
101
+ (d = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button")) == null || d.focus();
102
+ });
103
+ }
104
+ }
105
+ // Override only the methods that need custom behavior
106
+ shouldShowTooltip() {
107
+ const t = this.querySelector('[slot="icon"]') !== null, e = this.hasDefaultSlotContent();
108
+ return !this.isDisabled() && (t && !e || e && this.isContentOverflowing);
109
+ }
110
+ getTooltipText() {
111
+ const t = S(this, "aria-label"), e = this.getDefaultSlotElement();
112
+ return (e == null ? void 0 : e.textContent) || t || "";
113
+ }
114
+ handleKeyDown(t) {
115
+ var l;
116
+ const e = (l = this.segmentedControlContext) == null ? void 0 : l.registeredItems.map(
117
+ (a) => a.value
118
+ );
119
+ if (!e)
120
+ return;
121
+ const n = e.indexOf(this.value);
122
+ let s = this.value;
123
+ const o = I(this);
124
+ let i = t.key;
125
+ switch (o === "rtl" && (i === "ArrowLeft" ? i = "ArrowRight" : i === "ArrowRight" && (i = "ArrowLeft")), i) {
126
+ case "ArrowDown":
127
+ case "ArrowRight":
128
+ s = this.findNextEnabledItem(e, n, 1);
129
+ break;
130
+ case "ArrowUp":
131
+ case "ArrowLeft":
132
+ s = this.findNextEnabledItem(e, n, -1);
133
+ break;
134
+ case " ":
135
+ case "Enter":
136
+ this.isDisabled() || (this.dispatchItemSelectedEvent(this.value), t.preventDefault());
137
+ return;
138
+ default:
139
+ return;
140
+ }
141
+ s !== this.value && (t.preventDefault(), this.focusItemWithValue(s));
142
+ }
143
+ focusItemWithValue(t) {
144
+ var n, s;
145
+ const e = (n = this.segmentedControlContext) == null ? void 0 : n.registeredItems.find(
146
+ (o) => o.value === t
147
+ );
148
+ if (e) {
149
+ const o = (s = e.shadowRoot) == null ? void 0 : s.querySelector("button");
150
+ o && o.focus();
151
+ }
152
+ }
153
+ handleClick() {
154
+ !this.isDisabled() && this.segmentedControlContext && this.dispatchItemSelectedEvent(this.value);
155
+ }
156
+ setupOverflowObserver() {
157
+ this._contentRef && (this._overflowObserver = new R(
158
+ this._contentRef,
159
+ (t) => {
160
+ this.isContentOverflowing = t;
161
+ }
162
+ ));
163
+ }
164
+ cleanupOverflowObserver() {
165
+ var t;
166
+ (t = this._overflowObserver) == null || t.disconnect();
167
+ }
168
+ findNextEnabledItem(t, e, n) {
169
+ var l;
170
+ const s = Array.from(((l = this.segmentedControlContext) == null ? void 0 : l.registeredItems) || []);
171
+ if (!s.length) return this.value;
172
+ const o = t.length;
173
+ let i = (e + n + o) % o;
174
+ for (; i !== e; ) {
175
+ const a = s.find((d) => d.value === t[i]);
176
+ if (a && !a.disabled)
177
+ return t[i];
178
+ i = (i + n + o) % o;
179
+ }
180
+ return this.value;
181
+ }
182
+ dispatchItemSelectedEvent(t) {
183
+ this.dispatchEvent(
184
+ new CustomEvent("bm-selected", {
185
+ detail: { value: t },
186
+ bubbles: !0,
187
+ composed: !0
188
+ })
189
+ );
190
+ }
191
+ getClassName() {
192
+ var f;
193
+ const { fluid: t, selectedValue: e, size: n = "md" } = this.segmentedControlContext || {}, s = this.isDisabled(), o = e === this.value, i = (((f = this.segmentedControlContext) == null ? void 0 : f.registeredItems) || []).map(
194
+ (g) => g.value
195
+ ), l = i.indexOf(this.value), a = l === 0, d = i.length > 0 && l === i.length - 1;
196
+ return b(
197
+ r,
198
+ n && `${r}--${n}`,
199
+ s && `${r}--disabled`,
200
+ o && `${r}--selected`,
201
+ t && `${r}--fluid`,
202
+ a && `${r}--first`,
203
+ d && !a && `${r}--last`,
204
+ this.hasIcon && !this.hasContent && `${r}--iconOnly`
205
+ );
206
+ }
207
+ render() {
208
+ const { selectedValue: t } = this.segmentedControlContext || {}, e = this.isDisabled(), n = t === this.value;
209
+ this.hasIcon = this.querySelector('[slot="icon"]') !== null, this.hasContent = this.hasDefaultSlotContent();
210
+ const s = this.getClassName(), o = b(
211
+ N(),
212
+ `${r}__state-layer`
213
+ );
214
+ return u`
215
+ <bm-tooltip
216
+ placement="top"
217
+ .disabled=${e || !this.shouldShowTooltip()}
218
+ .defaultOpen=${!1}
219
+ >
220
+ <span slot="text">${this.getTooltipText()}</span>
221
+ <button
222
+ slot="trigger"
223
+ class=${s}
224
+ data-floating-anchor
225
+ tabindex=${n ? "0" : "-1"}
226
+ aria-label=${this.getTooltipText()}
227
+ @keydown=${this.handleKeyDown}
228
+ @click=${this.handleClick}
229
+ >
230
+ <span class=${`${r}__content`}>
231
+ ${this.hasIcon ? u`<span class=${`${r}__icon`}>
232
+ <slot name="icon"></slot>
233
+ </span>` : p}
234
+ ${this.hasContent ? u`<span class="${r}__controlText">
235
+ <slot></slot>
236
+ </span>` : p}
237
+ </span>
238
+ ${e ? p : u`<span id="stateLayer" class=${o}></span>`}
239
+ </button>
240
+ </bm-tooltip>
241
+ `;
242
+ }
243
+ };
244
+ h.styles = [
245
+ w(A),
246
+ D,
247
+ /**
248
+ * In order to ensure the overflow observer works with wrappers we need to
249
+ * mount these styles to the host element. This ensures we lock the width of
250
+ * the item to the content width.
251
+ */
252
+ x`
253
+ :host {
254
+ flex-shrink: 1;
255
+ min-width: 0;
256
+ display: flex;
257
+ }
258
+ `
259
+ ];
260
+ c([
261
+ m({ type: String })
262
+ ], h.prototype, "value", 2);
263
+ c([
264
+ m({ type: Boolean })
265
+ ], h.prototype, "disabled", 2);
266
+ c([
267
+ C()
268
+ ], h.prototype, "selected", 2);
269
+ c([
270
+ C()
271
+ ], h.prototype, "isContentOverflowing", 2);
272
+ c([
273
+ v({ context: k, subscribe: !0 }),
274
+ m({ attribute: !1 })
275
+ ], h.prototype, "segmentedControlContext", 2);
276
+ c([
277
+ O(`.${r}__controlText`)
278
+ ], h.prototype, "_contentRef", 2);
279
+ h = c([
280
+ y("bm-segmented-control-item")
281
+ ], h);
282
+ export {
283
+ h as BmSegmentedControlItem
284
+ };
@@ -0,0 +1,59 @@
1
+ import { c as d } from "../chunks/consume.Ce9k1-wN.js";
2
+ import { r as c, a as C, x as p } from "../chunks/lit-element.CJtt9wj5.js";
3
+ import { n as u, c as f } from "../chunks/register-custom-element.vod7zfGv.js";
4
+ import { c as g, g as h } from "../chunks/classNames.C6fNrXWF.js";
5
+ import "../chunks/constants.jOWREYQE.js";
6
+ import { s as x } from "../chunks/segmentedControl.module.BPXEWodj.js";
7
+ import { segmentedControlContext as b } from "./SegmentedControl.context.js";
8
+ var v = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, a = (s, t, o, n) => {
9
+ for (var e = n > 1 ? void 0 : n ? _(t, o) : t, l = s.length - 1, m; l >= 0; l--)
10
+ (m = s[l]) && (e = (n ? m(t, o, e) : m(e)) || e);
11
+ return n && e && v(t, o, e), e;
12
+ };
13
+ const { subElementClassPrefix: i } = h("segmented-control");
14
+ let r = class extends C {
15
+ /**
16
+ * Necessary for initializing the controlItems array and setting the initial selected value
17
+ */
18
+ _handleSlotChange() {
19
+ var s;
20
+ if (this.segmentedControlContext && !((s = this.segmentedControlContext) != null && s.selectedValue)) {
21
+ const o = (this.segmentedControlContext.registeredItems || []).find(
22
+ (e) => {
23
+ var l;
24
+ return !e.disabled && !((l = this.segmentedControlContext) != null && l.disabled);
25
+ }
26
+ ), n = (o == null ? void 0 : o.value) || "";
27
+ n && this.dispatchEvent(
28
+ new CustomEvent("bm-selected", {
29
+ detail: { value: n },
30
+ bubbles: !0,
31
+ composed: !0
32
+ })
33
+ );
34
+ }
35
+ }
36
+ render() {
37
+ var t;
38
+ const s = g(
39
+ `${i}list`,
40
+ ((t = this.segmentedControlContext) == null ? void 0 : t.fluid) && `${i}list--fluid`
41
+ );
42
+ return p`
43
+ <div class=${s} part="list">
44
+ <slot @slotchange=${this._handleSlotChange}></slot>
45
+ </div>
46
+ `;
47
+ }
48
+ };
49
+ r.styles = c(x);
50
+ a([
51
+ d({ context: b, subscribe: !0 }),
52
+ u({ attribute: !1 })
53
+ ], r.prototype, "segmentedControlContext", 2);
54
+ r = a([
55
+ f("bm-segmented-control-list")
56
+ ], r);
57
+ export {
58
+ r as BmSegmentedControlList
59
+ };
@@ -0,0 +1,41 @@
1
+ import { c as p } from "../chunks/consume.Ce9k1-wN.js";
2
+ import { r as i, a as u, x as d } from "../chunks/lit-element.CJtt9wj5.js";
3
+ import { n as c, c as f } from "../chunks/register-custom-element.vod7zfGv.js";
4
+ import { c as C, g } from "../chunks/classNames.C6fNrXWF.js";
5
+ import "../chunks/constants.jOWREYQE.js";
6
+ import { s as v } from "../chunks/segmentedControl.module.BPXEWodj.js";
7
+ import { segmentedControlContext as b } from "./SegmentedControl.context.js";
8
+ var x = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, m = (r, e, o, t) => {
9
+ for (var s = t > 1 ? void 0 : t ? _(e, o) : e, n = r.length - 1, a; n >= 0; n--)
10
+ (a = r[n]) && (s = (t ? a(e, o, s) : a(s)) || s);
11
+ return t && s && x(e, o, s), s;
12
+ };
13
+ const { subElementClassPrefix: P } = g("segmented-control");
14
+ let l = class extends u {
15
+ constructor() {
16
+ super(...arguments), this.value = "";
17
+ }
18
+ render() {
19
+ var t;
20
+ const r = ((t = this.segmentedControlContext) == null ? void 0 : t.selectedValue) === this.value, e = `${P}panel`, o = C(e, r && `${e}--selected`);
21
+ return d`
22
+ <div class=${o} part="panel" aria-disabled=${!r}>
23
+ <slot></slot>
24
+ </div>
25
+ `;
26
+ }
27
+ };
28
+ l.styles = i(v);
29
+ m([
30
+ c({ type: String })
31
+ ], l.prototype, "value", 2);
32
+ m([
33
+ p({ context: b, subscribe: !0 }),
34
+ c({ attribute: !1 })
35
+ ], l.prototype, "segmentedControlContext", 2);
36
+ l = m([
37
+ f("bm-segmented-control-panel")
38
+ ], l);
39
+ export {
40
+ l as BmSegmentedControlPanel
41
+ };
@@ -0,0 +1,10 @@
1
+ import { BmSegmentedControl as t } from "./SegmentedControl.js";
2
+ import { BmSegmentedControlItem as r } from "./SegmentedControlItem.js";
3
+ import { BmSegmentedControlList as l } from "./SegmentedControlList.js";
4
+ import { BmSegmentedControlPanel as f } from "./SegmentedControlPanel.js";
5
+ export {
6
+ t as BmSegmentedControl,
7
+ r as BmSegmentedControlItem,
8
+ l as BmSegmentedControlList,
9
+ f as BmSegmentedControlPanel
10
+ };