panelui-native 0.38.0 → 0.40.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 (37) hide show
  1. package/README.md +2 -1
  2. package/lib/module/components/heatmap-chart/index.js +113 -6
  3. package/lib/module/components/heatmap-chart/index.js.map +1 -1
  4. package/lib/module/components/pagination/index.js +519 -0
  5. package/lib/module/components/pagination/index.js.map +1 -0
  6. package/lib/module/components/ring-chart/index.js +183 -45
  7. package/lib/module/components/ring-chart/index.js.map +1 -1
  8. package/lib/module/components/steps/index.js +8 -6
  9. package/lib/module/components/steps/index.js.map +1 -1
  10. package/lib/module/components/table/index.js +100 -26
  11. package/lib/module/components/table/index.js.map +1 -1
  12. package/lib/module/components/timeline/index.js +8 -7
  13. package/lib/module/components/timeline/index.js.map +1 -1
  14. package/lib/module/index.js +1 -0
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/typescript/src/components/heatmap-chart/index.d.ts +51 -3
  17. package/lib/typescript/src/components/heatmap-chart/index.d.ts.map +1 -1
  18. package/lib/typescript/src/components/pagination/index.d.ts +285 -0
  19. package/lib/typescript/src/components/pagination/index.d.ts.map +1 -0
  20. package/lib/typescript/src/components/ring-chart/index.d.ts +75 -8
  21. package/lib/typescript/src/components/ring-chart/index.d.ts.map +1 -1
  22. package/lib/typescript/src/components/steps/index.d.ts +8 -6
  23. package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
  24. package/lib/typescript/src/components/table/index.d.ts +59 -17
  25. package/lib/typescript/src/components/table/index.d.ts.map +1 -1
  26. package/lib/typescript/src/components/timeline/index.d.ts +8 -7
  27. package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
  28. package/lib/typescript/src/index.d.ts +2 -1
  29. package/lib/typescript/src/index.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/src/components/heatmap-chart/index.tsx +147 -5
  32. package/src/components/pagination/index.tsx +591 -0
  33. package/src/components/ring-chart/index.tsx +269 -47
  34. package/src/components/steps/index.tsx +8 -6
  35. package/src/components/table/index.tsx +146 -30
  36. package/src/components/timeline/index.tsx +8 -7
  37. package/src/index.ts +15 -0
@@ -0,0 +1,285 @@
1
+ /**
2
+ * Pagination — moving through a result set one page at a time.
3
+ *
4
+ * The component owns the arithmetic and nothing else. Give it how many pages
5
+ * there are and which one you are on, and it works out which numbers to show,
6
+ * where the gaps fall, and which controls are dead at the ends; it never fetches
7
+ * and never slices, because the data is yours.
8
+ *
9
+ * ```tsx
10
+ * <Pagination count={12} page={page} onPageChange={setPage} />
11
+ * ```
12
+ *
13
+ * Three presentations, because a phone is not a desktop:
14
+ *
15
+ * - `numbers` — the full run, with the middle folded into ellipses. Fits about
16
+ * seven targets across a phone, which is what `siblings` and `boundaries`
17
+ * are tuned for.
18
+ * - `compact` — the two arrows with `3 / 12` between them. Digits and a slash,
19
+ * so there is no sentence to translate.
20
+ * - `simple` — labelled Previous and Next, for a flow you walk rather than
21
+ * jump around in: a wizard, an article, a set of onboarding cards.
22
+ *
23
+ * Every target is at least 44pt in both axes, and the small size keeps that
24
+ * reach with `hitSlop` rather than by growing — the row gets denser, the
25
+ * fingers do not get smaller.
26
+ *
27
+ * An ellipsis is a button, not punctuation. A dead 44pt target in the middle of
28
+ * a row of live ones is a thing people tap and then think is broken, so tapping
29
+ * one jumps `pageJump` pages that way.
30
+ *
31
+ * Given children, the root becomes a row with them on the leading edge and the
32
+ * controls on the trailing one — which is where `Pagination.Status` goes:
33
+ *
34
+ * ```tsx
35
+ * <Pagination count={12} page={page} onPageChange={setPage} variant="compact">
36
+ * <Pagination.Status page={page} pageSize={20} total={240} />
37
+ * </Pagination>
38
+ * ```
39
+ */
40
+ import { type ReactNode } from 'react';
41
+ import { View, type ViewProps } from 'react-native';
42
+ import { type VariantProps } from 'tailwind-variants';
43
+ import { type AnimatedPressableProps } from '../../primitives/animated-pressable.js';
44
+ import { type TextProps } from '../../primitives/text.js';
45
+ export type PaginationVariant = 'numbers' | 'compact' | 'simple';
46
+ export type PaginationSize = 'sm' | 'default';
47
+ declare const paginationVariants: import("tailwind-variants").TVReturnType<{
48
+ size: {
49
+ default: {
50
+ list: string;
51
+ item: string;
52
+ itemLabel: string;
53
+ ellipsis: string;
54
+ status: string;
55
+ summary: string;
56
+ };
57
+ sm: {
58
+ list: string;
59
+ item: string;
60
+ itemLabel: string;
61
+ ellipsis: string;
62
+ status: string;
63
+ summary: string;
64
+ };
65
+ };
66
+ /** Whether the item is the page you are on. */
67
+ current: {
68
+ true: {
69
+ item: string;
70
+ itemLabel: string;
71
+ };
72
+ false: {
73
+ itemLabel: string;
74
+ };
75
+ };
76
+ disabled: {
77
+ true: {
78
+ item: string;
79
+ };
80
+ };
81
+ }, {
82
+ root: string;
83
+ list: string;
84
+ item: string;
85
+ itemLabel: string;
86
+ ellipsis: string;
87
+ status: string;
88
+ summary: string;
89
+ }, undefined, {
90
+ size: {
91
+ default: {
92
+ list: string;
93
+ item: string;
94
+ itemLabel: string;
95
+ ellipsis: string;
96
+ status: string;
97
+ summary: string;
98
+ };
99
+ sm: {
100
+ list: string;
101
+ item: string;
102
+ itemLabel: string;
103
+ ellipsis: string;
104
+ status: string;
105
+ summary: string;
106
+ };
107
+ };
108
+ /** Whether the item is the page you are on. */
109
+ current: {
110
+ true: {
111
+ item: string;
112
+ itemLabel: string;
113
+ };
114
+ false: {
115
+ itemLabel: string;
116
+ };
117
+ };
118
+ disabled: {
119
+ true: {
120
+ item: string;
121
+ };
122
+ };
123
+ }, {
124
+ root: string;
125
+ list: string;
126
+ item: string;
127
+ itemLabel: string;
128
+ ellipsis: string;
129
+ status: string;
130
+ summary: string;
131
+ }, import("tailwind-variants").TVReturnType<{
132
+ size: {
133
+ default: {
134
+ list: string;
135
+ item: string;
136
+ itemLabel: string;
137
+ ellipsis: string;
138
+ status: string;
139
+ summary: string;
140
+ };
141
+ sm: {
142
+ list: string;
143
+ item: string;
144
+ itemLabel: string;
145
+ ellipsis: string;
146
+ status: string;
147
+ summary: string;
148
+ };
149
+ };
150
+ /** Whether the item is the page you are on. */
151
+ current: {
152
+ true: {
153
+ item: string;
154
+ itemLabel: string;
155
+ };
156
+ false: {
157
+ itemLabel: string;
158
+ };
159
+ };
160
+ disabled: {
161
+ true: {
162
+ item: string;
163
+ };
164
+ };
165
+ }, {
166
+ root: string;
167
+ list: string;
168
+ item: string;
169
+ itemLabel: string;
170
+ ellipsis: string;
171
+ status: string;
172
+ summary: string;
173
+ }, undefined, unknown, unknown, undefined>>;
174
+ export type PaginationItemValue = number | 'start-ellipsis' | 'end-ellipsis';
175
+ /**
176
+ * Which numbers to draw, and where the gaps go.
177
+ *
178
+ * The run is a fixed width rather than a sliding window: the same number of
179
+ * targets whichever page you are on, so the row does not reflow under the
180
+ * finger as you step through it and the arrow you were aiming at stays put.
181
+ * `boundaries` pins the ends, `siblings` pads the middle, and a gap of exactly
182
+ * one page is drawn as that page instead of an ellipsis — a `…` that hides a
183
+ * single number is longer than the number.
184
+ *
185
+ * Exported because a caller sometimes needs the same run for a control of their
186
+ * own, and two implementations of this would drift.
187
+ */
188
+ export declare function paginationRange({ count, page, siblings, boundaries, }: {
189
+ count: number;
190
+ page: number;
191
+ siblings?: number;
192
+ boundaries?: number;
193
+ }): PaginationItemValue[];
194
+ export interface PaginationProps extends Omit<ViewProps, 'children'>, VariantProps<typeof paginationVariants> {
195
+ className?: string;
196
+ /**
197
+ * How many pages there are. Pages are numbered from 1, so this is also the
198
+ * last page's number.
199
+ */
200
+ count: number;
201
+ /** The page being shown. Pass it to control the component. */
202
+ page?: number;
203
+ /** The page to start on when the component keeps its own. Defaults to 1. */
204
+ defaultPage?: number;
205
+ /** Called with the page that was asked for, already clamped to `count`. */
206
+ onPageChange?: (page: number) => void;
207
+ /** Which presentation to draw. */
208
+ variant?: PaginationVariant;
209
+ size?: PaginationSize;
210
+ /**
211
+ * How many pages to keep either side of the current one. Raise it on a
212
+ * tablet, where there is room for a longer run.
213
+ */
214
+ siblings?: number;
215
+ /** How many pages to keep pinned at each end of the run. */
216
+ boundaries?: number;
217
+ /**
218
+ * Show the previous and next arrows. Turning them off leaves the numbers
219
+ * alone, so only do it where something else moves the page — a swipe, a
220
+ * scroller reaching its end.
221
+ */
222
+ controls?: boolean;
223
+ /** How far tapping an ellipsis jumps. */
224
+ pageJump?: number;
225
+ /** Greys out and deafens the whole row — for a page that is still loading. */
226
+ disabled?: boolean;
227
+ /** Labels the row for a screen reader. Defaults to "Pagination". */
228
+ accessibilityLabel?: string;
229
+ /** Leading content — a `Pagination.Status`, a page-size control of your own. */
230
+ children?: ReactNode;
231
+ }
232
+ export interface PaginationItemProps extends Omit<AnimatedPressableProps, 'children' | 'disabled'> {
233
+ className?: string;
234
+ /** The page this target goes to. */
235
+ page: number;
236
+ /** Styles the number. */
237
+ labelClassName?: string;
238
+ children?: ReactNode;
239
+ }
240
+ export interface PaginationPreviousProps extends Omit<AnimatedPressableProps, 'children'> {
241
+ className?: string;
242
+ /** Write the word beside the arrow, rather than leaving it as a glyph. */
243
+ label?: boolean;
244
+ }
245
+ export interface PaginationNextProps extends Omit<AnimatedPressableProps, 'children'> {
246
+ className?: string;
247
+ /** Write the word beside the arrow, rather than leaving it as a glyph. */
248
+ label?: boolean;
249
+ }
250
+ export interface PaginationEllipsisProps extends Omit<AnimatedPressableProps, 'children'> {
251
+ className?: string;
252
+ /** Which way the gap runs: `-1` towards page 1, `1` towards the last page. */
253
+ direction?: -1 | 1;
254
+ /** How many pages a tap covers. */
255
+ jump?: number;
256
+ }
257
+ export interface PaginationSummaryProps extends TextProps {
258
+ className?: string;
259
+ }
260
+ export interface PaginationStatusProps extends TextProps {
261
+ className?: string;
262
+ /** Which page the span is counted from. Read from the root when left out. */
263
+ page?: number;
264
+ /** How many rows a page holds. Required for the span to be worked out. */
265
+ pageSize?: number;
266
+ /** How many rows there are altogether. */
267
+ total?: number;
268
+ children?: ReactNode;
269
+ }
270
+ export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<View>> & {
271
+ Item: import("react").ForwardRefExoticComponent<PaginationItemProps & import("react").RefAttributes<View>>;
272
+ Previous: {
273
+ ({ ...props }: PaginationPreviousProps): import("react").JSX.Element;
274
+ displayName: string;
275
+ };
276
+ Next: {
277
+ ({ ...props }: PaginationNextProps): import("react").JSX.Element;
278
+ displayName: string;
279
+ };
280
+ Ellipsis: import("react").ForwardRefExoticComponent<PaginationEllipsisProps & import("react").RefAttributes<View>>;
281
+ Summary: import("react").ForwardRefExoticComponent<PaginationSummaryProps & import("react").RefAttributes<import("react-native").Text>>;
282
+ Status: import("react").ForwardRefExoticComponent<PaginationStatusProps & import("react").RefAttributes<import("react-native").Text>>;
283
+ };
284
+ export {};
285
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/pagination/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI1D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAC7C,OAAO,EAAQ,KAAK,SAAS,EAAgB,MAAM,0BAAuB,CAAC;AAI3E,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AACjE,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,SAAS,CAAC;AAS9C,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;IA6BpB,+CAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAA/C,+CAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAA/C,+CAA+C;;;;;;;;;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AC"}
@@ -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 full-circle track and the progress over it — with
29
- * only the progress animated, through `strokeDasharray`. Sweeping the arc by
30
- * rebuilding its path would work, but a dash offset is two numbers moving on
31
- * an unchanged path, and it keeps the rounded cap pinned to the moving end for
32
- * free.
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
- /** Rounded ends, or square ones. */
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;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;AAKzF,sEAAsE;AACtE,MAAM,WAAW,SAAS;IACxB,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,KAAK,EAAE,M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AAC;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
- * Adapted from: origin-space/originui apps/origin/registry/default/ui/stepper.tsx
5
- * (the Stepper / Item / Trigger / Indicator / Title / Description / Separator
6
- * anatomy, and the completed | active | inactive | loading state resolution).
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
- * Upstream drives all styling through `data-*` attributes, which React Native
9
- * has no equivalent for. Here the state is resolved in JS and passed down
10
- * through context into `tv()` variants — the same approach Alert uses.
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;;;;;;;;;;;;;;GAcG;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,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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. That is the one rule the
8
- * component cannot enforce for you — `flex` and `width` on a `Table.Head` and
9
- * on the `Table.Cell` beneath it have to agree, or the column drifts.
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 flex={2}>Invoice</Table.Head>
20
- * <Table.Head align="end" sortDirection="desc" onPress={toggleSort}>
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 flex={2}>INV-001</Table.Cell>
28
- * <Table.Cell align="end">$250.00</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. Must match the `flex` on
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. Must match the `width` on the cells beneath it.
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. Must match the `flex` on the head above it.
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. Must match the
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
- /** Which edge the cell's content sits against. Match the head above it. */
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpD,OAAO,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Q,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"}
@@ -1,14 +1,15 @@
1
1
  /**
2
2
  * Timeline — a vertical sequence of events.
3
3
  *
4
- * Adapted from: origin-space/originui apps/origin/registry/default/ui/timeline.tsx
5
- * (the Item / Indicator / Separator / Header / Date / Title / Content anatomy
6
- * and the completed-up-to-active state rule), shaped to match this repo's
7
- * `Steps` component so the two read as siblings.
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
- * Upstream drives styling through `data-*` attributes, which React Native has
10
- * no equivalent for; state is resolved in JS and passed through context into
11
- * `tv()` variants instead.
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;;;;;;;;;;;;;;;;;;;;;;;;;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