@secondstaxorg/sscomp 1.7.1 → 1.7.7

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 (44) hide show
  1. package/dist/bundle.css +0 -1
  2. package/dist/index.css +0 -2
  3. package/dist/index.es.css +0 -2
  4. package/dist/index.es.js +832 -389
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/index.js +4303 -3236
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.css +0 -2
  9. package/dist/index.min.js +843 -400
  10. package/dist/index.min.js.map +1 -1
  11. package/package.json +1 -1
  12. package/types/components/Accordion/Accordion.d.ts +4 -0
  13. package/types/components/Accordion/type.d.ts +2 -2
  14. package/types/components/CountrySelector/CountrySelector.d.ts +2 -1
  15. package/types/components/CountrySelector/type.d.ts +17 -13
  16. package/types/components/DatePicker/style.d.ts +1 -0
  17. package/types/components/DatePicker/type.d.ts +12 -0
  18. package/types/components/DateRangePicker/type.d.ts +4 -0
  19. package/types/components/DropdownList/DropdownList.d.ts +1 -0
  20. package/types/components/DropdownList/type.d.ts +4 -0
  21. package/types/components/EmailField/EmailField.d.ts +7 -0
  22. package/types/components/EmailField/style.d.ts +5 -0
  23. package/types/components/EmailField/type.d.ts +16 -0
  24. package/types/components/FileUpload/FileUpdload.d.ts +5 -0
  25. package/types/components/FileUpload/style.d.ts +2 -0
  26. package/types/components/FileUpload/type.d.ts +6 -0
  27. package/types/components/NumberField/NumberField.d.ts +8 -0
  28. package/types/components/NumberField/style.d.ts +5 -0
  29. package/types/components/NumberField/type.d.ts +46 -0
  30. package/types/components/PasswordField/PasswordField.d.ts +1 -0
  31. package/types/components/PhoneInput/PhoneInput.d.ts +1 -0
  32. package/types/components/PhoneInput/countries.d.ts +6 -0
  33. package/types/components/PhoneInput/type.d.ts +14 -2
  34. package/types/components/Selector/Selector.d.ts +1 -0
  35. package/types/components/Selector/styles.d.ts +2 -1
  36. package/types/components/Selector/types.d.ts +26 -4
  37. package/types/components/TextArea/TextArea.d.ts +1 -0
  38. package/types/components/TextArea/type.d.ts +7 -0
  39. package/types/components/TextField/TextField.d.ts +1 -0
  40. package/types/components/TextField/type.d.ts +7 -0
  41. package/types/components/Tooltip/Tooltip.d.ts +0 -1
  42. package/types/components/Tooltip/style.d.ts +1 -0
  43. package/types/components/Tooltip/type.d.ts +1 -1
  44. package/types/components/index.d.ts +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondstaxorg/sscomp",
3
- "version": "1.7.1",
3
+ "version": "1.7.7",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { AccordionProps } from "./type";
3
+ declare const Accordion: (props: AccordionProps) => JSX.Element;
4
+ export default Accordion;
@@ -12,9 +12,9 @@ export interface AccordionProps {
12
12
  label: string;
13
13
  }) => void;
14
14
  /**
15
- * Optional, specify the array index (counting from 0) for which accordion to have expanded on page load
15
+ * Optional, specify the array index (counting from 0) in an array or as a single number for which accordions to have expanded on page load
16
16
  * */
17
- defaultExpanded?: number;
17
+ defaultExpanded?: number[] | number;
18
18
  onDelete?: ({}: {}) => void;
19
19
  }
20
20
  export declare type AccordionsType = {
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { SelectorProps } from "./type";
3
+ import '../../styles/typography.css';
3
4
  /**
4
- * Dropdown selector for selecting countries and currencies
5
+ * Dropdown selector for selecting <b>countries</b> or <b>currencies</b>
5
6
  */
6
7
  declare const CountrySelector: (props: SelectorProps) => JSX.Element;
7
8
  export default CountrySelector;
@@ -2,24 +2,15 @@ export interface SelectorProps {
2
2
  /**
3
3
  * Array of countries containing objects of country name, country short name, country flag and subname to be used in the case of selecting currencies
4
4
  */
5
- options: {
6
- optionName: string;
7
- optionShortName: string;
8
- optionFlag?: string;
9
- subName?: string;
10
- }[];
5
+ options: optionType[];
11
6
  /**
12
7
  * Function to receive the object of the selected item from the dropdown
13
8
  */
14
9
  selectedOption: (a: any) => void;
15
10
  /**
16
- * Initial text to be displayed in the field. Suitable to for when there is the need to display the current value of when updating a form
11
+ * Country to be prepopulated when component is rendered
17
12
  */
18
- initialText?: string;
19
- /**
20
- * Initial flag to be displayed in the field along with the initial text. Suitable to for when there is the need to display the current value of when updating a form
21
- */
22
- initialFlag?: string;
13
+ initialCountry?: string;
23
14
  /**
24
15
  * Label for the field
25
16
  */
@@ -36,9 +27,22 @@ export interface SelectorProps {
36
27
  * Division in the list to segment different groups of options
37
28
  */
38
29
  sectionTitle?: string;
30
+ /**
31
+ * Specify that the component is a required field
32
+ * */
39
33
  required?: boolean;
40
34
  /**
41
35
  * Input name as is with html input tag
42
36
  * */
43
- inputName: string;
37
+ inputName?: string;
38
+ /**
39
+ * Specify whether the component is a readonly field
40
+ */
41
+ readonly?: boolean;
44
42
  }
43
+ export declare type optionType = {
44
+ optionName: string;
45
+ optionShortName: string;
46
+ optionFlag?: string;
47
+ subName?: string;
48
+ };
@@ -1,5 +1,6 @@
1
1
  export declare const InputLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
2
2
  export declare const DatePickerContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const CalendarSheet: import("styled-components").StyledComponent<"div", any, {}, never>;
3
4
  export declare const InputField: import("styled-components").StyledComponent<"div", any, {}, never>;
4
5
  export declare const CalendarContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
6
  export declare const ErrorMessage: import("styled-components").StyledComponent<"p", any, {}, never>;
@@ -31,4 +31,16 @@ export interface DatePickerProps {
31
31
  * Specify whether the field is a required field
32
32
  */
33
33
  required?: boolean;
34
+ /**
35
+ * Number of years back to exclude from valid years.
36
+ */
37
+ minYear?: number;
38
+ /**
39
+ * Initial value to be displayed when the component is rendered.
40
+ */
41
+ value?: Date;
42
+ /**
43
+ * Specify whether the component is a readonly field
44
+ */
45
+ readonly?: boolean;
34
46
  }
@@ -23,4 +23,8 @@ export interface DateRangePickerProps {
23
23
  */
24
24
  showActionButtons?: boolean;
25
25
  width?: number;
26
+ /**
27
+ * Specify whether the component is a readonly field
28
+ */
29
+ readonly?: boolean;
26
30
  }
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { DropdownProps } from "./type";
3
+ import '../../styles/typography.css';
3
4
  /**
4
5
  * Dropdown component for selecting from a list of options
5
6
  */
@@ -45,4 +45,8 @@ export interface DropdownProps {
45
45
  * Input name as is with html input tag
46
46
  * */
47
47
  inputName: string;
48
+ /**
49
+ * Specify whether the component is a readonly field
50
+ */
51
+ readonly?: boolean;
48
52
  }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { EmailFieldProps } from "./type";
3
+ /**
4
+ * This component is used to render an email field. The email field validates the value of the input against a valid email address.
5
+ */
6
+ declare const EmailField: (props: EmailFieldProps) => JSX.Element;
7
+ export default EmailField;
@@ -0,0 +1,5 @@
1
+ export declare const InputLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const MainContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const InputField: import("styled-components").StyledComponent<"input", any, {}, never>;
4
+ export declare const InputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const ErrorMessage: import("styled-components").StyledComponent<"p", any, {}, never>;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ export interface EmailFieldProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
+ /**
4
+ * Label of the input field
5
+ */
6
+ label?: string;
7
+ /**
8
+ * Subtext of the label
9
+ */
10
+ subtext?: string;
11
+ /**
12
+ * The initial value of the field to be displayed in the component
13
+ */
14
+ initialVal?: string;
15
+ width?: number | 'fit-content' | '100%';
16
+ }
@@ -0,0 +1,5 @@
1
+ import { FileUploadProps } from "./type";
2
+ import React from "react";
3
+ import "../../styles/typography.css";
4
+ declare const FileUpdload: React.FC<FileUploadProps>;
5
+ export default FileUpdload;
@@ -0,0 +1,2 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const ErrorText: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,6 @@
1
+ export interface FileUploadProps {
2
+ label?: string;
3
+ required?: boolean;
4
+ value?: any;
5
+ onChange: (a: any) => void;
6
+ }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { NumberFieldProps } from "./type";
3
+ import '../../styles/typography.css';
4
+ /**
5
+ * This component is used to render a number or amount field. The latter is rendered when `currencyFlagPath` prop is supplied.
6
+ */
7
+ declare const NumberField: (props: NumberFieldProps) => JSX.Element;
8
+ export default NumberField;
@@ -0,0 +1,5 @@
1
+ export declare const InputLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const MainContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const InputField: import("styled-components").StyledComponent<"input", any, {}, never>;
4
+ export declare const InputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const ErrorMessage: import("styled-components").StyledComponent<"p", any, {}, never>;
@@ -0,0 +1,46 @@
1
+ export interface NumberFieldProps {
2
+ /**
3
+ * Label of the input field
4
+ */
5
+ label?: string;
6
+ /**
7
+ * Subtext of the label
8
+ */
9
+ subtext?: string;
10
+ /**
11
+ * Custom error message to be displayed in the case of an error
12
+ */
13
+ errMsg?: string;
14
+ /**
15
+ * Width of the component when rendered
16
+ */
17
+ width?: number | 'fit-content' | '100%';
18
+ /**
19
+ * When supplied the component can be rendered as an amount field
20
+ */
21
+ currencyFlagPath?: string;
22
+ /**
23
+ * Default value to be passed to the component to be displayed when rendered
24
+ */
25
+ value?: number | string;
26
+ /**
27
+ * Value that gets output when the component is typed in
28
+ */
29
+ onChange: (a: string) => void;
30
+ /**
31
+ * Specify whether the component should be disabled
32
+ */
33
+ disabled?: boolean;
34
+ /**
35
+ * Specify whether this is a required field
36
+ */
37
+ required?: boolean;
38
+ /**
39
+ * Specify a placeholder text for the input
40
+ */
41
+ placeholder?: string;
42
+ /**
43
+ * Specify whether the component is a readonly field
44
+ */
45
+ readonly?: boolean;
46
+ }
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { PasswordFieldProps } from "./type";
3
+ import '../../styles/typography.css';
3
4
  /**
4
5
  * Component for handling password input fields
5
6
  */
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { PhoneInputProps } from "./type";
3
+ import "../../styles/typography.css";
3
4
  /**
4
5
  * Dropdown component for selecting from a list of options
5
6
  */
@@ -0,0 +1,6 @@
1
+ export declare const countries: {
2
+ code: string;
3
+ country: string;
4
+ flag: string;
5
+ dial_code: string;
6
+ }[];
@@ -3,14 +3,18 @@ export interface PhoneInputProps {
3
3
  * Country code to be displayed on page load
4
4
  */
5
5
  initialCountryCode?: string;
6
+ /**
7
+ * Country code to be displayed on page load
8
+ */
9
+ initialPhoneNumber?: number;
6
10
  /**
7
11
  * Placeholder text to be displayed in the field
8
12
  */
9
13
  placeholder?: string;
10
14
  /**
11
- * Function to receive the object of the selected item
15
+ * Function to receive the object of the selected country
12
16
  */
13
- selectedCountryCode: (a: countryCodesType) => void;
17
+ selectedCountryCode?: (a: countryCodesType) => void;
14
18
  /**
15
19
  * Boolean to specify whether the field is active or disabled
16
20
  */
@@ -31,13 +35,21 @@ export interface PhoneInputProps {
31
35
  * Input name as is with html input tag
32
36
  * */
33
37
  inputName: string;
38
+ /**
39
+ * Onchange function when user is making an input
40
+ * */
34
41
  onChange: (value: {
35
42
  countryCode: string;
36
43
  phoneNumber: number;
37
44
  }) => void;
45
+ /**
46
+ * Specify whether the component is a readonly field
47
+ */
48
+ readonly?: boolean;
38
49
  }
39
50
  export declare type countryCodesType = {
40
51
  "country": string;
41
52
  "dial_code": string;
42
53
  "code": string;
54
+ "flag": string;
43
55
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { SelectorProps } from "./types";
3
+ import '../../styles/typography.css';
3
4
  /**
4
5
  * Component for making selections. Usage could be in an onboarding process
5
6
  */
@@ -1,5 +1,6 @@
1
1
  export declare const MainContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
2
2
  export declare const FieldContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const OtherContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
4
  export declare const InputLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
4
5
  export declare const SrInput: import("styled-components").StyledComponent<"input", any, {}, never>;
5
- export declare const SelectorContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const SelectorContainer: import("styled-components").StyledComponent<"button", any, {}, never>;
@@ -2,10 +2,7 @@ export interface SelectorProps {
2
2
  /**
3
3
  * Array containing items to be listed in the component
4
4
  */
5
- itemsList: {
6
- value?: string;
7
- label: string;
8
- }[];
5
+ itemsList: itemType[];
9
6
  /**
10
7
  * Callback function passing out the selected item when clicked
11
8
  */
@@ -44,4 +41,29 @@ export interface SelectorProps {
44
41
  * Input name as is with html input tag
45
42
  * */
46
43
  inputName: string;
44
+ /**
45
+ * Specify whether the options should be displayed side-by-side or one on top of the other
46
+ * */
47
+ arrangement: 'vertical' | 'horizontal';
48
+ /**
49
+ * Specify whether there should be an "Other" option
50
+ * */
51
+ otherOption?: boolean;
52
+ /**
53
+ * Specify the placeholder text for the "Other" option
54
+ * */
55
+ otherPlaceholder?: string;
56
+ /**
57
+ * Specify the number of columns if arrangement is horizontal
58
+ * */
59
+ numCols?: number;
60
+ value?: itemType | itemType[];
61
+ /**
62
+ * Specify whether the component is a readonly field
63
+ */
64
+ readonly?: boolean;
47
65
  }
66
+ export declare type itemType = {
67
+ label: string;
68
+ value?: string;
69
+ };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { TextAreaProps } from "./type";
3
+ import '../../styles/typography.css';
3
4
  /**
4
5
  * Component to display a textarea field in a form. This mimics the behavior of a regular HTML <code>&lt;textarea&gt;</code> element and accepts the same props as it along with the custom ones defined.
5
6
  */
@@ -16,5 +16,12 @@ export interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextArea
16
16
  * Initial value to be displayed
17
17
  */
18
18
  initialVal?: string | number;
19
+ /**
20
+ * Specify the width of the component
21
+ */
19
22
  width?: number;
23
+ /**
24
+ * Specify whether the component is a readonly field
25
+ */
26
+ readonly?: boolean;
20
27
  }
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { TextFieldProps } from "./type";
3
+ import '../../styles/typography.css';
3
4
  /**
4
5
  * Component to display an input field component in a form. This mimics the behavior of a regular HTML <code>&lt;input&gt;</code> element and accepts the same props as it along with the custom ones defined.
5
6
  */
@@ -16,5 +16,12 @@ export interface TextFieldProps extends React.InputHTMLAttributes<HTMLInputEleme
16
16
  * The initial value of the field to be displayed in the component
17
17
  */
18
18
  initialVal?: string | number;
19
+ /**
20
+ * Specify the width of the component
21
+ */
19
22
  width?: number | 'fit-content' | '100%';
23
+ /**
24
+ * Specify whether the component is a readonly field
25
+ */
26
+ readonly?: boolean;
20
27
  }
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { TooltipProps } from "./type";
3
- import 'tippy.js/dist/tippy.css';
4
3
  /**
5
4
  * Tooltip text to be displayed on an element
6
5
  */
@@ -0,0 +1 @@
1
+ export declare const TippyContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -15,5 +15,5 @@ export interface TooltipProps {
15
15
  /**
16
16
  * The HTML id attribute assigned to the child element wrapped inside the tooltip
17
17
  */
18
- childElementId: string;
18
+ childElementClassName: string;
19
19
  }
@@ -68,3 +68,7 @@ export { default as Selector } from './Selector/Selector';
68
68
  export { default as StepProgress } from './StepProgress/StepProgress';
69
69
  export { default as PhoneInput } from './PhoneInput/PhoneInput';
70
70
  export { default as Tooltip } from './Tooltip/Tooltip';
71
+ export { default as Accordion } from './Accordion/Accordion';
72
+ export { default as FileUpload } from './FileUpload/FileUpdload';
73
+ export { default as EmailField } from './EmailField/EmailField';
74
+ export { default as NumberField } from './NumberField/NumberField';