@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
@@ -6,52 +6,52 @@ const meta = {
6
6
  export default meta;
7
7
  export const Inline = {
8
8
  render: () => html `
9
- Text with <ds-link href="#" text="inline link"></ds-link>.
9
+ Text with <ds-link ds-href="#" ds-text="inline link"></ds-link>.
10
10
  `
11
11
  };
12
12
  export const OpenInANewTab = {
13
13
  render: () => html `
14
- Text with <ds-link href="#" target="_blank" text="open in a new tab inline link"></ds-link>.
14
+ Text with <ds-link ds-href="#" ds-target="_blank" ds-text="open in a new tab inline link"></ds-link>.
15
15
  `
16
16
  };
17
17
  export const Back = {
18
18
  args: {
19
- text: 'Back',
20
- href: '#',
21
- icon: 'arrow_back',
22
- iconPosition: 'start',
23
- iconTitle: 'Arrow back',
19
+ dsText: 'Back',
20
+ dsHref: '#',
21
+ dsIcon: 'arrow_back',
22
+ dsIconPosition: 'start',
23
+ dsIconTitle: 'Arrow back',
24
24
  }
25
25
  };
26
26
  export const Download = {
27
27
  args: {
28
- text: 'Brand book (pdf)',
29
- href: '#',
30
- icon: 'download',
31
- iconPosition: 'start',
32
- iconTitle: 'Download',
33
- iconHidden: false,
34
- variant: 'standalone',
35
- size: 'xLarge',
36
- weight: 'semibold',
37
- download: true
28
+ dsText: 'Brand book (pdf)',
29
+ dsHref: '#',
30
+ dsIcon: 'download',
31
+ dsIconPosition: 'start',
32
+ dsIconTitle: 'Download',
33
+ dsIconHidden: false,
34
+ dsVariant: 'standalone',
35
+ dsSize: 'xLarge',
36
+ dsWeight: 'semibold',
37
+ dsDownload: true
38
38
  }
39
39
  };
40
40
  export const StandaloneBoldLinkWithIcon = {
41
41
  args: {
42
- text: 'Standalone bold link with icon',
43
- href: '#',
44
- icon: 'arrow_forward',
45
- iconTitle: 'Arrow forward',
46
- variant: 'standalone',
47
- size: '2xLarge',
48
- weight: 'bold'
42
+ dsText: 'Standalone bold link with icon',
43
+ dsHref: '#',
44
+ dsIcon: 'arrow_forward',
45
+ dsIconTitle: 'Arrow forward',
46
+ dsVariant: 'standalone',
47
+ dsSize: '2xLarge',
48
+ dsWeight: 'bold'
49
49
  }
50
50
  };
51
51
  export const NavigationLink = {
52
52
  args: {
53
- text: 'Navigation link',
54
- href: '#',
55
- variant: 'standalone'
53
+ dsText: 'Navigation link',
54
+ dsHref: '#',
55
+ dsVariant: 'standalone'
56
56
  }
57
57
  };
@@ -8,50 +8,67 @@ const meta = {
8
8
  export default meta;
9
9
  export const Inline = {
10
10
  args: {
11
- text: 'Link text',
12
- href: '#',
13
- variant: 'inline'
11
+ dsText: 'Link text',
12
+ dsHref: '#',
13
+ dsVariant: 'inline'
14
14
  },
15
15
  };
16
16
  export const Standalone = {
17
17
  args: {
18
- text: 'Link text',
19
- href: '#',
20
- variant: 'standalone'
18
+ dsText: 'Link text',
19
+ dsHref: '#',
20
+ dsVariant: 'standalone'
21
21
  },
22
22
  };
23
23
  export const Size = {
24
24
  render: () => html `
25
25
  <div>
26
- <div><ds-link href="#" text="Link text" size="2xLarge"></ds-link></div>
27
- <div><ds-link href="#" text="Link text" size="xLarge"></ds-link></div>
28
- <div><ds-link href="#" text="Link text" size="large"></ds-link></div>
29
- <div><ds-link href="#" text="Link text" size="medium"></ds-link></div>
30
- <div><ds-link href="#" text="Link text" size="small"></ds-link></div>
31
- <div><ds-link href="#" text="Link text" size="xSmall"></ds-link></div>
26
+ <div><ds-link ds-href="#" ds-text="Link text" ds-size="2xLarge"></ds-link></div>
27
+ <div><ds-link ds-href="#" ds-text="Link text" ds-size="xLarge"></ds-link></div>
28
+ <div><ds-link ds-href="#" ds-text="Link text" ds-size="large"></ds-link></div>
29
+ <div><ds-link ds-href="#" ds-text="Link text" ds-size="medium"></ds-link></div>
30
+ <div><ds-link ds-href="#" ds-text="Link text" ds-size="small"></ds-link></div>
31
+ <div><ds-link ds-href="#" ds-text="Link text" ds-size="xSmall"></ds-link></div>
32
32
  </div>
33
33
  `
34
34
  };
35
35
  export const Weight = {
36
36
  render: () => html `
37
37
  <div>
38
- <div><ds-link href="#" text="Link text" weight="regular"></ds-link></div>
39
- <div><ds-link href="#" text="Link text" weight="semibold"></ds-link></div>
40
- <div><ds-link href="#" text="Link text" weight="bold"></ds-link></div>
38
+ <div><ds-link ds-href="#" ds-text="Link text" ds-weight="regular"></ds-link></div>
39
+ <div><ds-link ds-href="#" ds-text="Link text" ds-weight="semibold"></ds-link></div>
40
+ <div><ds-link ds-href="#" ds-text="Link text" ds-weight="bold"></ds-link></div>
41
41
  </div>
42
42
  `
43
43
  };
44
+ export const Black = {
45
+ args: {
46
+ dsText: 'Link text',
47
+ dsHref: '#',
48
+ dsColour: 'black'
49
+ },
50
+ };
51
+ export const White = {
52
+ args: {
53
+ dsText: 'Link text',
54
+ dsHref: '#',
55
+ dsColour: 'white'
56
+ },
57
+ parameters: {
58
+ backgrounds: { default: 'Black 90%' },
59
+ }
60
+ };
44
61
  export const OpensInANewTab = {
45
62
  args: {
46
- text: 'Link text',
47
- href: '#',
48
- target: '_blank',
63
+ dsText: 'Link text',
64
+ dsHref: '#',
65
+ dsTarget: '_blank',
49
66
  },
50
67
  play: async ({ canvasElement, step }) => {
51
68
  const shadowRoot = await getShadowRoot(canvasElement, 'ds-link');
52
69
  const anchorElem = shadowRoot.querySelector('a');
53
70
  const visuallyHiddenElem = shadowRoot.querySelector('ds-visually-hidden');
54
- const iconEnd = shadowRoot.querySelector('slot[name=iconEnd]');
71
+ const iconEnd = shadowRoot.querySelector('slot[name=suffix]');
55
72
  await step('Anchor should have attribute rel with value "noopener noreferrer"', () => {
56
73
  expect(anchorElem.rel).toBe('noopener noreferrer');
57
74
  });
@@ -66,8 +83,8 @@ export const OpensInANewTab = {
66
83
  export const IconPosition = {
67
84
  render: () => html `
68
85
  <div>
69
- <div><ds-link href="#" text="Link text" icon="download" icon-position="start" icon-title="Download icon"></ds-link></div>
70
- <div><ds-link href="#" text="Link text" icon="download" icon-position="end" icon-title="Download icon"></ds-link></div>
86
+ <div><ds-link ds-href="#" ds-text="Link text" ds-icon="download" ds-icon-position="start" ds-icon-title="Download icon"></ds-link></div>
87
+ <div><ds-link ds-href="#" ds-text="Link text" ds-icon="download" ds-icon-position="end" ds-icon-title="Download icon"></ds-link></div>
71
88
  </div>
72
89
  `
73
90
  };
@@ -1,83 +1,24 @@
1
1
  import { icons } from "../../../00-foundations/icons/iconList";
2
- import { getAriaAttributeArgTypes } from "../../../../utils/attributes/attributes";
3
- const anchorAriaAttributes = [
4
- 'aria-current',
5
- 'aria-haspopup',
6
- ];
7
- const anchorAriaAttributeArgTypes = getAriaAttributeArgTypes(anchorAriaAttributes);
8
2
  const meta = {
9
3
  title: 'Base Components/Link',
10
4
  component: 'ds-link',
11
5
  argTypes: {
12
- text: { control: 'text' },
13
- href: { control: 'text' },
6
+ dsIcon: {
7
+ control: 'select',
8
+ options: icons.map(icon => icon.name),
9
+ },
14
10
  }
15
11
  };
16
12
  export default meta;
17
13
  export const Default = {
18
14
  args: {
19
- text: 'Link text',
20
- href: '#',
15
+ dsText: 'Link text',
16
+ dsHref: '#',
21
17
  },
22
18
  };
23
19
  export const Playground = {
24
20
  args: {
25
- text: 'Link text',
26
- href: '#',
27
- },
28
- argTypes: {
29
- text: { control: 'text' },
30
- href: { control: 'text' },
31
- target: { control: 'text' },
32
- size: {
33
- control: 'select',
34
- options: ['2xLarge', 'xLarge', 'large', 'medium', 'small', 'xSmall'],
35
- table: {
36
- type: { summary: 'select' },
37
- defaultValue: { summary: 'medium' },
38
- },
39
- },
40
- variant: {
41
- control: 'select',
42
- options: ['inline', 'standalone'],
43
- table: {
44
- type: { summary: 'select' },
45
- defaultValue: { summary: 'inline' },
46
- },
47
- },
48
- weight: {
49
- control: 'select',
50
- options: ['regular', 'semibold', 'bold'],
51
- table: {
52
- type: { summary: 'select' },
53
- defaultValue: { summary: 'regular' },
54
- },
55
- },
56
- icon: {
57
- control: 'select',
58
- options: icons.map(icon => icon.name),
59
- },
60
- iconPosition: {
61
- control: 'select',
62
- options: ['start', 'end'],
63
- },
64
- iconTitle: {
65
- control: 'text',
66
- },
67
- iconHidden: {
68
- control: 'boolean',
69
- },
70
- download: {
71
- control: 'boolean'
72
- },
73
- language: {
74
- control: 'text',
75
- description: 'ISO 639 language code. Known languages are: "en", "fi", "sv". When undefined will use browser\'s language.',
76
- },
77
- ariaLabel: {
78
- name: 'aria-label',
79
- control: 'text',
80
- },
81
- ...anchorAriaAttributeArgTypes,
21
+ dsText: 'Link text',
22
+ dsHref: '#',
82
23
  },
83
24
  };
@@ -13,18 +13,16 @@
13
13
  .ds-link-with-arrow {
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
  letter-spacing: var(--ds-letterSpacing-wide);
18
18
  font-weight: var(--ds-fontWeight-semibold);
19
19
  font-size: var(--ds-fontSize-16);
20
20
  text-decoration-line: none;
21
21
  }
22
22
  .ds-link-with-arrow:focus-visible {
23
- box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
24
- outline-color: var(--ds-borderColor-black);
25
- outline-offset: var(--ds-borderWidth-thin);
26
- outline-style: solid;
27
- outline-width: var(--ds-borderWidth-thin);
23
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);
24
+ outline: var(--ds-borderWidth-thin) solid var(--ds-palette-black-95);
25
+ outline-offset: calc(var(--ds-borderWidth-thin) * 1);
28
26
  }
29
27
  @media (min-width: 30rem) {
30
28
  .ds-link-with-arrow {
@@ -38,8 +36,8 @@
38
36
  line-height: 0;
39
37
  align-items: center;
40
38
  justify-content: center;
41
- color: var(--ds-textColor-white);
42
- background-color: var(--ds-bgColor-primary);
39
+ color: var(--ds-palette-white);
40
+ background-color: var(--ds-palette-mainBlue-70);
43
41
  }
44
42
  .ds-link-with-arrow__icon--start {
45
43
  margin-right: var(--ds-spacing-xSmall);
@@ -49,10 +47,10 @@
49
47
  }
50
48
  :hover slot > .ds-link-with-arrow__icon {
51
49
  outline: 10px solid;
52
- background-color: var(--ds-bgColor-primary-hover);
50
+ background-color: var(--ds-palette-mainBlue-80);
53
51
  }
54
52
  :active slot > .ds-link-with-arrow__icon {
55
- background-color: var(--ds-bgColor-primary-active);
53
+ background-color: var(--ds-palette-mainBlue-90);
56
54
  }
57
55
  .ds-link-with-arrow:hover, .ds-link-with-arrow:active {
58
56
  text-decoration-line: underline;
@@ -63,8 +61,8 @@
63
61
  text-underline-position: from-font;
64
62
  }
65
63
  .ds-link-with-arrow:hover {
66
- color: var(--ds-textColor-link-hover);
64
+ color: var(--ds-palette-mainBlue-80);
67
65
  }
68
66
  .ds-link-with-arrow:active, .ds-link-with-arrow:focus-visible {
69
- color: var(--ds-textColor-link-active);
67
+ color: var(--ds-palette-mainBlue-90);
70
68
  }
@@ -1,8 +1,8 @@
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 DsLinkWithArrow {
8
8
  inheritedAttributes = {};
@@ -10,15 +10,17 @@ export class DsLinkWithArrow {
10
10
  rel;
11
11
  visuallyHiddenAssistiveTextId = visuallyHiddenAssistiveTextIdGenerator.next().value;
12
12
  el;
13
- text;
14
- iconPosition = 'start';
15
- href;
16
- target;
17
- language;
18
- ariaLabel;
13
+ dsText;
14
+ dsIconPosition = 'start';
15
+ dsHref;
16
+ dsTarget;
17
+ dsAriaLabel;
19
18
  componentWillLoad() {
20
- this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-label']);
21
- if (opensInNewTab(this.target)) {
19
+ this.inheritedAttributes = {
20
+ ...inheritAriaAttributes(this.el, ['aria-label']),
21
+ ...inheritSpecifiedAttributes(this.el, ['lang']),
22
+ };
23
+ if (opensInNewTab(this.dsTarget)) {
22
24
  this.icon = 'arrow_outward';
23
25
  this.rel = 'noopener noreferrer';
24
26
  }
@@ -26,10 +28,10 @@ export class DsLinkWithArrow {
26
28
  render() {
27
29
  const classes = classNames('ds-link-with-arrow');
28
30
  const iconClasses = classNames('ds-link-with-arrow__icon', {
29
- 'ds-link-with-arrow__icon--start': this.iconPosition === 'start',
30
- 'ds-link-with-arrow__icon--end': this.iconPosition === 'end',
31
+ 'ds-link-with-arrow__icon--start': this.dsIconPosition === 'start',
32
+ 'ds-link-with-arrow__icon--end': this.dsIconPosition === 'end',
31
33
  });
32
- 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)))));
34
+ 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())));
33
35
  }
34
36
  static get is() { return "ds-link-with-arrow"; }
35
37
  static get encapsulation() { return "shadow"; }
@@ -45,8 +47,9 @@ export class DsLinkWithArrow {
45
47
  }
46
48
  static get properties() {
47
49
  return {
48
- "text": {
50
+ "dsText": {
49
51
  "type": "string",
52
+ "attribute": "ds-text",
50
53
  "mutable": false,
51
54
  "complexType": {
52
55
  "original": "string",
@@ -57,15 +60,15 @@ export class DsLinkWithArrow {
57
60
  "optional": true,
58
61
  "docs": {
59
62
  "tags": [],
60
- "text": ""
63
+ "text": "Text content of the link"
61
64
  },
62
65
  "getter": false,
63
66
  "setter": false,
64
- "attribute": "text",
65
67
  "reflect": false
66
68
  },
67
- "iconPosition": {
69
+ "dsIconPosition": {
68
70
  "type": "string",
71
+ "attribute": "ds-icon-position",
69
72
  "mutable": false,
70
73
  "complexType": {
71
74
  "original": "LinkIconPosition",
@@ -81,16 +84,16 @@ export class DsLinkWithArrow {
81
84
  "optional": false,
82
85
  "docs": {
83
86
  "tags": [],
84
- "text": ""
87
+ "text": "Whether to display the arrow icon before or after the link"
85
88
  },
86
89
  "getter": false,
87
90
  "setter": false,
88
- "attribute": "icon-position",
89
91
  "reflect": false,
90
92
  "defaultValue": "'start'"
91
93
  },
92
- "href": {
94
+ "dsHref": {
93
95
  "type": "string",
96
+ "attribute": "ds-href",
94
97
  "mutable": false,
95
98
  "complexType": {
96
99
  "original": "string",
@@ -101,15 +104,15 @@ export class DsLinkWithArrow {
101
104
  "optional": false,
102
105
  "docs": {
103
106
  "tags": [],
104
- "text": ""
107
+ "text": "Passed to the `href` attribute of the `a` element"
105
108
  },
106
109
  "getter": false,
107
110
  "setter": false,
108
- "attribute": "href",
109
111
  "reflect": false
110
112
  },
111
- "target": {
113
+ "dsTarget": {
112
114
  "type": "string",
115
+ "attribute": "ds-target",
113
116
  "mutable": false,
114
117
  "complexType": {
115
118
  "original": "LinkTarget",
@@ -125,39 +128,15 @@ export class DsLinkWithArrow {
125
128
  "optional": true,
126
129
  "docs": {
127
130
  "tags": [],
128
- "text": ""
129
- },
130
- "getter": false,
131
- "setter": false,
132
- "attribute": "target",
133
- "reflect": false
134
- },
135
- "language": {
136
- "type": "string",
137
- "mutable": false,
138
- "complexType": {
139
- "original": "LinkLang",
140
- "resolved": "\"en\" | \"fi\" | \"sv\"",
141
- "references": {
142
- "LinkLang": {
143
- "location": "global",
144
- "id": "global::LinkLang"
145
- }
146
- }
147
- },
148
- "required": false,
149
- "optional": true,
150
- "docs": {
151
- "tags": [],
152
- "text": ""
131
+ "text": "Passed to the `target` attribute of the `a` element"
153
132
  },
154
133
  "getter": false,
155
134
  "setter": false,
156
- "attribute": "lang",
157
135
  "reflect": false
158
136
  },
159
- "ariaLabel": {
137
+ "dsAriaLabel": {
160
138
  "type": "string",
139
+ "attribute": "ds-aria-label",
161
140
  "mutable": false,
162
141
  "complexType": {
163
142
  "original": "string",
@@ -168,11 +147,10 @@ export class DsLinkWithArrow {
168
147
  "optional": false,
169
148
  "docs": {
170
149
  "tags": [],
171
- "text": ""
150
+ "text": "Passed to the `aria-label` attribute of the `a` element"
172
151
  },
173
152
  "getter": false,
174
153
  "setter": false,
175
- "attribute": "aria-label",
176
154
  "reflect": false
177
155
  }
178
156
  };
@@ -9,9 +9,9 @@ const meta = {
9
9
  export default meta;
10
10
  export const OpenInANewTab = {
11
11
  args: {
12
- text: 'Link with arrow icon',
13
- href: '#',
14
- target: '_blank',
12
+ dsText: 'Link with arrow icon',
13
+ dsHref: '#',
14
+ dsTarget: '_blank',
15
15
  },
16
16
  play: async ({ canvasElement, step }) => {
17
17
  const shadowRoot = await getShadowRoot(canvasElement, 'ds-link-with-arrow');
@@ -27,7 +27,7 @@ export const OpenInANewTab = {
27
27
  };
28
28
  const iconAtTheEndDOM = html `
29
29
  <div class="ds-sb-icon-at-the-end">
30
- <ds-link-with-arrow text="Link with arrow icon" href="#" icon-position="end"></ds-link-with-arrow>
30
+ <ds-link-with-arrow ds-text="Link with arrow icon" ds-href="#" ds-icon-position="end"></ds-link-with-arrow>
31
31
  </div>
32
32
  `;
33
33
  export const IconAtTheEnd = {
@@ -5,15 +5,15 @@ const meta = {
5
5
  export default meta;
6
6
  export const IconPositionStart = {
7
7
  args: {
8
- text: 'Link with arrow icon',
9
- href: '#',
10
- iconPosition: 'start',
8
+ dsText: 'Link with arrow icon',
9
+ dsHref: '#',
10
+ dsIconPosition: 'start',
11
11
  },
12
12
  };
13
13
  export const IconPositionEnd = {
14
14
  args: {
15
- text: 'Link with arrow icon',
16
- href: '#',
17
- iconPosition: 'end',
15
+ dsText: 'Link with arrow icon',
16
+ dsHref: '#',
17
+ dsIconPosition: 'end',
18
18
  },
19
19
  };
@@ -1,9 +1,3 @@
1
- import { getAriaAttributeArgTypes } from "../../../../utils/attributes/attributes";
2
- const anchorAriaAttributes = [
3
- 'aria-current',
4
- 'aria-haspopup',
5
- ];
6
- const anchorAriaAttributeArgTypes = getAriaAttributeArgTypes(anchorAriaAttributes);
7
1
  const meta = {
8
2
  title: 'Base Components/LinkWithArrow',
9
3
  component: 'ds-link-with-arrow',
@@ -11,31 +5,13 @@ const meta = {
11
5
  export default meta;
12
6
  export const Default = {
13
7
  args: {
14
- text: 'Link with arrow icon',
15
- href: '#',
8
+ dsText: 'Link with arrow icon',
9
+ dsHref: '#',
16
10
  },
17
11
  };
18
12
  export const Playground = {
19
13
  args: {
20
- text: 'Link with arrow icon',
21
- href: '#',
22
- },
23
- argTypes: {
24
- text: { control: 'text' },
25
- href: { control: 'text' },
26
- target: { control: 'text' },
27
- iconPosition: {
28
- control: 'select',
29
- options: ['start', 'end'],
30
- },
31
- language: {
32
- control: 'text',
33
- description: 'ISO 639 language code. Known languages are: "en", "fi", "sv". When undefined will use browser\'s language.',
34
- },
35
- ariaLabel: {
36
- name: 'aria-label',
37
- control: 'text',
38
- },
39
- ...anchorAriaAttributeArgTypes,
14
+ dsText: 'Link with arrow icon',
15
+ dsHref: '#',
40
16
  },
41
17
  };