panelui-native 0.1.0 → 0.4.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 +251 -0
- package/lib/module/components/alert/index.js +107 -24
- package/lib/module/components/alert/index.js.map +1 -1
- package/lib/module/components/avatar/index.js +1 -1
- package/lib/module/components/avatar/index.js.map +1 -1
- package/lib/module/components/badge/index.js +3 -3
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/bottom-sheet/index.js +35 -31
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/button/index.js +44 -15
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/card/index.js +5 -5
- package/lib/module/components/card/index.js.map +1 -1
- package/lib/module/components/checkbox/index.js +21 -8
- package/lib/module/components/checkbox/index.js.map +1 -1
- package/lib/module/components/dialog/index.js +21 -17
- package/lib/module/components/dialog/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js +178 -0
- package/lib/module/components/empty-state/index.js.map +1 -0
- package/lib/module/components/frame/index.js +100 -0
- package/lib/module/components/frame/index.js.map +1 -0
- package/lib/module/components/inline-select/index.js +159 -0
- package/lib/module/components/inline-select/index.js.map +1 -0
- package/lib/module/components/input/index.js +1 -1
- package/lib/module/components/input/index.js.map +1 -1
- package/lib/module/components/input-group/index.js +132 -0
- package/lib/module/components/input-group/index.js.map +1 -0
- package/lib/module/components/label/index.js +117 -0
- package/lib/module/components/label/index.js.map +1 -0
- package/lib/module/components/progress/index.js +138 -0
- package/lib/module/components/progress/index.js.map +1 -0
- package/lib/module/components/select/index.js +35 -28
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/skeleton/index.js +1 -1
- package/lib/module/components/skeleton/index.js.map +1 -1
- package/lib/module/components/spinner/index.js +1 -1
- package/lib/module/components/spinner/index.js.map +1 -1
- package/lib/module/components/steps/index.js +354 -0
- package/lib/module/components/steps/index.js.map +1 -0
- package/lib/module/components/tabs/index.js +9 -3
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/toast/index.js +479 -0
- package/lib/module/components/toast/index.js.map +1 -0
- package/lib/module/components/toast/toast-store.js +81 -0
- package/lib/module/components/toast/toast-store.js.map +1 -0
- package/lib/module/components/typography/index.js +126 -0
- package/lib/module/components/typography/index.js.map +1 -0
- package/lib/module/icons/index.js +223 -2
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +11 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/panel-ui-provider.js +20 -8
- package/lib/module/providers/panel-ui-provider.js.map +1 -1
- package/lib/module/theme/use-theme.js +90 -3
- package/lib/module/theme/use-theme.js.map +1 -1
- package/lib/typescript/src/components/alert/index.d.ts +41 -19
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts +39 -0
- package/lib/typescript/src/components/button/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/dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts +73 -0
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -0
- package/lib/typescript/src/components/frame/index.d.ts +21 -0
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -0
- package/lib/typescript/src/components/inline-select/index.d.ts +25 -0
- package/lib/typescript/src/components/inline-select/index.d.ts.map +1 -0
- package/lib/typescript/src/components/input-group/index.d.ts +34 -0
- package/lib/typescript/src/components/input-group/index.d.ts.map +1 -0
- package/lib/typescript/src/components/label/index.d.ts +28 -0
- package/lib/typescript/src/components/label/index.d.ts.map +1 -0
- package/lib/typescript/src/components/progress/index.d.ts +132 -0
- package/lib/typescript/src/components/progress/index.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/spinner/index.d.ts +2 -2
- package/lib/typescript/src/components/spinner/index.d.ts.map +1 -1
- package/lib/typescript/src/components/steps/index.d.ts +62 -0
- package/lib/typescript/src/components/steps/index.d.ts.map +1 -0
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts +176 -0
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/toast-store.d.ts +65 -0
- package/lib/typescript/src/components/toast/toast-store.d.ts.map +1 -0
- package/lib/typescript/src/components/typography/index.d.ts +77 -0
- package/lib/typescript/src/components/typography/index.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +25 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +12 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/providers/panel-ui-provider.d.ts +20 -5
- package/lib/typescript/src/providers/panel-ui-provider.d.ts.map +1 -1
- package/lib/typescript/src/theme/use-theme.d.ts +64 -4
- package/lib/typescript/src/theme/use-theme.d.ts.map +1 -1
- package/package.json +28 -5
- package/src/components/alert/index.tsx +104 -28
- package/src/components/avatar/index.tsx +1 -1
- package/src/components/badge/index.tsx +3 -3
- package/src/components/bottom-sheet/index.tsx +8 -3
- package/src/components/button/index.tsx +47 -7
- package/src/components/card/index.tsx +5 -5
- package/src/components/checkbox/index.tsx +18 -4
- package/src/components/dialog/index.tsx +10 -5
- package/src/components/empty-state/index.tsx +136 -0
- package/src/components/frame/index.tsx +104 -0
- package/src/components/inline-select/index.tsx +185 -0
- package/src/components/input/index.tsx +1 -1
- package/src/components/input-group/index.tsx +164 -0
- package/src/components/label/index.tsx +128 -0
- package/src/components/progress/index.tsx +147 -0
- package/src/components/select/index.tsx +30 -23
- package/src/components/skeleton/index.tsx +1 -1
- package/src/components/spinner/index.tsx +1 -1
- package/src/components/steps/index.tsx +343 -0
- package/src/components/tabs/index.tsx +10 -2
- package/src/components/toast/index.tsx +447 -0
- package/src/components/toast/toast-store.ts +120 -0
- package/src/components/typography/index.tsx +121 -0
- package/src/icons/index.tsx +152 -1
- package/src/index.ts +82 -3
- package/src/providers/panel-ui-provider.tsx +35 -10
- package/src/theme/use-theme.ts +119 -4
- package/theme.css +446 -108
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Typography — semantic text presets.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from: heroui-inc/heroui-native (Typography `type` scale and the
|
|
7
|
+
* Heading / Paragraph / Code compound parts), built on PanelUI's Text
|
|
8
|
+
* primitive so every preset keeps `className` passthrough and theme colours.
|
|
9
|
+
*/
|
|
10
|
+
import { forwardRef } from 'react';
|
|
11
|
+
import { View } from 'react-native';
|
|
12
|
+
import { tv } from 'tailwind-variants';
|
|
13
|
+
import { Text } from "../../primitives/text.js";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
const typographyVariants = tv({
|
|
16
|
+
base: 'text-foreground',
|
|
17
|
+
variants: {
|
|
18
|
+
type: {
|
|
19
|
+
h1: 'text-4xl font-bold tracking-tight',
|
|
20
|
+
h2: 'text-3xl font-semibold tracking-tight',
|
|
21
|
+
h3: 'text-2xl font-semibold tracking-tight',
|
|
22
|
+
h4: 'text-xl font-semibold',
|
|
23
|
+
h5: 'text-lg font-semibold',
|
|
24
|
+
h6: 'text-base font-semibold',
|
|
25
|
+
body: 'text-base font-normal',
|
|
26
|
+
'body-sm': 'text-sm font-normal',
|
|
27
|
+
'body-xs': 'text-xs font-normal',
|
|
28
|
+
code: 'font-mono text-sm text-foreground'
|
|
29
|
+
},
|
|
30
|
+
muted: {
|
|
31
|
+
true: 'text-muted-foreground'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
type: 'body'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/** Heading levels, for `Typography.Heading`. */
|
|
40
|
+
|
|
41
|
+
/** Body sizes, for `Typography.Paragraph`. */
|
|
42
|
+
|
|
43
|
+
/** Maps a heading preset to its accessibility heading level. */
|
|
44
|
+
const HEADING_LEVEL = {
|
|
45
|
+
h1: 1,
|
|
46
|
+
h2: 2,
|
|
47
|
+
h3: 3,
|
|
48
|
+
h4: 4,
|
|
49
|
+
h5: 5,
|
|
50
|
+
h6: 6
|
|
51
|
+
};
|
|
52
|
+
const TypographyRoot = /*#__PURE__*/forwardRef(({
|
|
53
|
+
className,
|
|
54
|
+
type,
|
|
55
|
+
muted,
|
|
56
|
+
...props
|
|
57
|
+
}, ref) => /*#__PURE__*/_jsx(Text, {
|
|
58
|
+
ref: ref,
|
|
59
|
+
className: typographyVariants({
|
|
60
|
+
type,
|
|
61
|
+
muted,
|
|
62
|
+
className
|
|
63
|
+
}),
|
|
64
|
+
...props
|
|
65
|
+
}));
|
|
66
|
+
TypographyRoot.displayName = 'Typography';
|
|
67
|
+
/** Heading text, wired up with the matching accessibility heading level. */
|
|
68
|
+
const TypographyHeading = /*#__PURE__*/forwardRef(({
|
|
69
|
+
className,
|
|
70
|
+
type = 'h2',
|
|
71
|
+
muted,
|
|
72
|
+
...props
|
|
73
|
+
}, ref) => /*#__PURE__*/_jsx(Text, {
|
|
74
|
+
ref: ref,
|
|
75
|
+
accessibilityRole: "header",
|
|
76
|
+
"aria-level": HEADING_LEVEL[type],
|
|
77
|
+
className: typographyVariants({
|
|
78
|
+
type,
|
|
79
|
+
muted,
|
|
80
|
+
className
|
|
81
|
+
}),
|
|
82
|
+
...props
|
|
83
|
+
}));
|
|
84
|
+
TypographyHeading.displayName = 'Typography.Heading';
|
|
85
|
+
const TypographyParagraph = /*#__PURE__*/forwardRef(({
|
|
86
|
+
className,
|
|
87
|
+
type = 'body',
|
|
88
|
+
muted,
|
|
89
|
+
...props
|
|
90
|
+
}, ref) => /*#__PURE__*/_jsx(Text, {
|
|
91
|
+
ref: ref,
|
|
92
|
+
className: typographyVariants({
|
|
93
|
+
type,
|
|
94
|
+
muted,
|
|
95
|
+
className
|
|
96
|
+
}),
|
|
97
|
+
...props
|
|
98
|
+
}));
|
|
99
|
+
TypographyParagraph.displayName = 'Typography.Paragraph';
|
|
100
|
+
/** Inline code on a muted surface. */
|
|
101
|
+
const TypographyCode = /*#__PURE__*/forwardRef(({
|
|
102
|
+
className,
|
|
103
|
+
containerClassName,
|
|
104
|
+
muted,
|
|
105
|
+
testID,
|
|
106
|
+
...props
|
|
107
|
+
}, ref) => /*#__PURE__*/_jsx(View, {
|
|
108
|
+
ref: ref,
|
|
109
|
+
testID: testID,
|
|
110
|
+
className: `self-start rounded-md bg-muted px-1.5 py-1 ${containerClassName ?? ''}`,
|
|
111
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
112
|
+
className: typographyVariants({
|
|
113
|
+
type: 'code',
|
|
114
|
+
muted,
|
|
115
|
+
className
|
|
116
|
+
}),
|
|
117
|
+
...props
|
|
118
|
+
})
|
|
119
|
+
}));
|
|
120
|
+
TypographyCode.displayName = 'Typography.Code';
|
|
121
|
+
export const Typography = Object.assign(TypographyRoot, {
|
|
122
|
+
Heading: TypographyHeading,
|
|
123
|
+
Paragraph: TypographyParagraph,
|
|
124
|
+
Code: TypographyCode
|
|
125
|
+
});
|
|
126
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","View","tv","Text","jsx","_jsx","typographyVariants","base","variants","type","h1","h2","h3","h4","h5","h6","body","code","muted","true","defaultVariants","HEADING_LEVEL","TypographyRoot","className","props","ref","displayName","TypographyHeading","accessibilityRole","TypographyParagraph","TypographyCode","containerClassName","testID","children","Typography","Object","assign","Heading","Paragraph","Code"],"sourceRoot":"../../../../src","sources":["components/typography/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,IAAI,QAA6C,cAAc;AACxE,SAASC,EAAE,QAA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M,CAACC,MAAM,CAACd,cAAc,EAAE;EACtDe,OAAO,EAAEV,iBAAiB;EAC1BW,SAAS,EAAET,mBAAmB;EAC9BU,IAAI,EAAET;AACR,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Icon set.
|
|
5
|
+
*
|
|
6
|
+
* Two families live here:
|
|
7
|
+
* - Stroked 24×24 icons (Lucide geometry, as used by shadcn-ui/ui) for chrome
|
|
8
|
+
* such as chevrons and the close button.
|
|
9
|
+
* - Filled 16×16 status icons for Alert and Toast indicators.
|
|
10
|
+
* Adapted from: heroui-inc/heroui-native src/components/alert/{default,success,warning}-icon.tsx
|
|
11
|
+
*
|
|
12
|
+
* `color` has no default on the status icons on purpose — callers resolve it
|
|
13
|
+
* from the active theme with `useCSSVariable`, so icons follow the theme
|
|
14
|
+
* instead of a hardcoded hex.
|
|
15
|
+
*/
|
|
16
|
+
import Svg, { Circle, Path } from 'react-native-svg';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
/** Props for icons that must never be announced by a screen reader. */
|
|
19
|
+
const decorative = {
|
|
20
|
+
accessibilityElementsHidden: true,
|
|
21
|
+
importantForAccessibility: 'no-hide-descendants'
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/* -------------------------------------------------------------------------- */
|
|
25
|
+
/* Stroked chrome icons */
|
|
26
|
+
/* -------------------------------------------------------------------------- */
|
|
27
|
+
|
|
5
28
|
export function CheckIcon({
|
|
6
29
|
size = 14,
|
|
7
30
|
color = '#fff',
|
|
@@ -42,6 +65,46 @@ export function ChevronDownIcon({
|
|
|
42
65
|
})
|
|
43
66
|
});
|
|
44
67
|
}
|
|
68
|
+
export function ChevronLeftIcon({
|
|
69
|
+
size = 16,
|
|
70
|
+
color = '#737373',
|
|
71
|
+
...props
|
|
72
|
+
}) {
|
|
73
|
+
return /*#__PURE__*/_jsx(Svg, {
|
|
74
|
+
width: size,
|
|
75
|
+
height: size,
|
|
76
|
+
viewBox: "0 0 24 24",
|
|
77
|
+
fill: "none",
|
|
78
|
+
...props,
|
|
79
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
80
|
+
d: "m15 18-6-6 6-6",
|
|
81
|
+
stroke: color,
|
|
82
|
+
strokeWidth: 2,
|
|
83
|
+
strokeLinecap: "round",
|
|
84
|
+
strokeLinejoin: "round"
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export function ChevronRightIcon({
|
|
89
|
+
size = 16,
|
|
90
|
+
color = '#737373',
|
|
91
|
+
...props
|
|
92
|
+
}) {
|
|
93
|
+
return /*#__PURE__*/_jsx(Svg, {
|
|
94
|
+
width: size,
|
|
95
|
+
height: size,
|
|
96
|
+
viewBox: "0 0 24 24",
|
|
97
|
+
fill: "none",
|
|
98
|
+
...props,
|
|
99
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
100
|
+
d: "m9 18 6-6-6-6",
|
|
101
|
+
stroke: color,
|
|
102
|
+
strokeWidth: 2,
|
|
103
|
+
strokeLinecap: "round",
|
|
104
|
+
strokeLinejoin: "round"
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
45
108
|
export function XIcon({
|
|
46
109
|
size = 16,
|
|
47
110
|
color = '#737373',
|
|
@@ -62,4 +125,162 @@ export function XIcon({
|
|
|
62
125
|
})
|
|
63
126
|
});
|
|
64
127
|
}
|
|
128
|
+
export function SearchIcon({
|
|
129
|
+
size = 16,
|
|
130
|
+
color = '#737373',
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
return /*#__PURE__*/_jsxs(Svg, {
|
|
134
|
+
width: size,
|
|
135
|
+
height: size,
|
|
136
|
+
viewBox: "0 0 24 24",
|
|
137
|
+
fill: "none",
|
|
138
|
+
...props,
|
|
139
|
+
children: [/*#__PURE__*/_jsx(Circle, {
|
|
140
|
+
cx: 11,
|
|
141
|
+
cy: 11,
|
|
142
|
+
r: 8,
|
|
143
|
+
stroke: color,
|
|
144
|
+
strokeWidth: 2
|
|
145
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
146
|
+
d: "m21 21-4.3-4.3",
|
|
147
|
+
stroke: color,
|
|
148
|
+
strokeWidth: 2,
|
|
149
|
+
strokeLinecap: "round",
|
|
150
|
+
strokeLinejoin: "round"
|
|
151
|
+
})]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
export function ArrowUpRightIcon({
|
|
155
|
+
size = 20,
|
|
156
|
+
color = '#fff',
|
|
157
|
+
...props
|
|
158
|
+
}) {
|
|
159
|
+
return /*#__PURE__*/_jsx(Svg, {
|
|
160
|
+
width: size,
|
|
161
|
+
height: size,
|
|
162
|
+
viewBox: "0 0 24 24",
|
|
163
|
+
fill: "none",
|
|
164
|
+
...props,
|
|
165
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
166
|
+
d: "M7 17 17 7M8 7h9v9",
|
|
167
|
+
stroke: color,
|
|
168
|
+
strokeWidth: 2,
|
|
169
|
+
strokeLinecap: "round",
|
|
170
|
+
strokeLinejoin: "round"
|
|
171
|
+
})
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
export function SunIcon({
|
|
175
|
+
size = 18,
|
|
176
|
+
color = '#f5f5f5',
|
|
177
|
+
...props
|
|
178
|
+
}) {
|
|
179
|
+
return /*#__PURE__*/_jsxs(Svg, {
|
|
180
|
+
width: size,
|
|
181
|
+
height: size,
|
|
182
|
+
viewBox: "0 0 24 24",
|
|
183
|
+
fill: "none",
|
|
184
|
+
...props,
|
|
185
|
+
children: [/*#__PURE__*/_jsx(Circle, {
|
|
186
|
+
cx: 12,
|
|
187
|
+
cy: 12,
|
|
188
|
+
r: 4,
|
|
189
|
+
stroke: color,
|
|
190
|
+
strokeWidth: 2
|
|
191
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
192
|
+
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",
|
|
193
|
+
stroke: color,
|
|
194
|
+
strokeWidth: 2,
|
|
195
|
+
strokeLinecap: "round"
|
|
196
|
+
})]
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
export function MoonIcon({
|
|
200
|
+
size = 18,
|
|
201
|
+
color = '#262626',
|
|
202
|
+
...props
|
|
203
|
+
}) {
|
|
204
|
+
return /*#__PURE__*/_jsx(Svg, {
|
|
205
|
+
width: size,
|
|
206
|
+
height: size,
|
|
207
|
+
viewBox: "0 0 24 24",
|
|
208
|
+
fill: "none",
|
|
209
|
+
...props,
|
|
210
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
211
|
+
d: "M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79",
|
|
212
|
+
stroke: color,
|
|
213
|
+
strokeWidth: 2,
|
|
214
|
+
strokeLinecap: "round",
|
|
215
|
+
strokeLinejoin: "round"
|
|
216
|
+
})
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* -------------------------------------------------------------------------- */
|
|
221
|
+
/* Filled status icons (Alert / Toast indicators) */
|
|
222
|
+
/* -------------------------------------------------------------------------- */
|
|
223
|
+
|
|
224
|
+
/** Info circle. Used for `default`, `info` and `destructive` status. */
|
|
225
|
+
export function InfoIcon({
|
|
226
|
+
size = 20,
|
|
227
|
+
color,
|
|
228
|
+
...props
|
|
229
|
+
}) {
|
|
230
|
+
return /*#__PURE__*/_jsx(Svg, {
|
|
231
|
+
width: size,
|
|
232
|
+
height: size,
|
|
233
|
+
viewBox: "0 0 16 16",
|
|
234
|
+
fill: color,
|
|
235
|
+
...decorative,
|
|
236
|
+
...props,
|
|
237
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
238
|
+
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",
|
|
239
|
+
fillRule: "evenodd",
|
|
240
|
+
clipRule: "evenodd"
|
|
241
|
+
})
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** Check circle. Used for `success` status. */
|
|
246
|
+
export function CheckCircleIcon({
|
|
247
|
+
size = 20,
|
|
248
|
+
color,
|
|
249
|
+
...props
|
|
250
|
+
}) {
|
|
251
|
+
return /*#__PURE__*/_jsx(Svg, {
|
|
252
|
+
width: size,
|
|
253
|
+
height: size,
|
|
254
|
+
viewBox: "0 0 16 16",
|
|
255
|
+
fill: color,
|
|
256
|
+
...decorative,
|
|
257
|
+
...props,
|
|
258
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
259
|
+
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",
|
|
260
|
+
fillRule: "evenodd",
|
|
261
|
+
clipRule: "evenodd"
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/** Warning triangle. Used for `warning` status. */
|
|
267
|
+
export function AlertTriangleIcon({
|
|
268
|
+
size = 20,
|
|
269
|
+
color,
|
|
270
|
+
...props
|
|
271
|
+
}) {
|
|
272
|
+
return /*#__PURE__*/_jsx(Svg, {
|
|
273
|
+
width: size,
|
|
274
|
+
height: size,
|
|
275
|
+
viewBox: "0 0 16 16",
|
|
276
|
+
fill: color,
|
|
277
|
+
...decorative,
|
|
278
|
+
...props,
|
|
279
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
280
|
+
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",
|
|
281
|
+
fillRule: "evenodd",
|
|
282
|
+
clipRule: "evenodd"
|
|
283
|
+
})
|
|
284
|
+
});
|
|
285
|
+
}
|
|
65
286
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Svg","Path","jsx","_jsx","CheckIcon","size","color","props","width","height","viewBox","fill","children","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","ChevronDownIcon","XIcon"],"sourceRoot":"../../../src","sources":["icons/index.tsx"],"mappings":";;AAAA,OAAOA,GAAG,IAAIC,IAAI,QAAuB,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["Svg","Circle","Path","jsx","_jsx","jsxs","_jsxs","decorative","accessibilityElementsHidden","importantForAccessibility","CheckIcon","size","color","props","width","height","viewBox","fill","children","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","ChevronDownIcon","ChevronLeftIcon","ChevronRightIcon","XIcon","SearchIcon","cx","cy","r","ArrowUpRightIcon","SunIcon","MoonIcon","InfoIcon","fillRule","clipRule","CheckCircleIcon","AlertTriangleIcon"],"sourceRoot":"../../../src","sources":["icons/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,GAAG,IAAIC,MAAM,EAAEC,IAAI,QAAuB,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EA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;MACHiB,CAAC,EAAC,oKAAoK;MACtKiB,QAAQ,EAAC,SAAS;MAClBC,QAAQ,EAAC;IAAS,CACnB;EAAC,CACC,CAAC;AAEV;;AAEA;AACA,OAAO,SAASC,eAAeA,CAAC;EAAE3B,IAAI,GAAG,EAAE;EAAEC,KAAK;EAAE,GAAGC;AAAiB,CAAC,EAAE;EACzE,oBACET,IAAA,CAACJ,GAAG;IAACc,KAAK,EAAEH,IAAK;IAACI,MAAM,EAAEJ,IAAK;IAACK,OAAO,EAAC,WAAW;IAACC,IAAI,EAAEL,KAAM;IAAA,GAAKL,UAAU;IAAA,GAAMM,KAAK;IAAAK,QAAA,eACxFd,IAAA,CAACF,IAAI;MACHiB,CAAC,EAAC,uLAAuL;MACzLiB,QAAQ,EAAC,SAAS;MAClBC,QAAQ,EAAC;IAAS,CACnB;EAAC,CACC,CAAC;AAEV;;AAEA;AACA,OAAO,SAASE,iBAAiBA,CAAC;EAAE5B,IAAI,GAAG,EAAE;EAAEC,KAAK;EAAE,GAAGC;AAAiB,CAAC,EAAE;EAC3E,oBACET,IAAA,CAACJ,GAAG;IAACc,KAAK,EAAEH,IAAK;IAACI,MAAM,EAAEJ,IAAK;IAACK,OAAO,EAAC,WAAW;IAACC,IAAI,EAAEL,KAAM;IAAA,GAAKL,UAAU;IAAA,GAAMM,KAAK;IAAAK,QAAA,eACxFd,IAAA,CAACF,IAAI;MACHiB,CAAC,EAAC,oUAAoU;MACtUiB,QAAQ,EAAC,SAAS;MAClBC,QAAQ,EAAC;IAAS,CACnB;EAAC,CACC,CAAC;AAEV","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
export { PanelUIProvider } from "./providers/panel-ui-provider.js";
|
|
5
5
|
|
|
6
6
|
// Theme
|
|
7
|
-
export { useTheme } from "./theme/use-theme.js";
|
|
7
|
+
export { useTheme, useThemeMode, PANEL_THEMES, PANEL_THEME_NAMES, PANEL_EXTRA_THEMES } from "./theme/use-theme.js";
|
|
8
8
|
|
|
9
9
|
// Primitives
|
|
10
10
|
export { Portal, PortalHost, PortalProvider } from "./primitives/portal.js";
|
|
@@ -18,18 +18,27 @@ export { Badge } from "./components/badge/index.js";
|
|
|
18
18
|
export { BottomSheet } from "./components/bottom-sheet/index.js";
|
|
19
19
|
export { Button } from "./components/button/index.js";
|
|
20
20
|
export { Dialog } from "./components/dialog/index.js";
|
|
21
|
+
export { Frame } from "./components/frame/index.js";
|
|
22
|
+
export { InlineSelect } from "./components/inline-select/index.js";
|
|
21
23
|
export { Select } from "./components/select/index.js";
|
|
22
24
|
export { Tabs } from "./components/tabs/index.js";
|
|
23
25
|
export { Card } from "./components/card/index.js";
|
|
24
26
|
export { Checkbox } from "./components/checkbox/index.js";
|
|
27
|
+
export { EmptyState } from "./components/empty-state/index.js";
|
|
25
28
|
export { Input } from "./components/input/index.js";
|
|
29
|
+
export { InputGroup } from "./components/input-group/index.js";
|
|
30
|
+
export { Label } from "./components/label/index.js";
|
|
31
|
+
export { Progress } from "./components/progress/index.js";
|
|
26
32
|
export { RadioGroup } from "./components/radio-group/index.js";
|
|
27
33
|
export { Skeleton } from "./components/skeleton/index.js";
|
|
28
34
|
export { Spinner } from "./components/spinner/index.js";
|
|
35
|
+
export { Steps } from "./components/steps/index.js";
|
|
29
36
|
export { Switch } from "./components/switch/index.js";
|
|
37
|
+
export { Toast, ToastViewport, toast, useToast } from "./components/toast/index.js";
|
|
38
|
+
export { Typography } from "./components/typography/index.js";
|
|
30
39
|
|
|
31
40
|
// Icons
|
|
32
|
-
export { CheckIcon, ChevronDownIcon, XIcon } from "./icons/index.js";
|
|
41
|
+
export { AlertTriangleIcon, ArrowUpRightIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, InfoIcon, MoonIcon, SearchIcon, SunIcon, XIcon } from "./icons/index.js";
|
|
33
42
|
|
|
34
43
|
// Utils
|
|
35
44
|
export { cn } from "./utils/cn.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PanelUIProvider","useTheme","Portal","PortalHost","PortalProvider","Text","AnimatedPressable","Alert","Avatar","Badge","BottomSheet","Button","Dialog","Select","Tabs","Card","Checkbox","Input","RadioGroup","Skeleton","Spinner","Switch","CheckIcon","ChevronDownIcon","XIcon","cn"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA,SAASA,eAAe,QAAmC,kCAA+B;;AAE1F;AACA,
|
|
1
|
+
{"version":3,"names":["PanelUIProvider","useTheme","useThemeMode","PANEL_THEMES","PANEL_THEME_NAMES","PANEL_EXTRA_THEMES","Portal","PortalHost","PortalProvider","Text","AnimatedPressable","Alert","Avatar","Badge","BottomSheet","Button","Dialog","Frame","InlineSelect","Select","Tabs","Card","Checkbox","EmptyState","Input","InputGroup","Label","Progress","RadioGroup","Skeleton","Spinner","Steps","Switch","Toast","ToastViewport","toast","useToast","Typography","AlertTriangleIcon","ArrowUpRightIcon","CheckCircleIcon","CheckIcon","ChevronDownIcon","ChevronLeftIcon","ChevronRightIcon","InfoIcon","MoonIcon","SearchIcon","SunIcon","XIcon","cn"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA,SAASA,eAAe,QAAmC,kCAA+B;;AAE1F;AACA,SACEC,QAAQ,EACRC,YAAY,EACZC,YAAY,EACZC,iBAAiB,EACjBC,kBAAkB,QAKb,sBAAmB;;AAE1B;AACA,SAASC,MAAM,EAAEC,UAAU,EAAEC,cAAc,QAAQ,wBAAqB;AACxE,SAASC,IAAI,QAAwB,sBAAmB;AACxD,SACEC,iBAAiB,QAEZ,oCAAiC;;AAExC;AACA,SACEC,KAAK,QAGA,6BAAoB;AAC3B,SAASC,MAAM,QAA0B,8BAAqB;AAC9D,SAASC,KAAK,QAAyB,6BAAoB;AAC3D,SACEC,WAAW,QAGN,oCAA2B;AAClC,SAASC,MAAM,QAA0B,8BAAqB;AAC9D,SACEC,MAAM,QAGD,8BAAqB;AAC5B,SAASC,KAAK,QAAyB,6BAAoB;AAC3D,SACEC,YAAY,QAGP,qCAA4B;AACnC,SAASC,MAAM,QAAgD,8BAAqB;AACpF,SACEC,IAAI,QAKC,4BAAmB;AAC1B,SAASC,IAAI,QAAwB,4BAAmB;AACxD,SAASC,QAAQ,QAA4B,gCAAuB;AACpE,SACEC,UAAU,QAGL,mCAA0B;AACjC,SAASC,KAAK,QAAyB,6BAAoB;AAC3D,SACEC,UAAU,QAIL,mCAA0B;AACjC,SAASC,KAAK,QAA8C,6BAAoB;AAChF,SAASC,QAAQ,QAA4B,gCAAuB;AACpE,SACEC,UAAU,QAGL,mCAA0B;AACjC,SAASC,QAAQ,QAA4B,gCAAuB;AACpE,SAASC,OAAO,QAA2B,+BAAsB;AACjE,SACEC,KAAK,QAQA,6BAAoB;AAC3B,SAASC,MAAM,QAA0B,8BAAqB;AAC9D,SACEC,KAAK,EACLC,aAAa,EACbC,KAAK,EACLC,QAAQ,QASH,6BAAoB;AAC3B,SACEC,UAAU,QAML,kCAAyB;;AAEhC;AACA,SACEC,iBAAiB,EACjBC,gBAAgB,EAChBC,eAAe,EACfC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,gBAAgB,EAChBC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,OAAO,EACPC,KAAK,QAEA,kBAAS;;AAEhB;AACA,SAASC,EAAE,QAAQ,eAAY","ignoreList":[]}
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
4
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
5
5
|
import { PortalHost, PortalProvider } from "../primitives/portal.js";
|
|
6
|
+
import { ToastViewport } from "../components/toast/index.js";
|
|
7
|
+
import { cn } from "../utils/cn.js";
|
|
6
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
9
|
/**
|
|
8
|
-
* Root provider for PanelUI.
|
|
9
|
-
* the
|
|
10
|
+
* Root provider for PanelUI. Owns three things:
|
|
11
|
+
* the gesture handler root, the themed page background, and the portal host
|
|
12
|
+
* used by overlay components (Dialog, BottomSheet, Select).
|
|
10
13
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
14
|
+
* The background lives here because native wrappers like SafeAreaView do not
|
|
15
|
+
* accept `className` — putting `bg-background` on one silently does nothing,
|
|
16
|
+
* leaving the page unthemed while its children follow the theme.
|
|
17
|
+
*
|
|
18
|
+
* Theme switching is handled natively by Uniwind — use the `useTheme()` hook
|
|
19
|
+
* exported from panelui-native.
|
|
13
20
|
*/
|
|
14
21
|
export function PanelUIProvider({
|
|
15
|
-
children
|
|
22
|
+
children,
|
|
23
|
+
className,
|
|
24
|
+
background = true
|
|
16
25
|
}) {
|
|
17
26
|
return /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
18
27
|
style: styles.root,
|
|
19
|
-
children: /*#__PURE__*/
|
|
20
|
-
|
|
28
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
29
|
+
className: cn('flex-1', background && 'bg-background', className),
|
|
30
|
+
children: /*#__PURE__*/_jsxs(PortalProvider, {
|
|
31
|
+
children: [children, /*#__PURE__*/_jsx(ToastViewport, {}), /*#__PURE__*/_jsx(PortalHost, {})]
|
|
32
|
+
})
|
|
21
33
|
})
|
|
22
34
|
});
|
|
23
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","GestureHandlerRootView","PortalHost","PortalProvider","jsx","_jsx","jsxs","_jsxs","PanelUIProvider","children","style","styles","root","create","flex"],"sourceRoot":"../../../src","sources":["providers/panel-ui-provider.tsx"],"mappings":";;AACA,SAASA,UAAU,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["StyleSheet","View","GestureHandlerRootView","PortalHost","PortalProvider","ToastViewport","cn","jsx","_jsx","jsxs","_jsxs","PanelUIProvider","children","className","background","style","styles","root","create","flex"],"sourceRoot":"../../../src","sources":["providers/panel-ui-provider.tsx"],"mappings":";;AACA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,UAAU,EAAEC,cAAc,QAAQ,yBAAsB;AACjE,SAASC,aAAa,QAAQ,8BAAqB;AACnD,SAASC,EAAE,QAAQ,gBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAgBjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAC;EAC9BC,QAAQ;EACRC,SAAS;EACTC,UAAU,GAAG;AACO,CAAC,EAAE;EACvB,oBACEN,IAAA,CAACN,sBAAsB;IAACa,KAAK,EAAEC,MAAM,CAACC,IAAK;IAAAL,QAAA,eACzCJ,IAAA,CAACP,IAAI;MAACY,SAAS,EAAEP,EAAE,CAAC,QAAQ,EAAEQ,UAAU,IAAI,eAAe,EAAED,SAAS,CAAE;MAAAD,QAAA,eACtEF,KAAA,CAACN,cAAc;QAAAQ,QAAA,GACZA,QAAQ,eAETJ,IAAA,CAACH,aAAa,IAAE,CAAC,eACjBG,IAAA,CAACL,UAAU,IAAE,CAAC;MAAA,CACA;IAAC,CACb;EAAC,CACe,CAAC;AAE7B;AAEA,MAAMa,MAAM,GAAGhB,UAAU,CAACkB,MAAM,CAAC;EAC/BD,IAAI,EAAE;IAAEE,IAAI,EAAE;EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Uniwind, useUniwind } from 'uniwind';
|
|
4
|
+
|
|
5
|
+
/** Themes shipped in `panelui-native/theme.css`. */
|
|
6
|
+
|
|
7
|
+
/** Light/dark mode within a theme family. */
|
|
8
|
+
|
|
9
|
+
/** A theme family — one look, in its light and dark form. */
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The theme families PanelUI ships. Each sets its own palette *and* its own
|
|
13
|
+
* radius scale, so switching family changes the shape of the UI as well as
|
|
14
|
+
* its colour — Panel is the Coss default, Moon is sharp and monochrome,
|
|
15
|
+
* Grass is soft and green.
|
|
16
|
+
*
|
|
17
|
+
* Everything beyond `panel` must be registered in your metro config, or
|
|
18
|
+
* `setTheme` throws "it was not registered":
|
|
19
|
+
*
|
|
20
|
+
* ```js
|
|
21
|
+
* withUniwindConfig(config, {
|
|
22
|
+
* cssEntryFile: './global.css',
|
|
23
|
+
* extraThemes: ['moon', 'moon-dark', 'grass', 'grass-dark'],
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export const PANEL_THEMES = [{
|
|
28
|
+
id: 'panel',
|
|
29
|
+
name: 'Panel',
|
|
30
|
+
light: 'light',
|
|
31
|
+
dark: 'dark',
|
|
32
|
+
swatch: ['#262626', '#f5f5f5']
|
|
33
|
+
}, {
|
|
34
|
+
id: 'moon',
|
|
35
|
+
name: 'Moon',
|
|
36
|
+
light: 'moon',
|
|
37
|
+
dark: 'moon-dark',
|
|
38
|
+
swatch: ['#0070f3', '#0070f3']
|
|
39
|
+
}, {
|
|
40
|
+
id: 'grass',
|
|
41
|
+
name: 'Grass',
|
|
42
|
+
light: 'grass',
|
|
43
|
+
dark: 'grass-dark',
|
|
44
|
+
swatch: ['#24b47e', '#3ecf8e']
|
|
45
|
+
}];
|
|
46
|
+
|
|
47
|
+
/** Every concrete theme name, in registration order. */
|
|
48
|
+
export const PANEL_THEME_NAMES = PANEL_THEMES.flatMap(family => [family.light, family.dark]);
|
|
49
|
+
|
|
50
|
+
/** The names to pass as `extraThemes` in your metro config. */
|
|
51
|
+
export const PANEL_EXTRA_THEMES = PANEL_THEME_NAMES.filter(name => name !== 'light' && name !== 'dark');
|
|
52
|
+
function findFamily(theme) {
|
|
53
|
+
return PANEL_THEMES.find(family => family.light === theme || family.dark === theme) ?? PANEL_THEMES[0];
|
|
54
|
+
}
|
|
55
|
+
|
|
4
56
|
/**
|
|
5
57
|
* Reactive access to the current Uniwind theme plus a setter.
|
|
6
58
|
* Theme changes are applied natively by Uniwind without re-rendering the tree.
|
|
@@ -10,10 +62,45 @@ export function useTheme() {
|
|
|
10
62
|
theme
|
|
11
63
|
} = useUniwind();
|
|
12
64
|
return {
|
|
13
|
-
/**
|
|
14
|
-
theme,
|
|
15
|
-
/** Switch theme
|
|
65
|
+
/** The active theme name, e.g. `'dark'` or `'moon-dark'`. */
|
|
66
|
+
theme: theme,
|
|
67
|
+
/** Switch theme by name, or `'system'` to follow the device. */
|
|
16
68
|
setTheme: name => Uniwind.setTheme(name)
|
|
17
69
|
};
|
|
18
70
|
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Theme family and light/dark mode as two separate axes — what a picker like
|
|
74
|
+
* "choose a brand, then toggle the sun" actually needs.
|
|
75
|
+
*
|
|
76
|
+
* Named themes are not adaptive in Uniwind, so each brand ships as a
|
|
77
|
+
* light/dark pair. Toggling the mode keeps the current family, so a user in
|
|
78
|
+
* Moon dark lands in Moon light rather than the default theme.
|
|
79
|
+
*
|
|
80
|
+
* ```tsx
|
|
81
|
+
* const { family, mode, setFamily, toggleMode } = useThemeMode();
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export function useThemeMode() {
|
|
85
|
+
const {
|
|
86
|
+
theme
|
|
87
|
+
} = useUniwind();
|
|
88
|
+
const family = findFamily(theme);
|
|
89
|
+
const mode = theme === family.dark ? 'dark' : 'light';
|
|
90
|
+
return {
|
|
91
|
+
/** The active theme family. */
|
|
92
|
+
family,
|
|
93
|
+
/** `'light'` or `'dark'` within that family. */
|
|
94
|
+
mode,
|
|
95
|
+
/** Switch brand, staying in the current light/dark mode. */
|
|
96
|
+
setFamily: id => {
|
|
97
|
+
const next = PANEL_THEMES.find(candidate => candidate.id === id);
|
|
98
|
+
if (next) Uniwind.setTheme(next[mode]);
|
|
99
|
+
},
|
|
100
|
+
/** Set the mode, staying in the current family. */
|
|
101
|
+
setMode: next => Uniwind.setTheme(family[next]),
|
|
102
|
+
/** Flip light ↔ dark within the current family. */
|
|
103
|
+
toggleMode: () => Uniwind.setTheme(mode === 'dark' ? family.light : family.dark)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
19
106
|
//# sourceMappingURL=use-theme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Uniwind","useUniwind","
|
|
1
|
+
{"version":3,"names":["Uniwind","useUniwind","PANEL_THEMES","id","name","light","dark","swatch","PANEL_THEME_NAMES","flatMap","family","PANEL_EXTRA_THEMES","filter","findFamily","theme","find","useTheme","setTheme","useThemeMode","mode","setFamily","next","candidate","setMode","toggleMode"],"sourceRoot":"../../../src","sources":["theme/use-theme.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,UAAU,QAAQ,SAAS;;AAE7C;;AAWA;;AAGA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAyC,GAAG,CACvD;EACEC,EAAE,EAAE,OAAO;EACXC,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS;AAC/B,CAAC,EACD;EACEJ,EAAE,EAAE,MAAM;EACVC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,MAAM;EACbC,IAAI,EAAE,WAAW;EACjBC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS;AAC/B,CAAC,EACD;EACEJ,EAAE,EAAE,OAAO;EACXC,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,YAAY;EAClBC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS;AAC/B,CAAC,CACF;;AAED;AACA,OAAO,MAAMC,iBAAw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