@gusnips/react 0.9.24 → 0.9.26

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 (116) hide show
  1. package/README.md +173 -36
  2. package/dist/api-client.d.ts +51 -51
  3. package/dist/api-client.d.ts.map +1 -1
  4. package/dist/api-client.js +3 -3
  5. package/dist/api-error.d.ts +11 -11
  6. package/dist/api-error.js +11 -11
  7. package/dist/auth-email.d.ts +40 -0
  8. package/dist/auth-email.d.ts.map +1 -0
  9. package/dist/auth-email.js +106 -0
  10. package/dist/auth-email.js.map +1 -0
  11. package/dist/auth-store.d.ts +23 -23
  12. package/dist/auth-store.js +13 -13
  13. package/dist/commands.d.ts +80 -0
  14. package/dist/commands.d.ts.map +1 -0
  15. package/dist/commands.js +192 -0
  16. package/dist/commands.js.map +1 -0
  17. package/dist/copy.d.ts +3 -3
  18. package/dist/copy.js +3 -3
  19. package/dist/deploy-recovery.d.ts +40 -40
  20. package/dist/deploy-recovery.js +40 -40
  21. package/dist/describe-error.d.ts +68 -68
  22. package/dist/describe-error.d.ts.map +1 -1
  23. package/dist/describe-error.js +5 -5
  24. package/dist/error-boundary.d.ts +12 -12
  25. package/dist/guards.d.ts +15 -15
  26. package/dist/guards.js +3 -3
  27. package/dist/hydrate.d.ts +15 -16
  28. package/dist/hydrate.d.ts.map +1 -1
  29. package/dist/hydrate.js +9 -9
  30. package/dist/hydrate.js.map +1 -1
  31. package/dist/i18n.d.ts +15 -16
  32. package/dist/i18n.d.ts.map +1 -1
  33. package/dist/i18n.js +5 -6
  34. package/dist/i18n.js.map +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -0
  38. package/dist/index.js.map +1 -1
  39. package/dist/internal-path.d.ts +8 -7
  40. package/dist/internal-path.d.ts.map +1 -1
  41. package/dist/internal-path.js +8 -7
  42. package/dist/internal-path.js.map +1 -1
  43. package/dist/prerender-contract.d.ts +7 -7
  44. package/dist/prerender-contract.js +7 -7
  45. package/dist/query.d.ts +16 -17
  46. package/dist/query.d.ts.map +1 -1
  47. package/dist/query.js +2 -2
  48. package/dist/query.js.map +1 -1
  49. package/dist/sse.d.ts +19 -20
  50. package/dist/sse.d.ts.map +1 -1
  51. package/dist/sse.js +18 -19
  52. package/dist/sse.js.map +1 -1
  53. package/dist/states.d.ts +12 -12
  54. package/dist/states.d.ts.map +1 -1
  55. package/dist/supabase-session.d.ts +47 -48
  56. package/dist/supabase-session.d.ts.map +1 -1
  57. package/dist/supabase-session.js +35 -35
  58. package/dist/supabase-session.js.map +1 -1
  59. package/dist/theme.d.ts +4 -4
  60. package/dist/theme.js +4 -4
  61. package/dist/ui/class-name.d.ts +3 -4
  62. package/dist/ui/class-name.d.ts.map +1 -1
  63. package/dist/ui/class-name.js +3 -4
  64. package/dist/ui/class-name.js.map +1 -1
  65. package/dist/ui/combobox.d.ts +11 -11
  66. package/dist/ui/combobox.d.ts.map +1 -1
  67. package/dist/ui/dialog.d.ts +5 -5
  68. package/dist/ui/dialog.js +2 -2
  69. package/dist/ui/drawer.d.ts +10 -10
  70. package/dist/ui/drawer.d.ts.map +1 -1
  71. package/dist/ui/drawer.js +2 -2
  72. package/dist/ui/input.d.ts +2 -2
  73. package/dist/ui/input.js +2 -2
  74. package/dist/ui/menu.d.ts +9 -9
  75. package/dist/ui/menu.d.ts.map +1 -1
  76. package/dist/ui/menu.js +4 -4
  77. package/dist/ui/menu.js.map +1 -1
  78. package/dist/ui/select.d.ts +12 -12
  79. package/dist/ui/select.d.ts.map +1 -1
  80. package/dist/ui/select.js +3 -3
  81. package/dist/ui/tabs.d.ts +14 -15
  82. package/dist/ui/tabs.d.ts.map +1 -1
  83. package/dist/ui/tabs.js +13 -14
  84. package/dist/ui/tabs.js.map +1 -1
  85. package/package.json +5 -1
  86. package/src/api-client.ts +51 -51
  87. package/src/api-error.ts +11 -11
  88. package/src/auth-email.test.ts +145 -0
  89. package/src/auth-email.ts +112 -0
  90. package/src/auth-store.ts +23 -23
  91. package/src/commands-hook.test.ts +444 -0
  92. package/src/commands.test.ts +245 -0
  93. package/src/commands.ts +268 -0
  94. package/src/copy.ts +3 -3
  95. package/src/deploy-recovery.ts +40 -40
  96. package/src/describe-error.ts +68 -68
  97. package/src/error-boundary.tsx +12 -12
  98. package/src/guards.tsx +15 -15
  99. package/src/hydrate.ts +15 -16
  100. package/src/i18n.ts +15 -16
  101. package/src/index.ts +2 -0
  102. package/src/internal-path.ts +8 -7
  103. package/src/prerender-contract.ts +7 -7
  104. package/src/query.ts +16 -17
  105. package/src/sse.ts +19 -20
  106. package/src/states.ts +12 -12
  107. package/src/supabase-session.ts +46 -47
  108. package/src/theme.ts +4 -4
  109. package/src/ui/class-name.ts +3 -4
  110. package/src/ui/combobox.tsx +11 -11
  111. package/src/ui/dialog.tsx +5 -5
  112. package/src/ui/drawer.tsx +10 -10
  113. package/src/ui/input.tsx +2 -2
  114. package/src/ui/menu.tsx +8 -8
  115. package/src/ui/select.tsx +12 -12
  116. package/src/ui/tabs.tsx +14 -15
package/src/ui/select.tsx CHANGED
@@ -32,7 +32,7 @@ export type SelectProps<T extends string = string> = Omit<
32
32
  "children" | "items" | "defaultValue" | "multiple"
33
33
  > & {
34
34
  options?: readonly SelectOption<T>[];
35
- /** Shown while nothing is selected. No default — a default would be English. */
35
+ /** Shown while nothing is selected. No default because a default would be English. */
36
36
  placeholder?: ReactNode;
37
37
  /**
38
38
  * Shown instead of the list when `options` is empty. Required, because a popup that opens
@@ -40,9 +40,9 @@ export type SelectProps<T extends string = string> = Omit<
40
40
  */
41
41
  emptyLabel: ReactNode;
42
42
  /**
43
- * Label of an entry that puts the field back to nothing selected — for an optional
44
- * question, where "I'd rather not say" has to stay reachable after the first answer.
45
- * Rendered only once there is a value to take back; picking it calls `onValueChange(null)`.
43
+ * Label of an entry that puts the field back to nothing selected, for an optional question where
44
+ * "I'd rather not say" has to stay reachable after the first answer. Rendered only once there is
45
+ * a value to take back; picking it calls `onValueChange(null)`.
46
46
  */
47
47
  clearLabel?: string;
48
48
  /** Accessible name for the trigger, when no visible label points at it. */
@@ -51,15 +51,15 @@ export type SelectProps<T extends string = string> = Omit<
51
51
  chevron?: ReactNode;
52
52
  /** Mark next to the selected option. */
53
53
  indicator?: ReactNode;
54
- /** Classes for the trigger — the button you see when the popup is closed. */
54
+ /** Classes for the trigger button, which you see when the popup is closed. */
55
55
  className?: StateClassName<Primitive.Trigger.State>;
56
56
  popupClassName?: StateClassName<Primitive.Popup.State>;
57
57
  triggerProps?: Primitive.Trigger.Props;
58
58
  /**
59
- * Positioner props — `align`, `side`, `sideOffset`, `collisionPadding`, and the stacking
60
- * order. The default `z-[60]` puts the list above the overlay layer (z-50: dialog, drawer);
61
- * raise it with `positionerProps={{ className: "z-[80]" }}` if the app stacks something
62
- * higher than a dialog above it.
59
+ * Positioner props: `align`, `side`, `sideOffset`, `collisionPadding` and the stacking order. The
60
+ * default `z-[60]` puts the list above the overlay layer (z-50: dialog, drawer); raise it with
61
+ * `positionerProps={{ className: "z-[80]" }}` if the app stacks something higher than a dialog
62
+ * above it.
63
63
  */
64
64
  positionerProps?: Primitive.Positioner.Props;
65
65
  };
@@ -71,9 +71,9 @@ export type SelectProps<T extends string = string> = Omit<
71
71
  *
72
72
  * Controlled only, and that is the point of `value ?? null`: React and Base UI both read
73
73
  * `value={undefined}` as "uncontrolled", so a caller holding `T | undefined` in state would
74
- * silently hand the field back to the primitive the moment the value cleared, and every
75
- * later render would be ignored. `null` says "nothing selected" out loud. `defaultValue` is
76
- * not accepted here for the same reason — use the parts for an uncontrolled select.
74
+ * silently hand the field back to the primitive the moment the value cleared, and every later
75
+ * render would be ignored. `null` says "nothing selected" out loud. `defaultValue` is not accepted
76
+ * here for the same reason. Use the parts for an uncontrolled select.
77
77
  */
78
78
  export function Select<T extends string = string>({
79
79
  value,
package/src/ui/tabs.tsx CHANGED
@@ -14,20 +14,19 @@ type TabListLabel =
14
14
 
15
15
  export type TabListProps = Omit<Primitive.List.Props, "aria-labelledby"> &
16
16
  TabListLabel & {
17
- /** Classes for the scroll wrapper — the element that owns the sideways scroll. */
17
+ /** Classes for the wrapper that owns the sideways scroll. */
18
18
  wrapperClassName?: string;
19
19
  };
20
20
 
21
21
  /**
22
22
  * The rail, and the reason this file exists.
23
23
  *
24
- * It scrolls sideways rather than wrapping, because a second row of tabs pushes the panel
25
- * below the fold on a phone. But the scroll cannot live on the rail itself: `overflow-x: auto`
26
- * makes the element a scroll container, a scroll container clips everything its children paint
27
- * outside the padding box, and a computed `overflow-x` of `auto` forces `overflow-y` from
28
- * `visible` to `auto` as well. A self-scrolling rail therefore crops the focus ring on all
29
- * FOUR sides of whichever tab the keyboard is on — top and bottom always, the left of the
30
- * first tab and the right of the last.
24
+ * It scrolls sideways rather than wrapping, because a second row of tabs pushes the panel below the
25
+ * fold on a phone. But the scroll cannot live on the rail itself: `overflow-x: auto` makes the
26
+ * element a scroll container, a scroll container clips everything its children paint outside the
27
+ * padding box, and a computed `overflow-x` of `auto` forces `overflow-y` from `visible` to `auto`
28
+ * as well. A self-scrolling rail therefore crops the focus ring on all FOUR sides of whichever tab
29
+ * the keyboard is on: top and bottom always, the left of the first tab and the right of the last.
31
30
  *
32
31
  * So the scroll goes on a wrapper, and the wrapper's padding is the room the ring needs. The
33
32
  * number is derived, not inherited: `@gusnips/tokens` draws `outline: 2px solid` at
@@ -68,17 +67,17 @@ export function Tab({ className, ...rest }: Primitive.Tab.Props) {
68
67
  }
69
68
 
70
69
  /**
71
- * The travelling marker under the active tab — a SEPARATE part, because the two donors
72
- * disagreed about whether to have one at all and both were right about their own app. Render
73
- * it or do not; the rail works either way.
70
+ * The travelling marker under the active tab. A SEPARATE part, because the two donors disagreed
71
+ * about whether to have one at all and both were right about their own app. Render it or do not;
72
+ * the rail works either way.
74
73
  *
75
74
  * It must be a child of `TabList`: Base UI measures the active tab against the enclosing
76
75
  * `[role="tablist"]` and writes `--active-tab-left` / `--active-tab-width` onto this element.
77
76
  *
78
- * `renderBeforeHydration` is on by default because this package's apps are prerendered — with
79
- * it off, every prerendered page shows the rail with no marker until React arrives. It writes
80
- * one inline script to do that; under a strict CSP without Base UI's `CspProvider` the script
81
- * is blocked and the behaviour falls back to exactly what `false` would have done.
77
+ * `renderBeforeHydration` is on by default because this package's apps are prerendered. With it
78
+ * off, every prerendered page shows the rail with no marker until React arrives. It writes one
79
+ * inline script to do that; under a strict CSP without Base UI's `CspProvider` the script is
80
+ * blocked and the behaviour falls back to exactly what `false` would have done.
82
81
  */
83
82
  export function TabIndicator({ className, ...rest }: Primitive.Indicator.Props) {
84
83
  return (