@dsn-starter-kit/components-web 1.0.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +929 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +258 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +258 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +914 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +21 -13
- package/dist/button/Button.d.ts +0 -50
- package/dist/button/Button.d.ts.map +0 -1
- package/dist/button/Button.js +0 -247
- package/dist/button/Button.js.map +0 -1
- package/dist/button/Button.test.d.ts +0 -2
- package/dist/button/Button.test.d.ts.map +0 -1
- package/dist/button/Button.test.js +0 -299
- package/dist/button/Button.test.js.map +0 -1
- package/dist/button/button-styles.generated.d.ts +0 -2
- package/dist/button/button-styles.generated.d.ts.map +0 -1
- package/dist/button/button-styles.generated.js +0 -4
- package/dist/button/button-styles.generated.js.map +0 -1
- package/dist/button/index.d.ts +0 -3
- package/dist/button/index.d.ts.map +0 -1
- package/dist/button/index.js +0 -2
- package/dist/button/index.js.map +0 -1
- package/dist/heading/Heading.d.ts +0 -30
- package/dist/heading/Heading.d.ts.map +0 -1
- package/dist/heading/Heading.js +0 -79
- package/dist/heading/Heading.js.map +0 -1
- package/dist/heading/Heading.test.d.ts +0 -2
- package/dist/heading/Heading.test.d.ts.map +0 -1
- package/dist/heading/Heading.test.js +0 -157
- package/dist/heading/Heading.test.js.map +0 -1
- package/dist/heading/heading-styles.generated.d.ts +0 -2
- package/dist/heading/heading-styles.generated.d.ts.map +0 -1
- package/dist/heading/heading-styles.generated.js +0 -4
- package/dist/heading/heading-styles.generated.js.map +0 -1
- package/dist/heading/index.d.ts +0 -3
- package/dist/heading/index.d.ts.map +0 -1
- package/dist/heading/index.js +0 -2
- package/dist/heading/index.js.map +0 -1
- package/dist/icon/Icon.d.ts +0 -31
- package/dist/icon/Icon.d.ts.map +0 -1
- package/dist/icon/Icon.js +0 -110
- package/dist/icon/Icon.js.map +0 -1
- package/dist/icon/Icon.test.d.ts +0 -2
- package/dist/icon/Icon.test.d.ts.map +0 -1
- package/dist/icon/Icon.test.js +0 -193
- package/dist/icon/Icon.test.js.map +0 -1
- package/dist/icon/icon-paths.generated.d.ts +0 -2
- package/dist/icon/icon-paths.generated.d.ts.map +0 -1
- package/dist/icon/icon-paths.generated.js +0 -56
- package/dist/icon/icon-paths.generated.js.map +0 -1
- package/dist/icon/icon-styles.generated.d.ts +0 -2
- package/dist/icon/icon-styles.generated.d.ts.map +0 -1
- package/dist/icon/icon-styles.generated.js +0 -4
- package/dist/icon/icon-styles.generated.js.map +0 -1
- package/dist/icon/index.d.ts +0 -3
- package/dist/icon/index.d.ts.map +0 -1
- package/dist/icon/index.js +0 -2
- package/dist/icon/index.js.map +0 -1
- package/dist/index.d.ts +0 -52
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -71
- package/dist/index.js.map +0 -1
- package/dist/link/Link.d.ts +0 -52
- package/dist/link/Link.d.ts.map +0 -1
- package/dist/link/Link.js +0 -260
- package/dist/link/Link.js.map +0 -1
- package/dist/link/Link.test.d.ts +0 -2
- package/dist/link/Link.test.d.ts.map +0 -1
- package/dist/link/Link.test.js +0 -256
- package/dist/link/Link.test.js.map +0 -1
- package/dist/link/index.d.ts +0 -3
- package/dist/link/index.d.ts.map +0 -1
- package/dist/link/index.js +0 -2
- package/dist/link/index.js.map +0 -1
- package/dist/link/link-styles.generated.d.ts +0 -2
- package/dist/link/link-styles.generated.d.ts.map +0 -1
- package/dist/link/link-styles.generated.js +0 -4
- package/dist/link/link-styles.generated.js.map +0 -1
- package/dist/ordered-list/OrderedList.d.ts +0 -32
- package/dist/ordered-list/OrderedList.d.ts.map +0 -1
- package/dist/ordered-list/OrderedList.js +0 -72
- package/dist/ordered-list/OrderedList.js.map +0 -1
- package/dist/ordered-list/OrderedList.test.d.ts +0 -2
- package/dist/ordered-list/OrderedList.test.d.ts.map +0 -1
- package/dist/ordered-list/OrderedList.test.js +0 -82
- package/dist/ordered-list/OrderedList.test.js.map +0 -1
- package/dist/ordered-list/index.d.ts +0 -2
- package/dist/ordered-list/index.d.ts.map +0 -1
- package/dist/ordered-list/index.js +0 -2
- package/dist/ordered-list/index.js.map +0 -1
- package/dist/ordered-list/ordered-list-styles.generated.d.ts +0 -2
- package/dist/ordered-list/ordered-list-styles.generated.d.ts.map +0 -1
- package/dist/ordered-list/ordered-list-styles.generated.js +0 -4
- package/dist/ordered-list/ordered-list-styles.generated.js.map +0 -1
- package/dist/paragraph/Paragraph.d.ts +0 -26
- package/dist/paragraph/Paragraph.d.ts.map +0 -1
- package/dist/paragraph/Paragraph.js +0 -60
- package/dist/paragraph/Paragraph.js.map +0 -1
- package/dist/paragraph/Paragraph.test.d.ts +0 -2
- package/dist/paragraph/Paragraph.test.d.ts.map +0 -1
- package/dist/paragraph/Paragraph.test.js +0 -121
- package/dist/paragraph/Paragraph.test.js.map +0 -1
- package/dist/paragraph/index.d.ts +0 -3
- package/dist/paragraph/index.d.ts.map +0 -1
- package/dist/paragraph/index.js +0 -2
- package/dist/paragraph/index.js.map +0 -1
- package/dist/paragraph/paragraph-styles.generated.d.ts +0 -2
- package/dist/paragraph/paragraph-styles.generated.d.ts.map +0 -1
- package/dist/paragraph/paragraph-styles.generated.js +0 -4
- package/dist/paragraph/paragraph-styles.generated.js.map +0 -1
- package/dist/unordered-list/UnorderedList.d.ts +0 -22
- package/dist/unordered-list/UnorderedList.d.ts.map +0 -1
- package/dist/unordered-list/UnorderedList.js +0 -42
- package/dist/unordered-list/UnorderedList.js.map +0 -1
- package/dist/unordered-list/UnorderedList.test.d.ts +0 -2
- package/dist/unordered-list/UnorderedList.test.d.ts.map +0 -1
- package/dist/unordered-list/UnorderedList.test.js +0 -56
- package/dist/unordered-list/UnorderedList.test.js.map +0 -1
- package/dist/unordered-list/index.d.ts +0 -2
- package/dist/unordered-list/index.d.ts.map +0 -1
- package/dist/unordered-list/index.js +0 -2
- package/dist/unordered-list/index.js.map +0 -1
- package/dist/unordered-list/unordered-list-styles.generated.d.ts +0 -2
- package/dist/unordered-list/unordered-list-styles.generated.d.ts.map +0 -1
- package/dist/unordered-list/unordered-list-styles.generated.js +0 -4
- package/dist/unordered-list/unordered-list-styles.generated.js.map +0 -1
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,914 @@
|
|
|
1
|
+
//#region src/button/button-styles.generated.ts
|
|
2
|
+
const buttonStyles = "/**\n * Shadow DOM wrapper styles for the Button Web Component.\n * The core button styles are imported from the shared HTML/CSS source.\n */\n\n:host {\n display: inline-block;\n}\n\n:host([full-width]) {\n display: block;\n width: 100%;\n}\n\n::slotted(*) {\n pointer-events: none;\n}\n\n/* Shared button styles - single source of truth */\n/**\n * Button Component\n * Uses component tokens for consistent styling\n */\n\n.dsn-button {\n /* Reset */\n display: inline-flex;\n align-self: flex-start;\n align-items: center;\n justify-content: center;\n position: relative; /* Ankerpunt voor DotBadge */\n\n /* Typography */\n font-family: var(--dsn-button-font-family);\n font-weight: var(--dsn-button-font-weight);\n line-height: var(--dsn-button-line-height);\n text-decoration: none;\n\n /* Borders */\n border: var(--dsn-button-border-width) solid transparent;\n border-radius: var(--dsn-button-border-radius);\n\n /* Interaction */\n cursor: pointer;\n user-select: none;\n transition:\n background-color var(--dsn-transition-duration-normal)\n var(--dsn-transition-easing-default),\n color var(--dsn-transition-duration-normal)\n var(--dsn-transition-easing-default),\n border-color var(--dsn-transition-duration-normal)\n var(--dsn-transition-easing-default);\n\n /* Accessibility - WCAG pointer target */\n min-block-size: var(--dsn-button-min-block-size);\n min-inline-size: var(--dsn-button-min-inline-size);\n}\n\n/* =============================================================================\n Size Variants\n ============================================================================= */\n\n.dsn-button--size-small {\n font-size: var(--dsn-button-size-small-font-size);\n padding-block: var(--dsn-button-size-small-padding-block);\n padding-inline: var(--dsn-button-size-small-padding-inline);\n gap: var(--dsn-button-size-small-gap);\n min-block-size: var(--dsn-button-size-small-min-block-size);\n}\n\n.dsn-button--size-default {\n font-size: var(--dsn-button-size-default-font-size);\n padding-block: var(--dsn-button-size-default-padding-block);\n padding-inline: var(--dsn-button-size-default-padding-inline);\n gap: var(--dsn-button-size-default-gap);\n}\n\n.dsn-button--size-large {\n font-size: var(--dsn-button-size-large-font-size);\n padding-block: var(--dsn-button-size-large-padding-block);\n padding-inline: var(--dsn-button-size-large-padding-inline);\n gap: var(--dsn-button-size-large-gap);\n}\n\n/* Icon sizing per button size */\n.dsn-button--size-small > .dsn-icon {\n width: var(--dsn-button-size-small-icon-size);\n height: var(--dsn-button-size-small-icon-size);\n}\n\n.dsn-button--size-default > .dsn-icon {\n width: var(--dsn-button-size-default-icon-size);\n height: var(--dsn-button-size-default-icon-size);\n}\n\n.dsn-button--size-large > .dsn-icon {\n width: var(--dsn-button-size-large-icon-size);\n height: var(--dsn-button-size-large-icon-size);\n}\n\n/* Icon Only Button */\n.dsn-button--icon-only {\n padding-inline: var(--dsn-button-size-default-icon-only-padding);\n}\n\n.dsn-button--icon-only.dsn-button--size-small {\n padding-inline: var(--dsn-button-size-small-icon-only-padding);\n}\n\n.dsn-button--icon-only.dsn-button--size-large {\n padding-inline: var(--dsn-button-size-large-icon-only-padding);\n}\n\n/* Icon Only — hide text label visually, keep accessible for screen readers */\n.dsn-button--icon-only .dsn-button__label {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n/* =============================================================================\n Focus State\n ============================================================================= */\n\n.dsn-button:focus-visible {\n background-color: var(--dsn-focus-background-color);\n color: var(--dsn-focus-color);\n border-color: var(--dsn-focus-background-color);\n outline: var(--dsn-focus-outline-width) var(--dsn-focus-outline-style)\n var(--dsn-focus-outline-color);\n outline-offset: var(--dsn-focus-outline-offset);\n box-shadow: 0 0 0\n calc(var(--dsn-focus-outline-offset) + var(--dsn-focus-outline-width))\n var(--dsn-focus-inverse-outline-color);\n}\n\n/* =============================================================================\n Color Variants\n ============================================================================= */\n\n/* Variant: Strong (main CTA) */\n.dsn-button--strong {\n background-color: var(--dsn-button-strong-background-color);\n color: var(--dsn-button-strong-color);\n border-color: var(--dsn-button-strong-border-color);\n}\n\n.dsn-button--strong:hover:not(:disabled) {\n background-color: var(--dsn-button-strong-hover-background-color);\n color: var(--dsn-button-strong-hover-color);\n border-color: var(--dsn-button-strong-hover-border-color);\n}\n\n.dsn-button--strong:active:not(:disabled) {\n background-color: var(--dsn-button-strong-active-background-color);\n color: var(--dsn-button-strong-active-color);\n border-color: var(--dsn-button-strong-active-border-color);\n}\n\n/* Variant: Default (alternative actions) */\n.dsn-button--default {\n background-color: var(--dsn-button-default-background-color);\n color: var(--dsn-button-default-color);\n border-color: var(--dsn-button-default-border-color);\n}\n\n.dsn-button--default:hover:not(:disabled) {\n background-color: var(--dsn-button-default-hover-background-color);\n color: var(--dsn-button-default-hover-color);\n border-color: var(--dsn-button-default-hover-border-color);\n}\n\n.dsn-button--default:active:not(:disabled) {\n background-color: var(--dsn-button-default-active-background-color);\n color: var(--dsn-button-default-active-color);\n border-color: var(--dsn-button-default-active-border-color);\n}\n\n/* Variant: Subtle (low emphasis) */\n.dsn-button--subtle {\n background-color: var(--dsn-button-subtle-background-color);\n color: var(--dsn-button-subtle-color);\n border-color: var(--dsn-button-subtle-border-color);\n}\n\n.dsn-button--subtle:hover:not(:disabled) {\n background-color: var(--dsn-button-subtle-hover-background-color);\n color: var(--dsn-button-subtle-hover-color);\n border-color: var(--dsn-button-subtle-hover-border-color);\n}\n\n.dsn-button--subtle:active:not(:disabled) {\n background-color: var(--dsn-button-subtle-active-background-color);\n color: var(--dsn-button-subtle-active-color);\n border-color: var(--dsn-button-subtle-active-border-color);\n}\n\n/* =============================================================================\n Sentiment Variants: Negative\n ============================================================================= */\n\n.dsn-button--strong-negative {\n background-color: var(--dsn-button-strong-negative-background-color);\n color: var(--dsn-button-strong-negative-color);\n border-color: var(--dsn-button-strong-negative-border-color);\n}\n\n.dsn-button--strong-negative:hover:not(:disabled) {\n background-color: var(--dsn-button-strong-negative-hover-background-color);\n color: var(--dsn-button-strong-negative-hover-color);\n border-color: var(--dsn-button-strong-negative-hover-border-color);\n}\n\n.dsn-button--strong-negative:active:not(:disabled) {\n background-color: var(--dsn-button-strong-negative-active-background-color);\n color: var(--dsn-button-strong-negative-active-color);\n border-color: var(--dsn-button-strong-negative-active-border-color);\n}\n\n.dsn-button--default-negative {\n background-color: var(--dsn-button-default-negative-background-color);\n color: var(--dsn-button-default-negative-color);\n border-color: var(--dsn-button-default-negative-border-color);\n}\n\n.dsn-button--default-negative:hover:not(:disabled) {\n background-color: var(--dsn-button-default-negative-hover-background-color);\n color: var(--dsn-button-default-negative-hover-color);\n border-color: var(--dsn-button-default-negative-hover-border-color);\n}\n\n.dsn-button--default-negative:active:not(:disabled) {\n background-color: var(--dsn-button-default-negative-active-background-color);\n color: var(--dsn-button-default-negative-active-color);\n border-color: var(--dsn-button-default-negative-active-border-color);\n}\n\n.dsn-button--subtle-negative {\n background-color: var(--dsn-button-subtle-negative-background-color);\n color: var(--dsn-button-subtle-negative-color);\n border-color: var(--dsn-button-subtle-negative-border-color);\n}\n\n.dsn-button--subtle-negative:hover:not(:disabled) {\n background-color: var(--dsn-button-subtle-negative-hover-background-color);\n color: var(--dsn-button-subtle-negative-hover-color);\n border-color: var(--dsn-button-subtle-negative-hover-border-color);\n}\n\n.dsn-button--subtle-negative:active:not(:disabled) {\n background-color: var(--dsn-button-subtle-negative-active-background-color);\n color: var(--dsn-button-subtle-negative-active-color);\n border-color: var(--dsn-button-subtle-negative-active-border-color);\n}\n\n/* =============================================================================\n Sentiment Variants: Positive\n ============================================================================= */\n\n.dsn-button--strong-positive {\n background-color: var(--dsn-button-strong-positive-background-color);\n color: var(--dsn-button-strong-positive-color);\n border-color: var(--dsn-button-strong-positive-border-color);\n}\n\n.dsn-button--strong-positive:hover:not(:disabled) {\n background-color: var(--dsn-button-strong-positive-hover-background-color);\n color: var(--dsn-button-strong-positive-hover-color);\n border-color: var(--dsn-button-strong-positive-hover-border-color);\n}\n\n.dsn-button--strong-positive:active:not(:disabled) {\n background-color: var(--dsn-button-strong-positive-active-background-color);\n color: var(--dsn-button-strong-positive-active-color);\n border-color: var(--dsn-button-strong-positive-active-border-color);\n}\n\n.dsn-button--default-positive {\n background-color: var(--dsn-button-default-positive-background-color);\n color: var(--dsn-button-default-positive-color);\n border-color: var(--dsn-button-default-positive-border-color);\n}\n\n.dsn-button--default-positive:hover:not(:disabled) {\n background-color: var(--dsn-button-default-positive-hover-background-color);\n color: var(--dsn-button-default-positive-hover-color);\n border-color: var(--dsn-button-default-positive-hover-border-color);\n}\n\n.dsn-button--default-positive:active:not(:disabled) {\n background-color: var(--dsn-button-default-positive-active-background-color);\n color: var(--dsn-button-default-positive-active-color);\n border-color: var(--dsn-button-default-positive-active-border-color);\n}\n\n.dsn-button--subtle-positive {\n background-color: var(--dsn-button-subtle-positive-background-color);\n color: var(--dsn-button-subtle-positive-color);\n border-color: var(--dsn-button-subtle-positive-border-color);\n}\n\n.dsn-button--subtle-positive:hover:not(:disabled) {\n background-color: var(--dsn-button-subtle-positive-hover-background-color);\n color: var(--dsn-button-subtle-positive-hover-color);\n border-color: var(--dsn-button-subtle-positive-hover-border-color);\n}\n\n.dsn-button--subtle-positive:active:not(:disabled) {\n background-color: var(--dsn-button-subtle-positive-active-background-color);\n color: var(--dsn-button-subtle-positive-active-color);\n border-color: var(--dsn-button-subtle-positive-active-border-color);\n}\n\n/* =============================================================================\n States\n ============================================================================= */\n\n/* Disabled State */\n.dsn-button:disabled {\n background-color: var(--dsn-button-disabled-background-color);\n color: var(--dsn-button-disabled-color);\n border-color: var(--dsn-button-disabled-border-color);\n cursor: not-allowed;\n}\n\n/* Loading State */\n.dsn-button--loading {\n pointer-events: none;\n}\n\n.dsn-button--loading > .dsn-button__loader {\n animation: dsn-button-spin 0.8s linear infinite;\n}\n\n@keyframes dsn-button-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Full Width */\n.dsn-button--full-width {\n width: 100%;\n}\n\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/icon/icon-paths.generated.ts
|
|
5
|
+
const iconPaths = {
|
|
6
|
+
"alert-triangle": [
|
|
7
|
+
"M0 0h24v24H0z",
|
|
8
|
+
"M12 9v4",
|
|
9
|
+
"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",
|
|
10
|
+
"M12 16h.01"
|
|
11
|
+
],
|
|
12
|
+
"archive": [
|
|
13
|
+
"M0 0h24v24H0z",
|
|
14
|
+
"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2",
|
|
15
|
+
"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-10",
|
|
16
|
+
"M10 12l4 0"
|
|
17
|
+
],
|
|
18
|
+
"arrow-down": [
|
|
19
|
+
"M0 0h24v24H0z",
|
|
20
|
+
"M12 5l0 14",
|
|
21
|
+
"M18 13l-6 6",
|
|
22
|
+
"M6 13l6 6"
|
|
23
|
+
],
|
|
24
|
+
"arrow-left": [
|
|
25
|
+
"M5 12l14 0",
|
|
26
|
+
"M5 12l6 6",
|
|
27
|
+
"M5 12l6 -6"
|
|
28
|
+
],
|
|
29
|
+
"arrow-narrow-down": [
|
|
30
|
+
"M0 0h24v24H0z",
|
|
31
|
+
"M12 5l0 14",
|
|
32
|
+
"M16 15l-4 4",
|
|
33
|
+
"M8 15l4 4"
|
|
34
|
+
],
|
|
35
|
+
"arrow-narrow-up": [
|
|
36
|
+
"M0 0h24v24H0z",
|
|
37
|
+
"M12 5l0 14",
|
|
38
|
+
"M16 9l-4 -4",
|
|
39
|
+
"M8 9l4 -4"
|
|
40
|
+
],
|
|
41
|
+
"arrow-right": [
|
|
42
|
+
"M5 12l14 0",
|
|
43
|
+
"M13 18l6 -6",
|
|
44
|
+
"M13 6l6 6"
|
|
45
|
+
],
|
|
46
|
+
"arrow-up": [
|
|
47
|
+
"M0 0h24v24H0z",
|
|
48
|
+
"M12 5l0 14",
|
|
49
|
+
"M18 11l-6 -6",
|
|
50
|
+
"M6 11l6 -6"
|
|
51
|
+
],
|
|
52
|
+
"arrows-sort": [
|
|
53
|
+
"M0 0h24v24H0z",
|
|
54
|
+
"M3 9l4 -4l4 4m-4 -4v14",
|
|
55
|
+
"M21 15l-4 4l-4 -4m4 4v-14"
|
|
56
|
+
],
|
|
57
|
+
"bell": [
|
|
58
|
+
"M0 0h24v24H0z",
|
|
59
|
+
"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",
|
|
60
|
+
"M9 17v1a3 3 0 0 0 6 0v-1"
|
|
61
|
+
],
|
|
62
|
+
"calendar-event": [
|
|
63
|
+
"M0 0h24v24H0z",
|
|
64
|
+
"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",
|
|
65
|
+
"M16 3l0 4",
|
|
66
|
+
"M8 3l0 4",
|
|
67
|
+
"M4 11l16 0",
|
|
68
|
+
"M8 15h2v2h-2l0 -2"
|
|
69
|
+
],
|
|
70
|
+
"check": ["M5 12l5 5l10 -10"],
|
|
71
|
+
"chevron-down": ["M6 9l6 6l6 -6"],
|
|
72
|
+
"chevron-left": ["M15 6l-6 6l6 6"],
|
|
73
|
+
"chevron-right": ["M9 6l6 6l-6 6"],
|
|
74
|
+
"chevron-up": ["M6 15l6 -6l6 6"],
|
|
75
|
+
"circle-check": [
|
|
76
|
+
"M0 0h24v24H0z",
|
|
77
|
+
"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
|
|
78
|
+
"M9 12l2 2l4 -4"
|
|
79
|
+
],
|
|
80
|
+
"clock": [
|
|
81
|
+
"M0 0h24v24H0z",
|
|
82
|
+
"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",
|
|
83
|
+
"M12 7v5l3 3"
|
|
84
|
+
],
|
|
85
|
+
"dots-vertical": [
|
|
86
|
+
"M0 0h24v24H0z",
|
|
87
|
+
"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
88
|
+
"M11 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
89
|
+
"M11 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"
|
|
90
|
+
],
|
|
91
|
+
"download": [
|
|
92
|
+
"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",
|
|
93
|
+
"M7 11l5 5l5 -5",
|
|
94
|
+
"M12 4l0 12"
|
|
95
|
+
],
|
|
96
|
+
"edit": [
|
|
97
|
+
"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",
|
|
98
|
+
"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",
|
|
99
|
+
"M16 5l3 3"
|
|
100
|
+
],
|
|
101
|
+
"exclamation-circle": [
|
|
102
|
+
"M0 0h24v24H0z",
|
|
103
|
+
"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
|
|
104
|
+
"M12 9v4",
|
|
105
|
+
"M12 16v.01"
|
|
106
|
+
],
|
|
107
|
+
"external-link": [
|
|
108
|
+
"M0 0h24v24H0z",
|
|
109
|
+
"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6",
|
|
110
|
+
"M11 13l9 -9",
|
|
111
|
+
"M15 4h5v5"
|
|
112
|
+
],
|
|
113
|
+
"eye": [
|
|
114
|
+
"M0 0h24v24H0z",
|
|
115
|
+
"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",
|
|
116
|
+
"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"
|
|
117
|
+
],
|
|
118
|
+
"file-description": [
|
|
119
|
+
"M0 0h24v24H0z",
|
|
120
|
+
"M14 3v4a1 1 0 0 0 1 1h4",
|
|
121
|
+
"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",
|
|
122
|
+
"M9 17h6",
|
|
123
|
+
"M9 13h6"
|
|
124
|
+
],
|
|
125
|
+
"folder": ["M0 0h24v24H0z", "M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2"],
|
|
126
|
+
"heart-filled": ["M0 0h24v24H0z", "M6.979 3.074a6 6 0 0 1 4.988 1.425l.037 .033l.034 -.03a6 6 0 0 1 4.733 -1.44l.246 .036a6 6 0 0 1 3.364 10.008l-.18 .185l-.048 .041l-7.45 7.379a1 1 0 0 1 -1.313 .082l-.094 -.082l-7.493 -7.422a6 6 0 0 1 3.176 -10.215z"],
|
|
127
|
+
"heart": ["M0 0h24v24H0z", "M19.5 12.572l-7.5 7.428l-7.5 -7.428a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572"],
|
|
128
|
+
"home": [
|
|
129
|
+
"M5 12l-2 0l9 -9l9 9l-2 0",
|
|
130
|
+
"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7",
|
|
131
|
+
"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6"
|
|
132
|
+
],
|
|
133
|
+
"info-circle": [
|
|
134
|
+
"M0 0h24v24H0z",
|
|
135
|
+
"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",
|
|
136
|
+
"M12 9h.01",
|
|
137
|
+
"M11 12h1v4h1"
|
|
138
|
+
],
|
|
139
|
+
"loader": [
|
|
140
|
+
"M0 0h24v24H0z",
|
|
141
|
+
"M12 6l0 -3",
|
|
142
|
+
"M16.25 7.75l2.15 -2.15",
|
|
143
|
+
"M18 12l3 0",
|
|
144
|
+
"M16.25 16.25l2.15 2.15",
|
|
145
|
+
"M12 18l0 3",
|
|
146
|
+
"M7.75 16.25l-2.15 2.15",
|
|
147
|
+
"M6 12l-3 0",
|
|
148
|
+
"M7.75 7.75l-2.15 -2.15"
|
|
149
|
+
],
|
|
150
|
+
"mail": [
|
|
151
|
+
"M0 0h24v24H0z",
|
|
152
|
+
"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10",
|
|
153
|
+
"M3 7l9 6l9 -6"
|
|
154
|
+
],
|
|
155
|
+
"menu": [
|
|
156
|
+
"M4 6l16 0",
|
|
157
|
+
"M4 12l16 0",
|
|
158
|
+
"M4 18l16 0"
|
|
159
|
+
],
|
|
160
|
+
"message-circle": ["M0 0h24v24H0z", "M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1"],
|
|
161
|
+
"minus": ["M5 12l14 0"],
|
|
162
|
+
"paperclip": ["M0 0h24v24H0z", "M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5"],
|
|
163
|
+
"pencil": ["M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4", "M13.5 6.5l4 4"],
|
|
164
|
+
"photo": [
|
|
165
|
+
"M0 0h24v24H0z",
|
|
166
|
+
"M15 8h.01",
|
|
167
|
+
"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",
|
|
168
|
+
"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",
|
|
169
|
+
"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3"
|
|
170
|
+
],
|
|
171
|
+
"plus": ["M12 5l0 14", "M5 12l14 0"],
|
|
172
|
+
"printer": [
|
|
173
|
+
"M0 0h24v24H0z",
|
|
174
|
+
"M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2",
|
|
175
|
+
"M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4",
|
|
176
|
+
"M7 15a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2l0 -4"
|
|
177
|
+
],
|
|
178
|
+
"search": ["M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", "M21 21l-6 -6"],
|
|
179
|
+
"selector": [
|
|
180
|
+
"M0 0h24v24H0z",
|
|
181
|
+
"M8 9l4 -4l4 4",
|
|
182
|
+
"M16 15l-4 4l-4 -4"
|
|
183
|
+
],
|
|
184
|
+
"settings": ["M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z", "M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"],
|
|
185
|
+
"sort-ascending": [
|
|
186
|
+
"M0 0h24v24H0z",
|
|
187
|
+
"M4 6l7 0",
|
|
188
|
+
"M4 12l7 0",
|
|
189
|
+
"M4 18l9 0",
|
|
190
|
+
"M15 9l3 -3l3 3",
|
|
191
|
+
"M18 6l0 12"
|
|
192
|
+
],
|
|
193
|
+
"sort-descending": [
|
|
194
|
+
"M0 0h24v24H0z",
|
|
195
|
+
"M4 6l9 0",
|
|
196
|
+
"M4 12l7 0",
|
|
197
|
+
"M4 18l7 0",
|
|
198
|
+
"M15 15l3 3l3 -3",
|
|
199
|
+
"M18 6l0 12"
|
|
200
|
+
],
|
|
201
|
+
"star-filled": ["M0 0h24v24H0z", "M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z"],
|
|
202
|
+
"star": ["M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"],
|
|
203
|
+
"trash": [
|
|
204
|
+
"M4 7l16 0",
|
|
205
|
+
"M10 11l0 6",
|
|
206
|
+
"M14 11l0 6",
|
|
207
|
+
"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",
|
|
208
|
+
"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"
|
|
209
|
+
],
|
|
210
|
+
"upload": [
|
|
211
|
+
"M0 0h24v24H0z",
|
|
212
|
+
"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",
|
|
213
|
+
"M7 9l5 -5l5 5",
|
|
214
|
+
"M12 4l0 12"
|
|
215
|
+
],
|
|
216
|
+
"user": ["M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0", "M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"],
|
|
217
|
+
"x": ["M18 6l-12 12", "M6 6l12 12"]
|
|
218
|
+
};
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/button/Button.ts
|
|
221
|
+
var DsnButton = class extends HTMLElement {
|
|
222
|
+
static get observedAttributes() {
|
|
223
|
+
return [
|
|
224
|
+
"variant",
|
|
225
|
+
"size",
|
|
226
|
+
"disabled",
|
|
227
|
+
"loading",
|
|
228
|
+
"full-width",
|
|
229
|
+
"icon-only",
|
|
230
|
+
"type"
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
constructor() {
|
|
234
|
+
super();
|
|
235
|
+
this._loaderEl = null;
|
|
236
|
+
this.attachShadow({ mode: "open" });
|
|
237
|
+
this._button = document.createElement("button");
|
|
238
|
+
this._button.setAttribute("type", "button");
|
|
239
|
+
this._iconStartSlot = document.createElement("slot");
|
|
240
|
+
this._iconStartSlot.setAttribute("name", "icon-start");
|
|
241
|
+
this._button.appendChild(this._iconStartSlot);
|
|
242
|
+
this._button.appendChild(document.createElement("slot"));
|
|
243
|
+
const iconEndSlot = document.createElement("slot");
|
|
244
|
+
iconEndSlot.setAttribute("name", "icon-end");
|
|
245
|
+
this._button.appendChild(iconEndSlot);
|
|
246
|
+
const style = document.createElement("style");
|
|
247
|
+
style.textContent = buttonStyles;
|
|
248
|
+
this.shadowRoot.appendChild(style);
|
|
249
|
+
this.shadowRoot.appendChild(this._button);
|
|
250
|
+
}
|
|
251
|
+
connectedCallback() {
|
|
252
|
+
this._updateClasses();
|
|
253
|
+
this._updateDisabled();
|
|
254
|
+
this._updateType();
|
|
255
|
+
}
|
|
256
|
+
attributeChangedCallback(name, _oldValue, _newValue) {
|
|
257
|
+
switch (name) {
|
|
258
|
+
case "variant":
|
|
259
|
+
case "size":
|
|
260
|
+
case "loading":
|
|
261
|
+
case "full-width":
|
|
262
|
+
case "icon-only":
|
|
263
|
+
this._updateClasses();
|
|
264
|
+
break;
|
|
265
|
+
case "disabled":
|
|
266
|
+
this._updateDisabled();
|
|
267
|
+
break;
|
|
268
|
+
case "type": this._updateType();
|
|
269
|
+
}
|
|
270
|
+
if (name === "loading") {
|
|
271
|
+
this._updateDisabled();
|
|
272
|
+
this._updateLoader();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
_updateLoader() {
|
|
276
|
+
if (this.loading) {
|
|
277
|
+
if (!this._loaderEl) this._loaderEl = this._createLoaderSvg();
|
|
278
|
+
this._iconStartSlot.style.display = "none";
|
|
279
|
+
this._button.insertBefore(this._loaderEl, this._iconStartSlot);
|
|
280
|
+
} else {
|
|
281
|
+
if (this._loaderEl && this._loaderEl.parentNode) this._loaderEl.remove();
|
|
282
|
+
this._iconStartSlot.style.display = "";
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
_createLoaderSvg() {
|
|
286
|
+
const ns = "http://www.w3.org/2000/svg";
|
|
287
|
+
const svg = document.createElementNS(ns, "svg");
|
|
288
|
+
svg.setAttribute("viewBox", "0 0 24 24");
|
|
289
|
+
svg.setAttribute("fill", "none");
|
|
290
|
+
svg.setAttribute("stroke", "currentColor");
|
|
291
|
+
svg.setAttribute("stroke-width", "2");
|
|
292
|
+
svg.setAttribute("stroke-linecap", "round");
|
|
293
|
+
svg.setAttribute("stroke-linejoin", "round");
|
|
294
|
+
svg.setAttribute("aria-hidden", "true");
|
|
295
|
+
svg.classList.add("dsn-icon", "dsn-button__loader");
|
|
296
|
+
(iconPaths["loader"] || []).forEach((d) => {
|
|
297
|
+
const path = document.createElementNS(ns, "path");
|
|
298
|
+
path.setAttribute("d", d);
|
|
299
|
+
if (d === "M0 0h24v24H0z") {
|
|
300
|
+
path.setAttribute("stroke", "none");
|
|
301
|
+
path.setAttribute("fill", "none");
|
|
302
|
+
}
|
|
303
|
+
svg.appendChild(path);
|
|
304
|
+
});
|
|
305
|
+
return svg;
|
|
306
|
+
}
|
|
307
|
+
_updateClasses() {
|
|
308
|
+
const variant = this.variant;
|
|
309
|
+
const size = this.size;
|
|
310
|
+
const loading = this.loading;
|
|
311
|
+
const fullWidth = this.fullWidth;
|
|
312
|
+
const iconOnly = this.iconOnly;
|
|
313
|
+
const classes = [
|
|
314
|
+
"dsn-button",
|
|
315
|
+
`dsn-button--${variant}`,
|
|
316
|
+
`dsn-button--size-${size}`
|
|
317
|
+
];
|
|
318
|
+
if (loading) classes.push("dsn-button--loading");
|
|
319
|
+
if (fullWidth) classes.push("dsn-button--full-width");
|
|
320
|
+
if (iconOnly) classes.push("dsn-button--icon-only");
|
|
321
|
+
this._button.className = classes.join(" ");
|
|
322
|
+
}
|
|
323
|
+
_updateDisabled() {
|
|
324
|
+
if (this.disabled || this.loading) this._button.setAttribute("disabled", "");
|
|
325
|
+
else this._button.removeAttribute("disabled");
|
|
326
|
+
if (this.loading) this._button.setAttribute("aria-busy", "true");
|
|
327
|
+
else this._button.removeAttribute("aria-busy");
|
|
328
|
+
}
|
|
329
|
+
_updateType() {
|
|
330
|
+
this._button.setAttribute("type", this.type);
|
|
331
|
+
}
|
|
332
|
+
get variant() {
|
|
333
|
+
return this.getAttribute("variant") || "strong";
|
|
334
|
+
}
|
|
335
|
+
set variant(value) {
|
|
336
|
+
this.setAttribute("variant", value);
|
|
337
|
+
}
|
|
338
|
+
get size() {
|
|
339
|
+
return this.getAttribute("size") || "default";
|
|
340
|
+
}
|
|
341
|
+
set size(value) {
|
|
342
|
+
this.setAttribute("size", value);
|
|
343
|
+
}
|
|
344
|
+
get disabled() {
|
|
345
|
+
return this.hasAttribute("disabled");
|
|
346
|
+
}
|
|
347
|
+
set disabled(value) {
|
|
348
|
+
if (value) this.setAttribute("disabled", "");
|
|
349
|
+
else this.removeAttribute("disabled");
|
|
350
|
+
}
|
|
351
|
+
get loading() {
|
|
352
|
+
return this.hasAttribute("loading");
|
|
353
|
+
}
|
|
354
|
+
set loading(value) {
|
|
355
|
+
if (value) this.setAttribute("loading", "");
|
|
356
|
+
else this.removeAttribute("loading");
|
|
357
|
+
}
|
|
358
|
+
get fullWidth() {
|
|
359
|
+
return this.hasAttribute("full-width");
|
|
360
|
+
}
|
|
361
|
+
set fullWidth(value) {
|
|
362
|
+
if (value) this.setAttribute("full-width", "");
|
|
363
|
+
else this.removeAttribute("full-width");
|
|
364
|
+
}
|
|
365
|
+
get iconOnly() {
|
|
366
|
+
return this.hasAttribute("icon-only");
|
|
367
|
+
}
|
|
368
|
+
set iconOnly(value) {
|
|
369
|
+
if (value) this.setAttribute("icon-only", "");
|
|
370
|
+
else this.removeAttribute("icon-only");
|
|
371
|
+
}
|
|
372
|
+
get type() {
|
|
373
|
+
return this.getAttribute("type") || "button";
|
|
374
|
+
}
|
|
375
|
+
set type(value) {
|
|
376
|
+
this.setAttribute("type", value);
|
|
377
|
+
}
|
|
378
|
+
get form() {
|
|
379
|
+
return this._button.form;
|
|
380
|
+
}
|
|
381
|
+
focus(options) {
|
|
382
|
+
this._button.focus(options);
|
|
383
|
+
}
|
|
384
|
+
blur() {
|
|
385
|
+
this._button.blur();
|
|
386
|
+
}
|
|
387
|
+
click() {
|
|
388
|
+
this._button.click();
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
function defineButton(tagName = "dsn-button") {
|
|
392
|
+
if (!customElements.get(tagName)) customElements.define(tagName, DsnButton);
|
|
393
|
+
}
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/icon/icon-styles.generated.ts
|
|
396
|
+
const iconStyles = "/**\n * Shadow DOM wrapper styles for the Icon Web Component.\n * The core icon styles are imported from the shared HTML/CSS source.\n */\n\n:host {\n display: inline-block;\n vertical-align: middle;\n line-height: 0;\n}\n\n/* Shared icon styles - single source of truth */\n/**\n * Icon Component Styles\n * Uses design tokens for sizing (coupled to typography)\n *\n * Usage:\n * <svg class=\"dsn-icon dsn-icon--lg\" ...>\n * <use href=\"...\" />\n * </svg>\n */\n\n.dsn-icon {\n /* Base styles */\n display: inline-block;\n vertical-align: middle;\n flex-shrink: 0;\n\n /* Default size (md) */\n width: var(--dsn-icon-size-md);\n height: var(--dsn-icon-size-md);\n}\n\n/* Size Variants - Using design tokens */\n.dsn-icon--sm {\n width: var(--dsn-icon-size-sm);\n height: var(--dsn-icon-size-sm);\n}\n\n.dsn-icon--lg {\n width: var(--dsn-icon-size-lg);\n height: var(--dsn-icon-size-lg);\n}\n\n.dsn-icon--xl {\n width: var(--dsn-icon-size-xl);\n height: var(--dsn-icon-size-xl);\n}\n\n.dsn-icon--2xl {\n width: var(--dsn-icon-size-2xl);\n height: var(--dsn-icon-size-2xl);\n}\n\n.dsn-icon--3xl {\n width: var(--dsn-icon-size-3xl);\n height: var(--dsn-icon-size-3xl);\n}\n\n.dsn-icon--4xl {\n width: var(--dsn-icon-size-4xl);\n height: var(--dsn-icon-size-4xl);\n}\n\n";
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/icon/Icon.ts
|
|
399
|
+
/**
|
|
400
|
+
* DSN Icon Web Component
|
|
401
|
+
*
|
|
402
|
+
* A custom element that renders SVG icons from the design system icon set.
|
|
403
|
+
* Icons are inlined as SVG markup for Shadow DOM encapsulation.
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```html
|
|
407
|
+
* <dsn-icon name="check" size="md"></dsn-icon>
|
|
408
|
+
* <dsn-icon name="settings" size="lg" label="Open settings"></dsn-icon>
|
|
409
|
+
* ```
|
|
410
|
+
*/
|
|
411
|
+
var DsnIcon = class extends HTMLElement {
|
|
412
|
+
static get observedAttributes() {
|
|
413
|
+
return [
|
|
414
|
+
"name",
|
|
415
|
+
"size",
|
|
416
|
+
"label"
|
|
417
|
+
];
|
|
418
|
+
}
|
|
419
|
+
constructor() {
|
|
420
|
+
super();
|
|
421
|
+
this._svg = null;
|
|
422
|
+
this.attachShadow({ mode: "open" });
|
|
423
|
+
const style = document.createElement("style");
|
|
424
|
+
style.textContent = iconStyles;
|
|
425
|
+
this.shadowRoot.appendChild(style);
|
|
426
|
+
}
|
|
427
|
+
connectedCallback() {
|
|
428
|
+
this._render();
|
|
429
|
+
}
|
|
430
|
+
attributeChangedCallback() {
|
|
431
|
+
this._render();
|
|
432
|
+
}
|
|
433
|
+
_render() {
|
|
434
|
+
const name = this.name;
|
|
435
|
+
const size = this.size;
|
|
436
|
+
const label = this.label;
|
|
437
|
+
if (this._svg) {
|
|
438
|
+
this._svg.remove();
|
|
439
|
+
this._svg = null;
|
|
440
|
+
}
|
|
441
|
+
if (!name || !(name in iconPaths)) return;
|
|
442
|
+
const paths = iconPaths[name];
|
|
443
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
444
|
+
svg.setAttribute("viewBox", "0 0 24 24");
|
|
445
|
+
svg.setAttribute("fill", "none");
|
|
446
|
+
svg.setAttribute("stroke", "currentColor");
|
|
447
|
+
svg.setAttribute("stroke-width", "2");
|
|
448
|
+
svg.setAttribute("stroke-linecap", "round");
|
|
449
|
+
svg.setAttribute("stroke-linejoin", "round");
|
|
450
|
+
const classes = ["dsn-icon"];
|
|
451
|
+
if (size !== "md") classes.push(`dsn-icon--${size}`);
|
|
452
|
+
svg.setAttribute("class", classes.join(" "));
|
|
453
|
+
if (label) {
|
|
454
|
+
svg.setAttribute("role", "img");
|
|
455
|
+
svg.setAttribute("aria-label", label);
|
|
456
|
+
} else svg.setAttribute("aria-hidden", "true");
|
|
457
|
+
for (const d of paths) {
|
|
458
|
+
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
459
|
+
path.setAttribute("d", d);
|
|
460
|
+
svg.appendChild(path);
|
|
461
|
+
}
|
|
462
|
+
this._svg = svg;
|
|
463
|
+
this.shadowRoot.appendChild(svg);
|
|
464
|
+
}
|
|
465
|
+
get name() {
|
|
466
|
+
return this.getAttribute("name") || "";
|
|
467
|
+
}
|
|
468
|
+
set name(value) {
|
|
469
|
+
this.setAttribute("name", value);
|
|
470
|
+
}
|
|
471
|
+
get size() {
|
|
472
|
+
return this.getAttribute("size") || "md";
|
|
473
|
+
}
|
|
474
|
+
set size(value) {
|
|
475
|
+
this.setAttribute("size", value);
|
|
476
|
+
}
|
|
477
|
+
get label() {
|
|
478
|
+
return this.getAttribute("label") || "";
|
|
479
|
+
}
|
|
480
|
+
set label(value) {
|
|
481
|
+
if (value) this.setAttribute("label", value);
|
|
482
|
+
else this.removeAttribute("label");
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
function defineIcon(tagName = "dsn-icon") {
|
|
486
|
+
if (!customElements.get(tagName)) customElements.define(tagName, DsnIcon);
|
|
487
|
+
}
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/paragraph/paragraph-styles.generated.ts
|
|
490
|
+
const paragraphStyles = "/**\n * Shadow DOM wrapper styles for the Paragraph Web Component.\n * The core paragraph styles are imported from the shared HTML/CSS source.\n */\n\n:host {\n display: block;\n}\n\n/* Shared paragraph styles - single source of truth */\n/**\n * Paragraph Component\n * Uses component tokens for consistent styling\n *\n * Base class includes the default variant styles — class=\"dsn-paragraph\" is sufficient\n * for the most common case. Variant modifiers (lead, small-print) override what differs.\n */\n\n.dsn-paragraph {\n font-family: var(--dsn-paragraph-font-family);\n font-weight: var(--dsn-paragraph-font-weight);\n color: var(--dsn-paragraph-color);\n max-inline-size: var(--dsn-paragraph-max-inline-size);\n margin-block-start: 0;\n font-size: var(--dsn-paragraph-default-font-size);\n line-height: var(--dsn-paragraph-default-line-height);\n margin-block-end: var(--dsn-paragraph-default-margin-block-end);\n}\n\n/* Lead Variant */\n.dsn-paragraph--lead {\n font-size: var(--dsn-paragraph-lead-font-size);\n line-height: var(--dsn-paragraph-lead-line-height);\n margin-block-end: var(--dsn-paragraph-lead-margin-block-end);\n}\n\n/* Small Print Variant */\n.dsn-paragraph--small-print {\n font-size: var(--dsn-paragraph-small-print-font-size);\n line-height: var(--dsn-paragraph-small-print-line-height);\n margin-block-end: var(--dsn-paragraph-small-print-margin-block-end);\n}\n\n";
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region src/paragraph/Paragraph.ts
|
|
493
|
+
var DsnParagraph = class extends HTMLElement {
|
|
494
|
+
static get observedAttributes() {
|
|
495
|
+
return ["variant"];
|
|
496
|
+
}
|
|
497
|
+
constructor() {
|
|
498
|
+
super();
|
|
499
|
+
this.attachShadow({ mode: "open" });
|
|
500
|
+
this._paragraph = document.createElement("p");
|
|
501
|
+
this._paragraph.innerHTML = "<slot></slot>";
|
|
502
|
+
const style = document.createElement("style");
|
|
503
|
+
style.textContent = paragraphStyles;
|
|
504
|
+
this.shadowRoot.appendChild(style);
|
|
505
|
+
this.shadowRoot.appendChild(this._paragraph);
|
|
506
|
+
}
|
|
507
|
+
connectedCallback() {
|
|
508
|
+
this._updateClasses();
|
|
509
|
+
}
|
|
510
|
+
attributeChangedCallback() {
|
|
511
|
+
this._updateClasses();
|
|
512
|
+
}
|
|
513
|
+
_updateClasses() {
|
|
514
|
+
const variant = this.variant;
|
|
515
|
+
const classes = ["dsn-paragraph", variant !== "default" && `dsn-paragraph--${variant}`].filter(Boolean);
|
|
516
|
+
this._paragraph.className = classes.join(" ");
|
|
517
|
+
}
|
|
518
|
+
get variant() {
|
|
519
|
+
return this.getAttribute("variant") || "default";
|
|
520
|
+
}
|
|
521
|
+
set variant(value) {
|
|
522
|
+
this.setAttribute("variant", value);
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
function defineParagraph(tagName = "dsn-paragraph") {
|
|
526
|
+
if (!customElements.get(tagName)) customElements.define(tagName, DsnParagraph);
|
|
527
|
+
}
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/heading/heading-styles.generated.ts
|
|
530
|
+
const headingStyles = "/**\n * Shadow DOM wrapper styles for the Heading Web Component.\n * The core heading styles are imported from the shared HTML/CSS source.\n */\n\n:host {\n display: block;\n}\n\n/* Shared heading styles - single source of truth */\n/**\n * Heading Component\n * Uses semantic component tokens for consistent styling\n *\n * Each appearance level has its own complete set of tokens\n * (font-family, font-weight, color, font-size, line-height, margin).\n *\n * The `level` prop controls the semantic HTML element (h1–h6).\n * The `appearance` prop controls the visual style, independently of level.\n */\n\n.dsn-heading {\n margin-block-start: 0;\n text-wrap: balance;\n}\n\n/* Heading 1 Appearance */\n.dsn-heading--heading-1 {\n font-family: var(--dsn-heading-level-1-font-family);\n font-weight: var(--dsn-heading-level-1-font-weight);\n color: var(--dsn-heading-level-1-color);\n font-size: var(--dsn-heading-level-1-font-size);\n line-height: var(--dsn-heading-level-1-line-height);\n margin-block-end: var(--dsn-heading-level-1-margin-block-end);\n}\n\n/* Heading 2 Appearance */\n.dsn-heading--heading-2 {\n font-family: var(--dsn-heading-level-2-font-family);\n font-weight: var(--dsn-heading-level-2-font-weight);\n color: var(--dsn-heading-level-2-color);\n font-size: var(--dsn-heading-level-2-font-size);\n line-height: var(--dsn-heading-level-2-line-height);\n margin-block-end: var(--dsn-heading-level-2-margin-block-end);\n}\n\n/* Heading 3 Appearance */\n.dsn-heading--heading-3 {\n font-family: var(--dsn-heading-level-3-font-family);\n font-weight: var(--dsn-heading-level-3-font-weight);\n color: var(--dsn-heading-level-3-color);\n font-size: var(--dsn-heading-level-3-font-size);\n line-height: var(--dsn-heading-level-3-line-height);\n margin-block-end: var(--dsn-heading-level-3-margin-block-end);\n}\n\n/* Heading 4 Appearance */\n.dsn-heading--heading-4 {\n font-family: var(--dsn-heading-level-4-font-family);\n font-weight: var(--dsn-heading-level-4-font-weight);\n color: var(--dsn-heading-level-4-color);\n font-size: var(--dsn-heading-level-4-font-size);\n line-height: var(--dsn-heading-level-4-line-height);\n margin-block-end: var(--dsn-heading-level-4-margin-block-end);\n}\n\n/* Heading 5 Appearance */\n.dsn-heading--heading-5 {\n font-family: var(--dsn-heading-level-5-font-family);\n font-weight: var(--dsn-heading-level-5-font-weight);\n color: var(--dsn-heading-level-5-color);\n font-size: var(--dsn-heading-level-5-font-size);\n line-height: var(--dsn-heading-level-5-line-height);\n margin-block-end: var(--dsn-heading-level-5-margin-block-end);\n}\n\n/* Heading 6 Appearance */\n.dsn-heading--heading-6 {\n font-family: var(--dsn-heading-level-6-font-family);\n font-weight: var(--dsn-heading-level-6-font-weight);\n color: var(--dsn-heading-level-6-color);\n font-size: var(--dsn-heading-level-6-font-size);\n line-height: var(--dsn-heading-level-6-line-height);\n margin-block-end: var(--dsn-heading-level-6-margin-block-end);\n}\n\n";
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region src/heading/Heading.ts
|
|
533
|
+
var DsnHeading = class extends HTMLElement {
|
|
534
|
+
static get observedAttributes() {
|
|
535
|
+
return ["level", "appearance"];
|
|
536
|
+
}
|
|
537
|
+
constructor() {
|
|
538
|
+
super();
|
|
539
|
+
this.attachShadow({ mode: "open" });
|
|
540
|
+
this._heading = document.createElement("h2");
|
|
541
|
+
this._heading.innerHTML = "<slot></slot>";
|
|
542
|
+
const style = document.createElement("style");
|
|
543
|
+
style.textContent = headingStyles;
|
|
544
|
+
this.shadowRoot.appendChild(style);
|
|
545
|
+
this.shadowRoot.appendChild(this._heading);
|
|
546
|
+
}
|
|
547
|
+
connectedCallback() {
|
|
548
|
+
this._updateElement();
|
|
549
|
+
this._updateClasses();
|
|
550
|
+
}
|
|
551
|
+
attributeChangedCallback(name) {
|
|
552
|
+
if (name === "level") this._updateElement();
|
|
553
|
+
this._updateClasses();
|
|
554
|
+
}
|
|
555
|
+
_updateElement() {
|
|
556
|
+
const tag = `h${this.level}`;
|
|
557
|
+
if (this._heading.tagName.toLowerCase() !== tag) {
|
|
558
|
+
const newHeading = document.createElement(tag);
|
|
559
|
+
newHeading.innerHTML = "<slot></slot>";
|
|
560
|
+
newHeading.className = this._heading.className;
|
|
561
|
+
this.shadowRoot.replaceChild(newHeading, this._heading);
|
|
562
|
+
this._heading = newHeading;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
_updateClasses() {
|
|
566
|
+
const classes = ["dsn-heading", `dsn-heading--${this.appearance}`];
|
|
567
|
+
this._heading.className = classes.join(" ");
|
|
568
|
+
}
|
|
569
|
+
get level() {
|
|
570
|
+
return this.getAttribute("level") || "2";
|
|
571
|
+
}
|
|
572
|
+
set level(value) {
|
|
573
|
+
this.setAttribute("level", value);
|
|
574
|
+
}
|
|
575
|
+
get appearance() {
|
|
576
|
+
return this.getAttribute("appearance") || `heading-${this.level}`;
|
|
577
|
+
}
|
|
578
|
+
set appearance(value) {
|
|
579
|
+
this.setAttribute("appearance", value);
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
function defineHeading(tagName = "dsn-heading") {
|
|
583
|
+
if (!customElements.get(tagName)) customElements.define(tagName, DsnHeading);
|
|
584
|
+
}
|
|
585
|
+
//#endregion
|
|
586
|
+
//#region src/link/link-styles.generated.ts
|
|
587
|
+
const linkStyles = "/**\n * Shadow DOM wrapper styles for the Link Web Component.\n * The core link styles are imported from the shared HTML/CSS source.\n */\n\n:host {\n display: inline;\n}\n\n::slotted(*) {\n pointer-events: none;\n}\n\n/* Shared link styles - single source of truth */\n/**\n * Link Component\n * Uses component tokens for consistent styling\n */\n\n.dsn-link {\n /* Layout */\n display: inline-flex;\n align-self: flex-start;\n align-items: center;\n gap: var(--dsn-link-gap);\n position: relative; /* Ankerpunt voor DotBadge */\n\n /* Typography */\n color: var(--dsn-link-color);\n text-decoration-line: var(--dsn-link-text-decoration-line);\n text-decoration-color: var(--dsn-link-text-decoration-color);\n text-decoration-thickness: var(--dsn-link-text-decoration-thickness);\n text-underline-offset: var(--dsn-link-text-underline-offset);\n font: inherit;\n\n /* Interaction */\n cursor: pointer;\n transition:\n color var(--dsn-transition-duration-normal)\n var(--dsn-transition-easing-default),\n text-decoration-color var(--dsn-transition-duration-normal)\n var(--dsn-transition-easing-default);\n}\n\n/* Icon sizing */\n.dsn-link > .dsn-icon {\n width: var(--dsn-link-icon-size);\n height: var(--dsn-link-icon-size);\n flex-shrink: 0;\n}\n\n/* Size Variants */\n.dsn-link--size-small {\n font-size: var(--dsn-link-size-small-font-size);\n gap: var(--dsn-link-size-small-gap);\n}\n\n.dsn-link--size-default {\n font-size: var(--dsn-link-size-default-font-size);\n gap: var(--dsn-link-size-default-gap);\n}\n\n.dsn-link--size-large {\n font-size: var(--dsn-link-size-large-font-size);\n gap: var(--dsn-link-size-large-gap);\n}\n\n/* Icon sizing per link size */\n.dsn-link--size-small > .dsn-icon {\n width: var(--dsn-link-size-small-icon-size);\n height: var(--dsn-link-size-small-icon-size);\n}\n\n.dsn-link--size-default > .dsn-icon {\n width: var(--dsn-link-size-default-icon-size);\n height: var(--dsn-link-size-default-icon-size);\n}\n\n.dsn-link--size-large > .dsn-icon {\n width: var(--dsn-link-size-large-icon-size);\n height: var(--dsn-link-size-large-icon-size);\n}\n\n/* Hover */\n.dsn-link:hover:not([aria-disabled='true']) {\n color: var(--dsn-link-hover-color);\n text-decoration-line: var(--dsn-link-hover-text-decoration-line);\n}\n\n/* Active */\n.dsn-link:active:not([aria-disabled='true']) {\n color: var(--dsn-link-active-color);\n}\n\n/* Focus */\n.dsn-link:focus-visible {\n background-color: var(--dsn-focus-background-color);\n color: var(--dsn-focus-color);\n text-decoration: none;\n outline: var(--dsn-focus-outline-width) var(--dsn-focus-outline-style)\n var(--dsn-focus-outline-color);\n outline-offset: var(--dsn-focus-outline-offset);\n box-shadow: 0 0 0\n calc(var(--dsn-focus-outline-offset) + var(--dsn-focus-outline-width))\n var(--dsn-focus-inverse-outline-color);\n box-decoration-break: clone;\n}\n\n/* Current page */\n.dsn-link[aria-current='page'] {\n cursor: default;\n text-decoration-line: none;\n}\n\n/* Disabled */\n.dsn-link[aria-disabled='true'] {\n color: var(--dsn-link-disabled-color);\n text-decoration-line: none;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n";
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region src/link/Link.ts
|
|
590
|
+
var DsnLink = class extends HTMLElement {
|
|
591
|
+
static get observedAttributes() {
|
|
592
|
+
return [
|
|
593
|
+
"href",
|
|
594
|
+
"target",
|
|
595
|
+
"rel",
|
|
596
|
+
"disabled",
|
|
597
|
+
"current",
|
|
598
|
+
"size",
|
|
599
|
+
"external"
|
|
600
|
+
];
|
|
601
|
+
}
|
|
602
|
+
constructor() {
|
|
603
|
+
super();
|
|
604
|
+
this._hintNode = null;
|
|
605
|
+
this._hrefBackup = null;
|
|
606
|
+
this.attachShadow({ mode: "open" });
|
|
607
|
+
this._anchor = document.createElement("a");
|
|
608
|
+
this._anchor.classList.add("dsn-link");
|
|
609
|
+
this._anchor.innerHTML = "<slot name=\"icon-start\"></slot><slot></slot><slot name=\"icon-end\"></slot>";
|
|
610
|
+
const style = document.createElement("style");
|
|
611
|
+
style.textContent = linkStyles;
|
|
612
|
+
this.shadowRoot.appendChild(style);
|
|
613
|
+
this.shadowRoot.appendChild(this._anchor);
|
|
614
|
+
}
|
|
615
|
+
connectedCallback() {
|
|
616
|
+
this._updateClasses();
|
|
617
|
+
this._updateHref();
|
|
618
|
+
this._updateTarget();
|
|
619
|
+
this._updateRel();
|
|
620
|
+
this._updateDisabled();
|
|
621
|
+
this._updateCurrent();
|
|
622
|
+
this._updateExternal();
|
|
623
|
+
}
|
|
624
|
+
attributeChangedCallback(name) {
|
|
625
|
+
switch (name) {
|
|
626
|
+
case "href":
|
|
627
|
+
this._updateHref();
|
|
628
|
+
break;
|
|
629
|
+
case "target":
|
|
630
|
+
this._updateTarget();
|
|
631
|
+
break;
|
|
632
|
+
case "rel":
|
|
633
|
+
this._updateRel();
|
|
634
|
+
break;
|
|
635
|
+
case "disabled":
|
|
636
|
+
this._updateDisabled();
|
|
637
|
+
break;
|
|
638
|
+
case "current":
|
|
639
|
+
this._updateCurrent();
|
|
640
|
+
break;
|
|
641
|
+
case "size":
|
|
642
|
+
this._updateClasses();
|
|
643
|
+
break;
|
|
644
|
+
case "external": this._updateExternal();
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
_updateClasses() {
|
|
648
|
+
const classes = ["dsn-link"];
|
|
649
|
+
if (this.hasAttribute("size")) classes.push(`dsn-link--size-${this.size}`);
|
|
650
|
+
this._anchor.className = classes.join(" ");
|
|
651
|
+
}
|
|
652
|
+
_updateHref() {
|
|
653
|
+
if (this.disabled) return;
|
|
654
|
+
const href = this.getAttribute("href");
|
|
655
|
+
if (href) this._anchor.setAttribute("href", href);
|
|
656
|
+
else this._anchor.removeAttribute("href");
|
|
657
|
+
}
|
|
658
|
+
_updateTarget() {
|
|
659
|
+
const target = this.getAttribute("target");
|
|
660
|
+
if (target) this._anchor.setAttribute("target", target);
|
|
661
|
+
else this._anchor.removeAttribute("target");
|
|
662
|
+
}
|
|
663
|
+
_updateRel() {
|
|
664
|
+
const rel = this.getAttribute("rel");
|
|
665
|
+
if (rel) this._anchor.setAttribute("rel", rel);
|
|
666
|
+
else this._anchor.removeAttribute("rel");
|
|
667
|
+
}
|
|
668
|
+
_updateDisabled() {
|
|
669
|
+
if (this.disabled) {
|
|
670
|
+
this._hrefBackup = this._anchor.getAttribute("href");
|
|
671
|
+
this._anchor.removeAttribute("href");
|
|
672
|
+
this._anchor.setAttribute("aria-disabled", "true");
|
|
673
|
+
this._anchor.setAttribute("tabindex", "-1");
|
|
674
|
+
} else {
|
|
675
|
+
this._anchor.removeAttribute("aria-disabled");
|
|
676
|
+
this._anchor.removeAttribute("tabindex");
|
|
677
|
+
if (this._hrefBackup) {
|
|
678
|
+
this._anchor.setAttribute("href", this._hrefBackup);
|
|
679
|
+
this._hrefBackup = null;
|
|
680
|
+
} else this._updateHref();
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
_updateCurrent() {
|
|
684
|
+
if (this.current) this._anchor.setAttribute("aria-current", "page");
|
|
685
|
+
else this._anchor.removeAttribute("aria-current");
|
|
686
|
+
}
|
|
687
|
+
_updateExternal() {
|
|
688
|
+
if (this.external) {
|
|
689
|
+
if (!this.getAttribute("target")) this._anchor.setAttribute("target", "_blank");
|
|
690
|
+
if (!this.getAttribute("rel")) this._anchor.setAttribute("rel", "noopener noreferrer");
|
|
691
|
+
if (!this._hintNode) this._hintNode = document.createTextNode(" (opens in new tab)");
|
|
692
|
+
this._anchor.appendChild(this._hintNode);
|
|
693
|
+
} else {
|
|
694
|
+
if (this._hintNode && this._hintNode.parentNode) this._hintNode.remove();
|
|
695
|
+
this._updateTarget();
|
|
696
|
+
this._updateRel();
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
get href() {
|
|
700
|
+
return this.getAttribute("href");
|
|
701
|
+
}
|
|
702
|
+
set href(value) {
|
|
703
|
+
if (value) this.setAttribute("href", value);
|
|
704
|
+
else this.removeAttribute("href");
|
|
705
|
+
}
|
|
706
|
+
get target() {
|
|
707
|
+
return this.getAttribute("target");
|
|
708
|
+
}
|
|
709
|
+
set target(value) {
|
|
710
|
+
if (value) this.setAttribute("target", value);
|
|
711
|
+
else this.removeAttribute("target");
|
|
712
|
+
}
|
|
713
|
+
get rel() {
|
|
714
|
+
return this.getAttribute("rel");
|
|
715
|
+
}
|
|
716
|
+
set rel(value) {
|
|
717
|
+
if (value) this.setAttribute("rel", value);
|
|
718
|
+
else this.removeAttribute("rel");
|
|
719
|
+
}
|
|
720
|
+
get disabled() {
|
|
721
|
+
return this.hasAttribute("disabled");
|
|
722
|
+
}
|
|
723
|
+
set disabled(value) {
|
|
724
|
+
if (value) this.setAttribute("disabled", "");
|
|
725
|
+
else this.removeAttribute("disabled");
|
|
726
|
+
}
|
|
727
|
+
get current() {
|
|
728
|
+
return this.hasAttribute("current");
|
|
729
|
+
}
|
|
730
|
+
set current(value) {
|
|
731
|
+
if (value) this.setAttribute("current", "");
|
|
732
|
+
else this.removeAttribute("current");
|
|
733
|
+
}
|
|
734
|
+
get external() {
|
|
735
|
+
return this.hasAttribute("external");
|
|
736
|
+
}
|
|
737
|
+
set external(value) {
|
|
738
|
+
if (value) this.setAttribute("external", "");
|
|
739
|
+
else this.removeAttribute("external");
|
|
740
|
+
}
|
|
741
|
+
get size() {
|
|
742
|
+
return this.getAttribute("size") || "default";
|
|
743
|
+
}
|
|
744
|
+
set size(value) {
|
|
745
|
+
this.setAttribute("size", value);
|
|
746
|
+
}
|
|
747
|
+
focus(options) {
|
|
748
|
+
this._anchor.focus(options);
|
|
749
|
+
}
|
|
750
|
+
blur() {
|
|
751
|
+
this._anchor.blur();
|
|
752
|
+
}
|
|
753
|
+
click() {
|
|
754
|
+
this._anchor.click();
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
function defineLink(tagName = "dsn-link") {
|
|
758
|
+
if (!customElements.get(tagName)) customElements.define(tagName, DsnLink);
|
|
759
|
+
}
|
|
760
|
+
//#endregion
|
|
761
|
+
//#region src/unordered-list/unordered-list-styles.generated.ts
|
|
762
|
+
const unorderedListStyles = "/**\n * Shadow DOM wrapper styles for the UnorderedList Web Component.\n * The core styles are imported from the shared HTML/CSS source.\n */\n\n:host {\n display: block;\n}\n\n/* Shared unordered list styles - single source of truth */\n/**\n * Unordered List Component\n * Uses component tokens for consistent styling.\n * Bullet markers are colored via the marker-color token.\n */\n\n.dsn-unordered-list {\n font-family: var(--dsn-unordered-list-font-family);\n font-weight: var(--dsn-unordered-list-font-weight);\n color: var(--dsn-unordered-list-color);\n font-size: var(--dsn-unordered-list-font-size);\n line-height: var(--dsn-unordered-list-line-height);\n max-inline-size: var(--dsn-unordered-list-max-inline-size);\n padding-inline-start: var(--dsn-unordered-list-padding-inline-start);\n margin-block-start: 0;\n margin-block-end: var(--dsn-unordered-list-margin-block-end);\n list-style-type: disc;\n}\n\n/* Colored bullet markers */\n.dsn-unordered-list ::marker {\n color: var(--dsn-unordered-list-marker-color);\n}\n\n/* Spacing between list items */\n.dsn-unordered-list > li {\n margin-block-end: var(--dsn-unordered-list-gap);\n}\n\n.dsn-unordered-list > li:last-child {\n margin-block-end: 0;\n}\n\n";
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region src/unordered-list/UnorderedList.ts
|
|
765
|
+
/**
|
|
766
|
+
* DSN Unordered List Web Component
|
|
767
|
+
*
|
|
768
|
+
* A custom element that provides a styled unordered list with accent-colored bullet markers.
|
|
769
|
+
* Uses the same CSS classes and design tokens as the HTML and React components.
|
|
770
|
+
*
|
|
771
|
+
* @example
|
|
772
|
+
* ```html
|
|
773
|
+
* <dsn-unordered-list>
|
|
774
|
+
* <li>First item</li>
|
|
775
|
+
* <li>Second item</li>
|
|
776
|
+
* <li>Third item</li>
|
|
777
|
+
* </dsn-unordered-list>
|
|
778
|
+
* ```
|
|
779
|
+
*/
|
|
780
|
+
var DsnUnorderedList = class extends HTMLElement {
|
|
781
|
+
constructor() {
|
|
782
|
+
super();
|
|
783
|
+
this.attachShadow({ mode: "open" });
|
|
784
|
+
this._list = document.createElement("ul");
|
|
785
|
+
this._list.classList.add("dsn-unordered-list");
|
|
786
|
+
this._list.innerHTML = "<slot></slot>";
|
|
787
|
+
const style = document.createElement("style");
|
|
788
|
+
style.textContent = unorderedListStyles;
|
|
789
|
+
this.shadowRoot.appendChild(style);
|
|
790
|
+
this.shadowRoot.appendChild(this._list);
|
|
791
|
+
}
|
|
792
|
+
connectedCallback() {
|
|
793
|
+
this._list.className = "dsn-unordered-list";
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
function defineUnorderedList(tagName = "dsn-unordered-list") {
|
|
797
|
+
if (!customElements.get(tagName)) customElements.define(tagName, DsnUnorderedList);
|
|
798
|
+
}
|
|
799
|
+
//#endregion
|
|
800
|
+
//#region src/ordered-list/ordered-list-styles.generated.ts
|
|
801
|
+
const orderedListStyles = "/**\n * Shadow DOM wrapper styles for the OrderedList Web Component.\n * The core styles are imported from the shared HTML/CSS source.\n */\n\n:host {\n display: block;\n}\n\n/* Shared ordered list styles - single source of truth */\n/**\n * Ordered List Component\n * Uses component tokens for consistent styling.\n */\n\n.dsn-ordered-list {\n font-family: var(--dsn-ordered-list-font-family);\n font-weight: var(--dsn-ordered-list-font-weight);\n color: var(--dsn-ordered-list-color);\n font-size: var(--dsn-ordered-list-font-size);\n line-height: var(--dsn-ordered-list-line-height);\n max-inline-size: var(--dsn-ordered-list-max-inline-size);\n padding-inline-start: var(--dsn-ordered-list-padding-inline-start);\n margin-block-start: 0;\n margin-block-end: var(--dsn-ordered-list-margin-block-end);\n list-style-type: decimal;\n}\n\n/* Number markers */\n.dsn-ordered-list ::marker {\n color: var(--dsn-ordered-list-marker-color);\n}\n\n/* Spacing between list items */\n.dsn-ordered-list > li {\n margin-block-end: var(--dsn-ordered-list-gap);\n}\n\n.dsn-ordered-list > li:last-child {\n margin-block-end: 0;\n}\n\n";
|
|
802
|
+
//#endregion
|
|
803
|
+
//#region src/ordered-list/OrderedList.ts
|
|
804
|
+
/**
|
|
805
|
+
* DSN Ordered List Web Component
|
|
806
|
+
*
|
|
807
|
+
* A custom element that provides a styled ordered list with numbered markers.
|
|
808
|
+
* Uses the same CSS classes and design tokens as the HTML and React components.
|
|
809
|
+
*
|
|
810
|
+
* @example
|
|
811
|
+
* ```html
|
|
812
|
+
* <dsn-ordered-list>
|
|
813
|
+
* <li>First step</li>
|
|
814
|
+
* <li>Second step</li>
|
|
815
|
+
* <li>Third step</li>
|
|
816
|
+
* </dsn-ordered-list>
|
|
817
|
+
*
|
|
818
|
+
* <dsn-ordered-list start="5">
|
|
819
|
+
* <li>Fifth step</li>
|
|
820
|
+
* <li>Sixth step</li>
|
|
821
|
+
* </dsn-ordered-list>
|
|
822
|
+
* ```
|
|
823
|
+
*/
|
|
824
|
+
var DsnOrderedList = class extends HTMLElement {
|
|
825
|
+
static get observedAttributes() {
|
|
826
|
+
return ["start"];
|
|
827
|
+
}
|
|
828
|
+
constructor() {
|
|
829
|
+
super();
|
|
830
|
+
this.attachShadow({ mode: "open" });
|
|
831
|
+
this._list = document.createElement("ol");
|
|
832
|
+
this._list.classList.add("dsn-ordered-list");
|
|
833
|
+
this._list.innerHTML = "<slot></slot>";
|
|
834
|
+
const style = document.createElement("style");
|
|
835
|
+
style.textContent = orderedListStyles;
|
|
836
|
+
this.shadowRoot.appendChild(style);
|
|
837
|
+
this.shadowRoot.appendChild(this._list);
|
|
838
|
+
}
|
|
839
|
+
connectedCallback() {
|
|
840
|
+
this._list.className = "dsn-ordered-list";
|
|
841
|
+
this._updateStart();
|
|
842
|
+
}
|
|
843
|
+
attributeChangedCallback(name) {
|
|
844
|
+
if (name === "start") this._updateStart();
|
|
845
|
+
}
|
|
846
|
+
_updateStart() {
|
|
847
|
+
const start = this.getAttribute("start");
|
|
848
|
+
if (start) this._list.setAttribute("start", start);
|
|
849
|
+
else this._list.removeAttribute("start");
|
|
850
|
+
}
|
|
851
|
+
get start() {
|
|
852
|
+
return parseInt(this.getAttribute("start") || "1", 10);
|
|
853
|
+
}
|
|
854
|
+
set start(value) {
|
|
855
|
+
this.setAttribute("start", String(value));
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
function defineOrderedList(tagName = "dsn-ordered-list") {
|
|
859
|
+
if (!customElements.get(tagName)) customElements.define(tagName, DsnOrderedList);
|
|
860
|
+
}
|
|
861
|
+
//#endregion
|
|
862
|
+
//#region src/index.ts
|
|
863
|
+
/**
|
|
864
|
+
* @dsn-starter-kit/components-web
|
|
865
|
+
* Web Components for the design system
|
|
866
|
+
*
|
|
867
|
+
* This package exports Web Components that can be registered manually or all at once.
|
|
868
|
+
* Components are NOT auto-registered on import - you must explicitly register them.
|
|
869
|
+
*
|
|
870
|
+
* @example Register all components at once
|
|
871
|
+
* ```ts
|
|
872
|
+
* import { defineAllComponents } from '@dsn-starter-kit/components-web';
|
|
873
|
+
* defineAllComponents();
|
|
874
|
+
* ```
|
|
875
|
+
*
|
|
876
|
+
* @example Register specific components
|
|
877
|
+
* ```ts
|
|
878
|
+
* import { defineButton, defineIcon } from '@dsn-starter-kit/components-web';
|
|
879
|
+
* defineButton();
|
|
880
|
+
* defineIcon();
|
|
881
|
+
* ```
|
|
882
|
+
*
|
|
883
|
+
* @example Register with custom tag names
|
|
884
|
+
* ```ts
|
|
885
|
+
* import { defineButton } from '@dsn-starter-kit/components-web';
|
|
886
|
+
* defineButton('my-custom-button');
|
|
887
|
+
* ```
|
|
888
|
+
*/
|
|
889
|
+
/**
|
|
890
|
+
* Register all components with their default tag names.
|
|
891
|
+
* Call this once in your application entry point.
|
|
892
|
+
*
|
|
893
|
+
* Default tag names:
|
|
894
|
+
* - dsn-button
|
|
895
|
+
* - dsn-icon
|
|
896
|
+
* - dsn-paragraph
|
|
897
|
+
* - dsn-heading
|
|
898
|
+
* - dsn-link
|
|
899
|
+
* - dsn-unordered-list
|
|
900
|
+
* - dsn-ordered-list
|
|
901
|
+
*/
|
|
902
|
+
function defineAllComponents() {
|
|
903
|
+
defineButton();
|
|
904
|
+
defineIcon();
|
|
905
|
+
defineParagraph();
|
|
906
|
+
defineHeading();
|
|
907
|
+
defineLink();
|
|
908
|
+
defineUnorderedList();
|
|
909
|
+
defineOrderedList();
|
|
910
|
+
}
|
|
911
|
+
//#endregion
|
|
912
|
+
export { DsnButton, DsnHeading, DsnIcon, DsnLink, DsnOrderedList, DsnParagraph, DsnUnorderedList, defineAllComponents, defineButton, defineHeading, defineIcon, defineLink, defineOrderedList, defineParagraph, defineUnorderedList };
|
|
913
|
+
|
|
914
|
+
//# sourceMappingURL=index.mjs.map
|