@sveltia/ui 0.42.0 → 0.42.1

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 (72) hide show
  1. package/dist/components/alert/alert.svelte +30 -36
  2. package/dist/components/alert/infobar.svelte +45 -55
  3. package/dist/components/bottom-navigation/bottom-navigation.svelte +15 -21
  4. package/dist/components/button/button-group.svelte +5 -7
  5. package/dist/components/button/button.svelte +175 -274
  6. package/dist/components/button/floating-action-button-wrapper.svelte +18 -23
  7. package/dist/components/button/select-button-group.svelte +41 -57
  8. package/dist/components/button/split-button.svelte +18 -25
  9. package/dist/components/calendar/calendar.svelte +80 -103
  10. package/dist/components/checkbox/checkbox-group.svelte +19 -22
  11. package/dist/components/checkbox/checkbox.svelte +63 -91
  12. package/dist/components/dialog/dialog.svelte +87 -105
  13. package/dist/components/dialog/prompt-dialog.svelte +3 -5
  14. package/dist/components/disclosure/disclosure.svelte +21 -34
  15. package/dist/components/divider/divider.svelte +14 -18
  16. package/dist/components/divider/spacer.svelte +8 -13
  17. package/dist/components/drawer/drawer.svelte +190 -343
  18. package/dist/components/grid/grid-body.svelte +14 -16
  19. package/dist/components/grid/grid-cell.svelte +3 -5
  20. package/dist/components/grid/grid-col-header.svelte +3 -5
  21. package/dist/components/grid/grid-foot.svelte +3 -5
  22. package/dist/components/grid/grid-head.svelte +3 -5
  23. package/dist/components/grid/grid-row-header.svelte +4 -6
  24. package/dist/components/grid/grid-row.svelte +4 -6
  25. package/dist/components/grid/grid.svelte +12 -18
  26. package/dist/components/icon/icon.svelte +5 -7
  27. package/dist/components/listbox/listbox.svelte +61 -78
  28. package/dist/components/listbox/option-group.svelte +11 -15
  29. package/dist/components/listbox/option.svelte +39 -54
  30. package/dist/components/menu/menu-item-group.svelte +3 -5
  31. package/dist/components/menu/menu-item.svelte +51 -67
  32. package/dist/components/menu/menu.svelte +17 -21
  33. package/dist/components/progressbar/progressbar.svelte +15 -24
  34. package/dist/components/radio/radio-group.svelte +31 -40
  35. package/dist/components/radio/radio.svelte +63 -81
  36. package/dist/components/resizable-pane/resizable-handle.svelte +48 -60
  37. package/dist/components/resizable-pane/resizable-pane-group.svelte +14 -18
  38. package/dist/components/select/combobox.svelte +112 -135
  39. package/dist/components/select/select-tags.svelte +57 -73
  40. package/dist/components/slider/slider.svelte +74 -94
  41. package/dist/components/switch/switch.svelte +81 -115
  42. package/dist/components/table/table-body.svelte +14 -16
  43. package/dist/components/table/table-cell.svelte +3 -5
  44. package/dist/components/table/table-col-header.svelte +3 -5
  45. package/dist/components/table/table-foot.svelte +3 -5
  46. package/dist/components/table/table-head.svelte +3 -5
  47. package/dist/components/table/table-row-header.svelte +4 -6
  48. package/dist/components/table/table-row.svelte +4 -6
  49. package/dist/components/table/table.svelte +12 -18
  50. package/dist/components/tabs/tab-box.svelte +6 -9
  51. package/dist/components/tabs/tab-list.svelte +73 -91
  52. package/dist/components/tabs/tab-panel.svelte +7 -11
  53. package/dist/components/tabs/tab-panels.svelte +14 -19
  54. package/dist/components/text-editor/code-editor.svelte +7 -10
  55. package/dist/components/text-editor/lexical-root.svelte +160 -221
  56. package/dist/components/text-editor/text-editor.svelte +18 -25
  57. package/dist/components/text-editor/toolbar/toolbar-wrapper.svelte +37 -44
  58. package/dist/components/text-field/number-input.svelte +68 -87
  59. package/dist/components/text-field/password-input.svelte +42 -52
  60. package/dist/components/text-field/search-bar.svelte +53 -64
  61. package/dist/components/text-field/secret-input.svelte +46 -61
  62. package/dist/components/text-field/text-area.svelte +68 -80
  63. package/dist/components/text-field/text-input.svelte +106 -138
  64. package/dist/components/toast/toast.svelte +89 -104
  65. package/dist/components/toolbar/toolbar.svelte +54 -70
  66. package/dist/components/typography/truncated-text.svelte +7 -9
  67. package/dist/components/util/app-shell.svelte +493 -35
  68. package/dist/components/util/empty-state.svelte +11 -13
  69. package/dist/components/util/group.svelte +3 -5
  70. package/dist/components/util/modal.svelte +48 -59
  71. package/dist/components/util/popup.svelte +67 -87
  72. package/package.json +1 -1
@@ -131,28 +131,21 @@
131
131
  </Toast>
132
132
  {/if}
133
133
 
134
- <style lang="scss">
135
- .text-editor {
136
- margin: var(--sui-focus-ring-width);
137
- width: calc(100% - var(--sui-focus-ring-width) * 2);
138
-
139
- &.flex:not([hidden]) {
140
- display: block; // Avoid Tailwind .flex class collisions
141
- }
142
-
143
- :global {
144
- .sui.text-area {
145
- margin: 0 !important;
146
- width: 100% !important;
147
- min-width: auto;
148
-
149
- textarea {
150
- border-start-start-radius: 0 !important;
151
- border-start-end-radius: 0 !important;
152
- border-end-start-radius: var(--sui-textbox-border-radius) !important;
153
- border-end-end-radius: var(--sui-textbox-border-radius) !important;
154
- }
155
- }
156
- }
157
- }
158
- </style>
134
+ <style>.text-editor {
135
+ margin: var(--sui-focus-ring-width);
136
+ width: calc(100% - var(--sui-focus-ring-width) * 2);
137
+ }
138
+ .text-editor.flex:not([hidden]) {
139
+ display: block;
140
+ }
141
+ .text-editor :global(.sui.text-area) {
142
+ margin: 0 !important;
143
+ width: 100% !important;
144
+ min-width: auto;
145
+ }
146
+ .text-editor :global(.sui.text-area) :global(textarea) {
147
+ border-start-start-radius: 0 !important;
148
+ border-start-end-radius: 0 !important;
149
+ border-end-start-radius: var(--sui-textbox-border-radius) !important;
150
+ border-end-end-radius: var(--sui-textbox-border-radius) !important;
151
+ }</style>
@@ -34,48 +34,41 @@
34
34
  </Toolbar>
35
35
  </div>
36
36
 
37
- <style lang="scss">
38
- .wrapper {
39
- display: contents;
40
-
41
- :global {
42
- [role='toolbar'] {
43
- position: sticky;
44
- top: 0;
45
- z-index: 100;
46
- display: flex;
47
- flex-wrap: wrap;
48
- gap: 4px;
49
- border-width: 1px 1px 0;
50
- border-style: solid;
51
- border-color: var(--sui-textbox-border-color);
52
- border-start-start-radius: var(--sui-textbox-border-radius);
53
- border-start-end-radius: var(--sui-textbox-border-radius);
54
- border-end-start-radius: 0;
55
- border-end-end-radius: 0;
56
- padding: 0 4px;
57
- height: auto;
58
- min-height: 40px;
59
- background-color: var(--sui-tertiary-background-color);
60
-
61
- @media (width < 768px) {
62
- flex-wrap: wrap;
63
- height: auto;
64
- }
65
- }
66
-
67
- .sui.menu-button {
68
- padding: 0 4px;
69
- }
70
-
71
- .sui.button {
72
- flex: none;
73
- margin: 0 !important;
74
- }
75
-
76
- .sui.button-group {
77
- gap: 4px;
78
- }
79
- }
37
+ <style>.wrapper {
38
+ display: contents;
39
+ }
40
+ .wrapper :global([role=toolbar]) {
41
+ position: sticky;
42
+ top: 0;
43
+ z-index: 100;
44
+ display: flex;
45
+ flex-wrap: wrap;
46
+ gap: 4px;
47
+ border-width: 1px 1px 0;
48
+ border-style: solid;
49
+ border-color: var(--sui-textbox-border-color);
50
+ border-start-start-radius: var(--sui-textbox-border-radius);
51
+ border-start-end-radius: var(--sui-textbox-border-radius);
52
+ border-end-start-radius: 0;
53
+ border-end-end-radius: 0;
54
+ padding: 0 4px;
55
+ height: auto;
56
+ min-height: 40px;
57
+ background-color: var(--sui-tertiary-background-color);
58
+ }
59
+ @media (width < 768px) {
60
+ .wrapper :global([role=toolbar]) {
61
+ flex-wrap: wrap;
62
+ height: auto;
80
63
  }
81
- </style>
64
+ }
65
+ .wrapper :global(.sui.menu-button) {
66
+ padding: 0 4px;
67
+ }
68
+ .wrapper :global(.sui.button) {
69
+ flex: none;
70
+ margin: 0 !important;
71
+ }
72
+ .wrapper :global(.sui.button-group) {
73
+ gap: 4px;
74
+ }</style>
@@ -199,91 +199,72 @@
199
199
  />
200
200
  </div>
201
201
 
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);
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
+ }
208
235
 
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>
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>
@@ -102,55 +102,45 @@
102
102
  </Button>
103
103
  </div>
104
104
 
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>
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>
@@ -115,67 +115,56 @@
115
115
  {/if}
116
116
  </div>
117
117
 
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>
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>
@@ -96,64 +96,49 @@
96
96
  </Button>
97
97
  </div>
98
98
 
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>
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>