@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.
Files changed (279) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/lib/module/adjust/adjust-template.js +1 -0
  3. package/lib/module/adjust/adjust-template.js.map +1 -1
  4. package/lib/module/adjust/axis-adjust.js +181 -0
  5. package/lib/module/adjust/axis-adjust.js.map +1 -0
  6. package/lib/module/adjust/axis-tabs.js +81 -0
  7. package/lib/module/adjust/axis-tabs.js.map +1 -0
  8. package/lib/module/adjust/axis-wheel.js +286 -0
  9. package/lib/module/adjust/axis-wheel.js.map +1 -0
  10. package/lib/module/adjust/index.js +4 -0
  11. package/lib/module/adjust/index.js.map +1 -1
  12. package/lib/module/adjust/store-sample.js +436 -0
  13. package/lib/module/adjust/store-sample.js.map +1 -0
  14. package/lib/module/blocks/color-swatch-picker/color-swatch-picker.js +1 -1
  15. package/lib/module/blocks/detail-editor/compare-slider.js +5 -2
  16. package/lib/module/blocks/detail-editor/compare-slider.js.map +1 -1
  17. package/lib/module/blocks/detail-editor/detail-canvas.js +192 -61
  18. package/lib/module/blocks/detail-editor/detail-canvas.js.map +1 -1
  19. package/lib/module/blocks/detail-editor/detail-types.js +57 -0
  20. package/lib/module/blocks/detail-editor/detail-types.js.map +1 -1
  21. package/lib/module/blocks/detail-editor/draft-preview.js +22 -0
  22. package/lib/module/blocks/detail-editor/draft-preview.js.map +1 -1
  23. package/lib/module/blocks/detail-editor/focus-context.js +1 -0
  24. package/lib/module/blocks/detail-editor/focus-context.js.map +1 -1
  25. package/lib/module/blocks/detail-editor/index.js +2 -2
  26. package/lib/module/blocks/detail-editor/index.js.map +1 -1
  27. package/lib/module/blocks/detail-editor/keep-words.js +34 -0
  28. package/lib/module/blocks/detail-editor/keep-words.js.map +1 -0
  29. package/lib/module/blocks/detail-editor/layout-picker.js +192 -8
  30. package/lib/module/blocks/detail-editor/layout-picker.js.map +1 -1
  31. package/lib/module/blocks/detail-request/detail-request.js +213 -0
  32. package/lib/module/blocks/detail-request/detail-request.js.map +1 -0
  33. package/lib/module/blocks/detail-request/index.js +4 -0
  34. package/lib/module/blocks/detail-request/index.js.map +1 -0
  35. package/lib/module/blocks/detail-studio/action-chips.js +72 -0
  36. package/lib/module/blocks/detail-studio/action-chips.js.map +1 -0
  37. package/lib/module/blocks/detail-studio/adjust-tiles.js +3 -3
  38. package/lib/module/blocks/detail-studio/adjust-tiles.js.map +1 -1
  39. package/lib/module/blocks/detail-studio/asset-grid.js +33 -16
  40. package/lib/module/blocks/detail-studio/asset-grid.js.map +1 -1
  41. package/lib/module/blocks/detail-studio/confirm-row.js +3 -0
  42. package/lib/module/blocks/detail-studio/confirm-row.js.map +1 -1
  43. package/lib/module/blocks/detail-studio/detail-studio-template.js +2 -6
  44. package/lib/module/blocks/detail-studio/detail-studio-template.js.map +1 -1
  45. package/lib/module/blocks/detail-studio/edge-fade.js +74 -0
  46. package/lib/module/blocks/detail-studio/edge-fade.js.map +1 -0
  47. package/lib/module/blocks/detail-studio/image-prompt.js +8 -10
  48. package/lib/module/blocks/detail-studio/image-prompt.js.map +1 -1
  49. package/lib/module/blocks/detail-studio/index.js +7 -5
  50. package/lib/module/blocks/detail-studio/index.js.map +1 -1
  51. package/lib/module/blocks/detail-studio/rewrite-tray.js +17 -64
  52. package/lib/module/blocks/detail-studio/rewrite-tray.js.map +1 -1
  53. package/lib/module/blocks/detail-studio/section-cover.js +41 -0
  54. package/lib/module/blocks/detail-studio/section-cover.js.map +1 -0
  55. package/lib/module/blocks/detail-studio/section-edit-template.js +103 -12
  56. package/lib/module/blocks/detail-studio/section-edit-template.js.map +1 -1
  57. package/lib/module/blocks/detail-studio/section-kind-grid.js +2 -3
  58. package/lib/module/blocks/detail-studio/section-kind-grid.js.map +1 -1
  59. package/lib/module/blocks/detail-studio/section-settings.js +127 -61
  60. package/lib/module/blocks/detail-studio/section-settings.js.map +1 -1
  61. package/lib/module/blocks/detail-studio/studio-bar.js +46 -25
  62. package/lib/module/blocks/detail-studio/studio-bar.js.map +1 -1
  63. package/lib/module/blocks/detail-studio/studio-dock.js +21 -39
  64. package/lib/module/blocks/detail-studio/studio-dock.js.map +1 -1
  65. package/lib/module/blocks/detail-studio/studio-glyphs.js +92 -0
  66. package/lib/module/blocks/detail-studio/studio-glyphs.js.map +1 -0
  67. package/lib/module/blocks/detail-studio/studio-sheet.js +5 -3
  68. package/lib/module/blocks/detail-studio/studio-sheet.js.map +1 -1
  69. package/lib/module/blocks/detail-studio/studio-steps.js +60 -0
  70. package/lib/module/blocks/detail-studio/studio-steps.js.map +1 -0
  71. package/lib/module/blocks/detail-studio/studio-toggle.js +130 -0
  72. package/lib/module/blocks/detail-studio/studio-toggle.js.map +1 -0
  73. package/lib/module/blocks/detail-studio/{photo-tool-bar.js → studio-tools.js} +63 -42
  74. package/lib/module/blocks/detail-studio/studio-tools.js.map +1 -0
  75. package/lib/module/blocks/detail-studio/text-format-panel.js +16 -8
  76. package/lib/module/blocks/detail-studio/text-format-panel.js.map +1 -1
  77. package/lib/module/blocks/index.js +1 -0
  78. package/lib/module/blocks/index.js.map +1 -1
  79. package/lib/module/components/button/button.js +13 -5
  80. package/lib/module/components/button/button.js.map +1 -1
  81. package/lib/module/components/chip/chip.js +5 -1
  82. package/lib/module/components/chip/chip.js.map +1 -1
  83. package/lib/module/components/chip-group/chip-group.js +1 -0
  84. package/lib/module/components/chip-group/chip-group.js.map +1 -1
  85. package/lib/module/components/credit/credit.js +6 -2
  86. package/lib/module/components/credit/credit.js.map +1 -1
  87. package/lib/module/components/dropdown-menu/dropdown-menu.js +9 -4
  88. package/lib/module/components/dropdown-menu/dropdown-menu.js.map +1 -1
  89. package/lib/module/components/segmented-control/segmented-control.js +3 -1
  90. package/lib/module/components/segmented-control/segmented-control.js.map +1 -1
  91. package/lib/module/components/skeleton/skeleton.js +4 -2
  92. package/lib/module/components/skeleton/skeleton.js.map +1 -1
  93. package/lib/module/components/slider/slider.js +53 -16
  94. package/lib/module/components/slider/slider.js.map +1 -1
  95. package/lib/module/index.js +1 -1
  96. package/lib/module/index.js.map +1 -1
  97. package/lib/module/internal/glyphs.js +2 -1
  98. package/lib/module/internal/glyphs.js.map +1 -1
  99. package/lib/module/internal/line-icons.js +1 -0
  100. package/lib/module/internal/line-icons.js.map +1 -1
  101. package/lib/module/internal/retry-glyph.js +5 -2
  102. package/lib/module/internal/retry-glyph.js.map +1 -1
  103. package/lib/module/internal/undo-glyph.js +11 -8
  104. package/lib/module/internal/undo-glyph.js.map +1 -1
  105. package/lib/module/sortable/section-board.js +73 -89
  106. package/lib/module/sortable/section-board.js.map +1 -1
  107. package/lib/module/templates/design-pick-template.js +8 -1
  108. package/lib/module/templates/design-pick-template.js.map +1 -1
  109. package/lib/module/templates/intro-template.js +3 -3
  110. package/lib/module/templates/intro-template.js.map +1 -1
  111. package/lib/module/templates/result-template.js +2 -1
  112. package/lib/module/templates/result-template.js.map +1 -1
  113. package/lib/typescript/src/adjust/adjust-template.d.ts.map +1 -1
  114. package/lib/typescript/src/adjust/axis-adjust.d.ts +25 -0
  115. package/lib/typescript/src/adjust/axis-adjust.d.ts.map +1 -0
  116. package/lib/typescript/src/adjust/axis-tabs.d.ts +15 -0
  117. package/lib/typescript/src/adjust/axis-tabs.d.ts.map +1 -0
  118. package/lib/typescript/src/adjust/axis-wheel.d.ts +15 -0
  119. package/lib/typescript/src/adjust/axis-wheel.d.ts.map +1 -0
  120. package/lib/typescript/src/adjust/index.d.ts +4 -0
  121. package/lib/typescript/src/adjust/index.d.ts.map +1 -1
  122. package/lib/typescript/src/adjust/store-sample.d.ts +46 -0
  123. package/lib/typescript/src/adjust/store-sample.d.ts.map +1 -0
  124. package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts +2 -1
  125. package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts.map +1 -1
  126. package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts +3 -1
  127. package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts.map +1 -1
  128. package/lib/typescript/src/blocks/detail-editor/detail-types.d.ts +11 -0
  129. package/lib/typescript/src/blocks/detail-editor/detail-types.d.ts.map +1 -1
  130. package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts +4 -1
  131. package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts.map +1 -1
  132. package/lib/typescript/src/blocks/detail-editor/focus-context.d.ts +9 -0
  133. package/lib/typescript/src/blocks/detail-editor/focus-context.d.ts.map +1 -1
  134. package/lib/typescript/src/blocks/detail-editor/index.d.ts +3 -2
  135. package/lib/typescript/src/blocks/detail-editor/index.d.ts.map +1 -1
  136. package/lib/typescript/src/blocks/detail-editor/keep-words.d.ts +2 -0
  137. package/lib/typescript/src/blocks/detail-editor/keep-words.d.ts.map +1 -0
  138. package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts +6 -1
  139. package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts.map +1 -1
  140. package/lib/typescript/src/blocks/detail-request/detail-request.d.ts +24 -0
  141. package/lib/typescript/src/blocks/detail-request/detail-request.d.ts.map +1 -0
  142. package/lib/typescript/src/blocks/detail-request/index.d.ts +2 -0
  143. package/lib/typescript/src/blocks/detail-request/index.d.ts.map +1 -0
  144. package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts +12 -0
  145. package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts.map +1 -0
  146. package/lib/typescript/src/blocks/detail-studio/asset-grid.d.ts.map +1 -1
  147. package/lib/typescript/src/blocks/detail-studio/confirm-row.d.ts.map +1 -1
  148. package/lib/typescript/src/blocks/detail-studio/detail-studio-template.d.ts.map +1 -1
  149. package/lib/typescript/src/blocks/detail-studio/edge-fade.d.ts +10 -0
  150. package/lib/typescript/src/blocks/detail-studio/edge-fade.d.ts.map +1 -0
  151. package/lib/typescript/src/blocks/detail-studio/image-prompt.d.ts.map +1 -1
  152. package/lib/typescript/src/blocks/detail-studio/index.d.ts +7 -5
  153. package/lib/typescript/src/blocks/detail-studio/index.d.ts.map +1 -1
  154. package/lib/typescript/src/blocks/detail-studio/rewrite-tray.d.ts +3 -3
  155. package/lib/typescript/src/blocks/detail-studio/rewrite-tray.d.ts.map +1 -1
  156. package/lib/typescript/src/blocks/detail-studio/section-cover.d.ts +7 -0
  157. package/lib/typescript/src/blocks/detail-studio/section-cover.d.ts.map +1 -0
  158. package/lib/typescript/src/blocks/detail-studio/section-edit-template.d.ts +9 -0
  159. package/lib/typescript/src/blocks/detail-studio/section-edit-template.d.ts.map +1 -1
  160. package/lib/typescript/src/blocks/detail-studio/section-kind-grid.d.ts.map +1 -1
  161. package/lib/typescript/src/blocks/detail-studio/section-settings.d.ts +11 -13
  162. package/lib/typescript/src/blocks/detail-studio/section-settings.d.ts.map +1 -1
  163. package/lib/typescript/src/blocks/detail-studio/studio-bar.d.ts +6 -2
  164. package/lib/typescript/src/blocks/detail-studio/studio-bar.d.ts.map +1 -1
  165. package/lib/typescript/src/blocks/detail-studio/studio-dock.d.ts +0 -2
  166. package/lib/typescript/src/blocks/detail-studio/studio-dock.d.ts.map +1 -1
  167. package/lib/typescript/src/blocks/detail-studio/studio-glyphs.d.ts +6 -0
  168. package/lib/typescript/src/blocks/detail-studio/studio-glyphs.d.ts.map +1 -0
  169. package/lib/typescript/src/blocks/detail-studio/studio-sheet.d.ts.map +1 -1
  170. package/lib/typescript/src/blocks/detail-studio/studio-steps.d.ts +11 -0
  171. package/lib/typescript/src/blocks/detail-studio/studio-steps.d.ts.map +1 -0
  172. package/lib/typescript/src/blocks/detail-studio/studio-toggle.d.ts +14 -0
  173. package/lib/typescript/src/blocks/detail-studio/studio-toggle.d.ts.map +1 -0
  174. package/lib/typescript/src/blocks/detail-studio/studio-tools.d.ts +19 -0
  175. package/lib/typescript/src/blocks/detail-studio/studio-tools.d.ts.map +1 -0
  176. package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts +2 -1
  177. package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts.map +1 -1
  178. package/lib/typescript/src/blocks/index.d.ts +1 -0
  179. package/lib/typescript/src/blocks/index.d.ts.map +1 -1
  180. package/lib/typescript/src/components/button/button.d.ts +3 -1
  181. package/lib/typescript/src/components/button/button.d.ts.map +1 -1
  182. package/lib/typescript/src/components/chip/chip.d.ts +2 -1
  183. package/lib/typescript/src/components/chip/chip.d.ts.map +1 -1
  184. package/lib/typescript/src/components/chip-group/chip-group.d.ts +1 -0
  185. package/lib/typescript/src/components/chip-group/chip-group.d.ts.map +1 -1
  186. package/lib/typescript/src/components/credit/credit.d.ts +1 -0
  187. package/lib/typescript/src/components/credit/credit.d.ts.map +1 -1
  188. package/lib/typescript/src/components/dropdown-menu/dropdown-menu.d.ts +2 -0
  189. package/lib/typescript/src/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  190. package/lib/typescript/src/components/segmented-control/segmented-control.d.ts +2 -0
  191. package/lib/typescript/src/components/segmented-control/segmented-control.d.ts.map +1 -1
  192. package/lib/typescript/src/components/skeleton/skeleton.d.ts +2 -1
  193. package/lib/typescript/src/components/skeleton/skeleton.d.ts.map +1 -1
  194. package/lib/typescript/src/components/slider/slider.d.ts +2 -1
  195. package/lib/typescript/src/components/slider/slider.d.ts.map +1 -1
  196. package/lib/typescript/src/index.d.ts +1 -1
  197. package/lib/typescript/src/index.d.ts.map +1 -1
  198. package/lib/typescript/src/internal/glyphs.d.ts +1 -0
  199. package/lib/typescript/src/internal/glyphs.d.ts.map +1 -1
  200. package/lib/typescript/src/internal/line-icons.d.ts +1 -0
  201. package/lib/typescript/src/internal/line-icons.d.ts.map +1 -1
  202. package/lib/typescript/src/internal/retry-glyph.d.ts.map +1 -1
  203. package/lib/typescript/src/internal/undo-glyph.d.ts.map +1 -1
  204. package/lib/typescript/src/sortable/section-board.d.ts.map +1 -1
  205. package/lib/typescript/src/templates/design-pick-template.d.ts.map +1 -1
  206. package/lib/typescript/src/templates/intro-template.d.ts.map +1 -1
  207. package/lib/typescript/src/templates/result-template.d.ts +2 -1
  208. package/lib/typescript/src/templates/result-template.d.ts.map +1 -1
  209. package/package.json +1 -1
  210. package/src/adjust/adjust-template.tsx +1 -0
  211. package/src/adjust/axis-adjust.tsx +206 -0
  212. package/src/adjust/axis-tabs.tsx +81 -0
  213. package/src/adjust/axis-wheel.tsx +309 -0
  214. package/src/adjust/index.ts +15 -0
  215. package/src/adjust/store-sample.tsx +519 -0
  216. package/src/blocks/color-swatch-picker/color-swatch-picker.tsx +1 -1
  217. package/src/blocks/detail-editor/compare-slider.tsx +3 -1
  218. package/src/blocks/detail-editor/detail-canvas.tsx +264 -69
  219. package/src/blocks/detail-editor/detail-types.ts +37 -0
  220. package/src/blocks/detail-editor/draft-preview.tsx +46 -2
  221. package/src/blocks/detail-editor/focus-context.ts +13 -0
  222. package/src/blocks/detail-editor/index.ts +11 -1
  223. package/src/blocks/detail-editor/keep-words.ts +36 -0
  224. package/src/blocks/detail-editor/layout-picker.tsx +188 -6
  225. package/src/blocks/detail-request/detail-request.tsx +198 -0
  226. package/src/blocks/detail-request/index.ts +11 -0
  227. package/src/blocks/detail-studio/action-chips.tsx +77 -0
  228. package/src/blocks/detail-studio/adjust-tiles.tsx +3 -3
  229. package/src/blocks/detail-studio/asset-grid.tsx +30 -16
  230. package/src/blocks/detail-studio/confirm-row.tsx +3 -0
  231. package/src/blocks/detail-studio/detail-studio-template.tsx +2 -6
  232. package/src/blocks/detail-studio/edge-fade.tsx +76 -0
  233. package/src/blocks/detail-studio/image-prompt.tsx +6 -9
  234. package/src/blocks/detail-studio/index.ts +19 -16
  235. package/src/blocks/detail-studio/rewrite-tray.tsx +16 -56
  236. package/src/blocks/detail-studio/section-cover.tsx +44 -0
  237. package/src/blocks/detail-studio/section-edit-template.tsx +138 -13
  238. package/src/blocks/detail-studio/section-kind-grid.tsx +2 -2
  239. package/src/blocks/detail-studio/section-settings.tsx +124 -69
  240. package/src/blocks/detail-studio/studio-bar.tsx +61 -41
  241. package/src/blocks/detail-studio/studio-dock.tsx +19 -37
  242. package/src/blocks/detail-studio/studio-glyphs.tsx +77 -0
  243. package/src/blocks/detail-studio/studio-sheet.tsx +7 -3
  244. package/src/blocks/detail-studio/studio-steps.tsx +58 -0
  245. package/src/blocks/detail-studio/studio-toggle.tsx +130 -0
  246. package/src/blocks/detail-studio/studio-tools.tsx +126 -0
  247. package/src/blocks/detail-studio/text-format-panel.tsx +26 -14
  248. package/src/blocks/index.tsx +1 -0
  249. package/src/components/button/button.tsx +12 -5
  250. package/src/components/chip/chip.tsx +9 -1
  251. package/src/components/chip-group/chip-group.tsx +2 -0
  252. package/src/components/credit/credit.tsx +9 -2
  253. package/src/components/dropdown-menu/dropdown-menu.tsx +18 -7
  254. package/src/components/segmented-control/segmented-control.tsx +10 -2
  255. package/src/components/skeleton/skeleton.tsx +5 -2
  256. package/src/components/slider/slider.tsx +66 -14
  257. package/src/index.tsx +1 -0
  258. package/src/internal/glyphs.tsx +2 -0
  259. package/src/internal/line-icons.ts +2 -0
  260. package/src/internal/retry-glyph.tsx +7 -2
  261. package/src/internal/undo-glyph.tsx +12 -11
  262. package/src/sortable/section-board.tsx +71 -76
  263. package/src/templates/design-pick-template.tsx +9 -1
  264. package/src/templates/intro-template.tsx +14 -12
  265. package/src/templates/result-template.tsx +3 -0
  266. package/lib/module/blocks/detail-studio/keyboard-bar.js +0 -67
  267. package/lib/module/blocks/detail-studio/keyboard-bar.js.map +0 -1
  268. package/lib/module/blocks/detail-studio/photo-tool-bar.js.map +0 -1
  269. package/lib/module/blocks/detail-studio/section-thumb.js +0 -49
  270. package/lib/module/blocks/detail-studio/section-thumb.js.map +0 -1
  271. package/lib/typescript/src/blocks/detail-studio/keyboard-bar.d.ts +0 -18
  272. package/lib/typescript/src/blocks/detail-studio/keyboard-bar.d.ts.map +0 -1
  273. package/lib/typescript/src/blocks/detail-studio/photo-tool-bar.d.ts +0 -19
  274. package/lib/typescript/src/blocks/detail-studio/photo-tool-bar.d.ts.map +0 -1
  275. package/lib/typescript/src/blocks/detail-studio/section-thumb.d.ts +0 -14
  276. package/lib/typescript/src/blocks/detail-studio/section-thumb.d.ts.map +0 -1
  277. package/src/blocks/detail-studio/keyboard-bar.tsx +0 -73
  278. package/src/blocks/detail-studio/photo-tool-bar.tsx +0 -100
  279. package/src/blocks/detail-studio/section-thumb.tsx +0 -41
@@ -1,6 +1,6 @@
1
1
  import { View } from 'react-native';
2
- import { SegmentedControl } from '../../components/segmented-control/segmented-control';
3
- import { Slider } from '../../components/slider/slider';
2
+ import { PressableBase } from '../../internal/pressable-base';
3
+ import { useTheme } from '../../theme/theme-provider';
4
4
  import { makeStyles } from '../../utils/styles';
5
5
  import {
6
6
  ColorSwatchPicker,
@@ -8,48 +8,92 @@ import {
8
8
  } from '../color-swatch-picker/color-swatch-picker';
9
9
  import {
10
10
  DETAIL_COLORS,
11
- detailBlockSpace,
12
11
  type DetailLayout,
13
12
  } from '../detail-editor/detail-types';
14
- import { LayoutPicker } from '../detail-editor/layout-picker';
13
+ import {
14
+ LABELS as LAYOUT_LABELS,
15
+ SoftDiagram,
16
+ } from '../detail-editor/layout-picker';
15
17
 
16
- export type SectionSettingsTab = 'layout' | 'background' | 'space';
18
+ export type SectionSpace = { top: number; bottom: number };
17
19
 
18
20
  export type SectionSettingsProps = {
19
- tab: SectionSettingsTab;
20
- onTabChange: (tab: SectionSettingsTab) => void;
21
21
  layout: DetailLayout | null;
22
22
  layouts: readonly DetailLayout[];
23
23
  onLayoutChange: (layout: DetailLayout) => void;
24
24
  background: string;
25
25
  onBackgroundChange: (color: string) => void;
26
- space: { top: number; bottom: number };
27
- onSpaceChange: (
28
- patch: Partial<{ top: number; bottom: number }>,
29
- group: string
30
- ) => void;
31
- onSlidingStart?: () => void;
26
+ space: SectionSpace;
27
+ onSpaceChange: (space: SectionSpace) => void;
32
28
  colors?: readonly ColorSwatch[];
33
29
  };
34
30
 
35
- const TABS: { value: SectionSettingsTab; label: string }[] = [
36
- { value: 'layout', label: '배치' },
37
- { value: 'background', label: '배경' },
38
- { value: 'space', label: '여백' },
31
+ export const SECTION_SPACES: readonly { value: number; label: string }[] = [
32
+ { value: 1, label: '좁게' },
33
+ { value: 3, label: '보통' },
34
+ { value: 6, label: '넓게' },
39
35
  ];
40
36
 
37
+ const COLUMNS = 4;
38
+
41
39
  const useStyles = makeStyles((t) => ({
42
- tabs: { paddingHorizontal: t.space[4] },
43
- body: { paddingTop: t.space[3] },
40
+ root: { gap: t.space[4], paddingTop: t.space[1] },
41
+ grid: { gap: t.space[2], paddingHorizontal: t.space[4] },
42
+ row: { flexDirection: 'row', gap: t.space[2] },
43
+ cell: { flex: 1 },
44
+ tile: {
45
+ height: t.space[16] + t.space[4],
46
+ overflow: 'hidden',
47
+ alignItems: 'center',
48
+ justifyContent: 'center',
49
+ gap: t.space[1],
50
+ padding: t.space[2],
51
+ borderRadius: t.radius.lg,
52
+ borderWidth: 1,
53
+ borderColor: t.colors.border,
54
+ backgroundColor: t.colors.surface,
55
+ },
56
+ on: {
57
+ borderColor: t.colors.primary,
58
+ backgroundColor: t.colors.primaryTint,
59
+ },
44
60
  inset: { paddingHorizontal: t.space[4] },
45
- space: { paddingHorizontal: t.space[5] },
61
+ swatches: { paddingHorizontal: t.space[1] },
62
+ spaces: {
63
+ flexDirection: 'row',
64
+ gap: t.space[2],
65
+ paddingHorizontal: t.space[4],
66
+ },
67
+ space: {
68
+ flex: 1,
69
+ height: t.controlSize.lg,
70
+ alignItems: 'center',
71
+ justifyContent: 'center',
72
+ borderRadius: t.radius.lg,
73
+ borderWidth: 1,
74
+ borderColor: t.colors.border,
75
+ backgroundColor: t.colors.surface,
76
+ },
77
+ gap: {
78
+ width: '46%',
79
+ borderTopWidth: t.space[1] / 2,
80
+ borderBottomWidth: t.space[1] / 2,
81
+ borderColor: t.colors.input,
82
+ },
83
+ gapOn: { borderColor: t.colors.primary },
46
84
  }));
47
85
 
48
- const px = (value: number) => String(Math.round(detailBlockSpace(value)));
86
+ function rows<T>(items: readonly T[]): (T | null)[][] {
87
+ const out: (T | null)[][] = [];
88
+ for (let i = 0; i < items.length; i += COLUMNS) {
89
+ const row: (T | null)[] = items.slice(i, i + COLUMNS);
90
+ while (row.length < COLUMNS) row.push(null);
91
+ out.push(row);
92
+ }
93
+ return out;
94
+ }
49
95
 
50
96
  export function SectionSettings({
51
- tab,
52
- onTabChange,
53
97
  layout,
54
98
  layouts,
55
99
  onLayoutChange,
@@ -57,58 +101,69 @@ export function SectionSettings({
57
101
  onBackgroundChange,
58
102
  space,
59
103
  onSpaceChange,
60
- onSlidingStart,
61
104
  colors,
62
105
  }: SectionSettingsProps) {
106
+ const t = useTheme();
63
107
  const s = useStyles();
64
108
  return (
65
- <View>
66
- <View style={s.tabs}>
67
- <SegmentedControl
68
- items={TABS}
69
- value={tab}
70
- onValueChange={onTabChange}
109
+ <View style={s.root}>
110
+ <View accessibilityRole="radiogroup" style={s.grid}>
111
+ {rows(layouts).map((row, r) => (
112
+ <View key={r} style={s.row}>
113
+ {row.map((item, c) =>
114
+ item ? (
115
+ <PressableBase
116
+ key={item}
117
+ accessibilityRole="radio"
118
+ accessibilityState={{ selected: item === layout }}
119
+ accessibilityLabel={LAYOUT_LABELS[item]}
120
+ onPress={() => onLayoutChange(item)}
121
+ style={s.cell}
122
+ >
123
+ <View style={[s.tile, item === layout && s.on]}>
124
+ <SoftDiagram layout={item} />
125
+ </View>
126
+ </PressableBase>
127
+ ) : (
128
+ <View key={`empty-${c}`} style={s.cell} />
129
+ )
130
+ )}
131
+ </View>
132
+ ))}
133
+ </View>
134
+ <View style={s.inset}>
135
+ <ColorSwatchPicker
136
+ variant="row"
137
+ style={s.swatches}
138
+ colors={colors ?? DETAIL_COLORS}
139
+ value={background}
140
+ onValueChange={onBackgroundChange}
71
141
  />
72
142
  </View>
73
- <View style={s.body}>
74
- {tab === 'layout' ? (
75
- <LayoutPicker
76
- value={layout}
77
- items={layouts}
78
- onValueChange={onLayoutChange}
79
- />
80
- ) : tab === 'background' ? (
81
- <View style={s.inset}>
82
- <ColorSwatchPicker
83
- colors={colors ?? DETAIL_COLORS}
84
- value={background}
85
- onValueChange={onBackgroundChange}
86
- />
87
- </View>
88
- ) : (
89
- <View style={s.space}>
90
- <Slider
91
- value={space.top}
92
- min={0}
93
- max={10}
94
- onChange={(top) => onSpaceChange({ top }, 'space_top')}
95
- onSlidingStart={onSlidingStart}
96
- startLabel="위"
97
- endLabel={px(space.top)}
98
- accessibilityLabel="위 여백"
99
- />
100
- <Slider
101
- value={space.bottom}
102
- min={0}
103
- max={10}
104
- onChange={(bottom) => onSpaceChange({ bottom }, 'space_bottom')}
105
- onSlidingStart={onSlidingStart}
106
- startLabel="아래"
107
- endLabel={px(space.bottom)}
108
- accessibilityLabel="아래 여백"
109
- />
110
- </View>
111
- )}
143
+ <View accessibilityRole="radiogroup" style={s.spaces}>
144
+ {SECTION_SPACES.map((item) => {
145
+ const on = space.top === item.value && space.bottom === item.value;
146
+ return (
147
+ <PressableBase
148
+ key={item.value}
149
+ accessibilityRole="radio"
150
+ accessibilityState={{ selected: on }}
151
+ accessibilityLabel={`여백 ${item.label}`}
152
+ onPress={() =>
153
+ onSpaceChange({ top: item.value, bottom: item.value })
154
+ }
155
+ style={[s.space, on && s.on]}
156
+ >
157
+ <View
158
+ style={[
159
+ s.gap,
160
+ { height: item.value * t.space[1] + t.space[1] },
161
+ on && s.gapOn,
162
+ ]}
163
+ />
164
+ </PressableBase>
165
+ );
166
+ })}
112
167
  </View>
113
168
  </View>
114
169
  );
@@ -1,8 +1,8 @@
1
- import type { ReactNode } from 'react';
1
+ import { useState, type ReactNode } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import { Button } from '../../components/button/button';
4
4
  import { Text } from '../../components/text/text';
5
- import { ChevronGlyph, CloseGlyph } from '../../internal/glyphs';
5
+ import { CheckGlyph, ChevronGlyph, CloseGlyph } from '../../internal/glyphs';
6
6
  import { renderIcon, type IconSlot } from '../../internal/icon';
7
7
  import { PressableBase } from '../../internal/pressable-base';
8
8
  import { useTheme } from '../../theme/theme-provider';
@@ -32,6 +32,7 @@ export type StudioBarProps = {
32
32
  loading?: boolean;
33
33
  };
34
34
  tools?: readonly StudioBarTool[];
35
+ confirm?: { label: string; onPress: () => void };
35
36
  };
36
37
 
37
38
  const useStyles = makeStyles((t) => ({
@@ -55,8 +56,6 @@ const useStyles = makeStyles((t) => ({
55
56
  mirror: { transform: [{ scaleX: -1 }] },
56
57
  center: {
57
58
  position: 'absolute',
58
- left: t.space[16] + t.space[8],
59
- right: t.space[16] + t.space[8],
60
59
  top: 0,
61
60
  bottom: 0,
62
61
  flexDirection: 'row',
@@ -70,12 +69,12 @@ const useStyles = makeStyles((t) => ({
70
69
  color: t.colors.title,
71
70
  flexShrink: 1,
72
71
  },
73
- end: { marginLeft: 'auto', paddingRight: t.space[2] },
74
- narrow: {
75
- left: t.space[16] * 2 + t.space[3],
76
- right: t.space[16] * 2 + t.space[3],
72
+ end: {
73
+ marginLeft: 'auto',
74
+ flexDirection: 'row',
75
+ alignItems: 'center',
77
76
  },
78
- tools: { marginLeft: 'auto', flexDirection: 'row', alignItems: 'center' },
77
+ done: { paddingHorizontal: t.space[3] },
79
78
  tool: {
80
79
  width: t.minTouchSize,
81
80
  height: t.minTouchSize,
@@ -96,13 +95,25 @@ export function StudioBar({
96
95
  tag,
97
96
  action,
98
97
  tools,
98
+ confirm,
99
99
  }: StudioBarProps) {
100
100
  const t = useTheme();
101
101
  const s = useStyles();
102
+ const [width, setWidth] = useState(0);
103
+ const [end, setEnd] = useState(0);
102
104
  const back = leading === 'back';
103
105
  const Glyph = back ? ChevronGlyph : CloseGlyph;
106
+ const pad = t.space[2];
107
+ const lead = pad + t.minTouchSize;
108
+ const trail = pad + end;
109
+ const side = Math.max(lead, trail);
110
+ const even = width - side * 2 >= t.space[16] * 2;
111
+ const center = even
112
+ ? { left: side, right: side }
113
+ : { left: lead, right: trail };
104
114
  return (
105
115
  <View
116
+ onLayout={(e) => setWidth(e.nativeEvent.layout.width)}
106
117
  style={[
107
118
  s.bar,
108
119
  {
@@ -114,13 +125,13 @@ export function StudioBar({
114
125
  ]}
115
126
  >
116
127
  <View
117
- style={[s.center, tools && s.narrow, { top: topInset }]}
128
+ style={[s.center, center, { top: topInset }]}
118
129
  pointerEvents="box-none"
119
130
  >
120
131
  <Text accessibilityRole="header" numberOfLines={1} style={s.title}>
121
132
  {title}
122
133
  </Text>
123
- {tag}
134
+ {tag ? <View>{tag}</View> : null}
124
135
  </View>
125
136
  <PressableBase
126
137
  onPress={onClose}
@@ -131,43 +142,52 @@ export function StudioBar({
131
142
  <Glyph color={t.colors.title} size={t.iconSize.md} />
132
143
  </View>
133
144
  </PressableBase>
134
- {tools ? (
135
- <View style={s.tools}>
136
- {tools.map((tool) => (
137
- <PressableBase
138
- key={tool.key}
139
- onPress={tool.onPress}
140
- disabled={!tool.onPress}
141
- disabledStyle={{}}
142
- accessibilityLabel={tool.label}
143
- accessibilityState={
144
- tool.active === undefined
145
- ? undefined
146
- : { selected: tool.active }
147
- }
148
- style={[s.tool, tool.active && s.toolOn]}
149
- >
150
- <View style={tool.mirror && s.mirror}>
151
- {renderIcon(tool.icon, {
152
- color: tool.onPress ? t.colors.title : t.colors.input,
153
- size: t.iconSize.md,
154
- })}
155
- </View>
156
- </PressableBase>
157
- ))}
158
- </View>
159
- ) : action ? (
160
- <View style={s.end}>
145
+ <View style={s.end} onLayout={(e) => setEnd(e.nativeEvent.layout.width)}>
146
+ {tools?.map((tool) => (
147
+ <PressableBase
148
+ key={tool.key}
149
+ onPress={tool.onPress}
150
+ disabled={!tool.onPress}
151
+ disabledStyle={{}}
152
+ accessibilityLabel={tool.label}
153
+ accessibilityState={
154
+ tool.active === undefined ? undefined : { selected: tool.active }
155
+ }
156
+ style={[s.tool, tool.active && s.toolOn]}
157
+ >
158
+ <View style={tool.mirror && s.mirror}>
159
+ {renderIcon(tool.icon, {
160
+ color: tool.onPress
161
+ ? t.colors.title
162
+ : t.colors.disabledForeground,
163
+ size: t.iconSize.md,
164
+ })}
165
+ </View>
166
+ </PressableBase>
167
+ ))}
168
+ {action ? (
161
169
  <Button
162
- size="sm"
170
+ variant="ghost"
171
+ point
172
+ size="md"
173
+ style={s.done}
163
174
  onPress={action.onPress}
164
175
  disabled={action.disabled}
165
176
  loading={action.loading}
166
177
  >
167
178
  {action.label}
168
179
  </Button>
169
- </View>
170
- ) : null}
180
+ ) : null}
181
+ {confirm ? (
182
+ <PressableBase
183
+ onPress={confirm.onPress}
184
+ accessibilityLabel={confirm.label}
185
+ style={s.tool}
186
+ >
187
+ <CheckGlyph color={t.colors.primary} size={t.iconSize.md} />
188
+ </PressableBase>
189
+ ) : null}
190
+ </View>
171
191
  </View>
172
192
  );
173
193
  }
@@ -3,7 +3,6 @@ import { Text } from '../../components/text/text';
3
3
  import { renderIcon, type IconSlot } from '../../internal/icon';
4
4
  import { PressableBase } from '../../internal/pressable-base';
5
5
  import { useTheme } from '../../theme/theme-provider';
6
- import type { Theme } from '../../types';
7
6
  import { makeStyles } from '../../utils/styles';
8
7
 
9
8
  export type StudioDockItem = {
@@ -19,71 +18,54 @@ export type StudioDockProps = {
19
18
  bottomInset?: number;
20
19
  };
21
20
 
22
- const TOOL = { width: 72, height: 56 } as const;
23
-
24
- function dockBottom(t: Theme, bottomInset = 0) {
25
- return Math.max(bottomInset, t.space[4]);
26
- }
27
-
28
- export function studioDockSpace(t: Theme, bottomInset?: number): number {
29
- return dockBottom(t, bottomInset) + TOOL.height + t.space[1] * 2 + t.space[4];
30
- }
31
-
32
21
  const useStyles = makeStyles((t) => ({
33
- wrap: {
34
- position: 'absolute',
35
- left: 0,
36
- right: 0,
37
- alignItems: 'center',
38
- },
39
22
  dock: {
40
23
  flexDirection: 'row',
41
- gap: t.space[2],
42
- paddingVertical: t.space[1],
43
- paddingHorizontal: t.space[3],
44
- borderRadius: t.radius.lg,
24
+ paddingTop: t.space[1],
25
+ paddingHorizontal: t.space[2],
26
+ borderTopWidth: 1,
27
+ borderTopColor: t.colors.border,
45
28
  backgroundColor: t.colors.surface,
46
- boxShadow: t.shadow.lift,
47
29
  },
48
30
  tool: {
49
- width: TOOL.width,
50
- height: TOOL.height,
31
+ flex: 1,
51
32
  alignItems: 'center',
52
33
  justifyContent: 'center',
53
34
  gap: t.space[1],
35
+ paddingVertical: t.space[2],
54
36
  borderRadius: t.radius.md,
55
37
  },
56
- label: { color: t.colors.title },
57
38
  }));
58
39
 
59
- export function StudioDock({ items, bottomInset }: StudioDockProps) {
40
+ export function StudioDock({ items, bottomInset = 0 }: StudioDockProps) {
60
41
  const t = useTheme();
61
42
  const s = useStyles();
62
43
  return (
63
44
  <View
64
- pointerEvents="box-none"
65
- style={[s.wrap, { bottom: dockBottom(t, bottomInset) }]}
45
+ accessibilityRole="toolbar"
46
+ style={[s.dock, { paddingBottom: Math.max(bottomInset, t.space[2]) }]}
66
47
  >
67
- <View accessibilityRole="toolbar" style={s.dock}>
68
- {items.map((item) => (
48
+ {items.map((item) => {
49
+ const color = item.disabled
50
+ ? t.colors.disabledForeground
51
+ : t.colors.title;
52
+ return (
69
53
  <PressableBase
70
54
  key={item.key}
71
55
  onPress={item.onPress}
72
56
  disabled={item.disabled}
57
+ disabledStyle={{}}
73
58
  accessibilityLabel={item.label}
74
59
  feedback="small"
75
60
  style={s.tool}
76
61
  >
77
- {renderIcon(item.icon, {
78
- color: t.colors.title,
79
- size: t.iconSize.md,
80
- })}
81
- <Text variant="caption" numberOfLines={1} style={s.label}>
62
+ {renderIcon(item.icon, { color, size: t.space[6] })}
63
+ <Text variant="caption" numberOfLines={1} style={{ color }}>
82
64
  {item.label}
83
65
  </Text>
84
66
  </PressableBase>
85
- ))}
86
- </View>
67
+ );
68
+ })}
87
69
  </View>
88
70
  );
89
71
  }
@@ -0,0 +1,77 @@
1
+ import { StyleSheet, View } from 'react-native';
2
+ import { MoreGlyph } from '../../internal/glyphs';
3
+ import type { IconRenderProps } from '../../internal/icon';
4
+
5
+ export { RetryGlyph } from '../../internal/retry-glyph';
6
+
7
+ const OPEN = 'transparent';
8
+
9
+ const g = StyleSheet.create({
10
+ center: { alignItems: 'center', justifyContent: 'center' },
11
+ arc: { position: 'absolute', transform: [{ rotate: '45deg' }] },
12
+ turn: { transform: [{ rotate: '90deg' }] },
13
+ });
14
+
15
+ export function MinusGlyph({ color, size }: IconRenderProps) {
16
+ const stroke = Math.max(1.5, size / 16);
17
+ return (
18
+ <View style={[g.center, { width: size, height: size }]}>
19
+ <View
20
+ style={{
21
+ width: size * 0.6,
22
+ height: stroke,
23
+ borderRadius: stroke,
24
+ backgroundColor: color,
25
+ }}
26
+ />
27
+ </View>
28
+ );
29
+ }
30
+
31
+ export function WaveGlyph({ color, size }: IconRenderProps) {
32
+ const stroke = Math.max(1.5, size / 14);
33
+ const ring = size * 0.4;
34
+ const top = (size - ring) / 2;
35
+ const arc = {
36
+ width: ring,
37
+ height: ring,
38
+ top,
39
+ borderRadius: ring / 2,
40
+ borderWidth: stroke,
41
+ borderColor: OPEN,
42
+ };
43
+ return (
44
+ <View style={{ width: size, height: size }}>
45
+ <View
46
+ style={[
47
+ g.arc,
48
+ arc,
49
+ {
50
+ left: size / 2 - ring + stroke / 2,
51
+ borderTopColor: color,
52
+ borderLeftColor: color,
53
+ },
54
+ ]}
55
+ />
56
+ <View
57
+ style={[
58
+ g.arc,
59
+ arc,
60
+ {
61
+ left: size / 2 - stroke / 2,
62
+ borderBottomColor: color,
63
+ borderRightColor: color,
64
+ },
65
+ ]}
66
+ />
67
+ </View>
68
+ );
69
+ }
70
+
71
+ export function DotsGlyph({ color, size }: IconRenderProps) {
72
+ return (
73
+ <View style={g.turn}>
74
+ <MoreGlyph color={color} size={size} />
75
+ </View>
76
+ );
77
+ }
@@ -16,13 +16,17 @@ export type StudioSheetProps = {
16
16
  children: ReactNode;
17
17
  };
18
18
 
19
+ const OFFSET = /(^|,\s*)(-?[\d.]+px)\s+([\d.]+px)/g;
20
+
21
+ const raise = (shadow: string) => shadow.replace(OFFSET, '$1$2 -$3');
22
+
19
23
  const useStyles = makeStyles((t) => ({
20
24
  sheet: {
21
25
  paddingTop: t.space[2],
22
- borderTopLeftRadius: t.radius.lg,
23
- borderTopRightRadius: t.radius.lg,
26
+ borderTopLeftRadius: t.radius.md * 2,
27
+ borderTopRightRadius: t.radius.md * 2,
24
28
  backgroundColor: t.colors.surface,
25
- boxShadow: t.shadow.lift,
29
+ boxShadow: raise(t.shadow.lift),
26
30
  },
27
31
  }));
28
32
 
@@ -0,0 +1,58 @@
1
+ import { View } from 'react-native';
2
+ import { makeStyles } from '../../utils/styles';
3
+
4
+ export type StudioStep = { key: string; label: string };
5
+
6
+ export type StudioStepsProps = {
7
+ steps: readonly StudioStep[];
8
+ current: string | null;
9
+ done?: boolean;
10
+ };
11
+
12
+ const useStyles = makeStyles((t) => ({
13
+ row: {
14
+ flexDirection: 'row',
15
+ gap: t.space[1],
16
+ paddingHorizontal: t.space[4],
17
+ paddingBottom: t.space[2],
18
+ },
19
+ track: {
20
+ flex: 1,
21
+ height: t.space[1],
22
+ overflow: 'hidden',
23
+ borderRadius: t.radius.full,
24
+ backgroundColor: t.colors.muted,
25
+ },
26
+ fill: {
27
+ height: '100%',
28
+ borderRadius: t.radius.full,
29
+ backgroundColor: t.colors.primary,
30
+ },
31
+ full: { width: '100%' },
32
+ half: { width: '50%' },
33
+ }));
34
+
35
+ export function StudioSteps({ steps, current, done }: StudioStepsProps) {
36
+ const s = useStyles();
37
+ const at = done ? steps.length : steps.findIndex((x) => x.key === current);
38
+ const now = steps[at];
39
+ return (
40
+ <View
41
+ accessible
42
+ accessibilityRole="progressbar"
43
+ accessibilityLabel={now?.label}
44
+ accessibilityValue={{ min: 0, max: steps.length, now: Math.max(0, at) }}
45
+ style={s.row}
46
+ >
47
+ {steps.map((step, i) => (
48
+ <View key={step.key} style={s.track}>
49
+ {i < at ? (
50
+ <View style={[s.fill, s.full]} />
51
+ ) : i === at ? (
52
+ <View style={[s.fill, s.half]} />
53
+ ) : null}
54
+ </View>
55
+ ))}
56
+ </View>
57
+ );
58
+ }