@phillips/seldon 1.250.0 → 1.252.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.
@@ -1,4 +1,4 @@
1
- import { jsxs as g, Fragment as S, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as u, Fragment as S, jsx as o } from "react/jsx-runtime";
2
2
  import { Root as f, Trigger as v, Portal as j, Content as P } from "../../node_modules/@radix-ui/react-popover/dist/index.js";
3
3
  import _ from "react";
4
4
  import q from "../../components/Drawer/Drawer.js";
@@ -12,39 +12,39 @@ import { countActiveFilters as k, getFilterButtonClickHandler as l, getFilterBut
12
12
  const A = _.forwardRef(
13
13
  ({
14
14
  filterId: e = 0,
15
- className: h,
15
+ className: g,
16
16
  filterButtonLabel: r,
17
- buttonType: i,
17
+ buttonType: n,
18
18
  handleClick: m,
19
19
  filtersListState: a,
20
- filters: t,
21
- onSelectFilter: w,
22
- onApplyFilter: F,
23
- onClickClear: $,
20
+ filters: p,
21
+ onSelectFilter: h,
22
+ onApplyFilter: w,
23
+ onClickClear: F,
24
24
  resultsCount: b,
25
- filterButtonLabelTranslated: p,
25
+ filterButtonLabelTranslated: t,
26
26
  dropdownMenuTranslation: x,
27
- ariaLabels: n = {},
27
+ ariaLabels: i = {},
28
28
  hideDesktopSortButton: R,
29
29
  id: c
30
30
  }, M) => {
31
- const d = a?.[e] ?? !1, { totalCount: D, filterCount: s } = k(t, i), u = z(r, s, p || null);
32
- return R && i === Q.Sort ? null : /* @__PURE__ */ g(S, { children: [
33
- /* @__PURE__ */ g(O.Media, { lessThan: "md", children: [
31
+ const d = a?.[e] ?? !1, { totalCount: $, filterCount: D } = k(p, n), s = z(r, t || null);
32
+ return R && n === Q.Sort ? null : /* @__PURE__ */ u(S, { children: [
33
+ /* @__PURE__ */ u(O.Media, { lessThan: "md", children: [
34
34
  /* @__PURE__ */ o(
35
35
  C,
36
36
  {
37
37
  ref: M,
38
- className: h,
38
+ className: g,
39
39
  isSelected: d,
40
- count: s,
41
- label: u,
40
+ count: D,
41
+ label: s,
42
42
  id: c,
43
- totalCount: D,
44
- ariaLabel: n.button || `${r} button`,
43
+ totalCount: $,
44
+ ariaLabel: i.button || `${r} button`,
45
45
  onClick: l(a, m, e),
46
46
  isMobile: !0,
47
- type: i
47
+ type: n
48
48
  }
49
49
  ),
50
50
  /* @__PURE__ */ o(
@@ -53,30 +53,30 @@ const A = _.forwardRef(
53
53
  drawerOpenSide: "bottom",
54
54
  isOpen: d,
55
55
  onClose: l(a, m, e),
56
- "aria-label": n.drawer || `${r} drawer`,
56
+ "aria-label": i.drawer || `${r} drawer`,
57
57
  className: `${E}-filter-drawer-mobile`,
58
- headerText: `${u} Filter`,
58
+ headerText: s,
59
59
  paddingLevel: 0,
60
60
  children: /* @__PURE__ */ o(
61
61
  N,
62
62
  {
63
- buttonType: i,
64
- filters: t,
63
+ buttonType: n,
64
+ filters: p,
65
65
  filterIndex: e,
66
- onSelectFilter: w,
67
- onApplyFilter: F,
68
- onClickClear: $,
66
+ onSelectFilter: h,
67
+ onApplyFilter: w,
68
+ onClickClear: F,
69
69
  resultsCount: b,
70
- ariaLabels: n?.ariaLabel,
70
+ ariaLabels: i?.ariaLabel,
71
71
  filterButtonLabel: r,
72
- filterButtonLabelTranslated: p,
72
+ filterButtonLabelTranslated: t,
73
73
  dropdownMenuTranslation: x
74
74
  }
75
75
  )
76
76
  }
77
77
  )
78
78
  ] }),
79
- /* @__PURE__ */ o(O.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ g(
79
+ /* @__PURE__ */ o(O.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ u(
80
80
  f,
81
81
  {
82
82
  open: d,
@@ -86,16 +86,16 @@ const A = _.forwardRef(
86
86
  C,
87
87
  {
88
88
  ref: M,
89
- className: h,
89
+ className: g,
90
90
  isSelected: d,
91
- count: s,
92
- label: u,
93
- totalCount: D,
91
+ count: D,
92
+ label: s,
93
+ totalCount: $,
94
94
  id: c,
95
- ariaLabel: n.ariaLabel || `${r} button`,
95
+ ariaLabel: i.ariaLabel || `${r} button`,
96
96
  onClick: l(a, m, e),
97
97
  isMobile: !1,
98
- type: i
98
+ type: n
99
99
  }
100
100
  ) }),
101
101
  /* @__PURE__ */ o(j, { children: /* @__PURE__ */ o(
@@ -106,20 +106,20 @@ const A = _.forwardRef(
106
106
  sideOffset: 5,
107
107
  align: "start",
108
108
  alignOffset: 5,
109
- "aria-label": n.ariaLabel || `${r} dropdown`,
109
+ "aria-label": i.ariaLabel || `${r} dropdown`,
110
110
  children: /* @__PURE__ */ o(
111
111
  H,
112
112
  {
113
- buttonType: i,
114
- filters: t,
113
+ buttonType: n,
114
+ filters: p,
115
115
  filterIndex: e,
116
- onSelectFilter: w,
117
- onApplyFilter: F,
118
- onClickClear: $,
116
+ onSelectFilter: h,
117
+ onApplyFilter: w,
118
+ onClickClear: F,
119
119
  resultsCount: b,
120
- ariaLabels: n?.ariaLabel,
120
+ ariaLabels: i?.ariaLabel,
121
121
  filterButtonLabel: r,
122
- filterButtonLabelTranslated: p,
122
+ filterButtonLabelTranslated: t,
123
123
  dropdownMenuTranslation: x
124
124
  }
125
125
  )
@@ -58,4 +58,4 @@ export declare function handleInputChange(e: React.ChangeEvent<HTMLInputElement
58
58
  * Utility to reset all filter states to false and call the handler.
59
59
  */
60
60
  export declare function resetAllFilters(filtersListState: boolean[] | undefined, handleClick: ((state: boolean[]) => void) | undefined): void;
61
- export declare function getFilterButtonLabel(filterButtonLabel: string, filterCount: number | null, filterButtonLabelTranslated: string | null): string;
61
+ export declare function getFilterButtonLabel(filterButtonLabel: string, filterButtonLabelTranslated: string | null): string;
@@ -1,33 +1,33 @@
1
- import { FilterButtonType as e } from "./types.js";
2
- e.Filter, e.Sort, e.Sale, e.Departments, e.Location, e.Month, e.Year;
3
- const f = (t, r) => {
1
+ import { FilterButtonType as o } from "./types.js";
2
+ o.Filter, o.Sort, o.Sale, o.Departments, o.Location, o.Month, o.Year;
3
+ const c = (t, r) => {
4
4
  if (!t) return { totalCount: 0, filterCount: 0 };
5
- const n = t.filter((o) => o.id !== "Sort").reduce(
6
- (o, i) => o + Array.from(i.filterDimensions).filter((s) => s.active).length,
5
+ const e = t.filter((n) => n.id !== "Sort").reduce(
6
+ (n, i) => n + Array.from(i.filterDimensions).filter((f) => f.active).length,
7
7
  0
8
8
  ), u = r === "Sort" ? 0 : (() => {
9
- const o = t.find((i) => i.id === r)?.filterDimensions;
10
- return o ? Array.from(o).filter((i) => i.active).length : 0;
9
+ const n = t.find((i) => i.id === r)?.filterDimensions;
10
+ return n ? Array.from(n).filter((i) => i.active).length : 0;
11
11
  })();
12
- return { totalCount: n, filterCount: u };
13
- }, m = (t, r) => t && typeof r == "number" && t[r - 1] && t[r - 1].filterDimensions ? Array.from(t[r - 1].filterDimensions) : [], a = (t, r) => t === "Filter" ? "Filters" : r ? "ChevronUp" : "ChevronDown", l = (t, r, n) => () => {
14
- t && r && r(t.map((u, o) => o === n ? !u : !1));
12
+ return { totalCount: e, filterCount: u };
13
+ }, m = (t, r) => t && typeof r == "number" && t[r - 1] && t[r - 1].filterDimensions ? Array.from(t[r - 1].filterDimensions) : [], l = (t, r) => t === "Filter" ? "Filters" : r ? "ChevronUp" : "ChevronDown", a = (t, r, e) => () => {
14
+ t && r && r(t.map((u, n) => n === e ? !u : !1));
15
15
  };
16
- function p(t, r, n) {
17
- n && n(t, r);
16
+ function p(t, r, e) {
17
+ e && e(t, r);
18
18
  }
19
19
  function D(t, r) {
20
20
  t && r && r(t.map(() => !1));
21
21
  }
22
- function F(t, r, n) {
23
- return n || `${t}` + (r && r > 0 ? ` (${r})` : "");
22
+ function F(t, r) {
23
+ return r || `${t}`;
24
24
  }
25
25
  export {
26
- f as countActiveFilters,
27
- l as getFilterButtonClickHandler,
26
+ c as countActiveFilters,
27
+ a as getFilterButtonClickHandler,
28
28
  F as getFilterButtonLabel,
29
29
  m as getFilterDimensions,
30
- a as getIcon,
30
+ l as getIcon,
31
31
  p as handleInputChange,
32
32
  D as resetAllFilters
33
33
  };
@@ -1,10 +1,10 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { SaleCardActions } from './SaleCardActions';
3
- import { SaleCardVariants, SaleCardImageDisplay } from './types';
3
+ import { SaleCardImageDisplay, SaleCardVariants } from './types';
4
4
  /**
5
5
  * Props for the SaleCard component.
6
6
  */
7
- export interface SaleCardProps extends ComponentProps<'div'> {
7
+ export interface SaleCardProps extends ComponentProps<'article'> {
8
8
  /**
9
9
  * The source URL of the image to be displayed.
10
10
  * Leaving this prop undefined or falsy is the intended way to hide the image.
@@ -45,5 +45,5 @@ export interface SaleCardProps extends ComponentProps<'div'> {
45
45
  *
46
46
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/patterns-salecard--overview)
47
47
  */
48
- declare const SaleCard: import('react').ForwardRefExoticComponent<Omit<SaleCardProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
48
+ declare const SaleCard: import('react').ForwardRefExoticComponent<Omit<SaleCardProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
49
49
  export default SaleCard;
@@ -1,52 +1,51 @@
1
- import { jsxs as i, jsx as l } from "react/jsx-runtime";
2
- import u from "../../_virtual/index.js";
3
- import { forwardRef as L } from "react";
4
- import T from "../../components/Button/Button.js";
5
- import { ButtonVariants as A } from "../../components/Button/types.js";
6
- import I from "../../components/SeldonImage/SeldonImage.js";
7
- import { TextVariants as r } from "../../components/Text/types.js";
8
- import e from "../../components/Text/Text.js";
9
- import { SSRMediaQuery as k } from "../../providers/SeldonProvider/utils.js";
10
- import { getCommonProps as x } from "../../utils/index.js";
11
- import { SaleCardImageDisplay as P, SaleCardVariants as f } from "./types.js";
12
- const R = L(
1
+ import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
+ import L from "../../_virtual/index.js";
3
+ import { forwardRef as M } from "react";
4
+ import g from "../../components/Button/Button.js";
5
+ import a from "../../components/Card/Card.js";
6
+ import { CardVariants as A } from "../../components/Card/types.js";
7
+ import { ButtonVariants as R } from "../../components/Button/types.js";
8
+ import { SSRMediaQuery as T } from "../../providers/SeldonProvider/utils.js";
9
+ import { getCommonProps as k } from "../../utils/index.js";
10
+ import { SaleCardImageDisplay as w, SaleCardVariants as f } from "./types.js";
11
+ const y = M(
13
12
  ({
14
13
  className: p,
15
- imageSrc: s,
16
- imageAlt: S = "Auction Image",
17
- auctionType: h,
18
- titleText: N,
19
- date: $,
20
- location: v,
21
- badgeText: o,
22
- modalButtonOnClick: n,
14
+ imageSrc: l,
15
+ imageAlt: h = "Auction Image",
16
+ auctionType: C,
17
+ titleText: u,
18
+ date: E,
19
+ location: S,
20
+ badgeText: s,
21
+ modalButtonOnClick: i,
23
22
  modalButtonText: t,
24
- variant: m = f.DEFAULT,
25
- children: c,
26
- imageDisplay: d = P.LEFT,
27
- ..._
28
- }, g) => {
29
- const { className: a, ...C } = x(_, "SaleCard"), E = u(a, p, {
30
- [`${a}--${m}`]: m,
31
- [`${a}--image-${d}`]: d
32
- }), b = { ...C, ..._ };
33
- return /* @__PURE__ */ i("article", { ...b, className: E, ref: g, children: [
34
- s ? /* @__PURE__ */ l(I, { src: s, alt: S, className: `${a}__image` }) : null,
35
- /* @__PURE__ */ i("div", { className: `${a}__details`, children: [
36
- /* @__PURE__ */ l(e, { variant: r.labelSmall, children: h }),
37
- /* @__PURE__ */ l(e, { variant: r.headingSmall, className: `${a}__title`, children: N }),
38
- o && /* @__PURE__ */ l(e, { variant: r.badgeSmall, className: `${a}__badge`, children: o }),
39
- /* @__PURE__ */ i("div", { className: `${a}__info`, children: [
40
- /* @__PURE__ */ l(e, { variant: r.labelSmall, children: v }),
41
- /* @__PURE__ */ l(e, { variant: r.labelSmall, children: $ }),
42
- t && n && /* @__PURE__ */ l("div", { className: `${a}__modal-link`, children: /* @__PURE__ */ l(T, { onClick: n, variant: A.link, linkSize: "sm", children: t }) })
23
+ variant: o = f.DEFAULT,
24
+ children: n,
25
+ imageDisplay: c = w.LEFT,
26
+ ...d
27
+ }, _) => {
28
+ const { className: e, ...N } = k(d, "SaleCard"), $ = L(e, p, {
29
+ [`${e}--${o}`]: o,
30
+ [`${e}--image-${c}`]: c
31
+ }), I = { ...N, ...d };
32
+ return /* @__PURE__ */ m(a.Root, { ref: _, element: "article", variant: A.default, className: $, ...I, children: [
33
+ l ? /* @__PURE__ */ r(a.Image, { alt: h, src: l }) : null,
34
+ /* @__PURE__ */ m(a.Content, { children: [
35
+ /* @__PURE__ */ r(a.Eyebrow, { children: C }),
36
+ /* @__PURE__ */ r(a.Title, { children: u }),
37
+ s ? /* @__PURE__ */ r(a.Badge, { children: s }) : null,
38
+ /* @__PURE__ */ m(a.Meta, { className: `${e}__info`, children: [
39
+ /* @__PURE__ */ r(a.MetaItem, { children: S }),
40
+ /* @__PURE__ */ r(a.MetaItem, { children: E }),
41
+ t && i && /* @__PURE__ */ r("div", { className: `${e}__modal-link`, children: /* @__PURE__ */ r(g, { onClick: i, variant: R.link, linkSize: "sm", children: t }) })
43
42
  ] })
44
43
  ] }),
45
- m !== f.RELATED_SALE_TILE && c && /* @__PURE__ */ l("div", { className: `${a}__ctas`, children: /* @__PURE__ */ l(k.Media, { greaterThanOrEqual: "snw-mobile", children: c }) })
44
+ o !== f.RELATED_SALE_TILE && n && /* @__PURE__ */ r("div", { className: `${e}__ctas`, children: /* @__PURE__ */ r(T.Media, { greaterThanOrEqual: "snw-mobile", children: n }) })
46
45
  ] });
47
46
  }
48
47
  );
49
- R.displayName = "SaleCard";
48
+ y.displayName = "SaleCard";
50
49
  export {
51
- R as default
50
+ y as default
52
51
  };
@@ -1,7 +1,7 @@
1
1
  import { SaleCardProps } from './SaleCard';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: import('react').ForwardRefExoticComponent<Omit<SaleCardProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
4
+ component: import('react').ForwardRefExoticComponent<Omit<SaleCardProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
5
5
  };
6
6
  export default meta;
7
7
  export declare const SaleCardPlayground: {
@@ -8,6 +8,7 @@
8
8
 
9
9
  // ⚛️ Components
10
10
  @use 'components/Button/button';
11
+ @use 'components/Card/card';
11
12
  @use 'components/IconButton/iconButton';
12
13
  @use 'components/Icon/icon';
13
14
  @use 'components/Grid/grid';
@@ -0,0 +1,113 @@
1
+ @use '../../allPartials' as *;
2
+
3
+ .#{$px}-card {
4
+ align-items: center;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: $spacing-md;
8
+
9
+ @include media($breakpoint-snw-mobile) {
10
+ flex-direction: row;
11
+ }
12
+
13
+ &--stacked {
14
+ align-items: flex-start;
15
+ flex-direction: column;
16
+
17
+ .#{$px}-card__image,
18
+ .#{$px}-card__video {
19
+ min-width: 100%;
20
+ }
21
+
22
+ .#{$px}-card__details {
23
+ align-self: stretch;
24
+ }
25
+ }
26
+
27
+ &__image,
28
+ &__video {
29
+ align-items: center;
30
+ border-radius: $radius-xs;
31
+ display: flex;
32
+ flex: none;
33
+ justify-content: center;
34
+ min-width: 0;
35
+ width: 100%;
36
+
37
+ @include media($breakpoint-snw-mobile) {
38
+ flex: 0 0 30%;
39
+ min-width: auto;
40
+ width: auto;
41
+ }
42
+ }
43
+
44
+ &__image {
45
+ img {
46
+ height: auto;
47
+ object-fit: cover;
48
+ width: 100%;
49
+ }
50
+ }
51
+
52
+ &__video {
53
+ width: 100%;
54
+ }
55
+
56
+ &__details {
57
+ align-items: flex-start;
58
+ display: flex;
59
+ flex-direction: column;
60
+ flex-grow: 1;
61
+ gap: $spacing-micro;
62
+
63
+ @include media($size-snw-mobile, 'max') {
64
+ align-self: stretch;
65
+ }
66
+ }
67
+
68
+ &__title {
69
+ &.#{$px}-text {
70
+ text-transform: uppercase;
71
+ }
72
+
73
+ a {
74
+ color: inherit;
75
+ text-decoration: none;
76
+
77
+ &:hover,
78
+ &:focus-visible {
79
+ color: inherit;
80
+ text-decoration: underline;
81
+ }
82
+ }
83
+ }
84
+
85
+ &__cta {
86
+ align-self: flex-start;
87
+ }
88
+
89
+ &__description {
90
+ &.#{$px}-text {
91
+ color: $text-default;
92
+ }
93
+ }
94
+
95
+ &__badge {
96
+ border: 1px solid $badge-blue;
97
+ color: $badge-blue;
98
+ padding: $spacing-micro 8px;
99
+ text-transform: unset;
100
+ }
101
+
102
+ &__meta {
103
+ display: flex;
104
+ flex-direction: column;
105
+ gap: $spacing-micro;
106
+ }
107
+
108
+ &__meta-item {
109
+ &.#{$px}-text {
110
+ color: $text-supporting;
111
+ }
112
+ }
113
+ }
@@ -4,12 +4,24 @@
4
4
  overflow: hidden;
5
5
  position: relative;
6
6
 
7
- &--aspect-ratio-16-9 img {
8
- aspect-ratio: 16 / 9;
7
+ &--aspect-ratio-16-9 {
8
+ img {
9
+ aspect-ratio: 16 / 9;
10
+ }
11
+
12
+ &.#{$px}-seldon-image--error-image {
13
+ aspect-ratio: 16 / 9;
14
+ }
9
15
  }
10
16
 
11
- &--aspect-ratio-1-1 img {
12
- aspect-ratio: 1 / 1;
17
+ &--aspect-ratio-1-1 {
18
+ img {
19
+ aspect-ratio: 1 / 1;
20
+ }
21
+
22
+ &.#{$px}-seldon-image--error-image {
23
+ aspect-ratio: 1 / 1;
24
+ }
13
25
  }
14
26
 
15
27
  &--error {
@@ -30,82 +30,18 @@ a:has(> .#{$px}-sale-card) {
30
30
  }
31
31
  }
32
32
 
33
- &__title {
34
- &.#{$px}-text {
35
- text-transform: uppercase;
36
- }
37
- }
38
-
39
- &__image {
40
- align-items: center;
41
- aspect-ratio: 91/51;
42
- border-radius: $radius-xs;
43
- display: flex;
44
- flex: 0 0 30%;
45
- justify-content: center;
46
- min-width: 100%;
47
-
48
- @include media($breakpoint-snw-mobile) {
49
- min-width: auto;
50
- }
51
-
52
- img {
53
- height: auto;
54
- object-fit: cover;
55
- width: 100%;
56
- }
57
- }
58
-
59
- &__details {
60
- align-items: flex-start;
61
- display: flex;
62
- flex-direction: column;
63
- flex-grow: 1;
64
- gap: $spacing-micro;
65
-
66
- @include media($size-snw-mobile, 'max') {
67
- align-self: flex-start;
68
- }
69
- }
70
-
71
33
  &__ctas {
72
34
  flex: 0 0 0%;
73
35
 
74
- @media (min-width: $breakpoint-snw-mobile) {
36
+ @include media($breakpoint-snw-mobile) {
75
37
  flex-basis: 250px;
76
38
  }
77
39
  }
78
40
 
79
- &__date_info {
80
- display: flex;
81
- flex-direction: row;
82
- }
83
-
84
- &__separator {
85
- margin: 0 8px;
86
- }
87
-
88
- &__info {
89
- display: flex;
90
- flex-direction: column;
91
- gap: $spacing-micro;
92
-
93
- .#{$px}-text {
94
- color: $text-supporting;
95
- }
96
- }
97
-
98
41
  &__modal-link .#{$px}-button {
99
42
  @include text($linkSmall);
100
43
  }
101
44
 
102
- &__badge {
103
- border: 1px solid $badge-blue;
104
- color: $badge-blue;
105
- padding: $spacing-micro 8px;
106
- text-transform: unset;
107
- }
108
-
109
45
  &__cta-button {
110
46
  padding: $spacing-sm $spacing-lg;
111
47
  white-space: nowrap;
@@ -132,12 +68,13 @@ a:has(> .#{$px}-sale-card) {
132
68
  &.#{$px}-sale-card--image-left {
133
69
  flex-direction: row;
134
70
  }
71
+
135
72
  &.#{$px}-sale-card--image-right {
136
73
  flex-direction: row-reverse;
137
74
  }
138
75
  }
139
76
 
140
- .#{$px}-sale-card__image {
77
+ > .#{$px}-card__image {
141
78
  max-width: $spacing-xxxl;
142
79
  min-width: 94px;
143
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.250.0",
3
+ "version": "1.252.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"