@ezpg/app-ui 0.3.0 → 0.5.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 +23 -0
- package/lib/module/blocks/brand-profile-card/brand-profile-card.js +2 -2
- package/lib/module/blocks/brand-profile-card/brand-profile-card.js.map +1 -1
- package/lib/module/blocks/bulk-ship-list/bulk-ship-list.js +1 -1
- package/lib/module/blocks/bulk-ship-list/bulk-ship-list.js.map +1 -1
- package/lib/module/blocks/claim-row/claim-row.js +6 -5
- package/lib/module/blocks/claim-row/claim-row.js.map +1 -1
- package/lib/module/blocks/color-swatch-picker/color-swatch-picker.js +1 -1
- package/lib/module/blocks/color-swatch-picker/color-swatch-picker.js.map +1 -1
- package/lib/module/blocks/copy-variant-picker/copy-variant-picker.js +3 -3
- package/lib/module/blocks/copy-variant-picker/copy-variant-picker.js.map +1 -1
- package/lib/module/blocks/credit-wallet/credit-wallet.js +1 -1
- package/lib/module/blocks/credit-wallet/credit-wallet.js.map +1 -1
- package/lib/module/blocks/image-grid/image-grid.js +9 -9
- package/lib/module/blocks/image-grid/image-grid.js.map +1 -1
- package/lib/module/blocks/internal/format.js +4 -0
- package/lib/module/blocks/internal/format.js.map +1 -1
- package/lib/module/blocks/invoice-row/invoice-row.js +2 -2
- package/lib/module/blocks/invoice-row/invoice-row.js.map +1 -1
- package/lib/module/blocks/logo-candidate-grid/logo-candidate-grid.js +1 -1
- package/lib/module/blocks/logo-candidate-grid/logo-candidate-grid.js.map +1 -1
- package/lib/module/blocks/oauth-buttons/oauth-buttons.js +2 -2
- package/lib/module/blocks/oauth-buttons/oauth-buttons.js.map +1 -1
- package/lib/module/blocks/option-editor/option-editor.js +3 -3
- package/lib/module/blocks/option-editor/option-editor.js.map +1 -1
- package/lib/module/blocks/order-card/index.js +1 -1
- package/lib/module/blocks/order-card/index.js.map +1 -1
- package/lib/module/blocks/order-card/order-card.js +31 -9
- package/lib/module/blocks/order-card/order-card.js.map +1 -1
- package/lib/module/blocks/plan-card/plan-card.js +2 -2
- package/lib/module/blocks/plan-card/plan-card.js.map +1 -1
- package/lib/module/blocks/product-list-empty/product-list-empty.js +5 -5
- package/lib/module/blocks/product-list-empty/product-list-empty.js.map +1 -1
- package/lib/module/blocks/review-row/review-row.js +17 -17
- package/lib/module/blocks/review-row/review-row.js.map +1 -1
- package/lib/module/blocks/sales-chart/sales-chart.js +2 -2
- package/lib/module/blocks/sales-chart/sales-chart.js.map +1 -1
- package/lib/module/blocks/selection-bar/selection-bar.js +1 -1
- package/lib/module/blocks/selection-bar/selection-bar.js.map +1 -1
- package/lib/module/blocks/shipping-tracking-row/shipping-tracking-row.js +1 -1
- package/lib/module/blocks/shipping-tracking-row/shipping-tracking-row.js.map +1 -1
- package/lib/module/blocks/site-preview-frame/site-preview-frame.js +1 -1
- package/lib/module/blocks/site-preview-frame/site-preview-frame.js.map +1 -1
- package/lib/module/blocks/step-screen/step-screen.js +18 -14
- package/lib/module/blocks/step-screen/step-screen.js.map +1 -1
- package/lib/module/blocks/supply-item-card/supply-item-card.js +5 -5
- package/lib/module/blocks/supply-item-card/supply-item-card.js.map +1 -1
- package/lib/module/components/button/button.js +12 -17
- package/lib/module/components/button/button.js.map +1 -1
- package/lib/module/components/chip/chip.js +2 -2
- package/lib/module/components/chip/chip.js.map +1 -1
- package/lib/module/components/dialog/dialog.js +5 -5
- package/lib/module/components/dialog/dialog.js.map +1 -1
- package/lib/module/components/empty-state/empty-state.js +4 -4
- package/lib/module/components/empty-state/empty-state.js.map +1 -1
- package/lib/module/components/field/field.js +15 -14
- package/lib/module/components/field/field.js.map +1 -1
- package/lib/module/components/list-row/index.js.map +1 -1
- package/lib/module/components/list-row/list-row.js +38 -10
- package/lib/module/components/list-row/list-row.js.map +1 -1
- package/lib/module/components/segmented-tabs/segmented-tabs.js +2 -2
- package/lib/module/components/segmented-tabs/segmented-tabs.js.map +1 -1
- package/lib/module/components/status-badge/status-badge.js +1 -1
- package/lib/module/components/status-badge/status-badge.js.map +1 -1
- package/lib/module/components/text/text.js +5 -0
- package/lib/module/components/text/text.js.map +1 -1
- package/lib/module/components/toast/toast.js +4 -4
- package/lib/module/components/toast/toast.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/templates/editor-template.js +142 -0
- package/lib/module/templates/editor-template.js.map +1 -0
- package/lib/module/templates/group.js +45 -0
- package/lib/module/templates/group.js.map +1 -0
- package/lib/module/templates/index.js +10 -0
- package/lib/module/templates/index.js.map +1 -0
- package/lib/module/templates/list-template.js +98 -0
- package/lib/module/templates/list-template.js.map +1 -0
- package/lib/module/templates/parts.js +115 -0
- package/lib/module/templates/parts.js.map +1 -0
- package/lib/module/templates/result-template.js +233 -0
- package/lib/module/templates/result-template.js.map +1 -0
- package/lib/module/templates/scroll-templates.js +100 -0
- package/lib/module/templates/scroll-templates.js.map +1 -0
- package/lib/module/templates/system-template.js +64 -0
- package/lib/module/templates/system-template.js.map +1 -0
- package/lib/module/theme/base.js +35 -2
- package/lib/module/theme/base.js.map +1 -1
- package/lib/module/theme/contract.js +6 -0
- package/lib/module/theme/contract.js.map +1 -0
- package/lib/module/theme/tokens.js +10 -2
- package/lib/module/theme/tokens.js.map +1 -1
- package/lib/typescript/src/blocks/claim-row/claim-row.d.ts.map +1 -1
- package/lib/typescript/src/blocks/color-swatch-picker/color-swatch-picker.d.ts.map +1 -1
- package/lib/typescript/src/blocks/image-grid/image-grid.d.ts.map +1 -1
- package/lib/typescript/src/blocks/internal/format.d.ts +1 -0
- package/lib/typescript/src/blocks/internal/format.d.ts.map +1 -1
- package/lib/typescript/src/blocks/invoice-row/invoice-row.d.ts.map +1 -1
- package/lib/typescript/src/blocks/oauth-buttons/oauth-buttons.d.ts.map +1 -1
- package/lib/typescript/src/blocks/order-card/index.d.ts +1 -1
- package/lib/typescript/src/blocks/order-card/index.d.ts.map +1 -1
- package/lib/typescript/src/blocks/order-card/order-card.d.ts +10 -0
- package/lib/typescript/src/blocks/order-card/order-card.d.ts.map +1 -1
- package/lib/typescript/src/blocks/product-list-empty/product-list-empty.d.ts.map +1 -1
- package/lib/typescript/src/blocks/review-row/review-row.d.ts.map +1 -1
- package/lib/typescript/src/blocks/step-screen/step-screen.d.ts +3 -1
- package/lib/typescript/src/blocks/step-screen/step-screen.d.ts.map +1 -1
- package/lib/typescript/src/components/button/button.d.ts +2 -2
- package/lib/typescript/src/components/button/button.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/empty-state.d.ts.map +1 -1
- package/lib/typescript/src/components/field/field.d.ts.map +1 -1
- package/lib/typescript/src/components/list-row/index.d.ts +1 -1
- package/lib/typescript/src/components/list-row/index.d.ts.map +1 -1
- package/lib/typescript/src/components/list-row/list-row.d.ts +4 -1
- package/lib/typescript/src/components/list-row/list-row.d.ts.map +1 -1
- package/lib/typescript/src/components/status-badge/status-badge.d.ts +2 -1
- package/lib/typescript/src/components/status-badge/status-badge.d.ts.map +1 -1
- package/lib/typescript/src/components/text/text.d.ts +1 -1
- package/lib/typescript/src/components/text/text.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/toast.d.ts +2 -1
- package/lib/typescript/src/components/toast/toast.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/templates/editor-template.d.ts +22 -0
- package/lib/typescript/src/templates/editor-template.d.ts.map +1 -0
- package/lib/typescript/src/templates/group.d.ts +8 -0
- package/lib/typescript/src/templates/group.d.ts.map +1 -0
- package/lib/typescript/src/templates/index.d.ts +15 -0
- package/lib/typescript/src/templates/index.d.ts.map +1 -0
- package/lib/typescript/src/templates/list-template.d.ts +27 -0
- package/lib/typescript/src/templates/list-template.d.ts.map +1 -0
- package/lib/typescript/src/templates/parts.d.ts +27 -0
- package/lib/typescript/src/templates/parts.d.ts.map +1 -0
- package/lib/typescript/src/templates/result-template.d.ts +21 -0
- package/lib/typescript/src/templates/result-template.d.ts.map +1 -0
- package/lib/typescript/src/templates/scroll-templates.d.ts +32 -0
- package/lib/typescript/src/templates/scroll-templates.d.ts.map +1 -0
- package/lib/typescript/src/templates/system-template.d.ts +12 -0
- package/lib/typescript/src/templates/system-template.d.ts.map +1 -0
- package/lib/typescript/src/theme/base.d.ts +35 -2
- package/lib/typescript/src/theme/base.d.ts.map +1 -1
- package/lib/typescript/src/theme/contract.d.ts +7 -0
- package/lib/typescript/src/theme/contract.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +23 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blocks/brand-profile-card/brand-profile-card.tsx +2 -2
- package/src/blocks/bulk-ship-list/bulk-ship-list.tsx +1 -1
- package/src/blocks/claim-row/claim-row.tsx +12 -3
- package/src/blocks/color-swatch-picker/color-swatch-picker.tsx +5 -1
- package/src/blocks/copy-variant-picker/copy-variant-picker.tsx +3 -3
- package/src/blocks/credit-wallet/credit-wallet.tsx +1 -1
- package/src/blocks/image-grid/image-grid.tsx +15 -8
- package/src/blocks/internal/format.ts +5 -0
- package/src/blocks/invoice-row/invoice-row.tsx +5 -1
- package/src/blocks/logo-candidate-grid/logo-candidate-grid.tsx +1 -1
- package/src/blocks/oauth-buttons/oauth-buttons.tsx +6 -2
- package/src/blocks/option-editor/option-editor.tsx +3 -3
- package/src/blocks/order-card/index.ts +4 -0
- package/src/blocks/order-card/order-card.tsx +50 -6
- package/src/blocks/plan-card/plan-card.tsx +2 -2
- package/src/blocks/product-list-empty/product-list-empty.tsx +11 -4
- package/src/blocks/review-row/review-row.tsx +26 -15
- package/src/blocks/sales-chart/sales-chart.tsx +2 -2
- package/src/blocks/selection-bar/selection-bar.tsx +1 -1
- package/src/blocks/shipping-tracking-row/shipping-tracking-row.tsx +1 -1
- package/src/blocks/site-preview-frame/site-preview-frame.tsx +1 -1
- package/src/blocks/step-screen/step-screen.tsx +24 -12
- package/src/blocks/supply-item-card/supply-item-card.tsx +5 -5
- package/src/components/button/button.tsx +22 -14
- package/src/components/chip/chip.tsx +2 -2
- package/src/components/dialog/dialog.tsx +5 -5
- package/src/components/empty-state/empty-state.tsx +8 -4
- package/src/components/field/field.tsx +15 -14
- package/src/components/list-row/index.ts +1 -1
- package/src/components/list-row/list-row.tsx +35 -8
- package/src/components/segmented-tabs/segmented-tabs.tsx +2 -2
- package/src/components/status-badge/status-badge.tsx +3 -3
- package/src/components/text/text.tsx +4 -1
- package/src/components/toast/toast.tsx +6 -5
- package/src/index.tsx +1 -0
- package/src/templates/editor-template.tsx +164 -0
- package/src/templates/group.tsx +49 -0
- package/src/templates/index.ts +28 -0
- package/src/templates/list-template.tsx +124 -0
- package/src/templates/parts.tsx +138 -0
- package/src/templates/result-template.tsx +268 -0
- package/src/templates/scroll-templates.tsx +140 -0
- package/src/templates/system-template.tsx +70 -0
- package/src/theme/base.ts +38 -2
- package/src/theme/contract.ts +21 -0
- package/src/theme/tokens.ts +11 -0
- package/src/types/index.ts +15 -1
|
@@ -6,6 +6,7 @@ import { ChevronGlyph } from '../../internal/glyphs';
|
|
|
6
6
|
import { PressableBase } from '../../internal/pressable-base';
|
|
7
7
|
import { useTheme } from '../../theme/theme-provider';
|
|
8
8
|
import { makeStyles } from '../../utils/styles';
|
|
9
|
+
import { Notice, type TemplateNotice } from '../../templates/parts';
|
|
9
10
|
|
|
10
11
|
export type StepAction = {
|
|
11
12
|
label: string;
|
|
@@ -22,6 +23,7 @@ export type StepScreenProps = {
|
|
|
22
23
|
backLabel?: string;
|
|
23
24
|
primaryAction: StepAction;
|
|
24
25
|
secondaryAction?: StepAction;
|
|
26
|
+
notice?: TemplateNotice;
|
|
25
27
|
bottomInset?: number;
|
|
26
28
|
children?: ReactNode;
|
|
27
29
|
};
|
|
@@ -29,14 +31,14 @@ export type StepScreenProps = {
|
|
|
29
31
|
const useStyles = makeStyles((t) => ({
|
|
30
32
|
root: { flex: 1, backgroundColor: t.colors.background },
|
|
31
33
|
header: {
|
|
32
|
-
height:
|
|
34
|
+
height: t.headerHeight,
|
|
33
35
|
flexDirection: 'row',
|
|
34
36
|
alignItems: 'center',
|
|
35
37
|
paddingHorizontal: t.space[1],
|
|
36
38
|
},
|
|
37
39
|
back: {
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
40
|
+
width: t.minTouchSize,
|
|
41
|
+
height: t.minTouchSize,
|
|
40
42
|
alignItems: 'center',
|
|
41
43
|
justifyContent: 'center',
|
|
42
44
|
},
|
|
@@ -44,16 +46,19 @@ const useStyles = makeStyles((t) => ({
|
|
|
44
46
|
track: { height: 3, backgroundColor: t.colors.muted },
|
|
45
47
|
fill: { height: 3, backgroundColor: t.colors.primary },
|
|
46
48
|
body: {
|
|
47
|
-
gap: t.
|
|
48
|
-
paddingTop: t.
|
|
49
|
-
paddingHorizontal: t.
|
|
50
|
-
paddingBottom: t.
|
|
49
|
+
gap: t.layout.titleGap,
|
|
50
|
+
paddingTop: t.layout.screenTop,
|
|
51
|
+
paddingHorizontal: t.layout.screenX,
|
|
52
|
+
paddingBottom: t.layout.footerBottom,
|
|
53
|
+
},
|
|
54
|
+
title: {
|
|
55
|
+
fontSize: t.typography.screenTitle.fontSize,
|
|
56
|
+
lineHeight: t.typography.screenTitle.lineHeight,
|
|
51
57
|
},
|
|
52
|
-
title: { fontSize: 24, lineHeight: 32 },
|
|
53
58
|
footer: {
|
|
54
|
-
gap: t.
|
|
55
|
-
paddingHorizontal: t.
|
|
56
|
-
paddingTop: t.
|
|
59
|
+
gap: t.layout.itemGap,
|
|
60
|
+
paddingHorizontal: t.layout.screenX,
|
|
61
|
+
paddingTop: t.layout.footerTop,
|
|
57
62
|
backgroundColor: t.colors.background,
|
|
58
63
|
},
|
|
59
64
|
}));
|
|
@@ -66,6 +71,7 @@ export function StepScreen({
|
|
|
66
71
|
backLabel = '이전',
|
|
67
72
|
primaryAction,
|
|
68
73
|
secondaryAction,
|
|
74
|
+
notice,
|
|
69
75
|
bottomInset = 0,
|
|
70
76
|
children,
|
|
71
77
|
}: StepScreenProps) {
|
|
@@ -106,7 +112,13 @@ export function StepScreen({
|
|
|
106
112
|
</Text>
|
|
107
113
|
{children}
|
|
108
114
|
</ScrollView>
|
|
109
|
-
<
|
|
115
|
+
{notice ? <Notice notice={notice} /> : null}
|
|
116
|
+
<View
|
|
117
|
+
style={[
|
|
118
|
+
s.footer,
|
|
119
|
+
{ paddingBottom: t.layout.footerBottom + bottomInset },
|
|
120
|
+
]}
|
|
121
|
+
>
|
|
110
122
|
<Button
|
|
111
123
|
size="lg"
|
|
112
124
|
onPress={primaryAction.onPress}
|
|
@@ -39,22 +39,22 @@ const useStyles = makeStyles((t) => ({
|
|
|
39
39
|
group: {
|
|
40
40
|
borderWidth: 1,
|
|
41
41
|
borderColor: t.colors.border,
|
|
42
|
-
borderRadius:
|
|
42
|
+
borderRadius: t.radius.lg,
|
|
43
43
|
overflow: 'hidden',
|
|
44
44
|
},
|
|
45
45
|
row: {
|
|
46
46
|
flexDirection: 'row',
|
|
47
47
|
alignItems: 'center',
|
|
48
48
|
gap: t.space[3],
|
|
49
|
-
minHeight:
|
|
50
|
-
paddingHorizontal:
|
|
49
|
+
minHeight: t.controlSize.lg,
|
|
50
|
+
paddingHorizontal: t.space[4],
|
|
51
51
|
},
|
|
52
52
|
divided: { borderTopWidth: 1, borderTopColor: t.colors.border },
|
|
53
53
|
pressed: { backgroundColor: t.colors.muted },
|
|
54
54
|
radio: {
|
|
55
55
|
width: 20,
|
|
56
56
|
height: 20,
|
|
57
|
-
borderRadius:
|
|
57
|
+
borderRadius: t.radius.full,
|
|
58
58
|
borderWidth: 2,
|
|
59
59
|
borderColor: t.colors.input,
|
|
60
60
|
alignItems: 'center',
|
|
@@ -64,7 +64,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
64
64
|
radioDot: {
|
|
65
65
|
width: 10,
|
|
66
66
|
height: 10,
|
|
67
|
-
borderRadius:
|
|
67
|
+
borderRadius: t.radius.full,
|
|
68
68
|
backgroundColor: t.colors.primary,
|
|
69
69
|
},
|
|
70
70
|
quantity: { flex: 1 },
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
import { useTheme } from '../../theme/theme-provider';
|
|
9
9
|
import { makeStyles } from '../../utils/styles';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export type ButtonSize
|
|
11
|
+
import type { ButtonSize, ButtonVariant } from '../../theme/contract';
|
|
12
|
+
|
|
13
|
+
export type { ButtonSize, ButtonVariant };
|
|
14
14
|
|
|
15
15
|
export type ButtonProps = Omit<
|
|
16
16
|
PressableBaseProps,
|
|
@@ -24,8 +24,6 @@ export type ButtonProps = Omit<
|
|
|
24
24
|
children: ReactNode;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const heights: Record<ButtonSize, number> = { sm: 44, md: 48, lg: 52 };
|
|
28
|
-
|
|
29
27
|
const useStyles = makeStyles((t) => ({
|
|
30
28
|
base: {
|
|
31
29
|
flexDirection: 'row',
|
|
@@ -36,17 +34,21 @@ const useStyles = makeStyles((t) => ({
|
|
|
36
34
|
borderColor: 'transparent',
|
|
37
35
|
},
|
|
38
36
|
sm: {
|
|
39
|
-
height:
|
|
37
|
+
height: t.controlSize.sm,
|
|
40
38
|
paddingHorizontal: t.space[3],
|
|
41
39
|
borderRadius: t.radius.md,
|
|
42
40
|
},
|
|
43
|
-
md: {
|
|
41
|
+
md: {
|
|
42
|
+
height: t.controlSize.md,
|
|
43
|
+
paddingHorizontal: t.space[4],
|
|
44
|
+
borderRadius: t.radius.md,
|
|
45
|
+
},
|
|
44
46
|
lg: {
|
|
45
|
-
height:
|
|
47
|
+
height: t.controlSize.lg,
|
|
46
48
|
paddingHorizontal: t.space[5],
|
|
47
49
|
borderRadius: t.radius.lg,
|
|
48
50
|
},
|
|
49
|
-
|
|
51
|
+
primary: { backgroundColor: t.colors.primary },
|
|
50
52
|
secondary: { backgroundColor: t.colors.muted },
|
|
51
53
|
outline: {
|
|
52
54
|
backgroundColor: t.colors.background,
|
|
@@ -55,16 +57,22 @@ const useStyles = makeStyles((t) => ({
|
|
|
55
57
|
ghost: { backgroundColor: 'transparent' },
|
|
56
58
|
danger: { backgroundColor: t.colors.danger },
|
|
57
59
|
label: { fontFamily: t.fontFamily, fontWeight: '600' },
|
|
58
|
-
smLabel: {
|
|
60
|
+
smLabel: {
|
|
61
|
+
fontSize: t.typography.label.fontSize,
|
|
62
|
+
lineHeight: t.typography.label.lineHeight,
|
|
63
|
+
},
|
|
59
64
|
mdLabel: {
|
|
60
65
|
fontSize: t.typography.body.fontSize,
|
|
61
66
|
lineHeight: t.typography.body.lineHeight,
|
|
62
67
|
},
|
|
63
|
-
lgLabel: {
|
|
68
|
+
lgLabel: {
|
|
69
|
+
fontSize: t.typography.bodyLg.fontSize,
|
|
70
|
+
lineHeight: t.typography.bodyLg.lineHeight,
|
|
71
|
+
},
|
|
64
72
|
}));
|
|
65
73
|
|
|
66
74
|
export function Button({
|
|
67
|
-
variant = '
|
|
75
|
+
variant = 'primary',
|
|
68
76
|
size = 'md',
|
|
69
77
|
loading = false,
|
|
70
78
|
disabled,
|
|
@@ -78,7 +86,7 @@ export function Button({
|
|
|
78
86
|
const t = useTheme();
|
|
79
87
|
const s = useStyles();
|
|
80
88
|
const color = {
|
|
81
|
-
|
|
89
|
+
primary: t.colors.primaryForeground,
|
|
82
90
|
secondary: t.colors.foreground,
|
|
83
91
|
outline: t.colors.foreground,
|
|
84
92
|
ghost: t.colors.foreground,
|
|
@@ -90,7 +98,7 @@ export function Button({
|
|
|
90
98
|
<PressableBase
|
|
91
99
|
{...rest}
|
|
92
100
|
disabled={disabled || loading}
|
|
93
|
-
touchHeight={
|
|
101
|
+
touchHeight={t.controlSize[size]}
|
|
94
102
|
accessibilityState={{ ...accessibilityState, busy: loading }}
|
|
95
103
|
style={[s.base, s[size], s[variant], style]}
|
|
96
104
|
>
|
|
@@ -35,8 +35,8 @@ const useStyles = makeStyles((t) => ({
|
|
|
35
35
|
},
|
|
36
36
|
label: {
|
|
37
37
|
fontFamily: t.fontFamily,
|
|
38
|
-
fontSize:
|
|
39
|
-
lineHeight:
|
|
38
|
+
fontSize: t.typography.label.fontSize,
|
|
39
|
+
lineHeight: t.typography.label.lineHeight,
|
|
40
40
|
fontWeight: '500',
|
|
41
41
|
},
|
|
42
42
|
count: { fontVariant: ['tabular-nums'], fontWeight: '700' },
|
|
@@ -23,18 +23,18 @@ const useStyles = makeStyles((t) => ({
|
|
|
23
23
|
alignSelf: 'center',
|
|
24
24
|
width: '100%',
|
|
25
25
|
maxWidth: 360,
|
|
26
|
-
paddingTop:
|
|
26
|
+
paddingTop: t.space[6],
|
|
27
27
|
paddingHorizontal: t.space[5],
|
|
28
28
|
paddingBottom: t.space[5],
|
|
29
29
|
gap: t.space[5],
|
|
30
|
-
borderRadius:
|
|
30
|
+
borderRadius: t.radius.lg,
|
|
31
31
|
backgroundColor: t.colors.background,
|
|
32
32
|
boxShadow: t.shadow.md,
|
|
33
33
|
},
|
|
34
34
|
title: {
|
|
35
35
|
fontFamily: t.fontFamily,
|
|
36
|
-
fontSize:
|
|
37
|
-
lineHeight:
|
|
36
|
+
fontSize: t.typography.title.fontSize,
|
|
37
|
+
lineHeight: t.typography.title.lineHeight,
|
|
38
38
|
fontWeight: '700',
|
|
39
39
|
textAlign: 'center',
|
|
40
40
|
color: t.colors.foreground,
|
|
@@ -108,7 +108,7 @@ export function Dialog({
|
|
|
108
108
|
{cancelLabel}
|
|
109
109
|
</Button>
|
|
110
110
|
<Button
|
|
111
|
-
variant={danger ? 'danger' : '
|
|
111
|
+
variant={danger ? 'danger' : 'primary'}
|
|
112
112
|
style={s.action}
|
|
113
113
|
loading={loading}
|
|
114
114
|
onPress={onConfirm}
|
|
@@ -35,19 +35,23 @@ const useStyles = makeStyles((t) => ({
|
|
|
35
35
|
color: t.colors.foreground,
|
|
36
36
|
textAlign: 'center',
|
|
37
37
|
},
|
|
38
|
-
button: {
|
|
38
|
+
button: {
|
|
39
|
+
marginTop: t.space[5],
|
|
40
|
+
height: t.controlSize.md,
|
|
41
|
+
paddingHorizontal: t.space[5],
|
|
42
|
+
},
|
|
39
43
|
section: {
|
|
40
44
|
flexDirection: 'row',
|
|
41
45
|
alignItems: 'center',
|
|
42
46
|
gap: t.space[3],
|
|
43
|
-
minHeight:
|
|
47
|
+
minHeight: t.controlSize.lg,
|
|
44
48
|
paddingLeft: t.space[4],
|
|
45
49
|
paddingRight: t.space[1],
|
|
46
50
|
},
|
|
47
51
|
sectionTitle: {
|
|
48
52
|
...t.typography.body,
|
|
49
53
|
flex: 1,
|
|
50
|
-
fontSize:
|
|
54
|
+
fontSize: t.typography.label.fontSize,
|
|
51
55
|
fontFamily: t.fontFamily,
|
|
52
56
|
color: t.colors.mutedForeground,
|
|
53
57
|
},
|
|
@@ -57,7 +61,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
57
61
|
paddingHorizontal: t.space[3],
|
|
58
62
|
},
|
|
59
63
|
linkLabel: {
|
|
60
|
-
fontSize:
|
|
64
|
+
fontSize: t.typography.label.fontSize,
|
|
61
65
|
fontWeight: '600',
|
|
62
66
|
fontFamily: t.fontFamily,
|
|
63
67
|
color: t.colors.foreground,
|
|
@@ -27,8 +27,8 @@ const useStyles = makeStyles((t) => ({
|
|
|
27
27
|
root: { gap: t.space[2] },
|
|
28
28
|
label: {
|
|
29
29
|
fontFamily: t.fontFamily,
|
|
30
|
-
fontSize:
|
|
31
|
-
lineHeight:
|
|
30
|
+
fontSize: t.typography.label.fontSize,
|
|
31
|
+
lineHeight: t.typography.label.lineHeight,
|
|
32
32
|
fontWeight: '600',
|
|
33
33
|
color: t.colors.foreground,
|
|
34
34
|
},
|
|
@@ -36,9 +36,9 @@ const useStyles = makeStyles((t) => ({
|
|
|
36
36
|
flexDirection: 'row',
|
|
37
37
|
alignItems: 'center',
|
|
38
38
|
gap: t.space[2],
|
|
39
|
-
height:
|
|
39
|
+
height: t.controlSize.lg,
|
|
40
40
|
paddingHorizontal: t.space[4],
|
|
41
|
-
borderRadius:
|
|
41
|
+
borderRadius: t.radius.md,
|
|
42
42
|
borderWidth: 1,
|
|
43
43
|
borderColor: t.colors.input,
|
|
44
44
|
backgroundColor: t.colors.background,
|
|
@@ -56,16 +56,17 @@ const useStyles = makeStyles((t) => ({
|
|
|
56
56
|
disabled: { opacity: t.opacity.disabled, backgroundColor: t.colors.muted },
|
|
57
57
|
input: {
|
|
58
58
|
flex: 1,
|
|
59
|
+
minWidth: 0,
|
|
59
60
|
alignSelf: 'stretch',
|
|
60
61
|
paddingVertical: 0,
|
|
61
62
|
fontFamily: t.fontFamily,
|
|
62
|
-
fontSize:
|
|
63
|
+
fontSize: t.typography.bodyLg.fontSize,
|
|
63
64
|
color: t.colors.foreground,
|
|
64
65
|
},
|
|
65
66
|
error: {
|
|
66
67
|
fontFamily: t.fontFamily,
|
|
67
|
-
fontSize:
|
|
68
|
-
lineHeight:
|
|
68
|
+
fontSize: t.typography.label.fontSize,
|
|
69
|
+
lineHeight: t.typography.label.lineHeight,
|
|
69
70
|
paddingLeft: t.space[1],
|
|
70
71
|
color: t.colors.danger,
|
|
71
72
|
},
|
|
@@ -73,7 +74,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
73
74
|
warned: {
|
|
74
75
|
borderWidth: 2,
|
|
75
76
|
paddingHorizontal: t.space[4] - 1,
|
|
76
|
-
borderColor: t.colors.
|
|
77
|
+
borderColor: t.colors.warningText,
|
|
77
78
|
},
|
|
78
79
|
noteRow: {
|
|
79
80
|
flexDirection: 'row',
|
|
@@ -84,15 +85,15 @@ const useStyles = makeStyles((t) => ({
|
|
|
84
85
|
grow: { flex: 1, paddingLeft: 0 },
|
|
85
86
|
hint: {
|
|
86
87
|
fontFamily: t.fontFamily,
|
|
87
|
-
fontSize:
|
|
88
|
-
lineHeight:
|
|
88
|
+
fontSize: t.typography.label.fontSize,
|
|
89
|
+
lineHeight: t.typography.label.lineHeight,
|
|
89
90
|
paddingLeft: t.space[1],
|
|
90
91
|
color: t.colors.mutedForeground,
|
|
91
92
|
},
|
|
92
93
|
warning: {
|
|
93
94
|
fontFamily: t.fontFamily,
|
|
94
|
-
fontSize:
|
|
95
|
-
lineHeight:
|
|
95
|
+
fontSize: t.typography.label.fontSize,
|
|
96
|
+
lineHeight: t.typography.label.lineHeight,
|
|
96
97
|
paddingLeft: t.space[1],
|
|
97
98
|
color: t.colors.foreground,
|
|
98
99
|
},
|
|
@@ -179,8 +180,8 @@ export function Field({
|
|
|
179
180
|
<View style={s.noteRow}>
|
|
180
181
|
<AlertGlyph
|
|
181
182
|
filled
|
|
182
|
-
color={t.colors.
|
|
183
|
-
onColor={t.colors.
|
|
183
|
+
color={t.colors.warningText}
|
|
184
|
+
onColor={t.colors.background}
|
|
184
185
|
size={t.iconSize.sm}
|
|
185
186
|
/>
|
|
186
187
|
<Text
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ListRow, type ListRowProps } from './list-row';
|
|
1
|
+
export { ListRow, type ListRowProps, type ListRowTone } from './list-row';
|
|
@@ -8,12 +8,16 @@ import {
|
|
|
8
8
|
import { useTheme } from '../../theme/theme-provider';
|
|
9
9
|
import { makeStyles } from '../../utils/styles';
|
|
10
10
|
|
|
11
|
+
export type ListRowTone = 'muted' | 'warning' | 'danger';
|
|
12
|
+
|
|
11
13
|
export type ListRowProps = Omit<
|
|
12
14
|
PressableBaseProps,
|
|
13
15
|
'children' | 'touchHeight'
|
|
14
16
|
> & {
|
|
15
17
|
title: string;
|
|
16
18
|
description?: string;
|
|
19
|
+
overline?: string;
|
|
20
|
+
overlineTone?: ListRowTone;
|
|
17
21
|
leading?: IconSlot;
|
|
18
22
|
trailing?: IconSlot;
|
|
19
23
|
chevron?: boolean;
|
|
@@ -25,20 +29,30 @@ const useStyles = makeStyles((t) => ({
|
|
|
25
29
|
flexDirection: 'row',
|
|
26
30
|
alignItems: 'center',
|
|
27
31
|
gap: t.space[3],
|
|
28
|
-
minHeight:
|
|
29
|
-
paddingVertical: t.space[
|
|
30
|
-
paddingHorizontal: t.
|
|
32
|
+
minHeight: t.listRow.oneLine,
|
|
33
|
+
paddingVertical: t.space[2],
|
|
34
|
+
paddingHorizontal: t.layout.screenX,
|
|
31
35
|
backgroundColor: t.colors.background,
|
|
32
36
|
},
|
|
37
|
+
twoLine: { minHeight: t.listRow.twoLine },
|
|
38
|
+
threeLine: { minHeight: t.listRow.threeLine },
|
|
33
39
|
pressed: { backgroundColor: t.colors.muted },
|
|
34
|
-
body: { flex: 1
|
|
40
|
+
body: { flex: 1 },
|
|
41
|
+
overline: {
|
|
42
|
+
...t.typography.caption,
|
|
43
|
+
fontFamily: t.fontFamily,
|
|
44
|
+
fontWeight: '600',
|
|
45
|
+
},
|
|
46
|
+
muted: { color: t.colors.mutedForeground },
|
|
47
|
+
warning: { color: t.colors.warningText },
|
|
48
|
+
danger: { color: t.colors.danger },
|
|
35
49
|
title: {
|
|
36
|
-
...t.typography.
|
|
50
|
+
...t.typography.bodyLg,
|
|
37
51
|
fontFamily: t.fontFamily,
|
|
38
52
|
color: t.colors.foreground,
|
|
39
53
|
},
|
|
40
54
|
description: {
|
|
41
|
-
...t.typography.
|
|
55
|
+
...t.typography.label,
|
|
42
56
|
fontFamily: t.fontFamily,
|
|
43
57
|
color: t.colors.mutedForeground,
|
|
44
58
|
},
|
|
@@ -48,6 +62,8 @@ const useStyles = makeStyles((t) => ({
|
|
|
48
62
|
export function ListRow({
|
|
49
63
|
title,
|
|
50
64
|
description,
|
|
65
|
+
overline,
|
|
66
|
+
overlineTone = 'muted',
|
|
51
67
|
leading,
|
|
52
68
|
trailing,
|
|
53
69
|
chevron,
|
|
@@ -60,11 +76,22 @@ export function ListRow({
|
|
|
60
76
|
const s = useStyles();
|
|
61
77
|
const icon = { color: t.colors.mutedForeground, size: t.iconSize.md };
|
|
62
78
|
const showChevron = chevron ?? !!onPress;
|
|
79
|
+
const lines = [overline, description].filter(Boolean).length;
|
|
80
|
+
const height = lines === 2 ? s.threeLine : lines === 1 ? s.twoLine : null;
|
|
63
81
|
|
|
64
82
|
const content = (
|
|
65
83
|
<>
|
|
66
84
|
{leading ? renderIcon(leading, icon) : null}
|
|
67
85
|
<View style={s.body}>
|
|
86
|
+
{overline ? (
|
|
87
|
+
<Text
|
|
88
|
+
numberOfLines={1}
|
|
89
|
+
maxFontSizeMultiplier={t.maxFontScale}
|
|
90
|
+
style={[s.overline, s[overlineTone]]}
|
|
91
|
+
>
|
|
92
|
+
{overline}
|
|
93
|
+
</Text>
|
|
94
|
+
) : null}
|
|
68
95
|
<Text
|
|
69
96
|
numberOfLines={titleLines}
|
|
70
97
|
maxFontSizeMultiplier={t.maxFontScale}
|
|
@@ -97,14 +124,14 @@ export function ListRow({
|
|
|
97
124
|
);
|
|
98
125
|
|
|
99
126
|
if (!onPress) {
|
|
100
|
-
return <View style={[s.row, style]}>{content}</View>;
|
|
127
|
+
return <View style={[s.row, height, style]}>{content}</View>;
|
|
101
128
|
}
|
|
102
129
|
return (
|
|
103
130
|
<PressableBase
|
|
104
131
|
{...rest}
|
|
105
132
|
onPress={onPress}
|
|
106
133
|
pressedStyle={s.pressed}
|
|
107
|
-
style={[s.row, style]}
|
|
134
|
+
style={[s.row, height, style]}
|
|
108
135
|
>
|
|
109
136
|
{content}
|
|
110
137
|
</PressableBase>
|
|
@@ -32,8 +32,8 @@ const useStyles = makeStyles((t) => ({
|
|
|
32
32
|
selected: { backgroundColor: t.colors.background, boxShadow: t.shadow.sm },
|
|
33
33
|
label: {
|
|
34
34
|
fontFamily: t.fontFamily,
|
|
35
|
-
fontSize:
|
|
36
|
-
lineHeight:
|
|
35
|
+
fontSize: t.typography.label.fontSize,
|
|
36
|
+
lineHeight: t.typography.label.lineHeight,
|
|
37
37
|
fontWeight: '500',
|
|
38
38
|
color: t.colors.mutedForeground,
|
|
39
39
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Text, View, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import type { Tone } from '../../theme/contract';
|
|
2
3
|
import { useTheme } from '../../theme/theme-provider';
|
|
3
4
|
import { makeStyles } from '../../utils/styles';
|
|
4
5
|
|
|
5
|
-
export type StatusBadgeTone =
|
|
6
|
-
'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
6
|
+
export type StatusBadgeTone = Exclude<Tone, 'primary'>;
|
|
7
7
|
|
|
8
8
|
export type StatusBadgeProps = {
|
|
9
9
|
tone?: StatusBadgeTone;
|
|
@@ -15,7 +15,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
15
15
|
base: {
|
|
16
16
|
alignSelf: 'flex-start',
|
|
17
17
|
paddingHorizontal: t.space[2],
|
|
18
|
-
paddingVertical:
|
|
18
|
+
paddingVertical: t.space[1],
|
|
19
19
|
borderRadius: t.radius.full,
|
|
20
20
|
},
|
|
21
21
|
label: {
|
|
@@ -4,7 +4,7 @@ import type { TypographyVariant } from '../../types';
|
|
|
4
4
|
import { useTheme } from '../../theme/theme-provider';
|
|
5
5
|
import { makeStyles } from '../../utils/styles';
|
|
6
6
|
|
|
7
|
-
export type TextTone = 'default' | 'muted' | 'danger' | 'success';
|
|
7
|
+
export type TextTone = 'default' | 'muted' | 'warning' | 'danger' | 'success';
|
|
8
8
|
|
|
9
9
|
export type TextProps = RNTextProps & {
|
|
10
10
|
ref?: Ref<ComponentRef<typeof RNText>>;
|
|
@@ -17,12 +17,15 @@ export type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
|
17
17
|
|
|
18
18
|
const useStyles = makeStyles((t) => ({
|
|
19
19
|
caption: t.typography.caption,
|
|
20
|
+
label: t.typography.label,
|
|
20
21
|
body: t.typography.body,
|
|
21
22
|
bodyLg: t.typography.bodyLg,
|
|
22
23
|
title: t.typography.title,
|
|
24
|
+
screenTitle: t.typography.screenTitle,
|
|
23
25
|
display: t.typography.display,
|
|
24
26
|
default: { color: t.colors.foreground },
|
|
25
27
|
muted: { color: t.colors.mutedForeground },
|
|
28
|
+
warning: { color: t.colors.warningText },
|
|
26
29
|
danger: { color: t.colors.danger },
|
|
27
30
|
success: { color: t.colors.success },
|
|
28
31
|
font: { fontFamily: t.fontFamily },
|
|
@@ -18,10 +18,11 @@ import {
|
|
|
18
18
|
import { useNativeDriver } from '../../internal/overlay';
|
|
19
19
|
import { PressableBase } from '../../internal/pressable-base';
|
|
20
20
|
import { useReducedMotion } from '../../internal/use-reduced-motion';
|
|
21
|
+
import type { Tone } from '../../theme/contract';
|
|
21
22
|
import { useTheme } from '../../theme/theme-provider';
|
|
22
23
|
import { makeStyles } from '../../utils/styles';
|
|
23
24
|
|
|
24
|
-
export type ToastTone = 'neutral' | 'success' | 'danger'
|
|
25
|
+
export type ToastTone = Extract<Tone, 'neutral' | 'success' | 'danger'>;
|
|
25
26
|
|
|
26
27
|
export type ToastOptions = {
|
|
27
28
|
message: string;
|
|
@@ -124,7 +125,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
124
125
|
flexDirection: 'row',
|
|
125
126
|
alignItems: 'center',
|
|
126
127
|
maxWidth: 480,
|
|
127
|
-
minHeight:
|
|
128
|
+
minHeight: t.controlSize.md,
|
|
128
129
|
paddingHorizontal: t.space[4],
|
|
129
130
|
paddingVertical: t.space[3],
|
|
130
131
|
borderRadius: t.radius.md,
|
|
@@ -136,12 +137,12 @@ const useStyles = makeStyles((t) => ({
|
|
|
136
137
|
paddingRight: t.space[2],
|
|
137
138
|
},
|
|
138
139
|
message: { ...t.typography.body, flexShrink: 1, fontFamily: t.fontFamily },
|
|
139
|
-
messageFill: { flex: 1, fontSize:
|
|
140
|
+
messageFill: { flex: 1, fontSize: t.typography.label.fontSize },
|
|
140
141
|
action: { paddingHorizontal: t.space[3], justifyContent: 'center' },
|
|
141
142
|
actionLabel: {
|
|
142
143
|
fontFamily: t.fontFamily,
|
|
143
|
-
fontSize:
|
|
144
|
-
lineHeight:
|
|
144
|
+
fontSize: t.typography.label.fontSize,
|
|
145
|
+
lineHeight: t.typography.label.lineHeight,
|
|
145
146
|
fontWeight: '700',
|
|
146
147
|
},
|
|
147
148
|
}));
|
package/src/index.tsx
CHANGED