@phillips/seldon 1.26.0 → 1.26.2
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/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.js +33 -32
- package/dist/components/Grid/Grid.d.ts +2 -2
- package/dist/components/Grid/Grid.js +8 -16
- package/dist/components/GridItem/GridItem.d.ts +1 -1
- package/dist/components/GridItem/GridItem.js +21 -22
- package/dist/components/HeroBanner/HeroBanner.d.ts +3 -2
- package/dist/components/HeroBanner/HeroBanner.js +36 -23
- package/dist/components/IconButton/IconButton.js +18 -14
- package/dist/components/Link/Link.d.ts +2 -2
- package/dist/components/Link/Link.js +21 -23
- package/dist/components/Link/utils.d.ts +1 -1
- package/dist/components/Link/utils.js +6 -6
- package/dist/components/LinkBlock/LinkBlock.d.ts +1 -1
- package/dist/components/LinkBlock/LinkBlock.js +10 -10
- package/dist/components/LinkList/LinkList.d.ts +1 -1
- package/dist/components/LinkList/LinkList.js +11 -10
- package/dist/components/Modal/Modal.js +43 -36
- package/dist/components/Row/Row.d.ts +1 -1
- package/dist/components/Row/Row.js +21 -23
- package/dist/components/Select/Select.js +28 -27
- package/dist/components/Social/Social.d.ts +2 -2
- package/dist/components/Social/Social.js +11 -8
- package/dist/components/SplitPanel/SplitPanel.d.ts +1 -1
- package/dist/components/SplitPanel/SplitPanel.js +22 -21
- package/dist/components/Subscribe/Subscribe.d.ts +1 -1
- package/dist/components/Subscribe/Subscribe.js +41 -52
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/Text/Text.js +12 -20
- package/dist/components/ViewingsList/ViewingsList.d.ts +2 -2
- package/dist/components/ViewingsList/ViewingsList.js +43 -45
- package/dist/components/ViewingsList/ViewingsListCard.d.ts +2 -2
- package/dist/components/ViewingsList/ViewingsListCard.js +51 -51
- package/dist/index.d.ts +2 -2
- package/dist/index.js +61 -60
- package/dist/node_modules/change-case/dist/index.js +64 -0
- package/dist/scss/components/Grid/_grid.scss +2 -4
- package/dist/scss/styles.scss +3 -5
- package/dist/utils/index.d.ts +9 -10
- package/dist/utils/index.js +38 -29
- package/package.json +10 -7
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as y } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import
|
|
3
|
+
import it from "../../node_modules/classnames/index.js";
|
|
4
4
|
import { px as E } from "../../utils/index.js";
|
|
5
5
|
import g from "../Input/Input.js";
|
|
6
6
|
import l from "../Button/Button.js";
|
|
7
|
-
import
|
|
8
|
-
const u = `${E}-viewings-list-card`,
|
|
9
|
-
address1:
|
|
10
|
-
address1Label:
|
|
7
|
+
import pt from "./ViewingsListCardForm.js";
|
|
8
|
+
const u = `${E}-viewings-list-card`, Et = ({
|
|
9
|
+
address1: d,
|
|
10
|
+
address1Label: $,
|
|
11
11
|
addressUrl: C,
|
|
12
12
|
addressUrlLabel: T,
|
|
13
13
|
address2: O,
|
|
@@ -18,16 +18,16 @@ const u = `${E}-viewings-list-card`, Ee = ({
|
|
|
18
18
|
cardTitle: L = "Add New Viewing",
|
|
19
19
|
deleteBtnLabel: _ = "DELETE",
|
|
20
20
|
editBtnLabel: k = "EDIT",
|
|
21
|
-
|
|
21
|
+
isEditState: o,
|
|
22
22
|
enableOnSite: i = "false",
|
|
23
23
|
enableOnSiteToggleLabel: I = "Enabled on website",
|
|
24
24
|
email: N,
|
|
25
|
-
emailLabel:
|
|
26
|
-
emailLink:
|
|
25
|
+
emailLabel: S = "Email",
|
|
26
|
+
emailLink: V,
|
|
27
27
|
emailLinkLabel: v = "Email Address",
|
|
28
28
|
emailOn: j = "false",
|
|
29
29
|
emailToggleLabel: D = "Include Email Address",
|
|
30
|
-
id:
|
|
30
|
+
id: e,
|
|
31
31
|
invalidFields: n,
|
|
32
32
|
location: R,
|
|
33
33
|
locationLabel: q = "Location",
|
|
@@ -49,40 +49,40 @@ const u = `${E}-viewings-list-card`, Ee = ({
|
|
|
49
49
|
viewingLabel: Y,
|
|
50
50
|
viewingLabelValue: Z,
|
|
51
51
|
viewingDates: F,
|
|
52
|
-
viewingDatesLabel:
|
|
53
|
-
viewingHours1:
|
|
54
|
-
viewingHours1Label:
|
|
55
|
-
viewingHours2:
|
|
56
|
-
viewingHours2Label:
|
|
52
|
+
viewingDatesLabel: tt,
|
|
53
|
+
viewingHours1: et,
|
|
54
|
+
viewingHours1Label: nt,
|
|
55
|
+
viewingHours2: ot,
|
|
56
|
+
viewingHours2Label: st
|
|
57
57
|
}) => {
|
|
58
|
-
const [
|
|
58
|
+
const [ct, rt] = r.useState(i === "true"), c = r.useRef(null);
|
|
59
59
|
r.useEffect(() => {
|
|
60
60
|
o && c.current && c.current.focus();
|
|
61
61
|
}, [o]), r.useEffect(() => {
|
|
62
62
|
var s, b;
|
|
63
63
|
n && c.current && ((b = (s = c.current.closest(".phillips-viewings-list-card")) == null ? void 0 : s.querySelector(".phillips-input--invalid input")) == null || b.focus());
|
|
64
64
|
}, [n]);
|
|
65
|
-
const
|
|
65
|
+
const lt = () => {
|
|
66
66
|
typeof p == "function" && p();
|
|
67
|
-
},
|
|
67
|
+
}, ut = () => {
|
|
68
68
|
typeof m == "function" && m();
|
|
69
|
-
},
|
|
69
|
+
}, at = (s) => {
|
|
70
70
|
typeof h == "function" && h(s);
|
|
71
71
|
};
|
|
72
72
|
return /* @__PURE__ */ a(
|
|
73
73
|
"section",
|
|
74
74
|
{
|
|
75
|
-
"data-testid": `viewings-list-card-${
|
|
76
|
-
id:
|
|
77
|
-
className:
|
|
75
|
+
"data-testid": `viewings-list-card-${e}`,
|
|
76
|
+
id: e,
|
|
77
|
+
className: it(`${u}`, { [`${u}--edit-state`]: o }),
|
|
78
78
|
children: [
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ t("h3", { className: `${u}__title`, children: L }),
|
|
80
|
+
/* @__PURE__ */ t("input", { type: "hidden", name: "id", value: e }),
|
|
81
|
+
/* @__PURE__ */ t(
|
|
82
82
|
g,
|
|
83
83
|
{
|
|
84
84
|
ref: c,
|
|
85
|
-
id: `location-${
|
|
85
|
+
id: `location-${e}`,
|
|
86
86
|
defaultValue: R,
|
|
87
87
|
labelText: q,
|
|
88
88
|
size: "sm",
|
|
@@ -92,11 +92,11 @@ const u = `${E}-viewings-list-card`, Ee = ({
|
|
|
92
92
|
readOnly: !o
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
o ? /* @__PURE__ */
|
|
96
|
-
|
|
95
|
+
o ? /* @__PURE__ */ t(
|
|
96
|
+
pt,
|
|
97
97
|
{
|
|
98
|
-
address1:
|
|
99
|
-
address1Label:
|
|
98
|
+
address1: d,
|
|
99
|
+
address1Label: $,
|
|
100
100
|
addressUrl: C,
|
|
101
101
|
addressUrlLabel: T,
|
|
102
102
|
address2: O,
|
|
@@ -104,12 +104,12 @@ const u = `${E}-viewings-list-card`, Ee = ({
|
|
|
104
104
|
address3: x,
|
|
105
105
|
address3Label: z,
|
|
106
106
|
email: N,
|
|
107
|
-
emailLabel:
|
|
108
|
-
emailLink:
|
|
107
|
+
emailLabel: S,
|
|
108
|
+
emailLink: V,
|
|
109
109
|
emailLinkLabel: v,
|
|
110
110
|
emailOn: j,
|
|
111
111
|
emailToggleLabel: D,
|
|
112
|
-
id:
|
|
112
|
+
id: e,
|
|
113
113
|
invalidFields: n,
|
|
114
114
|
previewDates: B,
|
|
115
115
|
previewDatesLabel: G,
|
|
@@ -124,17 +124,17 @@ const u = `${E}-viewings-list-card`, Ee = ({
|
|
|
124
124
|
viewingLabel: Y,
|
|
125
125
|
viewingLabelValue: Z,
|
|
126
126
|
viewingDates: F,
|
|
127
|
-
viewingDatesLabel:
|
|
128
|
-
viewingHours1:
|
|
129
|
-
viewingHours1Label:
|
|
130
|
-
viewingHours2:
|
|
131
|
-
viewingHours2Label:
|
|
127
|
+
viewingDatesLabel: tt,
|
|
128
|
+
viewingHours1: et,
|
|
129
|
+
viewingHours1Label: nt,
|
|
130
|
+
viewingHours2: ot,
|
|
131
|
+
viewingHours2Label: st
|
|
132
132
|
}
|
|
133
133
|
) : null,
|
|
134
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ t(
|
|
135
135
|
g,
|
|
136
136
|
{
|
|
137
|
-
id: `enableOnSite-${
|
|
137
|
+
id: `enableOnSite-${e}`,
|
|
138
138
|
type: "toggle",
|
|
139
139
|
defaultChecked: i === "true",
|
|
140
140
|
labelText: I,
|
|
@@ -142,25 +142,25 @@ const u = `${E}-viewings-list-card`, Ee = ({
|
|
|
142
142
|
inline: !0,
|
|
143
143
|
value: "true",
|
|
144
144
|
name: "enableOnSite",
|
|
145
|
-
onChange: () =>
|
|
145
|
+
onChange: () => rt((s) => !s),
|
|
146
146
|
readOnly: !o
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
149
|
+
ct ? null : /* @__PURE__ */ t("input", { type: "hidden", name: "enableOnSite", value: "false" }),
|
|
150
|
+
/* @__PURE__ */ t("hr", {}),
|
|
151
|
+
/* @__PURE__ */ t("div", { className: `${u}__btn-group ${E}-button__group`, children: o ? /* @__PURE__ */ a(y, { children: [
|
|
152
|
+
/* @__PURE__ */ t(l, { id: `vlc-save-btn-${e}`, buttonType: "ghost", type: "submit", size: "sm", onClick: at, children: X }),
|
|
153
|
+
/* @__PURE__ */ t(l, { id: `vlc-cancel-btn-${e}`, buttonType: "ghost", type: "button", size: "sm", onClick: lt, children: A })
|
|
154
154
|
] }) : /* @__PURE__ */ a(y, { children: [
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ t(l, { id: `vlc-edit-btn-${e}`, buttonType: "ghost", type: "button", size: "sm", onClick: ut, children: k }),
|
|
156
|
+
/* @__PURE__ */ t(
|
|
157
157
|
l,
|
|
158
158
|
{
|
|
159
|
-
id: `vlc-delete-btn-${
|
|
159
|
+
id: `vlc-delete-btn-${e}`,
|
|
160
160
|
buttonType: "ghost",
|
|
161
161
|
type: "button",
|
|
162
162
|
size: "sm",
|
|
163
|
-
onClick: () => typeof f == "function" && f(
|
|
163
|
+
onClick: () => typeof f == "function" && f(e),
|
|
164
164
|
children: _
|
|
165
165
|
}
|
|
166
166
|
)
|
|
@@ -170,5 +170,5 @@ const u = `${E}-viewings-list-card`, Ee = ({
|
|
|
170
170
|
);
|
|
171
171
|
};
|
|
172
172
|
export {
|
|
173
|
-
|
|
173
|
+
Et as default
|
|
174
174
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from './utils';
|
|
2
|
+
export { default as Page } from './pages/Page';
|
|
1
3
|
export { default as Button, type ButtonProps } from './components/Button/Button';
|
|
2
4
|
export { default as IconButton } from './components/IconButton/IconButton';
|
|
3
5
|
export { default as ErrorBoundary, type ErrorBoundaryProps } from './components/ErrorBoundary/ErrorBoundary';
|
|
@@ -22,5 +24,3 @@ export { default as ViewingsList, type ViewingsListProps } from './components/Vi
|
|
|
22
24
|
export { default as Modal, type ModalProps } from './components/Modal/Modal';
|
|
23
25
|
export { default as StatefulViewingsList, type StatefulViewingsListProps, } from './components/ViewingsList/StatefulViewingsList';
|
|
24
26
|
export * from './components/Text';
|
|
25
|
-
export * from './utils';
|
|
26
|
-
export { default as Page } from './pages/Page';
|
package/dist/index.js
CHANGED
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import {
|
|
6
|
-
import { default as
|
|
7
|
-
import {
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import {
|
|
11
|
-
import { default as
|
|
12
|
-
import {
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import {
|
|
16
|
-
import { default as
|
|
17
|
-
import {
|
|
18
|
-
import { default as
|
|
19
|
-
import {
|
|
20
|
-
import { default as
|
|
21
|
-
import {
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import {
|
|
25
|
-
import { default as
|
|
26
|
-
import {
|
|
27
|
-
import { default as
|
|
1
|
+
import { PaddingTokens as t, defaultYear as r, emailValidation as a, generatePaddingClassName as f, getCommonProps as s, noOp as p, px as d, useNormalizedInputProps as l } from "./utils/index.js";
|
|
2
|
+
import { default as u } from "./pages/Page.js";
|
|
3
|
+
import { default as i } from "./components/Button/Button.js";
|
|
4
|
+
import { default as g } from "./components/IconButton/IconButton.js";
|
|
5
|
+
import { default as S } from "./components/ErrorBoundary/ErrorBoundary.js";
|
|
6
|
+
import { default as k } from "./components/Footer/Footer.js";
|
|
7
|
+
import { Grid as B } from "./components/Grid/Grid.js";
|
|
8
|
+
import { default as V } from "./components/Header/Header.js";
|
|
9
|
+
import { default as w } from "./components/HeroBanner/HeroBanner.js";
|
|
10
|
+
import { default as T } from "./components/Input/Input.js";
|
|
11
|
+
import { default as H } from "./components/Link/Link.js";
|
|
12
|
+
import { LinkVariants as y } from "./components/Link/utils.js";
|
|
13
|
+
import { default as A } from "./components/LinkBlock/LinkBlock.js";
|
|
14
|
+
import { default as F } from "./components/LinkList/LinkList.js";
|
|
15
|
+
import { default as O } from "./components/Row/Row.js";
|
|
16
|
+
import { default as Y } from "./components/GridItem/GridItem.js";
|
|
17
|
+
import { GridItemAlign as j } from "./components/GridItem/types.js";
|
|
18
|
+
import { default as v } from "./components/Select/Select.js";
|
|
19
|
+
import { default as J } from "./components/SplitPanel/SplitPanel.js";
|
|
20
|
+
import { default as Q } from "./components/Subscribe/Subscribe.js";
|
|
21
|
+
import { SubscriptionState as W } from "./components/Subscribe/types.js";
|
|
22
|
+
import { default as Z } from "./components/Social/Social.js";
|
|
23
|
+
import { default as $ } from "./components/ViewingsList/ViewingsList.js";
|
|
24
|
+
import { default as oe } from "./components/Modal/Modal.js";
|
|
25
|
+
import { default as re } from "./components/ViewingsList/StatefulViewingsList.js";
|
|
26
|
+
import { TextVariants as fe } from "./components/Text/types.js";
|
|
27
|
+
import { default as pe } from "./components/Text/Text.js";
|
|
28
28
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
29
|
+
i as Button,
|
|
30
|
+
S as ErrorBoundary,
|
|
31
|
+
k as Footer,
|
|
32
|
+
B as Grid,
|
|
33
|
+
Y as GridItem,
|
|
34
|
+
j as GridItemAlign,
|
|
35
|
+
V as Header,
|
|
36
|
+
w as HeroBanner,
|
|
37
|
+
g as IconButton,
|
|
38
|
+
T as Input,
|
|
39
|
+
H as Link,
|
|
40
|
+
A as LinkBlock,
|
|
41
|
+
F as LinkList,
|
|
42
|
+
y as LinkVariants,
|
|
43
|
+
oe as Modal,
|
|
44
|
+
t as PaddingTokens,
|
|
45
|
+
u as Page,
|
|
46
|
+
O as Row,
|
|
47
|
+
v as Select,
|
|
48
|
+
Z as Social,
|
|
49
|
+
J as SplitPanel,
|
|
50
|
+
re as StatefulViewingsList,
|
|
51
|
+
Q as Subscribe,
|
|
52
|
+
W as SubscriptionState,
|
|
53
|
+
pe as Text,
|
|
54
|
+
fe as TextVariants,
|
|
55
|
+
$ as ViewingsList,
|
|
56
|
+
r as defaultYear,
|
|
57
|
+
a as emailValidation,
|
|
58
|
+
f as generatePaddingClassName,
|
|
59
|
+
s as getCommonProps,
|
|
60
|
+
p as noOp,
|
|
61
|
+
d as px,
|
|
62
|
+
l as useNormalizedInputProps
|
|
62
63
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const x = /([\p{Ll}\d])(\p{Lu})/gu, P = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu, _ = /(\d)\p{Ll}|(\p{L})\d/u, R = /[^\p{L}\d]+/giu, h = "$1\0$2", L = "";
|
|
2
|
+
function E(r) {
|
|
3
|
+
let e = r.trim();
|
|
4
|
+
e = e.replace(x, h).replace(P, h), e = e.replace(R, "\0");
|
|
5
|
+
let l = 0, c = e.length;
|
|
6
|
+
for (; e.charAt(l) === "\0"; )
|
|
7
|
+
l++;
|
|
8
|
+
if (l === c)
|
|
9
|
+
return [];
|
|
10
|
+
for (; e.charAt(c - 1) === "\0"; )
|
|
11
|
+
c--;
|
|
12
|
+
return e.slice(l, c).split(/\0/g);
|
|
13
|
+
}
|
|
14
|
+
function o(r) {
|
|
15
|
+
var l;
|
|
16
|
+
const e = E(r);
|
|
17
|
+
for (let c = 0; c < e.length; c++) {
|
|
18
|
+
const a = e[c], t = _.exec(a);
|
|
19
|
+
if (t) {
|
|
20
|
+
const s = t.index + ((l = t[1]) != null ? l : t[2]).length;
|
|
21
|
+
e.splice(c, 1, a.slice(0, s), a.slice(s));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
function A(r, e) {
|
|
27
|
+
var t;
|
|
28
|
+
const [l, c, a] = w(r, e);
|
|
29
|
+
return l + c.map(C(e == null ? void 0 : e.locale)).join((t = e == null ? void 0 : e.delimiter) != null ? t : " ") + a;
|
|
30
|
+
}
|
|
31
|
+
function S(r, e) {
|
|
32
|
+
return A(r, { delimiter: "-", ...e });
|
|
33
|
+
}
|
|
34
|
+
function C(r) {
|
|
35
|
+
return r === !1 ? (e) => e.toLowerCase() : (e) => e.toLocaleLowerCase(r);
|
|
36
|
+
}
|
|
37
|
+
function w(r, e = {}) {
|
|
38
|
+
var i, f, u;
|
|
39
|
+
const l = (i = e.split) != null ? i : e.separateNumbers ? o : E, c = (f = e.prefixCharacters) != null ? f : L, a = (u = e.suffixCharacters) != null ? u : L;
|
|
40
|
+
let t = 0, s = r.length;
|
|
41
|
+
for (; t < r.length; ) {
|
|
42
|
+
const n = r.charAt(t);
|
|
43
|
+
if (!c.includes(n))
|
|
44
|
+
break;
|
|
45
|
+
t++;
|
|
46
|
+
}
|
|
47
|
+
for (; s > t; ) {
|
|
48
|
+
const n = s - 1, d = r.charAt(n);
|
|
49
|
+
if (!a.includes(d))
|
|
50
|
+
break;
|
|
51
|
+
s = n;
|
|
52
|
+
}
|
|
53
|
+
return [
|
|
54
|
+
r.slice(0, t),
|
|
55
|
+
l(r.slice(t, s)),
|
|
56
|
+
r.slice(s)
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
S as kebabCase,
|
|
61
|
+
A as noCase,
|
|
62
|
+
E as split,
|
|
63
|
+
o as splitSeparateNumbers
|
|
64
|
+
};
|
package/dist/scss/styles.scss
CHANGED
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
@import './typography';
|
|
8
8
|
@import './sharedClasses';
|
|
9
9
|
|
|
10
|
+
// 📑 Pages
|
|
11
|
+
@import 'pages/page';
|
|
12
|
+
|
|
10
13
|
// ⚛️ Components
|
|
11
14
|
@import 'components/Button/button';
|
|
12
15
|
@import 'components/IconButton/iconButton';
|
|
13
|
-
|
|
14
|
-
// @import 'components/DatePicker/datePicker';
|
|
15
16
|
@import 'components/Footer/footer';
|
|
16
17
|
@import 'components/Grid/grid';
|
|
17
18
|
@import 'components/Header/header';
|
|
@@ -29,6 +30,3 @@
|
|
|
29
30
|
@import 'components/LinkList/linkList';
|
|
30
31
|
@import 'components/Text/text';
|
|
31
32
|
@import 'components/Modal/modal';
|
|
32
|
-
|
|
33
|
-
// 📑 Pages
|
|
34
|
-
@import 'pages/page';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const px = "phillips";
|
|
3
|
+
/**
|
|
4
|
+
* Returns standard props values incorporating the component name into the class name and data-testid
|
|
5
|
+
*/
|
|
6
|
+
export declare const getCommonProps: ({ id, ...props }: {
|
|
7
|
+
id?: string | undefined;
|
|
8
|
+
}, componentName: string) => {
|
|
9
|
+
'data-testid': string;
|
|
10
|
+
className: string;
|
|
11
|
+
};
|
|
3
12
|
export declare enum PaddingTokens {
|
|
4
13
|
xs = "xs",
|
|
5
14
|
sm = "sm",
|
|
@@ -8,16 +17,6 @@ export declare enum PaddingTokens {
|
|
|
8
17
|
xl = "xl"
|
|
9
18
|
}
|
|
10
19
|
export declare const noOp: () => void;
|
|
11
|
-
export interface CommonProps {
|
|
12
|
-
/**
|
|
13
|
-
* Optional className to be applied to the outer most element
|
|
14
|
-
*/
|
|
15
|
-
className?: string;
|
|
16
|
-
/**
|
|
17
|
-
* A custom `id`
|
|
18
|
-
*/
|
|
19
|
-
id?: string;
|
|
20
|
-
}
|
|
21
20
|
export interface InputProps {
|
|
22
21
|
/**
|
|
23
22
|
* Specify whether the `<input>` should be disabled
|
package/dist/utils/index.js
CHANGED
|
@@ -1,36 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { kebabCase as c } from "../node_modules/change-case/dist/index.js";
|
|
3
|
+
const t = "phillips", v = ({ id: a, ...i }, e) => {
|
|
4
|
+
const l = c(e);
|
|
5
|
+
return {
|
|
6
|
+
...i,
|
|
7
|
+
"data-testid": a ? `${l}-${a}` : `${l}`,
|
|
8
|
+
className: `${t}-${l}`
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
var $ = /* @__PURE__ */ ((a) => (a.xs = "xs", a.sm = "sm", a.md = "md", a.lg = "lg", a.xl = "xl", a))($ || {});
|
|
12
|
+
const f = () => {
|
|
5
13
|
};
|
|
6
|
-
function
|
|
7
|
-
disabled:
|
|
8
|
-
id:
|
|
9
|
-
invalid:
|
|
10
|
-
invalidText:
|
|
11
|
-
readOnly:
|
|
12
|
-
type:
|
|
13
|
-
warn:
|
|
14
|
-
warnText:
|
|
14
|
+
function x({
|
|
15
|
+
disabled: a = !1,
|
|
16
|
+
id: i,
|
|
17
|
+
invalid: e = !1,
|
|
18
|
+
invalidText: l = "invalid",
|
|
19
|
+
readOnly: s = !1,
|
|
20
|
+
type: r,
|
|
21
|
+
warn: m = !1,
|
|
22
|
+
warnText: d
|
|
15
23
|
}) {
|
|
16
|
-
const
|
|
17
|
-
disabled: !
|
|
18
|
-
invalid: !
|
|
19
|
-
invalidId: `${
|
|
20
|
-
type:
|
|
21
|
-
warn: !
|
|
22
|
-
warnId: `${
|
|
24
|
+
const n = {
|
|
25
|
+
disabled: !s && a,
|
|
26
|
+
invalid: !s && !a && e,
|
|
27
|
+
invalidId: `${i}-error-msg`,
|
|
28
|
+
type: r === "toggle" ? "checkbox" : r,
|
|
29
|
+
warn: !s && !a && !e && m,
|
|
30
|
+
warnId: `${i}-warn-msg`,
|
|
23
31
|
validation: null
|
|
24
32
|
};
|
|
25
|
-
return
|
|
33
|
+
return n.invalid && (n.validation = /* @__PURE__ */ o("div", { className: `${t}-input__validation ${t}-${r}-input--invalid`, id: n.invalidId, children: l })), n.warn && (n.validation = /* @__PURE__ */ o("div", { className: `${t}-input__validation ${t}-${r}-input--warn`, id: n.warnId, children: d })), n;
|
|
26
34
|
}
|
|
27
|
-
const
|
|
35
|
+
const g = (/* @__PURE__ */ new Date()).getFullYear(), w = (a, i = "end", e = "vertical") => `${t}-padding-${e}-${a}-${i}`, N = (a) => /(.+)@(.+){2,}\.(.+){2,}/i.test(a);
|
|
28
36
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
v as
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
$ as PaddingTokens,
|
|
38
|
+
g as defaultYear,
|
|
39
|
+
N as emailValidation,
|
|
40
|
+
w as generatePaddingClassName,
|
|
41
|
+
v as getCommonProps,
|
|
42
|
+
f as noOp,
|
|
43
|
+
t as px,
|
|
44
|
+
x as useNormalizedInputProps
|
|
36
45
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phillips/seldon",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/PhillipsAuctionHouse/seldon"
|
|
@@ -32,12 +32,14 @@
|
|
|
32
32
|
"preview": "npx http-server storybook-static",
|
|
33
33
|
"clean": "rimraf './dist'",
|
|
34
34
|
"clean:stories": "rimraf './storybook-static'",
|
|
35
|
+
"create-component": "node --no-warnings --loader ts-node/esm .template/scripts/createComponent.ts",
|
|
35
36
|
"format": "prettier . --write",
|
|
36
37
|
"lint": "tsc --noEmit && eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 && npm run lint:styles",
|
|
37
38
|
"lint:styles": "stylelint \"src/**/*.scss\" --fix",
|
|
38
39
|
"prepare": "husky install"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
42
|
+
"change-case": "^5.4.4",
|
|
41
43
|
"classnames": "^2.5.1",
|
|
42
44
|
"flatpickr": "^4.6.13",
|
|
43
45
|
"react-modal": "^3.16.1"
|
|
@@ -46,18 +48,18 @@
|
|
|
46
48
|
"@chromatic-com/storybook": "^1.5.0",
|
|
47
49
|
"@commitlint/cli": "^19.3.0",
|
|
48
50
|
"@commitlint/config-conventional": "^19.2.2",
|
|
49
|
-
"@figma/code-connect": "^0.2.
|
|
51
|
+
"@figma/code-connect": "^0.2.1",
|
|
50
52
|
"@semantic-release/changelog": "^6.0.3",
|
|
51
53
|
"@semantic-release/git": "^10.0.1",
|
|
52
54
|
"@semantic-release/github": "^10.0.6",
|
|
53
|
-
"@storybook/addon-essentials": "^8.1.
|
|
55
|
+
"@storybook/addon-essentials": "^8.1.10",
|
|
54
56
|
"@storybook/addon-interactions": "^8.1.4",
|
|
55
57
|
"@storybook/addon-links": "^8.1.4",
|
|
56
|
-
"@storybook/addon-mdx-gfm": "^8.1.
|
|
58
|
+
"@storybook/addon-mdx-gfm": "^8.1.10",
|
|
57
59
|
"@storybook/blocks": "^8.1.4",
|
|
58
60
|
"@storybook/react": "^8.1.4",
|
|
59
61
|
"@storybook/react-vite": "^8.1.4",
|
|
60
|
-
"@storybook/theming": "^8.1.
|
|
62
|
+
"@storybook/theming": "^8.1.10",
|
|
61
63
|
"@testing-library/jest-dom": "^6.4.6",
|
|
62
64
|
"@testing-library/react": "^16.0.0",
|
|
63
65
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -71,6 +73,7 @@
|
|
|
71
73
|
"@vitest/coverage-v8": "^1.6.0",
|
|
72
74
|
"color": "^4.2.3",
|
|
73
75
|
"eslint": "^8.57.0",
|
|
76
|
+
"eslint-plugin-react": "^7.34.3",
|
|
74
77
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
75
78
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
76
79
|
"eslint-plugin-storybook": "^0.8.0",
|
|
@@ -82,14 +85,14 @@
|
|
|
82
85
|
"rimraf": "^5.0.7",
|
|
83
86
|
"rollup-plugin-copy": "^3.5.0",
|
|
84
87
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
85
|
-
"sass": "^1.77.
|
|
88
|
+
"sass": "^1.77.6",
|
|
86
89
|
"semantic-release": "^23.1.1",
|
|
87
90
|
"storybook": "^8.1.4",
|
|
88
91
|
"stylelint": "^16.6.1",
|
|
89
92
|
"stylelint-config-standard": "^36.0.0",
|
|
90
93
|
"stylelint-config-standard-scss": "^13.1.0",
|
|
91
94
|
"stylelint-order": "^6.0.4",
|
|
92
|
-
"stylelint-scss": "^6.3.
|
|
95
|
+
"stylelint-scss": "^6.3.2",
|
|
93
96
|
"ts-node": "^10.9.2",
|
|
94
97
|
"typescript": "^5.4.5",
|
|
95
98
|
"vite": "^5.3.1",
|