@spscommerce/ds-react 8.30.1 → 8.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,6 @@ export type SpsDateRangePickerProps = React.PropsWithChildren<SpsGlobalPropTypes
15
15
  value?: SimpleDateRange | DatePreset;
16
16
  showTwoMonths?: boolean;
17
17
  format?: string;
18
- }> & React.HTMLAttributes<HTMLInputElement>;
18
+ }> & React.InputHTMLAttributes<HTMLInputElement>;
19
19
  export declare const DEFAULT_PRESETS: DatePreset[];
20
20
  export declare function SpsDateRangePicker({ children, className, disabled, formMeta, id, maxDate, minDate, onChange, presets, selectedPreset: presetProp, onPresetChange, value, showTwoMonths, format, "data-testid": testId, ...rest }: SpsDateRangePickerProps): React.JSX.Element;
@@ -13,5 +13,5 @@ export type SpsDatepickerProps = React.PropsWithChildren<SpsGlobalPropTypes & {
13
13
  format?: string;
14
14
  showTwoMonths?: boolean;
15
15
  autoCloseOnSelect?: boolean;
16
- }> & React.HTMLAttributes<HTMLInputElement>;
16
+ }> & React.InputHTMLAttributes<HTMLInputElement>;
17
17
  export declare function SpsDatepicker({ children, className, disabled, formMeta, id, maxDate, minDate, onChange, value, format, showTwoMonths, autoCloseOnSelect, "data-testid": testId, ...rest }: SpsDatepickerProps): React.JSX.Element;
package/lib/index.js CHANGED
@@ -32964,7 +32964,7 @@ Object.assign(FI, {
32964
32964
  displayName: "SpsSearchResultsBar"
32965
32965
  });
32966
32966
  const VI = {
32967
- results: "number || null",
32967
+ results: "number || string || null",
32968
32968
  selections: "{ [key: string]: string[] }",
32969
32969
  zeroStateText: "string",
32970
32970
  onClear: "() => void"
package/lib/index.umd.cjs CHANGED
@@ -9815,7 +9815,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
9815
9815
  </>
9816
9816
  )
9817
9817
  }
9818
- `}}}};function yf(e){const{tabs:t,activeTab:n,onTabChange:r,className:a,unsafelyReplaceClassName:s,"data-testid":l,...c}=e,[p,m]=o.useState();o.useEffect(()=>{if(t.length)if(n){const h=t.find(g=>g.label===n.label);m(h)}else m(t[0])},[]);const f=(h,g)=>{h.preventDefault(),m(g),typeof r=="function"&&r(g)},u=U(s||"sps-tabs",a);return o.createElement("div",{className:u},o.createElement("nav",{className:"sps-nav sps-nav--tabs","data-testid":l,...c},t.map(h=>o.createElement("a",{key:h.label,id:h.id,className:U("sps-nav__item","sps-nav__link",h===p&&"active"),role:"tab","data-toggle":"tab",href:h.controlsId?`#${h.controlsId}`:void 0,"aria-controls":h.controlsId,"aria-selected":h===n,onClick:g=>{f(g,h)},"data-testid":`${l}__tab-link`},h.icon&&o.createElement("i",{className:`sps-icon sps-icon-${h.icon}`}),o.createElement("span",null,h.label),h.tag&&o.createElement("span",{className:"sps-tag sps-tag--key"},h.tag)))))}Object.assign(yf,{displayName:"SpsTabs"});const FD={resultsCount:"number",totalResults:"number",onClear:"() => void"};function Tf(e){const{children:t,className:n,resultsCount:r,totalResults:a,onClear:s,"data-testid":l,unsafelyReplaceClassName:c,...p}=e,{t:m}=o.useContext(Ke),f=U(c||"sps-search-results-bar",n),[u,h,g]=m("design-system:searchResultsBar.count",{count:r,total:a,defaultValue:`${r} of ${a}`}).split(" ");return o.createElement("div",{className:f,"data-testid":`${l}`,...p},o.createElement("span",{className:"sps-search-results-bar__label","data-testid":`${l}__label`},m("design-system:searchResultsBar.matchingResults",{defaultValue:"Matching results"})),u&&!Number.isNaN(Number(u))&&o.createElement("span",{className:"sps-search-results-bar__count","data-testid":`${l}__count`},o.createElement("i",{className:"sps-icon sps-icon-double-angle-right"}),o.createElement("span",null,u)),g&&!Number.isNaN(Number(g))&&o.createElement("span",{className:"sps-search-results-bar__total","data-testid":`${l}__total`},h," ",g),o.createElement("div",{className:"sps-search-results-bar__buttons","data-testid":`${l}__button`},o.createElement("button",{type:"button",onClick:s},m("design-system:searchResultsBar.clear",{defaultValue:"Clear"}))))}Object.assign(Tf,{props:FD,displayName:"SpsSearchResultsBar"});const VD={results:"number || null",selections:"{ [key: string]: string[] }",zeroStateText:"string",onClear:"() => void"};function Sl(e){const{className:t,results:n,selections:r,zeroStateText:a,onClear:s,"data-testid":l,unsafelyReplaceClassName:c,...p}=e,{t:m}=o.useContext(Ke),f=U(c||"sps-search-results-bar-v2",t),u=r?Object.keys(r).reduce((h,g)=>(r[g].length>0&&(h[g]=r[g]),h),{}):{};return o.createElement("div",{className:f,"data-testid":`${l}`,...p},n!=null&&o.createElement("div",{className:"sps-search-results-bar-v2__results"},o.createElement("span",{"data-testid":`${l}__label`},m("design-system:searchResultsBar.results",{defaultValue:"Results:"})),o.createElement(Kt,{kind:Y.TagKind.INFO},o.createElement("span",null,n))),o.createElement("div",{className:"sps-search-results-bar-v2__selections"},Object.keys(u).length>0?Object.keys(u).map((h,g)=>o.createElement(o.Fragment,null,o.createElement("span",{key:g,className:"sps-search-results-bar-v2__selection"},h,":"),u[h].map((y,E)=>o.createElement(Kt,{key:E,kind:Y.TagKind.KEY},o.createElement("span",null,y))))):o.createElement("span",{className:"font-italic"},a||m("design-system:searchResultsBar.noAdvancedSearchSelections",{defaultValue:"No Advanced Search Selections"}))),o.createElement("div",{className:"sps-search-results-bar-v2__buttons","data-testid":`${l}__button`},o.createElement(ze,{kind:Y.ButtonKind.LINK,onClick:s},m("design-system:searchResultsBar.clearResults",{defaultValue:"Clear Results"}))))}Object.assign(Sl,{props:VD,displayName:"SpsSearchResultsBarV2"});const $D={basic:{label:"Basic",description:({NavigateTo:e})=>o.createElement(o.Fragment,null,o.createElement("p",null,"SpsSearchResultsBarV2 should be used with List Toolbar and Advanced Search."),o.createElement("p",null,"For more examples go to the Advanced Search section on the"," ",o.createElement(e,{to:"list-toolbar"},"List Toolbar")," page.")),examples:{basic:{react:v.code`
9818
+ `}}}};function yf(e){const{tabs:t,activeTab:n,onTabChange:r,className:a,unsafelyReplaceClassName:s,"data-testid":l,...c}=e,[p,m]=o.useState();o.useEffect(()=>{if(t.length)if(n){const h=t.find(g=>g.label===n.label);m(h)}else m(t[0])},[]);const f=(h,g)=>{h.preventDefault(),m(g),typeof r=="function"&&r(g)},u=U(s||"sps-tabs",a);return o.createElement("div",{className:u},o.createElement("nav",{className:"sps-nav sps-nav--tabs","data-testid":l,...c},t.map(h=>o.createElement("a",{key:h.label,id:h.id,className:U("sps-nav__item","sps-nav__link",h===p&&"active"),role:"tab","data-toggle":"tab",href:h.controlsId?`#${h.controlsId}`:void 0,"aria-controls":h.controlsId,"aria-selected":h===n,onClick:g=>{f(g,h)},"data-testid":`${l}__tab-link`},h.icon&&o.createElement("i",{className:`sps-icon sps-icon-${h.icon}`}),o.createElement("span",null,h.label),h.tag&&o.createElement("span",{className:"sps-tag sps-tag--key"},h.tag)))))}Object.assign(yf,{displayName:"SpsTabs"});const FD={resultsCount:"number",totalResults:"number",onClear:"() => void"};function Tf(e){const{children:t,className:n,resultsCount:r,totalResults:a,onClear:s,"data-testid":l,unsafelyReplaceClassName:c,...p}=e,{t:m}=o.useContext(Ke),f=U(c||"sps-search-results-bar",n),[u,h,g]=m("design-system:searchResultsBar.count",{count:r,total:a,defaultValue:`${r} of ${a}`}).split(" ");return o.createElement("div",{className:f,"data-testid":`${l}`,...p},o.createElement("span",{className:"sps-search-results-bar__label","data-testid":`${l}__label`},m("design-system:searchResultsBar.matchingResults",{defaultValue:"Matching results"})),u&&!Number.isNaN(Number(u))&&o.createElement("span",{className:"sps-search-results-bar__count","data-testid":`${l}__count`},o.createElement("i",{className:"sps-icon sps-icon-double-angle-right"}),o.createElement("span",null,u)),g&&!Number.isNaN(Number(g))&&o.createElement("span",{className:"sps-search-results-bar__total","data-testid":`${l}__total`},h," ",g),o.createElement("div",{className:"sps-search-results-bar__buttons","data-testid":`${l}__button`},o.createElement("button",{type:"button",onClick:s},m("design-system:searchResultsBar.clear",{defaultValue:"Clear"}))))}Object.assign(Tf,{props:FD,displayName:"SpsSearchResultsBar"});const VD={results:"number || string || null",selections:"{ [key: string]: string[] }",zeroStateText:"string",onClear:"() => void"};function Sl(e){const{className:t,results:n,selections:r,zeroStateText:a,onClear:s,"data-testid":l,unsafelyReplaceClassName:c,...p}=e,{t:m}=o.useContext(Ke),f=U(c||"sps-search-results-bar-v2",t),u=r?Object.keys(r).reduce((h,g)=>(r[g].length>0&&(h[g]=r[g]),h),{}):{};return o.createElement("div",{className:f,"data-testid":`${l}`,...p},n!=null&&o.createElement("div",{className:"sps-search-results-bar-v2__results"},o.createElement("span",{"data-testid":`${l}__label`},m("design-system:searchResultsBar.results",{defaultValue:"Results:"})),o.createElement(Kt,{kind:Y.TagKind.INFO},o.createElement("span",null,n))),o.createElement("div",{className:"sps-search-results-bar-v2__selections"},Object.keys(u).length>0?Object.keys(u).map((h,g)=>o.createElement(o.Fragment,null,o.createElement("span",{key:g,className:"sps-search-results-bar-v2__selection"},h,":"),u[h].map((y,E)=>o.createElement(Kt,{key:E,kind:Y.TagKind.KEY},o.createElement("span",null,y))))):o.createElement("span",{className:"font-italic"},a||m("design-system:searchResultsBar.noAdvancedSearchSelections",{defaultValue:"No Advanced Search Selections"}))),o.createElement("div",{className:"sps-search-results-bar-v2__buttons","data-testid":`${l}__button`},o.createElement(ze,{kind:Y.ButtonKind.LINK,onClick:s},m("design-system:searchResultsBar.clearResults",{defaultValue:"Clear Results"}))))}Object.assign(Sl,{props:VD,displayName:"SpsSearchResultsBarV2"});const $D={basic:{label:"Basic",description:({NavigateTo:e})=>o.createElement(o.Fragment,null,o.createElement("p",null,"SpsSearchResultsBarV2 should be used with List Toolbar and Advanced Search."),o.createElement("p",null,"For more examples go to the Advanced Search section on the"," ",o.createElement(e,{to:"list-toolbar"},"List Toolbar")," page.")),examples:{basic:{react:v.code`
9819
9819
  import {
9820
9820
  useSpsForm,
9821
9821
  SpsListToolbar,
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { SpsGlobalPropTypes } from "../prop-types";
3
3
  export type SpsSearchResultsBarV2Props = React.PropsWithChildren<SpsGlobalPropTypes & {
4
- results?: number | null;
4
+ results?: number | string | null;
5
5
  selections?: Record<string, string[]>;
6
6
  zeroStateText?: string;
7
7
  onClear?: () => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spscommerce/ds-react",
3
3
  "description": "SPS Design System React components",
4
- "version": "8.30.1",
4
+ "version": "8.31.1",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/spscommerce/woodland/tree/main/packages/@spscommerce/ds-react",
@@ -46,11 +46,11 @@
46
46
  "moment-timezone": "^0.5.48",
47
47
  "react": "^16.9.0",
48
48
  "react-dom": "^16.9.0",
49
- "@sps-woodland/illustrations": "8.30.1",
50
- "@sps-woodland/tabs": "8.30.1",
51
- "@spscommerce/ds-colors": "8.30.1",
52
- "@spscommerce/ds-shared": "8.30.1",
53
- "@spscommerce/positioning": "8.30.1"
49
+ "@sps-woodland/illustrations": "8.31.1",
50
+ "@spscommerce/ds-colors": "8.31.1",
51
+ "@sps-woodland/tabs": "8.31.1",
52
+ "@spscommerce/ds-shared": "8.31.1",
53
+ "@spscommerce/positioning": "8.31.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@react-spectrum/provider": "^3.4.1",
@@ -72,12 +72,12 @@
72
72
  "raf-stub": "^2.0.2",
73
73
  "react": "^16.9.0",
74
74
  "react-dom": "^16.9.0",
75
- "@sps-woodland/illustrations": "8.30.1",
76
- "@sps-woodland/tabs": "8.30.1",
77
- "@spscommerce/ds-colors": "8.30.1",
78
- "@spscommerce/ds-shared": "8.30.1",
79
- "@spscommerce/positioning": "8.30.1",
80
- "test": "8.30.1"
75
+ "@sps-woodland/illustrations": "8.31.1",
76
+ "@sps-woodland/tabs": "8.31.1",
77
+ "@spscommerce/ds-shared": "8.31.1",
78
+ "@spscommerce/ds-colors": "8.31.1",
79
+ "@spscommerce/positioning": "8.31.1",
80
+ "test": "8.31.1"
81
81
  },
82
82
  "scripts": {
83
83
  "build": "pnpm run build:js && pnpm run build:types",