chop-logic-components 0.8.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 (55) hide show
  1. package/dist/components/containers/tabs/Tabs.d.ts +16 -0
  2. package/dist/components/containers/tabs/Tabs.styled.d.ts +14 -0
  3. package/dist/components/containers/tabs/__docs__/Tabs.stories.d.ts +8 -0
  4. package/dist/components/containers/tabs/__docs__/TabsExample.d.ts +2 -0
  5. package/dist/components/containers/tabs/__tests__/TabList.test.d.ts +1 -0
  6. package/dist/components/containers/tabs/__tests__/Tabs.test.d.ts +1 -0
  7. package/dist/components/containers/tabs/elements/TabButton.d.ts +14 -0
  8. package/dist/components/containers/tabs/elements/TabContent.d.ts +9 -0
  9. package/dist/components/containers/tabs/elements/TabList.d.ts +13 -0
  10. package/dist/components/index.d.ts +1 -0
  11. package/dist/components/inputs/button/Button.d.ts +10 -2
  12. package/dist/components/inputs/button/Button.styled.d.ts +1 -1
  13. package/dist/components/inputs/button/__docs__/ButtonExample.d.ts +1 -1
  14. package/dist/components/inputs/multi-select/MultiSelect.d.ts +21 -2
  15. package/dist/components/inputs/multi-select/__docs__/MultiSelectExample.d.ts +1 -1
  16. package/dist/components/inputs/multi-select/elements/Combobox.d.ts +1 -1
  17. package/dist/components/inputs/multi-select/elements/Dropdown.d.ts +1 -1
  18. package/dist/components/inputs/multi-select/elements/Option.d.ts +1 -1
  19. package/dist/components/inputs/numeric/NumericInput.d.ts +11 -0
  20. package/dist/components/inputs/numeric/NumericInput.styled.d.ts +7 -0
  21. package/dist/components/inputs/numeric/__docs__/NumericInput.stories.d.ts +7 -0
  22. package/dist/components/inputs/numeric/__docs__/NumericInputExample.d.ts +5 -0
  23. package/dist/components/inputs/numeric/__tests__/NumericInput.test.d.ts +1 -0
  24. package/dist/components/inputs/select/Select.d.ts +13 -2
  25. package/dist/components/inputs/select/__docs__/SelectExample.d.ts +1 -1
  26. package/dist/components/inputs/select/elements/Combobox.d.ts +1 -1
  27. package/dist/components/inputs/select/elements/Dropdown.d.ts +1 -1
  28. package/dist/components/inputs/select/elements/Option.d.ts +1 -1
  29. package/dist/components/inputs/text/TextInput.d.ts +7 -1
  30. package/dist/components/inputs/text/__docs__/TextInputExample.d.ts +1 -1
  31. package/dist/components/misc/icon/Icon.d.ts +22 -1
  32. package/dist/components/modals/alert/Alert.d.ts +10 -1
  33. package/dist/components/modals/alert/__docs__/Alert.stories.d.ts +1 -1
  34. package/dist/components/modals/alert/elements/Header.d.ts +2 -2
  35. package/dist/components/modals/alert/helpers/get-alert-title.d.ts +1 -1
  36. package/dist/components/modals/alert/helpers/render-alert-icon.d.ts +2 -2
  37. package/dist/components/modals/dialog/Dialog.d.ts +6 -1
  38. package/dist/components/modals/dialog/__docs__/DialogExample.d.ts +1 -1
  39. package/dist/components/modals/tooltip/Tooltip.d.ts +7 -1
  40. package/dist/components/modals/tooltip/__docs__/TooltipExample.d.ts +1 -1
  41. package/dist/constants/style-variables.d.ts +1 -0
  42. package/dist/index.cjs.js +299 -218
  43. package/dist/index.cjs.js.map +1 -1
  44. package/dist/index.es.js +5727 -5566
  45. package/dist/index.es.js.map +1 -1
  46. package/package.json +14 -14
  47. package/dist/__mocks__/select-values.d.ts +0 -5
  48. package/dist/components/inputs/button/types.d.ts +0 -11
  49. package/dist/components/inputs/multi-select/types.d.ts +0 -21
  50. package/dist/components/inputs/select/types.d.ts +0 -13
  51. package/dist/components/inputs/text/types.d.ts +0 -8
  52. package/dist/components/misc/icon/types.d.ts +0 -22
  53. package/dist/components/modals/alert/types.d.ts +0 -11
  54. package/dist/components/modals/dialog/types.d.ts +0 -7
  55. package/dist/components/modals/tooltip/types.d.ts +0 -8
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
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';
15
+ declare const ChopLogicTabs: React.FC<ChopLogicTabsProps>;
16
+ export default ChopLogicTabs;
@@ -0,0 +1,14 @@
1
+ import { ChopLogicTabsMode } from './Tabs';
2
+
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
+ $selected: boolean;
5
+ $disabled: boolean;
6
+ $mode: ChopLogicTabsMode;
7
+ }>> & string;
8
+ export declare const StyledTabContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
+ export declare const StyledTabList: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
10
+ $mode: ChopLogicTabsMode;
11
+ }>> & string;
12
+ export declare const StyledTabsContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
13
+ $mode: ChopLogicTabsMode;
14
+ }>> & string;
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { default as ChopLogicTabs } from '../Tabs';
3
+
4
+ declare const meta: Meta<typeof ChopLogicTabs>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof ChopLogicTabs>;
7
+ export declare const Default: Story;
8
+ export declare const VerticalTabs: Story;
@@ -0,0 +1,2 @@
1
+ declare const ExampleComponent: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ExampleComponent;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { ChopLogicTabsMode } from '../Tabs';
3
+
4
+ type ChopLogicTabButtonProps = {
5
+ title: string;
6
+ tabId: string;
7
+ onTabSelect: (id: string) => void;
8
+ tabPanelId: string;
9
+ isSelected: boolean;
10
+ mode: ChopLogicTabsMode;
11
+ isDisabled?: boolean;
12
+ };
13
+ declare const ChopLogicTabButton: React.FC<ChopLogicTabButtonProps>;
14
+ export default ChopLogicTabButton;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { ChopLogicTabItem } from '../Tabs';
3
+
4
+ type ChopLogicTabContentProps = {
5
+ tabs: ChopLogicTabItem[];
6
+ selectedTabId: string;
7
+ };
8
+ declare const ChopLogicTabContent: React.FC<ChopLogicTabContentProps>;
9
+ export default ChopLogicTabContent;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { ChopLogicTabItem, ChopLogicTabsMode } from '../Tabs';
3
+
4
+ type ChopLogicTabListProps = {
5
+ tabs: ChopLogicTabItem[];
6
+ tabIds: string[];
7
+ onTabSelect: (id: string) => void;
8
+ selectedTabId: string;
9
+ tabPanelIds: string[];
10
+ mode: ChopLogicTabsMode;
11
+ };
12
+ declare const ChopLogicTabList: React.FC<ChopLogicTabListProps>;
13
+ export default ChopLogicTabList;
@@ -6,3 +6,4 @@ export { default as ChopLogicTextInput } from './inputs/text/TextInput';
6
6
  export { default as ChopLogicAlert } from './modals/alert/Alert';
7
7
  export { default as ChopLogicDialog } from './modals/dialog/Dialog';
8
8
  export { default as ChopLogicTooltip } from './modals/tooltip/Tooltip';
9
+ export { default as ChopLogicTabs } from './containers/tabs/Tabs';
@@ -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";