@realmorg/ui 2.0.0-alpha.2 → 2.0.0-alpha.3

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 (64) hide show
  1. package/components/accordion.html +18 -0
  2. package/components/alert-dialog.html +40 -0
  3. package/components/alert.html +14 -0
  4. package/components/aspect-ratio.html +6 -0
  5. package/components/attachment.html +14 -0
  6. package/components/avatar.html +22 -0
  7. package/components/badge.html +6 -0
  8. package/components/breadcrumb.html +30 -0
  9. package/components/bubble.html +10 -0
  10. package/components/button-group.html +14 -0
  11. package/components/button.html +6 -0
  12. package/components/calendar.html +6 -0
  13. package/components/card.html +30 -0
  14. package/components/carousel.html +22 -0
  15. package/components/chart.html +6 -0
  16. package/components/checkbox.html +6 -0
  17. package/components/code-block.html +6 -0
  18. package/components/collapsible.html +14 -0
  19. package/components/combobox.html +13 -0
  20. package/components/command.html +12 -0
  21. package/components/context-menu.html +14 -0
  22. package/components/dialog.html +49 -3
  23. package/components/direction.html +6 -0
  24. package/components/drawer.html +46 -3
  25. package/components/dropdown-menu.html +49 -0
  26. package/components/empty.html +26 -0
  27. package/components/field.html +26 -0
  28. package/components/hover-card.html +17 -0
  29. package/components/input-group.html +16 -0
  30. package/components/input-otp.html +12 -0
  31. package/components/input.html +12 -0
  32. package/components/item.html +38 -0
  33. package/components/kbd.html +10 -0
  34. package/components/label.html +6 -0
  35. package/components/marker.html +6 -0
  36. package/components/menubar.html +21 -0
  37. package/components/message-scroller.html +6 -0
  38. package/components/message.html +18 -0
  39. package/components/navigation-menu.html +29 -0
  40. package/components/pagination.html +6 -0
  41. package/components/popover.html +31 -0
  42. package/components/progress.html +6 -0
  43. package/components/radio-group.html +6 -0
  44. package/components/resizable.html +14 -0
  45. package/components/scroll-area.html +6 -0
  46. package/components/select.html +12 -0
  47. package/components/separator.html +6 -0
  48. package/components/sheet.html +30 -0
  49. package/components/sidebar.html +52 -2
  50. package/components/skeleton.html +6 -0
  51. package/components/slider.html +28 -1
  52. package/components/spinner.html +6 -0
  53. package/components/switch.html +6 -0
  54. package/components/table.html +6 -0
  55. package/components/tabs.html +18 -0
  56. package/components/textarea.html +12 -0
  57. package/components/toaster.html +6 -0
  58. package/components/toggle-group.html +6 -0
  59. package/components/toggle.html +6 -0
  60. package/components/tooltip.html +17 -0
  61. package/dist/theme.css +13 -0
  62. package/dist/ui.html +988 -9
  63. package/package.json +3 -3
  64. package/theme.css +13 -0
@@ -39,11 +39,17 @@
39
39
  </script>
40
40
 
41
41
  <style>
42
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
43
+ touch-action does not reach shadow content in iOS Safari. */
44
+ :host,
45
+ * {
46
+ touch-action: manipulation;
47
+ }
42
48
  :host {
43
49
  --ui-sidebar-width: calc(var(--spacing) * 64);
44
50
  --ui-sidebar-label: block;
45
51
  display: flex;
46
- min-height: 100dvh;
52
+ min-height: 100svh;
47
53
  background: var(--sidebar);
48
54
  }
49
55
  :host(:state(attr-collapsed)) {
@@ -54,7 +60,7 @@
54
60
  position: sticky;
55
61
  top: 0;
56
62
  width: var(--ui-sidebar-width);
57
- height: 100dvh;
63
+ height: 100svh;
58
64
  flex-shrink: 0;
59
65
  transition: width 0.2s ease;
60
66
  }
@@ -93,6 +99,10 @@
93
99
 
94
100
  <custom-element name="ui-sidebar" slot="sidebar">
95
101
  <style>
102
+ :host,
103
+ * {
104
+ touch-action: manipulation;
105
+ }
96
106
  :host {
97
107
  display: flex;
98
108
  flex-direction: column;
@@ -111,6 +121,10 @@
111
121
 
112
122
  <custom-element name="ui-sidebar-header" slot="header">
113
123
  <style>
124
+ :host,
125
+ * {
126
+ touch-action: manipulation;
127
+ }
114
128
  :host {
115
129
  display: flex;
116
130
  flex-direction: column;
@@ -124,6 +138,10 @@
124
138
 
125
139
  <custom-element name="ui-sidebar-footer" slot="footer">
126
140
  <style>
141
+ :host,
142
+ * {
143
+ touch-action: manipulation;
144
+ }
127
145
  :host {
128
146
  display: flex;
129
147
  flex-direction: column;
@@ -137,6 +155,10 @@
137
155
 
138
156
  <custom-element name="ui-sidebar-content">
139
157
  <style>
158
+ :host,
159
+ * {
160
+ touch-action: manipulation;
161
+ }
140
162
  :host {
141
163
  display: block;
142
164
  flex: 1;
@@ -163,6 +185,10 @@
163
185
  </script>
164
186
 
165
187
  <style>
188
+ :host,
189
+ * {
190
+ touch-action: manipulation;
191
+ }
166
192
  :host {
167
193
  display: flex;
168
194
  flex-direction: column;
@@ -175,6 +201,10 @@
175
201
 
176
202
  <custom-element name="ui-sidebar-group-label">
177
203
  <style>
204
+ :host,
205
+ * {
206
+ touch-action: manipulation;
207
+ }
178
208
  :host {
179
209
  display: var(--ui-sidebar-label, block);
180
210
  height: calc(var(--spacing) * 8);
@@ -192,6 +222,10 @@
192
222
 
193
223
  <custom-element name="ui-sidebar-menu">
194
224
  <style>
225
+ :host,
226
+ * {
227
+ touch-action: manipulation;
228
+ }
195
229
  :host {
196
230
  display: block;
197
231
  }
@@ -210,6 +244,10 @@
210
244
 
211
245
  <custom-element name="ui-sidebar-menu-item" role="listitem">
212
246
  <style>
247
+ :host,
248
+ * {
249
+ touch-action: manipulation;
250
+ }
213
251
  :host {
214
252
  position: relative;
215
253
  display: block;
@@ -250,6 +288,10 @@
250
288
  </script>
251
289
 
252
290
  <style>
291
+ :host,
292
+ * {
293
+ touch-action: manipulation;
294
+ }
253
295
  :host {
254
296
  display: block;
255
297
  }
@@ -291,6 +333,10 @@
291
333
 
292
334
  <custom-element name="ui-sidebar-menu-badge">
293
335
  <style>
336
+ :host,
337
+ * {
338
+ touch-action: manipulation;
339
+ }
294
340
  :host {
295
341
  display: var(--ui-sidebar-label, block);
296
342
  position: absolute;
@@ -322,6 +368,10 @@
322
368
 
323
369
  <custom-element name="ui-sidebar-inset">
324
370
  <style>
371
+ :host,
372
+ * {
373
+ touch-action: manipulation;
374
+ }
325
375
  :host {
326
376
  display: flex;
327
377
  flex: 1;
@@ -1,5 +1,11 @@
1
1
  <custom-element name="ui-skeleton">
2
2
  <style>
3
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
4
+ touch-action does not reach shadow content in iOS Safari. */
5
+ :host,
6
+ * {
7
+ touch-action: manipulation;
8
+ }
3
9
  :host {
4
10
  display: block;
5
11
  border-radius: var(--radius-md);
@@ -14,9 +14,21 @@
14
14
  return `${((props.value - props.min) / (props.max - props.min || 1)) * 100}%`;
15
15
  },
16
16
  });
17
+
18
+ // Writing the value Safari just set, during a finger drag, makes the thumb jump.
19
+ observe(() => {
20
+ const value = String(props.value);
21
+ if (refs.control && refs.control.value !== value) refs.control.value = value;
22
+ });
17
23
  </script>
18
24
 
19
25
  <style>
26
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
27
+ touch-action does not reach shadow content in iOS Safari. */
28
+ :host,
29
+ * {
30
+ touch-action: manipulation;
31
+ }
20
32
  :host {
21
33
  display: block;
22
34
  min-width: calc(var(--spacing) * 32);
@@ -30,6 +42,8 @@
30
42
  background: transparent;
31
43
  cursor: pointer;
32
44
  outline: none;
45
+ /* The slider owns the whole gesture, so the browser never turns a drag into a page pan. */
46
+ touch-action: none;
33
47
  }
34
48
  input::-webkit-slider-runnable-track {
35
49
  height: calc(var(--spacing) * 1.5);
@@ -61,6 +75,20 @@
61
75
  input:focus-visible::-webkit-slider-thumb {
62
76
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--ring) 50%, transparent);
63
77
  }
78
+ @media (pointer: coarse) {
79
+ input {
80
+ height: calc(var(--spacing) * 6);
81
+ }
82
+ input::-webkit-slider-thumb {
83
+ width: calc(var(--spacing) * 6);
84
+ height: calc(var(--spacing) * 6);
85
+ margin-top: calc(var(--spacing) * -2.25);
86
+ }
87
+ input::-moz-range-thumb {
88
+ width: calc(var(--spacing) * 6);
89
+ height: calc(var(--spacing) * 6);
90
+ }
91
+ }
64
92
  input:disabled {
65
93
  cursor: not-allowed;
66
94
  opacity: 0.5;
@@ -74,7 +102,6 @@
74
102
  _min="@min"
75
103
  _max="@max"
76
104
  _step="@step"
77
- _value="@value"
78
105
  _disabled="@disabled"
79
106
  _aria-label="@label"
80
107
  >
@@ -12,6 +12,12 @@
12
12
  </script>
13
13
 
14
14
  <style>
15
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
16
+ touch-action does not reach shadow content in iOS Safari. */
17
+ :host,
18
+ * {
19
+ touch-action: manipulation;
20
+ }
15
21
  :host {
16
22
  display: inline-flex;
17
23
  width: calc(var(--attr-size) * 1px);
@@ -10,6 +10,12 @@
10
10
  </script>
11
11
 
12
12
  <style>
13
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
14
+ touch-action does not reach shadow content in iOS Safari. */
15
+ :host,
16
+ * {
17
+ touch-action: manipulation;
18
+ }
13
19
  :host(:state(attr-checked)) label {
14
20
  color: var(--foreground);
15
21
  }
@@ -20,6 +20,12 @@
20
20
  </script>
21
21
 
22
22
  <style>
23
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
24
+ touch-action does not reach shadow content in iOS Safari. */
25
+ :host,
26
+ * {
27
+ touch-action: manipulation;
28
+ }
23
29
  :host {
24
30
  display: block;
25
31
  width: 100%;
@@ -38,6 +38,12 @@
38
38
  </script>
39
39
 
40
40
  <style>
41
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
42
+ touch-action does not reach shadow content in iOS Safari. */
43
+ :host,
44
+ * {
45
+ touch-action: manipulation;
46
+ }
41
47
  :host {
42
48
  display: flex;
43
49
  flex-direction: column;
@@ -55,6 +61,10 @@
55
61
 
56
62
  <custom-element name="ui-tabs-list">
57
63
  <style>
64
+ :host,
65
+ * {
66
+ touch-action: manipulation;
67
+ }
58
68
  :host {
59
69
  display: block;
60
70
  width: fit-content;
@@ -91,6 +101,10 @@
91
101
  </script>
92
102
 
93
103
  <style>
104
+ :host,
105
+ * {
106
+ touch-action: manipulation;
107
+ }
94
108
  :host {
95
109
  display: flex;
96
110
  flex: 1;
@@ -150,6 +164,10 @@
150
164
 
151
165
  <custom-element name="ui-tabs-content" role="tabpanel">
152
166
  <style>
167
+ :host,
168
+ * {
169
+ touch-action: manipulation;
170
+ }
153
171
  :host {
154
172
  display: block;
155
173
  flex: 1;
@@ -15,6 +15,12 @@
15
15
  </script>
16
16
 
17
17
  <style>
18
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
19
+ touch-action does not reach shadow content in iOS Safari. */
20
+ :host,
21
+ * {
22
+ touch-action: manipulation;
23
+ }
18
24
  :host {
19
25
  display: block;
20
26
  }
@@ -35,6 +41,12 @@
35
41
  field-sizing: content;
36
42
  resize: vertical;
37
43
  }
44
+ /* iOS Safari zooms in on a focused field whose text is under 16px. */
45
+ @media (pointer: coarse) {
46
+ textarea {
47
+ font-size: var(--text-base);
48
+ }
49
+ }
38
50
  textarea::placeholder {
39
51
  color: var(--muted-foreground);
40
52
  }
@@ -43,6 +43,12 @@
43
43
  </script>
44
44
 
45
45
  <style>
46
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
47
+ touch-action does not reach shadow content in iOS Safari. */
48
+ :host,
49
+ * {
50
+ touch-action: manipulation;
51
+ }
46
52
  ol {
47
53
  position: fixed;
48
54
  inset: auto calc(var(--spacing) * 4) calc(var(--spacing) * 4) auto;
@@ -37,6 +37,12 @@
37
37
  </script>
38
38
 
39
39
  <style>
40
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
41
+ touch-action does not reach shadow content in iOS Safari. */
42
+ :host,
43
+ * {
44
+ touch-action: manipulation;
45
+ }
40
46
  :host {
41
47
  display: inline-flex;
42
48
  align-items: center;
@@ -16,6 +16,12 @@
16
16
  </script>
17
17
 
18
18
  <style>
19
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
20
+ touch-action does not reach shadow content in iOS Safari. */
21
+ :host,
22
+ * {
23
+ touch-action: manipulation;
24
+ }
19
25
  :host {
20
26
  display: inline-flex;
21
27
  }
@@ -38,6 +38,12 @@
38
38
  </script>
39
39
 
40
40
  <style>
41
+ /* A double tap must not zoom the page. Set inside the shadow root, because a page-level
42
+ touch-action does not reach shadow content in iOS Safari. */
43
+ :host,
44
+ * {
45
+ touch-action: manipulation;
46
+ }
41
47
  :host {
42
48
  display: contents;
43
49
  }
@@ -48,6 +54,10 @@
48
54
 
49
55
  <custom-element name="ui-tooltip-trigger">
50
56
  <style>
57
+ :host,
58
+ * {
59
+ touch-action: manipulation;
60
+ }
51
61
  :host {
52
62
  display: inline-block;
53
63
  vertical-align: middle;
@@ -67,6 +77,10 @@
67
77
  </script>
68
78
 
69
79
  <style>
80
+ :host,
81
+ * {
82
+ touch-action: manipulation;
83
+ }
70
84
  :host {
71
85
  margin: 0 0 calc(var(--spacing) * 1);
72
86
  padding: calc(var(--spacing) * 1.5) calc(var(--spacing) * 3);
@@ -76,6 +90,9 @@
76
90
  color: var(--background);
77
91
  font-size: var(--text-xs);
78
92
  inset: auto;
93
+ height: fit-content;
94
+ max-height: calc(100svh - calc(var(--spacing) * 8));
95
+ overflow-y: auto;
79
96
  position-area: top;
80
97
  position-try-fallbacks: flip-block;
81
98
  }
package/dist/theme.css CHANGED
@@ -138,6 +138,19 @@
138
138
  }
139
139
  }
140
140
 
141
+ /* Taps respond at once and a double tap does not zoom. Pinch zoom still works. */
142
+ html {
143
+ touch-action: manipulation;
144
+ }
145
+
146
+ /* iOS Safari only sends clicks for taps on clickable elements, so tapping outside an open popover
147
+ or menu would not close it. Touch screens show no cursor, so this changes nothing visible. */
148
+ @media (pointer: coarse) {
149
+ html {
150
+ cursor: pointer;
151
+ }
152
+ }
153
+
141
154
  body {
142
155
  background: var(--background);
143
156
  color: var(--foreground);