@phillips/seldon 1.22.2 → 1.23.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,30 +1,32 @@
1
- import { jsx as k } from "react/jsx-runtime";
2
- import c from "../../node_modules/classnames/index.js";
3
- import { px as p } from "../../utils/index.js";
4
- import { getLinkVariantClassName as f, isLinkExternal as x, LinkVariants as d } from "./utils.js";
5
- const V = ({
6
- children: s,
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import f from "../../node_modules/classnames/index.js";
3
+ import { px as x } from "../../utils/index.js";
4
+ import { getLinkVariantClassName as d, isLinkExternal as L, LinkVariants as s } from "./utils.js";
5
+ import { TextVariants as o } from "../Text/types.js";
6
+ import N from "../Text/Text.js";
7
+ const j = ({
8
+ children: i,
7
9
  id: a,
8
- className: r,
10
+ className: m,
9
11
  element: t = "a",
10
- variant: e = d.standalone,
11
- href: n,
12
- ...o
12
+ variant: r = s.standalone,
13
+ href: e,
14
+ ...l
13
15
  }) => {
14
- const i = c(`${p}-link`, f(e), r), l = a ? `link-${a}` : "link", m = x(n);
15
- return /* @__PURE__ */ k(
16
+ const c = f(`${x}-link`, d(r), m), p = a ? `link-${a}` : "link", k = L(e);
17
+ return /* @__PURE__ */ n(
16
18
  t,
17
19
  {
18
- ...o,
19
- href: n,
20
- "data-testid": l,
20
+ ...l,
21
+ href: e,
22
+ "data-testid": p,
21
23
  id: a,
22
- className: i,
23
- ...m && t === "a" ? { rel: "noopener noreferrer", target: "_blank" } : {},
24
- children: s
24
+ className: c,
25
+ ...k && t === "a" ? { rel: "noopener noreferrer", target: "_blank" } : {},
26
+ children: /* @__PURE__ */ n(N, { variant: r === s.email ? o.email : o.ctaSm, children: i })
25
27
  }
26
28
  );
27
29
  };
28
30
  export {
29
- V as default
31
+ j as default
30
32
  };
@@ -4,7 +4,7 @@ export declare enum TextVariants {
4
4
  display2 = "display2",
5
5
  display3 = "display3",
6
6
  display4 = "display4",
7
- heading1 = "heading1",
7
+ blockquote = "blockquote",
8
8
  heading2 = "heading2",
9
9
  heading3 = "heading3",
10
10
  heading4 = "heading4",
@@ -16,5 +16,5 @@ export declare enum TextVariants {
16
16
  ctaSm = "ctaSm",
17
17
  email = "email",
18
18
  label = "label",
19
- textBadge = "textBadge"
19
+ badge = "badge"
20
20
  }
@@ -1,4 +1,4 @@
1
- var l = /* @__PURE__ */ ((d) => (d.display0 = "display0", d.display1 = "display1", d.display2 = "display2", d.display3 = "display3", d.display4 = "display4", d.heading1 = "heading1", d.heading2 = "heading2", d.heading3 = "heading3", d.heading4 = "heading4", d.body1 = "body1", d.body2 = "body2", d.body3 = "body3", d.button = "button", d.ctaLg = "ctaLg", d.ctaSm = "ctaSm", d.email = "email", d.label = "label", d.textBadge = "textBadge", d))(l || {});
1
+ var l = /* @__PURE__ */ ((d) => (d.display0 = "display0", d.display1 = "display1", d.display2 = "display2", d.display3 = "display3", d.display4 = "display4", d.blockquote = "blockquote", d.heading2 = "heading2", d.heading3 = "heading3", d.heading4 = "heading4", d.body1 = "body1", d.body2 = "body2", d.body3 = "body3", d.button = "button", d.ctaLg = "ctaLg", d.ctaSm = "ctaSm", d.email = "email", d.label = "label", d.badge = "badge", d))(l || {});
2
2
  export {
3
3
  l as TextVariants
4
4
  };
@@ -1,10 +1,10 @@
1
- import { px as a } from "../../utils/index.js";
2
- import { TextVariants as r } from "./types.js";
3
- const c = (e = r.body1) => {
4
- const t = e.replace("labelText", "label-text").replace("textBadge", "text-badge").replace("ctaSm", "cta-sm").replace("ctaLg", "cta-lg");
5
- return `${a}-text--${t.charAt(0).toLowerCase() + t.slice(1)}`;
6
- }, s = (e = r.body1) => e.includes("body") ? "p" : e === r.label ? "label" : e.includes("heading") ? `h${isNaN(parseInt(e.slice(-1))) ? 3 : parseInt(e.slice(-1))}` : "span";
1
+ import { px as s } from "../../utils/index.js";
2
+ import { TextVariants as t } from "./types.js";
3
+ const n = (e = t.body1) => {
4
+ const r = e.replace("ctaSm", "cta-sm").replace("ctaLg", "cta-lg");
5
+ return `${s}-text--${r.charAt(0).toLowerCase() + r.slice(1)}`;
6
+ }, c = (e = t.body1) => [t.display0, t.display1].includes(e) ? "h1" : [t.display2, t.display3, t.display4].includes(e) ? "h3" : e === t.blockquote ? "blockquote" : e.includes("body") ? "p" : e === t.label ? "label" : e.includes("heading") ? `h${isNaN(parseInt(e.slice(-1))) ? 3 : parseInt(e.slice(-1))}` : "span";
7
7
  export {
8
- s as determineDefaultTextElement,
9
- c as determineTextClassName
8
+ c as determineDefaultTextElement,
9
+ n as determineTextClassName
10
10
  };
@@ -63,8 +63,8 @@
63
63
  line-height: 1.25;
64
64
  }
65
65
 
66
- @if $label == 'text-badge' {
67
- font-size: $text-badge-label-size;
66
+ @if $label == 'badge' {
67
+ font-size: $badge-label-size;
68
68
  font-weight: 500;
69
69
  letter-spacing: 0.1875rem;
70
70
  line-height: 1.25;
@@ -94,8 +94,8 @@
94
94
  @include labelText($label);
95
95
  }
96
96
 
97
- @if $token == 'text-badge' {
98
- @include labelText($text-badge);
97
+ @if $token == 'badge' {
98
+ @include labelText($badge);
99
99
  }
100
100
 
101
101
  // Displays
@@ -120,8 +120,8 @@
120
120
  }
121
121
 
122
122
  // Headings
123
- @if $token == 'heading1' {
124
- @include hText($heading-size1);
123
+ @if $token == 'blockquote' {
124
+ @include hText($heading-size1, $color: $primary-black, $transform-style: initial);
125
125
  }
126
126
 
127
127
  @if $token == 'heading2' {
@@ -43,11 +43,11 @@
43
43
  @mixin gridMargins {
44
44
  margin: 0 $spacing-md;
45
45
 
46
- @media (min-width: $breakpoint3) {
46
+ @media (min-width: $breakpoint-lg) {
47
47
  margin: 0 $spacing-lg;
48
48
  }
49
49
 
50
- @media (min-width: $breakpoint4) {
50
+ @media (min-width: $breakpoint-xl) {
51
51
  margin: 0 $spacing-xl;
52
52
  }
53
53
  }
@@ -67,11 +67,11 @@
67
67
  gap: $spacing-md;
68
68
  grid-template-columns: repeat(2, 1fr);
69
69
 
70
- @media (min-width: $breakpoint2) {
70
+ @media (min-width: $breakpoint-md) {
71
71
  grid-template-columns: repeat(4, 1fr);
72
72
  }
73
73
 
74
- @media (min-width: $breakpoint3) {
74
+ @media (min-width: $breakpoint-lg) {
75
75
  grid-template-columns: repeat(12, 1fr);
76
76
  }
77
77
 
@@ -81,47 +81,47 @@
81
81
  }
82
82
 
83
83
  @mixin media($breakpoint, $type: 'min') {
84
- @if $breakpoint == $breakpoint-sm {
85
- // $breakpoint2: 961px;
84
+ @if $breakpoint == $size-sm {
85
+ // $breakpoint-md: 961px;
86
86
  @if $type == 'min' {
87
- @media (min-width: $breakpoint2) {
87
+ @media (min-width: $breakpoint-md) {
88
88
  @content;
89
89
  }
90
90
  }
91
91
 
92
92
  @if $type == 'max' {
93
- @media (max-width: $breakpoint2) {
93
+ @media (max-width: $breakpoint-md) {
94
94
  @content;
95
95
  }
96
96
  }
97
97
  }
98
98
 
99
- @if $breakpoint == $breakpoint-md {
100
- // $breakpoint3: 1401px;
99
+ @if $breakpoint == $size-md {
100
+ // $breakpoint-lg: 1401px;
101
101
 
102
102
  @if $type == 'min' {
103
- @media (min-width: $breakpoint3) {
103
+ @media (min-width: $breakpoint-lg) {
104
104
  @content;
105
105
  }
106
106
  }
107
107
 
108
108
  @if type == 'max' {
109
- @media (max-width: $breakpoint3) {
109
+ @media (max-width: $breakpoint-lg) {
110
110
  @content;
111
111
  }
112
112
  }
113
113
  }
114
114
 
115
- @if $breakpoint == $breakpoint-lg {
116
- // $breakpoint4: 1801px;
115
+ @if $breakpoint == $size-lg {
116
+ // $breakpoint-xl: 1801px;
117
117
  @if type == 'min' {
118
- @media (min-width: $breakpoint4) {
118
+ @media (min-width: $breakpoint-xl) {
119
119
  @content;
120
120
  }
121
121
  }
122
122
 
123
123
  @if type == 'max' {
124
- @media (max-width: $breakpoint4) {
124
+ @media (max-width: $breakpoint-xl) {
125
125
  @content;
126
126
  }
127
127
  }
@@ -73,21 +73,21 @@ $cta-sm: 'cta-sm';
73
73
  $cta-lg: 'cta-lg';
74
74
  $email: 'email';
75
75
  $label: 'label';
76
- $text-badge: 'text-badge';
76
+ $badge: 'badge';
77
77
  $display0: 'display0';
78
78
  $display1: 'display1';
79
79
  $display2: 'display2';
80
80
  $display3: 'display3';
81
81
  $display4: 'display4';
82
- $heading1: 'heading1';
82
+ $blockquote: 'blockquote';
83
83
  $heading2: 'heading2';
84
84
  $heading3: 'heading3';
85
85
  $heading4: 'heading4';
86
86
  $body1: 'body1';
87
87
  $body2: 'body2';
88
88
  $body3: 'body3';
89
- $text-tokens: $button, $cta-sm, $cta-lg, $email, $label, $text-badge, $display0, $display1, $display2, $display3,
90
- $display4, $heading1, $heading2, $heading3, $heading4, $body1, $body2, $body3;
89
+ $text-tokens: $button, $cta-sm, $cta-lg, $email, $label, $badge, $display0, $display1, $display2, $display3, $display4,
90
+ $blockquote, $heading2, $heading3, $heading4, $body1, $body2, $body3;
91
91
 
92
92
  ////////////////////////
93
93
  /// FONT SIZE TOKENS:
@@ -158,7 +158,7 @@ $cta-sm-label-size: var(--label-size2);
158
158
  $email-label-size: var(--label-size2);
159
159
  $cta-lg-label-size: var(--label-size1);
160
160
  $text-label-size: var(--label-size3);
161
- $text-badge-label-size: var(--label-size3);
161
+ $badge-label-size: var(--label-size3);
162
162
 
163
163
  ////////////////////////
164
164
  /// SPACING TOKENS:
@@ -216,24 +216,22 @@ $margin-lg: var(--spacing-lg);
216
216
  $margin-xl: var(--spacing-xl);
217
217
 
218
218
  ////////////////////////
219
- /// Breakpoint TOKENS:
219
+ /// Breakpoint TOKENS that map to minimum pixels
220
220
  ///////////////////////
221
-
222
- $breakpoint2: 961px;
223
- $breakpoint3: 1401px;
224
- $breakpoint4: 1801px;
221
+ $breakpoint-sm: 461px;
222
+ $breakpoint-md: 961px;
223
+ $breakpoint-lg: 1401px;
224
+ $breakpoint-xl: 1801px;
225
225
 
226
226
  ////////////////////////
227
227
  /// max-site-width TOKEN:
228
228
  ///////////////////////
229
229
  $max-site-width: 1560px;
230
230
 
231
- ////////////////////////////
232
- /// Media breakpoint tokens:
233
- ///////////////////////////
234
-
235
- $breakpoint-xs: 'xs';
236
- $breakpoint-sm: 'sm';
237
- $breakpoint-md: 'md';
238
- $breakpoint-lg: 'lg';
239
- $breakpoint-xl: 'xl';
231
+ ////////////////////////
232
+ /// Our tokens usually support at least 4 sizes.
233
+ ///////////////////////
234
+ $size-sm: 'sm';
235
+ $size-md: 'md';
236
+ $size-lg: 'lg';
237
+ $size-xl: 'xl';
@@ -18,11 +18,11 @@
18
18
  padding: $spacing-md $spacing-md $spacing-sm;
19
19
  text-align: right;
20
20
 
21
- @include media($breakpoint-md) {
21
+ @include media($size-md) {
22
22
  padding: $spacing-md $spacing-lg $spacing-sm;
23
23
  }
24
24
 
25
- @include media($breakpoint-lg) {
25
+ @include media($size-lg) {
26
26
  padding: $spacing-md $spacing-xl $spacing-sm;
27
27
  }
28
28
 
@@ -50,17 +50,17 @@
50
50
  flex-direction: column;
51
51
  padding: $spacing-lg $spacing-md 0;
52
52
 
53
- @include media($breakpoint-sm) {
53
+ @include media($size-sm) {
54
54
  align-items: flex-start;
55
55
  flex-direction: row;
56
56
  justify-content: space-between;
57
57
  }
58
58
 
59
- @include media($breakpoint-md) {
59
+ @include media($size-md) {
60
60
  padding: 3.75rem $spacing-lg;
61
61
  }
62
62
 
63
- @include media($breakpoint-lg) {
63
+ @include media($size-lg) {
64
64
  padding: 3.75rem $spacing-xl;
65
65
  }
66
66
  }
@@ -68,7 +68,7 @@
68
68
  &__content-split-panel__left {
69
69
  margin-bottom: $spacing-md;
70
70
 
71
- @include media($breakpoint-sm) {
71
+ @include media($size-sm) {
72
72
  margin-bottom: 0;
73
73
  }
74
74
  }
@@ -76,7 +76,7 @@
76
76
  &__content-split-panel__right {
77
77
  display: flex;
78
78
 
79
- @include media($breakpoint-sm) {
79
+ @include media($size-sm) {
80
80
  justify-content: flex-end;
81
81
  }
82
82
  }
@@ -26,7 +26,7 @@
26
26
  }
27
27
  }
28
28
 
29
- @include media($breakpoint-sm) {
29
+ @include media($size-sm) {
30
30
  @for $i from 1 through 4 {
31
31
  &--span-sm-#{$i} {
32
32
  @include gridItemColumnSpan($i, 4);
@@ -34,7 +34,7 @@
34
34
  }
35
35
  }
36
36
 
37
- @include media($breakpoint-md) {
37
+ @include media($size-md) {
38
38
  @for $i from 1 through 12 {
39
39
  &--span-md-#{$i} {
40
40
  @include gridItemColumnSpan($i, 12);
@@ -42,7 +42,7 @@
42
42
  }
43
43
  }
44
44
 
45
- @include media($breakpoint-lg) {
45
+ @include media($size-lg) {
46
46
  @for $i from 1 through 12 {
47
47
  &--span-lg-#{$i} {
48
48
  @include gridItemColumnSpan($i, 12);
@@ -14,7 +14,7 @@
14
14
  padding: 1rem;
15
15
  width: 100%;
16
16
 
17
- @media (max-width: 28.8125rem) {
17
+ @media (max-width: $breakpoint-sm) {
18
18
  align-items: center;
19
19
  align-self: stretch;
20
20
  background: $pure-black;
@@ -71,11 +71,11 @@
71
71
  font-size: 0.75rem;
72
72
  gap: 1.875rem;
73
73
 
74
- @media (min-width: 28.8125rem) {
74
+ @media (min-width: $breakpoint-sm) {
75
75
  font-size: 0.875rem;
76
76
  }
77
77
 
78
- @media (max-width: 28.8125rem) {
78
+ @media (max-width: $breakpoint-sm) {
79
79
  align-items: center;
80
80
  flex-direction: column;
81
81
  gap: 1rem;
@@ -91,7 +91,7 @@
91
91
  margin: 1.875rem 0;
92
92
  text-align: center;
93
93
 
94
- @media (min-width: 28.8125rem) {
94
+ @media (min-width: $breakpoint-sm) {
95
95
  font-size: 2.375rem;
96
96
  }
97
97
 
@@ -1,8 +1,6 @@
1
1
  @import '../../type';
2
2
 
3
3
  .#{$px}-link {
4
- @include text($cta-sm);
5
-
6
4
  color: $cta-blue;
7
5
  text-decoration: none;
8
6
  white-space: nowrap;
@@ -27,8 +25,4 @@
27
25
  &--list {
28
26
  color: $soft-black;
29
27
  }
30
-
31
- &--email {
32
- @include text($email);
33
- }
34
28
  }
@@ -5,7 +5,7 @@
5
5
  // mobile first
6
6
  grid-column: span 2;
7
7
 
8
- @include media($breakpoint-md) {
8
+ @include media($size-md) {
9
9
  grid-column: span 4;
10
10
  }
11
11
  }
@@ -7,7 +7,7 @@
7
7
  display: inline-flex;
8
8
  flex-direction: column;
9
9
 
10
- @include media($breakpoint-sm) {
10
+ @include media($size-sm) {
11
11
  align-items: flex-end;
12
12
  }
13
13
 
@@ -25,7 +25,7 @@
25
25
  margin: 0 0 $spacing-md;
26
26
  padding: 0;
27
27
 
28
- @include media($breakpoint-sm) {
28
+ @include media($size-sm) {
29
29
  gap: 0 1rem;
30
30
  }
31
31
 
@@ -11,7 +11,7 @@
11
11
  flex: 1 1 0px;
12
12
  }
13
13
 
14
- @include media($breakpoint-sm) {
14
+ @include media($size-sm) {
15
15
  align-items: stretch;
16
16
  flex-direction: row;
17
17
 
@@ -19,7 +19,7 @@
19
19
  text-align: center;
20
20
  }
21
21
 
22
- @include media($breakpoint-sm) {
22
+ @include media($size-sm) {
23
23
  &__title,
24
24
  &__blurb {
25
25
  text-align: left;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.22.2",
3
+ "version": "1.23.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -49,7 +49,7 @@
49
49
  "@semantic-release/changelog": "^6.0.3",
50
50
  "@semantic-release/git": "^10.0.1",
51
51
  "@semantic-release/github": "^10.0.5",
52
- "@storybook/addon-essentials": "^8.1.4",
52
+ "@storybook/addon-essentials": "^8.1.5",
53
53
  "@storybook/addon-interactions": "^8.1.4",
54
54
  "@storybook/addon-links": "^8.1.4",
55
55
  "@storybook/addon-mdx-gfm": "^8.1.5",
@@ -73,14 +73,14 @@
73
73
  "eslint-plugin-react-refresh": "^0.4.7",
74
74
  "eslint-plugin-storybook": "^0.8.0",
75
75
  "husky": "^9.0.11",
76
- "prettier": "3.2.5",
76
+ "prettier": "3.3.0",
77
77
  "react": "^18.3.1",
78
78
  "react-docgen-typescript": "^2.2.2",
79
79
  "react-dom": "^18.2.0",
80
80
  "rimraf": "^5.0.7",
81
81
  "rollup-plugin-copy": "^3.5.0",
82
82
  "rollup-plugin-peer-deps-external": "^2.2.4",
83
- "sass": "^1.77.3",
83
+ "sass": "^1.77.4",
84
84
  "semantic-release": "^23.1.1",
85
85
  "storybook": "^8.1.4",
86
86
  "stylelint": "^16.6.1",