@phillips/seldon 1.151.0 → 1.151.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.
@@ -10,9 +10,9 @@ export interface FavoritesCollectionTileProps extends ComponentProps<'div'> {
10
10
  */
11
11
  emptyFavoritesText?: string;
12
12
  /**
13
- * Lot blank list text en/zh
13
+ * Lot create first list text en/zh
14
14
  */
15
- blankListText?: string;
15
+ createFirstListText?: string;
16
16
  /**
17
17
  * Lot empty lists text en/zh
18
18
  */
@@ -40,7 +40,7 @@ export interface FavoritesCollectionTileProps extends ComponentProps<'div'> {
40
40
  /**
41
41
  * Whether this card is in favorites view or lists view
42
42
  */
43
- variant: 'favorites' | 'lists';
43
+ variant: 'favorites' | 'lists' | 'create';
44
44
  /**
45
45
  * React component to render within the navigation item, renders <Link> by default
46
46
  */
@@ -61,6 +61,14 @@ export interface FavoritesCollectionTileProps extends ComponentProps<'div'> {
61
61
  * Function to modify strings for lot string translation
62
62
  */
63
63
  formatlotStr?: (count: number, lotText?: string) => string;
64
+ /**
65
+ * Custom class name for the Link component
66
+ */
67
+ linkClassName?: string;
68
+ /**
69
+ * Custom icon size for the icon in the tile
70
+ */
71
+ iconSize?: number;
64
72
  }
65
73
  /**
66
74
  * ## Overview
@@ -1,121 +1,148 @@
1
- import { jsx as t, jsxs as i, Fragment as R } from "react/jsx-runtime";
2
- import { Root as j, Trigger as I, Portal as D, Content as P } from "../../node_modules/@radix-ui/react-popover/dist/index.js";
3
- import m from "../../node_modules/classnames/index.js";
4
- import { memo as E, forwardRef as O, useRef as Y } from "react";
5
- import _ from "../../components/Icon/Icon.js";
6
- import A from "../../components/Link/Link.js";
7
- import K from "../../components/SeldonImage/SeldonImage.js";
8
- import { TextVariants as p } from "../../components/Text/types.js";
9
- import $ from "../../components/Text/Text.js";
10
- import { getCommonProps as S } from "../../utils/index.js";
11
- const W = E(
12
- O(
1
+ import { jsx as t, jsxs as a, Fragment as f } from "react/jsx-runtime";
2
+ import { Root as O, Trigger as V, Portal as A, Content as Y } from "../../node_modules/@radix-ui/react-popover/dist/index.js";
3
+ import l from "../../node_modules/classnames/index.js";
4
+ import { memo as H, forwardRef as K, useRef as q } from "react";
5
+ import $ from "../../components/Icon/Icon.js";
6
+ import B from "../../components/Link/Link.js";
7
+ import G from "../../components/SeldonImage/SeldonImage.js";
8
+ import { TextVariants as y } from "../../components/Text/types.js";
9
+ import g from "../../components/Text/Text.js";
10
+ import { getCommonProps as J } from "../../utils/index.js";
11
+ const ae = H(
12
+ K(
13
13
  ({
14
- id: r,
15
- className: v,
16
- count: n,
17
- name: c,
18
- imageSrc: N,
19
- variant: l,
20
- element: f = A,
21
- href: y,
22
- emptyFavoritesText: u = "You have not added any objects to your Favorites yet.",
23
- emptyListsText: g = "You have not added any objects to your List yet.",
24
- blankListText: b = "Create your first List.",
25
- editListText: C = "Edit List",
26
- deleteListText: k = "Delete List",
27
- onEdit: w,
28
- onDelete: x,
29
- formatlotStr: h = (e, d = e > 1 ? "LOTS" : "LOT") => `${e} ${d}`,
30
- ...L
31
- }, F) => {
32
- const { className: e, ...d } = S({ id: r, ...L }, "FavoritesCollectionTile"), T = Y(null), o = c && n !== null && n !== void 0, s = n === 0;
33
- return /* @__PURE__ */ t("div", { ...d, className: m(e, v), ref: F, id: r, children: /* @__PURE__ */ i("div", { className: `${e}__content`, children: [
34
- /* @__PURE__ */ i("div", { className: `${e}__header`, children: [
35
- /* @__PURE__ */ i("div", { className: `${e}__info`, children: [
36
- o && /* @__PURE__ */ t($, { element: "span", className: `${e}__count`, variant: p.body3, children: h && o && h(n) }),
37
- /* @__PURE__ */ t($, { element: "h3", className: `${e}__title`, variant: p.heading5, children: c })
14
+ id: c,
15
+ className: u,
16
+ count: d,
17
+ name: _,
18
+ imageSrc: b,
19
+ variant: h,
20
+ element: C = B,
21
+ href: L,
22
+ emptyFavoritesText: k = "You have not added any objects to your Favorites yet.",
23
+ emptyListsText: w = "You have not added any objects to your List yet.",
24
+ createFirstListText: x = "Create your first List.",
25
+ editListText: F = "Edit List",
26
+ deleteListText: T = "Delete List",
27
+ onEdit: R,
28
+ onDelete: j,
29
+ formatlotStr: v = (e, p = e === 1 ? "LOT" : "LOTS") => `${e} ${p}`,
30
+ linkClassName: I,
31
+ iconSize: o = 22,
32
+ ...P
33
+ }, D) => {
34
+ const { className: e, ...p } = J({ id: c, ...P }, "FavoritesCollectionTile"), E = q(null), i = _ && d !== null && d !== void 0, r = d === 0, m = h === "lists", n = h === "create", N = i && r;
35
+ return /* @__PURE__ */ t("div", { ...p, className: l(e, u), ref: D, id: c, children: /* @__PURE__ */ a("div", { className: `${e}__content`, children: [
36
+ /* @__PURE__ */ a("div", { className: `${e}__header`, children: [
37
+ /* @__PURE__ */ a("div", { className: `${e}__info`, children: [
38
+ i && /* @__PURE__ */ t(g, { element: "span", className: `${e}__count`, variant: y.body3, children: v && i && v(d) }),
39
+ /* @__PURE__ */ t(g, { element: "h3", className: `${e}__title`, variant: y.heading5, children: _ })
38
40
  ] }),
39
- /* @__PURE__ */ t(R, { children: o && (l === "lists" || l === "favorites" && !s) && /* @__PURE__ */ i(j, { children: [
40
- /* @__PURE__ */ t(I, { asChild: !0, children: /* @__PURE__ */ t(
41
+ /* @__PURE__ */ t(f, { children: i && m && /* @__PURE__ */ a(O, { children: [
42
+ /* @__PURE__ */ t(V, { asChild: !0, children: /* @__PURE__ */ t(
41
43
  "div",
42
44
  {
43
45
  className: `${e}__actions`,
44
46
  "data-testid": "menu-trigger",
45
47
  tabIndex: 0,
46
48
  role: "button",
47
- onKeyDown: (a) => {
48
- a.key === "Enter" && (a.preventDefault(), a.stopPropagation(), a.target.click());
49
+ onKeyDown: (s) => {
50
+ s.key === "Enter" && (s.preventDefault(), s.stopPropagation(), s.target.click());
49
51
  },
50
- children: /* @__PURE__ */ t(
51
- _,
52
+ children: /* @__PURE__ */ t("div", { className: `${e}__icon-rotate`, children: /* @__PURE__ */ t(
53
+ $,
52
54
  {
53
55
  icon: "Icon",
54
- width: 24,
55
- height: 24,
56
+ width: o,
57
+ height: o,
56
58
  color: "$dark-gray",
57
- className: `${e}__icon-rotate`
59
+ className: `${e}__icon-button`
58
60
  }
59
- )
61
+ ) })
60
62
  }
61
63
  ) }),
62
- /* @__PURE__ */ t(D, { children: /* @__PURE__ */ t(P, { sideOffset: 5, className: `${e}__popover-content`, children: /* @__PURE__ */ i("div", { className: `${e}__dropdown`, "data-testid": "dropdown-menu", children: [
63
- /* @__PURE__ */ t(
64
- "button",
65
- {
66
- className: `${e}__dropdown--item`,
67
- onClick: (a) => w?.(r, a),
68
- type: "button",
69
- children: C
70
- }
71
- ),
72
- /* @__PURE__ */ t(
73
- "button",
74
- {
75
- className: `${e}__dropdown--item`,
76
- onClick: (a) => x?.(r, a),
77
- type: "button",
78
- children: k
79
- }
80
- )
81
- ] }) }) })
64
+ /* @__PURE__ */ t(A, { children: /* @__PURE__ */ t(
65
+ Y,
66
+ {
67
+ avoidCollisions: !0,
68
+ collisionPadding: 10,
69
+ sideOffset: 5,
70
+ align: "start",
71
+ alignOffset: 5,
72
+ className: `${e}__popover-content`,
73
+ children: /* @__PURE__ */ a("div", { className: `${e}__dropdown`, "data-testid": "dropdown-menu", children: [
74
+ /* @__PURE__ */ t(
75
+ "button",
76
+ {
77
+ className: `${e}__dropdown--item`,
78
+ onClick: (s) => R?.(c, s),
79
+ type: "button",
80
+ children: F
81
+ }
82
+ ),
83
+ /* @__PURE__ */ t(
84
+ "button",
85
+ {
86
+ className: `${e}__dropdown--item`,
87
+ onClick: (s) => j?.(c, s),
88
+ type: "button",
89
+ children: T
90
+ }
91
+ )
92
+ ] })
93
+ }
94
+ ) })
82
95
  ] }) })
83
96
  ] }),
84
- /* @__PURE__ */ i(f, { href: y, className: `${e}__media-link`, tabIndex: 0, children: [
85
- s && l === "favorites" && /* @__PURE__ */ t("div", { className: `${e}__media-container`, "data-testid": "favorites", "aria-label": "Favorites", children: /* @__PURE__ */ t("div", { className: m(`${e}__empty`, `${e}__empty--favorites`), children: /* @__PURE__ */ i("div", { className: `${e}__empty__content`, children: [
97
+ /* @__PURE__ */ a(C, { href: L, className: l(`${e}__media-link`, I), tabIndex: 0, children: [
98
+ r && h === "favorites" && /* @__PURE__ */ t("div", { className: `${e}__media-container`, "data-testid": "favorites", "aria-label": "Favorites", children: /* @__PURE__ */ t("div", { className: l(`${e}__empty`, `${e}__empty--bg`), children: /* @__PURE__ */ a("div", { className: `${e}__empty__content`, children: [
86
99
  /* @__PURE__ */ t(
87
- _,
100
+ $,
88
101
  {
89
102
  icon: "Favorite",
90
- width: 24,
91
- height: 24,
103
+ width: o,
104
+ height: o,
92
105
  color: "$dark-gray",
93
106
  className: `${e}__icon`
94
107
  }
95
108
  ),
96
- /* @__PURE__ */ t("div", { className: `${e}__text`, children: u })
109
+ /* @__PURE__ */ t("div", { className: `${e}__text`, children: k })
97
110
  ] }) }) }),
98
- (s || !o) && l === "lists" && /* @__PURE__ */ t("div", { className: `${e}__media-container`, "data-testid": "list", "aria-label": "Lists", children: /* @__PURE__ */ t("div", { className: m(`${e}__empty`, `${e}__empty--list`), children: /* @__PURE__ */ i("div", { className: `${e}__empty__content`, children: [
99
- /* @__PURE__ */ t(
100
- _,
111
+ (r || !i) && (m || n) && /* @__PURE__ */ a(f, { children: [
112
+ n && /* @__PURE__ */ t("div", { className: `${e}__create-spacing` }),
113
+ /* @__PURE__ */ t("div", { className: `${e}__media-container`, "data-testid": "list", "aria-label": "Lists", children: /* @__PURE__ */ t(
114
+ "div",
101
115
  {
102
- icon: o && s ? "Favorite" : "Add",
103
- width: 24,
104
- height: 24,
105
- color: "$dark-gray",
106
- className: `${e}__icon`
116
+ className: l(`${e}__empty`, {
117
+ [`${e}__empty--create-list`]: !i && (m || n),
118
+ [`${e}__empty--bg`]: r && !n
119
+ }),
120
+ children: /* @__PURE__ */ a("div", { className: `${e}__empty__content`, children: [
121
+ /* @__PURE__ */ t(
122
+ $,
123
+ {
124
+ icon: N ? "Favorite" : "Add",
125
+ width: o,
126
+ height: o,
127
+ color: "$dark-gray",
128
+ className: l(`${e}__icon`, {
129
+ [`${e}__icon-circle`]: !i && (m || n)
130
+ })
131
+ }
132
+ ),
133
+ /* @__PURE__ */ t("div", { className: `${e}__text`, children: N ? w : x })
134
+ ] })
107
135
  }
108
- ),
109
- /* @__PURE__ */ t("div", { className: `${e}__text`, children: o && s ? g : b })
110
- ] }) }) }),
111
- !s && o && /* @__PURE__ */ t("div", { className: `${e}__media-container`, ref: T, children: /* @__PURE__ */ t(
112
- K,
136
+ ) })
137
+ ] }),
138
+ !r && i && /* @__PURE__ */ t("div", { className: `${e}__media-container`, ref: E, children: /* @__PURE__ */ t(
139
+ G,
113
140
  {
114
- alt: c,
141
+ alt: _,
115
142
  aspectRatio: "1/1",
116
143
  className: `${e}__media`,
117
144
  objectFit: "cover",
118
- src: N,
145
+ src: b,
119
146
  style: {
120
147
  cursor: "pointer"
121
148
  }
@@ -127,5 +154,5 @@ const W = E(
127
154
  )
128
155
  );
129
156
  export {
130
- W as default
157
+ ae as default
131
158
  };
@@ -16,6 +16,7 @@ export declare const Playground: {
16
16
  onEdit: () => void;
17
17
  onDelete: () => void;
18
18
  element: string;
19
+ linkClassName: string;
19
20
  };
20
21
  argTypes: {
21
22
  variant: {
@@ -42,16 +43,18 @@ export declare const EmptyFavorites: {
42
43
  variant: string;
43
44
  element: string;
44
45
  formatlotStr: (count: number, lotText?: string) => string;
46
+ linkClassName: string;
45
47
  };
46
48
  };
47
- export declare const BlankList: {
49
+ export declare const CreateList: {
48
50
  (props: ComponentProps<typeof FavoritesCollectionTile>): import("react/jsx-runtime").JSX.Element;
49
51
  args: {
50
52
  id: string;
51
53
  count: number;
52
- name: string;
54
+ name: null;
53
55
  variant: string;
54
56
  element: string;
57
+ linkClassName: string;
55
58
  };
56
59
  };
57
60
  export declare const EmptyList: {
@@ -62,6 +65,7 @@ export declare const EmptyList: {
62
65
  name: string;
63
66
  variant: string;
64
67
  element: string;
68
+ linkClassName: string;
65
69
  };
66
70
  };
67
71
  export declare const TranslatedList: {
@@ -74,5 +78,6 @@ export declare const TranslatedList: {
74
78
  element: string;
75
79
  emptyListsText: string;
76
80
  formatlotStr: (count: number) => string;
81
+ linkClassName: string;
77
82
  };
78
83
  };
@@ -3,7 +3,6 @@
3
3
  .#{$px}-favorites-collection-tile {
4
4
  display: flex;
5
5
  flex-direction: column;
6
- max-width: 24.5rem;
7
6
  text-align: left;
8
7
 
9
8
  &__content {
@@ -16,7 +15,7 @@
16
15
  align-items: flex-end;
17
16
  display: flex;
18
17
  justify-content: space-between;
19
- margin-bottom: $spacing-sm;
18
+ padding-bottom: $spacing-sm;
20
19
  }
21
20
 
22
21
  &__info {
@@ -55,7 +54,8 @@
55
54
  display: flex;
56
55
  height: 2.5rem;
57
56
  justify-content: center;
58
- margin-left: $spacing-sm;
57
+ position: relative;
58
+ top: $spacing-sm;
59
59
  transition: background 0.8s;
60
60
  width: 2.5rem;
61
61
 
@@ -70,11 +70,14 @@
70
70
  background-size: 100%;
71
71
  transition: background 0s;
72
72
  }
73
+
74
+ @media (min-width: $breakpoint-xl) {
75
+ top: calc($spacing-sm + 0.45rem);
76
+ }
73
77
  }
74
78
 
75
79
  &__popover-content {
76
80
  outline: none;
77
- transform: translateX(2.5rem);
78
81
  }
79
82
 
80
83
  &__dropdown {
@@ -100,6 +103,9 @@
100
103
  color: inherit;
101
104
  text-decoration: none;
102
105
  }
106
+ &.#{$px}-link {
107
+ text-transform: none;
108
+ }
103
109
  }
104
110
 
105
111
  &__media-container {
@@ -121,11 +127,11 @@
121
127
  display: block;
122
128
  position: relative;
123
129
 
124
- &--favorites {
130
+ &--bg {
125
131
  background-color: $soft-gray;
126
132
  }
127
133
 
128
- &--list {
134
+ &--create-list {
129
135
  border: 1px solid #0000001f;
130
136
  border-radius: 0;
131
137
  }
@@ -134,23 +140,41 @@
134
140
  bottom: 20px;
135
141
  left: 20px;
136
142
  position: absolute;
143
+ width: calc(100% - 40px);
137
144
  }
138
145
  }
139
146
 
140
147
  &__icon {
141
148
  grid-column: 1;
142
149
  justify-self: start;
150
+ pointer-events: none;
143
151
 
144
152
  &-rotate {
145
153
  transform: rotate(90deg);
146
154
  }
155
+
156
+ &-circle {
157
+ border: 2px solid $dark-gray;
158
+ border-radius: 50%;
159
+ transform: scale(0.846);
160
+ }
161
+ }
162
+
163
+ &__icon-button {
164
+ pointer-events: none;
147
165
  }
148
166
 
167
+ // will update font size with variable rem sizing after design takes a pass at it some point in the future
149
168
  &__text {
150
169
  color: $dark-gray;
151
- font-size: $body-size3;
170
+ font-size: 0.75rem;
152
171
  font-variation-settings: 'wght' 400;
153
172
  padding-top: 5px;
173
+ text-transform: none;
174
+ }
175
+
176
+ &__create-spacing {
177
+ height: calc($spacing-xsm + var(--body-line-height-size3) + var(--heading-line-height-size5));
154
178
  }
155
179
 
156
180
  [data-radix-popper-content-wrapper] > * {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.151.0",
3
+ "version": "1.151.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"