@happyvertical/smrt-ui 0.55.20 → 0.55.22
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/components/calendar/DayView.svelte +1 -1
- package/dist/components/data/CollectionList.svelte +1 -1
- package/dist/components/data/DataTable.svelte +5 -0
- package/dist/components/data/ListSortSelect.svelte +1 -1
- package/dist/components/feedback/Alert.svelte +86 -20
- package/dist/components/feedback/LoadingOverlay.svelte +2 -2
- package/dist/components/feedback/PhoneSheet.svelte +1 -1
- package/dist/components/feedback/Progress.svelte +7 -0
- package/dist/components/feedback/ToastViewport.svelte +1 -1
- package/dist/components/feedback/WorkingStrip.svelte +4 -4
- package/dist/components/forms/CameraCapture.svelte +1 -1
- package/dist/components/forms/Checkbox.svelte +133 -30
- package/dist/components/forms/Combobox.svelte +2 -2
- package/dist/components/forms/Fieldset.svelte +1 -1
- package/dist/components/forms/FilePicker.svelte +1 -1
- package/dist/components/forms/FormActionBar.svelte +2 -2
- package/dist/components/forms/Input.svelte +66 -61
- package/dist/components/forms/InputGroup.svelte +1 -1
- package/dist/components/forms/Listbox.svelte +1 -1
- package/dist/components/forms/MultiSelect.svelte +2 -2
- package/dist/components/forms/Radio.svelte +9 -0
- package/dist/components/forms/RangeSlider.svelte +1 -1
- package/dist/components/forms/SegmentedControl.svelte +7 -2
- package/dist/components/forms/Select.svelte +67 -61
- package/dist/components/forms/SignaturePad.svelte +1 -1
- package/dist/components/forms/Slider.svelte +1 -1
- package/dist/components/forms/StagedControlReview.svelte +4 -4
- package/dist/components/forms/Switch.svelte +130 -28
- package/dist/components/forms/TagsInput.svelte +1 -1
- package/dist/components/forms/Toggle.svelte +12 -0
- package/dist/components/forms/ToggleButton.svelte +6 -1
- package/dist/components/layout/Footer.svelte +1 -1
- package/dist/components/layout/Masthead.svelte +1 -1
- package/dist/components/memberships/MembershipCard.svelte +3 -3
- package/dist/components/nav/FilterChips.svelte +6 -1
- package/dist/components/nav/Tabs.svelte +192 -183
- package/dist/components/nav/Tabs.svelte.d.ts.map +1 -1
- package/dist/components/permissions/PermissionPicker.svelte +4 -4
- package/dist/components/roles/RoleSelector.svelte +2 -2
- package/dist/components/ui/Accordion.svelte +1 -1
- package/dist/components/ui/AccordionItem.svelte +1 -1
- package/dist/components/ui/Badge.svelte +26 -24
- package/dist/components/ui/Button.svelte +101 -115
- package/dist/components/ui/Button.svelte.d.ts +1 -1
- package/dist/components/ui/Card.svelte +44 -57
- package/dist/components/ui/Chip.svelte +68 -58
- package/dist/components/ui/Disclosure.svelte +1 -1
- package/dist/components/ui/IconToggle.svelte +8 -2
- package/dist/styles/unstyled.css +2 -2
- package/dist/svelte/playground/BaseControlsPreview.svelte +2 -2
- package/dist/svelte/playground/CollectionsPreview.svelte +1 -1
- package/dist/svelte/playground/DataTablePreview.svelte +5 -5
- package/dist/svelte/playground/FeedbackPreview.svelte +1 -1
- package/dist/svelte/playground/InteractiveControlsPreview.svelte +1 -1
- package/dist/svelte/playground/StylelessPreview.svelte +35 -2
- package/dist/svelte/playground/StylelessPreview.svelte.d.ts.map +1 -1
- package/dist/themes/README.md +58 -4
- package/dist/themes/ThemeProvider.svelte +9 -0
- package/dist/themes/ThemeProvider.svelte.d.ts.map +1 -1
- package/dist/themes/components/ColorSchemeToggle.svelte +3 -3
- package/dist/themes/components/ThemeSwitcher.svelte +3 -3
- package/dist/themes/forced-colors.d.ts +2 -0
- package/dist/themes/forced-colors.d.ts.map +1 -0
- package/dist/themes/forced-colors.js +49 -0
- package/dist/themes/styles/base.css +80 -1
- package/dist/themes/styles/forced-colors.css +42 -0
- package/package.json +2 -2
|
@@ -330,7 +330,7 @@ function getTypeLabel(type: string): string {
|
|
|
330
330
|
|
|
331
331
|
.event-card--link:hover {
|
|
332
332
|
background: var(--smrt-day-view-card-hover);
|
|
333
|
-
border-color: var(--smrt-color
|
|
333
|
+
border-color: var(--smrt-hairline-strong-color);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
.event-card--link:hover .event-arrow {
|
|
@@ -112,7 +112,7 @@ function toggle(key: string | number) {
|
|
|
112
112
|
@layer smrt.theme {
|
|
113
113
|
.collection { display: grid; gap: var(--smrt-spacing-2); margin: 0; padding: 0; list-style: none; }
|
|
114
114
|
.collection--grid { grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); }
|
|
115
|
-
li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--smrt-spacing-3); min-width: 0; padding: var(--smrt-spacing-3); border: var(--smrt-card-border,
|
|
115
|
+
li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--smrt-spacing-3); min-width: 0; padding: var(--smrt-spacing-3); border: var(--smrt-card-border, var(--smrt-hairline)); border-radius: var(--smrt-radius-medium); background: var(--smrt-card-background, var(--smrt-color-surface)); color: var(--smrt-color-on-surface); }
|
|
116
116
|
li.selected { border-color: var(--smrt-color-primary); background: var(--smrt-color-primary-container); }
|
|
117
117
|
/* The selection box and actions sit above an item's stretched link. */
|
|
118
118
|
.select { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; }
|
|
@@ -2351,5 +2351,10 @@ $effect(() => {
|
|
|
2351
2351
|
.data-table-container--narrow .data-table { table-layout: fixed; }
|
|
2352
2352
|
.data-table-container--narrow .data-table__cell { white-space: normal; overflow-wrap: anywhere; }
|
|
2353
2353
|
.data-table-container--narrow .data-table__sort-button { max-width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
|
|
2354
|
+
/* Forced colors (#3908): system colours where colour alone carries meaning. */
|
|
2355
|
+
@media (forced-colors: active) {
|
|
2356
|
+
.data-table__row--selected, .data-table__row--selected .data-table__cell--pinned-start, .data-table__row--selected .data-table__cell--pinned-end { background: Canvas; }
|
|
2357
|
+
.data-table__row--selected { outline: var(--smrt-focus-ring-width) solid Highlight; outline-offset: calc(-1 * var(--smrt-focus-ring-width)); }
|
|
2358
|
+
}
|
|
2354
2359
|
}
|
|
2355
2360
|
</style>
|
|
@@ -114,7 +114,7 @@ function handleChange(event: Event) {
|
|
|
114
114
|
.list-sort-select__control {
|
|
115
115
|
min-height: 2.75rem;
|
|
116
116
|
padding: 0.25rem 0.5rem;
|
|
117
|
-
border:
|
|
117
|
+
border: var(--smrt-hairline);
|
|
118
118
|
border-radius: var(--smrt-radius-md, 0.375rem);
|
|
119
119
|
background: var(--smrt-color-surface, transparent);
|
|
120
120
|
color: inherit;
|
|
@@ -32,33 +32,99 @@ const role = $derived(
|
|
|
32
32
|
);
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
|
-
<div class="
|
|
36
|
-
<span class="marker" aria-hidden="true"></span>
|
|
37
|
-
<div class="
|
|
38
|
-
{#if title}<strong>{title}</strong>{/if}
|
|
39
|
-
{#if children}<div class="message">{@render children()}</div>{/if}
|
|
35
|
+
<div class="smrt-alert__root smrt-alert__{variant} {className}" {role} data-smrt-component="Alert">
|
|
36
|
+
<span class="smrt-alert__marker" data-smrt-part="marker" aria-hidden="true"></span>
|
|
37
|
+
<div class="smrt-alert__content" data-smrt-part="body">
|
|
38
|
+
{#if title}<strong data-smrt-part="title">{title}</strong>{/if}
|
|
39
|
+
{#if children}<div class="smrt-alert__message" data-smrt-part="message">{@render children()}</div>{/if}
|
|
40
40
|
</div>
|
|
41
|
-
{#if action}<div class="
|
|
41
|
+
{#if action}<div class="smrt-alert__action" data-smrt-part="actions">{@render action()}</div>{/if}
|
|
42
42
|
{#if dismissible}
|
|
43
|
-
<button type="button" class="
|
|
43
|
+
<button type="button" class="smrt-alert__dismiss" data-smrt-part="close" aria-label="Dismiss" onclick={ondismiss}>×</button>
|
|
44
44
|
{/if}
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
47
|
<style>
|
|
48
48
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
49
|
+
@layer smrt.structure {
|
|
50
|
+
.smrt-alert__root {
|
|
51
|
+
display: grid;
|
|
52
|
+
grid-template-columns: auto minmax(0, 1fr) auto auto;
|
|
53
|
+
align-items: start;
|
|
54
|
+
gap: var(--smrt-spacing-3);
|
|
55
|
+
padding: var(--smrt-spacing-3) var(--smrt-spacing-4);
|
|
56
|
+
}
|
|
57
|
+
.smrt-alert__marker {
|
|
58
|
+
width: .65rem;
|
|
59
|
+
height: .65rem;
|
|
60
|
+
margin-top: .4rem;
|
|
61
|
+
}
|
|
62
|
+
.smrt-alert__content {
|
|
63
|
+
min-width: 0;
|
|
64
|
+
}
|
|
65
|
+
strong {
|
|
66
|
+
display: block;
|
|
67
|
+
}
|
|
68
|
+
.smrt-alert__action {
|
|
69
|
+
align-self: center;
|
|
70
|
+
}
|
|
71
|
+
.smrt-alert__dismiss {
|
|
72
|
+
width: 2rem;
|
|
73
|
+
height: 2rem;
|
|
74
|
+
margin: -.35rem;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
49
78
|
@layer smrt.theme {
|
|
50
|
-
.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.
|
|
79
|
+
.smrt-alert__root {
|
|
80
|
+
--smrt-alert-color: var(--smrt-color-primary);
|
|
81
|
+
border: var(--smrt-hairline);
|
|
82
|
+
border-color: color-mix(in srgb, var(--smrt-alert-color) 35%, var(--smrt-hairline-color));
|
|
83
|
+
box-shadow: var(--smrt-inset-highlight);
|
|
84
|
+
border-radius: var(--smrt-radius-medium);
|
|
85
|
+
background: color-mix(in srgb, var(--smrt-alert-color) 8%, var(--smrt-surface-panel));
|
|
86
|
+
color: var(--smrt-color-on-surface);
|
|
87
|
+
}
|
|
88
|
+
.smrt-alert__info {
|
|
89
|
+
--smrt-alert-color: var(--smrt-color-info);
|
|
90
|
+
}
|
|
91
|
+
.smrt-alert__success {
|
|
92
|
+
--smrt-alert-color: var(--smrt-color-success);
|
|
93
|
+
}
|
|
94
|
+
.smrt-alert__warning {
|
|
95
|
+
--smrt-alert-color: var(--smrt-color-warning);
|
|
96
|
+
}
|
|
97
|
+
.smrt-alert__error {
|
|
98
|
+
--smrt-alert-color: var(--smrt-color-error);
|
|
99
|
+
}
|
|
100
|
+
.smrt-alert__marker {
|
|
101
|
+
border-radius: 50%;
|
|
102
|
+
background: var(--smrt-alert-color);
|
|
103
|
+
}
|
|
104
|
+
strong {
|
|
105
|
+
font: var(--smrt-typography-title-small-font);
|
|
106
|
+
}
|
|
107
|
+
.smrt-alert__message {
|
|
108
|
+
color: var(--smrt-color-on-surface-variant);
|
|
109
|
+
}
|
|
110
|
+
.smrt-alert__dismiss {
|
|
111
|
+
border: 0;
|
|
112
|
+
border-radius: var(--smrt-radius-full);
|
|
113
|
+
background: transparent;
|
|
114
|
+
color: inherit;
|
|
115
|
+
font-size: 1.25rem;
|
|
116
|
+
}
|
|
117
|
+
.smrt-alert__dismiss:hover {
|
|
118
|
+
background: color-mix(in srgb, currentColor calc(var(--smrt-state-hover) * 100%), transparent);
|
|
119
|
+
}
|
|
120
|
+
.smrt-alert__dismiss:focus-visible {
|
|
121
|
+
outline: var(--smrt-focus-ring-width) solid var(--smrt-focus-ring-color);
|
|
122
|
+
outline-offset: var(--smrt-focus-ring-offset);
|
|
123
|
+
}
|
|
124
|
+
/* Forced colors (#3908): system colours where colour alone carries meaning. */
|
|
125
|
+
@media (forced-colors: active) {
|
|
126
|
+
.smrt-alert__root { background: Canvas; border-color: CanvasText; }
|
|
127
|
+
.smrt-alert__marker { background: CanvasText; }
|
|
128
|
+
}
|
|
63
129
|
}
|
|
64
130
|
</style>
|
|
@@ -261,7 +261,7 @@ function handleKeydown(e: KeyboardEvent) {
|
|
|
261
261
|
font-size: var(--smrt-typography-label-large-size, 0.875rem);
|
|
262
262
|
color: var(--smrt-color-on-surface-variant);
|
|
263
263
|
background: transparent;
|
|
264
|
-
border:
|
|
264
|
+
border: var(--smrt-hairline-strong);
|
|
265
265
|
border-radius: var(--smrt-radius-md);
|
|
266
266
|
cursor: pointer;
|
|
267
267
|
transition: all var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
|
|
@@ -269,7 +269,7 @@ function handleKeydown(e: KeyboardEvent) {
|
|
|
269
269
|
|
|
270
270
|
.dismiss-btn:hover {
|
|
271
271
|
background: var(--smrt-color-surface-container-highest);
|
|
272
|
-
border-color: var(--smrt-color
|
|
272
|
+
border-color: var(--smrt-hairline-strong-color);
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
.dismiss-btn:focus-visible {
|
|
@@ -169,7 +169,7 @@ function onkeydown(event: KeyboardEvent): void {
|
|
|
169
169
|
min-block-size: 3.5rem;
|
|
170
170
|
padding-block: 0;
|
|
171
171
|
padding-inline: var(--smrt-spacing-4) var(--smrt-spacing-2);
|
|
172
|
-
border-block-end:
|
|
172
|
+
border-block-end: var(--smrt-hairline);
|
|
173
173
|
touch-action: pan-x;
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -68,5 +68,12 @@ const displayValue = $derived(
|
|
|
68
68
|
.progress--circular > span { position: absolute; font: var(--smrt-typography-label-small-font); }
|
|
69
69
|
@keyframes linear-progress { from { left: -40%; } to { left: 105%; } } @keyframes spin { to { transform: rotate(270deg); } }
|
|
70
70
|
@media (prefers-reduced-motion: reduce) { .progress--linear .indicator, .progress--circular .indicator { transition: none; } .progress--linear.indeterminate .indicator { animation-duration: 2.5s; } }
|
|
71
|
+
/* Forced colors (#3908): system colours where colour alone carries meaning. */
|
|
72
|
+
@media (forced-colors: active) {
|
|
73
|
+
.progress--linear .track { background: Canvas; border: var(--smrt-hairline-strong); }
|
|
74
|
+
.progress--linear .indicator { background: Highlight; }
|
|
75
|
+
.progress--circular .track { stroke: CanvasText; }
|
|
76
|
+
.progress--circular .indicator { stroke: Highlight; }
|
|
77
|
+
}
|
|
71
78
|
}
|
|
72
79
|
</style>
|
|
@@ -189,7 +189,7 @@ async function runAction(toast: Toast) {
|
|
|
189
189
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
190
190
|
@layer smrt.theme {
|
|
191
191
|
.viewport { position: fixed; z-index: var(--smrt-z-index-toast, 1200); display: grid; width: min(24rem, calc(var(--smrt-toast-viewport-region-width, 100vw) - 2 * var(--smrt-toast-viewport-inset))); gap: var(--smrt-spacing-2); pointer-events: none; }
|
|
192
|
-
.viewport :global(
|
|
192
|
+
.viewport :global([data-smrt-component="Alert"]) { pointer-events: auto; background: color-mix(in srgb, var(--smrt-alert-color) 8%, var(--smrt-glass-surface-strong)); backdrop-filter: blur(var(--smrt-glass-blur)) saturate(var(--smrt-glass-saturation)); box-shadow: var(--smrt-inset-highlight), var(--smrt-elevation-3); }
|
|
193
193
|
.viewport--top-start { top: calc(var(--smrt-toast-viewport-top, 0px) + var(--smrt-toast-viewport-inset)); left: calc(var(--smrt-toast-viewport-left, 0px) + var(--smrt-toast-viewport-inset)); }
|
|
194
194
|
.viewport--top-end { top: calc(var(--smrt-toast-viewport-top, 0px) + var(--smrt-toast-viewport-inset)); right: calc(var(--smrt-toast-viewport-right, 0px) + var(--smrt-toast-viewport-inset)); }
|
|
195
195
|
.viewport--bottom-start { bottom: calc(var(--smrt-toast-viewport-bottom, 0px) + var(--smrt-toast-viewport-inset)); left: calc(var(--smrt-toast-viewport-left, 0px) + var(--smrt-toast-viewport-inset)); }
|
|
@@ -269,7 +269,7 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
269
269
|
box-sizing: border-box;
|
|
270
270
|
min-block-size: 2.75rem;
|
|
271
271
|
padding-inline-end: var(--smrt-spacing-2);
|
|
272
|
-
border-block-start:
|
|
272
|
+
border-block-start: var(--smrt-hairline);
|
|
273
273
|
box-shadow: var(--smrt-elevation-2);
|
|
274
274
|
}
|
|
275
275
|
|
|
@@ -279,14 +279,14 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
279
279
|
max-inline-size: min(34rem, calc(100vw - 2rem));
|
|
280
280
|
padding-block: var(--smrt-spacing-1);
|
|
281
281
|
padding-inline-end: var(--smrt-spacing-2);
|
|
282
|
-
border:
|
|
282
|
+
border: var(--smrt-hairline);
|
|
283
283
|
border-radius: var(--smrt-radius-xl, 1.25rem);
|
|
284
284
|
box-shadow: var(--smrt-elevation-3);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
.working-strip--inline {
|
|
288
288
|
padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
|
|
289
|
-
border-block-end:
|
|
289
|
+
border-block-end: var(--smrt-hairline);
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
.working-strip[data-phase='waiting'] {
|
|
@@ -390,7 +390,7 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
390
390
|
min-inline-size: 2.75rem;
|
|
391
391
|
min-block-size: 2.75rem;
|
|
392
392
|
padding: 0 var(--smrt-spacing-4);
|
|
393
|
-
border:
|
|
393
|
+
border: var(--smrt-hairline);
|
|
394
394
|
border-radius: var(--smrt-radius-full);
|
|
395
395
|
background: var(--smrt-color-surface);
|
|
396
396
|
color: var(--smrt-color-on-surface);
|
|
@@ -583,7 +583,7 @@ useControlRegistration(() => {
|
|
|
583
583
|
min-width: var(--smrt-touch-target-min);
|
|
584
584
|
min-height: var(--smrt-touch-target-min);
|
|
585
585
|
padding: 0 var(--smrt-spacing-4);
|
|
586
|
-
border:
|
|
586
|
+
border: var(--smrt-hairline-strong);
|
|
587
587
|
border-radius: var(--smrt-radius-small);
|
|
588
588
|
background: var(--smrt-color-surface);
|
|
589
589
|
color: var(--smrt-color-on-surface);
|
|
@@ -124,8 +124,8 @@ useControlRegistration(() => {
|
|
|
124
124
|
</script>
|
|
125
125
|
|
|
126
126
|
<label
|
|
127
|
-
data-density={density} class="
|
|
128
|
-
class:
|
|
127
|
+
data-density={density} class="smrt-checkbox__root {className}"
|
|
128
|
+
class:smrt-checkbox__disabled={disabled}
|
|
129
129
|
data-smrt-hit-target
|
|
130
130
|
data-smrt-control={controlId}
|
|
131
131
|
data-smrt-form={interactionContext?.formId}
|
|
@@ -145,17 +145,17 @@ useControlRegistration(() => {
|
|
|
145
145
|
aria-describedby={resolvedDescription}
|
|
146
146
|
aria-invalid={formGroup?.().invalid ? 'true' : undefined}
|
|
147
147
|
onchange={handleChange}
|
|
148
|
-
{...rest}
|
|
148
|
+
{...rest} data-smrt-part="input"
|
|
149
149
|
/>
|
|
150
|
-
<span class="checkbox__box" aria-hidden="true">
|
|
151
|
-
{#if indeterminate}<span class="checkbox__dash"></span>{:else if checked}<span class="checkbox__check">✓</span>{/if}
|
|
150
|
+
<span class="smrt-checkbox__box" data-smrt-part="box" aria-hidden="true">
|
|
151
|
+
{#if indeterminate}<span class="smrt-checkbox__dash" data-smrt-part="indicator"></span>{:else if checked}<span class="smrt-checkbox__check" data-smrt-part="indicator">✓</span>{/if}
|
|
152
152
|
</span>
|
|
153
|
-
{#if label}<span class="checkbox__label">{label}</span>{/if}
|
|
153
|
+
{#if label}<span class="smrt-checkbox__label" data-smrt-part="label">{label}</span>{/if}
|
|
154
154
|
</label>
|
|
155
155
|
|
|
156
156
|
<style>
|
|
157
157
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
158
|
-
@layer smrt.
|
|
158
|
+
@layer smrt.structure {
|
|
159
159
|
/* The visible box stays 18px. A transparent 44x44 hit area (WCAG 2.5.8 / M3 touch target) is
|
|
160
160
|
centred on it with ::before, so clicks nearby still land on the wrapping <label>. It adds no
|
|
161
161
|
layout. The box and the label text sit above every hit area (z-index 1 over 0), so one
|
|
@@ -164,34 +164,137 @@ useControlRegistration(() => {
|
|
|
164
164
|
checkbox stands alone in its parent. Beside anything else (a row title, a link, other text)
|
|
165
165
|
it keeps to the box's own column and grows vertically only. Resize it with
|
|
166
166
|
--smrt-control-hit-size (0px turns it off). */
|
|
167
|
-
.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
167
|
+
.smrt-checkbox__root {
|
|
168
|
+
--smrt-checkbox-box: 1.125rem;
|
|
169
|
+
--smrt-checkbox-hit: max(var(--smrt-control-hit-size, 2.75rem), var(--smrt-checkbox-box));
|
|
170
|
+
position: relative;
|
|
171
|
+
display: inline-flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
gap: var(--smrt-spacing-2);
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
}
|
|
176
|
+
.smrt-checkbox__root::before {
|
|
177
|
+
content: '';
|
|
178
|
+
position: absolute;
|
|
179
|
+
z-index: 0;
|
|
180
|
+
inset-block-start: 50%;
|
|
181
|
+
inset-inline-start: calc(var(--smrt-checkbox-box) / 2);
|
|
182
|
+
inline-size: var(--smrt-checkbox-hit);
|
|
183
|
+
block-size: var(--smrt-checkbox-hit);
|
|
184
|
+
margin-block-start: calc(var(--smrt-checkbox-hit) / -2);
|
|
185
|
+
margin-inline-start: calc(var(--smrt-checkbox-hit) / -2);
|
|
186
|
+
}
|
|
187
|
+
.smrt-checkbox__disabled {
|
|
188
|
+
cursor: not-allowed;
|
|
189
|
+
}
|
|
190
|
+
input {
|
|
191
|
+
position: absolute;
|
|
192
|
+
width: 1px;
|
|
193
|
+
height: 1px;
|
|
194
|
+
opacity: 0;
|
|
195
|
+
pointer-events: none;
|
|
196
|
+
}
|
|
197
|
+
.smrt-checkbox__box {
|
|
198
|
+
position: relative;
|
|
199
|
+
z-index: 1;
|
|
200
|
+
width: 1.125rem;
|
|
201
|
+
height: 1.125rem;
|
|
202
|
+
display: grid;
|
|
203
|
+
place-items: center;
|
|
204
|
+
}
|
|
205
|
+
.smrt-checkbox__label {
|
|
206
|
+
position: relative;
|
|
207
|
+
z-index: 1;
|
|
208
|
+
}
|
|
209
|
+
.smrt-checkbox__dash {
|
|
210
|
+
width: .6rem;
|
|
211
|
+
height: 2px;
|
|
212
|
+
}
|
|
213
|
+
.smrt-checkbox__root:not(:only-child)::before {
|
|
214
|
+
inline-size: var(--smrt-checkbox-box);
|
|
215
|
+
margin-inline-start: calc(var(--smrt-checkbox-box) / -2);
|
|
216
|
+
}
|
|
180
217
|
/* Table cells: neighbouring cells hold links and other controls, so the hit area never leaves
|
|
181
218
|
the cell's column. It grows vertically only (box wide)... */
|
|
182
|
-
:global(:is(td, th)) .
|
|
219
|
+
:global(:is(td, th)) .smrt-checkbox__root::before {
|
|
220
|
+
inline-size: var(--smrt-checkbox-box);
|
|
221
|
+
margin-inline-start: calc(var(--smrt-checkbox-box) / -2);
|
|
222
|
+
}
|
|
183
223
|
/* ...unless the checkbox is the cell's only content: then the whole cell, clipped to its own
|
|
184
224
|
edges, is the hit area (the 44px target the header and every row share). The cell only needs
|
|
185
225
|
a containing block, so :where() keeps that rule at zero specificity: a sticky header or a
|
|
186
226
|
pinned column's own position always wins (a sticky cell contains the hit area too). */
|
|
187
|
-
:global(:where(td:has(> [data-smrt-hit-target]:only-child), th:has(> [data-smrt-hit-target]:only-child))) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
227
|
+
:global(:where(td:has(> [data-smrt-hit-target]:only-child), th:has(> [data-smrt-hit-target]:only-child))) {
|
|
228
|
+
position: relative;
|
|
229
|
+
}
|
|
230
|
+
:global(:is(td, th):has(> [data-smrt-hit-target]:only-child)) > .smrt-checkbox__root {
|
|
231
|
+
position: static;
|
|
232
|
+
}
|
|
233
|
+
:global(:is(td, th):has(> [data-smrt-hit-target]:only-child)) > .smrt-checkbox__root::before {
|
|
234
|
+
inset: 0;
|
|
235
|
+
inline-size: auto;
|
|
236
|
+
block-size: auto;
|
|
237
|
+
margin: 0;
|
|
238
|
+
}
|
|
239
|
+
.smrt-checkbox__root[data-density='touch'] {
|
|
240
|
+
--smrt-checkbox-target-min: var(--smrt-touch-target-min);
|
|
241
|
+
}
|
|
242
|
+
.smrt-checkbox__root[data-density='comfortable'] {
|
|
243
|
+
--smrt-checkbox-target-min: 0px;
|
|
244
|
+
}
|
|
245
|
+
.smrt-checkbox__root {
|
|
246
|
+
min-height: var(--smrt-checkbox-target-min, var(--smrt-control-target-min));
|
|
247
|
+
min-width: var(--smrt-checkbox-target-min, var(--smrt-control-target-min));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
@layer smrt.theme {
|
|
251
|
+
.smrt-checkbox__root {
|
|
252
|
+
color: var(--smrt-color-on-surface);
|
|
253
|
+
}
|
|
254
|
+
.smrt-checkbox__disabled {
|
|
255
|
+
opacity: .5;
|
|
256
|
+
}
|
|
257
|
+
.smrt-checkbox__box {
|
|
258
|
+
border: 2px solid var(--smrt-color-outline);
|
|
259
|
+
border-radius: var(--smrt-radius-extra-small);
|
|
260
|
+
background: var(--smrt-color-surface);
|
|
261
|
+
transition: background var(--smrt-duration-short2), border-color var(--smrt-duration-short2);
|
|
262
|
+
}
|
|
263
|
+
input:checked + .smrt-checkbox__box, input:indeterminate + .smrt-checkbox__box {
|
|
264
|
+
background: var(--smrt-color-primary);
|
|
265
|
+
border-color: var(--smrt-color-primary);
|
|
266
|
+
color: var(--smrt-color-on-primary);
|
|
267
|
+
}
|
|
268
|
+
input:focus-visible + .smrt-checkbox__box {
|
|
269
|
+
outline: var(--smrt-focus-ring-width) solid var(--smrt-focus-ring-color);
|
|
270
|
+
outline-offset: var(--smrt-focus-ring-offset);
|
|
271
|
+
}
|
|
272
|
+
.smrt-checkbox__check {
|
|
273
|
+
font-size: .8rem;
|
|
274
|
+
font-weight: 800;
|
|
275
|
+
line-height: 1;
|
|
276
|
+
}
|
|
277
|
+
.smrt-checkbox__dash {
|
|
278
|
+
background: currentColor;
|
|
279
|
+
}
|
|
280
|
+
.smrt-checkbox__root[data-smrt-highlighted='true'] {
|
|
281
|
+
outline: 3px solid var(--smrt-color-tertiary);
|
|
282
|
+
outline-offset: 4px;
|
|
283
|
+
border-radius: var(--smrt-radius-small);
|
|
284
|
+
}
|
|
285
|
+
@media (prefers-reduced-motion: reduce) {
|
|
286
|
+
.smrt-checkbox__box {
|
|
287
|
+
transition: none;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/* Forced colors (#3908): system colours where colour alone carries meaning. */
|
|
291
|
+
@media (forced-colors: active) {
|
|
292
|
+
.smrt-checkbox__box { background: Canvas; border-color: CanvasText; }
|
|
293
|
+
input:checked + .smrt-checkbox__box, input:indeterminate + .smrt-checkbox__box { background: Highlight; border-color: Highlight; color: HighlightText; }
|
|
294
|
+
.smrt-checkbox__dash { background: HighlightText; }
|
|
295
|
+
.smrt-checkbox__disabled { opacity: 1; color: GrayText; }
|
|
296
|
+
.smrt-checkbox__disabled .smrt-checkbox__box, .smrt-checkbox__disabled input:checked + .smrt-checkbox__box, .smrt-checkbox__disabled input:indeterminate + .smrt-checkbox__box { background: Canvas; border-color: GrayText; color: GrayText; }
|
|
297
|
+
.smrt-checkbox__disabled .smrt-checkbox__dash { background: GrayText; }
|
|
298
|
+
}
|
|
196
299
|
}
|
|
197
300
|
</style>
|
|
@@ -350,8 +350,8 @@ useControlRegistration(() => {
|
|
|
350
350
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
351
351
|
@layer smrt.theme {
|
|
352
352
|
.combobox { position: relative; display: grid; gap: 0; color: var(--smrt-color-on-surface); }
|
|
353
|
-
input { box-sizing: border-box; width: 100%; padding: var(--smrt-spacing-2) var(--smrt-spacing-3); border:
|
|
354
|
-
input:focus { outline: var(--smrt-focus-ring-width) solid var(--smrt-focus-ring-color); outline-offset: var(--smrt-focus-ring-offset); } .options { position: absolute; z-index: var(--smrt-z-index-dropdown); top: 100%; left: 0; right: 0; display: grid; padding: var(--smrt-spacing-1); border:
|
|
353
|
+
input { box-sizing: border-box; width: 100%; padding: var(--smrt-spacing-2) var(--smrt-spacing-3); border: var(--smrt-hairline-strong); border-radius: var(--smrt-radius-small); background: var(--smrt-color-surface); color: inherit; }
|
|
354
|
+
input:focus { outline: var(--smrt-focus-ring-width) solid var(--smrt-focus-ring-color); outline-offset: var(--smrt-focus-ring-offset); } .options { position: absolute; z-index: var(--smrt-z-index-dropdown); top: 100%; left: 0; right: 0; display: grid; padding: var(--smrt-spacing-1); border: var(--smrt-hairline); border-radius: var(--smrt-radius-small); background: var(--smrt-color-surface-container); box-shadow: var(--smrt-elevation-2); }
|
|
355
355
|
.options button { padding: var(--smrt-spacing-2) var(--smrt-spacing-3); border: 0; border-radius: var(--smrt-radius-extra-small); background: transparent; color: var(--smrt-color-on-surface); text-align: left; } .options button.active { background: var(--smrt-color-secondary-container); }
|
|
356
356
|
.options.empty { padding: var(--smrt-spacing-2) var(--smrt-spacing-3); color: var(--smrt-color-on-surface-variant); }
|
|
357
357
|
.sr-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
@@ -36,7 +36,7 @@ const errorId = $derived(error ? `fieldset-${instanceId}-error` : undefined);
|
|
|
36
36
|
<style>
|
|
37
37
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
38
38
|
@layer smrt.theme {
|
|
39
|
-
.fieldset { margin: 0; padding: var(--smrt-spacing-4); border:
|
|
39
|
+
.fieldset { margin: 0; padding: var(--smrt-spacing-4); border: var(--smrt-hairline); border-radius: var(--smrt-radius-medium); }
|
|
40
40
|
legend { padding: 0 var(--smrt-spacing-2); color: var(--smrt-color-on-surface); font: var(--smrt-typography-title-small-font); }
|
|
41
41
|
.content--stack { display: grid; gap: var(--smrt-spacing-4); }
|
|
42
42
|
.description, .error { margin: 0 0 var(--smrt-spacing-3); font: var(--smrt-typography-body-small-font); color: var(--smrt-color-on-surface-variant); } .error { margin: var(--smrt-spacing-3) 0 0; color: var(--smrt-color-error); }
|
|
@@ -118,7 +118,7 @@ useControlRegistration(() => {
|
|
|
118
118
|
<style>
|
|
119
119
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
120
120
|
@layer smrt.theme {
|
|
121
|
-
.file-picker { display: inline-flex; flex-direction: column; gap: var(--smrt-spacing-1); padding: var(--smrt-spacing-3) var(--smrt-spacing-4); border:
|
|
121
|
+
.file-picker { display: inline-flex; flex-direction: column; gap: var(--smrt-spacing-1); padding: var(--smrt-spacing-3) var(--smrt-spacing-4); border: var(--smrt-hairline-strong); border-radius: var(--smrt-radius-small); background: var(--smrt-color-surface); color: var(--smrt-color-on-surface); cursor: pointer; }
|
|
122
122
|
.file-picker.dropzone { width: 100%; min-height: 8rem; align-items: center; justify-content: center; border-style: dashed; text-align: center; }
|
|
123
123
|
.file-picker.dragging { border-color: var(--smrt-color-primary); background: var(--smrt-color-primary-container); }
|
|
124
124
|
.file-picker.disabled { opacity: .5; cursor: not-allowed; } input { position: absolute; width: 1px; height: 1px; opacity: 0; }
|
|
@@ -49,7 +49,7 @@ const { t } = useI18n();
|
|
|
49
49
|
gap: var(--smrt-spacing-3);
|
|
50
50
|
margin-block-start: var(--smrt-spacing-6);
|
|
51
51
|
padding-block-start: var(--smrt-spacing-4);
|
|
52
|
-
border-block-start:
|
|
52
|
+
border-block-start: var(--smrt-hairline);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.form-action-bar.plain {
|
|
@@ -69,7 +69,7 @@ const { t } = useI18n();
|
|
|
69
69
|
margin: 0;
|
|
70
70
|
padding: var(--smrt-spacing-2) var(--smrt-spacing-4)
|
|
71
71
|
calc(var(--smrt-spacing-2) + env(safe-area-inset-bottom));
|
|
72
|
-
border-block-start:
|
|
72
|
+
border-block-start: var(--smrt-hairline);
|
|
73
73
|
background: var(--smrt-color-surface);
|
|
74
74
|
box-shadow: var(--smrt-elevation-2);
|
|
75
75
|
}
|