@phillips/seldon 1.21.0 → 1.22.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.
@@ -1,5 +1,4 @@
1
1
  export interface FooterProps extends React.HTMLAttributes<HTMLElement> {
2
- chidlren?: React.ReactNode;
3
2
  /**
4
3
  * Copyright data added to bottom of site
5
4
  */
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { TextVariants } from './types';
3
+ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
4
+ /**
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.
6
+ */
7
+ element?: React.ElementType;
8
+ /**
9
+ * The OOTB style to apply to the text
10
+ */
11
+ variant?: TextVariants;
12
+ }
13
+ /**
14
+ * ## Overview
15
+ *
16
+ * All text rendered in the UI can be wrapped in this component to enforce consistent styling and semantic HTML.
17
+ *
18
+ * [Figma Link](https://www.figma.com/design/xMuOXOAKVt5HC7hgYjF3ot/Components-v2.0?node-id=6344-139&t=BUiWETQbkkWoDZ5V-4)
19
+ */
20
+ declare const Text: ({ children, id, element: CustomElement, variant, className, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
21
+ export default Text;
@@ -0,0 +1,28 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { px as p } from "../../utils/index.js";
3
+ import f from "../../node_modules/classnames/index.js";
4
+ import { TextVariants as c } from "./types.js";
5
+ import { determineDefaultTextElement as d, determineTextClassName as i } from "./utils.js";
6
+ const $ = ({
7
+ children: m,
8
+ id: t,
9
+ element: s,
10
+ variant: e = c.body2,
11
+ className: o,
12
+ ...a
13
+ }) => {
14
+ const r = t ? `text-${t}` : "text", n = `${p}-text`, x = s || d(e);
15
+ return /* @__PURE__ */ l(
16
+ x,
17
+ {
18
+ ...a,
19
+ "data-testid": r,
20
+ id: t,
21
+ className: f(n, i(e), o),
22
+ children: m
23
+ }
24
+ );
25
+ };
26
+ export {
27
+ $ as default
28
+ };
@@ -0,0 +1,2 @@
1
+ export { TextVariants } from './types';
2
+ export { default as Text, type TextProps } from './Text';
@@ -0,0 +1,20 @@
1
+ export declare enum TextVariants {
2
+ display0 = "display0",
3
+ display1 = "display1",
4
+ display2 = "display2",
5
+ display3 = "display3",
6
+ display4 = "display4",
7
+ heading1 = "heading1",
8
+ heading2 = "heading2",
9
+ heading3 = "heading3",
10
+ heading4 = "heading4",
11
+ body1 = "body1",
12
+ body2 = "body2",
13
+ body3 = "body3",
14
+ button = "button",
15
+ ctaLg = "ctaLg",
16
+ ctaSm = "ctaSm",
17
+ email = "email",
18
+ label = "label",
19
+ textBadge = "textBadge"
20
+ }
@@ -0,0 +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 || {});
2
+ export {
3
+ l as TextVariants
4
+ };
@@ -0,0 +1,3 @@
1
+ import { TextVariants } from './types';
2
+ export declare const determineTextClassName: (variant?: TextVariants) => string;
3
+ export declare const determineDefaultTextElement: (variant?: TextVariants) => string;
@@ -0,0 +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";
7
+ export {
8
+ s as determineDefaultTextElement,
9
+ c as determineTextClassName
10
+ };
Binary file
Binary file
package/dist/index.d.ts CHANGED
@@ -18,4 +18,6 @@ export { default as Subscribe, type SubscribeProps } from './components/Subscrib
18
18
  export { default as Social, type SocialProps } from './components/Social/Social';
19
19
  export { default as ViewingsList, type ViewingsListProps } from './components/ViewingsList/ViewingsList';
20
20
  export { default as StatefulViewingsList, type StatefulViewingsListProps, } from './components/ViewingsList/StatefulViewingsList';
21
+ export * from './components/Text';
22
+ export { PaddingTokens } from './utils';
21
23
  export { default as Page } from './pages/Page';
package/dist/index.js CHANGED
@@ -1,44 +1,50 @@
1
1
  import { default as t } from "./components/Button/Button.js";
2
2
  import { default as a } from "./components/ErrorBoundary/ErrorBoundary.js";
3
- import { default as l } from "./components/Footer/Footer.js";
4
- import { Grid as d } from "./components/Grid/Grid.js";
3
+ import { default as s } from "./components/Footer/Footer.js";
4
+ import { Grid as l } from "./components/Grid/Grid.js";
5
5
  import { default as p } from "./components/Header/Header.js";
6
- import { default as x } from "./components/HeroBanner/HeroBanner.js";
6
+ import { default as u } from "./components/HeroBanner/HeroBanner.js";
7
7
  import { default as n } from "./components/Input/Input.js";
8
8
  import { default as k } from "./components/Link/Link.js";
9
- import { LinkVariants as c } from "./components/Link/utils.js";
9
+ import { LinkVariants as S } from "./components/Link/utils.js";
10
10
  import { default as B } from "./components/LinkBlock/LinkBlock.js";
11
- import { default as G } from "./components/LinkList/LinkList.js";
12
- import { default as V } from "./components/Row/Row.js";
13
- import { default as H } from "./components/GridItem/GridItem.js";
14
- import { GridItemAlign as y } from "./components/GridItem/types.js";
15
- import { default as E } from "./components/Select/Select.js";
16
- import { default as R } from "./components/SplitPanel/SplitPanel.js";
17
- import { default as j } from "./components/Subscribe/Subscribe.js";
18
- import { default as v } from "./components/Social/Social.js";
19
- import { default as C } from "./components/ViewingsList/ViewingsList.js";
20
- import { default as J } from "./components/ViewingsList/StatefulViewingsList.js";
21
- import { default as M } from "./pages/Page.js";
11
+ import { default as w } from "./components/LinkList/LinkList.js";
12
+ import { default as I } from "./components/Row/Row.js";
13
+ import { default as T } from "./components/GridItem/GridItem.js";
14
+ import { GridItemAlign as H } from "./components/GridItem/types.js";
15
+ import { default as A } from "./components/Select/Select.js";
16
+ import { default as F } from "./components/SplitPanel/SplitPanel.js";
17
+ import { default as h } from "./components/Subscribe/Subscribe.js";
18
+ import { default as q } from "./components/Social/Social.js";
19
+ import { default as z } from "./components/ViewingsList/ViewingsList.js";
20
+ import { default as D } from "./components/ViewingsList/StatefulViewingsList.js";
21
+ import { TextVariants as K } from "./components/Text/types.js";
22
+ import { default as N } from "./components/Text/Text.js";
23
+ import { PaddingTokens as Q } from "./utils/index.js";
24
+ import { default as W } from "./pages/Page.js";
22
25
  export {
23
26
  t as Button,
24
27
  a as ErrorBoundary,
25
- l as Footer,
26
- d as Grid,
27
- H as GridItem,
28
- y as GridItemAlign,
28
+ s as Footer,
29
+ l as Grid,
30
+ T as GridItem,
31
+ H as GridItemAlign,
29
32
  p as Header,
30
- x as HeroBanner,
33
+ u as HeroBanner,
31
34
  n as Input,
32
35
  k as Link,
33
36
  B as LinkBlock,
34
- G as LinkList,
35
- c as LinkVariants,
36
- M as Page,
37
- V as Row,
38
- E as Select,
39
- v as Social,
40
- R as SplitPanel,
41
- J as StatefulViewingsList,
42
- j as Subscribe,
43
- C as ViewingsList
37
+ w as LinkList,
38
+ S as LinkVariants,
39
+ Q as PaddingTokens,
40
+ W as Page,
41
+ I as Row,
42
+ A as Select,
43
+ q as Social,
44
+ F as SplitPanel,
45
+ D as StatefulViewingsList,
46
+ h as Subscribe,
47
+ N as Text,
48
+ K as TextVariants,
49
+ z as ViewingsList
44
50
  };
@@ -56,7 +56,7 @@
56
56
  text-transform: lowercase;
57
57
  }
58
58
 
59
- @if $label == 'text' {
59
+ @if $label == 'label' {
60
60
  font-size: $text-label-size;
61
61
  font-weight: 500;
62
62
  letter-spacing: 0.0625rem;
@@ -90,8 +90,8 @@
90
90
  @include labelText($email);
91
91
  }
92
92
 
93
- @if $token == 'text' {
94
- @include labelText($text);
93
+ @if $token == 'label' {
94
+ @include labelText($label);
95
95
  }
96
96
 
97
97
  @if $token == 'text-badge' {
@@ -1,8 +1,5 @@
1
1
  @import './vars';
2
2
 
3
- // Design wants this replaced in the future with a local version of Montserrat
4
- @import 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,200;0,400;0,500;0,600;0,700;1,400&display=swap';
5
-
6
3
  html,
7
4
  body {
8
5
  font-family:
@@ -31,8 +28,8 @@ body {
31
28
  /** Fonts **/
32
29
  @font-face {
33
30
  font-family: DistinctDisplay;
34
- src: url('../fonts/Distinct-Display.woff') format('woff');
35
- src: url('../fonts/Distinct-Display.woff2') format('woff2');
31
+ src: url('@phillips/seldon/dist/fonts/Distinct-Display.woff') format('woff');
32
+ src: url('@phillips/seldon/dist/fonts/Distinct-Display.woff2') format('woff2');
36
33
  }
37
34
 
38
35
  @mixin DistinctDisplay {
@@ -42,8 +39,8 @@ body {
42
39
  @font-face {
43
40
  font-family: DistinctDisplay;
44
41
  font-style: italic;
45
- src: url('../fonts/Distinct-DisplayItalic.woff') format('woff');
46
- src: url('../fonts/Distinct-DisplayItalic.woff2') format('woff2');
42
+ src: url('@phillips/seldon/dist/fonts/Distinct-DisplayItalic.woff') format('woff');
43
+ src: url('@phillips/seldon/dist/fonts/Distinct-DisplayItalic.woff2') format('woff2');
47
44
  }
48
45
 
49
46
  @mixin DistinctDisplayItalic {
@@ -51,10 +48,21 @@ body {
51
48
  font-style: italic;
52
49
  }
53
50
 
51
+ /** Fonts **/
52
+ @font-face {
53
+ font-family: Montserrat;
54
+ src: url('@phillips/seldon/dist/fonts/Montserrat.woff') format('woff');
55
+ src: url('@phillips/seldon/dist/fonts/Montserrat.woff2') format('woff2');
56
+ }
57
+
58
+ @mixin Montserrat {
59
+ font-family: Montserrat, sans-serif;
60
+ }
61
+
54
62
  @font-face {
55
63
  font-family: Distinct;
56
- src: url('../fonts/Distinct-Text.woff') format('woff');
57
- src: url('../fonts/Distinct-Text.woff2') format('woff2');
64
+ src: url('@phillips/seldon/dist/fonts/Distinct-Text.woff') format('woff');
65
+ src: url('@phillips/seldon/dist/fonts/Distinct-Text.woff2') format('woff2');
58
66
  }
59
67
 
60
68
  @mixin DistinctText {
@@ -64,8 +72,8 @@ body {
64
72
  @font-face {
65
73
  font-family: Distinct;
66
74
  font-style: italic;
67
- src: url('../fonts/Distinct-Italic.woff') format('woff');
68
- src: url('../fonts/Distinct-Italic.woff2') format('woff2');
75
+ src: url('@phillips/seldon/dist/fonts/Distinct-Italic.woff') format('woff');
76
+ src: url('@phillips/seldon/dist/fonts/Distinct-Italic.woff2') format('woff2');
69
77
  }
70
78
 
71
79
  @mixin DistinctItalic {
@@ -72,7 +72,7 @@ $button: 'button';
72
72
  $cta-sm: 'cta-sm';
73
73
  $cta-lg: 'cta-lg';
74
74
  $email: 'email';
75
- $text: 'text';
75
+ $label: 'label';
76
76
  $text-badge: 'text-badge';
77
77
  $display0: 'display0';
78
78
  $display1: 'display1';
@@ -86,6 +86,8 @@ $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
91
 
90
92
  ////////////////////////
91
93
  /// FONT SIZE TOKENS:
@@ -1,3 +1,4 @@
1
+ @use 'sass:math';
1
2
  @import '../../_utils';
2
3
 
3
4
  @mixin gridItemColumnSpan($span: 1, $total-cols: 12) {
@@ -9,7 +10,8 @@
9
10
  }
10
11
 
11
12
  &-align-center {
12
- grid-column: calc((#{$total-cols} + 1 - #{$span}) / 2) / span #{$span};
13
+ grid-column: math.ceil(math.div($total-cols + 1 - $span, 2)) / span #{$span};
14
+ text-align: center;
13
15
  }
14
16
  }
15
17
 
@@ -20,14 +22,14 @@
20
22
 
21
23
  @for $i from 1 through 2 {
22
24
  &--span-xs-#{$i} {
23
- @include gridItemColumnSpan(#{$i}, 2);
25
+ @include gridItemColumnSpan($i, 2);
24
26
  }
25
27
  }
26
28
 
27
29
  @include media($breakpoint-sm) {
28
30
  @for $i from 1 through 4 {
29
31
  &--span-sm-#{$i} {
30
- @include gridItemColumnSpan(#{$i}, 4);
32
+ @include gridItemColumnSpan($i, 4);
31
33
  }
32
34
  }
33
35
  }
@@ -35,7 +37,7 @@
35
37
  @include media($breakpoint-md) {
36
38
  @for $i from 1 through 12 {
37
39
  &--span-md-#{$i} {
38
- @include gridItemColumnSpan(#{$i}, 12);
40
+ @include gridItemColumnSpan($i, 12);
39
41
  }
40
42
  }
41
43
  }
@@ -43,7 +45,7 @@
43
45
  @include media($breakpoint-lg) {
44
46
  @for $i from 1 through 12 {
45
47
  &--span-lg-#{$i} {
46
- @include gridItemColumnSpan(#{$i}, 12);
48
+ @include gridItemColumnSpan($i, 12);
47
49
  }
48
50
  }
49
51
  }
@@ -9,6 +9,7 @@
9
9
  display: flex;
10
10
  flex-flow: column;
11
11
  justify-content: center;
12
+ margin-bottom: $spacing-lg;
12
13
  min-height: 25rem;
13
14
  padding: 1rem;
14
15
  width: 100%;
@@ -0,0 +1,27 @@
1
+ @import '../../_vars';
2
+
3
+ .#{$px}-text {
4
+ @each $variant in $text-tokens {
5
+ &--#{$variant} {
6
+ @include text($variant);
7
+ }
8
+ }
9
+ }
10
+
11
+ h1.#{$px}-text,
12
+ blockquote.#{$px}-text {
13
+ margin-bottom: $spacing-xl;
14
+ }
15
+
16
+ h2.#{$px}-text {
17
+ margin-bottom: $spacing-lg;
18
+ }
19
+ h3.#{$px}-text {
20
+ margin-bottom: $spacing-md;
21
+ }
22
+ h4.#{$px}-text {
23
+ margin-bottom: $spacing-sm;
24
+ }
25
+ p.#{$px}-text {
26
+ margin-bottom: $spacing-md;
27
+ }
@@ -26,6 +26,7 @@
26
26
  @import 'components/Link/link';
27
27
  @import 'components/LinkBlock/linkBlock';
28
28
  @import 'components/LinkList/linkList';
29
+ @import 'components/Text/text';
29
30
 
30
31
  // 📑 Pages
31
32
  @import 'pages/page';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.21.0",
3
+ "version": "1.22.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -42,30 +42,30 @@
42
42
  "flatpickr": "^4.6.13"
43
43
  },
44
44
  "devDependencies": {
45
- "@chromatic-com/storybook": "^1.4.0",
45
+ "@chromatic-com/storybook": "^1.5.0",
46
46
  "@commitlint/cli": "^19.3.0",
47
47
  "@commitlint/config-conventional": "^19.2.2",
48
48
  "@figma/code-connect": "^0.1.2",
49
49
  "@semantic-release/changelog": "^6.0.3",
50
50
  "@semantic-release/git": "^10.0.1",
51
- "@semantic-release/github": "^10.0.4",
52
- "@storybook/addon-essentials": "^8.1.3",
53
- "@storybook/addon-interactions": "^8.1.1",
54
- "@storybook/addon-links": "^8.1.1",
55
- "@storybook/addon-mdx-gfm": "^8.1.3",
56
- "@storybook/blocks": "^8.1.1",
57
- "@storybook/react": "^8.1.1",
58
- "@storybook/react-vite": "^8.1.1",
59
- "@storybook/theming": "^8.1.3",
51
+ "@semantic-release/github": "^10.0.5",
52
+ "@storybook/addon-essentials": "^8.1.4",
53
+ "@storybook/addon-interactions": "^8.1.4",
54
+ "@storybook/addon-links": "^8.1.4",
55
+ "@storybook/addon-mdx-gfm": "^8.1.4",
56
+ "@storybook/blocks": "^8.1.4",
57
+ "@storybook/react": "^8.1.4",
58
+ "@storybook/react-vite": "^8.1.4",
59
+ "@storybook/theming": "^8.1.4",
60
60
  "@testing-library/jest-dom": "^6.4.5",
61
61
  "@testing-library/react": "^14.0.0",
62
62
  "@testing-library/user-event": "^14.5.2",
63
63
  "@types/color": "^3.0.6",
64
- "@types/react": "^18.3.2",
64
+ "@types/react": "^18.3.3",
65
65
  "@types/react-dom": "^18.0.11",
66
66
  "@typescript-eslint/eslint-plugin": "^5.62.0",
67
67
  "@typescript-eslint/parser": "^5.62.0",
68
- "@vitejs/plugin-react": "^4.2.1",
68
+ "@vitejs/plugin-react": "^4.3.0",
69
69
  "@vitest/coverage-v8": "^1.6.0",
70
70
  "color": "^4.2.3",
71
71
  "eslint": "^8.57.0",
@@ -82,15 +82,15 @@
82
82
  "rollup-plugin-peer-deps-external": "^2.2.4",
83
83
  "sass": "^1.77.2",
84
84
  "semantic-release": "^23.1.1",
85
- "storybook": "^8.1.1",
86
- "stylelint": "^16.5.0",
85
+ "storybook": "^8.1.4",
86
+ "stylelint": "^16.6.1",
87
87
  "stylelint-config-standard": "^36.0.0",
88
88
  "stylelint-config-standard-scss": "^13.1.0",
89
89
  "stylelint-order": "^6.0.4",
90
90
  "stylelint-scss": "^6.3.0",
91
91
  "ts-node": "^10.9.2",
92
92
  "typescript": "^5.4.5",
93
- "vite": "^5.2.11",
93
+ "vite": "^5.2.12",
94
94
  "vite-plugin-dts": "^2.3.0",
95
95
  "vite-plugin-svgr": "^4.2.0",
96
96
  "vite-tsconfig-paths": "^4.3.2",