@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
@@ -199,72 +199,91 @@
199
199
  />
200
200
  </div>
201
201
 
202
- <style>.number-input {
203
- display: inline-flex;
204
- align-items: center;
205
- margin: var(--sui-focus-ring-width);
206
- min-width: var(--sui-textbox-singleline-min-width);
207
- }
208
- .number-input.flex:not([hidden]) {
209
- display: inline-flex;
210
- width: -moz-available;
211
- width: -webkit-fill-available;
212
- width: stretch;
213
- min-width: 0;
214
- }
215
- .number-input :global(:not(:first-child)) :global(input) {
216
- border-start-start-radius: 0;
217
- border-end-start-radius: 0;
218
- }
219
- .number-input :global(:not(:last-child)) :global(input) {
220
- border-start-end-radius: 0;
221
- border-end-end-radius: 0;
222
- }
223
- .number-input :global(:not(.disabled)) :global(button[aria-disabled=true]) {
224
- filter: grayscale(0) opacity(1);
225
- }
226
- .number-input :global(:not(.disabled)) :global(button[aria-disabled=true]) :global(*) {
227
- filter: grayscale(1) opacity(0.35);
228
- }
229
- .number-input :global(.text-input) {
230
- flex: auto;
231
- margin: 0 !important;
232
- width: 0;
233
- min-width: 0 !important;
234
- }
202
+ <style lang="scss">
203
+ .number-input {
204
+ display: inline-flex;
205
+ align-items: center;
206
+ margin: var(--sui-focus-ring-width);
207
+ min-width: var(--sui-textbox-singleline-min-width);
235
208
 
236
- .buttons {
237
- display: flex;
238
- flex-direction: column;
239
- width: 24px;
240
- height: var(--sui-textbox-height);
241
- }
242
- .buttons :global(button) {
243
- flex: none;
244
- margin: 0 !important;
245
- border-width: 1px;
246
- border-color: var(--sui-textbox-border-color);
247
- width: 100%;
248
- height: 50%;
249
- }
250
- .buttons :global(button:first-of-type) {
251
- border-block-start-width: 1px;
252
- border-block-end-width: 0;
253
- border-inline-end-width: 0;
254
- border-inline-start-width: 1px;
255
- border-start-end-radius: 0;
256
- border-end-end-radius: 0;
257
- border-end-start-radius: 0;
258
- }
259
- .buttons :global(button:last-of-type) {
260
- border-block-start-width: 0;
261
- border-block-end-width: 1px;
262
- border-inline-end-width: 0;
263
- border-inline-start-width: 1px;
264
- border-start-start-radius: 0;
265
- border-start-end-radius: 0;
266
- border-end-end-radius: 0;
267
- }
268
- .buttons :global(button) :global(.icon) {
269
- font-size: 20px;
270
- }</style>
209
+ &.flex:not([hidden]) {
210
+ display: inline-flex; // Avoid Tailwind .flex class collisions
211
+ width: -moz-available;
212
+ width: -webkit-fill-available;
213
+ width: stretch;
214
+ min-width: 0;
215
+ }
216
+
217
+ :global {
218
+ :not(:first-child) input {
219
+ border-start-start-radius: 0;
220
+ border-end-start-radius: 0;
221
+ }
222
+
223
+ :not(:last-child) input {
224
+ border-start-end-radius: 0;
225
+ border-end-end-radius: 0;
226
+ }
227
+
228
+ // Maintain the border opacity
229
+ &:not(.disabled) {
230
+ button[aria-disabled='true'] {
231
+ filter: grayscale(0) opacity(1);
232
+
233
+ * {
234
+ filter: grayscale(1) opacity(0.35);
235
+ }
236
+ }
237
+ }
238
+
239
+ .text-input {
240
+ flex: auto;
241
+ margin: 0 !important;
242
+ width: 0; // = auto
243
+ min-width: 0 !important;
244
+ }
245
+ }
246
+ }
247
+
248
+ .buttons {
249
+ display: flex;
250
+ flex-direction: column;
251
+ width: 24px;
252
+ height: var(--sui-textbox-height);
253
+
254
+ :global {
255
+ button {
256
+ flex: none;
257
+ margin: 0 !important;
258
+ border-width: 1px;
259
+ border-color: var(--sui-textbox-border-color);
260
+ width: 100%;
261
+ height: 50%;
262
+
263
+ &:first-of-type {
264
+ border-block-start-width: 1px;
265
+ border-block-end-width: 0;
266
+ border-inline-end-width: 0;
267
+ border-inline-start-width: 1px;
268
+ border-start-end-radius: 0;
269
+ border-end-end-radius: 0;
270
+ border-end-start-radius: 0;
271
+ }
272
+
273
+ &:last-of-type {
274
+ border-block-start-width: 0;
275
+ border-block-end-width: 1px;
276
+ border-inline-end-width: 0;
277
+ border-inline-start-width: 1px;
278
+ border-start-start-radius: 0;
279
+ border-start-end-radius: 0;
280
+ border-end-end-radius: 0;
281
+ }
282
+
283
+ .icon {
284
+ font-size: 20px;
285
+ }
286
+ }
287
+ }
288
+ }
289
+ </style>
@@ -102,45 +102,55 @@
102
102
  </Button>
103
103
  </div>
104
104
 
105
- <style>.password-input {
106
- display: inline-flex;
107
- align-items: center;
108
- margin: var(--sui-focus-ring-width);
109
- min-width: var(--sui-textbox-singleline-min-width);
110
- }
111
- .password-input.flex:not([hidden]) {
112
- display: inline-flex;
113
- width: -moz-available;
114
- width: -webkit-fill-available;
115
- width: stretch;
116
- min-width: 0;
117
- }
118
- .password-input :global(.text-input) {
119
- flex: auto;
120
- margin: 0 !important;
121
- width: 0;
122
- min-width: 0 !important;
123
- }
124
- .password-input :global(input) {
125
- border-start-end-radius: 0;
126
- border-end-end-radius: 0;
127
- }
128
- .password-input :global(button) {
129
- flex: none;
130
- margin-block: 0;
131
- margin-inline-start: -1px;
132
- margin-inline-end: 0;
133
- border-width: 1px;
134
- border-color: var(--sui-textbox-border-color);
135
- width: var(--sui-textbox-height);
136
- aspect-ratio: 1/1;
137
- }
138
- .password-input :global(button:last-child) {
139
- border-start-start-radius: 0;
140
- border-start-end-radius: 4px;
141
- border-end-end-radius: 4px;
142
- border-end-start-radius: 0;
143
- }
144
- .password-input :global(button) :global(.icon) {
145
- font-size: var(--sui-font-size-xx-large);
146
- }</style>
105
+ <style lang="scss">
106
+ .password-input {
107
+ display: inline-flex;
108
+ align-items: center;
109
+ margin: var(--sui-focus-ring-width);
110
+ min-width: var(--sui-textbox-singleline-min-width);
111
+
112
+ &.flex:not([hidden]) {
113
+ display: inline-flex; // Avoid Tailwind .flex class collisions
114
+ width: -moz-available;
115
+ width: -webkit-fill-available;
116
+ width: stretch;
117
+ min-width: 0;
118
+ }
119
+
120
+ :global {
121
+ .text-input {
122
+ flex: auto;
123
+ margin: 0 !important;
124
+ width: 0; // = auto
125
+ min-width: 0 !important;
126
+ }
127
+
128
+ input {
129
+ border-start-end-radius: 0;
130
+ border-end-end-radius: 0;
131
+ }
132
+
133
+ button {
134
+ flex: none;
135
+ margin-block: 0;
136
+ margin-inline-start: -1px;
137
+ margin-inline-end: 0;
138
+ border-width: 1px;
139
+ border-color: var(--sui-textbox-border-color);
140
+ width: var(--sui-textbox-height);
141
+ aspect-ratio: 1 / 1;
142
+
143
+ &:last-child {
144
+ border-start-start-radius: 0;
145
+ border-start-end-radius: 4px;
146
+ border-end-end-radius: 4px;
147
+ border-end-start-radius: 0;
148
+ }
149
+
150
+ .icon {
151
+ font-size: var(--sui-font-size-xx-large);
152
+ }
153
+ }
154
+ }
155
+ }
156
+ </style>
@@ -115,56 +115,67 @@
115
115
  {/if}
116
116
  </div>
117
117
 
118
- <style>.search-bar {
119
- display: inline-flex;
120
- align-items: center;
121
- position: relative;
122
- margin: var(--sui-focus-ring-width);
123
- min-width: var(--sui-textbox-singleline-min-width);
124
- }
125
- .search-bar.flex:not([hidden]) {
126
- display: inline-flex;
127
- width: -moz-available;
128
- width: -webkit-fill-available;
129
- width: stretch;
130
- min-width: 0;
131
- }
132
- .search-bar > span {
133
- position: absolute;
134
- inset-block: 0;
135
- inset-inline-start: 0;
136
- inset-inline-end: auto;
137
- z-index: 2;
138
- display: flex;
139
- align-items: center;
140
- justify-content: center;
141
- width: var(--sui-button-medium-height);
142
- height: var(--sui-button-medium-height);
143
- }
144
- .search-bar :global(.icon) {
145
- font-size: calc(var(--sui-textbox-height) * 0.6);
146
- opacity: 0.5;
147
- }
148
- .search-bar > :global(button) {
149
- position: absolute;
150
- inset-block: 0;
151
- inset-inline-start: auto;
152
- inset-inline-end: 0;
153
- z-index: 2;
154
- margin: 0 !important;
155
- height: var(--sui-button-medium-height);
156
- }
157
- .search-bar :global(.label) {
158
- --sui-textbox-singleline-padding: 0 36px;
159
- }
160
- .search-bar :global(.text-input) {
161
- flex: auto;
162
- margin: 0 !important;
163
- width: 0;
164
- min-width: 0 !important;
165
- }
166
- .search-bar :global(input) {
167
- z-index: 1;
168
- padding: 0 var(--sui-button-medium-height) !important;
169
- width: 100%;
170
- }</style>
118
+ <style lang="scss">
119
+ .search-bar {
120
+ display: inline-flex;
121
+ align-items: center;
122
+ position: relative;
123
+ margin: var(--sui-focus-ring-width);
124
+ min-width: var(--sui-textbox-singleline-min-width);
125
+
126
+ &.flex:not([hidden]) {
127
+ display: inline-flex; // Avoid Tailwind .flex class collisions
128
+ width: -moz-available;
129
+ width: -webkit-fill-available;
130
+ width: stretch;
131
+ min-width: 0;
132
+ }
133
+
134
+ & > span {
135
+ position: absolute;
136
+ inset-block: 0;
137
+ inset-inline-start: 0;
138
+ inset-inline-end: auto;
139
+ z-index: 2;
140
+ display: flex;
141
+ align-items: center;
142
+ justify-content: center;
143
+ width: var(--sui-button-medium-height);
144
+ height: var(--sui-button-medium-height);
145
+ }
146
+
147
+ :global {
148
+ .icon {
149
+ font-size: calc(var(--sui-textbox-height) * 0.6);
150
+ opacity: 0.5;
151
+ }
152
+
153
+ & > button {
154
+ position: absolute;
155
+ inset-block: 0;
156
+ inset-inline-start: auto;
157
+ inset-inline-end: 0;
158
+ z-index: 2;
159
+ margin: 0 !important;
160
+ height: var(--sui-button-medium-height);
161
+ }
162
+
163
+ .label {
164
+ --sui-textbox-singleline-padding: 0 36px;
165
+ }
166
+
167
+ .text-input {
168
+ flex: auto;
169
+ margin: 0 !important;
170
+ width: 0; // = auto
171
+ min-width: 0 !important;
172
+ }
173
+
174
+ input {
175
+ z-index: 1;
176
+ padding: 0 var(--sui-button-medium-height) !important;
177
+ width: 100%;
178
+ }
179
+ }
180
+ }
181
+ </style>
@@ -96,49 +96,64 @@
96
96
  </Button>
97
97
  </div>
98
98
 
99
- <style>.secret-input {
100
- display: inline-flex;
101
- align-items: center;
102
- margin: var(--sui-focus-ring-width);
103
- min-width: var(--sui-textbox-singleline-min-width);
104
- }
105
- .secret-input.flex:not([hidden]) {
106
- display: inline-flex;
107
- width: -moz-available;
108
- width: -webkit-fill-available;
109
- width: stretch;
110
- min-width: 0;
111
- }
112
- .secret-input.show :global(input) {
113
- -webkit-text-security: none;
114
- }
115
- .secret-input :global(.text-input) {
116
- flex: auto;
117
- margin: 0 !important;
118
- width: 0;
119
- min-width: 0 !important;
120
- }
121
- .secret-input :global(input) {
122
- border-start-end-radius: 0;
123
- border-end-end-radius: 0;
124
- -webkit-text-security: disc;
125
- }
126
- .secret-input :global(button) {
127
- flex: none;
128
- margin-block: 0;
129
- margin-inline-start: -1px;
130
- margin-inline-end: 0;
131
- border-width: 1px;
132
- border-color: var(--sui-textbox-border-color);
133
- width: var(--sui-textbox-height);
134
- aspect-ratio: 1/1;
135
- }
136
- .secret-input :global(button:last-child) {
137
- border-start-start-radius: 0;
138
- border-start-end-radius: 4px;
139
- border-end-end-radius: 4px;
140
- border-end-start-radius: 0;
141
- }
142
- .secret-input :global(button) :global(.icon) {
143
- font-size: var(--sui-font-size-xx-large);
144
- }</style>
99
+ <style lang="scss">
100
+ .secret-input {
101
+ display: inline-flex;
102
+ align-items: center;
103
+ margin: var(--sui-focus-ring-width);
104
+ min-width: var(--sui-textbox-singleline-min-width);
105
+
106
+ &.flex:not([hidden]) {
107
+ display: inline-flex; // Avoid Tailwind .flex class collisions
108
+ width: -moz-available;
109
+ width: -webkit-fill-available;
110
+ width: stretch;
111
+ min-width: 0;
112
+ }
113
+
114
+ &.show {
115
+ :global {
116
+ input {
117
+ -webkit-text-security: none;
118
+ }
119
+ }
120
+ }
121
+
122
+ :global {
123
+ .text-input {
124
+ flex: auto;
125
+ margin: 0 !important;
126
+ width: 0; // = auto
127
+ min-width: 0 !important;
128
+ }
129
+
130
+ input {
131
+ border-start-end-radius: 0;
132
+ border-end-end-radius: 0;
133
+ -webkit-text-security: disc;
134
+ }
135
+
136
+ button {
137
+ flex: none;
138
+ margin-block: 0;
139
+ margin-inline-start: -1px;
140
+ margin-inline-end: 0;
141
+ border-width: 1px;
142
+ border-color: var(--sui-textbox-border-color);
143
+ width: var(--sui-textbox-height);
144
+ aspect-ratio: 1 / 1;
145
+
146
+ &:last-child {
147
+ border-start-start-radius: 0;
148
+ border-start-end-radius: 4px;
149
+ border-end-end-radius: 4px;
150
+ border-end-start-radius: 0;
151
+ }
152
+
153
+ .icon {
154
+ font-size: var(--sui-font-size-xx-large);
155
+ }
156
+ }
157
+ }
158
+ }
159
+ </style>
@@ -80,75 +80,87 @@
80
80
  {/if}
81
81
  </div>
82
82
 
83
- <style>.text-area {
84
- display: inline-grid;
85
- margin: var(--sui-focus-ring-width);
86
- min-width: var(--sui-textbox-multiline-min-width);
87
- }
88
- .text-area[hidden] {
89
- display: none;
90
- }
91
- .text-area.flex:not([hidden]) {
92
- display: inline-grid;
93
- width: -moz-available;
94
- width: -webkit-fill-available;
95
- width: stretch;
96
- min-width: 0;
97
- }
83
+ <style lang="scss">
84
+ .text-area {
85
+ display: inline-grid;
86
+ margin: var(--sui-focus-ring-width);
87
+ min-width: var(--sui-textbox-multiline-min-width);
98
88
 
99
- :is(textarea, .clone) {
100
- grid-area: 1/1/2/2;
101
- display: block;
102
- margin: 0;
103
- border-width: var(--sui-textbox-border-width, 1px);
104
- border-color: var(--sui-textbox-border-color);
105
- border-radius: var(--sui-textbox-border-radius);
106
- padding: var(--sui-textbox-multiline-padding);
107
- width: 100%;
108
- min-height: 8em;
109
- color: var(--sui-textbox-foreground-color);
110
- background-color: var(--sui-textbox-background-color);
111
- font-family: var(--sui-textbox-font-family);
112
- font-size: var(--sui-textbox-font-size);
113
- line-height: var(--sui-textbox-multiline-line-height);
114
- font-weight: var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));
115
- text-align: var(--sui-textbox-text-align, start);
116
- text-indent: var(--sui-textbox-text-indent, 0);
117
- text-transform: var(--sui-textbox-text-transform, none);
118
- letter-spacing: var(--sui-textbox-letter-spacing, normal);
119
- word-spacing: var(--sui-word-spacing-normal, normal);
120
- transition: all 200ms;
121
- }
122
- :is(textarea, .clone).resizing {
123
- transition-duration: 0ms;
124
- }
125
- :is(textarea, .clone):focus {
126
- border-color: var(--sui-textbox-border-color-focus, var(--sui-primary-accent-color));
127
- color: var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));
128
- background-color: var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));
129
- }
130
- :is(textarea, .clone):is(:disabled, :read-only) {
131
- background-color: var(--sui-disabled-background-color);
132
- }
89
+ &[hidden] {
90
+ display: none;
91
+ }
133
92
 
134
- textarea {
135
- resize: vertical;
136
- }
137
- textarea.auto-resize {
138
- overflow: hidden;
139
- resize: none;
140
- }
141
- textarea[aria-invalid=true] {
142
- border-color: var(--sui-error-border-color);
143
- }
93
+ &.flex:not([hidden]) {
94
+ display: inline-grid; // Avoid Tailwind .flex class collisions
95
+ width: -moz-available;
96
+ width: -webkit-fill-available;
97
+ width: stretch;
98
+ min-width: 0;
99
+ }
100
+ }
144
101
 
145
- .clone {
146
- overflow: hidden;
147
- visibility: hidden;
148
- }
102
+ :is(textarea, .clone) {
103
+ grid-area: 1 / 1 / 2 / 2;
104
+ display: block;
105
+ margin: 0;
106
+ border-width: var(--sui-textbox-border-width, 1px);
107
+ border-color: var(--sui-textbox-border-color);
108
+ border-radius: var(--sui-textbox-border-radius);
109
+ padding: var(--sui-textbox-multiline-padding);
110
+ width: 100%;
111
+ min-height: 8em;
112
+ color: var(--sui-textbox-foreground-color);
113
+ background-color: var(--sui-textbox-background-color);
114
+ font-family: var(--sui-textbox-font-family);
115
+ font-size: var(--sui-textbox-font-size);
116
+ line-height: var(--sui-textbox-multiline-line-height);
117
+ font-weight: var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));
118
+ text-align: var(--sui-textbox-text-align, start);
119
+ text-indent: var(--sui-textbox-text-indent, 0);
120
+ text-transform: var(--sui-textbox-text-transform, none);
121
+ letter-spacing: var(--sui-textbox-letter-spacing, normal);
122
+ word-spacing: var(--sui-word-spacing-normal, normal);
123
+ transition: all 200ms;
149
124
 
150
- textarea,
151
- .clone {
152
- white-space: pre-wrap;
153
- word-break: break-all;
154
- }</style>
125
+ &.resizing {
126
+ transition-duration: 0ms;
127
+ }
128
+
129
+ &:focus {
130
+ border-color: var(--sui-textbox-border-color-focus, var(--sui-primary-accent-color));
131
+ color: var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));
132
+ background-color: var(
133
+ --sui-textbox-background-color-focus,
134
+ var(--sui-textbox-background-color)
135
+ );
136
+ }
137
+
138
+ &:is(:disabled, :read-only) {
139
+ background-color: var(--sui-disabled-background-color);
140
+ }
141
+ }
142
+
143
+ textarea {
144
+ resize: vertical;
145
+
146
+ &.auto-resize {
147
+ overflow: hidden;
148
+ resize: none;
149
+ }
150
+
151
+ &[aria-invalid='true'] {
152
+ border-color: var(--sui-error-border-color);
153
+ }
154
+ }
155
+
156
+ .clone {
157
+ overflow: hidden;
158
+ visibility: hidden;
159
+ }
160
+
161
+ textarea,
162
+ .clone {
163
+ white-space: pre-wrap;
164
+ word-break: break-all;
165
+ }
166
+ </style>