panelui-native 0.22.6 → 0.28.1
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 +1 -0
- package/lib/module/components/accordion/index.js +8 -8
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/alert/index.js +2 -2
- package/lib/module/components/alert/index.js.map +1 -1
- package/lib/module/components/area-chart/index.js +958 -0
- package/lib/module/components/area-chart/index.js.map +1 -0
- package/lib/module/components/attachment/index.js +2 -1
- package/lib/module/components/attachment/index.js.map +1 -1
- package/lib/module/components/avatar/index.js +4 -4
- package/lib/module/components/avatar/index.js.map +1 -1
- package/lib/module/components/badge/index.js +4 -4
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/bar-chart/index.js +994 -0
- package/lib/module/components/bar-chart/index.js.map +1 -0
- package/lib/module/components/bottom-sheet/index.js +213 -24
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/breadcrumb/index.js +275 -0
- package/lib/module/components/breadcrumb/index.js.map +1 -0
- package/lib/module/components/button/index.js +11 -6
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/calendar/index.js +557 -0
- package/lib/module/components/calendar/index.js.map +1 -0
- package/lib/module/components/carousel/index.js +680 -0
- package/lib/module/components/carousel/index.js.map +1 -0
- package/lib/module/components/chip/index.js +6 -6
- package/lib/module/components/chip/index.js.map +1 -1
- package/lib/module/components/date-picker/index.js +158 -0
- package/lib/module/components/date-picker/index.js.map +1 -0
- package/lib/module/components/dialog/index.js +7 -2
- package/lib/module/components/dialog/index.js.map +1 -1
- package/lib/module/components/direction/index.js +15 -20
- package/lib/module/components/direction/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js +2 -2
- package/lib/module/components/empty-state/index.js.map +1 -1
- package/lib/module/components/field/index.js +5 -5
- package/lib/module/components/field/index.js.map +1 -1
- package/lib/module/components/flow/index.js +3 -3
- package/lib/module/components/flow/index.js.map +1 -1
- package/lib/module/components/frame/index.js +22 -5
- package/lib/module/components/frame/index.js.map +1 -1
- package/lib/module/components/heatmap-chart/index.js +28 -8
- package/lib/module/components/heatmap-chart/index.js.map +1 -1
- package/lib/module/components/input-group/index.js +5 -4
- package/lib/module/components/input-group/index.js.map +1 -1
- package/lib/module/components/item/index.js +9 -9
- package/lib/module/components/item/index.js.map +1 -1
- package/lib/module/components/label/index.js +4 -4
- package/lib/module/components/label/index.js.map +1 -1
- package/lib/module/components/line-chart/index.js +165 -184
- package/lib/module/components/line-chart/index.js.map +1 -1
- package/lib/module/components/loader/index.js +758 -0
- package/lib/module/components/loader/index.js.map +1 -0
- package/lib/module/components/map/basemap.js +265 -0
- package/lib/module/components/map/basemap.js.map +1 -0
- package/lib/module/components/map/index.js +850 -0
- package/lib/module/components/map/index.js.map +1 -0
- package/lib/module/components/map/maplibre.js +87 -0
- package/lib/module/components/map/maplibre.js.map +1 -0
- package/lib/module/components/marker/index.js +3 -3
- package/lib/module/components/marker/index.js.map +1 -1
- package/lib/module/components/message/index.js +15 -14
- package/lib/module/components/message/index.js.map +1 -1
- package/lib/module/components/message-scroller/index.js +5 -4
- package/lib/module/components/message-scroller/index.js.map +1 -1
- package/lib/module/components/otp-input/index.js +2 -2
- package/lib/module/components/popover/index.js +39 -7
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/progress/index.js +8 -2
- package/lib/module/components/progress/index.js.map +1 -1
- package/lib/module/components/radio-group/index.js +2 -2
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/ring-chart/index.js +423 -0
- package/lib/module/components/ring-chart/index.js.map +1 -0
- package/lib/module/components/section-rail/index.js +6 -6
- package/lib/module/components/section-rail/index.js.map +1 -1
- package/lib/module/components/select/index.js +10 -4
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/separator/index.js +76 -22
- package/lib/module/components/separator/index.js.map +1 -1
- package/lib/module/components/shimmer/index.js +10 -1
- package/lib/module/components/shimmer/index.js.map +1 -1
- package/lib/module/components/slider/index.js +19 -5
- package/lib/module/components/slider/index.js.map +1 -1
- package/lib/module/components/steps/index.js +5 -5
- package/lib/module/components/steps/index.js.map +1 -1
- package/lib/module/components/switch/index.js +6 -1
- package/lib/module/components/switch/index.js.map +1 -1
- package/lib/module/components/tabs/index.js +7 -7
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/timeline/index.js +4 -4
- package/lib/module/components/timeline/index.js.map +1 -1
- package/lib/module/components/toast/index.js +2 -2
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/components/toggle-button/index.js +5 -5
- package/lib/module/components/toggle-button/index.js.map +1 -1
- package/lib/module/components/tooltip/index.js +492 -0
- package/lib/module/components/tooltip/index.js.map +1 -0
- package/lib/module/components/typography/index.js +7 -2
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/use-back-handler.js +37 -0
- package/lib/module/hooks/use-back-handler.js.map +1 -0
- package/lib/module/hooks/use-direction.js +43 -0
- package/lib/module/hooks/use-direction.js.map +1 -0
- package/lib/module/icons/index.js +180 -2
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +12 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/primitives/keyboard-avoider.js +2 -1
- package/lib/module/primitives/keyboard-avoider.js.map +1 -1
- package/lib/module/primitives/text.js +55 -11
- package/lib/module/primitives/text.js.map +1 -1
- package/lib/module/utils/chart.js +279 -0
- package/lib/module/utils/chart.js.map +1 -0
- package/lib/module/utils/date.js +386 -0
- package/lib/module/utils/date.js.map +1 -0
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/area-chart/index.d.ts +237 -0
- package/lib/typescript/src/components/area-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/attachment/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bar-chart/index.d.ts +270 -0
- package/lib/typescript/src/components/bar-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +75 -4
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/breadcrumb/index.d.ts +100 -0
- package/lib/typescript/src/components/breadcrumb/index.d.ts.map +1 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/calendar/index.d.ts +108 -0
- package/lib/typescript/src/components/calendar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/carousel/index.d.ts +179 -0
- package/lib/typescript/src/components/carousel/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
- package/lib/typescript/src/components/date-picker/index.d.ts +91 -0
- package/lib/typescript/src/components/date-picker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/components/direction/index.d.ts +11 -10
- package/lib/typescript/src/components/direction/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
- package/lib/typescript/src/components/field/index.d.ts.map +1 -1
- package/lib/typescript/src/components/frame/index.d.ts +17 -0
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
- package/lib/typescript/src/components/heatmap-chart/index.d.ts +22 -3
- package/lib/typescript/src/components/heatmap-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/item/index.d.ts.map +1 -1
- package/lib/typescript/src/components/label/index.d.ts.map +1 -1
- package/lib/typescript/src/components/line-chart/index.d.ts +42 -2
- package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/loader/index.d.ts +38 -0
- package/lib/typescript/src/components/loader/index.d.ts.map +1 -0
- package/lib/typescript/src/components/map/basemap.d.ts +76 -0
- package/lib/typescript/src/components/map/basemap.d.ts.map +1 -0
- package/lib/typescript/src/components/map/index.d.ts +367 -0
- package/lib/typescript/src/components/map/index.d.ts.map +1 -0
- package/lib/typescript/src/components/map/maplibre.d.ts +193 -0
- package/lib/typescript/src/components/map/maplibre.d.ts.map +1 -0
- package/lib/typescript/src/components/marker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -1
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/progress/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ring-chart/index.d.ts +156 -0
- package/lib/typescript/src/components/ring-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/separator/index.d.ts +36 -1
- package/lib/typescript/src/components/separator/index.d.ts.map +1 -1
- package/lib/typescript/src/components/shimmer/index.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/index.d.ts.map +1 -1
- package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tooltip/index.d.ts +125 -0
- package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/typography/index.d.ts +6 -0
- package/lib/typescript/src/components/typography/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +1 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-back-handler.d.ts +19 -0
- package/lib/typescript/src/hooks/use-back-handler.d.ts.map +1 -0
- package/lib/typescript/src/hooks/use-direction.d.ts +20 -0
- package/lib/typescript/src/hooks/use-direction.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +8 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +14 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -1
- package/lib/typescript/src/primitives/text.d.ts +20 -0
- package/lib/typescript/src/primitives/text.d.ts.map +1 -1
- package/lib/typescript/src/utils/chart.d.ts +96 -0
- package/lib/typescript/src/utils/chart.d.ts.map +1 -0
- package/lib/typescript/src/utils/date.d.ts +116 -0
- package/lib/typescript/src/utils/date.d.ts.map +1 -0
- package/package.json +9 -1
- package/src/components/accordion/index.tsx +8 -12
- package/src/components/alert/index.tsx +2 -2
- package/src/components/area-chart/index.tsx +1147 -0
- package/src/components/attachment/index.tsx +2 -2
- package/src/components/avatar/index.tsx +4 -4
- package/src/components/badge/index.tsx +6 -6
- package/src/components/bar-chart/index.tsx +1208 -0
- package/src/components/bottom-sheet/index.tsx +282 -21
- package/src/components/breadcrumb/index.tsx +363 -0
- package/src/components/button/index.tsx +12 -8
- package/src/components/calendar/index.tsx +703 -0
- package/src/components/carousel/index.tsx +788 -0
- package/src/components/chip/index.tsx +6 -8
- package/src/components/date-picker/index.tsx +237 -0
- package/src/components/dialog/index.tsx +7 -2
- package/src/components/direction/index.tsx +22 -22
- package/src/components/empty-state/index.tsx +2 -2
- package/src/components/field/index.tsx +3 -5
- package/src/components/flow/index.tsx +3 -3
- package/src/components/frame/index.tsx +22 -7
- package/src/components/heatmap-chart/index.tsx +58 -11
- package/src/components/input-group/index.tsx +5 -4
- package/src/components/item/index.tsx +9 -9
- package/src/components/label/index.tsx +2 -2
- package/src/components/line-chart/index.tsx +194 -223
- package/src/components/loader/index.tsx +812 -0
- package/src/components/map/basemap.ts +304 -0
- package/src/components/map/index.tsx +1116 -0
- package/src/components/map/maplibre.ts +201 -0
- package/src/components/marker/index.tsx +3 -3
- package/src/components/message/index.tsx +15 -14
- package/src/components/message-scroller/index.tsx +5 -4
- package/src/components/otp-input/index.tsx +2 -2
- package/src/components/popover/index.tsx +43 -7
- package/src/components/progress/index.tsx +10 -2
- package/src/components/radio-group/index.tsx +2 -2
- package/src/components/ring-chart/index.tsx +543 -0
- package/src/components/section-rail/index.tsx +6 -6
- package/src/components/select/index.tsx +10 -4
- package/src/components/separator/index.tsx +77 -19
- package/src/components/shimmer/index.tsx +10 -1
- package/src/components/slider/index.tsx +20 -5
- package/src/components/steps/index.tsx +5 -5
- package/src/components/switch/index.tsx +6 -1
- package/src/components/tabs/index.tsx +7 -9
- package/src/components/timeline/index.tsx +4 -4
- package/src/components/toast/index.tsx +2 -2
- package/src/components/toggle-button/index.tsx +5 -7
- package/src/components/tooltip/index.tsx +610 -0
- package/src/components/typography/index.tsx +7 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-back-handler.ts +37 -0
- package/src/hooks/use-direction.ts +45 -0
- package/src/icons/index.tsx +111 -0
- package/src/index.ts +129 -0
- package/src/primitives/keyboard-avoider.tsx +2 -1
- package/src/primitives/text.tsx +53 -8
- package/src/utils/chart.ts +355 -0
- package/src/utils/date.ts +446 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type ReactElement, type ReactNode } from 'react';
|
|
1
|
+
import { type ComponentProps, type ReactElement, type ReactNode } from 'react';
|
|
2
2
|
import { type ViewProps } from 'react-native';
|
|
3
|
+
import Animated from 'react-native-reanimated';
|
|
3
4
|
export interface BottomSheetProps {
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
open?: boolean;
|
|
@@ -40,8 +41,10 @@ export interface BottomSheetContentProps extends ViewProps {
|
|
|
40
41
|
/** Tap on the backdrop closes the sheet. Default true. */
|
|
41
42
|
dismissible?: boolean;
|
|
42
43
|
/**
|
|
43
|
-
* Show a close button in the top
|
|
44
|
-
*
|
|
44
|
+
* Show a close button in the top trailing corner — the right in a
|
|
45
|
+
* left-to-right app, the left in a right-to-left one. On by default for the
|
|
46
|
+
* styled sheet; ignored by the native sheet, which has its own dismiss
|
|
47
|
+
* affordances.
|
|
45
48
|
*/
|
|
46
49
|
showClose?: boolean;
|
|
47
50
|
/**
|
|
@@ -58,12 +61,80 @@ export interface BottomSheetContentProps extends ViewProps {
|
|
|
58
61
|
* optional `expo-blur`; without it this dims, rather than failing.
|
|
59
62
|
*/
|
|
60
63
|
blur?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* How tall the sheet opens.
|
|
66
|
+
*
|
|
67
|
+
* `auto` sizes to the content, which is right for a sheet that is a handful
|
|
68
|
+
* of rows. `half` and `full` fix the height instead, for content that has to
|
|
69
|
+
* be given the room rather than allowed to ask for it — a list, a form, a
|
|
70
|
+
* document. Either way the sheet is clamped to leave the status bar clear,
|
|
71
|
+
* so `full` is as tall as the screen allows rather than as tall as the screen.
|
|
72
|
+
*
|
|
73
|
+
* On the native sheet this maps onto the platform's detents.
|
|
74
|
+
*/
|
|
75
|
+
size?: 'auto' | 'half' | 'full';
|
|
76
|
+
children?: ReactNode;
|
|
77
|
+
}
|
|
78
|
+
declare function BottomSheetContent({ className, dismissible, showClose, detached, blur, size, children, ...props }: BottomSheetContentProps): import("react").JSX.Element | null;
|
|
79
|
+
export interface BottomSheetHeaderProps extends ViewProps {
|
|
80
|
+
className?: string;
|
|
81
|
+
/** Heading for the sheet. Strings are wrapped; anything else is drawn as given. */
|
|
82
|
+
title?: ReactNode;
|
|
83
|
+
/** A line under the title, for what the sheet is asking. */
|
|
84
|
+
description?: ReactNode;
|
|
85
|
+
children?: ReactNode;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A fixed heading above the sheet's body.
|
|
89
|
+
*
|
|
90
|
+
* It exists mostly to reserve the top-right corner. The close button is
|
|
91
|
+
* absolutely positioned there, so anything full-width at the top of a sheet
|
|
92
|
+
* sits under it — a title is exactly that shape, and the end padding here is
|
|
93
|
+
* what keeps the two from meeting. Being outside `Body` is the other half:
|
|
94
|
+
* it stays put while the content scrolls under it, so the sheet still says
|
|
95
|
+
* what it is once the list has moved.
|
|
96
|
+
*/
|
|
97
|
+
declare function BottomSheetHeader({ className, title, description, children, ...props }: BottomSheetHeaderProps): import("react").JSX.Element;
|
|
98
|
+
declare namespace BottomSheetHeader {
|
|
99
|
+
var displayName: string;
|
|
100
|
+
}
|
|
101
|
+
export interface BottomSheetBodyProps extends Omit<ComponentProps<typeof Animated.ScrollView>, 'ref'> {
|
|
102
|
+
className?: string;
|
|
103
|
+
children?: ReactNode;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The scrolling part of a sized sheet.
|
|
107
|
+
*
|
|
108
|
+
* A plain `ScrollView` works here too, but only one of the two gestures can
|
|
109
|
+
* win a given drag and neither knows about the other, so the list and the
|
|
110
|
+
* sheet fight over every downward swipe. This one reports where it is
|
|
111
|
+
* scrolled to, which is what lets the sheet hold off until the list has run
|
|
112
|
+
* out — pull down on a list at its top and the sheet comes with you, pull
|
|
113
|
+
* down anywhere else and the list scrolls.
|
|
114
|
+
*/
|
|
115
|
+
declare function BottomSheetBody({ className, children, onScroll, ...props }: BottomSheetBodyProps): import("react").JSX.Element;
|
|
116
|
+
declare namespace BottomSheetBody {
|
|
117
|
+
var displayName: string;
|
|
118
|
+
}
|
|
119
|
+
export interface BottomSheetFooterProps extends ViewProps {
|
|
120
|
+
className?: string;
|
|
61
121
|
children?: ReactNode;
|
|
62
122
|
}
|
|
63
|
-
|
|
123
|
+
/**
|
|
124
|
+
* A row pinned below the body, for whatever the sheet is asking to be decided.
|
|
125
|
+
* Outside `Body` so it stays reachable however far the content scrolls — an
|
|
126
|
+
* action that has to be scrolled to is one people do not find.
|
|
127
|
+
*/
|
|
128
|
+
declare function BottomSheetFooter({ className, children, ...props }: BottomSheetFooterProps): import("react").JSX.Element;
|
|
129
|
+
declare namespace BottomSheetFooter {
|
|
130
|
+
var displayName: string;
|
|
131
|
+
}
|
|
64
132
|
export declare const BottomSheet: typeof BottomSheetRoot & {
|
|
65
133
|
Trigger: typeof BottomSheetTrigger;
|
|
66
134
|
Content: typeof BottomSheetContent;
|
|
135
|
+
Header: typeof BottomSheetHeader;
|
|
136
|
+
Body: typeof BottomSheetBody;
|
|
137
|
+
Footer: typeof BottomSheetFooter;
|
|
67
138
|
};
|
|
68
139
|
export {};
|
|
69
140
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpF,OAAO,QAYN,MAAM,yBAAyB,CAAC;AAgDjC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CAC9E;AA8DD,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,WAAmB,EACnB,MAAM,EACN,UAAU,GACX,EAAE,gBAAgB,+BA+BlB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,EA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AAc,CAAC,OAAO,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;GASG;AACH,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,+BA2CtB;kBAhDQ,eAAe;;;AAmDxB,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,sBAAsB,+BASxB;kBAbQ,iBAAiB;;;AAgB1B,eAAO,MAAM,WAAW;;;;;;CAMtB,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Breadcrumb — the trail of where you are in a hierarchy.
|
|
3
|
+
*
|
|
4
|
+
* A row of links back up the tree, ending in the page you are on. The last
|
|
5
|
+
* crumb is not a link: you cannot navigate to where you already are, so it is
|
|
6
|
+
* a plain, current-marked label rather than a dead tappable target.
|
|
7
|
+
*
|
|
8
|
+
* The separators are the component's job, not yours. `Breadcrumb.List` drops a
|
|
9
|
+
* chevron between each crumb it holds, so a trail is just its items — there is
|
|
10
|
+
* no separator to forget, mis-order, or leave dangling at the end. Change the
|
|
11
|
+
* glyph once with `separator` on the root and every gap follows.
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Breadcrumb>
|
|
15
|
+
* <Breadcrumb.List>
|
|
16
|
+
* <Breadcrumb.Item>
|
|
17
|
+
* <Breadcrumb.Link onPress={goHome}>Home</Breadcrumb.Link>
|
|
18
|
+
* </Breadcrumb.Item>
|
|
19
|
+
* <Breadcrumb.Item>
|
|
20
|
+
* <Breadcrumb.Link onPress={goProjects}>Projects</Breadcrumb.Link>
|
|
21
|
+
* </Breadcrumb.Item>
|
|
22
|
+
* <Breadcrumb.Item>
|
|
23
|
+
* <Breadcrumb.Page>PanelUI</Breadcrumb.Page>
|
|
24
|
+
* </Breadcrumb.Item>
|
|
25
|
+
* </Breadcrumb.List>
|
|
26
|
+
* </Breadcrumb>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* A deep trail on a narrow phone does not wrap into a paragraph: give the list
|
|
30
|
+
* a `maxItems` and it keeps the first and last crumbs, folding the middle into
|
|
31
|
+
* a single ellipsis. Hand the ellipsis an `onEllipsisPress` and it becomes the
|
|
32
|
+
* handle for a menu of the hidden steps.
|
|
33
|
+
*/
|
|
34
|
+
import { type ReactNode } from 'react';
|
|
35
|
+
import { View, type ViewProps } from 'react-native';
|
|
36
|
+
import { type AnimatedPressableProps } from '../../primitives/animated-pressable.js';
|
|
37
|
+
import { type TextProps } from '../../primitives/text.js';
|
|
38
|
+
type BreadcrumbSize = 'sm' | 'default';
|
|
39
|
+
export interface BreadcrumbProps extends ViewProps {
|
|
40
|
+
className?: string;
|
|
41
|
+
/** Text density for every crumb. `sm` for a dense header bar. */
|
|
42
|
+
size?: BreadcrumbSize;
|
|
43
|
+
/**
|
|
44
|
+
* The glyph `Breadcrumb.List` places between crumbs. Defaults to a chevron;
|
|
45
|
+
* pass a `<Text>/</Text>`, a slash, or any node to change every gap at once.
|
|
46
|
+
*/
|
|
47
|
+
separator?: ReactNode;
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
}
|
|
50
|
+
export interface BreadcrumbListProps extends ViewProps {
|
|
51
|
+
className?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Collapse the trail once it holds more than this many crumbs, so a deep
|
|
54
|
+
* path never wraps into a block of text on a narrow screen. The first
|
|
55
|
+
* `itemsBeforeCollapse` and last `itemsAfterCollapse` survive; the middle
|
|
56
|
+
* folds into a single ellipsis.
|
|
57
|
+
*/
|
|
58
|
+
maxItems?: number;
|
|
59
|
+
/** How many leading crumbs to keep when collapsing. Default 1. */
|
|
60
|
+
itemsBeforeCollapse?: number;
|
|
61
|
+
/** How many trailing crumbs to keep when collapsing. Default 1. */
|
|
62
|
+
itemsAfterCollapse?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Makes the collapsed ellipsis pressable — the handle for a menu listing the
|
|
65
|
+
* hidden steps. Without it the ellipsis is a static marker.
|
|
66
|
+
*/
|
|
67
|
+
onEllipsisPress?: () => void;
|
|
68
|
+
children?: ReactNode;
|
|
69
|
+
}
|
|
70
|
+
export interface BreadcrumbItemProps extends ViewProps {
|
|
71
|
+
className?: string;
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
}
|
|
74
|
+
export interface BreadcrumbLinkProps extends Omit<AnimatedPressableProps, 'children'> {
|
|
75
|
+
className?: string;
|
|
76
|
+
/** Text style for the crumb's label. */
|
|
77
|
+
textClassName?: string;
|
|
78
|
+
children?: ReactNode;
|
|
79
|
+
}
|
|
80
|
+
export interface BreadcrumbPageProps extends TextProps {
|
|
81
|
+
className?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface BreadcrumbSeparatorProps extends ViewProps {
|
|
84
|
+
className?: string;
|
|
85
|
+
/** Override the glyph for this one gap. Falls back to the root's separator. */
|
|
86
|
+
children?: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
export interface BreadcrumbEllipsisProps extends Omit<AnimatedPressableProps, 'children'> {
|
|
89
|
+
className?: string;
|
|
90
|
+
}
|
|
91
|
+
export declare const Breadcrumb: import("react").ForwardRefExoticComponent<BreadcrumbProps & import("react").RefAttributes<View>> & {
|
|
92
|
+
List: import("react").ForwardRefExoticComponent<BreadcrumbListProps & import("react").RefAttributes<View>>;
|
|
93
|
+
Item: import("react").ForwardRefExoticComponent<BreadcrumbItemProps & import("react").RefAttributes<View>>;
|
|
94
|
+
Link: import("react").ForwardRefExoticComponent<BreadcrumbLinkProps & import("react").RefAttributes<View>>;
|
|
95
|
+
Page: import("react").ForwardRefExoticComponent<BreadcrumbPageProps & import("react").RefAttributes<import("react-native").Text>>;
|
|
96
|
+
Separator: import("react").ForwardRefExoticComponent<BreadcrumbSeparatorProps & import("react").RefAttributes<View>>;
|
|
97
|
+
Ellipsis: import("react").ForwardRefExoticComponent<BreadcrumbEllipsisProps & import("react").RefAttributes<View>>;
|
|
98
|
+
};
|
|
99
|
+
export {};
|
|
100
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/breadcrumb/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAC7C,OAAO,EAAQ,KAAK,SAAS,EAAgB,MAAM,0BAAuB,CAAC;AAG3E,KAAK,cAAc,GAAG,IAAI,GAAG,SAAS,CAAC;AA2BvC,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAsBD,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,eAAe,CAAC,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAA7E,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAwBjF,CAAC;AAEH,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAsB9D,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,UAAU,CAAC,EAC3D,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iFAAiF;IACjF,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,wCAAwC;IACxC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAiCD,eAAO,MAAM,MAAM,8FAiGlB,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { type ViewProps } from 'react-native';
|
|
2
|
+
import { type CalendarSystem, type DateLocale } from '../../utils/date.js';
|
|
3
|
+
export type CalendarMode = 'single' | 'multiple' | 'range';
|
|
4
|
+
export type CalendarCaptionLayout = 'label' | 'dropdown';
|
|
5
|
+
/** A range under construction: `to` is undefined between the two taps. */
|
|
6
|
+
export interface DateRange {
|
|
7
|
+
from: Date;
|
|
8
|
+
to?: Date;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What a `mode` selects. Written as a map so the root, the parts and the
|
|
12
|
+
* caller all read the same association rather than each casting their own way.
|
|
13
|
+
*/
|
|
14
|
+
export interface CalendarSelection {
|
|
15
|
+
single: Date | undefined;
|
|
16
|
+
multiple: Date[];
|
|
17
|
+
range: DateRange | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Which days cannot be picked. A list, a span, or a rule — a rule because
|
|
21
|
+
* "no weekends" and "not in the past" are the two most common cases and
|
|
22
|
+
* neither can be written as a list that stays right tomorrow.
|
|
23
|
+
*/
|
|
24
|
+
export type CalendarDisabled = Date[] | {
|
|
25
|
+
from: Date;
|
|
26
|
+
to: Date;
|
|
27
|
+
} | ((date: Date) => boolean);
|
|
28
|
+
export interface CalendarProps<Mode extends CalendarMode = 'single'> extends Omit<ViewProps, 'children'> {
|
|
29
|
+
className?: string;
|
|
30
|
+
/** One day, several, or a span with two ends. */
|
|
31
|
+
mode?: Mode;
|
|
32
|
+
/** Controlled selection. Its shape follows `mode`. */
|
|
33
|
+
selected?: CalendarSelection[Mode];
|
|
34
|
+
/** Starting selection when uncontrolled. */
|
|
35
|
+
defaultSelected?: CalendarSelection[Mode];
|
|
36
|
+
onSelect?: (selected: CalendarSelection[Mode]) => void;
|
|
37
|
+
/** Controlled visible month. Any day inside it will do. */
|
|
38
|
+
month?: Date;
|
|
39
|
+
/** Month shown first when uncontrolled. Defaults to the selection, or today. */
|
|
40
|
+
defaultMonth?: Date;
|
|
41
|
+
onMonthChange?: (month: Date) => void;
|
|
42
|
+
/** Months side by side. Two is what picking a range across a boundary wants. */
|
|
43
|
+
numberOfMonths?: number;
|
|
44
|
+
/**
|
|
45
|
+
* `dropdown` turns the caption into month and year pickers, which is the
|
|
46
|
+
* difference between choosing a birthday in four taps and in four hundred.
|
|
47
|
+
*/
|
|
48
|
+
captionLayout?: CalendarCaptionLayout;
|
|
49
|
+
/** Days that cannot be picked: a list, a span, or a rule. */
|
|
50
|
+
disabled?: CalendarDisabled;
|
|
51
|
+
/** Earliest selectable day. Also stops the caption paging back past it. */
|
|
52
|
+
minDate?: Date;
|
|
53
|
+
/** Latest selectable day. */
|
|
54
|
+
maxDate?: Date;
|
|
55
|
+
/** `0` is Sunday. */
|
|
56
|
+
weekStartsOn?: number;
|
|
57
|
+
/** Draw the neighbouring months' days rather than leaving the cells blank. */
|
|
58
|
+
showOutsideDays?: boolean;
|
|
59
|
+
/** BCP 47 tag for the month and weekday names. The device's own by default. */
|
|
60
|
+
locale?: DateLocale;
|
|
61
|
+
/**
|
|
62
|
+
* Which calendar the months and the day numbers are counted in.
|
|
63
|
+
*
|
|
64
|
+
* `gregory` by default rather than `auto`: a grid whose month boundaries move
|
|
65
|
+
* with the device's language is a surprise, and it is the caller — not the
|
|
66
|
+
* locale — who knows whether the dates being picked are Hijri ones. `auto`
|
|
67
|
+
* follows the locale for the cases where they are the same question.
|
|
68
|
+
*/
|
|
69
|
+
calendar?: CalendarSystem;
|
|
70
|
+
}
|
|
71
|
+
declare function CalendarRoot<Mode extends CalendarMode = 'single'>({ className, mode, selected, defaultSelected, onSelect, month: monthProp, defaultMonth, onMonthChange, numberOfMonths, captionLayout, disabled, minDate, maxDate, weekStartsOn, showOutsideDays, locale, calendar, ...props }: CalendarProps<Mode>): import("react").JSX.Element;
|
|
72
|
+
declare namespace CalendarRoot {
|
|
73
|
+
var displayName: string;
|
|
74
|
+
}
|
|
75
|
+
interface GridProps {
|
|
76
|
+
month: Date;
|
|
77
|
+
mode: CalendarMode;
|
|
78
|
+
value: unknown;
|
|
79
|
+
onSelect: (date: Date) => void;
|
|
80
|
+
disabled?: CalendarDisabled;
|
|
81
|
+
minDate?: Date;
|
|
82
|
+
maxDate?: Date;
|
|
83
|
+
weekStartsOn: number;
|
|
84
|
+
showOutsideDays: boolean;
|
|
85
|
+
locale: DateLocale;
|
|
86
|
+
system: 'gregory' | 'islamic';
|
|
87
|
+
}
|
|
88
|
+
declare function CalendarGrid({ month, mode, value, onSelect, disabled, minDate, maxDate, weekStartsOn, showOutsideDays, locale, system, }: GridProps): import("react").JSX.Element;
|
|
89
|
+
interface DayProps {
|
|
90
|
+
date: Date;
|
|
91
|
+
outside: boolean;
|
|
92
|
+
selected: boolean;
|
|
93
|
+
inRange: boolean;
|
|
94
|
+
today: boolean;
|
|
95
|
+
disabled: boolean;
|
|
96
|
+
openStart: boolean;
|
|
97
|
+
openEnd: boolean;
|
|
98
|
+
locale: DateLocale;
|
|
99
|
+
system: 'gregory' | 'islamic';
|
|
100
|
+
onPress: () => void;
|
|
101
|
+
}
|
|
102
|
+
declare function CalendarDay({ date, outside, selected, inRange, today, disabled, openStart, openEnd, locale, system, onPress, }: DayProps): import("react").JSX.Element;
|
|
103
|
+
export declare const Calendar: typeof CalendarRoot & {
|
|
104
|
+
Grid: typeof CalendarGrid;
|
|
105
|
+
Day: typeof CalendarDay;
|
|
106
|
+
};
|
|
107
|
+
export {};
|
|
108
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/calendar/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAK/D,OAAO,EAiBL,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,qBAAkB,CAAC;AAE1B,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,UAAU,CAAC;AAEzD,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,EAAE,CAAC,EAAE,IAAI,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,IAAI,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjB,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB,IAAI,EAAE,GACN;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,IAAI,CAAA;CAAE,GACxB,CAAC,CAAC,IAAI,EAAE,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ACnB,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE,QAAQ,+BAsCV;AAED,eAAO,MAAM,QAAQ;;;CAGnB,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carousel — a run of slides, one at a time, dragged with a finger.
|
|
3
|
+
*
|
|
4
|
+
* ```tsx
|
|
5
|
+
* <Carousel loop>
|
|
6
|
+
* <Carousel.Content className="h-56">
|
|
7
|
+
* {photos.map((photo) => (
|
|
8
|
+
* <Carousel.Item key={photo.id}>
|
|
9
|
+
* <Image source={{ uri: photo.uri }} className="h-full w-full" />
|
|
10
|
+
* </Carousel.Item>
|
|
11
|
+
* ))}
|
|
12
|
+
* </Carousel.Content>
|
|
13
|
+
* <Carousel.Controls />
|
|
14
|
+
* </Carousel>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* ## One shared value, four layouts
|
|
18
|
+
*
|
|
19
|
+
* Everything is driven from a single `progress` — the position in the run, as a
|
|
20
|
+
* fractional index. `2.4` is two-fifths of the way from the third slide to the
|
|
21
|
+
* fourth, and every slide styles itself from its own distance to that number.
|
|
22
|
+
* A pan writes to it, a spring settles it onto a whole number, and the dots
|
|
23
|
+
* read it.
|
|
24
|
+
*
|
|
25
|
+
* That is why the track is a pan gesture rather than a paging `ScrollView`. A
|
|
26
|
+
* scroll view carries its offset natively and would serve `default` well
|
|
27
|
+
* enough, but `coverflow` and `stack` do not lay their slides along a track at
|
|
28
|
+
* all — they hold them in one place and pull them apart with transforms — so
|
|
29
|
+
* there would be nothing for it to scroll. One mechanism all four read beats a
|
|
30
|
+
* native scroller for one of them and something else for the rest.
|
|
31
|
+
*
|
|
32
|
+
* ## What each layout is for
|
|
33
|
+
*
|
|
34
|
+
* - **`default`** — a track. The honest choice for content that is read rather
|
|
35
|
+
* than admired: a row of cards, a gallery, an onboarding run.
|
|
36
|
+
* - **`interactive`** — the run fans out around the middle slide and tilts away
|
|
37
|
+
* on both sides, opening wider while a finger is down. For a small set worth
|
|
38
|
+
* showing off.
|
|
39
|
+
* - **`coverflow`** — the neighbours turn away from you in perspective. Best
|
|
40
|
+
* with art: covers, posters, photographs.
|
|
41
|
+
* - **`stack`** — a deck. The active card is on top with the next two peeking
|
|
42
|
+
* out behind it, and dragging takes the top one away. For cards dealt with
|
|
43
|
+
* one at a time, where the pile is the point.
|
|
44
|
+
*
|
|
45
|
+
* Depth is carried by scale, opacity and z-order rather than by moving slides
|
|
46
|
+
* along z: React Native's transform has `perspective` and `rotateY` but no
|
|
47
|
+
* `translateZ`, so a slide is made to *look* further away rather than put there.
|
|
48
|
+
*/
|
|
49
|
+
import { type ReactNode } from 'react';
|
|
50
|
+
import { type ViewProps } from 'react-native';
|
|
51
|
+
export type CarouselVariant = 'default' | 'interactive' | 'coverflow' | 'stack';
|
|
52
|
+
export type CarouselOrientation = 'horizontal' | 'vertical';
|
|
53
|
+
export type CarouselAlign = 'start' | 'center';
|
|
54
|
+
/** Position and controls, for a control of your own outside the built-in ones. */
|
|
55
|
+
export declare function useCarouselState(): {
|
|
56
|
+
index: number;
|
|
57
|
+
count: number;
|
|
58
|
+
scrollTo: (index: number) => void;
|
|
59
|
+
next: () => void;
|
|
60
|
+
previous: () => void;
|
|
61
|
+
};
|
|
62
|
+
export interface CarouselProps extends ViewProps {
|
|
63
|
+
className?: string;
|
|
64
|
+
/** How the slides are arranged, and how they move. */
|
|
65
|
+
variant?: CarouselVariant;
|
|
66
|
+
/** Which way the run travels. `stack` is always dealt sideways. */
|
|
67
|
+
orientation?: CarouselOrientation;
|
|
68
|
+
/** Run past the last slide back to the first, and the other way. */
|
|
69
|
+
loop?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Where the active slide sits. `center` is what the fanned layouts want;
|
|
72
|
+
* `start` suits a row of cards running off the trailing edge. `coverflow`
|
|
73
|
+
* and `stack` are always centred.
|
|
74
|
+
*/
|
|
75
|
+
align?: CarouselAlign;
|
|
76
|
+
/**
|
|
77
|
+
* Length of one slide along the direction of travel, in points. Measured from
|
|
78
|
+
* the carousel's own box when omitted, which is what a full-width slide
|
|
79
|
+
* wants; set it for a run that shows more than one at a time.
|
|
80
|
+
*/
|
|
81
|
+
itemSize?: number;
|
|
82
|
+
/** Advance on a timer. Stops for good the first time a finger lands. */
|
|
83
|
+
autoplay?: boolean;
|
|
84
|
+
/** Milliseconds each slide is held when `autoplay` is set. */
|
|
85
|
+
autoplayInterval?: number;
|
|
86
|
+
/** Controlled active slide. */
|
|
87
|
+
index?: number;
|
|
88
|
+
/** Starting slide when uncontrolled. */
|
|
89
|
+
defaultIndex?: number;
|
|
90
|
+
onIndexChange?: (index: number) => void;
|
|
91
|
+
/** Let go of the gesture, for a carousel inside something else that drags. */
|
|
92
|
+
scrollEnabled?: boolean;
|
|
93
|
+
children?: ReactNode;
|
|
94
|
+
}
|
|
95
|
+
/** Imperative handle, for driving the run from outside its own controls. */
|
|
96
|
+
export interface CarouselHandle {
|
|
97
|
+
next: () => void;
|
|
98
|
+
previous: () => void;
|
|
99
|
+
scrollTo: (index: number) => void;
|
|
100
|
+
}
|
|
101
|
+
export interface CarouselContentProps extends ViewProps {
|
|
102
|
+
className?: string;
|
|
103
|
+
children?: ReactNode;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The box the slides live in. Give it a height — nothing inside it is in the
|
|
107
|
+
* layout flow, so it has no height of its own to take.
|
|
108
|
+
*
|
|
109
|
+
* It does not move. Every slide places itself from `progress`, which is what
|
|
110
|
+
* lets `default` and `coverflow` be one component with different arithmetic
|
|
111
|
+
* rather than two different trees. The alignment here is the *resting* place
|
|
112
|
+
* every slide is offset from.
|
|
113
|
+
*/
|
|
114
|
+
declare function CarouselContent({ className, children, ...props }: CarouselContentProps): import("react").JSX.Element;
|
|
115
|
+
export interface CarouselItemProps extends ViewProps {
|
|
116
|
+
className?: string;
|
|
117
|
+
children?: ReactNode;
|
|
118
|
+
}
|
|
119
|
+
/** One slide. Its transform is whatever the root's `variant` asks for. */
|
|
120
|
+
declare function CarouselItem({ className, children, style, ...props }: CarouselItemProps): import("react").JSX.Element;
|
|
121
|
+
export interface CarouselCaptionProps extends ViewProps {
|
|
122
|
+
className?: string;
|
|
123
|
+
children?: ReactNode;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A slide's label, shown only while that slide is the active one.
|
|
127
|
+
*
|
|
128
|
+
* It lives inside the slide rather than beside the run, so it travels with what
|
|
129
|
+
* it names — a caption that stays put while the picture moves belongs to the
|
|
130
|
+
* carousel rather than to the picture.
|
|
131
|
+
*/
|
|
132
|
+
declare function CarouselCaption({ className, children, ...props }: CarouselCaptionProps): import("react").JSX.Element;
|
|
133
|
+
export interface CarouselDotsProps extends ViewProps {
|
|
134
|
+
className?: string;
|
|
135
|
+
/** Lay the dots down the side instead of across. */
|
|
136
|
+
orientation?: CarouselOrientation;
|
|
137
|
+
/** Jump to a slide by tapping its dot. */
|
|
138
|
+
interactive?: boolean;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* One dot per slide, the active one drawn as a bar.
|
|
142
|
+
*
|
|
143
|
+
* Length rather than colour alone carries the position: a row that differs only
|
|
144
|
+
* in opacity is unreadable at a glance, and invisible to anyone who cannot
|
|
145
|
+
* separate the two greys.
|
|
146
|
+
*/
|
|
147
|
+
declare function CarouselDots({ className, orientation, interactive, ...props }: CarouselDotsProps): import("react").JSX.Element | null;
|
|
148
|
+
export interface CarouselArrowProps extends ViewProps {
|
|
149
|
+
className?: string;
|
|
150
|
+
children?: ReactNode;
|
|
151
|
+
}
|
|
152
|
+
export interface CarouselControlsProps extends ViewProps {
|
|
153
|
+
className?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The arrows and the dots in one pill.
|
|
157
|
+
*
|
|
158
|
+
* Together rather than scattered, because they answer the same question — where
|
|
159
|
+
* am I in this, and how do I move — and a bar that reads as one object can sit
|
|
160
|
+
* over the content instead of taking a strip of the layout for itself.
|
|
161
|
+
*/
|
|
162
|
+
declare function CarouselControls({ className, ...props }: CarouselControlsProps): import("react").JSX.Element;
|
|
163
|
+
export declare const Carousel: import("react").ForwardRefExoticComponent<CarouselProps & import("react").RefAttributes<CarouselHandle>> & {
|
|
164
|
+
Content: typeof CarouselContent;
|
|
165
|
+
Item: typeof CarouselItem;
|
|
166
|
+
Caption: typeof CarouselCaption;
|
|
167
|
+
Dots: typeof CarouselDots;
|
|
168
|
+
Previous: {
|
|
169
|
+
({ className, children, ...props }: CarouselArrowProps): import("react").JSX.Element;
|
|
170
|
+
displayName: string;
|
|
171
|
+
};
|
|
172
|
+
Next: {
|
|
173
|
+
({ className, children, ...props }: CarouselArrowProps): import("react").JSX.Element;
|
|
174
|
+
displayName: string;
|
|
175
|
+
};
|
|
176
|
+
Controls: typeof CarouselControls;
|
|
177
|
+
};
|
|
178
|
+
export {};
|
|
179
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/carousel/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAgDvF,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,OAAO,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,UAAU,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;AAyC/C,kFAAkF;AAClF,wBAAgB,gBAAgB;;;sBA/BZ,MAAM,KAAK,IAAI;gBACrB,IAAI;oBACA,IAAI;EAgCrB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
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DatePicker — a calendar behind a button.
|
|
3
|
+
*
|
|
4
|
+
* ```tsx
|
|
5
|
+
* const [day, setDay] = useState<Date>();
|
|
6
|
+
*
|
|
7
|
+
* <DatePicker selected={day} onSelect={setDay} placeholder="Pick a date" />
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* It is the `Calendar` in a `Popover` with a trigger that reads back what was
|
|
11
|
+
* chosen, and it is a separate component from the calendar for the same reason
|
|
12
|
+
* `Select` is separate from a list: the hard parts are the ones around the
|
|
13
|
+
* grid — what a closed field says, when the panel closes, and what a range
|
|
14
|
+
* shows while only half of it has been picked.
|
|
15
|
+
*
|
|
16
|
+
* ## It closes when the selection is finished, not when it changes
|
|
17
|
+
*
|
|
18
|
+
* A single date is done in one tap, so the panel closes on it. A range needs
|
|
19
|
+
* two, so it stays open until the second — closing on the first would put
|
|
20
|
+
* someone back where they started with half a range on screen. Multiple never
|
|
21
|
+
* closes on its own; only the caller knows when a set is complete.
|
|
22
|
+
*
|
|
23
|
+
* ## An anchored panel, not a sheet
|
|
24
|
+
*
|
|
25
|
+
* A month grid is a fixed size that fits beside its trigger on any phone, and
|
|
26
|
+
* a sheet is the right container for a list of unknown length rather than for
|
|
27
|
+
* a shape that is always the same. Pass `presentation="bottom-sheet"` where the
|
|
28
|
+
* screen is busy — a form with the keyboard up is the usual case.
|
|
29
|
+
*/
|
|
30
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
31
|
+
import { type CalendarSystem } from '../../utils/date.js';
|
|
32
|
+
import { type CalendarCaptionLayout, type CalendarDisabled, type CalendarMode, type CalendarSelection } from '../calendar/index.js';
|
|
33
|
+
import { type PopoverPresentation } from '../popover/index.js';
|
|
34
|
+
export type DatePickerMode = CalendarMode;
|
|
35
|
+
export interface DatePickerProps<Mode extends DatePickerMode = 'single'> {
|
|
36
|
+
/** One day, several, or a span with two ends. */
|
|
37
|
+
mode?: Mode;
|
|
38
|
+
/** Controlled selection. Its shape follows `mode`. */
|
|
39
|
+
selected?: CalendarSelection[Mode];
|
|
40
|
+
/** Starting selection when uncontrolled. */
|
|
41
|
+
defaultSelected?: CalendarSelection[Mode];
|
|
42
|
+
onSelect?: (selected: CalendarSelection[Mode]) => void;
|
|
43
|
+
/** Controlled open state of the panel. */
|
|
44
|
+
open?: boolean;
|
|
45
|
+
onOpenChange?: (open: boolean) => void;
|
|
46
|
+
/** What the trigger reads when nothing has been chosen. */
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
/** Override how the chosen value is written on the trigger. */
|
|
49
|
+
format?: (selected: CalendarSelection[Mode]) => string;
|
|
50
|
+
/** Anchored panel, or a sheet from the bottom of the screen. */
|
|
51
|
+
presentation?: PopoverPresentation;
|
|
52
|
+
/** Stop the trigger opening it. */
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/** Days that cannot be picked: a list, a span, or a rule. */
|
|
55
|
+
disabledDates?: CalendarDisabled;
|
|
56
|
+
/** Earliest selectable day. */
|
|
57
|
+
minDate?: Date;
|
|
58
|
+
/** Latest selectable day. */
|
|
59
|
+
maxDate?: Date;
|
|
60
|
+
/** Months side by side inside the panel. */
|
|
61
|
+
numberOfMonths?: number;
|
|
62
|
+
/** `dropdown` swaps the month caption for month and year pickers. */
|
|
63
|
+
captionLayout?: CalendarCaptionLayout;
|
|
64
|
+
/** `0` is Sunday. */
|
|
65
|
+
weekStartsOn?: number;
|
|
66
|
+
/** BCP 47 tag for the month and weekday names, and for the trigger's text. */
|
|
67
|
+
locale?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Which calendar the months and day numbers are counted in. Forwarded to the
|
|
70
|
+
* grid, and used for the trigger's own text so the two always agree.
|
|
71
|
+
*/
|
|
72
|
+
calendar?: CalendarSystem;
|
|
73
|
+
className?: string;
|
|
74
|
+
/**
|
|
75
|
+
* A trigger of your own. Given one, it is cloned with an `onPress` that opens
|
|
76
|
+
* the panel — so a field row or an icon button can stand in for the default
|
|
77
|
+
* button without this component knowing what either looks like.
|
|
78
|
+
*/
|
|
79
|
+
children?: ReactElement<{
|
|
80
|
+
onPress?: () => void;
|
|
81
|
+
}> | ReactNode;
|
|
82
|
+
}
|
|
83
|
+
declare function DatePickerRoot<Mode extends DatePickerMode = 'single'>({ mode, selected, defaultSelected, onSelect, open: openProp, onOpenChange, placeholder, format, presentation, disabled, disabledDates, minDate, maxDate, numberOfMonths, captionLayout, weekStartsOn, locale, calendar, className, children, }: DatePickerProps<Mode>): import("react").JSX.Element;
|
|
84
|
+
declare namespace DatePickerRoot {
|
|
85
|
+
var displayName: string;
|
|
86
|
+
}
|
|
87
|
+
export declare const DatePicker: typeof DatePickerRoot & {
|
|
88
|
+
Trigger: ({ children }: import("../popover/index.js").PopoverTriggerProps) => import("react").JSX.Element;
|
|
89
|
+
};
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/date-picker/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAkC,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK1F,OAAO,EAAsC,KAAK,cAAc,EAAE,MAAM,qBAAkB,CAAC;AAE3F,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEvB,MAAM,sBAAa,CAAC;AACrB,OAAO,EAAW,KAAK,mBAAmB,EAAE,MAAM,qBAAY,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC;AAqC1C,MAAM,WAAW,eAAe,CAAC,IAAI,SAAS,cAAc,GAAG,QAAQ;IACrE,iDAAiD;IACjD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,sDAAsD;IACtD,QAAQ,CAAC,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B,EACvB,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,WAAiC,EACjC,MAAM,EACN,YAAwB,EACxB,QAAgB,EAChB,aAAa,EACb,OAAO,EACP,OAAO,EACP,cAAkB,EAClB,aAAuB,EACvB,YAAgB,EAChB,MAAM,EACN,QAAoB,EACpB,SAAS,EACT,QAAQ,GACT,EAAE,eAAe,CAAC,IAAI,CAAC,+BAgFvB;kBArGQ,cAAc;;;AAwGvB,eAAO,MAAM,UAAU;;CAErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI/D,OAAO,EAAQ,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI/D,OAAO,EAAQ,KAAK,SAAS,EAAgB,MAAM,0BAAuB,CAAC;AAmB3E,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,iBAAS,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,WAAmB,EAAE,EAAE,WAAW,+BAmBrF;AAED,UAAU,kBAA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