panelui-native 0.28.1 → 0.32.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 +22 -3
- package/lib/module/components/calendar/index.js +450 -132
- package/lib/module/components/calendar/index.js.map +1 -1
- package/lib/module/components/code-block/highlight.js +363 -0
- package/lib/module/components/code-block/highlight.js.map +1 -0
- package/lib/module/components/code-block/index.js +313 -0
- package/lib/module/components/code-block/index.js.map +1 -0
- package/lib/module/components/date-picker/index.js +8 -1
- package/lib/module/components/date-picker/index.js.map +1 -1
- package/lib/module/components/heatmap-chart/index.js +9 -8
- package/lib/module/components/heatmap-chart/index.js.map +1 -1
- package/lib/module/components/map/index.js +50 -4
- package/lib/module/components/map/index.js.map +1 -1
- package/lib/module/components/menu/index.js +714 -0
- package/lib/module/components/menu/index.js.map +1 -0
- package/lib/module/components/plan/index.js +582 -0
- package/lib/module/components/plan/index.js.map +1 -0
- package/lib/module/components/popover/index.js +35 -4
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/post/index.js +992 -0
- package/lib/module/components/post/index.js.map +1 -0
- package/lib/module/components/radio-group/index.js +13 -8
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/reasoning/index.js +244 -0
- package/lib/module/components/reasoning/index.js.map +1 -0
- package/lib/module/components/response/index.js +296 -0
- package/lib/module/components/response/index.js.map +1 -0
- package/lib/module/components/response/markdown.js +463 -0
- package/lib/module/components/response/markdown.js.map +1 -0
- package/lib/module/components/select/index.js +97 -15
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/sources/index.js +221 -0
- package/lib/module/components/sources/index.js.map +1 -0
- package/lib/module/components/table/index.js +632 -0
- package/lib/module/components/table/index.js.map +1 -0
- package/lib/module/components/task/index.js +300 -0
- package/lib/module/components/task/index.js.map +1 -0
- package/lib/module/components/textarea/index.js +295 -0
- package/lib/module/components/textarea/index.js.map +1 -0
- package/lib/module/components/tooltip/index.js +179 -23
- package/lib/module/components/tooltip/index.js.map +1 -1
- package/lib/module/icons/index.js +339 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +12 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/primitives/collapse.js +112 -0
- package/lib/module/primitives/collapse.js.map +1 -0
- package/lib/module/utils/date.js +129 -22
- package/lib/module/utils/date.js.map +1 -1
- package/lib/typescript/src/components/calendar/index.d.ts +79 -5
- package/lib/typescript/src/components/calendar/index.d.ts.map +1 -1
- package/lib/typescript/src/components/code-block/highlight.d.ts +39 -0
- package/lib/typescript/src/components/code-block/highlight.d.ts.map +1 -0
- package/lib/typescript/src/components/code-block/index.d.ts +113 -0
- package/lib/typescript/src/components/code-block/index.d.ts.map +1 -0
- package/lib/typescript/src/components/date-picker/index.d.ts +7 -1
- package/lib/typescript/src/components/date-picker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/heatmap-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/index.d.ts +8 -1
- package/lib/typescript/src/components/map/index.d.ts.map +1 -1
- package/lib/typescript/src/components/menu/index.d.ts +261 -0
- package/lib/typescript/src/components/menu/index.d.ts.map +1 -0
- package/lib/typescript/src/components/plan/index.d.ts +238 -0
- package/lib/typescript/src/components/plan/index.d.ts.map +1 -0
- package/lib/typescript/src/components/popover/index.d.ts +35 -1
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/post/index.d.ts +358 -0
- package/lib/typescript/src/components/post/index.d.ts.map +1 -0
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/reasoning/index.d.ts +97 -0
- package/lib/typescript/src/components/reasoning/index.d.ts.map +1 -0
- package/lib/typescript/src/components/response/index.d.ts +91 -0
- package/lib/typescript/src/components/response/index.d.ts.map +1 -0
- package/lib/typescript/src/components/response/markdown.d.ts +88 -0
- package/lib/typescript/src/components/response/markdown.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts +27 -2
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/sources/index.d.ts +85 -0
- package/lib/typescript/src/components/sources/index.d.ts.map +1 -0
- package/lib/typescript/src/components/table/index.d.ts +274 -0
- package/lib/typescript/src/components/table/index.d.ts.map +1 -0
- package/lib/typescript/src/components/task/index.d.ts +103 -0
- package/lib/typescript/src/components/task/index.d.ts.map +1 -0
- package/lib/typescript/src/components/textarea/index.d.ts +175 -0
- package/lib/typescript/src/components/textarea/index.d.ts.map +1 -0
- package/lib/typescript/src/components/tooltip/index.d.ts +63 -8
- package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -1
- package/lib/typescript/src/icons/index.d.ts +54 -1
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +14 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/primitives/collapse.d.ts +42 -0
- package/lib/typescript/src/primitives/collapse.d.ts.map +1 -0
- package/lib/typescript/src/utils/date.d.ts +49 -5
- package/lib/typescript/src/utils/date.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/calendar/index.tsx +519 -139
- package/src/components/code-block/highlight.ts +278 -0
- package/src/components/code-block/index.tsx +341 -0
- package/src/components/date-picker/index.tsx +19 -1
- package/src/components/heatmap-chart/index.tsx +9 -9
- package/src/components/map/index.tsx +53 -4
- package/src/components/menu/index.tsx +812 -0
- package/src/components/plan/index.tsx +648 -0
- package/src/components/popover/index.tsx +69 -2
- package/src/components/post/index.tsx +1116 -0
- package/src/components/radio-group/index.tsx +11 -2
- package/src/components/reasoning/index.tsx +297 -0
- package/src/components/response/index.tsx +390 -0
- package/src/components/response/markdown.ts +489 -0
- package/src/components/select/index.tsx +132 -12
- package/src/components/sources/index.tsx +278 -0
- package/src/components/table/index.tsx +747 -0
- package/src/components/task/index.tsx +329 -0
- package/src/components/textarea/index.tsx +381 -0
- package/src/components/tooltip/index.tsx +203 -20
- package/src/icons/index.tsx +264 -1
- package/src/index.ts +131 -0
- package/src/primitives/collapse.tsx +128 -0
- package/src/utils/date.ts +146 -22
- package/theme.css +112 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Table — rows and columns that stay lined up.
|
|
5
|
+
*
|
|
6
|
+
* React Native has no table layout: no `<table>`, no column model, nothing that
|
|
7
|
+
* makes the third cell of one row the same width as the third cell of the next.
|
|
8
|
+
* A table here is therefore a stack of flex rows, and the columns exist only
|
|
9
|
+
* because every row divides its width the same way. That is the one rule the
|
|
10
|
+
* component cannot enforce for you — `flex` and `width` on a `Table.Head` and
|
|
11
|
+
* on the `Table.Cell` beneath it have to agree, or the column drifts.
|
|
12
|
+
*
|
|
13
|
+
* Everything else it does own: the hairlines between rows and the missing one
|
|
14
|
+
* under the last, the muted header and footer, the striping, the alignment of a
|
|
15
|
+
* numeric column, and the sort arrow that turns over rather than swapping.
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Table variant="outline">
|
|
19
|
+
* <Table.Header>
|
|
20
|
+
* <Table.Row>
|
|
21
|
+
* <Table.Head flex={2}>Invoice</Table.Head>
|
|
22
|
+
* <Table.Head align="end" sortDirection="desc" onPress={toggleSort}>
|
|
23
|
+
* Amount
|
|
24
|
+
* </Table.Head>
|
|
25
|
+
* </Table.Row>
|
|
26
|
+
* </Table.Header>
|
|
27
|
+
* <Table.Body>
|
|
28
|
+
* <Table.Row>
|
|
29
|
+
* <Table.Cell flex={2}>INV-001</Table.Cell>
|
|
30
|
+
* <Table.Cell align="end">$250.00</Table.Cell>
|
|
31
|
+
* </Table.Row>
|
|
32
|
+
* </Table.Body>
|
|
33
|
+
* </Table>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* `Table.Frame` is the same table in a widget shell, with the column headings
|
|
37
|
+
* lifted onto the tray above the card. It takes the whole table and does the
|
|
38
|
+
* lift itself, so the columns are still declared once.
|
|
39
|
+
*
|
|
40
|
+
* A table wider than the phone belongs in a horizontal scroller with a
|
|
41
|
+
* `minWidth` on the table, not squeezed until the columns are unreadable — wrap
|
|
42
|
+
* it in `ScrollFade` and the cut edge tells you there is more to the right.
|
|
43
|
+
*
|
|
44
|
+
* Long tables belong in a `FlatList` rather than in `Table.Body`, which renders
|
|
45
|
+
* every row it is given. `Table.Row` takes `index` and `last` directly for that
|
|
46
|
+
* case, since a virtualised row has no parent to read them from.
|
|
47
|
+
*/
|
|
48
|
+
import { Children, cloneElement, createContext, forwardRef, isValidElement, useContext, useEffect, useMemo } from 'react';
|
|
49
|
+
import { View } from 'react-native';
|
|
50
|
+
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
51
|
+
import { tv } from 'tailwind-variants';
|
|
52
|
+
import { useCSSVariable } from 'uniwind';
|
|
53
|
+
import { ChevronUpIcon } from "../../icons/index.js";
|
|
54
|
+
import { AnimatedPressable } from "../../primitives/animated-pressable.js";
|
|
55
|
+
import { Text, textChildren } from "../../primitives/text.js";
|
|
56
|
+
import { cn } from "../../utils/cn.js";
|
|
57
|
+
import { selectionTick } from "../../utils/haptics.js";
|
|
58
|
+
import { Frame } from "../frame/index.js";
|
|
59
|
+
|
|
60
|
+
/** Long enough to read as the arrow turning over, short enough not to lag a tap. */
|
|
61
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
62
|
+
const SORT_DURATION = 160;
|
|
63
|
+
const tableVariants = tv({
|
|
64
|
+
slots: {
|
|
65
|
+
root: 'w-full',
|
|
66
|
+
row: 'w-full flex-row items-center',
|
|
67
|
+
head: 'flex-row items-center gap-1.5',
|
|
68
|
+
headLabel: 'font-medium text-muted-foreground',
|
|
69
|
+
cell: 'flex-row items-center',
|
|
70
|
+
cellLabel: 'text-foreground',
|
|
71
|
+
caption: 'text-muted-foreground'
|
|
72
|
+
},
|
|
73
|
+
variants: {
|
|
74
|
+
variant: {
|
|
75
|
+
/** Hairlines only — the table sits directly on the page. */
|
|
76
|
+
default: {},
|
|
77
|
+
/** Framed and clipped, for a table that reads as its own card. */
|
|
78
|
+
outline: {
|
|
79
|
+
root: 'overflow-hidden rounded-xl border border-border'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
size: {
|
|
83
|
+
default: {
|
|
84
|
+
row: 'min-h-12 gap-3 px-4',
|
|
85
|
+
headLabel: 'text-xs',
|
|
86
|
+
cellLabel: 'text-sm',
|
|
87
|
+
caption: 'text-sm'
|
|
88
|
+
},
|
|
89
|
+
sm: {
|
|
90
|
+
row: 'min-h-10 gap-2 px-3',
|
|
91
|
+
headLabel: 'text-[11px]',
|
|
92
|
+
cellLabel: 'text-xs',
|
|
93
|
+
caption: 'text-xs'
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
defaultVariants: {
|
|
98
|
+
variant: 'default',
|
|
99
|
+
size: 'default'
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const alignment = {
|
|
103
|
+
start: 'justify-start',
|
|
104
|
+
center: 'justify-center',
|
|
105
|
+
end: 'justify-end'
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Density and striping are set once on the root; every part below reads them
|
|
110
|
+
* from here rather than being told again per row and per cell.
|
|
111
|
+
*/
|
|
112
|
+
const TableContext = /*#__PURE__*/createContext({
|
|
113
|
+
size: 'default',
|
|
114
|
+
striped: false
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Which band of the table a row is in, and where in that band. A row needs all
|
|
119
|
+
* three: the section decides its text and its borders, the index decides
|
|
120
|
+
* whether it is striped, and being last is what removes the hairline that would
|
|
121
|
+
* otherwise double up with the table's own bottom edge.
|
|
122
|
+
*/
|
|
123
|
+
const TableRowContext = /*#__PURE__*/createContext({
|
|
124
|
+
section: 'body',
|
|
125
|
+
index: 0,
|
|
126
|
+
last: false
|
|
127
|
+
});
|
|
128
|
+
const TableRoot = /*#__PURE__*/forwardRef(({
|
|
129
|
+
className,
|
|
130
|
+
variant,
|
|
131
|
+
size = 'default',
|
|
132
|
+
striped = false,
|
|
133
|
+
children,
|
|
134
|
+
...props
|
|
135
|
+
}, ref) => {
|
|
136
|
+
const {
|
|
137
|
+
root
|
|
138
|
+
} = tableVariants({
|
|
139
|
+
variant,
|
|
140
|
+
size
|
|
141
|
+
});
|
|
142
|
+
const context = useMemo(() => ({
|
|
143
|
+
size,
|
|
144
|
+
striped
|
|
145
|
+
}), [size, striped]);
|
|
146
|
+
return /*#__PURE__*/_jsx(TableContext.Provider, {
|
|
147
|
+
value: context,
|
|
148
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
149
|
+
ref: ref,
|
|
150
|
+
role: "table",
|
|
151
|
+
className: root({
|
|
152
|
+
className
|
|
153
|
+
}),
|
|
154
|
+
...props,
|
|
155
|
+
children: textChildren(children)
|
|
156
|
+
})
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
TableRoot.displayName = 'Table';
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Wraps each row of a section in its position, so a row does not have to be
|
|
163
|
+
* told where it sits. Wrapping rather than cloning: a row is often produced by
|
|
164
|
+
* a `.map()` through a component of your own, and props set on that wrapper
|
|
165
|
+
* would never reach the row itself.
|
|
166
|
+
*/
|
|
167
|
+
function useSectionRows(children, section) {
|
|
168
|
+
return useMemo(() => {
|
|
169
|
+
const rows = Children.toArray(children).filter(child => /*#__PURE__*/isValidElement(child));
|
|
170
|
+
return rows.map((child, index) => /*#__PURE__*/_jsx(TableRowContext.Provider, {
|
|
171
|
+
value: {
|
|
172
|
+
section,
|
|
173
|
+
index,
|
|
174
|
+
last: index === rows.length - 1
|
|
175
|
+
},
|
|
176
|
+
children: child
|
|
177
|
+
}, index));
|
|
178
|
+
}, [children, section]);
|
|
179
|
+
}
|
|
180
|
+
/** The band of column headers. Draws the rule that separates it from the body. */
|
|
181
|
+
const TableHeader = /*#__PURE__*/forwardRef(({
|
|
182
|
+
className,
|
|
183
|
+
children,
|
|
184
|
+
...props
|
|
185
|
+
}, ref) => {
|
|
186
|
+
const rows = useSectionRows(children, 'header');
|
|
187
|
+
return /*#__PURE__*/_jsx(View, {
|
|
188
|
+
ref: ref,
|
|
189
|
+
role: "rowgroup",
|
|
190
|
+
className: cn('w-full border-b border-border', className),
|
|
191
|
+
...props,
|
|
192
|
+
children: rows
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
TableHeader.displayName = 'Table.Header';
|
|
196
|
+
/** The data rows. Renders every child it is given — see `FlatList` for long tables. */
|
|
197
|
+
const TableBody = /*#__PURE__*/forwardRef(({
|
|
198
|
+
className,
|
|
199
|
+
children,
|
|
200
|
+
...props
|
|
201
|
+
}, ref) => {
|
|
202
|
+
const rows = useSectionRows(children, 'body');
|
|
203
|
+
return /*#__PURE__*/_jsx(View, {
|
|
204
|
+
ref: ref,
|
|
205
|
+
role: "rowgroup",
|
|
206
|
+
className: cn('w-full', className),
|
|
207
|
+
...props,
|
|
208
|
+
children: rows
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
TableBody.displayName = 'Table.Body';
|
|
212
|
+
/** Totals band. Tinted and ruled off, because a sum is not another row of data. */
|
|
213
|
+
const TableFooter = /*#__PURE__*/forwardRef(({
|
|
214
|
+
className,
|
|
215
|
+
children,
|
|
216
|
+
...props
|
|
217
|
+
}, ref) => {
|
|
218
|
+
const rows = useSectionRows(children, 'footer');
|
|
219
|
+
return /*#__PURE__*/_jsx(View, {
|
|
220
|
+
ref: ref,
|
|
221
|
+
role: "rowgroup",
|
|
222
|
+
className: cn('w-full border-t border-border bg-muted/50', className),
|
|
223
|
+
...props,
|
|
224
|
+
children: rows
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
TableFooter.displayName = 'Table.Footer';
|
|
228
|
+
/**
|
|
229
|
+
* Renders as a pressable when given `onPress`, and as a plain view otherwise,
|
|
230
|
+
* so a table you only read does not announce every row as a button.
|
|
231
|
+
*/
|
|
232
|
+
const TableRow = /*#__PURE__*/forwardRef(({
|
|
233
|
+
className,
|
|
234
|
+
selected,
|
|
235
|
+
disabled,
|
|
236
|
+
index,
|
|
237
|
+
last,
|
|
238
|
+
children,
|
|
239
|
+
onPress,
|
|
240
|
+
...props
|
|
241
|
+
}, ref) => {
|
|
242
|
+
const {
|
|
243
|
+
size,
|
|
244
|
+
striped
|
|
245
|
+
} = useContext(TableContext);
|
|
246
|
+
const row = useContext(TableRowContext);
|
|
247
|
+
const {
|
|
248
|
+
row: rowClass
|
|
249
|
+
} = tableVariants({
|
|
250
|
+
size
|
|
251
|
+
});
|
|
252
|
+
const position = index ?? row.index;
|
|
253
|
+
const isLast = last ?? row.last;
|
|
254
|
+
// The header is one row above a rule of its own and the footer one below
|
|
255
|
+
// another, so neither wants a hairline; in the body every row but the last
|
|
256
|
+
// is separated from the one under it.
|
|
257
|
+
const ruled = row.section === 'body' && !isLast;
|
|
258
|
+
// Stripe the odd rows, so the first row of a table reads on the table's own
|
|
259
|
+
// background rather than in a band.
|
|
260
|
+
const striping = striped && row.section === 'body' && position % 2 === 1 && !selected;
|
|
261
|
+
const classes = rowClass({
|
|
262
|
+
className: cn(ruled && 'border-b border-border', striping && 'bg-muted/40', selected && 'bg-accent', disabled && 'opacity-[0.64]', className)
|
|
263
|
+
});
|
|
264
|
+
if (!onPress) {
|
|
265
|
+
return /*#__PURE__*/_jsx(View, {
|
|
266
|
+
ref: ref,
|
|
267
|
+
role: "row",
|
|
268
|
+
accessibilityState: {
|
|
269
|
+
disabled: !!disabled,
|
|
270
|
+
selected: !!selected
|
|
271
|
+
},
|
|
272
|
+
className: classes,
|
|
273
|
+
...props,
|
|
274
|
+
children: textChildren(children)
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return /*#__PURE__*/_jsx(AnimatedPressable, {
|
|
278
|
+
ref: ref
|
|
279
|
+
// A row you can act on is a button first: announcing it as a row would
|
|
280
|
+
// hide the fact that it does anything.
|
|
281
|
+
,
|
|
282
|
+
accessibilityRole: "button",
|
|
283
|
+
accessibilityState: {
|
|
284
|
+
disabled: !!disabled,
|
|
285
|
+
selected: !!selected
|
|
286
|
+
},
|
|
287
|
+
disabled: disabled,
|
|
288
|
+
onPress: onPress,
|
|
289
|
+
className: classes,
|
|
290
|
+
...props,
|
|
291
|
+
children: textChildren(children)
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
TableRow.displayName = 'Table.Row';
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Column sizing, shared by a head and the cells beneath it. Written out on both
|
|
298
|
+
* rather than inherited from one place, so the props table on each says what it
|
|
299
|
+
* actually takes.
|
|
300
|
+
*/
|
|
301
|
+
function columnStyle({
|
|
302
|
+
flex,
|
|
303
|
+
width
|
|
304
|
+
}) {
|
|
305
|
+
if (width !== undefined) return {
|
|
306
|
+
width,
|
|
307
|
+
flexGrow: 0,
|
|
308
|
+
flexShrink: 0
|
|
309
|
+
};
|
|
310
|
+
return {
|
|
311
|
+
flex: flex ?? 1
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* A column header. Given `onPress` it becomes the handle for sorting by that
|
|
316
|
+
* column, and the arrow rotates between the two directions rather than being
|
|
317
|
+
* replaced, so it is clear it is the same arrow pointing the other way.
|
|
318
|
+
*
|
|
319
|
+
* The sorted column is stated twice — a full-strength arrow *and* a label that
|
|
320
|
+
* takes the foreground colour and a heavier weight. One signal at the size of a
|
|
321
|
+
* sort arrow is too quiet to notice: a press that only nudges a dim 14px chevron
|
|
322
|
+
* reads as a press that did nothing, even when the rows behind it did move.
|
|
323
|
+
*
|
|
324
|
+
* The component never sorts. It renders the direction it is told and reports
|
|
325
|
+
* the press; which column, which way and in what order stay with the caller,
|
|
326
|
+
* because the data being sorted is theirs.
|
|
327
|
+
*/
|
|
328
|
+
const TableHead = /*#__PURE__*/forwardRef(({
|
|
329
|
+
className,
|
|
330
|
+
labelClassName,
|
|
331
|
+
align = 'start',
|
|
332
|
+
sortable,
|
|
333
|
+
sortDirection,
|
|
334
|
+
onPress,
|
|
335
|
+
flex,
|
|
336
|
+
width,
|
|
337
|
+
children,
|
|
338
|
+
style,
|
|
339
|
+
...props
|
|
340
|
+
}, ref) => {
|
|
341
|
+
const {
|
|
342
|
+
size
|
|
343
|
+
} = useContext(TableContext);
|
|
344
|
+
const {
|
|
345
|
+
head,
|
|
346
|
+
headLabel
|
|
347
|
+
} = tableVariants({
|
|
348
|
+
size
|
|
349
|
+
});
|
|
350
|
+
const arrowColor = useCSSVariable('--color-muted-foreground');
|
|
351
|
+
const activeArrowColor = useCSSVariable('--color-foreground');
|
|
352
|
+
const showArrow = sortable || !!sortDirection;
|
|
353
|
+
const turn = useSharedValue(sortDirection === 'desc' ? 1 : 0);
|
|
354
|
+
useEffect(() => {
|
|
355
|
+
turn.value = withTiming(sortDirection === 'desc' ? 1 : 0, {
|
|
356
|
+
duration: SORT_DURATION
|
|
357
|
+
});
|
|
358
|
+
}, [sortDirection, turn]);
|
|
359
|
+
const arrowStyle = useAnimatedStyle(() => ({
|
|
360
|
+
transform: [{
|
|
361
|
+
rotate: `${turn.value * 180}deg`
|
|
362
|
+
}]
|
|
363
|
+
}));
|
|
364
|
+
const classes = head({
|
|
365
|
+
className: cn(alignment[align], className)
|
|
366
|
+
});
|
|
367
|
+
const label = /*#__PURE__*/_jsxs(_Fragment, {
|
|
368
|
+
children: [textChildren(children, text => /*#__PURE__*/_jsx(Text, {
|
|
369
|
+
className: headLabel({
|
|
370
|
+
className: cn(sortDirection && 'font-semibold text-foreground', labelClassName)
|
|
371
|
+
}),
|
|
372
|
+
children: text
|
|
373
|
+
})), showArrow ? /*#__PURE__*/_jsx(Animated.View, {
|
|
374
|
+
// Dimmed until this is the column being sorted by: the arrow is an
|
|
375
|
+
// affordance first and an answer second. Far enough down that the
|
|
376
|
+
// two states are not mistaken for each other at a glance.
|
|
377
|
+
style: [arrowStyle, sortDirection ? undefined : {
|
|
378
|
+
opacity: 0.35
|
|
379
|
+
}],
|
|
380
|
+
children: /*#__PURE__*/_jsx(ChevronUpIcon, {
|
|
381
|
+
size: sortDirection ? 16 : 14,
|
|
382
|
+
color: sortDirection ? typeof activeArrowColor === 'string' ? activeArrowColor : '#0a0a0a' : typeof arrowColor === 'string' ? arrowColor : '#737373'
|
|
383
|
+
})
|
|
384
|
+
}) : null]
|
|
385
|
+
});
|
|
386
|
+
if (!onPress) {
|
|
387
|
+
return /*#__PURE__*/_jsx(View, {
|
|
388
|
+
ref: ref,
|
|
389
|
+
role: "columnheader",
|
|
390
|
+
className: classes,
|
|
391
|
+
style: [columnStyle({
|
|
392
|
+
flex,
|
|
393
|
+
width
|
|
394
|
+
}), style],
|
|
395
|
+
...props,
|
|
396
|
+
children: label
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
return /*#__PURE__*/_jsx(AnimatedPressable, {
|
|
400
|
+
ref: ref,
|
|
401
|
+
accessibilityRole: "button",
|
|
402
|
+
accessibilityState: {
|
|
403
|
+
selected: !!sortDirection
|
|
404
|
+
},
|
|
405
|
+
accessibilityHint: sortDirection === 'asc' ? 'Sorts this column in descending order' : sortDirection === 'desc' ? 'Sorts this column in ascending order' : 'Sorts the table by this column',
|
|
406
|
+
onPress: event => {
|
|
407
|
+
// The rows re-order under the finger; the tick is what ties that to
|
|
408
|
+
// the press, on the frame of the press rather than after the sort.
|
|
409
|
+
selectionTick();
|
|
410
|
+
onPress?.(event);
|
|
411
|
+
},
|
|
412
|
+
className: classes,
|
|
413
|
+
style: [columnStyle({
|
|
414
|
+
flex,
|
|
415
|
+
width
|
|
416
|
+
}), style],
|
|
417
|
+
...props,
|
|
418
|
+
children: label
|
|
419
|
+
});
|
|
420
|
+
});
|
|
421
|
+
TableHead.displayName = 'Table.Head';
|
|
422
|
+
/**
|
|
423
|
+
* One cell of a row. Bare text is wrapped in the cell's own type style, so a
|
|
424
|
+
* row of strings needs no `Text` around each one; anything else — a Badge, an
|
|
425
|
+
* Avatar, a Button — is rendered as given.
|
|
426
|
+
*/
|
|
427
|
+
const TableCell = /*#__PURE__*/forwardRef(({
|
|
428
|
+
className,
|
|
429
|
+
labelClassName,
|
|
430
|
+
align = 'start',
|
|
431
|
+
flex,
|
|
432
|
+
width,
|
|
433
|
+
children,
|
|
434
|
+
style,
|
|
435
|
+
...props
|
|
436
|
+
}, ref) => {
|
|
437
|
+
const {
|
|
438
|
+
size
|
|
439
|
+
} = useContext(TableContext);
|
|
440
|
+
const {
|
|
441
|
+
cell,
|
|
442
|
+
cellLabel
|
|
443
|
+
} = tableVariants({
|
|
444
|
+
size
|
|
445
|
+
});
|
|
446
|
+
return /*#__PURE__*/_jsx(View, {
|
|
447
|
+
ref: ref,
|
|
448
|
+
role: "cell",
|
|
449
|
+
className: cell({
|
|
450
|
+
className: cn(alignment[align], className)
|
|
451
|
+
}),
|
|
452
|
+
style: [columnStyle({
|
|
453
|
+
flex,
|
|
454
|
+
width
|
|
455
|
+
}), style],
|
|
456
|
+
...props,
|
|
457
|
+
children: textChildren(children, text => /*#__PURE__*/_jsx(Text, {
|
|
458
|
+
className: cellLabel({
|
|
459
|
+
className: labelClassName
|
|
460
|
+
}),
|
|
461
|
+
children: text
|
|
462
|
+
}))
|
|
463
|
+
});
|
|
464
|
+
});
|
|
465
|
+
TableCell.displayName = 'Table.Cell';
|
|
466
|
+
/**
|
|
467
|
+
* A line about the table as a whole — what it counts, when it was last read.
|
|
468
|
+
* Place it after the body: a caption read before the columns is a heading, and
|
|
469
|
+
* a heading is not this component's job.
|
|
470
|
+
*/
|
|
471
|
+
const TableCaption = /*#__PURE__*/forwardRef(({
|
|
472
|
+
className,
|
|
473
|
+
...props
|
|
474
|
+
}, ref) => {
|
|
475
|
+
const {
|
|
476
|
+
size
|
|
477
|
+
} = useContext(TableContext);
|
|
478
|
+
const {
|
|
479
|
+
caption
|
|
480
|
+
} = tableVariants({
|
|
481
|
+
size
|
|
482
|
+
});
|
|
483
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
484
|
+
ref: ref,
|
|
485
|
+
className: caption({
|
|
486
|
+
className
|
|
487
|
+
}),
|
|
488
|
+
...props
|
|
489
|
+
});
|
|
490
|
+
});
|
|
491
|
+
TableCaption.displayName = 'Table.Caption';
|
|
492
|
+
/**
|
|
493
|
+
* Stands in for the body when there is nothing to show. A table with a header
|
|
494
|
+
* and no rows under it looks broken rather than empty, and the header is worth
|
|
495
|
+
* keeping: it says what would be there.
|
|
496
|
+
*/
|
|
497
|
+
const TableEmpty = /*#__PURE__*/forwardRef(({
|
|
498
|
+
className,
|
|
499
|
+
children,
|
|
500
|
+
...props
|
|
501
|
+
}, ref) => {
|
|
502
|
+
const {
|
|
503
|
+
size
|
|
504
|
+
} = useContext(TableContext);
|
|
505
|
+
const {
|
|
506
|
+
caption
|
|
507
|
+
} = tableVariants({
|
|
508
|
+
size
|
|
509
|
+
});
|
|
510
|
+
return /*#__PURE__*/_jsx(View, {
|
|
511
|
+
ref: ref,
|
|
512
|
+
role: "row",
|
|
513
|
+
className: cn('w-full items-center justify-center px-4 py-8', className),
|
|
514
|
+
...props,
|
|
515
|
+
children: textChildren(children, text => /*#__PURE__*/_jsx(Text, {
|
|
516
|
+
className: caption(),
|
|
517
|
+
children: text
|
|
518
|
+
}))
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
TableEmpty.displayName = 'Table.Empty';
|
|
522
|
+
/**
|
|
523
|
+
* The table in a widget shell: column headings on the tray, rows in the card
|
|
524
|
+
* below.
|
|
525
|
+
*
|
|
526
|
+
* The headings are lifted out of the card because they are not data. Sitting on
|
|
527
|
+
* the tray they read as the label for the block, the way the muted caption above
|
|
528
|
+
* any other panel does, and the card underneath holds nothing but rows — so the
|
|
529
|
+
* first row is a row rather than the thing after the header.
|
|
530
|
+
*
|
|
531
|
+
* The lift is done here rather than by the caller because the alternative is
|
|
532
|
+
* declaring every column twice: a heading row outside the table and a body
|
|
533
|
+
* inside it, with `flex` and `width` kept in agreement across the gap by hand.
|
|
534
|
+
* Given the whole table, this can take the `Table.Header` out of it and leave
|
|
535
|
+
* everything measuring against the same padding.
|
|
536
|
+
*
|
|
537
|
+
* ```tsx
|
|
538
|
+
* <Table.Frame title="Invoices" action={<Badge>5</Badge>}>
|
|
539
|
+
* <Table.Header>
|
|
540
|
+
* <Table.Row>
|
|
541
|
+
* <Table.Head flex={2}>Invoice</Table.Head>
|
|
542
|
+
* <Table.Head align="end">Amount</Table.Head>
|
|
543
|
+
* </Table.Row>
|
|
544
|
+
* </Table.Header>
|
|
545
|
+
* <Table.Body>…</Table.Body>
|
|
546
|
+
* </Table.Frame>
|
|
547
|
+
* ```
|
|
548
|
+
*/
|
|
549
|
+
const TableFrame = /*#__PURE__*/forwardRef(({
|
|
550
|
+
className,
|
|
551
|
+
title,
|
|
552
|
+
action,
|
|
553
|
+
description,
|
|
554
|
+
size = 'default',
|
|
555
|
+
striped = false,
|
|
556
|
+
children,
|
|
557
|
+
...props
|
|
558
|
+
}, ref) => {
|
|
559
|
+
const context = useMemo(() => ({
|
|
560
|
+
size,
|
|
561
|
+
striped
|
|
562
|
+
}), [size, striped]);
|
|
563
|
+
const {
|
|
564
|
+
heading,
|
|
565
|
+
body
|
|
566
|
+
} = useMemo(() => {
|
|
567
|
+
let found = null;
|
|
568
|
+
const remaining = [];
|
|
569
|
+
for (const child of Children.toArray(children)) {
|
|
570
|
+
if (!found && /*#__PURE__*/isValidElement(child) && child.type === TableHeader) {
|
|
571
|
+
// The tray already draws the rule the panel's top border is, so the
|
|
572
|
+
// header's own would double it.
|
|
573
|
+
found = /*#__PURE__*/cloneElement(child, {
|
|
574
|
+
className: cn('border-b-0', child.props.className)
|
|
575
|
+
});
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
remaining.push(child);
|
|
579
|
+
}
|
|
580
|
+
return {
|
|
581
|
+
heading: found,
|
|
582
|
+
body: remaining
|
|
583
|
+
};
|
|
584
|
+
}, [children]);
|
|
585
|
+
const captioned = title !== undefined || description !== undefined || !!action;
|
|
586
|
+
return /*#__PURE__*/_jsx(TableContext.Provider, {
|
|
587
|
+
value: context,
|
|
588
|
+
children: /*#__PURE__*/_jsxs(Frame, {
|
|
589
|
+
ref: ref,
|
|
590
|
+
role: "table",
|
|
591
|
+
className: className,
|
|
592
|
+
...props,
|
|
593
|
+
children: [captioned ? /*#__PURE__*/_jsxs(Frame.Header, {
|
|
594
|
+
className: cn('items-start', heading && 'pb-1.5'),
|
|
595
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
596
|
+
className: "min-w-0 flex-1 gap-0.5",
|
|
597
|
+
children: [textChildren(title, text => /*#__PURE__*/_jsx(Frame.Title, {
|
|
598
|
+
children: text
|
|
599
|
+
})), textChildren(description, text => /*#__PURE__*/_jsx(Frame.Description, {
|
|
600
|
+
children: text
|
|
601
|
+
}))]
|
|
602
|
+
}), action ? /*#__PURE__*/_jsx(Frame.Action, {
|
|
603
|
+
children: action
|
|
604
|
+
}) : null]
|
|
605
|
+
}) : null, heading ?
|
|
606
|
+
/*#__PURE__*/
|
|
607
|
+
// No horizontal padding of its own: `Table.Row` brings the same
|
|
608
|
+
// `px-4` the rows in the panel do, which is the whole reason the
|
|
609
|
+
// headings still line up with their cells from out here.
|
|
610
|
+
_jsx(View, {
|
|
611
|
+
className: cn('pb-2', captioned ? 'pt-0' : 'pt-2.5'),
|
|
612
|
+
children: heading
|
|
613
|
+
}) : null, /*#__PURE__*/_jsx(Frame.Panel, {
|
|
614
|
+
dividers: false,
|
|
615
|
+
children: body
|
|
616
|
+
})]
|
|
617
|
+
})
|
|
618
|
+
});
|
|
619
|
+
});
|
|
620
|
+
TableFrame.displayName = 'Table.Frame';
|
|
621
|
+
export const Table = Object.assign(TableRoot, {
|
|
622
|
+
Frame: TableFrame,
|
|
623
|
+
Header: TableHeader,
|
|
624
|
+
Body: TableBody,
|
|
625
|
+
Footer: TableFooter,
|
|
626
|
+
Row: TableRow,
|
|
627
|
+
Head: TableHead,
|
|
628
|
+
Cell: TableCell,
|
|
629
|
+
Caption: TableCaption,
|
|
630
|
+
Empty: TableEmpty
|
|
631
|
+
});
|
|
632
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Children","cloneElement","createContext","forwardRef","isValidElement","useContext","useEffect","useMemo","View","Animated","useAnimatedStyle","useSharedValue","withTiming","tv","useCSSVariable","ChevronUpIcon","AnimatedPressable","Text","textChildren","cn","selectionTick","Frame","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SORT_DURATION","tableVariants","slots","root","row","head","headLabel","cell","cellLabel","caption","variants","variant","default","outline","size","sm","defaultVariants","alignment","start","center","end","TableContext","striped","TableRowContext","section","index","last","TableRoot","className","children","props","ref","context","Provider","value","role","displayName","useSectionRows","rows","toArray","filter","child","map","length","TableHeader","TableBody","TableFooter","TableRow","selected","disabled","onPress","rowClass","position","isLast","ruled","striping","classes","accessibilityState","accessibilityRole","columnStyle","flex","width","undefined","flexGrow","flexShrink","TableHead","labelClassName","align","sortable","sortDirection","style","arrowColor","activeArrowColor","showArrow","turn","duration","arrowStyle","transform","rotate","label","text","opacity","color","accessibilityHint","event","TableCell","TableCaption","TableEmpty","TableFrame","title","action","description","heading","body","found","remaining","type","push","captioned","Header","Title","Description","Action","Panel","dividers","Table","Object","assign","Body","Footer","Row","Head","Cell","Caption","Empty"],"sourceRoot":"../../../../src","sources":["components/table/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,QAAQ,EACRC,YAAY,EACZC,aAAa,EACbC,UAAU,EACVC,cAAc,EACdC,UAAU,EACVC,SAAS,EACTC,OAAO,QA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