@marianmeres/stuic 2.66.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +292 -4
- package/dist/README.md +41 -18
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/actions/popover/README.md +19 -0
- package/dist/actions/popover/index.css +6 -9
- package/dist/actions/popover/popover.svelte.js +2 -2
- package/dist/actions/tooltip/README.md +18 -0
- package/dist/actions/tooltip/index.css +5 -8
- package/dist/actions/tooltip/tooltip.svelte.js +1 -1
- package/dist/actions/typeahead.svelte.d.ts +53 -0
- package/dist/actions/typeahead.svelte.js +328 -0
- package/dist/base.css +17 -0
- package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte +10 -10
- package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte.d.ts +4 -3
- package/dist/components/AlertConfirmPrompt/Current.svelte +15 -18
- package/dist/components/AlertConfirmPrompt/Current.svelte.d.ts +4 -3
- package/dist/components/AlertConfirmPrompt/acp-icons.js +5 -4
- package/dist/components/AlertConfirmPrompt/index.css +66 -0
- package/dist/components/AssetsPreview/AssetsPreview.svelte +91 -73
- package/dist/components/AssetsPreview/index.css +61 -0
- package/dist/components/Avatar/Avatar.svelte +31 -18
- package/dist/components/Avatar/README.md +166 -0
- package/dist/components/Avatar/index.css +130 -0
- package/dist/components/Backdrop/Backdrop.svelte +7 -2
- package/dist/components/Backdrop/README.md +71 -6
- package/dist/components/Backdrop/index.css +31 -0
- package/dist/components/Button/Button.svelte +116 -124
- package/dist/components/Button/Button.svelte.d.ts +35 -24
- package/dist/components/Button/README.md +87 -21
- package/dist/components/Button/index.css +475 -9
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroupRadio/ButtonGroupRadio.svelte +7 -39
- package/dist/components/ButtonGroupRadio/ButtonGroupRadio.svelte.d.ts +0 -1
- package/dist/components/ButtonGroupRadio/README.md +82 -4
- package/dist/components/ButtonGroupRadio/index.css +158 -14
- package/dist/components/Collapsible/Collapsible.svelte +7 -7
- package/dist/components/Collapsible/Collapsible.svelte.d.ts +2 -2
- package/dist/components/Collapsible/README.md +34 -2
- package/dist/components/Collapsible/index.css +40 -0
- package/dist/components/CommandMenu/CommandMenu.svelte +18 -26
- package/dist/components/CommandMenu/CommandMenu.svelte.d.ts +0 -1
- package/dist/components/CommandMenu/README.md +39 -0
- package/dist/components/CommandMenu/index.css +47 -2
- package/dist/components/DismissibleMessage/DismissibleMessage.svelte +53 -51
- package/dist/components/DismissibleMessage/DismissibleMessage.svelte.d.ts +6 -6
- package/dist/components/DismissibleMessage/README.md +93 -11
- package/dist/components/DismissibleMessage/index.css +128 -8
- package/dist/components/DismissibleMessage/index.d.ts +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.svelte +14 -51
- package/dist/components/DropdownMenu/DropdownMenu.svelte.d.ts +6 -7
- package/dist/components/DropdownMenu/README.md +132 -0
- package/dist/components/DropdownMenu/index.css +258 -52
- package/dist/components/Input/FieldAssets.svelte +8 -5
- package/dist/components/Input/FieldCheckbox.svelte +7 -44
- package/dist/components/Input/FieldFile.svelte +1 -6
- package/dist/components/Input/FieldInput.svelte +9 -1
- package/dist/components/Input/FieldInput.svelte.d.ts +2 -0
- package/dist/components/Input/FieldOptions.svelte +42 -39
- package/dist/components/Input/FieldRadios.svelte +7 -16
- package/dist/components/Input/FieldSelect.svelte +1 -1
- package/dist/components/Input/FieldSwitch.svelte +1 -5
- package/dist/components/Input/FieldTextarea.svelte +1 -1
- package/dist/components/Input/README.md +194 -0
- package/dist/components/Input/_internal/FieldRadioInternal.svelte +2 -40
- package/dist/components/Input/_internal/InputWrap.svelte +8 -48
- package/dist/components/Input/index.css +524 -116
- package/dist/components/KbdShortcut/KbdShortcut.svelte +4 -12
- package/dist/components/KbdShortcut/README.md +34 -0
- package/dist/components/KbdShortcut/index.css +55 -0
- package/dist/components/ListItemButton/ListItemButton.svelte +37 -74
- package/dist/components/ListItemButton/ListItemButton.svelte.d.ts +1 -10
- package/dist/components/ListItemButton/README.md +100 -45
- package/dist/components/ListItemButton/index.css +173 -52
- package/dist/components/ListItemButton/index.d.ts +1 -1
- package/dist/components/ListItemButton/index.js +1 -1
- package/dist/components/Modal/Modal.svelte +1 -8
- package/dist/components/Modal/README.md +29 -0
- package/dist/components/Modal/index.css +38 -0
- package/dist/components/ModalDialog/ModalDialog.svelte +2 -21
- package/dist/components/ModalDialog/README.md +35 -0
- package/dist/components/ModalDialog/index.css +59 -0
- package/dist/components/Nav/Nav.svelte +732 -0
- package/dist/components/Nav/Nav.svelte.d.ts +110 -0
- package/dist/components/Nav/README.md +334 -0
- package/dist/components/Nav/index.css +318 -0
- package/dist/components/Nav/index.d.ts +1 -0
- package/dist/components/Nav/index.js +1 -0
- package/dist/components/Notifications/Notifications.svelte +44 -129
- package/dist/components/Notifications/Notifications.svelte.d.ts +9 -18
- package/dist/components/Notifications/README.md +186 -70
- package/dist/components/Notifications/index.css +212 -15
- package/dist/components/Notifications/notifications-stack.svelte.d.ts +4 -0
- package/dist/components/Notifications/notifications-stack.svelte.js +8 -0
- package/dist/components/Progress/Progress.svelte +4 -2
- package/dist/components/Progress/Progress.svelte.d.ts +1 -0
- package/dist/components/Progress/README.md +97 -11
- package/dist/components/Progress/_internal/Bar.svelte +4 -15
- package/dist/components/Progress/_internal/Bar.svelte.d.ts +1 -1
- package/dist/components/Progress/_internal/Circle.svelte +30 -2
- package/dist/components/Progress/_internal/Circle.svelte.d.ts +1 -0
- package/dist/components/Progress/index.css +50 -4
- package/dist/components/Skeleton/README.md +152 -0
- package/dist/components/Skeleton/Skeleton.svelte +9 -9
- package/dist/components/Skeleton/Skeleton.svelte.d.ts +0 -1
- package/dist/components/Skeleton/index.css +72 -45
- package/dist/components/Spinner/README.md +149 -37
- package/dist/components/Spinner/Spinner.svelte +14 -38
- package/dist/components/Spinner/Spinner.svelte.d.ts +2 -1
- package/dist/components/Spinner/SpinnerCircle.svelte +6 -34
- package/dist/components/Spinner/SpinnerCircle.svelte.d.ts +1 -0
- package/dist/components/Spinner/SpinnerCircleOscillate.svelte +10 -5
- package/dist/components/Spinner/SpinnerUnicode.svelte +3 -1
- package/dist/components/Spinner/SpinnerUnicode.svelte.d.ts +1 -0
- package/dist/components/Spinner/index.css +104 -0
- package/dist/components/Switch/README.md +45 -14
- package/dist/components/Switch/Switch.svelte +23 -48
- package/dist/components/Switch/Switch.svelte.d.ts +4 -2
- package/dist/components/Switch/index.css +121 -4
- package/dist/components/Switch/index.d.ts +1 -2
- package/dist/components/Switch/index.js +1 -2
- package/dist/components/TabbedMenu/README.md +37 -21
- package/dist/components/TabbedMenu/TabbedMenu.svelte +5 -46
- package/dist/components/TabbedMenu/TabbedMenu.svelte.d.ts +0 -1
- package/dist/components/TabbedMenu/index.css +84 -17
- package/dist/components/ThemePreview/README.md +289 -0
- package/dist/components/ThemePreview/ThemePreview.svelte +394 -0
- package/dist/components/ThemePreview/ThemePreview.svelte.d.ts +35 -0
- package/dist/components/ThemePreview/index.css +509 -0
- package/dist/components/ThemePreview/index.d.ts +1 -0
- package/dist/components/ThemePreview/index.js +1 -0
- package/dist/components/TwCheck/README.md +32 -13
- package/dist/components/TwCheck/TwCheck.svelte +11 -9
- package/dist/components/TwCheck/TwCheck.svelte.d.ts +0 -1
- package/dist/components/TwCheck/index.css +17 -2
- package/dist/components/TypeaheadInput/TypeaheadInput.svelte +20 -188
- package/dist/components/TypeaheadInput/TypeaheadInput.svelte.d.ts +4 -2
- package/dist/components/X/X.svelte +12 -5
- package/dist/components/X/X.svelte.d.ts +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.css +46 -26
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/themes/blue-orange.css +217 -0
- package/dist/themes/blue-orange.d.ts +6 -0
- package/dist/themes/blue-orange.js +175 -0
- package/dist/themes/cyan-red.css +217 -0
- package/dist/themes/cyan-red.d.ts +6 -0
- package/dist/themes/cyan-red.js +175 -0
- package/dist/themes/cyan-slate.css +217 -0
- package/dist/themes/cyan-slate.d.ts +6 -0
- package/dist/themes/cyan-slate.js +175 -0
- package/dist/themes/emerald-pink.css +217 -0
- package/dist/themes/emerald-pink.d.ts +6 -0
- package/dist/themes/emerald-pink.js +175 -0
- package/dist/themes/fuchsia-emerald.css +217 -0
- package/dist/themes/fuchsia-emerald.d.ts +6 -0
- package/dist/themes/fuchsia-emerald.js +175 -0
- package/dist/themes/gray.css +217 -0
- package/dist/themes/gray.d.ts +6 -0
- package/dist/themes/gray.js +175 -0
- package/dist/themes/indigo-amber.css +217 -0
- package/dist/themes/indigo-amber.d.ts +6 -0
- package/dist/themes/indigo-amber.js +175 -0
- package/dist/themes/neutral.css +217 -0
- package/dist/themes/neutral.d.ts +6 -0
- package/dist/themes/neutral.js +175 -0
- package/dist/themes/pink-emerald.css +217 -0
- package/dist/themes/pink-emerald.d.ts +6 -0
- package/dist/themes/pink-emerald.js +175 -0
- package/dist/themes/purple-yellow.css +217 -0
- package/dist/themes/purple-yellow.d.ts +6 -0
- package/dist/themes/purple-yellow.js +175 -0
- package/dist/themes/rainbow.css +217 -0
- package/dist/themes/rainbow.d.ts +6 -0
- package/dist/themes/rainbow.js +180 -0
- package/dist/themes/red-blue.css +217 -0
- package/dist/themes/red-blue.d.ts +6 -0
- package/dist/themes/red-blue.js +175 -0
- package/dist/themes/red-cyan.css +217 -0
- package/dist/themes/red-cyan.d.ts +6 -0
- package/dist/themes/red-cyan.js +175 -0
- package/dist/themes/rose-teal.css +217 -0
- package/dist/themes/rose-teal.d.ts +6 -0
- package/dist/themes/rose-teal.js +175 -0
- package/dist/themes/sky-amber.css +217 -0
- package/dist/themes/sky-amber.d.ts +6 -0
- package/dist/themes/sky-amber.js +175 -0
- package/dist/themes/slate-cyan.css +217 -0
- package/dist/themes/slate-cyan.d.ts +6 -0
- package/dist/themes/slate-cyan.js +175 -0
- package/dist/themes/tailwind-color-pairs.md +31 -0
- package/dist/themes/teal-rose.css +217 -0
- package/dist/themes/teal-rose.d.ts +6 -0
- package/dist/themes/teal-rose.js +175 -0
- package/dist/themes/violet-lime.css +217 -0
- package/dist/themes/violet-lime.d.ts +6 -0
- package/dist/themes/violet-lime.js +175 -0
- package/dist/utils/design-tokens.d.ts +43 -0
- package/dist/utils/design-tokens.js +127 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/storage-abstraction.js +1 -1
- package/package.json +14 -11
- package/dist/components/Switch/SwitchButton.svelte +0 -135
- package/dist/components/Switch/SwitchButton.svelte.d.ts +0 -21
|
@@ -1,58 +1,179 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* =============================================================================
|
|
2
|
+
LIST ITEM BUTTON COMPONENT TOKENS
|
|
3
|
+
Override globally: :root { --stuic-list-item-button-radius: 0; }
|
|
4
|
+
Override locally: <ListItemButton style="--stuic-list-item-button-radius: 9999px;">
|
|
5
|
+
============================================================================= */
|
|
6
|
+
|
|
2
7
|
:root {
|
|
3
|
-
|
|
8
|
+
/* Structure tokens */
|
|
9
|
+
--stuic-list-item-button-radius: var(--radius-md);
|
|
10
|
+
--stuic-list-item-button-transition: 150ms;
|
|
11
|
+
--stuic-list-item-button-gap: 0.5rem;
|
|
12
|
+
|
|
13
|
+
/* Focus ring */
|
|
14
|
+
--stuic-list-item-button-ring-width: 3px;
|
|
15
|
+
--stuic-list-item-button-ring-offset: 0px;
|
|
16
|
+
--stuic-list-item-button-ring-color: var(--stuic-color-ring);
|
|
17
|
+
|
|
18
|
+
/* Size: sm */
|
|
19
|
+
--stuic-list-item-button-padding-x-sm: 0.5rem;
|
|
20
|
+
--stuic-list-item-button-padding-y-sm: 0.375rem;
|
|
21
|
+
--stuic-list-item-button-font-size-sm: var(--text-sm);
|
|
22
|
+
--stuic-list-item-button-min-height-sm: 2.25rem; /* 36px */
|
|
23
|
+
|
|
24
|
+
/* Size: md */
|
|
25
|
+
--stuic-list-item-button-padding-x-md: 0.625rem;
|
|
26
|
+
--stuic-list-item-button-padding-y-md: 0.5rem;
|
|
27
|
+
--stuic-list-item-button-font-size-md: var(--text-base);
|
|
28
|
+
--stuic-list-item-button-min-height-md: 2.5rem; /* 40px */
|
|
29
|
+
|
|
30
|
+
/* Size: lg */
|
|
31
|
+
--stuic-list-item-button-padding-x-lg: 0.75rem;
|
|
32
|
+
--stuic-list-item-button-padding-y-lg: 0.625rem;
|
|
33
|
+
--stuic-list-item-button-font-size-lg: var(--text-base);
|
|
34
|
+
--stuic-list-item-button-min-height-lg: 2.75rem; /* 44px - Apple HIG minimum */
|
|
35
|
+
|
|
36
|
+
/* Touch-friendly modifier */
|
|
37
|
+
--stuic-list-item-button-min-height-touch: 2.75rem; /* 44px */
|
|
38
|
+
--stuic-list-item-button-padding-y-touch: 0.625rem;
|
|
39
|
+
|
|
40
|
+
/* Color tokens: Base state */
|
|
41
|
+
--stuic-list-item-button-bg: var(--stuic-color-muted);
|
|
42
|
+
--stuic-list-item-button-text: var(--stuic-color-foreground);
|
|
43
|
+
--stuic-list-item-button-border: transparent;
|
|
44
|
+
|
|
45
|
+
/* Color tokens: Hover state */
|
|
46
|
+
--stuic-list-item-button-bg-hover: var(--stuic-color-primary);
|
|
47
|
+
--stuic-list-item-button-text-hover: var(--stuic-color-primary-foreground);
|
|
48
|
+
--stuic-list-item-button-border-hover: transparent;
|
|
49
|
+
|
|
50
|
+
/* Color tokens: Active/Selected state */
|
|
51
|
+
--stuic-list-item-button-bg-active: var(--stuic-color-primary);
|
|
52
|
+
--stuic-list-item-button-text-active: var(--stuic-color-primary-foreground);
|
|
53
|
+
--stuic-list-item-button-border-active: transparent;
|
|
54
|
+
|
|
55
|
+
/* Color tokens: Focus state (keyboard navigation) */
|
|
56
|
+
--stuic-list-item-button-bg-focus: var(--stuic-color-primary);
|
|
57
|
+
--stuic-list-item-button-text-focus: var(--stuic-color-primary-foreground);
|
|
58
|
+
--stuic-list-item-button-border-focus: transparent;
|
|
4
59
|
}
|
|
5
60
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
61
|
+
@layer components {
|
|
62
|
+
/* =============================================================================
|
|
63
|
+
BASE STYLES
|
|
64
|
+
============================================================================= */
|
|
65
|
+
|
|
66
|
+
.stuic-list-item-button {
|
|
67
|
+
/* Layout */
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: var(--stuic-list-item-button-gap);
|
|
71
|
+
width: 100%;
|
|
72
|
+
|
|
73
|
+
/* Typography */
|
|
74
|
+
text-align: left;
|
|
75
|
+
text-decoration: none;
|
|
76
|
+
|
|
77
|
+
/* Box model */
|
|
78
|
+
border-width: 1px;
|
|
79
|
+
border-style: solid;
|
|
80
|
+
border-radius: var(--stuic-list-item-button-radius);
|
|
81
|
+
|
|
82
|
+
/* Colors */
|
|
83
|
+
background: var(--stuic-list-item-button-bg);
|
|
84
|
+
color: var(--stuic-list-item-button-text);
|
|
85
|
+
border-color: var(--stuic-list-item-button-border);
|
|
86
|
+
|
|
87
|
+
/* Interaction */
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
user-select: none;
|
|
90
|
+
-webkit-tap-highlight-color: transparent;
|
|
91
|
+
touch-action: manipulation;
|
|
92
|
+
transition:
|
|
93
|
+
background var(--stuic-list-item-button-transition),
|
|
94
|
+
color var(--stuic-list-item-button-transition),
|
|
95
|
+
border-color var(--stuic-list-item-button-transition);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* =============================================================================
|
|
99
|
+
STATE STYLES
|
|
100
|
+
============================================================================= */
|
|
34
101
|
|
|
35
102
|
/* Hover state */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
103
|
+
.stuic-list-item-button:hover:not(:disabled):not([data-active]) {
|
|
104
|
+
background: var(--stuic-list-item-button-bg-hover);
|
|
105
|
+
color: var(--stuic-list-item-button-text-hover);
|
|
106
|
+
border-color: var(--stuic-list-item-button-border-hover);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Focus styles */
|
|
110
|
+
.stuic-list-item-button:focus {
|
|
111
|
+
outline: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.stuic-list-item-button:focus-visible:not([data-active]) {
|
|
115
|
+
background: var(--stuic-list-item-button-bg-focus);
|
|
116
|
+
color: var(--stuic-list-item-button-text-focus);
|
|
117
|
+
border-color: var(--stuic-list-item-button-border-focus);
|
|
118
|
+
outline: var(--stuic-list-item-button-ring-width) solid
|
|
119
|
+
var(--stuic-list-item-button-ring-color);
|
|
120
|
+
outline-offset: var(--stuic-list-item-button-ring-offset);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Active/Selected state (via data attribute) */
|
|
124
|
+
.stuic-list-item-button[data-active] {
|
|
125
|
+
background: var(--stuic-list-item-button-bg-active);
|
|
126
|
+
color: var(--stuic-list-item-button-text-active);
|
|
127
|
+
border-color: var(--stuic-list-item-button-border-active);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Focused state (keyboard navigation highlight, distinct from focus-visible) */
|
|
131
|
+
.stuic-list-item-button[data-focused]:not([data-active]) {
|
|
132
|
+
background: var(--stuic-list-item-button-bg-focus);
|
|
133
|
+
color: var(--stuic-list-item-button-text-focus);
|
|
134
|
+
border-color: var(--stuic-list-item-button-border-focus);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Disabled state */
|
|
138
|
+
.stuic-list-item-button:disabled {
|
|
139
|
+
opacity: 0.5;
|
|
140
|
+
cursor: not-allowed;
|
|
141
|
+
pointer-events: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* =============================================================================
|
|
145
|
+
SIZE VARIANTS
|
|
146
|
+
============================================================================= */
|
|
147
|
+
|
|
148
|
+
.stuic-list-item-button[data-size="sm"] {
|
|
149
|
+
padding: var(--stuic-list-item-button-padding-y-sm)
|
|
150
|
+
var(--stuic-list-item-button-padding-x-sm);
|
|
151
|
+
font-size: var(--stuic-list-item-button-font-size-sm);
|
|
152
|
+
min-height: var(--stuic-list-item-button-min-height-sm);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.stuic-list-item-button[data-size="md"] {
|
|
156
|
+
padding: var(--stuic-list-item-button-padding-y-md)
|
|
157
|
+
var(--stuic-list-item-button-padding-x-md);
|
|
158
|
+
font-size: var(--stuic-list-item-button-font-size-md);
|
|
159
|
+
min-height: var(--stuic-list-item-button-min-height-md);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.stuic-list-item-button[data-size="lg"] {
|
|
163
|
+
padding: var(--stuic-list-item-button-padding-y-lg)
|
|
164
|
+
var(--stuic-list-item-button-padding-x-lg);
|
|
165
|
+
font-size: var(--stuic-list-item-button-font-size-lg);
|
|
166
|
+
min-height: var(--stuic-list-item-button-min-height-lg);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* =============================================================================
|
|
170
|
+
TOUCH-FRIENDLY MODIFIER
|
|
171
|
+
Ensures minimum 44px touch target per Apple HIG guidelines
|
|
172
|
+
============================================================================= */
|
|
173
|
+
|
|
174
|
+
.stuic-list-item-button[data-touch-friendly] {
|
|
175
|
+
min-height: var(--stuic-list-item-button-min-height-touch);
|
|
176
|
+
padding-top: var(--stuic-list-item-button-padding-y-touch);
|
|
177
|
+
padding-bottom: var(--stuic-list-item-button-padding-y-touch);
|
|
178
|
+
}
|
|
58
179
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as ListItemButton, type Props as ListItemButtonProps,
|
|
1
|
+
export { default as ListItemButton, type Props as ListItemButtonProps, } from "./ListItemButton.svelte";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as ListItemButton,
|
|
1
|
+
export { default as ListItemButton, } from "./ListItemButton.svelte";
|
|
@@ -103,9 +103,8 @@
|
|
|
103
103
|
>
|
|
104
104
|
<div
|
|
105
105
|
class={twMerge(
|
|
106
|
-
"
|
|
106
|
+
"stuic-modal",
|
|
107
107
|
"flex flex-col overflow-hidden",
|
|
108
|
-
"rounded-none md:rounded-md",
|
|
109
108
|
"w-full flex-1",
|
|
110
109
|
classProp
|
|
111
110
|
)}
|
|
@@ -126,9 +125,3 @@
|
|
|
126
125
|
</div>
|
|
127
126
|
</div>
|
|
128
127
|
</ModalDialog>
|
|
129
|
-
|
|
130
|
-
<style>
|
|
131
|
-
.main {
|
|
132
|
-
scrollbar-width: thin;
|
|
133
|
-
}
|
|
134
|
-
</style>
|
|
@@ -118,6 +118,35 @@ By default, Modal is:
|
|
|
118
118
|
- **Mobile**: Full screen with 1rem margins from viewport edges
|
|
119
119
|
- **Desktop (md+)**: Centered, max-width 768px, auto height with max 80vh
|
|
120
120
|
|
|
121
|
+
## CSS Variables
|
|
122
|
+
|
|
123
|
+
Override to customize appearance:
|
|
124
|
+
|
|
125
|
+
| Variable | Default | Description |
|
|
126
|
+
|----------|---------|-------------|
|
|
127
|
+
| `--stuic-modal-bg` | `--stuic-color-surface` | Modal background color |
|
|
128
|
+
| `--stuic-modal-text` | `--stuic-color-surface-foreground` | Modal text color |
|
|
129
|
+
| `--stuic-modal-radius` | `--radius-md` | Border radius (desktop only) |
|
|
130
|
+
|
|
131
|
+
### Customization Examples
|
|
132
|
+
|
|
133
|
+
```css
|
|
134
|
+
/* Global override */
|
|
135
|
+
:root {
|
|
136
|
+
--stuic-modal-bg: var(--stuic-color-background);
|
|
137
|
+
--stuic-modal-radius: var(--radius-lg);
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
```svelte
|
|
142
|
+
<!-- Local override -->
|
|
143
|
+
<Modal style="--stuic-modal-bg: var(--stuic-color-muted);">
|
|
144
|
+
Content with muted background
|
|
145
|
+
</Modal>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Note: Modal inherits backdrop styling from ModalDialog. See ModalDialog documentation for backdrop customization (`--stuic-modal-dialog-backdrop`).
|
|
149
|
+
|
|
121
150
|
## Relationship to ModalDialog
|
|
122
151
|
|
|
123
152
|
Modal is a higher-level component built on `ModalDialog`. It provides:
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
MODAL COMPONENT TOKENS
|
|
3
|
+
Override globally: :root { --stuic-modal-radius: 0; }
|
|
4
|
+
Override locally: <Modal style="--stuic-modal-radius: var(--radius-lg);">
|
|
5
|
+
============================================================================ */
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
/* Background & text - reference theme tokens */
|
|
9
|
+
--stuic-modal-bg: var(--stuic-color-surface);
|
|
10
|
+
--stuic-modal-text: var(--stuic-color-surface-foreground);
|
|
11
|
+
|
|
12
|
+
/* Border radius (desktop only - mobile is fullscreen) */
|
|
13
|
+
--stuic-modal-radius: var(--radius-md);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@layer components {
|
|
17
|
+
/* ============================================================================
|
|
18
|
+
BASE STYLES
|
|
19
|
+
============================================================================ */
|
|
20
|
+
|
|
21
|
+
.stuic-modal {
|
|
22
|
+
background: var(--stuic-modal-bg);
|
|
23
|
+
color: var(--stuic-modal-text);
|
|
24
|
+
border-radius: 0; /* Mobile: fullscreen, no radius */
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (min-width: 48rem) {
|
|
28
|
+
/* md breakpoint */
|
|
29
|
+
.stuic-modal {
|
|
30
|
+
border-radius: var(--stuic-modal-radius);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Thin scrollbar for main content area */
|
|
35
|
+
.stuic-modal .main {
|
|
36
|
+
scrollbar-width: thin;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"fixed inset-4 m-auto size-auto",
|
|
138
138
|
"flex justify-center items-center",
|
|
139
139
|
"focus:outline-none focus-visible:outline-none",
|
|
140
|
-
"bg-transparent
|
|
140
|
+
"bg-transparent",
|
|
141
141
|
classDialog
|
|
142
142
|
)}
|
|
143
143
|
onclick={(e) => {
|
|
@@ -181,28 +181,9 @@
|
|
|
181
181
|
onpointerdown={stopPropagation()}
|
|
182
182
|
onclick={stopPropagation()}
|
|
183
183
|
data-type={type}
|
|
184
|
-
class={twMerge(
|
|
185
|
-
`box relative size-full overflow-auto
|
|
186
|
-
text-black dark:text-white bg-white dark:bg-neutral-800`,
|
|
187
|
-
classProp
|
|
188
|
-
)}
|
|
184
|
+
class={twMerge("box relative size-full overflow-auto", classProp)}
|
|
189
185
|
>
|
|
190
186
|
{@render children?.()}
|
|
191
187
|
</div>
|
|
192
188
|
</dialog>
|
|
193
189
|
{/if}
|
|
194
|
-
|
|
195
|
-
<style>
|
|
196
|
-
dialog[open]::backdrop {
|
|
197
|
-
animation: fadeIn 0.15s ease-out;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@keyframes fadeIn {
|
|
201
|
-
from {
|
|
202
|
-
opacity: 0;
|
|
203
|
-
}
|
|
204
|
-
to {
|
|
205
|
-
opacity: 1;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
</style>
|
|
@@ -108,6 +108,41 @@ A modal component using the native HTML `<dialog>` element with `showModal()`. P
|
|
|
108
108
|
</script>
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
+
## CSS Variables
|
|
112
|
+
|
|
113
|
+
### Component Tokens
|
|
114
|
+
|
|
115
|
+
Override to customize appearance:
|
|
116
|
+
|
|
117
|
+
| Variable | Default | Description |
|
|
118
|
+
|----------|---------|-------------|
|
|
119
|
+
| `--stuic-modal-dialog-radius` | `--radius-lg` | Border radius of content box |
|
|
120
|
+
| `--stuic-modal-dialog-transition` | `150ms` | Animation/transition duration |
|
|
121
|
+
| `--stuic-modal-dialog-backdrop` | `rgb(0 0 0 / 0.4)` | Backdrop overlay color |
|
|
122
|
+
| `--stuic-modal-dialog-bg` | `--stuic-color-surface` | Content box background |
|
|
123
|
+
| `--stuic-modal-dialog-text` | `--stuic-color-surface-foreground` | Content box text color |
|
|
124
|
+
| `--stuic-modal-dialog-shadow` | `--shadow-xl` | Content box shadow |
|
|
125
|
+
|
|
126
|
+
### Customization Examples
|
|
127
|
+
|
|
128
|
+
```css
|
|
129
|
+
/* Global override - all dialogs */
|
|
130
|
+
:root {
|
|
131
|
+
--stuic-modal-dialog-radius: 0;
|
|
132
|
+
--stuic-modal-dialog-backdrop: rgb(0 0 0 / 0.7);
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```svelte
|
|
137
|
+
<!-- Local override - single dialog -->
|
|
138
|
+
<ModalDialog
|
|
139
|
+
bind:this={dialog}
|
|
140
|
+
style="--stuic-modal-dialog-radius: 9999px;"
|
|
141
|
+
>
|
|
142
|
+
Content with pill-shaped radius
|
|
143
|
+
</ModalDialog>
|
|
144
|
+
```
|
|
145
|
+
|
|
111
146
|
## Relationship to Modal
|
|
112
147
|
|
|
113
148
|
`Modal` is a higher-level component built on top of `ModalDialog`.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
MODAL DIALOG COMPONENT TOKENS
|
|
3
|
+
Override globally: :root { --stuic-modal-dialog-radius: 0; }
|
|
4
|
+
Override locally: <ModalDialog style="--stuic-modal-dialog-radius: 9999px;">
|
|
5
|
+
============================================================================ */
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
/* Core customization */
|
|
9
|
+
--stuic-modal-dialog-radius: var(--radius-lg);
|
|
10
|
+
--stuic-modal-dialog-transition: 150ms;
|
|
11
|
+
|
|
12
|
+
/* Backdrop */
|
|
13
|
+
--stuic-modal-dialog-backdrop: rgb(0 0 0 / 0.4);
|
|
14
|
+
|
|
15
|
+
/* Content box - reference theme tokens */
|
|
16
|
+
--stuic-modal-dialog-bg: var(--stuic-color-surface);
|
|
17
|
+
--stuic-modal-dialog-text: var(--stuic-color-surface-foreground);
|
|
18
|
+
|
|
19
|
+
/* Optional shadow for elevation */
|
|
20
|
+
--stuic-modal-dialog-shadow: var(--shadow-xl);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@layer components {
|
|
24
|
+
/* ============================================================================
|
|
25
|
+
BACKDROP STYLES
|
|
26
|
+
============================================================================ */
|
|
27
|
+
|
|
28
|
+
.stuic-modal-dialog::backdrop {
|
|
29
|
+
background: var(--stuic-modal-dialog-backdrop);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ============================================================================
|
|
33
|
+
CONTENT BOX STYLES
|
|
34
|
+
============================================================================ */
|
|
35
|
+
|
|
36
|
+
.stuic-modal-dialog .box {
|
|
37
|
+
background: var(--stuic-modal-dialog-bg);
|
|
38
|
+
color: var(--stuic-modal-dialog-text);
|
|
39
|
+
border-radius: var(--stuic-modal-dialog-radius);
|
|
40
|
+
box-shadow: var(--stuic-modal-dialog-shadow);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ============================================================================
|
|
44
|
+
ANIMATIONS
|
|
45
|
+
============================================================================ */
|
|
46
|
+
|
|
47
|
+
.stuic-modal-dialog[open]::backdrop {
|
|
48
|
+
animation: stuic-modal-dialog-fadeIn var(--stuic-modal-dialog-transition) ease-out;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes stuic-modal-dialog-fadeIn {
|
|
52
|
+
from {
|
|
53
|
+
opacity: 0;
|
|
54
|
+
}
|
|
55
|
+
to {
|
|
56
|
+
opacity: 1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|