chop-logic-components 4.1.0 → 4.1.1

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 (159) hide show
  1. package/README.md +11 -0
  2. package/dist/components/atoms/button/Button.d.ts +7 -0
  3. package/dist/components/atoms/button/icon-button/IconButton.d.ts +3 -0
  4. package/dist/components/atoms/button/inner-button/InnerButton.d.ts +3 -0
  5. package/dist/components/atoms/button/primary-button/PrimaryButton.d.ts +3 -0
  6. package/dist/components/atoms/button/secondary-button/SecondaryButton.d.ts +3 -0
  7. package/dist/components/atoms/editable-text/EditView.d.ts +14 -0
  8. package/dist/components/atoms/editable-text/EditableText.d.ts +4 -0
  9. package/dist/components/atoms/editable-text/ReadView.d.ts +10 -0
  10. package/dist/components/atoms/editable-text/useEditModeState.d.ts +6 -0
  11. package/dist/components/atoms/editable-text/useInputFocus.d.ts +2 -0
  12. package/dist/components/atoms/editable-text/useValueState.d.ts +6 -0
  13. package/dist/components/atoms/error-message/ErrorMessage.d.ts +10 -0
  14. package/dist/components/atoms/header/Header.d.ts +4 -0
  15. package/dist/components/atoms/icon/Icon.d.ts +11 -0
  16. package/dist/components/atoms/image/BasicImage.d.ts +13 -0
  17. package/dist/components/atoms/image/FallBackImage.d.ts +2 -0
  18. package/dist/components/atoms/image/Image.d.ts +6 -0
  19. package/dist/components/atoms/image/ResponsivePicture.d.ts +15 -0
  20. package/dist/components/atoms/index.d.ts +11 -0
  21. package/dist/components/atoms/input/Input.d.ts +5 -0
  22. package/dist/components/atoms/label/Label.d.ts +16 -0
  23. package/dist/components/atoms/link/Link.d.ts +4 -0
  24. package/dist/components/atoms/portal/Portal.d.ts +5 -0
  25. package/dist/components/atoms/tooltip/Tooltip.controller.d.ts +19 -0
  26. package/dist/components/atoms/tooltip/Tooltip.d.ts +4 -0
  27. package/dist/components/contexts/form/FormContext.d.ts +7 -0
  28. package/dist/components/contexts/index.d.ts +4 -0
  29. package/dist/components/contexts/theme/ThemeContext.d.ts +8 -0
  30. package/dist/components/contexts/theme/ThemeProvider.d.ts +8 -0
  31. package/dist/components/hocs/index.d.ts +3 -0
  32. package/dist/components/hocs/with-error-boundary/with-error-boundary.d.ts +6 -0
  33. package/dist/components/hocs/with-figure-caption/with-figure-caption.d.ts +6 -0
  34. package/dist/components/hocs/with-tooltip/with-tooltip.d.ts +7 -0
  35. package/dist/components/molecules/accordion/Accordion.d.ts +4 -0
  36. package/dist/components/molecules/accordion/AccordionItem.d.ts +3 -0
  37. package/dist/components/molecules/alert/Alert.d.ts +4 -0
  38. package/dist/components/molecules/alert/Alert.helpers.d.ts +3 -0
  39. package/dist/components/molecules/alert/AlertProgressBar.d.ts +4 -0
  40. package/dist/components/molecules/breadcrumbs/BreadcrumbItem.d.ts +7 -0
  41. package/dist/components/molecules/breadcrumbs/BreadcrumbList.d.ts +6 -0
  42. package/dist/components/molecules/breadcrumbs/Breadcrumbs.d.ts +4 -0
  43. package/dist/components/molecules/checkbox/Checkbox.controller.d.ts +9 -0
  44. package/dist/components/molecules/checkbox/Checkbox.d.ts +9 -0
  45. package/dist/components/molecules/checkbox/Checkbox.helpers.d.ts +6 -0
  46. package/dist/components/molecules/checkbox/CheckboxStateful.d.ts +4 -0
  47. package/dist/components/molecules/checkbox/CheckboxStateless.d.ts +4 -0
  48. package/dist/components/molecules/index.d.ts +10 -0
  49. package/dist/components/molecules/multi-select/MultiSelect.Combobox.d.ts +15 -0
  50. package/dist/components/molecules/multi-select/MultiSelect.Dropdown.d.ts +11 -0
  51. package/dist/components/molecules/multi-select/MultiSelect.controller.d.ts +13 -0
  52. package/dist/components/molecules/multi-select/MultiSelect.d.ts +4 -0
  53. package/dist/components/molecules/multi-select/MultiSelect.helpers.d.ts +9 -0
  54. package/dist/components/molecules/multi-select/MultiSelectComboboxSelectedValues.d.ts +8 -0
  55. package/dist/components/molecules/multi-select/Option.d.ts +8 -0
  56. package/dist/components/molecules/numeric-input/NumericInput.controller.d.ts +22 -0
  57. package/dist/components/molecules/numeric-input/NumericInput.d.ts +9 -0
  58. package/dist/components/molecules/numeric-input/NumericInput.helpers.d.ts +13 -0
  59. package/dist/components/molecules/numeric-input/NumericInputStateful.d.ts +4 -0
  60. package/dist/components/molecules/numeric-input/NumericInputStateless.d.ts +4 -0
  61. package/dist/components/molecules/search/Search.controller.d.ts +12 -0
  62. package/dist/components/molecules/search/Search.d.ts +4 -0
  63. package/dist/components/molecules/select/Select.controller.d.ts +14 -0
  64. package/dist/components/molecules/select/Select.d.ts +4 -0
  65. package/dist/components/molecules/select/Select.helpers.d.ts +7 -0
  66. package/dist/components/molecules/select/combobox/Combobox.d.ts +15 -0
  67. package/dist/components/molecules/select/dropdown/Dropdown.d.ts +14 -0
  68. package/dist/components/molecules/select/option/Option.d.ts +10 -0
  69. package/dist/components/molecules/switch/Switch.controller.d.ts +10 -0
  70. package/dist/components/molecules/switch/Switch.d.ts +4 -0
  71. package/dist/components/molecules/switch/Switch.helpers.d.ts +6 -0
  72. package/dist/components/molecules/text-input/TextInput.controller.d.ts +17 -0
  73. package/dist/components/molecules/text-input/TextInput.d.ts +9 -0
  74. package/dist/components/molecules/text-input/TextInput.helpers.d.ts +11 -0
  75. package/dist/components/molecules/text-input/TextInputButtons.d.ts +11 -0
  76. package/dist/components/molecules/text-input/TextInputStateful.d.ts +4 -0
  77. package/dist/components/molecules/text-input/TextInputStateless.d.ts +4 -0
  78. package/dist/components/organisms/dialog/Dialog.d.ts +4 -0
  79. package/dist/components/organisms/form/Form.controller.d.ts +14 -0
  80. package/dist/components/organisms/form/Form.d.ts +4 -0
  81. package/dist/components/organisms/form/Form.helpers.d.ts +4 -0
  82. package/dist/components/organisms/grid/Grid.controller.d.ts +15 -0
  83. package/dist/components/organisms/grid/Grid.d.ts +4 -0
  84. package/dist/components/organisms/grid/Grid.helpers.d.ts +6 -0
  85. package/dist/components/organisms/grid/body/GridBody.d.ts +13 -0
  86. package/dist/components/organisms/grid/checkbox/GridCheckbox.d.ts +6 -0
  87. package/dist/components/organisms/grid/column-group/GridColumnGroup.d.ts +6 -0
  88. package/dist/components/organisms/grid/data-cell/GridDataCell.d.ts +4 -0
  89. package/dist/components/organisms/grid/grid-row/GridRow.d.ts +13 -0
  90. package/dist/components/organisms/grid/head/GridHead.d.ts +13 -0
  91. package/dist/components/organisms/grid/header-cell/HeaderCell.d.ts +5 -0
  92. package/dist/components/organisms/grid/select-all-grid-rows-cell/SelectAllGridRowsCell.d.ts +10 -0
  93. package/dist/components/organisms/grid/select-grid-row-cell/SelectGridRowCell.d.ts +10 -0
  94. package/dist/components/organisms/index.d.ts +5 -0
  95. package/dist/components/organisms/menu/Menu.d.ts +4 -0
  96. package/dist/components/organisms/menu/leaf/MenuLeaf.d.ts +5 -0
  97. package/dist/components/organisms/menu/list-item/MenuListItem.d.ts +10 -0
  98. package/dist/components/organisms/menu/sub-menu/SubMenu.d.ts +14 -0
  99. package/dist/components/organisms/tabs/Tabs.d.ts +4 -0
  100. package/dist/components/organisms/tabs/button/TabButton.d.ts +18 -0
  101. package/dist/components/organisms/tabs/content/TabContent.d.ts +8 -0
  102. package/dist/components/organisms/tabs/edit-input/TabEditInput.d.ts +14 -0
  103. package/dist/components/organisms/tabs/list/TabList.d.ts +19 -0
  104. package/dist/enums/alert-mode.d.ts +7 -0
  105. package/dist/enums/button-view.d.ts +6 -0
  106. package/dist/enums/element-size.d.ts +8 -0
  107. package/dist/enums/icon-name.d.ts +284 -0
  108. package/dist/enums/index.d.ts +8 -0
  109. package/dist/enums/loader-view.d.ts +11 -0
  110. package/dist/enums/orientation-mode.d.ts +4 -0
  111. package/dist/enums/semantic-color.d.ts +7 -0
  112. package/dist/enums/tooltip-container.d.ts +7 -0
  113. package/dist/hooks/index.d.ts +15 -0
  114. package/dist/hooks/use-auto-close/use-auto-close.d.ts +6 -0
  115. package/dist/hooks/use-click-outside/use-click-outside.d.ts +8 -0
  116. package/dist/hooks/use-container-dimensions/use-container-dimensions.d.ts +8 -0
  117. package/dist/hooks/use-debounce/use-debounce.d.ts +1 -0
  118. package/dist/hooks/use-element-ids/use-element-ids.d.ts +5 -0
  119. package/dist/hooks/use-is-hovered/use-is-hovered.d.ts +2 -0
  120. package/dist/hooks/use-is-mounted/use-is-mounted.d.ts +1 -0
  121. package/dist/hooks/use-is-overflow/use-is-overflow.d.ts +6 -0
  122. package/dist/hooks/use-key-press/use-key-press.d.ts +8 -0
  123. package/dist/hooks/use-modal-focus-trap/use-modal-focus-trap.d.ts +7 -0
  124. package/dist/hooks/use-remaining-timer/use-remaining-timer.d.ts +9 -0
  125. package/dist/hooks/use-reset-form-input/use-reset-form-input.d.ts +1 -0
  126. package/dist/hooks/use-theme/use-theme.d.ts +4 -0
  127. package/dist/hooks/use-tooltip-position/use-tooltip-position.d.ts +12 -0
  128. package/dist/hooks/use-window-dimensions/use-window-dimensions.d.ts +2 -0
  129. package/dist/index.d.ts +2 -924
  130. package/dist/main.d.ts +8 -0
  131. package/dist/types/_common.d.ts +35 -0
  132. package/dist/types/accordion.d.ts +8 -0
  133. package/dist/types/alert.d.ts +11 -0
  134. package/dist/types/breadcrumbs.d.ts +10 -0
  135. package/dist/types/button.d.ts +11 -0
  136. package/dist/types/checkbox.d.ts +9 -0
  137. package/dist/types/dialog.d.ts +9 -0
  138. package/dist/types/editable-text.d.ts +12 -0
  139. package/dist/types/form.d.ts +18 -0
  140. package/dist/types/grid.d.ts +27 -0
  141. package/dist/types/header.d.ts +9 -0
  142. package/dist/types/image.d.ts +21 -0
  143. package/dist/types/index.d.ts +23 -0
  144. package/dist/types/link.d.ts +9 -0
  145. package/dist/types/loader.d.ts +6 -0
  146. package/dist/types/menu.d.ts +17 -0
  147. package/dist/types/multi-select.d.ts +7 -0
  148. package/dist/types/numeric.d.ts +19 -0
  149. package/dist/types/search.d.ts +16 -0
  150. package/dist/types/select.d.ts +7 -0
  151. package/dist/types/switch.d.ts +13 -0
  152. package/dist/types/tabs.d.ts +23 -0
  153. package/dist/types/text.d.ts +17 -0
  154. package/dist/types/tooltip.d.ts +11 -0
  155. package/dist/utils/get-class-name.d.ts +5 -0
  156. package/dist/utils/handle-dropdown-list-key-press.d.ts +7 -0
  157. package/dist/utils/index.d.ts +3 -0
  158. package/dist/utils/move-focus-on-element-by-id.d.ts +1 -0
  159. package/package.json +17 -13
package/dist/index.d.ts CHANGED
@@ -1,924 +1,2 @@
1
- import { AnchorHTMLAttributes } from 'react';
2
- import { ButtonHTMLAttributes } from 'react';
3
- import { ChangeEventHandler } from 'react';
4
- import { ComponentType } from 'react';
5
- import { Context } from 'react';
6
- import { CSSProperties } from 'react';
7
- import { FC } from 'react';
8
- import { FocusEventHandler } from 'react';
9
- import { FormEventHandler } from 'react';
10
- import { ForwardRefExoticComponent } from 'react';
11
- import { HTMLAttributes } from 'react';
12
- import { HTMLInputAutoCompleteAttribute } from 'react';
13
- import { InputHTMLAttributes } from 'react';
14
- import { MouseEvent as MouseEvent_2 } from 'react';
15
- import { PropsWithChildren } from 'react';
16
- import { ReactElement } from 'react';
17
- import { ReactNode } from 'react';
18
- import { ReactPortal } from 'react';
19
- import { RefAttributes } from 'react';
20
- import { RefObject } from 'react';
21
-
22
- export declare const Accordion: FC<AccordionProps>;
23
-
24
- export declare type AccordionItemProps = PropsWithChildren & {
25
- summary: string;
26
- };
27
-
28
- export declare interface AccordionProps extends ChopLogicComponentProps {
29
- items: AccordionItemProps[];
30
- }
31
-
32
- export declare const Alert: FC<AlertProps>;
33
-
34
- export declare enum AlertMode {
35
- Success = "success",
36
- Error = "error",
37
- Warning = "warning",
38
- Info = "info",
39
- Help = "help"
40
- }
41
-
42
- export declare interface AlertProps extends ChopLogicComponentProps {
43
- isOpened: boolean;
44
- onClose: () => void;
45
- message: string;
46
- mode?: AlertMode;
47
- icon?: IconName;
48
- autoClose?: boolean;
49
- autoCloseDelay?: number;
50
- }
51
-
52
- export declare interface Breadcrumb {
53
- label: string;
54
- icon?: IconName;
55
- link?: string;
56
- }
57
-
58
- export declare const Breadcrumbs: FC<BreadcrumbsProps>;
59
-
60
- export declare interface BreadcrumbsProps extends ChopLogicComponentProps {
61
- items: Breadcrumb[];
62
- }
63
-
64
- export declare const Button: FC<ButtonProps & {
65
- tooltip?: string;
66
- visibleOn?: "hover" | "click" | "focus" | "contextmenu";
67
- }>;
68
-
69
- export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
70
- view?: ButtonView;
71
- icon?: IconName;
72
- text?: string;
73
- extended?: boolean;
74
- tooltip?: string;
75
- label?: string;
76
- iconSize?: ElementSize;
77
- }
78
-
79
- export declare enum ButtonView {
80
- Primary = "primary",
81
- Secondary = "secondary",
82
- Icon = "icon",
83
- Inner = "inner"
84
- }
85
-
86
- /**
87
- * Checkbox component factory
88
- * Renders either a stateful or stateless component
89
- * based on the `stateless` prop.
90
- */
91
- export declare const Checkbox: FC<CheckboxProps>;
92
-
93
- export declare interface CheckboxProps extends ChopLogicInputProps {
94
- noLabel?: boolean;
95
- iconPosition?: 'left' | 'right';
96
- onChange?: ChangeEventHandler<HTMLInputElement>;
97
- defaultChecked?: boolean;
98
- checked?: boolean;
99
- }
100
-
101
- export declare interface ChopLogicComponentProps {
102
- id?: string;
103
- className?: string;
104
- style?: CSSProperties;
105
- tabIndex?: number;
106
- title?: string;
107
- }
108
-
109
- export declare interface ChopLogicInputProps extends ChopLogicComponentProps {
110
- label: string;
111
- name: string;
112
- disabled?: boolean;
113
- required?: boolean;
114
- stateless?: boolean;
115
- value?: string | number | readonly string[];
116
- }
117
-
118
- export declare type ChopLogicRegExpWithFlags = {
119
- regexp: string;
120
- flags?: string;
121
- };
122
-
123
- export declare interface ChopLogicTabItem {
124
- content: ReactElement;
125
- title: string;
126
- id: string;
127
- disabled?: boolean;
128
- }
129
-
130
- export declare const CL_DARK_THEME_CLASS = "cl-components-dark-theme";
131
-
132
- export declare const CL_LIGHT_THEME_CLASS = "cl-components-light-theme";
133
-
134
- export declare const Dialog: FC<DialogProps>;
135
-
136
- export declare interface DialogProps extends ChopLogicComponentProps, PropsWithChildren {
137
- isOpened: boolean;
138
- onClose: () => void;
139
- title: string;
140
- icon?: IconName;
141
- }
142
-
143
- export declare type Dimensions = {
144
- width: number;
145
- height: number;
146
- };
147
-
148
- export declare const EditableText: FC<EditableTextProps>;
149
-
150
- export declare interface EditableTextProps extends ChopLogicComponentProps {
151
- value: string;
152
- autoSelectTextOnEditMode?: boolean;
153
- isEditMode?: boolean;
154
- multiline?: boolean;
155
- onChange?: (value: string) => void;
156
- onClick?: (event: MouseEvent_2) => void;
157
- placeholder?: string;
158
- readOnly?: boolean;
159
- }
160
-
161
- export declare enum ElementSize {
162
- ExtraSmall = "xs",
163
- Small = "s",
164
- Medium = "m",
165
- Large = "l",
166
- ExtraLarge = "xl",
167
- ExtraExtraLarge = "2xl"
168
- }
169
-
170
- export declare const ErrorMessage: FC<ErrorMessageProps>;
171
-
172
- declare type ErrorMessageProps = {
173
- errorId: string;
174
- visible?: boolean;
175
- message?: string;
176
- testId?: string;
177
- className?: string;
178
- };
179
-
180
- export declare const Form: FC<FormProps>;
181
-
182
- export declare const FormContext: Context<FormContextProps>;
183
-
184
- export declare interface FormContextProps {
185
- onChangeFormInput?: (params: FormInputParams) => void;
186
- initialValues?: FormValues;
187
- resetSignal?: number;
188
- }
189
-
190
- export declare interface FormInputParams {
191
- name: string;
192
- value: unknown;
193
- valid?: boolean;
194
- }
195
-
196
- export declare interface FormProps extends PropsWithChildren, ChopLogicComponentProps {
197
- initialValues?: FormValues;
198
- hasReset?: boolean;
199
- onClickSubmit?: (data: FormValues) => void;
200
- onReset?: FormEventHandler<HTMLFormElement>;
201
- onSubmit?: FormEventHandler<HTMLFormElement>;
202
- }
203
-
204
- export declare type FormValidationState = [string, boolean][];
205
-
206
- export declare type FormValues = {
207
- [key: string]: unknown;
208
- };
209
-
210
- export declare const Grid: FC<GridProps>;
211
-
212
- export declare type GridColumn = {
213
- field: string;
214
- title?: string;
215
- component?: ReactElement;
216
- highlighted?: boolean;
217
- className?: string;
218
- };
219
-
220
- export declare type GridItem = {
221
- id: string;
222
- disabled?: boolean;
223
- [key: string]: unknown;
224
- };
225
-
226
- export declare interface GridProps extends ChopLogicComponentProps {
227
- columns: GridColumn[];
228
- data: GridItem[];
229
- caption?: string;
230
- selectable?: boolean;
231
- renderDataItem?: RenderDataItemCallback;
232
- onSelect?: (ids: string[]) => void;
233
- }
234
-
235
- export declare type GridRowValue = {
236
- field: string;
237
- value: string | ReactElement;
238
- };
239
-
240
- export declare const Header: FC<HeaderProps>;
241
-
242
- declare type HeaderLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
243
-
244
- export declare interface HeaderProps extends HTMLAttributes<HTMLHeadingElement> {
245
- children: ReactNode;
246
- as?: HeaderLevel;
247
- icon?: IconName;
248
- }
249
-
250
- export declare const Icon: FC<IconProps>;
251
-
252
- export declare enum IconName {
253
- Activity = "chop-icon__activity",
254
- Airplay = "chop-icon__airplay",
255
- AlertCircle = "chop-icon__alert-circle",
256
- AlertOctagon = "chop-icon__alert-octagon",
257
- AlertTriangle = "chop-icon__alert-triangle",
258
- AlignCenter = "chop-icon__align-center",
259
- AlignJustify = "chop-icon__align-justify",
260
- AlignLeft = "chop-icon__align-left",
261
- AlignRight = "chop-icon__align-right",
262
- Anchor = "chop-icon__anchor",
263
- Aperture = "chop-icon__aperture",
264
- Archive = "chop-icon__archive",
265
- ArrowDown = "chop-icon__arrow-down",
266
- ArrowDownCircle = "chop-icon__arrow-down-circle",
267
- ArrowDownLeft = "chop-icon__arrow-down-left",
268
- ArrowDownRight = "chop-icon__arrow-down-right",
269
- ArrowLeft = "chop-icon__arrow-left",
270
- ArrowLeftCircle = "chop-icon__arrow-left-circle",
271
- ArrowRight = "chop-icon__arrow-right",
272
- ArrowRightCircle = "chop-icon__arrow-right-circle",
273
- ArrowUp = "chop-icon__arrow-up",
274
- ArrowUpCircle = "chop-icon__arrow-up-circle",
275
- ArrowUpLeft = "chop-icon__arrow-up-left",
276
- ArrowUpRight = "chop-icon__arrow-up-right",
277
- AtSign = "chop-icon__at-sign",
278
- Award = "chop-icon__award",
279
- BarChart = "chop-icon__bar-chart",
280
- BarChart2 = "chop-icon__bar-chart-2",
281
- Battery = "chop-icon__battery",
282
- BatteryCharging = "chop-icon__battery-charging",
283
- Bell = "chop-icon__bell",
284
- BellOff = "chop-icon__bell-off",
285
- Bluetooth = "chop-icon__bluetooth",
286
- Bold = "chop-icon__bold",
287
- Book = "chop-icon__book",
288
- BookOpen = "chop-icon__book-open",
289
- Bookmark = "chop-icon__bookmark",
290
- Box = "chop-icon__box",
291
- Briefcase = "chop-icon__briefcase",
292
- Calendar = "chop-icon__calendar",
293
- Camera = "chop-icon__camera",
294
- CameraOff = "chop-icon__camera-off",
295
- Cast = "chop-icon__cast",
296
- Check = "chop-icon__check",
297
- CheckCircle = "chop-icon__check-circle",
298
- CheckSquare = "chop-icon__check-square",
299
- ChevronDown = "chop-icon__chevron-down",
300
- ChevronLeft = "chop-icon__chevron-left",
301
- ChevronRight = "chop-icon__chevron-right",
302
- ChevronUp = "chop-icon__chevron-up",
303
- ChevronsDown = "chop-icon__chevrons-down",
304
- ChevronsLeft = "chop-icon__chevrons-left",
305
- ChevronsRight = "chop-icon__chevrons-right",
306
- ChevronsUp = "chop-icon__chevrons-up",
307
- Chrome = "chop-icon__chrome",
308
- Circle = "chop-icon__circle",
309
- Clipboard = "chop-icon__clipboard",
310
- Clock = "chop-icon__clock",
311
- Cloud = "chop-icon__cloud",
312
- CloudDrizzle = "chop-icon__cloud-drizzle",
313
- CloudLightning = "chop-icon__cloud-lightning",
314
- CloudOff = "chop-icon__cloud-off",
315
- CloudRain = "chop-icon__cloud-rain",
316
- CloudSnow = "chop-icon__cloud-snow",
317
- Code = "chop-icon__code",
318
- Codepen = "chop-icon__codepen",
319
- Codesandbox = "chop-icon__codesandbox",
320
- Coffee = "chop-icon__coffee",
321
- Columns = "chop-icon__columns",
322
- Command = "chop-icon__command",
323
- Compass = "chop-icon__compass",
324
- Copy = "chop-icon__copy",
325
- CornerDownLeft = "chop-icon__corner-down-left",
326
- CornerDownRight = "chop-icon__corner-down-right",
327
- CornerLeftDown = "chop-icon__corner-left-down",
328
- CornerLeftUp = "chop-icon__corner-left-up",
329
- CornerRightDown = "chop-icon__corner-right-down",
330
- CornerRightUp = "chop-icon__corner-right-up",
331
- CornerUpLeft = "chop-icon__corner-up-left",
332
- CornerUpRight = "chop-icon__corner-up-right",
333
- Cpu = "chop-icon__cpu",
334
- CreditCard = "chop-icon__credit-card",
335
- Crop = "chop-icon__crop",
336
- Crosshair = "chop-icon__crosshair",
337
- Database = "chop-icon__database",
338
- Delete = "chop-icon__delete",
339
- Disc = "chop-icon__disc",
340
- DollarSign = "chop-icon__dollar-sign",
341
- Download = "chop-icon__download",
342
- DownloadCloud = "chop-icon__download-cloud",
343
- Droplet = "chop-icon__droplet",
344
- Edit = "chop-icon__edit",
345
- Edit2 = "chop-icon__edit-2",
346
- Edit3 = "chop-icon__edit-3",
347
- ExternalLink = "chop-icon__external-link",
348
- Eye = "chop-icon__eye",
349
- EyeOff = "chop-icon__eye-off",
350
- Facebook = "chop-icon__facebook",
351
- FastForward = "chop-icon__fast-forward",
352
- Feather = "chop-icon__feather",
353
- Figma = "chop-icon__figma",
354
- File = "chop-icon__file",
355
- FileMinus = "chop-icon__file-minus",
356
- FilePlus = "chop-icon__file-plus",
357
- FileText = "chop-icon__file-text",
358
- Film = "chop-icon__film",
359
- Filter = "chop-icon__filter",
360
- Flag = "chop-icon__flag",
361
- Folder = "chop-icon__folder",
362
- FolderMinus = "chop-icon__folder-minus",
363
- FolderPlus = "chop-icon__folder-plus",
364
- Framer = "chop-icon__framer",
365
- Frown = "chop-icon__frown",
366
- Gift = "chop-icon__gift",
367
- GitBranch = "chop-icon__git-branch",
368
- GitCommit = "chop-icon__git-commit",
369
- GitMerge = "chop-icon__git-merge",
370
- GitPullRequest = "chop-icon__git-pull-request",
371
- Github = "chop-icon__github",
372
- Gitlab = "chop-icon__gitlab",
373
- Globe = "chop-icon__globe",
374
- Grid = "chop-icon__grid",
375
- HardDrive = "chop-icon__hard-drive",
376
- Hash = "chop-icon__hash",
377
- Headphones = "chop-icon__headphones",
378
- Heart = "chop-icon__heart",
379
- HelpCircle = "chop-icon__help-circle",
380
- Hexagon = "chop-icon__hexagon",
381
- Home = "chop-icon__home",
382
- Image = "chop-icon__image",
383
- Inbox = "chop-icon__inbox",
384
- Info = "chop-icon__info",
385
- Instagram = "chop-icon__instagram",
386
- Italic = "chop-icon__italic",
387
- Key = "chop-icon__key",
388
- Layers = "chop-icon__layers",
389
- Layout = "chop-icon__layout",
390
- LifeBuoy = "chop-icon__life-buoy",
391
- Link = "chop-icon__link",
392
- Link2 = "chop-icon__link-2",
393
- Linkedin = "chop-icon__linkedin",
394
- List = "chop-icon__list",
395
- Loader = "chop-icon__loader",
396
- Lock = "chop-icon__lock",
397
- LogIn = "chop-icon__log-in",
398
- LogOut = "chop-icon__log-out",
399
- Mail = "chop-icon__mail",
400
- Map = "chop-icon__map",
401
- MapPin = "chop-icon__map-pin",
402
- Maximize = "chop-icon__maximize",
403
- Maximize2 = "chop-icon__maximize-2",
404
- Meh = "chop-icon__meh",
405
- Menu = "chop-icon__menu",
406
- MessageCircle = "chop-icon__message-circle",
407
- MessageSquare = "chop-icon__message-square",
408
- Mic = "chop-icon__mic",
409
- MicOff = "chop-icon__mic-off",
410
- Minimize = "chop-icon__minimize",
411
- Minimize2 = "chop-icon__minimize-2",
412
- Minus = "chop-icon__minus",
413
- MinusCircle = "chop-icon__minus-circle",
414
- MinusSquare = "chop-icon__minus-square",
415
- Monitor = "chop-icon__monitor",
416
- Moon = "chop-icon__moon",
417
- MoreHorizontal = "chop-icon__more-horizontal",
418
- MoreVertical = "chop-icon__more-vertical",
419
- MousePointer = "chop-icon__mouse-pointer",
420
- Move = "chop-icon__move",
421
- Music = "chop-icon__music",
422
- Navigation = "chop-icon__navigation",
423
- Navigation2 = "chop-icon__navigation-2",
424
- Octagon = "chop-icon__octagon",
425
- Package = "chop-icon__package",
426
- Paperclip = "chop-icon__paperclip",
427
- Pause = "chop-icon__pause",
428
- PauseCircle = "chop-icon__pause-circle",
429
- PenTool = "chop-icon__pen-tool",
430
- Percent = "chop-icon__percent",
431
- Phone = "chop-icon__phone",
432
- PhoneCall = "chop-icon__phone-call",
433
- PhoneForwarded = "chop-icon__phone-forwarded",
434
- PhoneIncoming = "chop-icon__phone-incoming",
435
- PhoneMissed = "chop-icon__phone-missed",
436
- PhoneOff = "chop-icon__phone-off",
437
- PhoneOutgoing = "chop-icon__phone-outgoing",
438
- PieChart = "chop-icon__pie-chart",
439
- Play = "chop-icon__play",
440
- PlayCircle = "chop-icon__play-circle",
441
- Plus = "chop-icon__plus",
442
- PlusCircle = "chop-icon__plus-circle",
443
- PlusSquare = "chop-icon__plus-square",
444
- Pocket = "chop-icon__pocket",
445
- Power = "chop-icon__power",
446
- Printer = "chop-icon__printer",
447
- Radio = "chop-icon__radio",
448
- RefreshCcw = "chop-icon__refresh-ccw",
449
- RefreshCw = "chop-icon__refresh-cw",
450
- Repeat = "chop-icon__repeat",
451
- Rewind = "chop-icon__rewind",
452
- RotateCcw = "chop-icon__rotate-ccw",
453
- RotateCw = "chop-icon__rotate-cw",
454
- Rss = "chop-icon__rss",
455
- Save = "chop-icon__save",
456
- Scissors = "chop-icon__scissors",
457
- Search = "chop-icon__search",
458
- Send = "chop-icon__send",
459
- Server = "chop-icon__server",
460
- Settings = "chop-icon__settings",
461
- Share = "chop-icon__share",
462
- Share2 = "chop-icon__share-2",
463
- Shield = "chop-icon__shield",
464
- ShieldOff = "chop-icon__shield-off",
465
- ShoppingBag = "chop-icon__shopping-bag",
466
- ShoppingCart = "chop-icon__shopping-cart",
467
- Shuffle = "chop-icon__shuffle",
468
- Sidebar = "chop-icon__sidebar",
469
- SkipBack = "chop-icon__skip-back",
470
- SkipForward = "chop-icon__skip-forward",
471
- Slack = "chop-icon__slack",
472
- Slash = "chop-icon__slash",
473
- Sliders = "chop-icon__sliders",
474
- Smartphone = "chop-icon__smartphone",
475
- Smile = "chop-icon__smile",
476
- Speaker = "chop-icon__speaker",
477
- Square = "chop-icon__square",
478
- Star = "chop-icon__star",
479
- StopCircle = "chop-icon__stop-circle",
480
- Sun = "chop-icon__sun",
481
- Sunrise = "chop-icon__sunrise",
482
- Sunset = "chop-icon__sunset",
483
- Tablet = "chop-icon__tablet",
484
- Tag = "chop-icon__tag",
485
- Target = "chop-icon__target",
486
- Terminal = "chop-icon__terminal",
487
- Thermometer = "chop-icon__thermometer",
488
- ThumbsDown = "chop-icon__thumbs-down",
489
- ThumbsUp = "chop-icon__thumbs-up",
490
- ToggleLeft = "chop-icon__toggle-left",
491
- ToggleRight = "chop-icon__toggle-right",
492
- Tool = "chop-icon__tool",
493
- Trash = "chop-icon__trash",
494
- Trash2 = "chop-icon__trash-2",
495
- Trello = "chop-icon__trello",
496
- TrendingDown = "chop-icon__trending-down",
497
- TrendingUp = "chop-icon__trending-up",
498
- Triangle = "chop-icon__triangle",
499
- Truck = "chop-icon__truck",
500
- Tv = "chop-icon__tv",
501
- Twitch = "chop-icon__twitch",
502
- Twitter = "chop-icon__twitter",
503
- Type = "chop-icon__type",
504
- Umbrella = "chop-icon__umbrella",
505
- Underline = "chop-icon__underline",
506
- Unlock = "chop-icon__unlock",
507
- Upload = "chop-icon__upload",
508
- UploadCloud = "chop-icon__upload-cloud",
509
- User = "chop-icon__user",
510
- UserCheck = "chop-icon__user-check",
511
- UserMinus = "chop-icon__user-minus",
512
- UserPlus = "chop-icon__user-plus",
513
- UserX = "chop-icon__user-x",
514
- Users = "chop-icon__users",
515
- Video = "chop-icon__video",
516
- VideoOff = "chop-icon__video-off",
517
- Voicemail = "chop-icon__voicemail",
518
- Volume = "chop-icon__volume",
519
- Volume1 = "chop-icon__volume-1",
520
- Volume2 = "chop-icon__volume-2",
521
- VolumeX = "chop-icon__volume-x",
522
- Watch = "chop-icon__watch",
523
- Wifi = "chop-icon__wifi",
524
- WifiOff = "chop-icon__wifi-off",
525
- Wind = "chop-icon__wind",
526
- X = "chop-icon__x",
527
- XCircle = "chop-icon__x-circle",
528
- XOctagon = "chop-icon__x-octagon",
529
- XSquare = "chop-icon__x-square",
530
- Youtube = "chop-icon__youtube",
531
- Zap = "chop-icon__zap",
532
- ZapOff = "chop-icon__zap-off",
533
- ZoomIn = "chop-icon__zoom-in",
534
- ZoomOut = "chop-icon__zoom-out"
535
- }
536
-
537
- declare interface IconProps extends ChopLogicComponentProps {
538
- name?: IconName;
539
- testId?: string;
540
- hidden?: boolean;
541
- size?: ElementSize;
542
- }
543
-
544
- declare const Image_2: FC<ImageProps & {
545
- caption?: string;
546
- }>;
547
- export { Image_2 as Image }
548
-
549
- export declare interface ImageProps {
550
- src: string;
551
- alt: string;
552
- sources?: ImageSource[];
553
- sizes?: string;
554
- caption?: string;
555
- width?: number | string;
556
- height?: number | string;
557
- aspectRatio?: string;
558
- loading?: 'lazy' | 'eager';
559
- decoding?: 'sync' | 'async' | 'auto';
560
- className?: string;
561
- decorative?: boolean;
562
- onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
563
- }
564
-
565
- export declare interface ImageSource {
566
- src: string;
567
- descriptor?: string;
568
- media?: string;
569
- type?: string;
570
- }
571
-
572
- export declare const Input: ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
573
- children?: ReactNode | undefined;
574
- } & RefAttributes<HTMLInputElement>>;
575
-
576
- export declare const Label: FC<LabelProps>;
577
-
578
- declare type LabelProps = {
579
- label: string;
580
- required: boolean;
581
- inputId: string;
582
- isTextHidden?: boolean;
583
- icon?: IconName;
584
- iconPosition?: 'left' | 'right';
585
- iconSize?: ElementSize;
586
- disabled?: boolean;
587
- className?: string;
588
- testId?: string;
589
- };
590
-
591
- export declare const Link: FC<LinkProps>;
592
-
593
- export declare interface LinkProps extends PropsWithChildren, AnchorHTMLAttributes<HTMLAnchorElement> {
594
- href: string;
595
- icon?: IconName;
596
- iconPosition?: 'left' | 'right';
597
- external?: boolean;
598
- disabled?: boolean;
599
- }
600
-
601
- export declare interface LoaderProps extends ChopLogicComponentProps, HTMLAttributes<HTMLSpanElement> {
602
- view?: LoaderView;
603
- }
604
-
605
- export declare enum LoaderView {
606
- Dots = "dots",
607
- Brackets = "brackets",
608
- Linear = "linear",
609
- Square = "square",
610
- Circle = "circle",
611
- Pulse = "pulse",
612
- Arrow = "arrow",
613
- Filler = "filler",
614
- Rotation = "rotation"
615
- }
616
-
617
- export declare const Menu: FC<MenuProps>;
618
-
619
- export declare interface MenuItem {
620
- label: string;
621
- id: string;
622
- nestedItems?: MenuItem[];
623
- icon?: IconName;
624
- link?: string;
625
- onClick?: () => void;
626
- onHover?: () => void;
627
- onFocus?: () => void;
628
- }
629
-
630
- export declare interface MenuProps extends ChopLogicComponentProps {
631
- items: MenuItem[];
632
- mode?: OrientationMode;
633
- openedOn?: 'hover' | 'click';
634
- }
635
-
636
- declare type ModalFocusTrapParams = {
637
- modalRef: RefObject<HTMLElement | null>;
638
- isOpened: boolean;
639
- };
640
-
641
- export declare const MultiSelect: FC<MultiSelectProps>;
642
-
643
- export declare interface MultiSelectProps extends ChopLogicInputProps {
644
- options: SelectValue[];
645
- onChange?: (values?: SelectValue[]) => void;
646
- defaultValue?: string | number | readonly string[];
647
- placeholder?: string;
648
- }
649
-
650
- export declare type MultiSelectValue = SelectValue & {
651
- selected: boolean;
652
- };
653
-
654
- /**
655
- * NumericInput component factory
656
- * Renders either a stateful or stateless component
657
- * based on the `stateless` prop.
658
- */
659
- export declare const NumericInput: FC<NumericInputProps>;
660
-
661
- export declare interface NumericInputProps extends ChopLogicInputProps {
662
- errorMessage?: string;
663
- validator?: NumericInputValidator;
664
- hasSpinButtons?: boolean;
665
- min?: number;
666
- max?: number;
667
- step?: number;
668
- readOnly?: boolean;
669
- defaultValue?: number;
670
- stateless?: boolean;
671
- value?: number;
672
- onIncrement?: () => void;
673
- onDecrement?: () => void;
674
- onChange?: ChangeEventHandler<HTMLInputElement>;
675
- onBlur?: FocusEventHandler<HTMLInputElement>;
676
- onFocus?: FocusEventHandler<HTMLInputElement>;
677
- }
678
-
679
- export declare type NumericInputValidator = (input?: number) => boolean;
680
-
681
- export declare enum OrientationMode {
682
- Vertical = "vertical",
683
- Horizontal = "horizontal"
684
- }
685
-
686
- export declare const Portal: ({ children }: {
687
- children: ReactElement;
688
- }) => ReactPortal;
689
-
690
- export declare type RenderDataItemCallback = (item: GridItem, field: string) => ReactElement;
691
-
692
- export declare const Search: FC<SearchProps>;
693
-
694
- export declare interface SearchProps extends ChopLogicInputProps {
695
- maxLength?: number;
696
- minLength?: number;
697
- placeholder?: string;
698
- autoComplete?: HTMLInputAutoCompleteAttribute;
699
- clearable?: boolean;
700
- spellCheck?: boolean;
701
- searchMode?: 'automatic' | 'manual';
702
- onSearch?: (searchTerm: string) => void;
703
- onClear?: () => void;
704
- onBlur?: FocusEventHandler<HTMLInputElement>;
705
- onFocus?: FocusEventHandler<HTMLInputElement>;
706
- debounceDelay?: number;
707
- }
708
-
709
- export declare const Select: FC<SelectProps>;
710
-
711
- export declare interface SelectProps extends ChopLogicInputProps {
712
- options: SelectValue[];
713
- onChange?: (value?: SelectValue) => void;
714
- placeholder?: string;
715
- defaultValue?: string | number | readonly string[];
716
- }
717
-
718
- export declare type SelectValue = {
719
- id: string;
720
- label: string;
721
- } & {
722
- [key in string]: unknown;
723
- };
724
-
725
- export declare enum SemanticColor {
726
- Default = "default",
727
- Info = "info",
728
- Success = "success",
729
- Warning = "warning",
730
- Danger = "danger"
731
- }
732
-
733
- export declare const Switch: FC<SwitchProps>;
734
-
735
- export declare interface SwitchProps {
736
- checked?: boolean;
737
- onChange?: (checked: boolean) => void;
738
- value?: string;
739
- hasIndicator?: boolean;
740
- label: string;
741
- name: string;
742
- disabled?: boolean;
743
- id?: string;
744
- className?: string;
745
- style?: CSSProperties;
746
- }
747
-
748
- export declare const Tabs: FC<TabsProps>;
749
-
750
- export declare interface TabsProps extends ChopLogicComponentProps {
751
- tabs: ChopLogicTabItem[];
752
- defaultTabId?: string;
753
- mode?: OrientationMode;
754
- stretched?: boolean;
755
- editable?: boolean;
756
- extendable?: boolean;
757
- extendedTabLabel?: string;
758
- extendedTabContent?: ReactElement;
759
- onTabTitleChange?: (tabId: string, newTitle: string) => void;
760
- onTabAdd?: () => void;
761
- onTabSelect?: (id: string) => void;
762
- onTabDelete?: (id: string) => void;
763
- }
764
-
765
- /**
766
- * TextInput component factory
767
- * Renders either a stateful or stateless component
768
- * based on the `stateless` prop.
769
- */
770
- export declare const TextInput: FC<TextInputProps>;
771
-
772
- export declare interface TextInputProps extends ChopLogicInputProps {
773
- errorMessage?: string;
774
- clearable?: boolean;
775
- readOnly?: boolean;
776
- type?: 'text' | 'email' | 'password';
777
- validator?: ChopLogicRegExpWithFlags | TextInputValidator;
778
- maxLength?: number;
779
- placeholder?: string;
780
- defaultValue?: string;
781
- autoComplete?: HTMLInputAutoCompleteAttribute;
782
- onClear?: () => void;
783
- onChange?: ChangeEventHandler<HTMLInputElement>;
784
- onBlur?: FocusEventHandler<HTMLInputElement>;
785
- onFocus?: FocusEventHandler<HTMLInputElement>;
786
- }
787
-
788
- export declare type TextInputValidator = (input: string) => boolean;
789
-
790
- export declare const ThemeContext: Context< {
791
- mode?: ThemeMode;
792
- setMode: (mode: ThemeMode) => void;
793
- }>;
794
-
795
- declare type ThemeMode = typeof CL_LIGHT_THEME_CLASS | typeof CL_DARK_THEME_CLASS;
796
-
797
- declare type ThemeMode_2 = typeof CL_LIGHT_THEME_CLASS | typeof CL_DARK_THEME_CLASS;
798
-
799
- export declare const ThemeProvider: FC<{
800
- children: ReactNode;
801
- injectedMode?: ThemeMode_2;
802
- }>;
803
-
804
- export declare const Tooltip: FC<TooltipProps>;
805
-
806
- export declare enum TooltipContainer {
807
- Span = "span",
808
- Div = "div",
809
- P = "p",
810
- Strong = "strong",
811
- Em = "em"
812
- }
813
-
814
- export declare interface TooltipProps extends PropsWithChildren, ChopLogicComponentProps {
815
- tooltipContent: string | ReactElement;
816
- containerTag?: TooltipContainer;
817
- visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
818
- autoClose?: boolean;
819
- autoCloseDelay?: number;
820
- color?: SemanticColor;
821
- }
822
-
823
- export declare const useAutoClose: ({ isOpened, onClose, autoClose, autoCloseDelay, }: {
824
- isOpened: boolean;
825
- onClose: () => void;
826
- autoClose?: boolean;
827
- autoCloseDelay?: number;
828
- }) => void;
829
-
830
- export declare const useClickOutside: ({ ref, onClickOutsideHandler, dependentRef, }: UseClickOutsideParams) => void;
831
-
832
- declare type UseClickOutsideParams = {
833
- ref: RefObject<HTMLElement | null>;
834
- onClickOutsideHandler: () => void;
835
- dependentRef?: RefObject<HTMLElement | null>;
836
- };
837
-
838
- export declare const useContainerDimensions: ({ ref, isVisible, }: useContainerDimensionsParams) => Dimensions;
839
-
840
- declare type useContainerDimensionsParams = {
841
- ref: RefObject<HTMLElement | null>;
842
- isVisible?: boolean;
843
- };
844
-
845
- export declare const useDebounce: <T>(value: T, delay: number) => T;
846
-
847
- export declare function useElementIds(id?: string): {
848
- elementId: string;
849
- errorId: string;
850
- dropdownId: string;
851
- };
852
-
853
- export declare function useIsHovered(ref: RefObject<HTMLElement | null>, isMounted?: boolean): boolean;
854
-
855
- export declare const useIsMounted: (isOpened: boolean, delay?: number) => boolean;
856
-
857
- export declare const useIsOverflow: ({ ref, dimension, isMounted, }: {
858
- ref: RefObject<HTMLElement | null>;
859
- dimension: "width" | "height";
860
- isMounted?: boolean;
861
- }) => boolean;
862
-
863
- export declare const useKeyPress: ({ ref, keyCode, onKeyPress }: useKeyPressParams) => void;
864
-
865
- declare type useKeyPressParams = {
866
- keyCode: string;
867
- ref: RefObject<HTMLElement | null>;
868
- onKeyPress: () => void;
869
- };
870
-
871
- export declare const useModalFocusTrap: ({ modalRef, isOpened }: ModalFocusTrapParams) => void;
872
-
873
- export declare function useRemainingTimer({ isOpened, isHovered, onClose, autoClose, autoCloseDelay, }: UseRemainingTimerProps): number;
874
-
875
- declare type UseRemainingTimerProps = {
876
- isOpened: boolean;
877
- isHovered: boolean;
878
- onClose: () => void;
879
- autoClose?: boolean;
880
- autoCloseDelay?: number;
881
- };
882
-
883
- export declare const useResetFormInput: (onReset: () => void) => void;
884
-
885
- export declare const useTheme: () => {
886
- mode?: "cl-components-light-theme" | "cl-components-dark-theme";
887
- setMode: (mode: "cl-components-light-theme" | "cl-components-dark-theme") => void;
888
- };
889
-
890
- export declare const useTooltipPosition: ({ wrapperRef, tooltipRef, isOpened, spacing, }: useTooltipPositionParams) => {
891
- top: number;
892
- left: number;
893
- };
894
-
895
- declare type useTooltipPositionParams = {
896
- wrapperRef: RefObject<HTMLElement | null>;
897
- tooltipRef: RefObject<HTMLElement | null>;
898
- isOpened: boolean;
899
- spacing?: number;
900
- };
901
-
902
- export declare function useWindowDimensions(): Dimensions;
903
-
904
- export declare function withErrorBoundary<P extends object>(ComponentToWrap: ComponentType<P>): FC<P & WithErrorBoundaryProps>;
905
-
906
- export declare type WithErrorBoundaryProps = {
907
- errorMessage?: string;
908
- onError?: () => void;
909
- };
910
-
911
- export declare function withFigureCaption<P extends object>(Component: ComponentType<P>): FC<P & WithFigureCaptionProps>;
912
-
913
- declare type WithFigureCaptionProps = {
914
- caption?: string;
915
- };
916
-
917
- export declare function withTooltip<P extends object>(Component: ComponentType<P>): FC<P & WithTooltipProps>;
918
-
919
- declare type WithTooltipProps = {
920
- tooltip?: string;
921
- visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
922
- };
923
-
924
- export { }
1
+ export * from './main'
2
+ export {}