@ezpg/app-ui 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/lib/module/blocks/index.js +1 -0
- package/lib/module/blocks/index.js.map +1 -1
- package/lib/module/blocks/question-accordion/index.js +4 -0
- package/lib/module/blocks/question-accordion/index.js.map +1 -0
- package/lib/module/blocks/question-accordion/question-accordion.js +256 -0
- package/lib/module/blocks/question-accordion/question-accordion.js.map +1 -0
- package/lib/module/blocks/step-screen/step-screen.js +2 -3
- package/lib/module/blocks/step-screen/step-screen.js.map +1 -1
- package/lib/module/components/page-header/page-header.js +4 -2
- package/lib/module/components/page-header/page-header.js.map +1 -1
- package/lib/module/components/text/text.js +4 -1
- package/lib/module/components/text/text.js.map +1 -1
- package/lib/module/templates/result-template.js +2 -3
- package/lib/module/templates/result-template.js.map +1 -1
- package/lib/module/theme/base.js +22 -2
- package/lib/module/theme/base.js.map +1 -1
- package/lib/typescript/src/blocks/index.d.ts +1 -0
- package/lib/typescript/src/blocks/index.d.ts.map +1 -1
- package/lib/typescript/src/blocks/question-accordion/index.d.ts +2 -0
- package/lib/typescript/src/blocks/question-accordion/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/question-accordion/question-accordion.d.ts +27 -0
- package/lib/typescript/src/blocks/question-accordion/question-accordion.d.ts.map +1 -0
- package/lib/typescript/src/components/page-header/page-header.d.ts.map +1 -1
- package/lib/typescript/src/components/text/text.d.ts.map +1 -1
- package/lib/typescript/src/theme/base.d.ts +21 -1
- package/lib/typescript/src/theme/base.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +7 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/blocks/index.tsx +1 -0
- package/src/blocks/question-accordion/index.ts +6 -0
- package/src/blocks/question-accordion/question-accordion.tsx +254 -0
- package/src/blocks/step-screen/step-screen.tsx +3 -3
- package/src/components/page-header/page-header.tsx +4 -1
- package/src/components/text/text.tsx +9 -1
- package/src/templates/result-template.tsx +3 -3
- package/src/theme/base.ts +22 -1
- package/src/types/index.ts +10 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/index.tsx"],"names":[],"mappings":"AAAA,cAAc,+BAAsB,CAAC;AACrC,cAAc,2BAAkB,CAAC;AACjC,cAAc,sBAAa,CAAC;AAC5B,cAAc,uBAAc,CAAC;AAC7B,cAAc,yBAAgB,CAAC;AAC/B,cAAc,wBAAe,CAAC;AAC9B,cAAc,gCAAuB,CAAC;AACtC,cAAc,gCAAuB,CAAC;AACtC,cAAc,0BAAiB,CAAC;AAChC,cAAc,0BAAiB,CAAC;AAChC,cAAc,gCAAuB,CAAC;AACtC,cAAc,wBAAe,CAAC;AAC9B,cAAc,gCAAuB,CAAC;AACtC,cAAc,0BAAiB,CAAC;AAChC,cAAc,uBAAc,CAAC;AAC7B,cAAc,sBAAa,CAAC;AAC5B,cAAc,+BAAsB,CAAC;AACrC,cAAc,wBAAe,CAAC;AAC9B,cAAc,uBAAc,CAAC;AAC7B,cAAc,0BAAiB,CAAC;AAChC,cAAc,iCAAwB,CAAC;AACvC,cAAc,kCAAyB,CAAC;AACxC,cAAc,+BAAsB,CAAC;AACrC,cAAc,sBAAa,CAAC;AAC5B,cAAc,wBAAe,CAAC;AAC9B,cAAc,6BAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAmB,CAAC;AACjE,cAAc,sBAAa,CAAC;AAC5B,cAAc,wBAAe,CAAC;AAC9B,cAAc,uBAAc,CAAC;AAC7B,cAAc,sBAAa,CAAC;AAC5B,cAAc,yBAAgB,CAAC;AAC/B,cAAc,0BAAiB,CAAC;AAChC,cAAc,wBAAe,CAAC;AAC9B,cAAc,yBAAgB,CAAC;AAC/B,cAAc,yBAAgB,CAAC;AAC/B,cAAc,wBAAe,CAAC;AA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C;AAC9B,cAAc,uBAAc,CAAC;AAC7B,cAAc,0BAAiB,CAAC;AAChC,cAAc,yBAAgB,CAAC;AAC/B,cAAc,uBAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/question-accordion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,yBAAsB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
export type QuestionOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export type QuestionSection = {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
question: string;
|
|
10
|
+
options: readonly QuestionOption[];
|
|
11
|
+
value: readonly string[];
|
|
12
|
+
hint?: string;
|
|
13
|
+
max?: number;
|
|
14
|
+
other?: string;
|
|
15
|
+
};
|
|
16
|
+
export type QuestionAccordionProps = {
|
|
17
|
+
sections: readonly QuestionSection[];
|
|
18
|
+
openKey: string | null;
|
|
19
|
+
onOpenChange: (key: string | null) => void;
|
|
20
|
+
onValueChange: (key: string, value: string[]) => void;
|
|
21
|
+
onOtherChange?: (key: string, text: string) => void;
|
|
22
|
+
otherLabel?: string;
|
|
23
|
+
otherMax?: number;
|
|
24
|
+
style?: StyleProp<ViewStyle>;
|
|
25
|
+
};
|
|
26
|
+
export declare function QuestionAccordion({ sections, openKey, onOpenChange, onValueChange, onOtherChange, otherLabel, otherMax, style, }: QuestionAccordionProps): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=question-accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question-accordion.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/question-accordion/question-accordion.tsx"],"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ts","sourceRoot":"","sources":["../../../../../src/components/page-header/page-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AAMhE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;
|
|
1
|
+
{"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../../../../src/components/page-header/page-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AAMhE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAwCF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,iBAAiB,+BAoB3E;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qCAIpD;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,MAAM,EACN,QAAY,EACZ,KAAK,GACN,EAAE,eAAe,+BA0BjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,KAAK,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAa,CAAC;AAIrD,MAAM,MAAM,QAAQ,GAClB,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,KAAK,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAa,CAAC;AAIrD,MAAM,MAAM,QAAQ,GAClB,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAyBpE,wBAAgB,IAAI,CAAC,EACnB,OAAgB,EAChB,IAAgB,EAChB,MAAM,EACN,KAAK,EACL,GAAG,IAAI,EACR,EAAE,SAAS,+BAiBX"}
|
|
@@ -3,6 +3,9 @@ export declare const semantic: {
|
|
|
3
3
|
readonly background: "#f4f4f5";
|
|
4
4
|
readonly surface: "#ffffff";
|
|
5
5
|
readonly foreground: "#1a1a1a";
|
|
6
|
+
readonly title: "#2a2d33";
|
|
7
|
+
readonly selectSurface: "#fdf6f2";
|
|
8
|
+
readonly selectForeground: "#9a3412";
|
|
6
9
|
readonly muted: "#f0f0f0";
|
|
7
10
|
readonly mutedForeground: "#626262";
|
|
8
11
|
readonly border: "#e3e3e3";
|
|
@@ -28,6 +31,9 @@ export declare const semantic: {
|
|
|
28
31
|
readonly background: "#0a0a0a";
|
|
29
32
|
readonly surface: "#171717";
|
|
30
33
|
readonly foreground: "#fafafa";
|
|
34
|
+
readonly title: "#fafafa";
|
|
35
|
+
readonly selectSurface: "#5f2814";
|
|
36
|
+
readonly selectForeground: "#f6b298";
|
|
31
37
|
readonly muted: "#262626";
|
|
32
38
|
readonly mutedForeground: "#a3a3a3";
|
|
33
39
|
readonly border: "#262626";
|
|
@@ -68,6 +74,7 @@ export declare const radius: {
|
|
|
68
74
|
readonly sm: 6;
|
|
69
75
|
readonly md: 8;
|
|
70
76
|
readonly lg: 12;
|
|
77
|
+
readonly xl: 20;
|
|
71
78
|
readonly full: 9999;
|
|
72
79
|
};
|
|
73
80
|
export declare const typography: {
|
|
@@ -91,6 +98,17 @@ export declare const typography: {
|
|
|
91
98
|
readonly lineHeight: 24;
|
|
92
99
|
readonly fontWeight: "400";
|
|
93
100
|
};
|
|
101
|
+
readonly eyebrow: {
|
|
102
|
+
readonly fontSize: 13;
|
|
103
|
+
readonly lineHeight: 18;
|
|
104
|
+
readonly fontWeight: "500";
|
|
105
|
+
};
|
|
106
|
+
readonly question: {
|
|
107
|
+
readonly fontSize: 18;
|
|
108
|
+
readonly lineHeight: 26;
|
|
109
|
+
readonly fontWeight: "500";
|
|
110
|
+
readonly letterSpacing: -0.4;
|
|
111
|
+
};
|
|
94
112
|
readonly title: {
|
|
95
113
|
readonly fontSize: 20;
|
|
96
114
|
readonly lineHeight: 28;
|
|
@@ -99,7 +117,8 @@ export declare const typography: {
|
|
|
99
117
|
readonly screenTitle: {
|
|
100
118
|
readonly fontSize: 24;
|
|
101
119
|
readonly lineHeight: 32;
|
|
102
|
-
readonly fontWeight: "
|
|
120
|
+
readonly fontWeight: "600";
|
|
121
|
+
readonly letterSpacing: -0.6;
|
|
103
122
|
};
|
|
104
123
|
readonly display: {
|
|
105
124
|
readonly fontSize: 28;
|
|
@@ -110,6 +129,7 @@ export declare const typography: {
|
|
|
110
129
|
export declare const shadow: {
|
|
111
130
|
readonly sm: "0px 1px 2px rgba(0, 0, 0, 0.08)";
|
|
112
131
|
readonly md: "0px 4px 12px rgba(0, 0, 0, 0.12)";
|
|
132
|
+
readonly panel: "0px 1px 2px rgba(17, 24, 39, 0.04), 0px 8px 24px rgba(17, 24, 39, 0.04)";
|
|
113
133
|
};
|
|
114
134
|
export declare const motion: {
|
|
115
135
|
readonly duration: 200;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/theme/base.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/theme/base.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDX,CAAC;AAEX,eAAO,MAAM,IAAI,kEAMP,CAAC;AAEX,eAAO,MAAM,KAAK;;;;;;;;;;;;CAYR,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;;CAMT,CAAC;AAEX,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDb,CAAC;AAEX,eAAO,MAAM,MAAM;;;;CAKT,CAAC;AAEX,eAAO,MAAM,MAAM;;CAET,CAAC;AAEX,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAEX,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAEX,eAAO,MAAM,KAAK;;;CAGR,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;;;;;CAST,CAAC;AAEX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,eAAO,MAAM,KAAK;;;;;CAKR,CAAC"}
|
|
@@ -4,6 +4,9 @@ export type ThemeColors = {
|
|
|
4
4
|
background: string;
|
|
5
5
|
surface: string;
|
|
6
6
|
foreground: string;
|
|
7
|
+
title: string;
|
|
8
|
+
selectSurface: string;
|
|
9
|
+
selectForeground: string;
|
|
7
10
|
muted: string;
|
|
8
11
|
mutedForeground: string;
|
|
9
12
|
border: string;
|
|
@@ -30,6 +33,7 @@ export type TypographyToken = {
|
|
|
30
33
|
fontSize: number;
|
|
31
34
|
lineHeight: number;
|
|
32
35
|
fontWeight: TextStyle['fontWeight'];
|
|
36
|
+
letterSpacing?: number;
|
|
33
37
|
};
|
|
34
38
|
export type ThemeTokens = {
|
|
35
39
|
space: {
|
|
@@ -49,14 +53,16 @@ export type ThemeTokens = {
|
|
|
49
53
|
sm: number;
|
|
50
54
|
md: number;
|
|
51
55
|
lg: number;
|
|
56
|
+
xl: number;
|
|
52
57
|
full: number;
|
|
53
58
|
};
|
|
54
|
-
typography: Record<TypographyVariant, TypographyToken>;
|
|
59
|
+
typography: Record<TypographyVariant | 'eyebrow' | 'question', TypographyToken>;
|
|
55
60
|
fontFamily: string | undefined;
|
|
56
61
|
maxFontScale: number;
|
|
57
62
|
shadow: {
|
|
58
63
|
sm: string;
|
|
59
64
|
md: string;
|
|
65
|
+
panel: string;
|
|
60
66
|
};
|
|
61
67
|
motion: {
|
|
62
68
|
duration: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAA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CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAEhD,KAAK,WAAW,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC;CAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezpg/app-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.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",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"
|
|
9
|
+
"zdot-app-ui-source": "./src/index.tsx",
|
|
10
10
|
"types": "./lib/typescript/src/index.d.ts",
|
|
11
11
|
"default": "./lib/module/index.js"
|
|
12
12
|
},
|
|
13
13
|
"./charts": {
|
|
14
|
-
"
|
|
14
|
+
"zdot-app-ui-source": "./src/charts.tsx",
|
|
15
15
|
"types": "./lib/typescript/src/charts.d.ts",
|
|
16
16
|
"default": "./lib/module/charts.js"
|
|
17
17
|
},
|
|
18
18
|
"./adjust": {
|
|
19
|
-
"
|
|
19
|
+
"zdot-app-ui-source": "./src/adjust.tsx",
|
|
20
20
|
"types": "./lib/typescript/src/adjust.d.ts",
|
|
21
21
|
"default": "./lib/module/adjust.js"
|
|
22
22
|
},
|
|
23
23
|
"./sortable": {
|
|
24
|
-
"
|
|
24
|
+
"zdot-app-ui-source": "./src/sortable.tsx",
|
|
25
25
|
"types": "./lib/typescript/src/sortable.d.ts",
|
|
26
26
|
"default": "./lib/module/sortable.js"
|
|
27
27
|
},
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"ui",
|
|
49
49
|
"design-system",
|
|
50
50
|
"components",
|
|
51
|
-
"
|
|
51
|
+
"zdot"
|
|
52
52
|
],
|
|
53
53
|
"repository": {
|
|
54
54
|
"type": "git",
|
package/src/blocks/index.tsx
CHANGED
|
@@ -34,6 +34,7 @@ export * from './quick-actions';
|
|
|
34
34
|
export * from './action-grid';
|
|
35
35
|
export * from './site-summary';
|
|
36
36
|
export * from './cover-photos';
|
|
37
|
+
export * from './question-accordion';
|
|
37
38
|
export * from './slider-list';
|
|
38
39
|
export * from './scan-modal';
|
|
39
40
|
export * from './summary-cards';
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { TextInput, View, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { Text } from '../../components/text/text';
|
|
4
|
+
import { ChevronGlyph } from '../../internal/glyphs';
|
|
5
|
+
import { PressableBase } from '../../internal/pressable-base';
|
|
6
|
+
import { useTheme } from '../../theme/theme-provider';
|
|
7
|
+
import { makeStyles } from '../../utils/styles';
|
|
8
|
+
|
|
9
|
+
export type QuestionOption = { value: string; label: string };
|
|
10
|
+
|
|
11
|
+
export type QuestionSection = {
|
|
12
|
+
key: string;
|
|
13
|
+
label: string;
|
|
14
|
+
question: string;
|
|
15
|
+
options: readonly QuestionOption[];
|
|
16
|
+
value: readonly string[];
|
|
17
|
+
hint?: string;
|
|
18
|
+
max?: number;
|
|
19
|
+
other?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type QuestionAccordionProps = {
|
|
23
|
+
sections: readonly QuestionSection[];
|
|
24
|
+
openKey: string | null;
|
|
25
|
+
onOpenChange: (key: string | null) => void;
|
|
26
|
+
onValueChange: (key: string, value: string[]) => void;
|
|
27
|
+
onOtherChange?: (key: string, text: string) => void;
|
|
28
|
+
otherLabel?: string;
|
|
29
|
+
otherMax?: number;
|
|
30
|
+
style?: StyleProp<ViewStyle>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const ROW = 54;
|
|
34
|
+
const CELL = 50;
|
|
35
|
+
const DOT = 6;
|
|
36
|
+
|
|
37
|
+
const useStyles = makeStyles((t) => ({
|
|
38
|
+
row: {
|
|
39
|
+
height: ROW,
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
gap: t.space[2],
|
|
43
|
+
},
|
|
44
|
+
line: { borderTopWidth: 1, borderTopColor: t.colors.border },
|
|
45
|
+
index: {
|
|
46
|
+
width: t.space[6],
|
|
47
|
+
...t.typography.caption,
|
|
48
|
+
fontWeight: '500',
|
|
49
|
+
color: t.colors.ring,
|
|
50
|
+
fontVariant: ['tabular-nums'],
|
|
51
|
+
},
|
|
52
|
+
label: { ...t.typography.label, color: t.colors.mutedForeground },
|
|
53
|
+
summary: {
|
|
54
|
+
flex: 1,
|
|
55
|
+
textAlign: 'right',
|
|
56
|
+
...t.typography.body,
|
|
57
|
+
fontWeight: '500',
|
|
58
|
+
color: t.colors.title,
|
|
59
|
+
},
|
|
60
|
+
chevron: { transform: [{ rotate: '90deg' }] },
|
|
61
|
+
panel: {
|
|
62
|
+
marginHorizontal: -t.space[3],
|
|
63
|
+
marginVertical: t.space[2],
|
|
64
|
+
paddingTop: t.space[4],
|
|
65
|
+
paddingBottom: t.space[3],
|
|
66
|
+
paddingHorizontal: t.space[3],
|
|
67
|
+
borderRadius: t.radius.xl,
|
|
68
|
+
backgroundColor: t.colors.surface,
|
|
69
|
+
boxShadow: t.shadow.panel,
|
|
70
|
+
},
|
|
71
|
+
head: { flexDirection: 'row', alignItems: 'center', gap: t.space[2] },
|
|
72
|
+
openIndex: { color: t.colors.primary },
|
|
73
|
+
eyebrow: { ...t.typography.eyebrow, color: t.colors.primary },
|
|
74
|
+
hint: {
|
|
75
|
+
marginLeft: 'auto',
|
|
76
|
+
...t.typography.caption,
|
|
77
|
+
color: t.colors.ring,
|
|
78
|
+
},
|
|
79
|
+
question: {
|
|
80
|
+
marginTop: t.space[2],
|
|
81
|
+
marginBottom: t.space[4],
|
|
82
|
+
...t.typography.question,
|
|
83
|
+
color: t.colors.title,
|
|
84
|
+
},
|
|
85
|
+
grid: {
|
|
86
|
+
flexDirection: 'row',
|
|
87
|
+
flexWrap: 'wrap',
|
|
88
|
+
borderTopWidth: 1,
|
|
89
|
+
borderTopColor: t.colors.border,
|
|
90
|
+
},
|
|
91
|
+
cell: {
|
|
92
|
+
width: '50%',
|
|
93
|
+
height: CELL,
|
|
94
|
+
justifyContent: 'center',
|
|
95
|
+
paddingHorizontal: t.space[3],
|
|
96
|
+
borderBottomWidth: 1,
|
|
97
|
+
borderBottomColor: t.colors.border,
|
|
98
|
+
},
|
|
99
|
+
right: { borderLeftWidth: 1, borderLeftColor: t.colors.border },
|
|
100
|
+
picked: { backgroundColor: t.colors.selectSurface },
|
|
101
|
+
cellText: { ...t.typography.body, color: t.colors.mutedForeground },
|
|
102
|
+
pickedText: { fontWeight: '500', color: t.colors.selectForeground },
|
|
103
|
+
otherText: { color: t.colors.ring },
|
|
104
|
+
dot: {
|
|
105
|
+
position: 'absolute',
|
|
106
|
+
right: t.space[3],
|
|
107
|
+
width: DOT,
|
|
108
|
+
height: DOT,
|
|
109
|
+
borderRadius: t.radius.full,
|
|
110
|
+
backgroundColor: t.colors.primary,
|
|
111
|
+
},
|
|
112
|
+
input: {
|
|
113
|
+
marginTop: t.space[3],
|
|
114
|
+
paddingVertical: t.space[2],
|
|
115
|
+
borderBottomWidth: 1,
|
|
116
|
+
borderBottomColor: t.colors.input,
|
|
117
|
+
...t.typography.body,
|
|
118
|
+
color: t.colors.title,
|
|
119
|
+
},
|
|
120
|
+
}));
|
|
121
|
+
|
|
122
|
+
function pad(n: number): string {
|
|
123
|
+
return String(n).padStart(2, '0');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function QuestionAccordion({
|
|
127
|
+
sections,
|
|
128
|
+
openKey,
|
|
129
|
+
onOpenChange,
|
|
130
|
+
onValueChange,
|
|
131
|
+
onOtherChange,
|
|
132
|
+
otherLabel = '기타 · 직접 입력',
|
|
133
|
+
otherMax = 20,
|
|
134
|
+
style,
|
|
135
|
+
}: QuestionAccordionProps) {
|
|
136
|
+
const t = useTheme();
|
|
137
|
+
const s = useStyles();
|
|
138
|
+
const [typing, setTyping] = useState<string | null>(null);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<View style={style}>
|
|
142
|
+
{sections.map((section, i) => {
|
|
143
|
+
const open = section.key === openKey;
|
|
144
|
+
const prevOpen = i > 0 && sections[i - 1]?.key === openKey;
|
|
145
|
+
const chosen = section.options
|
|
146
|
+
.filter((o) => section.value.includes(o.value))
|
|
147
|
+
.map((o) => o.label);
|
|
148
|
+
const summary = [
|
|
149
|
+
...chosen,
|
|
150
|
+
...(section.other ? [section.other] : []),
|
|
151
|
+
].join(' · ');
|
|
152
|
+
if (!open) {
|
|
153
|
+
return (
|
|
154
|
+
<PressableBase
|
|
155
|
+
key={section.key}
|
|
156
|
+
accessibilityRole="button"
|
|
157
|
+
accessibilityState={{ expanded: false }}
|
|
158
|
+
accessibilityLabel={
|
|
159
|
+
summary ? `${section.label}, ${summary}` : section.label
|
|
160
|
+
}
|
|
161
|
+
onPress={() => onOpenChange(section.key)}
|
|
162
|
+
style={[s.row, i > 0 && !prevOpen && s.line]}
|
|
163
|
+
>
|
|
164
|
+
<Text style={s.index}>{pad(i + 1)}</Text>
|
|
165
|
+
<Text style={s.label}>{section.label}</Text>
|
|
166
|
+
<Text numberOfLines={1} style={s.summary}>
|
|
167
|
+
{summary}
|
|
168
|
+
</Text>
|
|
169
|
+
<View style={s.chevron}>
|
|
170
|
+
<ChevronGlyph color={t.colors.ring} size={16} />
|
|
171
|
+
</View>
|
|
172
|
+
</PressableBase>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
const max = section.max ?? section.options.length;
|
|
176
|
+
const otherOn = typing === section.key || Boolean(section.other);
|
|
177
|
+
const cells = [
|
|
178
|
+
...section.options.map((o) => ({ ...o, other: false })),
|
|
179
|
+
...(onOtherChange
|
|
180
|
+
? [{ value: '__other', label: otherLabel, other: true }]
|
|
181
|
+
: []),
|
|
182
|
+
];
|
|
183
|
+
return (
|
|
184
|
+
<View key={section.key} style={s.panel}>
|
|
185
|
+
<View style={s.head}>
|
|
186
|
+
<Text style={[s.index, s.openIndex]}>{pad(i + 1)}</Text>
|
|
187
|
+
<Text accessibilityRole="header" style={s.eyebrow}>
|
|
188
|
+
{section.label}
|
|
189
|
+
</Text>
|
|
190
|
+
{section.hint ? <Text style={s.hint}>{section.hint}</Text> : null}
|
|
191
|
+
</View>
|
|
192
|
+
<Text style={s.question}>{section.question}</Text>
|
|
193
|
+
<View accessibilityRole="list" style={s.grid}>
|
|
194
|
+
{cells.map((cell, c) => {
|
|
195
|
+
const picked = cell.other
|
|
196
|
+
? otherOn
|
|
197
|
+
: section.value.includes(cell.value);
|
|
198
|
+
return (
|
|
199
|
+
<PressableBase
|
|
200
|
+
key={cell.value}
|
|
201
|
+
accessibilityRole="checkbox"
|
|
202
|
+
accessibilityState={{ checked: picked }}
|
|
203
|
+
accessibilityLabel={cell.label}
|
|
204
|
+
onPress={() => {
|
|
205
|
+
if (cell.other) {
|
|
206
|
+
if (otherOn) {
|
|
207
|
+
setTyping(null);
|
|
208
|
+
onOtherChange?.(section.key, '');
|
|
209
|
+
} else {
|
|
210
|
+
setTyping(section.key);
|
|
211
|
+
}
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const next = picked
|
|
215
|
+
? section.value.filter((v) => v !== cell.value)
|
|
216
|
+
: section.value.length < max
|
|
217
|
+
? [...section.value, cell.value]
|
|
218
|
+
: [...section.value];
|
|
219
|
+
onValueChange(section.key, next);
|
|
220
|
+
}}
|
|
221
|
+
style={[s.cell, c % 2 === 1 && s.right, picked && s.picked]}
|
|
222
|
+
>
|
|
223
|
+
<Text
|
|
224
|
+
numberOfLines={1}
|
|
225
|
+
style={[
|
|
226
|
+
s.cellText,
|
|
227
|
+
cell.other && !picked && s.otherText,
|
|
228
|
+
picked && s.pickedText,
|
|
229
|
+
]}
|
|
230
|
+
>
|
|
231
|
+
{cell.label}
|
|
232
|
+
</Text>
|
|
233
|
+
{picked ? <View style={s.dot} /> : null}
|
|
234
|
+
</PressableBase>
|
|
235
|
+
);
|
|
236
|
+
})}
|
|
237
|
+
</View>
|
|
238
|
+
{otherOn ? (
|
|
239
|
+
<TextInput
|
|
240
|
+
value={section.other ?? ''}
|
|
241
|
+
onChangeText={(text) => onOtherChange?.(section.key, text)}
|
|
242
|
+
maxLength={otherMax}
|
|
243
|
+
autoFocus={typing === section.key && !section.other}
|
|
244
|
+
accessibilityLabel={`${section.label} ${otherLabel}`}
|
|
245
|
+
placeholderTextColor={t.colors.ring}
|
|
246
|
+
style={s.input}
|
|
247
|
+
/>
|
|
248
|
+
) : null}
|
|
249
|
+
</View>
|
|
250
|
+
);
|
|
251
|
+
})}
|
|
252
|
+
</View>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
@@ -56,8 +56,8 @@ const useStyles = makeStyles((t) => ({
|
|
|
56
56
|
paddingBottom: t.layout.footerBottom,
|
|
57
57
|
},
|
|
58
58
|
title: {
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
...t.typography.screenTitle,
|
|
60
|
+
color: t.colors.title,
|
|
61
61
|
},
|
|
62
62
|
footer: {
|
|
63
63
|
gap: t.layout.itemGap,
|
|
@@ -136,7 +136,7 @@ export function StepScreen({
|
|
|
136
136
|
keyboardShouldPersistTaps="handled"
|
|
137
137
|
>
|
|
138
138
|
{top}
|
|
139
|
-
<Text
|
|
139
|
+
<Text accessibilityRole="header" style={s.title}>
|
|
140
140
|
{title}
|
|
141
141
|
</Text>
|
|
142
142
|
{children}
|
|
@@ -34,6 +34,9 @@ const useStyles = makeStyles((t) => ({
|
|
|
34
34
|
title: {
|
|
35
35
|
fontSize: t.typography.display.fontSize,
|
|
36
36
|
lineHeight: t.typography.display.lineHeight,
|
|
37
|
+
fontWeight: t.typography.screenTitle.fontWeight,
|
|
38
|
+
letterSpacing: t.typography.screenTitle.letterSpacing,
|
|
39
|
+
color: t.colors.title,
|
|
37
40
|
},
|
|
38
41
|
action: {
|
|
39
42
|
width: t.minTouchSize,
|
|
@@ -98,7 +101,7 @@ export function PageHeader({
|
|
|
98
101
|
const s = useStyles();
|
|
99
102
|
return (
|
|
100
103
|
<View style={[s.root, { paddingTop: t.space[5] + topInset }, style]}>
|
|
101
|
-
<Text
|
|
104
|
+
<Text accessibilityRole="header" style={s.title}>
|
|
102
105
|
{title}
|
|
103
106
|
</Text>
|
|
104
107
|
{action && !action.icon ? (
|
|
@@ -25,6 +25,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
25
25
|
screenTitle: t.typography.screenTitle,
|
|
26
26
|
display: t.typography.display,
|
|
27
27
|
default: { color: t.colors.foreground },
|
|
28
|
+
heading: { color: t.colors.title },
|
|
28
29
|
muted: { color: t.colors.mutedForeground },
|
|
29
30
|
primary: { color: t.colors.primary },
|
|
30
31
|
point: { color: t.colors.point },
|
|
@@ -51,7 +52,14 @@ export function Text({
|
|
|
51
52
|
<RNText
|
|
52
53
|
maxFontSizeMultiplier={t.maxFontScale}
|
|
53
54
|
{...rest}
|
|
54
|
-
style={[
|
|
55
|
+
style={[
|
|
56
|
+
s.font,
|
|
57
|
+
s[variant],
|
|
58
|
+
s[tone],
|
|
59
|
+
variant === 'screenTitle' && tone === 'default' && s.heading,
|
|
60
|
+
weight && s[weight],
|
|
61
|
+
style,
|
|
62
|
+
]}
|
|
55
63
|
/>
|
|
56
64
|
);
|
|
57
65
|
}
|
|
@@ -47,8 +47,8 @@ const useStyles = makeStyles((t) => ({
|
|
|
47
47
|
paddingTop: t.layout.screenTop,
|
|
48
48
|
paddingBottom: t.layout.groupGap,
|
|
49
49
|
paddingHorizontal: t.layout.screenX,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
...t.typography.screenTitle,
|
|
51
|
+
color: t.colors.title,
|
|
52
52
|
},
|
|
53
53
|
pager: { flex: 1 },
|
|
54
54
|
page: { gap: t.space[2] },
|
|
@@ -185,7 +185,7 @@ export function ResultTemplate({
|
|
|
185
185
|
return (
|
|
186
186
|
<View style={s.root}>
|
|
187
187
|
{title ? (
|
|
188
|
-
<Text
|
|
188
|
+
<Text accessibilityRole="header" style={s.heading}>
|
|
189
189
|
{title}
|
|
190
190
|
</Text>
|
|
191
191
|
) : null}
|
package/src/theme/base.ts
CHANGED
|
@@ -3,6 +3,9 @@ export const semantic = {
|
|
|
3
3
|
background: '#f4f4f5',
|
|
4
4
|
surface: '#ffffff',
|
|
5
5
|
foreground: '#1a1a1a',
|
|
6
|
+
title: '#2a2d33',
|
|
7
|
+
selectSurface: '#fdf6f2',
|
|
8
|
+
selectForeground: '#9a3412',
|
|
6
9
|
muted: '#f0f0f0',
|
|
7
10
|
mutedForeground: '#626262',
|
|
8
11
|
border: '#e3e3e3',
|
|
@@ -28,6 +31,9 @@ export const semantic = {
|
|
|
28
31
|
background: '#0a0a0a',
|
|
29
32
|
surface: '#171717',
|
|
30
33
|
foreground: '#fafafa',
|
|
34
|
+
title: '#fafafa',
|
|
35
|
+
selectSurface: '#5f2814',
|
|
36
|
+
selectForeground: '#f6b298',
|
|
31
37
|
muted: '#262626',
|
|
32
38
|
mutedForeground: '#a3a3a3',
|
|
33
39
|
border: '#262626',
|
|
@@ -77,6 +83,7 @@ export const radius = {
|
|
|
77
83
|
sm: 6,
|
|
78
84
|
md: 8,
|
|
79
85
|
lg: 12,
|
|
86
|
+
xl: 20,
|
|
80
87
|
full: 9999,
|
|
81
88
|
} as const;
|
|
82
89
|
|
|
@@ -101,6 +108,17 @@ export const typography = {
|
|
|
101
108
|
lineHeight: 24,
|
|
102
109
|
fontWeight: '400',
|
|
103
110
|
},
|
|
111
|
+
eyebrow: {
|
|
112
|
+
fontSize: 13,
|
|
113
|
+
lineHeight: 18,
|
|
114
|
+
fontWeight: '500',
|
|
115
|
+
},
|
|
116
|
+
question: {
|
|
117
|
+
fontSize: 18,
|
|
118
|
+
lineHeight: 26,
|
|
119
|
+
fontWeight: '500',
|
|
120
|
+
letterSpacing: -0.4,
|
|
121
|
+
},
|
|
104
122
|
title: {
|
|
105
123
|
fontSize: 20,
|
|
106
124
|
lineHeight: 28,
|
|
@@ -109,7 +127,8 @@ export const typography = {
|
|
|
109
127
|
screenTitle: {
|
|
110
128
|
fontSize: 24,
|
|
111
129
|
lineHeight: 32,
|
|
112
|
-
fontWeight: '
|
|
130
|
+
fontWeight: '600',
|
|
131
|
+
letterSpacing: -0.6,
|
|
113
132
|
},
|
|
114
133
|
display: {
|
|
115
134
|
fontSize: 28,
|
|
@@ -121,6 +140,8 @@ export const typography = {
|
|
|
121
140
|
export const shadow = {
|
|
122
141
|
sm: '0px 1px 2px rgba(0, 0, 0, 0.08)',
|
|
123
142
|
md: '0px 4px 12px rgba(0, 0, 0, 0.12)',
|
|
143
|
+
panel:
|
|
144
|
+
'0px 1px 2px rgba(17, 24, 39, 0.04), 0px 8px 24px rgba(17, 24, 39, 0.04)',
|
|
124
145
|
} as const;
|
|
125
146
|
|
|
126
147
|
export const motion = {
|