lutra 0.1.19 → 0.1.21

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.
@@ -15,6 +15,8 @@
15
15
  open = $bindable(false),
16
16
  items,
17
17
  trigger,
18
+ width,
19
+ maxWidth,
18
20
  }: {
19
21
  /** Whether the menu is open */
20
22
  open?: boolean;
@@ -22,6 +24,10 @@
22
24
  items: Item[];
23
25
  /** The trigger for the menu */
24
26
  trigger: string | Snippet<[{ toggle: () => void, isOpen: boolean }]>;
27
+ /** The width of the menu */
28
+ width?: string;
29
+ /** The max width of the menu */
30
+ maxWidth?: string;
25
31
  } = $props();
26
32
 
27
33
  let _open = $state(open);
@@ -120,7 +126,7 @@
120
126
 
121
127
 
122
128
  <UiContent>
123
- <div class="MenuDropdown" bind:this={menuEl}>
129
+ <div class="MenuDropdown" class:open={_open} bind:this={menuEl}>
124
130
  <div
125
131
  class="Trigger"
126
132
  bind:this={triggerEl}
@@ -137,6 +143,7 @@
137
143
  <Overlay position="anchor" id="o-{id}" anchor={triggerEl} layer="menu">
138
144
  <div {id}
139
145
  class="MenuDropdownContent"
146
+ style="--menu-width: {width}; --menu-max-width: {maxWidth};"
140
147
  class:scrollable={scrollable}
141
148
  role="menu"
142
149
  bind:this={contentEl}
@@ -171,8 +178,8 @@
171
178
  border-radius: var(--menu-border-radius);
172
179
  box-shadow: 0 0.5rem 1rem var(--shadow-color);
173
180
  background-color: var(--menu-background-color);
174
- width: var(--width, fit-content);
175
- max-width: var(--max-width, 50ch);
181
+ width: var(--menu-width, fit-content);
182
+ max-width: var(--menu-max-width, 50ch);
176
183
  overflow-x: clip;
177
184
  overflow-y: auto;
178
185
  scrollbar-width: thin;
@@ -10,6 +10,10 @@ type $$ComponentProps = {
10
10
  toggle: () => void;
11
11
  isOpen: boolean;
12
12
  }]>;
13
+ /** The width of the menu */
14
+ width?: string;
15
+ /** The max width of the menu */
16
+ maxWidth?: string;
13
17
  };
14
18
  declare const MenuDropdown: import("svelte").Component<$$ComponentProps, {}, "open">;
15
19
  type MenuDropdown = ReturnType<typeof MenuDropdown>;
@@ -21,7 +21,7 @@
21
21
  <Icon {icon} alt={text} />
22
22
  {/if}
23
23
  {#if text}
24
- {text}
24
+ <span class="text">{text}</span>
25
25
  {/if}
26
26
  {#if snippet}
27
27
  {@render snippet()}
@@ -29,3 +29,9 @@
29
29
  {#if Comp}
30
30
  <Comp {...props} />
31
31
  {/if}
32
+
33
+ <style>
34
+ .text {
35
+ display: contents;
36
+ }
37
+ </style>
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "lutra",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
+ "bump-and-publish:patch": "pnpm version:patch && pnpm build && npm publish",
6
7
  "build": "vite build && npm run package",
7
8
  "preview": "vite preview",
8
9
  "package": "svelte-kit sync && svelte-package && publint",