@roomstay/frontend 2.1.24 → 2.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { TextBoxProps } from '../TextBox';
3
3
  import { Option, SelectProps } from './Select';
4
- type IInputSelectProps<TOption extends Option<KeyName>, KeyName extends string> = Pick<SelectProps<TOption, KeyName>, 'value' | 'onChange' | 'keyName' | 'labelName'> & Pick<TextBoxProps, 'label' | 'placeholder' | 'required'> & {
4
+ type IInputSelectProps<TOption extends Option<KeyName>, KeyName extends string> = Pick<SelectProps<TOption, KeyName>, 'value' | 'onChange' | 'keyName' | 'labelName'> & Pick<TextBoxProps, 'label' | 'placeholder' | 'required' | 'validationStatus'> & {
5
5
  options: TOption[];
6
6
  };
7
- export default function InputSelect<TOption extends Option<KeyName>, KeyName extends string>({ value, onChange, options, keyName, labelName, label, placeholder, required, }: IInputSelectProps<TOption, KeyName>): ReactElement | null;
7
+ export default function InputSelect<TOption extends Option<KeyName>, KeyName extends string>({ value, onChange, options, keyName, labelName, label, placeholder, required, validationStatus, }: IInputSelectProps<TOption, KeyName>): ReactElement | null;
8
8
  export {};
@@ -30,7 +30,9 @@ const react_1 = __importStar(require("react"));
30
30
  const TextBox_1 = __importDefault(require("../TextBox"));
31
31
  const Select_1 = require("./Select");
32
32
  const AutoFocusOnSelect_1 = require("../../../hooks/AutoFocusOnSelect");
33
- function InputSelect({ value, onChange, options, keyName, labelName, label, placeholder, required, }) {
33
+ const InputSelect_module_scss_1 = __importDefault(require("./InputSelect.module.scss"));
34
+ const Icon_1 = require("../Icon/Icon");
35
+ function InputSelect({ value, onChange, options, keyName, labelName, label, placeholder, required, validationStatus, }) {
34
36
  var _a;
35
37
  const [container, setContainer] = (0, react_1.useState)(null);
36
38
  const innerRef = (0, react_1.useRef)(null);
@@ -43,14 +45,13 @@ function InputSelect({ value, onChange, options, keyName, labelName, label, plac
43
45
  return (react_1.default.createElement(react_1.default.Fragment, null,
44
46
  react_1.default.createElement(TextBox_1.default, { label: label, inputProps: {
45
47
  onClick: onTriggerClicked,
46
- }, value: ((_a = getOption(value)) === null || _a === void 0 ? void 0 : _a.text) || '', ref: innerRef, placeholder: placeholder, required: required }),
47
- react_1.default.createElement("div", { ref: setContainer }),
48
+ autoComplete: 'off',
49
+ }, value: ((_a = getOption(value)) === null || _a === void 0 ? void 0 : _a.text) || '', ref: innerRef, placeholder: placeholder, required: required, validationStatus: validationStatus, className: InputSelect_module_scss_1.default['text-input'], icon: Icon_1.IconType.ArrowDown2, iconPosition: "right" }),
50
+ react_1.default.createElement("div", { ref: setContainer, style: { width: '100%', display: 'block' } }),
48
51
  react_1.default.createElement(Select_1.Select, { keyName: keyName, labelName: labelName, options: options, target: container, onClose: onDropdownClosed, onChange: (value) => {
49
52
  onItemSelected();
50
53
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
51
- }, open: isDropdownOpen, overlay: {
52
- className: 'w-100',
53
- } })));
54
+ }, open: isDropdownOpen })));
54
55
  }
55
56
  exports.default = InputSelect;
56
57
  //# sourceMappingURL=InputSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputSelect.js","sourceRoot":"/","sources":["src/components/generic/Select/InputSelect.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8D;AAC9D,2EAAqE;AACrE,+DAAiF;AACjF,iEAAiE;AAOjE,SAAwB,WAAW,CAA0D,EACzF,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,GAC0B;;IAClC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAwB,IAAI,CAAC,CAAC;IACxE,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAmB,IAAI,CAAC,CAAC;IAEhD,MAAM,SAAS,GAAG,CAAC,GAAsB,EAAuB,EAAE;QAC9D,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;IAC7D,CAAC,CAAC;IAEF,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,IAAA,wCAAoB,EAAC;QAChG,GAAG,EAAE,QAAQ,CAAC,OAAO;KACxB,CAAC,CAAC;IAEH,OAAO,CACH;QACI,8BAAC,iBAAO,IACJ,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE;gBACR,OAAO,EAAE,gBAAgB;aAC5B,EACD,KAAK,EAAE,CAAA,MAAA,SAAS,CAAC,KAAK,CAAC,0CAAE,IAAI,KAAI,EAAE,EACnC,GAAG,EAAE,QAAQ,EACb,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,GACpB;QACF,uCAAK,GAAG,EAAE,YAAY,GAAI;QAC1B,8BAAC,eAAM,IACH,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,cAAc,EAAE,CAAC;gBACjB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,KAAK,CAAC,CAAC;YACtB,CAAC,EACD,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE;gBACL,SAAS,EAAE,OAAO;aACrB,GACH,CACH,CACN,CAAC;AACN,CAAC;AAnDD,8BAmDC","sourcesContent":["import React, { ReactElement, useRef, useState } from 'react';\nimport TextBox, { TextBoxProps } from '@/components/generic/TextBox';\nimport { Option, Select, SelectProps } from '@/components/generic/Select/Select';\nimport { useAutoFocusOnSelect } from '@/hooks/AutoFocusOnSelect';\n\ntype IInputSelectProps<TOption extends Option<KeyName>, KeyName extends string> = Pick<SelectProps<TOption, KeyName>, 'value' | 'onChange' | 'keyName' | 'labelName'> &\n Pick<TextBoxProps, 'label' | 'placeholder' | 'required'> & {\n options: TOption[];\n };\n\nexport default function InputSelect<TOption extends Option<KeyName>, KeyName extends string>({\n value,\n onChange,\n options,\n keyName,\n labelName,\n label,\n placeholder,\n required,\n}: IInputSelectProps<TOption, KeyName>): ReactElement | null {\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const innerRef = useRef<HTMLInputElement>(null);\n\n const getOption = (key?: TOption[KeyName]): TOption | undefined => {\n return options.find((option) => option[keyName] === key);\n };\n\n const { onDropdownClosed, onItemSelected, onTriggerClicked, isDropdownOpen } = useAutoFocusOnSelect({\n ref: innerRef.current,\n });\n\n return (\n <>\n <TextBox\n label={label}\n inputProps={{\n onClick: onTriggerClicked,\n }}\n value={getOption(value)?.text || ''}\n ref={innerRef}\n placeholder={placeholder}\n required={required}\n />\n <div ref={setContainer} />\n <Select<TOption, KeyName>\n keyName={keyName}\n labelName={labelName}\n options={options}\n target={container}\n onClose={onDropdownClosed}\n onChange={(value) => {\n onItemSelected();\n onChange?.(value);\n }}\n open={isDropdownOpen}\n overlay={{\n className: 'w-100',\n }}\n />\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"InputSelect.js","sourceRoot":"/","sources":["src/components/generic/Select/InputSelect.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8D;AAC9D,2EAAqE;AACrE,+DAAiF;AACjF,iEAAiE;AAEjE,wFAA+C;AAC/C,uCAAwC;AAOxC,SAAwB,WAAW,CAA0D,EACzF,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,gBAAgB,GACkB;;IAClC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAwB,IAAI,CAAC,CAAC;IACxE,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAmB,IAAI,CAAC,CA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BAsDC","sourcesContent":["import React, { ReactElement, useRef, useState } from 'react';\nimport TextBox, { TextBoxProps } from '@/components/generic/TextBox';\nimport { Option, Select, SelectProps } from '@/components/generic/Select/Select';\nimport { useAutoFocusOnSelect } from '@/hooks/AutoFocusOnSelect';\n\nimport styles from './InputSelect.module.scss';\nimport { IconType } from '../Icon/Icon';\n\ntype IInputSelectProps<TOption extends Option<KeyName>, KeyName extends string> = Pick<SelectProps<TOption, KeyName>, 'value' | 'onChange' | 'keyName' | 'labelName'> &\n Pick<TextBoxProps, 'label' | 'placeholder' | 'required' | 'validationStatus'> & {\n options: TOption[];\n };\n\nexport default function InputSelect<TOption extends Option<KeyName>, KeyName extends string>({\n value,\n onChange,\n options,\n keyName,\n labelName,\n label,\n placeholder,\n required,\n validationStatus,\n}: IInputSelectProps<TOption, KeyName>): ReactElement | null {\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const innerRef = useRef<HTMLInputElement>(null);\n\n const getOption = (key?: TOption[KeyName]): TOption | undefined => {\n return options.find((option) => option[keyName] === key);\n };\n\n const { onDropdownClosed, onItemSelected, onTriggerClicked, isDropdownOpen } = useAutoFocusOnSelect({\n ref: innerRef.current,\n });\n\n return (\n <>\n <TextBox\n label={label}\n inputProps={{\n onClick: onTriggerClicked,\n autoComplete: 'off',\n }}\n value={getOption(value)?.text || ''}\n ref={innerRef}\n placeholder={placeholder}\n required={required}\n validationStatus={validationStatus}\n className={styles['text-input']}\n icon={IconType.ArrowDown2}\n iconPosition=\"right\"\n />\n <div ref={setContainer} style={{ width: '100%', display: 'block' }} />\n <Select<TOption, KeyName>\n keyName={keyName}\n labelName={labelName}\n options={options}\n target={container}\n onClose={onDropdownClosed}\n onChange={(value) => {\n onItemSelected();\n onChange?.(value);\n }}\n open={isDropdownOpen}\n />\n </>\n );\n}\n"]}
@@ -24,5 +24,5 @@ export interface TextProps extends PropsWithChildren<any> {
24
24
  style?: React.CSSProperties;
25
25
  lineThrough?: boolean;
26
26
  }
27
- export declare function Text(props: TextProps): JSX.Element;
27
+ export declare const Text: React.ForwardRefExoticComponent<Pick<TextProps, keyof TextProps> & React.RefAttributes<HTMLParagraphElement>>;
28
28
  export default Text;
@@ -1,10 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.Text = exports.TextTransform = exports.TextType = void 0;
7
- const react_1 = __importDefault(require("react"));
30
+ const react_1 = __importStar(require("react"));
8
31
  const classnames_1 = __importDefault(require("classnames"));
9
32
  var TextType;
10
33
  (function (TextType) {
@@ -18,7 +41,7 @@ var TextTransform;
18
41
  (function (TextTransform) {
19
42
  TextTransform["Uppercase"] = "u-uppercase";
20
43
  })(TextTransform = exports.TextTransform || (exports.TextTransform = {}));
21
- function Text(props) {
44
+ exports.Text = (0, react_1.forwardRef)(function Text(props, ref) {
22
45
  const defaultProps = Object.assign({ type: TextType.Body }, props);
23
46
  const transformClasses = {};
24
47
  if (props.transforms) {
@@ -33,8 +56,7 @@ function Text(props) {
33
56
  if (defaultProps.color) {
34
57
  styles.color = defaultProps.color;
35
58
  }
36
- return (react_1.default.createElement("p", { className: classes, style: styles }, props.children));
37
- }
38
- exports.Text = Text;
39
- exports.default = Text;
59
+ return (react_1.default.createElement("p", { className: classes, style: styles, ref: ref }, props.children));
60
+ });
61
+ exports.default = exports.Text;
40
62
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sourceRoot":"/","sources":["src/components/generic/Text.tsx"],"names":[],"mappings":";;;;;;AAEA,kDAA0B;AAE1B,4DAAoC;AAGpC,IAAY,QAKX;AALD,WAAY,QAAQ;IAChB,yBAAa,CAAA;IACb,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,2BAAe,CAAA;AACnB,CAAC,EALW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAKnB;AAED,yCAAyC;AACzC,IAAY,aAEX;AAFD,WAAY,aAAa;IACrB,0CAAyB,CAAA;AAC7B,CAAC,EAFW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAExB;AAgBD,SAAgB,IAAI,CAAC,KAAgB;IACjC,MAAM,YAAY,mBACd,IAAI,EAAE,QAAQ,CAAC,IAAI,IAChB,KAAK,CACX,CAAC;IAEF,MAAM,gBAAgB,GAAQ,EAAE,CAAC;IAEjC,IAAI,KAAK,CAAC,UAAU,EAAE;QAClB,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;KACjF;IAED,MAAM,YAAY,GAAQ,EAAE,CAAC;IAE7B,IAAI,KAAK,CAAC,SAAS,EAAE;QACjB,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;KACzE;IAED,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,KAAK,CAAC,KAAK,gCAClC,CAAC,QAAQ,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,YAAY,CAAC,IAAI,EAChD,eAAe,EAAE,KAAK,CAAC,MAAM,EAC7B,aAAa,EAAE,KAAK,CAAC,IAAI,EACzB,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,gBAAgB,EAAE,KAAK,CAAC,WAAW,IAChC,YAAY,GACZ,gBAAgB,EACrB,CAAC;IAEH,MAAM,MAAM,qBACL,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC,CAChC,CAAC;IAEF,IAAI,YAAY,CAAC,KAAK,EAAE;QACpB,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;KACrC;IAED,OAAO,CACH,qCAAG,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAC/B,KAAK,CAAC,QAAQ,CACf,CACP,CAAC;AACN,CAAC;AAzCD,oBAyCC;AAED,kBAAe,IAAI,CAAC","sourcesContent":["import { Color } from '@/util/Color';\nimport { TextAlign } from '@/util/TextAlignment';\nimport React from 'react';\n\nimport classNames from 'classnames';\nimport { PropsWithChildren } from 'react';\n\nexport enum TextType {\n Body = 'body',\n Small = 'small',\n Caption = 'caption',\n Label = 'label',\n}\n\n// Refactor to globalize for Headings too\nexport enum TextTransform {\n Uppercase = 'u-uppercase',\n}\n\nexport interface TextProps extends PropsWithChildren<any> {\n [x: string]: React.ReactNode;\n type?: TextType;\n color?: Color;\n align?: TextAlign;\n transforms?: TextTransform[];\n className?: string;\n inline?: boolean;\n bold?: boolean;\n preformatted?: boolean;\n style?: React.CSSProperties;\n lineThrough?: boolean;\n}\n\nexport function Text(props: TextProps) {\n const defaultProps: TextProps = {\n type: TextType.Body,\n ...props,\n };\n\n const transformClasses: any = {};\n\n if (props.transforms) {\n props.transforms.forEach((transform) => (transformClasses[transform] = true));\n }\n\n const extraClasses: any = {};\n\n if (props.className) {\n props.className.split(' ').forEach((it) => (extraClasses[it] = true));\n }\n\n const classes = classNames(props.align, {\n [`text-${defaultProps.type}`]: defaultProps.type,\n 'u-inline-flex': props.inline,\n 'u-text-bold': props.bold,\n 'u-pre-wrap': props.preformatted,\n 'u-line-through': props.lineThrough,\n ...extraClasses,\n ...transformClasses,\n });\n\n const styles: any = {\n ...(defaultProps.style || {}),\n };\n\n if (defaultProps.color) {\n styles.color = defaultProps.color;\n }\n\n return (\n <p className={classes} style={styles}>\n {props.children}\n </p>\n );\n}\n\nexport default Text;\n"]}
1
+ {"version":3,"file":"Text.js","sourceRoot":"/","sources":["src/components/generic/Text.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAA0C;AAE1C,4DAAoC;AAGpC,IAAY,QAKX;AALD,WAAY,QAAQ;IAChB,yBAAa,CAAA;IACb,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,2BAAe,CAAA;AACnB,CAAC,EALW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAKnB;AAED,yCAAyC;AACzC,IAAY,aAEX;AAFD,WAAY,aAAa;IACrB,0CAAyB,CAAA;AAC7B,CAAC,EAFW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAExB;AAgBY,QAAA,IAAI,GAAG,IAAA,kBAAU,EAAkC,SAAS,IAAI,CAAC,KAAK,EAAE,GAAG;IACpF,MAAM,YAAY,mBACd,IAAI,EAAE,QAAQ,CAAC,IAAI,IAChB,KAAK,CACX,CAAC;IAEF,MAAM,gBAAgB,GAAQ,EAAE,CAAC;IAEjC,IAAI,KAAK,CAAC,UAAU,EAAE;QAClB,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;KACjF;IAED,MAAM,YAAY,GAAQ,EAAE,CAAC;IAE7B,IAAI,KAAK,CAAC,SAAS,EAAE;QACjB,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;KACzE;IAED,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,KAAK,CAAC,KAAK,gCAClC,CAAC,QAAQ,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,YAAY,CAAC,IAAI,EAChD,eAAe,EAAE,KAAK,CAAC,MAAM,EAC7B,aAAa,EAAE,KAAK,CAAC,IAAI,EACzB,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,gBAAgB,EAAE,KAAK,CAAC,WAAW,IAChC,YAAY,GACZ,gBAAgB,EACrB,CAAC;IAEH,MAAM,MAAM,qBACL,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC,CAChC,CAAC;IAEF,IAAI,YAAY,CAAC,KAAK,EAAE;QACpB,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;KACrC;IAED,OAAO,CACH,qCAAG,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IACzC,KAAK,CAAC,QAAQ,CACf,CACP,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,kBAAe,YAAI,CAAC","sourcesContent":["import { Color } from '@/util/Color';\nimport { TextAlign } from '@/util/TextAlignment';\nimport React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\nimport { PropsWithChildren } from 'react';\n\nexport enum TextType {\n Body = 'body',\n Small = 'small',\n Caption = 'caption',\n Label = 'label',\n}\n\n// Refactor to globalize for Headings too\nexport enum TextTransform {\n Uppercase = 'u-uppercase',\n}\n\nexport interface TextProps extends PropsWithChildren<any> {\n [x: string]: React.ReactNode;\n type?: TextType;\n color?: Color;\n align?: TextAlign;\n transforms?: TextTransform[];\n className?: string;\n inline?: boolean;\n bold?: boolean;\n preformatted?: boolean;\n style?: React.CSSProperties;\n lineThrough?: boolean;\n}\n\nexport const Text = forwardRef<HTMLParagraphElement, TextProps>(function Text(props, ref) {\n const defaultProps: TextProps = {\n type: TextType.Body,\n ...props,\n };\n\n const transformClasses: any = {};\n\n if (props.transforms) {\n props.transforms.forEach((transform) => (transformClasses[transform] = true));\n }\n\n const extraClasses: any = {};\n\n if (props.className) {\n props.className.split(' ').forEach((it) => (extraClasses[it] = true));\n }\n\n const classes = classNames(props.align, {\n [`text-${defaultProps.type}`]: defaultProps.type,\n 'u-inline-flex': props.inline,\n 'u-text-bold': props.bold,\n 'u-pre-wrap': props.preformatted,\n 'u-line-through': props.lineThrough,\n ...extraClasses,\n ...transformClasses,\n });\n\n const styles: any = {\n ...(defaultProps.style || {}),\n };\n\n if (defaultProps.color) {\n styles.color = defaultProps.color;\n }\n\n return (\n <p className={classes} style={styles} ref={ref}>\n {props.children}\n </p>\n );\n});\n\nexport default Text;\n"]}
@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  export type TextAreaProps = JSX.IntrinsicElements['textarea'] & {
3
3
  label?: ReactNode;
4
4
  required?: boolean;
5
+ validationStatus?: 'error' | 'success';
5
6
  };
6
- declare const _default: React.ForwardRefExoticComponent<Pick<TextAreaProps, "label" | "key" | keyof React.TextareaHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
7
+ declare const _default: React.ForwardRefExoticComponent<Pick<TextAreaProps, "label" | "key" | keyof React.TextareaHTMLAttributes<HTMLTextAreaElement> | "validationStatus"> & React.RefAttributes<HTMLTextAreaElement>>;
7
8
  export default _default;
@@ -22,14 +22,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  const react_1 = __importStar(require("react"));
30
+ const classnames_1 = __importDefault(require("classnames"));
27
31
  const TextArea = (props, ref) => {
28
32
  return (react_1.default.createElement(react_1.default.Fragment, null,
29
33
  props.label && (react_1.default.createElement("label", { className: "u-marg-bottom--lighter text-bold d-flex" },
30
34
  props.label,
31
35
  (props === null || props === void 0 ? void 0 : props.required) && react_1.default.createElement("div", { style: { color: 'red' } }, "*"))),
32
- react_1.default.createElement("textarea", Object.assign({}, props, { ref: ref }))));
36
+ react_1.default.createElement("textarea", Object.assign({}, props, { className: (0, classnames_1.default)('textbox c-input', {
37
+ '--success': props.validationStatus === 'success',
38
+ '--error': props.validationStatus === 'error',
39
+ '--disabled': props.disabled,
40
+ }, props.className), ref: ref }))));
33
41
  };
34
42
  exports.default = (0, react_1.forwardRef)(TextArea);
35
43
  //# sourceMappingURL=TextArea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","sourceRoot":"/","sources":["src/components/generic/TextArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+E;AAO/E,MAAM,QAAQ,GAAiE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1F,OAAO,CACH;QACK,KAAK,CAAC,KAAK,IAAI,CACZ,yCAAO,SAAS,EAAC,yCAAyC;YACrD,KAAK,CAAC,KAAK;YACX,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,KAAI,uCAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAS,CACrD,CACX;QACD,4DAAc,KAAK,IAAE,GAAG,EAAE,GAAG,IAAI,CAClC,CACN,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,IAAA,kBAAU,EAAC,QAAQ,CAAC,CAAC","sourcesContent":["import React, { forwardRef, ForwardRefRenderFunction, ReactNode } from 'react';\n\nexport type TextAreaProps = JSX.IntrinsicElements['textarea'] & {\n label?: ReactNode;\n required?: boolean;\n};\n\nconst TextArea: ForwardRefRenderFunction<HTMLTextAreaElement, TextAreaProps> = (props, ref) => {\n return (\n <>\n {props.label && (\n <label className=\"u-marg-bottom--lighter text-bold d-flex\">\n {props.label}\n {props?.required && <div style={{ color: 'red' }}>*</div>}\n </label>\n )}\n <textarea {...props} ref={ref} />\n </>\n );\n};\n\nexport default forwardRef(TextArea);\n"]}
1
+ {"version":3,"file":"TextArea.js","sourceRoot":"/","sources":["src/components/generic/TextArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+E;AAC/E,4DAAoC;AAQpC,MAAM,QAAQ,GAAiE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1F,OAAO,CACH;QACK,KAAK,CAAC,KAAK,IAAI,CACZ,yCAAO,SAAS,EAAC,yCAAyC;YACrD,KAAK,CAAC,KAAK;YACX,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,KAAI,uCAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAS,CACrD,CACX;QACD,4DACQ,KAAK,IACT,SAAS,EAAE,IAAA,oBAAU,EACjB,iBAAiB,EACjB;gBACI,WAAW,EAAE,KAAK,CAAC,gBAAgB,KAAK,SAAS;gBACjD,SAAS,EAAE,KAAK,CAAC,gBAAgB,KAAK,OAAO;gBAC7C,YAAY,EAAE,KAAK,CAAC,QAAQ;aAC/B,EACD,KAAK,CAAC,SAAS,CAClB,EACD,GAAG,EAAE,GAAG,IACV,CACH,CACN,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,IAAA,kBAAU,EAAC,QAAQ,CAAC,CAAC","sourcesContent":["import React, { forwardRef, ForwardRefRenderFunction, ReactNode } from 'react';\nimport classNames from 'classnames';\n\nexport type TextAreaProps = JSX.IntrinsicElements['textarea'] & {\n label?: ReactNode;\n required?: boolean;\n validationStatus?: 'error' | 'success';\n};\n\nconst TextArea: ForwardRefRenderFunction<HTMLTextAreaElement, TextAreaProps> = (props, ref) => {\n return (\n <>\n {props.label && (\n <label className=\"u-marg-bottom--lighter text-bold d-flex\">\n {props.label}\n {props?.required && <div style={{ color: 'red' }}>*</div>}\n </label>\n )}\n <textarea\n {...props}\n className={classNames(\n 'textbox c-input',\n {\n '--success': props.validationStatus === 'success',\n '--error': props.validationStatus === 'error',\n '--disabled': props.disabled,\n },\n props.className\n )}\n ref={ref}\n />\n </>\n );\n};\n\nexport default forwardRef(TextArea);\n"]}
@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  import { IconType } from './Icon/Icon';
3
3
  export interface TextBoxProps {
4
4
  icon?: IconType;
5
+ iconPosition?: 'left' | 'right';
5
6
  placeholder?: string;
6
7
  wide?: boolean;
7
8
  type?: 'text' | 'tel' | 'password' | 'email';
@@ -35,6 +35,7 @@ const TextBox = (props, ref) => {
35
35
  const inputProperties = Object.assign({ type, className: 'text-small', placeholder: props.placeholder }, props.inputProps);
36
36
  if (props.name) {
37
37
  inputProperties.name = props.name;
38
+ inputProperties.id = `${props.name}${type}Input`;
38
39
  }
39
40
  if (props.required) {
40
41
  inputProperties.required = props.required;
@@ -53,6 +54,7 @@ const TextBox = (props, ref) => {
53
54
  }
54
55
  const classes = (0, classnames_1.default)('textbox c-input', {
55
56
  '--has-icon': !!icon,
57
+ [`--icon-${props.iconPosition}`]: !!props.iconPosition,
56
58
  '--selected': selected,
57
59
  '--wide': props.wide,
58
60
  '--success': props.validationStatus === 'success',
@@ -65,15 +67,14 @@ const TextBox = (props, ref) => {
65
67
  const onBlurHandler = () => {
66
68
  return setSelected(false);
67
69
  };
68
- const id = `${props.name}${type}Input`;
69
70
  return (react_1.default.createElement(react_1.default.Fragment, null,
70
- props.label && (react_1.default.createElement("label", { className: "text-bold d-flex u-marg-bottom--lighter", htmlFor: id },
71
+ props.label && (react_1.default.createElement("label", { className: "text-bold d-flex u-marg-bottom--lighter", htmlFor: inputProperties.id },
71
72
  react_1.default.createElement(react_1.default.Fragment, null,
72
73
  props.label,
73
74
  (props === null || props === void 0 ? void 0 : props.required) && react_1.default.createElement("div", { style: { color: 'red' } }, "*")))),
74
75
  react_1.default.createElement("label", { className: classes },
75
76
  icon,
76
- react_1.default.createElement("input", Object.assign({}, inputProperties, { id: id, ref: ref, value: props.value, onFocus: onFocusHandler, onBlur: onBlurHandler, onKeyPress: props.onKeyPress })))));
77
+ react_1.default.createElement("input", Object.assign({}, inputProperties, { ref: ref, value: props.value, onFocus: onFocusHandler, onBlur: onBlurHandler, onKeyPress: props.onKeyPress })))));
77
78
  };
78
79
  exports.default = react_1.default.forwardRef(TextBox);
79
80
  //# sourceMappingURL=TextBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextBox.js","sourceRoot":"/","sources":["src/components/generic/TextBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA6E;AAC7E,0EAAgE;AAEhE,4DAAoC;AAwBpC,MAAM,OAAO,GAA6D,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACrF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,eAAe,mBACjB,IAAI,EACJ,SAAS,EAAE,YAAY,EACvB,WAAW,EAAE,KAAK,CAAC,WAAW,IAC3B,KAAK,CAAC,UAAU,CACtB,CAAC;IAEF,IAAI,KAAK,CAAC,IAAI,EAAE;QACZ,eAAe,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;KACrC;IAED,IAAI,KAAK,CAAC,QAAQ,EAAE;QAChB,eAAe,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;KAC7C;IAED,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K,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAS,CAC1D,CACC,CACX;QACD,yCAAO,SAAS,EAAE,OAAO;YACpB,IAAI;YACL,yDAAW,eAAe,IAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,CAC9I,CACT,CACN,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,eAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import React, { ForwardRefRenderFunction, ReactNode, useState } from 'react';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\n\nimport classNames from 'classnames';\n\nexport interface TextBoxProps {\n icon?: IconType;\n placeholder?: string;\n wide?: boolean;\n type?: 'text' | 'tel' | 'password' | 'email';\n name?: string;\n required?: boolean;\n label?: ReactNode;\n\n validationStatus?: 'success' | 'error';\n\n value?: string;\n\n className?: string;\n\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n\n inputProps?: Omit<JSX.IntrinsicElements['input'], 'id' | 'ref' | 'value' | 'onFocus' | 'onBlur' | 'onKeyPress'>;\n\n onKeyPress?: JSX.IntrinsicElements['input']['onKeyPress'];\n}\n\nconst TextBox: ForwardRefRenderFunction<HTMLInputElement, TextBoxProps> = (props, ref) => {\n const [selected, setSelected] = useState(false);\n\n const type = props.type ? props.type : 'text';\n const inputProperties: JSX.IntrinsicElements['input'] = {\n type,\n className: 'text-small',\n placeholder: props.placeholder,\n ...props.inputProps,\n };\n\n if (props.name) {\n inputProperties.name = props.name;\n }\n\n if (props.required) {\n inputProperties.required = props.required;\n }\n\n const onChange: JSX.IntrinsicElements['input']['onChange'] = (e) => {\n if (props.onChange) {\n props.onChange(e);\n }\n };\n\n if (props.onChange) {\n inputProperties.onChange = onChange;\n }\n\n let icon: ReactNode = '';\n\n if (props.icon) {\n icon = <Icon icon={props.icon} size=\"1em\" />;\n }\n\n const classes = classNames(\n 'textbox c-input',\n {\n '--has-icon': !!icon,\n '--selected': selected,\n '--wide': props.wide,\n '--success': props.validationStatus === 'success',\n '--error': props.validationStatus === 'error',\n '--disabled': inputProperties.disabled,\n },\n props.className\n );\n const onFocusHandler = () => {\n return setSelected(true);\n };\n const onBlurHandler = () => {\n return setSelected(false);\n };\n\n const id = `${props.name}${type}Input`;\n\n return (\n <>\n {props.label && (\n <label className=\"text-bold d-flex u-marg-bottom--lighter\" htmlFor={id}>\n <>\n {props.label}\n {props?.required && <div style={{ color: 'red' }}>*</div>}\n </>\n </label>\n )}\n <label className={classes}>\n {icon}\n <input {...inputProperties} id={id} ref={ref} value={props.value} onFocus={onFocusHandler} onBlur={onBlurHandler} onKeyPress={props.onKeyPress} />\n </label>\n </>\n );\n};\n\nexport default React.forwardRef(TextBox);\n"]}
1
+ {"version":3,"file":"TextBox.js","sourceRoot":"/","sources":["src/components/generic/TextBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA6E;AAC7E,0EAAgE;AAEhE,4DAAoC;AAyBpC,MAAM,OAAO,GAA6D,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACrF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,eAAe,mBACjB,IAAI,EACJ,SAAS,EAAE,YAAY,EACvB,WAAW,EAAE,KAAK,CAAC,WAAW,IAC3B,KAAK,CAAC,UAAU,CACtB,CAAC;IAEF,IAAI,KAAK,CAAC,IAAI,EAAE;QACZ,eAAe,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAClC,eAAe,CAAC,EAAE,GAA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AAK,IAAI,CACZ,yCAAO,SAAS,EAAC,yCAAyC,EAAC,OAAO,EAAE,eAAe,CAAC,EAAE;YAClF;gBACK,KAAK,CAAC,KAAK;gBACX,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,KAAI,uCAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAS,CAC1D,CACC,CACX;QACD,yCAAO,SAAS,EAAE,OAAO;YACpB,IAAI;YACL,yDAAW,eAAe,IAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,CACtI,CACT,CACN,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,eAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import React, { ForwardRefRenderFunction, ReactNode, useState } from 'react';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\n\nimport classNames from 'classnames';\n\nexport interface TextBoxProps {\n icon?: IconType;\n iconPosition?: 'left' | 'right';\n placeholder?: string;\n wide?: boolean;\n type?: 'text' | 'tel' | 'password' | 'email';\n name?: string;\n required?: boolean;\n label?: ReactNode;\n\n validationStatus?: 'success' | 'error';\n\n value?: string;\n\n className?: string;\n\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n\n inputProps?: Omit<JSX.IntrinsicElements['input'], 'id' | 'ref' | 'value' | 'onFocus' | 'onBlur' | 'onKeyPress'>;\n\n onKeyPress?: JSX.IntrinsicElements['input']['onKeyPress'];\n}\n\nconst TextBox: ForwardRefRenderFunction<HTMLInputElement, TextBoxProps> = (props, ref) => {\n const [selected, setSelected] = useState(false);\n\n const type = props.type ? props.type : 'text';\n const inputProperties: JSX.IntrinsicElements['input'] = {\n type,\n className: 'text-small',\n placeholder: props.placeholder,\n ...props.inputProps,\n };\n\n if (props.name) {\n inputProperties.name = props.name;\n inputProperties.id = `${props.name}${type}Input`;\n }\n\n if (props.required) {\n inputProperties.required = props.required;\n }\n\n const onChange: JSX.IntrinsicElements['input']['onChange'] = (e) => {\n if (props.onChange) {\n props.onChange(e);\n }\n };\n\n if (props.onChange) {\n inputProperties.onChange = onChange;\n }\n\n let icon: ReactNode = '';\n\n if (props.icon) {\n icon = <Icon icon={props.icon} size=\"1em\" />;\n }\n\n const classes = classNames(\n 'textbox c-input',\n {\n '--has-icon': !!icon,\n [`--icon-${props.iconPosition}`]: !!props.iconPosition,\n '--selected': selected,\n '--wide': props.wide,\n '--success': props.validationStatus === 'success',\n '--error': props.validationStatus === 'error',\n '--disabled': inputProperties.disabled,\n },\n props.className\n );\n const onFocusHandler = () => {\n return setSelected(true);\n };\n const onBlurHandler = () => {\n return setSelected(false);\n };\n\n return (\n <>\n {props.label && (\n <label className=\"text-bold d-flex u-marg-bottom--lighter\" htmlFor={inputProperties.id}>\n <>\n {props.label}\n {props?.required && <div style={{ color: 'red' }}>*</div>}\n </>\n </label>\n )}\n <label className={classes}>\n {icon}\n <input {...inputProperties} ref={ref} value={props.value} onFocus={onFocusHandler} onBlur={onBlurHandler} onKeyPress={props.onKeyPress} />\n </label>\n </>\n );\n};\n\nexport default React.forwardRef(TextBox);\n"]}
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  interface ConfirmationFormContextType {
3
3
  errorChecks: (() => ConfirmationValidator)[];
4
+ /** @deprecated */
4
5
  addErrorCheck: (check: () => ConfirmationValidator) => void;
6
+ addErrorChecks: (...checks: (() => ConfirmationValidator)[]) => void;
5
7
  }
6
8
  export declare const ConfirmationFormContext: React.Context<ConfirmationFormContextType | null>;
7
9
  interface ConfirmationFormContextWrapperProps {
@@ -6,26 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ConfirmationFormContextWrapper = exports.ConfirmationFormContext = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const react_2 = require("react");
9
+ const lodash_1 = require("lodash");
9
10
  exports.ConfirmationFormContext = react_1.default.createContext(null);
10
11
  function ConfirmationFormContextWrapper(props) {
11
12
  const [errorChecks, setErrorChecks] = (0, react_2.useState)([]);
12
13
  const context = {
13
14
  errorChecks,
14
15
  addErrorCheck: (check) => {
15
- setErrorChecks((oldErrors) => {
16
- let replaced = false;
17
- const newErrors = oldErrors.map((oldErrorValidator) => {
18
- if (oldErrorValidator.name === check.name) {
19
- replaced = true;
20
- return check;
21
- }
22
- return oldErrorValidator;
23
- });
24
- if (!replaced) {
25
- return [...oldErrors, check];
26
- }
27
- return newErrors;
28
- });
16
+ context.addErrorChecks(check);
17
+ },
18
+ addErrorChecks: (...checks) => {
19
+ setErrorChecks((oldErrors) => (0, lodash_1.unionBy)(checks, oldErrors, (check) => check().name));
29
20
  },
30
21
  };
31
22
  return (react_1.default.createElement(react_1.default.Fragment, null,
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationFormContext.js","sourceRoot":"/","sources":["src/contexts/ConfirmationFormContext.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,iCAAiC;AAQpB,QAAA,uBAAuB,GAAG,eAAK,CAAC,aAAa,CAAqC,IAAI,CAAC,CAAC;AAarG,SAAgB,8BAA8B,CAAC,KAA0C;IACrF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAkC,EAAS,CAAC,CAAC;IAE3F,MAAM,OAAO,GAAgC;QACzC,WAAW;QACX,aAAa,EAAE,CAAC,KAAkC,EAAE,EAAE;YAClD,cAAc,CAAC,CAAC,SAAS,EAAE,EAAE;gBACzB,IAAI,QAAQ,GAAG,KAAK,CAAC;gBAErB,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,iBAAiB,EAAE,EAAE;oBAClD,IAAI,iBAAiB,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE;wBACvC,QAAQ,GAAG,IAAI,CAAC;wBAChB,OAAO,KAAK,CAAC;qBAChB;oBACD,OAAO,iBAAiB,CAAC;gBAC7B,CAAC,CAAC,CAAC;gBAEH,IAAI,CAAC,QAAQ,EAAE;oBACX,OAAO,CAAC,GAAG,SAAS,EAAE,KAAK,CAAC,CAAC;iBAChC;gBAED,OAAO,SAAS,CAAC;YACrB,CAAC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;IAEF,OAAO,CACH;QACI,8BAAC,+BAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IAAG,KAAK,CAAC,QAAQ,CAAoC,CACtG,CACN,CAAC;AACN,CAAC;AA/BD,wEA+BC","sourcesContent":["import React from 'react';\nimport { useState } from 'react';\n\ninterface ConfirmationFormContextType {\n errorChecks: (() => ConfirmationValidator)[];\n\n addErrorCheck: (check: () => ConfirmationValidator) => void;\n}\n\nexport const ConfirmationFormContext = React.createContext<ConfirmationFormContextType | null>(null);\n\ninterface ConfirmationFormContextWrapperProps {\n children: React.ReactNode;\n}\n\ntype ConfirmationValidator = {\n message: string;\n name: string; // TODO re-think this to make validations unique\n\n validate: (scrollToInput?: boolean) => boolean;\n};\n\nexport function ConfirmationFormContextWrapper(props: ConfirmationFormContextWrapperProps) {\n const [errorChecks, setErrorChecks] = useState<(() => ConfirmationValidator)[]>([] as any);\n\n const context: ConfirmationFormContextType = {\n errorChecks,\n addErrorCheck: (check: () => ConfirmationValidator) => {\n setErrorChecks((oldErrors) => {\n let replaced = false;\n\n const newErrors = oldErrors.map((oldErrorValidator) => {\n if (oldErrorValidator.name === check.name) {\n replaced = true;\n return check;\n }\n return oldErrorValidator;\n });\n\n if (!replaced) {\n return [...oldErrors, check];\n }\n\n return newErrors;\n });\n },\n };\n\n return (\n <>\n <ConfirmationFormContext.Provider value={context}>{props.children}</ConfirmationFormContext.Provider>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"ConfirmationFormContext.js","sourceRoot":"/","sources":["src/contexts/ConfirmationFormContext.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,iCAAiC;AACjC,mCAAiC;AAWpB,QAAA,uBAAuB,GAAG,eAAK,CAAC,aAAa,CAAqC,IAAI,CAAC,CAAC;AAarG,SAAgB,8BAA8B,CAAC,KAA0C;IACrF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAkC,EAAS,CAAC,CAAC;IAE3F,MAAM,OAAO,GAAgC;QACzC,WAAW;QACX,aAAa,EAAE,CAAC,KAAkC,EAAE,EAAE;YAClD,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;QACD,cAAc,EAAE,CAAC,GAAG,MAAuC,EAAE,EAAE;YAC3D,cAAc,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,MAAM,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QACvF,CAAC;KACJ,CAAC;IAEF,OAAO,CACH;QACI,8BAAC,+BAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IAAG,KAAK,CAAC,QAAQ,CAAoC,CACtG,CACN,CAAC;AACN,CAAC;AAlBD,wEAkBC","sourcesContent":["import React from 'react';\nimport { useState } from 'react';\nimport { unionBy } from 'lodash';\n\ninterface ConfirmationFormContextType {\n errorChecks: (() => ConfirmationValidator)[];\n\n /** @deprecated */\n addErrorCheck: (check: () => ConfirmationValidator) => void;\n\n addErrorChecks: (...checks: (() => ConfirmationValidator)[]) => void;\n}\n\nexport const ConfirmationFormContext = React.createContext<ConfirmationFormContextType | null>(null);\n\ninterface ConfirmationFormContextWrapperProps {\n children: React.ReactNode;\n}\n\ntype ConfirmationValidator = {\n message: string;\n name: string; // TODO re-think this to make validations unique\n\n validate: (scrollToInput?: boolean) => boolean;\n};\n\nexport function ConfirmationFormContextWrapper(props: ConfirmationFormContextWrapperProps) {\n const [errorChecks, setErrorChecks] = useState<(() => ConfirmationValidator)[]>([] as any);\n\n const context: ConfirmationFormContextType = {\n errorChecks,\n addErrorCheck: (check: () => ConfirmationValidator) => {\n context.addErrorChecks(check);\n },\n addErrorChecks: (...checks: (() => ConfirmationValidator)[]) => {\n setErrorChecks((oldErrors) => unionBy(checks, oldErrors, (check) => check().name));\n },\n };\n\n return (\n <>\n <ConfirmationFormContext.Provider value={context}>{props.children}</ConfirmationFormContext.Provider>\n </>\n );\n}\n"]}
@@ -68,6 +68,7 @@ export { default as StepRoom } from './pages/steps/StepRoom/StepRoom';
68
68
  export { default as StepThanks } from './pages/steps/StepThanks/StepThanks';
69
69
  export * from './translations/Translation';
70
70
  export * from './util/Color';
71
+ export * from './util/Debounce';
71
72
  export * from './hooks/CurrentHotelHook';
72
73
  export * from './hooks/EventHook';
73
74
  export * from './events/index';
package/dist/src/index.js CHANGED
@@ -146,6 +146,7 @@ Object.defineProperty(exports, "StepThanks", { enumerable: true, get: function (
146
146
  __exportStar(require("./translations/Translation"), exports);
147
147
  // Util
148
148
  __exportStar(require("./util/Color"), exports);
149
+ __exportStar(require("./util/Debounce"), exports);
149
150
  // Hooks
150
151
  __exportStar(require("./hooks/CurrentHotelHook"), exports);
151
152
  __exportStar(require("./hooks/EventHook"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,uGAA+E;AAC/E,+EAAuD;AACvD,+EAAuD;AACvD,qFAA6D;AAC7D,qEAA6C;AAE7C,kCAAkC;AAClC,kDAA6B;AAC7B,yFAAiE;AAEpD,QAAA,KAAK,GAAG,eAAQ,CAAC;AAE9B,+CAA+C;AAAtC,+GAAA,cAAc,OAAA;AACvB,qDAAwC;AAA/B,wGAAA,IAAI,OAAA;AAEb,aAAa;AACb,wFAAsE;AACtE,sFAAoE;AACpE,sFAAoE;AACpE,oFAAkE;AAClE,sEAAoD;AAEpD,uDAAiE;AAAxD,6GAAA,OAAO,OAAQ;AACxB,iEAA+C;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,CAAC","sourcesContent":["import StepConfirmation from '@/pages/steps/StepConfirmation/StepConfirmation';\nimport StepDate from '@/pages/steps/StepDate/StepDate';\nimport StepRoom from '@/pages/steps/StepRoom/StepRoom';\nimport StepThanks from '@/pages/steps/StepThanks/StepThanks';\nimport StepManager from '@/util/StepManager';\n\n// TODO: Look into resolving this.\nimport ReactRaw from 'react';\nimport RoomstayEventManager from './events/RoomstayEventManager';\n\nexport const react = ReactRaw;\n\nexport { useTranslation } from 'react-i18next';\nexport { Link } from 'react-router-dom';\n\n// Components\nexport * from '@/engines/FullPageBookingEngine/FullPageBookingEngine';\nexport * from '@/engines/InlineRoomMiniEngine/InlineRoomMiniEngine';\nexport * from '@/engines/RecentSearchesEngine/RecentSearchesEngine';\nexport * from '@/engines/BookingWizardEngine/BookingWizardEngine';\nexport * from '@/engines/CustomEngine/CustomEngine';\n\nexport { default as Icon } from '@/components/generic/Icon/Icon';\nexport * from '@/components/generic/Icon/Icon';\nexport * from '@/components/generic/Text';\nexport * from '@/components/generic/Select/index';\n\nexport { default as TextBox } from '@/components/generic/TextBox';\nexport { default as TextArea } from '@/components/generic/TextArea';\nexport { default as InputGroup } from '@/components/generic/InputGroup/InputGroup';\nexport { default as RadioFields } from '@/components/generic/radio/RadioFields';\nexport { default as Checkbox } from '@/components/generic/Checkbox/Checkbox';\n\nexport { default as LineBreak } from '@/components/generic/LineBreak';\nexport { default as AutoAutoHeight } from '@/animations/AutoAutoHeight';\nexport { default as Headline } from '@/components/generic/Headline';\n\nexport * from '@/components/generic/Alert';\nexport { default as Alert } from '@/components/generic/Alert';\nexport { default as BEButton } from '@/components/generic/BEButton';\n\nexport { BE_NO_ROOMS_FOUND_BLOCK } from '@/components/steps/room/NoRoomsFoundBlock';\nexport { default as NoRoomsFoundBlock } from '@/components/steps/room/NoRoomsFoundBlock';\n\nexport { default as StepConfirmationCountrySelector } from '@/components/steps/confirmation/StepConfirmationCountrySelector';\n\nexport * from '@/components/steps/confirmation/StepConfirmationCommentsComponent';\nexport * from '@/components/summary/BESummaryPerkBlock';\n\nexport * from '@/components/summary/BESummary';\n\nexport * from '@/components/steps/room/StepRoomBestRateAlert';\nexport { default as StepNoRoomBestRateAlert } from '@/components/steps/room/StepRoomBestRateAlert';\n\n// Loaders\nexport { default as SmallSpinner } from '@/components/generic/loader/SmallSpinner';\n\n// Providers\nexport * from '@/providers/LanguageProvider';\nexport * from '@/providers/CurrencyProvider';\nexport { default as CurrencyProvider } from '@/providers/CurrencyProvider';\nexport { default as FeatureProvider } from '@/providers/FeatureProvider';\nexport { default as RatePillProvider } from '@/providers/RatePillProvider';\nexport * from '@/providers/PromotionProvider';\n\n// Features\n\nexport { default as ConfirmationVerifyFeature } from '@/providers/feature/ConfirmationVerifyFeature';\nexport { default as DatePickerTypeFeature } from '@/providers/feature/DatePickerTypeFeature';\nexport { default as FeaturedPromoFeature } from '@/providers/feature/FeaturedPromoFeature';\nexport { default as InlineAddonStepFeature } from '@/providers/feature/InlineAddonStepFeature';\nexport { default as RoomUpsellFeature } from '@/providers/feature/RoomUpsellFeature';\nexport { default as ShowIATANumberOnCheckoutFeature } from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\nexport { default as E164PhoneNumberFieldFeature } from '@/providers/feature/E164PhoneNumberFieldFeature';\nexport { default as FullPageEngineSmallSpacingFeature } from '@/providers/feature/FullPageEngineSmallSpacingFeature';\n\n// Contexts\nexport * from '@frontend/contexts';\nexport { useFormContext } from 'react-hook-form';\n\nexport { default as SessionProvider } from '@/providers/SessionProvider';\nexport * from '@/providers/RoomstayThemeEngine';\nexport { default as RoomstayThemeEngine } from '@/providers/RoomstayThemeEngine';\nexport { registerReplacement, withDI } from '@/providers/DIProvider';\n\nexport { default as DataLayer } from '@/util/DataLayer';\nexport * from '@/util/DataLayer';\n\n// Models\nexport * from '@/models/Client/Hotel/Hotel';\nexport * from '@/models/Client/Hotel/HotelPerk';\n\nexport * from '@/models/Client/Hotel/DistanceUnitType.types';\nexport * from '@/models/Client/Hotel/WeekdayStartsOn.types';\n\nexport * from '@/models/Client/Hotel/Company';\n\nexport { default as API } from '@/api/BookingAPI';\n\n// Steps\nexport { default as StepManager } from '@/util/StepManager';\n\nexport { default as StepAddon } from '@/pages/steps/StepAddon/StepAddon';\nexport { default as StepDate } from '@/pages/steps/StepDate/StepDate';\nexport { default as StepConfirmation } from '@/pages/steps/StepConfirmation/StepConfirmation';\nexport { default as StepHotel } from '@/pages/steps/StepHotel/StepHotel';\nexport { default as StepRoom } from '@/pages/steps/StepRoom/StepRoom';\nexport { default as StepThanks } from '@/pages/steps/StepThanks/StepThanks';\n\nexport * from '@/translations/Translation';\n\n// Util\n\nexport * from '@/util/Color';\n\n// Hooks\n\nexport * from '@/hooks/CurrentHotelHook';\nexport * from '@/hooks/EventHook';\n\nexport * from '@/events/index';\n\n/** @deprecated use `roomstay.events` instead */\nexport { default as RoomstayEventManager } from '@/events/RoomstayEventManager';\n\nexport const events = {\n on: RoomstayEventManager.addEvent,\n raise: RoomstayEventManager.raise,\n};\n\ndeclare const RS_VERSION: string;\nexport const Version = RS_VERSION;\n\nStepManager.currentSteps = {\n 0: StepDate,\n 10: StepRoom,\n 20: StepConfirmation,\n 30: StepThanks,\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,uGAA+E;AAC/E,+EAAuD;AACvD,+EAAuD;AACvD,qFAA6D;AAC7D,qEAA6C;AAE7C,kCAAkC;AAClC,kDAA6B;AAC7B,yFAAiE;AAEpD,QAAA,KAAK,GAAG,eAAQ,CAAC;AAE9B,+CAA+C;AAAtC,+GAAA,cAAc,OAAA;AACvB,qDAAwC;AAA/B,wGAAA,IAAI,OAAA;AAEb,aAAa;AACb,wFAAsE;AACtE,sFAAoE;AACpE,sFAAoE;AACpE,oFAAkE;AAClE,sEAAoD;AAEpD,uDAAiE;AAAxD,6GAAA,OAAO,OAAQ;AACxB,iEAA+C;AAC/C,4DAA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ACjB,CAAC","sourcesContent":["import StepConfirmation from '@/pages/steps/StepConfirmation/StepConfirmation';\nimport StepDate from '@/pages/steps/StepDate/StepDate';\nimport StepRoom from '@/pages/steps/StepRoom/StepRoom';\nimport StepThanks from '@/pages/steps/StepThanks/StepThanks';\nimport StepManager from '@/util/StepManager';\n\n// TODO: Look into resolving this.\nimport ReactRaw from 'react';\nimport RoomstayEventManager from './events/RoomstayEventManager';\n\nexport const react = ReactRaw;\n\nexport { useTranslation } from 'react-i18next';\nexport { Link } from 'react-router-dom';\n\n// Components\nexport * from '@/engines/FullPageBookingEngine/FullPageBookingEngine';\nexport * from '@/engines/InlineRoomMiniEngine/InlineRoomMiniEngine';\nexport * from '@/engines/RecentSearchesEngine/RecentSearchesEngine';\nexport * from '@/engines/BookingWizardEngine/BookingWizardEngine';\nexport * from '@/engines/CustomEngine/CustomEngine';\n\nexport { default as Icon } from '@/components/generic/Icon/Icon';\nexport * from '@/components/generic/Icon/Icon';\nexport * from '@/components/generic/Text';\nexport * from '@/components/generic/Select/index';\n\nexport { default as TextBox } from '@/components/generic/TextBox';\nexport { default as TextArea } from '@/components/generic/TextArea';\nexport { default as InputGroup } from '@/components/generic/InputGroup/InputGroup';\nexport { default as RadioFields } from '@/components/generic/radio/RadioFields';\nexport { default as Checkbox } from '@/components/generic/Checkbox/Checkbox';\n\nexport { default as LineBreak } from '@/components/generic/LineBreak';\nexport { default as AutoAutoHeight } from '@/animations/AutoAutoHeight';\nexport { default as Headline } from '@/components/generic/Headline';\n\nexport * from '@/components/generic/Alert';\nexport { default as Alert } from '@/components/generic/Alert';\nexport { default as BEButton } from '@/components/generic/BEButton';\n\nexport { BE_NO_ROOMS_FOUND_BLOCK } from '@/components/steps/room/NoRoomsFoundBlock';\nexport { default as NoRoomsFoundBlock } from '@/components/steps/room/NoRoomsFoundBlock';\n\nexport { default as StepConfirmationCountrySelector } from '@/components/steps/confirmation/StepConfirmationCountrySelector';\n\nexport * from '@/components/steps/confirmation/StepConfirmationCommentsComponent';\nexport * from '@/components/summary/BESummaryPerkBlock';\n\nexport * from '@/components/summary/BESummary';\n\nexport * from '@/components/steps/room/StepRoomBestRateAlert';\nexport { default as StepNoRoomBestRateAlert } from '@/components/steps/room/StepRoomBestRateAlert';\n\n// Loaders\nexport { default as SmallSpinner } from '@/components/generic/loader/SmallSpinner';\n\n// Providers\nexport * from '@/providers/LanguageProvider';\nexport * from '@/providers/CurrencyProvider';\nexport { default as CurrencyProvider } from '@/providers/CurrencyProvider';\nexport { default as FeatureProvider } from '@/providers/FeatureProvider';\nexport { default as RatePillProvider } from '@/providers/RatePillProvider';\nexport * from '@/providers/PromotionProvider';\n\n// Features\n\nexport { default as ConfirmationVerifyFeature } from '@/providers/feature/ConfirmationVerifyFeature';\nexport { default as DatePickerTypeFeature } from '@/providers/feature/DatePickerTypeFeature';\nexport { default as FeaturedPromoFeature } from '@/providers/feature/FeaturedPromoFeature';\nexport { default as InlineAddonStepFeature } from '@/providers/feature/InlineAddonStepFeature';\nexport { default as RoomUpsellFeature } from '@/providers/feature/RoomUpsellFeature';\nexport { default as ShowIATANumberOnCheckoutFeature } from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\nexport { default as E164PhoneNumberFieldFeature } from '@/providers/feature/E164PhoneNumberFieldFeature';\nexport { default as FullPageEngineSmallSpacingFeature } from '@/providers/feature/FullPageEngineSmallSpacingFeature';\n\n// Contexts\nexport * from '@frontend/contexts';\nexport { useFormContext } from 'react-hook-form';\n\nexport { default as SessionProvider } from '@/providers/SessionProvider';\nexport * from '@/providers/RoomstayThemeEngine';\nexport { default as RoomstayThemeEngine } from '@/providers/RoomstayThemeEngine';\nexport { registerReplacement, withDI } from '@/providers/DIProvider';\n\nexport { default as DataLayer } from '@/util/DataLayer';\nexport * from '@/util/DataLayer';\n\n// Models\nexport * from '@/models/Client/Hotel/Hotel';\nexport * from '@/models/Client/Hotel/HotelPerk';\n\nexport * from '@/models/Client/Hotel/DistanceUnitType.types';\nexport * from '@/models/Client/Hotel/WeekdayStartsOn.types';\n\nexport * from '@/models/Client/Hotel/Company';\n\nexport { default as API } from '@/api/BookingAPI';\n\n// Steps\nexport { default as StepManager } from '@/util/StepManager';\n\nexport { default as StepAddon } from '@/pages/steps/StepAddon/StepAddon';\nexport { default as StepDate } from '@/pages/steps/StepDate/StepDate';\nexport { default as StepConfirmation } from '@/pages/steps/StepConfirmation/StepConfirmation';\nexport { default as StepHotel } from '@/pages/steps/StepHotel/StepHotel';\nexport { default as StepRoom } from '@/pages/steps/StepRoom/StepRoom';\nexport { default as StepThanks } from '@/pages/steps/StepThanks/StepThanks';\n\nexport * from '@/translations/Translation';\n\n// Util\n\nexport * from '@/util/Color';\nexport * from '@/util/Debounce';\n\n// Hooks\n\nexport * from '@/hooks/CurrentHotelHook';\nexport * from '@/hooks/EventHook';\n\nexport * from '@/events/index';\n\n/** @deprecated use `roomstay.events` instead */\nexport { default as RoomstayEventManager } from '@/events/RoomstayEventManager';\n\nexport const events = {\n on: RoomstayEventManager.addEvent,\n raise: RoomstayEventManager.raise,\n};\n\ndeclare const RS_VERSION: string;\nexport const Version = RS_VERSION;\n\nStepManager.currentSteps = {\n 0: StepDate,\n 10: StepRoom,\n 20: StepConfirmation,\n 30: StepThanks,\n};\n"]}
@@ -1,5 +1,5 @@
1
+ import React from 'react';
1
2
  import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import Text from '../components/generic/Text';
3
- declare const _default: ComponentMeta<typeof Text>;
3
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Pick<import("../components/generic/Text").TextProps, keyof import("../components/generic/Text").TextProps> & React.RefAttributes<HTMLParagraphElement>>>;
4
4
  export default _default;
5
- export declare const Default: ComponentStory<typeof Text>;
5
+ export declare const Default: ComponentStory<React.ForwardRefExoticComponent<Pick<import("../components/generic/Text").TextProps, keyof import("../components/generic/Text").TextProps> & React.RefAttributes<HTMLParagraphElement>>>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ComponentStory, ComponentMeta } from '@storybook/react';
3
- declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Pick<import("../components/generic/TextArea").TextAreaProps, "label" | "key" | keyof React.TextareaHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>>;
3
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Pick<import("../components/generic/TextArea").TextAreaProps, "label" | "key" | keyof React.TextareaHTMLAttributes<HTMLTextAreaElement> | "validationStatus"> & React.RefAttributes<HTMLTextAreaElement>>>;
4
4
  export default _default;
5
- export declare const Default: ComponentStory<React.ForwardRefExoticComponent<Pick<import("../components/generic/TextArea").TextAreaProps, "label" | "key" | keyof React.TextareaHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>>;
5
+ export declare const Default: ComponentStory<React.ForwardRefExoticComponent<Pick<import("../components/generic/TextArea").TextAreaProps, "label" | "key" | keyof React.TextareaHTMLAttributes<HTMLTextAreaElement> | "validationStatus"> & React.RefAttributes<HTMLTextAreaElement>>>;