@duro-app/ui 5.11.0 → 5.12.0
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/dist/Table-ColfpgKV.js.map +1 -1
- package/dist/compiler-runtime-BuugS4D0.js.map +1 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/styles.css.d.ts +1 -0
- package/dist/components/Button/styles.css.d.ts.map +1 -1
- package/dist/components/Callout/Callout.d.ts.map +1 -1
- package/dist/components/Callout/styles.css.d.ts +3 -0
- package/dist/components/Callout/styles.css.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/DetailPanel/DetailPanel.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -17
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.stories.d.ts +4 -0
- package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/components/Dialog/native.css.d.ts +82 -0
- package/dist/components/Dialog/native.css.d.ts.map +1 -0
- package/dist/components/Dialog/parts.css.d.ts +82 -0
- package/dist/components/Dialog/parts.css.d.ts.map +1 -0
- package/dist/components/Dialog/parts.d.ts +35 -0
- package/dist/components/Dialog/parts.d.ts.map +1 -0
- package/dist/components/Dialog/styles.css.d.ts +1 -74
- package/dist/components/Dialog/styles.css.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/styles.css.d.ts +2 -0
- package/dist/components/Drawer/styles.css.d.ts.map +1 -1
- package/dist/components/Grid/styles.css.d.ts +1 -0
- package/dist/components/Grid/styles.css.d.ts.map +1 -1
- package/dist/components/Icon/Icon.d.ts +3 -9
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/geometry.d.ts +60 -0
- package/dist/components/Icon/geometry.d.ts.map +1 -0
- package/dist/components/Icon/types.d.ts +15 -0
- package/dist/components/Icon/types.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +5 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/styles.css.d.ts +1 -0
- package/dist/components/Input/styles.css.d.ts.map +1 -1
- package/dist/components/LinkButton/styles.css.d.ts +1 -0
- package/dist/components/LinkButton/styles.css.d.ts.map +1 -1
- package/dist/components/Meter/styles.css.d.ts +1 -0
- package/dist/components/Meter/styles.css.d.ts.map +1 -1
- package/dist/components/PageShell/styles.css.d.ts +2 -0
- package/dist/components/PageShell/styles.css.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -17
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.d.ts +3 -0
- package/dist/components/RadioGroup/RadioGroup.stories.d.ts.map +1 -1
- package/dist/components/RadioGroup/group.d.ts +31 -0
- package/dist/components/RadioGroup/group.d.ts.map +1 -0
- package/dist/components/RadioGroup/styles.css.d.ts +10 -0
- package/dist/components/RadioGroup/styles.css.d.ts.map +1 -1
- package/dist/components/ScrollArea/styles.css.d.ts +1 -0
- package/dist/components/ScrollArea/styles.css.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts +2 -6
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.types.d.ts +6 -0
- package/dist/components/Spinner/Spinner.types.d.ts.map +1 -0
- package/dist/components/Spinner/ring.css.d.ts +39 -0
- package/dist/components/Spinner/ring.css.d.ts.map +1 -0
- package/dist/components/Spinner/styles.css.d.ts +1 -28
- package/dist/components/Spinner/styles.css.d.ts.map +1 -1
- package/dist/components/StatusIcon/StatusIcon.d.ts.map +1 -1
- package/dist/components/StatusIcon/styles.css.d.ts +3 -0
- package/dist/components/StatusIcon/styles.css.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts +2 -18
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.types.d.ts +18 -0
- package/dist/components/Switch/Switch.types.d.ts.map +1 -0
- package/dist/components/TableOfContents/styles.css.d.ts +1 -0
- package/dist/components/TableOfContents/styles.css.d.ts.map +1 -1
- package/dist/components/Textarea/styles.css.d.ts +1 -0
- package/dist/components/Textarea/styles.css.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/styles.css.d.ts +11 -2
- package/dist/components/Toggle/styles.css.d.ts.map +1 -1
- package/dist/components/VirtualTable/styles.css.d.ts +6 -0
- package/dist/components/VirtualTable/styles.css.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +4299 -3566
- package/dist/index.js.map +1 -1
- package/dist/shared/portal/hostRegistry.d.ts +33 -0
- package/dist/shared/portal/hostRegistry.d.ts.map +1 -0
- package/dist/shared/useOverlayOpenState.d.ts +40 -0
- package/dist/shared/useOverlayOpenState.d.ts.map +1 -0
- package/dist/table.js +141 -135
- package/dist/table.js.map +1 -1
- package/package.json +34 -4
- package/src/components/Alert/Alert.tsx +14 -2
- package/src/components/Button/Button.tsx +3 -2
- package/src/components/Button/styles.css.ts +2 -0
- package/src/components/Callout/Callout.tsx +17 -3
- package/src/components/Callout/styles.css.ts +5 -0
- package/src/components/Checkbox/Checkbox.native.tsx +67 -0
- package/src/components/Checkbox/Checkbox.tsx +1 -50
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +3 -0
- package/src/components/DetailPanel/DetailPanel.tsx +9 -45
- package/src/components/Dialog/Dialog.native.tsx +296 -0
- package/src/components/Dialog/Dialog.stories.tsx +71 -0
- package/src/components/Dialog/Dialog.tsx +41 -130
- package/src/components/Dialog/native.css.ts +78 -0
- package/src/components/Dialog/parts.css.ts +101 -0
- package/src/components/Dialog/parts.tsx +61 -0
- package/src/components/Dialog/styles.css.ts +2 -89
- package/src/components/Drawer/Drawer.tsx +20 -49
- package/src/components/Drawer/styles.css.ts +4 -0
- package/src/components/Grid/styles.css.ts +2 -0
- package/src/components/Icon/Icon.native.tsx +54 -0
- package/src/components/Icon/Icon.tsx +19 -430
- package/src/components/Icon/geometry.ts +456 -0
- package/src/components/Icon/types.ts +74 -0
- package/src/components/Input/Input.tsx +8 -0
- package/src/components/Input/styles.css.ts +2 -0
- package/src/components/LinkButton/styles.css.ts +2 -0
- package/src/components/Meter/styles.css.ts +2 -0
- package/src/components/PageShell/styles.css.ts +4 -0
- package/src/components/RadioGroup/RadioGroup.meta.ts +1 -1
- package/src/components/RadioGroup/RadioGroup.native.tsx +48 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +64 -1
- package/src/components/RadioGroup/RadioGroup.tsx +8 -83
- package/src/components/RadioGroup/group.tsx +85 -0
- package/src/components/RadioGroup/styles.css.ts +13 -0
- package/src/components/ScrollArea/styles.css.ts +2 -0
- package/src/components/Spinner/Spinner.native.tsx +37 -0
- package/src/components/Spinner/Spinner.tsx +6 -15
- package/src/components/Spinner/Spinner.types.ts +6 -0
- package/src/components/Spinner/ring.css.ts +45 -0
- package/src/components/Spinner/styles.css.ts +2 -32
- package/src/components/StatusIcon/StatusIcon.tsx +13 -2
- package/src/components/StatusIcon/styles.css.ts +5 -0
- package/src/components/Switch/Switch.native.tsx +45 -0
- package/src/components/Switch/Switch.tsx +22 -44
- package/src/components/Switch/Switch.types.ts +18 -0
- package/src/components/TableOfContents/styles.css.ts +2 -0
- package/src/components/Textarea/styles.css.ts +2 -0
- package/src/components/ThemeProvider/ThemeProvider.native.tsx +70 -10
- package/src/components/Toggle/Toggle.tsx +2 -0
- package/src/components/Toggle/styles.css.ts +14 -2
- package/src/components/VirtualTable/styles.css.ts +12 -0
- package/src/index.native.ts +28 -1
- package/src/native-guard/globals.d.ts +10 -0
- package/src/native-guard/react-dom.d.ts +3 -0
- package/src/shared/accessibilityFocus.native.ts +23 -0
- package/src/shared/portal/OverlayModal.native.tsx +51 -0
- package/src/shared/portal/PortalHost.native.tsx +102 -0
- package/src/shared/portal/hostRegistry.ts +76 -0
- package/src/shared/portal/themeScope.native.ts +18 -0
- package/src/shared/safeArea.native.ts +22 -0
- package/src/shared/useOverlayOpenState.ts +128 -0
- package/dist/components/ThemeProvider/ThemeProvider.native.d.ts +0 -10
- package/dist/components/ThemeProvider/ThemeProvider.native.d.ts.map +0 -1
- package/dist/index.native.d.ts +0 -33
- package/dist/index.native.d.ts.map +0 -1
- package/dist/platform.native.d.ts +0 -2
- package/dist/platform.native.d.ts.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** One passive surface (a toast region) waiting for a host to draw it. */
|
|
3
|
+
export interface PortalEntry {
|
|
4
|
+
readonly key: string;
|
|
5
|
+
/** Numeric layer from `LAYERS` in `@duro-app/tokens/keys`; higher draws on top. */
|
|
6
|
+
readonly layer: number;
|
|
7
|
+
readonly node: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface HostRegistrySnapshot {
|
|
10
|
+
/** The host that draws every entry: the last one presented, else the root. */
|
|
11
|
+
readonly topHost: string | undefined;
|
|
12
|
+
/** Entries ordered by layer, lowest first (equal layers keep insertion order). */
|
|
13
|
+
readonly entries: readonly PortalEntry[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The hosts that passive surfaces draw into, on native: the app root, each
|
|
17
|
+
* open Duro Modal and each `PortalHost` a consumer mounts in a natively
|
|
18
|
+
* presented route. Entries render in the top host only, so a toast raised
|
|
19
|
+
* under an open Dialog draws above it.
|
|
20
|
+
*
|
|
21
|
+
* A plain store (subscribe / getSnapshot) for `useSyncExternalStore`; it holds
|
|
22
|
+
* no React state and imports nothing from React Native.
|
|
23
|
+
*/
|
|
24
|
+
export interface HostRegistry {
|
|
25
|
+
/** Adds a host. A `base` host (the app root) always sits below the others. */
|
|
26
|
+
addHost(id: string, placement: 'base' | 'presented'): () => void;
|
|
27
|
+
setEntry(entry: PortalEntry): void;
|
|
28
|
+
removeEntry(key: string): void;
|
|
29
|
+
getSnapshot(): HostRegistrySnapshot;
|
|
30
|
+
subscribe(listener: () => void): () => void;
|
|
31
|
+
}
|
|
32
|
+
export declare function createHostRegistry(): HostRegistry;
|
|
33
|
+
//# sourceMappingURL=hostRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hostRegistry.d.ts","sourceRoot":"","sources":["../../../src/shared/portal/hostRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AAEpC,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;CACzC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,8EAA8E;IAC9E,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,IAAI,CAAA;IAChE,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;IAClC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,WAAW,IAAI,oBAAoB,CAAA;IACnC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;CAC5C;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CAwCjD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DurationToken } from '@duro-app/tokens/keys';
|
|
2
|
+
/**
|
|
3
|
+
* When the owner hears that the overlay closed.
|
|
4
|
+
* - `after-exit`: once the exit animation has played (Dialog, Drawer): the
|
|
5
|
+
* overlay stays logically open while it animates out.
|
|
6
|
+
* - `at-once`: as soon as the close is asked for (DetailPanel); the panel
|
|
7
|
+
* still animates out while `present`.
|
|
8
|
+
*/
|
|
9
|
+
export type CloseNotice = 'after-exit' | 'at-once';
|
|
10
|
+
interface Options {
|
|
11
|
+
/** Controlled open state. */
|
|
12
|
+
open: boolean | undefined;
|
|
13
|
+
/** Initial open state when uncontrolled. */
|
|
14
|
+
defaultOpen: boolean;
|
|
15
|
+
onOpenChange: ((open: boolean) => void) | undefined;
|
|
16
|
+
/** Motion token the exit animation lasts. */
|
|
17
|
+
exitDuration: DurationToken;
|
|
18
|
+
closeNotice: CloseNotice;
|
|
19
|
+
}
|
|
20
|
+
export interface OverlayOpenState {
|
|
21
|
+
/** Logically open (what `open` / the uncontrolled state says). */
|
|
22
|
+
open: boolean;
|
|
23
|
+
/** Rendered: open, or animating out. */
|
|
24
|
+
present: boolean;
|
|
25
|
+
/** Playing the exit animation. */
|
|
26
|
+
closing: boolean;
|
|
27
|
+
requestOpen: () => void;
|
|
28
|
+
/** Animated close. Does nothing while a close is already playing. */
|
|
29
|
+
requestClose: () => void;
|
|
30
|
+
/** Close without the exit animation (a swipe that already moved the panel out). */
|
|
31
|
+
closeNow: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Open, presence and exit-animation state shared by Dialog, Drawer and
|
|
35
|
+
* DetailPanel on both platforms. A controlled `open` that turns false from
|
|
36
|
+
* outside plays the exit animation too.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useOverlayOpenState({ open: controlledOpen, defaultOpen, onOpenChange, exitDuration, closeNotice, }: Options): OverlayOpenState;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=useOverlayOpenState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOverlayOpenState.d.ts","sourceRoot":"","sources":["../../src/shared/useOverlayOpenState.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,aAAa,EAAC,MAAM,uBAAuB,CAAA;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,SAAS,CAAA;AAElD,UAAU,OAAO;IACf,6BAA6B;IAC7B,IAAI,EAAE,OAAO,GAAG,SAAS,CAAA;IACzB,4CAA4C;IAC5C,WAAW,EAAE,OAAO,CAAA;IACpB,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IACnD,6CAA6C;IAC7C,YAAY,EAAE,aAAa,CAAA;IAC3B,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,IAAI,EAAE,OAAO,CAAA;IACb,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,qEAAqE;IACrE,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,mFAAmF;IACnF,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EAAE,cAAc,EACpB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,EAAE,OAAO,GAAG,gBAAgB,CA+E5B"}
|