chop-logic-components 1.1.2 → 1.1.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 (232) hide show
  1. package/dist/BackIcon-BYIgN9YC.js +8 -0
  2. package/dist/BackIcon-BYIgN9YC.js.map +1 -0
  3. package/dist/BackIcon-BdQui5Aa.cjs +2 -0
  4. package/dist/BackIcon-BdQui5Aa.cjs.map +1 -0
  5. package/dist/CancelIcon-BhlLqC6F.js +8 -0
  6. package/dist/CancelIcon-BhlLqC6F.js.map +1 -0
  7. package/dist/CancelIcon-Bm_iptAX.cjs +2 -0
  8. package/dist/CancelIcon-Bm_iptAX.cjs.map +1 -0
  9. package/dist/ChevronDownIcon-CUo77OHJ.js +14 -0
  10. package/dist/ChevronDownIcon-CUo77OHJ.js.map +1 -0
  11. package/dist/ChevronDownIcon-Dcu6wZF6.cjs +2 -0
  12. package/dist/ChevronDownIcon-Dcu6wZF6.cjs.map +1 -0
  13. package/dist/ChevronLeftIcon-BjZ-P9HN.js +14 -0
  14. package/dist/ChevronLeftIcon-BjZ-P9HN.js.map +1 -0
  15. package/dist/ChevronLeftIcon-lu-2-_8H.cjs +2 -0
  16. package/dist/ChevronLeftIcon-lu-2-_8H.cjs.map +1 -0
  17. package/dist/ChevronRightIcon-Bs6vV-bO.cjs +2 -0
  18. package/dist/ChevronRightIcon-Bs6vV-bO.cjs.map +1 -0
  19. package/dist/ChevronRightIcon-LzUbMOE4.js +14 -0
  20. package/dist/ChevronRightIcon-LzUbMOE4.js.map +1 -0
  21. package/dist/ChevronUpIcon-ByBUWN2S.js +8 -0
  22. package/dist/ChevronUpIcon-ByBUWN2S.js.map +1 -0
  23. package/dist/ChevronUpIcon-Dm5wukir.cjs +2 -0
  24. package/dist/ChevronUpIcon-Dm5wukir.cjs.map +1 -0
  25. package/dist/ClearIcon-D4DEbX1Q.js +11 -0
  26. package/dist/ClearIcon-D4DEbX1Q.js.map +1 -0
  27. package/dist/ClearIcon-DivVdYES.cjs +2 -0
  28. package/dist/ClearIcon-DivVdYES.cjs.map +1 -0
  29. package/dist/CopyIcon-D22c5OS-.cjs +2 -0
  30. package/dist/CopyIcon-D22c5OS-.cjs.map +1 -0
  31. package/dist/CopyIcon-NUkhTWCH.js +25 -0
  32. package/dist/CopyIcon-NUkhTWCH.js.map +1 -0
  33. package/dist/CutIcon-CglXY55h.js +27 -0
  34. package/dist/CutIcon-CglXY55h.js.map +1 -0
  35. package/dist/CutIcon-CrYDHo1s.cjs +2 -0
  36. package/dist/CutIcon-CrYDHo1s.cjs.map +1 -0
  37. package/dist/DeleteIcon-CPMkkc0h.cjs +2 -0
  38. package/dist/DeleteIcon-CPMkkc0h.cjs.map +1 -0
  39. package/dist/DeleteIcon-DJt-Jw_m.js +8 -0
  40. package/dist/DeleteIcon-DJt-Jw_m.js.map +1 -0
  41. package/dist/DownloadIcon-BcmjSwu3.js +8 -0
  42. package/dist/DownloadIcon-BcmjSwu3.js.map +1 -0
  43. package/dist/DownloadIcon-DHiPBlSa.cjs +2 -0
  44. package/dist/DownloadIcon-DHiPBlSa.cjs.map +1 -0
  45. package/dist/ForwardIcon-3blZq6dd.js +8 -0
  46. package/dist/ForwardIcon-3blZq6dd.js.map +1 -0
  47. package/dist/ForwardIcon-gOy8g4uc.cjs +2 -0
  48. package/dist/ForwardIcon-gOy8g4uc.cjs.map +1 -0
  49. package/dist/HideIcon-DIGpNz28.cjs +2 -0
  50. package/dist/HideIcon-DIGpNz28.cjs.map +1 -0
  51. package/dist/HideIcon-kx8wAtKR.js +8 -0
  52. package/dist/HideIcon-kx8wAtKR.js.map +1 -0
  53. package/dist/PasteIcon-BKnWh5CH.cjs +2 -0
  54. package/dist/PasteIcon-BKnWh5CH.cjs.map +1 -0
  55. package/dist/PasteIcon-BXKC5uP2.js +8 -0
  56. package/dist/PasteIcon-BXKC5uP2.js.map +1 -0
  57. package/dist/QuestionIcon-i6E3ATxf.js +22 -0
  58. package/dist/QuestionIcon-i6E3ATxf.js.map +1 -0
  59. package/dist/QuestionIcon-sh6GuYQj.cjs +2 -0
  60. package/dist/QuestionIcon-sh6GuYQj.cjs.map +1 -0
  61. package/dist/RemoveIcon-BMtwZqc4.js +30 -0
  62. package/dist/RemoveIcon-BMtwZqc4.js.map +1 -0
  63. package/dist/RemoveIcon-D-jlwDbA.cjs +2 -0
  64. package/dist/RemoveIcon-D-jlwDbA.cjs.map +1 -0
  65. package/dist/SaveIcon-Bt1dCazw.cjs +2 -0
  66. package/dist/SaveIcon-Bt1dCazw.cjs.map +1 -0
  67. package/dist/SaveIcon-CPSuZbnK.js +8 -0
  68. package/dist/SaveIcon-CPSuZbnK.js.map +1 -0
  69. package/dist/ShowIcon-D3HWz-2N.cjs +2 -0
  70. package/dist/ShowIcon-D3HWz-2N.cjs.map +1 -0
  71. package/dist/ShowIcon-Dl0adz4t.js +11 -0
  72. package/dist/ShowIcon-Dl0adz4t.js.map +1 -0
  73. package/dist/UploadIcon-D9WOn42G.js +11 -0
  74. package/dist/UploadIcon-D9WOn42G.js.map +1 -0
  75. package/dist/UploadIcon-s_UIC0fh.cjs +2 -0
  76. package/dist/UploadIcon-s_UIC0fh.cjs.map +1 -0
  77. package/dist/components/containers/form/Form.d.ts +1 -1
  78. package/dist/components/containers/form/Form.styled.d.ts +1 -1
  79. package/dist/components/containers/form/__docs__/{FormExample.d.ts → Form.example.d.ts} +1 -1
  80. package/dist/components/containers/form/__docs__/Form.stories.d.ts +1 -1
  81. package/dist/components/containers/form/controller.d.ts +1 -1
  82. package/dist/components/containers/form/helpers.d.ts +1 -1
  83. package/dist/components/containers/grid/Grid.d.ts +1 -1
  84. package/dist/components/containers/grid/Grid.styled.d.ts +1 -1
  85. package/dist/components/containers/grid/__docs__/{GridExample.d.ts → Grid.example.d.ts} +1 -1
  86. package/dist/components/containers/grid/__docs__/Grid.stories.d.ts +1 -1
  87. package/dist/components/containers/grid/controller.d.ts +1 -1
  88. package/dist/components/containers/grid/elements/Body.d.ts +1 -1
  89. package/dist/components/containers/grid/elements/Checkbox.d.ts +1 -1
  90. package/dist/components/containers/grid/elements/ColumnGroup.d.ts +1 -1
  91. package/dist/components/containers/grid/elements/DataCell.d.ts +1 -1
  92. package/dist/components/containers/grid/elements/Head.d.ts +1 -1
  93. package/dist/components/containers/grid/elements/HeaderCell.d.ts +1 -1
  94. package/dist/components/containers/grid/elements/Row.d.ts +1 -1
  95. package/dist/components/containers/grid/elements/SelectAllRowsCell.d.ts +1 -1
  96. package/dist/components/containers/grid/elements/SelectRowCell.d.ts +1 -1
  97. package/dist/components/containers/grid/helpers.d.ts +1 -1
  98. package/dist/components/containers/portal/__docs__/Portal.example.d.ts +4 -0
  99. package/dist/components/containers/portal/__docs__/Portal.stories.d.ts +7 -0
  100. package/dist/components/containers/tabs/Tabs.d.ts +1 -1
  101. package/dist/components/containers/tabs/Tabs.styled.d.ts +2 -1
  102. package/dist/components/containers/tabs/__docs__/{TabsExample.d.ts → Tabs.example.d.ts} +1 -1
  103. package/dist/components/containers/tabs/elements/TabButton.d.ts +2 -1
  104. package/dist/components/containers/tabs/elements/TabContent.d.ts +1 -1
  105. package/dist/components/containers/tabs/elements/TabList.d.ts +11 -1
  106. package/dist/components/inputs/button/Button.d.ts +2 -12
  107. package/dist/components/inputs/button/Button.styled.d.ts +1 -1
  108. package/dist/components/inputs/button/__docs__/{ButtonExample.d.ts → Button.example.d.ts} +1 -1
  109. package/dist/components/inputs/button/__docs__/Button.stories.d.ts +1 -1
  110. package/dist/components/inputs/checkbox/Checkbox.d.ts +1 -1
  111. package/dist/components/inputs/checkbox/Checkbox.styled.d.ts +1 -1
  112. package/dist/components/inputs/checkbox/__docs__/{CheckboxExample.d.ts → Checkbox.example.d.ts} +1 -1
  113. package/dist/components/inputs/checkbox/__docs__/Checkbox.stories.d.ts +1 -1
  114. package/dist/components/inputs/checkbox/helpers.d.ts +1 -1
  115. package/dist/components/inputs/multi-select/MultiSelect.d.ts +1 -1
  116. package/dist/components/inputs/multi-select/__docs__/{MultiSelectExample.d.ts → MultiSelect.example.d.ts} +1 -1
  117. package/dist/components/inputs/multi-select/__docs__/MultiSelect.stories.d.ts +1 -1
  118. package/dist/components/inputs/multi-select/controller.d.ts +4 -4
  119. package/dist/components/inputs/multi-select/elements/Combobox.d.ts +13 -1
  120. package/dist/components/inputs/multi-select/elements/Dropdown.d.ts +9 -1
  121. package/dist/components/inputs/multi-select/elements/Option.d.ts +6 -1
  122. package/dist/components/inputs/multi-select/helpers.d.ts +5 -5
  123. package/dist/components/inputs/numeric/NumericInput.d.ts +1 -1
  124. package/dist/components/inputs/numeric/NumericInput.styled.d.ts +1 -1
  125. package/dist/components/inputs/numeric/__docs__/{NumericInputExample.d.ts → NumericInput.example.d.ts} +1 -1
  126. package/dist/components/inputs/numeric/__docs__/NumericInput.stories.d.ts +1 -1
  127. package/dist/components/inputs/numeric/controller.d.ts +2 -2
  128. package/dist/components/inputs/numeric/helpers.d.ts +2 -2
  129. package/dist/components/inputs/select/Select.d.ts +1 -1
  130. package/dist/components/inputs/select/__docs__/{SelectExample.d.ts → Select.example.d.ts} +1 -1
  131. package/dist/components/inputs/select/__docs__/Select.stories.d.ts +1 -1
  132. package/dist/components/inputs/select/controller.d.ts +4 -4
  133. package/dist/components/inputs/select/elements/Combobox.d.ts +13 -1
  134. package/dist/components/inputs/select/elements/Dropdown.d.ts +12 -1
  135. package/dist/components/inputs/select/elements/Option.d.ts +8 -1
  136. package/dist/components/inputs/select/helpers.d.ts +3 -3
  137. package/dist/components/inputs/text/TextInput.d.ts +1 -1
  138. package/dist/components/inputs/text/TextInput.styled.d.ts +1 -1
  139. package/dist/components/inputs/text/__docs__/{TextInputExample.d.ts → TextInput.example.d.ts} +1 -1
  140. package/dist/components/inputs/text/__docs__/TextInput.stories.d.ts +1 -1
  141. package/dist/components/inputs/text/controller.d.ts +2 -2
  142. package/dist/components/inputs/text/helpers.d.ts +2 -2
  143. package/dist/components/modals/alert/Alert.d.ts +1 -1
  144. package/dist/components/modals/alert/Alert.styled.d.ts +1 -1
  145. package/dist/components/modals/alert/__docs__/{AlertExample.d.ts → Alert.example.d.ts} +1 -1
  146. package/dist/components/modals/alert/__docs__/Alert.stories.d.ts +1 -1
  147. package/dist/components/modals/alert/elements/Header.d.ts +9 -1
  148. package/dist/components/modals/dialog/Dialog.d.ts +1 -1
  149. package/dist/components/modals/dialog/Dialog.styled.d.ts +1 -1
  150. package/dist/components/modals/dialog/__docs__/{DialogExample.d.ts → Dialog.example.d.ts} +1 -1
  151. package/dist/components/modals/dialog/__docs__/Dialog.stories.d.ts +1 -1
  152. package/dist/components/modals/dialog/elements/Header.d.ts +1 -1
  153. package/dist/components/modals/dialog/elements/Layout.d.ts +8 -2
  154. package/dist/components/modals/tooltip/Tooltip.d.ts +1 -1
  155. package/dist/components/modals/tooltip/Tooltip.styled.d.ts +1 -1
  156. package/dist/components/modals/tooltip/__docs__/{TooltipExample.d.ts → Tooltip.example.d.ts} +1 -1
  157. package/dist/components/modals/tooltip/__docs__/Tooltip.stories.d.ts +1 -1
  158. package/dist/contexts/chop-logic-form-context.d.ts +1 -1
  159. package/dist/contexts/chop-logic-theme-context.d.ts +1 -8
  160. package/dist/css/themes.d.ts +1 -1
  161. package/dist/elements/error-message/ErrorMessage.d.ts +1 -1
  162. package/dist/elements/error-message/ErrorMessage.styled.d.ts +1 -1
  163. package/dist/elements/icon/Icon.d.ts +2 -4
  164. package/dist/elements/icon/__docs__/Icon.example.d.ts +5 -0
  165. package/dist/elements/icon/__docs__/Icon.stories.d.ts +7 -0
  166. package/dist/elements/input-inner-button/InputInnerButton.d.ts +1 -1
  167. package/dist/elements/input-inner-button/InputInnerButton.styled.d.ts +1 -1
  168. package/dist/elements/label/Label.d.ts +1 -1
  169. package/dist/elements/label/Label.styled.d.ts +1 -1
  170. package/dist/elements/styled/ExampleDivContainer.styled.d.ts +5 -0
  171. package/dist/elements/styled/Select.styled.d.ts +1 -1
  172. package/dist/enums/chop-logic-tabs-mode.d.ts +4 -0
  173. package/dist/enums/chop-logic-theme-mode.d.ts +4 -0
  174. package/dist/enums/chop-logic-tooltip-container.d.ts +7 -0
  175. package/dist/enums/index.d.ts +3 -0
  176. package/dist/hooks/use-click-outside/__docs__/useClickOutside.example.d.ts +2 -0
  177. package/dist/hooks/use-click-outside/__docs__/useClickOutside.stories.d.ts +3 -4
  178. package/dist/hooks/use-container-dimensions/__docs__/useContainerDimensions.example.d.ts +2 -0
  179. package/dist/hooks/use-container-dimensions/__docs__/useContainerDimensions.stories.d.ts +3 -4
  180. package/dist/hooks/use-key-press/__docs__/useKeyPress.example.d.ts +2 -0
  181. package/dist/hooks/use-key-press/__docs__/useKeyPress.stories.d.ts +3 -4
  182. package/dist/hooks/use-modal-focus-trap/__docs__/useModalFocusTrap.example.d.ts +2 -0
  183. package/dist/hooks/use-modal-focus-trap/__docs__/useModalFocusTrap.stories.d.ts +3 -4
  184. package/dist/hooks/use-mount/__docs__/useMount.example.d.ts +2 -0
  185. package/dist/hooks/use-mount/__docs__/useMount.stories.d.ts +3 -4
  186. package/dist/hooks/use-tooltip-position/__docs__/useTooltipPosition.example.d.ts +2 -0
  187. package/dist/hooks/use-tooltip-position/__docs__/useTooltipPosition.stories.d.ts +3 -4
  188. package/dist/hooks/use-window-dimensions/__docs__/useWindowDimensions.example.d.ts +2 -0
  189. package/dist/hooks/use-window-dimensions/__docs__/useWindowDimensions.stories.d.ts +3 -4
  190. package/dist/index-CKJ3Lh5y.cjs +903 -0
  191. package/dist/index-CKJ3Lh5y.cjs.map +1 -0
  192. package/dist/index-V1IMdfTA.js +4145 -0
  193. package/dist/index-V1IMdfTA.js.map +1 -0
  194. package/dist/index.cjs.js +1 -902
  195. package/dist/index.cjs.js.map +1 -1
  196. package/dist/index.d.ts +1 -1
  197. package/dist/index.es.js +36 -4286
  198. package/dist/index.es.js.map +1 -1
  199. package/dist/{types → models}/chop-logic-theme.d.ts +8 -0
  200. package/dist/models/common.d.ts +30 -0
  201. package/dist/models/components/alert.d.ts +10 -0
  202. package/dist/{types → models}/components/button.d.ts +3 -3
  203. package/dist/{types → models}/components/checkbox.d.ts +3 -3
  204. package/dist/models/components/dialog.d.ts +8 -0
  205. package/dist/{types → models}/components/form.d.ts +7 -7
  206. package/dist/{types → models}/components/grid.d.ts +3 -3
  207. package/dist/models/components/icon.d.ts +6 -0
  208. package/dist/models/components/multi-select.d.ts +8 -0
  209. package/dist/{types → models}/components/numeric.d.ts +4 -5
  210. package/dist/models/components/select.d.ts +8 -0
  211. package/dist/models/components/tabs.d.ts +15 -0
  212. package/dist/{types → models}/components/text.d.ts +4 -9
  213. package/dist/models/components/tooltip.d.ts +9 -0
  214. package/dist/models/index.d.ts +15 -0
  215. package/dist/utils/get-chop-logic-theme.d.ts +1 -1
  216. package/dist/utils/handle-dropdown-list-key-press.d.ts +2 -2
  217. package/package.json +1 -1
  218. package/dist/hooks/use-click-outside/__docs__/Example.d.ts +0 -2
  219. package/dist/hooks/use-container-dimensions/__docs__/Example.d.ts +0 -2
  220. package/dist/hooks/use-key-press/__docs__/Example.d.ts +0 -2
  221. package/dist/hooks/use-modal-focus-trap/__docs__/Example.d.ts +0 -2
  222. package/dist/hooks/use-mount/__docs__/Example.d.ts +0 -2
  223. package/dist/hooks/use-tooltip-position/__docs__/Example.d.ts +0 -2
  224. package/dist/hooks/use-window-dimensions/__docs__/Example.d.ts +0 -2
  225. package/dist/types/components/_common.d.ts +0 -15
  226. package/dist/types/components/alert.d.ts +0 -18
  227. package/dist/types/components/dialog.d.ts +0 -15
  228. package/dist/types/components/multi-select.d.ts +0 -38
  229. package/dist/types/components/select.d.ts +0 -45
  230. package/dist/types/components/tabs.d.ts +0 -25
  231. package/dist/types/components/tooltip.d.ts +0 -9
  232. package/dist/types/index.d.ts +0 -13
@@ -1,3 +1,5 @@
1
+ import { ChopLogicThemeMode } from '../enums';
2
+
1
3
  export interface ChopLogicTheme {
2
4
  fontColorBase: string;
3
5
  fontColorLight: string;
@@ -26,3 +28,9 @@ export interface ChopLogicTheme {
26
28
  zIndexPopup: string;
27
29
  zIndexModal: string;
28
30
  }
31
+ export interface ChopLogicThemeContextProps {
32
+ mode: ChopLogicThemeMode;
33
+ setMode?: (mode: ChopLogicThemeMode) => void;
34
+ customTheme?: Partial<ChopLogicTheme>;
35
+ setCustomTheme?: (customTheme: ChopLogicTheme) => void;
36
+ }
@@ -0,0 +1,30 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ export interface ChopLogicComponentProps {
4
+ id?: string;
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ tabIndex?: number;
8
+ title?: string;
9
+ }
10
+ export interface ChopLogicInputProps extends ChopLogicComponentProps {
11
+ label: string;
12
+ name: string;
13
+ disabled?: boolean;
14
+ required?: boolean;
15
+ }
16
+ export type ChopLogicSelectValue = {
17
+ id: string;
18
+ label: string;
19
+ } & {
20
+ [key in string]: unknown;
21
+ };
22
+ export type ChopLogicMultiSelectValue = ChopLogicSelectValue & {
23
+ selected: boolean;
24
+ };
25
+ export type ChopLogicNumericInputValidator = (input?: number) => boolean;
26
+ export type ChopLogicTextInputValidator = (input: string) => boolean;
27
+ export type ChopLogicRegExpWithFlags = {
28
+ regexp: string;
29
+ flags?: string;
30
+ };
@@ -0,0 +1,10 @@
1
+ import { ChopLogicAlertMode, ChopLogicIconName } from '../../enums';
2
+ import { ChopLogicComponentProps } from '../common.ts';
3
+
4
+ export interface ChopLogicAlertProps extends ChopLogicComponentProps {
5
+ isOpened: boolean;
6
+ onClose: () => void;
7
+ message: string;
8
+ mode?: ChopLogicAlertMode;
9
+ icon?: ChopLogicIconName;
10
+ }
@@ -1,8 +1,8 @@
1
1
  import { FocusEventHandler, MouseEventHandler } from 'react';
2
2
  import { ChopLogicButtonView, ChopLogicIconName } from '../../enums';
3
- import { CommonInputProps } from './_common';
3
+ import { ChopLogicInputProps } from '../common.ts';
4
4
 
5
- export type ChopLogicButtonProps = Partial<CommonInputProps> & {
5
+ export interface ChopLogicButtonProps extends Partial<ChopLogicInputProps> {
6
6
  onClick?: MouseEventHandler<HTMLButtonElement>;
7
7
  onFocus?: FocusEventHandler<HTMLButtonElement>;
8
8
  onBlur?: FocusEventHandler<HTMLButtonElement>;
@@ -12,4 +12,4 @@ export type ChopLogicButtonProps = Partial<CommonInputProps> & {
12
12
  extended?: boolean;
13
13
  type?: 'button' | 'reset' | 'submit';
14
14
  tooltip?: string;
15
- };
15
+ }
@@ -1,9 +1,9 @@
1
1
  import { ChangeEventHandler } from 'react';
2
- import { CommonInputProps } from './_common';
2
+ import { ChopLogicInputProps } from '../common.ts';
3
3
 
4
- export type ChopLogicCheckboxProps = CommonInputProps & {
4
+ export interface ChopLogicCheckboxProps extends ChopLogicInputProps {
5
5
  noLabel?: boolean;
6
6
  iconPosition?: 'left' | 'right';
7
7
  onChange?: ChangeEventHandler<HTMLInputElement>;
8
8
  defaultChecked?: boolean;
9
- };
9
+ }
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { ChopLogicComponentProps } from '../common.ts';
3
+
4
+ export interface ChopLogicDialogProps extends ChopLogicComponentProps, PropsWithChildren {
5
+ isOpened: boolean;
6
+ onClose: () => void;
7
+ title: string;
8
+ }
@@ -1,25 +1,25 @@
1
1
  import { FormEventHandler, PropsWithChildren } from 'react';
2
- import { CommonComponentProps } from './_common.ts';
2
+ import { ChopLogicComponentProps } from '../common.ts';
3
3
 
4
4
  export type ChopLogicFormData = {
5
5
  [key: string]: unknown;
6
6
  };
7
7
  export type ChopLogicFormValidationState = [string, boolean][];
8
- export type ChopLogicFormInputParams = {
8
+ export interface ChopLogicFormInputParams {
9
9
  name: string;
10
10
  value: unknown;
11
11
  valid?: boolean;
12
- };
13
- export type ChopLogicFormContextProps = {
12
+ }
13
+ export interface ChopLogicFormContextProps {
14
14
  onChangeFormInput?: (params: ChopLogicFormInputParams) => void;
15
15
  initialValues?: ChopLogicFormData;
16
16
  resetSignal?: number;
17
- };
18
- export type ChopLogicFormProps = PropsWithChildren & CommonComponentProps & {
17
+ }
18
+ export interface ChopLogicFormProps extends PropsWithChildren, ChopLogicComponentProps {
19
19
  columns?: number;
20
20
  initialValues?: ChopLogicFormData;
21
21
  hasReset?: boolean;
22
22
  onClickSubmit?: (data: ChopLogicFormData) => void;
23
23
  onReset?: FormEventHandler<HTMLFormElement>;
24
24
  onSubmit?: FormEventHandler<HTMLFormElement>;
25
- };
25
+ }
@@ -1,14 +1,14 @@
1
1
  import { ReactElement } from 'react';
2
- import { CommonComponentProps } from './_common';
2
+ import { ChopLogicComponentProps } from '../common.ts';
3
3
 
4
- export type ChopLogicGridProps = CommonComponentProps & {
4
+ export interface ChopLogicGridProps extends ChopLogicComponentProps {
5
5
  columns: ChopLogicGridColumn[];
6
6
  data: ChopLogicGridItem[];
7
7
  caption?: string;
8
8
  selectable?: boolean;
9
9
  renderDataItem?: RenderDataItemCallback;
10
10
  onSelect?: (ids: string[]) => void;
11
- };
11
+ }
12
12
  export type ChopLogicGridColumn = {
13
13
  field: string;
14
14
  title?: string;
@@ -0,0 +1,6 @@
1
+ import { ChopLogicIconName } from '../../enums';
2
+ import { ChopLogicComponentProps } from '../common.ts';
3
+
4
+ export interface ChopLogicIconProps extends ChopLogicComponentProps {
5
+ name?: ChopLogicIconName;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { ChopLogicInputProps, ChopLogicSelectValue } from '../common.ts';
2
+
3
+ export interface ChopLogicMultiSelectProps extends ChopLogicInputProps {
4
+ options: ChopLogicSelectValue[];
5
+ onChange?: (values?: ChopLogicSelectValue[]) => void;
6
+ defaultValue?: string | number | readonly string[];
7
+ placeholder?: string;
8
+ }
@@ -1,10 +1,9 @@
1
1
  import { ChangeEventHandler, FocusEventHandler } from 'react';
2
- import { CommonInputProps } from './_common';
2
+ import { ChopLogicInputProps, ChopLogicNumericInputValidator } from '../common.ts';
3
3
 
4
- export type NumericValidationFunction = (input?: number) => boolean;
5
- export type ChopLogicNumericInputProps = CommonInputProps & {
4
+ export interface ChopLogicNumericInputProps extends ChopLogicInputProps {
6
5
  errorMessage?: string;
7
- validator?: NumericValidationFunction;
6
+ validator?: ChopLogicNumericInputValidator;
8
7
  hasSpinButtons?: boolean;
9
8
  min?: number;
10
9
  max?: number;
@@ -15,4 +14,4 @@ export type ChopLogicNumericInputProps = CommonInputProps & {
15
14
  onChange?: ChangeEventHandler<HTMLInputElement>;
16
15
  onBlur?: FocusEventHandler<HTMLInputElement>;
17
16
  onFocus?: FocusEventHandler<HTMLInputElement>;
18
- };
17
+ }
@@ -0,0 +1,8 @@
1
+ import { ChopLogicInputProps, ChopLogicSelectValue } from '../common.ts';
2
+
3
+ export interface ChopLogicSelectProps extends ChopLogicInputProps {
4
+ options: ChopLogicSelectValue[];
5
+ onChange?: (value?: ChopLogicSelectValue) => void;
6
+ placeholder?: string;
7
+ defaultValue?: string | number | readonly string[];
8
+ }
@@ -0,0 +1,15 @@
1
+ import { ReactElement } from 'react';
2
+ import { ChopLogicTabsMode } from '../../enums';
3
+ import { ChopLogicComponentProps } from '../common.ts';
4
+
5
+ export interface ChopLogicTabsProps extends ChopLogicComponentProps {
6
+ tabs: ChopLogicTabItem[];
7
+ defaultTabId?: string;
8
+ mode?: ChopLogicTabsMode;
9
+ }
10
+ export interface ChopLogicTabItem {
11
+ content: ReactElement;
12
+ title: string;
13
+ id: string;
14
+ disabled?: boolean;
15
+ }
@@ -1,17 +1,12 @@
1
1
  import { ChangeEventHandler, FocusEventHandler, HTMLInputAutoCompleteAttribute } from 'react';
2
- import { CommonInputProps } from './_common';
2
+ import { ChopLogicInputProps, ChopLogicRegExpWithFlags, ChopLogicTextInputValidator } from '../common.ts';
3
3
 
4
- export type RegExpWithFlags = {
5
- regexp: string;
6
- flags?: string;
7
- };
8
- export type TextValidationFunction = (input: string) => boolean;
9
- export type ChopLogicTextInputProps = CommonInputProps & {
4
+ export interface ChopLogicTextInputProps extends ChopLogicInputProps {
10
5
  errorMessage?: string;
11
6
  clearable?: boolean;
12
7
  readOnly?: boolean;
13
8
  type?: 'text' | 'email' | 'password';
14
- validator?: RegExpWithFlags | TextValidationFunction;
9
+ validator?: ChopLogicRegExpWithFlags | ChopLogicTextInputValidator;
15
10
  maxLength?: number;
16
11
  placeholder?: string;
17
12
  defaultValue?: string;
@@ -20,4 +15,4 @@ export type ChopLogicTextInputProps = CommonInputProps & {
20
15
  onChange?: ChangeEventHandler<HTMLInputElement>;
21
16
  onBlur?: FocusEventHandler<HTMLInputElement>;
22
17
  onFocus?: FocusEventHandler<HTMLInputElement>;
23
- };
18
+ }
@@ -0,0 +1,9 @@
1
+ import { PropsWithChildren, ReactElement } from 'react';
2
+ import { ChopLogicTooltipContainer } from '../../enums';
3
+ import { ChopLogicComponentProps } from '../common.ts';
4
+
5
+ export interface ChopLogicTooltipProps extends PropsWithChildren, ChopLogicComponentProps {
6
+ tooltipContent: string | ReactElement;
7
+ containerTag?: ChopLogicTooltipContainer;
8
+ visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
9
+ }
@@ -0,0 +1,15 @@
1
+ export type { ChopLogicTheme, ChopLogicThemeContextProps } from './chop-logic-theme.ts';
2
+ export type { ChopLogicComponentProps, ChopLogicInputProps, ChopLogicMultiSelectValue, ChopLogicNumericInputValidator, ChopLogicRegExpWithFlags, ChopLogicSelectValue, ChopLogicTextInputValidator, } from './common.ts';
3
+ export type { ChopLogicAlertProps } from './components/alert.ts';
4
+ export type { ChopLogicButtonProps } from './components/button.ts';
5
+ export type { ChopLogicCheckboxProps } from './components/checkbox.ts';
6
+ export type { ChopLogicDialogProps } from './components/dialog.ts';
7
+ export type { ChopLogicFormContextProps, ChopLogicFormData, ChopLogicFormInputParams, ChopLogicFormProps, ChopLogicFormValidationState, } from './components/form.ts';
8
+ export type { ChopLogicGridColumn, ChopLogicGridItem, ChopLogicGridProps, RenderDataItemCallback } from './components/grid.ts';
9
+ export type { ChopLogicIconProps } from './components/icon.ts';
10
+ export type { ChopLogicMultiSelectProps } from './components/multi-select.ts';
11
+ export type { ChopLogicNumericInputProps } from './components/numeric.ts';
12
+ export type { ChopLogicSelectProps } from './components/select.ts';
13
+ export type { ChopLogicTabItem, ChopLogicTabsProps } from './components/tabs.ts';
14
+ export type { ChopLogicTextInputProps } from './components/text.ts';
15
+ export type { ChopLogicTooltipProps } from './components/tooltip.ts';
@@ -1,3 +1,3 @@
1
- import { ChopLogicTheme } from '../types';
1
+ import { ChopLogicTheme } from '../models';
2
2
 
3
3
  export declare function getChopLogicTheme(mode?: 'dark' | 'light', customTheme?: Partial<ChopLogicTheme>): ChopLogicTheme;
@@ -1,8 +1,8 @@
1
1
  import { KeyboardEvent } from 'react';
2
- import { SelectValue } from '../types';
2
+ import { ChopLogicSelectValue } from '../models';
3
3
 
4
4
  export declare function handleDropdownListKeyPress({ e, options, onClose, }: {
5
5
  e: KeyboardEvent<HTMLUListElement>;
6
- options: SelectValue[];
6
+ options: ChopLogicSelectValue[];
7
7
  onClose: () => void;
8
8
  }): void;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/SavouryGin/chop-logic-components.git"
6
6
  },
7
- "version": "1.1.2",
7
+ "version": "1.1.4",
8
8
  "description": "React UI components library for Chop Logic project",
9
9
  "type": "module",
10
10
  "main": "dist/index.cjs.js",
@@ -1,2 +0,0 @@
1
- declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
- export default Example;
@@ -1,2 +0,0 @@
1
- declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
- export default Example;
@@ -1,2 +0,0 @@
1
- declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
- export default Example;
@@ -1,2 +0,0 @@
1
- declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
- export default Example;
@@ -1,2 +0,0 @@
1
- declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
- export default Example;
@@ -1,2 +0,0 @@
1
- declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
- export default Example;
@@ -1,2 +0,0 @@
1
- declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
- export default Example;
@@ -1,15 +0,0 @@
1
- import { CSSProperties } from 'react';
2
-
3
- export type CommonInputProps = CommonComponentProps & {
4
- label: string;
5
- name: string;
6
- disabled?: boolean;
7
- required?: boolean;
8
- };
9
- export type CommonComponentProps = {
10
- id?: string;
11
- className?: string;
12
- style?: CSSProperties;
13
- tabIndex?: number;
14
- title?: string;
15
- };
@@ -1,18 +0,0 @@
1
- import { ChopLogicAlertMode, ChopLogicIconName } from '../../enums';
2
- import { ChopLogicTheme } from '..';
3
- import { CommonComponentProps } from './_common';
4
-
5
- export type ChopLogicAlertProps = CommonComponentProps & {
6
- isOpened: boolean;
7
- onClose: () => void;
8
- message: string;
9
- mode?: ChopLogicAlertMode;
10
- icon?: ChopLogicIconName;
11
- };
12
- export type ChopLogicAlertHeaderProps = {
13
- onClose: () => void;
14
- theme: ChopLogicTheme;
15
- mode: ChopLogicAlertMode;
16
- title?: string;
17
- icon?: ChopLogicIconName;
18
- };
@@ -1,15 +0,0 @@
1
- import { HTMLAttributes, PropsWithChildren } from 'react';
2
- import { ChopLogicTheme } from '..';
3
- import { CommonComponentProps } from './_common';
4
-
5
- export type ChopLogicDialogProps = CommonComponentProps & PropsWithChildren & {
6
- isOpened: boolean;
7
- onClose: () => void;
8
- title: string;
9
- };
10
- export type DialogLayoutProps = PropsWithChildren & HTMLAttributes<HTMLDivElement> & {
11
- title: string;
12
- onClose: () => void;
13
- isOpened: boolean;
14
- theme: ChopLogicTheme;
15
- };
@@ -1,38 +0,0 @@
1
- import { ChopLogicTheme } from '..';
2
- import { CommonInputProps } from './_common';
3
- import { SelectValue } from './select';
4
-
5
- export type MultiSelectValue = SelectValue & {
6
- selected: boolean;
7
- };
8
- export type ChopLogicMultiSelectProps = CommonInputProps & {
9
- options: SelectValue[];
10
- onChange?: (values?: SelectValue[]) => void;
11
- defaultValue?: string | number | readonly string[];
12
- placeholder?: string;
13
- };
14
- export type MultiSelectDropdownProps = {
15
- options: MultiSelectValue[];
16
- opened: boolean;
17
- dropdownId: string;
18
- onClose: () => void;
19
- onSelect: (id: string) => void;
20
- theme: ChopLogicTheme;
21
- };
22
- export type MultiSelectComboboxProps = {
23
- opened: boolean;
24
- disabled: boolean;
25
- required: boolean;
26
- onClick: () => void;
27
- comboboxId: string;
28
- dropdownId: string;
29
- values?: MultiSelectValue[];
30
- placeholder?: string;
31
- name: string;
32
- theme: ChopLogicTheme;
33
- };
34
- export type MultiSelectOptionProps = {
35
- value: MultiSelectValue;
36
- onSelect: (id: string) => void;
37
- theme: ChopLogicTheme;
38
- };
@@ -1,45 +0,0 @@
1
- import { ChopLogicTheme } from '..';
2
- import { CommonInputProps } from './_common';
3
-
4
- export type SelectValue = {
5
- id: string;
6
- label: string;
7
- } & {
8
- [key in string]: unknown;
9
- };
10
- export type ChopLogicSelectProps = CommonInputProps & {
11
- options: SelectValue[];
12
- onChange?: (value?: SelectValue) => void;
13
- placeholder?: string;
14
- defaultValue?: string | number | readonly string[];
15
- };
16
- export type SelectOptionProps = {
17
- value: SelectValue;
18
- selected: boolean;
19
- onSelect: (id: string) => void;
20
- onClear: () => void;
21
- theme: ChopLogicTheme;
22
- };
23
- export type SelectComboboxProps = {
24
- opened: boolean;
25
- disabled: boolean;
26
- required: boolean;
27
- onClick: () => void;
28
- comboboxId: string;
29
- dropdownId: string;
30
- selected?: SelectValue;
31
- placeholder?: string;
32
- name: string;
33
- theme: ChopLogicTheme;
34
- };
35
- export type SelectDropdownProps = {
36
- options: SelectValue[];
37
- opened: boolean;
38
- dropdownId: string;
39
- comboboxId: string;
40
- onClose: () => void;
41
- selected?: SelectValue;
42
- onSelect: (id: string) => void;
43
- onClear: () => void;
44
- theme: ChopLogicTheme;
45
- };
@@ -1,25 +0,0 @@
1
- import { ReactElement } from 'react';
2
- import { ChopLogicTheme } from '..';
3
- import { CommonComponentProps } from './_common';
4
-
5
- export type ChopLogicTabsProps = CommonComponentProps & {
6
- tabs: ChopLogicTabItem[];
7
- defaultTabId?: string;
8
- mode?: ChopLogicTabsMode;
9
- };
10
- export type ChopLogicTabListProps = {
11
- tabs: ChopLogicTabItem[];
12
- tabIds: string[];
13
- onTabSelect: (id: string) => void;
14
- selectedTabId: string;
15
- tabPanelIds: string[];
16
- mode: ChopLogicTabsMode;
17
- theme: ChopLogicTheme;
18
- };
19
- export type ChopLogicTabItem = {
20
- content: ReactElement;
21
- title: string;
22
- id: string;
23
- disabled?: boolean;
24
- };
25
- export type ChopLogicTabsMode = 'vertical' | 'horizontal';
@@ -1,9 +0,0 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { CommonComponentProps } from './_common';
3
-
4
- export type ChopLogicTooltipProps = PropsWithChildren & CommonComponentProps & {
5
- tooltipContent: string | ReactElement;
6
- containerTag?: TooltipContainerTag;
7
- visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
8
- };
9
- export type TooltipContainerTag = 'span' | 'div' | 'p' | 'strong' | 'em';
@@ -1,13 +0,0 @@
1
- export type { ChopLogicTheme } from './chop-logic-theme.ts';
2
- export * from './components/alert.ts';
3
- export * from './components/button.ts';
4
- export * from './components/checkbox.ts';
5
- export * from './components/dialog.ts';
6
- export * from './components/form.ts';
7
- export * from './components/grid.ts';
8
- export * from './components/multi-select.ts';
9
- export * from './components/numeric.ts';
10
- export * from './components/select.ts';
11
- export * from './components/tabs.ts';
12
- export * from './components/text.ts';
13
- export * from './components/tooltip.ts';