@uh-design-system/component-library 0.5.2 → 0.6.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 (243) hide show
  1. package/dist/cjs/{utils-3412cbed.js → attributes-BMbXzbwU.js} +2 -28
  2. package/dist/cjs/component-library.cjs.js +7 -7
  3. package/dist/cjs/controlUtils-ofqiQxRF.js +42 -0
  4. package/dist/cjs/ds-accordion.cjs.entry.js +79 -0
  5. package/dist/cjs/ds-button.cjs.entry.js +107 -0
  6. package/dist/cjs/ds-card.cjs.entry.js +58 -0
  7. package/dist/cjs/ds-checkbox-group.cjs.entry.js +109 -49
  8. package/dist/cjs/ds-checkbox.cjs.entry.js +88 -79
  9. package/dist/cjs/ds-icon.cjs.entry.js +943 -0
  10. package/dist/cjs/ds-input-validity.cjs.entry.js +14 -15
  11. package/dist/cjs/ds-link-with-arrow.cjs.entry.js +21 -20
  12. package/dist/cjs/ds-link.cjs.entry.js +34 -31
  13. package/dist/cjs/ds-radio-button-group.cjs.entry.js +153 -0
  14. package/dist/cjs/ds-radio-button.cjs.entry.js +151 -0
  15. package/dist/cjs/ds-spinner.cjs.entry.js +62 -0
  16. package/dist/cjs/ds-text-input.cjs.entry.js +90 -77
  17. package/dist/cjs/ds-visually-hidden.cjs.entry.js +3 -6
  18. package/dist/cjs/index-Bp6Dd2i1.js +94 -0
  19. package/dist/cjs/{store-9bd20f3c.js → index-DwLFyR5p.js} +6 -2
  20. package/dist/cjs/{index-bf84b124.js → index-Mjp9Y-Sw.js} +701 -55
  21. package/dist/cjs/index.cjs.js +3 -5
  22. package/dist/cjs/{linkUtils-695da37c.js → linkUtils-onlbgKdI.js} +4 -2
  23. package/dist/cjs/loader.cjs.js +3 -5
  24. package/dist/cjs/utils-BjZTECpy.js +29 -0
  25. package/dist/collection/accessibility/stories/naming.stories.js +3 -3
  26. package/dist/collection/collection-manifest.json +78 -3
  27. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +18 -17
  28. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +91 -50
  29. package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.examples.stories.js +6 -6
  30. package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.features.stories.js +14 -14
  31. package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.stories.js +24 -66
  32. package/dist/collection/components/01-base-components/ds-button/ds-button.css +124 -145
  33. package/dist/collection/components/01-base-components/ds-button/ds-button.js +150 -65
  34. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +121 -23
  35. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +49 -42
  36. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.stories.js +16 -72
  37. package/dist/collection/components/01-base-components/ds-card/ds-card.css +127 -0
  38. package/dist/collection/components/01-base-components/ds-card/ds-card.js +303 -0
  39. package/dist/collection/components/01-base-components/ds-card/stories/ds-card.examples.stories.js +92 -0
  40. package/dist/collection/components/01-base-components/ds-card/stories/ds-card.features.stories.js +66 -0
  41. package/dist/collection/components/01-base-components/ds-card/stories/ds-card.stories.js +71 -0
  42. package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +46 -46
  43. package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.js +120 -111
  44. package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.features.stories.js +20 -20
  45. package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.js +12 -25
  46. package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.css +2 -3
  47. package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js +214 -63
  48. package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.js +215 -50
  49. package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.stories.js +30 -28
  50. package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +36 -31
  51. package/dist/collection/components/01-base-components/ds-icon/stories/ds-icon.stories.js +10 -37
  52. package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.css +2 -2
  53. package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js +60 -30
  54. package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.features.stories.js +4 -4
  55. package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.js +4 -9
  56. package/dist/collection/components/01-base-components/ds-link/ds-link.css +24 -14
  57. package/dist/collection/components/01-base-components/ds-link/ds-link.js +74 -75
  58. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.examples.stories.js +27 -27
  59. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.features.stories.js +38 -21
  60. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +8 -67
  61. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +10 -12
  62. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +30 -52
  63. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.examples.stories.js +4 -4
  64. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.features.stories.js +6 -6
  65. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.stories.js +4 -28
  66. package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.css +115 -0
  67. package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.js +449 -0
  68. package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.js +72 -0
  69. package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.js +22 -0
  70. package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.css +30 -0
  71. package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.js +360 -0
  72. package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.js +42 -0
  73. package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.js +71 -0
  74. package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.js +60 -0
  75. package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.css +279 -0
  76. package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.js +221 -0
  77. package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.examples.stories.js +120 -0
  78. package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.features.stories.js +107 -0
  79. package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.stories.js +14 -0
  80. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +85 -118
  81. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +230 -155
  82. package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.examples.stories.js +26 -21
  83. package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.features.stories.js +40 -40
  84. package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.stories.js +30 -56
  85. package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
  86. package/dist/collection/store.js +7 -1
  87. package/dist/collection/utils/attributes/attributes.js +2 -2
  88. package/dist/collection/utils/button/buttonUtils.js +14 -0
  89. package/dist/collection/utils/colours/colourTypes.js +3 -3
  90. package/dist/collection/utils/colours/colourUtils.js +5 -3
  91. package/dist/collection/utils/controls/controlUtils.js +35 -1
  92. package/dist/collection/utils/link/linkUtils.js +3 -2
  93. package/dist/collection/utils/spinner/spinnerUtils.js +20 -0
  94. package/dist/collection/utils/tests/testUtils.js +1 -0
  95. package/dist/collection/utils/typography/typographyUtils.js +3 -3
  96. package/dist/collection/utils/utils.js +10 -9
  97. package/dist/component-library/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +1 -1
  98. package/dist/component-library/component-library.css +1 -1
  99. package/dist/component-library/component-library.esm.js +1 -1
  100. package/dist/component-library/controlUtils-CNER0MvM.js +1 -0
  101. package/dist/component-library/ds-accordion.entry.js +1 -0
  102. package/dist/component-library/ds-button.entry.js +1 -0
  103. package/dist/component-library/ds-card.entry.js +1 -0
  104. package/dist/component-library/ds-checkbox-group.entry.js +1 -1
  105. package/dist/component-library/ds-checkbox.entry.js +1 -1
  106. package/dist/component-library/ds-icon.entry.js +1 -0
  107. package/dist/component-library/ds-input-validity.entry.js +1 -1
  108. package/dist/component-library/ds-link-with-arrow.entry.js +1 -1
  109. package/dist/component-library/ds-link.entry.js +1 -1
  110. package/dist/component-library/ds-radio-button-group.entry.js +1 -0
  111. package/dist/component-library/ds-radio-button.entry.js +1 -0
  112. package/dist/component-library/ds-spinner.entry.js +1 -0
  113. package/dist/component-library/ds-text-input.entry.js +1 -1
  114. package/dist/component-library/ds-visually-hidden.entry.js +1 -1
  115. package/dist/component-library/index-BfTCfPZ1.js +6 -0
  116. package/dist/component-library/index-Cm7V4EAn.js +2 -0
  117. package/dist/component-library/index-DuYjhvTn.js +1 -0
  118. package/dist/component-library/index.esm.js +1 -1
  119. package/dist/component-library/linkUtils-02nCfO0F.js +1 -0
  120. package/dist/component-library/utils-CqaqnfY4.js +1 -0
  121. package/dist/components/attributes.js +3 -3
  122. package/dist/components/controlUtils.js +35 -2
  123. package/dist/components/ds-accordion.js +58 -42
  124. package/dist/components/ds-button2.js +78 -39
  125. package/dist/components/ds-card.d.ts +11 -0
  126. package/dist/components/ds-card.js +91 -0
  127. package/dist/components/ds-checkbox-group.js +116 -56
  128. package/dist/components/ds-checkbox2.js +93 -80
  129. package/dist/components/ds-icon2.js +292 -292
  130. package/dist/components/ds-input-validity2.js +17 -14
  131. package/dist/components/ds-link-with-arrow.js +22 -22
  132. package/dist/components/ds-link.js +43 -40
  133. package/dist/components/ds-radio-button-group.d.ts +11 -0
  134. package/dist/components/ds-radio-button-group.js +185 -0
  135. package/dist/components/ds-radio-button.d.ts +11 -0
  136. package/dist/components/ds-radio-button.js +198 -0
  137. package/dist/components/ds-spinner.d.ts +11 -0
  138. package/dist/components/ds-spinner.js +6 -0
  139. package/dist/components/ds-spinner2.js +89 -0
  140. package/dist/components/ds-text-input.js +126 -104
  141. package/dist/components/ds-visually-hidden2.js +2 -3
  142. package/dist/components/index.js +208 -2
  143. package/dist/components/index2.js +713 -39
  144. package/dist/components/index3.js +69 -57
  145. package/dist/components/linkUtils.js +4 -2
  146. package/dist/docs.d.ts +443 -0
  147. package/dist/docs.json +4790 -0
  148. package/dist/esm/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +3 -26
  149. package/dist/esm/component-library.js +6 -5
  150. package/dist/esm/controlUtils-CNER0MvM.js +37 -0
  151. package/dist/esm/ds-accordion.entry.js +77 -0
  152. package/dist/esm/ds-button.entry.js +105 -0
  153. package/dist/esm/ds-card.entry.js +56 -0
  154. package/dist/esm/ds-checkbox-group.entry.js +108 -46
  155. package/dist/esm/ds-checkbox.entry.js +78 -67
  156. package/dist/esm/ds-icon.entry.js +941 -0
  157. package/dist/esm/ds-input-validity.entry.js +14 -13
  158. package/dist/esm/ds-link-with-arrow.entry.js +21 -18
  159. package/dist/esm/ds-link.entry.js +34 -29
  160. package/dist/esm/ds-radio-button-group.entry.js +151 -0
  161. package/dist/esm/ds-radio-button.entry.js +149 -0
  162. package/dist/esm/ds-spinner.entry.js +60 -0
  163. package/dist/esm/ds-text-input.entry.js +88 -73
  164. package/dist/esm/ds-visually-hidden.entry.js +3 -4
  165. package/dist/esm/index-BfTCfPZ1.js +92 -0
  166. package/dist/esm/{index-434995e1.js → index-Cm7V4EAn.js} +699 -34
  167. package/dist/{components/store.js → esm/index-DuYjhvTn.js} +6 -3
  168. package/dist/esm/index.js +2 -2
  169. package/dist/esm/{linkUtils-3d1b28cf.js → linkUtils-02nCfO0F.js} +4 -2
  170. package/dist/esm/loader.js +4 -4
  171. package/dist/esm/utils-CqaqnfY4.js +25 -0
  172. package/dist/hydrate/index.d.ts +271 -0
  173. package/dist/hydrate/index.js +22280 -0
  174. package/dist/hydrate/index.mjs +22272 -0
  175. package/dist/hydrate/package.json +12 -0
  176. package/dist/styles/helpers.css +15 -0
  177. package/dist/styles/helpers.css.map +1 -0
  178. package/dist/styles/mixins/_breakpoints.scss +13 -0
  179. package/dist/styles/mixins/_focus.scss +26 -0
  180. package/dist/styles/mixins/_wrapper.scss +5 -0
  181. package/dist/styles/mixins/imports-default/_imports.scss +2 -0
  182. package/dist/styles/mixins/tokens/_breakpoints.scss +13 -0
  183. package/dist/styles/mixins/tokens/_semantic-colours.scss +75 -0
  184. package/dist/styles/mixins.scss +12 -0
  185. package/dist/styles/variables.css +176 -0
  186. package/dist/styles/variables.css.map +1 -0
  187. package/dist/types/components/01-base-components/ds-accordion/ds-accordion.d.ts +11 -8
  188. package/dist/types/components/01-base-components/ds-button/ds-button.d.ts +16 -11
  189. package/dist/types/components/01-base-components/ds-button/stories/ds-button.examples.stories.d.ts +1 -0
  190. package/dist/types/components/01-base-components/ds-button/stories/ds-button.features.stories.d.ts +1 -0
  191. package/dist/types/components/01-base-components/ds-card/ds-card.d.ts +20 -0
  192. package/dist/types/components/01-base-components/ds-card/stories/ds-card.examples.stories.d.ts +8 -0
  193. package/dist/types/components/01-base-components/ds-card/stories/ds-card.features.stories.d.ts +8 -0
  194. package/dist/types/components/01-base-components/ds-card/stories/ds-card.stories.d.ts +7 -0
  195. package/dist/types/components/01-base-components/ds-checkbox/ds-checkbox.d.ts +21 -22
  196. package/dist/types/components/01-base-components/ds-checkbox-group/ds-checkbox-group.d.ts +21 -11
  197. package/dist/types/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.d.ts +3 -0
  198. package/dist/types/components/01-base-components/ds-icon/ds-icon.d.ts +7 -5
  199. package/dist/types/components/01-base-components/ds-input-validity/ds-input-validity.d.ts +5 -6
  200. package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +13 -14
  201. package/dist/types/components/01-base-components/ds-link/stories/ds-link.features.stories.d.ts +2 -0
  202. package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +5 -7
  203. package/dist/types/components/01-base-components/ds-radio-button/ds-radio-button.d.ts +44 -0
  204. package/dist/types/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.d.ts +15 -0
  205. package/dist/types/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.d.ts +7 -0
  206. package/dist/types/components/01-base-components/ds-radio-button-group/ds-radio-button-group.d.ts +34 -0
  207. package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.d.ts +6 -0
  208. package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.d.ts +11 -0
  209. package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.d.ts +7 -0
  210. package/dist/types/components/01-base-components/ds-spinner/ds-spinner.d.ts +17 -0
  211. package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.examples.stories.d.ts +7 -0
  212. package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.features.stories.d.ts +7 -0
  213. package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.stories.d.ts +7 -0
  214. package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +37 -32
  215. package/dist/types/components.d.ts +1287 -228
  216. package/dist/types/stencil-public-runtime.d.ts +22 -0
  217. package/dist/types/store.d.ts +6 -1
  218. package/dist/types/utils/attributes/attributes.d.ts +1 -1
  219. package/dist/types/utils/button/buttonUtils.d.ts +1 -0
  220. package/dist/types/utils/colours/colourTypes.d.ts +3 -3
  221. package/dist/types/utils/controls/controlUtils.d.ts +2 -0
  222. package/dist/types/utils/link/linkUtils.d.ts +1 -1
  223. package/dist/types/utils/spinner/spinnerUtils.d.ts +1 -0
  224. package/dist/types/utils/tests/testUtils.d.ts +1 -0
  225. package/dist/types/utils/utils.d.ts +2 -1
  226. package/package.json +40 -36
  227. package/dist/cjs/controlUtils-041de0fd.js +0 -7
  228. package/dist/cjs/ds-accordion_3.cjs.entry.js +0 -1095
  229. package/dist/cjs/index-5b0b9d4c.js +0 -82
  230. package/dist/component-library/controlUtils-9ca4087b.js +0 -1
  231. package/dist/component-library/ds-accordion_3.entry.js +0 -1
  232. package/dist/component-library/index-434995e1.js +0 -2
  233. package/dist/component-library/index-72ac5051.js +0 -6
  234. package/dist/component-library/linkUtils-3d1b28cf.js +0 -1
  235. package/dist/component-library/store-b8d17c10.js +0 -1
  236. package/dist/esm/controlUtils-9ca4087b.js +0 -4
  237. package/dist/esm/ds-accordion_3.entry.js +0 -1089
  238. package/dist/esm/index-72ac5051.js +0 -80
  239. package/dist/esm/store-b8d17c10.js +0 -204
  240. package/dist/loader/package.json +0 -11
  241. /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
  242. /package/dist/component-library/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
  243. /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
@@ -1,10 +1,9 @@
1
1
  import { p as proxyCustomElement, H, h } from './index2.js';
2
2
  import { c as classNames } from './index3.js';
3
- import { i as isValidation } from './store.js';
3
+ import { i as isValidation } from './index.js';
4
4
  import { d as defineCustomElement$1 } from './ds-icon2.js';
5
5
 
6
- const dsInputValidityCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.ds-input-validity{display:flex;align-items:center;margin-top:var(--ds-spacing-2xSmall);gap:var(--ds-spacing-2xSmall)}.ds-input-validity--error{color:var(--ds-textColor-danger)}.ds-input-validity--success{color:var(--ds-textColor-success)}.ds-input-validity ds-icon{display:block;height:1.5rem}.ds-input-validity small{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large)}";
7
- const DsInputValidityStyle0 = dsInputValidityCss;
6
+ const dsInputValidityCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.ds-input-validity{display:flex;align-items:center;margin-top:var(--ds-spacing-2xSmall);gap:var(--ds-spacing-2xSmall)}.ds-input-validity--error{color:var(--ds-palette-red-70)}.ds-input-validity--success{color:var(--ds-palette-green-70)}.ds-input-validity ds-icon{display:block;height:1.5rem}.ds-input-validity small{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large)}";
8
7
 
9
8
  const DsInputValidity = proxyCustomElement(class DsInputValidity extends H {
10
9
  constructor() {
@@ -12,9 +11,11 @@ const DsInputValidity = proxyCustomElement(class DsInputValidity extends H {
12
11
  this.__registerHost();
13
12
  }
14
13
  get el() { return this; }
15
- text;
16
- type = 'error';
17
- validityRole;
14
+ dsText;
15
+ dsType = 'error';
16
+ dsValidityRole;
17
+ dsAriaLive;
18
+ dsAriaAtomic;
18
19
  identifier;
19
20
  componentDidLoad() {
20
21
  this.identifier = this.el.getAttribute('id');
@@ -22,17 +23,19 @@ const DsInputValidity = proxyCustomElement(class DsInputValidity extends H {
22
23
  }
23
24
  render() {
24
25
  const classes = classNames('ds-input-validity', {
25
- 'ds-input-validity--error': this.type === 'error',
26
- 'ds-input-validity--success': this.type === 'success',
26
+ 'ds-input-validity--error': this.dsType === 'error',
27
+ 'ds-input-validity--success': this.dsType === 'success',
27
28
  });
28
- const icon = this.type === 'success' ? 'check_circle_fill' : 'warning_fill';
29
- return (h("div", { key: '2eca152eca6e7b4d7e894ff8aaf50a6d03c3e44f', role: isValidation('client') ? this.validityRole : undefined }, this.text && (h("div", { key: '73e4cd1b3af6a84b9c7cbca813c166bc10e9dd26', class: classes }, h("ds-icon", { key: '4eaad4001e758837f9e8b1aae48292a1c5a1a08f', name: icon }), h("small", { key: '3ee5d39785454b9aab9ae6012f3ad940c1f18df0', id: this.identifier }, this.text)))));
29
+ const icon = this.dsType === 'success' ? 'check_circle_fill' : 'warning_fill';
30
+ return (h("div", { key: '469ca293035b5f7f7f832fcde1651aef6d8a7e93', role: isValidation('client') ? this.dsValidityRole : undefined, "aria-live": isValidation('client') ? this.dsAriaLive : undefined, "aria-atomic": isValidation('client') ? this.dsAriaAtomic : undefined }, this.dsText && (h("div", { key: 'c1b800c75f2434fd3f26f656289853897a5fd485', class: classes }, h("ds-icon", { key: '7af7ca8d0ab5be6b795f4143c310b5134cadc7cd', dsName: icon }), h("small", { key: '81f8f36d3558f98331a0ec15cffcc3a6bb41f449', id: this.identifier }, this.dsText)))));
30
31
  }
31
- static get style() { return DsInputValidityStyle0; }
32
+ static get style() { return dsInputValidityCss; }
32
33
  }, [0, "ds-input-validity", {
33
- "text": [1],
34
- "type": [1],
35
- "validityRole": [1, "role"],
34
+ "dsText": [1, "ds-text"],
35
+ "dsType": [1, "ds-type"],
36
+ "dsValidityRole": [1, "ds-validity-role"],
37
+ "dsAriaLive": [1, "ds-aria-live"],
38
+ "dsAriaAtomic": [1, "ds-aria-atomic"],
36
39
  "identifier": [32]
37
40
  }]);
38
41
  function defineCustomElement() {
@@ -1,12 +1,11 @@
1
1
  import { p as proxyCustomElement, H, h } from './index2.js';
2
2
  import { c as classNames } from './index3.js';
3
- import { i as inheritAriaAttributes } from './attributes.js';
3
+ import { b as inheritSpecifiedAttributes, a as inheritAriaAttributes } from './attributes.js';
4
4
  import { o as opensInNewTab, v as visuallyHiddenAssistiveText } from './linkUtils.js';
5
- import { g as getAriaLabel, i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
5
+ import { i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
6
6
  import { d as defineCustomElement$2 } from './ds-visually-hidden2.js';
7
7
 
8
- const dsLinkWithArrowCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link-with-arrow{display:inline-flex;align-items:center;color:var(--ds-textColor-link);letter-spacing:var(--ds-letterSpacing-wide);font-weight:var(--ds-fontWeight-semibold);font-size:var(--ds-fontSize-16);text-decoration-line:none}.ds-link-with-arrow:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}@media (min-width: 30rem){.ds-link-with-arrow{font-size:var(--ds-fontSize-18)}}.ds-link-with-arrow__icon{display:inline-flex;width:2em;height:2em;line-height:0;align-items:center;justify-content:center;color:var(--ds-textColor-white);background-color:var(--ds-bgColor-primary)}.ds-link-with-arrow__icon--start{margin-right:var(--ds-spacing-xSmall)}.ds-link-with-arrow__icon--end{margin-left:var(--ds-spacing-xSmall)}:hover slot>.ds-link-with-arrow__icon{outline:10px solid;background-color:var(--ds-bgColor-primary-hover)}:active slot>.ds-link-with-arrow__icon{background-color:var(--ds-bgColor-primary-active)}.ds-link-with-arrow:hover,.ds-link-with-arrow:active{text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:12%;text-underline-position:from-font}.ds-link-with-arrow:hover{color:var(--ds-textColor-link-hover)}.ds-link-with-arrow:active,.ds-link-with-arrow:focus-visible{color:var(--ds-textColor-link-active)}";
9
- const DsLinkWithArrowStyle0 = dsLinkWithArrowCss;
8
+ const dsLinkWithArrowCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link-with-arrow{display:inline-flex;align-items:center;color:var(--ds-palette-mainBlue-70);letter-spacing:var(--ds-letterSpacing-wide);font-weight:var(--ds-fontWeight-semibold);font-size:var(--ds-fontSize-16);text-decoration-line:none}.ds-link-with-arrow:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);outline:var(--ds-borderWidth-thin) solid var(--ds-palette-black-95);outline-offset:calc(var(--ds-borderWidth-thin) * 1)}@media (min-width: 30rem){.ds-link-with-arrow{font-size:var(--ds-fontSize-18)}}.ds-link-with-arrow__icon{display:inline-flex;width:2em;height:2em;line-height:0;align-items:center;justify-content:center;color:var(--ds-palette-white);background-color:var(--ds-palette-mainBlue-70)}.ds-link-with-arrow__icon--start{margin-right:var(--ds-spacing-xSmall)}.ds-link-with-arrow__icon--end{margin-left:var(--ds-spacing-xSmall)}:hover slot>.ds-link-with-arrow__icon{outline:10px solid;background-color:var(--ds-palette-mainBlue-80)}:active slot>.ds-link-with-arrow__icon{background-color:var(--ds-palette-mainBlue-90)}.ds-link-with-arrow:hover,.ds-link-with-arrow:active{text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:12%;text-underline-position:from-font}.ds-link-with-arrow:hover{color:var(--ds-palette-mainBlue-80)}.ds-link-with-arrow:active,.ds-link-with-arrow:focus-visible{color:var(--ds-palette-mainBlue-90)}";
10
9
 
11
10
  const visuallyHiddenAssistiveTextIdGenerator = idGenerator('visually-hidden-assistive-text');
12
11
  const DsLinkWithArrow$1 = proxyCustomElement(class DsLinkWithArrow extends H {
@@ -20,15 +19,17 @@ const DsLinkWithArrow$1 = proxyCustomElement(class DsLinkWithArrow extends H {
20
19
  rel;
21
20
  visuallyHiddenAssistiveTextId = visuallyHiddenAssistiveTextIdGenerator.next().value;
22
21
  get el() { return this; }
23
- text;
24
- iconPosition = 'start';
25
- href;
26
- target;
27
- language;
28
- ariaLabel;
22
+ dsText;
23
+ dsIconPosition = 'start';
24
+ dsHref;
25
+ dsTarget;
26
+ dsAriaLabel;
29
27
  componentWillLoad() {
30
- this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-label']);
31
- if (opensInNewTab(this.target)) {
28
+ this.inheritedAttributes = {
29
+ ...inheritAriaAttributes(this.el, ['aria-label']),
30
+ ...inheritSpecifiedAttributes(this.el, ['lang']),
31
+ };
32
+ if (opensInNewTab(this.dsTarget)) {
32
33
  this.icon = 'arrow_outward';
33
34
  this.rel = 'noopener noreferrer';
34
35
  }
@@ -36,19 +37,18 @@ const DsLinkWithArrow$1 = proxyCustomElement(class DsLinkWithArrow extends H {
36
37
  render() {
37
38
  const classes = classNames('ds-link-with-arrow');
38
39
  const iconClasses = classNames('ds-link-with-arrow__icon', {
39
- 'ds-link-with-arrow__icon--start': this.iconPosition === 'start',
40
- 'ds-link-with-arrow__icon--end': this.iconPosition === 'end',
40
+ 'ds-link-with-arrow__icon--start': this.dsIconPosition === 'start',
41
+ 'ds-link-with-arrow__icon--end': this.dsIconPosition === 'end',
41
42
  });
42
- return (h("a", { key: 'bce4a90f9cc5113ab3d5b300d791d2299e22b7ad', href: this.href, class: classes, rel: this.rel, target: this.target, "aria-label": getAriaLabel(this.text, this.ariaLabel), ...this.inheritedAttributes }, h("slot", { key: '96ba4a33114443aab36d1301cf65c56437b9a85b', name: "iconStart" }, this.iconPosition === 'start' && h("ds-icon", { key: '86d8029de69c1ecb3002a97f5bc0cdbf899b7f91', name: this.icon, class: iconClasses, size: "1.4em" })), this.text, h("slot", { key: '7c2dafaee60253b1f5c22819b1afec83d106234b', name: "iconStart" }, this.iconPosition === 'end' && h("ds-icon", { key: 'a9fb3e2ddee16cce7c6b8fc0fba0b11970567276', name: this.icon, class: iconClasses, size: "1.4em" })), opensInNewTab(this.target) && (h("ds-visually-hidden", { key: 'f93f37d0d10d7a2d51980ff8feb76915cc4823b2', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText(this.language ?? document.documentElement.lang)))));
43
+ return (h("a", { key: 'be8d2878b2b0801df9d5b5988aa96ac251f659cc', href: this.dsHref, class: classes, rel: this.rel, target: this.dsTarget, "aria-label": this.dsAriaLabel, ...this.inheritedAttributes }, h("slot", { key: '7b5247167879c1b0335c33c1fcf74551bb78b25d', name: "prefix" }, this.dsIconPosition === 'start' && h("ds-icon", { key: 'd1c996dee504b053d11ad790b7ce545b1e1eab1a', dsName: this.icon, class: iconClasses, dsSize: "1.4em" })), this.dsText, h("slot", { key: 'd7f14b3e9f57dc3761254852f94267a55474cd3e', name: "suffix" }, this.dsIconPosition === 'end' && h("ds-icon", { key: 'c174d0e68979dc095a08936e6fffcc3a9e434088', dsName: this.icon, class: iconClasses, dsSize: "1.4em" })), opensInNewTab(this.dsTarget) && h("ds-visually-hidden", { key: 'de0de903e0bf1733b8be9fc2b35797e944cd3470', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText())));
43
44
  }
44
- static get style() { return DsLinkWithArrowStyle0; }
45
+ static get style() { return dsLinkWithArrowCss; }
45
46
  }, [1, "ds-link-with-arrow", {
46
- "text": [1],
47
- "iconPosition": [1, "icon-position"],
48
- "href": [1],
49
- "target": [1],
50
- "language": [1, "lang"],
51
- "ariaLabel": [1, "aria-label"]
47
+ "dsText": [1, "ds-text"],
48
+ "dsIconPosition": [1, "ds-icon-position"],
49
+ "dsHref": [1, "ds-href"],
50
+ "dsTarget": [1, "ds-target"],
51
+ "dsAriaLabel": [1, "ds-aria-label"]
52
52
  }]);
53
53
  function defineCustomElement$1() {
54
54
  if (typeof customElements === "undefined") {
@@ -1,12 +1,11 @@
1
1
  import { p as proxyCustomElement, H, h } from './index2.js';
2
2
  import { c as classNames } from './index3.js';
3
- import { i as inheritAriaAttributes } from './attributes.js';
3
+ import { b as inheritSpecifiedAttributes, a as inheritAriaAttributes } from './attributes.js';
4
4
  import { o as opensInNewTab, v as visuallyHiddenAssistiveText } from './linkUtils.js';
5
- import { g as getAriaLabel, i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
5
+ import { i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
6
6
  import { d as defineCustomElement$2 } from './ds-visually-hidden2.js';
7
7
 
8
- const dsLinkCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link{display:inline-flex;align-items:center;color:var(--ds-textColor-link);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:12%;text-underline-position:from-font}.ds-link:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}.ds-link--semibold{font-weight:var(--ds-fontWeight-semibold)}.ds-link--bold{font-weight:var(--ds-fontWeight-bold)}.ds-link--2xLarge{font-size:var(--ds-fontSize-22)}.ds-link--xLarge{font-size:var(--ds-fontSize-20)}.ds-link--large{font-size:var(--ds-fontSize-18)}.ds-link--medium{font-size:var(--ds-fontSize-16)}.ds-link--small{font-size:var(--ds-fontSize-14)}.ds-link--xSmall{font-size:var(--ds-fontSize-12)}.ds-link__icon{height:1em;width:1em}.ds-link__icon--start-inline{margin-right:var(--ds-spacing-3xSmall)}.ds-link__icon--start-standalone{margin-right:var(--ds-spacing-2xSmall)}.ds-link__icon--end-inline{margin-left:var(--ds-spacing-3xSmall)}.ds-link__icon--end-standalone{margin-left:var(--ds-spacing-2xSmall)}.ds-link:hover,.ds-link:active{text-decoration-thickness:13%;text-underline-offset:12%}.ds-link:hover{color:var(--ds-textColor-link-hover)}.ds-link:active{color:var(--ds-textColor-link-active)}.ds-link:visited{color:var(--ds-textColor-link-visited)}.ds-link--standalone{color:var(--ds-textColor-link);text-decoration-line:none}.ds-link--standalone:hover,.ds-link--standalone:active{text-decoration-line:underline}.ds-link--standalone:hover{color:var(--ds-textColor-link-hover)}.ds-link--standalone:active{color:var(--ds-textColor-link-active)}.ds-link--standalone:focus-visible{color:var(--ds-textColor-link)}.ds-link--standalone:visited{color:var(--ds-textColor-link)}";
9
- const DsLinkStyle0 = dsLinkCss;
8
+ const dsLinkCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link{display:inline-flex;align-items:center;color:var(--ds-palette-mainBlue-70);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:12%;text-underline-position:from-font}.ds-link:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);outline:var(--ds-borderWidth-thin) solid var(--ds-palette-black-95);outline-offset:calc(var(--ds-borderWidth-thin) * 1)}.ds-link--semibold{font-weight:var(--ds-fontWeight-semibold)}.ds-link--bold{font-weight:var(--ds-fontWeight-bold)}.ds-link--2xLarge{font-size:var(--ds-fontSize-22)}.ds-link--xLarge{font-size:var(--ds-fontSize-20)}.ds-link--large{font-size:var(--ds-fontSize-18)}.ds-link--medium{font-size:var(--ds-fontSize-16)}.ds-link--small{font-size:var(--ds-fontSize-14)}.ds-link--xSmall{font-size:var(--ds-fontSize-12)}.ds-link__icon{height:1em;width:1em}.ds-link__icon--start-inline{margin-right:var(--ds-spacing-3xSmall)}.ds-link__icon--start-standalone{margin-right:var(--ds-spacing-2xSmall)}.ds-link__icon--end-inline{margin-left:var(--ds-spacing-3xSmall)}.ds-link__icon--end-standalone{margin-left:var(--ds-spacing-2xSmall)}.ds-link:hover,.ds-link:active{text-decoration-thickness:13%;text-underline-offset:12%}.ds-link:hover{color:var(--ds-palette-mainBlue-80)}.ds-link:active{color:var(--ds-palette-mainBlue-90)}.ds-link:visited{color:#551a8b}.ds-link--standalone{color:var(--ds-palette-mainBlue-70);text-decoration-line:none}.ds-link--standalone:hover,.ds-link--standalone:active{text-decoration-line:underline}.ds-link--standalone:hover{color:var(--ds-palette-mainBlue-80)}.ds-link--standalone:active{color:var(--ds-palette-mainBlue-90)}.ds-link--standalone:focus-visible{color:var(--ds-palette-mainBlue-70)}.ds-link--standalone:visited{color:var(--ds-palette-mainBlue-70)}.ds-link--colour-white{color:var(--ds-palette-white)}.ds-link--colour-white:hover,.ds-link--colour-white:active,.ds-link--colour-white:visited,.ds-link--colour-white:focus-visible{color:var(--ds-palette-white)}.ds-link--colour-black{color:var(--ds-palette-black-95)}.ds-link--colour-black:hover,.ds-link--colour-black:active,.ds-link--colour-black:visited,.ds-link--colour-black:focus-visible{color:var(--ds-palette-black-95)}";
10
9
 
11
10
  const visuallyHiddenAssistiveTextIdGenerator = idGenerator('visually-hidden-assistive-text');
12
11
  const DsLink$1 = proxyCustomElement(class DsLink extends H {
@@ -19,52 +18,56 @@ const DsLink$1 = proxyCustomElement(class DsLink extends H {
19
18
  rel;
20
19
  visuallyHiddenAssistiveTextId = visuallyHiddenAssistiveTextIdGenerator.next().value;
21
20
  get el() { return this; }
22
- text;
23
- size;
24
- variant = 'inline';
25
- weight = 'regular';
26
- icon = '';
27
- iconPosition = 'end';
28
- iconTitle;
29
- iconHidden;
30
- href;
31
- target;
32
- download;
33
- language;
34
- ariaLabel;
21
+ dsText;
22
+ dsSize;
23
+ dsVariant = 'inline';
24
+ dsWeight = 'regular';
25
+ dsIcon = '';
26
+ dsIconPosition = 'end';
27
+ dsIconTitle;
28
+ dsIconHidden;
29
+ dsHref;
30
+ dsTarget;
31
+ dsDownload;
32
+ dsAriaLabel;
33
+ dsColour;
35
34
  componentWillLoad() {
36
- this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-label']);
37
- if (opensInNewTab(this.target)) {
38
- this.icon = 'open_in_new';
39
- this.iconPosition = 'end';
35
+ this.inheritedAttributes = {
36
+ ...inheritAriaAttributes(this.el, ['aria-label']),
37
+ ...inheritSpecifiedAttributes(this.el, ['lang']),
38
+ };
39
+ if (opensInNewTab(this.dsTarget)) {
40
+ this.dsIcon = 'open_in_new';
41
+ this.dsIconPosition = 'end';
40
42
  this.rel = 'noopener noreferrer';
41
43
  }
42
44
  }
43
45
  render() {
44
- const classes = classNames('ds-link', `ds-link--${this.weight}`, `ds-link--${this.variant}`, {
45
- [`ds-link--${this.size}`]: Boolean(this.size),
46
+ const classes = classNames('ds-link', `ds-link--${this.dsWeight}`, `ds-link--${this.dsVariant}`, {
47
+ [`ds-link--${this.dsSize}`]: !!this.dsSize,
48
+ [`ds-link--colour-${this.dsColour}`]: !!this.dsColour,
46
49
  });
47
50
  const iconClasses = classNames('ds-link__icon', {
48
- [`ds-link__icon--start-${this.variant}`]: this.iconPosition === 'start',
49
- [`ds-link__icon--end-${this.variant}`]: this.iconPosition === 'end',
51
+ [`ds-link__icon--start-${this.dsVariant}`]: this.dsIconPosition === 'start',
52
+ [`ds-link__icon--end-${this.dsVariant}`]: this.dsIconPosition === 'end',
50
53
  });
51
- return (h("a", { key: 'f8e36a029709033379e53cc1c409bc9c0069820e', href: this.href, class: classes, rel: this.rel, target: this.target, download: this.download, "aria-label": getAriaLabel(this.text, this.ariaLabel), ...this.inheritedAttributes }, h("slot", { key: '88f90209b6557942dd956585b5f77632aa647c8e', name: "iconStart" }, this.icon && this.iconPosition === 'start' && h("ds-icon", { key: '87169acfb32913d10d27b35a9c6f714385979aa7', name: this.icon, class: iconClasses, size: "1em", title: this.iconTitle, hidden: this.iconHidden })), this.text, h("slot", { key: 'b38677240eb8bd7c1200c8dc08876ba75e7b3e81', name: "iconEnd" }, this.icon && this.iconPosition === 'end' && h("ds-icon", { key: 'c3088e302a43b4cbc5601a9adff54a3dc27a59dc', name: this.icon, class: iconClasses, size: "1em", title: this.iconTitle, hidden: this.iconHidden })), opensInNewTab(this.target) && (h("ds-visually-hidden", { key: '25ac189fd216148a05fddfc6e384cfbde59e0e22', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText(this.language ?? document.documentElement.lang)))));
54
+ return (h("a", { key: 'a2dadeffad7a9ea98044d8d9e655b9623cdb287e', href: this.dsHref, class: classes, rel: this.rel, target: this.dsTarget, download: this.dsDownload, "aria-label": this.dsAriaLabel, ...this.inheritedAttributes }, h("slot", { key: '731bfe4dc924dd63b2815daed0ebe8bf2f7c455e', name: "prefix" }, this.dsIcon && this.dsIconPosition === 'start' && (h("ds-icon", { key: '4070f566905c409d9489221edaebb796aaccf973', dsName: this.dsIcon, class: iconClasses, dsSize: "1em", dsTitle: this.dsIconTitle, dsHidden: this.dsIconHidden }))), this.dsText, h("slot", { key: 'a57232ddd92c4225efe30b22247e8bf649e1f98f', name: "suffix" }, this.dsIcon && this.dsIconPosition === 'end' && (h("ds-icon", { key: '12d9a52ab321c0f607013accf39ee82947bac4eb', dsName: this.dsIcon, class: iconClasses, dsSize: "1em", dsTitle: this.dsIconTitle, dsHidden: this.dsIconHidden }))), opensInNewTab(this.dsTarget) && h("ds-visually-hidden", { key: 'baf51d298ca730b60c969e980fe91eb6096bd791', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText())));
52
55
  }
53
- static get style() { return DsLinkStyle0; }
56
+ static get style() { return dsLinkCss; }
54
57
  }, [1, "ds-link", {
55
- "text": [1],
56
- "size": [1],
57
- "variant": [1],
58
- "weight": [1],
59
- "icon": [1025],
60
- "iconPosition": [1025, "icon-position"],
61
- "iconTitle": [1, "icon-title"],
62
- "iconHidden": [4, "icon-hidden"],
63
- "href": [1],
64
- "target": [1],
65
- "download": [4],
66
- "language": [1, "lang"],
67
- "ariaLabel": [1, "aria-label"]
58
+ "dsText": [1, "ds-text"],
59
+ "dsSize": [1, "ds-size"],
60
+ "dsVariant": [1, "ds-variant"],
61
+ "dsWeight": [1, "ds-weight"],
62
+ "dsIcon": [1025, "ds-icon"],
63
+ "dsIconPosition": [1025, "ds-icon-position"],
64
+ "dsIconTitle": [1, "ds-icon-title"],
65
+ "dsIconHidden": [4, "ds-icon-hidden"],
66
+ "dsHref": [1, "ds-href"],
67
+ "dsTarget": [1, "ds-target"],
68
+ "dsDownload": [4, "ds-download"],
69
+ "dsAriaLabel": [1, "ds-aria-label"],
70
+ "dsColour": [1, "ds-colour"]
68
71
  }]);
69
72
  function defineCustomElement$1() {
70
73
  if (typeof customElements === "undefined") {
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface DsRadioButtonGroup extends Components.DsRadioButtonGroup, HTMLElement {}
4
+ export const DsRadioButtonGroup: {
5
+ prototype: DsRadioButtonGroup;
6
+ new (): DsRadioButtonGroup;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,185 @@
1
+ import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index2.js';
2
+ import { c as classNames } from './index3.js';
3
+ import { i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
4
+ import { a as inheritAriaAttributes } from './attributes.js';
5
+ import { g as getRequiredText, b as atLeastOneOption } from './controlUtils.js';
6
+ import { d as defineCustomElement$2 } from './ds-input-validity2.js';
7
+
8
+ const dsRadioButtonGroupCss = ".ds-radio-button-group{display:inline-flex;flex-direction:column;border:none;padding:0;margin:0}.ds-radio-button-group__radio-buttons-slot{display:inline-flex;flex-direction:column}.ds-radio-button-group__radio-buttons-slot--horizontal{flex-flow:row wrap;gap:var(--ds-spacing-small)}.ds-radio-button-group__legend{padding-inline:0;color:var(--ds-palette-black-95);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-semibold);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);margin-bottom:var(--ds-spacing-3xSmall)}.ds-radio-button-group__assistive-text{font-size:var(--ds-fontSize-14);color:var(--ds-palette-black-70);line-height:var(--ds-lineHeight-large);margin-bottom:var(--ds-spacing-2xSmall)}";
9
+
10
+ const radioButtonGroupIdGenerator = idGenerator('ds-radio-button-group');
11
+ const DsRadioButtonGroup$1 = proxyCustomElement(class DsRadioButtonGroup extends H {
12
+ constructor() {
13
+ super();
14
+ this.__registerHost();
15
+ this.__attachShadow();
16
+ this.dsRadioGroupValueChange = createEvent(this, "dsRadioGroupValueChange");
17
+ this.dsRadioGroupInvalidStateChange = createEvent(this, "dsRadioGroupInvalidStateChange");
18
+ this.dsChange = createEvent(this, "dsChange");
19
+ this.internals = this.attachInternals();
20
+ }
21
+ fieldsetId = radioButtonGroupIdGenerator.next().value;
22
+ errorTextId = `${this.fieldsetId}-error`;
23
+ assistiveTextId = `${this.fieldsetId}-assistive-text`;
24
+ inheritedAttributes = {};
25
+ get el() { return this; }
26
+ internals;
27
+ dsLegend;
28
+ dsAssistiveText;
29
+ dsValue;
30
+ dsDirection = 'vertical';
31
+ dsErrorText = '';
32
+ dsRequired = false;
33
+ showInternalsValidationMessage = false;
34
+ dsRadioGroupValueChange;
35
+ dsRadioGroupInvalidStateChange;
36
+ dsChange;
37
+ getLegendText = () => {
38
+ if (this.dsRequired) {
39
+ return getRequiredText(this.dsLegend);
40
+ }
41
+ return this.dsLegend;
42
+ };
43
+ getValidationMessage = () => this.dsErrorText || (this.showInternalsValidationMessage ? this.internals?.validationMessage : '');
44
+ getRadios = () => {
45
+ return Array.from(this.el.querySelectorAll('ds-radio-button'));
46
+ };
47
+ getEnabledRadios = () => {
48
+ return this.getRadios().filter(e => !e.dsDisabled);
49
+ };
50
+ updateRadios = (updateFn) => {
51
+ this.getRadios().forEach(updateFn);
52
+ };
53
+ updateFocusableRadioButton = () => {
54
+ const radios = this.getEnabledRadios();
55
+ if (!radios.length) {
56
+ return;
57
+ }
58
+ let focusableBtn = null;
59
+ for (const radio of radios) {
60
+ const isFocusable = radio.dsValue === this.dsValue;
61
+ radio.setFocusable(isFocusable);
62
+ if (isFocusable) {
63
+ focusableBtn = radio;
64
+ }
65
+ }
66
+ if (!focusableBtn) {
67
+ radios[0].setFocusable(true);
68
+ }
69
+ };
70
+ formResetCallback() {
71
+ this.internals?.setValidity({});
72
+ }
73
+ componentWillLoad() {
74
+ this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-labelledby']);
75
+ this.updateFocusableRadioButton();
76
+ }
77
+ componentDidLoad() {
78
+ this.updateRadios(element => {
79
+ element.setAttribute('ds-errors-disabled', 'true');
80
+ });
81
+ if (this.dsRequired) {
82
+ this.internals?.setValidity({ valueMissing: true }, atLeastOneOption(), this.getRadios()?.[0].shadowRoot.querySelector('input'));
83
+ }
84
+ }
85
+ async getValue() {
86
+ return this.dsValue;
87
+ }
88
+ errorTextObserver(errorText) {
89
+ this.dsRadioGroupInvalidStateChange.emit(!!errorText);
90
+ }
91
+ dsValueObserver(value) {
92
+ this.dsChange.emit(value);
93
+ if (this.dsRequired) {
94
+ this.internals?.setValidity({ valueMissing: !value }, atLeastOneOption(), this.getRadios()?.[0].shadowRoot.querySelector('input'));
95
+ }
96
+ }
97
+ onInputChange(e) {
98
+ e.stopPropagation();
99
+ const targetElem = e.target;
100
+ this.dsValue = targetElem.dsValue;
101
+ this.dsRadioGroupValueChange.emit(this.dsValue);
102
+ this.updateFocusableRadioButton();
103
+ }
104
+ onKeyDown(e) {
105
+ if (!['ArrowUp', 'ArrowLeft', 'ArrowDown', 'ArrowRight'].includes(e.key)) {
106
+ return;
107
+ }
108
+ if (e.target && !this.el.contains(e.target)) {
109
+ return;
110
+ }
111
+ const radios = this.getEnabledRadios();
112
+ if (e.target && !radios.includes(e.target)) {
113
+ return;
114
+ }
115
+ e.preventDefault();
116
+ const currentIndex = radios.findIndex(r => r === e.target);
117
+ let nextIndex;
118
+ if (['ArrowUp', 'ArrowLeft'].includes(e.key)) {
119
+ nextIndex = currentIndex === 0 ? radios.length - 1 : currentIndex - 1;
120
+ }
121
+ if (['ArrowDown', 'ArrowRight'].includes(e.key)) {
122
+ nextIndex = (currentIndex + 1) % radios.length;
123
+ }
124
+ const nextElem = radios[nextIndex];
125
+ nextElem.dsFocus();
126
+ nextElem.setChecked();
127
+ }
128
+ render() {
129
+ const classes = classNames('ds-radio-button-group');
130
+ const legendClasses = classNames('ds-radio-button-group__legend');
131
+ const assistiveTextClasses = classNames('ds-radio-button-group__assistive-text');
132
+ const radioButtonsSlotClasses = classNames('ds-radio-button-group__radio-buttons-slot', {
133
+ 'ds-radio-button-group__radio-buttons-slot--horizontal': this.dsDirection === 'horizontal',
134
+ });
135
+ const errorClasses = classNames('ds-radio-button-group__error');
136
+ const ariaDescribedBy = [!!this.dsAssistiveText && this.assistiveTextId, !!this.dsErrorText && this.errorTextId].filter(Boolean).join(' ');
137
+ return (h(Host, { key: 'fd0fece58fea50d7ea0672b7f49608c2cdcb306e', "data-invalid": !!this.dsErrorText || undefined }, h("fieldset", { key: '809c66ac58f880345c231b2930ddd9c91c61cbc2', class: classes, "aria-describedby": ariaDescribedBy, ...this.inheritedAttributes }, h("legend", { key: '5194fa04e6645381ef83ad5b4f09c98ea6757da4', class: legendClasses }, h("slot", { key: '2944e5176ce596d6ab5ee6ee735f5b1e5a4e892b', name: "legend" }, this.getLegendText())), h("slot", { key: '3df729bf79cef8d07e88c3e52e337a54a3fb4ead', name: "assistiveText" }, this.dsAssistiveText && (h("small", { key: '36148c44fd5cc17ae506ab598ff79de41e23b71f', class: assistiveTextClasses, id: this.assistiveTextId }, this.dsAssistiveText))), h("div", { key: '54380add5970ee72c0357b9562815d39a95602f0', class: radioButtonsSlotClasses }, h("slot", { key: '3ec766be90173f61dbb76b762c7f6d3f9781570f', onSlotchange: this.updateFocusableRadioButton })), (!!this.dsErrorText || this.dsRequired) && (h("slot", { key: 'c8ae86acd96ecba84d7ab83dad731511629e3f4b', name: "validity" }, h("div", { key: 'da0ce15f076e2c76ca040a6ad6100d706e576862', class: errorClasses }, h("ds-input-validity", { key: 'd9beed52855b81a8125cb0c6498b023357383328', id: this.errorTextId, dsText: this.getValidationMessage(), dsType: "error", dsAriaLive: "polite", dsAriaAtomic: "true" })))))));
138
+ }
139
+ static get formAssociated() { return true; }
140
+ static get watchers() { return {
141
+ "dsErrorText": ["errorTextObserver"],
142
+ "dsValue": ["dsValueObserver"]
143
+ }; }
144
+ static get style() { return dsRadioButtonGroupCss; }
145
+ }, [65, "ds-radio-button-group", {
146
+ "dsLegend": [1, "ds-legend"],
147
+ "dsAssistiveText": [1, "ds-assistive-text"],
148
+ "dsValue": [1025, "ds-value"],
149
+ "dsDirection": [1, "ds-direction"],
150
+ "dsErrorText": [1, "ds-error-text"],
151
+ "dsRequired": [4, "ds-required"],
152
+ "showInternalsValidationMessage": [32],
153
+ "getValue": [64]
154
+ }, [[0, "dsRadioButtonChecked", "onInputChange"], [4, "keydown", "onKeyDown"]], {
155
+ "dsErrorText": ["errorTextObserver"],
156
+ "dsValue": ["dsValueObserver"]
157
+ }]);
158
+ function defineCustomElement$1() {
159
+ if (typeof customElements === "undefined") {
160
+ return;
161
+ }
162
+ const components = ["ds-radio-button-group", "ds-icon", "ds-input-validity"];
163
+ components.forEach(tagName => { switch (tagName) {
164
+ case "ds-radio-button-group":
165
+ if (!customElements.get(tagName)) {
166
+ customElements.define(tagName, DsRadioButtonGroup$1);
167
+ }
168
+ break;
169
+ case "ds-icon":
170
+ if (!customElements.get(tagName)) {
171
+ defineCustomElement$3();
172
+ }
173
+ break;
174
+ case "ds-input-validity":
175
+ if (!customElements.get(tagName)) {
176
+ defineCustomElement$2();
177
+ }
178
+ break;
179
+ } });
180
+ }
181
+
182
+ const DsRadioButtonGroup = DsRadioButtonGroup$1;
183
+ const defineCustomElement = defineCustomElement$1;
184
+
185
+ export { DsRadioButtonGroup, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface DsRadioButton extends Components.DsRadioButton, HTMLElement {}
4
+ export const DsRadioButton: {
5
+ prototype: DsRadioButton;
6
+ new (): DsRadioButton;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;