@ezpg/app-ui 0.17.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/lib/module/blocks/cover-photos/cover-photos.js +165 -0
  3. package/lib/module/blocks/cover-photos/cover-photos.js.map +1 -0
  4. package/lib/module/blocks/cover-photos/index.js +4 -0
  5. package/lib/module/blocks/cover-photos/index.js.map +1 -0
  6. package/lib/module/blocks/detail-editor/draft-preview.js +39 -0
  7. package/lib/module/blocks/detail-editor/draft-preview.js.map +1 -0
  8. package/lib/module/blocks/detail-editor/index.js +2 -0
  9. package/lib/module/blocks/detail-editor/index.js.map +1 -1
  10. package/lib/module/blocks/detail-editor/layout-picker.js +1 -1
  11. package/lib/module/blocks/detail-editor/layout-picker.js.map +1 -1
  12. package/lib/module/blocks/detail-editor/structure-picker.js +75 -0
  13. package/lib/module/blocks/detail-editor/structure-picker.js.map +1 -0
  14. package/lib/module/blocks/index.js +3 -0
  15. package/lib/module/blocks/index.js.map +1 -1
  16. package/lib/module/blocks/question-accordion/index.js +4 -0
  17. package/lib/module/blocks/question-accordion/index.js.map +1 -0
  18. package/lib/module/blocks/question-accordion/question-accordion.js +256 -0
  19. package/lib/module/blocks/question-accordion/question-accordion.js.map +1 -0
  20. package/lib/module/blocks/slider-list/index.js +4 -0
  21. package/lib/module/blocks/slider-list/index.js.map +1 -0
  22. package/lib/module/blocks/slider-list/slider-list.js +45 -0
  23. package/lib/module/blocks/slider-list/slider-list.js.map +1 -0
  24. package/lib/module/blocks/step-screen/step-screen.js +2 -3
  25. package/lib/module/blocks/step-screen/step-screen.js.map +1 -1
  26. package/lib/module/components/list-row/list-row.js +8 -2
  27. package/lib/module/components/list-row/list-row.js.map +1 -1
  28. package/lib/module/components/page-header/page-header.js +4 -2
  29. package/lib/module/components/page-header/page-header.js.map +1 -1
  30. package/lib/module/components/section-tabs/index.js +4 -0
  31. package/lib/module/components/section-tabs/index.js.map +1 -0
  32. package/lib/module/components/section-tabs/section-tabs.js +73 -0
  33. package/lib/module/components/section-tabs/section-tabs.js.map +1 -0
  34. package/lib/module/components/text/text.js +4 -1
  35. package/lib/module/components/text/text.js.map +1 -1
  36. package/lib/module/index.js +1 -0
  37. package/lib/module/index.js.map +1 -1
  38. package/lib/module/internal/flush-row.js +5 -0
  39. package/lib/module/internal/flush-row.js.map +1 -0
  40. package/lib/module/templates/index.js +1 -0
  41. package/lib/module/templates/index.js.map +1 -1
  42. package/lib/module/templates/parts.js +41 -1
  43. package/lib/module/templates/parts.js.map +1 -1
  44. package/lib/module/templates/result-template.js +2 -3
  45. package/lib/module/templates/result-template.js.map +1 -1
  46. package/lib/module/templates/sheet-form-template.js +174 -0
  47. package/lib/module/templates/sheet-form-template.js.map +1 -0
  48. package/lib/module/theme/base.js +22 -2
  49. package/lib/module/theme/base.js.map +1 -1
  50. package/lib/typescript/src/blocks/cover-photos/cover-photos.d.ts +16 -0
  51. package/lib/typescript/src/blocks/cover-photos/cover-photos.d.ts.map +1 -0
  52. package/lib/typescript/src/blocks/cover-photos/index.d.ts +2 -0
  53. package/lib/typescript/src/blocks/cover-photos/index.d.ts.map +1 -0
  54. package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts +8 -0
  55. package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts.map +1 -0
  56. package/lib/typescript/src/blocks/detail-editor/index.d.ts +2 -0
  57. package/lib/typescript/src/blocks/detail-editor/index.d.ts.map +1 -1
  58. package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts +3 -0
  59. package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts.map +1 -1
  60. package/lib/typescript/src/blocks/detail-editor/structure-picker.d.ts +13 -0
  61. package/lib/typescript/src/blocks/detail-editor/structure-picker.d.ts.map +1 -0
  62. package/lib/typescript/src/blocks/index.d.ts +3 -0
  63. package/lib/typescript/src/blocks/index.d.ts.map +1 -1
  64. package/lib/typescript/src/blocks/question-accordion/index.d.ts +2 -0
  65. package/lib/typescript/src/blocks/question-accordion/index.d.ts.map +1 -0
  66. package/lib/typescript/src/blocks/question-accordion/question-accordion.d.ts +27 -0
  67. package/lib/typescript/src/blocks/question-accordion/question-accordion.d.ts.map +1 -0
  68. package/lib/typescript/src/blocks/slider-list/index.d.ts +2 -0
  69. package/lib/typescript/src/blocks/slider-list/index.d.ts.map +1 -0
  70. package/lib/typescript/src/blocks/slider-list/slider-list.d.ts +17 -0
  71. package/lib/typescript/src/blocks/slider-list/slider-list.d.ts.map +1 -0
  72. package/lib/typescript/src/components/list-row/list-row.d.ts.map +1 -1
  73. package/lib/typescript/src/components/page-header/page-header.d.ts.map +1 -1
  74. package/lib/typescript/src/components/section-tabs/index.d.ts +2 -0
  75. package/lib/typescript/src/components/section-tabs/index.d.ts.map +1 -0
  76. package/lib/typescript/src/components/section-tabs/section-tabs.d.ts +14 -0
  77. package/lib/typescript/src/components/section-tabs/section-tabs.d.ts.map +1 -0
  78. package/lib/typescript/src/components/text/text.d.ts.map +1 -1
  79. package/lib/typescript/src/index.d.ts +1 -0
  80. package/lib/typescript/src/index.d.ts.map +1 -1
  81. package/lib/typescript/src/internal/flush-row.d.ts +2 -0
  82. package/lib/typescript/src/internal/flush-row.d.ts.map +1 -0
  83. package/lib/typescript/src/templates/index.d.ts +2 -0
  84. package/lib/typescript/src/templates/index.d.ts.map +1 -1
  85. package/lib/typescript/src/templates/parts.d.ts +2 -1
  86. package/lib/typescript/src/templates/parts.d.ts.map +1 -1
  87. package/lib/typescript/src/templates/sheet-form-template.d.ts +31 -0
  88. package/lib/typescript/src/templates/sheet-form-template.d.ts.map +1 -0
  89. package/lib/typescript/src/theme/base.d.ts +21 -1
  90. package/lib/typescript/src/theme/base.d.ts.map +1 -1
  91. package/lib/typescript/src/types/index.d.ts +7 -1
  92. package/lib/typescript/src/types/index.d.ts.map +1 -1
  93. package/package.json +6 -6
  94. package/src/blocks/cover-photos/cover-photos.tsx +176 -0
  95. package/src/blocks/cover-photos/index.ts +5 -0
  96. package/src/blocks/detail-editor/draft-preview.tsx +34 -0
  97. package/src/blocks/detail-editor/index.ts +6 -0
  98. package/src/blocks/detail-editor/layout-picker.tsx +1 -1
  99. package/src/blocks/detail-editor/structure-picker.tsx +75 -0
  100. package/src/blocks/index.tsx +3 -0
  101. package/src/blocks/question-accordion/index.ts +6 -0
  102. package/src/blocks/question-accordion/question-accordion.tsx +254 -0
  103. package/src/blocks/slider-list/index.ts +5 -0
  104. package/src/blocks/slider-list/slider-list.tsx +57 -0
  105. package/src/blocks/step-screen/step-screen.tsx +3 -3
  106. package/src/components/list-row/list-row.tsx +6 -0
  107. package/src/components/page-header/page-header.tsx +4 -1
  108. package/src/components/section-tabs/index.ts +5 -0
  109. package/src/components/section-tabs/section-tabs.tsx +87 -0
  110. package/src/components/text/text.tsx +9 -1
  111. package/src/index.tsx +1 -0
  112. package/src/internal/flush-row.ts +3 -0
  113. package/src/templates/index.ts +5 -0
  114. package/src/templates/parts.tsx +45 -0
  115. package/src/templates/result-template.tsx +3 -3
  116. package/src/templates/sheet-form-template.tsx +190 -0
  117. package/src/theme/base.ts +22 -1
  118. package/src/types/index.ts +10 -3
@@ -62,19 +62,64 @@ const useStyles = makeStyles((t) => ({
62
62
  paddingVertical: t.space[3],
63
63
  },
64
64
  cardLine: { height: 1, backgroundColor: t.colors.muted },
65
+ split: {
66
+ flexDirection: 'row',
67
+ backgroundColor: t.colors.surface,
68
+ borderTopWidth: 1,
69
+ borderTopColor: t.colors.border,
70
+ },
71
+ side: { flex: 1 },
72
+ main: { flex: 2 },
65
73
  }));
66
74
 
67
75
  export function BottomBar({
68
76
  primaryAction,
69
77
  secondaryAction,
70
78
  bottomInset = 0,
79
+ split = false,
71
80
  }: {
72
81
  primaryAction: TemplateAction;
73
82
  secondaryAction?: TemplateAction;
74
83
  bottomInset?: number;
84
+ split?: boolean;
75
85
  }) {
76
86
  const t = useTheme();
77
87
  const s = useStyles();
88
+ if (split) {
89
+ return (
90
+ <View
91
+ style={[
92
+ s.bar,
93
+ s.split,
94
+ { paddingBottom: t.layout.footerBottom + bottomInset },
95
+ ]}
96
+ >
97
+ {secondaryAction ? (
98
+ <View style={s.side}>
99
+ <Button
100
+ size="lg"
101
+ variant="secondary"
102
+ onPress={secondaryAction.onPress}
103
+ disabled={secondaryAction.disabled}
104
+ loading={secondaryAction.loading}
105
+ >
106
+ {secondaryAction.label}
107
+ </Button>
108
+ </View>
109
+ ) : null}
110
+ <View style={s.main}>
111
+ <Button
112
+ size="lg"
113
+ onPress={primaryAction.onPress}
114
+ disabled={primaryAction.disabled}
115
+ loading={primaryAction.loading}
116
+ >
117
+ {primaryAction.label}
118
+ </Button>
119
+ </View>
120
+ </View>
121
+ );
122
+ }
78
123
  return (
79
124
  <View
80
125
  style={[s.bar, { paddingBottom: t.layout.footerBottom + bottomInset }]}
@@ -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
- fontSize: t.typography.screenTitle.fontSize,
51
- lineHeight: t.typography.screenTitle.lineHeight,
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 weight="bold" accessibilityRole="header" style={s.heading}>
188
+ <Text accessibilityRole="header" style={s.heading}>
189
189
  {title}
190
190
  </Text>
191
191
  ) : null}
@@ -0,0 +1,190 @@
1
+ import type { ComponentRef, ReactNode, Ref } from 'react';
2
+ import {
3
+ KeyboardAvoidingView,
4
+ ScrollView,
5
+ View,
6
+ type LayoutChangeEvent,
7
+ } from 'react-native';
8
+ import { Text } from '../components/text/text';
9
+ import { ChevronGlyph } from '../internal/glyphs';
10
+ import { PressableBase } from '../internal/pressable-base';
11
+ import { useTheme } from '../theme/theme-provider';
12
+ import { makeStyles } from '../utils/styles';
13
+ import { FlushRowContext } from '../internal/flush-row';
14
+ import { BottomBar, type TemplateAction } from './parts';
15
+
16
+ export type SheetFormTemplateProps = {
17
+ title: string;
18
+ onBack?: () => void;
19
+ backLabel?: string;
20
+ action?: { label: string; onPress: () => void; disabled?: boolean };
21
+ tabs?: ReactNode;
22
+ primaryAction: TemplateAction;
23
+ secondaryAction?: TemplateAction;
24
+ topInset?: number;
25
+ bottomInset?: number;
26
+ scrollRef?: Ref<ComponentRef<typeof ScrollView>>;
27
+ onScrollY?: (y: number) => void;
28
+ children: ReactNode;
29
+ };
30
+
31
+ export type SheetBlockProps = {
32
+ title: string;
33
+ aside?: ReactNode;
34
+ lead?: ReactNode;
35
+ onLayout?: (event: LayoutChangeEvent) => void;
36
+ children: ReactNode;
37
+ };
38
+
39
+ const useStyles = makeStyles((t) => ({
40
+ root: { flex: 1, backgroundColor: t.colors.background },
41
+ header: {
42
+ height: t.headerHeight,
43
+ flexDirection: 'row',
44
+ alignItems: 'center',
45
+ paddingHorizontal: t.space[1],
46
+ backgroundColor: t.colors.surface,
47
+ },
48
+ side: {
49
+ minWidth: t.minTouchSize * 2,
50
+ height: t.minTouchSize,
51
+ justifyContent: 'center',
52
+ },
53
+ end: { alignItems: 'flex-end', paddingHorizontal: t.space[3] },
54
+ back: {
55
+ width: t.minTouchSize,
56
+ height: t.minTouchSize,
57
+ alignItems: 'center',
58
+ justifyContent: 'center',
59
+ transform: [{ scaleX: -1 }],
60
+ },
61
+ title: {
62
+ flex: 1,
63
+ textAlign: 'center',
64
+ fontSize: t.typography.title.fontSize,
65
+ lineHeight: t.typography.title.lineHeight,
66
+ },
67
+ body: { padding: t.space[3], gap: t.space[3] },
68
+ block: {
69
+ padding: t.space[4],
70
+ gap: t.space[3],
71
+ borderRadius: t.radius.lg,
72
+ backgroundColor: t.colors.surface,
73
+ },
74
+ head: {
75
+ flexDirection: 'row',
76
+ alignItems: 'center',
77
+ justifyContent: 'space-between',
78
+ gap: t.space[2],
79
+ },
80
+ lead: { flexDirection: 'row', alignItems: 'center', gap: t.space[1] },
81
+ blockTitle: {
82
+ fontSize: t.typography.title.fontSize,
83
+ lineHeight: t.typography.title.lineHeight,
84
+ },
85
+ }));
86
+
87
+ export function SheetBlock({
88
+ title,
89
+ aside,
90
+ lead,
91
+ onLayout,
92
+ children,
93
+ }: SheetBlockProps) {
94
+ const s = useStyles();
95
+ return (
96
+ <View onLayout={onLayout} style={s.block}>
97
+ <View style={s.head}>
98
+ <View style={s.lead}>
99
+ {lead}
100
+ <Text weight="bold" accessibilityRole="header" style={s.blockTitle}>
101
+ {title}
102
+ </Text>
103
+ </View>
104
+ {aside}
105
+ </View>
106
+ <FlushRowContext.Provider value>{children}</FlushRowContext.Provider>
107
+ </View>
108
+ );
109
+ }
110
+
111
+ export function SheetFormTemplate({
112
+ title,
113
+ onBack,
114
+ backLabel = '뒤로',
115
+ action,
116
+ tabs,
117
+ primaryAction,
118
+ secondaryAction,
119
+ topInset = 0,
120
+ bottomInset = 0,
121
+ scrollRef,
122
+ onScrollY,
123
+ children,
124
+ }: SheetFormTemplateProps) {
125
+ const t = useTheme();
126
+ const s = useStyles();
127
+ return (
128
+ <KeyboardAvoidingView behavior="padding" style={s.root}>
129
+ <View style={{ paddingTop: topInset, backgroundColor: t.colors.surface }}>
130
+ <View style={s.header}>
131
+ <View style={s.side}>
132
+ {onBack ? (
133
+ <PressableBase
134
+ accessibilityLabel={backLabel}
135
+ onPress={onBack}
136
+ style={s.back}
137
+ >
138
+ <ChevronGlyph color={t.colors.foreground} size={24} />
139
+ </PressableBase>
140
+ ) : null}
141
+ </View>
142
+ <Text
143
+ weight="bold"
144
+ numberOfLines={1}
145
+ accessibilityRole="header"
146
+ style={s.title}
147
+ >
148
+ {title}
149
+ </Text>
150
+ <View style={[s.side, s.end]}>
151
+ {action ? (
152
+ <PressableBase
153
+ accessibilityRole="button"
154
+ disabled={action.disabled}
155
+ onPress={action.onPress}
156
+ >
157
+ <Text
158
+ weight="medium"
159
+ tone={action.disabled ? 'muted' : undefined}
160
+ >
161
+ {action.label}
162
+ </Text>
163
+ </PressableBase>
164
+ ) : null}
165
+ </View>
166
+ </View>
167
+ </View>
168
+ {tabs}
169
+ <ScrollView
170
+ ref={scrollRef}
171
+ contentContainerStyle={s.body}
172
+ keyboardShouldPersistTaps="handled"
173
+ scrollEventThrottle={32}
174
+ onScroll={
175
+ onScrollY
176
+ ? (event) => onScrollY(event.nativeEvent.contentOffset.y)
177
+ : undefined
178
+ }
179
+ >
180
+ {children}
181
+ </ScrollView>
182
+ <BottomBar
183
+ split
184
+ primaryAction={primaryAction}
185
+ secondaryAction={secondaryAction}
186
+ bottomInset={bottomInset}
187
+ />
188
+ </KeyboardAvoidingView>
189
+ );
190
+ }
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: '700',
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 = {
@@ -6,6 +6,9 @@ export type ThemeColors = {
6
6
  background: string;
7
7
  surface: string;
8
8
  foreground: string;
9
+ title: string;
10
+ selectSurface: string;
11
+ selectForeground: string;
9
12
  muted: string;
10
13
  mutedForeground: string;
11
14
  border: string;
@@ -35,6 +38,7 @@ export type TypographyToken = {
35
38
  fontSize: number;
36
39
  lineHeight: number;
37
40
  fontWeight: TextStyle['fontWeight'];
41
+ letterSpacing?: number;
38
42
  };
39
43
 
40
44
  export type ThemeTokens = {
@@ -51,11 +55,14 @@ export type ThemeTokens = {
51
55
  12: number;
52
56
  16: number;
53
57
  };
54
- radius: { sm: number; md: number; lg: number; full: number };
55
- typography: Record<TypographyVariant, TypographyToken>;
58
+ radius: { sm: number; md: number; lg: number; xl: number; full: number };
59
+ typography: Record<
60
+ TypographyVariant | 'eyebrow' | 'question',
61
+ TypographyToken
62
+ >;
56
63
  fontFamily: string | undefined;
57
64
  maxFontScale: number;
58
- shadow: { sm: string; md: string };
65
+ shadow: { sm: string; md: string; panel: string };
59
66
  motion: { duration: number };
60
67
  opacity: { pressed: number; disabled: number };
61
68
  iconSize: { sm: number; md: number };