@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
@@ -41,6 +41,7 @@
41
41
  editable = true,
42
42
  position = 'bottom-left',
43
43
  filterThreshold = 5,
44
+ ariaLabel = undefined,
44
45
  children,
45
46
  chevronIcon,
46
47
  onChange,
@@ -134,6 +135,7 @@
134
135
  aria-required={required}
135
136
  aria-invalid={invalid}
136
137
  aria-haspopup="listbox"
138
+ aria-label={ariaLabel}
137
139
  >
138
140
  <div role="none" class="label">
139
141
  <TruncatedText>
@@ -157,6 +159,7 @@
157
159
  aria-controls="{id}-popup"
158
160
  aria-expanded={isPopupOpen}
159
161
  aria-haspopup="listbox"
162
+ aria-label={ariaLabel}
160
163
  />
161
164
  {/if}
162
165
  <Button
@@ -235,122 +238,145 @@
235
238
  {@render children?.()}
236
239
  </Listbox>
237
240
  {#if !hasMatchingOptions}
238
- <div role="alert" class="no-options">
241
+ <div role="alert" class="no-options" aria-live="assertive">
239
242
  {_('_sui.combobox.no_matching_options')}
240
243
  </div>
241
244
  {/if}
242
245
  </div>
243
246
  </Popup>
244
247
 
245
- <style>.combobox {
246
- margin: var(--sui-focus-ring-width);
247
- display: flex;
248
- align-items: center;
249
- position: relative;
250
- min-width: var(--sui-combobox-min-width, calc(var(--sui-option-height) * 5));
251
- }
252
- .combobox div[role=combobox] {
253
- display: flex;
254
- align-items: center;
255
- border-width: 1px;
256
- border-color: var(--sui-control-border-color);
257
- border-radius: var(--sui-textbox-border-radius);
258
- padding-block: 0;
259
- padding-inline-start: calc(var(--sui-textbox-height) / 4);
260
- padding-inline-end: var(--sui-textbox-height);
261
- width: 100%;
262
- height: var(--sui-textbox-height);
263
- color: var(--sui-control-foreground-color);
264
- background-color: var(--sui-disabled-background-color);
265
- font-family: var(--sui-control-font-family);
266
- font-size: var(--sui-control-font-size);
267
- line-height: var(--sui-control-line-height);
268
- -webkit-user-select: none;
269
- user-select: none;
270
- cursor: pointer;
271
- transition: all 200ms;
272
- }
273
- .combobox div[role=combobox]:not(.selected) {
274
- font-style: italic;
275
- }
276
- .combobox div[role=combobox]:is(:hover, :focus) {
277
- background-color: var(--sui-hover-background-color);
278
- }
279
- .combobox div[role=combobox][aria-invalid=true] {
280
- border-color: var(--sui-error-border-color);
281
- }
282
- .combobox div[role=combobox] .label {
283
- width: 100%;
284
- }
285
- .combobox :global(.icon) {
286
- font-size: var(--sui-font-size-xx-large);
287
- opacity: 0.5;
288
- }
289
- .combobox > :global(.icon) {
290
- position: absolute;
291
- inset-block-start: 8px;
292
- inset-inline-start: 8px;
293
- z-index: 1;
294
- }
295
- .combobox > :global(button) {
296
- position: absolute;
297
- inset-block-start: 0;
298
- inset-inline-end: 0;
299
- z-index: 1;
300
- margin: 0 !important;
301
- border-start-start-radius: 0;
302
- border-end-start-radius: 0;
303
- background-color: transparent !important;
304
- }
305
- .combobox > :global(button[tabindex="-1"]) {
306
- pointer-events: none;
307
- }
308
- .combobox :global(:not(.editable)) > :global(button) {
309
- background-color: transparent !important;
310
- }
311
- .combobox :global(.text-input) {
312
- margin: 0 !important;
313
- width: 100% !important;
314
- }
315
- .combobox :global(input) {
316
- padding-block: 0;
317
- padding-inline: 8px 32px;
318
- width: 0;
319
- }
320
- .combobox + :global([role=listbox]) {
321
- position: fixed;
322
- z-index: 100;
323
- border-radius: var(--sui-control-medium-border-radius);
324
- box-shadow: 0 8px 16px var(--sui-popup-shadow-color);
325
- overflow: auto;
326
- background-color: var(--sui-secondary-background-color);
327
- -webkit-backdrop-filter: blur(32px);
328
- backdrop-filter: blur(32px);
329
- /* Add .1s delay before the position can be determined */
330
- transition: opacity 100ms 100ms;
331
- }
332
- .combobox + :global([role=listbox]:not(.open)) {
333
- opacity: 0;
334
- pointer-events: none;
335
- }
336
-
337
- .combobox-inner {
338
- display: flex;
339
- flex-direction: column;
340
- overflow: hidden;
341
- }
342
- .combobox-inner :global(.sui.search-bar) {
343
- flex: none;
344
- }
345
- .combobox-inner :global(.sui.listbox) {
346
- flex: auto;
347
- overflow-y: auto;
348
- }
349
- .combobox-inner .no-options {
350
- flex: none;
351
- display: flex;
352
- align-items: center;
353
- padding: var(--sui-option-padding);
354
- height: var(--sui-option-height);
355
- color: var(--sui-tertiary-foreground-color);
356
- }</style>
248
+ <style lang="scss">
249
+ .combobox {
250
+ margin: var(--sui-focus-ring-width);
251
+ display: flex;
252
+ align-items: center;
253
+ position: relative;
254
+ min-width: var(--sui-combobox-min-width, calc(var(--sui-option-height) * 5));
255
+
256
+ div[role='combobox'] {
257
+ display: flex;
258
+ align-items: center;
259
+ border-width: 1px;
260
+ border-color: var(--sui-control-border-color);
261
+ border-radius: var(--sui-textbox-border-radius);
262
+ padding-block: 0;
263
+ padding-inline-start: calc(var(--sui-textbox-height) / 4);
264
+ padding-inline-end: var(--sui-textbox-height);
265
+ width: 100%;
266
+ height: var(--sui-textbox-height);
267
+ color: var(--sui-control-foreground-color);
268
+ background-color: var(--sui-disabled-background-color);
269
+ font-family: var(--sui-control-font-family);
270
+ font-size: var(--sui-control-font-size);
271
+ line-height: var(--sui-control-line-height);
272
+ -webkit-user-select: none;
273
+ user-select: none;
274
+ cursor: pointer;
275
+ transition: all 200ms;
276
+
277
+ &:not(.selected) {
278
+ font-style: italic;
279
+ }
280
+
281
+ &:is(:hover, :focus) {
282
+ background-color: var(--sui-hover-background-color);
283
+ }
284
+
285
+ &[aria-invalid='true'] {
286
+ border-color: var(--sui-error-border-color);
287
+ }
288
+
289
+ .label {
290
+ width: 100%;
291
+ }
292
+ }
293
+
294
+ :global {
295
+ .icon {
296
+ font-size: var(--sui-font-size-xx-large);
297
+ opacity: 0.5;
298
+ }
299
+
300
+ & > .icon {
301
+ position: absolute;
302
+ inset-block-start: 8px;
303
+ inset-inline-start: 8px;
304
+ z-index: 1;
305
+ }
306
+
307
+ & > button {
308
+ position: absolute;
309
+ inset-block-start: 0;
310
+ inset-inline-end: 0;
311
+ z-index: 1;
312
+ margin: 0 !important;
313
+ border-start-start-radius: 0;
314
+ border-end-start-radius: 0;
315
+ background-color: transparent !important;
316
+
317
+ &[tabindex='-1'] {
318
+ pointer-events: none;
319
+ }
320
+ }
321
+
322
+ &:not(.editable) > button {
323
+ background-color: transparent !important;
324
+ }
325
+
326
+ .text-input {
327
+ margin: 0 !important;
328
+ width: 100% !important;
329
+ }
330
+
331
+ input {
332
+ padding-block: 0;
333
+ padding-inline: 8px 32px;
334
+ width: 0; // = auto
335
+ }
336
+
337
+ & + [role='listbox'] {
338
+ position: fixed;
339
+ z-index: 100;
340
+ border-radius: var(--sui-control-medium-border-radius);
341
+ box-shadow: 0 8px 16px var(--sui-popup-shadow-color);
342
+ overflow: auto;
343
+ background-color: var(--sui-secondary-background-color);
344
+ -webkit-backdrop-filter: blur(32px);
345
+ backdrop-filter: blur(32px);
346
+ /* Add .1s delay before the position can be determined */
347
+ transition: opacity 100ms 100ms;
348
+
349
+ &:not(.open) {
350
+ opacity: 0;
351
+ pointer-events: none;
352
+ }
353
+ }
354
+ }
355
+ }
356
+
357
+ .combobox-inner {
358
+ display: flex;
359
+ flex-direction: column;
360
+ overflow: hidden;
361
+
362
+ :global {
363
+ .sui.search-bar {
364
+ flex: none;
365
+ }
366
+
367
+ .sui.listbox {
368
+ flex: auto;
369
+ overflow-y: auto;
370
+ }
371
+ }
372
+
373
+ .no-options {
374
+ flex: none;
375
+ display: flex;
376
+ align-items: center;
377
+ padding: var(--sui-option-padding);
378
+ height: var(--sui-option-height);
379
+ color: var(--sui-tertiary-foreground-color);
380
+ }
381
+ }
382
+ </style>
@@ -256,60 +256,76 @@
256
256
  {/if}
257
257
  </div>
258
258
 
259
- <style>.select-tags {
260
- display: flex;
261
- flex-wrap: wrap;
262
- align-items: center;
263
- }
264
- .select-tags.disabled {
265
- pointer-events: none;
266
- }
267
- .select-tags.disabled > * {
268
- opacity: 0.5;
269
- }
270
- .select-tags span[role=listbox] {
271
- display: contents;
272
- }
273
- .select-tags span[draggable] {
274
- display: inline-flex;
275
- align-items: center;
276
- position: relative;
277
- margin: var(--sui-focus-ring-width);
278
- padding: 0;
279
- padding-inline-start: 8px;
280
- border-radius: var(--sui-control-medium-border-radius);
281
- background-color: var(--sui-secondary-background-color);
282
- cursor: grab;
283
- outline: none;
284
- }
285
- .select-tags span[draggable]:focus-within {
286
- outline: var(--sui-focus-ring-width) solid var(--sui-primary-accent-color-translucent);
287
- outline-offset: 1px;
288
- }
289
- .select-tags span[draggable].drag-source {
290
- opacity: 0.4;
291
- cursor: grabbing;
292
- }
293
- .select-tags span[draggable].drop-before::before, .select-tags span[draggable].drop-after::after {
294
- content: "";
295
- position: absolute;
296
- top: 0;
297
- bottom: 0;
298
- margin-left: -1px;
299
- border-radius: 1px;
300
- width: 4px;
301
- background-color: var(--sui-primary-accent-color);
302
- pointer-events: none;
303
- }
304
- .select-tags span[draggable].drop-before::before {
305
- inset-inline-start: calc(-1 * var(--sui-focus-ring-width) - 1px);
306
- }
307
- .select-tags span[draggable].drop-after::after {
308
- inset-inline-end: calc(-1 * var(--sui-focus-ring-width) - 1px);
309
- }
310
- .select-tags span[draggable] .label {
311
- outline: none;
312
- }
313
- .select-tags span[draggable] :global(.icon) {
314
- font-size: var(--sui-font-size-large);
315
- }</style>
259
+ <style lang="scss">
260
+ .select-tags {
261
+ display: flex;
262
+ flex-wrap: wrap;
263
+ align-items: center;
264
+
265
+ &.disabled {
266
+ pointer-events: none;
267
+
268
+ & > * {
269
+ opacity: 0.5;
270
+ }
271
+ }
272
+
273
+ span[role='listbox'] {
274
+ display: contents;
275
+ }
276
+
277
+ span[draggable] {
278
+ display: inline-flex;
279
+ align-items: center;
280
+ position: relative;
281
+ margin: var(--sui-focus-ring-width);
282
+ padding: 0;
283
+ padding-inline-start: 8px;
284
+ border-radius: var(--sui-control-medium-border-radius);
285
+ background-color: var(--sui-secondary-background-color);
286
+ cursor: grab;
287
+ outline: none;
288
+
289
+ &:focus-within {
290
+ outline: var(--sui-focus-ring-width) solid var(--sui-primary-accent-color-translucent);
291
+ outline-offset: 1px;
292
+ }
293
+
294
+ &.drag-source {
295
+ opacity: 0.4;
296
+ cursor: grabbing;
297
+ }
298
+
299
+ &.drop-before::before,
300
+ &.drop-after::after {
301
+ content: '';
302
+ position: absolute;
303
+ top: 0;
304
+ bottom: 0;
305
+ margin-left: -1px;
306
+ border-radius: 1px;
307
+ width: 4px;
308
+ background-color: var(--sui-primary-accent-color);
309
+ pointer-events: none;
310
+ }
311
+
312
+ &.drop-before::before {
313
+ inset-inline-start: calc(-1 * var(--sui-focus-ring-width) - 1px);
314
+ }
315
+
316
+ &.drop-after::after {
317
+ inset-inline-end: calc(-1 * var(--sui-focus-ring-width) - 1px);
318
+ }
319
+
320
+ .label {
321
+ outline: none;
322
+ }
323
+
324
+ :global {
325
+ .icon {
326
+ font-size: var(--sui-font-size-large);
327
+ }
328
+ }
329
+ }
330
+ }
331
+ </style>
@@ -381,77 +381,97 @@
381
381
  </div>
382
382
  </div>
383
383
 
384
- <style>.slider {
385
- position: relative;
386
- display: inline-block;
387
- margin: var(--sui-focus-ring-width);
388
- padding: 4px 6px;
389
- touch-action: none;
390
- }
391
- .slider:hover .base-bar {
392
- background-color: var(--sui-hover-background-color);
393
- }
394
- .slider:active .base-bar {
395
- background-color: var(--sui-active-background-color);
396
- }
397
-
398
- .base {
399
- position: relative;
400
- width: var(--sui-slider-base-width, 240px);
401
- height: calc(var(--sui-checkbox-height) / 2);
402
- cursor: pointer;
403
- }
404
-
405
- .base-bar {
406
- border-width: 1px;
407
- border-style: solid;
408
- border-color: var(--sui-control-border-color);
409
- border-radius: var(--sui-checkbox-height);
410
- background-color: var(--sui-slider-background-color, var(--sui-secondary-background-color));
411
- transition: all 200ms;
412
- width: 100%;
413
- height: 100%;
414
- }
415
-
416
- .slider-bar {
417
- position: absolute;
418
- top: 0;
419
- height: calc(var(--sui-checkbox-height) / 2);
420
- border-radius: var(--sui-checkbox-height);
421
- background-color: var(--sui-primary-accent-color-light);
422
- }
423
- .invalid .slider-bar {
424
- background-color: var(--sui-error-border-color);
425
- }
426
-
427
- [role=slider] {
428
- position: absolute;
429
- top: 0;
430
- border: 3px solid var(--sui-primary-accent-color-light);
431
- border-radius: var(--sui-checkbox-height);
432
- width: calc(var(--sui-checkbox-height) - 2px);
433
- height: calc(var(--sui-checkbox-height) - 2px);
434
- background-color: var(--sui-primary-accent-color-inverted);
435
- cursor: pointer;
436
- }
437
- [role=slider]:dir(ltr) {
438
- transform: translate(calc((var(--sui-checkbox-height) / 2 - 1px) * -1), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));
439
- }
440
- [role=slider]:dir(rtl) {
441
- transform: translate(calc(var(--sui-checkbox-height) / 2 - 1px), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));
442
- }
443
- .invalid [role=slider] {
444
- border-color: var(--sui-error-border-color);
445
- }
446
-
447
- .label {
448
- position: absolute;
449
- top: calc(var(--sui-checkbox-height) / 2 + 8px);
450
- font-size: var(--sui-font-size-x-small);
451
- }
452
- .label:dir(ltr) {
453
- transform: translateX(-50%);
454
- }
455
- .label:dir(rtl) {
456
- transform: translateX(50%);
457
- }</style>
384
+ <style lang="scss">
385
+ .slider {
386
+ position: relative;
387
+ display: inline-block;
388
+ margin: var(--sui-focus-ring-width);
389
+ padding: 4px 6px;
390
+ touch-action: none;
391
+
392
+ &:hover {
393
+ .base-bar {
394
+ background-color: var(--sui-hover-background-color);
395
+ }
396
+ }
397
+
398
+ &:active {
399
+ .base-bar {
400
+ background-color: var(--sui-active-background-color);
401
+ }
402
+ }
403
+ }
404
+
405
+ .base {
406
+ position: relative;
407
+ width: var(--sui-slider-base-width, 240px);
408
+ height: calc(var(--sui-checkbox-height) / 2);
409
+ cursor: pointer;
410
+ }
411
+
412
+ .base-bar {
413
+ border-width: 1px;
414
+ border-style: solid;
415
+ border-color: var(--sui-control-border-color);
416
+ border-radius: var(--sui-checkbox-height);
417
+ background-color: var(--sui-slider-background-color, var(--sui-secondary-background-color));
418
+ transition: all 200ms;
419
+ width: 100%;
420
+ height: 100%;
421
+ }
422
+
423
+ .slider-bar {
424
+ position: absolute;
425
+ top: 0;
426
+ height: calc(var(--sui-checkbox-height) / 2);
427
+ border-radius: var(--sui-checkbox-height);
428
+ background-color: var(--sui-primary-accent-color-light);
429
+
430
+ .invalid & {
431
+ background-color: var(--sui-error-border-color);
432
+ }
433
+ }
434
+
435
+ [role='slider'] {
436
+ position: absolute;
437
+ top: 0;
438
+ border: 3px solid var(--sui-primary-accent-color-light);
439
+ border-radius: var(--sui-checkbox-height);
440
+ width: calc(var(--sui-checkbox-height) - 2px);
441
+ height: calc(var(--sui-checkbox-height) - 2px);
442
+ background-color: var(--sui-primary-accent-color-inverted);
443
+ cursor: pointer;
444
+
445
+ &:dir(ltr) {
446
+ transform: translate(
447
+ calc((var(--sui-checkbox-height) / 2 - 1px) * -1),
448
+ calc((var(--sui-checkbox-height) / 4 - 1px) * -1)
449
+ );
450
+ }
451
+
452
+ &:dir(rtl) {
453
+ transform: translate(
454
+ calc((var(--sui-checkbox-height) / 2 - 1px)),
455
+ calc((var(--sui-checkbox-height) / 4 - 1px) * -1)
456
+ );
457
+ }
458
+
459
+ .invalid & {
460
+ border-color: var(--sui-error-border-color);
461
+ }
462
+ }
463
+
464
+ .label {
465
+ position: absolute;
466
+ top: calc(var(--sui-checkbox-height) / 2 + 8px);
467
+ font-size: var(--sui-font-size-x-small);
468
+
469
+ &:dir(ltr) {
470
+ transform: translateX(-50%);
471
+ }
472
+
473
+ &:dir(rtl) {
474
+ transform: translateX(50%);
475
+ }
476
+ }
477
+ </style>