@dropins/storefront-product-discovery 1.0.0-beta.1 → 1.0.0-beta2
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/package.json +1 -1
- package/render.js +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-product-discovery", "version": "1.0.0-
|
|
1
|
+
{"name": "@dropins/storefront-product-discovery", "version": "1.0.0-beta2", "@dropins/tools": "^1.3.0-beta1", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
(function(o,t){try{if(typeof document<"u"){const r=document.createElement("style"),d=t.styleId;for(const e in t.attributes)r.setAttribute(e,t.attributes[e]);r.setAttribute("data-dropin",d),r.appendChild(document.createTextNode(o));const i=document.querySelector('style[data-dropin="sdk"]');if(i)i.after(r);else{const e=document.querySelector('link[rel="stylesheet"], style');e?e.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})(`.dropin-product-item-card__skeleton{gap:var(--spacing-small)}.dropin-product-item-card__skeleton__image{height:375px}.dropin-product-item-card__skeleton__content{grid-column:1/-1}.dropin-product-item-card{display:grid;position:relative;grid-auto-flow:row;background:var(--color-neutral-50);border:1px solid var(--color-neutral-400);color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin:var(--spacing-small);width:300px}.dropin-product-item-card__image-container{overflow:hidden;width:100%;height:auto}.dropin-product-item-card__image img{width:100%;max-height:375px}.dropin-product-item-card__content{display:grid;grid-template-columns:1fr 1fr;padding:var(--spacing-small);gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.dropin-product-item-card__title,.dropin-product-item-card__sku,.dropin-product-item-card__price,.dropin-product-item-card__swatches,.dropin-product-item-card__action{grid-column:1/3}.dropin-product-item-card__title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing)}.dropin-product-item-card__sku,.dropin-product-item-card__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.dropin-product-item-card__swatches{margin-top:var(--spacing-xsmall)}.dropin-product-item-card__action{margin-top:var(--spacing-xsmall);width:100%}
|
|
4
4
|
.product-discovery-product-list,.product-discovery-product-list__container{display:flex;flex-direction:column;width:100%}.product-discovery-product-list__grid{display:grid;grid-template-columns:1fr 1fr;margin-top:var(--spacing-small)}.product-discovery-product-list__grid .dropin-product-item-card{text-align:left;border:1px solid transparent;width:200px}.product-discovery-product-list__grid .dropin-product-item-card:hover{border:1px solid var(--color-neutral-400);box-shadow:0 0 var(--spacing-xsmall) 0 #a9a9a9;padding:none}.product-discovery-product-list__grid .dropin-product-item-card a:hover{text-decoration:none;color:var(--color-neutral-800)}.product-discovery-product-list__header{display:flex;flex-direction:row-reverse;width:100%}.product-discovery-product-list__picker{width:15.625rem;display:inline-block}.product-discovery-product-item__image{min-height:250px}@media only screen and (min-width: 768px){.product-discovery-product-list__grid{grid-template-columns:repeat(3,1fr)}}@media only screen and (min-width: 1366px){.product-discovery-product-list__grid{grid-template-columns:repeat(4,1fr)}}.product-discovery-search-alert-message__wrapper{display:flex;flex-direction:column;justify-content:center;width:100%;min-height:300px}.product-discovery-search-alert-message__content{display:flex;justify-content:center}.product-discovery-facet__bucket .dropin-price-range .dropin-price--small.dropin-price--bold{font:var(--type-body-2-default-font)}.product-discovery-facet__bucket .dropin-radio-button__label:before{margin-right:var(--spacing-xsmall)}.product-discovery-facet-list{display:flex;flex-direction:column;width:100%}.product-discovery-facet-list__selected-filters{display:flex;flex-direction:row;flex-wrap:wrap;row-gap:var(--spacing-xxsmall);padding:0 0 var(--spacing-xxsmall) 0}.product-discovery-facet-list__selected-filters button{padding:0 var(--spacing-xxsmall);margin:0 var(--spacing-xxsmall);border-radius:var(--shape-border-radius-2)}.product-discovery-facet-list__selected-filters .dropin-price-range .dropin-price--small.dropin-price--bold{font:var(--type-button-2-font)}.product-discovery-facet-list__facet-options{text-align:left}.product-discovery-facet-list__facet-options button{padding:0}.product-discovery-facet-list__facet-options .dropin-radio-button{padding:var(--spacing-xxsmall) 0}.product-discovery-facet-list__facet-options--hidden{display:none}.product-discovery-facet-list__show-filters-button{display:flex;margin:0 0 var(--spacing-xsmall) 0}.product-discovery-facet-list .dropin-divider{margin:var(--spacing-xsmall) 0 var(--spacing-xsmall) 0}@media only screen and (min-width: 768px){.product-discovery-facet-list{min-width:13.12rem}.product-discovery-facet-list__facet-options{display:flex;flex-direction:column}.product-discovery-facet-list__show-filters-button{display:none}}
|
|
5
|
-
.product-discovery--search-bar-results{position:absolute;top:100%;left:0;right:0;z-index:1000;display:flex;align-items:flex-start;justify-content:flex-end;pointer-events:none}.product-discovery--search-bar-results__popover{position:relative;background:var(--color-neutral-50, #fff);box-shadow:0 10px 25px -3px #0000001a,0 4px 6px -2px #0000000d,0 0 0 1px #0000000d;width:100%;
|
|
5
|
+
.product-discovery--search-bar-results{position:absolute;top:100%;left:0;right:0;z-index:1000;display:flex;align-items:flex-start;justify-content:flex-end;pointer-events:none}.product-discovery--search-bar-results__popover{position:relative;background:var(--color-neutral-50, #fff);box-shadow:0 10px 25px -3px #0000001a,0 4px 6px -2px #0000000d,0 0 0 1px #0000000d;width:100%;overflow:hidden;z-index:1001;animation:popoverSlideIn .2s ease-out;pointer-events:auto;display:flex;flex-direction:column;height:100%;min-height:0}.product-discovery--search-bar-results__outer-container{display:flex;flex-direction:column;padding:var(--spacing-small, 1rem)}@keyframes popoverSlideIn{0%{opacity:0;transform:translateY(-10px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}.product-discovery--search-bar-results__grid{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-small, 1rem);overflow-y:auto;flex:1;min-height:0}.product-discovery--search-bar-results__grid>*{min-width:0;overflow:hidden}.product-discovery--search-bar-results__view-all-wrapper{flex-shrink:0;border-top:1px solid var(--color-neutral-200, #e5e5e5);background:var(--color-neutral-300)}.product-discovery--search-bar-results__view-all-button{display:flex;justify-content:center;width:100%}.product-discovery--search-bar-results__grid::-webkit-scrollbar{width:.5rem}.product-discovery--search-bar-results__grid::-webkit-scrollbar-track{background:var(--color-neutral-100, #f5f5f5);border-radius:.25rem}.product-discovery--search-bar-results__grid::-webkit-scrollbar-thumb{background:var(--color-neutral-400, #d4d4d4);border-radius:.25rem}.product-discovery--search-bar-results__grid::-webkit-scrollbar-thumb:hover{background:var(--color-neutral-500, #a3a3a3)}@media only screen and (min-width: 48rem){.product-discovery--search-bar-results{padding-top:.25rem}.product-discovery--search-bar-results__grid{gap:var(--spacing-medium, 1.5rem);padding:var(--spacing-medium, 1.5rem)}}.product-discovery--product-item{display:flex;flex-flow:column nowrap;gap:var(--spacing-small);width:auto;align-items:center;cursor:pointer;text-decoration:none;color:inherit;font-weight:var(--font-weight-regular, 600)}.product-discovery--product-item:hover,.product-discovery--product-item:focus{box-shadow:0 2px 8px #0000001a;text-decoration:none}.product-discovery--product-item__image .dropin-image{width:10rem;height:10rem;max-width:10rem;max-height:10rem;object-fit:cover;border-radius:var(--shape-border-radius-2, 4px)}.product-discovery--product-item__details{display:flex;flex-flow:column nowrap;justify-content:space-between;width:100%}.product-discovery--product-item__details [data-slot=ProductPrice]{text-align:start}
|
|
6
6
|
.product-discovery--search-bar-input__container{display:flex;align-items:center;width:100%}.product-discovery--search-bar-input__form{display:flex;align-items:center}
|
|
7
7
|
.product-discovery-results-info{display:none}.product-discovery-results-info__search-phrase--upercase{text-transform:capitalize}@media only screen and (min-width: 768px){.product-discovery-results-info{display:flex;flex-direction:row;gap:var(--spacing-xsmall);width:100%;padding:var(--spacing-xsmall);text-align:center}}`,{styleId:"storefront-product-discovery"});
|
|
8
8
|
import{jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{Render as c}from"@dropins/tools/lib.js";import{useState as i,useEffect as a}from"@dropins/tools/preact-hooks.js";import{UIProvider as l}from"@dropins/tools/components.js";import{events as u}from"@dropins/tools/event-bus.js";const h={PLP:{Warning:{minQueryLength:"Your search term {SEARCH_PHRASE} has not reached the minimum of {{minQueryLength}} characters.",noResults:"Your search returned no results.",searchError:"An error occurred while searching."},SortDropdown:{title:"Sort by",option:"Sort by: {{selectedOption}}",relevanceLabel:"Most Relevant",positionLabel:"Position",sortAttributeASC:"{{label}}: Low to High",sortAttributeDESC:"{{label}}: High to Low",sortASC:"Price: Low to High",sortDESC:"Price: High to Low",productName:"Product Name",productInStock:"In Stock",productLowStock:"Low Stock"}},Facet:{showMore:"Show more",showLess:"Show less",clearAll:"Clear all"},ResultsInfo:{resultsFor:"Results for",products:"products"},SearchInput:{placeholder:"Search",viewAllButton:"View All"}},S={Search:h},m={default:S},d=({children:r})=>{const[t,n]=i("en_US");return a(()=>{const e=u.on("locale",s=>{n(s)},{eager:!0});return()=>{e==null||e.off()}},[]),o(l,{lang:t,langDefinitions:m,children:r})},A=new c(o(d,{}));export{A as render};
|