@delightui/components 0.1.110 → 0.1.111

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 (33) hide show
  1. package/dist/cjs/components/molecules/Search/Search.d.ts +18 -0
  2. package/dist/cjs/components/molecules/Search/Search.presenter.d.ts +320 -0
  3. package/dist/cjs/components/molecules/Search/Search.types.d.ts +53 -0
  4. package/dist/cjs/components/molecules/Search/index.d.ts +2 -0
  5. package/dist/cjs/components/molecules/index.d.ts +2 -0
  6. package/dist/cjs/components/utils/RenderStateView/RenderStateView.types.d.ts +4 -0
  7. package/dist/cjs/components/utils/RenderStateView/usePresenter.d.ts +1 -0
  8. package/dist/cjs/components/utils/index.d.ts +2 -0
  9. package/dist/cjs/components/utils/useDebounce/index.d.ts +1 -0
  10. package/dist/cjs/components/utils/useDebounce/useDebounce.d.ts +10 -0
  11. package/dist/cjs/library.css +66 -0
  12. package/dist/cjs/library.js +3 -3
  13. package/dist/cjs/library.js.map +1 -1
  14. package/dist/esm/components/molecules/Search/Search.d.ts +18 -0
  15. package/dist/esm/components/molecules/Search/Search.presenter.d.ts +320 -0
  16. package/dist/esm/components/molecules/Search/Search.types.d.ts +53 -0
  17. package/dist/esm/components/molecules/Search/index.d.ts +2 -0
  18. package/dist/esm/components/molecules/index.d.ts +2 -0
  19. package/dist/esm/components/utils/RenderStateView/RenderStateView.types.d.ts +4 -0
  20. package/dist/esm/components/utils/RenderStateView/usePresenter.d.ts +1 -0
  21. package/dist/esm/components/utils/index.d.ts +2 -0
  22. package/dist/esm/components/utils/useDebounce/index.d.ts +1 -0
  23. package/dist/esm/components/utils/useDebounce/useDebounce.d.ts +10 -0
  24. package/dist/esm/library.css +66 -0
  25. package/dist/esm/library.js +3 -3
  26. package/dist/esm/library.js.map +1 -1
  27. package/dist/index.d.ts +86 -1
  28. package/docs/README.md +6 -0
  29. package/docs/components/atoms/Input.md +0 -63
  30. package/docs/components/molecules/Search.md +710 -0
  31. package/docs/components/utils/RenderStateView.md +137 -38
  32. package/docs/components/utils/useDebounce.md +576 -0
  33. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Search component with auto and manual search modes
3
+ *
4
+ * @param props - The search component props
5
+ * @param ref - Forward ref to the input element
6
+ * @returns Search component
7
+ */
8
+ declare const Search: import("react").ForwardRefExoticComponent<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "value" | "type"> & import("../FormField/FormField.types").ControlledFormComponentProps<string> & {
9
+ style?: import("./Search.types").SearchStyleEnum;
10
+ onSearch: import("./Search.types").SearchCallback;
11
+ debounceMs?: number;
12
+ minCharacters?: number;
13
+ showSubmitButton?: boolean;
14
+ showClearButton?: boolean;
15
+ loading?: boolean;
16
+ 'component-variant'?: string;
17
+ } & import("react").RefAttributes<HTMLInputElement>>;
18
+ export default Search;
@@ -0,0 +1,320 @@
1
+ import { SearchProps } from './Search.types';
2
+ /**
3
+ * Custom hook that manages the search component logic and state
4
+ * @param props - The search component props
5
+ * @returns Object containing component state and handlers
6
+ */
7
+ declare const useSearchPresenter: (props: SearchProps) => {
8
+ controlledValue: string | undefined;
9
+ isSearching: boolean;
10
+ searchDisabled: boolean;
11
+ handleInputChange: (newValue: string) => void;
12
+ handleSubmit: () => void;
13
+ handleClear: () => void;
14
+ handleKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
15
+ showClearButton: number | undefined;
16
+ isAutoStyle: boolean;
17
+ isButtonStyle: boolean;
18
+ variantProps: {
19
+ 'component-variant': string;
20
+ };
21
+ restProps: {
22
+ className?: string | undefined;
23
+ form?: string | undefined;
24
+ list?: string | undefined;
25
+ role?: import("react").AriaRole | undefined;
26
+ src?: string | undefined;
27
+ onLoad?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
28
+ onError?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
29
+ alt?: string | undefined;
30
+ height?: number | string | undefined;
31
+ width?: number | string | undefined;
32
+ defaultChecked?: boolean | undefined;
33
+ defaultValue?: string | number | readonly string[] | undefined;
34
+ suppressContentEditableWarning?: boolean | undefined;
35
+ suppressHydrationWarning?: boolean | undefined;
36
+ accessKey?: string | undefined;
37
+ autoFocus?: boolean | undefined;
38
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
39
+ contextMenu?: string | undefined;
40
+ dir?: string | undefined;
41
+ draggable?: (boolean | "true" | "false") | undefined;
42
+ hidden?: boolean | undefined;
43
+ id?: string | undefined;
44
+ lang?: string | undefined;
45
+ nonce?: string | undefined;
46
+ slot?: string | undefined;
47
+ spellCheck?: (boolean | "true" | "false") | undefined;
48
+ tabIndex?: number | undefined;
49
+ title?: string | undefined;
50
+ translate?: "yes" | "no" | undefined;
51
+ radioGroup?: string | undefined;
52
+ about?: string | undefined;
53
+ content?: string | undefined;
54
+ datatype?: string | undefined;
55
+ inlist?: any;
56
+ prefix?: string | undefined;
57
+ property?: string | undefined;
58
+ rel?: string | undefined;
59
+ resource?: string | undefined;
60
+ rev?: string | undefined;
61
+ typeof?: string | undefined;
62
+ vocab?: string | undefined;
63
+ autoCapitalize?: string | undefined;
64
+ autoCorrect?: string | undefined;
65
+ autoSave?: string | undefined;
66
+ color?: string | undefined;
67
+ itemProp?: string | undefined;
68
+ itemScope?: boolean | undefined;
69
+ itemType?: string | undefined;
70
+ itemID?: string | undefined;
71
+ itemRef?: string | undefined;
72
+ results?: number | undefined;
73
+ security?: string | undefined;
74
+ unselectable?: "on" | "off" | undefined;
75
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
76
+ is?: string | undefined;
77
+ "aria-activedescendant"?: string | undefined;
78
+ "aria-atomic"?: (boolean | "true" | "false") | undefined;
79
+ "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
80
+ "aria-braillelabel"?: string | undefined;
81
+ "aria-brailleroledescription"?: string | undefined;
82
+ "aria-busy"?: (boolean | "true" | "false") | undefined;
83
+ "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
84
+ "aria-colcount"?: number | undefined;
85
+ "aria-colindex"?: number | undefined;
86
+ "aria-colindextext"?: string | undefined;
87
+ "aria-colspan"?: number | undefined;
88
+ "aria-controls"?: string | undefined;
89
+ "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
90
+ "aria-describedby"?: string | undefined;
91
+ "aria-description"?: string | undefined;
92
+ "aria-details"?: string | undefined;
93
+ "aria-disabled"?: (boolean | "true" | "false") | undefined;
94
+ "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
95
+ "aria-errormessage"?: string | undefined;
96
+ "aria-expanded"?: (boolean | "true" | "false") | undefined;
97
+ "aria-flowto"?: string | undefined;
98
+ "aria-grabbed"?: (boolean | "true" | "false") | undefined;
99
+ "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
100
+ "aria-hidden"?: (boolean | "true" | "false") | undefined;
101
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
102
+ "aria-keyshortcuts"?: string | undefined;
103
+ "aria-label"?: string | undefined;
104
+ "aria-labelledby"?: string | undefined;
105
+ "aria-level"?: number | undefined;
106
+ "aria-live"?: "off" | "assertive" | "polite" | undefined;
107
+ "aria-modal"?: (boolean | "true" | "false") | undefined;
108
+ "aria-multiline"?: (boolean | "true" | "false") | undefined;
109
+ "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
110
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
111
+ "aria-owns"?: string | undefined;
112
+ "aria-placeholder"?: string | undefined;
113
+ "aria-posinset"?: number | undefined;
114
+ "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
115
+ "aria-readonly"?: (boolean | "true" | "false") | undefined;
116
+ "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
117
+ "aria-required"?: (boolean | "true" | "false") | undefined;
118
+ "aria-roledescription"?: string | undefined;
119
+ "aria-rowcount"?: number | undefined;
120
+ "aria-rowindex"?: number | undefined;
121
+ "aria-rowindextext"?: string | undefined;
122
+ "aria-rowspan"?: number | undefined;
123
+ "aria-selected"?: (boolean | "true" | "false") | undefined;
124
+ "aria-setsize"?: number | undefined;
125
+ "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
126
+ "aria-valuemax"?: number | undefined;
127
+ "aria-valuemin"?: number | undefined;
128
+ "aria-valuenow"?: number | undefined;
129
+ "aria-valuetext"?: string | undefined;
130
+ children?: import("react").ReactNode | undefined;
131
+ dangerouslySetInnerHTML?: {
132
+ __html: string | TrustedHTML;
133
+ } | undefined;
134
+ onCopy?: import("react").ClipboardEventHandler<HTMLInputElement> | undefined;
135
+ onCopyCapture?: import("react").ClipboardEventHandler<HTMLInputElement> | undefined;
136
+ onCut?: import("react").ClipboardEventHandler<HTMLInputElement> | undefined;
137
+ onCutCapture?: import("react").ClipboardEventHandler<HTMLInputElement> | undefined;
138
+ onPaste?: import("react").ClipboardEventHandler<HTMLInputElement> | undefined;
139
+ onPasteCapture?: import("react").ClipboardEventHandler<HTMLInputElement> | undefined;
140
+ onCompositionEnd?: import("react").CompositionEventHandler<HTMLInputElement> | undefined;
141
+ onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLInputElement> | undefined;
142
+ onCompositionStart?: import("react").CompositionEventHandler<HTMLInputElement> | undefined;
143
+ onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLInputElement> | undefined;
144
+ onCompositionUpdate?: import("react").CompositionEventHandler<HTMLInputElement> | undefined;
145
+ onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLInputElement> | undefined;
146
+ onFocus?: import("react").FocusEventHandler<HTMLInputElement> | undefined;
147
+ onFocusCapture?: import("react").FocusEventHandler<HTMLInputElement> | undefined;
148
+ onBlur?: import("react").FocusEventHandler<HTMLInputElement> | undefined;
149
+ onBlurCapture?: import("react").FocusEventHandler<HTMLInputElement> | undefined;
150
+ onChange?: import("react").ChangeEventHandler<HTMLInputElement> | undefined;
151
+ onChangeCapture?: import("react").FormEventHandler<HTMLInputElement> | undefined;
152
+ onBeforeInput?: import("react").FormEventHandler<HTMLInputElement> | undefined;
153
+ onBeforeInputCapture?: import("react").FormEventHandler<HTMLInputElement> | undefined;
154
+ onInput?: import("react").FormEventHandler<HTMLInputElement> | undefined;
155
+ onInputCapture?: import("react").FormEventHandler<HTMLInputElement> | undefined;
156
+ onReset?: import("react").FormEventHandler<HTMLInputElement> | undefined;
157
+ onResetCapture?: import("react").FormEventHandler<HTMLInputElement> | undefined;
158
+ onSubmit?: import("react").FormEventHandler<HTMLInputElement> | undefined;
159
+ onSubmitCapture?: import("react").FormEventHandler<HTMLInputElement> | undefined;
160
+ onInvalid?: import("react").FormEventHandler<HTMLInputElement> | undefined;
161
+ onInvalidCapture?: import("react").FormEventHandler<HTMLInputElement> | undefined;
162
+ onLoadCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
163
+ onErrorCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
164
+ onKeyDown?: import("react").KeyboardEventHandler<HTMLInputElement> | undefined;
165
+ onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLInputElement> | undefined;
166
+ onKeyPress?: import("react").KeyboardEventHandler<HTMLInputElement> | undefined;
167
+ onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLInputElement> | undefined;
168
+ onKeyUp?: import("react").KeyboardEventHandler<HTMLInputElement> | undefined;
169
+ onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLInputElement> | undefined;
170
+ onAbort?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
171
+ onAbortCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
172
+ onCanPlay?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
173
+ onCanPlayCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
174
+ onCanPlayThrough?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
175
+ onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
176
+ onDurationChange?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
177
+ onDurationChangeCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
178
+ onEmptied?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
179
+ onEmptiedCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
180
+ onEncrypted?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
181
+ onEncryptedCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
182
+ onEnded?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
183
+ onEndedCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
184
+ onLoadedData?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
185
+ onLoadedDataCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
186
+ onLoadedMetadata?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
187
+ onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
188
+ onLoadStart?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
189
+ onLoadStartCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
190
+ onPause?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
191
+ onPauseCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
192
+ onPlay?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
193
+ onPlayCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
194
+ onPlaying?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
195
+ onPlayingCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
196
+ onProgress?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
197
+ onProgressCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
198
+ onRateChange?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
199
+ onRateChangeCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
200
+ onResize?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
201
+ onResizeCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
202
+ onSeeked?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
203
+ onSeekedCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
204
+ onSeeking?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
205
+ onSeekingCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
206
+ onStalled?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
207
+ onStalledCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
208
+ onSuspend?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
209
+ onSuspendCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
210
+ onTimeUpdate?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
211
+ onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
212
+ onVolumeChange?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
213
+ onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
214
+ onWaiting?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
215
+ onWaitingCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
216
+ onAuxClick?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
217
+ onAuxClickCapture?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
218
+ onClick?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
219
+ onClickCapture?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
220
+ onContextMenu?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
221
+ onContextMenuCapture?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
222
+ onDoubleClick?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
223
+ onDoubleClickCapture?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
224
+ onDrag?: import("react").DragEventHandler<HTMLInputElement> | undefined;
225
+ onDragCapture?: import("react").DragEventHandler<HTMLInputElement> | undefined;
226
+ onDragEnd?: import("react").DragEventHandler<HTMLInputElement> | undefined;
227
+ onDragEndCapture?: import("react").DragEventHandler<HTMLInputElement> | undefined;
228
+ onDragEnter?: import("react").DragEventHandler<HTMLInputElement> | undefined;
229
+ onDragEnterCapture?: import("react").DragEventHandler<HTMLInputElement> | undefined;
230
+ onDragExit?: import("react").DragEventHandler<HTMLInputElement> | undefined;
231
+ onDragExitCapture?: import("react").DragEventHandler<HTMLInputElement> | undefined;
232
+ onDragLeave?: import("react").DragEventHandler<HTMLInputElement> | undefined;
233
+ onDragLeaveCapture?: import("react").DragEventHandler<HTMLInputElement> | undefined;
234
+ onDragOver?: import("react").DragEventHandler<HTMLInputElement> | undefined;
235
+ onDragOverCapture?: import("react").DragEventHandler<HTMLInputElement> | undefined;
236
+ onDragStart?: import("react").DragEventHandler<HTMLInputElement> | undefined;
237
+ onDragStartCapture?: import("react").DragEventHandler<HTMLInputElement> | undefined;
238
+ onDrop?: import("react").DragEventHandler<HTMLInputElement> | undefined;
239
+ onDropCapture?: import("react").DragEventHandler<HTMLInputElement> | undefined;
240
+ onMouseDown?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
241
+ onMouseDownCapture?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
242
+ onMouseEnter?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
243
+ onMouseLeave?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
244
+ onMouseMove?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
245
+ onMouseMoveCapture?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
246
+ onMouseOut?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
247
+ onMouseOutCapture?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
248
+ onMouseOver?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
249
+ onMouseOverCapture?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
250
+ onMouseUp?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
251
+ onMouseUpCapture?: import("react").MouseEventHandler<HTMLInputElement> | undefined;
252
+ onSelect?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
253
+ onSelectCapture?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
254
+ onTouchCancel?: import("react").TouchEventHandler<HTMLInputElement> | undefined;
255
+ onTouchCancelCapture?: import("react").TouchEventHandler<HTMLInputElement> | undefined;
256
+ onTouchEnd?: import("react").TouchEventHandler<HTMLInputElement> | undefined;
257
+ onTouchEndCapture?: import("react").TouchEventHandler<HTMLInputElement> | undefined;
258
+ onTouchMove?: import("react").TouchEventHandler<HTMLInputElement> | undefined;
259
+ onTouchMoveCapture?: import("react").TouchEventHandler<HTMLInputElement> | undefined;
260
+ onTouchStart?: import("react").TouchEventHandler<HTMLInputElement> | undefined;
261
+ onTouchStartCapture?: import("react").TouchEventHandler<HTMLInputElement> | undefined;
262
+ onPointerDown?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
263
+ onPointerDownCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
264
+ onPointerMove?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
265
+ onPointerMoveCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
266
+ onPointerUp?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
267
+ onPointerUpCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
268
+ onPointerCancel?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
269
+ onPointerCancelCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
270
+ onPointerEnter?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
271
+ onPointerLeave?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
272
+ onPointerOver?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
273
+ onPointerOverCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
274
+ onPointerOut?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
275
+ onPointerOutCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
276
+ onGotPointerCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
277
+ onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
278
+ onLostPointerCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
279
+ onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLInputElement> | undefined;
280
+ onScroll?: import("react").UIEventHandler<HTMLInputElement> | undefined;
281
+ onScrollCapture?: import("react").UIEventHandler<HTMLInputElement> | undefined;
282
+ onWheel?: import("react").WheelEventHandler<HTMLInputElement> | undefined;
283
+ onWheelCapture?: import("react").WheelEventHandler<HTMLInputElement> | undefined;
284
+ onAnimationStart?: import("react").AnimationEventHandler<HTMLInputElement> | undefined;
285
+ onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLInputElement> | undefined;
286
+ onAnimationEnd?: import("react").AnimationEventHandler<HTMLInputElement> | undefined;
287
+ onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLInputElement> | undefined;
288
+ onAnimationIteration?: import("react").AnimationEventHandler<HTMLInputElement> | undefined;
289
+ onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLInputElement> | undefined;
290
+ onTransitionEnd?: import("react").TransitionEventHandler<HTMLInputElement> | undefined;
291
+ onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLInputElement> | undefined;
292
+ disabled?: boolean | undefined;
293
+ pattern?: string | undefined;
294
+ required?: boolean | undefined;
295
+ checked?: boolean | undefined;
296
+ size?: number | undefined;
297
+ step?: number | string | undefined;
298
+ autoComplete?: import("react").HTMLInputAutoCompleteAttribute | undefined;
299
+ name?: string | undefined;
300
+ accept?: string | undefined;
301
+ capture?: boolean | "user" | "environment" | undefined;
302
+ enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
303
+ formAction?: string | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS] | undefined;
304
+ formEncType?: string | undefined;
305
+ formMethod?: string | undefined;
306
+ formNoValidate?: boolean | undefined;
307
+ formTarget?: string | undefined;
308
+ max?: number | string | undefined;
309
+ maxLength?: number | undefined;
310
+ min?: number | string | undefined;
311
+ minLength?: number | undefined;
312
+ multiple?: boolean | undefined;
313
+ placeholder?: string | undefined;
314
+ readOnly?: boolean | undefined;
315
+ invalid?: boolean;
316
+ showSubmitButton?: boolean;
317
+ showClearButton?: boolean;
318
+ };
319
+ };
320
+ export default useSearchPresenter;
@@ -0,0 +1,53 @@
1
+ import type { InputHTMLAttributes } from 'react';
2
+ import { ControlledFormComponentProps } from '../FormField/FormField.types';
3
+ /**
4
+ * Enum for different search modes.
5
+ */
6
+ export type SearchStyleEnum = 'Auto' | 'Button';
7
+ /**
8
+ * Search callback function type that receives the search query and returns a promise
9
+ */
10
+ export type SearchCallback = (query: string) => Promise<void>;
11
+ /**
12
+ * Props for the Search component
13
+ */
14
+ export type SearchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value'> & ControlledFormComponentProps<string> & {
15
+ /**
16
+ * The search style - 'Auto' for debounced search on input, 'Button' for search on enter/submit
17
+ * @default 'Auto'
18
+ */
19
+ style?: SearchStyleEnum;
20
+ /**
21
+ * Callback function to handle search with the query string
22
+ */
23
+ onSearch: SearchCallback;
24
+ /**
25
+ * Debounce delay in milliseconds for auto style
26
+ * @default 300
27
+ */
28
+ debounceMs?: number;
29
+ /**
30
+ * Minimum characters required to trigger search in auto style
31
+ * @default 1
32
+ */
33
+ minCharacters?: number;
34
+ /**
35
+ * Show submit button in button style
36
+ * @default true
37
+ */
38
+ showSubmitButton?: boolean;
39
+ /**
40
+ * Show clear button when there is text
41
+ * @default true
42
+ */
43
+ showClearButton?: boolean;
44
+ /**
45
+ * Loading state while search is in progress in auto style
46
+ * @default false
47
+ */
48
+ loading?: boolean;
49
+ /**
50
+ * Provide a way to override the styling
51
+ */
52
+ 'component-variant'?: string;
53
+ };
@@ -0,0 +1,2 @@
1
+ export { default } from './Search';
2
+ export type { SearchProps, SearchStyleEnum as SearchModeEnum, SearchCallback } from './Search.types';
@@ -20,6 +20,7 @@ export { default as ProgressBar } from './ProgressBar';
20
20
  export { default as RadioGroup } from './RadioGroup';
21
21
  export { Option, default as Select } from './Select';
22
22
  export { default as ChipInput } from './ChipInput';
23
+ export { default as Search } from './Search';
23
24
  export * from './Accordion';
24
25
  export * from './ActionCard';
25
26
  export * from './Breadcrumbs';
@@ -42,3 +43,4 @@ export * from './ProgressBar';
42
43
  export * from './RadioGroup';
43
44
  export * from './Select';
44
45
  export * from './ChipInput';
46
+ export * from './Search';
@@ -2,9 +2,13 @@ export type RenderStateViewProps<T = unknown, P = any> = {
2
2
  className?: string;
3
3
  data?: T | null;
4
4
  isLoading?: boolean;
5
+ errorData?: Error | string | null;
5
6
  filled?: React.ComponentType<{
6
7
  data: T;
7
8
  } & P>;
8
9
  empty?: React.ComponentType<P>;
9
10
  loading?: React.ComponentType<P>;
11
+ error?: React.ComponentType<{
12
+ error: Error | string;
13
+ } & P>;
10
14
  };
@@ -1,5 +1,6 @@
1
1
  import { RenderStateViewProps } from "./RenderStateView.types";
2
2
  export declare const usePresenter: <T = unknown, P = any>(props: RenderStateViewProps<T, P>) => {
3
+ showError: boolean;
3
4
  showLoading: boolean;
4
5
  showEmpty: boolean;
5
6
  showFilled: boolean;
@@ -2,6 +2,7 @@ export { ConditionalView } from './ConditionalView';
2
2
  export { WrapTextNodes } from './WrapTextNodes';
3
3
  export { RenderStateView } from './RenderStateView';
4
4
  export { useInflateView } from './useInflateView';
5
+ export { useDebounce } from './useDebounce';
5
6
  export type { AccessibilityActions, AccessibilityProps } from './accessibilityUtils';
6
7
  export { getClickAccessibilityProps } from './accessibilityUtils';
7
8
  export * from './ConditionalView';
@@ -9,3 +10,4 @@ export * from './WrapTextNodes';
9
10
  export * from './RenderStateView';
10
11
  export * from './useInflateView';
11
12
  export * from './utils';
13
+ export * from './useDebounce';
@@ -0,0 +1 @@
1
+ export { useDebounce } from './useDebounce';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Custom hook that debounces a callback function
3
+ * @param callback - The function to debounce
4
+ * @param delay - The debounce delay in milliseconds
5
+ * @returns Object containing the debounced function and a cancel function
6
+ */
7
+ export declare const useDebounce: <T extends (...args: any[]) => void>(callback: T, delay: number) => {
8
+ debouncedCallback: (...args: Parameters<T>) => void;
9
+ cancel: () => void;
10
+ };
@@ -3805,6 +3805,72 @@ span.flatpickr-weekday {
3805
3805
  --checkbox-item-row-gap: var(--chip-input-checkbox-item-row-gap);
3806
3806
  --checkbox-item-column-gap: var(--chip-input-checkbox-item-column-gap);
3807
3807
  }
3808
+ .Search-module_search__ktB-4 {
3809
+ display: flex;
3810
+ height: var(--search-input-height);
3811
+ width: var(--search-input-width);
3812
+ row-gap: var(--search-input-row-gap);
3813
+ -moz-column-gap: var(--search-input-column-gap);
3814
+ column-gap: var(--search-input-column-gap);
3815
+ border-bottom-width: var(--search-input-border-bottom-width);
3816
+ border-left-width: var(--search-input-border-left-width);
3817
+ border-right-width: var(--search-input-border-right-width);
3818
+ border-top-width: var(--search-input-border-top-width);
3819
+ border-style: var(--search-input-border-style);
3820
+ border-color: var(--search-input-border-color);
3821
+ border-top-left-radius: var(--search-input-border-top-left-radius);
3822
+ border-top-right-radius: var(--search-input-border-top-right-radius);
3823
+ border-bottom-right-radius: var(--search-input-border-bottom-right-radius);
3824
+ border-bottom-left-radius: var(--search-input-border-bottom-left-radius);
3825
+ background-color: var(--search-input-background-color);
3826
+ color: var(--search-input-color);
3827
+ }
3828
+ .Search-module_search__ktB-4 .Search-module_searchElement__YebtI {
3829
+ flex: 1;
3830
+ width: 100%;
3831
+ height: 100%;
3832
+ padding-top: calc(var(--search-input-padding-top) - var(--search-input-border-top-width));
3833
+ padding-bottom: calc(var(--search-input-padding-bottom) - var(--search-input-border-bottom-width));
3834
+ padding-left: calc(var(--search-input-padding-left) - var(--search-input-border-left-width));
3835
+ padding-right: calc(var(--search-input-padding-right) - var(--search-input-border-right-width));
3836
+ font-family: var(--search-input-font-family);
3837
+ font-weight: var(--search-input-font-weight);
3838
+ font-size: var(--search-input-font-size);
3839
+ letter-spacing: var(--search-input-letter-spacing);
3840
+ line-height: var(--search-input-line-height);
3841
+ color: var(--search-input-color);
3842
+ }
3843
+ .Search-module_search__ktB-4 .Search-module_searchElement__YebtI::-moz-placeholder {
3844
+ font-family: var(--search-input-font-family);
3845
+ font-weight: var(--search-input-font-weight);
3846
+ font-size: var(--search-input-font-size);
3847
+ letter-spacing: var(--search-input-letter-spacing);
3848
+ line-height: var(--search-input-line-height);
3849
+ color: var(--search-input-color);
3850
+ opacity: 0.6;
3851
+ }
3852
+ .Search-module_search__ktB-4 .Search-module_searchElement__YebtI::placeholder {
3853
+ font-family: var(--search-input-font-family);
3854
+ font-weight: var(--search-input-font-weight);
3855
+ font-size: var(--search-input-font-size);
3856
+ letter-spacing: var(--search-input-letter-spacing);
3857
+ line-height: var(--search-input-line-height);
3858
+ color: var(--search-input-color);
3859
+ opacity: 0.6;
3860
+ }
3861
+ .Search-module_search__ktB-4 .Search-module_trailingIcon__VG0Ug {
3862
+ padding-right: var(--search-input-column-gap);
3863
+ align-self: center;
3864
+ }
3865
+ .Search-module_search__ktB-4 .Search-module_leadingIcon__2z4Gk {
3866
+ padding-left: var(--search-input-column-gap);
3867
+ align-self: center;
3868
+ }
3869
+ .Search-module_search__ktB-4 .Search-module_trailingContainer__LhQ3B {
3870
+ display: flex;
3871
+ align-items: center;
3872
+ gap: var(--search-input-column-gap);
3873
+ }
3808
3874
  .Dropzone-module_dropzone__4uDyI {
3809
3875
  width: var(--dropzone-width);
3810
3876
  }