@lifesg/web-frontend-engine 1.0.0-alpha.2 → 1.0.0-alpha.4

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.
Files changed (76) hide show
  1. package/README.md +21 -27
  2. package/cjs/index.js +88 -84
  3. package/cjs/index.js.map +1 -1
  4. package/components/custom/filter/filter/filter.d.ts +2 -0
  5. package/components/custom/filter/filter/types.d.ts +14 -0
  6. package/components/custom/filter/filter-checkbox/filter-checkbox.d.ts +3 -0
  7. package/components/custom/filter/filter-checkbox/types.d.ts +12 -0
  8. package/components/custom/filter/filter-item/filter-item.d.ts +3 -0
  9. package/components/custom/filter/filter-item/types.d.ts +8 -0
  10. package/components/custom/filter/index.d.ts +3 -0
  11. package/components/custom/index.d.ts +1 -0
  12. package/components/elements/alert/alert.d.ts +1 -2
  13. package/components/elements/section/index.d.ts +2 -0
  14. package/components/elements/section/section.d.ts +2 -0
  15. package/components/elements/section/types.d.ts +10 -0
  16. package/components/elements/sections/index.d.ts +2 -0
  17. package/components/elements/sections/sections.d.ts +14 -0
  18. package/components/elements/sections/types.d.ts +5 -0
  19. package/components/elements/text/data.d.ts +12 -12
  20. package/components/elements/text/text.d.ts +1 -2
  21. package/components/elements/wrapper/conditional-renderer.d.ts +5 -1
  22. package/components/elements/wrapper/types.d.ts +11 -2
  23. package/components/elements/wrapper/wrapper.d.ts +2 -11
  24. package/components/fields/checkbox-group/checkbox-group.d.ts +1 -2
  25. package/components/fields/checkbox-group/checkbox-group.styles.d.ts +2 -1
  26. package/components/fields/checkbox-group/types.d.ts +13 -1
  27. package/components/fields/chips/chips.d.ts +1 -2
  28. package/components/fields/chips/types.d.ts +1 -0
  29. package/components/fields/contact-field/contact-field.d.ts +3 -0
  30. package/components/fields/contact-field/data.d.ts +5 -0
  31. package/components/fields/contact-field/index.d.ts +2 -0
  32. package/components/fields/contact-field/types.d.ts +30 -0
  33. package/components/fields/date-field/date-field.d.ts +3 -0
  34. package/components/fields/date-field/index.d.ts +2 -0
  35. package/components/fields/{date-input → date-field}/types.d.ts +2 -2
  36. package/components/fields/index.d.ts +6 -4
  37. package/components/fields/multi-select/multi-select.d.ts +1 -2
  38. package/components/fields/radio-button/radio-button.d.ts +1 -2
  39. package/components/fields/radio-button/radio-button.styles.d.ts +1 -0
  40. package/components/fields/radio-button/types.d.ts +9 -0
  41. package/components/fields/reset-button/index.d.ts +2 -0
  42. package/components/fields/reset-button/reset-button.d.ts +3 -0
  43. package/components/fields/reset-button/types.d.ts +5 -0
  44. package/components/fields/select/select.d.ts +1 -2
  45. package/components/fields/submit-button/submit-button.d.ts +1 -2
  46. package/components/fields/text-field/index.d.ts +2 -0
  47. package/components/fields/text-field/text-field.d.ts +3 -0
  48. package/components/fields/text-field/types.d.ts +8 -0
  49. package/components/fields/textarea/textarea.d.ts +1 -2
  50. package/components/fields/time-field/index.d.ts +2 -0
  51. package/components/fields/time-field/time-field.d.ts +3 -0
  52. package/components/fields/{time-picker → time-field}/types.d.ts +1 -1
  53. package/components/fields/unit-number-field/index.d.ts +2 -0
  54. package/components/fields/unit-number-field/types.d.ts +7 -0
  55. package/components/fields/unit-number-field/unit-number-field.d.ts +3 -0
  56. package/components/frontend-engine/frontend-engine.d.ts +2 -8
  57. package/components/frontend-engine/types.d.ts +76 -20
  58. package/components/frontend-engine/yup/context-provider.d.ts +1 -1
  59. package/components/shared/chip/chip.d.ts +1 -1
  60. package/components/shared/error-messages.d.ts +3 -0
  61. package/components/shared/sanitize/sanitize.d.ts +1 -1
  62. package/index.js +95 -91
  63. package/index.js.map +1 -1
  64. package/package.json +2 -2
  65. package/components/fields/contact-number/contact-number.d.ts +0 -4
  66. package/components/fields/contact-number/data.d.ts +0 -215
  67. package/components/fields/contact-number/index.d.ts +0 -2
  68. package/components/fields/contact-number/types.d.ts +0 -29
  69. package/components/fields/date-input/date-input.d.ts +0 -4
  70. package/components/fields/date-input/index.d.ts +0 -2
  71. package/components/fields/textfield/index.d.ts +0 -2
  72. package/components/fields/textfield/textfield.d.ts +0 -4
  73. package/components/fields/textfield/types.d.ts +0 -8
  74. package/components/fields/time-picker/index.d.ts +0 -2
  75. package/components/fields/time-picker/time-picker.d.ts +0 -4
  76. /package/components/fields/{contact-number → contact-field}/utils.d.ts +0 -0
@@ -0,0 +1,2 @@
1
+ import { IFilterProps } from "./types";
2
+ export declare const Filter: (props: IFilterProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { ICustomComponentJsonSchema } from "../../../frontend-engine";
2
+ import { IFilterCheckboxSchema } from "../filter-checkbox/types";
3
+ import { IFilterItemSchema } from "../filter-item/types";
4
+ export interface IFilterSchema extends ICustomComponentJsonSchema<"filter"> {
5
+ label?: string | undefined;
6
+ toggleFilterButtonLabel?: string | undefined;
7
+ children: Record<string, IFilterItemSchema | IFilterCheckboxSchema>;
8
+ clearButtonDisabled?: boolean | undefined;
9
+ }
10
+ export interface IFilterProps {
11
+ id: string | undefined;
12
+ schema: IFilterSchema | undefined;
13
+ warnings?: Record<string, string> | undefined;
14
+ }
@@ -0,0 +1,3 @@
1
+ import { IGenericFieldProps } from "../../../frontend-engine";
2
+ import { IFilterCheckboxSchema } from "./types";
3
+ export declare const FilterCheckbox: (props: IGenericFieldProps<IFilterCheckboxSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { ICustomFieldJsonSchema } from "../../../frontend-engine";
2
+ export interface IFilterCheckboxSchema<V = undefined> extends Omit<ICustomFieldJsonSchema<"filter-checkbox", V>, "validation"> {
3
+ label: string;
4
+ options: IOption[];
5
+ collapsible?: boolean | undefined;
6
+ showDivider?: boolean | undefined;
7
+ showMobileDivider?: boolean | undefined;
8
+ }
9
+ export interface IOption {
10
+ label: string;
11
+ value: string;
12
+ }
@@ -0,0 +1,3 @@
1
+ import { IGenericFieldProps } from "../../../frontend-engine";
2
+ import { IFilterItemSchema } from "./types";
3
+ export declare const FilterItem: (props: IGenericFieldProps<IFilterItemSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ICustomComponentJsonSchema, TFrontendEngineFieldSchema } from "../../../frontend-engine";
2
+ export interface IFilterItemSchema<V = undefined> extends ICustomComponentJsonSchema<"filter-item"> {
3
+ label: string;
4
+ children: Record<string, TFrontendEngineFieldSchema<V>>;
5
+ collapsible?: boolean | undefined;
6
+ showDivider?: boolean | undefined;
7
+ showMobileDivider?: boolean | undefined;
8
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./filter/filter";
2
+ export * from "./filter-item/filter-item";
3
+ export * from "./filter-checkbox/filter-checkbox";
@@ -0,0 +1 @@
1
+ export * from "./filter";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine";
3
2
  import { IAlertSchema } from "./types";
4
- export declare const Alert: (props: IGenericFieldProps<IAlertSchema>) => JSX.Element;
3
+ export declare const Alert: (props: IGenericFieldProps<IAlertSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from "./section";
2
+ export * from "./types";
@@ -0,0 +1,2 @@
1
+ import { ISectionProps } from "./types";
2
+ export declare const Section: (props: ISectionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { IFrontendEngineElementJsonSchema, TComponentOmitProps, TFrontendEngineFieldSchema } from "../../frontend-engine";
2
+ import { IWrapperSchema } from "../wrapper";
3
+ export interface ISectionSchema<V = undefined> extends IFrontendEngineElementJsonSchema<"section">, TComponentOmitProps<IWrapperSchema> {
4
+ children: Record<string, TFrontendEngineFieldSchema<V>>;
5
+ }
6
+ export interface ISectionProps {
7
+ id: string;
8
+ sectionSchema: ISectionSchema;
9
+ warnings?: Record<string, string> | undefined;
10
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./sections";
2
+ export * from "./types";
@@ -0,0 +1,14 @@
1
+ import { ISectionsProps } from "./types";
2
+ /**
3
+ * this component is meant to render "pages" which consists of individual Section component
4
+ * it is not rendering in pages yet because there are no use cases yet
5
+ * so this is just a placeholder for now
6
+ *
7
+ * this component renders the sections object and cannot be defined via `uiType`
8
+ * i.e. it is used internally only
9
+ *
10
+ * TODO:
11
+ * - render pages properly
12
+ * - handle validation and errors in each section before navigating away
13
+ */
14
+ export declare const Sections: (props: ISectionsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ISectionSchema } from "../section";
2
+ export interface ISectionsProps {
3
+ schema?: Record<string, ISectionSchema> | undefined;
4
+ warnings?: Record<string, string> | undefined;
5
+ }
@@ -1,14 +1,14 @@
1
1
  export declare const TEXT_MAPPING: {
2
- "TEXT-D1": import("styled-components").StyledComponent<"h1", any, import("@lifesg/react-design-system/text").TextProps, never>;
3
- "TEXT-D2": import("styled-components").StyledComponent<"h1", any, import("@lifesg/react-design-system/text").TextProps, never>;
4
- "TEXT-DBODY": import("styled-components").StyledComponent<"h1", any, import("@lifesg/react-design-system/text").TextProps, never>;
5
- "TEXT-H1": import("styled-components").StyledComponent<"h1", any, import("@lifesg/react-design-system/text").TextProps, never>;
6
- "TEXT-H2": import("styled-components").StyledComponent<"h2", any, import("@lifesg/react-design-system/text").TextProps, never>;
7
- "TEXT-H3": import("styled-components").StyledComponent<"h3", any, import("@lifesg/react-design-system/text").TextProps, never>;
8
- "TEXT-H4": import("styled-components").StyledComponent<"h4", any, import("@lifesg/react-design-system/text").TextProps, never>;
9
- "TEXT-H5": import("styled-components").StyledComponent<"h5", any, import("@lifesg/react-design-system/text").TextProps, never>;
10
- "TEXT-H6": import("styled-components").StyledComponent<"h6", any, import("@lifesg/react-design-system/text").TextProps, never>;
11
- "TEXT-BODY": import("styled-components").StyledComponent<"p", any, import("@lifesg/react-design-system/text").TextProps, never>;
12
- "TEXT-BODYSMALL": import("styled-components").StyledComponent<"p", any, import("@lifesg/react-design-system/text").TextProps, never>;
13
- "TEXT-XSMALL": import("styled-components").StyledComponent<"span", any, import("@lifesg/react-design-system/text").TextProps, never>;
2
+ "TEXT-D1": import("styled-components").StyledComponent<"h1", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
3
+ "TEXT-D2": import("styled-components").StyledComponent<"h1", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
4
+ "TEXT-DBODY": import("styled-components").StyledComponent<"h1", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
5
+ "TEXT-H1": import("styled-components").StyledComponent<"h1", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
6
+ "TEXT-H2": import("styled-components").StyledComponent<"h2", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
7
+ "TEXT-H3": import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
8
+ "TEXT-H4": import("styled-components").StyledComponent<"h4", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
9
+ "TEXT-H5": import("styled-components").StyledComponent<"h5", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
10
+ "TEXT-H6": import("styled-components").StyledComponent<"h6", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
11
+ "TEXT-BODY": import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
12
+ "TEXT-BODYSMALL": import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
13
+ "TEXT-XSMALL": import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("@lifesg/react-design-system/text").TextProps, never>;
14
14
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine";
3
2
  import { ITextSchema } from "./types";
4
- export declare const Text: (props: IGenericFieldProps<ITextSchema>) => JSX.Element;
3
+ export declare const Text: (props: IGenericFieldProps<ITextSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,18 @@
1
1
  import React from "react";
2
+ import { TFrontendEngineFieldSchema } from "../../frontend-engine";
2
3
  import { TRenderRules } from "../../frontend-engine/yup";
4
+ import { IFilterItemSchema } from "../../custom/filter/filter-item/types";
5
+ import { IFilterCheckboxSchema } from "../../custom/filter/filter-checkbox/types";
3
6
  interface IProps {
4
7
  id: string;
5
8
  renderRules?: TRenderRules[] | undefined;
6
9
  children: React.ReactNode;
10
+ schema: TFrontendEngineFieldSchema | IFilterItemSchema | IFilterCheckboxSchema;
7
11
  }
8
12
  /**
9
13
  * conditionally render children according to render rules provided
10
14
  * render conditions are based on Yup schema and the base schema is derived from corresponding validation config
11
15
  * automatically remove validation config on hide / unmount, for more complex fields, it still has to be done via the field itself
12
16
  */
13
- export declare const ConditionalRenderer: ({ id, renderRules, children }: IProps) => JSX.Element;
17
+ export declare const ConditionalRenderer: ({ id, renderRules, children, schema }: IProps) => import("react/jsx-runtime").JSX.Element;
14
18
  export {};
@@ -1,9 +1,18 @@
1
1
  /// <reference types="react" />
2
+ import { IFilterCheckboxSchema } from "../../custom/filter/filter-checkbox/types";
3
+ import { IFilterItemSchema } from "../../custom/filter/filter-item/types";
2
4
  import { TComponentOmitProps, TFrontendEngineFieldSchema } from "../../frontend-engine";
3
5
  import { TRenderRules } from "../../frontend-engine/yup";
4
- export type TWrapperType = "div" | "span" | "section" | "header" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p";
6
+ export type TWrapperType = "div" | "span" | "header" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p";
5
7
  export interface IWrapperSchema extends TComponentOmitProps<React.HTMLAttributes<HTMLElement>, "children"> {
6
- fieldType: TWrapperType;
8
+ uiType: TWrapperType;
7
9
  showIf?: TRenderRules[] | undefined;
8
10
  children: Record<string, TFrontendEngineFieldSchema> | string;
9
11
  }
12
+ export interface IWrapperProps {
13
+ id?: string | undefined;
14
+ schema?: IWrapperSchema | undefined;
15
+ /** only used internally by FrontendEngine */
16
+ children?: Record<string, TFrontendEngineFieldSchema> | Record<string, IFilterItemSchema | IFilterCheckboxSchema> | undefined;
17
+ warnings?: Record<string, string> | undefined;
18
+ }
@@ -1,12 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { TFrontendEngineFieldSchema } from "../../frontend-engine/types";
3
- import { IWrapperSchema } from "./types";
4
- interface IWrapperProps {
5
- id?: string | undefined;
6
- schema?: IWrapperSchema | undefined;
7
- /** only used internally by FrontendEngine */
8
- children?: Record<string, TFrontendEngineFieldSchema> | undefined;
9
- warnings?: Record<string, string> | undefined;
10
- }
11
- export declare const Wrapper: (props: IWrapperProps) => JSX.Element;
12
- export {};
2
+ import { IWrapperProps } from "./types";
3
+ export declare const Wrapper: (props: IWrapperProps) => JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine";
3
2
  import { ICheckboxGroupSchema } from "./types";
4
- export declare const CheckboxGroup: (props: IGenericFieldProps<ICheckboxGroupSchema>) => JSX.Element;
3
+ export declare const CheckboxGroup: (props: IGenericFieldProps<ICheckboxGroupSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@ interface ILabelProps {
3
3
  disabled?: boolean | undefined;
4
4
  }
5
5
  export declare const Label: import("styled-components").StyledComponent<"label", any, ILabelProps, never>;
6
- export declare const StyledCheckbox: import("styled-components").StyledComponent<({ className, checked, disabled, onClick, onKeyPress, displaySize, ...otherProps }: import("@lifesg/react-design-system/checkbox").CheckboxProps) => JSX.Element, any, {}, never>;
6
+ export declare const StyledCheckbox: import("styled-components").StyledComponent<({ className, checked, disabled, onChange, onKeyPress, displaySize, ...otherProps }: import("@lifesg/react-design-system/checkbox").CheckboxProps) => JSX.Element, any, {}, never>;
7
7
  export declare const CheckboxContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const ToggleWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
9
  export {};
@@ -3,8 +3,20 @@ import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../f
3
3
  interface IOption {
4
4
  label: string;
5
5
  value: string;
6
+ disabled?: boolean | undefined;
6
7
  }
8
+ interface IToggleOption extends IOption {
9
+ none?: boolean;
10
+ }
11
+ type TCustomOptions = {
12
+ styleType: "default";
13
+ } | {
14
+ styleType: "toggle";
15
+ indicator?: boolean;
16
+ border?: boolean;
17
+ };
7
18
  export interface ICheckboxGroupSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"checkbox", V>, TComponentOmitProps<CheckboxProps> {
8
- options: IOption[];
19
+ options: IToggleOption[];
20
+ customOptions?: TCustomOptions;
9
21
  }
10
22
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine";
3
2
  import { IChipsSchema } from "./types";
4
- export declare const Chips: (props: IGenericFieldProps<IChipsSchema>) => JSX.Element;
3
+ export declare const Chips: (props: IGenericFieldProps<IChipsSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -4,6 +4,7 @@ import { IYupValidationRule } from "../../frontend-engine/yup/types";
4
4
  export interface IChipOption {
5
5
  label: string;
6
6
  value: string;
7
+ disabled?: boolean | undefined;
7
8
  }
8
9
  export interface IChipsSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"chips", V>, TComponentOmitProps<React.ButtonHTMLAttributes<HTMLButtonElement>> {
9
10
  options: IChipOption[];
@@ -0,0 +1,3 @@
1
+ import { IGenericFieldProps } from "../../frontend-engine/types";
2
+ import { IContactFieldSchema } from "./types";
3
+ export declare const ContactField: (props: IGenericFieldProps<IContactFieldSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { TCallingCodeMap, TCountry } from "./types";
2
+ export declare const CountryData: readonly [readonly ["Afghanistan", readonly ["asia"], "af", "93"], readonly ["Albania", readonly ["europe"], "al", "355"], readonly ["Algeria", readonly ["africa", "north-africa"], "dz", "213"], readonly ["Andorra", readonly ["europe"], "ad", "376"], readonly ["Angola", readonly ["africa"], "ao", "244"], readonly ["Antigua and Barbuda", readonly ["america", "carribean"], "ag", "1268"], readonly ["Argentina", readonly ["america", "south-america"], "ar", "54", "(..) ........"], readonly ["Armenia", readonly ["asia", "ex-ussr"], "am", "374", ".. ......"], readonly ["Aruba", readonly ["america", "carribean"], "aw", "297"], readonly ["Australia", readonly ["oceania"], "au", "61", "(..) .... ...."], readonly ["Austria", readonly ["europe", "eu-union"], "at", "43"], readonly ["Azerbaijan", readonly ["asia", "ex-ussr"], "az", "994", "(..) ... .. .."], readonly ["Bahamas", readonly ["america", "carribean"], "bs", "1242"], readonly ["Bahrain", readonly ["middle-east"], "bh", "973"], readonly ["Bangladesh", readonly ["asia"], "bd", "880"], readonly ["Barbados", readonly ["america", "carribean"], "bb", "1246"], readonly ["Belarus", readonly ["europe", "ex-ussr"], "by", "375", "(..) ... .. .."], readonly ["Belgium", readonly ["europe", "eu-union"], "be", "32", "... .. .. .."], readonly ["Belize", readonly ["america", "central-america"], "bz", "501"], readonly ["Benin", readonly ["africa"], "bj", "229"], readonly ["Bhutan", readonly ["asia"], "bt", "975"], readonly ["Bolivia", readonly ["america", "south-america"], "bo", "591"], readonly ["Bosnia and Herzegovina", readonly ["europe", "ex-yugos"], "ba", "387"], readonly ["Botswana", readonly ["africa"], "bw", "267"], readonly ["Brazil", readonly ["america", "south-america"], "br", "55", "(..) ........."], readonly ["British Indian Ocean Territory", readonly ["asia"], "io", "246"], readonly ["Brunei", readonly ["asia"], "bn", "673"], readonly ["Bulgaria", readonly ["europe", "eu-union"], "bg", "359"], readonly ["Burkina Faso", readonly ["africa"], "bf", "226"], readonly ["Burundi", readonly ["africa"], "bi", "257"], readonly ["Cambodia", readonly ["asia"], "kh", "855"], readonly ["Cameroon", readonly ["africa"], "cm", "237"], readonly ["Canada", readonly ["america", "north-america"], "ca", "1", "(...) ... ...."], readonly ["Cape Verde", readonly ["africa"], "cv", "238"], readonly ["Caribbean Netherlands", readonly ["america", "carribean"], "bq", "599", ""], readonly ["Central African Republic", readonly ["africa"], "cf", "236"], readonly ["Chad", readonly ["africa"], "td", "235"], readonly ["Chile", readonly ["america", "south-america"], "cl", "56"], readonly ["China", readonly ["asia"], "cn", "86", ".. ........."], readonly ["Colombia", readonly ["america", "south-america"], "co", "57", "... ... ...."], readonly ["Comoros", readonly ["africa"], "km", "269"], readonly ["Congo", readonly ["africa"], "cd", "243"], readonly ["Congo", readonly ["africa"], "cg", "242"], readonly ["Costa Rica", readonly ["america", "central-america"], "cr", "506", ".... ...."], readonly ["Côte d’Ivoire", readonly ["africa"], "ci", "225", ".. .. .. .."], readonly ["Croatia", readonly ["europe", "eu-union", "ex-yugos"], "hr", "385"], readonly ["Cuba", readonly ["america", "carribean"], "cu", "53"], readonly ["Curaçao", readonly ["america", "carribean"], "cw", "599", ""], readonly ["Cyprus", readonly ["europe", "eu-union"], "cy", "357", ".. ......"], readonly ["Czech Republic", readonly ["europe", "eu-union"], "cz", "420", "... ... ..."], readonly ["Denmark", readonly ["europe", "eu-union", "baltic"], "dk", "45", ".. .. .. .."], readonly ["Djibouti", readonly ["africa"], "dj", "253"], readonly ["Dominica", readonly ["america", "carribean"], "dm", "1767"], readonly ["Dominican Republic", readonly ["america", "carribean"], "do", "1", ""], readonly ["Ecuador", readonly ["america", "south-america"], "ec", "593"], readonly ["Egypt", readonly ["africa", "north-africa"], "eg", "20"], readonly ["El Salvador", readonly ["america", "central-america"], "sv", "503", ".... ...."], readonly ["Equatorial Guinea", readonly ["africa"], "gq", "240"], readonly ["Eritrea", readonly ["africa"], "er", "291"], readonly ["Estonia", readonly ["europe", "eu-union", "ex-ussr", "baltic"], "ee", "372", ".... ......"], readonly ["Ethiopia", readonly ["africa"], "et", "251"], readonly ["Fiji", readonly ["oceania"], "fj", "679"], readonly ["Finland", readonly ["europe", "eu-union", "baltic"], "fi", "358", ".. ... .. .."], readonly ["France", readonly ["europe", "eu-union"], "fr", "33", ". .. .. .. .."], readonly ["French Guiana", readonly ["america", "south-america"], "gf", "594"], readonly ["French Polynesia", readonly ["oceania"], "pf", "689"], readonly ["Gabon", readonly ["africa"], "ga", "241"], readonly ["Gambia", readonly ["africa"], "gm", "220"], readonly ["Georgia", readonly ["asia", "ex-ussr"], "ge", "995"], readonly ["Germany", readonly ["europe", "eu-union", "baltic"], "de", "49", ".... ........"], readonly ["Ghana", readonly ["africa"], "gh", "233"], readonly ["Greece", readonly ["europe", "eu-union"], "gr", "30"], readonly ["Grenada", readonly ["america", "carribean"], "gd", "1473"], readonly ["Guadeloupe", readonly ["america", "carribean"], "gp", "590", "", 0], readonly ["Guam", readonly ["oceania"], "gu", "1671"], readonly ["Guatemala", readonly ["america", "central-america"], "gt", "502", ".... ...."], readonly ["Guinea", readonly ["africa"], "gn", "224"], readonly ["Guinea-Bissau", readonly ["africa"], "gw", "245"], readonly ["Guyana", readonly ["america", "south-america"], "gy", "592"], readonly ["Haiti", readonly ["america", "carribean"], "ht", "509", ".... ...."], readonly ["Honduras", readonly ["america", "central-america"], "hn", "504"], readonly ["Hong Kong", readonly ["asia"], "hk", "852", ".... ...."], readonly ["Hungary", readonly ["europe", "eu-union"], "hu", "36"], readonly ["Iceland", readonly ["europe"], "is", "354", "... ...."], readonly ["India", readonly ["asia"], "in", "91", "..... ....."], readonly ["Indonesia", readonly ["asia"], "id", "62"], readonly ["Iran", readonly ["middle-east"], "ir", "98", "... ... ...."], readonly ["Iraq", readonly ["middle-east"], "iq", "964"], readonly ["Ireland", readonly ["europe", "eu-union"], "ie", "353", ".. ......."], readonly ["Israel", readonly ["middle-east"], "il", "972", "... ... ...."], readonly ["Italy", readonly ["europe", "eu-union"], "it", "39", "... ......."], readonly ["Jamaica", readonly ["america", "carribean"], "jm", "1876"], readonly ["Japan", readonly ["asia"], "jp", "81", ".. .... ...."], readonly ["Jordan", readonly ["middle-east"], "jo", "962"], readonly ["Kazakhstan", readonly ["asia", "ex-ussr"], "kz", "7", "... ... .. .."], readonly ["Kenya", readonly ["africa"], "ke", "254"], readonly ["Kiribati", readonly ["oceania"], "ki", "686"], readonly ["Kosovo", readonly ["europe", "ex-yugos"], "xk", "383"], readonly ["Kuwait", readonly ["middle-east"], "kw", "965"], readonly ["Kyrgyzstan", readonly ["asia", "ex-ussr"], "kg", "996", "... ... ..."], readonly ["Laos", readonly ["asia"], "la", "856"], readonly ["Latvia", readonly ["europe", "eu-union", "ex-ussr", "baltic"], "lv", "371", ".. ... ..."], readonly ["Lebanon", readonly ["middle-east"], "lb", "961"], readonly ["Lesotho", readonly ["africa"], "ls", "266"], readonly ["Liberia", readonly ["africa"], "lr", "231"], readonly ["Libya", readonly ["africa", "north-africa"], "ly", "218"], readonly ["Liechtenstein", readonly ["europe"], "li", "423"], readonly ["Lithuania", readonly ["europe", "eu-union", "ex-ussr", "baltic"], "lt", "370"], readonly ["Luxembourg", readonly ["europe", "eu-union"], "lu", "352"], readonly ["Macau", readonly ["asia"], "mo", "853"], readonly ["Macedonia", readonly ["europe", "ex-yugos"], "mk", "389"], readonly ["Madagascar", readonly ["africa"], "mg", "261"], readonly ["Malawi", readonly ["africa"], "mw", "265"], readonly ["Malaysia", readonly ["asia"], "my", "60", ".. .... ...."], readonly ["Maldives", readonly ["asia"], "mv", "960"], readonly ["Mali", readonly ["africa"], "ml", "223"], readonly ["Malta", readonly ["europe", "eu-union"], "mt", "356"], readonly ["Marshall Islands", readonly ["oceania"], "mh", "692"], readonly ["Martinique", readonly ["america", "carribean"], "mq", "596"], readonly ["Mauritania", readonly ["africa"], "mr", "222"], readonly ["Mauritius", readonly ["africa"], "mu", "230"], readonly ["Mexico", readonly ["america", "central-america"], "mx", "52", "... ... ...."], readonly ["Micronesia", readonly ["oceania"], "fm", "691"], readonly ["Moldova", readonly ["europe"], "md", "373", "(..) .. .. .."], readonly ["Monaco", readonly ["europe"], "mc", "377"], readonly ["Mongolia", readonly ["asia"], "mn", "976"], readonly ["Montenegro", readonly ["europe", "ex-yugos"], "me", "382"], readonly ["Morocco", readonly ["africa", "north-africa"], "ma", "212"], readonly ["Mozambique", readonly ["africa"], "mz", "258"], readonly ["Myanmar", readonly ["asia"], "mm", "95"], readonly ["Namibia", readonly ["africa"], "na", "264"], readonly ["Nauru", readonly ["africa"], "nr", "674"], readonly ["Nepal", readonly ["asia"], "np", "977"], readonly ["Netherlands", readonly ["europe", "eu-union"], "nl", "31", ".. ........"], readonly ["New Caledonia", readonly ["oceania"], "nc", "687"], readonly ["New Zealand", readonly ["oceania"], "nz", "64", "... ... ...."], readonly ["Nicaragua", readonly ["america", "central-america"], "ni", "505"], readonly ["Niger", readonly ["africa"], "ne", "227"], readonly ["Nigeria", readonly ["africa"], "ng", "234"], readonly ["North Korea", readonly ["asia"], "kp", "850"], readonly ["Norway", readonly ["europe", "baltic"], "no", "47", "... .. ..."], readonly ["Oman", readonly ["middle-east"], "om", "968"], readonly ["Pakistan", readonly ["asia"], "pk", "92", "... ......."], readonly ["Palau", readonly ["oceania"], "pw", "680"], readonly ["Palestine", readonly ["middle-east"], "ps", "970"], readonly ["Panama", readonly ["america", "central-america"], "pa", "507"], readonly ["Papua New Guinea", readonly ["oceania"], "pg", "675"], readonly ["Paraguay", readonly ["america", "south-america"], "py", "595"], readonly ["Peru", readonly ["america", "south-america"], "pe", "51"], readonly ["Philippines", readonly ["asia"], "ph", "63", ".... ......."], readonly ["Poland", readonly ["europe", "eu-union", "baltic"], "pl", "48", "... ... ..."], readonly ["Portugal", readonly ["europe", "eu-union"], "pt", "351"], readonly ["Puerto Rico", readonly ["america", "carribean"], "pr", "1", ""], readonly ["Qatar", readonly ["middle-east"], "qa", "974"], readonly ["Réunion", readonly ["africa"], "re", "262"], readonly ["Romania", readonly ["europe", "eu-union"], "ro", "40"], readonly ["Russia", readonly ["europe", "asia", "ex-ussr", "baltic"], "ru", "7", "(...) ... .. .."], readonly ["Rwanda", readonly ["africa"], "rw", "250"], readonly ["Saint Kitts and Nevis", readonly ["america", "carribean"], "kn", "1869"], readonly ["Saint Lucia", readonly ["america", "carribean"], "lc", "1758"], readonly ["Saint Vincent and the Grenadines", readonly ["america", "carribean"], "vc", "1784"], readonly ["Samoa", readonly ["oceania"], "ws", "685"], readonly ["San Marino", readonly ["europe"], "sm", "378"], readonly ["São Tomé and Príncipe", readonly ["africa"], "st", "239"], readonly ["Saudi Arabia", readonly ["middle-east"], "sa", "966"], readonly ["Senegal", readonly ["africa"], "sn", "221"], readonly ["Serbia", readonly ["europe", "ex-yugos"], "rs", "381"], readonly ["Seychelles", readonly ["africa"], "sc", "248"], readonly ["Sierra Leone", readonly ["africa"], "sl", "232"], readonly ["Singapore", readonly ["asia"], "sg", "65", ".... ...."], readonly ["Slovakia", readonly ["europe", "eu-union"], "sk", "421"], readonly ["Slovenia", readonly ["europe", "eu-union", "ex-yugos"], "si", "386"], readonly ["Solomon Islands", readonly ["oceania"], "sb", "677"], readonly ["Somalia", readonly ["africa"], "so", "252"], readonly ["South Africa", readonly ["africa"], "za", "27"], readonly ["South Korea", readonly ["asia"], "kr", "82", "... .... ...."], readonly ["South Sudan", readonly ["africa", "north-africa"], "ss", "211"], readonly ["Spain", readonly ["europe", "eu-union"], "es", "34", "... ... ..."], readonly ["Sri Lanka", readonly ["asia"], "lk", "94"], readonly ["Sudan", readonly ["africa"], "sd", "249"], readonly ["Suriname", readonly ["america", "south-america"], "sr", "597"], readonly ["Swaziland", readonly ["africa"], "sz", "268"], readonly ["Sweden", readonly ["europe", "eu-union", "baltic"], "se", "46", "(...) ... ..."], readonly ["Switzerland", readonly ["europe"], "ch", "41", ".. ... .. .."], readonly ["Syria", readonly ["middle-east"], "sy", "963"], readonly ["Taiwan", readonly ["asia"], "tw", "886"], readonly ["Tajikistan", readonly ["asia", "ex-ussr"], "tj", "992"], readonly ["Tanzania", readonly ["africa"], "tz", "255"], readonly ["Thailand", readonly ["asia"], "th", "66"], readonly ["Timor-Leste", readonly ["asia"], "tl", "670"], readonly ["Togo", readonly ["africa"], "tg", "228"], readonly ["Tonga", readonly ["oceania"], "to", "676"], readonly ["Trinidad and Tobago", readonly ["america", "carribean"], "tt", "1868"], readonly ["Tunisia", readonly ["africa", "north-africa"], "tn", "216"], readonly ["Turkey", readonly ["europe"], "tr", "90", "... ... .. .."], readonly ["Turkmenistan", readonly ["asia", "ex-ussr"], "tm", "993"], readonly ["Tuvalu", readonly ["asia"], "tv", "688"], readonly ["Uganda", readonly ["africa"], "ug", "256"], readonly ["Ukraine", readonly ["europe", "ex-ussr"], "ua", "380", "(..) ... .. .."], readonly ["United Arab Emirates", readonly ["middle-east"], "ae", "971"], readonly ["United Kingdom", readonly ["europe", "eu-union"], "gb", "44", ".... ......"], readonly ["United States", readonly ["america", "north-america"], "us", "1", "(...) ... ...."], readonly ["Uruguay", readonly ["america", "south-america"], "uy", "598"], readonly ["Uzbekistan", readonly ["asia", "ex-ussr"], "uz", "998", ".. ... .. .."], readonly ["Vanuatu", readonly ["oceania"], "vu", "678"], readonly ["Vatican City", readonly ["europe"], "va", "39", ".. .... ...."], readonly ["Venezuela", readonly ["america", "south-america"], "ve", "58"], readonly ["Vietnam", readonly ["asia"], "vn", "84"], readonly ["Yemen", readonly ["middle-east"], "ye", "967"], readonly ["Zambia", readonly ["africa"], "zm", "260"], readonly ["Zimbabwe", readonly ["africa"], "zw", "263"]];
3
+ export declare const getInternationalCallingCodeMap: () => TCallingCodeMap;
4
+ export declare const getCountries: () => string[];
5
+ export declare const getCountryFromPrefix: (prefix: string, country: Map<TCountry, string>) => TCountry | undefined;
@@ -0,0 +1,2 @@
1
+ export * from "./contact-field";
2
+ export * from "./types";
@@ -0,0 +1,30 @@
1
+ import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../frontend-engine/types";
2
+ import { CountryData } from "./data";
3
+ import { PhoneNumberInputProps } from "@lifesg/react-design-system";
4
+ interface IContactFieldProps extends PhoneNumberInputProps {
5
+ defaultCountry?: TCountry;
6
+ enableSearch?: boolean | undefined;
7
+ }
8
+ export type TSingaporeNumberRule = "default" | "house" | "mobile";
9
+ export type TCountry = (typeof CountryData)[number][0];
10
+ export type TCallingCodeMap = Map<TCountry, string>;
11
+ export interface IContactFieldValidationRule {
12
+ contactNumber?: {
13
+ internationalNumber: boolean | Omit<TCountry, "Singapore">;
14
+ singaporeNumber?: never;
15
+ } | {
16
+ internationalNumber?: never;
17
+ singaporeNumber: TSingaporeNumberRule;
18
+ };
19
+ }
20
+ export interface ISelectedCountry {
21
+ prefix: string | undefined;
22
+ name: TCountry;
23
+ }
24
+ export interface IParsedPhoneNumber {
25
+ prefix: string;
26
+ number: string;
27
+ }
28
+ export interface IContactFieldSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"contact-field", V, IContactFieldValidationRule>, TComponentOmitProps<IContactFieldProps> {
29
+ }
30
+ export {};
@@ -0,0 +1,3 @@
1
+ import { IGenericFieldProps } from "../../frontend-engine/types";
2
+ import { IDateFieldSchema } from "./types";
3
+ export declare const DateField: (props: IGenericFieldProps<IDateFieldSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from "./date-field";
2
+ export * from "./types";
@@ -1,6 +1,6 @@
1
1
  import { DateInputProps } from "@lifesg/react-design-system/date-input";
2
2
  import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../frontend-engine/types";
3
- export interface IDateInputValidationRule {
3
+ export interface IDateFieldValidationRule {
4
4
  future?: boolean | undefined;
5
5
  past?: boolean | undefined;
6
6
  notFuture?: boolean | undefined;
@@ -8,7 +8,7 @@ export interface IDateInputValidationRule {
8
8
  minDate?: string | undefined;
9
9
  maxDate?: string | undefined;
10
10
  }
11
- export interface IDateInputSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"date", V, IDateInputValidationRule>, TComponentOmitProps<DateInputProps> {
11
+ export interface IDateFieldSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"date-field", V, IDateFieldValidationRule>, TComponentOmitProps<DateInputProps> {
12
12
  useCurrentDate?: boolean | undefined;
13
13
  dateFormat?: string | undefined;
14
14
  }
@@ -1,11 +1,13 @@
1
1
  export * from "./checkbox-group";
2
2
  export * from "./chips";
3
- export * from "./contact-number";
4
- export * from "./date-input";
3
+ export * from "./contact-field";
4
+ export * from "./date-field";
5
5
  export * from "./multi-select";
6
6
  export * from "./radio-button";
7
7
  export * from "./select";
8
8
  export * from "./submit-button";
9
+ export * from "./text-field";
9
10
  export * from "./textarea";
10
- export * from "./textfield";
11
- export * from "./time-picker";
11
+ export * from "./time-field";
12
+ export * from "./reset-button";
13
+ export * from "./unit-number-field";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine";
3
2
  import { IMultiSelectSchema } from "./types";
4
- export declare const MultiSelect: (props: IGenericFieldProps<IMultiSelectSchema>) => JSX.Element;
3
+ export declare const MultiSelect: (props: IGenericFieldProps<IMultiSelectSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine";
3
2
  import { IRadioButtonGroupSchema } from "./types";
4
- export declare const RadioButtonGroup: (props: IGenericFieldProps<IRadioButtonGroupSchema>) => JSX.Element;
3
+ export declare const RadioButtonGroup: (props: IGenericFieldProps<IRadioButtonGroupSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -5,4 +5,5 @@ interface ILabelProps {
5
5
  export declare const Label: import("styled-components").StyledComponent<"label", any, ILabelProps, never>;
6
6
  export declare const StyledRadioButton: import("styled-components").StyledComponent<({ className, checked, disabled, onChange, ...otherProps }: import("@lifesg/react-design-system/radio-button").RadioButtonProps) => JSX.Element, any, {}, never>;
7
7
  export declare const RadioContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const ToggleWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
9
  export {};
@@ -3,8 +3,17 @@ import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../f
3
3
  interface IOption {
4
4
  label: string;
5
5
  value: string;
6
+ disabled?: boolean | undefined;
6
7
  }
8
+ type TCustomOptions = {
9
+ styleType: "default";
10
+ } | {
11
+ styleType: "toggle";
12
+ indicator?: boolean;
13
+ border?: boolean;
14
+ };
7
15
  export interface IRadioButtonGroupSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"radio", V>, TComponentOmitProps<RadioButtonProps> {
8
16
  options: IOption[];
17
+ customOptions?: TCustomOptions;
9
18
  }
10
19
  export {};
@@ -0,0 +1,2 @@
1
+ export * from "./reset-button";
2
+ export * from "./types";
@@ -0,0 +1,3 @@
1
+ import { IGenericFieldProps } from "../../frontend-engine";
2
+ import { IResetButtonSchema } from "./types";
3
+ export declare const ResetButton: (props: IGenericFieldProps<IResetButtonSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ButtonProps } from "@lifesg/react-design-system/button/types";
2
+ import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../frontend-engine";
3
+ export interface IResetButtonSchema extends Omit<IFrontendEngineBaseFieldJsonSchema<"reset">, "validation">, TComponentOmitProps<ButtonProps, "disabled"> {
4
+ disabled?: boolean | undefined;
5
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine";
3
2
  import { ISelectSchema } from "./types";
4
- export declare const Select: (props: IGenericFieldProps<ISelectSchema>) => JSX.Element;
3
+ export declare const Select: (props: IGenericFieldProps<ISelectSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine";
3
2
  import { ISubmitButtonSchema } from "./types";
4
- export declare const SubmitButton: (props: IGenericFieldProps<ISubmitButtonSchema>) => JSX.Element;
3
+ export declare const SubmitButton: (props: IGenericFieldProps<ISubmitButtonSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from "./text-field";
2
+ export * from "./types";
@@ -0,0 +1,3 @@
1
+ import { IGenericFieldProps } from "../../frontend-engine";
2
+ import { IEmailFieldSchema, INumericFieldSchema, ITextFieldSchema } from "./types";
3
+ export declare const TextField: (props: IGenericFieldProps<ITextFieldSchema | IEmailFieldSchema | INumericFieldSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { FormInputProps } from "@lifesg/react-design-system/form/types";
2
+ import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../frontend-engine";
3
+ export interface ITextFieldSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"text-field", V>, TComponentOmitProps<FormInputProps, "type" | "maxLength"> {
4
+ }
5
+ export interface IEmailFieldSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"email-field", V>, TComponentOmitProps<FormInputProps, "type" | "maxLength"> {
6
+ }
7
+ export interface INumericFieldSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"numeric-field", V>, TComponentOmitProps<FormInputProps, "type" | "max" | "min"> {
8
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine/types";
3
2
  import { ITextareaSchema } from "./types";
4
- export declare const Textarea: (props: IGenericFieldProps<ITextareaSchema>) => JSX.Element;
3
+ export declare const Textarea: (props: IGenericFieldProps<ITextareaSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from "./time-field";
2
+ export * from "./types";
@@ -0,0 +1,3 @@
1
+ import { IGenericFieldProps } from "../../frontend-engine";
2
+ import { ITimeFieldSchema } from "./types";
3
+ export declare const TimeField: (props: IGenericFieldProps<ITimeFieldSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { TimepickerProps } from "@lifesg/react-design-system/timepicker";
2
2
  import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../frontend-engine";
3
- export interface ITimePickerSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"time", V>, TComponentOmitProps<TimepickerProps> {
3
+ export interface ITimeFieldSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"time-field", V>, TComponentOmitProps<TimepickerProps> {
4
4
  useCurrentTime?: boolean | undefined;
5
5
  is24HourFormat?: boolean | undefined;
6
6
  }
@@ -0,0 +1,2 @@
1
+ export * from "./unit-number-field";
2
+ export * from "./types";
@@ -0,0 +1,7 @@
1
+ import { UnitNumberInputProps } from "@lifesg/react-design-system/unit-number";
2
+ import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../frontend-engine";
3
+ export interface IUnitNumberFieldValidationRule {
4
+ unitNumberFormat?: boolean | undefined;
5
+ }
6
+ export interface IUnitNumberFieldSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"unit-number-field", V, IUnitNumberFieldValidationRule>, TComponentOmitProps<UnitNumberInputProps> {
7
+ }
@@ -0,0 +1,3 @@
1
+ import { IGenericFieldProps } from "../../frontend-engine";
2
+ import { IUnitNumberFieldSchema } from "./types";
3
+ export declare const UnitNumberField: (props: IGenericFieldProps<IUnitNumberFieldSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -1,20 +1,14 @@
1
1
  import { ReactElement, Ref } from "react";
2
- import { IFrontendEngineProps, IFrontendEngineRef } from "./types";
2
+ import { IFrontendEngineProps, IFrontendEngineRef, TNoInfer } from "./types";
3
3
  import { IYupValidationRule } from "./yup";
4
- /**
5
- * prevents inferrence
6
- * https://stackoverflow.com/questions/56687668/a-way-to-disable-type-argument-inference-in-generics
7
- */
8
- type NoInfer<T, U> = [T][T extends U ? 0 : never];
9
4
  /**
10
5
  * The one and only component needed to create your form
11
6
  *
12
7
  * Minimally you will need to set the `data` props which is the JSON schema to define the form
13
8
  */
14
- export declare const FrontendEngine: <V = undefined>(props: IFrontendEngineProps<NoInfer<V, IYupValidationRule>> & {
9
+ export declare const FrontendEngine: <V = undefined>(props: IFrontendEngineProps<TNoInfer<V, IYupValidationRule>> & {
15
10
  ref?: Ref<IFrontendEngineRef>;
16
11
  }) => ReactElement;
17
- export {};
18
12
  /**
19
13
  * casting as a function with generics as a way to define generics with forwardRef
20
14
  * the generics are a way to set custom definition of Yup validation config