@threadlabs/looma 0.13.5 → 0.14.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 (65) hide show
  1. package/components/ui-button/ui-button.html +2 -1
  2. package/components/ui-checkbox/ui-checkbox.html +35 -0
  3. package/components/ui-combobox/ui-combobox.html +38 -3
  4. package/components/ui-icon/ui-icon.html +67 -7
  5. package/components/ui-input/ui-input.html +27 -0
  6. package/components/ui-input-group/ui-input-group.html +15 -0
  7. package/components/ui-radio/ui-radio.html +35 -0
  8. package/components/ui-select/ui-select.html +29 -3
  9. package/components/ui-switch/ui-switch.html +36 -0
  10. package/components/ui-textarea/ui-textarea.html +20 -0
  11. package/dist/index.js +17 -18
  12. package/package.json +1 -1
  13. package/styles/ui-button.css +3 -1
  14. package/styles/ui-checkbox.css +38 -0
  15. package/styles/ui-combobox.css +38 -1
  16. package/styles/ui-input-group.css +20 -0
  17. package/styles/ui-input.css +29 -0
  18. package/styles/ui-radio.css +38 -0
  19. package/styles/ui-select.css +29 -3
  20. package/styles/ui-switch.css +41 -0
  21. package/styles/ui-textarea.css +21 -0
  22. package/vanilla/UiCheckbox.d.ts +1 -0
  23. package/vanilla/UiCheckbox.js +1 -1
  24. package/vanilla/UiCombobox.d.ts +1 -1
  25. package/vanilla/UiCombobox.js +1 -1
  26. package/vanilla/UiIcon.js +1 -3
  27. package/vanilla/UiInput.d.ts +1 -0
  28. package/vanilla/UiInput.js +1 -1
  29. package/vanilla/UiRadio.d.ts +1 -0
  30. package/vanilla/UiRadio.js +1 -1
  31. package/vanilla/UiSelect.d.ts +1 -0
  32. package/vanilla/UiSelect.js +1 -1
  33. package/vanilla/UiSwitch.d.ts +1 -0
  34. package/vanilla/UiSwitch.js +1 -1
  35. package/vanilla/UiTextarea.d.ts +1 -0
  36. package/vanilla/UiTextarea.js +1 -1
  37. package/vue/UiButton.vue +2 -1
  38. package/vue/UiCheckbox.d.ts +2 -0
  39. package/vue/UiCheckbox.vue +34 -0
  40. package/vue/UiCombobox.d.ts +2 -2
  41. package/vue/UiCombobox.vue +39 -2
  42. package/vue/UiIcon.vue +337 -42
  43. package/vue/UiInput.d.ts +2 -0
  44. package/vue/UiInput.vue +41 -0
  45. package/vue/UiInputGroup.vue +15 -0
  46. package/vue/UiRadio.d.ts +2 -0
  47. package/vue/UiRadio.vue +34 -0
  48. package/vue/UiSelect.d.ts +2 -0
  49. package/vue/UiSelect.vue +34 -3
  50. package/vue/UiSwitch.d.ts +2 -0
  51. package/vue/UiSwitch.vue +35 -0
  52. package/vue/UiTextarea.d.ts +2 -0
  53. package/vue/UiTextarea.vue +27 -0
  54. package/vue/chunks/UiButton.js +1 -1
  55. package/vue/chunks/UiCheckbox.js +3 -2
  56. package/vue/chunks/UiCombobox.js +1 -1
  57. package/vue/chunks/UiIcon.js +950 -32
  58. package/vue/chunks/UiInput.js +7 -2
  59. package/vue/chunks/UiInputGroup.js +1 -1
  60. package/vue/chunks/UiRadio.js +3 -2
  61. package/vue/chunks/UiSelect.js +7 -2
  62. package/vue/chunks/UiSwitch.js +3 -2
  63. package/vue/chunks/UiTextarea.js +7 -2
  64. package/vue/components.css +368 -168
  65. package/components/ui-icon/ui-icon.js +0 -8
package/vue/UiIcon.vue CHANGED
@@ -1,8 +1,6 @@
1
1
  <!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
2
2
  <script setup lang="ts">
3
- import { ref } from 'vue'
4
- import * as controllerModule from '../components/ui-icon/ui-icon.js'
5
- import { createDispatch, useComponentHost } from './host'
3
+ import { computed } from 'vue'
6
4
 
7
5
  defineOptions({ inheritAttrs: false })
8
6
 
@@ -15,38 +13,328 @@ const props = withDefaults(
15
13
  },
16
14
  )
17
15
 
18
- const root = ref<HTMLElement | null>(null)
19
- const shapes = ref<
20
- {
21
- tag: 'path' | 'circle' | 'rect' | 'line'
22
- d?: string
23
- cx?: string
24
- cy?: string
25
- r?: string
26
- x?: string
27
- y?: string
28
- width?: string
29
- height?: string
30
- rx?: string
31
- x1?: string
32
- x2?: string
33
- y1?: string
34
- y2?: string
35
- }[]
36
- >([])
16
+ const shapes = computed(() =>
17
+ ({
18
+ 'align-center': [{ tag: 'path', d: 'M21 5H3' }, { tag: 'path', d: 'M17 12H7' }, {
19
+ tag: 'path',
20
+ d: 'M19 19H5',
21
+ }],
22
+ 'align-left': [{ tag: 'path', d: 'M21 5H3' }, { tag: 'path', d: 'M15 12H3' }, {
23
+ tag: 'path',
24
+ d: 'M17 19H3',
25
+ }],
26
+ 'align-right': [{ tag: 'path', d: 'M21 5H3' }, { tag: 'path', d: 'M21 12H9' }, {
27
+ tag: 'path',
28
+ d: 'M21 19H7',
29
+ }],
30
+ 'arrow-left': [{ tag: 'path', d: 'm12 19-7-7 7-7' }, { tag: 'path', d: 'M19 12H5' }],
31
+ bold: [{
32
+ tag: 'path',
33
+ d: 'M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8',
34
+ }],
35
+ 'book-user': [{ tag: 'path', d: 'M15 13a3 3 0 1 0-6 0' }, {
36
+ tag: 'path',
37
+ d: 'M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20',
38
+ }, { tag: 'circle', cx: '12', cy: '8', r: '2' }],
39
+ braces: [{
40
+ tag: 'path',
41
+ d: 'M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1',
42
+ }, {
43
+ tag: 'path',
44
+ d: 'M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1',
45
+ }],
46
+ calculator: [
47
+ { tag: 'rect', width: '16', height: '20', x: '4', y: '2', rx: '2' },
48
+ { tag: 'line', x1: '8', x2: '16', y1: '6', y2: '6' },
49
+ { tag: 'line', x1: '16', x2: '16', y1: '14', y2: '18' },
50
+ { tag: 'path', d: 'M16 10h.01' },
51
+ { tag: 'path', d: 'M12 10h.01' },
52
+ { tag: 'path', d: 'M8 10h.01' },
53
+ { tag: 'path', d: 'M12 14h.01' },
54
+ { tag: 'path', d: 'M8 14h.01' },
55
+ { tag: 'path', d: 'M12 18h.01' },
56
+ { tag: 'path', d: 'M8 18h.01' },
57
+ ],
58
+ 'chevron-down': [{ tag: 'path', d: 'm6 9 6 6 6-6' }],
59
+ 'chevron-left': [{ tag: 'path', d: 'm15 18-6-6 6-6' }],
60
+ 'chevron-right': [{ tag: 'path', d: 'm9 18 6-6-6-6' }],
61
+ 'circle-check': [{ tag: 'circle', cx: '12', cy: '12', r: '10' }, {
62
+ tag: 'path',
63
+ d: 'm9 12 2 2 4-4',
64
+ }],
65
+ 'circle-x': [{ tag: 'circle', cx: '12', cy: '12', r: '10' }, { tag: 'path', d: 'm15 9-6 6' }, {
66
+ tag: 'path',
67
+ d: 'm9 9 6 6',
68
+ }],
69
+ 'code-xml': [{ tag: 'path', d: 'm18 16 4-4-4-4' }, { tag: 'path', d: 'm6 8-4 4 4 4' }, {
70
+ tag: 'path',
71
+ d: 'm14.5 4-5 16',
72
+ }],
73
+ columns: [{ tag: 'rect', width: '18', height: '18', x: '3', y: '3', rx: '2' }, {
74
+ tag: 'path',
75
+ d: 'M9 3v18',
76
+ }, { tag: 'path', d: 'M15 3v18' }],
77
+ 'credit-card': [{ tag: 'rect', width: '20', height: '14', x: '2', y: '5', rx: '2' }, {
78
+ tag: 'line',
79
+ x1: '2',
80
+ x2: '22',
81
+ y1: '10',
82
+ y2: '10',
83
+ }],
84
+ ellipsis: [{ tag: 'circle', cx: '12', cy: '12', r: '1' }, {
85
+ tag: 'circle',
86
+ cx: '19',
87
+ cy: '12',
88
+ r: '1',
89
+ }, { tag: 'circle', cx: '5', cy: '12', r: '1' }],
90
+ eraser: [{
91
+ tag: 'path',
92
+ d: 'M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21',
93
+ }, { tag: 'path', d: 'm5.082 11.09 8.828 8.828' }],
94
+ 'file-text': [
95
+ {
96
+ tag: 'path',
97
+ d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',
98
+ },
99
+ { tag: 'path', d: 'M14 2v5a1 1 0 0 0 1 1h5' },
100
+ { tag: 'path', d: 'M10 9H8' },
101
+ { tag: 'path', d: 'M16 13H8' },
102
+ { tag: 'path', d: 'M16 17H8' },
103
+ ],
104
+ folder: [{
105
+ tag: 'path',
106
+ d: 'M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z',
107
+ }],
108
+ 'grip-horizontal': [
109
+ { tag: 'circle', cx: '12', cy: '9', r: '1' },
110
+ { tag: 'circle', cx: '19', cy: '9', r: '1' },
111
+ { tag: 'circle', cx: '5', cy: '9', r: '1' },
112
+ { tag: 'circle', cx: '12', cy: '15', r: '1' },
113
+ { tag: 'circle', cx: '19', cy: '15', r: '1' },
114
+ { tag: 'circle', cx: '5', cy: '15', r: '1' },
115
+ ],
116
+ 'grip-vertical': [
117
+ { tag: 'circle', cx: '9', cy: '12', r: '1' },
118
+ { tag: 'circle', cx: '9', cy: '5', r: '1' },
119
+ { tag: 'circle', cx: '9', cy: '19', r: '1' },
120
+ { tag: 'circle', cx: '15', cy: '12', r: '1' },
121
+ { tag: 'circle', cx: '15', cy: '5', r: '1' },
122
+ { tag: 'circle', cx: '15', cy: '19', r: '1' },
123
+ ],
124
+ 'heading-1': [{ tag: 'path', d: 'M4 12h8' }, { tag: 'path', d: 'M4 18V6' }, {
125
+ tag: 'path',
126
+ d: 'M12 18V6',
127
+ }, { tag: 'path', d: 'm17 12 3-2v8' }],
128
+ 'heading-2': [{ tag: 'path', d: 'M4 12h8' }, { tag: 'path', d: 'M4 18V6' }, {
129
+ tag: 'path',
130
+ d: 'M12 18V6',
131
+ }, { tag: 'path', d: 'M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1' }],
132
+ 'heading-3': [
133
+ { tag: 'path', d: 'M4 12h8' },
134
+ { tag: 'path', d: 'M4 18V6' },
135
+ { tag: 'path', d: 'M12 18V6' },
136
+ { tag: 'path', d: 'M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2' },
137
+ { tag: 'path', d: 'M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2' },
138
+ ],
139
+ help: [{ tag: 'circle', cx: '12', cy: '12', r: '10' }, {
140
+ tag: 'path',
141
+ d: 'M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3',
142
+ }, { tag: 'path', d: 'M12 17h.01' }],
143
+ highlighter: [{ tag: 'path', d: 'm9 11-6 6v3h9l3-3' }, {
144
+ tag: 'path',
145
+ d: 'm22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4',
146
+ }],
147
+ image: [{ tag: 'rect', width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2' }, {
148
+ tag: 'circle',
149
+ cx: '9',
150
+ cy: '9',
151
+ r: '2',
152
+ }, { tag: 'path', d: 'm21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21' }],
153
+ info: [{ tag: 'circle', cx: '12', cy: '12', r: '10' }, { tag: 'path', d: 'M12 16v-4' }, {
154
+ tag: 'path',
155
+ d: 'M12 8h.01',
156
+ }],
157
+ italic: [{ tag: 'line', x1: '19', x2: '10', y1: '4', y2: '4' }, {
158
+ tag: 'line',
159
+ x1: '14',
160
+ x2: '5',
161
+ y1: '20',
162
+ y2: '20',
163
+ }, { tag: 'line', x1: '15', x2: '9', y1: '4', y2: '20' }],
164
+ 'layout-dashboard': [
165
+ { tag: 'rect', width: '7', height: '9', x: '3', y: '3', rx: '1' },
166
+ { tag: 'rect', width: '7', height: '5', x: '14', y: '3', rx: '1' },
167
+ { tag: 'rect', width: '7', height: '9', x: '14', y: '12', rx: '1' },
168
+ { tag: 'rect', width: '7', height: '5', x: '3', y: '16', rx: '1' },
169
+ ],
170
+ list: [
171
+ { tag: 'path', d: 'M3 5h.01' },
172
+ { tag: 'path', d: 'M3 12h.01' },
173
+ { tag: 'path', d: 'M3 19h.01' },
174
+ { tag: 'path', d: 'M8 5h13' },
175
+ { tag: 'path', d: 'M8 12h13' },
176
+ { tag: 'path', d: 'M8 19h13' },
177
+ ],
178
+ 'list-ordered': [
179
+ { tag: 'path', d: 'M11 5h10' },
180
+ { tag: 'path', d: 'M11 12h10' },
181
+ { tag: 'path', d: 'M11 19h10' },
182
+ { tag: 'path', d: 'M4 4h1v5' },
183
+ { tag: 'path', d: 'M4 9h2' },
184
+ { tag: 'path', d: 'M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02' },
185
+ ],
186
+ 'list-todo': [
187
+ { tag: 'path', d: 'M13 5h8' },
188
+ { tag: 'path', d: 'M13 12h8' },
189
+ { tag: 'path', d: 'M13 19h8' },
190
+ { tag: 'path', d: 'm3 17 2 2 4-4' },
191
+ { tag: 'rect', x: '3', y: '4', width: '6', height: '6', rx: '1' },
192
+ ],
193
+ loader: [{ tag: 'path', d: 'M21 12a9 9 0 1 1-6.219-8.56' }],
194
+ merge: [{ tag: 'path', d: 'm8 6 4-4 4 4' }, {
195
+ tag: 'path',
196
+ d: 'M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22',
197
+ }, { tag: 'path', d: 'm20 22-5-5' }],
198
+ minus: [{ tag: 'path', d: 'M5 12h14' }],
199
+ 'notebook-pen': [
200
+ { tag: 'path', d: 'M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4' },
201
+ { tag: 'path', d: 'M2 6h4' },
202
+ { tag: 'path', d: 'M2 10h4' },
203
+ { tag: 'path', d: 'M2 14h4' },
204
+ { tag: 'path', d: 'M2 18h4' },
205
+ {
206
+ tag: 'path',
207
+ d: 'M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z',
208
+ },
209
+ ],
210
+ 'paint-bucket': [
211
+ { tag: 'path', d: 'm19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z' },
212
+ { tag: 'path', d: 'm5 2 5 5' },
213
+ { tag: 'path', d: 'M2 13h15' },
214
+ { tag: 'path', d: 'M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z' },
215
+ ],
216
+ 'panel-bottom': [{ tag: 'rect', width: '18', height: '18', x: '3', y: '3', rx: '2' }, {
217
+ tag: 'path',
218
+ d: 'M3 15h18',
219
+ }],
220
+ 'panel-left': [{ tag: 'rect', width: '18', height: '18', x: '3', y: '3', rx: '2' }, {
221
+ tag: 'path',
222
+ d: 'M9 3v18',
223
+ }],
224
+ 'panel-right': [{ tag: 'rect', width: '18', height: '18', x: '3', y: '3', rx: '2' }, {
225
+ tag: 'path',
226
+ d: 'M15 3v18',
227
+ }],
228
+ 'panel-top': [{ tag: 'rect', width: '18', height: '18', x: '3', y: '3', rx: '2' }, {
229
+ tag: 'path',
230
+ d: 'M3 9h18',
231
+ }],
232
+ pilcrow: [{ tag: 'path', d: 'M13 4v16' }, { tag: 'path', d: 'M17 4v16' }, {
233
+ tag: 'path',
234
+ d: 'M19 4H9.5a4.5 4.5 0 0 0 0 9H13',
235
+ }],
236
+ plus: [{ tag: 'path', d: 'M5 12h14' }, { tag: 'path', d: 'M12 5v14' }],
237
+ quote: [{
238
+ tag: 'path',
239
+ d: 'M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z',
240
+ }, {
241
+ tag: 'path',
242
+ d: 'M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z',
243
+ }],
244
+ receipt: [
245
+ { tag: 'path', d: 'M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z' },
246
+ { tag: 'path', d: 'M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8' },
247
+ { tag: 'path', d: 'M12 17.5v-11' },
248
+ ],
249
+ redo: [{ tag: 'path', d: 'm15 14 5-5-5-5' }, {
250
+ tag: 'path',
251
+ d: 'M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13',
252
+ }],
253
+ rows: [{ tag: 'rect', width: '18', height: '18', x: '3', y: '3', rx: '2' }, {
254
+ tag: 'path',
255
+ d: 'M21 9H3',
256
+ }, { tag: 'path', d: 'M21 15H3' }],
257
+ settings: [{
258
+ tag: 'path',
259
+ d: 'M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915',
260
+ }, { tag: 'circle', cx: '12', cy: '12', r: '3' }],
261
+ split: [{ tag: 'path', d: 'M16 3h5v5' }, { tag: 'path', d: 'M8 3H3v5' }, {
262
+ tag: 'path',
263
+ d: 'M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3',
264
+ }, { tag: 'path', d: 'm15 9 6-6' }],
265
+ strikethrough: [{ tag: 'path', d: 'M16 4H9a3 3 0 0 0-2.83 4' }, {
266
+ tag: 'path',
267
+ d: 'M14 12a4 4 0 0 1 0 8H6',
268
+ }, { tag: 'line', x1: '4', x2: '20', y1: '12', y2: '12' }],
269
+ table: [{
270
+ tag: 'path',
271
+ d: 'M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18',
272
+ }],
273
+ trash: [
274
+ { tag: 'path', d: 'M10 11v6' },
275
+ { tag: 'path', d: 'M14 11v6' },
276
+ { tag: 'path', d: 'M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6' },
277
+ { tag: 'path', d: 'M3 6h18' },
278
+ { tag: 'path', d: 'M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2' },
279
+ ],
280
+ 'triangle-alert': [
281
+ {
282
+ tag: 'path',
283
+ d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3',
284
+ },
285
+ { tag: 'path', d: 'M12 9v4' },
286
+ { tag: 'path', d: 'M12 17h.01' },
287
+ ],
288
+ truck: [
289
+ { tag: 'path', d: 'M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2' },
290
+ { tag: 'path', d: 'M15 18H9' },
291
+ {
292
+ tag: 'path',
293
+ d: 'M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14',
294
+ },
295
+ { tag: 'circle', cx: '17', cy: '18', r: '2' },
296
+ { tag: 'circle', cx: '7', cy: '18', r: '2' },
297
+ ],
298
+ underline: [{ tag: 'path', d: 'M6 4v6a6 6 0 0 0 12 0V4' }, {
299
+ tag: 'line',
300
+ x1: '4',
301
+ x2: '20',
302
+ y1: '20',
303
+ y2: '20',
304
+ }],
305
+ undo: [{ tag: 'path', d: 'M9 14 4 9l5-5' }, {
306
+ tag: 'path',
307
+ d: 'M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11',
308
+ }],
309
+ users: [
310
+ { tag: 'path', d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2' },
311
+ { tag: 'path', d: 'M16 3.128a4 4 0 0 1 0 7.744' },
312
+ { tag: 'path', d: 'M22 21v-2a4 4 0 0 0-3-3.87' },
313
+ { tag: 'circle', cx: '9', cy: '7', r: '4' },
314
+ ],
315
+ })[props.name]
316
+ )
37
317
 
38
- const dispatch = createDispatch(root)
318
+ function text(value: unknown): string {
319
+ if (Array.isArray(value)) return value.map(text).join(' ')
320
+ return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
321
+ }
39
322
 
40
- useComponentHost(controllerModule.default, {
41
- root,
42
- dispatch,
43
- props,
44
- state: { shapes },
45
- })
323
+ function attribute(value: unknown): any {
324
+ if (
325
+ value === null || value === undefined || value === false
326
+ || (typeof value === 'object' && !Array.isArray(value))
327
+ ) return undefined
328
+ return value === true ? '' : text(value)
329
+ }
330
+
331
+ function list(value: unknown): any[] {
332
+ return Array.isArray(value) ? value : []
333
+ }
46
334
  </script>
47
335
 
48
336
  <template>
49
- <span data-component="ui-icon" aria-hidden="true" v-bind="$attrs" ref="root"><svg
337
+ <span data-component="ui-icon" aria-hidden="true" v-bind="$attrs"><svg
50
338
  viewBox="0 0 24 24"
51
339
  fill="none"
52
340
  stroke="currentColor"
@@ -55,24 +343,31 @@ useComponentHost(controllerModule.default, {
55
343
  stroke-linejoin="round"
56
344
  focusable="false"
57
345
  >
58
- <g v-for="(shape, index) in shapes" :key="index">
59
- <path v-if="shape.tag === 'path'" :d="shape.d"></path>
60
- <circle v-if="shape.tag === 'circle'" :cx="shape.cx" :cy="shape.cy" :r="shape.r"></circle>
346
+ <g v-for="(shape, index) in list(shapes)" :key="index">
347
+ <path v-if="shape.tag === 'path'" :d="attribute(shape.d)"></path>
348
+ <circle
349
+ v-if="shape.tag === 'circle'"
350
+ :cx="attribute(shape.cx)"
351
+ :cy="attribute(shape.cy)"
352
+ :r="attribute(shape.r)"
353
+ >
354
+ </circle>
61
355
  <rect
62
356
  v-if="shape.tag === 'rect'"
63
- :x="shape.x"
64
- :y="shape.y"
65
- :width="shape.width"
66
- :height="shape.height"
67
- :rx="shape.rx"
357
+ :x="attribute(shape.x)"
358
+ :y="attribute(shape.y)"
359
+ :width="attribute(shape.width)"
360
+ :height="attribute(shape.height)"
361
+ :rx="attribute(shape.rx)"
362
+ :ry="attribute(shape.ry)"
68
363
  >
69
364
  </rect>
70
365
  <line
71
366
  v-if="shape.tag === 'line'"
72
- :x1="shape.x1"
73
- :x2="shape.x2"
74
- :y1="shape.y1"
75
- :y2="shape.y2"
367
+ :x1="attribute(shape.x1)"
368
+ :y1="attribute(shape.y1)"
369
+ :x2="attribute(shape.x2)"
370
+ :y2="attribute(shape.y2)"
76
371
  >
77
372
  </line>
78
373
  </g>
package/vue/UiInput.d.ts CHANGED
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  invalid?: boolean;
4
4
  readonly?: boolean;
5
5
  required?: boolean;
6
+ size?: 'sm' | 'md' | 'lg';
6
7
  value?: string;
7
8
  modelValue?: string | null;
8
9
  };
@@ -12,6 +13,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
12
13
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
13
14
  }>, {
14
15
  invalid: boolean;
16
+ size: "sm" | "md" | "lg";
15
17
  disabled: boolean;
16
18
  required: boolean;
17
19
  readonly: boolean;
package/vue/UiInput.vue CHANGED
@@ -12,6 +12,7 @@ const props = withDefaults(
12
12
  invalid?: boolean
13
13
  readonly?: boolean
14
14
  required?: boolean
15
+ size?: 'sm' | 'md' | 'lg'
15
16
  value?: string
16
17
  modelValue?: string | null
17
18
  }>(),
@@ -20,6 +21,7 @@ const props = withDefaults(
20
21
  invalid: false,
21
22
  readonly: false,
22
23
  required: false,
24
+ size: 'md',
23
25
  },
24
26
  )
25
27
  const emit = defineEmits<{
@@ -32,6 +34,13 @@ const model = computed({
32
34
 
33
35
  const root = ref<HTMLElement | null>(null)
34
36
 
37
+ /** The values the styles' :host-state() rules test. */
38
+ const hostState = computed(() =>
39
+ [
40
+ props.size && `size size=${props.size}`,
41
+ ].filter(Boolean).join(' ')
42
+ )
43
+
35
44
  const dispatch = createDispatch(root)
36
45
 
37
46
  useComponentHost(controllerModule.default, {
@@ -50,6 +59,7 @@ useComponentHost(controllerModule.default, {
50
59
  :required="required"
51
60
  :aria-invalid="invalid"
52
61
  v-model="model"
62
+ :data-ui-input-state="hostState || undefined"
53
63
  ref="root"
54
64
  >
55
65
  </template>
@@ -138,6 +148,37 @@ useComponentHost(controllerModule.default, {
138
148
  background-color var(--ui-motion-fast) var(--ui-motion-ease);
139
149
  }
140
150
 
151
+ /* Each size reads the hook and then an Input Group's default first, so a group, which draws the frame, can zero it. */
152
+ [data-component~="ui-input"][data-ui-input-state~="size=sm"] {
153
+ min-block-size: var(
154
+ --ui-input-min-block-size,
155
+ var(--_ui-default-input-min-block-size, var(--ui-control-size-sm))
156
+ );
157
+ padding: var(--ui-space-1) var(--ui-space-2);
158
+ font-size: var(--ui-font-size-sm);
159
+ }
160
+
161
+ [data-component~="ui-input"][data-ui-input-state~="size=lg"] {
162
+ min-block-size: var(
163
+ --ui-input-min-block-size,
164
+ var(--_ui-default-input-min-block-size, var(--ui-control-size-lg))
165
+ );
166
+ padding: var(--ui-space-3) var(--ui-space-4);
167
+ font-size: var(--ui-font-size-md);
168
+ }
169
+
170
+ /* Under touch a small field is still a touch-sized target, as a small button is, and keeps
171
+ body-size text: below 16px, iOS zooms the page into the focused field. */
172
+ @media (pointer: coarse) {
173
+ [data-component~="ui-input"][data-ui-input-state~="size=sm"] {
174
+ min-block-size: var(
175
+ --ui-input-min-block-size,
176
+ var(--_ui-default-input-min-block-size, var(--ui-control-min-block-size))
177
+ );
178
+ font-size: inherit;
179
+ }
180
+ }
181
+
141
182
  /* Tabbing into a field selects its text; tint that selection softly instead of the page highlight. */
142
183
  [data-component~="ui-input"]::selection {
143
184
  background: color-mix(in srgb, var(--ui-accent-solid) 20%, transparent);
@@ -91,6 +91,21 @@ useComponentHost(controllerModule.default, {
91
91
  box-shadow var(--ui-motion-fast) var(--ui-motion-ease);
92
92
  }
93
93
 
94
+ /* The frame takes its input's size, so a small group lines up with small buttons and fields. */
95
+ [data-component~="ui-input-group"]:has(.field [data-ui-input-state~="size=sm"]) {
96
+ min-block-size: var(--ui-control-size-sm);
97
+ }
98
+
99
+ [data-component~="ui-input-group"]:has(.field [data-ui-input-state~="size=lg"]) {
100
+ min-block-size: var(--ui-control-size-lg);
101
+ }
102
+
103
+ @media (pointer: coarse) {
104
+ [data-component~="ui-input-group"]:has(.field [data-ui-input-state~="size=sm"]) {
105
+ min-block-size: var(--ui-control-min-block-size);
106
+ }
107
+ }
108
+
94
109
  [data-component~="ui-input-group"]:hover:not(:has(input:focus, input:disabled)) {
95
110
  border-color: var(--ui-control-border-hover, var(--ui-text-secondary));
96
111
  }
package/vue/UiRadio.d.ts CHANGED
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  disabled?: boolean;
4
4
  name?: string;
5
5
  required?: boolean;
6
+ size?: 'sm' | 'md' | 'lg';
6
7
  value?: string;
7
8
  };
8
9
  declare var __VLS_1: {}, __VLS_3: {};
@@ -29,6 +30,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
29
30
  "onUpdate:value"?: ((value: string) => any) | undefined;
30
31
  }>, {
31
32
  name: string;
33
+ size: "sm" | "md" | "lg";
32
34
  value: string;
33
35
  disabled: boolean;
34
36
  checked: boolean;
package/vue/UiRadio.vue CHANGED
@@ -12,6 +12,7 @@ const props = withDefaults(
12
12
  disabled?: boolean
13
13
  name?: string
14
14
  required?: boolean
15
+ size?: 'sm' | 'md' | 'lg'
15
16
  value?: string
16
17
  }>(),
17
18
  {
@@ -19,6 +20,7 @@ const props = withDefaults(
19
20
  disabled: false,
20
21
  name: '',
21
22
  required: false,
23
+ size: 'md',
22
24
  value: 'on',
23
25
  },
24
26
  )
@@ -43,6 +45,7 @@ const internalChecked = ref(false)
43
45
  const hostState = computed(() =>
44
46
  [
45
47
  props.disabled && 'disabled',
48
+ props.size && `size size=${props.size}`,
46
49
  ].filter(Boolean).join(' ')
47
50
  )
48
51
 
@@ -159,6 +162,37 @@ input:focus-visible {
159
162
  cursor: not-allowed;
160
163
  }
161
164
 
165
+ /* A sized choice keeps its box and aligns instead: the label takes that size's field type size,
166
+ and the first line centres in that control height, so the label shares a row's baseline.
167
+ Multi-line labels and descriptions still grow downward from that first line. */
168
+ [data-component~="ui-radio"][data-ui-radio-state~="size=sm"] {
169
+ --_font: var(--ui-font-size-sm);
170
+ --_row: var(--ui-control-size-sm);
171
+ }
172
+
173
+ [data-component~="ui-radio"][data-ui-radio-state~="size=lg"] {
174
+ --_font: var(--ui-font-size-md);
175
+ --_row: var(--ui-control-size-lg);
176
+ }
177
+
178
+ [data-component~="ui-radio"][data-ui-radio-state~="size=sm"],
179
+ [data-component~="ui-radio"][data-ui-radio-state~="size=lg"] {
180
+ --_line: calc(var(--_font) * var(--ui-line-height-md));
181
+ font-size: var(--_font);
182
+ padding-block: calc((var(--_row) - var(--_line)) / 2);
183
+ }
184
+
185
+ [data-component~="ui-radio"][data-ui-radio-state~="size=sm"] input,
186
+ [data-component~="ui-radio"][data-ui-radio-state~="size=lg"] input {
187
+ margin-top: calc((var(--_line) - var(--_ui-radio-size, 1.125rem)) / 2);
188
+ }
189
+
190
+ @media (pointer: coarse) {
191
+ [data-component~="ui-radio"][data-ui-radio-state~="size=sm"] {
192
+ --_row: var(--ui-control-min-block-size);
193
+ }
194
+ }
195
+
162
196
  /* A component that sets its display still honours the hidden attribute on its root. */
163
197
  [data-component~="ui-radio"][hidden] {
164
198
  display: none;
package/vue/UiSelect.d.ts CHANGED
@@ -2,6 +2,7 @@ type __VLS_Props = {
2
2
  disabled?: boolean;
3
3
  invalid?: boolean;
4
4
  required?: boolean;
5
+ size?: 'sm' | 'md' | 'lg';
5
6
  value?: string;
6
7
  modelValue?: string | null;
7
8
  };
@@ -15,6 +16,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
15
16
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
16
17
  }>, {
17
18
  invalid: boolean;
19
+ size: "sm" | "md" | "lg";
18
20
  disabled: boolean;
19
21
  required: boolean;
20
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;