zdp-design-system 0.43.8

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 (110) hide show
  1. package/CHANGELOG.md +449 -0
  2. package/LICENSE +21 -0
  3. package/README.md +568 -0
  4. package/THIRD_PARTY_NOTICES.md +34 -0
  5. package/dist/code.ts +2 -0
  6. package/dist/combobox.ts +9 -0
  7. package/dist/command.ts +1 -0
  8. package/dist/components/Accordion.svelte +97 -0
  9. package/dist/components/Avatar.svelte +90 -0
  10. package/dist/components/Badge.svelte +61 -0
  11. package/dist/components/Breadcrumb.svelte +97 -0
  12. package/dist/components/Button.svelte +163 -0
  13. package/dist/components/Callout.svelte +81 -0
  14. package/dist/components/Card.svelte +151 -0
  15. package/dist/components/CardHeader.svelte +58 -0
  16. package/dist/components/Checkbox.svelte +135 -0
  17. package/dist/components/CodeBlock.svelte +247 -0
  18. package/dist/components/Combobox.svelte +552 -0
  19. package/dist/components/CommandField.svelte +230 -0
  20. package/dist/components/ConfirmAction.svelte +307 -0
  21. package/dist/components/Container.svelte +63 -0
  22. package/dist/components/Dialog.svelte +303 -0
  23. package/dist/components/Disclosure.svelte +176 -0
  24. package/dist/components/Divider.svelte +41 -0
  25. package/dist/components/EmptyState.svelte +79 -0
  26. package/dist/components/ErrorText.svelte +18 -0
  27. package/dist/components/Field.svelte +38 -0
  28. package/dist/components/Grid.svelte +76 -0
  29. package/dist/components/HelpText.svelte +17 -0
  30. package/dist/components/Icon.svelte +45 -0
  31. package/dist/components/IconButton.svelte +162 -0
  32. package/dist/components/IdentityChip.svelte +130 -0
  33. package/dist/components/Inline.svelte +85 -0
  34. package/dist/components/InlineCode.svelte +27 -0
  35. package/dist/components/Input.svelte +109 -0
  36. package/dist/components/Kbd.svelte +63 -0
  37. package/dist/components/KeyValue.svelte +73 -0
  38. package/dist/components/Label.svelte +43 -0
  39. package/dist/components/Link.svelte +70 -0
  40. package/dist/components/LocaleSwitcher.svelte +209 -0
  41. package/dist/components/Menu.svelte +491 -0
  42. package/dist/components/Page.svelte +36 -0
  43. package/dist/components/PageHeader.svelte +93 -0
  44. package/dist/components/Pagination.svelte +297 -0
  45. package/dist/components/Popover.svelte +208 -0
  46. package/dist/components/Progress.svelte +111 -0
  47. package/dist/components/Radio.svelte +132 -0
  48. package/dist/components/Section.svelte +52 -0
  49. package/dist/components/SegmentedControl.svelte +190 -0
  50. package/dist/components/Select.svelte +88 -0
  51. package/dist/components/ShareDock.svelte +304 -0
  52. package/dist/components/Sheet.svelte +332 -0
  53. package/dist/components/ShortcutHint.svelte +52 -0
  54. package/dist/components/Skeleton.svelte +82 -0
  55. package/dist/components/SkipLink.svelte +40 -0
  56. package/dist/components/SortHeader.svelte +138 -0
  57. package/dist/components/Spinner.svelte +82 -0
  58. package/dist/components/Stack.svelte +62 -0
  59. package/dist/components/StatusToast.svelte +133 -0
  60. package/dist/components/Surface.svelte +53 -0
  61. package/dist/components/Switch.svelte +152 -0
  62. package/dist/components/Table.svelte +94 -0
  63. package/dist/components/TableToolbar.svelte +195 -0
  64. package/dist/components/Tabs.svelte +205 -0
  65. package/dist/components/TermSheet.svelte +392 -0
  66. package/dist/components/TermTrigger.svelte +70 -0
  67. package/dist/components/TextScaleControl.svelte +219 -0
  68. package/dist/components/Textarea.svelte +106 -0
  69. package/dist/components/ThemeToggle.svelte +148 -0
  70. package/dist/components/Toast.svelte +180 -0
  71. package/dist/components/Toolbar.svelte +83 -0
  72. package/dist/components/Tooltip.svelte +199 -0
  73. package/dist/components/VisuallyHidden.svelte +18 -0
  74. package/dist/disclosure.ts +11 -0
  75. package/dist/focusable.ts +36 -0
  76. package/dist/identity.ts +5 -0
  77. package/dist/index.d.ts +106 -0
  78. package/dist/index.js +76 -0
  79. package/dist/index.ts +106 -0
  80. package/dist/menu.ts +12 -0
  81. package/dist/modal-layer.ts +108 -0
  82. package/dist/pagination.ts +10 -0
  83. package/dist/preferences.js +14 -0
  84. package/dist/preferences.ts +36 -0
  85. package/dist/progress.ts +4 -0
  86. package/dist/schemas/design-tokens.schema.json +119 -0
  87. package/dist/segmented.ts +8 -0
  88. package/dist/share.d.ts +48 -0
  89. package/dist/share.js +115 -0
  90. package/dist/share.ts +99 -0
  91. package/dist/sheet.ts +3 -0
  92. package/dist/shortcuts.js +125 -0
  93. package/dist/shortcuts.ts +153 -0
  94. package/dist/styles/brand-fonts.css +10 -0
  95. package/dist/styles/components.css +4686 -0
  96. package/dist/styles/expressive-fonts.css +2 -0
  97. package/dist/styles/index.css +2 -0
  98. package/dist/styles/locale-fonts.css +4 -0
  99. package/dist/styles/tokens.css +413 -0
  100. package/dist/table-tools.ts +10 -0
  101. package/dist/term.ts +16 -0
  102. package/dist/theme.ts +2 -0
  103. package/dist/toast.ts +14 -0
  104. package/dist/tokens/zdp.tokens.json +241 -0
  105. package/dist/tokens.js +122 -0
  106. package/dist/tokens.ts +123 -0
  107. package/docs/CONSUMER_CONTRACT.md +482 -0
  108. package/docs/EXTERNAL_UI_ADOPTION.md +141 -0
  109. package/docs/INTERACTIVE_PRIMITIVE_AUDIT.md +127 -0
  110. package/package.json +78 -0
@@ -0,0 +1,76 @@
1
+ <script lang="ts">
2
+ export let as: 'div' | 'section' | 'ul' | 'ol' = 'div';
3
+ export let columns: 'one' | 'two' | 'three' | 'four' | 'auto' = 'auto';
4
+ export let gap: 'sm' | 'md' | 'lg' | 'xl' = 'md';
5
+ export let labelledBy: string | null = null;
6
+
7
+ $: labelledGroupRole = as === 'div' && labelledBy ? 'group' : undefined;
8
+ </script>
9
+
10
+ <svelte:element
11
+ this={as}
12
+ class={`zdp-grid zdp-grid--columns-${columns} zdp-grid--gap-${gap}`}
13
+ role={labelledGroupRole}
14
+ aria-labelledby={labelledBy ?? undefined}
15
+ >
16
+ <slot />
17
+ </svelte:element>
18
+
19
+ <style>
20
+ .zdp-grid {
21
+ display: grid;
22
+ gap: var(--zdp-space-4);
23
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
24
+ min-width: 0;
25
+ }
26
+
27
+ .zdp-grid--columns-one {
28
+ grid-template-columns: 1fr;
29
+ }
30
+
31
+ .zdp-grid--columns-two {
32
+ grid-template-columns: repeat(2, minmax(0, 1fr));
33
+ }
34
+
35
+ .zdp-grid--columns-three {
36
+ grid-template-columns: repeat(3, minmax(0, 1fr));
37
+ }
38
+
39
+ .zdp-grid--columns-four {
40
+ grid-template-columns: repeat(4, minmax(0, 1fr));
41
+ }
42
+
43
+ .zdp-grid--columns-auto {
44
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
45
+ }
46
+
47
+ .zdp-grid--gap-sm {
48
+ gap: var(--zdp-space-2);
49
+ }
50
+
51
+ .zdp-grid--gap-md {
52
+ gap: var(--zdp-space-4);
53
+ }
54
+
55
+ .zdp-grid--gap-lg {
56
+ gap: var(--zdp-space-6);
57
+ }
58
+
59
+ .zdp-grid--gap-xl {
60
+ gap: var(--zdp-space-8);
61
+ }
62
+
63
+ @media (max-width: 64rem) {
64
+ .zdp-grid--columns-four {
65
+ grid-template-columns: repeat(2, minmax(0, 1fr));
66
+ }
67
+ }
68
+
69
+ @media (max-width: 42rem) {
70
+ .zdp-grid--columns-two,
71
+ .zdp-grid--columns-three,
72
+ .zdp-grid--columns-four {
73
+ grid-template-columns: 1fr;
74
+ }
75
+ }
76
+ </style>
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ export let id: string | null = null;
3
+ </script>
4
+
5
+ <p class="zdp-help-text" id={id ?? undefined}>
6
+ <slot />
7
+ </p>
8
+
9
+ <style>
10
+ .zdp-help-text {
11
+ color: var(--zdp-color-ink-muted);
12
+ font-family: var(--zdp-font-family-sans);
13
+ font-size: var(--zdp-type-caption-size);
14
+ line-height: var(--zdp-type-caption-line-height);
15
+ margin: 0;
16
+ }
17
+ </style>
@@ -0,0 +1,45 @@
1
+ <script lang="ts">
2
+ export let size: 'sm' | 'md' = 'md';
3
+ export let label: string | null = null;
4
+ </script>
5
+
6
+ <span
7
+ class={`zdp-icon zdp-icon--${size}`}
8
+ role={label ? 'img' : undefined}
9
+ aria-label={label ?? undefined}
10
+ aria-hidden={label ? undefined : 'true'}
11
+ >
12
+ <slot />
13
+ </span>
14
+
15
+ <style>
16
+ .zdp-icon {
17
+ align-items: center;
18
+ display: inline-flex;
19
+ flex: 0 0 auto;
20
+ justify-content: center;
21
+ line-height: 1;
22
+ text-align: center;
23
+ -webkit-user-select: none;
24
+ user-select: none;
25
+ }
26
+
27
+ .zdp-icon--sm {
28
+ font-size: var(--zdp-control-glyph-sm);
29
+ height: var(--zdp-control-glyph-sm);
30
+ width: var(--zdp-control-glyph-sm);
31
+ }
32
+
33
+ .zdp-icon--md {
34
+ font-size: var(--zdp-control-glyph-md);
35
+ height: var(--zdp-control-glyph-md);
36
+ width: var(--zdp-control-glyph-md);
37
+ }
38
+
39
+ .zdp-icon :global(svg) {
40
+ display: block;
41
+ flex: 0 0 auto;
42
+ height: 100%;
43
+ width: 100%;
44
+ }
45
+ </style>
@@ -0,0 +1,162 @@
1
+ <script lang="ts">
2
+ export let ariaLabel: string;
3
+ export let title: string | null = null;
4
+ export let variant: 'ghost' | 'solid' = 'ghost';
5
+ export let size: 'sm' | 'md' = 'md';
6
+ export let type: 'button' | 'submit' | 'reset' = 'button';
7
+ export let disabled = false;
8
+ export let id: string | null = null;
9
+ export let name: string | null = null;
10
+ export let value: string | null = null;
11
+ export let form: string | null = null;
12
+ export let ariaControls: string | null = null;
13
+ export let ariaDescribedBy: string | null = null;
14
+ export let ariaExpanded: boolean | null = null;
15
+ export let ariaPressed: boolean | null = null;
16
+ export let ariaKeyShortcuts: string | null = null;
17
+ export let onclick: ((event: MouseEvent) => void) | null = null;
18
+ </script>
19
+
20
+ <button
21
+ class={`zdp-icon-button zdp-icon-button--${variant} zdp-icon-button--${size}`}
22
+ {id}
23
+ {name}
24
+ {value}
25
+ {form}
26
+ aria-label={ariaLabel}
27
+ title={title ?? ariaLabel}
28
+ {type}
29
+ {disabled}
30
+ aria-controls={ariaControls ?? undefined}
31
+ aria-describedby={ariaDescribedBy ?? undefined}
32
+ aria-expanded={ariaExpanded ?? undefined}
33
+ aria-pressed={ariaPressed ?? undefined}
34
+ aria-keyshortcuts={ariaKeyShortcuts ?? undefined}
35
+ onclick={onclick ?? undefined}
36
+ >
37
+ <span class={`zdp-icon zdp-icon--${size} zdp-icon-button__glyph`} aria-hidden="true">
38
+ <slot />
39
+ </span>
40
+ </button>
41
+
42
+ <style>
43
+ .zdp-icon-button {
44
+ align-items: center;
45
+ border: var(--zdp-control-border-width) solid var(--zdp-color-line-strong);
46
+ border-radius: var(--zdp-control-radius);
47
+ cursor: pointer;
48
+ display: inline-flex;
49
+ font-family: var(--zdp-font-family-sans);
50
+ font-weight: var(--zdp-font-weight-regular);
51
+ justify-content: center;
52
+ transition:
53
+ background-color var(--zdp-motion-fast) ease,
54
+ border-color var(--zdp-motion-fast) ease,
55
+ color var(--zdp-motion-fast) ease;
56
+ -webkit-user-select: none;
57
+ user-select: none;
58
+ }
59
+
60
+ .zdp-icon-button--sm {
61
+ height: var(--zdp-control-icon-sm);
62
+ width: var(--zdp-control-icon-sm);
63
+ }
64
+
65
+ .zdp-icon-button--md {
66
+ height: var(--zdp-control-icon-md);
67
+ width: var(--zdp-control-icon-md);
68
+ }
69
+
70
+ .zdp-icon-button--ghost {
71
+ background: var(--zdp-color-surface-panel);
72
+ border-color: var(--zdp-color-line-subtle);
73
+ color: var(--zdp-color-ink-normal);
74
+ }
75
+
76
+ .zdp-icon-button--ghost:hover:not(:disabled) {
77
+ background: var(--zdp-color-surface-raised);
78
+ border-color: var(--zdp-color-line-strong);
79
+ color: var(--zdp-color-ink-strong);
80
+ }
81
+
82
+ :global([data-zdp-theme="dark"]) .zdp-icon-button--ghost {
83
+ background: var(--zdp-color-surface-panel);
84
+ border-color: var(--zdp-color-line-subtle);
85
+ color: var(--zdp-color-ink-muted);
86
+ }
87
+
88
+ :global([data-zdp-theme="dark"]) .zdp-icon-button--ghost:hover:not(:disabled) {
89
+ background: var(--zdp-color-surface-raised);
90
+ border-color: var(--zdp-color-line-strong);
91
+ color: var(--zdp-color-ink-strong);
92
+ }
93
+
94
+ .zdp-icon-button--ghost:active:not(:disabled) {
95
+ background: var(--zdp-color-surface-raised);
96
+ border-color: var(--zdp-color-line-strong);
97
+ color: var(--zdp-color-ink-strong);
98
+ }
99
+
100
+ .zdp-icon-button--solid {
101
+ background: var(--zdp-color-accent-primary);
102
+ border-color: var(--zdp-color-accent-primary-strong);
103
+ color: var(--zdp-color-ink-strong);
104
+ }
105
+
106
+ .zdp-icon-button--solid:hover:not(:disabled) {
107
+ background: var(--zdp-color-accent-primary-strong);
108
+ border-color: var(--zdp-color-accent-primary-strong);
109
+ }
110
+
111
+ .zdp-icon-button--solid:active:not(:disabled) {
112
+ background: var(--zdp-color-accent-primary-strong);
113
+ border-color: var(--zdp-color-accent-primary-strong);
114
+ }
115
+
116
+ :global([data-zdp-theme="dark"]) .zdp-icon-button--solid {
117
+ color: var(--zdp-color-ink-inverse);
118
+ }
119
+
120
+ .zdp-icon-button:focus-visible {
121
+ border-color: var(--zdp-color-focus-line);
122
+ outline: var(--zdp-control-focus-outline-width) solid var(--zdp-color-focus-surface);
123
+ outline-offset: var(--zdp-control-focus-outline-offset);
124
+ }
125
+
126
+ .zdp-icon-button:disabled {
127
+ cursor: not-allowed;
128
+ opacity: 0.56;
129
+ }
130
+
131
+ .zdp-icon,
132
+ .zdp-icon-button__glyph {
133
+ align-items: center;
134
+ display: inline-flex;
135
+ flex: 0 0 auto;
136
+ justify-content: center;
137
+ line-height: 1;
138
+ text-align: center;
139
+ -webkit-user-select: none;
140
+ user-select: none;
141
+ }
142
+
143
+ .zdp-icon--sm {
144
+ font-size: var(--zdp-control-glyph-sm);
145
+ height: var(--zdp-control-glyph-sm);
146
+ width: var(--zdp-control-glyph-sm);
147
+ }
148
+
149
+ .zdp-icon--md {
150
+ font-size: var(--zdp-control-glyph-md);
151
+ height: var(--zdp-control-glyph-md);
152
+ width: var(--zdp-control-glyph-md);
153
+ }
154
+
155
+ .zdp-icon :global(svg),
156
+ .zdp-icon-button__glyph :global(svg) {
157
+ display: block;
158
+ flex: 0 0 auto;
159
+ height: 100%;
160
+ width: 100%;
161
+ }
162
+ </style>
@@ -0,0 +1,130 @@
1
+ <script lang="ts">
2
+ import Avatar from './Avatar.svelte';
3
+ import type { ZdpIdentityChipAriaCurrent, ZdpIdentityChipSize } from '../identity';
4
+
5
+ export let label = 'User';
6
+ export let description: string | null = null;
7
+ export let initials: string | null = null;
8
+ export let imageSrc: string | null = null;
9
+ export let href: string | null = null;
10
+ export let size: ZdpIdentityChipSize = 'md';
11
+ export let selected = false;
12
+ export let ariaLabel: string | null = null;
13
+ export let ariaCurrent: ZdpIdentityChipAriaCurrent | null = null;
14
+
15
+ $: chipClass = `zdp-identity-chip zdp-identity-chip--${size} ${href ? 'zdp-identity-chip--link' : ''}`;
16
+ </script>
17
+
18
+ {#if href}
19
+ <a
20
+ class={chipClass}
21
+ href={href}
22
+ aria-label={ariaLabel ?? undefined}
23
+ aria-current={ariaCurrent ?? undefined}
24
+ data-selected={selected ? 'true' : undefined}
25
+ >
26
+ <Avatar label={label} initials={initials} imageSrc={imageSrc} size={size} decorative />
27
+ <span class="zdp-identity-chip__body">
28
+ <span class="zdp-identity-chip__label">{label}</span>
29
+ {#if description}
30
+ <span class="zdp-identity-chip__description">{description}</span>
31
+ {/if}
32
+ </span>
33
+ </a>
34
+ {:else}
35
+ <span
36
+ class={chipClass}
37
+ role={ariaLabel ? 'group' : undefined}
38
+ aria-label={ariaLabel ?? undefined}
39
+ data-selected={selected ? 'true' : undefined}
40
+ >
41
+ <Avatar label={label} initials={initials} imageSrc={imageSrc} size={size} decorative />
42
+ <span class="zdp-identity-chip__body">
43
+ <span class="zdp-identity-chip__label">{label}</span>
44
+ {#if description}
45
+ <span class="zdp-identity-chip__description">{description}</span>
46
+ {/if}
47
+ </span>
48
+ </span>
49
+ {/if}
50
+
51
+ <style>
52
+ .zdp-identity-chip {
53
+ align-items: center;
54
+ background: var(--zdp-color-surface-panel);
55
+ border: var(--zdp-control-border-width) solid var(--zdp-color-line-subtle);
56
+ border-radius: var(--zdp-control-radius);
57
+ box-sizing: border-box;
58
+ color: var(--zdp-color-ink-normal);
59
+ display: inline-flex;
60
+ font-family: var(--zdp-font-family-sans);
61
+ gap: var(--zdp-space-2);
62
+ max-width: 100%;
63
+ min-width: 0;
64
+ text-align: start;
65
+ text-decoration: none;
66
+ vertical-align: middle;
67
+ }
68
+
69
+ .zdp-identity-chip--sm {
70
+ min-height: var(--zdp-control-height-md);
71
+ padding: var(--zdp-space-1) var(--zdp-space-2);
72
+ }
73
+
74
+ .zdp-identity-chip--md {
75
+ min-height: calc(var(--zdp-control-height-md) + var(--zdp-space-2));
76
+ padding: var(--zdp-space-2) var(--zdp-space-3);
77
+ }
78
+
79
+ .zdp-identity-chip--link {
80
+ cursor: pointer;
81
+ transition:
82
+ background-color var(--zdp-motion-fast) ease,
83
+ border-color var(--zdp-motion-fast) ease,
84
+ color var(--zdp-motion-fast) ease;
85
+ }
86
+
87
+ .zdp-identity-chip--link:hover {
88
+ background: var(--zdp-color-surface-raised);
89
+ border-color: var(--zdp-color-line-strong);
90
+ color: var(--zdp-color-ink-strong);
91
+ }
92
+
93
+ .zdp-identity-chip--link:focus-visible {
94
+ border-color: var(--zdp-color-focus-line);
95
+ outline: var(--zdp-control-focus-outline-width) solid var(--zdp-color-focus-surface);
96
+ outline-offset: var(--zdp-control-focus-outline-offset);
97
+ }
98
+
99
+ .zdp-identity-chip[data-selected='true'],
100
+ .zdp-identity-chip[aria-current] {
101
+ border-color: var(--zdp-color-accent-primary-strong);
102
+ color: var(--zdp-color-ink-strong);
103
+ }
104
+
105
+ .zdp-identity-chip__body {
106
+ display: grid;
107
+ gap: var(--zdp-space-1);
108
+ min-width: 0;
109
+ }
110
+
111
+ .zdp-identity-chip__label,
112
+ .zdp-identity-chip__description {
113
+ display: block;
114
+ min-width: 0;
115
+ overflow-wrap: var(--zdp-i18n-overflow-wrap);
116
+ }
117
+
118
+ .zdp-identity-chip__label {
119
+ color: var(--zdp-color-ink-strong);
120
+ font-size: var(--zdp-type-body-small-size);
121
+ font-weight: var(--zdp-font-weight-medium);
122
+ line-height: var(--zdp-type-body-small-line-height);
123
+ }
124
+
125
+ .zdp-identity-chip__description {
126
+ color: var(--zdp-color-ink-muted);
127
+ font-size: var(--zdp-type-caption-size);
128
+ line-height: var(--zdp-type-caption-line-height);
129
+ }
130
+ </style>
@@ -0,0 +1,85 @@
1
+ <script lang="ts">
2
+ export let as: 'div' | 'section' | 'nav' | 'header' | 'footer' = 'div';
3
+ export let gap: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md';
4
+ export let align: 'stretch' | 'start' | 'center' | 'end' | 'baseline' = 'center';
5
+ export let justify: 'start' | 'center' | 'end' | 'between' = 'start';
6
+ export let labelledBy: string | null = null;
7
+
8
+ $: labelledGroupRole = as === 'div' && labelledBy ? 'group' : undefined;
9
+ </script>
10
+
11
+ <svelte:element
12
+ this={as}
13
+ class={`zdp-inline zdp-inline--gap-${gap} zdp-inline--align-${align} zdp-inline--justify-${justify}`}
14
+ role={labelledGroupRole}
15
+ aria-labelledby={labelledBy ?? undefined}
16
+ >
17
+ <slot />
18
+ </svelte:element>
19
+
20
+ <style>
21
+ .zdp-inline {
22
+ align-items: center;
23
+ display: flex;
24
+ flex-wrap: wrap;
25
+ gap: var(--zdp-space-3);
26
+ justify-content: flex-start;
27
+ min-width: 0;
28
+ }
29
+
30
+ .zdp-inline--gap-xs {
31
+ gap: var(--zdp-space-1);
32
+ }
33
+
34
+ .zdp-inline--gap-sm {
35
+ gap: var(--zdp-space-2);
36
+ }
37
+
38
+ .zdp-inline--gap-md {
39
+ gap: var(--zdp-space-3);
40
+ }
41
+
42
+ .zdp-inline--gap-lg {
43
+ gap: var(--zdp-space-4);
44
+ }
45
+
46
+ .zdp-inline--gap-xl {
47
+ gap: var(--zdp-space-6);
48
+ }
49
+
50
+ .zdp-inline--align-stretch {
51
+ align-items: stretch;
52
+ }
53
+
54
+ .zdp-inline--align-start {
55
+ align-items: flex-start;
56
+ }
57
+
58
+ .zdp-inline--align-center {
59
+ align-items: center;
60
+ }
61
+
62
+ .zdp-inline--align-end {
63
+ align-items: flex-end;
64
+ }
65
+
66
+ .zdp-inline--align-baseline {
67
+ align-items: baseline;
68
+ }
69
+
70
+ .zdp-inline--justify-start {
71
+ justify-content: flex-start;
72
+ }
73
+
74
+ .zdp-inline--justify-center {
75
+ justify-content: center;
76
+ }
77
+
78
+ .zdp-inline--justify-end {
79
+ justify-content: flex-end;
80
+ }
81
+
82
+ .zdp-inline--justify-between {
83
+ justify-content: space-between;
84
+ }
85
+ </style>
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ export let text: string | null = null;
3
+ export let ariaLabel: string | null = null;
4
+ </script>
5
+
6
+ <code class="zdp-inline-code" aria-label={ariaLabel ?? undefined}>
7
+ {#if text !== null}
8
+ {text}
9
+ {:else}
10
+ <slot />
11
+ {/if}
12
+ </code>
13
+
14
+ <style>
15
+ .zdp-inline-code {
16
+ background: var(--zdp-color-surface-raised);
17
+ border: var(--zdp-control-border-width) solid var(--zdp-color-line-subtle);
18
+ border-radius: var(--zdp-radius-sm);
19
+ box-decoration-break: clone;
20
+ color: var(--zdp-color-ink-strong);
21
+ font-family: var(--zdp-font-family-mono);
22
+ font-size: 0.92em;
23
+ line-height: 1.4;
24
+ padding: 0.05em 0.36em;
25
+ word-break: break-word;
26
+ }
27
+ </style>
@@ -0,0 +1,109 @@
1
+ <script lang="ts">
2
+ import type { HTMLInputAttributes } from 'svelte/elements';
3
+
4
+ type DescribedBy = string | readonly string[] | null;
5
+
6
+ export let id: string | null = null;
7
+ export let name: string | null = null;
8
+ export let type: HTMLInputAttributes['type'] = 'text';
9
+ export let value = '';
10
+ export let placeholder: string | null = null;
11
+ export let autocomplete: HTMLInputAttributes['autocomplete'] | null = null;
12
+ export let describedBy: DescribedBy = null;
13
+ export let errorMessageId: string | null = null;
14
+ export let invalid = false;
15
+ export let disabled = false;
16
+ export let readonly = false;
17
+ export let required = false;
18
+
19
+ $: ariaDescribedBy = normalizeIdRefs(describedBy);
20
+ $: resolvedErrorMessageId = invalid && errorMessageId ? errorMessageId : null;
21
+
22
+ function handleInput(event: Event): void {
23
+ value = (event.currentTarget as HTMLInputElement).value;
24
+ }
25
+
26
+ function normalizeIdRefs(value: DescribedBy): string | null {
27
+ if (value === null) {
28
+ return null;
29
+ }
30
+
31
+ if (typeof value === 'string') {
32
+ const normalized = value.trim();
33
+ return normalized ? normalized : null;
34
+ }
35
+
36
+ const normalized = value.map((entry) => entry.trim()).filter(Boolean);
37
+ return normalized.length > 0 ? normalized.join(' ') : null;
38
+ }
39
+ </script>
40
+
41
+ <input
42
+ class="zdp-input"
43
+ id={id ?? undefined}
44
+ name={name ?? undefined}
45
+ {type}
46
+ {value}
47
+ placeholder={placeholder ?? undefined}
48
+ autocomplete={autocomplete ?? undefined}
49
+ aria-describedby={ariaDescribedBy ?? undefined}
50
+ aria-errormessage={resolvedErrorMessageId ?? undefined}
51
+ aria-invalid={invalid ? 'true' : undefined}
52
+ {disabled}
53
+ readonly={readonly}
54
+ {required}
55
+ oninput={handleInput}
56
+ />
57
+
58
+ <style>
59
+ .zdp-input {
60
+ background: var(--zdp-color-surface-panel);
61
+ border: var(--zdp-control-border-width) solid var(--zdp-color-line-strong);
62
+ border-radius: var(--zdp-control-radius);
63
+ box-sizing: border-box;
64
+ color: var(--zdp-color-ink-strong);
65
+ font-family: var(--zdp-font-family-sans);
66
+ font-size: var(--zdp-type-control-size);
67
+ line-height: var(--zdp-type-control-line-height);
68
+ min-height: var(--zdp-control-height-md);
69
+ padding: 0 var(--zdp-space-3);
70
+ transition:
71
+ background-color var(--zdp-motion-fast) ease,
72
+ border-color var(--zdp-motion-fast) ease,
73
+ color var(--zdp-motion-fast) ease;
74
+ width: 100%;
75
+ }
76
+
77
+ .zdp-input::placeholder {
78
+ color: var(--zdp-color-ink-muted);
79
+ }
80
+
81
+ .zdp-input:hover:not(:disabled) {
82
+ background: var(--zdp-color-surface-raised);
83
+ border-color: var(--zdp-color-line-strong);
84
+ }
85
+
86
+ .zdp-input:focus-visible {
87
+ border-color: var(--zdp-color-focus-line);
88
+ outline: var(--zdp-control-focus-outline-width) solid var(--zdp-color-focus-surface);
89
+ outline-offset: var(--zdp-control-focus-outline-offset);
90
+ }
91
+
92
+ .zdp-input[aria-invalid="true"] {
93
+ border-color: var(--zdp-color-accent-danger);
94
+ }
95
+
96
+ .zdp-input[readonly] {
97
+ background: var(--zdp-color-surface-raised);
98
+ color: var(--zdp-color-ink-normal);
99
+ }
100
+
101
+ .zdp-input[readonly]:hover {
102
+ background: var(--zdp-color-surface-raised);
103
+ }
104
+
105
+ .zdp-input:disabled {
106
+ cursor: not-allowed;
107
+ opacity: 0.56;
108
+ }
109
+ </style>