@sveltia/ui 0.42.0 → 0.43.0
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/alert/alert.svelte +30 -36
- package/dist/components/alert/infobar.svelte +45 -55
- package/dist/components/bottom-navigation/bottom-navigation.svelte +15 -21
- package/dist/components/button/button-group.svelte +5 -7
- package/dist/components/button/button.svelte +175 -274
- package/dist/components/button/floating-action-button-wrapper.svelte +18 -23
- package/dist/components/button/select-button-group.svelte +41 -57
- package/dist/components/button/split-button.svelte +18 -25
- package/dist/components/calendar/calendar.svelte +80 -103
- package/dist/components/checkbox/checkbox-group.svelte +19 -22
- package/dist/components/checkbox/checkbox.svelte +63 -91
- package/dist/components/dialog/dialog.svelte +87 -105
- package/dist/components/dialog/prompt-dialog.svelte +3 -5
- package/dist/components/disclosure/disclosure.svelte +21 -34
- package/dist/components/divider/divider.svelte +14 -18
- package/dist/components/divider/spacer.svelte +8 -13
- package/dist/components/drawer/drawer.svelte +190 -343
- package/dist/components/grid/grid-body.svelte +14 -16
- package/dist/components/grid/grid-cell.svelte +3 -5
- package/dist/components/grid/grid-col-header.svelte +3 -5
- package/dist/components/grid/grid-foot.svelte +3 -5
- package/dist/components/grid/grid-head.svelte +3 -5
- package/dist/components/grid/grid-row-header.svelte +4 -6
- package/dist/components/grid/grid-row.svelte +4 -6
- package/dist/components/grid/grid.svelte +12 -18
- package/dist/components/icon/icon.svelte +5 -7
- package/dist/components/listbox/listbox.svelte +61 -78
- package/dist/components/listbox/option-group.svelte +11 -15
- package/dist/components/listbox/option.svelte +39 -54
- package/dist/components/menu/menu-item-group.svelte +3 -5
- package/dist/components/menu/menu-item.svelte +51 -67
- package/dist/components/menu/menu.svelte +17 -21
- package/dist/components/progressbar/progressbar.svelte +15 -24
- package/dist/components/radio/radio-group.svelte +31 -40
- package/dist/components/radio/radio.svelte +63 -81
- package/dist/components/resizable-pane/resizable-handle.svelte +48 -60
- package/dist/components/resizable-pane/resizable-pane-group.svelte +14 -18
- package/dist/components/select/combobox.svelte +112 -135
- package/dist/components/select/select-tags.svelte +57 -73
- package/dist/components/slider/slider.svelte +74 -94
- package/dist/components/switch/switch.svelte +81 -115
- package/dist/components/table/table-body.svelte +14 -16
- package/dist/components/table/table-cell.svelte +3 -5
- package/dist/components/table/table-col-header.svelte +3 -5
- package/dist/components/table/table-foot.svelte +3 -5
- package/dist/components/table/table-head.svelte +3 -5
- package/dist/components/table/table-row-header.svelte +4 -6
- package/dist/components/table/table-row.svelte +4 -6
- package/dist/components/table/table.svelte +12 -18
- package/dist/components/tabs/tab-box.svelte +6 -9
- package/dist/components/tabs/tab-list.svelte +73 -91
- package/dist/components/tabs/tab-panel.svelte +7 -11
- package/dist/components/tabs/tab-panels.svelte +14 -19
- package/dist/components/text-editor/code-editor.svelte +7 -10
- package/dist/components/text-editor/core.js +10 -7
- package/dist/components/text-editor/lexical-root.svelte +160 -221
- package/dist/components/text-editor/text-editor.svelte +18 -25
- package/dist/components/text-editor/toolbar/toolbar-wrapper.svelte +37 -44
- package/dist/components/text-field/number-input.svelte +68 -87
- package/dist/components/text-field/password-input.svelte +42 -52
- package/dist/components/text-field/search-bar.svelte +53 -64
- package/dist/components/text-field/secret-input.svelte +46 -61
- package/dist/components/text-field/text-area.svelte +68 -80
- package/dist/components/text-field/text-input.svelte +106 -138
- package/dist/components/toast/toast.svelte +89 -104
- package/dist/components/toolbar/toolbar.svelte +54 -70
- package/dist/components/typography/truncated-text.svelte +7 -9
- package/dist/components/util/app-shell.svelte +493 -40
- package/dist/components/util/empty-state.svelte +11 -13
- package/dist/components/util/group.svelte +3 -5
- package/dist/components/util/modal.svelte +48 -59
- package/dist/components/util/popup.svelte +67 -87
- package/dist/services/i18n.js +2 -2
- package/package.json +2 -2
|
@@ -33,12 +33,9 @@
|
|
|
33
33
|
{@render children?.()}
|
|
34
34
|
</div>
|
|
35
35
|
|
|
36
|
-
<style
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
</style>
|
|
36
|
+
<style>.tab-box {
|
|
37
|
+
display: flex;
|
|
38
|
+
}
|
|
39
|
+
.tab-box.vertical {
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
}</style>
|
|
@@ -119,94 +119,76 @@
|
|
|
119
119
|
<div role="none" class="indicator" style={indicatorStyle}></div>
|
|
120
120
|
</div>
|
|
121
121
|
|
|
122
|
-
<style
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.inner {
|
|
198
|
-
display: contents;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.indicator {
|
|
202
|
-
position: absolute;
|
|
203
|
-
z-index: 0;
|
|
204
|
-
inset: auto;
|
|
205
|
-
border-radius: var(--sui-tab-list-indicator-border-radius, 0);
|
|
206
|
-
border-color: var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));
|
|
207
|
-
background-color: var(--sui-tab-list-indicator-background-color, transparent);
|
|
208
|
-
box-shadow: var(--sui-tab-list-indicator-box-shadow, none);
|
|
209
|
-
pointer-events: none;
|
|
210
|
-
transition: var(--sui-tab-list-indicator-transition, all 200ms);
|
|
211
|
-
}
|
|
212
|
-
</style>
|
|
122
|
+
<style>.tab-list {
|
|
123
|
+
flex: none;
|
|
124
|
+
position: relative;
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
margin: var(--sui-tab-list-margin, var(--sui-focus-ring-width));
|
|
128
|
+
border-color: var(--sui-tab-list-border-color, var(--sui-control-border-color));
|
|
129
|
+
border-radius: var(--sui-tab-list-border-radius, 0);
|
|
130
|
+
background-color: var(--sui-tab-list-background-color, transparent);
|
|
131
|
+
}
|
|
132
|
+
.tab-list[aria-orientation=horizontal] {
|
|
133
|
+
gap: var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));
|
|
134
|
+
margin-block: var(--sui-horizontal-tab-list-margin-block, 0 32px);
|
|
135
|
+
margin-inline: var(--sui-horizontal-tab-list-margin-inline, 0);
|
|
136
|
+
border-block-width: var(--sui-horizontal-tab-list-border-block-width, 0 1px);
|
|
137
|
+
border-inline-width: var(--sui-horizontal-tab-list-border-inline-width, 0 0);
|
|
138
|
+
padding: var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));
|
|
139
|
+
}
|
|
140
|
+
.tab-list[aria-orientation=horizontal] :global(button) {
|
|
141
|
+
width: var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));
|
|
142
|
+
height: var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));
|
|
143
|
+
justify-content: var(--sui-horizontal-tab-justify-content, center);
|
|
144
|
+
}
|
|
145
|
+
.tab-list[aria-orientation=horizontal] .indicator {
|
|
146
|
+
border-block-width: var(--sui-horizontal-tab-list-indicator-border-block-width, 0 2px);
|
|
147
|
+
border-inline-width: var(--sui-horizontal-tab-list-indicator-border-inline-width, 0 0);
|
|
148
|
+
}
|
|
149
|
+
.tab-list[aria-orientation=vertical] {
|
|
150
|
+
gap: var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
margin-block: var(--sui-vertical-tab-list-margin-block, 0);
|
|
153
|
+
margin-inline: var(--sui-vertical-tab-list-margin-inline, 0 32px);
|
|
154
|
+
border-block-width: var(--sui-vertical-tab-list-border-block-width, 0 0);
|
|
155
|
+
border-inline-width: var(--sui-vertical-tab-list-border-inline-width, 0 1px);
|
|
156
|
+
padding: var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));
|
|
157
|
+
width: var(--sui-vertical-tab-list-width, auto);
|
|
158
|
+
}
|
|
159
|
+
.tab-list[aria-orientation=vertical] :global(button) {
|
|
160
|
+
justify-content: var(--sui-vertical-tab-justify-content, flex-start);
|
|
161
|
+
padding-inline-end: 32px;
|
|
162
|
+
width: var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));
|
|
163
|
+
height: var(--sui-vertical-tab-height, var(--sui-tab-height, auto));
|
|
164
|
+
}
|
|
165
|
+
.tab-list[aria-orientation=vertical] .indicator {
|
|
166
|
+
border-block-width: var(--sui-vertical-tab-list-indicator-border-block-width, 0 0);
|
|
167
|
+
border-inline-width: var(--sui-vertical-tab-list-indicator-border-inline-width, 0 2px);
|
|
168
|
+
}
|
|
169
|
+
.tab-list :global(button) {
|
|
170
|
+
position: relative;
|
|
171
|
+
z-index: 1;
|
|
172
|
+
border-color: transparent;
|
|
173
|
+
margin: 0 !important;
|
|
174
|
+
border-radius: var(--sui-tab-border-radius, 0);
|
|
175
|
+
font-family: var(--sui-tab-font-family, var(--sui-control-font-family, inherit));
|
|
176
|
+
font-size: var(--sui-tab-font-size, var(--sui-control-font-size, inherit));
|
|
177
|
+
font-weight: var(--sui-tab-font-weight, var(--sui-control-font-weight, var(--sui-font-weight-normal, normal)));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.inner {
|
|
181
|
+
display: contents;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.indicator {
|
|
185
|
+
position: absolute;
|
|
186
|
+
z-index: 0;
|
|
187
|
+
inset: auto;
|
|
188
|
+
border-radius: var(--sui-tab-list-indicator-border-radius, 0);
|
|
189
|
+
border-color: var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));
|
|
190
|
+
background-color: var(--sui-tab-list-indicator-background-color, transparent);
|
|
191
|
+
box-shadow: var(--sui-tab-list-indicator-box-shadow, none);
|
|
192
|
+
pointer-events: none;
|
|
193
|
+
transition: var(--sui-tab-list-indicator-transition, all 200ms);
|
|
194
|
+
}</style>
|
|
@@ -31,14 +31,10 @@
|
|
|
31
31
|
{@render children?.()}
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
|
-
<style
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
display: none;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
</style>
|
|
34
|
+
<style>.tab-panel {
|
|
35
|
+
flex: auto;
|
|
36
|
+
transition: all 200ms;
|
|
37
|
+
}
|
|
38
|
+
.tab-panel[aria-hidden=true], .tab-panel:not([aria-hidden]) {
|
|
39
|
+
display: none;
|
|
40
|
+
}</style>
|
|
@@ -30,22 +30,17 @@
|
|
|
30
30
|
{@render children?.()}
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
|
-
<style
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
scroll-snap-align: center;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
</style>
|
|
33
|
+
<style>.tab-panels {
|
|
34
|
+
flex: auto;
|
|
35
|
+
display: flex;
|
|
36
|
+
gap: var(--sui-tab-panels-gap, 16px);
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
scroll-snap-type: x mandatory;
|
|
39
|
+
}
|
|
40
|
+
.tab-panels > :global(.tab-panel) {
|
|
41
|
+
flex: none;
|
|
42
|
+
display: block !important;
|
|
43
|
+
width: 100%;
|
|
44
|
+
overflow: auto;
|
|
45
|
+
scroll-snap-align: center;
|
|
46
|
+
}</style>
|
|
@@ -117,13 +117,10 @@
|
|
|
117
117
|
</Toast>
|
|
118
118
|
{/if}
|
|
119
119
|
|
|
120
|
-
<style
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
</style>
|
|
120
|
+
<style>.code-editor {
|
|
121
|
+
margin: var(--sui-focus-ring-width);
|
|
122
|
+
width: calc(100% - var(--sui-focus-ring-width) * 2);
|
|
123
|
+
}
|
|
124
|
+
.code-editor.flex:not([hidden]) {
|
|
125
|
+
display: block;
|
|
126
|
+
}</style>
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
ListNode,
|
|
29
29
|
} from '@lexical/list';
|
|
30
30
|
import {
|
|
31
|
+
CODE,
|
|
31
32
|
$convertFromMarkdownString as convertFromMarkdownString,
|
|
32
33
|
$convertToMarkdownString as convertToMarkdownString,
|
|
33
34
|
registerMarkdownShortcuts,
|
|
@@ -210,11 +211,11 @@ export const initEditor = ({
|
|
|
210
211
|
.filter(([button]) => enabledButtons.includes(/** @type {TextEditorNodeType} */ (button)))
|
|
211
212
|
.flatMap(([, nodes]) => nodes),
|
|
212
213
|
),
|
|
213
|
-
...(isCodeEditor
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
...(isCodeEditor
|
|
215
|
+
? [CodeNode, CodeHighlightNode]
|
|
216
|
+
: // We haven’t implemented buttons for horizontal rules and tables yet, but we still want
|
|
217
|
+
// to support them in Markdown, so always include them in the node list
|
|
218
|
+
[HorizontalRuleNode, TableNode, TableCellNode, TableRowNode]),
|
|
218
219
|
],
|
|
219
220
|
theme: EDITOR_THEME,
|
|
220
221
|
};
|
|
@@ -227,8 +228,10 @@ export const initEditor = ({
|
|
|
227
228
|
.filter(([button]) => enabledButtons.includes(/** @type {TextEditorNodeType} */ (button)))
|
|
228
229
|
.flatMap(([, transformers]) => transformers),
|
|
229
230
|
),
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
...(isCodeEditor
|
|
232
|
+
? [CODE]
|
|
233
|
+
: // See the comment above for why we always include horizontal rules and tables
|
|
234
|
+
[HR, TABLE]),
|
|
232
235
|
];
|
|
233
236
|
|
|
234
237
|
const editor = createEditor(editorConfig);
|