@photonhealth/react 0.0.0-stage → 2.0.0-rc.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 (180) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +84 -2
  3. package/dist/adapters/index.d.ts +2 -0
  4. package/dist/adapters/index.d.ts.map +1 -0
  5. package/dist/adapters/index.js +2 -0
  6. package/dist/adapters/index.js.map +1 -0
  7. package/dist/adapters/tailwind.d.ts +3 -0
  8. package/dist/adapters/tailwind.d.ts.map +1 -0
  9. package/dist/adapters/tailwind.js +123 -0
  10. package/dist/adapters/tailwind.js.map +1 -0
  11. package/dist/components/ChangeList.d.ts +21 -0
  12. package/dist/components/ChangeList.d.ts.map +1 -0
  13. package/dist/components/ChangeList.js +40 -0
  14. package/dist/components/ChangeList.js.map +1 -0
  15. package/dist/components/PhotonOrder.d.ts +46 -0
  16. package/dist/components/PhotonOrder.d.ts.map +1 -0
  17. package/dist/components/PhotonOrder.js +270 -0
  18. package/dist/components/PhotonOrder.js.map +1 -0
  19. package/dist/components/PhotonPatient.d.ts +48 -0
  20. package/dist/components/PhotonPatient.d.ts.map +1 -0
  21. package/dist/components/PhotonPatient.js +83 -0
  22. package/dist/components/PhotonPatient.js.map +1 -0
  23. package/dist/components/PhotonPrescription.d.ts +43 -0
  24. package/dist/components/PhotonPrescription.d.ts.map +1 -0
  25. package/dist/components/PhotonPrescription.js +364 -0
  26. package/dist/components/PhotonPrescription.js.map +1 -0
  27. package/dist/components/ScreeningAlerts.d.ts +6 -0
  28. package/dist/components/ScreeningAlerts.d.ts.map +1 -0
  29. package/dist/components/ScreeningAlerts.js +11 -0
  30. package/dist/components/ScreeningAlerts.js.map +1 -0
  31. package/dist/components/SignedIn.d.ts +12 -0
  32. package/dist/components/SignedIn.d.ts.map +1 -0
  33. package/dist/components/SignedIn.js +84 -0
  34. package/dist/components/SignedIn.js.map +1 -0
  35. package/dist/components/TreatmentPicker.d.ts +45 -0
  36. package/dist/components/TreatmentPicker.d.ts.map +1 -0
  37. package/dist/components/TreatmentPicker.js +279 -0
  38. package/dist/components/TreatmentPicker.js.map +1 -0
  39. package/dist/components/activity.d.ts +7 -0
  40. package/dist/components/activity.d.ts.map +1 -0
  41. package/dist/components/activity.js +24 -0
  42. package/dist/components/activity.js.map +1 -0
  43. package/dist/components/display.d.ts +90 -0
  44. package/dist/components/display.d.ts.map +1 -0
  45. package/dist/components/display.js +223 -0
  46. package/dist/components/display.js.map +1 -0
  47. package/dist/components/flow.d.ts +35 -0
  48. package/dist/components/flow.d.ts.map +1 -0
  49. package/dist/components/flow.js +53 -0
  50. package/dist/components/flow.js.map +1 -0
  51. package/dist/components/format.d.ts +26 -0
  52. package/dist/components/format.d.ts.map +1 -0
  53. package/dist/components/format.js +61 -0
  54. package/dist/components/format.js.map +1 -0
  55. package/dist/components/index.d.ts +6 -0
  56. package/dist/components/index.d.ts.map +1 -0
  57. package/dist/components/index.js +6 -0
  58. package/dist/components/index.js.map +1 -0
  59. package/dist/components/open.d.ts +47 -0
  60. package/dist/components/open.d.ts.map +1 -0
  61. package/dist/components/open.js +73 -0
  62. package/dist/components/open.js.map +1 -0
  63. package/dist/components/patient/Benefits.d.ts +25 -0
  64. package/dist/components/patient/Benefits.d.ts.map +1 -0
  65. package/dist/components/patient/Benefits.js +47 -0
  66. package/dist/components/patient/Benefits.js.map +1 -0
  67. package/dist/components/patient/Clinical.d.ts +55 -0
  68. package/dist/components/patient/Clinical.d.ts.map +1 -0
  69. package/dist/components/patient/Clinical.js +117 -0
  70. package/dist/components/patient/Clinical.js.map +1 -0
  71. package/dist/components/patient/IntakeForm.d.ts +10 -0
  72. package/dist/components/patient/IntakeForm.d.ts.map +1 -0
  73. package/dist/components/patient/IntakeForm.js +324 -0
  74. package/dist/components/patient/IntakeForm.js.map +1 -0
  75. package/dist/components/patient/Summary.d.ts +48 -0
  76. package/dist/components/patient/Summary.d.ts.map +1 -0
  77. package/dist/components/patient/Summary.js +80 -0
  78. package/dist/components/patient/Summary.js.map +1 -0
  79. package/dist/components/patient/fields.d.ts +43 -0
  80. package/dist/components/patient/fields.d.ts.map +1 -0
  81. package/dist/components/patient/fields.js +71 -0
  82. package/dist/components/patient/fields.js.map +1 -0
  83. package/dist/components/patient/query.d.ts +23 -0
  84. package/dist/components/patient/query.d.ts.map +1 -0
  85. package/dist/components/patient/query.js +65 -0
  86. package/dist/components/patient/query.js.map +1 -0
  87. package/dist/components/search.d.ts +154 -0
  88. package/dist/components/search.d.ts.map +1 -0
  89. package/dist/components/search.js +295 -0
  90. package/dist/components/search.js.map +1 -0
  91. package/dist/hooks/index.d.ts +5 -0
  92. package/dist/hooks/index.d.ts.map +1 -0
  93. package/dist/hooks/index.js +5 -0
  94. package/dist/hooks/index.js.map +1 -0
  95. package/dist/hooks/useLatestCallback.d.ts +7 -0
  96. package/dist/hooks/useLatestCallback.d.ts.map +1 -0
  97. package/dist/hooks/useLatestCallback.js +14 -0
  98. package/dist/hooks/useLatestCallback.js.map +1 -0
  99. package/dist/hooks/useLive.d.ts +15 -0
  100. package/dist/hooks/useLive.d.ts.map +1 -0
  101. package/dist/hooks/useLive.js +6 -0
  102. package/dist/hooks/useLive.js.map +1 -0
  103. package/dist/hooks/useOnChange.d.ts +11 -0
  104. package/dist/hooks/useOnChange.d.ts.map +1 -0
  105. package/dist/hooks/useOnChange.js +28 -0
  106. package/dist/hooks/useOnChange.js.map +1 -0
  107. package/dist/hooks/useSession.d.ts +7 -0
  108. package/dist/hooks/useSession.d.ts.map +1 -0
  109. package/dist/hooks/useSession.js +10 -0
  110. package/dist/hooks/useSession.js.map +1 -0
  111. package/dist/index.d.ts +20 -0
  112. package/dist/index.d.ts.map +1 -0
  113. package/dist/index.js +19 -0
  114. package/dist/index.js.map +1 -0
  115. package/dist/primitives/PhotonProvider.d.ts +58 -0
  116. package/dist/primitives/PhotonProvider.d.ts.map +1 -0
  117. package/dist/primitives/PhotonProvider.js +91 -0
  118. package/dist/primitives/PhotonProvider.js.map +1 -0
  119. package/dist/primitives/defaults.d.ts +3 -0
  120. package/dist/primitives/defaults.d.ts.map +1 -0
  121. package/dist/primitives/defaults.js +67 -0
  122. package/dist/primitives/defaults.js.map +1 -0
  123. package/dist/primitives/icons.d.ts +6 -0
  124. package/dist/primitives/icons.d.ts.map +1 -0
  125. package/dist/primitives/icons.js +6 -0
  126. package/dist/primitives/icons.js.map +1 -0
  127. package/dist/primitives/index.d.ts +5 -0
  128. package/dist/primitives/index.d.ts.map +1 -0
  129. package/dist/primitives/index.js +5 -0
  130. package/dist/primitives/index.js.map +1 -0
  131. package/dist/primitives/select.d.ts +7 -0
  132. package/dist/primitives/select.d.ts.map +1 -0
  133. package/dist/primitives/select.js +16 -0
  134. package/dist/primitives/select.js.map +1 -0
  135. package/dist/primitives/types.d.ts +276 -0
  136. package/dist/primitives/types.d.ts.map +1 -0
  137. package/dist/primitives/types.js +3 -0
  138. package/dist/primitives/types.js.map +1 -0
  139. package/dist/styles.css +611 -0
  140. package/dist/test-utils/contract.d.ts +17 -0
  141. package/dist/test-utils/contract.d.ts.map +1 -0
  142. package/dist/test-utils/contract.js +261 -0
  143. package/dist/test-utils/contract.js.map +1 -0
  144. package/package.json +74 -4
  145. package/src/adapters/index.ts +1 -0
  146. package/src/adapters/tailwind.tsx +544 -0
  147. package/src/components/ChangeList.tsx +85 -0
  148. package/src/components/PhotonOrder.tsx +493 -0
  149. package/src/components/PhotonPatient.tsx +184 -0
  150. package/src/components/PhotonPrescription.tsx +605 -0
  151. package/src/components/ScreeningAlerts.tsx +28 -0
  152. package/src/components/SignedIn.tsx +144 -0
  153. package/src/components/TreatmentPicker.tsx +350 -0
  154. package/src/components/activity.ts +23 -0
  155. package/src/components/display.ts +278 -0
  156. package/src/components/flow.ts +67 -0
  157. package/src/components/format.ts +73 -0
  158. package/src/components/index.ts +5 -0
  159. package/src/components/open.ts +100 -0
  160. package/src/components/patient/Benefits.tsx +125 -0
  161. package/src/components/patient/Clinical.tsx +210 -0
  162. package/src/components/patient/IntakeForm.tsx +532 -0
  163. package/src/components/patient/Summary.tsx +310 -0
  164. package/src/components/patient/fields.tsx +144 -0
  165. package/src/components/patient/query.ts +77 -0
  166. package/src/components/search.tsx +377 -0
  167. package/src/hooks/index.ts +4 -0
  168. package/src/hooks/useLatestCallback.ts +16 -0
  169. package/src/hooks/useLive.ts +21 -0
  170. package/src/hooks/useOnChange.ts +34 -0
  171. package/src/hooks/useSession.ts +11 -0
  172. package/src/index.ts +19 -0
  173. package/src/primitives/PhotonProvider.tsx +153 -0
  174. package/src/primitives/defaults.tsx +409 -0
  175. package/src/primitives/icons.tsx +37 -0
  176. package/src/primitives/index.ts +4 -0
  177. package/src/primitives/select.ts +15 -0
  178. package/src/primitives/types.ts +276 -0
  179. package/src/styles.css +611 -0
  180. package/src/test-utils/contract.tsx +410 -0
package/src/styles.css ADDED
@@ -0,0 +1,611 @@
1
+ /*
2
+ * @photonhealth/react — optional structural styles for the unstyled defaults.
3
+ *
4
+ * Adopts the host page: fonts, sizes and colours are inherited; spacing is in
5
+ * em so it scales with the page's type; accents use the system AccentColor.
6
+ * Every rule is wrapped in :where() (zero specificity), so any host style wins.
7
+ *
8
+ * Tune without overriding selectors:
9
+ * --prx-accent interactive colour (default AccentColor)
10
+ * --prx-border hairlines (default: currentColor at 20%)
11
+ * --prx-radius corner radius (default 0.5em)
12
+ * --prx-surface card background (default transparent)
13
+ * --prx-on-accent text on accent buttons (default white)
14
+ * --prx-warning / --prx-critical / --prx-success / --prx-info status tints
15
+ */
16
+
17
+ :where([class^="prx-"], [class*=" prx-"]) {
18
+ box-sizing: border-box;
19
+ }
20
+
21
+ :where([data-gap="1"]) {
22
+ gap: 0.25em;
23
+ }
24
+ :where([data-gap="2"]) {
25
+ gap: 0.5em;
26
+ }
27
+ :where([data-gap="3"]) {
28
+ gap: 0.75em;
29
+ }
30
+ :where([data-gap="4"]) {
31
+ gap: 1em;
32
+ }
33
+ :where([data-gap="6"]) {
34
+ gap: 1.5em;
35
+ }
36
+
37
+ :where(.prx-stack) {
38
+ display: flex;
39
+ flex-direction: column;
40
+ }
41
+ :where(.prx-stack[data-align="start"]) {
42
+ align-items: flex-start;
43
+ }
44
+ :where(.prx-stack[data-align="end"]) {
45
+ align-items: flex-end;
46
+ }
47
+ :where(.prx-row) {
48
+ display: flex;
49
+ flex-wrap: wrap;
50
+ align-items: center;
51
+ }
52
+ :where(.prx-row[data-align="start"]) {
53
+ align-items: flex-start;
54
+ }
55
+ :where(.prx-row[data-align="end"]) {
56
+ align-items: flex-end;
57
+ }
58
+ :where(.prx-row[data-justify="between"]) {
59
+ justify-content: space-between;
60
+ }
61
+ :where(.prx-row[data-justify="end"]) {
62
+ justify-content: flex-end;
63
+ }
64
+ :where(.prx-grid) {
65
+ display: grid;
66
+ }
67
+ :where(.prx-container) {
68
+ max-width: 35em;
69
+ margin-inline: auto;
70
+ }
71
+
72
+ :where(.prx-page-header h1) {
73
+ margin: 0;
74
+ font-size: 1.5em;
75
+ }
76
+ :where(.prx-page-header p) {
77
+ margin: 0.25em 0 0;
78
+ opacity: 0.75;
79
+ }
80
+ :where(.prx-text[data-tone="secondary"]) {
81
+ opacity: 0.8;
82
+ }
83
+ :where(.prx-text[data-tone="tertiary"]) {
84
+ opacity: 0.65;
85
+ }
86
+
87
+ :where(.prx-card) {
88
+ border: 1px solid var(--prx-border, color-mix(in srgb, currentColor 20%, transparent));
89
+ border-radius: var(--prx-radius, 0.5em);
90
+ background: var(--prx-surface, transparent);
91
+ }
92
+ :where(.prx-card-header, .prx-card-body, .prx-card-footer) {
93
+ padding: 1em;
94
+ }
95
+ :where(.prx-card[data-divided] > * + *) {
96
+ border-top: 1px solid var(--prx-border, color-mix(in srgb, currentColor 20%, transparent));
97
+ }
98
+ :where(.prx-card-header) {
99
+ display: flex;
100
+ justify-content: space-between;
101
+ gap: 1em;
102
+ align-items: flex-start;
103
+ }
104
+ :where(.prx-card-title) {
105
+ margin: 0;
106
+ font-size: 1.05em;
107
+ }
108
+ :where(.prx-card-description) {
109
+ margin: 0.25em 0 0;
110
+ opacity: 0.75;
111
+ }
112
+ :where(.prx-card-footer) {
113
+ display: flex;
114
+ justify-content: flex-end;
115
+ align-items: center;
116
+ gap: 0.5em;
117
+ flex-wrap: wrap;
118
+ }
119
+ :where(.prx-card-footer-start) {
120
+ margin-right: auto;
121
+ }
122
+ :where(.prx-spinner-status) {
123
+ display: inline-flex;
124
+ align-items: center;
125
+ gap: 0.5em;
126
+ font-size: 0.875em;
127
+ opacity: 0.75;
128
+ }
129
+ :where(.prx-spinner) {
130
+ width: 1em;
131
+ height: 1em;
132
+ border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
133
+ border-top-color: currentColor;
134
+ border-radius: 50%;
135
+ animation: prx-spin var(--prx-spin-duration, 0.8s) linear infinite;
136
+ }
137
+ @keyframes prx-spin {
138
+ to {
139
+ transform: rotate(360deg);
140
+ }
141
+ }
142
+ @media (prefers-reduced-motion: reduce) {
143
+ :where(.prx-spinner) {
144
+ animation: none;
145
+ }
146
+ }
147
+
148
+ :where(.prx-field) {
149
+ display: flex;
150
+ flex-direction: column;
151
+ gap: 0.25em;
152
+ min-width: 0;
153
+ }
154
+ :where(.prx-label) {
155
+ font-size: 0.85em;
156
+ font-weight: 600;
157
+ }
158
+ :where(.prx-note) {
159
+ font-size: 0.85em;
160
+ min-height: 1.2em;
161
+ opacity: 0.75;
162
+ }
163
+ :where(.prx-field[data-invalid] .prx-note) {
164
+ color: var(--prx-critical, #d92d20);
165
+ opacity: 1;
166
+ }
167
+ :where(.prx-input) {
168
+ font: inherit;
169
+ color: inherit;
170
+ background: transparent;
171
+ border: 1px solid var(--prx-border, color-mix(in srgb, currentColor 20%, transparent));
172
+ border-radius: var(--prx-radius, 0.5em);
173
+ padding: 0.5em 0.65em;
174
+ width: 100%;
175
+ box-sizing: border-box;
176
+ }
177
+ :where(.prx-input:focus-visible, .prx-button:focus-visible) {
178
+ outline: 2px solid var(--prx-accent, AccentColor);
179
+ outline-offset: 2px;
180
+ }
181
+ :where(.prx-input-wrap) {
182
+ position: relative;
183
+ display: block;
184
+ }
185
+ :where(.prx-spinner) {
186
+ position: absolute;
187
+ right: 0.65em;
188
+ top: 50%;
189
+ width: 1em;
190
+ height: 1em;
191
+ margin-top: -0.5em;
192
+ border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
193
+ border-top-color: var(--prx-accent, AccentColor);
194
+ border-radius: 50%;
195
+ animation: prx-spin var(--prx-spin-duration, 0.8s) linear infinite;
196
+ }
197
+ @keyframes prx-spin {
198
+ to {
199
+ transform: rotate(360deg);
200
+ }
201
+ }
202
+ @media (prefers-reduced-motion: reduce) {
203
+ :where(.prx-spinner) {
204
+ animation: none;
205
+ }
206
+ }
207
+ :where(.prx-check) {
208
+ display: inline-flex;
209
+ gap: 0.5em;
210
+ align-items: center;
211
+ }
212
+ :where(.prx-radio-group) {
213
+ border: 0;
214
+ padding: 0;
215
+ margin: 0;
216
+ display: flex;
217
+ flex-direction: column;
218
+ gap: 0.5em;
219
+ }
220
+ :where(.prx-radio-group[data-horizontal]) {
221
+ flex-direction: row;
222
+ flex-wrap: wrap;
223
+ }
224
+
225
+ :where(.prx-button) {
226
+ font: inherit;
227
+ cursor: pointer;
228
+ border-radius: var(--prx-radius, 0.5em);
229
+ padding: 0.5em 1em;
230
+ border: 1px solid var(--prx-accent, AccentColor);
231
+ background: var(--prx-accent, AccentColor);
232
+ color: var(--prx-on-accent, white);
233
+ }
234
+ :where(.prx-button[data-variant="secondary"]) {
235
+ background: transparent;
236
+ color: var(--prx-accent, AccentColor);
237
+ border-color: var(--prx-accent, AccentColor);
238
+ }
239
+ :where(.prx-button[data-variant="ghost"]) {
240
+ background: transparent;
241
+ color: var(--prx-accent, AccentColor);
242
+ border-color: transparent;
243
+ }
244
+ :where(.prx-button[data-variant="secondary"]:hover, .prx-button[data-variant="ghost"]:hover) {
245
+ background: color-mix(in srgb, var(--prx-accent, AccentColor) 8%, transparent);
246
+ }
247
+ :where(.prx-button[data-tone="critical"]) {
248
+ color: var(--prx-critical, #d92d20);
249
+ }
250
+ :where(.prx-button[data-tone="critical"]:hover) {
251
+ background: color-mix(in srgb, var(--prx-critical, #d92d20) 8%, transparent);
252
+ }
253
+ :where(.prx-button[data-variant="danger"]) {
254
+ background: var(--prx-critical, #d92d20);
255
+ border-color: var(--prx-critical, #d92d20);
256
+ color: white;
257
+ }
258
+ :where(.prx-button[data-size="sm"]) {
259
+ padding: 0.3em 0.7em;
260
+ font-size: 0.9em;
261
+ }
262
+ :where(.prx-button[data-size="lg"]) {
263
+ padding: 0.7em 1.4em;
264
+ }
265
+ :where(.prx-icon) {
266
+ width: 1.25em;
267
+ height: 1.25em;
268
+ display: block;
269
+ }
270
+ :where(.prx-button:not([data-icon])) {
271
+ display: inline-flex;
272
+ align-items: center;
273
+ gap: 0.4em;
274
+ }
275
+ :where(.prx-button:not([data-icon]) .prx-icon) {
276
+ width: 1em;
277
+ height: 1em;
278
+ }
279
+ :where(.prx-button[data-icon]) {
280
+ padding: 0.35em;
281
+ line-height: 0;
282
+ }
283
+ :where(.prx-badge-remove .prx-icon) {
284
+ width: 1em;
285
+ height: 1em;
286
+ }
287
+ :where(.prx-button:disabled) {
288
+ opacity: 0.5;
289
+ cursor: not-allowed;
290
+ }
291
+ :where(.prx-button[data-loading]) {
292
+ cursor: progress;
293
+ }
294
+
295
+ /* Rows like OptionList's (.prx-option): separate cards; keyboard focus reads as its selected row. */
296
+ :where(.prx-choices) {
297
+ list-style: none;
298
+ margin: 0;
299
+ padding: 0;
300
+ display: flex;
301
+ flex-direction: column;
302
+ gap: 0.5em;
303
+ }
304
+ :where(.prx-choice) {
305
+ font: inherit;
306
+ color: inherit;
307
+ background: none;
308
+ width: 100%;
309
+ text-align: left;
310
+ padding: 0.75em 1em;
311
+ border: 1px solid var(--prx-border, color-mix(in srgb, currentColor 20%, transparent));
312
+ border-radius: var(--prx-radius, 0.5em);
313
+ cursor: pointer;
314
+ display: flex;
315
+ align-items: center;
316
+ gap: 0.75em;
317
+ }
318
+ :where(.prx-choice-text) {
319
+ flex: 1;
320
+ min-width: 0;
321
+ display: flex;
322
+ flex-direction: column;
323
+ gap: 0.15em;
324
+ }
325
+ /* What Return would take: shown on the row the keys are on, so it answers "and now what?". Keyboard only —
326
+ a pointer doesn't need telling. */
327
+ :where(.prx-choice-return) {
328
+ flex: none;
329
+ width: 1.15em;
330
+ height: 1.15em;
331
+ visibility: hidden;
332
+ }
333
+ :where(.prx-choice:focus-visible .prx-choice-return),
334
+ :where(.prx-choice-active .prx-choice-return) {
335
+ visibility: visible;
336
+ }
337
+ /* Driven by a field that keeps the cursor: the row the keys are on is marked, not focused, so it has to
338
+ look the way a focused one does. */
339
+ :where(li.prx-choice) {
340
+ list-style: none;
341
+ cursor: pointer;
342
+ }
343
+ :where(.prx-choice-active) {
344
+ border-color: var(--prx-accent, AccentColor);
345
+ box-shadow: inset 0 0 0 1px var(--prx-accent, AccentColor);
346
+ background: color-mix(in srgb, var(--prx-accent, AccentColor) 6%, transparent);
347
+ }
348
+ /* The way out of the list: the same row and width as a choice, so the keys run through it — but no border
349
+ until it has focus, because it isn't one of the people above it. */
350
+ :where(.prx-choice-action) {
351
+ border-color: transparent;
352
+ color: var(--prx-accent, AccentColor);
353
+ }
354
+ :where(.prx-choice-action:focus-visible),
355
+ :where(.prx-choice-action.prx-choice-active) {
356
+ border-color: var(--prx-accent, AccentColor);
357
+ }
358
+ :where(.prx-choice:hover) {
359
+ background: color-mix(in srgb, var(--prx-accent, AccentColor) 8%, transparent);
360
+ }
361
+ :where(.prx-choice:focus-visible, .prx-choice[aria-busy="true"]) {
362
+ outline: none;
363
+ border-color: var(--prx-accent, AccentColor);
364
+ box-shadow: inset 0 0 0 1px var(--prx-accent, AccentColor);
365
+ background: color-mix(in srgb, var(--prx-accent, AccentColor) 6%, transparent);
366
+ }
367
+ :where(.prx-choice:disabled) {
368
+ opacity: 0.5;
369
+ cursor: not-allowed;
370
+ }
371
+ :where(.prx-choice-line) {
372
+ display: flex;
373
+ flex-wrap: wrap;
374
+ align-items: baseline;
375
+ column-gap: 0.5em;
376
+ }
377
+ :where(.prx-choice-description) {
378
+ font-size: 0.85em;
379
+ opacity: 0.7;
380
+ }
381
+ :where(.prx-options) {
382
+ display: flex;
383
+ flex-direction: column;
384
+ gap: 0.6em;
385
+ border-radius: var(--prx-radius, 0.5em);
386
+ }
387
+ :where(.prx-options:focus-visible) {
388
+ outline: none; /* the selected row shows where focus is */
389
+ }
390
+ :where(.prx-options-list) {
391
+ list-style: none;
392
+ margin: 0;
393
+ padding: 0;
394
+ display: flex;
395
+ flex-direction: column;
396
+ gap: 0.5em;
397
+ }
398
+ :where(.prx-option) {
399
+ font: inherit;
400
+ color: inherit;
401
+ background: none;
402
+ width: 100%;
403
+ text-align: left;
404
+ padding: 0.75em 1em;
405
+ border: 1px solid var(--prx-border, color-mix(in srgb, currentColor 20%, transparent));
406
+ border-radius: var(--prx-radius, 0.5em);
407
+ display: flex;
408
+ flex-direction: column;
409
+ gap: 0.75em;
410
+ }
411
+ :where(button.prx-option) {
412
+ cursor: pointer;
413
+ }
414
+ :where(button.prx-option:hover, button.prx-option:focus-visible) {
415
+ background: color-mix(in srgb, var(--prx-accent, AccentColor) 8%, transparent);
416
+ outline: none;
417
+ }
418
+ :where(.prx-option[data-active][data-selected]) {
419
+ border-color: var(--prx-accent, AccentColor);
420
+ box-shadow: inset 0 0 0 1px var(--prx-accent, AccentColor);
421
+ background: color-mix(in srgb, var(--prx-accent, AccentColor) 6%, transparent);
422
+ }
423
+ :where(.prx-option[data-active] .prx-option-label) {
424
+ font-weight: 600;
425
+ }
426
+ :where(.prx-option-row) {
427
+ display: flex;
428
+ align-items: center;
429
+ gap: 0.6em;
430
+ }
431
+ :where(.prx-option-text) {
432
+ display: flex;
433
+ flex-direction: column;
434
+ gap: 0.15em;
435
+ }
436
+ :where(.prx-toggle-group) {
437
+ display: flex;
438
+ flex-direction: column;
439
+ gap: 0.5em;
440
+ }
441
+ :where(.prx-toggle-label) {
442
+ font-size: 0.85em;
443
+ }
444
+ :where(.prx-toggles) {
445
+ display: flex;
446
+ flex-wrap: wrap;
447
+ gap: 0.5em;
448
+ }
449
+ :where(.prx-toggle) {
450
+ font: inherit;
451
+ color: inherit;
452
+ background: none;
453
+ cursor: pointer;
454
+ padding: 0.45em 0.9em;
455
+ border: 1px solid var(--prx-border, color-mix(in srgb, currentColor 20%, transparent));
456
+ border-radius: var(--prx-radius, 0.5em);
457
+ display: inline-flex;
458
+ align-items: baseline;
459
+ gap: 0.4em;
460
+ }
461
+ :where(.prx-toggle[aria-pressed="true"]) {
462
+ background: var(--prx-accent, AccentColor);
463
+ border-color: var(--prx-accent, AccentColor);
464
+ color: var(--prx-on-accent, white);
465
+ font-weight: 600;
466
+ }
467
+ :where(.prx-toggle[data-muted]:not([aria-pressed="true"])) {
468
+ opacity: 0.45;
469
+ }
470
+ :where(.prx-toggle:disabled) {
471
+ opacity: 0.5;
472
+ cursor: not-allowed;
473
+ }
474
+ :where(.prx-option-chevron) {
475
+ margin-left: auto;
476
+ opacity: 0.5;
477
+ }
478
+ /* The view's primary action, in flow: right-aligned under the content. Where it sits on a page
479
+ (pinned, in a footer, in a dialog's buttons) is the host's call. */
480
+ :where(.prx-action-bar) {
481
+ display: flex;
482
+ justify-content: flex-end;
483
+ align-items: center;
484
+ gap: 1em;
485
+ }
486
+ /* Narrow containers (a phone, a dialog, a side panel): chips share the row evenly, for thumbs. A
487
+ container query, not a viewport one: the cards can sit at any width on any screen. */
488
+ :where(.prx-toggle-group) {
489
+ container-type: inline-size;
490
+ }
491
+ @container (max-width: 28em) {
492
+ :where(.prx-toggle) {
493
+ flex: 1 1 calc(33.333% - 0.5em);
494
+ justify-content: center;
495
+ }
496
+ }
497
+ :where(.prx-alert) {
498
+ display: flex;
499
+ justify-content: space-between;
500
+ gap: 1em;
501
+ padding: 0.75em 1em;
502
+ border-radius: var(--prx-radius, 0.5em);
503
+ border-left: 0.25em solid var(--prx-info, var(--prx-accent, AccentColor));
504
+ background: color-mix(in srgb, var(--prx-info, var(--prx-accent, AccentColor)) 8%, transparent);
505
+ }
506
+ :where(.prx-alert[data-tone="warning"]) {
507
+ border-left-color: var(--prx-warning, #b54708);
508
+ background: color-mix(in srgb, var(--prx-warning, #b54708) 8%, transparent);
509
+ }
510
+ :where(.prx-alert[data-tone="critical"]) {
511
+ border-left-color: var(--prx-critical, #d92d20);
512
+ background: color-mix(in srgb, var(--prx-critical, #d92d20) 8%, transparent);
513
+ }
514
+ :where(.prx-alert[data-tone="success"]) {
515
+ border-left-color: var(--prx-success, #067647);
516
+ background: color-mix(in srgb, var(--prx-success, #067647) 8%, transparent);
517
+ }
518
+ :where(.prx-alert[data-tone="neutral"]) {
519
+ border-left-color: var(--prx-border, color-mix(in srgb, currentColor 20%, transparent));
520
+ background: transparent;
521
+ }
522
+ :where(.prx-alert-description) {
523
+ margin-top: 0.25em;
524
+ }
525
+
526
+ :where(.prx-badge) {
527
+ display: inline-block;
528
+ font-size: 0.8em;
529
+ padding: 0.1em 0.6em;
530
+ border-radius: 999px;
531
+ border: 1px solid var(--prx-border, color-mix(in srgb, currentColor 20%, transparent));
532
+ }
533
+ :where(.prx-badge-remove) {
534
+ font: inherit;
535
+ color: inherit;
536
+ background: none;
537
+ border: 0;
538
+ padding: 0 0 0 0.35em;
539
+ cursor: pointer;
540
+ opacity: 0.7;
541
+ }
542
+ :where(.prx-badge-remove:hover) {
543
+ opacity: 1;
544
+ }
545
+ :where(.prx-badge-remove:focus-visible) {
546
+ outline: 2px solid var(--prx-accent, AccentColor);
547
+ outline-offset: 1px;
548
+ }
549
+ :where(.prx-badge[data-tone="warning"]) {
550
+ border-color: var(--prx-warning, #b54708);
551
+ color: var(--prx-warning, #b54708);
552
+ }
553
+ :where(.prx-badge[data-tone="critical"]) {
554
+ border-color: var(--prx-critical, #d92d20);
555
+ color: var(--prx-critical, #d92d20);
556
+ }
557
+ :where(.prx-badge[data-tone="success"]) {
558
+ border-color: var(--prx-success, #067647);
559
+ color: var(--prx-success, #067647);
560
+ }
561
+ :where(.prx-badge[data-tone="info"]) {
562
+ border-color: var(--prx-info, var(--prx-accent, AccentColor));
563
+ color: var(--prx-info, var(--prx-accent, AccentColor));
564
+ }
565
+
566
+ :where(.prx-disclosure) {
567
+ display: flex;
568
+ flex-direction: column;
569
+ gap: 0.75em;
570
+ }
571
+ :where(.prx-disclosure-toggle) {
572
+ font: inherit;
573
+ color: inherit;
574
+ background: none;
575
+ border: 0;
576
+ padding: 0;
577
+ display: flex;
578
+ align-items: center;
579
+ gap: 0.35em;
580
+ width: 100%;
581
+ text-align: left;
582
+ cursor: pointer;
583
+ opacity: 0.8;
584
+ border-radius: var(--prx-radius, 0.5em);
585
+ }
586
+ :where(.prx-disclosure-toggle:hover) {
587
+ opacity: 1;
588
+ }
589
+ :where(.prx-disclosure-toggle:focus-visible) {
590
+ outline: 2px solid var(--prx-accent, AccentColor);
591
+ outline-offset: 2px;
592
+ }
593
+ :where(.prx-disclosure-chevron) {
594
+ width: 1em;
595
+ height: 1em;
596
+ flex: none;
597
+ }
598
+ :where(.prx-disclosure[data-open] .prx-disclosure-chevron) {
599
+ transform: rotate(90deg);
600
+ }
601
+
602
+ @media (prefers-reduced-motion: no-preference) {
603
+ :where(.prx-disclosure-chevron) {
604
+ transition: transform 0.14s;
605
+ }
606
+ :where(.prx-button, .prx-input) {
607
+ transition:
608
+ border-color 0.14s,
609
+ background-color 0.14s;
610
+ }
611
+ }