chop-logic-components 0.9.0 → 0.10.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 (51) hide show
  1. package/dist/components/containers/tabs/Tabs.d.ts +12 -1
  2. package/dist/components/containers/tabs/Tabs.styled.d.ts +1 -1
  3. package/dist/components/containers/tabs/elements/TabButton.d.ts +1 -1
  4. package/dist/components/containers/tabs/elements/TabContent.d.ts +1 -1
  5. package/dist/components/containers/tabs/elements/TabList.d.ts +1 -1
  6. package/dist/components/inputs/button/Button.d.ts +10 -2
  7. package/dist/components/inputs/button/Button.styled.d.ts +1 -1
  8. package/dist/components/inputs/button/__docs__/ButtonExample.d.ts +1 -1
  9. package/dist/components/inputs/multi-select/MultiSelect.d.ts +21 -2
  10. package/dist/components/inputs/multi-select/__docs__/MultiSelectExample.d.ts +1 -1
  11. package/dist/components/inputs/multi-select/elements/Combobox.d.ts +1 -1
  12. package/dist/components/inputs/multi-select/elements/Dropdown.d.ts +1 -1
  13. package/dist/components/inputs/multi-select/elements/Option.d.ts +1 -1
  14. package/dist/components/inputs/numeric/NumericInput.d.ts +11 -0
  15. package/dist/components/inputs/numeric/NumericInput.styled.d.ts +7 -0
  16. package/dist/components/inputs/numeric/__docs__/NumericInput.stories.d.ts +7 -0
  17. package/dist/components/inputs/numeric/__docs__/NumericInputExample.d.ts +5 -0
  18. package/dist/components/inputs/numeric/__tests__/NumericInput.test.d.ts +1 -0
  19. package/dist/components/inputs/select/Select.d.ts +13 -2
  20. package/dist/components/inputs/select/__docs__/SelectExample.d.ts +1 -1
  21. package/dist/components/inputs/select/elements/Combobox.d.ts +1 -1
  22. package/dist/components/inputs/select/elements/Dropdown.d.ts +1 -1
  23. package/dist/components/inputs/select/elements/Option.d.ts +1 -1
  24. package/dist/components/inputs/text/TextInput.d.ts +7 -1
  25. package/dist/components/inputs/text/__docs__/TextInputExample.d.ts +1 -1
  26. package/dist/components/misc/icon/Icon.d.ts +22 -1
  27. package/dist/components/modals/alert/Alert.d.ts +10 -1
  28. package/dist/components/modals/alert/__docs__/Alert.stories.d.ts +1 -1
  29. package/dist/components/modals/alert/elements/Header.d.ts +2 -2
  30. package/dist/components/modals/alert/helpers/get-alert-title.d.ts +1 -1
  31. package/dist/components/modals/alert/helpers/render-alert-icon.d.ts +2 -2
  32. package/dist/components/modals/dialog/Dialog.d.ts +6 -1
  33. package/dist/components/modals/dialog/__docs__/DialogExample.d.ts +1 -1
  34. package/dist/components/modals/tooltip/Tooltip.d.ts +7 -1
  35. package/dist/components/modals/tooltip/__docs__/TooltipExample.d.ts +1 -1
  36. package/dist/constants/style-variables.d.ts +1 -0
  37. package/dist/index.cjs.js +161 -158
  38. package/dist/index.cjs.js.map +1 -1
  39. package/dist/index.es.js +5537 -5533
  40. package/dist/index.es.js.map +1 -1
  41. package/package.json +5 -5
  42. package/dist/__mocks__/select-values.d.ts +0 -5
  43. package/dist/components/containers/tabs/types.d.ts +0 -13
  44. package/dist/components/inputs/button/types.d.ts +0 -11
  45. package/dist/components/inputs/multi-select/types.d.ts +0 -21
  46. package/dist/components/inputs/select/types.d.ts +0 -13
  47. package/dist/components/inputs/text/types.d.ts +0 -8
  48. package/dist/components/misc/icon/types.d.ts +0 -22
  49. package/dist/components/modals/alert/types.d.ts +0 -11
  50. package/dist/components/modals/dialog/types.d.ts +0 -7
  51. package/dist/components/modals/tooltip/types.d.ts +0 -8
@@ -1,5 +1,16 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicTabsProps } from './types';
3
2
 
3
+ export type ChopLogicTabsProps = React.HTMLAttributes<HTMLDivElement> & {
4
+ tabs: ChopLogicTabItem[];
5
+ defaultTabId?: string;
6
+ mode?: ChopLogicTabsMode;
7
+ };
8
+ export type ChopLogicTabItem = {
9
+ content: React.ReactElement;
10
+ title: string;
11
+ id: string;
12
+ disabled?: boolean;
13
+ };
14
+ export type ChopLogicTabsMode = 'vertical' | 'horizontal';
4
15
  declare const ChopLogicTabs: React.FC<ChopLogicTabsProps>;
5
16
  export default ChopLogicTabs;
@@ -1,4 +1,4 @@
1
- import { ChopLogicTabsMode } from './types';
1
+ import { ChopLogicTabsMode } from './Tabs';
2
2
 
3
3
  export declare const StyledTabButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
4
4
  $selected: boolean;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicTabsMode } from '../types';
2
+ import { ChopLogicTabsMode } from '../Tabs';
3
3
 
4
4
  type ChopLogicTabButtonProps = {
5
5
  title: string;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicTabItem } from '../types';
2
+ import { ChopLogicTabItem } from '../Tabs';
3
3
 
4
4
  type ChopLogicTabContentProps = {
5
5
  tabs: ChopLogicTabItem[];
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicTabItem, ChopLogicTabsMode } from '../types';
2
+ import { ChopLogicTabItem, ChopLogicTabsMode } from '../Tabs';
3
3
 
4
4
  type ChopLogicTabListProps = {
5
5
  tabs: ChopLogicTabItem[];
@@ -1,5 +1,13 @@
1
- import { default as React } from 'react';
2
- import { ChopLogicButtonProps } from './types';
1
+ import { default as React, MouseEventHandler } from 'react';
2
+ import { CLIcon } from '../../../../../../../../../src/components/misc/icon/Icon';
3
3
 
4
+ export type ChopLogicButtonView = 'primary' | 'secondary' | 'danger' | 'icon';
5
+ export type ChopLogicButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
6
+ onClick?: MouseEventHandler<HTMLButtonElement> | (() => void);
7
+ view?: ChopLogicButtonView;
8
+ label?: string;
9
+ icon?: CLIcon;
10
+ text?: string;
11
+ };
4
12
  declare const ChopLogicButton: React.FC<ChopLogicButtonProps>;
5
13
  export default ChopLogicButton;
@@ -1,4 +1,4 @@
1
- import { ChopLogicButtonView } from './types';
1
+ import { ChopLogicButtonView } from './Button';
2
2
 
3
3
  export declare const StyledButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
4
4
  $view: ChopLogicButtonView;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicButtonProps } from '../types';
2
+ import { ChopLogicButtonProps } from '../Button';
3
3
 
4
4
  declare const ExampleButton: React.FC<ChopLogicButtonProps>;
5
5
  export default ExampleButton;
@@ -1,4 +1,23 @@
1
- import { ChopLogicMultiSelectProps } from './types';
2
-
1
+ /// <reference types="react" />
2
+ export type MultiSelectValue = {
3
+ id: string;
4
+ label: string;
5
+ selected: boolean;
6
+ };
7
+ export type ChopLogicMultiSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
8
+ id: string;
9
+ name: string;
10
+ label: string;
11
+ values: MultiSelectValue[];
12
+ onSelectChange?: (values?: MultiSelectValue[]) => void;
13
+ placeholder?: string;
14
+ };
15
+ export type MultiSelectDropdownProps = {
16
+ values: MultiSelectValue[];
17
+ isOpened: boolean;
18
+ dropdownId: string;
19
+ onClose: () => void;
20
+ onSelect: (id: string) => void;
21
+ };
3
22
  declare const ChopLogicMultiSelect: React.FC<ChopLogicMultiSelectProps>;
4
23
  export default ChopLogicMultiSelect;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicMultiSelectProps } from '../types';
2
+ import { ChopLogicMultiSelectProps } from '../MultiSelect';
3
3
 
4
4
  declare const Example: React.FC<ChopLogicMultiSelectProps>;
5
5
  export default Example;
@@ -1,4 +1,4 @@
1
- import { MultiSelectValue } from '../types';
1
+ import { MultiSelectValue } from '../MultiSelect';
2
2
 
3
3
  type SelectComboboxProps = {
4
4
  isOpened: boolean;
@@ -1,4 +1,4 @@
1
- import { MultiSelectDropdownProps } from '../types';
1
+ import { MultiSelectDropdownProps } from '../MultiSelect';
2
2
 
3
3
  declare const MultiSelectDropdown: React.FC<MultiSelectDropdownProps>;
4
4
  export default MultiSelectDropdown;
@@ -1,4 +1,4 @@
1
- import { MultiSelectValue } from '../types';
1
+ import { MultiSelectValue } from '../MultiSelect';
2
2
 
3
3
  type SelectOptionProps = {
4
4
  value: MultiSelectValue;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+
3
+ export type ChopLogicNumericInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
4
+ id: string;
5
+ name: string;
6
+ label: string;
7
+ valid?: boolean;
8
+ errorMessage?: string;
9
+ };
10
+ declare const NumericInput: React.FC<ChopLogicNumericInputProps>;
11
+ export default NumericInput;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ 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
+ 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
+ $disabled: boolean;
5
+ $invalid: boolean;
6
+ }>> & string;
7
+ export declare const StyledNumericInput: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { default as NumericInputExample } from './NumericInputExample';
3
+
4
+ declare const meta: Meta<typeof NumericInputExample>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof NumericInputExample>;
7
+ export declare const Default: Story;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { ChopLogicNumericInputProps } from '../NumericInput';
3
+
4
+ declare const Example: React.FC<ChopLogicNumericInputProps>;
5
+ export default Example;
@@ -1,4 +1,15 @@
1
- import { ChopLogicSelectProps } from './types';
2
-
1
+ /// <reference types="react" />
2
+ export type ChopLogicSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
3
+ id: string;
4
+ name: string;
5
+ label: string;
6
+ values: SelectValue[];
7
+ onSelectChange?: (value?: SelectValue) => void;
8
+ placeholder?: string;
9
+ };
10
+ export type SelectValue = {
11
+ id: string;
12
+ label: string;
13
+ };
3
14
  declare const ChopLogicSelect: React.FC<ChopLogicSelectProps>;
4
15
  export default ChopLogicSelect;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicSelectProps } from '../types';
2
+ import { ChopLogicSelectProps } from '../Select';
3
3
 
4
4
  declare const Example: React.FC<ChopLogicSelectProps>;
5
5
  export default Example;
@@ -1,4 +1,4 @@
1
- import { SelectValue } from '../types';
1
+ import { SelectValue } from '../Select';
2
2
 
3
3
  type SelectComboboxProps = {
4
4
  isOpened: boolean;
@@ -1,4 +1,4 @@
1
- import { SelectValue } from '../types';
1
+ import { SelectValue } from '../Select';
2
2
 
3
3
  type SelectDropdownProps = {
4
4
  values: SelectValue[];
@@ -1,4 +1,4 @@
1
- import { SelectValue } from '../types';
1
+ import { SelectValue } from '../Select';
2
2
 
3
3
  type SelectOptionProps = {
4
4
  value: SelectValue;
@@ -1,5 +1,11 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicTextInputProps } from './types';
3
2
 
3
+ export type ChopLogicTextInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
4
+ id: string;
5
+ name: string;
6
+ label: string;
7
+ valid?: boolean;
8
+ errorMessage?: string;
9
+ };
4
10
  declare const TextInput: React.FC<ChopLogicTextInputProps>;
5
11
  export default TextInput;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicTextInputProps } from '../types';
2
+ import { ChopLogicTextInputProps } from '../TextInput';
3
3
 
4
4
  declare const Example: React.FC<ChopLogicTextInputProps>;
5
5
  export default Example;
@@ -1,6 +1,27 @@
1
1
  import { default as React } from 'react';
2
- import { CLIcon } from './types';
3
2
 
3
+ export declare enum CLIcon {
4
+ ArrowDown = "arrow-down",
5
+ ArrowUp = "arrow-up",
6
+ Back = "back",
7
+ Cancel = "cancel",
8
+ CheckboxChecked = "checkbox-checked",
9
+ CheckboxUnchecked = "checkbox-unchecked",
10
+ CheckMark = "check-mark",
11
+ Copy = "copy",
12
+ Cut = "cut",
13
+ Delete = "delete",
14
+ Download = "download",
15
+ Error = "error",
16
+ Forward = "forward",
17
+ Help = "help",
18
+ Info = "info",
19
+ Paste = "paste",
20
+ Question = "question",
21
+ Save = "save",
22
+ Upload = "upload",
23
+ Warning = "warning"
24
+ }
4
25
  declare const ChopLogicIcon: React.FC<{
5
26
  name?: CLIcon;
6
27
  }>;
@@ -1,4 +1,13 @@
1
- import { ChopLogicAlertProps } from './types';
1
+ import { CLIcon } from '../../../../../../../../../src/components/misc/icon/Icon';
2
2
 
3
+ export type ChopLogicAlertMode = 'success' | 'error' | 'warning' | 'info' | 'help';
4
+ export type ChopLogicAlertProps = React.HTMLAttributes<HTMLDivElement> & {
5
+ isOpened: boolean;
6
+ onClose: () => void;
7
+ message: string;
8
+ title?: string;
9
+ mode?: ChopLogicAlertMode;
10
+ icon?: CLIcon;
11
+ };
3
12
  declare const ChopLogicAlert: React.FC<ChopLogicAlertProps>;
4
13
  export default ChopLogicAlert;
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { Meta, StoryObj } from '@storybook/react';
3
- import { ChopLogicAlertProps } from '../types';
3
+ import { ChopLogicAlertProps } from '../Alert';
4
4
 
5
5
  declare const ExampleComponent: React.FC<ChopLogicAlertProps>;
6
6
  declare const meta: Meta<typeof ExampleComponent>;
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { CLIcon } from '../../../../../../../../../../src/components/misc/icon/types';
3
- import { ChopLogicAlertMode } from '../types';
2
+ import { CLIcon } from '../../../../../../../../../../src/components/misc/icon/Icon';
3
+ import { ChopLogicAlertMode } from '../Alert';
4
4
 
5
5
  type ChopLogicAlertHeaderProps = {
6
6
  onClose: () => void;
@@ -1,3 +1,3 @@
1
- import { ChopLogicAlertMode } from '../types';
1
+ import { ChopLogicAlertMode } from '../Alert';
2
2
 
3
3
  export declare function getAlertTitle(mode: ChopLogicAlertMode, title?: string): string;
@@ -1,4 +1,4 @@
1
- import { CLIcon } from '../../../../../../../../../../src/components/misc/icon/types';
2
- import { ChopLogicAlertMode } from '../types';
1
+ import { CLIcon } from '../../../../../../../../../../src/components/misc/icon/Icon';
2
+ import { ChopLogicAlertMode } from '../Alert';
3
3
 
4
4
  export declare function renderAlertIcon(mode: ChopLogicAlertMode, icon?: CLIcon): React.ReactElement | null;
@@ -1,4 +1,9 @@
1
- import { ChopLogicModalProps } from './types';
1
+ import { PropsWithChildren } from 'react';
2
2
 
3
+ export type ChopLogicModalProps = PropsWithChildren & React.HTMLAttributes<HTMLDivElement> & {
4
+ isOpened: boolean;
5
+ onClose: () => void;
6
+ title: string;
7
+ };
3
8
  declare const ChopLogicDialog: React.FC<ChopLogicModalProps>;
4
9
  export default ChopLogicDialog;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicModalProps } from '../types';
2
+ import { ChopLogicModalProps } from '../Dialog';
3
3
 
4
4
  declare const Example: React.FC<ChopLogicModalProps>;
5
5
  export default Example;
@@ -1,4 +1,10 @@
1
- import { ChopLogicTooltipProps } from './types';
1
+ import { PropsWithChildren } from 'react';
2
2
 
3
+ export type ChopLogicTooltipProps = PropsWithChildren & React.HTMLAttributes<HTMLElement> & {
4
+ tooltipContent: string | React.ReactElement;
5
+ id: string;
6
+ containerTag?: 'span' | 'div' | 'p' | 'strong' | 'em';
7
+ visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
8
+ };
3
9
  declare const ChopLogicTooltip: React.FC<ChopLogicTooltipProps>;
4
10
  export default ChopLogicTooltip;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ChopLogicTooltipProps } from '../types';
2
+ import { ChopLogicTooltipProps } from '../Tooltip';
3
3
 
4
4
  declare const TooltipExample: React.FC<ChopLogicTooltipProps>;
5
5
  export default TooltipExample;
@@ -18,6 +18,7 @@ export declare const UNITS: Readonly<{
18
18
  bigGap: "1rem";
19
19
  minElementSize: "2.75rem";
20
20
  blockBorderRadius: "0.375rem";
21
+ inputWrapperHeight: "3rem";
21
22
  }>;
22
23
  export declare const SHADOWS: Readonly<{
23
24
  box: "rgba(0, 0, 0, 0.15) 2.4px 2.4px 3.2px";