panelui-native 0.38.0 → 0.41.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 +3 -1
- package/lib/module/components/card/index.js +172 -3
- package/lib/module/components/card/index.js.map +1 -1
- package/lib/module/components/drawer/index.js +13 -4
- package/lib/module/components/drawer/index.js.map +1 -1
- package/lib/module/components/heatmap-chart/index.js +113 -6
- package/lib/module/components/heatmap-chart/index.js.map +1 -1
- package/lib/module/components/map/index.js +72 -12
- package/lib/module/components/map/index.js.map +1 -1
- package/lib/module/components/pagination/index.js +529 -0
- package/lib/module/components/pagination/index.js.map +1 -0
- package/lib/module/components/panelside/index.js +68 -18
- package/lib/module/components/panelside/index.js.map +1 -1
- package/lib/module/components/ring-chart/index.js +183 -45
- package/lib/module/components/ring-chart/index.js.map +1 -1
- package/lib/module/components/steps/index.js +8 -6
- package/lib/module/components/steps/index.js.map +1 -1
- package/lib/module/components/table/index.js +100 -26
- package/lib/module/components/table/index.js.map +1 -1
- package/lib/module/components/text-animation/index.js +857 -0
- package/lib/module/components/text-animation/index.js.map +1 -0
- package/lib/module/components/timeline/index.js +8 -7
- package/lib/module/components/timeline/index.js.map +1 -1
- package/lib/module/icons/index.js +25 -7
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/card/index.d.ts +20 -0
- package/lib/typescript/src/components/card/index.d.ts.map +1 -1
- package/lib/typescript/src/components/drawer/index.d.ts +13 -1
- package/lib/typescript/src/components/drawer/index.d.ts.map +1 -1
- package/lib/typescript/src/components/heatmap-chart/index.d.ts +51 -3
- package/lib/typescript/src/components/heatmap-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/index.d.ts +37 -2
- package/lib/typescript/src/components/map/index.d.ts.map +1 -1
- package/lib/typescript/src/components/pagination/index.d.ts +285 -0
- package/lib/typescript/src/components/pagination/index.d.ts.map +1 -0
- package/lib/typescript/src/components/panelside/index.d.ts +50 -4
- package/lib/typescript/src/components/panelside/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ring-chart/index.d.ts +75 -8
- package/lib/typescript/src/components/ring-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/steps/index.d.ts +8 -6
- package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
- package/lib/typescript/src/components/table/index.d.ts +59 -17
- package/lib/typescript/src/components/table/index.d.ts.map +1 -1
- package/lib/typescript/src/components/text-animation/index.d.ts +268 -0
- package/lib/typescript/src/components/text-animation/index.d.ts.map +1 -0
- package/lib/typescript/src/components/timeline/index.d.ts +8 -7
- package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
- package/lib/typescript/src/icons/index.d.ts +6 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +6 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/card/index.tsx +227 -2
- package/src/components/drawer/index.tsx +31 -9
- package/src/components/heatmap-chart/index.tsx +147 -5
- package/src/components/map/index.tsx +158 -14
- package/src/components/pagination/index.tsx +603 -0
- package/src/components/panelside/index.tsx +134 -19
- package/src/components/ring-chart/index.tsx +269 -47
- package/src/components/steps/index.tsx +8 -6
- package/src/components/table/index.tsx +146 -30
- package/src/components/text-animation/index.tsx +1093 -0
- package/src/components/timeline/index.tsx +8 -7
- package/src/icons/index.tsx +23 -4
- package/src/index.ts +28 -1
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* ```tsx
|
|
5
5
|
* <RingChart data={goals}>
|
|
6
|
+
* <RingChart.Header title="Today" value="486 kcal" legend />
|
|
6
7
|
* <RingChart.Ring index={0} />
|
|
7
8
|
* <RingChart.Ring index={1} />
|
|
8
9
|
* <RingChart.Center />
|
|
9
|
-
* <RingChart.Legend />
|
|
10
10
|
* </RingChart>
|
|
11
11
|
* ```
|
|
12
12
|
*
|
|
@@ -25,11 +25,15 @@
|
|
|
25
25
|
*
|
|
26
26
|
* ## Drawing
|
|
27
27
|
*
|
|
28
|
-
* Each ring is two arcs — a
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
28
|
+
* Each ring is two arcs — a track and the progress over it — with only the
|
|
29
|
+
* progress animated, through `strokeDasharray`. Sweeping the arc by rebuilding
|
|
30
|
+
* its path would work, but a dash offset is two numbers moving on an unchanged
|
|
31
|
+
* path, and it keeps the rounded cap pinned to the moving end for free.
|
|
32
|
+
*
|
|
33
|
+
* The same dash pattern is what makes the other two shapes possible without any
|
|
34
|
+
* more geometry. An open gauge is the pattern cut short of the circumference
|
|
35
|
+
* and the whole circle turned to put the gap where it is wanted; a segmented
|
|
36
|
+
* ring is the pattern repeated, one pair per tick. Both stay one `Circle`.
|
|
33
37
|
*
|
|
34
38
|
* Touch, not hover: a ring is selected by pressing it, and pressing the same
|
|
35
39
|
* one again clears the selection. There is no equivalent of a pointer resting
|
|
@@ -65,6 +69,17 @@ export interface RingChartProps extends ViewProps {
|
|
|
65
69
|
strokeWidth?: number;
|
|
66
70
|
/** Gap between one ring and the next. */
|
|
67
71
|
ringGap?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Where the arcs begin, in degrees clockwise from twelve o'clock. `0` is the
|
|
74
|
+
* top, `90` the right-hand side.
|
|
75
|
+
*/
|
|
76
|
+
startAngle?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Where they end, on the same clock. Leaving a turn's worth between the two
|
|
79
|
+
* gives a closed ring; anything less leaves a gap and reads as a gauge —
|
|
80
|
+
* `startAngle={-90} endAngle={90}` is the half circle over the top.
|
|
81
|
+
*/
|
|
82
|
+
endAngle?: number;
|
|
68
83
|
/** Milliseconds for the arcs to sweep in. */
|
|
69
84
|
animationDuration?: number;
|
|
70
85
|
/** Selected ring. Leave unset to let the chart track it. */
|
|
@@ -84,10 +99,23 @@ export interface RingChartRingProps {
|
|
|
84
99
|
color?: string;
|
|
85
100
|
/** Which of the five chart tokens to take, when the datum names no colour. */
|
|
86
101
|
colorIndex?: SeriesColorIndex;
|
|
87
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* Rounded ends, or square ones. Defaults to round, and to square when the
|
|
104
|
+
* ring is segmented — a rounded cap on a tick as long as it is wide draws a
|
|
105
|
+
* lozenge rather than a tick.
|
|
106
|
+
*/
|
|
88
107
|
lineCap?: 'round' | 'butt';
|
|
89
108
|
/** Opacity of the track behind the arc. */
|
|
90
109
|
trackOpacity?: number;
|
|
110
|
+
/**
|
|
111
|
+
* Break the ring into this many ticks, lit one at a time as the value
|
|
112
|
+
* climbs. For a target made of countable things — eight of twelve sessions
|
|
113
|
+
* reads off ticks you can count, and off a smooth arc only as "about two
|
|
114
|
+
* thirds".
|
|
115
|
+
*/
|
|
116
|
+
segments?: number;
|
|
117
|
+
/** Gap between one tick and the next, in points. */
|
|
118
|
+
segmentGap?: number;
|
|
91
119
|
}
|
|
92
120
|
/**
|
|
93
121
|
* One ring: a full-circle track, and the arc showing how far along it the
|
|
@@ -98,7 +126,7 @@ export interface RingChartRingProps {
|
|
|
98
126
|
* — and it keeps the rounded cap pinned to the moving end without any extra
|
|
99
127
|
* geometry.
|
|
100
128
|
*/
|
|
101
|
-
declare function RingChartRing({ index, color, colorIndex, lineCap, trackOpacity, }: RingChartRingProps): import("react").JSX.Element | null;
|
|
129
|
+
declare function RingChartRing({ index, color, colorIndex, lineCap, trackOpacity, segments, segmentGap, }: RingChartRingProps): import("react").JSX.Element | null;
|
|
102
130
|
declare namespace RingChartRing {
|
|
103
131
|
var displayName: string;
|
|
104
132
|
var slot: "ring";
|
|
@@ -147,7 +175,46 @@ declare namespace RingChartLegend {
|
|
|
147
175
|
var displayName: string;
|
|
148
176
|
var slot: "overlay";
|
|
149
177
|
}
|
|
178
|
+
export interface RingChartHeaderProps extends ViewProps {
|
|
179
|
+
className?: string;
|
|
180
|
+
/** Small line above the value — what the chart is of. */
|
|
181
|
+
title?: string;
|
|
182
|
+
/** The readout. The largest thing on the card, and the first thing read. */
|
|
183
|
+
value?: string;
|
|
184
|
+
/** One muted line under the value — a period, a comparison, a target. */
|
|
185
|
+
caption?: string;
|
|
186
|
+
/** Prettier names for the rings, keyed by their `label`. */
|
|
187
|
+
labels?: Record<string, string>;
|
|
188
|
+
/**
|
|
189
|
+
* Draw a swatch and a name per ring along the trailing edge. Prefer this to
|
|
190
|
+
* `RingChart.Legend` on a chart that has a header: that legend hangs off the
|
|
191
|
+
* bottom of the square, where it overlaps whatever is under the chart.
|
|
192
|
+
*/
|
|
193
|
+
legend?: boolean;
|
|
194
|
+
/** Trailing slot — a control, a badge, a range picker. Wins over `legend`. */
|
|
195
|
+
children?: ReactNode;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* The strip above the rings: what the chart is of, what it currently reads, and
|
|
199
|
+
* what the colours mean.
|
|
200
|
+
*
|
|
201
|
+
* It belongs to the chart rather than to the card around it because it is about
|
|
202
|
+
* the *rings* — the number changes as one is selected, and the legend is the
|
|
203
|
+
* list the chart itself is holding. The card's header is a caption on the tray
|
|
204
|
+
* the chart sits in; this is the chart introducing itself.
|
|
205
|
+
*
|
|
206
|
+
* The value is not derived here. There is no total to derive: the rings measure
|
|
207
|
+
* different things against different targets. Take it from `onActiveIndexChange`
|
|
208
|
+
* and pass the formatted string down, so one header can show the headline figure
|
|
209
|
+
* when nothing is selected and a ring's own when something is.
|
|
210
|
+
*/
|
|
211
|
+
declare function RingChartHeader({ className, title, value, caption, labels, legend, children, ...props }: RingChartHeaderProps): import("react").JSX.Element;
|
|
212
|
+
declare namespace RingChartHeader {
|
|
213
|
+
var displayName: string;
|
|
214
|
+
var slot: "header";
|
|
215
|
+
}
|
|
150
216
|
export declare const RingChart: import("react").ForwardRefExoticComponent<RingChartProps & import("react").RefAttributes<RingChartHandle>> & {
|
|
217
|
+
Header: typeof RingChartHeader;
|
|
151
218
|
Ring: typeof RingChartRing;
|
|
152
219
|
Center: typeof RingChartCenter;
|
|
153
220
|
Legend: typeof RingChartLegend;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ring-chart/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ring-chart/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAWvF,OAAO,EAAiC,KAAK,gBAAgB,EAAE,MAAM,sBAAmB,CAAC;AAWzF,sEAAsE;AACtE,MAAM,WAAW,SAAS;IACxB,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA6BD,kEAAkE;AAClE,wBAAgB,YAAY;;;EAM3B;AAED,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2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,eAAe;;;;AA4DxB,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,SAAgB,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,sCA6CvF;kBA7CQ,eAAe;;;;AAiDxB,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,KAAK,EACL,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,+BAoDtB;kBA7DQ,eAAe;;;;AAiExB,eAAO,MAAM,SAAS;;;;;CAKpB,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Steps — a stepper for multi-step flows.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* A row or column of numbered stops, each one completed, active, inactive or
|
|
5
|
+
* loading. An item works that state out from its own position against the
|
|
6
|
+
* root's `value` rather than being told it, so the four states stay mutually
|
|
7
|
+
* exclusive and in order — there is no way to write two active steps, or to
|
|
8
|
+
* mark step four done while step three is still pending.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* The state is resolved in JS and passed down through context into `tv()`
|
|
11
|
+
* variants, because React Native has no attribute selectors a stylesheet could
|
|
12
|
+
* key off. Alert and Timeline resolve their states the same way.
|
|
11
13
|
*
|
|
12
14
|
* Steps does not own your flow: it reflects whatever step your app says is
|
|
13
15
|
* active. Pass `value` to control it, or `defaultValue` to let it manage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/steps/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/steps/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,IAAI,EAAE,KAAK,IAAI,IAAI,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpF,OAAO,EAAQ,KAAK,SAAS,EAAgB,MAAM,0BAAuB,CAAC;AAG3E,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AACxE,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,UAAU,CAAC;AAuFzD,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA6CD,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAqCD,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA0BD,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAoDD,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA4BD,eAAO,MAAM,KAAK;;;;;;;CAOhB,CAAC"}
|
|
@@ -4,28 +4,37 @@
|
|
|
4
4
|
* React Native has no table layout: no `<table>`, no column model, nothing that
|
|
5
5
|
* makes the third cell of one row the same width as the third cell of the next.
|
|
6
6
|
* A table here is therefore a stack of flex rows, and the columns exist only
|
|
7
|
-
* because every row divides its width the same way.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* because every row divides its width the same way.
|
|
8
|
+
*
|
|
9
|
+
* `columns` is the column model that closes that gap. Give the root one entry
|
|
10
|
+
* per column and every `Table.Head` and `Table.Cell` takes its `flex`, `width`
|
|
11
|
+
* and `align` from the entry at its own position in the row — so a column is
|
|
12
|
+
* described once, at the top, and a row is just its contents. Without it the
|
|
13
|
+
* sizing has to be repeated on every head and every cell, and the column drifts
|
|
14
|
+
* the moment two of them disagree.
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Table columns={[{ flex: 2 }, { align: 'end' }]}>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Props set on a head or a cell still win, for the one row that has to differ.
|
|
10
21
|
*
|
|
11
22
|
* Everything else it does own: the hairlines between rows and the missing one
|
|
12
23
|
* under the last, the muted header and footer, the striping, the alignment of a
|
|
13
24
|
* numeric column, and the sort arrow that turns over rather than swapping.
|
|
14
25
|
*
|
|
15
26
|
* ```tsx
|
|
16
|
-
* <Table variant="outline">
|
|
27
|
+
* <Table variant="outline" columns={[{ flex: 2 }, { align: 'end' }]}>
|
|
17
28
|
* <Table.Header>
|
|
18
29
|
* <Table.Row>
|
|
19
|
-
* <Table.Head
|
|
20
|
-
* <Table.Head
|
|
21
|
-
* Amount
|
|
22
|
-
* </Table.Head>
|
|
30
|
+
* <Table.Head>Invoice</Table.Head>
|
|
31
|
+
* <Table.Head sortDirection="desc" onPress={toggleSort}>Amount</Table.Head>
|
|
23
32
|
* </Table.Row>
|
|
24
33
|
* </Table.Header>
|
|
25
34
|
* <Table.Body>
|
|
26
35
|
* <Table.Row>
|
|
27
|
-
* <Table.Cell
|
|
28
|
-
* <Table.Cell
|
|
36
|
+
* <Table.Cell>INV-001</Table.Cell>
|
|
37
|
+
* <Table.Cell>$250.00</Table.Cell>
|
|
29
38
|
* </Table.Row>
|
|
30
39
|
* </Table.Body>
|
|
31
40
|
* </Table>
|
|
@@ -145,6 +154,23 @@ declare const tableVariants: import("tailwind-variants").TVReturnType<{
|
|
|
145
154
|
cellLabel: string;
|
|
146
155
|
caption: string;
|
|
147
156
|
}, undefined, unknown, unknown, undefined>>;
|
|
157
|
+
export interface TableColumn {
|
|
158
|
+
/**
|
|
159
|
+
* Share of the leftover width, relative to the other columns. Defaults to 1,
|
|
160
|
+
* so columns divide the row evenly.
|
|
161
|
+
*/
|
|
162
|
+
flex?: number;
|
|
163
|
+
/**
|
|
164
|
+
* Fixed width in pixels, for a column that must not move — an icon, a state
|
|
165
|
+
* dot. Wins over `flex`.
|
|
166
|
+
*/
|
|
167
|
+
width?: number;
|
|
168
|
+
/**
|
|
169
|
+
* Which edge the column's content sits against. Use `end` for numbers: a
|
|
170
|
+
* money column reads as a column only when the digits line up.
|
|
171
|
+
*/
|
|
172
|
+
align?: CellAlign;
|
|
173
|
+
}
|
|
148
174
|
export interface TableProps extends ViewProps, VariantProps<typeof tableVariants> {
|
|
149
175
|
className?: string;
|
|
150
176
|
/**
|
|
@@ -157,6 +183,15 @@ export interface TableProps extends ViewProps, VariantProps<typeof tableVariants
|
|
|
157
183
|
* for a short table, where the stripes are louder than the data.
|
|
158
184
|
*/
|
|
159
185
|
striped?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* The column model: one entry per column, in order. Every `Table.Head` and
|
|
188
|
+
* `Table.Cell` takes its `flex`, `width` and `align` from the entry at its
|
|
189
|
+
* own position in the row, so a column is described once instead of on every
|
|
190
|
+
* row. Anything set on a head or a cell still wins.
|
|
191
|
+
*
|
|
192
|
+
* Declare it outside render — a new array each frame renumbers every cell.
|
|
193
|
+
*/
|
|
194
|
+
columns?: TableColumn[];
|
|
160
195
|
children?: ReactNode;
|
|
161
196
|
}
|
|
162
197
|
export interface TableHeaderProps extends ViewProps {
|
|
@@ -193,13 +228,14 @@ export interface TableHeadProps extends Omit<ViewProps, 'children'> {
|
|
|
193
228
|
className?: string;
|
|
194
229
|
/**
|
|
195
230
|
* Share of the leftover width, relative to the other cells in the row.
|
|
196
|
-
* Defaults to 1, so columns divide the row evenly.
|
|
197
|
-
* the cells beneath it.
|
|
231
|
+
* Defaults to 1, so columns divide the row evenly. Without a `columns` model
|
|
232
|
+
* on the root it must match the `flex` on the cells beneath it.
|
|
198
233
|
*/
|
|
199
234
|
flex?: number;
|
|
200
235
|
/**
|
|
201
236
|
* Fixed width in pixels, for a column that must not move — an icon, a state
|
|
202
|
-
* dot.
|
|
237
|
+
* dot. Without a `columns` model on the root it must match the `width` on the
|
|
238
|
+
* cells beneath it.
|
|
203
239
|
*/
|
|
204
240
|
width?: number;
|
|
205
241
|
/**
|
|
@@ -224,15 +260,19 @@ export interface TableCellProps extends ViewProps {
|
|
|
224
260
|
className?: string;
|
|
225
261
|
/**
|
|
226
262
|
* Share of the leftover width, relative to the other cells in the row.
|
|
227
|
-
* Defaults to 1.
|
|
263
|
+
* Defaults to 1. Without a `columns` model on the root it must match the
|
|
264
|
+
* `flex` on the head above it.
|
|
228
265
|
*/
|
|
229
266
|
flex?: number;
|
|
230
267
|
/**
|
|
231
|
-
* Fixed width in pixels, for a column that must not move.
|
|
232
|
-
* `width` on the head above it.
|
|
268
|
+
* Fixed width in pixels, for a column that must not move. Without a `columns`
|
|
269
|
+
* model on the root it must match the `width` on the head above it.
|
|
233
270
|
*/
|
|
234
271
|
width?: number;
|
|
235
|
-
/**
|
|
272
|
+
/**
|
|
273
|
+
* Which edge the cell's content sits against. Without a `columns` model on
|
|
274
|
+
* the root, match the head above it.
|
|
275
|
+
*/
|
|
236
276
|
align?: CellAlign;
|
|
237
277
|
/** Styles the cell's text. */
|
|
238
278
|
labelClassName?: string;
|
|
@@ -257,6 +297,8 @@ export interface TableFrameProps extends Omit<ViewProps, 'children'> {
|
|
|
257
297
|
size?: TableSize;
|
|
258
298
|
/** Tint every other body row, as on `Table`. */
|
|
259
299
|
striped?: boolean;
|
|
300
|
+
/** The column model, as on `Table`. */
|
|
301
|
+
columns?: TableColumn[];
|
|
260
302
|
children?: ReactNode;
|
|
261
303
|
}
|
|
262
304
|
export declare const Table: import("react").ForwardRefExoticComponent<TableProps & import("react").RefAttributes<View>> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,OAAO,EAUL,KAAK,SAAS,EACf,MAA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IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA8CD,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiBD,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA4BD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kEAAkE;IAClE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,kCAAkC;IAClC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAmGD,eAAO,MAAM,KAAK;;;;;;;;;;CAUhB,CAAC"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextAnimation — the five ways a piece of text arrives.
|
|
3
|
+
*
|
|
4
|
+
* ```tsx
|
|
5
|
+
* <TextAnimation.Typing text="Everything ships with its accessibility done" />
|
|
6
|
+
* <TextAnimation.Rotating text={['fast', 'native', 'yours']} />
|
|
7
|
+
* <TextAnimation.Counting value={2048} />
|
|
8
|
+
* <TextAnimation.Sliding value={price} decimals={2} />
|
|
9
|
+
* <TextAnimation.Scrolling value={120} step={10} />
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* ## Why one component with five parts
|
|
13
|
+
*
|
|
14
|
+
* They are one idea — a value that changes and wants to be seen changing —
|
|
15
|
+
* and they share every prop that says *how*: `duration`, `delay`, `loop`,
|
|
16
|
+
* `enabled`. Put on the `TextAnimation` root, those become the defaults for
|
|
17
|
+
* everything inside it, so a hero with three of these in it is configured once
|
|
18
|
+
* rather than three times.
|
|
19
|
+
*
|
|
20
|
+
* ## What React Native forces
|
|
21
|
+
*
|
|
22
|
+
* Nested `Text` is the only thing that gets real line-breaking, and it cannot
|
|
23
|
+
* be transformed — a `translateY` on it is ignored. So the two parts that
|
|
24
|
+
* animate a whole string, `Typing` and `Counting`, stay real text and keep
|
|
25
|
+
* wrapping; the three that slide glyphs past each other lay out as rows of
|
|
26
|
+
* views, which buys the transform and costs line-breaking. None of the three
|
|
27
|
+
* is ever a paragraph, so the trade only ever falls the right way.
|
|
28
|
+
*
|
|
29
|
+
* ## Why the digits are drawn rather than measured
|
|
30
|
+
*
|
|
31
|
+
* A number animated as React state is a re-render per frame. `Counting` runs
|
|
32
|
+
* the value on the UI thread and only crosses back when the *rounded* number
|
|
33
|
+
* changes, which for a whole number is a couple of dozen times rather than
|
|
34
|
+
* sixty a second. The sliding and scrolling parts do not cross back at all:
|
|
35
|
+
* every digit is already rendered, and the animation is a transform on a
|
|
36
|
+
* column of them.
|
|
37
|
+
*/
|
|
38
|
+
import { type ReactNode } from 'react';
|
|
39
|
+
import { type ViewProps } from 'react-native';
|
|
40
|
+
import { type TextProps } from '../../primitives/text.js';
|
|
41
|
+
export interface TextAnimationProps extends ViewProps {
|
|
42
|
+
className?: string;
|
|
43
|
+
/**
|
|
44
|
+
* How long one pass takes, in milliseconds. What that measures depends on
|
|
45
|
+
* the part: a keystroke for `Typing`, a phrase's turn on screen for
|
|
46
|
+
* `Rotating`, the whole journey for the three that count.
|
|
47
|
+
*/
|
|
48
|
+
duration?: number;
|
|
49
|
+
/** How long to wait before starting, in milliseconds. */
|
|
50
|
+
delay?: number;
|
|
51
|
+
/** Start again from the beginning when the run finishes. */
|
|
52
|
+
loop?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Animate at all. `false` draws the finished text or the final number
|
|
55
|
+
* immediately, which is also what a reduced-motion setting does.
|
|
56
|
+
*/
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
children?: ReactNode;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Shared configuration, and a row to lay the parts out in.
|
|
62
|
+
*
|
|
63
|
+
* Optional in every case — each part works standalone with its own props, and
|
|
64
|
+
* this is only here so a line with three of them in it says `duration` once.
|
|
65
|
+
*/
|
|
66
|
+
declare function TextAnimationRoot({ className, duration, delay, loop, enabled, children, ...props }: TextAnimationProps): import("react").JSX.Element;
|
|
67
|
+
declare namespace TextAnimationRoot {
|
|
68
|
+
var displayName: string;
|
|
69
|
+
}
|
|
70
|
+
export interface TextAnimationTypingProps extends Omit<TextProps, 'children'> {
|
|
71
|
+
className?: string;
|
|
72
|
+
/**
|
|
73
|
+
* What to type. An array is typed, held, erased and replaced by the next,
|
|
74
|
+
* which is the shape a rotating headline wants.
|
|
75
|
+
*/
|
|
76
|
+
text: string | string[];
|
|
77
|
+
/** Milliseconds per keystroke. */
|
|
78
|
+
duration?: number;
|
|
79
|
+
/** Milliseconds before the first keystroke. */
|
|
80
|
+
delay?: number;
|
|
81
|
+
/** How long a finished string sits before it is erased, in milliseconds. */
|
|
82
|
+
hold?: number;
|
|
83
|
+
/** Start again after the last string. Only means anything for an array. */
|
|
84
|
+
loop?: boolean;
|
|
85
|
+
/** Draw a blinking caret after the text. */
|
|
86
|
+
caret?: boolean;
|
|
87
|
+
/** Styles the caret. */
|
|
88
|
+
caretClassName?: string;
|
|
89
|
+
/** Called once the last string has finished being typed. */
|
|
90
|
+
onDone?: () => void;
|
|
91
|
+
enabled?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A string arriving one character at a time.
|
|
95
|
+
*
|
|
96
|
+
* The text is React state rather than anything on the UI thread, and it has
|
|
97
|
+
* to be: a character is a different string, and a string is a re-render
|
|
98
|
+
* whichever thread decided on it. That is fine at a keystroke every 50-odd
|
|
99
|
+
* milliseconds, which is three orders of magnitude slower than a frame.
|
|
100
|
+
*
|
|
101
|
+
* It reserves no space. A line that grows as it types pushes whatever is under
|
|
102
|
+
* it down the screen on every keystroke, so give the container a height, or
|
|
103
|
+
* type into a block that has one already.
|
|
104
|
+
*/
|
|
105
|
+
declare function TextAnimationTyping({ className, text, duration, delay, hold, loop, caret, caretClassName, onDone, enabled, ...props }: TextAnimationTypingProps): import("react").JSX.Element;
|
|
106
|
+
declare namespace TextAnimationTyping {
|
|
107
|
+
var displayName: string;
|
|
108
|
+
}
|
|
109
|
+
export interface TextAnimationRotatingProps extends Omit<TextProps, 'children'> {
|
|
110
|
+
className?: string;
|
|
111
|
+
/** The phrases to cycle. One string never rotates, which is a valid state. */
|
|
112
|
+
text: string | string[];
|
|
113
|
+
/** How long each phrase holds, in milliseconds. */
|
|
114
|
+
duration?: number;
|
|
115
|
+
/** Milliseconds before the first change. */
|
|
116
|
+
delay?: number;
|
|
117
|
+
enabled?: boolean;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* One phrase replaced by the next, the outgoing one leaving upward and the
|
|
121
|
+
* incoming one arriving from below.
|
|
122
|
+
*
|
|
123
|
+
* The box is sized by the longest phrase and not by the current one. A box
|
|
124
|
+
* that resizes as the words change makes the line around it jump, which is
|
|
125
|
+
* more distracting than the effect is interesting — and a box sized by the
|
|
126
|
+
* *first* phrase clips every longer one that follows, which is worse than
|
|
127
|
+
* either.
|
|
128
|
+
*
|
|
129
|
+
* So the width comes from a sizer: every phrase, laid out invisibly in a view
|
|
130
|
+
* with no height. Yoga still takes a column's width from its children when
|
|
131
|
+
* their height is fixed at zero, so the box ends up as wide as the longest
|
|
132
|
+
* phrase and as tall as one line of them.
|
|
133
|
+
*/
|
|
134
|
+
declare function TextAnimationRotating({ className, text, duration, delay, enabled, ...props }: TextAnimationRotatingProps): import("react").JSX.Element;
|
|
135
|
+
declare namespace TextAnimationRotating {
|
|
136
|
+
var displayName: string;
|
|
137
|
+
}
|
|
138
|
+
export interface TextAnimationCountingProps extends Omit<TextProps, 'children'> {
|
|
139
|
+
className?: string;
|
|
140
|
+
/** Where the number ends up. */
|
|
141
|
+
value: number;
|
|
142
|
+
/** Where it starts from. Defaults to zero. */
|
|
143
|
+
from?: number;
|
|
144
|
+
/** How long the whole journey takes, in milliseconds. */
|
|
145
|
+
duration?: number;
|
|
146
|
+
/** Milliseconds before it starts. */
|
|
147
|
+
delay?: number;
|
|
148
|
+
/** Digits after the point. */
|
|
149
|
+
decimals?: number;
|
|
150
|
+
/**
|
|
151
|
+
* Formatting for the number, as `Intl.NumberFormat` options — a currency, a
|
|
152
|
+
* percentage, grouped thousands. Falls back to a plain fixed-point string on
|
|
153
|
+
* an engine whose `Intl` cannot do it.
|
|
154
|
+
*/
|
|
155
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
156
|
+
enabled?: boolean;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* A number counting up to itself.
|
|
160
|
+
*
|
|
161
|
+
* The text is rewritten from a Reanimated reaction rather than from state:
|
|
162
|
+
* sixty re-renders a second for a number that is only ever a string is the
|
|
163
|
+
* kind of thing that makes an otherwise still screen drop frames. Only the
|
|
164
|
+
* rounded value crosses back to JavaScript, so the work per frame is one
|
|
165
|
+
* comparison and, at most, one `setState` on a value that actually changed.
|
|
166
|
+
*/
|
|
167
|
+
declare function TextAnimationCounting({ className, value, from, duration, delay, decimals, formatOptions, enabled, ...props }: TextAnimationCountingProps): import("react").JSX.Element;
|
|
168
|
+
declare namespace TextAnimationCounting {
|
|
169
|
+
var displayName: string;
|
|
170
|
+
}
|
|
171
|
+
export interface TextAnimationSlidingProps extends ViewProps {
|
|
172
|
+
className?: string;
|
|
173
|
+
/** The number to show. Each digit rolls to its new value independently. */
|
|
174
|
+
value: number;
|
|
175
|
+
/** Digits after the point. */
|
|
176
|
+
decimals?: number;
|
|
177
|
+
/** Pad the whole part to this many digits with leading zeroes. */
|
|
178
|
+
padStart?: number;
|
|
179
|
+
/** A separator every three digits — `','` for `1,024`. */
|
|
180
|
+
thousandSeparator?: string;
|
|
181
|
+
/** The decimal mark. */
|
|
182
|
+
decimalSeparator?: string;
|
|
183
|
+
/** Styles the digits. */
|
|
184
|
+
textClassName?: string;
|
|
185
|
+
/** Size of the digits, as on `Text`. */
|
|
186
|
+
size?: TextProps['size'];
|
|
187
|
+
/** Weight of the digits, as on `Text`. */
|
|
188
|
+
weight?: TextProps['weight'];
|
|
189
|
+
/** Milliseconds before the roll starts. */
|
|
190
|
+
delay?: number;
|
|
191
|
+
enabled?: boolean;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* An odometer: every digit is a column of ten, and each column rolls to the
|
|
195
|
+
* one it should be showing.
|
|
196
|
+
*
|
|
197
|
+
* Nothing here is measured at runtime. A column is ten stacked digits and the
|
|
198
|
+
* whole thing is moved by a fraction of its own height, so the roll needs no
|
|
199
|
+
* `onLayout`, no first frame at the wrong offset, and no re-render per digit
|
|
200
|
+
* per frame. The height comes from one hidden `0` in flow, which is what makes
|
|
201
|
+
* the column as tall as the font is rather than as tall as a number happens to
|
|
202
|
+
* be.
|
|
203
|
+
*/
|
|
204
|
+
declare function TextAnimationSliding({ className, value, decimals, padStart, thousandSeparator, decimalSeparator, textClassName, size, weight, delay, enabled, ...props }: TextAnimationSlidingProps): import("react").JSX.Element;
|
|
205
|
+
declare namespace TextAnimationSliding {
|
|
206
|
+
var displayName: string;
|
|
207
|
+
}
|
|
208
|
+
export interface TextAnimationScrollingProps extends ViewProps {
|
|
209
|
+
className?: string;
|
|
210
|
+
/** The value to land on. */
|
|
211
|
+
value: number;
|
|
212
|
+
/** The gap between the values either side of it. */
|
|
213
|
+
step?: number;
|
|
214
|
+
/** How many values to show above and below the one in the window. */
|
|
215
|
+
around?: number;
|
|
216
|
+
/** How long the run takes, in milliseconds. */
|
|
217
|
+
duration?: number;
|
|
218
|
+
/** Milliseconds before it starts. */
|
|
219
|
+
delay?: number;
|
|
220
|
+
/** Formatting for each value, as `Intl.NumberFormat` options. */
|
|
221
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
222
|
+
/** Styles the values. */
|
|
223
|
+
textClassName?: string;
|
|
224
|
+
/** Size of the values, as on `Text`. */
|
|
225
|
+
size?: TextProps['size'];
|
|
226
|
+
/** Weight of the values, as on `Text`. */
|
|
227
|
+
weight?: TextProps['weight'];
|
|
228
|
+
/**
|
|
229
|
+
* Draw a band behind the value in the window, so the one being chosen is
|
|
230
|
+
* told apart from the scale around it.
|
|
231
|
+
*/
|
|
232
|
+
highlight?: boolean;
|
|
233
|
+
/** Styles that band. */
|
|
234
|
+
highlightClassName?: string;
|
|
235
|
+
/**
|
|
236
|
+
* What the top and bottom of the window fade into — a theme token name, or
|
|
237
|
+
* any colour. It has to be told: the fade is painted, so it can only be the
|
|
238
|
+
* right colour if it is the colour of whatever is behind the window.
|
|
239
|
+
* Defaults to `--color-background`; pass `--color-card` inside a card.
|
|
240
|
+
*
|
|
241
|
+
* `false` turns the fade off, for a window on a surface that is not one flat
|
|
242
|
+
* colour.
|
|
243
|
+
*/
|
|
244
|
+
fadeColor?: string | false;
|
|
245
|
+
enabled?: boolean;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* A column of values scrolling past a window, coming to rest on one.
|
|
249
|
+
*
|
|
250
|
+
* The difference from `Sliding` is what the reader is being told. An odometer
|
|
251
|
+
* says *this number changed*; a column that scrolls past its neighbours says
|
|
252
|
+
* *this number was chosen from a scale*, and the values either side of it are
|
|
253
|
+
* the scale. Reach for it for a target, a threshold, a picked quantity — and
|
|
254
|
+
* for a plain change of value, reach for the other one.
|
|
255
|
+
*/
|
|
256
|
+
declare function TextAnimationScrolling({ className, value, step, around, duration, delay, formatOptions, textClassName, size, weight, highlight, highlightClassName, fadeColor, enabled, ...props }: TextAnimationScrollingProps): import("react").JSX.Element;
|
|
257
|
+
declare namespace TextAnimationScrolling {
|
|
258
|
+
var displayName: string;
|
|
259
|
+
}
|
|
260
|
+
export declare const TextAnimation: typeof TextAnimationRoot & {
|
|
261
|
+
Typing: typeof TextAnimationTyping;
|
|
262
|
+
Rotating: typeof TextAnimationRotating;
|
|
263
|
+
Counting: typeof TextAnimationCounting;
|
|
264
|
+
Sliding: typeof TextAnimationSliding;
|
|
265
|
+
Scrolling: typeof TextAnimationScrolling;
|
|
266
|
+
};
|
|
267
|
+
export {};
|
|
268
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/text-animation/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAkBpE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,0BAAuB,CAAC;AAuC7D,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,OAAO,EACP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AAC;CACnB;AAED;;;;;;;;GAQG;AACH,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,KAAK,EACL,IAAQ,EACR,MAAU,EACV,QAAQ,EACR,KAAK,EACL,aAAa,EACb,aAAa,EACb,IAAI,EACJ,MAAM,EACN,SAAiB,EACjB,kBAAkB,EAClB,SAAgC,EAChC,OAAO,EACP,GAAG,KAAK,EACT,EAAE,2BAA2B,+BAsJ7B;kBAtKQ,sBAAsB;;;AAyK/B,eAAO,MAAM,aAAa;;;;;;CAMxB,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Timeline — a vertical sequence of events.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* One `value` on the root says how far the sequence has got, and every item
|
|
5
|
+
* resolves its own state from its `step` against it — completed below, active
|
|
6
|
+
* at, inactive above. Stating it once is the point: a timeline whose items each
|
|
7
|
+
* carried their own state would let you write two active items, or none.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
9
|
+
* State is resolved in JS and handed down through context into `tv()` variants
|
|
10
|
+
* rather than being read off the element, because React Native has no
|
|
11
|
+
* attribute selectors for a stylesheet to key off. `Steps` resolves its states
|
|
12
|
+
* the same way, so the two read as siblings.
|
|
12
13
|
*
|
|
13
14
|
* Vertical only — a horizontal timeline gives each item roughly a fifth of a
|
|
14
15
|
* phone's width, which is not enough for a date and a title.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/timeline/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/timeline/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAKL,KAAK,SAAS,EACf,MAA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