@lifesg/web-frontend-engine 1.0.0-alpha.3 → 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 (50) hide show
  1. package/cjs/index.js +88 -84
  2. package/cjs/index.js.map +1 -1
  3. package/components/custom/filter/filter/filter.d.ts +2 -0
  4. package/components/custom/filter/filter/types.d.ts +14 -0
  5. package/components/custom/filter/filter-checkbox/filter-checkbox.d.ts +3 -0
  6. package/components/custom/filter/filter-checkbox/types.d.ts +12 -0
  7. package/components/custom/filter/filter-item/filter-item.d.ts +3 -0
  8. package/components/custom/filter/filter-item/types.d.ts +8 -0
  9. package/components/custom/filter/index.d.ts +3 -0
  10. package/components/custom/index.d.ts +1 -0
  11. package/components/elements/alert/alert.d.ts +1 -2
  12. package/components/elements/section/section.d.ts +1 -2
  13. package/components/elements/sections/sections.d.ts +1 -2
  14. package/components/elements/text/data.d.ts +12 -12
  15. package/components/elements/text/text.d.ts +1 -2
  16. package/components/elements/wrapper/conditional-renderer.d.ts +4 -2
  17. package/components/elements/wrapper/types.d.ts +3 -1
  18. package/components/fields/checkbox-group/checkbox-group.d.ts +1 -2
  19. package/components/fields/checkbox-group/checkbox-group.styles.d.ts +2 -1
  20. package/components/fields/checkbox-group/types.d.ts +13 -1
  21. package/components/fields/chips/chips.d.ts +1 -2
  22. package/components/fields/chips/types.d.ts +1 -0
  23. package/components/fields/contact-field/contact-field.d.ts +1 -2
  24. package/components/fields/contact-field/data.d.ts +4 -214
  25. package/components/fields/contact-field/types.d.ts +8 -7
  26. package/components/fields/date-field/date-field.d.ts +1 -2
  27. package/components/fields/index.d.ts +2 -0
  28. package/components/fields/multi-select/multi-select.d.ts +1 -2
  29. package/components/fields/radio-button/radio-button.d.ts +1 -2
  30. package/components/fields/radio-button/radio-button.styles.d.ts +1 -0
  31. package/components/fields/radio-button/types.d.ts +9 -0
  32. package/components/fields/reset-button/index.d.ts +2 -0
  33. package/components/fields/reset-button/reset-button.d.ts +3 -0
  34. package/components/fields/reset-button/types.d.ts +5 -0
  35. package/components/fields/select/select.d.ts +1 -2
  36. package/components/fields/submit-button/submit-button.d.ts +1 -2
  37. package/components/fields/text-field/text-field.d.ts +1 -2
  38. package/components/fields/textarea/textarea.d.ts +1 -2
  39. package/components/fields/time-field/time-field.d.ts +1 -2
  40. package/components/fields/unit-number-field/index.d.ts +2 -0
  41. package/components/fields/unit-number-field/types.d.ts +7 -0
  42. package/components/fields/unit-number-field/unit-number-field.d.ts +3 -0
  43. package/components/frontend-engine/types.d.ts +29 -7
  44. package/components/frontend-engine/yup/context-provider.d.ts +1 -1
  45. package/components/shared/chip/chip.d.ts +1 -1
  46. package/components/shared/error-messages.d.ts +3 -0
  47. package/components/shared/sanitize/sanitize.d.ts +1 -1
  48. package/index.js +95 -91
  49. package/index.js.map +1 -1
  50. package/package.json +2 -2
@@ -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;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { ISectionProps } from "./types";
3
- export declare const Section: (props: ISectionProps) => JSX.Element;
2
+ export declare const Section: (props: ISectionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ISectionsProps } from "./types";
3
2
  /**
4
3
  * this component is meant to render "pages" which consists of individual Section component
@@ -12,4 +11,4 @@ import { ISectionsProps } from "./types";
12
11
  * - render pages properly
13
12
  * - handle validation and errors in each section before navigating away
14
13
  */
15
- export declare const Sections: (props: ISectionsProps) => JSX.Element;
14
+ export declare const Sections: (props: ISectionsProps) => import("react/jsx-runtime").JSX.Element;
@@ -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,16 +1,18 @@
1
1
  import React from "react";
2
2
  import { TFrontendEngineFieldSchema } from "../../frontend-engine";
3
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";
4
6
  interface IProps {
5
7
  id: string;
6
8
  renderRules?: TRenderRules[] | undefined;
7
9
  children: React.ReactNode;
8
- schema: TFrontendEngineFieldSchema;
10
+ schema: TFrontendEngineFieldSchema | IFilterItemSchema | IFilterCheckboxSchema;
9
11
  }
10
12
  /**
11
13
  * conditionally render children according to render rules provided
12
14
  * render conditions are based on Yup schema and the base schema is derived from corresponding validation config
13
15
  * automatically remove validation config on hide / unmount, for more complex fields, it still has to be done via the field itself
14
16
  */
15
- export declare const ConditionalRenderer: ({ id, renderRules, children, schema }: IProps) => JSX.Element;
17
+ export declare const ConditionalRenderer: ({ id, renderRules, children, schema }: IProps) => import("react/jsx-runtime").JSX.Element;
16
18
  export {};
@@ -1,4 +1,6 @@
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
6
  export type TWrapperType = "div" | "span" | "header" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p";
@@ -11,6 +13,6 @@ export interface IWrapperProps {
11
13
  id?: string | undefined;
12
14
  schema?: IWrapperSchema | undefined;
13
15
  /** only used internally by FrontendEngine */
14
- children?: Record<string, TFrontendEngineFieldSchema> | undefined;
16
+ children?: Record<string, TFrontendEngineFieldSchema> | Record<string, IFilterItemSchema | IFilterCheckboxSchema> | undefined;
15
17
  warnings?: Record<string, string> | undefined;
16
18
  }
@@ -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[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine/types";
3
2
  import { IContactFieldSchema } from "./types";
4
- export declare const ContactField: (props: IGenericFieldProps<IContactFieldSchema>) => JSX.Element;
3
+ export declare const ContactField: (props: IGenericFieldProps<IContactFieldSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -1,215 +1,5 @@
1
- export declare const InternationalCallingCodeMap: {
2
- Singapore: string;
3
- Afghanistan: string;
4
- Albania: string;
5
- Algeria: string;
6
- Andorra: string;
7
- Angola: string;
8
- "Antigua and Barbuda": string;
9
- Argentina: string;
10
- Armenia: string;
11
- Aruba: string;
12
- Australia: string;
13
- Austria: string;
14
- Azerbaijan: string;
15
- Bahamas: string;
16
- Bahrain: string;
17
- Bangladesh: string;
18
- Barbados: string;
19
- Belarus: string;
20
- Belgium: string;
21
- Belize: string;
22
- Benin: string;
23
- Bhutan: string;
24
- Bolivia: string;
25
- "Bosnia and Herzegovina": string;
26
- Botswana: string;
27
- Brazil: string;
28
- "British Indian Ocean Territory": string;
29
- Brunei: string;
30
- Bulgaria: string;
31
- "Burkina Faso": string;
32
- Burundi: string;
33
- Cambodia: string;
34
- Cameroon: string;
35
- Canada: string;
36
- "Cape Verde": string;
37
- "Caribbean Netherlands": string;
38
- "Central African Republic": string;
39
- Chad: string;
40
- Chile: string;
41
- China: string;
42
- Colombia: string;
43
- Comoros: string;
44
- Congo: string;
45
- "Costa Rica": string;
46
- "C\u00F4te d\u2019Ivoire": string;
47
- Croatia: string;
48
- Cuba: string;
49
- Curaçao: string;
50
- Cyprus: string;
51
- "Czech Republic": string;
52
- Denmark: string;
53
- Djibouti: string;
54
- Dominica: string;
55
- "Dominican Republic": string;
56
- Ecuador: string;
57
- Egypt: string;
58
- "El Salvador": string;
59
- "Equatorial Guinea": string;
60
- Eritrea: string;
61
- Estonia: string;
62
- Ethiopia: string;
63
- Fiji: string;
64
- Finland: string;
65
- France: string;
66
- "French Guiana": string;
67
- "French Polynesia": string;
68
- Gabon: string;
69
- Gambia: string;
70
- Georgia: string;
71
- Germany: string;
72
- Ghana: string;
73
- Greece: string;
74
- Grenada: string;
75
- Guadeloupe: string;
76
- Guam: string;
77
- Guatemala: string;
78
- Guinea: string;
79
- "Guinea-Bissau": string;
80
- Guyana: string;
81
- Haiti: string;
82
- Honduras: string;
83
- "Hong Kong": string;
84
- Hungary: string;
85
- Iceland: string;
86
- India: string;
87
- Indonesia: string;
88
- Iran: string;
89
- Iraq: string;
90
- Ireland: string;
91
- Israel: string;
92
- Italy: string;
93
- Jamaica: string;
94
- Japan: string;
95
- Jordan: string;
96
- Kazakhstan: string;
97
- Kenya: string;
98
- Kiribati: string;
99
- Kosovo: string;
100
- Kuwait: string;
101
- Kyrgyzstan: string;
102
- Laos: string;
103
- Latvia: string;
104
- Lebanon: string;
105
- Lesotho: string;
106
- Liberia: string;
107
- Libya: string;
108
- Liechtenstein: string;
109
- Lithuania: string;
110
- Luxembourg: string;
111
- Macau: string;
112
- Macedonia: string;
113
- Madagascar: string;
114
- Malawi: string;
115
- Malaysia: string;
116
- Maldives: string;
117
- Mali: string;
118
- Malta: string;
119
- "Marshall Islands": string;
120
- Martinique: string;
121
- Mauritania: string;
122
- Mauritius: string;
123
- Mexico: string;
124
- Micronesia: string;
125
- Moldova: string;
126
- Monaco: string;
127
- Mongolia: string;
128
- Montenegro: string;
129
- Morocco: string;
130
- Mozambique: string;
131
- Myanmar: string;
132
- Namibia: string;
133
- Nauru: string;
134
- Nepal: string;
135
- Netherlands: string;
136
- "New Caledonia": string;
137
- "New Zealand": string;
138
- Nicaragua: string;
139
- Niger: string;
140
- Nigeria: string;
141
- "North Korea": string;
142
- Norway: string;
143
- Oman: string;
144
- Pakistan: string;
145
- Palau: string;
146
- Palestine: string;
147
- Panama: string;
148
- "Papua New Guinea": string;
149
- Paraguay: string;
150
- Peru: string;
151
- Philippines: string;
152
- Poland: string;
153
- Portugal: string;
154
- "Puerto Rico": string;
155
- Qatar: string;
156
- Réunion: string;
157
- Romania: string;
158
- Russia: string;
159
- Rwanda: string;
160
- "Saint Kitts and Nevis": string;
161
- "Saint Lucia": string;
162
- "Saint Vincent and the Grenadines": string;
163
- Samoa: string;
164
- "San Marino": string;
165
- "S\u00E3o Tom\u00E9 and Pr\u00EDncipe": string;
166
- "Saudi Arabia": string;
167
- Senegal: string;
168
- Serbia: string;
169
- Seychelles: string;
170
- "Sierra Leone": string;
171
- Slovakia: string;
172
- Slovenia: string;
173
- "Solomon Islands": string;
174
- Somalia: string;
175
- "South Africa": string;
176
- "South Korea": string;
177
- "South Sudan": string;
178
- Spain: string;
179
- "Sri Lanka": string;
180
- Sudan: string;
181
- Suriname: string;
182
- Swaziland: string;
183
- Sweden: string;
184
- Switzerland: string;
185
- Syria: string;
186
- Taiwan: string;
187
- Tajikistan: string;
188
- Tanzania: string;
189
- Thailand: string;
190
- "Timor-Leste": string;
191
- Togo: string;
192
- Tonga: string;
193
- "Trinidad and Tobago": string;
194
- Tunisia: string;
195
- Turkey: string;
196
- Turkmenistan: string;
197
- Tuvalu: string;
198
- Uganda: string;
199
- Ukraine: string;
200
- "United Arab Emirates": string;
201
- "United Kingdom": string;
202
- "United States": string;
203
- Uruguay: string;
204
- Uzbekistan: string;
205
- Vanuatu: string;
206
- "Vatican City": string;
207
- Venezuela: string;
208
- Vietnam: string;
209
- Yemen: string;
210
- Zambia: string;
211
- Zimbabwe: string;
212
- };
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;
213
4
  export declare const getCountries: () => string[];
214
- export declare const getPrefix: (country: string) => string;
215
- export declare const getCountryFromPrefix: (prefix: string) => string | undefined;
5
+ export declare const getCountryFromPrefix: (prefix: string, country: Map<TCountry, string>) => TCountry | undefined;
@@ -1,15 +1,16 @@
1
- import { FormInputProps } from "@lifesg/react-design-system/form/types";
2
1
  import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../frontend-engine/types";
3
- import { InternationalCallingCodeMap } from "./data";
4
- export type TCountry = keyof typeof InternationalCallingCodeMap;
5
- interface IContactFieldProps extends FormInputProps {
6
- country?: TCountry;
2
+ import { CountryData } from "./data";
3
+ import { PhoneNumberInputProps } from "@lifesg/react-design-system";
4
+ interface IContactFieldProps extends PhoneNumberInputProps {
5
+ defaultCountry?: TCountry;
7
6
  enableSearch?: boolean | undefined;
8
7
  }
9
8
  export type TSingaporeNumberRule = "default" | "house" | "mobile";
9
+ export type TCountry = (typeof CountryData)[number][0];
10
+ export type TCallingCodeMap = Map<TCountry, string>;
10
11
  export interface IContactFieldValidationRule {
11
12
  contactNumber?: {
12
- internationalNumber: true;
13
+ internationalNumber: boolean | Omit<TCountry, "Singapore">;
13
14
  singaporeNumber?: never;
14
15
  } | {
15
16
  internationalNumber?: never;
@@ -17,7 +18,7 @@ export interface IContactFieldValidationRule {
17
18
  };
18
19
  }
19
20
  export interface ISelectedCountry {
20
- prefix: string;
21
+ prefix: string | undefined;
21
22
  name: TCountry;
22
23
  }
23
24
  export interface IParsedPhoneNumber {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine/types";
3
2
  import { IDateFieldSchema } from "./types";
4
- export declare const DateField: (props: IGenericFieldProps<IDateFieldSchema>) => JSX.Element;
3
+ export declare const DateField: (props: IGenericFieldProps<IDateFieldSchema>) => import("react/jsx-runtime").JSX.Element;
@@ -9,3 +9,5 @@ export * from "./submit-button";
9
9
  export * from "./text-field";
10
10
  export * from "./textarea";
11
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;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IGenericFieldProps } from "../../frontend-engine";
3
2
  import { IEmailFieldSchema, INumericFieldSchema, ITextFieldSchema } from "./types";
4
- export declare const TextField: (props: IGenericFieldProps<ITextFieldSchema | IEmailFieldSchema | INumericFieldSchema>) => JSX.Element;
3
+ export declare const TextField: (props: IGenericFieldProps<ITextFieldSchema | IEmailFieldSchema | INumericFieldSchema>) => import("react/jsx-runtime").JSX.Element;