triafly-ui-kit 1.0.3 → 1.0.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 (123) hide show
  1. package/dist/main.d.ts +1181 -26
  2. package/package.json +1 -1
  3. package/dist/components/Ui/Accordeon/Accordeon.d.ts +0 -8
  4. package/dist/components/Ui/Accordeon/Accordeon.stories.d.ts +0 -9
  5. package/dist/components/Ui/Accordeon/index.d.ts +0 -1
  6. package/dist/components/Ui/Alert/Alert.d.ts +0 -9
  7. package/dist/components/Ui/Alert/index.d.ts +0 -1
  8. package/dist/components/Ui/Avatar/Avatar.d.ts +0 -6
  9. package/dist/components/Ui/Avatar/index.d.ts +0 -1
  10. package/dist/components/Ui/Badge/Badge.d.ts +0 -14
  11. package/dist/components/Ui/Badge/index.d.ts +0 -1
  12. package/dist/components/Ui/Button/Button.d.ts +0 -17
  13. package/dist/components/Ui/Button/index.d.ts +0 -1
  14. package/dist/components/Ui/Checkbox/Checkbox.d.ts +0 -10
  15. package/dist/components/Ui/Checkbox/Checkbox.stories.d.ts +0 -15
  16. package/dist/components/Ui/Checkbox/index.d.ts +0 -1
  17. package/dist/components/Ui/CliTextareaInput/CliTextareaInput.d.ts +0 -17
  18. package/dist/components/Ui/CliTextareaInput/index.d.ts +0 -2
  19. package/dist/components/Ui/CliTextareaInput/utils/escapeHtml/escapeHtml.d.ts +0 -1
  20. package/dist/components/Ui/CliTextareaInput/utils/fixJson/fixJson.d.ts +0 -1
  21. package/dist/components/Ui/CliTextareaInput/utils/highlightSyntax/highlightSyntax.d.ts +0 -2
  22. package/dist/components/Ui/CliTextareaInput/utils/highlightSyntax/index.d.ts +0 -1
  23. package/dist/components/Ui/CliTextareaInput/utils/hooks/index.d.ts +0 -7
  24. package/dist/components/Ui/CliTextareaInput/utils/hooks/useFixFormat/index.d.ts +0 -1
  25. package/dist/components/Ui/CliTextareaInput/utils/hooks/useFixFormat/useFixFormat.d.ts +0 -5
  26. package/dist/components/Ui/CliTextareaInput/utils/hooks/useHistoryNavigation/index.d.ts +0 -1
  27. package/dist/components/Ui/CliTextareaInput/utils/hooks/useHistoryNavigation/useHistoryNavigation.d.ts +0 -6
  28. package/dist/components/Ui/CliTextareaInput/utils/hooks/useKeyHandlers/index.d.ts +0 -1
  29. package/dist/components/Ui/CliTextareaInput/utils/hooks/useKeyHandlers/useKeyHandlers.d.ts +0 -9
  30. package/dist/components/Ui/CliTextareaInput/utils/hooks/useLineNumbers/index.d.ts +0 -1
  31. package/dist/components/Ui/CliTextareaInput/utils/hooks/useLineNumbers/useLineNumbers.d.ts +0 -7
  32. package/dist/components/Ui/CliTextareaInput/utils/hooks/useScrollSync/index.d.ts +0 -1
  33. package/dist/components/Ui/CliTextareaInput/utils/hooks/useScrollSync/useScrollSync.d.ts +0 -6
  34. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextActions/index.d.ts +0 -1
  35. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextActions/useTextActions.d.ts +0 -14
  36. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextCoursore/index.d.ts +0 -1
  37. package/dist/components/Ui/CliTextareaInput/utils/hooks/useTextCoursore/useTextCoursore.d.ts +0 -10
  38. package/dist/components/Ui/CliTextareaInput/utils/index.d.ts +0 -3
  39. package/dist/components/Ui/CliTextareaInput/utils/processJson/index.d.ts +0 -1
  40. package/dist/components/Ui/CliTextareaInput/utils/processJson/processJson.d.ts +0 -1
  41. package/dist/components/Ui/CliTextareaInput/utils/processXml/processXml.d.ts +0 -1
  42. package/dist/components/Ui/CliTextareaInput/utils/processYml/processYml.d.ts +0 -1
  43. package/dist/components/Ui/CliTextareaInput/utils/types.d.ts +0 -10
  44. package/dist/components/Ui/CustomLink/CustomLink.d.ts +0 -14
  45. package/dist/components/Ui/CustomLink/index.d.ts +0 -1
  46. package/dist/components/Ui/Demos/DemoElements/DemoElements.d.ts +0 -2
  47. package/dist/components/Ui/Demos/DemoForm/DemoForm.d.ts +0 -9
  48. package/dist/components/Ui/Demos/DemoForm/DemoForm.stories.d.ts +0 -6
  49. package/dist/components/Ui/Demos/DemoLogin/DemoLogin.d.ts +0 -2
  50. package/dist/components/Ui/Demos/DemoLogin/DemoLogin.stories.d.ts +0 -11
  51. package/dist/components/Ui/DropdownInput/DropdownInput.d.ts +0 -18
  52. package/dist/components/Ui/DropdownInput/DropdownInput.stories.d.ts +0 -19
  53. package/dist/components/Ui/DropdownInput/index.d.ts +0 -1
  54. package/dist/components/Ui/DropdownMenu/DropdownMenu.d.ts +0 -15
  55. package/dist/components/Ui/DropdownMenu/DropdownMenu.stories.d.ts +0 -6
  56. package/dist/components/Ui/DropdownMenu/index.d.ts +0 -1
  57. package/dist/components/Ui/FileUpload/FileUpload.d.ts +0 -3
  58. package/dist/components/Ui/FileUpload/fn.d.ts +0 -7
  59. package/dist/components/Ui/FileUpload/index.d.ts +0 -1
  60. package/dist/components/Ui/FileUpload/types.d.ts +0 -32
  61. package/dist/components/Ui/Form/FormContext/FormContext.d.ts +0 -76
  62. package/dist/components/Ui/Form/FormItem/FormItem.d.ts +0 -3
  63. package/dist/components/Ui/Form/FormItem/fn.d.ts +0 -2
  64. package/dist/components/Ui/Form/FormItem/types.d.ts +0 -10
  65. package/dist/components/Ui/Form/FormRoot/FormRoot.d.ts +0 -3
  66. package/dist/components/Ui/Form/FormRoot/index.d.ts +0 -1
  67. package/dist/components/Ui/Form/FormRoot/types.d.ts +0 -12
  68. package/dist/components/Ui/Form/index.d.ts +0 -2
  69. package/dist/components/Ui/Form/useForm/index.d.ts +0 -1
  70. package/dist/components/Ui/Form/useForm/useForm.d.ts +0 -2
  71. package/dist/components/Ui/Form/utils/fn.d.ts +0 -7
  72. package/dist/components/Ui/Form/utils/types.d.ts +0 -12
  73. package/dist/components/Ui/Icons/Icons.d.ts +0 -564
  74. package/dist/components/Ui/Icons/index.d.ts +0 -1
  75. package/dist/components/Ui/Icons/utils/CreateIcon.d.ts +0 -11
  76. package/dist/components/Ui/Loader/Loader.d.ts +0 -7
  77. package/dist/components/Ui/Loader/index.d.ts +0 -1
  78. package/dist/components/Ui/Pagination/Pagination.d.ts +0 -7
  79. package/dist/components/Ui/Pagination/index.d.ts +0 -1
  80. package/dist/components/Ui/Radio/Radio.d.ts +0 -11
  81. package/dist/components/Ui/Radio/Radio.stories.d.ts +0 -8
  82. package/dist/components/Ui/Radio/index.d.ts +0 -1
  83. package/dist/components/Ui/SearchInput/SearchData.d.ts +0 -1
  84. package/dist/components/Ui/SearchInput/SearchInput.d.ts +0 -22
  85. package/dist/components/Ui/Skeleton/Skeleton.d.ts +0 -12
  86. package/dist/components/Ui/Skeleton/index.d.ts +0 -1
  87. package/dist/components/Ui/Switch/Switch.d.ts +0 -10
  88. package/dist/components/Ui/Switch/index.d.ts +0 -1
  89. package/dist/components/Ui/Table/MemoizedRow/MemoizedRow.d.ts +0 -13
  90. package/dist/components/Ui/Table/Table.d.ts +0 -2
  91. package/dist/components/Ui/Table/TableTypes.d.ts +0 -34
  92. package/dist/components/Ui/Table/index.d.ts +0 -1
  93. package/dist/components/Ui/TextInput/TextInput.d.ts +0 -22
  94. package/dist/components/Ui/TextInput/TextInput.stories.d.ts +0 -16
  95. package/dist/components/Ui/TextInput/index.d.ts +0 -1
  96. package/dist/components/Ui/TextareaInput/TextareaInput.d.ts +0 -16
  97. package/dist/components/Ui/TextareaInput/TextareaInput.stories.d.ts +0 -6
  98. package/dist/components/Ui/TextareaInput/index.d.ts +0 -1
  99. package/dist/components/Ui/Tooltip/Tooltip.d.ts +0 -13
  100. package/dist/components/Ui/Tooltip/Tooltip.stories.d.ts +0 -8
  101. package/dist/components/Ui/Tooltip/index.d.ts +0 -1
  102. package/dist/components/Ui/Tree/Tree.stories.d.ts +0 -14
  103. package/dist/components/Ui/Tree/TreeEl/Tree.d.ts +0 -3
  104. package/dist/components/Ui/Tree/TreeEl/index.d.ts +0 -1
  105. package/dist/components/Ui/Tree/TreeEl/tree-types.d.ts +0 -20
  106. package/dist/components/Ui/Tree/TreeItem/TreeItem.d.ts +0 -5
  107. package/dist/components/Ui/Tree/TreeItem/treeItem-types.d.ts +0 -16
  108. package/dist/components/Ui/Tree/TreeList/TreeList.d.ts +0 -4
  109. package/dist/components/Ui/Tree/TreeList/treeList-types.d.ts +0 -17
  110. package/dist/components/Ui/Tree/index.d.ts +0 -1
  111. package/dist/components/Ui/Tree/types-tree.d.ts +0 -7
  112. package/dist/context/ToastContext/ToastContext.d.ts +0 -9
  113. package/dist/context/ToastContext/index.d.ts +0 -1
  114. package/dist/context/TriaflyContext/TriaflyContext.types.d.ts +0 -7
  115. package/dist/context/TriaflyContext/TriaflyProvider.d.ts +0 -7
  116. package/dist/context/TriaflyContext/hooks/index.d.ts +0 -3
  117. package/dist/context/TriaflyContext/hooks/useBreakpointValue/index.d.ts +0 -1
  118. package/dist/context/TriaflyContext/hooks/useBreakpointValue/useBreakpointValue.d.ts +0 -8
  119. package/dist/context/TriaflyContext/hooks/useModal/index.d.ts +0 -1
  120. package/dist/context/TriaflyContext/hooks/useModal/useModal.d.ts +0 -6
  121. package/dist/context/TriaflyContext/hooks/useTheme/index.d.ts +0 -1
  122. package/dist/context/TriaflyContext/hooks/useTheme/useTheme.d.ts +0 -5
  123. package/dist/context/TriaflyContext/index.d.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triafly-ui-kit",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "UI Kit from Triafly",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",
@@ -1,8 +0,0 @@
1
- type AccordeonProps = {
2
- title?: string;
3
- content: React.ReactNode;
4
- openTitle?: React.ReactNode;
5
- closeTitle?: React.ReactNode;
6
- };
7
- export declare const Accordeon: React.FC<AccordeonProps>;
8
- export {};
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { Accordeon } from './Accordeon';
3
- declare const meta: Meta<typeof Accordeon>;
4
- export default meta;
5
- type Story = StoryObj<typeof Accordeon>;
6
- export declare const Default: Story;
7
- export declare const Opened: Story;
8
- export declare const WithHTMLContent: Story;
9
- export declare const WithLongContent: Story;
@@ -1 +0,0 @@
1
- export * from './Accordeon';
@@ -1,9 +0,0 @@
1
- type AlertProps = {
2
- text: string;
3
- icon?: React.ReactElement;
4
- status: "success" | "error" | "warning";
5
- isMultiline?: boolean;
6
- isOpen?: boolean;
7
- };
8
- export declare const Alert: React.FC<AlertProps>;
9
- export {};
@@ -1 +0,0 @@
1
- export * from './Alert';
@@ -1,6 +0,0 @@
1
- interface AvatarProps {
2
- imageUrl?: string;
3
- username: string;
4
- }
5
- export declare const Avatar: React.FC<AvatarProps>;
6
- export {};
@@ -1 +0,0 @@
1
- export * from './Avatar';
@@ -1,14 +0,0 @@
1
- import { default as React } from 'react';
2
- type StatusType = "default" | "success" | "warning" | "error" | "active" | "blocked" | "done" | "loading" | (string & {});
3
- type BadgeProps = {
4
- children: React.ReactNode;
5
- variant?: "outline" | "solid" | "subtle";
6
- status?: StatusType;
7
- iconLeft?: React.ReactNode;
8
- iconRight?: React.ReactNode;
9
- isClickable?: boolean;
10
- onClick?: () => void;
11
- borderRadius?: string | number;
12
- };
13
- export declare const Badge: React.FC<BadgeProps>;
14
- export {};
@@ -1 +0,0 @@
1
- export * from './Badge';
@@ -1,17 +0,0 @@
1
- import { ReactElement, default as React } from 'react';
2
- type ButtonProps = {
3
- style?: React.CSSProperties;
4
- label?: string;
5
- onClick?: () => void;
6
- isDisabled?: boolean;
7
- isLoading?: boolean;
8
- title?: string;
9
- className?: string;
10
- navigation?: string;
11
- to?: string | number;
12
- type: "button" | "submit" | "reset";
13
- icon?: ReactElement;
14
- iconTail?: ReactElement;
15
- };
16
- export declare const Button: React.FC<ButtonProps>;
17
- export {};
@@ -1 +0,0 @@
1
- export * from './Button';
@@ -1,10 +0,0 @@
1
- type CheckboxProps = {
2
- label?: string;
3
- isDisabled?: boolean;
4
- isChecked?: boolean;
5
- isIndeterminate?: boolean;
6
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
7
- name?: string;
8
- };
9
- export declare const Checkbox: React.FC<CheckboxProps>;
10
- export {};
@@ -1,15 +0,0 @@
1
- import { ReactElement } from 'react';
2
- import { Meta, StoryObj } from '@storybook/react';
3
- import { Checkbox } from './Checkbox';
4
- declare const meta: Meta<typeof Checkbox>;
5
- export default meta;
6
- type Story = StoryObj<typeof Checkbox>;
7
- export declare const Default: Story;
8
- export declare const Checked: Story;
9
- export declare const Disabled: Story;
10
- export declare const CheckedDisabled: Story;
11
- export declare const WithoutLabel: Story;
12
- export declare const Indeterminate: Story;
13
- export declare const IndeterminateDisabled: Story;
14
- export declare const States: () => ReactElement;
15
- export declare const InteractivePlayground: () => ReactElement;
@@ -1 +0,0 @@
1
- export * from './Checkbox';
@@ -1,17 +0,0 @@
1
- import { EditorFormat, HistoryItem } from './utils/types';
2
- type CliTextareaInputProps = {
3
- name?: string;
4
- spellCheck?: boolean;
5
- isDisabled?: boolean;
6
- onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>, element?: HistoryItem) => void;
7
- onSubmit?: (text: string) => Promise<void>;
8
- onError?: (error: Error) => void;
9
- history?: HistoryItem[];
10
- value?: string;
11
- resize?: boolean;
12
- format: EditorFormat;
13
- numberColl?: boolean;
14
- showPrompt?: boolean;
15
- };
16
- export declare const CliTextareaInput: import('react').ForwardRefExoticComponent<CliTextareaInputProps & import('react').RefAttributes<HTMLTextAreaElement>>;
17
- export {};
@@ -1,2 +0,0 @@
1
- export * from './CliTextareaInput';
2
- export * from './utils';
@@ -1 +0,0 @@
1
- export declare const escapeHtml: (str: string) => string;
@@ -1 +0,0 @@
1
- export declare const fixJson: (dirtyJson: string) => string;
@@ -1,2 +0,0 @@
1
- export type EditorFormat = "plain" | "json" | "yml" | "xml";
2
- export declare const highlightSyntax: (code: string, lang: EditorFormat) => string;
@@ -1 +0,0 @@
1
- export * from './highlightSyntax';
@@ -1,7 +0,0 @@
1
- export * from './useFixFormat';
2
- export * from './useHistoryNavigation';
3
- export * from './useTextCoursore';
4
- export * from './useLineNumbers';
5
- export * from './useScrollSync';
6
- export * from './useTextActions';
7
- export * from './useKeyHandlers';
@@ -1 +0,0 @@
1
- export * from './useFixFormat';
@@ -1,5 +0,0 @@
1
- type UseFixFormatReturn = {
2
- formatJson: (text: string) => Promise<string>;
3
- };
4
- export declare const useFixFormat: () => UseFixFormatReturn;
5
- export {};
@@ -1 +0,0 @@
1
- export * from './useHistoryNavigation';
@@ -1,6 +0,0 @@
1
- import { EditorFormat, HistoryItem } from '../../types';
2
- type UseHistoryNavigationReturn = {
3
- navigate: (direction: "up" | "down") => void;
4
- };
5
- export declare const useHistoryNavigation: (history: HistoryItem[] | undefined, format: EditorFormat, onChange: (value: string, element: HistoryItem) => void) => UseHistoryNavigationReturn;
6
- export {};
@@ -1 +0,0 @@
1
- export * from './useKeyHandlers';
@@ -1,9 +0,0 @@
1
- import { ChangeEventHandler, KeyboardEvent } from 'react';
2
- export declare const useKeyHandlers: ({ navigate, handleFormat, handleSubmit, onChange, localValue, showPrompt, }: {
3
- navigate: (direction: "up" | "down") => void;
4
- handleFormat: () => void;
5
- handleSubmit: () => void;
6
- localValue?: string;
7
- onChange?: ChangeEventHandler<HTMLTextAreaElement>;
8
- showPrompt: boolean;
9
- }) => ((e: KeyboardEvent<HTMLTextAreaElement>) => void);
@@ -1 +0,0 @@
1
- export * from './useLineNumbers';
@@ -1,7 +0,0 @@
1
- import { RefObject } from 'react';
2
- export declare const LINE_HEIGHT = 24;
3
- type UseLineNumbersReturn = {
4
- visibleLines: number[];
5
- };
6
- export declare const useLineNumbers: (textareaRef: RefObject<HTMLTextAreaElement>, value?: string) => UseLineNumbersReturn;
7
- export {};
@@ -1 +0,0 @@
1
- export * from './useScrollSync';
@@ -1,6 +0,0 @@
1
- import { RefObject } from 'react';
2
- type UseScrollSyncReturn = {
3
- syncScroll: () => void;
4
- };
5
- export declare const useScrollSync: (textareaRef: RefObject<HTMLTextAreaElement>, preRef: RefObject<HTMLPreElement>, lineNumbersRef: RefObject<HTMLDivElement>, value?: string) => UseScrollSyncReturn;
6
- export {};
@@ -1 +0,0 @@
1
- export * from './useTextActions';
@@ -1,14 +0,0 @@
1
- import { ChangeEventHandler } from 'react';
2
- import { EditorFormat } from '../../types';
3
- type UseTextActionsReturn = {
4
- handleFormat: () => Promise<void>;
5
- handleSubmit: () => Promise<void>;
6
- };
7
- export declare const useTextActions: ({ value, format, onChange, onSubmit, onError, }: {
8
- value?: string;
9
- format: EditorFormat;
10
- onChange?: ChangeEventHandler<HTMLTextAreaElement>;
11
- onSubmit?: (text: string) => Promise<void>;
12
- onError?: (error: Error) => void;
13
- }) => UseTextActionsReturn;
14
- export {};
@@ -1 +0,0 @@
1
- export * from './useTextCoursore';
@@ -1,10 +0,0 @@
1
- import { RefObject } from 'react';
2
- type UseTextCoursoreReturn = {
3
- saveSelectionCoursore: ({ start, end }: {
4
- start: number;
5
- end: number;
6
- }) => void;
7
- restoreSelectionCoursore: () => void;
8
- };
9
- export declare const useTextCoursore: (textareaRef: RefObject<HTMLTextAreaElement>) => UseTextCoursoreReturn;
10
- export {};
@@ -1,3 +0,0 @@
1
- export * from './highlightSyntax';
2
- export * from './processJson';
3
- export * from './hooks';
@@ -1 +0,0 @@
1
- export * from './processJson';
@@ -1 +0,0 @@
1
- export declare const processJson: (code: string) => string;
@@ -1 +0,0 @@
1
- export declare const processXml: (code: string) => string;
@@ -1 +0,0 @@
1
- export declare const processYml: (code: string) => string;
@@ -1,10 +0,0 @@
1
- export type EditorFormat = "plain" | "json" | "yml" | "xml";
2
- export type HistoryItem = {
3
- format: EditorFormat;
4
- value: string;
5
- label: string;
6
- id: string;
7
- };
8
- export type HistoryTerminal = {
9
- value: string;
10
- };
@@ -1,14 +0,0 @@
1
- import { default as React } from 'react';
2
- type LinkProps = {
3
- href: string;
4
- children: React.ReactNode;
5
- target?: string;
6
- className?: string;
7
- style?: React.CSSProperties;
8
- onClick?: () => void;
9
- ariaLabel?: string;
10
- title?: string;
11
- icon?: React.ReactNode;
12
- };
13
- export declare const CustomLink: React.FC<LinkProps>;
14
- export {};
@@ -1 +0,0 @@
1
- export * from './CustomLink';
@@ -1,2 +0,0 @@
1
- declare const DemoElements: () => JSX.Element;
2
- export default DemoElements;
@@ -1,9 +0,0 @@
1
- export interface DemoFormProps {
2
- columns: boolean;
3
- isInputDisabled: boolean;
4
- isChecboxDisabled: boolean;
5
- isRadioDisabled: boolean;
6
- isSwitchDisabled: boolean;
7
- }
8
- declare const DemoForm: ({ columns, isInputDisabled, isChecboxDisabled, isRadioDisabled, isSwitchDisabled, }: DemoFormProps) => JSX.Element;
9
- export default DemoForm;
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { DemoFormProps } from './DemoForm';
3
- declare const meta: Meta<DemoFormProps>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Primary: Story;
@@ -1,2 +0,0 @@
1
- declare const DemoLogin: () => JSX.Element;
2
- export default DemoLogin;
@@ -1,11 +0,0 @@
1
- import { StoryObj } from '@storybook/react';
2
- declare const meta: {
3
- title: string;
4
- component: () => JSX.Element;
5
- parameters: {
6
- layout: string;
7
- };
8
- };
9
- export default meta;
10
- type Story = StoryObj<typeof meta>;
11
- export declare const Primary: Story;
@@ -1,18 +0,0 @@
1
- import { default as React } from 'react';
2
- type Option = {
3
- value: string;
4
- label: string;
5
- };
6
- type DropdownInputProps = {
7
- label?: string;
8
- options: Option[];
9
- value?: string | number;
10
- onChange?: (value: string) => void;
11
- name?: string;
12
- placeholder?: string;
13
- errorMessage?: string;
14
- isDisabled?: boolean;
15
- className?: string;
16
- };
17
- export declare const DropdownInput: React.FC<DropdownInputProps>;
18
- export default DropdownInput;
@@ -1,19 +0,0 @@
1
- import { Meta } from '@storybook/react';
2
- interface DropdownInputStoryArgs {
3
- label?: string;
4
- name?: string;
5
- options: {
6
- value: string;
7
- label: string;
8
- }[];
9
- placeholder?: string;
10
- value?: string | number;
11
- errorMessage?: string;
12
- isDisabled?: boolean;
13
- }
14
- declare const meta: Meta<DropdownInputStoryArgs>;
15
- export default meta;
16
- export declare const Default: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, DropdownInputStoryArgs>;
17
- export declare const WithSelectedValue: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, DropdownInputStoryArgs>;
18
- export declare const Disabled: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, DropdownInputStoryArgs>;
19
- export declare const WithErrorMessage: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, DropdownInputStoryArgs>;
@@ -1 +0,0 @@
1
- export * from './DropdownInput';
@@ -1,15 +0,0 @@
1
- import { default as React } from 'react';
2
- export type MenuContent = {
3
- icon?: React.ReactNode;
4
- title: string;
5
- isDanger?: boolean;
6
- onClick?: () => void;
7
- };
8
- type DropdownMenuProps = {
9
- content: MenuContent[];
10
- horizontalPosition?: "left" | "center" | "right";
11
- verticalPosition?: "top" | "bottom";
12
- iconTrigger?: React.ReactNode | string;
13
- };
14
- export declare const DropdownMenu: React.FC<DropdownMenuProps>;
15
- export default DropdownMenu;
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { DropdownMenu } from './DropdownMenu';
3
- declare const meta: Meta<typeof DropdownMenu>;
4
- export default meta;
5
- type Story = StoryObj<typeof DropdownMenu>;
6
- export declare const Default: Story;
@@ -1 +0,0 @@
1
- export * from './DropdownMenu';
@@ -1,3 +0,0 @@
1
- import { default as React } from 'react';
2
- import { FileUploadHandle, FileUploadProps } from './types';
3
- export declare const FileUpload: React.ForwardRefExoticComponent<FileUploadProps & React.RefAttributes<FileUploadHandle>>;
@@ -1,7 +0,0 @@
1
- export declare const SIZE_UNITS: {
2
- B: number;
3
- KB: number;
4
- MB: number;
5
- GB: number;
6
- };
7
- export declare const formatFileSize: (bytes: number) => string;
@@ -1 +0,0 @@
1
- export * from './FileUpload';
@@ -1,32 +0,0 @@
1
- export type SizeUnit = "B" | "KB" | "MB" | "GB";
2
- export type FileUploadProps = {
3
- acceptedFormats?: string[];
4
- maxSize?: number;
5
- multiple?: boolean;
6
- onFilesChange?: (files: File[], parsedData?: unknown[][]) => void;
7
- onError?: (error: string) => void;
8
- onSuccess?: () => void;
9
- parserCsv?: boolean;
10
- sizeUnit?: SizeUnit;
11
- onReset?: () => void;
12
- visibilityFileUpload?: boolean;
13
- onVisibilityChange?: (visible: boolean) => void;
14
- value?: File[];
15
- onChange?: (value: File[]) => void;
16
- isDisabled?: boolean;
17
- hasError?: boolean;
18
- errorMessage?: string;
19
- label?: string;
20
- isNotDeleteElement?: boolean;
21
- };
22
- export type UploadedFile = {
23
- file: File;
24
- parsedData?: unknown[][];
25
- error?: string;
26
- isLoading?: boolean;
27
- };
28
- export type FileUploadHandle = {
29
- reset: () => void;
30
- getFiles: () => File[];
31
- getParsedData: () => unknown[][];
32
- };
@@ -1,76 +0,0 @@
1
- import { Rule } from '../utils/types';
2
- export type FieldPath = string | string[];
3
- export interface FormInstance {
4
- /**
5
- * Сбрасывает все значения формы и ошибки
6
- * (возвращает форму в исходное состояние)
7
- */
8
- resetFields: () => void;
9
- /**
10
- * Устанавливает значения для нескольких полей формы сразу
11
- * @param values - объект с новыми значениями {имяПоля: значение}
12
- */
13
- setFieldsValue: (values: Record<string, unknown>) => void;
14
- /**
15
- * Возвращает текущие значения всех полей формы
16
- * @returns объект со значениями {имяПоля: значение}
17
- */
18
- getFieldsValue: () => Record<string, unknown>;
19
- /**
20
- * Устанавливает значение конкретного поля формы
21
- * @param name - имя поля для обновления
22
- * @param value - новое значение поля
23
- */
24
- setFieldValue: (name: FieldPath, value: unknown) => void;
25
- /**
26
- * Получает текущее значение конкретного поля
27
- * @param name - имя поля
28
- * @returns текущее значение поля
29
- */
30
- getFieldValue: (name: FieldPath) => unknown;
31
- /**
32
- * Отправляет форму (вызывает валидацию перед отправкой)
33
- * @throws выбрасывает ошибку, если валидация не пройдена
34
- */
35
- submit: () => Promise<void>;
36
- /**
37
- * Валидирует указанные поля (или все поля, если не указаны)
38
- * @param names - опциональный массив имен полей для валидации
39
- * @returns Promise с текущими значениями формы при успешной валидации
40
- * @throws выбрасывает ошибку с информацией о невалидных полях
41
- */
42
- validateFields: (names?: string[]) => Promise<Record<string, unknown>>;
43
- /**
44
- * Получает ошибки валидации для указанного поля
45
- * @param name - имя поля
46
- * @returns массив сообщений об ошибках или пустой массив, если ошибок нет
47
- */
48
- getFieldError: (name: FieldPath) => string[];
49
- /**
50
- * Устанавливает ошибки валидации для указанного поля
51
- * @param name - имя поля
52
- * @param errors - массив сообщений об ошибках
53
- */
54
- setFieldError: (name: FieldPath, errors: string[]) => void;
55
- /**
56
- * Получает правила валидации для указанного поля
57
- * @param name - имя поля
58
- * @returns массив правил валидации
59
- */
60
- getFieldRules: (name: FieldPath) => Rule[];
61
- /**
62
- * Устанавливает правила валидации для указанного поля
63
- * @param name - имя поля
64
- * @param rules - массив правил валидации
65
- */
66
- setFieldRules: (name: FieldPath, rules: Rule[]) => void;
67
- /**
68
- * Подписывает на изменения конкретного поля формы
69
- * @param name - имя поля для подписки
70
- * @param listener - функция-обработчик изменений
71
- * @returns функция для отписки от изменений
72
- */
73
- subscribe: (name: FieldPath, listener: () => void) => () => void;
74
- disabled?: boolean;
75
- }
76
- export declare const FormContext: import('react').Context<FormInstance | null>;
@@ -1,3 +0,0 @@
1
- import { default as React } from 'react';
2
- import { FormItemProps } from './types';
3
- export declare const FormItem: React.MemoExoticComponent<({ name, children, rules, label, isDisabled: itemDisabled, style, classNameItem, }: FormItemProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,2 +0,0 @@
1
- export declare const getComponentName: (component: React.ReactElement["type"]) => string;
2
- export declare const getChildType: (child: React.ReactElement) => string;
@@ -1,10 +0,0 @@
1
- import { Rule } from '../utils/types';
2
- export interface FormItemProps {
3
- name: string | string[];
4
- children: React.ReactElement;
5
- rules?: Rule[];
6
- label?: string;
7
- isDisabled?: boolean;
8
- style?: React.CSSProperties;
9
- classNameItem?: string;
10
- }
@@ -1,3 +0,0 @@
1
- import { FormComponent } from './types';
2
- declare const Form: FormComponent;
3
- export { Form };
@@ -1 +0,0 @@
1
- export * from './FormRoot';
@@ -1,12 +0,0 @@
1
- import { FormInstance } from '../FormContext/FormContext';
2
- import { FormItem } from '../FormItem/FormItem';
3
- interface FormProps {
4
- form?: FormInstance;
5
- children: React.ReactNode;
6
- onFinish?: (values: Record<string, unknown>) => void;
7
- disabled?: boolean;
8
- }
9
- export interface FormComponent extends React.FC<FormProps> {
10
- Item: typeof FormItem;
11
- }
12
- export {};
@@ -1,2 +0,0 @@
1
- export * from './FormRoot';
2
- export * from './useForm';
@@ -1 +0,0 @@
1
- export * from './useForm';
@@ -1,2 +0,0 @@
1
- import { FormInstance } from '../FormContext/FormContext';
2
- export declare function useForm(): [FormInstance];
@@ -1,7 +0,0 @@
1
- import { Rule } from './types';
2
- export declare const validateRule: (rule: Rule, value: unknown) => string | null;
3
- export declare const normalizePath: (name: string | string[]) => string[];
4
- export declare const getFieldKey: (name: string | string[]) => string;
5
- export declare const setByPath: (obj: any, path: string | string[], value: unknown) => void;
6
- export declare const getByPath: (obj: any, path: string | string[]) => unknown;
7
- export declare const getNestedValue: (obj: any, path: string[]) => unknown;