@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,203 @@
1
+ import { consume as B } from "@lit/context";
2
+ import { unsafeCSS as T, LitElement as L, html as r, nothing as u } from "lit";
3
+ import { property as p } from "lit/decorators.js";
4
+ import { createRef as _, ref as C } from "lit/directives/ref.js";
5
+ import { unsafeSVG as y } from "lit/directives/unsafe-svg.js";
6
+ import M from "clsx";
7
+ import { C as R, E as W } from "../../chunks/HelperText.CcVVOtA3.js";
8
+ import { g as D } from "../../chunks/classNames.Cq_tbDRp.js";
9
+ import { t as H, p as U } from "../../chunks/constants.jOWREYQE.js";
10
+ import { f as O } from "../../chunks/fileUpload.module.kN6o64aL.js";
11
+ import { a as V, c as k } from "../../chunks/tokens.CTW8Tt94.js";
12
+ import { c as A } from "../../chunks/register-custom-element.DHGKOhmA.js";
13
+ import { fileUploadListContext as G } from "./FileUploadListContext.js";
14
+ import "../../Icon/Icon.js";
15
+ import "../../Tooltip/Tooltip.js";
16
+ import "../../CloseButton/CloseButton.js";
17
+ import "../../ProgressBar/ProgressBar.js";
18
+ const Z = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
19
+ <g clip-path="url(#clip0_501_2445)">
20
+ <path
21
+ d="M14 2H6C4.9 2 4.01 2.9 4.01 4L4 20C4 21.1 4.89 22 5.99 22H18C19.1 22 20 21.1 20 20V8L14 2ZM6 20V4H13V9H18V20H6Z"
22
+ fill="currentColor"
23
+ />
24
+ </g>
25
+ <defs>
26
+ <clipPath id="clip0_501_2445">
27
+ <rect width="24" height="24" fill="none" />
28
+ </clipPath>
29
+ </defs>
30
+ </svg>
31
+ `;
32
+ var q = Object.defineProperty, J = Object.getOwnPropertyDescriptor, x = (t) => {
33
+ throw TypeError(t);
34
+ }, o = (t, e, s, m) => {
35
+ for (var l = m > 1 ? void 0 : m ? J(e, s) : e, $ = t.length - 1, v; $ >= 0; $--)
36
+ (v = t[$]) && (l = (m ? v(e, s, l) : v(l)) || l);
37
+ return m && l && q(e, s, l), l;
38
+ }, S = (t, e, s) => e.has(t) || x("Cannot " + s), h = (t, e, s) => (S(t, e, "read from private field"), s ? s.call(t) : e.get(t)), g = (t, e, s) => e.has(t) ? x("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), c = (t, e, s) => (S(t, e, "access private method"), s), f, a, z, E, N, w, I, P, F, d;
39
+ const { baseClassNamePrefix: K, subElementClassPrefix: n, classModifierPrefix: b } = D("file-upload-list-item"), Q = {
40
+ error: { customIconColor: k, icon: W },
41
+ success: {
42
+ customIconColor: V,
43
+ icon: R
44
+ }
45
+ };
46
+ let i = class extends L {
47
+ constructor() {
48
+ super(...arguments), g(this, a), this.error = "", this.size = "md", this.state = "uploaded", this.progress = 0, g(this, f, () => {
49
+ var t;
50
+ return !!(this.disabled || (t = this.listContext) != null && t.ctxDisabled);
51
+ }), this.tooltipRef = _(), this.fileNameRef = _(), g(this, d, () => {
52
+ var t;
53
+ return ((t = this.listContext) == null ? void 0 : t.ctxSize) ?? this.size ?? "md";
54
+ });
55
+ }
56
+ render() {
57
+ const { ctxThumbnail: t } = this.listContext ?? {}, e = t === !1 ? !1 : this.thumbnail ?? t ?? !1, s = M(
58
+ K,
59
+ this.theme && H(this.theme),
60
+ `${b}${h(this, d).call(this)}`,
61
+ `${b}${this.state}`,
62
+ h(this, f).call(this) && `${b}disabled`
63
+ );
64
+ return r`
65
+ <div class=${s}>
66
+ ${c(this, a, z).call(this, e)}
67
+ <div class=${`${n}content`}>
68
+ <div class=${`${n}content-start`}>
69
+ ${c(this, a, E).call(this)} ${c(this, a, N).call(this)} ${c(this, a, w).call(this)}
70
+ </div>
71
+ <div class=${`${n}content-end`}>
72
+ ${c(this, a, I).call(this)} ${c(this, a, P).call(this)}
73
+ </div>
74
+ </div>
75
+ ${c(this, a, F).call(this)}
76
+ </div>
77
+ `;
78
+ }
79
+ };
80
+ f = /* @__PURE__ */ new WeakMap();
81
+ a = /* @__PURE__ */ new WeakSet();
82
+ z = function(t) {
83
+ return t ? r`
84
+ <div class=${`${n}thumbnail`}>
85
+ ${t === !0 ? r`<bm-icon
86
+ color="secondary"
87
+ icon="image"
88
+ size="${h(this, d).call(this) === "md" ? "sm" : "md"}"
89
+ >
90
+ ${y(Z)}
91
+ </bm-icon>` : r`<img src=${t} alt=${this.fileName} />`}
92
+ </div>
93
+ ` : u;
94
+ };
95
+ E = function() {
96
+ return r`
97
+ <bm-tooltip @bm-toggle=${() => {
98
+ const e = this.fileNameRef.value, s = this.tooltipRef.value;
99
+ if (!e || !s)
100
+ return;
101
+ const { offsetWidth: m, scrollWidth: l } = e;
102
+ l <= m && (s.open = !1);
103
+ }} ${C(this.tooltipRef)}>
104
+ <span slot="text">${this.fileName}</span>
105
+ <span
106
+ slot="trigger"
107
+ class=${`${n}filename`}
108
+ ${C(this.fileNameRef)}
109
+ >
110
+ ${this.fileName}
111
+ </span>
112
+ </bm-tooltip>
113
+ `;
114
+ };
115
+ N = function() {
116
+ return r`<p class=${`${n}size`}>${this.fileSize}</p>`;
117
+ };
118
+ w = function() {
119
+ return !this.error || this.state !== "error" ? u : r` <bm-helper-text
120
+ hideIcon
121
+ appearance="negative"
122
+ size="sm"
123
+ class=${`${n}error`}
124
+ text=${this.error}
125
+ ></bm-helper-text>`;
126
+ };
127
+ I = function() {
128
+ const t = Q[this.state];
129
+ return t ? r`<div class=${`${n}status`}>
130
+ <bm-icon customIconColor=${t.customIconColor} size="sm"
131
+ >${y(t.icon)}</bm-icon
132
+ >
133
+ </div>` : u;
134
+ };
135
+ P = function() {
136
+ const t = (e) => {
137
+ e.stopPropagation();
138
+ const s = new CustomEvent(`${U}dismiss`, {
139
+ bubbles: !0,
140
+ composed: !0
141
+ });
142
+ this.dispatchEvent(s);
143
+ };
144
+ return r`<bm-close-button
145
+ size="sm"
146
+ ?disabled=${h(this, f).call(this)}
147
+ class=${`${n}remove`}
148
+ @click=${t}
149
+ ></bm-button>`;
150
+ };
151
+ F = function() {
152
+ return this.state === "uploading" ? r`<bm-progress-bar
153
+ size="sm"
154
+ value=${this.progress}
155
+ state="active"
156
+ fullWidth
157
+ class=${`${n}progress-bar`}
158
+ progressbarAriaLabel="File upload progress"
159
+ ></bm-progress-bar>` : u;
160
+ };
161
+ d = /* @__PURE__ */ new WeakMap();
162
+ i.styles = T(O);
163
+ o([
164
+ p({ type: String })
165
+ ], i.prototype, "error", 2);
166
+ o([
167
+ p({ type: String })
168
+ ], i.prototype, "fileName", 2);
169
+ o([
170
+ p({ type: String })
171
+ ], i.prototype, "fileSize", 2);
172
+ o([
173
+ p({ type: String })
174
+ ], i.prototype, "size", 2);
175
+ o([
176
+ p({
177
+ type: String,
178
+ converter(t) {
179
+ return t === "true" || t === "" ? !0 : t === "false" ? !1 : t;
180
+ }
181
+ })
182
+ ], i.prototype, "thumbnail", 2);
183
+ o([
184
+ p({ type: String })
185
+ ], i.prototype, "state", 2);
186
+ o([
187
+ p({ type: Number })
188
+ ], i.prototype, "progress", 2);
189
+ o([
190
+ p({ type: String })
191
+ ], i.prototype, "theme", 2);
192
+ o([
193
+ p({ type: Boolean })
194
+ ], i.prototype, "disabled", 2);
195
+ o([
196
+ B({ context: G, subscribe: !0 })
197
+ ], i.prototype, "listContext", 2);
198
+ i = o([
199
+ A("bm-file-upload-list-item")
200
+ ], i);
201
+ export {
202
+ i as BmFileUploadListItem
203
+ };
@@ -0,0 +1,46 @@
1
+ import { LitElement } from 'lit';
2
+ import { FileItem, FileUploadListSize } from '@viasat/beam-shared/components/fileUpload';
3
+ import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
4
+ /**
5
+ * `bm-file-upload-list`
6
+ *
7
+ * @slot default - Specify the list items
8
+ */
9
+ export declare class BmFileUploadList extends LitElement {
10
+ #private;
11
+ static styles: import('lit').CSSResult;
12
+ /**
13
+ * Specify if the all items displays with a default thumbnail or a preview of the image being uploaded. Image only displays for size lg.
14
+ * @default false
15
+ */
16
+ thumbnail?: boolean;
17
+ /**
18
+ * Specify FileUpload List size
19
+ * @default 'md'
20
+ */
21
+ size?: FileUploadListSize;
22
+ /**
23
+ * Specify the theme of the FileUpload. By default it inherits the theme from the parent
24
+ */
25
+ theme?: ThemeTypes;
26
+ /**
27
+ * Specify if the FileUpload is disabled
28
+ */
29
+ disabled?: boolean;
30
+ /**
31
+ * Specify a render function for the list item
32
+ */
33
+ renderItem?: (fileItem: FileItem, dismissFile: () => void) => void;
34
+ private listContext?;
35
+ private fileUploadContext?;
36
+ willUpdate(): void;
37
+ private internalRenderItem;
38
+ private handleSlotChange;
39
+ render(): import('lit-html').TemplateResult<1>;
40
+ }
41
+ declare global {
42
+ interface HTMLElementTagNameMap {
43
+ 'bm-file-upload-list': BmFileUploadList;
44
+ }
45
+ }
46
+ //# sourceMappingURL=FileUpload.List.d.ts.map
@@ -0,0 +1,106 @@
1
+ import { provide as c, consume as u } from "@lit/context";
2
+ import { unsafeCSS as x, LitElement as C, html as m } from "lit";
3
+ import { property as n } from "lit/decorators.js";
4
+ import v from "clsx";
5
+ import { g as b } from "../../chunks/classNames.Cq_tbDRp.js";
6
+ import { t as g } from "../../chunks/constants.jOWREYQE.js";
7
+ import { f as y } from "../../chunks/fileUpload.module.kN6o64aL.js";
8
+ import { c as _ } from "../../chunks/register-custom-element.DHGKOhmA.js";
9
+ import { fileUploadContext as S } from "./FileUploadContext.js";
10
+ import { fileUploadListContext as $ } from "./FileUploadListContext.js";
11
+ import "./FileUpload.List.Item.js";
12
+ var U = Object.defineProperty, w = Object.getOwnPropertyDescriptor, h = (t) => {
13
+ throw TypeError(t);
14
+ }, a = (t, e, s, r) => {
15
+ for (var o = r > 1 ? void 0 : r ? w(e, s) : e, l = t.length - 1, p; l >= 0; l--)
16
+ (p = t[l]) && (o = (r ? p(e, s, o) : p(o)) || o);
17
+ return r && o && U(e, s, o), o;
18
+ }, z = (t, e, s) => e.has(t) || h("Cannot " + s), E = (t, e, s) => (z(t, e, "read from private field"), s ? s.call(t) : e.get(t)), N = (t, e, s) => e.has(t) ? h("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), d;
19
+ const { baseClassNamePrefix: P, classModifierPrefix: f } = b("file-upload-list");
20
+ let i = class extends C {
21
+ constructor() {
22
+ super(...arguments), this.fileUploadContext = {}, N(this, d, () => {
23
+ var t;
24
+ return !!(this.disabled || (t = this.fileUploadContext) != null && t.ctxDisabled);
25
+ });
26
+ }
27
+ willUpdate() {
28
+ this.listContext = {
29
+ ctxSize: this.size ?? "md",
30
+ ctxThumbnail: this.thumbnail,
31
+ ctxDisabled: E(this, d).call(this)
32
+ };
33
+ }
34
+ internalRenderItem(t, e) {
35
+ return m`
36
+ <bm-file-upload-list-item
37
+ fileName=${t.fileName}
38
+ fileSize=${t.fileSize}
39
+ error=${t.error}
40
+ thumbnail=${t.thumbnail}
41
+ state=${t.state}
42
+ progress=${t.progress}
43
+ @bm-dismiss=${e}
44
+ ></bm-file-upload-list-item>
45
+ `;
46
+ }
47
+ handleSlotChange(t) {
48
+ const s = t.target.assignedElements(), { ctxFileItems: r } = this.fileUploadContext ?? {};
49
+ r && (s.length > 0 && console.warn(
50
+ "Ignoring assigned elements in <bm-file-upload-list> when used inside a <bm-file-upload> component"
51
+ ), s.forEach((o) => o.remove()));
52
+ }
53
+ render() {
54
+ const { ctxSize: t = "md", ctxDisabled: e } = this.listContext ?? {}, s = v(
55
+ P,
56
+ this.theme && g(this.theme),
57
+ `${f}${t || "md"}`,
58
+ e && `${f}disabled`
59
+ ), { ctxFileItems: r, ctxDismissFile: o } = this.fileUploadContext ?? {};
60
+ return m`
61
+ <div class=${s}>
62
+ <slot @slotchange=${this.handleSlotChange}></slot>
63
+ ${r == null ? void 0 : r.map(
64
+ (l) => (this.renderItem ?? this.internalRenderItem)(
65
+ l,
66
+ () => o == null ? void 0 : o(l)
67
+ )
68
+ )}
69
+ </div>
70
+ `;
71
+ }
72
+ };
73
+ d = /* @__PURE__ */ new WeakMap();
74
+ i.styles = x(y);
75
+ a([
76
+ n({
77
+ type: String,
78
+ converter(t) {
79
+ return t === "true" ? !0 : t === "false" ? !1 : t;
80
+ }
81
+ })
82
+ ], i.prototype, "thumbnail", 2);
83
+ a([
84
+ n({ type: String })
85
+ ], i.prototype, "size", 2);
86
+ a([
87
+ n({ type: String })
88
+ ], i.prototype, "theme", 2);
89
+ a([
90
+ n({ type: Boolean })
91
+ ], i.prototype, "disabled", 2);
92
+ a([
93
+ n({ type: Function })
94
+ ], i.prototype, "renderItem", 2);
95
+ a([
96
+ c({ context: $ })
97
+ ], i.prototype, "listContext", 2);
98
+ a([
99
+ u({ context: S, subscribe: !0 })
100
+ ], i.prototype, "fileUploadContext", 2);
101
+ i = a([
102
+ _("bm-file-upload-list")
103
+ ], i);
104
+ export {
105
+ i as BmFileUploadList
106
+ };
@@ -0,0 +1,101 @@
1
+ import { FileActions } from '@viasat/beam-shared/components/fileUpload';
2
+ import { FormValidator } from '@viasat/beam-shared/components/form';
3
+ import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
4
+ import { BmFormContext } from '../Form/Form.context';
5
+ import { FormField } from '../Form/Form.decorator';
6
+ import { BmFileUploadButton } from './FileUpload.Button';
7
+ import { BmFileUploadDropzone } from './FileUpload.Dropzone';
8
+ export declare class BmFileUploadFileSelectedEvent extends CustomEvent<{
9
+ file: File;
10
+ actions: FileActions;
11
+ abortSignal: AbortSignal;
12
+ }> {
13
+ constructor(file: File, actions: FileActions, abortSignal: AbortSignal);
14
+ }
15
+ /**
16
+ * `bm-file-upload`
17
+ *
18
+ * @fires bm-selected - Dispatched when a file is uploaded. Preventing default on this event will make upload asynchronous
19
+ * @slot label - Specify Label for for FileUpload
20
+ * @slot helper-text - Specify HelperText for FileUpload
21
+ */
22
+ export declare class BmFileUpload extends FormField {
23
+ #private;
24
+ static styles: import('lit').CSSResult;
25
+ /**
26
+ * Specify what types of files can be uploaded
27
+ */
28
+ accept?: string;
29
+ /**
30
+ * Specify error text and display error state of FileUpload
31
+ */
32
+ error?: string | boolean;
33
+ /**
34
+ * Specify if FileUpload is in disabled state
35
+ */
36
+ disabled?: boolean;
37
+ /**
38
+ * Specify if more than one file can be can be uploaded
39
+ * @default false
40
+ */
41
+ multiple?: boolean;
42
+ /**
43
+ * Specify how many files can be uploaded
44
+ */
45
+ fileLimit?: number;
46
+ /**
47
+ * Specify the maximum file size that can be uploaded
48
+ */
49
+ maxFileSize?: number;
50
+ /**
51
+ * Specify if FileUpload is a required input
52
+ * @default false
53
+ */
54
+ required?: boolean;
55
+ /**
56
+ * Specify if FileUpload is in read-only state
57
+ */
58
+ readOnly?: boolean;
59
+ /**
60
+ * Specify if FileUpload displays with an asterisk
61
+ * @default false
62
+ */
63
+ hideRequiredMarker?: boolean;
64
+ /**
65
+ * Specify form validation rules for FileUpload
66
+ */
67
+ validationRules: Array<FormValidator>;
68
+ /**
69
+ * Specify if FileUpload is fluid
70
+ * @default false
71
+ */
72
+ fluid?: boolean;
73
+ /**
74
+ * Specify the width of FileUpload
75
+ */
76
+ width?: string;
77
+ /**
78
+ * Specify the theme of the FileUpload. By default it inherits the theme from the parent
79
+ */
80
+ theme?: ThemeTypes;
81
+ formContext: BmFormContext;
82
+ private fileUploadContext;
83
+ pickerRef: import('lit-html/directives/ref').Ref<BmFileUploadButton | BmFileUploadDropzone>;
84
+ private _textFieldLabel;
85
+ private _textFieldHelperText;
86
+ private filesState;
87
+ willUpdate(): void;
88
+ firstUpdated(): void;
89
+ updated(changedProps: Map<string, unknown>): void;
90
+ formAssociatedCallback(): void;
91
+ formResetCallback(): void;
92
+ private _hasPickerSlot;
93
+ private _hasFilesListSlot;
94
+ render(): import('lit-html').TemplateResult<1>;
95
+ }
96
+ declare global {
97
+ interface HTMLElementTagNameMap {
98
+ 'bm-file-upload': BmFileUpload;
99
+ }
100
+ }
101
+ //# sourceMappingURL=FileUpload.d.ts.map