@oxy.so/bloom 4.34.0 → 4.34.2

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 (54) hide show
  1. package/docs/mail-list.mdx +22 -22
  2. package/docs/settings-modal.mdx +1 -1
  3. package/lib/commonjs/mail-list/MailList.js +2 -0
  4. package/lib/commonjs/mail-list/MailList.js.map +1 -1
  5. package/lib/commonjs/mail-list/MailRow.js +26 -29
  6. package/lib/commonjs/mail-list/MailRow.js.map +1 -1
  7. package/lib/commonjs/mail-list/shared.js +26 -10
  8. package/lib/commonjs/mail-list/shared.js.map +1 -1
  9. package/lib/commonjs/settings-modal/SettingsModal.js +12 -18
  10. package/lib/commonjs/settings-modal/SettingsModal.js.map +1 -1
  11. package/lib/module/mail-list/MailList.js +2 -0
  12. package/lib/module/mail-list/MailList.js.map +1 -1
  13. package/lib/module/mail-list/MailRow.js +26 -29
  14. package/lib/module/mail-list/MailRow.js.map +1 -1
  15. package/lib/module/mail-list/shared.js +26 -10
  16. package/lib/module/mail-list/shared.js.map +1 -1
  17. package/lib/module/settings-modal/SettingsModal.js +12 -18
  18. package/lib/module/settings-modal/SettingsModal.js.map +1 -1
  19. package/lib/typescript/commonjs/mail-list/MailList.d.ts +1 -1
  20. package/lib/typescript/commonjs/mail-list/MailList.d.ts.map +1 -1
  21. package/lib/typescript/commonjs/mail-list/MailRow.d.ts +5 -20
  22. package/lib/typescript/commonjs/mail-list/MailRow.d.ts.map +1 -1
  23. package/lib/typescript/commonjs/mail-list/shared.d.ts +2 -9
  24. package/lib/typescript/commonjs/mail-list/shared.d.ts.map +1 -1
  25. package/lib/typescript/commonjs/mail-list/types.d.ts +8 -6
  26. package/lib/typescript/commonjs/mail-list/types.d.ts.map +1 -1
  27. package/lib/typescript/commonjs/settings-modal/SettingsModal.d.ts.map +1 -1
  28. package/lib/typescript/module/mail-list/MailList.d.ts +1 -1
  29. package/lib/typescript/module/mail-list/MailList.d.ts.map +1 -1
  30. package/lib/typescript/module/mail-list/MailRow.d.ts +5 -20
  31. package/lib/typescript/module/mail-list/MailRow.d.ts.map +1 -1
  32. package/lib/typescript/module/mail-list/shared.d.ts +2 -9
  33. package/lib/typescript/module/mail-list/shared.d.ts.map +1 -1
  34. package/lib/typescript/module/mail-list/types.d.ts +8 -6
  35. package/lib/typescript/module/mail-list/types.d.ts.map +1 -1
  36. package/lib/typescript/module/settings-modal/SettingsModal.d.ts.map +1 -1
  37. package/package.json +1 -1
  38. package/src/__tests__/support/adoption-matrix.ts +708 -0
  39. package/src/__tests__/support/collision-fixture-barrel.ts +20 -0
  40. package/src/__tests__/support/commerce-harness.tsx +97 -0
  41. package/src/__tests__/support/composite.ts +68 -0
  42. package/src/__tests__/support/constructed-style-sheets.ts +68 -0
  43. package/src/__tests__/support/press-host.ts +30 -0
  44. package/src/__tests__/support/rendered-style.ts +99 -0
  45. package/src/__tests__/support/unread-hook-fixture.ts +33 -0
  46. package/src/__tests__/support/worklet-capture-fixture.tsx +28 -0
  47. package/src/mail-list/MailList.tsx +2 -0
  48. package/src/mail-list/MailRow.tsx +24 -33
  49. package/src/mail-list/shared.ts +27 -10
  50. package/src/mail-list/types.ts +8 -6
  51. package/src/settings-modal/SettingsModal.tsx +12 -15
  52. package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +9346 -0
  53. package/src/theme/__tests__/__fixtures__/tonal-glass-primary-failures.json +69 -0
  54. package/src/theme/__tests__/fixtures/color-engine-golden.json +1 -0
@@ -5,13 +5,11 @@ import type { BloomIconComponent } from '../icons/icon-component';
5
5
  import type { AccentTone } from '../theme/accent-colors';
6
6
 
7
7
  /**
8
- * The two rungs of ONE row, not two components.
9
- *
10
- * `comfortable` is the phone inbox: avatar, three lines, 88 tall. `compact` is
11
- * the desktop list: one line, 40 tall, the same facts on a single baseline.
12
- * Nothing but the geometry table changes between them.
8
+ * One row at three densities: compact is a single 40px baseline, comfortable
9
+ * stacks two lines at a 64px floor, cozy keeps those lines with an 80px floor
10
+ * and a larger avatar and insets. All share the same content and actions.
13
11
  */
14
- export type MailDensity = 'comfortable' | 'compact';
12
+ export type MailDensity = 'comfortable' | 'cozy' | 'compact';
15
13
 
16
14
  /** Who a message is from, as a row draws them. */
17
15
  export interface MailSender {
@@ -154,6 +152,8 @@ export interface MailRowProps {
154
152
  */
155
153
  checked?: boolean;
156
154
  onCheckedChange?: (checked: boolean) => void;
155
+ /** Show sender avatars. Selection checkboxes remain visible when enabled. */
156
+ showAvatar?: boolean;
157
157
  density?: MailDensity;
158
158
  onPress?: () => void;
159
159
  onLongPress?: () => void;
@@ -203,6 +203,8 @@ export interface MailListProps {
203
203
  sections?: readonly MailListSection[];
204
204
  /** One unlabelled run, for a list that is not bucketed. */
205
205
  mails?: readonly MailSummary[];
206
+ /** Show sender avatars. Selection checkboxes remain visible when enabled. */
207
+ showAvatar?: boolean;
206
208
  density?: MailDensity;
207
209
  /** The row the reading pane is showing. */
208
210
  selectedId?: string;
@@ -25,6 +25,7 @@ import { PageHeader } from '../page-header';
25
25
  import { ButtonGroup, ButtonGroupItem } from '../button-group';
26
26
  import { RiCloseLine } from '../icons/remix/RiCloseLine';
27
27
  import { Backdrop, OverlayRoot } from '../overlay';
28
+ import { ModalKeyboard } from '../overlay/ModalKeyboard';
28
29
  import type { WebCssStyle } from '../styles/web-view-style';
29
30
  import { webDataSet } from '../styles/web-data';
30
31
  import { Text } from '../typography';
@@ -135,6 +136,7 @@ export function SettingsModal({
135
136
  labels,
136
137
  testID,
137
138
  }: SettingsModalProps) {
139
+ const panelRef = useRef<View>(null);
138
140
  const common = useCommonMessages();
139
141
  useSettingsWebCss();
140
142
  const palette = useSettingsPalette();
@@ -248,21 +250,6 @@ export function SettingsModal({
248
250
  if (mayLeave('navigation')) setCompactPageOpen(false);
249
251
  }, [mayLeave]);
250
252
 
251
- // Escape closes (web). On `window`, not `document`: a menu or popover opened
252
- // inside the modal handles Escape on `document` and stops propagation there,
253
- // so the innermost surface closes first and the modal stays open.
254
- useEffect(() => {
255
- if (!mounted || !IS_WEB || typeof window === 'undefined') return;
256
- const handler = (event: KeyboardEvent) => {
257
- if (event.key === 'Escape') {
258
- event.stopPropagation();
259
- requestClose();
260
- }
261
- };
262
- window.addEventListener('keydown', handler);
263
- return () => window.removeEventListener('keydown', handler);
264
- }, [mounted, requestClose]);
265
-
266
253
  const compactPageOpenRef = useRef(false);
267
254
  compactPageOpenRef.current = compactPageOpen && layoutRef.current === 'compact';
268
255
 
@@ -350,6 +337,14 @@ export function SettingsModal({
350
337
  <ModalPortal>
351
338
  <SettingsModalContext.Provider value={context}>
352
339
  <OverlayRoot onRequestClose={onHardwareBack} modal>
340
+ {IS_WEB ? (
341
+ <ModalKeyboard
342
+ panelRef={panelRef}
343
+ closing={!visible && wasVisible.current}
344
+ dismissible
345
+ dismiss={requestClose}
346
+ />
347
+ ) : null}
353
348
  <Backdrop
354
349
  onPress={requestClose}
355
350
  progress={progress}
@@ -372,6 +367,8 @@ export function SettingsModal({
372
367
  ]}
373
368
  >
374
369
  <View
370
+ ref={panelRef}
371
+ tabIndex={IS_WEB ? -1 : undefined}
375
372
  role="dialog"
376
373
  aria-modal
377
374
  aria-label={labels?.dialog ?? 'Settings'}