@open-mercato/core 0.7.1-develop.7203.1.9396450b78 → 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,17 +1,16 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MarketingControlDemo } from "../demos/marketing-controls.js";
|
|
3
|
+
import { marketingControlExampleCode } from "../demos/marketing-controls-code.generated.js";
|
|
4
|
+
import { FieldLabelExample, FormFieldLabelExample, HintTextExample } from "../demos/key-components.js";
|
|
2
5
|
import * as React from "react";
|
|
3
|
-
import { Copy,
|
|
6
|
+
import { Copy, Info, Link2, Send, User } from "lucide-react";
|
|
7
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
4
8
|
import { Input } from "@open-mercato/ui/primitives/input";
|
|
5
9
|
import { Textarea } from "@open-mercato/ui/primitives/textarea";
|
|
6
10
|
import {
|
|
7
11
|
Select,
|
|
8
12
|
SelectContent,
|
|
9
|
-
SelectGroup,
|
|
10
13
|
SelectItem,
|
|
11
|
-
SelectLabel,
|
|
12
|
-
SelectSeparator,
|
|
13
|
-
SelectTrigger,
|
|
14
|
-
SelectTriggerLeading,
|
|
15
14
|
SelectValue
|
|
16
15
|
} from "@open-mercato/ui/primitives/select";
|
|
17
16
|
import { CompactSelectTrigger } from "@open-mercato/ui/primitives/compact-select";
|
|
@@ -23,11 +22,13 @@ import { Radio, RadioGroup } from "@open-mercato/ui/primitives/radio";
|
|
|
23
22
|
import { RadioField } from "@open-mercato/ui/primitives/radio-field";
|
|
24
23
|
import { Switch } from "@open-mercato/ui/primitives/switch";
|
|
25
24
|
import { SwitchField } from "@open-mercato/ui/primitives/switch-field";
|
|
25
|
+
import { Badge } from "@open-mercato/ui/primitives/badge";
|
|
26
26
|
import { Slider } from "@open-mercato/ui/primitives/slider";
|
|
27
27
|
import { FormField } from "@open-mercato/ui/primitives/form-field";
|
|
28
28
|
import { SearchInput } from "@open-mercato/ui/primitives/search-input";
|
|
29
29
|
import { EmailInput } from "@open-mercato/ui/primitives/email-input";
|
|
30
30
|
import { PasswordInput } from "@open-mercato/ui/primitives/password-input";
|
|
31
|
+
import { PasswordStrength } from "@open-mercato/ui/primitives/password-strength";
|
|
31
32
|
import { WebsiteInput } from "@open-mercato/ui/primitives/website-input";
|
|
32
33
|
import { AmountInput } from "@open-mercato/ui/primitives/amount-input";
|
|
33
34
|
import { CounterInput } from "@open-mercato/ui/primitives/counter-input";
|
|
@@ -39,16 +40,102 @@ import {
|
|
|
39
40
|
COLOR_PICKER_DEFAULT_SWATCHES
|
|
40
41
|
} from "@open-mercato/ui/primitives/color-picker";
|
|
41
42
|
import { TagInput } from "@open-mercato/ui/primitives/tag-input";
|
|
42
|
-
import { RichEditor } from "@open-mercato/ui/primitives/rich-editor";
|
|
43
|
+
import { RichEditor, RichEditorColorPalette, RICH_EDITOR_COLOR_PALETTE } from "@open-mercato/ui/primitives/rich-editor";
|
|
43
44
|
import { IconButton } from "@open-mercato/ui/primitives/icon-button";
|
|
45
|
+
import { FileFormatIcon } from "@open-mercato/ui/primitives/file-format-icon";
|
|
46
|
+
import { FileUploadAreaDemo, FileUploadCardDemo, ImageUploadDemo } from "../demos/file-upload.js";
|
|
47
|
+
import { SelectionSourceCardsDemo, IntegrationSwitchDemo } from "../demos/selection-cards.js";
|
|
48
|
+
import { SelectSourceExample, SelectSourceMatrix, DropdownSourceExample } from "../demos/menus.js";
|
|
49
|
+
import { SourceTextInputMatrix, SourcePhoneExamples, SourceTextareaExamples } from "../demos/text-inputs.js";
|
|
50
|
+
import { inputFieldCode, textareaFieldCode, phoneNumberFieldCode, selectFieldCode, dropdownCode, fieldLabelCode, fieldLabelInformationCode, fieldLabelActionCode, formFieldLabelCode, hintTextCode } from "./inputs-snippets.js";
|
|
44
51
|
function DemoSearchInput({ size }) {
|
|
45
|
-
const
|
|
52
|
+
const t = useT();
|
|
53
|
+
const [value, setValue] = React.useState(() => t("design_system.gallery.sampleCopy.openOrders"));
|
|
46
54
|
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(SearchInput, { value, onChange: setValue, size }) });
|
|
47
55
|
}
|
|
48
56
|
function DemoAmountInput({ showCurrency }) {
|
|
49
57
|
const [value, setValue] = React.useState({ amount: "1250.00", currency: "EUR" });
|
|
50
58
|
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(AmountInput, { value, onChange: setValue, showCurrency }) });
|
|
51
59
|
}
|
|
60
|
+
const selectionCardClasses = "relative w-full max-w-90 gap-3.5 rounded-xl border border-border bg-background p-4 shadow-xs transition-colors hover:border-transparent hover:bg-muted hover:shadow-none has-[[data-state=checked]]:border-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus has-[:disabled]:border-border has-[:disabled]:bg-background has-[:disabled]:shadow-none [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-xl [&_button]:relative [&_button]:z-10";
|
|
61
|
+
function SelectionCardsPreview({ control, disabled = false }) {
|
|
62
|
+
const t = useT();
|
|
63
|
+
const choices = [
|
|
64
|
+
{ value: "immediate", label: t("design_system.gallery.samples.selection.immediate"), description: t("design_system.gallery.samples.selection.immediateDescription") },
|
|
65
|
+
{ value: "weekly", label: t("design_system.gallery.samples.selection.weekly"), description: t("design_system.gallery.samples.selection.weeklyDescription") }
|
|
66
|
+
];
|
|
67
|
+
const cards = choices.map((choice, index) => {
|
|
68
|
+
const fieldProps = {
|
|
69
|
+
label: choice.label,
|
|
70
|
+
description: choice.description,
|
|
71
|
+
sublabel: t("design_system.gallery.samples.selection.optional"),
|
|
72
|
+
badge: /* @__PURE__ */ jsx(Badge, { variant: disabled ? "outline" : "info", size: "sm", className: disabled ? "text-text-disabled" : void 0, children: t("design_system.gallery.samples.selection.new") }),
|
|
73
|
+
disabled,
|
|
74
|
+
className: "mt-0",
|
|
75
|
+
containerClassName: selectionCardClasses
|
|
76
|
+
};
|
|
77
|
+
if (control === "radio") return /* @__PURE__ */ jsx(RadioField, { value: choice.value, flip: true, ...fieldProps }, choice.value);
|
|
78
|
+
if (control === "switch") return /* @__PURE__ */ jsx(SwitchField, { defaultChecked: index === 0, ...fieldProps }, choice.value);
|
|
79
|
+
return /* @__PURE__ */ jsx(CheckboxField, { defaultChecked: index === 0, flip: true, ...fieldProps }, choice.value);
|
|
80
|
+
});
|
|
81
|
+
if (control === "radio") {
|
|
82
|
+
return /* @__PURE__ */ jsx(RadioGroup, { defaultValue: "immediate", "aria-label": t("design_system.gallery.samples.selection.preferences"), className: "grid w-full gap-4 sm:grid-cols-2", children: cards });
|
|
83
|
+
}
|
|
84
|
+
return /* @__PURE__ */ jsx("div", { className: "grid w-full gap-4 sm:grid-cols-2", children: cards });
|
|
85
|
+
}
|
|
86
|
+
function FlippedRadioPreview() {
|
|
87
|
+
const t = useT();
|
|
88
|
+
return /* @__PURE__ */ jsxs(RadioGroup, { defaultValue: "immediate", "aria-label": t("design_system.gallery.samples.selection.preferences"), className: "w-72", children: [
|
|
89
|
+
/* @__PURE__ */ jsx(RadioField, { value: "immediate", flip: true, label: t("design_system.gallery.samples.selection.immediate") }),
|
|
90
|
+
/* @__PURE__ */ jsx(RadioField, { value: "weekly", flip: true, label: t("design_system.gallery.samples.selection.weekly") })
|
|
91
|
+
] });
|
|
92
|
+
}
|
|
93
|
+
function ReadOnlyInputPreview() {
|
|
94
|
+
const t = useT();
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
FormField,
|
|
97
|
+
{
|
|
98
|
+
className: "w-full max-w-sm",
|
|
99
|
+
label: t("design_system.gallery.samples.states.recordId"),
|
|
100
|
+
description: t("design_system.gallery.samples.states.readOnlyHint"),
|
|
101
|
+
children: /* @__PURE__ */ jsx(Input, { readOnly: true, value: "OM-2026-0042" })
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function ReadOnlyTextareaPreview() {
|
|
106
|
+
const t = useT();
|
|
107
|
+
return /* @__PURE__ */ jsx(
|
|
108
|
+
FormField,
|
|
109
|
+
{
|
|
110
|
+
className: "w-full max-w-sm",
|
|
111
|
+
label: t("design_system.gallery.samples.states.savedNote"),
|
|
112
|
+
description: t("design_system.gallery.samples.states.readOnlyHint"),
|
|
113
|
+
children: /* @__PURE__ */ jsx(Textarea, { readOnly: true, value: t("design_system.gallery.samples.states.noteValue") })
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
function DisabledSearchInputPreview() {
|
|
118
|
+
const t = useT();
|
|
119
|
+
const [query, setQuery] = React.useState("OM-2026-0042");
|
|
120
|
+
return /* @__PURE__ */ jsx(FormField, { className: "w-full max-w-sm", label: t("design_system.gallery.samples.states.search"), disabled: true, children: /* @__PURE__ */ jsx(SearchInput, { value: query, onChange: setQuery }) });
|
|
121
|
+
}
|
|
122
|
+
function InvalidPasswordInputPreview() {
|
|
123
|
+
const t = useT();
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
FormField,
|
|
126
|
+
{
|
|
127
|
+
className: "w-full max-w-sm",
|
|
128
|
+
label: t("design_system.gallery.samples.states.password"),
|
|
129
|
+
error: t("design_system.gallery.samples.states.passwordError"),
|
|
130
|
+
children: /* @__PURE__ */ jsx(PasswordInput, { defaultValue: "short", autoComplete: "off" })
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
function DisabledAmountInputPreview() {
|
|
135
|
+
const t = useT();
|
|
136
|
+
const [value, setValue] = React.useState({ amount: "1250.00", currency: "EUR" });
|
|
137
|
+
return /* @__PURE__ */ jsx(FormField, { className: "w-full max-w-sm", label: t("design_system.gallery.samples.states.amount"), disabled: true, children: /* @__PURE__ */ jsx(AmountInput, { value, onChange: setValue }) });
|
|
138
|
+
}
|
|
52
139
|
function DemoCounterInput({
|
|
53
140
|
initial = 2,
|
|
54
141
|
step,
|
|
@@ -75,9 +162,12 @@ function DemoCardInput({ initial = "" }) {
|
|
|
75
162
|
}
|
|
76
163
|
function DemoColorPicker({
|
|
77
164
|
allowCustom,
|
|
78
|
-
swatches
|
|
165
|
+
swatches,
|
|
166
|
+
showOpacity = false
|
|
79
167
|
}) {
|
|
168
|
+
const t = useT();
|
|
80
169
|
const [color, setColor] = React.useState("#6366F1");
|
|
170
|
+
const [opacity, setOpacity] = React.useState(75);
|
|
81
171
|
return /* @__PURE__ */ jsx(
|
|
82
172
|
ColorPicker,
|
|
83
173
|
{
|
|
@@ -85,7 +175,10 @@ function DemoColorPicker({
|
|
|
85
175
|
onChange: setColor,
|
|
86
176
|
allowCustom,
|
|
87
177
|
swatches,
|
|
88
|
-
|
|
178
|
+
showOpacity,
|
|
179
|
+
opacity: showOpacity ? opacity : 100,
|
|
180
|
+
onOpacityChange: showOpacity ? setOpacity : void 0,
|
|
181
|
+
"aria-label": t("design_system.gallery.sampleCopy.pickColor")
|
|
89
182
|
}
|
|
90
183
|
);
|
|
91
184
|
}
|
|
@@ -97,21 +190,87 @@ function DemoTagInput({
|
|
|
97
190
|
const [tags, setTags] = React.useState(initial);
|
|
98
191
|
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(TagInput, { value: tags, onChange: setTags, maxTags, placeholder }) });
|
|
99
192
|
}
|
|
100
|
-
function DemoRichEditor({ variant }) {
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
);
|
|
104
|
-
|
|
193
|
+
function DemoRichEditor({ variant = "standard", toolbarDesign, disabled = false, counter = false }) {
|
|
194
|
+
const t = useT();
|
|
195
|
+
const [html, setHtml] = React.useState(() => "<p>" + t("design_system.gallery.samples.richEditor.initial") + "</p>");
|
|
196
|
+
const [feedback, setFeedback] = React.useState("");
|
|
197
|
+
const labels = {
|
|
198
|
+
bold: t("design_system.gallery.samples.richEditor.labels.bold"),
|
|
199
|
+
italic: t("design_system.gallery.samples.richEditor.labels.italic"),
|
|
200
|
+
underline: t("design_system.gallery.samples.richEditor.labels.underline"),
|
|
201
|
+
strikethrough: t("design_system.gallery.samples.richEditor.labels.strikethrough"),
|
|
202
|
+
unorderedList: t("design_system.gallery.samples.richEditor.labels.unorderedList"),
|
|
203
|
+
orderedList: t("design_system.gallery.samples.richEditor.labels.orderedList"),
|
|
204
|
+
checklist: t("design_system.gallery.samples.richEditor.labels.checklist"),
|
|
205
|
+
blockquote: t("design_system.gallery.samples.richEditor.labels.blockquote"),
|
|
206
|
+
code: t("design_system.gallery.samples.richEditor.labels.code"),
|
|
207
|
+
inlineCode: t("design_system.gallery.samples.richEditor.labels.inlineCode"),
|
|
208
|
+
codeBlock: t("design_system.gallery.samples.richEditor.labels.codeBlock"),
|
|
209
|
+
horizontalRule: t("design_system.gallery.samples.richEditor.labels.horizontalRule"),
|
|
210
|
+
image: t("design_system.gallery.samples.richEditor.labels.image"),
|
|
211
|
+
imageUrlPrompt: t("design_system.gallery.samples.richEditor.labels.imageUrlPrompt"),
|
|
212
|
+
table: t("design_system.gallery.samples.richEditor.labels.table"),
|
|
213
|
+
heading: t("design_system.gallery.samples.richEditor.labels.heading"),
|
|
214
|
+
heading1: t("design_system.gallery.samples.richEditor.labels.heading1"),
|
|
215
|
+
heading2: t("design_system.gallery.samples.richEditor.labels.heading2"),
|
|
216
|
+
heading3: t("design_system.gallery.samples.richEditor.labels.heading3"),
|
|
217
|
+
paragraph: t("design_system.gallery.samples.richEditor.labels.paragraph"),
|
|
218
|
+
link: t("design_system.gallery.samples.richEditor.labels.link"),
|
|
219
|
+
linkUrlPrompt: t("design_system.gallery.samples.richEditor.labels.linkUrlPrompt"),
|
|
220
|
+
color: t("design_system.gallery.samples.richEditor.labels.color"),
|
|
221
|
+
textColor: t("design_system.gallery.samples.richEditor.labels.textColor"),
|
|
222
|
+
fontSize: t("design_system.gallery.samples.richEditor.labels.fontSize"),
|
|
223
|
+
align: t("design_system.gallery.samples.richEditor.labels.align"),
|
|
224
|
+
alignLeft: t("design_system.gallery.samples.richEditor.labels.alignLeft"),
|
|
225
|
+
alignCenter: t("design_system.gallery.samples.richEditor.labels.alignCenter"),
|
|
226
|
+
alignRight: t("design_system.gallery.samples.richEditor.labels.alignRight"),
|
|
227
|
+
alignJustify: t("design_system.gallery.samples.richEditor.labels.alignJustify"),
|
|
228
|
+
comment: t("design_system.gallery.samples.richEditor.labels.comment"),
|
|
229
|
+
mention: t("design_system.gallery.samples.richEditor.labels.mention"),
|
|
230
|
+
more: t("design_system.gallery.samples.richEditor.labels.more"),
|
|
231
|
+
help: t("design_system.gallery.samples.richEditor.labels.help"),
|
|
232
|
+
fullscreen: t("design_system.gallery.samples.richEditor.labels.fullscreen"),
|
|
233
|
+
placeholder: t("design_system.gallery.samples.richEditor.labels.placeholder"),
|
|
234
|
+
colors: Object.fromEntries(Object.keys(RICH_EDITOR_COLOR_PALETTE).map((key) => [key, t(`design_system.gallery.samples.richEditor.colors.${key}`)]))
|
|
235
|
+
};
|
|
236
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 w-full max-w-3xl flex-col gap-3", children: [
|
|
237
|
+
/* @__PURE__ */ jsx(
|
|
238
|
+
RichEditor,
|
|
239
|
+
{
|
|
240
|
+
value: html,
|
|
241
|
+
onChange: setHtml,
|
|
242
|
+
variant,
|
|
243
|
+
toolbarDesign,
|
|
244
|
+
disabled,
|
|
245
|
+
maxLength: counter ? 100 : void 0,
|
|
246
|
+
labels,
|
|
247
|
+
onComment: () => setFeedback(t("design_system.gallery.samples.richEditor.comment")),
|
|
248
|
+
onMention: () => setFeedback(t("design_system.gallery.samples.richEditor.mention"))
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
feedback && /* @__PURE__ */ jsx("output", { "aria-live": "polite", className: "text-sm text-muted-foreground", children: feedback })
|
|
252
|
+
] });
|
|
253
|
+
}
|
|
254
|
+
function DemoRichEditorPalette() {
|
|
255
|
+
const t = useT();
|
|
256
|
+
const [value, setValue] = React.useState("gray");
|
|
257
|
+
const labels = Object.fromEntries(Object.keys(RICH_EDITOR_COLOR_PALETTE).map((key) => [key, t(`design_system.gallery.samples.richEditor.colors.${key}`)]));
|
|
258
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-sm flex-col gap-3", children: [
|
|
259
|
+
/* @__PURE__ */ jsx(RichEditorColorPalette, { value, onChange: setValue, labels }),
|
|
260
|
+
/* @__PURE__ */ jsx("output", { "aria-live": "polite", className: "text-sm text-muted-foreground", children: value ? labels[value] : "" })
|
|
261
|
+
] });
|
|
105
262
|
}
|
|
106
263
|
const inputEntry = {
|
|
107
264
|
id: "input",
|
|
108
265
|
title: "Input",
|
|
109
266
|
importPath: "@open-mercato/ui/primitives/input",
|
|
267
|
+
figmaNodeId: "266:5251",
|
|
268
|
+
usage: { do: ["Numeric sizes 32, 36 and 40 use the source 14/20 text, 20 px icons and asymmetric input padding. Named sizes preserve existing callers.", "leading and trailing accept interactive controls; provide accessible labels and forward disabled to those controls. leftIcon/rightIcon remain decorative.", "The source compositions cover all twelve Text Input types. Hover and focus are real browser states; the Date example uses the native date picker and locale formatting. Existing CardInput brand badges and phone parsing retain their runtime behavior."] },
|
|
110
269
|
variants: [
|
|
111
270
|
{
|
|
112
271
|
id: "default",
|
|
113
272
|
title: "default",
|
|
114
|
-
render: () => /* @__PURE__ */ jsx(
|
|
273
|
+
render: () => /* @__PURE__ */ jsx(InputInputsDefaultSample, {}),
|
|
115
274
|
code: `import { Input } from '@open-mercato/ui/primitives/input'
|
|
116
275
|
|
|
117
276
|
<Input placeholder="Product name" />`
|
|
@@ -119,10 +278,7 @@ const inputEntry = {
|
|
|
119
278
|
{
|
|
120
279
|
id: "icon-slots",
|
|
121
280
|
title: "Icon slots",
|
|
122
|
-
render: () => /* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsx(Input, { leftIcon: /* @__PURE__ */ jsx(User, {}), placeholder: "Assignee" }) }),
|
|
124
|
-
/* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsx(Input, { rightIcon: /* @__PURE__ */ jsx(Info, {}), placeholder: "SKU" }) })
|
|
125
|
-
] }),
|
|
281
|
+
render: () => /* @__PURE__ */ jsx(InputInputsIconSlotsSample, {}),
|
|
126
282
|
code: `import { Info, User } from 'lucide-react'
|
|
127
283
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
128
284
|
|
|
@@ -132,11 +288,7 @@ import { Input } from '@open-mercato/ui/primitives/input'
|
|
|
132
288
|
{
|
|
133
289
|
id: "sizes",
|
|
134
290
|
title: "Sizes",
|
|
135
|
-
render: () => /* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */ jsx("div", { className: "w-44", children: /* @__PURE__ */ jsx(Input, { size: "lg", placeholder: "Large" }) }),
|
|
137
|
-
/* @__PURE__ */ jsx("div", { className: "w-44", children: /* @__PURE__ */ jsx(Input, { size: "default", placeholder: "Default" }) }),
|
|
138
|
-
/* @__PURE__ */ jsx("div", { className: "w-44", children: /* @__PURE__ */ jsx(Input, { size: "sm", placeholder: "Small" }) })
|
|
139
|
-
] }),
|
|
291
|
+
render: () => /* @__PURE__ */ jsx(InputInputsSizesSample, {}),
|
|
140
292
|
code: `import { Input } from '@open-mercato/ui/primitives/input'
|
|
141
293
|
|
|
142
294
|
<Input size="lg" placeholder="Large" />
|
|
@@ -146,26 +298,42 @@ import { Input } from '@open-mercato/ui/primitives/input'
|
|
|
146
298
|
{
|
|
147
299
|
id: "states",
|
|
148
300
|
title: "States",
|
|
149
|
-
render: () => /* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsx(Input, { "aria-invalid": true, defaultValue: "not-a-number" }) }),
|
|
151
|
-
/* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsx(Input, { disabled: true, placeholder: "Disabled" }) })
|
|
152
|
-
] }),
|
|
301
|
+
render: () => /* @__PURE__ */ jsx(InputInputsStatesSample, {}),
|
|
153
302
|
code: `import { Input } from '@open-mercato/ui/primitives/input'
|
|
154
303
|
|
|
155
304
|
<Input aria-invalid defaultValue="not-a-number" />
|
|
156
305
|
<Input disabled placeholder="Disabled" />`
|
|
157
|
-
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
id: "read-only",
|
|
309
|
+
title: "Read-only",
|
|
310
|
+
render: () => /* @__PURE__ */ jsx(ReadOnlyInputPreview, {}),
|
|
311
|
+
code: `import { Input } from '@open-mercato/ui/primitives/input'
|
|
312
|
+
import { FormField } from '@open-mercato/ui/primitives/form-field'
|
|
313
|
+
|
|
314
|
+
<FormField label="Record ID" description="Read-only content stays focusable and can be selected and copied.">
|
|
315
|
+
<Input readOnly value="OM-2026-0042" />
|
|
316
|
+
</FormField>`
|
|
317
|
+
},
|
|
318
|
+
{ id: "source-32", title: "Source / all twelve types / 32 px", render: () => /* @__PURE__ */ jsx(SourceTextInputMatrix, { size: 32 }), code: inputFieldCode({ inputProps: " size={32}" }) },
|
|
319
|
+
{ id: "source-36", title: "Source / all twelve types / 36 px", render: () => /* @__PURE__ */ jsx(SourceTextInputMatrix, { size: 36 }), code: inputFieldCode({ inputProps: " size={36}" }) },
|
|
320
|
+
{ id: "source-40", title: "Source / all twelve types / 40 px", render: () => /* @__PURE__ */ jsx(SourceTextInputMatrix, { size: 40 }), code: inputFieldCode({ inputProps: " size={40}" }) },
|
|
321
|
+
{ id: "source-placeholder", title: "Source / placeholder", render: () => /* @__PURE__ */ jsx(SourceTextInputMatrix, { state: "placeholder" }), code: inputFieldCode() },
|
|
322
|
+
{ id: "source-error", title: "Source / error", render: () => /* @__PURE__ */ jsx(SourceTextInputMatrix, { state: "error" }), code: inputFieldCode({ inputProps: " aria-invalid", fieldProps: ' error="Enter your full name"' }) },
|
|
323
|
+
{ id: "source-disabled", title: "Source / disabled", render: () => /* @__PURE__ */ jsx(SourceTextInputMatrix, { state: "disabled" }), code: inputFieldCode({ inputProps: " disabled", fieldProps: " disabled" }) }
|
|
158
324
|
]
|
|
159
325
|
};
|
|
160
326
|
const textareaEntry = {
|
|
161
327
|
id: "textarea",
|
|
162
328
|
title: "Textarea",
|
|
329
|
+
figmaNodeId: "435:5725",
|
|
330
|
+
usage: { do: ["appearance=source adds the source 112 px minimum field, 12 px radius, 14/20 text and an interior character counter. The browser-native resize handle remains operable.", "The default appearance and external counter retain their current layout. Set maxLength together with showCount and supply a visible field label."] },
|
|
163
331
|
importPath: "@open-mercato/ui/primitives/textarea",
|
|
164
332
|
variants: [
|
|
165
333
|
{
|
|
166
334
|
id: "default",
|
|
167
335
|
title: "default",
|
|
168
|
-
render: () => /* @__PURE__ */ jsx(
|
|
336
|
+
render: () => /* @__PURE__ */ jsx(TextareaInputsDefaultSample, {}),
|
|
169
337
|
code: `import { Textarea } from '@open-mercato/ui/primitives/textarea'
|
|
170
338
|
|
|
171
339
|
<Textarea placeholder="Internal note for the fulfillment team" />`
|
|
@@ -173,14 +341,7 @@ const textareaEntry = {
|
|
|
173
341
|
{
|
|
174
342
|
id: "character-count",
|
|
175
343
|
title: "Character counter",
|
|
176
|
-
render: () => /* @__PURE__ */ jsx(
|
|
177
|
-
Textarea,
|
|
178
|
-
{
|
|
179
|
-
showCount: true,
|
|
180
|
-
maxLength: 200,
|
|
181
|
-
defaultValue: "Customer prefers delivery after 4 PM."
|
|
182
|
-
}
|
|
183
|
-
) }),
|
|
344
|
+
render: () => /* @__PURE__ */ jsx(TextareaInputsCharacterCountSample, {}),
|
|
184
345
|
code: `import { Textarea } from '@open-mercato/ui/primitives/textarea'
|
|
185
346
|
|
|
186
347
|
<Textarea showCount maxLength={200} defaultValue="Customer prefers delivery after 4 PM." />`
|
|
@@ -188,140 +349,74 @@ const textareaEntry = {
|
|
|
188
349
|
{
|
|
189
350
|
id: "states",
|
|
190
351
|
title: "States",
|
|
191
|
-
render: () => /* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(Textarea, { "aria-invalid": true, defaultValue: "Too short" }) }),
|
|
193
|
-
/* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(Textarea, { disabled: true, placeholder: "Disabled" }) })
|
|
194
|
-
] }),
|
|
352
|
+
render: () => /* @__PURE__ */ jsx(TextareaInputsStatesSample, {}),
|
|
195
353
|
code: `import { Textarea } from '@open-mercato/ui/primitives/textarea'
|
|
196
354
|
|
|
197
355
|
<Textarea aria-invalid defaultValue="Too short" />
|
|
198
356
|
<Textarea disabled placeholder="Disabled" />`
|
|
199
|
-
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: "read-only",
|
|
360
|
+
title: "Read-only",
|
|
361
|
+
render: () => /* @__PURE__ */ jsx(ReadOnlyTextareaPreview, {}),
|
|
362
|
+
code: `import { Textarea } from '@open-mercato/ui/primitives/textarea'
|
|
363
|
+
import { FormField } from '@open-mercato/ui/primitives/form-field'
|
|
364
|
+
|
|
365
|
+
<FormField label="Saved note" description="Read-only content stays focusable and can be selected and copied.">
|
|
366
|
+
<Textarea readOnly value="Customer requested delivery after 4 PM." />
|
|
367
|
+
</FormField>`
|
|
368
|
+
},
|
|
369
|
+
{ id: "source-states", title: "Source / default, filled, error and disabled", render: () => /* @__PURE__ */ jsx(SourceTextareaExamples, {}), code: textareaFieldCode }
|
|
370
|
+
]
|
|
371
|
+
};
|
|
372
|
+
const phoneNumberEntry = {
|
|
373
|
+
id: "phone-number-field",
|
|
374
|
+
title: "PhoneNumberField",
|
|
375
|
+
importPath: "@open-mercato/ui/backend/inputs/PhoneNumberField",
|
|
376
|
+
figmaNodeId: "313:10101",
|
|
377
|
+
usage: { do: ["Numeric sizes 32/36/40 add source geometry while the existing automatic height remains the default.", "Choose a country or edit the national number to update the local value. Validation and optional duplicate lookup retain their existing contracts.", "countries translates and limits picker choices; countryLabel names the picker and renderCountryIcon can supply actual country assets."] },
|
|
378
|
+
variants: [
|
|
379
|
+
{ id: "sizes", title: "Source / 32, 36 and 40 px", render: () => /* @__PURE__ */ jsx(SourcePhoneExamples, {}), code: phoneNumberFieldCode() },
|
|
380
|
+
{ id: "placeholder", title: "Source / placeholder", render: () => /* @__PURE__ */ jsx(SourcePhoneExamples, { state: "placeholder" }), code: phoneNumberFieldCode() },
|
|
381
|
+
{ id: "validation", title: "Source / validation", render: () => /* @__PURE__ */ jsx(SourcePhoneExamples, { state: "error" }), code: phoneNumberFieldCode(' externalError="Enter a valid phone number"') },
|
|
382
|
+
{ id: "disabled", title: "Source / disabled", render: () => /* @__PURE__ */ jsx(SourcePhoneExamples, { state: "disabled" }), code: phoneNumberFieldCode(" disabled") }
|
|
200
383
|
]
|
|
201
384
|
};
|
|
202
385
|
const selectEntry = {
|
|
203
386
|
id: "select",
|
|
387
|
+
figmaNodeId: "270:1085",
|
|
204
388
|
title: "Select",
|
|
205
389
|
importPath: "@open-mercato/ui/primitives/select",
|
|
390
|
+
usage: { do: [
|
|
391
|
+
"Six source leading types: Basic, Country, Avatar, Provider, Brand, and Company. The 32/36/40 numeric sizes use the measured source text, icons, padding and radii; named sizes retain their existing defaults.",
|
|
392
|
+
"SelectItem leading keeps the visual outside Radix ItemText. The trigger renders its selected visual explicitly, so a selection never duplicates the icon.",
|
|
393
|
+
"Use Dropdown for searchable choices. Select keeps Radix keyboard typeahead; search inputs must not be nested in a Select listbox."
|
|
394
|
+
] },
|
|
206
395
|
variants: [
|
|
207
|
-
{
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
<SelectItem value="eur">Euro (EUR)</SelectItem>
|
|
232
|
-
<SelectItem value="pln">Polish Z\u0142oty (PLN)</SelectItem>
|
|
233
|
-
<SelectItem value="usd">US Dollar (USD)</SelectItem>
|
|
234
|
-
</SelectContent>
|
|
235
|
-
</Select>`
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
id: "groups-leading",
|
|
239
|
-
title: "Groups + leading slot",
|
|
240
|
-
render: () => /* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsxs(Select, { children: [
|
|
241
|
-
/* @__PURE__ */ jsxs(SelectTrigger, { children: [
|
|
242
|
-
/* @__PURE__ */ jsx(SelectTriggerLeading, { children: /* @__PURE__ */ jsx(Globe, {}) }),
|
|
243
|
-
/* @__PURE__ */ jsx(SelectValue, { placeholder: "Sales channel" })
|
|
244
|
-
] }),
|
|
245
|
-
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
246
|
-
/* @__PURE__ */ jsxs(SelectGroup, { children: [
|
|
247
|
-
/* @__PURE__ */ jsx(SelectLabel, { children: "Online" }),
|
|
248
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "webstore", children: "Webstore" }),
|
|
249
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "marketplace", children: "Marketplace" })
|
|
250
|
-
] }),
|
|
251
|
-
/* @__PURE__ */ jsx(SelectSeparator, {}),
|
|
252
|
-
/* @__PURE__ */ jsxs(SelectGroup, { children: [
|
|
253
|
-
/* @__PURE__ */ jsx(SelectLabel, { children: "Offline" }),
|
|
254
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "retail", children: "Retail store" })
|
|
255
|
-
] })
|
|
256
|
-
] })
|
|
257
|
-
] }) }),
|
|
258
|
-
code: `import { Globe } from 'lucide-react'
|
|
259
|
-
import {
|
|
260
|
-
Select,
|
|
261
|
-
SelectContent,
|
|
262
|
-
SelectGroup,
|
|
263
|
-
SelectItem,
|
|
264
|
-
SelectLabel,
|
|
265
|
-
SelectSeparator,
|
|
266
|
-
SelectTrigger,
|
|
267
|
-
SelectTriggerLeading,
|
|
268
|
-
SelectValue,
|
|
269
|
-
} from '@open-mercato/ui/primitives/select'
|
|
270
|
-
|
|
271
|
-
<Select>
|
|
272
|
-
<SelectTrigger>
|
|
273
|
-
<SelectTriggerLeading><Globe /></SelectTriggerLeading>
|
|
274
|
-
<SelectValue placeholder="Sales channel" />
|
|
275
|
-
</SelectTrigger>
|
|
276
|
-
<SelectContent>
|
|
277
|
-
<SelectGroup>
|
|
278
|
-
<SelectLabel>Online</SelectLabel>
|
|
279
|
-
<SelectItem value="webstore">Webstore</SelectItem>
|
|
280
|
-
<SelectItem value="marketplace">Marketplace</SelectItem>
|
|
281
|
-
</SelectGroup>
|
|
282
|
-
<SelectSeparator />
|
|
283
|
-
<SelectGroup>
|
|
284
|
-
<SelectLabel>Offline</SelectLabel>
|
|
285
|
-
<SelectItem value="retail">Retail store</SelectItem>
|
|
286
|
-
</SelectGroup>
|
|
287
|
-
</SelectContent>
|
|
288
|
-
</Select>`
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
id: "sizes",
|
|
292
|
-
title: "Sizes",
|
|
293
|
-
render: () => /* @__PURE__ */ jsx(Fragment, { children: ["lg", "default", "sm", "xs"].map((size) => /* @__PURE__ */ jsx("div", { className: "w-40", children: /* @__PURE__ */ jsxs(Select, { defaultValue: "active", children: [
|
|
294
|
-
/* @__PURE__ */ jsx(SelectTrigger, { size, children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
295
|
-
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
296
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "active", children: "Active" }),
|
|
297
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "archived", children: "Archived" })
|
|
298
|
-
] })
|
|
299
|
-
] }) }, size)) }),
|
|
300
|
-
code: `import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@open-mercato/ui/primitives/select'
|
|
301
|
-
|
|
302
|
-
<SelectTrigger size="lg" />
|
|
303
|
-
<SelectTrigger size="default" />
|
|
304
|
-
<SelectTrigger size="sm" />
|
|
305
|
-
<SelectTrigger size="xs" />`
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
id: "states",
|
|
309
|
-
title: "States",
|
|
310
|
-
render: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
311
|
-
/* @__PURE__ */ jsx("div", { className: "w-48", children: /* @__PURE__ */ jsxs(Select, { children: [
|
|
312
|
-
/* @__PURE__ */ jsx(SelectTrigger, { "aria-invalid": "true", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Required" }) }),
|
|
313
|
-
/* @__PURE__ */ jsx(SelectContent, { children: /* @__PURE__ */ jsx(SelectItem, { value: "a", children: "Option A" }) })
|
|
314
|
-
] }) }),
|
|
315
|
-
/* @__PURE__ */ jsx("div", { className: "w-48", children: /* @__PURE__ */ jsxs(Select, { children: [
|
|
316
|
-
/* @__PURE__ */ jsx(SelectTrigger, { disabled: true, children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Disabled" }) }),
|
|
317
|
-
/* @__PURE__ */ jsx(SelectContent, { children: /* @__PURE__ */ jsx(SelectItem, { value: "a", children: "Option A" }) })
|
|
318
|
-
] }) })
|
|
319
|
-
] }),
|
|
320
|
-
code: `import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@open-mercato/ui/primitives/select'
|
|
321
|
-
|
|
322
|
-
<SelectTrigger aria-invalid="true"><SelectValue placeholder="Required" /></SelectTrigger>
|
|
323
|
-
<SelectTrigger disabled><SelectValue placeholder="Disabled" /></SelectTrigger>`
|
|
324
|
-
}
|
|
396
|
+
{ id: "default", title: "Basic / 36 px", render: () => /* @__PURE__ */ jsx("div", { className: "w-72 max-w-full", children: /* @__PURE__ */ jsx(SelectSourceExample, { kind: "basic" }) }), code: selectFieldCode() },
|
|
397
|
+
{ id: "groups-leading", title: "All six leading types / 36 px", render: () => /* @__PURE__ */ jsx(SelectSourceMatrix, {}), code: selectFieldCode({ leading: true }) },
|
|
398
|
+
{ id: "sizes", title: "All types / 32 px", render: () => /* @__PURE__ */ jsx(SelectSourceMatrix, { size: 32 }), code: selectFieldCode({ size: 32, leading: true }) },
|
|
399
|
+
{ id: "medium", title: "All types / 40 px", render: () => /* @__PURE__ */ jsx(SelectSourceMatrix, { size: 40 }), code: selectFieldCode({ size: 40, leading: true }) },
|
|
400
|
+
{ id: "placeholder", title: "All types / placeholders", render: () => /* @__PURE__ */ jsx(SelectSourceMatrix, { state: "default" }), code: selectFieldCode({ leading: true, initialValue: "" }) },
|
|
401
|
+
{ id: "states", title: "All types / disabled", render: () => /* @__PURE__ */ jsx(SelectSourceMatrix, { state: "disabled" }), code: selectFieldCode({ leading: true, selectProps: " disabled", fieldProps: " disabled" }) },
|
|
402
|
+
{ id: "errors", title: "All types / errors", render: () => /* @__PURE__ */ jsx(SelectSourceMatrix, { state: "error" }), code: selectFieldCode({ leading: true, initialValue: "", fieldProps: ' error="Choose an office"' }) }
|
|
403
|
+
]
|
|
404
|
+
};
|
|
405
|
+
const dropdownEntry = {
|
|
406
|
+
id: "dropdown",
|
|
407
|
+
figmaNodeId: "379:6629",
|
|
408
|
+
title: "Dropdown",
|
|
409
|
+
importPath: "@open-mercato/ui/primitives/dropdown",
|
|
410
|
+
descriptionKey: "design_system.entries.dropdown.description",
|
|
411
|
+
usage: { do: [
|
|
412
|
+
"A searchable, keyboard-operated picker built from Popover and cmdk. All six leading types use source assets and production components at 36 or 56 px.",
|
|
413
|
+
"Search, clear, choose with arrows and Enter, or dismiss with Escape. The selected value and footer action update local example state.",
|
|
414
|
+
"The saved checked state is separate from the active keyboard option. Footer buttons remain outside listbox options. Source Misc Items 414:8031 supplies search, action and caption layouts."
|
|
415
|
+
] },
|
|
416
|
+
variants: [
|
|
417
|
+
{ id: "small", title: "All six types / 36 px", render: () => /* @__PURE__ */ jsx(DropdownSourceExample, {}), code: dropdownCode() },
|
|
418
|
+
{ id: "large", title: "All six types / 56 px", render: () => /* @__PURE__ */ jsx(DropdownSourceExample, { size: 56 }), code: dropdownCode({ size: 56 }) },
|
|
419
|
+
{ id: "empty", title: "No results / clear to recover", render: () => /* @__PURE__ */ jsx(DropdownSourceExample, { empty: true }), code: dropdownCode({ initialQuery: "zzzz" }) }
|
|
325
420
|
]
|
|
326
421
|
};
|
|
327
422
|
const compactSelectEntry = {
|
|
@@ -332,14 +427,7 @@ const compactSelectEntry = {
|
|
|
332
427
|
{
|
|
333
428
|
id: "trigger-label",
|
|
334
429
|
title: "With trigger label",
|
|
335
|
-
render: () => /* @__PURE__ */ jsx(
|
|
336
|
-
/* @__PURE__ */ jsx(CompactSelectTrigger, { triggerLabel: "Sort:", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
337
|
-
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
338
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "newest", children: "Newest" }),
|
|
339
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "oldest", children: "Oldest" }),
|
|
340
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "value", children: "Highest value" })
|
|
341
|
-
] })
|
|
342
|
-
] }) }),
|
|
430
|
+
render: () => /* @__PURE__ */ jsx(CompactSelectInputsTriggerLabelSample, {}),
|
|
343
431
|
code: `import {
|
|
344
432
|
CompactSelectTrigger,
|
|
345
433
|
Select,
|
|
@@ -362,13 +450,7 @@ const compactSelectEntry = {
|
|
|
362
450
|
{
|
|
363
451
|
id: "plain",
|
|
364
452
|
title: "Without label",
|
|
365
|
-
render: () => /* @__PURE__ */ jsx(
|
|
366
|
-
/* @__PURE__ */ jsx(CompactSelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
367
|
-
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
368
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "table", children: "Table" }),
|
|
369
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "board", children: "Board" })
|
|
370
|
-
] })
|
|
371
|
-
] }) }),
|
|
453
|
+
render: () => /* @__PURE__ */ jsx(CompactSelectInputsPlainSample, {}),
|
|
372
454
|
code: `import {
|
|
373
455
|
CompactSelectTrigger,
|
|
374
456
|
Select,
|
|
@@ -397,14 +479,7 @@ const inlineSelectEntry = {
|
|
|
397
479
|
{
|
|
398
480
|
id: "default",
|
|
399
481
|
title: "default (border on hover)",
|
|
400
|
-
render: () => /* @__PURE__ */ jsx(
|
|
401
|
-
/* @__PURE__ */ jsx(InlineSelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
402
|
-
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
403
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "low", children: "Low" }),
|
|
404
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "medium", children: "Medium" }),
|
|
405
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "high", children: "High" })
|
|
406
|
-
] })
|
|
407
|
-
] }) }),
|
|
482
|
+
render: () => /* @__PURE__ */ jsx(InlineSelectInputsDefaultSample, {}),
|
|
408
483
|
code: `import {
|
|
409
484
|
InlineSelectTrigger,
|
|
410
485
|
Select,
|
|
@@ -427,13 +502,7 @@ const inlineSelectEntry = {
|
|
|
427
502
|
{
|
|
428
503
|
id: "invisible",
|
|
429
504
|
title: "Invisible until focus",
|
|
430
|
-
render: () => /* @__PURE__ */ jsx(
|
|
431
|
-
/* @__PURE__ */ jsx(InlineSelectTrigger, { showBorderOnHover: false, children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
432
|
-
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
433
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "draft", children: "Draft" }),
|
|
434
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "published", children: "Published" })
|
|
435
|
-
] })
|
|
436
|
-
] }) }),
|
|
505
|
+
render: () => /* @__PURE__ */ jsx(InlineSelectInputsInvisibleSample, {}),
|
|
437
506
|
code: `import {
|
|
438
507
|
InlineSelectTrigger,
|
|
439
508
|
Select,
|
|
@@ -456,7 +525,7 @@ const inlineInputEntry = {
|
|
|
456
525
|
{
|
|
457
526
|
id: "default",
|
|
458
527
|
title: "default (border on hover)",
|
|
459
|
-
render: () => /* @__PURE__ */ jsx(
|
|
528
|
+
render: () => /* @__PURE__ */ jsx(InlineInputInputsDefaultSample, {}),
|
|
460
529
|
code: `import { InlineInput } from '@open-mercato/ui/primitives/inline-input'
|
|
461
530
|
|
|
462
531
|
<InlineInput defaultValue="Aurora desk lamp" aria-label="Product name" onBlur={save} />`
|
|
@@ -486,11 +555,7 @@ const checkboxEntry = {
|
|
|
486
555
|
{
|
|
487
556
|
id: "states",
|
|
488
557
|
title: "States",
|
|
489
|
-
render: () => /* @__PURE__ */
|
|
490
|
-
/* @__PURE__ */ jsx(Checkbox, { "aria-label": "Unchecked" }),
|
|
491
|
-
/* @__PURE__ */ jsx(Checkbox, { defaultChecked: true, "aria-label": "Checked" }),
|
|
492
|
-
/* @__PURE__ */ jsx(Checkbox, { checked: "indeterminate", "aria-label": "Indeterminate" })
|
|
493
|
-
] }),
|
|
558
|
+
render: () => /* @__PURE__ */ jsx(CheckboxInputsStatesSample, {}),
|
|
494
559
|
code: `import { Checkbox } from '@open-mercato/ui/primitives/checkbox'
|
|
495
560
|
|
|
496
561
|
<Checkbox />
|
|
@@ -500,10 +565,7 @@ const checkboxEntry = {
|
|
|
500
565
|
{
|
|
501
566
|
id: "sizes",
|
|
502
567
|
title: "Sizes",
|
|
503
|
-
render: () => /* @__PURE__ */
|
|
504
|
-
/* @__PURE__ */ jsx(Checkbox, { size: "sm", defaultChecked: true, "aria-label": "Small" }),
|
|
505
|
-
/* @__PURE__ */ jsx(Checkbox, { size: "md", defaultChecked: true, "aria-label": "Medium" })
|
|
506
|
-
] }),
|
|
568
|
+
render: () => /* @__PURE__ */ jsx(CheckboxInputsSizesSample, {}),
|
|
507
569
|
code: `import { Checkbox } from '@open-mercato/ui/primitives/checkbox'
|
|
508
570
|
|
|
509
571
|
<Checkbox size="sm" defaultChecked />
|
|
@@ -512,10 +574,7 @@ const checkboxEntry = {
|
|
|
512
574
|
{
|
|
513
575
|
id: "disabled",
|
|
514
576
|
title: "Disabled",
|
|
515
|
-
render: () => /* @__PURE__ */
|
|
516
|
-
/* @__PURE__ */ jsx(Checkbox, { disabled: true, "aria-label": "Disabled" }),
|
|
517
|
-
/* @__PURE__ */ jsx(Checkbox, { disabled: true, defaultChecked: true, "aria-label": "Disabled checked" })
|
|
518
|
-
] }),
|
|
577
|
+
render: () => /* @__PURE__ */ jsx(CheckboxInputsDisabledSample, {}),
|
|
519
578
|
code: `import { Checkbox } from '@open-mercato/ui/primitives/checkbox'
|
|
520
579
|
|
|
521
580
|
<Checkbox disabled />
|
|
@@ -527,11 +586,12 @@ const checkboxFieldEntry = {
|
|
|
527
586
|
id: "checkbox-field",
|
|
528
587
|
title: "CheckboxField",
|
|
529
588
|
importPath: "@open-mercato/ui/primitives/checkbox-field",
|
|
589
|
+
figmaNodeId: "231:4897",
|
|
530
590
|
variants: [
|
|
531
591
|
{
|
|
532
592
|
id: "default",
|
|
533
593
|
title: "default",
|
|
534
|
-
render: () => /* @__PURE__ */ jsx(
|
|
594
|
+
render: () => /* @__PURE__ */ jsx(CheckboxFieldInputsDefaultSample, {}),
|
|
535
595
|
code: `import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
536
596
|
|
|
537
597
|
<CheckboxField label="Email notifications" defaultChecked />`
|
|
@@ -539,14 +599,7 @@ const checkboxFieldEntry = {
|
|
|
539
599
|
{
|
|
540
600
|
id: "with-description",
|
|
541
601
|
title: "With sublabel + description",
|
|
542
|
-
render: () => /* @__PURE__ */ jsx(
|
|
543
|
-
CheckboxField,
|
|
544
|
-
{
|
|
545
|
-
label: "Auto-archive",
|
|
546
|
-
sublabel: "(recommended)",
|
|
547
|
-
description: "Closed conversations move to the archive after 30 days."
|
|
548
|
-
}
|
|
549
|
-
) }),
|
|
602
|
+
render: () => /* @__PURE__ */ jsx(CheckboxFieldInputsWithDescriptionSample, {}),
|
|
550
603
|
code: `import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
551
604
|
|
|
552
605
|
<CheckboxField
|
|
@@ -558,10 +611,207 @@ const checkboxFieldEntry = {
|
|
|
558
611
|
{
|
|
559
612
|
id: "flip",
|
|
560
613
|
title: "Flipped (checkbox right)",
|
|
561
|
-
render: () => /* @__PURE__ */ jsx(
|
|
614
|
+
render: () => /* @__PURE__ */ jsx(CheckboxFieldInputsFlipSample, {}),
|
|
562
615
|
code: `import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
563
616
|
|
|
564
617
|
<CheckboxField flip label="Include shipping costs" defaultChecked />`
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
id: "cards",
|
|
621
|
+
title: "Card / default, selected and hover",
|
|
622
|
+
render: () => /* @__PURE__ */ jsx(SelectionCardsPreview, { control: "checkbox" }),
|
|
623
|
+
code: `import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
624
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
625
|
+
|
|
626
|
+
const cardClassName = 'relative w-full max-w-90 gap-3.5 rounded-xl border border-border bg-background p-4 shadow-xs transition-colors hover:border-transparent hover:bg-muted hover:shadow-none has-[[data-state=checked]]:border-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus has-[:disabled]:border-border has-[:disabled]:bg-background has-[:disabled]:shadow-none [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-xl [&_button]:relative [&_button]:z-10'
|
|
627
|
+
|
|
628
|
+
<div className="grid w-full gap-4 sm:grid-cols-2">
|
|
629
|
+
<CheckboxField flip defaultChecked
|
|
630
|
+
label="Immediate updates"
|
|
631
|
+
sublabel="(Optional)"
|
|
632
|
+
description="Receive an update when an order changes."
|
|
633
|
+
badge={<Badge variant="info" size="sm">New</Badge>}
|
|
634
|
+
className="mt-0"
|
|
635
|
+
containerClassName={cardClassName}
|
|
636
|
+
/>
|
|
637
|
+
<CheckboxField flip
|
|
638
|
+
label="Weekly summary"
|
|
639
|
+
sublabel="(Optional)"
|
|
640
|
+
description="Receive one summary every Monday."
|
|
641
|
+
badge={<Badge variant="info" size="sm">New</Badge>}
|
|
642
|
+
className="mt-0"
|
|
643
|
+
containerClassName={cardClassName}
|
|
644
|
+
/>
|
|
645
|
+
</div>`
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
id: "cards-disabled",
|
|
649
|
+
title: "Card / disabled",
|
|
650
|
+
render: () => /* @__PURE__ */ jsx(SelectionCardsPreview, { control: "checkbox", disabled: true }),
|
|
651
|
+
code: `import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
652
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
653
|
+
|
|
654
|
+
const cardClassName = 'relative w-full max-w-90 gap-3.5 rounded-xl border border-border bg-background p-4 shadow-xs transition-colors hover:border-transparent hover:bg-muted hover:shadow-none has-[[data-state=checked]]:border-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus has-[:disabled]:border-border has-[:disabled]:bg-background has-[:disabled]:shadow-none [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-xl [&_button]:relative [&_button]:z-10'
|
|
655
|
+
|
|
656
|
+
<div className="grid w-full gap-4 sm:grid-cols-2">
|
|
657
|
+
<CheckboxField flip defaultChecked disabled
|
|
658
|
+
label="Immediate updates"
|
|
659
|
+
sublabel="(Optional)"
|
|
660
|
+
description="Receive an update when an order changes."
|
|
661
|
+
badge={<Badge variant="outline" size="sm" className="text-text-disabled">New</Badge>}
|
|
662
|
+
className="mt-0"
|
|
663
|
+
containerClassName={cardClassName}
|
|
664
|
+
/>
|
|
665
|
+
<CheckboxField flip disabled
|
|
666
|
+
label="Weekly summary"
|
|
667
|
+
sublabel="(Optional)"
|
|
668
|
+
description="Receive one summary every Monday."
|
|
669
|
+
badge={<Badge variant="outline" size="sm" className="text-text-disabled">New</Badge>}
|
|
670
|
+
className="mt-0"
|
|
671
|
+
containerClassName={cardClassName}
|
|
672
|
+
/>
|
|
673
|
+
</div>`
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
id: "source-cards-icon",
|
|
677
|
+
title: "icon cards / default, active, disabled and live hover",
|
|
678
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "checkbox", kind: "icon" }),
|
|
679
|
+
code: `import * as React from 'react'
|
|
680
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
681
|
+
import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
682
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
683
|
+
|
|
684
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
685
|
+
const [checked, setChecked] = React.useState(false)
|
|
686
|
+
const label = 'Label'
|
|
687
|
+
return (
|
|
688
|
+
|
|
689
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
690
|
+
<img src={imageUrl} alt="" className="size-10 shrink-0 object-contain" />
|
|
691
|
+
<CheckboxField flip checked={checked} onCheckedChange={value => setChecked(value === true)} disabled={disabled}
|
|
692
|
+
label={label}
|
|
693
|
+
sublabel="(Sublabel)"
|
|
694
|
+
description="Insert the checkbox description here."
|
|
695
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
696
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
697
|
+
/>
|
|
698
|
+
</div>
|
|
699
|
+
|
|
700
|
+
)
|
|
701
|
+
}`
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
id: "source-cards-avatar",
|
|
705
|
+
title: "avatar cards / default, active, disabled and live hover",
|
|
706
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "checkbox", kind: "avatar" }),
|
|
707
|
+
code: `import * as React from 'react'
|
|
708
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
709
|
+
import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
710
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
711
|
+
import { Avatar } from '@open-mercato/ui/primitives/avatar'
|
|
712
|
+
|
|
713
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
714
|
+
const [checked, setChecked] = React.useState(false)
|
|
715
|
+
const label = 'Label'
|
|
716
|
+
return (
|
|
717
|
+
|
|
718
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
719
|
+
<Avatar label={label} size={40} src={imageUrl} aria-hidden="true" />
|
|
720
|
+
<CheckboxField flip checked={checked} onCheckedChange={value => setChecked(value === true)} disabled={disabled}
|
|
721
|
+
label={label}
|
|
722
|
+
sublabel="(Sublabel)"
|
|
723
|
+
description="Insert the checkbox description here."
|
|
724
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
725
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
726
|
+
/>
|
|
727
|
+
</div>
|
|
728
|
+
|
|
729
|
+
)
|
|
730
|
+
}`
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
id: "source-cards-provider",
|
|
734
|
+
title: "provider cards / default, active, disabled and live hover",
|
|
735
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "checkbox", kind: "provider" }),
|
|
736
|
+
code: `import * as React from 'react'
|
|
737
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
738
|
+
import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
739
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
740
|
+
|
|
741
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
742
|
+
const [checked, setChecked] = React.useState(false)
|
|
743
|
+
const label = 'Label'
|
|
744
|
+
return (
|
|
745
|
+
|
|
746
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
747
|
+
<img src={imageUrl} alt="" className="h-6 w-8 shrink-0 object-contain" />
|
|
748
|
+
<CheckboxField flip checked={checked} onCheckedChange={value => setChecked(value === true)} disabled={disabled}
|
|
749
|
+
label={label}
|
|
750
|
+
sublabel="(Sublabel)"
|
|
751
|
+
description="Insert the checkbox description here."
|
|
752
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
753
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
754
|
+
/>
|
|
755
|
+
</div>
|
|
756
|
+
|
|
757
|
+
)
|
|
758
|
+
}`
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
id: "source-cards-brand",
|
|
762
|
+
title: "brand cards / default, active, disabled and live hover",
|
|
763
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "checkbox", kind: "brand" }),
|
|
764
|
+
code: `import * as React from 'react'
|
|
765
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
766
|
+
import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
767
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
768
|
+
|
|
769
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
770
|
+
const [checked, setChecked] = React.useState(false)
|
|
771
|
+
const label = 'Label'
|
|
772
|
+
return (
|
|
773
|
+
|
|
774
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
775
|
+
<img src={imageUrl} alt="" className="size-10 shrink-0 object-contain" />
|
|
776
|
+
<CheckboxField flip checked={checked} onCheckedChange={value => setChecked(value === true)} disabled={disabled}
|
|
777
|
+
label={label}
|
|
778
|
+
sublabel="(Sublabel)"
|
|
779
|
+
description="Insert the checkbox description here."
|
|
780
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
781
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
782
|
+
/>
|
|
783
|
+
</div>
|
|
784
|
+
|
|
785
|
+
)
|
|
786
|
+
}`
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
id: "source-cards-company",
|
|
790
|
+
title: "company cards / default, active, disabled and live hover",
|
|
791
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "checkbox", kind: "company" }),
|
|
792
|
+
code: `import * as React from 'react'
|
|
793
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
794
|
+
import { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'
|
|
795
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
796
|
+
|
|
797
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
798
|
+
const [checked, setChecked] = React.useState(false)
|
|
799
|
+
const label = 'Label'
|
|
800
|
+
return (
|
|
801
|
+
|
|
802
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
803
|
+
<img src={imageUrl} alt="" className="size-10 shrink-0 object-contain" />
|
|
804
|
+
<CheckboxField flip checked={checked} onCheckedChange={value => setChecked(value === true)} disabled={disabled}
|
|
805
|
+
label={label}
|
|
806
|
+
sublabel="(Sublabel)"
|
|
807
|
+
description="Insert the checkbox description here."
|
|
808
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
809
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
810
|
+
/>
|
|
811
|
+
</div>
|
|
812
|
+
|
|
813
|
+
)
|
|
814
|
+
}`
|
|
565
815
|
}
|
|
566
816
|
]
|
|
567
817
|
};
|
|
@@ -574,11 +824,7 @@ const radioEntry = {
|
|
|
574
824
|
{
|
|
575
825
|
id: "group",
|
|
576
826
|
title: "RadioGroup",
|
|
577
|
-
render: () => /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */ jsx(Radio, { value: "card", "aria-label": "Card" }),
|
|
579
|
-
/* @__PURE__ */ jsx(Radio, { value: "transfer", "aria-label": "Bank transfer" }),
|
|
580
|
-
/* @__PURE__ */ jsx(Radio, { value: "cash", "aria-label": "Cash" })
|
|
581
|
-
] }),
|
|
827
|
+
render: () => /* @__PURE__ */ jsx(RadioInputsGroupSample, {}),
|
|
582
828
|
code: `import { Radio, RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
583
829
|
|
|
584
830
|
<RadioGroup defaultValue="card" aria-label="Payment method">
|
|
@@ -590,10 +836,7 @@ const radioEntry = {
|
|
|
590
836
|
{
|
|
591
837
|
id: "disabled",
|
|
592
838
|
title: "Disabled",
|
|
593
|
-
render: () => /* @__PURE__ */
|
|
594
|
-
/* @__PURE__ */ jsx(Radio, { value: "a", "aria-label": "Selected disabled" }),
|
|
595
|
-
/* @__PURE__ */ jsx(Radio, { value: "b", "aria-label": "Unselected disabled" })
|
|
596
|
-
] }),
|
|
839
|
+
render: () => /* @__PURE__ */ jsx(RadioInputsDisabledSample, {}),
|
|
597
840
|
code: `import { Radio, RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
598
841
|
|
|
599
842
|
<RadioGroup defaultValue="a" disabled>
|
|
@@ -608,14 +851,24 @@ const radioFieldEntry = {
|
|
|
608
851
|
id: "radio-field",
|
|
609
852
|
title: "RadioField",
|
|
610
853
|
importPath: "@open-mercato/ui/primitives/radio-field",
|
|
854
|
+
figmaNodeId: "515:4282",
|
|
611
855
|
variants: [
|
|
856
|
+
{
|
|
857
|
+
id: "flip",
|
|
858
|
+
title: "Flipped (radio right)",
|
|
859
|
+
render: () => /* @__PURE__ */ jsx(FlippedRadioPreview, {}),
|
|
860
|
+
code: `import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
861
|
+
import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
862
|
+
|
|
863
|
+
<RadioGroup defaultValue="immediate" aria-label="Notification preferences" className="w-72">
|
|
864
|
+
<RadioField value="immediate" flip label="Immediate updates" />
|
|
865
|
+
<RadioField value="weekly" flip label="Weekly summary" />
|
|
866
|
+
</RadioGroup>`
|
|
867
|
+
},
|
|
612
868
|
{
|
|
613
869
|
id: "default",
|
|
614
870
|
title: "default",
|
|
615
|
-
render: () => /* @__PURE__ */
|
|
616
|
-
/* @__PURE__ */ jsx(RadioField, { value: "standard", label: "Standard" }),
|
|
617
|
-
/* @__PURE__ */ jsx(RadioField, { value: "express", label: "Express" })
|
|
618
|
-
] }),
|
|
871
|
+
render: () => /* @__PURE__ */ jsx(RadioFieldInputsDefaultSample, {}),
|
|
619
872
|
code: `import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
620
873
|
import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
621
874
|
|
|
@@ -627,24 +880,7 @@ import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
|
627
880
|
{
|
|
628
881
|
id: "with-description",
|
|
629
882
|
title: "With description",
|
|
630
|
-
render: () => /* @__PURE__ */ jsx(
|
|
631
|
-
/* @__PURE__ */ jsx(
|
|
632
|
-
RadioField,
|
|
633
|
-
{
|
|
634
|
-
value: "invoice",
|
|
635
|
-
label: "Invoice",
|
|
636
|
-
description: "Pay within 14 days of delivery."
|
|
637
|
-
}
|
|
638
|
-
),
|
|
639
|
-
/* @__PURE__ */ jsx(
|
|
640
|
-
RadioField,
|
|
641
|
-
{
|
|
642
|
-
value: "prepaid",
|
|
643
|
-
label: "Prepaid",
|
|
644
|
-
description: "Order ships after payment clears."
|
|
645
|
-
}
|
|
646
|
-
)
|
|
647
|
-
] }) }),
|
|
883
|
+
render: () => /* @__PURE__ */ jsx(RadioFieldInputsWithDescriptionSample, {}),
|
|
648
884
|
code: `import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
649
885
|
import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
650
886
|
|
|
@@ -652,6 +888,210 @@ import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
|
652
888
|
<RadioField value="invoice" label="Invoice" description="Pay within 14 days of delivery." />
|
|
653
889
|
<RadioField value="prepaid" label="Prepaid" description="Order ships after payment clears." />
|
|
654
890
|
</RadioGroup>`
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
id: "cards",
|
|
894
|
+
title: "Card / default, selected and hover",
|
|
895
|
+
render: () => /* @__PURE__ */ jsx(SelectionCardsPreview, { control: "radio" }),
|
|
896
|
+
code: `import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
897
|
+
import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
898
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
899
|
+
|
|
900
|
+
const cardClassName = 'relative w-full max-w-90 gap-3.5 rounded-xl border border-border bg-background p-4 shadow-xs transition-colors hover:border-transparent hover:bg-muted hover:shadow-none has-[[data-state=checked]]:border-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus has-[:disabled]:border-border has-[:disabled]:bg-background has-[:disabled]:shadow-none [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-xl [&_button]:relative [&_button]:z-10'
|
|
901
|
+
|
|
902
|
+
<RadioGroup defaultValue="immediate" aria-label="Notification preferences" className="grid w-full gap-4 sm:grid-cols-2">
|
|
903
|
+
<RadioField flip value="immediate"
|
|
904
|
+
label="Immediate updates"
|
|
905
|
+
sublabel="(Optional)"
|
|
906
|
+
description="Receive an update when an order changes."
|
|
907
|
+
badge={<Badge variant="info" size="sm">New</Badge>}
|
|
908
|
+
className="mt-0"
|
|
909
|
+
containerClassName={cardClassName}
|
|
910
|
+
/>
|
|
911
|
+
<RadioField flip value="weekly"
|
|
912
|
+
label="Weekly summary"
|
|
913
|
+
sublabel="(Optional)"
|
|
914
|
+
description="Receive one summary every Monday."
|
|
915
|
+
badge={<Badge variant="info" size="sm">New</Badge>}
|
|
916
|
+
className="mt-0"
|
|
917
|
+
containerClassName={cardClassName}
|
|
918
|
+
/>
|
|
919
|
+
</RadioGroup>`
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
id: "cards-disabled",
|
|
923
|
+
title: "Card / disabled",
|
|
924
|
+
render: () => /* @__PURE__ */ jsx(SelectionCardsPreview, { control: "radio", disabled: true }),
|
|
925
|
+
code: `import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
926
|
+
import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
927
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
928
|
+
|
|
929
|
+
const cardClassName = 'relative w-full max-w-90 gap-3.5 rounded-xl border border-border bg-background p-4 shadow-xs transition-colors hover:border-transparent hover:bg-muted hover:shadow-none has-[[data-state=checked]]:border-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus has-[:disabled]:border-border has-[:disabled]:bg-background has-[:disabled]:shadow-none [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-xl [&_button]:relative [&_button]:z-10'
|
|
930
|
+
|
|
931
|
+
<RadioGroup defaultValue="immediate" aria-label="Notification preferences" className="grid w-full gap-4 sm:grid-cols-2">
|
|
932
|
+
<RadioField flip value="immediate" disabled
|
|
933
|
+
label="Immediate updates"
|
|
934
|
+
sublabel="(Optional)"
|
|
935
|
+
description="Receive an update when an order changes."
|
|
936
|
+
badge={<Badge variant="outline" size="sm" className="text-text-disabled">New</Badge>}
|
|
937
|
+
className="mt-0"
|
|
938
|
+
containerClassName={cardClassName}
|
|
939
|
+
/>
|
|
940
|
+
<RadioField flip value="weekly" disabled
|
|
941
|
+
label="Weekly summary"
|
|
942
|
+
sublabel="(Optional)"
|
|
943
|
+
description="Receive one summary every Monday."
|
|
944
|
+
badge={<Badge variant="outline" size="sm" className="text-text-disabled">New</Badge>}
|
|
945
|
+
className="mt-0"
|
|
946
|
+
containerClassName={cardClassName}
|
|
947
|
+
/>
|
|
948
|
+
</RadioGroup>`
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
id: "source-cards-icon",
|
|
952
|
+
title: "icon cards / default, active, disabled and live hover",
|
|
953
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "radio", kind: "icon" }),
|
|
954
|
+
code: `import * as React from 'react'
|
|
955
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
956
|
+
import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
957
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
958
|
+
import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
959
|
+
|
|
960
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
961
|
+
const [value, setValue] = React.useState('selected')
|
|
962
|
+
const label = 'Label'
|
|
963
|
+
return (
|
|
964
|
+
<RadioGroup value={value} onValueChange={setValue} aria-label={label}>
|
|
965
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
966
|
+
<img src={imageUrl} alt="" className="size-10 shrink-0 object-contain" />
|
|
967
|
+
<RadioField value="selected" flip disabled={disabled}
|
|
968
|
+
label={label}
|
|
969
|
+
sublabel="(Sublabel)"
|
|
970
|
+
description="Insert the checkbox description here."
|
|
971
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
972
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
973
|
+
/>
|
|
974
|
+
</div>
|
|
975
|
+
</RadioGroup>
|
|
976
|
+
)
|
|
977
|
+
}`
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
id: "source-cards-avatar",
|
|
981
|
+
title: "avatar cards / default, active, disabled and live hover",
|
|
982
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "radio", kind: "avatar" }),
|
|
983
|
+
code: `import * as React from 'react'
|
|
984
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
985
|
+
import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
986
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
987
|
+
import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
988
|
+
import { Avatar } from '@open-mercato/ui/primitives/avatar'
|
|
989
|
+
|
|
990
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
991
|
+
const [value, setValue] = React.useState('selected')
|
|
992
|
+
const label = 'Label'
|
|
993
|
+
return (
|
|
994
|
+
<RadioGroup value={value} onValueChange={setValue} aria-label={label}>
|
|
995
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
996
|
+
<Avatar label={label} size={40} src={imageUrl} aria-hidden="true" />
|
|
997
|
+
<RadioField value="selected" flip disabled={disabled}
|
|
998
|
+
label={label}
|
|
999
|
+
sublabel="(Sublabel)"
|
|
1000
|
+
description="Insert the checkbox description here."
|
|
1001
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
1002
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
1003
|
+
/>
|
|
1004
|
+
</div>
|
|
1005
|
+
</RadioGroup>
|
|
1006
|
+
)
|
|
1007
|
+
}`
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
id: "source-cards-provider",
|
|
1011
|
+
title: "provider cards / default, active, disabled and live hover",
|
|
1012
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "radio", kind: "provider" }),
|
|
1013
|
+
code: `import * as React from 'react'
|
|
1014
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1015
|
+
import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
1016
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1017
|
+
import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
1018
|
+
|
|
1019
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
1020
|
+
const [value, setValue] = React.useState('selected')
|
|
1021
|
+
const label = 'Label'
|
|
1022
|
+
return (
|
|
1023
|
+
<RadioGroup value={value} onValueChange={setValue} aria-label={label}>
|
|
1024
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
1025
|
+
<img src={imageUrl} alt="" className="h-6 w-8 shrink-0 object-contain" />
|
|
1026
|
+
<RadioField value="selected" flip disabled={disabled}
|
|
1027
|
+
label={label}
|
|
1028
|
+
sublabel="(Sublabel)"
|
|
1029
|
+
description="Insert the checkbox description here."
|
|
1030
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
1031
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
1032
|
+
/>
|
|
1033
|
+
</div>
|
|
1034
|
+
</RadioGroup>
|
|
1035
|
+
)
|
|
1036
|
+
}`
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
id: "source-cards-brand",
|
|
1040
|
+
title: "brand cards / default, active, disabled and live hover",
|
|
1041
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "radio", kind: "brand" }),
|
|
1042
|
+
code: `import * as React from 'react'
|
|
1043
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1044
|
+
import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
1045
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1046
|
+
import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
1047
|
+
|
|
1048
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
1049
|
+
const [value, setValue] = React.useState('selected')
|
|
1050
|
+
const label = 'Label'
|
|
1051
|
+
return (
|
|
1052
|
+
<RadioGroup value={value} onValueChange={setValue} aria-label={label}>
|
|
1053
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
1054
|
+
<img src={imageUrl} alt="" className="size-10 shrink-0 object-contain" />
|
|
1055
|
+
<RadioField value="selected" flip disabled={disabled}
|
|
1056
|
+
label={label}
|
|
1057
|
+
sublabel="(Sublabel)"
|
|
1058
|
+
description="Insert the checkbox description here."
|
|
1059
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
1060
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
1061
|
+
/>
|
|
1062
|
+
</div>
|
|
1063
|
+
</RadioGroup>
|
|
1064
|
+
)
|
|
1065
|
+
}`
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
id: "source-cards-company",
|
|
1069
|
+
title: "company cards / default, active, disabled and live hover",
|
|
1070
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "radio", kind: "company" }),
|
|
1071
|
+
code: `import * as React from 'react'
|
|
1072
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1073
|
+
import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
1074
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1075
|
+
import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
1076
|
+
|
|
1077
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
1078
|
+
const [value, setValue] = React.useState('selected')
|
|
1079
|
+
const label = 'Label'
|
|
1080
|
+
return (
|
|
1081
|
+
<RadioGroup value={value} onValueChange={setValue} aria-label={label}>
|
|
1082
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
1083
|
+
<img src={imageUrl} alt="" className="size-10 shrink-0 object-contain" />
|
|
1084
|
+
<RadioField value="selected" flip disabled={disabled}
|
|
1085
|
+
label={label}
|
|
1086
|
+
sublabel="(Sublabel)"
|
|
1087
|
+
description="Insert the checkbox description here."
|
|
1088
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
1089
|
+
className="mt-0 disabled:opacity-100 disabled:data-[state=checked]:bg-bg-disabled disabled:data-[state=checked]:border-border-disabled disabled:data-[state=checked]:text-background" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
1090
|
+
/>
|
|
1091
|
+
</div>
|
|
1092
|
+
</RadioGroup>
|
|
1093
|
+
)
|
|
1094
|
+
}`
|
|
655
1095
|
}
|
|
656
1096
|
]
|
|
657
1097
|
};
|
|
@@ -663,10 +1103,7 @@ const switchEntry = {
|
|
|
663
1103
|
{
|
|
664
1104
|
id: "states",
|
|
665
1105
|
title: "States",
|
|
666
|
-
render: () => /* @__PURE__ */
|
|
667
|
-
/* @__PURE__ */ jsx(Switch, { "aria-label": "Off" }),
|
|
668
|
-
/* @__PURE__ */ jsx(Switch, { defaultChecked: true, "aria-label": "On" })
|
|
669
|
-
] }),
|
|
1106
|
+
render: () => /* @__PURE__ */ jsx(SwitchInputsStatesSample, {}),
|
|
670
1107
|
code: `import { Switch } from '@open-mercato/ui/primitives/switch'
|
|
671
1108
|
|
|
672
1109
|
<Switch />
|
|
@@ -675,10 +1112,7 @@ const switchEntry = {
|
|
|
675
1112
|
{
|
|
676
1113
|
id: "disabled",
|
|
677
1114
|
title: "Disabled",
|
|
678
|
-
render: () => /* @__PURE__ */
|
|
679
|
-
/* @__PURE__ */ jsx(Switch, { disabled: true, "aria-label": "Disabled off" }),
|
|
680
|
-
/* @__PURE__ */ jsx(Switch, { disabled: true, defaultChecked: true, "aria-label": "Disabled on" })
|
|
681
|
-
] }),
|
|
1115
|
+
render: () => /* @__PURE__ */ jsx(SwitchInputsDisabledSample, {}),
|
|
682
1116
|
code: `import { Switch } from '@open-mercato/ui/primitives/switch'
|
|
683
1117
|
|
|
684
1118
|
<Switch disabled />
|
|
@@ -690,11 +1124,12 @@ const switchFieldEntry = {
|
|
|
690
1124
|
id: "switch-field",
|
|
691
1125
|
title: "SwitchField",
|
|
692
1126
|
importPath: "@open-mercato/ui/primitives/switch-field",
|
|
1127
|
+
figmaNodeId: "385:4580",
|
|
693
1128
|
variants: [
|
|
694
1129
|
{
|
|
695
1130
|
id: "default",
|
|
696
1131
|
title: "default (switch right)",
|
|
697
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1132
|
+
render: () => /* @__PURE__ */ jsx(SwitchFieldInputsDefaultSample, {}),
|
|
698
1133
|
code: `import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
699
1134
|
|
|
700
1135
|
<SwitchField label="Two-factor authentication" defaultChecked />`
|
|
@@ -702,13 +1137,7 @@ const switchFieldEntry = {
|
|
|
702
1137
|
{
|
|
703
1138
|
id: "with-description",
|
|
704
1139
|
title: "With description",
|
|
705
|
-
render: () => /* @__PURE__ */ jsx(
|
|
706
|
-
SwitchField,
|
|
707
|
-
{
|
|
708
|
-
label: "Low-stock alerts",
|
|
709
|
-
description: "Notify purchasing when stock drops below the reorder point."
|
|
710
|
-
}
|
|
711
|
-
) }),
|
|
1140
|
+
render: () => /* @__PURE__ */ jsx(SwitchFieldInputsWithDescriptionSample, {}),
|
|
712
1141
|
code: `import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
713
1142
|
|
|
714
1143
|
<SwitchField
|
|
@@ -719,22 +1148,428 @@ const switchFieldEntry = {
|
|
|
719
1148
|
{
|
|
720
1149
|
id: "flip",
|
|
721
1150
|
title: "Flipped (switch left)",
|
|
722
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1151
|
+
render: () => /* @__PURE__ */ jsx(SwitchFieldInputsFlipSample, {}),
|
|
723
1152
|
code: `import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
724
1153
|
|
|
725
1154
|
<SwitchField flip label="Sync inventory nightly" defaultChecked />`
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
id: "cards",
|
|
1158
|
+
title: "Card / default, selected and hover",
|
|
1159
|
+
render: () => /* @__PURE__ */ jsx(SelectionCardsPreview, { control: "switch" }),
|
|
1160
|
+
code: `import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1161
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1162
|
+
|
|
1163
|
+
const cardClassName = 'relative w-full max-w-90 gap-3.5 rounded-xl border border-border bg-background p-4 shadow-xs transition-colors hover:border-transparent hover:bg-muted hover:shadow-none has-[[data-state=checked]]:border-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus has-[:disabled]:border-border has-[:disabled]:bg-background has-[:disabled]:shadow-none [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-xl [&_button]:relative [&_button]:z-10'
|
|
1164
|
+
|
|
1165
|
+
<div className="grid w-full gap-4 sm:grid-cols-2">
|
|
1166
|
+
<SwitchField defaultChecked
|
|
1167
|
+
label="Immediate updates"
|
|
1168
|
+
sublabel="(Optional)"
|
|
1169
|
+
description="Receive an update when an order changes."
|
|
1170
|
+
badge={<Badge variant="info" size="sm">New</Badge>}
|
|
1171
|
+
className="mt-0"
|
|
1172
|
+
containerClassName={cardClassName}
|
|
1173
|
+
/>
|
|
1174
|
+
<SwitchField
|
|
1175
|
+
label="Weekly summary"
|
|
1176
|
+
sublabel="(Optional)"
|
|
1177
|
+
description="Receive one summary every Monday."
|
|
1178
|
+
badge={<Badge variant="info" size="sm">New</Badge>}
|
|
1179
|
+
className="mt-0"
|
|
1180
|
+
containerClassName={cardClassName}
|
|
1181
|
+
/>
|
|
1182
|
+
</div>`
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
id: "cards-disabled",
|
|
1186
|
+
title: "Card / disabled",
|
|
1187
|
+
render: () => /* @__PURE__ */ jsx(SelectionCardsPreview, { control: "switch", disabled: true }),
|
|
1188
|
+
code: `import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1189
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1190
|
+
|
|
1191
|
+
const cardClassName = 'relative w-full max-w-90 gap-3.5 rounded-xl border border-border bg-background p-4 shadow-xs transition-colors hover:border-transparent hover:bg-muted hover:shadow-none has-[[data-state=checked]]:border-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus has-[:disabled]:border-border has-[:disabled]:bg-background has-[:disabled]:shadow-none [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-xl [&_button]:relative [&_button]:z-10'
|
|
1192
|
+
|
|
1193
|
+
<div className="grid w-full gap-4 sm:grid-cols-2">
|
|
1194
|
+
<SwitchField defaultChecked disabled
|
|
1195
|
+
label="Immediate updates"
|
|
1196
|
+
sublabel="(Optional)"
|
|
1197
|
+
description="Receive an update when an order changes."
|
|
1198
|
+
badge={<Badge variant="outline" size="sm" className="text-text-disabled">New</Badge>}
|
|
1199
|
+
className="mt-0"
|
|
1200
|
+
containerClassName={cardClassName}
|
|
1201
|
+
/>
|
|
1202
|
+
<SwitchField disabled
|
|
1203
|
+
label="Weekly summary"
|
|
1204
|
+
sublabel="(Optional)"
|
|
1205
|
+
description="Receive one summary every Monday."
|
|
1206
|
+
badge={<Badge variant="outline" size="sm" className="text-text-disabled">New</Badge>}
|
|
1207
|
+
className="mt-0"
|
|
1208
|
+
containerClassName={cardClassName}
|
|
1209
|
+
/>
|
|
1210
|
+
</div>`
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
id: "source-cards-icon",
|
|
1214
|
+
title: "icon cards / default, active, disabled and live hover",
|
|
1215
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "switch", kind: "icon" }),
|
|
1216
|
+
code: `import * as React from 'react'
|
|
1217
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1218
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1219
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1220
|
+
|
|
1221
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
1222
|
+
const [checked, setChecked] = React.useState(false)
|
|
1223
|
+
const label = 'Label'
|
|
1224
|
+
return (
|
|
1225
|
+
|
|
1226
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
1227
|
+
<img src={imageUrl} alt="" className="size-10 shrink-0 object-contain" />
|
|
1228
|
+
<SwitchField checked={checked} onCheckedChange={setChecked} disabled={disabled}
|
|
1229
|
+
label={label}
|
|
1230
|
+
sublabel="(Sublabel)"
|
|
1231
|
+
description="Insert the checkbox description here."
|
|
1232
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
1233
|
+
className="mt-0" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
1234
|
+
/>
|
|
1235
|
+
</div>
|
|
1236
|
+
|
|
1237
|
+
)
|
|
1238
|
+
}`
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
id: "source-cards-avatar",
|
|
1242
|
+
title: "avatar cards / default, active, disabled and live hover",
|
|
1243
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "switch", kind: "avatar" }),
|
|
1244
|
+
code: `import * as React from 'react'
|
|
1245
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1246
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1247
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1248
|
+
import { Avatar } from '@open-mercato/ui/primitives/avatar'
|
|
1249
|
+
|
|
1250
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
1251
|
+
const [checked, setChecked] = React.useState(false)
|
|
1252
|
+
const label = 'Label'
|
|
1253
|
+
return (
|
|
1254
|
+
|
|
1255
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
1256
|
+
<Avatar label={label} size={40} src={imageUrl} aria-hidden="true" />
|
|
1257
|
+
<SwitchField checked={checked} onCheckedChange={setChecked} disabled={disabled}
|
|
1258
|
+
label={label}
|
|
1259
|
+
sublabel="(Sublabel)"
|
|
1260
|
+
description="Insert the checkbox description here."
|
|
1261
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
1262
|
+
className="mt-0" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
1263
|
+
/>
|
|
1264
|
+
</div>
|
|
1265
|
+
|
|
1266
|
+
)
|
|
1267
|
+
}`
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
id: "source-cards-provider",
|
|
1271
|
+
title: "provider cards / default, active, disabled and live hover",
|
|
1272
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "switch", kind: "provider" }),
|
|
1273
|
+
code: `import * as React from 'react'
|
|
1274
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1275
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1276
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1277
|
+
|
|
1278
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
1279
|
+
const [checked, setChecked] = React.useState(false)
|
|
1280
|
+
const label = 'Label'
|
|
1281
|
+
return (
|
|
1282
|
+
|
|
1283
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
1284
|
+
<img src={imageUrl} alt="" className="h-6 w-8 shrink-0 object-contain" />
|
|
1285
|
+
<SwitchField checked={checked} onCheckedChange={setChecked} disabled={disabled}
|
|
1286
|
+
label={label}
|
|
1287
|
+
sublabel="(Sublabel)"
|
|
1288
|
+
description="Insert the checkbox description here."
|
|
1289
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
1290
|
+
className="mt-0" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
1291
|
+
/>
|
|
1292
|
+
</div>
|
|
1293
|
+
|
|
1294
|
+
)
|
|
1295
|
+
}`
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
id: "source-cards-brand",
|
|
1299
|
+
title: "brand cards / default, active, disabled and live hover",
|
|
1300
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "switch", kind: "brand" }),
|
|
1301
|
+
code: `import * as React from 'react'
|
|
1302
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1303
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1304
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1305
|
+
|
|
1306
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
1307
|
+
const [checked, setChecked] = React.useState(false)
|
|
1308
|
+
const label = 'Label'
|
|
1309
|
+
return (
|
|
1310
|
+
|
|
1311
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
1312
|
+
<img src={imageUrl} alt="" className="size-10 shrink-0 object-contain" />
|
|
1313
|
+
<SwitchField checked={checked} onCheckedChange={setChecked} disabled={disabled}
|
|
1314
|
+
label={label}
|
|
1315
|
+
sublabel="(Sublabel)"
|
|
1316
|
+
description="Insert the checkbox description here."
|
|
1317
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
1318
|
+
className="mt-0" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
1319
|
+
/>
|
|
1320
|
+
</div>
|
|
1321
|
+
|
|
1322
|
+
)
|
|
1323
|
+
}`
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
id: "source-cards-company",
|
|
1327
|
+
title: "company cards / default, active, disabled and live hover",
|
|
1328
|
+
render: () => /* @__PURE__ */ jsx(SelectionSourceCardsDemo, { control: "switch", kind: "company" }),
|
|
1329
|
+
code: `import * as React from 'react'
|
|
1330
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1331
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1332
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1333
|
+
|
|
1334
|
+
function SelectionCardExample({ imageUrl, disabled = false }: { imageUrl: string; disabled?: boolean }) {
|
|
1335
|
+
const [checked, setChecked] = React.useState(false)
|
|
1336
|
+
const label = 'Label'
|
|
1337
|
+
return (
|
|
1338
|
+
|
|
1339
|
+
<div className={cn('relative flex w-90 max-w-full items-start gap-3.5 rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs transition-colors hover:bg-muted hover:shadow-none has-[[data-state=checked]]:ring-accent-indigo has-[[data-state=checked]]:shadow-none has-[:focus-visible]:shadow-focus [&_label]:after:absolute [&_label]:after:inset-0 [&_label]:after:rounded-selection-card [&_button]:relative [&_button]:z-10', disabled && 'shadow-none hover:bg-background has-[[data-state=checked]]:ring-border')}>
|
|
1340
|
+
<img src={imageUrl} alt="" className="size-10 shrink-0 object-contain" />
|
|
1341
|
+
<SwitchField checked={checked} onCheckedChange={setChecked} disabled={disabled}
|
|
1342
|
+
label={label}
|
|
1343
|
+
sublabel="(Sublabel)"
|
|
1344
|
+
description="Insert the checkbox description here."
|
|
1345
|
+
badge={<Badge size={16} appearance={disabled ? 'stroke' : 'light'} tone={disabled ? 'neutral' : 'info'}>New</Badge>}
|
|
1346
|
+
className="mt-0" containerClassName="min-w-0 flex-1 gap-3.5"
|
|
1347
|
+
/>
|
|
1348
|
+
</div>
|
|
1349
|
+
|
|
1350
|
+
)
|
|
1351
|
+
}`
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
id: "integration-horizontal-card",
|
|
1355
|
+
title: "Integration / horizontal / card",
|
|
1356
|
+
render: () => /* @__PURE__ */ jsx(IntegrationSwitchDemo, { alignment: "horizontal", appearance: "card" }),
|
|
1357
|
+
code: `import * as React from 'react'
|
|
1358
|
+
import { Settings } from 'lucide-react'
|
|
1359
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1360
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1361
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1362
|
+
import { Switch } from '@open-mercato/ui/primitives/switch'
|
|
1363
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1364
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
1365
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@open-mercato/ui/primitives/dialog'
|
|
1366
|
+
|
|
1367
|
+
function IntegrationExample({ brandUrl, alignment, appearance }: { brandUrl: string; alignment: 'horizontal' | 'vertical'; appearance: 'card' | 'list' }) {
|
|
1368
|
+
const t = useT()
|
|
1369
|
+
const id = React.useId()
|
|
1370
|
+
const [checked, setChecked] = React.useState(false)
|
|
1371
|
+
const [open, setOpen] = React.useState(false)
|
|
1372
|
+
const horizontal = alignment === 'horizontal'
|
|
1373
|
+
const card = appearance === 'card'
|
|
1374
|
+
return (
|
|
1375
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
1376
|
+
<div data-slot="integration-switch" data-alignment={alignment} data-appearance={appearance} className={cn('relative flex max-w-full gap-3.5', horizontal ? 'w-154 flex-wrap items-center sm:flex-nowrap' : 'w-95 flex-col items-start', card && 'rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs')}>
|
|
1377
|
+
<img src={brandUrl} alt="" className={cn('shrink-0', card ? 'size-10' : 'size-12')} />
|
|
1378
|
+
<div className={cn('flex min-w-0 flex-col gap-1', horizontal && 'min-w-40 flex-1')}>
|
|
1379
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
1380
|
+
<span id={id} className={cn('font-medium text-foreground', card ? 'text-sm leading-5' : 'text-base leading-6')}>Microsoft Office 365</span>
|
|
1381
|
+
<Badge size={16} appearance="light" tone="info">New</Badge>
|
|
1382
|
+
</div>
|
|
1383
|
+
<p className={cn('text-muted-foreground', card ? 'text-xs leading-4' : 'text-sm leading-5')}>Seamless collaboration and document management.</p>
|
|
1384
|
+
</div>
|
|
1385
|
+
<Button asChild variant="outline" size="default" className={horizontal ? undefined : 'w-full'}><DialogTrigger><Settings aria-hidden="true" />Manage</DialogTrigger></Button>
|
|
1386
|
+
<Switch aria-labelledby={id} checked={checked} onCheckedChange={setChecked} className={horizontal ? undefined : card ? 'absolute top-5 right-5' : 'absolute top-3 right-3'} />
|
|
1387
|
+
</div>
|
|
1388
|
+
<DialogContent onKeyDownCapture={event => { if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) { event.preventDefault(); setOpen(false) } }}>
|
|
1389
|
+
<DialogHeader><DialogTitle>Microsoft Office 365 settings</DialogTitle><DialogDescription>Seamless collaboration and document management.</DialogDescription></DialogHeader>
|
|
1390
|
+
<SwitchField label="Enable integration" checked={checked} onCheckedChange={setChecked} />
|
|
1391
|
+
<DialogFooter><Button variant="outline" onClick={() => setOpen(false)}>{t('common.close')}</Button></DialogFooter>
|
|
1392
|
+
</DialogContent>
|
|
1393
|
+
</Dialog>
|
|
1394
|
+
)
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
<IntegrationExample brandUrl={brandUrl} alignment="horizontal" appearance="card" />`
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
id: "integration-horizontal-list",
|
|
1401
|
+
title: "Integration / horizontal / list",
|
|
1402
|
+
render: () => /* @__PURE__ */ jsx(IntegrationSwitchDemo, { alignment: "horizontal", appearance: "list" }),
|
|
1403
|
+
code: `import * as React from 'react'
|
|
1404
|
+
import { Settings } from 'lucide-react'
|
|
1405
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1406
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1407
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1408
|
+
import { Switch } from '@open-mercato/ui/primitives/switch'
|
|
1409
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1410
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
1411
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@open-mercato/ui/primitives/dialog'
|
|
1412
|
+
|
|
1413
|
+
function IntegrationExample({ brandUrl, alignment, appearance }: { brandUrl: string; alignment: 'horizontal' | 'vertical'; appearance: 'card' | 'list' }) {
|
|
1414
|
+
const t = useT()
|
|
1415
|
+
const id = React.useId()
|
|
1416
|
+
const [checked, setChecked] = React.useState(false)
|
|
1417
|
+
const [open, setOpen] = React.useState(false)
|
|
1418
|
+
const horizontal = alignment === 'horizontal'
|
|
1419
|
+
const card = appearance === 'card'
|
|
1420
|
+
return (
|
|
1421
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
1422
|
+
<div data-slot="integration-switch" data-alignment={alignment} data-appearance={appearance} className={cn('relative flex max-w-full gap-3.5', horizontal ? 'w-154 flex-wrap items-center sm:flex-nowrap' : 'w-95 flex-col items-start', card && 'rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs')}>
|
|
1423
|
+
<img src={brandUrl} alt="" className={cn('shrink-0', card ? 'size-10' : 'size-12')} />
|
|
1424
|
+
<div className={cn('flex min-w-0 flex-col gap-1', horizontal && 'min-w-40 flex-1')}>
|
|
1425
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
1426
|
+
<span id={id} className={cn('font-medium text-foreground', card ? 'text-sm leading-5' : 'text-base leading-6')}>Microsoft Office 365</span>
|
|
1427
|
+
<Badge size={16} appearance="light" tone="info">New</Badge>
|
|
1428
|
+
</div>
|
|
1429
|
+
<p className={cn('text-muted-foreground', card ? 'text-xs leading-4' : 'text-sm leading-5')}>Seamless collaboration and document management.</p>
|
|
1430
|
+
</div>
|
|
1431
|
+
<Button asChild variant="outline" size="default" className={horizontal ? undefined : 'w-full'}><DialogTrigger><Settings aria-hidden="true" />Manage</DialogTrigger></Button>
|
|
1432
|
+
<Switch aria-labelledby={id} checked={checked} onCheckedChange={setChecked} className={horizontal ? undefined : card ? 'absolute top-5 right-5' : 'absolute top-3 right-3'} />
|
|
1433
|
+
</div>
|
|
1434
|
+
<DialogContent onKeyDownCapture={event => { if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) { event.preventDefault(); setOpen(false) } }}>
|
|
1435
|
+
<DialogHeader><DialogTitle>Microsoft Office 365 settings</DialogTitle><DialogDescription>Seamless collaboration and document management.</DialogDescription></DialogHeader>
|
|
1436
|
+
<SwitchField label="Enable integration" checked={checked} onCheckedChange={setChecked} />
|
|
1437
|
+
<DialogFooter><Button variant="outline" onClick={() => setOpen(false)}>{t('common.close')}</Button></DialogFooter>
|
|
1438
|
+
</DialogContent>
|
|
1439
|
+
</Dialog>
|
|
1440
|
+
)
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
<IntegrationExample brandUrl={brandUrl} alignment="horizontal" appearance="list" />`
|
|
1444
|
+
},
|
|
1445
|
+
{
|
|
1446
|
+
id: "integration-vertical-card",
|
|
1447
|
+
title: "Integration / vertical / card",
|
|
1448
|
+
render: () => /* @__PURE__ */ jsx(IntegrationSwitchDemo, { alignment: "vertical", appearance: "card" }),
|
|
1449
|
+
code: `import * as React from 'react'
|
|
1450
|
+
import { Settings } from 'lucide-react'
|
|
1451
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1452
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1453
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1454
|
+
import { Switch } from '@open-mercato/ui/primitives/switch'
|
|
1455
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1456
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
1457
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@open-mercato/ui/primitives/dialog'
|
|
1458
|
+
|
|
1459
|
+
function IntegrationExample({ brandUrl, alignment, appearance }: { brandUrl: string; alignment: 'horizontal' | 'vertical'; appearance: 'card' | 'list' }) {
|
|
1460
|
+
const t = useT()
|
|
1461
|
+
const id = React.useId()
|
|
1462
|
+
const [checked, setChecked] = React.useState(false)
|
|
1463
|
+
const [open, setOpen] = React.useState(false)
|
|
1464
|
+
const horizontal = alignment === 'horizontal'
|
|
1465
|
+
const card = appearance === 'card'
|
|
1466
|
+
return (
|
|
1467
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
1468
|
+
<div data-slot="integration-switch" data-alignment={alignment} data-appearance={appearance} className={cn('relative flex max-w-full gap-3.5', horizontal ? 'w-154 flex-wrap items-center sm:flex-nowrap' : 'w-95 flex-col items-start', card && 'rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs')}>
|
|
1469
|
+
<img src={brandUrl} alt="" className={cn('shrink-0', card ? 'size-10' : 'size-12')} />
|
|
1470
|
+
<div className={cn('flex min-w-0 flex-col gap-1', horizontal && 'min-w-40 flex-1')}>
|
|
1471
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
1472
|
+
<span id={id} className={cn('font-medium text-foreground', card ? 'text-sm leading-5' : 'text-base leading-6')}>Microsoft Office 365</span>
|
|
1473
|
+
<Badge size={16} appearance="light" tone="info">New</Badge>
|
|
1474
|
+
</div>
|
|
1475
|
+
<p className={cn('text-muted-foreground', card ? 'text-xs leading-4' : 'text-sm leading-5')}>Seamless collaboration and document management.</p>
|
|
1476
|
+
</div>
|
|
1477
|
+
<Button asChild variant="outline" size="default" className={horizontal ? undefined : 'w-full'}><DialogTrigger><Settings aria-hidden="true" />Manage</DialogTrigger></Button>
|
|
1478
|
+
<Switch aria-labelledby={id} checked={checked} onCheckedChange={setChecked} className={horizontal ? undefined : card ? 'absolute top-5 right-5' : 'absolute top-3 right-3'} />
|
|
1479
|
+
</div>
|
|
1480
|
+
<DialogContent onKeyDownCapture={event => { if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) { event.preventDefault(); setOpen(false) } }}>
|
|
1481
|
+
<DialogHeader><DialogTitle>Microsoft Office 365 settings</DialogTitle><DialogDescription>Seamless collaboration and document management.</DialogDescription></DialogHeader>
|
|
1482
|
+
<SwitchField label="Enable integration" checked={checked} onCheckedChange={setChecked} />
|
|
1483
|
+
<DialogFooter><Button variant="outline" onClick={() => setOpen(false)}>{t('common.close')}</Button></DialogFooter>
|
|
1484
|
+
</DialogContent>
|
|
1485
|
+
</Dialog>
|
|
1486
|
+
)
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
<IntegrationExample brandUrl={brandUrl} alignment="vertical" appearance="card" />`
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
id: "integration-vertical-list",
|
|
1493
|
+
title: "Integration / vertical / list",
|
|
1494
|
+
render: () => /* @__PURE__ */ jsx(IntegrationSwitchDemo, { alignment: "vertical", appearance: "list" }),
|
|
1495
|
+
code: `import * as React from 'react'
|
|
1496
|
+
import { Settings } from 'lucide-react'
|
|
1497
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
1498
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
1499
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
1500
|
+
import { Switch } from '@open-mercato/ui/primitives/switch'
|
|
1501
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
1502
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
1503
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@open-mercato/ui/primitives/dialog'
|
|
1504
|
+
|
|
1505
|
+
function IntegrationExample({ brandUrl, alignment, appearance }: { brandUrl: string; alignment: 'horizontal' | 'vertical'; appearance: 'card' | 'list' }) {
|
|
1506
|
+
const t = useT()
|
|
1507
|
+
const id = React.useId()
|
|
1508
|
+
const [checked, setChecked] = React.useState(false)
|
|
1509
|
+
const [open, setOpen] = React.useState(false)
|
|
1510
|
+
const horizontal = alignment === 'horizontal'
|
|
1511
|
+
const card = appearance === 'card'
|
|
1512
|
+
return (
|
|
1513
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
1514
|
+
<div data-slot="integration-switch" data-alignment={alignment} data-appearance={appearance} className={cn('relative flex max-w-full gap-3.5', horizontal ? 'w-154 flex-wrap items-center sm:flex-nowrap' : 'w-95 flex-col items-start', card && 'rounded-selection-card bg-background p-4 ring-1 ring-inset ring-border shadow-xs')}>
|
|
1515
|
+
<img src={brandUrl} alt="" className={cn('shrink-0', card ? 'size-10' : 'size-12')} />
|
|
1516
|
+
<div className={cn('flex min-w-0 flex-col gap-1', horizontal && 'min-w-40 flex-1')}>
|
|
1517
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
1518
|
+
<span id={id} className={cn('font-medium text-foreground', card ? 'text-sm leading-5' : 'text-base leading-6')}>Microsoft Office 365</span>
|
|
1519
|
+
<Badge size={16} appearance="light" tone="info">New</Badge>
|
|
1520
|
+
</div>
|
|
1521
|
+
<p className={cn('text-muted-foreground', card ? 'text-xs leading-4' : 'text-sm leading-5')}>Seamless collaboration and document management.</p>
|
|
1522
|
+
</div>
|
|
1523
|
+
<Button asChild variant="outline" size="default" className={horizontal ? undefined : 'w-full'}><DialogTrigger><Settings aria-hidden="true" />Manage</DialogTrigger></Button>
|
|
1524
|
+
<Switch aria-labelledby={id} checked={checked} onCheckedChange={setChecked} className={horizontal ? undefined : card ? 'absolute top-5 right-5' : 'absolute top-3 right-3'} />
|
|
1525
|
+
</div>
|
|
1526
|
+
<DialogContent onKeyDownCapture={event => { if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) { event.preventDefault(); setOpen(false) } }}>
|
|
1527
|
+
<DialogHeader><DialogTitle>Microsoft Office 365 settings</DialogTitle><DialogDescription>Seamless collaboration and document management.</DialogDescription></DialogHeader>
|
|
1528
|
+
<SwitchField label="Enable integration" checked={checked} onCheckedChange={setChecked} />
|
|
1529
|
+
<DialogFooter><Button variant="outline" onClick={() => setOpen(false)}>{t('common.close')}</Button></DialogFooter>
|
|
1530
|
+
</DialogContent>
|
|
1531
|
+
</Dialog>
|
|
1532
|
+
)
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
<IntegrationExample brandUrl={brandUrl} alignment="vertical" appearance="list" />`
|
|
726
1536
|
}
|
|
727
1537
|
]
|
|
728
1538
|
};
|
|
1539
|
+
function SliderValueDemo({ initialValues }) {
|
|
1540
|
+
const t = useT();
|
|
1541
|
+
const id = React.useId();
|
|
1542
|
+
const [values, setValues] = React.useState(initialValues);
|
|
1543
|
+
const range = values.length === 2;
|
|
1544
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-72 max-w-full flex-col gap-1", children: [
|
|
1545
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 text-xs", children: [
|
|
1546
|
+
/* @__PURE__ */ jsx("span", { id, children: t(range ? "design_system.gallery.examples.controls.range" : "design_system.gallery.examples.controls.value") }),
|
|
1547
|
+
/* @__PURE__ */ jsx("output", { className: "text-muted-foreground", children: values.join(" \u2013 ") })
|
|
1548
|
+
] }),
|
|
1549
|
+
/* @__PURE__ */ jsx(
|
|
1550
|
+
Slider,
|
|
1551
|
+
{
|
|
1552
|
+
value: values,
|
|
1553
|
+
onValueChange: setValues,
|
|
1554
|
+
min: 0,
|
|
1555
|
+
max: 100,
|
|
1556
|
+
className: "h-4",
|
|
1557
|
+
"aria-labelledby": id,
|
|
1558
|
+
thumbLabels: range ? [t("design_system.gallery.examples.controls.lower"), t("design_system.gallery.examples.controls.upper")] : void 0
|
|
1559
|
+
}
|
|
1560
|
+
)
|
|
1561
|
+
] });
|
|
1562
|
+
}
|
|
729
1563
|
const sliderEntry = {
|
|
730
1564
|
id: "slider",
|
|
1565
|
+
figmaNodeId: "2617:1169",
|
|
731
1566
|
title: "Slider",
|
|
732
1567
|
importPath: "@open-mercato/ui/primitives/slider",
|
|
733
1568
|
variants: [
|
|
734
1569
|
{
|
|
735
1570
|
id: "single",
|
|
736
1571
|
title: "Single value",
|
|
737
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1572
|
+
render: () => /* @__PURE__ */ jsx(SliderInputsSingleSample, {}),
|
|
738
1573
|
code: `import { Slider } from '@open-mercato/ui/primitives/slider'
|
|
739
1574
|
|
|
740
1575
|
<Slider defaultValue={[40]} min={0} max={100} step={5} aria-label="Discount" />`
|
|
@@ -742,7 +1577,7 @@ const sliderEntry = {
|
|
|
742
1577
|
{
|
|
743
1578
|
id: "range",
|
|
744
1579
|
title: "Range (two thumbs)",
|
|
745
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1580
|
+
render: () => /* @__PURE__ */ jsx(SliderInputsRangeSample, {}),
|
|
746
1581
|
code: `import { Slider } from '@open-mercato/ui/primitives/slider'
|
|
747
1582
|
|
|
748
1583
|
<Slider defaultValue={[20, 60]} min={0} max={100} aria-label="Price range" />`
|
|
@@ -750,10 +1585,56 @@ const sliderEntry = {
|
|
|
750
1585
|
{
|
|
751
1586
|
id: "disabled",
|
|
752
1587
|
title: "Disabled",
|
|
753
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1588
|
+
render: () => /* @__PURE__ */ jsx(SliderInputsDisabledSample, {}),
|
|
754
1589
|
code: `import { Slider } from '@open-mercato/ui/primitives/slider'
|
|
755
1590
|
|
|
756
1591
|
<Slider defaultValue={[45]} disabled />`
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
id: "source-values",
|
|
1595
|
+
title: "Source values \xB7 0 / 25 / 50 / 75 / 100",
|
|
1596
|
+
render: () => /* @__PURE__ */ jsx("div", { className: "flex w-full flex-wrap gap-6", children: [0, 25, 50, 75, 100].map((value) => /* @__PURE__ */ jsx(SliderValueDemo, { initialValues: [value] }, value)) }),
|
|
1597
|
+
code: `import * as React from 'react'
|
|
1598
|
+
import { Slider } from '@open-mercato/ui/primitives/slider'
|
|
1599
|
+
|
|
1600
|
+
function SliderValueDemo({ initialValues }: { initialValues: number[] }) {
|
|
1601
|
+
const id = React.useId()
|
|
1602
|
+
const [values, setValues] = React.useState(initialValues)
|
|
1603
|
+
const range = values.length === 2
|
|
1604
|
+
return <div className="flex w-72 max-w-full flex-col gap-1">
|
|
1605
|
+
<div className="flex items-center justify-between gap-2 text-xs">
|
|
1606
|
+
<span id={id}>{range ? 'Range' : 'Value'}</span>
|
|
1607
|
+
<output className="text-muted-foreground">{values.join(' \u2013 ')}</output>
|
|
1608
|
+
</div>
|
|
1609
|
+
<Slider value={values} onValueChange={setValues} min={0} max={100} className="h-4" aria-labelledby={id}
|
|
1610
|
+
thumbLabels={range ? ['Lower value', 'Upper value'] : undefined} />
|
|
1611
|
+
</div>
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
<div className="flex w-full flex-wrap gap-6">{[0, 25, 50, 75, 100].map(value => <SliderValueDemo key={value} initialValues={[value]} />)}</div>`
|
|
1615
|
+
},
|
|
1616
|
+
{
|
|
1617
|
+
id: "source-ranges",
|
|
1618
|
+
title: "Source ranges \xB7 11 pairs",
|
|
1619
|
+
render: () => /* @__PURE__ */ jsx("div", { className: "flex w-full flex-wrap gap-6", children: [[0, 0], [0, 25], [25, 50], [50, 75], [75, 100], [0, 50], [25, 75], [50, 100], [0, 75], [25, 100], [0, 100]].map((values) => /* @__PURE__ */ jsx(SliderValueDemo, { initialValues: values }, values.join("-"))) }),
|
|
1620
|
+
code: `import * as React from 'react'
|
|
1621
|
+
import { Slider } from '@open-mercato/ui/primitives/slider'
|
|
1622
|
+
|
|
1623
|
+
function SliderValueDemo({ initialValues }: { initialValues: number[] }) {
|
|
1624
|
+
const id = React.useId()
|
|
1625
|
+
const [values, setValues] = React.useState(initialValues)
|
|
1626
|
+
const range = values.length === 2
|
|
1627
|
+
return <div className="flex w-72 max-w-full flex-col gap-1">
|
|
1628
|
+
<div className="flex items-center justify-between gap-2 text-xs">
|
|
1629
|
+
<span id={id}>{range ? 'Range' : 'Value'}</span>
|
|
1630
|
+
<output className="text-muted-foreground">{values.join(' \u2013 ')}</output>
|
|
1631
|
+
</div>
|
|
1632
|
+
<Slider value={values} onValueChange={setValues} min={0} max={100} className="h-4" aria-labelledby={id}
|
|
1633
|
+
thumbLabels={range ? ['Lower value', 'Upper value'] : undefined} />
|
|
1634
|
+
</div>
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
<div className="flex w-full flex-wrap gap-6">{[[0, 0], [0, 25], [25, 50], [50, 75], [75, 100], [0, 50], [25, 75], [50, 100], [0, 75], [25, 100], [0, 100]].map(values => <SliderValueDemo key={values.join("-")} initialValues={values} />)}</div>`
|
|
757
1638
|
}
|
|
758
1639
|
]
|
|
759
1640
|
};
|
|
@@ -765,7 +1646,7 @@ const formFieldEntry = {
|
|
|
765
1646
|
{
|
|
766
1647
|
id: "default",
|
|
767
1648
|
title: "Label + description",
|
|
768
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1649
|
+
render: () => /* @__PURE__ */ jsx(FormFieldInputsDefaultSample, {}),
|
|
769
1650
|
code: `import { FormField } from '@open-mercato/ui/primitives/form-field'
|
|
770
1651
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
771
1652
|
|
|
@@ -776,7 +1657,7 @@ import { Input } from '@open-mercato/ui/primitives/input'
|
|
|
776
1657
|
{
|
|
777
1658
|
id: "required",
|
|
778
1659
|
title: "Required",
|
|
779
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1660
|
+
render: () => /* @__PURE__ */ jsx(FormFieldInputsRequiredSample, {}),
|
|
780
1661
|
code: `import { FormField } from '@open-mercato/ui/primitives/form-field'
|
|
781
1662
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
782
1663
|
|
|
@@ -787,7 +1668,7 @@ import { Input } from '@open-mercato/ui/primitives/input'
|
|
|
787
1668
|
{
|
|
788
1669
|
id: "error",
|
|
789
1670
|
title: "Error",
|
|
790
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1671
|
+
render: () => /* @__PURE__ */ jsx(FormFieldInputsErrorSample, {}),
|
|
791
1672
|
code: `import { FormField } from '@open-mercato/ui/primitives/form-field'
|
|
792
1673
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
793
1674
|
|
|
@@ -798,7 +1679,7 @@ import { Input } from '@open-mercato/ui/primitives/input'
|
|
|
798
1679
|
{
|
|
799
1680
|
id: "horizontal",
|
|
800
1681
|
title: "Horizontal",
|
|
801
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1682
|
+
render: () => /* @__PURE__ */ jsx(FormFieldInputsHorizontalSample, {}),
|
|
802
1683
|
code: `import { FormField } from '@open-mercato/ui/primitives/form-field'
|
|
803
1684
|
import { Switch } from '@open-mercato/ui/primitives/switch'
|
|
804
1685
|
|
|
@@ -830,6 +1711,19 @@ const [query, setQuery] = React.useState('')
|
|
|
830
1711
|
code: `import { SearchInput } from '@open-mercato/ui/primitives/search-input'
|
|
831
1712
|
|
|
832
1713
|
<SearchInput size="sm" value={query} onChange={setQuery} />`
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
id: "disabled",
|
|
1717
|
+
title: "Disabled (clear action hidden)",
|
|
1718
|
+
render: () => /* @__PURE__ */ jsx(DisabledSearchInputPreview, {}),
|
|
1719
|
+
code: `import { SearchInput } from '@open-mercato/ui/primitives/search-input'
|
|
1720
|
+
import { FormField } from '@open-mercato/ui/primitives/form-field'
|
|
1721
|
+
|
|
1722
|
+
const [query, setQuery] = React.useState('OM-2026-0042')
|
|
1723
|
+
|
|
1724
|
+
<FormField label="Search orders" disabled>
|
|
1725
|
+
<SearchInput value={query} onChange={setQuery} />
|
|
1726
|
+
</FormField>`
|
|
833
1727
|
}
|
|
834
1728
|
]
|
|
835
1729
|
};
|
|
@@ -864,6 +1758,105 @@ const emailInputEntry = {
|
|
|
864
1758
|
}
|
|
865
1759
|
]
|
|
866
1760
|
};
|
|
1761
|
+
function PasswordStrengthDemo({ initialValue = "", interactive = false }) {
|
|
1762
|
+
const t = useT();
|
|
1763
|
+
const [password, setPassword] = React.useState(initialValue);
|
|
1764
|
+
const requirements = [
|
|
1765
|
+
{ id: "uppercase", label: t("design_system.gallery.samples.passwordStrength.uppercase"), met: /[A-Z]/.test(password) },
|
|
1766
|
+
{ id: "number", label: t("design_system.gallery.samples.passwordStrength.number"), met: /[0-9]/.test(password) },
|
|
1767
|
+
{ id: "length", label: t("design_system.gallery.samples.passwordStrength.length"), met: password.length >= 8 }
|
|
1768
|
+
];
|
|
1769
|
+
const met = requirements.filter((requirement) => requirement.met).length;
|
|
1770
|
+
const strength = password.length === 0 ? "empty" : met === 3 ? "strong" : met === 2 ? "moderate" : "weak";
|
|
1771
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-75 max-w-full", children: [
|
|
1772
|
+
interactive ? /* @__PURE__ */ jsx(PasswordInput, { value: password, onChange: (event) => setPassword(event.target.value), "aria-label": t("design_system.gallery.samples.passwordStrength.password") }) : null,
|
|
1773
|
+
/* @__PURE__ */ jsx(PasswordStrength, { strength, requirements })
|
|
1774
|
+
] });
|
|
1775
|
+
}
|
|
1776
|
+
const passwordStrengthEntry = {
|
|
1777
|
+
id: "password-strength",
|
|
1778
|
+
title: "PasswordStrength",
|
|
1779
|
+
importPath: "@open-mercato/ui/primitives/password-strength",
|
|
1780
|
+
figmaNodeId: "327:8202",
|
|
1781
|
+
usage: {
|
|
1782
|
+
do: ["Supply the evaluated strength and requirements from the policy that owns the form.", "The interactive example demonstrates the three rules shown in Figma; the visual primitive does not define authentication policy."]
|
|
1783
|
+
},
|
|
1784
|
+
variants: [
|
|
1785
|
+
{
|
|
1786
|
+
id: "empty",
|
|
1787
|
+
title: "empty",
|
|
1788
|
+
render: () => /* @__PURE__ */ jsx(PasswordStrengthDemo, { initialValue: "" }),
|
|
1789
|
+
code: `import { PasswordStrength } from '@open-mercato/ui/primitives/password-strength'
|
|
1790
|
+
|
|
1791
|
+
|
|
1792
|
+
<PasswordStrength strength="empty" requirements={[
|
|
1793
|
+
{ id: 'uppercase', label: 'At least 1 uppercase', met: false },
|
|
1794
|
+
{ id: 'number', label: 'At least 1 number', met: false },
|
|
1795
|
+
{ id: 'length', label: 'At least 8 characters', met: false },
|
|
1796
|
+
]} />`
|
|
1797
|
+
},
|
|
1798
|
+
{
|
|
1799
|
+
id: "weak",
|
|
1800
|
+
title: "weak",
|
|
1801
|
+
render: () => /* @__PURE__ */ jsx(PasswordStrengthDemo, { initialValue: "A" }),
|
|
1802
|
+
code: `import { PasswordStrength } from '@open-mercato/ui/primitives/password-strength'
|
|
1803
|
+
|
|
1804
|
+
|
|
1805
|
+
<PasswordStrength strength="weak" requirements={[
|
|
1806
|
+
{ id: 'uppercase', label: 'At least 1 uppercase', met: true },
|
|
1807
|
+
{ id: 'number', label: 'At least 1 number', met: false },
|
|
1808
|
+
{ id: 'length', label: 'At least 8 characters', met: false },
|
|
1809
|
+
]} />`
|
|
1810
|
+
},
|
|
1811
|
+
{
|
|
1812
|
+
id: "moderate",
|
|
1813
|
+
title: "moderate",
|
|
1814
|
+
render: () => /* @__PURE__ */ jsx(PasswordStrengthDemo, { initialValue: "A1" }),
|
|
1815
|
+
code: `import { PasswordStrength } from '@open-mercato/ui/primitives/password-strength'
|
|
1816
|
+
|
|
1817
|
+
|
|
1818
|
+
<PasswordStrength strength="moderate" requirements={[
|
|
1819
|
+
{ id: 'uppercase', label: 'At least 1 uppercase', met: true },
|
|
1820
|
+
{ id: 'number', label: 'At least 1 number', met: true },
|
|
1821
|
+
{ id: 'length', label: 'At least 8 characters', met: false },
|
|
1822
|
+
]} />`
|
|
1823
|
+
},
|
|
1824
|
+
{
|
|
1825
|
+
id: "strong",
|
|
1826
|
+
title: "strong",
|
|
1827
|
+
render: () => /* @__PURE__ */ jsx(PasswordStrengthDemo, { initialValue: "A1234567" }),
|
|
1828
|
+
code: `import { PasswordStrength } from '@open-mercato/ui/primitives/password-strength'
|
|
1829
|
+
|
|
1830
|
+
|
|
1831
|
+
<PasswordStrength strength="strong" requirements={[
|
|
1832
|
+
{ id: 'uppercase', label: 'At least 1 uppercase', met: true },
|
|
1833
|
+
{ id: 'number', label: 'At least 1 number', met: true },
|
|
1834
|
+
{ id: 'length', label: 'At least 8 characters', met: true },
|
|
1835
|
+
]} />`
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
id: "interactive",
|
|
1839
|
+
title: "interactive",
|
|
1840
|
+
render: () => /* @__PURE__ */ jsx(PasswordStrengthDemo, { interactive: true }),
|
|
1841
|
+
code: `import { PasswordStrength } from '@open-mercato/ui/primitives/password-strength'
|
|
1842
|
+
import { PasswordInput } from '@open-mercato/ui/primitives/password-input'
|
|
1843
|
+
|
|
1844
|
+
const [password, setPassword] = React.useState('')
|
|
1845
|
+
const requirements = [
|
|
1846
|
+
{ id: 'uppercase', label: 'At least 1 uppercase', met: /[A-Z]/.test(password) },
|
|
1847
|
+
{ id: 'number', label: 'At least 1 number', met: /[0-9]/.test(password) },
|
|
1848
|
+
{ id: 'length', label: 'At least 8 characters', met: password.length >= 8 },
|
|
1849
|
+
]
|
|
1850
|
+
const met = requirements.filter(requirement => requirement.met).length
|
|
1851
|
+
const strength = password.length === 0 ? 'empty' : met === 3 ? 'strong' : met === 2 ? 'moderate' : 'weak'
|
|
1852
|
+
|
|
1853
|
+
<div className="w-75 max-w-full">
|
|
1854
|
+
<PasswordInput value={password} onChange={event => setPassword(event.target.value)} aria-label="Password" />
|
|
1855
|
+
<PasswordStrength strength={strength} requirements={requirements} />
|
|
1856
|
+
</div>`
|
|
1857
|
+
}
|
|
1858
|
+
]
|
|
1859
|
+
};
|
|
867
1860
|
const passwordInputEntry = {
|
|
868
1861
|
id: "password-input",
|
|
869
1862
|
title: "PasswordInput",
|
|
@@ -892,6 +1885,17 @@ const passwordInputEntry = {
|
|
|
892
1885
|
code: `import { PasswordInput } from '@open-mercato/ui/primitives/password-input'
|
|
893
1886
|
|
|
894
1887
|
<PasswordInput disabled />`
|
|
1888
|
+
},
|
|
1889
|
+
{
|
|
1890
|
+
id: "invalid",
|
|
1891
|
+
title: "Invalid (described error)",
|
|
1892
|
+
render: () => /* @__PURE__ */ jsx(InvalidPasswordInputPreview, {}),
|
|
1893
|
+
code: `import { PasswordInput } from '@open-mercato/ui/primitives/password-input'
|
|
1894
|
+
import { FormField } from '@open-mercato/ui/primitives/form-field'
|
|
1895
|
+
|
|
1896
|
+
<FormField label="Password" error="Use at least 12 characters.">
|
|
1897
|
+
<PasswordInput defaultValue="short" autoComplete="off" />
|
|
1898
|
+
</FormField>`
|
|
895
1899
|
}
|
|
896
1900
|
]
|
|
897
1901
|
};
|
|
@@ -948,6 +1952,19 @@ const [value, setValue] = React.useState<AmountValue>({ amount: '', currency: 'E
|
|
|
948
1952
|
code: `import { AmountInput } from '@open-mercato/ui/primitives/amount-input'
|
|
949
1953
|
|
|
950
1954
|
<AmountInput value={value} onChange={setValue} showCurrency={false} />`
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
id: "disabled",
|
|
1958
|
+
title: "Disabled (amount and currency)",
|
|
1959
|
+
render: () => /* @__PURE__ */ jsx(DisabledAmountInputPreview, {}),
|
|
1960
|
+
code: `import { AmountInput, type AmountValue } from '@open-mercato/ui/primitives/amount-input'
|
|
1961
|
+
import { FormField } from '@open-mercato/ui/primitives/form-field'
|
|
1962
|
+
|
|
1963
|
+
const [value, setValue] = React.useState<AmountValue>({ amount: '1250.00', currency: 'EUR' })
|
|
1964
|
+
|
|
1965
|
+
<FormField label="Order total" disabled>
|
|
1966
|
+
<AmountInput value={value} onChange={setValue} />
|
|
1967
|
+
</FormField>`
|
|
951
1968
|
}
|
|
952
1969
|
]
|
|
953
1970
|
};
|
|
@@ -992,10 +2009,10 @@ const digitInputEntry = {
|
|
|
992
2009
|
{
|
|
993
2010
|
id: "default",
|
|
994
2011
|
title: "default (6 cells)",
|
|
995
|
-
render: () => /* @__PURE__ */ jsx(
|
|
2012
|
+
render: () => /* @__PURE__ */ jsx(DigitInputInputsDefaultSample, {}),
|
|
996
2013
|
code: `import { DigitInput } from '@open-mercato/ui/primitives/digit-input'
|
|
997
2014
|
|
|
998
|
-
<DigitInput onComplete={(code) => verify(code)} />`
|
|
2015
|
+
<DigitInput className="w-full gap-1 sm:w-auto sm:gap-2" cellClassName="min-w-0 w-8 flex-1 sm:w-14 sm:flex-none" onComplete={(code) => verify(code)} />`
|
|
999
2016
|
},
|
|
1000
2017
|
{
|
|
1001
2018
|
id: "masked",
|
|
@@ -1008,10 +2025,7 @@ const digitInputEntry = {
|
|
|
1008
2025
|
{
|
|
1009
2026
|
id: "states",
|
|
1010
2027
|
title: "States",
|
|
1011
|
-
render: () => /* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */ jsx(DigitInput, { length: 4, value: "4921", "aria-invalid": true, "aria-label": "Invalid code" }),
|
|
1013
|
-
/* @__PURE__ */ jsx(DigitInput, { length: 4, disabled: true, "aria-label": "Disabled code" })
|
|
1014
|
-
] }),
|
|
2028
|
+
render: () => /* @__PURE__ */ jsx(DigitInputInputsStatesSample, {}),
|
|
1015
2029
|
code: `import { DigitInput } from '@open-mercato/ui/primitives/digit-input'
|
|
1016
2030
|
|
|
1017
2031
|
<DigitInput length={4} aria-invalid />
|
|
@@ -1052,15 +2066,7 @@ const buttonInputEntry = {
|
|
|
1052
2066
|
{
|
|
1053
2067
|
id: "copy-link",
|
|
1054
2068
|
title: "Copy link",
|
|
1055
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1056
|
-
ButtonInput,
|
|
1057
|
-
{
|
|
1058
|
-
readOnly: true,
|
|
1059
|
-
defaultValue: "https://app.example.com/i/8f2c",
|
|
1060
|
-
leftIcon: /* @__PURE__ */ jsx(Link2, {}),
|
|
1061
|
-
trailingAction: /* @__PURE__ */ jsx(IconButton, { variant: "ghost", "aria-label": "Copy link", children: /* @__PURE__ */ jsx(Copy, {}) })
|
|
1062
|
-
}
|
|
1063
|
-
) }),
|
|
2069
|
+
render: () => /* @__PURE__ */ jsx(ButtonInputInputsCopyLinkSample, {}),
|
|
1064
2070
|
code: `import { Copy, Link2 } from 'lucide-react'
|
|
1065
2071
|
import { ButtonInput } from '@open-mercato/ui/primitives/button-input'
|
|
1066
2072
|
import { IconButton } from '@open-mercato/ui/primitives/icon-button'
|
|
@@ -1077,13 +2083,7 @@ import { IconButton } from '@open-mercato/ui/primitives/icon-button'
|
|
|
1077
2083
|
{
|
|
1078
2084
|
id: "send",
|
|
1079
2085
|
title: "Send action",
|
|
1080
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1081
|
-
ButtonInput,
|
|
1082
|
-
{
|
|
1083
|
-
placeholder: "Invite by email",
|
|
1084
|
-
trailingAction: /* @__PURE__ */ jsx(IconButton, { variant: "ghost", "aria-label": "Send invite", children: /* @__PURE__ */ jsx(Send, {}) })
|
|
1085
|
-
}
|
|
1086
|
-
) }),
|
|
2086
|
+
render: () => /* @__PURE__ */ jsx(ButtonInputInputsSendSample, {}),
|
|
1087
2087
|
code: `import { Send } from 'lucide-react'
|
|
1088
2088
|
import { ButtonInput } from '@open-mercato/ui/primitives/button-input'
|
|
1089
2089
|
import { IconButton } from '@open-mercato/ui/primitives/icon-button'
|
|
@@ -1101,7 +2101,19 @@ const colorPickerEntry = {
|
|
|
1101
2101
|
id: "color-picker",
|
|
1102
2102
|
title: "ColorPicker",
|
|
1103
2103
|
importPath: "@open-mercato/ui/primitives/color-picker",
|
|
2104
|
+
figmaNodeId: "4415:53671",
|
|
1104
2105
|
variants: [
|
|
2106
|
+
{
|
|
2107
|
+
id: "opacity",
|
|
2108
|
+
title: "Opacity",
|
|
2109
|
+
render: () => /* @__PURE__ */ jsx(DemoColorPicker, { showOpacity: true }),
|
|
2110
|
+
code: `import { ColorPicker } from '@open-mercato/ui/primitives/color-picker'
|
|
2111
|
+
|
|
2112
|
+
const [color, setColor] = React.useState('#6366F1')
|
|
2113
|
+
const [opacity, setOpacity] = React.useState(75)
|
|
2114
|
+
|
|
2115
|
+
<ColorPicker value={color} onChange={setColor} showOpacity opacity={opacity} onOpacityChange={setOpacity} />`
|
|
2116
|
+
},
|
|
1105
2117
|
{
|
|
1106
2118
|
id: "default",
|
|
1107
2119
|
title: "default",
|
|
@@ -1141,7 +2153,7 @@ const tagInputEntry = {
|
|
|
1141
2153
|
{
|
|
1142
2154
|
id: "default",
|
|
1143
2155
|
title: "default",
|
|
1144
|
-
render: () => /* @__PURE__ */ jsx(
|
|
2156
|
+
render: () => /* @__PURE__ */ jsx(TagInputInputsDefaultSample, {}),
|
|
1145
2157
|
code: `import { TagInput } from '@open-mercato/ui/primitives/tag-input'
|
|
1146
2158
|
|
|
1147
2159
|
const [tags, setTags] = React.useState<string[]>(['wholesale', 'priority', 'eu'])
|
|
@@ -1151,7 +2163,7 @@ const [tags, setTags] = React.useState<string[]>(['wholesale', 'priority', 'eu']
|
|
|
1151
2163
|
{
|
|
1152
2164
|
id: "max-tags",
|
|
1153
2165
|
title: "Max tags reached",
|
|
1154
|
-
render: () => /* @__PURE__ */ jsx(
|
|
2166
|
+
render: () => /* @__PURE__ */ jsx(TagInputInputsMaxTagsSample, {}),
|
|
1155
2167
|
code: `import { TagInput } from '@open-mercato/ui/primitives/tag-input'
|
|
1156
2168
|
|
|
1157
2169
|
<TagInput value={tags} onChange={setTags} maxTags={3} />`
|
|
@@ -1160,33 +2172,478 @@ const [tags, setTags] = React.useState<string[]>(['wholesale', 'priority', 'eu']
|
|
|
1160
2172
|
};
|
|
1161
2173
|
const richEditorEntry = {
|
|
1162
2174
|
id: "rich-editor",
|
|
2175
|
+
figmaNodeId: "166926:17605",
|
|
1163
2176
|
title: "RichEditor",
|
|
1164
2177
|
importPath: "@open-mercato/ui/primitives/rich-editor",
|
|
2178
|
+
docsAnchor: "#richeditor",
|
|
2179
|
+
usage: { do: [
|
|
2180
|
+
"toolbarDesign opts into source layouts 01\u201304 with 28 px controls, 20 px icons and 6 px item radii. Existing full, standard, basic and minimal presets retain their defaults.",
|
|
2181
|
+
"Every source layout includes a working More menu. Hidden commands remain available in that menu when the toolbar narrows.",
|
|
2182
|
+
"The 12-color palette already includes the source Color11 (white) and Color12 (black). Color choice changes editable content; stored HTML still passes through the existing sanitizer.",
|
|
2183
|
+
"The character counter updates while typing. onChange retains its blur contract; consumers supply translated labels and their own comment and mention workflows."
|
|
2184
|
+
] },
|
|
2185
|
+
variants: [
|
|
2186
|
+
{ id: "minimal", title: "Preset / minimal", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { variant: "minimal" }), code: `import * as React from 'react'
|
|
2187
|
+
import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2188
|
+
|
|
2189
|
+
const [html, setHtml] = React.useState('<p>Editable text</p>')
|
|
2190
|
+
<RichEditor value={html} onChange={setHtml} variant="minimal" />` },
|
|
2191
|
+
{ id: "standard", title: "Preset / standard", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { variant: "standard" }), code: `import * as React from 'react'
|
|
2192
|
+
import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2193
|
+
|
|
2194
|
+
const [html, setHtml] = React.useState('<p>Editable text</p>')
|
|
2195
|
+
<RichEditor value={html} onChange={setHtml} variant="standard" />` },
|
|
2196
|
+
{ id: "basic", title: "Preset / basic", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { variant: "basic" }), code: `import * as React from 'react'
|
|
2197
|
+
import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2198
|
+
|
|
2199
|
+
const [html, setHtml] = React.useState('<p>Editable text</p>')
|
|
2200
|
+
<RichEditor value={html} onChange={setHtml} variant="basic" />` },
|
|
2201
|
+
{ id: "full", title: "Preset / full", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { variant: "full" }), code: `import * as React from 'react'
|
|
2202
|
+
import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2203
|
+
|
|
2204
|
+
const [html, setHtml] = React.useState('<p>Editable text</p>')
|
|
2205
|
+
<RichEditor value={html} onChange={setHtml} variant="full" />` },
|
|
2206
|
+
{ id: "source-01", title: "Source layout 01", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { toolbarDesign: "01" }), code: `import * as React from 'react'
|
|
2207
|
+
import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2208
|
+
|
|
2209
|
+
const [html, setHtml] = React.useState('<p>Editable text</p>')
|
|
2210
|
+
<RichEditor value={html} onChange={setHtml} toolbarDesign="01" />` },
|
|
2211
|
+
{ id: "source-02", title: "Source layout 02", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { toolbarDesign: "02" }), code: `import * as React from 'react'
|
|
2212
|
+
import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2213
|
+
|
|
2214
|
+
const [html, setHtml] = React.useState('<p>Editable text</p>')
|
|
2215
|
+
<RichEditor value={html} onChange={setHtml} toolbarDesign="02" />` },
|
|
2216
|
+
{ id: "source-03", title: "Source layout 03", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { toolbarDesign: "03" }), code: `import * as React from 'react'
|
|
2217
|
+
import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2218
|
+
|
|
2219
|
+
const [html, setHtml] = React.useState('<p>Editable text</p>')
|
|
2220
|
+
<RichEditor value={html} onChange={setHtml} toolbarDesign="03" />` },
|
|
2221
|
+
{ id: "source-04", title: "Source layout 04", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { toolbarDesign: "04" }), code: `import * as React from 'react'
|
|
2222
|
+
import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2223
|
+
|
|
2224
|
+
const [html, setHtml] = React.useState('<p>Editable text</p>')
|
|
2225
|
+
<RichEditor value={html} onChange={setHtml} toolbarDesign="04" />` },
|
|
2226
|
+
{ id: "disabled", title: "Source layout / disabled", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { toolbarDesign: "01", disabled: true }), code: `import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2227
|
+
|
|
2228
|
+
<RichEditor value={html} onChange={setHtml} toolbarDesign="01" disabled />` },
|
|
2229
|
+
{ id: "counter", title: "Live character counter", render: () => /* @__PURE__ */ jsx(DemoRichEditor, { toolbarDesign: "03", counter: true }), code: `import { RichEditor } from '@open-mercato/ui/primitives/rich-editor'
|
|
2230
|
+
|
|
2231
|
+
<RichEditor value={html} onChange={setHtml} toolbarDesign="03" maxLength={100} />` },
|
|
2232
|
+
{ id: "palette", title: "All twelve source colors", render: () => /* @__PURE__ */ jsx(DemoRichEditorPalette, {}), code: `import * as React from 'react'
|
|
2233
|
+
import { RichEditorColorPalette, type RichEditorColorKey } from '@open-mercato/ui/primitives/rich-editor'
|
|
2234
|
+
|
|
2235
|
+
const [color, setColor] = React.useState<RichEditorColorKey | null>('gray')
|
|
2236
|
+
<RichEditorColorPalette value={color} onChange={setColor} />` }
|
|
2237
|
+
]
|
|
2238
|
+
};
|
|
2239
|
+
const fileUploadAreaEntry = {
|
|
2240
|
+
id: "file-upload",
|
|
2241
|
+
title: "FileUploadArea",
|
|
2242
|
+
importPath: "@open-mercato/ui/primitives/file-upload",
|
|
2243
|
+
figmaNodeId: "450:9413",
|
|
2244
|
+
docsAnchor: "#fileuploadarea",
|
|
2245
|
+
usage: { do: ["Default and hover are live states of the same drop target. Select or drop files to exercise the local demo queue.", "Pass onFilesSelected and handle transfer separately. Demo progress is simulated locally; files never leave the browser.", "Keep custom accept/maxSizeBytes and the description consistent."] },
|
|
1165
2246
|
variants: [
|
|
1166
2247
|
{
|
|
1167
|
-
id: "
|
|
1168
|
-
title: "
|
|
1169
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1170
|
-
code: `import {
|
|
2248
|
+
id: "default",
|
|
2249
|
+
title: "default",
|
|
2250
|
+
render: () => /* @__PURE__ */ jsx(FileUploadAreaDemo, {}),
|
|
2251
|
+
code: `import { FileUploadArea } from '@open-mercato/ui/primitives/file-upload'
|
|
1171
2252
|
|
|
1172
|
-
|
|
2253
|
+
<FileUploadArea onFilesSelected={handleFiles} onFilesRejected={handleRejections} />`
|
|
2254
|
+
},
|
|
2255
|
+
{
|
|
2256
|
+
id: "drag-and-drop",
|
|
2257
|
+
title: "drag-and-drop",
|
|
2258
|
+
render: () => /* @__PURE__ */ jsx(FileUploadAreaDemo, {}),
|
|
2259
|
+
code: `import { FileUploadArea } from '@open-mercato/ui/primitives/file-upload'
|
|
1173
2260
|
|
|
1174
|
-
<
|
|
2261
|
+
<FileUploadArea onFilesSelected={handleFiles} onFilesRejected={handleRejections} />`
|
|
1175
2262
|
},
|
|
1176
2263
|
{
|
|
1177
|
-
id: "
|
|
1178
|
-
title: "
|
|
1179
|
-
render: () => /* @__PURE__ */ jsx(
|
|
1180
|
-
code: `import {
|
|
2264
|
+
id: "disabled",
|
|
2265
|
+
title: "disabled",
|
|
2266
|
+
render: () => /* @__PURE__ */ jsx(FileUploadAreaDemo, { disabled: true }),
|
|
2267
|
+
code: `import { FileUploadArea } from '@open-mercato/ui/primitives/file-upload'
|
|
1181
2268
|
|
|
1182
|
-
<
|
|
2269
|
+
<FileUploadArea disabled onFilesSelected={handleFiles} onFilesRejected={handleRejections} />`
|
|
1183
2270
|
}
|
|
1184
2271
|
]
|
|
1185
2272
|
};
|
|
2273
|
+
const fileUploadCardEntry = {
|
|
2274
|
+
id: "file-upload-card",
|
|
2275
|
+
title: "FileUploadCard",
|
|
2276
|
+
importPath: "@open-mercato/ui/primitives/file-upload-card",
|
|
2277
|
+
figmaNodeId: "451:409",
|
|
2278
|
+
docsAnchor: "#fileuploadcard",
|
|
2279
|
+
usage: { do: ["Cancel/remove and retry are real callbacks. The error example retries using local simulated progress.", "The caller owns transfer state, progress, and localized file-size text."] },
|
|
2280
|
+
variants: [
|
|
2281
|
+
{
|
|
2282
|
+
id: "uploading",
|
|
2283
|
+
title: "uploading",
|
|
2284
|
+
render: () => /* @__PURE__ */ jsx(FileUploadCardDemo, { initialStatus: "uploading" }),
|
|
2285
|
+
code: `import { FileUploadCard } from '@open-mercato/ui/primitives/file-upload-card'
|
|
2286
|
+
|
|
2287
|
+
<FileUploadCard fileName="my-cv.pdf" sizeLabel={sizeLabel} status="uploading" progress={progress} onRemove={removeFile} onRetry={retryFile} />`
|
|
2288
|
+
},
|
|
2289
|
+
{
|
|
2290
|
+
id: "success",
|
|
2291
|
+
title: "success",
|
|
2292
|
+
render: () => /* @__PURE__ */ jsx(FileUploadCardDemo, { initialStatus: "success" }),
|
|
2293
|
+
code: `import { FileUploadCard } from '@open-mercato/ui/primitives/file-upload-card'
|
|
2294
|
+
|
|
2295
|
+
<FileUploadCard fileName="my-cv.pdf" sizeLabel={sizeLabel} status="success" progress={progress} onRemove={removeFile} onRetry={retryFile} />`
|
|
2296
|
+
},
|
|
2297
|
+
{
|
|
2298
|
+
id: "error",
|
|
2299
|
+
title: "error",
|
|
2300
|
+
render: () => /* @__PURE__ */ jsx(FileUploadCardDemo, { initialStatus: "error" }),
|
|
2301
|
+
code: `import { FileUploadCard } from '@open-mercato/ui/primitives/file-upload-card'
|
|
2302
|
+
|
|
2303
|
+
<FileUploadCard fileName="my-cv.pdf" sizeLabel={sizeLabel} status="error" progress={progress} onRemove={removeFile} onRetry={retryFile} />`
|
|
2304
|
+
}
|
|
2305
|
+
]
|
|
2306
|
+
};
|
|
2307
|
+
const fileFormatIconEntry = {
|
|
2308
|
+
id: "file-format-icon",
|
|
2309
|
+
title: "FileFormatIcon",
|
|
2310
|
+
importPath: "@open-mercato/ui/primitives/file-format-icon",
|
|
2311
|
+
figmaNodeId: "450:17234",
|
|
2312
|
+
docsAnchor: "#fileformaticon",
|
|
2313
|
+
usage: { do: ["Both sizes and all nine category colors come from Figma. Teal is the source name of the light-blue category.", "The original Figma paper/fold artwork is bundled locally. Category-label foregrounds meet 4.5:1 contrast."] },
|
|
2314
|
+
variants: [
|
|
2315
|
+
{
|
|
2316
|
+
id: "red-default",
|
|
2317
|
+
title: "red / 40px",
|
|
2318
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "red", size: "default" }),
|
|
2319
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2320
|
+
|
|
2321
|
+
<FileFormatIcon format="PDF" tone="red" size="default" />`
|
|
2322
|
+
},
|
|
2323
|
+
{
|
|
2324
|
+
id: "orange-default",
|
|
2325
|
+
title: "orange / 40px",
|
|
2326
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "orange", size: "default" }),
|
|
2327
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2328
|
+
|
|
2329
|
+
<FileFormatIcon format="PDF" tone="orange" size="default" />`
|
|
2330
|
+
},
|
|
2331
|
+
{
|
|
2332
|
+
id: "yellow-default",
|
|
2333
|
+
title: "yellow / 40px",
|
|
2334
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "yellow", size: "default" }),
|
|
2335
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2336
|
+
|
|
2337
|
+
<FileFormatIcon format="PDF" tone="yellow" size="default" />`
|
|
2338
|
+
},
|
|
2339
|
+
{
|
|
2340
|
+
id: "green-default",
|
|
2341
|
+
title: "green / 40px",
|
|
2342
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "green", size: "default" }),
|
|
2343
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2344
|
+
|
|
2345
|
+
<FileFormatIcon format="PDF" tone="green" size="default" />`
|
|
2346
|
+
},
|
|
2347
|
+
{
|
|
2348
|
+
id: "teal-default",
|
|
2349
|
+
title: "teal / 40px",
|
|
2350
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "teal", size: "default" }),
|
|
2351
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2352
|
+
|
|
2353
|
+
<FileFormatIcon format="PDF" tone="teal" size="default" />`
|
|
2354
|
+
},
|
|
2355
|
+
{
|
|
2356
|
+
id: "blue-default",
|
|
2357
|
+
title: "blue / 40px",
|
|
2358
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "blue", size: "default" }),
|
|
2359
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2360
|
+
|
|
2361
|
+
<FileFormatIcon format="PDF" tone="blue" size="default" />`
|
|
2362
|
+
},
|
|
2363
|
+
{
|
|
2364
|
+
id: "purple-default",
|
|
2365
|
+
title: "purple / 40px",
|
|
2366
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "purple", size: "default" }),
|
|
2367
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2368
|
+
|
|
2369
|
+
<FileFormatIcon format="PDF" tone="purple" size="default" />`
|
|
2370
|
+
},
|
|
2371
|
+
{
|
|
2372
|
+
id: "pink-default",
|
|
2373
|
+
title: "pink / 40px",
|
|
2374
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "pink", size: "default" }),
|
|
2375
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2376
|
+
|
|
2377
|
+
<FileFormatIcon format="PDF" tone="pink" size="default" />`
|
|
2378
|
+
},
|
|
2379
|
+
{
|
|
2380
|
+
id: "gray-default",
|
|
2381
|
+
title: "gray / 40px",
|
|
2382
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "gray", size: "default" }),
|
|
2383
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2384
|
+
|
|
2385
|
+
<FileFormatIcon format="PDF" tone="gray" size="default" />`
|
|
2386
|
+
},
|
|
2387
|
+
{
|
|
2388
|
+
id: "red-sm",
|
|
2389
|
+
title: "red / 32px",
|
|
2390
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "red", size: "sm" }),
|
|
2391
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2392
|
+
|
|
2393
|
+
<FileFormatIcon format="PDF" tone="red" size="sm" />`
|
|
2394
|
+
},
|
|
2395
|
+
{
|
|
2396
|
+
id: "orange-sm",
|
|
2397
|
+
title: "orange / 32px",
|
|
2398
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "orange", size: "sm" }),
|
|
2399
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2400
|
+
|
|
2401
|
+
<FileFormatIcon format="PDF" tone="orange" size="sm" />`
|
|
2402
|
+
},
|
|
2403
|
+
{
|
|
2404
|
+
id: "yellow-sm",
|
|
2405
|
+
title: "yellow / 32px",
|
|
2406
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "yellow", size: "sm" }),
|
|
2407
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2408
|
+
|
|
2409
|
+
<FileFormatIcon format="PDF" tone="yellow" size="sm" />`
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
id: "green-sm",
|
|
2413
|
+
title: "green / 32px",
|
|
2414
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "green", size: "sm" }),
|
|
2415
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2416
|
+
|
|
2417
|
+
<FileFormatIcon format="PDF" tone="green" size="sm" />`
|
|
2418
|
+
},
|
|
2419
|
+
{
|
|
2420
|
+
id: "teal-sm",
|
|
2421
|
+
title: "teal / 32px",
|
|
2422
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "teal", size: "sm" }),
|
|
2423
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2424
|
+
|
|
2425
|
+
<FileFormatIcon format="PDF" tone="teal" size="sm" />`
|
|
2426
|
+
},
|
|
2427
|
+
{
|
|
2428
|
+
id: "blue-sm",
|
|
2429
|
+
title: "blue / 32px",
|
|
2430
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "blue", size: "sm" }),
|
|
2431
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2432
|
+
|
|
2433
|
+
<FileFormatIcon format="PDF" tone="blue" size="sm" />`
|
|
2434
|
+
},
|
|
2435
|
+
{
|
|
2436
|
+
id: "purple-sm",
|
|
2437
|
+
title: "purple / 32px",
|
|
2438
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "purple", size: "sm" }),
|
|
2439
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2440
|
+
|
|
2441
|
+
<FileFormatIcon format="PDF" tone="purple" size="sm" />`
|
|
2442
|
+
},
|
|
2443
|
+
{
|
|
2444
|
+
id: "pink-sm",
|
|
2445
|
+
title: "pink / 32px",
|
|
2446
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "pink", size: "sm" }),
|
|
2447
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2448
|
+
|
|
2449
|
+
<FileFormatIcon format="PDF" tone="pink" size="sm" />`
|
|
2450
|
+
},
|
|
2451
|
+
{
|
|
2452
|
+
id: "gray-sm",
|
|
2453
|
+
title: "gray / 32px",
|
|
2454
|
+
render: () => /* @__PURE__ */ jsx(FileFormatIcon, { format: "PDF", tone: "gray", size: "sm" }),
|
|
2455
|
+
code: `import { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'
|
|
2456
|
+
|
|
2457
|
+
<FileFormatIcon format="PDF" tone="gray" size="sm" />`
|
|
2458
|
+
}
|
|
2459
|
+
]
|
|
2460
|
+
};
|
|
2461
|
+
const imageUploadEntry = {
|
|
2462
|
+
id: "image-upload",
|
|
2463
|
+
title: "ImageUpload",
|
|
2464
|
+
importPath: "@open-mercato/ui/primitives/image-upload",
|
|
2465
|
+
figmaNodeId: "452:653",
|
|
2466
|
+
docsAnchor: "#imageupload",
|
|
2467
|
+
usage: { do: ["Figma calls the layout with text above actions Vertical; both source layouts place the avatar to the left.", "New selections must decode as PNG/JPEG and meet the configured minimum dimensions (400\xD7400 by default). The caller owns the preview URL and transfer.", "Existing uploaded illustrations are exact source fixtures. Change and Remove update only local browser state."] },
|
|
2468
|
+
variants: [
|
|
2469
|
+
{
|
|
2470
|
+
id: "avatar-vertical-empty",
|
|
2471
|
+
title: "avatar / vertical / empty",
|
|
2472
|
+
render: () => /* @__PURE__ */ jsx(ImageUploadDemo, { kind: "avatar", alignment: "vertical", uploaded: false }),
|
|
2473
|
+
code: `import { ImageUpload } from '@open-mercato/ui/primitives/image-upload'
|
|
2474
|
+
|
|
2475
|
+
<ImageUpload kind="avatar" alignment="vertical" src={previewUrl} alt={imageLabel} onChange={handleImageChange} />`
|
|
2476
|
+
},
|
|
2477
|
+
{
|
|
2478
|
+
id: "avatar-vertical-uploaded",
|
|
2479
|
+
title: "avatar / vertical / uploaded",
|
|
2480
|
+
render: () => /* @__PURE__ */ jsx(ImageUploadDemo, { kind: "avatar", alignment: "vertical", uploaded: true }),
|
|
2481
|
+
code: `import { ImageUpload } from '@open-mercato/ui/primitives/image-upload'
|
|
2482
|
+
|
|
2483
|
+
<ImageUpload kind="avatar" alignment="vertical" src={previewUrl} alt={imageLabel} onChange={handleImageChange} />`
|
|
2484
|
+
},
|
|
2485
|
+
{
|
|
2486
|
+
id: "avatar-horizontal-empty",
|
|
2487
|
+
title: "avatar / horizontal / empty",
|
|
2488
|
+
render: () => /* @__PURE__ */ jsx(ImageUploadDemo, { kind: "avatar", alignment: "horizontal", uploaded: false }),
|
|
2489
|
+
code: `import { ImageUpload } from '@open-mercato/ui/primitives/image-upload'
|
|
2490
|
+
|
|
2491
|
+
<ImageUpload kind="avatar" alignment="horizontal" src={previewUrl} alt={imageLabel} onChange={handleImageChange} />`
|
|
2492
|
+
},
|
|
2493
|
+
{
|
|
2494
|
+
id: "avatar-horizontal-uploaded",
|
|
2495
|
+
title: "avatar / horizontal / uploaded",
|
|
2496
|
+
render: () => /* @__PURE__ */ jsx(ImageUploadDemo, { kind: "avatar", alignment: "horizontal", uploaded: true }),
|
|
2497
|
+
code: `import { ImageUpload } from '@open-mercato/ui/primitives/image-upload'
|
|
2498
|
+
|
|
2499
|
+
<ImageUpload kind="avatar" alignment="horizontal" src={previewUrl} alt={imageLabel} onChange={handleImageChange} />`
|
|
2500
|
+
},
|
|
2501
|
+
{
|
|
2502
|
+
id: "company-vertical-empty",
|
|
2503
|
+
title: "company / vertical / empty",
|
|
2504
|
+
render: () => /* @__PURE__ */ jsx(ImageUploadDemo, { kind: "company", alignment: "vertical", uploaded: false }),
|
|
2505
|
+
code: `import { ImageUpload } from '@open-mercato/ui/primitives/image-upload'
|
|
2506
|
+
|
|
2507
|
+
<ImageUpload kind="company" alignment="vertical" src={previewUrl} alt={imageLabel} onChange={handleImageChange} />`
|
|
2508
|
+
},
|
|
2509
|
+
{
|
|
2510
|
+
id: "company-vertical-uploaded",
|
|
2511
|
+
title: "company / vertical / uploaded",
|
|
2512
|
+
render: () => /* @__PURE__ */ jsx(ImageUploadDemo, { kind: "company", alignment: "vertical", uploaded: true }),
|
|
2513
|
+
code: `import { ImageUpload } from '@open-mercato/ui/primitives/image-upload'
|
|
2514
|
+
|
|
2515
|
+
<ImageUpload kind="company" alignment="vertical" src={previewUrl} alt={imageLabel} onChange={handleImageChange} />`
|
|
2516
|
+
},
|
|
2517
|
+
{
|
|
2518
|
+
id: "company-horizontal-empty",
|
|
2519
|
+
title: "company / horizontal / empty",
|
|
2520
|
+
render: () => /* @__PURE__ */ jsx(ImageUploadDemo, { kind: "company", alignment: "horizontal", uploaded: false }),
|
|
2521
|
+
code: `import { ImageUpload } from '@open-mercato/ui/primitives/image-upload'
|
|
2522
|
+
|
|
2523
|
+
<ImageUpload kind="company" alignment="horizontal" src={previewUrl} alt={imageLabel} onChange={handleImageChange} />`
|
|
2524
|
+
},
|
|
2525
|
+
{
|
|
2526
|
+
id: "company-horizontal-uploaded",
|
|
2527
|
+
title: "company / horizontal / uploaded",
|
|
2528
|
+
render: () => /* @__PURE__ */ jsx(ImageUploadDemo, { kind: "company", alignment: "horizontal", uploaded: true }),
|
|
2529
|
+
code: `import { ImageUpload } from '@open-mercato/ui/primitives/image-upload'
|
|
2530
|
+
|
|
2531
|
+
<ImageUpload kind="company" alignment="horizontal" src={previewUrl} alt={imageLabel} onChange={handleImageChange} />`
|
|
2532
|
+
},
|
|
2533
|
+
{
|
|
2534
|
+
id: "disabled",
|
|
2535
|
+
title: "disabled",
|
|
2536
|
+
render: () => /* @__PURE__ */ jsx(ImageUploadDemo, { kind: "avatar", alignment: "vertical", uploaded: true, disabled: true }),
|
|
2537
|
+
code: `import { ImageUpload } from '@open-mercato/ui/primitives/image-upload'
|
|
2538
|
+
|
|
2539
|
+
<ImageUpload disabled src={previewUrl} onChange={handleImageChange} />`
|
|
2540
|
+
}
|
|
2541
|
+
]
|
|
2542
|
+
};
|
|
2543
|
+
const labelEntry = {
|
|
2544
|
+
id: "label",
|
|
2545
|
+
title: "FieldLabel",
|
|
2546
|
+
importPath: "@open-mercato/ui/primitives/label",
|
|
2547
|
+
figmaNodeId: "266:2814",
|
|
2548
|
+
descriptionKey: "design_system.entries.label.description",
|
|
2549
|
+
variants: [
|
|
2550
|
+
{ id: "normal", title: "normal", render: () => /* @__PURE__ */ jsx(FieldLabelExample, {}), code: fieldLabelCode(' sublabel="(optional)"') },
|
|
2551
|
+
{ id: "disabled", title: "disabled", render: () => /* @__PURE__ */ jsx(FieldLabelExample, { disabled: true }), code: fieldLabelCode(" disabled") },
|
|
2552
|
+
{ id: "required", title: "required", render: () => /* @__PURE__ */ jsx(FieldLabelExample, { kind: "required" }), code: fieldLabelCode(" required") },
|
|
2553
|
+
{ id: "optional", title: "optional", render: () => /* @__PURE__ */ jsx(FieldLabelExample, { kind: "optional" }), code: fieldLabelCode(' sublabel="(optional)"') },
|
|
2554
|
+
{ id: "information", title: "information", render: () => /* @__PURE__ */ jsx(FieldLabelExample, { kind: "information" }), code: fieldLabelInformationCode },
|
|
2555
|
+
{ id: "action", title: "action", render: () => /* @__PURE__ */ jsx(FieldLabelExample, { kind: "action" }), code: fieldLabelActionCode },
|
|
2556
|
+
{ id: "form-field", title: "form-field", render: () => /* @__PURE__ */ jsx(FormFieldLabelExample, {}), code: formFieldLabelCode }
|
|
2557
|
+
]
|
|
2558
|
+
};
|
|
2559
|
+
const hint_textEntry = {
|
|
2560
|
+
id: "hint-text",
|
|
2561
|
+
title: "HintText",
|
|
2562
|
+
importPath: "@open-mercato/ui/primitives/hint-text",
|
|
2563
|
+
figmaNodeId: "266:5284",
|
|
2564
|
+
descriptionKey: "design_system.entries.hint-text.description",
|
|
2565
|
+
variants: [
|
|
2566
|
+
{ id: "default", title: "default", render: () => /* @__PURE__ */ jsx(HintTextExample, {}), code: hintTextCode() },
|
|
2567
|
+
{ id: "error", title: "error", render: () => /* @__PURE__ */ jsx(HintTextExample, { state: "error" }), code: hintTextCode({ state: "error" }) },
|
|
2568
|
+
{ id: "disabled", title: "disabled", render: () => /* @__PURE__ */ jsx(HintTextExample, { state: "disabled" }), code: hintTextCode({ state: "disabled" }) },
|
|
2569
|
+
{ id: "text-only", title: "text-only", render: () => /* @__PURE__ */ jsx(HintTextExample, { icon: false }), code: hintTextCode({ icon: false }) }
|
|
2570
|
+
]
|
|
2571
|
+
};
|
|
2572
|
+
const marketingControlsEntry = {
|
|
2573
|
+
id: "marketing-controls",
|
|
2574
|
+
title: "Marketing Controls",
|
|
2575
|
+
importPath: "@open-mercato/ui/primitives/input",
|
|
2576
|
+
figmaNodeId: "6696:81119",
|
|
2577
|
+
variants: [
|
|
2578
|
+
{ id: "product-image-1", title: "product-image-1", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 0 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={0} />') },
|
|
2579
|
+
{ id: "product-image-2", title: "product-image-2", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 1 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={1} />') },
|
|
2580
|
+
{ id: "product-image-3", title: "product-image-3", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 2 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={2} />') },
|
|
2581
|
+
{ id: "product-image-4", title: "product-image-4", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 3 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={3} />') },
|
|
2582
|
+
{ id: "product-image-5", title: "product-image-5", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 4 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={4} />') },
|
|
2583
|
+
{ id: "product-image-6", title: "product-image-6", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 5 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={5} />') },
|
|
2584
|
+
{ id: "product-image-7", title: "product-image-7", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 6 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={6} />') },
|
|
2585
|
+
{ id: "product-image-8", title: "product-image-8", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 7 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={7} />') },
|
|
2586
|
+
{ id: "product-image-9", title: "product-image-9", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 8 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={8} />') },
|
|
2587
|
+
{ id: "product-image-10", title: "product-image-10", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "product-image", product: 9 }), code: marketingControlExampleCode('<MarketingControlDemo kind="product-image" product={9} />') },
|
|
2588
|
+
{ id: "step-item-default", title: "step-item-default", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "step-item", state: "default" }), code: marketingControlExampleCode('<MarketingControlDemo kind="step-item" state="default" />') },
|
|
2589
|
+
{ id: "step-item-active", title: "step-item-active", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "step-item", state: "active" }), code: marketingControlExampleCode('<MarketingControlDemo kind="step-item" state="active" />') },
|
|
2590
|
+
{ id: "step-item-complete", title: "step-item-complete", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "step-item", state: "complete" }), code: marketingControlExampleCode('<MarketingControlDemo kind="step-item" state="complete" />') },
|
|
2591
|
+
{ id: "select-default", title: "select-default", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "select", state: "default" }), code: marketingControlExampleCode('<MarketingControlDemo kind="select" state="default" />') },
|
|
2592
|
+
{ id: "select-hover", title: "select-hover", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "select", state: "hover" }), code: marketingControlExampleCode('<MarketingControlDemo kind="select" state="hover" />') },
|
|
2593
|
+
{ id: "select-active", title: "select-active", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "select", state: "active" }), code: marketingControlExampleCode('<MarketingControlDemo kind="select" state="active" />') },
|
|
2594
|
+
{ id: "select-filled", title: "select-filled", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "select", state: "filled" }), code: marketingControlExampleCode('<MarketingControlDemo kind="select" state="filled" />') },
|
|
2595
|
+
{ id: "input-default-medium", title: "input-default-medium", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "input", state: "default", size: "medium" }), code: marketingControlExampleCode('<MarketingControlDemo kind="input" state="default" size="medium" />') },
|
|
2596
|
+
{ id: "input-hover-medium", title: "input-hover-medium", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "input", state: "hover", size: "medium" }), code: marketingControlExampleCode('<MarketingControlDemo kind="input" state="hover" size="medium" />') },
|
|
2597
|
+
{ id: "input-active-medium", title: "input-active-medium", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "input", state: "active", size: "medium" }), code: marketingControlExampleCode('<MarketingControlDemo kind="input" state="active" size="medium" />') },
|
|
2598
|
+
{ id: "input-filled-medium", title: "input-filled-medium", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "input", state: "filled", size: "medium" }), code: marketingControlExampleCode('<MarketingControlDemo kind="input" state="filled" size="medium" />') },
|
|
2599
|
+
{ id: "input-default-large", title: "input-default-large", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "input", state: "default", size: "large" }), code: marketingControlExampleCode('<MarketingControlDemo kind="input" state="default" size="large" />') },
|
|
2600
|
+
{ id: "input-hover-large", title: "input-hover-large", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "input", state: "hover", size: "large" }), code: marketingControlExampleCode('<MarketingControlDemo kind="input" state="hover" size="large" />') },
|
|
2601
|
+
{ id: "input-active-large", title: "input-active-large", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "input", state: "active", size: "large" }), code: marketingControlExampleCode('<MarketingControlDemo kind="input" state="active" size="large" />') },
|
|
2602
|
+
{ id: "input-filled-large", title: "input-filled-large", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "input", state: "filled", size: "large" }), code: marketingControlExampleCode('<MarketingControlDemo kind="input" state="filled" size="large" />') },
|
|
2603
|
+
{ id: "textarea-default", title: "textarea-default", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "textarea", state: "default" }), code: marketingControlExampleCode('<MarketingControlDemo kind="textarea" state="default" />') },
|
|
2604
|
+
{ id: "textarea-hover", title: "textarea-hover", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "textarea", state: "hover" }), code: marketingControlExampleCode('<MarketingControlDemo kind="textarea" state="hover" />') },
|
|
2605
|
+
{ id: "textarea-active", title: "textarea-active", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "textarea", state: "active" }), code: marketingControlExampleCode('<MarketingControlDemo kind="textarea" state="active" />') },
|
|
2606
|
+
{ id: "textarea-filled", title: "textarea-filled", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "textarea", state: "filled" }), code: marketingControlExampleCode('<MarketingControlDemo kind="textarea" state="filled" />') },
|
|
2607
|
+
{ id: "amount-default", title: "amount-default", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "amount", state: "default" }), code: marketingControlExampleCode('<MarketingControlDemo kind="amount" state="default" />') },
|
|
2608
|
+
{ id: "amount-hover", title: "amount-hover", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "amount", state: "hover" }), code: marketingControlExampleCode('<MarketingControlDemo kind="amount" state="hover" />') },
|
|
2609
|
+
{ id: "amount-active", title: "amount-active", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "amount", state: "active" }), code: marketingControlExampleCode('<MarketingControlDemo kind="amount" state="active" />') },
|
|
2610
|
+
{ id: "amount-filled", title: "amount-filled", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "amount", state: "filled" }), code: marketingControlExampleCode('<MarketingControlDemo kind="amount" state="filled" />') },
|
|
2611
|
+
{ id: "tab-menu-default", title: "tab-menu-default", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "tab-menu", state: "default" }), code: marketingControlExampleCode('<MarketingControlDemo kind="tab-menu" state="default" />') },
|
|
2612
|
+
{ id: "tab-menu-hover", title: "tab-menu-hover", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "tab-menu", state: "hover" }), code: marketingControlExampleCode('<MarketingControlDemo kind="tab-menu" state="hover" />') },
|
|
2613
|
+
{ id: "tab-menu-active", title: "tab-menu-active", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "tab-menu", state: "active" }), code: marketingControlExampleCode('<MarketingControlDemo kind="tab-menu" state="active" />') },
|
|
2614
|
+
{ id: "inline-input-placeholder", title: "inline-input-placeholder", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-input", state: "placeholder" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-input" state="placeholder" />') },
|
|
2615
|
+
{ id: "inline-input-hover", title: "inline-input-hover", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-input", state: "hover" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-input" state="hover" />') },
|
|
2616
|
+
{ id: "inline-input-focus", title: "inline-input-focus", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-input", state: "focus" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-input" state="focus" />') },
|
|
2617
|
+
{ id: "inline-input-filled", title: "inline-input-filled", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-input", state: "filled" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-input" state="filled" />') },
|
|
2618
|
+
{ id: "inline-input-disabled", title: "inline-input-disabled", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-input", state: "disabled" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-input" state="disabled" />') },
|
|
2619
|
+
{ id: "inline-select-placeholder", title: "inline-select-placeholder", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-select", state: "placeholder" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-select" state="placeholder" />') },
|
|
2620
|
+
{ id: "inline-select-hover", title: "inline-select-hover", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-select", state: "hover" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-select" state="hover" />') },
|
|
2621
|
+
{ id: "inline-select-focus", title: "inline-select-focus", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-select", state: "focus" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-select" state="focus" />') },
|
|
2622
|
+
{ id: "inline-select-filled", title: "inline-select-filled", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-select", state: "filled" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-select" state="filled" />') },
|
|
2623
|
+
{ id: "inline-select-disabled", title: "inline-select-disabled", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "inline-select", state: "disabled" }), code: marketingControlExampleCode('<MarketingControlDemo kind="inline-select" state="disabled" />') },
|
|
2624
|
+
{ id: "chart-tooltip-right", title: "chart-tooltip-right", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "chart-tooltip", side: "right" }), code: marketingControlExampleCode('<MarketingControlDemo kind="chart-tooltip" side="right" />') },
|
|
2625
|
+
{ id: "chart-tooltip-left", title: "chart-tooltip-left", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "chart-tooltip", side: "left" }), code: marketingControlExampleCode('<MarketingControlDemo kind="chart-tooltip" side="left" />') },
|
|
2626
|
+
{ id: "chart-tooltip-bottom", title: "chart-tooltip-bottom", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "chart-tooltip", side: "bottom" }), code: marketingControlExampleCode('<MarketingControlDemo kind="chart-tooltip" side="bottom" />') },
|
|
2627
|
+
{ id: "chart-tooltip-top", title: "chart-tooltip-top", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "chart-tooltip", side: "top" }), code: marketingControlExampleCode('<MarketingControlDemo kind="chart-tooltip" side="top" />') },
|
|
2628
|
+
{ id: "selected-button-default", title: "selected-button-default", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "selected-button", state: "default" }), code: marketingControlExampleCode('<MarketingControlDemo kind="selected-button" state="default" />') },
|
|
2629
|
+
{ id: "selected-button-hover", title: "selected-button-hover", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "selected-button", state: "hover" }), code: marketingControlExampleCode('<MarketingControlDemo kind="selected-button" state="hover" />') },
|
|
2630
|
+
{ id: "selected-button-selected", title: "selected-button-selected", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "selected-button", state: "selected" }), code: marketingControlExampleCode('<MarketingControlDemo kind="selected-button" state="selected" />') },
|
|
2631
|
+
{ id: "selected-button-disabled", title: "selected-button-disabled", render: () => /* @__PURE__ */ jsx(MarketingControlDemo, { kind: "selected-button", state: "disabled" }), code: marketingControlExampleCode('<MarketingControlDemo kind="selected-button" state="disabled" />') }
|
|
2632
|
+
]
|
|
2633
|
+
};
|
|
1186
2634
|
const entries = [
|
|
2635
|
+
marketingControlsEntry,
|
|
2636
|
+
labelEntry,
|
|
2637
|
+
hint_textEntry,
|
|
2638
|
+
fileUploadAreaEntry,
|
|
2639
|
+
fileUploadCardEntry,
|
|
2640
|
+
fileFormatIconEntry,
|
|
2641
|
+
imageUploadEntry,
|
|
1187
2642
|
inputEntry,
|
|
1188
2643
|
textareaEntry,
|
|
2644
|
+
phoneNumberEntry,
|
|
1189
2645
|
selectEntry,
|
|
2646
|
+
dropdownEntry,
|
|
1190
2647
|
compactSelectEntry,
|
|
1191
2648
|
inlineSelectEntry,
|
|
1192
2649
|
inlineInputEntry,
|
|
@@ -1201,6 +2658,7 @@ const entries = [
|
|
|
1201
2658
|
searchInputEntry,
|
|
1202
2659
|
emailInputEntry,
|
|
1203
2660
|
passwordInputEntry,
|
|
2661
|
+
passwordStrengthEntry,
|
|
1204
2662
|
websiteInputEntry,
|
|
1205
2663
|
amountInputEntry,
|
|
1206
2664
|
counterInputEntry,
|
|
@@ -1211,6 +2669,285 @@ const entries = [
|
|
|
1211
2669
|
tagInputEntry,
|
|
1212
2670
|
richEditorEntry
|
|
1213
2671
|
];
|
|
2672
|
+
function InputInputsDefaultSample() {
|
|
2673
|
+
const t = useT();
|
|
2674
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(Input, { placeholder: t("design_system.gallery.samples.marketing.productName") }) });
|
|
2675
|
+
}
|
|
2676
|
+
function InputInputsIconSlotsSample() {
|
|
2677
|
+
const t = useT();
|
|
2678
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2679
|
+
/* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsx(Input, { leftIcon: /* @__PURE__ */ jsx(User, {}), placeholder: t("design_system.gallery.sampleCopy.assignee") }) }),
|
|
2680
|
+
/* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsx(Input, { rightIcon: /* @__PURE__ */ jsx(Info, {}), placeholder: "SKU" }) })
|
|
2681
|
+
] });
|
|
2682
|
+
}
|
|
2683
|
+
function InputInputsSizesSample() {
|
|
2684
|
+
const t = useT();
|
|
2685
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2686
|
+
/* @__PURE__ */ jsx("div", { className: "w-44", children: /* @__PURE__ */ jsx(Input, { size: "lg", placeholder: t("design_system.gallery.sampleCopy.large") }) }),
|
|
2687
|
+
/* @__PURE__ */ jsx("div", { className: "w-44", children: /* @__PURE__ */ jsx(Input, { size: "default", placeholder: t("design_system.gallery.examples.aiProduct.default") }) }),
|
|
2688
|
+
/* @__PURE__ */ jsx("div", { className: "w-44", children: /* @__PURE__ */ jsx(Input, { size: "sm", placeholder: t("design_system.gallery.sampleCopy.small") }) })
|
|
2689
|
+
] });
|
|
2690
|
+
}
|
|
2691
|
+
function InputInputsStatesSample() {
|
|
2692
|
+
const t = useT();
|
|
2693
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2694
|
+
/* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsx(Input, { "aria-invalid": true, defaultValue: "not-a-number" }) }),
|
|
2695
|
+
/* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsx(Input, { disabled: true, placeholder: t("design_system.gallery.examples.keyComponents.disabled") }) })
|
|
2696
|
+
] });
|
|
2697
|
+
}
|
|
2698
|
+
function TextareaInputsDefaultSample() {
|
|
2699
|
+
const t = useT();
|
|
2700
|
+
return /* @__PURE__ */ jsx("div", { className: "w-80", children: /* @__PURE__ */ jsx(Textarea, { placeholder: t("design_system.gallery.sampleCopy.internalNoteForTheFulfillmentTeam") }) });
|
|
2701
|
+
}
|
|
2702
|
+
function TextareaInputsStatesSample() {
|
|
2703
|
+
const t = useT();
|
|
2704
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2705
|
+
/* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(Textarea, { "aria-invalid": true, defaultValue: t("design_system.gallery.sampleCopy.tooShort") }) }),
|
|
2706
|
+
/* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(Textarea, { disabled: true, placeholder: t("design_system.gallery.examples.keyComponents.disabled") }) })
|
|
2707
|
+
] });
|
|
2708
|
+
}
|
|
2709
|
+
function CompactSelectInputsTriggerLabelSample() {
|
|
2710
|
+
const t = useT();
|
|
2711
|
+
return /* @__PURE__ */ jsx("div", { className: "w-44", children: /* @__PURE__ */ jsxs(Select, { defaultValue: "newest", children: [
|
|
2712
|
+
/* @__PURE__ */ jsx(CompactSelectTrigger, { triggerLabel: "Sort:", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
2713
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
2714
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "newest", children: t("design_system.gallery.sampleCopy.newest") }),
|
|
2715
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "oldest", children: t("design_system.gallery.sampleCopy.oldest") }),
|
|
2716
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "value", children: t("design_system.gallery.sampleCopy.highestValue") })
|
|
2717
|
+
] })
|
|
2718
|
+
] }) });
|
|
2719
|
+
}
|
|
2720
|
+
function CompactSelectInputsPlainSample() {
|
|
2721
|
+
const t = useT();
|
|
2722
|
+
return /* @__PURE__ */ jsx("div", { className: "w-36", children: /* @__PURE__ */ jsxs(Select, { defaultValue: "table", children: [
|
|
2723
|
+
/* @__PURE__ */ jsx(CompactSelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
2724
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
2725
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "table", children: t("design_system.gallery.samples.richEditor.labels.table") }),
|
|
2726
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "board", children: t("design_system.gallery.sampleCopy.board") })
|
|
2727
|
+
] })
|
|
2728
|
+
] }) });
|
|
2729
|
+
}
|
|
2730
|
+
function InlineSelectInputsDefaultSample() {
|
|
2731
|
+
const t = useT();
|
|
2732
|
+
return /* @__PURE__ */ jsx("div", { className: "w-40", children: /* @__PURE__ */ jsxs(Select, { defaultValue: "high", children: [
|
|
2733
|
+
/* @__PURE__ */ jsx(InlineSelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
2734
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
2735
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "low", children: t("design_system.gallery.samples.finance.low") }),
|
|
2736
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "medium", children: t("design_system.gallery.examples.aiProduct.medium") }),
|
|
2737
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "high", children: t("design_system.gallery.samples.finance.high") })
|
|
2738
|
+
] })
|
|
2739
|
+
] }) });
|
|
2740
|
+
}
|
|
2741
|
+
function InlineSelectInputsInvisibleSample() {
|
|
2742
|
+
const t = useT();
|
|
2743
|
+
return /* @__PURE__ */ jsx("div", { className: "w-40", children: /* @__PURE__ */ jsxs(Select, { defaultValue: "draft", children: [
|
|
2744
|
+
/* @__PURE__ */ jsx(InlineSelectTrigger, { showBorderOnHover: false, children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
2745
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
2746
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "draft", children: t("design_system.gallery.sampleCopy.draft") }),
|
|
2747
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "published", children: t("design_system.gallery.sampleCopy.published") })
|
|
2748
|
+
] })
|
|
2749
|
+
] }) });
|
|
2750
|
+
}
|
|
2751
|
+
function InlineInputInputsDefaultSample() {
|
|
2752
|
+
const t = useT();
|
|
2753
|
+
return /* @__PURE__ */ jsx("div", { className: "w-56", children: /* @__PURE__ */ jsx(InlineInput, { defaultValue: t("design_system.gallery.sampleCopy.auroraDeskLamp"), "aria-label": t("design_system.gallery.samples.marketing.productName") }) });
|
|
2754
|
+
}
|
|
2755
|
+
function CheckboxInputsStatesSample() {
|
|
2756
|
+
const t = useT();
|
|
2757
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2758
|
+
/* @__PURE__ */ jsx(Checkbox, { "aria-label": t("design_system.gallery.sampleCopy.unchecked") }),
|
|
2759
|
+
/* @__PURE__ */ jsx(Checkbox, { defaultChecked: true, "aria-label": t("design_system.gallery.sampleCopy.checked") }),
|
|
2760
|
+
/* @__PURE__ */ jsx(Checkbox, { checked: "indeterminate", "aria-label": t("design_system.gallery.sampleCopy.indeterminate") })
|
|
2761
|
+
] });
|
|
2762
|
+
}
|
|
2763
|
+
function CheckboxInputsSizesSample() {
|
|
2764
|
+
const t = useT();
|
|
2765
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2766
|
+
/* @__PURE__ */ jsx(Checkbox, { size: "sm", defaultChecked: true, "aria-label": t("design_system.gallery.sampleCopy.small") }),
|
|
2767
|
+
/* @__PURE__ */ jsx(Checkbox, { size: "md", defaultChecked: true, "aria-label": t("design_system.gallery.examples.aiProduct.medium") })
|
|
2768
|
+
] });
|
|
2769
|
+
}
|
|
2770
|
+
function CheckboxInputsDisabledSample() {
|
|
2771
|
+
const t = useT();
|
|
2772
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2773
|
+
/* @__PURE__ */ jsx(Checkbox, { disabled: true, "aria-label": t("design_system.gallery.examples.keyComponents.disabled") }),
|
|
2774
|
+
/* @__PURE__ */ jsx(Checkbox, { disabled: true, defaultChecked: true, "aria-label": t("design_system.gallery.sampleCopy.disabledChecked") })
|
|
2775
|
+
] });
|
|
2776
|
+
}
|
|
2777
|
+
function CheckboxFieldInputsDefaultSample() {
|
|
2778
|
+
const t = useT();
|
|
2779
|
+
return /* @__PURE__ */ jsx(CheckboxField, { label: t("design_system.gallery.sampleCopy.emailNotifications"), defaultChecked: true });
|
|
2780
|
+
}
|
|
2781
|
+
function CheckboxFieldInputsWithDescriptionSample() {
|
|
2782
|
+
const t = useT();
|
|
2783
|
+
return /* @__PURE__ */ jsx("div", { className: "w-80", children: /* @__PURE__ */ jsx(
|
|
2784
|
+
CheckboxField,
|
|
2785
|
+
{
|
|
2786
|
+
label: t("design_system.gallery.sampleCopy.autoarchive"),
|
|
2787
|
+
sublabel: "(recommended)",
|
|
2788
|
+
description: t("design_system.gallery.sampleCopy.closedConversationsMoveToTheArchiveAfter30Days")
|
|
2789
|
+
}
|
|
2790
|
+
) });
|
|
2791
|
+
}
|
|
2792
|
+
function CheckboxFieldInputsFlipSample() {
|
|
2793
|
+
const t = useT();
|
|
2794
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(CheckboxField, { flip: true, label: t("design_system.gallery.sampleCopy.includeShippingCosts"), defaultChecked: true }) });
|
|
2795
|
+
}
|
|
2796
|
+
function RadioInputsGroupSample() {
|
|
2797
|
+
const t = useT();
|
|
2798
|
+
return /* @__PURE__ */ jsxs(RadioGroup, { defaultValue: "card", className: "flex-row gap-3", "aria-label": t("design_system.gallery.samples.menu.kind.provider"), children: [
|
|
2799
|
+
/* @__PURE__ */ jsx(Radio, { value: "card", "aria-label": t("design_system.gallery.sampleCopy.card") }),
|
|
2800
|
+
/* @__PURE__ */ jsx(Radio, { value: "transfer", "aria-label": t("design_system.gallery.sampleCopy.bankTransfer") }),
|
|
2801
|
+
/* @__PURE__ */ jsx(Radio, { value: "cash", "aria-label": t("design_system.gallery.sampleCopy.cash") })
|
|
2802
|
+
] });
|
|
2803
|
+
}
|
|
2804
|
+
function RadioInputsDisabledSample() {
|
|
2805
|
+
const t = useT();
|
|
2806
|
+
return /* @__PURE__ */ jsxs(RadioGroup, { defaultValue: "a", disabled: true, className: "flex-row gap-3", "aria-label": t("design_system.gallery.sampleCopy.disabledGroup"), children: [
|
|
2807
|
+
/* @__PURE__ */ jsx(Radio, { value: "a", "aria-label": t("design_system.gallery.sampleCopy.selectedDisabled") }),
|
|
2808
|
+
/* @__PURE__ */ jsx(Radio, { value: "b", "aria-label": t("design_system.gallery.sampleCopy.unselectedDisabled") })
|
|
2809
|
+
] });
|
|
2810
|
+
}
|
|
2811
|
+
function RadioFieldInputsDefaultSample() {
|
|
2812
|
+
const t = useT();
|
|
2813
|
+
return /* @__PURE__ */ jsxs(RadioGroup, { defaultValue: "standard", "aria-label": t("design_system.gallery.sampleCopy.shippingSpeed"), children: [
|
|
2814
|
+
/* @__PURE__ */ jsx(RadioField, { value: "standard", label: t("design_system.gallery.sampleCopy.standard") }),
|
|
2815
|
+
/* @__PURE__ */ jsx(RadioField, { value: "express", label: t("design_system.gallery.sampleCopy.express") })
|
|
2816
|
+
] });
|
|
2817
|
+
}
|
|
2818
|
+
function RadioFieldInputsWithDescriptionSample() {
|
|
2819
|
+
const t = useT();
|
|
2820
|
+
return /* @__PURE__ */ jsx("div", { className: "w-80", children: /* @__PURE__ */ jsxs(RadioGroup, { defaultValue: "invoice", "aria-label": t("design_system.gallery.samples.marketing.billing"), children: [
|
|
2821
|
+
/* @__PURE__ */ jsx(
|
|
2822
|
+
RadioField,
|
|
2823
|
+
{
|
|
2824
|
+
value: "invoice",
|
|
2825
|
+
label: t("design_system.gallery.sampleCopy.invoice"),
|
|
2826
|
+
description: t("design_system.gallery.sampleCopy.payWithin14DaysOfDelivery")
|
|
2827
|
+
}
|
|
2828
|
+
),
|
|
2829
|
+
/* @__PURE__ */ jsx(
|
|
2830
|
+
RadioField,
|
|
2831
|
+
{
|
|
2832
|
+
value: "prepaid",
|
|
2833
|
+
label: t("design_system.gallery.sampleCopy.prepaid"),
|
|
2834
|
+
description: t("design_system.gallery.sampleCopy.orderShipsAfterPaymentClears")
|
|
2835
|
+
}
|
|
2836
|
+
)
|
|
2837
|
+
] }) });
|
|
2838
|
+
}
|
|
2839
|
+
function SwitchInputsStatesSample() {
|
|
2840
|
+
const t = useT();
|
|
2841
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2842
|
+
/* @__PURE__ */ jsx(Switch, { "aria-label": t("design_system.gallery.sampleCopy.off") }),
|
|
2843
|
+
/* @__PURE__ */ jsx(Switch, { defaultChecked: true, "aria-label": t("design_system.gallery.sampleCopy.on") })
|
|
2844
|
+
] });
|
|
2845
|
+
}
|
|
2846
|
+
function SwitchInputsDisabledSample() {
|
|
2847
|
+
const t = useT();
|
|
2848
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2849
|
+
/* @__PURE__ */ jsx(Switch, { disabled: true, "aria-label": t("design_system.gallery.sampleCopy.disabledOff") }),
|
|
2850
|
+
/* @__PURE__ */ jsx(Switch, { disabled: true, defaultChecked: true, "aria-label": t("design_system.gallery.sampleCopy.disabledOn") })
|
|
2851
|
+
] });
|
|
2852
|
+
}
|
|
2853
|
+
function SwitchFieldInputsDefaultSample() {
|
|
2854
|
+
const t = useT();
|
|
2855
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(SwitchField, { label: t("design_system.gallery.sampleCopy.twofactorAuthentication"), defaultChecked: true }) });
|
|
2856
|
+
}
|
|
2857
|
+
function SwitchFieldInputsWithDescriptionSample() {
|
|
2858
|
+
const t = useT();
|
|
2859
|
+
return /* @__PURE__ */ jsx("div", { className: "w-80", children: /* @__PURE__ */ jsx(
|
|
2860
|
+
SwitchField,
|
|
2861
|
+
{
|
|
2862
|
+
label: t("design_system.gallery.sampleCopy.lowstockAlerts"),
|
|
2863
|
+
description: t("design_system.gallery.sampleCopy.notifyPurchasingWhenStockDropsBelowTheReorderPoint")
|
|
2864
|
+
}
|
|
2865
|
+
) });
|
|
2866
|
+
}
|
|
2867
|
+
function SwitchFieldInputsFlipSample() {
|
|
2868
|
+
const t = useT();
|
|
2869
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(SwitchField, { flip: true, label: t("design_system.gallery.sampleCopy.syncInventoryNightly"), defaultChecked: true }) });
|
|
2870
|
+
}
|
|
2871
|
+
function SliderInputsSingleSample() {
|
|
2872
|
+
const t = useT();
|
|
2873
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(Slider, { defaultValue: [40], min: 0, max: 100, step: 5, "aria-label": t("design_system.gallery.sampleCopy.discount") }) });
|
|
2874
|
+
}
|
|
2875
|
+
function SliderInputsRangeSample() {
|
|
2876
|
+
const t = useT();
|
|
2877
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(Slider, { defaultValue: [20, 60], min: 0, max: 100, "aria-label": t("design_system.gallery.sampleCopy.priceRange") }) });
|
|
2878
|
+
}
|
|
2879
|
+
function SliderInputsDisabledSample() {
|
|
2880
|
+
const t = useT();
|
|
2881
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(Slider, { defaultValue: [45], disabled: true, "aria-label": t("design_system.gallery.sampleCopy.disabledSlider") }) });
|
|
2882
|
+
}
|
|
2883
|
+
function FormFieldInputsDefaultSample() {
|
|
2884
|
+
const t = useT();
|
|
2885
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(FormField, { label: t("design_system.gallery.sampleCopy.warehouseCode"), description: t("design_system.gallery.sampleCopy.shortIdentifierUsedOnLabels"), children: /* @__PURE__ */ jsx(Input, { placeholder: "WAW-01" }) }) });
|
|
2886
|
+
}
|
|
2887
|
+
function FormFieldInputsRequiredSample() {
|
|
2888
|
+
const t = useT();
|
|
2889
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(FormField, { label: t("design_system.gallery.sampleCopy.companyName"), required: true, children: /* @__PURE__ */ jsx(Input, { placeholder: "Acme sp. z o.o." }) }) });
|
|
2890
|
+
}
|
|
2891
|
+
function FormFieldInputsHorizontalSample() {
|
|
2892
|
+
const t = useT();
|
|
2893
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(FormField, { label: t("design_system.gallery.sampleCopy.enableWebhooks"), orientation: "horizontal", children: /* @__PURE__ */ jsx(Switch, { defaultChecked: true }) }) });
|
|
2894
|
+
}
|
|
2895
|
+
function DigitInputInputsDefaultSample() {
|
|
2896
|
+
const t = useT();
|
|
2897
|
+
return /* @__PURE__ */ jsx(DigitInput, { "aria-label": t("design_system.gallery.examples.aiProduct.verification"), className: "w-full gap-1 sm:w-auto sm:gap-2", cellClassName: "min-w-0 w-8 flex-1 sm:w-14 sm:flex-none" });
|
|
2898
|
+
}
|
|
2899
|
+
function DigitInputInputsStatesSample() {
|
|
2900
|
+
const t = useT();
|
|
2901
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
2902
|
+
/* @__PURE__ */ jsx(DigitInput, { length: 4, value: "4921", "aria-invalid": true, "aria-label": t("design_system.gallery.sampleCopy.invalidCode") }),
|
|
2903
|
+
/* @__PURE__ */ jsx(DigitInput, { length: 4, disabled: true, "aria-label": t("design_system.gallery.sampleCopy.disabledCode") })
|
|
2904
|
+
] });
|
|
2905
|
+
}
|
|
2906
|
+
function ButtonInputInputsCopyLinkSample() {
|
|
2907
|
+
const t = useT();
|
|
2908
|
+
return /* @__PURE__ */ jsx("div", { className: "w-80", children: /* @__PURE__ */ jsx(
|
|
2909
|
+
ButtonInput,
|
|
2910
|
+
{
|
|
2911
|
+
readOnly: true,
|
|
2912
|
+
defaultValue: "https://app.example.com/i/8f2c",
|
|
2913
|
+
leftIcon: /* @__PURE__ */ jsx(Link2, {}),
|
|
2914
|
+
trailingAction: /* @__PURE__ */ jsx(IconButton, { variant: "ghost", "aria-label": t("design_system.gallery.sampleCopy.copyLink"), children: /* @__PURE__ */ jsx(Copy, {}) })
|
|
2915
|
+
}
|
|
2916
|
+
) });
|
|
2917
|
+
}
|
|
2918
|
+
function ButtonInputInputsSendSample() {
|
|
2919
|
+
const t = useT();
|
|
2920
|
+
return /* @__PURE__ */ jsx("div", { className: "w-80", children: /* @__PURE__ */ jsx(
|
|
2921
|
+
ButtonInput,
|
|
2922
|
+
{
|
|
2923
|
+
placeholder: t("design_system.gallery.sampleCopy.inviteByEmail"),
|
|
2924
|
+
trailingAction: /* @__PURE__ */ jsx(IconButton, { variant: "ghost", "aria-label": t("design_system.gallery.sampleCopy.sendInvite"), children: /* @__PURE__ */ jsx(Send, {}) })
|
|
2925
|
+
}
|
|
2926
|
+
) });
|
|
2927
|
+
}
|
|
2928
|
+
function TagInputInputsDefaultSample() {
|
|
2929
|
+
const t = useT();
|
|
2930
|
+
return /* @__PURE__ */ jsx(DemoTagInput, { initial: ["wholesale", "priority", "eu"], placeholder: t("design_system.gallery.sampleCopy.addTag") });
|
|
2931
|
+
}
|
|
2932
|
+
function TagInputInputsMaxTagsSample() {
|
|
2933
|
+
const t = useT();
|
|
2934
|
+
return /* @__PURE__ */ jsx(DemoTagInput, { initial: ["red", "green", "blue"], maxTags: 3, placeholder: t("design_system.gallery.sampleCopy.addTag") });
|
|
2935
|
+
}
|
|
2936
|
+
function TextareaInputsCharacterCountSample() {
|
|
2937
|
+
const t = useT();
|
|
2938
|
+
return /* @__PURE__ */ jsx("div", { className: "w-80", children: /* @__PURE__ */ jsx(
|
|
2939
|
+
Textarea,
|
|
2940
|
+
{
|
|
2941
|
+
showCount: true,
|
|
2942
|
+
maxLength: 200,
|
|
2943
|
+
defaultValue: t("design_system.gallery.sampleCopy.customerPrefersDeliveryAfter4PM")
|
|
2944
|
+
}
|
|
2945
|
+
) });
|
|
2946
|
+
}
|
|
2947
|
+
function FormFieldInputsErrorSample() {
|
|
2948
|
+
const t = useT();
|
|
2949
|
+
return /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(FormField, { label: t("design_system.gallery.sampleCopy.vatID"), error: t("design_system.gallery.sampleCopy.vatIDMustHave10Digits"), children: /* @__PURE__ */ jsx(Input, { defaultValue: "52601" }) }) });
|
|
2950
|
+
}
|
|
1214
2951
|
export {
|
|
1215
2952
|
entries
|
|
1216
2953
|
};
|