yt-uikit 0.9.26-progress-bar-ui.7 → 0.9.26-progress-bar-ui.8

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/dist/esm/index.js CHANGED
@@ -1473,7 +1473,8 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
1473
1473
  justify-content: space-between;
1474
1474
  align-items: center;
1475
1475
  margin-inline: 1rem;
1476
- margin-bottom: 12px;
1476
+ margin-bottom: 0px;
1477
+ margin-top: 6px;
1477
1478
  cursor: pointer;
1478
1479
  `,gi=c.span`
1479
1480
  font-size: 14px;
@@ -1498,7 +1499,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
1498
1499
  display: grid;
1499
1500
  grid-template-rows: ${e=>e.$isOpen?"1fr":"0fr"};
1500
1501
  opacity: ${e=>e.$isOpen?1:0};
1501
- margin-top: ${e=>e.$isOpen?"12px":"0"};
1502
+ margin-top: ${e=>e.$isOpen?"10px":"0"};
1502
1503
  transition:
1503
1504
  grid-template-rows 0.3s ease-in-out,
1504
1505
  opacity 0.3s ease-in-out,
@@ -1529,10 +1530,10 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
1529
1530
  &:focus {
1530
1531
  border: 1px solid #000;
1531
1532
  }
1532
- `,vi=c.label`
1533
+ `,vi=c.span`
1533
1534
  position: absolute;
1534
1535
  top: -10px;
1535
- left: 12px;
1536
+ left: 25px;
1536
1537
  display: inline-block;
1537
1538
  padding: 0 6px;
1538
1539
  font-size: 14px;
@@ -1541,7 +1542,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
1541
1542
  color: #333;
1542
1543
  pointer-events: none;
1543
1544
  transition: all 0.15s ease-in-out;
1544
- `,wi=({note:r,noteSectionTitle:o="ORDER NOTE"})=>{const[i,a]=le(Lr),[l,c]=t(!1);return n(()=>{""===i&&r&&""!==r&&a(r)},[r,i,a]),e.createElement(ui,{className:"yt-cart-note-section form-group"},e.createElement(mi,{className:"yt-cart-note-header",onClick:()=>c(!l)},e.createElement(gi,{className:"yt-cart-note-label"},o.toUpperCase(),e.createElement(ee,{className:"info-icon"})),e.createElement(xi,{className:"yt-cart-note-toggle icon-transition "+(l?"rotated":""),$isOpen:l},e.createElement(V,null))),e.createElement(fi,{className:"note-collapse-wrapper "+(l?"is-open":""),$isOpen:l},e.createElement(yi,{className:"note-collapse-inner"},e.createElement(bi,{className:"textarea-container"},e.createElement(hi,{className:"yt-cart-note-textarea floating-input-note",value:i,onChange:e=>a(e.target.value)}),e.createElement(vi,{className:"floating-label"},"Add Message here")))))},Ci=(e,t)=>!!t&&(!e?.tracksInventory||(!t?.inventoryItem?.tracked||("continue"===t.inventoryPolicy||t.inventoryQuantity>0))),Ei=e=>{if(null!=e)return mn(String(e))},ki=(e,t)=>{const n=Ei(e),r=Ei(t);return Boolean(n&&r&&n===r)},Ti=e=>{const t=e?._claim_allowed_variants;return Array.isArray(t)&&t.length>0?t.map(String):[]},Si=e=>{const t=(e=>e?.variants?.edges?.filter(t=>Ci(e,t?.node))||[])(e),n=Ti(e);return n.length?t.filter(e=>n.some(t=>ki(t,e?.node?.id))):[]},$i=e=>{const t=Si(e)[0]?.node?.id;return Ei(t)},Bi=e=>Si(e).length>0,zi=(e,t)=>t?.find(t=>t.couponTemplateId===e?.couponTemplateId),Ni=(e,t,n)=>t?e.filter(e=>{const r=n.find(t=>String(t?.id)===e);return r?.couponTemplateId===t}).length:0,Ii=({product:e,selectedProductIds:t,freebieProducts:n,freebieCouponTemplates:r,fallbackMaxFreebies:o=1,fallbackLimitReached:i=!1})=>{const a=zi(e,r);if(!a)return i||t.length>=o;const l=a.maxFreebiesInTier??1;return Ni(t,a.couponTemplateId,n)>=l},Fi=(e,t)=>{if(!t)return!1;const n=mn(t);return[...e?.customerGetsProductIds?.ids??[],...e?._allVariantIds??[]].some(e=>{const r=String(e);return ki(r,t)||r===n})},Pi=(e,t,n=1)=>{if(!e?.length)return 0;const r=new Map;e.forEach(e=>{const t=e?.couponTemplateId??"__default__";r.set(t,(r.get(t)??0)+1)});let o=0;return r.forEach((e,r)=>{const i="number"==typeof r?t?.find(e=>e.couponTemplateId===r):void 0,a=i?.maxFreebiesInTier??n;o+=Math.min(e,a)}),o},Di=(e,t,n)=>{const r=Si(e);if(0===r.length)return{selectedVariantId:void 0,selectedVariantGid:void 0,selectedVariantPrice:0,availableVariants:[],displayVariantCount:0,effectiveDiscount:1,effectiveDiscountPercentage:0,effectivePrice:0,dealAmount:0,showOptions:!1,isFree:!0,isNoDiscount:!1};let o;n&&(o=r.find(e=>ki(e?.node?.id,n))),o||(o=r[0]);const i=o?.node?.id,a=mn(i),l=Number(o?.node?.price)||0,c=t?.find(e=>Fi(e,i)),s="no_discount"===c?.freebieType,d="percentage_off"===c?.freebieType?Number(c?.discountPercentage)||0:Number(e?.percentageOffOnCustomerGetsProducts)||0,p=d?.01*d:1;let u=0;"deal_amount"===c?.freebieType&&c.discountValue&&(u=c.discountValue);const m=s?l:1===p?0:(1-p)*l;return{selectedVariantId:a,selectedVariantGid:i,selectedVariantPrice:l,availableVariants:r,displayVariantCount:e?._claim_allowed_variants?.length||1,effectiveDiscount:p,effectiveDiscountPercentage:d,effectivePrice:m,dealAmount:u,showOptions:e?.variants?.edges?.length>1,isFree:!s&&0===m,isNoDiscount:s}},Ai=c.div`
1545
+ `,wi=({note:r,noteSectionTitle:o="Order Note"})=>{const[i,a]=le(Lr),[l,c]=t(!1);return n(()=>{""===i&&r&&""!==r&&a(r)},[r,i,a]),e.createElement(ui,{className:"yt-cart-note-section form-group"},e.createElement(mi,{className:"yt-cart-note-header",onClick:()=>c(!l)},e.createElement(gi,{className:"yt-cart-note-label"},o,e.createElement(ee,{className:"info-icon"})),e.createElement(xi,{className:"yt-cart-note-toggle icon-transition "+(l?"rotated":""),$isOpen:l},e.createElement(V,null))),e.createElement(fi,{className:"note-collapse-wrapper "+(l?"is-open":""),$isOpen:l},e.createElement(yi,{className:"note-collapse-inner"},e.createElement(bi,{className:"textarea-container"},e.createElement(hi,{className:"yt-cart-note-textarea floating-input-note",value:i,onChange:e=>a(e.target.value)}),e.createElement(vi,{className:"floating-label"},"Add Message here")))))},Ci=(e,t)=>!!t&&(!e?.tracksInventory||(!t?.inventoryItem?.tracked||("continue"===t.inventoryPolicy||t.inventoryQuantity>0))),Ei=e=>{if(null!=e)return mn(String(e))},ki=(e,t)=>{const n=Ei(e),r=Ei(t);return Boolean(n&&r&&n===r)},Ti=e=>{const t=e?._claim_allowed_variants;return Array.isArray(t)&&t.length>0?t.map(String):[]},Si=e=>{const t=(e=>e?.variants?.edges?.filter(t=>Ci(e,t?.node))||[])(e),n=Ti(e);return n.length?t.filter(e=>n.some(t=>ki(t,e?.node?.id))):[]},$i=e=>{const t=Si(e)[0]?.node?.id;return Ei(t)},Bi=e=>Si(e).length>0,zi=(e,t)=>t?.find(t=>t.couponTemplateId===e?.couponTemplateId),Ni=(e,t,n)=>t?e.filter(e=>{const r=n.find(t=>String(t?.id)===e);return r?.couponTemplateId===t}).length:0,Ii=({product:e,selectedProductIds:t,freebieProducts:n,freebieCouponTemplates:r,fallbackMaxFreebies:o=1,fallbackLimitReached:i=!1})=>{const a=zi(e,r);if(!a)return i||t.length>=o;const l=a.maxFreebiesInTier??1;return Ni(t,a.couponTemplateId,n)>=l},Fi=(e,t)=>{if(!t)return!1;const n=mn(t);return[...e?.customerGetsProductIds?.ids??[],...e?._allVariantIds??[]].some(e=>{const r=String(e);return ki(r,t)||r===n})},Pi=(e,t,n=1)=>{if(!e?.length)return 0;const r=new Map;e.forEach(e=>{const t=e?.couponTemplateId??"__default__";r.set(t,(r.get(t)??0)+1)});let o=0;return r.forEach((e,r)=>{const i="number"==typeof r?t?.find(e=>e.couponTemplateId===r):void 0,a=i?.maxFreebiesInTier??n;o+=Math.min(e,a)}),o},Di=(e,t,n)=>{const r=Si(e);if(0===r.length)return{selectedVariantId:void 0,selectedVariantGid:void 0,selectedVariantPrice:0,availableVariants:[],displayVariantCount:0,effectiveDiscount:1,effectiveDiscountPercentage:0,effectivePrice:0,dealAmount:0,showOptions:!1,isFree:!0,isNoDiscount:!1};let o;n&&(o=r.find(e=>ki(e?.node?.id,n))),o||(o=r[0]);const i=o?.node?.id,a=mn(i),l=Number(o?.node?.price)||0,c=t?.find(e=>Fi(e,i)),s="no_discount"===c?.freebieType,d="percentage_off"===c?.freebieType?Number(c?.discountPercentage)||0:Number(e?.percentageOffOnCustomerGetsProducts)||0,p=d?.01*d:1;let u=0;"deal_amount"===c?.freebieType&&c.discountValue&&(u=c.discountValue);const m=s?l:1===p?0:(1-p)*l;return{selectedVariantId:a,selectedVariantGid:i,selectedVariantPrice:l,availableVariants:r,displayVariantCount:e?._claim_allowed_variants?.length||1,effectiveDiscount:p,effectiveDiscountPercentage:d,effectivePrice:m,dealAmount:u,showOptions:e?.variants?.edges?.length>1,isFree:!s&&0===m,isNoDiscount:s}},Ai=c.div`
1545
1546
  display: flex;
1546
1547
  flex-direction: row;
1547
1548
  column-gap: 10px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.9.26-progress-bar-ui.7",
3
+ "version": "0.9.26-progress-bar-ui.8",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "rm -rf dist && tsc && rollup -c",