@phillips/seldon 1.19.2 → 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.
- package/dist/components/ErrorBoundary/ErrorBoundary.js +10 -11
- package/dist/components/Grid/Grid.d.ts +2 -6
- package/dist/components/Grid/Grid.js +10 -19
- package/dist/components/GridItem/GridItem.d.ts +29 -0
- package/dist/components/GridItem/GridItem.js +31 -0
- package/dist/components/GridItem/gridItemUtils.d.ts +4 -0
- package/dist/components/GridItem/gridItemUtils.js +16 -0
- package/dist/components/GridItem/types.d.ts +5 -0
- package/dist/components/GridItem/types.js +4 -0
- package/dist/components/LinkBlock/LinkBlock.d.ts +1 -1
- package/dist/components/LinkBlock/LinkBlock.js +10 -9
- package/dist/components/LinkList/LinkList.d.ts +1 -1
- package/dist/components/Row/Row.d.ts +27 -0
- package/dist/components/Row/Row.js +31 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +30 -24
- package/dist/scss/_sharedClasses.scss +10 -0
- package/dist/scss/_utils.scss +39 -4
- package/dist/scss/_vars.scss +21 -18
- package/dist/scss/components/Button/_button.scss +1 -1
- package/dist/scss/components/Footer/_footer.scss +7 -7
- package/dist/scss/components/Grid/_grid.scss +2 -2
- package/dist/scss/components/GridItem/_gridItem.scss +50 -0
- package/dist/scss/components/LinkList/_linkList.scss +1 -1
- package/dist/scss/components/Row/_row.scss +7 -0
- package/dist/scss/components/Social/_social.scss +1 -1
- package/dist/scss/components/SplitPanel/_splitPanel.scss +2 -6
- package/dist/scss/components/SplitPanel/_splitPanel.stories.scss +1 -1
- package/dist/scss/components/Subscribe/_subscribe.scss +2 -2
- package/dist/scss/styles.scss +3 -0
- package/dist/utils/index.d.ts +8 -5
- package/dist/utils/index.js +23 -21
- package/package.json +17 -18
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var e = (t, r, o) => (
|
|
4
|
-
import { jsx as
|
|
5
|
-
import * as
|
|
6
|
-
|
|
7
|
-
class h extends l.Component {
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var c = (t, r, o) => r in t ? i(t, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[r] = o;
|
|
3
|
+
var e = (t, r, o) => (c(t, typeof r != "symbol" ? r + "" : r, o), o);
|
|
4
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
5
|
+
import * as p from "react";
|
|
6
|
+
class h extends p.Component {
|
|
8
7
|
constructor() {
|
|
9
8
|
super(...arguments);
|
|
10
9
|
e(this, "state", {
|
|
@@ -14,12 +13,12 @@ class h extends l.Component {
|
|
|
14
13
|
static getDerivedStateFromError() {
|
|
15
14
|
return { hasError: !0 };
|
|
16
15
|
}
|
|
17
|
-
componentDidCatch(o,
|
|
18
|
-
var a;
|
|
19
|
-
(
|
|
16
|
+
componentDidCatch(o, n) {
|
|
17
|
+
var a, s;
|
|
18
|
+
(s = this.props) == null || s.logger(o, (a = n.componentStack) != null ? a : "ErrorBoundary caught an error");
|
|
20
19
|
}
|
|
21
20
|
render() {
|
|
22
|
-
return this.state.hasError ? this.props.fallback || /* @__PURE__ */
|
|
21
|
+
return this.state.hasError ? this.props.fallback || /* @__PURE__ */ l("h2", { children: "Sorry... An error occurred and we are looking into it" }) : this.props.children;
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
e(h, "defaultProps", {
|
|
@@ -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
|
|
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,
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { px as
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
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:
|
|
18
|
-
[`${t}-grid__container--has-margins`]: i
|
|
19
|
-
}),
|
|
10
|
+
className: i(`${m}-grid__container`, e),
|
|
20
11
|
...o,
|
|
21
|
-
children:
|
|
12
|
+
children: t
|
|
22
13
|
}
|
|
23
14
|
);
|
|
24
15
|
}
|
|
25
16
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
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
|
+
};
|
|
@@ -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:
|
|
6
|
+
description: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* ## Overview
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as k, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import d from "../../node_modules/classnames/index.js";
|
|
3
|
+
import { px as p } from "../../utils/index.js";
|
|
4
4
|
import f from "../Link/Link.js";
|
|
5
5
|
import { LinkVariants as b } from "../Link/utils.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/* @__PURE__ */
|
|
6
|
+
const j = ({ linkProps: s, description: e, className: l, id: t, ...m }) => {
|
|
7
|
+
var o;
|
|
8
|
+
const a = `${p}-link-block`, r = d(a, l), c = (o = s.element) != null ? o : f, n = t ? `link-block-${t}` : "link-block";
|
|
9
|
+
return /* @__PURE__ */ k("div", { ...m, className: r, id: t, "data-testid": n, children: [
|
|
10
|
+
/* @__PURE__ */ i(c, { ...s, "data-testid": `${n}-link`, variant: b.list }),
|
|
11
|
+
/* @__PURE__ */ i("p", { className: `${a}__description`, children: e })
|
|
11
12
|
] });
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
j as default
|
|
15
16
|
};
|
|
@@ -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.
|
|
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
|
|
4
|
-
import { Grid as
|
|
5
|
-
import { default as
|
|
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
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import {
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
29
|
-
|
|
33
|
+
B as LinkBlock,
|
|
34
|
+
G as LinkList,
|
|
30
35
|
c as LinkVariants,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
j as
|
|
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
|
+
}
|
package/dist/scss/_utils.scss
CHANGED
|
@@ -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-
|
|
44
|
+
margin: 0 $spacing-md;
|
|
44
45
|
|
|
45
46
|
@media (min-width: $breakpoint3) {
|
|
46
|
-
margin: 0 $spacing-
|
|
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-
|
|
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-
|
|
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
|
+
}
|
package/dist/scss/_vars.scss
CHANGED
|
@@ -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-
|
|
169
|
-
--spacing-
|
|
170
|
-
--spacing-
|
|
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-
|
|
177
|
-
--spacing-
|
|
178
|
-
--spacing-
|
|
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-
|
|
186
|
-
--spacing-
|
|
187
|
-
--spacing-
|
|
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-
|
|
195
|
-
$spacing-
|
|
196
|
-
$spacing-
|
|
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-
|
|
203
|
-
$padding-
|
|
204
|
-
$padding-
|
|
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-
|
|
211
|
-
$margin-
|
|
212
|
-
$margin-
|
|
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';
|
|
@@ -15,21 +15,21 @@
|
|
|
15
15
|
|
|
16
16
|
&__navigation {
|
|
17
17
|
background-color: $white;
|
|
18
|
-
padding: $spacing-
|
|
18
|
+
padding: $spacing-md $spacing-md $spacing-sm;
|
|
19
19
|
text-align: right;
|
|
20
20
|
|
|
21
21
|
@include media($breakpoint-md) {
|
|
22
|
-
padding: $spacing-
|
|
22
|
+
padding: $spacing-md $spacing-lg $spacing-sm;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@include media($breakpoint-lg) {
|
|
26
|
-
padding: $spacing-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
69
|
+
margin-bottom: $spacing-md;
|
|
70
70
|
|
|
71
71
|
@include media($breakpoint-sm) {
|
|
72
72
|
margin-bottom: 0;
|
|
@@ -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,11 +5,7 @@
|
|
|
5
5
|
align-items: center;
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
|
-
gap: $spacing-
|
|
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-
|
|
25
|
+
padding-right: $spacing-md;
|
|
30
26
|
}
|
|
31
27
|
|
|
32
28
|
&--borderless {
|
package/dist/scss/styles.scss
CHANGED
|
@@ -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';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -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,9 +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;
|
|
68
|
-
|
|
69
|
-
* Nullish coalescing operator '??' polyfill
|
|
70
|
-
* To be removed once sass upgrade branch is merged in phillips-public
|
|
71
|
-
*/
|
|
72
|
-
export declare const nullishCoalescing: (a: any, b: any) => any;
|
|
75
|
+
export declare const generatePaddingClassName: (padding: PaddingTokens, side?: 'start' | 'end', direction?: 'vertical' | 'horizontal') => string;
|
|
73
76
|
export {};
|
package/dist/utils/index.js
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
const
|
|
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:
|
|
5
|
-
id:
|
|
6
|
-
invalid:
|
|
5
|
+
disabled: a = !1,
|
|
6
|
+
id: n,
|
|
7
|
+
invalid: r = !1,
|
|
7
8
|
invalidText: d = "invalid",
|
|
8
|
-
readOnly:
|
|
9
|
-
type:
|
|
10
|
-
warn:
|
|
11
|
-
warnText:
|
|
9
|
+
readOnly: e = !1,
|
|
10
|
+
type: t,
|
|
11
|
+
warn: o = !1,
|
|
12
|
+
warnText: v
|
|
12
13
|
}) {
|
|
13
|
-
const
|
|
14
|
-
disabled: !
|
|
15
|
-
invalid: !
|
|
16
|
-
invalidId: `${
|
|
17
|
-
type:
|
|
18
|
-
warn: !
|
|
19
|
-
warnId: `${
|
|
14
|
+
const i = {
|
|
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
|
|
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
|
|
25
|
+
const $ = (/* @__PURE__ */ new Date()).getFullYear(), p = (a, n = "end", r = "vertical") => `${l}-padding-${r}-${a}-${n}`;
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
m as PaddingTokens,
|
|
28
|
+
$ as defaultYear,
|
|
29
|
+
p as generatePaddingClassName,
|
|
30
|
+
l as px,
|
|
29
31
|
c as useNormalizedInputProps
|
|
30
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phillips/seldon",
|
|
3
|
-
"version": "1.
|
|
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": "
|
|
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.
|
|
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.
|
|
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.
|
|
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": "^
|
|
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/
|
|
62
|
-
"@types/react": "^18.3.1",
|
|
62
|
+
"@types/react": "^18.3.2",
|
|
63
63
|
"@types/react-dom": "^18.0.11",
|
|
64
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
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.
|
|
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.
|
|
90
|
-
"ts-jest": "^29.1.2",
|
|
88
|
+
"stylelint-scss": "^6.3.0",
|
|
91
89
|
"ts-node": "^10.9.2",
|
|
92
|
-
"typescript": "^5.
|
|
93
|
-
"vite": "^
|
|
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",
|