@antscorp/antsomi-ui 1.2.0 → 1.2.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/types/components/atoms/Checkbox/Checkbox.d.ts +1 -0
  3. package/dist/types/components/atoms/Checkbox/index.d.ts +1 -0
  4. package/dist/types/components/atoms/InputNumber/InputNumber.d.ts +1 -2
  5. package/dist/types/components/atoms/InputNumber/InputNumber.stories.d.ts +16 -0
  6. package/dist/types/components/atoms/InputNumber/__tests__/InputNumber.test.d.ts +1 -0
  7. package/dist/types/components/atoms/index.d.ts +1 -0
  8. package/dist/types/components/common/ConfigProvider/ConfigProvider.d.ts +4 -1
  9. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.d.ts +1 -0
  10. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +1 -0
  11. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +1 -1
  12. package/dist/types/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +2 -1
  13. package/dist/types/components/molecules/index.d.ts +1 -1
  14. package/dist/types/locales/i18n.d.ts +73 -0
  15. package/dist/types/locales/translations.d.ts +37 -0
  16. package/dist/types/types/index.d.ts +1 -0
  17. package/package.json +1 -1
  18. package/CHANGELOG.md +0 -54
  19. package/dist/json/6c296f4f68b6157dbae376b802e8cb69.json +0 -8
  20. package/dist/json/92f420e6aec822089f8cf33e83aa1e0c.json +0 -8
  21. package/dist/types/jest-setup.d.ts +0 -1
  22. package/dist/types/src/components/atoms/Button/Button.d.ts +0 -1
  23. package/dist/types/src/components/atoms/Button/Button.stories.d.ts +0 -32
  24. package/dist/types/src/components/atoms/Button/index.d.ts +0 -10
  25. package/dist/types/src/components/atoms/Button/test.d.ts +0 -3
  26. package/dist/types/src/components/atoms/Divider/Divider.d.ts +0 -1
  27. package/dist/types/src/components/atoms/Divider/Divider.stories.d.ts +0 -8
  28. package/dist/types/src/components/atoms/Divider/index.d.ts +0 -1
  29. package/dist/types/src/components/atoms/Input/Input.d.ts +0 -7
  30. package/dist/types/src/components/atoms/Input/Input.stories.d.ts +0 -19
  31. package/dist/types/src/components/atoms/Input/index.d.ts +0 -1
  32. package/dist/types/src/components/atoms/InputNumber/InputNumber.d.ts +0 -7
  33. package/dist/types/src/components/atoms/InputNumber/index.d.ts +0 -1
  34. package/dist/types/src/components/atoms/Radio/Radio.d.ts +0 -1
  35. package/dist/types/src/components/atoms/Radio/index.d.ts +0 -1
  36. package/dist/types/src/components/atoms/Space/Space.d.ts +0 -1
  37. package/dist/types/src/components/atoms/Space/index.d.ts +0 -1
  38. package/dist/types/src/components/atoms/Tag/Tag.d.ts +0 -1
  39. package/dist/types/src/components/atoms/Tag/index.d.ts +0 -1
  40. package/dist/types/src/components/atoms/Tooltip/Tooltip.d.ts +0 -1
  41. package/dist/types/src/components/atoms/Tooltip/index.d.ts +0 -1
  42. package/dist/types/src/components/atoms/Typography/Text.d.ts +0 -1
  43. package/dist/types/src/components/atoms/Typography/index.d.ts +0 -1
  44. package/dist/types/src/components/atoms/index.d.ts +0 -9
  45. package/dist/types/src/components/common/ConfigProvider/ConfigProvider.d.ts +0 -7
  46. package/dist/types/src/components/common/ConfigProvider/GlobalStyle.d.ts +0 -5
  47. package/dist/types/src/components/common/ConfigProvider/index.d.ts +0 -1
  48. package/dist/types/src/components/common/index.d.ts +0 -1
  49. package/dist/types/src/components/icons/EventIcon.d.ts +0 -3
  50. package/dist/types/src/components/icons/index.d.ts +0 -1
  51. package/dist/types/src/components/index.d.ts +0 -3
  52. package/dist/types/src/components/molecules/Alert/Alert.d.ts +0 -1
  53. package/dist/types/src/components/molecules/Alert/index.d.ts +0 -1
  54. package/dist/types/src/components/molecules/Cascader/Cascader.d.ts +0 -1
  55. package/dist/types/src/components/molecules/Cascader/index.d.ts +0 -1
  56. package/dist/types/src/components/molecules/CustomComponent/CustomComponent.d.ts +0 -2
  57. package/dist/types/src/components/molecules/CustomComponent/index.d.ts +0 -1
  58. package/dist/types/src/components/molecules/DatePicker/DatePicker.d.ts +0 -8
  59. package/dist/types/src/components/molecules/DatePicker/DatePicker.stories.d.ts +0 -4
  60. package/dist/types/src/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.d.ts +0 -24
  61. package/dist/types/src/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.stories.d.ts +0 -5
  62. package/dist/types/src/components/molecules/DatePicker/components/AdvancedPicker/constants.d.ts +0 -53
  63. package/dist/types/src/components/molecules/DatePicker/components/AdvancedPicker/index.d.ts +0 -3
  64. package/dist/types/src/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +0 -6
  65. package/dist/types/src/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +0 -11
  66. package/dist/types/src/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +0 -15
  67. package/dist/types/src/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +0 -9
  68. package/dist/types/src/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.stories.d.ts +0 -7
  69. package/dist/types/src/components/molecules/DatePicker/components/AdvancedRangePicker/constants.d.ts +0 -4
  70. package/dist/types/src/components/molecules/DatePicker/components/AdvancedRangePicker/index.d.ts +0 -2
  71. package/dist/types/src/components/molecules/DatePicker/components/AdvancedRangePicker/types.d.ts +0 -14
  72. package/dist/types/src/components/molecules/DatePicker/index.d.ts +0 -3
  73. package/dist/types/src/components/molecules/Dropdown/Dropdown.d.ts +0 -1
  74. package/dist/types/src/components/molecules/Dropdown/index.d.ts +0 -1
  75. package/dist/types/src/components/molecules/Modal/Modal.d.ts +0 -1
  76. package/dist/types/src/components/molecules/Modal/index.d.ts +0 -1
  77. package/dist/types/src/components/molecules/Select/Select.d.ts +0 -15
  78. package/dist/types/src/components/molecules/Select/Select.stories.d.ts +0 -28
  79. package/dist/types/src/components/molecules/Select/Test.d.ts +0 -3
  80. package/dist/types/src/components/molecules/Select/index.d.ts +0 -2
  81. package/dist/types/src/components/molecules/Select/styled.d.ts +0 -4
  82. package/dist/types/src/components/molecules/index.d.ts +0 -8
  83. package/dist/types/src/constants.d.ts +0 -12
  84. package/dist/types/src/hooks/index.d.ts +0 -2
  85. package/dist/types/src/index.d.ts +0 -2
  86. package/dist/types/src/locales/i18n.d.ts +0 -23
  87. package/dist/types/src/locales/translations.d.ts +0 -14
  88. package/dist/types/src/test.d.ts +0 -3
  89. package/dist/types/src/types/index.d.ts +0 -5
  90. package/dist/types/src/utils/common.d.ts +0 -8
  91. package/dist/types/src/utils/handleError.d.ts +0 -2
  92. /package/dist/types/{src/components → components}/atoms/Button/__tests__/Button.test.d.ts +0 -0
  93. /package/dist/types/{src/locales → locales}/types.d.ts +0 -0
@@ -1,3 +0,0 @@
1
- export { AdvancedPicker } from './AdvancedPicker';
2
- export type { AdvancedPickerProps } from './AdvancedPicker';
3
- export type { TOption as TAdvancedPickerOption } from './types';
@@ -1,6 +0,0 @@
1
- export declare const DropdownContent: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const DropdownHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const DropdownFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const DatePickerHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const DatePickerCustomInput: import("styled-components").StyledComponent<"input", any, {}, never>;
6
- export declare const DatePickerFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,11 +0,0 @@
1
- export type TOption = {
2
- dateType: TDateType;
3
- calculationType: TCalculationType;
4
- calculationDate: TCalculationDate;
5
- value: number;
6
- };
7
- export type TDateType = 'today' | 'first_day_of_week_mon_sun' | 'first_day_of_week_sun_sat' | 'first_day_of_month' | 'first_day_of_quarter' | 'first_day_of_year' | 'last_day_of_week_mon_sun' | 'last_day_of_week_sun_sat' | 'last_day_of_month' | 'last_day_of_quarter' | 'last_day_of_year' | 'fixed';
8
- export type TCalculationType = 'minus' | 'plus' | '';
9
- export type TCalculationDate = 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years' | '';
10
- export type TOperatorKey = 'after' | 'between' | 'before';
11
- export type TAdvancedType = 'startDate' | 'endDate';
@@ -1,15 +0,0 @@
1
- /**
2
- * Calculates a new date based on the given parameters.
3
- * @param {string} [dateTypeKey='today'] - Key to determine the type of date to be used as the starting point.
4
- * Valid values are: 'today', 'first_day_of_week_mon_sun', 'first_day_of_week_sun_sat',
5
- * 'first_day_of_month', 'first_day_of_quarter', 'first_day_of_year', 'last_day_of_week_mon_sun',
6
- * 'last_day_of_week_sun_sat', 'last_day_of_month', 'last_day_of_quarter', 'last_day_of_year'.
7
- * @param {string} [calculationTypeKey='minus'] - Key to determine whether to add or subtract the specified value.
8
- * Valid values are: 'plus', 'minus'.
9
- * @param {string} [calculationDateKey='days'] - Key to determine the unit of time to be added or subtracted.
10
- * Valid values are: 'days', 'weeks', 'months', 'quarters', 'years'.
11
- * @param {number} [value=0] - Value to be added or subtracted.
12
- * @param {string} [dateFormat=DEFAULT_DATE_FORMAT] - Format in which to return the new date.
13
- * @returns {string} The new date in the specified format.
14
- */
15
- export declare const calculationDateAdvanced: (dateTypeKey?: string, calculationTypeKey?: string, calculationDateKey?: any, value?: number, dateFormat?: string) => any;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { TOnChangePayload, TTimeRange } from './types';
3
- export interface AdvancedRangePickerProps {
4
- timeRange: TTimeRange;
5
- errorMessage?: string;
6
- showLabel?: boolean;
7
- onChange?: ({ timeRange, mode, }: TOnChangePayload) => void;
8
- }
9
- export declare const AdvancedRangePicker: React.FC<AdvancedRangePickerProps>;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { ComponentStory, ComponentMeta } from '@storybook/react';
3
- import { AdvancedRangePicker } from './AdvancedRangePicker';
4
- declare const _default: ComponentMeta<React.FC<import("./AdvancedRangePicker").AdvancedRangePickerProps>>;
5
- export default _default;
6
- export declare const Template: ComponentStory<typeof AdvancedRangePicker>;
7
- export declare const Basic: ComponentStory<typeof AdvancedRangePicker>;
@@ -1,4 +0,0 @@
1
- export declare const ADVANCED_RANGE_PICKER_FORMAT: {
2
- startDate: string;
3
- endDate: string;
4
- };
@@ -1,2 +0,0 @@
1
- export { AdvancedRangePicker } from './AdvancedRangePicker';
2
- export type { TTimeRange as TAdvancedRangePickerTimeRange } from './types';
@@ -1,14 +0,0 @@
1
- import { TOption } from '../AdvancedPicker/types';
2
- export type TOnChangeMode = 'system' | 'user';
3
- export type TTimeRange = {
4
- startDate: TOption & {
5
- date: string;
6
- };
7
- endDate: TOption & {
8
- date: string;
9
- };
10
- };
11
- export type TOnChangePayload = {
12
- timeRange: TTimeRange;
13
- mode: 'system' | 'user';
14
- };
@@ -1,3 +0,0 @@
1
- export { DatePicker } from './DatePicker';
2
- export type { AdvancedPickerProps, TAdvancedPickerOption } from './components/AdvancedPicker';
3
- export type { TAdvancedRangePickerTimeRange } from './components/AdvancedRangePicker';
@@ -1 +0,0 @@
1
- export { Dropdown } from 'antd';
@@ -1 +0,0 @@
1
- export { Dropdown } from './Dropdown';
@@ -1 +0,0 @@
1
- export { Modal } from 'antd';
@@ -1 +0,0 @@
1
- export { Modal } from './Modal';
@@ -1,15 +0,0 @@
1
- import { SelectProps as AntdSelectProps } from 'antd';
2
- import React from 'react';
3
- export interface SelectProps extends AntdSelectProps {
4
- }
5
- declare const Select: (<ValueType = any, OptionType extends import("rc-select/lib/Select").DefaultOptionType | import("rc-select/lib/Select").BaseOptionType = import("rc-select/lib/Select").DefaultOptionType>(props: AntdSelectProps<ValueType, OptionType> & {
6
- children?: React.ReactNode;
7
- } & {
8
- ref?: React.Ref<import("antd").RefSelectProps> | undefined;
9
- }) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
10
- SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
11
- Option: import("rc-select/lib/Option").OptionFC;
12
- OptGroup: import("rc-select/lib/OptGroup").OptionGroupFC;
13
- _InternalPanelDoNotUseOrYouWillBeFired: any;
14
- } & React.FC<SelectProps>;
15
- export { Select };
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { ComponentStory, ComponentMeta } from '@storybook/react';
3
- import { Select, SelectProps } from './Select';
4
- declare const _default: ComponentMeta<(<ValueType = any, OptionType extends import("rc-select/lib/Select").DefaultOptionType | import("rc-select/lib/Select").BaseOptionType = import("rc-select/lib/Select").DefaultOptionType>(props: import("antd").SelectProps<ValueType, OptionType> & {
5
- children?: React.ReactNode;
6
- } & {
7
- ref?: React.Ref<import("rc-select").BaseSelectRef> | undefined;
8
- }) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
9
- SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
10
- Option: import("rc-select/lib/Option").OptionFC;
11
- OptGroup: import("rc-select/lib/OptGroup").OptionGroupFC;
12
- _InternalPanelDoNotUseOrYouWillBeFired: any;
13
- } & React.FC<SelectProps>>;
14
- export default _default;
15
- export declare const Default: ComponentStory<(<ValueType = any, OptionType extends import("rc-select/lib/Select").DefaultOptionType | import("rc-select/lib/Select").BaseOptionType = import("rc-select/lib/Select").DefaultOptionType>(props: import("antd").SelectProps<ValueType, OptionType> & {
16
- children?: React.ReactNode;
17
- } & {
18
- ref?: React.Ref<import("rc-select").BaseSelectRef> | undefined;
19
- }) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
20
- SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
21
- Option: import("rc-select/lib/Option").OptionFC;
22
- OptGroup: import("rc-select/lib/OptGroup").OptionGroupFC;
23
- _InternalPanelDoNotUseOrYouWillBeFired: any;
24
- } & React.FC<SelectProps>>;
25
- export declare const BasicUsage: ComponentStory<typeof Select>;
26
- export declare const MultipleSelection: ComponentStory<typeof Select>;
27
- export declare const CustomSelectionRender: ComponentStory<typeof Select>;
28
- export declare const Status: ComponentStory<typeof Select>;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const SelectTest: () => JSX.Element;
3
- export default SelectTest;
@@ -1,2 +0,0 @@
1
- export { Select } from './Select';
2
- export type { SelectProps } from './Select';
@@ -1,4 +0,0 @@
1
- export declare const StyledTag: import("styled-components").StyledComponent<import("antd").TagType, any, {}, never>;
2
- export declare const TagCloseBtn: import("styled-components").StyledComponent<"div", any, {
3
- borderColor?: string | undefined;
4
- }, never>;
@@ -1,8 +0,0 @@
1
- export { Alert } from './Alert';
2
- export { Cascader } from './Cascader';
3
- export { Dropdown } from './Dropdown';
4
- export { Modal } from './Modal';
5
- export { Select } from './Select';
6
- export { CustomComponent } from './CustomComponent';
7
- export { DatePicker } from './DatePicker';
8
- export type { AdvancedPickerProps, TAdvancedPickerOption, TAdvancedRangePickerTimeRange } from './DatePicker';
@@ -1,12 +0,0 @@
1
- import { ThemeConfig } from 'antd';
2
- type TTheme = {
3
- token?: ThemeConfig['token'] & {
4
- [key: string]: any;
5
- };
6
- components?: ThemeConfig['components'];
7
- algorithm?: ThemeConfig['algorithm'];
8
- hashed?: ThemeConfig['hashed'];
9
- inherit?: ThemeConfig['inherit'];
10
- };
11
- export declare const THEME: TTheme;
12
- export {};
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function useDeepCompareEffect(callback: React.EffectCallback, dependencies: React.DependencyList | undefined): void;
@@ -1,2 +0,0 @@
1
- import './locales/i18n';
2
- export * from './components';
@@ -1,23 +0,0 @@
1
- export declare const translationsJson: {
2
- en: {
3
- translation: {
4
- global: {};
5
- button: {};
6
- datePicker: {
7
- startDate: string;
8
- enDate: string;
9
- };
10
- };
11
- };
12
- vi: {
13
- translation: {
14
- global: {};
15
- button: {};
16
- datePicker: {
17
- startDate: string;
18
- enDate: string;
19
- };
20
- };
21
- };
22
- };
23
- export declare const i18n: Promise<import("i18next").TFunction<"translation", undefined, "translation">>;
@@ -1,14 +0,0 @@
1
- import { ConvertedToObjectType, TranslationJsonType } from './types';
2
- /**
3
- * This file is seperate from the './i18n.ts' simply to make the Hot Module Replacement work seamlessly.
4
- * Your components can import this file in 'messages.ts' files which would ruin the HMR if this isn't a separate module
5
- */
6
- export declare const translations: ConvertedToObjectType<TranslationJsonType>;
7
- export declare const convertLanguageJsonToObject: (json: any, objToConvertTo?: ConvertedToObjectType<{
8
- global: {};
9
- button: {};
10
- datePicker: {
11
- startDate: string;
12
- enDate: string;
13
- };
14
- }>, current?: string) => void;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import '@antscorp/icons/main.css';
3
- export declare const App: () => JSX.Element;
@@ -1,5 +0,0 @@
1
- export type THandleErrorPayload = {
2
- path: string;
3
- name: string;
4
- args: Record<string, any>;
5
- };
@@ -1,8 +0,0 @@
1
- /**
2
- * Function to reorder list
3
- * @param {Object[]} list - list of item want to reorder
4
- * @param {number} startIndex - start item index want to replace position: ;
5
- * @param {number} endIndex - end item index want to replace position: ;
6
- * @returns {object[]}
7
- */
8
- export declare const reorder: (list: Array<Record<string, unknown> | string | number>, startIndex: number, endIndex: number) => any[];
@@ -1,2 +0,0 @@
1
- import { THandleErrorPayload } from 'src/types';
2
- export declare const handleError: (error: any, payload: THandleErrorPayload) => void;
File without changes