@duro-app/ui 5.10.0 → 5.12.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 (179) hide show
  1. package/dist/{Table-gRiLI243.js → Table-ColfpgKV.js} +8 -4
  2. package/dist/Table-ColfpgKV.js.map +1 -0
  3. package/dist/compiler-runtime-BuugS4D0.js.map +1 -1
  4. package/dist/components/Alert/Alert.d.ts.map +1 -1
  5. package/dist/components/Button/Button.d.ts +2 -1
  6. package/dist/components/Button/Button.d.ts.map +1 -1
  7. package/dist/components/Button/styles.css.d.ts +1 -0
  8. package/dist/components/Button/styles.css.d.ts.map +1 -1
  9. package/dist/components/Callout/Callout.d.ts.map +1 -1
  10. package/dist/components/Callout/styles.css.d.ts +3 -0
  11. package/dist/components/Callout/styles.css.d.ts.map +1 -1
  12. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  13. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
  14. package/dist/components/DetailPanel/DetailPanel.d.ts.map +1 -1
  15. package/dist/components/Dialog/Dialog.d.ts +2 -17
  16. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  17. package/dist/components/Dialog/Dialog.stories.d.ts +4 -0
  18. package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
  19. package/dist/components/Dialog/native.css.d.ts +82 -0
  20. package/dist/components/Dialog/native.css.d.ts.map +1 -0
  21. package/dist/components/Dialog/parts.css.d.ts +82 -0
  22. package/dist/components/Dialog/parts.css.d.ts.map +1 -0
  23. package/dist/components/Dialog/parts.d.ts +35 -0
  24. package/dist/components/Dialog/parts.d.ts.map +1 -0
  25. package/dist/components/Dialog/styles.css.d.ts +1 -74
  26. package/dist/components/Dialog/styles.css.d.ts.map +1 -1
  27. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  28. package/dist/components/Drawer/styles.css.d.ts +2 -0
  29. package/dist/components/Drawer/styles.css.d.ts.map +1 -1
  30. package/dist/components/FileTrigger/FileTrigger.d.ts +23 -0
  31. package/dist/components/FileTrigger/FileTrigger.d.ts.map +1 -0
  32. package/dist/components/FileTrigger/FileTrigger.meta.d.ts +3 -0
  33. package/dist/components/FileTrigger/FileTrigger.meta.d.ts.map +1 -0
  34. package/dist/components/FileTrigger/FileTrigger.stories.d.ts +9 -0
  35. package/dist/components/FileTrigger/FileTrigger.stories.d.ts.map +1 -0
  36. package/dist/components/FileTrigger/index.d.ts +3 -0
  37. package/dist/components/FileTrigger/index.d.ts.map +1 -0
  38. package/dist/components/FileTrigger/pick.d.ts +14 -0
  39. package/dist/components/FileTrigger/pick.d.ts.map +1 -0
  40. package/dist/components/Grid/styles.css.d.ts +1 -0
  41. package/dist/components/Grid/styles.css.d.ts.map +1 -1
  42. package/dist/components/Icon/Icon.d.ts +3 -9
  43. package/dist/components/Icon/Icon.d.ts.map +1 -1
  44. package/dist/components/Icon/Icon.stories.d.ts.map +1 -1
  45. package/dist/components/Icon/geometry.d.ts +60 -0
  46. package/dist/components/Icon/geometry.d.ts.map +1 -0
  47. package/dist/components/Icon/types.d.ts +15 -0
  48. package/dist/components/Icon/types.d.ts.map +1 -0
  49. package/dist/components/Input/Input.d.ts +5 -1
  50. package/dist/components/Input/Input.d.ts.map +1 -1
  51. package/dist/components/Input/styles.css.d.ts +1 -0
  52. package/dist/components/Input/styles.css.d.ts.map +1 -1
  53. package/dist/components/LinkButton/styles.css.d.ts +1 -0
  54. package/dist/components/LinkButton/styles.css.d.ts.map +1 -1
  55. package/dist/components/Meter/styles.css.d.ts +1 -0
  56. package/dist/components/Meter/styles.css.d.ts.map +1 -1
  57. package/dist/components/PageShell/styles.css.d.ts +2 -0
  58. package/dist/components/PageShell/styles.css.d.ts.map +1 -1
  59. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -17
  60. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  61. package/dist/components/RadioGroup/RadioGroup.stories.d.ts +3 -0
  62. package/dist/components/RadioGroup/RadioGroup.stories.d.ts.map +1 -1
  63. package/dist/components/RadioGroup/group.d.ts +31 -0
  64. package/dist/components/RadioGroup/group.d.ts.map +1 -0
  65. package/dist/components/RadioGroup/styles.css.d.ts +10 -0
  66. package/dist/components/RadioGroup/styles.css.d.ts.map +1 -1
  67. package/dist/components/ScrollArea/styles.css.d.ts +1 -0
  68. package/dist/components/ScrollArea/styles.css.d.ts.map +1 -1
  69. package/dist/components/Spinner/Spinner.d.ts +2 -6
  70. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  71. package/dist/components/Spinner/Spinner.types.d.ts +6 -0
  72. package/dist/components/Spinner/Spinner.types.d.ts.map +1 -0
  73. package/dist/components/Spinner/ring.css.d.ts +39 -0
  74. package/dist/components/Spinner/ring.css.d.ts.map +1 -0
  75. package/dist/components/Spinner/styles.css.d.ts +1 -28
  76. package/dist/components/Spinner/styles.css.d.ts.map +1 -1
  77. package/dist/components/StatusIcon/StatusIcon.d.ts.map +1 -1
  78. package/dist/components/StatusIcon/styles.css.d.ts +3 -0
  79. package/dist/components/StatusIcon/styles.css.d.ts.map +1 -1
  80. package/dist/components/Switch/Switch.d.ts +2 -18
  81. package/dist/components/Switch/Switch.d.ts.map +1 -1
  82. package/dist/components/Switch/Switch.types.d.ts +18 -0
  83. package/dist/components/Switch/Switch.types.d.ts.map +1 -0
  84. package/dist/components/TableOfContents/styles.css.d.ts +1 -0
  85. package/dist/components/TableOfContents/styles.css.d.ts.map +1 -1
  86. package/dist/components/Textarea/styles.css.d.ts +1 -0
  87. package/dist/components/Textarea/styles.css.d.ts.map +1 -1
  88. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  89. package/dist/components/Toggle/styles.css.d.ts +11 -2
  90. package/dist/components/Toggle/styles.css.d.ts.map +1 -1
  91. package/dist/components/VirtualTable/styles.css.d.ts +6 -0
  92. package/dist/components/VirtualTable/styles.css.d.ts.map +1 -1
  93. package/dist/index.css +1 -1
  94. package/dist/index.d.ts +1 -0
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +4589 -3788
  97. package/dist/index.js.map +1 -1
  98. package/dist/shared/portal/hostRegistry.d.ts +33 -0
  99. package/dist/shared/portal/hostRegistry.d.ts.map +1 -0
  100. package/dist/shared/useOverlayOpenState.d.ts +40 -0
  101. package/dist/shared/useOverlayOpenState.d.ts.map +1 -0
  102. package/dist/table.js +141 -135
  103. package/dist/table.js.map +1 -1
  104. package/package.json +34 -4
  105. package/src/components/Alert/Alert.tsx +14 -2
  106. package/src/components/Button/Button.tsx +3 -2
  107. package/src/components/Button/styles.css.ts +2 -0
  108. package/src/components/Callout/Callout.tsx +17 -3
  109. package/src/components/Callout/styles.css.ts +5 -0
  110. package/src/components/Checkbox/Checkbox.native.tsx +67 -0
  111. package/src/components/Checkbox/Checkbox.tsx +1 -50
  112. package/src/components/ConfirmDialog/ConfirmDialog.tsx +3 -0
  113. package/src/components/DetailPanel/DetailPanel.tsx +9 -45
  114. package/src/components/Dialog/Dialog.native.tsx +296 -0
  115. package/src/components/Dialog/Dialog.stories.tsx +71 -0
  116. package/src/components/Dialog/Dialog.tsx +41 -130
  117. package/src/components/Dialog/native.css.ts +78 -0
  118. package/src/components/Dialog/parts.css.ts +101 -0
  119. package/src/components/Dialog/parts.tsx +61 -0
  120. package/src/components/Dialog/styles.css.ts +2 -89
  121. package/src/components/Drawer/Drawer.tsx +20 -49
  122. package/src/components/Drawer/styles.css.ts +4 -0
  123. package/src/components/FileTrigger/FileTrigger.meta.ts +24 -0
  124. package/src/components/FileTrigger/FileTrigger.stories.tsx +36 -0
  125. package/src/components/FileTrigger/FileTrigger.tsx +80 -0
  126. package/src/components/FileTrigger/index.ts +2 -0
  127. package/src/components/FileTrigger/pick.ts +21 -0
  128. package/src/components/Grid/styles.css.ts +2 -0
  129. package/src/components/Icon/Icon.native.tsx +54 -0
  130. package/src/components/Icon/Icon.stories.tsx +1 -0
  131. package/src/components/Icon/Icon.tsx +19 -400
  132. package/src/components/Icon/geometry.ts +456 -0
  133. package/src/components/Icon/types.ts +74 -0
  134. package/src/components/Input/Input.tsx +8 -0
  135. package/src/components/Input/styles.css.ts +2 -0
  136. package/src/components/LinkButton/styles.css.ts +2 -0
  137. package/src/components/Meter/styles.css.ts +2 -0
  138. package/src/components/PageShell/styles.css.ts +4 -0
  139. package/src/components/RadioGroup/RadioGroup.meta.ts +1 -1
  140. package/src/components/RadioGroup/RadioGroup.native.tsx +48 -0
  141. package/src/components/RadioGroup/RadioGroup.stories.tsx +64 -1
  142. package/src/components/RadioGroup/RadioGroup.tsx +8 -83
  143. package/src/components/RadioGroup/group.tsx +85 -0
  144. package/src/components/RadioGroup/styles.css.ts +13 -0
  145. package/src/components/ScrollArea/styles.css.ts +2 -0
  146. package/src/components/Spinner/Spinner.native.tsx +37 -0
  147. package/src/components/Spinner/Spinner.tsx +6 -15
  148. package/src/components/Spinner/Spinner.types.ts +6 -0
  149. package/src/components/Spinner/ring.css.ts +45 -0
  150. package/src/components/Spinner/styles.css.ts +2 -32
  151. package/src/components/StatusIcon/StatusIcon.tsx +13 -2
  152. package/src/components/StatusIcon/styles.css.ts +5 -0
  153. package/src/components/Switch/Switch.native.tsx +45 -0
  154. package/src/components/Switch/Switch.tsx +22 -44
  155. package/src/components/Switch/Switch.types.ts +18 -0
  156. package/src/components/TableOfContents/styles.css.ts +2 -0
  157. package/src/components/Textarea/styles.css.ts +2 -0
  158. package/src/components/ThemeProvider/ThemeProvider.native.tsx +70 -10
  159. package/src/components/Toggle/Toggle.tsx +2 -0
  160. package/src/components/Toggle/styles.css.ts +14 -2
  161. package/src/components/VirtualTable/styles.css.ts +12 -0
  162. package/src/index.native.ts +28 -1
  163. package/src/index.ts +5 -0
  164. package/src/native-guard/globals.d.ts +10 -0
  165. package/src/native-guard/react-dom.d.ts +3 -0
  166. package/src/shared/accessibilityFocus.native.ts +23 -0
  167. package/src/shared/portal/OverlayModal.native.tsx +51 -0
  168. package/src/shared/portal/PortalHost.native.tsx +102 -0
  169. package/src/shared/portal/hostRegistry.ts +76 -0
  170. package/src/shared/portal/themeScope.native.ts +18 -0
  171. package/src/shared/safeArea.native.ts +22 -0
  172. package/src/shared/useOverlayOpenState.ts +128 -0
  173. package/dist/Table-gRiLI243.js.map +0 -1
  174. package/dist/components/ThemeProvider/ThemeProvider.native.d.ts +0 -10
  175. package/dist/components/ThemeProvider/ThemeProvider.native.d.ts.map +0 -1
  176. package/dist/index.native.d.ts +0 -33
  177. package/dist/index.native.d.ts.map +0 -1
  178. package/dist/platform.native.d.ts +0 -2
  179. package/dist/platform.native.d.ts.map +0 -1
@@ -0,0 +1,456 @@
1
+ import type {IconName} from './types'
2
+
3
+ /**
4
+ * Icon glyphs as renderer-independent geometry on a 24-unit grid (plan N0,
5
+ * Decision 9): the web draws them as SVG elements, native with the renderer
6
+ * the icon benchmark picks. Generated once from the JSX tables Icon.tsx held
7
+ * through 5.11; edit the data here.
8
+ *
9
+ * A `stroke` glyph is drawn with a 2-unit stroke, round caps and joins, and no
10
+ * fill. A `fill` glyph is filled, with even-odd cutouts where `fillRule` says;
11
+ * a shape inside it may carry its own stroke (`lock-filled`'s shackle).
12
+ */
13
+ /** `currentColor` is the icon's colour (the text colour on the web, `color` on native). */
14
+ export type Paint = 'currentColor' | 'none'
15
+
16
+ export type Shape =
17
+ | {
18
+ tag: 'path'
19
+ d: string
20
+ fillRule?: 'evenodd'
21
+ /** Paint override for this shape: the icon's colour, or none. */
22
+ fill?: Paint
23
+ stroke?: Paint
24
+ strokeWidth?: number
25
+ strokeLinecap?: 'round'
26
+ }
27
+ | {tag: 'circle'; cx: number; cy: number; r: number}
28
+ | {tag: 'ellipse'; cx: number; cy: number; rx: number; ry: number}
29
+ | {tag: 'line'; x1: number; y1: number; x2: number; y2: number}
30
+ | {tag: 'rect'; x: number; y: number; width: number; height: number; rx?: number; ry?: number}
31
+ | {tag: 'polyline'; points: string}
32
+ | {tag: 'polygon'; points: string}
33
+
34
+ export interface Glyph {
35
+ readonly style: 'stroke' | 'fill'
36
+ readonly shapes: readonly Shape[]
37
+ }
38
+
39
+ export const GLYPHS: Record<IconName, Glyph> = {
40
+ 'x-circle': {
41
+ style: 'stroke',
42
+ shapes: [
43
+ {tag: 'circle', cx: 12, cy: 12, r: 10},
44
+ {tag: 'line', x1: 15, y1: 9, x2: 9, y2: 15},
45
+ {tag: 'line', x1: 9, y1: 9, x2: 15, y2: 15},
46
+ ],
47
+ },
48
+ 'check-circle': {
49
+ style: 'stroke',
50
+ shapes: [
51
+ {tag: 'circle', cx: 12, cy: 12, r: 10},
52
+ {tag: 'polyline', points: '16 10 11 15 8 12'},
53
+ ],
54
+ },
55
+ 'check-done': {
56
+ style: 'stroke',
57
+ shapes: [
58
+ {tag: 'path', d: 'M22 11.08V12a10 10 0 1 1-5.93-9.14'},
59
+ {tag: 'polyline', points: '22 4 12 14.01 9 11.01'},
60
+ ],
61
+ },
62
+ clock: {
63
+ style: 'stroke',
64
+ shapes: [
65
+ {tag: 'circle', cx: 12, cy: 12, r: 10},
66
+ {tag: 'polyline', points: '12 6 12 12 16 14'},
67
+ ],
68
+ },
69
+ forbidden: {
70
+ style: 'stroke',
71
+ shapes: [
72
+ {tag: 'circle', cx: 12, cy: 12, r: 10},
73
+ {tag: 'line', x1: 4.93, y1: 4.93, x2: 19.07, y2: 19.07},
74
+ ],
75
+ },
76
+ 'info-circle': {
77
+ style: 'stroke',
78
+ shapes: [
79
+ {tag: 'circle', cx: 12, cy: 12, r: 10},
80
+ {tag: 'line', x1: 12, y1: 16, x2: 12, y2: 12},
81
+ {tag: 'line', x1: 12, y1: 8, x2: 12.01, y2: 8},
82
+ ],
83
+ },
84
+ 'alert-triangle': {
85
+ style: 'stroke',
86
+ shapes: [
87
+ {
88
+ tag: 'path',
89
+ d: 'M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z',
90
+ },
91
+ {tag: 'line', x1: 12, y1: 9, x2: 12, y2: 13},
92
+ {tag: 'line', x1: 12, y1: 17, x2: 12.01, y2: 17},
93
+ ],
94
+ },
95
+ shield: {
96
+ style: 'stroke',
97
+ shapes: [{tag: 'path', d: 'M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'}],
98
+ },
99
+ lock: {
100
+ style: 'stroke',
101
+ shapes: [
102
+ {tag: 'rect', x: 3, y: 11, width: 18, height: 11, rx: 2, ry: 2},
103
+ {tag: 'path', d: 'M7 11V7a5 5 0 0 1 10 0v4'},
104
+ ],
105
+ },
106
+ key: {
107
+ style: 'stroke',
108
+ shapes: [
109
+ {
110
+ tag: 'path',
111
+ d: 'M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.78 7.78 5.5 5.5 0 0 1 7.78-7.78zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4',
112
+ },
113
+ ],
114
+ },
115
+ map: {
116
+ style: 'stroke',
117
+ shapes: [
118
+ {tag: 'polygon', points: '1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6'},
119
+ {tag: 'line', x1: 8, y1: 2, x2: 8, y2: 18},
120
+ {tag: 'line', x1: 16, y1: 6, x2: 16, y2: 22},
121
+ ],
122
+ },
123
+ layers: {
124
+ style: 'stroke',
125
+ shapes: [
126
+ {tag: 'polygon', points: '12 2 2 7 12 12 22 7 12 2'},
127
+ {tag: 'polyline', points: '2 17 12 22 22 17'},
128
+ {tag: 'polyline', points: '2 12 12 17 22 12'},
129
+ ],
130
+ },
131
+ repeat: {
132
+ style: 'stroke',
133
+ shapes: [
134
+ {tag: 'polyline', points: '17 1 21 5 17 9'},
135
+ {tag: 'path', d: 'M3 11V9a4 4 0 0 1 4-4h14'},
136
+ {tag: 'polyline', points: '7 23 3 19 7 15'},
137
+ {tag: 'path', d: 'M21 13v2a4 4 0 0 1-4 4H3'},
138
+ ],
139
+ },
140
+ database: {
141
+ style: 'stroke',
142
+ shapes: [
143
+ {tag: 'ellipse', cx: 12, cy: 5, rx: 9, ry: 3},
144
+ {tag: 'path', d: 'M21 12c0 1.66-4 3-9 3s-9-1.34-9-3'},
145
+ {tag: 'path', d: 'M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5'},
146
+ ],
147
+ },
148
+ 'shield-check': {
149
+ style: 'stroke',
150
+ shapes: [
151
+ {tag: 'path', d: 'M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'},
152
+ {tag: 'polyline', points: '9 12 11 14 15 10'},
153
+ ],
154
+ },
155
+ route: {
156
+ style: 'stroke',
157
+ shapes: [
158
+ {tag: 'circle', cx: 6, cy: 19, r: 3},
159
+ {tag: 'path', d: 'M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15'},
160
+ {tag: 'circle', cx: 18, cy: 5, r: 3},
161
+ ],
162
+ },
163
+ 'git-branch': {
164
+ style: 'stroke',
165
+ shapes: [
166
+ {tag: 'line', x1: 6, y1: 3, x2: 6, y2: 15},
167
+ {tag: 'circle', cx: 18, cy: 6, r: 3},
168
+ {tag: 'circle', cx: 6, cy: 18, r: 3},
169
+ {tag: 'path', d: 'M18 9a9 9 0 0 1-9 9'},
170
+ ],
171
+ },
172
+ menu: {
173
+ style: 'stroke',
174
+ shapes: [
175
+ {tag: 'line', x1: 3, y1: 6, x2: 21, y2: 6},
176
+ {tag: 'line', x1: 3, y1: 12, x2: 21, y2: 12},
177
+ {tag: 'line', x1: 3, y1: 18, x2: 21, y2: 18},
178
+ ],
179
+ },
180
+ server: {
181
+ style: 'stroke',
182
+ shapes: [
183
+ {tag: 'rect', x: 2, y: 2, width: 20, height: 8, rx: 2, ry: 2},
184
+ {tag: 'rect', x: 2, y: 14, width: 20, height: 8, rx: 2, ry: 2},
185
+ {tag: 'line', x1: 6, y1: 6, x2: 6.01, y2: 6},
186
+ {tag: 'line', x1: 6, y1: 18, x2: 6.01, y2: 18},
187
+ ],
188
+ },
189
+ 'hard-drive': {
190
+ style: 'stroke',
191
+ shapes: [
192
+ {tag: 'line', x1: 22, y1: 12, x2: 2, y2: 12},
193
+ {
194
+ tag: 'path',
195
+ d: 'M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z',
196
+ },
197
+ {tag: 'line', x1: 6, y1: 16, x2: 6.01, y2: 16},
198
+ {tag: 'line', x1: 10, y1: 16, x2: 10.01, y2: 16},
199
+ ],
200
+ },
201
+ box: {
202
+ style: 'stroke',
203
+ shapes: [
204
+ {
205
+ tag: 'path',
206
+ d: 'M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z',
207
+ },
208
+ {tag: 'polyline', points: '3.27 6.96 12 12.01 20.73 6.96'},
209
+ {tag: 'line', x1: 12, y1: 22.08, x2: 12, y2: 12},
210
+ ],
211
+ },
212
+ image: {
213
+ style: 'stroke',
214
+ shapes: [
215
+ {tag: 'rect', x: 3, y: 3, width: 18, height: 18, rx: 2, ry: 2},
216
+ {tag: 'circle', cx: 8.5, cy: 8.5, r: 1.5},
217
+ {tag: 'polyline', points: '21 15 16 10 5 21'},
218
+ ],
219
+ },
220
+ tag: {
221
+ style: 'stroke',
222
+ shapes: [
223
+ {
224
+ tag: 'path',
225
+ d: 'M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z',
226
+ },
227
+ {tag: 'line', x1: 7, y1: 7, x2: 7.01, y2: 7},
228
+ ],
229
+ },
230
+ 'pie-chart': {
231
+ style: 'stroke',
232
+ shapes: [
233
+ {tag: 'path', d: 'M21.21 15.89A10 10 0 1 1 8 2.83'},
234
+ {tag: 'path', d: 'M22 12A10 10 0 0 0 12 2v10z'},
235
+ ],
236
+ },
237
+ users: {
238
+ style: 'stroke',
239
+ shapes: [
240
+ {tag: 'path', d: 'M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'},
241
+ {tag: 'circle', cx: 9, cy: 7, r: 4},
242
+ {tag: 'path', d: 'M23 21v-2a4 4 0 0 0-3-3.87'},
243
+ {tag: 'path', d: 'M16 3.13a4 4 0 0 1 0 7.75'},
244
+ ],
245
+ },
246
+ 'user-plus': {
247
+ style: 'stroke',
248
+ shapes: [
249
+ {tag: 'path', d: 'M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'},
250
+ {tag: 'circle', cx: 8.5, cy: 7, r: 4},
251
+ {tag: 'line', x1: 20, y1: 8, x2: 20, y2: 14},
252
+ {tag: 'line', x1: 23, y1: 11, x2: 17, y2: 11},
253
+ ],
254
+ },
255
+ mail: {
256
+ style: 'stroke',
257
+ shapes: [
258
+ {
259
+ tag: 'path',
260
+ d: 'M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z',
261
+ },
262
+ {tag: 'polyline', points: '22,6 12,13 2,6'},
263
+ ],
264
+ },
265
+ 'file-text': {
266
+ style: 'stroke',
267
+ shapes: [
268
+ {tag: 'path', d: 'M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'},
269
+ {tag: 'polyline', points: '14 2 14 8 20 8'},
270
+ {tag: 'line', x1: 16, y1: 13, x2: 8, y2: 13},
271
+ {tag: 'line', x1: 16, y1: 17, x2: 8, y2: 17},
272
+ {tag: 'polyline', points: '10 9 9 9 8 9'},
273
+ ],
274
+ },
275
+ plug: {
276
+ style: 'stroke',
277
+ shapes: [
278
+ {tag: 'path', d: 'M12 22v-5'},
279
+ {tag: 'path', d: 'M9 8V2'},
280
+ {tag: 'path', d: 'M15 8V2'},
281
+ {tag: 'path', d: 'M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z'},
282
+ ],
283
+ },
284
+ pin: {
285
+ style: 'stroke',
286
+ shapes: [
287
+ {tag: 'line', x1: 12, y1: 17, x2: 12, y2: 22},
288
+ {
289
+ tag: 'path',
290
+ d: 'M9 10.76V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v6.76a2 2 0 0 0 .55 1.38l1.68 1.78A1 1 0 0 1 16.5 16h-9a1 1 0 0 1-.73-1.68l1.68-1.78A2 2 0 0 0 9 10.76z',
291
+ },
292
+ ],
293
+ },
294
+ search: {
295
+ style: 'stroke',
296
+ shapes: [
297
+ {tag: 'circle', cx: 11, cy: 11, r: 8},
298
+ {tag: 'line', x1: 21, y1: 21, x2: 16.65, y2: 16.65},
299
+ ],
300
+ },
301
+ x: {
302
+ style: 'stroke',
303
+ shapes: [
304
+ {tag: 'line', x1: 18, y1: 6, x2: 6, y2: 18},
305
+ {tag: 'line', x1: 6, y1: 6, x2: 18, y2: 18},
306
+ ],
307
+ },
308
+ mic: {
309
+ style: 'stroke',
310
+ shapes: [
311
+ {tag: 'path', d: 'M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'},
312
+ {tag: 'path', d: 'M19 10v2a7 7 0 0 1-14 0v-2'},
313
+ {tag: 'line', x1: 12, y1: 19, x2: 12, y2: 23},
314
+ {tag: 'line', x1: 8, y1: 23, x2: 16, y2: 23},
315
+ ],
316
+ },
317
+ sun: {
318
+ style: 'stroke',
319
+ shapes: [
320
+ {tag: 'circle', cx: 12, cy: 12, r: 5},
321
+ {tag: 'line', x1: 12, y1: 1, x2: 12, y2: 3},
322
+ {tag: 'line', x1: 12, y1: 21, x2: 12, y2: 23},
323
+ {tag: 'line', x1: 4.22, y1: 4.22, x2: 5.64, y2: 5.64},
324
+ {tag: 'line', x1: 18.36, y1: 18.36, x2: 19.78, y2: 19.78},
325
+ {tag: 'line', x1: 1, y1: 12, x2: 3, y2: 12},
326
+ {tag: 'line', x1: 21, y1: 12, x2: 23, y2: 12},
327
+ {tag: 'line', x1: 4.22, y1: 19.78, x2: 5.64, y2: 18.36},
328
+ {tag: 'line', x1: 18.36, y1: 5.64, x2: 19.78, y2: 4.22},
329
+ ],
330
+ },
331
+ moon: {
332
+ style: 'stroke',
333
+ shapes: [{tag: 'path', d: 'M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'}],
334
+ },
335
+ monitor: {
336
+ style: 'stroke',
337
+ shapes: [
338
+ {tag: 'rect', x: 2, y: 3, width: 20, height: 14, rx: 2, ry: 2},
339
+ {tag: 'line', x1: 8, y1: 21, x2: 16, y2: 21},
340
+ {tag: 'line', x1: 12, y1: 17, x2: 12, y2: 21},
341
+ ],
342
+ },
343
+ contrast: {
344
+ style: 'stroke',
345
+ shapes: [
346
+ {tag: 'circle', cx: 12, cy: 12, r: 10},
347
+ {tag: 'path', d: 'M12 2a10 10 0 0 1 0 20z', fill: 'currentColor', stroke: 'none'},
348
+ ],
349
+ },
350
+ signal: {
351
+ style: 'stroke',
352
+ shapes: [
353
+ {tag: 'line', x1: 4, y1: 20, x2: 4, y2: 16},
354
+ {tag: 'line', x1: 9, y1: 20, x2: 9, y2: 12},
355
+ {tag: 'line', x1: 14, y1: 20, x2: 14, y2: 8},
356
+ {tag: 'line', x1: 19, y1: 20, x2: 19, y2: 4},
357
+ ],
358
+ },
359
+ battery: {
360
+ style: 'stroke',
361
+ shapes: [
362
+ {tag: 'rect', x: 2, y: 7, width: 17, height: 10, rx: 2},
363
+ {tag: 'line', x1: 22, y1: 11, x2: 22, y2: 13},
364
+ ],
365
+ },
366
+ video: {
367
+ style: 'stroke',
368
+ shapes: [
369
+ {tag: 'rect', x: 2, y: 6, width: 14, height: 12, rx: 2},
370
+ {tag: 'path', d: 'M16 10l6-3v10l-6-3z'},
371
+ ],
372
+ },
373
+ music: {
374
+ style: 'stroke',
375
+ shapes: [
376
+ {tag: 'path', d: 'M9 18V5l12-2v13'},
377
+ {tag: 'circle', cx: 6, cy: 18, r: 3},
378
+ {tag: 'circle', cx: 18, cy: 16, r: 3},
379
+ ],
380
+ },
381
+ play: {
382
+ style: 'stroke',
383
+ shapes: [{tag: 'path', d: 'M6 4l14 8-14 8z'}],
384
+ },
385
+ pause: {
386
+ style: 'stroke',
387
+ shapes: [
388
+ {tag: 'rect', x: 6, y: 4, width: 4, height: 16},
389
+ {tag: 'rect', x: 14, y: 4, width: 4, height: 16},
390
+ ],
391
+ },
392
+ 'info-circle-filled': {
393
+ style: 'fill',
394
+ shapes: [
395
+ {
396
+ tag: 'path',
397
+ fillRule: 'evenodd',
398
+ d: 'M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-.75 6a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0zM11 11a1 1 0 1 1 2 0v5a1 1 0 1 1-2 0v-5z',
399
+ },
400
+ ],
401
+ },
402
+ 'alert-triangle-filled': {
403
+ style: 'fill',
404
+ shapes: [
405
+ {
406
+ tag: 'path',
407
+ fillRule: 'evenodd',
408
+ d: 'M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM11 10a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0v-3zm.25 6a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0z',
409
+ },
410
+ ],
411
+ },
412
+ 'check-circle-filled': {
413
+ style: 'fill',
414
+ shapes: [
415
+ {
416
+ tag: 'path',
417
+ fillRule: 'evenodd',
418
+ d: 'M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm4.707 8.707a1 1 0 0 0-1.414-1.414L11 13.586l-2.293-2.293a1 1 0 0 0-1.414 1.414l3 3a1 1 0 0 0 1.414 0l5-5z',
419
+ },
420
+ ],
421
+ },
422
+ 'x-circle-filled': {
423
+ style: 'fill',
424
+ shapes: [
425
+ {
426
+ tag: 'path',
427
+ fillRule: 'evenodd',
428
+ d: 'M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM9.707 8.293a1 1 0 0 0-1.414 1.414L10.586 12l-2.293 2.293a1 1 0 1 0 1.414 1.414L12 13.414l2.293 2.293a1 1 0 0 0 1.414-1.414L13.414 12l2.293-2.293a1 1 0 0 0-1.414-1.414L12 10.586 9.707 8.293z',
429
+ },
430
+ ],
431
+ },
432
+ 'shield-filled': {
433
+ style: 'fill',
434
+ shapes: [
435
+ {
436
+ tag: 'path',
437
+ fillRule: 'evenodd',
438
+ d: 'M12 1L3 5v7c0 6.5 8.5 10.5 9 10.73.5-.23 9-4.23 9-10.73V5l-9-4zm3.707 8.707a1 1 0 0 0-1.414-1.414L11 11.586l-1.293-1.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4z',
439
+ },
440
+ ],
441
+ },
442
+ 'lock-filled': {
443
+ style: 'fill',
444
+ shapes: [
445
+ {
446
+ tag: 'path',
447
+ d: 'M7 11V7a5 5 0 0 1 10 0v4',
448
+ fill: 'none',
449
+ stroke: 'currentColor',
450
+ strokeWidth: 2,
451
+ strokeLinecap: 'round',
452
+ },
453
+ {tag: 'rect', x: 3, y: 11, width: 18, height: 11, rx: 2, ry: 2},
454
+ ],
455
+ },
456
+ }
@@ -0,0 +1,74 @@
1
+ import type {ColorToken, IconSize} from '@duro-app/tokens/keys'
2
+
3
+ export type {IconSize}
4
+
5
+ export type IconName =
6
+ | 'x-circle'
7
+ | 'check-circle'
8
+ | 'check-done'
9
+ | 'clock'
10
+ | 'forbidden'
11
+ | 'info-circle'
12
+ | 'alert-triangle'
13
+ | 'shield'
14
+ | 'lock'
15
+ | 'key'
16
+ // Navigation / wayfinding glyphs
17
+ | 'map'
18
+ | 'layers'
19
+ | 'repeat'
20
+ | 'database'
21
+ | 'shield-check'
22
+ | 'route'
23
+ | 'git-branch'
24
+ | 'menu'
25
+ | 'pin'
26
+ // Infrastructure / inventory glyphs
27
+ | 'server'
28
+ | 'hard-drive'
29
+ | 'box'
30
+ | 'image'
31
+ | 'tag'
32
+ | 'pie-chart'
33
+ // People / access / admin glyphs
34
+ | 'users'
35
+ | 'user-plus'
36
+ | 'mail'
37
+ | 'file-text'
38
+ | 'plug'
39
+ // Input / action glyphs
40
+ | 'search'
41
+ | 'mic'
42
+ | 'x'
43
+ // Color-mode glyphs
44
+ | 'sun'
45
+ | 'moon'
46
+ | 'monitor'
47
+ | 'contrast'
48
+ // Device status glyphs
49
+ | 'signal'
50
+ | 'battery'
51
+ // Media glyphs
52
+ | 'video'
53
+ | 'music'
54
+ | 'play'
55
+ | 'pause'
56
+ // Filled variants (solid shape with cutout symbol)
57
+ | 'info-circle-filled'
58
+ | 'alert-triangle-filled'
59
+ | 'check-circle-filled'
60
+ | 'x-circle-filled'
61
+ | 'shield-filled'
62
+ | 'lock-filled'
63
+
64
+ export interface IconProps {
65
+ name: IconName
66
+ /** Token from the icon size scale: sm 16, md 18, lg 24, xl 36, xxl 48. */
67
+ size?: IconSize
68
+ /**
69
+ * Colour token. Default: the surrounding text colour on the web
70
+ * (`currentColor`), the `text` token on native, where an icon cannot
71
+ * inherit a colour.
72
+ */
73
+ color?: ColorToken
74
+ }
@@ -46,6 +46,10 @@ interface InputProps {
46
46
  | 'name'
47
47
  | 'tel'
48
48
  | 'url'
49
+ /** Phone keyboards: how the typed text is capitalised. */
50
+ autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters'
51
+ /** Whether the platform checks (and on phones, autocorrects) the spelling. */
52
+ spellCheck?: boolean
49
53
  value?: string
50
54
  defaultValue?: string
51
55
  disabled?: boolean
@@ -82,6 +86,8 @@ export function Input({
82
86
  list,
83
87
  pattern,
84
88
  autoComplete,
89
+ autoCapitalize,
90
+ spellCheck,
85
91
  value,
86
92
  defaultValue,
87
93
  disabled,
@@ -137,6 +143,8 @@ export function Input({
137
143
  required={required}
138
144
  minLength={minLength}
139
145
  autoComplete={autoComplete}
146
+ autoCapitalize={autoCapitalize}
147
+ spellCheck={spellCheck}
140
148
  value={effectiveValue}
141
149
  defaultValue={defaultValue}
142
150
  disabled={effectiveDisabled}
@@ -8,6 +8,8 @@ import {borders} from '@duro-app/tokens/tokens/borders.css'
8
8
  export const styles = css.create({
9
9
  base: {
10
10
  width: '100%',
11
+ // Native has no border-box reset (the web's global-reset.css); declare it.
12
+ boxSizing: 'border-box',
11
13
  paddingTop: spacing.sm,
12
14
  paddingBottom: spacing.sm,
13
15
  paddingLeft: spacing.md,
@@ -62,5 +62,7 @@ export const styles = css.create({
62
62
  },
63
63
  fullWidth: {
64
64
  width: '100%',
65
+ // Native has no border-box reset (the web's global-reset.css); declare it.
66
+ boxSizing: 'border-box',
65
67
  },
66
68
  })
@@ -8,6 +8,8 @@ export const styles = css.create({
8
8
  track: {
9
9
  position: 'relative',
10
10
  width: '100%',
11
+ // Native has no border-box reset (the web's global-reset.css); declare it.
12
+ boxSizing: 'border-box',
11
13
  height: sizes.meterH,
12
14
  borderRadius: radii.full,
13
15
  backgroundColor: colors.border,
@@ -6,9 +6,13 @@ import {sizes} from '@duro-app/tokens/tokens/sizes.css'
6
6
  export const styles = css.create({
7
7
  root: {
8
8
  width: '100%',
9
+ // Native has no border-box reset (the web's global-reset.css); declare it.
10
+ boxSizing: 'border-box',
9
11
  },
10
12
  container: {
11
13
  width: '100%',
14
+ // Native has no border-box reset (the web's global-reset.css); declare it.
15
+ boxSizing: 'border-box',
12
16
  marginLeft: 'auto',
13
17
  marginRight: 'auto',
14
18
  },
@@ -30,7 +30,7 @@ export const meta: ComponentMeta = {
30
30
  'RadioGroup for form single-select; ToggleGroup for segmented/toolbar single-select',
31
31
  },
32
32
  ],
33
- example: `<RadioGroup.Root defaultValue="email" onValueChange={(v) => console.log(v)}>
33
+ example: `<RadioGroup.Root name="channel" defaultValue="email" onValueChange={(v) => console.log(v)}>
34
34
  <RadioGroup.Item value="email">Email</RadioGroup.Item>
35
35
  <RadioGroup.Item value="sms">SMS</RadioGroup.Item>
36
36
  <RadioGroup.Item value="push">Push notification</RadioGroup.Item>
@@ -0,0 +1,48 @@
1
+ import type {ReactNode} from 'react'
2
+ import {html} from 'react-strict-dom'
3
+ import {styles} from './styles.css'
4
+ import {Root, useRadioGroup} from './group'
5
+
6
+ interface ItemProps {
7
+ value: string
8
+ disabled?: boolean
9
+ children: ReactNode
10
+ }
11
+
12
+ /**
13
+ * Native radio item: RSD renders `<input type="radio">` as a text field on
14
+ * native, so the item is a button with the radio role, drawn like the web one.
15
+ */
16
+ function Item({value, disabled: itemDisabled = false, children}: ItemProps) {
17
+ const {value: groupValue, onSelect, disabled: groupDisabled} = useRadioGroup()
18
+ const isChecked = groupValue === value
19
+ const isDisabled = groupDisabled || itemDisabled
20
+ return (
21
+ <html.button
22
+ type="button"
23
+ role="radio"
24
+ aria-checked={isChecked}
25
+ disabled={isDisabled}
26
+ onClick={() => onSelect(value)}
27
+ style={[styles.item, styles.nativeItem, isDisabled && styles.itemDisabled]}
28
+ >
29
+ {/* div, not span: a native span is a Text, which draws no sized box. */}
30
+ <html.div
31
+ style={[
32
+ styles.circle,
33
+ styles.nativeFlex,
34
+ isChecked ? styles.circleChecked : styles.circleUnchecked,
35
+ ]}
36
+ aria-hidden
37
+ >
38
+ {isChecked && <html.div style={styles.dot} />}
39
+ </html.div>
40
+ {children && <html.span>{children}</html.span>}
41
+ </html.button>
42
+ )
43
+ }
44
+
45
+ export const RadioGroup = {
46
+ Root,
47
+ Item,
48
+ }