@phillips/seldon 1.7.2 → 1.9.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/Button/Button.d.ts +4 -4
- package/dist/components/Button/Button.js +8 -9
- package/dist/components/Header/Header.js +15 -15
- package/dist/components/Input/Input.js +41 -39
- package/dist/components/ViewingsList/StatefulViewingsList.d.ts +27 -0
- package/dist/components/ViewingsList/StatefulViewingsList.js +33 -0
- package/dist/components/ViewingsList/ViewingsList.d.ts +60 -0
- package/dist/components/ViewingsList/ViewingsList.js +54 -0
- package/dist/components/ViewingsList/ViewingsListCard.d.ts +85 -0
- package/dist/components/ViewingsList/ViewingsListCard.js +162 -0
- package/dist/components/ViewingsList/ViewingsListCardForm.d.ts +131 -0
- package/dist/components/ViewingsList/ViewingsListCardForm.js +218 -0
- package/dist/index.cjs +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +17 -13
- package/dist/scss/_typography.scss +2 -1
- package/dist/scss/_utils.scss +1 -1
- package/dist/scss/components/Button/_button.scss +14 -2
- package/dist/scss/components/Input/_input.scss +15 -3
- package/dist/scss/components/Toggle/_toggle.scss +7 -0
- package/dist/scss/components/ViewingsList/_viewingsList.scss +55 -0
- package/dist/scss/styles.scss +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommonProps } from '../../utils';
|
|
2
|
-
export interface ButtonProps extends CommonProps {
|
|
2
|
+
export interface ButtonProps extends CommonProps, Record<string, unknown> {
|
|
3
3
|
/**
|
|
4
4
|
* Button contents
|
|
5
5
|
*/
|
|
@@ -11,15 +11,15 @@ export interface ButtonProps extends CommonProps {
|
|
|
11
11
|
/**
|
|
12
12
|
* Optional click handler
|
|
13
13
|
*/
|
|
14
|
-
onClick?: () => void;
|
|
14
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => void | unknown;
|
|
15
15
|
/**
|
|
16
16
|
* Is this the principal call to action on the page?
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
buttonType?: 'primary' | 'secondary' | 'ghost';
|
|
19
19
|
/**
|
|
20
20
|
* How large should the button be?
|
|
21
21
|
*/
|
|
22
22
|
size?: 'sm' | 'md' | 'lg';
|
|
23
23
|
}
|
|
24
|
-
declare const Button: ({
|
|
24
|
+
declare const Button: ({ buttonType, size, children, iconLast, id, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export default Button;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import b from "../../node_modules/classnames/index.js";
|
|
3
3
|
import { px as t } from "../../utils/index.js";
|
|
4
|
-
const
|
|
4
|
+
const f = ({ buttonType: n = "primary", size: a = "md", children: r, iconLast: s = !1, id: o, ...u }) => /* @__PURE__ */ m(
|
|
5
5
|
"button",
|
|
6
6
|
{
|
|
7
7
|
"data-testid": o ? `button-${o}` : "button",
|
|
8
8
|
id: o,
|
|
9
9
|
type: "button",
|
|
10
|
-
className:
|
|
11
|
-
[`${t}-button--
|
|
12
|
-
[`${t}-button--icon-last`]: a
|
|
10
|
+
className: b(`${t}-button`, `${t}-button--${a}`, `${t}-button--${n}`, {
|
|
11
|
+
[`${t}-button--icon-last`]: s
|
|
13
12
|
}),
|
|
14
|
-
...
|
|
15
|
-
children:
|
|
13
|
+
...u,
|
|
14
|
+
children: r
|
|
16
15
|
}
|
|
17
16
|
);
|
|
18
17
|
export {
|
|
19
|
-
|
|
18
|
+
f as default
|
|
20
19
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, jsxs as e, Fragment as d } from "react/jsx-runtime";
|
|
2
2
|
import i from "../Button/Button.js";
|
|
3
|
-
const a = ({ user: n, onLogin:
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
3
|
+
const a = ({ user: n, onLogin: h, onLogout: r, onCreateAccount: c }) => /* @__PURE__ */ l("header", { children: /* @__PURE__ */ e("div", { className: "storybook-header", children: [
|
|
4
|
+
/* @__PURE__ */ e("div", { children: [
|
|
5
|
+
/* @__PURE__ */ l("svg", { width: "32", height: "32", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("g", { fill: "none", fillRule: "evenodd", children: [
|
|
6
|
+
/* @__PURE__ */ l("path", { d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z", fill: "#FFF" }),
|
|
7
|
+
/* @__PURE__ */ l("path", { d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z", fill: "#555AB9" }),
|
|
8
|
+
/* @__PURE__ */ l("path", { d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z", fill: "#91BAF8" })
|
|
9
9
|
] }) }),
|
|
10
|
-
/* @__PURE__ */
|
|
10
|
+
/* @__PURE__ */ l("h1", { children: "Acme" })
|
|
11
11
|
] }),
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
12
|
+
/* @__PURE__ */ l("div", { children: n ? /* @__PURE__ */ e(d, { children: [
|
|
13
|
+
/* @__PURE__ */ e("span", { className: "welcome", children: [
|
|
14
14
|
"Welcome, ",
|
|
15
|
-
/* @__PURE__ */
|
|
15
|
+
/* @__PURE__ */ l("b", { children: n.name }),
|
|
16
16
|
"!"
|
|
17
17
|
] }),
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
] }) : /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ l(i, { size: "sm", onClick: r, children: "Log out" })
|
|
19
|
+
] }) : /* @__PURE__ */ e(d, { children: [
|
|
20
|
+
/* @__PURE__ */ l(i, { size: "sm", onClick: h, children: "Log in" }),
|
|
21
|
+
/* @__PURE__ */ l(i, { size: "sm", onClick: c, children: "Sign up" })
|
|
22
22
|
] }) })
|
|
23
23
|
] }) });
|
|
24
24
|
export {
|
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import { jsxs as P, jsx as
|
|
1
|
+
import { jsxs as P, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import * as R from "react";
|
|
3
|
-
import
|
|
4
|
-
import { px as
|
|
3
|
+
import d from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { px as i, useNormalizedInputProps as y } from "../../utils/index.js";
|
|
5
5
|
const z = R.forwardRef(
|
|
6
6
|
({
|
|
7
|
-
className:
|
|
8
|
-
defaultValue:
|
|
7
|
+
className: a,
|
|
8
|
+
defaultValue: r,
|
|
9
9
|
disabled: u,
|
|
10
|
-
hideLabel:
|
|
11
|
-
id:
|
|
12
|
-
inline:
|
|
13
|
-
invalid:
|
|
14
|
-
invalidText:
|
|
15
|
-
labelText:
|
|
16
|
-
onChange:
|
|
17
|
-
onClick:
|
|
18
|
-
placeholder:
|
|
19
|
-
readOnly:
|
|
10
|
+
hideLabel: o,
|
|
11
|
+
id: t,
|
|
12
|
+
inline: m,
|
|
13
|
+
invalid: $,
|
|
14
|
+
invalidText: c,
|
|
15
|
+
labelText: _,
|
|
16
|
+
onChange: b,
|
|
17
|
+
onClick: f,
|
|
18
|
+
placeholder: h,
|
|
19
|
+
readOnly: p,
|
|
20
20
|
size: w = "md",
|
|
21
21
|
type: s = "text",
|
|
22
22
|
value: x,
|
|
23
|
-
warn:
|
|
24
|
-
warnText:
|
|
25
|
-
...
|
|
23
|
+
warn: v,
|
|
24
|
+
warnText: I,
|
|
25
|
+
...e
|
|
26
26
|
}, N) => {
|
|
27
|
-
const
|
|
28
|
-
[`${
|
|
29
|
-
[`${
|
|
30
|
-
[`${
|
|
31
|
-
[`${
|
|
32
|
-
[`${
|
|
33
|
-
[`${
|
|
27
|
+
const n = y({ disabled: u, id: t, invalid: $, invalidText: c, readOnly: p, type: s, warn: v, warnText: I }), j = d(`${i}-${s}-input`, `${i}-input`, `${i}-input--${w}`, {
|
|
28
|
+
[`${i}-input--inline`]: m,
|
|
29
|
+
[`${i}-input--readonly`]: p,
|
|
30
|
+
[`${i}-input--disabled`]: n.disabled,
|
|
31
|
+
[`${i}-input--invalid`]: n.invalid,
|
|
32
|
+
[`${i}-input--warn`]: n.warn,
|
|
33
|
+
[`${a}__wrapper`]: a,
|
|
34
|
+
[`${i}-input--hidden`]: e.hidden
|
|
34
35
|
});
|
|
35
36
|
return /* @__PURE__ */ P("div", { className: j, children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ l("label", { htmlFor: t, className: d(`${i}-input__label`, { [`${i}-input__label--hidden`]: o }), children: _ }),
|
|
38
|
+
/* @__PURE__ */ l(
|
|
38
39
|
"input",
|
|
39
40
|
{
|
|
40
|
-
className:
|
|
41
|
-
"data-testid":
|
|
42
|
-
defaultValue:
|
|
43
|
-
disabled:
|
|
44
|
-
id:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
className: d(`${i}-input__input`, { className: a }),
|
|
42
|
+
"data-testid": t,
|
|
43
|
+
defaultValue: r,
|
|
44
|
+
disabled: n.disabled,
|
|
45
|
+
id: t,
|
|
46
|
+
name: e.name,
|
|
47
|
+
onChange: b,
|
|
48
|
+
onClick: f,
|
|
49
|
+
placeholder: h,
|
|
50
|
+
readOnly: p,
|
|
49
51
|
ref: N,
|
|
50
|
-
type:
|
|
52
|
+
type: n.type,
|
|
51
53
|
value: x,
|
|
52
|
-
...
|
|
54
|
+
...e
|
|
53
55
|
}
|
|
54
56
|
),
|
|
55
|
-
|
|
57
|
+
n.validation
|
|
56
58
|
] });
|
|
57
59
|
}
|
|
58
60
|
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ViewingsListCardProps } from './ViewingsListCard';
|
|
3
|
+
import { I18nObject } from './ViewingsList';
|
|
4
|
+
export interface StatefulViewingsListProps extends Record<string, unknown> {
|
|
5
|
+
/**
|
|
6
|
+
* Existing viewings to populate the list
|
|
7
|
+
*/
|
|
8
|
+
defaultViewing?: ViewingsListCardProps[];
|
|
9
|
+
/**
|
|
10
|
+
* Optional strings to pass for the form and button labels
|
|
11
|
+
*/
|
|
12
|
+
i18n?: I18nObject;
|
|
13
|
+
/**
|
|
14
|
+
* Optional validations script to be ran when Viewing list is updated and saved
|
|
15
|
+
*/
|
|
16
|
+
validate?: ((e: ViewingsListCardProps) => object | undefined) | (() => object);
|
|
17
|
+
/**
|
|
18
|
+
* Method for removing a viewing from the list
|
|
19
|
+
*/
|
|
20
|
+
onDelete?: (id: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Method used to persist changes to a particular view
|
|
23
|
+
*/
|
|
24
|
+
onSave: (e: React.MouseEvent<HTMLElement>, cb: React.Dispatch<React.SetStateAction<ViewingsListCardProps[]>>, validateCb: (e: ViewingsListCardProps) => object | undefined) => boolean;
|
|
25
|
+
}
|
|
26
|
+
declare const StatefulViewingsList: ({ defaultViewing, i18n, validate, onDelete, onSave, ...props }: StatefulViewingsListProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export default StatefulViewingsList;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import c from "./ViewingsList.js";
|
|
4
|
+
const S = ({
|
|
5
|
+
defaultViewing: o,
|
|
6
|
+
i18n: d,
|
|
7
|
+
validate: a = () => {
|
|
8
|
+
},
|
|
9
|
+
onDelete: l = () => {
|
|
10
|
+
},
|
|
11
|
+
onSave: s,
|
|
12
|
+
...r
|
|
13
|
+
}) => {
|
|
14
|
+
const [f, n] = u.useState(o);
|
|
15
|
+
return /* @__PURE__ */ m(
|
|
16
|
+
c,
|
|
17
|
+
{
|
|
18
|
+
...r,
|
|
19
|
+
i18n: d,
|
|
20
|
+
viewings: f,
|
|
21
|
+
onDelete: (t) => {
|
|
22
|
+
n((e) => e == null ? void 0 : e.filter((i) => i.id !== t)), l(t);
|
|
23
|
+
},
|
|
24
|
+
onAdd: (t) => {
|
|
25
|
+
n((e) => e ? [...e, { id: t }] : [{ id: t }]);
|
|
26
|
+
},
|
|
27
|
+
onSave: (t) => s(t, n, a)
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
S as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ViewingsListCardProps } from './ViewingsListCard';
|
|
3
|
+
export interface I18nObject {
|
|
4
|
+
address1Label?: string;
|
|
5
|
+
addressUrlLabel?: string;
|
|
6
|
+
address2Label?: string;
|
|
7
|
+
address3Label?: string;
|
|
8
|
+
addViewingsBtnLabel?: string;
|
|
9
|
+
cancelBtnLabel?: string;
|
|
10
|
+
deleteBtnLabel?: string;
|
|
11
|
+
editBtnLabel?: string;
|
|
12
|
+
enableOnSiteToggleLabel?: string;
|
|
13
|
+
locationLabel?: string;
|
|
14
|
+
previewDatesLabel?: string;
|
|
15
|
+
previewHours1Label?: string;
|
|
16
|
+
previewHours2Label?: string;
|
|
17
|
+
previewLabel?: string;
|
|
18
|
+
previewToggleLabel?: string;
|
|
19
|
+
saveBtnLabel?: string;
|
|
20
|
+
viewingLabel?: string;
|
|
21
|
+
viewingDatesLabel?: string;
|
|
22
|
+
viewingHours1Label?: string;
|
|
23
|
+
viewingHours2Label?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ViewingsListProps {
|
|
26
|
+
/**
|
|
27
|
+
* String for Viewing cards that gets nuber appended. EX: 'Title {x}`
|
|
28
|
+
*/
|
|
29
|
+
cardTitle?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Unique id for component
|
|
32
|
+
*/
|
|
33
|
+
id?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Optional strings to pass for the form and button labels
|
|
36
|
+
*/
|
|
37
|
+
i18n?: I18nObject;
|
|
38
|
+
/**
|
|
39
|
+
* Title for Viewings list
|
|
40
|
+
*/
|
|
41
|
+
title?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Array of viewings objects
|
|
44
|
+
*/
|
|
45
|
+
viewings?: ViewingsListCardProps[] | [];
|
|
46
|
+
/**
|
|
47
|
+
* Method for removing a viewing from the list
|
|
48
|
+
*/
|
|
49
|
+
onAdd?: (id: string) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Method for removing a viewing from the list
|
|
52
|
+
*/
|
|
53
|
+
onDelete?: (id: string) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Method used to persist changes to a particular view
|
|
56
|
+
*/
|
|
57
|
+
onSave: (e: React.MouseEvent<HTMLElement>) => boolean;
|
|
58
|
+
}
|
|
59
|
+
declare const ViewingsList: ({ cardTitle, id, i18n, onAdd, onDelete, onSave, title, viewings, }: ViewingsListProps) => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
export default ViewingsList;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as B, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import p from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { px as $ } from "../../utils/index.js";
|
|
5
|
+
import M from "./ViewingsListCard.js";
|
|
6
|
+
import R from "../Button/Button.js";
|
|
7
|
+
const S = () => Math.floor(Math.random() * 100) + Date.now(), z = ({
|
|
8
|
+
cardTitle: O = "Viewing Details",
|
|
9
|
+
id: f,
|
|
10
|
+
i18n: r = {},
|
|
11
|
+
onAdd: m,
|
|
12
|
+
onDelete: e,
|
|
13
|
+
onSave: D,
|
|
14
|
+
title: x,
|
|
15
|
+
viewings: i
|
|
16
|
+
}) => {
|
|
17
|
+
const [a, h] = d.useState(i), [c, o] = d.useState(""), [s, u] = d.useState();
|
|
18
|
+
d.useEffect(() => {
|
|
19
|
+
h(i);
|
|
20
|
+
}, [i]);
|
|
21
|
+
const { addViewingsBtnLabel: C = "ADD VIEWINGS" } = r, E = () => {
|
|
22
|
+
const t = `${S()}${a ? "-" + a.length : ""}`;
|
|
23
|
+
o(t), u(t), m && m(t);
|
|
24
|
+
}, N = (t) => {
|
|
25
|
+
o(""), typeof e == "function" && e(t);
|
|
26
|
+
}, y = (t) => {
|
|
27
|
+
o(t), u(a == null ? void 0 : a.find((n) => n.id === t));
|
|
28
|
+
}, b = (t) => {
|
|
29
|
+
D(t) && o("");
|
|
30
|
+
}, j = () => {
|
|
31
|
+
typeof s == "string" ? typeof e == "function" && e(s) : c === (s == null ? void 0 : s.id) && h((t) => t == null ? void 0 : t.map((n) => n.id === s.id ? s : n)), o("");
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ B("div", { className: p(`${$}-viewings-list`), id: f, children: [
|
|
34
|
+
/* @__PURE__ */ l("h2", { className: p(`${$}-viewings-list__title`), children: x }),
|
|
35
|
+
a == null ? void 0 : a.map((t, n) => /* @__PURE__ */ l(
|
|
36
|
+
M,
|
|
37
|
+
{
|
|
38
|
+
...t,
|
|
39
|
+
...r,
|
|
40
|
+
cardTitle: t.location ? `${O} ${n + 1}` : void 0,
|
|
41
|
+
editState: c === t.id,
|
|
42
|
+
onCancel: j,
|
|
43
|
+
onDelete: N,
|
|
44
|
+
onEdit: () => y(t.id),
|
|
45
|
+
onSave: b
|
|
46
|
+
},
|
|
47
|
+
`${t.id}`
|
|
48
|
+
)),
|
|
49
|
+
/* @__PURE__ */ l(R, { id: `viewings-list-add-btn-${f || S()}`, size: "sm", onClick: E, children: C })
|
|
50
|
+
] }, c);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
z as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ViewingsListCardFormProps } from './ViewingsListCardForm';
|
|
3
|
+
export interface ViewingsListCardProps extends ViewingsListCardFormProps, Record<string, unknown> {
|
|
4
|
+
/**
|
|
5
|
+
* Title of card
|
|
6
|
+
*/
|
|
7
|
+
cardTitle?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional string to pass for cancel button
|
|
10
|
+
*/
|
|
11
|
+
cancelBtnLabel?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional string to pass for delete button
|
|
14
|
+
*/
|
|
15
|
+
deleteBtnLabel?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional string to pass for edit button
|
|
18
|
+
*/
|
|
19
|
+
editBtnLabel?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Location of viewing
|
|
22
|
+
*/
|
|
23
|
+
editState?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Default boolean to determine whether viewing is enabled on site
|
|
26
|
+
*/
|
|
27
|
+
enableOnSite?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Label for enable on site toggle
|
|
30
|
+
*/
|
|
31
|
+
enableOnSiteToggleLabel?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Location of viewing
|
|
34
|
+
*/
|
|
35
|
+
location?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Location of viewing
|
|
38
|
+
*/
|
|
39
|
+
locationLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Unique id for component
|
|
42
|
+
*/
|
|
43
|
+
id: string;
|
|
44
|
+
/**
|
|
45
|
+
* Validation error message object
|
|
46
|
+
*/
|
|
47
|
+
invalidFields?: {
|
|
48
|
+
address1?: string | undefined;
|
|
49
|
+
address1Url?: string | undefined;
|
|
50
|
+
address2?: string | undefined;
|
|
51
|
+
address3?: string | undefined;
|
|
52
|
+
location?: string | undefined;
|
|
53
|
+
previewDates?: string | undefined;
|
|
54
|
+
previewHours1?: string | undefined;
|
|
55
|
+
previewHours2?: string | undefined;
|
|
56
|
+
previewLabelValue?: string | undefined;
|
|
57
|
+
previewOn?: string | undefined;
|
|
58
|
+
viewingLabelValue?: string | undefined;
|
|
59
|
+
viewingDates?: string | undefined;
|
|
60
|
+
viewingHours1?: string | undefined;
|
|
61
|
+
viewingHours2?: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Callback for when Viewings edits are cancelled
|
|
65
|
+
*/
|
|
66
|
+
onCancel?: () => void | unknown;
|
|
67
|
+
/**
|
|
68
|
+
* Callback for when Viewings item is deleted
|
|
69
|
+
*/
|
|
70
|
+
onDelete?: (id: string) => void | unknown;
|
|
71
|
+
/**
|
|
72
|
+
* Callback for when Viewings item is placed in an editable mode
|
|
73
|
+
*/
|
|
74
|
+
onEdit?: () => void | unknown;
|
|
75
|
+
/**
|
|
76
|
+
* Callback for when form is saved/submitted
|
|
77
|
+
*/
|
|
78
|
+
onSave?: (e: React.MouseEvent<HTMLElement>) => void | unknown;
|
|
79
|
+
/**
|
|
80
|
+
* Optional string to pass for edit button
|
|
81
|
+
*/
|
|
82
|
+
saveBtnLabel?: string;
|
|
83
|
+
}
|
|
84
|
+
declare const ViewingsListCard: ({ address1, address1Label, addressUrl, addressUrlLabel, address2, address2Label, address3, address3Label, cancelBtnLabel, cardTitle, deleteBtnLabel, editBtnLabel, editState, enableOnSite, enableOnSiteToggleLabel, id, invalidFields, location, locationLabel, onCancel, onEdit, onDelete, onSave, previewDates, previewDatesLabel, previewHours1, previewHours1Label, previewHours2, previewHours2Label, previewLabel, previewLabelValue, previewOn, previewToggleLabel, saveBtnLabel, viewingLabel, viewingLabelValue, viewingDates, viewingDatesLabel, viewingHours1, viewingHours1Label, viewingHours2, viewingHours2Label, }: ViewingsListCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
export default ViewingsListCard;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import st from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { px as $ } from "../../utils/index.js";
|
|
5
|
+
import g from "../Input/Input.js";
|
|
6
|
+
import u from "../Button/Button.js";
|
|
7
|
+
import ct from "./ViewingsListCardForm.js";
|
|
8
|
+
const l = `${$}-viewings-list-card`, ft = ({
|
|
9
|
+
address1: C,
|
|
10
|
+
address1Label: E,
|
|
11
|
+
addressUrl: T,
|
|
12
|
+
addressUrlLabel: O,
|
|
13
|
+
address2: w,
|
|
14
|
+
address2Label: d,
|
|
15
|
+
address3: x,
|
|
16
|
+
address3Label: z,
|
|
17
|
+
cancelBtnLabel: L = "CANCEL",
|
|
18
|
+
cardTitle: _ = "Add New Viewing",
|
|
19
|
+
deleteBtnLabel: k = "DELETE",
|
|
20
|
+
editBtnLabel: N = "EDIT",
|
|
21
|
+
editState: o,
|
|
22
|
+
enableOnSite: i = "false",
|
|
23
|
+
enableOnSiteToggleLabel: V = "Enabled on website",
|
|
24
|
+
id: e,
|
|
25
|
+
invalidFields: n,
|
|
26
|
+
location: A,
|
|
27
|
+
locationLabel: I = "Location",
|
|
28
|
+
onCancel: p,
|
|
29
|
+
onEdit: f,
|
|
30
|
+
onDelete: m,
|
|
31
|
+
onSave: h,
|
|
32
|
+
previewDates: S,
|
|
33
|
+
previewDatesLabel: v,
|
|
34
|
+
previewHours1: j,
|
|
35
|
+
previewHours1Label: D,
|
|
36
|
+
previewHours2: R,
|
|
37
|
+
previewHours2Label: q,
|
|
38
|
+
previewLabel: B,
|
|
39
|
+
previewLabelValue: G,
|
|
40
|
+
previewOn: H,
|
|
41
|
+
previewToggleLabel: J,
|
|
42
|
+
saveBtnLabel: K = "SAVE DETAILS",
|
|
43
|
+
viewingLabel: M,
|
|
44
|
+
viewingLabelValue: P,
|
|
45
|
+
viewingDates: Q,
|
|
46
|
+
viewingDatesLabel: U,
|
|
47
|
+
viewingHours1: W,
|
|
48
|
+
viewingHours1Label: X,
|
|
49
|
+
viewingHours2: Y,
|
|
50
|
+
viewingHours2Label: Z
|
|
51
|
+
}) => {
|
|
52
|
+
const [F, tt] = r.useState(i === "true"), c = r.useRef(null);
|
|
53
|
+
r.useEffect(() => {
|
|
54
|
+
o && c.current && c.current.focus();
|
|
55
|
+
}, [o]), r.useEffect(() => {
|
|
56
|
+
var s, b;
|
|
57
|
+
n && c.current && ((b = (s = c.current.closest(".phillips-viewings-list-card")) == null ? void 0 : s.querySelector(".phillips-input--invalid input")) == null || b.focus());
|
|
58
|
+
}, [n]);
|
|
59
|
+
const et = () => {
|
|
60
|
+
typeof p == "function" && p();
|
|
61
|
+
}, nt = () => {
|
|
62
|
+
typeof f == "function" && f();
|
|
63
|
+
}, ot = (s) => {
|
|
64
|
+
typeof h == "function" && h(s);
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ a(
|
|
67
|
+
"section",
|
|
68
|
+
{
|
|
69
|
+
"data-testid": `viewings-list-card-${e}`,
|
|
70
|
+
id: e,
|
|
71
|
+
className: st(`${l}`, { [`${l}--edit-state`]: o }),
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ t("h3", { className: `${l}__title`, children: _ }),
|
|
74
|
+
/* @__PURE__ */ t("input", { type: "hidden", name: "id", value: e }),
|
|
75
|
+
/* @__PURE__ */ t(
|
|
76
|
+
g,
|
|
77
|
+
{
|
|
78
|
+
ref: c,
|
|
79
|
+
id: `location-${e}`,
|
|
80
|
+
defaultValue: A,
|
|
81
|
+
labelText: I,
|
|
82
|
+
size: "sm",
|
|
83
|
+
name: "location",
|
|
84
|
+
invalid: n == null ? void 0 : n.location,
|
|
85
|
+
invalidText: n == null ? void 0 : n.location,
|
|
86
|
+
readOnly: !o
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
o ? /* @__PURE__ */ t(
|
|
90
|
+
ct,
|
|
91
|
+
{
|
|
92
|
+
address1: C,
|
|
93
|
+
address1Label: E,
|
|
94
|
+
addressUrl: T,
|
|
95
|
+
addressUrlLabel: O,
|
|
96
|
+
address2: w,
|
|
97
|
+
address2Label: d,
|
|
98
|
+
address3: x,
|
|
99
|
+
address3Label: z,
|
|
100
|
+
id: e,
|
|
101
|
+
invalidFields: n,
|
|
102
|
+
previewDates: S,
|
|
103
|
+
previewDatesLabel: v,
|
|
104
|
+
previewHours1: j,
|
|
105
|
+
previewHours1Label: D,
|
|
106
|
+
previewHours2: R,
|
|
107
|
+
previewHours2Label: q,
|
|
108
|
+
previewLabel: B,
|
|
109
|
+
previewLabelValue: G,
|
|
110
|
+
previewOn: H,
|
|
111
|
+
previewToggleLabel: J,
|
|
112
|
+
viewingLabel: M,
|
|
113
|
+
viewingLabelValue: P,
|
|
114
|
+
viewingDates: Q,
|
|
115
|
+
viewingDatesLabel: U,
|
|
116
|
+
viewingHours1: W,
|
|
117
|
+
viewingHours1Label: X,
|
|
118
|
+
viewingHours2: Y,
|
|
119
|
+
viewingHours2Label: Z
|
|
120
|
+
}
|
|
121
|
+
) : null,
|
|
122
|
+
/* @__PURE__ */ t(
|
|
123
|
+
g,
|
|
124
|
+
{
|
|
125
|
+
id: `enableOnSite-${e}`,
|
|
126
|
+
type: "toggle",
|
|
127
|
+
defaultChecked: i === "true",
|
|
128
|
+
labelText: V,
|
|
129
|
+
size: "md",
|
|
130
|
+
inline: !0,
|
|
131
|
+
value: "true",
|
|
132
|
+
name: "enableOnSite",
|
|
133
|
+
onChange: () => tt((s) => !s),
|
|
134
|
+
readOnly: !o
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
F ? null : /* @__PURE__ */ t("input", { type: "hidden", name: "enableOnSite", value: "false" }),
|
|
138
|
+
/* @__PURE__ */ t("hr", {}),
|
|
139
|
+
/* @__PURE__ */ t("div", { className: `${l}__btn-group ${$}-button__group`, children: o ? /* @__PURE__ */ a(y, { children: [
|
|
140
|
+
/* @__PURE__ */ t(u, { id: `vlc-save-btn-${e}`, buttonType: "ghost", type: "submit", size: "sm", onClick: ot, children: K }),
|
|
141
|
+
/* @__PURE__ */ t(u, { id: `vlc-cancel-btn-${e}`, buttonType: "ghost", type: "button", size: "sm", onClick: et, children: L })
|
|
142
|
+
] }) : /* @__PURE__ */ a(y, { children: [
|
|
143
|
+
/* @__PURE__ */ t(u, { id: `vlc-edit-btn-${e}`, buttonType: "ghost", type: "button", size: "sm", onClick: nt, children: N }),
|
|
144
|
+
/* @__PURE__ */ t(
|
|
145
|
+
u,
|
|
146
|
+
{
|
|
147
|
+
id: `vlc-delete-btn-${e}`,
|
|
148
|
+
buttonType: "ghost",
|
|
149
|
+
type: "button",
|
|
150
|
+
size: "sm",
|
|
151
|
+
onClick: () => typeof m == "function" && m(e),
|
|
152
|
+
children: k
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
] }) })
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
export {
|
|
161
|
+
ft as default
|
|
162
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export interface ViewingsListCardFormProps {
|
|
2
|
+
/**
|
|
3
|
+
* Address1 of viewing
|
|
4
|
+
*/
|
|
5
|
+
address1?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Label for address1 input
|
|
8
|
+
*/
|
|
9
|
+
address1Label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* URL for a map link to address1
|
|
12
|
+
*/
|
|
13
|
+
addressUrl?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Label for address1 url input
|
|
16
|
+
*/
|
|
17
|
+
addressUrlLabel?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Address2 of viewing
|
|
20
|
+
*/
|
|
21
|
+
address2?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Label for address2 input
|
|
24
|
+
*/
|
|
25
|
+
address2Label?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Address3 of viewing
|
|
28
|
+
*/
|
|
29
|
+
address3?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Label for address3 input
|
|
32
|
+
*/
|
|
33
|
+
address3Label?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Unique id for ViewingListCard component
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* Validation error message object
|
|
40
|
+
*/
|
|
41
|
+
invalidFields?: {
|
|
42
|
+
address1?: string | undefined;
|
|
43
|
+
addressUrl?: string | undefined;
|
|
44
|
+
address2?: string | undefined;
|
|
45
|
+
address3?: string | undefined;
|
|
46
|
+
location?: string | undefined;
|
|
47
|
+
previewDates?: string | undefined;
|
|
48
|
+
previewHours1?: string | undefined;
|
|
49
|
+
previewHours2?: string | undefined;
|
|
50
|
+
previewLabelValue?: string | undefined;
|
|
51
|
+
previewOn?: string | undefined;
|
|
52
|
+
viewingLabelValue?: string | undefined;
|
|
53
|
+
viewingDates?: string | undefined;
|
|
54
|
+
viewingHours1?: string | undefined;
|
|
55
|
+
viewingHours2?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Label for preview label input
|
|
59
|
+
*/
|
|
60
|
+
previewLabel?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Value for preview label input
|
|
63
|
+
*/
|
|
64
|
+
previewLabelValue?: string;
|
|
65
|
+
/**
|
|
66
|
+
* How large should the button be?
|
|
67
|
+
*/
|
|
68
|
+
previewDates?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Label for preview date input
|
|
71
|
+
*/
|
|
72
|
+
previewDatesLabel?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Default value for preview hours input
|
|
75
|
+
*/
|
|
76
|
+
previewHours1?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Label for preview Hours1 input
|
|
79
|
+
*/
|
|
80
|
+
previewHours1Label?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Default value for preview hours 2 input
|
|
83
|
+
*/
|
|
84
|
+
previewHours2?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Label for preview Hours1 input
|
|
87
|
+
*/
|
|
88
|
+
previewHours2Label?: string;
|
|
89
|
+
/**
|
|
90
|
+
* How large should the button be?
|
|
91
|
+
*/
|
|
92
|
+
previewOn?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Label for preview sectioin toggle
|
|
95
|
+
*/
|
|
96
|
+
previewToggleLabel?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Label for viewing label input
|
|
99
|
+
*/
|
|
100
|
+
viewingLabel?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Value for viewing label input
|
|
103
|
+
*/
|
|
104
|
+
viewingLabelValue?: string;
|
|
105
|
+
/**
|
|
106
|
+
* How large should the button be?
|
|
107
|
+
*/
|
|
108
|
+
viewingDates?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Label for viewing date input
|
|
111
|
+
*/
|
|
112
|
+
viewingDatesLabel?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Default value for viewing hours input
|
|
115
|
+
*/
|
|
116
|
+
viewingHours1?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Label for viewing Hours1 input
|
|
119
|
+
*/
|
|
120
|
+
viewingHours1Label?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Default value for viewing hours 2 input
|
|
123
|
+
*/
|
|
124
|
+
viewingHours2?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Label for viewing Hours1 input
|
|
127
|
+
*/
|
|
128
|
+
viewingHours2Label?: string;
|
|
129
|
+
}
|
|
130
|
+
declare const ViewingsListCardForm: ({ address1, address1Label, addressUrl, addressUrlLabel, address2, address2Label, address3, address3Label, id, invalidFields, previewDates, previewDatesLabel, previewHours1, previewHours1Label, previewHours2, previewHours2Label, previewLabel, previewLabelValue, previewOn, previewToggleLabel, viewingLabel, viewingLabelValue, viewingDates, viewingDatesLabel, viewingHours1, viewingHours1Label, viewingHours2, viewingHours2Label, }: ViewingsListCardFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
131
|
+
export default ViewingsListCardForm;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { jsxs as p, Fragment as Y, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import Z from "../../node_modules/classnames/index.js";
|
|
3
|
+
import * as x from "react";
|
|
4
|
+
import { px as q } from "../../utils/index.js";
|
|
5
|
+
import u from "../Input/Input.js";
|
|
6
|
+
const T = `${q}-viewings-list-card-form`, M = ({
|
|
7
|
+
address1: b,
|
|
8
|
+
address1Label: f = "Address ('432 Park Ave', ETC)",
|
|
9
|
+
addressUrl: g,
|
|
10
|
+
addressUrlLabel: H = "URL for map link ('http://www.website.com')",
|
|
11
|
+
address2: V,
|
|
12
|
+
address2Label: a = "City, State, Zip ('New York, NY 10019')",
|
|
13
|
+
address3: $,
|
|
14
|
+
address3Label: c = "Country (United States)",
|
|
15
|
+
id: r,
|
|
16
|
+
invalidFields: e,
|
|
17
|
+
previewDates: z,
|
|
18
|
+
previewDatesLabel: h = "Date(s)",
|
|
19
|
+
previewHours1: L,
|
|
20
|
+
previewHours1Label: D = "Hours1",
|
|
21
|
+
previewHours2: C,
|
|
22
|
+
previewHours2Label: O = "Hours2",
|
|
23
|
+
previewLabel: U = "Label ('Preview', 'Opening NIght', etc)",
|
|
24
|
+
previewLabelValue: y,
|
|
25
|
+
previewOn: m = "false",
|
|
26
|
+
previewToggleLabel: S = "Preview/ Reception",
|
|
27
|
+
viewingLabel: k = "Label ('Open to public')",
|
|
28
|
+
viewingLabelValue: N,
|
|
29
|
+
viewingDates: P,
|
|
30
|
+
viewingDatesLabel: _ = "Date(s)",
|
|
31
|
+
viewingHours1: R,
|
|
32
|
+
viewingHours1Label: j = "Hours1",
|
|
33
|
+
viewingHours2: A,
|
|
34
|
+
viewingHours2Label: E = "Hours2"
|
|
35
|
+
}) => {
|
|
36
|
+
const [w, o] = x.useState(m === "true");
|
|
37
|
+
return x.useEffect(() => {
|
|
38
|
+
o(m === "true");
|
|
39
|
+
}, [m]), /* @__PURE__ */ p(Y, { children: [
|
|
40
|
+
/* @__PURE__ */ t(
|
|
41
|
+
u,
|
|
42
|
+
{
|
|
43
|
+
id: `previewOn-${r}`,
|
|
44
|
+
type: "toggle",
|
|
45
|
+
labelText: S,
|
|
46
|
+
size: "md",
|
|
47
|
+
defaultChecked: w,
|
|
48
|
+
inline: !0,
|
|
49
|
+
invalid: e == null ? void 0 : e.previewOn,
|
|
50
|
+
invalidText: e == null ? void 0 : e.previewOn,
|
|
51
|
+
value: !0,
|
|
52
|
+
name: "previewOn",
|
|
53
|
+
onChange: () => o((I) => !I)
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
w ? null : /* @__PURE__ */ t("input", { type: "hidden", name: "previewOn", value: "false" }),
|
|
57
|
+
/* @__PURE__ */ p(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: Z(`${T}__preview-set`, { [`${T}__preview-set--hidden`]: !w }),
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ t(
|
|
63
|
+
u,
|
|
64
|
+
{
|
|
65
|
+
id: `previewLabel-${r}`,
|
|
66
|
+
name: "previewLabelValue",
|
|
67
|
+
defaultValue: y,
|
|
68
|
+
labelText: U,
|
|
69
|
+
size: "sm",
|
|
70
|
+
invalid: e == null ? void 0 : e.previewLabelValue,
|
|
71
|
+
invalidText: e == null ? void 0 : e.previewLabelValue,
|
|
72
|
+
hidden: !w
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ t(
|
|
76
|
+
u,
|
|
77
|
+
{
|
|
78
|
+
id: `previewDates-${r}`,
|
|
79
|
+
name: "previewDates",
|
|
80
|
+
defaultValue: z,
|
|
81
|
+
labelText: h,
|
|
82
|
+
size: "sm",
|
|
83
|
+
invalid: e == null ? void 0 : e.previewDates,
|
|
84
|
+
invalidText: e == null ? void 0 : e.previewDates,
|
|
85
|
+
hidden: !w
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ t(
|
|
89
|
+
u,
|
|
90
|
+
{
|
|
91
|
+
id: `previewHours1-${r}`,
|
|
92
|
+
name: "previewHours1",
|
|
93
|
+
defaultValue: L,
|
|
94
|
+
labelText: D,
|
|
95
|
+
size: "sm",
|
|
96
|
+
invalid: e == null ? void 0 : e.previewHours1,
|
|
97
|
+
invalidText: e == null ? void 0 : e.previewHours1,
|
|
98
|
+
hidden: !w
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ t(
|
|
102
|
+
u,
|
|
103
|
+
{
|
|
104
|
+
id: `previewHours2-${r}`,
|
|
105
|
+
name: "previewHours2",
|
|
106
|
+
defaultValue: C,
|
|
107
|
+
labelText: O,
|
|
108
|
+
size: "sm",
|
|
109
|
+
invalid: e == null ? void 0 : e.previewHours2,
|
|
110
|
+
invalidText: e == null ? void 0 : e.previewHours2,
|
|
111
|
+
hidden: !w
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ t(
|
|
118
|
+
u,
|
|
119
|
+
{
|
|
120
|
+
id: `viewingLabel-${r}`,
|
|
121
|
+
name: "viewingLabelValue",
|
|
122
|
+
defaultValue: N,
|
|
123
|
+
labelText: k,
|
|
124
|
+
size: "sm",
|
|
125
|
+
invalid: e == null ? void 0 : e.viewingLabelValue,
|
|
126
|
+
invalidText: e == null ? void 0 : e.viewingLabelValue
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ t(
|
|
130
|
+
u,
|
|
131
|
+
{
|
|
132
|
+
id: `viewingDates-${r}`,
|
|
133
|
+
name: "viewingDates",
|
|
134
|
+
defaultValue: P,
|
|
135
|
+
labelText: _,
|
|
136
|
+
size: "sm",
|
|
137
|
+
invalid: e == null ? void 0 : e.viewingDates,
|
|
138
|
+
invalidText: e == null ? void 0 : e.viewingDates
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ t(
|
|
142
|
+
u,
|
|
143
|
+
{
|
|
144
|
+
id: `viewingHours1-${r}`,
|
|
145
|
+
name: "viewingHours1",
|
|
146
|
+
defaultValue: R,
|
|
147
|
+
labelText: j,
|
|
148
|
+
size: "sm",
|
|
149
|
+
invalid: e == null ? void 0 : e.viewingHours1,
|
|
150
|
+
invalidText: e == null ? void 0 : e.viewingHours1
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ t(
|
|
154
|
+
u,
|
|
155
|
+
{
|
|
156
|
+
id: `viewingHours2-${r}`,
|
|
157
|
+
name: "viewingHours2",
|
|
158
|
+
defaultValue: A,
|
|
159
|
+
labelText: E,
|
|
160
|
+
size: "sm",
|
|
161
|
+
invalid: e == null ? void 0 : e.viewingHours2,
|
|
162
|
+
invalidText: e == null ? void 0 : e.viewingHours2
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
/* @__PURE__ */ t(
|
|
166
|
+
u,
|
|
167
|
+
{
|
|
168
|
+
id: `address1-${r}`,
|
|
169
|
+
name: "address1",
|
|
170
|
+
defaultValue: b,
|
|
171
|
+
labelText: f,
|
|
172
|
+
size: "sm",
|
|
173
|
+
invalid: e == null ? void 0 : e.address1,
|
|
174
|
+
invalidText: e == null ? void 0 : e.address1
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
/* @__PURE__ */ t(
|
|
178
|
+
u,
|
|
179
|
+
{
|
|
180
|
+
id: `address2-${r}`,
|
|
181
|
+
name: "address2",
|
|
182
|
+
defaultValue: V,
|
|
183
|
+
labelText: a,
|
|
184
|
+
size: "sm",
|
|
185
|
+
invalid: e == null ? void 0 : e.address2,
|
|
186
|
+
invalidText: e == null ? void 0 : e.address2
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
/* @__PURE__ */ t(
|
|
190
|
+
u,
|
|
191
|
+
{
|
|
192
|
+
id: `address3-${r}`,
|
|
193
|
+
name: "address3",
|
|
194
|
+
defaultValue: $,
|
|
195
|
+
labelText: c,
|
|
196
|
+
size: "sm",
|
|
197
|
+
invalid: e == null ? void 0 : e.address3,
|
|
198
|
+
invalidText: e == null ? void 0 : e.address3
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ t(
|
|
202
|
+
u,
|
|
203
|
+
{
|
|
204
|
+
id: `addressUrl-${r}`,
|
|
205
|
+
name: "addressUrl",
|
|
206
|
+
defaultValue: g,
|
|
207
|
+
labelText: H,
|
|
208
|
+
size: "sm",
|
|
209
|
+
type: "url",
|
|
210
|
+
invalid: e == null ? void 0 : e.addressUrl,
|
|
211
|
+
invalidText: e == null ? void 0 : e.addressUrl
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
] });
|
|
215
|
+
};
|
|
216
|
+
export {
|
|
217
|
+
M as default
|
|
218
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var me=Object.defineProperty;var xe=(n,s,o)=>s in n?me(n,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[s]=o;var B=(n,s,o)=>(xe(n,typeof s!="symbol"?s+"":s,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),fe=require("react");function be(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const h=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(s,o,h.get?h:{enumerable:!0,get:()=>n[o]})}}return s.default=n,Object.freeze(s)}const i=be(fe);function je(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var W={exports:{}};/*!
|
|
2
|
+
Copyright (c) 2018 Jed Watson.
|
|
3
|
+
Licensed under the MIT License (MIT), see
|
|
4
|
+
http://jedwatson.github.io/classnames
|
|
5
|
+
*/(function(n){(function(){var s={}.hasOwnProperty;function o(){for(var h=[],p=0;p<arguments.length;p++){var u=arguments[p];if(u){var m=typeof u;if(m==="string"||m==="number")h.push(u);else if(Array.isArray(u)){if(u.length){var x=o.apply(null,u);x&&h.push(x)}}else if(m==="object"){if(u.toString!==Object.prototype.toString&&!u.toString.toString().includes("[native code]")){h.push(u.toString());continue}for(var r in u)s.call(u,r)&&u[r]&&h.push(r)}}}return h.join(" ")}n.exports?(o.default=o,n.exports=o):window.classNames=o})()})(W);var ge=W.exports;const S=je(ge),c="phillips";function Y({disabled:n=!1,id:s,invalid:o=!1,invalidText:h="invalid",readOnly:p=!1,type:u,warn:m=!1,warnText:x}){const r={disabled:!p&&n,invalid:!p&&!n&&o,invalidId:`${s}-error-msg`,type:u==="toggle"?"checkbox":u,warn:!p&&!n&&!o&&m,warnId:`${s}-warn-msg`,validation:null};return r.invalid&&(r.validation=e.jsx("div",{className:`${c}-input__validation ${c}-${u}-input--invalid`,id:r.invalidId,children:h})),r.warn&&(r.validation=e.jsx("div",{className:`${c}-input__validation ${c}-${u}-input--warn`,id:r.warnId,children:x})),r}const N=({buttonType:n="primary",size:s="md",children:o,iconLast:h=!1,id:p,...u})=>e.jsx("button",{"data-testid":p?`button-${p}`:"button",id:p,type:"button",className:S(`${c}-button`,`${c}-button--${s}`,`${c}-button--${n}`,{[`${c}-button--icon-last`]:h}),...u,children:o});class G extends i.Component{constructor(){super(...arguments);B(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(o,h){var p;(p=this.props)==null||p.logger(o,h.componentStack)}render(){return this.state.hasError?this.props.fallback||e.jsx("h2",{children:"Sorry... An error occurred and we are looking into it"}):this.props.children}}B(G,"defaultProps",{logger:console.log});const J=({user:n,onLogin:s,onLogout:o,onCreateAccount:h})=>e.jsx("header",{children:e.jsxs("div",{className:"storybook-header",children:[e.jsxs("div",{children:[e.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxs("g",{fill:"none",fillRule:"evenodd",children:[e.jsx("path",{d:"M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z",fill:"#FFF"}),e.jsx("path",{d:"M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z",fill:"#555AB9"}),e.jsx("path",{d:"M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z",fill:"#91BAF8"})]})}),e.jsx("h1",{children:"Acme"})]}),e.jsx("div",{children:n?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"welcome",children:["Welcome, ",e.jsx("b",{children:n.name}),"!"]}),e.jsx(N,{size:"sm",onClick:o,children:"Log out"})]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{size:"sm",onClick:s,children:"Log in"}),e.jsx(N,{size:"sm",onClick:h,children:"Sign up"})]})})]})}),D=`${c}-hero-banner`,we=({prehead:n,date:s,headerText:o,subHeadText:h,association:p,background:u,id:m})=>e.jsx("header",{"data-testid":m?`hero-banner-${m}`:"hero-banner",id:m,className:D,style:{"--background":u},children:e.jsxs("span",{className:`${D}__content-wrapper`,children:[n||s?e.jsxs("p",{className:`${D}__pre-head`,children:[n?e.jsx("span",{children:n}):null,s?e.jsx("span",{children:s}):null]}):null,e.jsxs("h1",{className:`${D}__heading`,children:[o,h?e.jsx("span",{children:h}):null]}),p?e.jsx("p",{children:p}):null]})}),w=i.forwardRef(({className:n,defaultValue:s,disabled:o,hideLabel:h,id:p,inline:u,invalid:m,invalidText:x,labelText:r,onChange:t,onClick:b,placeholder:f,readOnly:l,size:_="md",type:T="text",value:j,warn:g,warnText:z,...y},d)=>{const a=Y({disabled:o,id:p,invalid:m,invalidText:x,readOnly:l,type:T,warn:g,warnText:z}),$=S(`${c}-${T}-input`,`${c}-input`,`${c}-input--${_}`,{[`${c}-input--inline`]:u,[`${c}-input--readonly`]:l,[`${c}-input--disabled`]:a.disabled,[`${c}-input--invalid`]:a.invalid,[`${c}-input--warn`]:a.warn,[`${n}__wrapper`]:n,[`${c}-input--hidden`]:y.hidden});return e.jsxs("div",{className:$,children:[e.jsx("label",{htmlFor:p,className:S(`${c}-input__label`,{[`${c}-input__label--hidden`]:h}),children:r}),e.jsx("input",{className:S(`${c}-input__input`,{className:n}),"data-testid":p,defaultValue:s,disabled:a.disabled,id:p,name:y.name,onChange:t,onClick:b,placeholder:f,readOnly:l,ref:d,type:a.type,value:j,...y}),a.validation]})});w.displayName="Input";const $e=i.forwardRef(({children:n,className:s,defaultValue:o,disabled:h,hideLabel:p,id:u,inline:m,invalid:x,invalidText:r,labelText:t,onChange:b,onClick:f,readOnly:l,size:_="md",value:T,warn:j,warnText:g,...z},y)=>{const d="select",a=Y({disabled:h,id:u,invalid:x,invalidText:r,readOnly:l,type:d,warn:j,warnText:g}),$=S(`${c}-${d}-input`,`${c}-input`,`${c}-input--${_}`,{[`${c}-input--inline`]:m,[`${c}-input--readonly`]:l,[`${c}-input--disabled`]:a.disabled,[`${c}-input--invalid`]:a.invalid,[`${c}-input--warn`]:a.warn,[`${s}__wrapper`]:s});return e.jsxs("div",{className:$,children:[e.jsx("label",{htmlFor:u,className:S(`${c}-input__label`,{[`${c}-input__label--hidden`]:p}),children:t}),e.jsx("select",{className:S(`${c}-input__input`,{className:s}),"data-testid":u,defaultValue:o,disabled:a.disabled,id:u,onChange:b,onClick:f,ref:y,value:T,...z,children:n}),a.validation]})}),v=`${c}-viewings-list-card-form`,ie=({address1:n,address1Label:s="Address ('432 Park Ave', ETC)",addressUrl:o,addressUrlLabel:h="URL for map link ('http://www.website.com')",address2:p,address2Label:u="City, State, Zip ('New York, NY 10019')",address3:m,address3Label:x="Country (United States)",id:r,invalidFields:t,previewDates:b,previewDatesLabel:f="Date(s)",previewHours1:l,previewHours1Label:_="Hours1",previewHours2:T,previewHours2Label:j="Hours2",previewLabel:g="Label ('Preview', 'Opening NIght', etc)",previewLabelValue:z,previewOn:y="false",previewToggleLabel:d="Preview/ Reception",viewingLabel:a="Label ('Open to public')",viewingLabelValue:$,viewingDates:H,viewingDatesLabel:E="Date(s)",viewingHours1:A,viewingHours1Label:P="Hours1",viewingHours2:I,viewingHours2Label:R="Hours2"})=>{const[k,O]=i.useState(y==="true");return i.useEffect(()=>{O(y==="true")},[y]),e.jsxs(e.Fragment,{children:[e.jsx(w,{id:`previewOn-${r}`,type:"toggle",labelText:d,size:"md",defaultChecked:k,inline:!0,invalid:t==null?void 0:t.previewOn,invalidText:t==null?void 0:t.previewOn,value:!0,name:"previewOn",onChange:()=>O(U=>!U)}),k?null:e.jsx("input",{type:"hidden",name:"previewOn",value:"false"}),e.jsxs("div",{className:S(`${v}__preview-set`,{[`${v}__preview-set--hidden`]:!k}),children:[e.jsx(w,{id:`previewLabel-${r}`,name:"previewLabelValue",defaultValue:z,labelText:g,size:"sm",invalid:t==null?void 0:t.previewLabelValue,invalidText:t==null?void 0:t.previewLabelValue,hidden:!k}),e.jsx(w,{id:`previewDates-${r}`,name:"previewDates",defaultValue:b,labelText:f,size:"sm",invalid:t==null?void 0:t.previewDates,invalidText:t==null?void 0:t.previewDates,hidden:!k}),e.jsx(w,{id:`previewHours1-${r}`,name:"previewHours1",defaultValue:l,labelText:_,size:"sm",invalid:t==null?void 0:t.previewHours1,invalidText:t==null?void 0:t.previewHours1,hidden:!k}),e.jsx(w,{id:`previewHours2-${r}`,name:"previewHours2",defaultValue:T,labelText:j,size:"sm",invalid:t==null?void 0:t.previewHours2,invalidText:t==null?void 0:t.previewHours2,hidden:!k})]}),e.jsx(w,{id:`viewingLabel-${r}`,name:"viewingLabelValue",defaultValue:$,labelText:a,size:"sm",invalid:t==null?void 0:t.viewingLabelValue,invalidText:t==null?void 0:t.viewingLabelValue}),e.jsx(w,{id:`viewingDates-${r}`,name:"viewingDates",defaultValue:H,labelText:E,size:"sm",invalid:t==null?void 0:t.viewingDates,invalidText:t==null?void 0:t.viewingDates}),e.jsx(w,{id:`viewingHours1-${r}`,name:"viewingHours1",defaultValue:A,labelText:P,size:"sm",invalid:t==null?void 0:t.viewingHours1,invalidText:t==null?void 0:t.viewingHours1}),e.jsx(w,{id:`viewingHours2-${r}`,name:"viewingHours2",defaultValue:I,labelText:R,size:"sm",invalid:t==null?void 0:t.viewingHours2,invalidText:t==null?void 0:t.viewingHours2}),e.jsx(w,{id:`address1-${r}`,name:"address1",defaultValue:n,labelText:s,size:"sm",invalid:t==null?void 0:t.address1,invalidText:t==null?void 0:t.address1}),e.jsx(w,{id:`address2-${r}`,name:"address2",defaultValue:p,labelText:u,size:"sm",invalid:t==null?void 0:t.address2,invalidText:t==null?void 0:t.address2}),e.jsx(w,{id:`address3-${r}`,name:"address3",defaultValue:m,labelText:x,size:"sm",invalid:t==null?void 0:t.address3,invalidText:t==null?void 0:t.address3}),e.jsx(w,{id:`addressUrl-${r}`,name:"addressUrl",defaultValue:o,labelText:h,size:"sm",type:"url",invalid:t==null?void 0:t.addressUrl,invalidText:t==null?void 0:t.addressUrl})]})},L=`${c}-viewings-list-card`,ye=({address1:n,address1Label:s,addressUrl:o,addressUrlLabel:h,address2:p,address2Label:u,address3:m,address3Label:x,cancelBtnLabel:r="CANCEL",cardTitle:t="Add New Viewing",deleteBtnLabel:b="DELETE",editBtnLabel:f="EDIT",editState:l,enableOnSite:_="false",enableOnSiteToggleLabel:T="Enabled on website",id:j,invalidFields:g,location:z,locationLabel:y="Location",onCancel:d,onEdit:a,onDelete:$,onSave:H,previewDates:E,previewDatesLabel:A,previewHours1:P,previewHours1Label:I,previewHours2:R,previewHours2Label:k,previewLabel:O,previewLabelValue:U,previewOn:K,previewToggleLabel:Q,saveBtnLabel:X="SAVE DETAILS",viewingLabel:F,viewingLabelValue:ee,viewingDates:te,viewingDatesLabel:ne,viewingHours1:se,viewingHours1Label:re,viewingHours2:oe,viewingHours2Label:ae})=>{const[ce,ue]=i.useState(_==="true"),C=i.useRef(null);i.useEffect(()=>{l&&C.current&&C.current.focus()},[l]),i.useEffect(()=>{var V,M;g&&C.current&&((M=(V=C.current.closest(".phillips-viewings-list-card"))==null?void 0:V.querySelector(".phillips-input--invalid input"))==null||M.focus())},[g]);const pe=()=>{typeof d=="function"&&d()},he=()=>{typeof a=="function"&&a()},le=V=>{typeof H=="function"&&H(V)};return e.jsxs("section",{"data-testid":`viewings-list-card-${j}`,id:j,className:S(`${L}`,{[`${L}--edit-state`]:l}),children:[e.jsx("h3",{className:`${L}__title`,children:t}),e.jsx("input",{type:"hidden",name:"id",value:j}),e.jsx(w,{ref:C,id:`location-${j}`,defaultValue:z,labelText:y,size:"sm",name:"location",invalid:g==null?void 0:g.location,invalidText:g==null?void 0:g.location,readOnly:!l}),l?e.jsx(ie,{address1:n,address1Label:s,addressUrl:o,addressUrlLabel:h,address2:p,address2Label:u,address3:m,address3Label:x,id:j,invalidFields:g,previewDates:E,previewDatesLabel:A,previewHours1:P,previewHours1Label:I,previewHours2:R,previewHours2Label:k,previewLabel:O,previewLabelValue:U,previewOn:K,previewToggleLabel:Q,viewingLabel:F,viewingLabelValue:ee,viewingDates:te,viewingDatesLabel:ne,viewingHours1:se,viewingHours1Label:re,viewingHours2:oe,viewingHours2Label:ae}):null,e.jsx(w,{id:`enableOnSite-${j}`,type:"toggle",defaultChecked:_==="true",labelText:T,size:"md",inline:!0,value:"true",name:"enableOnSite",onChange:()=>ue(V=>!V),readOnly:!l}),ce?null:e.jsx("input",{type:"hidden",name:"enableOnSite",value:"false"}),e.jsx("hr",{}),e.jsx("div",{className:`${L}__btn-group ${c}-button__group`,children:l?e.jsxs(e.Fragment,{children:[e.jsx(N,{id:`vlc-save-btn-${j}`,buttonType:"ghost",type:"submit",size:"sm",onClick:le,children:X}),e.jsx(N,{id:`vlc-cancel-btn-${j}`,buttonType:"ghost",type:"button",size:"sm",onClick:pe,children:r})]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{id:`vlc-edit-btn-${j}`,buttonType:"ghost",type:"button",size:"sm",onClick:he,children:f}),e.jsx(N,{id:`vlc-delete-btn-${j}`,buttonType:"ghost",type:"button",size:"sm",onClick:()=>typeof $=="function"&&$(j),children:b})]})})]})},q=()=>Math.floor(Math.random()*100)+Date.now(),Z=({cardTitle:n="Viewing Details",id:s,i18n:o={},onAdd:h,onDelete:p,onSave:u,title:m,viewings:x})=>{const[r,t]=i.useState(x),[b,f]=i.useState(""),[l,_]=i.useState();i.useEffect(()=>{t(x)},[x]);const{addViewingsBtnLabel:T="ADD VIEWINGS"}=o,j=()=>{const a=`${q()}${r?"-"+r.length:""}`;f(a),_(a),h&&h(a)},g=a=>{f(""),typeof p=="function"&&p(a)},z=a=>{f(a),_(r==null?void 0:r.find($=>$.id===a))},y=a=>{u(a)&&f("")},d=()=>{typeof l=="string"?typeof p=="function"&&p(l):b===(l==null?void 0:l.id)&&t(a=>a==null?void 0:a.map($=>$.id===l.id?l:$)),f("")};return e.jsxs("div",{className:S(`${c}-viewings-list`),id:s,children:[e.jsx("h2",{className:S(`${c}-viewings-list__title`),children:m}),r==null?void 0:r.map((a,$)=>e.jsx(ye,{...a,...o,cardTitle:a.location?`${n} ${$+1}`:void 0,editState:b===a.id,onCancel:d,onDelete:g,onEdit:()=>z(a.id),onSave:y},`${a.id}`)),e.jsx(N,{id:`viewings-list-add-btn-${s||q()}`,size:"sm",onClick:j,children:T})]},b)},_e=({defaultViewing:n,i18n:s,validate:o=()=>{},onDelete:h=()=>{},onSave:p,...u})=>{const[m,x]=i.useState(n),r=b=>{x(f=>f==null?void 0:f.filter(l=>l.id!==b)),h(b)},t=b=>{x(f=>f?[...f,{id:b}]:[{id:b}])};return e.jsx(Z,{...u,i18n:s,viewings:m,onDelete:r,onAdd:t,onSave:b=>p(b,x,o)})},de=()=>{const[n,s]=i.useState();return e.jsxs("article",{children:[e.jsx(J,{user:n,onLogin:()=>s({name:"Jane Doe"}),onLogout:()=>s(void 0),onCreateAccount:()=>s({name:"Jane Doe"})}),e.jsxs("section",{className:"storybook-page",children:[e.jsx("h2",{children:"Pages in Storybook"}),e.jsxs("p",{children:["We recommend building UIs with a"," ",e.jsx("a",{href:"https://componentdriven.org",target:"_blank",rel:"noopener noreferrer",children:e.jsx("strong",{children:"component-driven"})})," ","process starting with atomic components and ending with pages."]}),e.jsx("p",{children:"Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:"}),e.jsxs("ul",{children:[e.jsx("li",{children:'Use a higher-level connected component. Storybook helps you compose such data from the "args" of child component stories'}),e.jsx("li",{children:"Assemble data in the page component from your services. You can mock these services out using Storybook."})]}),e.jsxs("p",{children:["Get a guided tutorial on component-driven development at"," ",e.jsx("a",{href:"https://storybook.js.org/tutorials/",target:"_blank",rel:"noopener noreferrer",children:"Storybook tutorials"}),". Read more in the"," ",e.jsx("a",{href:"https://storybook.js.org/docs",target:"_blank",rel:"noopener noreferrer",children:"docs"}),"."]}),e.jsxs("div",{className:"tip-wrapper",children:[e.jsx("span",{className:"tip",children:"Tip"})," Adjust the width of the canvas with the"," ",e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("g",{fill:"none",fillRule:"evenodd",children:e.jsx("path",{d:"M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z",id:"a",fill:"#999"})})}),"Viewports addon in the toolbar"]})]})]})};exports.Button=N;exports.ErrorBoundary=G;exports.Header=J;exports.HeroBanner=we;exports.Input=w;exports.Page=de;exports.Select=$e;exports.StatefulViewingsList=_e;exports.ViewingsList=Z;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ export { default as Header } from './components/Header/Header';
|
|
|
4
4
|
export { default as HeroBanner } from './components/HeroBanner/HeroBanner';
|
|
5
5
|
export { default as Input } from './components/Input/Input';
|
|
6
6
|
export { default as Select } from './components/Select/Select';
|
|
7
|
+
export { default as ViewingsList } from './components/ViewingsList/ViewingsList';
|
|
8
|
+
export { default as StatefulViewingsList } from './components/ViewingsList/StatefulViewingsList';
|
|
7
9
|
export { default as Page } from './pages/Page';
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
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
6
|
import { default as x } from "./components/Select/Select.js";
|
|
7
|
-
import { default as
|
|
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";
|
|
8
10
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
x as Select
|
|
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
|
|
16
20
|
};
|
package/dist/scss/_utils.scss
CHANGED
|
@@ -33,10 +33,11 @@
|
|
|
33
33
|
width: 1em;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
&--secondary
|
|
36
|
+
&--secondary,
|
|
37
|
+
&--ghost {
|
|
37
38
|
color: $text-color;
|
|
38
39
|
background-color: transparent;
|
|
39
|
-
|
|
40
|
+
border: 1px solid;
|
|
40
41
|
|
|
41
42
|
&:hover,
|
|
42
43
|
&:focus {
|
|
@@ -52,6 +53,10 @@
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
&--ghost {
|
|
57
|
+
border-color: transparent;
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
&.#{$px}-button--icon-last svg {
|
|
56
61
|
margin-inline-end: unset;
|
|
57
62
|
margin-inline-start: 0.5rem;
|
|
@@ -74,3 +79,10 @@
|
|
|
74
79
|
margin: 0;
|
|
75
80
|
}
|
|
76
81
|
}
|
|
82
|
+
|
|
83
|
+
.#{$px}-button__group {
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: 0.25rem;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
width: 100%;
|
|
88
|
+
}
|
|
@@ -8,9 +8,19 @@ $lg: #{$px}-input--lg;
|
|
|
8
8
|
.#{$px}-input {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
|
+
width: 100%;
|
|
12
|
+
|
|
13
|
+
&--hidden {
|
|
14
|
+
@include hidden();
|
|
15
|
+
}
|
|
11
16
|
|
|
12
17
|
&__label {
|
|
18
|
+
color: $keyline-gray;
|
|
19
|
+
font-size: 0.8125rem;
|
|
20
|
+
font-weight: 600;
|
|
13
21
|
margin-bottom: 0.5rem;
|
|
22
|
+
text-transform: uppercase;
|
|
23
|
+
word-break: break-word;
|
|
14
24
|
|
|
15
25
|
&--hidden {
|
|
16
26
|
@include hidden();
|
|
@@ -18,8 +28,10 @@ $lg: #{$px}-input--lg;
|
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
&__input {
|
|
21
|
-
accent-color: $
|
|
22
|
-
border:
|
|
31
|
+
accent-color: $soft-black;
|
|
32
|
+
border: 1px solid $keyline-gray;
|
|
33
|
+
border-radius: 0.1875rem;
|
|
34
|
+
font-size: 0.8125rem;
|
|
23
35
|
margin-bottom: 0.5rem;
|
|
24
36
|
padding: 0.5rem;
|
|
25
37
|
// width: 100%;
|
|
@@ -60,7 +72,7 @@ $lg: #{$px}-input--lg;
|
|
|
60
72
|
}
|
|
61
73
|
|
|
62
74
|
.#{$px}-input__label {
|
|
63
|
-
max-width: 8.75rem;
|
|
75
|
+
// max-width: 8.75rem;
|
|
64
76
|
}
|
|
65
77
|
}
|
|
66
78
|
|
|
@@ -182,4 +182,11 @@ $lg: #{$px}-input--lg;
|
|
|
182
182
|
padding-top: 3.5rem;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
+
|
|
186
|
+
&:has(.#{$px}-input__input:focus) label:before {
|
|
187
|
+
outline: 2px solid AccentColor;
|
|
188
|
+
outline: 2px solid Highlight;
|
|
189
|
+
outline: 2px solid -webkit-focus-ring-color;
|
|
190
|
+
outline-offset: 1px;
|
|
191
|
+
}
|
|
185
192
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@import '../../vars';
|
|
2
|
+
@import '../../_utils';
|
|
3
|
+
@import '../../typography';
|
|
4
|
+
|
|
5
|
+
.#{$px}-viewings-list {
|
|
6
|
+
align-items: center;
|
|
7
|
+
background-color: $off-white;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 2.5rem;
|
|
11
|
+
padding: 1rem;
|
|
12
|
+
width: 38rem;
|
|
13
|
+
|
|
14
|
+
&__title {
|
|
15
|
+
@include headerText;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// viewings-list-card-form
|
|
20
|
+
.#{$px}-viewings-list-card {
|
|
21
|
+
align-items: flex-start;
|
|
22
|
+
background-color: $pure-white;
|
|
23
|
+
border: 1px solid;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 1.5rem;
|
|
27
|
+
max-width: 34rem;
|
|
28
|
+
padding: 2rem;
|
|
29
|
+
width: 100%;
|
|
30
|
+
|
|
31
|
+
&__title {
|
|
32
|
+
@include headerText;
|
|
33
|
+
color: $soft-black;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__location {
|
|
37
|
+
font-size: 1.25rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-form__preview-set {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: 2rem;
|
|
44
|
+
padding-inline-start: 1rem;
|
|
45
|
+
width: 100%;
|
|
46
|
+
|
|
47
|
+
&--hidden {
|
|
48
|
+
@include hidden;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
hr {
|
|
53
|
+
width: 100%;
|
|
54
|
+
}
|
|
55
|
+
}
|
package/dist/scss/styles.scss
CHANGED
package/dist/utils/index.d.ts
CHANGED