@duro-app/ui 5.12.0 → 5.13.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-Bms2ftt3.js +1694 -0
- package/dist/Table-Bms2ftt3.js.map +1 -0
- package/dist/components/AppShell/native.css.d.ts +53 -0
- package/dist/components/AppShell/native.css.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.d.ts +7 -35
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.meta.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerScroll.stories.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerSnap.stories.d.ts +20 -0
- package/dist/components/Drawer/DrawerSnap.stories.d.ts.map +1 -0
- package/dist/components/Drawer/native.css.d.ts +55 -0
- package/dist/components/Drawer/native.css.d.ts.map +1 -0
- package/dist/components/Drawer/parts.css.d.ts +96 -0
- package/dist/components/Drawer/parts.css.d.ts.map +1 -0
- package/dist/components/Drawer/parts.d.ts +56 -0
- package/dist/components/Drawer/parts.d.ts.map +1 -0
- package/dist/components/Drawer/sheetPhysics.d.ts +56 -0
- package/dist/components/Drawer/sheetPhysics.d.ts.map +1 -0
- package/dist/components/Drawer/styles.css.d.ts +13 -58
- package/dist/components/Drawer/styles.css.d.ts.map +1 -1
- package/dist/components/Drawer/touchInput.d.ts +35 -0
- package/dist/components/Drawer/touchInput.d.ts.map +1 -0
- package/dist/components/Drawer/useDrawerRoot.d.ts +33 -0
- package/dist/components/Drawer/useDrawerRoot.d.ts.map +1 -0
- package/dist/components/Drawer/useSheetHeights.d.ts +7 -0
- package/dist/components/Drawer/useSheetHeights.d.ts.map +1 -0
- package/dist/components/Drawer/useSwipeDismiss.d.ts +13 -2
- package/dist/components/Drawer/useSwipeDismiss.d.ts.map +1 -1
- package/dist/components/Menu/Menu.d.ts +7 -1
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/native.css.d.ts +14 -0
- package/dist/components/Menu/native.css.d.ts.map +1 -0
- package/dist/components/Menu/useMenuOpen.d.ts +16 -0
- package/dist/components/Menu/useMenuOpen.d.ts.map +1 -0
- package/dist/components/Menu/useMenuRoot.d.ts +3 -6
- package/dist/components/Menu/useMenuRoot.d.ts.map +1 -1
- package/dist/components/Popover/native.css.d.ts +11 -0
- package/dist/components/Popover/native.css.d.ts.map +1 -0
- package/dist/components/SideNav/Chevron.d.ts +4 -0
- package/dist/components/SideNav/Chevron.d.ts.map +1 -0
- package/dist/components/SideNav/SideNav.d.ts.map +1 -1
- package/dist/components/SideNav/styles.css.d.ts +6 -0
- package/dist/components/SideNav/styles.css.d.ts.map +1 -1
- package/dist/components/SideNav/types.d.ts +6 -0
- package/dist/components/SideNav/types.d.ts.map +1 -0
- package/dist/components/SplitPane/SplitPane.d.ts +38 -0
- package/dist/components/SplitPane/SplitPane.d.ts.map +1 -0
- package/dist/components/SplitPane/SplitPane.meta.d.ts +3 -0
- package/dist/components/SplitPane/SplitPane.meta.d.ts.map +1 -0
- package/dist/components/SplitPane/SplitPane.stories.d.ts +17 -0
- package/dist/components/SplitPane/SplitPane.stories.d.ts.map +1 -0
- package/dist/components/SplitPane/styles.css.d.ts +78 -0
- package/dist/components/SplitPane/styles.css.d.ts.map +1 -0
- package/dist/components/Tabs/TabLayout.d.ts +7 -0
- package/dist/components/Tabs/TabLayout.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/indicator.d.ts +28 -0
- package/dist/components/Tabs/indicator.d.ts.map +1 -0
- package/dist/components/Tabs/styles.css.d.ts +4 -0
- package/dist/components/Tabs/styles.css.d.ts.map +1 -1
- package/dist/components/Tabs/useTabIndicator.d.ts +4 -0
- package/dist/components/Tabs/useTabIndicator.d.ts.map +1 -0
- package/dist/components/Tabs/useTabKeys.d.ts +13 -0
- package/dist/components/Tabs/useTabKeys.d.ts.map +1 -0
- package/dist/components/Tag/RemoveGlyph.d.ts +4 -0
- package/dist/components/Tag/RemoveGlyph.d.ts.map +1 -0
- package/dist/components/Tag/Tag.d.ts +2 -24
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/Tag/styles.css.d.ts +8 -0
- package/dist/components/Tag/styles.css.d.ts.map +1 -1
- package/dist/components/Tag/types.d.ts +39 -0
- package/dist/components/Tag/types.d.ts.map +1 -0
- package/dist/components/Toast/ToastProvider.d.ts +2 -21
- package/dist/components/Toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/Toast/native.css.d.ts +81 -0
- package/dist/components/Toast/native.css.d.ts.map +1 -0
- package/dist/components/Toast/store.d.ts +47 -0
- package/dist/components/Toast/store.d.ts.map +1 -0
- package/dist/components/Tooltip/TooltipHint.d.ts +9 -0
- package/dist/components/Tooltip/TooltipHint.d.ts.map +1 -0
- package/dist/components/Tree/Tree.d.ts.map +1 -1
- package/dist/components/Tree/styles.css.d.ts +6 -0
- package/dist/components/Tree/styles.css.d.ts.map +1 -1
- package/dist/components/Tree/useTreeKeyboard.d.ts +19 -0
- package/dist/components/Tree/useTreeKeyboard.d.ts.map +1 -0
- package/dist/components/VirtualList/VirtualList.d.ts +33 -0
- package/dist/components/VirtualList/VirtualList.d.ts.map +1 -0
- package/dist/components/VirtualList/VirtualList.meta.d.ts +3 -0
- package/dist/components/VirtualList/VirtualList.meta.d.ts.map +1 -0
- package/dist/components/VirtualList/VirtualList.stories.d.ts +15 -0
- package/dist/components/VirtualList/VirtualList.stories.d.ts.map +1 -0
- package/dist/components/VirtualList/styles.css.d.ts +28 -0
- package/dist/components/VirtualList/styles.css.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4935 -4260
- package/dist/index.js.map +1 -1
- package/dist/shared/ButtonHost.d.ts +11 -0
- package/dist/shared/ButtonHost.d.ts.map +1 -0
- package/dist/shared/pressableChild.d.ts +14 -0
- package/dist/shared/pressableChild.d.ts.map +1 -0
- package/dist/table.js +1 -1
- package/package.json +2 -2
- package/src/components/AppShell/AppShell.meta.ts +1 -1
- package/src/components/AppShell/AppShell.native.tsx +174 -0
- package/src/components/AppShell/native.css.ts +56 -0
- package/src/components/Button/Button.tsx +3 -3
- package/src/components/Drawer/Drawer.meta.ts +2 -1
- package/src/components/Drawer/Drawer.native.tsx +469 -0
- package/src/components/Drawer/Drawer.tsx +58 -145
- package/src/components/Drawer/DrawerScroll.stories.tsx +4 -54
- package/src/components/Drawer/DrawerSnap.stories.tsx +205 -0
- package/src/components/Drawer/native.css.ts +58 -0
- package/src/components/Drawer/parts.css.ts +125 -0
- package/src/components/Drawer/parts.tsx +110 -0
- package/src/components/Drawer/sheetPhysics.ts +103 -0
- package/src/components/Drawer/styles.css.ts +15 -74
- package/src/components/Drawer/touchInput.ts +81 -0
- package/src/components/Drawer/useDrawerRoot.ts +90 -0
- package/src/components/Drawer/useSheetHeights.ts +42 -0
- package/src/components/Drawer/useSwipeDismiss.ts +146 -23
- package/src/components/Menu/Menu.meta.ts +1 -1
- package/src/components/Menu/Menu.native.tsx +268 -0
- package/src/components/Menu/Menu.tsx +11 -2
- package/src/components/Menu/native.css.ts +18 -0
- package/src/components/Menu/useMenuOpen.ts +33 -0
- package/src/components/Menu/useMenuRoot.ts +7 -26
- package/src/components/Popover/Popover.meta.ts +1 -1
- package/src/components/Popover/Popover.native.tsx +205 -0
- package/src/components/Popover/native.css.ts +13 -0
- package/src/components/SideNav/Chevron.native.tsx +20 -0
- package/src/components/SideNav/Chevron.tsx +20 -0
- package/src/components/SideNav/SideNav.meta.ts +1 -1
- package/src/components/SideNav/SideNav.tsx +57 -41
- package/src/components/SideNav/styles.css.ts +8 -0
- package/src/components/SideNav/types.ts +6 -0
- package/src/components/SplitPane/SplitPane.meta.ts +40 -0
- package/src/components/SplitPane/SplitPane.native.tsx +47 -0
- package/src/components/SplitPane/SplitPane.stories.tsx +148 -0
- package/src/components/SplitPane/SplitPane.tsx +218 -0
- package/src/components/SplitPane/styles.css.ts +81 -0
- package/src/components/Tabs/TabLayout.native.tsx +9 -0
- package/src/components/Tabs/TabLayout.tsx +6 -0
- package/src/components/Tabs/Tabs.meta.ts +1 -1
- package/src/components/Tabs/Tabs.tsx +38 -136
- package/src/components/Tabs/indicator.ts +36 -0
- package/src/components/Tabs/styles.css.ts +7 -0
- package/src/components/Tabs/useTabIndicator.native.ts +35 -0
- package/src/components/Tabs/useTabIndicator.ts +49 -0
- package/src/components/Tabs/useTabKeys.native.ts +2 -0
- package/src/components/Tabs/useTabKeys.ts +99 -0
- package/src/components/Tag/RemoveGlyph.native.tsx +17 -0
- package/src/components/Tag/RemoveGlyph.tsx +10 -0
- package/src/components/Tag/Tag.meta.ts +1 -1
- package/src/components/Tag/Tag.native.tsx +70 -0
- package/src/components/Tag/Tag.tsx +9 -37
- package/src/components/Tag/styles.css.ts +9 -0
- package/src/components/Tag/types.ts +43 -0
- package/src/components/Toast/Toast.meta.ts +1 -1
- package/src/components/Toast/ToastProvider.native.tsx +226 -0
- package/src/components/Toast/ToastProvider.tsx +22 -84
- package/src/components/Toast/native.css.ts +78 -0
- package/src/components/Toast/store.ts +96 -0
- package/src/components/Toggle/Toggle.tsx +3 -3
- package/src/components/Tooltip/Tooltip.meta.ts +1 -1
- package/src/components/Tooltip/Tooltip.native.tsx +36 -0
- package/src/components/Tooltip/TooltipHint.ts +13 -0
- package/src/components/Tree/Tree.meta.ts +1 -1
- package/src/components/Tree/Tree.tsx +23 -135
- package/src/components/Tree/styles.css.ts +6 -0
- package/src/components/Tree/useTreeKeyboard.native.ts +5 -0
- package/src/components/Tree/useTreeKeyboard.ts +152 -0
- package/src/components/VirtualList/VirtualList.meta.ts +39 -0
- package/src/components/VirtualList/VirtualList.stories.tsx +95 -0
- package/src/components/VirtualList/VirtualList.tsx +103 -0
- package/src/components/VirtualList/styles.css.ts +31 -0
- package/src/hooks/useContainerBelow.native.ts +30 -0
- package/src/index.native.ts +33 -0
- package/src/index.ts +8 -1
- package/src/shared/ButtonHost.native.tsx +70 -0
- package/src/shared/ButtonHost.tsx +12 -0
- package/src/shared/portal/AnchoredOverlay.native.tsx +117 -0
- package/src/shared/pressableChild.ts +33 -0
- package/src/shared/useKeyboardHeight.native.ts +18 -0
- package/src/shared/useScreenReaderEnabled.native.ts +19 -0
- package/dist/Table-ColfpgKV.js +0 -1552
- package/dist/Table-ColfpgKV.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SnapPoint } from './Drawer';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj;
|
|
6
|
+
interface SheetArgs {
|
|
7
|
+
snapPoints: SnapPoint[];
|
|
8
|
+
defaultSnapPoint: SnapPoint;
|
|
9
|
+
titleAlign: 'start' | 'center';
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const SnapSheet: StoryObj<SheetArgs>;
|
|
13
|
+
export declare const DragUpGrowsToLarge: Story;
|
|
14
|
+
export declare const DragDownShrinksToMedium: Story;
|
|
15
|
+
export declare const DragDownBelowMediumDismisses: Story;
|
|
16
|
+
export declare const SlowShortDragSnapsBack: Story;
|
|
17
|
+
export declare const GrabberTapCyclesDetents: Story;
|
|
18
|
+
export declare const DragUpOnContentGrowsThenScrolls: Story;
|
|
19
|
+
export declare const DoneCloses: Story;
|
|
20
|
+
//# sourceMappingURL=DrawerSnap.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerSnap.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerSnap.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAS,KAAK,SAAS,EAAC,MAAM,UAAU,CAAA;AAK/C,QAAA,MAAM,IAAI,EAAE,IAGX,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAA;AAIrB,UAAU,SAAS;IACjB,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,gBAAgB,EAAE,SAAS,CAAA;IAC3B,UAAU,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC9B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;CACvC;AAwCD,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,SAAS,CA2BzC,CAAA;AA8BD,eAAO,MAAM,kBAAkB,EAAE,KAQhC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,KAQrC,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAQ1C,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAWpC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,KAYrC,CAAA;AAED,eAAO,MAAM,+BAA+B,EAAE,KAiB7C,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KASxB,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { css } from 'react-strict-dom';
|
|
2
|
+
/**
|
|
3
|
+
* Native Drawer surfaces. Motion is Reanimated's (plan N0, Decision 4): these
|
|
4
|
+
* styles draw the panel and backdrop, the animated views around them move them.
|
|
5
|
+
*/
|
|
6
|
+
export declare const nativeStyles: Readonly<{
|
|
7
|
+
readonly fill: Readonly<{
|
|
8
|
+
readonly position: css.StyleXClassNameFor<"position", "absolute">;
|
|
9
|
+
readonly top: css.StyleXClassNameFor<"top", 0>;
|
|
10
|
+
readonly left: css.StyleXClassNameFor<"left", 0>;
|
|
11
|
+
readonly right: css.StyleXClassNameFor<"right", 0>;
|
|
12
|
+
readonly bottom: css.StyleXClassNameFor<"bottom", 0>;
|
|
13
|
+
}>;
|
|
14
|
+
readonly scrim: Readonly<{
|
|
15
|
+
readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
|
|
16
|
+
}>;
|
|
17
|
+
readonly panel: Readonly<{
|
|
18
|
+
readonly flexGrow: css.StyleXClassNameFor<"flexGrow", 1>;
|
|
19
|
+
readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
|
|
20
|
+
readonly boxShadow: css.StyleXClassNameFor<"boxShadow", string>;
|
|
21
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
22
|
+
readonly flexDirection: css.StyleXClassNameFor<"flexDirection", "column">;
|
|
23
|
+
readonly overflow: css.StyleXClassNameFor<"overflow", "hidden">;
|
|
24
|
+
}>;
|
|
25
|
+
readonly panelBottom: Readonly<{
|
|
26
|
+
readonly borderTopWidth: css.StyleXClassNameFor<"borderTopWidth", string>;
|
|
27
|
+
readonly borderTopStyle: css.StyleXClassNameFor<"borderTopStyle", "solid">;
|
|
28
|
+
readonly borderTopColor: css.StyleXClassNameFor<"borderTopColor", string>;
|
|
29
|
+
readonly borderTopLeftRadius: css.StyleXClassNameFor<"borderTopLeftRadius", string>;
|
|
30
|
+
readonly borderTopRightRadius: css.StyleXClassNameFor<"borderTopRightRadius", string>;
|
|
31
|
+
}>;
|
|
32
|
+
readonly panelRight: Readonly<{
|
|
33
|
+
readonly borderLeftWidth: css.StyleXClassNameFor<"borderLeftWidth", string>;
|
|
34
|
+
readonly borderLeftStyle: css.StyleXClassNameFor<"borderLeftStyle", "solid">;
|
|
35
|
+
readonly borderLeftColor: css.StyleXClassNameFor<"borderLeftColor", string>;
|
|
36
|
+
}>;
|
|
37
|
+
readonly panelLeft: Readonly<{
|
|
38
|
+
readonly borderRightWidth: css.StyleXClassNameFor<"borderRightWidth", string>;
|
|
39
|
+
readonly borderRightStyle: css.StyleXClassNameFor<"borderRightStyle", "solid">;
|
|
40
|
+
readonly borderRightColor: css.StyleXClassNameFor<"borderRightColor", string>;
|
|
41
|
+
}>;
|
|
42
|
+
readonly insets: (top: number, bottom: number) => readonly [Readonly<{
|
|
43
|
+
paddingTop: css.StyleXClassNameFor<"paddingTop", number>;
|
|
44
|
+
paddingBottom: css.StyleXClassNameFor<"paddingBottom", number>;
|
|
45
|
+
}>, css.InlineStyles];
|
|
46
|
+
readonly bodyContent: Readonly<{
|
|
47
|
+
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
48
|
+
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
49
|
+
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
50
|
+
}>;
|
|
51
|
+
readonly hiddenBelow: (height: number) => readonly [Readonly<{
|
|
52
|
+
paddingBottom: css.StyleXClassNameFor<"paddingBottom", number>;
|
|
53
|
+
}>, css.InlineStyles];
|
|
54
|
+
}>;
|
|
55
|
+
//# sourceMappingURL=native.css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.css.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/native.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAMpC;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CvB,CAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { css } from 'react-strict-dom';
|
|
2
|
+
/** Styles of the Drawer parts both platforms draw (no animations: native has none). */
|
|
3
|
+
export declare const partStyles: Readonly<{
|
|
4
|
+
readonly grabberHit: Readonly<{
|
|
5
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
6
|
+
readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
|
|
7
|
+
readonly justifyContent: css.StyleXClassNameFor<"justifyContent", "center">;
|
|
8
|
+
readonly alignSelf: css.StyleXClassNameFor<"alignSelf", "stretch">;
|
|
9
|
+
readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 0>;
|
|
10
|
+
readonly paddingTop: css.StyleXClassNameFor<"paddingTop", string>;
|
|
11
|
+
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
12
|
+
readonly borderWidth: css.StyleXClassNameFor<"borderWidth", 0>;
|
|
13
|
+
readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", "transparent">;
|
|
14
|
+
}>;
|
|
15
|
+
readonly grabber: Readonly<{
|
|
16
|
+
readonly display: css.StyleXClassNameFor<"display", "block">;
|
|
17
|
+
readonly width: css.StyleXClassNameFor<"width", string>;
|
|
18
|
+
readonly height: css.StyleXClassNameFor<"height", string>;
|
|
19
|
+
readonly borderRadius: css.StyleXClassNameFor<"borderRadius", string>;
|
|
20
|
+
readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
|
|
21
|
+
}>;
|
|
22
|
+
readonly header: Readonly<{
|
|
23
|
+
readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 0>;
|
|
24
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
25
|
+
readonly alignItems: css.StyleXClassNameFor<"alignItems", "flex-start">;
|
|
26
|
+
readonly justifyContent: css.StyleXClassNameFor<"justifyContent", "space-between">;
|
|
27
|
+
readonly paddingTop: css.StyleXClassNameFor<"paddingTop", string>;
|
|
28
|
+
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
29
|
+
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
30
|
+
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
31
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
32
|
+
}>;
|
|
33
|
+
readonly headerUnderGrabber: Readonly<{
|
|
34
|
+
readonly paddingTop: css.StyleXClassNameFor<"paddingTop", 0>;
|
|
35
|
+
}>;
|
|
36
|
+
readonly headerCentered: Readonly<{
|
|
37
|
+
readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
|
|
38
|
+
}>;
|
|
39
|
+
readonly headerSide: Readonly<{
|
|
40
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
41
|
+
readonly flexGrow: css.StyleXClassNameFor<"flexGrow", 1>;
|
|
42
|
+
readonly flexBasis: css.StyleXClassNameFor<"flexBasis", 0>;
|
|
43
|
+
}>;
|
|
44
|
+
readonly headerEnd: Readonly<{
|
|
45
|
+
readonly justifyContent: css.StyleXClassNameFor<"justifyContent", "flex-end">;
|
|
46
|
+
}>;
|
|
47
|
+
readonly title: Readonly<{
|
|
48
|
+
readonly fontSize: css.StyleXClassNameFor<"fontSize", string>;
|
|
49
|
+
readonly fontWeight: css.StyleXClassNameFor<"fontWeight", string>;
|
|
50
|
+
readonly lineHeight: css.StyleXClassNameFor<"lineHeight", string>;
|
|
51
|
+
readonly color: css.StyleXClassNameFor<"color", string>;
|
|
52
|
+
readonly margin: css.StyleXClassNameFor<"margin", 0>;
|
|
53
|
+
}>;
|
|
54
|
+
readonly description: Readonly<{
|
|
55
|
+
readonly fontSize: css.StyleXClassNameFor<"fontSize", string>;
|
|
56
|
+
readonly lineHeight: css.StyleXClassNameFor<"lineHeight", string>;
|
|
57
|
+
readonly color: css.StyleXClassNameFor<"color", string>;
|
|
58
|
+
readonly margin: css.StyleXClassNameFor<"margin", 0>;
|
|
59
|
+
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
60
|
+
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
61
|
+
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
62
|
+
}>;
|
|
63
|
+
readonly footer: Readonly<{
|
|
64
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
65
|
+
readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
|
|
66
|
+
readonly justifyContent: css.StyleXClassNameFor<"justifyContent", "flex-end">;
|
|
67
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
68
|
+
readonly paddingTop: css.StyleXClassNameFor<"paddingTop", string>;
|
|
69
|
+
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
70
|
+
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
71
|
+
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
72
|
+
readonly borderTopWidth: css.StyleXClassNameFor<"borderTopWidth", string>;
|
|
73
|
+
readonly borderTopStyle: css.StyleXClassNameFor<"borderTopStyle", "solid">;
|
|
74
|
+
readonly borderTopColor: css.StyleXClassNameFor<"borderTopColor", string>;
|
|
75
|
+
}>;
|
|
76
|
+
readonly closeButton: Readonly<{
|
|
77
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
78
|
+
readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
|
|
79
|
+
readonly justifyContent: css.StyleXClassNameFor<"justifyContent", "center">;
|
|
80
|
+
readonly width: css.StyleXClassNameFor<"width", string>;
|
|
81
|
+
readonly height: css.StyleXClassNameFor<"height", string>;
|
|
82
|
+
readonly borderRadius: css.StyleXClassNameFor<"borderRadius", string>;
|
|
83
|
+
readonly borderWidth: css.StyleXClassNameFor<"borderWidth", 0>;
|
|
84
|
+
readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
|
|
85
|
+
readonly color: css.StyleXClassNameFor<"color", string>;
|
|
86
|
+
readonly cursor: css.StyleXClassNameFor<"cursor", "pointer">;
|
|
87
|
+
readonly padding: css.StyleXClassNameFor<"padding", 0>;
|
|
88
|
+
readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 0>;
|
|
89
|
+
readonly transitionProperty: css.StyleXClassNameFor<"transitionProperty", "background-color">;
|
|
90
|
+
readonly transitionDuration: css.StyleXClassNameFor<"transitionDuration", string>;
|
|
91
|
+
}>;
|
|
92
|
+
readonly inlineWrapper: Readonly<{
|
|
93
|
+
readonly display: css.StyleXClassNameFor<"display", "inline-flex">;
|
|
94
|
+
}>;
|
|
95
|
+
}>;
|
|
96
|
+
//# sourceMappingURL=parts.css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parts.css.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/parts.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAQpC,uFAAuF;AACvF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmHrB,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { DurationToken } from '@duro-app/tokens/keys';
|
|
3
|
+
import { SnapPoint } from './sheetPhysics';
|
|
4
|
+
export type DrawerAnchor = 'right' | 'left' | 'bottom';
|
|
5
|
+
export type DrawerSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
export type { SnapPoint };
|
|
7
|
+
export interface DrawerContextValue {
|
|
8
|
+
/** Rendered: open, or playing the exit animation. */
|
|
9
|
+
open: boolean;
|
|
10
|
+
closing: boolean;
|
|
11
|
+
closeDuration: DurationToken;
|
|
12
|
+
anchor: DrawerAnchor;
|
|
13
|
+
dismissable: boolean;
|
|
14
|
+
swipeDismiss: boolean;
|
|
15
|
+
requestOpen: () => void;
|
|
16
|
+
requestClose: () => void;
|
|
17
|
+
/** Close immediately without the exit animation (a swipe has played its own) */
|
|
18
|
+
requestCloseImmediate: () => void;
|
|
19
|
+
titleId: string;
|
|
20
|
+
descriptionId: string;
|
|
21
|
+
/** The panel's host: a DOM element on the web, a view on native */
|
|
22
|
+
panelRef: RefObject<unknown>;
|
|
23
|
+
/** A bottom sheet's detents, ascending; empty when the drawer has none */
|
|
24
|
+
snapPoints: readonly SnapPoint[];
|
|
25
|
+
/** Index into snapPoints the sheet rests at */
|
|
26
|
+
snapIndex: number;
|
|
27
|
+
setSnapIndex: (index: number) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare const DrawerContext: import('react').Context<DrawerContextValue | null>;
|
|
30
|
+
export declare function useDrawer(): DrawerContextValue;
|
|
31
|
+
export interface GrabberLabels {
|
|
32
|
+
/** The grabber's name when a press grows the sheet */
|
|
33
|
+
expand: string;
|
|
34
|
+
/** The grabber's name when a press shrinks it */
|
|
35
|
+
collapse: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const DEFAULT_GRABBER_LABELS: GrabberLabels;
|
|
38
|
+
interface HeaderProps {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* 'center' puts the Title in the middle and the other children at the end,
|
|
42
|
+
* as a phone sheet does (a text close button on the right). Default: 'start'
|
|
43
|
+
*/
|
|
44
|
+
titleAlign?: 'start' | 'center';
|
|
45
|
+
}
|
|
46
|
+
export declare function Header({ children, titleAlign }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function Title({ children }: {
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function Description({ children }: {
|
|
51
|
+
children: ReactNode;
|
|
52
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare function Footer({ children }: {
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
//# sourceMappingURL=parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/parts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EAEf,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAE7C,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;AACtD,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,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,EAAC,QAAQ,EAAC,EAAE;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,2CAO5D;AAED,wBAAgB,MAAM,CAAC,EAAC,QAAQ,EAAC,EAAE;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,2CAEvD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The drawer's drag rules, shared by the web (pointer events) and native
|
|
3
|
+
* (Gesture Handler on the UI thread) so both settle a drag the same way.
|
|
4
|
+
* Pure numbers: no DOM, no React Native. The functions the native drag
|
|
5
|
+
* calls on the UI thread are worklets ('worklet'); on the web the directive
|
|
6
|
+
* is an inert string.
|
|
7
|
+
*/
|
|
8
|
+
/** A bottom-sheet detent (plan N0, Decision 5). */
|
|
9
|
+
export type SnapPoint = 'medium' | 'large';
|
|
10
|
+
/** Fraction of the panel (or of the lowest detent) a drag must cover to dismiss */
|
|
11
|
+
export declare const DISMISS_THRESHOLD = 0.3;
|
|
12
|
+
/** Release speed (px/ms) that dismisses, or moves one detent, whatever the distance */
|
|
13
|
+
export declare const VELOCITY_THRESHOLD = 0.5;
|
|
14
|
+
/** Duration of the slide-out once a drag dismisses (ms) */
|
|
15
|
+
export declare const DISMISS_DURATION: 160;
|
|
16
|
+
/** Duration of the settle onto a detent, or the snap back (ms) */
|
|
17
|
+
export declare const SNAP_DURATION: 200;
|
|
18
|
+
/** Movement (px) before a press becomes a drag; under it a tap stays a tap */
|
|
19
|
+
export declare const DRAG_SLOP = 8;
|
|
20
|
+
/** Movement (px) across the drag's axis that hands the gesture to a scroll instead */
|
|
21
|
+
export declare const CROSS_SLOP = 16;
|
|
22
|
+
/** 'medium' is half the window */
|
|
23
|
+
export declare const MEDIUM_FRACTION = 0.5;
|
|
24
|
+
/** How far (px) a snap sheet may be pulled past its largest detent: it resists, never further */
|
|
25
|
+
export declare const SNAP_MAX_OVERSHOOT: 24;
|
|
26
|
+
/** Height of one detent: 'medium' half the window, 'large' the window less its top inset. */
|
|
27
|
+
export declare function detentHeight(point: SnapPoint, windowHeight: number, topInset: number): number;
|
|
28
|
+
/** The detents in ascending height, each once. */
|
|
29
|
+
export declare function sortSnapPoints(points: readonly SnapPoint[]): SnapPoint[];
|
|
30
|
+
/**
|
|
31
|
+
* Where a released drag settles: a detent index into `heights` (ascending),
|
|
32
|
+
* or 'dismiss'.
|
|
33
|
+
*
|
|
34
|
+
* - A fling (|velocity| over VELOCITY_THRESHOLD) moves one detent in its
|
|
35
|
+
* direction from the detent it started at; down from the lowest dismisses.
|
|
36
|
+
* - Otherwise the nearest detent wins, unless the sheet is below the lowest
|
|
37
|
+
* by more than DISMISS_THRESHOLD of it, which dismisses.
|
|
38
|
+
*
|
|
39
|
+
* `velocity` is px/ms, positive downward (closing).
|
|
40
|
+
*/
|
|
41
|
+
export declare function settleDetent({ heights, from, height, velocity, }: {
|
|
42
|
+
heights: readonly number[];
|
|
43
|
+
from: number;
|
|
44
|
+
height: number;
|
|
45
|
+
velocity: number;
|
|
46
|
+
}): number | 'dismiss';
|
|
47
|
+
/** The grabber's tap: the next detent up, wrapping from the largest to the smallest. */
|
|
48
|
+
export declare function cycleDetent(index: number, count: number): number;
|
|
49
|
+
/**
|
|
50
|
+
* Past the largest detent the sheet resists: the overshoot grows ever more
|
|
51
|
+
* slowly and never exceeds `max`.
|
|
52
|
+
*/
|
|
53
|
+
export declare function rubberBand(overshoot: number, max: number): number;
|
|
54
|
+
/** Whether a side drawer's release dismisses it. `movement` is toward its edge. */
|
|
55
|
+
export declare function shouldDismissEdge(movement: number, size: number, velocity: number): boolean;
|
|
56
|
+
//# sourceMappingURL=sheetPhysics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheetPhysics.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/sheetPhysics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,mDAAmD;AACnD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE1C,m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AG,OAAO,CAG3F"}
|
|
@@ -67,6 +67,19 @@ export declare const styles: Readonly<{
|
|
|
67
67
|
readonly borderTopRightRadius: css.StyleXClassNameFor<"borderTopRightRadius", string>;
|
|
68
68
|
readonly maxHeight: css.StyleXClassNameFor<"maxHeight", "85vh">;
|
|
69
69
|
}>;
|
|
70
|
+
readonly panelSnap: Readonly<{
|
|
71
|
+
readonly maxHeight: css.StyleXClassNameFor<"maxHeight", "none">;
|
|
72
|
+
readonly transitionProperty: css.StyleXClassNameFor<"transitionProperty", "height">;
|
|
73
|
+
readonly transitionDuration: css.StyleXClassNameFor<"transitionDuration", string>;
|
|
74
|
+
readonly transitionTimingFunction: css.StyleXClassNameFor<"transitionTimingFunction", string>;
|
|
75
|
+
}>;
|
|
76
|
+
readonly sheetHeight: (height: number) => readonly [Readonly<{
|
|
77
|
+
height: css.StyleXClassNameFor<"height", number>;
|
|
78
|
+
}>, css.InlineStyles];
|
|
79
|
+
readonly grabberHitWeb: Readonly<{
|
|
80
|
+
readonly cursor: css.StyleXClassNameFor<"cursor", "grab">;
|
|
81
|
+
readonly touchAction: css.StyleXClassNameFor<"touchAction", "none">;
|
|
82
|
+
}>;
|
|
70
83
|
readonly panelLeftBorder: Readonly<{
|
|
71
84
|
readonly borderLeftWidth: css.StyleXClassNameFor<"borderLeftWidth", 0>;
|
|
72
85
|
readonly borderRightWidth: css.StyleXClassNameFor<"borderRightWidth", string>;
|
|
@@ -139,32 +152,6 @@ export declare const styles: Readonly<{
|
|
|
139
152
|
readonly closeDurationSlow: Readonly<{
|
|
140
153
|
readonly animationDuration: css.StyleXClassNameFor<"animationDuration", string>;
|
|
141
154
|
}>;
|
|
142
|
-
readonly header: Readonly<{
|
|
143
|
-
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
144
|
-
readonly alignItems: css.StyleXClassNameFor<"alignItems", "flex-start">;
|
|
145
|
-
readonly justifyContent: css.StyleXClassNameFor<"justifyContent", "space-between">;
|
|
146
|
-
readonly paddingTop: css.StyleXClassNameFor<"paddingTop", string>;
|
|
147
|
-
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
148
|
-
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
149
|
-
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
150
|
-
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
151
|
-
}>;
|
|
152
|
-
readonly title: Readonly<{
|
|
153
|
-
readonly fontSize: css.StyleXClassNameFor<"fontSize", string>;
|
|
154
|
-
readonly fontWeight: css.StyleXClassNameFor<"fontWeight", string>;
|
|
155
|
-
readonly lineHeight: css.StyleXClassNameFor<"lineHeight", string>;
|
|
156
|
-
readonly color: css.StyleXClassNameFor<"color", string>;
|
|
157
|
-
readonly margin: css.StyleXClassNameFor<"margin", 0>;
|
|
158
|
-
}>;
|
|
159
|
-
readonly description: Readonly<{
|
|
160
|
-
readonly fontSize: css.StyleXClassNameFor<"fontSize", string>;
|
|
161
|
-
readonly lineHeight: css.StyleXClassNameFor<"lineHeight", string>;
|
|
162
|
-
readonly color: css.StyleXClassNameFor<"color", string>;
|
|
163
|
-
readonly margin: css.StyleXClassNameFor<"margin", 0>;
|
|
164
|
-
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
165
|
-
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
166
|
-
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
167
|
-
}>;
|
|
168
155
|
readonly body: Readonly<{
|
|
169
156
|
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
170
157
|
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
@@ -172,37 +159,5 @@ export declare const styles: Readonly<{
|
|
|
172
159
|
readonly overflowY: css.StyleXClassNameFor<"overflowY", "auto">;
|
|
173
160
|
readonly flex: css.StyleXClassNameFor<"flex", 1>;
|
|
174
161
|
}>;
|
|
175
|
-
readonly footer: Readonly<{
|
|
176
|
-
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
177
|
-
readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
|
|
178
|
-
readonly justifyContent: css.StyleXClassNameFor<"justifyContent", "flex-end">;
|
|
179
|
-
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
180
|
-
readonly paddingTop: css.StyleXClassNameFor<"paddingTop", string>;
|
|
181
|
-
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
182
|
-
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
183
|
-
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
184
|
-
readonly borderTopWidth: css.StyleXClassNameFor<"borderTopWidth", string>;
|
|
185
|
-
readonly borderTopStyle: css.StyleXClassNameFor<"borderTopStyle", "solid">;
|
|
186
|
-
readonly borderTopColor: css.StyleXClassNameFor<"borderTopColor", string>;
|
|
187
|
-
}>;
|
|
188
|
-
readonly closeButton: Readonly<{
|
|
189
|
-
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
190
|
-
readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
|
|
191
|
-
readonly justifyContent: css.StyleXClassNameFor<"justifyContent", "center">;
|
|
192
|
-
readonly width: css.StyleXClassNameFor<"width", string>;
|
|
193
|
-
readonly height: css.StyleXClassNameFor<"height", string>;
|
|
194
|
-
readonly borderRadius: css.StyleXClassNameFor<"borderRadius", string>;
|
|
195
|
-
readonly borderWidth: css.StyleXClassNameFor<"borderWidth", 0>;
|
|
196
|
-
readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
|
|
197
|
-
readonly color: css.StyleXClassNameFor<"color", string>;
|
|
198
|
-
readonly cursor: css.StyleXClassNameFor<"cursor", "pointer">;
|
|
199
|
-
readonly padding: css.StyleXClassNameFor<"padding", 0>;
|
|
200
|
-
readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 0>;
|
|
201
|
-
readonly transitionProperty: css.StyleXClassNameFor<"transitionProperty", "background-color">;
|
|
202
|
-
readonly transitionDuration: css.StyleXClassNameFor<"transitionDuration", string>;
|
|
203
|
-
}>;
|
|
204
|
-
readonly inlineWrapper: Readonly<{
|
|
205
|
-
readonly display: css.StyleXClassNameFor<"display", "inline-flex">;
|
|
206
|
-
}>;
|
|
207
162
|
}>;
|
|
208
163
|
//# sourceMappingURL=styles.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AASpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmMjB,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real touch input and viewport control for Storybook interaction tests
|
|
3
|
+
* (the Drawer's, SplitPane's), through
|
|
4
|
+
* Chrome DevTools Protocol: synthetic pointer events neither scroll nor go
|
|
5
|
+
* through touch adjustment the way a finger does.
|
|
6
|
+
*/
|
|
7
|
+
export type Point = {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A CDP command. `vitest/browser` loads only under the test runner, so it is
|
|
13
|
+
* imported here, at call time: a static import breaks the built Storybook.
|
|
14
|
+
* `CDPSession` is empty until the provider's typings load; `send` exists at runtime.
|
|
15
|
+
*/
|
|
16
|
+
export declare function cdpSend(method: string, params: object): Promise<unknown>;
|
|
17
|
+
/** Set the page's viewport (test runner only, like `cdpSend`). */
|
|
18
|
+
export declare function setViewport(width: number, height: number): Promise<void>;
|
|
19
|
+
export declare const pause: (ms: number) => Promise<unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* CDP input lands in top-level page coordinates; the story runs in an iframe
|
|
22
|
+
* the test runner offsets and may scale to fit. Map a point up every frame.
|
|
23
|
+
*/
|
|
24
|
+
export declare function toPage(p: Point): Point;
|
|
25
|
+
/**
|
|
26
|
+
* A finger drag from one point to another, in `steps` moves 16 ms apart.
|
|
27
|
+
* Each move is a round trip to the browser; few of them keep a test well
|
|
28
|
+
* inside its timeout on a loaded machine.
|
|
29
|
+
*/
|
|
30
|
+
export declare function touchDrag(from: Point, to: Point, steps?: number): Promise<void>;
|
|
31
|
+
/** A finger tap. */
|
|
32
|
+
export declare function touchTap(at: Point): Promise<void>;
|
|
33
|
+
/** The centre of an element, in its own document's coordinates. */
|
|
34
|
+
export declare function centre(el: Element): Point;
|
|
35
|
+
//# sourceMappingURL=touchInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touchInput.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/touchInput.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,KAAK,GAAG;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,CAAA;AAE1C;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAI3D;AAED,kEAAkE;AAClE,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAG9D;AAED,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,qBAA0C,CAAA;AAE1E;;;GAGG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAWtC;AASD;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,SAAI,iBAWhE;AAED,oBAAoB;AACpB,wBAAsB,QAAQ,CAAC,EAAE,EAAE,KAAK,iBAGvC;AAED,mEAAmE;AACnE,wBAAgB,MAAM,CAAC,EAAE,EAAE,OAAO,GAAG,KAAK,CAGzC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DurationToken } from '@duro-app/tokens/keys';
|
|
3
|
+
import { DrawerAnchor, DrawerContextValue } from './parts';
|
|
4
|
+
import { SnapPoint } from './sheetPhysics';
|
|
5
|
+
export interface DrawerRootProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Controlled open state */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
/** Default open state (uncontrolled) */
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
/** Called when drawer open state changes */
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
/** Which edge the drawer slides from. Default: 'right' */
|
|
14
|
+
anchor?: DrawerAnchor;
|
|
15
|
+
/** Whether clicking backdrop or pressing Escape (Android's back button on native) closes the drawer. Default: true */
|
|
16
|
+
dismissable?: boolean;
|
|
17
|
+
/** Whether swipe gesture dismisses the drawer. Default: true */
|
|
18
|
+
swipeDismiss?: boolean;
|
|
19
|
+
/** Motion token for the close animation. Default: 'fast' (150ms) */
|
|
20
|
+
closeAnimationDuration?: DurationToken;
|
|
21
|
+
/**
|
|
22
|
+
* Bottom anchor only: the heights the sheet rests at. 'medium' is half the
|
|
23
|
+
* window, 'large' the window less its top safe-area inset. A drag moves
|
|
24
|
+
* between them and dismisses below the lowest; the grabber steps through
|
|
25
|
+
* them on a tap. Without it, a bottom drawer is as tall as its content.
|
|
26
|
+
*/
|
|
27
|
+
snapPoints?: readonly SnapPoint[];
|
|
28
|
+
/** The detent the sheet opens at. Default: the lowest of snapPoints */
|
|
29
|
+
defaultSnapPoint?: SnapPoint;
|
|
30
|
+
}
|
|
31
|
+
/** The state both platforms' Drawer.Root share: open and closing, ids, and the detent. */
|
|
32
|
+
export declare function useDrawerRoot({ open: controlledOpen, defaultOpen, onOpenChange, anchor, dismissable, swipeDismiss, closeAnimationDuration, snapPoints: snapPointsProp, defaultSnapPoint, }: Omit<DrawerRootProps, 'children'>): DrawerContextValue;
|
|
33
|
+
//# sourceMappingURL=useDrawerRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDrawerRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/useDrawerRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,SAAS,EAA8C,MAAM,OAAO,CAAA;AACjF,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAC,YAAY,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAC7D,OAAO,EAAiB,KAAK,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAE7D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,wCAAwC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,sHAAsH;IACtH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gEAAgE;IAChE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,aAAa,CAAA;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;IACjC,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,SAAS,CAAA;CAC7B;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EAAE,cAAc,EACpB,WAAmB,EACnB,YAAY,EACZ,MAAgB,EAChB,WAAkB,EAClB,YAAmB,EACnB,sBAA+B,EAC/B,UAAU,EAAE,cAAc,EAC1B,gBAAgB,GACjB,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG,kBAAkB,CA6CxD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SnapPoint } from './sheetPhysics';
|
|
2
|
+
/**
|
|
3
|
+
* Web: each detent's height in px, ascending, following the window as it
|
|
4
|
+
* resizes (a rotated phone, an opened on-screen keyboard).
|
|
5
|
+
*/
|
|
6
|
+
export declare function useSheetHeights(points: readonly SnapPoint[], active: boolean): number[];
|
|
7
|
+
//# sourceMappingURL=useSheetHeights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSheetHeights.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/useSheetHeights.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAqB3D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,CAevF"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import { DrawerAnchor } from './
|
|
1
|
+
import { DrawerAnchor } from './parts';
|
|
2
|
+
/** A bottom sheet's detents: the drag moves between them before it dismisses. */
|
|
3
|
+
export interface SwipeSnap {
|
|
4
|
+
/** Each detent's height in px, ascending */
|
|
5
|
+
heights: readonly number[];
|
|
6
|
+
/** The detent the sheet rests at */
|
|
7
|
+
index: number;
|
|
8
|
+
/** A drag settled on another detent */
|
|
9
|
+
onSnap: (index: number) => void;
|
|
10
|
+
}
|
|
2
11
|
interface UseSwipeDismissOptions {
|
|
3
12
|
anchor: DrawerAnchor;
|
|
4
13
|
enabled: boolean;
|
|
@@ -9,6 +18,8 @@ interface UseSwipeDismissOptions {
|
|
|
9
18
|
* exists, and listeners must follow the element that is actually shown.
|
|
10
19
|
*/
|
|
11
20
|
panel: HTMLDivElement | null;
|
|
21
|
+
/** Bottom anchor with snapPoints: drag between detents, dismiss below the lowest */
|
|
22
|
+
snap?: SwipeSnap | null;
|
|
12
23
|
}
|
|
13
24
|
/**
|
|
14
25
|
* Hook that adds swipe-to-dismiss gesture to a drawer panel.
|
|
@@ -17,6 +28,6 @@ interface UseSwipeDismissOptions {
|
|
|
17
28
|
* Opposite direction: iOS-style — panel stays anchored, shows subtle
|
|
18
29
|
* overscroll feedback (box-shadow intensifies), then snaps back.
|
|
19
30
|
*/
|
|
20
|
-
export declare function useSwipeDismiss({ anchor, enabled, onDismiss, panel }: UseSwipeDismissOptions): void;
|
|
31
|
+
export declare function useSwipeDismiss({ anchor, enabled, onDismiss, panel, snap, }: UseSwipeDismissOptions): void;
|
|
21
32
|
export {};
|
|
22
33
|
//# sourceMappingURL=useSwipeDismiss.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSwipeDismiss.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/useSwipeDismiss.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"useSwipeDismiss.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/useSwipeDismiss.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AAkBzC,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,4CAA4C;IAC5C,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,uCAAuC;IACvC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC;AAED,UAAU,sBAAsB;IAC9B,MAAM,EAAE,YAAY,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB;;;;OAIG;IACH,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAC5B,oFAAoF;IACpF,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;CACxB;AAiBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,SAAS,EACT,KAAK,EACL,IAAW,GACZ,EAAE,sBAAsB,QA0YxB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode, Ref } from 'react';
|
|
2
|
+
import { OnNavigate } from '../../shared/navigate';
|
|
2
3
|
import { ControlSize } from '../../shared/types';
|
|
3
4
|
interface RootProps {
|
|
4
5
|
children: ReactNode;
|
|
@@ -34,9 +35,14 @@ interface ItemProps {
|
|
|
34
35
|
declare function Item({ onClick, children }: ItemProps): import("react/jsx-runtime").JSX.Element;
|
|
35
36
|
interface LinkItemProps {
|
|
36
37
|
href: string;
|
|
38
|
+
/**
|
|
39
|
+
* Called for a plain primary click (ADR-0002): call `event.preventDefault()`,
|
|
40
|
+
* then your router's navigate. Without it the browser follows the link.
|
|
41
|
+
*/
|
|
42
|
+
onNavigate?: OnNavigate;
|
|
37
43
|
children: ReactNode;
|
|
38
44
|
}
|
|
39
|
-
declare function LinkItem({ href, children }: LinkItemProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
declare function LinkItem({ href, onNavigate, children }: LinkItemProps): import("react/jsx-runtime").JSX.Element;
|
|
40
46
|
declare function Separator(): import("react/jsx-runtime").JSX.Element;
|
|
41
47
|
export declare const Menu: {
|
|
42
48
|
Root: typeof Root;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":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,GAAG,GACJ,EAAE,YAAY,2CAiDd;AAGD,UAAU,UAAU;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CACxB;AAKD,iBAAS,KAAK,CAAC,EAAC,QAAQ,EAAE,KAAe,EAAC,EAAE,UAAU,sCAkDrD;AAGD,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,iBAAS,IAAI,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,SAAS,2CA6B3C;AAGD,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,iBAAS,QAAQ,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAC,EAAE,aAAa,2CA4B5D;AAMD,iBAAS,SAAS,4CAEjB;AAED,eAAO,MAAM,IAAI;;;;;;;CAOhB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { css } from 'react-strict-dom';
|
|
2
|
+
/** Native Menu additions to the shared styles. */
|
|
3
|
+
export declare const nativeStyles: Readonly<{
|
|
4
|
+
readonly nativeFlex: Readonly<{
|
|
5
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
6
|
+
}>;
|
|
7
|
+
readonly popupInPlace: Readonly<{
|
|
8
|
+
readonly position: css.StyleXClassNameFor<"position", "relative">;
|
|
9
|
+
}>;
|
|
10
|
+
readonly itemPressed: Readonly<{
|
|
11
|
+
readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
|
|
12
|
+
}>;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=native.css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.css.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/native.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAGpC,kDAAkD;AAClD,eAAO,MAAM,YAAY;;;;;;;;;;EAavB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface MenuOpenOptions {
|
|
2
|
+
open?: boolean;
|
|
3
|
+
defaultOpen?: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The menu's open state, controlled or not, shared by both platforms (plan
|
|
8
|
+
* N0, Decision 10). Focus, highlight and keys are each platform's adapter:
|
|
9
|
+
* `useMenuRoot` on the web, Menu.native on native.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useMenuOpen({ open: openProp, defaultOpen, onOpenChange }: MenuOpenOptions): {
|
|
12
|
+
open: boolean;
|
|
13
|
+
openRef: import('react').RefObject<boolean>;
|
|
14
|
+
setOpen: (next: boolean) => void;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useMenuOpen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMenuOpen.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/useMenuOpen.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;CACvC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,WAAmB,EAAE,YAAY,EAAC,EAAE,eAAe;;;oBAUrF,OAAO;EASjB"}
|