panelui-native 0.46.0 → 0.49.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.
Files changed (72) hide show
  1. package/README.md +5 -1
  2. package/lib/module/components/accordion/index.js +32 -4
  3. package/lib/module/components/accordion/index.js.map +1 -1
  4. package/lib/module/components/button/index.js +83 -15
  5. package/lib/module/components/button/index.js.map +1 -1
  6. package/lib/module/components/button-group/index.js +186 -0
  7. package/lib/module/components/button-group/index.js.map +1 -0
  8. package/lib/module/components/color-picker/index.js +110 -1
  9. package/lib/module/components/color-picker/index.js.map +1 -1
  10. package/lib/module/components/date-time-picker/index.js +23 -5
  11. package/lib/module/components/date-time-picker/index.js.map +1 -1
  12. package/lib/module/components/fab/index.js +514 -0
  13. package/lib/module/components/fab/index.js.map +1 -0
  14. package/lib/module/components/markdown-editor/index.js +406 -0
  15. package/lib/module/components/markdown-editor/index.js.map +1 -0
  16. package/lib/module/components/markdown-editor/markdown-transforms.js +243 -0
  17. package/lib/module/components/markdown-editor/markdown-transforms.js.map +1 -0
  18. package/lib/module/components/questionnaire/index.js +1312 -0
  19. package/lib/module/components/questionnaire/index.js.map +1 -0
  20. package/lib/module/components/tabs/index.js +94 -18
  21. package/lib/module/components/tabs/index.js.map +1 -1
  22. package/lib/module/components/time-picker/index.js +34 -6
  23. package/lib/module/components/time-picker/index.js.map +1 -1
  24. package/lib/module/components/tree/index.js +500 -0
  25. package/lib/module/components/tree/index.js.map +1 -0
  26. package/lib/module/icons/index.js +217 -0
  27. package/lib/module/icons/index.js.map +1 -1
  28. package/lib/module/index.js +6 -1
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/typescript/src/components/accordion/index.d.ts +21 -0
  31. package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
  32. package/lib/typescript/src/components/button/index.d.ts +21 -0
  33. package/lib/typescript/src/components/button/index.d.ts.map +1 -1
  34. package/lib/typescript/src/components/button-group/index.d.ts +212 -0
  35. package/lib/typescript/src/components/button-group/index.d.ts.map +1 -0
  36. package/lib/typescript/src/components/color-picker/index.d.ts +82 -1
  37. package/lib/typescript/src/components/color-picker/index.d.ts.map +1 -1
  38. package/lib/typescript/src/components/date-time-picker/index.d.ts +7 -1
  39. package/lib/typescript/src/components/date-time-picker/index.d.ts.map +1 -1
  40. package/lib/typescript/src/components/fab/index.d.ts +285 -0
  41. package/lib/typescript/src/components/fab/index.d.ts.map +1 -0
  42. package/lib/typescript/src/components/markdown-editor/index.d.ts +102 -0
  43. package/lib/typescript/src/components/markdown-editor/index.d.ts.map +1 -0
  44. package/lib/typescript/src/components/markdown-editor/markdown-transforms.d.ts +76 -0
  45. package/lib/typescript/src/components/markdown-editor/markdown-transforms.d.ts.map +1 -0
  46. package/lib/typescript/src/components/questionnaire/index.d.ts +336 -0
  47. package/lib/typescript/src/components/questionnaire/index.d.ts.map +1 -0
  48. package/lib/typescript/src/components/tabs/index.d.ts +9 -0
  49. package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
  50. package/lib/typescript/src/components/time-picker/index.d.ts +19 -1
  51. package/lib/typescript/src/components/time-picker/index.d.ts.map +1 -1
  52. package/lib/typescript/src/components/tree/index.d.ts +125 -0
  53. package/lib/typescript/src/components/tree/index.d.ts.map +1 -0
  54. package/lib/typescript/src/icons/index.d.ts +22 -0
  55. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  56. package/lib/typescript/src/index.d.ts +8 -3
  57. package/lib/typescript/src/index.d.ts.map +1 -1
  58. package/package.json +1 -1
  59. package/src/components/accordion/index.tsx +48 -6
  60. package/src/components/button/index.tsx +97 -15
  61. package/src/components/button-group/index.tsx +199 -0
  62. package/src/components/color-picker/index.tsx +140 -3
  63. package/src/components/date-time-picker/index.tsx +39 -3
  64. package/src/components/fab/index.tsx +583 -0
  65. package/src/components/markdown-editor/index.tsx +526 -0
  66. package/src/components/markdown-editor/markdown-transforms.ts +228 -0
  67. package/src/components/questionnaire/index.tsx +1615 -0
  68. package/src/components/tabs/index.tsx +100 -28
  69. package/src/components/time-picker/index.tsx +42 -6
  70. package/src/components/tree/index.tsx +564 -0
  71. package/src/icons/index.tsx +154 -0
  72. package/src/index.ts +77 -1
@@ -0,0 +1,212 @@
1
+ /**
2
+ * ButtonGroup — several buttons drawn as one control.
3
+ *
4
+ * ```tsx
5
+ * <ButtonGroup>
6
+ * <Button startContent={<ListChecksIcon size={16} />}>Tasks</Button>
7
+ * <Button startContent={<CalendarIcon size={16} />}>Agenda</Button>
8
+ * <Button startContent={<ChartIcon size={16} />}>Board</Button>
9
+ * </ButtonGroup>
10
+ * ```
11
+ *
12
+ * The buttons stay buttons. Anything a `Button` does — an icon, a badge, a
13
+ * loading state, a disabled segment, opening a Popover — it still does inside a
14
+ * group, because the group is a container rather than a component that takes a
15
+ * list of items and renders them for you. A list-of-items API has to grow a
16
+ * prop for every one of those things; this one has none of them and can do all
17
+ * of them.
18
+ *
19
+ * ## Why the container draws the border
20
+ *
21
+ * A joined run could be built by giving the first and last segments their
22
+ * corners and squaring the ones between, then collapsing every shared edge with
23
+ * a negative margin. That works on the web and is a stack of off-by-one
24
+ * problems on a phone: the hairlines land on different fractions of a pixel per
25
+ * device, and a run that wraps has no first or last segment any more.
26
+ *
27
+ * So the group draws the shape once — one border, one radius, one shadow,
28
+ * clipped — and the buttons inside it draw none of their own. The dividers are
29
+ * real one-pixel views the group puts between its children, which is also why
30
+ * they are always exactly one pixel and always in the same place.
31
+ *
32
+ * ## What it passes down
33
+ *
34
+ * `variant` and `size` fill in for a button that did not choose its own, so a
35
+ * run of six does not repeat the same two props six times. A segment that wants
36
+ * to stand out — the selected one, the destructive one — sets its own and wins.
37
+ *
38
+ * ```tsx
39
+ * <ButtonGroup size="sm">
40
+ * <Button>Day</Button>
41
+ * <Button variant="secondary">Week</Button> {/* the selected one *\/}
42
+ * <Button>Month</Button>
43
+ * </ButtonGroup>
44
+ * ```
45
+ *
46
+ * ## Not a selection control
47
+ *
48
+ * This joins buttons; what they mean is yours. For a control that owns which
49
+ * one is on, reach for `ToggleButtonGroup`, and for switching between panels of
50
+ * content reach for `Tabs` — a segmented run of buttons that swaps a screen is
51
+ * navigation, and navigation should say so to a screen reader.
52
+ */
53
+ import { type ReactNode } from 'react';
54
+ import { View, type ViewProps } from 'react-native';
55
+ import { type VariantProps } from 'tailwind-variants';
56
+ import { type ButtonSize, type ButtonVariant } from '../button/index.js';
57
+ /** Which way the run reads. */
58
+ export type ButtonGroupOrientation = 'horizontal' | 'vertical';
59
+ declare const buttonGroupVariants: import("tailwind-variants").TVReturnType<{
60
+ orientation: {
61
+ horizontal: {
62
+ root: string;
63
+ divider: string;
64
+ };
65
+ vertical: {
66
+ root: string;
67
+ divider: string;
68
+ };
69
+ };
70
+ attached: {
71
+ true: {
72
+ root: string;
73
+ };
74
+ false: {
75
+ root: string;
76
+ };
77
+ };
78
+ size: {
79
+ sm: {
80
+ root: string;
81
+ };
82
+ md: {
83
+ root: string;
84
+ };
85
+ lg: {
86
+ root: string;
87
+ };
88
+ icon: {
89
+ root: string;
90
+ };
91
+ };
92
+ fullWidth: {
93
+ true: {
94
+ root: string;
95
+ };
96
+ };
97
+ }, {
98
+ root: string;
99
+ divider: string;
100
+ }, undefined, {
101
+ orientation: {
102
+ horizontal: {
103
+ root: string;
104
+ divider: string;
105
+ };
106
+ vertical: {
107
+ root: string;
108
+ divider: string;
109
+ };
110
+ };
111
+ attached: {
112
+ true: {
113
+ root: string;
114
+ };
115
+ false: {
116
+ root: string;
117
+ };
118
+ };
119
+ size: {
120
+ sm: {
121
+ root: string;
122
+ };
123
+ md: {
124
+ root: string;
125
+ };
126
+ lg: {
127
+ root: string;
128
+ };
129
+ icon: {
130
+ root: string;
131
+ };
132
+ };
133
+ fullWidth: {
134
+ true: {
135
+ root: string;
136
+ };
137
+ };
138
+ }, {
139
+ root: string;
140
+ divider: string;
141
+ }, import("tailwind-variants").TVReturnType<{
142
+ orientation: {
143
+ horizontal: {
144
+ root: string;
145
+ divider: string;
146
+ };
147
+ vertical: {
148
+ root: string;
149
+ divider: string;
150
+ };
151
+ };
152
+ attached: {
153
+ true: {
154
+ root: string;
155
+ };
156
+ false: {
157
+ root: string;
158
+ };
159
+ };
160
+ size: {
161
+ sm: {
162
+ root: string;
163
+ };
164
+ md: {
165
+ root: string;
166
+ };
167
+ lg: {
168
+ root: string;
169
+ };
170
+ icon: {
171
+ root: string;
172
+ };
173
+ };
174
+ fullWidth: {
175
+ true: {
176
+ root: string;
177
+ };
178
+ };
179
+ }, {
180
+ root: string;
181
+ divider: string;
182
+ }, undefined, unknown, unknown, undefined>>;
183
+ type ButtonGroupVariantProps = VariantProps<typeof buttonGroupVariants>;
184
+ export interface ButtonGroupProps extends ViewProps, Omit<ButtonGroupVariantProps, 'size' | 'attached'> {
185
+ className?: string;
186
+ /** Which way the run reads. Vertical is the toolbar down the side of a canvas. */
187
+ orientation?: ButtonGroupOrientation;
188
+ /** Fills in for any button that did not choose its own. */
189
+ variant?: ButtonVariant;
190
+ /** Fills in for any button that did not choose its own, and sets the radius. */
191
+ size?: ButtonSize;
192
+ /**
193
+ * Draw the run as one joined shape.
194
+ *
195
+ * On by default — that is what a group is. Turn it off for a plain row of
196
+ * separate buttons that should still share a variant and a size, which is a
197
+ * toolbar rather than a segmented control.
198
+ */
199
+ attached?: boolean;
200
+ /**
201
+ * Span the container, with the segments sharing it equally.
202
+ *
203
+ * Equally, not by content: a row of segments at their natural widths is a row
204
+ * whose divisions move when the labels change, and a picker whose halves are
205
+ * different sizes reads as though one of them matters more.
206
+ */
207
+ fullWidth?: boolean;
208
+ children?: ReactNode;
209
+ }
210
+ export declare const ButtonGroup: import("react").ForwardRefExoticComponent<ButtonGroupProps & import("react").RefAttributes<View>>;
211
+ export {};
212
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button-group/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,oBAAW,CAAC;AAEnB,+BAA+B;AAC/B,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE/D,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAqCvB,CAAC;AAEH,KAAK,uBAAuB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAExE,MAAM,WAAW,gBACf,SAAQ,SAAS,EACf,IAAI,CAAC,uBAAuB,EAAE,MAAM,GAAG,UAAU,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,2DAA2D;IAC3D,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,gFAAgF;IAChF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAiED,eAAO,MAAM,WAAW,mGAAkB,CAAC"}
@@ -28,12 +28,35 @@
28
28
  * a control with no alpha is one that has no `ColorPicker.Alpha`, not one with
29
29
  * a prop turned off.
30
30
  *
31
+ * ## Folding it away
32
+ *
33
+ * A picker is a page's worth of controls in service of one value, and that
34
+ * value is read far more often than it is changed — so `presentation` puts the
35
+ * controls behind the row that reads it out:
36
+ *
37
+ * ```tsx
38
+ * <ColorPicker value={accent} onValueChange={setAccent} presentation="popover">
39
+ * <ColorPicker.Trigger>
40
+ * <ColorPicker.Field label="Accent" />
41
+ * </ColorPicker.Trigger>
42
+ * <ColorPicker.Content>
43
+ * <ColorPicker.Area />
44
+ * <ColorPicker.Hue />
45
+ * </ColorPicker.Content>
46
+ * </ColorPicker>
47
+ * ```
48
+ *
49
+ * `Content` re-provides the picker's context around what it holds, because the
50
+ * panel is portalled above the rest of the screen and is therefore no longer
51
+ * below the picker in the tree by the time the parts inside it go looking.
52
+ *
31
53
  * Works controlled (`value` + `onValueChange`) or uncontrolled (`defaultValue`).
32
54
  */
33
- import { type ReactNode } from 'react';
55
+ import { type ReactElement, type ReactNode } from 'react';
34
56
  import { View } from 'react-native';
35
57
  import { type VariantProps } from 'tailwind-variants';
36
58
  import { type ColorFormat } from '../../utils/color.js';
59
+ import { type PopoverContentProps } from '../popover/index.js';
37
60
  declare const colorPickerVariants: import("tailwind-variants").TVReturnType<{
38
61
  size: {
39
62
  sm: {};
@@ -130,6 +153,8 @@ declare const colorPickerVariants: import("tailwind-variants").TVReturnType<{
130
153
  }, undefined, unknown, unknown, undefined>>;
131
154
  type ColorPickerVariantProps = VariantProps<typeof colorPickerVariants>;
132
155
  export type ColorPickerSize = NonNullable<ColorPickerVariantProps['size']>;
156
+ /** How the controls get onto the screen. */
157
+ export type ColorPickerPresentation = 'inline' | 'popover' | 'bottom-sheet';
133
158
  export interface ColorPickerProps extends Omit<ColorPickerVariantProps, 'disabled'> {
134
159
  className?: string;
135
160
  /** Controlled colour. Leave unset and pass `defaultValue` to run uncontrolled. */
@@ -157,9 +182,55 @@ export interface ColorPickerProps extends Omit<ColorPickerVariantProps, 'disable
157
182
  * buzz proportional to speed.
158
183
  */
159
184
  haptics?: boolean;
185
+ /**
186
+ * How the controls get onto the screen.
187
+ *
188
+ * `inline` stacks them where they are written, and is the default. The other
189
+ * two put them behind a `ColorPicker.Trigger` and draw them in a
190
+ * `ColorPicker.Content` — which is the arrangement a colour usually wants,
191
+ * since a picker is a page's worth of controls in service of one value that
192
+ * is looked at far more often than it is changed.
193
+ */
194
+ presentation?: ColorPickerPresentation;
195
+ /** Controlled open state of the panel. Ignored by `inline`. */
196
+ open?: boolean;
197
+ onOpenChange?: (open: boolean) => void;
160
198
  /** The parts, in the order they should stack. */
161
199
  children: ReactNode;
162
200
  }
201
+ export interface ColorPickerTriggerProps {
202
+ /** One element, cloned with an `onPress` that opens the panel. */
203
+ children: ReactElement<{
204
+ onPress?: (...args: unknown[]) => void;
205
+ }>;
206
+ }
207
+ /**
208
+ * What you press to open the picker. `ColorPicker.Field` is the obvious child —
209
+ * it already reads out the colour it would let you change — but anything that
210
+ * takes an `onPress` will do.
211
+ */
212
+ declare function ColorPickerTrigger({ children }: ColorPickerTriggerProps): import("react").JSX.Element;
213
+ declare namespace ColorPickerTrigger {
214
+ var displayName: string;
215
+ }
216
+ export interface ColorPickerContentProps extends PopoverContentProps {
217
+ }
218
+ /**
219
+ * The panel the controls are drawn in.
220
+ *
221
+ * It re-provides the picker's context around its children, and has to: the
222
+ * panel is rendered through a portal, above everything else on the screen, so
223
+ * by the time the parts inside it look for the picker they are no longer
224
+ * anywhere below it in the tree. Without this the first `ColorPicker.Area`
225
+ * inside a popover would throw.
226
+ *
227
+ * Defaults to the trigger's width, floored, so a panel opened from a labelled
228
+ * strip lines up under it rather than announcing itself as a different object.
229
+ */
230
+ declare function ColorPickerContent({ className, width, minWidth, children, ...props }: ColorPickerContentProps): import("react").JSX.Element;
231
+ declare namespace ColorPickerContent {
232
+ var displayName: string;
233
+ }
163
234
  export interface ColorPickerAreaProps {
164
235
  className?: string;
165
236
  /** Height of the square in points. Defaults to the picker's size. */
@@ -214,6 +285,14 @@ export interface ColorPickerFieldProps {
214
285
  showValue?: boolean;
215
286
  /** Extra classes for the swatch. */
216
287
  swatchClassName?: string;
288
+ /**
289
+ * Makes the strip pressable, and a button to a screen reader.
290
+ *
291
+ * Mostly you do not pass this yourself: `ColorPicker.Trigger` clones the
292
+ * strip with one, which is what turns the row into the thing that opens the
293
+ * picker.
294
+ */
295
+ onPress?: (...args: unknown[]) => void;
217
296
  /** Anything to put after the swatch — a copy button, a reset. */
218
297
  children?: ReactNode;
219
298
  }
@@ -244,6 +323,8 @@ export interface ColorPickerWheelProps {
244
323
  thumbClassName?: string;
245
324
  }
246
325
  export declare const ColorPicker: import("react").ForwardRefExoticComponent<ColorPickerProps & import("react").RefAttributes<View>> & {
326
+ Trigger: typeof ColorPickerTrigger;
327
+ Content: typeof ColorPickerContent;
247
328
  Field: import("react").ForwardRefExoticComponent<ColorPickerFieldProps & import("react").RefAttributes<View>>;
248
329
  Area: import("react").ForwardRefExoticComponent<ColorPickerAreaProps & import("react").RefAttributes<View>>;
249
330
  Wheel: import("react").ForwardRefExoticComponent<ColorPickerWheelProps & import("react").RefAttributes<View>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/color-picker/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,IAAI,EAGL,MAAM,cAAc,CAAC;AAqBtB,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI1D,OAAO,EAKL,KAAK,WAAW,EAEjB,MAAM,sBAAmB,CAAC;AAiC3B,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA2CvB,CAAC;AAEH,KAAK,uBAAuB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACxE,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,uBA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AA0DD,MAAM,WAAW,0BAA0B;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA4JD,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAoLD,eAAO,MAAM,WAAW;;;;;;;;;;;;CAYtB,CAAC"}
@@ -98,6 +98,12 @@ export interface DateTimePickerProps {
98
98
  calendar?: CalendarSystem;
99
99
  /** Label on the button that closes the panel. */
100
100
  doneLabel?: string;
101
+ /**
102
+ * What the time half of the panel is called, above its face. The date half
103
+ * names itself with the month it is showing; the time half has nothing that
104
+ * would say what it is otherwise.
105
+ */
106
+ timeLabel?: string;
101
107
  className?: string;
102
108
  /**
103
109
  * A trigger of your own. Given one, it is cloned with an `onPress` that opens
@@ -110,7 +116,7 @@ export interface DateTimePickerProps {
110
116
  onPress?: () => void;
111
117
  }> | ReactNode;
112
118
  }
113
- declare function DateTimePickerRoot({ value: valueProp, defaultValue, onValueChange, layout, presentation, open: openProp, onOpenChange, hourCycle, minuteStep, minTime, maxTime, placeholder, format, disabled, disabledDates, minDate, maxDate, captionLayout, weekStartsOn, locale, calendar, doneLabel, className, children, }: DateTimePickerProps): import("react").JSX.Element;
119
+ declare function DateTimePickerRoot({ value: valueProp, defaultValue, onValueChange, layout, presentation, open: openProp, onOpenChange, hourCycle, minuteStep, minTime, maxTime, placeholder, format, disabled, disabledDates, minDate, maxDate, captionLayout, weekStartsOn, locale, calendar, doneLabel, timeLabel, className, children, }: DateTimePickerProps): import("react").JSX.Element;
114
120
  declare namespace DateTimePickerRoot {
115
121
  var displayName: string;
116
122
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/date-time-picker/index.tsx"],"names":[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AAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,MAAM,CAAC;IACjC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,+BAA+B;IAC/B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,6BAA6B;IAC7B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,qEAAqE;IACrE,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;CAC/D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,aAAa,EACb,MAAgB,EAChB,YAAwB,EACxB,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,SAAc,EACd,UAAU,EACV,OAAO,EACP,OAAO,EACP,WAAiC,EACjC,MAAM,EACN,QAAgB,EAChB,aAAa,EACb,OAAO,EACP,OAAO,EACP,aAAuB,EACvB,YAAgB,EAChB,MAAM,EACN,QAAoB,EACpB,SAAkB,EAClB,SAAS,EACT,QAAQ,GACT,EAAE,mBAAmB,+BAyLrB;kBAlNQ,kBAAkB;;;AAqN3B,eAAO,MAAM,cAAc;;CAEzB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/date-time-picker/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;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* <Fab icon={<PlusIcon size={24} />} accessibilityLabel="New note" onPress={compose} />
6
+ * ```
7
+ *
8
+ * ## It floats, which is the whole problem with it
9
+ *
10
+ * A button pinned over the content is a button covering some of it, and the
11
+ * bottom-right corner of a scrolling list is exactly where the last row goes. So
12
+ * a Fab is right when a screen has *one* action worth that trade and wrong when
13
+ * it has three — a corner with three buttons in it is a toolbar that has been
14
+ * put in the wrong place. Where a screen has several, the honest shapes are a
15
+ * `ButtonGroup` in a bar or, if one of them really does lead, this with a
16
+ * `Fab.Group` behind it.
17
+ *
18
+ * It positions itself absolutely against its nearest positioned ancestor, which
19
+ * on a screen means the screen. Give the content below it enough bottom padding
20
+ * to scroll clear — this cannot know how tall your list is, and a Fab sitting on
21
+ * the last row forever is the failure people actually hit.
22
+ *
23
+ * ## Extended, and when to bother
24
+ *
25
+ * ```tsx
26
+ * <Fab extended icon={<PencilIcon size={20} />}>Write</Fab>
27
+ * ```
28
+ *
29
+ * A lone glyph is a guess unless the glyph is a plus. `extended` spells the
30
+ * action out, costs the width, and is worth it for anything a plus would not
31
+ * have said.
32
+ *
33
+ * ## The speed dial
34
+ *
35
+ * ```tsx
36
+ * <Fab.Group icon={<PlusIcon size={24} />} accessibilityLabel="Add">
37
+ * <Fab.Action icon={<ImageIcon size={18} />} label="Photo" onPress={addPhoto} />
38
+ * <Fab.Action icon={<FileIcon size={18} />} label="File" onPress={addFile} />
39
+ * </Fab.Group>
40
+ * ```
41
+ *
42
+ * The actions come out of the button one after another rather than together —
43
+ * a stagger of a few frames each, which is enough to read as a list unfolding
44
+ * instead of a menu appearing. Every action carries its label beside it, because
45
+ * a column of unlabelled circles is a quiz.
46
+ *
47
+ * Opening also drops a scrim over the screen. Not for looks: an open dial is
48
+ * modal — the next tap either picks something or closes it — and a scrim is what
49
+ * says so, as well as what catches the tap that closes it.
50
+ *
51
+ * A group draws itself through a portal, above everything else — the scrim and
52
+ * the buttons together, so the backdrop cannot end up on top of the dial it is
53
+ * behind. That means its `offset` is measured from the screen's edges rather
54
+ * than from whatever it is written inside, which is what lets it be declared
55
+ * next to the content it belongs to instead of at the root of the screen.
56
+ */
57
+ import { type ReactNode } from 'react';
58
+ import { View, type ViewProps } from 'react-native';
59
+ import { type VariantProps } from 'tailwind-variants';
60
+ /** Which corner the button sits in. */
61
+ export type FabPlacement = 'bottom-right' | 'bottom-center' | 'bottom-left';
62
+ declare const fabVariants: import("tailwind-variants").TVReturnType<{
63
+ size: {
64
+ sm: {
65
+ root: string;
66
+ label: string;
67
+ };
68
+ md: {
69
+ root: string;
70
+ label: string;
71
+ };
72
+ lg: {
73
+ root: string;
74
+ label: string;
75
+ };
76
+ };
77
+ extended: {
78
+ true: {};
79
+ false: {};
80
+ };
81
+ variant: {
82
+ primary: {
83
+ root: string;
84
+ label: string;
85
+ };
86
+ secondary: {
87
+ root: string;
88
+ label: string;
89
+ };
90
+ surface: {
91
+ root: string;
92
+ label: string;
93
+ };
94
+ destructive: {
95
+ root: string;
96
+ label: string;
97
+ };
98
+ };
99
+ disabled: {
100
+ true: {
101
+ root: string;
102
+ };
103
+ };
104
+ }, {
105
+ root: string;
106
+ label: string;
107
+ }, undefined, {
108
+ size: {
109
+ sm: {
110
+ root: string;
111
+ label: string;
112
+ };
113
+ md: {
114
+ root: string;
115
+ label: string;
116
+ };
117
+ lg: {
118
+ root: string;
119
+ label: string;
120
+ };
121
+ };
122
+ extended: {
123
+ true: {};
124
+ false: {};
125
+ };
126
+ variant: {
127
+ primary: {
128
+ root: string;
129
+ label: string;
130
+ };
131
+ secondary: {
132
+ root: string;
133
+ label: string;
134
+ };
135
+ surface: {
136
+ root: string;
137
+ label: string;
138
+ };
139
+ destructive: {
140
+ root: string;
141
+ label: string;
142
+ };
143
+ };
144
+ disabled: {
145
+ true: {
146
+ root: string;
147
+ };
148
+ };
149
+ }, {
150
+ root: string;
151
+ label: string;
152
+ }, import("tailwind-variants").TVReturnType<{
153
+ size: {
154
+ sm: {
155
+ root: string;
156
+ label: string;
157
+ };
158
+ md: {
159
+ root: string;
160
+ label: string;
161
+ };
162
+ lg: {
163
+ root: string;
164
+ label: string;
165
+ };
166
+ };
167
+ extended: {
168
+ true: {};
169
+ false: {};
170
+ };
171
+ variant: {
172
+ primary: {
173
+ root: string;
174
+ label: string;
175
+ };
176
+ secondary: {
177
+ root: string;
178
+ label: string;
179
+ };
180
+ surface: {
181
+ root: string;
182
+ label: string;
183
+ };
184
+ destructive: {
185
+ root: string;
186
+ label: string;
187
+ };
188
+ };
189
+ disabled: {
190
+ true: {
191
+ root: string;
192
+ };
193
+ };
194
+ }, {
195
+ root: string;
196
+ label: string;
197
+ }, undefined, unknown, unknown, undefined>>;
198
+ type FabVariantProps = VariantProps<typeof fabVariants>;
199
+ /** How big the button is. */
200
+ export type FabSize = NonNullable<FabVariantProps['size']>;
201
+ /** What the button is drawn in. */
202
+ export type FabVariant = NonNullable<FabVariantProps['variant']>;
203
+ export interface FabProps extends Omit<ViewProps, 'children'>, FabVariantProps {
204
+ className?: string;
205
+ /** The glyph. Sized by you — this is the one thing that should not guess. */
206
+ icon?: ReactNode;
207
+ /**
208
+ * The label, which turns the circle into a stadium. Needs `extended`; a
209
+ * label with nowhere to go is a label that gets clipped by the circle.
210
+ */
211
+ children?: ReactNode;
212
+ /** Spell the action out beside the glyph. */
213
+ extended?: boolean;
214
+ /**
215
+ * Pin it over the content, in a corner.
216
+ *
217
+ * Left out, it is an ordinary button in the flow — which is what you want
218
+ * inside a `Fab.Group`, or when the screen already has somewhere for it to
219
+ * sit.
220
+ */
221
+ placement?: FabPlacement;
222
+ /** Distance from the edges when `placement` is set, in points. */
223
+ offset?: number;
224
+ onPress?: () => void;
225
+ disabled?: boolean;
226
+ /**
227
+ * A tick on press. Off by default — needs the optional `expo-haptics`, and
228
+ * is silent without it.
229
+ */
230
+ haptics?: boolean;
231
+ /** Required for an icon-only button. A lone glyph reads out as nothing. */
232
+ accessibilityLabel?: string;
233
+ }
234
+ export interface FabGroupProps extends Omit<ViewProps, 'children'> {
235
+ className?: string;
236
+ /** The glyph on the trigger. */
237
+ icon?: ReactNode;
238
+ /** The trigger's label, if it should be extended while closed. */
239
+ label?: string;
240
+ /** `Fab.Action` children, in the order they should unfold. */
241
+ children?: ReactNode;
242
+ /** Controlled open state. */
243
+ open?: boolean;
244
+ onOpenChange?: (open: boolean) => void;
245
+ /** Which corner of the *screen* the whole dial parks in. */
246
+ placement?: FabPlacement;
247
+ /** Distance from the screen's edges, in points. Add your safe-area inset. */
248
+ offset?: number;
249
+ size?: FabSize;
250
+ variant?: FabVariant;
251
+ disabled?: boolean;
252
+ haptics?: boolean;
253
+ /** Frost the screen behind the open dial instead of dimming it. */
254
+ blur?: boolean;
255
+ /** Required — the trigger is a lone glyph until it is opened. */
256
+ accessibilityLabel?: string;
257
+ /**
258
+ * Turn the trigger's glyph a quarter circle while the dial is open.
259
+ *
260
+ * On by default, and it is doing real work when the glyph is a plus: the
261
+ * same mark becomes a cross, which says "this closes now" without a second
262
+ * icon that has to be swapped in. Turn it off for a glyph that means
263
+ * something at one angle only.
264
+ */
265
+ rotateOnOpen?: boolean;
266
+ }
267
+ export interface FabActionProps extends Omit<ViewProps, 'children'> {
268
+ className?: string;
269
+ /** The glyph. */
270
+ icon?: ReactNode;
271
+ /** What it does, beside the glyph. A column of unlabelled circles is a quiz. */
272
+ label?: string;
273
+ onPress?: () => void;
274
+ disabled?: boolean;
275
+ /** Draws it in the destructive colour, for the one that removes something. */
276
+ destructive?: boolean;
277
+ /** Extra classes for the label chip. */
278
+ labelClassName?: string;
279
+ }
280
+ export declare const Fab: import("react").ForwardRefExoticComponent<FabProps & import("react").RefAttributes<View>> & {
281
+ Group: import("react").ForwardRefExoticComponent<FabGroupProps & import("react").RefAttributes<View>>;
282
+ Action: import("react").ForwardRefExoticComponent<FabActionProps & import("react").RefAttributes<View>>;
283
+ };
284
+ export {};
285
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["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