@sveltia/ui 0.25.12 → 0.25.13

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.
@@ -11,11 +11,21 @@
11
11
  import Menu from './menu.svelte';
12
12
 
13
13
  /**
14
- * @import { ButtonProps, CommonEventHandlers, MenuItemProps } from '../../typedefs';
14
+ * @import {
15
+ * ButtonProps,
16
+ * CommonEventHandlers,
17
+ * MenuItemProps,
18
+ * PopupPosition,
19
+ * } from '../../typedefs';
15
20
  */
16
21
 
17
22
  /**
18
- * @type {ButtonProps & MenuItemProps & CommonEventHandlers & Record<string, any>}
23
+ * @typedef {object} Props
24
+ * @property {PopupPosition} [popupPosition] Where to show the dropdown menu.
25
+ */
26
+
27
+ /**
28
+ * @type {ButtonProps & MenuItemProps & CommonEventHandlers & Props & Record<string, any>}
19
29
  */
20
30
  let {
21
31
  /* eslint-disable prefer-const */
@@ -24,6 +34,7 @@
24
34
  hidden = false,
25
35
  disabled = false,
26
36
  label = '',
37
+ popupPosition = 'right-top', // @todo Make this auto detect
27
38
  children: _children,
28
39
  startIcon: _startIcon,
29
40
  endIcon: _endIcon,
@@ -130,7 +141,7 @@
130
141
  <Popup
131
142
  anchor={buttonElement}
132
143
  parentDialogElement={dialogElement}
133
- position="right-top"
144
+ position={popupPosition}
134
145
  bind:open={isPopupOpen}
135
146
  bind:hovered={isPopupHovered}
136
147
  >
@@ -1,12 +1,24 @@
1
1
  export default MenuItem;
2
2
  type MenuItem = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<ButtonProps & MenuItemProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Record<string, any>>): void;
4
+ $set?(props: Partial<ButtonProps & MenuItemProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Props & Record<string, any>>): void;
5
5
  };
6
6
  /**
7
7
  * A menu item widget.
8
8
  * @see https://w3c.github.io/aria/#menuitem
9
9
  */
10
- declare const MenuItem: import("svelte").Component<ButtonProps & MenuItemProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & Record<string, any>, {}, "">;
10
+ declare const MenuItem: import("svelte").Component<ButtonProps & MenuItemProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & {
11
+ /**
12
+ * Where to show the dropdown menu.
13
+ */
14
+ popupPosition?: PopupPosition | undefined;
15
+ } & Record<string, any>, {}, "">;
16
+ type Props = {
17
+ /**
18
+ * Where to show the dropdown menu.
19
+ */
20
+ popupPosition?: PopupPosition | undefined;
21
+ };
11
22
  import type { ButtonProps } from '../../typedefs';
12
23
  import type { MenuItemProps } from '../../typedefs';
24
+ import type { PopupPosition } from '../../typedefs';
@@ -50,6 +50,12 @@
50
50
  padding: 8px;
51
51
  background-color: var(--sui-tertiary-background-color);
52
52
  }
53
+ @media (width < 768px) {
54
+ .wrapper :global([role="toolbar"]) {
55
+ flex-wrap: wrap;
56
+ height: auto;
57
+ }
58
+ }
53
59
  .wrapper :global(.sui.menu-button) {
54
60
  padding: 0 4px;
55
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.25.12",
3
+ "version": "0.25.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {