@sveltia/ui 0.41.3 → 0.42.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 +39 -31
- package/dist/components/alert/alert.svelte.d.ts +8 -0
- package/dist/components/alert/infobar.svelte +58 -46
- package/dist/components/alert/infobar.svelte.d.ts +8 -0
- package/dist/components/bottom-navigation/bottom-navigation.svelte +21 -15
- package/dist/components/button/button-group.svelte +10 -6
- package/dist/components/button/button-group.svelte.d.ts +8 -0
- package/dist/components/button/button.svelte +274 -175
- package/dist/components/button/floating-action-button-wrapper.svelte +23 -18
- package/dist/components/button/select-button-group.svelte +60 -41
- package/dist/components/button/select-button-group.svelte.d.ts +8 -0
- package/dist/components/button/split-button.svelte +25 -18
- package/dist/components/calendar/calendar.svelte +103 -80
- package/dist/components/checkbox/checkbox-group.svelte +25 -19
- package/dist/components/checkbox/checkbox-group.svelte.d.ts +8 -0
- package/dist/components/checkbox/checkbox.svelte +93 -65
- package/dist/components/checkbox/checkbox.svelte.d.ts +2 -2
- package/dist/components/dialog/dialog.svelte +105 -87
- package/dist/components/dialog/prompt-dialog.svelte +5 -3
- package/dist/components/disclosure/disclosure.svelte +34 -21
- package/dist/components/divider/divider.svelte +21 -14
- package/dist/components/divider/divider.svelte.d.ts +8 -0
- package/dist/components/divider/spacer.svelte +13 -8
- package/dist/components/drawer/drawer.svelte +343 -190
- package/dist/components/grid/grid-body.svelte +16 -14
- package/dist/components/grid/grid-cell.svelte +5 -3
- package/dist/components/grid/grid-col-header.svelte +5 -3
- package/dist/components/grid/grid-foot.svelte +5 -3
- package/dist/components/grid/grid-head.svelte +5 -3
- package/dist/components/grid/grid-row-header.svelte +6 -4
- package/dist/components/grid/grid-row.svelte +6 -4
- package/dist/components/grid/grid.svelte +21 -12
- package/dist/components/grid/grid.svelte.d.ts +8 -0
- package/dist/components/icon/icon.svelte +7 -5
- package/dist/components/listbox/listbox.svelte +81 -61
- package/dist/components/listbox/listbox.svelte.d.ts +8 -0
- package/dist/components/listbox/option-group.svelte +15 -11
- package/dist/components/listbox/option.svelte +54 -39
- package/dist/components/menu/menu-item-group.svelte +5 -3
- package/dist/components/menu/menu-item.svelte +67 -51
- package/dist/components/menu/menu.svelte +24 -17
- package/dist/components/menu/menu.svelte.d.ts +8 -0
- package/dist/components/progressbar/progressbar.svelte +27 -15
- package/dist/components/progressbar/progressbar.svelte.d.ts +8 -0
- package/dist/components/radio/radio-group.svelte +43 -31
- package/dist/components/radio/radio-group.svelte.d.ts +8 -0
- package/dist/components/radio/radio.svelte +81 -63
- package/dist/components/resizable-pane/resizable-handle.svelte +63 -48
- package/dist/components/resizable-pane/resizable-handle.svelte.d.ts +8 -0
- package/dist/components/resizable-pane/resizable-pane-group.svelte +18 -14
- package/dist/components/select/combobox.svelte +139 -113
- package/dist/components/select/select-tags.svelte +73 -57
- package/dist/components/slider/slider.svelte +94 -74
- package/dist/components/switch/switch.svelte +118 -81
- package/dist/components/switch/switch.svelte.d.ts +8 -0
- package/dist/components/table/table-body.svelte +16 -14
- package/dist/components/table/table-cell.svelte +5 -3
- package/dist/components/table/table-col-header.svelte +5 -3
- package/dist/components/table/table-foot.svelte +5 -3
- package/dist/components/table/table-head.svelte +5 -3
- package/dist/components/table/table-row-header.svelte +6 -4
- package/dist/components/table/table-row.svelte +6 -4
- package/dist/components/table/table.svelte +21 -13
- package/dist/components/table/table.svelte.d.ts +8 -0
- package/dist/components/tabs/tab-box.svelte +9 -6
- package/dist/components/tabs/tab-list.svelte +94 -73
- package/dist/components/tabs/tab-list.svelte.d.ts +8 -0
- package/dist/components/tabs/tab-panel.svelte +11 -7
- package/dist/components/tabs/tab-panels.svelte +19 -14
- package/dist/components/text-editor/code-editor.svelte +10 -7
- package/dist/components/text-editor/core.js +3 -0
- package/dist/components/text-editor/lexical-root.svelte +221 -160
- package/dist/components/text-editor/text-editor.svelte +25 -18
- package/dist/components/text-editor/toolbar/insert-link-button.svelte +2 -1
- package/dist/components/text-editor/toolbar/toolbar-wrapper.svelte +44 -37
- package/dist/components/text-field/number-input.svelte +87 -68
- package/dist/components/text-field/password-input.svelte +52 -42
- package/dist/components/text-field/search-bar.svelte +64 -53
- package/dist/components/text-field/secret-input.svelte +61 -46
- package/dist/components/text-field/text-area.svelte +80 -68
- package/dist/components/text-field/text-input.svelte +139 -107
- package/dist/components/toast/toast.svelte +104 -89
- package/dist/components/toolbar/toolbar.svelte +73 -54
- package/dist/components/toolbar/toolbar.svelte.d.ts +8 -0
- package/dist/components/typography/truncated-text.svelte +9 -7
- package/dist/components/util/app-shell.svelte +40 -493
- package/dist/components/util/empty-state.svelte +13 -11
- package/dist/components/util/group.svelte +8 -3
- package/dist/components/util/group.svelte.d.ts +8 -0
- package/dist/components/util/modal.svelte +59 -48
- package/dist/components/util/popup.svelte +87 -67
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -4
- package/dist/locales/en.yaml +50 -3
- package/dist/locales/ja.yaml +49 -2
- package/dist/services/i18n.d.ts +6 -0
- package/dist/services/i18n.js +19 -14
- package/dist/typedefs.d.ts +5 -1
- package/dist/typedefs.js +2 -1
- package/package.json +23 -23
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
readonly = false,
|
|
40
40
|
required = false,
|
|
41
41
|
invalid = false,
|
|
42
|
-
|
|
42
|
+
ariaLabel = undefined,
|
|
43
43
|
children,
|
|
44
44
|
oninput,
|
|
45
45
|
...restProps
|
|
@@ -127,109 +127,141 @@
|
|
|
127
127
|
{/if}
|
|
128
128
|
</div>
|
|
129
129
|
|
|
130
|
-
<style
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
input {
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
.label {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
130
|
+
<style lang="scss">
|
|
131
|
+
.text-input {
|
|
132
|
+
display: inline-flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
position: relative;
|
|
135
|
+
margin: var(--sui-focus-ring-width);
|
|
136
|
+
min-width: var(--sui-textbox-singleline-min-width);
|
|
137
|
+
|
|
138
|
+
&.flex:not([hidden]) {
|
|
139
|
+
display: inline-flex; // Avoid Tailwind .flex class collisions
|
|
140
|
+
width: -moz-available;
|
|
141
|
+
width: -webkit-fill-available;
|
|
142
|
+
width: stretch;
|
|
143
|
+
min-width: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&.monospace {
|
|
147
|
+
--sui-textbox-font-family: var(--sui-font-family-monospace, monospace);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// https://stackoverflow.com/a/68240841
|
|
152
|
+
input:is(:-webkit-autofill, :-webkit-autofill:focus) {
|
|
153
|
+
transition:
|
|
154
|
+
background-color 0s 600000s,
|
|
155
|
+
color 0s 600000s;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
input {
|
|
159
|
+
display: inline-block;
|
|
160
|
+
flex: auto;
|
|
161
|
+
border-width: var(--sui-textbox-border-width, 1px);
|
|
162
|
+
border-color: var(--sui-textbox-border-color);
|
|
163
|
+
border-radius: var(--sui-textbox-border-radius);
|
|
164
|
+
padding: var(--sui-textbox-singleline-padding);
|
|
165
|
+
min-width: 0;
|
|
166
|
+
height: var(--sui-textbox-height);
|
|
167
|
+
color: var(--sui-textbox-foreground-color);
|
|
168
|
+
background-color: var(--sui-textbox-background-color);
|
|
169
|
+
font-family: var(--sui-textbox-font-family);
|
|
170
|
+
font-size: var(--sui-textbox-font-size);
|
|
171
|
+
line-height: var(--sui-textbox-singleline-line-height);
|
|
172
|
+
font-weight: var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));
|
|
173
|
+
text-align: var(--sui-textbox-text-align, start);
|
|
174
|
+
text-indent: var(--sui-textbox-text-indent, 0);
|
|
175
|
+
text-transform: var(--sui-textbox-text-transform, none);
|
|
176
|
+
letter-spacing: var(--sui-textbox-letter-spacing, normal);
|
|
177
|
+
word-spacing: var(--sui-word-spacing-normal, normal);
|
|
178
|
+
transition: all 200ms;
|
|
179
|
+
|
|
180
|
+
&:focus {
|
|
181
|
+
border-color: var(--sui-textbox-border-color-focus, var(--sui-primary-accent-color));
|
|
182
|
+
color: var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));
|
|
183
|
+
background-color: var(
|
|
184
|
+
--sui-textbox-background-color-focus,
|
|
185
|
+
var(--sui-textbox-background-color)
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&:read-only {
|
|
190
|
+
color: var(--sui-tertiary-foreground-color);
|
|
191
|
+
border-color: var(--sui-textbox-border-color) !important;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&:is(:disabled, :read-only) {
|
|
195
|
+
background-color: var(--sui-disabled-background-color);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&[aria-invalid='true'] {
|
|
199
|
+
border-color: var(--sui-error-border-color);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
:global {
|
|
203
|
+
& ~ button {
|
|
204
|
+
flex: none;
|
|
205
|
+
margin-inline-start: -1px;
|
|
206
|
+
border-width: 1px;
|
|
207
|
+
border-color: var(--sui-textbox-border-color);
|
|
208
|
+
height: var(--sui-textbox-height);
|
|
209
|
+
aspect-ratio: 1 / 1;
|
|
210
|
+
|
|
211
|
+
&:last-child {
|
|
212
|
+
border-start-start-radius: 0;
|
|
213
|
+
border-start-end-radius: 4px;
|
|
214
|
+
border-end-end-radius: 4px;
|
|
215
|
+
border-end-start-radius: 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.icon {
|
|
219
|
+
font-size: var(--sui-font-size-xx-large);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.label {
|
|
226
|
+
position: absolute;
|
|
227
|
+
inset: var(--sui-textbox-singleline-padding);
|
|
228
|
+
z-index: 2;
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
justify-content: var(
|
|
232
|
+
--sui-textbox-placeholder-text-align,
|
|
233
|
+
var(--sui-textbox-text-align, start)
|
|
234
|
+
);
|
|
235
|
+
pointer-events: none;
|
|
236
|
+
|
|
237
|
+
&.hidden {
|
|
238
|
+
opacity: 0;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
input:focus + .label {
|
|
243
|
+
opacity: 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
input::placeholder,
|
|
247
|
+
.label {
|
|
248
|
+
color: var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));
|
|
249
|
+
opacity: var(--sui-textbox-placeholder-opacity, 0.5);
|
|
250
|
+
font-family: var(--sui-textbox-placeholder-font-family, var(--sui-textbox-font-family));
|
|
251
|
+
font-size: var(--sui-textbox-placeholder-font-size, var(--sui-textbox-font-size));
|
|
252
|
+
line-height: var(
|
|
253
|
+
--sui-textbox-placeholder-singleline-line-height,
|
|
254
|
+
var(--sui-textbox-singleline-line-height)
|
|
255
|
+
);
|
|
256
|
+
font-weight: var(
|
|
257
|
+
--sui-textbox-placeholder-font-weight,
|
|
258
|
+
var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal))
|
|
259
|
+
);
|
|
260
|
+
text-align: var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));
|
|
261
|
+
text-indent: var(--sui-textbox-placeholder-text-indent, var(--sui-textbox-text-indent, 0));
|
|
262
|
+
letter-spacing: var(
|
|
263
|
+
--sui-textbox-placeholder-letter-spacing,
|
|
264
|
+
var(--sui-textbox-letter-spacing, normal)
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
</style>
|
|
@@ -137,92 +137,107 @@
|
|
|
137
137
|
{@render children?.()}
|
|
138
138
|
</div>
|
|
139
139
|
|
|
140
|
-
<style
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
140
|
+
<style lang="scss">
|
|
141
|
+
.toast-base {
|
|
142
|
+
position: fixed;
|
|
143
|
+
inset: 16px;
|
|
144
|
+
z-index: 99999;
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
justify-content: flex-end;
|
|
148
|
+
align-items: flex-end;
|
|
149
|
+
gap: 8px;
|
|
150
|
+
margin: 0;
|
|
151
|
+
border: 0;
|
|
152
|
+
padding: 0;
|
|
153
|
+
width: auto;
|
|
154
|
+
height: auto;
|
|
155
|
+
background-color: transparent;
|
|
156
|
+
font-family: var(--sui-font-family-default);
|
|
157
|
+
font-size: var(--sui-font-size-default);
|
|
158
|
+
font-weight: var(--sui-font-weight-normal, normal);
|
|
159
|
+
text-align: center;
|
|
160
|
+
pointer-events: none;
|
|
161
|
+
-webkit-user-select: none;
|
|
162
|
+
user-select: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:global {
|
|
166
|
+
body:has(.sui.bottom-navigation:not([inert]:not([hidden]))) .toast-base {
|
|
167
|
+
bottom: calc(var(--sui-bottom-navigation-height) + 16px);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.toast {
|
|
172
|
+
position: absolute;
|
|
173
|
+
width: max-content;
|
|
174
|
+
max-width: 80dvw;
|
|
175
|
+
box-shadow: 0 8px 16px var(--sui-popup-shadow-color);
|
|
176
|
+
opacity: 1;
|
|
177
|
+
transition-duration: 250ms;
|
|
178
|
+
will-change: opacity;
|
|
179
|
+
|
|
180
|
+
&[aria-hidden='true'] {
|
|
181
|
+
display: block;
|
|
182
|
+
opacity: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&.top-left {
|
|
186
|
+
inset-block-start: 0;
|
|
187
|
+
inset-block-end: auto;
|
|
188
|
+
inset-inline-start: 0;
|
|
189
|
+
inset-inline-end: auto;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&.top-center {
|
|
193
|
+
inset-block-start: 0;
|
|
194
|
+
inset-block-end: auto;
|
|
195
|
+
inset-inline-start: 50%;
|
|
196
|
+
inset-inline-end: auto;
|
|
197
|
+
|
|
198
|
+
&:dir(ltr) {
|
|
199
|
+
transform: translateX(-50%);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&:dir(rtl) {
|
|
203
|
+
transform: translateX(50%);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&.top-right {
|
|
208
|
+
inset-block-start: 0;
|
|
209
|
+
inset-block-end: auto;
|
|
210
|
+
inset-inline-start: auto;
|
|
211
|
+
inset-inline-end: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&.bottom-left {
|
|
215
|
+
inset-block-start: auto;
|
|
216
|
+
inset-block-end: 0;
|
|
217
|
+
inset-inline-start: 0;
|
|
218
|
+
inset-inline-end: auto;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&.bottom-center {
|
|
222
|
+
inset-block-start: auto;
|
|
223
|
+
inset-block-end: 0;
|
|
224
|
+
inset-inline-start: 50%;
|
|
225
|
+
inset-inline-end: auto;
|
|
226
|
+
|
|
227
|
+
&:dir(ltr) {
|
|
228
|
+
transform: translateX(-50%);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&:dir(rtl) {
|
|
232
|
+
transform: translateX(50%);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&.bottom-right {
|
|
237
|
+
inset-block-start: auto;
|
|
238
|
+
inset-block-end: 0;
|
|
239
|
+
inset-inline-start: auto;
|
|
240
|
+
inset-inline-end: 0;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
</style>
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* @property {'horizontal' | 'vertical'} [orientation] Orientation of the widget. An alias of the
|
|
19
19
|
* `aria-orientation` attribute.
|
|
20
20
|
* @property {'primary' | 'secondary'} [variant] The style variant of the toolbar.
|
|
21
|
+
* @property {string} [ariaLabel] The `aria-label` attribute on the wrapper element.
|
|
21
22
|
* @property {Snippet} [children] Primary slot content.
|
|
22
23
|
*/
|
|
23
24
|
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
disabled = false,
|
|
32
33
|
orientation = 'horizontal',
|
|
33
34
|
variant = undefined,
|
|
35
|
+
ariaLabel = undefined,
|
|
34
36
|
children,
|
|
35
37
|
...restProps
|
|
36
38
|
/* eslint-enable prefer-const */
|
|
@@ -45,65 +47,82 @@
|
|
|
45
47
|
aria-hidden={hidden}
|
|
46
48
|
aria-disabled={disabled}
|
|
47
49
|
aria-orientation={orientation}
|
|
50
|
+
aria-label={ariaLabel}
|
|
48
51
|
>
|
|
49
52
|
<div role="none" class="inner" inert={disabled}>
|
|
50
53
|
{@render children?.()}
|
|
51
54
|
</div>
|
|
52
55
|
</div>
|
|
53
56
|
|
|
54
|
-
<style>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
<style lang="scss">
|
|
58
|
+
[role='toolbar'] {
|
|
59
|
+
--toolbar-size: var(--sui-secondary-toolbar-size);
|
|
60
|
+
flex: none !important;
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
padding-inline: 8px;
|
|
64
|
+
background-color: var(--toolbar-background-color, transparent);
|
|
65
|
+
|
|
66
|
+
&.primary {
|
|
67
|
+
--toolbar-size: var(--sui-primary-toolbar-size);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.secondary {
|
|
71
|
+
@media (width < 768px) {
|
|
72
|
+
padding-inline: 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&[aria-orientation='horizontal'] {
|
|
77
|
+
height: var(--toolbar-size);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&[aria-orientation='vertical'] {
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
width: var(--toolbar-size);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:global {
|
|
86
|
+
button[role='button']:is([aria-pressed='true'], [aria-checked='true']) {
|
|
87
|
+
background-color: var(--sui-selected-background-color);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
h2 {
|
|
91
|
+
flex: auto;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
gap: 8px;
|
|
95
|
+
margin: 0;
|
|
96
|
+
padding-inline-end: 12px;
|
|
97
|
+
min-width: 0;
|
|
98
|
+
font-size: var(--sui-font-size-x-large);
|
|
99
|
+
|
|
100
|
+
&:first-child {
|
|
101
|
+
padding-inline-start: 12px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
span:not(.sui.truncated-text) {
|
|
105
|
+
font-size: var(--sui-font-size-small);
|
|
106
|
+
font-weight: var(--sui-font-weight-normal, normal);
|
|
107
|
+
opacity: 0.8;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.divider {
|
|
112
|
+
&[aria-orientation='horizontal'] {
|
|
113
|
+
margin: 0 4px;
|
|
114
|
+
width: calc(100% - 8px);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&[aria-orientation='vertical'] {
|
|
118
|
+
margin: 4px 0;
|
|
119
|
+
height: calc(100% - 8px);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
68
123
|
}
|
|
69
|
-
}
|
|
70
|
-
[role=toolbar][aria-orientation=horizontal] {
|
|
71
|
-
height: var(--toolbar-size);
|
|
72
|
-
}
|
|
73
|
-
[role=toolbar][aria-orientation=vertical] {
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
width: var(--toolbar-size);
|
|
76
|
-
}
|
|
77
|
-
[role=toolbar] :global(button[role=button]:is([aria-pressed=true], [aria-checked=true])) {
|
|
78
|
-
background-color: var(--sui-selected-background-color);
|
|
79
|
-
}
|
|
80
|
-
[role=toolbar] :global(h2) {
|
|
81
|
-
flex: auto;
|
|
82
|
-
display: flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
gap: 8px;
|
|
85
|
-
margin: 0;
|
|
86
|
-
padding-inline-end: 12px;
|
|
87
|
-
min-width: 0;
|
|
88
|
-
font-size: var(--sui-font-size-x-large);
|
|
89
|
-
}
|
|
90
|
-
[role=toolbar] :global(h2:first-child) {
|
|
91
|
-
padding-inline-start: 12px;
|
|
92
|
-
}
|
|
93
|
-
[role=toolbar] :global(h2) :global(span:not(.sui.truncated-text)) {
|
|
94
|
-
font-size: var(--sui-font-size-small);
|
|
95
|
-
font-weight: var(--sui-font-weight-normal, normal);
|
|
96
|
-
opacity: 0.8;
|
|
97
|
-
}
|
|
98
|
-
[role=toolbar] :global(.divider[aria-orientation=horizontal]) {
|
|
99
|
-
margin: 0 4px;
|
|
100
|
-
width: calc(100% - 8px);
|
|
101
|
-
}
|
|
102
|
-
[role=toolbar] :global(.divider[aria-orientation=vertical]) {
|
|
103
|
-
margin: 4px 0;
|
|
104
|
-
height: calc(100% - 8px);
|
|
105
|
-
}
|
|
106
124
|
|
|
107
|
-
.inner {
|
|
108
|
-
|
|
109
|
-
}
|
|
125
|
+
.inner {
|
|
126
|
+
display: contents;
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
@@ -31,6 +31,10 @@ declare const Toolbar: import("svelte").Component<{
|
|
|
31
31
|
* The style variant of the toolbar.
|
|
32
32
|
*/
|
|
33
33
|
variant?: "primary" | "secondary" | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The `aria-label` attribute on the wrapper element.
|
|
36
|
+
*/
|
|
37
|
+
ariaLabel?: string | undefined;
|
|
34
38
|
/**
|
|
35
39
|
* Primary slot content.
|
|
36
40
|
*/
|
|
@@ -59,6 +63,10 @@ type Props = {
|
|
|
59
63
|
* The style variant of the toolbar.
|
|
60
64
|
*/
|
|
61
65
|
variant?: "primary" | "secondary" | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The `aria-label` attribute on the wrapper element.
|
|
68
|
+
*/
|
|
69
|
+
ariaLabel?: string | undefined;
|
|
62
70
|
/**
|
|
63
71
|
* Primary slot content.
|
|
64
72
|
*/
|
|
@@ -26,10 +26,12 @@
|
|
|
26
26
|
{@render children?.()}
|
|
27
27
|
</span>
|
|
28
28
|
|
|
29
|
-
<style
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
<style lang="scss">
|
|
30
|
+
.truncated-text {
|
|
31
|
+
display: -webkit-box;
|
|
32
|
+
-webkit-box-orient: vertical;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
white-space: normal;
|
|
35
|
+
overflow-wrap: anywhere;
|
|
36
|
+
}
|
|
37
|
+
</style>
|