@ezpg/app-ui 0.8.0 → 0.10.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/CHANGELOG.md +12 -0
- package/lib/module/adjust/adjust-template.js +92 -0
- package/lib/module/adjust/adjust-template.js.map +1 -0
- package/lib/module/adjust/color-adjust-note.js +67 -0
- package/lib/module/adjust/color-adjust-note.js.map +1 -0
- package/lib/module/adjust/color-track.js +132 -0
- package/lib/module/adjust/color-track.js.map +1 -0
- package/lib/module/adjust/dial-strip.js +126 -0
- package/lib/module/adjust/dial-strip.js.map +1 -0
- package/lib/module/adjust/hsl.js +29 -0
- package/lib/module/adjust/hsl.js.map +1 -0
- package/lib/module/adjust/index.js +9 -0
- package/lib/module/adjust/index.js.map +1 -0
- package/lib/module/adjust/scrub-ruler.js +159 -0
- package/lib/module/adjust/scrub-ruler.js.map +1 -0
- package/lib/module/adjust.js +4 -0
- package/lib/module/adjust.js.map +1 -0
- package/lib/module/templates/index.js +1 -0
- package/lib/module/templates/index.js.map +1 -1
- package/lib/module/templates/intro-template.js +136 -0
- package/lib/module/templates/intro-template.js.map +1 -0
- package/lib/typescript/src/adjust/adjust-template.d.ts +13 -0
- package/lib/typescript/src/adjust/adjust-template.d.ts.map +1 -0
- package/lib/typescript/src/adjust/color-adjust-note.d.ts +10 -0
- package/lib/typescript/src/adjust/color-adjust-note.d.ts.map +1 -0
- package/lib/typescript/src/adjust/color-track.d.ts +12 -0
- package/lib/typescript/src/adjust/color-track.d.ts.map +1 -0
- package/lib/typescript/src/adjust/dial-strip.d.ts +16 -0
- package/lib/typescript/src/adjust/dial-strip.d.ts.map +1 -0
- package/lib/typescript/src/adjust/hsl.d.ts +4 -0
- package/lib/typescript/src/adjust/hsl.d.ts.map +1 -0
- package/lib/typescript/src/adjust/index.d.ts +7 -0
- package/lib/typescript/src/adjust/index.d.ts.map +1 -0
- package/lib/typescript/src/adjust/scrub-ruler.d.ts +13 -0
- package/lib/typescript/src/adjust/scrub-ruler.d.ts.map +1 -0
- package/lib/typescript/src/adjust.d.ts +2 -0
- package/lib/typescript/src/adjust.d.ts.map +1 -0
- package/lib/typescript/src/templates/index.d.ts +2 -0
- package/lib/typescript/src/templates/index.d.ts.map +1 -1
- package/lib/typescript/src/templates/intro-template.d.ts +16 -0
- package/lib/typescript/src/templates/intro-template.d.ts.map +1 -0
- package/package.json +6 -1
- package/src/adjust/adjust-template.tsx +89 -0
- package/src/adjust/color-adjust-note.tsx +61 -0
- package/src/adjust/color-track.tsx +140 -0
- package/src/adjust/dial-strip.tsx +142 -0
- package/src/adjust/hsl.ts +37 -0
- package/src/adjust/index.ts +9 -0
- package/src/adjust/scrub-ruler.tsx +160 -0
- package/src/adjust.tsx +1 -0
- package/src/templates/index.ts +2 -0
- package/src/templates/intro-template.tsx +153 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useMemo, useRef } from 'react';
|
|
4
|
+
import { PanResponder, View } from 'react-native';
|
|
5
|
+
import { Text } from "../components/text/text.js";
|
|
6
|
+
import { useTheme } from "../theme/theme-provider.js";
|
|
7
|
+
import { makeStyles } from "../utils/styles.js";
|
|
8
|
+
import { clamp } from "./hsl.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const MINOR = 3;
|
|
11
|
+
const TICK = 2;
|
|
12
|
+
const useStyles = makeStyles(t => ({
|
|
13
|
+
root: {
|
|
14
|
+
height: t.controlSize.lg,
|
|
15
|
+
marginHorizontal: t.layout.screenX,
|
|
16
|
+
overflow: 'hidden'
|
|
17
|
+
},
|
|
18
|
+
ticks: {
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
top: t.space[2],
|
|
21
|
+
left: '50%',
|
|
22
|
+
flexDirection: 'row',
|
|
23
|
+
alignItems: 'flex-end'
|
|
24
|
+
},
|
|
25
|
+
tick: {
|
|
26
|
+
width: TICK,
|
|
27
|
+
height: t.space[2],
|
|
28
|
+
backgroundColor: t.colors.input
|
|
29
|
+
},
|
|
30
|
+
major: {
|
|
31
|
+
height: t.space[4],
|
|
32
|
+
backgroundColor: t.colors.mutedForeground
|
|
33
|
+
},
|
|
34
|
+
zero: {
|
|
35
|
+
height: t.space[5],
|
|
36
|
+
backgroundColor: t.colors.foreground
|
|
37
|
+
},
|
|
38
|
+
needle: {
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
left: '50%',
|
|
41
|
+
top: t.space[1],
|
|
42
|
+
width: TICK,
|
|
43
|
+
marginLeft: -TICK / 2,
|
|
44
|
+
height: t.space[6] + t.space[1],
|
|
45
|
+
borderRadius: t.radius.sm,
|
|
46
|
+
backgroundColor: t.colors.primary
|
|
47
|
+
},
|
|
48
|
+
ends: {
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
left: 0,
|
|
51
|
+
right: 0,
|
|
52
|
+
bottom: 0,
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
justifyContent: 'space-between'
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
export function ScrubRuler({
|
|
58
|
+
value,
|
|
59
|
+
min = -2,
|
|
60
|
+
max = 2,
|
|
61
|
+
onChange,
|
|
62
|
+
startLabel,
|
|
63
|
+
endLabel,
|
|
64
|
+
accessibilityLabel,
|
|
65
|
+
style
|
|
66
|
+
}) {
|
|
67
|
+
const t = useTheme();
|
|
68
|
+
const s = useStyles();
|
|
69
|
+
const step = t.space[8];
|
|
70
|
+
const gap = (step - TICK * (MINOR + 1)) / (MINOR + 1);
|
|
71
|
+
const latest = useRef({
|
|
72
|
+
value,
|
|
73
|
+
onChange,
|
|
74
|
+
min,
|
|
75
|
+
max
|
|
76
|
+
});
|
|
77
|
+
latest.current = {
|
|
78
|
+
value,
|
|
79
|
+
onChange,
|
|
80
|
+
min,
|
|
81
|
+
max
|
|
82
|
+
};
|
|
83
|
+
const start = useRef(value);
|
|
84
|
+
const pan = useMemo(() => PanResponder.create({
|
|
85
|
+
onStartShouldSetPanResponder: () => true,
|
|
86
|
+
onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dx) > Math.abs(g.dy),
|
|
87
|
+
onPanResponderTerminationRequest: () => false,
|
|
88
|
+
onPanResponderGrant: () => {
|
|
89
|
+
start.current = latest.current.value;
|
|
90
|
+
},
|
|
91
|
+
onPanResponderMove: (_, g) => {
|
|
92
|
+
const {
|
|
93
|
+
onChange: change,
|
|
94
|
+
min: lo,
|
|
95
|
+
max: hi,
|
|
96
|
+
value: now
|
|
97
|
+
} = latest.current;
|
|
98
|
+
const next = clamp(start.current - Math.round(g.dx / step), lo, hi);
|
|
99
|
+
if (next !== now) change(next);
|
|
100
|
+
}
|
|
101
|
+
}), [step]);
|
|
102
|
+
const ticks = [];
|
|
103
|
+
for (let v = min; v <= max; v += 1) {
|
|
104
|
+
ticks.push(/*#__PURE__*/_jsx(View, {
|
|
105
|
+
style: [s.tick, v === 0 ? s.zero : s.major, v < max && {
|
|
106
|
+
marginRight: gap
|
|
107
|
+
}]
|
|
108
|
+
}, `m${v}`));
|
|
109
|
+
if (v < max) {
|
|
110
|
+
for (let j = 0; j < MINOR; j += 1) {
|
|
111
|
+
ticks.push(/*#__PURE__*/_jsx(View, {
|
|
112
|
+
style: [s.tick, {
|
|
113
|
+
marginRight: gap
|
|
114
|
+
}]
|
|
115
|
+
}, `${v}-${j}`));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
120
|
+
...pan.panHandlers,
|
|
121
|
+
accessible: true,
|
|
122
|
+
accessibilityRole: "adjustable",
|
|
123
|
+
accessibilityLabel: accessibilityLabel,
|
|
124
|
+
accessibilityValue: {
|
|
125
|
+
min,
|
|
126
|
+
max,
|
|
127
|
+
now: value
|
|
128
|
+
},
|
|
129
|
+
accessibilityActions: [{
|
|
130
|
+
name: 'increment'
|
|
131
|
+
}, {
|
|
132
|
+
name: 'decrement'
|
|
133
|
+
}],
|
|
134
|
+
onAccessibilityAction: e => onChange(clamp(value + (e.nativeEvent.actionName === 'increment' ? 1 : -1), min, max)),
|
|
135
|
+
style: [s.root, style],
|
|
136
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
137
|
+
style: [s.ticks, {
|
|
138
|
+
transform: [{
|
|
139
|
+
translateX: -(value - min) * step - TICK / 2
|
|
140
|
+
}]
|
|
141
|
+
}],
|
|
142
|
+
children: ticks
|
|
143
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
144
|
+
style: s.needle
|
|
145
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
146
|
+
style: s.ends,
|
|
147
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
148
|
+
variant: "caption",
|
|
149
|
+
tone: "muted",
|
|
150
|
+
children: startLabel ?? ''
|
|
151
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
152
|
+
variant: "caption",
|
|
153
|
+
tone: "muted",
|
|
154
|
+
children: endLabel ?? ''
|
|
155
|
+
})]
|
|
156
|
+
})]
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=scrub-ruler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","useRef","PanResponder","View","Text","useTheme","makeStyles","clamp","jsx","_jsx","jsxs","_jsxs","MINOR","TICK","useStyles","t","root","height","controlSize","lg","marginHorizontal","layout","screenX","overflow","ticks","position","top","space","left","flexDirection","alignItems","tick","width","backgroundColor","colors","input","major","mutedForeground","zero","foreground","needle","marginLeft","borderRadius","radius","sm","primary","ends","right","bottom","justifyContent","ScrubRuler","value","min","max","onChange","startLabel","endLabel","accessibilityLabel","style","s","step","gap","latest","current","start","pan","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","_","g","Math","abs","dx","dy","onPanResponderTerminationRequest","onPanResponderGrant","onPanResponderMove","change","lo","hi","now","next","round","v","push","marginRight","j","panHandlers","accessible","accessibilityRole","accessibilityValue","accessibilityActions","name","onAccessibilityAction","e","nativeEvent","actionName","children","transform","translateX","variant","tone"],"sourceRoot":"../../../src","sources":["adjust/scrub-ruler.tsx"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACvC,SACEC,YAAY,EACZC,IAAI,QAGC,cAAc;AACrB,SAASC,IAAI,QAAQ,4BAAyB;AAC9C,SAASC,QAAQ,QAAQ,4BAAyB;AAClD,SAASC,UAAU,QAAQ,oBAAiB;AAC5C,SAASC,KAAK,QAAQ,UAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAa9B,MAAMC,KAAK,GAAG,CAAC;AACf,MAAMC,IAAI,GAAG,CAAC;AAEd,MAAMC,SAAS,GAAGR,UAAU,CAAES,CAAC,KAAM;EACnCC,IAAI,EAAE;IACJC,MAAM,EAAEF,CAAC,CAACG,WAAW,CAACC,EAAE;IACxBC,gBAAgB,EAAEL,CAAC,CAACM,MAAM,CAACC,OAAO;IAClCC,QAAQ,EAAE;EACZ,CAAC;EACDC,KAAK,EAAE;IACLC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAEX,CAAC,CAACY,KAAK,CAAC,CAAC,CAAC;IACfC,IAAI,EAAE,KAAK;IACXC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDC,IAAI,EAAE;IAAEC,KAAK,EAAEnB,IAAI;IAAEI,MAAM,EAAEF,CAAC,CAACY,KAAK,CAAC,CAAC,CAAC;IAAEM,eAAe,EAAElB,CAAC,CAACmB,MAAM,CAACC;EAAM,CAAC;EAC1EC,KAAK,EAAE;IAAEnB,MAAM,EAAEF,CAAC,CAACY,KAAK,CAAC,CAAC,CAAC;IAAEM,eAAe,EAAElB,CAAC,CAACmB,MAAM,CAACG;EAAgB,CAAC;EACxEC,IAAI,EAAE;IAAErB,MAAM,EAAEF,CAAC,CAACY,KAAK,CAAC,CAAC,CAAC;IAAEM,eAAe,EAAElB,CAAC,CAACm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C,CAACnC,KAAK,EACP;QAAE2E,SAAS,EAAE,CAAC;UAAEC,UAAU,EAAE,EAAEjD,KAAK,GAAGC,GAAG,CAAC,GAAGQ,IAAI,GAAG/C,IAAI,GAAG;QAAE,CAAC;MAAE,CAAC,CACjE;MAAAqF,QAAA,EAED1E;IAAK,CACF,CAAC,eACPf,IAAA,CAACN,IAAI;MAACuD,KAAK,EAAEC,CAAC,CAACnB;IAAO,CAAE,CAAC,eACzB7B,KAAA,CAACR,IAAI;MAACuD,KAAK,EAAEC,CAAC,CAACb,IAAK;MAAAoD,QAAA,gBAClBzF,IAAA,CAACL,IAAI;QAACiG,OAAO,EAAC,SAAS;QAACC,IAAI,EAAC,OAAO;QAAAJ,QAAA,EACjC3C,UAAU,IAAI;MAAE,CACb,CAAC,eACP9C,IAAA,CAACL,IAAI;QAACiG,OAAO,EAAC,SAAS;QAACC,IAAI,EAAC,OAAO;QAAAJ,QAAA,EACjC1C,QAAQ,IAAI;MAAE,CACX,CAAC;IAAA,CACH,CAAC;EAAA,CACH,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["adjust.tsx"],"mappings":";;AAAA,cAAc,mBAAgB","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export { DetailTemplate, DashboardTemplate, FormTemplate, MenuTemplate } from "./scroll-templates.js";
|
|
4
4
|
export { EditorTemplate } from "./editor-template.js";
|
|
5
5
|
export { ListTemplate } from "./list-template.js";
|
|
6
|
+
export { IntroTemplate } from "./intro-template.js";
|
|
6
7
|
export { ResultTemplate } from "./result-template.js";
|
|
7
8
|
export { SystemTemplate } from "./system-template.js";
|
|
8
9
|
export { ListSection } from "./parts.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DetailTemplate","DashboardTemplate","FormTemplate","MenuTemplate","EditorTemplate","ListTemplate","ResultTemplate","SystemTemplate","ListSection","Group"],"sourceRoot":"../../../src","sources":["templates/index.ts"],"mappings":";;AAAA,SACEA,cAAc,EACdC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,QACP,uBAAoB;AAO3B,SAASC,cAAc,QAAQ,sBAAmB;AAMlD,SAASC,YAAY,QAAQ,oBAAiB;AAE9C,SAASC,cAAc,QAAQ,sBAAmB;AAElD,SAASC,cAAc,QAAQ,sBAAmB;AAElD,SAASC,WAAW,QAAQ,YAAS;AACrC,SAASC,KAAK,QAAQ,YAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["DetailTemplate","DashboardTemplate","FormTemplate","MenuTemplate","EditorTemplate","ListTemplate","IntroTemplate","ResultTemplate","SystemTemplate","ListSection","Group"],"sourceRoot":"../../../src","sources":["templates/index.ts"],"mappings":";;AAAA,SACEA,cAAc,EACdC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,QACP,uBAAoB;AAO3B,SAASC,cAAc,QAAQ,sBAAmB;AAMlD,SAASC,YAAY,QAAQ,oBAAiB;AAE9C,SAASC,aAAa,QAAQ,qBAAkB;AAEhD,SAASC,cAAc,QAAQ,sBAAmB;AAElD,SAASC,cAAc,QAAQ,sBAAmB;AAElD,SAASC,WAAW,QAAQ,YAAS;AACrC,SAASC,KAAK,QAAQ,YAAS","ignoreList":[]}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useRef, useState } from 'react';
|
|
4
|
+
import { ScrollView, View } from 'react-native';
|
|
5
|
+
import { Button } from "../components/button/button.js";
|
|
6
|
+
import { Text } from "../components/text/text.js";
|
|
7
|
+
import { PressableBase } from "../internal/pressable-base.js";
|
|
8
|
+
import { useTheme } from "../theme/theme-provider.js";
|
|
9
|
+
import { makeStyles } from "../utils/styles.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const useStyles = makeStyles(t => ({
|
|
12
|
+
root: {
|
|
13
|
+
flex: 1,
|
|
14
|
+
backgroundColor: t.colors.background
|
|
15
|
+
},
|
|
16
|
+
top: {
|
|
17
|
+
height: t.minTouchSize,
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
justifyContent: 'flex-end',
|
|
20
|
+
paddingHorizontal: t.layout.screenX
|
|
21
|
+
},
|
|
22
|
+
skip: {
|
|
23
|
+
minWidth: t.minTouchSize,
|
|
24
|
+
alignItems: 'flex-end',
|
|
25
|
+
justifyContent: 'center'
|
|
26
|
+
},
|
|
27
|
+
pager: {
|
|
28
|
+
flex: 1
|
|
29
|
+
},
|
|
30
|
+
page: {
|
|
31
|
+
flex: 1,
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
gap: t.layout.titleGap,
|
|
34
|
+
paddingHorizontal: t.layout.screenX
|
|
35
|
+
},
|
|
36
|
+
title: {
|
|
37
|
+
textAlign: 'center'
|
|
38
|
+
},
|
|
39
|
+
footer: {
|
|
40
|
+
gap: t.layout.titleGap,
|
|
41
|
+
paddingHorizontal: t.layout.screenX,
|
|
42
|
+
paddingTop: t.layout.footerTop
|
|
43
|
+
},
|
|
44
|
+
dots: {
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
gap: t.space[2]
|
|
48
|
+
},
|
|
49
|
+
dot: {
|
|
50
|
+
width: t.space[2],
|
|
51
|
+
height: t.space[2],
|
|
52
|
+
borderRadius: t.radius.full,
|
|
53
|
+
backgroundColor: t.colors.input
|
|
54
|
+
},
|
|
55
|
+
dotOn: {
|
|
56
|
+
width: t.space[5],
|
|
57
|
+
backgroundColor: t.colors.primary
|
|
58
|
+
}
|
|
59
|
+
}));
|
|
60
|
+
export function IntroTemplate({
|
|
61
|
+
pages,
|
|
62
|
+
onDone,
|
|
63
|
+
nextLabel = '다음',
|
|
64
|
+
doneLabel = '시작하기',
|
|
65
|
+
skipLabel = 'Skip',
|
|
66
|
+
bottomInset = 0
|
|
67
|
+
}) {
|
|
68
|
+
const t = useTheme();
|
|
69
|
+
const s = useStyles();
|
|
70
|
+
const pager = useRef(null);
|
|
71
|
+
const [width, setWidth] = useState(0);
|
|
72
|
+
const [index, setIndex] = useState(0);
|
|
73
|
+
const last = index >= pages.length - 1;
|
|
74
|
+
const art = Math.max(0, width - t.layout.screenX * 2);
|
|
75
|
+
const next = () => {
|
|
76
|
+
if (last) {
|
|
77
|
+
onDone();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
pager.current?.scrollTo({
|
|
81
|
+
x: (index + 1) * width,
|
|
82
|
+
animated: true
|
|
83
|
+
});
|
|
84
|
+
setIndex(index + 1);
|
|
85
|
+
};
|
|
86
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
87
|
+
style: s.root,
|
|
88
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
89
|
+
style: s.top,
|
|
90
|
+
children: last ? null : /*#__PURE__*/_jsx(PressableBase, {
|
|
91
|
+
onPress: onDone,
|
|
92
|
+
accessibilityLabel: skipLabel,
|
|
93
|
+
style: s.skip,
|
|
94
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
95
|
+
variant: "caption",
|
|
96
|
+
tone: "muted",
|
|
97
|
+
children: skipLabel
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
}), /*#__PURE__*/_jsx(ScrollView, {
|
|
101
|
+
ref: pager,
|
|
102
|
+
horizontal: true,
|
|
103
|
+
pagingEnabled: true,
|
|
104
|
+
showsHorizontalScrollIndicator: false,
|
|
105
|
+
onLayout: e => setWidth(e.nativeEvent.layout.width),
|
|
106
|
+
onMomentumScrollEnd: e => width && setIndex(Math.round(e.nativeEvent.contentOffset.x / width)),
|
|
107
|
+
style: s.pager,
|
|
108
|
+
children: pages.map(page => /*#__PURE__*/_jsxs(View, {
|
|
109
|
+
style: [s.page, {
|
|
110
|
+
width
|
|
111
|
+
}],
|
|
112
|
+
children: [art ? page.art(art) : null, /*#__PURE__*/_jsx(Text, {
|
|
113
|
+
variant: "screenTitle",
|
|
114
|
+
accessibilityRole: "header",
|
|
115
|
+
style: s.title,
|
|
116
|
+
children: page.title
|
|
117
|
+
})]
|
|
118
|
+
}, page.key))
|
|
119
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
120
|
+
style: [s.footer, {
|
|
121
|
+
paddingBottom: t.layout.footerBottom + bottomInset
|
|
122
|
+
}],
|
|
123
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
124
|
+
style: s.dots,
|
|
125
|
+
children: pages.map((page, i) => /*#__PURE__*/_jsx(View, {
|
|
126
|
+
style: [s.dot, i === index && s.dotOn]
|
|
127
|
+
}, page.key))
|
|
128
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
129
|
+
size: "lg",
|
|
130
|
+
onPress: next,
|
|
131
|
+
children: last ? doneLabel : nextLabel
|
|
132
|
+
})]
|
|
133
|
+
})]
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=intro-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useRef","useState","ScrollView","View","Button","Text","PressableBase","useTheme","makeStyles","jsx","_jsx","jsxs","_jsxs","useStyles","t","root","flex","backgroundColor","colors","background","top","height","minTouchSize","flexDirection","justifyContent","paddingHorizontal","layout","screenX","skip","minWidth","alignItems","pager","page","gap","titleGap","title","textAlign","footer","paddingTop","footerTop","dots","space","dot","width","borderRadius","radius","full","input","dotOn","primary","IntroTemplate","pages","onDone","nextLabel","doneLabel","skipLabel","bottomInset","s","setWidth","index","setIndex","last","length","art","Math","max","next","current","scrollTo","x","animated","style","children","onPress","accessibilityLabel","variant","tone","ref","horizontal","pagingEnabled","showsHorizontalScrollIndicator","onLayout","e","nativeEvent","onMomentumScrollEnd","round","contentOffset","map","accessibilityRole","key","paddingBottom","footerBottom","i","size"],"sourceRoot":"../../../src","sources":["templates/intro-template.tsx"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,QAAQ,QAA2C,OAAO;AAC3E,SACEC,UAAU,EACVC,IAAI,QAI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AEW;QAAM,CAAC,CAAE;QAAA6B,QAAA,GAC7CT,GAAG,GAAG/B,IAAI,CAAC+B,GAAG,CAACA,GAAG,CAAC,GAAG,IAAI,eAC3BrD,IAAA,CAACL,IAAI;UACHsE,OAAO,EAAC,aAAa;UACrBa,iBAAiB,EAAC,QAAQ;UAC1BjB,KAAK,EAAEd,CAAC,CAACtB,KAAM;UAAAqC,QAAA,EAEdxC,IAAI,CAACG;QAAK,CACP,CAAC;MAAA,GAREH,IAAI,CAACyD,GASV,CACP;IAAC,CACQ,CAAC,eACb7E,KAAA,CAACT,IAAI;MACHoE,KAAK,EAAE,CACLd,CAAC,CAACpB,MAAM,EACR;QAAEqD,aAAa,EAAE5E,CAAC,CAACY,MAAM,CAACiE,YAAY,GAAGnC;MAAY,CAAC,CACtD;MAAAgB,QAAA,gBAEF9D,IAAA,CAACP,IAAI;QAACoE,KAAK,EAAEd,CAAC,CAACjB,IAAK;QAAAgC,QAAA,EACjBrB,KAAK,CAACoC,GAAG,CAAC,CAACvD,IAAI,EAAE4D,CAAC,kBACjBlF,IAAA,CAACP,IAAI;UAAgBoE,KAAK,EAAE,CAACd,CAAC,CAACf,GAAG,EAAEkD,CAAC,KAAKjC,KAAK,IAAIF,CAAC,CAACT,KAAK;QAAE,GAAjDhB,IAAI,CAACyD,GAA8C,CAC/D;MAAC,CACE,CAAC,eACP/E,IAAA,CAACN,MAAM;QAACyF,IAAI,EAAC,IAAI;QAACpB,OAAO,EAAEP,IAAK;QAAAM,QAAA,EAC7BX,IAAI,GAAGP,SAAS,GAAGD;MAAS,CACvB,CAAC;IAAA,CACL,CAAC;EAAA,CACH,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type TemplateAction } from '../templates/parts.js';
|
|
3
|
+
export type AdjustTemplateProps = {
|
|
4
|
+
preview: ReactNode;
|
|
5
|
+
label?: string;
|
|
6
|
+
compareLabel?: string;
|
|
7
|
+
onCompareChange?: (comparing: boolean) => void;
|
|
8
|
+
controls: ReactNode;
|
|
9
|
+
primaryAction: TemplateAction;
|
|
10
|
+
bottomInset?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function AdjustTemplate({ preview, label, compareLabel, onCompareChange, controls, primaryAction, bottomInset, }: AdjustTemplateProps): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=adjust-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjust-template.d.ts","sourceRoot":"","sources":["../../../../src/adjust/adjust-template.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,uBAAoB,CAAC;AAIpE,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,cAAc,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAkCF,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,KAAK,EACL,YAAuB,EACvB,eAAe,EACf,QAAQ,EACR,aAAa,EACb,WAAe,GAChB,EAAE,mBAAmB,+BA8BrB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
export type ColorAdjustNoteProps = {
|
|
3
|
+
original: string;
|
|
4
|
+
applied: string;
|
|
5
|
+
title: string;
|
|
6
|
+
detail?: string;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
};
|
|
9
|
+
export declare function ColorAdjustNote({ original, applied, title, detail, style, }: ColorAdjustNoteProps): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=color-adjust-note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-adjust-note.d.ts","sourceRoot":"","sources":["../../../../src/adjust/color-adjust-note.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAkBF,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,KAAK,GACN,EAAE,oBAAoB,+BA0BtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
export type ColorTrackProps = {
|
|
3
|
+
kind: 'hue' | 'saturation';
|
|
4
|
+
hue: number;
|
|
5
|
+
saturation: number;
|
|
6
|
+
lightness?: number;
|
|
7
|
+
onChange: (value: number) => void;
|
|
8
|
+
label: string;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
};
|
|
11
|
+
export declare function ColorTrack({ kind, hue, saturation, lightness, onChange, label, style, }: ColorTrackProps): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=color-track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-track.d.ts","sourceRoot":"","sources":["../../../../src/adjust/color-track.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAOtB,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,KAAK,GAAG,YAAY,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAgBF,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,GAAG,EACH,UAAU,EACV,SAAc,EACd,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE,eAAe,+BA6FjB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
export type DialItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
value?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
};
|
|
9
|
+
export type DialStripProps = {
|
|
10
|
+
items: readonly DialItem[];
|
|
11
|
+
selected: string;
|
|
12
|
+
onSelect: (key: string) => void;
|
|
13
|
+
style?: StyleProp<ViewStyle>;
|
|
14
|
+
};
|
|
15
|
+
export declare function DialStrip({ items, selected, onSelect, style, }: DialStripProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=dial-strip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-strip.d.ts","sourceRoot":"","sources":["../../../../src/adjust/dial-strip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAOhF,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AA+EF,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,GACN,EAAE,cAAc,+BAqChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hsl.d.ts","sourceRoot":"","sources":["../../../../src/adjust/hsl.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAYhE;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAkB9D;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AdjustTemplate, type AdjustTemplateProps } from './adjust-template.js';
|
|
2
|
+
export { ColorAdjustNote, type ColorAdjustNoteProps, } from './color-adjust-note.js';
|
|
3
|
+
export { ColorTrack, type ColorTrackProps } from './color-track.js';
|
|
4
|
+
export { DialStrip, type DialItem, type DialStripProps } from './dial-strip.js';
|
|
5
|
+
export { ScrubRuler, type ScrubRulerProps } from './scrub-ruler.js';
|
|
6
|
+
export { hexToHsl, hslToHex } from './hsl.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adjust/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAmB,CAAC;AAC7E,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,GAC1B,MAAM,wBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAe,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAc,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAe,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAO,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
export type ScrubRulerProps = {
|
|
3
|
+
value: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
onChange: (value: number) => void;
|
|
7
|
+
startLabel?: string;
|
|
8
|
+
endLabel?: string;
|
|
9
|
+
accessibilityLabel: string;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
};
|
|
12
|
+
export declare function ScrubRuler({ value, min, max, onChange, startLabel, endLabel, accessibilityLabel, style, }: ScrubRulerProps): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=scrub-ruler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrub-ruler.d.ts","sourceRoot":"","sources":["../../../../src/adjust/scrub-ruler.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAyCF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,GAAQ,EACR,GAAO,EACP,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,KAAK,GACN,EAAE,eAAe,+BAwFjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjust.d.ts","sourceRoot":"","sources":["../../../src/adjust.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAgB,CAAC"}
|
|
@@ -4,6 +4,8 @@ export { EditorTemplate } from './editor-template.js';
|
|
|
4
4
|
export type { EditorSheet, EditorTemplateProps, EditorTool, } from './editor-template.js';
|
|
5
5
|
export { ListTemplate } from './list-template.js';
|
|
6
6
|
export type { ListTemplateProps, ListTemplateStatus } from './list-template.js';
|
|
7
|
+
export { IntroTemplate } from './intro-template.js';
|
|
8
|
+
export type { IntroPage, IntroTemplateProps } from './intro-template.js';
|
|
7
9
|
export { ResultTemplate } from './result-template.js';
|
|
8
10
|
export type { ResultPreview, ResultTemplateProps } from './result-template.js';
|
|
9
11
|
export { SystemTemplate } from './system-template.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACb,MAAM,uBAAoB,CAAC;AAC5B,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM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S,EAAE,kBAAkB,EAAE,MAAM,qBAAkB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAmB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAS,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type IntroPage = {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
art: (width: number) => ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export type IntroTemplateProps = {
|
|
8
|
+
pages: readonly IntroPage[];
|
|
9
|
+
onDone: () => void;
|
|
10
|
+
nextLabel?: string;
|
|
11
|
+
doneLabel?: string;
|
|
12
|
+
skipLabel?: string;
|
|
13
|
+
bottomInset?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function IntroTemplate({ pages, onDone, nextLabel, doneLabel, skipLabel, bottomInset, }: IntroTemplateProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=intro-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intro-template.d.ts","sourceRoot":"","sources":["../../../../src/templates/intro-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc5E,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AA0CF,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,MAAM,EACN,SAAgB,EAChB,SAAkB,EAClB,SAAkB,EAClB,WAAe,GAChB,EAAE,kBAAkB,+BA4EpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezpg/app-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "React Native UI components for EZPG partner apps",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
"types": "./lib/typescript/src/charts.d.ts",
|
|
16
16
|
"default": "./lib/module/charts.js"
|
|
17
17
|
},
|
|
18
|
+
"./adjust": {
|
|
19
|
+
"ezpg-app-ui-source": "./src/adjust.tsx",
|
|
20
|
+
"types": "./lib/typescript/src/adjust.d.ts",
|
|
21
|
+
"default": "./lib/module/adjust.js"
|
|
22
|
+
},
|
|
18
23
|
"./sortable": {
|
|
19
24
|
"ezpg-app-ui-source": "./src/sortable.tsx",
|
|
20
25
|
"types": "./lib/typescript/src/sortable.d.ts",
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { Text } from '../components/text/text';
|
|
4
|
+
import { PressableBase } from '../internal/pressable-base';
|
|
5
|
+
import { BottomBar, type TemplateAction } from '../templates/parts';
|
|
6
|
+
import { useTheme } from '../theme/theme-provider';
|
|
7
|
+
import { makeStyles } from '../utils/styles';
|
|
8
|
+
|
|
9
|
+
export type AdjustTemplateProps = {
|
|
10
|
+
preview: ReactNode;
|
|
11
|
+
label?: string;
|
|
12
|
+
compareLabel?: string;
|
|
13
|
+
onCompareChange?: (comparing: boolean) => void;
|
|
14
|
+
controls: ReactNode;
|
|
15
|
+
primaryAction: TemplateAction;
|
|
16
|
+
bottomInset?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const useStyles = makeStyles((t) => ({
|
|
20
|
+
root: { flex: 1, backgroundColor: t.colors.background },
|
|
21
|
+
stage: {
|
|
22
|
+
flex: 1,
|
|
23
|
+
minHeight: 0,
|
|
24
|
+
backgroundColor: t.colors.muted,
|
|
25
|
+
overflow: 'hidden',
|
|
26
|
+
},
|
|
27
|
+
label: {
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
alignSelf: 'center',
|
|
30
|
+
bottom: t.space[2],
|
|
31
|
+
paddingHorizontal: t.space[2],
|
|
32
|
+
paddingVertical: t.space[1],
|
|
33
|
+
borderRadius: t.radius.sm,
|
|
34
|
+
backgroundColor: t.colors.foreground,
|
|
35
|
+
opacity: 0.72,
|
|
36
|
+
},
|
|
37
|
+
compare: {
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
top: t.space[2],
|
|
40
|
+
right: t.space[3],
|
|
41
|
+
paddingHorizontal: t.space[3],
|
|
42
|
+
paddingVertical: t.space[1],
|
|
43
|
+
borderRadius: t.radius.full,
|
|
44
|
+
borderWidth: 1,
|
|
45
|
+
borderColor: t.colors.border,
|
|
46
|
+
backgroundColor: t.colors.background,
|
|
47
|
+
},
|
|
48
|
+
controls: { paddingTop: t.layout.groupGap, gap: t.layout.groupGap },
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
export function AdjustTemplate({
|
|
52
|
+
preview,
|
|
53
|
+
label,
|
|
54
|
+
compareLabel = '원래와 비교',
|
|
55
|
+
onCompareChange,
|
|
56
|
+
controls,
|
|
57
|
+
primaryAction,
|
|
58
|
+
bottomInset = 0,
|
|
59
|
+
}: AdjustTemplateProps) {
|
|
60
|
+
const t = useTheme();
|
|
61
|
+
const s = useStyles();
|
|
62
|
+
return (
|
|
63
|
+
<View style={s.root}>
|
|
64
|
+
<View style={s.stage}>
|
|
65
|
+
{preview}
|
|
66
|
+
{label ? (
|
|
67
|
+
<View style={s.label} pointerEvents="none">
|
|
68
|
+
<Text variant="caption" style={{ color: t.colors.background }}>
|
|
69
|
+
{label}
|
|
70
|
+
</Text>
|
|
71
|
+
</View>
|
|
72
|
+
) : null}
|
|
73
|
+
{onCompareChange ? (
|
|
74
|
+
<PressableBase
|
|
75
|
+
onPressIn={() => onCompareChange(true)}
|
|
76
|
+
onPressOut={() => onCompareChange(false)}
|
|
77
|
+
accessibilityRole="button"
|
|
78
|
+
accessibilityLabel={compareLabel}
|
|
79
|
+
style={s.compare}
|
|
80
|
+
>
|
|
81
|
+
<Text variant="caption">{compareLabel}</Text>
|
|
82
|
+
</PressableBase>
|
|
83
|
+
) : null}
|
|
84
|
+
</View>
|
|
85
|
+
<View style={s.controls}>{controls}</View>
|
|
86
|
+
<BottomBar primaryAction={primaryAction} bottomInset={bottomInset} />
|
|
87
|
+
</View>
|
|
88
|
+
);
|
|
89
|
+
}
|