@phillips/seldon 1.120.0 → 1.122.0

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.
@@ -27,6 +27,10 @@ export interface CarouselProps extends ComponentProps<'div'> {
27
27
  * Whether the carousel should disable dragging.
28
28
  */
29
29
  disableDrag?: boolean;
30
+ /**
31
+ * Whether to disable dragging to navigate between slides for different viewports.
32
+ */
33
+ disableNavigationDrag?: 'mobile' | 'desktop' | 'all' | null;
30
34
  /**
31
35
  * The threshold for slides to be considered in view. A value of 0.1 means that 10% of the slide must be in view for it to be considered in view.
32
36
  */
@@ -1,99 +1,115 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { createContext as I, forwardRef as D, useEffect as c, useCallback as n } from "react";
3
- import { getCommonProps as y } from "../../utils/index.js";
4
- import g from "../../node_modules/classnames/index.js";
5
- import k from "../../node_modules/embla-carousel-class-names/esm/embla-carousel-class-names.esm.js";
6
- import V from "../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js";
7
- import { WheelGesturesPlugin as b } from "../../node_modules/embla-carousel-wheel-gestures/dist/embla-carousel-wheel-gestures.esm.js";
8
- const A = I(null), R = D(
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { createContext as P, forwardRef as g, useEffect as n, useCallback as f } from "react";
3
+ import { getCommonProps as I } from "../../utils/index.js";
4
+ import y from "../../node_modules/classnames/index.js";
5
+ import V from "../../node_modules/embla-carousel-class-names/esm/embla-carousel-class-names.esm.js";
6
+ import A from "../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js";
7
+ import { WheelGesturesPlugin as R } from "../../node_modules/embla-carousel-wheel-gestures/dist/embla-carousel-wheel-gestures.esm.js";
8
+ const S = P(null), E = g(
9
9
  ({
10
- loop: f = !1,
11
- startIndex: m = 0,
12
- onSlideChange: s,
13
- className: u,
14
- children: p,
15
- columnGap: d,
16
- useWheelGestures: w = !1,
17
- disableDrag: l = !1,
18
- inViewThreshold: x = 0.99,
19
- ...a
20
- }, C) => {
21
- const { className: N, ...v } = y(a, "Carousel"), [P, e] = V(
10
+ loop: m = !1,
11
+ startIndex: u = 0,
12
+ onSlideChange: a,
13
+ className: p,
14
+ children: d,
15
+ columnGap: w,
16
+ useWheelGestures: x = !1,
17
+ disableDrag: o = !1,
18
+ disableNavigationDrag: h = null,
19
+ inViewThreshold: N = 0.99,
20
+ ...t
21
+ }, k) => {
22
+ const { className: v, ...C } = I(t, "Carousel");
23
+ let s = {};
24
+ switch (h) {
25
+ case "mobile":
26
+ s = { breakpoints: { "(max-width: 960px)": { watchDrag: !1 } } };
27
+ break;
28
+ case "desktop":
29
+ s = { breakpoints: { "(min-width: 961px)": { watchDrag: !1 } } };
30
+ break;
31
+ case "all":
32
+ s = { watchDrag: !1 };
33
+ break;
34
+ default:
35
+ s = {};
36
+ }
37
+ const [b, e] = A(
22
38
  {
23
- loop: f,
24
- startIndex: m,
25
- inViewThreshold: x,
26
- breakpoints: { "(min-width: 961px)": { watchDrag: !1 } }
39
+ loop: m,
40
+ startIndex: u,
41
+ inViewThreshold: N,
42
+ ...s
27
43
  },
28
44
  [
29
- ...w ? [
30
- b({
45
+ ...x ? [
46
+ R({
31
47
  forceWheelAxis: "x"
32
48
  })
33
49
  ] : [],
34
- k({
50
+ V({
35
51
  snapped: "carousel-item-in-view"
36
52
  })
37
53
  ]
38
54
  );
39
- c(() => {
40
- l ? e?.reInit({
55
+ n(() => {
56
+ o ? e?.reInit({
41
57
  watchDrag: () => !1
42
58
  }) : e?.reInit({
43
59
  watchDrag: () => !0
44
60
  });
45
- }, [l, e]);
46
- const h = n(
61
+ }, [o, e]);
62
+ const D = f(
47
63
  (r) => {
48
64
  r.key === "ArrowLeft" ? (r.preventDefault(), e?.scrollPrev()) : r.key === "ArrowRight" && (r.preventDefault(), e?.scrollNext());
49
65
  },
50
66
  [e]
51
- ), o = n(
67
+ ), l = f(
52
68
  (r) => {
53
69
  if (!r)
54
70
  return;
55
- const t = r.slidesInView()?.[0];
56
- t !== void 0 && s?.(t);
71
+ const i = r.slidesInView()?.[0];
72
+ i !== void 0 && a?.(i);
57
73
  },
58
- [s]
74
+ [a]
59
75
  );
60
- return c(() => {
76
+ return n(() => {
61
77
  if (e)
62
- return e.on("slidesInView", o), () => {
63
- e.off("slidesInView", o);
78
+ return e.on("slidesInView", l), () => {
79
+ e.off("slidesInView", l);
64
80
  };
65
- }, [e, o]), /* @__PURE__ */ i(
66
- A.Provider,
81
+ }, [e, l]), /* @__PURE__ */ c(
82
+ S.Provider,
67
83
  {
68
84
  value: {
69
- carouselRef: P,
85
+ carouselRef: b,
70
86
  api: e,
71
87
  scrollPrev: () => e?.scrollPrev(),
72
88
  scrollNext: () => e?.scrollNext(),
73
89
  canScrollPrev: e?.canScrollPrev() ?? !1,
74
90
  canScrollNext: e?.canScrollNext() ?? !1,
75
- columnGap: d,
76
- onSlideChange: s
91
+ columnGap: w,
92
+ onSlideChange: a
77
93
  },
78
- children: /* @__PURE__ */ i(
94
+ children: /* @__PURE__ */ c(
79
95
  "div",
80
96
  {
81
- ref: C,
82
- onKeyDownCapture: h,
83
- className: g(N, u),
97
+ ref: k,
98
+ onKeyDownCapture: D,
99
+ className: y(v, p),
84
100
  role: "region",
85
101
  "aria-roledescription": "carousel",
86
- ...a,
87
- ...v,
88
- children: p
102
+ ...t,
103
+ ...C,
104
+ children: d
89
105
  }
90
106
  )
91
107
  }
92
108
  );
93
109
  }
94
110
  );
95
- R.displayName = "Carousel";
111
+ E.displayName = "Carousel";
96
112
  export {
97
- A as CarouselContext,
98
- R as default
113
+ S as CarouselContext,
114
+ E as default
99
115
  };
@@ -12,7 +12,9 @@ export declare const Playground: {
12
12
  };
13
13
  export declare const CarouselWithArrows: {
14
14
  (props: CarouselProps): import("react/jsx-runtime").JSX.Element;
15
- args: {};
15
+ args: {
16
+ disableNavigationDrag: "desktop";
17
+ };
16
18
  argTypes: {};
17
19
  };
18
20
  export declare const CarouselWithDots: {
@@ -1,12 +1,12 @@
1
1
  import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
2
  import u from "../../node_modules/classnames/index.js";
3
- import { forwardRef as p, useCallback as a } from "react";
4
- import { getCommonProps as C } from "../../utils/index.js";
5
- import { useCarousel as d } from "./utils.js";
3
+ import { forwardRef as d, useCallback as a } from "react";
4
+ import { getCommonProps as p } from "../../utils/index.js";
5
+ import { useCarousel as C } from "./utils.js";
6
6
  import f from "../../assets/CarouselArrowNext.svg.js";
7
7
  import v from "../../assets/CarouselArrowPrev.svg.js";
8
- const N = p(({ className: t, ...s }, l) => {
9
- const { className: e, ...n } = C(s, "CarouselArrows"), { api: r } = d(), i = a(() => {
8
+ const w = d(({ className: t, ...s }, n) => {
9
+ const { className: e, ...l } = p(s, "CarouselArrows"), { api: r } = C(), i = a(() => {
10
10
  r && r.scrollPrev(!0);
11
11
  }, [r]), c = a(() => {
12
12
  r && r.scrollNext(!0);
@@ -14,19 +14,19 @@ const N = p(({ className: t, ...s }, l) => {
14
14
  return /* @__PURE__ */ m(
15
15
  "div",
16
16
  {
17
- ref: l,
17
+ ref: n,
18
18
  "aria-roledescription": "carousel-arrow-navigation",
19
19
  className: u(`${e}`, t),
20
20
  ...s,
21
- ...n,
21
+ ...l,
22
22
  children: [
23
- /* @__PURE__ */ o("button", { className: `${e}-prev-btn`, onClick: () => i(), children: /* @__PURE__ */ o("div", { className: `${e}-prev-btn__icon`, children: /* @__PURE__ */ o(v, {}) }) }),
24
- /* @__PURE__ */ o("button", { className: `${e}-next-btn`, onClick: () => c(), children: /* @__PURE__ */ o("div", { className: `${e}-next-btn__icon`, children: /* @__PURE__ */ o(f, {}) }) })
23
+ /* @__PURE__ */ o("button", { "data-testid": "prev-arrow", className: `${e}-prev-btn`, onClick: () => i(), children: /* @__PURE__ */ o("div", { className: `${e}-prev-btn__icon`, children: /* @__PURE__ */ o(v, {}) }) }),
24
+ /* @__PURE__ */ o("button", { "data-testid": "next-arrow", className: `${e}-next-btn`, onClick: () => c(), children: /* @__PURE__ */ o("div", { className: `${e}-next-btn__icon`, children: /* @__PURE__ */ o(f, {}) }) })
25
25
  ]
26
26
  }
27
27
  );
28
28
  });
29
- N.displayName = "CarouselArrows";
29
+ w.displayName = "CarouselArrows";
30
30
  export {
31
- N as default
31
+ w as default
32
32
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -20,6 +20,10 @@ export interface ObjectTileProps extends ComponentProps<'a'> {
20
20
  * Estimate on request text to use when estimate is not available.
21
21
  */
22
22
  estimateOnRequestText?: string;
23
+ /**
24
+ * Element used for badge object
25
+ */
26
+ badgeElement?: React.ElementType;
23
27
  /**
24
28
  * Element used for favoriting object
25
29
  */
@@ -1,105 +1,107 @@
1
- import { jsxs as s, jsx as a, Fragment as E } from "react/jsx-runtime";
2
- import { memo as O, forwardRef as z } from "react";
3
- import B from "../../node_modules/classnames/index.js";
4
- import { getCommonProps as F } from "../../utils/index.js";
1
+ import { jsxs as s, jsx as a, Fragment as O } from "react/jsx-runtime";
2
+ import { memo as z, forwardRef as F } from "react";
3
+ import I from "../../node_modules/classnames/index.js";
4
+ import { getCommonProps as L } from "../../utils/index.js";
5
5
  import { TextVariants as l } from "../../components/Text/types.js";
6
6
  import i from "../../components/Text/Text.js";
7
- import I from "../DetailList/DetailList.js";
8
- import L from "../../components/Detail/Detail.js";
9
- import R from "../../components/SeldonImage/SeldonImage.js";
10
- const V = O(
11
- z(
7
+ import R from "../DetailList/DetailList.js";
8
+ import V from "../../components/Detail/Detail.js";
9
+ import W from "../../components/SeldonImage/SeldonImage.js";
10
+ const w = z(
11
+ F(
12
12
  ({
13
- badgeText: p,
14
- className: f,
15
- children: $,
16
- element: N,
13
+ badgeText: f,
14
+ className: $,
15
+ children: N,
16
+ element: g,
17
17
  estimate: n,
18
- estimateLabelText: g = "Estimate",
18
+ estimateLabelText: b = "Estimate",
19
19
  estimateOnRequestText: m,
20
- favoriteElement: r,
20
+ badgeElement: r,
21
+ favoriteElement: o,
21
22
  imageAlt: u = "Brought to you by Phillips",
22
- imageUrl: b = "",
23
- imageSrcSet: v,
24
- imageSizes: j,
25
- imageLoading: k,
26
- imageFetchPriority: y,
27
- lotNumber: P,
28
- makerText: o,
29
- modelText: c,
30
- referenceNumber: _,
31
- titleText: d,
23
+ imageUrl: v = "",
24
+ imageSrcSet: j,
25
+ imageSizes: k,
26
+ imageLoading: y,
27
+ imageFetchPriority: P,
28
+ lotNumber: S,
29
+ makerText: c,
30
+ modelText: _,
31
+ referenceNumber: d,
32
+ titleText: h,
32
33
  withdrawnText: t,
33
- ...h
34
- }, S) => {
35
- const { className: e, ...C } = F(h, "ObjectTile"), x = N ?? "a", D = n || m;
36
- return /* @__PURE__ */ s(x, { ...C, className: B(e, f), ...h, ref: S, children: [
34
+ ...p
35
+ }, C) => {
36
+ const { className: e, ...x } = L(p, "ObjectTile"), D = g ?? "a", E = n || m;
37
+ return /* @__PURE__ */ s(D, { ...x, className: I(e, $), ...p, ref: C, children: [
37
38
  /* @__PURE__ */ a(
38
- R,
39
+ W,
39
40
  {
40
41
  alt: u,
41
42
  aspectRatio: "1/1",
42
43
  className: `${e}__img`,
43
44
  objectFit: "contain",
44
- src: b,
45
- srcSet: v,
46
- sizes: j,
47
- loading: k,
48
- fetchPriority: y
45
+ src: v,
46
+ srcSet: j,
47
+ sizes: k,
48
+ loading: y,
49
+ fetchPriority: P
49
50
  }
50
51
  ),
51
- t ? null : /* @__PURE__ */ a(i, { className: `${e}__badge`, variant: l.badge, children: p }),
52
+ t ? null : /* @__PURE__ */ a(i, { className: `${e}__badge`, variant: l.badge, children: f }),
52
53
  /* @__PURE__ */ s("div", { className: `${e}__lot-number-like`, children: [
53
- /* @__PURE__ */ a(i, { className: `${e}__lot-number`, variant: l.heading3, element: "p", children: P }),
54
- r && /* @__PURE__ */ a(r, {})
54
+ /* @__PURE__ */ a(i, { className: `${e}__lot-number`, variant: l.heading3, element: "p", children: S }),
55
+ r && /* @__PURE__ */ a("div", { className: `${e}__lot-badge`, children: /* @__PURE__ */ a(r, {}) }),
56
+ o && /* @__PURE__ */ a(o, {})
55
57
  ] }),
56
- t ? /* @__PURE__ */ a(i, { className: `${e}__withdrawn`, variant: l.heading4, children: t }) : /* @__PURE__ */ s(E, { children: [
58
+ t ? /* @__PURE__ */ a(i, { className: `${e}__withdrawn`, variant: l.heading4, children: t }) : /* @__PURE__ */ s(O, { children: [
57
59
  /* @__PURE__ */ s("div", { className: `${e}__meta`, children: [
58
- o ? /* @__PURE__ */ a(i, { className: `${e}__maker`, variant: l.heading3, children: o }) : null,
59
- d ? /* @__PURE__ */ a(
60
+ c ? /* @__PURE__ */ a(i, { className: `${e}__maker`, variant: l.heading3, children: c }) : null,
61
+ h ? /* @__PURE__ */ a(
60
62
  i,
61
63
  {
62
64
  className: `${e}__title ${e}__token-fix`,
63
65
  variant: l.heading4,
64
66
  element: "cite",
65
- children: d
67
+ children: h
66
68
  }
67
69
  ) : null,
68
- _ ? /* @__PURE__ */ a(
70
+ d ? /* @__PURE__ */ a(
69
71
  i,
70
72
  {
71
73
  className: `${e}__reference-number ${e}__token-fix`,
72
74
  variant: l.heading4,
73
75
  element: "p",
74
- children: _
76
+ children: d
75
77
  }
76
78
  ) : null,
77
- c ? /* @__PURE__ */ a(
79
+ _ ? /* @__PURE__ */ a(
78
80
  i,
79
81
  {
80
82
  className: `${e}__model ${e}__token-fix`,
81
83
  variant: l.heading4,
82
84
  element: "p",
83
- children: c
85
+ children: _
84
86
  }
85
87
  ) : null
86
88
  ] }),
87
- D ? /* @__PURE__ */ a(I, { hasSeparators: !0, className: `${e}__estimate ${e}__section`, children: /* @__PURE__ */ a(
88
- L,
89
+ E ? /* @__PURE__ */ a(R, { hasSeparators: !0, className: `${e}__estimate ${e}__section`, children: /* @__PURE__ */ a(
90
+ V,
89
91
  {
90
92
  className: `${e}__estimate__label`,
91
- label: g,
93
+ label: b,
92
94
  value: n || m,
93
95
  hasWrap: !1
94
96
  }
95
97
  ) }) : null,
96
- /* @__PURE__ */ a("div", { className: `${e}__section`, children: $ })
98
+ /* @__PURE__ */ a("div", { className: `${e}__section`, children: N })
97
99
  ] })
98
100
  ] });
99
101
  }
100
102
  )
101
103
  );
102
- V.displayName = "ObjectTile";
104
+ w.displayName = "ObjectTile";
103
105
  export {
104
- V as default
106
+ w as default
105
107
  };
@@ -9,6 +9,7 @@ export declare const NoImage: {
9
9
  (props: ComponentProps<typeof ObjectTile>): import("react/jsx-runtime").JSX.Element;
10
10
  args: {
11
11
  badgeText: string;
12
+ badgeElement: () => import("react/jsx-runtime").JSX.Element;
12
13
  favoriteElement: () => import("react/jsx-runtime").JSX.Element;
13
14
  estimate: string;
14
15
  element: string;
@@ -26,6 +27,7 @@ export declare const Playground: {
26
27
  (props: ComponentProps<typeof ObjectTile>): import("react/jsx-runtime").JSX.Element;
27
28
  args: {
28
29
  badgeText: string;
30
+ badgeElement: () => import("react/jsx-runtime").JSX.Element;
29
31
  favoriteElement: () => import("react/jsx-runtime").JSX.Element;
30
32
  estimate: string;
31
33
  element: string;
@@ -1,7 +1,6 @@
1
1
  @use '../../allPartials' as *;
2
2
 
3
3
  .#{$px}-bid-snapshot {
4
- padding-bottom: $spacing-sm;
5
4
  position: relative;
6
5
 
7
6
  &__text .#{$px}-has-separators .#{$px}-detail {
@@ -30,6 +29,13 @@
30
29
  &--has-bids .#{$px}-detail__value {
31
30
  font-variation-settings: 'wght' 600;
32
31
  }
32
+
33
+ // styles that will apply to bid message inside bid snapshot only
34
+ .#{$px}-bid-message {
35
+ &.#{$px}-bid-message {
36
+ margin-bottom: $spacing-sm;
37
+ }
38
+ }
33
39
  }
34
40
 
35
41
  .#{$px}-bid-message {
@@ -30,15 +30,31 @@
30
30
  &__lot-number-like {
31
31
  position: relative;
32
32
 
33
- & > :not(.#{$px}-object-tile__lot-number) {
33
+ & > :not(.#{$px}-object-tile__lot-number):not(.#{$px}-object-tile__lot-badge) {
34
34
  position: absolute;
35
35
  right: 0;
36
36
  top: 50%;
37
37
  transform: translateY(-50%);
38
38
  }
39
+
40
+ .#{$px}-object-tile__lot-badge {
41
+ display: inline-block;
42
+ left: 4%;
43
+ position: absolute;
44
+
45
+ svg {
46
+ height: 100%;
47
+ width: 100%;
48
+
49
+ path {
50
+ fill: $pure-black;
51
+ }
52
+ }
53
+ }
39
54
  }
40
55
 
41
56
  & .#{$px}-object-tile__lot-number {
57
+ display: inline-block;
42
58
  margin-bottom: $spacing-xsm;
43
59
  }
44
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.120.0",
3
+ "version": "1.122.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"