@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.
- package/README.md +173 -36
- package/dist/api-client.d.ts +51 -51
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +3 -3
- package/dist/api-error.d.ts +11 -11
- package/dist/api-error.js +11 -11
- package/dist/auth-email.d.ts +40 -0
- package/dist/auth-email.d.ts.map +1 -0
- package/dist/auth-email.js +106 -0
- package/dist/auth-email.js.map +1 -0
- package/dist/auth-store.d.ts +23 -23
- package/dist/auth-store.js +13 -13
- package/dist/commands.d.ts +80 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +192 -0
- package/dist/commands.js.map +1 -0
- package/dist/copy.d.ts +3 -3
- package/dist/copy.js +3 -3
- package/dist/deploy-recovery.d.ts +40 -40
- package/dist/deploy-recovery.js +40 -40
- package/dist/describe-error.d.ts +68 -68
- package/dist/describe-error.d.ts.map +1 -1
- package/dist/describe-error.js +5 -5
- package/dist/error-boundary.d.ts +12 -12
- package/dist/guards.d.ts +15 -15
- package/dist/guards.js +3 -3
- package/dist/hydrate.d.ts +15 -16
- package/dist/hydrate.d.ts.map +1 -1
- package/dist/hydrate.js +9 -9
- package/dist/hydrate.js.map +1 -1
- package/dist/i18n.d.ts +15 -16
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +5 -6
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal-path.d.ts +8 -7
- package/dist/internal-path.d.ts.map +1 -1
- package/dist/internal-path.js +8 -7
- package/dist/internal-path.js.map +1 -1
- package/dist/prerender-contract.d.ts +7 -7
- package/dist/prerender-contract.js +7 -7
- package/dist/query.d.ts +16 -17
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +2 -2
- package/dist/query.js.map +1 -1
- package/dist/sse.d.ts +19 -20
- package/dist/sse.d.ts.map +1 -1
- package/dist/sse.js +18 -19
- package/dist/sse.js.map +1 -1
- package/dist/states.d.ts +12 -12
- package/dist/states.d.ts.map +1 -1
- package/dist/supabase-session.d.ts +47 -48
- package/dist/supabase-session.d.ts.map +1 -1
- package/dist/supabase-session.js +35 -35
- package/dist/supabase-session.js.map +1 -1
- package/dist/theme.d.ts +4 -4
- package/dist/theme.js +4 -4
- package/dist/ui/class-name.d.ts +3 -4
- package/dist/ui/class-name.d.ts.map +1 -1
- package/dist/ui/class-name.js +3 -4
- package/dist/ui/class-name.js.map +1 -1
- package/dist/ui/combobox.d.ts +11 -11
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/dialog.d.ts +5 -5
- package/dist/ui/dialog.js +2 -2
- package/dist/ui/drawer.d.ts +10 -10
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +2 -2
- package/dist/ui/input.d.ts +2 -2
- package/dist/ui/input.js +2 -2
- package/dist/ui/menu.d.ts +9 -9
- package/dist/ui/menu.d.ts.map +1 -1
- package/dist/ui/menu.js +4 -4
- package/dist/ui/menu.js.map +1 -1
- package/dist/ui/select.d.ts +12 -12
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +3 -3
- package/dist/ui/tabs.d.ts +14 -15
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +13 -14
- package/dist/ui/tabs.js.map +1 -1
- package/package.json +5 -1
- package/src/api-client.ts +51 -51
- package/src/api-error.ts +11 -11
- package/src/auth-email.test.ts +145 -0
- package/src/auth-email.ts +112 -0
- package/src/auth-store.ts +23 -23
- package/src/commands-hook.test.ts +444 -0
- package/src/commands.test.ts +245 -0
- package/src/commands.ts +268 -0
- package/src/copy.ts +3 -3
- package/src/deploy-recovery.ts +40 -40
- package/src/describe-error.ts +68 -68
- package/src/error-boundary.tsx +12 -12
- package/src/guards.tsx +15 -15
- package/src/hydrate.ts +15 -16
- package/src/i18n.ts +15 -16
- package/src/index.ts +2 -0
- package/src/internal-path.ts +8 -7
- package/src/prerender-contract.ts +7 -7
- package/src/query.ts +16 -17
- package/src/sse.ts +19 -20
- package/src/states.ts +12 -12
- package/src/supabase-session.ts +46 -47
- package/src/theme.ts +4 -4
- package/src/ui/class-name.ts +3 -4
- package/src/ui/combobox.tsx +11 -11
- package/src/ui/dialog.tsx +5 -5
- package/src/ui/drawer.tsx +10 -10
- package/src/ui/input.tsx +2 -2
- package/src/ui/menu.tsx +8 -8
- package/src/ui/select.tsx +12 -12
- 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
|
|
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
|
|
44
|
-
*
|
|
45
|
-
*
|
|
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
|
|
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
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
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
|
-
*
|
|
76
|
-
*
|
|
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
|
|
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
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
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
|
|
72
|
-
*
|
|
73
|
-
*
|
|
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
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
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 (
|