@ezpg/app-ui 0.0.0-stage → 0.1.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 +7 -0
- package/LICENSE +20 -0
- package/lib/module/blocks/brand-profile-card/brand-profile-card.js +90 -0
- package/lib/module/blocks/brand-profile-card/brand-profile-card.js.map +1 -0
- package/lib/module/blocks/brand-profile-card/index.js +4 -0
- package/lib/module/blocks/brand-profile-card/index.js.map +1 -0
- package/lib/module/blocks/claim-row/claim-row.js +107 -0
- package/lib/module/blocks/claim-row/claim-row.js.map +1 -0
- package/lib/module/blocks/claim-row/index.js +4 -0
- package/lib/module/blocks/claim-row/index.js.map +1 -0
- package/lib/module/blocks/color-swatch-picker/color-swatch-picker.js +124 -0
- package/lib/module/blocks/color-swatch-picker/color-swatch-picker.js.map +1 -0
- package/lib/module/blocks/color-swatch-picker/index.js +4 -0
- package/lib/module/blocks/color-swatch-picker/index.js.map +1 -0
- package/lib/module/blocks/copy-variant-picker/copy-variant-picker.js +142 -0
- package/lib/module/blocks/copy-variant-picker/copy-variant-picker.js.map +1 -0
- package/lib/module/blocks/copy-variant-picker/index.js +4 -0
- package/lib/module/blocks/copy-variant-picker/index.js.map +1 -0
- package/lib/module/blocks/credit-wallet/credit-wallet.js +123 -0
- package/lib/module/blocks/credit-wallet/credit-wallet.js.map +1 -0
- package/lib/module/blocks/credit-wallet/index.js +4 -0
- package/lib/module/blocks/credit-wallet/index.js.map +1 -0
- package/lib/module/blocks/image-grid/image-grid.js +273 -0
- package/lib/module/blocks/image-grid/image-grid.js.map +1 -0
- package/lib/module/blocks/image-grid/index.js +4 -0
- package/lib/module/blocks/image-grid/index.js.map +1 -0
- package/lib/module/blocks/index.js +22 -0
- package/lib/module/blocks/index.js.map +1 -0
- package/lib/module/blocks/internal/card.js +41 -0
- package/lib/module/blocks/internal/card.js.map +1 -0
- package/lib/module/blocks/internal/format.js +25 -0
- package/lib/module/blocks/internal/format.js.map +1 -0
- package/lib/module/blocks/invoice-row/index.js +4 -0
- package/lib/module/blocks/invoice-row/index.js.map +1 -0
- package/lib/module/blocks/invoice-row/invoice-row.js +101 -0
- package/lib/module/blocks/invoice-row/invoice-row.js.map +1 -0
- package/lib/module/blocks/logo-candidate-grid/index.js +4 -0
- package/lib/module/blocks/logo-candidate-grid/index.js.map +1 -0
- package/lib/module/blocks/logo-candidate-grid/logo-candidate-grid.js +117 -0
- package/lib/module/blocks/logo-candidate-grid/logo-candidate-grid.js.map +1 -0
- package/lib/module/blocks/oauth-buttons/index.js +4 -0
- package/lib/module/blocks/oauth-buttons/index.js.map +1 -0
- package/lib/module/blocks/oauth-buttons/oauth-buttons.js +102 -0
- package/lib/module/blocks/oauth-buttons/oauth-buttons.js.map +1 -0
- package/lib/module/blocks/option-editor/index.js +4 -0
- package/lib/module/blocks/option-editor/index.js.map +1 -0
- package/lib/module/blocks/option-editor/option-editor.js +133 -0
- package/lib/module/blocks/option-editor/option-editor.js.map +1 -0
- package/lib/module/blocks/order-card/index.js +4 -0
- package/lib/module/blocks/order-card/index.js.map +1 -0
- package/lib/module/blocks/order-card/order-card.js +156 -0
- package/lib/module/blocks/order-card/order-card.js.map +1 -0
- package/lib/module/blocks/plan-card/index.js +4 -0
- package/lib/module/blocks/plan-card/index.js.map +1 -0
- package/lib/module/blocks/plan-card/plan-card.js +134 -0
- package/lib/module/blocks/plan-card/plan-card.js.map +1 -0
- package/lib/module/blocks/product-list-empty/index.js +4 -0
- package/lib/module/blocks/product-list-empty/index.js.map +1 -0
- package/lib/module/blocks/product-list-empty/product-list-empty.js +155 -0
- package/lib/module/blocks/product-list-empty/product-list-empty.js.map +1 -0
- package/lib/module/blocks/review-row/index.js +4 -0
- package/lib/module/blocks/review-row/index.js.map +1 -0
- package/lib/module/blocks/review-row/review-row.js +284 -0
- package/lib/module/blocks/review-row/review-row.js.map +1 -0
- package/lib/module/blocks/sales-chart/index.js +4 -0
- package/lib/module/blocks/sales-chart/index.js.map +1 -0
- package/lib/module/blocks/sales-chart/sales-chart.js +126 -0
- package/lib/module/blocks/sales-chart/sales-chart.js.map +1 -0
- package/lib/module/blocks/service-state-banner/index.js +4 -0
- package/lib/module/blocks/service-state-banner/index.js.map +1 -0
- package/lib/module/blocks/service-state-banner/service-state-banner.js +64 -0
- package/lib/module/blocks/service-state-banner/service-state-banner.js.map +1 -0
- package/lib/module/blocks/shipping-tracking-row/index.js +4 -0
- package/lib/module/blocks/shipping-tracking-row/index.js.map +1 -0
- package/lib/module/blocks/shipping-tracking-row/shipping-tracking-row.js +116 -0
- package/lib/module/blocks/shipping-tracking-row/shipping-tracking-row.js.map +1 -0
- package/lib/module/blocks/site-preview-frame/index.js +4 -0
- package/lib/module/blocks/site-preview-frame/index.js.map +1 -0
- package/lib/module/blocks/site-preview-frame/site-preview-frame.js +111 -0
- package/lib/module/blocks/site-preview-frame/site-preview-frame.js.map +1 -0
- package/lib/module/blocks/stat-card/index.js +4 -0
- package/lib/module/blocks/stat-card/index.js.map +1 -0
- package/lib/module/blocks/stat-card/stat-card.js +71 -0
- package/lib/module/blocks/stat-card/stat-card.js.map +1 -0
- package/lib/module/blocks/step-screen/index.js +4 -0
- package/lib/module/blocks/step-screen/index.js.map +1 -0
- package/lib/module/blocks/step-screen/step-screen.js +134 -0
- package/lib/module/blocks/step-screen/step-screen.js.map +1 -0
- package/lib/module/blocks/supply-item-card/index.js +4 -0
- package/lib/module/blocks/supply-item-card/index.js.map +1 -0
- package/lib/module/blocks/supply-item-card/supply-item-card.js +151 -0
- package/lib/module/blocks/supply-item-card/supply-item-card.js.map +1 -0
- package/lib/module/charts/index.js +5 -0
- package/lib/module/charts/index.js.map +1 -0
- package/lib/module/charts/line-chart.js +115 -0
- package/lib/module/charts/line-chart.js.map +1 -0
- package/lib/module/charts/scale.js +45 -0
- package/lib/module/charts/scale.js.map +1 -0
- package/lib/module/charts/sparkline.js +50 -0
- package/lib/module/charts/sparkline.js.map +1 -0
- package/lib/module/charts/summary.js +11 -0
- package/lib/module/charts/summary.js.map +1 -0
- package/lib/module/charts.js +5 -0
- package/lib/module/charts.js.map +1 -0
- package/lib/module/components/button/button.js +122 -0
- package/lib/module/components/button/button.js.map +1 -0
- package/lib/module/components/button/index.js +4 -0
- package/lib/module/components/button/index.js.map +1 -0
- package/lib/module/components/checkbox/checkbox.js +72 -0
- package/lib/module/components/checkbox/checkbox.js.map +1 -0
- package/lib/module/components/checkbox/index.js +4 -0
- package/lib/module/components/checkbox/index.js.map +1 -0
- package/lib/module/components/chip/chip.js +68 -0
- package/lib/module/components/chip/chip.js.map +1 -0
- package/lib/module/components/chip/index.js +4 -0
- package/lib/module/components/chip/index.js.map +1 -0
- package/lib/module/components/chip-group/chip-group.js +55 -0
- package/lib/module/components/chip-group/chip-group.js.map +1 -0
- package/lib/module/components/chip-group/index.js +4 -0
- package/lib/module/components/chip-group/index.js.map +1 -0
- package/lib/module/components/dialog/dialog.js +118 -0
- package/lib/module/components/dialog/dialog.js.map +1 -0
- package/lib/module/components/dialog/index.js +4 -0
- package/lib/module/components/dialog/index.js.map +1 -0
- package/lib/module/components/divider/divider.js +21 -0
- package/lib/module/components/divider/divider.js.map +1 -0
- package/lib/module/components/divider/index.js +4 -0
- package/lib/module/components/divider/index.js.map +1 -0
- package/lib/module/components/empty-state/empty-state.js +126 -0
- package/lib/module/components/empty-state/empty-state.js.map +1 -0
- package/lib/module/components/empty-state/index.js +4 -0
- package/lib/module/components/empty-state/index.js.map +1 -0
- package/lib/module/components/field/field.js +123 -0
- package/lib/module/components/field/field.js.map +1 -0
- package/lib/module/components/field/index.js +4 -0
- package/lib/module/components/field/index.js.map +1 -0
- package/lib/module/components/list-row/index.js +4 -0
- package/lib/module/components/list-row/index.js.map +1 -0
- package/lib/module/components/list-row/list-row.js +97 -0
- package/lib/module/components/list-row/list-row.js.map +1 -0
- package/lib/module/components/photo/index.js +4 -0
- package/lib/module/components/photo/index.js.map +1 -0
- package/lib/module/components/photo/photo.js +68 -0
- package/lib/module/components/photo/photo.js.map +1 -0
- package/lib/module/components/price/index.js +4 -0
- package/lib/module/components/price/index.js.map +1 -0
- package/lib/module/components/price/price.js +72 -0
- package/lib/module/components/price/price.js.map +1 -0
- package/lib/module/components/search-field/index.js +4 -0
- package/lib/module/components/search-field/index.js.map +1 -0
- package/lib/module/components/search-field/search-field.js +35 -0
- package/lib/module/components/search-field/search-field.js.map +1 -0
- package/lib/module/components/segmented-tabs/index.js +4 -0
- package/lib/module/components/segmented-tabs/index.js.map +1 -0
- package/lib/module/components/segmented-tabs/segmented-tabs.js +74 -0
- package/lib/module/components/segmented-tabs/segmented-tabs.js.map +1 -0
- package/lib/module/components/sheet/index.js +4 -0
- package/lib/module/components/sheet/index.js.map +1 -0
- package/lib/module/components/sheet/sheet.js +97 -0
- package/lib/module/components/sheet/sheet.js.map +1 -0
- package/lib/module/components/skeleton/index.js +4 -0
- package/lib/module/components/skeleton/index.js.map +1 -0
- package/lib/module/components/skeleton/skeleton.js +49 -0
- package/lib/module/components/skeleton/skeleton.js.map +1 -0
- package/lib/module/components/status-badge/index.js +4 -0
- package/lib/module/components/status-badge/index.js.map +1 -0
- package/lib/module/components/status-badge/status-badge.js +48 -0
- package/lib/module/components/status-badge/status-badge.js.map +1 -0
- package/lib/module/components/switch/index.js +4 -0
- package/lib/module/components/switch/index.js.map +1 -0
- package/lib/module/components/switch/switch.js +26 -0
- package/lib/module/components/switch/switch.js.map +1 -0
- package/lib/module/components/text/index.js +4 -0
- package/lib/module/components/text/index.js.map +1 -0
- package/lib/module/components/text/text.js +56 -0
- package/lib/module/components/text/text.js.map +1 -0
- package/lib/module/components/toast/index.js +4 -0
- package/lib/module/components/toast/index.js.map +1 -0
- package/lib/module/components/toast/toast.js +203 -0
- package/lib/module/components/toast/toast.js.map +1 -0
- package/lib/module/components/wizard-steps/index.js +4 -0
- package/lib/module/components/wizard-steps/index.js.map +1 -0
- package/lib/module/components/wizard-steps/wizard-steps.js +69 -0
- package/lib/module/components/wizard-steps/wizard-steps.js.map +1 -0
- package/lib/module/index.js +31 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/internal/glyphs.js +200 -0
- package/lib/module/internal/glyphs.js.map +1 -0
- package/lib/module/internal/icon.js +8 -0
- package/lib/module/internal/icon.js.map +1 -0
- package/lib/module/internal/overlay.js +60 -0
- package/lib/module/internal/overlay.js.map +1 -0
- package/lib/module/internal/pressable-base.js +40 -0
- package/lib/module/internal/pressable-base.js.map +1 -0
- package/lib/module/internal/use-reduced-motion.js +31 -0
- package/lib/module/internal/use-reduced-motion.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/sortable/index.js +6 -0
- package/lib/module/sortable/index.js.map +1 -0
- package/lib/module/sortable/move.js +11 -0
- package/lib/module/sortable/move.js.map +1 -0
- package/lib/module/sortable/sortable-grid.js +86 -0
- package/lib/module/sortable/sortable-grid.js.map +1 -0
- package/lib/module/sortable/sortable-list.js +16 -0
- package/lib/module/sortable/sortable-list.js.map +1 -0
- package/lib/module/sortable.js +6 -0
- package/lib/module/sortable.js.map +1 -0
- package/lib/module/theme/create-theme.js +56 -0
- package/lib/module/theme/create-theme.js.map +1 -0
- package/lib/module/theme/theme-provider.js +26 -0
- package/lib/module/theme/theme-provider.js.map +1 -0
- package/lib/module/theme/tokens.js +123 -0
- package/lib/module/theme/tokens.js.map +1 -0
- package/lib/module/types/index.js +4 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/utils/color.js +30 -0
- package/lib/module/utils/color.js.map +1 -0
- package/lib/module/utils/styles.js +22 -0
- package/lib/module/utils/styles.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/blocks/brand-profile-card/brand-profile-card.d.ts +15 -0
- package/lib/typescript/src/blocks/brand-profile-card/brand-profile-card.d.ts.map +1 -0
- package/lib/typescript/src/blocks/brand-profile-card/index.d.ts +2 -0
- package/lib/typescript/src/blocks/brand-profile-card/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/claim-row/claim-row.d.ts +22 -0
- package/lib/typescript/src/blocks/claim-row/claim-row.d.ts.map +1 -0
- package/lib/typescript/src/blocks/claim-row/index.d.ts +2 -0
- package/lib/typescript/src/blocks/claim-row/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/color-swatch-picker/color-swatch-picker.d.ts +16 -0
- package/lib/typescript/src/blocks/color-swatch-picker/color-swatch-picker.d.ts.map +1 -0
- package/lib/typescript/src/blocks/color-swatch-picker/index.d.ts +2 -0
- package/lib/typescript/src/blocks/color-swatch-picker/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/copy-variant-picker/copy-variant-picker.d.ts +22 -0
- package/lib/typescript/src/blocks/copy-variant-picker/copy-variant-picker.d.ts.map +1 -0
- package/lib/typescript/src/blocks/copy-variant-picker/index.d.ts +2 -0
- package/lib/typescript/src/blocks/copy-variant-picker/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/credit-wallet/credit-wallet.d.ts +14 -0
- package/lib/typescript/src/blocks/credit-wallet/credit-wallet.d.ts.map +1 -0
- package/lib/typescript/src/blocks/credit-wallet/index.d.ts +2 -0
- package/lib/typescript/src/blocks/credit-wallet/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/image-grid/image-grid.d.ts +24 -0
- package/lib/typescript/src/blocks/image-grid/image-grid.d.ts.map +1 -0
- package/lib/typescript/src/blocks/image-grid/index.d.ts +2 -0
- package/lib/typescript/src/blocks/image-grid/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/index.d.ts +20 -0
- package/lib/typescript/src/blocks/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/internal/card.d.ts +10 -0
- package/lib/typescript/src/blocks/internal/card.d.ts.map +1 -0
- package/lib/typescript/src/blocks/internal/format.d.ts +7 -0
- package/lib/typescript/src/blocks/internal/format.d.ts.map +1 -0
- package/lib/typescript/src/blocks/invoice-row/index.d.ts +2 -0
- package/lib/typescript/src/blocks/invoice-row/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/invoice-row/invoice-row.d.ts +22 -0
- package/lib/typescript/src/blocks/invoice-row/invoice-row.d.ts.map +1 -0
- package/lib/typescript/src/blocks/logo-candidate-grid/index.d.ts +2 -0
- package/lib/typescript/src/blocks/logo-candidate-grid/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/logo-candidate-grid/logo-candidate-grid.d.ts +17 -0
- package/lib/typescript/src/blocks/logo-candidate-grid/logo-candidate-grid.d.ts.map +1 -0
- package/lib/typescript/src/blocks/oauth-buttons/index.d.ts +2 -0
- package/lib/typescript/src/blocks/oauth-buttons/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/oauth-buttons/oauth-buttons.d.ts +20 -0
- package/lib/typescript/src/blocks/oauth-buttons/oauth-buttons.d.ts.map +1 -0
- package/lib/typescript/src/blocks/option-editor/index.d.ts +2 -0
- package/lib/typescript/src/blocks/option-editor/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/option-editor/option-editor.d.ts +20 -0
- package/lib/typescript/src/blocks/option-editor/option-editor.d.ts.map +1 -0
- package/lib/typescript/src/blocks/order-card/index.d.ts +2 -0
- package/lib/typescript/src/blocks/order-card/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/order-card/order-card.d.ts +44 -0
- package/lib/typescript/src/blocks/order-card/order-card.d.ts.map +1 -0
- package/lib/typescript/src/blocks/plan-card/index.d.ts +2 -0
- package/lib/typescript/src/blocks/plan-card/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/plan-card/plan-card.d.ts +36 -0
- package/lib/typescript/src/blocks/plan-card/plan-card.d.ts.map +1 -0
- package/lib/typescript/src/blocks/product-list-empty/index.d.ts +2 -0
- package/lib/typescript/src/blocks/product-list-empty/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/product-list-empty/product-list-empty.d.ts +21 -0
- package/lib/typescript/src/blocks/product-list-empty/product-list-empty.d.ts.map +1 -0
- package/lib/typescript/src/blocks/review-row/index.d.ts +2 -0
- package/lib/typescript/src/blocks/review-row/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/review-row/review-row.d.ts +34 -0
- package/lib/typescript/src/blocks/review-row/review-row.d.ts.map +1 -0
- package/lib/typescript/src/blocks/sales-chart/index.d.ts +2 -0
- package/lib/typescript/src/blocks/sales-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/sales-chart/sales-chart.d.ts +20 -0
- package/lib/typescript/src/blocks/sales-chart/sales-chart.d.ts.map +1 -0
- package/lib/typescript/src/blocks/service-state-banner/index.d.ts +2 -0
- package/lib/typescript/src/blocks/service-state-banner/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/service-state-banner/service-state-banner.d.ts +13 -0
- package/lib/typescript/src/blocks/service-state-banner/service-state-banner.d.ts.map +1 -0
- package/lib/typescript/src/blocks/shipping-tracking-row/index.d.ts +2 -0
- package/lib/typescript/src/blocks/shipping-tracking-row/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/shipping-tracking-row/shipping-tracking-row.d.ts +12 -0
- package/lib/typescript/src/blocks/shipping-tracking-row/shipping-tracking-row.d.ts.map +1 -0
- package/lib/typescript/src/blocks/site-preview-frame/index.d.ts +2 -0
- package/lib/typescript/src/blocks/site-preview-frame/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/site-preview-frame/site-preview-frame.d.ts +18 -0
- package/lib/typescript/src/blocks/site-preview-frame/site-preview-frame.d.ts.map +1 -0
- package/lib/typescript/src/blocks/stat-card/index.d.ts +2 -0
- package/lib/typescript/src/blocks/stat-card/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/stat-card/stat-card.d.ts +17 -0
- package/lib/typescript/src/blocks/stat-card/stat-card.d.ts.map +1 -0
- package/lib/typescript/src/blocks/step-screen/index.d.ts +2 -0
- package/lib/typescript/src/blocks/step-screen/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/step-screen/step-screen.d.ts +26 -0
- package/lib/typescript/src/blocks/step-screen/step-screen.d.ts.map +1 -0
- package/lib/typescript/src/blocks/supply-item-card/index.d.ts +2 -0
- package/lib/typescript/src/blocks/supply-item-card/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/supply-item-card/supply-item-card.d.ts +30 -0
- package/lib/typescript/src/blocks/supply-item-card/supply-item-card.d.ts.map +1 -0
- package/lib/typescript/src/charts/index.d.ts +3 -0
- package/lib/typescript/src/charts/index.d.ts.map +1 -0
- package/lib/typescript/src/charts/line-chart.d.ts +21 -0
- package/lib/typescript/src/charts/line-chart.d.ts.map +1 -0
- package/lib/typescript/src/charts/scale.d.ts +13 -0
- package/lib/typescript/src/charts/scale.d.ts.map +1 -0
- package/lib/typescript/src/charts/sparkline.d.ts +15 -0
- package/lib/typescript/src/charts/sparkline.d.ts.map +1 -0
- package/lib/typescript/src/charts/summary.d.ts +3 -0
- package/lib/typescript/src/charts/summary.d.ts.map +1 -0
- package/lib/typescript/src/charts.d.ts +3 -0
- package/lib/typescript/src/charts.d.ts.map +1 -0
- package/lib/typescript/src/components/button/button.d.ts +18 -0
- package/lib/typescript/src/components/button/button.d.ts.map +1 -0
- package/lib/typescript/src/components/button/index.d.ts +2 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -0
- package/lib/typescript/src/components/checkbox/checkbox.d.ts +8 -0
- package/lib/typescript/src/components/checkbox/checkbox.d.ts.map +1 -0
- package/lib/typescript/src/components/checkbox/index.d.ts +2 -0
- package/lib/typescript/src/components/checkbox/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/chip.d.ts +9 -0
- package/lib/typescript/src/components/chip/chip.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/index.d.ts +2 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip-group/chip-group.d.ts +27 -0
- package/lib/typescript/src/components/chip-group/chip-group.d.ts.map +1 -0
- package/lib/typescript/src/components/chip-group/index.d.ts +2 -0
- package/lib/typescript/src/components/chip-group/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/dialog.d.ts +20 -0
- package/lib/typescript/src/components/dialog/dialog.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/index.d.ts +2 -0
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -0
- package/lib/typescript/src/components/divider/divider.d.ts +9 -0
- package/lib/typescript/src/components/divider/divider.d.ts.map +1 -0
- package/lib/typescript/src/components/divider/index.d.ts +2 -0
- package/lib/typescript/src/components/divider/index.d.ts.map +1 -0
- package/lib/typescript/src/components/empty-state/empty-state.d.ts +26 -0
- package/lib/typescript/src/components/empty-state/empty-state.d.ts.map +1 -0
- package/lib/typescript/src/components/empty-state/index.d.ts +2 -0
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -0
- package/lib/typescript/src/components/field/field.d.ts +15 -0
- package/lib/typescript/src/components/field/field.d.ts.map +1 -0
- package/lib/typescript/src/components/field/index.d.ts +2 -0
- package/lib/typescript/src/components/field/index.d.ts.map +1 -0
- package/lib/typescript/src/components/list-row/index.d.ts +2 -0
- package/lib/typescript/src/components/list-row/index.d.ts.map +1 -0
- package/lib/typescript/src/components/list-row/list-row.d.ts +15 -0
- package/lib/typescript/src/components/list-row/list-row.d.ts.map +1 -0
- package/lib/typescript/src/components/photo/index.d.ts +2 -0
- package/lib/typescript/src/components/photo/index.d.ts.map +1 -0
- package/lib/typescript/src/components/photo/photo.d.ts +15 -0
- package/lib/typescript/src/components/photo/photo.d.ts.map +1 -0
- package/lib/typescript/src/components/price/index.d.ts +2 -0
- package/lib/typescript/src/components/price/index.d.ts.map +1 -0
- package/lib/typescript/src/components/price/price.d.ts +15 -0
- package/lib/typescript/src/components/price/price.d.ts.map +1 -0
- package/lib/typescript/src/components/search-field/index.d.ts +2 -0
- package/lib/typescript/src/components/search-field/index.d.ts.map +1 -0
- package/lib/typescript/src/components/search-field/search-field.d.ts +9 -0
- package/lib/typescript/src/components/search-field/search-field.d.ts.map +1 -0
- package/lib/typescript/src/components/segmented-tabs/index.d.ts +2 -0
- package/lib/typescript/src/components/segmented-tabs/index.d.ts.map +1 -0
- package/lib/typescript/src/components/segmented-tabs/segmented-tabs.d.ts +14 -0
- package/lib/typescript/src/components/segmented-tabs/segmented-tabs.d.ts.map +1 -0
- package/lib/typescript/src/components/sheet/index.d.ts +2 -0
- package/lib/typescript/src/components/sheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/sheet/sheet.d.ts +17 -0
- package/lib/typescript/src/components/sheet/sheet.d.ts.map +1 -0
- package/lib/typescript/src/components/skeleton/index.d.ts +2 -0
- package/lib/typescript/src/components/skeleton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/skeleton/skeleton.d.ts +13 -0
- package/lib/typescript/src/components/skeleton/skeleton.d.ts.map +1 -0
- package/lib/typescript/src/components/status-badge/index.d.ts +2 -0
- package/lib/typescript/src/components/status-badge/index.d.ts.map +1 -0
- package/lib/typescript/src/components/status-badge/status-badge.d.ts +10 -0
- package/lib/typescript/src/components/status-badge/status-badge.d.ts.map +1 -0
- package/lib/typescript/src/components/switch/index.d.ts +2 -0
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -0
- package/lib/typescript/src/components/switch/switch.d.ts +9 -0
- package/lib/typescript/src/components/switch/switch.d.ts.map +1 -0
- package/lib/typescript/src/components/text/index.d.ts +2 -0
- package/lib/typescript/src/components/text/index.d.ts.map +1 -0
- package/lib/typescript/src/components/text/text.d.ts +16 -0
- package/lib/typescript/src/components/text/text.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/index.d.ts +2 -0
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/toast.d.ts +30 -0
- package/lib/typescript/src/components/toast/toast.d.ts.map +1 -0
- package/lib/typescript/src/components/wizard-steps/index.d.ts +2 -0
- package/lib/typescript/src/components/wizard-steps/index.d.ts.map +1 -0
- package/lib/typescript/src/components/wizard-steps/wizard-steps.d.ts +11 -0
- package/lib/typescript/src/components/wizard-steps/wizard-steps.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +31 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/internal/glyphs.d.ts +12 -0
- package/lib/typescript/src/internal/glyphs.d.ts.map +1 -0
- package/lib/typescript/src/internal/icon.d.ts +9 -0
- package/lib/typescript/src/internal/icon.d.ts.map +1 -0
- package/lib/typescript/src/internal/overlay.d.ts +16 -0
- package/lib/typescript/src/internal/overlay.d.ts.map +1 -0
- package/lib/typescript/src/internal/pressable-base.d.ts +13 -0
- package/lib/typescript/src/internal/pressable-base.d.ts.map +1 -0
- package/lib/typescript/src/internal/use-reduced-motion.d.ts +3 -0
- package/lib/typescript/src/internal/use-reduced-motion.d.ts.map +1 -0
- package/lib/typescript/src/sortable/index.d.ts +4 -0
- package/lib/typescript/src/sortable/index.d.ts.map +1 -0
- package/lib/typescript/src/sortable/move.d.ts +3 -0
- package/lib/typescript/src/sortable/move.d.ts.map +1 -0
- package/lib/typescript/src/sortable/sortable-grid.d.ts +37 -0
- package/lib/typescript/src/sortable/sortable-grid.d.ts.map +1 -0
- package/lib/typescript/src/sortable/sortable-list.d.ts +5 -0
- package/lib/typescript/src/sortable/sortable-list.d.ts.map +1 -0
- package/lib/typescript/src/sortable.d.ts +4 -0
- package/lib/typescript/src/sortable.d.ts.map +1 -0
- package/lib/typescript/src/theme/create-theme.d.ts +8 -0
- package/lib/typescript/src/theme/create-theme.d.ts.map +1 -0
- package/lib/typescript/src/theme/theme-provider.d.ts +13 -0
- package/lib/typescript/src/theme/theme-provider.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens.d.ts +4 -0
- package/lib/typescript/src/theme/tokens.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +90 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/color.d.ts +5 -0
- package/lib/typescript/src/utils/color.d.ts.map +1 -0
- package/lib/typescript/src/utils/styles.d.ts +13 -0
- package/lib/typescript/src/utils/styles.d.ts.map +1 -0
- package/package.json +109 -3
- package/src/blocks/brand-profile-card/brand-profile-card.tsx +87 -0
- package/src/blocks/brand-profile-card/index.ts +4 -0
- package/src/blocks/claim-row/claim-row.tsx +112 -0
- package/src/blocks/claim-row/index.ts +6 -0
- package/src/blocks/color-swatch-picker/color-swatch-picker.tsx +119 -0
- package/src/blocks/color-swatch-picker/index.ts +5 -0
- package/src/blocks/copy-variant-picker/copy-variant-picker.tsx +140 -0
- package/src/blocks/copy-variant-picker/index.ts +5 -0
- package/src/blocks/credit-wallet/credit-wallet.tsx +105 -0
- package/src/blocks/credit-wallet/index.ts +1 -0
- package/src/blocks/image-grid/image-grid.tsx +279 -0
- package/src/blocks/image-grid/index.ts +1 -0
- package/src/blocks/index.tsx +19 -0
- package/src/blocks/internal/card.tsx +42 -0
- package/src/blocks/internal/format.ts +22 -0
- package/src/blocks/invoice-row/index.ts +5 -0
- package/src/blocks/invoice-row/invoice-row.tsx +122 -0
- package/src/blocks/logo-candidate-grid/index.ts +5 -0
- package/src/blocks/logo-candidate-grid/logo-candidate-grid.tsx +129 -0
- package/src/blocks/oauth-buttons/index.ts +5 -0
- package/src/blocks/oauth-buttons/oauth-buttons.tsx +109 -0
- package/src/blocks/option-editor/index.ts +5 -0
- package/src/blocks/option-editor/option-editor.tsx +135 -0
- package/src/blocks/order-card/index.ts +11 -0
- package/src/blocks/order-card/order-card.tsx +184 -0
- package/src/blocks/plan-card/index.ts +1 -0
- package/src/blocks/plan-card/plan-card.tsx +147 -0
- package/src/blocks/product-list-empty/index.ts +5 -0
- package/src/blocks/product-list-empty/product-list-empty.tsx +144 -0
- package/src/blocks/review-row/index.ts +8 -0
- package/src/blocks/review-row/review-row.tsx +256 -0
- package/src/blocks/sales-chart/index.ts +5 -0
- package/src/blocks/sales-chart/sales-chart.tsx +120 -0
- package/src/blocks/service-state-banner/index.ts +5 -0
- package/src/blocks/service-state-banner/service-state-banner.tsx +66 -0
- package/src/blocks/shipping-tracking-row/index.ts +5 -0
- package/src/blocks/shipping-tracking-row/shipping-tracking-row.tsx +93 -0
- package/src/blocks/site-preview-frame/index.ts +5 -0
- package/src/blocks/site-preview-frame/site-preview-frame.tsx +121 -0
- package/src/blocks/stat-card/index.ts +1 -0
- package/src/blocks/stat-card/stat-card.tsx +77 -0
- package/src/blocks/step-screen/index.ts +5 -0
- package/src/blocks/step-screen/step-screen.tsx +137 -0
- package/src/blocks/supply-item-card/index.ts +6 -0
- package/src/blocks/supply-item-card/supply-item-card.tsx +145 -0
- package/src/charts/index.ts +2 -0
- package/src/charts/line-chart.tsx +177 -0
- package/src/charts/scale.ts +49 -0
- package/src/charts/sparkline.tsx +64 -0
- package/src/charts/summary.ts +11 -0
- package/src/charts.tsx +2 -0
- package/src/components/button/button.tsx +119 -0
- package/src/components/button/index.ts +6 -0
- package/src/components/checkbox/checkbox.tsx +79 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/chip/chip.tsx +73 -0
- package/src/components/chip/index.ts +1 -0
- package/src/components/chip-group/chip-group.tsx +86 -0
- package/src/components/chip-group/index.ts +5 -0
- package/src/components/dialog/dialog.tsx +131 -0
- package/src/components/dialog/index.ts +1 -0
- package/src/components/divider/divider.tsx +26 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/empty-state/empty-state.tsx +152 -0
- package/src/components/empty-state/index.ts +5 -0
- package/src/components/field/field.tsx +151 -0
- package/src/components/field/index.ts +1 -0
- package/src/components/list-row/index.ts +1 -0
- package/src/components/list-row/list-row.tsx +115 -0
- package/src/components/photo/index.ts +1 -0
- package/src/components/photo/photo.tsx +87 -0
- package/src/components/price/index.ts +1 -0
- package/src/components/price/price.tsx +84 -0
- package/src/components/search-field/index.ts +1 -0
- package/src/components/search-field/search-field.tsx +46 -0
- package/src/components/segmented-tabs/index.ts +5 -0
- package/src/components/segmented-tabs/segmented-tabs.tsx +81 -0
- package/src/components/sheet/index.ts +1 -0
- package/src/components/sheet/sheet.tsx +121 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/skeleton/skeleton.tsx +73 -0
- package/src/components/status-badge/index.ts +5 -0
- package/src/components/status-badge/status-badge.tsx +54 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/switch/switch.tsx +26 -0
- package/src/components/text/index.ts +1 -0
- package/src/components/text/text.tsx +54 -0
- package/src/components/toast/index.ts +9 -0
- package/src/components/toast/toast.tsx +248 -0
- package/src/components/wizard-steps/index.ts +1 -0
- package/src/components/wizard-steps/wizard-steps.tsx +54 -0
- package/src/index.tsx +56 -0
- package/src/internal/glyphs.tsx +158 -0
- package/src/internal/icon.tsx +10 -0
- package/src/internal/overlay.tsx +59 -0
- package/src/internal/pressable-base.tsx +55 -0
- package/src/internal/use-reduced-motion.ts +32 -0
- package/src/sortable/index.ts +8 -0
- package/src/sortable/move.ts +19 -0
- package/src/sortable/sortable-grid.tsx +97 -0
- package/src/sortable/sortable-list.tsx +11 -0
- package/src/sortable.tsx +3 -0
- package/src/theme/create-theme.ts +67 -0
- package/src/theme/theme-provider.tsx +37 -0
- package/src/theme/tokens.ts +91 -0
- package/src/types/index.ts +80 -0
- package/src/utils/color.ts +47 -0
- package/src/utils/styles.ts +30 -0
- package/README.md +0 -3
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ActivityIndicator,
|
|
4
|
+
Platform,
|
|
5
|
+
Text,
|
|
6
|
+
View,
|
|
7
|
+
type StyleProp,
|
|
8
|
+
type ViewStyle,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
import { PressableBase } from '../../internal/pressable-base';
|
|
11
|
+
import { makeStyles } from '../../utils/styles';
|
|
12
|
+
|
|
13
|
+
export type OAuthProvider = 'kakao' | 'naver' | 'google' | 'apple';
|
|
14
|
+
|
|
15
|
+
export type OAuthButtonsProps = {
|
|
16
|
+
providers: readonly OAuthProvider[];
|
|
17
|
+
onPress: (provider: OAuthProvider) => void;
|
|
18
|
+
/**
|
|
19
|
+
* 각 사 공식 로고. 로고는 상표라 패키지에 넣지 않는다.
|
|
20
|
+
* 각 사 브랜드 가이드의 에셋을 앱에서 넘긴다.
|
|
21
|
+
*/
|
|
22
|
+
icons?: Partial<Record<OAuthProvider, ReactNode>>;
|
|
23
|
+
/** 진행 중인 공급자 */
|
|
24
|
+
loading?: OAuthProvider | null;
|
|
25
|
+
/** 문구 바꾸기 */
|
|
26
|
+
labels?: Partial<Record<OAuthProvider, string>>;
|
|
27
|
+
style?: StyleProp<ViewStyle>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// 각 사 브랜드 가이드의 지정 색. 테마 토큰을 따르지 않는다.
|
|
31
|
+
const BRAND: Record<
|
|
32
|
+
OAuthProvider,
|
|
33
|
+
{ bg: string; fg: string; border?: string; label: string }
|
|
34
|
+
> = {
|
|
35
|
+
kakao: { bg: '#FEE500', fg: 'rgba(0, 0, 0, 0.85)', label: '카카오 로그인' },
|
|
36
|
+
naver: { bg: '#03C75A', fg: '#FFFFFF', label: '네이버 로그인' },
|
|
37
|
+
google: {
|
|
38
|
+
bg: '#FFFFFF',
|
|
39
|
+
fg: '#1F1F1F',
|
|
40
|
+
border: '#747775',
|
|
41
|
+
label: 'Google 계정으로 로그인',
|
|
42
|
+
},
|
|
43
|
+
apple: { bg: '#000000', fg: '#FFFFFF', label: 'Apple로 로그인' },
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const HEIGHT = 48;
|
|
47
|
+
|
|
48
|
+
const useStyles = makeStyles((t) => ({
|
|
49
|
+
root: { gap: t.space[2] },
|
|
50
|
+
button: {
|
|
51
|
+
height: HEIGHT,
|
|
52
|
+
flexDirection: 'row',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
justifyContent: 'center',
|
|
55
|
+
gap: t.space[2],
|
|
56
|
+
paddingHorizontal: t.space[4],
|
|
57
|
+
borderRadius: 12,
|
|
58
|
+
borderWidth: 1,
|
|
59
|
+
borderColor: 'transparent',
|
|
60
|
+
},
|
|
61
|
+
icon: { position: 'absolute', left: t.space[4] },
|
|
62
|
+
label: { fontSize: 15, fontWeight: '600', fontFamily: t.fontFamily },
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
/** 소셜 로그인 버튼 묶음. Apple은 iOS에서만 보인다 */
|
|
66
|
+
export function OAuthButtons({
|
|
67
|
+
providers,
|
|
68
|
+
onPress,
|
|
69
|
+
icons = {},
|
|
70
|
+
loading = null,
|
|
71
|
+
labels = {},
|
|
72
|
+
style,
|
|
73
|
+
}: OAuthButtonsProps) {
|
|
74
|
+
const s = useStyles();
|
|
75
|
+
const shown = providers.filter((p) => p !== 'apple' || Platform.OS === 'ios');
|
|
76
|
+
return (
|
|
77
|
+
<View style={[s.root, style]}>
|
|
78
|
+
{shown.map((p) => {
|
|
79
|
+
const brand = BRAND[p];
|
|
80
|
+
const label = labels[p] ?? brand.label;
|
|
81
|
+
return (
|
|
82
|
+
<PressableBase
|
|
83
|
+
key={p}
|
|
84
|
+
accessibilityLabel={label}
|
|
85
|
+
disabled={loading !== null}
|
|
86
|
+
accessibilityState={{ busy: loading === p }}
|
|
87
|
+
onPress={() => onPress(p)}
|
|
88
|
+
style={[
|
|
89
|
+
s.button,
|
|
90
|
+
{
|
|
91
|
+
backgroundColor: brand.bg,
|
|
92
|
+
borderColor: brand.border ?? brand.bg,
|
|
93
|
+
},
|
|
94
|
+
]}
|
|
95
|
+
>
|
|
96
|
+
{icons[p] ? <View style={s.icon}>{icons[p]}</View> : null}
|
|
97
|
+
{loading === p ? (
|
|
98
|
+
<ActivityIndicator size="small" color={brand.fg} />
|
|
99
|
+
) : (
|
|
100
|
+
<Text numberOfLines={1} style={[s.label, { color: brand.fg }]}>
|
|
101
|
+
{label}
|
|
102
|
+
</Text>
|
|
103
|
+
)}
|
|
104
|
+
</PressableBase>
|
|
105
|
+
);
|
|
106
|
+
})}
|
|
107
|
+
</View>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { View, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { Button } from '../../components/button/button';
|
|
3
|
+
import { formatPrice } from '../../components/price/price';
|
|
4
|
+
import { Switch } from '../../components/switch/switch';
|
|
5
|
+
import { Text } from '../../components/text/text';
|
|
6
|
+
import { PressableBase } from '../../internal/pressable-base';
|
|
7
|
+
import { makeStyles } from '../../utils/styles';
|
|
8
|
+
import { SortableHandle } from '../../sortable/sortable-grid';
|
|
9
|
+
import { SortableList } from '../../sortable/sortable-list';
|
|
10
|
+
|
|
11
|
+
export type ProductOption = {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
/** 기본 가격에 더하는 금액 */
|
|
15
|
+
priceDelta: number;
|
|
16
|
+
/** false면 판매 중지(품절) */
|
|
17
|
+
active: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type OptionEditorProps = {
|
|
21
|
+
options: readonly ProductOption[];
|
|
22
|
+
onOptionsChange: (options: ProductOption[]) => void;
|
|
23
|
+
/** 옵션 눌러 수정 (앱에서 Sheet 등으로) */
|
|
24
|
+
onEdit?: (id: string) => void;
|
|
25
|
+
onAdd?: () => void;
|
|
26
|
+
style?: StyleProp<ViewStyle>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const useStyles = makeStyles((t) => ({
|
|
30
|
+
root: { gap: t.space[2] },
|
|
31
|
+
list: {
|
|
32
|
+
borderWidth: 1,
|
|
33
|
+
borderColor: t.colors.border,
|
|
34
|
+
borderRadius: t.radius.lg,
|
|
35
|
+
overflow: 'hidden',
|
|
36
|
+
},
|
|
37
|
+
row: {
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
gap: t.space[3],
|
|
41
|
+
minHeight: Math.max(t.minTouchSize, 56),
|
|
42
|
+
paddingHorizontal: t.space[4],
|
|
43
|
+
backgroundColor: t.colors.background,
|
|
44
|
+
},
|
|
45
|
+
separator: { borderTopWidth: 1, borderTopColor: t.colors.border },
|
|
46
|
+
pressed: { backgroundColor: t.colors.muted },
|
|
47
|
+
name: { flex: 1 },
|
|
48
|
+
price: { fontVariant: ['tabular-nums'] },
|
|
49
|
+
grip: {
|
|
50
|
+
width: 20,
|
|
51
|
+
height: t.minTouchSize,
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
gap: 4,
|
|
54
|
+
},
|
|
55
|
+
bar: {
|
|
56
|
+
height: 2,
|
|
57
|
+
marginHorizontal: 3,
|
|
58
|
+
borderRadius: 1,
|
|
59
|
+
backgroundColor: t.colors.mutedForeground,
|
|
60
|
+
},
|
|
61
|
+
}));
|
|
62
|
+
|
|
63
|
+
/** 상품 옵션(1단) 목록. 손잡이로 순서를 바꾼다. 앱 최상단이 GestureHandlerRootView로 감싸져 있어야 한다 */
|
|
64
|
+
export function OptionEditor({
|
|
65
|
+
options,
|
|
66
|
+
onOptionsChange,
|
|
67
|
+
onEdit,
|
|
68
|
+
onAdd,
|
|
69
|
+
style,
|
|
70
|
+
}: OptionEditorProps) {
|
|
71
|
+
const s = useStyles();
|
|
72
|
+
const setActive = (id: string, active: boolean) =>
|
|
73
|
+
onOptionsChange(options.map((o) => (o.id === id ? { ...o, active } : o)));
|
|
74
|
+
return (
|
|
75
|
+
<View style={[s.root, style]}>
|
|
76
|
+
<View style={s.list}>
|
|
77
|
+
<SortableList
|
|
78
|
+
data={options}
|
|
79
|
+
keyExtractor={(o) => o.id}
|
|
80
|
+
onDataChange={onOptionsChange}
|
|
81
|
+
handle
|
|
82
|
+
gap={0}
|
|
83
|
+
itemLabel={(o) => o.name}
|
|
84
|
+
renderItem={({ item, index }) => {
|
|
85
|
+
const tone = item.active ? 'default' : 'muted';
|
|
86
|
+
const rowStyle = [s.row, index > 0 && s.separator];
|
|
87
|
+
const content = (
|
|
88
|
+
<>
|
|
89
|
+
<SortableHandle>
|
|
90
|
+
<View
|
|
91
|
+
style={s.grip}
|
|
92
|
+
accessibilityRole="image"
|
|
93
|
+
accessibilityLabel="순서 변경"
|
|
94
|
+
>
|
|
95
|
+
<View style={s.bar} />
|
|
96
|
+
<View style={s.bar} />
|
|
97
|
+
</View>
|
|
98
|
+
</SortableHandle>
|
|
99
|
+
<Text tone={tone} style={s.name} numberOfLines={1}>
|
|
100
|
+
{item.name}
|
|
101
|
+
</Text>
|
|
102
|
+
{item.priceDelta ? (
|
|
103
|
+
<Text tone={tone} style={s.price}>
|
|
104
|
+
+{formatPrice(item.priceDelta)}
|
|
105
|
+
</Text>
|
|
106
|
+
) : null}
|
|
107
|
+
<Switch
|
|
108
|
+
value={item.active}
|
|
109
|
+
onValueChange={(v) => setActive(item.id, v)}
|
|
110
|
+
accessibilityLabel={`${item.name} 판매`}
|
|
111
|
+
/>
|
|
112
|
+
</>
|
|
113
|
+
);
|
|
114
|
+
return onEdit ? (
|
|
115
|
+
<PressableBase
|
|
116
|
+
onPress={() => onEdit(item.id)}
|
|
117
|
+
pressedStyle={s.pressed}
|
|
118
|
+
style={rowStyle}
|
|
119
|
+
>
|
|
120
|
+
{content}
|
|
121
|
+
</PressableBase>
|
|
122
|
+
) : (
|
|
123
|
+
<View style={rowStyle}>{content}</View>
|
|
124
|
+
);
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
</View>
|
|
128
|
+
{onAdd ? (
|
|
129
|
+
<Button variant="outline" onPress={onAdd}>
|
|
130
|
+
옵션 추가
|
|
131
|
+
</Button>
|
|
132
|
+
) : null}
|
|
133
|
+
</View>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { View, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { Button, type ButtonVariant } from '../../components/button/button';
|
|
4
|
+
import { formatPrice } from '../../components/price/price';
|
|
5
|
+
import { Text } from '../../components/text/text';
|
|
6
|
+
import { ChevronGlyph } from '../../internal/glyphs';
|
|
7
|
+
import { useTheme } from '../../theme/theme-provider';
|
|
8
|
+
import { makeStyles } from '../../utils/styles';
|
|
9
|
+
import { Card } from '../internal/card';
|
|
10
|
+
import { formatDeadline } from '../internal/format';
|
|
11
|
+
|
|
12
|
+
export type OrderStatus =
|
|
13
|
+
| 'pending'
|
|
14
|
+
| 'paid'
|
|
15
|
+
| 'preparing'
|
|
16
|
+
| 'shipping'
|
|
17
|
+
| 'delivered'
|
|
18
|
+
| 'confirmed'
|
|
19
|
+
| 'partiallyCanceled'
|
|
20
|
+
| 'cancelRequested'
|
|
21
|
+
| 'returnRequested'
|
|
22
|
+
| 'exchangeRequested'
|
|
23
|
+
| 'canceled'
|
|
24
|
+
| 'refunded';
|
|
25
|
+
|
|
26
|
+
/** 주문 상태 → 묶음 제목 (OrderSection) */
|
|
27
|
+
export const orderStatusLabel: Record<OrderStatus, string> = {
|
|
28
|
+
pending: '결제 대기',
|
|
29
|
+
paid: '신규',
|
|
30
|
+
preparing: '배송 준비',
|
|
31
|
+
shipping: '배송 중',
|
|
32
|
+
delivered: '배송 완료',
|
|
33
|
+
confirmed: '구매 확정',
|
|
34
|
+
partiallyCanceled: '부분 취소',
|
|
35
|
+
cancelRequested: '취소 요청',
|
|
36
|
+
returnRequested: '반품 요청',
|
|
37
|
+
exchangeRequested: '교환 요청',
|
|
38
|
+
canceled: '취소',
|
|
39
|
+
refunded: '환불 완료',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type OrderItem = { name: string; option?: string; quantity: number };
|
|
43
|
+
|
|
44
|
+
export type OrderAction = {
|
|
45
|
+
label: string;
|
|
46
|
+
onPress: () => void;
|
|
47
|
+
/** 기본 'outline' */
|
|
48
|
+
variant?: ButtonVariant;
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type OrderCardProps = {
|
|
53
|
+
items: readonly OrderItem[];
|
|
54
|
+
/** 결제 금액 */
|
|
55
|
+
total: number;
|
|
56
|
+
/** 처리 기한까지 남은 영업일. 임박했을 때만 표시한다 */
|
|
57
|
+
dueInDays?: number;
|
|
58
|
+
/** 없고 기한도 임박하지 않으면 한 줄로 줄여 보여준다 */
|
|
59
|
+
actions?: readonly OrderAction[];
|
|
60
|
+
onPress?: () => void;
|
|
61
|
+
style?: StyleProp<ViewStyle>;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const useStyles = makeStyles((t) => ({
|
|
65
|
+
row: { flexDirection: 'row', alignItems: 'center', gap: t.space[2] },
|
|
66
|
+
grow: { flex: 1 },
|
|
67
|
+
title: { fontSize: 16, lineHeight: 24 },
|
|
68
|
+
amount: { fontVariant: ['tabular-nums'] },
|
|
69
|
+
deadline: { fontSize: 14, lineHeight: 20 },
|
|
70
|
+
action: { flex: 1 },
|
|
71
|
+
compact: {
|
|
72
|
+
flexDirection: 'row',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
gap: t.space[2],
|
|
75
|
+
minHeight: Math.max(t.minTouchSize, 56),
|
|
76
|
+
paddingVertical: t.space[2],
|
|
77
|
+
},
|
|
78
|
+
section: { gap: t.space[3] },
|
|
79
|
+
}));
|
|
80
|
+
|
|
81
|
+
/** '장미 꽃다발 (중) 외 1건', '튤립 다발 × 2' */
|
|
82
|
+
export function summarizeItems(items: readonly OrderItem[]): string {
|
|
83
|
+
const [first, ...rest] = items;
|
|
84
|
+
if (!first) return '';
|
|
85
|
+
const name = first.option ? `${first.name} (${first.option})` : first.name;
|
|
86
|
+
if (rest.length) return `${name} 외 ${rest.length}건`;
|
|
87
|
+
return first.quantity > 1 ? `${name} × ${first.quantity}` : name;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** 주문 목록의 한 건. 처리할 일이 없으면 누를 수 있는 한 줄로 보여준다 */
|
|
91
|
+
export function OrderCard({
|
|
92
|
+
items,
|
|
93
|
+
total,
|
|
94
|
+
dueInDays,
|
|
95
|
+
actions = [],
|
|
96
|
+
onPress,
|
|
97
|
+
style,
|
|
98
|
+
}: OrderCardProps) {
|
|
99
|
+
const t = useTheme();
|
|
100
|
+
const s = useStyles();
|
|
101
|
+
const summary = summarizeItems(items);
|
|
102
|
+
const deadline = dueInDays !== undefined ? formatDeadline(dueInDays) : null;
|
|
103
|
+
const label = `${summary}, ${formatPrice(total)}${deadline ? `, ${deadline}` : ''}`;
|
|
104
|
+
|
|
105
|
+
if (!actions.length && !deadline) {
|
|
106
|
+
return (
|
|
107
|
+
<Card
|
|
108
|
+
onPress={onPress}
|
|
109
|
+
accessibilityLabel={label}
|
|
110
|
+
style={[s.compact, style]}
|
|
111
|
+
>
|
|
112
|
+
<Text style={s.grow} numberOfLines={1}>
|
|
113
|
+
{summary}
|
|
114
|
+
</Text>
|
|
115
|
+
<Text weight="bold" style={s.amount}>
|
|
116
|
+
{formatPrice(total)}
|
|
117
|
+
</Text>
|
|
118
|
+
{onPress ? (
|
|
119
|
+
<ChevronGlyph color={t.colors.mutedForeground} size={t.iconSize.sm} />
|
|
120
|
+
) : null}
|
|
121
|
+
</Card>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<Card onPress={onPress} accessibilityLabel={label} style={style}>
|
|
127
|
+
<View style={s.row}>
|
|
128
|
+
<Text weight="semibold" style={[s.title, s.grow]} numberOfLines={1}>
|
|
129
|
+
{summary}
|
|
130
|
+
</Text>
|
|
131
|
+
<Text variant="bodyLg" weight="bold" style={s.amount}>
|
|
132
|
+
{formatPrice(total)}
|
|
133
|
+
</Text>
|
|
134
|
+
</View>
|
|
135
|
+
{deadline ? (
|
|
136
|
+
<Text weight="bold" tone="destructive" style={s.deadline}>
|
|
137
|
+
{deadline}
|
|
138
|
+
</Text>
|
|
139
|
+
) : null}
|
|
140
|
+
{actions.length ? (
|
|
141
|
+
<View style={s.row}>
|
|
142
|
+
{actions.map((a) => (
|
|
143
|
+
<Button
|
|
144
|
+
key={a.label}
|
|
145
|
+
variant={a.variant ?? 'outline'}
|
|
146
|
+
loading={a.loading}
|
|
147
|
+
style={s.action}
|
|
148
|
+
onPress={a.onPress}
|
|
149
|
+
>
|
|
150
|
+
{a.label}
|
|
151
|
+
</Button>
|
|
152
|
+
))}
|
|
153
|
+
</View>
|
|
154
|
+
) : null}
|
|
155
|
+
</Card>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export type OrderSectionProps = {
|
|
160
|
+
/** 예) '신규', orderStatusLabel[status] */
|
|
161
|
+
title: string;
|
|
162
|
+
/** 제목 옆 건수 */
|
|
163
|
+
count?: number;
|
|
164
|
+
children: ReactNode;
|
|
165
|
+
style?: StyleProp<ViewStyle>;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/** 같은 상태의 주문을 묶는 제목과 목록 */
|
|
169
|
+
export function OrderSection({
|
|
170
|
+
title,
|
|
171
|
+
count,
|
|
172
|
+
children,
|
|
173
|
+
style,
|
|
174
|
+
}: OrderSectionProps) {
|
|
175
|
+
const s = useStyles();
|
|
176
|
+
return (
|
|
177
|
+
<View style={[s.section, style]}>
|
|
178
|
+
<Text weight="bold" accessibilityRole="header">
|
|
179
|
+
{count === undefined ? title : `${title} ${count}`}
|
|
180
|
+
</Text>
|
|
181
|
+
{children}
|
|
182
|
+
</View>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PlanCard, type PlanCardProps, type PlanState } from './plan-card';
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { View, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { Button } from '../../components/button/button';
|
|
3
|
+
import { formatPrice } from '../../components/price/price';
|
|
4
|
+
import { Text } from '../../components/text/text';
|
|
5
|
+
import { CheckGlyph } from '../../internal/glyphs';
|
|
6
|
+
import { useTheme } from '../../theme/theme-provider';
|
|
7
|
+
import { makeStyles } from '../../utils/styles';
|
|
8
|
+
import { Card } from '../internal/card';
|
|
9
|
+
|
|
10
|
+
export type PlanState = 'active' | 'cancelScheduled' | 'pastDue' | 'suspended';
|
|
11
|
+
|
|
12
|
+
export type PlanCardProps = {
|
|
13
|
+
name: string;
|
|
14
|
+
/** 월 요금 */
|
|
15
|
+
price: number;
|
|
16
|
+
/** 매월 주는 크레딧 */
|
|
17
|
+
monthlyCredits: number;
|
|
18
|
+
/** 하루 생성 한도 */
|
|
19
|
+
dailyLimit: number;
|
|
20
|
+
features?: readonly string[];
|
|
21
|
+
/** 지금 쓰는 플랜이면 변경 버튼을 숨긴다 */
|
|
22
|
+
current?: boolean;
|
|
23
|
+
/** 테두리를 굵게 강조 */
|
|
24
|
+
recommended?: boolean;
|
|
25
|
+
/** 지금 구독 상태 (current일 때) */
|
|
26
|
+
state?: PlanState;
|
|
27
|
+
/** 예) '11월 30일' — 해지 예약일 */
|
|
28
|
+
cancelDate?: string;
|
|
29
|
+
/** 바꾸면 오늘 결제할 금액. 넘기면 버튼에 금액을 붙인다 */
|
|
30
|
+
proratedAmount?: number;
|
|
31
|
+
/** 가격 인상 예정 */
|
|
32
|
+
priceChange?: { newPrice: number; effectiveDate: string; consented: boolean };
|
|
33
|
+
onSelect?: () => void;
|
|
34
|
+
onConsent?: () => void;
|
|
35
|
+
/** 기본 '이 플랜으로 변경' */
|
|
36
|
+
actionLabel?: string;
|
|
37
|
+
style?: StyleProp<ViewStyle>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const useStyles = makeStyles((t) => ({
|
|
41
|
+
recommended: {
|
|
42
|
+
borderColor: t.colors.primary,
|
|
43
|
+
borderWidth: 2,
|
|
44
|
+
padding: t.space[4] - 1,
|
|
45
|
+
},
|
|
46
|
+
head: { flexDirection: 'row', alignItems: 'center', gap: t.space[2] },
|
|
47
|
+
name: { flex: 1 },
|
|
48
|
+
list: { gap: 6 },
|
|
49
|
+
feature: { flexDirection: 'row', alignItems: 'center', gap: t.space[2] },
|
|
50
|
+
change: {
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
gap: t.space[2],
|
|
54
|
+
paddingTop: t.space[3],
|
|
55
|
+
borderTopWidth: 1,
|
|
56
|
+
borderTopColor: t.colors.border,
|
|
57
|
+
},
|
|
58
|
+
changePrice: { flex: 1 },
|
|
59
|
+
}));
|
|
60
|
+
|
|
61
|
+
function stateText(state: PlanState, cancelDate?: string): string | null {
|
|
62
|
+
switch (state) {
|
|
63
|
+
case 'cancelScheduled':
|
|
64
|
+
return cancelDate ? `${cancelDate} 해지` : '해지 신청됨';
|
|
65
|
+
case 'pastDue':
|
|
66
|
+
return '결제 실패';
|
|
67
|
+
case 'suspended':
|
|
68
|
+
return '이용 정지';
|
|
69
|
+
default:
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** 구독 플랜 한 장. 섹션 제목('이용 중인 플랜' 등)은 쓰는 쪽에서 붙인다 */
|
|
75
|
+
export function PlanCard({
|
|
76
|
+
name,
|
|
77
|
+
price,
|
|
78
|
+
monthlyCredits,
|
|
79
|
+
dailyLimit,
|
|
80
|
+
features = [],
|
|
81
|
+
current,
|
|
82
|
+
recommended,
|
|
83
|
+
state = 'active',
|
|
84
|
+
cancelDate,
|
|
85
|
+
proratedAmount,
|
|
86
|
+
priceChange,
|
|
87
|
+
onSelect,
|
|
88
|
+
onConsent,
|
|
89
|
+
actionLabel = '이 플랜으로 변경',
|
|
90
|
+
style,
|
|
91
|
+
}: PlanCardProps) {
|
|
92
|
+
const t = useTheme();
|
|
93
|
+
const s = useStyles();
|
|
94
|
+
const items = [
|
|
95
|
+
`월 크레딧 ${formatPrice(monthlyCredits, '')}`,
|
|
96
|
+
`하루 생성 ${dailyLimit}회`,
|
|
97
|
+
...features,
|
|
98
|
+
];
|
|
99
|
+
const alert = current ? stateText(state, cancelDate) : null;
|
|
100
|
+
return (
|
|
101
|
+
<Card style={[recommended && s.recommended, style]}>
|
|
102
|
+
<View style={s.head}>
|
|
103
|
+
<Text variant="bodyLg" weight="bold" style={s.name}>
|
|
104
|
+
{name}
|
|
105
|
+
</Text>
|
|
106
|
+
<Text variant="bodyLg" weight="bold">
|
|
107
|
+
월 {formatPrice(price)}
|
|
108
|
+
</Text>
|
|
109
|
+
</View>
|
|
110
|
+
<View style={s.list}>
|
|
111
|
+
{items.map((item) => (
|
|
112
|
+
<View key={item} style={s.feature}>
|
|
113
|
+
<CheckGlyph color={t.colors.foreground} size={16} />
|
|
114
|
+
<Text>{item}</Text>
|
|
115
|
+
</View>
|
|
116
|
+
))}
|
|
117
|
+
</View>
|
|
118
|
+
{alert ? <Text tone="destructive">{alert}</Text> : null}
|
|
119
|
+
{priceChange ? (
|
|
120
|
+
<View style={s.change}>
|
|
121
|
+
<Text tone="muted">{priceChange.effectiveDate}부터</Text>
|
|
122
|
+
<Text weight="bold" style={s.changePrice}>
|
|
123
|
+
월 {formatPrice(priceChange.newPrice)}
|
|
124
|
+
</Text>
|
|
125
|
+
{priceChange.consented ? (
|
|
126
|
+
<Text tone="muted">동의함</Text>
|
|
127
|
+
) : onConsent ? (
|
|
128
|
+
<Button size="sm" onPress={onConsent}>
|
|
129
|
+
인상 동의
|
|
130
|
+
</Button>
|
|
131
|
+
) : null}
|
|
132
|
+
</View>
|
|
133
|
+
) : null}
|
|
134
|
+
{!current && onSelect ? (
|
|
135
|
+
<Button
|
|
136
|
+
size="lg"
|
|
137
|
+
variant={recommended ? 'solid' : 'outline'}
|
|
138
|
+
onPress={onSelect}
|
|
139
|
+
>
|
|
140
|
+
{proratedAmount !== undefined && proratedAmount > 0
|
|
141
|
+
? `${formatPrice(proratedAmount)} 결제하고 ${actionLabel}`
|
|
142
|
+
: actionLabel}
|
|
143
|
+
</Button>
|
|
144
|
+
) : null}
|
|
145
|
+
</Card>
|
|
146
|
+
);
|
|
147
|
+
}
|