@multiplatform.one/components 7.65.0 → 7.65.2
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/dist/cjs/Alert/index.cjs +26 -5
- package/dist/cjs/Alert/index.native.js +26 -5
- package/dist/cjs/Alert/index.native.js.map +1 -1
- package/dist/cjs/images/Image/framing.cjs +29 -0
- package/dist/cjs/images/Image/framing.native.js +32 -0
- package/dist/cjs/images/Image/framing.native.js.map +1 -0
- package/dist/cjs/images/Image/shared.cjs +2 -2
- package/dist/cjs/images/Image/shared.native.js +2 -2
- package/dist/cjs/images/Image/shared.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.cjs +16 -131
- package/dist/cjs/views/Dashboard.native.js +16 -131
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/List.cjs +14 -189
- package/dist/cjs/views/List.native.js +14 -193
- package/dist/cjs/views/List.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.cjs +181 -0
- package/dist/cjs/views/ListGroup.native.js +194 -0
- package/dist/cjs/views/ListGroup.native.js.map +1 -0
- package/dist/cjs/views/ListRow.cjs +266 -0
- package/dist/cjs/views/ListRow.native.js +274 -0
- package/dist/cjs/views/ListRow.native.js.map +1 -0
- package/dist/cjs/views/ShortcutCard.cjs +100 -0
- package/dist/cjs/views/ShortcutCard.native.js +104 -0
- package/dist/cjs/views/ShortcutCard.native.js.map +1 -0
- package/dist/cjs/views/index.cjs +3 -0
- package/dist/cjs/views/index.native.js +3 -0
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/cjs/views/widgetChrome.cjs +93 -0
- package/dist/cjs/views/widgetChrome.native.js +95 -0
- package/dist/cjs/views/widgetChrome.native.js.map +1 -0
- package/dist/esm/Alert/index.mjs +27 -6
- package/dist/esm/Alert/index.mjs.map +1 -1
- package/dist/esm/Alert/index.native.js +27 -6
- package/dist/esm/Alert/index.native.js.map +1 -1
- package/dist/esm/images/Image/framing.mjs +4 -0
- package/dist/esm/images/Image/framing.mjs.map +1 -0
- package/dist/esm/images/Image/framing.native.js +4 -0
- package/dist/esm/images/Image/framing.native.js.map +1 -0
- package/dist/esm/images/Image/shared.mjs +2 -2
- package/dist/esm/images/Image/shared.mjs.map +1 -1
- package/dist/esm/images/Image/shared.native.js +2 -2
- package/dist/esm/images/Image/shared.native.js.map +1 -1
- package/dist/esm/views/Dashboard.mjs +6 -121
- package/dist/esm/views/Dashboard.mjs.map +1 -1
- package/dist/esm/views/Dashboard.native.js +6 -121
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/List.mjs +8 -186
- package/dist/esm/views/List.mjs.map +1 -1
- package/dist/esm/views/List.native.js +8 -190
- package/dist/esm/views/List.native.js.map +1 -1
- package/dist/esm/views/ListGroup.mjs +144 -0
- package/dist/esm/views/ListGroup.mjs.map +1 -0
- package/dist/esm/views/ListGroup.native.js +154 -0
- package/dist/esm/views/ListGroup.native.js.map +1 -0
- package/dist/esm/views/ListRow.mjs +234 -0
- package/dist/esm/views/ListRow.mjs.map +1 -0
- package/dist/esm/views/ListRow.native.js +239 -0
- package/dist/esm/views/ListRow.native.js.map +1 -0
- package/dist/esm/views/ShortcutCard.mjs +75 -0
- package/dist/esm/views/ShortcutCard.mjs.map +1 -0
- package/dist/esm/views/ShortcutCard.native.js +76 -0
- package/dist/esm/views/ShortcutCard.native.js.map +1 -0
- package/dist/esm/views/index.mjs +2 -2
- package/dist/esm/views/index.mjs.map +1 -1
- package/dist/esm/views/index.native.js +2 -2
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/esm/views/widgetChrome.mjs +66 -0
- package/dist/esm/views/widgetChrome.mjs.map +1 -0
- package/dist/esm/views/widgetChrome.native.js +65 -0
- package/dist/esm/views/widgetChrome.native.js.map +1 -0
- package/dist/jsx/Alert/index.mjs +27 -6
- package/dist/jsx/Alert/index.mjs.map +1 -1
- package/dist/jsx/Alert/index.native.js +26 -5
- package/dist/jsx/Alert/index.native.js.map +1 -1
- package/dist/jsx/feedback/NotifyHost.native.js +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.native.js +1 -1
- package/dist/jsx/images/Image/framing.mjs +4 -0
- package/dist/jsx/images/Image/framing.mjs.map +1 -0
- package/dist/jsx/images/Image/framing.native.js +32 -0
- package/dist/jsx/images/Image/framing.native.js.map +1 -0
- package/dist/jsx/images/Image/shared.mjs +2 -2
- package/dist/jsx/images/Image/shared.mjs.map +1 -1
- package/dist/jsx/images/Image/shared.native.js +2 -2
- package/dist/jsx/images/Image/shared.native.js.map +1 -1
- package/dist/jsx/index.native.js +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.mjs +6 -121
- package/dist/jsx/views/Dashboard.mjs.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +16 -131
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/List.mjs +8 -186
- package/dist/jsx/views/List.mjs.map +1 -1
- package/dist/jsx/views/List.native.js +14 -193
- package/dist/jsx/views/List.native.js.map +1 -1
- package/dist/jsx/views/ListGroup.mjs +144 -0
- package/dist/jsx/views/ListGroup.mjs.map +1 -0
- package/dist/jsx/views/ListGroup.native.js +194 -0
- package/dist/jsx/views/ListGroup.native.js.map +1 -0
- package/dist/jsx/views/ListRow.mjs +234 -0
- package/dist/jsx/views/ListRow.mjs.map +1 -0
- package/dist/jsx/views/ListRow.native.js +274 -0
- package/dist/jsx/views/ListRow.native.js.map +1 -0
- package/dist/jsx/views/ShortcutCard.mjs +75 -0
- package/dist/jsx/views/ShortcutCard.mjs.map +1 -0
- package/dist/jsx/views/ShortcutCard.native.js +104 -0
- package/dist/jsx/views/ShortcutCard.native.js.map +1 -0
- package/dist/jsx/views/index.mjs +2 -2
- package/dist/jsx/views/index.mjs.map +1 -1
- package/dist/jsx/views/index.native.js +3 -0
- package/dist/jsx/views/index.native.js.map +1 -1
- package/dist/jsx/views/widgetChrome.mjs +66 -0
- package/dist/jsx/views/widgetChrome.mjs.map +1 -0
- package/dist/jsx/views/widgetChrome.native.js +95 -0
- package/dist/jsx/views/widgetChrome.native.js.map +1 -0
- package/package.json +9 -9
- package/src/Alert/Alert.spec.tsx +79 -0
- package/src/Alert/Alert.stories.tsx +32 -1
- package/src/Alert/index.tsx +54 -5
- package/src/images/Image/framing.ts +8 -0
- package/src/images/Image/shared.ts +2 -7
- package/src/overlayElevation.spec.tsx +3 -1
- package/src/views/Dashboard.tsx +5 -146
- package/src/views/Kanban.native.spec.tsx +2 -2
- package/src/views/List.tsx +22 -237
- package/src/views/ListGroup.spec.tsx +220 -0
- package/src/views/ListGroup.stories.tsx +83 -0
- package/src/views/ListGroup.tsx +189 -0
- package/src/views/ListRow.tsx +282 -0
- package/src/views/ShortcutCard.spec.tsx +40 -0
- package/src/views/ShortcutCard.stories.tsx +50 -1
- package/src/views/ShortcutCard.tsx +88 -0
- package/src/views/index.ts +6 -0
- package/src/views/widgetChrome.tsx +73 -0
- package/types/Alert/index.d.ts +9 -0
- package/types/Alert/index.d.ts.map +1 -1
- package/types/images/Image/framing.d.ts +7 -0
- package/types/images/Image/framing.d.ts.map +1 -0
- package/types/images/Image/shared.d.ts +1 -6
- package/types/images/Image/shared.d.ts.map +1 -1
- package/types/views/Dashboard.d.ts +2 -15
- package/types/views/Dashboard.d.ts.map +1 -1
- package/types/views/List.d.ts +3 -66
- package/types/views/List.d.ts.map +1 -1
- package/types/views/ListGroup.d.ts +43 -0
- package/types/views/ListGroup.d.ts.map +1 -0
- package/types/views/ListRow.d.ts +88 -0
- package/types/views/ListRow.d.ts.map +1 -0
- package/types/views/ShortcutCard.d.ts +26 -0
- package/types/views/ShortcutCard.d.ts.map +1 -0
- package/types/views/index.d.ts +1 -1
- package/types/views/index.d.ts.map +1 -1
- package/types/views/widgetChrome.d.ts +72 -0
- package/types/views/widgetChrome.d.ts.map +1 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { ImageFramingContext } from "../images/Image/framing";
|
|
2
|
+
import {
|
|
3
|
+
IconSlot,
|
|
4
|
+
type IconSlotValue,
|
|
5
|
+
MIN_PRESS_TARGET,
|
|
6
|
+
recipeKeyAbove,
|
|
7
|
+
sizeRecipeForToken,
|
|
8
|
+
type SizeRecipeToken,
|
|
9
|
+
useResolvedKnobs,
|
|
10
|
+
} from "@multiplatform.one/theme";
|
|
11
|
+
import type React from "react";
|
|
12
|
+
import { createContext, useContext, type ReactNode } from "react";
|
|
13
|
+
import { Text, View, XStack, YStack, isWeb, type SizeTokens } from "tamagui";
|
|
14
|
+
|
|
15
|
+
/** Per-row interaction state passed to `renderItem` and `ListRow`. */
|
|
16
|
+
export interface ListItemState {
|
|
17
|
+
selected: boolean;
|
|
18
|
+
focused: boolean;
|
|
19
|
+
/** Ink for the selected row (LC-05 selection tier) */
|
|
20
|
+
selectedInk?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** True inside a ListRow with a subtitle: its trailing meta is a caption. */
|
|
24
|
+
const ListRowTwoLineContext = createContext(false);
|
|
25
|
+
|
|
26
|
+
export const ListItemStateContext = createContext<ListItemState>({
|
|
27
|
+
selected: false,
|
|
28
|
+
focused: false,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** Read the current row's selection/focus. Defaults to idle outside a List. */
|
|
32
|
+
export function useListItemState(): ListItemState {
|
|
33
|
+
return useContext(ListItemStateContext);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Subject-led document row (Desk list / Linear / Finder): leading glyph or
|
|
38
|
+
* media, title (+ optional subtitle), trailing muted meta. Sits inside List's
|
|
39
|
+
* stacked-group chrome — does not paint its own radius, fill, or ring.
|
|
40
|
+
*
|
|
41
|
+
* LC-155 ROW-ANATOMY: the title is the headline role, the subtitle the meta
|
|
42
|
+
* role on one line, and with a subtitle the row is a two-line Mail row whose
|
|
43
|
+
* trailing meta is a caption at the top right.
|
|
44
|
+
*/
|
|
45
|
+
export interface ListRowProps {
|
|
46
|
+
/** Leading glyph slot — fixed box so titles share one x (LC-08). */
|
|
47
|
+
icon?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Leading media slot (an avatar, a thumbnail): a `$true` square, and a
|
|
50
|
+
* thumbnail inside it draws no tile of its own.
|
|
51
|
+
*/
|
|
52
|
+
media?: ReactNode;
|
|
53
|
+
title: ReactNode;
|
|
54
|
+
subtitle?: ReactNode;
|
|
55
|
+
/** Trailing Finder/Desk columns (dates, size, kind, status). */
|
|
56
|
+
meta?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* A finished item (a checked to-do): the title and subtitle take the meta
|
|
59
|
+
* ink and a strike-through, so the row reads done without a fill of its own.
|
|
60
|
+
*/
|
|
61
|
+
done?: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function RowText({
|
|
65
|
+
children,
|
|
66
|
+
...props
|
|
67
|
+
}: { children: ReactNode } & React.ComponentProps<typeof Text>) {
|
|
68
|
+
if (children == null || children === false) return null;
|
|
69
|
+
if (typeof children === "string" || typeof children === "number") {
|
|
70
|
+
return <Text {...props}>{children}</Text>;
|
|
71
|
+
}
|
|
72
|
+
return <>{children}</>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Trailing Finder/Desk column. Inherits selected fill ink (LC-71). `width`
|
|
77
|
+
* fixes the column (a size token or a measured px) so the same column lines
|
|
78
|
+
* up from row to row; rich cell content (pills, formatted cells) renders in a
|
|
79
|
+
* box of that width instead of a Text run.
|
|
80
|
+
*/
|
|
81
|
+
export function ListRowMeta({
|
|
82
|
+
children,
|
|
83
|
+
width,
|
|
84
|
+
color,
|
|
85
|
+
}: {
|
|
86
|
+
children: ReactNode;
|
|
87
|
+
width?: number | SizeTokens;
|
|
88
|
+
color?: string;
|
|
89
|
+
}) {
|
|
90
|
+
const { knobProps } = useResolvedKnobs();
|
|
91
|
+
const { selected, selectedInk } = useListItemState();
|
|
92
|
+
const twoLine = useContext(ListRowTwoLineContext);
|
|
93
|
+
const type = twoLine ? knobProps.textRole.caption : knobProps.label;
|
|
94
|
+
const ink = color ?? (twoLine ? knobProps.textRole.caption.color : knobProps.textAccentColor);
|
|
95
|
+
const resolved = selected && selectedInk ? selectedInk : ink;
|
|
96
|
+
if (typeof children !== "string" && typeof children !== "number") {
|
|
97
|
+
return (
|
|
98
|
+
<XStack
|
|
99
|
+
width={width}
|
|
100
|
+
flexShrink={0}
|
|
101
|
+
minWidth={0}
|
|
102
|
+
alignItems="center"
|
|
103
|
+
justifyContent="flex-end"
|
|
104
|
+
overflow="hidden"
|
|
105
|
+
{...({ "data-list-slot": "trailing", color: resolved } as Record<string, unknown>)}
|
|
106
|
+
>
|
|
107
|
+
{children}
|
|
108
|
+
</XStack>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
return (
|
|
112
|
+
<Text
|
|
113
|
+
{...type}
|
|
114
|
+
color={resolved}
|
|
115
|
+
numberOfLines={1}
|
|
116
|
+
width={width}
|
|
117
|
+
flexShrink={0}
|
|
118
|
+
textAlign="right"
|
|
119
|
+
userSelect="none"
|
|
120
|
+
>
|
|
121
|
+
{children}
|
|
122
|
+
</Text>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* LC-261 NO-MIDDOT-JOIN: a number in a row's trailing meta is a small glyph
|
|
128
|
+
* and the figure (a story count, a comment count), never strung onto the
|
|
129
|
+
* subtitle with "·". The glyph names the quantity; `label` says it in words
|
|
130
|
+
* for assistive tech. With no figure the glyph alone is the value (LC-260).
|
|
131
|
+
*/
|
|
132
|
+
export function ListRowFact({
|
|
133
|
+
icon,
|
|
134
|
+
label,
|
|
135
|
+
children,
|
|
136
|
+
}: {
|
|
137
|
+
icon: IconSlotValue;
|
|
138
|
+
label: string;
|
|
139
|
+
children?: ReactNode;
|
|
140
|
+
}) {
|
|
141
|
+
const { knobProps } = useResolvedKnobs();
|
|
142
|
+
const { selected, selectedInk } = useListItemState();
|
|
143
|
+
const caption = knobProps.textRole.caption;
|
|
144
|
+
const ink = selected && selectedInk ? selectedInk : caption.color;
|
|
145
|
+
const iconSize = sizeRecipeForToken(knobProps.sizeToken as SizeRecipeToken).iconSize;
|
|
146
|
+
return (
|
|
147
|
+
<XStack
|
|
148
|
+
alignItems="center"
|
|
149
|
+
gap="$1"
|
|
150
|
+
flexShrink={0}
|
|
151
|
+
aria-label={label}
|
|
152
|
+
{...({ "data-list-slot": "fact", accessible: true, role: "img" } as Record<string, unknown>)}
|
|
153
|
+
>
|
|
154
|
+
<IconSlot icon={icon} size={iconSize} color={ink as string} />
|
|
155
|
+
{children != null ? (
|
|
156
|
+
<Text {...caption} color={ink} numberOfLines={1} userSelect="none">
|
|
157
|
+
{children}
|
|
158
|
+
</Text>
|
|
159
|
+
) : null}
|
|
160
|
+
</XStack>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The leading glyph of a (two-line) list row: the control icon two recipe
|
|
166
|
+
* keys above the row's size token (20 at the default `$true`), read off the
|
|
167
|
+
* scale so a preset restyles it with every other control icon.
|
|
168
|
+
*/
|
|
169
|
+
export function listLeadingIconSize(sizeToken: string): number {
|
|
170
|
+
return sizeRecipeForToken(recipeKeyAbove(recipeKeyAbove(sizeToken as SizeRecipeToken))).iconSize;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function ListRow({ icon, media, title, subtitle, meta, done = false }: ListRowProps) {
|
|
174
|
+
const { knobProps } = useResolvedKnobs();
|
|
175
|
+
const { selected, selectedInk } = useListItemState();
|
|
176
|
+
const { headline, meta: metaRole } = knobProps.textRole;
|
|
177
|
+
const selectedOverride = selected && selectedInk ? selectedInk : undefined;
|
|
178
|
+
const ink = selectedOverride ?? knobProps.textAccentColor;
|
|
179
|
+
const iconSize = listLeadingIconSize(knobProps.sizeToken);
|
|
180
|
+
const leading = icon ? <IconSlot icon={icon} size={iconSize} color={ink} /> : null;
|
|
181
|
+
const twoLine = subtitle != null && subtitle !== false;
|
|
182
|
+
const doneProps = done ? ({ textDecorationLine: "line-through" } as const) : null;
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<ListRowTwoLineContext.Provider value={twoLine}>
|
|
186
|
+
<XStack
|
|
187
|
+
alignItems="center"
|
|
188
|
+
{...knobProps.gap}
|
|
189
|
+
flex={1}
|
|
190
|
+
minWidth={0}
|
|
191
|
+
width="100%"
|
|
192
|
+
{...(twoLine ? { paddingVertical: "$1" } : null)}
|
|
193
|
+
{...(done ? ({ "data-done": true } as Record<string, unknown>) : null)}
|
|
194
|
+
>
|
|
195
|
+
{media ? (
|
|
196
|
+
<View
|
|
197
|
+
width="$true"
|
|
198
|
+
height="$true"
|
|
199
|
+
flexShrink={0}
|
|
200
|
+
alignItems="center"
|
|
201
|
+
justifyContent="center"
|
|
202
|
+
overflow="hidden"
|
|
203
|
+
{...({ "data-list-slot": "media" } as Record<string, unknown>)}
|
|
204
|
+
>
|
|
205
|
+
<ImageFramingContext.Provider value={false}>{media}</ImageFramingContext.Provider>
|
|
206
|
+
</View>
|
|
207
|
+
) : null}
|
|
208
|
+
{leading ? (
|
|
209
|
+
<View
|
|
210
|
+
width={iconSize}
|
|
211
|
+
height={iconSize}
|
|
212
|
+
flexShrink={0}
|
|
213
|
+
alignItems="center"
|
|
214
|
+
justifyContent="center"
|
|
215
|
+
{...({ "data-list-slot": "icon", color: ink } as Record<string, unknown>)}
|
|
216
|
+
>
|
|
217
|
+
{leading}
|
|
218
|
+
</View>
|
|
219
|
+
) : null}
|
|
220
|
+
<YStack
|
|
221
|
+
flex={1}
|
|
222
|
+
minWidth={0}
|
|
223
|
+
{...({ "data-list-slot": "title" } as Record<string, unknown>)}
|
|
224
|
+
>
|
|
225
|
+
<RowText
|
|
226
|
+
{...knobProps.body}
|
|
227
|
+
{...headline}
|
|
228
|
+
color={selectedOverride ?? (done ? metaRole.color : headline.color)}
|
|
229
|
+
{...doneProps}
|
|
230
|
+
numberOfLines={1}
|
|
231
|
+
userSelect="none"
|
|
232
|
+
>
|
|
233
|
+
{title}
|
|
234
|
+
</RowText>
|
|
235
|
+
{twoLine ? (
|
|
236
|
+
<RowText
|
|
237
|
+
{...knobProps.body}
|
|
238
|
+
{...metaRole}
|
|
239
|
+
color={selectedOverride ?? metaRole.color}
|
|
240
|
+
{...doneProps}
|
|
241
|
+
opacity={selected ? 0.85 : 1}
|
|
242
|
+
numberOfLines={1}
|
|
243
|
+
userSelect="none"
|
|
244
|
+
>
|
|
245
|
+
{subtitle}
|
|
246
|
+
</RowText>
|
|
247
|
+
) : null}
|
|
248
|
+
</YStack>
|
|
249
|
+
{meta != null && meta !== false ? (
|
|
250
|
+
<XStack
|
|
251
|
+
alignItems="center"
|
|
252
|
+
{...knobProps.gap}
|
|
253
|
+
flexShrink={0}
|
|
254
|
+
{...(twoLine ? { alignSelf: "flex-start" } : null)}
|
|
255
|
+
{...({ "data-list-slot": "meta" } as Record<string, unknown>)}
|
|
256
|
+
>
|
|
257
|
+
{typeof meta === "string" || typeof meta === "number" ? (
|
|
258
|
+
<ListRowMeta>{meta}</ListRowMeta>
|
|
259
|
+
) : (
|
|
260
|
+
meta
|
|
261
|
+
)}
|
|
262
|
+
</XStack>
|
|
263
|
+
) : null}
|
|
264
|
+
</XStack>
|
|
265
|
+
</ListRowTwoLineContext.Provider>
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* A row in a scroller waits this long before it paints its press, the delay
|
|
271
|
+
* UIScrollView gives its content: a touch that becomes a scroll never fills
|
|
272
|
+
* the row it started on (LC-147).
|
|
273
|
+
*/
|
|
274
|
+
export const listRowPressDelayMs = 150;
|
|
275
|
+
|
|
276
|
+
/** What a touch surface adds to a row: the 44 floor and, on native, the press delay. */
|
|
277
|
+
export function listRowTouchProps(touch: boolean, native = !isWeb) {
|
|
278
|
+
if (!touch) return {};
|
|
279
|
+
return native
|
|
280
|
+
? { minHeight: MIN_PRESS_TARGET, delayPressIn: listRowPressDelayMs }
|
|
281
|
+
: { minHeight: MIN_PRESS_TARGET };
|
|
282
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cleanup, fireEvent, screen } from "@testing-library/react";
|
|
2
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
3
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { ShortcutCard } from "./Dashboard";
|
|
5
|
+
|
|
6
|
+
afterEach(cleanup);
|
|
7
|
+
|
|
8
|
+
describe("ShortcutCard subtitle (the launch tile One's home used to paint itself)", () => {
|
|
9
|
+
it("renders one line under the title and stays one button", () => {
|
|
10
|
+
const onClick = vi.fn();
|
|
11
|
+
renderWithProviders(
|
|
12
|
+
<ShortcutCard
|
|
13
|
+
config={{ id: "pokemon", title: "Pokemon", subtitle: "1,025 records", onClick }}
|
|
14
|
+
aria-label="Pokemon"
|
|
15
|
+
/>,
|
|
16
|
+
);
|
|
17
|
+
expect(screen.getByText("Pokemon")).toBeTruthy();
|
|
18
|
+
expect(screen.getByText("1,025 records")).toBeTruthy();
|
|
19
|
+
fireEvent.click(screen.getByRole("button", { name: "Pokemon" }));
|
|
20
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("stacks the icon above the text in the tile layout and keeps the row layout by default", () => {
|
|
24
|
+
const { container } = renderWithProviders(
|
|
25
|
+
<>
|
|
26
|
+
<ShortcutCard layout="tile" config={{ id: "a", title: "Tile", icon: <span>i</span> }} />
|
|
27
|
+
<ShortcutCard config={{ id: "b", title: "Row", icon: <span>i</span> }} />
|
|
28
|
+
</>,
|
|
29
|
+
);
|
|
30
|
+
const heads = container.querySelectorAll("[data-shortcut-layout]");
|
|
31
|
+
expect([...heads].map((h) => h.getAttribute("data-shortcut-layout"))).toEqual(["tile", "row"]);
|
|
32
|
+
expect(getComputedStyle(heads[0] as Element).flexDirection).toBe("column");
|
|
33
|
+
expect(getComputedStyle(heads[1] as Element).flexDirection).toBe("row");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("draws no subtitle line when none is given", () => {
|
|
37
|
+
renderWithProviders(<ShortcutCard config={{ id: "orders", title: "Sales Orders" }} />);
|
|
38
|
+
expect(screen.getByText("Sales Orders").parentElement?.children).toHaveLength(1);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { action } from "@multiplatform.one/storybook";
|
|
6
6
|
import { ShoppingCartIcon } from "@phosphor-icons/react";
|
|
7
7
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
8
|
-
import { YStack } from "tamagui";
|
|
8
|
+
import { XStack, YStack } from "tamagui";
|
|
9
9
|
import { ShortcutCard } from "./Dashboard";
|
|
10
10
|
|
|
11
11
|
const iconSize = 16;
|
|
@@ -58,3 +58,52 @@ export const NoCount: Story = {
|
|
|
58
58
|
</YStack>
|
|
59
59
|
),
|
|
60
60
|
};
|
|
61
|
+
|
|
62
|
+
export const WithSubtitle: Story = {
|
|
63
|
+
render: () => (
|
|
64
|
+
<YStack width={280} padding="$4">
|
|
65
|
+
<ShortcutCard
|
|
66
|
+
config={{
|
|
67
|
+
id: "orders",
|
|
68
|
+
title: "Sales Orders",
|
|
69
|
+
subtitle: "18 open",
|
|
70
|
+
icon: <ShoppingCartIcon size={iconSize} />,
|
|
71
|
+
onClick: action("shortcut:orders"),
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
</YStack>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Tile: Story = {
|
|
79
|
+
render: () => (
|
|
80
|
+
<XStack width="100%" maxWidth={390} padding="$4" gap="$3">
|
|
81
|
+
<ShortcutCard
|
|
82
|
+
layout="tile"
|
|
83
|
+
flex={1}
|
|
84
|
+
flexBasis={0}
|
|
85
|
+
minWidth={0}
|
|
86
|
+
config={{
|
|
87
|
+
id: "orders",
|
|
88
|
+
title: "Sales Orders",
|
|
89
|
+
subtitle: "Default",
|
|
90
|
+
icon: <ShoppingCartIcon size={iconSize} />,
|
|
91
|
+
onClick: action("shortcut:orders"),
|
|
92
|
+
}}
|
|
93
|
+
/>
|
|
94
|
+
<ShortcutCard
|
|
95
|
+
layout="tile"
|
|
96
|
+
flex={1}
|
|
97
|
+
flexBasis={0}
|
|
98
|
+
minWidth={0}
|
|
99
|
+
config={{
|
|
100
|
+
id: "customers",
|
|
101
|
+
title: "Customers",
|
|
102
|
+
subtitle: "63 records",
|
|
103
|
+
icon: <ShoppingCartIcon size={iconSize} />,
|
|
104
|
+
onClick: action("shortcut:customers"),
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
</XStack>
|
|
108
|
+
),
|
|
109
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Card } from "../Card";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import { SizableText, Text, XStack, YStack, type FontSizeTokens, type YStackProps } from "tamagui";
|
|
4
|
+
import { NestedIconWell, useWidgetChrome } from "./widgetChrome";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Frappe workspace shortcut: label + nested count pill.
|
|
8
|
+
*/
|
|
9
|
+
export interface ShortcutConfig {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
/** One line under the title: a record count, a hint, the current value. */
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
count?: number | string;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
color?: string;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ShortcutCardProps extends Omit<YStackProps, "children"> {
|
|
21
|
+
config: ShortcutConfig;
|
|
22
|
+
/**
|
|
23
|
+
* `row` puts the icon beside the text (a full-width shortcut). `tile` puts
|
|
24
|
+
* it above, the iOS launch tile, so a half-width tile in a phone grid keeps
|
|
25
|
+
* its whole title and subtitle line.
|
|
26
|
+
*/
|
|
27
|
+
layout?: "row" | "tile";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function ShortcutCard({ config, layout = "row", ...stackProps }: ShortcutCardProps) {
|
|
31
|
+
const { knobProps, nested, interactive } = useWidgetChrome(config.onClick);
|
|
32
|
+
const { px, box, hitSlop } = nested;
|
|
33
|
+
const tile = layout === "tile";
|
|
34
|
+
const Head = tile ? YStack : XStack;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Card
|
|
38
|
+
width="100%"
|
|
39
|
+
{...interactive}
|
|
40
|
+
hitSlop={config.onClick ? hitSlop : undefined}
|
|
41
|
+
{...stackProps}
|
|
42
|
+
>
|
|
43
|
+
<Head
|
|
44
|
+
alignItems={tile ? "flex-start" : "center"}
|
|
45
|
+
{...knobProps.gap}
|
|
46
|
+
{...({ "data-shortcut-layout": layout } as Record<string, unknown>)}
|
|
47
|
+
>
|
|
48
|
+
{config.icon ? (
|
|
49
|
+
<NestedIconWell color={config.color} box={box} px={px} radius={knobProps.borderRadius}>
|
|
50
|
+
{config.icon}
|
|
51
|
+
</NestedIconWell>
|
|
52
|
+
) : null}
|
|
53
|
+
<YStack flex={tile ? undefined : 1} alignSelf={tile ? "stretch" : undefined} minWidth={0}>
|
|
54
|
+
<SizableText
|
|
55
|
+
size={knobProps.sizeToken as FontSizeTokens}
|
|
56
|
+
{...knobProps.heading}
|
|
57
|
+
numberOfLines={1}
|
|
58
|
+
>
|
|
59
|
+
{config.title}
|
|
60
|
+
</SizableText>
|
|
61
|
+
{config.subtitle ? (
|
|
62
|
+
<Text {...knobProps.body} {...knobProps.textRole.meta} numberOfLines={1}>
|
|
63
|
+
{config.subtitle}
|
|
64
|
+
</Text>
|
|
65
|
+
) : null}
|
|
66
|
+
</YStack>
|
|
67
|
+
{config.count != null && config.count !== "" ? (
|
|
68
|
+
<XStack
|
|
69
|
+
height={px}
|
|
70
|
+
minHeight={px}
|
|
71
|
+
maxHeight={px}
|
|
72
|
+
minWidth={px}
|
|
73
|
+
paddingHorizontal="$2"
|
|
74
|
+
alignItems="center"
|
|
75
|
+
justifyContent="center"
|
|
76
|
+
backgroundColor="$color4"
|
|
77
|
+
{...knobProps.borderRadius}
|
|
78
|
+
data-nested-px={px}
|
|
79
|
+
>
|
|
80
|
+
<Text {...knobProps.label} color={knobProps.textAccentColor}>
|
|
81
|
+
{config.count}
|
|
82
|
+
</Text>
|
|
83
|
+
</XStack>
|
|
84
|
+
) : null}
|
|
85
|
+
</Head>
|
|
86
|
+
</Card>
|
|
87
|
+
);
|
|
88
|
+
}
|
package/src/views/index.ts
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IconSlot,
|
|
3
|
+
useChartPalette,
|
|
4
|
+
useReadableTextOn,
|
|
5
|
+
useResolvedKnobs,
|
|
6
|
+
} from "@multiplatform.one/theme";
|
|
7
|
+
import type { ReactNode } from "react";
|
|
8
|
+
import { YStack, type YStackProps } from "tamagui";
|
|
9
|
+
|
|
10
|
+
/** The nested control box a dashboard widget's pills and wells share. */
|
|
11
|
+
export function splitNestedControl(nested: {
|
|
12
|
+
px: number;
|
|
13
|
+
hitSlop: { top: number; bottom: number; left: number; right: number };
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
minWidth: number;
|
|
17
|
+
maxWidth: number;
|
|
18
|
+
minHeight: number;
|
|
19
|
+
maxHeight: number;
|
|
20
|
+
}) {
|
|
21
|
+
const { px, hitSlop, ...box } = nested;
|
|
22
|
+
return { px, hitSlop, box };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Dashboard widgets' shared chrome: knobs, the nested control box, press states. */
|
|
26
|
+
export function useWidgetChrome(onPress?: YStackProps["onPress"]) {
|
|
27
|
+
const resolved = useResolvedKnobs();
|
|
28
|
+
const { knobProps, control } = resolved;
|
|
29
|
+
const nested = splitNestedControl(knobProps.nestedControl);
|
|
30
|
+
const interactive = onPress
|
|
31
|
+
? {
|
|
32
|
+
cursor: "pointer" as const,
|
|
33
|
+
hoverStyle: control.hoverKnobProps,
|
|
34
|
+
pressStyle: control.pressKnobProps,
|
|
35
|
+
focusVisibleStyle: control.focusVisibleKnobProps,
|
|
36
|
+
onPress,
|
|
37
|
+
role: "button" as const,
|
|
38
|
+
}
|
|
39
|
+
: undefined;
|
|
40
|
+
return { knobProps, control, nested, interactive };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function NestedIconWell({
|
|
44
|
+
color,
|
|
45
|
+
box,
|
|
46
|
+
px,
|
|
47
|
+
radius,
|
|
48
|
+
children,
|
|
49
|
+
}: {
|
|
50
|
+
color?: string;
|
|
51
|
+
box: ReturnType<typeof splitNestedControl>["box"];
|
|
52
|
+
px: number;
|
|
53
|
+
radius: object;
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
}) {
|
|
56
|
+
const identity = useChartPalette().single;
|
|
57
|
+
const fill = color || identity;
|
|
58
|
+
const ink = useReadableTextOn(fill);
|
|
59
|
+
return (
|
|
60
|
+
<YStack
|
|
61
|
+
{...box}
|
|
62
|
+
{...radius}
|
|
63
|
+
alignItems="center"
|
|
64
|
+
justifyContent="center"
|
|
65
|
+
backgroundColor={fill as any}
|
|
66
|
+
{...{ color: ink }}
|
|
67
|
+
overflow="hidden"
|
|
68
|
+
data-nested-px={px}
|
|
69
|
+
>
|
|
70
|
+
<IconSlot icon={children} color={ink} />
|
|
71
|
+
</YStack>
|
|
72
|
+
);
|
|
73
|
+
}
|
package/types/Alert/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { GetProps, SizeTokens } from "tamagui";
|
|
3
3
|
export type AlertIntent = "info" | "success" | "warning" | "error";
|
|
4
|
+
export type AlertPlacement = "inline" | "bar";
|
|
4
5
|
export interface AlertProps extends Omit<GetProps<typeof AlertFrame>, "role" | "children"> {
|
|
5
6
|
/** Semantic intent. info rides the accent hue; the rest use the semantic ramp. */
|
|
6
7
|
intent?: AlertIntent;
|
|
@@ -16,6 +17,8 @@ export interface AlertProps extends Omit<GetProps<typeof AlertFrame>, "role" | "
|
|
|
16
17
|
actionLabel?: string;
|
|
17
18
|
/** Press handler for the convenience action button. */
|
|
18
19
|
onAction?: () => void;
|
|
20
|
+
/** Accessible name for the convenience action when the label alone is too terse. */
|
|
21
|
+
actionAccessibilityLabel?: string;
|
|
19
22
|
/** Custom secondary action slot (Primer/Polaris: at most two actions). */
|
|
20
23
|
secondaryAction?: ReactNode;
|
|
21
24
|
/** Convenience secondary action label. */
|
|
@@ -30,6 +33,12 @@ export interface AlertProps extends Omit<GetProps<typeof AlertFrame>, "role" | "
|
|
|
30
33
|
visible?: boolean;
|
|
31
34
|
/** Uncontrolled initial visibility (default true). */
|
|
32
35
|
defaultVisible?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* `inline` (default): a rounded box in the content flow. `bar`: pinned edge
|
|
38
|
+
* to edge across the top of a screen (an update waiting, offline): square
|
|
39
|
+
* corners, no stripe, one hairline along its bottom edge.
|
|
40
|
+
*/
|
|
41
|
+
placement?: AlertPlacement;
|
|
33
42
|
/**
|
|
34
43
|
* Control size token (Tamagui's own `size`, e.g. `"$3"` in a table). Below
|
|
35
44
|
* `$true` the icon and dismiss glyph draw one step smaller.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Alert/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Alert/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKxD,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKpD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEnE,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9C,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACxF,kFAAkF;IAClF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,uBAAuB;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,sDAAsD;IACtD,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,oFAAoF;IACpF,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,0EAA0E;IAC1E,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,0CAA0C;IAC1C,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,iCAAiC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAqBD,QAAA,MAAM,UAAU;;;6CAQd,CAAC;AAubH;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CAQtC;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-155: a slot that owns a thumbnail's frame (a list row's media slot)
|
|
3
|
+
* provides `false`, so thumbnails inside it draw no tile of their own. An
|
|
4
|
+
* explicit `framed` prop still wins.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ImageFramingContext: import("react").Context<boolean | undefined>;
|
|
7
|
+
//# sourceMappingURL=framing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../../../src/images/Image/framing.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,8CAAgD,CAAC"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { ImageURISource } from "react-native";
|
|
2
2
|
import type { ImageThumbnailSize } from "./types";
|
|
3
|
-
|
|
4
|
-
* LC-155: a slot that owns a thumbnail's frame (a list row's media slot)
|
|
5
|
-
* provides `false`, so thumbnails inside it draw no tile of their own. An
|
|
6
|
-
* explicit `framed` prop still wins.
|
|
7
|
-
*/
|
|
8
|
-
export declare const ImageFramingContext: import("react").Context<boolean | undefined>;
|
|
3
|
+
export { ImageFramingContext } from "./framing";
|
|
9
4
|
export declare function isThumbnailSize(size: unknown): size is ImageThumbnailSize;
|
|
10
5
|
/** Thumbnail px; below the default size token every named step draws one smaller. */
|
|
11
6
|
export declare function thumbnailPx(size: ImageThumbnailSize | number, nestedPx: number, small: boolean): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/images/Image/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/images/Image/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,kBAAkB,CAEzE;AAED,qFAAqF;AACrF,wBAAgB,WAAW,CACzB,IAAI,EAAE,kBAAkB,GAAG,MAAM,EACjC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,GACb,MAAM,CAWR;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAI5E;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO;;;;EAsBvE;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAcxD;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAaxF"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { type ReactNode } from "react";
|
|
2
2
|
import { type YStackProps } from "tamagui";
|
|
3
|
+
import { type ShortcutConfig } from "./ShortcutCard";
|
|
4
|
+
export { ShortcutCard, type ShortcutCardProps, type ShortcutConfig } from "./ShortcutCard";
|
|
3
5
|
export type CardHeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
4
6
|
/**
|
|
5
7
|
* Trend direction for KPI cards.
|
|
@@ -74,17 +76,6 @@ export interface ProgressConfig {
|
|
|
74
76
|
format?: "number" | "percent";
|
|
75
77
|
color?: string;
|
|
76
78
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Frappe workspace shortcut: label + nested count pill.
|
|
79
|
-
*/
|
|
80
|
-
export interface ShortcutConfig {
|
|
81
|
-
id: string;
|
|
82
|
-
title: string;
|
|
83
|
-
count?: number | string;
|
|
84
|
-
icon?: React.ReactNode;
|
|
85
|
-
color?: string;
|
|
86
|
-
onClick?: () => void;
|
|
87
|
-
}
|
|
88
79
|
/**
|
|
89
80
|
* Frappe link card / Polaris resource list / Grafana table-lite.
|
|
90
81
|
*/
|
|
@@ -200,10 +191,6 @@ export interface ProgressCardProps extends Omit<YStackProps, "children"> {
|
|
|
200
191
|
config: ProgressConfig;
|
|
201
192
|
}
|
|
202
193
|
export declare function ProgressCard({ config, ...stackProps }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
|
|
203
|
-
export interface ShortcutCardProps extends Omit<YStackProps, "children"> {
|
|
204
|
-
config: ShortcutConfig;
|
|
205
|
-
}
|
|
206
|
-
export declare function ShortcutCard({ config, ...stackProps }: ShortcutCardProps): import("react/jsx-runtime").JSX.Element;
|
|
207
194
|
export interface ListCardProps extends Omit<YStackProps, "children"> {
|
|
208
195
|
config: ListConfig;
|
|
209
196
|
headingLevel?: CardHeadingLevel;
|