@vtex/faststore 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/LICENSE +21 -0
- package/README.md +95 -0
- package/dist/actions.json +334 -0
- package/dist/catalog.json +6615 -0
- package/dist/client.d.ts +17 -0
- package/dist/client.js +8 -0
- package/dist/components.d.ts +87 -0
- package/dist/components.js +87 -0
- package/dist/content-types.json +684 -0
- package/dist/core/dist/actions/mock-action.d.ts +24 -0
- package/dist/core/dist/actions/mock-action.js +28 -0
- package/dist/core/dist/actions/mock-action.js.map +1 -0
- package/dist/core/dist/actions/registry.d.ts +24 -0
- package/dist/core/dist/actions/registry.js +28 -0
- package/dist/core/dist/actions/registry.js.map +1 -0
- package/dist/core/dist/define-component.d.ts +100 -0
- package/dist/core/dist/define-component.js +8 -0
- package/dist/core/dist/define-component.js.map +1 -0
- package/dist/core/dist/define-content-type.d.ts +95 -0
- package/dist/core/dist/define-content-type.js +283 -0
- package/dist/core/dist/define-content-type.js.map +1 -0
- package/dist/core/dist/index.d.ts +7 -0
- package/dist/core/dist/index.js +5 -0
- package/dist/core/dist/schema/generated/schema.d.ts +28 -0
- package/dist/core/dist/types.d.ts +1 -0
- package/dist/docs/access-code-field.md +100 -0
- package/dist/docs/access-code-sign-in.md +174 -0
- package/dist/docs/account-entry-point.md +155 -0
- package/dist/docs/address-summary.md +50 -0
- package/dist/docs/buy-button.md +162 -0
- package/dist/docs/carousel.md +105 -0
- package/dist/docs/cart-item.md +162 -0
- package/dist/docs/cart-totalizer.md +197 -0
- package/dist/docs/cart.md +495 -0
- package/dist/docs/client-preferences.md +184 -0
- package/dist/docs/client-profile-form.md +192 -0
- package/dist/docs/client-profile.md +117 -0
- package/dist/docs/container.md +97 -0
- package/dist/docs/document-field.md +97 -0
- package/dist/docs/email-field.md +93 -0
- package/dist/docs/email-identification.md +102 -0
- package/dist/docs/footer-copyright.md +112 -0
- package/dist/docs/footer-link-group.md +162 -0
- package/dist/docs/footer-root.md +145 -0
- package/dist/docs/footer-social.md +151 -0
- package/dist/docs/free-shipping-progress.md +87 -0
- package/dist/docs/gallery.md +84 -0
- package/dist/docs/header-root.md +150 -0
- package/dist/docs/identity-edit.md +88 -0
- package/dist/docs/identity-summary.md +106 -0
- package/dist/docs/incentives.md +151 -0
- package/dist/docs/logo.md +135 -0
- package/dist/docs/meter.md +67 -0
- package/dist/docs/navigation-link-list.md +171 -0
- package/dist/docs/navigation-link.md +163 -0
- package/dist/docs/navigation-menu.md +264 -0
- package/dist/docs/payment-methods.md +139 -0
- package/dist/docs/phone-field.md +106 -0
- package/dist/docs/postal-code-field.md +126 -0
- package/dist/docs/pricing.md +499 -0
- package/dist/docs/product-gallery.md +409 -0
- package/dist/docs/product-information.md +295 -0
- package/dist/docs/product-list.md +170 -0
- package/dist/docs/product-quantity.md +88 -0
- package/dist/docs/product-shelf.md +141 -0
- package/dist/docs/promotion.md +109 -0
- package/dist/docs/region.md +225 -0
- package/dist/docs/session.md +123 -0
- package/dist/docs/shipping-address.md +390 -0
- package/dist/docs/shipping-simulator.md +147 -0
- package/dist/docs/sign-in-form.md +117 -0
- package/dist/docs/tabs.md +176 -0
- package/dist/docs/toast.md +124 -0
- package/dist/docs/variant-selector.md +450 -0
- package/dist/graphql/define-subgraph.d.ts +12 -0
- package/dist/graphql/define-subgraph.js +15 -0
- package/dist/graphql/define-subgraph.js.map +1 -0
- package/dist/graphql/gql.d.ts +10 -0
- package/dist/graphql/gql.js +16 -0
- package/dist/graphql/gql.js.map +1 -0
- package/dist/graphql/types.d.ts +88 -0
- package/dist/graphql.d.ts +4 -0
- package/dist/graphql.js +3 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +5 -0
- package/dist/internal/client.d.ts +24 -0
- package/dist/internal/client.js +23 -0
- package/dist/internal/content.d.ts +2 -0
- package/dist/internal/content.js +2 -0
- package/dist/internal/server.d.ts +7 -0
- package/dist/internal/server.js +6 -0
- package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +111 -0
- package/dist/matter/access-code-sign-in/access-code-sign-in.js +387 -0
- package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -0
- package/dist/matter/account-entry-point/account-entry-point.d.ts +64 -0
- package/dist/matter/account-entry-point/account-entry-point.js +151 -0
- package/dist/matter/account-entry-point/account-entry-point.js.map +1 -0
- package/dist/matter/breadcrumb/breadcrumb.d.ts +40 -0
- package/dist/matter/breadcrumb/breadcrumb.js +155 -0
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/matter/buy-button/buy-button.d.ts +95 -0
- package/dist/matter/buy-button/buy-button.js +259 -0
- package/dist/matter/buy-button/buy-button.js.map +1 -0
- package/dist/matter/cart/cart-namespace.d.ts +48 -0
- package/dist/matter/cart/cart-namespace.js +50 -0
- package/dist/matter/cart/cart-namespace.js.map +1 -0
- package/dist/matter/cart/cart.d.ts +312 -0
- package/dist/matter/cart/cart.js +1034 -0
- package/dist/matter/cart/cart.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +103 -0
- package/dist/matter/cart-item/cart-item.js +672 -0
- package/dist/matter/cart-item/cart-item.js.map +1 -0
- package/dist/matter/cart-item-compositions/cart-item-compositions.d.ts +49 -0
- package/dist/matter/cart-item-compositions/cart-item-compositions.js +165 -0
- package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -0
- package/dist/matter/cart-item-customizations/cart-item-customizations.d.ts +28 -0
- package/dist/matter/cart-item-customizations/cart-item-customizations.js +73 -0
- package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -0
- package/dist/matter/cart-item-discounts/cart-item-discounts.d.ts +33 -0
- package/dist/matter/cart-item-discounts/cart-item-discounts.js +70 -0
- package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -0
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.d.ts +24 -0
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +54 -0
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -0
- package/dist/matter/cart-item-variations/cart-item-variations.d.ts +27 -0
- package/dist/matter/cart-item-variations/cart-item-variations.js +69 -0
- package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -0
- package/dist/matter/cart-totalizer/cart-totalizer.d.ts +78 -0
- package/dist/matter/cart-totalizer/cart-totalizer.js +220 -0
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -0
- package/dist/matter/client-preferences/client-preferences.d.ts +50 -0
- package/dist/matter/client-preferences/client-preferences.js +206 -0
- package/dist/matter/client-preferences/client-preferences.js.map +1 -0
- package/dist/matter/client-profile/client-profile.d.ts +59 -0
- package/dist/matter/client-profile/client-profile.js +185 -0
- package/dist/matter/client-profile/client-profile.js.map +1 -0
- package/dist/matter/client-profile-form/client-profile-form.d.ts +126 -0
- package/dist/matter/client-profile-form/client-profile-form.js +660 -0
- package/dist/matter/client-profile-form/client-profile-form.js.map +1 -0
- package/dist/matter/delivery-options/delivery-options-accordion.d.ts +30 -0
- package/dist/matter/delivery-options/delivery-options-accordion.js +189 -0
- package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -0
- package/dist/matter/delivery-options/delivery-options-controller.d.ts +49 -0
- package/dist/matter/delivery-options/delivery-options-controller.js +203 -0
- package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -0
- package/dist/matter/delivery-options/delivery-options.d.ts +31 -0
- package/dist/matter/delivery-options/delivery-options.js +103 -0
- package/dist/matter/delivery-options/delivery-options.js.map +1 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +9 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js +76 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -0
- package/dist/matter/email-identification/email-identification.d.ts +37 -0
- package/dist/matter/email-identification/email-identification.js +111 -0
- package/dist/matter/email-identification/email-identification.js.map +1 -0
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +44 -0
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +170 -0
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -0
- package/dist/matter/identity-edit/identity-edit.d.ts +52 -0
- package/dist/matter/identity-edit/identity-edit.js +148 -0
- package/dist/matter/identity-edit/identity-edit.js.map +1 -0
- package/dist/matter/identity-summary/identity-summary.d.ts +128 -0
- package/dist/matter/identity-summary/identity-summary.js +344 -0
- package/dist/matter/identity-summary/identity-summary.js.map +1 -0
- package/dist/matter/pricing/pricing.d.ts +162 -0
- package/dist/matter/pricing/pricing.js +793 -0
- package/dist/matter/pricing/pricing.js.map +1 -0
- package/dist/matter/product-gallery/product-gallery.d.ts +23 -0
- package/dist/matter/product-gallery/product-gallery.js +188 -0
- package/dist/matter/product-gallery/product-gallery.js.map +1 -0
- package/dist/matter/product-information/product-information.d.ts +61 -0
- package/dist/matter/product-information/product-information.js +355 -0
- package/dist/matter/product-information/product-information.js.map +1 -0
- package/dist/matter/product-list/product-list.d.ts +86 -0
- package/dist/matter/product-list/product-list.js +342 -0
- package/dist/matter/product-list/product-list.js.map +1 -0
- package/dist/matter/product-quantity/product-quantity.d.ts +50 -0
- package/dist/matter/product-quantity/product-quantity.js +111 -0
- package/dist/matter/product-quantity/product-quantity.js.map +1 -0
- package/dist/matter/product-shelf/product-shelf.d.ts +125 -0
- package/dist/matter/product-shelf/product-shelf.js +376 -0
- package/dist/matter/product-shelf/product-shelf.js.map +1 -0
- package/dist/matter/region/region.d.ts +211 -0
- package/dist/matter/region/region.js +579 -0
- package/dist/matter/region/region.js.map +1 -0
- package/dist/matter/session/session.d.ts +58 -0
- package/dist/matter/session/session.js +112 -0
- package/dist/matter/session/session.js.map +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +101 -0
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -0
- package/dist/matter/shipping-address/shipping-address.d.ts +284 -0
- package/dist/matter/shipping-address/shipping-address.js +1036 -0
- package/dist/matter/shipping-address/shipping-address.js.map +1 -0
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +143 -0
- package/dist/matter/shipping-simulator/shipping-simulator.js +644 -0
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -0
- package/dist/matter/sign-in-form/sign-in-form.d.ts +79 -0
- package/dist/matter/sign-in-form/sign-in-form.js +226 -0
- package/dist/matter/sign-in-form/sign-in-form.js.map +1 -0
- package/dist/matter/variant-selector/variant-selector.d.ts +183 -0
- package/dist/matter/variant-selector/variant-selector.js +840 -0
- package/dist/matter/variant-selector/variant-selector.js.map +1 -0
- package/dist/message-locales.json +7 -0
- package/dist/particles/access-code-field/access-code-field.d.ts +33 -0
- package/dist/particles/access-code-field/access-code-field.js +95 -0
- package/dist/particles/access-code-field/access-code-field.js.map +1 -0
- package/dist/particles/accordion/accordion.d.ts +45 -0
- package/dist/particles/accordion/accordion.js +156 -0
- package/dist/particles/accordion/accordion.js.map +1 -0
- package/dist/particles/address-summary/address-summary.d.ts +50 -0
- package/dist/particles/address-summary/address-summary.js +129 -0
- package/dist/particles/address-summary/address-summary.js.map +1 -0
- package/dist/particles/badge/badge.d.ts +10 -0
- package/dist/particles/badge/badge.js +27 -0
- package/dist/particles/badge/badge.js.map +1 -0
- package/dist/particles/button/button.d.ts +18 -0
- package/dist/particles/button/button.js +37 -0
- package/dist/particles/button/button.js.map +1 -0
- package/dist/particles/carousel/carousel.d.ts +60 -0
- package/dist/particles/carousel/carousel.js +335 -0
- package/dist/particles/carousel/carousel.js.map +1 -0
- package/dist/particles/checkbox/checkbox.d.ts +40 -0
- package/dist/particles/checkbox/checkbox.js +82 -0
- package/dist/particles/checkbox/checkbox.js.map +1 -0
- package/dist/particles/container/container.d.ts +20 -0
- package/dist/particles/container/container.js +36 -0
- package/dist/particles/container/container.js.map +1 -0
- package/dist/particles/dialog/dialog.d.ts +54 -0
- package/dist/particles/dialog/dialog.js +192 -0
- package/dist/particles/dialog/dialog.js.map +1 -0
- package/dist/particles/document-field/document-field.d.ts +61 -0
- package/dist/particles/document-field/document-field.js +146 -0
- package/dist/particles/document-field/document-field.js.map +1 -0
- package/dist/particles/drawer/drawer.d.ts +52 -0
- package/dist/particles/drawer/drawer.js +183 -0
- package/dist/particles/drawer/drawer.js.map +1 -0
- package/dist/particles/email-field/email-field.d.ts +37 -0
- package/dist/particles/email-field/email-field.js +106 -0
- package/dist/particles/email-field/email-field.js.map +1 -0
- package/dist/particles/field/field.d.ts +50 -0
- package/dist/particles/field/field.js +133 -0
- package/dist/particles/field/field.js.map +1 -0
- package/dist/particles/fieldset/fieldset.d.ts +16 -0
- package/dist/particles/fieldset/fieldset.js +52 -0
- package/dist/particles/fieldset/fieldset.js.map +1 -0
- package/dist/particles/footer-copyright/footer-copyright.d.ts +32 -0
- package/dist/particles/footer-copyright/footer-copyright.js +50 -0
- package/dist/particles/footer-copyright/footer-copyright.js.map +1 -0
- package/dist/particles/footer-link-group/footer-link-group.d.ts +66 -0
- package/dist/particles/footer-link-group/footer-link-group.js +154 -0
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -0
- package/dist/particles/footer-root/footer-root.d.ts +21 -0
- package/dist/particles/footer-root/footer-root.js +38 -0
- package/dist/particles/footer-root/footer-root.js.map +1 -0
- package/dist/particles/footer-social/footer-social.d.ts +79 -0
- package/dist/particles/footer-social/footer-social.js +176 -0
- package/dist/particles/footer-social/footer-social.js.map +1 -0
- package/dist/particles/gallery/gallery.d.ts +181 -0
- package/dist/particles/gallery/gallery.js +920 -0
- package/dist/particles/gallery/gallery.js.map +1 -0
- package/dist/particles/header-root/header-root.d.ts +21 -0
- package/dist/particles/header-root/header-root.js +38 -0
- package/dist/particles/header-root/header-root.js.map +1 -0
- package/dist/particles/icon/icon.d.ts +22 -0
- package/dist/particles/icon/icon.js +48 -0
- package/dist/particles/icon/icon.js.map +1 -0
- package/dist/particles/image/image.d.ts +13 -0
- package/dist/particles/image/image.js +59 -0
- package/dist/particles/image/image.js.map +1 -0
- package/dist/particles/incentives/incentives.d.ts +85 -0
- package/dist/particles/incentives/incentives.js +200 -0
- package/dist/particles/incentives/incentives.js.map +1 -0
- package/dist/particles/input/input.d.ts +9 -0
- package/dist/particles/input/input.js +28 -0
- package/dist/particles/input/input.js.map +1 -0
- package/dist/particles/logo/logo.d.ts +55 -0
- package/dist/particles/logo/logo.js +96 -0
- package/dist/particles/logo/logo.js.map +1 -0
- package/dist/particles/menu/menu.d.ts +103 -0
- package/dist/particles/menu/menu.js +409 -0
- package/dist/particles/menu/menu.js.map +1 -0
- package/dist/particles/menubar/menubar.d.ts +18 -0
- package/dist/particles/menubar/menubar.js +42 -0
- package/dist/particles/menubar/menubar.js.map +1 -0
- package/dist/particles/meter/meter.d.ts +36 -0
- package/dist/particles/meter/meter.js +132 -0
- package/dist/particles/meter/meter.js.map +1 -0
- package/dist/particles/navigation-link/navigation-link.d.ts +43 -0
- package/dist/particles/navigation-link/navigation-link.js +82 -0
- package/dist/particles/navigation-link/navigation-link.js.map +1 -0
- package/dist/particles/navigation-link-list/navigation-link-list.d.ts +59 -0
- package/dist/particles/navigation-link-list/navigation-link-list.js +103 -0
- package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -0
- package/dist/particles/navigation-menu/navigation-menu.d.ts +78 -0
- package/dist/particles/navigation-menu/navigation-menu.js +295 -0
- package/dist/particles/navigation-menu/navigation-menu.js.map +1 -0
- package/dist/particles/number-field/number-field.d.ts +46 -0
- package/dist/particles/number-field/number-field.js +169 -0
- package/dist/particles/number-field/number-field.js.map +1 -0
- package/dist/particles/password-field/password-field.d.ts +31 -0
- package/dist/particles/password-field/password-field.js +109 -0
- package/dist/particles/password-field/password-field.js.map +1 -0
- package/dist/particles/payment-methods/payment-methods.d.ts +72 -0
- package/dist/particles/payment-methods/payment-methods.js +151 -0
- package/dist/particles/payment-methods/payment-methods.js.map +1 -0
- package/dist/particles/phone-field/phone-field.d.ts +67 -0
- package/dist/particles/phone-field/phone-field.js +250 -0
- package/dist/particles/phone-field/phone-field.js.map +1 -0
- package/dist/particles/popover/popover.d.ts +68 -0
- package/dist/particles/popover/popover.js +284 -0
- package/dist/particles/popover/popover.js.map +1 -0
- package/dist/particles/postal-code-field/postal-code-field.d.ts +75 -0
- package/dist/particles/postal-code-field/postal-code-field.js +169 -0
- package/dist/particles/postal-code-field/postal-code-field.js.map +1 -0
- package/dist/particles/promotion/promotion.d.ts +46 -0
- package/dist/particles/promotion/promotion.js +78 -0
- package/dist/particles/promotion/promotion.js.map +1 -0
- package/dist/particles/quantity-selector/quantity-selector.d.ts +30 -0
- package/dist/particles/quantity-selector/quantity-selector.js +116 -0
- package/dist/particles/quantity-selector/quantity-selector.js.map +1 -0
- package/dist/particles/radio/radio.d.ts +36 -0
- package/dist/particles/radio/radio.js +76 -0
- package/dist/particles/radio/radio.js.map +1 -0
- package/dist/particles/scroll-area/scroll-area.d.ts +36 -0
- package/dist/particles/scroll-area/scroll-area.js +145 -0
- package/dist/particles/scroll-area/scroll-area.js.map +1 -0
- package/dist/particles/select/select.d.ts +125 -0
- package/dist/particles/select/select.js +478 -0
- package/dist/particles/select/select.js.map +1 -0
- package/dist/particles/separator/separator.d.ts +12 -0
- package/dist/particles/separator/separator.js +33 -0
- package/dist/particles/separator/separator.js.map +1 -0
- package/dist/particles/shared/input-mask.d.ts +5 -0
- package/dist/particles/shared/input-mask.js +58 -0
- package/dist/particles/shared/input-mask.js.map +1 -0
- package/dist/particles/spinner/spinner.d.ts +13 -0
- package/dist/particles/spinner/spinner.js +31 -0
- package/dist/particles/spinner/spinner.js.map +1 -0
- package/dist/particles/switch/switch.d.ts +27 -0
- package/dist/particles/switch/switch.js +59 -0
- package/dist/particles/switch/switch.js.map +1 -0
- package/dist/particles/tabs/tabs.d.ts +45 -0
- package/dist/particles/tabs/tabs.js +164 -0
- package/dist/particles/tabs/tabs.js.map +1 -0
- package/dist/particles/text/text.d.ts +24 -0
- package/dist/particles/text/text.js +40 -0
- package/dist/particles/text/text.js.map +1 -0
- package/dist/particles/toast/toast.d.ts +83 -0
- package/dist/particles/toast/toast.js +194 -0
- package/dist/particles/toast/toast.js.map +1 -0
- package/dist/particles/toggle/toggle.d.ts +26 -0
- package/dist/particles/toggle/toggle.js +61 -0
- package/dist/particles/toggle/toggle.js.map +1 -0
- package/dist/particles/tooltip/tooltip.d.ts +61 -0
- package/dist/particles/tooltip/tooltip.js +240 -0
- package/dist/particles/tooltip/tooltip.js.map +1 -0
- package/dist/schema.graphql +2953 -0
- package/dist/sdk/actions/cart-action-provider.d.ts +19 -0
- package/dist/sdk/actions/cart-action-provider.js +23 -0
- package/dist/sdk/actions/cart-action-provider.js.map +1 -0
- package/dist/sdk/actions/identity-action-provider.d.ts +15 -0
- package/dist/sdk/actions/identity-action-provider.js +19 -0
- package/dist/sdk/actions/identity-action-provider.js.map +1 -0
- package/dist/sdk/actions/index.d.ts +7 -0
- package/dist/sdk/actions/index.js +6 -0
- package/dist/sdk/actions/inject-actions.d.ts +14 -0
- package/dist/sdk/actions/inject-actions.js +36 -0
- package/dist/sdk/actions/inject-actions.js.map +1 -0
- package/dist/sdk/actions/region-action-provider.d.ts +15 -0
- package/dist/sdk/actions/region-action-provider.js +19 -0
- package/dist/sdk/actions/region-action-provider.js.map +1 -0
- package/dist/sdk/actions/session-action-provider.d.ts +15 -0
- package/dist/sdk/actions/session-action-provider.js +19 -0
- package/dist/sdk/actions/session-action-provider.js.map +1 -0
- package/dist/sdk/actions/shipping-action-provider.d.ts +15 -0
- package/dist/sdk/actions/shipping-action-provider.js +19 -0
- package/dist/sdk/actions/shipping-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +21 -0
- package/dist/sdk/cache/storefront-cache.js +35 -0
- package/dist/sdk/cache/storefront-cache.js.map +1 -0
- package/dist/sdk/cart/operations.d.ts +31 -0
- package/dist/sdk/cart/operations.js +215 -0
- package/dist/sdk/cart/operations.js.map +1 -0
- package/dist/sdk/cart/optimistic.d.ts +24 -0
- package/dist/sdk/cart/optimistic.js +164 -0
- package/dist/sdk/cart/optimistic.js.map +1 -0
- package/dist/sdk/cart/use-cart-actions.d.ts +56 -0
- package/dist/sdk/cart/use-cart-actions.js +348 -0
- package/dist/sdk/cart/use-cart-actions.js.map +1 -0
- package/dist/sdk/cart/use-cart-validate-on-open.js +50 -0
- package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -0
- package/dist/sdk/cart/write-gate.js +54 -0
- package/dist/sdk/cart/write-gate.js.map +1 -0
- package/dist/sdk/client/assert-api-url.js +20 -0
- package/dist/sdk/client/assert-api-url.js.map +1 -0
- package/dist/sdk/client/create-client.d.ts +23 -0
- package/dist/sdk/client/create-client.js +46 -0
- package/dist/sdk/client/create-client.js.map +1 -0
- package/dist/sdk/client/fetch-page-data.d.ts +39 -0
- package/dist/sdk/client/fetch-page-data.js +33 -0
- package/dist/sdk/client/fetch-page-data.js.map +1 -0
- package/dist/sdk/client/register-preload-query.d.ts +24 -0
- package/dist/sdk/client/register-preload-query.js +33 -0
- package/dist/sdk/client/register-preload-query.js.map +1 -0
- package/dist/sdk/content/create-content-runtime.d.ts +68 -0
- package/dist/sdk/content/create-content-runtime.js +503 -0
- package/dist/sdk/content/create-content-runtime.js.map +1 -0
- package/dist/sdk/context/headers.d.ts +15 -0
- package/dist/sdk/context/headers.js +21 -0
- package/dist/sdk/context/headers.js.map +1 -0
- package/dist/sdk/context/storefront-context.d.ts +11 -0
- package/dist/sdk/context/storefront-context.js +29 -0
- package/dist/sdk/context/storefront-context.js.map +1 -0
- package/dist/sdk/data/data-override-context.d.ts +12 -0
- package/dist/sdk/data/data-override-context.js +19 -0
- package/dist/sdk/data/data-override-context.js.map +1 -0
- package/dist/sdk/data/entity-subscriber.js +28 -0
- package/dist/sdk/data/entity-subscriber.js.map +1 -0
- package/dist/sdk/data/hot-data-provider.d.ts +19 -0
- package/dist/sdk/data/hot-data-provider.js +33 -0
- package/dist/sdk/data/hot-data-provider.js.map +1 -0
- package/dist/sdk/data/index.d.ts +8 -0
- package/dist/sdk/data/index.js +8 -0
- package/dist/sdk/data/list-item-ref-context.d.ts +20 -0
- package/dist/sdk/data/list-item-ref-context.js +11 -0
- package/dist/sdk/data/list-item-ref-context.js.map +1 -0
- package/dist/sdk/data/multiple-reactive-data-provider.d.ts +32 -0
- package/dist/sdk/data/multiple-reactive-data-provider.js +20 -0
- package/dist/sdk/data/multiple-reactive-data-provider.js.map +1 -0
- package/dist/sdk/data/page-reactive-data-root.d.ts +53 -0
- package/dist/sdk/data/page-reactive-data-root.js +153 -0
- package/dist/sdk/data/page-reactive-data-root.js.map +1 -0
- package/dist/sdk/data/reactive-data-provider.d.ts +25 -0
- package/dist/sdk/data/reactive-data-provider.js +24 -0
- package/dist/sdk/data/reactive-data-provider.js.map +1 -0
- package/dist/sdk/data/reactive-list-item-data-provider.d.ts +26 -0
- package/dist/sdk/data/reactive-list-item-data-provider.js +42 -0
- package/dist/sdk/data/reactive-list-item-data-provider.js.map +1 -0
- package/dist/sdk/data/use-reactive-entity.js +40 -0
- package/dist/sdk/data/use-reactive-entity.js.map +1 -0
- package/dist/sdk/format/client.d.ts +12 -0
- package/dist/sdk/format/client.js +20 -0
- package/dist/sdk/format/client.js.map +1 -0
- package/dist/sdk/format/formatters.d.ts +32 -0
- package/dist/sdk/format/formatters.js +45 -0
- package/dist/sdk/format/formatters.js.map +1 -0
- package/dist/sdk/generated/fragment-types.js +23 -0
- package/dist/sdk/generated/fragment-types.js.map +1 -0
- package/dist/sdk/generated/gql.js +51 -0
- package/dist/sdk/generated/gql.js.map +1 -0
- package/dist/sdk/generated/graphql.d.ts +622 -0
- package/dist/sdk/generated/graphql.js +11917 -0
- package/dist/sdk/generated/graphql.js.map +1 -0
- package/dist/sdk/graphql-tag.d.ts +10 -0
- package/dist/sdk/graphql-tag.js +21 -0
- package/dist/sdk/graphql-tag.js.map +1 -0
- package/dist/sdk/i18n/client.d.ts +4 -0
- package/dist/sdk/i18n/client.js +4 -0
- package/dist/sdk/i18n/locales.d.ts +8 -0
- package/dist/sdk/i18n/locales.js +57 -0
- package/dist/sdk/i18n/locales.js.map +1 -0
- package/dist/sdk/i18n/messages/en-US.js +24 -0
- package/dist/sdk/i18n/messages/en-US.js.map +1 -0
- package/dist/sdk/i18n/messages/en-US.json +19 -0
- package/dist/sdk/i18n/messages/en-US.json.d.ts +23 -0
- package/dist/sdk/i18n/messages/es-ES.js +24 -0
- package/dist/sdk/i18n/messages/es-ES.js.map +1 -0
- package/dist/sdk/i18n/messages/es-ES.json +19 -0
- package/dist/sdk/i18n/messages/pt-BR.js +24 -0
- package/dist/sdk/i18n/messages/pt-BR.js.map +1 -0
- package/dist/sdk/i18n/messages/pt-BR.json +19 -0
- package/dist/sdk/i18n/provider.d.ts +1 -0
- package/dist/sdk/i18n/provider.js +30 -0
- package/dist/sdk/i18n/provider.js.map +1 -0
- package/dist/sdk/i18n/server.d.ts +28 -0
- package/dist/sdk/i18n/server.js +59 -0
- package/dist/sdk/i18n/server.js.map +1 -0
- package/dist/sdk/identity/operations.d.ts +34 -0
- package/dist/sdk/identity/operations.js +78 -0
- package/dist/sdk/identity/operations.js.map +1 -0
- package/dist/sdk/identity/use-identity-actions.d.ts +62 -0
- package/dist/sdk/identity/use-identity-actions.js +180 -0
- package/dist/sdk/identity/use-identity-actions.js.map +1 -0
- package/dist/sdk/provider/index.d.ts +2 -0
- package/dist/sdk/provider/index.js +2 -0
- package/dist/sdk/provider/storefront-provider.d.ts +32 -0
- package/dist/sdk/provider/storefront-provider.js +111 -0
- package/dist/sdk/provider/storefront-provider.js.map +1 -0
- package/dist/sdk/region/operations.d.ts +6 -0
- package/dist/sdk/region/region-operations.d.ts +30 -0
- package/dist/sdk/region/region-operations.js +23 -0
- package/dist/sdk/region/region-operations.js.map +1 -0
- package/dist/sdk/region/use-region-actions.d.ts +23 -0
- package/dist/sdk/region/use-region-actions.js +66 -0
- package/dist/sdk/region/use-region-actions.js.map +1 -0
- package/dist/sdk/seller.js +11 -0
- package/dist/sdk/seller.js.map +1 -0
- package/dist/sdk/session/auth-operations.d.ts +47 -0
- package/dist/sdk/session/auth-operations.js +79 -0
- package/dist/sdk/session/auth-operations.js.map +1 -0
- package/dist/sdk/session/operations.d.ts +6 -0
- package/dist/sdk/session/use-session-actions.d.ts +27 -0
- package/dist/sdk/session/use-session-actions.js +126 -0
- package/dist/sdk/session/use-session-actions.js.map +1 -0
- package/dist/sdk/shipping/cart-operations.d.ts +3 -0
- package/dist/sdk/shipping/cart-operations.js +33 -0
- package/dist/sdk/shipping/cart-operations.js.map +1 -0
- package/dist/sdk/shipping/operations.d.ts +3 -0
- package/dist/sdk/shipping/operations.js +33 -0
- package/dist/sdk/shipping/operations.js.map +1 -0
- package/dist/sdk/shipping/option-select-operations.d.ts +24 -0
- package/dist/sdk/shipping/option-select-operations.js +45 -0
- package/dist/sdk/shipping/option-select-operations.js.map +1 -0
- package/dist/sdk/shipping/request-timeout.js +41 -0
- package/dist/sdk/shipping/request-timeout.js.map +1 -0
- package/dist/sdk/shipping/shipping-operations.d.ts +38 -0
- package/dist/sdk/shipping/shipping-operations.js +77 -0
- package/dist/sdk/shipping/shipping-operations.js.map +1 -0
- package/dist/sdk/shipping/use-cart-shipping-simulation.d.ts +7 -0
- package/dist/sdk/shipping/use-cart-shipping-simulation.js +72 -0
- package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -0
- package/dist/sdk/shipping/use-shipping-actions.d.ts +27 -0
- package/dist/sdk/shipping/use-shipping-actions.js +113 -0
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -0
- package/dist/sdk/shipping/use-shipping-simulation.d.ts +7 -0
- package/dist/sdk/shipping/use-shipping-simulation.js +72 -0
- package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -0
- package/dist/sdk/state/cart.d.ts +42 -0
- package/dist/sdk/state/cart.js +64 -0
- package/dist/sdk/state/cart.js.map +1 -0
- package/dist/sdk/state/index.js +3 -0
- package/dist/sdk/state/variant-selector.d.ts +17 -0
- package/dist/sdk/state/variant-selector.js +14 -0
- package/dist/sdk/state/variant-selector.js.map +1 -0
- package/dist/utils/safe-href.js +63 -0
- package/dist/utils/safe-href.js.map +1 -0
- package/package.json +84 -0
- package/src/styles/tailwind.css +32 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import "../../core/dist/index.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Select } from "@base-ui/react/select";
|
|
6
|
+
//#region src/particles/select/select.tsx
|
|
7
|
+
const SelectRootDefinition = defineComponent({
|
|
8
|
+
name: "SelectRoot",
|
|
9
|
+
importPath: "@vtex/faststore/components",
|
|
10
|
+
component: SelectRoot,
|
|
11
|
+
editor: {
|
|
12
|
+
label: "Select Root",
|
|
13
|
+
category: "layout"
|
|
14
|
+
},
|
|
15
|
+
schema: {
|
|
16
|
+
disabled: {
|
|
17
|
+
type: "boolean",
|
|
18
|
+
default: false,
|
|
19
|
+
label: "Disabled"
|
|
20
|
+
},
|
|
21
|
+
modal: {
|
|
22
|
+
type: "boolean",
|
|
23
|
+
default: true,
|
|
24
|
+
label: "Modal"
|
|
25
|
+
},
|
|
26
|
+
required: {
|
|
27
|
+
type: "boolean",
|
|
28
|
+
default: false,
|
|
29
|
+
label: "Required"
|
|
30
|
+
},
|
|
31
|
+
readOnly: {
|
|
32
|
+
type: "boolean",
|
|
33
|
+
default: false,
|
|
34
|
+
label: "Read Only"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
guideline: "Root of a select dropdown. Manages selection state, modal overlay, and form integration. Compose as: SelectRoot > (SelectLabel + SelectTrigger > (SelectValue + SelectIcon) + SelectPortal > (SelectBackdrop + SelectPositioner > SelectPopup > (SelectScrollUpArrow + SelectList > [SelectItem > (SelectItemText + SelectItemIndicator)] + SelectScrollDownArrow))). Use SelectGroup > (SelectGroupLabel + [SelectItem]) for grouped options. Set modal=false to allow interacting with background elements while open."
|
|
38
|
+
});
|
|
39
|
+
const SelectLabelDefinition = defineComponent({
|
|
40
|
+
name: "SelectLabel",
|
|
41
|
+
importPath: "@vtex/faststore/components",
|
|
42
|
+
component: SelectLabel,
|
|
43
|
+
editor: {
|
|
44
|
+
label: "Select Label",
|
|
45
|
+
category: "layout"
|
|
46
|
+
},
|
|
47
|
+
schema: {},
|
|
48
|
+
guideline: "Accessible label associated with the trigger. Always place outside Select.Trigger so screen readers announce it separately."
|
|
49
|
+
});
|
|
50
|
+
const SelectTriggerDefinition = defineComponent({
|
|
51
|
+
name: "SelectTrigger",
|
|
52
|
+
importPath: "@vtex/faststore/components",
|
|
53
|
+
component: SelectTrigger,
|
|
54
|
+
editor: {
|
|
55
|
+
label: "Select Trigger",
|
|
56
|
+
category: "action"
|
|
57
|
+
},
|
|
58
|
+
schema: { disabled: {
|
|
59
|
+
type: "boolean",
|
|
60
|
+
default: false,
|
|
61
|
+
label: "Disabled"
|
|
62
|
+
} },
|
|
63
|
+
guideline: "Opens and closes the popup on click. Use data-open and data-placeholder CSS attributes for open-state and empty-state styling."
|
|
64
|
+
});
|
|
65
|
+
const SelectValueDefinition = defineComponent({
|
|
66
|
+
name: "SelectValue",
|
|
67
|
+
importPath: "@vtex/faststore/components",
|
|
68
|
+
component: SelectValue,
|
|
69
|
+
editor: {
|
|
70
|
+
label: "Select Value",
|
|
71
|
+
category: "layout"
|
|
72
|
+
},
|
|
73
|
+
schema: {},
|
|
74
|
+
guideline: "Renders the selected item's text, or placeholder when nothing is selected. Style the placeholder state via [data-fs-select-value][data-placeholder]."
|
|
75
|
+
});
|
|
76
|
+
const SelectIconDefinition = defineComponent({
|
|
77
|
+
name: "SelectIcon",
|
|
78
|
+
importPath: "@vtex/faststore/components",
|
|
79
|
+
component: SelectIcon,
|
|
80
|
+
editor: {
|
|
81
|
+
label: "Select Icon",
|
|
82
|
+
category: "layout"
|
|
83
|
+
},
|
|
84
|
+
schema: {},
|
|
85
|
+
guideline: "Decorative indicator (e.g. chevron) inside the trigger. Rotates or changes when the popup opens via data-open."
|
|
86
|
+
});
|
|
87
|
+
const SelectPortalDefinition = defineComponent({
|
|
88
|
+
name: "SelectPortal",
|
|
89
|
+
importPath: "@vtex/faststore/components",
|
|
90
|
+
component: SelectPortal,
|
|
91
|
+
editor: {
|
|
92
|
+
label: "Select Portal",
|
|
93
|
+
category: "layout"
|
|
94
|
+
},
|
|
95
|
+
schema: {},
|
|
96
|
+
guideline: "Teleports popup content to <body>. Always wrap Select.Positioner with this to avoid overflow/z-index issues."
|
|
97
|
+
});
|
|
98
|
+
const SelectBackdropDefinition = defineComponent({
|
|
99
|
+
name: "SelectBackdrop",
|
|
100
|
+
importPath: "@vtex/faststore/components",
|
|
101
|
+
component: SelectBackdrop,
|
|
102
|
+
editor: {
|
|
103
|
+
label: "Select Backdrop",
|
|
104
|
+
category: "layout"
|
|
105
|
+
},
|
|
106
|
+
schema: {},
|
|
107
|
+
guideline: "Invisible overlay that closes the select when clicked outside. Required when modal=true to trap interaction."
|
|
108
|
+
});
|
|
109
|
+
const SelectPositionerDefinition = defineComponent({
|
|
110
|
+
name: "SelectPositioner",
|
|
111
|
+
importPath: "@vtex/faststore/components",
|
|
112
|
+
component: SelectPositioner,
|
|
113
|
+
editor: {
|
|
114
|
+
label: "Select Positioner",
|
|
115
|
+
category: "layout"
|
|
116
|
+
},
|
|
117
|
+
schema: {
|
|
118
|
+
side: {
|
|
119
|
+
type: [
|
|
120
|
+
"top",
|
|
121
|
+
"bottom",
|
|
122
|
+
"left",
|
|
123
|
+
"right"
|
|
124
|
+
],
|
|
125
|
+
default: "bottom",
|
|
126
|
+
label: "Side"
|
|
127
|
+
},
|
|
128
|
+
align: {
|
|
129
|
+
type: [
|
|
130
|
+
"start",
|
|
131
|
+
"center",
|
|
132
|
+
"end"
|
|
133
|
+
],
|
|
134
|
+
default: "center",
|
|
135
|
+
label: "Align"
|
|
136
|
+
},
|
|
137
|
+
sideOffset: {
|
|
138
|
+
type: "number",
|
|
139
|
+
default: 0,
|
|
140
|
+
label: "Side Offset"
|
|
141
|
+
},
|
|
142
|
+
alignItemWithTrigger: {
|
|
143
|
+
type: "boolean",
|
|
144
|
+
default: true,
|
|
145
|
+
label: "Align Item With Trigger"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
guideline: "Positions the popup relative to the trigger. Use side and align to control placement; alignItemWithTrigger=true overlaps the trigger to align the selected item visually."
|
|
149
|
+
});
|
|
150
|
+
const SelectScrollUpArrowDefinition = defineComponent({
|
|
151
|
+
name: "SelectScrollUpArrow",
|
|
152
|
+
importPath: "@vtex/faststore/components",
|
|
153
|
+
component: SelectScrollUpArrow,
|
|
154
|
+
editor: {
|
|
155
|
+
label: "Select Scroll Up Arrow",
|
|
156
|
+
category: "layout"
|
|
157
|
+
},
|
|
158
|
+
schema: { keepMounted: {
|
|
159
|
+
type: "boolean",
|
|
160
|
+
default: false,
|
|
161
|
+
label: "Keep Mounted"
|
|
162
|
+
} },
|
|
163
|
+
guideline: "Scrolls the list upward when hovered. Appears automatically when the list overflows at the top."
|
|
164
|
+
});
|
|
165
|
+
const SelectPopupDefinition = defineComponent({
|
|
166
|
+
name: "SelectPopup",
|
|
167
|
+
importPath: "@vtex/faststore/components",
|
|
168
|
+
component: SelectPopup,
|
|
169
|
+
editor: {
|
|
170
|
+
label: "Select Popup",
|
|
171
|
+
category: "layout"
|
|
172
|
+
},
|
|
173
|
+
schema: {},
|
|
174
|
+
guideline: "Visible container for the select list. Apply background, shadow, and border styles here."
|
|
175
|
+
});
|
|
176
|
+
const SelectArrowDefinition = defineComponent({
|
|
177
|
+
name: "SelectArrow",
|
|
178
|
+
importPath: "@vtex/faststore/components",
|
|
179
|
+
component: SelectArrow,
|
|
180
|
+
editor: {
|
|
181
|
+
label: "Select Arrow",
|
|
182
|
+
category: "layout"
|
|
183
|
+
},
|
|
184
|
+
schema: {},
|
|
185
|
+
guideline: "Pointing arrow attached to the popup indicating the anchor. Optional — omit when not using an arrow indicator."
|
|
186
|
+
});
|
|
187
|
+
const SelectListDefinition = defineComponent({
|
|
188
|
+
name: "SelectList",
|
|
189
|
+
importPath: "@vtex/faststore/components",
|
|
190
|
+
component: SelectList,
|
|
191
|
+
editor: {
|
|
192
|
+
label: "Select List",
|
|
193
|
+
category: "layout"
|
|
194
|
+
},
|
|
195
|
+
schema: {},
|
|
196
|
+
guideline: "Scrollable container for all Select.Item elements. Apply max-height and overflow for scrolling."
|
|
197
|
+
});
|
|
198
|
+
const SelectItemDefinition = defineComponent({
|
|
199
|
+
name: "SelectItem",
|
|
200
|
+
importPath: "@vtex/faststore/components",
|
|
201
|
+
component: SelectItem,
|
|
202
|
+
editor: {
|
|
203
|
+
label: "Select Item",
|
|
204
|
+
category: "layout"
|
|
205
|
+
},
|
|
206
|
+
schema: {
|
|
207
|
+
value: {
|
|
208
|
+
type: "string",
|
|
209
|
+
label: "Value"
|
|
210
|
+
},
|
|
211
|
+
disabled: {
|
|
212
|
+
type: "boolean",
|
|
213
|
+
default: false,
|
|
214
|
+
label: "Disabled"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
guideline: "One selectable option. Requires a unique value prop. Style selected and highlighted states via data-selected and data-highlighted attributes."
|
|
218
|
+
});
|
|
219
|
+
const SelectItemTextDefinition = defineComponent({
|
|
220
|
+
name: "SelectItemText",
|
|
221
|
+
importPath: "@vtex/faststore/components",
|
|
222
|
+
component: SelectItemText,
|
|
223
|
+
editor: {
|
|
224
|
+
label: "Select Item Text",
|
|
225
|
+
category: "layout"
|
|
226
|
+
},
|
|
227
|
+
schema: {},
|
|
228
|
+
guideline: "The visible text label of an item. Base UI uses this for keyboard navigation matching."
|
|
229
|
+
});
|
|
230
|
+
const SelectItemIndicatorDefinition = defineComponent({
|
|
231
|
+
name: "SelectItemIndicator",
|
|
232
|
+
importPath: "@vtex/faststore/components",
|
|
233
|
+
component: SelectItemIndicator,
|
|
234
|
+
editor: {
|
|
235
|
+
label: "Select Item Indicator",
|
|
236
|
+
category: "layout"
|
|
237
|
+
},
|
|
238
|
+
schema: { keepMounted: {
|
|
239
|
+
type: "boolean",
|
|
240
|
+
default: false,
|
|
241
|
+
label: "Keep Mounted"
|
|
242
|
+
} },
|
|
243
|
+
guideline: "Checkmark or indicator shown only on the selected item. Set keepMounted=true to animate in/out."
|
|
244
|
+
});
|
|
245
|
+
const SelectSeparatorDefinition = defineComponent({
|
|
246
|
+
name: "SelectSeparator",
|
|
247
|
+
importPath: "@vtex/faststore/components",
|
|
248
|
+
component: SelectSeparator,
|
|
249
|
+
editor: {
|
|
250
|
+
label: "Select Separator",
|
|
251
|
+
category: "layout"
|
|
252
|
+
},
|
|
253
|
+
schema: {},
|
|
254
|
+
guideline: "Visual divider between items or groups. Use between unrelated option groups."
|
|
255
|
+
});
|
|
256
|
+
const SelectGroupDefinition = defineComponent({
|
|
257
|
+
name: "SelectGroup",
|
|
258
|
+
importPath: "@vtex/faststore/components",
|
|
259
|
+
component: SelectGroup,
|
|
260
|
+
editor: {
|
|
261
|
+
label: "Select Group",
|
|
262
|
+
category: "layout"
|
|
263
|
+
},
|
|
264
|
+
schema: {},
|
|
265
|
+
guideline: "Groups related items under a shared SelectGroupLabel for semantic and visual grouping."
|
|
266
|
+
});
|
|
267
|
+
const SelectGroupLabelDefinition = defineComponent({
|
|
268
|
+
name: "SelectGroupLabel",
|
|
269
|
+
importPath: "@vtex/faststore/components",
|
|
270
|
+
component: SelectGroupLabel,
|
|
271
|
+
editor: {
|
|
272
|
+
label: "Select Group Label",
|
|
273
|
+
category: "layout"
|
|
274
|
+
},
|
|
275
|
+
schema: {},
|
|
276
|
+
guideline: "Non-interactive label for a Select.Group. Announced by screen readers as a group name."
|
|
277
|
+
});
|
|
278
|
+
const SelectScrollDownArrowDefinition = defineComponent({
|
|
279
|
+
name: "SelectScrollDownArrow",
|
|
280
|
+
importPath: "@vtex/faststore/components",
|
|
281
|
+
component: SelectScrollDownArrow,
|
|
282
|
+
editor: {
|
|
283
|
+
label: "Select Scroll Down Arrow",
|
|
284
|
+
category: "layout"
|
|
285
|
+
},
|
|
286
|
+
schema: { keepMounted: {
|
|
287
|
+
type: "boolean",
|
|
288
|
+
default: false,
|
|
289
|
+
label: "Keep Mounted"
|
|
290
|
+
} },
|
|
291
|
+
guideline: "Scrolls the list downward when hovered. Appears when the list overflows at the bottom."
|
|
292
|
+
});
|
|
293
|
+
function SelectRoot({ disabled = false, modal = true, required = false, readOnly = false, children, ...props }) {
|
|
294
|
+
return /* @__PURE__ */ jsx(Select.Root, {
|
|
295
|
+
...props,
|
|
296
|
+
disabled,
|
|
297
|
+
modal,
|
|
298
|
+
required,
|
|
299
|
+
readOnly,
|
|
300
|
+
children
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
function SelectLabel({ className, children, ...props }) {
|
|
304
|
+
return /* @__PURE__ */ jsx(Select.Label, {
|
|
305
|
+
...props,
|
|
306
|
+
className,
|
|
307
|
+
"data-fs-select-label": "",
|
|
308
|
+
children
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
function SelectTrigger({ disabled = false, className, children, ...props }) {
|
|
312
|
+
return /* @__PURE__ */ jsx(Select.Trigger, {
|
|
313
|
+
...props,
|
|
314
|
+
disabled,
|
|
315
|
+
className,
|
|
316
|
+
"data-fs-select-trigger": "",
|
|
317
|
+
children
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
function SelectValue({ placeholder, className, children, ...props }) {
|
|
321
|
+
return /* @__PURE__ */ jsx(Select.Value, {
|
|
322
|
+
...props,
|
|
323
|
+
placeholder,
|
|
324
|
+
className,
|
|
325
|
+
"data-fs-select-value": "",
|
|
326
|
+
children
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
function SelectIcon({ className, children, ...props }) {
|
|
330
|
+
return /* @__PURE__ */ jsx(Select.Icon, {
|
|
331
|
+
...props,
|
|
332
|
+
className,
|
|
333
|
+
"data-fs-select-icon": "",
|
|
334
|
+
children
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
function SelectPortal({ children }) {
|
|
338
|
+
return /* @__PURE__ */ jsx(Select.Portal, { children });
|
|
339
|
+
}
|
|
340
|
+
function SelectBackdrop({ className, children, ...props }) {
|
|
341
|
+
return /* @__PURE__ */ jsx(Select.Backdrop, {
|
|
342
|
+
...props,
|
|
343
|
+
className,
|
|
344
|
+
"data-fs-select-backdrop": "",
|
|
345
|
+
children
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
function SelectPositioner({ side = "bottom", align = "center", sideOffset = 0, alignItemWithTrigger = true, className, children, ...props }) {
|
|
349
|
+
return /* @__PURE__ */ jsx(Select.Positioner, {
|
|
350
|
+
...props,
|
|
351
|
+
side,
|
|
352
|
+
align,
|
|
353
|
+
sideOffset,
|
|
354
|
+
alignItemWithTrigger,
|
|
355
|
+
className,
|
|
356
|
+
"data-fs-select-positioner": "",
|
|
357
|
+
children
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
function SelectScrollUpArrow({ keepMounted = false, className, children, ...props }) {
|
|
361
|
+
return /* @__PURE__ */ jsx(Select.ScrollUpArrow, {
|
|
362
|
+
...props,
|
|
363
|
+
keepMounted,
|
|
364
|
+
className,
|
|
365
|
+
"data-fs-select-scroll-up-arrow": "",
|
|
366
|
+
children
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
function SelectPopup({ className, children, ...props }) {
|
|
370
|
+
return /* @__PURE__ */ jsx(Select.Popup, {
|
|
371
|
+
...props,
|
|
372
|
+
className,
|
|
373
|
+
"data-fs-select-popup": "",
|
|
374
|
+
children
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function SelectArrow({ className, children, ...props }) {
|
|
378
|
+
return /* @__PURE__ */ jsx(Select.Arrow, {
|
|
379
|
+
...props,
|
|
380
|
+
className,
|
|
381
|
+
"data-fs-select-arrow": "",
|
|
382
|
+
children
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
function SelectList({ className, children, ...props }) {
|
|
386
|
+
return /* @__PURE__ */ jsx(Select.List, {
|
|
387
|
+
...props,
|
|
388
|
+
className,
|
|
389
|
+
"data-fs-select-list": "",
|
|
390
|
+
children
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
function SelectItem({ value, disabled = false, label, className, children, ...props }) {
|
|
394
|
+
return /* @__PURE__ */ jsx(Select.Item, {
|
|
395
|
+
...props,
|
|
396
|
+
value,
|
|
397
|
+
disabled,
|
|
398
|
+
label,
|
|
399
|
+
className,
|
|
400
|
+
"data-fs-select-item": "",
|
|
401
|
+
children
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
function SelectItemText({ className, children, ...props }) {
|
|
405
|
+
return /* @__PURE__ */ jsx(Select.ItemText, {
|
|
406
|
+
...props,
|
|
407
|
+
className,
|
|
408
|
+
"data-fs-select-item-text": "",
|
|
409
|
+
children
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
function SelectItemIndicator({ keepMounted = false, className, children, ...props }) {
|
|
413
|
+
return /* @__PURE__ */ jsx(Select.ItemIndicator, {
|
|
414
|
+
...props,
|
|
415
|
+
keepMounted,
|
|
416
|
+
className,
|
|
417
|
+
"data-fs-select-item-indicator": "",
|
|
418
|
+
children
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function SelectSeparator({ className, children, ...props }) {
|
|
422
|
+
return /* @__PURE__ */ jsx(Select.Separator, {
|
|
423
|
+
...props,
|
|
424
|
+
className,
|
|
425
|
+
"data-fs-select-separator": "",
|
|
426
|
+
children
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
function SelectGroup({ className, children, ...props }) {
|
|
430
|
+
return /* @__PURE__ */ jsx(Select.Group, {
|
|
431
|
+
...props,
|
|
432
|
+
className,
|
|
433
|
+
"data-fs-select-group": "",
|
|
434
|
+
children
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
function SelectGroupLabel({ className, children, ...props }) {
|
|
438
|
+
return /* @__PURE__ */ jsx(Select.GroupLabel, {
|
|
439
|
+
...props,
|
|
440
|
+
className,
|
|
441
|
+
"data-fs-select-group-label": "",
|
|
442
|
+
children
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
function SelectScrollDownArrow({ keepMounted = false, className, children, ...props }) {
|
|
446
|
+
return /* @__PURE__ */ jsx(Select.ScrollDownArrow, {
|
|
447
|
+
...props,
|
|
448
|
+
keepMounted,
|
|
449
|
+
className,
|
|
450
|
+
"data-fs-select-scroll-down-arrow": "",
|
|
451
|
+
children
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
const Select$1 = {
|
|
455
|
+
Root: SelectRoot,
|
|
456
|
+
Label: SelectLabel,
|
|
457
|
+
Trigger: SelectTrigger,
|
|
458
|
+
Value: SelectValue,
|
|
459
|
+
Icon: SelectIcon,
|
|
460
|
+
Portal: SelectPortal,
|
|
461
|
+
Backdrop: SelectBackdrop,
|
|
462
|
+
Positioner: SelectPositioner,
|
|
463
|
+
ScrollUpArrow: SelectScrollUpArrow,
|
|
464
|
+
Popup: SelectPopup,
|
|
465
|
+
Arrow: SelectArrow,
|
|
466
|
+
List: SelectList,
|
|
467
|
+
Item: SelectItem,
|
|
468
|
+
ItemText: SelectItemText,
|
|
469
|
+
ItemIndicator: SelectItemIndicator,
|
|
470
|
+
Separator: SelectSeparator,
|
|
471
|
+
Group: SelectGroup,
|
|
472
|
+
GroupLabel: SelectGroupLabel,
|
|
473
|
+
ScrollDownArrow: SelectScrollDownArrow
|
|
474
|
+
};
|
|
475
|
+
//#endregion
|
|
476
|
+
export { Select$1 as Select, SelectArrow, SelectArrowDefinition, SelectBackdrop, SelectBackdropDefinition, SelectGroup, SelectGroupDefinition, SelectGroupLabel, SelectGroupLabelDefinition, SelectIcon, SelectIconDefinition, SelectItem, SelectItemDefinition, SelectItemIndicator, SelectItemIndicatorDefinition, SelectItemText, SelectItemTextDefinition, SelectLabel, SelectLabelDefinition, SelectList, SelectListDefinition, SelectPopup, SelectPopupDefinition, SelectPortal, SelectPortalDefinition, SelectPositioner, SelectPositionerDefinition, SelectRoot, SelectRootDefinition, SelectScrollDownArrow, SelectScrollDownArrowDefinition, SelectScrollUpArrow, SelectScrollUpArrowDefinition, SelectSeparator, SelectSeparatorDefinition, SelectTrigger, SelectTriggerDefinition, SelectValue, SelectValueDefinition };
|
|
477
|
+
|
|
478
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","names":["BaseSelect","Select"],"sources":["../../../src/particles/select/select.tsx"],"sourcesContent":["'use client';\nimport { Select as BaseSelect } from '@base-ui/react/select';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type SelectSide = 'top' | 'bottom' | 'left' | 'right';\nexport type SelectAlign = 'start' | 'center' | 'end';\n\nexport type SelectRootProps = {\n disabled?: boolean;\n modal?: boolean;\n required?: boolean;\n readOnly?: boolean;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string | null) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n name?: string;\n children?: ReactNode;\n};\n\nexport type SelectLabelProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectTriggerProps = ComponentPropsWithRef<'button'> & {\n disabled?: boolean;\n};\n\nexport type SelectValueProps = Omit<ComponentPropsWithRef<'span'>, 'children'> & {\n placeholder?: string;\n /** Rendered content, or a render function receiving the current value (Base UI resolves the\n * matching item's label automatically when omitted, but only once that item has mounted at\n * least once — e.g. after the popup has been opened — so pass a render function when the\n * label must be correct before the shopper ever opens the dropdown). */\n children?: ReactNode | ((value: string | null) => ReactNode);\n};\n\nexport type SelectIconProps = ComponentPropsWithRef<'span'>;\n\nexport type SelectPortalProps = {\n children?: ReactNode;\n};\n\nexport type SelectBackdropProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectPositionerProps = ComponentPropsWithRef<'div'> & {\n side?: SelectSide;\n align?: SelectAlign;\n sideOffset?: number;\n alignItemWithTrigger?: boolean;\n};\n\nexport type SelectScrollUpArrowProps = ComponentPropsWithRef<'div'> & {\n keepMounted?: boolean;\n};\n\nexport type SelectPopupProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectArrowProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectListProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectItemProps = ComponentPropsWithRef<'div'> & {\n value?: string;\n disabled?: boolean;\n label?: string;\n};\n\nexport type SelectItemTextProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectItemIndicatorProps = ComponentPropsWithRef<'span'> & {\n keepMounted?: boolean;\n};\n\nexport type SelectSeparatorProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectGroupProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectGroupLabelProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectScrollDownArrowProps = ComponentPropsWithRef<'div'> & {\n keepMounted?: boolean;\n};\n\nexport const SelectRootDefinition = defineComponent<SelectRootProps>({\n name: 'SelectRoot',\n importPath: '@vtex/faststore/components',\n component: SelectRoot,\n editor: { label: 'Select Root', category: 'layout' },\n schema: {\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n modal: { type: 'boolean', default: true, label: 'Modal' },\n required: { type: 'boolean', default: false, label: 'Required' },\n readOnly: { type: 'boolean', default: false, label: 'Read Only' },\n },\n guideline:\n 'Root of a select dropdown. Manages selection state, modal overlay, and form integration. Compose as: SelectRoot > (SelectLabel + SelectTrigger > (SelectValue + SelectIcon) + SelectPortal > (SelectBackdrop + SelectPositioner > SelectPopup > (SelectScrollUpArrow + SelectList > [SelectItem > (SelectItemText + SelectItemIndicator)] + SelectScrollDownArrow))). Use SelectGroup > (SelectGroupLabel + [SelectItem]) for grouped options. Set modal=false to allow interacting with background elements while open.',\n});\n\nexport const SelectLabelDefinition = defineComponent<SelectLabelProps>({\n name: 'SelectLabel',\n importPath: '@vtex/faststore/components',\n component: SelectLabel,\n editor: { label: 'Select Label', category: 'layout' },\n schema: {},\n guideline:\n 'Accessible label associated with the trigger. Always place outside Select.Trigger so screen readers announce it separately.',\n});\n\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerProps>({\n name: 'SelectTrigger',\n importPath: '@vtex/faststore/components',\n component: SelectTrigger,\n editor: { label: 'Select Trigger', category: 'action' },\n schema: {\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'Opens and closes the popup on click. Use data-open and data-placeholder CSS attributes for open-state and empty-state styling.',\n});\n\nexport const SelectValueDefinition = defineComponent<SelectValueProps>({\n name: 'SelectValue',\n importPath: '@vtex/faststore/components',\n component: SelectValue,\n editor: { label: 'Select Value', category: 'layout' },\n schema: {},\n guideline:\n \"Renders the selected item's text, or placeholder when nothing is selected. Style the placeholder state via [data-fs-select-value][data-placeholder].\",\n});\n\nexport const SelectIconDefinition = defineComponent<SelectIconProps>({\n name: 'SelectIcon',\n importPath: '@vtex/faststore/components',\n component: SelectIcon,\n editor: { label: 'Select Icon', category: 'layout' },\n schema: {},\n guideline:\n 'Decorative indicator (e.g. chevron) inside the trigger. Rotates or changes when the popup opens via data-open.',\n});\n\nexport const SelectPortalDefinition = defineComponent<SelectPortalProps>({\n name: 'SelectPortal',\n importPath: '@vtex/faststore/components',\n component: SelectPortal,\n editor: { label: 'Select Portal', category: 'layout' },\n schema: {},\n guideline:\n 'Teleports popup content to <body>. Always wrap Select.Positioner with this to avoid overflow/z-index issues.',\n});\n\nexport const SelectBackdropDefinition = defineComponent<SelectBackdropProps>({\n name: 'SelectBackdrop',\n importPath: '@vtex/faststore/components',\n component: SelectBackdrop,\n editor: { label: 'Select Backdrop', category: 'layout' },\n schema: {},\n guideline:\n 'Invisible overlay that closes the select when clicked outside. Required when modal=true to trap interaction.',\n});\n\nexport const SelectPositionerDefinition = defineComponent<SelectPositionerProps>({\n name: 'SelectPositioner',\n importPath: '@vtex/faststore/components',\n component: SelectPositioner,\n editor: { label: 'Select Positioner', category: 'layout' },\n schema: {\n side: { type: ['top', 'bottom', 'left', 'right'] as const, default: 'bottom', label: 'Side' },\n align: { type: ['start', 'center', 'end'] as const, default: 'center', label: 'Align' },\n sideOffset: { type: 'number', default: 0, label: 'Side Offset' },\n alignItemWithTrigger: { type: 'boolean', default: true, label: 'Align Item With Trigger' },\n },\n guideline:\n 'Positions the popup relative to the trigger. Use side and align to control placement; alignItemWithTrigger=true overlaps the trigger to align the selected item visually.',\n});\n\nexport const SelectScrollUpArrowDefinition = defineComponent<SelectScrollUpArrowProps>({\n name: 'SelectScrollUpArrow',\n importPath: '@vtex/faststore/components',\n component: SelectScrollUpArrow,\n editor: { label: 'Select Scroll Up Arrow', category: 'layout' },\n schema: {\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline: 'Scrolls the list upward when hovered. Appears automatically when the list overflows at the top.',\n});\n\nexport const SelectPopupDefinition = defineComponent<SelectPopupProps>({\n name: 'SelectPopup',\n importPath: '@vtex/faststore/components',\n component: SelectPopup,\n editor: { label: 'Select Popup', category: 'layout' },\n schema: {},\n guideline: 'Visible container for the select list. Apply background, shadow, and border styles here.',\n});\n\nexport const SelectArrowDefinition = defineComponent<SelectArrowProps>({\n name: 'SelectArrow',\n importPath: '@vtex/faststore/components',\n component: SelectArrow,\n editor: { label: 'Select Arrow', category: 'layout' },\n schema: {},\n guideline:\n 'Pointing arrow attached to the popup indicating the anchor. Optional — omit when not using an arrow indicator.',\n});\n\nexport const SelectListDefinition = defineComponent<SelectListProps>({\n name: 'SelectList',\n importPath: '@vtex/faststore/components',\n component: SelectList,\n editor: { label: 'Select List', category: 'layout' },\n schema: {},\n guideline: 'Scrollable container for all Select.Item elements. Apply max-height and overflow for scrolling.',\n});\n\nexport const SelectItemDefinition = defineComponent<SelectItemProps>({\n name: 'SelectItem',\n importPath: '@vtex/faststore/components',\n component: SelectItem,\n editor: { label: 'Select Item', category: 'layout' },\n schema: {\n value: { type: 'string', label: 'Value' },\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'One selectable option. Requires a unique value prop. Style selected and highlighted states via data-selected and data-highlighted attributes.',\n});\n\nexport const SelectItemTextDefinition = defineComponent<SelectItemTextProps>({\n name: 'SelectItemText',\n importPath: '@vtex/faststore/components',\n component: SelectItemText,\n editor: { label: 'Select Item Text', category: 'layout' },\n schema: {},\n guideline: 'The visible text label of an item. Base UI uses this for keyboard navigation matching.',\n});\n\nexport const SelectItemIndicatorDefinition = defineComponent<SelectItemIndicatorProps>({\n name: 'SelectItemIndicator',\n importPath: '@vtex/faststore/components',\n component: SelectItemIndicator,\n editor: { label: 'Select Item Indicator', category: 'layout' },\n schema: {\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline: 'Checkmark or indicator shown only on the selected item. Set keepMounted=true to animate in/out.',\n});\n\nexport const SelectSeparatorDefinition = defineComponent<SelectSeparatorProps>({\n name: 'SelectSeparator',\n importPath: '@vtex/faststore/components',\n component: SelectSeparator,\n editor: { label: 'Select Separator', category: 'layout' },\n schema: {},\n guideline: 'Visual divider between items or groups. Use between unrelated option groups.',\n});\n\nexport const SelectGroupDefinition = defineComponent<SelectGroupProps>({\n name: 'SelectGroup',\n importPath: '@vtex/faststore/components',\n component: SelectGroup,\n editor: { label: 'Select Group', category: 'layout' },\n schema: {},\n guideline: 'Groups related items under a shared SelectGroupLabel for semantic and visual grouping.',\n});\n\nexport const SelectGroupLabelDefinition = defineComponent<SelectGroupLabelProps>({\n name: 'SelectGroupLabel',\n importPath: '@vtex/faststore/components',\n component: SelectGroupLabel,\n editor: { label: 'Select Group Label', category: 'layout' },\n schema: {},\n guideline: 'Non-interactive label for a Select.Group. Announced by screen readers as a group name.',\n});\n\nexport const SelectScrollDownArrowDefinition = defineComponent<SelectScrollDownArrowProps>({\n name: 'SelectScrollDownArrow',\n importPath: '@vtex/faststore/components',\n component: SelectScrollDownArrow,\n editor: { label: 'Select Scroll Down Arrow', category: 'layout' },\n schema: {\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline: 'Scrolls the list downward when hovered. Appears when the list overflows at the bottom.',\n});\n\nexport function SelectRoot({\n disabled = false,\n modal = true,\n required = false,\n readOnly = false,\n children,\n ...props\n}: SelectRootProps) {\n return (\n <BaseSelect.Root {...props} disabled={disabled} modal={modal} required={required} readOnly={readOnly}>\n {children}\n </BaseSelect.Root>\n );\n}\n\nexport function SelectLabel({ className, children, ...props }: SelectLabelProps) {\n return (\n <BaseSelect.Label {...props} className={className} data-fs-select-label=\"\">\n {children}\n </BaseSelect.Label>\n );\n}\n\nexport function SelectTrigger({ disabled = false, className, children, ...props }: SelectTriggerProps) {\n return (\n <BaseSelect.Trigger {...props} disabled={disabled} className={className} data-fs-select-trigger=\"\">\n {children}\n </BaseSelect.Trigger>\n );\n}\n\nexport function SelectValue({ placeholder, className, children, ...props }: SelectValueProps) {\n return (\n <BaseSelect.Value {...props} placeholder={placeholder} className={className} data-fs-select-value=\"\">\n {children}\n </BaseSelect.Value>\n );\n}\n\nexport function SelectIcon({ className, children, ...props }: SelectIconProps) {\n return (\n <BaseSelect.Icon {...props} className={className} data-fs-select-icon=\"\">\n {children}\n </BaseSelect.Icon>\n );\n}\n\nexport function SelectPortal({ children }: SelectPortalProps) {\n return <BaseSelect.Portal>{children}</BaseSelect.Portal>;\n}\n\nexport function SelectBackdrop({ className, children, ...props }: SelectBackdropProps) {\n return (\n <BaseSelect.Backdrop {...props} className={className} data-fs-select-backdrop=\"\">\n {children}\n </BaseSelect.Backdrop>\n );\n}\n\nexport function SelectPositioner({\n side = 'bottom',\n align = 'center',\n sideOffset = 0,\n alignItemWithTrigger = true,\n className,\n children,\n ...props\n}: SelectPositionerProps) {\n return (\n <BaseSelect.Positioner\n {...props}\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className={className}\n data-fs-select-positioner=\"\"\n >\n {children}\n </BaseSelect.Positioner>\n );\n}\n\nexport function SelectScrollUpArrow({ keepMounted = false, className, children, ...props }: SelectScrollUpArrowProps) {\n return (\n <BaseSelect.ScrollUpArrow\n {...props}\n keepMounted={keepMounted}\n className={className}\n data-fs-select-scroll-up-arrow=\"\"\n >\n {children}\n </BaseSelect.ScrollUpArrow>\n );\n}\n\nexport function SelectPopup({ className, children, ...props }: SelectPopupProps) {\n return (\n <BaseSelect.Popup {...props} className={className} data-fs-select-popup=\"\">\n {children}\n </BaseSelect.Popup>\n );\n}\n\nexport function SelectArrow({ className, children, ...props }: SelectArrowProps) {\n return (\n <BaseSelect.Arrow {...props} className={className} data-fs-select-arrow=\"\">\n {children}\n </BaseSelect.Arrow>\n );\n}\n\nexport function SelectList({ className, children, ...props }: SelectListProps) {\n return (\n <BaseSelect.List {...props} className={className} data-fs-select-list=\"\">\n {children}\n </BaseSelect.List>\n );\n}\n\nexport function SelectItem({ value, disabled = false, label, className, children, ...props }: SelectItemProps) {\n return (\n <BaseSelect.Item\n {...props}\n value={value}\n disabled={disabled}\n label={label}\n className={className}\n data-fs-select-item=\"\"\n >\n {children}\n </BaseSelect.Item>\n );\n}\n\nexport function SelectItemText({ className, children, ...props }: SelectItemTextProps) {\n return (\n <BaseSelect.ItemText {...props} className={className} data-fs-select-item-text=\"\">\n {children}\n </BaseSelect.ItemText>\n );\n}\n\nexport function SelectItemIndicator({ keepMounted = false, className, children, ...props }: SelectItemIndicatorProps) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n keepMounted={keepMounted}\n className={className}\n data-fs-select-item-indicator=\"\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n}\n\nexport function SelectSeparator({ className, children, ...props }: SelectSeparatorProps) {\n return (\n <BaseSelect.Separator {...props} className={className} data-fs-select-separator=\"\">\n {children}\n </BaseSelect.Separator>\n );\n}\n\nexport function SelectGroup({ className, children, ...props }: SelectGroupProps) {\n return (\n <BaseSelect.Group {...props} className={className} data-fs-select-group=\"\">\n {children}\n </BaseSelect.Group>\n );\n}\n\nexport function SelectGroupLabel({ className, children, ...props }: SelectGroupLabelProps) {\n return (\n <BaseSelect.GroupLabel {...props} className={className} data-fs-select-group-label=\"\">\n {children}\n </BaseSelect.GroupLabel>\n );\n}\n\nexport function SelectScrollDownArrow({\n keepMounted = false,\n className,\n children,\n ...props\n}: SelectScrollDownArrowProps) {\n return (\n <BaseSelect.ScrollDownArrow\n {...props}\n keepMounted={keepMounted}\n className={className}\n data-fs-select-scroll-down-arrow=\"\"\n >\n {children}\n </BaseSelect.ScrollDownArrow>\n );\n}\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Backdrop: SelectBackdrop,\n Positioner: SelectPositioner,\n ScrollUpArrow: SelectScrollUpArrow,\n Popup: SelectPopup,\n Arrow: SelectArrow,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Separator: SelectSeparator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n ScrollDownArrow: SelectScrollDownArrow,\n};\n"],"mappings":";;;;;;AAqFA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAS;CACnD,QAAQ;EACN,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;EAC/D,OAAO;GAAE,MAAM;GAAW,SAAS;GAAM,OAAO;EAAQ;EACxD,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;EAC/D,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAY;CAClE;CACA,WACE;AACJ,CAAC;AAED,MAAa,wBAAwB,gBAAkC;CACrE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAgB,UAAU;CAAS;CACpD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ,EACN,UAAU;EAAE,MA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AEA,SAAgB,eAAe,EAAE,WAAW,UAAU,GAAG,SAA8B;CACrF,OACE,oBAACA,OAAW,UAAZ;EAAqB,GAAI;EAAkB;EAAW,4BAAyB;EAC5E;CACkB,CAAA;AAEzB;AAEA,SAAgB,oBAAoB,EAAE,cAAc,OAAO,WAAW,UAAU,GAAG,SAAmC;CACpH,OACE,oBAACA,OAAW,eAAZ;EACE,GAAI;EACS;EACF;EACX,iCAA8B;EAE7B;CACuB,CAAA;AAE9B;AAEA,SAAgB,gBAAgB,EAAE,WAAW,UAAU,GAAG,SAA+B;CACvF,OACE,oBAACA,OAAW,WAAZ;EAAsB,GAAI;EAAkB;EAAW,4BAAyB;EAC7E;CACmB,CAAA;AAE1B;AAEA,SAAgB,YAAY,EAAE,WAAW,UAAU,GAAG,SAA2B;CAC/E,OACE,oBAACA,OAAW,OAAZ;EAAkB,GAAI;EAAkB;EAAW,wBAAqB;EACrE;CACe,CAAA;AAEtB;AAEA,SAAgB,iBAAiB,EAAE,WAAW,UAAU,GAAG,SAAgC;CACzF,OACE,oBAACA,OAAW,YAAZ;EAAuB,GAAI;EAAkB;EAAW,8BAA2B;EAChF;CACoB,CAAA;AAE3B;AAEA,SAAgB,sBAAsB,EACpC,cAAc,OACd,WACA,UACA,GAAG,SAC0B;CAC7B,OACE,oBAACA,OAAW,iBAAZ;EACE,GAAI;EACS;EACF;EACX,oCAAiC;EAEhC;CACyB,CAAA;AAEhC;AAEA,MAAaC,WAAS;CACpB,MAAM;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,eAAe;CACf,OAAO;CACP,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,WAAW;CACX,OAAO;CACP,YAAY;CACZ,iBAAiB;AACnB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
2
|
+
import "../../core/dist/index.js";
|
|
3
|
+
import { ComponentPropsWithRef } from "react";
|
|
4
|
+
//#region src/particles/separator/separator.d.ts
|
|
5
|
+
export type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
6
|
+
export type SeparatorProps = ComponentPropsWithRef<'div'> & {
|
|
7
|
+
orientation?: SeparatorOrientation;
|
|
8
|
+
};
|
|
9
|
+
export declare const SeparatorDefinition: ComponentDefinition<SeparatorProps>;
|
|
10
|
+
export declare function Separator({ orientation, className, ...props }: SeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import "../../core/dist/index.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Separator } from "@base-ui/react/separator";
|
|
6
|
+
//#region src/particles/separator/separator.tsx
|
|
7
|
+
const SeparatorDefinition = defineComponent({
|
|
8
|
+
name: "Separator",
|
|
9
|
+
importPath: "@vtex/faststore/components",
|
|
10
|
+
component: Separator$1,
|
|
11
|
+
editor: {
|
|
12
|
+
label: "Separator",
|
|
13
|
+
category: "layout"
|
|
14
|
+
},
|
|
15
|
+
schema: { orientation: {
|
|
16
|
+
type: ["horizontal", "vertical"],
|
|
17
|
+
default: "horizontal",
|
|
18
|
+
label: "Orientation"
|
|
19
|
+
} },
|
|
20
|
+
guideline: "Visual divider between content sections. Use orientation='vertical' inside flex rows to create column dividers."
|
|
21
|
+
});
|
|
22
|
+
function Separator$1({ orientation = "horizontal", className, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
24
|
+
...props,
|
|
25
|
+
orientation,
|
|
26
|
+
className,
|
|
27
|
+
"data-fs-separator": ""
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { Separator$1 as Separator, SeparatorDefinition };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","names":["Separator","BaseSeparator"],"sources":["../../../src/particles/separator/separator.tsx"],"sourcesContent":["'use client';\nimport { Separator as BaseSeparator } from '@base-ui/react/separator';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\n\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\nexport type SeparatorProps = ComponentPropsWithRef<'div'> & {\n orientation?: SeparatorOrientation;\n};\n\nexport const SeparatorDefinition = defineComponent<SeparatorProps>({\n name: 'Separator',\n importPath: '@vtex/faststore/components',\n component: Separator,\n editor: { label: 'Separator', category: 'layout' },\n schema: {\n orientation: { type: ['horizontal', 'vertical'] as const, default: 'horizontal', label: 'Orientation' },\n },\n guideline:\n \"Visual divider between content sections. Use orientation='vertical' inside flex rows to create column dividers.\",\n});\n\nexport function Separator({ orientation = 'horizontal', className, ...props }: SeparatorProps) {\n return <BaseSeparator {...props} orientation={orientation} className={className} data-fs-separator=\"\" />;\n}\n"],"mappings":";;;;;;AAWA,MAAa,sBAAsB,gBAAgC;CACjE,MAAM;CACN,YAAY;CACZ,WAAWA;CACX,QAAQ;EAAE,OAAO;EAAa,UAAU;CAAS;CACjD,QAAQ,EACN,aAAa;EAAE,MAAM,CAAC,cAAc,UAAU;EAAY,SAAS;EAAc,OAAO;CAAc,EACxG;CACA,WACE;AACJ,CAAC;AAED,SAAgBA,YAAU,EAAE,cAAc,cAAc,WAAW,GAAG,SAAyB;CAC7F,OAAO,oBAACC,WAAD;EAAe,GAAI;EAAoB;EAAwB;EAAW,qBAAkB;CAAI,CAAA;AACzG"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//#region src/particles/shared/input-mask.ts
|
|
2
|
+
const DIGIT = "9";
|
|
3
|
+
const ALPHA = "A";
|
|
4
|
+
const ALPHANUM = "S";
|
|
5
|
+
const ALL = "*";
|
|
6
|
+
function escapeToken(text) {
|
|
7
|
+
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
8
|
+
}
|
|
9
|
+
function matchToken(char, token) {
|
|
10
|
+
switch (token) {
|
|
11
|
+
case DIGIT: return /[0-9]/.test(char);
|
|
12
|
+
case ALPHA: return /[A-ú]/.test(char);
|
|
13
|
+
case ALPHANUM: return /[A-ú0-9]/.test(char);
|
|
14
|
+
case ALL: return true;
|
|
15
|
+
default: return new RegExp(escapeToken(token)).test(char);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** True when `char` is a fillable slot token rather than a literal separator. */
|
|
19
|
+
function isSlotToken(char) {
|
|
20
|
+
return char === DIGIT || char === ALPHA || char === ALPHANUM || char === ALL;
|
|
21
|
+
}
|
|
22
|
+
/** Number of fillable slots (`9` | `A` | `S` | `*`) in a single mask. */
|
|
23
|
+
function countSlots(mask) {
|
|
24
|
+
return mask.split("").filter(isSlotToken).length;
|
|
25
|
+
}
|
|
26
|
+
function selectMask(rawValue, masks) {
|
|
27
|
+
const inputLength = rawValue.length;
|
|
28
|
+
const sorted = [...masks].sort((a, b) => countSlots(a) - countSlots(b));
|
|
29
|
+
return sorted.find((m) => inputLength <= countSlots(m)) ?? sorted[sorted.length - 1] ?? "";
|
|
30
|
+
}
|
|
31
|
+
function applySimpleMask(value, mask) {
|
|
32
|
+
let result = value;
|
|
33
|
+
for (let i = 0; i < result.length; i++) {
|
|
34
|
+
const valueToken = result.charAt(i);
|
|
35
|
+
const maskToken = mask.charAt(i);
|
|
36
|
+
if (maskToken && matchToken(valueToken, maskToken)) continue;
|
|
37
|
+
if (maskToken === " " || /\W/.test(maskToken)) {
|
|
38
|
+
const firstPart = result.slice(0, i);
|
|
39
|
+
const secondPart = result.slice(i);
|
|
40
|
+
result = applySimpleMask(firstPart + maskToken + secondPart, mask);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
/** Weave a mask's literal separators into `value` (progressive; never blocks typing). */
|
|
47
|
+
function applyMask(value, mask) {
|
|
48
|
+
if (mask.includes("|")) return applySimpleMask(value, selectMask(value, mask.split("|")));
|
|
49
|
+
return applySimpleMask(value, mask);
|
|
50
|
+
}
|
|
51
|
+
/** True when every fillable slot takes digits only — strip non-digits + hint numeric input. */
|
|
52
|
+
function isDigitOnly(mask) {
|
|
53
|
+
return [...mask].filter(isSlotToken).every((token) => token === DIGIT);
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { applyMask, countSlots, isDigitOnly, isSlotToken };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=input-mask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-mask.js","names":[],"sources":["../../../src/particles/shared/input-mask.ts"],"sourcesContent":["// Ported input mask (fastcheckout `packages/libs/input-mask/src/input-mask.ts`).\n// A mask string is a template of slot tokens (`9` digit, `A` alpha, `S` alphanumeric, `*` any)\n// interleaved with literal separators; `applyMask` weaves the literals into the raw value as the\n// shopper types. A pipe-delimited mask (`maskA|maskB`) selects the shortest mask that still fits the\n// current input length, letting one field cover multiple formats.\n//\n// Two limits carried over from the source, kept for parity: the `A`/`S` classes span `[A-ú]`, so they\n// also admit the ASCII punctuation between the letter ranges (`_`, `[`, `~`); and only non-word\n// literals are woven in, so a mask like `AA_999` never inserts its `_`. Neither is reachable through\n// the masks in use — postal formats separate with a space or a hyphen and CPF is digit-only.\n\nconst DIGIT = '9';\nconst ALPHA = 'A';\nconst ALPHANUM = 'S';\nconst ALL = '*';\n\nfunction escapeToken(text: string): string {\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\n\nfunction matchToken(char: string, token: string): boolean {\n switch (token) {\n case DIGIT:\n return /[0-9]/.test(char);\n case ALPHA:\n return /[A-ú]/.test(char);\n case ALPHANUM:\n return /[A-ú0-9]/.test(char);\n case ALL:\n return true;\n default:\n return new RegExp(escapeToken(token)).test(char);\n }\n}\n\n/** True when `char` is a fillable slot token rather than a literal separator. */\nexport function isSlotToken(char: string): boolean {\n return char === DIGIT || char === ALPHA || char === ALPHANUM || char === ALL;\n}\n\n/** Number of fillable slots (`9` | `A` | `S` | `*`) in a single mask. */\nexport function countSlots(mask: string): number {\n return mask.split('').filter(isSlotToken).length;\n}\n\nfunction selectMask(rawValue: string, masks: string[]): string {\n const inputLength = rawValue.length;\n const sorted = [...masks].sort((a, b) => countSlots(a) - countSlots(b));\n return sorted.find((m) => inputLength <= countSlots(m)) ?? sorted[sorted.length - 1] ?? '';\n}\n\nfunction applySimpleMask(value: string, mask: string): string {\n let result = value;\n for (let i = 0; i < result.length; i++) {\n const valueToken = result.charAt(i);\n const maskToken = mask.charAt(i);\n\n if (maskToken && matchToken(valueToken, maskToken)) {\n continue;\n }\n\n if (maskToken === ' ' || /\\W/.test(maskToken)) {\n const firstPart = result.slice(0, i);\n const secondPart = result.slice(i);\n result = applySimpleMask(firstPart + maskToken + secondPart, mask);\n break;\n }\n }\n\n return result;\n}\n\n/** Weave a mask's literal separators into `value` (progressive; never blocks typing). */\nexport function applyMask(value: string, mask: string): string {\n if (mask.includes('|')) {\n const masks = mask.split('|');\n return applySimpleMask(value, selectMask(value, masks));\n }\n return applySimpleMask(value, mask);\n}\n\n/** True when every fillable slot takes digits only — strip non-digits + hint numeric input. */\nexport function isDigitOnly(mask: string): boolean {\n return [...mask].filter(isSlotToken).every((token) => token === DIGIT);\n}\n"],"mappings":";AAWA,MAAM,QAAQ;AACd,MAAM,QAAQ;AACd,MAAM,WAAW;AACjB,MAAM,MAAM;AAEZ,SAAS,YAAY,MAAsB;CACzC,OAAO,KAAK,QAAQ,4BAA4B,MAAM;AACxD;AAEA,SAAS,WAAW,MAAc,OAAwB;CACxD,QAAQ,OAAR;EACE,KAAK,OACH,OAAO,QAAQ,KAAK,IAAI;EAC1B,KAAK,OACH,OAAO,QAAQ,KAAK,IAAI;EAC1B,KA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AAG,IAAI,CAAC,CAAC,OAAO,WAAW,CAAC,CAAC,OAAO,UAAU,UAAU,KAAK;AACvE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
2
|
+
import "../../core/dist/index.js";
|
|
3
|
+
import { ComponentPropsWithRef } from "react";
|
|
4
|
+
//#region src/particles/spinner/spinner.d.ts
|
|
5
|
+
/** Props for {@link Spinner}. Extends all native `<output>` attributes. */
|
|
6
|
+
export type SpinnerProps = Omit<ComponentPropsWithRef<'output'>, 'children'> & {
|
|
7
|
+
/** Accessible label. Defaults to `'Loading'`. */
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const SpinnerDefinition: ComponentDefinition<SpinnerProps>;
|
|
11
|
+
export declare function Spinner({ label, className, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
//# sourceMappingURL=spinner.d.ts.map
|