@open-mercato/core 0.7.1-develop.7202.1.a52dc6707c → 0.8.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/.turbo/turbo-build.log +1 -1
- package/build.mjs +11 -0
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +23 -0
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/[id]/page.js +2 -1
- package/dist/modules/customers/backend/customers/companies/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +2 -1
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/[id]/page.js +2 -2
- package/dist/modules/customers/backend/customers/people/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +2 -1
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/lib/detailHelpers.js +4 -0
- package/dist/modules/customers/lib/detailHelpers.js.map +2 -2
- package/dist/modules/customers/lib/todoCompatibility.js +5 -0
- package/dist/modules/customers/lib/todoCompatibility.js.map +2 -2
- package/dist/modules/design_system/backend/design-system/page.meta.js +3 -2
- package/dist/modules/design_system/backend/design-system/page.meta.js.map +2 -2
- package/dist/modules/design_system/gallery/assets/ai-prompt-image.png +0 -0
- package/dist/modules/design_system/gallery/assets/avatar-illustration.png +0 -0
- package/dist/modules/design_system/gallery/assets/avatar-memoji.png +0 -0
- package/dist/modules/design_system/gallery/assets/avatar-photo.png +0 -0
- package/dist/modules/design_system/gallery/assets/blog-photo-0.png +0 -0
- package/dist/modules/design_system/gallery/assets/contact-support-portrait.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-ada.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-avax.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-bnb.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-brand.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-btc.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-clock.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-crown.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-dot.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-eth.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-hbar.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-history.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-link.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-menu.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-metamask.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-more.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-phantom.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-rewards.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-sad-face.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-sol.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-star.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-status-cancelled.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-status-pending.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-status-success.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-status-warning.svg +3 -0
- package/dist/modules/design_system/gallery/assets/crypto-trx.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-usdc.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-usdt.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-walletconnect.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-wei.png +0 -0
- package/dist/modules/design_system/gallery/assets/crypto-xrp.png +0 -0
- package/dist/modules/design_system/gallery/assets/cryptocurrency-artwork.js +67 -0
- package/dist/modules/design_system/gallery/assets/cryptocurrency-artwork.js.map +7 -0
- package/dist/modules/design_system/gallery/assets/github-logo.png +0 -0
- package/dist/modules/design_system/gallery/assets/images.d.js +1 -0
- package/dist/modules/design_system/gallery/assets/images.d.js.map +7 -0
- package/dist/modules/design_system/gallery/assets/input-european-union.svg +18 -0
- package/dist/modules/design_system/gallery/assets/landing-teams-01.png +0 -0
- package/dist/modules/design_system/gallery/assets/marketing-artwork.js +83 -0
- package/dist/modules/design_system/gallery/assets/marketing-artwork.js.map +7 -0
- package/dist/modules/design_system/gallery/assets/menu-apex.svg +18 -0
- package/dist/modules/design_system/gallery/assets/menu-mastercard.svg +7 -0
- package/dist/modules/design_system/gallery/assets/menu-spotify.svg +4 -0
- package/dist/modules/design_system/gallery/assets/menu-united-states.svg +16 -0
- package/dist/modules/design_system/gallery/assets/select-google.png +0 -0
- package/dist/modules/design_system/gallery/assets/select-poland.png +0 -0
- package/dist/modules/design_system/gallery/assets/selection-artwork.js +5 -0
- package/dist/modules/design_system/gallery/assets/selection-artwork.js.map +7 -0
- package/dist/modules/design_system/gallery/assets/social-apple-filled.svg +4 -0
- package/dist/modules/design_system/gallery/assets/social-apple-stroke.svg +4 -0
- package/dist/modules/design_system/gallery/assets/social-dropbox-filled.svg +5 -0
- package/dist/modules/design_system/gallery/assets/social-dropbox-stroke.svg +5 -0
- package/dist/modules/design_system/gallery/assets/social-facebook-filled.svg +4 -0
- package/dist/modules/design_system/gallery/assets/social-facebook-stroke.svg +10 -0
- package/dist/modules/design_system/gallery/assets/social-github-filled.svg +4 -0
- package/dist/modules/design_system/gallery/assets/social-github-stroke.svg +4 -0
- package/dist/modules/design_system/gallery/assets/social-google-filled.svg +7 -0
- package/dist/modules/design_system/gallery/assets/social-google-stroke.svg +7 -0
- package/dist/modules/design_system/gallery/assets/social-linkedin-filled.svg +4 -0
- package/dist/modules/design_system/gallery/assets/social-linkedin-stroke.svg +4 -0
- package/dist/modules/design_system/gallery/assets/social-x-filled.svg +4 -0
- package/dist/modules/design_system/gallery/assets/social-x-stroke.svg +4 -0
- package/dist/modules/design_system/gallery/assets/style-studio-product.png +0 -0
- package/dist/modules/design_system/gallery/assets/upload-images.js +8 -0
- package/dist/modules/design_system/gallery/assets/upload-images.js.map +7 -0
- package/dist/modules/design_system/gallery/components/BrandStylePreview.js +74 -0
- package/dist/modules/design_system/gallery/components/BrandStylePreview.js.map +7 -0
- package/dist/modules/design_system/gallery/components/CodeSnippet.js +31 -31
- package/dist/modules/design_system/gallery/components/CodeSnippet.js.map +2 -2
- package/dist/modules/design_system/gallery/components/ColorPlayground.js +408 -0
- package/dist/modules/design_system/gallery/components/ColorPlayground.js.map +7 -0
- package/dist/modules/design_system/gallery/components/ColorStudioCompositions.js +166 -0
- package/dist/modules/design_system/gallery/components/ColorStudioCompositions.js.map +7 -0
- package/dist/modules/design_system/gallery/components/ColorStudioSpecimen.js +182 -0
- package/dist/modules/design_system/gallery/components/ColorStudioSpecimen.js.map +7 -0
- package/dist/modules/design_system/gallery/components/CompactEntrySpecimen.js +80 -0
- package/dist/modules/design_system/gallery/components/CompactEntrySpecimen.js.map +7 -0
- package/dist/modules/design_system/gallery/components/ComponentIndex.js +42 -0
- package/dist/modules/design_system/gallery/components/ComponentIndex.js.map +7 -0
- package/dist/modules/design_system/gallery/components/DesignSystemHome.js +69 -0
- package/dist/modules/design_system/gallery/components/DesignSystemHome.js.map +7 -0
- package/dist/modules/design_system/gallery/components/EntryCard.js +47 -41
- package/dist/modules/design_system/gallery/components/EntryCard.js.map +2 -2
- package/dist/modules/design_system/gallery/components/EntryHeader.js +68 -0
- package/dist/modules/design_system/gallery/components/EntryHeader.js.map +7 -0
- package/dist/modules/design_system/gallery/components/FamilyEntryPreview.js +19 -0
- package/dist/modules/design_system/gallery/components/FamilyEntryPreview.js.map +7 -0
- package/dist/modules/design_system/gallery/components/FoundationGuide.js +46 -0
- package/dist/modules/design_system/gallery/components/FoundationGuide.js.map +7 -0
- package/dist/modules/design_system/gallery/components/GalleryLink.js +21 -0
- package/dist/modules/design_system/gallery/components/GalleryLink.js.map +7 -0
- package/dist/modules/design_system/gallery/components/GalleryNavigation.js +82 -0
- package/dist/modules/design_system/gallery/components/GalleryNavigation.js.map +7 -0
- package/dist/modules/design_system/gallery/components/GalleryShell.js +147 -67
- package/dist/modules/design_system/gallery/components/GalleryShell.js.map +3 -3
- package/dist/modules/design_system/gallery/components/IconsBrowser.js +33 -0
- package/dist/modules/design_system/gallery/components/IconsBrowser.js.map +7 -0
- package/dist/modules/design_system/gallery/components/SourceLibrary.js +93 -0
- package/dist/modules/design_system/gallery/components/SourceLibrary.js.map +7 -0
- package/dist/modules/design_system/gallery/components/StyleAgents.js +139 -0
- package/dist/modules/design_system/gallery/components/StyleAgents.js.map +7 -0
- package/dist/modules/design_system/gallery/components/ThemeTokenReference.js +101 -0
- package/dist/modules/design_system/gallery/components/ThemeTokenReference.js.map +7 -0
- package/dist/modules/design_system/gallery/components/VariantPreview.js +2 -2
- package/dist/modules/design_system/gallery/components/VariantPreview.js.map +2 -2
- package/dist/modules/design_system/gallery/components/colorPreview.js +58 -0
- package/dist/modules/design_system/gallery/components/colorPreview.js.map +7 -0
- package/dist/modules/design_system/gallery/components/colorStudio.js +218 -0
- package/dist/modules/design_system/gallery/components/colorStudio.js.map +7 -0
- package/dist/modules/design_system/gallery/components/styleAgentBranding.js +46 -0
- package/dist/modules/design_system/gallery/components/styleAgentBranding.js.map +7 -0
- package/dist/modules/design_system/gallery/components/themeTokens.js +32 -0
- package/dist/modules/design_system/gallery/components/themeTokens.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/ai-product-code.generated.js +194 -0
- package/dist/modules/design_system/gallery/demos/ai-product-code.generated.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/ai-product.js +423 -0
- package/dist/modules/design_system/gallery/demos/ai-product.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/buttons.js +289 -0
- package/dist/modules/design_system/gallery/demos/buttons.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/cryptocurrency.js +1708 -0
- package/dist/modules/design_system/gallery/demos/cryptocurrency.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/feeds-code.generated.js +92 -0
- package/dist/modules/design_system/gallery/demos/feeds-code.generated.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/feeds.js +148 -0
- package/dist/modules/design_system/gallery/demos/feeds.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/file-upload.js +72 -0
- package/dist/modules/design_system/gallery/demos/file-upload.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/foundation-reference-data.js +4875 -0
- package/dist/modules/design_system/gallery/demos/foundation-reference-data.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/foundation-references.js +188 -0
- package/dist/modules/design_system/gallery/demos/foundation-references.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/key-components-code.generated.js +6 -0
- package/dist/modules/design_system/gallery/demos/key-components-code.generated.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/key-components.js +127 -0
- package/dist/modules/design_system/gallery/demos/key-components.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/marketing-controls-code.generated.js +98 -0
- package/dist/modules/design_system/gallery/demos/marketing-controls-code.generated.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/marketing-controls.js +134 -0
- package/dist/modules/design_system/gallery/demos/marketing-controls.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/marketing-widgets-code.generated.js +195 -0
- package/dist/modules/design_system/gallery/demos/marketing-widgets-code.generated.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/marketing-widgets.js +586 -0
- package/dist/modules/design_system/gallery/demos/marketing-widgets.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/menu-fixtures.js +40 -0
- package/dist/modules/design_system/gallery/demos/menu-fixtures.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/menu-sources.js +295 -0
- package/dist/modules/design_system/gallery/demos/menu-sources.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/menus.js +150 -0
- package/dist/modules/design_system/gallery/demos/menus.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/rating-reviews.js +53 -0
- package/dist/modules/design_system/gallery/demos/rating-reviews.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/registered-icons.js +104 -0
- package/dist/modules/design_system/gallery/demos/registered-icons.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/selection-cards.js +99 -0
- package/dist/modules/design_system/gallery/demos/selection-cards.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/shell-code.generated.js +189 -0
- package/dist/modules/design_system/gallery/demos/shell-code.generated.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/shell.js +330 -0
- package/dist/modules/design_system/gallery/demos/shell.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/source-artwork.js +120 -0
- package/dist/modules/design_system/gallery/demos/source-artwork.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/source-filters-code.generated.js +125 -0
- package/dist/modules/design_system/gallery/demos/source-filters-code.generated.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/source-filters.js +185 -0
- package/dist/modules/design_system/gallery/demos/source-filters.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/source-icons.js +69 -0
- package/dist/modules/design_system/gallery/demos/source-icons.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/table-cells-code.generated.js +150 -0
- package/dist/modules/design_system/gallery/demos/table-cells-code.generated.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/table-cells.js +181 -0
- package/dist/modules/design_system/gallery/demos/table-cells.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/text-inputs.js +113 -0
- package/dist/modules/design_system/gallery/demos/text-inputs.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/time-picker-code.generated.js +41 -0
- package/dist/modules/design_system/gallery/demos/time-picker-code.generated.js.map +7 -0
- package/dist/modules/design_system/gallery/demos/time-picker.js +41 -0
- package/dist/modules/design_system/gallery/demos/time-picker.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/banners.js +123 -60
- package/dist/modules/design_system/gallery/entries/banners.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/buttons-snippets.js +433 -0
- package/dist/modules/design_system/gallery/entries/buttons-snippets.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/buttons.js +127 -148
- package/dist/modules/design_system/gallery/entries/buttons.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/charts.js +532 -186
- package/dist/modules/design_system/gallery/entries/charts.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/dates.js +191 -3
- package/dist/modules/design_system/gallery/entries/dates.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/detail.js +118 -77
- package/dist/modules/design_system/gallery/entries/detail.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/display.js +1449 -240
- package/dist/modules/design_system/gallery/entries/display.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/feedback.js +1058 -132
- package/dist/modules/design_system/gallery/entries/feedback.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/filters.js +231 -103
- package/dist/modules/design_system/gallery/entries/filters.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/foundations.js +368 -57
- package/dist/modules/design_system/gallery/entries/foundations.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/icons.js +29 -91
- package/dist/modules/design_system/gallery/entries/icons.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/inputs-snippets.js +154 -0
- package/dist/modules/design_system/gallery/entries/inputs-snippets.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/inputs.js +2043 -306
- package/dist/modules/design_system/gallery/entries/inputs.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/library.js +20 -0
- package/dist/modules/design_system/gallery/entries/library.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/messages.js +121 -103
- package/dist/modules/design_system/gallery/entries/messages.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/navigation.js +676 -103
- package/dist/modules/design_system/gallery/entries/navigation.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/notifications.js +131 -78
- package/dist/modules/design_system/gallery/entries/notifications.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/overlays.js +611 -203
- package/dist/modules/design_system/gallery/entries/overlays.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/scaffolding.js +1175 -120
- package/dist/modules/design_system/gallery/entries/scaffolding.js.map +2 -2
- package/dist/modules/design_system/gallery/entries/schedule.js +79 -54
- package/dist/modules/design_system/gallery/entries/schedule.js.map +2 -2
- package/dist/modules/design_system/gallery/presentation.js +108 -0
- package/dist/modules/design_system/gallery/presentation.js.map +7 -0
- package/dist/modules/design_system/gallery/registry.js +8 -5
- package/dist/modules/design_system/gallery/registry.js.map +2 -2
- package/dist/modules/design_system/gallery/source-library.generated.js +5 -0
- package/dist/modules/design_system/gallery/source-library.generated.js.map +7 -0
- package/dist/modules/design_system/i18n/de.json +7167 -0
- package/dist/modules/design_system/i18n/en.json +7167 -0
- package/dist/modules/design_system/i18n/es.json +7167 -0
- package/dist/modules/design_system/i18n/ko.json +7167 -0
- package/dist/modules/design_system/i18n/pl.json +7167 -0
- package/dist/modules/push_notifications/lib/queue.js +1 -31
- package/dist/modules/push_notifications/lib/queue.js.map +2 -2
- package/jest.config.cjs +1 -0
- package/jest.mocks/image.js +1 -0
- package/package.json +8 -9
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +50 -0
- package/src/modules/customers/backend/customers/companies/[id]/page.tsx +2 -1
- package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +2 -1
- package/src/modules/customers/backend/customers/people/[id]/page.tsx +2 -2
- package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +2 -1
- package/src/modules/customers/lib/detailHelpers.ts +4 -0
- package/src/modules/customers/lib/todoCompatibility.ts +10 -0
- package/src/modules/design_system/backend/design-system/page.meta.ts +3 -2
- package/src/modules/design_system/gallery/assets/README.md +30 -0
- package/src/modules/design_system/gallery/assets/ai-prompt-image.png +0 -0
- package/src/modules/design_system/gallery/assets/avatar-illustration.png +0 -0
- package/src/modules/design_system/gallery/assets/avatar-memoji.png +0 -0
- package/src/modules/design_system/gallery/assets/avatar-photo.png +0 -0
- package/src/modules/design_system/gallery/assets/blog-photo-0.png +0 -0
- package/src/modules/design_system/gallery/assets/contact-support-portrait.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-ada.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-avax.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-bnb.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-brand.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-btc.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-clock.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-crown.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-dot.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-eth.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-hbar.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-history.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-link.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-menu.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-metamask.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-more.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-phantom.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-rewards.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-sad-face.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-sol.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-star.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-status-cancelled.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-status-pending.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-status-success.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-status-warning.svg +3 -0
- package/src/modules/design_system/gallery/assets/crypto-trx.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-usdc.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-usdt.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-walletconnect.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-wei.png +0 -0
- package/src/modules/design_system/gallery/assets/crypto-xrp.png +0 -0
- package/src/modules/design_system/gallery/assets/cryptocurrency-artwork.ts +63 -0
- package/src/modules/design_system/gallery/assets/github-logo.png +0 -0
- package/src/modules/design_system/gallery/assets/images.d.ts +9 -0
- package/src/modules/design_system/gallery/assets/input-european-union.svg +18 -0
- package/src/modules/design_system/gallery/assets/landing-teams-01.png +0 -0
- package/src/modules/design_system/gallery/assets/marketing-artwork.ts +79 -0
- package/src/modules/design_system/gallery/assets/menu-apex.svg +18 -0
- package/src/modules/design_system/gallery/assets/menu-mastercard.svg +7 -0
- package/src/modules/design_system/gallery/assets/menu-spotify.svg +4 -0
- package/src/modules/design_system/gallery/assets/menu-united-states.svg +16 -0
- package/src/modules/design_system/gallery/assets/select-google.png +0 -0
- package/src/modules/design_system/gallery/assets/select-poland.png +0 -0
- package/src/modules/design_system/gallery/assets/selection-artwork.ts +1 -0
- package/src/modules/design_system/gallery/assets/social-apple-filled.svg +4 -0
- package/src/modules/design_system/gallery/assets/social-apple-stroke.svg +4 -0
- package/src/modules/design_system/gallery/assets/social-dropbox-filled.svg +5 -0
- package/src/modules/design_system/gallery/assets/social-dropbox-stroke.svg +5 -0
- package/src/modules/design_system/gallery/assets/social-facebook-filled.svg +4 -0
- package/src/modules/design_system/gallery/assets/social-facebook-stroke.svg +10 -0
- package/src/modules/design_system/gallery/assets/social-github-filled.svg +4 -0
- package/src/modules/design_system/gallery/assets/social-github-stroke.svg +4 -0
- package/src/modules/design_system/gallery/assets/social-google-filled.svg +7 -0
- package/src/modules/design_system/gallery/assets/social-google-stroke.svg +7 -0
- package/src/modules/design_system/gallery/assets/social-linkedin-filled.svg +4 -0
- package/src/modules/design_system/gallery/assets/social-linkedin-stroke.svg +4 -0
- package/src/modules/design_system/gallery/assets/social-x-filled.svg +4 -0
- package/src/modules/design_system/gallery/assets/social-x-stroke.svg +4 -0
- package/src/modules/design_system/gallery/assets/style-studio-product.png +0 -0
- package/src/modules/design_system/gallery/assets/upload-images.ts +5 -0
- package/src/modules/design_system/gallery/components/BrandStylePreview.tsx +94 -0
- package/src/modules/design_system/gallery/components/CodeSnippet.tsx +34 -34
- package/src/modules/design_system/gallery/components/ColorPlayground.tsx +324 -0
- package/src/modules/design_system/gallery/components/ColorStudioCompositions.tsx +96 -0
- package/src/modules/design_system/gallery/components/ColorStudioSpecimen.tsx +164 -0
- package/src/modules/design_system/gallery/components/CompactEntrySpecimen.tsx +65 -0
- package/src/modules/design_system/gallery/components/ComponentIndex.tsx +47 -0
- package/src/modules/design_system/gallery/components/DesignSystemHome.tsx +66 -0
- package/src/modules/design_system/gallery/components/EntryCard.tsx +52 -37
- package/src/modules/design_system/gallery/components/EntryHeader.tsx +80 -0
- package/src/modules/design_system/gallery/components/FamilyEntryPreview.tsx +22 -0
- package/src/modules/design_system/gallery/components/FoundationGuide.tsx +43 -0
- package/src/modules/design_system/gallery/components/GalleryLink.tsx +19 -0
- package/src/modules/design_system/gallery/components/GalleryNavigation.tsx +86 -0
- package/src/modules/design_system/gallery/components/GalleryShell.tsx +149 -63
- package/src/modules/design_system/gallery/components/IconsBrowser.tsx +40 -0
- package/src/modules/design_system/gallery/components/SourceLibrary.tsx +90 -0
- package/src/modules/design_system/gallery/components/StyleAgents.tsx +115 -0
- package/src/modules/design_system/gallery/components/ThemeTokenReference.tsx +76 -0
- package/src/modules/design_system/gallery/components/VariantPreview.tsx +2 -2
- package/src/modules/design_system/gallery/components/colorPreview.ts +63 -0
- package/src/modules/design_system/gallery/components/colorStudio.ts +260 -0
- package/src/modules/design_system/gallery/components/styleAgentBranding.ts +42 -0
- package/src/modules/design_system/gallery/components/themeTokens.ts +26 -0
- package/src/modules/design_system/gallery/demos/ai-product-code.generated.ts +3 -0
- package/src/modules/design_system/gallery/demos/ai-product.tsx +188 -0
- package/src/modules/design_system/gallery/demos/buttons.tsx +331 -0
- package/src/modules/design_system/gallery/demos/cryptocurrency.tsx +1943 -0
- package/src/modules/design_system/gallery/demos/feeds-code.generated.ts +4 -0
- package/src/modules/design_system/gallery/demos/feeds.tsx +82 -0
- package/src/modules/design_system/gallery/demos/file-upload.tsx +61 -0
- package/src/modules/design_system/gallery/demos/foundation-reference-data.ts +4872 -0
- package/src/modules/design_system/gallery/demos/foundation-references.tsx +140 -0
- package/src/modules/design_system/gallery/demos/key-components-code.generated.ts +3 -0
- package/src/modules/design_system/gallery/demos/key-components.tsx +106 -0
- package/src/modules/design_system/gallery/demos/marketing-controls-code.generated.ts +3 -0
- package/src/modules/design_system/gallery/demos/marketing-controls.tsx +92 -0
- package/src/modules/design_system/gallery/demos/marketing-widgets-code.generated.ts +3 -0
- package/src/modules/design_system/gallery/demos/marketing-widgets.tsx +189 -0
- package/src/modules/design_system/gallery/demos/menu-fixtures.tsx +48 -0
- package/src/modules/design_system/gallery/demos/menu-sources.ts +5 -0
- package/src/modules/design_system/gallery/demos/menus.tsx +122 -0
- package/src/modules/design_system/gallery/demos/rating-reviews.tsx +44 -0
- package/src/modules/design_system/gallery/demos/registered-icons.tsx +117 -0
- package/src/modules/design_system/gallery/demos/selection-cards.tsx +97 -0
- package/src/modules/design_system/gallery/demos/shell-code.generated.ts +3 -0
- package/src/modules/design_system/gallery/demos/shell.tsx +183 -0
- package/src/modules/design_system/gallery/demos/source-artwork.tsx +88 -0
- package/src/modules/design_system/gallery/demos/source-filters-code.generated.ts +3 -0
- package/src/modules/design_system/gallery/demos/source-filters.tsx +119 -0
- package/src/modules/design_system/gallery/demos/source-icons.tsx +62 -0
- package/src/modules/design_system/gallery/demos/table-cells-code.generated.ts +3 -0
- package/src/modules/design_system/gallery/demos/table-cells.tsx +144 -0
- package/src/modules/design_system/gallery/demos/text-inputs.tsx +90 -0
- package/src/modules/design_system/gallery/demos/time-picker-code.generated.ts +5 -0
- package/src/modules/design_system/gallery/demos/time-picker.tsx +31 -0
- package/src/modules/design_system/gallery/entries/banners.tsx +143 -94
- package/src/modules/design_system/gallery/entries/buttons-snippets.ts +432 -0
- package/src/modules/design_system/gallery/entries/buttons.tsx +125 -196
- package/src/modules/design_system/gallery/entries/charts.tsx +545 -233
- package/src/modules/design_system/gallery/entries/dates.tsx +171 -3
- package/src/modules/design_system/gallery/entries/detail.tsx +142 -115
- package/src/modules/design_system/gallery/entries/display.tsx +1691 -319
- package/src/modules/design_system/gallery/entries/feedback.tsx +1082 -169
- package/src/modules/design_system/gallery/entries/filters.tsx +238 -143
- package/src/modules/design_system/gallery/entries/foundations.tsx +404 -61
- package/src/modules/design_system/gallery/entries/icons.tsx +31 -117
- package/src/modules/design_system/gallery/entries/inputs-snippets.ts +156 -0
- package/src/modules/design_system/gallery/entries/inputs.tsx +2146 -503
- package/src/modules/design_system/gallery/entries/library.tsx +16 -0
- package/src/modules/design_system/gallery/entries/messages.tsx +114 -106
- package/src/modules/design_system/gallery/entries/navigation.tsx +782 -192
- package/src/modules/design_system/gallery/entries/notifications.tsx +145 -120
- package/src/modules/design_system/gallery/entries/overlays.tsx +696 -280
- package/src/modules/design_system/gallery/entries/scaffolding.tsx +1192 -158
- package/src/modules/design_system/gallery/entries/schedule.tsx +72 -58
- package/src/modules/design_system/gallery/presentation.ts +106 -0
- package/src/modules/design_system/gallery/registry.ts +8 -6
- package/src/modules/design_system/gallery/source-library.generated.ts +2 -0
- package/src/modules/design_system/i18n/de.json +7112 -3
- package/src/modules/design_system/i18n/en.json +7112 -3
- package/src/modules/design_system/i18n/es.json +7112 -3
- package/src/modules/design_system/i18n/ko.json +7112 -3
- package/src/modules/design_system/i18n/pl.json +7112 -3
- package/src/modules/push_notifications/AGENTS.md +9 -5
- package/src/modules/push_notifications/lib/queue.ts +15 -44
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Banner } from "@open-mercato/ui/primitives/banner";
|
|
2
3
|
import * as React from "react";
|
|
4
|
+
import { NotificationFeedExample } from "../demos/feeds.js";
|
|
5
|
+
import { notificationFeedExampleCode } from "../demos/feeds-code.generated.js";
|
|
3
6
|
import { Inbox, RefreshCw, Search, Settings, UserPlus } from "lucide-react";
|
|
4
7
|
import { Alert, AlertDescription, AlertTitle } from "@open-mercato/ui/primitives/alert";
|
|
5
8
|
import { EmptyState } from "@open-mercato/ui/primitives/empty-state";
|
|
9
|
+
import { EmptyStateIllustration } from "@open-mercato/ui/primitives/empty-state-illustration";
|
|
6
10
|
import { Skeleton } from "@open-mercato/ui/primitives/skeleton";
|
|
7
11
|
import { CircularProgress, Progress } from "@open-mercato/ui/primitives/progress";
|
|
8
12
|
import { Spinner } from "@open-mercato/ui/primitives/spinner";
|
|
13
|
+
import { RatingCellDemo, RatingReviewDemo } from "../demos/rating-reviews.js";
|
|
9
14
|
import { Rating } from "@open-mercato/ui/primitives/rating";
|
|
10
|
-
import {
|
|
15
|
+
import { RatingBar } from "@open-mercato/ui/primitives/rating-bar";
|
|
16
|
+
import { Textarea } from "@open-mercato/ui/primitives/textarea";
|
|
17
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
18
|
+
import { StepIndicator, StepperDots } from "@open-mercato/ui/primitives/step-indicator";
|
|
11
19
|
import { Notification } from "@open-mercato/ui/primitives/notification";
|
|
12
20
|
import {
|
|
13
21
|
NotificationFeed,
|
|
@@ -20,8 +28,108 @@ import {
|
|
|
20
28
|
import { Button } from "@open-mercato/ui/primitives/button";
|
|
21
29
|
import { IconButton } from "@open-mercato/ui/primitives/icon-button";
|
|
22
30
|
import { LinkButton } from "@open-mercato/ui/primitives/link-button";
|
|
31
|
+
const bannerStatuses = ["error", "warning", "success", "information", "feature"];
|
|
32
|
+
function BannerExamples({ appearance, minimal = false }) {
|
|
33
|
+
const t = useT();
|
|
34
|
+
const [dismissed, setDismissed] = React.useState([]);
|
|
35
|
+
const [details, setDetails] = React.useState(false);
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-full space-y-4", children: [
|
|
37
|
+
bannerStatuses.filter((status) => !dismissed.includes(status)).map((status) => /* @__PURE__ */ jsx(Banner, { status, style: appearance, title: t("design_system.gallery.samples.banner.title"), description: minimal ? void 0 : t("design_system.gallery.samples.banner.description"), showIcon: !minimal, onDismiss: minimal ? void 0 : () => setDismissed((value) => [...value, status]), action: minimal ? void 0 : /* @__PURE__ */ jsx(Button, { variant: "link", className: "h-auto p-0 text-inherit underline", onClick: () => setDetails((value) => !value), children: t("design_system.gallery.samples.banner.details") }) }, status)),
|
|
38
|
+
details ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("design_system.gallery.samples.banner.detailsBody") }) : null,
|
|
39
|
+
dismissed.length ? /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => setDismissed([]), children: t("design_system.gallery.samples.banner.restore") }) : null
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
function bannerExampleCode(appearance, minimal = false) {
|
|
43
|
+
return `import * as React from 'react'
|
|
44
|
+
import { Banner } from '@open-mercato/ui/primitives/banner'
|
|
45
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
46
|
+
|
|
47
|
+
function Example() {
|
|
48
|
+
const [dismissed, setDismissed] = React.useState<string[]>([])
|
|
49
|
+
const [details, setDetails] = React.useState(false)
|
|
50
|
+
return <div className="w-full space-y-4">
|
|
51
|
+
{(['error', 'warning', 'success', 'information', 'feature'] as const).filter(status => !dismissed.includes(status)).map(status => (
|
|
52
|
+
<Banner key={status} status={status} style="${appearance}" title="Workspace update"${minimal ? " showIcon={false}" : ' description="Your team can review the latest changes." onDismiss={() => setDismissed(value => [...value, status])} action={<Button variant="link" className="h-auto p-0 text-inherit underline" onClick={() => setDetails(value => !value)}>View details</Button>}'} />
|
|
53
|
+
))}
|
|
54
|
+
{details ? <p className="text-sm text-muted-foreground">This example changes local preview state.</p> : null}
|
|
55
|
+
{dismissed.length ? <Button variant="outline" size="sm" onClick={() => setDismissed([])}>Restore banners</Button> : null}
|
|
56
|
+
</div>
|
|
57
|
+
}`;
|
|
58
|
+
}
|
|
59
|
+
const bannerEntry = {
|
|
60
|
+
id: "banner",
|
|
61
|
+
title: "Banner",
|
|
62
|
+
importPath: "@open-mercato/ui/primitives/banner",
|
|
63
|
+
figmaNodeId: "224:2249",
|
|
64
|
+
docsAnchor: "#banner",
|
|
65
|
+
variants: [
|
|
66
|
+
{ id: "filled", title: "5 statuses / Filled", render: () => /* @__PURE__ */ jsx(BannerExamples, { appearance: "filled" }), code: bannerExampleCode("filled") },
|
|
67
|
+
{ id: "light", title: "5 statuses / Light", render: () => /* @__PURE__ */ jsx(BannerExamples, { appearance: "light" }), code: bannerExampleCode("light") },
|
|
68
|
+
{ id: "lighter", title: "5 statuses / Lighter", render: () => /* @__PURE__ */ jsx(BannerExamples, { appearance: "lighter" }), code: bannerExampleCode("lighter") },
|
|
69
|
+
{ id: "stroke", title: "5 statuses / Stroke", render: () => /* @__PURE__ */ jsx(BannerExamples, { appearance: "stroke" }), code: bannerExampleCode("stroke") },
|
|
70
|
+
{ id: "minimal", title: "Title only", render: () => /* @__PURE__ */ jsx(BannerExamples, { appearance: "lighter", minimal: true }), code: bannerExampleCode("lighter", true) }
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
function AlertSourceExamples({ size }) {
|
|
74
|
+
const t = useT();
|
|
75
|
+
const [hidden, setHidden] = React.useState([]);
|
|
76
|
+
const [details, setDetails] = React.useState(false);
|
|
77
|
+
return /* @__PURE__ */ jsxs("div", { className: "grid w-full gap-5 lg:grid-cols-2", children: [
|
|
78
|
+
["filled", "light", "lighter", "stroke"].map((appearance) => /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
79
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: appearance }),
|
|
80
|
+
bannerStatuses.filter((status) => !hidden.includes(`${appearance}-${status}`)).map((status) => /* @__PURE__ */ jsx(
|
|
81
|
+
Alert,
|
|
82
|
+
{
|
|
83
|
+
className: "max-w-[390px]",
|
|
84
|
+
status,
|
|
85
|
+
style: appearance,
|
|
86
|
+
size,
|
|
87
|
+
dismissible: true,
|
|
88
|
+
onDismiss: () => setHidden((value) => [...value, `${appearance}-${status}`]),
|
|
89
|
+
dismissAriaLabel: t("ui.banner.dismiss", "Dismiss banner"),
|
|
90
|
+
action: size === "default" ? void 0 : /* @__PURE__ */ jsx(Button, { variant: "link", className: size === "xs" ? "h-auto p-0 text-xs leading-4 text-inherit underline" : "h-auto p-0 text-sm leading-5 text-inherit underline", onClick: () => setDetails((value) => !value), children: t("design_system.gallery.samples.banner.details") }),
|
|
91
|
+
footer: size === "default" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ jsx(Button, { variant: "link", className: "h-auto p-0 text-inherit underline", onClick: () => setDetails((value) => !value), children: t("design_system.gallery.samples.banner.details") }),
|
|
93
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "opacity-50", children: "\u2219" }),
|
|
94
|
+
/* @__PURE__ */ jsx(Button, { variant: "link", className: "h-auto p-0 text-inherit", onClick: () => setHidden((value) => [...value, `${appearance}-${status}`]), children: t("ui.dialog.close.ariaLabel", "Close") })
|
|
95
|
+
] }) : void 0,
|
|
96
|
+
children: size === "default" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
97
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t("design_system.gallery.samples.banner.title") }),
|
|
98
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: t("design_system.gallery.samples.overlay.description") })
|
|
99
|
+
] }) : t("design_system.gallery.samples.banner.title")
|
|
100
|
+
},
|
|
101
|
+
status
|
|
102
|
+
))
|
|
103
|
+
] }, appearance)),
|
|
104
|
+
details ? /* @__PURE__ */ jsx("p", { role: "status", className: "text-sm text-muted-foreground", children: t("design_system.gallery.samples.banner.detailsBody") }) : null,
|
|
105
|
+
hidden.length ? /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => setHidden([]), children: t("design_system.gallery.samples.feeds.restore") }) : null
|
|
106
|
+
] });
|
|
107
|
+
}
|
|
108
|
+
function alertSourceCode(size) {
|
|
109
|
+
return `import * as React from 'react'
|
|
110
|
+
import { Alert, AlertTitle, AlertDescription } from '@open-mercato/ui/primitives/alert'
|
|
111
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
112
|
+
|
|
113
|
+
function Example() {
|
|
114
|
+
const [hidden, setHidden] = React.useState<string[]>([])
|
|
115
|
+
const [details, setDetails] = React.useState(false)
|
|
116
|
+
const statuses = ['error', 'warning', 'success', 'information', 'feature'] as const
|
|
117
|
+
return <div className="grid w-full gap-5 lg:grid-cols-2">
|
|
118
|
+
{(['filled', 'light', 'lighter', 'stroke'] as const).map(appearance => <div key={appearance} className="space-y-3">
|
|
119
|
+
<p className="text-xs text-muted-foreground">{appearance}</p>
|
|
120
|
+
{statuses.filter(status => !hidden.includes(appearance + '-' + status)).map(status => <Alert className="max-w-[390px]" key={status} status={status} style={appearance} size="${size}" dismissible onDismiss={() => setHidden(value => [...value, appearance + '-' + status])}
|
|
121
|
+
${size === "default" ? "footer" : "action"}={<Button variant="link" className="h-auto p-0 ${size === "xs" ? "text-xs leading-4" : "text-sm leading-5"} text-inherit underline" onClick={() => setDetails(value => !value)}>View details</Button>}>
|
|
122
|
+
${size === "default" ? "<AlertTitle>Workspace update</AlertTitle><AlertDescription>Choose how these changes apply to your workspace.</AlertDescription>" : "Workspace update"}
|
|
123
|
+
</Alert>)}
|
|
124
|
+
</div>)}
|
|
125
|
+
{details ? <p role="status">This example changes local preview state.</p> : null}
|
|
126
|
+
{hidden.length ? <Button size="sm" variant="outline" onClick={() => setHidden([])}>Restore examples</Button> : null}
|
|
127
|
+
</div>
|
|
128
|
+
}`;
|
|
129
|
+
}
|
|
23
130
|
const alertEntry = {
|
|
24
131
|
id: "alert",
|
|
132
|
+
figmaNodeId: "169:2399",
|
|
25
133
|
title: "Alert",
|
|
26
134
|
importPath: "@open-mercato/ui/primitives/alert",
|
|
27
135
|
usage: {
|
|
@@ -32,16 +140,13 @@ const alertEntry = {
|
|
|
32
140
|
dont: ["The legacy variant prop is deprecated \u2014 lint flags it.", "Never build ad-hoc colored notice boxes; this is the primitive for them."]
|
|
33
141
|
},
|
|
34
142
|
variants: [
|
|
143
|
+
{ id: "source-xs", title: "20 status/style combinations / 32px", render: () => /* @__PURE__ */ jsx(AlertSourceExamples, { size: "xs" }), code: alertSourceCode("xs") },
|
|
144
|
+
{ id: "source-sm", title: "20 status/style combinations / 36px", render: () => /* @__PURE__ */ jsx(AlertSourceExamples, { size: "sm" }), code: alertSourceCode("sm") },
|
|
145
|
+
{ id: "source-large", title: "20 status/style combinations / large", render: () => /* @__PURE__ */ jsx(AlertSourceExamples, { size: "default" }), code: alertSourceCode("default") },
|
|
35
146
|
{
|
|
36
147
|
id: "statuses-light",
|
|
37
148
|
title: "Statuses (light)",
|
|
38
|
-
render: () => /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */ jsx(Alert, { status: "error", style: "light", children: "Payment failed \u2014 the card was declined." }),
|
|
40
|
-
/* @__PURE__ */ jsx(Alert, { status: "warning", style: "light", children: "Inventory sync is running behind schedule." }),
|
|
41
|
-
/* @__PURE__ */ jsx(Alert, { status: "success", style: "light", children: "Order #10231 was fulfilled." }),
|
|
42
|
-
/* @__PURE__ */ jsx(Alert, { status: "information", style: "light", children: "Prices include VAT for EU customers." }),
|
|
43
|
-
/* @__PURE__ */ jsx(Alert, { status: "feature", style: "light", children: "Bulk editing is now available in the catalog." })
|
|
44
|
-
] }),
|
|
149
|
+
render: () => /* @__PURE__ */ jsx(AlertFeedbackStatusesLightSample, {}),
|
|
45
150
|
code: `import { Alert } from '@open-mercato/ui/primitives/alert'
|
|
46
151
|
|
|
47
152
|
<Alert status="error" style="light">Payment failed \u2014 the card was declined.</Alert>
|
|
@@ -53,10 +158,7 @@ const alertEntry = {
|
|
|
53
158
|
{
|
|
54
159
|
id: "filled",
|
|
55
160
|
title: "filled",
|
|
56
|
-
render: () => /* @__PURE__ */ jsx(
|
|
57
|
-
/* @__PURE__ */ jsx(AlertTitle, { children: "Import failed" }),
|
|
58
|
-
/* @__PURE__ */ jsx(AlertDescription, { children: "14 rows were rejected \u2014 download the error report to review them." })
|
|
59
|
-
] }) }),
|
|
161
|
+
render: () => /* @__PURE__ */ jsx(AlertFeedbackFilledSample, {}),
|
|
60
162
|
code: `import { Alert, AlertDescription, AlertTitle } from '@open-mercato/ui/primitives/alert'
|
|
61
163
|
|
|
62
164
|
<Alert status="error" style="filled" size="default">
|
|
@@ -67,10 +169,7 @@ const alertEntry = {
|
|
|
67
169
|
{
|
|
68
170
|
id: "stroke",
|
|
69
171
|
title: "stroke",
|
|
70
|
-
render: () => /* @__PURE__ */ jsx(
|
|
71
|
-
/* @__PURE__ */ jsx(AlertTitle, { children: "Backup complete" }),
|
|
72
|
-
/* @__PURE__ */ jsx(AlertDescription, { children: "The nightly snapshot finished without warnings." })
|
|
73
|
-
] }) }),
|
|
172
|
+
render: () => /* @__PURE__ */ jsx(AlertFeedbackStrokeSample, {}),
|
|
74
173
|
code: `import { Alert, AlertDescription, AlertTitle } from '@open-mercato/ui/primitives/alert'
|
|
75
174
|
|
|
76
175
|
<Alert status="success" style="stroke" size="default">
|
|
@@ -81,14 +180,7 @@ const alertEntry = {
|
|
|
81
180
|
{
|
|
82
181
|
id: "sizes",
|
|
83
182
|
title: "Sizes",
|
|
84
|
-
render: () => /* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */ jsx(Alert, { status: "information", size: "xs", children: "X-Small \u2014 inline form hint." }),
|
|
86
|
-
/* @__PURE__ */ jsx(Alert, { status: "information", size: "sm", children: "Small \u2014 the default single-line alert." }),
|
|
87
|
-
/* @__PURE__ */ jsxs(Alert, { status: "information", size: "default", children: [
|
|
88
|
-
/* @__PURE__ */ jsx(AlertTitle, { children: "Large" }),
|
|
89
|
-
/* @__PURE__ */ jsx(AlertDescription, { children: "Multi-line alert with a title and a description body." })
|
|
90
|
-
] })
|
|
91
|
-
] }),
|
|
183
|
+
render: () => /* @__PURE__ */ jsx(AlertFeedbackSizesSample, {}),
|
|
92
184
|
code: `import { Alert, AlertDescription, AlertTitle } from '@open-mercato/ui/primitives/alert'
|
|
93
185
|
|
|
94
186
|
<Alert status="information" size="xs">X-Small \u2014 inline form hint.</Alert>
|
|
@@ -101,16 +193,7 @@ const alertEntry = {
|
|
|
101
193
|
{
|
|
102
194
|
id: "dismissible-with-action",
|
|
103
195
|
title: "Dismissible with action",
|
|
104
|
-
render: () => /* @__PURE__ */ jsx(
|
|
105
|
-
Alert,
|
|
106
|
-
{
|
|
107
|
-
status: "warning",
|
|
108
|
-
style: "lighter",
|
|
109
|
-
dismissible: true,
|
|
110
|
-
action: /* @__PURE__ */ jsx(LinkButton, { variant: "black", underline: "always", children: "Review" }),
|
|
111
|
-
children: "3 products are missing tax categories."
|
|
112
|
-
}
|
|
113
|
-
) }),
|
|
196
|
+
render: () => /* @__PURE__ */ jsx(AlertFeedbackDismissibleWithActionSample, {}),
|
|
114
197
|
code: `import { Alert } from '@open-mercato/ui/primitives/alert'
|
|
115
198
|
import { LinkButton } from '@open-mercato/ui/primitives/link-button'
|
|
116
199
|
|
|
@@ -131,16 +214,28 @@ const emptyStateEntry = {
|
|
|
131
214
|
title: "EmptyState",
|
|
132
215
|
importPath: "@open-mercato/ui/primitives/empty-state",
|
|
133
216
|
variants: [
|
|
217
|
+
{
|
|
218
|
+
id: "source-illustration",
|
|
219
|
+
title: "Open Mercato",
|
|
220
|
+
render: () => /* @__PURE__ */ jsx(IllustratedEmptyStateExample, {}),
|
|
221
|
+
code: `import { EmptyState } from '@open-mercato/ui/primitives/empty-state'
|
|
222
|
+
import { EmptyStateIllustration } from '@open-mercato/ui/primitives/empty-state-illustration'
|
|
223
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
224
|
+
|
|
225
|
+
function RecordsEmptyState() {
|
|
226
|
+
const t = useT()
|
|
227
|
+
return <EmptyState
|
|
228
|
+
variant="subtle"
|
|
229
|
+
title={t('design_system.gallery.samples.emptyArtwork.records.title')}
|
|
230
|
+
description={t('design_system.gallery.samples.emptyArtwork.records.description')}
|
|
231
|
+
illustration={<EmptyStateIllustration kind="mercato-records" />}
|
|
232
|
+
/>
|
|
233
|
+
}`
|
|
234
|
+
},
|
|
134
235
|
{
|
|
135
236
|
id: "default",
|
|
136
237
|
title: "default",
|
|
137
|
-
render: () => /* @__PURE__ */ jsx(
|
|
138
|
-
EmptyState,
|
|
139
|
-
{
|
|
140
|
-
title: "No customers yet",
|
|
141
|
-
description: "Create your first customer to start tracking opportunities."
|
|
142
|
-
}
|
|
143
|
-
) }),
|
|
238
|
+
render: () => /* @__PURE__ */ jsx(EmptyStateFeedbackDefaultSample, {}),
|
|
144
239
|
code: `import { EmptyState } from '@open-mercato/ui/primitives/empty-state'
|
|
145
240
|
|
|
146
241
|
<EmptyState
|
|
@@ -151,15 +246,7 @@ const emptyStateEntry = {
|
|
|
151
246
|
{
|
|
152
247
|
id: "with-actions",
|
|
153
248
|
title: "With icon and actions",
|
|
154
|
-
render: () => /* @__PURE__ */ jsx(
|
|
155
|
-
EmptyState,
|
|
156
|
-
{
|
|
157
|
-
icon: /* @__PURE__ */ jsx(Inbox, { className: "size-8" }),
|
|
158
|
-
title: "No orders found",
|
|
159
|
-
description: "Orders will appear here once your storefront starts selling.",
|
|
160
|
-
actions: /* @__PURE__ */ jsx(Button, { size: "sm", children: "Create order" })
|
|
161
|
-
}
|
|
162
|
-
) }),
|
|
249
|
+
render: () => /* @__PURE__ */ jsx(EmptyStateFeedbackWithActionsSample, {}),
|
|
163
250
|
code: `import { Inbox } from 'lucide-react'
|
|
164
251
|
import { EmptyState } from '@open-mercato/ui/primitives/empty-state'
|
|
165
252
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
@@ -174,16 +261,7 @@ import { Button } from '@open-mercato/ui/primitives/button'
|
|
|
174
261
|
{
|
|
175
262
|
id: "subtle",
|
|
176
263
|
title: "subtle",
|
|
177
|
-
render: () => /* @__PURE__ */ jsx(
|
|
178
|
-
EmptyState,
|
|
179
|
-
{
|
|
180
|
-
variant: "subtle",
|
|
181
|
-
size: "sm",
|
|
182
|
-
icon: /* @__PURE__ */ jsx(Search, { className: "size-5" }),
|
|
183
|
-
title: "No results",
|
|
184
|
-
description: "Try a different search term or clear the filters."
|
|
185
|
-
}
|
|
186
|
-
) }),
|
|
264
|
+
render: () => /* @__PURE__ */ jsx(EmptyStateFeedbackSubtleSample, {}),
|
|
187
265
|
code: `import { Search } from 'lucide-react'
|
|
188
266
|
import { EmptyState } from '@open-mercato/ui/primitives/empty-state'
|
|
189
267
|
|
|
@@ -197,6 +275,64 @@ import { EmptyState } from '@open-mercato/ui/primitives/empty-state'
|
|
|
197
275
|
}
|
|
198
276
|
]
|
|
199
277
|
};
|
|
278
|
+
function IllustratedEmptyStateExample() {
|
|
279
|
+
const t = useT();
|
|
280
|
+
return /* @__PURE__ */ jsx(
|
|
281
|
+
EmptyState,
|
|
282
|
+
{
|
|
283
|
+
variant: "subtle",
|
|
284
|
+
title: t("design_system.gallery.samples.emptyArtwork.records.title"),
|
|
285
|
+
description: t("design_system.gallery.samples.emptyArtwork.records.description"),
|
|
286
|
+
illustration: /* @__PURE__ */ jsx(EmptyStateIllustration, { kind: "mercato-records" })
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
const emptyArtworkSubjects = ["records", "search", "files", "messages"];
|
|
291
|
+
function EmptyIllustrationsExample() {
|
|
292
|
+
const t = useT();
|
|
293
|
+
return /* @__PURE__ */ jsx("div", { className: "grid w-full grid-cols-1 gap-6 lg:grid-cols-2", children: emptyArtworkSubjects.map((subject) => /* @__PURE__ */ jsx(
|
|
294
|
+
EmptyState,
|
|
295
|
+
{
|
|
296
|
+
variant: "subtle",
|
|
297
|
+
className: "min-w-0 border border-border bg-background",
|
|
298
|
+
title: t(`design_system.gallery.samples.emptyArtwork.${subject}.title`),
|
|
299
|
+
description: t(`design_system.gallery.samples.emptyArtwork.${subject}.description`),
|
|
300
|
+
illustration: /* @__PURE__ */ jsx(EmptyStateIllustration, { kind: `mercato-${subject}` })
|
|
301
|
+
},
|
|
302
|
+
subject
|
|
303
|
+
)) });
|
|
304
|
+
}
|
|
305
|
+
const emptyStateIllustrationEntry = {
|
|
306
|
+
id: "empty-state-illustration",
|
|
307
|
+
title: "EmptyStateIllustration",
|
|
308
|
+
importPath: "@open-mercato/ui/primitives/empty-state-illustration",
|
|
309
|
+
variants: [
|
|
310
|
+
{
|
|
311
|
+
id: "mercato",
|
|
312
|
+
title: "Open Mercato",
|
|
313
|
+
render: () => /* @__PURE__ */ jsx(EmptyIllustrationsExample, {}),
|
|
314
|
+
code: `import { EmptyStateIllustration } from '@open-mercato/ui/primitives/empty-state-illustration'
|
|
315
|
+
import { EmptyState } from '@open-mercato/ui/primitives/empty-state'
|
|
316
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
317
|
+
|
|
318
|
+
const subjects = ['records', 'search', 'files', 'messages'] as const
|
|
319
|
+
|
|
320
|
+
function EmptyStateCollection() {
|
|
321
|
+
const t = useT()
|
|
322
|
+
return <div className="grid w-full grid-cols-1 gap-6 lg:grid-cols-2">
|
|
323
|
+
{subjects.map(subject => <EmptyState
|
|
324
|
+
key={subject}
|
|
325
|
+
variant="subtle"
|
|
326
|
+
className="min-w-0 border border-border bg-background"
|
|
327
|
+
title={t(\`design_system.gallery.samples.emptyArtwork.\${subject}.title\`)}
|
|
328
|
+
description={t(\`design_system.gallery.samples.emptyArtwork.\${subject}.description\`)}
|
|
329
|
+
illustration={<EmptyStateIllustration kind={\`mercato-\${subject}\`} />}
|
|
330
|
+
/>)}
|
|
331
|
+
</div>
|
|
332
|
+
}`
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
};
|
|
200
336
|
const skeletonEntry = {
|
|
201
337
|
id: "skeleton",
|
|
202
338
|
title: "Skeleton",
|
|
@@ -246,9 +382,36 @@ const skeletonEntry = {
|
|
|
246
382
|
}
|
|
247
383
|
]
|
|
248
384
|
};
|
|
385
|
+
function CircularSourceDemo() {
|
|
386
|
+
const t = useT();
|
|
387
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-6", children: [
|
|
388
|
+
[48, 56, 64, 72, 80].map((size) => /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [
|
|
389
|
+
/* @__PURE__ */ jsxs("span", { className: "w-12 text-xs text-muted-foreground", children: [
|
|
390
|
+
size,
|
|
391
|
+
"px"
|
|
392
|
+
] }),
|
|
393
|
+
[0, 25, 50, 75, 100].map((value) => /* @__PURE__ */ jsx(CircularProgress, { value, size, showValue: size !== 48, ariaLabel: t("design_system.gallery.examples.navigation.progress") }, value))
|
|
394
|
+
] }, size)),
|
|
395
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("design_system.gallery.examples.navigation.circularHint") })
|
|
396
|
+
] });
|
|
397
|
+
}
|
|
398
|
+
function ProgressLabelDemo() {
|
|
399
|
+
const t = useT();
|
|
400
|
+
const label = t("design_system.gallery.examples.controls.storage");
|
|
401
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-md flex-col gap-6", children: [
|
|
402
|
+
/* @__PURE__ */ jsx(Progress, { value: 80, size: "md", label, "aria-label": label, showValue: true, description: t("design_system.gallery.examples.controls.storageHint") }),
|
|
403
|
+
/* @__PURE__ */ jsx(Progress, { value: 80, size: "md", label, "aria-label": label, showValue: true }),
|
|
404
|
+
/* @__PURE__ */ jsx(Progress, { value: 80, size: "md", "aria-label": label, showValue: true, valuePlacement: "right" })
|
|
405
|
+
] });
|
|
406
|
+
}
|
|
407
|
+
function ProgressEndpointDemo() {
|
|
408
|
+
const t = useT();
|
|
409
|
+
return /* @__PURE__ */ jsx("div", { className: "flex w-full max-w-md flex-col gap-4", children: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100].map((value) => /* @__PURE__ */ jsx(Progress, { value, size: "md", showValue: true, valuePlacement: "right", "aria-label": t("design_system.gallery.examples.controls.storage") }, value)) });
|
|
410
|
+
}
|
|
249
411
|
const progressEntry = {
|
|
250
412
|
id: "progress",
|
|
251
413
|
title: "Progress",
|
|
414
|
+
figmaNodeId: "450:17821",
|
|
252
415
|
importPath: "@open-mercato/ui/primitives/progress",
|
|
253
416
|
variants: [
|
|
254
417
|
{
|
|
@@ -262,15 +425,7 @@ const progressEntry = {
|
|
|
262
425
|
{
|
|
263
426
|
id: "labelled",
|
|
264
427
|
title: "Labelled",
|
|
265
|
-
render: () => /* @__PURE__ */ jsx(
|
|
266
|
-
Progress,
|
|
267
|
-
{
|
|
268
|
-
value: 80,
|
|
269
|
-
label: "Data storage",
|
|
270
|
-
showValue: true,
|
|
271
|
-
description: "Upgrade to unlock unlimited storage."
|
|
272
|
-
}
|
|
273
|
-
) }),
|
|
428
|
+
render: () => /* @__PURE__ */ jsx(ProgressFeedbackLabelledSample, {}),
|
|
274
429
|
code: `import { Progress } from '@open-mercato/ui/primitives/progress'
|
|
275
430
|
|
|
276
431
|
<Progress
|
|
@@ -315,6 +470,62 @@ const progressEntry = {
|
|
|
315
470
|
<CircularProgress value={75} size="sm" />
|
|
316
471
|
<CircularProgress value={75} size="xs" />
|
|
317
472
|
<CircularProgress value={100} tone="success" showValue />`
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
id: "circular-source-sizes",
|
|
476
|
+
title: "Circular source sizes \xB7 25 states",
|
|
477
|
+
render: () => /* @__PURE__ */ jsx(CircularSourceDemo, {}),
|
|
478
|
+
code: `import { CircularProgress } from '@open-mercato/ui/primitives/progress'
|
|
479
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
480
|
+
|
|
481
|
+
const t = useT()
|
|
482
|
+
|
|
483
|
+
{([48, 56, 64, 72, 80] as const).map((size) => (
|
|
484
|
+
<div key={size} className="flex flex-wrap items-center gap-4">
|
|
485
|
+
<span>{size}px</span>
|
|
486
|
+
{[0, 25, 50, 75, 100].map((value) => (
|
|
487
|
+
<CircularProgress key={value} value={value} size={size} showValue={size !== 48} ariaLabel={t('design_system.gallery.examples.navigation.progress')} />
|
|
488
|
+
))}
|
|
489
|
+
</div>
|
|
490
|
+
))}`
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
id: "label-positions",
|
|
494
|
+
title: "Label positions \xB7 top / description / right",
|
|
495
|
+
render: () => /* @__PURE__ */ jsx(ProgressLabelDemo, {}),
|
|
496
|
+
code: `import * as React from 'react'
|
|
497
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
498
|
+
import { Progress } from '@open-mercato/ui/primitives/progress'
|
|
499
|
+
|
|
500
|
+
function ProgressLabelDemo() {
|
|
501
|
+
const t = useT()
|
|
502
|
+
const label = t('design_system.gallery.examples.controls.storage')
|
|
503
|
+
return <div className="flex w-full max-w-md flex-col gap-6">
|
|
504
|
+
<Progress value={80} size="md" label={label} aria-label={label} showValue description={t('design_system.gallery.examples.controls.storageHint')} />
|
|
505
|
+
<Progress value={80} size="md" label={label} aria-label={label} showValue />
|
|
506
|
+
<Progress value={80} size="md" aria-label={label} showValue valuePlacement="right" />
|
|
507
|
+
</div>
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
<ProgressLabelDemo />`
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
id: "endpoints",
|
|
515
|
+
title: "Linear values \xB7 0 to 100",
|
|
516
|
+
render: () => /* @__PURE__ */ jsx(ProgressEndpointDemo, {}),
|
|
517
|
+
code: `import * as React from 'react'
|
|
518
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
519
|
+
import { Progress } from '@open-mercato/ui/primitives/progress'
|
|
520
|
+
|
|
521
|
+
function ProgressEndpointDemo() {
|
|
522
|
+
const t = useT()
|
|
523
|
+
return <div className="flex w-full max-w-md flex-col gap-4">
|
|
524
|
+
{[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100].map(value => <Progress key={value} value={value} size="md" showValue valuePlacement="right" aria-label={t('design_system.gallery.examples.controls.storage')} />)}
|
|
525
|
+
</div>
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
<ProgressEndpointDemo />`
|
|
318
529
|
}
|
|
319
530
|
]
|
|
320
531
|
};
|
|
@@ -340,10 +551,7 @@ const spinnerEntry = {
|
|
|
340
551
|
{
|
|
341
552
|
id: "inline-with-label",
|
|
342
553
|
title: "Inline with label",
|
|
343
|
-
render: () => /* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */ jsx(Spinner, { size: "sm" }),
|
|
345
|
-
"Loading orders\u2026"
|
|
346
|
-
] }),
|
|
554
|
+
render: () => /* @__PURE__ */ jsx(SpinnerFeedbackInlineWithLabelSample, {}),
|
|
347
555
|
code: `import { Spinner } from '@open-mercato/ui/primitives/spinner'
|
|
348
556
|
|
|
349
557
|
<span className="inline-flex items-center gap-2 text-sm text-muted-foreground">
|
|
@@ -353,14 +561,16 @@ const spinnerEntry = {
|
|
|
353
561
|
}
|
|
354
562
|
]
|
|
355
563
|
};
|
|
356
|
-
function InteractiveRatingDemo() {
|
|
564
|
+
function InteractiveRatingDemo({ allowHalf = false }) {
|
|
565
|
+
const t = useT();
|
|
357
566
|
const [value, setValue] = React.useState(3);
|
|
358
|
-
return /* @__PURE__ */ jsx(Rating, { value, onChange: setValue, "aria-label": "
|
|
567
|
+
return /* @__PURE__ */ jsx(Rating, { value, onChange: setValue, allowHalf, "aria-label": t("design_system.gallery.samples.rating.label") });
|
|
359
568
|
}
|
|
360
569
|
const ratingEntry = {
|
|
361
570
|
id: "rating",
|
|
362
571
|
title: "Rating",
|
|
363
572
|
importPath: "@open-mercato/ui/primitives/rating",
|
|
573
|
+
figmaNodeId: "532:4340",
|
|
364
574
|
variants: [
|
|
365
575
|
{
|
|
366
576
|
id: "read-only",
|
|
@@ -383,10 +593,32 @@ const ratingEntry = {
|
|
|
383
593
|
title: "Interactive",
|
|
384
594
|
render: () => /* @__PURE__ */ jsx(InteractiveRatingDemo, {}),
|
|
385
595
|
code: `import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
596
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
597
|
+
|
|
598
|
+
const t = useT()
|
|
599
|
+
const [value, setValue] = React.useState(3)
|
|
600
|
+
|
|
601
|
+
<Rating value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
id: "half-heart",
|
|
605
|
+
title: "Heart / half precision",
|
|
606
|
+
render: () => /* @__PURE__ */ jsx(Rating, { value: 3.5, icon: "heart", allowHalf: true }),
|
|
607
|
+
code: `import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
386
608
|
|
|
609
|
+
<Rating value={3.5} icon="heart" allowHalf />`
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
id: "interactive-half",
|
|
613
|
+
title: "Interactive / half precision",
|
|
614
|
+
render: () => /* @__PURE__ */ jsx(InteractiveRatingDemo, { allowHalf: true }),
|
|
615
|
+
code: `import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
616
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
617
|
+
|
|
618
|
+
const t = useT()
|
|
387
619
|
const [value, setValue] = React.useState(3)
|
|
388
620
|
|
|
389
|
-
<Rating value={value} onChange={setValue} aria-label=
|
|
621
|
+
<Rating value={value} onChange={setValue} allowHalf aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
390
622
|
},
|
|
391
623
|
{
|
|
392
624
|
id: "icons-and-sizes",
|
|
@@ -401,6 +633,452 @@ const [value, setValue] = React.useState(3)
|
|
|
401
633
|
<Rating value={3} max={5} icon="heart" />
|
|
402
634
|
<Rating value={3} max={5} icon="circle" size="sm" />
|
|
403
635
|
<Rating value={3} max={5} size="lg" />`
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
id: "cell-star-default",
|
|
639
|
+
title: "Cell / star / default and live hover",
|
|
640
|
+
render: () => /* @__PURE__ */ jsx(RatingCellDemo, { icon: "star", initialValue: 0 }),
|
|
641
|
+
code: `import * as React from 'react'
|
|
642
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
643
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
644
|
+
|
|
645
|
+
function RatingCellExample() {
|
|
646
|
+
const t = useT()
|
|
647
|
+
const [value, setValue] = React.useState(0)
|
|
648
|
+
return <Rating appearance="cell" icon="star" value={value} onChange={setValue} max={1} aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
<RatingCellExample />`
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
id: "cell-star-selected",
|
|
655
|
+
title: "Cell / star / selected and live hover",
|
|
656
|
+
render: () => /* @__PURE__ */ jsx(RatingCellDemo, { icon: "star", initialValue: 1 }),
|
|
657
|
+
code: `import * as React from 'react'
|
|
658
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
659
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
660
|
+
|
|
661
|
+
function RatingCellExample() {
|
|
662
|
+
const t = useT()
|
|
663
|
+
const [value, setValue] = React.useState(1)
|
|
664
|
+
return <Rating appearance="cell" icon="star" value={value} onChange={setValue} max={1} aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
<RatingCellExample />`
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
id: "cell-heart-default",
|
|
671
|
+
title: "Cell / heart / default and live hover",
|
|
672
|
+
render: () => /* @__PURE__ */ jsx(RatingCellDemo, { icon: "heart", initialValue: 0 }),
|
|
673
|
+
code: `import * as React from 'react'
|
|
674
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
675
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
676
|
+
|
|
677
|
+
function RatingCellExample() {
|
|
678
|
+
const t = useT()
|
|
679
|
+
const [value, setValue] = React.useState(0)
|
|
680
|
+
return <Rating appearance="cell" icon="heart" value={value} onChange={setValue} max={1} aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
<RatingCellExample />`
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
id: "cell-heart-selected",
|
|
687
|
+
title: "Cell / heart / selected and live hover",
|
|
688
|
+
render: () => /* @__PURE__ */ jsx(RatingCellDemo, { icon: "heart", initialValue: 1 }),
|
|
689
|
+
code: `import * as React from 'react'
|
|
690
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
691
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
692
|
+
|
|
693
|
+
function RatingCellExample() {
|
|
694
|
+
const t = useT()
|
|
695
|
+
const [value, setValue] = React.useState(1)
|
|
696
|
+
return <Rating appearance="cell" icon="heart" value={value} onChange={setValue} max={1} aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
<RatingCellExample />`
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
id: "cells-interactive",
|
|
703
|
+
title: "Cells / keyboard selection",
|
|
704
|
+
render: () => /* @__PURE__ */ jsx(RatingCellDemo, { icon: "star", initialValue: 3, max: 5 }),
|
|
705
|
+
code: `import * as React from 'react'
|
|
706
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
707
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
708
|
+
|
|
709
|
+
function RatingCellsExample() {
|
|
710
|
+
const t = useT()
|
|
711
|
+
const [value, setValue] = React.useState(3)
|
|
712
|
+
return <Rating appearance="cell" value={value} onChange={setValue} max={5} aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
<RatingCellsExample />`
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
id: "cells-disabled",
|
|
719
|
+
title: "Cells / disabled",
|
|
720
|
+
render: () => /* @__PURE__ */ jsx(RatingCellDemo, { icon: "star", initialValue: 3, max: 5, disabled: true }),
|
|
721
|
+
code: `import * as React from 'react'
|
|
722
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
723
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
724
|
+
|
|
725
|
+
function RatingCellsExample() {
|
|
726
|
+
const t = useT()
|
|
727
|
+
const [value, setValue] = React.useState(3)
|
|
728
|
+
return <Rating appearance="cell" value={value} onChange={setValue} max={5} disabled aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
<RatingCellsExample />`
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
id: "review-star-vertical",
|
|
735
|
+
title: "Review / star / vertical",
|
|
736
|
+
render: () => /* @__PURE__ */ jsx(RatingReviewDemo, { icon: "star", alignment: "vertical" }),
|
|
737
|
+
code: `import * as React from 'react'
|
|
738
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
739
|
+
import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
|
|
740
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
741
|
+
import { LinkButton } from '@open-mercato/ui/primitives/link-button'
|
|
742
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
743
|
+
import { ScrollArea } from '@open-mercato/ui/primitives/scroll-area'
|
|
744
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@open-mercato/ui/primitives/dialog'
|
|
745
|
+
|
|
746
|
+
function RatingReviewExample({ icon, alignment }: { icon: 'star' | 'heart'; alignment: 'vertical' | 'horizontal' }) {
|
|
747
|
+
const t = useT()
|
|
748
|
+
const locale = useLocale()
|
|
749
|
+
const [open, setOpen] = React.useState(false)
|
|
750
|
+
const value = new Intl.NumberFormat(locale).format(4.5)
|
|
751
|
+
const count = new Intl.NumberFormat(locale, { notation: 'compact', maximumFractionDigits: 1 }).format(5200)
|
|
752
|
+
const summary = t('design_system.gallery.samples.rating.summary', '{value} \u2219 {count} Ratings', { value, count })
|
|
753
|
+
const reviews = t('design_system.gallery.samples.rating.reviews', '{count} reviews', { count: 18 })
|
|
754
|
+
return (
|
|
755
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
756
|
+
<div data-slot="rating-review" data-alignment={alignment} className={cn('inline-flex max-w-full items-start gap-2', alignment === 'vertical' ? 'flex-col' : 'flex-wrap')}>
|
|
757
|
+
<Rating value={4.5} allowHalf icon={icon} />
|
|
758
|
+
<div className="flex flex-wrap items-start gap-1 text-sm leading-5">
|
|
759
|
+
<span>{summary}</span>
|
|
760
|
+
<LinkButton asChild variant="gray" underline="always"><DialogTrigger>{reviews}</DialogTrigger></LinkButton>
|
|
761
|
+
</div>
|
|
762
|
+
</div>
|
|
763
|
+
<DialogContent onKeyDownCapture={event => { if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) { event.preventDefault(); setOpen(false) } }}>
|
|
764
|
+
<DialogHeader><DialogTitle>{reviews}</DialogTitle><DialogDescription>{summary}</DialogDescription></DialogHeader>
|
|
765
|
+
<ScrollArea className="h-72" scrollbarSize="md">
|
|
766
|
+
<ol className="flex flex-col gap-3 pr-6">
|
|
767
|
+
{Array.from({ length: 18 }, (_, index) => <li key={index} className="flex items-center justify-between gap-3 text-sm"><span>{t('design_system.gallery.samples.rating.reviewNumber', 'Review {number}', { number: index + 1 })}</span><Rating value={index < 9 ? 5 : 4} icon={icon} /></li>)}
|
|
768
|
+
</ol>
|
|
769
|
+
</ScrollArea>
|
|
770
|
+
<DialogFooter><Button asChild variant="outline"><DialogClose>{t('common.close')}</DialogClose></Button></DialogFooter>
|
|
771
|
+
</DialogContent>
|
|
772
|
+
</Dialog>
|
|
773
|
+
)
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
<RatingReviewExample icon="star" alignment="vertical" />`
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
id: "review-star-horizontal",
|
|
780
|
+
title: "Review / star / horizontal",
|
|
781
|
+
render: () => /* @__PURE__ */ jsx(RatingReviewDemo, { icon: "star", alignment: "horizontal" }),
|
|
782
|
+
code: `import * as React from 'react'
|
|
783
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
784
|
+
import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
|
|
785
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
786
|
+
import { LinkButton } from '@open-mercato/ui/primitives/link-button'
|
|
787
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
788
|
+
import { ScrollArea } from '@open-mercato/ui/primitives/scroll-area'
|
|
789
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@open-mercato/ui/primitives/dialog'
|
|
790
|
+
|
|
791
|
+
function RatingReviewExample({ icon, alignment }: { icon: 'star' | 'heart'; alignment: 'vertical' | 'horizontal' }) {
|
|
792
|
+
const t = useT()
|
|
793
|
+
const locale = useLocale()
|
|
794
|
+
const [open, setOpen] = React.useState(false)
|
|
795
|
+
const value = new Intl.NumberFormat(locale).format(4.5)
|
|
796
|
+
const count = new Intl.NumberFormat(locale, { notation: 'compact', maximumFractionDigits: 1 }).format(5200)
|
|
797
|
+
const summary = t('design_system.gallery.samples.rating.summary', '{value} \u2219 {count} Ratings', { value, count })
|
|
798
|
+
const reviews = t('design_system.gallery.samples.rating.reviews', '{count} reviews', { count: 18 })
|
|
799
|
+
return (
|
|
800
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
801
|
+
<div data-slot="rating-review" data-alignment={alignment} className={cn('inline-flex max-w-full items-start gap-2', alignment === 'vertical' ? 'flex-col' : 'flex-wrap')}>
|
|
802
|
+
<Rating value={4.5} allowHalf icon={icon} />
|
|
803
|
+
<div className="flex flex-wrap items-start gap-1 text-sm leading-5">
|
|
804
|
+
<span>{summary}</span>
|
|
805
|
+
<LinkButton asChild variant="gray" underline="always"><DialogTrigger>{reviews}</DialogTrigger></LinkButton>
|
|
806
|
+
</div>
|
|
807
|
+
</div>
|
|
808
|
+
<DialogContent onKeyDownCapture={event => { if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) { event.preventDefault(); setOpen(false) } }}>
|
|
809
|
+
<DialogHeader><DialogTitle>{reviews}</DialogTitle><DialogDescription>{summary}</DialogDescription></DialogHeader>
|
|
810
|
+
<ScrollArea className="h-72" scrollbarSize="md">
|
|
811
|
+
<ol className="flex flex-col gap-3 pr-6">
|
|
812
|
+
{Array.from({ length: 18 }, (_, index) => <li key={index} className="flex items-center justify-between gap-3 text-sm"><span>{t('design_system.gallery.samples.rating.reviewNumber', 'Review {number}', { number: index + 1 })}</span><Rating value={index < 9 ? 5 : 4} icon={icon} /></li>)}
|
|
813
|
+
</ol>
|
|
814
|
+
</ScrollArea>
|
|
815
|
+
<DialogFooter><Button asChild variant="outline"><DialogClose>{t('common.close')}</DialogClose></Button></DialogFooter>
|
|
816
|
+
</DialogContent>
|
|
817
|
+
</Dialog>
|
|
818
|
+
)
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
<RatingReviewExample icon="star" alignment="horizontal" />`
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
id: "review-heart-vertical",
|
|
825
|
+
title: "Review / heart / vertical",
|
|
826
|
+
render: () => /* @__PURE__ */ jsx(RatingReviewDemo, { icon: "heart", alignment: "vertical" }),
|
|
827
|
+
code: `import * as React from 'react'
|
|
828
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
829
|
+
import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
|
|
830
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
831
|
+
import { LinkButton } from '@open-mercato/ui/primitives/link-button'
|
|
832
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
833
|
+
import { ScrollArea } from '@open-mercato/ui/primitives/scroll-area'
|
|
834
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@open-mercato/ui/primitives/dialog'
|
|
835
|
+
|
|
836
|
+
function RatingReviewExample({ icon, alignment }: { icon: 'star' | 'heart'; alignment: 'vertical' | 'horizontal' }) {
|
|
837
|
+
const t = useT()
|
|
838
|
+
const locale = useLocale()
|
|
839
|
+
const [open, setOpen] = React.useState(false)
|
|
840
|
+
const value = new Intl.NumberFormat(locale).format(4.5)
|
|
841
|
+
const count = new Intl.NumberFormat(locale, { notation: 'compact', maximumFractionDigits: 1 }).format(5200)
|
|
842
|
+
const summary = t('design_system.gallery.samples.rating.summary', '{value} \u2219 {count} Ratings', { value, count })
|
|
843
|
+
const reviews = t('design_system.gallery.samples.rating.reviews', '{count} reviews', { count: 18 })
|
|
844
|
+
return (
|
|
845
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
846
|
+
<div data-slot="rating-review" data-alignment={alignment} className={cn('inline-flex max-w-full items-start gap-2', alignment === 'vertical' ? 'flex-col' : 'flex-wrap')}>
|
|
847
|
+
<Rating value={4.5} allowHalf icon={icon} />
|
|
848
|
+
<div className="flex flex-wrap items-start gap-1 text-sm leading-5">
|
|
849
|
+
<span>{summary}</span>
|
|
850
|
+
<LinkButton asChild variant="gray" underline="always"><DialogTrigger>{reviews}</DialogTrigger></LinkButton>
|
|
851
|
+
</div>
|
|
852
|
+
</div>
|
|
853
|
+
<DialogContent onKeyDownCapture={event => { if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) { event.preventDefault(); setOpen(false) } }}>
|
|
854
|
+
<DialogHeader><DialogTitle>{reviews}</DialogTitle><DialogDescription>{summary}</DialogDescription></DialogHeader>
|
|
855
|
+
<ScrollArea className="h-72" scrollbarSize="md">
|
|
856
|
+
<ol className="flex flex-col gap-3 pr-6">
|
|
857
|
+
{Array.from({ length: 18 }, (_, index) => <li key={index} className="flex items-center justify-between gap-3 text-sm"><span>{t('design_system.gallery.samples.rating.reviewNumber', 'Review {number}', { number: index + 1 })}</span><Rating value={index < 9 ? 5 : 4} icon={icon} /></li>)}
|
|
858
|
+
</ol>
|
|
859
|
+
</ScrollArea>
|
|
860
|
+
<DialogFooter><Button asChild variant="outline"><DialogClose>{t('common.close')}</DialogClose></Button></DialogFooter>
|
|
861
|
+
</DialogContent>
|
|
862
|
+
</Dialog>
|
|
863
|
+
)
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
<RatingReviewExample icon="heart" alignment="vertical" />`
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
id: "review-heart-horizontal",
|
|
870
|
+
title: "Review / heart / horizontal",
|
|
871
|
+
render: () => /* @__PURE__ */ jsx(RatingReviewDemo, { icon: "heart", alignment: "horizontal" }),
|
|
872
|
+
code: `import * as React from 'react'
|
|
873
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
874
|
+
import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
|
|
875
|
+
import { Rating } from '@open-mercato/ui/primitives/rating'
|
|
876
|
+
import { LinkButton } from '@open-mercato/ui/primitives/link-button'
|
|
877
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
878
|
+
import { ScrollArea } from '@open-mercato/ui/primitives/scroll-area'
|
|
879
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@open-mercato/ui/primitives/dialog'
|
|
880
|
+
|
|
881
|
+
function RatingReviewExample({ icon, alignment }: { icon: 'star' | 'heart'; alignment: 'vertical' | 'horizontal' }) {
|
|
882
|
+
const t = useT()
|
|
883
|
+
const locale = useLocale()
|
|
884
|
+
const [open, setOpen] = React.useState(false)
|
|
885
|
+
const value = new Intl.NumberFormat(locale).format(4.5)
|
|
886
|
+
const count = new Intl.NumberFormat(locale, { notation: 'compact', maximumFractionDigits: 1 }).format(5200)
|
|
887
|
+
const summary = t('design_system.gallery.samples.rating.summary', '{value} \u2219 {count} Ratings', { value, count })
|
|
888
|
+
const reviews = t('design_system.gallery.samples.rating.reviews', '{count} reviews', { count: 18 })
|
|
889
|
+
return (
|
|
890
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
891
|
+
<div data-slot="rating-review" data-alignment={alignment} className={cn('inline-flex max-w-full items-start gap-2', alignment === 'vertical' ? 'flex-col' : 'flex-wrap')}>
|
|
892
|
+
<Rating value={4.5} allowHalf icon={icon} />
|
|
893
|
+
<div className="flex flex-wrap items-start gap-1 text-sm leading-5">
|
|
894
|
+
<span>{summary}</span>
|
|
895
|
+
<LinkButton asChild variant="gray" underline="always"><DialogTrigger>{reviews}</DialogTrigger></LinkButton>
|
|
896
|
+
</div>
|
|
897
|
+
</div>
|
|
898
|
+
<DialogContent onKeyDownCapture={event => { if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) { event.preventDefault(); setOpen(false) } }}>
|
|
899
|
+
<DialogHeader><DialogTitle>{reviews}</DialogTitle><DialogDescription>{summary}</DialogDescription></DialogHeader>
|
|
900
|
+
<ScrollArea className="h-72" scrollbarSize="md">
|
|
901
|
+
<ol className="flex flex-col gap-3 pr-6">
|
|
902
|
+
{Array.from({ length: 18 }, (_, index) => <li key={index} className="flex items-center justify-between gap-3 text-sm"><span>{t('design_system.gallery.samples.rating.reviewNumber', 'Review {number}', { number: index + 1 })}</span><Rating value={index < 9 ? 5 : 4} icon={icon} /></li>)}
|
|
903
|
+
</ol>
|
|
904
|
+
</ScrollArea>
|
|
905
|
+
<DialogFooter><Button asChild variant="outline"><DialogClose>{t('common.close')}</DialogClose></Button></DialogFooter>
|
|
906
|
+
</DialogContent>
|
|
907
|
+
</Dialog>
|
|
908
|
+
)
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
<RatingReviewExample icon="heart" alignment="horizontal" />`
|
|
912
|
+
}
|
|
913
|
+
]
|
|
914
|
+
};
|
|
915
|
+
function RatingBarDemo({ variant = "emoji", initialValue = 0, disabled = false, feedback = false }) {
|
|
916
|
+
const t = useT();
|
|
917
|
+
const [value, setValue] = React.useState(initialValue);
|
|
918
|
+
const bar = /* @__PURE__ */ jsx(RatingBar, { variant, value, onChange: setValue, disabled, "aria-label": t("design_system.gallery.samples.rating.label"), className: feedback ? "w-full border-0 border-b" : void 0 });
|
|
919
|
+
return feedback ? /* @__PURE__ */ jsxs("div", { className: "w-80 max-w-full overflow-hidden rounded-xl border border-border bg-background focus-within:shadow-focus", children: [
|
|
920
|
+
bar,
|
|
921
|
+
/* @__PURE__ */ jsx(Textarea, { "aria-label": t("design_system.gallery.samples.rating.feedback"), placeholder: t("design_system.gallery.samples.rating.feedback"), disabled, className: "min-h-24 resize-none rounded-none border-0 p-3 shadow-none focus-visible:shadow-none" })
|
|
922
|
+
] }) : bar;
|
|
923
|
+
}
|
|
924
|
+
const ratingBarEntry = {
|
|
925
|
+
id: "rating-bar",
|
|
926
|
+
title: "RatingBar",
|
|
927
|
+
importPath: "@open-mercato/ui/primitives/rating-bar",
|
|
928
|
+
figmaNodeId: "535:4658",
|
|
929
|
+
usage: {
|
|
930
|
+
do: ["Use the five-part feedback scale with a translated group label.", "The feedback-area composition joins the scale to a Textarea and keeps both controls independently accessible."],
|
|
931
|
+
dont: ["Do not use this feedback scale for unrelated actions; use ButtonGroup for actions."]
|
|
932
|
+
},
|
|
933
|
+
variants: [
|
|
934
|
+
{
|
|
935
|
+
id: "emoji",
|
|
936
|
+
title: "emoji / unselected",
|
|
937
|
+
render: () => /* @__PURE__ */ jsx(RatingBarDemo, { variant: "emoji" }),
|
|
938
|
+
code: `import { RatingBar } from '@open-mercato/ui/primitives/rating-bar'
|
|
939
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
940
|
+
|
|
941
|
+
const t = useT()
|
|
942
|
+
const [value, setValue] = React.useState(0)
|
|
943
|
+
|
|
944
|
+
<RatingBar variant="emoji" value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
id: "emoji-selected",
|
|
948
|
+
title: "emoji / selected",
|
|
949
|
+
render: () => /* @__PURE__ */ jsx(RatingBarDemo, { variant: "emoji", initialValue: 4 }),
|
|
950
|
+
code: `import { RatingBar } from '@open-mercato/ui/primitives/rating-bar'
|
|
951
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
952
|
+
|
|
953
|
+
const t = useT()
|
|
954
|
+
const [value, setValue] = React.useState(4)
|
|
955
|
+
|
|
956
|
+
<RatingBar variant="emoji" value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
id: "number",
|
|
960
|
+
title: "number / unselected",
|
|
961
|
+
render: () => /* @__PURE__ */ jsx(RatingBarDemo, { variant: "number" }),
|
|
962
|
+
code: `import { RatingBar } from '@open-mercato/ui/primitives/rating-bar'
|
|
963
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
964
|
+
|
|
965
|
+
const t = useT()
|
|
966
|
+
const [value, setValue] = React.useState(0)
|
|
967
|
+
|
|
968
|
+
<RatingBar variant="number" value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
id: "number-selected",
|
|
972
|
+
title: "number / selected",
|
|
973
|
+
render: () => /* @__PURE__ */ jsx(RatingBarDemo, { variant: "number", initialValue: 4 }),
|
|
974
|
+
code: `import { RatingBar } from '@open-mercato/ui/primitives/rating-bar'
|
|
975
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
976
|
+
|
|
977
|
+
const t = useT()
|
|
978
|
+
const [value, setValue] = React.useState(4)
|
|
979
|
+
|
|
980
|
+
<RatingBar variant="number" value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
id: "star",
|
|
984
|
+
title: "star / unselected",
|
|
985
|
+
render: () => /* @__PURE__ */ jsx(RatingBarDemo, { variant: "star" }),
|
|
986
|
+
code: `import { RatingBar } from '@open-mercato/ui/primitives/rating-bar'
|
|
987
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
988
|
+
|
|
989
|
+
const t = useT()
|
|
990
|
+
const [value, setValue] = React.useState(0)
|
|
991
|
+
|
|
992
|
+
<RatingBar variant="star" value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
id: "star-selected",
|
|
996
|
+
title: "star / selected",
|
|
997
|
+
render: () => /* @__PURE__ */ jsx(RatingBarDemo, { variant: "star", initialValue: 4 }),
|
|
998
|
+
code: `import { RatingBar } from '@open-mercato/ui/primitives/rating-bar'
|
|
999
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1000
|
+
|
|
1001
|
+
const t = useT()
|
|
1002
|
+
const [value, setValue] = React.useState(4)
|
|
1003
|
+
|
|
1004
|
+
<RatingBar variant="star" value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
id: "heart",
|
|
1008
|
+
title: "heart / unselected",
|
|
1009
|
+
render: () => /* @__PURE__ */ jsx(RatingBarDemo, { variant: "heart" }),
|
|
1010
|
+
code: `import { RatingBar } from '@open-mercato/ui/primitives/rating-bar'
|
|
1011
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1012
|
+
|
|
1013
|
+
const t = useT()
|
|
1014
|
+
const [value, setValue] = React.useState(0)
|
|
1015
|
+
|
|
1016
|
+
<RatingBar variant="heart" value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
id: "heart-selected",
|
|
1020
|
+
title: "heart / selected",
|
|
1021
|
+
render: () => /* @__PURE__ */ jsx(RatingBarDemo, { variant: "heart", initialValue: 4 }),
|
|
1022
|
+
code: `import { RatingBar } from '@open-mercato/ui/primitives/rating-bar'
|
|
1023
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1024
|
+
|
|
1025
|
+
const t = useT()
|
|
1026
|
+
const [value, setValue] = React.useState(4)
|
|
1027
|
+
|
|
1028
|
+
<RatingBar variant="heart" value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} />`
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
id: "feedback-area",
|
|
1032
|
+
title: "Feedback area / all types",
|
|
1033
|
+
render: () => /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-wrap gap-6", children: [
|
|
1034
|
+
/* @__PURE__ */ jsx(RatingBarDemo, { variant: "emoji", feedback: true }),
|
|
1035
|
+
/* @__PURE__ */ jsx(RatingBarDemo, { variant: "number", feedback: true }),
|
|
1036
|
+
/* @__PURE__ */ jsx(RatingBarDemo, { variant: "star", feedback: true }),
|
|
1037
|
+
/* @__PURE__ */ jsx(RatingBarDemo, { variant: "heart", feedback: true })
|
|
1038
|
+
] }),
|
|
1039
|
+
code: `import { RatingBar, type RatingBarProps } from '@open-mercato/ui/primitives/rating-bar'
|
|
1040
|
+
import { Textarea } from '@open-mercato/ui/primitives/textarea'
|
|
1041
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1042
|
+
|
|
1043
|
+
function RatingFeedback({ variant }: { variant: RatingBarProps['variant'] }) {
|
|
1044
|
+
const t = useT()
|
|
1045
|
+
const [value, setValue] = React.useState(0)
|
|
1046
|
+
return (
|
|
1047
|
+
<div className="w-80 max-w-full overflow-hidden rounded-xl border border-border bg-background focus-within:shadow-focus">
|
|
1048
|
+
<RatingBar variant={variant} value={value} onChange={setValue} aria-label={t('design_system.gallery.samples.rating.label')} className="w-full border-0 border-b" />
|
|
1049
|
+
<Textarea aria-label={t('design_system.gallery.samples.rating.feedback')} placeholder={t('design_system.gallery.samples.rating.feedback')} className="min-h-24 resize-none rounded-none border-0 p-3 shadow-none focus-visible:shadow-none" />
|
|
1050
|
+
</div>
|
|
1051
|
+
)
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
<div className="flex w-full flex-wrap gap-6">
|
|
1055
|
+
<RatingFeedback variant="emoji" />
|
|
1056
|
+
<RatingFeedback variant="number" />
|
|
1057
|
+
<RatingFeedback variant="star" />
|
|
1058
|
+
<RatingFeedback variant="heart" />
|
|
1059
|
+
</div>`
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
id: "disabled",
|
|
1063
|
+
title: "Disabled / all types",
|
|
1064
|
+
render: () => /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-wrap gap-6", children: [
|
|
1065
|
+
/* @__PURE__ */ jsx(RatingBarDemo, { variant: "emoji", initialValue: 4, disabled: true }),
|
|
1066
|
+
/* @__PURE__ */ jsx(RatingBarDemo, { variant: "number", initialValue: 4, disabled: true }),
|
|
1067
|
+
/* @__PURE__ */ jsx(RatingBarDemo, { variant: "star", initialValue: 4, disabled: true }),
|
|
1068
|
+
/* @__PURE__ */ jsx(RatingBarDemo, { variant: "heart", initialValue: 4, disabled: true })
|
|
1069
|
+
] }),
|
|
1070
|
+
code: `import { RatingBar } from '@open-mercato/ui/primitives/rating-bar'
|
|
1071
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1072
|
+
|
|
1073
|
+
const t = useT()
|
|
1074
|
+
const [value, setValue] = React.useState(4)
|
|
1075
|
+
|
|
1076
|
+
<div className="flex w-full flex-wrap gap-6">
|
|
1077
|
+
<RatingBar variant="emoji" value={value} onChange={setValue} disabled aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
1078
|
+
<RatingBar variant="number" value={value} onChange={setValue} disabled aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
1079
|
+
<RatingBar variant="star" value={value} onChange={setValue} disabled aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
1080
|
+
<RatingBar variant="heart" value={value} onChange={setValue} disabled aria-label={t('design_system.gallery.samples.rating.label')} />
|
|
1081
|
+
</div>`
|
|
404
1082
|
}
|
|
405
1083
|
]
|
|
406
1084
|
};
|
|
@@ -419,9 +1097,42 @@ const errorSteps = [
|
|
|
419
1097
|
{ id: "validate", label: "Validation", status: "error" },
|
|
420
1098
|
{ id: "import", label: "Import", status: "pending" }
|
|
421
1099
|
];
|
|
1100
|
+
function StepQuantityDemo({ orientation }) {
|
|
1101
|
+
const t = useT();
|
|
1102
|
+
return /* @__PURE__ */ jsx("div", { className: orientation === "vertical" ? "grid w-full gap-6 md:grid-cols-3" : "flex w-full flex-col gap-6 overflow-x-auto", children: [3, 4, 5].map((count) => /* @__PURE__ */ jsx(StepIndicator, { showNumbers: true, orientation, steps: Array.from({ length: count }, (_, index) => ({
|
|
1103
|
+
id: String(index),
|
|
1104
|
+
label: t("design_system.gallery.examples.navigation.step", { step: index + 1 }),
|
|
1105
|
+
status: index === 0 ? "complete" : index === 1 ? "current" : "pending"
|
|
1106
|
+
})) }, count)) });
|
|
1107
|
+
}
|
|
1108
|
+
function StepInteractiveDemo() {
|
|
1109
|
+
const t = useT();
|
|
1110
|
+
const [activeStep, setActiveStep] = React.useState(1);
|
|
1111
|
+
const steps = Array.from({ length: 5 }, (_, index) => ({
|
|
1112
|
+
id: String(index),
|
|
1113
|
+
label: t("design_system.gallery.examples.navigation.step", { step: index + 1 }),
|
|
1114
|
+
status: index < activeStep ? "complete" : index === activeStep ? "current" : "pending"
|
|
1115
|
+
}));
|
|
1116
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-4", children: [
|
|
1117
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto p-1", children: /* @__PURE__ */ jsx(StepIndicator, { steps, showNumbers: true, onStepClick: (id) => setActiveStep(Number(id)) }) }),
|
|
1118
|
+
/* @__PURE__ */ jsx(StepperDots, { count: 5, activeStep, "aria-label": t("design_system.gallery.examples.navigation.progress") }),
|
|
1119
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
1120
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", disabled: activeStep === 0, onClick: () => setActiveStep((value) => value - 1), children: t("design_system.gallery.examples.navigation.previous") }),
|
|
1121
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", disabled: activeStep === 4, onClick: () => setActiveStep((value) => value + 1), children: t("design_system.gallery.examples.navigation.next") })
|
|
1122
|
+
] })
|
|
1123
|
+
] });
|
|
1124
|
+
}
|
|
1125
|
+
function StepperDotsDemo() {
|
|
1126
|
+
const t = useT();
|
|
1127
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-8", children: ["sm", "xs"].map((size) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
1128
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: size }),
|
|
1129
|
+
[0, 1, 2].map((activeStep) => /* @__PURE__ */ jsx(StepperDots, { count: 3, activeStep, size, "aria-label": t("design_system.gallery.examples.navigation.progress") }, activeStep))
|
|
1130
|
+
] }, size)) });
|
|
1131
|
+
}
|
|
422
1132
|
const stepIndicatorEntry = {
|
|
423
1133
|
id: "step-indicator",
|
|
424
1134
|
title: "StepIndicator",
|
|
1135
|
+
figmaNodeId: "3507:28",
|
|
425
1136
|
importPath: "@open-mercato/ui/primitives/step-indicator",
|
|
426
1137
|
variants: [
|
|
427
1138
|
{
|
|
@@ -465,6 +1176,96 @@ const steps: StepIndicatorStep[] = [
|
|
|
465
1176
|
]
|
|
466
1177
|
|
|
467
1178
|
<StepIndicator steps={steps} />`
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
id: "horizontal-quantities",
|
|
1182
|
+
title: "horizontal \xB7 3, 4, 5 steps",
|
|
1183
|
+
render: () => /* @__PURE__ */ jsx(StepQuantityDemo, { orientation: "horizontal" }),
|
|
1184
|
+
code: `import { StepIndicator } from '@open-mercato/ui/primitives/step-indicator'
|
|
1185
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1186
|
+
|
|
1187
|
+
const t = useT()
|
|
1188
|
+
|
|
1189
|
+
{[3, 4, 5].map((count) => (
|
|
1190
|
+
<StepIndicator key={count} showNumbers orientation="horizontal" steps={Array.from({ length: count }, (_, index) => ({
|
|
1191
|
+
id: String(index),
|
|
1192
|
+
label: t('design_system.gallery.examples.navigation.step', { step: index + 1 }),
|
|
1193
|
+
status: index === 0 ? 'complete' : index === 1 ? 'current' : 'pending',
|
|
1194
|
+
}))} />
|
|
1195
|
+
))}`
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
id: "vertical-quantities",
|
|
1199
|
+
title: "vertical \xB7 3, 4, 5 steps",
|
|
1200
|
+
render: () => /* @__PURE__ */ jsx(StepQuantityDemo, { orientation: "vertical" }),
|
|
1201
|
+
code: `import { StepIndicator } from '@open-mercato/ui/primitives/step-indicator'
|
|
1202
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1203
|
+
|
|
1204
|
+
const t = useT()
|
|
1205
|
+
|
|
1206
|
+
{[3, 4, 5].map((count) => (
|
|
1207
|
+
<StepIndicator key={count} showNumbers orientation="vertical" steps={Array.from({ length: count }, (_, index) => ({
|
|
1208
|
+
id: String(index),
|
|
1209
|
+
label: t('design_system.gallery.examples.navigation.step', { step: index + 1 }),
|
|
1210
|
+
status: index === 0 ? 'complete' : index === 1 ? 'current' : 'pending',
|
|
1211
|
+
}))} />
|
|
1212
|
+
))}`
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
id: "interactive",
|
|
1216
|
+
title: "Interactive steps and dots",
|
|
1217
|
+
render: () => /* @__PURE__ */ jsx(StepInteractiveDemo, {}),
|
|
1218
|
+
code: `import * as React from 'react'
|
|
1219
|
+
import { StepIndicator, StepperDots, type StepIndicatorStep } from '@open-mercato/ui/primitives/step-indicator'
|
|
1220
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
1221
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1222
|
+
|
|
1223
|
+
function StepInteractiveDemo() {
|
|
1224
|
+
const t = useT()
|
|
1225
|
+
const [activeStep, setActiveStep] = React.useState(1)
|
|
1226
|
+
const steps: StepIndicatorStep[] = Array.from({ length: 5 }, (_, index) => ({
|
|
1227
|
+
id: String(index),
|
|
1228
|
+
label: t('design_system.gallery.examples.navigation.step', { step: index + 1 }),
|
|
1229
|
+
status: index < activeStep ? 'complete' : index === activeStep ? 'current' : 'pending',
|
|
1230
|
+
}))
|
|
1231
|
+
return (
|
|
1232
|
+
<div className="flex w-full flex-col gap-4">
|
|
1233
|
+
<div className="overflow-x-auto p-1"><StepIndicator steps={steps} showNumbers onStepClick={(id) => setActiveStep(Number(id))} /></div>
|
|
1234
|
+
<StepperDots count={5} activeStep={activeStep} aria-label={t('design_system.gallery.examples.navigation.progress')} />
|
|
1235
|
+
<div className="flex gap-2">
|
|
1236
|
+
<Button variant="outline" size="sm" disabled={activeStep === 0} onClick={() => setActiveStep((value) => value - 1)}>{t('design_system.gallery.examples.navigation.previous')}</Button>
|
|
1237
|
+
<Button variant="outline" size="sm" disabled={activeStep === 4} onClick={() => setActiveStep((value) => value + 1)}>{t('design_system.gallery.examples.navigation.next')}</Button>
|
|
1238
|
+
</div>
|
|
1239
|
+
</div>
|
|
1240
|
+
)
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
<StepInteractiveDemo />`
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
id: "dots",
|
|
1247
|
+
title: "StepperDots \xB7 6 states",
|
|
1248
|
+
render: () => /* @__PURE__ */ jsx(StepperDotsDemo, {}),
|
|
1249
|
+
code: `import * as React from 'react'
|
|
1250
|
+
import { StepIndicator, StepperDots, type StepIndicatorStep } from '@open-mercato/ui/primitives/step-indicator'
|
|
1251
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
1252
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1253
|
+
|
|
1254
|
+
function StepperDotsDemo() {
|
|
1255
|
+
const t = useT()
|
|
1256
|
+
return (
|
|
1257
|
+
<div className="flex flex-wrap gap-8">
|
|
1258
|
+
{(['sm', 'xs'] as const).map((size) => (
|
|
1259
|
+
<div key={size} className="flex flex-col gap-4">
|
|
1260
|
+
<span className="text-xs text-muted-foreground">{size}</span>
|
|
1261
|
+
{[0, 1, 2].map((activeStep) => <StepperDots key={activeStep} count={3} activeStep={activeStep} size={size} aria-label={t('design_system.gallery.examples.navigation.progress')} />)}
|
|
1262
|
+
</div>
|
|
1263
|
+
))}
|
|
1264
|
+
</div>
|
|
1265
|
+
)
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
<StepperDotsDemo />`
|
|
468
1269
|
}
|
|
469
1270
|
]
|
|
470
1271
|
};
|
|
@@ -476,14 +1277,7 @@ const notificationEntry = {
|
|
|
476
1277
|
{
|
|
477
1278
|
id: "information",
|
|
478
1279
|
title: "Information",
|
|
479
|
-
render: () => /* @__PURE__ */ jsx(
|
|
480
|
-
Notification,
|
|
481
|
-
{
|
|
482
|
-
title: "Scheduled maintenance",
|
|
483
|
-
description: "The admin panel will be read-only on Sunday between 02:00 and 04:00 UTC.",
|
|
484
|
-
timestamp: "2 min ago"
|
|
485
|
-
}
|
|
486
|
-
) }),
|
|
1280
|
+
render: () => /* @__PURE__ */ jsx(NotificationFeedbackInformationSample, {}),
|
|
487
1281
|
code: `import { Notification } from '@open-mercato/ui/primitives/notification'
|
|
488
1282
|
|
|
489
1283
|
<Notification
|
|
@@ -496,19 +1290,7 @@ const notificationEntry = {
|
|
|
496
1290
|
{
|
|
497
1291
|
id: "success-with-actions",
|
|
498
1292
|
title: "Success with actions",
|
|
499
|
-
render: () => /* @__PURE__ */ jsx(
|
|
500
|
-
Notification,
|
|
501
|
-
{
|
|
502
|
-
status: "success",
|
|
503
|
-
title: "Export ready",
|
|
504
|
-
description: "Your product export (1,204 rows) finished successfully.",
|
|
505
|
-
timestamp: "just now",
|
|
506
|
-
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
507
|
-
/* @__PURE__ */ jsx(LinkButton, { variant: "black", underline: "always", children: "Download" }),
|
|
508
|
-
/* @__PURE__ */ jsx(LinkButton, { variant: "gray", underline: "always", children: "View log" })
|
|
509
|
-
] })
|
|
510
|
-
}
|
|
511
|
-
) }),
|
|
1293
|
+
render: () => /* @__PURE__ */ jsx(NotificationFeedbackSuccessWithActionsSample, {}),
|
|
512
1294
|
code: `import { Notification } from '@open-mercato/ui/primitives/notification'
|
|
513
1295
|
import { LinkButton } from '@open-mercato/ui/primitives/link-button'
|
|
514
1296
|
|
|
@@ -528,16 +1310,7 @@ import { LinkButton } from '@open-mercato/ui/primitives/link-button'
|
|
|
528
1310
|
{
|
|
529
1311
|
id: "error",
|
|
530
1312
|
title: "Error",
|
|
531
|
-
render: () => /* @__PURE__ */ jsx(
|
|
532
|
-
Notification,
|
|
533
|
-
{
|
|
534
|
-
status: "error",
|
|
535
|
-
title: "Webhook delivery failed",
|
|
536
|
-
description: "The endpoint responded with 503 after 3 retries.",
|
|
537
|
-
timestamp: "5 min ago",
|
|
538
|
-
actions: /* @__PURE__ */ jsx(LinkButton, { variant: "error", underline: "always", children: "Retry now" })
|
|
539
|
-
}
|
|
540
|
-
) }),
|
|
1313
|
+
render: () => /* @__PURE__ */ jsx(NotificationFeedbackErrorSample, {}),
|
|
541
1314
|
code: `import { Notification } from '@open-mercato/ui/primitives/notification'
|
|
542
1315
|
import { LinkButton } from '@open-mercato/ui/primitives/link-button'
|
|
543
1316
|
|
|
@@ -553,37 +1326,17 @@ import { LinkButton } from '@open-mercato/ui/primitives/link-button'
|
|
|
553
1326
|
};
|
|
554
1327
|
const notificationFeedEntry = {
|
|
555
1328
|
id: "notification-feed",
|
|
1329
|
+
figmaNodeId: "4308:731",
|
|
556
1330
|
title: "NotificationFeed",
|
|
557
1331
|
importPath: "@open-mercato/ui/primitives/notification-feed",
|
|
558
1332
|
variants: [
|
|
1333
|
+
{ id: "source-tabs-2", title: "4 row types / 2 tabs", render: () => /* @__PURE__ */ jsx(NotificationFeedExample, { tabs: 2 }), code: notificationFeedExampleCode(2) },
|
|
1334
|
+
{ id: "source-tabs-3", title: "4 row types / 3 tabs", render: () => /* @__PURE__ */ jsx(NotificationFeedExample, { tabs: 3 }), code: notificationFeedExampleCode(3) },
|
|
1335
|
+
{ id: "source-tabs-4", title: "4 row types / 4 tabs", render: () => /* @__PURE__ */ jsx(NotificationFeedExample, { tabs: 4 }), code: notificationFeedExampleCode(4) },
|
|
559
1336
|
{
|
|
560
1337
|
id: "default",
|
|
561
1338
|
title: "default",
|
|
562
|
-
render: () => /* @__PURE__ */ jsx(
|
|
563
|
-
/* @__PURE__ */ jsx(NotificationFeedHeader, { title: "Notifications", children: /* @__PURE__ */ jsx(IconButton, { size: "sm", variant: "ghost", "aria-label": "Notification settings", children: /* @__PURE__ */ jsx(Settings, {}) }) }),
|
|
564
|
-
/* @__PURE__ */ jsxs(NotificationFeedList, { children: [
|
|
565
|
-
/* @__PURE__ */ jsx(
|
|
566
|
-
NotificationFeedItem,
|
|
567
|
-
{
|
|
568
|
-
icon: /* @__PURE__ */ jsx(NotificationFeedIconBadge, { tone: "indigo", children: /* @__PURE__ */ jsx(UserPlus, { className: "size-5" }) }),
|
|
569
|
-
title: "New lead generated",
|
|
570
|
-
body: "John Smith submitted the contact form.",
|
|
571
|
-
timestamp: "10 minutes ago",
|
|
572
|
-
unread: true
|
|
573
|
-
}
|
|
574
|
-
),
|
|
575
|
-
/* @__PURE__ */ jsx(
|
|
576
|
-
NotificationFeedItem,
|
|
577
|
-
{
|
|
578
|
-
icon: /* @__PURE__ */ jsx(NotificationFeedIconBadge, { tone: "success", children: /* @__PURE__ */ jsx(RefreshCw, { className: "size-5" }) }),
|
|
579
|
-
title: "Catalog sync completed",
|
|
580
|
-
body: "312 products updated from the PIM.",
|
|
581
|
-
timestamp: "1 hour ago"
|
|
582
|
-
}
|
|
583
|
-
)
|
|
584
|
-
] }),
|
|
585
|
-
/* @__PURE__ */ jsx(NotificationFeedFooter, { children: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", className: "w-full", children: "Archive all" }) })
|
|
586
|
-
] }) }),
|
|
1339
|
+
render: () => /* @__PURE__ */ jsx(NotificationFeedFeedbackDefaultSample, {}),
|
|
587
1340
|
code: `import { Settings, UserPlus } from 'lucide-react'
|
|
588
1341
|
import {
|
|
589
1342
|
NotificationFeed,
|
|
@@ -642,16 +1395,189 @@ import { NotificationFeedIconBadge } from '@open-mercato/ui/primitives/notificat
|
|
|
642
1395
|
]
|
|
643
1396
|
};
|
|
644
1397
|
const entries = [
|
|
1398
|
+
bannerEntry,
|
|
645
1399
|
alertEntry,
|
|
646
1400
|
emptyStateEntry,
|
|
1401
|
+
emptyStateIllustrationEntry,
|
|
647
1402
|
skeletonEntry,
|
|
648
1403
|
progressEntry,
|
|
649
1404
|
spinnerEntry,
|
|
650
1405
|
ratingEntry,
|
|
1406
|
+
ratingBarEntry,
|
|
651
1407
|
stepIndicatorEntry,
|
|
652
1408
|
notificationEntry,
|
|
653
1409
|
notificationFeedEntry
|
|
654
1410
|
];
|
|
1411
|
+
function AlertFeedbackStatusesLightSample() {
|
|
1412
|
+
const t = useT();
|
|
1413
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-md flex-col gap-2", children: [
|
|
1414
|
+
/* @__PURE__ */ jsx(Alert, { status: "error", style: "light", children: t("design_system.gallery.sampleCopy.paymentFailedTheCardWasDeclined") }),
|
|
1415
|
+
/* @__PURE__ */ jsx(Alert, { status: "warning", style: "light", children: t("design_system.gallery.sampleCopy.inventorySyncIsRunningBehindSchedule") }),
|
|
1416
|
+
/* @__PURE__ */ jsx(Alert, { status: "success", style: "light", children: t("design_system.gallery.sampleCopy.order10231WasFulfilled") }),
|
|
1417
|
+
/* @__PURE__ */ jsx(Alert, { status: "information", style: "light", children: t("design_system.gallery.sampleCopy.pricesIncludeVATForEUCustomers") }),
|
|
1418
|
+
/* @__PURE__ */ jsx(Alert, { status: "feature", style: "light", children: t("design_system.gallery.sampleCopy.bulkEditingIsNowAvailableInTheCatalog") })
|
|
1419
|
+
] });
|
|
1420
|
+
}
|
|
1421
|
+
function AlertFeedbackFilledSample() {
|
|
1422
|
+
const t = useT();
|
|
1423
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsxs(Alert, { status: "error", style: "filled", size: "default", children: [
|
|
1424
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t("design_system.gallery.sampleCopy.importFailed") }),
|
|
1425
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: t("design_system.gallery.sampleCopy.14RowsWereRejectedDownloadTheErrorReportToReview") })
|
|
1426
|
+
] }) });
|
|
1427
|
+
}
|
|
1428
|
+
function AlertFeedbackStrokeSample() {
|
|
1429
|
+
const t = useT();
|
|
1430
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsxs(Alert, { status: "success", style: "stroke", size: "default", children: [
|
|
1431
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t("design_system.gallery.sampleCopy.backupComplete") }),
|
|
1432
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: t("design_system.gallery.sampleCopy.theNightlySnapshotFinishedWithoutWarnings") })
|
|
1433
|
+
] }) });
|
|
1434
|
+
}
|
|
1435
|
+
function AlertFeedbackSizesSample() {
|
|
1436
|
+
const t = useT();
|
|
1437
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-md flex-col gap-2", children: [
|
|
1438
|
+
/* @__PURE__ */ jsx(Alert, { status: "information", size: "xs", children: t("design_system.gallery.sampleCopy.xsmallInlineFormHint") }),
|
|
1439
|
+
/* @__PURE__ */ jsx(Alert, { status: "information", size: "sm", children: t("design_system.gallery.sampleCopy.smallTheDefaultSinglelineAlert") }),
|
|
1440
|
+
/* @__PURE__ */ jsxs(Alert, { status: "information", size: "default", children: [
|
|
1441
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t("design_system.gallery.sampleCopy.large") }),
|
|
1442
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: t("design_system.gallery.sampleCopy.multilineAlertWithATitleAndADescriptionBody") })
|
|
1443
|
+
] })
|
|
1444
|
+
] });
|
|
1445
|
+
}
|
|
1446
|
+
function AlertFeedbackDismissibleWithActionSample() {
|
|
1447
|
+
const t = useT();
|
|
1448
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
1449
|
+
Alert,
|
|
1450
|
+
{
|
|
1451
|
+
status: "warning",
|
|
1452
|
+
style: "lighter",
|
|
1453
|
+
dismissible: true,
|
|
1454
|
+
action: /* @__PURE__ */ jsx(LinkButton, { variant: "black", underline: "always", children: t("design_system.gallery.sampleCopy.review") }),
|
|
1455
|
+
children: t("design_system.gallery.sampleCopy.3ProductsAreMissingTaxCategories")
|
|
1456
|
+
}
|
|
1457
|
+
) });
|
|
1458
|
+
}
|
|
1459
|
+
function EmptyStateFeedbackDefaultSample() {
|
|
1460
|
+
const t = useT();
|
|
1461
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
1462
|
+
EmptyState,
|
|
1463
|
+
{
|
|
1464
|
+
title: t("design_system.gallery.sampleCopy.noCustomersYet"),
|
|
1465
|
+
description: t("design_system.gallery.sampleCopy.createYourFirstCustomerToStartTrackingOpportunities")
|
|
1466
|
+
}
|
|
1467
|
+
) });
|
|
1468
|
+
}
|
|
1469
|
+
function EmptyStateFeedbackWithActionsSample() {
|
|
1470
|
+
const t = useT();
|
|
1471
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
1472
|
+
EmptyState,
|
|
1473
|
+
{
|
|
1474
|
+
icon: /* @__PURE__ */ jsx(Inbox, { className: "size-8" }),
|
|
1475
|
+
title: t("design_system.gallery.sampleCopy.noOrdersFound"),
|
|
1476
|
+
description: t("design_system.gallery.sampleCopy.ordersWillAppearHereOnceYourStorefrontStartsSelling"),
|
|
1477
|
+
actions: /* @__PURE__ */ jsx(Button, { size: "sm", children: t("design_system.gallery.sampleCopy.createOrder") })
|
|
1478
|
+
}
|
|
1479
|
+
) });
|
|
1480
|
+
}
|
|
1481
|
+
function EmptyStateFeedbackSubtleSample() {
|
|
1482
|
+
const t = useT();
|
|
1483
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
1484
|
+
EmptyState,
|
|
1485
|
+
{
|
|
1486
|
+
variant: "subtle",
|
|
1487
|
+
size: "sm",
|
|
1488
|
+
icon: /* @__PURE__ */ jsx(Search, { className: "size-5" }),
|
|
1489
|
+
title: t("design_system.gallery.sampleCopy.noResults"),
|
|
1490
|
+
description: t("design_system.gallery.sampleCopy.tryADifferentSearchTermOrClearTheFilters")
|
|
1491
|
+
}
|
|
1492
|
+
) });
|
|
1493
|
+
}
|
|
1494
|
+
function ProgressFeedbackLabelledSample() {
|
|
1495
|
+
const t = useT();
|
|
1496
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
1497
|
+
Progress,
|
|
1498
|
+
{
|
|
1499
|
+
value: 80,
|
|
1500
|
+
label: t("design_system.gallery.examples.controls.storage"),
|
|
1501
|
+
showValue: true,
|
|
1502
|
+
description: t("design_system.gallery.examples.controls.storageHint")
|
|
1503
|
+
}
|
|
1504
|
+
) });
|
|
1505
|
+
}
|
|
1506
|
+
function SpinnerFeedbackInlineWithLabelSample() {
|
|
1507
|
+
const t = useT();
|
|
1508
|
+
return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
1509
|
+
/* @__PURE__ */ jsx(Spinner, { size: "sm" }),
|
|
1510
|
+
t("design_system.gallery.sampleCopy.loadingOrders")
|
|
1511
|
+
] });
|
|
1512
|
+
}
|
|
1513
|
+
function NotificationFeedbackInformationSample() {
|
|
1514
|
+
const t = useT();
|
|
1515
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
1516
|
+
Notification,
|
|
1517
|
+
{
|
|
1518
|
+
title: t("design_system.gallery.samples.crypto.notificationMaintenance"),
|
|
1519
|
+
description: t("design_system.gallery.sampleCopy.theAdminPanelWillBeReadonlyOnSundayBetween0200"),
|
|
1520
|
+
timestamp: t("design_system.gallery.sampleCopy.2MinAgo")
|
|
1521
|
+
}
|
|
1522
|
+
) });
|
|
1523
|
+
}
|
|
1524
|
+
function NotificationFeedbackSuccessWithActionsSample() {
|
|
1525
|
+
const t = useT();
|
|
1526
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
1527
|
+
Notification,
|
|
1528
|
+
{
|
|
1529
|
+
status: "success",
|
|
1530
|
+
title: t("design_system.gallery.sampleCopy.exportReady"),
|
|
1531
|
+
description: t("design_system.gallery.sampleCopy.yourProductExport1204RowsFinishedSuccessfully"),
|
|
1532
|
+
timestamp: t("design_system.gallery.sampleCopy.justNow"),
|
|
1533
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1534
|
+
/* @__PURE__ */ jsx(LinkButton, { variant: "black", underline: "always", children: t("design_system.gallery.sampleCopy.download") }),
|
|
1535
|
+
/* @__PURE__ */ jsx(LinkButton, { variant: "gray", underline: "always", children: t("design_system.gallery.sampleCopy.viewLog") })
|
|
1536
|
+
] })
|
|
1537
|
+
}
|
|
1538
|
+
) });
|
|
1539
|
+
}
|
|
1540
|
+
function NotificationFeedbackErrorSample() {
|
|
1541
|
+
const t = useT();
|
|
1542
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
1543
|
+
Notification,
|
|
1544
|
+
{
|
|
1545
|
+
status: "error",
|
|
1546
|
+
title: t("design_system.gallery.sampleCopy.webhookDeliveryFailed"),
|
|
1547
|
+
description: t("design_system.gallery.sampleCopy.theEndpointRespondedWith503After3Retries"),
|
|
1548
|
+
timestamp: t("design_system.gallery.sampleCopy.5MinAgo"),
|
|
1549
|
+
actions: /* @__PURE__ */ jsx(LinkButton, { variant: "error", underline: "always", children: t("design_system.gallery.sampleCopy.retryNow") })
|
|
1550
|
+
}
|
|
1551
|
+
) });
|
|
1552
|
+
}
|
|
1553
|
+
function NotificationFeedFeedbackDefaultSample() {
|
|
1554
|
+
const t = useT();
|
|
1555
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-sm", children: /* @__PURE__ */ jsxs(NotificationFeed, { children: [
|
|
1556
|
+
/* @__PURE__ */ jsx(NotificationFeedHeader, { title: t("design_system.families.notifications"), children: /* @__PURE__ */ jsx(IconButton, { size: "sm", variant: "ghost", "aria-label": t("design_system.gallery.sampleCopy.notificationSettings"), children: /* @__PURE__ */ jsx(Settings, {}) }) }),
|
|
1557
|
+
/* @__PURE__ */ jsxs(NotificationFeedList, { children: [
|
|
1558
|
+
/* @__PURE__ */ jsx(
|
|
1559
|
+
NotificationFeedItem,
|
|
1560
|
+
{
|
|
1561
|
+
icon: /* @__PURE__ */ jsx(NotificationFeedIconBadge, { tone: "indigo", children: /* @__PURE__ */ jsx(UserPlus, { className: "size-5" }) }),
|
|
1562
|
+
title: t("design_system.gallery.sampleCopy.newLeadGenerated"),
|
|
1563
|
+
body: t("design_system.gallery.sampleCopy.johnSmithSubmittedTheContactForm"),
|
|
1564
|
+
timestamp: t("design_system.gallery.sampleCopy.10MinutesAgo"),
|
|
1565
|
+
unread: true
|
|
1566
|
+
}
|
|
1567
|
+
),
|
|
1568
|
+
/* @__PURE__ */ jsx(
|
|
1569
|
+
NotificationFeedItem,
|
|
1570
|
+
{
|
|
1571
|
+
icon: /* @__PURE__ */ jsx(NotificationFeedIconBadge, { tone: "success", children: /* @__PURE__ */ jsx(RefreshCw, { className: "size-5" }) }),
|
|
1572
|
+
title: t("design_system.gallery.sampleCopy.catalogSyncCompleted"),
|
|
1573
|
+
body: t("design_system.gallery.sampleCopy.312ProductsUpdatedFromThePIM"),
|
|
1574
|
+
timestamp: t("design_system.gallery.sampleCopy.1HourAgo")
|
|
1575
|
+
}
|
|
1576
|
+
)
|
|
1577
|
+
] }),
|
|
1578
|
+
/* @__PURE__ */ jsx(NotificationFeedFooter, { children: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", className: "w-full", children: t("design_system.gallery.samples.feeds.archive") }) })
|
|
1579
|
+
] }) });
|
|
1580
|
+
}
|
|
655
1581
|
export {
|
|
656
1582
|
entries
|
|
657
1583
|
};
|