@phillips/seldon 1.19.3 → 1.20.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.
Files changed (31) hide show
  1. package/dist/components/Grid/Grid.d.ts +2 -6
  2. package/dist/components/Grid/Grid.js +10 -19
  3. package/dist/components/GridItem/GridItem.d.ts +29 -0
  4. package/dist/components/GridItem/GridItem.js +31 -0
  5. package/dist/components/GridItem/gridItemUtils.d.ts +4 -0
  6. package/dist/components/GridItem/gridItemUtils.js +16 -0
  7. package/dist/components/GridItem/types.d.ts +5 -0
  8. package/dist/components/GridItem/types.js +4 -0
  9. package/dist/components/LinkBlock/LinkBlock.d.ts +1 -1
  10. package/dist/components/LinkList/LinkList.d.ts +1 -1
  11. package/dist/components/Row/Row.d.ts +27 -0
  12. package/dist/components/Row/Row.js +31 -0
  13. package/dist/index.d.ts +3 -0
  14. package/dist/index.js +30 -24
  15. package/dist/scss/_sharedClasses.scss +10 -0
  16. package/dist/scss/_utils.scss +39 -4
  17. package/dist/scss/_vars.scss +21 -18
  18. package/dist/scss/components/Button/_button.scss +1 -1
  19. package/dist/scss/components/Footer/_footer.scss +7 -7
  20. package/dist/scss/components/Grid/_grid.scss +2 -2
  21. package/dist/scss/components/GridItem/_gridItem.scss +50 -0
  22. package/dist/scss/components/LinkList/_linkList.scss +1 -1
  23. package/dist/scss/components/Row/_row.scss +7 -0
  24. package/dist/scss/components/Social/_social.scss +1 -1
  25. package/dist/scss/components/SplitPanel/_splitPanel.scss +2 -6
  26. package/dist/scss/components/SplitPanel/_splitPanel.stories.scss +1 -1
  27. package/dist/scss/components/Subscribe/_subscribe.scss +2 -2
  28. package/dist/scss/styles.scss +3 -0
  29. package/dist/utils/index.d.ts +8 -0
  30. package/dist/utils/index.js +22 -19
  31. package/package.json +16 -17
@@ -4,13 +4,9 @@ export interface GridProps extends React.HTMLAttributes<HTMLElement> {
4
4
  */
5
5
  children: React.ReactNode;
6
6
  /**
7
- * Optional element to render in place of a button e.g. 'div', 'span', CustomComponent, etc
7
+ * Optional element to render as the top-level component e.g. 'div', 'span', CustomComponent, etc. Defaults to 'section'.
8
8
  */
9
9
  element?: React.ElementType<GridProps>;
10
- /**
11
- * Optional boolean to dictate if the grid has left and right margins
12
- */
13
- hasMargins?: boolean;
14
10
  }
15
- export declare function Grid({ children, className, element: Element, hasMargins, id, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Grid({ children, className, element: Element, id, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
16
12
  export default Grid;
@@ -1,28 +1,19 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import m from "../../node_modules/classnames/index.js";
3
- import { px as t } from "../../utils/index.js";
4
- function g({
5
- children: e,
6
- className: n,
7
- element: a = "section",
8
- hasMargins: i = !0,
9
- id: r,
10
- ...o
11
- }) {
12
- return /* @__PURE__ */ s(
13
- a,
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import i from "../../node_modules/classnames/index.js";
3
+ import { px as m } from "../../utils/index.js";
4
+ function f({ children: t, className: e, element: n = "section", id: r, ...o }) {
5
+ return /* @__PURE__ */ a(
6
+ n,
14
7
  {
15
8
  "data-testid": r ? `grid-container-${r}` : "grid-container",
16
9
  id: r,
17
- className: m(`${t}-grid__container`, n, {
18
- [`${t}-grid__container--has-margins`]: i
19
- }),
10
+ className: i(`${m}-grid__container`, e),
20
11
  ...o,
21
- children: e
12
+ children: t
22
13
  }
23
14
  );
24
15
  }
25
16
  export {
26
- g as Grid,
27
- g as default
17
+ f as Grid,
18
+ f as default
28
19
  };
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { GridItemAlign } from './types';
3
+ export interface GridItemProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /**
5
+ * Alignment defaults to 'center'
6
+ */
7
+ align?: GridItemAlign;
8
+ /**
9
+ * column spans at different breakpoints, defaults to all columns. If less than the total number of columns at the breakpoint it will be centered.
10
+ */
11
+ xs?: number;
12
+ sm?: number;
13
+ md?: number;
14
+ lg?: number;
15
+ /**
16
+ * Optional element to render as the top-level component e.g. 'div', 'span', CustomComponent, etc. Defaults to 'div'.
17
+ */
18
+ element?: React.ElementType;
19
+ }
20
+ /**
21
+ * ## Overview
22
+ *
23
+ * This item can be placed in a Grid and appropriately sized for the current breakpoint. It can also be aligned within the grid cell.
24
+ * If you center multiple GridItems in a Grid, they will wrap to the next line and be centered on that line.
25
+ *
26
+ * [Figma Link](https://www.figma.com/design/Hp2FyltbOmRxTuw9kSwBAd/EPIC-About-Us?node-id=912-5904&t=WzvEYp5zbnGnRFUf-4)
27
+ */
28
+ declare const GridItem: ({ children, xs, sm, md, lg, align, id, element: Element, className, ...props }: GridItemProps) => import("react/jsx-runtime").JSX.Element | null;
29
+ export default GridItem;
@@ -0,0 +1,31 @@
1
+ import { jsx as I } from "react/jsx-runtime";
2
+ import { useMemo as a } from "react";
3
+ import { px as g } from "../../utils/index.js";
4
+ import j from "../../node_modules/classnames/index.js";
5
+ import { determineColumnSpanClassName as v, validateColumnSpans as S } from "./gridItemUtils.js";
6
+ import { GridItemAlign as b } from "./types.js";
7
+ const B = ({
8
+ children: p,
9
+ xs: r = 2,
10
+ sm: m = 4,
11
+ md: o = 12,
12
+ lg: i = 12,
13
+ align: n = b.center,
14
+ id: e,
15
+ element: d = "div",
16
+ className: s,
17
+ ...l
18
+ }) => {
19
+ const u = e ? `grid-item-${e}` : "grid-item", t = a(() => ({ xs: r, sm: m, md: o, lg: i }), [r, m, o, i]), c = a(() => [
20
+ `${g}-grid-item`,
21
+ // figure out the class names for each breakpoint
22
+ Object.entries(t).map(
23
+ ([f, C]) => v(f, C, n)
24
+ ),
25
+ s
26
+ ], [n, t, s]);
27
+ return S(Object.values(t)) ? /* @__PURE__ */ I(d, { ...l, "data-testid": u, id: e, className: j(c), children: p }) : null;
28
+ };
29
+ export {
30
+ B as default
31
+ };
@@ -0,0 +1,4 @@
1
+ import { GridItemProps } from './GridItem';
2
+ import { GridItemAlign } from './types';
3
+ export declare const determineColumnSpanClassName: (breakpoint: GridItemAlign, columnSpan: number, align?: GridItemProps['align']) => string;
4
+ export declare const validateColumnSpans: (columnSpans: number[]) => boolean;
@@ -0,0 +1,16 @@
1
+ import { px as n } from "../../utils/index.js";
2
+ import { GridItemAlign as s } from "./types.js";
3
+ const l = (r, e, t = s.center) => `${n}-grid-item--span-${r}-${e} ${n}-grid-item--span-${r}-${e}-align-${t}`, i = (r) => {
4
+ for (let e = 0; e < r.length; e++) {
5
+ const t = r[e];
6
+ if (t > 12)
7
+ return console.warn("Column spans must be less than or equal to 12"), !1;
8
+ if (t < 1)
9
+ return console.warn("Column spans must be greater than or equal to 1"), !1;
10
+ }
11
+ return !0;
12
+ };
13
+ export {
14
+ l as determineColumnSpanClassName,
15
+ i as validateColumnSpans
16
+ };
@@ -0,0 +1,5 @@
1
+ export declare enum GridItemAlign {
2
+ center = "center",
3
+ left = "left",
4
+ right = "right"
5
+ }
@@ -0,0 +1,4 @@
1
+ var r = /* @__PURE__ */ ((e) => (e.center = "center", e.left = "left", e.right = "right", e))(r || {});
2
+ export {
3
+ r as GridItemAlign
4
+ };
@@ -3,7 +3,7 @@ export interface LinkBlockProps extends React.HTMLAttributes<HTMLDivElement> {
3
3
  /** Props for the Link component */
4
4
  linkProps: Omit<LinkProps, 'variant'>;
5
5
  /** Renders description under link */
6
- description: string;
6
+ description: React.ReactNode;
7
7
  }
8
8
  /**
9
9
  * ## Overview
@@ -7,7 +7,7 @@ export interface LinkListProps extends React.HTMLAttributes<HTMLUListElement> {
7
7
  /**
8
8
  * ## Overview
9
9
  *
10
- * The LinkList component is used to display a list of LinkBlocks in a 3 column list on some breakpoints and 1 column list on others. Because of the 3 column design, the set of LinkBlocks should be divisible by 3.
10
+ * The LinkList component is used to display a list of LinkBlocks in a 3 column list on some breakpoints and 1 column list on others.
11
11
  *
12
12
  * [Figma Link](https://www.figma.com/file/xMuOXOAKVt5HC7hgYjF3ot/Components-v2.0?type=design&node-id=5709-8035&mode=design&t=jOnrmrqnE8lCQvGR-4)
13
13
  */
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { PaddingTokens } from '../../utils';
3
+ import GridItem, { GridItemProps } from '../GridItem/GridItem';
4
+ export interface RowProps extends React.HTMLAttributes<HTMLElement> {
5
+ /** These children can be an array of GridItem components */
6
+ children: React.ReactElement<GridItemProps, typeof GridItem> | React.ReactElement<GridItemProps, typeof GridItem>[];
7
+ /**
8
+ * Optional element to render as the top-level component e.g. 'div', 'span', CustomComponent, etc. Defaults to 'section'.
9
+ */
10
+ element?: React.ElementType;
11
+ /**
12
+ * Optional padding override for the row. Defaults to `lg`. Horizontal padding is fixed for Row components at `lg`
13
+ */
14
+ padding?: {
15
+ top: PaddingTokens;
16
+ bottom: PaddingTokens;
17
+ };
18
+ }
19
+ /**
20
+ * ## Overview
21
+ *
22
+ * A page will usually contain multiple Rows. The Row component will apply paddings to the contents within it. Usually a Grid will be rendered within a Row to align to the grid, but other elements are supported.
23
+ *
24
+ * [Figma Link](https://www.figma.com/design/Hp2FyltbOmRxTuw9kSwBAd/EPIC-About-Us?node-id=912-5904&t=WzvEYp5zbnGnRFUf-4)
25
+ */
26
+ declare const Row: ({ children, id, element: CustomElement, padding, className, ...props }: RowProps) => import("react/jsx-runtime").JSX.Element;
27
+ export default Row;
@@ -0,0 +1,31 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { generatePaddingClassName as e, PaddingTokens as s, px as b } from "../../utils/index.js";
3
+ import f from "../../node_modules/classnames/index.js";
4
+ const d = ({
5
+ children: a,
6
+ id: o,
7
+ element: m,
8
+ padding: t = { top: s.lg, bottom: s.lg },
9
+ className: n,
10
+ ...r
11
+ }) => {
12
+ const l = o ? `row-${o}` : "row", c = `${b}-row`;
13
+ return /* @__PURE__ */ p(
14
+ m || "section",
15
+ {
16
+ ...r,
17
+ "data-testid": l,
18
+ id: o,
19
+ className: f(
20
+ c,
21
+ t.top && e(t.top, "start"),
22
+ t.bottom && e(t.bottom, "end"),
23
+ n
24
+ ),
25
+ children: a
26
+ }
27
+ );
28
+ };
29
+ export {
30
+ d as default
31
+ };
package/dist/index.d.ts CHANGED
@@ -9,6 +9,9 @@ export { default as Link, type LinkProps } from './components/Link/Link';
9
9
  export { LinkVariants } from './components/Link/utils';
10
10
  export { default as LinkBlock, type LinkBlockProps } from './components/LinkBlock/LinkBlock';
11
11
  export { default as LinkList, type LinkListProps } from './components/LinkList/LinkList';
12
+ export { default as Row, type RowProps } from './components/Row/Row';
13
+ export { default as GridItem, type GridItemProps } from './components/GridItem/GridItem';
14
+ export { GridItemAlign } from './components/GridItem/types';
12
15
  export { default as Select, type SelectProps } from './components/Select/Select';
13
16
  export { default as SplitPanel, type SplitPanelProps } from './components/SplitPanel/SplitPanel';
14
17
  export { default as Subscribe, type SubscribeProps } from './components/Subscribe/Subscribe';
package/dist/index.js CHANGED
@@ -1,38 +1,44 @@
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 s } from "./components/Footer/Footer.js";
4
- import { Grid as u } from "./components/Grid/Grid.js";
5
- import { default as d } from "./components/Header/Header.js";
3
+ import { default as l } from "./components/Footer/Footer.js";
4
+ import { Grid as d } from "./components/Grid/Grid.js";
5
+ import { default as p } from "./components/Header/Header.js";
6
6
  import { default as x } 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
9
  import { LinkVariants as c } from "./components/Link/utils.js";
10
- import { default as g } from "./components/LinkBlock/LinkBlock.js";
11
- import { default as b } from "./components/LinkList/LinkList.js";
12
- import { default as H } from "./components/Select/Select.js";
13
- import { default as y } from "./components/SplitPanel/SplitPanel.js";
14
- import { default as F } from "./components/Subscribe/Subscribe.js";
15
- import { default as I } from "./components/Social/Social.js";
16
- import { default as j } from "./components/ViewingsList/ViewingsList.js";
17
- import { default as v } from "./components/ViewingsList/StatefulViewingsList.js";
18
- import { default as A } from "./pages/Page.js";
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";
19
22
  export {
20
23
  t as Button,
21
24
  a as ErrorBoundary,
22
- s as Footer,
23
- u as Grid,
24
- d as Header,
25
+ l as Footer,
26
+ d as Grid,
27
+ H as GridItem,
28
+ y as GridItemAlign,
29
+ p as Header,
25
30
  x as HeroBanner,
26
31
  n as Input,
27
32
  k as Link,
28
- g as LinkBlock,
29
- b as LinkList,
33
+ B as LinkBlock,
34
+ G as LinkList,
30
35
  c as LinkVariants,
31
- A as Page,
32
- H as Select,
33
- I as Social,
34
- y as SplitPanel,
35
- v as StatefulViewingsList,
36
- F as Subscribe,
37
- j as ViewingsList
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
38
44
  };
@@ -0,0 +1,10 @@
1
+ @import './_utils';
2
+
3
+ // I think this is pretty tailwindy to generate these common classes
4
+ @each $direction in 'vertical', 'horizontal' {
5
+ @each $padding in $padding-tokens {
6
+ @each $side in 'start', 'end', 'both' {
7
+ @include padding($padding, $direction, $side);
8
+ }
9
+ }
10
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:string';
1
2
  @import './vars';
2
3
 
3
4
  @mixin hidden {
@@ -40,10 +41,10 @@
40
41
  }
41
42
 
42
43
  @mixin gridMargins {
43
- margin: 0 $spacing-medium;
44
+ margin: 0 $spacing-md;
44
45
 
45
46
  @media (min-width: $breakpoint3) {
46
- margin: 0 $spacing-large;
47
+ margin: 0 $spacing-lg;
47
48
  }
48
49
 
49
50
  @media (min-width: $breakpoint4) {
@@ -53,7 +54,7 @@
53
54
 
54
55
  @mixin grid($columns: 2, $margins-on: true) {
55
56
  display: grid;
56
- gap: $spacing-medium;
57
+ gap: $spacing-md;
57
58
  grid-template-columns: repeat($columns, 1fr);
58
59
 
59
60
  @if $margins-on {
@@ -63,7 +64,7 @@
63
64
 
64
65
  @mixin gridContainer($margins-on: true) {
65
66
  display: grid;
66
- gap: $spacing-medium;
67
+ gap: $spacing-md;
67
68
  grid-template-columns: repeat(2, 1fr);
68
69
 
69
70
  @media (min-width: $breakpoint2) {
@@ -126,3 +127,37 @@
126
127
  }
127
128
  }
128
129
  }
130
+
131
+ // prepends the parent class name to the child class name for BEM
132
+ @mixin padding($padding: $padding-lg, $direction: 'all', $side: 'both') {
133
+ $parsed-padding: string.slice(#{$padding}, 15, -2); // Parse the padding value by removing "-var(--spacing-" and ")".
134
+
135
+ .#{$px}-padding-#{$direction}-#{$parsed-padding}-#{$side} {
136
+ // Use the parsed padding value.
137
+ @if $direction == 'all' {
138
+ @if $side == 'both' {
139
+ padding: $padding;
140
+ }
141
+ }
142
+
143
+ @if $direction == 'vertical' {
144
+ @if $side == 'start' or $side == 'both' {
145
+ padding-top: $padding;
146
+ }
147
+
148
+ @if $side == 'end' or $side == 'both' {
149
+ padding-bottom: $padding;
150
+ }
151
+ }
152
+
153
+ @if $direction == 'horizontal' {
154
+ @if $side == 'start' or $side == 'both' {
155
+ padding-left: $padding;
156
+ }
157
+
158
+ @if $side == 'end' or $side == 'both' {
159
+ padding-right: $padding;
160
+ }
161
+ }
162
+ }
163
+ }
@@ -165,51 +165,52 @@ $text-badge-label-size: var(--label-size3);
165
165
  :root {
166
166
  --spacing-micro: 0.25rem;
167
167
  --spacing-xsm: 0.5rem;
168
- --spacing-small: 1rem;
169
- --spacing-medium: 2rem;
170
- --spacing-large: 3rem;
168
+ --spacing-sm: 1rem;
169
+ --spacing-md: 2rem;
170
+ --spacing-lg: 3rem;
171
171
  --spacing-xl: 6rem;
172
172
 
173
173
  @media (max-width: 960px) {
174
174
  --spacing-micro: 0.19rem;
175
175
  --spacing-xsm: 0.38rem;
176
- --spacing-small: 0.75rem;
177
- --spacing-medium: 1.5rem;
178
- --spacing-large: 2.25rem;
176
+ --spacing-sm: 0.75rem;
177
+ --spacing-md: 1.5rem;
178
+ --spacing-lg: 2.25rem;
179
179
  --spacing-xl: 4.8rem;
180
180
  }
181
181
 
182
182
  @media (min-width: 1801px) {
183
183
  --spacing-micro: 0.31rem;
184
184
  --spacing-xsm: 0.63rem;
185
- --spacing-small: 1.25rem;
186
- --spacing-medium: 2.5rem;
187
- --spacing-large: 3.75rem;
185
+ --spacing-sm: 1.25rem;
186
+ --spacing-md: 2.5rem;
187
+ --spacing-lg: 3.75rem;
188
188
  --spacing-xl: 7.5rem;
189
189
  }
190
190
  }
191
191
 
192
192
  $spacing-micro: var(--spacing-micro);
193
193
  $spacing-xsm: var(--spacing-xsm);
194
- $spacing-small: var(--spacing-small);
195
- $spacing-medium: var(--spacing-medium);
196
- $spacing-large: var(--spacing-large);
194
+ $spacing-sm: var(--spacing-sm);
195
+ $spacing-md: var(--spacing-md);
196
+ $spacing-lg: var(--spacing-lg);
197
197
  $spacing-xl: var(--spacing-xl);
198
198
 
199
199
  // PADDING
200
200
  $padding-micro: var(--spacing-micro);
201
201
  $padding-xsm: var(--spacing-xsm);
202
- $padding-small: var(--spacing-small);
203
- $padding-medium: var(--spacing-medium);
204
- $padding-large: var(--spacing-large);
202
+ $padding-sm: var(--spacing-sm);
203
+ $padding-md: var(--spacing-md);
204
+ $padding-lg: var(--spacing-lg);
205
205
  $padding-xl: var(--spacing-xl);
206
+ $padding-tokens: $padding-micro, $padding-xsm, $padding-sm, $padding-md, $padding-lg, $padding-xl;
206
207
 
207
208
  // MARGIN
208
209
  $margin-micro: var(--spacing-micro);
209
210
  $margin-xsm: var(--spacing-xsm);
210
- $margin-small: var(--spacing-small);
211
- $margin-medium: var(--spacing-medium);
212
- $margin-large: var(--spacing-large);
211
+ $margin-sm: var(--spacing-sm);
212
+ $margin-md: var(--spacing-md);
213
+ $margin-lg: var(--spacing-lg);
213
214
  $margin-xl: var(--spacing-xl);
214
215
 
215
216
  ////////////////////////
@@ -229,6 +230,8 @@ $max-site-width: 1560px;
229
230
  /// Media breakpoint tokens:
230
231
  ///////////////////////////
231
232
 
233
+ $breakpoint-xs: 'xs';
232
234
  $breakpoint-sm: 'sm';
233
235
  $breakpoint-md: 'md';
234
236
  $breakpoint-lg: 'lg';
237
+ $breakpoint-xl: 'xl';
@@ -14,7 +14,7 @@
14
14
  display: inline-flex;
15
15
  justify-content: center;
16
16
  min-width: 3rem;
17
- padding: 0.5em $spacing-medium;
17
+ padding: 0.5em $spacing-md;
18
18
  transition:
19
19
  color 0.25s,
20
20
  background-color 0.25s,
@@ -15,21 +15,21 @@
15
15
 
16
16
  &__navigation {
17
17
  background-color: $white;
18
- padding: $spacing-medium $spacing-medium $spacing-small;
18
+ padding: $spacing-md $spacing-md $spacing-sm;
19
19
  text-align: right;
20
20
 
21
21
  @include media($breakpoint-md) {
22
- padding: $spacing-medium $spacing-large $spacing-small;
22
+ padding: $spacing-md $spacing-lg $spacing-sm;
23
23
  }
24
24
 
25
25
  @include media($breakpoint-lg) {
26
- padding: $spacing-medium $spacing-xl $spacing-small;
26
+ padding: $spacing-md $spacing-xl $spacing-sm;
27
27
  }
28
28
 
29
29
  ul {
30
30
  display: inline-flex;
31
31
  flex-wrap: wrap;
32
- gap: $spacing-medium;
32
+ gap: $spacing-md;
33
33
  justify-content: center;
34
34
  list-style: none;
35
35
  padding: 0;
@@ -48,7 +48,7 @@
48
48
  align-items: center;
49
49
  display: flex;
50
50
  flex-direction: column;
51
- padding: $spacing-large $spacing-medium 0;
51
+ padding: $spacing-lg $spacing-md 0;
52
52
 
53
53
  @include media($breakpoint-sm) {
54
54
  align-items: flex-start;
@@ -57,7 +57,7 @@
57
57
  }
58
58
 
59
59
  @include media($breakpoint-md) {
60
- padding: 3.75rem $spacing-large;
60
+ padding: 3.75rem $spacing-lg;
61
61
  }
62
62
 
63
63
  @include media($breakpoint-lg) {
@@ -66,7 +66,7 @@
66
66
  }
67
67
 
68
68
  &__content-split-panel__left {
69
- margin-bottom: $spacing-medium;
69
+ margin-bottom: $spacing-md;
70
70
 
71
71
  @include media($breakpoint-sm) {
72
72
  margin-bottom: 0;
@@ -7,10 +7,10 @@
7
7
  }
8
8
 
9
9
  &__container--has-margins {
10
- margin: 0 $spacing-medium;
10
+ margin: 0 $spacing-md;
11
11
 
12
12
  @media (min-width: 1401px) {
13
- margin: 0 $spacing-large;
13
+ margin: 0 $spacing-lg;
14
14
  }
15
15
 
16
16
  @media (min-width: 1801px) {
@@ -0,0 +1,50 @@
1
+ @import '../../_utils';
2
+
3
+ @mixin gridItemColumnSpan($span: 1, $total-cols: 12) {
4
+ grid-column: span $span;
5
+
6
+ &-align-right {
7
+ grid-column-end: $total-cols + 1;
8
+ justify-self: end;
9
+ }
10
+
11
+ &-align-center {
12
+ grid-column: calc((#{$total-cols} + 1 - #{$span}) / 2) / span #{$span};
13
+ }
14
+ }
15
+
16
+ .#{$px}-grid-item {
17
+ justify-self: center;
18
+ text-align: center;
19
+ width: 100%;
20
+
21
+ @for $i from 1 through 2 {
22
+ &--span-xs-#{$i} {
23
+ @include gridItemColumnSpan(#{$i}, 2);
24
+ }
25
+ }
26
+
27
+ @include media($breakpoint-sm) {
28
+ @for $i from 1 through 4 {
29
+ &--span-sm-#{$i} {
30
+ @include gridItemColumnSpan(#{$i}, 4);
31
+ }
32
+ }
33
+ }
34
+
35
+ @include media($breakpoint-md) {
36
+ @for $i from 1 through 12 {
37
+ &--span-md-#{$i} {
38
+ @include gridItemColumnSpan(#{$i}, 12);
39
+ }
40
+ }
41
+ }
42
+
43
+ @include media($breakpoint-lg) {
44
+ @for $i from 1 through 12 {
45
+ &--span-lg-#{$i} {
46
+ @include gridItemColumnSpan(#{$i}, 12);
47
+ }
48
+ }
49
+ }
50
+ }
@@ -5,7 +5,7 @@
5
5
  // mobile first
6
6
  grid-column: span 2;
7
7
 
8
- @include media($breakpoint-sm) {
8
+ @include media($breakpoint-md) {
9
9
  grid-column: span 4;
10
10
  }
11
11
  }
@@ -0,0 +1,7 @@
1
+ @import '../../_vars';
2
+
3
+ .#{$px}-row {
4
+ // horizontal padding is fixed
5
+ padding-left: $spacing-lg;
6
+ padding-right: $spacing-lg;
7
+ }
@@ -22,7 +22,7 @@
22
22
  display: flex;
23
23
  gap: 0 1.25rem;
24
24
  list-style: none;
25
- margin: 0 0 $spacing-medium;
25
+ margin: 0 0 $spacing-md;
26
26
  padding: 0;
27
27
 
28
28
  @include media($breakpoint-sm) {
@@ -5,11 +5,7 @@
5
5
  align-items: center;
6
6
  display: flex;
7
7
  flex-direction: column;
8
- gap: $spacing-medium;
9
-
10
- &:not(.#{$px}-split-panel--borderless) {
11
- padding: 2.5rem $spacing-medium;
12
- }
8
+ gap: $spacing-md;
13
9
 
14
10
  > * {
15
11
  flex: 1 1 0px;
@@ -26,7 +22,7 @@
26
22
 
27
23
  & > :not(:last-child) {
28
24
  border-right: 1px solid $medium-gray;
29
- padding-right: $spacing-medium;
25
+ padding-right: $spacing-md;
30
26
  }
31
27
 
32
28
  &--borderless {
@@ -13,6 +13,6 @@
13
13
  }
14
14
 
15
15
  & .split-panel-story__text:not(:last-child) {
16
- margin-bottom: $spacing-medium;
16
+ margin-bottom: $spacing-md;
17
17
  }
18
18
  }
@@ -28,10 +28,10 @@
28
28
 
29
29
  &__blurb,
30
30
  .#{$px}-input__input {
31
- margin-bottom: $spacing-medium;
31
+ margin-bottom: $spacing-md;
32
32
  }
33
33
 
34
34
  &__button {
35
- margin: 0 0 $spacing-medium;
35
+ margin: 0 0 $spacing-md;
36
36
  }
37
37
  }
@@ -5,6 +5,7 @@
5
5
 
6
6
  // @use 'reset';
7
7
  @import './typography';
8
+ @import './sharedClasses';
8
9
 
9
10
  // ⚛️ Components
10
11
  @import 'components/Button/button';
@@ -15,6 +16,8 @@
15
16
  @import 'components/Header/header';
16
17
  @import 'components/HeroBanner/heroBanner';
17
18
  @import 'components/Input/input';
19
+ @import 'components/Row/row';
20
+ @import 'components/GridItem/gridItem';
18
21
  @import 'components/Social/social';
19
22
  @import 'components/SplitPanel/splitPanel';
20
23
  @import 'components/Subscribe/subscribe';
@@ -1,5 +1,12 @@
1
1
  import * as React from 'react';
2
2
  export declare const px = "phillips";
3
+ export declare enum PaddingTokens {
4
+ xs = "xs",
5
+ sm = "sm",
6
+ md = "md",
7
+ lg = "lg",
8
+ xl = "xl"
9
+ }
3
10
  export declare const noOp: () => void;
4
11
  export interface CommonProps {
5
12
  /**
@@ -65,4 +72,5 @@ interface NormalizedProps {
65
72
  */
66
73
  export declare function useNormalizedInputProps({ disabled, id, invalid, invalidText, readOnly, type, warn, warnText, }: InputProps): NormalizedProps;
67
74
  export declare const defaultYear: number;
75
+ export declare const generatePaddingClassName: (padding: PaddingTokens, side?: 'start' | 'end', direction?: 'vertical' | 'horizontal') => string;
68
76
  export {};
@@ -1,29 +1,32 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- const n = "phillips";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ const l = "phillips";
3
+ var m = /* @__PURE__ */ ((a) => (a.xs = "xs", a.sm = "sm", a.md = "md", a.lg = "lg", a.xl = "xl", a))(m || {});
3
4
  function c({
4
- disabled: l = !1,
5
- id: o,
6
- invalid: t = !1,
7
- invalidText: e = "invalid",
8
- readOnly: r = !1,
9
- type: a,
10
- warn: s = !1,
5
+ disabled: a = !1,
6
+ id: n,
7
+ invalid: r = !1,
8
+ invalidText: d = "invalid",
9
+ readOnly: e = !1,
10
+ type: t,
11
+ warn: o = !1,
11
12
  warnText: v
12
13
  }) {
13
14
  const i = {
14
- disabled: !r && l,
15
- invalid: !r && !l && t,
16
- invalidId: `${o}-error-msg`,
17
- type: a === "toggle" ? "checkbox" : a,
18
- warn: !r && !l && !t && s,
19
- warnId: `${o}-warn-msg`,
15
+ disabled: !e && a,
16
+ invalid: !e && !a && r,
17
+ invalidId: `${n}-error-msg`,
18
+ type: t === "toggle" ? "checkbox" : t,
19
+ warn: !e && !a && !r && o,
20
+ warnId: `${n}-warn-msg`,
20
21
  validation: null
21
22
  };
22
- return i.invalid && (i.validation = /* @__PURE__ */ d("div", { className: `${n}-input__validation ${n}-${a}-input--invalid`, id: i.invalidId, children: e })), i.warn && (i.validation = /* @__PURE__ */ d("div", { className: `${n}-input__validation ${n}-${a}-input--warn`, id: i.warnId, children: v })), i;
23
+ return i.invalid && (i.validation = /* @__PURE__ */ s("div", { className: `${l}-input__validation ${l}-${t}-input--invalid`, id: i.invalidId, children: d })), i.warn && (i.validation = /* @__PURE__ */ s("div", { className: `${l}-input__validation ${l}-${t}-input--warn`, id: i.warnId, children: v })), i;
23
24
  }
24
- const p = (/* @__PURE__ */ new Date()).getFullYear();
25
+ const $ = (/* @__PURE__ */ new Date()).getFullYear(), p = (a, n = "end", r = "vertical") => `${l}-padding-${r}-${a}-${n}`;
25
26
  export {
26
- p as defaultYear,
27
- n as px,
27
+ m as PaddingTokens,
28
+ $ as defaultYear,
29
+ p as generatePaddingClassName,
30
+ l as px,
28
31
  c as useNormalizedInputProps
29
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.19.3",
3
+ "version": "1.20.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -25,14 +25,15 @@
25
25
  ],
26
26
  "scripts": {
27
27
  "start": "storybook dev -p 6006",
28
- "test": "jest",
28
+ "test": "vitest",
29
+ "coverage": "vitest run --coverage",
29
30
  "build": "npm run clean && tsc && vite build",
30
31
  "build:storybook": "storybook build",
31
32
  "preview": "npx http-server storybook-static",
32
33
  "clean": "rimraf './dist'",
33
34
  "clean:stories": "rimraf './storybook-static'",
34
35
  "format": "prettier . --write",
35
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 && npm run lint:styles",
36
+ "lint": "tsc && eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 && npm run lint:styles",
36
37
  "lint:styles": "stylelint \"src/**/*.scss\" --fix",
37
38
  "prepare": "husky install"
38
39
  },
@@ -43,35 +44,33 @@
43
44
  "devDependencies": {
44
45
  "@commitlint/cli": "^19.3.0",
45
46
  "@commitlint/config-conventional": "^19.2.2",
46
- "@figma/code-connect": "^0.1.1",
47
+ "@figma/code-connect": "^0.1.2",
47
48
  "@semantic-release/changelog": "^6.0.3",
48
49
  "@semantic-release/git": "^10.0.1",
49
50
  "@semantic-release/github": "^10.0.3",
50
51
  "@storybook/addon-essentials": "^7.6.18",
51
- "@storybook/addon-interactions": "^7.0.22",
52
+ "@storybook/addon-interactions": "^7.6.19",
52
53
  "@storybook/addon-links": "^7.6.19",
53
54
  "@storybook/addon-styling": "^1.3.7",
54
- "@storybook/blocks": "^7.0.22",
55
+ "@storybook/blocks": "^7.6.19",
55
56
  "@storybook/react": "^7.0.22",
56
57
  "@storybook/react-vite": "^7.6.19",
57
- "@testing-library/jest-dom": "^5.17.0",
58
+ "@testing-library/jest-dom": "^6.4.5",
58
59
  "@testing-library/react": "^14.0.0",
59
60
  "@testing-library/user-event": "^14.5.2",
60
61
  "@types/color": "^3.0.6",
61
- "@types/jest": "^29.5.12",
62
62
  "@types/react": "^18.3.2",
63
63
  "@types/react-dom": "^18.0.11",
64
- "@typescript-eslint/eslint-plugin": "^5.59.0",
64
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
65
65
  "@typescript-eslint/parser": "^5.62.0",
66
66
  "@vitejs/plugin-react": "^4.2.1",
67
+ "@vitest/coverage-v8": "^1.6.0",
67
68
  "color": "^4.2.3",
68
69
  "eslint": "^8.57.0",
69
70
  "eslint-plugin-react-hooks": "^4.6.2",
70
71
  "eslint-plugin-react-refresh": "^0.4.7",
71
72
  "eslint-plugin-storybook": "^0.8.0",
72
73
  "husky": "^9.0.11",
73
- "jest": "^29.7.0",
74
- "jest-environment-jsdom": "^29.6.1",
75
74
  "prettier": "3.2.5",
76
75
  "react": "^18.3.1",
77
76
  "react-docgen-typescript": "^2.2.2",
@@ -80,20 +79,20 @@
80
79
  "rollup-plugin-copy": "^3.5.0",
81
80
  "rollup-plugin-peer-deps-external": "^2.2.4",
82
81
  "sass": "^1.77.0",
83
- "semantic-release": "^23.0.8",
82
+ "semantic-release": "^23.1.1",
84
83
  "storybook": "^7.6.19",
85
84
  "stylelint": "^16.4.0",
86
85
  "stylelint-config-standard": "^36.0.0",
87
86
  "stylelint-config-standard-scss": "^13.1.0",
88
87
  "stylelint-order": "^6.0.4",
89
- "stylelint-scss": "^6.2.1",
90
- "ts-jest": "^29.1.2",
88
+ "stylelint-scss": "^6.3.0",
91
89
  "ts-node": "^10.9.2",
92
- "typescript": "^5.0.2",
93
- "vite": "^4.5.3",
90
+ "typescript": "^5.4.5",
91
+ "vite": "^5.2.11",
94
92
  "vite-plugin-dts": "^2.3.0",
95
93
  "vite-plugin-svgr": "^4.2.0",
96
- "vite-tsconfig-paths": "^4.3.2"
94
+ "vite-tsconfig-paths": "^4.3.2",
95
+ "vitest": "^1.6.0"
97
96
  },
98
97
  "peerDependencies": {
99
98
  "react": "^18.3.1",