panelui-native 0.44.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.
- package/README.md +6 -1
- package/lib/module/components/accordion/index.js +32 -4
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/button/index.js +83 -15
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/button-group/index.js +186 -0
- package/lib/module/components/button-group/index.js.map +1 -0
- package/lib/module/components/color-picker/index.js +110 -1
- package/lib/module/components/color-picker/index.js.map +1 -1
- package/lib/module/components/combobox/index.js +7 -1
- package/lib/module/components/combobox/index.js.map +1 -1
- package/lib/module/components/date-time-picker/index.js +272 -0
- package/lib/module/components/date-time-picker/index.js.map +1 -0
- package/lib/module/components/fab/index.js +514 -0
- package/lib/module/components/fab/index.js.map +1 -0
- package/lib/module/components/grid-item/index.js +486 -0
- package/lib/module/components/grid-item/index.js.map +1 -0
- package/lib/module/components/{kpi-chart → kpi}/index.js +62 -62
- package/lib/module/components/kpi/index.js.map +1 -0
- package/lib/module/components/line-chart/index.js +92 -10
- package/lib/module/components/line-chart/index.js.map +1 -1
- package/lib/module/components/markdown-editor/index.js +406 -0
- package/lib/module/components/markdown-editor/index.js.map +1 -0
- package/lib/module/components/markdown-editor/markdown-transforms.js +243 -0
- package/lib/module/components/markdown-editor/markdown-transforms.js.map +1 -0
- package/lib/module/components/pie-chart/index.js +625 -0
- package/lib/module/components/pie-chart/index.js.map +1 -0
- package/lib/module/components/questionnaire/index.js +1312 -0
- package/lib/module/components/questionnaire/index.js.map +1 -0
- package/lib/module/components/scatter-chart/index.js +1173 -0
- package/lib/module/components/scatter-chart/index.js.map +1 -0
- package/lib/module/components/tabs/index.js +359 -41
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/time-picker/index.js +34 -6
- package/lib/module/components/time-picker/index.js.map +1 -1
- package/lib/module/components/tree/index.js +500 -0
- package/lib/module/components/tree/index.js.map +1 -0
- package/lib/module/icons/index.js +217 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +11 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/chart.js +81 -0
- package/lib/module/utils/chart.js.map +1 -1
- package/lib/typescript/src/components/accordion/index.d.ts +21 -0
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts +21 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button-group/index.d.ts +212 -0
- package/lib/typescript/src/components/button-group/index.d.ts.map +1 -0
- package/lib/typescript/src/components/color-picker/index.d.ts +82 -1
- package/lib/typescript/src/components/color-picker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/combobox/index.d.ts.map +1 -1
- package/lib/typescript/src/components/date-time-picker/index.d.ts +127 -0
- package/lib/typescript/src/components/date-time-picker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/fab/index.d.ts +285 -0
- package/lib/typescript/src/components/fab/index.d.ts.map +1 -0
- package/lib/typescript/src/components/grid-item/index.d.ts +292 -0
- package/lib/typescript/src/components/grid-item/index.d.ts.map +1 -0
- package/lib/typescript/src/components/{kpi-chart → kpi}/index.d.ts +65 -65
- package/lib/typescript/src/components/kpi/index.d.ts.map +1 -0
- package/lib/typescript/src/components/line-chart/index.d.ts +25 -1
- package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/markdown-editor/index.d.ts +102 -0
- package/lib/typescript/src/components/markdown-editor/index.d.ts.map +1 -0
- package/lib/typescript/src/components/markdown-editor/markdown-transforms.d.ts +76 -0
- package/lib/typescript/src/components/markdown-editor/markdown-transforms.d.ts.map +1 -0
- package/lib/typescript/src/components/pie-chart/index.d.ts +245 -0
- package/lib/typescript/src/components/pie-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/questionnaire/index.d.ts +336 -0
- package/lib/typescript/src/components/questionnaire/index.d.ts.map +1 -0
- package/lib/typescript/src/components/scatter-chart/index.d.ts +309 -0
- package/lib/typescript/src/components/scatter-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/tabs/index.d.ts +29 -2
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/time-picker/index.d.ts +19 -1
- package/lib/typescript/src/components/time-picker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tree/index.d.ts +125 -0
- package/lib/typescript/src/components/tree/index.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +22 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +14 -5
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/chart.d.ts +34 -0
- package/lib/typescript/src/utils/chart.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/accordion/index.tsx +48 -6
- package/src/components/button/index.tsx +97 -15
- package/src/components/button-group/index.tsx +199 -0
- package/src/components/color-picker/index.tsx +140 -3
- package/src/components/combobox/index.tsx +7 -1
- package/src/components/date-time-picker/index.tsx +411 -0
- package/src/components/fab/index.tsx +583 -0
- package/src/components/grid-item/index.tsx +515 -0
- package/src/components/{kpi-chart → kpi}/index.tsx +85 -85
- package/src/components/line-chart/index.tsx +98 -8
- package/src/components/markdown-editor/index.tsx +526 -0
- package/src/components/markdown-editor/markdown-transforms.ts +228 -0
- package/src/components/pie-chart/index.tsx +863 -0
- package/src/components/questionnaire/index.tsx +1615 -0
- package/src/components/scatter-chart/index.tsx +1401 -0
- package/src/components/tabs/index.tsx +392 -50
- package/src/components/time-picker/index.tsx +42 -6
- package/src/components/tree/index.tsx +564 -0
- package/src/icons/index.tsx +154 -0
- package/src/index.ts +142 -18
- package/src/utils/chart.ts +110 -0
- package/lib/module/components/kpi-chart/index.js.map +0 -1
- package/lib/typescript/src/components/kpi-chart/index.d.ts.map +0 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DateTimePicker — a day and a time of day, picked in one panel.
|
|
3
|
+
*
|
|
4
|
+
* ```tsx
|
|
5
|
+
* const [when, setWhen] = useState<Date>();
|
|
6
|
+
*
|
|
7
|
+
* <DateTimePicker value={when} onValueChange={setWhen} />
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* ## Why it is one component and not two side by side
|
|
11
|
+
*
|
|
12
|
+
* A date field beside a time field is two decisions the reader has to make
|
|
13
|
+
* separately and then hold together — and the two halves can disagree, which is
|
|
14
|
+
* how a booking ends up on the right day at a time that has already passed. Here
|
|
15
|
+
* the calendar and the scale are the same panel over one `Date`, so what is on
|
|
16
|
+
* screen is the answer rather than two thirds of it.
|
|
17
|
+
*
|
|
18
|
+
* The layout follows from that: the calendar is the coarse choice and takes the
|
|
19
|
+
* room, the time sits under it behind a hairline, and one Done finishes both.
|
|
20
|
+
* The panel is a fixed width, which is what lets the two halves line up — a
|
|
21
|
+
* month grid and a time scale that measured themselves independently would be
|
|
22
|
+
* two boxes of slightly different widths stacked on each other.
|
|
23
|
+
*
|
|
24
|
+
* ## It does not close on the date
|
|
25
|
+
*
|
|
26
|
+
* `DatePicker` closes as soon as a single day is tapped, because at that point
|
|
27
|
+
* there is nothing left to say. Here there is: the day is half the value, and
|
|
28
|
+
* closing on it would hide the other half at the moment it became relevant. So
|
|
29
|
+
* the panel stays until Done, in every presentation including the popover — the
|
|
30
|
+
* one place `DatePicker` has no Done button at all.
|
|
31
|
+
*
|
|
32
|
+
* ## The time face
|
|
33
|
+
*
|
|
34
|
+
* `ruler` by default rather than the wheel. Under a month grid the panel is
|
|
35
|
+
* already tall, and the wheel is five rows of it; the ruler is one readout over
|
|
36
|
+
* a scale, reads at arm's length, and is the one face that fits under a calendar
|
|
37
|
+
* without the whole thing needing to scroll. The other two are a prop away.
|
|
38
|
+
*
|
|
39
|
+
* ## Picking the time before the day
|
|
40
|
+
*
|
|
41
|
+
* Allowed, and it means today. There has to be *some* day for a time to be a
|
|
42
|
+
* `Date` at all, and the day the reader is looking at is the only defensible
|
|
43
|
+
* guess — the alternative is refusing to emit a value until both halves have
|
|
44
|
+
* been touched, which is a form that silently does nothing when you use it in
|
|
45
|
+
* the order it did not expect.
|
|
46
|
+
*/
|
|
47
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
48
|
+
import { type CalendarSystem } from '../../utils/date.js';
|
|
49
|
+
import { type HourCycle, type TimeValue } from '../../utils/time.js';
|
|
50
|
+
import { type CalendarCaptionLayout, type CalendarDisabled } from '../calendar/index.js';
|
|
51
|
+
import { type TimePickerLayout } from '../time-picker/index.js';
|
|
52
|
+
/** Where the panel is shown. `inline` renders it bare, for a Frame or a form. */
|
|
53
|
+
export type DateTimePickerPresentation = 'popover' | 'bottom-sheet' | 'dialog' | 'inline';
|
|
54
|
+
export interface DateTimePickerProps {
|
|
55
|
+
/** Controlled value. One `Date` carrying both halves. */
|
|
56
|
+
value?: Date;
|
|
57
|
+
/** Starting value when uncontrolled. */
|
|
58
|
+
defaultValue?: Date;
|
|
59
|
+
/**
|
|
60
|
+
* Fires on every change to either half, not on Done. Done closes the panel;
|
|
61
|
+
* it does not decide anything the caller has not already been told.
|
|
62
|
+
*/
|
|
63
|
+
onValueChange?: (value: Date) => void;
|
|
64
|
+
/** Which face the time is picked on. `ruler` is the one that fits here. */
|
|
65
|
+
layout?: TimePickerLayout;
|
|
66
|
+
/** Anchored panel, a sheet, a dialog, or the panel with nothing around it. */
|
|
67
|
+
presentation?: DateTimePickerPresentation;
|
|
68
|
+
/** Controlled open state of the panel. */
|
|
69
|
+
open?: boolean;
|
|
70
|
+
onOpenChange?: (open: boolean) => void;
|
|
71
|
+
/** `12` shows a meridiem, `24` does not. The value is 24-hour either way. */
|
|
72
|
+
hourCycle?: HourCycle;
|
|
73
|
+
/** Minutes between one selectable time and the next. */
|
|
74
|
+
minuteStep?: number;
|
|
75
|
+
/** Earliest selectable time of day, inclusive. */
|
|
76
|
+
minTime?: TimeValue;
|
|
77
|
+
/** Latest selectable time of day, inclusive. */
|
|
78
|
+
maxTime?: TimeValue;
|
|
79
|
+
/** What the trigger reads when nothing has been chosen. */
|
|
80
|
+
placeholder?: string;
|
|
81
|
+
/** Override how the chosen value is written on the trigger. */
|
|
82
|
+
format?: (value: Date) => string;
|
|
83
|
+
/** Stop the trigger opening it, and the panel from being used. */
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
/** Days that cannot be picked: a list, a span, or a rule. */
|
|
86
|
+
disabledDates?: CalendarDisabled;
|
|
87
|
+
/** Earliest selectable day. */
|
|
88
|
+
minDate?: Date;
|
|
89
|
+
/** Latest selectable day. */
|
|
90
|
+
maxDate?: Date;
|
|
91
|
+
/** `dropdown` swaps the month caption for month and year pickers. */
|
|
92
|
+
captionLayout?: CalendarCaptionLayout;
|
|
93
|
+
/** `0` is Sunday. */
|
|
94
|
+
weekStartsOn?: number;
|
|
95
|
+
/** BCP 47 tag for the month names, the time and the trigger's own text. */
|
|
96
|
+
locale?: string;
|
|
97
|
+
/** Which calendar the months and day numbers are counted in. */
|
|
98
|
+
calendar?: CalendarSystem;
|
|
99
|
+
/** Label on the button that closes the panel. */
|
|
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;
|
|
107
|
+
className?: string;
|
|
108
|
+
/**
|
|
109
|
+
* A trigger of your own. Given one, it is cloned with an `onPress` that opens
|
|
110
|
+
* the panel — so a field row or an icon button can stand in for the default
|
|
111
|
+
* button without this component knowing what either looks like.
|
|
112
|
+
*
|
|
113
|
+
* Ignored by `presentation="inline"`, which has no trigger.
|
|
114
|
+
*/
|
|
115
|
+
children?: ReactElement<{
|
|
116
|
+
onPress?: () => void;
|
|
117
|
+
}> | ReactNode;
|
|
118
|
+
}
|
|
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;
|
|
120
|
+
declare namespace DateTimePickerRoot {
|
|
121
|
+
var displayName: string;
|
|
122
|
+
}
|
|
123
|
+
export declare const DateTimePicker: typeof DateTimePickerRoot & {
|
|
124
|
+
Trigger: ({ children }: import("../popover/index.js").PopoverTriggerProps) => import("react").JSX.Element;
|
|
125
|
+
};
|
|
126
|
+
export {};
|
|
127
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/date-time-picker/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAsC,KAAK,cAAc,EAAE,MAAM,qBAAkB,CAAC;AAC3F,OAAO,EAML,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,qBAAkB,CAAC;AAE1B,OAAO,EAAY,KAAK,qBAAqB,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAa,CAAC;AAG1F,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,yBAAgB,CAAC;AA2BnE,iFAAiF;AACjF,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE1F,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,wCAAwC;IACxC,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC,2EAA2E;IAC3E,MAAM,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S,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,SAAkB,EAClB,SAAS,EACT,QAAQ,GACT,EAAE,mBAAmB,+BAsNrB;kBAhPQ,kBAAkB;;;AAmP3B,eAAO,MAAM,cAAc;;CAEzB,CAAC"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fab — the floating action button: one screen, one thing it is mostly for.
|
|
3
|
+
*
|
|
4
|
+
* ```tsx
|
|
5
|
+
* <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":["../../../../../src/components/fab/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAyB,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAQ3E,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAU1D,uCAAuC;AACvC,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,eAAe,GAAG,aAAa,CAAC;AAe5E,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAyCf,CAAC;AAEH,KAAK,eAAe,GAAG,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AAExD,6BAA6B;AAC7B,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3D,mCAAmC;AACnC,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;AAqBjE,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,eAAe;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO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