@artisanpack-ui/ecommerce-storefront-react 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +67 -2
- package/dist/Addresses-D3ESHG3L.mjs +27 -0
- package/dist/Addresses-D3ESHG3L.mjs.map +1 -0
- package/dist/CategoryShow-OAGROEMA.mjs +12 -0
- package/dist/CategoryShow-OAGROEMA.mjs.map +1 -0
- package/dist/Claim-CJ4UOAUD.mjs +22 -0
- package/dist/Claim-CJ4UOAUD.mjs.map +1 -0
- package/dist/Confirmation-TLMMBPWS.mjs +20 -0
- package/dist/Confirmation-TLMMBPWS.mjs.map +1 -0
- package/dist/Dashboard-ARXORMTL.mjs +24 -0
- package/dist/Dashboard-ARXORMTL.mjs.map +1 -0
- package/dist/Downloads-CEQBY7JO.mjs +25 -0
- package/dist/Downloads-CEQBY7JO.mjs.map +1 -0
- package/dist/Index-KRR3Q7EJ.mjs +12 -0
- package/dist/Index-KRR3Q7EJ.mjs.map +1 -0
- package/dist/Index-RLQFEBTX.mjs +22 -0
- package/dist/Index-RLQFEBTX.mjs.map +1 -0
- package/dist/Index-WDJYGR5Q.mjs +12 -0
- package/dist/Index-WDJYGR5Q.mjs.map +1 -0
- package/dist/Index-XYU5QLUT.mjs +23 -0
- package/dist/Index-XYU5QLUT.mjs.map +1 -0
- package/dist/Lookup-QNUQKUID.mjs +19 -0
- package/dist/Lookup-QNUQKUID.mjs.map +1 -0
- package/dist/OrderShow-RYTP62YA.mjs +27 -0
- package/dist/OrderShow-RYTP62YA.mjs.map +1 -0
- package/dist/Orders-LZW57GE6.mjs +25 -0
- package/dist/Orders-LZW57GE6.mjs.map +1 -0
- package/dist/Profile-ZAAWFCAL.mjs +25 -0
- package/dist/Profile-ZAAWFCAL.mjs.map +1 -0
- package/dist/Show-LFWUO3KR.mjs +14 -0
- package/dist/Show-LFWUO3KR.mjs.map +1 -0
- package/dist/TagShow-FXKXRGY2.mjs +12 -0
- package/dist/TagShow-FXKXRGY2.mjs.map +1 -0
- package/dist/chunk-5UUNH3EH.mjs +1888 -0
- package/dist/chunk-5UUNH3EH.mjs.map +1 -0
- package/dist/chunk-A3MMQ2RY.mjs +183 -0
- package/dist/chunk-A3MMQ2RY.mjs.map +1 -0
- package/dist/chunk-ABGPTZ3Q.mjs +198 -0
- package/dist/chunk-ABGPTZ3Q.mjs.map +1 -0
- package/dist/chunk-BJ3FJFZQ.mjs +32 -0
- package/dist/chunk-BJ3FJFZQ.mjs.map +1 -0
- package/dist/chunk-BSASRFQ7.mjs +89 -0
- package/dist/chunk-BSASRFQ7.mjs.map +1 -0
- package/dist/chunk-CGCW3555.mjs +148 -0
- package/dist/chunk-CGCW3555.mjs.map +1 -0
- package/dist/chunk-DWR23FJD.mjs +643 -0
- package/dist/chunk-DWR23FJD.mjs.map +1 -0
- package/dist/chunk-ENY3MH2W.mjs +148 -0
- package/dist/chunk-ENY3MH2W.mjs.map +1 -0
- package/dist/chunk-EWJLRWPO.mjs +280 -0
- package/dist/chunk-EWJLRWPO.mjs.map +1 -0
- package/dist/chunk-FL5XL3ET.mjs +212 -0
- package/dist/chunk-FL5XL3ET.mjs.map +1 -0
- package/dist/chunk-FOOP6UK3.mjs +218 -0
- package/dist/chunk-FOOP6UK3.mjs.map +1 -0
- package/dist/chunk-HCC7GTVO.mjs +115 -0
- package/dist/chunk-HCC7GTVO.mjs.map +1 -0
- package/dist/chunk-HXZMY3GE.mjs +2331 -0
- package/dist/chunk-HXZMY3GE.mjs.map +1 -0
- package/dist/chunk-IOL2YQ62.mjs +109 -0
- package/dist/chunk-IOL2YQ62.mjs.map +1 -0
- package/dist/chunk-JH7SFSZA.mjs +104 -0
- package/dist/chunk-JH7SFSZA.mjs.map +1 -0
- package/dist/chunk-JJOPX4PI.mjs +205 -0
- package/dist/chunk-JJOPX4PI.mjs.map +1 -0
- package/dist/chunk-LT3GG7YQ.mjs +32 -0
- package/dist/chunk-LT3GG7YQ.mjs.map +1 -0
- package/dist/chunk-MZFULGDI.mjs +267 -0
- package/dist/chunk-MZFULGDI.mjs.map +1 -0
- package/dist/chunk-O4WPMMSH.mjs +58 -0
- package/dist/chunk-O4WPMMSH.mjs.map +1 -0
- package/dist/chunk-OU3WYFIH.mjs +397 -0
- package/dist/chunk-OU3WYFIH.mjs.map +1 -0
- package/dist/chunk-P3NIV4YG.mjs +998 -0
- package/dist/chunk-P3NIV4YG.mjs.map +1 -0
- package/dist/chunk-PEBBSZ5R.mjs +201 -0
- package/dist/chunk-PEBBSZ5R.mjs.map +1 -0
- package/dist/chunk-T5OWL6EG.mjs +73 -0
- package/dist/chunk-T5OWL6EG.mjs.map +1 -0
- package/dist/chunk-THPUK35U.mjs +132 -0
- package/dist/chunk-THPUK35U.mjs.map +1 -0
- package/dist/chunk-TPOKMH5E.mjs +142 -0
- package/dist/chunk-TPOKMH5E.mjs.map +1 -0
- package/dist/chunk-VX5TEJNU.mjs +1898 -0
- package/dist/chunk-VX5TEJNU.mjs.map +1 -0
- package/dist/chunk-WUL34MB2.mjs +268 -0
- package/dist/chunk-WUL34MB2.mjs.map +1 -0
- package/dist/chunk-WYGOMIZK.mjs +140 -0
- package/dist/chunk-WYGOMIZK.mjs.map +1 -0
- package/dist/chunk-Y2IOBBN7.mjs +127 -0
- package/dist/chunk-Y2IOBBN7.mjs.map +1 -0
- package/dist/chunk-Y5BRPEHA.mjs +54 -0
- package/dist/chunk-Y5BRPEHA.mjs.map +1 -0
- package/dist/index.d.ts +4607 -0
- package/dist/index.mjs +1515 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +112 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/pages/Product/Show.tsx","../src/components/Gallery.tsx","../src/internal/portal.tsx","../src/product/forms/BundledForm.tsx","../src/product/AddToCart.tsx","../src/product/PurchaseFormContext.tsx","../src/product/forms/DigitalForm.tsx","../src/product/forms/GroupedForm.tsx","../src/product/forms/OptionsForm.tsx","../src/components/ChoiceCards.tsx","../src/product/forms/SimpleForm.tsx","../src/product/forms/VariableForm.tsx","../src/product/forms/registerProductForms.ts","../src/product/sections/RecentlyViewed.tsx","../src/product/sections/Reviews.tsx","../src/components/RatingInput.tsx","../src/internal/icon.tsx","../src/product/sections/SoldOutNotice.tsx","../src/product/sections/registerProductSections.ts","../src/product/builtIns.ts","../src/product/StorefrontSections.tsx"],"sourcesContent":["/**\n * `EcommerceStorefront/Product/Show`: the product page.\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/show`: the\n * breadcrumbs, the gallery beside the summary (category, name, rating,\n * price, short description, stock and SKU, the purchase form, the sold-out\n * notice and the highlights), the \"Product details\" accordion, then the\n * page's sections (reviews, upsells, related products) from the\n * `productSections` registry.\n *\n * The purchase form comes from the `productForms` registry under\n * `form.component`, so a satellite's product type draws its own form.\n *\n * @since 1.0.0\n */\n\nimport { __, type ProductShowProps } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Accordion, AccordionItem, Alert, Breadcrumbs, Icon } from '@artisanpack-ui/react';\nimport { useEffect, useMemo, useRef, type ReactElement } from 'react';\n\nimport { GALLERY_SHOW_EVENT, Gallery } from '../../components/Gallery';\nimport { Price } from '../../components/Price';\nimport { RatingSummary } from '../../components/RatingSummary';\nimport { StockStatus } from '../../components/StockStatus';\nimport { storefrontLayout } from '../../layout/StorefrontLayout';\nimport { registerProductBuiltIns } from '../../product/builtIns';\nimport { PurchaseFormContext } from '../../product/PurchaseFormContext';\nimport { StorefrontSections } from '../../product/StorefrontSections';\nimport { getRegistries } from '../../registries';\n\nregisterProductBuiltIns();\n\n/**\n * The product page.\n *\n * @since 1.0.0\n *\n * @param props - The page's props.\n * @returns The page.\n */\nexport default function ProductShow({\n product,\n variantId,\n gallery,\n price,\n stock,\n shortDescription,\n description,\n specifications,\n shippingReturns,\n category,\n breadcrumbs,\n highlights,\n form,\n soldOut,\n sections,\n feedback,\n}: ProductShowProps): ReactElement {\n const registries = getRegistries();\n const nameId = `ec-product-${product.id}-name`;\n const detailsId = `ec-product-${product.id}-details`;\n const scope = `product-${product.id}`;\n const Form = null === form ? undefined : registries.productForms.get(form.component)?.component;\n const SoldOut =\n null === soldOut ? undefined : registries.productSections.get(soldOut.component)?.component;\n const shownImage = useRef(gallery.active);\n const formContext = useMemo(\n () => ({\n productName: product.name,\n productUrl: product.url,\n variantId,\n announcement: feedback.announcement,\n notifySubscribed: feedback.notifySubscribed,\n }),\n [product.name, product.url, variantId, feedback.announcement, feedback.notifySubscribed],\n );\n\n // A variant change reloads the gallery with that variant's image active;\n // the gallery keeps its own state across the visit, so tell it, as the\n // Livewire page dispatches `ecommerce-gallery-show`.\n useEffect(() => {\n if (shownImage.current === gallery.active) {\n return;\n }\n\n shownImage.current = gallery.active;\n\n const image = gallery.items[gallery.active];\n\n if (undefined !== image) {\n window.dispatchEvent(\n new CustomEvent(GALLERY_SHOW_EVENT, { detail: { scope, url: image.url } }),\n );\n }\n }, [gallery, scope]);\n\n return (\n <article className=\"ec-product\" aria-labelledby={nameId} data-product-page={product.id}>\n {breadcrumbs.length > 1 ? (\n <Breadcrumbs\n items={breadcrumbs.map((crumb) => ({\n label: crumb.label,\n ...(null !== crumb.url ? { href: crumb.url } : {}),\n }))}\n label={__('Breadcrumb')}\n />\n ) : null}\n\n <div className=\"ec-product__top\">\n <Gallery\n items={gallery.items}\n name={gallery.name}\n active={gallery.active}\n thumbnails={gallery.thumbnails}\n zoom={gallery.zoom}\n scope={scope}\n />\n\n <div className=\"ec-product__summary\" data-product-summary=\"\">\n {null !== category ? (\n null !== category.url ? (\n <a href={category.url} className=\"ec-product__category\" data-product-category=\"\">\n {category.name}\n </a>\n ) : (\n <p className=\"ec-product__category\" data-product-category=\"\">\n {category.name}\n </p>\n )\n ) : null}\n\n <h1 id={nameId} className=\"ec-product__name\">\n {product.name}\n </h1>\n\n <RatingSummary rating={product.rating} />\n\n <Price price={price} size=\"lg\" data-product-price=\"\" />\n\n {null !== shortDescription ? (\n <div\n className=\"apui-prose ec-product__short-description\"\n data-product-short-description=\"\"\n dangerouslySetInnerHTML={{ __html: shortDescription }}\n />\n ) : null}\n\n <div className=\"ec-product__meta\">\n <StockStatus stock={stock} data-product-stock=\"\" />\n\n {null !== product.sku && '' !== product.sku ? (\n <p className=\"ec-product__sku\" data-product-sku=\"\">\n {__('SKU')} <code>{product.sku}</code>\n </p>\n ) : null}\n </div>\n\n <div className=\"ec-product__purchase\">\n {null !== form ? (\n undefined !== Form ? (\n <PurchaseFormContext.Provider value={formContext}>\n <Form key={`${form.component}-${product.id}`} {...form.props} />\n </PurchaseFormContext.Provider>\n ) : null\n ) : (\n <Alert\n icon=\"info\"\n title={__(\"This product can't be purchased online\")}\n data-product-unavailable=\"\"\n />\n )}\n\n {undefined !== SoldOut ? <SoldOut productId={product.id} /> : null}\n </div>\n\n {highlights.length > 0 ? (\n <ul\n role=\"list\"\n className=\"apui-card ec-product__highlights\"\n data-surface=\"default\"\n data-product-highlights=\"\"\n >\n {highlights.map((highlight) => (\n <li key={highlight.title} className=\"ec-product__highlight\">\n <Icon\n name={highlight.icon}\n className=\"ec-product__highlight-icon\"\n aria-hidden=\"true\"\n />\n <span>\n <span className=\"ec-product__highlight-title\">{highlight.title}</span>\n {null !== highlight.description ? (\n <span className=\"ec-product__highlight-description\">\n {highlight.description}\n </span>\n ) : null}\n </span>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n </div>\n\n {null !== description || specifications.length > 0 || null !== shippingReturns ? (\n <section\n className=\"ec-product__details\"\n aria-labelledby={detailsId}\n data-product-details=\"\"\n >\n <h2 id={detailsId} className=\"ec-product__section-title\">\n {__('Product details')}\n </h2>\n\n <Accordion defaultValue={['description']} collapsible className=\"ec-product__accordion\">\n {null !== description ? (\n <AccordionItem\n value=\"description\"\n title={__('Description')}\n data-details-section=\"description\"\n >\n <div className=\"apui-prose\" dangerouslySetInnerHTML={{ __html: description }} />\n </AccordionItem>\n ) : null}\n\n {specifications.length > 0 ? (\n <AccordionItem\n value=\"specifications\"\n title={__('Specifications')}\n data-details-section=\"specifications\"\n >\n <div className=\"apui-table ec-product__specs\" data-density=\"compact\">\n <div data-scope=\"table\" data-part=\"scroll\">\n <table data-scope=\"table\" data-part=\"table\">\n <caption className=\"apui-sr-only\">{__('Specifications')}</caption>\n <tbody>\n {specifications.map((row) => (\n <tr key={row.label} data-scope=\"table\" data-part=\"row\">\n <th scope=\"row\">{row.label}</th>\n <td>{row.value}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n </AccordionItem>\n ) : null}\n\n {null !== shippingReturns ? (\n <AccordionItem\n value=\"shipping\"\n title={__('Shipping & returns')}\n data-details-section=\"shipping\"\n >\n <div className=\"apui-prose\" dangerouslySetInnerHTML={{ __html: shippingReturns }} />\n </AccordionItem>\n ) : null}\n </Accordion>\n </section>\n ) : null}\n\n <StorefrontSections\n sections={sections}\n registry=\"productSections\"\n extra={{ productId: product.id, reviewSubmitted: feedback.reviewSubmitted }}\n />\n </article>\n );\n}\n\nProductShow.layout = storefrontLayout;\n","/**\n * `ec-gallery`: a product's images, with thumbnails, a counter and a zoom\n * lightbox.\n *\n * Mirrors ecommerce-storefront-livewire's `<x-artisanpack-ec-gallery>`. The\n * stage shows one image; a thumbnail shows another and a polite live region\n * announces it. The lightbox is the behavior engine's (`useLightbox`), so\n * its focus trap, keys and parts match the design system's ImageGallery.\n *\n * A variant change can bring up its image with a window event, as in\n * Livewire: `ecommerce-gallery-show` with `{ url, scope }`.\n *\n * @since 1.0.0\n */\n\nimport { useLightbox } from '@artisanpack-ui/behavior/react';\nimport { __, type StorefrontGalleryItem } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Badge, Button, Icon } from '@artisanpack-ui/react';\nimport { useEffect, useId, useRef, useState, type ReactElement } from 'react';\n\nimport { cx } from '../internal/classes';\nimport { Portal } from '../internal/portal';\n\n/**\n * Props for {@link Gallery}.\n *\n * @since 1.0.0\n */\nexport interface GalleryProps {\n /** The images. */\n items: StorefrontGalleryItem[];\n /** The product's name, for the region's label and the lightbox title. */\n name: string;\n /** The image shown first, 0-based. */\n active?: number;\n /** Where the thumbnails go. Default `bottom`. */\n thumbnails?: 'bottom' | 'start' | 'end' | 'none';\n /** Offers the zoom lightbox. Default true. */\n zoom?: boolean;\n /** Only `ecommerce-gallery-show` events with this scope change the image. */\n scope?: string | null;\n /** The root id; the lightbox parts' ids start with it. */\n id?: string;\n className?: string;\n}\n\n/**\n * The event that brings up an image by URL.\n *\n * @since 1.0.0\n */\nexport const GALLERY_SHOW_EVENT = 'ecommerce-gallery-show';\n\n/**\n * A product image gallery.\n *\n * @since 1.0.0\n *\n * @param props - The images and options.\n * @returns The gallery.\n */\nexport function Gallery({\n items,\n name,\n active: initial = 0,\n thumbnails = 'bottom',\n zoom = true,\n scope = null,\n id,\n className,\n}: GalleryProps): ReactElement {\n const generated = `ec-gallery-${useId().replace(/[^A-Za-z0-9_-]/g, '')}`;\n const baseId = id ?? generated;\n const count = items.length;\n const [active, setActive] = useState(Math.max(0, Math.min(initial, count - 1)));\n const [announcement, setAnnouncement] = useState('');\n const [open, setOpen] = useState(false);\n const [layerDir, setLayerDir] = useState<string | undefined>(undefined);\n const root = useRef<HTMLDivElement>(null);\n\n const show = (index: number): void => {\n const next = (index + count) % count;\n const item = items[next];\n\n setActive(next);\n setAnnouncement(\n __('Image :number of :total: :alt', {\n number: next + 1,\n total: count,\n alt: item?.alt ?? '',\n }),\n );\n };\n\n useEffect(() => {\n const listener = (event: Event): void => {\n const detail = (event as CustomEvent<{ url?: string; scope?: string | null }>).detail ?? {};\n\n if (null !== scope && detail.scope !== scope) {\n return;\n }\n\n const index = items.findIndex((item) => item.url === detail.url || item.full === detail.url);\n\n if (index >= 0) {\n show(index);\n }\n };\n\n window.addEventListener(GALLERY_SHOW_EVENT, listener);\n\n return () => window.removeEventListener(GALLERY_SHOW_EVENT, listener);\n });\n\n const lightbox = useLightbox({\n id: baseId,\n count: Math.max(1, count),\n open,\n onOpenChange: ({ open: next }) => setOpen(next),\n index: active,\n onIndexChange: ({ index }) => {\n if (open) {\n setActive(Math.min(Math.max(index, 0), count - 1));\n }\n },\n modal: true,\n });\n\n if (0 === count) {\n return (\n <div className={cx('ec-gallery', 'ec-gallery--empty', className)} data-gallery=\"empty\">\n <Icon name=\"image\" aria-hidden=\"true\" />\n <span className=\"apui-sr-only\">{__('No image available')}</span>\n </div>\n );\n }\n\n const current = items[active] ?? items[0]!;\n const zoomLabel =\n '' !== current.alt ? __('Zoom image: :alt', { alt: current.alt }) : __('Zoom image');\n const counter = __(':index / :count', { index: active + 1, count });\n // The lightbox renders at the end of the body: give it the gallery's\n // direction, so its arrow keys follow the text.\n const zoomIn = (): void => {\n if (null !== root.current) {\n setLayerDir(getComputedStyle(root.current).direction);\n }\n\n setOpen(true);\n };\n\n return (\n <div\n ref={root}\n className={cx('ec-gallery', className)}\n id={baseId}\n role=\"region\"\n aria-roledescription={__('gallery')}\n aria-label={__(':name images', { name })}\n data-gallery=\"\"\n data-gallery-thumbnails={thumbnails}\n >\n <div className=\"ec-gallery__layout\">\n <div className=\"ec-gallery__stage\" data-gallery-stage=\"\">\n {items.map((item, index) => (\n <img\n key={item.key}\n src={item.url}\n srcSet={item.srcset ?? undefined}\n sizes={null !== item.srcset ? '(min-width: 1024px) 50vw, 100vw' : undefined}\n width={item.width ?? 1200}\n height={item.height ?? 1200}\n alt={item.alt}\n loading={index !== initial ? 'lazy' : undefined}\n style={index !== active ? { display: 'none' } : undefined}\n decoding=\"async\"\n className=\"ec-gallery__image\"\n onClick={zoom ? zoomIn : undefined}\n data-gallery-image={index}\n />\n ))}\n\n {count > 1 ? (\n <Badge\n variant=\"solid\"\n color=\"neutral\"\n className=\"ec-gallery__counter\"\n aria-hidden=\"true\"\n data-gallery-counter=\"\"\n >\n <span>{counter}</span>\n </Badge>\n ) : null}\n\n {zoom ? (\n <Button\n variant=\"solid\"\n color=\"neutral\"\n size=\"sm\"\n leadingIcon=\"zoom-in\"\n className=\"ec-gallery__zoom\"\n aria-haspopup=\"dialog\"\n aria-label={zoomLabel}\n onClick={zoomIn}\n data-gallery-zoom=\"\"\n >\n {__('Zoom')}\n </Button>\n ) : null}\n </div>\n\n <p\n className=\"apui-sr-only\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-gallery-announcement=\"\"\n >\n {announcement}\n </p>\n\n {count > 1 && 'none' !== thumbnails ? (\n <ul role=\"list\" className=\"ec-gallery__thumbnails\" aria-label={__('Thumbnails')}>\n {items.map((item, index) => (\n <li key={item.key}>\n <button\n type=\"button\"\n className=\"ec-gallery__thumbnail\"\n aria-current={index === active ? 'true' : undefined}\n onClick={() => show(index)}\n aria-label={__('Image :number of :total: :alt', {\n number: index + 1,\n total: count,\n alt: item.alt,\n })}\n data-gallery-thumbnail={index}\n >\n <img\n src={item.url}\n srcSet={item.srcset ?? undefined}\n sizes={null !== item.srcset ? '128px' : undefined}\n width={128}\n height={128}\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </button>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n\n {zoom ? (\n <Portal>\n <div\n id={`${baseId}-layer`}\n className=\"ec-gallery__layer\"\n dir={layerDir}\n data-gallery-lightbox=\"\"\n >\n <div {...lightbox.getBackdropProps()} />\n <div {...lightbox.getPositionerProps()}>\n <div {...lightbox.getContentProps()} className=\"apui-lightbox\">\n <div data-scope=\"image-gallery\" data-part=\"bar\" id={`${baseId}-bar`}>\n <h2 {...lightbox.getTitleProps()} aria-live=\"polite\">\n {`${counter} · ${name}`}\n </h2>\n <Button\n {...lightbox.getCloseTriggerProps()}\n variant=\"ghost\"\n color=\"neutral\"\n size=\"sm\"\n iconOnly\n leadingIcon=\"x\"\n aria-label={__('Close')}\n />\n </div>\n <div data-scope=\"image-gallery\" data-part=\"stage\" id={`${baseId}-stage`}>\n <img {...lightbox.getImageProps()} src={current.full} alt={current.alt} />\n <Button\n {...lightbox.getPrevTriggerProps()}\n variant=\"soft\"\n color=\"neutral\"\n iconOnly\n leadingIcon=\"chevron-left\"\n aria-label={__('Previous image')}\n disabled={count < 2}\n />\n <Button\n {...lightbox.getNextTriggerProps()}\n variant=\"soft\"\n color=\"neutral\"\n iconOnly\n leadingIcon=\"chevron-right\"\n aria-label={__('Next image')}\n disabled={count < 2}\n />\n </div>\n {count > 1 ? (\n <div\n data-scope=\"image-gallery\"\n data-part=\"thumbs\"\n id={`${baseId}-thumbs`}\n role=\"group\"\n aria-label={__('Thumbnails')}\n >\n {items.map((item, index) => (\n <button\n key={item.key}\n type=\"button\"\n {...lightbox.getThumbProps({ index })}\n aria-label={__('Image :number of :total: :alt', {\n number: index + 1,\n total: count,\n alt: item.alt,\n })}\n >\n <img src={item.url} alt=\"\" loading=\"lazy\" decoding=\"async\" />\n </button>\n ))}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </Portal>\n ) : null}\n </div>\n );\n}\n","/**\n * Renders overlay parts at the end of `document.body` on the client, as the\n * design system's overlays do; nothing on the server or while hydrating.\n *\n * @internal\n */\n\nimport { useSyncExternalStore, type ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\n\nconst subscribe = () => () => {};\n\n/**\n * Whether the component renders on the client after hydration.\n *\n * @internal\n *\n * @returns True on the client.\n */\nexport function useIsClient(): boolean {\n return useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n );\n}\n\n/**\n * The children, portalled to the body on the client.\n *\n * @internal\n *\n * @param props - The children.\n * @returns The portal, or nothing before mount.\n */\nexport function Portal({ children }: { children: ReactNode }) {\n const isClient = useIsClient();\n\n return isClient ? createPortal(children, document.body) : null;\n}\n","/**\n * The `bundled` purchase form: the set's contents, its total and saving.\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/forms/bundled`.\n *\n * @since 1.0.0\n */\n\nimport { __, type StorefrontBundledFormProps } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Badge, Checkbox } from '@artisanpack-ui/react';\nimport { useState, type ReactElement } from 'react';\n\nimport { useStorefront } from '../../useStorefront';\nimport { AddToCart } from '../AddToCart';\nimport { usePurchaseFormContext } from '../PurchaseFormContext';\nimport { PURCHASE_ERROR_BAG, linePrice, useStorefrontPost } from '../support';\n\n/**\n * The bundled purchase form.\n *\n * @since 1.0.0\n *\n * @param props - The form's props.\n * @returns The form.\n */\nexport function BundledForm(props: StorefrontBundledFormProps): ReactElement {\n const formId = `ec-product-${props.productId}`;\n const { locale } = useStorefront();\n const { buttonText = null } = usePurchaseFormContext();\n const [quantity, setQuantity] = useState<number | null>(props.quantity);\n const { post, processing } = useStorefrontPost(PURCHASE_ERROR_BAG);\n const sets = null === quantity || quantity < 1 ? 1 : quantity;\n const total = linePrice(props.total, sets, locale);\n const saving = linePrice(props.saving, sets, locale);\n\n return (\n <div className=\"ec-purchase-form\" data-purchase-form=\"bundled\">\n {0 < props.items.length ? (\n <fieldset className=\"ec-bundle-items\" data-bundle-items=\"\">\n <legend className=\"ec-bundle-items__legend\">{__('In this set')}</legend>\n\n <div className=\"ec-bundle-items__list\">\n {props.items.map((item) => (\n <Checkbox\n key={item.id}\n id={`${formId}-bundle-item-${item.id}`}\n label={\n 1 === item.quantity\n ? item.name\n : __(':quantity × :name', { quantity: item.quantity, name: item.name })\n }\n description={__('Included')}\n checked\n disabled\n readOnly\n data-bundle-item={item.id}\n />\n ))}\n </div>\n </fieldset>\n ) : null}\n\n {null !== total ? (\n <p className=\"ec-bundle-total\" aria-live=\"polite\" aria-atomic=\"true\" data-bundle-total=\"\">\n <span className=\"apui-sr-only\">{__('Total')}</span>\n <bdi className=\"ec-bundle-total__price\">{total}</bdi>\n {null !== saving ? (\n <Badge variant=\"soft\" color=\"success\" data-bundle-saving=\"\">\n {__('You save :amount', { amount: saving })}\n </Badge>\n ) : null}\n </p>\n ) : null}\n\n <AddToCart\n form={props}\n formId={formId}\n quantity={quantity}\n onQuantityChange={setQuantity}\n onAdd={() => post(props.addUrl, { quantity })}\n processing={processing}\n buttonLabel={buttonText ?? __('Add set to cart')}\n priceOnButton={false}\n />\n </div>\n );\n}\n","/**\n * The add-to-cart row every purchase form ends with.\n *\n * Mirrors ecommerce-storefront-livewire's\n * `livewire/product/forms/partials/add-to-cart`: the quantity stepper and\n * the \"Add to cart\" button (with the line price), the buttons satellites add\n * beside it (`addToCartActions`), why the button is disabled, and the live\n * regions that say what the last add did. On a sold-out product whose form\n * offers it (`backInStock`), the \"Notify me\" signup replaces the row.\n *\n * @since 1.0.0\n */\n\nimport { __, type StorefrontPurchaseFormBase } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Alert, Button, Input } from '@artisanpack-ui/react';\nimport { useState, type FormEvent, type ReactElement } from 'react';\n\nimport { Quantity } from '../components/Quantity';\nimport { getRegistries } from '../registries';\nimport { useStorefront } from '../useStorefront';\nimport { usePurchaseFormContext } from './PurchaseFormContext';\nimport { PURCHASE_ERROR_BAG, linePrice, useErrorBag, useStorefrontPost } from './support';\n\n/**\n * Props for {@link AddToCart}.\n *\n * @since 1.0.0\n */\nexport interface AddToCartProps {\n /** The form's props. */\n form: StorefrontPurchaseFormBase;\n /** The form's id prefix, `ec-product-{id}`. */\n formId: string;\n /** The chosen quantity. */\n quantity: number | null;\n /** Called with a new quantity. */\n onQuantityChange: (quantity: number | null) => void;\n /** Adds to the cart. */\n onAdd: () => void;\n /** An add is running. */\n processing: boolean;\n /** Shows the quantity stepper (and `form.showQuantity` must allow it). */\n showQuantity?: boolean;\n /** The button's text; \"Add to cart\" by default. */\n buttonLabel?: string;\n /** Adds the line price to the button. */\n priceOnButton?: boolean;\n /** Replaces `form.blockedReason`. */\n blockedReason?: string | null;\n /** Extra fields the \"Notify me\" signup posts (the variable form's `selected`). */\n notifyData?: Record<string, unknown>;\n}\n\n/**\n * The add-to-cart row.\n *\n * @since 1.0.0\n *\n * @param props - The row's props.\n * @returns The row.\n */\nexport function AddToCart({\n form,\n formId,\n quantity,\n onQuantityChange,\n onAdd,\n processing,\n showQuantity = true,\n buttonLabel,\n priceOnButton = true,\n blockedReason,\n notifyData = {},\n}: AddToCartProps): ReactElement {\n const { locale } = useStorefront();\n const { announcement, notifySubscribed, buttonText = null } = usePurchaseFormContext();\n const errors = useErrorBag(PURCHASE_ERROR_BAG);\n const notify = form.backInStock;\n const offersNotify = null !== notify;\n const withQuantity = showQuantity && form.showQuantity && !offersNotify;\n const reason = undefined === blockedReason ? form.blockedReason : blockedReason;\n const price =\n form.canAdd && priceOnButton\n ? linePrice(form.unitPrice, withQuantity ? quantity : 1, locale)\n : null;\n const describedBy = [\n !form.canAdd && null !== reason && '' !== reason ? `${formId}-blocked` : null,\n ...['variant', 'quantities', 'options'].map((key) =>\n undefined !== errors[key] ? `${formId}-${key}-error` : null,\n ),\n ].filter((id): id is string => null !== id);\n const errorKeys = Object.keys(errors);\n const firstError = 0 === errorKeys.length ? null : errors[errorKeys[0]!]!;\n const actions = form.actions\n .map((key) => getRegistries().addToCartActions.get(key))\n .filter((entry) => undefined !== entry);\n\n return (\n <div className=\"ec-add-to-cart\" data-add-to-cart-row=\"\">\n {offersNotify ? (\n <NotifyMe\n formId={formId}\n notify={notify}\n subscribed={notifySubscribed}\n error={errors.email ?? null}\n data={notifyData}\n />\n ) : (\n <div className=\"ec-add-to-cart__row\">\n {withQuantity ? (\n <div className=\"ec-add-to-cart__quantity\">\n <Quantity\n id={`${formId}-quantity`}\n label={__('Quantity')}\n size=\"lg\"\n max={form.maxQuantity}\n value={quantity}\n onValueChange={onQuantityChange}\n error={errors.quantity ?? null}\n disabled={!form.canAdd}\n />\n </div>\n ) : null}\n\n <Button\n leadingIcon=\"shopping-bag\"\n color=\"primary\"\n size=\"lg\"\n className=\"ec-add-to-cart__button\"\n onClick={onAdd}\n disabled={!form.canAdd || processing}\n aria-describedby={0 === describedBy.length ? undefined : describedBy.join(' ')}\n data-add-to-cart=\"\"\n >\n {buttonLabel ?? buttonText ?? __('Add to cart')}\n {null !== price ? (\n <span className=\"ec-add-to-cart__price\" data-add-to-cart-price=\"\">\n {' '}\n <span aria-hidden=\"true\">·</span> <bdi>{price}</bdi>\n </span>\n ) : null}\n </Button>\n\n {0 < actions.length ? (\n <div className=\"ec-add-to-cart__actions\" data-add-to-cart-actions=\"\">\n {actions.map(({ key, component: Action }) => (\n <Action key={key} {...form} formId={formId} />\n ))}\n </div>\n ) : null}\n </div>\n )}\n\n {!withQuantity && undefined !== errors.quantity ? (\n <p className=\"ec-add-to-cart__error\" data-form-error=\"\">\n {errors.quantity}\n </p>\n ) : null}\n\n {!form.canAdd && null !== reason && '' !== reason && !offersNotify ? (\n <p id={`${formId}-blocked`} className=\"ec-add-to-cart__blocked\" data-add-blocked=\"\">\n {reason}\n </p>\n ) : null}\n\n <p\n className=\"apui-sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-cart-announcement=\"\"\n >\n {announcement}\n </p>\n\n {offersNotify && undefined !== errors.email ? (\n <p className=\"apui-sr-only\" role=\"alert\" data-notify-me-error-announcement=\"\">\n {__('Not signed up: :reason', { reason: errors.email })}\n </p>\n ) : null !== firstError && !offersNotify ? (\n <p className=\"apui-sr-only\" role=\"alert\" data-cart-error-announcement=\"\">\n {__('Not added to your cart: :reason', { reason: firstError })}\n </p>\n ) : null}\n </div>\n );\n}\n\n/**\n * The \"Notify me\" signup a sold-out product offers in place of the button.\n *\n * @param props - The signup, its state and the extra fields it posts.\n * @returns The signup.\n */\nfunction NotifyMe({\n formId,\n notify,\n subscribed,\n error,\n data,\n}: {\n formId: string;\n notify: NonNullable<StorefrontPurchaseFormBase['backInStock']>;\n subscribed: boolean;\n error: string | null;\n data: Record<string, unknown>;\n}): ReactElement {\n const [email, setEmail] = useState(notify.email);\n const { post, processing } = useStorefrontPost(PURCHASE_ERROR_BAG);\n\n const submit = (event: FormEvent<HTMLFormElement>): void => {\n event.preventDefault();\n post(notify.url, { ...data, email, variant_id: notify.variantId }, [\n 'ecommerceStorefront',\n 'feedback',\n 'form',\n ]);\n };\n\n return (\n <Alert\n color=\"neutral\"\n variant=\"outline\"\n icon={subscribed ? 'circle-check' : 'mail'}\n title={notify.title}\n className=\"ec-notify-me\"\n data-notify-me=\"\"\n description={\n subscribed ? (\n <p className=\"ec-notify-me__help\" data-notify-me-done=\"\">\n {__(\"We'll email you when it's back.\")}\n </p>\n ) : (\n <>\n <p id={`${formId}-notify-help`} className=\"ec-notify-me__help\">\n {__(\"Leave your email and we'll tell you as soon as it's back in stock.\")}\n </p>\n\n <form\n className=\"ec-notify-me__form\"\n onSubmit={submit}\n noValidate\n data-notify-me-form=\"\"\n >\n <Input\n id={`${formId}-notify-email`}\n type=\"email\"\n aria-label={__('Email address')}\n placeholder={__('you@example.com')}\n autoComplete=\"email\"\n className=\"ec-notify-me__email\"\n value={email}\n onValueChange={setEmail}\n readonly={notify.emailLocked}\n required\n aria-describedby={`${formId}-notify-help`}\n error={null === error ? undefined : error}\n />\n\n <Button\n type=\"submit\"\n color=\"neutral\"\n variant=\"solid\"\n className=\"ec-notify-me__button\"\n disabled={processing}\n data-notify-me-submit=\"\"\n >\n {__('Notify me')}\n </Button>\n </form>\n </>\n )\n }\n />\n );\n}\n","/**\n * What a purchase form needs from the page around it.\n *\n * Registered forms receive only their own props (`form.props`), as third-party\n * forms do. The product page adds the rest here: the previous request's\n * feedback (the \"Added to your cart\" announcement, a finished \"Notify me\"\n * signup) and the product's URL and variant, so the variable form can follow\n * the shopper's choice with `?variant=`. Outside a product page (a block, a\n * story) the defaults apply.\n *\n * @since 1.0.0\n */\n\nimport { createContext, useContext } from 'react';\n\n/**\n * The purchase form's page context.\n *\n * @since 1.0.0\n */\nexport interface PurchaseFormContextValue {\n /** The product's name, for the steppers' labels. */\n productName: string | null;\n /** The product page's URL, without a query string. */\n productUrl: string | null;\n /** The variant in the page's `?variant=`. */\n variantId: number | null;\n /** \"Added to your cart.\", for the form's live region. */\n announcement: string | null;\n /** The \"Notify me\" signup just succeeded. */\n notifySubscribed: boolean;\n /**\n * The Add-to-Cart block's button text, replacing \"Add to cart\" (and the\n * grouped and bundled forms' own labels); null for the default.\n */\n buttonText?: string | null;\n}\n\n/**\n * The purchase form's page context.\n *\n * @since 1.0.0\n */\nexport const PurchaseFormContext = createContext<PurchaseFormContextValue>({\n productName: null,\n productUrl: null,\n variantId: null,\n announcement: null,\n notifySubscribed: false,\n});\n\n/**\n * Reads the purchase form's page context.\n *\n * @since 1.0.0\n *\n * @returns The context.\n */\nexport function usePurchaseFormContext(): PurchaseFormContextValue {\n return useContext(PurchaseFormContext);\n}\n","/**\n * The `digital` purchase form: the license choice and the download notes.\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/forms/digital`.\n *\n * @since 1.0.0\n */\n\nimport { __, type StorefrontDigitalFormProps } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Icon, RadioGroup } from '@artisanpack-ui/react';\nimport { useState, type ReactElement } from 'react';\n\nimport { AddToCart } from '../AddToCart';\nimport { PURCHASE_ERROR_BAG, useErrorBag, useStorefrontPost } from '../support';\n\n/**\n * The digital purchase form.\n *\n * @since 1.0.0\n *\n * @param props - The form's props.\n * @returns The form.\n */\nexport function DigitalForm(props: StorefrontDigitalFormProps): ReactElement {\n const formId = `ec-product-${props.productId}`;\n const [quantity, setQuantity] = useState<number | null>(props.quantity);\n const [licenseType, setLicenseType] = useState(props.licenseType);\n const errors = useErrorBag(PURCHASE_ERROR_BAG);\n const { post, processing } = useStorefrontPost(PURCHASE_ERROR_BAG);\n\n return (\n <div className=\"ec-purchase-form\" data-purchase-form=\"digital\">\n {0 < props.licenseTypes.length ? (\n <RadioGroup\n id={`${formId}-license`}\n label={__('License')}\n variant=\"cards\"\n options={props.licenseTypes}\n value={'' === licenseType ? null : licenseType}\n required\n error={errors.license_type ?? undefined}\n onValueChange={(value) => setLicenseType(String(value))}\n data-license-types=\"\"\n />\n ) : null}\n\n <div className=\"ec-digital-notes\" data-digital-notes=\"\">\n <Icon name=\"download\" className=\"ec-digital-notes__icon\" aria-hidden=\"true\" />\n <ul role=\"list\" className=\"ec-digital-notes__list\">\n {props.notes.map((note) => (\n <li key={note}>{note}</li>\n ))}\n </ul>\n </div>\n\n <AddToCart\n form={props}\n formId={formId}\n quantity={quantity}\n onQuantityChange={setQuantity}\n onAdd={() =>\n post(props.addUrl, {\n quantity,\n ...(0 < props.licenseTypes.length ? { license_type: licenseType } : {}),\n })\n }\n processing={processing}\n />\n </div>\n );\n}\n","/**\n * The `grouped` purchase form: a quantity per child product.\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/forms/grouped`:\n * a table of the group's products with a quantity box per buyable row, the\n * running item count and total, and \"Add selected to cart\".\n *\n * @since 1.0.0\n */\n\nimport {\n __,\n formatMoney,\n trans_choice,\n type StorefrontGroupedFormProps,\n type StorefrontGroupedRow,\n} from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Badge, Icon, Input, Table } from '@artisanpack-ui/react';\nimport { useState, type ReactElement } from 'react';\n\nimport { Price } from '../../components/Price';\nimport { StockStatus } from '../../components/StockStatus';\nimport { useStorefront } from '../../useStorefront';\nimport { AddToCart } from '../AddToCart';\nimport { usePurchaseFormContext } from '../PurchaseFormContext';\nimport { PURCHASE_ERROR_BAG, useErrorBag, useStorefrontPost } from '../support';\n\n/**\n * The item count and total of the chosen quantities.\n *\n * @since 1.0.0\n *\n * @param rows - The form's rows.\n * @param quantities - Row id to quantity.\n * @param locale - The shopper's locale.\n * @returns The count, and the total (null when a chosen row has no unit price).\n */\nexport function groupedSummary(\n rows: StorefrontGroupedRow[],\n quantities: Record<string, number | null>,\n locale: string,\n): { count: number; total: string | null } {\n let count = 0;\n let amount = 0;\n let currency: string | null = null;\n let priced = true;\n\n for (const row of rows) {\n const quantity = quantities[String(row.id)] ?? 0;\n\n if (!row.buyable || null === quantity || quantity < 1) {\n continue;\n }\n\n count += quantity;\n\n if (null === row.unitPrice || null === row.unitPrice.amount) {\n priced = false;\n continue;\n }\n\n amount += row.unitPrice.amount * quantity;\n currency = row.unitPrice.currency;\n }\n\n return {\n count,\n total: priced && null !== currency ? formatMoney(amount, currency, locale) : null,\n };\n}\n\n/**\n * The grouped purchase form.\n *\n * @since 1.0.0\n *\n * @param props - The form's props.\n * @returns The form.\n */\nexport function GroupedForm(props: StorefrontGroupedFormProps): ReactElement {\n const formId = `ec-product-${props.productId}`;\n const { locale } = useStorefront();\n const { buttonText = null } = usePurchaseFormContext();\n const errors = useErrorBag(PURCHASE_ERROR_BAG);\n const [quantities, setQuantities] = useState<Record<string, number | null>>({});\n const { post, processing } = useStorefrontPost(PURCHASE_ERROR_BAG);\n const summary = groupedSummary(props.rows, quantities, locale);\n\n if (0 === props.rows.length) {\n return (\n <div className=\"ec-purchase-form\" data-purchase-form=\"grouped\">\n <p className=\"ec-purchase-form__notice\">\n {__('None of the products in this group are available right now.')}\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"ec-purchase-form\" data-purchase-form=\"grouped\">\n <Table<StorefrontGroupedRow>\n headers={[\n { key: 'name', label: __('Item') },\n { key: 'price', label: __('Price'), numeric: true },\n { key: 'quantity', label: __('Quantity'), numeric: true },\n ]}\n rows={props.rows}\n keyBy=\"id\"\n label={__('Products in this group')}\n stickyHeader={false}\n className=\"ec-grouped-table\"\n data-grouped-table=\"\"\n renderHeader={(column) =>\n 'quantity' === column.key ? (\n <>\n <span aria-hidden=\"true\">{__('Qty')}</span>\n <span className=\"apui-sr-only\">{column.label}</span>\n </>\n ) : (\n column.label\n )\n }\n renderCell={(row, column) => {\n if ('name' === column.key) {\n return (\n <span className=\"ec-grouped-table__item\" data-grouped-child={row.id}>\n <span className=\"ec-grouped-table__name\">{row.name}</span>\n {row.buyable ? null : row.stock.purchasable ? (\n <Badge variant=\"soft\" color=\"neutral\" size=\"sm\" data-grouped-unavailable=\"\">\n {__('Unavailable')}\n </Badge>\n ) : (\n <StockStatus stock={row.stock} />\n )}\n </span>\n );\n }\n\n if ('price' === column.key) {\n return <Price price={row.price} />;\n }\n\n const id = String(row.id);\n\n return row.buyable ? (\n <Input\n id={`${formId}-child-${row.id}`}\n type=\"number\"\n inputMode=\"numeric\"\n min={0}\n max={props.maxQuantity}\n step={1}\n placeholder=\"0\"\n aria-label={__('Quantity of :name', { name: row.name })}\n value={null === (quantities[id] ?? null) ? '' : String(quantities[id])}\n onValueChange={(raw) => {\n const number = '' === raw ? null : Number(raw);\n\n setQuantities((current) => ({\n ...current,\n [id]: null === number || Number.isNaN(number) ? null : number,\n }));\n }}\n error={errors[`quantities.${row.id}`] ?? undefined}\n className=\"ec-grouped-table__quantity\"\n data-grouped-quantity={row.id}\n />\n ) : (\n <>\n <span aria-hidden=\"true\">–</span>\n <span className=\"apui-sr-only\">\n {__(\":name can't be added right now.\", { name: row.name })}\n </span>\n </>\n );\n }}\n />\n\n {undefined !== errors.quantities ? (\n <p id={`${formId}-quantities-error`} className=\"ec-purchase-form__error\" data-form-error=\"\">\n <Icon name=\"circle-alert\" aria-hidden=\"true\" />\n {errors.quantities}\n </p>\n ) : null}\n\n <p\n className=\"ec-grouped-summary\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-grouped-summary=\"\"\n >\n {summary.count > 0 ? (\n <>\n <span>\n {trans_choice(':count item|:count items', summary.count, { count: summary.count })}\n </span>\n {null !== summary.total ? (\n <>\n <span className=\"apui-sr-only\">·</span>\n <bdi className=\"ec-grouped-summary__total\" data-grouped-total=\"\">\n {summary.total}\n </bdi>\n </>\n ) : null}\n </>\n ) : null}\n </p>\n\n <AddToCart\n form={props}\n formId={formId}\n quantity={null}\n onQuantityChange={() => undefined}\n onAdd={() => {\n const chosen: Record<string, number> = {};\n\n for (const [id, quantity] of Object.entries(quantities)) {\n if (null !== quantity && quantity > 0) {\n chosen[id] = quantity;\n }\n }\n\n post(props.addUrl, { quantities: chosen });\n }}\n processing={processing}\n showQuantity={false}\n blockedReason={__('None of these products are in stock.')}\n buttonLabel={buttonText ?? __('Add selected to cart')}\n priceOnButton={false}\n />\n </div>\n );\n}\n","/**\n * The `options` purchase form: a product type's storefront options.\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/forms/options`:\n * one field per visible option (text, textarea, number, quantity, select,\n * radio or choice cards, swatches, checkbox, or an info row), a character\n * count for limited text, and the engine's quote when the form shows one.\n * A reactive form posts its options to `optionsUrl` on each change and\n * redraws from the answer (which fields show, what's disabled, the quote).\n *\n * @since 1.0.0\n */\n\nimport {\n __,\n type StorefrontChoiceCardOption,\n type StorefrontOptionField,\n type StorefrontOptionsFormProps,\n type StorefrontPurchaseFormRedraw,\n type StorefrontSwatchOption,\n} from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Icon, RadioGroup } from '@artisanpack-ui/react';\nimport { useEffect, useRef, useState, type ReactElement } from 'react';\n\nimport { ChoiceCards } from '../../components/ChoiceCards';\nimport { Field } from '../../components/Field';\nimport { Quantity } from '../../components/Quantity';\nimport { Swatches } from '../../components/Swatches';\nimport { AddToCart } from '../AddToCart';\nimport { PURCHASE_ERROR_BAG, requestJson, useErrorBag, useStorefrontPost } from '../support';\n\n/**\n * Reads a value by its dot-notation field name, from flat or nested values.\n *\n * @since 1.0.0\n *\n * @param values - The values.\n * @param name - The field name, such as `engraving.text`.\n * @returns The value, or undefined.\n */\nexport function optionValue(values: Record<string, unknown>, name: string): unknown {\n if (name in values) {\n return values[name];\n }\n\n let current: unknown = values;\n\n for (const segment of name.split('.')) {\n if (null === current || 'object' !== typeof current) {\n return undefined;\n }\n\n current = (current as Record<string, unknown>)[segment];\n }\n\n return current;\n}\n\n/**\n * Sets a value by its dot-notation field name, nesting as Laravel reads\n * `options.{name}`.\n *\n * @since 1.0.0\n *\n * @param values - The nested values.\n * @param name - The field name.\n * @param value - The value.\n * @returns A copy with the value set.\n */\nexport function withOptionValue(\n values: Record<string, unknown>,\n name: string,\n value: unknown,\n): Record<string, unknown> {\n const segments = name.split('.');\n const copy: Record<string, unknown> = { ...values };\n let target = copy;\n\n segments.forEach((segment, index) => {\n if (index === segments.length - 1) {\n target[segment] = value;\n\n return;\n }\n\n const next = target[segment];\n const child: Record<string, unknown> =\n null !== next && 'object' === typeof next ? { ...(next as Record<string, unknown>) } : {};\n\n target[segment] = child;\n target = child;\n });\n\n return copy;\n}\n\n/**\n * Nests flat dot-notation values.\n *\n * @param values - Flat or nested values.\n * @returns Nested values.\n */\nfunction nested(values: Record<string, unknown>): Record<string, unknown> {\n return Object.entries(values).reduce<Record<string, unknown>>(\n (result, [name, value]) => withOptionValue(result, name, value),\n {},\n );\n}\n\n/**\n * Counts code points, as the server's character limit does.\n *\n * @param value - The text.\n * @returns The length.\n */\nfunction codePoints(value: unknown): number {\n return [...String(value ?? '')].length;\n}\n\n/**\n * A swatch field's color or image.\n *\n * @param swatch - A hex color or an image URL.\n * @returns The swatch option's `color` and `image`.\n */\nfunction swatchLook(swatch: string | null): Pick<StorefrontSwatchOption, 'color' | 'image'> {\n const color = null !== swatch && /^#[0-9a-f]{3,8}$/i.test(swatch) ? swatch : null;\n\n return { color, image: null === color ? swatch : null };\n}\n\n/**\n * The options purchase form.\n *\n * @since 1.0.0\n *\n * @param props - The form's props.\n * @returns The form.\n */\nexport function OptionsForm(props: StorefrontOptionsFormProps): ReactElement {\n const formId = `ec-product-${props.productId}`;\n const [form, setForm] = useState(props);\n const [source, setSource] = useState(props);\n const [values, setValues] = useState<Record<string, unknown>>(() => nested(props.values));\n const [quantity, setQuantity] = useState<number | null>(props.quantity);\n const [refreshing, setRefreshing] = useState(false);\n const errors = useErrorBag(PURCHASE_ERROR_BAG);\n const { post, processing } = useStorefrontPost(PURCHASE_ERROR_BAG);\n const pending = useRef<AbortController | null>(null);\n // The latest values, and the fields edited while a redraw was on its way:\n // its answer must not put back what the shopper typed meanwhile.\n const latestValues = useRef(values);\n const editedDuringRedraw = useRef(new Set<string>());\n\n useEffect(() => {\n latestValues.current = values;\n }, [values]);\n\n // New props from the page replace a redraw and the values typed so far.\n if (source !== props) {\n setSource(props);\n setForm(props);\n setValues(nested(props.values));\n }\n\n const redraw = async (next: Record<string, unknown>): Promise<void> => {\n if (!form.reactive) {\n return;\n }\n\n pending.current?.abort();\n\n const controller = new AbortController();\n\n pending.current = controller;\n editedDuringRedraw.current = new Set();\n setRefreshing(true);\n\n const answer = await requestJson<StorefrontPurchaseFormRedraw>(\n form.optionsUrl,\n { options: next },\n controller.signal,\n );\n\n if (pending.current !== controller) {\n return;\n }\n\n setRefreshing(false);\n\n if (null !== answer) {\n const redrawn = answer.props as StorefrontOptionsFormProps;\n\n let merged = nested(redrawn.values);\n\n for (const name of editedDuringRedraw.current) {\n merged = withOptionValue(merged, name, optionValue(latestValues.current, name));\n }\n\n // A redraw never brings back a stepper the form was given without (an\n // Add to Cart block that hides it).\n setForm({ ...redrawn, showQuantity: props.showQuantity && redrawn.showQuantity });\n setValues(merged);\n }\n\n pending.current = null;\n editedDuringRedraw.current = new Set();\n };\n\n const change = (name: string, value: unknown, refresh = true): Record<string, unknown> => {\n const next = withOptionValue(latestValues.current, name, value);\n\n if (null !== pending.current) {\n editedDuringRedraw.current.add(name);\n }\n\n latestValues.current = next;\n setValues(next);\n\n if (refresh) {\n void redraw(next);\n }\n\n return next;\n };\n\n const renderField = (field: StorefrontOptionField): ReactElement | null => {\n const key = `options.${field.name}`;\n const error = errors[key] ?? null;\n const value = optionValue(values, field.name);\n const countId = null === field.maxLength ? undefined : `${field.id}-count`;\n\n switch (field.type) {\n case 'info': {\n const items = field.meta.items;\n\n return (\n <div className=\"ec-option-info\">\n <p className=\"ec-option-info__label\">{field.label}</p>\n {Array.isArray(items) ? (\n <ul role=\"list\" className=\"ec-option-info__list\">\n {items.map((item: { quantity?: number; name?: string }, index) => (\n <li key={index}>\n {__(':quantity × :name', {\n quantity: Number(item.quantity ?? 1),\n name: String(item.name ?? ''),\n })}\n </li>\n ))}\n </ul>\n ) : null}\n {null !== field.help ? <p className=\"ec-option-info__help\">{field.help}</p> : null}\n </div>\n );\n }\n\n case 'quantity':\n return (\n <Quantity\n id={field.id}\n label={field.label}\n min={0}\n itemName={field.label}\n required={field.required}\n value={null === value || undefined === value || '' === value ? null : Number(value)}\n onValueChange={(next) => change(field.name, next)}\n error={error}\n />\n );\n\n case 'textarea':\n return (\n <Field\n control=\"textarea\"\n id={field.id}\n label={field.label}\n hint={field.help}\n errorKey={key}\n value={String(value ?? '')}\n required={field.required}\n error={error}\n attributes={undefined === countId ? {} : { 'aria-describedby': countId }}\n onValueChange={(next) => change(field.name, limit(next, field.maxLength), false)}\n onBlur={() => void redraw(values)}\n />\n );\n\n case 'select':\n return (\n <Field\n control=\"select\"\n id={field.id}\n label={field.label}\n hint={field.help}\n errorKey={key}\n options={field.options.map((option) => ({\n value: option.value,\n label: [\n null === option.delta\n ? option.label\n : __(':choice · :delta', { choice: option.label, delta: option.delta }),\n null === option.reason ? null : __('(:reason)', { reason: option.reason }),\n ]\n .filter((part): part is string => null !== part)\n .join(' '),\n ...(option.disabled ? { disabled: true as const } : {}),\n }))}\n placeholder={__('Choose…')}\n value={String(value ?? '')}\n required={field.required}\n error={error}\n onValueChange={(next) => change(field.name, next)}\n />\n );\n\n case 'radio':\n return field.cards ? (\n <ChoiceCards\n name={field.id}\n idPrefix={field.id}\n legend={field.label}\n hint={field.help}\n options={field.options.map((option): StorefrontChoiceCardOption => ({\n value: option.value,\n label: option.label,\n hint: option.hint,\n meta: option.delta,\n image: option.image,\n selected: String(value ?? '') === option.value,\n disabled: option.disabled,\n reason: option.reason,\n }))}\n required={field.required}\n error={error}\n onValueChange={(next) => change(field.name, next)}\n />\n ) : (\n <RadioGroup\n id={field.id}\n label={field.label}\n hint={field.help ?? undefined}\n options={field.options.map((option) => ({\n value: option.value,\n label: option.label,\n ...(null !== (option.reason ?? option.hint)\n ? { description: option.reason ?? option.hint }\n : {}),\n ...(null !== option.delta ? { meta: option.delta } : {}),\n disabled: option.disabled,\n }))}\n required={field.required}\n value={undefined === value || null === value ? null : String(value)}\n error={error ?? undefined}\n onValueChange={(next) => change(field.name, String(next))}\n />\n );\n\n case 'swatch':\n return (\n <>\n <Swatches\n name={field.id}\n idPrefix={field.id}\n legend={field.label}\n options={field.options.map((option): StorefrontSwatchOption => ({\n value: option.value,\n label: option.label,\n ...swatchLook(option.swatch),\n count: null,\n meta: option.delta,\n selected: String(value ?? '') === option.value,\n disabled: option.disabled,\n soldOut: false,\n reason: option.reason ?? option.hint,\n }))}\n required={field.required}\n error={error}\n describedBy={null === field.help ? undefined : `${field.id}-help`}\n onValueChange={(next) => change(field.name, next)}\n />\n {null !== field.help ? (\n <p id={`${field.id}-help`} className=\"ec-option-field__help\">\n {field.help}\n </p>\n ) : null}\n </>\n );\n\n case 'checkbox':\n return (\n <Field\n control=\"checkbox\"\n id={field.id}\n label={field.label}\n hint={field.help}\n errorKey={key}\n checked={true === value || '1' === value || 1 === value}\n required={field.required}\n error={error}\n onCheckedChange={(next) => change(field.name, next)}\n />\n );\n\n default:\n return (\n <Field\n id={field.id}\n label={field.label}\n hint={field.help}\n type={'number' === field.type ? 'number' : 'text'}\n errorKey={key}\n value={String(value ?? '')}\n required={field.required}\n error={error}\n attributes={undefined === countId ? {} : { 'aria-describedby': countId }}\n onValueChange={(next) => change(field.name, limit(next, field.maxLength), false)}\n onBlur={() => void redraw(values)}\n />\n );\n }\n };\n\n return (\n <div className=\"ec-purchase-form\" data-purchase-form=\"options\">\n {form.fields.map((field) => (\n <div key={field.id} className=\"ec-option-field\" data-option-field={field.name}>\n {renderField(field)}\n\n {null !== field.maxLength ? (\n <p id={`${field.id}-count`} className=\"ec-option-field__count\" data-character-count=\"\">\n {__(':count of :max characters', {\n count: Math.min(codePoints(optionValue(values, field.name)), field.maxLength),\n max: field.maxLength,\n })}\n </p>\n ) : null}\n </div>\n ))}\n\n {form.showsQuote ? (\n <p className=\"ec-option-price\" data-quoted-price=\"\">\n <span role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-quoted-price-value=\"\">\n {null !== form.quotedPrice ? (\n <>\n <strong className=\"ec-option-price__amount\">\n <bdi>{form.quotedPrice}</bdi>\n </strong>{' '}\n {__('including options')}\n </>\n ) : null}\n </span>\n {refreshing ? (\n <span className=\"ec-option-price__loading\" data-quoted-price-loading=\"\">\n {__('Updating price…')}\n </span>\n ) : null}\n </p>\n ) : null}\n\n {undefined !== errors.options ? (\n <p id={`${formId}-options-error`} className=\"ec-purchase-form__error\" data-form-error=\"\">\n <Icon name=\"circle-alert\" aria-hidden=\"true\" />\n {errors.options}\n </p>\n ) : null}\n\n <AddToCart\n form={form}\n formId={formId}\n quantity={quantity}\n onQuantityChange={setQuantity}\n onAdd={() => post(form.addUrl, { quantity, options: values })}\n processing={processing}\n showQuantity={form.showQuantity && !form.separately}\n />\n </div>\n );\n}\n\n/**\n * Cuts text to a character limit, counted in code points.\n *\n * @param value - The text.\n * @param max - The limit, or null.\n * @returns The text, at most `max` characters long.\n */\nfunction limit(value: string, max: number | null): string {\n if (null === max) {\n return value;\n }\n\n const characters = [...value];\n\n return characters.length > max ? characters.slice(0, max).join('') : value;\n}\n","/**\n * `ec-choice-cards`: a fieldset of radio cards, each with a label, a hint\n * or reason, an optional image and a price or other note.\n *\n * Mirrors ecommerce-storefront-livewire's `<x-artisanpack-ec-choice-cards>`\n * (shipping methods, bundle choices). The options say which is selected;\n * the parent updates them through `onValueChange`.\n *\n * @since 1.0.0\n */\n\nimport type { StorefrontChoiceCardOption } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Icon } from '@artisanpack-ui/react';\nimport type { ReactElement } from 'react';\n\nimport { cx, filled, idFragment } from '../internal/classes';\n\n/**\n * Props for {@link ChoiceCards}.\n *\n * @since 1.0.0\n */\nexport interface ChoiceCardsProps {\n /** The radios' name. */\n name: string;\n /** The fieldset's legend. */\n legend: string;\n options: StorefrontChoiceCardOption[];\n /** The inputs' id prefix. Defaults to `ec-choice-{name}`. */\n idPrefix?: string;\n required?: boolean;\n hint?: string | null;\n error?: string | null;\n /** Extra ids describing the fieldset. */\n describedBy?: string;\n /** Called with the chosen option's value. */\n onValueChange?: (value: string) => void;\n className?: string;\n}\n\n/**\n * Choice cards.\n *\n * @since 1.0.0\n *\n * @param props - The options and fieldset settings.\n * @returns The fieldset.\n */\nexport function ChoiceCards({\n name,\n legend,\n options,\n idPrefix,\n required = false,\n hint = null,\n error = null,\n describedBy,\n onValueChange,\n className,\n}: ChoiceCardsProps): ReactElement {\n const prefix = idPrefix ?? `ec-choice-${idFragment(name)}`;\n const hintId = `${prefix}-hint`;\n const errorId = `${prefix}-error`;\n const hasHint = filled(hint);\n const hasError = filled(error);\n const describedByIds = [describedBy, hasHint ? hintId : null, hasError ? errorId : null]\n .filter(filled)\n .join(' ');\n\n return (\n <fieldset\n className={cx('ec-choice-cards', className)}\n data-choice-cards={name}\n aria-describedby={'' !== describedByIds ? describedByIds : undefined}\n data-invalid={hasError ? '' : undefined}\n tabIndex={hasError ? -1 : undefined}\n >\n <legend className=\"ec-choice-cards__legend\">\n {legend}\n {required ? (\n <span className=\"ec-choice-cards__required\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </legend>\n\n {hasHint ? (\n <p id={hintId} className=\"ec-choice-cards__hint\">\n {hint}\n </p>\n ) : null}\n\n <div className=\"ec-choice-cards__options\">\n {options.map((option, index) => {\n const inputId = `${prefix}-${index}`;\n const note = option.reason ?? option.hint;\n const noteId = null !== note ? `${inputId}-note` : undefined;\n\n return (\n <label\n key={inputId}\n htmlFor={inputId}\n className=\"ec-choice-card\"\n data-choice-card={option.value}\n >\n <input\n id={inputId}\n type=\"radio\"\n name={name}\n value={option.value}\n className=\"ec-choice-card__input\"\n checked={option.selected}\n disabled={option.disabled}\n required={required ? true : undefined}\n aria-invalid={hasError ? 'true' : undefined}\n aria-describedby={noteId}\n onChange={() => onValueChange?.(option.value)}\n />\n\n {null !== option.image ? (\n <img\n src={option.image.url}\n srcSet={option.image.srcset ?? undefined}\n sizes={null !== option.image.srcset ? '48px' : undefined}\n alt={option.image.alt}\n className=\"ec-choice-card__image\"\n width={48}\n height={48}\n loading=\"lazy\"\n decoding=\"async\"\n />\n ) : null}\n\n <span className=\"ec-choice-card__text\">\n <span className=\"ec-choice-card__label\">{option.label}</span>\n {undefined !== noteId ? (\n <span id={noteId} className=\"ec-choice-card__hint\">\n {note}\n </span>\n ) : null}\n </span>\n\n {null !== option.meta ? (\n <span className=\"ec-choice-card__meta\" data-choice-card-meta=\"\">\n <bdi>{option.meta}</bdi>\n </span>\n ) : null}\n\n <Icon name=\"check\" className=\"ec-choice-card__check\" aria-hidden=\"true\" />\n </label>\n );\n })}\n </div>\n\n {hasError ? (\n <p id={errorId} className=\"ec-choice-cards__error\" data-choice-cards-error=\"\">\n <Icon name=\"circle-alert\" aria-hidden=\"true\" />\n {error}\n </p>\n ) : null}\n </fieldset>\n );\n}\n","/**\n * The `simple` purchase form: a quantity and \"Add to cart\".\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/forms/simple`.\n *\n * @since 1.0.0\n */\n\nimport type { StorefrontSimpleFormProps } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { useState, type ReactElement } from 'react';\n\nimport { AddToCart } from '../AddToCart';\nimport { PURCHASE_ERROR_BAG, useStorefrontPost } from '../support';\n\n/**\n * The simple purchase form.\n *\n * @since 1.0.0\n *\n * @param props - The form's props.\n * @returns The form.\n */\nexport function SimpleForm(props: StorefrontSimpleFormProps): ReactElement {\n const formId = `ec-product-${props.productId}`;\n const [quantity, setQuantity] = useState<number | null>(props.quantity);\n const { post, processing } = useStorefrontPost(PURCHASE_ERROR_BAG);\n\n return (\n <div className=\"ec-purchase-form\" data-purchase-form=\"simple\">\n <AddToCart\n form={props}\n formId={formId}\n quantity={quantity}\n onQuantityChange={setQuantity}\n onAdd={() => post(props.addUrl, { quantity })}\n processing={processing}\n />\n </div>\n );\n}\n","/**\n * The `variable` purchase form: a swatch group or a select per attribute.\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/forms/variable`.\n * A choice posts the selection to the form's `optionsUrl`, which answers\n * the redrawn form (availability, a cleared choice and its notice, the\n * matching variant); a new variant then reloads the page's price, stock and\n * gallery with `?variant=`, as the Livewire page follows the choice.\n *\n * @since 1.0.0\n */\n\nimport type {\n StorefrontPurchaseFormRedraw,\n StorefrontSwatchOption,\n StorefrontVariableFormProps,\n StorefrontVariationOption,\n} from '@artisanpack-ui/ecommerce-storefront-core';\nimport { __ } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Icon, Select } from '@artisanpack-ui/react';\nimport { useRef, useState, type ReactElement } from 'react';\n\nimport { useStorefrontRouter } from '../../internal/storefrontRouter';\nimport { Swatches } from '../../components/Swatches';\nimport { cx } from '../../internal/classes';\nimport { AddToCart } from '../AddToCart';\nimport { usePurchaseFormContext } from '../PurchaseFormContext';\nimport { PURCHASE_ERROR_BAG, requestJson, useErrorBag, useStorefrontPost } from '../support';\n\n/**\n * The page props a variant change reloads.\n *\n * Not the form itself: the redraw already holds it, and the page presents\n * the form from the URL's `?variant=` alone, so a choice that leaves no\n * full variant would come back as an empty selection and lose the choice\n * and its notice.\n *\n * @since 1.0.0\n */\nexport const VARIANT_RELOAD = ['variantId', 'product', 'gallery', 'price', 'stock', 'soldOut'];\n\n/**\n * A variation choice as a swatch: a hex `swatch` is the color, anything\n * else an image URL.\n *\n * @param option - The choice.\n * @returns The swatch option.\n */\nfunction swatchOption(option: StorefrontVariationOption): StorefrontSwatchOption {\n const swatch = option.swatch;\n const color = null !== swatch && /^#[0-9a-f]{3,8}$/i.test(swatch) ? swatch : null;\n\n return {\n value: option.value,\n label: option.label,\n color,\n image: null === color ? swatch : null,\n count: null,\n meta: null,\n selected: option.selected,\n disabled: option.disabled,\n soldOut: option.soldOut,\n reason: option.reason,\n };\n}\n\n/**\n * The variable purchase form.\n *\n * @since 1.0.0\n *\n * @param props - The form's props.\n * @returns The form.\n */\nexport function VariableForm(props: StorefrontVariableFormProps): ReactElement {\n const formId = `ec-product-${props.productId}`;\n const [form, setForm] = useState(props);\n const [source, setSource] = useState(props);\n const [quantity, setQuantity] = useState<number | null>(props.quantity);\n const { productUrl, variantId } = usePurchaseFormContext();\n const errors = useErrorBag(PURCHASE_ERROR_BAG);\n const { post, processing } = useStorefrontPost(PURCHASE_ERROR_BAG);\n const visits = useStorefrontRouter();\n const variantError = errors.variant;\n\n // The selection the latest choice asked for, and that request: a second\n // choice before the first redraw answers builds on the first, and only\n // the latest answer is drawn.\n const pendingSelection = useRef<Record<string, number> | null>(null);\n const pendingRequest = useRef<AbortController | null>(null);\n\n // New props from the page (a reload after an add) replace a redraw.\n if (source !== props) {\n setSource(props);\n setForm(props);\n }\n\n const choose = async (groupId: number, value: string): Promise<void> => {\n const selected: Record<string, number> = { ...(pendingSelection.current ?? form.selected) };\n\n if ('' === value) {\n delete selected[String(groupId)];\n } else {\n selected[String(groupId)] = Number(value);\n }\n\n pendingSelection.current = selected;\n pendingRequest.current?.abort();\n\n const controller = new AbortController();\n\n pendingRequest.current = controller;\n\n const redraw = await requestJson<StorefrontPurchaseFormRedraw>(\n form.optionsUrl,\n { selected, changed: groupId },\n controller.signal,\n );\n\n if (pendingRequest.current !== controller) {\n return;\n }\n\n pendingRequest.current = null;\n pendingSelection.current = null;\n\n if (null === redraw) {\n return;\n }\n\n const next = redraw.props as StorefrontVariableFormProps;\n\n // A redraw never brings back a stepper the form was given without (an\n // Add to Cart block that hides it).\n setForm({ ...next, showQuantity: props.showQuantity && next.showQuantity });\n\n if (null !== productUrl && next.variantId !== variantId) {\n visits.get(productUrl, null === next.variantId ? {} : { variant: next.variantId }, {\n only: VARIANT_RELOAD,\n preserveScroll: true,\n preserveState: true,\n replace: true,\n });\n }\n };\n\n return (\n <div className=\"ec-purchase-form\" data-purchase-form=\"variable\">\n {form.groups.map((group) => {\n const groupId = `${formId}-attribute-${group.id}`;\n const groupError = errors[`selected.${group.id}`] ?? null;\n const describedBy = undefined !== variantError ? `${formId}-variant-error` : undefined;\n\n if ('select' === group.control) {\n const chosen = group.options.find((option) => option.selected);\n\n return (\n <div\n key={group.id}\n className=\"ec-purchase-form__select\"\n data-variation-group={group.id}\n >\n <Select\n id={groupId}\n label={group.label}\n options={group.options.map((option) => ({\n value: option.value,\n label:\n null === option.reason\n ? option.label\n : __(':value (:reason)', { value: option.label, reason: option.reason }),\n disabled: option.disabled,\n }))}\n value={chosen?.value ?? ''}\n placeholder={group.placeholder}\n error={null === groupError ? undefined : groupError}\n required\n aria-describedby={describedBy}\n onValueChange={(value) => void choose(group.id, String(value))}\n />\n </div>\n );\n }\n\n return (\n <Swatches\n key={group.id}\n name={groupId}\n legend={group.label}\n options={group.options.map(swatchOption)}\n idPrefix={groupId}\n error={groupError}\n required\n describedBy={describedBy}\n onValueChange={(value) => void choose(group.id, value)}\n />\n );\n })}\n\n <p\n className={cx(\n 'ec-purchase-form__notice',\n null === form.selectionNotice || '' === form.selectionNotice ? 'apui-sr-only' : null,\n )}\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-selection-notice=\"\"\n >\n {form.selectionNotice}\n </p>\n\n {undefined !== variantError ? (\n <p id={`${formId}-variant-error`} className=\"ec-purchase-form__error\" data-variant-error=\"\">\n <Icon name=\"circle-alert\" aria-hidden=\"true\" />\n {variantError}\n </p>\n ) : null}\n\n <AddToCart\n form={form}\n formId={formId}\n quantity={quantity}\n onQuantityChange={setQuantity}\n onAdd={() =>\n post(form.addUrl, { quantity, selected: form.selected, variant_id: form.variantId })\n }\n processing={processing}\n notifyData={{ selected: form.selected }}\n />\n </div>\n );\n}\n","/**\n * The core purchase forms, registered in the `productForms` registry under\n * the product type keys the server's `ProductFormRegistry` uses.\n *\n * @since 1.0.0\n */\n\nimport type { ReactStorefrontRegistries } from '../../registries';\nimport { BundledForm } from './BundledForm';\nimport { DigitalForm } from './DigitalForm';\nimport { GroupedForm } from './GroupedForm';\nimport { OptionsForm } from './OptionsForm';\nimport { SimpleForm } from './SimpleForm';\nimport { VariableForm } from './VariableForm';\n\n/**\n * The core forms by key.\n *\n * @since 1.0.0\n */\nexport const CORE_PRODUCT_FORMS = {\n simple: SimpleForm,\n variable: VariableForm,\n grouped: GroupedForm,\n bundled: BundledForm,\n digital: DigitalForm,\n options: OptionsForm,\n} as const;\n\n/**\n * Registers the core purchase forms (positions 10, 20, …).\n *\n * @since 1.0.0\n *\n * @param registries - The client registries.\n */\nexport function registerProductForms(registries: ReactStorefrontRegistries): void {\n Object.entries(CORE_PRODUCT_FORMS).forEach(([key, component], index) => {\n registries.productForms.register(key, component, { position: (index + 1) * 10 });\n });\n}\n","/**\n * The recently viewed row.\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/recently-viewed`\n * and its placeholder: small cards (a thumbnail, the name and the price) for\n * the products the shopper looked at last, filled by the recently-viewed\n * satellite through the JSON `recently-viewed` route.\n *\n * Give it the row (`data`, as the Recently Viewed block's props carry it),\n * or the route to load it from; the placeholder shows while it loads.\n *\n * @since 1.0.0\n */\n\nimport { __, type StorefrontRecentlyViewed } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Icon, Skeleton as Bone } from '@artisanpack-ui/react';\nimport { useEffect, useId, useState, type ReactElement } from 'react';\n\nimport { Price } from '../../components/Price';\nimport { useStorefront } from '../../useStorefront';\nimport { requestJson } from '../support';\n\n/**\n * Props for {@link RecentlyViewed}.\n *\n * @since 1.0.0\n */\nexport interface RecentlyViewedProps {\n /** The row, already loaded. */\n data?: StorefrontRecentlyViewed | null;\n /** The `recently-viewed` route; defaults to the storefront's. */\n url?: string | null;\n /** The product being viewed, left out of the row. */\n productId?: number | null;\n /** How many products (and placeholder cards). */\n limit?: number | null;\n /** Columns. */\n columns?: number | null;\n /** A heading in place of \"Recently viewed\". */\n heading?: string | null;\n /**\n * With `data`, load the row again from the route and show it in place of\n * `data` (the Recently Viewed block: its props were built when the page\n * was, and a page restored from history would show a stale row).\n */\n refresh?: boolean;\n}\n\n/**\n * The recently viewed row.\n *\n * @since 1.0.0\n *\n * @param props - The row, or where to load it.\n * @returns The row, its placeholder, or its empty root.\n */\nexport function RecentlyViewed({\n data = null,\n url = null,\n productId = null,\n limit = null,\n columns = null,\n heading = null,\n refresh = false,\n}: RecentlyViewedProps): ReactElement {\n const { routes } = useStorefront();\n const route =\n url ??\n (null === routes.storefront.base\n ? null\n : `${routes.storefront.base.replace(/\\/$/, '')}/recently-viewed`);\n const target =\n (null === data || refresh) && null !== route\n ? recentlyViewedUrl(route, { product: productId, limit, columns, heading })\n : null;\n const [fetched, setFetched] = useState<{\n url: string;\n row: StorefrontRecentlyViewed | null;\n } | null>(null);\n\n useEffect(() => {\n if (null === target) {\n return;\n }\n\n const controller = new AbortController();\n\n void requestJson<StorefrontRecentlyViewed>(target, undefined, controller.signal).then(\n (answer) => {\n if (!controller.signal.aborted) {\n setFetched({ url: target, row: answer });\n }\n },\n );\n\n return () => controller.abort();\n }, [target]);\n\n const loaded: StorefrontRecentlyViewed | null | undefined =\n null !== data\n ? null !== target && fetched?.url === target && null !== fetched.row\n ? fetched.row\n : data\n : null === target\n ? null\n : fetched?.url === target\n ? fetched.row\n : undefined;\n\n if (undefined === loaded) {\n return (\n <RecentlyViewedPlaceholder\n title={null !== heading && '' !== heading.trim() ? heading : __('Recently viewed')}\n count={limit ?? 4}\n columns={columns ?? 4}\n />\n );\n }\n\n return <RecentlyViewedRow row={loaded} />;\n}\n\n/**\n * The `recently-viewed` route with its query string.\n *\n * @param route - The route's URL.\n * @param query - The product, limit, columns and heading; empty values are left out.\n * @returns The URL.\n */\nfunction recentlyViewedUrl(route: string, query: Record<string, string | number | null>): string {\n const base = 'undefined' !== typeof window ? window.location.origin : 'http://localhost';\n const target = new URL(route, base);\n\n for (const [key, value] of Object.entries(query)) {\n if (null !== value && '' !== value) {\n target.searchParams.set(key, String(value));\n }\n }\n\n return target.toString();\n}\n\n/**\n * The loaded row.\n *\n * @param props - The row, or null for none.\n * @returns The row's root, with the section when there are products.\n */\nfunction RecentlyViewedRow({ row }: { row: StorefrontRecentlyViewed | null }): ReactElement {\n const headingId = `ec-recently-viewed-${useId().replace(/[^A-Za-z0-9_-]/g, '')}`;\n\n return (\n <div data-recently-viewed=\"\">\n {null !== row && row.products.length > 0 ? (\n <section className=\"ec-recent\" aria-labelledby={headingId}>\n <h2 id={headingId} className=\"ec-recent__title\">\n {row.title}\n </h2>\n\n <ul role=\"list\" className=\"ec-recent__list\" data-columns={row.columns}>\n {row.products.map((product) => (\n <li key={product.id} className=\"ec-recent__item\">\n <article\n className=\"apui-card ec-recent__card\"\n data-surface=\"default\"\n data-interactive={null !== product.url ? '' : undefined}\n data-recently-viewed-product={product.id}\n >\n <div className=\"ec-recent__media\" aria-hidden=\"true\">\n {null !== product.image ? (\n <img\n src={product.image.url}\n srcSet={product.image.srcset ?? undefined}\n sizes={null !== product.image.srcset ? '64px' : undefined}\n width={64}\n height={64}\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n ) : (\n <Icon name=\"image\" />\n )}\n </div>\n\n <div className=\"ec-recent__body\">\n <h3 className=\"ec-recent__name\">\n {null !== product.url ? (\n <a href={product.url} data-product-link=\"\">\n {product.name}\n </a>\n ) : (\n product.name\n )}\n </h3>\n\n {null !== product.price ? (\n <Price\n price={product.price}\n saleBadge={false}\n showTax={false}\n size=\"sm\"\n className=\"ec-recent__price\"\n />\n ) : null}\n </div>\n </article>\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n </div>\n );\n}\n\n/**\n * Props for {@link RecentlyViewedPlaceholder}.\n *\n * @since 1.0.0\n */\nexport interface RecentlyViewedPlaceholderProps {\n title: string;\n /** Skeleton cards (1–12). */\n count?: number;\n /** Columns (1–6). */\n columns?: number;\n}\n\n/**\n * The skeleton row shown while the products load.\n *\n * @since 1.0.0\n *\n * @param props - The heading, cards and columns.\n * @returns The placeholder.\n */\nexport function RecentlyViewedPlaceholder({\n title,\n count = 4,\n columns = 4,\n}: RecentlyViewedPlaceholderProps): ReactElement {\n const cards = Math.max(1, Math.min(12, Math.trunc(count)));\n\n return (\n <div data-recently-viewed-placeholder=\"\">\n <section className=\"ec-recent\">\n <h2 className=\"ec-recent__title\">{title}</h2>\n\n <span className=\"apui-sr-only\" role=\"status\">\n {__('Loading recently viewed products…')}\n </span>\n\n <ul\n className=\"ec-recent__list\"\n data-columns={Math.max(1, Math.min(6, Math.trunc(columns)))}\n aria-busy=\"true\"\n aria-hidden=\"true\"\n data-skeleton=\"recent\"\n >\n {Array.from({ length: cards }, (_, index) => (\n <li key={index} className=\"ec-recent__item\">\n <div className=\"apui-card ec-recent__card\" data-surface=\"default\">\n <Bone className=\"ec-recent__skeleton-thumb\" />\n\n <div className=\"ec-recent__body ec-recent__body--skeleton\">\n <Bone shape=\"text\" className=\"ec-recent__skeleton-line\" data-length=\"long\" />\n <Bone shape=\"text\" className=\"ec-recent__skeleton-line\" data-length=\"short\" />\n </div>\n </div>\n </li>\n ))}\n </ul>\n </section>\n </div>\n );\n}\n","/**\n * The `reviews` product section.\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/reviews`: the\n * average and a rating breakdown that filters the list, the review form\n * (with its error summary and the guest name and email), the thank-you\n * notice that takes focus after a submit, and the paged list.\n *\n * Filtering and paging reload the page's `sections` with `?review-rating=`\n * and `?reviews-page=`; the form posts to `submitUrl` in its own error bag.\n *\n * @since 1.0.0\n */\n\nimport {\n __,\n trans_choice,\n type StorefrontProductReviews,\n} from '@artisanpack-ui/ecommerce-storefront-core';\nimport {\n Alert,\n Badge,\n Button,\n Card,\n Icon,\n Link,\n Pagination,\n Progress,\n Rating,\n ValidationSummary,\n} from '@artisanpack-ui/react';\nimport { useEffect, useRef, useState, type FormEvent, type ReactElement } from 'react';\n\nimport { useStorefrontRouter } from '../../internal/storefrontRouter';\nimport { EmptyState } from '../../components/EmptyState';\nimport { Field } from '../../components/Field';\nimport { RatingInput } from '../../components/RatingInput';\nimport { cx } from '../../internal/classes';\nimport { useStorefront, useStorefrontPage } from '../../useStorefront';\nimport { REVIEW_ERROR_BAG, useErrorBag, useStorefrontPost, visitWithQuery } from '../support';\n\n/**\n * The query parameter the rating filter uses.\n *\n * @since 1.0.0\n */\nexport const REVIEW_RATING_QUERY = 'review-rating';\n\n/**\n * Props for {@link Reviews}.\n *\n * @since 1.0.0\n */\nexport interface ReviewsProps extends StorefrontProductReviews {\n /** The product's id, for the element ids. */\n productId?: number;\n /** A review was just submitted (the page's `feedback.reviewSubmitted`). */\n reviewSubmitted?: { published: boolean } | null;\n /**\n * Whether the section offers the review form (the Reviews block's\n * `showForm`). Off, it drops the button, the thank-you notice and the\n * eligibility line.\n */\n allowForm?: boolean;\n}\n\n/**\n * The reviews section.\n *\n * @since 1.0.0\n *\n * @param props - The reviews.\n * @returns The section.\n */\nexport function Reviews({\n productId = 0,\n reviewSubmitted = null,\n allowForm = true,\n histogram,\n total,\n average,\n ratingFilter,\n reviews,\n pagination,\n canReview,\n reason,\n loginUrl,\n guest,\n honeypotName,\n submitUrl,\n}: ReviewsProps): ReactElement {\n const { locale } = useStorefront();\n const { url } = useStorefrontPage();\n const visits = useStorefrontRouter();\n const formId = `ec-review-form-${productId}`;\n const headingId = `ec-reviews-${productId}-heading`;\n const submitted = null !== reviewSubmitted;\n const canWrite = allowForm && canReview && !submitted;\n const [formOpen, setShowForm] = useState(false);\n // The thank-you notice replaces the form.\n const showForm = formOpen && !submitted;\n const openButton = useRef<HTMLButtonElement | HTMLAnchorElement>(null);\n const number = (value: number, minimum: number, maximum = minimum): string =>\n new Intl.NumberFormat(locale.replace('_', '-'), {\n minimumFractionDigits: minimum,\n maximumFractionDigits: maximum,\n }).format(value);\n const reload = ['sections'];\n\n const filter = (stars: number | null): void => {\n visitWithQuery(\n url,\n {\n [REVIEW_RATING_QUERY]: null === stars || stars === ratingFilter ? null : stars,\n [pagination.pageName]: null,\n },\n reload,\n visits,\n );\n };\n\n return (\n <section\n id=\"reviews\"\n className=\"ec-reviews\"\n aria-labelledby={headingId}\n data-product-reviews={productId}\n >\n <div className=\"ec-reviews__header\">\n <h2 id={headingId} className=\"ec-reviews__title\">\n {__('Customer reviews')}\n </h2>\n\n {canWrite ? (\n <Button\n ref={openButton}\n variant=\"outline\"\n color=\"neutral\"\n leadingIcon=\"pencil\"\n onClick={() => setShowForm((open) => !open)}\n aria-controls={formId}\n aria-expanded={showForm ? 'true' : 'false'}\n data-review-cta=\"\"\n data-review-open=\"\"\n >\n {__('Write a review')}\n </Button>\n ) : null}\n </div>\n\n {!allowForm ? null : submitted ? (\n <SubmittedNotice published={reviewSubmitted.published} />\n ) : !canReview && null !== reason ? (\n <p className=\"ec-reviews__ineligible\" data-review-cta=\"\" data-review-ineligible=\"\">\n {null !== loginUrl ? <Link href={loginUrl}>{reason}</Link> : reason}\n </p>\n ) : null}\n\n <div className={cx('ec-reviews__layout', 0 === total ? 'ec-reviews__layout--single' : null)}>\n {total > 0 ? (\n <Card className=\"ec-reviews__summary\" data-review-summary=\"\">\n <div className=\"ec-reviews__overall\">\n <span className=\"ec-reviews__average\" aria-hidden=\"true\">\n {number(average, 1)}\n </span>\n <span className=\"ec-reviews__overall-detail\">\n <Rating\n value={average}\n readonly\n size=\"md\"\n valueLabel={__(':rating out of 5', { rating: number(average, 0, 1) })}\n />\n <span className=\"ec-reviews__count\">\n {trans_choice(':count review|:count reviews', total, { count: total })}\n </span>\n </span>\n </div>\n\n <ul\n role=\"list\"\n className=\"ec-reviews__breakdown\"\n aria-label={__('Rating breakdown')}\n data-review-histogram=\"\"\n >\n {histogram.map((row) => (\n <li key={row.stars}>\n <button\n type=\"button\"\n className=\"ec-reviews__bar\"\n onClick={() => filter(row.stars)}\n aria-pressed={ratingFilter === row.stars ? 'true' : 'false'}\n disabled={0 === row.count && ratingFilter !== row.stars}\n data-histogram-row={row.stars}\n >\n <span className=\"ec-reviews__bar-stars\" aria-hidden=\"true\">\n {number(row.stars, 0)}\n <Icon name=\"star\" />\n </span>\n <Progress\n value={row.percent}\n size=\"sm\"\n color=\"accent\"\n className=\"ec-reviews__bar-track\"\n aria-hidden=\"true\"\n />\n <span className=\"ec-reviews__bar-count\" aria-hidden=\"true\">\n {number(row.count, 0)}\n </span>\n <span className=\"apui-sr-only\">\n {__(':stars: :reviews (:percent%)', {\n stars: trans_choice(':count star|:count stars', row.stars, {\n count: row.stars,\n }),\n reviews: trans_choice(':count review|:count reviews', row.count, {\n count: row.count,\n }),\n percent: row.percent,\n })}\n </span>\n </button>\n </li>\n ))}\n </ul>\n </Card>\n ) : null}\n\n <div className=\"ec-reviews__main\">\n {showForm && canWrite ? (\n <ReviewForm\n formId={formId}\n guest={guest}\n honeypotName={honeypotName}\n submitUrl={submitUrl}\n onCancel={() => {\n setShowForm(false);\n window.setTimeout(() => openButton.current?.focus(), 0);\n }}\n />\n ) : null}\n\n {null !== ratingFilter ? (\n <div className=\"ec-reviews__filter\" data-review-filter={ratingFilter}>\n <span>\n {trans_choice(\n 'Showing reviews rated :count star|Showing reviews rated :count stars',\n ratingFilter,\n { count: ratingFilter },\n )}\n </span>\n <Button variant=\"ghost\" color=\"neutral\" size=\"sm\" onClick={() => filter(null)}>\n {__('Show all reviews')}\n </Button>\n </div>\n ) : null}\n\n <p className=\"apui-sr-only\" role=\"status\" aria-live=\"polite\">\n {null !== ratingFilter\n ? trans_choice(':count review shown|:count reviews shown', pagination.total, {\n count: pagination.total,\n })\n : null}\n </p>\n\n {reviews.length > 0 ? (\n <>\n <ol role=\"list\" className=\"ec-reviews__list\" data-review-list=\"\">\n {reviews.map((review) => (\n <li key={review.id} className=\"ec-review\" data-review={review.id}>\n <article\n className=\"ec-review__article\"\n aria-labelledby={`ec-review-${review.id}-author`}\n >\n <div className=\"ec-review__heading\">\n <Rating\n value={review.rating}\n readonly\n size=\"sm\"\n valueLabel={__('Rated :rating out of 5', { rating: review.rating })}\n />\n {null !== review.title && '' !== review.title ? (\n <h3 className=\"ec-review__title\">{review.title}</h3>\n ) : null}\n </div>\n\n {null !== review.body && '' !== review.body ? (\n <p className=\"ec-review__body\">{review.body}</p>\n ) : null}\n\n <p className=\"ec-review__meta\">\n <span id={`ec-review-${review.id}-author`} className=\"ec-review__author\">\n {review.author}\n </span>\n {review.verifiedPurchase ? (\n <Badge\n variant=\"soft\"\n color=\"success\"\n leadingIcon=\"check\"\n data-review-verified=\"\"\n >\n {__('Verified purchase')}\n </Badge>\n ) : null}\n <time dateTime={review.date ?? undefined}>{review.dateLabel}</time>\n </p>\n </article>\n </li>\n ))}\n </ol>\n\n <Pagination\n page={pagination.currentPage}\n pageCount={pagination.lastPage}\n total={pagination.total}\n perPage={pagination.perPage}\n summary\n summaryLabel={__('Showing {from} to {to} of {total} reviews')}\n onPageChange={(page) =>\n visitWithQuery(\n url,\n { [pagination.pageName]: 1 === page ? null : page },\n reload,\n visits,\n )\n }\n />\n </>\n ) : null !== ratingFilter ? (\n <EmptyState\n icon=\"search-x\"\n title={__('No reviews with this rating')}\n headingLevel={3}\n size=\"sm\"\n >\n <Button variant=\"outline\" color=\"neutral\" onClick={() => filter(null)}>\n {__('Show all reviews')}\n </Button>\n </EmptyState>\n ) : !showForm ? (\n <EmptyState\n icon=\"message-square\"\n title={__('No reviews yet')}\n description={__('Be the first to review this product.')}\n headingLevel={3}\n />\n ) : null}\n </div>\n </div>\n </section>\n );\n}\n\n/**\n * The thank-you notice, focused when it replaces the form.\n *\n * @param props - Whether the review is already published.\n * @returns The notice.\n */\nfunction SubmittedNotice({ published }: { published: boolean }): ReactElement {\n const notice = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n notice.current?.focus();\n }, []);\n\n return (\n <Alert\n ref={notice}\n color=\"success\"\n icon=\"circle-check\"\n title={\n published\n ? __('Thanks — your review is published')\n : __('Thanks — your review is awaiting moderation')\n }\n role=\"status\"\n tabIndex={-1}\n data-review-cta=\"\"\n data-review-submitted=\"\"\n />\n );\n}\n\n/**\n * The review form.\n *\n * @param props - The form's id, whether the shopper is a guest, the honeypot\n * field's name, where to post, and what Cancel does.\n * @returns The form.\n */\nfunction ReviewForm({\n formId,\n guest,\n honeypotName,\n submitUrl,\n onCancel,\n}: {\n formId: string;\n guest: boolean;\n honeypotName: string;\n submitUrl: string;\n onCancel: () => void;\n}): ReactElement {\n const errors = useErrorBag(REVIEW_ERROR_BAG);\n const { post, processing } = useStorefrontPost(REVIEW_ERROR_BAG);\n const heading = useRef<HTMLHeadingElement>(null);\n const [rating, setRating] = useState(0);\n const [title, setTitle] = useState('');\n const [body, setBody] = useState('');\n const [authorName, setAuthorName] = useState('');\n const [authorEmail, setAuthorEmail] = useState('');\n const [honeypot, setHoneypot] = useState('');\n const fieldIds: Record<string, string> = {\n rating: `${formId}-rating`,\n title: `${formId}-title`,\n body: `${formId}-body`,\n author_name: `${formId}-name`,\n author_email: `${formId}-email`,\n };\n const summary = Object.entries(errors)\n .filter(([key]) => 'review' !== key)\n .map(([key, message]) => ({ field: fieldIds[key] ?? key, message }));\n\n useEffect(() => {\n heading.current?.focus();\n }, []);\n\n const submit = (event: FormEvent<HTMLFormElement>): void => {\n event.preventDefault();\n post(\n submitUrl,\n {\n rating,\n title,\n body,\n ...(guest ? { author_name: authorName, author_email: authorEmail } : {}),\n [honeypotName]: honeypot,\n },\n ['ecommerceStorefront', 'sections', 'feedback', 'product'],\n );\n };\n\n return (\n <Card className=\"ec-review-form-card\">\n <form\n id={formId}\n onSubmit={submit}\n className=\"ec-review-form\"\n aria-labelledby={`${formId}-heading`}\n noValidate\n data-review-form=\"\"\n >\n <h3 ref={heading} id={`${formId}-heading`} tabIndex={-1} className=\"ec-review-form__title\">\n {__('Write a review')}\n </h3>\n\n {summary.length > 0 ? (\n <ValidationSummary\n errors={summary}\n title={trans_choice(\n 'Fix :count thing to continue|Fix :count things to continue',\n summary.length,\n { count: summary.length },\n )}\n id={`${formId}-errors`}\n className=\"ec-error-summary\"\n data-error-summary=\"\"\n />\n ) : null}\n\n {undefined !== errors.review ? (\n <Alert color=\"error\" icon=\"circle-alert\" title={errors.review} data-review-error=\"\" />\n ) : null}\n\n <RatingInput\n id={fieldIds.rating!}\n label={__('Your rating')}\n value={rating}\n onValueChange={setRating}\n error={errors.rating ?? null}\n required\n />\n\n <Field\n id={fieldIds.title!}\n label={__('Title')}\n errorKey=\"title\"\n maxLength={255}\n value={title}\n onValueChange={setTitle}\n error={errors.title ?? null}\n />\n\n <Field\n control=\"textarea\"\n id={fieldIds.body!}\n label={__('Your review')}\n errorKey=\"body\"\n maxLength={10000}\n value={body}\n onValueChange={setBody}\n error={errors.body ?? null}\n attributes={{ rows: 5 }}\n />\n\n {guest ? (\n <div className=\"ec-review-form__pair\">\n <Field\n id={fieldIds.author_name!}\n label={__('Your name')}\n errorKey=\"author_name\"\n autoComplete=\"name\"\n required\n value={authorName}\n onValueChange={setAuthorName}\n error={errors.author_name ?? null}\n />\n <Field\n id={fieldIds.author_email!}\n type=\"email\"\n label={__('Your email')}\n hint={__('Not shown with your review.')}\n errorKey=\"author_email\"\n autoComplete=\"email\"\n required\n value={authorEmail}\n onValueChange={setAuthorEmail}\n error={errors.author_email ?? null}\n />\n </div>\n ) : null}\n\n <div className=\"apui-sr-only\" aria-hidden=\"true\">\n <label htmlFor={`${formId}-${honeypotName}`}>{__('Leave this field empty')}</label>\n <input\n id={`${formId}-${honeypotName}`}\n type=\"text\"\n name={honeypotName}\n value={honeypot}\n onChange={(event) => setHoneypot(event.target.value)}\n tabIndex={-1}\n autoComplete=\"off\"\n />\n </div>\n\n <div className=\"ec-review-form__actions\">\n <Button type=\"submit\" color=\"primary\" disabled={processing} data-review-submit=\"\">\n {__('Submit review')}\n </Button>\n <Button variant=\"ghost\" color=\"neutral\" onClick={onCancel} data-review-cancel=\"\">\n {__('Cancel')}\n </Button>\n </div>\n </form>\n </Card>\n );\n}\n","/**\n * `ec-rating-input`: five star radios for a review's rating.\n *\n * Mirrors ecommerce-storefront-livewire's `<x-artisanpack-ec-rating-input>`:\n * a radiogroup fieldset whose stars light up on hover, with \":rating of 5\"\n * beside them and the error under them.\n *\n * @since 1.0.0\n */\n\nimport {\n __,\n trans_choice,\n type StorefrontRatingInputProps,\n} from '@artisanpack-ui/ecommerce-storefront-core';\nimport { useState, type ReactElement } from 'react';\n\nimport { cx, filled } from '../internal/classes';\nimport { IconSvg } from '../internal/icon';\n\n/**\n * Props for {@link RatingInput}.\n *\n * @since 1.0.0\n */\nexport interface RatingInputProps extends StorefrontRatingInputProps {\n /** The chosen rating, 1–5, or 0 for none. */\n value: number;\n /** Called with the chosen rating. */\n onValueChange: (value: number) => void;\n className?: string;\n}\n\nconst STARS = [1, 2, 3, 4, 5];\n\n/**\n * A star rating input.\n *\n * @since 1.0.0\n *\n * @param props - The value, label and error.\n * @returns The fieldset.\n */\nexport function RatingInput({\n id,\n label = null,\n error = null,\n required = false,\n value,\n onValueChange,\n className,\n}: RatingInputProps): ReactElement {\n const [preview, setPreview] = useState(0);\n const hasError = filled(error);\n const shown = preview || value;\n\n return (\n <fieldset\n className={cx('apui-radio-group ec-rating-input', className)}\n id={id}\n role=\"radiogroup\"\n aria-required={required ? 'true' : undefined}\n data-invalid={hasError ? '' : undefined}\n aria-describedby={hasError ? `${id}-error` : undefined}\n data-rating-input={id}\n >\n <legend data-scope=\"radio-group\" data-part=\"label\">\n {label ?? __('Rating')}\n {required ? (\n <span data-scope=\"radio-group\" data-part=\"required\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </legend>\n\n <div className=\"ec-rating-input__row\">\n <div\n className=\"apui-rating ec-rating-input__stars\"\n data-size=\"lg\"\n data-interactive=\"\"\n onMouseLeave={() => setPreview(0)}\n >\n {STARS.map((star) => (\n <label\n key={star}\n data-scope=\"rating\"\n data-part=\"item\"\n onMouseEnter={() => setPreview(star)}\n >\n <input\n type=\"radio\"\n data-scope=\"rating\"\n data-part=\"control\"\n id={`${id}-${star}`}\n name={id}\n value={star}\n checked={value === star}\n onChange={() => onValueChange(star)}\n aria-label={trans_choice(':count star|:count stars', star, { count: star })}\n required={required && 1 === star ? true : undefined}\n aria-invalid={hasError ? 'true' : undefined}\n />\n <span data-scope=\"rating\" data-part=\"star\" aria-hidden=\"true\">\n <IconSvg name=\"star\" />\n </span>\n </label>\n ))}\n </div>\n\n <span\n className=\"ec-rating-input__value\"\n aria-hidden=\"true\"\n hidden={shown <= 0}\n data-rating-input-value=\"\"\n >\n {shown > 0 ? __(':rating of 5', { rating: shown }) : null}\n </span>\n </div>\n\n {hasError ? (\n <p data-scope=\"radio-group\" data-part=\"error\" id={`${id}-error`} data-rating-input-error=\"\">\n <IconSvg name=\"circle-alert\" />\n {error}\n </p>\n ) : null}\n </fieldset>\n );\n}\n","/**\n * A bare registry icon, for markup that prints the icon's `<svg>` straight\n * into a part (as LUC's `IconRegistry::render()` does), without the design\n * system's `.apui-icon` wrapper.\n *\n * @internal\n */\n\nimport { ICON_SVG_ATTRIBUTES, resolveIcon } from '@artisanpack-ui/behavior/icons';\nimport type { ReactElement, SVGProps } from 'react';\n\nconst SVG_PROPS = Object.fromEntries(\n Object.entries(ICON_SVG_ATTRIBUTES).map(([name, value]) => [\n name.startsWith('aria-')\n ? name\n : name.replace(/-([a-z])/g, (_, char: string) => char.toUpperCase()),\n value,\n ]),\n) as SVGProps<SVGSVGElement>;\n\n/**\n * The `<svg>` of a registered icon, or nothing when the name isn't registered.\n *\n * @param props - The icon name.\n * @returns The svg.\n */\nexport function IconSvg({ name }: { name: string }): ReactElement | null {\n const body = resolveIcon(name);\n\n if (undefined === body) {\n return null;\n }\n\n return <svg {...SVG_PROPS} dangerouslySetInnerHTML={{ __html: body }} />;\n}\n","/**\n * The `sold-out` notice a sold-out product shows under its purchase form.\n *\n * Mirrors ecommerce-storefront-livewire's `livewire/product/partials/sold-out`.\n *\n * @since 1.0.0\n */\n\nimport { __ } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Alert } from '@artisanpack-ui/react';\nimport type { ReactElement } from 'react';\n\n/**\n * Props every `productSections` component drawing a sold-out notice gets.\n *\n * @since 1.0.0\n */\nexport interface SoldOutNoticeProps {\n /**\n * The sold-out product's id. The built-in notice doesn't need it; a\n * notice of your own (a pre-order prompt, say) can use it.\n */\n productId: number;\n}\n\n/**\n * The sold-out notice.\n *\n * @since 1.0.0\n *\n * @param _props - The product's id, which the built-in notice doesn't use.\n * @returns The notice.\n */\nexport function SoldOutNotice(_props: Partial<SoldOutNoticeProps> = {}): ReactElement {\n return (\n <Alert\n color=\"neutral\"\n icon=\"mail\"\n title={__('This item is sold out')}\n className=\"ec-product__sold-out\"\n data-product-sold-out=\"\"\n >\n {__('Check back soon. It may be restocked, and similar pieces are below.')}\n </Alert>\n );\n}\n","/**\n * The built-in product sections and notices (`productSections`). The cart's\n * cross-sells (`cartSections` `related-products`) register from\n * `cart/builtIns.ts`, so they exist when the cart is the first page.\n *\n * @since 1.0.0\n */\n\nimport type { ReactStorefrontRegistries } from '../../registries';\nimport { RecentlyViewed } from './RecentlyViewed';\nimport { RelatedProducts } from './RelatedProducts';\nimport { Reviews } from './Reviews';\nimport { SoldOutNotice } from './SoldOutNotice';\n\n/**\n * Registers `reviews`, `related-products`, `recently-viewed` and `sold-out`\n * in `productSections`.\n *\n * @since 1.0.0\n *\n * @param registries - The client registries.\n */\nexport function registerProductSections(registries: ReactStorefrontRegistries): void {\n registries.productSections.register('reviews', Reviews, { position: 10 });\n registries.productSections.register('related-products', RelatedProducts, { position: 20 });\n registries.productSections.register('recently-viewed', RecentlyViewed, { position: 30 });\n registries.productSections.register('sold-out', SoldOutNotice, { position: 40 });\n}\n","/**\n * Registers the product page's built-in client components: the core\n * purchase forms (`productForms`) and the built-in sections and sold-out\n * notice (`productSections`). The cart's cross-sells are in cart/builtIns.ts.\n *\n * The page wrapper adds them before the first page renders (see\n * src/builtIns.ts); the modules that draw these registries also call\n * {@link registerProductBuiltIns} at load (the product page,\n * {@link StorefrontSections}), for use outside a page.\n *\n * @since 1.0.0\n */\n\nimport { addBuiltInRegistration } from '../registries';\nimport { registerProductForms } from './forms/registerProductForms';\nimport { registerProductSections } from './sections/registerProductSections';\n\nlet registered = false;\n\n/**\n * Adds the built-in registrations once.\n *\n * @since 1.0.0\n */\nexport function registerProductBuiltIns(): void {\n if (registered) {\n return;\n }\n\n registered = true;\n addBuiltInRegistration((registries) => {\n registerProductForms(registries);\n registerProductSections(registries);\n });\n}\n","/**\n * Draws a page's sections from a client registry: the product page's\n * sections (`productSections`) and the cart's (`cartSections`).\n *\n * Each section is `{ key, component, props }`; the component registered\n * under `component` gets the section's props and `sectionKey`, plus any\n * `extra` props the page adds. A section whose component isn't registered\n * draws nothing.\n *\n * @since 1.0.0\n */\n\nimport type { StorefrontProductSection } from '@artisanpack-ui/ecommerce-storefront-core';\nimport type { ReactElement } from 'react';\n\nimport { getRegistries, type ReactStorefrontRegistries } from '../registries';\nimport { registerProductBuiltIns } from './builtIns';\n\nregisterProductBuiltIns();\n\n/**\n * Props for {@link StorefrontSections}.\n *\n * @since 1.0.0\n */\nexport interface StorefrontSectionsProps {\n /** The sections, in order. */\n sections: StorefrontProductSection[];\n /** Which registry draws them. */\n registry: keyof Pick<ReactStorefrontRegistries, 'productSections' | 'cartSections'>;\n /** The wrapper's class (`ec-product__section`) and data attribute name. */\n className?: string;\n /** The data attribute naming each wrapper's key, such as `data-product-section`. */\n keyAttribute?: string;\n /** Props every section gets as well. */\n extra?: Record<string, unknown>;\n}\n\n/**\n * The sections.\n *\n * @since 1.0.0\n *\n * @param props - The sections and their registry.\n * @returns One wrapper per drawn section.\n */\nexport function StorefrontSections({\n sections,\n registry,\n className = 'ec-product__section',\n keyAttribute = 'data-product-section',\n extra = {},\n}: StorefrontSectionsProps): ReactElement {\n const entries = getRegistries()[registry];\n\n return (\n <>\n {sections.map((section) => {\n const entry = entries.get(section.component);\n\n if (undefined === entry) {\n return null;\n }\n\n const Section = entry.component;\n\n return (\n <div key={section.key} className={className} {...{ [keyAttribute]: section.key }}>\n <Section {...extra} {...section.props} sectionKey={section.key} />\n </div>\n );\n })}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAS,MAAAA,YAAiC;AAC1C,SAAS,WAAW,eAAe,SAAAC,QAAO,aAAa,QAAAC,aAAY;AACnE,SAAS,aAAAC,YAAW,SAAS,UAAAC,eAAiC;;;ACH9D,SAAS,mBAAmB;AAC5B,SAAS,UAAsC;AAC/C,SAAS,OAAO,QAAQ,YAAY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CAAC,QACnB,gBAAAC,OAAC,QAAmB,cAAW,SAAQ,aAAU,OAC/C;AAAA,oCAAAD,MAAC,QAAG,OAAM,OAAO,cAAI,OAAM;AAAA,oBAC3B,gBAAAA,MAAC,QAAI,cAAI,OAAM;AAAA,uBAFR,IAAI,KAGb,CACD,GACH;AAAA,mBACF,GACF,GACF;AAAA;AAAA,YACF,IACE;AAAA,YAEH,SAAS,kBACR,gBAAAA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAM;AAAA,gBACN,OAAOI,KAAG,oBAAoB;AAAA,gBAC9B,wBAAqB;AAAA,gBAErB,0BAAAJ,MAAC,SAAI,WAAU,cAAa,yBAAyB,EAAE,QAAQ,gBAAgB,GAAG;AAAA;AAAA,YACpF,IACE;AAAA,aACN;AAAA;AAAA;AAAA,IACF,IACE;AAAA,IAEJ,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,UAAS;AAAA,QACT,OAAO,EAAE,WAAW,QAAQ,IAAI,iBAAiB,SAAS,gBAAgB;AAAA;AAAA,IAC5E;AAAA,KACF;AAEJ;AAEA,YAAY,SAAS;","names":["__","Alert","Icon","useEffect","useRef","__","Badge","useState","__","Button","useState","jsx","jsxs","__","Button","useState","jsx","jsxs","useState","__","Badge","__","Icon","useState","jsx","jsxs","useState","__","Icon","__","Badge","Icon","Input","useState","Fragment","jsx","jsxs","useState","__","Badge","Input","Icon","__","Icon","RadioGroup","useEffect","useRef","useState","Icon","jsx","jsxs","Icon","Fragment","jsx","jsxs","useState","useRef","useEffect","__","RadioGroup","Icon","useState","jsx","useState","__","Icon","useRef","useState","jsx","jsxs","useState","useRef","__","Icon","__","Icon","useEffect","useId","useState","jsx","jsxs","limit","useState","useEffect","__","useId","Icon","__","trans_choice","Alert","Badge","Button","Icon","useEffect","useRef","useState","__","trans_choice","useState","jsx","jsx","jsxs","useState","__","trans_choice","Fragment","jsx","jsxs","useState","useRef","__","Button","trans_choice","Icon","Badge","useEffect","Alert","__","Alert","jsx","Fragment","jsx","jsx","jsxs","useRef","useEffect","__","Alert","Icon"]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cx,
|
|
3
|
+
filled,
|
|
4
|
+
idFragment
|
|
5
|
+
} from "./chunk-VX5TEJNU.mjs";
|
|
6
|
+
|
|
7
|
+
// src/components/Swatches.tsx
|
|
8
|
+
import { Icon } from "@artisanpack-ui/react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function Swatches({
|
|
11
|
+
name,
|
|
12
|
+
legend,
|
|
13
|
+
options,
|
|
14
|
+
multiple = false,
|
|
15
|
+
idPrefix,
|
|
16
|
+
required = false,
|
|
17
|
+
error = null,
|
|
18
|
+
describedBy,
|
|
19
|
+
onValueChange,
|
|
20
|
+
className
|
|
21
|
+
}) {
|
|
22
|
+
const prefix = idPrefix ?? `ec-swatch-${idFragment(name)}`;
|
|
23
|
+
const errorId = `${prefix}-error`;
|
|
24
|
+
const hasError = filled(error);
|
|
25
|
+
const chosen = multiple ? null : options.find((option) => option.selected)?.label ?? null;
|
|
26
|
+
const describedByIds = [describedBy, hasError ? errorId : null].filter(filled).join(" ");
|
|
27
|
+
return /* @__PURE__ */ jsxs(
|
|
28
|
+
"fieldset",
|
|
29
|
+
{
|
|
30
|
+
className: cx("ec-swatches", className),
|
|
31
|
+
"data-swatches": name,
|
|
32
|
+
"aria-describedby": "" !== describedByIds ? describedByIds : void 0,
|
|
33
|
+
"data-invalid": hasError ? "" : void 0,
|
|
34
|
+
tabIndex: hasError ? -1 : void 0,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("legend", { className: "ec-swatches__legend", children: [
|
|
37
|
+
legend,
|
|
38
|
+
null !== chosen ? /* @__PURE__ */ jsxs("span", { className: "ec-swatches__chosen", "data-swatches-chosen": "", children: [
|
|
39
|
+
": ",
|
|
40
|
+
chosen
|
|
41
|
+
] }) : null,
|
|
42
|
+
required ? /* @__PURE__ */ jsx("span", { className: "ec-swatches__required", "aria-hidden": "true", children: "*" }) : null
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ jsx("div", { className: "ec-swatches__options", children: options.map((option, index) => {
|
|
45
|
+
const inputId = `${prefix}-${index}`;
|
|
46
|
+
const hasDot = null !== option.color || null !== option.image;
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
"label",
|
|
49
|
+
{
|
|
50
|
+
htmlFor: inputId,
|
|
51
|
+
className: "ec-swatch",
|
|
52
|
+
"data-dot": hasDot ? "" : void 0,
|
|
53
|
+
"data-sold-out": option.soldOut ? "" : void 0,
|
|
54
|
+
title: option.reason ?? void 0,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
"input",
|
|
58
|
+
{
|
|
59
|
+
id: inputId,
|
|
60
|
+
type: multiple ? "checkbox" : "radio",
|
|
61
|
+
name: multiple ? `${name}[]` : name,
|
|
62
|
+
value: option.value,
|
|
63
|
+
className: "ec-swatch__input",
|
|
64
|
+
checked: option.selected,
|
|
65
|
+
disabled: option.disabled,
|
|
66
|
+
required: required && !multiple ? true : void 0,
|
|
67
|
+
"aria-invalid": hasError ? "true" : void 0,
|
|
68
|
+
onChange: (event) => onValueChange?.(option.value, event.target.checked),
|
|
69
|
+
"data-swatch-value": option.value
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
null !== option.color ? /* @__PURE__ */ jsx(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
className: "ec-swatch__dot",
|
|
76
|
+
style: { backgroundColor: option.color },
|
|
77
|
+
"aria-hidden": "true"
|
|
78
|
+
}
|
|
79
|
+
) : null !== option.image ? /* @__PURE__ */ jsx("img", { src: option.image, alt: "", className: "ec-swatch__dot", "aria-hidden": "true" }) : null,
|
|
80
|
+
/* @__PURE__ */ jsx("span", { className: "ec-swatch__label", children: option.label }),
|
|
81
|
+
null !== option.count ? /* @__PURE__ */ jsxs("span", { className: "ec-swatch__count", children: [
|
|
82
|
+
"(",
|
|
83
|
+
option.count,
|
|
84
|
+
")"
|
|
85
|
+
] }) : null,
|
|
86
|
+
null !== option.meta ? /* @__PURE__ */ jsx("span", { className: "ec-swatch__count", "data-swatch-meta": "", children: option.meta }) : null,
|
|
87
|
+
null !== option.reason ? /* @__PURE__ */ jsxs("span", { className: "apui-sr-only", children: [
|
|
88
|
+
"(",
|
|
89
|
+
option.reason,
|
|
90
|
+
")"
|
|
91
|
+
] }) : null
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
inputId
|
|
95
|
+
);
|
|
96
|
+
}) }),
|
|
97
|
+
hasError ? /* @__PURE__ */ jsxs("p", { id: errorId, className: "ec-swatches__error", "data-swatches-error": "", children: [
|
|
98
|
+
/* @__PURE__ */ jsx(Icon, { name: "circle-alert", "aria-hidden": "true" }),
|
|
99
|
+
error
|
|
100
|
+
] }) : null
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export {
|
|
107
|
+
Swatches
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=chunk-IOL2YQ62.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Swatches.tsx"],"sourcesContent":["/**\n * `ec-swatches`: a fieldset of option chips, with a color dot or image\n * where the option has one.\n *\n * Mirrors ecommerce-storefront-livewire's `<x-artisanpack-ec-swatches>`:\n * radios (or checkboxes with `multiple`), the chosen label beside the\n * legend, counts and price differences, and a reason (\"Sold out\") for an\n * option that can't be chosen. The options say which are selected; the\n * parent updates them through `onValueChange`.\n *\n * @since 1.0.0\n */\n\nimport type { StorefrontSwatchOption } from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Icon } from '@artisanpack-ui/react';\nimport type { ReactElement } from 'react';\n\nimport { cx, filled, idFragment } from '../internal/classes';\n\n/**\n * Props for {@link Swatches}.\n *\n * @since 1.0.0\n */\nexport interface SwatchesProps {\n /** The input name. */\n name: string;\n /** The fieldset's legend. */\n legend: string;\n options: StorefrontSwatchOption[];\n /** Checkboxes instead of radios. */\n multiple?: boolean;\n /** The inputs' id prefix. Defaults to `ec-swatch-{name}`. */\n idPrefix?: string;\n required?: boolean;\n error?: string | null;\n /** Extra ids describing the fieldset. */\n describedBy?: string;\n /** Called when an option is chosen (or, with `multiple`, checked or unchecked). */\n onValueChange?: (value: string, checked: boolean) => void;\n className?: string;\n}\n\n/**\n * Option swatches.\n *\n * @since 1.0.0\n *\n * @param props - The options and fieldset settings.\n * @returns The fieldset.\n */\nexport function Swatches({\n name,\n legend,\n options,\n multiple = false,\n idPrefix,\n required = false,\n error = null,\n describedBy,\n onValueChange,\n className,\n}: SwatchesProps): ReactElement {\n const prefix = idPrefix ?? `ec-swatch-${idFragment(name)}`;\n const errorId = `${prefix}-error`;\n const hasError = filled(error);\n const chosen = multiple ? null : (options.find((option) => option.selected)?.label ?? null);\n const describedByIds = [describedBy, hasError ? errorId : null].filter(filled).join(' ');\n\n return (\n <fieldset\n className={cx('ec-swatches', className)}\n data-swatches={name}\n aria-describedby={'' !== describedByIds ? describedByIds : undefined}\n data-invalid={hasError ? '' : undefined}\n tabIndex={hasError ? -1 : undefined}\n >\n <legend className=\"ec-swatches__legend\">\n {legend}\n {null !== chosen ? (\n <span className=\"ec-swatches__chosen\" data-swatches-chosen=\"\">\n : {chosen}\n </span>\n ) : null}\n {required ? (\n <span className=\"ec-swatches__required\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </legend>\n\n <div className=\"ec-swatches__options\">\n {options.map((option, index) => {\n const inputId = `${prefix}-${index}`;\n const hasDot = null !== option.color || null !== option.image;\n\n return (\n <label\n key={inputId}\n htmlFor={inputId}\n className=\"ec-swatch\"\n data-dot={hasDot ? '' : undefined}\n data-sold-out={option.soldOut ? '' : undefined}\n title={option.reason ?? undefined}\n >\n <input\n id={inputId}\n type={multiple ? 'checkbox' : 'radio'}\n name={multiple ? `${name}[]` : name}\n value={option.value}\n className=\"ec-swatch__input\"\n checked={option.selected}\n disabled={option.disabled}\n required={required && !multiple ? true : undefined}\n aria-invalid={hasError ? 'true' : undefined}\n onChange={(event) => onValueChange?.(option.value, event.target.checked)}\n data-swatch-value={option.value}\n />\n\n {null !== option.color ? (\n <span\n className=\"ec-swatch__dot\"\n style={{ backgroundColor: option.color }}\n aria-hidden=\"true\"\n />\n ) : null !== option.image ? (\n <img src={option.image} alt=\"\" className=\"ec-swatch__dot\" aria-hidden=\"true\" />\n ) : null}\n\n <span className=\"ec-swatch__label\">{option.label}</span>\n\n {null !== option.count ? (\n <span className=\"ec-swatch__count\">({option.count})</span>\n ) : null}\n\n {null !== option.meta ? (\n <span className=\"ec-swatch__count\" data-swatch-meta=\"\">\n {option.meta}\n </span>\n ) : null}\n\n {null !== option.reason ? (\n <span className=\"apui-sr-only\">({option.reason})</span>\n ) : null}\n </label>\n );\n })}\n </div>\n\n {hasError ? (\n <p id={errorId} className=\"ec-swatches__error\" data-swatches-error=\"\">\n <Icon name=\"circle-alert\" aria-hidden=\"true\" />\n {error}\n </p>\n ) : null}\n </fieldset>\n );\n}\n"],"mappings":";;;;;;;AAcA,SAAS,YAAY;AAkEX,SAKA,KALA;AA7BH,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AACF,GAAgC;AAC9B,QAAM,SAAS,YAAY,aAAa,WAAW,IAAI,CAAC;AACxD,QAAM,UAAU,GAAG,MAAM;AACzB,QAAM,WAAW,OAAO,KAAK;AAC7B,QAAM,SAAS,WAAW,OAAQ,QAAQ,KAAK,CAAC,WAAW,OAAO,QAAQ,GAAG,SAAS;AACtF,QAAM,iBAAiB,CAAC,aAAa,WAAW,UAAU,IAAI,EAAE,OAAO,MAAM,EAAE,KAAK,GAAG;AAEvF,SACE;AAAA,IAAC;AAAA;A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