@phillips/seldon 1.105.1 → 1.106.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,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { TextVariants } from './types';
2
+ import { TextAlignments, TextVariants } from './types';
3
3
  export interface TextProps extends React.HTMLAttributes<HTMLElement> {
4
4
  /**
5
5
  * Optional element to render as the top-level component e.g. 'div', 'span', CustomComponent, etc. Defaults to the appropriate HTML based on the variant.
@@ -9,6 +9,10 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
9
9
  * The OOTB style to apply to the text
10
10
  */
11
11
  variant?: TextVariants;
12
+ /**
13
+ * The alignment of the text
14
+ */
15
+ align?: TextAlignments;
12
16
  }
13
17
  /**
14
18
  * ## Overview
@@ -19,5 +23,5 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
19
23
  *
20
24
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-text--overview)
21
25
  */
22
- declare const Text: ({ children, className, element: CustomElement, variant, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
26
+ declare const Text: ({ children, className, element: CustomElement, variant, align, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
23
27
  export default Text;
@@ -1,20 +1,27 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { getCommonProps as c } from "../../utils/index.js";
3
- import { TextVariants as f } from "./types.js";
4
- import { determineDefaultTextElement as i, determineTextClassName as p } from "./utils.js";
5
- import x from "../../node_modules/classnames/index.js";
6
- const b = ({ children: t, className: o, element: s, variant: e = f.body2, ...m }) => {
7
- const r = s || i(e), { className: a, ...n } = c(m, "Text");
8
- return /* @__PURE__ */ l(
9
- r,
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { getCommonProps as i } from "../../utils/index.js";
3
+ import { TextVariants as x, TextAlignments as c } from "./types.js";
4
+ import { determineDefaultTextElement as p, determineTextClassName as T } from "./utils.js";
5
+ import d from "../../node_modules/classnames/index.js";
6
+ const P = ({
7
+ children: o,
8
+ className: s,
9
+ element: r,
10
+ variant: e = x.body2,
11
+ align: n = c.left,
12
+ ...t
13
+ }) => {
14
+ const a = r || p(e), { className: m, ...l } = i(t, "Text");
15
+ return /* @__PURE__ */ f(
16
+ a,
10
17
  {
11
- ...n,
12
- className: x(a, o, p(e)),
13
- ...m,
14
- children: t
18
+ ...l,
19
+ className: d(m, s, T(e), `${m}--${n}`),
20
+ ...t,
21
+ children: o
15
22
  }
16
23
  );
17
24
  };
18
25
  export {
19
- b as default
26
+ P as default
20
27
  };
@@ -1,8 +1,8 @@
1
1
  import { TextProps } from './Text';
2
- import { TextVariants } from './types';
2
+ import { TextAlignments, TextVariants } from './types';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ children, className, element: CustomElement, variant, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
5
+ component: ({ children, className, element: CustomElement, variant, align, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
6
6
  };
7
7
  export default meta;
8
8
  export declare const Playground: {
@@ -17,6 +17,12 @@ export declare const Playground: {
17
17
  type: string;
18
18
  };
19
19
  };
20
+ align: {
21
+ options: typeof TextAlignments;
22
+ control: {
23
+ type: string;
24
+ };
25
+ };
20
26
  };
21
27
  };
22
28
  export declare const SuperScript: {
@@ -32,5 +38,11 @@ export declare const SuperScript: {
32
38
  type: string;
33
39
  };
34
40
  };
41
+ align: {
42
+ options: typeof TextAlignments;
43
+ control: {
44
+ type: string;
45
+ };
46
+ };
35
47
  };
36
48
  };
@@ -25,3 +25,8 @@ export declare enum TextVariants {
25
25
  snwHeadingHero1 = "snwHeadingHero1",
26
26
  snwHeadingHero2 = "snwHeadingHero2"
27
27
  }
28
+ export declare enum TextAlignments {
29
+ left = "left",
30
+ center = "center",
31
+ right = "right"
32
+ }
@@ -1,4 +1,5 @@
1
- var g = /* @__PURE__ */ ((d) => (d.blockquote = "blockquote", d.heading1 = "heading1", d.heading2 = "heading2", d.heading3 = "heading3", d.heading4 = "heading4", d.heading5 = "heading5", d.title1 = "title1", d.title2 = "title2", d.title3 = "title3", d.title4 = "title4", d.body1 = "body1", d.body2 = "body2", d.body3 = "body3", d.string1 = "string1", d.string2 = "string2", d.string3 = "string3", d.button = "button", d.email = "email", d.label = "label", d.link = "link", d.badge = "badge", d.snwFlyoutLink = "snwFlyoutLink", d.snwHeaderLink = "snwHeaderLink", d.snwHeadingHero1 = "snwHeadingHero1", d.snwHeadingHero2 = "snwHeadingHero2", d))(g || {});
1
+ var g = /* @__PURE__ */ ((d) => (d.blockquote = "blockquote", d.heading1 = "heading1", d.heading2 = "heading2", d.heading3 = "heading3", d.heading4 = "heading4", d.heading5 = "heading5", d.title1 = "title1", d.title2 = "title2", d.title3 = "title3", d.title4 = "title4", d.body1 = "body1", d.body2 = "body2", d.body3 = "body3", d.string1 = "string1", d.string2 = "string2", d.string3 = "string3", d.button = "button", d.email = "email", d.label = "label", d.link = "link", d.badge = "badge", d.snwFlyoutLink = "snwFlyoutLink", d.snwHeaderLink = "snwHeaderLink", d.snwHeadingHero1 = "snwHeadingHero1", d.snwHeadingHero2 = "snwHeadingHero2", d))(g || {}), l = /* @__PURE__ */ ((d) => (d.left = "left", d.center = "center", d.right = "right", d))(l || {});
2
2
  export {
3
+ l as TextAlignments,
3
4
  g as TextVariants
4
5
  };
@@ -16,6 +16,10 @@ export interface ObjectTileProps extends ComponentProps<'a'> {
16
16
  * Estimate label text.
17
17
  */
18
18
  estimateLabelText?: string;
19
+ /**
20
+ * Estimate on request text to use when estimate is not available.
21
+ */
22
+ estimateOnRequestText?: string;
19
23
  /**
20
24
  * Element used for favoriting object
21
25
  */
@@ -1,104 +1,105 @@
1
- import { jsxs as s, jsx as a, Fragment as O } from "react/jsx-runtime";
2
- import { memo as S, forwardRef as D } from "react";
3
- import R from "../../node_modules/classnames/index.js";
4
- import { getCommonProps as z } from "../../utils/index.js";
1
+ import { jsxs as s, jsx as e, Fragment as O } from "react/jsx-runtime";
2
+ import { memo as z, forwardRef as B } from "react";
3
+ import F from "../../node_modules/classnames/index.js";
4
+ import { getCommonProps as I } 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 B from "../DetailList/DetailList.js";
8
- import F from "../../components/Detail/Detail.js";
9
- import I from "../../components/SeldonImage/SeldonImage.js";
10
- const L = S(
11
- D(
7
+ import L from "../DetailList/DetailList.js";
8
+ import R from "../../components/Detail/Detail.js";
9
+ import V from "../../components/SeldonImage/SeldonImage.js";
10
+ const W = z(
11
+ B(
12
12
  ({
13
- badgeText: p,
14
- className: f,
15
- children: $,
13
+ badgeText: f,
14
+ className: $,
15
+ children: N,
16
16
  element: r,
17
- estimate: m,
18
- estimateLabelText: N = "Estimate",
19
- favoriteElement: n,
20
- imageAlt: g = "Brought to you by Phillips",
21
- imageUrl: u = "",
22
- imageSrcSet: b,
23
- imageSizes: v,
24
- imageLoading: j,
25
- imageFetchPriority: k,
26
- lotNumber: y,
27
- makerText: o,
28
- modelText: c,
29
- referenceNumber: _,
30
- titleText: d,
31
- withdrawnText: t,
32
- ...h
33
- }, P) => {
34
- const { className: e, ...x } = z(h, "ObjectTile"), C = r != null ? r : "a";
35
- return /* @__PURE__ */ s(C, { ...x, className: R(e, f), ...h, ref: P, children: [
36
- /* @__PURE__ */ a(
37
- I,
17
+ estimate: n,
18
+ estimateLabelText: g = "Estimate",
19
+ estimateOnRequestText: o,
20
+ favoriteElement: t,
21
+ 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: c,
29
+ modelText: _,
30
+ referenceNumber: d,
31
+ titleText: h,
32
+ withdrawnText: m,
33
+ ...p
34
+ }, S) => {
35
+ const { className: a, ...C } = I(p, "ObjectTile"), x = r != null ? r : "a", D = n || o;
36
+ return /* @__PURE__ */ s(x, { ...C, className: F(a, $), ...p, ref: S, children: [
37
+ /* @__PURE__ */ e(
38
+ V,
38
39
  {
39
- alt: g,
40
+ alt: u,
40
41
  aspectRatio: "1/1",
41
- className: `${e}__img`,
42
+ className: `${a}__img`,
42
43
  objectFit: "cover",
43
- src: u,
44
- srcSet: b,
45
- sizes: v,
46
- loading: j,
47
- fetchPriority: k
44
+ src: b,
45
+ srcSet: v,
46
+ sizes: j,
47
+ loading: k,
48
+ fetchPriority: y
48
49
  }
49
50
  ),
50
- t ? null : /* @__PURE__ */ a(i, { className: `${e}__badge`, variant: l.badge, children: p }),
51
- /* @__PURE__ */ s("div", { className: `${e}__lot-number-like`, children: [
52
- /* @__PURE__ */ a(i, { className: `${e}__lot-number`, variant: l.heading3, element: "p", children: y }),
53
- n && /* @__PURE__ */ a(n, {})
51
+ m ? null : /* @__PURE__ */ e(i, { className: `${a}__badge`, variant: l.badge, children: f }),
52
+ /* @__PURE__ */ s("div", { className: `${a}__lot-number-like`, children: [
53
+ /* @__PURE__ */ e(i, { className: `${a}__lot-number`, variant: l.heading3, element: "p", children: P }),
54
+ t && /* @__PURE__ */ e(t, {})
54
55
  ] }),
55
- t ? /* @__PURE__ */ a(i, { className: `${e}__withdrawn`, variant: l.heading4, children: t }) : /* @__PURE__ */ s(O, { children: [
56
- /* @__PURE__ */ s("div", { className: `${e}__meta`, children: [
57
- o ? /* @__PURE__ */ a(i, { className: `${e}__maker`, variant: l.heading3, children: o }) : null,
58
- d ? /* @__PURE__ */ a(
56
+ m ? /* @__PURE__ */ e(i, { className: `${a}__withdrawn`, variant: l.heading4, children: m }) : /* @__PURE__ */ s(O, { children: [
57
+ /* @__PURE__ */ s("div", { className: `${a}__meta`, children: [
58
+ c ? /* @__PURE__ */ e(i, { className: `${a}__maker`, variant: l.heading3, children: c }) : null,
59
+ h ? /* @__PURE__ */ e(
59
60
  i,
60
61
  {
61
- className: `${e}__title ${e}__token-fix`,
62
+ className: `${a}__title ${a}__token-fix`,
62
63
  variant: l.heading4,
63
64
  element: "cite",
64
- children: d
65
+ children: h
65
66
  }
66
67
  ) : null,
67
- _ ? /* @__PURE__ */ a(
68
+ d ? /* @__PURE__ */ e(
68
69
  i,
69
70
  {
70
- className: `${e}__reference-number ${e}__token-fix`,
71
+ className: `${a}__reference-number ${a}__token-fix`,
71
72
  variant: l.heading4,
72
73
  element: "p",
73
- children: _
74
+ children: d
74
75
  }
75
76
  ) : null,
76
- c ? /* @__PURE__ */ a(
77
+ _ ? /* @__PURE__ */ e(
77
78
  i,
78
79
  {
79
- className: `${e}__model ${e}__token-fix`,
80
+ className: `${a}__model ${a}__token-fix`,
80
81
  variant: l.heading4,
81
82
  element: "p",
82
- children: c
83
+ children: _
83
84
  }
84
85
  ) : null
85
86
  ] }),
86
- m ? /* @__PURE__ */ a(B, { hasSeparators: !0, className: `${e}__estimate ${e}__section`, children: /* @__PURE__ */ a(
87
- F,
87
+ D ? /* @__PURE__ */ e(L, { hasSeparators: !0, className: `${a}__estimate ${a}__section`, children: /* @__PURE__ */ e(
88
+ R,
88
89
  {
89
- className: `${e}__estimate__label`,
90
- label: N,
91
- value: m,
90
+ className: `${a}__estimate__label`,
91
+ label: g,
92
+ value: n || o,
92
93
  hasWrap: !1
93
94
  }
94
95
  ) }) : null,
95
- /* @__PURE__ */ a("div", { className: `${e}__section`, children: $ })
96
+ /* @__PURE__ */ e("div", { className: `${a}__section`, children: N })
96
97
  ] })
97
98
  ] });
98
99
  }
99
100
  )
100
101
  );
101
- L.displayName = "ObjectTile";
102
+ W.displayName = "ObjectTile";
102
103
  export {
103
- L as default
104
+ W as default
104
105
  };
@@ -11,13 +11,11 @@
11
11
 
12
12
  &-align-center {
13
13
  grid-column: math.ceil(math.div($total-cols + 1 - $span, 2)) / span #{$span};
14
- text-align: center;
15
14
  }
16
15
  }
17
16
 
18
17
  .#{$px}-grid-item {
19
18
  justify-self: center;
20
- text-align: center;
21
19
  width: 100%;
22
20
 
23
21
  @for $i from 1 through 2 {
@@ -8,6 +8,18 @@
8
8
  @include text($variant);
9
9
  }
10
10
  }
11
+
12
+ &--left {
13
+ text-align: left;
14
+ }
15
+
16
+ &--center {
17
+ text-align: center;
18
+ }
19
+
20
+ &--right {
21
+ text-align: right;
22
+ }
11
23
  }
12
24
 
13
25
  h1.#{$px}-text,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.105.1",
3
+ "version": "1.106.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"