@phillips/seldon 1.77.1 → 1.77.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,78 +1,82 @@
1
- import { jsxs as O, jsx as n } from "react/jsx-runtime";
2
- import u from "../../node_modules/classnames/index.js";
3
- import { getCommonProps as P, px as i } from "../../utils/index.js";
4
- import S from "../Select/Select.js";
1
+ import { jsxs as O, jsx as i } from "react/jsx-runtime";
2
+ import p from "../../node_modules/classnames/index.js";
3
+ import { getCommonProps as w, px as r } from "../../utils/index.js";
4
+ import V from "../Select/Select.js";
5
5
  import f from "../../assets/chevronRight.svg.js";
6
- import g from "../IconButton/IconButton.js";
6
+ import h from "../IconButton/IconButton.js";
7
7
  import { ButtonVariants as x } from "../Button/types.js";
8
- import { determineOptionValue as r, findOptionFromSelectString as v } from "./utils.js";
9
- const R = ({
8
+ import { determineOptionValue as o, findOptionFromSelectString as j } from "./utils.js";
9
+ import { usePendingState as k } from "../../utils/hooks.js";
10
+ const E = ({
10
11
  className: b,
11
- onChange: o,
12
+ onChange: P,
12
13
  variant: $ = "inline",
13
- options: e = [],
14
- value: l,
15
- isDisabled: c,
16
- previousLabel: h = "Previous",
17
- nextLabel: N = "Next",
18
- selectLabel: _ = "Select",
19
- ...m
14
+ options: n = [],
15
+ value: g,
16
+ isDisabled: l,
17
+ previousLabel: S = "Previous",
18
+ nextLabel: v = "Next",
19
+ selectLabel: C = "Select",
20
+ ...s
20
21
  }) => {
21
- const y = "pagination", { className: p, ...I } = P(m, "Pagination"), { id: s } = m;
22
+ const N = "pagination", { className: u, ..._ } = w(s, "Pagination"), { id: c } = s, { pendingState: y, setPendingState: I } = k(o(g)), m = y || g, d = (t, e) => {
23
+ const a = o(t);
24
+ I(a), P(a, e);
25
+ };
22
26
  return /* @__PURE__ */ O(
23
27
  "div",
24
28
  {
25
- className: u(`${i}-${y}`, { [`${p}__wrapper`]: p }, b),
26
- ...I,
27
- ...m,
29
+ className: p(`${r}-${N}`, { [`${u}__wrapper`]: u }, b),
30
+ ..._,
31
+ ...s,
28
32
  children: [
29
- /* @__PURE__ */ n(
30
- g,
33
+ /* @__PURE__ */ i(
34
+ h,
31
35
  {
32
- className: u(`${i}__pagination-button`, `${i}-left-arrow`),
36
+ className: p(`${r}__pagination-button`, `${r}-left-arrow`),
33
37
  onClick: () => {
34
- const t = e.findIndex((d) => r(d) === l) - 1, a = e.at(t) || "";
35
- o(r(a));
38
+ const t = n.findIndex((a) => o(a) === m) - 1, e = n.at(t) || "";
39
+ d(e);
36
40
  },
37
- "data-testid": `${s}-previous-button`,
38
- isDisabled: c,
39
- "aria-label": h,
41
+ "data-testid": `${c}-previous-button`,
42
+ isDisabled: l,
43
+ "aria-label": S,
40
44
  variant: x.tertiary,
41
- children: /* @__PURE__ */ n(f, {})
45
+ children: /* @__PURE__ */ i(f, {})
42
46
  }
43
47
  ),
44
- /* @__PURE__ */ n(
45
- S,
48
+ /* @__PURE__ */ i(
49
+ V,
46
50
  {
47
- className: $ === "inline" && `${i}--inline-pagination`,
48
- "aria-label": _,
49
- value: l,
51
+ className: $ === "inline" && `${r}--inline-pagination`,
52
+ "aria-label": C,
53
+ value: m,
50
54
  onChange: (t) => {
51
- const a = v(e, t == null ? void 0 : t.currentTarget.value);
52
- a && o(r(a), t);
55
+ const e = j(n, t == null ? void 0 : t.currentTarget.value);
56
+ e && d(e, t);
53
57
  },
54
- "data-testid": `${s}-select-button`,
58
+ "data-testid": `${c}-select-button`,
55
59
  hideLabel: !0,
56
- disabled: c,
57
- children: e.map((t) => {
58
- const a = r(t);
59
- return /* @__PURE__ */ n("option", { value: a, children: typeof t == "string" || typeof t == "number" ? t : t.label }, a);
60
+ disabled: l,
61
+ children: n.map((t) => {
62
+ const e = o(t);
63
+ return /* @__PURE__ */ i("option", { value: e, children: typeof t == "string" || typeof t == "number" ? t : t.label }, e);
60
64
  })
61
65
  }
62
66
  ),
63
- /* @__PURE__ */ n(
64
- g,
67
+ /* @__PURE__ */ i(
68
+ h,
65
69
  {
66
- className: `${i}__pagination-button`,
70
+ className: `${r}__pagination-button`,
67
71
  onClick: () => {
68
- const t = (e.findIndex((d) => r(d) === l) + 1) % e.length, a = e[t];
69
- o(r(a));
72
+ const t = (n.findIndex((a) => o(a) === m) + 1) % n.length, e = n[t];
73
+ d(e);
70
74
  },
71
- "data-testid": `${s}-next-button`,
72
- isDisabled: c,
73
- "aria-label": N,
75
+ "data-testid": `${c}-next-button`,
76
+ isDisabled: l,
77
+ "aria-label": v,
74
78
  variant: x.tertiary,
75
- children: /* @__PURE__ */ n(f, {})
79
+ children: /* @__PURE__ */ i(f, {})
76
80
  }
77
81
  )
78
82
  ]
@@ -80,5 +84,5 @@ const R = ({
80
84
  );
81
85
  };
82
86
  export {
83
- R as default
87
+ E as default
84
88
  };
package/dist/index.d.ts CHANGED
@@ -52,3 +52,4 @@ export * from './components/PinchZoom';
52
52
  export * from './components/Tabs';
53
53
  export * from './components/SeldonImage';
54
54
  export * from './patterns/SaleHeaderBanner';
55
+ export * from './utils/hooks';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { PaddingTokens as f, SpacingTokens as l, defaultYear as s, emailValidation as m, encodeURLSearchParams as p, findChildrenExcludingTypes as d, findChildrenOfType as u, generatePaddingClassName as n, getCommonProps as x, noOp as i, px as g, useNormalizedInputProps as c } from "./utils/index.js";
1
+ import { PaddingTokens as f, SpacingTokens as l, defaultYear as s, emailValidation as m, encodeURLSearchParams as p, findChildrenExcludingTypes as d, findChildrenOfType as n, generatePaddingClassName as u, getCommonProps as x, noOp as i, px as g, useNormalizedInputProps as c } from "./utils/index.js";
2
2
  import { default as C } from "./pages/Page.js";
3
3
  import { default as P } from "./components/Button/Button.js";
4
4
  import { ButtonVariants as b } from "./components/Button/types.js";
@@ -23,7 +23,7 @@ import { GridItemAlign as ae } from "./components/GridItem/types.js";
23
23
  import { default as le } from "./components/Search/Search.js";
24
24
  import { default as me } from "./components/Select/Select.js";
25
25
  import { default as de } from "./components/SplitPanel/SplitPanel.js";
26
- import { default as ne } from "./patterns/Subscribe/Subscribe.js";
26
+ import { default as ue } from "./patterns/Subscribe/Subscribe.js";
27
27
  import { SubscriptionState as ie } from "./patterns/Subscribe/types.js";
28
28
  import { default as ce } from "./patterns/Social/Social.js";
29
29
  import { default as Ce } from "./patterns/ViewingsList/ViewingsList.js";
@@ -52,7 +52,7 @@ import { default as ro } from "./components/ContentPeek/ContentPeek.js";
52
52
  import { default as fo } from "./components/Collapsible/Collapsible.js";
53
53
  import { default as so } from "./components/Collapsible/CollapsibleContent.js";
54
54
  import { default as po } from "./components/Collapsible/CollapsibleTrigger.js";
55
- import { SeldonProvider as no } from "./providers/SeldonProvider/SeldonProvider.js";
55
+ import { SeldonProvider as uo } from "./providers/SeldonProvider/SeldonProvider.js";
56
56
  import { default as io } from "./components/PageContentWrapper/PageContentWrapper.js";
57
57
  import { default as co } from "./components/Carousel/Carousel.js";
58
58
  import { default as Co } from "./components/Carousel/CarouselContent.js";
@@ -69,6 +69,7 @@ import { default as Oo } from "./patterns/SaleHeaderBanner/SaleHeaderBanner.js";
69
69
  import { default as Uo } from "./patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js";
70
70
  import { default as Fo } from "./patterns/SaleHeaderBanner/SaleHeaderCountdown.js";
71
71
  import { AuctionState as Yo } from "./patterns/SaleHeaderBanner/types.js";
72
+ import { usePendingState as jo } from "./utils/hooks.js";
72
73
  export {
73
74
  Ee as Accordion,
74
75
  Oe as AccordionItem,
@@ -122,13 +123,13 @@ export {
122
123
  Fo as SaleHeaderCountdown,
123
124
  le as Search,
124
125
  Eo as SeldonImage,
125
- no as SeldonProvider,
126
+ uo as SeldonProvider,
126
127
  me as Select,
127
128
  ce as Social,
128
129
  l as SpacingTokens,
129
130
  de as SplitPanel,
130
131
  Be as StatefulViewingsList,
131
- ne as Subscribe,
132
+ ue as Subscribe,
132
133
  ie as SubscriptionState,
133
134
  qe as SupportedLanguages,
134
135
  vo as TabsContainer,
@@ -144,10 +145,11 @@ export {
144
145
  m as emailValidation,
145
146
  p as encodeURLSearchParams,
146
147
  d as findChildrenExcludingTypes,
147
- u as findChildrenOfType,
148
- n as generatePaddingClassName,
148
+ n as findChildrenOfType,
149
+ u as generatePaddingClassName,
149
150
  x as getCommonProps,
150
151
  i as noOp,
151
152
  g as px,
152
- c as useNormalizedInputProps
153
+ c as useNormalizedInputProps,
154
+ jo as usePendingState
153
155
  };
@@ -1,4 +1,4 @@
1
- import { __module as t } from "../../_virtual/index6.js";
1
+ import { __module as t } from "../../_virtual/index5.js";
2
2
  /*!
3
3
  Copyright (c) 2015 Jed Watson.
4
4
  Based on code that is Copyright 2013-2015, Facebook, Inc.
@@ -1,4 +1,4 @@
1
- import { __module as e } from "../../../../_virtual/index5.js";
1
+ import { __module as e } from "../../../../_virtual/index6.js";
2
2
  import { __require as o } from "./cjs/react-is.production.min.js";
3
3
  import { __require as t } from "./cjs/react-is.development.js";
4
4
  var r;
@@ -61,11 +61,15 @@ $lg: #{$px}-input--lg;
61
61
  // Disabled
62
62
  &--disabled {
63
63
  color: $keyline-gray;
64
+ cursor: default;
64
65
 
65
66
  .#{$px}-input__label,
66
67
  .#{$px}-input__input {
67
68
  color: inherit;
68
- cursor: not-allowed;
69
+ }
70
+ .#{$px}-input__label:hover,
71
+ .#{$px}-input__input:hover {
72
+ cursor: default;
69
73
  }
70
74
  }
71
75
 
@@ -8,11 +8,16 @@
8
8
  }
9
9
 
10
10
  .#{$px} {
11
- &-icon-button.#{$px}__pagination-button {
12
- @include media($breakpoint-md) {
13
- > svg {
14
- height: 1.75rem;
15
- width: 1.75rem;
11
+ &-icon-button {
12
+ &:disabled {
13
+ border: unset;
14
+ }
15
+ &.#{$px}__pagination-button {
16
+ @include media($breakpoint-md) {
17
+ > svg {
18
+ height: 1.75rem;
19
+ width: 1.75rem;
20
+ }
16
21
  }
17
22
  }
18
23
  }
@@ -0,0 +1,4 @@
1
+ export declare const usePendingState: <StateType>(value: StateType) => {
2
+ pendingState: StateType | null;
3
+ setPendingState: import("react").Dispatch<import("react").SetStateAction<StateType | null>>;
4
+ };
@@ -0,0 +1,10 @@
1
+ import { useState as s, useEffect as i } from "react";
2
+ const r = (t) => {
3
+ const [n, e] = s(null);
4
+ return i(() => {
5
+ t && e(null);
6
+ }, [t]), { pendingState: n, setPendingState: e };
7
+ };
8
+ export {
9
+ r as usePendingState
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.77.1",
3
+ "version": "1.77.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"