@phillips/seldon 1.15.0 → 1.17.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.
@@ -0,0 +1,18 @@
1
+ import { ElementType } from 'react';
2
+ import { CommonProps } from '../../utils';
3
+ export interface GridProps extends CommonProps {
4
+ /**
5
+ * Button contents
6
+ */
7
+ children: React.ReactNode;
8
+ /**
9
+ * Optional element to render in place of a button e.g. React-Router, etc
10
+ */
11
+ element?: ElementType;
12
+ /**
13
+ * Optional boolean to dictate if the grid has left and right margins
14
+ */
15
+ hasMargins?: boolean;
16
+ }
17
+ export declare function Grid({ children, className, element: Element, hasMargins, id, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
18
+ export default Grid;
@@ -0,0 +1,29 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import s from "../../node_modules/classnames/index.js";
3
+ import { px as n } from "../../utils/index.js";
4
+ function g({
5
+ children: e,
6
+ className: t,
7
+ element: i = "section",
8
+ hasMargins: o = !0,
9
+ id: r,
10
+ ...a
11
+ }) {
12
+ return /* @__PURE__ */ m(
13
+ i,
14
+ {
15
+ "data-testid": r ? `grid-container-${r}` : "grid-container",
16
+ id: r,
17
+ className: s(`${n}-grid__container`, {
18
+ [`${t}`]: t,
19
+ [`${n}-grid__container--has-margins`]: o
20
+ }),
21
+ ...a,
22
+ children: e
23
+ }
24
+ );
25
+ }
26
+ export {
27
+ g as Grid,
28
+ g as default
29
+ };
@@ -43,6 +43,18 @@ const o = `${X}-viewings-list-card-form`, l = ({
43
43
  return T.useEffect(() => {
44
44
  f(p === "true");
45
45
  }, [p]), /* @__PURE__ */ a(W, { children: [
46
+ /* @__PURE__ */ t(
47
+ u,
48
+ {
49
+ id: `viewingLabel-${r}`,
50
+ name: "viewingLabelValue",
51
+ defaultValue: Z,
52
+ labelText: Y,
53
+ size: "sm",
54
+ invalid: e == null ? void 0 : e.viewingLabelValue,
55
+ invalidText: e == null ? void 0 : e.viewingLabelValue
56
+ }
57
+ ),
46
58
  /* @__PURE__ */ t(
47
59
  u,
48
60
  {
@@ -79,18 +91,6 @@ const o = `${X}-viewings-list-card-form`, l = ({
79
91
  invalidText: e == null ? void 0 : e.viewingHours2
80
92
  }
81
93
  ),
82
- /* @__PURE__ */ t(
83
- u,
84
- {
85
- id: `viewingLabel-${r}`,
86
- name: "viewingLabelValue",
87
- defaultValue: Z,
88
- labelText: Y,
89
- size: "sm",
90
- invalid: e == null ? void 0 : e.viewingLabelValue,
91
- invalidText: e == null ? void 0 : e.viewingLabelValue
92
- }
93
- ),
94
94
  /* @__PURE__ */ t(
95
95
  u,
96
96
  {
@@ -113,6 +113,19 @@ const o = `${X}-viewings-list-card-form`, l = ({
113
113
  {
114
114
  className: b(`${o}__preview-set`, { [`${o}__preview-set--hidden`]: !m }),
115
115
  children: [
116
+ /* @__PURE__ */ t(
117
+ u,
118
+ {
119
+ id: `previewLabel-${r}`,
120
+ name: "previewLabelValue",
121
+ defaultValue: I,
122
+ labelText: j,
123
+ size: "sm",
124
+ invalid: e == null ? void 0 : e.previewLabelValue,
125
+ invalidText: e == null ? void 0 : e.previewLabelValue,
126
+ hidden: !m
127
+ }
128
+ ),
116
129
  /* @__PURE__ */ t(
117
130
  u,
118
131
  {
@@ -151,19 +164,6 @@ const o = `${X}-viewings-list-card-form`, l = ({
151
164
  invalidText: e == null ? void 0 : e.previewHours2,
152
165
  hidden: !m
153
166
  }
154
- ),
155
- /* @__PURE__ */ t(
156
- u,
157
- {
158
- id: `previewLabel-${r}`,
159
- name: "previewLabelValue",
160
- defaultValue: I,
161
- labelText: j,
162
- size: "sm",
163
- invalid: e == null ? void 0 : e.previewLabelValue,
164
- invalidText: e == null ? void 0 : e.previewLabelValue,
165
- hidden: !m
166
- }
167
167
  )
168
168
  ]
169
169
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as Button } from './components/Button/Button';
2
2
  export { default as ErrorBoundary } from './components/ErrorBoundary/ErrorBoundary';
3
+ export { default as Grid } from './components/Grid/Grid';
3
4
  export { default as Header } from './components/Header/Header';
4
5
  export { default as HeroBanner } from './components/HeroBanner/HeroBanner';
5
6
  export { default as Input } from './components/Input/Input';
package/dist/index.js CHANGED
@@ -1,20 +1,22 @@
1
- import { default as r } from "./components/Button/Button.js";
2
- import { default as o } from "./components/ErrorBoundary/ErrorBoundary.js";
3
- import { default as s } from "./components/Header/Header.js";
4
- import { default as d } from "./components/HeroBanner/HeroBanner.js";
5
- import { default as p } from "./components/Input/Input.js";
6
- import { default as x } from "./components/Select/Select.js";
7
- import { default as i } from "./components/ViewingsList/ViewingsList.js";
8
- import { default as B } from "./components/ViewingsList/StatefulViewingsList.js";
9
- import { default as H } from "./pages/Page.js";
1
+ import { default as t } from "./components/Button/Button.js";
2
+ import { default as a } from "./components/ErrorBoundary/ErrorBoundary.js";
3
+ import { Grid as s } from "./components/Grid/Grid.js";
4
+ import { default as d } from "./components/Header/Header.js";
5
+ import { default as p } from "./components/HeroBanner/HeroBanner.js";
6
+ import { default as x } from "./components/Input/Input.js";
7
+ import { default as n } from "./components/Select/Select.js";
8
+ import { default as B } from "./components/ViewingsList/ViewingsList.js";
9
+ import { default as H } from "./components/ViewingsList/StatefulViewingsList.js";
10
+ import { default as S } from "./pages/Page.js";
10
11
  export {
11
- r as Button,
12
- o as ErrorBoundary,
13
- s as Header,
14
- d as HeroBanner,
15
- p as Input,
16
- H as Page,
17
- x as Select,
18
- B as StatefulViewingsList,
19
- i as ViewingsList
12
+ t as Button,
13
+ a as ErrorBoundary,
14
+ s as Grid,
15
+ d as Header,
16
+ p as HeroBanner,
17
+ x as Input,
18
+ S as Page,
19
+ n as Select,
20
+ H as StatefulViewingsList,
21
+ B as ViewingsList
20
22
  };
@@ -71,7 +71,6 @@ body {
71
71
  @include DistinctDisplay();
72
72
  color: $primary-black;
73
73
  font-weight: 400;
74
- font-style: italic;
75
74
  }
76
75
 
77
76
  @mixin bodyText {
@@ -36,3 +36,36 @@
36
36
  text-align: center;
37
37
  line-height: 1;
38
38
  }
39
+
40
+ @mixin grid($columns: 2) {
41
+ display: grid;
42
+ grid-template-columns: repeat($columns, 1fr);
43
+ gap: $spacing-medium;
44
+ }
45
+
46
+ @mixin gridContainer($margins-on: true) {
47
+ display: grid;
48
+ grid-template-columns: repeat(2, 1fr);
49
+ gap: $spacing-medium;
50
+
51
+ @if $margins-on {
52
+ margin: 0 $spacing-medium;
53
+ }
54
+
55
+ @media (min-width: $breakpoint2) {
56
+ grid-template-columns: repeat(4, 1fr);
57
+ }
58
+
59
+ @media (min-width: $breakpoint3) {
60
+ grid-template-columns: repeat(12, 1fr);
61
+ @if $margins-on {
62
+ margin: 0 $spacing-large;
63
+ }
64
+ }
65
+
66
+ @media (min-width: $breakpoint4) {
67
+ @if $margins-on {
68
+ margin: 0 $spacing-xl;
69
+ }
70
+ }
71
+ }
@@ -8,10 +8,11 @@ $px: phillips;
8
8
  // Primary color palette
9
9
  $pure-black: #000000;
10
10
  $primary-black: #323232;
11
- $pure-white: #ffffff;
11
+ $white: #ffffff;
12
+
12
13
  // Secondary color palette
13
14
  $soft-black: #545454;
14
- $dark-gray: #75715f;
15
+ $dark-gray: #7b7474;
15
16
  // Utilititarian color palette
16
17
  $keyline-gray: #949494;
17
18
  $medium-gray: #c3bebb;
@@ -21,15 +22,25 @@ $off-white: #f4f2f1;
21
22
  $error-red: #ff0000;
22
23
  $error-pink: rgba(255, 229, 229, 0.9);
23
24
  $warn-yellow: #d6d141;
24
- $post-sale-magenta: #ff0085;
25
- $clock-widget-blue: #4a90e2;
26
- $clock-widget-green: #6a9c53;
27
- $clock-widget-maroon: #6b0000;
28
- $clock-widget-red: #b00000;
25
+ $post-sale-pink: #ff0086;
26
+ $cta-blue: #4a90e2;
27
+ // AM color palette
28
+ $widget-blue: #4a90e2;
29
+ $widget-green: #6a9c53;
30
+ $widget-maroon: #6b0000;
31
+ $widget-red: #b00000;
32
+ $clock-widget-blue: $widget-blue;
33
+ $clock-widget-green: $widget-green;
34
+ $clock-widget-maroon: $widget-maroon;
35
+ $clock-widget-red: $widget-red;
29
36
  // Articker color palette
30
37
  $articker-red: #fc1e2b;
31
38
  $articker-orange: #ff8201;
32
39
  $articker-red-orange-gradient: linear-gradient(90deg, #fc1e2b, #ff8201);
40
+ // Legacy mapping
41
+ $pure-white: $white;
42
+ $post-sale-magenta: $post-sale-pink;
43
+
33
44
  // Text variables
34
45
  $header-color: $pure-black;
35
46
  $text-color: $soft-black;
@@ -147,3 +158,65 @@ $email-label-size: var(--label-size2);
147
158
  $cta-lg-label-size: var(--label-size1);
148
159
  $text-label-size: var(--label-size3);
149
160
  $text-badge-label-size: var(--label-size3);
161
+
162
+ ////////////////////////
163
+ /// SPACING TOKENS:
164
+ ///////////////////////
165
+
166
+ :root {
167
+ --spacing-micro: 0.25rem;
168
+ --spacing-xsm: 0.5rem;
169
+ --spacing-small: 1rem;
170
+ --spacing-medium: 2rem;
171
+ --spacing-large: 3rem;
172
+ --spacing-xl: 6rem;
173
+
174
+ @media (max-width: 960px) {
175
+ --spacing-micro: 0.19rem;
176
+ --spacing-xsm: 0.38rem;
177
+ --spacing-small: 0.75rem;
178
+ --spacing-medium: 1.5rem;
179
+ --spacing-large: 2.25rem;
180
+ --spacing-xl: 4.8rem;
181
+ }
182
+
183
+ @media (min-width: 1800px) {
184
+ --spacing-micro: 0.31rem;
185
+ --spacing-xsm: 0.63rem;
186
+ --spacing-small: 1.25rem;
187
+ --spacing-medium: 2.5rem;
188
+ --spacing-large: 3.75rem;
189
+ --spacing-xl: 7.5rem;
190
+ }
191
+ }
192
+
193
+ $spacing-micro: var(--spacing-micro);
194
+ $spacing-xsm: var(--spacing-xsm);
195
+ $spacing-small: var(--spacing-small);
196
+ $spacing-medium: var(--spacing-medium);
197
+ $spacing-large: var(--spacing-large);
198
+ $spacing-xl: var(--spacing-xl);
199
+
200
+ // PADDING
201
+ $padding-micro: var(--spacing-micro);
202
+ $padding-xsm: var(--spacing-xsm);
203
+ $padding-small: var(--spacing-small);
204
+ $padding-medium: var(--spacing-medium);
205
+ $padding-large: var(--spacing-large);
206
+ $padding-xl: var(--spacing-xl);
207
+
208
+ // MARGIN
209
+ $margin-micro: var(--spacing-micro);
210
+ $margin-xsm: var(--spacing-xsm);
211
+ $margin-small: var(--spacing-small);
212
+ $margin-medium: var(--spacing-medium);
213
+ $margin-large: var(--spacing-large);
214
+ $margin-xl: var(--spacing-xl);
215
+
216
+ ////////////////////////
217
+ /// Breakpoint TOKENS:
218
+ ///////////////////////
219
+
220
+ $breakpoint2: 961px;
221
+ $breakpoint3: 1401px;
222
+ $breakpoint4: 1801px;
@@ -0,0 +1,20 @@
1
+ @import '../../vars';
2
+ @import '../../_utils';
3
+
4
+ .#{$px}-grid {
5
+ &__container {
6
+ @include gridContainer(false);
7
+ }
8
+
9
+ &__container--has-margins {
10
+ margin: 0 $spacing-medium;
11
+
12
+ @media (min-width: 1401px) {
13
+ margin: 0 $spacing-large;
14
+ }
15
+
16
+ @media (min-width: 1801px) {
17
+ margin: 0 $spacing-xl;
18
+ }
19
+ }
20
+ }
@@ -9,7 +9,7 @@
9
9
  flex-direction: column;
10
10
  gap: 2.5rem;
11
11
  padding: 1rem;
12
- width: 38rem;
12
+ max-width: 38rem;
13
13
 
14
14
  &__title {
15
15
  @include headerText;
@@ -11,5 +11,6 @@
11
11
  @import 'components/Input/input';
12
12
  @import 'components/Toggle/toggle';
13
13
  @import 'components/ViewingsList/viewingsList';
14
+ @import 'components/Grid/grid';
14
15
  // 📑 Pages
15
16
  @import 'pages/page';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.15.0",
3
+ "version": "1.17.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",