@sps-woodland/core 8.56.1 → 8.56.2
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/lib/action-bar/action-bar/ActionBar.ve.js +1 -1
- package/lib/action-bar/index.js +1 -1
- package/lib/action-bar/index.umd.cjs +1 -1
- package/lib/action-bar/style.css +1 -1
- package/lib/add-to-list/add-to-list/AddToList.css.d.ts.map +1 -1
- package/lib/add-to-list/add-to-list/AddToList.d.ts.map +1 -1
- package/lib/add-to-list/add-to-list/AddToList.js +185 -178
- package/lib/add-to-list/add-to-list/AddToList.ve.js +1 -1
- package/lib/add-to-list/add-to-list/ItemsList.d.ts.map +1 -1
- package/lib/add-to-list/add-to-list/ItemsList.js +32 -31
- package/lib/add-to-list/index.js +244 -235
- package/lib/add-to-list/index.umd.cjs +1 -1
- package/lib/add-to-list/style.css +1 -1
- package/lib/buttons/button/Button.css.d.ts.map +1 -1
- package/lib/buttons/button/Button.ve.js +1 -1
- package/lib/buttons/index.js +1 -1
- package/lib/buttons/index.umd.cjs +1 -1
- package/lib/buttons/style.css +1 -1
- package/lib/cards/card/Card.css.d.ts.map +1 -1
- package/lib/cards/card/Card.ve.js +1 -1
- package/lib/cards/card-footer/CardFooter.ve.js +1 -1
- package/lib/cards/card-header/CardHeader.ve.js +1 -1
- package/lib/cards/card-title/CardTitle.ve.js +1 -1
- package/lib/cards/index.js +4 -4
- package/lib/cards/index.umd.cjs +1 -1
- package/lib/cards/style.css +1 -1
- package/lib/column-manager/column-manager/ColumnManager.d.ts.map +1 -1
- package/lib/column-manager/column-manager/ColumnManager.js +45 -45
- package/lib/components/icon/Icon.ve.js +1 -1
- package/lib/content-row/content-row/ContentRow.ve.js +1 -1
- package/lib/content-row/content-row-col/ContentRowCol.ve.js +1 -1
- package/lib/content-row/index.js +3 -3
- package/lib/content-row/index.umd.cjs +1 -1
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +1 -1
- package/lib/content-row/style.css +1 -1
- package/lib/content-tiles/content-tile/ContentTile.css.d.ts.map +1 -1
- package/lib/content-tiles/content-tile/ContentTile.ve.js +1 -1
- package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +1 -1
- package/lib/content-tiles/index.js +2 -2
- package/lib/content-tiles/index.umd.cjs +1 -1
- package/lib/content-tiles/style.css +1 -1
- package/lib/core.css +1 -1
- package/lib/dropdowns/dropdown/Dropdown.css.d.ts.map +1 -1
- package/lib/dropdowns/dropdown/Dropdown.ve.js +1 -1
- package/lib/dropdowns/index.js +3 -3
- package/lib/dropdowns/index.umd.cjs +1 -1
- package/lib/dropdowns/option-list/Option.css.d.ts.map +1 -1
- package/lib/dropdowns/option-list/Option.ve.js +1 -1
- package/lib/dropdowns/option-list/OptionList.ve.js +1 -1
- package/lib/dropdowns/style.css +1 -1
- package/lib/feedback-block/FeedbackBlock.ve.js +1 -1
- package/lib/feedback-block/index.js +1 -1
- package/lib/feedback-block/index.umd.cjs +1 -1
- package/lib/feedback-block/style.css +1 -1
- package/lib/file-upload/file-upload/FileUpload.ve.js +1 -1
- package/lib/file-upload/index.js +1 -1
- package/lib/file-upload/index.umd.cjs +1 -1
- package/lib/file-upload/style.css +1 -1
- package/lib/filter-tiles/filter-tile/FilterTile.css.d.ts.map +1 -1
- package/lib/filter-tiles/filter-tile/FilterTile.d.ts.map +1 -1
- package/lib/filter-tiles/filter-tile/FilterTile.js +30 -17
- package/lib/filter-tiles/filter-tile/FilterTile.ve.js +1 -1
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +1 -1
- package/lib/filter-tiles/index.js +66 -53
- package/lib/filter-tiles/index.umd.cjs +1 -1
- package/lib/filter-tiles/style.css +1 -1
- package/lib/focused-task/focused-task/FocusedTask.ve.js +1 -1
- package/lib/focused-task/index.js +1 -1
- package/lib/focused-task/index.umd.cjs +1 -1
- package/lib/focused-task/style.css +1 -1
- package/lib/growler/Growler.ve.js +1 -1
- package/lib/growler/Sonner.ve.js +1 -1
- package/lib/growler/index.js +2 -2
- package/lib/growler/index.umd.cjs +1 -1
- package/lib/growler/style.css +1 -1
- package/lib/index.js +8 -8
- package/lib/index.umd.cjs +1 -1
- package/lib/insight-card/InsightCard.ve.js +1 -1
- package/lib/insight-card/index.js +1 -1
- package/lib/insight-card/index.umd.cjs +1 -1
- package/lib/insight-card/style.css +1 -1
- package/lib/key-value-set/index.js +2 -2
- package/lib/key-value-set/index.umd.cjs +1 -1
- package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +1 -1
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +1 -1
- package/lib/key-value-set/style.css +1 -1
- package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +1 -1
- package/lib/list-bar/index.js +3 -3
- package/lib/list-bar/index.umd.cjs +1 -1
- package/lib/list-bar/list-bar/ListBar.ve.js +1 -1
- package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +1 -1
- package/lib/list-bar/style.css +1 -1
- package/lib/matrix/index.js +1 -1
- package/lib/matrix/index.umd.cjs +1 -1
- package/lib/matrix/matrix/Matrix.ve.js +1 -1
- package/lib/matrix/style.css +1 -1
- package/lib/modal/index.js +1 -1
- package/lib/modal/index.umd.cjs +1 -1
- package/lib/modal/modal/Modal.ve.js +1 -1
- package/lib/modal/style.css +1 -1
- package/lib/page-title/index.js +2 -2
- package/lib/page-title/index.umd.cjs +1 -1
- package/lib/page-title/page-subtitle/PageSubtitle.ve.js +1 -1
- package/lib/page-title/page-title/PageTitle.ve.js +1 -1
- package/lib/page-title/style.css +1 -1
- package/lib/photo/index.js +68 -64
- package/lib/photo/index.umd.cjs +1 -1
- package/lib/photo/photo/Photo.ve.js +1 -1
- package/lib/photo/photo-carousel/PhotoCarousel.css.d.ts.map +1 -1
- package/lib/photo/photo-carousel/PhotoCarousel.d.ts.map +1 -1
- package/lib/photo/photo-carousel/PhotoCarousel.js +36 -32
- package/lib/photo/photo-carousel/PhotoCarousel.ve.js +1 -1
- package/lib/photo/style.css +1 -1
- package/lib/product-bar/index.js +3 -3
- package/lib/product-bar/index.umd.cjs +1 -1
- package/lib/product-bar/product-bar/ProductBar.ve.js +1 -1
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +1 -1
- package/lib/product-bar/slack-link/SlackLink.ve.js +1 -1
- package/lib/product-bar/style.css +1 -1
- package/lib/product-bar-vertical/index.js +1 -1
- package/lib/product-bar-vertical/index.umd.cjs +1 -1
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +1 -1
- package/lib/product-bar-vertical/style.css +1 -1
- package/lib/progress-indicators/index.js +1 -1
- package/lib/progress-indicators/index.umd.cjs +1 -1
- package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +1 -1
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +1 -1
- package/lib/progress-indicators/style.css +1 -1
- package/lib/rich-text-editor/index.js +2 -2
- package/lib/rich-text-editor/index.umd.cjs +1 -1
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.css.d.ts.map +1 -1
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +1 -1
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +1 -1
- package/lib/rich-text-editor/style.css +1 -1
- package/lib/scrollable-container/ScrollableContainer.ve.js +1 -1
- package/lib/scrollable-container/index.js +1 -1
- package/lib/scrollable-container/index.umd.cjs +1 -1
- package/lib/scrollable-container/style.css +1 -1
- package/lib/side-nav/index.js +84 -72
- package/lib/side-nav/index.umd.cjs +1 -1
- package/lib/side-nav/side-nav/SideNav.css.d.ts.map +1 -1
- package/lib/side-nav/side-nav/SideNav.ve.js +1 -1
- package/lib/side-nav/side-nav-item/SideNavItem.d.ts.map +1 -1
- package/lib/side-nav/side-nav-item/SideNavItem.js +51 -39
- package/lib/side-nav/style.css +1 -1
- package/lib/sorting-header/caret/caret.ve.js +1 -1
- package/lib/sorting-header/index.js +154 -146
- package/lib/sorting-header/index.umd.cjs +1 -1
- package/lib/sorting-header/sorting-header/SortingHeader.ve.js +1 -1
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.css.d.ts +2 -0
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.css.d.ts.map +1 -1
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.d.ts.map +1 -1
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.js +49 -41
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +4 -2
- package/lib/sorting-header/style.css +1 -1
- package/lib/style.css +1 -1
- package/lib/tabs/index.js +51 -50
- package/lib/tabs/index.umd.cjs +1 -1
- package/lib/tabs/style.css +1 -1
- package/lib/tabs/tab/Tab.css.d.ts.map +1 -1
- package/lib/tabs/tab/Tab.ve.js +1 -1
- package/lib/tabs/tab-panel/TabPanel.d.ts.map +1 -1
- package/lib/tabs/tab-panel/TabPanel.js +12 -10
- package/lib/tabs/tabs/Tabs.css.d.ts +1 -0
- package/lib/tabs/tabs/Tabs.css.d.ts.map +1 -1
- package/lib/tabs/tabs/Tabs.ve.js +2 -1
- package/lib/tags/clickable-tag/ClickableTag.css.d.ts +1 -1
- package/lib/tags/clickable-tag/ClickableTag.css.d.ts.map +1 -1
- package/lib/tags/clickable-tag/ClickableTag.d.ts.map +1 -1
- package/lib/tags/clickable-tag/ClickableTag.js +59 -39
- package/lib/tags/clickable-tag/ClickableTag.ve.js +1 -1
- package/lib/tags/index.js +109 -89
- package/lib/tags/index.umd.cjs +1 -1
- package/lib/tags/split-tag/SplitTag.css.d.ts.map +1 -1
- package/lib/tags/split-tag/SplitTag.ve.js +1 -1
- package/lib/tags/style.css +1 -1
- package/lib/tags/tag/Tag.ve.js +1 -1
- package/lib/zero-state/ZeroState.ve.js +1 -1
- package/lib/zero-state/index.js +1 -1
- package/lib/zero-state/index.umd.cjs +1 -1
- package/lib/zero-state/style.css +1 -1
- package/package.json +10 -10
package/lib/modal/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem0{background-color:#fff;border-style:solid;border-width:.0625rem;border-radius:.25rem;display:flex;flex-direction:column;overflow:hidden;max-height:100%}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem1{border-color:#007db8}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem2,.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem3{border-color:#de002e}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem4{border-color:#0b8940}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem5,.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem6{border-color:#e7760b}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem7{border-color:#4b5356}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem8{width:23.75rem}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksem9{width:36.25rem}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksema{width:48.75rem}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemb{width:73.75rem}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemc{height:100%}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41kseme{align-items:center;color:#fff;display:flex;padding:1rem}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemf{background-color:#4b5356}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemg,.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemh{background-color:#de002e}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemi{background-color:#007db8}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemj{background-color:#0b8940}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemk,.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41kseml{background-color:#e7760b}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemm{flex-grow:1;font-size:.875rem;font-weight:600;line-height:1.25rem}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemn{font-weight:600;line-height:.875rem;font-size:.875rem;margin-right:.5rem}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemo{overflow-y:auto;padding:1rem;flex:1}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemp{align-items:center;background-color:#f3f4f4;display:flex;justify-content:flex-end;padding:.5rem}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemq{color:#fff;border-width:0}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksemr{padding:0 .25rem}.pkg_sps-woodland_core__family_modal__version_8_56_2__hash_41ksems{position:fixed;z-index:1000;inset:0;background:#f3f4f4cc;display:flex;align-items:start;justify-content:center;padding:4rem 1rem 1rem}.z-stratum-dropdown{z-index:1100}
|
package/lib/page-title/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import { Metadata as d, modChildren as h, Icon as c, cl as o, selectChildren as u, addClassName as w } from "@sps-woodland/core";
|
|
3
|
-
var f = "pkg_sps-woodland_core__family_page-
|
|
3
|
+
var f = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_14qi3ku0", y = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_14qi3ku1";
|
|
4
4
|
function p({
|
|
5
5
|
children: _,
|
|
6
6
|
className: t,
|
|
@@ -24,7 +24,7 @@ function E({
|
|
|
24
24
|
function C() {
|
|
25
25
|
return e.useContext(m);
|
|
26
26
|
}
|
|
27
|
-
var k = "pkg_sps-woodland_core__family_page-
|
|
27
|
+
var k = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl00", N = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl01", T = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl02", x = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl03";
|
|
28
28
|
function P({
|
|
29
29
|
as: _,
|
|
30
30
|
children: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react"),require("@sps-woodland/core")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core"],o):(e=typeof globalThis<"u"?globalThis:e||self,o(e.PageTitle={},e.react,e.spsWoodlandCore))})(this,(function(e,o,a){"use strict";function m(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const _ in t)if(_!=="default"){const l=Object.getOwnPropertyDescriptor(t,_);Object.defineProperty(n,_,l.get?l:{enumerable:!0,get:()=>t[_]})}}return n.default=t,Object.freeze(n)}const i=m(o);var v="pkg_sps-woodland_core__family_page-
|
|
1
|
+
(function(e,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react"),require("@sps-woodland/core")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core"],o):(e=typeof globalThis<"u"?globalThis:e||self,o(e.PageTitle={},e.react,e.spsWoodlandCore))})(this,(function(e,o,a){"use strict";function m(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const _ in t)if(_!=="default"){const l=Object.getOwnPropertyDescriptor(t,_);Object.defineProperty(n,_,l.get?l:{enumerable:!0,get:()=>t[_]})}}return n.default=t,Object.freeze(n)}const i=m(o);var v="pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_14qi3ku0",h="pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_14qi3ku1";function r({children:t,className:n,..._}){const l=a.modChildren(t,s=>s.type===a.Icon?[{className:a.cl(s.props.className,h)}]:[]);return i.createElement("div",{className:a.cl(v,n),..._},i.Children.toArray(l))}a.Metadata.set(r,{name:"Page Subtitle"});const d=i.createContext(void 0);function w({level:t,children:n}){return i.createElement(d.Provider,{value:t},n)}function c(){return i.useContext(d)}var y="pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl00",b="pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl01",P="pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl02",T="pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl03";function p({as:t,children:n,className:_,...l}){const[[s],C,u]=a.selectChildren(n,[{type:a.Icon},{type:r}]),g=c(),f=t??(g?`h${g}`:"h1"),k=s?a.addClassName(s,P):"";return i.createElement("div",{className:a.cl(y,_),...l},k,i.createElement("div",{className:b},f==="div"?u:i.createElement(f,{className:T},u),C))}a.Metadata.set(p,{name:"Page Title"}),e.HeadingLevelProvider=w,e.PageSubtitle=r,e.PageTitle=p,e.useHeadingLevel=c,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
var e = "pkg_sps-woodland_core__family_page-
|
|
2
|
+
var e = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_14qi3ku0", a = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_14qi3ku1";
|
|
3
3
|
export {
|
|
4
4
|
e as pageSubtitle,
|
|
5
5
|
a as pageSubtitleIcon
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
var e = "pkg_sps-woodland_core__family_page-
|
|
2
|
+
var e = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl00", a = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl01", l = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl02", o = "pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl03";
|
|
3
3
|
export {
|
|
4
4
|
e as pageTitle,
|
|
5
5
|
o as pageTitleHeading,
|
package/lib/page-title/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-woodland_core__family_page-
|
|
1
|
+
.pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_14qi3ku0{color:#4b5356;font-size:1.125rem;line-height:1.125rem;margin-top:.25rem}.pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_14qi3ku1{font-size:.75rem;line-height:1.125rem;margin-left:.25rem;margin-right:.25rem;margin-top:.25rem}.pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl00{display:flex;flex-direction:row}.pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl01{color:#1f282c;display:flex;flex-direction:column;font-size:1.5rem;line-height:1.5rem}.pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl02{align-self:flex-start;font-size:1.125rem;line-height:1.5rem;margin-right:.25rem;margin-top:.1875rem}.pkg_sps-woodland_core__family_page-title__version_8_56_2__hash_6nwwl03{color:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0}
|
package/lib/photo/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import { Metadata as
|
|
2
|
+
import { Metadata as R, cl as d, Icon as x, selectChildren as j } from "@sps-woodland/core";
|
|
3
3
|
import { grid as h } from "@sps-woodland/tokens";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
function
|
|
4
|
+
import { Button as v } from "@sps-woodland/core/buttons";
|
|
5
|
+
import { useWoodlandLanguage as S } from "@spscommerce/i18n";
|
|
6
|
+
function W(e, a, o) {
|
|
7
7
|
return a in e ? Object.defineProperty(e, a, {
|
|
8
8
|
value: o,
|
|
9
9
|
enumerable: !0,
|
|
@@ -11,7 +11,7 @@ function B(e, a, o) {
|
|
|
11
11
|
writable: !0
|
|
12
12
|
}) : e[a] = o, e;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function w(e, a) {
|
|
15
15
|
var o = Object.keys(e);
|
|
16
16
|
if (Object.getOwnPropertySymbols) {
|
|
17
17
|
var t = Object.getOwnPropertySymbols(e);
|
|
@@ -21,18 +21,18 @@ function b(e, a) {
|
|
|
21
21
|
}
|
|
22
22
|
return o;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function g(e) {
|
|
25
25
|
for (var a = 1; a < arguments.length; a++) {
|
|
26
26
|
var o = arguments[a] != null ? arguments[a] : {};
|
|
27
|
-
a % 2 ?
|
|
28
|
-
|
|
29
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) :
|
|
27
|
+
a % 2 ? w(Object(o), !0).forEach(function(t) {
|
|
28
|
+
W(e, t, o[t]);
|
|
29
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : w(Object(o)).forEach(function(t) {
|
|
30
30
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(o, t));
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
return e;
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var B = (e, a, o) => {
|
|
36
36
|
for (var t of Object.keys(e)) {
|
|
37
37
|
var n;
|
|
38
38
|
if (e[t] !== ((n = a[t]) !== null && n !== void 0 ? n : o[t]))
|
|
@@ -40,24 +40,24 @@ var F = (e, a, o) => {
|
|
|
40
40
|
}
|
|
41
41
|
return !0;
|
|
42
42
|
}, m = (e) => (a) => {
|
|
43
|
-
var o = e.defaultClassName, t =
|
|
43
|
+
var o = e.defaultClassName, t = g(g({}, e.defaultVariants), a);
|
|
44
44
|
for (var n in t) {
|
|
45
45
|
var i, c = (i = t[n]) !== null && i !== void 0 ? i : e.defaultVariants[n];
|
|
46
46
|
if (c != null) {
|
|
47
|
-
var
|
|
48
|
-
typeof
|
|
49
|
-
var
|
|
47
|
+
var l = c;
|
|
48
|
+
typeof l == "boolean" && (l = l === !0 ? "true" : "false");
|
|
49
|
+
var _ = (
|
|
50
50
|
// @ts-expect-error
|
|
51
|
-
e.variantClassNames[n][
|
|
51
|
+
e.variantClassNames[n][l]
|
|
52
52
|
);
|
|
53
|
-
|
|
53
|
+
_ && (o += " " + _);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
for (var [
|
|
57
|
-
|
|
56
|
+
for (var [u, s] of e.compoundVariants)
|
|
57
|
+
B(u, t, e.defaultVariants) && (o += " " + s);
|
|
58
58
|
return o;
|
|
59
|
-
},
|
|
60
|
-
function
|
|
59
|
+
}, D = m({ defaultClassName: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w0", variantClassNames: { placeholder: { true: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w1", false: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w2" } }, defaultVariants: { placeholder: !1 }, compoundVariants: [] }), F = m({ defaultClassName: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w3", variantClassNames: { mode: { fill: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w4", fit: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w5" } }, defaultVariants: { mode: "fill" }, compoundVariants: [] }), z = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w6";
|
|
60
|
+
function P({
|
|
61
61
|
className: e,
|
|
62
62
|
src: a,
|
|
63
63
|
altText: o,
|
|
@@ -65,64 +65,64 @@ function E({
|
|
|
65
65
|
placeholderIcon: n = "photo",
|
|
66
66
|
...i
|
|
67
67
|
}) {
|
|
68
|
-
const c = r.useRef(null),
|
|
68
|
+
const c = r.useRef(null), l = r.useRef(null), _ = r.useRef(null), u = r.useRef(null), [s, C] = r.useState(), [E, N] = r.useState(!1);
|
|
69
69
|
r.useEffect(() => {
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
const f =
|
|
70
|
+
l.current && (_.current && (window.clearInterval(_.current), _.current = null), _.current = window.setInterval(() => {
|
|
71
|
+
if (l.current) {
|
|
72
|
+
const f = l.current.getBoundingClientRect();
|
|
73
73
|
if (f.height) {
|
|
74
|
-
|
|
74
|
+
_.current && (window.clearInterval(_.current), _.current = null);
|
|
75
75
|
const p = f.width / f.height > 1;
|
|
76
|
-
|
|
76
|
+
N(p === (t === "fit"));
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}, 1e3 / 60));
|
|
80
|
-
}, [c.current,
|
|
81
|
-
|
|
80
|
+
}, [c.current, l.current, a]), r.useEffect(() => {
|
|
81
|
+
u.current && (window.clearInterval(u.current), u.current = null), u.current = window.setInterval(() => {
|
|
82
82
|
if (c.current) {
|
|
83
83
|
const f = c.current.getBoundingClientRect();
|
|
84
|
-
f.width && (
|
|
84
|
+
f.width && (O(f.width), u.current && (window.clearInterval(u.current), u.current = null));
|
|
85
85
|
}
|
|
86
86
|
}, 1e3 / 60);
|
|
87
87
|
}, [c.current]);
|
|
88
|
-
function
|
|
88
|
+
function O(f) {
|
|
89
89
|
if (f) {
|
|
90
|
-
const p = document?.body?.parentElement?.style?.fontSize || "16px",
|
|
91
|
-
|
|
90
|
+
const p = document?.body?.parentElement?.style?.fontSize || "16px", V = Number(p.substring(0, p.length - 2));
|
|
91
|
+
C(f / V);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
if (typeof
|
|
96
|
-
return
|
|
94
|
+
function I() {
|
|
95
|
+
if (typeof s < "u")
|
|
96
|
+
return s * 0.05;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
if (typeof
|
|
100
|
-
return 0.75 *
|
|
98
|
+
function k() {
|
|
99
|
+
if (typeof s < "u")
|
|
100
|
+
return 0.75 * s;
|
|
101
101
|
}
|
|
102
102
|
return /* @__PURE__ */ r.createElement(
|
|
103
103
|
"div",
|
|
104
104
|
{
|
|
105
105
|
ref: c,
|
|
106
|
-
className: d(
|
|
106
|
+
className: d(D({ placeholder: !a }), e),
|
|
107
107
|
style: {
|
|
108
|
-
width: `${
|
|
109
|
-
fontSize: `${
|
|
110
|
-
height: `${
|
|
108
|
+
width: `${s}` && `${s}rem`,
|
|
109
|
+
fontSize: `${I()}rem`,
|
|
110
|
+
height: `${k()}rem`
|
|
111
111
|
},
|
|
112
112
|
...i
|
|
113
113
|
},
|
|
114
|
-
a ?
|
|
114
|
+
a ? s ? /* @__PURE__ */ r.createElement(
|
|
115
115
|
"img",
|
|
116
116
|
{
|
|
117
|
-
className:
|
|
118
|
-
ref:
|
|
117
|
+
className: F({ mode: E ? "fit" : "fill" }),
|
|
118
|
+
ref: l,
|
|
119
119
|
src: a,
|
|
120
120
|
alt: o
|
|
121
121
|
}
|
|
122
|
-
) : /* @__PURE__ */ r.createElement("span", null) : /* @__PURE__ */ r.createElement(
|
|
122
|
+
) : /* @__PURE__ */ r.createElement("span", null) : /* @__PURE__ */ r.createElement(x, { className: z, icon: n })
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
R.set(P, {
|
|
126
126
|
name: "Photo",
|
|
127
127
|
props: {
|
|
128
128
|
src: "string",
|
|
@@ -134,46 +134,50 @@ V.set(E, {
|
|
|
134
134
|
placeholderIcon: "IconName"
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
|
-
var
|
|
138
|
-
function
|
|
137
|
+
var b = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba10", y = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba11", L = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba12", A = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba13", H = m({ defaultClassName: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba14", variantClassNames: { selected: { true: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba15", false: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba16" } }, defaultVariants: { selected: !1 }, compoundVariants: [] });
|
|
138
|
+
function G({
|
|
139
139
|
children: e,
|
|
140
140
|
className: a,
|
|
141
141
|
...o
|
|
142
142
|
}) {
|
|
143
|
-
const [t] =
|
|
144
|
-
function
|
|
143
|
+
const [t] = j(e, [{ type: P }]), [n, i] = r.useState(0), { t: c } = S();
|
|
144
|
+
function l() {
|
|
145
145
|
n + 1 === t.length ? i(0) : i(n + 1);
|
|
146
146
|
}
|
|
147
147
|
function _() {
|
|
148
148
|
i(n === 0 ? t.length - 1 : n - 1);
|
|
149
149
|
}
|
|
150
|
-
return /* @__PURE__ */ r.createElement("div", { className: h.root, ...o }, /* @__PURE__ */ r.createElement("div", { className: d(
|
|
150
|
+
return /* @__PURE__ */ r.createElement("div", { className: h.root, ...o }, /* @__PURE__ */ r.createElement("div", { className: d(b) }, /* @__PURE__ */ r.createElement("div", { className: d(y) }, /* @__PURE__ */ r.createElement(
|
|
151
151
|
v,
|
|
152
152
|
{
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
kind: "icon",
|
|
154
|
+
icon: "arrow-left-circle",
|
|
155
|
+
"aria-label": c("photo.previousPhoto", {
|
|
156
|
+
defaultValue: "Previous Photo"
|
|
157
|
+
}),
|
|
156
158
|
onClick: _
|
|
157
159
|
}
|
|
158
|
-
))), /* @__PURE__ */ r.createElement("div", { className: h[10] }, /* @__PURE__ */ r.createElement("div", { className: d(
|
|
160
|
+
))), /* @__PURE__ */ r.createElement("div", { className: h[10] }, /* @__PURE__ */ r.createElement("div", { className: d(A, h[12]) }, t[n]), /* @__PURE__ */ r.createElement("div", { className: d(L, h[12]) }, t.map((u, s) => /* @__PURE__ */ r.createElement(
|
|
159
161
|
"button",
|
|
160
162
|
{
|
|
161
163
|
tabIndex: 0,
|
|
162
164
|
className: d(H({ selected: s === n })),
|
|
163
165
|
onClick: () => i(s)
|
|
164
166
|
},
|
|
165
|
-
|
|
166
|
-
)))), /* @__PURE__ */ r.createElement("div", { className: d(
|
|
167
|
+
u
|
|
168
|
+
)))), /* @__PURE__ */ r.createElement("div", { className: d(b) }, /* @__PURE__ */ r.createElement("div", { className: d(y) }, /* @__PURE__ */ r.createElement(
|
|
167
169
|
v,
|
|
168
170
|
{
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
kind: "icon",
|
|
172
|
+
icon: "arrow-right-circle",
|
|
173
|
+
"aria-label": c("photo.nextPhoto", {
|
|
174
|
+
defaultValue: "Next Photo"
|
|
175
|
+
}),
|
|
176
|
+
onClick: l
|
|
173
177
|
}
|
|
174
178
|
))));
|
|
175
179
|
}
|
|
176
180
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
P as Photo,
|
|
182
|
+
G as PhotoCarousel
|
|
179
183
|
};
|
package/lib/photo/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(s,
|
|
1
|
+
(function(s,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("@sps-woodland/core"),require("@sps-woodland/tokens"),require("@sps-woodland/core/buttons"),require("@spscommerce/i18n")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@sps-woodland/tokens","@sps-woodland/core/buttons","@spscommerce/i18n"],h):(s=typeof globalThis<"u"?globalThis:s||self,h(s.Photo={},s.react,s.spsWoodlandCore,s.spsWoodlandTokens,s.spsWoodlandCoreButtons,s.spscommerceI18n))})(this,(function(s,h,c,m,b,N){"use strict";function E(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const n=E(h);function I(e,o,t){return o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}function y(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,r)}return t}function P(e){for(var o=1;o<arguments.length;o++){var t=arguments[o]!=null?arguments[o]:{};o%2?y(Object(t),!0).forEach(function(r){I(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var j=(e,o,t)=>{for(var r of Object.keys(e)){var a;if(e[r]!==((a=o[r])!==null&&a!==void 0?a:t[r]))return!1}return!0},w=e=>o=>{var t=e.defaultClassName,r=P(P({},e.defaultVariants),o);for(var a in r){var u,d=(u=r[a])!==null&&u!==void 0?u:e.defaultVariants[a];if(d!=null){var l=d;typeof l=="boolean"&&(l=l===!0?"true":"false");var i=e.variantClassNames[a][l];i&&(t+=" "+i)}}for(var[f,_]of e.compoundVariants)j(f,r,e.defaultVariants)&&(t+=" "+_);return t},k=w({defaultClassName:"pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w0",variantClassNames:{placeholder:{true:"pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w1",false:"pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w2"}},defaultVariants:{placeholder:!1},compoundVariants:[]}),S=w({defaultClassName:"pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w3",variantClassNames:{mode:{fill:"pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w4",fit:"pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w5"}},defaultVariants:{mode:"fill"},compoundVariants:[]}),V="pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w6";function g({className:e,src:o,altText:t,mode:r="fill",placeholderIcon:a="photo",...u}){const d=n.useRef(null),l=n.useRef(null),i=n.useRef(null),f=n.useRef(null),[_,D]=n.useState(),[T,q]=n.useState(!1);n.useEffect(()=>{l.current&&(i.current&&(window.clearInterval(i.current),i.current=null),i.current=window.setInterval(()=>{if(l.current){const p=l.current.getBoundingClientRect();if(p.height){i.current&&(window.clearInterval(i.current),i.current=null);const v=p.width/p.height>1;q(v===(r==="fit"))}}},1e3/60))},[d.current,l.current,o]),n.useEffect(()=>{f.current&&(window.clearInterval(f.current),f.current=null),f.current=window.setInterval(()=>{if(d.current){const p=d.current.getBoundingClientRect();p.width&&(z(p.width),f.current&&(window.clearInterval(f.current),f.current=null))}},1e3/60)},[d.current]);function z(p){if(p){const v=document?.body?.parentElement?.style?.fontSize||"16px",A=Number(v.substring(0,v.length-2));D(p/A)}}function F(){if(typeof _<"u")return _*.05}function L(){if(typeof _<"u")return .75*_}return n.createElement("div",{ref:d,className:c.cl(k({placeholder:!o}),e),style:{width:`${_}`&&`${_}rem`,fontSize:`${F()}rem`,height:`${L()}rem`},...u},o?_?n.createElement("img",{className:S({mode:T?"fit":"fill"}),ref:l,src:o,alt:t}):n.createElement("span",null):n.createElement(c.Icon,{className:V,icon:a}))}c.Metadata.set(g,{name:"Photo",props:{src:"string",altText:"string",mode:{type:'"fill" | "fit"',default:'"fill"'},placeholderIcon:"IconName"}});var O="pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba10",C="pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba11",R="pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba12",x="pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba13",W=w({defaultClassName:"pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba14",variantClassNames:{selected:{true:"pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba15",false:"pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba16"}},defaultVariants:{selected:!1},compoundVariants:[]});function B({children:e,className:o,...t}){const[r]=c.selectChildren(e,[{type:g}]),[a,u]=n.useState(0),{t:d}=N.useWoodlandLanguage();function l(){a+1===r.length?u(0):u(a+1)}function i(){u(a===0?r.length-1:a-1)}return n.createElement("div",{className:m.grid.root,...t},n.createElement("div",{className:c.cl(O)},n.createElement("div",{className:c.cl(C)},n.createElement(b.Button,{kind:"icon",icon:"arrow-left-circle","aria-label":d("photo.previousPhoto",{defaultValue:"Previous Photo"}),onClick:i}))),n.createElement("div",{className:m.grid[10]},n.createElement("div",{className:c.cl(x,m.grid[12])},r[a]),n.createElement("div",{className:c.cl(R,m.grid[12])},r.map((f,_)=>n.createElement("button",{tabIndex:0,className:c.cl(W({selected:_===a})),onClick:()=>u(_)},f)))),n.createElement("div",{className:c.cl(O)},n.createElement("div",{className:c.cl(C)},n.createElement(b.Button,{kind:"icon",icon:"arrow-right-circle","aria-label":d("photo.nextPhoto",{defaultValue:"Next Photo"}),onClick:l}))))}s.Photo=g,s.PhotoCarousel=B,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { createRuntimeFn as _ } from "../../node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.17.4/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js";
|
|
3
|
-
var s = _({ defaultClassName: "pkg_sps-
|
|
3
|
+
var s = _({ defaultClassName: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w0", variantClassNames: { placeholder: { true: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w1", false: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w2" } }, defaultVariants: { placeholder: !1 }, compoundVariants: [] }), r = _({ defaultClassName: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w3", variantClassNames: { mode: { fill: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w4", fit: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w5" } }, defaultVariants: { mode: "fill" }, compoundVariants: [] }), e = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w6";
|
|
4
4
|
export {
|
|
5
5
|
r as photo,
|
|
6
6
|
e as photoPlaceholder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhotoCarousel.css.d.ts","sourceRoot":"","sources":["../../../src/photo/photo-carousel/PhotoCarousel.css.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,0BAA0B,QAGrC,CAAC;AAEH,eAAO,MAAM,mBAAmB,QAG9B,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAI5B,CAAC;AAEH,eAAO,MAAM,yBAAyB,QAIpC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;
|
|
1
|
+
{"version":3,"file":"PhotoCarousel.css.d.ts","sourceRoot":"","sources":["../../../src/photo/photo-carousel/PhotoCarousel.css.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,0BAA0B,QAGrC,CAAC;AAEH,eAAO,MAAM,mBAAmB,QAG9B,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAI5B,CAAC;AAEH,eAAO,MAAM,yBAAyB,QAIpC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;EAoBjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhotoCarousel.d.ts","sourceRoot":"","sources":["../../../src/photo/photo-carousel/PhotoCarousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAY,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAcnE,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"PhotoCarousel.d.ts","sourceRoot":"","sources":["../../../src/photo/photo-carousel/PhotoCarousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAY,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAcnE,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,YAAY,CAwD9D"}
|
|
@@ -1,48 +1,52 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
import { selectChildren as
|
|
3
|
-
import { Photo as
|
|
4
|
-
import { grid as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
function
|
|
9
|
-
children:
|
|
10
|
-
className:
|
|
11
|
-
...
|
|
2
|
+
import { selectChildren as v, cl as t } from "@sps-woodland/core";
|
|
3
|
+
import { Photo as E } from "../photo/Photo.js";
|
|
4
|
+
import { grid as l } from "@sps-woodland/tokens";
|
|
5
|
+
import { photoCarouselButtonWrapper as i, photoCarouselButton as s, photoCarouselDisplayPhoto as N, photoCarouselList as P, photoCarouselListPhoto as C } from "./PhotoCarousel.ve.js";
|
|
6
|
+
import { Button as m } from "@sps-woodland/core/buttons";
|
|
7
|
+
import { useWoodlandLanguage as x } from "@spscommerce/i18n";
|
|
8
|
+
function y({
|
|
9
|
+
children: u,
|
|
10
|
+
className: g,
|
|
11
|
+
...h
|
|
12
12
|
}) {
|
|
13
|
-
const [
|
|
14
|
-
function
|
|
15
|
-
o + 1 ===
|
|
13
|
+
const [r] = v(u, [{ type: E }]), [o, a] = e.useState(0), { t: c } = x();
|
|
14
|
+
function p() {
|
|
15
|
+
o + 1 === r.length ? a(0) : a(o + 1);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
a(o === 0 ?
|
|
17
|
+
function d() {
|
|
18
|
+
a(o === 0 ? r.length - 1 : o - 1);
|
|
19
19
|
}
|
|
20
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
21
|
-
|
|
20
|
+
return /* @__PURE__ */ e.createElement("div", { className: l.root, ...h }, /* @__PURE__ */ e.createElement("div", { className: t(i) }, /* @__PURE__ */ e.createElement("div", { className: t(s) }, /* @__PURE__ */ e.createElement(
|
|
21
|
+
m,
|
|
22
22
|
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
kind: "icon",
|
|
24
|
+
icon: "arrow-left-circle",
|
|
25
|
+
"aria-label": c("photo.previousPhoto", {
|
|
26
|
+
defaultValue: "Previous Photo"
|
|
27
|
+
}),
|
|
28
|
+
onClick: d
|
|
27
29
|
}
|
|
28
|
-
))), /* @__PURE__ */ e.createElement("div", { className:
|
|
30
|
+
))), /* @__PURE__ */ e.createElement("div", { className: l[10] }, /* @__PURE__ */ e.createElement("div", { className: t(N, l[12]) }, r[o]), /* @__PURE__ */ e.createElement("div", { className: t(P, l[12]) }, r.map((f, n) => /* @__PURE__ */ e.createElement(
|
|
29
31
|
"button",
|
|
30
32
|
{
|
|
31
33
|
tabIndex: 0,
|
|
32
|
-
className: t(
|
|
33
|
-
onClick: () => a(
|
|
34
|
+
className: t(C({ selected: n === o })),
|
|
35
|
+
onClick: () => a(n)
|
|
34
36
|
},
|
|
35
|
-
|
|
36
|
-
)))), /* @__PURE__ */ e.createElement("div", { className: t(i) }, /* @__PURE__ */ e.createElement("div", { className: t(
|
|
37
|
-
|
|
37
|
+
f
|
|
38
|
+
)))), /* @__PURE__ */ e.createElement("div", { className: t(i) }, /* @__PURE__ */ e.createElement("div", { className: t(s) }, /* @__PURE__ */ e.createElement(
|
|
39
|
+
m,
|
|
38
40
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
kind: "icon",
|
|
42
|
+
icon: "arrow-right-circle",
|
|
43
|
+
"aria-label": c("photo.nextPhoto", {
|
|
44
|
+
defaultValue: "Next Photo"
|
|
45
|
+
}),
|
|
46
|
+
onClick: p
|
|
43
47
|
}
|
|
44
48
|
))));
|
|
45
49
|
}
|
|
46
50
|
export {
|
|
47
|
-
|
|
51
|
+
y as PhotoCarousel
|
|
48
52
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { createRuntimeFn as _ } from "../../node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.17.4/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js";
|
|
3
|
-
var s = "pkg_sps-
|
|
3
|
+
var s = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba10", e = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba11", r = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba12", p = "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba13", t = _({ defaultClassName: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba14", variantClassNames: { selected: { true: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba15", false: "pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba16" } }, defaultVariants: { selected: !1 }, compoundVariants: [] });
|
|
4
4
|
export {
|
|
5
5
|
e as photoCarouselButton,
|
|
6
6
|
s as photoCarouselButtonWrapper,
|
package/lib/photo/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w0{align-items:center;display:flex;justify-content:center;overflow:hidden;padding:0!important;vertical-align:middle}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w1{background:#f3f4f4;box-shadow:inset .0625rem 0 #d2d4d4,inset -.0625rem 0 #d2d4d4,inset 0 .0625rem #d2d4d4,inset 0 -.0625rem #d2d4d4,inset 1em 0 #fff,inset -1em 0 #fff,inset 0 1em #fff,inset 0 -1em #fff}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w3{visibility:hidden}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w4{height:100%;visibility:visible;width:auto}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w5{height:auto;visibility:visible;width:100%}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1orib4w6{font-size:6em;text-align:center;color:#717779}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba10{display:table;float:right}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba11{display:table-cell;vertical-align:middle}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba12{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba13{display:block;margin-bottom:.5rem;width:100%}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba14{display:block;background:transparent;border:0;cursor:pointer;padding:0}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba14:focus{outline-color:#007db8;outline-style:solid;outline-offset:.125rem;outline-width:.125rem;box-shadow:0 0 0 6px #fff}.pkg_sps-woodland_core__family_photo__version_8_56_2__hash_1744ba16{opacity:.4}
|
package/lib/product-bar/index.js
CHANGED
|
@@ -56,7 +56,7 @@ var ce = (e, n, r) => {
|
|
|
56
56
|
for (var [m, i] of e.compoundVariants)
|
|
57
57
|
ce(m, a, e.defaultVariants) && (r += " " + i);
|
|
58
58
|
return r;
|
|
59
|
-
}, ie = "pkg_sps-woodland_core__family_product-
|
|
59
|
+
}, ie = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux0", ue = H({ defaultClassName: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux1", variantClassNames: { fullWidth: { true: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux2", false: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux3" } }, defaultVariants: { fullWidth: !1 }, compoundVariants: [] }), de = H({ defaultClassName: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux4", variantClassNames: { hideNameText: { true: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux5", false: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux6" } }, defaultVariants: { hideNameText: !1 }, compoundVariants: [] }), fe = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux7", pe = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux8", me = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux9", he = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxa", X = H({ defaultClassName: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxb", variantClassNames: { active: { true: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxc", false: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxd" }, disabled: { true: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxe", false: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxf" } }, defaultVariants: { active: !1, disabled: !1 }, compoundVariants: [] }), ge = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxg", ve = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxh", be = H({ defaultClassName: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxi", variantClassNames: { priorityPlus: { true: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxj", false: "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxk" } }, defaultVariants: { priorityPlus: !1 }, compoundVariants: [] });
|
|
60
60
|
function Y(e) {
|
|
61
61
|
const n = t.useRef(null), { linkProps: r } = ae(e, n), { active: a, priority: s, ...o } = e, l = e.as ?? (e.href ? "a" : "button"), _ = {
|
|
62
62
|
...o,
|
|
@@ -114,7 +114,7 @@ D.set(Z, {
|
|
|
114
114
|
hideNameText: { type: "boolean", default: "false" }
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
|
-
var we = "pkg_sps-woodland_core__family_product-
|
|
117
|
+
var we = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn0", ke = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn1", Re = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn2", z = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn3", K = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn4";
|
|
118
118
|
function Ce({
|
|
119
119
|
items: e,
|
|
120
120
|
wrapperRef: n
|
|
@@ -376,7 +376,7 @@ D.set(je, {
|
|
|
376
376
|
enablePriorityPlus: { type: "boolean", default: "true" }
|
|
377
377
|
}
|
|
378
378
|
});
|
|
379
|
-
var Ie = "pkg_sps-woodland_core__family_product-
|
|
379
|
+
var Ie = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_pqijiy0", xe = "pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_pqijiy1";
|
|
380
380
|
function Pe({
|
|
381
381
|
channelId: e,
|
|
382
382
|
className: n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(u,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("react"),require("@sps-woodland/core"),require("@react-aria/link"),require("@ariakit/react"),require("@spscommerce/i18n")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@react-aria/link","@ariakit/react","@spscommerce/i18n"],V):(u=typeof globalThis<"u"?globalThis:u||self,V(u.ProductBar={},u.react,u.spsWoodlandCore,u.reactAriaLink,u.ariakitReact,u.spscommerceI18n))})(this,(function(u,V,c,te,P,U){"use strict";function re(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const r=re(V);function ne(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function X(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,a)}return t}function Y(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?X(Object(t),!0).forEach(function(a){ne(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):X(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}var ae=(e,n,t)=>{for(var a of Object.keys(e)){var o;if(e[a]!==((o=n[a])!==null&&o!==void 0?o:t[a]))return!1}return!0},D=e=>n=>{var t=e.defaultClassName,a=Y(Y({},e.defaultVariants),n);for(var o in a){var s,l=(s=a[o])!==null&&s!==void 0?s:e.defaultVariants[o];if(l!=null){var i=l;typeof i=="boolean"&&(i=i===!0?"true":"false");var h=e.variantClassNames[o][i];h&&(t+=" "+h)}}for(var[g,d]of e.compoundVariants)ae(g,a,e.defaultVariants)&&(t+=" "+d);return t},se="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux0",oe=D({defaultClassName:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux1",variantClassNames:{fullWidth:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux2",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux3"}},defaultVariants:{fullWidth:!1},compoundVariants:[]}),le=D({defaultClassName:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux4",variantClassNames:{hideNameText:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux5",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux6"}},defaultVariants:{hideNameText:!1},compoundVariants:[]}),ie="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux7",ce="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux8",_e="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjux9",ue="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxa",Z=D({defaultClassName:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxb",variantClassNames:{active:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxc",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxd"},disabled:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxe",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxf"}},defaultVariants:{active:!1,disabled:!1},compoundVariants:[]}),de="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxg",fe="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxh",pe=D({defaultClassName:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxi",variantClassNames:{priorityPlus:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxj",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_g6gjuxk"}},defaultVariants:{priorityPlus:!1},compoundVariants:[]});function K(e){const n=r.useRef(null),{linkProps:t}=te.useLink(e,n),{active:a,priority:o,...s}=e,l=e.as??(e.href?"a":"button"),i={...s,...t,ref:n,className:c.cl(Z({active:a,disabled:!1}),l==="button"&&de,e.className)};return r.createElement(l,{...i},e.children)}c.Metadata.set(K,{name:"Product Bar Tab",props:{active:{type:"boolean",required:!0},href:{type:"string"},priority:{type:"number"}}});function me(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.currentTarget.click())}const G=r.forwardRef(({children:e,className:n,name:t,logoSrc:a,hideNameText:o=!1,...s},l)=>{const i=!!s.onClick&&!("href"in s&&s.href);return r.createElement(r.Fragment,null,r.createElement("a",{className:c.cl(le({hideNameText:o}),n),...i?{role:"button",tabIndex:0,onKeyDown:me}:{},...s,ref:l},a&&r.createElement("img",{className:ie,src:a,"aria-hidden":"true",alt:`${t} Logo`,title:t}),t&&r.createElement("span",{className:c.cl(ce,o&&_e)},t)),r.createElement("span",{className:fe}))});c.Metadata.set(G,{name:"ProductBarName",props:{name:{type:"string"},logoSrc:{type:"string"},hideNameText:{type:"boolean",default:"false"}}});var he="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_5klvkn0",ge="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_5klvkn1",ve="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_5klvkn2",J="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_5klvkn3",Q="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_5klvkn4";function be({items:e,wrapperRef:n}){const{t}=U.useWoodlandLanguage();if(e.length===0)return null;const a=e.some(s=>s.props?.active),o=t("productBar.more",{defaultValue:"More"});return r.createElement("span",{ref:n},r.createElement(P.MenuProvider,null,r.createElement(P.MenuButton,{className:c.cl(Z({active:a,disabled:!1}),he),"aria-label":o},o,r.createElement(c.Icon,{icon:"chevron-down",className:ge,"aria-hidden":"true"})),r.createElement(P.Menu,{className:ve,gutter:4},e.map((s,l)=>{const i=s.props?.active,h=s.props?.children,g=s.props?.onPress,d=s.props?.href,N=s.props?.as,M=()=>{g&&g()};if(d&&N){const B=N;return r.createElement(P.MenuItem,{key:l,className:c.cl(J,i&&Q),render:r.createElement(B,{to:d})},h)}return d?r.createElement(P.MenuItem,{key:l,className:c.cl(J,i&&Q),render:r.createElement("a",{href:d})},h):r.createElement(P.MenuItem,{key:l,className:c.cl(J,i&&Q),onClick:M},h)}))))}function ye(e,n={}){const{enabled:t=!0,minVisibleItems:a=1,debounceMs:o=16}=n,s=r.useRef(null),l=r.useRef(null),i=r.useRef(null),h=r.useRef(null),g=r.useRef(null),d=r.useRef([]),N=r.useRef(0),M=r.useRef(0),B=r.useRef(!1),[W,E]=r.useState(e.length),[H,j]=r.useState(!1),L=r.useCallback(()=>{if(!s.current)return!1;const _=s.current,b=Array.from(_.children),f=i.current;f&&(N.current=f.getBoundingClientRect().width);const w=b.filter(k=>k!==f);if(w.length<e.length)return!1;if(d.current=w.map(k=>k.getBoundingClientRect().width),g.current){const k=g.current.querySelector("span:last-of-type");if(k){const p=k.getBoundingClientRect().width,C=getComputedStyle(g.current),x=parseFloat(C.marginRight)||0,m=Math.max(0,x-8);M.current=p+m}}return B.current=!0,!0},[e.length]),T=r.useCallback(()=>{if(!l.current)return 0;const _=l.current,b=_.getBoundingClientRect(),f=getComputedStyle(_),w=parseFloat(f.paddingLeft)+parseFloat(f.paddingRight),k=parseFloat(f.gap)||0;let p=w;const C=Array.from(_.children),x=C.filter(m=>getComputedStyle(m).display!=="none");x.length>1&&(p+=k*(x.length-1));for(const m of C){if(m===s.current)continue;const z=getComputedStyle(m),A=parseFloat(z.marginLeft)+parseFloat(z.marginRight);if(m===h.current){const S=Array.from(m.children),q=getComputedStyle(m),I=parseFloat(q.gap)||0;for(const y of S){const R=getComputedStyle(y),Ee=parseFloat(R.marginLeft)+parseFloat(R.marginRight);p+=y.getBoundingClientRect().width+Ee}S.length>1&&(p+=I*(S.length-1)),p+=parseFloat(q.paddingLeft)+parseFloat(q.paddingRight),p+=A}else p+=m.getBoundingClientRect().width+A}return Math.max(0,b.width-p-2)},[]),v=r.useRef(!1),O=r.useCallback(()=>{if(!t||!B.current){j(!1),v.current=!1;return}let _=T();const b=d.current,f=N.current||100,w=M.current||0;if(v.current&&w>0&&(_-=w),b.length===0||_<=0){E(e.length),j(!1),v.current=!1;return}if(b.reduce((y,R)=>y+R,0)<=_){E(e.length),j(!1),v.current=!1;return}let p=0,C=0;const x=_-f;for(let y=0;y<b.length;y++){const R=b[y];if(p+R<=x)p+=R,C++;else break}const F=Math.min(a,e.length),m=Math.max(C,F),A=b.slice(0,F).reduce((y,R)=>y+R,0)+f,S=C<F&&A>_&&w>0,q=!S&&_>A+w+20;let I=v.current;S&&!v.current?I=!0:q&&v.current&&(I=!1),I!==v.current&&(v.current=I,j(I)),E(m)},[t,e.length,a,T]);r.useEffect(()=>{if(!t){E(e.length);return}B.current=!1,d.current=[],E(e.length)},[t,e.length]),r.useLayoutEffect(()=>{if(!t||!s.current)return;L()&&O()}),r.useEffect(()=>{if(!t)return;let _;const b=()=>{clearTimeout(_),_=setTimeout(()=>{B.current||L(),O()},o)},f=new ResizeObserver(b);return l.current&&f.observe(l.current),()=>{clearTimeout(_),f.disconnect()}},[t,L,O,o]);const Be=t?e.slice(0,W):e,Ce=t&&W<e.length?e.slice(W):[];return{visibleItems:Be,overflowItems:Ce,containerRef:s,parentRef:l,overflowButtonRef:i,contentRef:h,brandRef:g,hideProductName:H}}function we(e){return[...e].sort((n,t)=>{const a=n.props?.priority??1/0,o=t.props?.priority??1/0;return a===o?0:a-o})}function ke(e,n){if(n.length===0)return{visible:e,overflow:n};const t=n.findIndex(i=>i.props?.active);if(t===-1)return{visible:e,overflow:n};const a=n[t],o=e[e.length-1],s=[...e.slice(0,-1),a],l=[...n.slice(0,t),o,...n.slice(t+1)];return{visible:s,overflow:l}}function $({fullWidth:e,enablePriorityPlus:n=!0,children:t,className:a,...o}){const s=r.useRef(null),[l,i,h]=c.selectChildren(t,[{type:G},{type:K}]),g=r.useMemo(()=>n?we(i):i,[n,i]),{visibleItems:d,overflowItems:N,containerRef:M,parentRef:B,overflowButtonRef:W,contentRef:E,brandRef:H,hideProductName:j}=ye(g,{enabled:n}),{visible:L,overflow:T}=r.useMemo(()=>ke(d,N),[d,N]),v=r.useMemo(()=>{if(!n||!l||l.length===0)return l;const O=l[0];return r.isValidElement(O)?[r.cloneElement(O,{hideNameText:j,ref:H})]:l},[n,l,j,H]);return r.createElement("div",{className:c.cl(se,a),...o,ref:s},r.createElement("nav",{className:oe({fullWidth:e}),ref:B},v,r.createElement("div",{className:pe({priorityPlus:n}),ref:M},L,T.length>0&&r.createElement(be,{items:T,wrapperRef:W})),r.createElement("div",{className:ue,ref:E},r.createElement(c.PortalContext.Provider,{value:{parentElementRef:s,fixed:!0}},h))))}c.Metadata.set($,{name:"ProductBar",props:{fullWidth:{type:"boolean"},enablePriorityPlus:{type:"boolean",default:"true"}}});var Re="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_pqijiy0",Ne="pkg_sps-woodland_core__family_product-bar__version_8_56_1__hash_pqijiy1";function ee({channelId:e,className:n,...t}){const{t:a}=U.useWoodlandLanguage();return r.createElement("a",{className:c.cl(Re,n),target:"_blank",rel:"noreferrer",href:`https://spscommerce.slack.com/archives/${e}`,...t},r.createElement(c.Icon,{className:Ne,icon:"conversation","aria-hidden":"true"}),r.createElement("span",null,a("slackLink.label",{defaultValue:"Chat"})))}c.Metadata.set(ee,{name:"Slack Link",props:{channelId:{type:"string",required:!0}}}),u.ProductBar=$,u.ProductBarName=G,u.ProductBarTab=K,u.SlackLink=ee,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(u,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("react"),require("@sps-woodland/core"),require("@react-aria/link"),require("@ariakit/react"),require("@spscommerce/i18n")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@react-aria/link","@ariakit/react","@spscommerce/i18n"],V):(u=typeof globalThis<"u"?globalThis:u||self,V(u.ProductBar={},u.react,u.spsWoodlandCore,u.reactAriaLink,u.ariakitReact,u.spscommerceI18n))})(this,(function(u,V,c,te,P,U){"use strict";function re(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const r=re(V);function ne(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function X(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,a)}return t}function Y(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?X(Object(t),!0).forEach(function(a){ne(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):X(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}var ae=(e,n,t)=>{for(var a of Object.keys(e)){var o;if(e[a]!==((o=n[a])!==null&&o!==void 0?o:t[a]))return!1}return!0},D=e=>n=>{var t=e.defaultClassName,a=Y(Y({},e.defaultVariants),n);for(var o in a){var s,l=(s=a[o])!==null&&s!==void 0?s:e.defaultVariants[o];if(l!=null){var i=l;typeof i=="boolean"&&(i=i===!0?"true":"false");var h=e.variantClassNames[o][i];h&&(t+=" "+h)}}for(var[g,d]of e.compoundVariants)ae(g,a,e.defaultVariants)&&(t+=" "+d);return t},se="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux0",oe=D({defaultClassName:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux1",variantClassNames:{fullWidth:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux2",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux3"}},defaultVariants:{fullWidth:!1},compoundVariants:[]}),le=D({defaultClassName:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux4",variantClassNames:{hideNameText:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux5",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux6"}},defaultVariants:{hideNameText:!1},compoundVariants:[]}),ie="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux7",ce="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux8",_e="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjux9",ue="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxa",Z=D({defaultClassName:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxb",variantClassNames:{active:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxc",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxd"},disabled:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxe",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxf"}},defaultVariants:{active:!1,disabled:!1},compoundVariants:[]}),de="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxg",fe="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxh",pe=D({defaultClassName:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxi",variantClassNames:{priorityPlus:{true:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxj",false:"pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_g6gjuxk"}},defaultVariants:{priorityPlus:!1},compoundVariants:[]});function K(e){const n=r.useRef(null),{linkProps:t}=te.useLink(e,n),{active:a,priority:o,...s}=e,l=e.as??(e.href?"a":"button"),i={...s,...t,ref:n,className:c.cl(Z({active:a,disabled:!1}),l==="button"&&de,e.className)};return r.createElement(l,{...i},e.children)}c.Metadata.set(K,{name:"Product Bar Tab",props:{active:{type:"boolean",required:!0},href:{type:"string"},priority:{type:"number"}}});function me(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.currentTarget.click())}const G=r.forwardRef(({children:e,className:n,name:t,logoSrc:a,hideNameText:o=!1,...s},l)=>{const i=!!s.onClick&&!("href"in s&&s.href);return r.createElement(r.Fragment,null,r.createElement("a",{className:c.cl(le({hideNameText:o}),n),...i?{role:"button",tabIndex:0,onKeyDown:me}:{},...s,ref:l},a&&r.createElement("img",{className:ie,src:a,"aria-hidden":"true",alt:`${t} Logo`,title:t}),t&&r.createElement("span",{className:c.cl(ce,o&&_e)},t)),r.createElement("span",{className:fe}))});c.Metadata.set(G,{name:"ProductBarName",props:{name:{type:"string"},logoSrc:{type:"string"},hideNameText:{type:"boolean",default:"false"}}});var he="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn0",ge="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn1",ve="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn2",J="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn3",Q="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_5klvkn4";function be({items:e,wrapperRef:n}){const{t}=U.useWoodlandLanguage();if(e.length===0)return null;const a=e.some(s=>s.props?.active),o=t("productBar.more",{defaultValue:"More"});return r.createElement("span",{ref:n},r.createElement(P.MenuProvider,null,r.createElement(P.MenuButton,{className:c.cl(Z({active:a,disabled:!1}),he),"aria-label":o},o,r.createElement(c.Icon,{icon:"chevron-down",className:ge,"aria-hidden":"true"})),r.createElement(P.Menu,{className:ve,gutter:4},e.map((s,l)=>{const i=s.props?.active,h=s.props?.children,g=s.props?.onPress,d=s.props?.href,N=s.props?.as,M=()=>{g&&g()};if(d&&N){const B=N;return r.createElement(P.MenuItem,{key:l,className:c.cl(J,i&&Q),render:r.createElement(B,{to:d})},h)}return d?r.createElement(P.MenuItem,{key:l,className:c.cl(J,i&&Q),render:r.createElement("a",{href:d})},h):r.createElement(P.MenuItem,{key:l,className:c.cl(J,i&&Q),onClick:M},h)}))))}function ye(e,n={}){const{enabled:t=!0,minVisibleItems:a=1,debounceMs:o=16}=n,s=r.useRef(null),l=r.useRef(null),i=r.useRef(null),h=r.useRef(null),g=r.useRef(null),d=r.useRef([]),N=r.useRef(0),M=r.useRef(0),B=r.useRef(!1),[W,E]=r.useState(e.length),[H,j]=r.useState(!1),L=r.useCallback(()=>{if(!s.current)return!1;const _=s.current,b=Array.from(_.children),f=i.current;f&&(N.current=f.getBoundingClientRect().width);const w=b.filter(k=>k!==f);if(w.length<e.length)return!1;if(d.current=w.map(k=>k.getBoundingClientRect().width),g.current){const k=g.current.querySelector("span:last-of-type");if(k){const p=k.getBoundingClientRect().width,C=getComputedStyle(g.current),x=parseFloat(C.marginRight)||0,m=Math.max(0,x-8);M.current=p+m}}return B.current=!0,!0},[e.length]),T=r.useCallback(()=>{if(!l.current)return 0;const _=l.current,b=_.getBoundingClientRect(),f=getComputedStyle(_),w=parseFloat(f.paddingLeft)+parseFloat(f.paddingRight),k=parseFloat(f.gap)||0;let p=w;const C=Array.from(_.children),x=C.filter(m=>getComputedStyle(m).display!=="none");x.length>1&&(p+=k*(x.length-1));for(const m of C){if(m===s.current)continue;const z=getComputedStyle(m),A=parseFloat(z.marginLeft)+parseFloat(z.marginRight);if(m===h.current){const S=Array.from(m.children),q=getComputedStyle(m),I=parseFloat(q.gap)||0;for(const y of S){const R=getComputedStyle(y),Ee=parseFloat(R.marginLeft)+parseFloat(R.marginRight);p+=y.getBoundingClientRect().width+Ee}S.length>1&&(p+=I*(S.length-1)),p+=parseFloat(q.paddingLeft)+parseFloat(q.paddingRight),p+=A}else p+=m.getBoundingClientRect().width+A}return Math.max(0,b.width-p-2)},[]),v=r.useRef(!1),O=r.useCallback(()=>{if(!t||!B.current){j(!1),v.current=!1;return}let _=T();const b=d.current,f=N.current||100,w=M.current||0;if(v.current&&w>0&&(_-=w),b.length===0||_<=0){E(e.length),j(!1),v.current=!1;return}if(b.reduce((y,R)=>y+R,0)<=_){E(e.length),j(!1),v.current=!1;return}let p=0,C=0;const x=_-f;for(let y=0;y<b.length;y++){const R=b[y];if(p+R<=x)p+=R,C++;else break}const F=Math.min(a,e.length),m=Math.max(C,F),A=b.slice(0,F).reduce((y,R)=>y+R,0)+f,S=C<F&&A>_&&w>0,q=!S&&_>A+w+20;let I=v.current;S&&!v.current?I=!0:q&&v.current&&(I=!1),I!==v.current&&(v.current=I,j(I)),E(m)},[t,e.length,a,T]);r.useEffect(()=>{if(!t){E(e.length);return}B.current=!1,d.current=[],E(e.length)},[t,e.length]),r.useLayoutEffect(()=>{if(!t||!s.current)return;L()&&O()}),r.useEffect(()=>{if(!t)return;let _;const b=()=>{clearTimeout(_),_=setTimeout(()=>{B.current||L(),O()},o)},f=new ResizeObserver(b);return l.current&&f.observe(l.current),()=>{clearTimeout(_),f.disconnect()}},[t,L,O,o]);const Be=t?e.slice(0,W):e,Ce=t&&W<e.length?e.slice(W):[];return{visibleItems:Be,overflowItems:Ce,containerRef:s,parentRef:l,overflowButtonRef:i,contentRef:h,brandRef:g,hideProductName:H}}function we(e){return[...e].sort((n,t)=>{const a=n.props?.priority??1/0,o=t.props?.priority??1/0;return a===o?0:a-o})}function ke(e,n){if(n.length===0)return{visible:e,overflow:n};const t=n.findIndex(i=>i.props?.active);if(t===-1)return{visible:e,overflow:n};const a=n[t],o=e[e.length-1],s=[...e.slice(0,-1),a],l=[...n.slice(0,t),o,...n.slice(t+1)];return{visible:s,overflow:l}}function $({fullWidth:e,enablePriorityPlus:n=!0,children:t,className:a,...o}){const s=r.useRef(null),[l,i,h]=c.selectChildren(t,[{type:G},{type:K}]),g=r.useMemo(()=>n?we(i):i,[n,i]),{visibleItems:d,overflowItems:N,containerRef:M,parentRef:B,overflowButtonRef:W,contentRef:E,brandRef:H,hideProductName:j}=ye(g,{enabled:n}),{visible:L,overflow:T}=r.useMemo(()=>ke(d,N),[d,N]),v=r.useMemo(()=>{if(!n||!l||l.length===0)return l;const O=l[0];return r.isValidElement(O)?[r.cloneElement(O,{hideNameText:j,ref:H})]:l},[n,l,j,H]);return r.createElement("div",{className:c.cl(se,a),...o,ref:s},r.createElement("nav",{className:oe({fullWidth:e}),ref:B},v,r.createElement("div",{className:pe({priorityPlus:n}),ref:M},L,T.length>0&&r.createElement(be,{items:T,wrapperRef:W})),r.createElement("div",{className:ue,ref:E},r.createElement(c.PortalContext.Provider,{value:{parentElementRef:s,fixed:!0}},h))))}c.Metadata.set($,{name:"ProductBar",props:{fullWidth:{type:"boolean"},enablePriorityPlus:{type:"boolean",default:"true"}}});var Re="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_pqijiy0",Ne="pkg_sps-woodland_core__family_product-bar__version_8_56_2__hash_pqijiy1";function ee({channelId:e,className:n,...t}){const{t:a}=U.useWoodlandLanguage();return r.createElement("a",{className:c.cl(Re,n),target:"_blank",rel:"noreferrer",href:`https://spscommerce.slack.com/archives/${e}`,...t},r.createElement(c.Icon,{className:Ne,icon:"conversation","aria-hidden":"true"}),r.createElement("span",null,a("slackLink.label",{defaultValue:"Chat"})))}c.Metadata.set(ee,{name:"Slack Link",props:{channelId:{type:"string",required:!0}}}),u.ProductBar=$,u.ProductBarName=G,u.ProductBarTab=K,u.SlackLink=ee,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|