@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
@@ -3,9 +3,11 @@ import classNames from "classnames";
3
3
  import { isValidation } from "../../../store";
4
4
  export class DsInputValidity {
5
5
  el;
6
- text;
7
- type = 'error';
8
- validityRole;
6
+ dsText;
7
+ dsType = 'error';
8
+ dsValidityRole;
9
+ dsAriaLive;
10
+ dsAriaAtomic;
9
11
  identifier;
10
12
  componentDidLoad() {
11
13
  this.identifier = this.el.getAttribute('id');
@@ -13,11 +15,11 @@ export class DsInputValidity {
13
15
  }
14
16
  render() {
15
17
  const classes = classNames('ds-input-validity', {
16
- 'ds-input-validity--error': this.type === 'error',
17
- 'ds-input-validity--success': this.type === 'success',
18
+ 'ds-input-validity--error': this.dsType === 'error',
19
+ 'ds-input-validity--success': this.dsType === 'success',
18
20
  });
19
- const icon = this.type === 'success' ? 'check_circle_fill' : 'warning_fill';
20
- 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)))));
21
+ const icon = this.dsType === 'success' ? 'check_circle_fill' : 'warning_fill';
22
+ 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)))));
21
23
  }
22
24
  static get is() { return "ds-input-validity"; }
23
25
  static get originalStyleUrls() {
@@ -32,8 +34,9 @@ export class DsInputValidity {
32
34
  }
33
35
  static get properties() {
34
36
  return {
35
- "text": {
37
+ "dsText": {
36
38
  "type": "string",
39
+ "attribute": "ds-text",
37
40
  "mutable": false,
38
41
  "complexType": {
39
42
  "original": "string",
@@ -44,60 +47,87 @@ export class DsInputValidity {
44
47
  "optional": false,
45
48
  "docs": {
46
49
  "tags": [],
47
- "text": ""
50
+ "text": "Text to display in the validity message"
48
51
  },
49
52
  "getter": false,
50
53
  "setter": false,
51
- "attribute": "text",
52
54
  "reflect": false
53
55
  },
54
- "type": {
56
+ "dsType": {
55
57
  "type": "string",
58
+ "attribute": "ds-type",
56
59
  "mutable": false,
57
60
  "complexType": {
58
- "original": "InputValidityType",
61
+ "original": "'error' | 'success'",
59
62
  "resolved": "\"error\" | \"success\"",
60
- "references": {
61
- "InputValidityType": {
62
- "location": "global",
63
- "id": "global::InputValidityType"
64
- }
65
- }
63
+ "references": {}
66
64
  },
67
65
  "required": false,
68
66
  "optional": false,
69
67
  "docs": {
70
68
  "tags": [],
71
- "text": ""
69
+ "text": "Type of the validity"
72
70
  },
73
71
  "getter": false,
74
72
  "setter": false,
75
- "attribute": "type",
76
73
  "reflect": false,
77
74
  "defaultValue": "'error'"
78
75
  },
79
- "validityRole": {
76
+ "dsValidityRole": {
80
77
  "type": "string",
78
+ "attribute": "ds-validity-role",
81
79
  "mutable": false,
82
80
  "complexType": {
83
- "original": "InputValidityRole",
81
+ "original": "'alert' | 'status'",
84
82
  "resolved": "\"alert\" | \"status\"",
85
- "references": {
86
- "InputValidityRole": {
87
- "location": "global",
88
- "id": "global::InputValidityRole"
89
- }
90
- }
83
+ "references": {}
84
+ },
85
+ "required": false,
86
+ "optional": true,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": "Passed to the `role` attribute of the container `div` element. Disabled if client-side validation is not used."
90
+ },
91
+ "getter": false,
92
+ "setter": false,
93
+ "reflect": false
94
+ },
95
+ "dsAriaLive": {
96
+ "type": "string",
97
+ "attribute": "ds-aria-live",
98
+ "mutable": false,
99
+ "complexType": {
100
+ "original": "'assertive' | 'polite'",
101
+ "resolved": "\"assertive\" | \"polite\"",
102
+ "references": {}
103
+ },
104
+ "required": false,
105
+ "optional": true,
106
+ "docs": {
107
+ "tags": [],
108
+ "text": "Passed to the `aria-live` attribute of the container `div` element. Disabled if client-side validation is not used."
109
+ },
110
+ "getter": false,
111
+ "setter": false,
112
+ "reflect": false
113
+ },
114
+ "dsAriaAtomic": {
115
+ "type": "string",
116
+ "attribute": "ds-aria-atomic",
117
+ "mutable": false,
118
+ "complexType": {
119
+ "original": "'true' | 'false'",
120
+ "resolved": "\"false\" | \"true\"",
121
+ "references": {}
91
122
  },
92
123
  "required": false,
93
124
  "optional": true,
94
125
  "docs": {
95
126
  "tags": [],
96
- "text": ""
127
+ "text": "Passed to the `aria-atomic` attribute of the container `div` element. Disabled if client-side validation is not used."
97
128
  },
98
129
  "getter": false,
99
130
  "setter": false,
100
- "attribute": "role",
101
131
  "reflect": false
102
132
  }
103
133
  };
@@ -5,13 +5,13 @@ const meta = {
5
5
  export default meta;
6
6
  export const Error = {
7
7
  args: {
8
- text: 'Link text',
9
- type: 'error'
8
+ dsText: 'Link text',
9
+ dsType: 'error'
10
10
  },
11
11
  };
12
12
  export const Success = {
13
13
  args: {
14
- text: 'Link text',
15
- type: 'success',
14
+ dsText: 'Link text',
15
+ dsType: 'success',
16
16
  },
17
17
  };
@@ -5,18 +5,13 @@ const meta = {
5
5
  export default meta;
6
6
  export const Default = {
7
7
  args: {
8
- text: 'Error text',
9
- type: 'error',
8
+ dsText: 'Error text',
9
+ dsType: 'error',
10
10
  },
11
11
  };
12
12
  export const Playground = {
13
13
  args: {
14
- text: 'Error text',
15
- type: 'error',
16
- },
17
- argTypes: {
18
- text: { control: 'text' },
19
- type: { control: 'select', options: ['error', 'success'] },
20
- validityRole: { name: 'role', control: 'radio', options: ['alert', 'status'] },
14
+ dsText: 'Error text',
15
+ dsType: 'error',
21
16
  },
22
17
  };
@@ -13,7 +13,7 @@
13
13
  .ds-link {
14
14
  display: inline-flex;
15
15
  align-items: center;
16
- color: var(--ds-textColor-link);
16
+ color: var(--ds-palette-mainBlue-70);
17
17
  font-weight: var(--ds-fontWeight-regular);
18
18
  letter-spacing: var(--ds-letterSpacing-wide);
19
19
  text-decoration-line: underline;
@@ -24,11 +24,9 @@
24
24
  text-underline-position: from-font;
25
25
  }
26
26
  .ds-link:focus-visible {
27
- box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
28
- outline-color: var(--ds-borderColor-black);
29
- outline-offset: var(--ds-borderWidth-thin);
30
- outline-style: solid;
31
- outline-width: var(--ds-borderWidth-thin);
27
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);
28
+ outline: var(--ds-borderWidth-thin) solid var(--ds-palette-black-95);
29
+ outline-offset: calc(var(--ds-borderWidth-thin) * 1);
32
30
  }
33
31
  .ds-link--semibold {
34
32
  font-weight: var(--ds-fontWeight-semibold);
@@ -75,30 +73,42 @@
75
73
  text-underline-offset: 12%;
76
74
  }
77
75
  .ds-link:hover {
78
- color: var(--ds-textColor-link-hover);
76
+ color: var(--ds-palette-mainBlue-80);
79
77
  }
80
78
  .ds-link:active {
81
- color: var(--ds-textColor-link-active);
79
+ color: var(--ds-palette-mainBlue-90);
82
80
  }
83
81
  .ds-link:visited {
84
- color: var(--ds-textColor-link-visited);
82
+ color: #551a8b;
85
83
  }
86
84
  .ds-link--standalone {
87
- color: var(--ds-textColor-link);
85
+ color: var(--ds-palette-mainBlue-70);
88
86
  text-decoration-line: none;
89
87
  }
90
88
  .ds-link--standalone:hover, .ds-link--standalone:active {
91
89
  text-decoration-line: underline;
92
90
  }
93
91
  .ds-link--standalone:hover {
94
- color: var(--ds-textColor-link-hover);
92
+ color: var(--ds-palette-mainBlue-80);
95
93
  }
96
94
  .ds-link--standalone:active {
97
- color: var(--ds-textColor-link-active);
95
+ color: var(--ds-palette-mainBlue-90);
98
96
  }
99
97
  .ds-link--standalone:focus-visible {
100
- color: var(--ds-textColor-link);
98
+ color: var(--ds-palette-mainBlue-70);
101
99
  }
102
100
  .ds-link--standalone:visited {
103
- color: var(--ds-textColor-link);
101
+ color: var(--ds-palette-mainBlue-70);
102
+ }
103
+ .ds-link--colour-white {
104
+ color: var(--ds-palette-white);
105
+ }
106
+ .ds-link--colour-white:hover, .ds-link--colour-white:active, .ds-link--colour-white:visited, .ds-link--colour-white:focus-visible {
107
+ color: var(--ds-palette-white);
108
+ }
109
+ .ds-link--colour-black {
110
+ color: var(--ds-palette-black-95);
111
+ }
112
+ .ds-link--colour-black:hover, .ds-link--colour-black:active, .ds-link--colour-black:visited, .ds-link--colour-black:focus-visible {
113
+ color: var(--ds-palette-black-95);
104
114
  }
@@ -1,44 +1,48 @@
1
1
  import { h } from "@stencil/core";
2
2
  import classNames from "classnames";
3
- import { inheritAriaAttributes } from "../../../utils/attributes/attributes";
3
+ import { inheritAriaAttributes, inheritSpecifiedAttributes } from "../../../utils/attributes/attributes";
4
4
  import { opensInNewTab, visuallyHiddenAssistiveText } from "../../../utils/link/linkUtils";
5
- import { getAriaLabel, idGenerator } from "../../../utils/utils";
5
+ import { idGenerator } from "../../../utils/utils";
6
6
  const visuallyHiddenAssistiveTextIdGenerator = idGenerator('visually-hidden-assistive-text');
7
7
  export class DsLink {
8
8
  inheritedAttributes = {};
9
9
  rel;
10
10
  visuallyHiddenAssistiveTextId = visuallyHiddenAssistiveTextIdGenerator.next().value;
11
11
  el;
12
- text;
13
- size;
14
- variant = 'inline';
15
- weight = 'regular';
16
- icon = '';
17
- iconPosition = 'end';
18
- iconTitle;
19
- iconHidden;
20
- href;
21
- target;
22
- download;
23
- language;
24
- ariaLabel;
12
+ dsText;
13
+ dsSize;
14
+ dsVariant = 'inline';
15
+ dsWeight = 'regular';
16
+ dsIcon = '';
17
+ dsIconPosition = 'end';
18
+ dsIconTitle;
19
+ dsIconHidden;
20
+ dsHref;
21
+ dsTarget;
22
+ dsDownload;
23
+ dsAriaLabel;
24
+ dsColour;
25
25
  componentWillLoad() {
26
- this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-label']);
27
- if (opensInNewTab(this.target)) {
28
- this.icon = 'open_in_new';
29
- this.iconPosition = 'end';
26
+ this.inheritedAttributes = {
27
+ ...inheritAriaAttributes(this.el, ['aria-label']),
28
+ ...inheritSpecifiedAttributes(this.el, ['lang']),
29
+ };
30
+ if (opensInNewTab(this.dsTarget)) {
31
+ this.dsIcon = 'open_in_new';
32
+ this.dsIconPosition = 'end';
30
33
  this.rel = 'noopener noreferrer';
31
34
  }
32
35
  }
33
36
  render() {
34
- const classes = classNames('ds-link', `ds-link--${this.weight}`, `ds-link--${this.variant}`, {
35
- [`ds-link--${this.size}`]: Boolean(this.size),
37
+ const classes = classNames('ds-link', `ds-link--${this.dsWeight}`, `ds-link--${this.dsVariant}`, {
38
+ [`ds-link--${this.dsSize}`]: !!this.dsSize,
39
+ [`ds-link--colour-${this.dsColour}`]: !!this.dsColour,
36
40
  });
37
41
  const iconClasses = classNames('ds-link__icon', {
38
- [`ds-link__icon--start-${this.variant}`]: this.iconPosition === 'start',
39
- [`ds-link__icon--end-${this.variant}`]: this.iconPosition === 'end',
42
+ [`ds-link__icon--start-${this.dsVariant}`]: this.dsIconPosition === 'start',
43
+ [`ds-link__icon--end-${this.dsVariant}`]: this.dsIconPosition === 'end',
40
44
  });
41
- 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)))));
45
+ 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())));
42
46
  }
43
47
  static get is() { return "ds-link"; }
44
48
  static get encapsulation() { return "shadow"; }
@@ -54,8 +58,9 @@ export class DsLink {
54
58
  }
55
59
  static get properties() {
56
60
  return {
57
- "text": {
61
+ "dsText": {
58
62
  "type": "string",
63
+ "attribute": "ds-text",
59
64
  "mutable": false,
60
65
  "complexType": {
61
66
  "original": "string",
@@ -66,15 +71,15 @@ export class DsLink {
66
71
  "optional": false,
67
72
  "docs": {
68
73
  "tags": [],
69
- "text": ""
74
+ "text": "Text content of the link"
70
75
  },
71
76
  "getter": false,
72
77
  "setter": false,
73
- "attribute": "text",
74
78
  "reflect": false
75
79
  },
76
- "size": {
80
+ "dsSize": {
77
81
  "type": "string",
82
+ "attribute": "ds-size",
78
83
  "mutable": false,
79
84
  "complexType": {
80
85
  "original": "LinkSize",
@@ -90,15 +95,15 @@ export class DsLink {
90
95
  "optional": true,
91
96
  "docs": {
92
97
  "tags": [],
93
- "text": ""
98
+ "text": "Size of the link"
94
99
  },
95
100
  "getter": false,
96
101
  "setter": false,
97
- "attribute": "size",
98
102
  "reflect": false
99
103
  },
100
- "variant": {
104
+ "dsVariant": {
101
105
  "type": "string",
106
+ "attribute": "ds-variant",
102
107
  "mutable": false,
103
108
  "complexType": {
104
109
  "original": "LinkVariant",
@@ -114,16 +119,16 @@ export class DsLink {
114
119
  "optional": false,
115
120
  "docs": {
116
121
  "tags": [],
117
- "text": ""
122
+ "text": "Variant of the link"
118
123
  },
119
124
  "getter": false,
120
125
  "setter": false,
121
- "attribute": "variant",
122
126
  "reflect": false,
123
127
  "defaultValue": "'inline'"
124
128
  },
125
- "weight": {
129
+ "dsWeight": {
126
130
  "type": "string",
131
+ "attribute": "ds-weight",
127
132
  "mutable": false,
128
133
  "complexType": {
129
134
  "original": "LinkWeight",
@@ -139,16 +144,16 @@ export class DsLink {
139
144
  "optional": false,
140
145
  "docs": {
141
146
  "tags": [],
142
- "text": ""
147
+ "text": "Font weight of the link"
143
148
  },
144
149
  "getter": false,
145
150
  "setter": false,
146
- "attribute": "weight",
147
151
  "reflect": false,
148
152
  "defaultValue": "'regular'"
149
153
  },
150
- "icon": {
154
+ "dsIcon": {
151
155
  "type": "string",
156
+ "attribute": "ds-icon",
152
157
  "mutable": true,
153
158
  "complexType": {
154
159
  "original": "string",
@@ -159,16 +164,16 @@ export class DsLink {
159
164
  "optional": false,
160
165
  "docs": {
161
166
  "tags": [],
162
- "text": ""
167
+ "text": "Icon to display alongside link"
163
168
  },
164
169
  "getter": false,
165
170
  "setter": false,
166
- "attribute": "icon",
167
171
  "reflect": false,
168
172
  "defaultValue": "''"
169
173
  },
170
- "iconPosition": {
174
+ "dsIconPosition": {
171
175
  "type": "string",
176
+ "attribute": "ds-icon-position",
172
177
  "mutable": true,
173
178
  "complexType": {
174
179
  "original": "LinkIconPosition",
@@ -184,16 +189,16 @@ export class DsLink {
184
189
  "optional": false,
185
190
  "docs": {
186
191
  "tags": [],
187
- "text": ""
192
+ "text": "Whether to display the icon before or after the link"
188
193
  },
189
194
  "getter": false,
190
195
  "setter": false,
191
- "attribute": "icon-position",
192
196
  "reflect": false,
193
197
  "defaultValue": "'end'"
194
198
  },
195
- "iconTitle": {
199
+ "dsIconTitle": {
196
200
  "type": "string",
201
+ "attribute": "ds-icon-title",
197
202
  "mutable": false,
198
203
  "complexType": {
199
204
  "original": "string",
@@ -204,15 +209,15 @@ export class DsLink {
204
209
  "optional": true,
205
210
  "docs": {
206
211
  "tags": [],
207
- "text": ""
212
+ "text": "Passed to the `dsTitle` property of the `ds-icon` element"
208
213
  },
209
214
  "getter": false,
210
215
  "setter": false,
211
- "attribute": "icon-title",
212
216
  "reflect": false
213
217
  },
214
- "iconHidden": {
218
+ "dsIconHidden": {
215
219
  "type": "boolean",
220
+ "attribute": "ds-icon-hidden",
216
221
  "mutable": false,
217
222
  "complexType": {
218
223
  "original": "boolean",
@@ -223,15 +228,15 @@ export class DsLink {
223
228
  "optional": true,
224
229
  "docs": {
225
230
  "tags": [],
226
- "text": ""
231
+ "text": "Passed to the `dsHidden` property of the `ds-icon` element"
227
232
  },
228
233
  "getter": false,
229
234
  "setter": false,
230
- "attribute": "icon-hidden",
231
235
  "reflect": false
232
236
  },
233
- "href": {
237
+ "dsHref": {
234
238
  "type": "string",
239
+ "attribute": "ds-href",
235
240
  "mutable": false,
236
241
  "complexType": {
237
242
  "original": "string",
@@ -242,15 +247,15 @@ export class DsLink {
242
247
  "optional": false,
243
248
  "docs": {
244
249
  "tags": [],
245
- "text": ""
250
+ "text": "Passed to the `href` attribute of the `a` element"
246
251
  },
247
252
  "getter": false,
248
253
  "setter": false,
249
- "attribute": "href",
250
254
  "reflect": false
251
255
  },
252
- "target": {
256
+ "dsTarget": {
253
257
  "type": "string",
258
+ "attribute": "ds-target",
254
259
  "mutable": false,
255
260
  "complexType": {
256
261
  "original": "LinkTarget",
@@ -266,15 +271,15 @@ export class DsLink {
266
271
  "optional": true,
267
272
  "docs": {
268
273
  "tags": [],
269
- "text": ""
274
+ "text": "Passed to the `target` attribute of the `a` element"
270
275
  },
271
276
  "getter": false,
272
277
  "setter": false,
273
- "attribute": "target",
274
278
  "reflect": false
275
279
  },
276
- "download": {
280
+ "dsDownload": {
277
281
  "type": "boolean",
282
+ "attribute": "ds-download",
278
283
  "mutable": false,
279
284
  "complexType": {
280
285
  "original": "boolean",
@@ -285,54 +290,48 @@ export class DsLink {
285
290
  "optional": true,
286
291
  "docs": {
287
292
  "tags": [],
288
- "text": ""
293
+ "text": "Passed to the `download` attribute of the `a` element"
289
294
  },
290
295
  "getter": false,
291
296
  "setter": false,
292
- "attribute": "download",
293
297
  "reflect": false
294
298
  },
295
- "language": {
299
+ "dsAriaLabel": {
296
300
  "type": "string",
301
+ "attribute": "ds-aria-label",
297
302
  "mutable": false,
298
303
  "complexType": {
299
- "original": "LinkLang",
300
- "resolved": "\"en\" | \"fi\" | \"sv\"",
301
- "references": {
302
- "LinkLang": {
303
- "location": "global",
304
- "id": "global::LinkLang"
305
- }
306
- }
304
+ "original": "string",
305
+ "resolved": "string",
306
+ "references": {}
307
307
  },
308
308
  "required": false,
309
- "optional": true,
309
+ "optional": false,
310
310
  "docs": {
311
311
  "tags": [],
312
- "text": ""
312
+ "text": "Passed to the `aria-label` attribute of the `a` element"
313
313
  },
314
314
  "getter": false,
315
315
  "setter": false,
316
- "attribute": "lang",
317
316
  "reflect": false
318
317
  },
319
- "ariaLabel": {
318
+ "dsColour": {
320
319
  "type": "string",
320
+ "attribute": "ds-colour",
321
321
  "mutable": false,
322
322
  "complexType": {
323
- "original": "string",
324
- "resolved": "string",
323
+ "original": "'black' | 'white'",
324
+ "resolved": "\"black\" | \"white\"",
325
325
  "references": {}
326
326
  },
327
327
  "required": false,
328
- "optional": false,
328
+ "optional": true,
329
329
  "docs": {
330
330
  "tags": [],
331
- "text": ""
331
+ "text": "Colour of the link. Overrides default colour."
332
332
  },
333
333
  "getter": false,
334
334
  "setter": false,
335
- "attribute": "aria-label",
336
335
  "reflect": false
337
336
  }
338
337
  };