@ezpg/app-ui 0.17.0 → 0.18.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 (86) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/lib/module/blocks/cover-photos/cover-photos.js +165 -0
  3. package/lib/module/blocks/cover-photos/cover-photos.js.map +1 -0
  4. package/lib/module/blocks/cover-photos/index.js +4 -0
  5. package/lib/module/blocks/cover-photos/index.js.map +1 -0
  6. package/lib/module/blocks/detail-editor/draft-preview.js +39 -0
  7. package/lib/module/blocks/detail-editor/draft-preview.js.map +1 -0
  8. package/lib/module/blocks/detail-editor/index.js +2 -0
  9. package/lib/module/blocks/detail-editor/index.js.map +1 -1
  10. package/lib/module/blocks/detail-editor/layout-picker.js +1 -1
  11. package/lib/module/blocks/detail-editor/layout-picker.js.map +1 -1
  12. package/lib/module/blocks/detail-editor/structure-picker.js +75 -0
  13. package/lib/module/blocks/detail-editor/structure-picker.js.map +1 -0
  14. package/lib/module/blocks/index.js +2 -0
  15. package/lib/module/blocks/index.js.map +1 -1
  16. package/lib/module/blocks/slider-list/index.js +4 -0
  17. package/lib/module/blocks/slider-list/index.js.map +1 -0
  18. package/lib/module/blocks/slider-list/slider-list.js +45 -0
  19. package/lib/module/blocks/slider-list/slider-list.js.map +1 -0
  20. package/lib/module/components/list-row/list-row.js +8 -2
  21. package/lib/module/components/list-row/list-row.js.map +1 -1
  22. package/lib/module/components/section-tabs/index.js +4 -0
  23. package/lib/module/components/section-tabs/index.js.map +1 -0
  24. package/lib/module/components/section-tabs/section-tabs.js +73 -0
  25. package/lib/module/components/section-tabs/section-tabs.js.map +1 -0
  26. package/lib/module/index.js +1 -0
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/internal/flush-row.js +5 -0
  29. package/lib/module/internal/flush-row.js.map +1 -0
  30. package/lib/module/templates/index.js +1 -0
  31. package/lib/module/templates/index.js.map +1 -1
  32. package/lib/module/templates/parts.js +41 -1
  33. package/lib/module/templates/parts.js.map +1 -1
  34. package/lib/module/templates/sheet-form-template.js +174 -0
  35. package/lib/module/templates/sheet-form-template.js.map +1 -0
  36. package/lib/typescript/src/blocks/cover-photos/cover-photos.d.ts +16 -0
  37. package/lib/typescript/src/blocks/cover-photos/cover-photos.d.ts.map +1 -0
  38. package/lib/typescript/src/blocks/cover-photos/index.d.ts +2 -0
  39. package/lib/typescript/src/blocks/cover-photos/index.d.ts.map +1 -0
  40. package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts +8 -0
  41. package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts.map +1 -0
  42. package/lib/typescript/src/blocks/detail-editor/index.d.ts +2 -0
  43. package/lib/typescript/src/blocks/detail-editor/index.d.ts.map +1 -1
  44. package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts +3 -0
  45. package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts.map +1 -1
  46. package/lib/typescript/src/blocks/detail-editor/structure-picker.d.ts +13 -0
  47. package/lib/typescript/src/blocks/detail-editor/structure-picker.d.ts.map +1 -0
  48. package/lib/typescript/src/blocks/index.d.ts +2 -0
  49. package/lib/typescript/src/blocks/index.d.ts.map +1 -1
  50. package/lib/typescript/src/blocks/slider-list/index.d.ts +2 -0
  51. package/lib/typescript/src/blocks/slider-list/index.d.ts.map +1 -0
  52. package/lib/typescript/src/blocks/slider-list/slider-list.d.ts +17 -0
  53. package/lib/typescript/src/blocks/slider-list/slider-list.d.ts.map +1 -0
  54. package/lib/typescript/src/components/list-row/list-row.d.ts.map +1 -1
  55. package/lib/typescript/src/components/section-tabs/index.d.ts +2 -0
  56. package/lib/typescript/src/components/section-tabs/index.d.ts.map +1 -0
  57. package/lib/typescript/src/components/section-tabs/section-tabs.d.ts +14 -0
  58. package/lib/typescript/src/components/section-tabs/section-tabs.d.ts.map +1 -0
  59. package/lib/typescript/src/index.d.ts +1 -0
  60. package/lib/typescript/src/index.d.ts.map +1 -1
  61. package/lib/typescript/src/internal/flush-row.d.ts +2 -0
  62. package/lib/typescript/src/internal/flush-row.d.ts.map +1 -0
  63. package/lib/typescript/src/templates/index.d.ts +2 -0
  64. package/lib/typescript/src/templates/index.d.ts.map +1 -1
  65. package/lib/typescript/src/templates/parts.d.ts +2 -1
  66. package/lib/typescript/src/templates/parts.d.ts.map +1 -1
  67. package/lib/typescript/src/templates/sheet-form-template.d.ts +31 -0
  68. package/lib/typescript/src/templates/sheet-form-template.d.ts.map +1 -0
  69. package/package.json +1 -1
  70. package/src/blocks/cover-photos/cover-photos.tsx +176 -0
  71. package/src/blocks/cover-photos/index.ts +5 -0
  72. package/src/blocks/detail-editor/draft-preview.tsx +34 -0
  73. package/src/blocks/detail-editor/index.ts +6 -0
  74. package/src/blocks/detail-editor/layout-picker.tsx +1 -1
  75. package/src/blocks/detail-editor/structure-picker.tsx +75 -0
  76. package/src/blocks/index.tsx +2 -0
  77. package/src/blocks/slider-list/index.ts +5 -0
  78. package/src/blocks/slider-list/slider-list.tsx +57 -0
  79. package/src/components/list-row/list-row.tsx +6 -0
  80. package/src/components/section-tabs/index.ts +5 -0
  81. package/src/components/section-tabs/section-tabs.tsx +87 -0
  82. package/src/index.tsx +1 -0
  83. package/src/internal/flush-row.ts +3 -0
  84. package/src/templates/index.ts +5 -0
  85. package/src/templates/parts.tsx +45 -0
  86. package/src/templates/sheet-form-template.tsx +190 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flush-row.d.ts","sourceRoot":"","sources":["../../../../src/internal/flush-row.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,kCAAuB,CAAC"}
@@ -24,4 +24,6 @@ export { PreviewTemplate } from './preview-template.js';
24
24
  export type { PreviewTemplateAction, PreviewTemplateProps, } from './preview-template.js';
25
25
  export { SplitPreviewTemplate } from './split-preview-template.js';
26
26
  export type { SplitPreviewTemplateProps } from './split-preview-template.js';
27
+ export { SheetBlock, SheetFormTemplate } from './sheet-form-template.js';
28
+ export type { SheetBlockProps, SheetFormTemplateProps, } from './sheet-form-template.js';
27
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACb,MAAM,uBAAoB,CAAC;AAC5B,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAmB,CAAC;AAC5E,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAqB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,UAAU,GACX,MAAM,sBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAiB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAiB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAkB,CAAC;AACjD,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,qBAAkB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAmB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAS,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAsB,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAsB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAoB,CAAC;AACrD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA0B,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACb,MAAM,uBAAoB,CAAC;AAC5B,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAmB,CAAC;AAC5E,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAqB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,UAAU,GACX,MAAM,sBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAiB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAiB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAkB,CAAC;AACjD,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,qBAAkB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAmB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAS,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAsB,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAsB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAoB,CAAC;AACrD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA0B,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA0B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,0BAAuB,CAAC;AACtE,YAAY,EACV,eAAe,EACf,sBAAsB,GACvB,MAAM,0BAAuB,CAAC"}
@@ -10,10 +10,11 @@ export type TemplateNotice = {
10
10
  reason: NoticeReason;
11
11
  text: string;
12
12
  };
13
- export declare function BottomBar({ primaryAction, secondaryAction, bottomInset, }: {
13
+ export declare function BottomBar({ primaryAction, secondaryAction, bottomInset, split, }: {
14
14
  primaryAction: TemplateAction;
15
15
  secondaryAction?: TemplateAction;
16
16
  bottomInset?: number;
17
+ split?: boolean;
17
18
  }): import("react").JSX.Element;
18
19
  export declare function Notice({ notice }: {
19
20
  notice: TemplateNotice;
@@ -1 +1 @@
1
- {"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../../../src/templates/parts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ3D,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,cAAc,GAAG,OAAO,CAAC;AAExE,MAAM,MAAM,cAAc,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAiDpE,wBAAgB,SAAS,CAAC,EACxB,aAAa,EACb,eAAe,EACf,WAAe,GAChB,EAAE;IACD,aAAa,EAAE,cAAc,CAAC;IAC9B,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,+BA2BA;AAED,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,+BAmB5D;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,KAAK,EACL,IAAI,EACJ,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAgDA"}
1
+ {"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../../../src/templates/parts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ3D,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,cAAc,GAAG,OAAO,CAAC;AAExE,MAAM,MAAM,cAAc,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAyDpE,wBAAgB,SAAS,CAAC,EACxB,aAAa,EACb,eAAe,EACf,WAAe,EACf,KAAa,GACd,EAAE;IACD,aAAa,EAAE,cAAc,CAAC;IAC9B,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,+BA8DA;AAED,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,+BAmB5D;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,KAAK,EACL,IAAI,EACJ,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAgDA"}
@@ -0,0 +1,31 @@
1
+ import type { ComponentRef, ReactNode, Ref } from 'react';
2
+ import { ScrollView, type LayoutChangeEvent } from 'react-native';
3
+ import { type TemplateAction } from './parts.js';
4
+ export type SheetFormTemplateProps = {
5
+ title: string;
6
+ onBack?: () => void;
7
+ backLabel?: string;
8
+ action?: {
9
+ label: string;
10
+ onPress: () => void;
11
+ disabled?: boolean;
12
+ };
13
+ tabs?: ReactNode;
14
+ primaryAction: TemplateAction;
15
+ secondaryAction?: TemplateAction;
16
+ topInset?: number;
17
+ bottomInset?: number;
18
+ scrollRef?: Ref<ComponentRef<typeof ScrollView>>;
19
+ onScrollY?: (y: number) => void;
20
+ children: ReactNode;
21
+ };
22
+ export type SheetBlockProps = {
23
+ title: string;
24
+ aside?: ReactNode;
25
+ lead?: ReactNode;
26
+ onLayout?: (event: LayoutChangeEvent) => void;
27
+ children: ReactNode;
28
+ };
29
+ export declare function SheetBlock({ title, aside, lead, onLayout, children, }: SheetBlockProps): import("react").JSX.Element;
30
+ export declare function SheetFormTemplate({ title, onBack, backLabel, action, tabs, primaryAction, secondaryAction, topInset, bottomInset, scrollRef, onScrollY, children, }: SheetFormTemplateProps): import("react").JSX.Element;
31
+ //# sourceMappingURL=sheet-form-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet-form-template.d.ts","sourceRoot":"","sources":["../../../../src/templates/sheet-form-template.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAEL,UAAU,EAEV,KAAK,iBAAiB,EACvB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,YAAS,CAAC;AAEzD,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACpE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,cAAc,CAAC;IAC9B,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAkDF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE,eAAe,+BAgBjB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,MAAM,EACN,SAAgB,EAChB,MAAM,EACN,IAAI,EACJ,aAAa,EACb,eAAe,EACf,QAAY,EACZ,WAAe,EACf,SAAS,EACT,SAAS,EACT,QAAQ,GACT,EAAE,sBAAsB,+BAkExB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezpg/app-ui",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "React Native UI components for EZPG partner apps",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -0,0 +1,176 @@
1
+ import { useState } from 'react';
2
+ import {
3
+ ActivityIndicator,
4
+ View,
5
+ type StyleProp,
6
+ type ViewStyle,
7
+ } from 'react-native';
8
+ import { Photo } from '../../components/photo/photo';
9
+ import { Text } from '../../components/text/text';
10
+ import { PlusGlyph } from '../../internal/glyphs';
11
+ import { PressableBase } from '../../internal/pressable-base';
12
+ import { useTheme } from '../../theme/theme-provider';
13
+ import { makeStyles } from '../../utils/styles';
14
+
15
+ export type CoverPhoto = {
16
+ id: string;
17
+ uri: string;
18
+ status?: 'uploading' | 'failed';
19
+ };
20
+
21
+ export type CoverPhotosProps = {
22
+ photos: readonly CoverPhoto[];
23
+ max?: number;
24
+ onAdd?: () => void;
25
+ onPress?: (id: string) => void;
26
+ onRetry?: (id: string) => void;
27
+ style?: StyleProp<ViewStyle>;
28
+ };
29
+
30
+ const COLUMNS = 4;
31
+ const ADD = '__add';
32
+
33
+ const useStyles = makeStyles((t) => ({
34
+ top: { flexDirection: 'row', gap: t.space[2] },
35
+ side: { flexDirection: 'row', flexWrap: 'wrap', gap: t.space[2] },
36
+ rest: {
37
+ flexDirection: 'row',
38
+ flexWrap: 'wrap',
39
+ gap: t.space[2],
40
+ marginTop: t.space[2],
41
+ },
42
+ fill: {
43
+ position: 'absolute',
44
+ top: 0,
45
+ right: 0,
46
+ bottom: 0,
47
+ left: 0,
48
+ alignItems: 'center',
49
+ justifyContent: 'center',
50
+ borderRadius: t.radius.md,
51
+ },
52
+ dim: { backgroundColor: `${t.colors.background}B3` },
53
+ failed: { backgroundColor: `${t.colors.background}D9` },
54
+ tag: {
55
+ position: 'absolute',
56
+ top: t.space[2],
57
+ left: t.space[2],
58
+ paddingHorizontal: t.space[2],
59
+ borderRadius: t.radius.full,
60
+ backgroundColor: t.colors.foreground,
61
+ },
62
+ tagText: { color: t.colors.surface },
63
+ add: {
64
+ alignItems: 'center',
65
+ justifyContent: 'center',
66
+ gap: t.space[1],
67
+ borderRadius: t.radius.md,
68
+ borderWidth: 1,
69
+ borderStyle: 'dashed',
70
+ borderColor: t.colors.input,
71
+ },
72
+ }));
73
+
74
+ export function CoverPhotos({
75
+ photos,
76
+ max = 10,
77
+ onAdd,
78
+ onPress,
79
+ onRetry,
80
+ style,
81
+ }: CoverPhotosProps) {
82
+ const t = useTheme();
83
+ const s = useStyles();
84
+ const [width, setWidth] = useState(0);
85
+ const gap = t.space[2];
86
+ const small = width > 0 ? (width - gap * (COLUMNS - 1)) / COLUMNS : 0;
87
+ const big = small * 2 + gap;
88
+ const cells = [
89
+ ...photos.slice(1).map((p) => p.id),
90
+ ...(onAdd && photos.length < max ? [ADD] : []),
91
+ ];
92
+
93
+ const tile = (id: string, size: number) => {
94
+ if (id === ADD) {
95
+ return (
96
+ <PressableBase
97
+ key={ADD}
98
+ accessibilityLabel={`사진 추가, ${max}장 중 ${photos.length}장`}
99
+ onPress={onAdd}
100
+ style={[s.add, { width: size, height: size }]}
101
+ >
102
+ <PlusGlyph color={t.colors.foreground} size={22} />
103
+ <Text variant="caption" tone="muted">
104
+ {photos.length}/{max}
105
+ </Text>
106
+ </PressableBase>
107
+ );
108
+ }
109
+ const index = photos.findIndex((p) => p.id === id);
110
+ const photo = photos[index];
111
+ if (!photo) return null;
112
+ const label = `사진 ${index + 1}${index === 0 ? ', 대표' : ''}`;
113
+ return (
114
+ <PressableBase
115
+ key={photo.id}
116
+ accessibilityLabel={
117
+ photo.status === 'failed' ? `${label}, 업로드 실패, 다시 시도` : label
118
+ }
119
+ disabled={photo.status === 'uploading'}
120
+ onPress={() =>
121
+ photo.status === 'failed' ? onRetry?.(photo.id) : onPress?.(photo.id)
122
+ }
123
+ style={{ width: size, height: size }}
124
+ >
125
+ <Photo
126
+ source={{ uri: photo.uri }}
127
+ radius={t.radius.md}
128
+ style={{ width: size, height: size }}
129
+ />
130
+ {index === 0 && !photo.status ? (
131
+ <View style={s.tag}>
132
+ <Text variant="caption" weight="bold" style={s.tagText}>
133
+ 대표
134
+ </Text>
135
+ </View>
136
+ ) : null}
137
+ {photo.status === 'uploading' ? (
138
+ <View style={[s.fill, s.dim]}>
139
+ <ActivityIndicator color={t.colors.foreground} />
140
+ </View>
141
+ ) : photo.status === 'failed' ? (
142
+ <View style={[s.fill, s.failed]}>
143
+ <Text variant="caption" weight="bold" tone="danger">
144
+ 다시
145
+ </Text>
146
+ </View>
147
+ ) : null}
148
+ </PressableBase>
149
+ );
150
+ };
151
+
152
+ return (
153
+ <View
154
+ style={style}
155
+ onLayout={(event) => setWidth(event.nativeEvent.layout.width)}
156
+ >
157
+ {width > 0 ? (
158
+ <>
159
+ <View style={s.top}>
160
+ {photos[0] ? tile(photos[0].id, big) : tile(ADD, big)}
161
+ <View style={[s.side, { width: big }]}>
162
+ {(photos[0] ? cells : [])
163
+ .slice(0, 4)
164
+ .map((id) => tile(id, small))}
165
+ </View>
166
+ </View>
167
+ {photos[0] && cells.length > 4 ? (
168
+ <View style={s.rest}>
169
+ {cells.slice(4).map((id) => tile(id, small))}
170
+ </View>
171
+ ) : null}
172
+ </>
173
+ ) : null}
174
+ </View>
175
+ );
176
+ }
@@ -0,0 +1,5 @@
1
+ export {
2
+ CoverPhotos,
3
+ type CoverPhoto,
4
+ type CoverPhotosProps,
5
+ } from './cover-photos';
@@ -0,0 +1,34 @@
1
+ import type { ReactNode } from 'react';
2
+ import { View } from 'react-native';
3
+ import { makeStyles } from '../../utils/styles';
4
+
5
+ export type DraftPreviewProps = {
6
+ height: number;
7
+ width: number;
8
+ children: ReactNode;
9
+ };
10
+
11
+ const useStyles = makeStyles((t) => ({
12
+ box: {
13
+ overflow: 'hidden',
14
+ alignItems: 'center',
15
+ paddingTop: t.space[4],
16
+ borderRadius: t.radius.lg,
17
+ backgroundColor: t.colors.muted,
18
+ },
19
+ page: {
20
+ overflow: 'hidden',
21
+ borderTopLeftRadius: t.radius.sm,
22
+ borderTopRightRadius: t.radius.sm,
23
+ backgroundColor: t.colors.surface,
24
+ },
25
+ }));
26
+
27
+ export function DraftPreview({ height, width, children }: DraftPreviewProps) {
28
+ const s = useStyles();
29
+ return (
30
+ <View style={[s.box, { height }]}>
31
+ <View style={[s.page, { width }]}>{children}</View>
32
+ </View>
33
+ );
34
+ }
@@ -49,3 +49,9 @@ export {
49
49
  type TrayPhoto,
50
50
  type TraySource,
51
51
  } from './photo-tray';
52
+ export {
53
+ StructurePicker,
54
+ type StructureOption,
55
+ type StructurePickerProps,
56
+ } from './structure-picker';
57
+ export { DraftPreview, type DraftPreviewProps } from './draft-preview';
@@ -55,7 +55,7 @@ const useStyles = makeStyles((t) => ({
55
55
  },
56
56
  }));
57
57
 
58
- function Diagram({ layout }: { layout: DetailLayout }) {
58
+ export function Diagram({ layout }: { layout: DetailLayout }) {
59
59
  const t = useTheme();
60
60
  const s = useStyles();
61
61
  const photo = <View style={s.photo} />;
@@ -0,0 +1,75 @@
1
+ import { View } from 'react-native';
2
+ import { Text } from '../../components/text/text';
3
+ import { PressableBase } from '../../internal/pressable-base';
4
+ import { makeStyles } from '../../utils/styles';
5
+ import type { DetailLayout } from './detail-types';
6
+ import { Diagram } from './layout-picker';
7
+
8
+ export type StructureOption<T extends string> = {
9
+ value: T;
10
+ label: string;
11
+ layouts: readonly DetailLayout[];
12
+ };
13
+
14
+ export type StructurePickerProps<T extends string> = {
15
+ items: readonly StructureOption<T>[];
16
+ value: T;
17
+ onValueChange: (value: T) => void;
18
+ };
19
+
20
+ const useStyles = makeStyles((t) => ({
21
+ row: { flexDirection: 'row', gap: t.space[3] },
22
+ item: { flex: 1, gap: t.space[2], alignItems: 'center' },
23
+ page: {
24
+ alignSelf: 'stretch',
25
+ aspectRatio: 0.7,
26
+ padding: t.space[2],
27
+ gap: t.space[1],
28
+ borderRadius: t.radius.md,
29
+ borderWidth: 1,
30
+ borderColor: t.colors.border,
31
+ backgroundColor: t.colors.muted,
32
+ },
33
+ on: { borderWidth: 2, borderColor: t.colors.primary },
34
+ part: { flex: 1, gap: t.space[1] },
35
+ }));
36
+
37
+ export function StructurePicker<T extends string>({
38
+ items,
39
+ value,
40
+ onValueChange,
41
+ }: StructurePickerProps<T>) {
42
+ const s = useStyles();
43
+ return (
44
+ <View accessibilityRole="radiogroup" style={s.row}>
45
+ {items.map((item) => {
46
+ const on = item.value === value;
47
+ return (
48
+ <PressableBase
49
+ key={item.value}
50
+ accessibilityRole="radio"
51
+ accessibilityState={{ selected: on }}
52
+ accessibilityLabel={item.label}
53
+ onPress={() => onValueChange(item.value)}
54
+ style={s.item}
55
+ >
56
+ <View style={[s.page, on && s.on]}>
57
+ {item.layouts.map((layout, index) => (
58
+ <View key={`${layout}-${index}`} style={s.part}>
59
+ <Diagram layout={layout} />
60
+ </View>
61
+ ))}
62
+ </View>
63
+ <Text
64
+ variant="caption"
65
+ weight={on ? 'bold' : undefined}
66
+ tone={on ? 'default' : 'muted'}
67
+ >
68
+ {item.label}
69
+ </Text>
70
+ </PressableBase>
71
+ );
72
+ })}
73
+ </View>
74
+ );
75
+ }
@@ -33,6 +33,8 @@ export * from './product-tile';
33
33
  export * from './quick-actions';
34
34
  export * from './action-grid';
35
35
  export * from './site-summary';
36
+ export * from './cover-photos';
37
+ export * from './slider-list';
36
38
  export * from './scan-modal';
37
39
  export * from './summary-cards';
38
40
  export * from './request-card';
@@ -0,0 +1,5 @@
1
+ export {
2
+ SliderList,
3
+ type SliderListItem,
4
+ type SliderListProps,
5
+ } from './slider-list';
@@ -0,0 +1,57 @@
1
+ import { View, type StyleProp, type ViewStyle } from 'react-native';
2
+ import { Divider } from '../../components/divider/divider';
3
+ import { Slider } from '../../components/slider/slider';
4
+ import { Text } from '../../components/text/text';
5
+ import { makeStyles } from '../../utils/styles';
6
+
7
+ export type SliderListItem = {
8
+ key: string;
9
+ label: string;
10
+ startLabel: string;
11
+ endLabel: string;
12
+ };
13
+
14
+ export type SliderListProps = {
15
+ items: readonly SliderListItem[];
16
+ values: Readonly<Record<string, number>>;
17
+ min?: number;
18
+ max?: number;
19
+ onChange: (key: string, value: number) => void;
20
+ style?: StyleProp<ViewStyle>;
21
+ };
22
+
23
+ const useStyles = makeStyles((t) => ({
24
+ row: { paddingTop: t.space[2], gap: t.space[1] },
25
+ }));
26
+
27
+ export function SliderList({
28
+ items,
29
+ values,
30
+ min = 0,
31
+ max = 1,
32
+ onChange,
33
+ style,
34
+ }: SliderListProps) {
35
+ const s = useStyles();
36
+ return (
37
+ <View style={style}>
38
+ {items.map((item) => (
39
+ <View key={item.key}>
40
+ <Divider />
41
+ <View style={s.row}>
42
+ <Text weight="medium">{item.label}</Text>
43
+ <Slider
44
+ value={values[item.key] ?? min}
45
+ min={min}
46
+ max={max}
47
+ onChange={(value) => onChange(item.key, value)}
48
+ startLabel={item.startLabel}
49
+ endLabel={item.endLabel}
50
+ accessibilityLabel={item.label}
51
+ />
52
+ </View>
53
+ </View>
54
+ ))}
55
+ </View>
56
+ );
57
+ }
@@ -1,3 +1,4 @@
1
+ import { useContext } from 'react';
1
2
  import { Text, View } from 'react-native';
2
3
  import { CheckGlyph, ChevronGlyph } from '../../internal/glyphs';
3
4
  import { renderIcon, type IconSlot } from '../../internal/icon';
@@ -8,6 +9,7 @@ import {
8
9
  import { useTheme } from '../../theme/theme-provider';
9
10
  import { makeStyles } from '../../utils/styles';
10
11
  import { Photo } from '../photo/photo';
12
+ import { FlushRowContext } from '../../internal/flush-row';
11
13
 
12
14
  export type ListRowTone = 'muted' | 'warning' | 'danger';
13
15
 
@@ -48,6 +50,7 @@ const useStyles = makeStyles((t) => ({
48
50
  },
49
51
  twoLine: { minHeight: t.listRow.twoLine },
50
52
  threeLine: { minHeight: t.listRow.threeLine },
53
+ flush: { paddingHorizontal: 0 },
51
54
  pressed: { backgroundColor: t.colors.muted },
52
55
  highlighted: { backgroundColor: t.colors.primaryTint },
53
56
  top: { alignItems: 'flex-start' },
@@ -123,6 +126,7 @@ export function ListRow({
123
126
  }: ListRowProps) {
124
127
  const t = useTheme();
125
128
  const s = useStyles();
129
+ const flush = useContext(FlushRowContext);
126
130
  const icon = { color: t.colors.mutedForeground, size: t.iconSize.md };
127
131
  const showChevron = chevron ?? !!onPress;
128
132
  const lines = [overline, description].filter(Boolean).length;
@@ -228,6 +232,7 @@ export function ListRow({
228
232
  <View
229
233
  style={[
230
234
  s.row,
235
+ flush && s.flush,
231
236
  height,
232
237
  meta && s.top,
233
238
  highlighted && s.highlighted,
@@ -246,6 +251,7 @@ export function ListRow({
246
251
  pressedStyle={s.pressed}
247
252
  style={[
248
253
  s.row,
254
+ flush && s.flush,
249
255
  height,
250
256
  meta && s.top,
251
257
  highlighted && s.highlighted,
@@ -0,0 +1,5 @@
1
+ export {
2
+ SectionTabs,
3
+ type SectionTabsItem,
4
+ type SectionTabsProps,
5
+ } from './section-tabs';
@@ -0,0 +1,87 @@
1
+ import { View, type StyleProp, type ViewStyle } from 'react-native';
2
+ import { PressableBase } from '../../internal/pressable-base';
3
+ import { useTheme } from '../../theme/theme-provider';
4
+ import { makeStyles } from '../../utils/styles';
5
+ import { Text } from '../text/text';
6
+
7
+ export type SectionTabsItem<T extends string> = {
8
+ value: T;
9
+ label: string;
10
+ dot?: boolean;
11
+ };
12
+
13
+ export type SectionTabsProps<T extends string> = {
14
+ items: readonly SectionTabsItem<T>[];
15
+ value: T;
16
+ onValueChange: (value: T) => void;
17
+ style?: StyleProp<ViewStyle>;
18
+ };
19
+
20
+ const DOT = 6;
21
+
22
+ const useStyles = makeStyles((t) => ({
23
+ row: {
24
+ flexDirection: 'row',
25
+ paddingHorizontal: t.space[2],
26
+ backgroundColor: t.colors.surface,
27
+ borderBottomWidth: 1,
28
+ borderBottomColor: t.colors.border,
29
+ },
30
+ tab: {
31
+ flex: 1,
32
+ height: t.minTouchSize,
33
+ flexDirection: 'row',
34
+ alignItems: 'center',
35
+ justifyContent: 'center',
36
+ gap: t.space[1],
37
+ borderBottomWidth: 2,
38
+ borderBottomColor: 'transparent',
39
+ },
40
+ selected: { borderBottomColor: t.colors.foreground },
41
+ dot: {
42
+ width: DOT,
43
+ height: DOT,
44
+ borderRadius: t.radius.full,
45
+ backgroundColor: t.colors.danger,
46
+ },
47
+ }));
48
+
49
+ export function SectionTabs<T extends string>({
50
+ items,
51
+ value,
52
+ onValueChange,
53
+ style,
54
+ }: SectionTabsProps<T>) {
55
+ const t = useTheme();
56
+ const s = useStyles();
57
+ return (
58
+ <View accessibilityRole="tablist" style={[s.row, style]}>
59
+ {items.map((item) => {
60
+ const selected = item.value === value;
61
+ return (
62
+ <PressableBase
63
+ key={item.value}
64
+ accessibilityRole="tab"
65
+ accessibilityState={{ selected }}
66
+ accessibilityLabel={
67
+ item.dot ? `${item.label}, 확인 필요` : item.label
68
+ }
69
+ pressedStyle={{}}
70
+ onPress={() => onValueChange(item.value)}
71
+ style={[s.tab, selected && s.selected]}
72
+ >
73
+ <Text
74
+ numberOfLines={1}
75
+ maxFontSizeMultiplier={t.maxFontScale}
76
+ weight={selected ? 'bold' : undefined}
77
+ tone={selected ? undefined : 'muted'}
78
+ >
79
+ {item.label}
80
+ </Text>
81
+ {item.dot ? <View style={s.dot} /> : null}
82
+ </PressableBase>
83
+ );
84
+ })}
85
+ </View>
86
+ );
87
+ }
package/src/index.tsx CHANGED
@@ -75,6 +75,7 @@ export * from './components/progress-circle';
75
75
  export * from './components/result-mark';
76
76
  export * from './components/page-header';
77
77
  export * from './blocks/setup-guide';
78
+ export * from './components/section-tabs';
78
79
  export * from './components/segmented-tabs';
79
80
  export * from './components/sheet';
80
81
  export * from './components/skeleton';
@@ -0,0 +1,3 @@
1
+ import { createContext } from 'react';
2
+
3
+ export const FlushRowContext = createContext(false);
@@ -41,3 +41,8 @@ export type {
41
41
  } from './preview-template';
42
42
  export { SplitPreviewTemplate } from './split-preview-template';
43
43
  export type { SplitPreviewTemplateProps } from './split-preview-template';
44
+ export { SheetBlock, SheetFormTemplate } from './sheet-form-template';
45
+ export type {
46
+ SheetBlockProps,
47
+ SheetFormTemplateProps,
48
+ } from './sheet-form-template';