@ezpg/app-ui 0.0.0-stage → 0.2.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 +26 -0
- package/LICENSE +20 -0
- package/lib/module/blocks/brand-profile-card/brand-profile-card.js +88 -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/bulk-ship-list/bulk-ship-list.js +190 -0
- package/lib/module/blocks/bulk-ship-list/bulk-ship-list.js.map +1 -0
- package/lib/module/blocks/bulk-ship-list/index.js +4 -0
- package/lib/module/blocks/bulk-ship-list/index.js.map +1 -0
- package/lib/module/blocks/claim-row/claim-row.js +106 -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 +122 -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 +140 -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 +121 -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/generation-progress/generation-progress.js +157 -0
- package/lib/module/blocks/generation-progress/generation-progress.js.map +1 -0
- package/lib/module/blocks/generation-progress/index.js +4 -0
- package/lib/module/blocks/generation-progress/index.js.map +1 -0
- package/lib/module/blocks/image-grid/image-grid.js +277 -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 +25 -0
- package/lib/module/blocks/index.js.map +1 -0
- package/lib/module/blocks/internal/card.js +80 -0
- package/lib/module/blocks/internal/card.js.map +1 -0
- package/lib/module/blocks/internal/format.js +19 -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 +99 -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 +115 -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 +99 -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 +143 -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 +151 -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 +138 -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 +153 -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 +276 -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 +124 -0
- package/lib/module/blocks/sales-chart/sales-chart.js.map +1 -0
- package/lib/module/blocks/selection-bar/index.js +4 -0
- package/lib/module/blocks/selection-bar/index.js.map +1 -0
- package/lib/module/blocks/selection-bar/selection-bar.js +69 -0
- package/lib/module/blocks/selection-bar/selection-bar.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 +70 -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 +114 -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 +121 -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 +69 -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 +132 -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 +145 -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 +124 -0
- package/lib/module/charts/line-chart.js.map +1 -0
- package/lib/module/charts/scale.js +39 -0
- package/lib/module/charts/scale.js.map +1 -0
- package/lib/module/charts/sparkline.js +49 -0
- package/lib/module/charts/sparkline.js.map +1 -0
- package/lib/module/charts/summary.js +10 -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 +82 -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 +56 -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 +116 -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 +20 -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 +116 -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 +172 -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 +65 -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 +70 -0
- package/lib/module/components/price/price.js.map +1 -0
- package/lib/module/components/progress-bar/index.js +4 -0
- package/lib/module/components/progress-bar/index.js.map +1 -0
- package/lib/module/components/progress-bar/progress-bar.js +92 -0
- package/lib/module/components/progress-bar/progress-bar.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 +48 -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 +27 -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 +195 -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 +67 -0
- package/lib/module/components/wizard-steps/wizard-steps.js.map +1 -0
- package/lib/module/index.js +32 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/internal/glyphs.js +196 -0
- package/lib/module/internal/glyphs.js.map +1 -0
- package/lib/module/internal/icon.js +6 -0
- package/lib/module/internal/icon.js.map +1 -0
- package/lib/module/internal/overlay.js +55 -0
- package/lib/module/internal/overlay.js.map +1 -0
- package/lib/module/internal/pressable-base.js +39 -0
- package/lib/module/internal/pressable-base.js.map +1 -0
- package/lib/module/internal/use-reduced-motion.js +27 -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 +10 -0
- package/lib/module/sortable/move.js.map +1 -0
- package/lib/module/sortable/sortable-grid.js +80 -0
- package/lib/module/sortable/sortable-grid.js.map +1 -0
- package/lib/module/sortable/sortable-list.js +15 -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 +50 -0
- package/lib/module/theme/create-theme.js.map +1 -0
- package/lib/module/theme/theme-provider.js +24 -0
- package/lib/module/theme/theme-provider.js.map +1 -0
- package/lib/module/theme/tokens.js +122 -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 +25 -0
- package/lib/module/utils/color.js.map +1 -0
- package/lib/module/utils/styles.js +17 -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 +13 -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/bulk-ship-list/bulk-ship-list.d.ts +24 -0
- package/lib/typescript/src/blocks/bulk-ship-list/bulk-ship-list.d.ts.map +1 -0
- package/lib/typescript/src/blocks/bulk-ship-list/index.d.ts +2 -0
- package/lib/typescript/src/blocks/bulk-ship-list/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/claim-row/claim-row.d.ts +15 -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 +14 -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 +18 -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 +12 -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/generation-progress/generation-progress.d.ts +17 -0
- package/lib/typescript/src/blocks/generation-progress/generation-progress.d.ts.map +1 -0
- package/lib/typescript/src/blocks/generation-progress/index.d.ts +2 -0
- package/lib/typescript/src/blocks/generation-progress/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/image-grid/image-grid.d.ts +18 -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 +23 -0
- package/lib/typescript/src/blocks/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/internal/card.d.ts +11 -0
- package/lib/typescript/src/blocks/internal/card.d.ts.map +1 -0
- package/lib/typescript/src/blocks/internal/format.d.ts +4 -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 +15 -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 +15 -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 +13 -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 +18 -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 +36 -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 +25 -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 +16 -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 +25 -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 +15 -0
- package/lib/typescript/src/blocks/sales-chart/sales-chart.d.ts.map +1 -0
- package/lib/typescript/src/blocks/selection-bar/index.d.ts +2 -0
- package/lib/typescript/src/blocks/selection-bar/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/selection-bar/selection-bar.d.ts +12 -0
- package/lib/typescript/src/blocks/selection-bar/selection-bar.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 +12 -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 +11 -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 +16 -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 +12 -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 +20 -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 +24 -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 +17 -0
- package/lib/typescript/src/charts/line-chart.d.ts.map +1 -0
- package/lib/typescript/src/charts/scale.d.ts +10 -0
- package/lib/typescript/src/charts/scale.d.ts.map +1 -0
- package/lib/typescript/src/charts/sparkline.d.ts +11 -0
- package/lib/typescript/src/charts/sparkline.d.ts.map +1 -0
- package/lib/typescript/src/charts/summary.d.ts +2 -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 +15 -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 +10 -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 +26 -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 +13 -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 +7 -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 +16 -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 +12 -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 +11 -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 +12 -0
- package/lib/typescript/src/components/price/price.d.ts.map +1 -0
- package/lib/typescript/src/components/progress-bar/index.d.ts +2 -0
- package/lib/typescript/src/components/progress-bar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/progress-bar/progress-bar.d.ts +9 -0
- package/lib/typescript/src/components/progress-bar/progress-bar.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 +8 -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 +13 -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 +14 -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 +9 -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 +9 -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 +13 -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 +22 -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 +8 -0
- package/lib/typescript/src/components/wizard-steps/wizard-steps.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +32 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/internal/glyphs.d.ts +11 -0
- package/lib/typescript/src/internal/glyphs.d.ts.map +1 -0
- package/lib/typescript/src/internal/icon.d.ts +8 -0
- package/lib/typescript/src/internal/icon.d.ts.map +1 -0
- package/lib/typescript/src/internal/overlay.d.ts +12 -0
- package/lib/typescript/src/internal/overlay.d.ts.map +1 -0
- package/lib/typescript/src/internal/pressable-base.d.ts +10 -0
- package/lib/typescript/src/internal/pressable-base.d.ts.map +1 -0
- package/lib/typescript/src/internal/use-reduced-motion.d.ts +2 -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 +2 -0
- package/lib/typescript/src/sortable/move.d.ts.map +1 -0
- package/lib/typescript/src/sortable/sortable-grid.d.ts +25 -0
- package/lib/typescript/src/sortable/sortable-grid.d.ts.map +1 -0
- package/lib/typescript/src/sortable/sortable-list.d.ts +4 -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 +4 -0
- package/lib/typescript/src/theme/create-theme.d.ts.map +1 -0
- package/lib/typescript/src/theme/theme-provider.d.ts +10 -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 +83 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/color.d.ts +3 -0
- package/lib/typescript/src/utils/color.d.ts.map +1 -0
- package/lib/typescript/src/utils/styles.d.ts +8 -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 +85 -0
- package/src/blocks/brand-profile-card/index.ts +4 -0
- package/src/blocks/bulk-ship-list/bulk-ship-list.tsx +187 -0
- package/src/blocks/bulk-ship-list/index.ts +8 -0
- package/src/blocks/claim-row/claim-row.tsx +125 -0
- package/src/blocks/claim-row/index.ts +7 -0
- package/src/blocks/color-swatch-picker/color-swatch-picker.tsx +117 -0
- package/src/blocks/color-swatch-picker/index.ts +5 -0
- package/src/blocks/copy-variant-picker/copy-variant-picker.tsx +136 -0
- package/src/blocks/copy-variant-picker/index.ts +5 -0
- package/src/blocks/credit-wallet/credit-wallet.tsx +111 -0
- package/src/blocks/credit-wallet/index.ts +1 -0
- package/src/blocks/generation-progress/generation-progress.tsx +180 -0
- package/src/blocks/generation-progress/index.ts +6 -0
- package/src/blocks/image-grid/image-grid.tsx +275 -0
- package/src/blocks/image-grid/index.ts +1 -0
- package/src/blocks/index.tsx +22 -0
- package/src/blocks/internal/card.tsx +86 -0
- package/src/blocks/internal/format.ts +19 -0
- package/src/blocks/invoice-row/index.ts +5 -0
- package/src/blocks/invoice-row/invoice-row.tsx +115 -0
- package/src/blocks/logo-candidate-grid/index.ts +5 -0
- package/src/blocks/logo-candidate-grid/logo-candidate-grid.tsx +127 -0
- package/src/blocks/oauth-buttons/index.ts +5 -0
- package/src/blocks/oauth-buttons/oauth-buttons.tsx +101 -0
- package/src/blocks/option-editor/index.ts +5 -0
- package/src/blocks/option-editor/option-editor.tsx +149 -0
- package/src/blocks/order-card/index.ts +11 -0
- package/src/blocks/order-card/order-card.tsx +176 -0
- package/src/blocks/plan-card/index.ts +1 -0
- package/src/blocks/plan-card/plan-card.tsx +149 -0
- package/src/blocks/product-list-empty/index.ts +5 -0
- package/src/blocks/product-list-empty/product-list-empty.tsx +139 -0
- package/src/blocks/review-row/index.ts +8 -0
- package/src/blocks/review-row/review-row.tsx +246 -0
- package/src/blocks/sales-chart/index.ts +5 -0
- package/src/blocks/sales-chart/sales-chart.tsx +115 -0
- package/src/blocks/selection-bar/index.ts +1 -0
- package/src/blocks/selection-bar/selection-bar.tsx +63 -0
- package/src/blocks/service-state-banner/index.ts +5 -0
- package/src/blocks/service-state-banner/service-state-banner.tsx +77 -0
- package/src/blocks/shipping-tracking-row/index.ts +5 -0
- package/src/blocks/shipping-tracking-row/shipping-tracking-row.tsx +92 -0
- package/src/blocks/site-preview-frame/index.ts +5 -0
- package/src/blocks/site-preview-frame/site-preview-frame.tsx +136 -0
- package/src/blocks/stat-card/index.ts +1 -0
- package/src/blocks/stat-card/stat-card.tsx +72 -0
- package/src/blocks/step-screen/index.ts +5 -0
- package/src/blocks/step-screen/step-screen.tsx +131 -0
- package/src/blocks/supply-item-card/index.ts +6 -0
- package/src/blocks/supply-item-card/supply-item-card.tsx +139 -0
- package/src/charts/index.ts +2 -0
- package/src/charts/line-chart.tsx +182 -0
- package/src/charts/scale.ts +46 -0
- package/src/charts/sparkline.tsx +60 -0
- package/src/charts/summary.ts +10 -0
- package/src/charts.tsx +2 -0
- package/src/components/button/button.tsx +116 -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 +90 -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 +124 -0
- package/src/components/dialog/index.ts +1 -0
- package/src/components/divider/divider.tsx +24 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/empty-state/empty-state.tsx +141 -0
- package/src/components/empty-state/index.ts +5 -0
- package/src/components/field/field.tsx +201 -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 +112 -0
- package/src/components/photo/index.ts +1 -0
- package/src/components/photo/photo.tsx +82 -0
- package/src/components/price/index.ts +1 -0
- package/src/components/price/price.tsx +81 -0
- package/src/components/progress-bar/index.ts +1 -0
- package/src/components/progress-bar/progress-bar.tsx +80 -0
- package/src/components/search-field/index.ts +1 -0
- package/src/components/search-field/search-field.tsx +45 -0
- package/src/components/segmented-tabs/index.ts +5 -0
- package/src/components/segmented-tabs/segmented-tabs.tsx +80 -0
- package/src/components/sheet/index.ts +1 -0
- package/src/components/sheet/sheet.tsx +118 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/skeleton/skeleton.tsx +69 -0
- package/src/components/status-badge/index.ts +5 -0
- package/src/components/status-badge/status-badge.tsx +53 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/switch/switch.tsx +28 -0
- package/src/components/text/index.ts +1 -0
- package/src/components/text/text.tsx +51 -0
- package/src/components/toast/index.ts +9 -0
- package/src/components/toast/toast.tsx +237 -0
- package/src/components/wizard-steps/index.ts +1 -0
- package/src/components/wizard-steps/wizard-steps.tsx +51 -0
- package/src/index.tsx +57 -0
- package/src/internal/glyphs.tsx +155 -0
- package/src/internal/icon.tsx +9 -0
- package/src/internal/overlay.tsx +55 -0
- package/src/internal/pressable-base.tsx +52 -0
- package/src/internal/use-reduced-motion.ts +30 -0
- package/src/sortable/index.ts +8 -0
- package/src/sortable/move.ts +18 -0
- package/src/sortable/sortable-grid.tsx +85 -0
- package/src/sortable/sortable-list.tsx +10 -0
- package/src/sortable.tsx +3 -0
- package/src/theme/create-theme.ts +62 -0
- package/src/theme/theme-provider.tsx +34 -0
- package/src/theme/tokens.ts +90 -0
- package/src/types/index.ts +73 -0
- package/src/utils/color.ts +44 -0
- package/src/utils/styles.ts +25 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Text","makeStyles","Card","jsx","_jsx","jsxs","_jsxs","useStyles","t","row","flexDirection","alignItems","gap","space","body","flex","value","flexWrap","columnGap","down","color","colors","info","StatCard","label","change","chart","onPress","style","s","hasChange","undefined","Number","isFinite","flat","Math","abs","up","rate","toFixed","accessibilityLabel","children","tone","variant","weight"],"sourceRoot":"../../../../src","sources":["blocks/stat-card/stat-card.tsx"],"mappings":";;AACA,SAASA,IAAI,QAAwC,cAAc;AACnE,SAASC,IAAI,QAAQ,+BAA4B;AACjD,SAASC,UAAU,QAAQ,uBAAoB;AAC/C,SAASC,IAAI,QAAQ,qBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAWxC,MAAMC,SAAS,GAAGN,UAAU,CAAEO,CAAC,KAAM;EACnCC,GAAG,EAAE;IAAEC,aAAa,EAAE,KAAK;IAAEC,UAAU,EAAE,UAAU;IAAEC,GAAG,EAAEJ,CAAC,CAACK,KAAK,CAAC,CAAC;EAAE,CAAC;EACtEC,IAAI,EAAE;IAAEC,IAAI,EAAE,CAAC;IAAEH,GAAG,EAAEJ,CAAC,CAACK,KAAK,CAAC,CAAC;EAAE,CAAC;EAClCG,KAAK,EAAE;IACLN,aAAa,EAAE,KAAK;IACpBO,QAAQ,EAAE,MAAM;IAChBN,UAAU,EAAE,UAAU;IACtBO,SAAS,EAAEV,CAAC,CAACK,KAAK,CAAC,CAAC;EACtB,CAAC;EACDM,IAAI,EAAE;IAAEC,KAAK,EAAEZ,CAAC,CAACa,MAAM,CAACC;EAAK;AAC/B,CAAC,CAAC,CAAC;AAEH,OAAO,SAASC,QAAQA,CAAC;EACvBC,KAAK;EACLR,KAAK;EACLS,MAAM;EACNC,KAAK;EACLC,OAAO;EACPC;AACa,CAAC,EAAE;EAChB,MAAMC,CAAC,GAAGtB,SAAS,CAAC,CAAC;EACrB,MAAMuB,SAAS,GACbL,MAAM,KAAKM,SAAS,IAAIN,MAAM,KAAK,IAAI,IAAIO,MAAM,CAACC,QAAQ,CAACR,MAAM,CAAC;EACpE,MAAMS,IAAI,GAAGJ,SAAS,IAAIK,IAAI,CAACC,GAAG,CAACX,MAAM,CAAC,GAAG,IAAI;EACjD,MAAMY,EAAE,GAAGP,SAAS,IAAIL,MAAM,GAAG,CA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AK;IAAA,CACF;EAAC,CACH,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StepScreen"],"sourceRoot":"../../../../src","sources":["blocks/step-screen/index.ts"],"mappings":";;AAAA,SACEA,UAAU,QAGL,kBAAe","ignoreList":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { KeyboardAvoidingView, ScrollView, View } from 'react-native';
|
|
4
|
+
import { Button } from "../../components/button/button.js";
|
|
5
|
+
import { Text } from "../../components/text/text.js";
|
|
6
|
+
import { ChevronGlyph } from "../../internal/glyphs.js";
|
|
7
|
+
import { PressableBase } from "../../internal/pressable-base.js";
|
|
8
|
+
import { useTheme } from "../../theme/theme-provider.js";
|
|
9
|
+
import { makeStyles } from "../../utils/styles.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const useStyles = makeStyles(t => ({
|
|
12
|
+
root: {
|
|
13
|
+
flex: 1,
|
|
14
|
+
backgroundColor: t.colors.background
|
|
15
|
+
},
|
|
16
|
+
header: {
|
|
17
|
+
height: 52,
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
paddingHorizontal: t.space[1]
|
|
21
|
+
},
|
|
22
|
+
back: {
|
|
23
|
+
width: 44,
|
|
24
|
+
height: 44,
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center'
|
|
27
|
+
},
|
|
28
|
+
backIcon: {
|
|
29
|
+
transform: [{
|
|
30
|
+
scaleX: -1
|
|
31
|
+
}]
|
|
32
|
+
},
|
|
33
|
+
track: {
|
|
34
|
+
height: 3,
|
|
35
|
+
backgroundColor: t.colors.muted
|
|
36
|
+
},
|
|
37
|
+
fill: {
|
|
38
|
+
height: 3,
|
|
39
|
+
backgroundColor: t.colors.primary
|
|
40
|
+
},
|
|
41
|
+
body: {
|
|
42
|
+
gap: t.space[5],
|
|
43
|
+
paddingTop: t.space[6],
|
|
44
|
+
paddingHorizontal: t.space[5],
|
|
45
|
+
paddingBottom: t.space[4]
|
|
46
|
+
},
|
|
47
|
+
title: {
|
|
48
|
+
fontSize: 24,
|
|
49
|
+
lineHeight: 32
|
|
50
|
+
},
|
|
51
|
+
footer: {
|
|
52
|
+
gap: t.space[2],
|
|
53
|
+
paddingHorizontal: t.space[5],
|
|
54
|
+
paddingTop: t.space[3],
|
|
55
|
+
backgroundColor: t.colors.background
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
export function StepScreen({
|
|
59
|
+
title,
|
|
60
|
+
total,
|
|
61
|
+
current = 0,
|
|
62
|
+
onBack,
|
|
63
|
+
backLabel = '이전',
|
|
64
|
+
primaryAction,
|
|
65
|
+
secondaryAction,
|
|
66
|
+
bottomInset = 0,
|
|
67
|
+
children
|
|
68
|
+
}) {
|
|
69
|
+
const t = useTheme();
|
|
70
|
+
const s = useStyles();
|
|
71
|
+
const step = total ? Math.min(total, Math.max(1, current + 1)) : 0;
|
|
72
|
+
return /*#__PURE__*/_jsxs(KeyboardAvoidingView, {
|
|
73
|
+
behavior: "padding",
|
|
74
|
+
style: s.root,
|
|
75
|
+
children: [onBack ? /*#__PURE__*/_jsx(View, {
|
|
76
|
+
style: s.header,
|
|
77
|
+
children: /*#__PURE__*/_jsx(PressableBase, {
|
|
78
|
+
onPress: onBack,
|
|
79
|
+
accessibilityLabel: backLabel,
|
|
80
|
+
style: s.back,
|
|
81
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
82
|
+
style: s.backIcon,
|
|
83
|
+
children: /*#__PURE__*/_jsx(ChevronGlyph, {
|
|
84
|
+
color: t.colors.foreground,
|
|
85
|
+
size: 24
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
}) : null, total ? /*#__PURE__*/_jsx(View, {
|
|
90
|
+
accessibilityRole: "progressbar",
|
|
91
|
+
accessibilityLabel: `${total}단계 중 ${step}단계`,
|
|
92
|
+
accessibilityValue: {
|
|
93
|
+
min: 1,
|
|
94
|
+
max: total,
|
|
95
|
+
now: step
|
|
96
|
+
},
|
|
97
|
+
style: s.track,
|
|
98
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
99
|
+
style: [s.fill, {
|
|
100
|
+
width: `${step / total * 100}%`
|
|
101
|
+
}]
|
|
102
|
+
})
|
|
103
|
+
}) : null, /*#__PURE__*/_jsxs(ScrollView, {
|
|
104
|
+
contentContainerStyle: s.body,
|
|
105
|
+
keyboardShouldPersistTaps: "handled",
|
|
106
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
107
|
+
weight: "bold",
|
|
108
|
+
accessibilityRole: "header",
|
|
109
|
+
style: s.title,
|
|
110
|
+
children: title
|
|
111
|
+
}), children]
|
|
112
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
113
|
+
style: [s.footer, {
|
|
114
|
+
paddingBottom: t.space[4] + bottomInset
|
|
115
|
+
}],
|
|
116
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
117
|
+
size: "lg",
|
|
118
|
+
onPress: primaryAction.onPress,
|
|
119
|
+
disabled: primaryAction.disabled,
|
|
120
|
+
loading: primaryAction.loading,
|
|
121
|
+
children: primaryAction.label
|
|
122
|
+
}), secondaryAction ? /*#__PURE__*/_jsx(Button, {
|
|
123
|
+
variant: "ghost",
|
|
124
|
+
onPress: secondaryAction.onPress,
|
|
125
|
+
disabled: secondaryAction.disabled,
|
|
126
|
+
loading: secondaryAction.loading,
|
|
127
|
+
children: secondaryAction.label
|
|
128
|
+
}) : null]
|
|
129
|
+
})]
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=step-screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["KeyboardAvoidingView","ScrollView","View","Button","Text","ChevronGlyph","PressableBase","useTheme","makeStyles","jsx","_jsx","jsxs","_jsxs","useStyles","t","root","flex","backgroundColor","colors","background","header","height","flexDirection","alignItems","paddingHorizontal","space","back","width","justifyContent","backIcon","transform","scaleX","track","muted","fill","primary","body","gap","paddingTop","paddingBottom","title","fontSize","lineHeight","footer","StepScreen","total","current","onBack","backLabel","primaryAction","secondaryAction","bottomInset","children","s","step","Math","min","max","behavior","style","onPress","accessibilityLabel","color","foreground","size","accessibilityRole","accessibilityValue","now","contentContainerStyle","keyboardShouldPersistTaps","weight","disabled","loading","label","variant"],"sourceRoot":"../../../../src","sources":["blocks/step-screen/step-screen.tsx"],"mappings":";;AACA,SAASA,oBAAoB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACrE,SAASC,MAAM,QAAQ,mCAAgC;AACvD,SAASC,IAAI,QAAQ,+BAA4B;AACjD,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SAASC,aAAa,QAAQ,kCAA+B;AAC7D,SAASC,QAAQ,QAAQ,+BAA4B;AACrD,SAASC,UAAU,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAqBhD,MAAMC,SAAS,GAAGL,UAAU,CAAEM,CAAC,KAAM;EACnCC,IAAI,EAAE;IAAEC,IAAI,EAAE,CAAC;IAAEC,eAAe,EAAEH,CAAC,CAACI,MAAM,CAACC;EAAW,CAAC;EACvDC,MAAM,EAAE;IACNC,MAAM,EAAE,EAAE;IACVC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAEV,CAAC,CAACW,KAAK,CAAC,CAAC;EAC9B,CAAC;EACDC,IAAI,EAAE;IACJC,KAAK,EAAE,EAAE;IACTN,MAAM,EAAE,EAAE;IACVE,UAAU,EAAE,QAAQ;IACpBK,cAAc,EAAE;EAClB,CAAC;EACDC,QAAQ,EAAE;IAAEC,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE,CAAC;IAAE,CAAC;EAAE,CAAC;EACzCC,KAAK,EAAE;IAAEX,MAAM,EAAE,C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AC,QAAQ;QAACN,KAAK,EAAEN,CAAC,CAACb,KAAM;QAAAY,QAAA,EAC3DZ;MAAK,CACF,CAAC,EACNY,QAAQ;IAAA,CACC,CAAC,eACbxC,KAAA,CAACV,IAAI;MAACyD,KAAK,EAAE,CAACN,CAAC,CAACV,MAAM,EAAE;QAAEJ,aAAa,EAAEzB,CAAC,CAACW,KAAK,CAAC,CAAC,CAAC,GAAG0B;MAAY,CAAC,CAAE;MAAAC,QAAA,gBACnE1C,IAAA,CAACP,MAAM;QACL6D,IAAI,EAAC,IAAI;QACTJ,OAAO,EAAEX,aAAa,CAACW,OAAQ;QAC/BW,QAAQ,EAAEtB,aAAa,CAACsB,QAAS;QACjCC,OAAO,EAAEvB,aAAa,CAACuB,OAAQ;QAAApB,QAAA,EAE9BH,aAAa,CAACwB;MAAK,CACd,CAAC,EACRvB,eAAe,gBACdxC,IAAA,CAACP,MAAM;QACLuE,OAAO,EAAC,OAAO;QACfd,OAAO,EAAEV,eAAe,CAACU,OAAQ;QACjCW,QAAQ,EAAErB,eAAe,CAACqB,QAAS;QACnCC,OAAO,EAAEtB,eAAe,CAACsB,OAAQ;QAAApB,QAAA,EAEhCF,eAAe,CAACuB;MAAK,CAChB,CAAC,GACP,IAAI;IAAA,CACJ,CAAC;EAAA,CACa,CAAC;AAE3B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SupplyItemCard"],"sourceRoot":"../../../../src","sources":["blocks/supply-item-card/index.ts"],"mappings":";;AAAA,SACEA,cAAc,QAIT,uBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { Button } from "../../components/button/button.js";
|
|
5
|
+
import { ChipGroup } from "../../components/chip-group/chip-group.js";
|
|
6
|
+
import { Photo } from "../../components/photo/photo.js";
|
|
7
|
+
import { formatPrice } from "../../components/price/price.js";
|
|
8
|
+
import { Text } from "../../components/text/text.js";
|
|
9
|
+
import { PressableBase } from "../../internal/pressable-base.js";
|
|
10
|
+
import { makeStyles } from "../../utils/styles.js";
|
|
11
|
+
import { Card } from "../internal/card.js";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const useStyles = makeStyles(t => ({
|
|
14
|
+
card: {
|
|
15
|
+
gap: t.space[4]
|
|
16
|
+
},
|
|
17
|
+
head: {
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
gap: t.space[3]
|
|
21
|
+
},
|
|
22
|
+
image: {
|
|
23
|
+
width: 64
|
|
24
|
+
},
|
|
25
|
+
name: {
|
|
26
|
+
flex: 1
|
|
27
|
+
},
|
|
28
|
+
group: {
|
|
29
|
+
borderWidth: 1,
|
|
30
|
+
borderColor: t.colors.border,
|
|
31
|
+
borderRadius: 10,
|
|
32
|
+
overflow: 'hidden'
|
|
33
|
+
},
|
|
34
|
+
row: {
|
|
35
|
+
flexDirection: 'row',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
gap: t.space[3],
|
|
38
|
+
minHeight: 52,
|
|
39
|
+
paddingHorizontal: 14
|
|
40
|
+
},
|
|
41
|
+
divided: {
|
|
42
|
+
borderTopWidth: 1,
|
|
43
|
+
borderTopColor: t.colors.border
|
|
44
|
+
},
|
|
45
|
+
pressed: {
|
|
46
|
+
backgroundColor: t.colors.muted
|
|
47
|
+
},
|
|
48
|
+
radio: {
|
|
49
|
+
width: 20,
|
|
50
|
+
height: 20,
|
|
51
|
+
borderRadius: 10,
|
|
52
|
+
borderWidth: 2,
|
|
53
|
+
borderColor: t.colors.input,
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'center'
|
|
56
|
+
},
|
|
57
|
+
radioOn: {
|
|
58
|
+
borderColor: t.colors.primary
|
|
59
|
+
},
|
|
60
|
+
radioDot: {
|
|
61
|
+
width: 10,
|
|
62
|
+
height: 10,
|
|
63
|
+
borderRadius: 5,
|
|
64
|
+
backgroundColor: t.colors.primary
|
|
65
|
+
},
|
|
66
|
+
quantity: {
|
|
67
|
+
flex: 1
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
export function SupplyItemCard({
|
|
71
|
+
name,
|
|
72
|
+
image,
|
|
73
|
+
options = [],
|
|
74
|
+
selectedOptionId = null,
|
|
75
|
+
onSelectOption,
|
|
76
|
+
quantities,
|
|
77
|
+
selectedQuantity,
|
|
78
|
+
onSelectQuantity,
|
|
79
|
+
unit = '장',
|
|
80
|
+
onAdd,
|
|
81
|
+
style
|
|
82
|
+
}) {
|
|
83
|
+
const s = useStyles();
|
|
84
|
+
const selected = quantities.find(q => q.quantity === selectedQuantity);
|
|
85
|
+
return /*#__PURE__*/_jsxs(Card, {
|
|
86
|
+
style: [s.card, style],
|
|
87
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
88
|
+
style: s.head,
|
|
89
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
90
|
+
style: s.image,
|
|
91
|
+
children: /*#__PURE__*/_jsx(Photo, {
|
|
92
|
+
source: image
|
|
93
|
+
})
|
|
94
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
95
|
+
variant: "bodyLg",
|
|
96
|
+
weight: "bold",
|
|
97
|
+
style: s.name,
|
|
98
|
+
children: name
|
|
99
|
+
})]
|
|
100
|
+
}), options.length > 1 ? /*#__PURE__*/_jsx(ChipGroup, {
|
|
101
|
+
items: options.map(o => ({
|
|
102
|
+
value: o.id,
|
|
103
|
+
label: o.label
|
|
104
|
+
})),
|
|
105
|
+
value: selectedOptionId,
|
|
106
|
+
onValueChange: id => id && onSelectOption?.(id)
|
|
107
|
+
}) : null, /*#__PURE__*/_jsx(View, {
|
|
108
|
+
accessibilityRole: "radiogroup",
|
|
109
|
+
style: s.group,
|
|
110
|
+
children: quantities.map((q, i) => {
|
|
111
|
+
const on = q.quantity === selectedQuantity;
|
|
112
|
+
const qty = `${formatPrice(q.quantity, '')}${unit}`;
|
|
113
|
+
return /*#__PURE__*/_jsxs(PressableBase, {
|
|
114
|
+
accessibilityRole: "radio",
|
|
115
|
+
accessibilityState: {
|
|
116
|
+
selected: on
|
|
117
|
+
},
|
|
118
|
+
accessibilityLabel: `${qty} ${formatPrice(q.price)}`,
|
|
119
|
+
pressedStyle: s.pressed,
|
|
120
|
+
onPress: () => onSelectQuantity(q.quantity),
|
|
121
|
+
style: [s.row, i > 0 && s.divided],
|
|
122
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
123
|
+
style: [s.radio, on && s.radioOn],
|
|
124
|
+
children: on ? /*#__PURE__*/_jsx(View, {
|
|
125
|
+
style: s.radioDot
|
|
126
|
+
}) : null
|
|
127
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
128
|
+
weight: on ? 'semibold' : undefined,
|
|
129
|
+
style: s.quantity,
|
|
130
|
+
children: qty
|
|
131
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
132
|
+
weight: on ? 'semibold' : undefined,
|
|
133
|
+
children: formatPrice(q.price)
|
|
134
|
+
})]
|
|
135
|
+
}, q.quantity);
|
|
136
|
+
})
|
|
137
|
+
}), onAdd ? /*#__PURE__*/_jsx(Button, {
|
|
138
|
+
size: "lg",
|
|
139
|
+
disabled: !selected,
|
|
140
|
+
onPress: onAdd,
|
|
141
|
+
children: selected ? `${formatPrice(selected.price)} 담기` : '담기'
|
|
142
|
+
}) : null]
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=supply-item-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Button","ChipGroup","Photo","formatPrice","Text","PressableBase","makeStyles","Card","jsx","_jsx","jsxs","_jsxs","useStyles","t","card","gap","space","head","flexDirection","alignItems","image","width","name","flex","group","borderWidth","borderColor","colors","border","borderRadius","overflow","row","minHeight","paddingHorizontal","divided","borderTopWidth","borderTopColor","pressed","backgroundColor","muted","radio","height","input","justifyContent","radioOn","primary","radioDot","quantity","SupplyItemCard","options","selectedOptionId","onSelectOption","quantities","selectedQuantity","onSelectQuantity","unit","onAdd","style","s","selected","find","q","children","source","variant","weight","length","items","map","o","value","id","label","onValueChange","accessibilityRole","i","on","qty","accessibilityState","accessibilityLabel","price","pressedStyle","onPress","undefined","size","disabled"],"sourceRoot":"../../../../src","sources":["blocks/supply-item-card/supply-item-card.tsx"],"mappings":";;AAAA,SACEA,IAAI,QAIC,cAAc;AACrB,SAASC,MAAM,QAAQ,mCAAgC;AACvD,SAASC,SAAS,QAAQ,2CAAwC;AAClE,SAASC,KAAK,QAAQ,iCAA8B;AACpD,SAASC,WAAW,QAAQ,iCAA8B;AAC1D,SAASC,IAAI,QAAQ,+BAA4B;AACjD,SAASC,aAAa,QAAQ,kCAA+B;AAC7D,SAASC,UAAU,QAAQ,uBAAoB;AAC/C,SAASC,IAAI,QAAQ,qBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAoBxC,MAAMC,SAAS,GAAGN,UAAU,CAAEO,CAAC,KAAM;EACnCC,IAAI,EAAE;IAAEC,GAAG,EAAEF,CAAC,CAACG,KAAK,CAAC,CAAC;EAAE,CAAC;EACzBC,IAAI,EAAE;IAAEC,aAAa,EAAE,KAAK;IAAEC,UAAU,EAAE,QAAQ;IAAEJ,GAAG,EAAEF,CAAC,CAACG,KAAK,CAAC,CAAC;EAAE,CAAC;EACrEI,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAG,CAAC;EACpBC,IAAI,EAAE;IAAEC,IAAI,EAAE;EAAE,CAAC;EACjBC,KAAK,EAAE;IACLC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEb,CAAC,CAACc,MAAM,CAACC,MAAM;IAC5BC,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDC,GAAG,EAAE;IACHb,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBJ,GA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B,KAAK,CAAC,KAAK,GAAG;IAAI,CAChD,CAAC,GACP,IAAI;EAAA,CACJ,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LineChart","Sparkline"],"sourceRoot":"../../../src","sources":["charts/index.ts"],"mappings":";;AAAA,SAASA,SAAS,QAA8C,iBAAc;AAC9E,SAASC,SAAS,QAA6B,gBAAa","ignoreList":[]}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import Svg, { Circle, Line, Path, Rect, Text as SvgText } from 'react-native-svg';
|
|
6
|
+
import { formatPrice } from "../components/price/price.js";
|
|
7
|
+
import { useTheme } from "../theme/theme-provider.js";
|
|
8
|
+
import { areaPath, labelStep, linearScale, linePath, niceTicks } from "./scale.js";
|
|
9
|
+
import { summarize } from "./summary.js";
|
|
10
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const defaultFormat = v => formatPrice(v, '');
|
|
12
|
+
const PAD = {
|
|
13
|
+
top: 8,
|
|
14
|
+
right: 12,
|
|
15
|
+
bottom: 24,
|
|
16
|
+
gap: 8
|
|
17
|
+
};
|
|
18
|
+
const FONT_SIZE = 11;
|
|
19
|
+
const WIDE = /[\u1100-\u11ff\u3000-\u9fff\uac00-\ud7af\uff00-\uffef]/;
|
|
20
|
+
const NARROW = /[,.:'\s]/;
|
|
21
|
+
export function estimateLabelWidth(label, fontSize = FONT_SIZE) {
|
|
22
|
+
let em = 0;
|
|
23
|
+
for (const ch of label) {
|
|
24
|
+
em += WIDE.test(ch) ? 1 : NARROW.test(ch) ? 0.34 : 0.64;
|
|
25
|
+
}
|
|
26
|
+
return Math.ceil(em * fontSize) + 2;
|
|
27
|
+
}
|
|
28
|
+
export function LineChart({
|
|
29
|
+
data,
|
|
30
|
+
height = 200,
|
|
31
|
+
formatY = defaultFormat,
|
|
32
|
+
formatX = label => label,
|
|
33
|
+
onPointPress,
|
|
34
|
+
accessibilityLabel,
|
|
35
|
+
style
|
|
36
|
+
}) {
|
|
37
|
+
const t = useTheme();
|
|
38
|
+
const [width, setWidth] = useState(0);
|
|
39
|
+
const values = data.map(d => d.value);
|
|
40
|
+
const ticks = niceTicks(Math.min(0, ...values), Math.max(0, ...values));
|
|
41
|
+
const yLabels = ticks.map(formatY);
|
|
42
|
+
const left = Math.max(0, ...yLabels.map(l => estimateLabelWidth(l))) + PAD.gap;
|
|
43
|
+
const plot = {
|
|
44
|
+
x0: left,
|
|
45
|
+
x1: width - PAD.right,
|
|
46
|
+
y0: PAD.top,
|
|
47
|
+
y1: height - PAD.bottom
|
|
48
|
+
};
|
|
49
|
+
const y = linearScale([ticks[0], ticks[ticks.length - 1]], [plot.y1, plot.y0]);
|
|
50
|
+
const x = linearScale([0, Math.max(1, data.length - 1)], [plot.x0, plot.x1]);
|
|
51
|
+
const points = data.map((d, i) => ({
|
|
52
|
+
x: data.length === 1 ? (plot.x0 + plot.x1) / 2 : x(i),
|
|
53
|
+
y: y(d.value)
|
|
54
|
+
}));
|
|
55
|
+
const step = labelStep(data.length, Math.max(1, Math.floor((plot.x1 - plot.x0) / 56)));
|
|
56
|
+
const last = points[points.length - 1];
|
|
57
|
+
const slot = data.length > 1 ? (plot.x1 - plot.x0) / (data.length - 1) : plot.x1 - plot.x0;
|
|
58
|
+
return /*#__PURE__*/_jsx(View, {
|
|
59
|
+
accessible: true,
|
|
60
|
+
accessibilityRole: "image",
|
|
61
|
+
accessibilityLabel: accessibilityLabel ?? summarize(values, formatY),
|
|
62
|
+
onLayout: e => setWidth(e.nativeEvent.layout.width),
|
|
63
|
+
style: [{
|
|
64
|
+
height
|
|
65
|
+
}, style],
|
|
66
|
+
children: width > 0 ? /*#__PURE__*/_jsxs(Svg, {
|
|
67
|
+
width: width,
|
|
68
|
+
height: height,
|
|
69
|
+
children: [ticks.map((tick, i) => /*#__PURE__*/_jsx(Line, {
|
|
70
|
+
x1: plot.x0,
|
|
71
|
+
x2: plot.x1,
|
|
72
|
+
y1: y(tick),
|
|
73
|
+
y2: y(tick),
|
|
74
|
+
stroke: t.colors.border,
|
|
75
|
+
strokeWidth: 1,
|
|
76
|
+
strokeDasharray: i === 0 ? undefined : '3 4'
|
|
77
|
+
}, `g${tick}`)), ticks.map((tick, i) => /*#__PURE__*/_jsx(SvgText, {
|
|
78
|
+
x: plot.x0 - PAD.gap,
|
|
79
|
+
y: y(tick) + FONT_SIZE / 3,
|
|
80
|
+
fontSize: FONT_SIZE,
|
|
81
|
+
fontFamily: t.fontFamily,
|
|
82
|
+
fill: t.colors.mutedForeground,
|
|
83
|
+
textAnchor: "end",
|
|
84
|
+
children: yLabels[i]
|
|
85
|
+
}, `y${tick}`)), data.map((d, i) => i % step === 0 || i === data.length - 1 ? /*#__PURE__*/_jsx(SvgText, {
|
|
86
|
+
x: points[i].x,
|
|
87
|
+
y: height - 6,
|
|
88
|
+
fontSize: FONT_SIZE,
|
|
89
|
+
fontFamily: t.fontFamily,
|
|
90
|
+
fill: t.colors.mutedForeground,
|
|
91
|
+
textAnchor: i === 0 && data.length > 1 ? 'start' : i === data.length - 1 && data.length > 1 ? 'end' : 'middle',
|
|
92
|
+
children: formatX(d.label, i)
|
|
93
|
+
}, `x${i}`) : null), points.length > 1 ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
94
|
+
children: [/*#__PURE__*/_jsx(Path, {
|
|
95
|
+
d: areaPath(points, plot.y1),
|
|
96
|
+
fill: t.colors.primary,
|
|
97
|
+
fillOpacity: 0.12
|
|
98
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
99
|
+
d: linePath(points),
|
|
100
|
+
fill: "none",
|
|
101
|
+
stroke: t.colors.primary,
|
|
102
|
+
strokeWidth: 2,
|
|
103
|
+
strokeLinejoin: "round",
|
|
104
|
+
strokeLinecap: "round"
|
|
105
|
+
})]
|
|
106
|
+
}) : null, last ? /*#__PURE__*/_jsx(Circle, {
|
|
107
|
+
cx: last.x,
|
|
108
|
+
cy: last.y,
|
|
109
|
+
r: 4,
|
|
110
|
+
fill: t.colors.primary,
|
|
111
|
+
stroke: t.colors.background,
|
|
112
|
+
strokeWidth: 2
|
|
113
|
+
}) : null, onPointPress ? data.map((d, i) => /*#__PURE__*/_jsx(Rect, {
|
|
114
|
+
x: points[i].x - slot / 2,
|
|
115
|
+
y: plot.y0,
|
|
116
|
+
width: slot,
|
|
117
|
+
height: plot.y1 - plot.y0,
|
|
118
|
+
fill: "transparent",
|
|
119
|
+
onPress: () => onPointPress(d, i)
|
|
120
|
+
}, `hit${i}`)) : null]
|
|
121
|
+
}) : null
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=line-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","View","Svg","Circle","Line","Path","Rect","Text","SvgText","formatPrice","useTheme","areaPath","labelStep","linearScale","linePath","niceTicks","summarize","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","defaultFormat","v","PAD","top","right","bottom","gap","FONT_SIZE","WIDE","NARROW","estimateLabelWidth","label","fontSize","em","ch","test","Math","ceil","LineChart","data","height","formatY","formatX","onPointPress","accessibilityLabel","style","t","width","setWidth","values","map","d","value","ticks","min","max","yLabels","left","l","plot","x0","x1","y0","y1","y","length","x","points","i","step","floor","last","slot","accessible","accessibilityRole","onLayout","e","nativeEvent","layout","children","tick","x2","y2","stroke","colors","border","strokeWidth","strokeDasharray","undefined","fontFamily","fill","mutedForeground","textAnchor","primary","fillOpacity","strokeLinejoin","strokeLinecap","cx","cy","r","background","onPress"],"sourceRoot":"../../../src","sources":["charts/line-chart.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,IAAI,QAAwC,cAAc;AACnE,OAAOC,GAAG,IACRC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,IAAI,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J,IAAI,CAACW,GAAG,CAAC,CAACC,CAAC,EAAEiB,CAAC,kBACZrD,IAAA,CAACZ,IAAI;QAEH+D,CAAC,EAAEC,MAAM,CAACC,CAAC,CAAC,CAAEF,CAAC,GAAGM,IAAI,GAAG,CAAE;QAC3BR,CAAC,EAAEL,IAAI,CAACG,EAAG;QACXf,KAAK,EAAEyB,IAAK;QACZhC,MAAM,EAAEmB,IAAI,CAACI,EAAE,GAAGJ,IAAI,CAACG,EAAG;QAC1B4B,IAAI,EAAC,aAAa;QAClBW,OAAO,EAAEA,CAAA,KAAM1D,YAAY,CAACQ,CAAC,EAAEiB,CAAC;MAAE,GAN7B,MAAMA,CAAC,EAOb,CACF,CAAC,GACF,IAAI;IAAA,CACL,CAAC,GACJ;EAAI,CACJ,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const STEPS = [1, 2, 2.5, 5, 10];
|
|
4
|
+
export function niceTicks(min, max, count = 4) {
|
|
5
|
+
let lo = Math.min(min, max);
|
|
6
|
+
let hi = Math.max(min, max);
|
|
7
|
+
if (!Number.isFinite(lo) || !Number.isFinite(hi)) return [0, 1];
|
|
8
|
+
if (lo === hi) {
|
|
9
|
+
if (hi === 0) hi = 1;else if (hi > 0) lo = 0;else hi = 0;
|
|
10
|
+
}
|
|
11
|
+
const raw = (hi - lo) / Math.max(1, count - 1);
|
|
12
|
+
const magnitude = 10 ** Math.floor(Math.log10(raw));
|
|
13
|
+
const step = (STEPS.find(s => s * magnitude >= raw) ?? 10) * magnitude;
|
|
14
|
+
const start = Math.floor(lo / step) * step;
|
|
15
|
+
const end = Math.ceil(hi / step) * step;
|
|
16
|
+
const ticks = [];
|
|
17
|
+
for (let v = start; v <= end + step / 2; v += step) {
|
|
18
|
+
ticks.push(Math.round(v / step) * step);
|
|
19
|
+
}
|
|
20
|
+
return ticks;
|
|
21
|
+
}
|
|
22
|
+
export function linearScale(domain, range) {
|
|
23
|
+
const [d0, d1] = domain;
|
|
24
|
+
const [r0, r1] = range;
|
|
25
|
+
return v => d1 === d0 ? (r0 + r1) / 2 : r0 + (v - d0) / (d1 - d0) * (r1 - r0);
|
|
26
|
+
}
|
|
27
|
+
export function linePath(points) {
|
|
28
|
+
return points.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`).join(' ');
|
|
29
|
+
}
|
|
30
|
+
export function areaPath(points, baseline) {
|
|
31
|
+
if (points.length === 0) return '';
|
|
32
|
+
const first = points[0];
|
|
33
|
+
const last = points[points.length - 1];
|
|
34
|
+
return `${linePath(points)} L${last.x},${baseline} L${first.x},${baseline} Z`;
|
|
35
|
+
}
|
|
36
|
+
export function labelStep(count, maxLabels) {
|
|
37
|
+
return Math.max(1, Math.ceil(count / Math.max(1, maxLabels)));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=scale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["STEPS","niceTicks","min","max","count","lo","Math","hi","Number","isFinite","raw","magnitude","floor","log10","step","find","s","start","end","ceil","ticks","v","push","round","linearScale","domain","range","d0","d1","r0","r1","linePath","points","map","p","i","x","y","join","areaPath","baseline","length","first","last","labelStep","maxLabels"],"sourceRoot":"../../../src","sources":["charts/scale.ts"],"mappings":";;AAEA,MAAMA,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;AAEhC,OAAO,SAASC,SAASA,CAACC,GAAW,EAAEC,GAAW,EAAEC,KAAK,GAAG,CAAC,EAAY;EACvE,IAAIC,EAAE,GAAGC,IAAI,CAACJ,GAAG,CAACA,GAAG,EAAEC,GAAG,CAAC;EAC3B,IAAII,EAAE,GAAGD,IAAI,CAACH,GAAG,CAACD,GAAG,EAAEC,GAAG,CAAC;EAC3B,IAAI,CAACK,MAAM,CAACC,QAAQ,CAACJ,EAAE,CAAC,IAAI,CAACG,MAAM,CAACC,QA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+
import { formatPrice } from "../components/price/price.js";
|
|
6
|
+
import { useTheme } from "../theme/theme-provider.js";
|
|
7
|
+
import { linearScale, linePath } from "./scale.js";
|
|
8
|
+
import { summarize } from "./summary.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export function Sparkline({
|
|
11
|
+
data,
|
|
12
|
+
width = 80,
|
|
13
|
+
height = 24,
|
|
14
|
+
color,
|
|
15
|
+
accessibilityLabel,
|
|
16
|
+
style
|
|
17
|
+
}) {
|
|
18
|
+
const t = useTheme();
|
|
19
|
+
const values = [...data];
|
|
20
|
+
const stroke = 1.5;
|
|
21
|
+
const y = linearScale([Math.min(...values), Math.max(...values)], [height - stroke, stroke]);
|
|
22
|
+
const x = linearScale([0, Math.max(1, values.length - 1)], [stroke, width - stroke]);
|
|
23
|
+
const points = values.map((v, i) => ({
|
|
24
|
+
x: x(i),
|
|
25
|
+
y: y(v)
|
|
26
|
+
}));
|
|
27
|
+
return /*#__PURE__*/_jsx(View, {
|
|
28
|
+
accessible: true,
|
|
29
|
+
accessibilityRole: "image",
|
|
30
|
+
accessibilityLabel: accessibilityLabel ?? summarize(values, v => formatPrice(v, '')),
|
|
31
|
+
style: [{
|
|
32
|
+
width,
|
|
33
|
+
height
|
|
34
|
+
}, style],
|
|
35
|
+
children: points.length > 1 ? /*#__PURE__*/_jsx(Svg, {
|
|
36
|
+
width: width,
|
|
37
|
+
height: height,
|
|
38
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
39
|
+
d: linePath(points),
|
|
40
|
+
fill: "none",
|
|
41
|
+
stroke: color ?? t.colors.primary,
|
|
42
|
+
strokeWidth: stroke,
|
|
43
|
+
strokeLinejoin: "round",
|
|
44
|
+
strokeLinecap: "round"
|
|
45
|
+
})
|
|
46
|
+
}) : null
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=sparkline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Svg","Path","formatPrice","useTheme","linearScale","linePath","summarize","jsx","_jsx","Sparkline","data","width","height","color","accessibilityLabel","style","t","values","stroke","y","Math","min","max","x","length","points","map","v","i","accessible","accessibilityRole","children","d","fill","colors","primary","strokeWidth","strokeLinejoin","strokeLinecap"],"sourceRoot":"../../../src","sources":["charts/sparkline.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAwC,cAAc;AACnE,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,QAAQ,8BAA2B;AACvD,SAASC,QAAQ,QAAQ,4BAAyB;AAClD,SAASC,WAAW,EAAEC,QAAQ,QAAQ,YAAS;AAC/C,SAASC,SAAS,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWtC,OAAO,SAASC,SAASA,CAAC;EACxBC,IAAI;EACJC,KAAK,GAAG,EAAE;EACVC,MAAM,GAAG,EAAE;EACXC,KAAK;EACLC,kBAAkB;EAClBC;AACc,CAAC,EAAE;EACjB,MAAMC,CAAC,GAAGb,QAAQ,CAAC,CAAC;EACpB,MAAMc,MAAM,GAAG,CAAC,GAAGP,IAAI,CAAC;EACxB,MAAMQ,MAAM,GAAG,GAAG;EAClB,MAAMC,CAAC,GAAGf,WAAW,CACnB,CAACgB,IAAI,CAACC,GAAG,CAAC,GAAGJ,MAAM,CAAC,EAAEG,IAAI,CAACE,GAAG,CAAC,GAAGL,MAAM,CAAC,CAAC,EAC1C,CAACL,MAAM,GAAGM,MAAM,EAAEA,MAAM,CAC1B,CAAC;EACD,MAAMK,CAAC,GAAGnB,WAAW,CACnB,CAAC,CAAC,EAAEgB,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEL,MAAM,CAACO,MAAM,GAAG,CAAC,CAAC,CAAC,EACnC,CAACN,MAAM,EAAEP,KAAK,GAAGO,MAAM,CACzB,CAAC;EACD,MAAMO,MAAM,GAAGR,MAAM,CAACS,GAAG,CAAC,CAACC,CAAC,EAAEC,CAAC,MAAM;IAAEL,CAAC,EAAEA,CAAC,CAACK,CAAC,CAAC;IAAET,CAAC,EAAEA,CAAC,CAACQ,CAAC;EAAE,CAAC,CAAC,CAAC;EAC3D,oBACEnB,IAAA,CAACT,IAAI;IACH8B,UAAU;IACVC,iBAAiB,EAAC,OAAO;IACzBhB,kBAAkB,EAChBA,kBAAkB,IAAIR,SAAS,CAACW,MAAM,EAAGU,CAAC,IAAKzB,WAAW,CAACyB,CAAC,EAAE,EAAE,CAAC,CAClE;IACDZ,KAAK,EAAE,CAAC;MAAEJ,KAAK;MAAEC;IAAO,CAAC,EAAEG,KAAK,CAAE;IAAAgB,QAAA,EAEjCN,MAAM,CAACD,MAAM,GAAG,CAAC,gBAChBhB,IAAA,CAACR,GAAG;MAACW,KAAK,EAAEA,KAAM;MAACC,MAAM,EAAEA,MAAO;MAAAmB,QAAA,eAChCvB,IAAA,CAACP,IAAI;QACH+B,CAAC,EAAE3B,QAAQ,CAACoB,MAAM,CAAE;QACpBQ,IAAI,EAAC,MAAM;QACXf,MAAM,EAAEL,KAAK,IAAIG,CAAC,CAACkB,MAAM,CAACC,OAAQ;QAClCC,WAAW,EAAElB,MAAO;QACpBmB,cAAc,EAAC,OAAO;QACtBC,aAAa,EAAC;MAAO,CACtB;IAAC,CACC,CAAC,GACJ;EAAI,CACJ,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function summarize(values, format) {
|
|
4
|
+
if (values.length === 0) return '데이터 없음';
|
|
5
|
+
const max = Math.max(...values);
|
|
6
|
+
const min = Math.min(...values);
|
|
7
|
+
const last = values[values.length - 1];
|
|
8
|
+
return `${values.length}개 구간, 최고 ${format(max)}, 최저 ${format(min)}, 마지막 ${format(last)}`;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["summarize","values","format","length","max","Math","min","last"],"sourceRoot":"../../../src","sources":["charts/summary.ts"],"mappings":";;AAAA,OAAO,SAASA,SAASA,CACvBC,MAAgB,EAChBC,MAA6B,EACrB;EACR,IAAID,MAAM,CAACE,MAAM,KAAK,CAAC,EAAE,OAAO,QAAQ;EACxC,MAAMC,GAAG,GAAGC,IAAI,CAACD,GAAG,CAAC,GAAGH,MAAM,CAAC;EAC/B,MAAMK,GAAG,GAAGD,IAAI,CAACC,GAAG,CAAC,GAAGL,MAAM,CAAC;EAC/B,MAAMM,IAAI,GAAGN,MAAM,CAACA,MAAM,CAACE,MAAM,GAAG,CAAC,CAAE;EACvC,OAAO,GAAGF,MAAM,CAACE,MAAM,YAAYD,MAAM,CAACE,GAAG,CAAC,QAAQF,MAAM,CAACI,GAAG,CAAC,SAASJ,MAAM,CAACK,IAAI,CAAC,EAAE;AAC1F","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["charts.tsx"],"mappings":";;AAAA,cAAc,mBAAgB;AAC9B,cAAc,+BAA4B","ignoreList":[]}
|