@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/dist/supabase-session.js
CHANGED
|
@@ -4,33 +4,33 @@ import { SIGN_OUT_TIMEOUT_MS } from "./api-client.js";
|
|
|
4
4
|
* Auth FAILED rather than answered, so nothing is known about the credential it was handed:
|
|
5
5
|
* either the request never landed, or GoTrue failed on its own.
|
|
6
6
|
*
|
|
7
|
-
* This is the question every site that ends a session has to ask
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* This is the question every site that ends a session has to ask: a token refresh, an API door, and
|
|
8
|
+
* a callback choosing between "try again" and "that link is spent". Without it one bad minute at
|
|
9
|
+
* GoTrue signs out everybody whose token happened to need refreshing, and tells everybody clicking
|
|
10
|
+
* a recovery link that it has expired, which sends them to ask the service that is down for a
|
|
11
|
+
* replacement.
|
|
12
12
|
*
|
|
13
13
|
* Both clauses carry weight, and the second is why this is a function rather than one call.
|
|
14
14
|
* `isAuthRetryableFetchError` is a NAME check, and the statuses that earn that name are a list
|
|
15
|
-
* auth-js owns. The list has drifted
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
15
|
+
* auth-js owns. The list has drifted: 502, 503 and 504 at 2.91; those plus the 52x family and still
|
|
16
|
+
* no 500 at 2.106; 500 through 530 at 2.108. Code leaning on it alone is right at whichever version
|
|
17
|
+
* happens to be installed, which is not the same as being right, and a fleet installs several
|
|
18
|
+
* versions at once. It is also a LIST rather than a range, so it has holes at every version, drift
|
|
19
|
+
* or no drift: at 2.112 nothing covers 505 through 519 or 531 up, and a 507 or a 599 with a JSON
|
|
20
|
+
* body arrives as a plain `AuthApiError`. Pinning a recent SDK does not make the status clause
|
|
21
|
+
* redundant.
|
|
22
22
|
*
|
|
23
|
-
* The same statuses with a body that is NOT JSON
|
|
24
|
-
* `AuthUnknownError`, which carries no status at any status, so nothing here can tell that 507
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* The same statuses with a body that is NOT JSON, such as a proxy's HTML page, arrive as an
|
|
24
|
+
* `AuthUnknownError`, which carries no status at any status, so nothing here can tell that 507 from
|
|
25
|
+
* a malformed 400. It answers false for both, on purpose: reading an unreadable 4xx as an outage
|
|
26
|
+
* would leave a dead session retrying forever, which is the other half of the same bug.
|
|
27
27
|
*
|
|
28
28
|
* Read the version a tree really serves with `bun why @supabase/auth-js`, which prints one
|
|
29
29
|
* heading per RESOLVED version; `node_modules` keeps copies the resolver does not serve.
|
|
30
30
|
*
|
|
31
|
-
* Anything that is not an auth error at all answers true: a failure from outside auth-js is not
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* Anything that is not an auth error at all answers true: a failure from outside auth-js is not a
|
|
32
|
+
* verdict on the credential either. Nothing at all answers false. `null` is what every supabase-js
|
|
33
|
+
* auth call returns on success, and success is not an outage.
|
|
34
34
|
*/
|
|
35
35
|
export function isAuthOutage(error) {
|
|
36
36
|
// Nothing thrown is not an outage, and this clause exists because the function is exported.
|
|
@@ -131,12 +131,12 @@ function localStorageOrMemory() {
|
|
|
131
131
|
* 2.116.0 and 41–51 s at 2.106.2. Nobody at a shared computer waits that long, and a page that
|
|
132
132
|
* navigates away in the meantime takes the removal with it.
|
|
133
133
|
*
|
|
134
|
-
* It resolves once the stored session is gone. `error` is `null` when auth ended the session on
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
134
|
+
* It resolves once the stored session is gone. `error` is `null` when auth ended the session on the
|
|
135
|
+
* server too. Otherwise it is the reason auth did not: its error, a thrown value or the deadline.
|
|
136
|
+
* The session may still be live on the server and on other devices. `SIGNED_OUT` arrives once
|
|
137
|
+
* auth-js has finished with the first call: about 100 ms later from 2.108.2 on, and up to 22 s
|
|
138
|
+
* later at 2.106.2. If your screen does not reload, clear your own store when this resolves instead
|
|
139
|
+
* of waiting for the event.
|
|
140
140
|
*/
|
|
141
141
|
export async function signOutEvenOffline(auth, { storage, storageKey }) {
|
|
142
142
|
let timer;
|
|
@@ -220,19 +220,19 @@ function isEmailLinkType(value) {
|
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
222
|
* Reads an auth callback address. Pure, so every edge case is testable without a router or a
|
|
223
|
-
* client
|
|
223
|
+
* client. Pass `location.search` and `location.hash`, or the two halves of a deep link.
|
|
224
224
|
*
|
|
225
|
-
* GoTrue writes a failure into the FRAGMENT on every path and into the query only on some
|
|
226
|
-
*
|
|
227
|
-
*
|
|
225
|
+
* GoTrue writes a failure into the FRAGMENT on every path and into the query only on some. After a
|
|
226
|
+
* provider round trip, it writes both; after an implicit-flow email link, it writes the fragment
|
|
227
|
+
* alone. A callback reading one of the two misses a failure the other carries, and the person lands
|
|
228
228
|
* on a screen that says nothing. Both are read here.
|
|
229
229
|
*
|
|
230
|
-
* `cancelled` is the provider refusing on its own, which for Google is the person pressing Cancel
|
|
231
|
-
*
|
|
232
|
-
* that same value for an expired email link, a banned user and a disabled signup, each with
|
|
233
|
-
* `error_code` beside it, while a refusal relayed from the provider arrives with none. The
|
|
234
|
-
* test reads an expired link as a change of mind. And `error` itself is absent for a status
|
|
235
|
-
* outside GoTrue's OAuth mapping
|
|
230
|
+
* `cancelled` is the provider refusing on its own, which for Google is the person pressing Cancel.
|
|
231
|
+
* That is their choice, not a failure to report. It is NOT `error === "access_denied"`: GoTrue
|
|
232
|
+
* writes that same value for an expired email link, a banned user and a disabled signup, each with
|
|
233
|
+
* an `error_code` beside it, while a refusal relayed from the provider arrives with none. The
|
|
234
|
+
* obvious test reads an expired link as a change of mind. And `error` itself is absent for a status
|
|
235
|
+
* outside GoTrue's OAuth mapping. A rate-limited link arrives with `error_code` alone.
|
|
236
236
|
*/
|
|
237
237
|
export function parseAuthCallback(search, hash = "") {
|
|
238
238
|
const query = new URLSearchParams(search);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase-session.js","sourceRoot":"","sources":["../src/supabase-session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,GAK1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAuB,MAAM,iBAAiB,CAAC;AAiC3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,4FAA4F;IAC5F,6EAA6E;IAC7E,8FAA8F;IAC9F,8FAA8F;IAC9F,gFAAgF;IAChF,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,KAAK,CAAC;IAChC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC;AACxE,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,0FAA0F;IAC1F,uFAAuF;IACvF,kFAAkF;IAClF,8EAA8E;IAC9E,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7D,8FAA8F;IAC9F,8FAA8F;IAC9F,OAAO,KAAK,CAAC,IAAI,KAAK,2BAA2B,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,OAAO,MA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,10 @@ declare global {
|
|
|
65
65
|
* "system" is stored as the word, not as an empty key. An empty key means the default, and the
|
|
66
66
|
* default is not always "system".
|
|
67
67
|
*
|
|
68
|
-
* **It writes to the page when the theme changes, and at no other time.** A page may override
|
|
69
|
-
*
|
|
70
|
-
* override until the theme really changes. Repainting on every resync would undo it a moment
|
|
71
|
-
*
|
|
68
|
+
* **It writes to the page when the theme changes, and at no other time.** A page may override the
|
|
69
|
+
* class for its own lifetime, as a public booking page that is always light does, and keeps that
|
|
70
|
+
* override until the theme really changes. Repainting on every resync would undo it a moment later,
|
|
71
|
+
* because `pageshow` fires on every load, not only on a back-forward restore.
|
|
72
72
|
*/
|
|
73
73
|
export declare function startTheme(options: ThemeOptions): ThemeController;
|
|
74
74
|
export interface Theme {
|
package/dist/theme.js
CHANGED
|
@@ -58,10 +58,10 @@ import { useSyncExternalStore } from "react";
|
|
|
58
58
|
* "system" is stored as the word, not as an empty key. An empty key means the default, and the
|
|
59
59
|
* default is not always "system".
|
|
60
60
|
*
|
|
61
|
-
* **It writes to the page when the theme changes, and at no other time.** A page may override
|
|
62
|
-
*
|
|
63
|
-
* override until the theme really changes. Repainting on every resync would undo it a moment
|
|
64
|
-
*
|
|
61
|
+
* **It writes to the page when the theme changes, and at no other time.** A page may override the
|
|
62
|
+
* class for its own lifetime, as a public booking page that is always light does, and keeps that
|
|
63
|
+
* override until the theme really changes. Repainting on every resync would undo it a moment later,
|
|
64
|
+
* because `pageshow` fires on every load, not only on a back-forward restore.
|
|
65
65
|
*/
|
|
66
66
|
export function startTheme(options) {
|
|
67
67
|
const running = window.__frontkitTheme;
|
package/dist/ui/class-name.d.ts
CHANGED
|
@@ -7,10 +7,9 @@ export type StateClassName<State> = string | ((state: State) => string | undefin
|
|
|
7
7
|
/**
|
|
8
8
|
* Merge a wrapper's own classes with the caller's, keeping BOTH forms working.
|
|
9
9
|
*
|
|
10
|
-
* `cn()` on its own silently DROPS the function form
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* keeps one code path for both.
|
|
10
|
+
* `cn()` on its own silently DROPS the function form. clsx walks strings, arrays and plain objects,
|
|
11
|
+
* and a function is none of the three, so a caller styling by `open` or `transitionStatus` would
|
|
12
|
+
* get an empty class and no warning. Always returning a function keeps one code path for both.
|
|
14
13
|
*/
|
|
15
14
|
export declare function mergeClassName<State>(base: ClassValue, extra: StateClassName<State>): (state: State) => string;
|
|
16
15
|
//# sourceMappingURL=class-name.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-name.d.ts","sourceRoot":"","sources":["../../src/ui/class-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGvC;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;AAEhG
|
|
1
|
+
{"version":3,"file":"class-name.d.ts","sourceRoot":"","sources":["../../src/ui/class-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGvC;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;AAEhG;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAClC,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAC3B,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAE1B"}
|
package/dist/ui/class-name.js
CHANGED
|
@@ -2,10 +2,9 @@ import { cn } from "../cn.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Merge a wrapper's own classes with the caller's, keeping BOTH forms working.
|
|
4
4
|
*
|
|
5
|
-
* `cn()` on its own silently DROPS the function form
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* keeps one code path for both.
|
|
5
|
+
* `cn()` on its own silently DROPS the function form. clsx walks strings, arrays and plain objects,
|
|
6
|
+
* and a function is none of the three, so a caller styling by `open` or `transitionStatus` would
|
|
7
|
+
* get an empty class and no warning. Always returning a function keeps one code path for both.
|
|
9
8
|
*/
|
|
10
9
|
export function mergeClassName(base, extra) {
|
|
11
10
|
return (state) => cn(base, typeof extra === "function" ? extra(state) : extra);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-name.js","sourceRoot":"","sources":["../../src/ui/class-name.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAQ9B
|
|
1
|
+
{"version":3,"file":"class-name.js","sourceRoot":"","sources":["../../src/ui/class-name.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAQ9B;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAgB,EAChB,KAA4B;IAE5B,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACjF,CAAC"}
|
package/dist/ui/combobox.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare const ComboboxGroupLabel: import("react").ForwardRefExoticCompone
|
|
|
23
23
|
* closed and the field goes blank the moment focus leaves, even though a value is set.
|
|
24
24
|
*/
|
|
25
25
|
export declare function comboboxInputValue<T>(open: boolean, query: string, value: T | null, getLabel: (item: T) => string): string;
|
|
26
|
-
/**
|
|
26
|
+
/** Pass text for the loading state. There is no default text or English fallback. */
|
|
27
27
|
type ComboboxLoadingState = {
|
|
28
28
|
loading: boolean;
|
|
29
29
|
loadingHint: ReactNode;
|
|
@@ -34,15 +34,15 @@ type ComboboxLoadingState = {
|
|
|
34
34
|
export type ComboboxProps<T> = Omit<Primitive.Root.Props<T, false, T>, "children" | "items" | "filteredItems" | "filter" | "value" | "defaultValue" | "multiple" | "open" | "defaultOpen" | "inputValue" | "defaultInputValue" | "onInputValueChange" | "itemToStringLabel" | "isItemEqualToValue"> & {
|
|
35
35
|
value: T | null;
|
|
36
36
|
/**
|
|
37
|
-
* Items for the current query. Filtering is yours: this passes `filter={null}` to Base UI,
|
|
38
|
-
*
|
|
39
|
-
* page. Bound it here if it needs bounding; there is no cap in the wrapper, because a cap
|
|
40
|
-
*
|
|
37
|
+
* Items for the current query. Filtering is yours: this passes `filter={null}` to Base UI, so the
|
|
38
|
+
* list shows exactly what you return, whether it is a server search, a fuzzy match or a bounded
|
|
39
|
+
* page. Bound it here if it needs bounding; there is no cap in the wrapper, because a cap would
|
|
40
|
+
* quietly truncate a list a caller meant to show whole.
|
|
41
41
|
*/
|
|
42
42
|
search: (query: string) => readonly T[];
|
|
43
43
|
/** Stable identity of an item: its React key, and how two items are compared. */
|
|
44
44
|
getKey: (item: T) => string;
|
|
45
|
-
/** The item's text
|
|
45
|
+
/** The item's text, shown in the input once it is picked and used for typeahead matches. */
|
|
46
46
|
getLabel: (item: T) => string;
|
|
47
47
|
renderItem?: (item: T) => ReactNode;
|
|
48
48
|
/**
|
|
@@ -50,7 +50,7 @@ export type ComboboxProps<T> = Omit<Primitive.Root.Props<T, false, T>, "children
|
|
|
50
50
|
* end, and this is the line that offers one.
|
|
51
51
|
*/
|
|
52
52
|
emptyHint: ReactNode;
|
|
53
|
-
/** Label for the clear button. Required
|
|
53
|
+
/** Label for the clear button. Required because the button has an icon and no text. */
|
|
54
54
|
clearLabel: string;
|
|
55
55
|
/** Label for the button that opens the list. Required, same reason. */
|
|
56
56
|
openLabel: string;
|
|
@@ -62,10 +62,10 @@ export type ComboboxProps<T> = Omit<Primitive.Root.Props<T, false, T>, "children
|
|
|
62
62
|
popupClassName?: StateClassName<Primitive.Popup.State>;
|
|
63
63
|
inputProps?: Primitive.Input.Props;
|
|
64
64
|
/**
|
|
65
|
-
* Positioner props
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
65
|
+
* Positioner props: `align`, `side`, `sideOffset`, `collisionPadding` and the stacking order. The
|
|
66
|
+
* default `z-[60]` puts the list above the overlay layer (z-50: dialog, drawer); raise it with
|
|
67
|
+
* `positionerProps={{ className: "z-[80]" }}` if the app stacks something higher than a dialog
|
|
68
|
+
* above it.
|
|
69
69
|
*/
|
|
70
70
|
positionerProps?: Primitive.Positioner.Props;
|
|
71
71
|
} & ComboboxLoadingState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/ui/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKtE,eAAO,MAAM,YAAY,uBAAiB,CAAC;AAC3C,eAAO,MAAM,aAAa,2JAAkB,CAAC;AAC7C,eAAO,MAAM,kBAAkB,0JAAuB,CAAC;AACvD,eAAO,MAAM,eAAe,0JAAoB,CAAC;AACjD,eAAO,MAAM,aAAa,4JAAkB,CAAC;AAC7C,eAAO,MAAM,cAAc,0JAAmB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,8JAAuB,CAAC;AACvD,eAAO,MAAM,aAAa,yJAAkB,CAAC;AAC7C,eAAO,MAAM,YAAY,wJAAiB,CAAC;AAC3C,eAAO,MAAM,YAAY,+IAAiB,CAAC;AAC3C,eAAO,MAAM,aAAa,yJAAkB,CAAC;AAC7C,eAAO,MAAM,aAAa,yJAAkB,CAAC;AAC7C,eAAO,MAAM,kBAAkB,8JAAuB,CAAC;AAEvD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,C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;;;;OAKG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC;CAC9C,GAAG,oBAAoB,CAAC;AAEzB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAC1B,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACT,cAAc,EACd,UAAU,EACV,eAAe,EACf,YAAY,EACZ,GAAG,IAAI,EACR,EAAE,aAAa,CAAC,CAAC,CAAC,+BAyHlB"}
|
package/dist/ui/dialog.d.ts
CHANGED
|
@@ -16,9 +16,9 @@ export type DialogContentProps = Primitive.Popup.Props & {
|
|
|
16
16
|
*/
|
|
17
17
|
label?: string;
|
|
18
18
|
/**
|
|
19
|
-
* Label for the built-in close button
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* Label for the built-in close button. REQUIRED to render the button: passing the label is the
|
|
20
|
+
* only way to render the button, so an unlabelled close button cannot be written. There is no
|
|
21
|
+
* default string, because a default would be English.
|
|
22
22
|
*/
|
|
23
23
|
closeLabel?: string;
|
|
24
24
|
backdropClassName?: StateClassName<Primitive.Backdrop.State>;
|
|
@@ -32,8 +32,8 @@ export type DialogContentProps = Primitive.Popup.Props & {
|
|
|
32
32
|
* page behind it) and is capped to the viewport, so a tall dialog is never taller than the
|
|
33
33
|
* screen it opens on.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
35
|
+
* Padding, radius, shadow and type all belong to the product. What is here is what makes the
|
|
36
|
+
* primitive work.
|
|
37
37
|
*/
|
|
38
38
|
export declare function DialogContent({ className, backdropClassName, container, label, closeLabel, children, ...rest }: DialogContentProps): import("react").JSX.Element;
|
|
39
39
|
//# sourceMappingURL=dialog.d.ts.map
|
package/dist/ui/dialog.js
CHANGED
|
@@ -20,8 +20,8 @@ export const DialogPopup = Primitive.Popup;
|
|
|
20
20
|
* page behind it) and is capped to the viewport, so a tall dialog is never taller than the
|
|
21
21
|
* screen it opens on.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* Padding, radius, shadow and type all belong to the product. What is here is what makes the
|
|
24
|
+
* primitive work.
|
|
25
25
|
*/
|
|
26
26
|
export function DialogContent({ className, backdropClassName, container, label, closeLabel, children, ...rest }) {
|
|
27
27
|
return (_jsxs(Primitive.Portal, { container: container, children: [_jsx(Primitive.Backdrop, { className: mergeClassName("fixed inset-0 z-50 bg-scrim transition-opacity data-ending-style:opacity-0 data-starting-style:opacity-0", backdropClassName) }), _jsxs(Primitive.Popup, { "aria-label": label, ...rest, className: mergeClassName("fixed top-1/2 left-1/2 z-50 max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 overflow-y-auto overscroll-contain bg-popover text-popover-foreground outline-none transition-[scale,opacity] data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0", className), children: [children, closeLabel === undefined ? null : (_jsx(Primitive.Close, { "aria-label": closeLabel,
|
package/dist/ui/drawer.d.ts
CHANGED
|
@@ -17,9 +17,9 @@ export type DrawerSide = "left" | "right" | "bottom";
|
|
|
17
17
|
/**
|
|
18
18
|
* Where the portal mounts, and whether the drawer covers the page or a box inside it.
|
|
19
19
|
*
|
|
20
|
-
* A scoped drawer positions itself `absolute` against a container instead of `fixed` against
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* A scoped drawer positions itself `absolute` against a container instead of `fixed` against the
|
|
21
|
+
* viewport, so it MUST be given that container, or it lands in `<body>` and positions against a box
|
|
22
|
+
* that is not there. The two travel together in the type.
|
|
23
23
|
*
|
|
24
24
|
* The container also needs a positioning context of its own (`relative`): `absolute` walks up
|
|
25
25
|
* to the nearest positioned ancestor, so a static container hands the drawer the whole page
|
|
@@ -34,20 +34,20 @@ type DrawerPortalTarget = {
|
|
|
34
34
|
};
|
|
35
35
|
export type DrawerProps<Payload = unknown> = Omit<Primitive.Root.Props<Payload>, "children" | "swipeDirection"> & DrawerPortalTarget & {
|
|
36
36
|
/**
|
|
37
|
-
* Which edge it comes from. This also sets `swipeDirection` on the root
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* Which edge it comes from. This also sets `swipeDirection` on the root. The two must agree,
|
|
38
|
+
* and a mismatch is silent: the drawer looks right and dismisses on a swipe towards the screen
|
|
39
|
+
* it is attached to.
|
|
40
40
|
*/
|
|
41
41
|
side?: DrawerSide;
|
|
42
42
|
/** Accessible name, for a drawer with no visible `DrawerTitle`. */
|
|
43
43
|
label?: string;
|
|
44
44
|
children?: ReactNode;
|
|
45
|
-
/** Classes for the popup
|
|
45
|
+
/** Classes for the popup panel. */
|
|
46
46
|
className?: StateClassName<Primitive.Popup.State>;
|
|
47
47
|
backdropClassName?: StateClassName<Primitive.Backdrop.State>;
|
|
48
48
|
viewportClassName?: StateClassName<Primitive.Viewport.State>;
|
|
49
49
|
contentClassName?: StateClassName<Primitive.Content.State>;
|
|
50
|
-
/** Popup-level props the wrapper does not own
|
|
50
|
+
/** Popup-level props the wrapper does not own, such as `initialFocus`, `finalFocus` and `data-*`. */
|
|
51
51
|
popupProps?: Primitive.Popup.Props;
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
@@ -55,8 +55,8 @@ export type DrawerProps<Payload = unknown> = Omit<Primitive.Root.Props<Payload>,
|
|
|
55
55
|
* composed once here because the parts have to be arranged in exactly this order to work at
|
|
56
56
|
* all, and because two of the four rules below cost someone a bug that no test would catch.
|
|
57
57
|
*
|
|
58
|
-
*
|
|
59
|
-
* `
|
|
58
|
+
* Every root prop passes straight through, including `open`, `onOpenChange`, `modal`, `snapPoints`,
|
|
59
|
+
* `actionsRef` and `data-*`.
|
|
60
60
|
*/
|
|
61
61
|
export declare function Drawer<Payload = unknown>({ side, label, scoped, container, className, backdropClassName, viewportClassName, contentClassName, popupProps, children, ...rest }: DrawerProps<Payload>): import("react").JSX.Element;
|
|
62
62
|
export {};
|
package/dist/ui/drawer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/ui/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtE,eAAO,MAAM,UAAU,uBAAiB,CAAC;AACzC,eAAO,MAAM,aAAa,mBAAoB,CAAC;AAC/C,eAAO,MAAM,YAAY,kBAAmB,CAAC;AAC7C,eAAO,MAAM,cAAc,sJAAqB,CAAC;AACjD,eAAO,MAAM,cAAc,sJAAqB,CAAC;AACjD,eAAO,MAAM,WAAW,mJAAkB,CAAC;AAC3C,eAAO,MAAM,aAAa,qJAAoB,CAAC;AAC/C,eAAO,MAAM,YAAY,yBAAmB,CAAC;AAC7C,eAAO,MAAM,eAAe,uJAAsB,CAAC;AACnD,eAAO,MAAM,WAAW,iBAAkB,CAAC;AAC3C,eAAO,MAAM,iBAAiB,uBAAwB,CAAC;AACvD,eAAO,MAAM,WAAW,iBAAkB,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAmBrD;;;;;;;;;;GAUG;AACH,KAAK,kBAAkB,GACnB;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;CAAE,GAC7E;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAExE,MAAM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
|
32
32
|
* composed once here because the parts have to be arranged in exactly this order to work at
|
|
33
33
|
* all, and because two of the four rules below cost someone a bug that no test would catch.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
* `
|
|
35
|
+
* Every root prop passes straight through, including `open`, `onOpenChange`, `modal`, `snapPoints`,
|
|
36
|
+
* `actionsRef` and `data-*`.
|
|
37
37
|
*/
|
|
38
38
|
export function Drawer({ side = "right", label, scoped = false, container, className, backdropClassName, viewportClassName, contentClassName, popupProps, children, ...rest }) {
|
|
39
39
|
return (_jsx(Primitive.Root, { swipeDirection: side === "bottom" ? "down" : side, ...rest, children: _jsxs(Primitive.Portal, { container: container, children: [_jsx(Primitive.Backdrop, { className: mergeClassName([
|
package/dist/ui/input.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import * as React from "react";
|
|
|
3
3
|
/**
|
|
4
4
|
* The inline height an autosizing textarea should carry, or `""` for "leave it to CSS".
|
|
5
5
|
*
|
|
6
|
-
* ponytail: this whole observer is here only until `field-sizing: content` is baseline
|
|
7
|
-
*
|
|
6
|
+
* ponytail: this whole observer is here only until `field-sizing: content` is baseline. One CSS
|
|
7
|
+
* line does the same job. Ceiling: it does not exist in every browser we support yet.
|
|
8
8
|
*/
|
|
9
9
|
export declare function textareaHeight(clientWidth: number, scrollHeight: number): string;
|
|
10
10
|
type FieldChrome = {
|
package/dist/ui/input.js
CHANGED
|
@@ -11,8 +11,8 @@ const TEXTAREA_MAX_HEIGHT = 160;
|
|
|
11
11
|
/**
|
|
12
12
|
* The inline height an autosizing textarea should carry, or `""` for "leave it to CSS".
|
|
13
13
|
*
|
|
14
|
-
* ponytail: this whole observer is here only until `field-sizing: content` is baseline
|
|
15
|
-
*
|
|
14
|
+
* ponytail: this whole observer is here only until `field-sizing: content` is baseline. One CSS
|
|
15
|
+
* line does the same job. Ceiling: it does not exist in every browser we support yet.
|
|
16
16
|
*/
|
|
17
17
|
export function textareaHeight(clientWidth, scrollHeight) {
|
|
18
18
|
if (clientWidth < TEXTAREA_MIN_AUTO_WIDTH)
|
package/dist/ui/menu.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Menu as Primitive } from "@base-ui/react/menu";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
|
-
export declare const Menu:
|
|
3
|
+
export declare const Menu: typeof Primitive.Root;
|
|
4
4
|
export declare const MenuTrigger: Primitive.Trigger;
|
|
5
5
|
export declare const MenuPortal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export declare const MenuPositioner: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").MenuPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -24,17 +24,17 @@ export type MenuContentProps = Primitive.Popup.Props & {
|
|
|
24
24
|
/** Where the portal mounts. Defaults to `<body>`. */
|
|
25
25
|
container?: Primitive.Portal.Props["container"];
|
|
26
26
|
/**
|
|
27
|
-
* Positioner props
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* Positioner props: `side`, `align`, `sideOffset`, `collisionPadding` and the stacking order. The
|
|
28
|
+
* default `z-[60]` puts the menu above the overlay layer (z-50: dialog, drawer) so a menu opened
|
|
29
|
+
* inside a dialog is not painted behind it; raise it with `positionerProps={{ className: "z-[80]"
|
|
30
|
+
* }}` if the app stacks something higher.
|
|
31
31
|
*/
|
|
32
32
|
positionerProps?: Primitive.Positioner.Props;
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* A dropdown
|
|
36
|
-
* and popup composed once, for the same reason the dialog's are: the arrangement is not
|
|
37
|
-
*
|
|
35
|
+
* A dropdown for choices, such as the account menu, a row's actions or a picker. Portal, positioner
|
|
36
|
+
* and popup composed once, for the same reason the dialog's are: the arrangement is not optional
|
|
37
|
+
* and getting it wrong throws a number.
|
|
38
38
|
*
|
|
39
39
|
* Roving focus, typeahead, escape, outside-dismiss and focus return all come from Base UI.
|
|
40
40
|
* Nothing here re-implements any of them.
|
|
@@ -55,7 +55,7 @@ type MenuGroupCaption = {
|
|
|
55
55
|
* Optional, because a group whose trigger already says what it is would only repeat itself.
|
|
56
56
|
*/
|
|
57
57
|
export declare function MenuGroup({ label, children, ...rest }: Primitive.Group.Props & MenuGroupCaption): import("react").JSX.Element;
|
|
58
|
-
/** A set of choices
|
|
58
|
+
/** A set of choices for a theme, locale or one axis of a filter. Same caption rule as `MenuGroup`. */
|
|
59
59
|
export declare function MenuRadioGroup({ label, children, ...rest }: Primitive.RadioGroup.Props & MenuGroupCaption): import("react").JSX.Element;
|
|
60
60
|
export type MenuRadioItemProps = Primitive.RadioItem.Props & {
|
|
61
61
|
/** Mark for the chosen item. */
|
package/dist/ui/menu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/ui/menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavC,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/ui/menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavC,eAAO,MAAM,IAAI,uBAAiB,CAAC;AACnC,eAAO,MAAM,WAAW,mBAAoB,CAAC;AAC7C,eAAO,MAAM,UAAU,yJAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc,sJAAuB,CAAC;AACnD,eAAO,MAAM,SAAS,wJAAkB,CAAC;AACzC,eAAO,MAAM,YAAY,2JAAqB,CAAC;AAC/C,eAAO,MAAM,SAAS,wJAAkB,CAAC;AACz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AAE,SAAS,CAAC,UAAU,CAAC,KAAK,GAAG,gBAAgB,+BAS/C;AAED,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,GAAG;IAC3D,gCAAgC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,+BAY5F"}
|
package/dist/ui/menu.js
CHANGED
|
@@ -25,9 +25,9 @@ export const MenuRadioItemIndicator = Primitive.RadioItemIndicator;
|
|
|
25
25
|
export const MenuSubmenuRoot = Primitive.SubmenuRoot;
|
|
26
26
|
export const MenuSubmenuTrigger = Primitive.SubmenuTrigger;
|
|
27
27
|
/**
|
|
28
|
-
* A dropdown
|
|
29
|
-
* and popup composed once, for the same reason the dialog's are: the arrangement is not
|
|
30
|
-
*
|
|
28
|
+
* A dropdown for choices, such as the account menu, a row's actions or a picker. Portal, positioner
|
|
29
|
+
* and popup composed once, for the same reason the dialog's are: the arrangement is not optional
|
|
30
|
+
* and getting it wrong throws a number.
|
|
31
31
|
*
|
|
32
32
|
* Roving focus, typeahead, escape, outside-dismiss and focus return all come from Base UI.
|
|
33
33
|
* Nothing here re-implements any of them.
|
|
@@ -71,7 +71,7 @@ const captionClasses = "px-3 pt-2 pb-1 text-muted-foreground";
|
|
|
71
71
|
export function MenuGroup({ label, children, ...rest }) {
|
|
72
72
|
return (_jsxs(Primitive.Group, { ...rest, children: [label === undefined ? null : (_jsx(Primitive.GroupLabel, { className: captionClasses, children: label })), children] }));
|
|
73
73
|
}
|
|
74
|
-
/** A set of choices
|
|
74
|
+
/** A set of choices for a theme, locale or one axis of a filter. Same caption rule as `MenuGroup`. */
|
|
75
75
|
export function MenuRadioGroup({ label, children, ...rest }) {
|
|
76
76
|
return (_jsxs(Primitive.RadioGroup, { ...rest, children: [label === undefined ? null : (_jsx(Primitive.GroupLabel, { className: captionClasses, children: label })), children] }));
|
|
77
77
|
}
|
package/dist/ui/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/ui/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAc,CAAC;AAE1C,sFAAsF;AACtF,4FAA4F;AAC5F,4FAA4F;AAC5F,6FAA6F;AAC7F,6FAA6F;AAC7F,0FAA0F;AAC1F,8FAA8F;AAC9F,8FAA8F;AAC9F,4FAA4F;AAC5F,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;AACnC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC;AACzC,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAC;AAC/C,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC;AACzC,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAC;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC,YAAY,CAAC;AACvD,MAAM,CAAC,MAAM,yBAAyB,GAAG,SAAS,CAAC,qBAAqB,CAAC;AACzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,CAAC,kBAAkB,CAAC;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,WAAW,CAAC;AACrD,MAAM,CAA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gC,GACrF,EACN,QAAQ,IACW,CACvB,CAAC;AACJ,CAAC"}
|
package/dist/ui/select.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface SelectOption<T extends string = string> {
|
|
|
23
23
|
}
|
|
24
24
|
export type SelectProps<T extends string = string> = Omit<Primitive.Root.Props<T, false>, "children" | "items" | "defaultValue" | "multiple"> & {
|
|
25
25
|
options?: readonly SelectOption<T>[];
|
|
26
|
-
/** Shown while nothing is selected. No default
|
|
26
|
+
/** Shown while nothing is selected. No default because a default would be English. */
|
|
27
27
|
placeholder?: ReactNode;
|
|
28
28
|
/**
|
|
29
29
|
* Shown instead of the list when `options` is empty. Required, because a popup that opens
|
|
@@ -31,9 +31,9 @@ export type SelectProps<T extends string = string> = Omit<Primitive.Root.Props<T
|
|
|
31
31
|
*/
|
|
32
32
|
emptyLabel: ReactNode;
|
|
33
33
|
/**
|
|
34
|
-
* Label of an entry that puts the field back to nothing selected
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* Label of an entry that puts the field back to nothing selected, for an optional question where
|
|
35
|
+
* "I'd rather not say" has to stay reachable after the first answer. Rendered only once there is
|
|
36
|
+
* a value to take back; picking it calls `onValueChange(null)`.
|
|
37
37
|
*/
|
|
38
38
|
clearLabel?: string;
|
|
39
39
|
/** Accessible name for the trigger, when no visible label points at it. */
|
|
@@ -42,15 +42,15 @@ export type SelectProps<T extends string = string> = Omit<Primitive.Root.Props<T
|
|
|
42
42
|
chevron?: ReactNode;
|
|
43
43
|
/** Mark next to the selected option. */
|
|
44
44
|
indicator?: ReactNode;
|
|
45
|
-
/** Classes for the trigger
|
|
45
|
+
/** Classes for the trigger button, which you see when the popup is closed. */
|
|
46
46
|
className?: StateClassName<Primitive.Trigger.State>;
|
|
47
47
|
popupClassName?: StateClassName<Primitive.Popup.State>;
|
|
48
48
|
triggerProps?: Primitive.Trigger.Props;
|
|
49
49
|
/**
|
|
50
|
-
* Positioner props
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
50
|
+
* Positioner props: `align`, `side`, `sideOffset`, `collisionPadding` and the stacking order. The
|
|
51
|
+
* default `z-[60]` puts the list above the overlay layer (z-50: dialog, drawer); raise it with
|
|
52
|
+
* `positionerProps={{ className: "z-[80]" }}` if the app stacks something higher than a dialog
|
|
53
|
+
* above it.
|
|
54
54
|
*/
|
|
55
55
|
positionerProps?: Primitive.Positioner.Props;
|
|
56
56
|
};
|
|
@@ -61,9 +61,9 @@ export type SelectProps<T extends string = string> = Omit<Primitive.Root.Props<T
|
|
|
61
61
|
*
|
|
62
62
|
* Controlled only, and that is the point of `value ?? null`: React and Base UI both read
|
|
63
63
|
* `value={undefined}` as "uncontrolled", so a caller holding `T | undefined` in state would
|
|
64
|
-
* silently hand the field back to the primitive the moment the value cleared, and every
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* silently hand the field back to the primitive the moment the value cleared, and every later
|
|
65
|
+
* render would be ignored. `null` says "nothing selected" out loud. `defaultValue` is not accepted
|
|
66
|
+
* here for the same reason. Use the parts for an uncontrolled select.
|
|
67
67
|
*/
|
|
68
68
|
export declare function Select<T extends string = string>({ value, options, placeholder, emptyLabel, clearLabel, label, chevron, indicator, className, popupClassName, triggerProps, positionerProps, ...rest }: SelectProps<T>): import("react").JSX.Element;
|
|
69
69
|
//# sourceMappingURL=select.d.ts.map
|
package/dist/ui/select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/ui/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKtE,eAAO,MAAM,UAAU,uBAAiB,CAAC;AACzC,eAAO,MAAM,aAAa,wJAAoB,CAAC;AAC/C,e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wC;IACxC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpD,cAAc,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;IACvC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAChD,KAAK,EACL,OAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,KAAK,EACL,OAAO,EACP,SAAS,EACT,SAAS,EACT,cAAc,EACd,YAAY,EACZ,eAAe,EACf,GAAG,IAAI,EACR,EAAE,WAAW,CAAC,CAAC,CAAC,+BAwGhB"}
|
package/dist/ui/select.js
CHANGED
|
@@ -25,9 +25,9 @@ export const SelectSeparator = Primitive.Separator;
|
|
|
25
25
|
*
|
|
26
26
|
* Controlled only, and that is the point of `value ?? null`: React and Base UI both read
|
|
27
27
|
* `value={undefined}` as "uncontrolled", so a caller holding `T | undefined` in state would
|
|
28
|
-
* silently hand the field back to the primitive the moment the value cleared, and every
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* silently hand the field back to the primitive the moment the value cleared, and every later
|
|
29
|
+
* render would be ignored. `null` says "nothing selected" out loud. `defaultValue` is not accepted
|
|
30
|
+
* here for the same reason. Use the parts for an uncontrolled select.
|
|
31
31
|
*/
|
|
32
32
|
export function Select({ value, options = [], placeholder, emptyLabel, clearLabel, label, chevron, indicator, className, popupClassName, triggerProps, positionerProps, ...rest }) {
|
|
33
33
|
const selected = options.find((option) => option.value === value);
|