panelui-native 0.14.0 → 0.19.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 +2 -0
- package/lib/module/components/bottom-sheet/index.js +38 -10
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/checkbox/index.js +24 -11
- package/lib/module/components/checkbox/index.js.map +1 -1
- package/lib/module/components/direction/index.js +86 -0
- package/lib/module/components/direction/index.js.map +1 -0
- package/lib/module/components/field/index.js +337 -0
- package/lib/module/components/field/index.js.map +1 -0
- package/lib/module/components/flow/flow-paths.js +378 -0
- package/lib/module/components/flow/flow-paths.js.map +1 -0
- package/lib/module/components/flow/index.js +1598 -0
- package/lib/module/components/flow/index.js.map +1 -0
- package/lib/module/components/form/index.js +77 -0
- package/lib/module/components/form/index.js.map +1 -0
- package/lib/module/components/form/use-field.js +50 -0
- package/lib/module/components/form/use-field.js.map +1 -0
- package/lib/module/components/form/use-form.js +217 -0
- package/lib/module/components/form/use-form.js.map +1 -0
- package/lib/module/components/frame/index.js +124 -22
- package/lib/module/components/frame/index.js.map +1 -1
- package/lib/module/components/message/index.js +16 -1
- package/lib/module/components/message/index.js.map +1 -1
- package/lib/module/components/otp-input/index.js +303 -0
- package/lib/module/components/otp-input/index.js.map +1 -0
- package/lib/module/components/signature/index.js +500 -0
- package/lib/module/components/signature/index.js.map +1 -0
- package/lib/module/components/soundwave/index.js +813 -0
- package/lib/module/components/soundwave/index.js.map +1 -0
- package/lib/module/components/typography/index.js +196 -5
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/module/icons/index.js +287 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +8 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +15 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/checkbox/index.d.ts +8 -0
- package/lib/typescript/src/components/checkbox/index.d.ts.map +1 -1
- package/lib/typescript/src/components/direction/index.d.ts +64 -0
- package/lib/typescript/src/components/direction/index.d.ts.map +1 -0
- package/lib/typescript/src/components/field/index.d.ts +94 -0
- package/lib/typescript/src/components/field/index.d.ts.map +1 -0
- package/lib/typescript/src/components/flow/flow-paths.d.ts +89 -0
- package/lib/typescript/src/components/flow/flow-paths.d.ts.map +1 -0
- package/lib/typescript/src/components/flow/index.d.ts +310 -0
- package/lib/typescript/src/components/flow/index.d.ts.map +1 -0
- package/lib/typescript/src/components/form/index.d.ts +64 -0
- package/lib/typescript/src/components/form/index.d.ts.map +1 -0
- package/lib/typescript/src/components/form/use-field.d.ts +16 -0
- package/lib/typescript/src/components/form/use-field.d.ts.map +1 -0
- package/lib/typescript/src/components/form/use-form.d.ts +37 -0
- package/lib/typescript/src/components/form/use-form.d.ts.map +1 -0
- package/lib/typescript/src/components/frame/index.d.ts +39 -2
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message/index.d.ts.map +1 -1
- package/lib/typescript/src/components/otp-input/index.d.ts +141 -0
- package/lib/typescript/src/components/otp-input/index.d.ts.map +1 -0
- package/lib/typescript/src/components/signature/index.d.ts +254 -0
- package/lib/typescript/src/components/signature/index.d.ts.map +1 -0
- package/lib/typescript/src/components/soundwave/index.d.ts +91 -0
- package/lib/typescript/src/components/soundwave/index.d.ts.map +1 -0
- package/lib/typescript/src/components/typography/index.d.ts +154 -1
- package/lib/typescript/src/components/typography/index.d.ts.map +1 -1
- package/lib/typescript/src/icons/index.d.ts +23 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +9 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +9 -1
- package/src/components/bottom-sheet/index.tsx +50 -12
- package/src/components/checkbox/index.tsx +40 -12
- package/src/components/direction/index.tsx +90 -0
- package/src/components/field/index.tsx +329 -0
- package/src/components/flow/flow-paths.ts +348 -0
- package/src/components/flow/index.tsx +1924 -0
- package/src/components/form/index.tsx +85 -0
- package/src/components/form/use-field.ts +65 -0
- package/src/components/form/use-form.ts +252 -0
- package/src/components/frame/index.tsx +162 -14
- package/src/components/message/index.tsx +17 -1
- package/src/components/otp-input/index.tsx +396 -0
- package/src/components/signature/index.tsx +681 -0
- package/src/components/soundwave/index.tsx +1029 -0
- package/src/components/typography/index.tsx +231 -10
- package/src/icons/index.tsx +195 -0
- package/src/index.ts +87 -0
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Typography — semantic text presets.
|
|
2
|
+
* Typography — semantic text presets, and the marks that go on them.
|
|
3
3
|
*
|
|
4
4
|
* The type scale in one place, so headings stay consistent instead of being
|
|
5
5
|
* rebuilt out of size and weight classes at each call site. Built on the Text
|
|
6
6
|
* primitive, so every preset keeps `className` passthrough and theme colours.
|
|
7
|
+
*
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Typography type="h2">Billing</Typography>
|
|
10
|
+
* <Typography>Your plan renews on the 1st.</Typography>
|
|
11
|
+
* <Typography underline>Terms of service</Typography>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* A preset sets size, weight and tracking together; the marks — `underline`,
|
|
15
|
+
* `italic`, `strike` — and `weight`, `align` and `transform` layer on top of
|
|
16
|
+
* whichever preset is in force. They are props rather than class names because
|
|
17
|
+
* the point of this component is that a screen never has to know which
|
|
18
|
+
* utilities add up to "a bolded lead paragraph".
|
|
19
|
+
*
|
|
20
|
+
* React Native draws no list markers and has no blockquote, so
|
|
21
|
+
* `Typography.List` and `Typography.Blockquote` build both out of a row and a
|
|
22
|
+
* rule — which is exactly the kind of thing this component exists to stop
|
|
23
|
+
* people rebuilding per screen.
|
|
7
24
|
*/
|
|
8
|
-
import { forwardRef } from 'react';
|
|
25
|
+
import { Children, forwardRef, type ReactNode } from 'react';
|
|
9
26
|
import { View, type Text as RNText, type ViewProps } from 'react-native';
|
|
10
27
|
import { tv, type VariantProps } from 'tailwind-variants';
|
|
11
28
|
import { Text, type TextProps } from '../../primitives/text';
|
|
29
|
+
import { cn } from '../../utils/cn';
|
|
12
30
|
|
|
13
31
|
const typographyVariants = tv({
|
|
14
32
|
base: 'text-foreground',
|
|
@@ -20,11 +38,43 @@ const typographyVariants = tv({
|
|
|
20
38
|
h4: 'text-xl font-semibold',
|
|
21
39
|
h5: 'text-lg font-semibold',
|
|
22
40
|
h6: 'text-base font-semibold',
|
|
41
|
+
/** The sentence under a heading, set larger and quieter than body. */
|
|
42
|
+
lead: 'text-xl font-normal text-muted-foreground',
|
|
23
43
|
body: 'text-base font-normal',
|
|
24
44
|
'body-sm': 'text-sm font-normal',
|
|
25
45
|
'body-xs': 'text-xs font-normal',
|
|
46
|
+
/** Body, one step up — for a number or a name that carries the row. */
|
|
47
|
+
large: 'text-lg font-semibold',
|
|
48
|
+
/** Body, one step down and tighter — captions, footnotes, meta. */
|
|
49
|
+
small: 'text-sm font-medium leading-none',
|
|
50
|
+
blockquote: 'text-base font-normal italic',
|
|
26
51
|
code: 'font-mono text-sm text-foreground',
|
|
27
52
|
},
|
|
53
|
+
weight: {
|
|
54
|
+
normal: 'font-normal',
|
|
55
|
+
medium: 'font-medium',
|
|
56
|
+
semibold: 'font-semibold',
|
|
57
|
+
bold: 'font-bold',
|
|
58
|
+
},
|
|
59
|
+
align: {
|
|
60
|
+
left: 'text-left',
|
|
61
|
+
center: 'text-center',
|
|
62
|
+
right: 'text-right',
|
|
63
|
+
},
|
|
64
|
+
transform: {
|
|
65
|
+
uppercase: 'uppercase',
|
|
66
|
+
lowercase: 'lowercase',
|
|
67
|
+
capitalize: 'capitalize',
|
|
68
|
+
},
|
|
69
|
+
underline: {
|
|
70
|
+
true: 'underline',
|
|
71
|
+
},
|
|
72
|
+
italic: {
|
|
73
|
+
true: 'italic',
|
|
74
|
+
},
|
|
75
|
+
strike: {
|
|
76
|
+
true: 'line-through',
|
|
77
|
+
},
|
|
28
78
|
muted: {
|
|
29
79
|
true: 'text-muted-foreground',
|
|
30
80
|
},
|
|
@@ -38,16 +88,38 @@ export type TypographyType = NonNullable<
|
|
|
38
88
|
VariantProps<typeof typographyVariants>['type']
|
|
39
89
|
>;
|
|
40
90
|
|
|
91
|
+
export type TypographyWeight = NonNullable<
|
|
92
|
+
VariantProps<typeof typographyVariants>['weight']
|
|
93
|
+
>;
|
|
94
|
+
|
|
41
95
|
export interface TypographyProps
|
|
42
96
|
extends Omit<TextProps, 'size' | 'weight'>,
|
|
43
97
|
VariantProps<typeof typographyVariants> {
|
|
44
98
|
className?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Overrides the weight the preset sets. This is the one to reach for when a
|
|
101
|
+
* paragraph needs a bolded run and a heading would be wrong.
|
|
102
|
+
*/
|
|
103
|
+
weight?: TypographyWeight;
|
|
104
|
+
/** Underlines the text — a link, a defined term, a signature line. */
|
|
105
|
+
underline?: boolean;
|
|
106
|
+
/** Slants the text. */
|
|
107
|
+
italic?: boolean;
|
|
108
|
+
/** Strikes the text through: an old price, a completed task. */
|
|
109
|
+
strike?: boolean;
|
|
110
|
+
/** Horizontal alignment within whatever the text is laid out in. */
|
|
111
|
+
align?: 'left' | 'center' | 'right';
|
|
112
|
+
/** Case, applied for display without changing the string underneath. */
|
|
113
|
+
transform?: 'uppercase' | 'lowercase' | 'capitalize';
|
|
45
114
|
}
|
|
46
115
|
|
|
47
116
|
/** Heading levels, for `Typography.Heading`. */
|
|
48
117
|
type HeadingType = Extract<TypographyType, 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;
|
|
49
118
|
/** Body sizes, for `Typography.Paragraph`. */
|
|
50
|
-
type ParagraphType = Extract<
|
|
119
|
+
type ParagraphType = Extract<
|
|
120
|
+
TypographyType,
|
|
121
|
+
'body' | 'body-sm' | 'body-xs' | 'lead' | 'large' | 'small'
|
|
122
|
+
>;
|
|
51
123
|
|
|
52
124
|
/** Maps a heading preset to its accessibility heading level. */
|
|
53
125
|
const HEADING_LEVEL: Record<HeadingType, number> = {
|
|
@@ -60,8 +132,25 @@ const HEADING_LEVEL: Record<HeadingType, number> = {
|
|
|
60
132
|
};
|
|
61
133
|
|
|
62
134
|
const TypographyRoot = forwardRef<RNText, TypographyProps>(
|
|
63
|
-
(
|
|
64
|
-
|
|
135
|
+
(
|
|
136
|
+
{ className, type, muted, weight, align, transform, underline, italic, strike, ...props },
|
|
137
|
+
ref
|
|
138
|
+
) => (
|
|
139
|
+
<Text
|
|
140
|
+
ref={ref}
|
|
141
|
+
className={typographyVariants({
|
|
142
|
+
type,
|
|
143
|
+
muted,
|
|
144
|
+
weight,
|
|
145
|
+
align,
|
|
146
|
+
transform,
|
|
147
|
+
underline,
|
|
148
|
+
italic,
|
|
149
|
+
strike,
|
|
150
|
+
className,
|
|
151
|
+
})}
|
|
152
|
+
{...props}
|
|
153
|
+
/>
|
|
65
154
|
)
|
|
66
155
|
);
|
|
67
156
|
TypographyRoot.displayName = 'Typography';
|
|
@@ -72,12 +161,25 @@ export interface TypographyHeadingProps extends Omit<TypographyProps, 'type'> {
|
|
|
72
161
|
|
|
73
162
|
/** Heading text, wired up with the matching accessibility heading level. */
|
|
74
163
|
const TypographyHeading = forwardRef<RNText, TypographyHeadingProps>(
|
|
75
|
-
(
|
|
164
|
+
(
|
|
165
|
+
{ className, type = 'h2', muted, weight, align, transform, underline, italic, strike, ...props },
|
|
166
|
+
ref
|
|
167
|
+
) => (
|
|
76
168
|
<Text
|
|
77
169
|
ref={ref}
|
|
78
170
|
accessibilityRole="header"
|
|
79
171
|
aria-level={HEADING_LEVEL[type]}
|
|
80
|
-
className={typographyVariants({
|
|
172
|
+
className={typographyVariants({
|
|
173
|
+
type,
|
|
174
|
+
muted,
|
|
175
|
+
weight,
|
|
176
|
+
align,
|
|
177
|
+
transform,
|
|
178
|
+
underline,
|
|
179
|
+
italic,
|
|
180
|
+
strike,
|
|
181
|
+
className,
|
|
182
|
+
})}
|
|
81
183
|
{...props}
|
|
82
184
|
/>
|
|
83
185
|
)
|
|
@@ -89,8 +191,25 @@ export interface TypographyParagraphProps extends Omit<TypographyProps, 'type'>
|
|
|
89
191
|
}
|
|
90
192
|
|
|
91
193
|
const TypographyParagraph = forwardRef<RNText, TypographyParagraphProps>(
|
|
92
|
-
(
|
|
93
|
-
|
|
194
|
+
(
|
|
195
|
+
{ className, type = 'body', muted, weight, align, transform, underline, italic, strike, ...props },
|
|
196
|
+
ref
|
|
197
|
+
) => (
|
|
198
|
+
<Text
|
|
199
|
+
ref={ref}
|
|
200
|
+
className={typographyVariants({
|
|
201
|
+
type,
|
|
202
|
+
muted,
|
|
203
|
+
weight,
|
|
204
|
+
align,
|
|
205
|
+
transform,
|
|
206
|
+
underline,
|
|
207
|
+
italic,
|
|
208
|
+
strike,
|
|
209
|
+
className,
|
|
210
|
+
})}
|
|
211
|
+
{...props}
|
|
212
|
+
/>
|
|
94
213
|
)
|
|
95
214
|
);
|
|
96
215
|
TypographyParagraph.displayName = 'Typography.Paragraph';
|
|
@@ -106,7 +225,7 @@ const TypographyCode = forwardRef<View, TypographyCodeProps & Pick<ViewProps, 't
|
|
|
106
225
|
<View
|
|
107
226
|
ref={ref}
|
|
108
227
|
testID={testID}
|
|
109
|
-
className={
|
|
228
|
+
className={cn('self-start rounded-md bg-muted px-1.5 py-1', containerClassName)}
|
|
110
229
|
>
|
|
111
230
|
<Text className={typographyVariants({ type: 'code', muted, className })} {...props} />
|
|
112
231
|
</View>
|
|
@@ -114,8 +233,110 @@ const TypographyCode = forwardRef<View, TypographyCodeProps & Pick<ViewProps, 't
|
|
|
114
233
|
);
|
|
115
234
|
TypographyCode.displayName = 'Typography.Code';
|
|
116
235
|
|
|
236
|
+
export interface TypographyBlockquoteProps extends Omit<TypographyProps, 'type'> {
|
|
237
|
+
/** Classes for the row that carries the rule. */
|
|
238
|
+
containerClassName?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* A quotation, marked by a rule down its leading edge.
|
|
243
|
+
*
|
|
244
|
+
* The rule uses `border-s`, so it moves to the right-hand side under a
|
|
245
|
+
* right-to-left `Direction` without the quote having to know.
|
|
246
|
+
*/
|
|
247
|
+
const TypographyBlockquote = forwardRef<View, TypographyBlockquoteProps>(
|
|
248
|
+
({ className, containerClassName, muted, weight, align, transform, underline, italic = true, strike, children, ...props }, ref) => (
|
|
249
|
+
<View ref={ref} className={cn('border-s-2 border-border ps-4', containerClassName)}>
|
|
250
|
+
<Text
|
|
251
|
+
className={typographyVariants({
|
|
252
|
+
type: 'blockquote',
|
|
253
|
+
muted,
|
|
254
|
+
weight,
|
|
255
|
+
align,
|
|
256
|
+
transform,
|
|
257
|
+
underline,
|
|
258
|
+
italic,
|
|
259
|
+
strike,
|
|
260
|
+
className,
|
|
261
|
+
})}
|
|
262
|
+
{...props}
|
|
263
|
+
>
|
|
264
|
+
{children}
|
|
265
|
+
</Text>
|
|
266
|
+
</View>
|
|
267
|
+
)
|
|
268
|
+
);
|
|
269
|
+
TypographyBlockquote.displayName = 'Typography.Blockquote';
|
|
270
|
+
|
|
271
|
+
export interface TypographyListProps extends ViewProps {
|
|
272
|
+
className?: string;
|
|
273
|
+
/** Numbered rather than bulleted. The numbers are drawn, not counted by CSS. */
|
|
274
|
+
ordered?: boolean;
|
|
275
|
+
children?: ReactNode;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* A bulleted or numbered list.
|
|
280
|
+
*
|
|
281
|
+
* React Native has no list markers at all, so each row is a marker and a text
|
|
282
|
+
* block side by side. The marker is drawn here rather than in the item, because
|
|
283
|
+
* only the list knows whether it is a bullet or a number — and only the list
|
|
284
|
+
* knows which number.
|
|
285
|
+
*/
|
|
286
|
+
const TypographyList = forwardRef<View, TypographyListProps>(
|
|
287
|
+
({ className, ordered = false, children, ...props }, ref) => (
|
|
288
|
+
<View ref={ref} accessibilityRole="list" className={cn('gap-2', className)} {...props}>
|
|
289
|
+
{Children.map(children, (child, index) => (
|
|
290
|
+
<View className="w-full flex-row gap-2">
|
|
291
|
+
{ordered ? (
|
|
292
|
+
<Text className="text-base text-muted-foreground">{index + 1}.</Text>
|
|
293
|
+
) : (
|
|
294
|
+
// A dot rather than "•": the character's size and baseline vary by
|
|
295
|
+
// platform font, and a view does not.
|
|
296
|
+
<View className="mt-2.5 size-1.5 shrink-0 rounded-full bg-muted-foreground" />
|
|
297
|
+
)}
|
|
298
|
+
<View className="flex-1">{child}</View>
|
|
299
|
+
</View>
|
|
300
|
+
))}
|
|
301
|
+
</View>
|
|
302
|
+
)
|
|
303
|
+
);
|
|
304
|
+
TypographyList.displayName = 'Typography.List';
|
|
305
|
+
|
|
306
|
+
export interface TypographyListItemProps extends Omit<TypographyProps, 'type'> {
|
|
307
|
+
type?: ParagraphType;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** One line of a list. The marker beside it belongs to the list. */
|
|
311
|
+
const TypographyListItem = forwardRef<RNText, TypographyListItemProps>(
|
|
312
|
+
(
|
|
313
|
+
{ className, type = 'body', muted, weight, align, transform, underline, italic, strike, ...props },
|
|
314
|
+
ref
|
|
315
|
+
) => (
|
|
316
|
+
<Text
|
|
317
|
+
ref={ref}
|
|
318
|
+
className={typographyVariants({
|
|
319
|
+
type,
|
|
320
|
+
muted,
|
|
321
|
+
weight,
|
|
322
|
+
align,
|
|
323
|
+
transform,
|
|
324
|
+
underline,
|
|
325
|
+
italic,
|
|
326
|
+
strike,
|
|
327
|
+
className,
|
|
328
|
+
})}
|
|
329
|
+
{...props}
|
|
330
|
+
/>
|
|
331
|
+
)
|
|
332
|
+
);
|
|
333
|
+
TypographyListItem.displayName = 'Typography.ListItem';
|
|
334
|
+
|
|
117
335
|
export const Typography = Object.assign(TypographyRoot, {
|
|
118
336
|
Heading: TypographyHeading,
|
|
119
337
|
Paragraph: TypographyParagraph,
|
|
120
338
|
Code: TypographyCode,
|
|
339
|
+
Blockquote: TypographyBlockquote,
|
|
340
|
+
List: TypographyList,
|
|
341
|
+
ListItem: TypographyListItem,
|
|
121
342
|
});
|
package/src/icons/index.tsx
CHANGED
|
@@ -80,6 +80,21 @@ export function CheckIcon({ size = 14, color, ...props }: IconProps) {
|
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
export function MinusIcon({ size = 14, color, ...props }: IconProps) {
|
|
84
|
+
const resolved = useResolvedColor(color, '#fff');
|
|
85
|
+
return (
|
|
86
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
87
|
+
<Path
|
|
88
|
+
d="M5 12h14"
|
|
89
|
+
stroke={resolved}
|
|
90
|
+
strokeWidth={3}
|
|
91
|
+
strokeLinecap="round"
|
|
92
|
+
strokeLinejoin="round"
|
|
93
|
+
/>
|
|
94
|
+
</Svg>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
83
98
|
export function ChevronDownIcon({ size = 16, color, ...props }: IconProps) {
|
|
84
99
|
const resolved = useResolvedColor(color, '#737373');
|
|
85
100
|
return (
|
|
@@ -510,3 +525,183 @@ export function PaperclipIcon({ size = 16, color, ...props }: IconProps) {
|
|
|
510
525
|
</Svg>
|
|
511
526
|
);
|
|
512
527
|
}
|
|
528
|
+
|
|
529
|
+
/** A capsule on a stand — a microphone, for anything voice. */
|
|
530
|
+
export function MicIcon({ size = 16, color, ...props }: IconProps) {
|
|
531
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
532
|
+
return (
|
|
533
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
534
|
+
<Path
|
|
535
|
+
d="M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3zM5 11v1a7 7 0 0 0 14 0v-1M12 19v3"
|
|
536
|
+
stroke={resolved}
|
|
537
|
+
strokeWidth={2}
|
|
538
|
+
strokeLinecap="round"
|
|
539
|
+
strokeLinejoin="round"
|
|
540
|
+
/>
|
|
541
|
+
</Svg>
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/** A filled triangle — start playback. */
|
|
546
|
+
export function PlayIcon({ size = 16, color, ...props }: IconProps) {
|
|
547
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
548
|
+
return (
|
|
549
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
550
|
+
<Path d="M7 4.5v15l13-7.5z" fill={resolved} stroke={resolved} strokeWidth={2} strokeLinejoin="round" />
|
|
551
|
+
</Svg>
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/** Two filled bars — hold playback where it is. */
|
|
556
|
+
export function PauseIcon({ size = 16, color, ...props }: IconProps) {
|
|
557
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
558
|
+
return (
|
|
559
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
560
|
+
<Path d="M8 5h2v14H8zM14 5h2v14h-2z" fill={resolved} stroke={resolved} strokeWidth={1.5} strokeLinejoin="round" />
|
|
561
|
+
</Svg>
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/** A pencil at an angle — draw, sign, edit by hand. */
|
|
566
|
+
export function PencilIcon({ size = 16, color, ...props }: IconProps) {
|
|
567
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
568
|
+
return (
|
|
569
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
570
|
+
<Path
|
|
571
|
+
d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"
|
|
572
|
+
stroke={resolved}
|
|
573
|
+
strokeWidth={2}
|
|
574
|
+
strokeLinecap="round"
|
|
575
|
+
strokeLinejoin="round"
|
|
576
|
+
/>
|
|
577
|
+
</Svg>
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/** An arrow curling anticlockwise — undo, reset, start over. */
|
|
582
|
+
export function RotateCcwIcon({ size = 16, color, ...props }: IconProps) {
|
|
583
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
584
|
+
return (
|
|
585
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
586
|
+
<Path
|
|
587
|
+
d="M3 12a9 9 0 1 0 2.64-6.36L3 8"
|
|
588
|
+
stroke={resolved}
|
|
589
|
+
strokeWidth={2}
|
|
590
|
+
strokeLinecap="round"
|
|
591
|
+
strokeLinejoin="round"
|
|
592
|
+
/>
|
|
593
|
+
<Path
|
|
594
|
+
d="M3 3v5h5"
|
|
595
|
+
stroke={resolved}
|
|
596
|
+
strokeWidth={2}
|
|
597
|
+
strokeLinecap="round"
|
|
598
|
+
strokeLinejoin="round"
|
|
599
|
+
/>
|
|
600
|
+
</Svg>
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/** A bin — discard what is there. */
|
|
605
|
+
export function TrashIcon({ size = 16, color, ...props }: IconProps) {
|
|
606
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
607
|
+
return (
|
|
608
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
609
|
+
<Path
|
|
610
|
+
d="M4 7h16M10 4h4M6 7l1 13h10l1-13"
|
|
611
|
+
stroke={resolved}
|
|
612
|
+
strokeWidth={2}
|
|
613
|
+
strokeLinecap="round"
|
|
614
|
+
strokeLinejoin="round"
|
|
615
|
+
/>
|
|
616
|
+
</Svg>
|
|
617
|
+
);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/** An arrow into a tray — save the thing to a file. */
|
|
621
|
+
export function DownloadIcon({ size = 16, color, ...props }: IconProps) {
|
|
622
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
623
|
+
return (
|
|
624
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
625
|
+
<Path
|
|
626
|
+
d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"
|
|
627
|
+
stroke={resolved}
|
|
628
|
+
strokeWidth={2}
|
|
629
|
+
strokeLinecap="round"
|
|
630
|
+
strokeLinejoin="round"
|
|
631
|
+
/>
|
|
632
|
+
</Svg>
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/** A cross of two strokes — zoom in, add. Pairs with MinusIcon. */
|
|
637
|
+
export function PlusIcon({ size = 16, color, ...props }: IconProps) {
|
|
638
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
639
|
+
return (
|
|
640
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
641
|
+
<Path
|
|
642
|
+
d="M12 5v14M5 12h14"
|
|
643
|
+
stroke={resolved}
|
|
644
|
+
strokeWidth={2}
|
|
645
|
+
strokeLinecap="round"
|
|
646
|
+
/>
|
|
647
|
+
</Svg>
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/** Four corners pushing outward — fit everything into view. */
|
|
652
|
+
export function MaximizeIcon({ size = 16, color, ...props }: IconProps) {
|
|
653
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
654
|
+
return (
|
|
655
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
656
|
+
<Path
|
|
657
|
+
d="M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5"
|
|
658
|
+
stroke={resolved}
|
|
659
|
+
strokeWidth={2}
|
|
660
|
+
strokeLinecap="round"
|
|
661
|
+
strokeLinejoin="round"
|
|
662
|
+
/>
|
|
663
|
+
</Svg>
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/** A closed padlock — the thing behind it cannot be moved. */
|
|
668
|
+
export function LockIcon({ size = 16, color, ...props }: IconProps) {
|
|
669
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
670
|
+
return (
|
|
671
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
672
|
+
<Path
|
|
673
|
+
d="M5 11h14v10H5z"
|
|
674
|
+
stroke={resolved}
|
|
675
|
+
strokeWidth={2}
|
|
676
|
+
strokeLinejoin="round"
|
|
677
|
+
/>
|
|
678
|
+
<Path
|
|
679
|
+
d="M8 11V7a4 4 0 0 1 8 0v4"
|
|
680
|
+
stroke={resolved}
|
|
681
|
+
strokeWidth={2}
|
|
682
|
+
strokeLinecap="round"
|
|
683
|
+
/>
|
|
684
|
+
</Svg>
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/** The same padlock with its shackle swung open — freely movable. */
|
|
689
|
+
export function UnlockIcon({ size = 16, color, ...props }: IconProps) {
|
|
690
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
691
|
+
return (
|
|
692
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
693
|
+
<Path
|
|
694
|
+
d="M5 11h14v10H5z"
|
|
695
|
+
stroke={resolved}
|
|
696
|
+
strokeWidth={2}
|
|
697
|
+
strokeLinejoin="round"
|
|
698
|
+
/>
|
|
699
|
+
<Path
|
|
700
|
+
d="M8 11V7a4 4 0 0 1 7.5-2"
|
|
701
|
+
stroke={resolved}
|
|
702
|
+
strokeWidth={2}
|
|
703
|
+
strokeLinecap="round"
|
|
704
|
+
/>
|
|
705
|
+
</Svg>
|
|
706
|
+
);
|
|
707
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -92,6 +92,36 @@ export {
|
|
|
92
92
|
type DialogProps,
|
|
93
93
|
type DialogContentProps,
|
|
94
94
|
} from './components/dialog';
|
|
95
|
+
export {
|
|
96
|
+
Soundwave,
|
|
97
|
+
type SoundwaveProps,
|
|
98
|
+
type SoundwaveState,
|
|
99
|
+
type SoundwaveVariant,
|
|
100
|
+
} from './components/soundwave';
|
|
101
|
+
export {
|
|
102
|
+
Direction,
|
|
103
|
+
useDirection,
|
|
104
|
+
type DirectionProps,
|
|
105
|
+
type DirectionValue,
|
|
106
|
+
} from './components/direction';
|
|
107
|
+
export {
|
|
108
|
+
Flow,
|
|
109
|
+
type FlowProps,
|
|
110
|
+
type FlowNodeProps,
|
|
111
|
+
type FlowHandleProps,
|
|
112
|
+
type FlowEdgeProps,
|
|
113
|
+
type FlowGroupProps,
|
|
114
|
+
type FlowBackgroundProps,
|
|
115
|
+
type FlowControlsProps,
|
|
116
|
+
type FlowMiniMapProps,
|
|
117
|
+
type FlowConnection,
|
|
118
|
+
type FlowViewport,
|
|
119
|
+
type FlowNodePosition,
|
|
120
|
+
type FlowEdgeVariant,
|
|
121
|
+
type FlowSide,
|
|
122
|
+
type FlowRect,
|
|
123
|
+
type FlowPoint,
|
|
124
|
+
} from './components/flow';
|
|
95
125
|
export {
|
|
96
126
|
Frame,
|
|
97
127
|
type FrameProps,
|
|
@@ -99,6 +129,11 @@ export {
|
|
|
99
129
|
type FramePanelProps,
|
|
100
130
|
type FrameRowProps,
|
|
101
131
|
type FrameSectionProps,
|
|
132
|
+
type FrameHeaderProps,
|
|
133
|
+
type FrameActionProps,
|
|
134
|
+
type FrameMediaProps,
|
|
135
|
+
type FrameContentProps,
|
|
136
|
+
type FrameActionsProps,
|
|
102
137
|
type FrameVariant,
|
|
103
138
|
} from './components/frame';
|
|
104
139
|
export {
|
|
@@ -155,6 +190,34 @@ export {
|
|
|
155
190
|
type EmptyStateProps,
|
|
156
191
|
type EmptyStateMediaProps,
|
|
157
192
|
} from './components/empty-state';
|
|
193
|
+
export {
|
|
194
|
+
Field,
|
|
195
|
+
type FieldProps,
|
|
196
|
+
type FieldContentProps,
|
|
197
|
+
type FieldLabelProps,
|
|
198
|
+
type FieldDescriptionProps,
|
|
199
|
+
type FieldErrorProps,
|
|
200
|
+
type FieldSetProps,
|
|
201
|
+
type FieldLegendProps,
|
|
202
|
+
type FieldGroupProps,
|
|
203
|
+
type FieldSeparatorProps,
|
|
204
|
+
type FieldTitleProps,
|
|
205
|
+
} from './components/field';
|
|
206
|
+
export {
|
|
207
|
+
Form,
|
|
208
|
+
useForm,
|
|
209
|
+
useField,
|
|
210
|
+
type FormProps,
|
|
211
|
+
type FormFieldProps,
|
|
212
|
+
type FormApi,
|
|
213
|
+
type FieldErrors,
|
|
214
|
+
type FieldTouched,
|
|
215
|
+
type FieldState,
|
|
216
|
+
type UseFormOptions,
|
|
217
|
+
type Validator,
|
|
218
|
+
type FormFieldRenderProps,
|
|
219
|
+
type UseFieldOptions,
|
|
220
|
+
} from './components/form';
|
|
158
221
|
export { Input, type InputProps } from './components/input';
|
|
159
222
|
export {
|
|
160
223
|
InputGroup,
|
|
@@ -162,6 +225,7 @@ export {
|
|
|
162
225
|
type InputGroupInputProps,
|
|
163
226
|
type InputGroupDecoratorProps,
|
|
164
227
|
} from './components/input-group';
|
|
228
|
+
export { OtpInput, type OtpInputProps } from './components/otp-input';
|
|
165
229
|
export {
|
|
166
230
|
Item,
|
|
167
231
|
type ItemProps,
|
|
@@ -243,6 +307,17 @@ export {
|
|
|
243
307
|
type ScrollFadeProps,
|
|
244
308
|
} from './components/scroll-fade';
|
|
245
309
|
export { Separator, type SeparatorProps } from './components/separator';
|
|
310
|
+
export {
|
|
311
|
+
Signature,
|
|
312
|
+
hasSignatureFileSystem,
|
|
313
|
+
hasSignatureRaster,
|
|
314
|
+
type SignatureProps,
|
|
315
|
+
type SignatureHandle,
|
|
316
|
+
type SignatureFile,
|
|
317
|
+
type SignatureSaveOptions,
|
|
318
|
+
type SignatureToolbarProps,
|
|
319
|
+
type SignatureButtonProps,
|
|
320
|
+
} from './components/signature';
|
|
246
321
|
export { Shimmer, type ShimmerProps } from './components/shimmer';
|
|
247
322
|
export {
|
|
248
323
|
ScrollText,
|
|
@@ -319,23 +394,35 @@ export {
|
|
|
319
394
|
ChevronDownIcon,
|
|
320
395
|
ChevronLeftIcon,
|
|
321
396
|
ChevronRightIcon,
|
|
397
|
+
DownloadIcon,
|
|
322
398
|
FacebookIcon,
|
|
323
399
|
FileIcon,
|
|
324
400
|
GoogleIcon,
|
|
325
401
|
IconColorProvider,
|
|
326
402
|
InfoIcon,
|
|
327
403
|
ImageIcon,
|
|
404
|
+
LockIcon,
|
|
405
|
+
MaximizeIcon,
|
|
406
|
+
MicIcon,
|
|
407
|
+
MinusIcon,
|
|
328
408
|
MoonIcon,
|
|
329
409
|
PackageIcon,
|
|
330
410
|
PaperclipIcon,
|
|
411
|
+
PauseIcon,
|
|
412
|
+
PencilIcon,
|
|
413
|
+
PlayIcon,
|
|
414
|
+
PlusIcon,
|
|
331
415
|
PlusSquareIcon,
|
|
332
416
|
ReceiptIcon,
|
|
417
|
+
RotateCcwIcon,
|
|
333
418
|
SearchIcon,
|
|
334
419
|
SendIcon,
|
|
335
420
|
ShareNodesIcon,
|
|
336
421
|
ShieldAlertIcon,
|
|
337
422
|
ShieldCheckIcon,
|
|
338
423
|
SunIcon,
|
|
424
|
+
TrashIcon,
|
|
425
|
+
UnlockIcon,
|
|
339
426
|
XIcon,
|
|
340
427
|
useIconColor,
|
|
341
428
|
type IconProps,
|