@uh-design-system/component-library 0.4.0 → 0.4.2

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 (151) hide show
  1. package/dist/cjs/component-library.cjs.js +3 -3
  2. package/dist/cjs/controlUtils-041de0fd.js +7 -0
  3. package/dist/cjs/ds-accordion_3.cjs.entry.js +27 -20
  4. package/dist/cjs/ds-checkbox-group.cjs.entry.js +156 -0
  5. package/dist/cjs/ds-checkbox.cjs.entry.js +153 -0
  6. package/dist/cjs/ds-input-validity.cjs.entry.js +38 -0
  7. package/dist/cjs/ds-link-with-arrow.cjs.entry.js +8 -7
  8. package/dist/cjs/ds-link.cjs.entry.js +11 -8
  9. package/dist/cjs/ds-text-input.cjs.entry.js +30 -6
  10. package/dist/cjs/ds-visually-hidden.cjs.entry.js +2 -2
  11. package/dist/cjs/{index-bfa0f441.js → index-b2bddcf4.js} +326 -125
  12. package/dist/cjs/{linkUtils-695da37c.js → linkUtils-e911e899.js} +10 -0
  13. package/dist/cjs/loader.cjs.js +2 -2
  14. package/dist/cjs/utils-c9113835.js +18 -0
  15. package/dist/collection/accessibility/accessibility.stories.js +10 -0
  16. package/dist/collection/accessibility/stories/ariaLabel.stories.js +19 -0
  17. package/dist/collection/accessibility/stories/ariaLabelledBy.stories.js +49 -0
  18. package/dist/collection/accessibility/stories/naming.stories.js +39 -0
  19. package/dist/collection/collection-manifest.json +4 -1
  20. package/dist/collection/components/00-foundations/icons/categories/information.js +4 -0
  21. package/dist/collection/components/00-foundations/typography/stories/typography.stories.js +133 -48
  22. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +1 -1
  23. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +6 -6
  24. package/dist/collection/components/01-base-components/ds-button/ds-button.css +9 -9
  25. package/dist/collection/components/01-base-components/ds-button/ds-button.js +2 -2
  26. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +53 -12
  27. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +88 -55
  28. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.stories.js +1 -1
  29. package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +144 -0
  30. package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.js +429 -0
  31. package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.features.stories.js +115 -0
  32. package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.js +37 -0
  33. package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.css +38 -0
  34. package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js +445 -0
  35. package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.js +89 -0
  36. package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.stories.js +47 -0
  37. package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +1 -1
  38. package/dist/collection/components/01-base-components/ds-icon/{ds-icon.stories.js → stories/ds-icon.stories.js} +12 -2
  39. package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.css +31 -0
  40. package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js +114 -0
  41. package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.features.stories.js +17 -0
  42. package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.js +21 -0
  43. package/dist/collection/components/01-base-components/ds-link/ds-link.css +19 -139
  44. package/dist/collection/components/01-base-components/ds-link/ds-link.js +68 -8
  45. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.examples.stories.js +6 -2
  46. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.features.stories.js +2 -2
  47. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +15 -4
  48. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +1 -139
  49. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +25 -5
  50. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.examples.stories.js → ds-link-with-arrow.examples.stories.js} +26 -3
  51. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.stories.js → ds-link-with-arrow.stories.js} +5 -4
  52. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +8 -11
  53. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +30 -5
  54. package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.examples.stories.js +29 -7
  55. package/dist/collection/components/01-base-components/ds-text-input/utils.js +0 -6
  56. package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
  57. package/dist/collection/utils/controls/controlUtils.js +2 -0
  58. package/dist/collection/utils/link/linkUtils.js +9 -0
  59. package/dist/collection/utils/typography/typographyUtils.js +39 -0
  60. package/dist/collection/utils/utils.js +24 -6
  61. package/dist/component-library/component-library.css +1 -1
  62. package/dist/component-library/component-library.esm.js +1 -1
  63. package/dist/component-library/controlUtils-9ca4087b.js +1 -0
  64. package/dist/component-library/ds-accordion_3.entry.js +1 -1
  65. package/dist/component-library/ds-checkbox-group.entry.js +1 -0
  66. package/dist/component-library/ds-checkbox.entry.js +1 -0
  67. package/dist/component-library/ds-input-validity.entry.js +1 -0
  68. package/dist/component-library/ds-link-with-arrow.entry.js +1 -1
  69. package/dist/component-library/ds-link.entry.js +1 -1
  70. package/dist/component-library/ds-text-input.entry.js +1 -1
  71. package/dist/component-library/ds-visually-hidden.entry.js +1 -1
  72. package/dist/component-library/index-50783b0c.js +2 -0
  73. package/dist/component-library/{linkUtils-3d1b28cf.js → linkUtils-fe63ff72.js} +1 -1
  74. package/dist/component-library/utils-b5843ae1.js +1 -0
  75. package/dist/components/attributes.js +1 -80
  76. package/dist/components/controlUtils.js +4 -0
  77. package/dist/components/ds-accordion.js +8 -8
  78. package/dist/components/ds-button2.js +4 -3
  79. package/dist/components/ds-checkbox-group.d.ts +11 -0
  80. package/dist/components/ds-checkbox-group.js +206 -0
  81. package/dist/components/ds-checkbox.d.ts +11 -0
  82. package/dist/components/ds-checkbox.js +6 -0
  83. package/dist/components/ds-checkbox2.js +185 -0
  84. package/dist/components/ds-icon2.js +24 -4
  85. package/dist/components/ds-input-validity.d.ts +11 -0
  86. package/dist/components/ds-input-validity.js +6 -0
  87. package/dist/components/ds-input-validity2.js +59 -0
  88. package/dist/components/ds-link-with-arrow.js +10 -8
  89. package/dist/components/ds-link.js +15 -9
  90. package/dist/components/ds-text-input.js +30 -7
  91. package/dist/components/ds-visually-hidden2.js +1 -1
  92. package/dist/components/index2.js +298 -130
  93. package/dist/components/index3.js +80 -0
  94. package/dist/components/linkUtils.js +10 -1
  95. package/dist/esm/component-library.js +4 -4
  96. package/dist/esm/controlUtils-9ca4087b.js +4 -0
  97. package/dist/esm/ds-accordion_3.entry.js +25 -18
  98. package/dist/esm/ds-checkbox-group.entry.js +152 -0
  99. package/dist/esm/ds-checkbox.entry.js +149 -0
  100. package/dist/esm/ds-input-validity.entry.js +34 -0
  101. package/dist/esm/ds-link-with-arrow.entry.js +8 -7
  102. package/dist/esm/ds-link.entry.js +11 -8
  103. package/dist/esm/ds-text-input.entry.js +30 -6
  104. package/dist/esm/ds-visually-hidden.entry.js +2 -2
  105. package/dist/esm/{index-42701395.js → index-50783b0c.js} +326 -126
  106. package/dist/esm/{linkUtils-3d1b28cf.js → linkUtils-fe63ff72.js} +10 -1
  107. package/dist/esm/loader.js +3 -3
  108. package/dist/esm/utils-b5843ae1.js +15 -0
  109. package/dist/types/accessibility/accessibility.stories.d.ts +3 -0
  110. package/dist/types/accessibility/stories/ariaLabel.stories.d.ts +5 -0
  111. package/dist/types/accessibility/stories/ariaLabelledBy.stories.d.ts +4 -0
  112. package/dist/types/accessibility/stories/naming.stories.d.ts +4 -0
  113. package/dist/types/components/00-foundations/typography/stories/typography.stories.d.ts +1 -0
  114. package/dist/types/components/01-base-components/ds-button/stories/ds-button.examples.stories.d.ts +2 -0
  115. package/dist/types/components/01-base-components/ds-button/stories/ds-button.features.stories.d.ts +4 -1
  116. package/dist/types/components/01-base-components/ds-checkbox/ds-checkbox.d.ts +49 -0
  117. package/dist/types/components/01-base-components/ds-checkbox/stories/ds-checkbox.features.stories.d.ts +13 -0
  118. package/dist/types/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.d.ts +7 -0
  119. package/dist/types/components/01-base-components/ds-checkbox-group/ds-checkbox-group.d.ts +56 -0
  120. package/dist/types/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.d.ts +11 -0
  121. package/dist/types/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.stories.d.ts +7 -0
  122. package/dist/types/components/01-base-components/ds-icon/{ds-icon.stories.d.ts → stories/ds-icon.stories.d.ts} +2 -1
  123. package/dist/types/components/01-base-components/ds-input-validity/ds-input-validity.d.ts +12 -0
  124. package/dist/types/components/01-base-components/ds-input-validity/stories/ds-input-validity.features.stories.d.ts +7 -0
  125. package/dist/types/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.d.ts +7 -0
  126. package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +4 -1
  127. package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +1 -0
  128. package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +5 -0
  129. package/dist/types/components/01-base-components/ds-text-input/utils.d.ts +0 -1
  130. package/dist/types/components.d.ts +142 -2
  131. package/dist/types/utils/controls/controlUtils.d.ts +2 -0
  132. package/dist/types/utils/link/linkUtils.d.ts +1 -0
  133. package/dist/types/utils/typography/typographyUtils.d.ts +5 -0
  134. package/dist/types/utils/utils.d.ts +10 -3
  135. package/package.json +19 -18
  136. package/dist/cjs/utils-8b73aa91.js +0 -10
  137. package/dist/collection/components/00-foundations/typography/typography.stories.js +0 -68
  138. package/dist/component-library/index-42701395.js +0 -2
  139. package/dist/component-library/utils-cca2a41a.js +0 -1
  140. package/dist/components/utils.js +0 -8
  141. package/dist/esm/utils-cca2a41a.js +0 -8
  142. package/dist/types/components/00-foundations/typography/typography.stories.d.ts +0 -7
  143. /package/dist/cjs/{attributes-f7831329.js → attributes-5f5b58be.js} +0 -0
  144. /package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.features.stories.js → ds-link-with-arrow.features.stories.js} +0 -0
  145. /package/dist/collection/utils/{attributes.js → attributes/attributes.js} +0 -0
  146. /package/dist/component-library/{attributes-9419ac39.js → attributes-7d09be1b.js} +0 -0
  147. /package/dist/esm/{attributes-9419ac39.js → attributes-7d09be1b.js} +0 -0
  148. /package/dist/types/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.examples.stories.d.ts → ds-link-with-arrow.examples.stories.d.ts} +0 -0
  149. /package/dist/types/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.features.stories.d.ts → ds-link-with-arrow.features.stories.d.ts} +0 -0
  150. /package/dist/types/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.stories.d.ts → ds-link-with-arrow.stories.d.ts} +0 -0
  151. /package/dist/types/utils/{attributes.d.ts → attributes/attributes.d.ts} +0 -0
@@ -11,6 +11,16 @@ const visuallyHiddenAssistiveText = (lang) => {
11
11
  return 'Opens in a new tab';
12
12
  }
13
13
  };
14
+ const getAriaLabel = (text, ariaLabel) => {
15
+ if (!ariaLabel) {
16
+ return undefined;
17
+ }
18
+ if (ariaLabel.startsWith(text)) {
19
+ return ariaLabel;
20
+ }
21
+ return [text, ariaLabel].join(' ');
22
+ };
14
23
 
24
+ exports.getAriaLabel = getAriaLabel;
15
25
  exports.opensInNewTab = opensInNewTab;
16
26
  exports.visuallyHiddenAssistiveText = visuallyHiddenAssistiveText;
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-bfa0f441.js');
5
+ const index = require('./index-b2bddcf4.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["ds-visually-hidden.cjs",[[1,"ds-visually-hidden"]]],["ds-accordion_3.cjs",[[1,"ds-accordion",{"variant":[1],"borderAligned":[4,"border-aligned"],"openByDefault":[4,"open-by-default"],"accordionId":[1,"accordion-id"],"headingLevel":[2,"heading-level"],"useCloseButton":[4,"use-close-button"],"closeButtonLabel":[1,"close-button-label"],"hideTopBorder":[4,"hide-top-border"],"isExpanded":[32]},null,{"isExpanded":["watchHandler"]}],[6,"ds-button",{"value":[1],"variant":[1],"colour":[1],"size":[1],"fontWeight":[1,"font-weight"],"icon":[1],"iconPosition":[1,"icon-position"],"type":[1],"disabled":[4],"fullWidth":[4,"full-width"],"ariaDisabled":[1,"aria-disabled"]}],[1,"ds-icon",{"name":[1],"colour":[1],"size":[1],"dsTitle":[1,"title"],"role":[1],"hidden":[4],"message":[32]}]]],["ds-text-input.cjs",[[6,"ds-text-input",{"label":[1],"placeholder":[1],"dsId":[1,"id"],"name":[1],"disabled":[4],"optional":[4],"required":[4],"readonly":[4],"value":[1],"min":[2],"max":[2],"maxlength":[2],"pattern":[1],"autocomplete":[1],"optionalText":[1,"optional-text"],"errorText":[1,"error-text"],"successText":[1,"success-text"],"assistiveText":[1,"assistive-text"],"actionButtonAriaLabel":[1,"action-button-aria-label"],"hiddenAssistiveText":[1,"hidden-assistive-text"],"prefixText":[1,"prefix-text"],"suffixText":[1,"suffix-text"],"icon":[1],"type":[1],"ariaLabel":[1,"aria-label"],"ariaLabelledBy":[1,"aria-labelledby"],"ariaDescribedby":[1,"aria-describedby"],"hasFocus":[32],"clearButtonVisible":[32],"passwordInputVisible":[32],"inputActive":[32],"togglePasswordVisibility":[64],"clearInput":[64]}]]],["ds-link.cjs",[[1,"ds-link",{"text":[1],"size":[1],"variant":[1],"weight":[1],"icon":[1025],"iconPosition":[1025,"icon-position"],"href":[1],"target":[1],"download":[4],"language":[1,"lang"]}]]],["ds-link-with-arrow.cjs",[[1,"ds-link-with-arrow",{"text":[1],"iconPosition":[1,"icon-position"],"href":[1],"target":[1],"language":[1,"lang"]}]]]], options);
11
+ return index.bootstrapLazy([["ds-accordion_3.cjs",[[1,"ds-accordion",{"variant":[1],"borderAligned":[4,"border-aligned"],"openByDefault":[4,"open-by-default"],"accordionId":[1,"accordion-id"],"headingLevel":[2,"heading-level"],"useCloseButton":[4,"use-close-button"],"closeButtonLabel":[1,"close-button-label"],"hideTopBorder":[4,"hide-top-border"],"isExpanded":[32]},null,{"isExpanded":["watchHandler"]}],[6,"ds-button",{"value":[1],"variant":[1],"colour":[1],"size":[1],"fontWeight":[1,"font-weight"],"icon":[1],"iconPosition":[1,"icon-position"],"type":[1],"disabled":[4],"fullWidth":[4,"full-width"],"ariaDisabled":[1,"aria-disabled"]}],[1,"ds-icon",{"name":[1],"colour":[1],"size":[1],"dsTitle":[1,"title"],"role":[1],"hidden":[4],"message":[32]}]]],["ds-checkbox-group.cjs",[[1,"ds-checkbox-group",{"legend":[1],"assistiveText":[1,"assistive-text"],"direction":[1],"errorText":[1,"error-text"],"text":[1],"checked":[1028],"checkedChildElementCount":[1026,"checked-child-element-count"],"disabled":[4],"parentCheckedCount":[2,"parent-checked-count"],"childElementsCount":[32],"isIndeterminate":[32],"indeterminateChildCheckboxCount":[32],"setChecked":[64]},[[0,"dsCheckboxGroupIndeterminateChildChange","handleIndeterminateChildChange"],[0,"dsCheckboxChange","handleCheckboxChange"],[0,"dsCheckboxGroupChange","handleCheckboxGroupChange"]],{"disabled":["handleCheckboxDisabledChange"],"checked":["handleCheckedChange"],"isIndeterminate":["handleIndeterminateChange"],"checkedChildElementCount":["handleCheckedChildElementCountChange"]}]]],["ds-visually-hidden.cjs",[[1,"ds-visually-hidden"]]],["ds-text-input.cjs",[[6,"ds-text-input",{"label":[1],"placeholder":[1],"dsId":[1,"id"],"name":[1],"disabled":[4],"optional":[4],"required":[4],"readonly":[4],"value":[1],"min":[2],"max":[2],"maxlength":[2],"pattern":[1],"autocomplete":[1],"optionalText":[1,"optional-text"],"errorText":[1,"error-text"],"successText":[1,"success-text"],"assistiveText":[1,"assistive-text"],"actionButtonAriaLabel":[1,"action-button-aria-label"],"hiddenAssistiveText":[1,"hidden-assistive-text"],"prefixText":[1,"prefix-text"],"suffixText":[1,"suffix-text"],"icon":[1],"type":[1],"ariaLabel":[1,"aria-label"],"ariaLabelledBy":[1,"aria-labelledby"],"ariaDescribedby":[1,"aria-describedby"],"hasFocus":[32],"clearButtonVisible":[32],"passwordInputVisible":[32],"inputActive":[32],"togglePasswordVisibility":[64],"clearInput":[64]}]]],["ds-link.cjs",[[1,"ds-link",{"text":[1],"size":[1],"variant":[1],"weight":[1],"icon":[1025],"iconPosition":[1025,"icon-position"],"iconTitle":[1,"icon-title"],"iconHidden":[4,"icon-hidden"],"href":[1],"target":[1],"download":[4],"language":[1,"lang"],"linkAriaLabel":[1,"aria-label"]}]]],["ds-link-with-arrow.cjs",[[1,"ds-link-with-arrow",{"text":[1],"iconPosition":[1,"icon-position"],"href":[1],"target":[1],"language":[1,"lang"],"linkAriaLabel":[1,"aria-label"]}]]],["ds-input-validity.cjs",[[0,"ds-input-validity",{"text":[1],"type":[1],"validityRole":[1,"role"],"identifier":[32]}]]],["ds-checkbox.cjs",[[65,"ds-checkbox",{"checkboxId":[1025,"id"],"checked":[1028],"legend":[1],"assistiveText":[1,"assistive-text"],"text":[1],"indeterminate":[4],"disabled":[4],"errorText":[1,"error-text"],"errorsDisabled":[4,"data-errors-disabled"],"required":[4],"optional":[4],"optionalText":[1,"optional-text"],"ariaLabel":[32],"value":[32],"validationMessage":[32]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ const formatAs = (value, suffix) => value.endsWith(suffix) ? value : `${value}${suffix}`;
4
+ const formatAsPx = (value) => formatAs(value, 'px');
5
+ const remToPx = (remString) => {
6
+ const rootFontSize = 16;
7
+ const rem = parseFloat(remString);
8
+ return formatAsPx(`${rem * rootFontSize}`);
9
+ };
10
+ function* idGenerator(id) {
11
+ let currentId = 1;
12
+ while (true) {
13
+ yield `${id}-${currentId++}`;
14
+ }
15
+ }
16
+
17
+ exports.idGenerator = idGenerator;
18
+ exports.remToPx = remToPx;
@@ -0,0 +1,10 @@
1
+ import AccessibilityDocs from "./Accessibility.mdx";
2
+ const meta = {
3
+ title: 'Accessibility',
4
+ parameters: {
5
+ docs: {
6
+ page: AccessibilityDocs,
7
+ },
8
+ },
9
+ };
10
+ export default meta;
@@ -0,0 +1,19 @@
1
+ import { html } from "lit";
2
+ const meta = {
3
+ title: 'Accessibility/aria-label',
4
+ };
5
+ export default meta;
6
+ export const HowToAriaLabel = {
7
+ name: 'How to "aria-label"',
8
+ render: () => html `
9
+ <ds-button aria-label="My profile Some other relevant thing" value="My profile"></ds-button>
10
+ <!This is a good example.>
11
+ `,
12
+ };
13
+ export const HowNotToAriaLabel = {
14
+ name: 'How not to "aria-label"',
15
+ render: () => html `
16
+ <ds-button aria-label="this will override the visible name of the button" value="My profile"></ds-button>
17
+ <!Think of this as a very bad example.>
18
+ `,
19
+ };
@@ -0,0 +1,49 @@
1
+ import { html } from "lit";
2
+ import { litTemplateResultToString } from "../../utils/utils";
3
+ const meta = {
4
+ title: 'Accessibility/aria-labelledby',
5
+ };
6
+ export default meta;
7
+ const howToAriaLabelledByDOM = html `
8
+ <div class="ds-sb-how-to-aria-labelled-by">
9
+ <div class="ds-sb-how-to-aria-labelled-by__card">
10
+ <h3 id="stu_1">Student 1</h3>
11
+ <p>Faculty of Science</p>
12
+ <ds-button id="button1" aria-labelledby="button1 stu_1" value="Add"></ds-button>
13
+ </div>
14
+ <div class="ds-sb-how-to-aria-labelled-by__card">
15
+ <h3 id="stu_2">Student 2</h3>
16
+ <p>Faculty of Arts</p>
17
+ <ds-button id="button2" aria-labelledby="button2 stu_2" value="Add"></ds-button>
18
+ </div>
19
+ </div>
20
+ `;
21
+ export const HowToAriaLabelledBy = {
22
+ name: 'How to "aria-labelledby"',
23
+ parameters: {
24
+ docs: {
25
+ source: {
26
+ code: litTemplateResultToString(howToAriaLabelledByDOM),
27
+ },
28
+ },
29
+ },
30
+ render: () => html `
31
+ <style>
32
+ .ds-sb-how-to-aria-labelled-by {
33
+ display: grid;
34
+ gap: 1rem;
35
+ grid-template-columns: 1fr;
36
+
37
+ @media (min-width: 60rem) {
38
+ grid-template-columns: 1fr 1fr;
39
+ }
40
+ }
41
+ .ds-sb-how-to-aria-labelled-by .ds-sb-how-to-aria-labelled-by__card {
42
+ padding: 1em;
43
+ background-color: #f7f7f7;
44
+ outline: 1px solid;
45
+ }
46
+ </style>
47
+ ${howToAriaLabelledByDOM}
48
+ `,
49
+ };
@@ -0,0 +1,39 @@
1
+ import { html } from "lit";
2
+ import { litTemplateResultToString } from "../../utils/utils";
3
+ const meta = {
4
+ title: 'Accessibility/Naming',
5
+ };
6
+ export default meta;
7
+ const howNamingWorksDOM = html `
8
+ <div class="ds-sb-how-naming-works">
9
+ <div>
10
+ <ds-button value="Continue"></ds-button>
11
+ <!The button gets it's accessible name from its text content>
12
+ </div>
13
+
14
+ <ds-text-input type="text" label="First name"></ds-text-input>
15
+ <!The text input gets its accessible name from the label/for structure>
16
+
17
+ <ds-link href="#" text="Apply to University of Helsinki"></ds-link>
18
+ <!The link gets it's accessible name from its text content>
19
+ </div>
20
+ `;
21
+ export const HowNamingWorks = {
22
+ parameters: {
23
+ docs: {
24
+ source: {
25
+ code: litTemplateResultToString(howNamingWorksDOM)
26
+ }
27
+ },
28
+ },
29
+ render: () => html `
30
+ <style>
31
+ .ds-sb-how-naming-works {
32
+ display: flex;
33
+ flex-direction: column;
34
+ gap: 1rem;
35
+ }
36
+ </style>
37
+ ${howNamingWorksDOM}
38
+ `,
39
+ };
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "entries": [
3
+ "components/01-base-components/ds-checkbox/ds-checkbox.js",
4
+ "components/01-base-components/ds-checkbox-group/ds-checkbox-group.js",
3
5
  "components/01-base-components/ds-accordion/ds-accordion.js",
4
6
  "components/01-base-components/ds-button/ds-button.js",
5
7
  "components/01-base-components/ds-icon/ds-icon.js",
8
+ "components/01-base-components/ds-input-validity/ds-input-validity.js",
6
9
  "components/01-base-components/ds-link/ds-link.js",
7
10
  "components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js",
8
11
  "components/01-base-components/ds-text-input/ds-text-input.js",
@@ -10,7 +13,7 @@
10
13
  ],
11
14
  "compiler": {
12
15
  "name": "@stencil/core",
13
- "version": "4.26.0",
16
+ "version": "4.27.2",
14
17
  "typescriptVersion": "5.5.4"
15
18
  },
16
19
  "collections": [],
@@ -49,6 +49,8 @@ import PieChartIcon from "@material-symbols/svg-700/sharp/pie_chart.svg";
49
49
  import PieChartFillIcon from "@material-symbols/svg-700/sharp/pie_chart-fill.svg";
50
50
  import TableIcon from "@material-symbols/svg-700/sharp/table.svg";
51
51
  import TableFillIcon from "@material-symbols/svg-700/sharp/table-fill.svg";
52
+ import DSCheckSmall from "../../../../../custom-icons/check_small.svg";
53
+ import DSCheckIndeterminateSmall from "../../../../../custom-icons/check_indeterminate_small.svg";
52
54
  export const icons = [
53
55
  { name: 'calendar_month', component: CalendarMonthIcon, category: category },
54
56
  { name: 'calendar_month_fill', component: CalendarMonthFillIcon, category: category },
@@ -100,4 +102,6 @@ export const icons = [
100
102
  { name: 'pie_chart_fill', component: PieChartFillIcon, category: category },
101
103
  { name: 'table', component: TableIcon, category: category },
102
104
  { name: 'table_fill', component: TableFillIcon, category: category },
105
+ { name: 'ds_check_small', component: DSCheckSmall, category: category },
106
+ { name: 'ds_check_indeterminate_small', component: DSCheckIndeterminateSmall, category: category },
103
107
  ];
@@ -2,9 +2,9 @@ import "../_typography.scss";
2
2
  import "../_base.scss";
3
3
  import "../_headings.scss";
4
4
  import "../_bodyText.scss";
5
- import { getTypographyVariables, createCategorySection, categories } from "../../../../utils/typography/typographyUtils";
5
+ import { getTypographyVariables, createCategorySection, categories, getHeadingVariables, headingSizes } from "../../../../utils/typography/typographyUtils";
6
6
  import { html } from "lit";
7
- import { generateLoremIpsum } from "../../../../utils/utils";
7
+ import { formatAsPx, generateLoremIpsum, pxToRem } from "../../../../utils/utils";
8
8
  const meta = {
9
9
  title: 'Foundations/Typography',
10
10
  };
@@ -27,61 +27,61 @@ export const TokenClasses = {
27
27
  render: ({ headingExample, textExample }) => html `
28
28
  <div>
29
29
  <h2>Heading styles</h2>
30
- <div class="ds-heading--2xLarge">${headingExample} </div>
31
- <div class="ds-heading--xLarge">${headingExample} </div>
32
- <div class="ds-heading--large">${headingExample} </div>
33
- <div class="ds-heading--medium">${headingExample} </div>
34
- <div class="ds-heading--small">${headingExample} </div>
35
- <div class="ds-heading--xSmall">${headingExample} </div>
36
-
30
+ <div class="ds-heading--2xLarge">${headingExample}</div>
31
+ <div class="ds-heading--xLarge">${headingExample}</div>
32
+ <div class="ds-heading--large">${headingExample}</div>
33
+ <div class="ds-heading--medium">${headingExample}</div>
34
+ <div class="ds-heading--small">${headingExample}</div>
35
+ <div class="ds-heading--xSmall">${headingExample}</div>
36
+
37
37
  <h2>Text Styles</h2>
38
38
  <h3>Regular</h3>
39
- <p class="ds-text--2xl-regular">${textExample} (2XL Regular) </p>
40
- <p class="ds-text--xl-regular">${textExample} (XL Regular) </p>
41
- <p class="ds-text--lg-regular">${textExample} (Large Regular) </p>
42
- <p class="ds-text--md-regular">${textExample} (Medium Regular) </p>
43
- <p class="ds-text--sm-regular">${textExample} (Small Regular) </p>
44
- <p class="ds-text--xs-regular">${textExample} (XS Regular) </p>
39
+ <p class="ds-text--2xl-regular">${textExample} (2XL Regular)</p>
40
+ <p class="ds-text--xl-regular">${textExample} (XL Regular)</p>
41
+ <p class="ds-text--lg-regular">${textExample} (Large Regular)</p>
42
+ <p class="ds-text--md-regular">${textExample} (Medium Regular)</p>
43
+ <p class="ds-text--sm-regular">${textExample} (Small Regular)</p>
44
+ <p class="ds-text--xs-regular">${textExample} (XS Regular)</p>
45
45
  <h3>SemiBold</h3>
46
- <p class="ds-text--2xl-semibold">${textExample} (2XL Semibold) </p>
47
- <p class="ds-text--xl-semibold">${textExample} (XL Semibold) </p>
48
- <p class="ds-text--lg-semibold">${textExample} (Large Semibold) </p>
49
- <p class="ds-text--md-semibold">${textExample} (Medium Semibold) </p>
50
- <p class="ds-text--sm-semibold">${textExample} (Small Semibold) </p>
51
- <p class="ds-text--xs-semibold">${textExample} (XS Semibold) </p>
46
+ <p class="ds-text--2xl-semibold">${textExample} (2XL Semibold)</p>
47
+ <p class="ds-text--xl-semibold">${textExample} (XL Semibold)</p>
48
+ <p class="ds-text--lg-semibold">${textExample} (Large Semibold)</p>
49
+ <p class="ds-text--md-semibold">${textExample} (Medium Semibold)</p>
50
+ <p class="ds-text--sm-semibold">${textExample} (Small Semibold)</p>
51
+ <p class="ds-text--xs-semibold">${textExample} (XS Semibold)</p>
52
52
  <h3>Bold</h3>
53
- <p class="ds-text--2xl-bold">${textExample} (2XL Bold) </p>
54
- <p class="ds-text--xl-bold">${textExample} (XL Bold) </p>
55
- <p class="ds-text--lg-bold">${textExample} (Large Bold) </p>
56
- <p class="ds-text--md-bold">${textExample} (Medium Bold) </p>
57
- <p class="ds-text--sm-bold">${textExample} (Small Bold) </p>
58
- <p class="ds-text--xs-bold">${textExample} (XS Bold) </p>
53
+ <p class="ds-text--2xl-bold">${textExample} (2XL Bold)</p>
54
+ <p class="ds-text--xl-bold">${textExample} (XL Bold)</p>
55
+ <p class="ds-text--lg-bold">${textExample} (Large Bold)</p>
56
+ <p class="ds-text--md-bold">${textExample} (Medium Bold)</p>
57
+ <p class="ds-text--sm-bold">${textExample} (Small Bold)</p>
58
+ <p class="ds-text--xs-bold">${textExample} (XS Bold)</p>
59
59
 
60
60
  <h2>Bodytext</h2>
61
- <p class="ds-bodyText--2xLarge">${textExample} (2xLarge) </p>
62
- <p class="ds-bodyText--xLarge">${textExample} (xLarge) </p>
63
- <p class="ds-bodyText--large">${textExample} (large) </p>
64
- <p class="ds-bodyText--medium">${textExample} (medium) </p>
65
- <p class="ds-bodyText--small">${textExample} (small) </p>
66
-
61
+ <p class="ds-bodyText--2xLarge">${textExample} (2xLarge)</p>
62
+ <p class="ds-bodyText--xLarge">${textExample} (xLarge)</p>
63
+ <p class="ds-bodyText--large">${textExample} (large)</p>
64
+ <p class="ds-bodyText--medium">${textExample} (medium)</p>
65
+ <p class="ds-bodyText--small">${textExample} (small)</p>
66
+
67
67
  <h2>Fontweight</h2>
68
- <p class="ds-font--regular">${textExample} (Regular) </p>
69
- <p class="ds-font--semibold">${textExample} (Semibold) </p>
70
- <p class="ds-font--semibold-plus">${textExample} (SemiboldPlus) </p>
71
- <p class="ds-font--bold">${textExample} (Bold) </p>
72
-
68
+ <p class="ds-font--regular">${textExample} (Regular)</p>
69
+ <p class="ds-font--semibold">${textExample} (Semibold)</p>
70
+ <p class="ds-font--semibold-plus">${textExample} (SemiboldPlus)</p>
71
+ <p class="ds-font--bold">${textExample} (Bold)</p>
72
+
73
73
  <h2>LetterSpacing</h2>
74
- <p class="ds-tracking--xtight">${textExample} (xTight Spacing) </p>
75
- <p class="ds-tracking--tight">${textExample} (Tight Spacing) </p>
76
- <p class="ds-tracking--normal">${textExample} (Normal Spacing) </p>
77
- <p class="ds-tracking--wide">${textExample} (Wide Spacing) </p>
78
- <p class="ds-tracking--xwide">${textExample} (xWide Spacing) </p>
79
-
74
+ <p class="ds-tracking--xtight">${textExample} (xTight Spacing)</p>
75
+ <p class="ds-tracking--tight">${textExample} (Tight Spacing)</p>
76
+ <p class="ds-tracking--normal">${textExample} (Normal Spacing)</p>
77
+ <p class="ds-tracking--wide">${textExample} (Wide Spacing)</p>
78
+ <p class="ds-tracking--xwide">${textExample} (xWide Spacing)</p>
79
+
80
80
  <h2>Lineheight</h2>
81
- <p class="ds-leading--small">${textExample} (Small Line Height) </p>
82
- <p class="ds-leading--medium">${textExample} (Medium Line Height) </p>
83
- <p class="ds-leading--large">${textExample} (Large Line Height) </p>
84
- <p class="ds-leading--xLarge">${textExample} (xLarge Line Height) </p>
81
+ <p class="ds-leading--small">${textExample} (Small Line Height)</p>
82
+ <p class="ds-leading--medium">${textExample} (Medium Line Height)</p>
83
+ <p class="ds-leading--large">${textExample} (Large Line Height)</p>
84
+ <p class="ds-leading--xLarge">${textExample} (xLarge Line Height)</p>
85
85
  </div>
86
86
  `,
87
87
  };
@@ -108,3 +108,88 @@ export const Typography = {
108
108
  },
109
109
  render: renderTypography,
110
110
  };
111
+ const renderHeadingDetails = (size, heading) => {
112
+ const variables = getHeadingVariables(size, heading === 'desktop');
113
+ return html `
114
+ <style>
115
+ .ds-sb-heading__details__content {
116
+ display: grid;
117
+ gap: 0 1rem;
118
+ grid-template-columns: auto auto 1fr;
119
+ }
120
+ .ds-sb-heading__details__content span.ds-sb-heading__details__content__two-col {
121
+ grid-column: span 2;
122
+ }
123
+ </style>
124
+ <div>
125
+ <h4 class="ds-heading-xSmall">${heading}</h4>
126
+ <div class="ds-text--sm-regular ds-sb-heading__details__content">
127
+ <span class="ds-text--sm-regular">Family</span>
128
+ <span class="ds-text--sm-semibold ds-sb-heading__details__content__two-col">${variables['font-family']}</span>
129
+
130
+ <span class="ds-text--sm-regular">Size</span>
131
+ <span class="ds-text--sm-semibold">${formatAsPx(variables['font-size'])}</span>
132
+ <span class="ds-text--sm-semibold">${pxToRem(variables['font-size'])}</span>
133
+
134
+ <span class="ds-text--sm-regular">Line height</span>
135
+ <span class="ds-text--sm-semibold">${formatAsPx(variables['line-height'])}</span>
136
+ <span class="ds-text--sm-semibold">${pxToRem(variables['line-height'])}</span>
137
+
138
+ <span class="ds-text--sm-regular">Letter spacing</span>
139
+ <span class="ds-text--sm-semibold ds-sb-heading__details__content__two-col">${formatAsPx(variables['letter-spacing'])}</span>
140
+
141
+ <span class="ds-text--sm-regular">Font weight</span>
142
+ <span class="ds-text--sm-semibold ds-sb-heading__details__content__two-col">${variables['font-weight']}</span>
143
+ </div>
144
+ </div>
145
+ `;
146
+ };
147
+ const renderHeadingDetailsDesktop = (size) => renderHeadingDetails(size, 'desktop');
148
+ const renderHeadingDetailsMobile = (size) => renderHeadingDetails(size, 'mobile');
149
+ const renderHeading = (size) => {
150
+ return html `
151
+ <style>
152
+ .ds-sb-heading {
153
+ border-bottom: 1px solid #c0c0c0;
154
+ padding-bottom: 2em;
155
+ margin-bottom: 0.5em;
156
+ }
157
+ .ds-sb-heading div.ds-sb-heading__details {
158
+ display: grid;
159
+ grid-template-columns: 1fr;
160
+ gap: 2rem 0;
161
+
162
+ @media (min-width: 60rem) {
163
+ grid-template-columns: 1fr 1fr;
164
+ gap: 0 2rem;
165
+ }
166
+ }
167
+ </style>
168
+ <div class="ds-sb-heading">
169
+ <h3 class="ds-heading--small">${size}</h3>
170
+ <div class="ds-sb-heading__details">
171
+ <div>${renderHeadingDetailsDesktop(size)} ${renderHeadingDetailsMobile(size)}</div>
172
+ <div>
173
+ <div class="ds-heading--${size}">${generateLoremIpsum()}</div>
174
+ </div>
175
+ </div>
176
+ </div>
177
+ `;
178
+ };
179
+ export const Headings = {
180
+ parameters: {
181
+ docs: {
182
+ source: {
183
+ code: `
184
+ ${headingSizes.map(size => `<div class="ds-heading--${size}">${generateLoremIpsum()}</div>`).join('\n')}
185
+ `
186
+ },
187
+ },
188
+ },
189
+ render: () => html `
190
+ <div>
191
+ <h2>Headings</h2>
192
+ ${headingSizes.map(size => renderHeading(size))}
193
+ </div>
194
+ `,
195
+ };
@@ -20,7 +20,7 @@
20
20
  position: relative;
21
21
  width: 100%;
22
22
  }
23
- .ds-accordion__open-button:focus-visible, .ds-accordion__open-button:focus-within {
23
+ .ds-accordion__open-button:focus-visible {
24
24
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
25
25
  outline-color: var(--ds-borderColor-black);
26
26
  outline-offset: var(--ds-borderWidth-thin);
@@ -43,18 +43,18 @@ export class DsAccordion {
43
43
  render() {
44
44
  const iconSize = this.variant === 'compact' ? '1.5rem' : '2rem';
45
45
  const buttonSize = this.variant === 'compact' ? 'small' : 'medium';
46
- return (h("div", { key: '830fb0965ea8904b662280b775a159528d7ddc03', class: classNames('ds-accordion', `ds-accordion--${this.variant}`, {
46
+ return (h("div", { key: '4ab62a504c68a926d59d2b4753aaf3a5b0ebd39d', class: classNames('ds-accordion', `ds-accordion--${this.variant}`, {
47
47
  'ds-accordion--border-aligned': this.borderAligned
48
- }), role: "presentation" }, h("div", { key: 'a3d6e538dda9513bfb578379cced370be686ce62', class: "ds-accordion__item" }, h("div", { key: '7c7819bf62cdffb9ac4a8c4f7b1609b31efcdd68', role: "heading", "aria-level": this.headingLevel, class: "ds-accordion__title" }, h("button", { key: '2e2a9fdfced241b23bdcfb444777cdd2fd0a764c', class: classNames('ds-accordion__open-button', `ds-accordion--${this.variant}`, {
48
+ }), role: "presentation" }, h("div", { key: 'f98a24462b341c86d4a9ba71eff5d7b5ffbb2eb0', class: "ds-accordion__item" }, h("div", { key: '0da3c96376007d4b597e55ac54cb90de9a4788c7', role: "heading", "aria-level": this.headingLevel, class: "ds-accordion__title" }, h("button", { key: '98885f42ecad0aaf00ea736d147fd7838685f1d0', class: classNames('ds-accordion__open-button', `ds-accordion--${this.variant}`, {
49
49
  'ds-accordion--border-aligned': this.borderAligned,
50
50
  'ds-accordion--hide-top-border': this.hideTopBorder
51
- }), onClick: this.handleClick, onKeyDown: this.handleKeyDown, "aria-expanded": this.isExpanded ? 'true' : 'false', "aria-controls": `${this.accordionId}-panel`, id: this.accordionId, ref: (el) => this.headerButtonRef = el }, h("span", { key: 'eca6297dd43b58849c8b46f66034ec51bb20bf1e', class: "ds-accordion__icon", "aria-hidden": "true" }, this.isExpanded ?
51
+ }), onClick: this.handleClick, onKeyDown: this.handleKeyDown, "aria-expanded": this.isExpanded ? 'true' : 'false', "aria-controls": `${this.accordionId}-panel`, id: this.accordionId, ref: (el) => this.headerButtonRef = el }, h("span", { key: '8f5ee7d3c251b0b34f9b57f74c2fb87ceb7266d3', class: "ds-accordion__icon", "aria-hidden": "true" }, this.isExpanded ?
52
52
  h("ds-icon", { size: iconSize, hidden: true, name: "keyboard_arrow_up" })
53
- : h("ds-icon", { size: iconSize, hidden: true, name: "keyboard_arrow_down" })), h("slot", { key: '9ddb913b968b8bbbe47d4be341766503fdcf4df7', name: "header" }))), h("div", { key: '21cee953529ccd21487b7ac0001aac10bf3d563e', id: `${this.accordionId}-panel`, role: "region", "aria-labelledby": this.accordionId, class: classNames('ds-accordion__panel', `ds-accordion__panel--${this.variant}`, {
53
+ : h("ds-icon", { size: iconSize, hidden: true, name: "keyboard_arrow_down" })), h("slot", { key: 'a9b391fd0bba7055c68e3995bafbf07d4b069038', name: "header" }))), h("div", { key: '551a044a61152ab1799d519fcf9331eb29b428e2', id: `${this.accordionId}-panel`, role: "region", "aria-labelledby": this.accordionId, class: classNames('ds-accordion__panel', `ds-accordion__panel--${this.variant}`, {
54
54
  'ds-accordion__panel--border-aligned': this.borderAligned,
55
55
  'ds-accordion__panel--expanded': this.isExpanded
56
- }), hidden: !this.isExpanded }, h("div", { key: 'a9d5dfdbf190936156b0b37b6ef2b877741f6ae1', class: "ds-accordion__content" }, h("slot", { key: '34ca29ec15581a470fe2c740fceea9fcdc7cb64a', name: "content" })), this.useCloseButton &&
57
- h("ds-button", { key: '1dfa2fad990fc6651a620efd8b3169346bb08648', "aria-labelledby": `${this.accordionId}-close-button ${this.accordionId}`, id: `${this.accordionId}-close-button`, class: classNames('ds-accordion__close-button', `ds-accordion--${this.variant}`, {
56
+ }), hidden: !this.isExpanded }, h("div", { key: '455ab200c7febf67028a6ec2ef27eeeaa8bff6ae', class: "ds-accordion__content" }, h("slot", { key: '31af185bd1680cf70ba81ed7826f977d9620372a', name: "content" })), this.useCloseButton &&
57
+ h("ds-button", { key: 'fdeeae0f9e3c866a1f851a18fe2524afa92124d5', "aria-labelledby": `${this.accordionId}-close-button ${this.accordionId}`, id: `${this.accordionId}-close-button`, class: classNames('ds-accordion__close-button', `ds-accordion--${this.variant}`, {
58
58
  'ds-accordion--border-aligned': this.borderAligned
59
59
  }), fontWeight: 'semiBold', variant: 'supplementary', colour: 'black', icon: 'keyboard_arrow_up', iconPosition: 'start', onClick: this.handleClick, onKeyDown: this.handleKeyDown, value: this.closeButtonLabel, size: buttonSize, type: 'button' })))));
60
60
  }
@@ -70,7 +70,7 @@
70
70
  border-color: transparent;
71
71
  color: var(--ds-textColor-white);
72
72
  }
73
- .ds-button.primary.blue:focus-visible, .ds-button.primary.blue:focus-within {
73
+ .ds-button.primary.blue:focus-visible {
74
74
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
75
75
  outline-color: var(--ds-borderColor-black);
76
76
  outline-offset: var(--ds-borderWidth-thin);
@@ -93,7 +93,7 @@
93
93
  border-color: transparent;
94
94
  color: var(--ds-textColor-white);
95
95
  }
96
- .ds-button.primary.black:focus-visible, .ds-button.primary.black:focus-within {
96
+ .ds-button.primary.black:focus-visible {
97
97
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
98
98
  outline-color: var(--ds-borderColor-black);
99
99
  outline-offset: var(--ds-borderWidth-thin);
@@ -116,7 +116,7 @@
116
116
  border-color: transparent;
117
117
  color: var(--ds-textColor-default);
118
118
  }
119
- .ds-button.primary.white:focus-visible, .ds-button.primary.white:focus-within {
119
+ .ds-button.primary.white:focus-visible {
120
120
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-black);
121
121
  outline-color: var(--ds-borderColor-white);
122
122
  outline-offset: var(--ds-borderWidth-thin);
@@ -139,7 +139,7 @@
139
139
  border-color: var(--ds-borderColor-primary);
140
140
  color: var(--ds-textColor-primary);
141
141
  }
142
- .ds-button.secondary.blue:focus-visible, .ds-button.secondary.blue:focus-within {
142
+ .ds-button.secondary.blue:focus-visible {
143
143
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
144
144
  outline-color: var(--ds-borderColor-black);
145
145
  outline-offset: var(--ds-borderWidth-thin);
@@ -162,7 +162,7 @@
162
162
  border-color: var(--ds-borderColor-black);
163
163
  color: var(--ds-textColor-default);
164
164
  }
165
- .ds-button.secondary.black:focus-visible, .ds-button.secondary.black:focus-within {
165
+ .ds-button.secondary.black:focus-visible {
166
166
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
167
167
  outline-color: var(--ds-borderColor-black);
168
168
  outline-offset: var(--ds-borderWidth-thin);
@@ -185,7 +185,7 @@
185
185
  border-color: var(--ds-borderColor-white);
186
186
  color: var(--ds-textColor-white);
187
187
  }
188
- .ds-button.secondary.white:focus-visible, .ds-button.secondary.white:focus-within {
188
+ .ds-button.secondary.white:focus-visible {
189
189
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-black);
190
190
  outline-color: var(--ds-borderColor-white);
191
191
  outline-offset: var(--ds-borderWidth-thin);
@@ -208,7 +208,7 @@
208
208
  border-color: transparent;
209
209
  color: var(--ds-textColor-primary);
210
210
  }
211
- .ds-button.supplementary.blue:focus-visible, .ds-button.supplementary.blue:focus-within {
211
+ .ds-button.supplementary.blue:focus-visible {
212
212
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
213
213
  outline-color: var(--ds-borderColor-black);
214
214
  outline-offset: var(--ds-borderWidth-thin);
@@ -239,7 +239,7 @@
239
239
  border-color: transparent;
240
240
  color: var(--ds-textColor-default);
241
241
  }
242
- .ds-button.supplementary.black:focus-visible, .ds-button.supplementary.black:focus-within {
242
+ .ds-button.supplementary.black:focus-visible {
243
243
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
244
244
  outline-color: var(--ds-borderColor-black);
245
245
  outline-offset: var(--ds-borderWidth-thin);
@@ -270,7 +270,7 @@
270
270
  border-color: transparent;
271
271
  color: var(--ds-textColor-white);
272
272
  }
273
- .ds-button.supplementary.white:focus-visible, .ds-button.supplementary.white:focus-within {
273
+ .ds-button.supplementary.white:focus-visible {
274
274
  box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-black);
275
275
  outline-color: var(--ds-borderColor-white);
276
276
  outline-offset: var(--ds-borderWidth-thin);
@@ -1,6 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import classNames from "classnames";
3
- import { inheritAriaAttributes, inheritAttributes } from "../../../utils/attributes";
3
+ import { inheritAriaAttributes, inheritAttributes } from "../../../utils/attributes/attributes";
4
4
  export class DsButton {
5
5
  inheritedAttributes = {};
6
6
  buttonEl;
@@ -65,7 +65,7 @@ export class DsButton {
65
65
  });
66
66
  const iconSize = this.size === 'small' ? '1rem' : undefined;
67
67
  const isDisabled = this.disabled || this.ariaDisabled === 'true';
68
- return (h("button", { key: '57b49111cb6e4957d1cd69cdfd09b99fe620b614', ref: el => (this.buttonEl = el), onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, class: classes, style: { fontWeight: this.fontWeight }, type: this.type, "aria-disabled": isDisabled ? 'true' : 'false', ...this.inheritedAttributes }, h("slot", { key: '56532d67c5a1df5e831025422db0c886bd731db0', name: "prefix" }, this.icon && this.iconPosition === 'start' && h("ds-icon", { key: '6028ee6b589400340f21411b252c7ba85732fa1c', name: this.icon, size: iconSize })), this.value && h("span", { key: '8b98003443f13f88f76b9a9a611eb1abc4daee74', class: "button-value" }, this.value), h("slot", { key: '35ad0a3aa154b8afba9bd50ffe30c1e25a37f382', name: "suffix" }, this.icon && this.iconPosition === 'end' && h("ds-icon", { key: '7eebd8b5754c0dd1d3d6a435234728518a16a405', name: this.icon, size: iconSize }))));
68
+ return (h("button", { key: '493f90c0fb16bd412af413f08ee5a1d2cdb178eb', ref: el => (this.buttonEl = el), onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, class: classes, style: { fontWeight: this.fontWeight }, type: this.type, "aria-disabled": isDisabled ? 'true' : 'false', ...this.inheritedAttributes }, h("slot", { key: '949f90e3355f81064e60d792ea7ecb2340001dc8', name: "prefix" }, this.icon && this.iconPosition === 'start' && h("ds-icon", { key: 'ac90509ba952a69c58749f4e41f6df5390a0709a', name: this.icon, size: iconSize })), this.value && h("span", { key: '8b3ac1d3fbcf5e22cde0dc6edd189dc697446d06', class: "button-value" }, this.value), h("slot", { key: '7b3ca23198eecb75454b2d46b6db504d456223a6', name: "suffix" }, this.icon && this.iconPosition === 'end' && h("ds-icon", { key: '3ddeb9b6c4678fb239ddfc34fda24f3c35b9905e', name: this.icon, size: iconSize }))));
69
69
  }
70
70
  static get is() { return "ds-button"; }
71
71
  static get encapsulation() { return "scoped"; }