panelui-native 0.4.0 → 0.5.3
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 +16 -8
- package/lib/module/components/accordion/index.js +312 -0
- package/lib/module/components/accordion/index.js.map +1 -0
- package/lib/module/components/avatar/index.js +58 -17
- package/lib/module/components/avatar/index.js.map +1 -1
- package/lib/module/components/badge/index.js +26 -5
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/button/index.js +51 -19
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/checkbox/index.js +42 -14
- package/lib/module/components/checkbox/index.js.map +1 -1
- package/lib/module/components/frame/index.js +64 -13
- package/lib/module/components/frame/index.js.map +1 -1
- package/lib/module/components/timeline/index.js +658 -0
- package/lib/module/components/timeline/index.js.map +1 -0
- package/lib/module/components/toast/index.js +145 -55
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/icons/index.js +388 -27
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/accordion/index.d.ts +56 -0
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -0
- package/lib/typescript/src/components/avatar/index.d.ts +8 -1
- package/lib/typescript/src/components/avatar/index.d.ts.map +1 -1
- package/lib/typescript/src/components/badge/index.d.ts +38 -0
- package/lib/typescript/src/components/badge/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts +18 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/checkbox/index.d.ts +42 -0
- package/lib/typescript/src/components/checkbox/index.d.ts.map +1 -1
- package/lib/typescript/src/components/frame/index.d.ts +39 -5
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
- package/lib/typescript/src/components/timeline/index.d.ts +96 -0
- package/lib/typescript/src/components/timeline/index.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/icons/index.d.ts +38 -3
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/accordion/index.tsx +344 -0
- package/src/components/avatar/index.tsx +68 -20
- package/src/components/badge/index.tsx +35 -6
- package/src/components/button/index.tsx +63 -20
- package/src/components/checkbox/index.tsx +49 -11
- package/src/components/frame/index.tsx +101 -31
- package/src/components/timeline/index.tsx +482 -0
- package/src/components/toast/index.tsx +166 -45
- package/src/icons/index.tsx +292 -27
- package/src/index.ts +38 -1
package/src/icons/index.tsx
CHANGED
|
@@ -7,17 +7,54 @@
|
|
|
7
7
|
* - Filled 16×16 status icons for Alert and Toast indicators.
|
|
8
8
|
* Adapted from: heroui-inc/heroui-native src/components/alert/{default,success,warning}-icon.tsx
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Every icon resolves its colour in the same order: an explicit `color` prop,
|
|
11
|
+
* then the colour inherited from an enclosing `IconColorProvider`, then its
|
|
12
|
+
* own fallback. Coloured surfaces such as Button provide the foreground that
|
|
13
|
+
* reads against them, so icons follow the theme without callers hardcoding a
|
|
14
|
+
* hex — which breaks the moment the theme inverts.
|
|
15
|
+
*
|
|
16
|
+
* Brand marks (Google, Facebook, Apple) are the exception: they carry their
|
|
17
|
+
* own colours and ignore the context.
|
|
13
18
|
*/
|
|
14
|
-
import
|
|
19
|
+
import { createContext, useContext, type ReactNode } from 'react';
|
|
20
|
+
import Svg, { Circle, G, Path, type SvgProps } from 'react-native-svg';
|
|
15
21
|
|
|
16
22
|
export interface IconProps extends SvgProps {
|
|
17
23
|
size?: number;
|
|
18
24
|
color?: string;
|
|
19
25
|
}
|
|
20
26
|
|
|
27
|
+
/**
|
|
28
|
+
* The colour icons inherit when they are not given one explicitly.
|
|
29
|
+
*
|
|
30
|
+
* Coloured surfaces (Button, and anything else that paints its own
|
|
31
|
+
* background) provide the foreground that reads against them, so an icon
|
|
32
|
+
* dropped into one follows the theme without the caller hardcoding a hex —
|
|
33
|
+
* which is what breaks the moment the theme inverts.
|
|
34
|
+
*/
|
|
35
|
+
const IconColorContext = createContext<string | undefined>(undefined);
|
|
36
|
+
|
|
37
|
+
export function IconColorProvider({
|
|
38
|
+
color,
|
|
39
|
+
children,
|
|
40
|
+
}: {
|
|
41
|
+
color: string | undefined;
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
}) {
|
|
44
|
+
return <IconColorContext.Provider value={color}>{children}</IconColorContext.Provider>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The inherited icon colour, if a surface is providing one. */
|
|
48
|
+
export function useIconColor(): string | undefined {
|
|
49
|
+
return useContext(IconColorContext);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Resolves an icon's colour: explicit prop, then inherited, then fallback. */
|
|
53
|
+
function useResolvedColor(explicit: string | undefined, fallback: string): string {
|
|
54
|
+
const inherited = useIconColor();
|
|
55
|
+
return explicit ?? inherited ?? fallback;
|
|
56
|
+
}
|
|
57
|
+
|
|
21
58
|
/** Props for icons that must never be announced by a screen reader. */
|
|
22
59
|
const decorative = {
|
|
23
60
|
accessibilityElementsHidden: true,
|
|
@@ -28,12 +65,13 @@ const decorative = {
|
|
|
28
65
|
/* Stroked chrome icons */
|
|
29
66
|
/* -------------------------------------------------------------------------- */
|
|
30
67
|
|
|
31
|
-
export function CheckIcon({ size = 14, color
|
|
68
|
+
export function CheckIcon({ size = 14, color, ...props }: IconProps) {
|
|
69
|
+
const resolved = useResolvedColor(color, '#fff');
|
|
32
70
|
return (
|
|
33
71
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
34
72
|
<Path
|
|
35
73
|
d="M20 6 9 17l-5-5"
|
|
36
|
-
stroke={
|
|
74
|
+
stroke={resolved}
|
|
37
75
|
strokeWidth={3}
|
|
38
76
|
strokeLinecap="round"
|
|
39
77
|
strokeLinejoin="round"
|
|
@@ -42,12 +80,13 @@ export function CheckIcon({ size = 14, color = '#fff', ...props }: IconProps) {
|
|
|
42
80
|
);
|
|
43
81
|
}
|
|
44
82
|
|
|
45
|
-
export function ChevronDownIcon({ size = 16, color
|
|
83
|
+
export function ChevronDownIcon({ size = 16, color, ...props }: IconProps) {
|
|
84
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
46
85
|
return (
|
|
47
86
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
48
87
|
<Path
|
|
49
88
|
d="m6 9 6 6 6-6"
|
|
50
|
-
stroke={
|
|
89
|
+
stroke={resolved}
|
|
51
90
|
strokeWidth={2}
|
|
52
91
|
strokeLinecap="round"
|
|
53
92
|
strokeLinejoin="round"
|
|
@@ -56,12 +95,13 @@ export function ChevronDownIcon({ size = 16, color = '#737373', ...props }: Icon
|
|
|
56
95
|
);
|
|
57
96
|
}
|
|
58
97
|
|
|
59
|
-
export function ChevronLeftIcon({ size = 16, color
|
|
98
|
+
export function ChevronLeftIcon({ size = 16, color, ...props }: IconProps) {
|
|
99
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
60
100
|
return (
|
|
61
101
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
62
102
|
<Path
|
|
63
103
|
d="m15 18-6-6 6-6"
|
|
64
|
-
stroke={
|
|
104
|
+
stroke={resolved}
|
|
65
105
|
strokeWidth={2}
|
|
66
106
|
strokeLinecap="round"
|
|
67
107
|
strokeLinejoin="round"
|
|
@@ -70,12 +110,13 @@ export function ChevronLeftIcon({ size = 16, color = '#737373', ...props }: Icon
|
|
|
70
110
|
);
|
|
71
111
|
}
|
|
72
112
|
|
|
73
|
-
export function ChevronRightIcon({ size = 16, color
|
|
113
|
+
export function ChevronRightIcon({ size = 16, color, ...props }: IconProps) {
|
|
114
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
74
115
|
return (
|
|
75
116
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
76
117
|
<Path
|
|
77
118
|
d="m9 18 6-6-6-6"
|
|
78
|
-
stroke={
|
|
119
|
+
stroke={resolved}
|
|
79
120
|
strokeWidth={2}
|
|
80
121
|
strokeLinecap="round"
|
|
81
122
|
strokeLinejoin="round"
|
|
@@ -84,12 +125,13 @@ export function ChevronRightIcon({ size = 16, color = '#737373', ...props }: Ico
|
|
|
84
125
|
);
|
|
85
126
|
}
|
|
86
127
|
|
|
87
|
-
export function XIcon({ size = 16, color
|
|
128
|
+
export function XIcon({ size = 16, color, ...props }: IconProps) {
|
|
129
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
88
130
|
return (
|
|
89
131
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
90
132
|
<Path
|
|
91
133
|
d="M18 6 6 18M6 6l12 12"
|
|
92
|
-
stroke={
|
|
134
|
+
stroke={resolved}
|
|
93
135
|
strokeWidth={2}
|
|
94
136
|
strokeLinecap="round"
|
|
95
137
|
strokeLinejoin="round"
|
|
@@ -98,13 +140,14 @@ export function XIcon({ size = 16, color = '#737373', ...props }: IconProps) {
|
|
|
98
140
|
);
|
|
99
141
|
}
|
|
100
142
|
|
|
101
|
-
export function SearchIcon({ size = 16, color
|
|
143
|
+
export function SearchIcon({ size = 16, color, ...props }: IconProps) {
|
|
144
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
102
145
|
return (
|
|
103
146
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
104
|
-
<Circle cx={11} cy={11} r={8} stroke={
|
|
147
|
+
<Circle cx={11} cy={11} r={8} stroke={resolved} strokeWidth={2} />
|
|
105
148
|
<Path
|
|
106
149
|
d="m21 21-4.3-4.3"
|
|
107
|
-
stroke={
|
|
150
|
+
stroke={resolved}
|
|
108
151
|
strokeWidth={2}
|
|
109
152
|
strokeLinecap="round"
|
|
110
153
|
strokeLinejoin="round"
|
|
@@ -113,12 +156,13 @@ export function SearchIcon({ size = 16, color = '#737373', ...props }: IconProps
|
|
|
113
156
|
);
|
|
114
157
|
}
|
|
115
158
|
|
|
116
|
-
export function ArrowUpRightIcon({ size = 20, color
|
|
159
|
+
export function ArrowUpRightIcon({ size = 20, color, ...props }: IconProps) {
|
|
160
|
+
const resolved = useResolvedColor(color, '#fff');
|
|
117
161
|
return (
|
|
118
162
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
119
163
|
<Path
|
|
120
164
|
d="M7 17 17 7M8 7h9v9"
|
|
121
|
-
stroke={
|
|
165
|
+
stroke={resolved}
|
|
122
166
|
strokeWidth={2}
|
|
123
167
|
strokeLinecap="round"
|
|
124
168
|
strokeLinejoin="round"
|
|
@@ -127,13 +171,14 @@ export function ArrowUpRightIcon({ size = 20, color = '#fff', ...props }: IconPr
|
|
|
127
171
|
);
|
|
128
172
|
}
|
|
129
173
|
|
|
130
|
-
export function SunIcon({ size = 18, color
|
|
174
|
+
export function SunIcon({ size = 18, color, ...props }: IconProps) {
|
|
175
|
+
const resolved = useResolvedColor(color, '#f5f5f5');
|
|
131
176
|
return (
|
|
132
177
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
133
|
-
<Circle cx={12} cy={12} r={4} stroke={
|
|
178
|
+
<Circle cx={12} cy={12} r={4} stroke={resolved} strokeWidth={2} />
|
|
134
179
|
<Path
|
|
135
180
|
d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"
|
|
136
|
-
stroke={
|
|
181
|
+
stroke={resolved}
|
|
137
182
|
strokeWidth={2}
|
|
138
183
|
strokeLinecap="round"
|
|
139
184
|
/>
|
|
@@ -141,12 +186,13 @@ export function SunIcon({ size = 18, color = '#f5f5f5', ...props }: IconProps) {
|
|
|
141
186
|
);
|
|
142
187
|
}
|
|
143
188
|
|
|
144
|
-
export function MoonIcon({ size = 18, color
|
|
189
|
+
export function MoonIcon({ size = 18, color, ...props }: IconProps) {
|
|
190
|
+
const resolved = useResolvedColor(color, '#262626');
|
|
145
191
|
return (
|
|
146
192
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
147
193
|
<Path
|
|
148
194
|
d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79"
|
|
149
|
-
stroke={
|
|
195
|
+
stroke={resolved}
|
|
150
196
|
strokeWidth={2}
|
|
151
197
|
strokeLinecap="round"
|
|
152
198
|
strokeLinejoin="round"
|
|
@@ -161,8 +207,9 @@ export function MoonIcon({ size = 18, color = '#262626', ...props }: IconProps)
|
|
|
161
207
|
|
|
162
208
|
/** Info circle. Used for `default`, `info` and `destructive` status. */
|
|
163
209
|
export function InfoIcon({ size = 20, color, ...props }: IconProps) {
|
|
210
|
+
const resolved = useResolvedColor(color, 'currentColor');
|
|
164
211
|
return (
|
|
165
|
-
<Svg width={size} height={size} viewBox="0 0 16 16" fill={
|
|
212
|
+
<Svg width={size} height={size} viewBox="0 0 16 16" fill={resolved} {...decorative} {...props}>
|
|
166
213
|
<Path
|
|
167
214
|
d="M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-9.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-.25 3a.75.75 0 0 0-1.5 0V11a.75.75 0 0 0 1.5 0z"
|
|
168
215
|
fillRule="evenodd"
|
|
@@ -174,8 +221,9 @@ export function InfoIcon({ size = 20, color, ...props }: IconProps) {
|
|
|
174
221
|
|
|
175
222
|
/** Check circle. Used for `success` status. */
|
|
176
223
|
export function CheckCircleIcon({ size = 20, color, ...props }: IconProps) {
|
|
224
|
+
const resolved = useResolvedColor(color, 'currentColor');
|
|
177
225
|
return (
|
|
178
|
-
<Svg width={size} height={size} viewBox="0 0 16 16" fill={
|
|
226
|
+
<Svg width={size} height={size} viewBox="0 0 16 16" fill={resolved} {...decorative} {...props}>
|
|
179
227
|
<Path
|
|
180
228
|
d="M13.5 8a5.5 5.5 0 1 1-11 0a5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0m-3.9-1.55a.75.75 0 1 0-1.2-.9L7.419 8.858L6.03 7.47a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.13-.08z"
|
|
181
229
|
fillRule="evenodd"
|
|
@@ -187,8 +235,9 @@ export function CheckCircleIcon({ size = 20, color, ...props }: IconProps) {
|
|
|
187
235
|
|
|
188
236
|
/** Warning triangle. Used for `warning` status. */
|
|
189
237
|
export function AlertTriangleIcon({ size = 20, color, ...props }: IconProps) {
|
|
238
|
+
const resolved = useResolvedColor(color, 'currentColor');
|
|
190
239
|
return (
|
|
191
|
-
<Svg width={size} height={size} viewBox="0 0 16 16" fill={
|
|
240
|
+
<Svg width={size} height={size} viewBox="0 0 16 16" fill={resolved} {...decorative} {...props}>
|
|
192
241
|
<Path
|
|
193
242
|
d="M7.134 2.994L2.217 11.5a1 1 0 0 0 .866 1.5h9.834a1 1 0 0 0 .866-1.5L8.866 2.993a1 1 0 0 0-1.732 0m3.03-.75c-.962-1.665-3.366-1.665-4.329 0L.918 10.749c-.963 1.666.24 3.751 2.165 3.751h9.834c1.925 0 3.128-2.085 2.164-3.751zM8 5a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0v-2A.75.75 0 0 1 8 5m1 5.75a1 1 0 1 1-2 0a1 1 0 0 1 2 0"
|
|
194
243
|
fillRule="evenodd"
|
|
@@ -197,3 +246,219 @@ export function AlertTriangleIcon({ size = 20, color, ...props }: IconProps) {
|
|
|
197
246
|
</Svg>
|
|
198
247
|
);
|
|
199
248
|
}
|
|
249
|
+
|
|
250
|
+
/* -------------------------------------------------------------------------- */
|
|
251
|
+
/* Brand marks */
|
|
252
|
+
/* -------------------------------------------------------------------------- */
|
|
253
|
+
|
|
254
|
+
/*
|
|
255
|
+
* These keep their official colours and so opt out of the icon colour
|
|
256
|
+
* context — recolouring a brand mark to match a button is a trademark
|
|
257
|
+
* problem, not a theming one.
|
|
258
|
+
*/
|
|
259
|
+
|
|
260
|
+
/** Google "G", in the four official brand colours. */
|
|
261
|
+
export function GoogleIcon({ size = 18, ...props }: Omit<IconProps, 'color'>) {
|
|
262
|
+
return (
|
|
263
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" {...decorative} {...props}>
|
|
264
|
+
<G>
|
|
265
|
+
<Path
|
|
266
|
+
fill="#4285F4"
|
|
267
|
+
d="M23.52 12.27c0-.79-.07-1.54-.2-2.27H12v4.51h6.47a5.53 5.53 0 0 1-2.4 3.63v3h3.88c2.27-2.09 3.57-5.17 3.57-8.87"
|
|
268
|
+
/>
|
|
269
|
+
<Path
|
|
270
|
+
fill="#34A853"
|
|
271
|
+
d="M12 24c3.24 0 5.96-1.08 7.95-2.91l-3.88-3.01c-1.08.72-2.45 1.15-4.07 1.15-3.13 0-5.78-2.11-6.73-4.96H1.29v3.11A12 12 0 0 0 12 24"
|
|
272
|
+
/>
|
|
273
|
+
<Path
|
|
274
|
+
fill="#FBBC05"
|
|
275
|
+
d="M5.27 14.27a7.2 7.2 0 0 1 0-4.54V6.62H1.29a12 12 0 0 0 0 10.76z"
|
|
276
|
+
/>
|
|
277
|
+
<Path
|
|
278
|
+
fill="#EA4335"
|
|
279
|
+
d="M12 4.75c1.77 0 3.35.61 4.6 1.8l3.44-3.44C17.95 1.18 15.24 0 12 0A12 12 0 0 0 1.29 6.62l3.98 3.11C6.22 6.86 8.87 4.75 12 4.75"
|
|
280
|
+
/>
|
|
281
|
+
</G>
|
|
282
|
+
</Svg>
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** Facebook "f" mark. */
|
|
287
|
+
export function FacebookIcon({ size = 18, ...props }: Omit<IconProps, 'color'>) {
|
|
288
|
+
return (
|
|
289
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" {...decorative} {...props}>
|
|
290
|
+
<Path
|
|
291
|
+
fill="#1877F2"
|
|
292
|
+
d="M24 12.07C24 5.4 18.63 0 12 0S0 5.4 0 12.07C0 18.1 4.39 23.09 10.13 24v-8.44H7.08v-3.49h3.05V9.41c0-3.02 1.79-4.69 4.53-4.69 1.31 0 2.68.24 2.68.24v2.97h-1.51c-1.49 0-1.96.93-1.96 1.89v2.25h3.33l-.53 3.49h-2.8V24C19.61 23.09 24 18.1 24 12.07"
|
|
293
|
+
/>
|
|
294
|
+
</Svg>
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Apple mark. Monochrome by design, so unlike the other brand marks it does
|
|
300
|
+
* follow the icon colour context — Apple's guidelines require it to match the
|
|
301
|
+
* button's text colour.
|
|
302
|
+
*/
|
|
303
|
+
export function AppleIcon({ size = 18, color, ...props }: IconProps) {
|
|
304
|
+
const resolved = useResolvedColor(color, '#000000');
|
|
305
|
+
return (
|
|
306
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" {...decorative} {...props}>
|
|
307
|
+
<Path
|
|
308
|
+
fill={resolved}
|
|
309
|
+
d="M17.05 12.54c-.03-2.85 2.33-4.22 2.43-4.29-1.32-1.94-3.38-2.2-4.11-2.23-1.75-.18-3.42 1.03-4.31 1.03-.89 0-2.26-1.01-3.72-.98-1.91.03-3.68 1.11-4.66 2.82-1.99 3.45-.51 8.55 1.42 11.35.95 1.37 2.07 2.91 3.55 2.85 1.43-.06 1.97-.92 3.69-.92 1.72 0 2.21.92 3.72.89 1.54-.03 2.51-1.39 3.44-2.77 1.09-1.59 1.53-3.13 1.56-3.21-.03-.01-2.99-1.15-3.01-4.54M14.27 4.2c.79-.96 1.32-2.28 1.17-3.6-1.14.05-2.51.76-3.32 1.71-.73.85-1.37 2.2-1.2 3.5 1.27.1 2.57-.65 3.35-1.61"
|
|
310
|
+
/>
|
|
311
|
+
</Svg>
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* -------------------------------------------------------------------------- */
|
|
316
|
+
/* Event icons (Timeline and other status surfaces) */
|
|
317
|
+
/* -------------------------------------------------------------------------- */
|
|
318
|
+
|
|
319
|
+
export function PlusSquareIcon({ size = 16, color, ...props }: IconProps) {
|
|
320
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
321
|
+
return (
|
|
322
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
323
|
+
<Path
|
|
324
|
+
d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zM12 8v8M8 12h8"
|
|
325
|
+
stroke={resolved}
|
|
326
|
+
strokeWidth={2}
|
|
327
|
+
strokeLinecap="round"
|
|
328
|
+
strokeLinejoin="round"
|
|
329
|
+
/>
|
|
330
|
+
</Svg>
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/** Three connected nodes — a branch, a share, a fan-out. */
|
|
335
|
+
export function ShareNodesIcon({ size = 16, color, ...props }: IconProps) {
|
|
336
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
337
|
+
return (
|
|
338
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
339
|
+
<Circle cx={18} cy={5} r={2.5} stroke={resolved} strokeWidth={2} />
|
|
340
|
+
<Circle cx={6} cy={12} r={2.5} stroke={resolved} strokeWidth={2} />
|
|
341
|
+
<Circle cx={18} cy={19} r={2.5} stroke={resolved} strokeWidth={2} />
|
|
342
|
+
<Path
|
|
343
|
+
d="m8.6 10.7 6.8-4M8.6 13.3l6.8 4"
|
|
344
|
+
stroke={resolved}
|
|
345
|
+
strokeWidth={2}
|
|
346
|
+
strokeLinecap="round"
|
|
347
|
+
/>
|
|
348
|
+
</Svg>
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/** Shield with an exclamation — a tripped guardrail. */
|
|
353
|
+
export function ShieldAlertIcon({ size = 16, color, ...props }: IconProps) {
|
|
354
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
355
|
+
return (
|
|
356
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
357
|
+
<Path
|
|
358
|
+
d="M12 2.5 4.5 5.5v6c0 4.6 3.2 8.6 7.5 10 4.3-1.4 7.5-5.4 7.5-10v-6z"
|
|
359
|
+
stroke={resolved}
|
|
360
|
+
strokeWidth={2}
|
|
361
|
+
strokeLinejoin="round"
|
|
362
|
+
/>
|
|
363
|
+
<Path d="M12 8v4" stroke={resolved} strokeWidth={2} strokeLinecap="round" />
|
|
364
|
+
<Circle cx={12} cy={15.5} r={1} fill={resolved} />
|
|
365
|
+
</Svg>
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/** Shield with a check — a passed verification. */
|
|
370
|
+
export function ShieldCheckIcon({ size = 16, color, ...props }: IconProps) {
|
|
371
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
372
|
+
return (
|
|
373
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
374
|
+
<Path
|
|
375
|
+
d="M12 2.5 4.5 5.5v6c0 4.6 3.2 8.6 7.5 10 4.3-1.4 7.5-5.4 7.5-10v-6z"
|
|
376
|
+
stroke={resolved}
|
|
377
|
+
strokeWidth={2}
|
|
378
|
+
strokeLinejoin="round"
|
|
379
|
+
/>
|
|
380
|
+
<Path
|
|
381
|
+
d="m9 12 2 2 4-4"
|
|
382
|
+
stroke={resolved}
|
|
383
|
+
strokeWidth={2}
|
|
384
|
+
strokeLinecap="round"
|
|
385
|
+
strokeLinejoin="round"
|
|
386
|
+
/>
|
|
387
|
+
</Svg>
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export function BellIcon({ size = 16, color, ...props }: IconProps) {
|
|
392
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
393
|
+
return (
|
|
394
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
395
|
+
<Path
|
|
396
|
+
d="M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9M13.7 21a2 2 0 0 1-3.4 0"
|
|
397
|
+
stroke={resolved}
|
|
398
|
+
strokeWidth={2}
|
|
399
|
+
strokeLinecap="round"
|
|
400
|
+
strokeLinejoin="round"
|
|
401
|
+
/>
|
|
402
|
+
</Svg>
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export function PackageIcon({ size = 16, color, ...props }: IconProps) {
|
|
407
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
408
|
+
return (
|
|
409
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
410
|
+
<Path
|
|
411
|
+
d="m12 2.5 8 4.5v10l-8 4.5-8-4.5V7zM4 7l8 4.5L20 7M12 11.5V21"
|
|
412
|
+
stroke={resolved}
|
|
413
|
+
strokeWidth={2}
|
|
414
|
+
strokeLinecap="round"
|
|
415
|
+
strokeLinejoin="round"
|
|
416
|
+
/>
|
|
417
|
+
</Svg>
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export function CardIcon({ size = 16, color, ...props }: IconProps) {
|
|
422
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
423
|
+
return (
|
|
424
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
425
|
+
<Path
|
|
426
|
+
d="M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 10h18"
|
|
427
|
+
stroke={resolved}
|
|
428
|
+
strokeWidth={2}
|
|
429
|
+
strokeLinecap="round"
|
|
430
|
+
strokeLinejoin="round"
|
|
431
|
+
/>
|
|
432
|
+
</Svg>
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export function ReceiptIcon({ size = 16, color, ...props }: IconProps) {
|
|
437
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
438
|
+
return (
|
|
439
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
440
|
+
<Path
|
|
441
|
+
d="M5 3h14v18l-2.3-1.6L14.4 21l-2.4-1.6L9.6 21l-2.3-1.6L5 21zM9 8h6M9 12h6"
|
|
442
|
+
stroke={resolved}
|
|
443
|
+
strokeWidth={2}
|
|
444
|
+
strokeLinecap="round"
|
|
445
|
+
strokeLinejoin="round"
|
|
446
|
+
/>
|
|
447
|
+
</Svg>
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/** Paper plane — sent, submitted, approved-and-forwarded. */
|
|
452
|
+
export function SendIcon({ size = 16, color, ...props }: IconProps) {
|
|
453
|
+
const resolved = useResolvedColor(color, '#737373');
|
|
454
|
+
return (
|
|
455
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
456
|
+
<Path
|
|
457
|
+
d="M21.5 2.5 2.5 10l7.5 3 3 7.5z"
|
|
458
|
+
stroke={resolved}
|
|
459
|
+
strokeWidth={2}
|
|
460
|
+
strokeLinejoin="round"
|
|
461
|
+
/>
|
|
462
|
+
</Svg>
|
|
463
|
+
);
|
|
464
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -23,12 +23,26 @@ export {
|
|
|
23
23
|
} from './primitives/animated-pressable';
|
|
24
24
|
|
|
25
25
|
// Components
|
|
26
|
+
export {
|
|
27
|
+
Accordion,
|
|
28
|
+
type AccordionProps,
|
|
29
|
+
type AccordionItemProps,
|
|
30
|
+
type AccordionTriggerProps,
|
|
31
|
+
type AccordionIndicatorProps,
|
|
32
|
+
type AccordionContentProps,
|
|
33
|
+
type AccordionVariant,
|
|
34
|
+
type AccordionSelectionMode,
|
|
35
|
+
} from './components/accordion';
|
|
26
36
|
export {
|
|
27
37
|
Alert,
|
|
28
38
|
type AlertProps,
|
|
29
39
|
type AlertIndicatorProps,
|
|
30
40
|
} from './components/alert';
|
|
31
|
-
export {
|
|
41
|
+
export {
|
|
42
|
+
Avatar,
|
|
43
|
+
type AvatarProps,
|
|
44
|
+
type AvatarBadgeProps,
|
|
45
|
+
} from './components/avatar';
|
|
32
46
|
export { Badge, type BadgeProps } from './components/badge';
|
|
33
47
|
export {
|
|
34
48
|
BottomSheet,
|
|
@@ -89,6 +103,15 @@ export {
|
|
|
89
103
|
type StepsOrientation,
|
|
90
104
|
} from './components/steps';
|
|
91
105
|
export { Switch, type SwitchProps } from './components/switch';
|
|
106
|
+
export {
|
|
107
|
+
Timeline,
|
|
108
|
+
type TimelineProps,
|
|
109
|
+
type TimelineItemProps,
|
|
110
|
+
type TimelineIndicatorProps,
|
|
111
|
+
type TimelineStatProps,
|
|
112
|
+
type TimelineVariant,
|
|
113
|
+
type TimelineTone,
|
|
114
|
+
} from './components/timeline';
|
|
92
115
|
export {
|
|
93
116
|
Toast,
|
|
94
117
|
ToastViewport,
|
|
@@ -115,17 +138,31 @@ export {
|
|
|
115
138
|
// Icons
|
|
116
139
|
export {
|
|
117
140
|
AlertTriangleIcon,
|
|
141
|
+
AppleIcon,
|
|
118
142
|
ArrowUpRightIcon,
|
|
143
|
+
BellIcon,
|
|
144
|
+
CardIcon,
|
|
119
145
|
CheckCircleIcon,
|
|
120
146
|
CheckIcon,
|
|
121
147
|
ChevronDownIcon,
|
|
122
148
|
ChevronLeftIcon,
|
|
123
149
|
ChevronRightIcon,
|
|
150
|
+
FacebookIcon,
|
|
151
|
+
GoogleIcon,
|
|
152
|
+
IconColorProvider,
|
|
124
153
|
InfoIcon,
|
|
125
154
|
MoonIcon,
|
|
155
|
+
PackageIcon,
|
|
156
|
+
PlusSquareIcon,
|
|
157
|
+
ReceiptIcon,
|
|
126
158
|
SearchIcon,
|
|
159
|
+
SendIcon,
|
|
160
|
+
ShareNodesIcon,
|
|
161
|
+
ShieldAlertIcon,
|
|
162
|
+
ShieldCheckIcon,
|
|
127
163
|
SunIcon,
|
|
128
164
|
XIcon,
|
|
165
|
+
useIconColor,
|
|
129
166
|
type IconProps,
|
|
130
167
|
} from './icons';
|
|
131
168
|
|