@spscommerce/ds-react 6.0.0-rc1 → 6.1.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.
Files changed (41) hide show
  1. package/lib/autocomplete/SpsAutocomplete.d.ts +2 -1
  2. package/lib/dropdown/SpsDropdown.d.ts +1 -0
  3. package/lib/fieldset/SpsFieldset.d.ts +1 -1
  4. package/lib/index.cjs.js +514 -357
  5. package/lib/index.es.js +755 -322
  6. package/lib/multi-select/SpsMultiSelect.d.ts +2 -1
  7. package/lib/option-list/SpsOptionListProps.d.ts +2 -0
  8. package/lib/pagination/SpsPageSelector.d.ts +1 -0
  9. package/lib/pagination/SpsPagination.d.ts +1 -0
  10. package/lib/product-bar/SpsProductBar.d.ts +1 -1
  11. package/lib/select/SpsSelect.d.ts +3 -1
  12. package/lib/table/SpsTable.d.ts +5 -2
  13. package/lib/table/SpsTableContext.d.ts +20 -0
  14. package/lib/table/SpsTableHead.d.ts +1 -4
  15. package/lib/table/SpsTableHeader.d.ts +3 -5
  16. package/lib/table/SpsTableRow.d.ts +1 -4
  17. package/lib/table/index.d.ts +1 -0
  18. package/lib/table/useColumnResizer.d.ts +8 -0
  19. package/lib/table/usePinnedStyles.d.ts +1 -1
  20. package/lib/tile-list/SpsTile.d.ts +3 -0
  21. package/lib/utils/Provide.d.ts +24 -0
  22. package/lib/utils/bindProps.d.ts +33 -0
  23. package/lib/utils/index.d.ts +2 -0
  24. package/package.json +13 -12
  25. package/lib/datepicker/SpsDateRangePicker.d.ts +0 -21
  26. package/lib/datepicker-v2/SpsDateRangePickerV2.d.ts +0 -21
  27. package/lib/datepicker-v2/SpsDatepickerCalendar.d.ts +0 -18
  28. package/lib/datepicker-v2/SpsDatepickerPopup.d.ts +0 -13
  29. package/lib/datepicker-v2/SpsDatepickerV2.d.ts +0 -18
  30. package/lib/datepicker-v2/index.d.ts +0 -4
  31. package/lib/datepicker-v2/useCalendar.d.ts +0 -2
  32. package/lib/datepicker-v2/useMoment.d.ts +0 -3
  33. package/lib/datepicker-v2/utils.d.ts +0 -23
  34. package/lib/datepicker-v2/validation.d.ts +0 -10
  35. package/lib/modal/SpsModalAction.d.ts +0 -18
  36. package/lib/modal/SpsModalBody.d.ts +0 -10
  37. package/lib/modal/SpsModalFooter.d.ts +0 -16
  38. package/lib/modal/SpsModalHeader.d.ts +0 -11
  39. package/lib/modal/SpsModalOverlay.d.ts +0 -12
  40. package/lib/modal-v2/SpsModalV2.d.ts +0 -18
  41. package/lib/modal-v2/index.d.ts +0 -1
package/lib/index.es.js CHANGED
@@ -1414,6 +1414,17 @@ const SpsFormComponentWrapper = React.forwardRef((props2, ref2) => {
1414
1414
  onClick(event);
1415
1415
  }
1416
1416
  }
1417
+ React.useEffect(() => {
1418
+ function handleMouseDown(e2) {
1419
+ if (e2.target.classList.contains("sps-form-control__clear-btn")) {
1420
+ e2.preventDefault();
1421
+ }
1422
+ }
1423
+ document.addEventListener("mousedown", handleMouseDown);
1424
+ return () => {
1425
+ document.removeEventListener("mousedown", handleMouseDown);
1426
+ };
1427
+ }, []);
1417
1428
  return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, rest), {
1418
1429
  className: classes,
1419
1430
  ref: ref2,
@@ -1759,7 +1770,8 @@ const spsOptionListPassthroughProps = {
1759
1770
  valueKey: "string",
1760
1771
  zeroState: "string",
1761
1772
  maxHeightPx: "number",
1762
- maxHeightRem: "number"
1773
+ maxHeightRem: "number",
1774
+ disableOptionsMemoization: "boolean"
1763
1775
  },
1764
1776
  propTypes: {
1765
1777
  captionKey: propTypes$1G.exports.string,
@@ -1805,11 +1817,13 @@ const propTypes$1C = __spreadProps(__spreadValues(__spreadValues(__spreadValues(
1805
1817
  specialAction: fun(),
1806
1818
  ignoreWidthStyles: propTypes$1G.exports.bool,
1807
1819
  loading: propTypes$1G.exports.bool,
1808
- filterByTextAndCaptionKey: propTypes$1G.exports.bool
1820
+ filterByTextAndCaptionKey: propTypes$1G.exports.bool,
1821
+ disableOptionsMemoization: propTypes$1G.exports.bool
1809
1822
  });
1810
1823
  async function updateOptions(props2, searchState, searchStatePatch, setOptionList, setAnyOptionHasIcon, promiseRef) {
1811
1824
  const options = typeof props2.options === "function" ? props2.options(searchState.value) : props2.options || [];
1812
1825
  const areOptionsPromise = options instanceof Promise;
1826
+ const removeSpecialSymbols = (value) => value.replace(/([.?*+^$[\]\\(){}|-])/g, "");
1813
1827
  searchStatePatch({ pending: areOptionsPromise });
1814
1828
  promiseRef.current = areOptionsPromise ? options : null;
1815
1829
  const result = areOptionsPromise ? await options || [] : options || [];
@@ -1827,13 +1841,15 @@ async function updateOptions(props2, searchState, searchStatePatch, setOptionLis
1827
1841
  newOpts.unshift(new SpsOptionListOption(null, { text: props2.nullOption }));
1828
1842
  }
1829
1843
  if (searchState.value) {
1830
- searchStatePatch({ replacementPattern: new RegExp(searchState.value, "ig") });
1844
+ const searchValue = removeSpecialSymbols(searchState.value);
1845
+ searchStatePatch({ replacementPattern: new RegExp(searchValue, "ig") });
1831
1846
  newOpts = newOpts.filter((o) => {
1832
- const regEx = new RegExp(searchState.value, "i");
1847
+ const regEx = new RegExp(searchValue, "i");
1848
+ const optionText = removeSpecialSymbols(o.text);
1833
1849
  if (props2.filterByTextAndCaptionKey) {
1834
- return regEx.test(o.text) || regEx.test(o.caption);
1850
+ return regEx.test(optionText) || regEx.test(removeSpecialSymbols(o.caption));
1835
1851
  }
1836
- return regEx.test(o.text);
1852
+ return regEx.test(optionText);
1837
1853
  });
1838
1854
  } else {
1839
1855
  searchStatePatch({ replacementPattern: null });
@@ -1857,7 +1873,7 @@ function useOptionListOptions(props2, searchState, searchStatePatch) {
1857
1873
  const [anyOptionHasIcon, setAnyOptionHasIcon] = React.useState(false);
1858
1874
  const promiseRef = React.useRef(null);
1859
1875
  const optionsRef = React.useRef(props2.options);
1860
- if (typeof props2.options !== "function") {
1876
+ if (typeof props2.options !== "function" || props2.disableOptionsMemoization) {
1861
1877
  optionsRef.current = props2.options;
1862
1878
  }
1863
1879
  const update2 = React.useMemo(() => typeof optionsRef.current === "function" ? debounce(updateOptions, typeof props2.searchDebounce !== "undefined" ? props2.searchDebounce : 500) : updateOptions, [optionsRef.current, props2.disabledOptions]);
@@ -2118,6 +2134,7 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
2118
2134
  filterByTextAndCaptionKey,
2119
2135
  maxHeightPx,
2120
2136
  maxHeightRem,
2137
+ disableOptionsMemoization,
2121
2138
  "data-testid": testId
2122
2139
  } = _a, rest = __objRest(_a, [
2123
2140
  "captionKey",
@@ -2155,6 +2172,7 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
2155
2172
  "filterByTextAndCaptionKey",
2156
2173
  "maxHeightPx",
2157
2174
  "maxHeightRem",
2175
+ "disableOptionsMemoization",
2158
2176
  "data-testid"
2159
2177
  ]);
2160
2178
  const specialActionOption = React.useMemo(() => specialAction ? new SpsOptionListOption(specialAction, {
@@ -2392,7 +2410,7 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
2392
2410
  ref: optionsRef,
2393
2411
  "data-testid": `${testId}-options`,
2394
2412
  style: optionsInlineStyles
2395
- }, !loading && !searchState.pending && zeroState && (searchState.value || !searchState.isAsync) && optionList.length === 0 && /* @__PURE__ */ React.createElement("div", {
2413
+ }, !loading && !searchState.pending && zeroState && optionList.length === 0 && /* @__PURE__ */ React.createElement("div", {
2396
2414
  className: "sps-option-list__zero-state"
2397
2415
  }, zeroState), (loading || searchState.pending) && /* @__PURE__ */ React.createElement("div", {
2398
2416
  className: "sps-option-list__loading"
@@ -2444,6 +2462,48 @@ Object.assign(SpsOptionList, {
2444
2462
  propTypes: propTypes$1C,
2445
2463
  displayName: "SpsOptionList"
2446
2464
  });
2465
+ function bindProps(E, boundProps, deps = []) {
2466
+ return React.useMemo(() => {
2467
+ const EWithBoundProps = (props2) => /* @__PURE__ */ React.createElement(E, __spreadValues({}, __spreadValues(__spreadValues({}, props2), boundProps)), props2.children);
2468
+ return EWithBoundProps;
2469
+ }, deps);
2470
+ }
2471
+ const Nested = function({
2472
+ children,
2473
+ elements
2474
+ }) {
2475
+ if (elements.length === 0) {
2476
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
2477
+ }
2478
+ const [E, p2] = Array.isArray(elements[0]) ? elements[0] : [elements[0]];
2479
+ return /* @__PURE__ */ React.createElement(E, __spreadValues({}, p2 != null ? p2 : {}), /* @__PURE__ */ React.createElement(Nested, {
2480
+ elements: elements.slice(1)
2481
+ }, children));
2482
+ };
2483
+ const Provide = function(_a) {
2484
+ var _b = _a, {
2485
+ children,
2486
+ providers = []
2487
+ } = _b, rest = __objRest(_b, [
2488
+ "children",
2489
+ "providers"
2490
+ ]);
2491
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({}, rest), /* @__PURE__ */ React.createElement(Nested, {
2492
+ elements: providers
2493
+ }, children));
2494
+ };
2495
+ const SpsApp = function(_c) {
2496
+ var _d = _c, {
2497
+ children,
2498
+ className
2499
+ } = _d, rest = __objRest(_d, [
2500
+ "children",
2501
+ "className"
2502
+ ]);
2503
+ return /* @__PURE__ */ React.createElement(Provide, __spreadValues({
2504
+ className: `sps-app ${className}`
2505
+ }, rest), children);
2506
+ };
2447
2507
  function selectChildren(children = [], groups = []) {
2448
2508
  const childrenArray = Array.isArray(children) ? flatten(children) : [children];
2449
2509
  const normGroups = groups.map((s) => Array.isArray(s) ? s : [s]);
@@ -2553,7 +2613,8 @@ const propsDoc$1y = {
2553
2613
  zeroState: "string",
2554
2614
  loading: "boolean",
2555
2615
  maxHeightOptionListPx: "number",
2556
- maxHeightOptionListRem: "number"
2616
+ maxHeightOptionListRem: "number",
2617
+ disableOptionsMemoization: "boolean"
2557
2618
  };
2558
2619
  const propTypes$1B = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
2559
2620
  debounce: propTypes$1G.exports.number,
@@ -2573,10 +2634,11 @@ const propTypes$1B = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
2573
2634
  zeroState: propTypes$1G.exports.string,
2574
2635
  loading: propTypes$1G.exports.bool,
2575
2636
  maxHeightOptionListPx: propTypes$1G.exports.number,
2576
- maxHeightOptionListRem: propTypes$1G.exports.number
2637
+ maxHeightOptionListRem: propTypes$1G.exports.number,
2638
+ disableOptionsMemoization: propTypes$1G.exports.bool
2577
2639
  });
2578
- function SpsAutocomplete(_a) {
2579
- var _b = _a, {
2640
+ function SpsAutocomplete(_e) {
2641
+ var _f = _e, {
2580
2642
  className,
2581
2643
  debounce: debounce2 = 0,
2582
2644
  disabled,
@@ -2594,8 +2656,9 @@ function SpsAutocomplete(_a) {
2594
2656
  loading,
2595
2657
  maxHeightOptionListPx,
2596
2658
  maxHeightOptionListRem,
2659
+ disableOptionsMemoization,
2597
2660
  "data-testid": testId
2598
- } = _b, rest = __objRest(_b, [
2661
+ } = _f, rest = __objRest(_f, [
2599
2662
  "className",
2600
2663
  "debounce",
2601
2664
  "disabled",
@@ -2613,6 +2676,7 @@ function SpsAutocomplete(_a) {
2613
2676
  "loading",
2614
2677
  "maxHeightOptionListPx",
2615
2678
  "maxHeightOptionListRem",
2679
+ "disableOptionsMemoization",
2616
2680
  "data-testid"
2617
2681
  ]);
2618
2682
  const meta = formMeta || formControl2;
@@ -2727,7 +2791,8 @@ function SpsAutocomplete(_a) {
2727
2791
  zeroState,
2728
2792
  loading,
2729
2793
  maxHeightPx: maxHeightOptionListPx,
2730
- maxHeightRem: maxHeightOptionListRem
2794
+ maxHeightRem: maxHeightOptionListRem,
2795
+ disableOptionsMemoization
2731
2796
  }));
2732
2797
  }
2733
2798
  Object.assign(SpsAutocomplete, {
@@ -2869,7 +2934,8 @@ const propsDoc$1x = {
2869
2934
  onClose: "() => void",
2870
2935
  loading: "boolean",
2871
2936
  maxHeightOptionListPx: "number",
2872
- maxHeightOptionListRem: "number"
2937
+ maxHeightOptionListRem: "number",
2938
+ disableOptionsMemoization: "boolean"
2873
2939
  };
2874
2940
  const propTypes$1A = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
2875
2941
  alignLeft: propTypes$1G.exports.bool,
@@ -2885,7 +2951,8 @@ const propTypes$1A = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
2885
2951
  onClose: fun(),
2886
2952
  loading: propTypes$1G.exports.bool,
2887
2953
  maxHeightOptionListPx: propTypes$1G.exports.number,
2888
- maxHeightOptionListRem: propTypes$1G.exports.number
2954
+ maxHeightOptionListRem: propTypes$1G.exports.number,
2955
+ disableOptionsMemoization: propTypes$1G.exports.bool
2889
2956
  });
2890
2957
  function SpsDropdown(props2) {
2891
2958
  const _a = props2, {
@@ -2906,7 +2973,8 @@ function SpsDropdown(props2) {
2906
2973
  onClose,
2907
2974
  loading,
2908
2975
  maxHeightOptionListPx,
2909
- maxHeightOptionListRem
2976
+ maxHeightOptionListRem,
2977
+ disableOptionsMemoization
2910
2978
  } = _a, rest = __objRest(_a, [
2911
2979
  "alignLeft",
2912
2980
  "className",
@@ -2925,7 +2993,8 @@ function SpsDropdown(props2) {
2925
2993
  "onClose",
2926
2994
  "loading",
2927
2995
  "maxHeightOptionListPx",
2928
- "maxHeightOptionListRem"
2996
+ "maxHeightOptionListRem",
2997
+ "disableOptionsMemoization"
2929
2998
  ]);
2930
2999
  const { t: t2 } = React.useContext(I18nContext);
2931
3000
  const id2 = useElementId(idProp);
@@ -3026,7 +3095,8 @@ function SpsDropdown(props2) {
3026
3095
  optionRole: "option",
3027
3096
  loading,
3028
3097
  maxHeightPx: maxHeightOptionListPx,
3029
- maxHeightRem: maxHeightOptionListRem
3098
+ maxHeightRem: maxHeightOptionListRem,
3099
+ disableOptionsMemoization
3030
3100
  }), /* @__PURE__ */ React.createElement("div", {
3031
3101
  onClick: handleButtonClick,
3032
3102
  className: buttonClasses,
@@ -5804,10 +5874,10 @@ function SpsTab({
5804
5874
  className: clsx("sps-nav__item", "sps-nav__link", isSelected && "active", isDisabled && "sps-nav__item--disabled")
5805
5875
  }), item.rendered);
5806
5876
  }
5807
- function SpsTabPanel(_c) {
5808
- var _d = _c, {
5877
+ function SpsTabPanel(_g) {
5878
+ var _h = _g, {
5809
5879
  state
5810
- } = _d, props2 = __objRest(_d, [
5880
+ } = _h, props2 = __objRest(_h, [
5811
5881
  "state"
5812
5882
  ]);
5813
5883
  const ref2 = React.useRef();
@@ -5842,11 +5912,11 @@ Object.assign(SpsTabsV2, {
5842
5912
  });
5843
5913
  const propsDoc$1u = {};
5844
5914
  const propTypes$1x = {};
5845
- function SpsCardV2Footer(_e) {
5846
- var _f = _e, {
5915
+ function SpsCardV2Footer(_i) {
5916
+ var _j = _i, {
5847
5917
  children,
5848
5918
  className
5849
- } = _f, rest = __objRest(_f, [
5919
+ } = _j, rest = __objRest(_j, [
5850
5920
  "children",
5851
5921
  "className"
5852
5922
  ]);
@@ -5861,11 +5931,11 @@ Object.assign(SpsCardV2Footer, {
5861
5931
  });
5862
5932
  const propsDoc$1t = {};
5863
5933
  const propTypes$1w = {};
5864
- function SpsCardV2Header(_g) {
5865
- var _h = _g, {
5934
+ function SpsCardV2Header(_k) {
5935
+ var _l = _k, {
5866
5936
  children,
5867
5937
  className
5868
- } = _h, rest = __objRest(_h, [
5938
+ } = _l, rest = __objRest(_l, [
5869
5939
  "children",
5870
5940
  "className"
5871
5941
  ]);
@@ -5880,11 +5950,11 @@ Object.assign(SpsCardV2Header, {
5880
5950
  });
5881
5951
  const propsDoc$1s = {};
5882
5952
  const propTypes$1v = {};
5883
- function SpsCardV2(_i) {
5884
- var _j = _i, {
5953
+ function SpsCardV2(_m) {
5954
+ var _n = _m, {
5885
5955
  children,
5886
5956
  className
5887
- } = _j, rest = __objRest(_j, [
5957
+ } = _n, rest = __objRest(_n, [
5888
5958
  "children",
5889
5959
  "className"
5890
5960
  ]);
@@ -5911,11 +5981,11 @@ Object.assign(SpsCardV2, {
5911
5981
  });
5912
5982
  const propsDoc$1r = {};
5913
5983
  const propTypes$1u = {};
5914
- function SpsCardV2Title(_k) {
5915
- var _l = _k, {
5984
+ function SpsCardV2Title(_o) {
5985
+ var _p = _o, {
5916
5986
  children,
5917
5987
  className
5918
- } = _l, rest = __objRest(_l, [
5988
+ } = _p, rest = __objRest(_p, [
5919
5989
  "children",
5920
5990
  "className"
5921
5991
  ]);
@@ -6252,8 +6322,8 @@ const propTypes$1t = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
6252
6322
  label: propTypes$1G.exports.string,
6253
6323
  onChange: fun()
6254
6324
  });
6255
- function SpsCheckbox(_m) {
6256
- var _n = _m, {
6325
+ function SpsCheckbox(_q) {
6326
+ var _r = _q, {
6257
6327
  checked: checkedProp,
6258
6328
  className,
6259
6329
  disabled,
@@ -6266,7 +6336,7 @@ function SpsCheckbox(_m) {
6266
6336
  onChange,
6267
6337
  "data-testid": testId,
6268
6338
  unsafelyReplaceClassName
6269
- } = _n, rest = __objRest(_n, [
6339
+ } = _r, rest = __objRest(_r, [
6270
6340
  "checked",
6271
6341
  "className",
6272
6342
  "disabled",
@@ -16159,13 +16229,13 @@ const propTypes$1g = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
16159
16229
  attachTo: ref().isRequired,
16160
16230
  isOpen: propTypes$1G.exports.bool.isRequired
16161
16231
  });
16162
- const SpsDatepickerPopup = React.forwardRef((_o, ref2) => {
16163
- var _p = _o, {
16232
+ const SpsDatepickerPopup = React.forwardRef((_s, ref2) => {
16233
+ var _t = _s, {
16164
16234
  attachTo,
16165
16235
  children,
16166
16236
  className,
16167
16237
  isOpen
16168
- } = _p, rest = __objRest(_p, [
16238
+ } = _t, rest = __objRest(_t, [
16169
16239
  "attachTo",
16170
16240
  "children",
16171
16241
  "className",
@@ -16203,8 +16273,8 @@ const propTypes$1f = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
16203
16273
  value: impl()
16204
16274
  });
16205
16275
  const CSS_BLOCK$3 = "sps-datepicker";
16206
- function SpsDatepicker(_q) {
16207
- var _r = _q, {
16276
+ function SpsDatepicker(_u) {
16277
+ var _v = _u, {
16208
16278
  children,
16209
16279
  className,
16210
16280
  disabled,
@@ -16215,7 +16285,7 @@ function SpsDatepicker(_q) {
16215
16285
  onChange,
16216
16286
  value,
16217
16287
  "data-testid": testId
16218
- } = _r, rest = __objRest(_r, [
16288
+ } = _v, rest = __objRest(_v, [
16219
16289
  "children",
16220
16290
  "className",
16221
16291
  "disabled",
@@ -16428,8 +16498,8 @@ const DEFAULT_PRESETS = [
16428
16498
  { definition: "P90D", label: "design-system:datepicker.preset.ninetyDays" },
16429
16499
  { definition: "P1Y", label: "design-system:datepicker.preset.oneYear" }
16430
16500
  ];
16431
- function SpsDateRangePicker(_s) {
16432
- var _t = _s, {
16501
+ function SpsDateRangePicker(_w) {
16502
+ var _x = _w, {
16433
16503
  children,
16434
16504
  className,
16435
16505
  disabled,
@@ -16441,7 +16511,7 @@ function SpsDateRangePicker(_s) {
16441
16511
  presets = DEFAULT_PRESETS,
16442
16512
  value,
16443
16513
  "data-testid": testId
16444
- } = _t, rest = __objRest(_t, [
16514
+ } = _x, rest = __objRest(_x, [
16445
16515
  "children",
16446
16516
  "className",
16447
16517
  "disabled",
@@ -22462,7 +22532,7 @@ function SpsFieldset({
22462
22532
  legend,
22463
22533
  unsafelyReplaceClassName,
22464
22534
  optional = false,
22465
- enabled,
22535
+ enabled = false,
22466
22536
  onToggled,
22467
22537
  tooltip,
22468
22538
  "data-testid": testId
@@ -22472,14 +22542,9 @@ function SpsFieldset({
22472
22542
  const infoCircleElement = React.useRef(null);
22473
22543
  const [showTip, setShowTip] = React.useState(TooltipVisibility.HIDDEN);
22474
22544
  const [wasFocused, setWasFocused] = React.useState(false);
22475
- const [isChecked, setisChecked] = React.useState(false);
22476
- React.useEffect(() => {
22477
- setisChecked(enabled);
22478
- }, [enabled]);
22479
- React.useEffect(() => {
22480
- if (typeof onToggled === "function") {
22481
- onToggled(isChecked);
22482
- }
22545
+ const [isChecked, setIsChecked] = React.useState(enabled);
22546
+ useDidUpdateEffect(() => {
22547
+ onToggled == null ? void 0 : onToggled(isChecked);
22483
22548
  }, [isChecked]);
22484
22549
  React.useEffect(() => {
22485
22550
  if (formControlSet || formMeta) {
@@ -22511,7 +22576,7 @@ function SpsFieldset({
22511
22576
  checked: isChecked,
22512
22577
  className: "d-inline-flex",
22513
22578
  onChange: () => {
22514
- setisChecked(!isChecked);
22579
+ setIsChecked(!isChecked);
22515
22580
  },
22516
22581
  "data-testid": `${testId}__checkbox`
22517
22582
  }), legend, tooltip && /* @__PURE__ */ React.createElement("span", {
@@ -25103,8 +25168,8 @@ const propTypes$_ = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
25103
25168
  helpIconColor: propTypes$1G.exports.string,
25104
25169
  errors: nodeOrRenderFn
25105
25170
  });
25106
- function SpsLabel(_u) {
25107
- var _v = _u, {
25171
+ function SpsLabel(_y) {
25172
+ var _z = _y, {
25108
25173
  children,
25109
25174
  className,
25110
25175
  description,
@@ -25116,7 +25181,7 @@ function SpsLabel(_u) {
25116
25181
  errors,
25117
25182
  unsafelyReplaceClassName,
25118
25183
  "data-testid": testId
25119
- } = _v, rest = __objRest(_v, [
25184
+ } = _z, rest = __objRest(_z, [
25120
25185
  "children",
25121
25186
  "className",
25122
25187
  "description",
@@ -25575,6 +25640,68 @@ Object.assign(SpsListActionBar, {
25575
25640
  propTypes: propTypes$Z,
25576
25641
  displayName: "SpsListActionBar"
25577
25642
  });
25643
+ const SpsTableContext = React.createContext({
25644
+ resizeable: false,
25645
+ resizeState: {},
25646
+ setResizeState: () => {
25647
+ },
25648
+ setSingleResizeState: () => {
25649
+ },
25650
+ sort: [],
25651
+ setSort: () => {
25652
+ }
25653
+ });
25654
+ const SpsTableContextProvider = ({
25655
+ children,
25656
+ resizeable = false,
25657
+ resizeState,
25658
+ onResizeStateChange,
25659
+ sort,
25660
+ onSortChange
25661
+ }) => {
25662
+ const [currentResizeState, setCurrentResizeState] = React.useState(resizeState || {});
25663
+ const [currentSort, setCurrentSort] = React.useState(sort || []);
25664
+ const onSortChangeRef = React.useRef(onSortChange);
25665
+ onSortChangeRef.current = onSortChange;
25666
+ const onResizeStateChangeRef = React.useRef(onResizeStateChange);
25667
+ onResizeStateChangeRef.current = onResizeStateChange;
25668
+ const setSort = React.useCallback((newSort) => {
25669
+ var _a;
25670
+ setCurrentSort(newSort);
25671
+ (_a = onSortChangeRef.current) == null ? void 0 : _a.call(onSortChangeRef, newSort);
25672
+ }, []);
25673
+ const setResizeState = React.useCallback((newResizeState) => {
25674
+ var _a;
25675
+ setCurrentResizeState(newResizeState);
25676
+ (_a = onResizeStateChangeRef.current) == null ? void 0 : _a.call(onResizeStateChangeRef, newResizeState);
25677
+ }, []);
25678
+ const setSingleResizeState = React.useCallback((resizeKey, columnWidth) => {
25679
+ setCurrentResizeState((currentState) => {
25680
+ var _a;
25681
+ const newState = __spreadProps(__spreadValues({}, currentState), { [resizeKey]: columnWidth });
25682
+ (_a = onResizeStateChangeRef.current) == null ? void 0 : _a.call(onResizeStateChangeRef, newState);
25683
+ return newState;
25684
+ });
25685
+ }, []);
25686
+ const contextValue = React.useMemo(() => ({
25687
+ resizeable,
25688
+ resizeState: currentResizeState,
25689
+ setResizeState,
25690
+ setSingleResizeState,
25691
+ sort: currentSort,
25692
+ setSort
25693
+ }), [
25694
+ resizeable,
25695
+ currentResizeState,
25696
+ setResizeState,
25697
+ setSingleResizeState,
25698
+ currentSort,
25699
+ setSort
25700
+ ]);
25701
+ return /* @__PURE__ */ React.createElement(SpsTableContext.Provider, {
25702
+ value: contextValue
25703
+ }, children);
25704
+ };
25578
25705
  const getScrollParent = (node) => {
25579
25706
  const regex = /(auto|scroll)/;
25580
25707
  const parents = (_node, ps) => {
@@ -25633,7 +25760,10 @@ const usePinnedCellStyle = (isPinned, elementRef) => {
25633
25760
  };
25634
25761
  const usePinnedTableBackgroundStyle = (containerRef) => {
25635
25762
  React.useLayoutEffect(() => {
25636
- if (containerRef.current) {
25763
+ const applyBackgroundStyle = () => {
25764
+ if (!containerRef.current) {
25765
+ return;
25766
+ }
25637
25767
  const pinnedThs = containerRef.current.querySelectorAll("table > thead > tr:first-child > .sps-table__cell--pinned");
25638
25768
  const verticalScrollbarWidth = containerRef.current.offsetWidth - containerRef.current.clientWidth;
25639
25769
  const horizontalScrollbarHeight = containerRef.current.offsetHeight - containerRef.current.clientHeight;
@@ -25666,7 +25796,18 @@ const usePinnedTableBackgroundStyle = (containerRef) => {
25666
25796
  containerRef.current.style.backgroundPosition = `0 0, 100% 0, 0 ${-horizontalScrollbarHeight}px,
25667
25797
  calc(100% - ${verticalScrollbarWidth}px) ${-horizontalScrollbarHeight}px`;
25668
25798
  }
25799
+ };
25800
+ if (containerRef.current) {
25801
+ applyBackgroundStyle();
25802
+ containerRef.current.addEventListener("scroll", applyBackgroundStyle);
25803
+ window.addEventListener("scroll", applyBackgroundStyle);
25669
25804
  }
25805
+ return () => {
25806
+ if (containerRef.current) {
25807
+ containerRef.current.removeEventListener("scroll", applyBackgroundStyle);
25808
+ }
25809
+ window.removeEventListener("scroll", applyBackgroundStyle);
25810
+ };
25670
25811
  });
25671
25812
  };
25672
25813
  const usePinnedTableHeadStyle = (containerRef, maxHeight) => {
@@ -25824,49 +25965,241 @@ const useMaxHeightTableStyle = (containerRef, maxHeight) => {
25824
25965
  });
25825
25966
  };
25826
25967
  const propsDoc$X = {
25827
- controlCell: "boolean",
25828
- currentSort: "Array<SortedColumn>",
25968
+ sort: "SortedColumn",
25829
25969
  onSortChange: "SortChangeHandler",
25830
- sortKey: "string"
25970
+ selectable: "boolean",
25971
+ maxHeightPx: "number",
25972
+ maxHeightRem: "number",
25973
+ resizeable: "boolean",
25974
+ resizeState: "ResizeState",
25975
+ onResizeStateChange: "ResizeStateChangeHandler"
25831
25976
  };
25832
25977
  const propTypes$Y = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
25833
- controlCell: propTypes$1G.exports.bool,
25834
- currentSort: propTypes$1G.exports.arrayOf(impl()),
25835
25978
  onSortChange: fun(),
25979
+ sort: propTypes$1G.exports.arrayOf(impl()),
25980
+ selectable: propTypes$1G.exports.bool,
25981
+ maxHeightPx: propTypes$1G.exports.number,
25982
+ maxHeightRem: propTypes$1G.exports.number,
25983
+ resizeable: propTypes$1G.exports.bool,
25984
+ resizeState: impl(),
25985
+ onResizeStateChange: fun()
25986
+ });
25987
+ function SpsTable(_A) {
25988
+ var _B = _A, {
25989
+ children,
25990
+ className,
25991
+ onSortChange,
25992
+ sort,
25993
+ "data-testid": testId,
25994
+ unsafelyReplaceClassName,
25995
+ maxHeightPx,
25996
+ maxHeightRem,
25997
+ resizeable,
25998
+ resizeState,
25999
+ onResizeStateChange
26000
+ } = _B, rest = __objRest(_B, [
26001
+ "children",
26002
+ "className",
26003
+ "onSortChange",
26004
+ "sort",
26005
+ "data-testid",
26006
+ "unsafelyReplaceClassName",
26007
+ "maxHeightPx",
26008
+ "maxHeightRem",
26009
+ "resizeable",
26010
+ "resizeState",
26011
+ "onResizeStateChange"
26012
+ ]);
26013
+ const classes = clsx(unsafelyReplaceClassName || "sps-table-container", className);
26014
+ const maxHeight = maxHeightPx ? maxHeightPx / 16 : maxHeightRem;
26015
+ const tableContainerInlineStyles = maxHeight ? { maxHeight: `${maxHeight}rem` } : {};
26016
+ const containerRef = React.useRef(null);
26017
+ useMaxHeightTableStyle(containerRef, maxHeight);
26018
+ usePinnedTableBackgroundStyle(containerRef);
26019
+ usePinnedTableHeadStyle(containerRef, maxHeight);
26020
+ return /* @__PURE__ */ React.createElement(SpsTableContextProvider, {
26021
+ resizeable,
26022
+ resizeState,
26023
+ onResizeStateChange,
26024
+ sort,
26025
+ onSortChange
26026
+ }, /* @__PURE__ */ React.createElement("div", {
26027
+ ref: containerRef,
26028
+ className: classes,
26029
+ style: tableContainerInlineStyles
26030
+ }, /* @__PURE__ */ React.createElement("div", {
26031
+ className: "sps-table__shadow shadow--top"
26032
+ }), /* @__PURE__ */ React.createElement("div", {
26033
+ className: "sps-table__shadow shadow--bottom"
26034
+ }), /* @__PURE__ */ React.createElement("table", __spreadValues({
26035
+ className: "sps-table",
26036
+ role: "table",
26037
+ "data-testid": `${testId}`
26038
+ }, rest), children)));
26039
+ }
26040
+ Object.assign(SpsTable, {
26041
+ props: propsDoc$X,
26042
+ propTypes: propTypes$Y,
26043
+ displayName: "SpsTable"
26044
+ });
26045
+ function findTableElementParent(element) {
26046
+ if (!element || !element.parentElement) {
26047
+ return null;
26048
+ }
26049
+ let parent = element.parentElement;
26050
+ while (parent) {
26051
+ if (parent.tagName.toLowerCase() === "table") {
26052
+ return parent;
26053
+ }
26054
+ parent = parent.parentElement;
26055
+ }
26056
+ return null;
26057
+ }
26058
+ const useColumnResizer = ({
26059
+ tableHeaderRef,
26060
+ resizerRef,
26061
+ resizeKey
26062
+ }) => {
26063
+ const { resizeable, resizeState, setSingleResizeState } = React.useContext(SpsTableContext);
26064
+ const isResizeable = !!resizeable && !!resizeKey;
26065
+ const initialColumnWidth = isResizeable ? resizeState == null ? void 0 : resizeState[resizeKey] : void 0;
26066
+ React.useLayoutEffect(() => {
26067
+ let start = null;
26068
+ let currentColumnWidth = initialColumnWidth;
26069
+ const table = findTableElementParent(tableHeaderRef.current);
26070
+ function applyResize() {
26071
+ if (tableHeaderRef.current) {
26072
+ const width = currentColumnWidth ? `${currentColumnWidth}px` : null;
26073
+ tableHeaderRef.current.style.width = width;
26074
+ tableHeaderRef.current.style.maxWidth = width;
26075
+ tableHeaderRef.current.style.minWidth = width;
26076
+ tableHeaderRef.current.style.overflow = width ? "hidden" : null;
26077
+ tableHeaderRef.current.style.textOverflow = width ? "ellipsis" : null;
26078
+ if (start) {
26079
+ const resizer = tableHeaderRef.current.querySelector(".sps-table__column-resizer");
26080
+ if (resizer) {
26081
+ resizer.style.backgroundColor = colors.blue200;
26082
+ }
26083
+ }
26084
+ if (!tableHeaderRef.current.classList.contains("sps-table__cell--pinned")) {
26085
+ tableHeaderRef.current.style.position = "relative";
26086
+ }
26087
+ if (table) {
26088
+ const cells = table.querySelectorAll(`tbody > tr > td:nth-of-type(${tableHeaderRef.current.cellIndex + 1})`);
26089
+ for (let i2 = 0; i2 < cells.length; i2 += 1) {
26090
+ cells[i2].style.width = width;
26091
+ cells[i2].style.maxWidth = width;
26092
+ cells[i2].style.minWidth = width;
26093
+ cells[i2].style.overflow = width ? "hidden" : null;
26094
+ cells[i2].style.textOverflow = width ? "ellipsis" : null;
26095
+ if (!cells[i2].title) {
26096
+ cells[i2].title = cells[i2].textContent;
26097
+ }
26098
+ }
26099
+ }
26100
+ }
26101
+ }
26102
+ const dragStartListener = (event) => {
26103
+ if (!tableHeaderRef.current) {
26104
+ return;
26105
+ }
26106
+ start = event.clientX;
26107
+ currentColumnWidth = tableHeaderRef.current.clientWidth;
26108
+ applyResize();
26109
+ };
26110
+ const dragListener = (event) => {
26111
+ if (!start || !tableHeaderRef.current) {
26112
+ return;
26113
+ }
26114
+ const delta = Math.max(Math.min(start - event.clientX, 5), -5);
26115
+ if (delta !== 0) {
26116
+ start = event.clientX;
26117
+ currentColumnWidth = Math.max(tableHeaderRef.current.clientWidth - delta, 40);
26118
+ applyResize();
26119
+ }
26120
+ };
26121
+ const dragEndListener = () => {
26122
+ if (!tableHeaderRef.current) {
26123
+ return;
26124
+ }
26125
+ start = null;
26126
+ applyResize();
26127
+ setSingleResizeState(resizeKey, currentColumnWidth);
26128
+ const resizer = tableHeaderRef.current.querySelector(".sps-table__column-resizer");
26129
+ if (resizer) {
26130
+ resizer.style.backgroundColor = null;
26131
+ }
26132
+ };
26133
+ const doubleClickListener = () => {
26134
+ currentColumnWidth = null;
26135
+ applyResize();
26136
+ setSingleResizeState(resizeKey, currentColumnWidth);
26137
+ };
26138
+ if (isResizeable && resizerRef.current) {
26139
+ resizerRef.current.addEventListener("dragstart", dragStartListener);
26140
+ resizerRef.current.addEventListener("mousedown", dragStartListener);
26141
+ resizerRef.current.addEventListener("dblclick", doubleClickListener);
26142
+ window.addEventListener("mousemove", dragListener);
26143
+ window.addEventListener("dragend", dragEndListener);
26144
+ window.addEventListener("mouseup", dragEndListener);
26145
+ applyResize();
26146
+ }
26147
+ return () => {
26148
+ if (resizerRef.current) {
26149
+ resizerRef.current.removeEventListener("dragstart", dragStartListener);
26150
+ resizerRef.current.removeEventListener("mousedown", dragStartListener);
26151
+ resizerRef.current.removeEventListener("dblclick", doubleClickListener);
26152
+ }
26153
+ window.removeEventListener("mousemove", dragListener);
26154
+ window.removeEventListener("dragend", dragEndListener);
26155
+ window.removeEventListener("mouseup", dragEndListener);
26156
+ };
26157
+ }, [
26158
+ isResizeable,
26159
+ initialColumnWidth,
26160
+ resizeKey,
26161
+ setSingleResizeState
26162
+ ]);
26163
+ return { isResizeable };
26164
+ };
26165
+ const propsDoc$W = {
26166
+ controlCell: "boolean",
26167
+ sortKey: "string",
26168
+ resizeKey: "string",
26169
+ pinned: "boolean"
26170
+ };
26171
+ const propTypes$X = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
26172
+ controlCell: propTypes$1G.exports.bool,
25836
26173
  sortKey: propTypes$1G.exports.string,
26174
+ resizeKey: propTypes$1G.exports.string,
25837
26175
  pinned: propTypes$1G.exports.bool
25838
26176
  });
25839
- function SpsTableHeader(props2) {
25840
- const _a = props2, {
26177
+ function SpsTableHeader(_C) {
26178
+ var _D = _C, {
25841
26179
  children,
25842
26180
  className,
25843
26181
  controlCell,
25844
- currentSort,
25845
- onSortChange,
25846
26182
  sortKey,
26183
+ resizeKey,
25847
26184
  "data-testid": testId,
25848
26185
  unsafelyReplaceClassName,
25849
26186
  pinned
25850
- } = _a, rest = __objRest(_a, [
26187
+ } = _D, rest = __objRest(_D, [
25851
26188
  "children",
25852
26189
  "className",
25853
26190
  "controlCell",
25854
- "currentSort",
25855
- "onSortChange",
25856
26191
  "sortKey",
26192
+ "resizeKey",
25857
26193
  "data-testid",
25858
26194
  "unsafelyReplaceClassName",
25859
26195
  "pinned"
25860
26196
  ]);
25861
- const [sort, setSort] = React.useState();
25862
- React.useEffect(() => {
25863
- setSort(currentSort && currentSort[0].key === sortKey ? currentSort[0].direction : void 0);
25864
- }, [currentSort]);
26197
+ const { sort, setSort } = React.useContext(SpsTableContext);
26198
+ const currentSort = sort == null ? void 0 : sort.find((s) => s.key === sortKey);
25865
26199
  const flipSort = () => {
25866
26200
  if (sortKey && !controlCell) {
25867
- const curSort = sort === SortDirection.ASCENDING ? SortDirection.DESCENDING : SortDirection.ASCENDING;
25868
- setSort(curSort);
25869
- onSortChange([{ key: sortKey, direction: curSort }]);
26201
+ const direction = (currentSort == null ? void 0 : currentSort.direction) === SortDirection.ASCENDING ? SortDirection.DESCENDING : SortDirection.ASCENDING;
26202
+ setSort([{ key: sortKey, direction }]);
25870
26203
  }
25871
26204
  };
25872
26205
  const handleKeyEvent = (event) => {
@@ -25875,14 +26208,16 @@ function SpsTableHeader(props2) {
25875
26208
  flipSort();
25876
26209
  }
25877
26210
  };
25878
- const classes = clsx(unsafelyReplaceClassName || "sps-table__header", controlCell && "sps-table__header--control", !sortKey && "sps-table__header--sort-disabled", sort === SortDirection.ASCENDING && "sps-table__header--sorted-asc", sort === SortDirection.DESCENDING && "sps-table__header--sorted-desc", pinned && "sps-table__cell--pinned", className);
25879
26211
  const tableHeaderRef = React.useRef(null);
25880
26212
  usePinnedCellStyle(pinned, tableHeaderRef);
26213
+ const resizerRef = React.useRef(null);
26214
+ const { isResizeable } = useColumnResizer({ tableHeaderRef, resizerRef, resizeKey });
26215
+ const classes = clsx(unsafelyReplaceClassName || "sps-table__header", controlCell && "sps-table__header--control", !sortKey && "sps-table__header--sort-disabled", (currentSort == null ? void 0 : currentSort.direction) === SortDirection.ASCENDING && "sps-table__header--sorted-asc", (currentSort == null ? void 0 : currentSort.direction) === SortDirection.DESCENDING && "sps-table__header--sorted-desc", pinned && "sps-table__cell--pinned", isResizeable && "sps-table__header--resizeable", className);
25881
26216
  return /* @__PURE__ */ React.createElement("th", __spreadValues({
25882
26217
  className: classes,
25883
26218
  ref: tableHeaderRef,
25884
26219
  role: "columnheader",
25885
- "aria-sort": sort || "none",
26220
+ "aria-sort": (currentSort == null ? void 0 : currentSort.direction) || "none",
25886
26221
  "data-testid": `${testId}__header`
25887
26222
  }, rest), /* @__PURE__ */ React.createElement("span", {
25888
26223
  className: "sps-table__header-cell-body",
@@ -25890,115 +26225,49 @@ function SpsTableHeader(props2) {
25890
26225
  onClick: flipSort,
25891
26226
  tabIndex: sortKey ? 0 : null,
25892
26227
  onKeyDown: handleKeyEvent
25893
- }, children));
26228
+ }, children), isResizeable && /* @__PURE__ */ React.createElement("span", {
26229
+ ref: resizerRef,
26230
+ className: clsx("sps-table__column-resizer")
26231
+ }));
25894
26232
  }
25895
26233
  Object.assign(SpsTableHeader, {
25896
- props: propsDoc$X,
25897
- propTypes: propTypes$Y,
26234
+ props: propsDoc$W,
26235
+ propTypes: propTypes$X,
25898
26236
  displayName: "SpsTableHeader"
25899
26237
  });
25900
26238
  function SpsTh(props2) {
25901
26239
  return /* @__PURE__ */ React.createElement(SpsTableHeader, __spreadValues({}, props2));
25902
26240
  }
25903
26241
  Object.assign(SpsTh, {
25904
- props: propsDoc$X,
25905
- propTypes: propTypes$Y,
25906
- displayName: "SpsTh"
25907
- });
25908
- const propsDoc$W = {
25909
- currentSort: "Array<SortedColumn>",
25910
- onSortChange: "SortChangeHandler"
25911
- };
25912
- const propTypes$X = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
25913
- currentSort: propTypes$1G.exports.arrayOf(impl()),
25914
- onSortChange: fun()
25915
- });
25916
- function SpsTableRow(props2) {
25917
- const _a = props2, {
25918
- children,
25919
- className,
25920
- currentSort,
25921
- onSortChange,
25922
- "data-testid": testId,
25923
- unsafelyReplaceClassName
25924
- } = _a, rest = __objRest(_a, [
25925
- "children",
25926
- "className",
25927
- "currentSort",
25928
- "onSortChange",
25929
- "data-testid",
25930
- "unsafelyReplaceClassName"
25931
- ]);
25932
- const newProps = {
25933
- onSortChange,
25934
- currentSort
25935
- };
25936
- const classes = clsx(unsafelyReplaceClassName || "sps-table__row", className);
25937
- return /* @__PURE__ */ React.createElement("tr", __spreadValues({
25938
- className: classes,
25939
- role: "row",
25940
- "data-testid": `${testId}__row`
25941
- }, rest), React.Children.map(children, (child) => {
25942
- if (child && (child.type === SpsTableHeader || child.type === SpsTh)) {
25943
- return React.cloneElement(child, newProps);
25944
- }
25945
- return child;
25946
- }));
25947
- }
25948
- Object.assign(SpsTableRow, {
25949
- props: propsDoc$W,
25950
- propTypes: propTypes$X,
25951
- displayName: "SpsTableRow"
25952
- });
25953
- function SpsTr(props2) {
25954
- return /* @__PURE__ */ React.createElement(SpsTableRow, __spreadValues({}, props2));
25955
- }
25956
- Object.assign(SpsTr, {
25957
26242
  props: propsDoc$W,
25958
26243
  propTypes: propTypes$X,
25959
- displayName: "SpsTr"
26244
+ displayName: "SpsTh"
25960
26245
  });
25961
26246
  const propsDoc$V = {
25962
- currentSort: "Array<SortedColumn>",
25963
- onSortChange: "SortChangeHandler"
26247
+ pinned: "boolean"
25964
26248
  };
25965
26249
  const propTypes$W = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
25966
- onSortChange: fun(),
25967
- currentSort: propTypes$1G.exports.arrayOf(impl()),
25968
26250
  pinned: propTypes$1G.exports.bool
25969
26251
  });
25970
- function SpsTableHead(props2) {
25971
- const _a = props2, {
26252
+ function SpsTableHead(_E) {
26253
+ var _F = _E, {
25972
26254
  children,
25973
26255
  className,
25974
- currentSort,
25975
- onSortChange,
25976
26256
  "data-testid": testId,
25977
26257
  unsafelyReplaceClassName,
25978
26258
  pinned
25979
- } = _a, rest = __objRest(_a, [
26259
+ } = _F, rest = __objRest(_F, [
25980
26260
  "children",
25981
26261
  "className",
25982
- "currentSort",
25983
- "onSortChange",
25984
26262
  "data-testid",
25985
26263
  "unsafelyReplaceClassName",
25986
26264
  "pinned"
25987
26265
  ]);
25988
- const newProps = {
25989
- onSortChange,
25990
- currentSort
25991
- };
25992
26266
  const classes = clsx(unsafelyReplaceClassName || "sps-table__head", pinned && "sps-table__head--pinned", className);
25993
26267
  return /* @__PURE__ */ React.createElement("thead", __spreadValues({
25994
26268
  className: classes,
25995
26269
  "data-testid": `${testId}__head`
25996
- }, rest), React.Children.map(children, (child) => {
25997
- if (child && (child.type === SpsTableRow || child.type === SpsTr)) {
25998
- return React.cloneElement(child, newProps);
25999
- }
26000
- return child;
26001
- }));
26270
+ }, rest), children);
26002
26271
  }
26003
26272
  Object.assign(SpsTableHead, {
26004
26273
  props: propsDoc$V,
@@ -26013,89 +26282,39 @@ Object.assign(SpsThead, {
26013
26282
  propTypes: propTypes$W,
26014
26283
  displayName: "SpsThead"
26015
26284
  });
26016
- const propsDoc$U = {
26017
- sort: "SortedColumn",
26018
- onSortChange: "SortChangeHandler",
26019
- selectable: "boolean",
26020
- maxHeightPx: "number",
26021
- maxHeightRem: "number"
26022
- };
26023
- const propTypes$V = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
26024
- onSortChange: fun(),
26025
- sort: propTypes$1G.exports.arrayOf(impl()),
26026
- selectable: propTypes$1G.exports.bool,
26027
- maxHeightPx: propTypes$1G.exports.number,
26028
- maxHeightRem: propTypes$1G.exports.number
26029
- });
26030
- function SpsTable(props2) {
26031
- const _a = props2, {
26285
+ const propsDoc$U = {};
26286
+ const propTypes$V = __spreadValues({}, spsGlobalPropTypes);
26287
+ function SpsTableRow(_G) {
26288
+ var _H = _G, {
26032
26289
  children,
26033
26290
  className,
26034
- onSortChange,
26035
- sort,
26036
26291
  "data-testid": testId,
26037
- unsafelyReplaceClassName,
26038
- maxHeightPx,
26039
- maxHeightRem
26040
- } = _a, rest = __objRest(_a, [
26292
+ unsafelyReplaceClassName
26293
+ } = _H, rest = __objRest(_H, [
26041
26294
  "children",
26042
26295
  "className",
26043
- "onSortChange",
26044
- "sort",
26045
26296
  "data-testid",
26046
- "unsafelyReplaceClassName",
26047
- "maxHeightPx",
26048
- "maxHeightRem"
26297
+ "unsafelyReplaceClassName"
26049
26298
  ]);
26050
- const [currentSort, setSort] = React.useState(sort);
26051
- const updateSortingDisplay = (newSort) => {
26052
- const sortedColumn = newSort && newSort[0];
26053
- React.Children.map(children, (child) => React.Children.map(child.props.children, (c2) => React.Children.map(c2.props.children, (c22) => {
26054
- var _a2, _b;
26055
- if (sortedColumn && (((_a2 = c22 == null ? void 0 : c22.props) == null ? void 0 : _a2.sortKey) && ((_b = c22 == null ? void 0 : c22.props) == null ? void 0 : _b.sortKey) === sortedColumn.key)) {
26056
- setSort([sortedColumn]);
26057
- }
26058
- })));
26059
- };
26060
- const sortChange = (newSort) => {
26061
- setSort(newSort);
26062
- onSortChange(newSort);
26063
- updateSortingDisplay(newSort);
26064
- };
26065
- const newProps = {
26066
- onSortChange: sortChange,
26067
- currentSort
26068
- };
26069
- const classes = clsx(unsafelyReplaceClassName || "sps-table-container", className);
26070
- const maxHeight = maxHeightPx ? maxHeightPx / 16 : maxHeightRem;
26071
- const tableContainerInlineStyles = maxHeight ? { maxHeight: `${maxHeight}rem` } : {};
26072
- const containerRef = React.useRef(null);
26073
- useMaxHeightTableStyle(containerRef, maxHeight);
26074
- usePinnedTableBackgroundStyle(containerRef);
26075
- usePinnedTableHeadStyle(containerRef, maxHeight);
26076
- return /* @__PURE__ */ React.createElement("div", {
26077
- ref: containerRef,
26299
+ const classes = clsx(unsafelyReplaceClassName || "sps-table__row", className);
26300
+ return /* @__PURE__ */ React.createElement("tr", __spreadValues({
26078
26301
  className: classes,
26079
- style: tableContainerInlineStyles
26080
- }, /* @__PURE__ */ React.createElement("div", {
26081
- className: "sps-table__shadow shadow--top"
26082
- }), /* @__PURE__ */ React.createElement("div", {
26083
- className: "sps-table__shadow shadow--bottom"
26084
- }), /* @__PURE__ */ React.createElement("table", __spreadValues({
26085
- className: "sps-table",
26086
- role: "table",
26087
- "data-testid": `${testId}`
26088
- }, rest), React.Children.map(children, (child) => {
26089
- if (child.type === SpsTableHead || child.type === SpsThead) {
26090
- return React.cloneElement(child, newProps);
26091
- }
26092
- return child;
26093
- })));
26302
+ role: "row",
26303
+ "data-testid": `${testId}__row`
26304
+ }, rest), children);
26094
26305
  }
26095
- Object.assign(SpsTable, {
26306
+ Object.assign(SpsTableRow, {
26096
26307
  props: propsDoc$U,
26097
26308
  propTypes: propTypes$V,
26098
- displayName: "SpsTable"
26309
+ displayName: "SpsTableRow"
26310
+ });
26311
+ function SpsTr(props2) {
26312
+ return /* @__PURE__ */ React.createElement(SpsTableRow, __spreadValues({}, props2));
26313
+ }
26314
+ Object.assign(SpsTr, {
26315
+ props: propsDoc$U,
26316
+ propTypes: propTypes$V,
26317
+ displayName: "SpsTr"
26099
26318
  });
26100
26319
  const propsDoc$T = {};
26101
26320
  const propTypes$U = __spreadValues({}, spsGlobalPropTypes);
@@ -26133,7 +26352,8 @@ Object.assign(SpsTbody, {
26133
26352
  const propsDoc$S = {
26134
26353
  buttonCell: "boolean",
26135
26354
  controlCell: "boolean",
26136
- wrap: "SpsTableCellWrapWidth"
26355
+ wrap: "SpsTableCellWrapWidth",
26356
+ pinned: "boolean"
26137
26357
  };
26138
26358
  const propTypes$T = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
26139
26359
  buttonCell: propTypes$1G.exports.bool,
@@ -26193,11 +26413,11 @@ Object.assign(SpsTd, {
26193
26413
  const propsDoc$R = {};
26194
26414
  const propTypes$S = __spreadValues({}, spsGlobalPropTypes);
26195
26415
  const CSS_BLOCK$1 = "sps-icon-button-panel";
26196
- function SpsIconButtonPanel(_w) {
26197
- var _x = _w, {
26416
+ function SpsIconButtonPanel(_I) {
26417
+ var _J = _I, {
26198
26418
  children,
26199
26419
  className
26200
- } = _x, rest = __objRest(_x, [
26420
+ } = _J, rest = __objRest(_J, [
26201
26421
  "children",
26202
26422
  "className"
26203
26423
  ]);
@@ -27236,6 +27456,146 @@ const SpsTableExamples = {
27236
27456
  `
27237
27457
  }
27238
27458
  }
27459
+ },
27460
+ resizeableColumns: {
27461
+ label: "Resizeable Columns",
27462
+ examples: {
27463
+ basic: {
27464
+ react: code`
27465
+ function DemoComponent() {
27466
+ const [resizeState, setResizeState] = React.useState({});
27467
+
27468
+ const items = [
27469
+ {
27470
+ spine: 2,
27471
+ title: "Seven Samurai",
27472
+ year: 1954,
27473
+ director: "Akira Kurosawa",
27474
+ runtime: 207,
27475
+ aspect_ratio: "1.33:1",
27476
+ countries: "Japan",
27477
+ languages: "Japanese",
27478
+ price: "$39.96"
27479
+ },
27480
+ {
27481
+ spine: 29,
27482
+ title: "Picnic at Hanging Rock",
27483
+ year: 1975,
27484
+ director: "Peter Weir",
27485
+ runtime: 107,
27486
+ aspect_ratio: "1.78:1",
27487
+ countries: "Australia",
27488
+ languages: "English",
27489
+ price: "$39.95"
27490
+ },
27491
+ {
27492
+ spine: 62,
27493
+ title: "The Passion of Joan of Arc",
27494
+ year: 1928,
27495
+ director: "Carl Theodor Dreyer",
27496
+ runtime: 81,
27497
+ aspect_ratio: "1.33:1",
27498
+ countries: "France",
27499
+ languages: "French",
27500
+ price: "$31.96"
27501
+ },
27502
+ {
27503
+ spine: 484,
27504
+ title: "Jeanne Dielman, 23, quai du Commerce, 1080 Bruxelles",
27505
+ year: 1975,
27506
+ director: "Chantal Akerman",
27507
+ runtime: 201,
27508
+ aspect_ratio: "1.66:1",
27509
+ countries: "France, Belgium",
27510
+ languages: "French",
27511
+ price: "$31.96"
27512
+ },
27513
+ {
27514
+ spine: 701,
27515
+ title: "Persona",
27516
+ year: 1966,
27517
+ director: "Ingmar Bergman",
27518
+ runtime: 83,
27519
+ aspect_ratio: "1.37:1",
27520
+ countries: "Sweden",
27521
+ languages: "Swedish",
27522
+ price: "$31.96"
27523
+ },
27524
+ {
27525
+ spine: 740,
27526
+ title: "The Bitter Tears of Petra von Kant",
27527
+ year: 1972,
27528
+ director: "Rainer Werner Fassbinder",
27529
+ runtime: 125,
27530
+ aspect_ratio: "1.37:1",
27531
+ countries: "West Germany",
27532
+ languages: "German",
27533
+ price: "$31.96"
27534
+ },
27535
+ {
27536
+ spine: 782,
27537
+ title: "The Apu Trilogy",
27538
+ year: 1959,
27539
+ director: "Satyajit Ray",
27540
+ aspect_ratio: "1.37:1",
27541
+ countries: "India",
27542
+ languages: "Bengali",
27543
+ price: "$79.96"
27544
+ },
27545
+ {
27546
+ spine: 888,
27547
+ title: "Stalker",
27548
+ year: 1979,
27549
+ director: "Andrei Tarkovsky",
27550
+ runtime: 161,
27551
+ aspect_ratio: "1.37:1",
27552
+ countries: "Soviet Union",
27553
+ languages: "Russian",
27554
+ price: "$31.96"
27555
+ }
27556
+ ];
27557
+
27558
+ return (
27559
+ <>
27560
+ <SpsTable resizeable resizeState={resizeState} onResizeStateChange={setResizeState}>
27561
+ <SpsTableHead>
27562
+ <SpsTableRow>
27563
+ <SpsTableHeader resizeKey="spine">Spine#</SpsTableHeader>
27564
+ <SpsTableHeader resizeKey="title">Title</SpsTableHeader>
27565
+ <SpsTableHeader resizeKey="year">Year</SpsTableHeader>
27566
+ <SpsTableHeader resizeKey="director">Director</SpsTableHeader>
27567
+ <SpsTableHeader resizeKey="runtime">Runtime</SpsTableHeader>
27568
+ <SpsTableHeader resizeKey="aspect_ratio">Aspect Ratio</SpsTableHeader>
27569
+ <SpsTableHeader resizeKey="countries">Countries</SpsTableHeader>
27570
+ <SpsTableHeader resizeKey="languages">Languages</SpsTableHeader>
27571
+ <SpsTableHeader resizeKey="price" className="text-right">Price</SpsTableHeader>
27572
+ </SpsTableRow>
27573
+ </SpsTableHead>
27574
+ <SpsTableBody>
27575
+ {items.map((row, index) => {
27576
+ return (
27577
+ <SpsTableRow key={index}>
27578
+ <SpsTableCell>{row["spine"]}</SpsTableCell>
27579
+ <SpsTableCell>{row["title"]}</SpsTableCell>
27580
+ <SpsTableCell>{row["year"]}</SpsTableCell>
27581
+ <SpsTableCell>{row["director"]}</SpsTableCell>
27582
+ <SpsTableCell>{row["runtime"]}</SpsTableCell>
27583
+ <SpsTableCell>{row["aspect_ratio"]}</SpsTableCell>
27584
+ <SpsTableCell>{row["countries"]}</SpsTableCell>
27585
+ <SpsTableCell>{row["languages"]}</SpsTableCell>
27586
+ <SpsTableCell className="text-right">{row["price"]}</SpsTableCell>
27587
+ </SpsTableRow>
27588
+ );
27589
+ })}
27590
+ </SpsTableBody>
27591
+ </SpsTable>
27592
+ {JSON.stringify({ resizeState })}
27593
+ </>
27594
+ );
27595
+ }
27596
+ `
27597
+ }
27598
+ }
27239
27599
  }
27240
27600
  };
27241
27601
  const SpsTagExamples = {
@@ -27755,8 +28115,8 @@ const propTypes$O = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
27755
28115
  formMeta: impl(),
27756
28116
  stacked: propTypes$1G.exports.bool
27757
28117
  });
27758
- function SpsInputGroup(_y) {
27759
- var _z = _y, {
28118
+ function SpsInputGroup(_K) {
28119
+ var _L = _K, {
27760
28120
  children,
27761
28121
  className,
27762
28122
  formArray: formArray2,
@@ -27765,7 +28125,7 @@ function SpsInputGroup(_y) {
27765
28125
  stacked,
27766
28126
  "data-testid": testId,
27767
28127
  unsafelyReplaceClassName
27768
- } = _z, rest = __objRest(_z, [
28128
+ } = _L, rest = __objRest(_L, [
27769
28129
  "children",
27770
28130
  "className",
27771
28131
  "formArray",
@@ -28933,8 +29293,8 @@ Object.assign(SpsModalFooter, {
28933
29293
  propTypes: {},
28934
29294
  displayName: "SpsModalFooter"
28935
29295
  });
28936
- function SpsModal(_A) {
28937
- var _B = _A, {
29296
+ function SpsModal(_M) {
29297
+ var _N = _M, {
28938
29298
  children,
28939
29299
  className,
28940
29300
  id: idProp,
@@ -28943,7 +29303,7 @@ function SpsModal(_A) {
28943
29303
  onClose,
28944
29304
  focusElementOnOpen,
28945
29305
  title
28946
- } = _B, rest = __objRest(_B, [
29306
+ } = _N, rest = __objRest(_N, [
28947
29307
  "children",
28948
29308
  "className",
28949
29309
  "id",
@@ -29536,7 +29896,8 @@ const propsDoc$H = {
29536
29896
  zeroState: "string",
29537
29897
  loading: "boolean",
29538
29898
  maxHeightOptionListPx: "number",
29539
- maxHeightOptionListRem: "number"
29899
+ maxHeightOptionListRem: "number",
29900
+ disableOptionsMemoization: "boolean"
29540
29901
  };
29541
29902
  const propTypes$H = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
29542
29903
  action: fun(),
@@ -29564,10 +29925,11 @@ const propTypes$H = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
29564
29925
  zeroState: propTypes$1G.exports.string,
29565
29926
  loading: propTypes$1G.exports.bool,
29566
29927
  maxHeightOptionListPx: propTypes$1G.exports.number,
29567
- maxHeightOptionListRem: propTypes$1G.exports.number
29928
+ maxHeightOptionListRem: propTypes$1G.exports.number,
29929
+ disableOptionsMemoization: propTypes$1G.exports.bool
29568
29930
  });
29569
- function SpsMultiSelect(_C) {
29570
- var _D = _C, {
29931
+ function SpsMultiSelect(_O) {
29932
+ var _P = _O, {
29571
29933
  action,
29572
29934
  captionKey,
29573
29935
  className,
@@ -29593,8 +29955,9 @@ function SpsMultiSelect(_C) {
29593
29955
  icon,
29594
29956
  maxHeightOptionListPx,
29595
29957
  maxHeightOptionListRem,
29958
+ disableOptionsMemoization,
29596
29959
  "data-testid": testId
29597
- } = _D, rest = __objRest(_D, [
29960
+ } = _P, rest = __objRest(_P, [
29598
29961
  "action",
29599
29962
  "captionKey",
29600
29963
  "className",
@@ -29620,6 +29983,7 @@ function SpsMultiSelect(_C) {
29620
29983
  "icon",
29621
29984
  "maxHeightOptionListPx",
29622
29985
  "maxHeightOptionListRem",
29986
+ "disableOptionsMemoization",
29623
29987
  "data-testid"
29624
29988
  ]);
29625
29989
  const meta = formMeta || formControl2;
@@ -29832,7 +30196,8 @@ function SpsMultiSelect(_C) {
29832
30196
  zeroState,
29833
30197
  loading,
29834
30198
  maxHeightPx: maxHeightOptionListPx,
29835
- maxHeightRem: maxHeightOptionListRem
30199
+ maxHeightRem: maxHeightOptionListRem,
30200
+ disableOptionsMemoization
29836
30201
  }));
29837
30202
  }
29838
30203
  Object.assign(SpsMultiSelect, {
@@ -30182,6 +30547,7 @@ const propsDoc$E = {
30182
30547
  notClearable: "boolean",
30183
30548
  options: "Eventually<any[]> | (filter?: string) => Eventually<any[]>",
30184
30549
  onChange: "ChangeEventHandler",
30550
+ onOpen: "OnOpenHandler",
30185
30551
  placeholder: "string",
30186
30552
  searchDebounce: "number",
30187
30553
  searchPlaceholder: "string",
@@ -30194,7 +30560,8 @@ const propsDoc$E = {
30194
30560
  loading: "boolean",
30195
30561
  filterByTextAndCaptionKey: "boolean",
30196
30562
  maxHeightOptionListPx: "number",
30197
- maxHeightOptionListRem: "number"
30563
+ maxHeightOptionListRem: "number",
30564
+ disableOptionsMemoization: "boolean"
30198
30565
  };
30199
30566
  const propTypes$E = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
30200
30567
  action: fun(),
@@ -30210,6 +30577,7 @@ const propTypes$E = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
30210
30577
  fun()
30211
30578
  ]).isRequired,
30212
30579
  onChange: fun(),
30580
+ onOpen: fun(),
30213
30581
  placeholder: propTypes$1G.exports.string,
30214
30582
  searchDebounce: propTypes$1G.exports.number,
30215
30583
  searchPlaceholder: propTypes$1G.exports.string,
@@ -30222,7 +30590,8 @@ const propTypes$E = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
30222
30590
  loading: propTypes$1G.exports.bool,
30223
30591
  filterByTextAndCaptionKey: propTypes$1G.exports.bool,
30224
30592
  maxHeightOptionListPx: propTypes$1G.exports.number,
30225
- maxHeightOptionListRem: propTypes$1G.exports.number
30593
+ maxHeightOptionListRem: propTypes$1G.exports.number,
30594
+ disableOptionsMemoization: propTypes$1G.exports.bool
30226
30595
  });
30227
30596
  const SpsSelect = React.forwardRef((props2, ref2) => {
30228
30597
  const _a = props2, {
@@ -30239,6 +30608,7 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
30239
30608
  options,
30240
30609
  onChange,
30241
30610
  onClick,
30611
+ onOpen,
30242
30612
  placeholder,
30243
30613
  searchDebounce,
30244
30614
  searchPlaceholder = "Search\u2026",
@@ -30252,7 +30622,8 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
30252
30622
  filterByTextAndCaptionKey,
30253
30623
  maxHeightOptionListPx,
30254
30624
  maxHeightOptionListRem,
30255
- "data-testid": testId
30625
+ "data-testid": testId,
30626
+ disableOptionsMemoization
30256
30627
  } = _a, rest = __objRest(_a, [
30257
30628
  "action",
30258
30629
  "autoFixWidth",
@@ -30267,6 +30638,7 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
30267
30638
  "options",
30268
30639
  "onChange",
30269
30640
  "onClick",
30641
+ "onOpen",
30270
30642
  "placeholder",
30271
30643
  "searchDebounce",
30272
30644
  "searchPlaceholder",
@@ -30280,7 +30652,8 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
30280
30652
  "filterByTextAndCaptionKey",
30281
30653
  "maxHeightOptionListPx",
30282
30654
  "maxHeightOptionListRem",
30283
- "data-testid"
30655
+ "data-testid",
30656
+ "disableOptionsMemoization"
30284
30657
  ]);
30285
30658
  const meta = formMeta || formControl2;
30286
30659
  const { wrapperId, controlId } = useFormControlId(id2, meta);
@@ -30380,6 +30753,7 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
30380
30753
  });
30381
30754
  useDidUpdateEffect(() => {
30382
30755
  if (state.isOpen) {
30756
+ onOpen == null ? void 0 : onOpen();
30383
30757
  const event = document.createEvent("CustomEvent");
30384
30758
  event.initCustomEvent("DropdownOpened", false, false, wrapperId);
30385
30759
  document.dispatchEvent(event);
@@ -30451,6 +30825,7 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
30451
30825
  loading,
30452
30826
  maxHeightPx: maxHeightOptionListPx,
30453
30827
  maxHeightRem: maxHeightOptionListRem,
30828
+ disableOptionsMemoization,
30454
30829
  "data-testid": `${testId}-option-list`
30455
30830
  }));
30456
30831
  });
@@ -30463,13 +30838,15 @@ const propsDoc$D = {
30463
30838
  page: "number",
30464
30839
  numPages: "number",
30465
30840
  onPageChange: "(number) => void",
30466
- disabled: "boolean"
30841
+ disabled: "boolean",
30842
+ unknownPageCount: "boolean"
30467
30843
  };
30468
30844
  const propTypes$D = __spreadValues({
30469
30845
  numPages: propTypes$1G.exports.number,
30470
30846
  onPageChange: fun(),
30471
30847
  page: propTypes$1G.exports.number,
30472
- disabled: propTypes$1G.exports.bool
30848
+ disabled: propTypes$1G.exports.bool,
30849
+ unknownPageCount: propTypes$1G.exports.bool
30473
30850
  }, spsGlobalPropTypes);
30474
30851
  function SpsPageSelector(props2) {
30475
30852
  const _a = props2, {
@@ -30479,7 +30856,8 @@ function SpsPageSelector(props2) {
30479
30856
  unsafelyReplaceClassName,
30480
30857
  className,
30481
30858
  "data-testid": testId,
30482
- disabled = false
30859
+ disabled = false,
30860
+ unknownPageCount = false
30483
30861
  } = _a, rest = __objRest(_a, [
30484
30862
  "numPages",
30485
30863
  "onPageChange",
@@ -30487,7 +30865,8 @@ function SpsPageSelector(props2) {
30487
30865
  "unsafelyReplaceClassName",
30488
30866
  "className",
30489
30867
  "data-testid",
30490
- "disabled"
30868
+ "disabled",
30869
+ "unknownPageCount"
30491
30870
  ]);
30492
30871
  const { t: t2 } = React.useContext(I18nContext);
30493
30872
  const [inputPage, setInputPage] = React.useState(pageProp);
@@ -30498,7 +30877,7 @@ function SpsPageSelector(props2) {
30498
30877
  }, [pageProp]);
30499
30878
  function updatePage(newPage) {
30500
30879
  const constrainedPage = constrain(newPage, [1, numPages]);
30501
- if (constrainedPage !== inputPage) {
30880
+ if (newPage !== page) {
30502
30881
  setPage(constrainedPage);
30503
30882
  setInputPage(constrainedPage);
30504
30883
  if (onPageChange && typeof onPageChange === "function") {
@@ -30506,17 +30885,15 @@ function SpsPageSelector(props2) {
30506
30885
  }
30507
30886
  }
30508
30887
  }
30509
- const debouncedPageUpdate = debounce(updatePage, 500);
30510
30888
  function onTextInputInput(event) {
30511
- setInputPage(event.target.value);
30512
- void debouncedPageUpdate(parseInt(event.target.value, 10));
30889
+ setInputPage(Number(event.target.value) || "");
30513
30890
  }
30514
30891
  const classes = clsx(unsafelyReplaceClassName || "sps-page-selector", className);
30515
30892
  const id2 = useElementId(null);
30516
30893
  return /* @__PURE__ */ React.createElement("div", __spreadValues({
30517
30894
  className: classes,
30518
30895
  "data-testid": testId
30519
- }, rest), /* @__PURE__ */ React.createElement("div", {
30896
+ }, rest), !unknownPageCount && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
30520
30897
  className: "sps-pagination__input-wrapper",
30521
30898
  "data-testid": `${testId}__input`
30522
30899
  }, /* @__PURE__ */ React.createElement("div", {
@@ -30524,7 +30901,9 @@ function SpsPageSelector(props2) {
30524
30901
  }, inputPage), /* @__PURE__ */ React.createElement("label", {
30525
30902
  htmlFor: id2.current,
30526
30903
  className: "sr-only"
30527
- }, t2("design-system:pagination.page")), /* @__PURE__ */ React.createElement("input", {
30904
+ }, t2("design-system:pagination.page")), /* @__PURE__ */ React.createElement(SpsForm, {
30905
+ onSubmit: () => updatePage(Number(inputPage))
30906
+ }, /* @__PURE__ */ React.createElement("input", {
30528
30907
  id: id2.current,
30529
30908
  type: "text",
30530
30909
  value: inputPage,
@@ -30532,11 +30911,12 @@ function SpsPageSelector(props2) {
30532
30911
  onChange: () => {
30533
30912
  },
30534
30913
  className: "sps-form-control sps-pagination__input",
30535
- disabled
30536
- })), /* @__PURE__ */ React.createElement("span", {
30914
+ disabled,
30915
+ onBlur: () => updatePage(Number(inputPage))
30916
+ }))), /* @__PURE__ */ React.createElement("span", {
30537
30917
  className: "sps-page-selector__total-pages",
30538
30918
  "data-testid": `${testId}_page-count`
30539
- }, Number.isNaN(numPages) ? t2("design-system:pagination.ofMany") : t2("design-system:pagination.ofPageCount", { pageCount: numPages })), /* @__PURE__ */ React.createElement("div", {
30919
+ }, Number.isNaN(numPages) ? t2("design-system:pagination.ofMany") : t2("design-system:pagination.ofPageCount", { pageCount: numPages }))), /* @__PURE__ */ React.createElement("div", {
30540
30920
  className: "sps-icon-button-panel",
30541
30921
  "data-testid": `${testId}__buttons`
30542
30922
  }, /* @__PURE__ */ React.createElement("div", {
@@ -30572,7 +30952,8 @@ const propsDoc$C = {
30572
30952
  pageSizeOptions: "Array<number>",
30573
30953
  totalResults: "number",
30574
30954
  onPageChange: "(page: number, pageSize: number, indices: [number, number]) => void",
30575
- disabled: "boolean"
30955
+ disabled: "boolean",
30956
+ unknownPageCount: "boolean"
30576
30957
  };
30577
30958
  const propTypes$C = __spreadValues({
30578
30959
  onPageChange: fun().isRequired,
@@ -30580,7 +30961,8 @@ const propTypes$C = __spreadValues({
30580
30961
  pageSize: propTypes$1G.exports.number,
30581
30962
  pageSizeOptions: propTypes$1G.exports.arrayOf(propTypes$1G.exports.number),
30582
30963
  totalResults: propTypes$1G.exports.number,
30583
- disabled: propTypes$1G.exports.bool
30964
+ disabled: propTypes$1G.exports.bool,
30965
+ unknownPageCount: propTypes$1G.exports.bool
30584
30966
  }, spsGlobalPropTypes);
30585
30967
  function SpsPagination(props2) {
30586
30968
  const _a = props2, {
@@ -30592,7 +30974,8 @@ function SpsPagination(props2) {
30592
30974
  "data-testid": testId,
30593
30975
  totalResults,
30594
30976
  unsafelyReplaceClassName,
30595
- disabled = false
30977
+ disabled = false,
30978
+ unknownPageCount = false
30596
30979
  } = _a, rest = __objRest(_a, [
30597
30980
  "className",
30598
30981
  "onPageChange",
@@ -30602,7 +30985,8 @@ function SpsPagination(props2) {
30602
30985
  "data-testid",
30603
30986
  "totalResults",
30604
30987
  "unsafelyReplaceClassName",
30605
- "disabled"
30988
+ "disabled",
30989
+ "unknownPageCount"
30606
30990
  ]);
30607
30991
  const [state, patchState] = usePatchReducer({
30608
30992
  page: pageProp,
@@ -30680,13 +31064,16 @@ function SpsPagination(props2) {
30680
31064
  value: state.pageSize,
30681
31065
  className: "ml-1 mr-1",
30682
31066
  disabled
30683
- }), "Per Page"), /* @__PURE__ */ React.createElement("div", {
31067
+ }), "Per Page"), unknownPageCount ? /* @__PURE__ */ React.createElement("div", {
31068
+ className: "sps-pagination__details"
31069
+ }, `Viewing ${state.indices[0]} - ${state.indices[1]}`) : /* @__PURE__ */ React.createElement("div", {
30684
31070
  className: "sps-pagination__details"
30685
31071
  }, `Viewing ${state.indices[0]} - ${state.indices[1]} of ${totalResultsString()}`), /* @__PURE__ */ React.createElement(SpsPageSelector, {
30686
31072
  numPages: state.numPages,
30687
31073
  page: state.page,
30688
31074
  onPageChange: handlePageChange,
30689
- disabled
31075
+ disabled,
31076
+ unknownPageCount
30690
31077
  }));
30691
31078
  }
30692
31079
  Object.assign(SpsPagination, {
@@ -30741,6 +31128,35 @@ const SpsPaginationExamples = {
30741
31128
  }
30742
31129
  `
30743
31130
  },
31131
+ situational: {
31132
+ description: () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("h4", null, "Unknown Page Count"), /* @__PURE__ */ React.createElement("p", null, "In cases where the exact page count of results is not able to be determined, a variation of the Pagination component with limited features can be utilized.")),
31133
+ react: code`
31134
+ function Component() {
31135
+ const [page, setPage] = React.useState(2);
31136
+ const [pageSize, setPageSize] = React.useState(25);
31137
+
31138
+ function handlePageChange(newPage, newPageSize) {
31139
+ console.log("change", newPage, newPageSize);
31140
+ setPage(newPage);
31141
+ setPageSize(newPageSize);
31142
+ }
31143
+
31144
+ return (
31145
+ <React.Fragment>
31146
+ <SpsPagination id="basic"
31147
+ totalResults={123}
31148
+ page={page}
31149
+ pageSize={pageSize}
31150
+ onPageChange={handlePageChange}
31151
+ unknownPageCount
31152
+ />
31153
+ <span className="mr-2">page: {page}</span>
31154
+ <span>pageSize: {pageSize}</span>
31155
+ </React.Fragment>
31156
+ );
31157
+ }
31158
+ `
31159
+ },
30744
31160
  disabled: {
30745
31161
  description: "Disabled state",
30746
31162
  react: code`
@@ -30820,7 +31236,7 @@ const propsDoc$A = {
30820
31236
  onTabChange: "(newTab: string) => void",
30821
31237
  onProductNameClick: "React.MouseEventHandler",
30822
31238
  productLogoSrc: "string",
30823
- productName: { type: "string", required: true },
31239
+ productName: "string",
30824
31240
  productNameHref: "string",
30825
31241
  tabs: "Array<string>"
30826
31242
  };
@@ -30830,7 +31246,7 @@ const propTypes$B = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
30830
31246
  onTabChange: fun(),
30831
31247
  onProductNameClick: fun(),
30832
31248
  productLogoSrc: propTypes$1G.exports.string,
30833
- productName: propTypes$1G.exports.string.isRequired,
31249
+ productName: propTypes$1G.exports.string,
30834
31250
  productNameHref: propTypes$1G.exports.string,
30835
31251
  tabs: propTypes$1G.exports.arrayOf(propTypes$1G.exports.string)
30836
31252
  });
@@ -30879,7 +31295,7 @@ function SpsProductBar(props2) {
30879
31295
  ref: rootElement
30880
31296
  }), /* @__PURE__ */ React.createElement("nav", {
30881
31297
  className: clsx("sps-navbar", "sps-navbar--expand-lg", fullWidth && "sps-navbar--full-width")
30882
- }, /* @__PURE__ */ React.createElement("a", {
31298
+ }, productName || productLogoSrc ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("a", {
30883
31299
  className: "sps-navbar__brand",
30884
31300
  href: productNameHref,
30885
31301
  onClick: onProductNameClick
@@ -30888,11 +31304,11 @@ function SpsProductBar(props2) {
30888
31304
  src: productLogoSrc,
30889
31305
  "aria-hidden": "true",
30890
31306
  alt: `${productName} Logo`
30891
- }), /* @__PURE__ */ React.createElement("span", {
31307
+ }), productName && /* @__PURE__ */ React.createElement("span", {
30892
31308
  className: "sps-navbar__brand-name"
30893
31309
  }, productName)), /* @__PURE__ */ React.createElement("span", {
30894
31310
  className: "sps-vertical-rule"
30895
- }), /* @__PURE__ */ React.createElement("div", {
31311
+ })) : null, /* @__PURE__ */ React.createElement("div", {
30896
31312
  className: "sps-navbar__nav"
30897
31313
  }, tabs.map((tab2) => /* @__PURE__ */ React.createElement("a", {
30898
31314
  className: clsx("sps-nav__item", "sps-nav__link", tab2 === activeTab && "active"),
@@ -31970,8 +32386,8 @@ const propTypes$x = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
31970
32386
  ref: ref(),
31971
32387
  value: propTypes$1G.exports.any
31972
32388
  });
31973
- function SpsRadioButton(_E) {
31974
- var _F = _E, {
32389
+ function SpsRadioButton(_Q) {
32390
+ var _R = _Q, {
31975
32391
  checked,
31976
32392
  className,
31977
32393
  "data-testid": testId,
@@ -31986,7 +32402,7 @@ function SpsRadioButton(_E) {
31986
32402
  ref: ref2,
31987
32403
  unsafelyReplaceClassName,
31988
32404
  value
31989
- } = _F, rest = __objRest(_F, [
32405
+ } = _R, rest = __objRest(_R, [
31990
32406
  "checked",
31991
32407
  "className",
31992
32408
  "data-testid",
@@ -32995,8 +33411,8 @@ const propTypes$v = __spreadValues({
32995
33411
  widthPx: propTypes$1G.exports.number,
32996
33412
  widthRem: propTypes$1G.exports.number
32997
33413
  }, spsGlobalPropTypes);
32998
- function SpsSortingHeaderCell(_G) {
32999
- var _H = _G, {
33414
+ function SpsSortingHeaderCell(_S) {
33415
+ var _T = _S, {
33000
33416
  className,
33001
33417
  "data-testid": testId,
33002
33418
  unsafelyReplaceClassName,
@@ -33009,7 +33425,7 @@ function SpsSortingHeaderCell(_G) {
33009
33425
  widthPx,
33010
33426
  widthRem,
33011
33427
  style: style2
33012
- } = _H, rest = __objRest(_H, [
33428
+ } = _T, rest = __objRest(_T, [
33013
33429
  "className",
33014
33430
  "data-testid",
33015
33431
  "unsafelyReplaceClassName",
@@ -33066,15 +33482,15 @@ const propTypes$u = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
33066
33482
  sort: propTypes$1G.exports.arrayOf(impl()),
33067
33483
  onSortChange: fun()
33068
33484
  });
33069
- function SpsSortingHeader(_I) {
33070
- var _J = _I, {
33485
+ function SpsSortingHeader(_U) {
33486
+ var _V = _U, {
33071
33487
  className,
33072
33488
  "data-testid": testId,
33073
33489
  unsafelyReplaceClassName,
33074
33490
  sort,
33075
33491
  onSortChange,
33076
33492
  children
33077
- } = _J, rest = __objRest(_J, [
33493
+ } = _V, rest = __objRest(_V, [
33078
33494
  "className",
33079
33495
  "data-testid",
33080
33496
  "unsafelyReplaceClassName",
@@ -33821,8 +34237,8 @@ const propTypes$o = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
33821
34237
  onClearCompleted: fun(),
33822
34238
  suppressTooltips: propTypes$1G.exports.bool
33823
34239
  });
33824
- function SpsTaskQueue(_K) {
33825
- var _L = _K, {
34240
+ function SpsTaskQueue(_W) {
34241
+ var _X = _W, {
33826
34242
  tasks = [],
33827
34243
  taskQueuePosition = Position.BOTTOM_RIGHT,
33828
34244
  notificationText,
@@ -33834,7 +34250,7 @@ function SpsTaskQueue(_K) {
33834
34250
  "data-testid": testId,
33835
34251
  unsafelyReplaceClassName,
33836
34252
  suppressTooltips = false
33837
- } = _L, rest = __objRest(_L, [
34253
+ } = _X, rest = __objRest(_X, [
33838
34254
  "tasks",
33839
34255
  "taskQueuePosition",
33840
34256
  "notificationText",
@@ -33878,6 +34294,7 @@ function SpsTaskQueue(_K) {
33878
34294
  const hasCompletedTask = tasks.some((task) => task.status === SpsTaskStatus.COMPLETED || task.status === SpsTaskStatus.ERRORED);
33879
34295
  const onCloseRef = React.useRef(onClose);
33880
34296
  onCloseRef.current = onClose;
34297
+ const tasksList = React.useRef();
33881
34298
  const handleToggle = () => {
33882
34299
  if (hasTasks && !isOpen) {
33883
34300
  setIsOpen(true);
@@ -33890,6 +34307,7 @@ function SpsTaskQueue(_K) {
33890
34307
  onClose();
33891
34308
  }
33892
34309
  }
34310
+ tasksList.current.scrollTop = 0;
33893
34311
  };
33894
34312
  const getTaskIcon = (task) => task.status === SpsTaskStatus.IN_PROGRESS ? SpsTaskStatusIcons[task.status] : `sps-icon sps-icon-${SpsTaskStatusIcons[task.status]}`;
33895
34313
  React.useEffect(() => {
@@ -33990,12 +34408,13 @@ function SpsTaskQueue(_K) {
33990
34408
  kind: tooltipKind,
33991
34409
  showOn: hasTasks ? TooltipShowTrigger.MANUAL : TooltipShowTrigger.MOUSEOVER,
33992
34410
  isShown: showNotification && !isOpen ? TooltipVisibility.VISIBLE : TooltipVisibility.HIDDEN,
33993
- hideDelay: TASK_QUEUE_NOTIFICATION_DURATION_MS
34411
+ hideDelay: Number(hasTasks) && TASK_QUEUE_NOTIFICATION_DURATION_MS
33994
34412
  }, !suppressTooltips && showNotification && (notificationText || t2("design-system:taskQueue.newTask")), !suppressTooltips && !showNotification && !hasTasks && t2("design-system:taskQueue.noTasks")), portal(/* @__PURE__ */ React.createElement("div", {
33995
34413
  ref: taskQueueDropdownRef,
33996
34414
  className: clsx("sps-task-queue__task-list", isOpen && "sps-task-queue__task-list--open", "z-stratum-dropdown"),
33997
34415
  style: posStyle
33998
34416
  }, /* @__PURE__ */ React.createElement("div", {
34417
+ ref: tasksList,
33999
34418
  className: "sps-task-queue__task-list-tasks"
34000
34419
  }, tasks.map((task, taskIndex) => /* @__PURE__ */ React.createElement("div", {
34001
34420
  key: taskIndex,
@@ -34364,8 +34783,8 @@ const propTypes$n = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
34364
34783
  value: propTypes$1G.exports.string,
34365
34784
  additionalText: propTypes$1G.exports.string
34366
34785
  });
34367
- const SpsTextInput = React.forwardRef((_M, ref2) => {
34368
- var _N = _M, {
34786
+ const SpsTextInput = React.forwardRef((_Y, ref2) => {
34787
+ var _Z = _Y, {
34369
34788
  className,
34370
34789
  disabled = false,
34371
34790
  formControl: formControl2,
@@ -34380,7 +34799,7 @@ const SpsTextInput = React.forwardRef((_M, ref2) => {
34380
34799
  unsafelyReplaceClassName,
34381
34800
  value = "",
34382
34801
  additionalText
34383
- } = _N, rest = __objRest(_N, [
34802
+ } = _Z, rest = __objRest(_Z, [
34384
34803
  "className",
34385
34804
  "disabled",
34386
34805
  "formControl",
@@ -34595,8 +35014,8 @@ const propTypes$m = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
34595
35014
  value: propTypes$1G.exports.string,
34596
35015
  additionalText: propTypes$1G.exports.string
34597
35016
  });
34598
- function SpsTextarea(_O) {
34599
- var _P = _O, {
35017
+ function SpsTextarea(__) {
35018
+ var _$ = __, {
34600
35019
  className,
34601
35020
  disabled = false,
34602
35021
  formControl: formControl2,
@@ -34611,7 +35030,7 @@ function SpsTextarea(_O) {
34611
35030
  unsafelyReplaceClassName,
34612
35031
  value = "",
34613
35032
  additionalText
34614
- } = _P, rest = __objRest(_P, [
35033
+ } = _$, rest = __objRest(_$, [
34615
35034
  "className",
34616
35035
  "disabled",
34617
35036
  "formControl",
@@ -34806,16 +35225,22 @@ const propsDoc$l = {
34806
35225
  href: "string",
34807
35226
  icon: { type: "ReactNodeOrRenderFn", required: "true" },
34808
35227
  error: "boolean",
35228
+ errorIcon: "ReactNodeOrRenderFn",
34809
35229
  title: { type: "string", required: "true" },
34810
- warning: "boolean"
35230
+ warning: "boolean",
35231
+ warningIcon: "ReactNodeOrRenderFn",
35232
+ disabled: "boolean"
34811
35233
  };
34812
35234
  const propTypes$l = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
34813
35235
  href: propTypes$1G.exports.string,
34814
35236
  target: propTypes$1G.exports.string,
34815
35237
  icon: nodeOrRenderFn.isRequired,
34816
35238
  error: propTypes$1G.exports.bool,
35239
+ errorIcon: nodeOrRenderFn,
34817
35240
  title: propTypes$1G.exports.string.isRequired,
34818
- warning: propTypes$1G.exports.bool
35241
+ warning: propTypes$1G.exports.bool,
35242
+ warningIcon: nodeOrRenderFn,
35243
+ disabled: propTypes$1G.exports.bool
34819
35244
  });
34820
35245
  function SpsTile(props2) {
34821
35246
  const _a = props2, {
@@ -34824,20 +35249,26 @@ function SpsTile(props2) {
34824
35249
  target,
34825
35250
  icon,
34826
35251
  error = false,
35252
+ errorIcon,
34827
35253
  title,
34828
35254
  unsafelyReplaceClassName,
34829
- warning = false
35255
+ warning = false,
35256
+ warningIcon,
35257
+ disabled = false
34830
35258
  } = _a, rest = __objRest(_a, [
34831
35259
  "className",
34832
35260
  "href",
34833
35261
  "target",
34834
35262
  "icon",
34835
35263
  "error",
35264
+ "errorIcon",
34836
35265
  "title",
34837
35266
  "unsafelyReplaceClassName",
34838
- "warning"
35267
+ "warning",
35268
+ "warningIcon",
35269
+ "disabled"
34839
35270
  ]);
34840
- const classes = clsx(unsafelyReplaceClassName || "sps-tile", className, error && "sps-tile--error", warning && "sps-tile--warning");
35271
+ const classes = clsx(unsafelyReplaceClassName || "sps-tile", className, error && "sps-tile--error", warning && "sps-tile--warning", disabled && "sps-tile--disabled");
34841
35272
  React.useEffect(() => {
34842
35273
  if (warning && error) {
34843
35274
  throw new Error("Tile should have warning or error, not both");
@@ -34847,16 +35278,16 @@ function SpsTile(props2) {
34847
35278
  className: "sps-tile-container sfg-col-3 sfg-break-col-6"
34848
35279
  }, /* @__PURE__ */ React.createElement("a", __spreadValues({
34849
35280
  className: classes,
34850
- href,
35281
+ href: disabled ? void 0 : href,
34851
35282
  target,
34852
35283
  rel: target === "_blank" ? "noopener noreferrer" : void 0
34853
35284
  }, rest), (warning || error) && /* @__PURE__ */ React.createElement("div", {
34854
35285
  className: "sps-tile--icon"
34855
- }, warning && /* @__PURE__ */ React.createElement("i", {
35286
+ }, warning && (warningIcon ? contentOf(warningIcon) : /* @__PURE__ */ React.createElement("i", {
34856
35287
  className: clsx("sps-icon", "sps-icon-status-warning")
34857
- }), error && /* @__PURE__ */ React.createElement("i", {
35288
+ })), error && (errorIcon ? contentOf(errorIcon) : /* @__PURE__ */ React.createElement("i", {
34858
35289
  className: clsx("sps-icon", "sps-icon-ban")
34859
- })), /* @__PURE__ */ React.createElement("div", {
35290
+ }))), /* @__PURE__ */ React.createElement("div", {
34860
35291
  className: "sps-tile--content"
34861
35292
  }, /* @__PURE__ */ React.createElement("div", {
34862
35293
  className: "sps-tile--image"
@@ -36201,8 +36632,8 @@ function Component() {
36201
36632
  };
36202
36633
  const propsDoc$7 = {};
36203
36634
  const propTypes$7 = __spreadValues({}, spsGlobalPropTypes);
36204
- function SpsFilterPanel(_Q) {
36205
- var _R = _Q, { children, className } = _R, rest = __objRest(_R, ["children", "className"]);
36635
+ function SpsFilterPanel(_aa) {
36636
+ var _ba = _aa, { children, className } = _ba, rest = __objRest(_ba, ["children", "className"]);
36206
36637
  return /* @__PURE__ */ React.createElement("div", __spreadValues({
36207
36638
  className: clsx("sps-filter-panel", className)
36208
36639
  }, rest), children);
@@ -36228,8 +36659,8 @@ const propTypes$6 = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
36228
36659
  onExpand: fun(),
36229
36660
  onCollapse: fun()
36230
36661
  });
36231
- function SpsFilterPanelSection(_S) {
36232
- var _T = _S, {
36662
+ function SpsFilterPanelSection(_ca) {
36663
+ var _da = _ca, {
36233
36664
  children,
36234
36665
  className,
36235
36666
  title,
@@ -36238,7 +36669,7 @@ function SpsFilterPanelSection(_S) {
36238
36669
  heightRem,
36239
36670
  onExpand,
36240
36671
  onCollapse
36241
- } = _T, rest = __objRest(_T, [
36672
+ } = _da, rest = __objRest(_da, [
36242
36673
  "children",
36243
36674
  "className",
36244
36675
  "title",
@@ -36291,12 +36722,12 @@ const propsDoc$5 = {
36291
36722
  const propTypes$5 = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
36292
36723
  onClear: fun()
36293
36724
  });
36294
- function SpsFilterPanelCap(_U) {
36295
- var _V = _U, {
36725
+ function SpsFilterPanelCap(_ea) {
36726
+ var _fa = _ea, {
36296
36727
  children,
36297
36728
  className,
36298
36729
  onClear
36299
- } = _V, rest = __objRest(_V, [
36730
+ } = _fa, rest = __objRest(_fa, [
36300
36731
  "children",
36301
36732
  "className",
36302
36733
  "onClear"
@@ -36655,14 +37086,14 @@ const propTypes$4 = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
36655
37086
  formMeta: impl(),
36656
37087
  onFilterChange: fun()
36657
37088
  });
36658
- function SpsFilterPanelFilterBox(_W) {
36659
- var _X = _W, {
37089
+ function SpsFilterPanelFilterBox(_ga) {
37090
+ var _ha = _ga, {
36660
37091
  className,
36661
37092
  value,
36662
37093
  placeholder,
36663
37094
  formMeta,
36664
37095
  onFilterChange
36665
- } = _X, rest = __objRest(_X, [
37096
+ } = _ha, rest = __objRest(_ha, [
36666
37097
  "className",
36667
37098
  "value",
36668
37099
  "placeholder",
@@ -36691,12 +37122,12 @@ const propsDoc$3 = {
36691
37122
  const propTypes$3 = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
36692
37123
  showCondition: propTypes$1G.exports.bool
36693
37124
  });
36694
- function SpsConditionalField(_Y) {
36695
- var _Z = _Y, {
37125
+ function SpsConditionalField(_ia) {
37126
+ var _ja = _ia, {
36696
37127
  showCondition = true,
36697
37128
  children,
36698
37129
  className
36699
- } = _Z, rest = __objRest(_Z, [
37130
+ } = _ja, rest = __objRest(_ja, [
36700
37131
  "showCondition",
36701
37132
  "children",
36702
37133
  "className"
@@ -37197,8 +37628,8 @@ function strToDollars(str) {
37197
37628
  function dollarsToStr(dollars) {
37198
37629
  return typeof dollars === "number" ? dollars.toFixed(2) : "";
37199
37630
  }
37200
- function SpsCurrencyInput(__) {
37201
- var _$ = __, {
37631
+ function SpsCurrencyInput(_ka) {
37632
+ var _la = _ka, {
37202
37633
  className,
37203
37634
  disabled = false,
37204
37635
  formMeta,
@@ -37208,7 +37639,7 @@ function SpsCurrencyInput(__) {
37208
37639
  ref: ref2,
37209
37640
  title,
37210
37641
  value
37211
- } = _$, rest = __objRest(_$, [
37642
+ } = _la, rest = __objRest(_la, [
37212
37643
  "className",
37213
37644
  "disabled",
37214
37645
  "formMeta",
@@ -37372,6 +37803,7 @@ const propTypes$1 = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
37372
37803
  function SpsKeyValueTag(props2) {
37373
37804
  const _a = props2, {
37374
37805
  color = TagKind.KEY,
37806
+ className,
37375
37807
  "data-testid": testId,
37376
37808
  href,
37377
37809
  icon,
@@ -37380,6 +37812,7 @@ function SpsKeyValueTag(props2) {
37380
37812
  unsafelyReplaceClassName
37381
37813
  } = _a, rest = __objRest(_a, [
37382
37814
  "color",
37815
+ "className",
37383
37816
  "data-testid",
37384
37817
  "href",
37385
37818
  "icon",
@@ -37387,7 +37820,7 @@ function SpsKeyValueTag(props2) {
37387
37820
  "value",
37388
37821
  "unsafelyReplaceClassName"
37389
37822
  ]);
37390
- const classes = clsx(unsafelyReplaceClassName || "sps-key-value-tag", href && "sps-key-value-tag--link");
37823
+ const classes = clsx(unsafelyReplaceClassName || "sps-key-value-tag", href && "sps-key-value-tag--link", className);
37391
37824
  return /* @__PURE__ */ React.createElement("span", __spreadValues({
37392
37825
  className: classes,
37393
37826
  "data-testid": `${testId}__key-value-tag`
@@ -37551,4 +37984,4 @@ Object.assign(SpsVr, {
37551
37984
  propTypes,
37552
37985
  displayName: "SpsDescriptionListTerm / SpsDt"
37553
37986
  });
37554
- export { AsTypingErrorKeys, ContentOrderExample, DEFAULT_PRESETS, FauxChangeEvent, I18nContext, MANIFEST, OnBlurErrorKeys, OnSubmitErrorKeys, PortalContext, PreventativeErrorKeys, SimpleDateUtils, SpsAddRemoveFormRowExamples, SpsAdvancedSearch, SpsAdvancedSearchExamples, SpsAutocomplete, SpsAutocompleteExamples, SpsButton, SpsButtonExamples, SpsButtonGroup, SpsCard, SpsCardExamples, SpsCardTabbedPane, SpsCardV2, SpsCardV2Footer, SpsCardV2Header, SpsCardV2Title, SpsCheckbox, SpsCheckboxDropdown, SpsCheckboxExamples, SpsClickableTag, SpsClickableTagExamples, SpsColumnChooser, SpsColumnChooserColumn, SpsColumnChooserExamples, SpsConditionalField, SpsConditionalFieldExamples, SpsContentRow, SpsContentRowCol, SpsContentRowExamples, SpsContentRowExpansion, SpsCurrencyInput, SpsCurrencyInputExamples, SpsDateRangePicker, SpsDateRangePickerExamples, SpsDateTime, SpsDatepicker, SpsDatepickerExamples, SpsDatetimeExamples, SpsDd, SpsDescriptionList, SpsDescriptionListDefinition, SpsDescriptionListExamples, SpsDescriptionListTerm, SpsDl, SpsDropdown, SpsDropdownExamples, SpsDt, SpsFeedbackBlock, SpsFeedbackBlockExamples, SpsFieldset, SpsFieldsetExamples, SpsFilterPanel, SpsFilterPanelCap, SpsFilterPanelExamples, SpsFilterPanelFilterBox, SpsFilterPanelSection, SpsFilterTile, SpsFilterTileList, SpsFilterTileListExamples, SpsFocusedTask, SpsFocusedTaskActions, SpsFocusedTaskExamples, SpsForm, SpsFormArrayMeta, SpsFormComponentWrapper, SpsFormExamples, SpsFormFieldMeta, SpsFormGroupMeta, SpsFormMetaBase, SpsFormSetMeta, SpsGrowler, SpsGrowlerExamples, SpsI, SpsIconButtonPanel, SpsIncrementor, SpsIncrementorExamples, SpsInputGroup, SpsInsightTile, SpsInsights, SpsKeyValueList, SpsKeyValueListExamples, SpsKeyValueListItem, SpsKeyValueTag, SpsKeyValueTagExamples, SpsLabel, SpsLabelExamples, SpsListActionBar, SpsListActionBarExamples, SpsListToolbar, SpsListToolbarExamples, SpsListToolbarSearch, SpsListToolbarSearchInfo, SpsListToolbarSortBy, SpsMicroBlock, SpsMicroBlockExamples, SpsMicroZeroState, SpsModal, SpsModalExamples, SpsModalFooter, SpsMultiSelect, SpsMultiSelectExamples, SpsPageSelector, SpsPageSubtitle, SpsPageTitle, SpsPageTitleExamples, SpsPagination, SpsPaginationExamples, SpsProductBar, SpsProductBarExamples, SpsProductBarTab, SpsProgressBar, SpsProgressBarExamples, SpsProgressRing, SpsRadioButton, SpsRadioButtonExamples, SpsScrollableContainer, SpsScrollableContainerExamples, SpsSearchResultsBar, SpsSearchResultsBarExamples, SpsSearchResultsBarV2, SpsSelect, SpsSelectExamples, SpsSideNav, SpsSideNavExamples, SpsSlackLink, SpsSlackLinkExamples, SpsSortingHeader, SpsSortingHeaderCell, SpsSortingHeaderExamples, SpsSpinner, SpsSpinnerExamples, SpsSplitButton, SpsSplitButtonExamples, SpsSteppedProgressBar, SpsSteppedProgressBarExamples, SpsSummaryListColumn, SpsSummaryListExamples, SpsSummaryListExpansion, SpsSummaryListRow, SpsTab, SpsTabPanel, SpsTable, SpsTableBody, SpsTableCell, SpsTableExamples, SpsTableHead, SpsTableHeader, SpsTableRow, SpsTabsV2, SpsTag, SpsTagExamples, SpsTaskQueue, SpsTaskQueueExamples, SpsTbody, SpsTd, SpsTextInput, SpsTextInputExamples, SpsTextarea, SpsTextareaExamples, SpsTh, SpsThead, SpsTile, SpsTileList, SpsTileListExamples, SpsToggle, SpsToggleExamples, SpsTooltip, SpsTooltipExamples, SpsTooltipTitle, SpsTr, SpsValidators, SpsVerticalRule, SpsVr, SpsWf, SpsWfDoc, SpsWfDs, SpsWfStep, SpsWizardExamples, SpsWizardSidebar, SpsWizardSubstep, SpsWorkflow, SpsWorkflowDocument, SpsWorkflowDocumentStatus, SpsWorkflowExamples, SpsWorkflowStep, SpsZeroState, SpsZeroStateExamples, TooltipVisibility, ValidationMode, addOnChangeErrorKey, addOnSubmitErrorKey, contentOf, date, dateConstraint, dateRange, findParentBranches, flipPosition, formArray, formControl, formGroup, getMember, getPosition, selectChildren, toggleTooltipState, useCheckDeprecatedProps, useCustomValidator, useDidUpdateEffect, useDocumentEventListener, useElementId, useForm, useGrowlers, useInputPopup, usePatchReducer, usePortal, useServerSideValidation, useSpsAction, useSpsForm, validate };
37987
+ export { AsTypingErrorKeys, ContentOrderExample, DEFAULT_PRESETS, FauxChangeEvent, I18nContext, MANIFEST, OnBlurErrorKeys, OnSubmitErrorKeys, PortalContext, PreventativeErrorKeys, Provide, SimpleDateUtils, SpsAddRemoveFormRowExamples, SpsAdvancedSearch, SpsAdvancedSearchExamples, SpsApp, SpsAutocomplete, SpsAutocompleteExamples, SpsButton, SpsButtonExamples, SpsButtonGroup, SpsCard, SpsCardExamples, SpsCardTabbedPane, SpsCardV2, SpsCardV2Footer, SpsCardV2Header, SpsCardV2Title, SpsCheckbox, SpsCheckboxDropdown, SpsCheckboxExamples, SpsClickableTag, SpsClickableTagExamples, SpsColumnChooser, SpsColumnChooserColumn, SpsColumnChooserExamples, SpsConditionalField, SpsConditionalFieldExamples, SpsContentRow, SpsContentRowCol, SpsContentRowExamples, SpsContentRowExpansion, SpsCurrencyInput, SpsCurrencyInputExamples, SpsDateRangePicker, SpsDateRangePickerExamples, SpsDateTime, SpsDatepicker, SpsDatepickerExamples, SpsDatetimeExamples, SpsDd, SpsDescriptionList, SpsDescriptionListDefinition, SpsDescriptionListExamples, SpsDescriptionListTerm, SpsDl, SpsDropdown, SpsDropdownExamples, SpsDt, SpsFeedbackBlock, SpsFeedbackBlockExamples, SpsFieldset, SpsFieldsetExamples, SpsFilterPanel, SpsFilterPanelCap, SpsFilterPanelExamples, SpsFilterPanelFilterBox, SpsFilterPanelSection, SpsFilterTile, SpsFilterTileList, SpsFilterTileListExamples, SpsFocusedTask, SpsFocusedTaskActions, SpsFocusedTaskExamples, SpsForm, SpsFormArrayMeta, SpsFormComponentWrapper, SpsFormExamples, SpsFormFieldMeta, SpsFormGroupMeta, SpsFormMetaBase, SpsFormSetMeta, SpsGrowler, SpsGrowlerExamples, SpsI, SpsIconButtonPanel, SpsIncrementor, SpsIncrementorExamples, SpsInputGroup, SpsInsightTile, SpsInsights, SpsKeyValueList, SpsKeyValueListExamples, SpsKeyValueListItem, SpsKeyValueTag, SpsKeyValueTagExamples, SpsLabel, SpsLabelExamples, SpsListActionBar, SpsListActionBarExamples, SpsListToolbar, SpsListToolbarExamples, SpsListToolbarSearch, SpsListToolbarSearchInfo, SpsListToolbarSortBy, SpsMicroBlock, SpsMicroBlockExamples, SpsMicroZeroState, SpsModal, SpsModalExamples, SpsModalFooter, SpsMultiSelect, SpsMultiSelectExamples, SpsPageSelector, SpsPageSubtitle, SpsPageTitle, SpsPageTitleExamples, SpsPagination, SpsPaginationExamples, SpsProductBar, SpsProductBarExamples, SpsProductBarTab, SpsProgressBar, SpsProgressBarExamples, SpsProgressRing, SpsRadioButton, SpsRadioButtonExamples, SpsScrollableContainer, SpsScrollableContainerExamples, SpsSearchResultsBar, SpsSearchResultsBarExamples, SpsSearchResultsBarV2, SpsSelect, SpsSelectExamples, SpsSideNav, SpsSideNavExamples, SpsSlackLink, SpsSlackLinkExamples, SpsSortingHeader, SpsSortingHeaderCell, SpsSortingHeaderExamples, SpsSpinner, SpsSpinnerExamples, SpsSplitButton, SpsSplitButtonExamples, SpsSteppedProgressBar, SpsSteppedProgressBarExamples, SpsSummaryListColumn, SpsSummaryListExamples, SpsSummaryListExpansion, SpsSummaryListRow, SpsTab, SpsTabPanel, SpsTable, SpsTableBody, SpsTableCell, SpsTableExamples, SpsTableHead, SpsTableHeader, SpsTableRow, SpsTabsV2, SpsTag, SpsTagExamples, SpsTaskQueue, SpsTaskQueueExamples, SpsTbody, SpsTd, SpsTextInput, SpsTextInputExamples, SpsTextarea, SpsTextareaExamples, SpsTh, SpsThead, SpsTile, SpsTileList, SpsTileListExamples, SpsToggle, SpsToggleExamples, SpsTooltip, SpsTooltipExamples, SpsTooltipTitle, SpsTr, SpsValidators, SpsVerticalRule, SpsVr, SpsWf, SpsWfDoc, SpsWfDs, SpsWfStep, SpsWizardExamples, SpsWizardSidebar, SpsWizardSubstep, SpsWorkflow, SpsWorkflowDocument, SpsWorkflowDocumentStatus, SpsWorkflowExamples, SpsWorkflowStep, SpsZeroState, SpsZeroStateExamples, TooltipVisibility, ValidationMode, addOnChangeErrorKey, addOnSubmitErrorKey, bindProps, contentOf, date, dateConstraint, dateRange, findParentBranches, flipPosition, formArray, formControl, formGroup, getMember, getPosition, selectChildren, toggleTooltipState, useCheckDeprecatedProps, useColumnResizer, useCustomValidator, useDidUpdateEffect, useDocumentEventListener, useElementId, useForm, useGrowlers, useInputPopup, usePatchReducer, usePortal, useServerSideValidation, useSpsAction, useSpsForm, validate };