@marianmeres/stuic 3.0.1 → 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 (43) hide show
  1. package/dist/components/AlertConfirmPrompt/index.css +4 -4
  2. package/dist/components/Button/index.css +7 -7
  3. package/dist/components/DismissibleMessage/DismissibleMessage.svelte +0 -1
  4. package/dist/components/DismissibleMessage/index.css +10 -10
  5. package/dist/components/DropdownMenu/DropdownMenu.svelte +317 -73
  6. package/dist/components/DropdownMenu/DropdownMenu.svelte.d.ts +19 -0
  7. package/dist/components/DropdownMenu/index.css +64 -0
  8. package/dist/components/DropdownMenu/index.d.ts +1 -1
  9. package/dist/components/HoverExpandableWidth/HoverExpandableWidth.svelte +3 -1
  10. package/dist/components/HoverExpandableWidth/HoverExpandableWidth.svelte.d.ts +1 -0
  11. package/dist/components/Input/index.css +1 -1
  12. package/dist/components/Switch/index.css +1 -1
  13. package/dist/components/ThemePreview/ThemePreview.svelte +17 -17
  14. package/dist/components/ThemePreview/index.css +7 -7
  15. package/dist/icons/index.d.ts +1 -0
  16. package/dist/icons/index.js +1 -0
  17. package/dist/themes/blue-orange.css +246 -210
  18. package/dist/themes/cyan-red.css +246 -210
  19. package/dist/themes/cyan-slate.css +246 -210
  20. package/dist/themes/emerald-pink.css +246 -210
  21. package/dist/themes/fuchsia-emerald.css +246 -210
  22. package/dist/themes/gray.css +246 -210
  23. package/dist/themes/indigo-amber.css +246 -210
  24. package/dist/themes/neutral.css +246 -210
  25. package/dist/themes/pink-emerald.css +246 -210
  26. package/dist/themes/pink-teal.css +253 -0
  27. package/dist/themes/pink-teal.d.ts +6 -0
  28. package/dist/themes/pink-teal.js +175 -0
  29. package/dist/themes/purple-yellow.css +246 -210
  30. package/dist/themes/rainbow.css +246 -210
  31. package/dist/themes/red-blue.css +246 -210
  32. package/dist/themes/red-cyan.css +246 -210
  33. package/dist/themes/red-sky.css +253 -0
  34. package/dist/themes/red-sky.d.ts +6 -0
  35. package/dist/themes/red-sky.js +175 -0
  36. package/dist/themes/rose-teal.css +246 -210
  37. package/dist/themes/sky-amber.css +246 -210
  38. package/dist/themes/slate-cyan.css +246 -210
  39. package/dist/themes/teal-rose.css +246 -210
  40. package/dist/themes/violet-lime.css +246 -210
  41. package/dist/utils/design-tokens.d.ts +1 -1
  42. package/dist/utils/design-tokens.js +15 -1
  43. package/package.json +1 -1
@@ -72,6 +72,19 @@ export interface NavigableExpandable {
72
72
  expandableItem: DropdownMenuExpandableItem;
73
73
  }
74
74
  export type NavigableItem = DropdownMenuActionItem | NavigableExpandable;
75
+ /** Search configuration options */
76
+ export interface DropdownMenuSearchConfig {
77
+ /** Placeholder text for search input */
78
+ placeholder?: string;
79
+ /** Search strategy */
80
+ strategy?: "prefix" | "exact" | "fuzzy";
81
+ /** Custom function to extract searchable text from an item */
82
+ getContent?: (item: DropdownMenuActionItem | DropdownMenuExpandableItem) => string;
83
+ /** Auto-focus search input when menu opens */
84
+ autoFocus?: boolean;
85
+ /** Message shown when no results found */
86
+ noResultsMessage?: string;
87
+ }
75
88
  export interface Props extends Omit<HTMLButtonAttributes, "children"> {
76
89
  /** Menu items to display */
77
90
  items: DropdownMenuItem[];
@@ -91,6 +104,8 @@ export interface Props extends Omit<HTMLButtonAttributes, "children"> {
91
104
  closeOnEscape?: boolean;
92
105
  /** Force fallback positioning mode (for testing) */
93
106
  forceFallback?: boolean;
107
+ /** Enable search/filter functionality (true for defaults, or config object) */
108
+ search?: boolean | DropdownMenuSearchConfig;
94
109
  /** Classes for the wrapper element */
95
110
  class?: string;
96
111
  /** Classes for the trigger button */
@@ -117,6 +132,10 @@ export interface Props extends Omit<HTMLButtonAttributes, "children"> {
117
132
  classExpandableContent?: string;
118
133
  /** Classes for backdrop (fallback mode only) */
119
134
  classBackdrop?: string;
135
+ /** Classes for search input container */
136
+ classSearchContainer?: string;
137
+ /** Classes for search input */
138
+ classSearchInput?: string;
120
139
  /** Show backdrop in fallback mode (default: true) */
121
140
  showBackdrop?: boolean;
122
141
  /** Custom trigger snippet - receives isOpen state, toggle function, and ARIA props for full control */
@@ -64,6 +64,11 @@
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
74
  @layer components {
@@ -266,4 +271,63 @@
266
271
  --pop-right;
267
272
  }
268
273
  }
274
+
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
+ }
292
+
293
+ .stuic-dropdown-menu-search-icon {
294
+ color: var(--stuic-dropdown-menu-search-text);
295
+ flex-shrink: 0;
296
+ display: flex;
297
+ }
298
+
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
+ }
308
+
309
+ .stuic-dropdown-menu-search-input::placeholder {
310
+ color: var(--stuic-dropdown-menu-search-text);
311
+ }
312
+
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
+ }
323
+
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);
332
+ }
269
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;
@@ -217,7 +217,7 @@
217
217
  .stuic-input .input-wrap.invalid:focus-within {
218
218
  border-color: var(--stuic-input-accent-error);
219
219
  box-shadow: 0 0 0 var(--stuic-input-ring-width)
220
- color-mix(in srgb, var(--stuic-input-accent-error) 20%, transparent);
220
+ color-mix(in srgb, var(--stuic-input-accent-error) 20%, var(--stuic-color-background));
221
221
  }
222
222
 
223
223
  /* Disabled state */
@@ -68,7 +68,7 @@
68
68
  .stuic-switch:focus {
69
69
  outline: none;
70
70
  box-shadow: 0 0 0 var(--stuic-switch-ring-width)
71
- color-mix(in srgb, var(--stuic-switch-ring-color) 30%, transparent);
71
+ color-mix(in srgb, var(--stuic-switch-ring-color) 30%, var(--stuic-color-background));
72
72
  }
73
73
 
74
74
  /* Disabled */
@@ -203,6 +203,23 @@
203
203
  </div>
204
204
  </section>
205
205
 
206
+ <!-- HIGHLIGHT BOXES -->
207
+ <section class="preview-section">
208
+ {#if showLabels}
209
+ <h2 class="section-label">Highlighted Content</h2>
210
+ {/if}
211
+
212
+ <div class="highlight-box primary">
213
+ <strong>Primary Highlight</strong>
214
+ <p>This box uses primary intent colors for important content.</p>
215
+ </div>
216
+
217
+ <div class="highlight-box accent">
218
+ <strong>Accent Highlight</strong>
219
+ <p>This box uses accent colors to draw attention.</p>
220
+ </div>
221
+ </section>
222
+
206
223
  <!-- ROLE COLORS -->
207
224
  <section class="preview-section">
208
225
  {#if showLabels}
@@ -289,23 +306,6 @@
289
306
  </div>
290
307
  </section>
291
308
 
292
- <!-- HIGHLIGHT BOXES -->
293
- <section class="preview-section">
294
- {#if showLabels}
295
- <h2 class="section-label">Highlighted Content</h2>
296
- {/if}
297
-
298
- <div class="highlight-box primary">
299
- <strong>Primary Highlight</strong>
300
- <p>This box uses primary intent colors for important content.</p>
301
- </div>
302
-
303
- <div class="highlight-box accent">
304
- <strong>Accent Highlight</strong>
305
- <p>This box uses accent colors to draw attention.</p>
306
- </div>
307
- </section>
308
-
309
309
  <!-- TYPOGRAPHY -->
310
310
  <section class="preview-section">
311
311
  {#if showLabels}
@@ -402,17 +402,17 @@
402
402
  opacity: 0.9;
403
403
  }
404
404
 
405
- /* Using soft variant pattern for content boxes */
405
+ /* Using surface-intent tokens for content boxes */
406
406
  .stuic-theme-preview .highlight-box.primary {
407
- background: color-mix(in srgb, var(--stuic-color-primary) 15%, transparent);
408
- color: var(--stuic-color-primary);
409
- border: 1px solid color-mix(in srgb, var(--stuic-color-primary) 30%, transparent);
407
+ background: var(--stuic-color-surface-primary);
408
+ color: var(--stuic-color-surface-primary-foreground);
409
+ border: 1px solid var(--stuic-color-surface-primary-border);
410
410
  }
411
411
 
412
412
  .stuic-theme-preview .highlight-box.accent {
413
- background: color-mix(in srgb, var(--stuic-color-accent) 15%, transparent);
414
- color: var(--stuic-color-accent);
415
- border: 1px solid color-mix(in srgb, var(--stuic-color-accent) 30%, transparent);
413
+ background: var(--stuic-color-surface-accent);
414
+ color: var(--stuic-color-surface-accent-foreground);
415
+ border: 1px solid var(--stuic-color-surface-accent-border);
416
416
  }
417
417
 
418
418
  /* ============================================================================
@@ -26,6 +26,7 @@ export { iconLucideTrash2 as iconTrash } from "@marianmeres/icons-fns/lucide/ico
26
26
  export { iconLucideZoomIn as iconZoomIn } from "@marianmeres/icons-fns/lucide/iconLucideZoomIn.js";
27
27
  export { iconLucideZoomOut as iconZoomOut } from "@marianmeres/icons-fns/lucide/iconLucideZoomOut.js";
28
28
  export { iconLucideSearch as iconSearch } from "@marianmeres/icons-fns/lucide/iconLucideSearch.js";
29
+ export { iconLucideX as iconX } from "@marianmeres/icons-fns/lucide/iconLucideX.js";
29
30
  export { iconLucideChevronDown as iconChevronDown } from "@marianmeres/icons-fns/lucide/iconLucideChevronDown.js";
30
31
  export { iconLucideChevronUp as iconChevronUp } from "@marianmeres/icons-fns/lucide/iconLucideChevronUp.js";
31
32
  export { iconLucideChevronRight as iconChevronRight } from "@marianmeres/icons-fns/lucide/iconLucideChevronRight.js";
@@ -30,6 +30,7 @@ export { iconLucideZoomIn as iconZoomIn } from "@marianmeres/icons-fns/lucide/ic
30
30
  export { iconLucideZoomOut as iconZoomOut } from "@marianmeres/icons-fns/lucide/iconLucideZoomOut.js";
31
31
  // UI Control Icons (Lucide)
32
32
  export { iconLucideSearch as iconSearch } from "@marianmeres/icons-fns/lucide/iconLucideSearch.js";
33
+ export { iconLucideX as iconX } from "@marianmeres/icons-fns/lucide/iconLucideX.js";
33
34
  export { iconLucideChevronDown as iconChevronDown } from "@marianmeres/icons-fns/lucide/iconLucideChevronDown.js";
34
35
  export { iconLucideChevronUp as iconChevronUp } from "@marianmeres/icons-fns/lucide/iconLucideChevronUp.js";
35
36
  export { iconLucideChevronRight as iconChevronRight } from "@marianmeres/icons-fns/lucide/iconLucideChevronRight.js";