@sveltia/ui 0.7.4 → 0.8.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 (118) hide show
  1. package/package/components/alert/alert.svelte +4 -4
  2. package/package/components/alert/alert.svelte.d.ts +2 -2
  3. package/package/components/button/button.svelte +13 -3
  4. package/package/components/button/button.svelte.d.ts +11 -4
  5. package/package/components/button/select-button-group.svelte +12 -8
  6. package/package/components/button/select-button.svelte +5 -4
  7. package/package/components/button/select-button.svelte.d.ts +2 -0
  8. package/package/components/calendar/calendar.svelte +20 -14
  9. package/package/components/checkbox/checkbox-group.svelte +6 -5
  10. package/package/components/checkbox/checkbox.svelte +16 -9
  11. package/package/components/checkbox/checkbox.svelte.d.ts +2 -2
  12. package/package/components/dialog/alert-dialog.svelte +50 -0
  13. package/package/components/dialog/alert-dialog.svelte.d.ts +55 -0
  14. package/package/components/dialog/confirmation-dialog.svelte +55 -0
  15. package/package/components/dialog/confirmation-dialog.svelte.d.ts +57 -0
  16. package/package/components/dialog/dialog.svelte +164 -220
  17. package/package/components/dialog/dialog.svelte.d.ts +20 -12
  18. package/package/components/dialog/prompt-dialog.svelte +78 -0
  19. package/package/components/dialog/prompt-dialog.svelte.d.ts +72 -0
  20. package/package/components/disclosure/disclosure.svelte +3 -3
  21. package/package/components/divider/divider.svelte +1 -1
  22. package/package/components/divider/spacer.svelte +1 -12
  23. package/package/components/divider/spacer.svelte.d.ts +0 -2
  24. package/package/components/drawer/drawer.svelte +118 -208
  25. package/package/components/drawer/drawer.svelte.d.ts +12 -8
  26. package/package/components/grid/grid-body.svelte +51 -0
  27. package/package/components/grid/grid-body.svelte.d.ts +36 -0
  28. package/package/components/grid/grid-cell.svelte +22 -0
  29. package/package/components/grid/grid-cell.svelte.d.ts +34 -0
  30. package/package/components/grid/grid-col-header.svelte +22 -0
  31. package/package/components/grid/grid-col-header.svelte.d.ts +34 -0
  32. package/package/components/grid/grid-foot.svelte +27 -0
  33. package/package/components/grid/grid-foot.svelte.d.ts +34 -0
  34. package/package/components/grid/grid-head.svelte +27 -0
  35. package/package/components/grid/grid-head.svelte.d.ts +34 -0
  36. package/package/components/grid/grid-row-header.svelte +23 -0
  37. package/package/components/grid/grid-row-header.svelte.d.ts +34 -0
  38. package/package/components/grid/grid-row.svelte +37 -0
  39. package/package/components/grid/grid-row.svelte.d.ts +44 -0
  40. package/package/components/grid/grid.svelte +52 -0
  41. package/package/components/grid/grid.svelte.d.ts +42 -0
  42. package/package/components/icon/icon.svelte +6 -7
  43. package/package/components/icon/icon.svelte.d.ts +0 -2
  44. package/package/components/listbox/listbox.svelte +6 -6
  45. package/package/components/listbox/option-group.svelte +6 -5
  46. package/package/components/listbox/option.svelte +7 -28
  47. package/package/components/listbox/option.svelte.d.ts +2 -0
  48. package/package/components/menu/menu-button.svelte +26 -16
  49. package/package/components/menu/menu-button.svelte.d.ts +2 -2
  50. package/package/components/menu/menu-item-checkbox.svelte +5 -4
  51. package/package/components/menu/menu-item-checkbox.svelte.d.ts +2 -0
  52. package/package/components/menu/menu-item-group.svelte +4 -3
  53. package/package/components/menu/menu-item-radio.svelte +5 -4
  54. package/package/components/menu/menu-item-radio.svelte.d.ts +2 -0
  55. package/package/components/menu/menu-item.svelte +7 -5
  56. package/package/components/menu/menu-item.svelte.d.ts +4 -2
  57. package/package/components/menu/menu.svelte +1 -1
  58. package/package/components/radio/radio-group.svelte +8 -8
  59. package/package/components/radio/radio-group.svelte.d.ts +2 -2
  60. package/package/components/radio/radio.svelte +5 -2
  61. package/package/components/radio/radio.svelte.d.ts +2 -0
  62. package/package/components/select/combobox.svelte +55 -35
  63. package/package/components/select/combobox.svelte.d.ts +3 -2
  64. package/package/components/select/select.svelte +10 -9
  65. package/package/components/select/select.svelte.d.ts +4 -3
  66. package/package/components/slider/slider.svelte +15 -7
  67. package/package/components/switch/switch.svelte +9 -6
  68. package/package/components/switch/switch.svelte.d.ts +2 -2
  69. package/package/components/table/table-body.svelte +31 -3
  70. package/package/components/table/table-body.svelte.d.ts +2 -0
  71. package/package/components/table/table-cell.svelte +3 -4
  72. package/package/components/table/table-cell.svelte.d.ts +1 -1
  73. package/package/components/table/table-col-header.svelte +1 -2
  74. package/package/components/table/table-foot.svelte +7 -3
  75. package/package/components/table/table-head.svelte +7 -3
  76. package/package/components/table/table-row-header.svelte +1 -2
  77. package/package/components/table/table-row.svelte +1 -14
  78. package/package/components/table/table-row.svelte.d.ts +0 -8
  79. package/package/components/table/table.svelte +5 -17
  80. package/package/components/table/table.svelte.d.ts +1 -7
  81. package/package/components/tabs/tab-list.svelte +7 -5
  82. package/package/components/tabs/tab-panel.svelte +1 -1
  83. package/package/components/tabs/tab.svelte +2 -1
  84. package/package/components/tabs/tab.svelte.d.ts +2 -0
  85. package/package/components/text-field/markdown-editor.svelte +36 -9
  86. package/package/components/text-field/markdown-editor.svelte.d.ts +2 -0
  87. package/package/components/text-field/number-input.svelte +107 -43
  88. package/package/components/text-field/number-input.svelte.d.ts +2 -0
  89. package/package/components/text-field/password-input.svelte +43 -12
  90. package/package/components/text-field/password-input.svelte.d.ts +2 -0
  91. package/package/components/text-field/search-bar.svelte +43 -13
  92. package/package/components/text-field/search-bar.svelte.d.ts +5 -0
  93. package/package/components/text-field/text-area.svelte +26 -6
  94. package/package/components/text-field/text-area.svelte.d.ts +2 -0
  95. package/package/components/text-field/text-input.svelte +37 -7
  96. package/package/components/text-field/text-input.svelte.d.ts +14 -4
  97. package/package/components/toast/toast.svelte +6 -16
  98. package/package/components/toast/toast.svelte.d.ts +2 -2
  99. package/package/components/toolbar/toolbar.svelte +3 -4
  100. package/package/components/util/app-shell.svelte +34 -29
  101. package/package/components/util/group.svelte +2 -2
  102. package/package/components/util/modal.svelte +220 -0
  103. package/package/components/util/modal.svelte.d.ts +83 -0
  104. package/package/components/util/popup.svelte +80 -121
  105. package/package/components/util/popup.svelte.d.ts +22 -13
  106. package/package/components/util/portal.svelte +1 -1
  107. package/package/index.d.ts +12 -0
  108. package/package/index.js +12 -0
  109. package/package/locales/en.d.ts +1 -0
  110. package/package/locales/en.js +1 -0
  111. package/package/locales/ja.d.ts +1 -0
  112. package/package/locales/ja.js +1 -0
  113. package/package/services/group.js +67 -13
  114. package/package/services/popup.d.ts +5 -1
  115. package/package/services/popup.js +22 -19
  116. package/package/styles/core.scss +13 -26
  117. package/package/styles/variables.scss +14 -2
  118. package/package.json +107 -11
@@ -9,6 +9,7 @@
9
9
 
10
10
  <script>
11
11
  import { _ } from 'svelte-i18n';
12
+ import { getRandomId } from '../../services/util';
12
13
  import Button from '../button/button.svelte';
13
14
  import Icon from '../icon/icon.svelte';
14
15
  import TextInput from './text-input.svelte';
@@ -19,6 +20,11 @@
19
20
  */
20
21
  let className = '';
21
22
  export { className as class };
23
+ /**
24
+ * Make the text input container flexible.
25
+ * @type {boolean}
26
+ */
27
+ export let flex = false;
22
28
  /**
23
29
  * Whether to hide the widget. An alias of the `aria-hidden` attribute.
24
30
  * @type {boolean | undefined}
@@ -35,12 +41,12 @@
35
41
  */
36
42
  export let readonly = false;
37
43
  /**
38
- * Whether to disable the widget. An alias of the `aria-required` attribute.
44
+ * Whether to mark the widget required. An alias of the `aria-required` attribute.
39
45
  * @type {boolean}
40
46
  */
41
47
  export let required = false;
42
48
  /**
43
- * Whether to disable the widget. An alias of the `aria-invalid` attribute.
49
+ * Whether to mark the widget invalid. An alias of the `aria-invalid` attribute.
44
50
  * @type {boolean}
45
51
  */
46
52
  export let invalid = false;
@@ -50,6 +56,7 @@
50
56
  */
51
57
  export let value = undefined;
52
58
 
59
+ const id = getRandomId('searchbox');
53
60
  /**
54
61
  * Reference to the `TextInput` component.
55
62
  * @type {TextInput | undefined}
@@ -67,23 +74,28 @@
67
74
  </script>
68
75
 
69
76
  <div
77
+ role={hidden ? undefined : 'none'}
70
78
  class="sui search-bar {className}"
79
+ class:flex
71
80
  class:disabled
72
- role="search"
81
+ class:readonly
73
82
  hidden={hidden || undefined}
74
83
  aria-hidden={hidden}
75
84
  >
76
- <span>
85
+ <span role="none">
77
86
  <Icon name="search" />
78
87
  </span>
79
88
  <TextInput
80
- bind:value
81
89
  role="searchbox"
90
+ {id}
91
+ bind:value
92
+ {flex}
82
93
  {hidden}
83
94
  {disabled}
84
95
  {readonly}
85
96
  {required}
86
97
  {invalid}
98
+ inputmode="search"
87
99
  {...$$restProps}
88
100
  bind:this={inputComponent}
89
101
  on:input
@@ -95,6 +107,8 @@
95
107
  {#if value}
96
108
  <Button
97
109
  iconic
110
+ aria-label={$_('_sui.clear')}
111
+ aria-controls={id}
98
112
  on:click={() => {
99
113
  value = '';
100
114
  input?.focus();
@@ -105,21 +119,29 @@
105
119
  });
106
120
  }}
107
121
  >
108
- <Icon slot="start-icon" name="close" label={$_('_sui.clear')} />
122
+ <Icon slot="start-icon" name="close" />
109
123
  </Button>
110
124
  {/if}
111
125
  </div>
112
126
 
113
- <style>[role=search] {
114
- display: flex;
127
+ <style>.search-bar {
128
+ display: inline-flex;
115
129
  align-items: center;
116
130
  position: relative;
131
+ margin: var(--sui-focus-ring-width);
132
+ min-width: var(--sui-textbox-singleline-min-width);
117
133
  }
118
- [role=search] :global(.icon) {
134
+ .search-bar.flex {
135
+ width: -moz-available;
136
+ width: -webkit-fill-available;
137
+ width: stretch;
138
+ min-width: 0;
139
+ }
140
+ .search-bar :global(.icon) {
119
141
  font-size: var(--sui-font-size-xx-large);
120
142
  opacity: 0.5;
121
143
  }
122
- [role=search] > span {
144
+ .search-bar > span {
123
145
  position: absolute;
124
146
  inset: 0 auto 0 0;
125
147
  z-index: 2;
@@ -129,16 +151,24 @@
129
151
  width: var(--sui-button-medium-height);
130
152
  height: var(--sui-button-medium-height);
131
153
  }
132
- [role=search] > :global(button) {
154
+ .search-bar > :global(button) {
133
155
  position: absolute;
134
156
  inset: 0 0 auto auto;
135
157
  z-index: 2;
158
+ margin: 0 !important;
136
159
  height: var(--sui-button-medium-height);
137
160
  }
138
- [role=search] :global(.label) {
161
+ .search-bar :global(.label) {
139
162
  inset: 0 36px;
140
163
  }
141
- [role=search] :global(input) {
164
+ .search-bar :global(.text-input) {
165
+ flex: auto;
166
+ margin: 0 !important;
167
+ width: 0;
168
+ min-width: 0 !important;
169
+ }
170
+ .search-bar :global(input) {
171
+ z-index: 1;
142
172
  padding: 0 var(--sui-button-medium-height) !important;
143
173
  width: 100%;
144
174
  }</style>
@@ -17,6 +17,7 @@ export default class SearchBar extends SvelteComponent<{
17
17
  value?: string;
18
18
  hidden?: boolean;
19
19
  readonly?: boolean;
20
+ flex?: boolean;
20
21
  }, {
21
22
  input: Event;
22
23
  keydown: KeyboardEvent;
@@ -31,6 +32,9 @@ export default class SearchBar extends SvelteComponent<{
31
32
  set class(arg: string);
32
33
  get class(): string;
33
34
  /**accessor*/
35
+ set flex(arg: boolean);
36
+ get flex(): boolean;
37
+ /**accessor*/
34
38
  set hidden(arg: boolean);
35
39
  get hidden(): boolean;
36
40
  /**accessor*/
@@ -64,6 +68,7 @@ declare const __propDef: {
64
68
  value?: string | undefined;
65
69
  hidden?: boolean | undefined;
66
70
  readonly?: boolean;
71
+ flex?: boolean;
67
72
  };
68
73
  events: {
69
74
  input: Event;
@@ -12,6 +12,11 @@
12
12
  */
13
13
  let className = '';
14
14
  export { className as class };
15
+ /**
16
+ * Make the text input container flexible.
17
+ * @type {boolean}
18
+ */
19
+ export let flex = false;
15
20
  /**
16
21
  * Whether to hide the widget. An alias of the `aria-hidden` attribute.
17
22
  * @type {boolean | undefined}
@@ -28,12 +33,12 @@
28
33
  */
29
34
  export let readonly = false;
30
35
  /**
31
- * Whether to disable the widget. An alias of the `aria-required` attribute.
36
+ * Whether to mark the widget required. An alias of the `aria-required` attribute.
32
37
  * @type {boolean}
33
38
  */
34
39
  export let required = false;
35
40
  /**
36
- * Whether to disable the widget. An alias of the `aria-invalid` attribute.
41
+ * Whether to mark the widget invalid. An alias of the `aria-invalid` attribute.
37
42
  * @type {boolean}
38
43
  */
39
44
  export let invalid = false;
@@ -54,7 +59,14 @@
54
59
  export let autoResize = false;
55
60
  </script>
56
61
 
57
- <div class="sui text-area {className}" class:disabled hidden={hidden || undefined}>
62
+ <div
63
+ role="none"
64
+ class="sui text-area {className}"
65
+ class:flex
66
+ class:disabled
67
+ class:readonly
68
+ hidden={hidden || undefined}
69
+ >
58
70
  <textarea
59
71
  {name}
60
72
  bind:value
@@ -78,7 +90,14 @@
78
90
 
79
91
  <style>.text-area {
80
92
  display: inline-grid;
81
- width: 100%;
93
+ margin: var(--sui-focus-ring-width);
94
+ min-width: var(--sui-textbox-multiline-min-width);
95
+ }
96
+ .text-area.flex {
97
+ width: -moz-available;
98
+ width: -webkit-fill-available;
99
+ width: stretch;
100
+ min-width: 0;
82
101
  }
83
102
 
84
103
  textarea,
@@ -107,8 +126,9 @@ textarea:focus,
107
126
  .clone:focus {
108
127
  border-color: var(--sui-primary-accent-color);
109
128
  }
110
- textarea:disabled,
111
- .clone:disabled {
129
+ textarea:disabled, textarea:read-only,
130
+ .clone:disabled,
131
+ .clone:read-only {
112
132
  background-color: var(--sui-disabled-background-color);
113
133
  }
114
134
 
@@ -17,6 +17,7 @@ export default class TextArea extends SvelteComponent<{
17
17
  value?: string;
18
18
  hidden?: boolean;
19
19
  readonly?: boolean;
20
+ flex?: boolean;
20
21
  autoResize?: boolean;
21
22
  }, {
22
23
  click: MouseEvent;
@@ -41,6 +42,7 @@ declare const __propDef: {
41
42
  value?: string | undefined;
42
43
  hidden?: boolean | undefined;
43
44
  readonly?: boolean;
45
+ flex?: boolean;
44
46
  autoResize?: boolean;
45
47
  };
46
48
  events: {
@@ -21,6 +21,11 @@
21
21
  */
22
22
  let className = '';
23
23
  export { className as class };
24
+ /**
25
+ * Make the text input container flexible.
26
+ * @type {boolean}
27
+ */
28
+ export let flex = false;
24
29
  /**
25
30
  * The `role` attribute on the `<input>` element.
26
31
  * @type {'textbox' | 'searchbox' | 'combobox' | 'spinbutton'}
@@ -42,12 +47,12 @@
42
47
  */
43
48
  export let readonly = false;
44
49
  /**
45
- * Whether to disable the widget. An alias of the `aria-required` attribute.
50
+ * Whether to mark the widget required. An alias of the `aria-required` attribute.
46
51
  * @type {boolean}
47
52
  */
48
53
  export let required = false;
49
54
  /**
50
- * Whether to disable the widget. An alias of the `aria-invalid` attribute.
55
+ * Whether to mark the widget invalid. An alias of the `aria-invalid` attribute.
51
56
  * @type {boolean}
52
57
  */
53
58
  export let invalid = false;
@@ -73,13 +78,26 @@
73
78
  * @type {boolean}
74
79
  */
75
80
  export let showInlineLabel = false;
81
+ /**
82
+ * The `inputmode` attribute on the `<input>`.
83
+ * @type {'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'}
84
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
85
+ */
86
+ export let inputmode = 'text';
76
87
 
77
88
  const id = getRandomId('input');
78
89
 
79
90
  $: ariaLabel = $$restProps['aria-label'];
80
91
  </script>
81
92
 
82
- <div class="sui text-input {className}" class:disabled hidden={hidden || undefined}>
93
+ <div
94
+ role="none"
95
+ class="sui text-input {className}"
96
+ class:flex
97
+ class:disabled
98
+ class:readonly
99
+ hidden={hidden || undefined}
100
+ >
83
101
  <input
84
102
  type="text"
85
103
  {role}
@@ -87,6 +105,7 @@
87
105
  tabindex={disabled ? -1 : 0}
88
106
  disabled={disabled || undefined}
89
107
  readonly={readonly || undefined}
108
+ {inputmode}
90
109
  aria-hidden={hidden}
91
110
  aria-disabled={disabled}
92
111
  aria-readonly={readonly}
@@ -110,14 +129,25 @@
110
129
  </div>
111
130
 
112
131
  <style>.text-input {
113
- position: relative;
114
- width: 100%;
115
132
  display: inline-flex;
116
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
+ .text-input.flex {
139
+ width: -moz-available;
140
+ width: -webkit-fill-available;
141
+ width: stretch;
142
+ min-width: 0;
143
+ }
144
+
145
+ input:-webkit-autofill,
146
+ input:-webkit-autofill:focus {
147
+ transition: background-color 0s 600000s, color 0s 600000s;
117
148
  }
118
149
 
119
150
  input {
120
- z-index: 1;
121
151
  display: inline-block;
122
152
  flex: auto;
123
153
  border-width: 1px;
@@ -140,7 +170,7 @@ input:read-only {
140
170
  color: var(--sui-tertiary-foreground-color);
141
171
  border-color: var(--sui-textbox-border-color) !important;
142
172
  }
143
- input:disabled {
173
+ input:disabled, input:read-only {
144
174
  background-color: var(--sui-disabled-background-color);
145
175
  }
146
176
  input[aria-invalid=true] {
@@ -14,12 +14,14 @@ export default class TextInput extends SvelteComponent<{
14
14
  disabled?: boolean;
15
15
  required?: boolean;
16
16
  value?: string | number;
17
+ role?: "textbox" | "searchbox" | "combobox" | "spinbutton";
17
18
  hidden?: boolean;
18
19
  element?: HTMLInputElement;
19
- role?: "textbox" | "searchbox" | "combobox" | "spinbutton";
20
- keyShortcuts?: string;
21
20
  readonly?: boolean;
21
+ keyShortcuts?: string;
22
+ flex?: boolean;
22
23
  showInlineLabel?: boolean;
24
+ inputmode?: "text" | "numeric" | "decimal" | "tel" | "search" | "email" | "url";
23
25
  }, {
24
26
  input: Event;
25
27
  keydown: KeyboardEvent;
@@ -36,6 +38,9 @@ export default class TextInput extends SvelteComponent<{
36
38
  set class(arg: string);
37
39
  get class(): string;
38
40
  /**accessor*/
41
+ set flex(arg: boolean);
42
+ get flex(): boolean;
43
+ /**accessor*/
39
44
  set role(arg: "textbox" | "searchbox" | "combobox" | "spinbutton");
40
45
  get role(): "textbox" | "searchbox" | "combobox" | "spinbutton";
41
46
  /**accessor*/
@@ -65,6 +70,9 @@ export default class TextInput extends SvelteComponent<{
65
70
  /**accessor*/
66
71
  set showInlineLabel(arg: boolean);
67
72
  get showInlineLabel(): boolean;
73
+ /**accessor*/
74
+ set inputmode(arg: "text" | "numeric" | "decimal" | "tel" | "search" | "email" | "url");
75
+ get inputmode(): "text" | "numeric" | "decimal" | "tel" | "search" | "email" | "url";
68
76
  }
69
77
  export type TextInputProps = typeof __propDef.props;
70
78
  export type TextInputEvents = typeof __propDef.events;
@@ -79,12 +87,14 @@ declare const __propDef: {
79
87
  disabled?: boolean;
80
88
  required?: boolean;
81
89
  value?: string | number | undefined;
90
+ role?: 'textbox' | 'searchbox' | 'combobox' | 'spinbutton';
82
91
  hidden?: boolean | undefined;
83
92
  element?: HTMLInputElement | undefined;
84
- role?: 'textbox' | 'searchbox' | 'combobox' | 'spinbutton';
85
- keyShortcuts?: string | undefined;
86
93
  readonly?: boolean;
94
+ keyShortcuts?: string | undefined;
95
+ flex?: boolean;
87
96
  showInlineLabel?: boolean;
97
+ inputmode?: 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
88
98
  };
89
99
  events: {
90
100
  input: Event;
@@ -6,7 +6,6 @@
6
6
  -->
7
7
  <script>
8
8
  import { onMount } from 'svelte';
9
- import Alert from '../alert/alert.svelte';
10
9
 
11
10
  /**
12
11
  * @type {boolean}
@@ -17,11 +16,6 @@
17
16
  * @type {number}
18
17
  */
19
18
  export let duration = 5000;
20
- /**
21
- * Alert type.
22
- * @type {'error' | 'warning' | 'info' | 'success'}
23
- */
24
- export let type = 'info';
25
19
 
26
20
  /**
27
21
  * @type {HTMLElement}
@@ -73,14 +67,10 @@
73
67
  }
74
68
  </script>
75
69
 
76
- <div class="sui toast-base" bind:this={popoverBase} />
70
+ <div role="none" class="sui toast-base" bind:this={popoverBase} />
77
71
 
78
- <div class="sui toast" hidden={!show || undefined} bind:this={toast}>
79
- <Alert {type}>
80
- {#if show}
81
- <slot />
82
- {/if}
83
- </Alert>
72
+ <div class="sui toast" aria-hidden={!show} bind:this={toast} {...$$restProps}>
73
+ <slot />
84
74
  </div>
85
75
 
86
76
  <style>.toast-base {
@@ -95,8 +85,8 @@
95
85
  margin: 0;
96
86
  border: 0;
97
87
  padding: 16px;
98
- width: 100vw;
99
- height: 100vh;
88
+ width: 100dvw;
89
+ height: 100dvh;
100
90
  background-color: transparent;
101
91
  font-family: var(--sui-font-family-default);
102
92
  font-size: var(--sui-font-size-default);
@@ -114,7 +104,7 @@
114
104
  transition-duration: 250ms;
115
105
  will-change: opacity;
116
106
  }
117
- .toast[hidden] {
107
+ .toast[aria-hidden=true] {
118
108
  display: block;
119
109
  opacity: 0;
120
110
  }</style>
@@ -7,7 +7,7 @@
7
7
  * @see https://developer.chrome.com/blog/introducing-popover-api/
8
8
  */
9
9
  export default class Toast extends SvelteComponent<{
10
- type?: "error" | "warning" | "info" | "success";
10
+ [x: string]: any;
11
11
  show?: boolean;
12
12
  duration?: number;
13
13
  }, {
@@ -22,7 +22,7 @@ export type ToastSlots = typeof __propDef.slots;
22
22
  import { SvelteComponent } from "svelte";
23
23
  declare const __propDef: {
24
24
  props: {
25
- type?: 'error' | 'warning' | 'info' | 'success';
25
+ [x: string]: any;
26
26
  show?: boolean;
27
27
  duration?: number;
28
28
  };
@@ -34,15 +34,15 @@
34
34
  </script>
35
35
 
36
36
  <div
37
- class="sui toolbar {orientation} {variant ?? ''} {className}"
38
37
  role="toolbar"
38
+ class="sui toolbar {orientation} {variant ?? ''} {className}"
39
39
  hidden={hidden || undefined}
40
40
  aria-hidden={hidden}
41
41
  aria-disabled={disabled}
42
42
  aria-orientation={orientation}
43
43
  {...$$restProps}
44
44
  >
45
- <div class="inner" inert={disabled}>
45
+ <div role="none" class="inner" inert={disabled}>
46
46
  <slot />
47
47
  </div>
48
48
  </div>
@@ -52,8 +52,7 @@
52
52
  flex: none !important;
53
53
  display: flex;
54
54
  align-items: center;
55
- gap: 8px;
56
- padding: 8px;
55
+ padding: 0 4px;
57
56
  }
58
57
  [role=toolbar].primary {
59
58
  --toolbar-size: var(--sui-primary-toolbar-size);
@@ -60,12 +60,12 @@
60
60
  <!-- Preload fonts, including the icons -->
61
61
  <div class="font-loader" aria-hidden="true" bind:this={fontLoader} style:opacity="0">
62
62
  Loading <strong>Sveltia</strong> <em>UI</em>
63
- <span class="material-symbols-outlined">favorite</span>
63
+ <span role="none" class="material-symbols-outlined">favorite</span>
64
64
  </div>
65
65
 
66
66
  <div
67
- class="sui app-shell"
68
67
  role="none"
68
+ class="sui app-shell"
69
69
  {...$$restProps}
70
70
  on:dragover|preventDefault
71
71
  on:drop|preventDefault
@@ -96,7 +96,7 @@
96
96
  --sui-background-color-3-hsl: var(--sui-base-hue) 5% 96%;
97
97
  --sui-background-color-4-hsl: var(--sui-base-hue) 5% 94%;
98
98
  --sui-background-color-5-hsl: var(--sui-base-hue) 5% 74%;
99
- --sui-border-color-1-hsl: var(--sui-base-hue) 5% 54%;
99
+ --sui-border-color-1-hsl: var(--sui-base-hue) 5% 50%;
100
100
  --sui-border-color-2-hsl: var(--sui-base-hue) 5% 74%;
101
101
  --sui-border-color-3-hsl: var(--sui-base-hue) 5% 70%;
102
102
  --sui-shadow-color: var(--sui-base-hue) 10% 0%;
@@ -105,6 +105,7 @@
105
105
  --sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);
106
106
  --sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);
107
107
  --sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);
108
+ --sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 40%);
108
109
  --sui-error-color-hue: 0;
109
110
  --sui-warning-color-hue: 40;
110
111
  --sui-info-color-hue: 210;
@@ -129,7 +130,7 @@
129
130
  --sui-background-color-3-hsl: var(--sui-base-hue) 10% 14%;
130
131
  --sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;
131
132
  --sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;
132
- --sui-border-color-1-hsl: var(--sui-base-hue) 10% 46%;
133
+ --sui-border-color-1-hsl: var(--sui-base-hue) 10% 50%;
133
134
  --sui-border-color-2-hsl: var(--sui-base-hue) 10% 26%;
134
135
  --sui-border-color-3-hsl: var(--sui-base-hue) 10% 22%;
135
136
  --sui-shadow-color: var(--sui-base-hue) 10% 0%;
@@ -138,6 +139,7 @@
138
139
  --sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);
139
140
  --sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);
140
141
  --sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);
142
+ --sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 40%);
141
143
  --sui-error-color-hue: 0;
142
144
  --sui-warning-color-hue: 40;
143
145
  --sui-info-color-hue: 210;
@@ -201,6 +203,7 @@
201
203
  var(--sui-success-color-hue) var(--sui-alert-background-color-saturation)
202
204
  var(--sui-alert-background-color-lightness)
203
205
  );
206
+ --sui-focus-ring-width: 4px;
204
207
  --sui-primary-border-color: hsl(var(--sui-border-color-2-hsl));
205
208
  --sui-secondary-border-color: hsl(var(--sui-border-color-3-hsl));
206
209
  --sui-error-border-color: hsl(
@@ -283,7 +286,9 @@
283
286
  --sui-textbox-background-color: hsl(var(--sui-background-color-1-hsl));
284
287
  --sui-textbox-font-family: var(--sui-font-family-default);
285
288
  --sui-textbox-font-size: var(--sui-font-size-default);
289
+ --sui-textbox-singleline-min-width: 240px;
286
290
  --sui-textbox-singleline-line-height: var(--sui-line-height-compact);
291
+ --sui-textbox-multiline-min-width: 480px;
287
292
  --sui-textbox-multiline-line-height: var(--sui-line-height-comfortable);
288
293
  --sui-tab-small-height: var(--sui-control-small-height);
289
294
  --sui-tab-medium-height: var(--sui-control-medium-height);
@@ -306,6 +311,14 @@
306
311
  --sui-secondary-row-height: 48px;
307
312
  }
308
313
  }
314
+ @media (prefers-reduced-transparency) {
315
+ :global(:root),
316
+ :global(:host) {
317
+ --sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));
318
+ --sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));
319
+ --sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));
320
+ }
321
+ }
309
322
 
310
323
  :global(.material-symbols-outlined) {
311
324
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
@@ -317,14 +330,21 @@
317
330
  overflow-anchor: none;
318
331
  scroll-behavior: smooth;
319
332
  box-sizing: border-box;
320
- outline-offset: 1px;
321
- outline-width: 2px !important;
333
+ outline-offset: 0px;
334
+ outline-width: var(--sui-focus-ring-width) !important;
322
335
  outline-style: solid;
323
336
  outline-color: transparent;
324
337
  border-width: 0;
325
338
  border-style: solid;
326
339
  vertical-align: top;
327
340
  }
341
+ @media (prefers-reduced-motion) {
342
+ :global(*),
343
+ :global(::before),
344
+ :global(::after) {
345
+ transition-duration: 1ms !important;
346
+ }
347
+ }
328
348
 
329
349
  :global(*) {
330
350
  -webkit-tap-highlight-color: transparent;
@@ -336,7 +356,8 @@
336
356
  }
337
357
 
338
358
  :global(:focus-visible) {
339
- outline-color: var(--sui-primary-accent-color-light);
359
+ outline-color: var(--sui-primary-accent-color-translucent);
360
+ z-index: 2;
340
361
  }
341
362
 
342
363
  :global(h1),
@@ -374,30 +395,10 @@
374
395
  user-select: text;
375
396
  }
376
397
 
377
- :global(dialog) {
378
- position: fixed;
379
- inset: 0;
380
- outline: 0;
381
- margin: 0;
382
- border: 0;
383
- padding: 0;
384
- width: 100vw;
385
- max-width: 100vw;
386
- height: 100vh;
387
- max-height: 100vh;
388
- color: var(--sui-primary-foreground-color);
389
- background: transparent;
390
- -webkit-user-select: none;
391
- user-select: none;
392
- touch-action: none;
393
- cursor: default;
394
- }
395
- :global(dialog::backdrop) {
396
- background: transparent;
397
- }
398
-
399
398
  :global(.disabled),
399
+ :global(.readonly),
400
400
  :global([aria-disabled=true]),
401
+ :global([aria-readonly=true]),
401
402
  :global([inert]) {
402
403
  cursor: default;
403
404
  pointer-events: none;
@@ -406,13 +407,17 @@
406
407
  filter: grayscale(1) opacity(0.35);
407
408
  }
408
409
  :global(.disabled) :global(*),
410
+ :global(.readonly) :global(*),
409
411
  :global([aria-disabled=true]) :global(*),
412
+ :global([aria-readonly=true]) :global(*),
410
413
  :global([inert]) :global(*) {
411
414
  filter: grayscale(0) opacity(1);
412
415
  }
413
416
 
414
417
  :global(.disabled) :global(*),
418
+ :global(.readonly) :global(*),
415
419
  :global([aria-disabled=true]) :global(*),
420
+ :global([aria-readonly=true]) :global(*),
416
421
  :global([inert]) :global(*) {
417
422
  cursor: default;
418
423
  pointer-events: none;
@@ -23,14 +23,14 @@
23
23
  </script>
24
24
 
25
25
  <div
26
- class="sui group {className}"
27
26
  role="group"
27
+ class="sui group {className}"
28
28
  hidden={hidden || undefined}
29
29
  aria-hidden={hidden}
30
30
  aria-disabled={disabled}
31
31
  {...$$restProps}
32
32
  >
33
- <div class="inner" inert={disabled}>
33
+ <div role="none" class="inner" inert={disabled}>
34
34
  <slot />
35
35
  </div>
36
36
  </div>