@hashicorp/design-system-components 4.6.0 → 4.7.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 (336) hide show
  1. package/addon-main.cjs +16 -1
  2. package/declarations/components/hds/app-footer/status-link.d.ts +1 -1
  3. package/declarations/components/hds/badge/index.d.ts +2 -2
  4. package/declarations/components/hds/badge/index.d.ts.map +1 -1
  5. package/declarations/components/hds/button/index.d.ts +1 -1
  6. package/declarations/components/hds/button/index.d.ts.map +1 -1
  7. package/declarations/components/hds/dialog-primitive/body.d.ts +17 -0
  8. package/declarations/components/hds/dialog-primitive/body.d.ts.map +1 -0
  9. package/declarations/components/hds/dialog-primitive/description.d.ts +17 -0
  10. package/declarations/components/hds/dialog-primitive/description.d.ts.map +1 -0
  11. package/declarations/components/hds/dialog-primitive/footer.d.ts +22 -0
  12. package/declarations/components/hds/dialog-primitive/footer.d.ts.map +1 -0
  13. package/declarations/components/hds/dialog-primitive/header.d.ts +28 -0
  14. package/declarations/components/hds/dialog-primitive/header.d.ts.map +1 -0
  15. package/declarations/components/hds/dialog-primitive/overlay.d.ts +14 -0
  16. package/declarations/components/hds/dialog-primitive/overlay.d.ts.map +1 -0
  17. package/declarations/components/hds/dialog-primitive/wrapper.d.ts +16 -0
  18. package/declarations/components/hds/dialog-primitive/wrapper.d.ts.map +1 -0
  19. package/declarations/components/hds/dropdown/list-item/checkbox.d.ts +1 -1
  20. package/declarations/components/hds/dropdown/list-item/checkbox.d.ts.map +1 -1
  21. package/declarations/components/hds/dropdown/list-item/radio.d.ts +1 -1
  22. package/declarations/components/hds/dropdown/list-item/radio.d.ts.map +1 -1
  23. package/declarations/components/hds/flyout/body.d.ts +14 -1
  24. package/declarations/components/hds/flyout/body.d.ts.map +1 -1
  25. package/declarations/components/hds/flyout/description.d.ts +15 -0
  26. package/declarations/components/hds/flyout/description.d.ts.map +1 -1
  27. package/declarations/components/hds/flyout/footer.d.ts +19 -0
  28. package/declarations/components/hds/flyout/footer.d.ts.map +1 -1
  29. package/declarations/components/hds/flyout/header.d.ts +21 -1
  30. package/declarations/components/hds/flyout/header.d.ts.map +1 -1
  31. package/declarations/components/hds/flyout/index.d.ts +42 -12
  32. package/declarations/components/hds/flyout/index.d.ts.map +1 -1
  33. package/declarations/components/hds/flyout/types.d.ts +6 -0
  34. package/declarations/components/hds/flyout/types.d.ts.map +1 -0
  35. package/declarations/components/hds/form/character-count/index.d.ts +37 -10
  36. package/declarations/components/hds/form/character-count/index.d.ts.map +1 -1
  37. package/declarations/components/hds/form/checkbox/base.d.ts +13 -1
  38. package/declarations/components/hds/form/checkbox/base.d.ts.map +1 -1
  39. package/declarations/components/hds/form/checkbox/field.d.ts +28 -1
  40. package/declarations/components/hds/form/checkbox/field.d.ts.map +1 -1
  41. package/declarations/components/hds/form/checkbox/group.d.ts +29 -1
  42. package/declarations/components/hds/form/checkbox/group.d.ts.map +1 -1
  43. package/declarations/components/hds/form/error/index.d.ts +27 -6
  44. package/declarations/components/hds/form/error/index.d.ts.map +1 -1
  45. package/declarations/components/hds/form/error/message.d.ts +14 -1
  46. package/declarations/components/hds/form/error/message.d.ts.map +1 -1
  47. package/declarations/components/hds/form/field/index.d.ts +50 -15
  48. package/declarations/components/hds/form/field/index.d.ts.map +1 -1
  49. package/declarations/components/hds/form/field/types.d.ts +10 -0
  50. package/declarations/components/hds/form/field/types.d.ts.map +1 -0
  51. package/declarations/components/hds/form/fieldset/index.d.ts +43 -14
  52. package/declarations/components/hds/form/fieldset/index.d.ts.map +1 -1
  53. package/declarations/components/hds/form/fieldset/types.d.ts +10 -0
  54. package/declarations/components/hds/form/fieldset/types.d.ts.map +1 -0
  55. package/declarations/components/hds/form/file-input/base.d.ts +10 -1
  56. package/declarations/components/hds/form/file-input/base.d.ts.map +1 -1
  57. package/declarations/components/hds/form/file-input/field.d.ts +25 -1
  58. package/declarations/components/hds/form/file-input/field.d.ts.map +1 -1
  59. package/declarations/components/hds/form/helper-text/index.d.ts +20 -5
  60. package/declarations/components/hds/form/helper-text/index.d.ts.map +1 -1
  61. package/declarations/components/hds/form/indicator/index.d.ts +15 -3
  62. package/declarations/components/hds/form/indicator/index.d.ts.map +1 -1
  63. package/declarations/components/hds/form/label/index.d.ts +20 -4
  64. package/declarations/components/hds/form/label/index.d.ts.map +1 -1
  65. package/declarations/components/hds/form/legend/index.d.ts +18 -3
  66. package/declarations/components/hds/form/legend/index.d.ts.map +1 -1
  67. package/declarations/components/hds/form/masked-input/base.d.ts +26 -5
  68. package/declarations/components/hds/form/masked-input/base.d.ts.map +1 -1
  69. package/declarations/components/hds/form/masked-input/field.d.ts +28 -1
  70. package/declarations/components/hds/form/masked-input/field.d.ts.map +1 -1
  71. package/declarations/components/hds/form/radio/base.d.ts +13 -1
  72. package/declarations/components/hds/form/radio/base.d.ts.map +1 -1
  73. package/declarations/components/hds/form/radio/field.d.ts +28 -1
  74. package/declarations/components/hds/form/radio/field.d.ts.map +1 -1
  75. package/declarations/components/hds/form/radio/group.d.ts +29 -1
  76. package/declarations/components/hds/form/radio/group.d.ts.map +1 -1
  77. package/declarations/components/hds/form/radio-card/description.d.ts +14 -1
  78. package/declarations/components/hds/form/radio-card/description.d.ts.map +1 -1
  79. package/declarations/components/hds/form/radio-card/group.d.ts +32 -1
  80. package/declarations/components/hds/form/radio-card/group.d.ts.map +1 -1
  81. package/declarations/components/hds/form/radio-card/index.d.ts +45 -9
  82. package/declarations/components/hds/form/radio-card/index.d.ts.map +1 -1
  83. package/declarations/components/hds/form/radio-card/label.d.ts +14 -1
  84. package/declarations/components/hds/form/radio-card/label.d.ts.map +1 -1
  85. package/declarations/components/hds/form/radio-card/types.d.ts +15 -0
  86. package/declarations/components/hds/form/radio-card/types.d.ts.map +1 -0
  87. package/declarations/components/hds/form/select/base.d.ts +22 -3
  88. package/declarations/components/hds/form/select/base.d.ts.map +1 -1
  89. package/declarations/components/hds/form/select/field.d.ts +28 -1
  90. package/declarations/components/hds/form/select/field.d.ts.map +1 -1
  91. package/declarations/components/hds/form/text-input/base.d.ts +22 -6
  92. package/declarations/components/hds/form/text-input/base.d.ts.map +1 -1
  93. package/declarations/components/hds/form/text-input/field.d.ts +36 -7
  94. package/declarations/components/hds/form/text-input/field.d.ts.map +1 -1
  95. package/declarations/components/hds/form/text-input/types.d.ts +19 -0
  96. package/declarations/components/hds/form/text-input/types.d.ts.map +1 -0
  97. package/declarations/components/hds/form/textarea/base.d.ts +15 -3
  98. package/declarations/components/hds/form/textarea/base.d.ts.map +1 -1
  99. package/declarations/components/hds/form/textarea/field.d.ts +28 -1
  100. package/declarations/components/hds/form/textarea/field.d.ts.map +1 -1
  101. package/declarations/components/hds/form/toggle/base.d.ts +13 -1
  102. package/declarations/components/hds/form/toggle/base.d.ts.map +1 -1
  103. package/declarations/components/hds/form/toggle/field.d.ts +27 -1
  104. package/declarations/components/hds/form/toggle/field.d.ts.map +1 -1
  105. package/declarations/components/hds/form/toggle/group.d.ts +29 -1
  106. package/declarations/components/hds/form/toggle/group.d.ts.map +1 -1
  107. package/declarations/components/hds/form/visibility-toggle/index.d.ts +15 -1
  108. package/declarations/components/hds/form/visibility-toggle/index.d.ts.map +1 -1
  109. package/declarations/components/hds/modal/body.d.ts +14 -1
  110. package/declarations/components/hds/modal/body.d.ts.map +1 -1
  111. package/declarations/components/hds/modal/footer.d.ts +19 -1
  112. package/declarations/components/hds/modal/footer.d.ts.map +1 -1
  113. package/declarations/components/hds/modal/header.d.ts +21 -1
  114. package/declarations/components/hds/modal/header.d.ts.map +1 -1
  115. package/declarations/components/hds/modal/index.d.ts +44 -15
  116. package/declarations/components/hds/modal/index.d.ts.map +1 -1
  117. package/declarations/components/hds/modal/types.d.ts +17 -0
  118. package/declarations/components/hds/modal/types.d.ts.map +1 -0
  119. package/declarations/components/hds/stepper/task/indicator.d.ts +1 -1
  120. package/declarations/components/hds/stepper/task/indicator.d.ts.map +1 -1
  121. package/declarations/components.d.ts +57 -1
  122. package/declarations/components.d.ts.map +1 -1
  123. package/declarations/instance-initializers/load-sprite.d.ts +13 -0
  124. package/declarations/instance-initializers/load-sprite.d.ts.map +1 -0
  125. package/declarations/modifiers/hds-clipboard.d.ts +2 -2
  126. package/declarations/modifiers/hds-clipboard.d.ts.map +1 -1
  127. package/declarations/template-registry.d.ts +144 -0
  128. package/declarations/template-registry.d.ts.map +1 -1
  129. package/declarations/utils/hds-aria-described-by.d.ts +6 -8
  130. package/declarations/utils/hds-aria-described-by.d.ts.map +1 -1
  131. package/declarations/utils/hds-get-element-id.d.ts +5 -1
  132. package/declarations/utils/hds-get-element-id.d.ts.map +1 -1
  133. package/dist/_app_/components/hds/dialog-primitive/body.js +1 -0
  134. package/dist/_app_/components/hds/dialog-primitive/description.js +1 -0
  135. package/dist/_app_/components/hds/dialog-primitive/footer.js +1 -0
  136. package/dist/_app_/components/hds/dialog-primitive/header.js +1 -0
  137. package/dist/_app_/components/hds/dialog-primitive/overlay.js +1 -0
  138. package/dist/_app_/components/hds/dialog-primitive/wrapper.js +1 -0
  139. package/dist/components/hds/alert/description.js +2 -2
  140. package/dist/components/hds/alert/description.js.map +1 -1
  141. package/dist/components/hds/alert/title.js +2 -2
  142. package/dist/components/hds/alert/title.js.map +1 -1
  143. package/dist/components/hds/application-state/body.js +2 -2
  144. package/dist/components/hds/application-state/body.js.map +1 -1
  145. package/dist/components/hds/application-state/header.js +2 -2
  146. package/dist/components/hds/application-state/header.js.map +1 -1
  147. package/dist/components/hds/application-state/index.js +2 -2
  148. package/dist/components/hds/application-state/index.js.map +1 -1
  149. package/dist/components/hds/badge/index.js.map +1 -1
  150. package/dist/components/hds/button-set/index.js +2 -2
  151. package/dist/components/hds/button-set/index.js.map +1 -1
  152. package/dist/components/hds/code-block/copy-button.js +2 -2
  153. package/dist/components/hds/code-block/copy-button.js.map +1 -1
  154. package/dist/components/hds/code-block/description.js +2 -2
  155. package/dist/components/hds/code-block/description.js.map +1 -1
  156. package/dist/components/hds/code-block/title.js +2 -2
  157. package/dist/components/hds/code-block/title.js.map +1 -1
  158. package/dist/components/hds/dialog-primitive/body.js +16 -0
  159. package/dist/components/hds/dialog-primitive/body.js.map +1 -0
  160. package/dist/components/hds/dialog-primitive/description.js +16 -0
  161. package/dist/components/hds/dialog-primitive/description.js.map +1 -0
  162. package/dist/components/hds/dialog-primitive/footer.js +16 -0
  163. package/dist/components/hds/dialog-primitive/footer.js.map +1 -0
  164. package/dist/components/hds/dialog-primitive/header.js +37 -0
  165. package/dist/components/hds/dialog-primitive/header.js.map +1 -0
  166. package/dist/components/hds/dialog-primitive/overlay.js +16 -0
  167. package/dist/components/hds/dialog-primitive/overlay.js.map +1 -0
  168. package/dist/components/hds/dialog-primitive/wrapper.js +16 -0
  169. package/dist/components/hds/dialog-primitive/wrapper.js.map +1 -0
  170. package/dist/components/hds/dropdown/footer.js +2 -2
  171. package/dist/components/hds/dropdown/footer.js.map +1 -1
  172. package/dist/components/hds/dropdown/header.js +2 -2
  173. package/dist/components/hds/dropdown/header.js.map +1 -1
  174. package/dist/components/hds/dropdown/list-item/checkbox.js.map +1 -1
  175. package/dist/components/hds/dropdown/list-item/generic.js +2 -2
  176. package/dist/components/hds/dropdown/list-item/generic.js.map +1 -1
  177. package/dist/components/hds/dropdown/list-item/radio.js.map +1 -1
  178. package/dist/components/hds/dropdown/list-item/separator.js +2 -2
  179. package/dist/components/hds/dropdown/list-item/separator.js.map +1 -1
  180. package/dist/components/hds/dropdown/toggle/chevron.js +2 -2
  181. package/dist/components/hds/dropdown/toggle/chevron.js.map +1 -1
  182. package/dist/components/hds/flyout/body.js +24 -4
  183. package/dist/components/hds/flyout/body.js.map +1 -1
  184. package/dist/components/hds/flyout/description.js +24 -4
  185. package/dist/components/hds/flyout/description.js.map +1 -1
  186. package/dist/components/hds/flyout/footer.js +24 -4
  187. package/dist/components/hds/flyout/footer.js.map +1 -1
  188. package/dist/components/hds/flyout/header.js +24 -4
  189. package/dist/components/hds/flyout/header.js.map +1 -1
  190. package/dist/components/hds/flyout/index.js +19 -11
  191. package/dist/components/hds/flyout/index.js.map +1 -1
  192. package/dist/components/hds/flyout/types.js +8 -0
  193. package/dist/components/hds/flyout/types.js.map +1 -0
  194. package/dist/components/hds/form/character-count/index.js +27 -22
  195. package/dist/components/hds/form/character-count/index.js.map +1 -1
  196. package/dist/components/hds/form/checkbox/base.js +9 -3
  197. package/dist/components/hds/form/checkbox/base.js.map +1 -1
  198. package/dist/components/hds/form/checkbox/field.js +9 -3
  199. package/dist/components/hds/form/checkbox/field.js.map +1 -1
  200. package/dist/components/hds/form/checkbox/group.js +9 -3
  201. package/dist/components/hds/form/checkbox/group.js.map +1 -1
  202. package/dist/components/hds/form/error/index.js +10 -8
  203. package/dist/components/hds/form/error/index.js.map +1 -1
  204. package/dist/components/hds/form/error/message.js +9 -3
  205. package/dist/components/hds/form/error/message.js.map +1 -1
  206. package/dist/components/hds/form/field/index.js +34 -29
  207. package/dist/components/hds/form/field/index.js.map +1 -1
  208. package/dist/components/hds/form/field/types.js +13 -0
  209. package/dist/components/hds/form/field/types.js.map +1 -0
  210. package/dist/components/hds/form/fieldset/index.js +29 -25
  211. package/dist/components/hds/form/fieldset/index.js.map +1 -1
  212. package/dist/components/hds/form/fieldset/types.js +13 -0
  213. package/dist/components/hds/form/fieldset/types.js.map +1 -0
  214. package/dist/components/hds/form/file-input/base.js +9 -3
  215. package/dist/components/hds/form/file-input/base.js.map +1 -1
  216. package/dist/components/hds/form/file-input/field.js +9 -3
  217. package/dist/components/hds/form/file-input/field.js.map +1 -1
  218. package/dist/components/hds/form/helper-text/index.js +8 -7
  219. package/dist/components/hds/form/helper-text/index.js.map +1 -1
  220. package/dist/components/hds/form/indicator/index.js +5 -5
  221. package/dist/components/hds/form/indicator/index.js.map +1 -1
  222. package/dist/components/hds/form/label/index.js +6 -6
  223. package/dist/components/hds/form/label/index.js.map +1 -1
  224. package/dist/components/hds/form/legend/index.js +5 -5
  225. package/dist/components/hds/form/legend/index.js.map +1 -1
  226. package/dist/components/hds/form/masked-input/base.js +2 -2
  227. package/dist/components/hds/form/masked-input/base.js.map +1 -1
  228. package/dist/components/hds/form/masked-input/field.js +9 -3
  229. package/dist/components/hds/form/masked-input/field.js.map +1 -1
  230. package/dist/components/hds/form/radio/base.js +9 -3
  231. package/dist/components/hds/form/radio/base.js.map +1 -1
  232. package/dist/components/hds/form/radio/field.js +9 -3
  233. package/dist/components/hds/form/radio/field.js.map +1 -1
  234. package/dist/components/hds/form/radio/group.js +9 -3
  235. package/dist/components/hds/form/radio/group.js.map +1 -1
  236. package/dist/components/hds/form/radio-card/description.js +9 -3
  237. package/dist/components/hds/form/radio-card/description.js.map +1 -1
  238. package/dist/components/hds/form/radio-card/group.js +9 -3
  239. package/dist/components/hds/form/radio-card/group.js.map +1 -1
  240. package/dist/components/hds/form/radio-card/index.js +12 -11
  241. package/dist/components/hds/form/radio-card/index.js.map +1 -1
  242. package/dist/components/hds/form/radio-card/label.js +9 -3
  243. package/dist/components/hds/form/radio-card/label.js.map +1 -1
  244. package/dist/components/hds/form/radio-card/types.js +18 -0
  245. package/dist/components/hds/form/radio-card/types.js.map +1 -0
  246. package/dist/components/hds/form/select/base.js +2 -2
  247. package/dist/components/hds/form/select/base.js.map +1 -1
  248. package/dist/components/hds/form/select/field.js +9 -3
  249. package/dist/components/hds/form/select/field.js.map +1 -1
  250. package/dist/components/hds/form/super-select/after-options.js +2 -2
  251. package/dist/components/hds/form/super-select/after-options.js.map +1 -1
  252. package/dist/components/hds/form/super-select/multiple/field.js.map +1 -1
  253. package/dist/components/hds/form/super-select/placeholder.js +2 -2
  254. package/dist/components/hds/form/super-select/placeholder.js.map +1 -1
  255. package/dist/components/hds/form/super-select/single/field.js.map +1 -1
  256. package/dist/components/hds/form/text-input/base.js +8 -5
  257. package/dist/components/hds/form/text-input/base.js.map +1 -1
  258. package/dist/components/hds/form/text-input/field.js +2 -1
  259. package/dist/components/hds/form/text-input/field.js.map +1 -1
  260. package/dist/components/hds/form/text-input/types.js +22 -0
  261. package/dist/components/hds/form/text-input/types.js.map +1 -0
  262. package/dist/components/hds/form/textarea/base.js +2 -2
  263. package/dist/components/hds/form/textarea/base.js.map +1 -1
  264. package/dist/components/hds/form/textarea/field.js +9 -3
  265. package/dist/components/hds/form/textarea/field.js.map +1 -1
  266. package/dist/components/hds/form/toggle/base.js +9 -3
  267. package/dist/components/hds/form/toggle/base.js.map +1 -1
  268. package/dist/components/hds/form/toggle/field.js +9 -3
  269. package/dist/components/hds/form/toggle/field.js.map +1 -1
  270. package/dist/components/hds/form/toggle/group.js +9 -3
  271. package/dist/components/hds/form/toggle/group.js.map +1 -1
  272. package/dist/components/hds/form/visibility-toggle/index.js +9 -3
  273. package/dist/components/hds/form/visibility-toggle/index.js.map +1 -1
  274. package/dist/components/hds/modal/body.js +24 -4
  275. package/dist/components/hds/modal/body.js.map +1 -1
  276. package/dist/components/hds/modal/footer.js +24 -4
  277. package/dist/components/hds/modal/footer.js.map +1 -1
  278. package/dist/components/hds/modal/header.js +24 -4
  279. package/dist/components/hds/modal/header.js.map +1 -1
  280. package/dist/components/hds/modal/index.js +21 -14
  281. package/dist/components/hds/modal/index.js.map +1 -1
  282. package/dist/components/hds/modal/types.js +20 -0
  283. package/dist/components/hds/modal/types.js.map +1 -0
  284. package/dist/components/hds/page-header/actions.js +2 -2
  285. package/dist/components/hds/page-header/actions.js.map +1 -1
  286. package/dist/components/hds/page-header/badges.js +2 -2
  287. package/dist/components/hds/page-header/badges.js.map +1 -1
  288. package/dist/components/hds/page-header/description.js +2 -2
  289. package/dist/components/hds/page-header/description.js.map +1 -1
  290. package/dist/components/hds/page-header/index.js +2 -2
  291. package/dist/components/hds/page-header/index.js.map +1 -1
  292. package/dist/components/hds/page-header/subtitle.js +2 -2
  293. package/dist/components/hds/page-header/subtitle.js.map +1 -1
  294. package/dist/components/hds/page-header/title.js +2 -2
  295. package/dist/components/hds/page-header/title.js.map +1 -1
  296. package/dist/components/hds/pagination/nav/ellipsis.js +2 -2
  297. package/dist/components/hds/pagination/nav/ellipsis.js.map +1 -1
  298. package/dist/components/hds/rich-tooltip/index.js.map +1 -1
  299. package/dist/components/hds/segmented-group/index.js +2 -2
  300. package/dist/components/hds/segmented-group/index.js.map +1 -1
  301. package/dist/components/hds/side-nav/base.js +2 -2
  302. package/dist/components/hds/side-nav/base.js.map +1 -1
  303. package/dist/components/hds/side-nav/header/index.js +2 -2
  304. package/dist/components/hds/side-nav/header/index.js.map +1 -1
  305. package/dist/components/hds/side-nav/list/back-link.js +2 -2
  306. package/dist/components/hds/side-nav/list/back-link.js.map +1 -1
  307. package/dist/components/hds/side-nav/list/index.js +2 -2
  308. package/dist/components/hds/side-nav/list/index.js.map +1 -1
  309. package/dist/components/hds/side-nav/list/item.js +2 -2
  310. package/dist/components/hds/side-nav/list/item.js.map +1 -1
  311. package/dist/components/hds/side-nav/list/link.js +2 -2
  312. package/dist/components/hds/side-nav/list/link.js.map +1 -1
  313. package/dist/components/hds/side-nav/list/title.js +2 -2
  314. package/dist/components/hds/side-nav/list/title.js.map +1 -1
  315. package/dist/components/hds/side-nav/toggle-button.js +2 -2
  316. package/dist/components/hds/side-nav/toggle-button.js.map +1 -1
  317. package/dist/components/hds/toast/index.js +2 -2
  318. package/dist/components/hds/toast/index.js.map +1 -1
  319. package/dist/components/hds/yield/index.js +2 -2
  320. package/dist/components/hds/yield/index.js.map +1 -1
  321. package/dist/components.js +56 -0
  322. package/dist/components.js.map +1 -1
  323. package/dist/instance-initializers/load-sprite.js +33 -0
  324. package/dist/instance-initializers/load-sprite.js.map +1 -0
  325. package/dist/modifiers/hds-clipboard.js.map +1 -1
  326. package/dist/styles/@hashicorp/design-system-components.css +118 -148
  327. package/dist/styles/@hashicorp/design-system-components.scss +1 -0
  328. package/dist/styles/components/dialog-primitive.scss +143 -0
  329. package/dist/styles/components/flyout.scss +8 -70
  330. package/dist/styles/components/form/text-input.scss +6 -2
  331. package/dist/styles/components/modal.scss +18 -84
  332. package/dist/utils/hds-aria-described-by.js +1 -0
  333. package/dist/utils/hds-aria-described-by.js.map +1 -1
  334. package/dist/utils/hds-get-element-id.js +2 -0
  335. package/dist/utils/hds-get-element-id.js.map +1 -1
  336. package/package.json +9 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/error/index.hbs","../../../../../src/components/hds/form/error/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class={{this.classNames}} id={{this.id}} {{did-insert this.onInsert}} {{will-destroy this.onRemove}} ...attributes>\\n <FlightIcon class=\\\"hds-form-error__icon\\\" @name=\\\"alert-diamond-fill\\\" />\\n <Hds::Text::Body class=\\\"hds-form-error__content\\\" @tag=\\\"div\\\" @size=\\\"100\\\" @weight=\\\"medium\\\">\\n {{yield (hash Message=(component \\\"hds/form/error/message\\\"))}}\\n </Hds::Text::Body>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nexport const ID_PREFIX = 'error-';\n\nconst NOOP = () => {};\n\nexport default class HdsFormErrorIndexComponent extends Component {\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id() {\n let { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n get onInsert() {\n let { onInsert } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n\n /**\n * @param onRemove\n * @type {function}\n * @default () => {}\n */\n get onRemove() {\n let { onRemove } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onRemove === 'function') {\n return onRemove;\n } else {\n return NOOP;\n }\n }\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames() {\n let classes = ['hds-form-error'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormErrorIndexComponent","Component","id","controlId","args","onInsert","onRemove","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,ugBAAugB;;ACDziB;AACA;AACA;AACA;;AAGO,MAAMA,SAAS,GAAG,SAAQ;AAEjC,MAAMC,IAAI,GAAGA,MAAM,EAAE,CAAA;AAEN,MAAMC,0BAA0B,SAASC,SAAS,CAAC;AAChE;AACF;AACA;AACA;AACA;EACE,IAAIC,EAAEA,GAAG;IACP,IAAI;AAAEC,MAAAA,SAAAA;KAAW,GAAG,IAAI,CAACC,IAAI,CAAA;AAC7B,IAAA,IAAID,SAAS,EAAE;AACb,MAAA,OAAO,CAAGL,EAAAA,SAAS,CAAGK,EAAAA,SAAS,CAAE,CAAA,CAAA;AACnC,KAAA;AACA,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIE,QAAQA,GAAG;IACb,IAAI;AAAEA,MAAAA,QAAAA;KAAU,GAAG,IAAI,CAACD,IAAI,CAAA;;AAE5B;AACA,IAAA,IAAI,OAAOC,QAAQ,KAAK,UAAU,EAAE;AAClC,MAAA,OAAOA,QAAQ,CAAA;AACjB,KAAC,MAAM;AACL,MAAA,OAAON,IAAI,CAAA;AACb,KAAA;AACF,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIO,QAAQA,GAAG;IACb,IAAI;AAAEA,MAAAA,QAAAA;KAAU,GAAG,IAAI,CAACF,IAAI,CAAA;;AAE5B;AACA,IAAA,IAAI,OAAOE,QAAQ,KAAK,UAAU,EAAE;AAClC,MAAA,OAAOA,QAAQ,CAAA;AACjB,KAAC,MAAM;AACL,MAAA,OAAOP,IAAI,CAAA;AACb,KAAA;AACF,GAAA;AACA;AACF;AACA;AACA;AACA;EACE,IAAIQ,UAAUA,GAAG;AACf,IAAA,IAAIC,OAAO,GAAG,CAAC,gBAAgB,CAAC,CAAA;;AAEhC;AACA;AACA;AACA,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACK,eAAe,EAAE;MAC7BD,OAAO,CAACE,IAAI,CAAC,IAAI,CAACN,IAAI,CAACK,eAAe,CAAC,CAAA;AACzC,KAAA;AAEA,IAAA,OAAOD,OAAO,CAACG,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EA9DoBb,0BAA0B,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/error/index.hbs","../../../../../src/components/hds/form/error/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class={{this.classNames}} id={{this.id}} {{did-insert this.onInsert}} {{will-destroy this.onRemove}} ...attributes>\\n <FlightIcon class=\\\"hds-form-error__icon\\\" @name=\\\"alert-diamond-fill\\\" />\\n <Hds::Text::Body class=\\\"hds-form-error__content\\\" @tag=\\\"div\\\" @size=\\\"100\\\" @weight=\\\"medium\\\">\\n {{yield (hash Message=(component \\\"hds/form/error/message\\\"))}}\\n </Hds::Text::Body>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormErrorMessageSignature } from './message';\n\nexport const ID_PREFIX = 'error-';\n\nconst NOOP = (): void => {};\n\nexport interface HdsFormErrorSignature {\n Args: {\n contextualClass?: string;\n controlId?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onInsert?: (element: HTMLElement, ...args: any[]) => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onRemove?: (element: HTMLElement, ...args: any[]) => void;\n };\n Blocks: {\n default: [\n {\n Message?: ComponentLike<HdsFormErrorMessageSignature>;\n },\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsFormErrorComponent extends Component<HdsFormErrorSignature> {\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id(): string | null {\n const { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onInsert(): (element: HTMLElement, ...args: any[]) => void {\n const { onInsert } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n\n /**\n * @param onRemove\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onRemove(): (element: HTMLElement, ...args: any[]) => void {\n const { onRemove } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onRemove === 'function') {\n return onRemove;\n } else {\n return NOOP;\n }\n }\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-error'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormErrorComponent","Component","id","controlId","args","onInsert","onRemove","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,8dAA8d;;ACDhgB;AACA;AACA;AACA;;AAMO,MAAMA,SAAS,GAAG,SAAQ;AAEjC,MAAMC,IAAI,GAAGA,MAAY,EAAE,CAAA;AAqBZ,MAAMC,qBAAqB,SAASC,SAAS,CAAwB;AAClF;AACF;AACA;AACA;AACA;EACE,IAAIC,EAAEA,GAAkB;IACtB,MAAM;AAAEC,MAAAA,SAAAA;KAAW,GAAG,IAAI,CAACC,IAAI,CAAA;AAC/B,IAAA,IAAID,SAAS,EAAE;AACb,MAAA,OAAO,CAAGL,EAAAA,SAAS,CAAGK,EAAAA,SAAS,CAAE,CAAA,CAAA;AACnC,KAAA;AACA,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACE;EACA,IAAIE,QAAQA,GAAmD;IAC7D,MAAM;AAAEA,MAAAA,QAAAA;KAAU,GAAG,IAAI,CAACD,IAAI,CAAA;;AAE9B;AACA,IAAA,IAAI,OAAOC,QAAQ,KAAK,UAAU,EAAE;AAClC,MAAA,OAAOA,QAAQ,CAAA;AACjB,KAAC,MAAM;AACL,MAAA,OAAON,IAAI,CAAA;AACb,KAAA;AACF,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACE;EACA,IAAIO,QAAQA,GAAmD;IAC7D,MAAM;AAAEA,MAAAA,QAAAA;KAAU,GAAG,IAAI,CAACF,IAAI,CAAA;;AAE9B;AACA,IAAA,IAAI,OAAOE,QAAQ,KAAK,UAAU,EAAE;AAClC,MAAA,OAAOA,QAAQ,CAAA;AACjB,KAAC,MAAM;AACL,MAAA,OAAOP,IAAI,CAAA;AACb,KAAA;AACF,GAAA;AACA;AACF;AACA;AACA;AACA;EACE,IAAIQ,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,gBAAgB,CAAC,CAAA;;AAElC;AACA;AACA;AACA,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACK,eAAe,EAAE;MAC7BD,OAAO,CAACE,IAAI,CAAC,IAAI,CAACN,IAAI,CAACK,eAAe,CAAC,CAAA;AACzC,KAAA;AAEA,IAAA,OAAOD,OAAO,CAACG,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EAhEoBb,qBAAqB,CAAA;;;;"}
@@ -1,10 +1,16 @@
1
- import templateOnly from '@ember/component/template-only';
1
+ import templateOnlyComponent from '@ember/component/template-only';
2
2
  import { precompileTemplate } from '@ember/template-compilation';
3
3
  import { setComponentTemplate } from '@ember/component';
4
4
 
5
- var TEMPLATE = precompileTemplate("{{! @glint-nocheck: not typesafe yet }}\n{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::Text::Body class=\"hds-form-error__message\" @tag=\"p\" @size=\"100\" @weight=\"medium\" ...attributes>\n {{yield}}\n</Hds::Text::Body>");
5
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::Text::Body class=\"hds-form-error__message\" @tag=\"p\" @size=\"100\" @weight=\"medium\" ...attributes>\n {{yield}}\n</Hds::Text::Body>");
6
6
 
7
- var message = setComponentTemplate(TEMPLATE, templateOnly());
7
+ /**
8
+ * Copyright (c) HashiCorp, Inc.
9
+ * SPDX-License-Identifier: MPL-2.0
10
+ */
11
+
12
+ const HdsFormErrorMessageComponent = templateOnlyComponent();
13
+ var message = setComponentTemplate(TEMPLATE, HdsFormErrorMessageComponent);
8
14
 
9
15
  export { message as default };
10
16
  //# sourceMappingURL=message.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","sources":["../../../../../src/components/hds/form/error/message.hbs","../../../../../src/components/hds/form/error/message.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body class=\\\"hds-form-error__message\\\" @tag=\\\"p\\\" @size=\\\"100\\\" @weight=\\\"medium\\\" ...attributes>\\n {{yield}}\\n</Hds::Text::Body>\")","import templateOnly from '@ember/component/template-only';\nexport default templateOnly();\n"],"names":["setComponentTemplate","TEMPLATE","templateOnly"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,uQAAuQ;;ACAzS,cAAAA,oBAAA,CAAAC,QAAA,EAAeC,YAAY,EAAE,CAAA;;;;"}
1
+ {"version":3,"file":"message.js","sources":["../../../../../src/components/hds/form/error/message.hbs","../../../../../src/components/hds/form/error/message.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body class=\\\"hds-form-error__message\\\" @tag=\\\"p\\\" @size=\\\"100\\\" @weight=\\\"medium\\\" ...attributes>\\n {{yield}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nimport type { HdsTextBodySignature } from '../../text/body';\n\nexport interface HdsFormErrorMessageSignature {\n Blocks: {\n default: [];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nconst HdsFormErrorMessageComponent =\n templateOnlyComponent<HdsFormErrorMessageSignature>();\n\nexport default HdsFormErrorMessageComponent;\n"],"names":["HdsFormErrorMessageComponent","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,8NAA8N;;ACDhQ;AACA;AACA;AACA;;AAaA,MAAMA,4BAA4B,GAChCC,qBAAqB,EAAgC,CAAA;AAEvD,cAAAC,oBAAA,CAAAC,QAAA,EAAeH,4BAA4B,CAAA;;;;"}
@@ -4,22 +4,21 @@ import { assert } from '@ember/debug';
4
4
  import { action } from '@ember/object';
5
5
  import { getElementId } from '../../../../utils/hds-get-element-id.js';
6
6
  import { ariaDescribedBy, registerAriaDescriptionElement, unregisterAriaDescriptionElement } from '../../../../utils/hds-aria-described-by.js';
7
+ import { HdsFormFieldLayoutValues } from './types.js';
8
+ import '../label/index.js';
9
+ import '../helper-text/index.js';
10
+ import '../character-count/index.js';
11
+ import '../error/index.js';
7
12
  import { precompileTemplate } from '@ember/template-compilation';
8
13
  import { c } from 'decorator-transforms/runtime';
9
14
  import { setComponentTemplate } from '@ember/component';
10
15
 
11
- var TEMPLATE = precompileTemplate("{{! @glint-nocheck: not typesafe yet }}\n{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<div class={{this.classNames}} ...attributes>\n {{yield\n (hash\n Label=(component\n \"hds/form/label\"\n controlId=this.id\n isRequired=this.isRequired\n isOptional=this.isOptional\n contextualClass=\"hds-form-field__label\"\n )\n )\n }}\n {{yield\n (hash\n HelperText=(component\n \"hds/form/helper-text\"\n controlId=this.id\n onInsert=this.appendDescriptor\n contextualClass=\"hds-form-field__helper-text\"\n )\n )\n }}\n <div class=\"hds-form-field__control\">\n {{yield (hash Control=(component \"hds/yield\") id=this.id ariaDescribedBy=this.ariaDescribedBy)}}\n </div>\n {{yield\n (hash\n CharacterCount=(component\n \"hds/form/character-count\"\n controlId=this.id\n onInsert=this.appendDescriptor\n contextualClass=\"hds-form-field__character-count\"\n )\n )\n }}\n {{yield\n (hash\n Error=(component\n \"hds/form/error\"\n controlId=this.id\n onInsert=this.appendDescriptor\n onRemove=this.removeDescriptor\n contextualClass=\"hds-form-field__error\"\n )\n )\n }}\n</div>");
16
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<div class={{this.classNames}} ...attributes>\n {{yield\n (hash\n Label=(component\n \"hds/form/label\"\n controlId=this.id\n isRequired=this.isRequired\n isOptional=this.isOptional\n contextualClass=\"hds-form-field__label\"\n )\n )\n }}\n {{yield\n (hash\n HelperText=(component\n \"hds/form/helper-text\"\n controlId=this.id\n onInsert=this.appendDescriptor\n contextualClass=\"hds-form-field__helper-text\"\n )\n )\n }}\n <div class=\"hds-form-field__control\">\n {{! @glint-expect-error }}\n {{yield (hash Control=(component \"hds/yield\") id=this.id ariaDescribedBy=this.ariaDescribedBy)}}\n </div>\n {{yield\n (hash\n CharacterCount=(component\n \"hds/form/character-count\"\n controlId=this.id\n onInsert=this.appendDescriptor\n contextualClass=\"hds-form-field__character-count\"\n )\n )\n }}\n {{yield\n (hash\n Error=(component\n \"hds/form/error\"\n controlId=this.id\n onInsert=this.appendDescriptor\n onRemove=this.removeDescriptor\n contextualClass=\"hds-form-field__error\"\n )\n )\n }}\n</div>");
12
17
 
13
18
  var _class;
14
- const LAYOUT_TYPES = ['vertical', 'flag'];
15
- const HdsFormFieldIndexComponent = c((_class = class HdsFormFieldIndexComponent extends Component {
16
- appendDescriptor(element) {
17
- registerAriaDescriptionElement(this, element);
18
- }
19
- removeDescriptor(element) {
20
- unregisterAriaDescriptionElement(this, element);
21
- }
22
-
19
+ const LAYOUT_TYPES = Object.values(HdsFormFieldLayoutValues);
20
+ // @ts-expect-error: decorator function return type 'ClassOf<AriaDescribedByComponent>' is not assignable to 'typeof HdsFormFieldComponent'
21
+ const HdsFormFieldComponent = c((_class = class HdsFormFieldComponent extends Component {
23
22
  /**
24
23
  * Sets the layout of the field
25
24
  *
@@ -27,7 +26,7 @@ const HdsFormFieldIndexComponent = c((_class = class HdsFormFieldIndexComponent
27
26
  * @type {string}
28
27
  */
29
28
  get layout() {
30
- let {
29
+ const {
31
30
  layout
32
31
  } = this.args;
33
32
  assert(`@layout for "Hds::Form::Field" must be one of the following: ${LAYOUT_TYPES.join(', ')}; received: ${layout}`, LAYOUT_TYPES.includes(layout));
@@ -41,13 +40,31 @@ const HdsFormFieldIndexComponent = c((_class = class HdsFormFieldIndexComponent
41
40
  return getElementId(this);
42
41
  }
43
42
 
43
+ /**
44
+ * @param isRequired
45
+ * @type {boolean}
46
+ * @default false
47
+ */
48
+ get isRequired() {
49
+ return this.args.isRequired || false;
50
+ }
51
+
52
+ /**
53
+ * @param isOptional
54
+ * @type {boolean}
55
+ * @default false
56
+ */
57
+ get isOptional() {
58
+ return this.args.isOptional || false;
59
+ }
60
+
44
61
  /**
45
62
  * Get the class names to apply to the component.
46
63
  * @method classNames
47
64
  * @return {string} The "class" attribute to apply to the component.
48
65
  */
49
66
  get classNames() {
50
- let classes = [];
67
+ const classes = [];
51
68
  if (this.args.layout) {
52
69
  classes.push(`hds-form-field--layout-${this.layout}`);
53
70
  }
@@ -59,26 +76,14 @@ const HdsFormFieldIndexComponent = c((_class = class HdsFormFieldIndexComponent
59
76
  }
60
77
  return classes.join(' ');
61
78
  }
62
-
63
- /**
64
- * @param isRequired
65
- * @type {boolean}
66
- * @default false
67
- */
68
- get isRequired() {
69
- return this.args.isRequired || false;
79
+ appendDescriptor(element) {
80
+ registerAriaDescriptionElement(this, element);
70
81
  }
71
-
72
- /**
73
- * @param isOptional
74
- * @type {boolean}
75
- * @default false
76
- */
77
- get isOptional() {
78
- return this.args.isOptional || false;
82
+ removeDescriptor(element) {
83
+ unregisterAriaDescriptionElement(this, element);
79
84
  }
80
85
  }, (_applyDecoratedDescriptor(_class.prototype, "appendDescriptor", [action], Object.getOwnPropertyDescriptor(_class.prototype, "appendDescriptor"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "removeDescriptor", [action], Object.getOwnPropertyDescriptor(_class.prototype, "removeDescriptor"), _class.prototype)), _class), [ariaDescribedBy]);
81
- var index = setComponentTemplate(TEMPLATE, HdsFormFieldIndexComponent);
86
+ var index = setComponentTemplate(TEMPLATE, HdsFormFieldComponent);
82
87
 
83
88
  export { LAYOUT_TYPES, index as default };
84
89
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/field/index.hbs","../../../../../src/components/hds/form/field/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class={{this.classNames}} ...attributes>\\n {{yield\\n (hash\\n Label=(component\\n \\\"hds/form/label\\\"\\n controlId=this.id\\n isRequired=this.isRequired\\n isOptional=this.isOptional\\n contextualClass=\\\"hds-form-field__label\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n HelperText=(component\\n \\\"hds/form/helper-text\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-field__helper-text\\\"\\n )\\n )\\n }}\\n <div class=\\\"hds-form-field__control\\\">\\n {{yield (hash Control=(component \\\"hds/yield\\\") id=this.id ariaDescribedBy=this.ariaDescribedBy)}}\\n </div>\\n {{yield\\n (hash\\n CharacterCount=(component\\n \\\"hds/form/character-count\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-field__character-count\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n Error=(component\\n \\\"hds/form/error\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n onRemove=this.removeDescriptor\\n contextualClass=\\\"hds-form-field__error\\\"\\n )\\n )\\n }}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { action } from '@ember/object';\nimport { getElementId } from '../../../../utils/hds-get-element-id.js';\nimport {\n ariaDescribedBy,\n registerAriaDescriptionElement,\n unregisterAriaDescriptionElement,\n} from '../../../../utils/hds-aria-described-by.ts';\n\nexport const LAYOUT_TYPES = ['vertical', 'flag'];\n\n@ariaDescribedBy\nclass HdsFormFieldIndexComponent extends Component {\n @action\n appendDescriptor(element) {\n registerAriaDescriptionElement(this, element);\n }\n\n @action removeDescriptor(element) {\n unregisterAriaDescriptionElement(this, element);\n }\n\n /**\n * Sets the layout of the field\n *\n * @param layout\n * @type {string}\n */\n get layout() {\n let { layout } = this.args;\n\n assert(\n `@layout for \"Hds::Form::Field\" must be one of the following: ${LAYOUT_TYPES.join(\n ', '\n )}; received: ${layout}`,\n LAYOUT_TYPES.includes(layout)\n );\n\n return layout;\n }\n\n /**\n * Calculates the unique ID to assign to the form control\n */\n get id() {\n return getElementId(this);\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames() {\n let classes = [];\n\n if (this.args.layout) {\n classes.push(`hds-form-field--layout-${this.layout}`);\n }\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n\n /**\n * @param isRequired\n * @type {boolean}\n * @default false\n */\n get isRequired() {\n return this.args.isRequired || false;\n }\n\n /**\n * @param isOptional\n * @type {boolean}\n * @default false\n */\n get isOptional() {\n return this.args.isOptional || false;\n }\n}\n\nexport default HdsFormFieldIndexComponent;\n"],"names":["LAYOUT_TYPES","HdsFormFieldIndexComponent","c","_class","Component","appendDescriptor","element","registerAriaDescriptionElement","removeDescriptor","unregisterAriaDescriptionElement","layout","args","assert","join","includes","id","getElementId","classNames","classes","push","contextualClass","isRequired","isOptional","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","ariaDescribedBy","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,yxCAAyxC;;;MCc9yCA,YAAY,GAAG,CAAC,UAAU,EAAE,MAAM,EAAC;AAAC,MAG3CC,0BAA0B,GAAAC,CAAA,EAAAC,MAAA,GAA1BF,MAAAA,0BAA0B,SAASG,SAAS,CAAC;EAEjDC,gBAAgBA,CAACC,OAAO,EAAE;AACxBC,IAAAA,8BAA8B,CAAC,IAAI,EAAED,OAAO,CAAC,CAAA;AAC/C,GAAA;EAEQE,gBAAgBA,CAACF,OAAO,EAAE;AAChCG,IAAAA,gCAAgC,CAAC,IAAI,EAAEH,OAAO,CAAC,CAAA;AACjD,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE,IAAII,MAAMA,GAAG;IACX,IAAI;AAAEA,MAAAA,MAAAA;KAAQ,GAAG,IAAI,CAACC,IAAI,CAAA;AAE1BC,IAAAA,MAAM,CACJ,CAAgEZ,6DAAAA,EAAAA,YAAY,CAACa,IAAI,CAC/E,IACF,CAAC,CAAA,YAAA,EAAeH,MAAM,CAAA,CAAE,EACxBV,YAAY,CAACc,QAAQ,CAACJ,MAAM,CAC9B,CAAC,CAAA;AAED,IAAA,OAAOA,MAAM,CAAA;AACf,GAAA;;AAEA;AACF;AACA;EACE,IAAIK,EAAEA,GAAG;IACP,OAAOC,YAAY,CAAC,IAAI,CAAC,CAAA;AAC3B,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAG;IACf,IAAIC,OAAO,GAAG,EAAE,CAAA;AAEhB,IAAA,IAAI,IAAI,CAACP,IAAI,CAACD,MAAM,EAAE;MACpBQ,OAAO,CAACC,IAAI,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAACT,MAAM,EAAE,CAAC,CAAA;AACvD,KAAA;;AAEA;AACA;AACA,IAAA,IAAI,IAAI,CAACC,IAAI,CAACS,eAAe,EAAE;MAC7BF,OAAO,CAACC,IAAI,CAAC,IAAI,CAACR,IAAI,CAACS,eAAe,CAAC,CAAA;AACzC,KAAA;AAEA,IAAA,OAAOF,OAAO,CAACL,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIQ,UAAUA,GAAG;AACf,IAAA,OAAO,IAAI,CAACV,IAAI,CAACU,UAAU,IAAI,KAAK,CAAA;AACtC,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAG;AACf,IAAA,OAAO,IAAI,CAACX,IAAI,CAACW,UAAU,IAAI,KAAK,CAAA;AACtC,GAAA;AACF,CAAC,GAAAC,yBAAA,CAAApB,MAAA,CAAAqB,SAAA,uBAzEEC,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAxB,MAAA,CAAAqB,SAAA,EAAArB,kBAAAA,CAAAA,EAAAA,MAAA,CAAAqB,SAAA,CAAA,EAAAD,yBAAA,CAAApB,MAAA,CAAAqB,SAAA,EAAA,kBAAA,EAAA,CAKNC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAxB,MAAA,CAAAqB,SAAA,uBAAArB,MAAA,CAAAqB,SAAA,CAAArB,GAAAA,MAAA,IAPRyB,eAAe,CAAA,CAAA,CAAA;AA6EhB,YAAAC,oBAAA,CAAAC,QAAA,EAAe7B,0BAA0B,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/field/index.hbs","../../../../../src/components/hds/form/field/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class={{this.classNames}} ...attributes>\\n {{yield\\n (hash\\n Label=(component\\n \\\"hds/form/label\\\"\\n controlId=this.id\\n isRequired=this.isRequired\\n isOptional=this.isOptional\\n contextualClass=\\\"hds-form-field__label\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n HelperText=(component\\n \\\"hds/form/helper-text\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-field__helper-text\\\"\\n )\\n )\\n }}\\n <div class=\\\"hds-form-field__control\\\">\\n {{! @glint-expect-error }}\\n {{yield (hash Control=(component \\\"hds/yield\\\") id=this.id ariaDescribedBy=this.ariaDescribedBy)}}\\n </div>\\n {{yield\\n (hash\\n CharacterCount=(component\\n \\\"hds/form/character-count\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-field__character-count\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n Error=(component\\n \\\"hds/form/error\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n onRemove=this.removeDescriptor\\n contextualClass=\\\"hds-form-field__error\\\"\\n )\\n )\\n }}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { action } from '@ember/object';\nimport { getElementId } from '../../../../utils/hds-get-element-id.ts';\nimport {\n ariaDescribedBy,\n registerAriaDescriptionElement,\n unregisterAriaDescriptionElement,\n} from '../../../../utils/hds-aria-described-by.ts';\nimport { HdsFormFieldLayoutValues } from './types.ts';\nimport HdsFormLabelComponent from '../label/index.ts';\nimport HdsFormHelperTextComponent from '../helper-text/index.ts';\nimport HdsFormCharacterCountComponent from '../character-count/index.ts';\nimport HdsFormErrorComponent from '../error/index.ts';\n\nimport type { HdsFormFieldLayouts } from './types.ts';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsYieldSignature } from '../../yield/index.ts';\n\nexport const LAYOUT_TYPES = Object.values(HdsFormFieldLayoutValues);\n\nexport interface HdsFormFieldSignature {\n Args: {\n id?: string;\n extraAriaDescribedBy?: string;\n contextualClass?: string;\n isOptional?: boolean;\n isRequired?: boolean;\n layout?: HdsFormFieldLayouts;\n };\n Blocks: {\n default: [\n {\n Label?: WithBoundArgs<\n typeof HdsFormLabelComponent,\n 'contextualClass' | 'controlId' | 'isRequired' | 'isOptional'\n >;\n HelperText?: WithBoundArgs<\n typeof HdsFormHelperTextComponent,\n 'contextualClass' | 'controlId' | 'onInsert'\n >;\n Control?: ComponentLike<HdsYieldSignature>;\n CharacterCount?: WithBoundArgs<\n typeof HdsFormCharacterCountComponent,\n 'contextualClass' | 'controlId' | 'onInsert'\n >;\n Error?: WithBoundArgs<\n typeof HdsFormErrorComponent,\n 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove'\n >;\n id?: string;\n ariaDescribedBy?: string;\n },\n ];\n };\n Element: HTMLElement;\n}\n\n// @ts-expect-error: decorator function return type 'ClassOf<AriaDescribedByComponent>' is not assignable to 'typeof HdsFormFieldComponent'\n@ariaDescribedBy\nclass HdsFormFieldComponent extends Component<HdsFormFieldSignature> {\n /**\n * Sets the layout of the field\n *\n * @param layout\n * @type {string}\n */\n get layout(): HdsFormFieldLayouts | undefined {\n const { layout } = this.args;\n\n assert(\n `@layout for \"Hds::Form::Field\" must be one of the following: ${LAYOUT_TYPES.join(\n ', '\n )}; received: ${layout}`,\n LAYOUT_TYPES.includes(layout as HdsFormFieldLayoutValues)\n );\n\n return layout;\n }\n\n /**\n * Calculates the unique ID to assign to the form control\n */\n get id(): string {\n return getElementId(this);\n }\n\n /**\n * @param isRequired\n * @type {boolean}\n * @default false\n */\n get isRequired(): boolean {\n return this.args.isRequired || false;\n }\n\n /**\n * @param isOptional\n * @type {boolean}\n * @default false\n */\n get isOptional(): boolean {\n return this.args.isOptional || false;\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes: string[] = [];\n\n if (this.args.layout) {\n classes.push(`hds-form-field--layout-${this.layout}`);\n }\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n\n @action\n appendDescriptor(element: HTMLElement): void {\n registerAriaDescriptionElement(this, element);\n }\n\n @action removeDescriptor(element: HTMLElement): void {\n unregisterAriaDescriptionElement(this, element);\n }\n}\n\nexport default HdsFormFieldComponent;\n"],"names":["LAYOUT_TYPES","Object","values","HdsFormFieldLayoutValues","HdsFormFieldComponent","c","_class","Component","layout","args","assert","join","includes","id","getElementId","isRequired","isOptional","classNames","classes","push","contextualClass","appendDescriptor","element","registerAriaDescriptionElement","removeDescriptor","unregisterAriaDescriptionElement","_applyDecoratedDescriptor","prototype","action","getOwnPropertyDescriptor","ariaDescribedBy","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,gxCAAgxC;;;ACuB3yC,MAAMA,YAAY,GAAGC,MAAM,CAACC,MAAM,CAACC,wBAAwB,EAAC;AAuCnE;AAAA,MAEMC,qBAAqB,GAAAC,CAAA,EAAAC,MAAA,GAArBF,MAAAA,qBAAqB,SAASG,SAAS,CAAwB;AACnE;AACF;AACA;AACA;AACA;AACA;EACE,IAAIC,MAAMA,GAAoC;IAC5C,MAAM;AAAEA,MAAAA,MAAAA;KAAQ,GAAG,IAAI,CAACC,IAAI,CAAA;AAE5BC,IAAAA,MAAM,CACJ,CAAgEV,6DAAAA,EAAAA,YAAY,CAACW,IAAI,CAC/E,IACF,CAAC,CAAA,YAAA,EAAeH,MAAM,CAAA,CAAE,EACxBR,YAAY,CAACY,QAAQ,CAACJ,MAAkC,CAC1D,CAAC,CAAA;AAED,IAAA,OAAOA,MAAM,CAAA;AACf,GAAA;;AAEA;AACF;AACA;EACE,IAAIK,EAAEA,GAAW;IACf,OAAOC,YAAY,CAAC,IAAI,CAAC,CAAA;AAC3B,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAY;AACxB,IAAA,OAAO,IAAI,CAACN,IAAI,CAACM,UAAU,IAAI,KAAK,CAAA;AACtC,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAY;AACxB,IAAA,OAAO,IAAI,CAACP,IAAI,CAACO,UAAU,IAAI,KAAK,CAAA;AACtC,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAW;IACvB,MAAMC,OAAiB,GAAG,EAAE,CAAA;AAE5B,IAAA,IAAI,IAAI,CAACT,IAAI,CAACD,MAAM,EAAE;MACpBU,OAAO,CAACC,IAAI,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAACX,MAAM,EAAE,CAAC,CAAA;AACvD,KAAA;;AAEA;AACA;AACA,IAAA,IAAI,IAAI,CAACC,IAAI,CAACW,eAAe,EAAE;MAC7BF,OAAO,CAACC,IAAI,CAAC,IAAI,CAACV,IAAI,CAACW,eAAe,CAAC,CAAA;AACzC,KAAA;AAEA,IAAA,OAAOF,OAAO,CAACP,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;EAGAU,gBAAgBA,CAACC,OAAoB,EAAQ;AAC3CC,IAAAA,8BAA8B,CAAC,IAAI,EAAED,OAAO,CAAC,CAAA;AAC/C,GAAA;EAEQE,gBAAgBA,CAACF,OAAoB,EAAQ;AACnDG,IAAAA,gCAAgC,CAAC,IAAI,EAAEH,OAAO,CAAC,CAAA;AACjD,GAAA;AACF,CAAC,GAAAI,yBAAA,CAAApB,MAAA,CAAAqB,SAAA,uBAREC,MAAM,CAAA,EAAA3B,MAAA,CAAA4B,wBAAA,CAAAvB,MAAA,CAAAqB,SAAA,EAAArB,kBAAAA,CAAAA,EAAAA,MAAA,CAAAqB,SAAA,CAAA,EAAAD,yBAAA,CAAApB,MAAA,CAAAqB,SAAA,EAAA,kBAAA,EAAA,CAKNC,MAAM,CAAA3B,EAAAA,MAAA,CAAA4B,wBAAA,CAAAvB,MAAA,CAAAqB,SAAA,uBAAArB,MAAA,CAAAqB,SAAA,CAAArB,GAAAA,MAAA,IAxERwB,eAAe,CAAA,CAAA,CAAA;AA6EhB,YAAAC,oBAAA,CAAAC,QAAA,EAAe5B,qBAAqB,CAAA;;;;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ let HdsFormFieldLayoutValues = /*#__PURE__*/function (HdsFormFieldLayoutValues) {
7
+ HdsFormFieldLayoutValues["Vertical"] = "vertical";
8
+ HdsFormFieldLayoutValues["Flag"] = "flag";
9
+ return HdsFormFieldLayoutValues;
10
+ }({});
11
+
12
+ export { HdsFormFieldLayoutValues };
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../../../../../src/components/hds/form/field/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsFormFieldLayoutValues {\n Vertical = 'vertical',\n Flag = 'flag',\n}\n\nexport type HdsFormFieldLayouts = `${HdsFormFieldLayoutValues}`;\n"],"names":["HdsFormFieldLayoutValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,wBAAwB,0BAAxBA,wBAAwB,EAAA;EAAxBA,wBAAwB,CAAA,UAAA,CAAA,GAAA,UAAA,CAAA;EAAxBA,wBAAwB,CAAA,MAAA,CAAA,GAAA,MAAA,CAAA;AAAA,EAAA,OAAxBA,wBAAwB,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}
@@ -3,21 +3,19 @@ import Component from '@glimmer/component';
3
3
  import { action } from '@ember/object';
4
4
  import { getElementId } from '../../../../utils/hds-get-element-id.js';
5
5
  import { ariaDescribedBy, registerAriaDescriptionElement, unregisterAriaDescriptionElement } from '../../../../utils/hds-aria-described-by.js';
6
+ import { HdsFormFieldsetLayoutValues } from './types.js';
7
+ import '../legend/index.js';
8
+ import '../helper-text/index.js';
9
+ import '../error/index.js';
6
10
  import { c } from 'decorator-transforms/runtime';
7
11
  import { precompileTemplate } from '@ember/template-compilation';
8
12
  import { setComponentTemplate } from '@ember/component';
9
13
 
10
- var TEMPLATE = precompileTemplate("{{! @glint-nocheck: not typesafe yet }}\n{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<fieldset class={{this.classNames}} id={{this.id}} ...attributes>\n {{yield\n (hash\n Legend=(component\n \"hds/form/legend\" isRequired=this.isRequired isOptional=this.isOptional contextualClass=\"hds-form-group__legend\"\n )\n )\n }}\n {{yield\n (hash\n HelperText=(component\n \"hds/form/helper-text\"\n controlId=this.id\n onInsert=this.appendDescriptor\n contextualClass=\"hds-form-group__helper-text\"\n )\n )\n }}\n <div class=\"hds-form-group__control-fields-wrapper\">\n {{yield (hash Control=(component \"hds/yield\") ariaDescribedBy=this.ariaDescribedBy)}}\n </div>\n {{yield\n (hash\n Error=(component\n \"hds/form/error\"\n controlId=this.id\n onInsert=this.appendDescriptor\n onRemove=this.removeDescriptor\n contextualClass=\"hds-form-group__error\"\n )\n )\n }}\n</fieldset>");
14
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<fieldset class={{this.classNames}} id={{this.id}} ...attributes>\n {{yield\n (hash\n Legend=(component\n \"hds/form/legend\" isRequired=this.isRequired isOptional=this.isOptional contextualClass=\"hds-form-group__legend\"\n )\n )\n }}\n {{yield\n (hash\n HelperText=(component\n \"hds/form/helper-text\"\n controlId=this.id\n onInsert=this.appendDescriptor\n contextualClass=\"hds-form-group__helper-text\"\n )\n )\n }}\n <div class=\"hds-form-group__control-fields-wrapper\">\n {{! @glint-expect-error }}\n {{yield (hash Control=(component \"hds/yield\") ariaDescribedBy=this.ariaDescribedBy)}}\n </div>\n {{yield\n (hash\n Error=(component\n \"hds/form/error\"\n controlId=this.id\n onInsert=this.appendDescriptor\n onRemove=this.removeDescriptor\n contextualClass=\"hds-form-group__error\"\n )\n )\n }}\n</fieldset>");
11
15
 
12
16
  var _class;
13
- const HdsFormFieldsetIndexComponent = c((_class = class HdsFormFieldsetIndexComponent extends Component {
14
- appendDescriptor(element) {
15
- registerAriaDescriptionElement(this, element);
16
- }
17
- removeDescriptor(element) {
18
- unregisterAriaDescriptionElement(this, element);
19
- }
20
-
17
+ // @ts-expect-error: decorator function return type 'ClassOf<AriaDescribedByComponent>' is not assignable to 'typeof HdsFormFieldComponent'
18
+ const HdsFormFieldsetComponent = c((_class = class HdsFormFieldsetComponent extends Component {
21
19
  /**
22
20
  * Sets the layout of the group
23
21
  *
@@ -26,7 +24,7 @@ const HdsFormFieldsetIndexComponent = c((_class = class HdsFormFieldsetIndexComp
26
24
  * @default 'vertical'
27
25
  */
28
26
  get layout() {
29
- return this.args.layout ?? 'vertical';
27
+ return this.args.layout ?? HdsFormFieldsetLayoutValues.Vertical;
30
28
  }
31
29
 
32
30
  /**
@@ -36,20 +34,6 @@ const HdsFormFieldsetIndexComponent = c((_class = class HdsFormFieldsetIndexComp
36
34
  return getElementId(this);
37
35
  }
38
36
 
39
- /**
40
- * Get the class names to apply to the component.
41
- * @method classNames
42
- * @return {string} The "class" attribute to apply to the component.
43
- */
44
- get classNames() {
45
- // we just need a class for the layout
46
- let classes = ['hds-form-group'];
47
-
48
- // add a class based on the @layout argument
49
- classes.push(`hds-form-group--layout-${this.layout}`);
50
- return classes.join(' ');
51
- }
52
-
53
37
  /**
54
38
  * @param isRequired
55
39
  * @type {boolean}
@@ -67,8 +51,28 @@ const HdsFormFieldsetIndexComponent = c((_class = class HdsFormFieldsetIndexComp
67
51
  get isOptional() {
68
52
  return this.args.isOptional || false;
69
53
  }
54
+
55
+ /**
56
+ * Get the class names to apply to the component.
57
+ * @method classNames
58
+ * @return {string} The "class" attribute to apply to the component.
59
+ */
60
+ get classNames() {
61
+ // we just need a class for the layout
62
+ const classes = ['hds-form-group'];
63
+
64
+ // add a class based on the @layout argument
65
+ classes.push(`hds-form-group--layout-${this.layout}`);
66
+ return classes.join(' ');
67
+ }
68
+ appendDescriptor(element) {
69
+ registerAriaDescriptionElement(this, element);
70
+ }
71
+ removeDescriptor(element) {
72
+ unregisterAriaDescriptionElement(this, element);
73
+ }
70
74
  }, (_applyDecoratedDescriptor(_class.prototype, "appendDescriptor", [action], Object.getOwnPropertyDescriptor(_class.prototype, "appendDescriptor"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "removeDescriptor", [action], Object.getOwnPropertyDescriptor(_class.prototype, "removeDescriptor"), _class.prototype)), _class), [ariaDescribedBy]);
71
- var index = setComponentTemplate(TEMPLATE, HdsFormFieldsetIndexComponent);
75
+ var index = setComponentTemplate(TEMPLATE, HdsFormFieldsetComponent);
72
76
 
73
77
  export { index as default };
74
78
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/fieldset/index.hbs","../../../../../src/components/hds/form/fieldset/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<fieldset class={{this.classNames}} id={{this.id}} ...attributes>\\n {{yield\\n (hash\\n Legend=(component\\n \\\"hds/form/legend\\\" isRequired=this.isRequired isOptional=this.isOptional contextualClass=\\\"hds-form-group__legend\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n HelperText=(component\\n \\\"hds/form/helper-text\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-group__helper-text\\\"\\n )\\n )\\n }}\\n <div class=\\\"hds-form-group__control-fields-wrapper\\\">\\n {{yield (hash Control=(component \\\"hds/yield\\\") ariaDescribedBy=this.ariaDescribedBy)}}\\n </div>\\n {{yield\\n (hash\\n Error=(component\\n \\\"hds/form/error\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n onRemove=this.removeDescriptor\\n contextualClass=\\\"hds-form-group__error\\\"\\n )\\n )\\n }}\\n</fieldset>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getElementId } from '../../../../utils/hds-get-element-id.js';\nimport {\n ariaDescribedBy,\n registerAriaDescriptionElement,\n unregisterAriaDescriptionElement,\n} from '../../../../utils/hds-aria-described-by.ts';\n\n@ariaDescribedBy\nclass HdsFormFieldsetIndexComponent extends Component {\n @action\n appendDescriptor(element) {\n registerAriaDescriptionElement(this, element);\n }\n\n @action removeDescriptor(element) {\n unregisterAriaDescriptionElement(this, element);\n }\n\n /**\n * Sets the layout of the group\n *\n * @param layout\n * @type {enum}\n * @default 'vertical'\n */\n get layout() {\n return this.args.layout ?? 'vertical';\n }\n\n /**\n * Calculates the unique ID to assign to the fieldset\n */\n get id() {\n return getElementId(this);\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames() {\n // we just need a class for the layout\n let classes = ['hds-form-group'];\n\n // add a class based on the @layout argument\n classes.push(`hds-form-group--layout-${this.layout}`);\n\n return classes.join(' ');\n }\n\n /**\n * @param isRequired\n * @type {boolean}\n * @default false\n */\n get isRequired() {\n return this.args.isRequired || false;\n }\n\n /**\n * @param isOptional\n * @type {boolean}\n * @default false\n */\n get isOptional() {\n return this.args.isOptional || false;\n }\n}\n\nexport default HdsFormFieldsetIndexComponent;\n"],"names":["HdsFormFieldsetIndexComponent","c","_class","Component","appendDescriptor","element","registerAriaDescriptionElement","removeDescriptor","unregisterAriaDescriptionElement","layout","args","id","getElementId","classNames","classes","push","join","isRequired","isOptional","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","ariaDescribedBy","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;AACA,eAAe,kBAAkB,CAAC,ghCAAghC;;;ACW9/B,MAG9CA,6BAA6B,GAAAC,CAAA,EAAAC,MAAA,GAA7BF,MAAAA,6BAA6B,SAASG,SAAS,CAAC;EAEpDC,gBAAgBA,CAACC,OAAO,EAAE;AACxBC,IAAAA,8BAA8B,CAAC,IAAI,EAAED,OAAO,CAAC,CAAA;AAC/C,GAAA;EAEQE,gBAAgBA,CAACF,OAAO,EAAE;AAChCG,IAAAA,gCAAgC,CAAC,IAAI,EAAEH,OAAO,CAAC,CAAA;AACjD,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAII,MAAMA,GAAG;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,UAAU,CAAA;AACvC,GAAA;;AAEA;AACF;AACA;EACE,IAAIE,EAAEA,GAAG;IACP,OAAOC,YAAY,CAAC,IAAI,CAAC,CAAA;AAC3B,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAG;AACf;AACA,IAAA,IAAIC,OAAO,GAAG,CAAC,gBAAgB,CAAC,CAAA;;AAEhC;IACAA,OAAO,CAACC,IAAI,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAACN,MAAM,EAAE,CAAC,CAAA;AAErD,IAAA,OAAOK,OAAO,CAACE,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAG;AACf,IAAA,OAAO,IAAI,CAACP,IAAI,CAACO,UAAU,IAAI,KAAK,CAAA;AACtC,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAG;AACf,IAAA,OAAO,IAAI,CAACR,IAAI,CAACQ,UAAU,IAAI,KAAK,CAAA;AACtC,GAAA;AACF,CAAC,GAAAC,yBAAA,CAAAjB,MAAA,CAAAkB,SAAA,uBA3DEC,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAArB,MAAA,CAAAkB,SAAA,EAAAlB,kBAAAA,CAAAA,EAAAA,MAAA,CAAAkB,SAAA,CAAA,EAAAD,yBAAA,CAAAjB,MAAA,CAAAkB,SAAA,EAAA,kBAAA,EAAA,CAKNC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAArB,MAAA,CAAAkB,SAAA,uBAAAlB,MAAA,CAAAkB,SAAA,CAAAlB,GAAAA,MAAA,IAPRsB,eAAe,CAAA,CAAA,CAAA;AA+DhB,YAAAC,oBAAA,CAAAC,QAAA,EAAe1B,6BAA6B,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/fieldset/index.hbs","../../../../../src/components/hds/form/fieldset/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<fieldset class={{this.classNames}} id={{this.id}} ...attributes>\\n {{yield\\n (hash\\n Legend=(component\\n \\\"hds/form/legend\\\" isRequired=this.isRequired isOptional=this.isOptional contextualClass=\\\"hds-form-group__legend\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n HelperText=(component\\n \\\"hds/form/helper-text\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-group__helper-text\\\"\\n )\\n )\\n }}\\n <div class=\\\"hds-form-group__control-fields-wrapper\\\">\\n {{! @glint-expect-error }}\\n {{yield (hash Control=(component \\\"hds/yield\\\") ariaDescribedBy=this.ariaDescribedBy)}}\\n </div>\\n {{yield\\n (hash\\n Error=(component\\n \\\"hds/form/error\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n onRemove=this.removeDescriptor\\n contextualClass=\\\"hds-form-group__error\\\"\\n )\\n )\\n }}\\n</fieldset>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getElementId } from '../../../../utils/hds-get-element-id.ts';\nimport {\n ariaDescribedBy,\n registerAriaDescriptionElement,\n unregisterAriaDescriptionElement,\n} from '../../../../utils/hds-aria-described-by.ts';\nimport { HdsFormFieldsetLayoutValues } from './types.ts';\nimport HdsFormLegendComponent from '../legend/index.ts';\nimport HdsFormHelperTextComponent from '../helper-text/index.ts';\nimport HdsFormErrorComponent from '../error/index.ts';\n\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsFormFieldsetLayouts } from './types.ts';\nimport type { HdsYieldSignature } from '../../yield/index.ts';\n\nexport interface HdsFormFieldsetSignature {\n Args: {\n isOptional?: boolean;\n isRequired?: boolean;\n layout?: HdsFormFieldsetLayouts;\n };\n Blocks: {\n default: [\n {\n Legend?: WithBoundArgs<\n typeof HdsFormLegendComponent,\n 'contextualClass' | 'isRequired' | 'isOptional'\n >;\n HelperText?: WithBoundArgs<\n typeof HdsFormHelperTextComponent,\n 'contextualClass' | 'controlId' | 'onInsert'\n >;\n Control?: ComponentLike<HdsYieldSignature>;\n Error?: WithBoundArgs<\n typeof HdsFormErrorComponent,\n 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove'\n >;\n id?: string;\n ariaDescribedBy?: string;\n },\n ];\n };\n Element: HTMLElement;\n}\n\n// @ts-expect-error: decorator function return type 'ClassOf<AriaDescribedByComponent>' is not assignable to 'typeof HdsFormFieldComponent'\n@ariaDescribedBy\nclass HdsFormFieldsetComponent extends Component<HdsFormFieldsetSignature> {\n /**\n * Sets the layout of the group\n *\n * @param layout\n * @type {enum}\n * @default 'vertical'\n */\n get layout(): HdsFormFieldsetLayouts {\n return this.args.layout ?? HdsFormFieldsetLayoutValues.Vertical;\n }\n\n /**\n * Calculates the unique ID to assign to the fieldset\n */\n get id(): string {\n return getElementId(this);\n }\n\n /**\n * @param isRequired\n * @type {boolean}\n * @default false\n */\n get isRequired(): boolean {\n return this.args.isRequired || false;\n }\n\n /**\n * @param isOptional\n * @type {boolean}\n * @default false\n */\n get isOptional(): boolean {\n return this.args.isOptional || false;\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n // we just need a class for the layout\n const classes = ['hds-form-group'];\n\n // add a class based on the @layout argument\n classes.push(`hds-form-group--layout-${this.layout}`);\n\n return classes.join(' ');\n }\n\n @action\n appendDescriptor(element: HTMLElement): void {\n registerAriaDescriptionElement(this, element);\n }\n\n @action removeDescriptor(element: HTMLElement): void {\n unregisterAriaDescriptionElement(this, element);\n }\n}\n\nexport default HdsFormFieldsetComponent;\n"],"names":["HdsFormFieldsetComponent","c","_class","Component","layout","args","HdsFormFieldsetLayoutValues","Vertical","id","getElementId","isRequired","isOptional","classNames","classes","push","join","appendDescriptor","element","registerAriaDescriptionElement","removeDescriptor","unregisterAriaDescriptionElement","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","ariaDescribedBy","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,ugCAAugC;;;ACmDziC;AAAA,MAEMA,wBAAwB,GAAAC,CAAA,EAAAC,MAAA,GAAxBF,MAAAA,wBAAwB,SAASG,SAAS,CAA2B;AACzE;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIC,MAAMA,GAA2B;IACnC,OAAO,IAAI,CAACC,IAAI,CAACD,MAAM,IAAIE,2BAA2B,CAACC,QAAQ,CAAA;AACjE,GAAA;;AAEA;AACF;AACA;EACE,IAAIC,EAAEA,GAAW;IACf,OAAOC,YAAY,CAAC,IAAI,CAAC,CAAA;AAC3B,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAY;AACxB,IAAA,OAAO,IAAI,CAACL,IAAI,CAACK,UAAU,IAAI,KAAK,CAAA;AACtC,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAY;AACxB,IAAA,OAAO,IAAI,CAACN,IAAI,CAACM,UAAU,IAAI,KAAK,CAAA;AACtC,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAW;AACvB;AACA,IAAA,MAAMC,OAAO,GAAG,CAAC,gBAAgB,CAAC,CAAA;;AAElC;IACAA,OAAO,CAACC,IAAI,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAACV,MAAM,EAAE,CAAC,CAAA;AAErD,IAAA,OAAOS,OAAO,CAACE,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;EAGAC,gBAAgBA,CAACC,OAAoB,EAAQ;AAC3CC,IAAAA,8BAA8B,CAAC,IAAI,EAAED,OAAO,CAAC,CAAA;AAC/C,GAAA;EAEQE,gBAAgBA,CAACF,OAAoB,EAAQ;AACnDG,IAAAA,gCAAgC,CAAC,IAAI,EAAEH,OAAO,CAAC,CAAA;AACjD,GAAA;AACF,CAAC,GAAAI,yBAAA,CAAAnB,MAAA,CAAAoB,SAAA,uBAREC,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAvB,MAAA,CAAAoB,SAAA,EAAApB,kBAAAA,CAAAA,EAAAA,MAAA,CAAAoB,SAAA,CAAA,EAAAD,yBAAA,CAAAnB,MAAA,CAAAoB,SAAA,EAAA,kBAAA,EAAA,CAKNC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAvB,MAAA,CAAAoB,SAAA,uBAAApB,MAAA,CAAAoB,SAAA,CAAApB,GAAAA,MAAA,IA1DRwB,eAAe,CAAA,CAAA,CAAA;AA+DhB,YAAAC,oBAAA,CAAAC,QAAA,EAAe5B,wBAAwB,CAAA;;;;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ let HdsFormFieldsetLayoutValues = /*#__PURE__*/function (HdsFormFieldsetLayoutValues) {
7
+ HdsFormFieldsetLayoutValues["Vertical"] = "vertical";
8
+ HdsFormFieldsetLayoutValues["Flag"] = "flag";
9
+ return HdsFormFieldsetLayoutValues;
10
+ }({});
11
+
12
+ export { HdsFormFieldsetLayoutValues };
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../../../../../src/components/hds/form/fieldset/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsFormFieldsetLayoutValues {\n Vertical = 'vertical',\n Flag = 'flag',\n}\n\nexport type HdsFormFieldsetLayouts = `${HdsFormFieldsetLayoutValues}`;\n"],"names":["HdsFormFieldsetLayoutValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,2BAA2B,0BAA3BA,2BAA2B,EAAA;EAA3BA,2BAA2B,CAAA,UAAA,CAAA,GAAA,UAAA,CAAA;EAA3BA,2BAA2B,CAAA,MAAA,CAAA,GAAA,MAAA,CAAA;AAAA,EAAA,OAA3BA,2BAA2B,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}
@@ -1,10 +1,16 @@
1
- import templateOnly from '@ember/component/template-only';
1
+ import templateOnlyComponent from '@ember/component/template-only';
2
2
  import { precompileTemplate } from '@ember/template-compilation';
3
3
  import { setComponentTemplate } from '@ember/component';
4
4
 
5
- var TEMPLATE = precompileTemplate("{{! @glint-nocheck: not typesafe yet }}\n{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<input class=\"hds-form-file-input hds-typography-body-200\" ...attributes type=\"file\" />");
5
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<input class=\"hds-form-file-input hds-typography-body-200\" ...attributes type=\"file\" />");
6
6
 
7
- var base = setComponentTemplate(TEMPLATE, templateOnly());
7
+ /**
8
+ * Copyright (c) HashiCorp, Inc.
9
+ * SPDX-License-Identifier: MPL-2.0
10
+ */
11
+
12
+ const HdsFormFileInputBaseComponent = templateOnlyComponent();
13
+ var base = setComponentTemplate(TEMPLATE, HdsFormFileInputBaseComponent);
8
14
 
9
15
  export { base as default };
10
16
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/file-input/base.hbs","../../../../../src/components/hds/form/file-input/base.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n\\n<input class=\\\"hds-form-file-input hds-typography-body-200\\\" ...attributes type=\\\"file\\\" />\")","import templateOnly from '@ember/component/template-only';\nexport default templateOnly();\n"],"names":["setComponentTemplate","TEMPLATE","templateOnly"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,sNAAsN;;ACAxP,WAAAA,oBAAA,CAAAC,QAAA,EAAeC,YAAY,EAAE,CAAA;;;;"}
1
+ {"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/file-input/base.hbs","../../../../../src/components/hds/form/file-input/base.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<input class=\\\"hds-form-file-input hds-typography-body-200\\\" ...attributes type=\\\"file\\\" />\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\ninterface HdsFormFileInputBaseSignature {\n Element: HTMLInputElement;\n}\n\nconst HdsFormFileInputBaseComponent =\n templateOnlyComponent<HdsFormFileInputBaseSignature>();\n\nexport default HdsFormFileInputBaseComponent;\n"],"names":["HdsFormFileInputBaseComponent","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,2KAA2K;;ACD7M;AACA;AACA;AACA;;AAQA,MAAMA,6BAA6B,GACjCC,qBAAqB,EAAiC,CAAA;AAExD,WAAAC,oBAAA,CAAAC,QAAA,EAAeH,6BAA6B,CAAA;;;;"}
@@ -1,10 +1,16 @@
1
- import templateOnly from '@ember/component/template-only';
1
+ import templateOnlyComponent from '@ember/component/template-only';
2
2
  import { precompileTemplate } from '@ember/template-compilation';
3
3
  import { setComponentTemplate } from '@ember/component';
4
4
 
5
- var TEMPLATE = precompileTemplate("{{! @glint-nocheck: not typesafe yet }}\n{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::Form::Field\n @layout=\"vertical\"\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\n @isRequired={{@isRequired}}\n @isOptional={{@isOptional}}\n @id={{@id}}\n as |F|\n>\n {{! Notice: the order of the elements is not relevant here, because is controlled at \"Hds::Form::Field\" component level }}\n {{yield (hash Label=F.Label isRequired=F.isRequired isOptional=F.isOptional)}}\n {{yield (hash HelperText=F.HelperText Error=F.Error)}}\n <F.Control>\n <Hds::Form::FileInput::Base\n required={{@isRequired}}\n ...attributes\n id={{F.id}}\n aria-describedby={{F.ariaDescribedBy}}\n />\n </F.Control>\n</Hds::Form::Field>");
5
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::Form::Field\n @layout=\"vertical\"\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\n @isRequired={{@isRequired}}\n @isOptional={{@isOptional}}\n @id={{@id}}\n as |F|\n>\n {{! Notice: the order of the elements is not relevant here, because is controlled at \"Hds::Form::Field\" component level }}\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\n <F.Control>\n <Hds::Form::FileInput::Base\n required={{@isRequired}}\n ...attributes\n id={{F.id}}\n aria-describedby={{F.ariaDescribedBy}}\n />\n </F.Control>\n</Hds::Form::Field>");
6
6
 
7
- var field = setComponentTemplate(TEMPLATE, templateOnly());
7
+ /**
8
+ * Copyright (c) HashiCorp, Inc.
9
+ * SPDX-License-Identifier: MPL-2.0
10
+ */
11
+
12
+ const HdsFormFileInputFieldComponent = templateOnlyComponent();
13
+ var field = setComponentTemplate(TEMPLATE, HdsFormFileInputFieldComponent);
8
14
 
9
15
  export { field as default };
10
16
  //# sourceMappingURL=field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/file-input/field.hbs","../../../../../src/components/hds/form/file-input/field.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label isRequired=F.isRequired isOptional=F.isOptional)}}\\n {{yield (hash HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n <Hds::Form::FileInput::Base\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n </F.Control>\\n</Hds::Form::Field>\")","import templateOnly from '@ember/component/template-only';\nexport default templateOnly();\n"],"names":["setComponentTemplate","TEMPLATE","templateOnly"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,8wBAA8wB;;ACAhzB,YAAAA,oBAAA,CAAAC,QAAA,EAAeC,YAAY,EAAE,CAAA;;;;"}
1
+ {"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/file-input/field.hbs","../../../../../src/components/hds/form/file-input/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n <Hds::Form::FileInput::Base\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormFieldSignature } from '../field';\nimport type { HdsFormLabelSignature } from '../label';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormErrorSignature } from '../error';\n\ninterface HdsFormFileInputFieldSignature {\n Args: Omit<HdsFormFieldSignature['Args'], 'contextualClass' | 'layout'>;\n Blocks: {\n default: [\n {\n Label?: ComponentLike<HdsFormLabelSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n },\n ];\n };\n Element: HdsFormFieldSignature['Element'];\n}\n\nconst HdsFormFileInputFieldComponent =\n templateOnlyComponent<HdsFormFileInputFieldSignature>();\n\nexport default HdsFormFileInputFieldComponent;\n"],"names":["HdsFormFileInputFieldComponent","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,iqBAAiqB;;ACDnsB;AACA;AACA;AACA;;AAuBA,MAAMA,8BAA8B,GAClCC,qBAAqB,EAAkC,CAAA;AAEzD,YAAAC,oBAAA,CAAAC,QAAA,EAAeH,8BAA8B,CAAA;;;;"}
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
2
2
  import { precompileTemplate } from '@ember/template-compilation';
3
3
  import { setComponentTemplate } from '@ember/component';
4
4
 
5
- var TEMPLATE = precompileTemplate("{{! @glint-nocheck: not typesafe yet }}\n{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::Text::Body\n class={{this.classNames}}\n @tag=\"div\"\n @size=\"100\"\n @weight=\"regular\"\n id={{this.id}}\n {{did-insert this.onInsert}}\n ...attributes\n>\n {{yield}}\n</Hds::Text::Body>");
5
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::Text::Body\n class={{this.classNames}}\n @tag=\"div\"\n @size=\"100\"\n @weight=\"regular\"\n id={{this.id}}\n {{did-insert this.onInsert}}\n ...attributes\n>\n {{yield}}\n</Hds::Text::Body>");
6
6
 
7
7
  /**
8
8
  * Copyright (c) HashiCorp, Inc.
@@ -11,14 +11,14 @@ var TEMPLATE = precompileTemplate("{{! @glint-nocheck: not typesafe yet }}\n{{!\
11
11
 
12
12
  const ID_PREFIX = 'helper-text-';
13
13
  const NOOP = () => {};
14
- class HdsFormHelperTextIndexComponent extends Component {
14
+ class HdsFormHelperTextComponent extends Component {
15
15
  /**
16
16
  * Determines the unique ID to assign to the element
17
17
  * @method id
18
18
  * @return {(string|null)} The "id" attribute to apply to the element or null, if no controlId is provided
19
19
  */
20
20
  get id() {
21
- let {
21
+ const {
22
22
  controlId
23
23
  } = this.args;
24
24
  if (controlId) {
@@ -32,8 +32,9 @@ class HdsFormHelperTextIndexComponent extends Component {
32
32
  * @type {function}
33
33
  * @default () => {}
34
34
  */
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
36
  get onInsert() {
36
- let {
37
+ const {
37
38
  onInsert
38
39
  } = this.args;
39
40
 
@@ -51,7 +52,7 @@ class HdsFormHelperTextIndexComponent extends Component {
51
52
  * @return {string} The "class" attribute to apply to the component.
52
53
  */
53
54
  get classNames() {
54
- let classes = ['hds-form-helper-text'];
55
+ const classes = ['hds-form-helper-text'];
55
56
 
56
57
  // add a class based on the @contextualClass argument
57
58
  // notice: this will *not* be documented for public use
@@ -62,7 +63,7 @@ class HdsFormHelperTextIndexComponent extends Component {
62
63
  return classes.join(' ');
63
64
  }
64
65
  }
65
- setComponentTemplate(TEMPLATE, HdsFormHelperTextIndexComponent);
66
+ setComponentTemplate(TEMPLATE, HdsFormHelperTextComponent);
66
67
 
67
- export { ID_PREFIX, HdsFormHelperTextIndexComponent as default };
68
+ export { ID_PREFIX, HdsFormHelperTextComponent as default };
68
69
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/helper-text/index.hbs","../../../../../src/components/hds/form/helper-text/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body\\n class={{this.classNames}}\\n @tag=\\\"div\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"regular\\\"\\n id={{this.id}}\\n {{did-insert this.onInsert}}\\n ...attributes\\n>\\n {{yield}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nexport const ID_PREFIX = 'helper-text-';\n\nconst NOOP = () => {};\n\nexport default class HdsFormHelperTextIndexComponent extends Component {\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id() {\n let { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n get onInsert() {\n let { onInsert } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames() {\n let classes = ['hds-form-helper-text'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormHelperTextIndexComponent","Component","id","controlId","args","onInsert","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,qUAAqU;;ACDvW;AACA;AACA;AACA;;AAGO,MAAMA,SAAS,GAAG,eAAc;AAEvC,MAAMC,IAAI,GAAGA,MAAM,EAAE,CAAA;AAEN,MAAMC,+BAA+B,SAASC,SAAS,CAAC;AACrE;AACF;AACA;AACA;AACA;EACE,IAAIC,EAAEA,GAAG;IACP,IAAI;AAAEC,MAAAA,SAAAA;KAAW,GAAG,IAAI,CAACC,IAAI,CAAA;AAC7B,IAAA,IAAID,SAAS,EAAE;AACb,MAAA,OAAO,CAAGL,EAAAA,SAAS,CAAGK,EAAAA,SAAS,CAAE,CAAA,CAAA;AACnC,KAAA;AACA,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIE,QAAQA,GAAG;IACb,IAAI;AAAEA,MAAAA,QAAAA;KAAU,GAAG,IAAI,CAACD,IAAI,CAAA;;AAE5B;AACA,IAAA,IAAI,OAAOC,QAAQ,KAAK,UAAU,EAAE;AAClC,MAAA,OAAOA,QAAQ,CAAA;AACjB,KAAC,MAAM;AACL,MAAA,OAAON,IAAI,CAAA;AACb,KAAA;AACF,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIO,UAAUA,GAAG;AACf,IAAA,IAAIC,OAAO,GAAG,CAAC,sBAAsB,CAAC,CAAA;;AAEtC;AACA;AACA;AACA,IAAA,IAAI,IAAI,CAACH,IAAI,CAACI,eAAe,EAAE;MAC7BD,OAAO,CAACE,IAAI,CAAC,IAAI,CAACL,IAAI,CAACI,eAAe,CAAC,CAAA;AACzC,KAAA;AAEA,IAAA,OAAOD,OAAO,CAACG,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EA/CoBZ,+BAA+B,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/helper-text/index.hbs","../../../../../src/components/hds/form/helper-text/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body\\n class={{this.classNames}}\\n @tag=\\\"div\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"regular\\\"\\n id={{this.id}}\\n {{did-insert this.onInsert}}\\n ...attributes\\n>\\n {{yield}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsTextBodySignature } from '../../text/body';\n\nexport const ID_PREFIX = 'helper-text-';\n\nconst NOOP = (): void => {};\n\nexport interface HdsFormHelperTextSignature {\n Args: {\n contextualClass?: string;\n controlId?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onInsert?: (element: HTMLElement, ...args: any[]) => void;\n };\n Blocks: {\n default: [];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nexport default class HdsFormHelperTextComponent extends Component<HdsFormHelperTextSignature> {\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id(): string | null {\n const { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onInsert(): (element: HTMLElement, ...args: any[]) => void {\n const { onInsert } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-helper-text'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormHelperTextComponent","Component","id","controlId","args","onInsert","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,4RAA4R;;ACD9T;AACA;AACA;AACA;;AAKO,MAAMA,SAAS,GAAG,eAAc;AAEvC,MAAMC,IAAI,GAAGA,MAAY,EAAE,CAAA;AAeZ,MAAMC,0BAA0B,SAASC,SAAS,CAA6B;AAC5F;AACF;AACA;AACA;AACA;EACE,IAAIC,EAAEA,GAAkB;IACtB,MAAM;AAAEC,MAAAA,SAAAA;KAAW,GAAG,IAAI,CAACC,IAAI,CAAA;AAC/B,IAAA,IAAID,SAAS,EAAE;AACb,MAAA,OAAO,CAAGL,EAAAA,SAAS,CAAGK,EAAAA,SAAS,CAAE,CAAA,CAAA;AACnC,KAAA;AACA,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACE;EACA,IAAIE,QAAQA,GAAmD;IAC7D,MAAM;AAAEA,MAAAA,QAAAA;KAAU,GAAG,IAAI,CAACD,IAAI,CAAA;;AAE9B;AACA,IAAA,IAAI,OAAOC,QAAQ,KAAK,UAAU,EAAE;AAClC,MAAA,OAAOA,QAAQ,CAAA;AACjB,KAAC,MAAM;AACL,MAAA,OAAON,IAAI,CAAA;AACb,KAAA;AACF,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIO,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,sBAAsB,CAAC,CAAA;;AAExC;AACA;AACA;AACA,IAAA,IAAI,IAAI,CAACH,IAAI,CAACI,eAAe,EAAE;MAC7BD,OAAO,CAACE,IAAI,CAAC,IAAI,CAACL,IAAI,CAACI,eAAe,CAAC,CAAA;AACzC,KAAA;AAEA,IAAA,OAAOD,OAAO,CAACG,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EAhDoBZ,0BAA0B,CAAA;;;;"}
@@ -2,21 +2,21 @@ import Component from '@glimmer/component';
2
2
  import { precompileTemplate } from '@ember/template-compilation';
3
3
  import { setComponentTemplate } from '@ember/component';
4
4
 
5
- var TEMPLATE = precompileTemplate("{{! @glint-nocheck: not typesafe yet }}\n{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n{{#if @isOptional}}\n <Hds::Text::Body class={{this.classNames}} tag=\"span\" @size=\"100\" @weight=\"regular\">(Optional)</Hds::Text::Body>\n{{/if}}\n{{#if @isRequired}}\n &nbsp;<Hds::Badge aria-hidden=\"true\" class={{this.classNames}} @size=\"small\" @color=\"neutral\" @text=\"Required\" />\n{{/if}}");
5
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n{{#if @isOptional}}\n <Hds::Text::Body class={{this.classNames}} tag=\"span\" @size=\"100\" @weight=\"regular\">(Optional)</Hds::Text::Body>\n{{/if}}\n{{#if @isRequired}}\n &nbsp;<Hds::Badge aria-hidden=\"true\" class={{this.classNames}} @size=\"small\" @color=\"neutral\" @text=\"Required\" />\n{{/if}}");
6
6
 
7
7
  /**
8
8
  * Copyright (c) HashiCorp, Inc.
9
9
  * SPDX-License-Identifier: MPL-2.0
10
10
  */
11
11
 
12
- class HdsFormIndicatorIndexComponent extends Component {
12
+ class HdsFormIndicatorComponent extends Component {
13
13
  /**
14
14
  * Get the class names to apply to the component.
15
15
  * @method classNames
16
16
  * @return {string} The "class" attribute to apply to the component.
17
17
  */
18
18
  get classNames() {
19
- let classes = ['hds-form-indicator'];
19
+ const classes = ['hds-form-indicator'];
20
20
  if (this.args.isOptional) {
21
21
  // add speficic class for "optional" indicator
22
22
  classes.push('hds-form-indicator--optional');
@@ -24,7 +24,7 @@ class HdsFormIndicatorIndexComponent extends Component {
24
24
  return classes.join(' ');
25
25
  }
26
26
  }
27
- setComponentTemplate(TEMPLATE, HdsFormIndicatorIndexComponent);
27
+ setComponentTemplate(TEMPLATE, HdsFormIndicatorComponent);
28
28
 
29
- export { HdsFormIndicatorIndexComponent as default };
29
+ export { HdsFormIndicatorComponent as default };
30
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/indicator/index.hbs","../../../../../src/components/hds/form/indicator/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{#if @isOptional}}\\n <Hds::Text::Body class={{this.classNames}} tag=\\\"span\\\" @size=\\\"100\\\" @weight=\\\"regular\\\">(Optional)</Hds::Text::Body>\\n{{/if}}\\n{{#if @isRequired}}\\n &nbsp;<Hds::Badge aria-hidden=\\\"true\\\" class={{this.classNames}} @size=\\\"small\\\" @color=\\\"neutral\\\" @text=\\\"Required\\\" />\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nexport default class HdsFormIndicatorIndexComponent extends Component {\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames() {\n let classes = ['hds-form-indicator'];\n\n if (this.args.isOptional) {\n // add speficic class for \"optional\" indicator\n classes.push('hds-form-indicator--optional');\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormIndicatorIndexComponent","Component","classNames","classes","args","isOptional","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,0aAA0a;;ACD5c;AACA;AACA;AACA;;AAIe,MAAMA,8BAA8B,SAASC,SAAS,CAAC;AACpE;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAG;AACf,IAAA,IAAIC,OAAO,GAAG,CAAC,oBAAoB,CAAC,CAAA;AAEpC,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,UAAU,EAAE;AACxB;AACAF,MAAAA,OAAO,CAACG,IAAI,CAAC,8BAA8B,CAAC,CAAA;AAC9C,KAAA;AAEA,IAAA,OAAOH,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EAhBoBT,8BAA8B,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/indicator/index.hbs","../../../../../src/components/hds/form/indicator/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{#if @isOptional}}\\n <Hds::Text::Body class={{this.classNames}} tag=\\\"span\\\" @size=\\\"100\\\" @weight=\\\"regular\\\">(Optional)</Hds::Text::Body>\\n{{/if}}\\n{{#if @isRequired}}\\n &nbsp;<Hds::Badge aria-hidden=\\\"true\\\" class={{this.classNames}} @size=\\\"small\\\" @color=\\\"neutral\\\" @text=\\\"Required\\\" />\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsTextBodySignature } from '../../text/body';\nimport type { HdsBadgeSignature } from '../../badge';\n\nexport interface HdsFormIndicatorSignature {\n Args: {\n isOptional?: boolean;\n isRequired?: boolean;\n };\n Element: HdsTextBodySignature['Element'] | HdsBadgeSignature['Element'];\n}\n\nexport default class HdsFormIndicatorComponent extends Component<HdsFormIndicatorSignature> {\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-indicator'];\n\n if (this.args.isOptional) {\n // add speficic class for \"optional\" indicator\n classes.push('hds-form-indicator--optional');\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormIndicatorComponent","Component","classNames","classes","args","isOptional","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,iYAAiY;;ACDna;AACA;AACA;AACA;;AAce,MAAMA,yBAAyB,SAASC,SAAS,CAA4B;AAC1F;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,oBAAoB,CAAC,CAAA;AAEtC,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,UAAU,EAAE;AACxB;AACAF,MAAAA,OAAO,CAACG,IAAI,CAAC,8BAA8B,CAAC,CAAA;AAC9C,KAAA;AAEA,IAAA,OAAOH,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EAhBoBT,yBAAyB,CAAA;;;;"}