chop-logic-components 1.0.4 → 1.0.6

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 (72) hide show
  1. package/README.md +5 -2
  2. package/dist/components/containers/form/Form.styled.d.ts +0 -1
  3. package/dist/components/containers/form/__docs__/FormExample.d.ts +1 -0
  4. package/dist/components/containers/form/controller.d.ts +1 -1
  5. package/dist/components/containers/form/types.d.ts +5 -3
  6. package/dist/components/containers/grid/Grid.d.ts +1 -0
  7. package/dist/components/containers/grid/Grid.styled.d.ts +0 -1
  8. package/dist/components/containers/grid/__docs__/GridExample.d.ts +1 -0
  9. package/dist/components/containers/grid/elements/Body.d.ts +1 -0
  10. package/dist/components/containers/grid/elements/DataCell.d.ts +1 -1
  11. package/dist/components/containers/grid/elements/Head.d.ts +1 -0
  12. package/dist/components/containers/grid/elements/Row.d.ts +1 -1
  13. package/dist/components/containers/grid/helpers.d.ts +2 -1
  14. package/dist/components/containers/grid/types.d.ts +6 -8
  15. package/dist/components/containers/tabs/types.d.ts +5 -3
  16. package/dist/components/inputs/_common/error-message/ErrorMessage.styled.d.ts +0 -1
  17. package/dist/components/inputs/_common/input-inner-button/InputInnerButton.styled.d.ts +0 -1
  18. package/dist/components/inputs/_common/label/Label.styled.d.ts +0 -1
  19. package/dist/components/inputs/button/types.d.ts +4 -3
  20. package/dist/components/inputs/checkbox/Checkbox.styled.d.ts +0 -1
  21. package/dist/components/inputs/checkbox/controller.d.ts +2 -1
  22. package/dist/components/inputs/checkbox/types.d.ts +6 -4
  23. package/dist/components/inputs/multi-select/MultiSelect.d.ts +1 -0
  24. package/dist/components/inputs/multi-select/MultiSelect.styled.d.ts +0 -1
  25. package/dist/components/inputs/multi-select/controller.d.ts +1 -1
  26. package/dist/components/inputs/multi-select/elements/Combobox.d.ts +1 -0
  27. package/dist/components/inputs/multi-select/elements/Dropdown.d.ts +1 -0
  28. package/dist/components/inputs/multi-select/elements/Option.d.ts +1 -0
  29. package/dist/components/inputs/multi-select/helpers.d.ts +1 -1
  30. package/dist/components/inputs/multi-select/types.d.ts +3 -4
  31. package/dist/components/inputs/numeric/NumericInput.styled.d.ts +0 -1
  32. package/dist/components/inputs/numeric/controller.d.ts +1 -1
  33. package/dist/components/inputs/numeric/types.d.ts +12 -5
  34. package/dist/components/inputs/select/Select.d.ts +1 -0
  35. package/dist/components/inputs/select/Select.styled.d.ts +0 -1
  36. package/dist/components/inputs/select/controller.d.ts +1 -1
  37. package/dist/components/inputs/select/elements/Combobox.d.ts +2 -1
  38. package/dist/components/inputs/select/elements/Dropdown.d.ts +2 -1
  39. package/dist/components/inputs/select/elements/Option.d.ts +1 -0
  40. package/dist/components/inputs/select/helpers.d.ts +1 -1
  41. package/dist/components/inputs/select/types.d.ts +4 -10
  42. package/dist/components/inputs/text/TextInput.styled.d.ts +0 -1
  43. package/dist/components/inputs/text/controller.d.ts +1 -1
  44. package/dist/components/inputs/text/types.d.ts +13 -5
  45. package/dist/components/modals/alert/Alert.d.ts +1 -0
  46. package/dist/components/modals/alert/Alert.styled.d.ts +0 -1
  47. package/dist/components/modals/alert/helpers.d.ts +1 -0
  48. package/dist/components/modals/alert/types.d.ts +2 -2
  49. package/dist/components/modals/dialog/Dialog.d.ts +1 -0
  50. package/dist/components/modals/dialog/Dialog.styled.d.ts +0 -1
  51. package/dist/components/modals/dialog/types.d.ts +4 -3
  52. package/dist/components/modals/tooltip/Tooltip.d.ts +1 -0
  53. package/dist/components/modals/tooltip/Tooltip.styled.d.ts +0 -1
  54. package/dist/components/modals/tooltip/controller.d.ts +4 -3
  55. package/dist/components/modals/tooltip/types.d.ts +4 -3
  56. package/dist/constants/style-variables.d.ts +6 -6
  57. package/dist/constants/themes.d.ts +4 -0
  58. package/dist/favicon.ico +0 -0
  59. package/dist/hooks/use-container-dimensions/index.d.ts +1 -0
  60. package/dist/hooks/use-modal-focus-trap/index.d.ts +2 -1
  61. package/dist/hooks/use-tooltip-position/index.d.ts +2 -1
  62. package/dist/index.cjs.js +155 -155
  63. package/dist/index.cjs.js.map +1 -1
  64. package/dist/index.es.js +5872 -5897
  65. package/dist/index.es.js.map +1 -1
  66. package/dist/logo.png +0 -0
  67. package/dist/utils/__tests__/get-chop-logic-theme.test.d.ts +1 -0
  68. package/dist/utils/__tests__/handle-dropdown-list-key-press.test.d.ts +1 -0
  69. package/dist/utils/get-chop-logic-theme.d.ts +3 -0
  70. package/dist/utils/handle-dropdown-list-key-press.d.ts +8 -0
  71. package/dist/utils/types.d.ts +49 -0
  72. package/package.json +19 -15
package/README.md CHANGED
@@ -4,9 +4,12 @@ Welcome to **Chop Logic Components**, a comprehensive React components library p
4
4
 
5
5
  ## About the Library
6
6
 
7
- Chop Logic is designed to speed up development by providing reusable, accessible, and highly customizable components. Whether you're building complex forms, creating dynamic layouts, or managing component logic with hooks, Chop Logic has the tools to make it easier.
7
+ Chop Logic is designed to speed up development by providing reusable, accessible, and highly customizable components. Whether you're building complex forms, creating dynamic layouts, or managing component logic with hooks, Chop Logic Components has the tools to make it easier.
8
8
 
9
- All components are well documented using Storybook. Visit the [DEMO page](https://savourygin.github.io/chop-logic-components) and try them out.
9
+ ## Links
10
+
11
+ - [Storybook Playground](https://savourygin.github.io/chop-logic-components)
12
+ - [Npm](https://www.npmjs.com/package/chop-logic-components)
10
13
 
11
14
  ## Getting Started
12
15
 
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledForm: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, {
3
2
  $columns: number;
4
3
  }>> & string;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicFormProps } from '../types';
2
3
 
3
4
  declare const FormExample: React.FC<ChopLogicFormProps>;
@@ -1,4 +1,4 @@
1
- import { FormEvent } from 'react';
1
+ import { default as React, FormEvent } from 'react';
2
2
  import { ChopLogicFormData, ChopLogicFormInputParams } from './types';
3
3
 
4
4
  export declare function useChopLogicFormController({ initialValues, onReset, onSubmit, onClickSubmit, }: {
@@ -1,10 +1,10 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { FormEventHandler, PropsWithChildren } from 'react';
2
+ import { CommonComponentProps } from '../../../../../../../../../src/utils/types';
2
3
 
3
4
  export type ChopLogicFormData = {
4
5
  [key: string]: unknown;
5
6
  };
6
7
  export type ChopLogicFormValidationState = [string, boolean][];
7
- export type ChopLogicFormInput = HTMLInputElement | HTMLSelectElement;
8
8
  export type ChopLogicFormInputParams = {
9
9
  name: string;
10
10
  value: unknown;
@@ -15,9 +15,11 @@ export type ChopLogicFormContextProps = {
15
15
  initialValues?: ChopLogicFormData;
16
16
  resetSignal?: number;
17
17
  };
18
- export type ChopLogicFormProps = PropsWithChildren & React.HTMLAttributes<HTMLFormElement> & {
18
+ export type ChopLogicFormProps = PropsWithChildren & CommonComponentProps & {
19
19
  columns?: number;
20
20
  initialValues?: ChopLogicFormData;
21
21
  hasReset?: boolean;
22
22
  onClickSubmit?: (data: ChopLogicFormData) => void;
23
+ onReset?: FormEventHandler<HTMLFormElement>;
24
+ onSubmit?: FormEventHandler<HTMLFormElement>;
23
25
  };
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicGridProps } from './types';
2
3
 
3
4
  declare const ChopLogicGrid: React.FC<ChopLogicGridProps>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledGrid: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>> & string;
3
2
  export declare const StyledGridHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, never>> & string;
4
3
  export declare const StyledGridBody: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, never>> & string;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicGridProps } from '../types';
2
3
 
3
4
  declare const GridExample: React.FC<ChopLogicGridProps>;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicGridColumn, ChopLogicGridItem, RenderDataItemCallback } from '../types';
2
3
 
3
4
  type ChopLogicGridBodyProps = {
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
3
  declare const GridDataCell: React.FC<{
4
- value: string | JSX.Element;
4
+ value: React.ReactElement | string;
5
5
  }>;
6
6
  export default GridDataCell;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicGridColumn } from '../types';
2
3
 
3
4
  type ChopLogicGridHeadProps = {
@@ -6,7 +6,7 @@ export type GridRowProps = {
6
6
  selectRowById: (id: string) => void;
7
7
  deselectRowById: (id: string) => void;
8
8
  selectable: boolean;
9
- values: (string | JSX.Element)[];
9
+ values: (string | React.ReactElement)[];
10
10
  disabled?: boolean;
11
11
  };
12
12
  declare const GridRow: React.FC<GridRowProps>;
@@ -1,7 +1,8 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicGridColumn, ChopLogicGridItem, RenderDataItemCallback } from './types';
2
3
 
3
4
  export declare function getGridRowValues({ item, columns, renderDataItem, }: {
4
5
  item: ChopLogicGridItem;
5
6
  columns: ChopLogicGridColumn[];
6
7
  renderDataItem?: RenderDataItemCallback;
7
- }): (string | JSX.Element)[];
8
+ }): (string | React.ReactElement)[];
@@ -1,20 +1,18 @@
1
- /// <reference types="react" />
2
- export type ChopLogicGridProps = {
1
+ import { ReactElement } from 'react';
2
+ import { CommonComponentProps } from '../../../../../../../../../src/utils/types';
3
+
4
+ export type ChopLogicGridProps = CommonComponentProps & {
3
5
  columns: ChopLogicGridColumn[];
4
6
  data: ChopLogicGridItem[];
5
7
  caption?: string;
6
- id?: string;
7
8
  selectable?: boolean;
8
- tabIndex?: number;
9
- className?: string;
10
- style?: React.CSSProperties;
11
9
  renderDataItem?: RenderDataItemCallback;
12
10
  onSelect?: (ids: string[]) => void;
13
11
  };
14
12
  export type ChopLogicGridColumn = {
15
13
  field: string;
16
14
  title?: string;
17
- component?: React.ReactElement;
15
+ component?: ReactElement;
18
16
  highlighted?: boolean;
19
17
  className?: string;
20
18
  };
@@ -23,4 +21,4 @@ export type ChopLogicGridItem = {
23
21
  disabled?: boolean;
24
22
  [key: string]: unknown;
25
23
  };
26
- export type RenderDataItemCallback = (item: ChopLogicGridItem, field: string) => JSX.Element;
24
+ export type RenderDataItemCallback = (item: ChopLogicGridItem, field: string) => ReactElement;
@@ -1,11 +1,13 @@
1
- /// <reference types="react" />
2
- export type ChopLogicTabsProps = React.HTMLAttributes<HTMLDivElement> & {
1
+ import { ReactElement } from 'react';
2
+ import { CommonComponentProps } from '../../../../../../../../../src/utils/types';
3
+
4
+ export type ChopLogicTabsProps = CommonComponentProps & {
3
5
  tabs: ChopLogicTabItem[];
4
6
  defaultTabId?: string;
5
7
  mode?: ChopLogicTabsMode;
6
8
  };
7
9
  export type ChopLogicTabItem = {
8
- content: React.ReactElement;
10
+ content: ReactElement;
9
11
  title: string;
10
12
  id: string;
11
13
  disabled?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledErrorMessage: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
3
2
  $visible: boolean;
4
3
  }>> & string;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledInputInnerButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
3
2
  export declare const StyledLabelText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
4
3
  export declare const StyledRequiredSign: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
@@ -1,12 +1,13 @@
1
1
  import { MouseEventHandler } from 'react';
2
+ import { CommonInputProps } from '../../../../../../../../../src/utils/types';
2
3
  import { ChopLogicIconName } from '../../../../../../../../../src/components/misc/icon/Icon';
3
4
 
4
5
  export type ChopLogicButtonView = 'primary' | 'secondary' | 'danger' | 'icon';
5
- export type ChopLogicButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
6
- onClick?: MouseEventHandler<HTMLButtonElement> | (() => void);
6
+ export type ChopLogicButtonProps = Partial<CommonInputProps> & {
7
+ onClick?: MouseEventHandler<HTMLButtonElement>;
7
8
  view?: ChopLogicButtonView;
8
- label?: string;
9
9
  icon?: ChopLogicIconName;
10
10
  text?: string;
11
11
  extended?: boolean;
12
+ type?: 'button' | 'reset' | 'submit';
12
13
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledCheckboxWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
2
  $disabled: boolean;
4
3
  }>> & string;
@@ -1,4 +1,5 @@
1
- /// <reference types="react" />
1
+ import { default as React } from 'react';
2
+
2
3
  export declare function useChopLogicCheckboxController({ name, defaultChecked, onChange, }: {
3
4
  name: string;
4
5
  defaultChecked?: boolean;
@@ -1,7 +1,9 @@
1
- /// <reference types="react" />
2
- export type ChopLogicCheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
3
- name: string;
4
- label: string;
1
+ import { ChangeEventHandler } from 'react';
2
+ import { CommonInputProps } from '../../../../../../../../../src/utils/types';
3
+
4
+ export type ChopLogicCheckboxProps = CommonInputProps & {
5
5
  noLabel?: boolean;
6
6
  iconPosition?: 'left' | 'right';
7
+ onChange?: ChangeEventHandler<HTMLInputElement>;
8
+ defaultChecked?: boolean;
7
9
  };
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicMultiSelectProps } from './types';
2
3
 
3
4
  declare const ChopLogicMultiSelect: React.FC<ChopLogicMultiSelectProps>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledMultiSelectWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
2
  $disabled: boolean;
4
3
  }>> & string;
@@ -1,4 +1,4 @@
1
- import { SelectValue } from '../select/types';
1
+ import { SelectValue } from '../../../../../../../../../src/utils/types.ts';
2
2
  import { MultiSelectValue } from './types';
3
3
 
4
4
  export declare function useChopLogicMultiSelectController({ name, defaultValue, onChange, options, }: {
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { MultiSelectValue } from '../types';
2
3
 
3
4
  type SelectComboboxProps = {
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { MultiSelectDropdownProps } from '../types';
2
3
 
3
4
  declare const MultiSelectDropdown: React.FC<MultiSelectDropdownProps>;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { MultiSelectValue } from '../types';
2
3
 
3
4
  type SelectOptionProps = {
@@ -1,5 +1,5 @@
1
+ import { SelectValue } from '../../../../../../../../../src/utils/types.ts';
1
2
  import { ChopLogicFormData } from '../../../../../../../../../src/components/containers/form/types';
2
- import { SelectValue } from '../select/types';
3
3
  import { MultiSelectValue } from './types';
4
4
 
5
5
  export declare function getMultiSelectInitialValues({ name, options, initialValues, defaultValue, }: {
@@ -1,13 +1,12 @@
1
- import { SelectValue } from '../select/types';
1
+ import { CommonInputProps, SelectValue } from '../../../../../../../../../src/utils/types';
2
2
 
3
3
  export type MultiSelectValue = SelectValue & {
4
4
  selected: boolean;
5
5
  };
6
- export type ChopLogicMultiSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
7
- name: string;
8
- label: string;
6
+ export type ChopLogicMultiSelectProps = CommonInputProps & {
9
7
  options: SelectValue[];
10
8
  onChange?: (values?: SelectValue[]) => void;
9
+ defaultValue?: string | number | readonly string[];
11
10
  placeholder?: string;
12
11
  };
13
12
  export type MultiSelectDropdownProps = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledNumericInputContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
2
  export declare const StyledNumericInputWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
3
  $disabled: boolean;
@@ -1,4 +1,4 @@
1
- import { ChangeEventHandler } from 'react';
1
+ import { default as React, ChangeEventHandler } from 'react';
2
2
  import { NumericValidationFunction } from './types';
3
3
 
4
4
  export declare function useChopLogicNumericInputController({ name, defaultValue, onChange, onSpinButtonClick, min, max, step, required, validator, }: {
@@ -1,11 +1,18 @@
1
- /// <reference types="react" />
1
+ import { ChangeEventHandler, FocusEventHandler } from 'react';
2
+ import { CommonInputProps } from '../../../../../../../../../src/utils/types';
3
+
2
4
  export type NumericValidationFunction = (input?: number) => boolean;
3
- export type ChopLogicNumericInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
4
- name: string;
5
- label: string;
5
+ export type ChopLogicNumericInputProps = CommonInputProps & {
6
6
  errorMessage?: string;
7
7
  validator?: NumericValidationFunction;
8
- onClear?: () => void;
9
8
  hasSpinButtons?: boolean;
9
+ min?: number;
10
+ max?: number;
11
+ step?: number;
12
+ readOnly?: boolean;
13
+ defaultValue?: number;
10
14
  onSpinButtonClick?: (value?: number) => void;
15
+ onChange?: ChangeEventHandler<HTMLInputElement>;
16
+ onBlur?: FocusEventHandler<HTMLInputElement>;
17
+ onFocus?: FocusEventHandler<HTMLInputElement>;
11
18
  };
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicSelectProps } from './types';
2
3
 
3
4
  declare const ChopLogicSelect: React.FC<ChopLogicSelectProps>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledSelectWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
2
  $disabled: boolean;
4
3
  }>> & string;
@@ -1,4 +1,4 @@
1
- import { SelectValue } from './types';
1
+ import { SelectValue } from '../../../../../../../../../src/utils/types.ts';
2
2
 
3
3
  export declare function useChopLogicSelectController({ name, defaultValue, onChange, options, }: {
4
4
  name: string;
@@ -1,4 +1,5 @@
1
- import { SelectValue } from '../types';
1
+ import { default as React } from 'react';
2
+ import { SelectValue } from '../../../../../../../../../../src/utils/types.ts';
2
3
 
3
4
  type SelectComboboxProps = {
4
5
  opened: boolean;
@@ -1,4 +1,5 @@
1
- import { SelectValue } from '../types';
1
+ import { default as React } from 'react';
2
+ import { SelectValue } from '../../../../../../../../../../src/utils/types.ts';
2
3
 
3
4
  type SelectDropdownProps = {
4
5
  options: SelectValue[];
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { SelectOptionProps } from '../types';
2
3
 
3
4
  declare const SelectOption: React.FC<SelectOptionProps>;
@@ -1,5 +1,5 @@
1
+ import { SelectValue } from '../../../../../../../../../src/utils/types.ts';
1
2
  import { ChopLogicFormData } from '../../../../../../../../../src/components/containers/form/types';
2
- import { SelectValue } from './types';
3
3
 
4
4
  export declare function getSelectInitialValue({ name, options, initialValues, defaultValue, }: {
5
5
  name: string;
@@ -1,16 +1,10 @@
1
- /// <reference types="react" />
2
- export type ChopLogicSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
3
- name: string;
4
- label: string;
1
+ import { CommonInputProps, SelectValue } from '../../../../../../../../../src/utils/types';
2
+
3
+ export type ChopLogicSelectProps = CommonInputProps & {
5
4
  options: SelectValue[];
6
5
  onChange?: (value?: SelectValue) => void;
7
6
  placeholder?: string;
8
- };
9
- export type SelectValue = {
10
- id: string;
11
- label: string;
12
- } & {
13
- [key in string]: unknown;
7
+ defaultValue?: string | number | readonly string[];
14
8
  };
15
9
  export type SelectOptionProps = {
16
10
  value: SelectValue;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledTextInputContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
2
  export declare const StyledTextInputWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
3
  $disabled: boolean;
@@ -1,4 +1,4 @@
1
- import { ChangeEventHandler } from 'react';
1
+ import { default as React, ChangeEventHandler } from 'react';
2
2
  import { RegExpWithFlags, TextValidationFunction } from './types';
3
3
 
4
4
  export declare function useChopLogicTextInputController({ name, defaultValue, onChange, onClear, required, validator, }: {
@@ -1,15 +1,23 @@
1
- /// <reference types="react" />
1
+ import { ChangeEventHandler, FocusEventHandler, HTMLInputAutoCompleteAttribute } from 'react';
2
+ import { CommonInputProps } from '../../../../../../../../../src/utils/types';
3
+
2
4
  export type RegExpWithFlags = {
3
5
  regexp: string;
4
6
  flags?: string;
5
7
  };
6
8
  export type TextValidationFunction = (input: string) => boolean;
7
- export type ChopLogicTextInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
8
- name: string;
9
- label: string;
9
+ export type ChopLogicTextInputProps = CommonInputProps & {
10
10
  errorMessage?: string;
11
11
  clearable?: boolean;
12
- onClear?: () => void;
12
+ readOnly?: boolean;
13
13
  type?: 'text' | 'email' | 'password';
14
14
  validator?: RegExpWithFlags | TextValidationFunction;
15
+ maxLength?: number;
16
+ placeholder?: string;
17
+ defaultValue?: string;
18
+ autoComplete?: HTMLInputAutoCompleteAttribute;
19
+ onClear?: () => void;
20
+ onChange?: ChangeEventHandler<HTMLInputElement>;
21
+ onBlur?: FocusEventHandler<HTMLInputElement>;
22
+ onFocus?: FocusEventHandler<HTMLInputElement>;
15
23
  };
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicAlertProps } from './types';
2
3
 
3
4
  declare const ChopLogicAlert: React.FC<ChopLogicAlertProps>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledAlertHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
3
2
  export declare const StyledAlertWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
3
  $isClosing: boolean;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicIconName } from '../../../../../../../../../src/components/misc/icon/Icon';
2
3
  import { ChopLogicAlertMode } from './types';
3
4
 
@@ -1,11 +1,11 @@
1
+ import { CommonComponentProps } from '../../../../../../../../../src/utils/types';
1
2
  import { ChopLogicIconName } from '../../../../../../../../../src/components/misc/icon/Icon';
2
3
 
3
4
  export type ChopLogicAlertMode = 'success' | 'error' | 'warning' | 'info' | 'help';
4
- export type ChopLogicAlertProps = React.HTMLAttributes<HTMLDivElement> & {
5
+ export type ChopLogicAlertProps = CommonComponentProps & {
5
6
  isOpened: boolean;
6
7
  onClose: () => void;
7
8
  message: string;
8
- title?: string;
9
9
  mode?: ChopLogicAlertMode;
10
10
  icon?: ChopLogicIconName;
11
11
  };
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicDialogProps } from './types';
2
3
 
3
4
  declare const ChopLogicDialog: React.FC<ChopLogicDialogProps>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledDialogLayout: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
2
  export declare const StyledDialogBackground: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
3
  $isClosing: boolean;
@@ -1,11 +1,12 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { HTMLAttributes, PropsWithChildren } from 'react';
2
+ import { CommonComponentProps } from '../../../../../../../../../src/utils/types';
2
3
 
3
- export type ChopLogicDialogProps = PropsWithChildren & React.HTMLAttributes<HTMLDivElement> & {
4
+ export type ChopLogicDialogProps = CommonComponentProps & PropsWithChildren & {
4
5
  isOpened: boolean;
5
6
  onClose: () => void;
6
7
  title: string;
7
8
  };
8
- export type DialogLayoutProps = PropsWithChildren & React.HTMLAttributes<HTMLDivElement> & {
9
+ export type DialogLayoutProps = PropsWithChildren & HTMLAttributes<HTMLDivElement> & {
9
10
  title: string;
10
11
  onClose: () => void;
11
12
  isOpened: boolean;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { ChopLogicTooltipProps } from './types';
2
3
 
3
4
  declare const ChopLogicTooltip: React.FC<ChopLogicTooltipProps>;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledTooltip: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,4 +1,5 @@
1
- /// <reference types="react" />
1
+ import { default as React } from 'react';
2
+
2
3
  export declare const useChopLogicTooltipController: ({ id }: {
3
4
  id?: string;
4
5
  }) => {
@@ -10,6 +11,6 @@ export declare const useChopLogicTooltipController: ({ id }: {
10
11
  top: number;
11
12
  left: number;
12
13
  isOpened: boolean;
13
- wrapperRef: import('react').MutableRefObject<null>;
14
- tooltipRef: import('react').RefObject<HTMLDivElement>;
14
+ wrapperRef: React.MutableRefObject<null>;
15
+ tooltipRef: React.RefObject<HTMLDivElement>;
15
16
  };
@@ -1,7 +1,8 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { PropsWithChildren, ReactElement } from 'react';
2
+ import { CommonComponentProps } from '../../../../../../../../../src/utils/types';
2
3
 
3
- export type ChopLogicTooltipProps = PropsWithChildren & React.HTMLAttributes<HTMLElement> & {
4
- tooltipContent: string | React.ReactElement;
4
+ export type ChopLogicTooltipProps = PropsWithChildren & CommonComponentProps & {
5
+ tooltipContent: string | ReactElement;
5
6
  containerTag?: TooltipContainerTag;
6
7
  visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
7
8
  };
@@ -1,10 +1,10 @@
1
1
  export declare const COLORS: Readonly<{
2
2
  primary: "hsl(0, 0%, 13%)";
3
+ secondary: "hsl(215, 69%, 49%)";
4
+ tertiary: "hsl(205, 48%, 56%)";
3
5
  background: "hsl(0, 0%, 100%)";
4
6
  highlight: "hsl(65, 43%, 95%)";
5
7
  shade: "hsl(206, 19%, 93%)";
6
- secondary: "hsl(215, 69%, 49%)";
7
- tertiary: "hsl(205, 48%, 56%)";
8
8
  accent: "hsl(16, 100%, 45%)";
9
9
  transparentBackground: "hsla(0, 0%, 0%, 0.3)";
10
10
  }>;
@@ -27,15 +27,15 @@ export declare const SHADOWS: Readonly<{
27
27
  inset: "-5px 5px 20px 5px rgba(0, 0, 0, 0.1) inset";
28
28
  }>;
29
29
  export declare const BORDERS: Readonly<{
30
- light: "1px solid #5998c5";
31
- heavy: "1px solid #266dd3";
30
+ thin: "1px solid #5998c5";
31
+ thick: "1px solid #266dd3";
32
32
  accent: "1px solid #e53d00";
33
33
  outline: "2px dashed #e53d00";
34
34
  }>;
35
35
  export declare const Z_INDEXES: Readonly<{
36
36
  dropdown: 1000;
37
- modal: 2000;
38
- tooltip: 3000;
37
+ modal: 1000;
38
+ tooltip: 1000;
39
39
  }>;
40
40
  export declare const GRADIENTS: Readonly<{
41
41
  primary: "linear-gradient(0deg, #222222, #266dd3)";
@@ -0,0 +1,4 @@
1
+ import { ChopLogicTheme } from '../../../../../../../src/utils/types.ts';
2
+
3
+ export declare const LIGHT_THEME: ChopLogicTheme;
4
+ export declare const DARK_THEME: ChopLogicTheme;
Binary file