@marianmeres/stuic 3.0.0 → 3.0.2

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 (156) hide show
  1. package/dist/actions/index.d.ts +1 -0
  2. package/dist/actions/index.js +1 -0
  3. package/dist/actions/typeahead.svelte.d.ts +53 -0
  4. package/dist/actions/typeahead.svelte.js +328 -0
  5. package/dist/base.css +17 -0
  6. package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte +4 -3
  7. package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte.d.ts +4 -3
  8. package/dist/components/AlertConfirmPrompt/Current.svelte +1 -2
  9. package/dist/components/AlertConfirmPrompt/Current.svelte.d.ts +0 -1
  10. package/dist/components/AlertConfirmPrompt/index.css +47 -43
  11. package/dist/components/AssetsPreview/AssetsPreview.svelte +0 -1
  12. package/dist/components/AssetsPreview/AssetsPreview.svelte.d.ts +0 -1
  13. package/dist/components/AssetsPreview/index.css +31 -29
  14. package/dist/components/Avatar/Avatar.svelte +0 -1
  15. package/dist/components/Avatar/Avatar.svelte.d.ts +0 -1
  16. package/dist/components/Avatar/index.css +87 -85
  17. package/dist/components/Backdrop/Backdrop.svelte +0 -1
  18. package/dist/components/Backdrop/Backdrop.svelte.d.ts +0 -1
  19. package/dist/components/Backdrop/index.css +15 -13
  20. package/dist/components/Button/Button.svelte +0 -1
  21. package/dist/components/Button/Button.svelte.d.ts +0 -1
  22. package/dist/components/Button/index.css +431 -429
  23. package/dist/components/ButtonGroupRadio/ButtonGroupRadio.svelte +0 -1
  24. package/dist/components/ButtonGroupRadio/ButtonGroupRadio.svelte.d.ts +0 -1
  25. package/dist/components/ButtonGroupRadio/index.css +123 -117
  26. package/dist/components/Collapsible/index.css +17 -15
  27. package/dist/components/CommandMenu/CommandMenu.svelte +7 -4
  28. package/dist/components/CommandMenu/CommandMenu.svelte.d.ts +0 -1
  29. package/dist/components/CommandMenu/index.css +27 -25
  30. package/dist/components/DismissibleMessage/DismissibleMessage.svelte +0 -2
  31. package/dist/components/DismissibleMessage/DismissibleMessage.svelte.d.ts +0 -1
  32. package/dist/components/DismissibleMessage/index.css +116 -110
  33. package/dist/components/DropdownMenu/DropdownMenu.svelte +317 -74
  34. package/dist/components/DropdownMenu/DropdownMenu.svelte.d.ts +19 -1
  35. package/dist/components/DropdownMenu/index.css +236 -170
  36. package/dist/components/DropdownMenu/index.d.ts +1 -1
  37. package/dist/components/HoverExpandableWidth/HoverExpandableWidth.svelte +3 -1
  38. package/dist/components/HoverExpandableWidth/HoverExpandableWidth.svelte.d.ts +1 -0
  39. package/dist/components/Input/FieldInput.svelte +8 -0
  40. package/dist/components/Input/FieldInput.svelte.d.ts +2 -0
  41. package/dist/components/Input/FieldOptions.svelte +1 -1
  42. package/dist/components/Input/index.css +411 -398
  43. package/dist/components/KbdShortcut/KbdShortcut.svelte +4 -12
  44. package/dist/components/KbdShortcut/README.md +34 -0
  45. package/dist/components/KbdShortcut/index.css +55 -0
  46. package/dist/components/ListItemButton/ListItemButton.svelte +0 -1
  47. package/dist/components/ListItemButton/ListItemButton.svelte.d.ts +0 -1
  48. package/dist/components/ListItemButton/index.css +118 -116
  49. package/dist/components/Modal/Modal.svelte +0 -1
  50. package/dist/components/Modal/Modal.svelte.d.ts +0 -1
  51. package/dist/components/Modal/index.css +18 -16
  52. package/dist/components/ModalDialog/index.css +29 -27
  53. package/dist/components/Nav/Nav.svelte +732 -0
  54. package/dist/components/Nav/Nav.svelte.d.ts +110 -0
  55. package/dist/components/Nav/README.md +334 -0
  56. package/dist/components/Nav/index.css +318 -0
  57. package/dist/components/Nav/index.d.ts +1 -0
  58. package/dist/components/Nav/index.js +1 -0
  59. package/dist/components/Notifications/Notifications.svelte +2 -3
  60. package/dist/components/Notifications/Notifications.svelte.d.ts +0 -1
  61. package/dist/components/Notifications/index.css +158 -158
  62. package/dist/components/Notifications/notifications-stack.svelte.d.ts +4 -0
  63. package/dist/components/Notifications/notifications-stack.svelte.js +8 -0
  64. package/dist/components/Progress/Progress.svelte +4 -2
  65. package/dist/components/Progress/Progress.svelte.d.ts +1 -0
  66. package/dist/components/Progress/README.md +86 -15
  67. package/dist/components/Progress/_internal/Bar.svelte +4 -15
  68. package/dist/components/Progress/_internal/Bar.svelte.d.ts +1 -1
  69. package/dist/components/Progress/_internal/Circle.svelte +30 -2
  70. package/dist/components/Progress/_internal/Circle.svelte.d.ts +1 -0
  71. package/dist/components/Progress/index.css +47 -1
  72. package/dist/components/Skeleton/README.md +152 -0
  73. package/dist/components/Skeleton/Skeleton.svelte +6 -7
  74. package/dist/components/Skeleton/Skeleton.svelte.d.ts +0 -1
  75. package/dist/components/Skeleton/index.css +73 -43
  76. package/dist/components/Spinner/README.md +149 -37
  77. package/dist/components/Spinner/Spinner.svelte +14 -38
  78. package/dist/components/Spinner/Spinner.svelte.d.ts +2 -1
  79. package/dist/components/Spinner/SpinnerCircle.svelte +6 -34
  80. package/dist/components/Spinner/SpinnerCircle.svelte.d.ts +1 -0
  81. package/dist/components/Spinner/SpinnerCircleOscillate.svelte +10 -5
  82. package/dist/components/Spinner/SpinnerUnicode.svelte +3 -1
  83. package/dist/components/Spinner/SpinnerUnicode.svelte.d.ts +1 -0
  84. package/dist/components/Spinner/index.css +104 -0
  85. package/dist/components/Switch/README.md +34 -18
  86. package/dist/components/Switch/Switch.svelte +24 -46
  87. package/dist/components/Switch/Switch.svelte.d.ts +4 -2
  88. package/dist/components/Switch/index.css +120 -2
  89. package/dist/components/Switch/index.d.ts +1 -2
  90. package/dist/components/Switch/index.js +1 -2
  91. package/dist/components/TabbedMenu/README.md +28 -17
  92. package/dist/components/TabbedMenu/TabbedMenu.svelte +5 -46
  93. package/dist/components/TabbedMenu/TabbedMenu.svelte.d.ts +0 -1
  94. package/dist/components/TabbedMenu/index.css +85 -3
  95. package/dist/components/ThemePreview/ThemePreview.svelte +86 -33
  96. package/dist/components/ThemePreview/ThemePreview.svelte.d.ts +3 -1
  97. package/dist/components/ThemePreview/index.css +24 -8
  98. package/dist/components/TwCheck/README.md +32 -13
  99. package/dist/components/TwCheck/TwCheck.svelte +11 -9
  100. package/dist/components/TwCheck/TwCheck.svelte.d.ts +0 -1
  101. package/dist/components/TwCheck/index.css +14 -0
  102. package/dist/components/TypeaheadInput/TypeaheadInput.svelte +19 -187
  103. package/dist/components/TypeaheadInput/TypeaheadInput.svelte.d.ts +4 -2
  104. package/dist/icons/index.d.ts +1 -0
  105. package/dist/icons/index.js +1 -0
  106. package/dist/index.css +44 -39
  107. package/dist/index.d.ts +1 -0
  108. package/dist/index.js +1 -0
  109. package/dist/themes/blue-orange.css +246 -156
  110. package/dist/themes/blue-orange.js +24 -0
  111. package/dist/themes/cyan-red.css +246 -156
  112. package/dist/themes/cyan-red.js +24 -0
  113. package/dist/themes/cyan-slate.css +246 -156
  114. package/dist/themes/cyan-slate.js +25 -1
  115. package/dist/themes/emerald-pink.css +246 -156
  116. package/dist/themes/emerald-pink.js +25 -1
  117. package/dist/themes/fuchsia-emerald.css +246 -156
  118. package/dist/themes/fuchsia-emerald.js +25 -1
  119. package/dist/themes/gray.css +246 -156
  120. package/dist/themes/gray.js +24 -0
  121. package/dist/themes/indigo-amber.css +246 -156
  122. package/dist/themes/indigo-amber.js +26 -2
  123. package/dist/themes/neutral.css +246 -156
  124. package/dist/themes/neutral.js +24 -0
  125. package/dist/themes/pink-emerald.css +246 -156
  126. package/dist/themes/pink-emerald.js +25 -1
  127. package/dist/themes/pink-teal.css +253 -0
  128. package/dist/themes/pink-teal.d.ts +6 -0
  129. package/dist/themes/pink-teal.js +175 -0
  130. package/dist/themes/purple-yellow.css +246 -156
  131. package/dist/themes/purple-yellow.js +24 -0
  132. package/dist/themes/rainbow.css +246 -156
  133. package/dist/themes/rainbow.js +25 -1
  134. package/dist/themes/red-blue.css +246 -156
  135. package/dist/themes/red-blue.js +24 -0
  136. package/dist/themes/red-cyan.css +246 -156
  137. package/dist/themes/red-cyan.js +24 -0
  138. package/dist/themes/red-sky.css +253 -0
  139. package/dist/themes/red-sky.d.ts +6 -0
  140. package/dist/themes/red-sky.js +175 -0
  141. package/dist/themes/rose-teal.css +246 -156
  142. package/dist/themes/rose-teal.js +24 -0
  143. package/dist/themes/sky-amber.css +246 -156
  144. package/dist/themes/sky-amber.js +26 -2
  145. package/dist/themes/slate-cyan.css +246 -156
  146. package/dist/themes/slate-cyan.js +25 -1
  147. package/dist/themes/teal-rose.css +246 -156
  148. package/dist/themes/teal-rose.js +24 -0
  149. package/dist/themes/violet-lime.css +246 -156
  150. package/dist/themes/violet-lime.js +27 -3
  151. package/dist/utils/design-tokens.d.ts +1 -1
  152. package/dist/utils/design-tokens.js +44 -3
  153. package/dist/utils/storage-abstraction.js +1 -1
  154. package/package.json +11 -28
  155. package/dist/components/Switch/SwitchButton.svelte +0 -134
  156. package/dist/components/Switch/SwitchButton.svelte.d.ts +0 -21
@@ -64,204 +64,270 @@
64
64
 
65
65
  /* Expandable section indent */
66
66
  --stuic-dropdown-menu-expandable-indent: calc(var(--spacing) * 4);
67
+
68
+ /* Search */
69
+ --stuic-dropdown-menu-search-bg: var(--stuic-color-surface);
70
+ --stuic-dropdown-menu-search-border: var(--stuic-color-border);
71
+ --stuic-dropdown-menu-search-text: var(--stuic-color-muted-foreground);
67
72
  }
68
73
 
69
- /* =============================================================================
70
- BASE STYLES
71
- ============================================================================= */
74
+ @layer components {
75
+ /* =============================================================================
76
+ BASE STYLES
77
+ ============================================================================= */
72
78
 
73
- .stuic-dropdown-menu {
74
- position: relative;
75
- display: inline-block;
76
- }
79
+ .stuic-dropdown-menu {
80
+ position: relative;
81
+ display: inline-block;
82
+ }
77
83
 
78
- /* =============================================================================
79
- TRIGGER BUTTON
80
- ============================================================================= */
84
+ /* =============================================================================
85
+ TRIGGER BUTTON
86
+ ============================================================================= */
87
+
88
+ .stuic-dropdown-menu-trigger {
89
+ /* Layout */
90
+ display: inline-flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ gap: var(--stuic-dropdown-menu-gap);
94
+
95
+ /* Sizing */
96
+ padding: var(--stuic-dropdown-menu-trigger-padding-y)
97
+ var(--stuic-dropdown-menu-trigger-padding-x);
98
+
99
+ /* Box model */
100
+ border-width: 1px;
101
+ border-style: solid;
102
+ border-radius: var(--stuic-dropdown-menu-radius);
103
+
104
+ /* Colors */
105
+ background: var(--stuic-dropdown-menu-trigger-bg);
106
+ color: var(--stuic-dropdown-menu-trigger-text);
107
+ border-color: var(--stuic-dropdown-menu-trigger-border);
108
+
109
+ /* Interaction */
110
+ cursor: pointer;
111
+ user-select: none;
112
+ -webkit-tap-highlight-color: transparent;
113
+ touch-action: manipulation;
114
+ transition:
115
+ background var(--stuic-dropdown-menu-transition),
116
+ color var(--stuic-dropdown-menu-transition),
117
+ border-color var(--stuic-dropdown-menu-transition);
118
+ }
81
119
 
82
- .stuic-dropdown-menu-trigger {
83
- /* Layout */
84
- display: inline-flex;
85
- align-items: center;
86
- justify-content: center;
87
- gap: var(--stuic-dropdown-menu-gap);
88
-
89
- /* Sizing */
90
- padding: var(--stuic-dropdown-menu-trigger-padding-y)
91
- var(--stuic-dropdown-menu-trigger-padding-x);
92
-
93
- /* Box model */
94
- border-width: 1px;
95
- border-style: solid;
96
- border-radius: var(--stuic-dropdown-menu-radius);
97
-
98
- /* Colors */
99
- background: var(--stuic-dropdown-menu-trigger-bg);
100
- color: var(--stuic-dropdown-menu-trigger-text);
101
- border-color: var(--stuic-dropdown-menu-trigger-border);
102
-
103
- /* Interaction */
104
- cursor: pointer;
105
- user-select: none;
106
- -webkit-tap-highlight-color: transparent;
107
- touch-action: manipulation;
108
- transition:
109
- background var(--stuic-dropdown-menu-transition),
110
- color var(--stuic-dropdown-menu-transition),
111
- border-color var(--stuic-dropdown-menu-transition);
112
- }
120
+ .stuic-dropdown-menu-trigger:hover:not(:disabled) {
121
+ background: var(--stuic-dropdown-menu-trigger-bg-hover);
122
+ color: var(--stuic-dropdown-menu-trigger-text-hover);
123
+ border-color: var(--stuic-dropdown-menu-trigger-border-hover);
124
+ }
113
125
 
114
- .stuic-dropdown-menu-trigger:hover:not(:disabled) {
115
- background: var(--stuic-dropdown-menu-trigger-bg-hover);
116
- color: var(--stuic-dropdown-menu-trigger-text-hover);
117
- border-color: var(--stuic-dropdown-menu-trigger-border-hover);
118
- }
126
+ .stuic-dropdown-menu-trigger:active:not(:disabled) {
127
+ background: var(--stuic-dropdown-menu-trigger-bg-active);
128
+ color: var(--stuic-dropdown-menu-trigger-text-active);
129
+ border-color: var(--stuic-dropdown-menu-trigger-border-active);
130
+ }
119
131
 
120
- .stuic-dropdown-menu-trigger:active:not(:disabled) {
121
- background: var(--stuic-dropdown-menu-trigger-bg-active);
122
- color: var(--stuic-dropdown-menu-trigger-text-active);
123
- border-color: var(--stuic-dropdown-menu-trigger-border-active);
124
- }
132
+ .stuic-dropdown-menu-trigger:focus-visible {
133
+ outline: var(--stuic-dropdown-menu-ring-width) solid
134
+ var(--stuic-dropdown-menu-ring-color);
135
+ outline-offset: var(--stuic-dropdown-menu-ring-offset);
136
+ }
125
137
 
126
- .stuic-dropdown-menu-trigger:focus-visible {
127
- outline: var(--stuic-dropdown-menu-ring-width) solid
128
- var(--stuic-dropdown-menu-ring-color);
129
- outline-offset: var(--stuic-dropdown-menu-ring-offset);
130
- }
138
+ /* =============================================================================
139
+ DROPDOWN CONTAINER
140
+ ============================================================================= */
131
141
 
132
- /* =============================================================================
133
- DROPDOWN CONTAINER
134
- ============================================================================= */
142
+ .stuic-dropdown-menu-dropdown {
143
+ /* Colors */
144
+ background: var(--stuic-dropdown-menu-bg);
145
+ color: var(--stuic-dropdown-menu-text);
146
+ border: 1px solid var(--stuic-dropdown-menu-border);
147
+ box-shadow: var(--stuic-dropdown-menu-shadow);
148
+
149
+ /* Box model */
150
+ border-radius: var(--stuic-dropdown-menu-radius);
151
+ padding: var(--stuic-dropdown-menu-padding);
152
+
153
+ /* Layout */
154
+ min-width: var(--stuic-dropdown-menu-min-width);
155
+ overflow-y: auto;
156
+ scrollbar-width: thin;
157
+
158
+ /* Stacking */
159
+ z-index: 50;
160
+ }
135
161
 
136
- .stuic-dropdown-menu-dropdown {
137
- /* Colors */
138
- background: var(--stuic-dropdown-menu-bg);
139
- color: var(--stuic-dropdown-menu-text);
140
- border: 1px solid var(--stuic-dropdown-menu-border);
141
- box-shadow: var(--stuic-dropdown-menu-shadow);
162
+ /* =============================================================================
163
+ DIVIDER
164
+ ============================================================================= */
142
165
 
143
- /* Box model */
144
- border-radius: var(--stuic-dropdown-menu-radius);
145
- padding: var(--stuic-dropdown-menu-padding);
166
+ .stuic-dropdown-menu-divider {
167
+ height: var(--stuic-dropdown-menu-divider-height);
168
+ margin: var(--stuic-dropdown-menu-divider-margin-y) 0;
169
+ background: var(--stuic-dropdown-menu-divider-bg);
170
+ }
146
171
 
147
- /* Layout */
148
- min-width: var(--stuic-dropdown-menu-min-width);
149
- overflow-y: auto;
150
- scrollbar-width: thin;
172
+ /* =============================================================================
173
+ HEADER (Section Label)
174
+ ============================================================================= */
175
+
176
+ .stuic-dropdown-menu-header {
177
+ padding: var(--stuic-dropdown-menu-header-padding-y)
178
+ var(--stuic-dropdown-menu-header-padding-x);
179
+ font-size: var(--stuic-dropdown-menu-header-font-size);
180
+ font-weight: var(--stuic-dropdown-menu-header-font-weight);
181
+ letter-spacing: var(--stuic-dropdown-menu-header-letter-spacing);
182
+ text-transform: var(--stuic-dropdown-menu-header-text-transform);
183
+ color: var(--stuic-dropdown-menu-header-text);
184
+ user-select: none;
185
+ }
151
186
 
152
- /* Stacking */
153
- z-index: 50;
154
- }
187
+ /* =============================================================================
188
+ BACKDROP (Fallback Mode)
189
+ ============================================================================= */
155
190
 
156
- /* =============================================================================
157
- DIVIDER
158
- ============================================================================= */
191
+ .stuic-dropdown-menu-backdrop {
192
+ position: fixed;
193
+ inset: 0;
194
+ background: var(--stuic-dropdown-menu-backdrop-bg);
195
+ z-index: var(--stuic-dropdown-menu-backdrop-z-index);
196
+ transition-property: opacity;
197
+ }
159
198
 
160
- .stuic-dropdown-menu-divider {
161
- height: var(--stuic-dropdown-menu-divider-height);
162
- margin: var(--stuic-dropdown-menu-divider-margin-y) 0;
163
- background: var(--stuic-dropdown-menu-divider-bg);
164
- }
199
+ /* =============================================================================
200
+ CLOSE BUTTON (Fallback Mode)
201
+ ============================================================================= */
202
+
203
+ .stuic-dropdown-menu-close {
204
+ background: var(--stuic-dropdown-menu-close-bg);
205
+ color: var(--stuic-dropdown-menu-close-text);
206
+ opacity: var(--stuic-dropdown-menu-close-opacity);
207
+ border-radius: var(--stuic-dropdown-menu-radius);
208
+ padding: calc(var(--spacing) * 2);
209
+ cursor: pointer;
210
+ line-height: 1;
211
+ transition: opacity var(--stuic-dropdown-menu-transition);
212
+ }
165
213
 
166
- /* =============================================================================
167
- HEADER (Section Label)
168
- ============================================================================= */
214
+ .stuic-dropdown-menu-close:hover {
215
+ opacity: var(--stuic-dropdown-menu-close-opacity-hover);
216
+ }
169
217
 
170
- .stuic-dropdown-menu-header {
171
- padding: var(--stuic-dropdown-menu-header-padding-y)
172
- var(--stuic-dropdown-menu-header-padding-x);
173
- font-size: var(--stuic-dropdown-menu-header-font-size);
174
- font-weight: var(--stuic-dropdown-menu-header-font-weight);
175
- letter-spacing: var(--stuic-dropdown-menu-header-letter-spacing);
176
- text-transform: var(--stuic-dropdown-menu-header-text-transform);
177
- color: var(--stuic-dropdown-menu-header-text);
178
- user-select: none;
179
- }
218
+ /* =============================================================================
219
+ EXPANDABLE SECTION
220
+ ============================================================================= */
180
221
 
181
- /* =============================================================================
182
- BACKDROP (Fallback Mode)
183
- ============================================================================= */
222
+ .stuic-dropdown-menu-expandable-content {
223
+ padding-left: var(--stuic-dropdown-menu-expandable-indent);
224
+ overflow: hidden;
225
+ }
184
226
 
185
- .stuic-dropdown-menu-backdrop {
186
- position: fixed;
187
- inset: 0;
188
- background: var(--stuic-dropdown-menu-backdrop-bg);
189
- z-index: var(--stuic-dropdown-menu-backdrop-z-index);
190
- transition-property: opacity;
191
- }
227
+ /* =============================================================================
228
+ LIST ITEM BUTTON OVERRIDES FOR DROPDOWN CONTEXT
229
+ Reset default ListItemButton background to transparent within dropdown.
230
+ ============================================================================= */
192
231
 
193
- /* =============================================================================
194
- CLOSE BUTTON (Fallback Mode)
195
- ============================================================================= */
232
+ .stuic-dropdown-menu-dropdown .stuic-list-item-button {
233
+ --stuic-list-item-button-bg: transparent;
234
+ --stuic-list-item-button-border: transparent;
235
+ }
196
236
 
197
- .stuic-dropdown-menu-close {
198
- background: var(--stuic-dropdown-menu-close-bg);
199
- color: var(--stuic-dropdown-menu-close-text);
200
- opacity: var(--stuic-dropdown-menu-close-opacity);
201
- border-radius: var(--stuic-dropdown-menu-radius);
202
- padding: calc(var(--spacing) * 2);
203
- cursor: pointer;
204
- line-height: 1;
205
- transition: opacity var(--stuic-dropdown-menu-transition);
206
- }
237
+ /* =============================================================================
238
+ CSS ANCHOR POSITIONING (when supported)
239
+ ============================================================================= */
207
240
 
208
- .stuic-dropdown-menu-close:hover {
209
- opacity: var(--stuic-dropdown-menu-close-opacity-hover);
210
- }
241
+ @position-try --pop-top {
242
+ position-area: top;
243
+ }
244
+ @position-try --pop-top-span-right {
245
+ position-area: top span-right;
246
+ }
247
+ @position-try --pop-top-span-left {
248
+ position-area: top span-left;
249
+ }
250
+ @position-try --pop-bottom {
251
+ position-area: bottom;
252
+ }
253
+ @position-try --pop-bottom-span-right {
254
+ position-area: bottom span-right;
255
+ }
256
+ @position-try --pop-bottom-span-left {
257
+ position-area: bottom span-left;
258
+ }
259
+ @position-try --pop-left {
260
+ position-area: left;
261
+ }
262
+ @position-try --pop-right {
263
+ position-area: right;
264
+ }
211
265
 
212
- /* =============================================================================
213
- EXPANDABLE SECTION
214
- ============================================================================= */
266
+ @supports (anchor-name: --anchor) {
267
+ .stuic-dropdown-menu-dropdown {
268
+ position-try-fallbacks:
269
+ flip-inline, --pop-bottom-span-right, --pop-bottom-span-left, --pop-bottom,
270
+ flip-block, --pop-top-span-right, --pop-top-span-left, --pop-top, --pop-left,
271
+ --pop-right;
272
+ }
273
+ }
215
274
 
216
- .stuic-dropdown-menu-expandable-content {
217
- padding-left: var(--stuic-dropdown-menu-expandable-indent);
218
- overflow: hidden;
219
- }
275
+ /* =============================================================================
276
+ SEARCH INPUT
277
+ ============================================================================= */
278
+
279
+ .stuic-dropdown-menu-search {
280
+ position: sticky;
281
+ top: 0;
282
+ z-index: 10;
283
+ display: flex;
284
+ align-items: center;
285
+ gap: calc(var(--spacing) * 1);
286
+ padding: calc(var(--spacing) * 1.5) calc(var(--spacing) * 2);
287
+ background: var(--stuic-dropdown-menu-search-bg);
288
+ border-bottom: 1px solid var(--stuic-dropdown-menu-search-border);
289
+ margin: calc(var(--stuic-dropdown-menu-padding) * -1);
290
+ margin-bottom: var(--stuic-dropdown-menu-padding);
291
+ }
220
292
 
221
- /* =============================================================================
222
- LIST ITEM BUTTON OVERRIDES FOR DROPDOWN CONTEXT
223
- Reset default ListItemButton background to transparent within dropdown.
224
- ============================================================================= */
293
+ .stuic-dropdown-menu-search-icon {
294
+ color: var(--stuic-dropdown-menu-search-text);
295
+ flex-shrink: 0;
296
+ display: flex;
297
+ }
225
298
 
226
- .stuic-dropdown-menu-dropdown .stuic-list-item-button {
227
- --stuic-list-item-button-bg: transparent;
228
- --stuic-list-item-button-border: transparent;
229
- }
299
+ .stuic-dropdown-menu-search-input {
300
+ flex: 1;
301
+ min-width: 0;
302
+ background: transparent;
303
+ border: none;
304
+ outline: none;
305
+ color: var(--stuic-dropdown-menu-text);
306
+ font-size: inherit;
307
+ }
230
308
 
231
- /* =============================================================================
232
- CSS ANCHOR POSITIONING (when supported)
233
- ============================================================================= */
309
+ .stuic-dropdown-menu-search-input::placeholder {
310
+ color: var(--stuic-dropdown-menu-search-text);
311
+ }
234
312
 
235
- @position-try --pop-top {
236
- position-area: top;
237
- }
238
- @position-try --pop-top-span-right {
239
- position-area: top span-right;
240
- }
241
- @position-try --pop-top-span-left {
242
- position-area: top span-left;
243
- }
244
- @position-try --pop-bottom {
245
- position-area: bottom;
246
- }
247
- @position-try --pop-bottom-span-right {
248
- position-area: bottom span-right;
249
- }
250
- @position-try --pop-bottom-span-left {
251
- position-area: bottom span-left;
252
- }
253
- @position-try --pop-left {
254
- position-area: left;
255
- }
256
- @position-try --pop-right {
257
- position-area: right;
258
- }
313
+ .stuic-dropdown-menu-search-clear {
314
+ background: transparent;
315
+ border: none;
316
+ color: var(--stuic-dropdown-menu-search-text);
317
+ cursor: pointer;
318
+ padding: calc(var(--spacing) * 0.5);
319
+ display: flex;
320
+ border-radius: var(--stuic-dropdown-menu-radius);
321
+ transition: color var(--stuic-dropdown-menu-transition);
322
+ }
259
323
 
260
- @supports (anchor-name: --anchor) {
261
- .stuic-dropdown-menu-dropdown {
262
- position-try-fallbacks:
263
- flip-inline, --pop-bottom-span-right, --pop-bottom-span-left, --pop-bottom,
264
- flip-block, --pop-top-span-right, --pop-top-span-left, --pop-top, --pop-left,
265
- --pop-right;
324
+ .stuic-dropdown-menu-search-clear:hover {
325
+ color: var(--stuic-dropdown-menu-text);
326
+ }
327
+
328
+ .stuic-dropdown-menu-no-results {
329
+ padding: calc(var(--spacing) * 4);
330
+ text-align: center;
331
+ color: var(--stuic-dropdown-menu-search-text);
266
332
  }
267
333
  }
@@ -1 +1 @@
1
- export { default as DropdownMenu, type Props as DropdownMenuProps, type DropdownMenuItem, type DropdownMenuActionItem, type DropdownMenuDividerItem, type DropdownMenuHeaderItem, type DropdownMenuCustomItem, type DropdownMenuExpandableItem, type DropdownMenuFlatItem, type DropdownMenuPosition, type NavigableItem, type NavigableExpandable, DROPDOWN_MENU_BASE_CLASSES, DROPDOWN_MENU_TRIGGER_CLASSES, DROPDOWN_MENU_DROPDOWN_CLASSES, DROPDOWN_MENU_DIVIDER_CLASSES, DROPDOWN_MENU_HEADER_CLASSES, } from "./DropdownMenu.svelte";
1
+ export { default as DropdownMenu, type Props as DropdownMenuProps, type DropdownMenuItem, type DropdownMenuActionItem, type DropdownMenuDividerItem, type DropdownMenuHeaderItem, type DropdownMenuCustomItem, type DropdownMenuExpandableItem, type DropdownMenuFlatItem, type DropdownMenuPosition, type DropdownMenuSearchConfig, type NavigableItem, type NavigableExpandable, DROPDOWN_MENU_BASE_CLASSES, DROPDOWN_MENU_TRIGGER_CLASSES, DROPDOWN_MENU_DROPDOWN_CLASSES, DROPDOWN_MENU_DIVIDER_CLASSES, DROPDOWN_MENU_HEADER_CLASSES, } from "./DropdownMenu.svelte";
@@ -9,6 +9,7 @@
9
9
  targetWidth?: number;
10
10
  delayIn?: number;
11
11
  delayOut?: number;
12
+ zIndex?: number;
12
13
  children: Snippet<
13
14
  [
14
15
  {
@@ -38,6 +39,7 @@
38
39
  targetWidth = 256,
39
40
  delayIn = 500,
40
41
  delayOut = 300,
42
+ zIndex = 10,
41
43
  class: classProp,
42
44
  children,
43
45
  ...rest
@@ -95,7 +97,7 @@
95
97
  el.style.width = "auto";
96
98
  el.style.height = "auto";
97
99
 
98
- el.style.zIndex = "1";
100
+ el.style.zIndex = `${zIndex}`;
99
101
 
100
102
  // kind of ugly - need to set props in multiple steps...
101
103
  (async () => {
@@ -7,6 +7,7 @@ export interface Props {
7
7
  targetWidth?: number;
8
8
  delayIn?: number;
9
9
  delayOut?: number;
10
+ zIndex?: number;
10
11
  children: Snippet<[
11
12
  {
12
13
  isExpanded: boolean;
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" module>
2
2
  import type { Snippet } from "svelte";
3
3
  import type { HTMLInputAttributes } from "svelte/elements";
4
+ import type { TypeaheadOptions } from "../../actions/typeahead.svelte.js";
4
5
  import type { ValidateOptions } from "../../actions/validate.svelte.js";
5
6
  import type { THC } from "../Thc/Thc.svelte";
6
7
 
@@ -17,6 +18,7 @@
17
18
  tabindex?: number;
18
19
  renderSize?: "sm" | "md" | "lg" | string;
19
20
  useTrim?: boolean;
21
+ useTypeahead?: boolean | Omit<TypeaheadOptions, "enabled">;
20
22
  required?: boolean;
21
23
  disabled?: boolean;
22
24
  validate?: boolean | Omit<ValidateOptions, "setValidationResult">;
@@ -42,6 +44,7 @@
42
44
 
43
45
  <script lang="ts">
44
46
  import { trim } from "../../actions/trim.svelte.js";
47
+ import { typeahead } from "../../actions/typeahead.svelte.js";
45
48
  import {
46
49
  validate as validateAction,
47
50
  type ValidationResult,
@@ -61,6 +64,7 @@
61
64
  class: classProp,
62
65
  renderSize = "md",
63
66
  useTrim = true,
67
+ useTypeahead,
64
68
  //
65
69
  required = false,
66
70
  disabled = false,
@@ -131,6 +135,10 @@
131
135
  enabled: useTrim,
132
136
  setValue: (v: string) => useTrim && (value = v),
133
137
  })}
138
+ use:typeahead={() => ({
139
+ enabled: !!useTypeahead,
140
+ ...(typeof useTypeahead === "boolean" ? {} : useTypeahead),
141
+ })}
134
142
  use:validateAction={() => ({
135
143
  enabled: !!validate,
136
144
  ...(typeof validate === "boolean" ? {} : validate),
@@ -1,5 +1,6 @@
1
1
  import type { Snippet } from "svelte";
2
2
  import type { HTMLInputAttributes } from "svelte/elements";
3
+ import type { TypeaheadOptions } from "../../actions/typeahead.svelte.js";
3
4
  import type { ValidateOptions } from "../../actions/validate.svelte.js";
4
5
  import type { THC } from "../Thc/Thc.svelte";
5
6
  type SnippetWithId = Snippet<[{
@@ -16,6 +17,7 @@ export interface Props extends HTMLInputAttributes, Record<string, any> {
16
17
  tabindex?: number;
17
18
  renderSize?: "sm" | "md" | "lg" | string;
18
19
  useTrim?: boolean;
20
+ useTypeahead?: boolean | Omit<TypeaheadOptions, "enabled">;
19
21
  required?: boolean;
20
22
  disabled?: boolean;
21
23
  validate?: boolean | Omit<ValidateOptions, "setValidationResult">;
@@ -561,7 +561,7 @@
561
561
  bind:this={modalDialog}
562
562
  preEscapeClose={escape}
563
563
  classDialog="items-start"
564
- class="w-full max-w-2xl bg-transparent pointer-events-none"
564
+ class={twMerge("w-full max-w-2xl bg-transparent! shadow-none! pointer-events-none")}
565
565
  ariaLabelledby={id}
566
566
  {noScrollLock}
567
567
  >