@ezpg/app-ui 0.21.0 → 0.22.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/adjust/adjust-template.js +1 -0
- package/lib/module/adjust/adjust-template.js.map +1 -1
- package/lib/module/adjust/axis-adjust.js +181 -0
- package/lib/module/adjust/axis-adjust.js.map +1 -0
- package/lib/module/adjust/axis-tabs.js +81 -0
- package/lib/module/adjust/axis-tabs.js.map +1 -0
- package/lib/module/adjust/axis-wheel.js +286 -0
- package/lib/module/adjust/axis-wheel.js.map +1 -0
- package/lib/module/adjust/index.js +4 -0
- package/lib/module/adjust/index.js.map +1 -1
- package/lib/module/adjust/store-sample.js +436 -0
- package/lib/module/adjust/store-sample.js.map +1 -0
- package/lib/module/blocks/color-swatch-picker/color-swatch-picker.js +1 -1
- package/lib/module/blocks/detail-editor/compare-slider.js +5 -2
- package/lib/module/blocks/detail-editor/compare-slider.js.map +1 -1
- package/lib/module/blocks/detail-editor/detail-canvas.js +192 -61
- package/lib/module/blocks/detail-editor/detail-canvas.js.map +1 -1
- package/lib/module/blocks/detail-editor/detail-types.js +57 -0
- package/lib/module/blocks/detail-editor/detail-types.js.map +1 -1
- package/lib/module/blocks/detail-editor/draft-preview.js +22 -0
- package/lib/module/blocks/detail-editor/draft-preview.js.map +1 -1
- package/lib/module/blocks/detail-editor/focus-context.js +1 -0
- package/lib/module/blocks/detail-editor/focus-context.js.map +1 -1
- package/lib/module/blocks/detail-editor/index.js +2 -2
- package/lib/module/blocks/detail-editor/index.js.map +1 -1
- package/lib/module/blocks/detail-editor/keep-words.js +34 -0
- package/lib/module/blocks/detail-editor/keep-words.js.map +1 -0
- package/lib/module/blocks/detail-editor/layout-picker.js +192 -8
- package/lib/module/blocks/detail-editor/layout-picker.js.map +1 -1
- package/lib/module/blocks/detail-request/detail-request.js +213 -0
- package/lib/module/blocks/detail-request/detail-request.js.map +1 -0
- package/lib/module/blocks/detail-request/index.js +4 -0
- package/lib/module/blocks/detail-request/index.js.map +1 -0
- package/lib/module/blocks/detail-studio/action-chips.js +72 -0
- package/lib/module/blocks/detail-studio/action-chips.js.map +1 -0
- package/lib/module/blocks/detail-studio/adjust-tiles.js +3 -3
- package/lib/module/blocks/detail-studio/adjust-tiles.js.map +1 -1
- package/lib/module/blocks/detail-studio/asset-grid.js +33 -16
- package/lib/module/blocks/detail-studio/asset-grid.js.map +1 -1
- package/lib/module/blocks/detail-studio/confirm-row.js +3 -0
- package/lib/module/blocks/detail-studio/confirm-row.js.map +1 -1
- package/lib/module/blocks/detail-studio/detail-studio-template.js +2 -6
- package/lib/module/blocks/detail-studio/detail-studio-template.js.map +1 -1
- package/lib/module/blocks/detail-studio/edge-fade.js +74 -0
- package/lib/module/blocks/detail-studio/edge-fade.js.map +1 -0
- package/lib/module/blocks/detail-studio/image-prompt.js +8 -10
- package/lib/module/blocks/detail-studio/image-prompt.js.map +1 -1
- package/lib/module/blocks/detail-studio/index.js +7 -5
- package/lib/module/blocks/detail-studio/index.js.map +1 -1
- package/lib/module/blocks/detail-studio/rewrite-tray.js +17 -64
- package/lib/module/blocks/detail-studio/rewrite-tray.js.map +1 -1
- package/lib/module/blocks/detail-studio/section-cover.js +41 -0
- package/lib/module/blocks/detail-studio/section-cover.js.map +1 -0
- package/lib/module/blocks/detail-studio/section-edit-template.js +103 -12
- package/lib/module/blocks/detail-studio/section-edit-template.js.map +1 -1
- package/lib/module/blocks/detail-studio/section-kind-grid.js +2 -3
- package/lib/module/blocks/detail-studio/section-kind-grid.js.map +1 -1
- package/lib/module/blocks/detail-studio/section-settings.js +127 -61
- package/lib/module/blocks/detail-studio/section-settings.js.map +1 -1
- package/lib/module/blocks/detail-studio/studio-bar.js +46 -25
- package/lib/module/blocks/detail-studio/studio-bar.js.map +1 -1
- package/lib/module/blocks/detail-studio/studio-dock.js +21 -39
- package/lib/module/blocks/detail-studio/studio-dock.js.map +1 -1
- package/lib/module/blocks/detail-studio/studio-glyphs.js +92 -0
- package/lib/module/blocks/detail-studio/studio-glyphs.js.map +1 -0
- package/lib/module/blocks/detail-studio/studio-sheet.js +5 -3
- package/lib/module/blocks/detail-studio/studio-sheet.js.map +1 -1
- package/lib/module/blocks/detail-studio/studio-steps.js +60 -0
- package/lib/module/blocks/detail-studio/studio-steps.js.map +1 -0
- package/lib/module/blocks/detail-studio/studio-toggle.js +130 -0
- package/lib/module/blocks/detail-studio/studio-toggle.js.map +1 -0
- package/lib/module/blocks/detail-studio/{photo-tool-bar.js → studio-tools.js} +63 -42
- package/lib/module/blocks/detail-studio/studio-tools.js.map +1 -0
- package/lib/module/blocks/detail-studio/text-format-panel.js +16 -8
- package/lib/module/blocks/detail-studio/text-format-panel.js.map +1 -1
- package/lib/module/blocks/index.js +1 -0
- package/lib/module/blocks/index.js.map +1 -1
- package/lib/module/components/button/button.js +13 -5
- package/lib/module/components/button/button.js.map +1 -1
- package/lib/module/components/chip/chip.js +5 -1
- package/lib/module/components/chip/chip.js.map +1 -1
- package/lib/module/components/chip-group/chip-group.js +1 -0
- package/lib/module/components/chip-group/chip-group.js.map +1 -1
- package/lib/module/components/credit/credit.js +6 -2
- package/lib/module/components/credit/credit.js.map +1 -1
- package/lib/module/components/dropdown-menu/dropdown-menu.js +9 -4
- package/lib/module/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/lib/module/components/segmented-control/segmented-control.js +3 -1
- package/lib/module/components/segmented-control/segmented-control.js.map +1 -1
- package/lib/module/components/skeleton/skeleton.js +4 -2
- package/lib/module/components/skeleton/skeleton.js.map +1 -1
- package/lib/module/components/slider/slider.js +53 -16
- package/lib/module/components/slider/slider.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/glyphs.js +2 -1
- package/lib/module/internal/glyphs.js.map +1 -1
- package/lib/module/internal/line-icons.js +1 -0
- package/lib/module/internal/line-icons.js.map +1 -1
- package/lib/module/internal/retry-glyph.js +5 -2
- package/lib/module/internal/retry-glyph.js.map +1 -1
- package/lib/module/internal/undo-glyph.js +11 -8
- package/lib/module/internal/undo-glyph.js.map +1 -1
- package/lib/module/sortable/section-board.js +73 -89
- package/lib/module/sortable/section-board.js.map +1 -1
- package/lib/module/templates/design-pick-template.js +8 -1
- package/lib/module/templates/design-pick-template.js.map +1 -1
- package/lib/module/templates/intro-template.js +3 -3
- package/lib/module/templates/intro-template.js.map +1 -1
- package/lib/module/templates/result-template.js +2 -1
- package/lib/module/templates/result-template.js.map +1 -1
- package/lib/typescript/src/adjust/adjust-template.d.ts.map +1 -1
- package/lib/typescript/src/adjust/axis-adjust.d.ts +25 -0
- package/lib/typescript/src/adjust/axis-adjust.d.ts.map +1 -0
- package/lib/typescript/src/adjust/axis-tabs.d.ts +15 -0
- package/lib/typescript/src/adjust/axis-tabs.d.ts.map +1 -0
- package/lib/typescript/src/adjust/axis-wheel.d.ts +15 -0
- package/lib/typescript/src/adjust/axis-wheel.d.ts.map +1 -0
- package/lib/typescript/src/adjust/index.d.ts +4 -0
- package/lib/typescript/src/adjust/index.d.ts.map +1 -1
- package/lib/typescript/src/adjust/store-sample.d.ts +46 -0
- package/lib/typescript/src/adjust/store-sample.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts +2 -1
- package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts +3 -1
- package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/detail-types.d.ts +11 -0
- package/lib/typescript/src/blocks/detail-editor/detail-types.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts +4 -1
- package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/focus-context.d.ts +9 -0
- package/lib/typescript/src/blocks/detail-editor/focus-context.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/index.d.ts +3 -2
- package/lib/typescript/src/blocks/detail-editor/index.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/keep-words.d.ts +2 -0
- package/lib/typescript/src/blocks/detail-editor/keep-words.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts +6 -1
- package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-request/detail-request.d.ts +24 -0
- package/lib/typescript/src/blocks/detail-request/detail-request.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-request/index.d.ts +2 -0
- package/lib/typescript/src/blocks/detail-request/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts +12 -0
- package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/asset-grid.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/confirm-row.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/detail-studio-template.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/edge-fade.d.ts +10 -0
- package/lib/typescript/src/blocks/detail-studio/edge-fade.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/image-prompt.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/index.d.ts +7 -5
- package/lib/typescript/src/blocks/detail-studio/index.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/rewrite-tray.d.ts +3 -3
- package/lib/typescript/src/blocks/detail-studio/rewrite-tray.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/section-cover.d.ts +7 -0
- package/lib/typescript/src/blocks/detail-studio/section-cover.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/section-edit-template.d.ts +9 -0
- package/lib/typescript/src/blocks/detail-studio/section-edit-template.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/section-kind-grid.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/section-settings.d.ts +11 -13
- package/lib/typescript/src/blocks/detail-studio/section-settings.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/studio-bar.d.ts +6 -2
- package/lib/typescript/src/blocks/detail-studio/studio-bar.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/studio-dock.d.ts +0 -2
- package/lib/typescript/src/blocks/detail-studio/studio-dock.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/studio-glyphs.d.ts +6 -0
- package/lib/typescript/src/blocks/detail-studio/studio-glyphs.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/studio-sheet.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/studio-steps.d.ts +11 -0
- package/lib/typescript/src/blocks/detail-studio/studio-steps.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/studio-toggle.d.ts +14 -0
- package/lib/typescript/src/blocks/detail-studio/studio-toggle.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/studio-tools.d.ts +19 -0
- package/lib/typescript/src/blocks/detail-studio/studio-tools.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts +2 -1
- package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts.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/components/button/button.d.ts +3 -1
- package/lib/typescript/src/components/button/button.d.ts.map +1 -1
- package/lib/typescript/src/components/chip/chip.d.ts +2 -1
- package/lib/typescript/src/components/chip/chip.d.ts.map +1 -1
- package/lib/typescript/src/components/chip-group/chip-group.d.ts +1 -0
- package/lib/typescript/src/components/chip-group/chip-group.d.ts.map +1 -1
- package/lib/typescript/src/components/credit/credit.d.ts +1 -0
- package/lib/typescript/src/components/credit/credit.d.ts.map +1 -1
- package/lib/typescript/src/components/dropdown-menu/dropdown-menu.d.ts +2 -0
- package/lib/typescript/src/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/lib/typescript/src/components/segmented-control/segmented-control.d.ts +2 -0
- package/lib/typescript/src/components/segmented-control/segmented-control.d.ts.map +1 -1
- package/lib/typescript/src/components/skeleton/skeleton.d.ts +2 -1
- package/lib/typescript/src/components/skeleton/skeleton.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/slider.d.ts +2 -1
- package/lib/typescript/src/components/slider/slider.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/internal/glyphs.d.ts +1 -0
- package/lib/typescript/src/internal/glyphs.d.ts.map +1 -1
- package/lib/typescript/src/internal/line-icons.d.ts +1 -0
- package/lib/typescript/src/internal/line-icons.d.ts.map +1 -1
- package/lib/typescript/src/internal/retry-glyph.d.ts.map +1 -1
- package/lib/typescript/src/internal/undo-glyph.d.ts.map +1 -1
- package/lib/typescript/src/sortable/section-board.d.ts.map +1 -1
- package/lib/typescript/src/templates/design-pick-template.d.ts.map +1 -1
- package/lib/typescript/src/templates/intro-template.d.ts.map +1 -1
- package/lib/typescript/src/templates/result-template.d.ts +2 -1
- package/lib/typescript/src/templates/result-template.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adjust/adjust-template.tsx +1 -0
- package/src/adjust/axis-adjust.tsx +206 -0
- package/src/adjust/axis-tabs.tsx +81 -0
- package/src/adjust/axis-wheel.tsx +309 -0
- package/src/adjust/index.ts +15 -0
- package/src/adjust/store-sample.tsx +519 -0
- package/src/blocks/color-swatch-picker/color-swatch-picker.tsx +1 -1
- package/src/blocks/detail-editor/compare-slider.tsx +3 -1
- package/src/blocks/detail-editor/detail-canvas.tsx +264 -69
- package/src/blocks/detail-editor/detail-types.ts +37 -0
- package/src/blocks/detail-editor/draft-preview.tsx +46 -2
- package/src/blocks/detail-editor/focus-context.ts +13 -0
- package/src/blocks/detail-editor/index.ts +11 -1
- package/src/blocks/detail-editor/keep-words.ts +36 -0
- package/src/blocks/detail-editor/layout-picker.tsx +188 -6
- package/src/blocks/detail-request/detail-request.tsx +198 -0
- package/src/blocks/detail-request/index.ts +11 -0
- package/src/blocks/detail-studio/action-chips.tsx +77 -0
- package/src/blocks/detail-studio/adjust-tiles.tsx +3 -3
- package/src/blocks/detail-studio/asset-grid.tsx +30 -16
- package/src/blocks/detail-studio/confirm-row.tsx +3 -0
- package/src/blocks/detail-studio/detail-studio-template.tsx +2 -6
- package/src/blocks/detail-studio/edge-fade.tsx +76 -0
- package/src/blocks/detail-studio/image-prompt.tsx +6 -9
- package/src/blocks/detail-studio/index.ts +19 -16
- package/src/blocks/detail-studio/rewrite-tray.tsx +16 -56
- package/src/blocks/detail-studio/section-cover.tsx +44 -0
- package/src/blocks/detail-studio/section-edit-template.tsx +138 -13
- package/src/blocks/detail-studio/section-kind-grid.tsx +2 -2
- package/src/blocks/detail-studio/section-settings.tsx +124 -69
- package/src/blocks/detail-studio/studio-bar.tsx +61 -41
- package/src/blocks/detail-studio/studio-dock.tsx +19 -37
- package/src/blocks/detail-studio/studio-glyphs.tsx +77 -0
- package/src/blocks/detail-studio/studio-sheet.tsx +7 -3
- package/src/blocks/detail-studio/studio-steps.tsx +58 -0
- package/src/blocks/detail-studio/studio-toggle.tsx +130 -0
- package/src/blocks/detail-studio/studio-tools.tsx +126 -0
- package/src/blocks/detail-studio/text-format-panel.tsx +26 -14
- package/src/blocks/index.tsx +1 -0
- package/src/components/button/button.tsx +12 -5
- package/src/components/chip/chip.tsx +9 -1
- package/src/components/chip-group/chip-group.tsx +2 -0
- package/src/components/credit/credit.tsx +9 -2
- package/src/components/dropdown-menu/dropdown-menu.tsx +18 -7
- package/src/components/segmented-control/segmented-control.tsx +10 -2
- package/src/components/skeleton/skeleton.tsx +5 -2
- package/src/components/slider/slider.tsx +66 -14
- package/src/index.tsx +1 -0
- package/src/internal/glyphs.tsx +2 -0
- package/src/internal/line-icons.ts +2 -0
- package/src/internal/retry-glyph.tsx +7 -2
- package/src/internal/undo-glyph.tsx +12 -11
- package/src/sortable/section-board.tsx +71 -76
- package/src/templates/design-pick-template.tsx +9 -1
- package/src/templates/intro-template.tsx +14 -12
- package/src/templates/result-template.tsx +3 -0
- package/lib/module/blocks/detail-studio/keyboard-bar.js +0 -67
- package/lib/module/blocks/detail-studio/keyboard-bar.js.map +0 -1
- package/lib/module/blocks/detail-studio/photo-tool-bar.js.map +0 -1
- package/lib/module/blocks/detail-studio/section-thumb.js +0 -49
- package/lib/module/blocks/detail-studio/section-thumb.js.map +0 -1
- package/lib/typescript/src/blocks/detail-studio/keyboard-bar.d.ts +0 -18
- package/lib/typescript/src/blocks/detail-studio/keyboard-bar.d.ts.map +0 -1
- package/lib/typescript/src/blocks/detail-studio/photo-tool-bar.d.ts +0 -19
- package/lib/typescript/src/blocks/detail-studio/photo-tool-bar.d.ts.map +0 -1
- package/lib/typescript/src/blocks/detail-studio/section-thumb.d.ts +0 -14
- package/lib/typescript/src/blocks/detail-studio/section-thumb.d.ts.map +0 -1
- package/src/blocks/detail-studio/keyboard-bar.tsx +0 -73
- package/src/blocks/detail-studio/photo-tool-bar.tsx +0 -100
- package/src/blocks/detail-studio/section-thumb.tsx +0 -41
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
import { useEffect, useRef, type ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Animated,
|
|
4
|
+
Easing,
|
|
5
|
+
Image,
|
|
6
|
+
Platform,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Text as RNText,
|
|
9
|
+
View,
|
|
10
|
+
type ImageSourcePropType,
|
|
11
|
+
type TextStyle,
|
|
12
|
+
type ViewStyle,
|
|
13
|
+
} from 'react-native';
|
|
14
|
+
import Svg, { Path } from 'react-native-svg';
|
|
15
|
+
import { useReducedMotion } from '../internal/use-reduced-motion';
|
|
16
|
+
|
|
17
|
+
export type StoreSampleScene =
|
|
18
|
+
'color' | 'motion' | 'shape' | 'style' | 'power' | 'whole';
|
|
19
|
+
|
|
20
|
+
export type StoreSampleLook = {
|
|
21
|
+
surface: string;
|
|
22
|
+
surfaceAlt: string;
|
|
23
|
+
text: string;
|
|
24
|
+
muted: string;
|
|
25
|
+
accent: string;
|
|
26
|
+
onAccent: string;
|
|
27
|
+
radiusSm: number;
|
|
28
|
+
radiusMd: number;
|
|
29
|
+
radiusLg: number;
|
|
30
|
+
button: 'square' | 'rounded' | 'pill';
|
|
31
|
+
gutter: number;
|
|
32
|
+
sectionGap: number;
|
|
33
|
+
autoplay: boolean;
|
|
34
|
+
photoRatio: number;
|
|
35
|
+
tracking: number;
|
|
36
|
+
scale: number;
|
|
37
|
+
weight: 500 | 600 | 700;
|
|
38
|
+
area: 0 | 1 | 2;
|
|
39
|
+
serif: boolean;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type StoreSampleCopy = {
|
|
43
|
+
store: string;
|
|
44
|
+
headline: string;
|
|
45
|
+
hero: string;
|
|
46
|
+
section: string;
|
|
47
|
+
more: string;
|
|
48
|
+
notice: string;
|
|
49
|
+
add: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type StoreSampleProps = {
|
|
53
|
+
scene: StoreSampleScene;
|
|
54
|
+
look: StoreSampleLook;
|
|
55
|
+
photos: readonly ImageSourcePropType[];
|
|
56
|
+
hero: ImageSourcePropType;
|
|
57
|
+
copy: StoreSampleCopy;
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
fontFamily?: string;
|
|
61
|
+
serifFamily?: string;
|
|
62
|
+
cutout?: boolean;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const BASE = 390;
|
|
66
|
+
const PAD = 20;
|
|
67
|
+
const BAR = 56;
|
|
68
|
+
const SMALL = 280;
|
|
69
|
+
const TURN = 3000;
|
|
70
|
+
const SLIDE = 600;
|
|
71
|
+
|
|
72
|
+
const styles = StyleSheet.create({
|
|
73
|
+
root: { overflow: 'hidden' },
|
|
74
|
+
row: { flexDirection: 'row' },
|
|
75
|
+
center: { alignItems: 'center', justifyContent: 'center' },
|
|
76
|
+
between: {
|
|
77
|
+
flexDirection: 'row',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
justifyContent: 'space-between',
|
|
80
|
+
},
|
|
81
|
+
lead: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
justifyContent: 'space-between',
|
|
84
|
+
alignItems: 'flex-start',
|
|
85
|
+
paddingRight: 0,
|
|
86
|
+
},
|
|
87
|
+
fill: { flex: 1 },
|
|
88
|
+
strong: { fontWeight: '600' },
|
|
89
|
+
bold: { fontWeight: '700' },
|
|
90
|
+
dots: {
|
|
91
|
+
position: 'absolute',
|
|
92
|
+
left: 0,
|
|
93
|
+
right: 0,
|
|
94
|
+
flexDirection: 'row',
|
|
95
|
+
justifyContent: 'center',
|
|
96
|
+
},
|
|
97
|
+
faded: { opacity: 0.35 },
|
|
98
|
+
clip: { overflow: 'hidden', alignItems: 'center', justifyContent: 'center' },
|
|
99
|
+
inset: { width: '76%', height: '76%' },
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const serifDefault = Platform.select({
|
|
103
|
+
ios: 'NanumMyeongjo',
|
|
104
|
+
android: 'NanumMyeongjo',
|
|
105
|
+
default: "'Nanum Myeongjo', 'Noto Serif KR', serif",
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
function Glyph({ d, size, color }: { d: string; size: number; color: string }) {
|
|
109
|
+
return (
|
|
110
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
111
|
+
<Path
|
|
112
|
+
d={d}
|
|
113
|
+
stroke={color}
|
|
114
|
+
strokeWidth={1.6}
|
|
115
|
+
strokeLinecap="round"
|
|
116
|
+
strokeLinejoin="round"
|
|
117
|
+
/>
|
|
118
|
+
</Svg>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const MENU = 'M4 8h16M4 16h16';
|
|
123
|
+
const BAG = 'M5 8h14l1 12H4zM9 8a3 3 0 016 0';
|
|
124
|
+
const HEART =
|
|
125
|
+
'M12 20s-7.5-4.6-7.5-10.2A4.2 4.2 0 0112 7.2a4.2 4.2 0 017.5 2.6C19.5 15.4 12 20 12 20z';
|
|
126
|
+
|
|
127
|
+
function Shot({
|
|
128
|
+
source,
|
|
129
|
+
box,
|
|
130
|
+
tone,
|
|
131
|
+
cutout,
|
|
132
|
+
}: {
|
|
133
|
+
source: ImageSourcePropType | undefined;
|
|
134
|
+
box: ViewStyle;
|
|
135
|
+
tone: string;
|
|
136
|
+
cutout: boolean;
|
|
137
|
+
}) {
|
|
138
|
+
if (!source) return <View style={[box, { backgroundColor: tone }]} />;
|
|
139
|
+
return cutout ? (
|
|
140
|
+
<View style={[styles.clip, box, { backgroundColor: tone }]}>
|
|
141
|
+
<Image source={source} resizeMode="contain" style={styles.inset} />
|
|
142
|
+
</View>
|
|
143
|
+
) : (
|
|
144
|
+
<Image
|
|
145
|
+
source={source}
|
|
146
|
+
resizeMode="cover"
|
|
147
|
+
style={[box as never, { backgroundColor: tone }]}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function Rail({
|
|
153
|
+
photos,
|
|
154
|
+
side,
|
|
155
|
+
gap,
|
|
156
|
+
pad,
|
|
157
|
+
radius,
|
|
158
|
+
tone,
|
|
159
|
+
play,
|
|
160
|
+
cutout,
|
|
161
|
+
}: {
|
|
162
|
+
photos: readonly ImageSourcePropType[];
|
|
163
|
+
side: number;
|
|
164
|
+
gap: number;
|
|
165
|
+
pad: number;
|
|
166
|
+
radius: number;
|
|
167
|
+
tone: string;
|
|
168
|
+
play: boolean;
|
|
169
|
+
cutout: boolean;
|
|
170
|
+
}) {
|
|
171
|
+
const reduced = useReducedMotion();
|
|
172
|
+
const x = useRef(new Animated.Value(0)).current;
|
|
173
|
+
const running = play && !reduced;
|
|
174
|
+
useEffect(() => {
|
|
175
|
+
if (!running) {
|
|
176
|
+
x.setValue(0);
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
let at = 0;
|
|
180
|
+
const timer = setInterval(() => {
|
|
181
|
+
at = (at + 1) % 3;
|
|
182
|
+
Animated.timing(x, {
|
|
183
|
+
toValue: -at * (side + gap),
|
|
184
|
+
duration: SLIDE,
|
|
185
|
+
easing: Easing.inOut(Easing.cubic),
|
|
186
|
+
useNativeDriver: Platform.OS !== 'web',
|
|
187
|
+
}).start();
|
|
188
|
+
}, TURN);
|
|
189
|
+
return () => clearInterval(timer);
|
|
190
|
+
}, [running, side, gap, x]);
|
|
191
|
+
return (
|
|
192
|
+
<Animated.View
|
|
193
|
+
style={[
|
|
194
|
+
styles.row,
|
|
195
|
+
{ gap, paddingLeft: pad, transform: [{ translateX: x }] },
|
|
196
|
+
]}
|
|
197
|
+
>
|
|
198
|
+
{photos.map((photo, i) => (
|
|
199
|
+
<Shot
|
|
200
|
+
key={i}
|
|
201
|
+
source={photo}
|
|
202
|
+
box={{ width: side, height: side, borderRadius: radius }}
|
|
203
|
+
tone={tone}
|
|
204
|
+
cutout={cutout}
|
|
205
|
+
/>
|
|
206
|
+
))}
|
|
207
|
+
</Animated.View>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function StoreSample({
|
|
212
|
+
scene,
|
|
213
|
+
look,
|
|
214
|
+
photos,
|
|
215
|
+
hero,
|
|
216
|
+
copy,
|
|
217
|
+
width,
|
|
218
|
+
height,
|
|
219
|
+
fontFamily,
|
|
220
|
+
serifFamily = serifDefault,
|
|
221
|
+
cutout = false,
|
|
222
|
+
}: StoreSampleProps) {
|
|
223
|
+
const k = width / BASE;
|
|
224
|
+
const px = (n: number) => n * k;
|
|
225
|
+
const tall = height / k;
|
|
226
|
+
const small = tall < SMALL;
|
|
227
|
+
const inner = BASE - PAD * 2;
|
|
228
|
+
const cell = (inner - look.gutter) / 2;
|
|
229
|
+
const family = look.serif ? serifFamily : fontFamily;
|
|
230
|
+
const round = (h: number) =>
|
|
231
|
+
look.button === 'pill'
|
|
232
|
+
? h / 2
|
|
233
|
+
: look.button === 'square'
|
|
234
|
+
? look.radiusSm
|
|
235
|
+
: look.radiusMd;
|
|
236
|
+
const title = (size: number): TextStyle => ({
|
|
237
|
+
fontFamily: family,
|
|
238
|
+
fontSize: px(size),
|
|
239
|
+
lineHeight: px(size + 10),
|
|
240
|
+
letterSpacing: px(size * look.tracking),
|
|
241
|
+
fontWeight: String(look.weight) as TextStyle['fontWeight'],
|
|
242
|
+
color: look.text,
|
|
243
|
+
});
|
|
244
|
+
const photo = (i: number, w: number, h: number, radius = look.radiusLg) => (
|
|
245
|
+
<Shot
|
|
246
|
+
key={i}
|
|
247
|
+
source={photos[i % Math.max(1, photos.length)]}
|
|
248
|
+
box={{ width: px(w), height: px(h), borderRadius: px(radius) }}
|
|
249
|
+
tone={look.surfaceAlt}
|
|
250
|
+
cutout={cutout}
|
|
251
|
+
/>
|
|
252
|
+
);
|
|
253
|
+
const pair = (first: number, h: number) => (
|
|
254
|
+
<View
|
|
255
|
+
style={[styles.row, { gap: px(look.gutter), paddingHorizontal: px(PAD) }]}
|
|
256
|
+
>
|
|
257
|
+
{photo(first, cell, h)}
|
|
258
|
+
{photo(first + 1, cell, h)}
|
|
259
|
+
</View>
|
|
260
|
+
);
|
|
261
|
+
const button = (label: string, h: number, size: number, flip = false) => (
|
|
262
|
+
<View
|
|
263
|
+
style={[
|
|
264
|
+
styles.center,
|
|
265
|
+
{
|
|
266
|
+
height: px(h),
|
|
267
|
+
paddingHorizontal: px(22),
|
|
268
|
+
borderRadius: px(round(h)),
|
|
269
|
+
backgroundColor: flip ? look.onAccent : look.accent,
|
|
270
|
+
},
|
|
271
|
+
]}
|
|
272
|
+
>
|
|
273
|
+
<RNText
|
|
274
|
+
allowFontScaling={false}
|
|
275
|
+
style={[
|
|
276
|
+
styles.strong,
|
|
277
|
+
{
|
|
278
|
+
fontFamily,
|
|
279
|
+
fontSize: px(size),
|
|
280
|
+
color: flip ? look.accent : look.onAccent,
|
|
281
|
+
},
|
|
282
|
+
]}
|
|
283
|
+
>
|
|
284
|
+
{label}
|
|
285
|
+
</RNText>
|
|
286
|
+
</View>
|
|
287
|
+
);
|
|
288
|
+
const bar = (
|
|
289
|
+
<View
|
|
290
|
+
style={[styles.between, { height: px(BAR), paddingHorizontal: px(PAD) }]}
|
|
291
|
+
>
|
|
292
|
+
<Glyph d={MENU} size={px(22)} color={look.text} />
|
|
293
|
+
<RNText allowFontScaling={false} style={[title(20), styles.bold]}>
|
|
294
|
+
{copy.store}
|
|
295
|
+
</RNText>
|
|
296
|
+
<Glyph d={BAG} size={px(22)} color={look.text} />
|
|
297
|
+
</View>
|
|
298
|
+
);
|
|
299
|
+
const strong = look.area === 2;
|
|
300
|
+
const heroHeight =
|
|
301
|
+
scene === 'whole'
|
|
302
|
+
? 252
|
|
303
|
+
: Math.min(300, Math.max(130, tall - (small ? 44 : 58)));
|
|
304
|
+
const heroBlock = (
|
|
305
|
+
<View
|
|
306
|
+
style={[
|
|
307
|
+
styles.row,
|
|
308
|
+
{
|
|
309
|
+
height: px(heroHeight),
|
|
310
|
+
backgroundColor: strong ? look.accent : look.surfaceAlt,
|
|
311
|
+
},
|
|
312
|
+
]}
|
|
313
|
+
>
|
|
314
|
+
<View
|
|
315
|
+
style={[
|
|
316
|
+
styles.lead,
|
|
317
|
+
{
|
|
318
|
+
paddingVertical: px(small ? 14 : 20),
|
|
319
|
+
paddingLeft: px(small ? 14 : 20),
|
|
320
|
+
},
|
|
321
|
+
]}
|
|
322
|
+
>
|
|
323
|
+
<RNText
|
|
324
|
+
allowFontScaling={false}
|
|
325
|
+
style={[
|
|
326
|
+
title(Math.round((small ? 12.6 : 16) * Math.pow(look.scale, 3.6))),
|
|
327
|
+
strong && { color: look.onAccent },
|
|
328
|
+
]}
|
|
329
|
+
>
|
|
330
|
+
{copy.hero}
|
|
331
|
+
</RNText>
|
|
332
|
+
{button(copy.more, small ? 36 : 48, 15, strong)}
|
|
333
|
+
</View>
|
|
334
|
+
<Shot
|
|
335
|
+
source={photos[2 % Math.max(1, photos.length)]}
|
|
336
|
+
box={{ width: px(178), height: '100%' }}
|
|
337
|
+
tone={strong ? look.accent : look.surfaceAlt}
|
|
338
|
+
cutout={cutout}
|
|
339
|
+
/>
|
|
340
|
+
</View>
|
|
341
|
+
);
|
|
342
|
+
const band = (
|
|
343
|
+
<View
|
|
344
|
+
style={[
|
|
345
|
+
styles.center,
|
|
346
|
+
{
|
|
347
|
+
height: px(48),
|
|
348
|
+
backgroundColor: look.area === 0 ? look.surface : look.accent,
|
|
349
|
+
},
|
|
350
|
+
]}
|
|
351
|
+
>
|
|
352
|
+
<RNText
|
|
353
|
+
allowFontScaling={false}
|
|
354
|
+
style={[
|
|
355
|
+
styles.strong,
|
|
356
|
+
{
|
|
357
|
+
fontFamily,
|
|
358
|
+
fontSize: px(15),
|
|
359
|
+
color: look.area === 0 ? look.muted : look.onAccent,
|
|
360
|
+
},
|
|
361
|
+
]}
|
|
362
|
+
>
|
|
363
|
+
{copy.notice}
|
|
364
|
+
</RNText>
|
|
365
|
+
</View>
|
|
366
|
+
);
|
|
367
|
+
const sectionTitle = (
|
|
368
|
+
<RNText
|
|
369
|
+
allowFontScaling={false}
|
|
370
|
+
style={[
|
|
371
|
+
title(Math.round(16 * Math.pow(look.scale, 2))),
|
|
372
|
+
{ paddingHorizontal: px(PAD), paddingBottom: px(14) },
|
|
373
|
+
]}
|
|
374
|
+
>
|
|
375
|
+
{copy.section}
|
|
376
|
+
</RNText>
|
|
377
|
+
);
|
|
378
|
+
|
|
379
|
+
let body: ReactNode;
|
|
380
|
+
if (scene === 'color') {
|
|
381
|
+
const h = Math.max(70, (tall - BAR - look.gutter - PAD) / 2);
|
|
382
|
+
body = (
|
|
383
|
+
<>
|
|
384
|
+
{bar}
|
|
385
|
+
<View style={{ gap: px(look.gutter) }}>
|
|
386
|
+
{pair(0, h)}
|
|
387
|
+
{pair(2, h)}
|
|
388
|
+
</View>
|
|
389
|
+
</>
|
|
390
|
+
);
|
|
391
|
+
} else if (scene === 'motion') {
|
|
392
|
+
const side = Math.max(64, Math.min(230, tall * 0.42));
|
|
393
|
+
body = (
|
|
394
|
+
<View style={{ paddingTop: px(PAD), gap: px(look.sectionGap) }}>
|
|
395
|
+
<View>
|
|
396
|
+
<Rail
|
|
397
|
+
photos={[0, 1, 3, 2].map(
|
|
398
|
+
(i) => photos[i % Math.max(1, photos.length)]!
|
|
399
|
+
)}
|
|
400
|
+
side={px(side)}
|
|
401
|
+
gap={px(look.gutter)}
|
|
402
|
+
pad={px(PAD)}
|
|
403
|
+
radius={px(look.radiusLg)}
|
|
404
|
+
tone={look.surfaceAlt}
|
|
405
|
+
play={look.autoplay}
|
|
406
|
+
cutout={cutout}
|
|
407
|
+
/>
|
|
408
|
+
{look.autoplay ? (
|
|
409
|
+
<View style={[styles.dots, { bottom: -px(PAD), gap: px(6) }]}>
|
|
410
|
+
{[0, 1, 2].map((i) => (
|
|
411
|
+
<View
|
|
412
|
+
key={i}
|
|
413
|
+
style={[
|
|
414
|
+
{
|
|
415
|
+
width: px(i ? 6 : 18),
|
|
416
|
+
height: px(6),
|
|
417
|
+
borderRadius: px(3),
|
|
418
|
+
backgroundColor: i ? look.muted : look.accent,
|
|
419
|
+
},
|
|
420
|
+
i > 0 && styles.faded,
|
|
421
|
+
]}
|
|
422
|
+
/>
|
|
423
|
+
))}
|
|
424
|
+
</View>
|
|
425
|
+
) : null}
|
|
426
|
+
</View>
|
|
427
|
+
{pair(2, cell)}
|
|
428
|
+
</View>
|
|
429
|
+
);
|
|
430
|
+
} else if (scene === 'shape') {
|
|
431
|
+
const h = Math.max(70, tall - PAD * 3 - 56);
|
|
432
|
+
body = (
|
|
433
|
+
<View style={{ padding: px(PAD), gap: px(PAD) }}>
|
|
434
|
+
<Shot
|
|
435
|
+
source={hero}
|
|
436
|
+
box={{
|
|
437
|
+
width: px(inner),
|
|
438
|
+
height: px(h),
|
|
439
|
+
borderRadius: px(look.radiusLg),
|
|
440
|
+
}}
|
|
441
|
+
tone={look.surfaceAlt}
|
|
442
|
+
cutout={cutout}
|
|
443
|
+
/>
|
|
444
|
+
<View style={[styles.row, { gap: px(10) }]}>
|
|
445
|
+
<View
|
|
446
|
+
style={[
|
|
447
|
+
styles.center,
|
|
448
|
+
{
|
|
449
|
+
width: px(56),
|
|
450
|
+
height: px(56),
|
|
451
|
+
borderRadius: px(round(56)),
|
|
452
|
+
backgroundColor: look.surfaceAlt,
|
|
453
|
+
},
|
|
454
|
+
]}
|
|
455
|
+
>
|
|
456
|
+
<Glyph d={HEART} size={px(24)} color={look.text} />
|
|
457
|
+
</View>
|
|
458
|
+
<View style={styles.fill}>{button(copy.add, 56, 17)}</View>
|
|
459
|
+
</View>
|
|
460
|
+
</View>
|
|
461
|
+
);
|
|
462
|
+
} else if (scene === 'style') {
|
|
463
|
+
const w = Math.min(260, Math.max(90, (tall - 110) / 1.25));
|
|
464
|
+
body = (
|
|
465
|
+
<View style={{ paddingTop: px(22) }}>
|
|
466
|
+
<RNText
|
|
467
|
+
allowFontScaling={false}
|
|
468
|
+
numberOfLines={1}
|
|
469
|
+
style={[title(small ? 26 : 30), { paddingHorizontal: px(PAD) }]}
|
|
470
|
+
>
|
|
471
|
+
{copy.headline}
|
|
472
|
+
</RNText>
|
|
473
|
+
<View
|
|
474
|
+
style={[
|
|
475
|
+
styles.row,
|
|
476
|
+
{
|
|
477
|
+
gap: px(look.gutter),
|
|
478
|
+
paddingLeft: px(PAD),
|
|
479
|
+
paddingTop: px(16),
|
|
480
|
+
},
|
|
481
|
+
]}
|
|
482
|
+
>
|
|
483
|
+
{[1, 0, 3].map((i) =>
|
|
484
|
+
photo(i, w, w / look.photoRatio, Math.min(look.radiusLg, w / 4))
|
|
485
|
+
)}
|
|
486
|
+
</View>
|
|
487
|
+
</View>
|
|
488
|
+
);
|
|
489
|
+
} else if (scene === 'power') {
|
|
490
|
+
body = (
|
|
491
|
+
<>
|
|
492
|
+
{heroBlock}
|
|
493
|
+
{band}
|
|
494
|
+
<View style={{ paddingTop: px(22) }}>{sectionTitle}</View>
|
|
495
|
+
{pair(0, cell)}
|
|
496
|
+
</>
|
|
497
|
+
);
|
|
498
|
+
} else {
|
|
499
|
+
body = (
|
|
500
|
+
<>
|
|
501
|
+
{bar}
|
|
502
|
+
{heroBlock}
|
|
503
|
+
{band}
|
|
504
|
+
<View style={{ paddingTop: px(look.sectionGap) }}>
|
|
505
|
+
{sectionTitle}
|
|
506
|
+
{pair(1, cell / look.photoRatio)}
|
|
507
|
+
</View>
|
|
508
|
+
</>
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
return (
|
|
512
|
+
<View
|
|
513
|
+
pointerEvents="none"
|
|
514
|
+
style={[styles.root, { width, height, backgroundColor: look.surface }]}
|
|
515
|
+
>
|
|
516
|
+
{body}
|
|
517
|
+
</View>
|
|
518
|
+
);
|
|
519
|
+
}
|
|
@@ -18,6 +18,7 @@ export type CompareSliderProps = {
|
|
|
18
18
|
aspectRatio?: number;
|
|
19
19
|
label?: string;
|
|
20
20
|
labels?: { before: string; after: string };
|
|
21
|
+
inset?: number;
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
const STEP = 0.1;
|
|
@@ -80,6 +81,7 @@ export function CompareSlider({
|
|
|
80
81
|
aspectRatio = 4 / 5,
|
|
81
82
|
label = '원본과 비교',
|
|
82
83
|
labels,
|
|
84
|
+
inset = 0,
|
|
83
85
|
}: CompareSliderProps) {
|
|
84
86
|
const t = useTheme();
|
|
85
87
|
const s = useStyles();
|
|
@@ -134,7 +136,7 @@ export function CompareSlider({
|
|
|
134
136
|
style={[s.fill, { width }]}
|
|
135
137
|
/>
|
|
136
138
|
</View>
|
|
137
|
-
<View style={[s.line, { left: x - 1 }]} />
|
|
139
|
+
<View style={[s.line, { left: x - 1, top: inset, bottom: inset }]} />
|
|
138
140
|
<View style={[s.knob, { left: x - knob / 2 }]}>
|
|
139
141
|
<View style={s.flip}>
|
|
140
142
|
<ChevronGlyph color={t.colors.title} size={t.space[3]} />
|