@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,248 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
useContext,
|
|
4
|
+
useEffect,
|
|
5
|
+
useId,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
useSyncExternalStore,
|
|
9
|
+
type ReactNode,
|
|
10
|
+
} from 'react';
|
|
11
|
+
import {
|
|
12
|
+
AccessibilityInfo,
|
|
13
|
+
Animated,
|
|
14
|
+
Platform,
|
|
15
|
+
Text,
|
|
16
|
+
View,
|
|
17
|
+
} from 'react-native';
|
|
18
|
+
import { useNativeDriver } from '../../internal/overlay';
|
|
19
|
+
import { PressableBase } from '../../internal/pressable-base';
|
|
20
|
+
import { useReducedMotion } from '../../internal/use-reduced-motion';
|
|
21
|
+
import { useTheme } from '../../theme/theme-provider';
|
|
22
|
+
import { makeStyles } from '../../utils/styles';
|
|
23
|
+
|
|
24
|
+
export type ToastTone = 'neutral' | 'success' | 'destructive';
|
|
25
|
+
|
|
26
|
+
export type ToastOptions = {
|
|
27
|
+
message: string;
|
|
28
|
+
/** 기본 'neutral' */
|
|
29
|
+
tone?: ToastTone;
|
|
30
|
+
/** ms. 기본 2500, action이 있으면 4000 */
|
|
31
|
+
duration?: number;
|
|
32
|
+
/** 메시지 오른쪽 텍스트 버튼 (예: 실행 취소). 누르면 Toast가 닫힌다 */
|
|
33
|
+
action?: ToastAction;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type ToastAction = { label: string; onPress: () => void };
|
|
37
|
+
|
|
38
|
+
type Current = {
|
|
39
|
+
id: number;
|
|
40
|
+
message: string;
|
|
41
|
+
tone: ToastTone;
|
|
42
|
+
action?: ToastAction;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** Provider 하나가 가진 상태. show를 불러도 Provider 아래 화면은 다시 렌더링되지 않는다. */
|
|
46
|
+
function createToastStore() {
|
|
47
|
+
let current: Current | null = null;
|
|
48
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
49
|
+
let seq = 0;
|
|
50
|
+
let hosts: string[] = [];
|
|
51
|
+
const listeners = new Set<() => void>();
|
|
52
|
+
const emit = () => listeners.forEach((l) => l());
|
|
53
|
+
|
|
54
|
+
const hide = () => {
|
|
55
|
+
clearTimeout(timer);
|
|
56
|
+
current = null;
|
|
57
|
+
emit();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
bottomInset: 0,
|
|
62
|
+
subscribe(listener: () => void) {
|
|
63
|
+
listeners.add(listener);
|
|
64
|
+
return () => {
|
|
65
|
+
listeners.delete(listener);
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
getCurrent: () => current,
|
|
69
|
+
/** 가장 나중에 붙은 host(가장 위의 Modal)만 그린다 */
|
|
70
|
+
getTopHost: () => hosts[hosts.length - 1],
|
|
71
|
+
addHost(id: string) {
|
|
72
|
+
hosts = [...hosts, id];
|
|
73
|
+
emit();
|
|
74
|
+
return () => {
|
|
75
|
+
hosts = hosts.filter((h) => h !== id);
|
|
76
|
+
emit();
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
show({ message, tone = 'neutral', duration, action }: ToastOptions) {
|
|
80
|
+
clearTimeout(timer);
|
|
81
|
+
current = { id: ++seq, message, tone, action };
|
|
82
|
+
timer = setTimeout(hide, duration ?? (action ? 4000 : 2500));
|
|
83
|
+
emit();
|
|
84
|
+
if (Platform.OS === 'ios')
|
|
85
|
+
AccessibilityInfo.announceForAccessibility(message);
|
|
86
|
+
},
|
|
87
|
+
hide,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
type ToastStore = ReturnType<typeof createToastStore>;
|
|
92
|
+
|
|
93
|
+
const StoreContext = createContext<ToastStore | null>(null);
|
|
94
|
+
|
|
95
|
+
export type ToastProviderProps = {
|
|
96
|
+
/** 하단 안전 영역 높이. 앱의 safe-area 값을 넘긴다 */
|
|
97
|
+
bottomInset?: number;
|
|
98
|
+
children: ReactNode;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export function ToastProvider({
|
|
102
|
+
bottomInset = 0,
|
|
103
|
+
children,
|
|
104
|
+
}: ToastProviderProps) {
|
|
105
|
+
const [store] = useState(createToastStore);
|
|
106
|
+
store.bottomInset = bottomInset;
|
|
107
|
+
useEffect(() => () => store.hide(), [store]);
|
|
108
|
+
return (
|
|
109
|
+
<StoreContext.Provider value={store}>
|
|
110
|
+
{children}
|
|
111
|
+
<ToastHost />
|
|
112
|
+
</StoreContext.Provider>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function useToast(): { show: (options: ToastOptions) => void } {
|
|
117
|
+
const store = useContext(StoreContext);
|
|
118
|
+
if (!store) throw new Error('useToast must be used inside <ToastProvider>.');
|
|
119
|
+
return store;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const useStyles = makeStyles((t) => ({
|
|
123
|
+
layer: {
|
|
124
|
+
position: 'absolute',
|
|
125
|
+
left: t.space[4],
|
|
126
|
+
right: t.space[4],
|
|
127
|
+
alignItems: 'center',
|
|
128
|
+
},
|
|
129
|
+
toast: {
|
|
130
|
+
flexDirection: 'row',
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
maxWidth: 480,
|
|
133
|
+
minHeight: 48,
|
|
134
|
+
paddingHorizontal: t.space[4],
|
|
135
|
+
paddingVertical: t.space[3],
|
|
136
|
+
borderRadius: t.radius.md,
|
|
137
|
+
boxShadow: t.shadow.md,
|
|
138
|
+
},
|
|
139
|
+
withAction: {
|
|
140
|
+
alignSelf: 'stretch',
|
|
141
|
+
paddingVertical: 0,
|
|
142
|
+
paddingRight: t.space[2],
|
|
143
|
+
},
|
|
144
|
+
message: { ...t.typography.body, flexShrink: 1, fontFamily: t.fontFamily },
|
|
145
|
+
messageFill: { flex: 1, fontSize: 14 },
|
|
146
|
+
action: { paddingHorizontal: t.space[3], justifyContent: 'center' },
|
|
147
|
+
actionLabel: {
|
|
148
|
+
fontFamily: t.fontFamily,
|
|
149
|
+
fontSize: 14,
|
|
150
|
+
lineHeight: 20,
|
|
151
|
+
fontWeight: '700',
|
|
152
|
+
},
|
|
153
|
+
}));
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Toast를 그리는 자리. Provider가 하나 두고, Modal을 쓰는 컴포넌트(Sheet · Dialog)가
|
|
157
|
+
* Modal 안에 하나씩 더 둔다. 가장 위의 host만 그린다.
|
|
158
|
+
*/
|
|
159
|
+
export function ToastHost() {
|
|
160
|
+
const store = useContext(StoreContext);
|
|
161
|
+
return store ? <ToastHostInner store={store} /> : null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function ToastHostInner({ store }: { store: ToastStore }) {
|
|
165
|
+
const t = useTheme();
|
|
166
|
+
const s = useStyles();
|
|
167
|
+
const id = useId();
|
|
168
|
+
const reduced = useReducedMotion();
|
|
169
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
170
|
+
const current = useSyncExternalStore(store.subscribe, store.getCurrent);
|
|
171
|
+
const isTop = useSyncExternalStore(
|
|
172
|
+
store.subscribe,
|
|
173
|
+
() => store.getTopHost() === id
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
useEffect(() => store.addHost(id), [store, id]);
|
|
177
|
+
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
if (!current) return;
|
|
180
|
+
opacity.setValue(reduced ? 1 : 0);
|
|
181
|
+
if (reduced) return;
|
|
182
|
+
const animation = Animated.timing(opacity, {
|
|
183
|
+
toValue: 1,
|
|
184
|
+
duration: t.motion.duration,
|
|
185
|
+
useNativeDriver,
|
|
186
|
+
});
|
|
187
|
+
animation.start();
|
|
188
|
+
return () => animation.stop();
|
|
189
|
+
}, [current, opacity, reduced, t.motion.duration]);
|
|
190
|
+
|
|
191
|
+
if (!current || !isTop) return null;
|
|
192
|
+
|
|
193
|
+
const [bg, fg] = {
|
|
194
|
+
neutral: [t.colors.foreground, t.colors.background],
|
|
195
|
+
success: [t.colors.success, t.colors.successForeground],
|
|
196
|
+
destructive: [t.colors.destructive, t.colors.destructiveForeground],
|
|
197
|
+
}[current.tone];
|
|
198
|
+
// 어두운 바탕(light) 위에서는 밝은 파랑, 밝은 바탕(dark) 위에서는 진한 파랑
|
|
199
|
+
const actionColor =
|
|
200
|
+
current.tone !== 'neutral'
|
|
201
|
+
? fg
|
|
202
|
+
: t.scheme === 'light'
|
|
203
|
+
? '#93c5fd'
|
|
204
|
+
: '#1d4ed8';
|
|
205
|
+
|
|
206
|
+
return (
|
|
207
|
+
<View
|
|
208
|
+
pointerEvents="box-none"
|
|
209
|
+
style={[s.layer, { bottom: t.space[4] + store.bottomInset }]}
|
|
210
|
+
>
|
|
211
|
+
<Animated.View
|
|
212
|
+
accessibilityRole="alert"
|
|
213
|
+
accessibilityLiveRegion="polite"
|
|
214
|
+
style={[
|
|
215
|
+
s.toast,
|
|
216
|
+
!!current.action && s.withAction,
|
|
217
|
+
{ backgroundColor: bg, opacity },
|
|
218
|
+
]}
|
|
219
|
+
>
|
|
220
|
+
<Text
|
|
221
|
+
maxFontSizeMultiplier={t.maxFontScale}
|
|
222
|
+
style={[s.message, !!current.action && s.messageFill, { color: fg }]}
|
|
223
|
+
>
|
|
224
|
+
{current.message}
|
|
225
|
+
</Text>
|
|
226
|
+
{current.action ? (
|
|
227
|
+
<PressableBase
|
|
228
|
+
accessibilityRole="button"
|
|
229
|
+
accessibilityLabel={current.action.label}
|
|
230
|
+
touchHeight={44}
|
|
231
|
+
style={s.action}
|
|
232
|
+
onPress={() => {
|
|
233
|
+
current.action?.onPress();
|
|
234
|
+
store.hide();
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
<Text
|
|
238
|
+
maxFontSizeMultiplier={t.maxFontScale}
|
|
239
|
+
style={[s.actionLabel, { color: actionColor }]}
|
|
240
|
+
>
|
|
241
|
+
{current.action.label}
|
|
242
|
+
</Text>
|
|
243
|
+
</PressableBase>
|
|
244
|
+
) : null}
|
|
245
|
+
</Animated.View>
|
|
246
|
+
</View>
|
|
247
|
+
);
|
|
248
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WizardSteps, type WizardStepsProps } from './wizard-steps';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Text, View, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { useTheme } from '../../theme/theme-provider';
|
|
3
|
+
import { makeStyles } from '../../utils/styles';
|
|
4
|
+
|
|
5
|
+
export type WizardStepsProps = {
|
|
6
|
+
/** 단계 이름 */
|
|
7
|
+
steps: readonly string[];
|
|
8
|
+
/** 지금 단계 (0부터) */
|
|
9
|
+
current: number;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const useStyles = makeStyles((t) => ({
|
|
14
|
+
root: { gap: t.space[2] },
|
|
15
|
+
bar: { flexDirection: 'row', gap: t.space[1] },
|
|
16
|
+
segment: {
|
|
17
|
+
flex: 1,
|
|
18
|
+
height: 4,
|
|
19
|
+
borderRadius: t.radius.full,
|
|
20
|
+
backgroundColor: t.colors.muted,
|
|
21
|
+
},
|
|
22
|
+
done: { backgroundColor: t.colors.primary },
|
|
23
|
+
label: {
|
|
24
|
+
...t.typography.caption,
|
|
25
|
+
fontFamily: t.fontFamily,
|
|
26
|
+
color: t.colors.mutedForeground,
|
|
27
|
+
},
|
|
28
|
+
name: { color: t.colors.foreground, fontWeight: '600' },
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
/** 여러 단계로 나뉜 입력 흐름의 진행 표시 */
|
|
32
|
+
export function WizardSteps({ steps, current, style }: WizardStepsProps) {
|
|
33
|
+
const t = useTheme();
|
|
34
|
+
const s = useStyles();
|
|
35
|
+
const index = Math.min(Math.max(current, 0), steps.length - 1);
|
|
36
|
+
return (
|
|
37
|
+
<View
|
|
38
|
+
style={[s.root, style]}
|
|
39
|
+
accessible
|
|
40
|
+
accessibilityRole="progressbar"
|
|
41
|
+
accessibilityLabel={`${steps.length}단계 중 ${index + 1}단계, ${steps[index] ?? ''}`}
|
|
42
|
+
accessibilityValue={{ min: 1, max: steps.length, now: index + 1 }}
|
|
43
|
+
>
|
|
44
|
+
<View style={s.bar}>
|
|
45
|
+
{steps.map((step, i) => (
|
|
46
|
+
<View key={step} style={[s.segment, i <= index && s.done]} />
|
|
47
|
+
))}
|
|
48
|
+
</View>
|
|
49
|
+
<Text maxFontSizeMultiplier={t.maxFontScale} style={s.label}>
|
|
50
|
+
{index + 1}/{steps.length} · <Text style={s.name}>{steps[index]}</Text>
|
|
51
|
+
</Text>
|
|
52
|
+
</View>
|
|
53
|
+
);
|
|
54
|
+
}
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export { createTheme, defaultThemes } from './theme/create-theme';
|
|
2
|
+
export {
|
|
3
|
+
ThemeProvider,
|
|
4
|
+
useTheme,
|
|
5
|
+
type ThemeProviderProps,
|
|
6
|
+
} from './theme/theme-provider';
|
|
7
|
+
export { makeStyles } from './utils/styles';
|
|
8
|
+
export {
|
|
9
|
+
PressableBase,
|
|
10
|
+
type PressableBaseProps,
|
|
11
|
+
} from './internal/pressable-base';
|
|
12
|
+
export type { IconRenderProps, IconSlot } from './internal/icon';
|
|
13
|
+
export { renderIcon } from './internal/icon';
|
|
14
|
+
export {
|
|
15
|
+
AlertGlyph,
|
|
16
|
+
CheckGlyph,
|
|
17
|
+
ChevronGlyph,
|
|
18
|
+
CloseGlyph,
|
|
19
|
+
PlusGlyph,
|
|
20
|
+
SearchGlyph,
|
|
21
|
+
} from './internal/glyphs';
|
|
22
|
+
export { contrastRatio, pickForeground } from './utils/color';
|
|
23
|
+
|
|
24
|
+
export * from './components/button';
|
|
25
|
+
export * from './components/checkbox';
|
|
26
|
+
export * from './components/chip';
|
|
27
|
+
export * from './components/chip-group';
|
|
28
|
+
export * from './components/dialog';
|
|
29
|
+
export * from './components/divider';
|
|
30
|
+
export * from './components/empty-state';
|
|
31
|
+
export * from './components/field';
|
|
32
|
+
export * from './components/list-row';
|
|
33
|
+
export * from './components/photo';
|
|
34
|
+
export * from './components/price';
|
|
35
|
+
export * from './components/search-field';
|
|
36
|
+
export * from './components/segmented-tabs';
|
|
37
|
+
export * from './components/sheet';
|
|
38
|
+
export * from './components/skeleton';
|
|
39
|
+
export * from './components/status-badge';
|
|
40
|
+
export * from './components/switch';
|
|
41
|
+
export * from './components/text';
|
|
42
|
+
export * from './components/toast';
|
|
43
|
+
export * from './components/wizard-steps';
|
|
44
|
+
|
|
45
|
+
export type {
|
|
46
|
+
ColorScheme,
|
|
47
|
+
Theme,
|
|
48
|
+
ThemeColors,
|
|
49
|
+
ThemeOverrides,
|
|
50
|
+
Themes,
|
|
51
|
+
ThemeTokens,
|
|
52
|
+
TypographyToken,
|
|
53
|
+
TypographyVariant,
|
|
54
|
+
} from './types';
|
|
55
|
+
|
|
56
|
+
export * from './blocks';
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import type { IconRenderProps } from './icon';
|
|
3
|
+
|
|
4
|
+
// svg 없이 그리는 최소 아이콘. 아이콘 세트는 앱이 슬롯으로 넣는다.
|
|
5
|
+
|
|
6
|
+
export function SearchGlyph({ color, size }: IconRenderProps) {
|
|
7
|
+
const ring = size * 0.62;
|
|
8
|
+
const stroke = Math.max(1.5, size / 10);
|
|
9
|
+
return (
|
|
10
|
+
<View style={{ width: size, height: size }}>
|
|
11
|
+
<View
|
|
12
|
+
style={{
|
|
13
|
+
width: ring,
|
|
14
|
+
height: ring,
|
|
15
|
+
borderRadius: ring / 2,
|
|
16
|
+
borderWidth: stroke,
|
|
17
|
+
borderColor: color,
|
|
18
|
+
}}
|
|
19
|
+
/>
|
|
20
|
+
<View
|
|
21
|
+
style={[
|
|
22
|
+
styles.absolute,
|
|
23
|
+
{
|
|
24
|
+
width: size * 0.36,
|
|
25
|
+
height: stroke,
|
|
26
|
+
backgroundColor: color,
|
|
27
|
+
borderRadius: stroke,
|
|
28
|
+
right: size * 0.02,
|
|
29
|
+
bottom: size * 0.14,
|
|
30
|
+
transform: [{ rotate: '45deg' }],
|
|
31
|
+
},
|
|
32
|
+
]}
|
|
33
|
+
/>
|
|
34
|
+
</View>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function CloseGlyph({ color, size }: IconRenderProps) {
|
|
39
|
+
const stroke = Math.max(1.5, size / 10);
|
|
40
|
+
const bar = {
|
|
41
|
+
position: 'absolute' as const,
|
|
42
|
+
width: size * 0.8,
|
|
43
|
+
height: stroke,
|
|
44
|
+
borderRadius: stroke,
|
|
45
|
+
backgroundColor: color,
|
|
46
|
+
top: (size - stroke) / 2,
|
|
47
|
+
left: size * 0.1,
|
|
48
|
+
};
|
|
49
|
+
return (
|
|
50
|
+
<View style={{ width: size, height: size }}>
|
|
51
|
+
<View style={[bar, { transform: [{ rotate: '45deg' }] }]} />
|
|
52
|
+
<View style={[bar, { transform: [{ rotate: '-45deg' }] }]} />
|
|
53
|
+
</View>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function CheckGlyph({ color, size }: IconRenderProps) {
|
|
58
|
+
const stroke = Math.max(2, size / 7);
|
|
59
|
+
return (
|
|
60
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
61
|
+
<View
|
|
62
|
+
style={{
|
|
63
|
+
width: size * 0.32,
|
|
64
|
+
height: size * 0.6,
|
|
65
|
+
marginTop: -size * 0.12,
|
|
66
|
+
borderRightWidth: stroke,
|
|
67
|
+
borderBottomWidth: stroke,
|
|
68
|
+
borderColor: color,
|
|
69
|
+
transform: [{ rotate: '45deg' }],
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
</View>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const styles = StyleSheet.create({
|
|
77
|
+
absolute: { position: 'absolute' },
|
|
78
|
+
center: { alignItems: 'center', justifyContent: 'center' },
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export function ChevronGlyph({ color, size }: IconRenderProps) {
|
|
82
|
+
const stroke = Math.max(1.5, size / 10);
|
|
83
|
+
return (
|
|
84
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
85
|
+
<View
|
|
86
|
+
style={{
|
|
87
|
+
width: size * 0.42,
|
|
88
|
+
height: size * 0.42,
|
|
89
|
+
marginLeft: -size * 0.16,
|
|
90
|
+
borderTopWidth: stroke,
|
|
91
|
+
borderRightWidth: stroke,
|
|
92
|
+
borderColor: color,
|
|
93
|
+
transform: [{ rotate: '45deg' }],
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
</View>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** filled면 원을 칠하고 느낌표를 onColor로 그린다 */
|
|
101
|
+
export function AlertGlyph({
|
|
102
|
+
color,
|
|
103
|
+
size,
|
|
104
|
+
filled = false,
|
|
105
|
+
onColor = '#ffffff',
|
|
106
|
+
}: IconRenderProps & { filled?: boolean; onColor?: string }) {
|
|
107
|
+
const stroke = Math.max(1.5, size / (filled ? 10 : 16));
|
|
108
|
+
const mark = filled ? onColor : color;
|
|
109
|
+
const ring = filled ? 0 : stroke;
|
|
110
|
+
return (
|
|
111
|
+
<View
|
|
112
|
+
style={[
|
|
113
|
+
styles.center,
|
|
114
|
+
{
|
|
115
|
+
width: size,
|
|
116
|
+
height: size,
|
|
117
|
+
borderRadius: size / 2,
|
|
118
|
+
borderWidth: ring,
|
|
119
|
+
borderColor: color,
|
|
120
|
+
backgroundColor: filled ? color : undefined,
|
|
121
|
+
},
|
|
122
|
+
]}
|
|
123
|
+
>
|
|
124
|
+
<View
|
|
125
|
+
style={{
|
|
126
|
+
width: stroke,
|
|
127
|
+
height: size * 0.28,
|
|
128
|
+
borderRadius: stroke,
|
|
129
|
+
backgroundColor: mark,
|
|
130
|
+
}}
|
|
131
|
+
/>
|
|
132
|
+
<View
|
|
133
|
+
style={{
|
|
134
|
+
width: stroke * 1.4,
|
|
135
|
+
height: stroke * 1.4,
|
|
136
|
+
marginTop: size * 0.08,
|
|
137
|
+
borderRadius: stroke,
|
|
138
|
+
backgroundColor: mark,
|
|
139
|
+
}}
|
|
140
|
+
/>
|
|
141
|
+
</View>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function PlusGlyph({ color, size }: IconRenderProps) {
|
|
146
|
+
const stroke = Math.max(1.5, size / 16);
|
|
147
|
+
const bar = {
|
|
148
|
+
position: 'absolute' as const,
|
|
149
|
+
backgroundColor: color,
|
|
150
|
+
borderRadius: stroke,
|
|
151
|
+
};
|
|
152
|
+
return (
|
|
153
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
154
|
+
<View style={[bar, { width: size * 0.6, height: stroke }]} />
|
|
155
|
+
<View style={[bar, { width: stroke, height: size * 0.6 }]} />
|
|
156
|
+
</View>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type IconRenderProps = { color: string; size: number };
|
|
4
|
+
|
|
5
|
+
/** 아이콘 자리. 함수로 넘기면 컴포넌트의 글자색과 크기를 받는다. */
|
|
6
|
+
export type IconSlot = ReactNode | ((props: IconRenderProps) => ReactNode);
|
|
7
|
+
|
|
8
|
+
export function renderIcon(slot: IconSlot, props: IconRenderProps): ReactNode {
|
|
9
|
+
return typeof slot === 'function' ? slot(props) : slot;
|
|
10
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Animated, Platform, Pressable, StyleSheet } from 'react-native';
|
|
3
|
+
import { useTheme } from '../theme/theme-provider';
|
|
4
|
+
import { useReducedMotion } from './use-reduced-motion';
|
|
5
|
+
|
|
6
|
+
export const useNativeDriver = Platform.OS !== 'web';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Modal 위 패널의 열림 · 닫힘 전환. 닫힘 애니메이션이 끝난 뒤 mounted가 false가 된다.
|
|
10
|
+
* progress는 0(닫힘) → 1(열림).
|
|
11
|
+
*/
|
|
12
|
+
export function useOverlayTransition(open: boolean) {
|
|
13
|
+
const t = useTheme();
|
|
14
|
+
const reduced = useReducedMotion();
|
|
15
|
+
const progress = useRef(new Animated.Value(0)).current;
|
|
16
|
+
const [mounted, setMounted] = useState(open);
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (open) setMounted(true);
|
|
20
|
+
const animation = Animated.timing(progress, {
|
|
21
|
+
toValue: open ? 1 : 0,
|
|
22
|
+
duration: reduced ? 0 : t.motion.duration,
|
|
23
|
+
useNativeDriver,
|
|
24
|
+
});
|
|
25
|
+
animation.start(({ finished }) => {
|
|
26
|
+
if (finished && !open) setMounted(false);
|
|
27
|
+
});
|
|
28
|
+
return () => animation.stop();
|
|
29
|
+
}, [open, progress, reduced, t.motion.duration]);
|
|
30
|
+
|
|
31
|
+
return { mounted, progress };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
backdrop: { backgroundColor: 'rgba(0, 0, 0, 0.4)' },
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function Backdrop({
|
|
39
|
+
progress,
|
|
40
|
+
onPress,
|
|
41
|
+
label,
|
|
42
|
+
}: {
|
|
43
|
+
progress: Animated.Value;
|
|
44
|
+
onPress: () => void;
|
|
45
|
+
label: string;
|
|
46
|
+
}) {
|
|
47
|
+
return (
|
|
48
|
+
<Animated.View
|
|
49
|
+
style={[StyleSheet.absoluteFill, styles.backdrop, { opacity: progress }]}
|
|
50
|
+
>
|
|
51
|
+
<Pressable
|
|
52
|
+
style={StyleSheet.absoluteFill}
|
|
53
|
+
onPress={onPress}
|
|
54
|
+
accessibilityRole="button"
|
|
55
|
+
accessibilityLabel={label}
|
|
56
|
+
/>
|
|
57
|
+
</Animated.View>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ComponentRef, Ref } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
type PressableProps,
|
|
5
|
+
type StyleProp,
|
|
6
|
+
type ViewStyle,
|
|
7
|
+
} from 'react-native';
|
|
8
|
+
import { useTheme } from '../theme/theme-provider';
|
|
9
|
+
|
|
10
|
+
export type PressableBaseProps = Omit<PressableProps, 'style'> & {
|
|
11
|
+
ref?: Ref<ComponentRef<typeof Pressable>>;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
/** 눌렸을 때 추가 스타일. 기본은 opacity.pressed */
|
|
14
|
+
pressedStyle?: StyleProp<ViewStyle>;
|
|
15
|
+
/** 눈에 보이는 높이. 최소 터치 크기보다 작으면 hitSlop으로 보완한다 */
|
|
16
|
+
touchHeight?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** 눌림 · 비활성 · 접근성 상태 · 최소 터치 영역을 한곳에서 처리하는 Pressable */
|
|
20
|
+
export function PressableBase({
|
|
21
|
+
style,
|
|
22
|
+
pressedStyle,
|
|
23
|
+
touchHeight,
|
|
24
|
+
disabled,
|
|
25
|
+
hitSlop,
|
|
26
|
+
accessibilityRole = 'button',
|
|
27
|
+
accessibilityState,
|
|
28
|
+
...rest
|
|
29
|
+
}: PressableBaseProps) {
|
|
30
|
+
const t = useTheme();
|
|
31
|
+
const slop =
|
|
32
|
+
hitSlop ??
|
|
33
|
+
(touchHeight !== undefined && touchHeight < t.minTouchSize
|
|
34
|
+
? {
|
|
35
|
+
top: Math.ceil((t.minTouchSize - touchHeight) / 2),
|
|
36
|
+
bottom: Math.ceil((t.minTouchSize - touchHeight) / 2),
|
|
37
|
+
}
|
|
38
|
+
: undefined);
|
|
39
|
+
return (
|
|
40
|
+
<Pressable
|
|
41
|
+
{...rest}
|
|
42
|
+
disabled={disabled}
|
|
43
|
+
hitSlop={slop}
|
|
44
|
+
accessibilityRole={accessibilityRole}
|
|
45
|
+
accessibilityState={{ ...accessibilityState, disabled: !!disabled }}
|
|
46
|
+
style={({ pressed }) => [
|
|
47
|
+
style,
|
|
48
|
+
pressed &&
|
|
49
|
+
!disabled &&
|
|
50
|
+
(pressedStyle ?? { opacity: t.opacity.pressed }),
|
|
51
|
+
disabled && { opacity: t.opacity.disabled },
|
|
52
|
+
]}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
import { AccessibilityInfo } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// 앱 전체에서 구독 하나를 공유한다.
|
|
5
|
+
let reduced = false;
|
|
6
|
+
let started = false;
|
|
7
|
+
const listeners = new Set<() => void>();
|
|
8
|
+
|
|
9
|
+
function set(value: boolean) {
|
|
10
|
+
if (value === reduced) return;
|
|
11
|
+
reduced = value;
|
|
12
|
+
listeners.forEach((l) => l());
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function subscribe(listener: () => void) {
|
|
16
|
+
if (!started) {
|
|
17
|
+
started = true;
|
|
18
|
+
AccessibilityInfo.isReduceMotionEnabled()
|
|
19
|
+
.then(set)
|
|
20
|
+
.catch(() => {});
|
|
21
|
+
AccessibilityInfo.addEventListener('reduceMotionChanged', set);
|
|
22
|
+
}
|
|
23
|
+
listeners.add(listener);
|
|
24
|
+
return () => {
|
|
25
|
+
listeners.delete(listener);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** 기기의 '동작 줄이기' 설정 */
|
|
30
|
+
export function useReducedMotion(): boolean {
|
|
31
|
+
return useSyncExternalStore(subscribe, () => reduced);
|
|
32
|
+
}
|