@phillips/seldon 1.19.0 → 1.19.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,14 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- export declare const LinkVariants: {
3
- /** Default variant, used */
4
- readonly standalone: "standalone";
5
- /** link rendering emailto: */
6
- readonly email: "email";
7
- /** these links are being rendered in a list */
8
- readonly list: "list";
9
- /** link is being rendered within body copy */
10
- readonly inline: "inline";
11
- };
2
+ import { LinkVariants } from './utils';
12
3
  export interface LinkProps extends HTMLAttributes<HTMLAnchorElement> {
13
4
  /**
14
5
  * Describes where the link is used. It controls the styling of the link so we apply consistent styles. Defaults to `standalone`. See the documentation [here](https://www.figma.com/file/xMuOXOAKVt5HC7hgYjF3ot/Components-v2.0?type=design&node-id=5731-12815) to see where each variant is used.
@@ -16,7 +7,7 @@ export interface LinkProps extends HTMLAttributes<HTMLAnchorElement> {
16
7
  * @default standalone
17
8
  * @see LinkVariants
18
9
  */
19
- variant?: keyof typeof LinkVariants;
10
+ variant?: LinkVariants;
20
11
  /**
21
12
  * The text of the link
22
13
  */
@@ -1,40 +1,30 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import k from "../../node_modules/classnames/index.js";
1
+ import { jsx as k } from "react/jsx-runtime";
2
+ import c from "../../node_modules/classnames/index.js";
3
3
  import { px as p } from "../../utils/index.js";
4
- import { getLinkVariantClassName as d, isLinkExternal as f } from "./utils.js";
5
- const x = {
6
- /** Default variant, used */
7
- standalone: "standalone",
8
- /** link rendering emailto: */
9
- email: "email",
10
- /** these links are being rendered in a list */
11
- list: "list",
12
- /** link is being rendered within body copy */
13
- inline: "inline"
14
- }, V = ({
4
+ import { getLinkVariantClassName as f, isLinkExternal as x, LinkVariants as d } from "./utils.js";
5
+ const V = ({
15
6
  children: s,
16
7
  id: a,
17
- className: e,
18
- element: n = "a",
19
- variant: i = x.standalone,
20
- href: t,
21
- ...l
8
+ className: r,
9
+ element: t = "a",
10
+ variant: e = d.standalone,
11
+ href: n,
12
+ ...o
22
13
  }) => {
23
- const r = k(`${p}-link`, d(i), e), o = a ? `link-${a}` : "link", m = f(t);
24
- return /* @__PURE__ */ c(
25
- n,
14
+ const i = c(`${p}-link`, f(e), r), l = a ? `link-${a}` : "link", m = x(n);
15
+ return /* @__PURE__ */ k(
16
+ t,
26
17
  {
27
- ...l,
28
- href: t,
29
- "data-testid": o,
18
+ ...o,
19
+ href: n,
20
+ "data-testid": l,
30
21
  id: a,
31
- className: r,
32
- ...m && n === "a" ? { rel: "noopener noreferrer", target: "_blank" } : {},
22
+ className: i,
23
+ ...m && t === "a" ? { rel: "noopener noreferrer", target: "_blank" } : {},
33
24
  children: s
34
25
  }
35
26
  );
36
27
  };
37
28
  export {
38
- x as LinkVariants,
39
29
  V as default
40
30
  };
@@ -1,3 +1,12 @@
1
- import { LinkVariants } from './Link';
2
1
  export declare const getLinkVariantClassName: (variant: keyof typeof LinkVariants) => string;
3
2
  export declare const isLinkExternal: (href: string) => boolean;
3
+ export declare enum LinkVariants {
4
+ /** Default variant, used */
5
+ standalone = "standalone",
6
+ /** link rendering emailto: */
7
+ email = "email",
8
+ /** these links are being rendered in a list */
9
+ list = "list",
10
+ /** link is being rendered within body copy */
11
+ inline = "inline"
12
+ }
@@ -1,8 +1,10 @@
1
- import { px as a } from "../../utils/index.js";
2
- const n = (t) => `${a}-link--${t}`, s = (t) => !!t.match(
1
+ import { px as t } from "../../utils/index.js";
2
+ const n = (l) => `${t}-link--${l}`, a = (l) => !!l.match(
3
3
  /(http[s]?:\/\/)(?!.*phillips\.com)([a-zA-Z0-9\-.]+)(:[0-9]{1,4})?([a-zA-Z0-9/\-._~:?#[\]@!$&'()*+,;=]*)/g
4
4
  );
5
+ var e = /* @__PURE__ */ ((l) => (l.standalone = "standalone", l.email = "email", l.list = "list", l.inline = "inline", l))(e || {});
5
6
  export {
7
+ e as LinkVariants,
6
8
  n as getLinkVariantClassName,
7
- s as isLinkExternal
9
+ a as isLinkExternal
8
10
  };
@@ -1,14 +1,15 @@
1
- import { jsxs as r, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
2
  import k from "../../node_modules/classnames/index.js";
3
3
  import { px as d } from "../../utils/index.js";
4
- import p, { LinkVariants as f } from "../Link/Link.js";
5
- const $ = ({ linkProps: t, description: e, className: i, id: s, ...l }) => {
6
- const a = `${d}-link-block`, c = k(a, i), m = t.element ?? p, n = s ? `link-block-${s}` : "link-block";
7
- return /* @__PURE__ */ r("div", { ...l, className: c, id: s, "data-testid": n, children: [
8
- /* @__PURE__ */ o(m, { ...t, "data-testid": `${n}-link`, variant: f.list }),
9
- /* @__PURE__ */ o("p", { className: `${a}__description`, children: e })
4
+ import p from "../Link/Link.js";
5
+ import { LinkVariants as f } from "../Link/utils.js";
6
+ const h = ({ linkProps: s, description: i, className: e, id: t, ...l }) => {
7
+ const a = `${d}-link-block`, m = k(a, e), r = s.element ?? p, n = t ? `link-block-${t}` : "link-block";
8
+ return /* @__PURE__ */ c("div", { ...l, className: m, id: t, "data-testid": n, children: [
9
+ /* @__PURE__ */ o(r, { ...s, "data-testid": `${n}-link`, variant: f.list }),
10
+ /* @__PURE__ */ o("p", { className: `${a}__description`, children: i })
10
11
  ] });
11
12
  };
12
13
  export {
13
- $ as default
14
+ h as default
14
15
  };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export { default as Header, type HeaderProps } from './components/Header/Header'
6
6
  export { default as HeroBanner, type HeroBannerProps } from './components/HeroBanner/HeroBanner';
7
7
  export { default as Input, type InputProps } from './components/Input/Input';
8
8
  export { default as Link, type LinkProps } from './components/Link/Link';
9
+ export { LinkVariants } from './components/Link/utils';
9
10
  export { default as LinkBlock, type LinkBlockProps } from './components/LinkBlock/LinkBlock';
10
11
  export { default as LinkList, type LinkListProps } from './components/LinkList/LinkList';
11
12
  export { default as Select, type SelectProps } from './components/Select/Select';
package/dist/index.js CHANGED
@@ -1,36 +1,38 @@
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";
3
+ import { default as s } from "./components/Footer/Footer.js";
4
4
  import { Grid as u } from "./components/Grid/Grid.js";
5
- import { default as p } from "./components/Header/Header.js";
5
+ import { default as d } 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
- import { default as S } from "./components/Link/Link.js";
9
- import { default as k } from "./components/LinkBlock/LinkBlock.js";
10
- import { default as g } from "./components/LinkList/LinkList.js";
11
- import { default as w } from "./components/Select/Select.js";
12
- import { default as P } from "./components/SplitPanel/SplitPanel.js";
13
- import { default as y } from "./components/Subscribe/Subscribe.js";
14
- import { default as F } from "./components/Social/Social.js";
15
- import { default as I } from "./components/ViewingsList/ViewingsList.js";
16
- import { default as j } from "./components/ViewingsList/StatefulViewingsList.js";
17
- import { default as v } from "./pages/Page.js";
8
+ import { default as k } from "./components/Link/Link.js";
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";
18
19
  export {
19
20
  t as Button,
20
21
  a as ErrorBoundary,
21
- l as Footer,
22
+ s as Footer,
22
23
  u as Grid,
23
- p as Header,
24
+ d as Header,
24
25
  x as HeroBanner,
25
26
  n as Input,
26
- S as Link,
27
- k as LinkBlock,
28
- g as LinkList,
29
- v as Page,
30
- w as Select,
31
- F as Social,
32
- P as SplitPanel,
33
- j as StatefulViewingsList,
34
- y as Subscribe,
35
- I as ViewingsList
27
+ k as Link,
28
+ g as LinkBlock,
29
+ b as LinkList,
30
+ 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
38
  };
@@ -79,25 +79,50 @@
79
79
  }
80
80
  }
81
81
 
82
- @mixin media($breakpoint) {
82
+ @mixin media($breakpoint, $type: 'min') {
83
83
  @if $breakpoint == $breakpoint-sm {
84
84
  // $breakpoint2: 961px;
85
- @media (min-width: $breakpoint2) {
86
- @content;
85
+ @if $type == 'min' {
86
+ @media (min-width: $breakpoint2) {
87
+ @content;
88
+ }
89
+ }
90
+
91
+ @if $type == 'max' {
92
+ @media (max-width: $breakpoint2) {
93
+ @content;
94
+ }
87
95
  }
88
96
  }
89
97
 
90
98
  @if $breakpoint == $breakpoint-md {
91
99
  // $breakpoint3: 1401px;
92
- @media (min-width: $breakpoint3) {
93
- @content;
100
+
101
+ @if $type == 'min' {
102
+ @media (min-width: $breakpoint3) {
103
+ @content;
104
+ }
105
+ }
106
+
107
+ @if type == 'max' {
108
+ @media (max-width: $breakpoint3) {
109
+ @content;
110
+ }
94
111
  }
95
112
  }
96
113
 
97
114
  @if $breakpoint == $breakpoint-lg {
98
115
  // $breakpoint4: 1801px;
99
- @media (min-width: $breakpoint4) {
100
- @content;
116
+ @if type == 'min' {
117
+ @media (min-width: $breakpoint4) {
118
+ @content;
119
+ }
120
+ }
121
+
122
+ @if type == 'max' {
123
+ @media (max-width: $breakpoint4) {
124
+ @content;
125
+ }
101
126
  }
102
127
  }
103
128
  }
@@ -2,10 +2,11 @@
2
2
 
3
3
  .#{$px}-link-list {
4
4
  &--item {
5
- grid-column: span 4;
5
+ // mobile first
6
+ grid-column: span 2;
6
7
 
7
- @include media($breakpoint-lg) {
8
- grid-column: span 2;
8
+ @include media($breakpoint-sm) {
9
+ grid-column: span 4;
9
10
  }
10
11
  }
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.19.0",
3
+ "version": "1.19.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"