@sveltia/ui 0.25.11 → 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.
- package/dist/components/dialog/dialog.svelte +10 -0
- package/dist/components/menu/menu-item.svelte +14 -3
- package/dist/components/menu/menu-item.svelte.d.ts +14 -2
- package/dist/components/select/combobox.svelte +9 -1
- package/dist/components/switch/switch.svelte +1 -0
- package/dist/components/text-editor/toolbar/toolbar-wrapper.svelte +6 -0
- package/dist/components/toolbar/toolbar.svelte +4 -1
- package/package.json +9 -9
|
@@ -234,10 +234,20 @@
|
|
|
234
234
|
.footer {
|
|
235
235
|
margin: var(--sui-dialog-footer-margin, 0 24px 24px);
|
|
236
236
|
}
|
|
237
|
+
@media (width < 768px) {
|
|
238
|
+
.footer {
|
|
239
|
+
margin: var(--sui-dialog-footer-margin, 0 16px 16px);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
237
242
|
|
|
238
243
|
.body {
|
|
239
244
|
overflow: auto;
|
|
240
245
|
margin: var(--sui-dialog-body-margin, 24px 24px);
|
|
241
246
|
white-space: normal;
|
|
242
247
|
line-height: var(--sui-line-height-compact);
|
|
248
|
+
}
|
|
249
|
+
@media (width < 768px) {
|
|
250
|
+
.body {
|
|
251
|
+
margin: var(--sui-dialog-body-margin, 16px 16px);
|
|
252
|
+
}
|
|
243
253
|
}</style>
|
|
@@ -11,11 +11,21 @@
|
|
|
11
11
|
import Menu from './menu.svelte';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @import {
|
|
14
|
+
* @import {
|
|
15
|
+
* ButtonProps,
|
|
16
|
+
* CommonEventHandlers,
|
|
17
|
+
* MenuItemProps,
|
|
18
|
+
* PopupPosition,
|
|
19
|
+
* } from '../../typedefs';
|
|
15
20
|
*/
|
|
16
21
|
|
|
17
22
|
/**
|
|
18
|
-
* @
|
|
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=
|
|
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 &
|
|
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';
|
|
@@ -89,7 +89,15 @@
|
|
|
89
89
|
// @ts-ignore
|
|
90
90
|
value = target.dataset.type === 'number' ? Number(target.value) : target.value;
|
|
91
91
|
_onChange();
|
|
92
|
-
onChange?.(
|
|
92
|
+
onChange?.(
|
|
93
|
+
new CustomEvent('Change', {
|
|
94
|
+
detail: {
|
|
95
|
+
target: inputElement,
|
|
96
|
+
name: target.name,
|
|
97
|
+
value,
|
|
98
|
+
},
|
|
99
|
+
}),
|
|
100
|
+
);
|
|
93
101
|
};
|
|
94
102
|
|
|
95
103
|
$effect(() => {
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
font-family: var(--sui-control-font-family);
|
|
90
90
|
font-size: var(--sui-control-font-size);
|
|
91
91
|
line-height: var(--sui-control-line-height);
|
|
92
|
+
font-weight: var(--sui-font-weight-normal, normal);
|
|
92
93
|
text-align: start;
|
|
93
94
|
cursor: pointer;
|
|
94
95
|
-webkit-user-select: none;
|
|
@@ -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
|
}
|
|
@@ -79,10 +79,13 @@
|
|
|
79
79
|
align-items: center;
|
|
80
80
|
gap: 8px;
|
|
81
81
|
margin: 0;
|
|
82
|
-
padding:
|
|
82
|
+
padding-inline-end: 12px;
|
|
83
83
|
min-width: 0;
|
|
84
84
|
font-size: var(--sui-font-size-x-large);
|
|
85
85
|
}
|
|
86
|
+
[role=toolbar] :global(h2):first-child {
|
|
87
|
+
padding-inline-start: 12px;
|
|
88
|
+
}
|
|
86
89
|
[role=toolbar] :global(h2) :global(strong) {
|
|
87
90
|
display: block;
|
|
88
91
|
overflow: hidden;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@playwright/test": "^1.51.1",
|
|
50
|
-
"@sveltejs/adapter-auto": "^
|
|
51
|
-
"@sveltejs/kit": "^2.20.
|
|
50
|
+
"@sveltejs/adapter-auto": "^6.0.0",
|
|
51
|
+
"@sveltejs/kit": "^2.20.4",
|
|
52
52
|
"@sveltejs/package": "^2.3.10",
|
|
53
53
|
"@sveltejs/vite-plugin-svelte": "5.0.3",
|
|
54
|
-
"cspell": "^8.
|
|
54
|
+
"cspell": "^8.18.1",
|
|
55
55
|
"eslint": "^8.57.1",
|
|
56
56
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
57
57
|
"eslint-config-prettier": "^10.1.1",
|
|
@@ -62,17 +62,17 @@
|
|
|
62
62
|
"postcss-html": "^1.8.0",
|
|
63
63
|
"prettier": "^3.5.3",
|
|
64
64
|
"prettier-plugin-svelte": "^3.3.3",
|
|
65
|
-
"sass": "^1.86.
|
|
66
|
-
"stylelint": "^16.
|
|
65
|
+
"sass": "^1.86.3",
|
|
66
|
+
"stylelint": "^16.17.0",
|
|
67
67
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
68
68
|
"stylelint-scss": "^6.11.1",
|
|
69
|
-
"svelte": "5.25.
|
|
69
|
+
"svelte": "5.25.7",
|
|
70
70
|
"svelte-check": "^4.1.5",
|
|
71
71
|
"svelte-i18n": "^4.0.1",
|
|
72
72
|
"svelte-preprocess": "^6.0.3",
|
|
73
73
|
"tslib": "^2.8.1",
|
|
74
|
-
"vite": "^6.2.
|
|
75
|
-
"vitest": "^3.
|
|
74
|
+
"vite": "^6.2.5",
|
|
75
|
+
"vitest": "^3.1.1"
|
|
76
76
|
},
|
|
77
77
|
"exports": {
|
|
78
78
|
".": {
|