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

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 +2 -2
  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-b1d61146.js} +116 -2
  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 +3 -0
  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 +315 -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 -1
  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 +11 -3
  48. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +1 -1
  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} +1 -3
  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-aaccd233.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 +104 -4
  93. package/dist/components/index3.js +80 -0
  94. package/dist/components/linkUtils.js +10 -1
  95. package/dist/esm/component-library.js +3 -3
  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-aaccd233.js} +116 -3
  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 +3 -2
  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
@@ -0,0 +1,56 @@
1
+ import { EventEmitter } from '../../../stencil-public-runtime';
2
+ import { CheckboxChangeEvent } from '../ds-checkbox/ds-checkbox';
3
+ export interface CheckboxGroupChangeEvent {
4
+ id: string;
5
+ checked: boolean;
6
+ }
7
+ export interface CheckboxGroupIndeterminateChildChangeEvent {
8
+ id: string;
9
+ indeterminate: boolean;
10
+ }
11
+ export declare class DsCheckboxGroup {
12
+ private readonly fieldsetId;
13
+ private readonly checkboxId;
14
+ private readonly errorTextId;
15
+ private readonly assistiveTextId;
16
+ private readonly nestedId;
17
+ private inheritedAttributes;
18
+ el: HTMLElement;
19
+ dsCheckboxGroupChange: EventEmitter<CheckboxGroupChangeEvent>;
20
+ dsCheckboxGroupIndeterminateChildChange: EventEmitter<CheckboxGroupIndeterminateChildChangeEvent>;
21
+ legend?: string;
22
+ assistiveText?: string;
23
+ direction: 'horizontal' | 'vertical';
24
+ errorText: string;
25
+ text: string;
26
+ checked: boolean;
27
+ checkedChildElementCount: number;
28
+ disabled: boolean;
29
+ parentCheckedCount: number;
30
+ childElementsCount: number;
31
+ isIndeterminate: boolean;
32
+ indeterminateChildCheckboxCount: number;
33
+ private elementIs;
34
+ private elementIsCheckbox;
35
+ private elementIsCheckboxGroup;
36
+ private getAriaDescribedBy;
37
+ private getChildElements;
38
+ private getChildCheckboxElements;
39
+ private updateChildElements;
40
+ private updateChildCheckboxes;
41
+ private updateChildElementsChecked;
42
+ setChecked(newValue: boolean): Promise<void>;
43
+ handleCheckboxDisabledChange(newValue: boolean): void;
44
+ handleCheckedChange(newValue: boolean): void;
45
+ handleIndeterminateChange(newValue: boolean): void;
46
+ handleIndeterminateChildChange(event: CustomEvent<CheckboxGroupIndeterminateChildChangeEvent>): void;
47
+ handleCheckedChildElementCountChange(newValue: number, oldValue: number): void;
48
+ private updateCheckedChildElementCount;
49
+ handleCheckboxChange(event: CustomEvent<CheckboxChangeEvent>): void;
50
+ handleCheckboxGroupChange(event: CustomEvent<CheckboxGroupChangeEvent>): void;
51
+ private setChildElementCount;
52
+ componentWillLoad(): void;
53
+ componentDidLoad(): void;
54
+ componentDidUpdate(): void;
55
+ render(): any;
56
+ }
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/web-components';
2
+ import { DsCheckboxGroup } from '../ds-checkbox-group';
3
+ declare const meta: Meta<typeof DsCheckboxGroup.prototype>;
4
+ export default meta;
5
+ type Story = StoryObj;
6
+ export declare const Vertical: Story;
7
+ export declare const VerticalInvalid: Story;
8
+ export declare const Horizontal: Story;
9
+ export declare const HorizontalInvalid: Story;
10
+ export declare const Nested: Story;
11
+ export declare const DeeplyNested: Story;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/web-components';
2
+ import { DsCheckboxGroup } from '../ds-checkbox-group';
3
+ declare const meta: Meta<typeof DsCheckboxGroup.prototype>;
4
+ export default meta;
5
+ type Story = StoryObj;
6
+ export declare const Default: Story;
7
+ export declare const Playground: Story;
@@ -1,6 +1,7 @@
1
1
  import { Meta, StoryObj } from '@storybook/web-components';
2
- import { DsIcon } from './ds-icon';
2
+ import { DsIcon } from '../ds-icon';
3
3
  declare const meta: Meta<typeof DsIcon.prototype>;
4
4
  export default meta;
5
5
  type Story = StoryObj;
6
6
  export declare const Default: Story;
7
+ export declare const Playground: Story;
@@ -0,0 +1,12 @@
1
+ type InputValidityType = 'error' | 'success';
2
+ type InputValidityRole = 'alert' | 'status';
3
+ export declare class DsInputValidity {
4
+ el: HTMLElement;
5
+ text: string;
6
+ type: InputValidityType;
7
+ role?: InputValidityRole;
8
+ identifier?: string;
9
+ componentDidLoad(): void;
10
+ render(): any;
11
+ }
12
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/web-components';
2
+ import { DsInputValidity } from '../ds-input-validity';
3
+ declare const meta: Meta<typeof DsInputValidity.prototype>;
4
+ export default meta;
5
+ type Story = StoryObj;
6
+ export declare const Error: Story;
7
+ export declare const Success: Story;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/web-components';
2
+ import { DsInputValidity } from '../ds-input-validity';
3
+ declare const meta: Meta<typeof DsInputValidity.prototype>;
4
+ export default meta;
5
+ type Story = StoryObj;
6
+ export declare const Default: Story;
7
+ export declare const Playground: Story;
@@ -9,16 +9,19 @@ export declare class DsLink {
9
9
  private rel?;
10
10
  private readonly visuallyHiddenAssistiveTextId;
11
11
  el: HTMLElement;
12
- text?: string;
12
+ text: string;
13
13
  size?: LinkSize;
14
14
  variant: LinkVariant;
15
15
  weight: LinkWeight;
16
16
  icon: string;
17
17
  iconPosition: LinkIconPosition;
18
+ iconTitle?: string;
19
+ iconHidden?: boolean;
18
20
  href: string;
19
21
  target?: LinkTarget;
20
22
  download?: boolean;
21
23
  language?: LinkLang;
24
+ ariaLabel?: string;
22
25
  componentWillLoad(): void;
23
26
  render(): any;
24
27
  }
@@ -12,6 +12,7 @@ export declare class DsLinkWithArrow {
12
12
  href: string;
13
13
  target?: LinkTarget;
14
14
  language?: LinkLang;
15
+ ariaLabel?: string;
15
16
  componentWillLoad(): void;
16
17
  render(): any;
17
18
  }
@@ -6,6 +6,9 @@ export declare class DsTextInput {
6
6
  private readonly visuallyHiddenAssistiveTextId;
7
7
  private readonly successTextId;
8
8
  private readonly errorTextId;
9
+ private hasPrefixSlot;
10
+ private hasSuffixSlot;
11
+ el: HTMLElement;
9
12
  label?: string;
10
13
  placeholder?: string;
11
14
  dsId?: string;
@@ -39,6 +42,8 @@ export declare class DsTextInput {
39
42
  inputActive: boolean;
40
43
  togglePasswordVisibility(): Promise<boolean>;
41
44
  clearInput(): Promise<void>;
45
+ private getLabelText;
46
+ componentWillLoad(): void;
42
47
  private onActionButtonClicked;
43
48
  private renderValidityMessage;
44
49
  private renderPrefixContent;
@@ -1,3 +1,2 @@
1
1
  export declare const textInputTypes: readonly ["text", "password", "search", "loading", "tel", "email", "url", "number"];
2
2
  export type TextInputType = typeof textInputTypes[number];
3
- export declare function idGenerator(id: string): Generator<string, void, unknown>;
@@ -5,7 +5,11 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { CheckboxChangeEvent } from "./components/01-base-components/ds-checkbox/ds-checkbox";
9
+ import { CheckboxGroupChangeEvent, CheckboxGroupIndeterminateChildChangeEvent } from "./components/01-base-components/ds-checkbox-group/ds-checkbox-group";
8
10
  import { TextInputType } from "./components/01-base-components/ds-text-input/utils";
11
+ export { CheckboxChangeEvent } from "./components/01-base-components/ds-checkbox/ds-checkbox";
12
+ export { CheckboxGroupChangeEvent, CheckboxGroupIndeterminateChildChangeEvent } from "./components/01-base-components/ds-checkbox-group/ds-checkbox-group";
9
13
  export { TextInputType } from "./components/01-base-components/ds-text-input/utils";
10
14
  export namespace Components {
11
15
  interface DsAccordion {
@@ -37,6 +41,36 @@ export namespace Components {
37
41
  "value": string;
38
42
  "variant": 'primary' | 'secondary' | 'supplementary';
39
43
  }
44
+ interface DsCheckbox {
45
+ "assistiveText"?: string;
46
+ "checkboxId"?: string;
47
+ "checked": boolean;
48
+ "disabled": boolean;
49
+ "errorText": string;
50
+ "errorsDisabled": boolean;
51
+ "indeterminate": boolean;
52
+ "legend"?: string;
53
+ "optional": boolean;
54
+ "optionalText"?: string;
55
+ "required": boolean;
56
+ "text"?: string;
57
+ }
58
+ interface DsCheckboxGroup {
59
+ "assistiveText"?: string;
60
+ "checked": boolean;
61
+ "checkedChildElementCount": number;
62
+ "direction": 'horizontal' | 'vertical';
63
+ "disabled": boolean;
64
+ "errorText": string;
65
+ "legend"?: string;
66
+ "parentCheckedCount": number;
67
+ /**
68
+ * Updates child elements' checked state.
69
+ * @param newValue New checked state.
70
+ */
71
+ "setChecked": (newValue: boolean) => Promise<void>;
72
+ "text": string;
73
+ }
40
74
  interface DsIcon {
41
75
  "colour": string;
42
76
  "dsTitle": string;
@@ -45,19 +79,28 @@ export namespace Components {
45
79
  "role": string;
46
80
  "size": string;
47
81
  }
82
+ interface DsInputValidity {
83
+ "role"?: InputValidityRole;
84
+ "text": string;
85
+ "type": InputValidityType;
86
+ }
48
87
  interface DsLink {
88
+ "ariaLabel"?: string;
49
89
  "download"?: boolean;
50
90
  "href": string;
51
91
  "icon": string;
92
+ "iconHidden"?: boolean;
52
93
  "iconPosition": LinkIconPosition;
94
+ "iconTitle"?: string;
53
95
  "language"?: LinkLang;
54
96
  "size"?: LinkSize;
55
97
  "target"?: LinkTarget;
56
- "text"?: string;
98
+ "text": string;
57
99
  "variant": LinkVariant;
58
100
  "weight": LinkWeight;
59
101
  }
60
102
  interface DsLinkWithArrow {
103
+ "ariaLabel"?: string;
61
104
  "href": string;
62
105
  "iconPosition": LinkIconPosition;
63
106
  "language"?: LinkLang;
@@ -98,6 +141,14 @@ export namespace Components {
98
141
  interface DsVisuallyHidden {
99
142
  }
100
143
  }
144
+ export interface DsCheckboxCustomEvent<T> extends CustomEvent<T> {
145
+ detail: T;
146
+ target: HTMLDsCheckboxElement;
147
+ }
148
+ export interface DsCheckboxGroupCustomEvent<T> extends CustomEvent<T> {
149
+ detail: T;
150
+ target: HTMLDsCheckboxGroupElement;
151
+ }
101
152
  declare global {
102
153
  interface HTMLDsAccordionElement extends Components.DsAccordion, HTMLStencilElement {
103
154
  }
@@ -111,12 +162,54 @@ declare global {
111
162
  prototype: HTMLDsButtonElement;
112
163
  new (): HTMLDsButtonElement;
113
164
  };
165
+ interface HTMLDsCheckboxElementEventMap {
166
+ "dsCheckboxChange": CheckboxChangeEvent;
167
+ "dsCheckboxError": string;
168
+ }
169
+ interface HTMLDsCheckboxElement extends Components.DsCheckbox, HTMLStencilElement {
170
+ addEventListener<K extends keyof HTMLDsCheckboxElementEventMap>(type: K, listener: (this: HTMLDsCheckboxElement, ev: DsCheckboxCustomEvent<HTMLDsCheckboxElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
171
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
172
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
173
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
174
+ removeEventListener<K extends keyof HTMLDsCheckboxElementEventMap>(type: K, listener: (this: HTMLDsCheckboxElement, ev: DsCheckboxCustomEvent<HTMLDsCheckboxElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
175
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
176
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
177
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
178
+ }
179
+ var HTMLDsCheckboxElement: {
180
+ prototype: HTMLDsCheckboxElement;
181
+ new (): HTMLDsCheckboxElement;
182
+ };
183
+ interface HTMLDsCheckboxGroupElementEventMap {
184
+ "dsCheckboxGroupChange": CheckboxGroupChangeEvent;
185
+ "dsCheckboxGroupIndeterminateChildChange": CheckboxGroupIndeterminateChildChangeEvent;
186
+ }
187
+ interface HTMLDsCheckboxGroupElement extends Components.DsCheckboxGroup, HTMLStencilElement {
188
+ addEventListener<K extends keyof HTMLDsCheckboxGroupElementEventMap>(type: K, listener: (this: HTMLDsCheckboxGroupElement, ev: DsCheckboxGroupCustomEvent<HTMLDsCheckboxGroupElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
189
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
190
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
191
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
192
+ removeEventListener<K extends keyof HTMLDsCheckboxGroupElementEventMap>(type: K, listener: (this: HTMLDsCheckboxGroupElement, ev: DsCheckboxGroupCustomEvent<HTMLDsCheckboxGroupElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
193
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
194
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
195
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
196
+ }
197
+ var HTMLDsCheckboxGroupElement: {
198
+ prototype: HTMLDsCheckboxGroupElement;
199
+ new (): HTMLDsCheckboxGroupElement;
200
+ };
114
201
  interface HTMLDsIconElement extends Components.DsIcon, HTMLStencilElement {
115
202
  }
116
203
  var HTMLDsIconElement: {
117
204
  prototype: HTMLDsIconElement;
118
205
  new (): HTMLDsIconElement;
119
206
  };
207
+ interface HTMLDsInputValidityElement extends Components.DsInputValidity, HTMLStencilElement {
208
+ }
209
+ var HTMLDsInputValidityElement: {
210
+ prototype: HTMLDsInputValidityElement;
211
+ new (): HTMLDsInputValidityElement;
212
+ };
120
213
  interface HTMLDsLinkElement extends Components.DsLink, HTMLStencilElement {
121
214
  }
122
215
  var HTMLDsLinkElement: {
@@ -144,7 +237,10 @@ declare global {
144
237
  interface HTMLElementTagNameMap {
145
238
  "ds-accordion": HTMLDsAccordionElement;
146
239
  "ds-button": HTMLDsButtonElement;
240
+ "ds-checkbox": HTMLDsCheckboxElement;
241
+ "ds-checkbox-group": HTMLDsCheckboxGroupElement;
147
242
  "ds-icon": HTMLDsIconElement;
243
+ "ds-input-validity": HTMLDsInputValidityElement;
148
244
  "ds-link": HTMLDsLinkElement;
149
245
  "ds-link-with-arrow": HTMLDsLinkWithArrowElement;
150
246
  "ds-text-input": HTMLDsTextInputElement;
@@ -181,6 +277,35 @@ declare namespace LocalJSX {
181
277
  "value"?: string;
182
278
  "variant"?: 'primary' | 'secondary' | 'supplementary';
183
279
  }
280
+ interface DsCheckbox {
281
+ "assistiveText"?: string;
282
+ "checkboxId"?: string;
283
+ "checked"?: boolean;
284
+ "disabled"?: boolean;
285
+ "errorText"?: string;
286
+ "errorsDisabled"?: boolean;
287
+ "indeterminate"?: boolean;
288
+ "legend"?: string;
289
+ "onDsCheckboxChange"?: (event: DsCheckboxCustomEvent<CheckboxChangeEvent>) => void;
290
+ "onDsCheckboxError"?: (event: DsCheckboxCustomEvent<string>) => void;
291
+ "optional"?: boolean;
292
+ "optionalText"?: string;
293
+ "required"?: boolean;
294
+ "text"?: string;
295
+ }
296
+ interface DsCheckboxGroup {
297
+ "assistiveText"?: string;
298
+ "checked"?: boolean;
299
+ "checkedChildElementCount"?: number;
300
+ "direction"?: 'horizontal' | 'vertical';
301
+ "disabled"?: boolean;
302
+ "errorText"?: string;
303
+ "legend"?: string;
304
+ "onDsCheckboxGroupChange"?: (event: DsCheckboxGroupCustomEvent<CheckboxGroupChangeEvent>) => void;
305
+ "onDsCheckboxGroupIndeterminateChildChange"?: (event: DsCheckboxGroupCustomEvent<CheckboxGroupIndeterminateChildChangeEvent>) => void;
306
+ "parentCheckedCount"?: number;
307
+ "text"?: string;
308
+ }
184
309
  interface DsIcon {
185
310
  "colour"?: string;
186
311
  "dsTitle"?: string;
@@ -189,19 +314,28 @@ declare namespace LocalJSX {
189
314
  "role"?: string;
190
315
  "size"?: string;
191
316
  }
317
+ interface DsInputValidity {
318
+ "role"?: InputValidityRole;
319
+ "text"?: string;
320
+ "type"?: InputValidityType;
321
+ }
192
322
  interface DsLink {
323
+ "ariaLabel"?: string;
193
324
  "download"?: boolean;
194
325
  "href": string;
195
326
  "icon"?: string;
327
+ "iconHidden"?: boolean;
196
328
  "iconPosition"?: LinkIconPosition;
329
+ "iconTitle"?: string;
197
330
  "language"?: LinkLang;
198
331
  "size"?: LinkSize;
199
332
  "target"?: LinkTarget;
200
- "text"?: string;
333
+ "text": string;
201
334
  "variant"?: LinkVariant;
202
335
  "weight"?: LinkWeight;
203
336
  }
204
337
  interface DsLinkWithArrow {
338
+ "ariaLabel"?: string;
205
339
  "href": string;
206
340
  "iconPosition"?: LinkIconPosition;
207
341
  "language"?: LinkLang;
@@ -242,7 +376,10 @@ declare namespace LocalJSX {
242
376
  interface IntrinsicElements {
243
377
  "ds-accordion": DsAccordion;
244
378
  "ds-button": DsButton;
379
+ "ds-checkbox": DsCheckbox;
380
+ "ds-checkbox-group": DsCheckboxGroup;
245
381
  "ds-icon": DsIcon;
382
+ "ds-input-validity": DsInputValidity;
246
383
  "ds-link": DsLink;
247
384
  "ds-link-with-arrow": DsLinkWithArrow;
248
385
  "ds-text-input": DsTextInput;
@@ -255,7 +392,10 @@ declare module "@stencil/core" {
255
392
  interface IntrinsicElements {
256
393
  "ds-accordion": LocalJSX.DsAccordion & JSXBase.HTMLAttributes<HTMLDsAccordionElement>;
257
394
  "ds-button": LocalJSX.DsButton & JSXBase.HTMLAttributes<HTMLDsButtonElement>;
395
+ "ds-checkbox": LocalJSX.DsCheckbox & JSXBase.HTMLAttributes<HTMLDsCheckboxElement>;
396
+ "ds-checkbox-group": LocalJSX.DsCheckboxGroup & JSXBase.HTMLAttributes<HTMLDsCheckboxGroupElement>;
258
397
  "ds-icon": LocalJSX.DsIcon & JSXBase.HTMLAttributes<HTMLDsIconElement>;
398
+ "ds-input-validity": LocalJSX.DsInputValidity & JSXBase.HTMLAttributes<HTMLDsInputValidityElement>;
259
399
  "ds-link": LocalJSX.DsLink & JSXBase.HTMLAttributes<HTMLDsLinkElement>;
260
400
  "ds-link-with-arrow": LocalJSX.DsLinkWithArrow & JSXBase.HTMLAttributes<HTMLDsLinkWithArrowElement>;
261
401
  "ds-text-input": LocalJSX.DsTextInput & JSXBase.HTMLAttributes<HTMLDsTextInputElement>;
@@ -0,0 +1,2 @@
1
+ export declare const getOptionalText: (text: string, optionalText?: string) => string;
2
+ export declare const getRequiredText: (text: string) => string;
@@ -1,2 +1,3 @@
1
1
  export declare const opensInNewTab: (target: string) => target is "_blank";
2
2
  export declare const visuallyHiddenAssistiveText: (lang: string) => "Avautuu uuteen välilehteen" | "Öppnas i en ny flik" | "Opens in a new tab";
3
+ export declare const getAriaLabel: (text: string, ariaLabel?: string) => string;
@@ -15,3 +15,8 @@ export declare const createCategorySection: (category: string, fonts: {
15
15
  value: string;
16
16
  }[], renderedCategories: Set<string>) => HTMLDivElement;
17
17
  export declare const getCSSClasses: (prefix: string) => string[];
18
+ export declare const headingSizes: readonly ["2xLarge", "xLarge", "large", "medium", "small", "xSmall"];
19
+ export type HeadingSize = typeof headingSizes[number];
20
+ export declare const getHeadingVariables: (size: HeadingSize, isDesktop: boolean) => {
21
+ [key: string]: string;
22
+ };
@@ -1,7 +1,14 @@
1
- export declare function generateLoremIpsum({ paragraphs, wordsPerParagraph, startWithLorem, consistent }?: {
1
+ import { TemplateResult } from "lit";
2
+ export declare const generateLoremIpsum: ({ paragraphs, wordsPerParagraph, startWithLorem, consistent }?: {
2
3
  paragraphs?: number;
3
4
  wordsPerParagraph?: number;
4
5
  startWithLorem?: boolean;
5
6
  consistent?: boolean;
6
- }): string;
7
- export declare function remToPx(remString: any): string;
7
+ }) => string;
8
+ export declare const formatAs: (value: string, suffix: string) => string;
9
+ export declare const formatAsRem: (value: string) => string;
10
+ export declare const formatAsPx: (value: string) => string;
11
+ export declare const remToPx: (remString: string) => string;
12
+ export declare const pxToRem: (pxString: string) => string;
13
+ export declare const litTemplateResultToString: (data: TemplateResult) => string;
14
+ export declare function idGenerator(id: string): Generator<string, void, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uh-design-system/component-library",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -44,6 +44,7 @@
44
44
  "start": "stencil build --dev --watch --serve",
45
45
  "test-storybook": "test-storybook",
46
46
  "test-storybook:update": "rm -rf __snapshots__ && test-storybook -u",
47
+ "test:unit": "stencil test --spec",
47
48
  "test": "stencil test --spec --e2e",
48
49
  "test.watch": "stencil test --spec --e2e --watchAll",
49
50
  "generate": "stencil generate",
@@ -93,5 +94,5 @@
93
94
  "glob": "^9.0.0"
94
95
  },
95
96
  "license": "MIT",
96
- "gitHead": "66cf27f598c9c38e05082f53e4f2e24f2dc909e3"
97
+ "gitHead": "3448fb142a11125d2188e392caaffe38d4ed3a75"
97
98
  }
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- function* idGenerator(id) {
4
- let currentId = 1;
5
- while (true) {
6
- yield `${id}-${currentId++}`;
7
- }
8
- }
9
-
10
- exports.idGenerator = idGenerator;
@@ -1,68 +0,0 @@
1
- import "./_typography.scss";
2
- import { getTypographyVariables, createCategorySection, categories } from "../../../utils/typography/typographyUtils";
3
- import { html } from "lit";
4
- const meta = {
5
- title: 'Foundations/Typography',
6
- };
7
- export default meta;
8
- export const Headings = {
9
- argTypes: {
10
- text: {
11
- name: 'Text',
12
- control: 'text',
13
- },
14
- },
15
- args: {
16
- text: 'This is a heading',
17
- },
18
- render: (args) => html `
19
- <h1>${args.text}</h1>
20
- <h2>${args.text}</h2>
21
- <h3>${args.text}</h3>
22
- <h4>${args.text}</h4>
23
- <h5>${args.text}</h5>
24
- <h6>${args.text}</h6>
25
- `,
26
- };
27
- export const Text = {
28
- argTypes: {
29
- text: {
30
- name: 'Text',
31
- control: 'text',
32
- },
33
- },
34
- args: {
35
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis nulla vehicula, commodo massa sit amet, commodo felis. Fusce et consectetur felis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer elit egestas luctus.',
36
- },
37
- render: (args) => html `
38
- <p class="bodyText bodyText--2xLarge">${args.text}</p>
39
- <p class="bodyText bodyText--xLarge">${args.text}</p>
40
- <p class="bodyText bodyText--large">${args.text}</p>
41
- <p class="bodyText bodyText--medium">${args.text}</p>
42
- <p class="bodyText bodyText--small">${args.text}</p>
43
- <p class="bodyText bodyText--xSmall">${args.text}</p>
44
- `,
45
- };
46
- const renderTypography = () => {
47
- const container = document.createElement('div');
48
- const typographyVariables = getTypographyVariables();
49
- const renderedCategories = new Set();
50
- const categoryNames = [...new Set(Object.values(categories)), 'Other'];
51
- categoryNames.forEach(category => {
52
- const categoryTypo = typographyVariables.filter(spacing => spacing.category === category);
53
- if (categoryTypo.length > 0) {
54
- container.appendChild(createCategorySection(category, categoryTypo, renderedCategories));
55
- }
56
- });
57
- return container;
58
- };
59
- export const Typography = {
60
- parameters: {
61
- docs: {
62
- source: {
63
- code: renderTypography().outerHTML,
64
- },
65
- },
66
- },
67
- render: renderTypography,
68
- };
@@ -1,2 +0,0 @@
1
- var t=Object.defineProperty,e=(t,e)=>{var n;Object.entries(null!=(n=e.o.t)?n:{}).map((([n,[o]])=>{if(31&o||32&o){const o=t[n],l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),n);Object.defineProperty(t,n,{get(){return l.get.call(this)},set(t){l.set.call(this,t)},configurable:!0,enumerable:!0}),t[n]=e.l.has(n)?e.l.get(n):o}}))},n=new WeakMap,o=t=>n.get(t),l=(t,o)=>{n.set(o.i=t,o),e(t,o)},s=(t,e)=>e in t,i=(t,e)=>(0,console.error)(t,e),r=new Map,c=new Map,u="slot-fb{display:contents}slot-fb[hidden]{display:none}",f="http://www.w3.org/1999/xlink",a="undefined"!=typeof window?window:{},d=a.document||{head:{}},h={u:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},v=t=>Promise.resolve(t),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),m=!1,y=[],$=[],b=(t,e)=>n=>{t.push(n),m||(m=!0,e&&4&h.u?S(g):h.raf(g))},w=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){i(t)}t.length=0},g=()=>{w(y),w($),(m=y.length>0)&&h.raf(g)},S=t=>v().then(t),j=b($,!0),O=t=>"object"==(t=typeof t)||"function"===t;function k(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{err:()=>C,map:()=>x,ok:()=>E,unwrap:()=>M,unwrapErr:()=>T});var E=t=>({isOk:!0,isErr:!1,value:t}),C=t=>({isOk:!1,isErr:!0,value:t});function x(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>E(t))):E(n)}if(t.isErr)return C(t.value);throw"should never get here"}var M=t=>{if(t.isOk)return t.value;throw t.value},T=t=>{if(t.isErr)return t.value;throw t.value},P=t=>{const e=t.__childNodes||t.childNodes;t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&F(e,t.tagName).forEach((t=>{var e;1===t.nodeType&&"SLOT-FB"===t.tagName&&(t.hidden=!!(null==(e=N(t,t["s-sn"],!1))?void 0:e.length))}));for(const t of e)1===t.nodeType&&(t.__childNodes||t.childNodes).length&&P(t)};function F(t,e,n){let o,l=0,s=[];for(;l<t.length;l++){if(o=t[l],o["s-sr"]&&o["s-hn"]===e&&(void 0===n||o["s-sn"]===n)&&(s.push(o),void 0!==n))return s;s=[...s,...F(o.childNodes,e,n)]}return s}var R,L,A,N=(t,e,n=!0)=>{const o=[];for((n&&t["s-sr"]||!t["s-sr"])&&o.push(t);(t=t.nextSibling)&&t["s-sn"]===e;)o.push(t);return o},B=(t,e)=>1===t.nodeType?null===t.getAttribute("slot")&&""===e||t.getAttribute("slot")===e:t["s-sn"]===e||""===e,H=(t,e,...n)=>{let o=null,l=null,s=null,i=!1,r=!1;const c=[],u=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?u(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!O(o))&&(o+=""),i&&r?c[c.length-1].v+=o:c.push(i?U(null,o):o),r=i)};if(u(n),e){e.key&&(l=e.key),e.name&&(s=e.name);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,c,D);const f=U(t,null);return f.p=e,c.length>0&&(f.m=c),f.$=l,f.S=s,f},U=(t,e)=>({u:0,j:t,v:e,O:null,m:null,p:null,$:null,S:null}),W={},D={forEach:(t,e)=>t.map(V).forEach(e),map:(t,e)=>t.map(V).map(e).map(q)},V=t=>({vattrs:t.p,vchildren:t.m,vkey:t.$,vname:t.S,vtag:t.j,vtext:t.v}),q=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),H(t.vtag,e,...t.vchildren||[])}const e=U(t.vtag,t.vtext);return e.p=t.vattrs,e.m=t.vchildren,e.$=t.vkey,e.S=t.vname,e},G=(t,e)=>null==t||O(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t,_=t=>o(t).$hostElement$,z=new WeakMap,I=t=>"sc-"+t.k,J=(t,e,n,o,l,i)=>{if(n!==o){let r=s(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,l=Q(n);let s=Q(o);e.remove(...l.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)o&&null!=o[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in o)n&&o[e]===n[e]||(e.includes("-")?t.style.setProperty(e,o[e]):t.style[e]=o[e])}else if("key"===e);else if("ref"===e)o&&o(t);else if(r||"o"!==e[0]||"n"!==e[1]){const s=O(o);if((r||s&&null!==o)&&!l)try{if(t.tagName.includes("-"))t[e]!==o&&(t[e]=o);else{const l=null==o?"":o;"list"===e?r=!1:null!=n&&t[e]==l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}let u=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(e=c,u=!0),null==o||!1===o?!1===o&&""!==t.getAttribute(e)||(u?t.removeAttributeNS(f,e):t.removeAttribute(e)):(!r||4&i||l)&&!s&&(o=!0===o?"":o,u?t.setAttributeNS(f,e,o):t.setAttribute(e,o))}else if(e="-"===e[2]?e.slice(3):s(a,c)?c.slice(2):c[2]+e.slice(3),n||o){const l=e.endsWith(X);e=e.replace(Y,""),n&&h.rel(t,e,n,l),o&&h.ael(t,e,o,l)}}},K=/\s/,Q=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(K):[]),X="Capture",Y=RegExp(X+"$"),Z=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.p||{},s=e.p||{};for(const t of tt(Object.keys(l)))t in s||J(o,t,l[t],void 0,n,e.u);for(const t of tt(Object.keys(s)))J(o,t,l[t],s[t],n,e.u)};function tt(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var et=!1,nt=!1,ot=!1,lt=!1,st=(t,e,n)=>{var o;const l=e.m[n];let s,i,r,c=0;if(et||(ot=!0,"slot"===l.j&&(l.u|=l.m?2:1)),null!==l.v)s=l.O=d.createTextNode(l.v);else if(1&l.u)s=l.O=d.createTextNode("");else if(s=l.O=d.createElement(!et&&2&l.u?"slot-fb":l.j),Z(null,l,lt),null!=R&&void 0!==R&&s["s-si"]!==R&&s.classList.add(s["s-si"]=R),l.m)for(c=0;c<l.m.length;++c)i=st(t,l,c),i&&s.appendChild(i);return s["s-hn"]=A,3&l.u&&(s["s-sr"]=!0,s["s-cr"]=L,s["s-sn"]=l.S||"",s["s-rf"]=null==(o=l.p)?void 0:o.ref,r=t&&t.m&&t.m[n],r&&r.j===l.j&&t.O&&it(t.O,!1),mt(L,s,e.O,null==t?void 0:t.O)),s},it=(t,e)=>{h.u|=1;const n=Array.from(t.__childNodes||t.childNodes);for(let t=n.length-1;t>=0;t--){const o=n[t];o["s-hn"]!==A&&o["s-ol"]&&(pt(ft(o).parentNode,o,ft(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,ot=!0),e&&it(o,e)}h.u&=-2},rt=(t,e,n,o,l,s)=>{let i,r=t["s-cr"]&&t["s-cr"].parentNode||t;for(r.shadowRoot&&r.tagName===A&&(r=r.shadowRoot);l<=s;++l)o[l]&&(i=st(null,n,l),i&&(o[l].O=i,pt(r,i,ft(e))))},ct=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;vt(e),t&&(nt=!0,t["s-ol"]?t["s-ol"].remove():it(t,!0),t.remove())}}},ut=(t,e,n=!1)=>t.j===e.j&&("slot"===t.j?t.S===e.S:n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),ft=t=>t&&t["s-ol"]||t,at=(t,e,n=!1)=>{const o=e.O=t.O,l=t.m,s=e.m,i=e.v;let r;null===i?(("slot"!==e.j||et)&&Z(t,e,lt),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],h=e[a],v=o.length-1,p=o[0],m=o[v];for(;r<=a&&c<=v;)if(null==d)d=e[++r];else if(null==h)h=e[--a];else if(null==p)p=o[++c];else if(null==m)m=o[--v];else if(ut(d,p,l))at(d,p,l),d=e[++r],p=o[++c];else if(ut(h,m,l))at(h,m,l),h=e[--a],m=o[--v];else if(ut(d,m,l))"slot"!==d.j&&"slot"!==m.j||it(d.O.parentNode,!1),at(d,m,l),pt(t,d.O,h.O.nextSibling),d=e[++r],m=o[--v];else if(ut(h,p,l))"slot"!==d.j&&"slot"!==m.j||it(h.O.parentNode,!1),at(h,p,l),pt(t,h.O,d.O),h=e[--a],p=o[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].$&&e[f].$===p.$){u=f;break}u>=0?(i=e[u],i.j!==p.j?s=st(e&&e[c],n,u):(at(i,p,l),e[u]=void 0,s=i.O),p=o[++c]):(s=st(e&&e[c],n,c),p=o[++c]),s&&pt(ft(d.O).parentNode,s,ft(d.O))}r>a?rt(t,null==o[v+1]?null:o[v+1].O,n,o,c,v):c>v&&ct(e,r,a)})(o,l,e,s,n):null!==s?(null!==t.v&&(o.textContent=""),rt(o,null,e,s,0,s.length-1)):!n&&null!==l&&ct(l,0,l.length-1)):(r=o["s-cr"])?r.parentNode.textContent=i:t.v!==i&&(o.data=i)},dt=[],ht=t=>{let e,n,o;const l=t.__childNodes||t.childNodes;for(const t of l){if(t["s-sr"]&&(e=t["s-cr"])&&e.parentNode){n=e.parentNode.__childNodes||e.parentNode.childNodes;const l=t["s-sn"];for(o=n.length-1;o>=0;o--)if(e=n[o],!e["s-cn"]&&!e["s-nr"]&&e["s-hn"]!==t["s-hn"])if(B(e,l)){let n=dt.find((t=>t.C===e));nt=!0,e["s-sn"]=e["s-sn"]||l,n?(n.C["s-sh"]=t["s-hn"],n.M=t):(e["s-sh"]=t["s-hn"],dt.push({M:t,C:e})),e["s-sr"]&&dt.map((t=>{B(t.C,e["s-sn"])&&(n=dt.find((t=>t.C===e)),n&&!t.M&&(t.M=n.M))}))}else dt.some((t=>t.C===e))||dt.push({C:e})}1===t.nodeType&&ht(t)}},vt=t=>{t.p&&t.p.ref&&t.p.ref(null),t.m&&t.m.map(vt)},pt=(t,e,n)=>("string"==typeof e["s-sn"]&&e["s-sr"]&&e["s-cr"]&&mt(e["s-cr"],e,t,e.parentElement),null==t?void 0:t.insertBefore(e,n));function mt(t,e,n,o){var l,s;let i;if(t&&"string"==typeof e["s-sn"]&&e["s-sr"]&&t.parentNode&&t.parentNode["s-sc"]&&(i=e["s-si"]||t.parentNode["s-sc"])){const t=e["s-sn"],r=e["s-hn"];if(null==(l=n.classList)||l.add(i+"-s"),o&&(null==(s=o.classList)?void 0:s.contains(i+"-s"))){let e=(o.__childNodes||o.childNodes)[0],n=!1;for(;e;){if(e["s-sn"]!==t&&e["s-hn"]===r&&e["s-sr"]){n=!0;break}e=e.nextSibling}n||o.classList.remove(i+"-s")}}}var yt=(t,e)=>{if(e&&!t.T&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.T=()=>{e["s-p"].splice(n-1,1),o()})))}},$t=(t,e)=>{if(t.u|=16,!(4&t.u))return yt(t,t.P),j((()=>bt(t,e)));t.u|=512},bt=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return e&&(l=Et(o,"componentWillLoad",void 0,n)),wt(l,(()=>St(t,o,e)))},wt=(t,e)=>gt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),gt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,St=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n;const o=I(e),l=c.get(o);if(t=11===t.nodeType?t:d,l)if("string"==typeof l){let s,i=z.get(t=t.head||t);if(i||z.set(t,i=new Set),!i.has(o)){{s=document.querySelector(`[sty-id="${o}"]`)||d.createElement("style"),s.innerHTML=l;const i=null!=(n=h.F)?n:k(d);if(null!=i&&s.setAttribute("nonce",i),!(1&e.u))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(p){const e=new CSSStyleSheet;e.replaceSync(l),t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=l+e.innerHTML:t.prepend(s)}else t.append(s);1&e.u&&t.insertBefore(s,null)}4&e.u&&(s.innerHTML+=u),i&&i.add(o)}}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);(10&o&&2&o||128&o)&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);jt(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>Ot(t);0===e.length?n():(Promise.all(e).then(n),t.u|=4,e.length=0)}},jt=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{var o,l,s,i;const r=t.$hostElement$,c=t.o,u=t.R||U(null,null),f=(t=>t&&t.j===W)(e)?e:H(null,null,e);if(A=r.tagName,n&&f.p)for(const t of Object.keys(f.p))r.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(f.p[t]=r[t]);if(f.j=null,f.u|=4,t.R=f,f.O=u.O=r.shadowRoot||r,R=r["s-sc"],et=!(!(1&c.u)||128&c.u),L=r["s-cr"],nt=!1,at(u,f,n),h.u|=1,ot){ht(f.O);for(const t of dt){const e=t.C;if(!e["s-ol"]){const t=d.createTextNode("");t["s-nr"]=e,pt(e.parentNode,e["s-ol"]=t,e)}}for(const t of dt){const e=t.C,r=t.M;if(r){const t=r.parentNode;let n=r.nextSibling;{let s=null==(o=e["s-ol"])?void 0:o.previousSibling;for(;s;){let o=null!=(l=s["s-nr"])?l:null;if(o&&o["s-sn"]===e["s-sn"]&&t===(o.__parentNode||o.parentNode)){for(o=o.nextSibling;o===e||(null==o?void 0:o["s-sr"]);)o=null==o?void 0:o.nextSibling;if(!o||!o["s-nr"]){n=o;break}}s=s.previousSibling}}(!n&&t!==(e.__parentNode||e.parentNode)||(e.__nextSibling||e.nextSibling)!==n)&&e!==n&&(!e["s-hn"]&&e["s-ol"]&&(e["s-hn"]=e["s-ol"].parentNode.nodeName),pt(t,e,n),1===e.nodeType&&"SLOT-FB"!==e.tagName&&(e.hidden=null!=(s=e["s-ih"])&&s)),e&&"function"==typeof r["s-rf"]&&r["s-rf"](e)}else 1===e.nodeType&&(n&&(e["s-ih"]=null!=(i=e.hidden)&&i),e.hidden=!0)}}nt&&P(f.O),h.u&=-2,dt.length=0,L=void 0})(t,e,o)}catch(e){i(e,t.$hostElement$)}return null},Ot=t=>{const e=t.$hostElement$,n=t.P;64&t.u||(t.u|=64,Ct(e),t.L(e),n||kt()),t.A(e),t.T&&(t.T(),t.T=void 0),512&t.u&&S((()=>$t(t,!1))),t.u&=-517},kt=()=>{S((()=>(t=>{const e=h.ce("appload",{detail:{namespace:"component-library"}});return t.dispatchEvent(e),e})(a)))},Et=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){i(t,o)}},Ct=t=>t.classList.add("hydrated"),xt=(t,e,n,l)=>{const s=o(t);if(!s)throw Error(`Couldn't find host element for "${l.k}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const r=s.$hostElement$,c=s.l.get(e),u=s.u,f=s.i;if(n=G(n,l.t[e][0]),(!(8&u)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(s.l.set(e,n),f)){if(l.N&&128&u){const t=l.N[e];t&&t.map((t=>{try{f[t](n,c,e)}catch(t){i(t,r)}}))}2==(18&u)&&$t(s,!1)}},Mt=(t,e,n)=>{var l,s;const i=t.prototype;if(e.t||e.N||t.watchers){t.watchers&&!e.N&&(e.N=t.watchers);const r=Object.entries(null!=(l=e.t)?l:{});if(r.map((([t,[l]])=>{if(31&l||2&n&&32&l){const{get:s,set:r}=Object.getOwnPropertyDescriptor(i,t)||{};s&&(e.t[t][0]|=2048),r&&(e.t[t][0]|=4096),(1&n||!s)&&Object.defineProperty(i,t,{get(){{if(!(2048&e.t[t][0]))return((t,e)=>o(this).l.get(e))(0,t);const n=o(this),l=n?n.i:i;if(!l)return;return l[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(i,t,{set(s){const i=o(this);if(r){const n=32&l?this[t]:i.$hostElement$[t];return void 0===n&&i.l.get(t)?s=i.l.get(t):!i.l.get(t)&&n&&i.l.set(t,n),r.call(this,G(s,l)),void xt(this,t,s=32&l?this[t]:i.$hostElement$[t],e)}{if(!(1&n&&4096&e.t[t][0]))return xt(this,t,s,e),void(1&n&&!i.i&&i.B.then((()=>{4096&e.t[t][0]&&i.i[t]!==i.l.get(t)&&(i.i[t]=s)})));const o=()=>{const n=i.i[t];!i.l.get(t)&&n&&i.l.set(t,n),i.i[t]=G(s,l),xt(this,t,i.i[t],e)};i.i?o():i.B.then((()=>o()))}}})}else 1&n&&64&l&&Object.defineProperty(i,t,{value(...e){var n;const l=o(this);return null==(n=null==l?void 0:l.H)?void 0:n.then((()=>{var n;return null==(n=l.i)?void 0:n[t](...e)}))}})})),1&n){const n=new Map;i.attributeChangedCallback=function(t,l,s){h.jmp((()=>{var r;const c=n.get(t);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const n=o(this),i=null==n?void 0:n.u;if(i&&!(8&i)&&128&i&&s!==l){const o=n.i,i=null==(r=e.N)?void 0:r[t];null==i||i.forEach((e=>{null!=o[e]&&o[e].call(o,s,l,t)}))}return}}const u=Object.getOwnPropertyDescriptor(i,c);(s=(null!==s||"boolean"!=typeof this[c])&&s)===this[c]||u.get&&!u.set||(this[c]=s)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.N)?s:{}),...r.filter((([t,e])=>15&e[0])).map((([t,e])=>{const o=e[1]||t;return n.set(o,t),o}))]))}}return t},Tt=(t,e={})=>{var l;const s=[],f=e.exclude||[],v=a.customElements,m=d.head,y=m.querySelector("meta[charset]"),$=d.createElement("style"),b=[];let w,g=!0;Object.assign(h,e),h.h=new URL(e.resourcesUrl||"./",d.baseURI).href;let S=!1;if(t.map((t=>{t[1].map((e=>{var l;const u={u:e[0],k:e[1],t:e[2],U:e[3]};4&u.u&&(S=!0),u.t=e[2],u.N=null!=(l=e[4])?l:{};const a=u.k,m=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,e)=>{const o={u:0,$hostElement$:t,o:e,l:new Map};o.H=new Promise((t=>o.A=t)),o.B=new Promise((t=>o.L=t)),t["s-p"]=[],t["s-rc"]=[],n.set(t,o)})(t=this,u),1&u.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${u.k}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),w&&(clearTimeout(w),w=null),g?b.push(this):h.jmp((()=>(t=>{if(!(1&h.u)){const e=o(t),n=e.o,l=()=>{};if(1&e.u)(null==e?void 0:e.i)||(null==e?void 0:e.B)&&e.B.then((()=>{}));else{e.u|=1,12&n.u&&(t=>{const e=t["s-cr"]=d.createComment("");e["s-cn"]=!0,pt(t,e,t.firstChild)})(t);{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){yt(e,e.P=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.u)){if(e.u|=32,n.W){const l=((t,e)=>{const n=t.k.replace(/-/g,"_"),o=t.W;if(!o)return;const l=r.get(o);return l?l[n]:import(`./${o}.entry.js`).then((t=>(r.set(o,t),t[n])),(t=>{i(t,e.$hostElement$)}))
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(l&&"then"in l){const t=()=>{};o=await l,t()}else o=l;if(!o)throw Error(`Constructor for "${n.k}#${e.D}" was not found`);o.isProxied||(n.N=o.watchers,Mt(o,n,2),o.isProxied=!0);const s=()=>{};e.u|=8;try{new o(e)}catch(e){i(e,t)}e.u&=-9,e.u|=128,s()}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=I(n);if(!c.has(e)){const o=()=>{};((t,e,n)=>{let o=c.get(t);p&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,c.set(t,o)})(e,t,!!(1&n.u)),o()}}}const l=e.P,s=()=>$t(e,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()})(t,e,n)}l()}})(this)))}disconnectedCallback(){h.jmp((()=>(async t=>{if(!(1&h.u)){const e=o(t);(null==e?void 0:e.i)||(null==e?void 0:e.B)&&e.B.then((()=>{}))}z.has(t)&&z.delete(t),t.shadowRoot&&z.has(t.shadowRoot)&&z.delete(t.shadowRoot)})(this))),h.raf((()=>{var t;const e=o(this),n=b.findIndex((t=>t===this));n>-1&&b.splice(n,1),(null==(t=null==e?void 0:e.R)?void 0:t.O)instanceof Node&&!e.R.O.isConnected&&delete e.R.O}))}componentOnReady(){return o(this).B}};u.W=t[0],f.includes(a)||v.get(a)||(s.push(a),v.define(a,Mt(m,u,1)))}))})),s.length>0&&(S&&($.textContent+=u),$.textContent+=s.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",$.innerHTML.length)){$.setAttribute("data-styles","");const t=null!=(l=h.F)?l:k(d);null!=t&&$.setAttribute("nonce",t),m.insertBefore($,y?y.nextSibling:m.firstChild)}g=!1,b.length?b.map((t=>t.connectedCallback())):h.jmp((()=>w=setTimeout(kt,30)))},Pt=(t,e)=>e,Ft=t=>h.F=t;export{Pt as F,Tt as b,_ as g,H as h,v as p,l as r,Ft as s}
@@ -1 +0,0 @@
1
- function*e(e){let i=1;for(;;)yield`${e}-${i++}`}export{e as i}
@@ -1,8 +0,0 @@
1
- function* idGenerator(id) {
2
- let currentId = 1;
3
- while (true) {
4
- yield `${id}-${currentId++}`;
5
- }
6
- }
7
-
8
- export { idGenerator as i };
@@ -1,8 +0,0 @@
1
- function* idGenerator(id) {
2
- let currentId = 1;
3
- while (true) {
4
- yield `${id}-${currentId++}`;
5
- }
6
- }
7
-
8
- export { idGenerator as i };
@@ -1,7 +0,0 @@
1
- import './_typography.scss';
2
- import { Meta, StoryObj } from '@storybook/web-components';
3
- declare const meta: Meta;
4
- export default meta;
5
- export declare const Headings: StoryObj;
6
- export declare const Text: StoryObj;
7
- export declare const Typography: StoryObj;