@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.
Files changed (100) hide show
  1. package/dist/components/alert/alert.svelte +39 -31
  2. package/dist/components/alert/alert.svelte.d.ts +8 -0
  3. package/dist/components/alert/infobar.svelte +58 -46
  4. package/dist/components/alert/infobar.svelte.d.ts +8 -0
  5. package/dist/components/bottom-navigation/bottom-navigation.svelte +21 -15
  6. package/dist/components/button/button-group.svelte +10 -6
  7. package/dist/components/button/button-group.svelte.d.ts +8 -0
  8. package/dist/components/button/button.svelte +274 -175
  9. package/dist/components/button/floating-action-button-wrapper.svelte +23 -18
  10. package/dist/components/button/select-button-group.svelte +60 -41
  11. package/dist/components/button/select-button-group.svelte.d.ts +8 -0
  12. package/dist/components/button/split-button.svelte +25 -18
  13. package/dist/components/calendar/calendar.svelte +103 -80
  14. package/dist/components/checkbox/checkbox-group.svelte +25 -19
  15. package/dist/components/checkbox/checkbox-group.svelte.d.ts +8 -0
  16. package/dist/components/checkbox/checkbox.svelte +93 -65
  17. package/dist/components/checkbox/checkbox.svelte.d.ts +2 -2
  18. package/dist/components/dialog/dialog.svelte +105 -87
  19. package/dist/components/dialog/prompt-dialog.svelte +5 -3
  20. package/dist/components/disclosure/disclosure.svelte +34 -21
  21. package/dist/components/divider/divider.svelte +21 -14
  22. package/dist/components/divider/divider.svelte.d.ts +8 -0
  23. package/dist/components/divider/spacer.svelte +13 -8
  24. package/dist/components/drawer/drawer.svelte +343 -190
  25. package/dist/components/grid/grid-body.svelte +16 -14
  26. package/dist/components/grid/grid-cell.svelte +5 -3
  27. package/dist/components/grid/grid-col-header.svelte +5 -3
  28. package/dist/components/grid/grid-foot.svelte +5 -3
  29. package/dist/components/grid/grid-head.svelte +5 -3
  30. package/dist/components/grid/grid-row-header.svelte +6 -4
  31. package/dist/components/grid/grid-row.svelte +6 -4
  32. package/dist/components/grid/grid.svelte +21 -12
  33. package/dist/components/grid/grid.svelte.d.ts +8 -0
  34. package/dist/components/icon/icon.svelte +7 -5
  35. package/dist/components/listbox/listbox.svelte +81 -61
  36. package/dist/components/listbox/listbox.svelte.d.ts +8 -0
  37. package/dist/components/listbox/option-group.svelte +15 -11
  38. package/dist/components/listbox/option.svelte +54 -39
  39. package/dist/components/menu/menu-item-group.svelte +5 -3
  40. package/dist/components/menu/menu-item.svelte +67 -51
  41. package/dist/components/menu/menu.svelte +24 -17
  42. package/dist/components/menu/menu.svelte.d.ts +8 -0
  43. package/dist/components/progressbar/progressbar.svelte +27 -15
  44. package/dist/components/progressbar/progressbar.svelte.d.ts +8 -0
  45. package/dist/components/radio/radio-group.svelte +43 -31
  46. package/dist/components/radio/radio-group.svelte.d.ts +8 -0
  47. package/dist/components/radio/radio.svelte +81 -63
  48. package/dist/components/resizable-pane/resizable-handle.svelte +63 -48
  49. package/dist/components/resizable-pane/resizable-handle.svelte.d.ts +8 -0
  50. package/dist/components/resizable-pane/resizable-pane-group.svelte +18 -14
  51. package/dist/components/select/combobox.svelte +139 -113
  52. package/dist/components/select/select-tags.svelte +73 -57
  53. package/dist/components/slider/slider.svelte +94 -74
  54. package/dist/components/switch/switch.svelte +118 -81
  55. package/dist/components/switch/switch.svelte.d.ts +8 -0
  56. package/dist/components/table/table-body.svelte +16 -14
  57. package/dist/components/table/table-cell.svelte +5 -3
  58. package/dist/components/table/table-col-header.svelte +5 -3
  59. package/dist/components/table/table-foot.svelte +5 -3
  60. package/dist/components/table/table-head.svelte +5 -3
  61. package/dist/components/table/table-row-header.svelte +6 -4
  62. package/dist/components/table/table-row.svelte +6 -4
  63. package/dist/components/table/table.svelte +21 -13
  64. package/dist/components/table/table.svelte.d.ts +8 -0
  65. package/dist/components/tabs/tab-box.svelte +9 -6
  66. package/dist/components/tabs/tab-list.svelte +94 -73
  67. package/dist/components/tabs/tab-list.svelte.d.ts +8 -0
  68. package/dist/components/tabs/tab-panel.svelte +11 -7
  69. package/dist/components/tabs/tab-panels.svelte +19 -14
  70. package/dist/components/text-editor/code-editor.svelte +10 -7
  71. package/dist/components/text-editor/core.js +3 -0
  72. package/dist/components/text-editor/lexical-root.svelte +221 -160
  73. package/dist/components/text-editor/text-editor.svelte +25 -18
  74. package/dist/components/text-editor/toolbar/insert-link-button.svelte +2 -1
  75. package/dist/components/text-editor/toolbar/toolbar-wrapper.svelte +44 -37
  76. package/dist/components/text-field/number-input.svelte +87 -68
  77. package/dist/components/text-field/password-input.svelte +52 -42
  78. package/dist/components/text-field/search-bar.svelte +64 -53
  79. package/dist/components/text-field/secret-input.svelte +61 -46
  80. package/dist/components/text-field/text-area.svelte +80 -68
  81. package/dist/components/text-field/text-input.svelte +139 -107
  82. package/dist/components/toast/toast.svelte +104 -89
  83. package/dist/components/toolbar/toolbar.svelte +73 -54
  84. package/dist/components/toolbar/toolbar.svelte.d.ts +8 -0
  85. package/dist/components/typography/truncated-text.svelte +9 -7
  86. package/dist/components/util/app-shell.svelte +40 -493
  87. package/dist/components/util/empty-state.svelte +13 -11
  88. package/dist/components/util/group.svelte +8 -3
  89. package/dist/components/util/group.svelte.d.ts +8 -0
  90. package/dist/components/util/modal.svelte +59 -48
  91. package/dist/components/util/popup.svelte +87 -67
  92. package/dist/index.d.ts +1 -0
  93. package/dist/index.js +1 -4
  94. package/dist/locales/en.yaml +50 -3
  95. package/dist/locales/ja.yaml +49 -2
  96. package/dist/services/i18n.d.ts +6 -0
  97. package/dist/services/i18n.js +19 -14
  98. package/dist/typedefs.d.ts +5 -1
  99. package/dist/typedefs.js +2 -1
  100. package/package.json +23 -23
@@ -39,7 +39,7 @@
39
39
  readonly = false,
40
40
  required = false,
41
41
  invalid = false,
42
- 'aria-label': ariaLabel,
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>.text-input {
131
- display: inline-flex;
132
- align-items: center;
133
- position: relative;
134
- margin: var(--sui-focus-ring-width);
135
- min-width: var(--sui-textbox-singleline-min-width);
136
- }
137
- .text-input.flex:not([hidden]) {
138
- display: inline-flex;
139
- width: -moz-available;
140
- width: -webkit-fill-available;
141
- width: stretch;
142
- min-width: 0;
143
- }
144
- .text-input.monospace {
145
- --sui-textbox-font-family: var(--sui-font-family-monospace, monospace);
146
- }
147
-
148
- input:is(:-webkit-autofill, :-webkit-autofill:focus) {
149
- transition: background-color 0s 600000s, color 0s 600000s;
150
- }
151
-
152
- input {
153
- display: inline-block;
154
- flex: auto;
155
- border-width: var(--sui-textbox-border-width, 1px);
156
- border-color: var(--sui-textbox-border-color);
157
- border-radius: var(--sui-textbox-border-radius);
158
- padding: var(--sui-textbox-singleline-padding);
159
- min-width: 0;
160
- height: var(--sui-textbox-height);
161
- color: var(--sui-textbox-foreground-color);
162
- background-color: var(--sui-textbox-background-color);
163
- font-family: var(--sui-textbox-font-family);
164
- font-size: var(--sui-textbox-font-size);
165
- line-height: var(--sui-textbox-singleline-line-height);
166
- font-weight: var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));
167
- text-align: var(--sui-textbox-text-align, start);
168
- text-indent: var(--sui-textbox-text-indent, 0);
169
- text-transform: var(--sui-textbox-text-transform, none);
170
- letter-spacing: var(--sui-textbox-letter-spacing, normal);
171
- word-spacing: var(--sui-word-spacing-normal, normal);
172
- transition: all 200ms;
173
- }
174
- input:focus {
175
- border-color: var(--sui-textbox-border-color-focus, var(--sui-primary-accent-color));
176
- color: var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));
177
- background-color: var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));
178
- }
179
- input:read-only {
180
- color: var(--sui-tertiary-foreground-color);
181
- border-color: var(--sui-textbox-border-color) !important;
182
- }
183
- input:is(:disabled, :read-only) {
184
- background-color: var(--sui-disabled-background-color);
185
- }
186
- input[aria-invalid=true] {
187
- border-color: var(--sui-error-border-color);
188
- }
189
- input ~ :global(button) {
190
- flex: none;
191
- margin-inline-start: -1px;
192
- border-width: 1px;
193
- border-color: var(--sui-textbox-border-color);
194
- height: var(--sui-textbox-height);
195
- aspect-ratio: 1/1;
196
- }
197
- input ~ :global(button:last-child) {
198
- border-start-start-radius: 0;
199
- border-start-end-radius: 4px;
200
- border-end-end-radius: 4px;
201
- border-end-start-radius: 0;
202
- }
203
- input ~ :global(button) :global(.icon) {
204
- font-size: var(--sui-font-size-xx-large);
205
- }
206
-
207
- .label {
208
- position: absolute;
209
- inset: var(--sui-textbox-singleline-padding);
210
- z-index: 2;
211
- display: flex;
212
- align-items: center;
213
- justify-content: var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));
214
- pointer-events: none;
215
- }
216
- .label.hidden {
217
- opacity: 0;
218
- }
219
-
220
- input:focus + .label {
221
- opacity: 0;
222
- }
223
-
224
- input::placeholder,
225
- .label {
226
- color: var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));
227
- opacity: var(--sui-textbox-placeholder-opacity, 0.5);
228
- font-family: var(--sui-textbox-placeholder-font-family, var(--sui-textbox-font-family));
229
- font-size: var(--sui-textbox-placeholder-font-size, var(--sui-textbox-font-size));
230
- line-height: var(--sui-textbox-placeholder-singleline-line-height, var(--sui-textbox-singleline-line-height));
231
- font-weight: var(--sui-textbox-placeholder-font-weight, var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal)));
232
- text-align: var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));
233
- text-indent: var(--sui-textbox-placeholder-text-indent, var(--sui-textbox-text-indent, 0));
234
- letter-spacing: var(--sui-textbox-placeholder-letter-spacing, var(--sui-textbox-letter-spacing, normal));
235
- }</style>
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>.toast-base {
141
- position: fixed;
142
- inset: 16px;
143
- z-index: 99999;
144
- display: flex;
145
- flex-direction: column;
146
- justify-content: flex-end;
147
- align-items: flex-end;
148
- gap: 8px;
149
- margin: 0;
150
- border: 0;
151
- padding: 0;
152
- width: auto;
153
- height: auto;
154
- background-color: transparent;
155
- font-family: var(--sui-font-family-default);
156
- font-size: var(--sui-font-size-default);
157
- font-weight: var(--sui-font-weight-normal, normal);
158
- text-align: center;
159
- pointer-events: none;
160
- -webkit-user-select: none;
161
- user-select: none;
162
- }
163
-
164
- :global(body:has(.sui.bottom-navigation:not([inert]:not([hidden])))) :global(.toast-base) {
165
- bottom: calc(var(--sui-bottom-navigation-height) + 16px);
166
- }
167
-
168
- .toast {
169
- position: absolute;
170
- width: max-content;
171
- max-width: 80dvw;
172
- box-shadow: 0 8px 16px var(--sui-popup-shadow-color);
173
- opacity: 1;
174
- transition-duration: 250ms;
175
- will-change: opacity;
176
- }
177
- .toast[aria-hidden=true] {
178
- display: block;
179
- opacity: 0;
180
- }
181
- .toast.top-left {
182
- inset-block-start: 0;
183
- inset-block-end: auto;
184
- inset-inline-start: 0;
185
- inset-inline-end: auto;
186
- }
187
- .toast.top-center {
188
- inset-block-start: 0;
189
- inset-block-end: auto;
190
- inset-inline-start: 50%;
191
- inset-inline-end: auto;
192
- }
193
- .toast.top-center:dir(ltr) {
194
- transform: translateX(-50%);
195
- }
196
- .toast.top-center:dir(rtl) {
197
- transform: translateX(50%);
198
- }
199
- .toast.top-right {
200
- inset-block-start: 0;
201
- inset-block-end: auto;
202
- inset-inline-start: auto;
203
- inset-inline-end: 0;
204
- }
205
- .toast.bottom-left {
206
- inset-block-start: auto;
207
- inset-block-end: 0;
208
- inset-inline-start: 0;
209
- inset-inline-end: auto;
210
- }
211
- .toast.bottom-center {
212
- inset-block-start: auto;
213
- inset-block-end: 0;
214
- inset-inline-start: 50%;
215
- inset-inline-end: auto;
216
- }
217
- .toast.bottom-center:dir(ltr) {
218
- transform: translateX(-50%);
219
- }
220
- .toast.bottom-center:dir(rtl) {
221
- transform: translateX(50%);
222
- }
223
- .toast.bottom-right {
224
- inset-block-start: auto;
225
- inset-block-end: 0;
226
- inset-inline-start: auto;
227
- inset-inline-end: 0;
228
- }</style>
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>[role=toolbar] {
55
- --toolbar-size: var(--sui-secondary-toolbar-size);
56
- flex: none !important;
57
- display: flex;
58
- align-items: center;
59
- padding-inline: 8px;
60
- background-color: var(--toolbar-background-color, transparent);
61
- }
62
- [role=toolbar].primary {
63
- --toolbar-size: var(--sui-primary-toolbar-size);
64
- }
65
- @media (width < 768px) {
66
- [role=toolbar].secondary {
67
- padding-inline: 0;
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
- display: contents;
109
- }</style>
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>.truncated-text {
30
- display: -webkit-box;
31
- -webkit-box-orient: vertical;
32
- overflow: hidden;
33
- white-space: normal;
34
- overflow-wrap: anywhere;
35
- }</style>
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>