@phillips/seldon 1.15.0 → 1.16.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
+ };
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
+ }
@@ -147,3 +147,65 @@ $email-label-size: var(--label-size2);
147
147
  $cta-lg-label-size: var(--label-size1);
148
148
  $text-label-size: var(--label-size3);
149
149
  $text-badge-label-size: var(--label-size3);
150
+
151
+ ////////////////////////
152
+ /// SPACING TOKENS:
153
+ ///////////////////////
154
+
155
+ :root {
156
+ --spacing-micro: 0.25rem;
157
+ --spacing-xsm: 0.5rem;
158
+ --spacing-small: 1rem;
159
+ --spacing-medium: 2rem;
160
+ --spacing-large: 3rem;
161
+ --spacing-xl: 6rem;
162
+
163
+ @media (max-width: 960px) {
164
+ --spacing-micro: 0.19rem;
165
+ --spacing-xsm: 0.38rem;
166
+ --spacing-small: 0.75rem;
167
+ --spacing-medium: 1.5rem;
168
+ --spacing-large: 2.25rem;
169
+ --spacing-xl: 4.8rem;
170
+ }
171
+
172
+ @media (min-width: 1800px) {
173
+ --spacing-micro: 0.31rem;
174
+ --spacing-xsm: 0.63rem;
175
+ --spacing-small: 1.25rem;
176
+ --spacing-medium: 2.5rem;
177
+ --spacing-large: 3.75rem;
178
+ --spacing-xl: 7.5rem;
179
+ }
180
+ }
181
+
182
+ $spacing-micro: var(--spacing-micro);
183
+ $spacing-xsm: var(--spacing-xsm);
184
+ $spacing-small: var(--spacing-small);
185
+ $spacing-medium: var(--spacing-medium);
186
+ $spacing-large: var(--spacing-large);
187
+ $spacing-xl: var(--spacing-xl);
188
+
189
+ // PADDING
190
+ $padding-micro: var(--spacing-micro);
191
+ $padding-xsm: var(--spacing-xsm);
192
+ $padding-small: var(--spacing-small);
193
+ $padding-medium: var(--spacing-medium);
194
+ $padding-large: var(--spacing-large);
195
+ $padding-xl: var(--spacing-xl);
196
+
197
+ // MARGIN
198
+ $margin-micro: var(--spacing-micro);
199
+ $margin-xsm: var(--spacing-xsm);
200
+ $margin-small: var(--spacing-small);
201
+ $margin-medium: var(--spacing-medium);
202
+ $margin-large: var(--spacing-large);
203
+ $margin-xl: var(--spacing-xl);
204
+
205
+ ////////////////////////
206
+ /// Breakpoint TOKENS:
207
+ ///////////////////////
208
+
209
+ $breakpoint2: 961px;
210
+ $breakpoint3: 1401px;
211
+ $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.16.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",