@digvation/ui 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/index.cjs +4477 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +977 -0
- package/dist/index.d.ts +977 -0
- package/dist/index.js +4397 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +64 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,977 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, FormHTMLAttributes, ChangeEvent, RefObject, TextareaHTMLAttributes, ReactElement, AnchorHTMLAttributes } from 'react';
|
|
4
|
+
|
|
5
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
6
|
+
|
|
7
|
+
type AlertVariant = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
8
|
+
interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
9
|
+
variant?: AlertVariant;
|
|
10
|
+
title?: ReactNode;
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare function DAlert({ variant, title, icon, className, children, ...props }: AlertProps): react.JSX.Element;
|
|
14
|
+
|
|
15
|
+
type BadgeVariant = 'default' | 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'outline';
|
|
16
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
17
|
+
variant?: BadgeVariant;
|
|
18
|
+
dot?: boolean;
|
|
19
|
+
dotClassName?: string;
|
|
20
|
+
}
|
|
21
|
+
declare function DBadge({ className, variant, dot, dotClassName, children, ...props }: BadgeProps): react.JSX.Element;
|
|
22
|
+
|
|
23
|
+
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'soft' | 'info' | 'success' | 'warning' | 'danger' | 'link';
|
|
24
|
+
type ButtonSize = 'sm' | 'md' | 'lg' | 'icon';
|
|
25
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
26
|
+
variant?: ButtonVariant;
|
|
27
|
+
size?: ButtonSize;
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
leftIcon?: ReactNode;
|
|
30
|
+
rightIcon?: ReactNode;
|
|
31
|
+
fullWidth?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare const DButton: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
34
|
+
|
|
35
|
+
type CardVariant = 'default' | 'outlined' | 'elevated' | 'interactive';
|
|
36
|
+
interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
37
|
+
variant?: CardVariant;
|
|
38
|
+
}
|
|
39
|
+
declare function DCard({ className, variant, ...props }: CardProps): react.JSX.Element;
|
|
40
|
+
declare function DCardHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
41
|
+
declare function DCardContent({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
42
|
+
declare function DCardFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
43
|
+
|
|
44
|
+
type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
45
|
+
declare const DCheckbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
46
|
+
|
|
47
|
+
type FloatingPlacement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
|
|
48
|
+
type FloatingScrollBehavior = 'reposition' | 'close' | 'lock';
|
|
49
|
+
|
|
50
|
+
interface DropdownProps {
|
|
51
|
+
trigger: (context: {
|
|
52
|
+
open: boolean;
|
|
53
|
+
}) => ReactNode;
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
placement?: FloatingPlacement;
|
|
56
|
+
matchWidth?: boolean;
|
|
57
|
+
onClose?: () => void;
|
|
58
|
+
closeOnItemClick?: boolean;
|
|
59
|
+
closeOnEsc?: boolean;
|
|
60
|
+
open?: boolean;
|
|
61
|
+
onOpenChange?: (open: boolean) => void;
|
|
62
|
+
contentRole?: 'listbox' | 'menu' | 'dialog';
|
|
63
|
+
className?: string;
|
|
64
|
+
contentClassName?: string;
|
|
65
|
+
/** Disable the generic vertical panel padding when a component owns its inner spacing. */
|
|
66
|
+
contentPadding?: boolean;
|
|
67
|
+
offset?: number;
|
|
68
|
+
minWidth?: number;
|
|
69
|
+
viewportPadding?: number;
|
|
70
|
+
/** Behavior when the page or a scroll ancestor moves while the panel is open. */
|
|
71
|
+
scrollBehavior?: FloatingScrollBehavior;
|
|
72
|
+
}
|
|
73
|
+
declare function DDropdown({ trigger, children, placement, matchWidth, onClose, closeOnItemClick, closeOnEsc, open: controlledOpen, onOpenChange, contentRole, className, contentClassName, contentPadding, offset, minWidth, viewportPadding, scrollBehavior, }: DropdownProps): react.JSX.Element;
|
|
74
|
+
|
|
75
|
+
interface DropdownContextValue {
|
|
76
|
+
close: () => void;
|
|
77
|
+
open: boolean;
|
|
78
|
+
}
|
|
79
|
+
declare const DropdownContext: react.Context<DropdownContextValue | null>;
|
|
80
|
+
declare function useDropdown(): DropdownContextValue;
|
|
81
|
+
declare function useDropdownClose(): (() => void) | null;
|
|
82
|
+
|
|
83
|
+
type InputSize = 'sm' | 'md' | 'lg';
|
|
84
|
+
|
|
85
|
+
interface SelectOption {
|
|
86
|
+
value: string | number;
|
|
87
|
+
label: ReactNode;
|
|
88
|
+
disabled?: boolean;
|
|
89
|
+
}
|
|
90
|
+
declare function selectOptionsFromChildren(children: ReactNode): SelectOption[];
|
|
91
|
+
interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange' | 'value' | 'defaultValue'> {
|
|
92
|
+
label?: ReactNode;
|
|
93
|
+
hint?: ReactNode;
|
|
94
|
+
error?: ReactNode;
|
|
95
|
+
containerClassName?: string;
|
|
96
|
+
options?: readonly SelectOption[];
|
|
97
|
+
children?: ReactNode;
|
|
98
|
+
placeholder?: ReactNode;
|
|
99
|
+
clearable?: boolean;
|
|
100
|
+
/** Compatibility search mode. Prefer DCombobox for autocomplete/async-search UX. */
|
|
101
|
+
searchable?: boolean;
|
|
102
|
+
loading?: boolean;
|
|
103
|
+
emptyMessage?: ReactNode;
|
|
104
|
+
asyncErrorMessage?: ReactNode;
|
|
105
|
+
/** Compatibility async mode. Prefer DCombobox for new async-search flows. */
|
|
106
|
+
fetchOptions?: (search: string) => Promise<readonly SelectOption[]>;
|
|
107
|
+
/** Changing this value causes async options to be requested again when the panel is open. */
|
|
108
|
+
refetchKey?: string | number | boolean | null;
|
|
109
|
+
onFetchError?: (error: unknown) => void;
|
|
110
|
+
value?: string | number | null;
|
|
111
|
+
defaultValue?: string | number | null;
|
|
112
|
+
size?: InputSize;
|
|
113
|
+
debounceMs?: number;
|
|
114
|
+
scrollBehavior?: FloatingScrollBehavior;
|
|
115
|
+
onValueChange?: (value: string | number | null) => void;
|
|
116
|
+
onChange?: (value: string | number | null) => void;
|
|
117
|
+
}
|
|
118
|
+
declare const DSelect: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
119
|
+
|
|
120
|
+
type ComboboxOption = SelectOption;
|
|
121
|
+
interface ComboboxProps {
|
|
122
|
+
label?: ReactNode;
|
|
123
|
+
placeholder?: string;
|
|
124
|
+
options?: readonly SelectOption[];
|
|
125
|
+
value?: string | number | null;
|
|
126
|
+
size?: InputSize;
|
|
127
|
+
onChange?: (value: string | number | null) => void;
|
|
128
|
+
fetchOptions?: (search: string) => Promise<readonly SelectOption[]>;
|
|
129
|
+
refetchKey?: string | number | boolean | null;
|
|
130
|
+
onFetchError?: (error: unknown) => void;
|
|
131
|
+
asyncErrorMessage?: ReactNode;
|
|
132
|
+
error?: ReactNode;
|
|
133
|
+
hint?: ReactNode;
|
|
134
|
+
disabled?: boolean;
|
|
135
|
+
clearable?: boolean;
|
|
136
|
+
containerClassName?: string;
|
|
137
|
+
renderEmpty?: (inputValue: string) => ReactNode;
|
|
138
|
+
allowCreate?: boolean;
|
|
139
|
+
onCreateOption?: (value: string) => void;
|
|
140
|
+
renderCreateOption?: (inputValue: string, onClick: () => void) => ReactNode;
|
|
141
|
+
renderOption?: (option: SelectOption, isSelected: boolean) => ReactNode;
|
|
142
|
+
onSearchChange?: (query: string) => void;
|
|
143
|
+
loading?: boolean;
|
|
144
|
+
idleMessage?: ReactNode;
|
|
145
|
+
ariaLabel?: string;
|
|
146
|
+
debounceMs?: number;
|
|
147
|
+
scrollBehavior?: FloatingScrollBehavior;
|
|
148
|
+
}
|
|
149
|
+
declare function DCombobox({ label, placeholder, options, value, size, onChange, fetchOptions, refetchKey, onFetchError, asyncErrorMessage, error, hint, disabled, clearable, containerClassName, allowCreate, onCreateOption, renderEmpty, renderCreateOption, renderOption, onSearchChange, loading, idleMessage, ariaLabel, debounceMs, scrollBehavior, }: ComboboxProps): react.JSX.Element;
|
|
150
|
+
|
|
151
|
+
type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
152
|
+
interface DialogProps {
|
|
153
|
+
open: boolean;
|
|
154
|
+
onClose: () => void;
|
|
155
|
+
title?: ReactNode;
|
|
156
|
+
description?: ReactNode;
|
|
157
|
+
children: ReactNode;
|
|
158
|
+
footer?: ReactNode;
|
|
159
|
+
size?: DialogSize;
|
|
160
|
+
closeOnOverlay?: boolean;
|
|
161
|
+
closeOnEscape?: boolean;
|
|
162
|
+
showClose?: boolean;
|
|
163
|
+
noPadding?: boolean;
|
|
164
|
+
className?: string;
|
|
165
|
+
overlayClassName?: string;
|
|
166
|
+
ariaLabel?: string;
|
|
167
|
+
ariaLabelledBy?: string;
|
|
168
|
+
}
|
|
169
|
+
declare function DDialog({ open, onClose, title, description, children, footer, size, closeOnOverlay, closeOnEscape, showClose, noPadding, className, overlayClassName, ariaLabel, ariaLabelledBy, }: DialogProps): react.JSX.Element;
|
|
170
|
+
|
|
171
|
+
interface ConfirmDialogProps {
|
|
172
|
+
open: boolean;
|
|
173
|
+
onClose: () => void;
|
|
174
|
+
onConfirm: () => void;
|
|
175
|
+
title?: ReactNode;
|
|
176
|
+
message?: ReactNode;
|
|
177
|
+
confirmLabel?: ReactNode;
|
|
178
|
+
cancelLabel?: ReactNode;
|
|
179
|
+
variant?: 'danger' | 'primary';
|
|
180
|
+
loading?: boolean;
|
|
181
|
+
}
|
|
182
|
+
declare function DConfirmDialog({ open, onClose, onConfirm, title, message, confirmLabel, cancelLabel, variant, loading }: ConfirmDialogProps): react.JSX.Element;
|
|
183
|
+
|
|
184
|
+
interface ConnectionErrorProps {
|
|
185
|
+
onRetry: () => void;
|
|
186
|
+
isRetrying?: boolean;
|
|
187
|
+
title?: ReactNode;
|
|
188
|
+
message?: ReactNode;
|
|
189
|
+
detail?: ReactNode;
|
|
190
|
+
diagnostics?: ReactNode;
|
|
191
|
+
}
|
|
192
|
+
declare function DConnectionError({ onRetry, isRetrying, title, message, detail, diagnostics }: ConnectionErrorProps): react.JSX.Element;
|
|
193
|
+
|
|
194
|
+
type TimePrecision = 'hour' | 'hour-minute';
|
|
195
|
+
type TimeMinuteStep = 1 | 5 | 10 | 15 | 30;
|
|
196
|
+
|
|
197
|
+
type DatePickerVariant = 'date' | 'date-hour' | 'date-time';
|
|
198
|
+
type DatePickerMinuteStep = TimeMinuteStep;
|
|
199
|
+
interface DatePickerProps {
|
|
200
|
+
label?: ReactNode;
|
|
201
|
+
value?: string;
|
|
202
|
+
onChange?: (value: string) => void;
|
|
203
|
+
onClear?: () => void;
|
|
204
|
+
placeholder?: string;
|
|
205
|
+
error?: ReactNode;
|
|
206
|
+
hint?: ReactNode;
|
|
207
|
+
disabled?: boolean;
|
|
208
|
+
clearable?: boolean;
|
|
209
|
+
containerClassName?: string;
|
|
210
|
+
minDate?: string;
|
|
211
|
+
maxDate?: string;
|
|
212
|
+
size?: InputSize;
|
|
213
|
+
variant?: DatePickerVariant;
|
|
214
|
+
minuteStep?: DatePickerMinuteStep;
|
|
215
|
+
scrollBehavior?: FloatingScrollBehavior;
|
|
216
|
+
}
|
|
217
|
+
declare function DDatePicker({ label, value, onChange, onClear, placeholder, error, hint, disabled, clearable, containerClassName, minDate, maxDate, size, variant, minuteStep, scrollBehavior }: DatePickerProps): react.JSX.Element;
|
|
218
|
+
|
|
219
|
+
type TimePickerVariant = TimePrecision;
|
|
220
|
+
type TimePickerMinuteStep = TimeMinuteStep;
|
|
221
|
+
interface TimePickerProps {
|
|
222
|
+
label?: ReactNode;
|
|
223
|
+
value?: string;
|
|
224
|
+
onChange?: (value: string) => void;
|
|
225
|
+
onClear?: () => void;
|
|
226
|
+
placeholder?: string;
|
|
227
|
+
error?: ReactNode;
|
|
228
|
+
hint?: ReactNode;
|
|
229
|
+
disabled?: boolean;
|
|
230
|
+
clearable?: boolean;
|
|
231
|
+
containerClassName?: string;
|
|
232
|
+
size?: InputSize;
|
|
233
|
+
variant?: TimePickerVariant;
|
|
234
|
+
minuteStep?: TimePickerMinuteStep;
|
|
235
|
+
scrollBehavior?: FloatingScrollBehavior;
|
|
236
|
+
}
|
|
237
|
+
declare function DTimePicker({ label, value, onChange, onClear, placeholder, error, hint, disabled, clearable, containerClassName, size, variant, minuteStep, scrollBehavior, }: TimePickerProps): react.JSX.Element;
|
|
238
|
+
|
|
239
|
+
interface DateRangeFilterProps {
|
|
240
|
+
from: string;
|
|
241
|
+
to: string;
|
|
242
|
+
onFromChange: (value: string) => void;
|
|
243
|
+
onToChange: (value: string) => void;
|
|
244
|
+
onClear?: () => void;
|
|
245
|
+
}
|
|
246
|
+
declare function DDateRangeFilter({ from, to, onFromChange, onToChange, onClear }: DateRangeFilterProps): react.JSX.Element;
|
|
247
|
+
|
|
248
|
+
declare function DEmptyState({ title, description, action, icon, className, }: {
|
|
249
|
+
title: ReactNode;
|
|
250
|
+
description?: ReactNode;
|
|
251
|
+
action?: ReactNode;
|
|
252
|
+
icon?: ReactNode;
|
|
253
|
+
className?: string;
|
|
254
|
+
}): react.JSX.Element;
|
|
255
|
+
|
|
256
|
+
type ExportFormat = 'pdf' | 'excel';
|
|
257
|
+
interface ExportButtonProps {
|
|
258
|
+
onExport: (format: ExportFormat) => Promise<Blob> | Blob | void;
|
|
259
|
+
filename?: string;
|
|
260
|
+
onSuccess?: (format: ExportFormat) => void;
|
|
261
|
+
onError?: (error: unknown, format: ExportFormat) => void;
|
|
262
|
+
onProcessing?: (format: ExportFormat) => void;
|
|
263
|
+
disabled?: boolean;
|
|
264
|
+
}
|
|
265
|
+
declare function DExportButton({ filename, disabled, ...props }: ExportButtonProps): react.JSX.Element;
|
|
266
|
+
|
|
267
|
+
type ValidationValue = unknown;
|
|
268
|
+
type ValidationParams = Record<string, string | number | boolean | null | undefined>;
|
|
269
|
+
interface ValidationIssue {
|
|
270
|
+
key?: string;
|
|
271
|
+
message?: string;
|
|
272
|
+
params?: ValidationParams;
|
|
273
|
+
}
|
|
274
|
+
interface ValidationContext<TValues extends Record<string, unknown> = Record<string, unknown>> {
|
|
275
|
+
name: string;
|
|
276
|
+
label: string;
|
|
277
|
+
values: TValues;
|
|
278
|
+
}
|
|
279
|
+
type ValidationResult = ValidationIssue | string | null | undefined | false;
|
|
280
|
+
type ValidationRule<TValue = ValidationValue, TValues extends Record<string, unknown> = Record<string, unknown>> = (value: TValue, context: ValidationContext<TValues>) => ValidationResult | Promise<ValidationResult>;
|
|
281
|
+
type ValidationSchema<TValues extends Record<string, unknown> = Record<string, unknown>> = Partial<{
|
|
282
|
+
[K in keyof TValues]: readonly ValidationRule<TValues[K], TValues>[];
|
|
283
|
+
}> & Record<string, readonly ValidationRule[]>;
|
|
284
|
+
declare function required(message?: string): ValidationRule;
|
|
285
|
+
declare function accepted(message?: string): ValidationRule;
|
|
286
|
+
declare function email(message?: string): ValidationRule;
|
|
287
|
+
declare function url(message?: string): ValidationRule;
|
|
288
|
+
declare function minLength(min: number, message?: string): ValidationRule;
|
|
289
|
+
declare function maxLength(max: number, message?: string): ValidationRule;
|
|
290
|
+
declare function minValue(min: number, message?: string): ValidationRule;
|
|
291
|
+
declare function maxValue(max: number, message?: string): ValidationRule;
|
|
292
|
+
declare function integer(message?: string): ValidationRule;
|
|
293
|
+
declare function pattern(regex: RegExp, message?: string): ValidationRule;
|
|
294
|
+
declare function sameAs(otherField: string, otherLabel?: string, message?: string): ValidationRule;
|
|
295
|
+
declare function oneOf(values: readonly unknown[], message?: string): ValidationRule;
|
|
296
|
+
declare function date(message?: string): ValidationRule;
|
|
297
|
+
declare function time(message?: string): ValidationRule;
|
|
298
|
+
declare function customValidation<TValue = ValidationValue>(rule: ValidationRule<TValue>): ValidationRule<TValue>;
|
|
299
|
+
declare function validateValue<TValue = ValidationValue>(value: TValue, rules?: readonly ValidationRule<TValue>[], context?: ValidationContext): Promise<ValidationIssue | null>;
|
|
300
|
+
|
|
301
|
+
type FormValidateOn = 'submit' | 'blur' | 'change';
|
|
302
|
+
type FormErrors = Record<string, string | undefined>;
|
|
303
|
+
type FormValues = Record<string, unknown>;
|
|
304
|
+
interface FormRenderProps {
|
|
305
|
+
errors: FormErrors;
|
|
306
|
+
isValid: boolean;
|
|
307
|
+
clearErrors: () => void;
|
|
308
|
+
}
|
|
309
|
+
interface DFormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, 'onSubmit' | 'children' | 'onInvalid'> {
|
|
310
|
+
children: ReactNode | ((props: FormRenderProps) => ReactNode);
|
|
311
|
+
values?: FormValues;
|
|
312
|
+
schema?: ValidationSchema;
|
|
313
|
+
validateOn?: FormValidateOn | readonly FormValidateOn[];
|
|
314
|
+
onSubmit?: (values: FormValues) => void | Promise<void>;
|
|
315
|
+
onInvalid?: (errors: FormErrors, values: FormValues) => void;
|
|
316
|
+
}
|
|
317
|
+
declare function DForm({ children, values, schema, validateOn, onSubmit, onInvalid, className, ...props }: DFormProps): react.JSX.Element;
|
|
318
|
+
interface UseDFormFieldOptions {
|
|
319
|
+
name: string;
|
|
320
|
+
value: unknown;
|
|
321
|
+
label?: string;
|
|
322
|
+
rules?: readonly ValidationRule[];
|
|
323
|
+
validateOn?: FormValidateOn | readonly FormValidateOn[];
|
|
324
|
+
}
|
|
325
|
+
interface DFormFieldState {
|
|
326
|
+
error?: string;
|
|
327
|
+
invalid: boolean;
|
|
328
|
+
onBlur: () => void;
|
|
329
|
+
validate: () => Promise<string | undefined>;
|
|
330
|
+
clearError: () => void;
|
|
331
|
+
}
|
|
332
|
+
declare function useDFormField({ name, value, label, rules, validateOn }: UseDFormFieldOptions): DFormFieldState;
|
|
333
|
+
interface DFormFieldProps extends UseDFormFieldOptions {
|
|
334
|
+
children: (state: DFormFieldState) => ReactNode;
|
|
335
|
+
}
|
|
336
|
+
declare function DFormField({ children, ...options }: DFormFieldProps): react.JSX.Element;
|
|
337
|
+
interface DValidationMessageProps {
|
|
338
|
+
error?: ReactNode;
|
|
339
|
+
className?: string;
|
|
340
|
+
}
|
|
341
|
+
declare function DValidationMessage({ error, className }: DValidationMessageProps): react.JSX.Element | null;
|
|
342
|
+
|
|
343
|
+
type InfoNoteVariant = 'neutral' | 'info' | 'warning' | 'success' | 'danger' | 'tip';
|
|
344
|
+
interface InfoNoteProps {
|
|
345
|
+
variant?: InfoNoteVariant;
|
|
346
|
+
title?: ReactNode;
|
|
347
|
+
icon?: ReactNode;
|
|
348
|
+
children: ReactNode;
|
|
349
|
+
className?: string;
|
|
350
|
+
}
|
|
351
|
+
declare function DInfoNote({ variant, title, icon, children, className }: InfoNoteProps): react.JSX.Element;
|
|
352
|
+
|
|
353
|
+
type InputFormat = 'plain' | 'currency' | 'percentage';
|
|
354
|
+
type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search';
|
|
355
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange' | 'size' | 'prefix'> {
|
|
356
|
+
label?: ReactNode;
|
|
357
|
+
labelInfo?: ReactNode;
|
|
358
|
+
error?: ReactNode;
|
|
359
|
+
hint?: ReactNode;
|
|
360
|
+
type?: InputType;
|
|
361
|
+
clearable?: boolean;
|
|
362
|
+
size?: InputSize;
|
|
363
|
+
onClear?: () => void;
|
|
364
|
+
onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
|
|
365
|
+
onNativeChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
366
|
+
leftIcon?: ReactNode;
|
|
367
|
+
rightIcon?: ReactNode;
|
|
368
|
+
leftAdornment?: ReactNode;
|
|
369
|
+
rightAdornment?: ReactNode;
|
|
370
|
+
prefix?: ReactNode;
|
|
371
|
+
suffix?: ReactNode;
|
|
372
|
+
format?: InputFormat;
|
|
373
|
+
loading?: boolean;
|
|
374
|
+
containerClassName?: string;
|
|
375
|
+
}
|
|
376
|
+
declare const DInput: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
377
|
+
interface DecimalNormalizationOptions {
|
|
378
|
+
scale?: number;
|
|
379
|
+
integer?: boolean;
|
|
380
|
+
}
|
|
381
|
+
declare function normalizeDecimalInput(input: string, { scale, integer }?: DecimalNormalizationOptions): string;
|
|
382
|
+
interface DecimalInputProps extends Omit<InputProps, 'inputMode' | 'onChange' | 'onNativeChange' | 'type' | 'value' | 'defaultValue' | 'format'> {
|
|
383
|
+
value: string;
|
|
384
|
+
onValueChange: (value: string) => void;
|
|
385
|
+
scale?: number;
|
|
386
|
+
integer?: boolean;
|
|
387
|
+
}
|
|
388
|
+
declare const DDecimalInput: react.ForwardRefExoticComponent<DecimalInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
389
|
+
interface CurrencyFormatOptions {
|
|
390
|
+
groupSeparator?: string;
|
|
391
|
+
decimalSeparator?: string;
|
|
392
|
+
}
|
|
393
|
+
declare function formatCurrencyInputValue(value: string, { groupSeparator, decimalSeparator }?: CurrencyFormatOptions): string;
|
|
394
|
+
declare function parseCurrencyInputValue(value: string, { groupSeparator, decimalSeparator }?: CurrencyFormatOptions): string;
|
|
395
|
+
interface CurrencyInputProps extends Omit<DecimalInputProps, 'integer' | 'onValueChange'> {
|
|
396
|
+
onValueChange: (value: string) => void;
|
|
397
|
+
currencySymbol?: ReactNode;
|
|
398
|
+
groupSeparator?: string;
|
|
399
|
+
decimalSeparator?: string;
|
|
400
|
+
}
|
|
401
|
+
declare const DCurrencyInput: react.ForwardRefExoticComponent<CurrencyInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
402
|
+
|
|
403
|
+
declare const idMessages: {
|
|
404
|
+
readonly 'common.apply': "Terapkan";
|
|
405
|
+
readonly 'common.cancel': "Batal";
|
|
406
|
+
readonly 'common.optional': "Opsional";
|
|
407
|
+
readonly 'common.loading': "Memuat...";
|
|
408
|
+
readonly 'common.clear': "Hapus";
|
|
409
|
+
readonly 'common.search': "Cari...";
|
|
410
|
+
readonly 'common.previousMonth': "Bulan sebelumnya";
|
|
411
|
+
readonly 'common.nextMonth': "Bulan berikutnya";
|
|
412
|
+
readonly 'common.yes': "Ya";
|
|
413
|
+
readonly 'common.no': "Tidak";
|
|
414
|
+
readonly 'input.fieldInfo': "Informasi field";
|
|
415
|
+
readonly 'input.loading': "Memuat";
|
|
416
|
+
readonly 'input.clear': "Hapus input";
|
|
417
|
+
readonly 'input.showPassword': "Tampilkan password";
|
|
418
|
+
readonly 'input.hidePassword': "Sembunyikan password";
|
|
419
|
+
readonly 'textarea.clear': "Hapus textarea";
|
|
420
|
+
readonly 'searchInput.placeholder': "Cari...";
|
|
421
|
+
readonly 'searchInput.clear': "Hapus pencarian";
|
|
422
|
+
readonly 'selectFilter.placeholder': "Pilih...";
|
|
423
|
+
readonly 'selectFilter.searchPlaceholder': "Cari...";
|
|
424
|
+
readonly 'selectFilter.clear': "Hapus filter";
|
|
425
|
+
readonly 'statusFilter.all': "Semua";
|
|
426
|
+
readonly 'dateRangeFilter.period': "Periode";
|
|
427
|
+
readonly 'dateRangeFilter.from': "Dari";
|
|
428
|
+
readonly 'dateRangeFilter.to': "Sampai";
|
|
429
|
+
readonly 'dateRangeFilter.reset': "Reset";
|
|
430
|
+
readonly 'pagination.label': "Paginasi";
|
|
431
|
+
readonly 'pagination.previous': "Halaman sebelumnya";
|
|
432
|
+
readonly 'pagination.next': "Halaman berikutnya";
|
|
433
|
+
readonly 'pagination.page': "Halaman {page}";
|
|
434
|
+
readonly 'dataTable.empty': "Tidak ada data";
|
|
435
|
+
readonly 'dataTable.searchPlaceholder': "Cari...";
|
|
436
|
+
readonly 'dataTable.toggleFilters': "Tampilkan/sembunyikan filter";
|
|
437
|
+
readonly 'dataTable.actions': "Aksi";
|
|
438
|
+
readonly 'dataTable.showing': "Menampilkan";
|
|
439
|
+
readonly 'dataTable.ofData': "dari {total} data";
|
|
440
|
+
readonly 'confirmDialog.title': "Konfirmasi";
|
|
441
|
+
readonly 'confirmDialog.message': "Apakah Anda yakin ingin melakukan aksi ini?";
|
|
442
|
+
readonly 'confirmDialog.confirm': "Ya, Lanjutkan";
|
|
443
|
+
readonly 'confirmDialog.cancel': "Batal";
|
|
444
|
+
readonly 'dialog.close': "Tutup dialog";
|
|
445
|
+
readonly 'connectionError.title': "Koneksi Gagal";
|
|
446
|
+
readonly 'connectionError.message': "Tidak dapat terhubung ke server.";
|
|
447
|
+
readonly 'connectionError.detail': "Pastikan server backend sudah berjalan dan koneksi internet Anda stabil.";
|
|
448
|
+
readonly 'connectionError.retrying': "Menghubungkan...";
|
|
449
|
+
readonly 'connectionError.retry': "Coba Lagi";
|
|
450
|
+
readonly 'loading.default': "Memuat...";
|
|
451
|
+
readonly 'notification.title': "Notifikasi";
|
|
452
|
+
readonly 'notification.empty': "Tidak ada notifikasi";
|
|
453
|
+
readonly 'notification.markAllRead': "Tandai semua sudah dibaca";
|
|
454
|
+
readonly 'notification.close': "Tutup notifikasi";
|
|
455
|
+
readonly 'notification.dismiss': "Tutup {title}";
|
|
456
|
+
readonly 'export.label': "Ekspor";
|
|
457
|
+
readonly 'export.pdf': "Ekspor PDF";
|
|
458
|
+
readonly 'export.excel': "Ekspor Excel";
|
|
459
|
+
readonly 'select.placeholder': "Pilih...";
|
|
460
|
+
readonly 'select.empty': "Tidak ditemukan";
|
|
461
|
+
readonly 'select.asyncError': "Gagal memuat pilihan";
|
|
462
|
+
readonly 'select.searchPlaceholder': "Cari...";
|
|
463
|
+
readonly 'select.loading': "Memuat...";
|
|
464
|
+
readonly 'select.clear': "Hapus pilihan";
|
|
465
|
+
readonly 'combobox.placeholder': "Ketik untuk mencari...";
|
|
466
|
+
readonly 'combobox.asyncError': "Gagal memuat pilihan";
|
|
467
|
+
readonly 'combobox.searching': "Mencari...";
|
|
468
|
+
readonly 'combobox.empty': "Tidak ditemukan";
|
|
469
|
+
readonly 'combobox.useValue': "Gunakan “{value}”";
|
|
470
|
+
readonly 'combobox.clear': "Hapus pilihan";
|
|
471
|
+
readonly 'datePicker.placeholder': "Pilih tanggal";
|
|
472
|
+
readonly 'datePicker.today': "Hari ini";
|
|
473
|
+
readonly 'datePicker.time': "Waktu";
|
|
474
|
+
readonly 'datePicker.selectHour': "Pilih jam";
|
|
475
|
+
readonly 'datePicker.selectHourMinute': "Pilih jam dan menit";
|
|
476
|
+
readonly 'datePicker.clear': "Hapus tanggal";
|
|
477
|
+
readonly 'timePicker.placeholder': "Pilih waktu";
|
|
478
|
+
readonly 'timePicker.title': "Pilih waktu";
|
|
479
|
+
readonly 'timePicker.hourPrecision': "Presisi jam";
|
|
480
|
+
readonly 'timePicker.hourMinutePrecision': "Presisi jam dan menit";
|
|
481
|
+
readonly 'timePicker.now': "Sekarang";
|
|
482
|
+
readonly 'timePicker.hour': "Jam";
|
|
483
|
+
readonly 'timePicker.minute': "Menit";
|
|
484
|
+
readonly 'timePicker.hourOption': "Jam {value}";
|
|
485
|
+
readonly 'timePicker.minuteOption': "Menit {value}";
|
|
486
|
+
readonly 'timePicker.clear': "Hapus waktu";
|
|
487
|
+
readonly 'rangeDatePicker.placeholder': "Pilih periode";
|
|
488
|
+
readonly 'rangeDatePicker.quickRange': "Rentang cepat";
|
|
489
|
+
readonly 'rangeDatePicker.summaryAllTime': "Semua waktu";
|
|
490
|
+
readonly 'rangeDatePicker.summarySelect': "Pilih tanggal awal dan akhir";
|
|
491
|
+
readonly 'rangeDatePicker.today': "Hari ini";
|
|
492
|
+
readonly 'rangeDatePicker.yesterday': "Kemarin";
|
|
493
|
+
readonly 'rangeDatePicker.thisWeek': "Minggu ini";
|
|
494
|
+
readonly 'rangeDatePicker.lastWeek': "Minggu lalu";
|
|
495
|
+
readonly 'rangeDatePicker.thisMonth': "Bulan ini";
|
|
496
|
+
readonly 'rangeDatePicker.lastMonth': "Bulan lalu";
|
|
497
|
+
readonly 'rangeDatePicker.thisYear': "Tahun ini";
|
|
498
|
+
readonly 'rangeDatePicker.lastYear': "Tahun lalu";
|
|
499
|
+
readonly 'rangeDatePicker.allTime': "Semua waktu";
|
|
500
|
+
readonly 'rangeDatePicker.clear': "Hapus rentang tanggal";
|
|
501
|
+
readonly 'validation.required': "{label} wajib diisi.";
|
|
502
|
+
readonly 'validation.accepted': "{label} harus disetujui.";
|
|
503
|
+
readonly 'validation.email': "{label} harus berupa email yang valid.";
|
|
504
|
+
readonly 'validation.url': "{label} harus berupa URL yang valid.";
|
|
505
|
+
readonly 'validation.minLength': "{label} minimal {min} karakter.";
|
|
506
|
+
readonly 'validation.maxLength': "{label} maksimal {max} karakter.";
|
|
507
|
+
readonly 'validation.minValue': "{label} minimal {min}.";
|
|
508
|
+
readonly 'validation.maxValue': "{label} maksimal {max}.";
|
|
509
|
+
readonly 'validation.integer': "{label} harus berupa bilangan bulat.";
|
|
510
|
+
readonly 'validation.pattern': "Format {label} tidak valid.";
|
|
511
|
+
readonly 'validation.sameAs': "{label} harus sama dengan {otherLabel}.";
|
|
512
|
+
readonly 'validation.oneOf': "{label} berisi pilihan yang tidak valid.";
|
|
513
|
+
readonly 'validation.date': "{label} harus berupa tanggal yang valid.";
|
|
514
|
+
readonly 'validation.time': "{label} harus berupa waktu yang valid.";
|
|
515
|
+
readonly 'validation.invalid': "{label} tidak valid.";
|
|
516
|
+
readonly 'validation.defaultLabel': "Field";
|
|
517
|
+
};
|
|
518
|
+
declare const enMessages: Record<keyof typeof idMessages, string>;
|
|
519
|
+
type BuiltInLocalizationKey = keyof typeof idMessages;
|
|
520
|
+
|
|
521
|
+
type LocalizationParams = Record<string, string | number | boolean | null | undefined>;
|
|
522
|
+
type LocalizationMessages = Partial<Record<BuiltInLocalizationKey | (string & {}), string>>;
|
|
523
|
+
type LocalizationTranslator = (key: string, params: LocalizationParams, fallback: string) => string | null | undefined;
|
|
524
|
+
interface LocalizationProviderProps {
|
|
525
|
+
children: ReactNode;
|
|
526
|
+
/** Default is Indonesian. BCP-47 values such as id-ID, en-US, or project locales are accepted. */
|
|
527
|
+
locale?: string;
|
|
528
|
+
/** Override only the design-system messages the project wants to own. */
|
|
529
|
+
messages?: LocalizationMessages;
|
|
530
|
+
/** Adapter for project i18n (i18next, next-intl, react-intl, etc.). */
|
|
531
|
+
translate?: LocalizationTranslator;
|
|
532
|
+
}
|
|
533
|
+
interface LocalizationContextValue {
|
|
534
|
+
locale: string;
|
|
535
|
+
t: (key: string, params?: LocalizationParams, fallback?: string) => string;
|
|
536
|
+
}
|
|
537
|
+
declare function createDTranslator({ locale, messages, translate, }?: Omit<LocalizationProviderProps, 'children'>): LocalizationContextValue['t'];
|
|
538
|
+
declare function DLocalizationProvider({ children, locale, messages, translate, }: LocalizationProviderProps): react.JSX.Element;
|
|
539
|
+
declare function useDLocalization(): LocalizationContextValue;
|
|
540
|
+
|
|
541
|
+
declare function getLocalizedMonthNames(locale: string, format?: 'long' | 'short'): string[];
|
|
542
|
+
declare function getLocalizedWeekdayNames(locale: string, format?: 'long' | 'short' | 'narrow'): string[];
|
|
543
|
+
|
|
544
|
+
declare function DLoadingIndicator({ label, className }: {
|
|
545
|
+
label?: ReactNode;
|
|
546
|
+
className?: string;
|
|
547
|
+
}): react.JSX.Element;
|
|
548
|
+
declare function DLoadingOverlay({ label }: {
|
|
549
|
+
label?: ReactNode;
|
|
550
|
+
}): react.JSX.Element;
|
|
551
|
+
|
|
552
|
+
interface NotificationItem {
|
|
553
|
+
id: string;
|
|
554
|
+
title: string;
|
|
555
|
+
message: string;
|
|
556
|
+
type: 'info' | 'success' | 'warning' | 'error';
|
|
557
|
+
read: boolean;
|
|
558
|
+
createdAt: string;
|
|
559
|
+
}
|
|
560
|
+
interface NotificationPanelProps {
|
|
561
|
+
notifications: readonly NotificationItem[];
|
|
562
|
+
open: boolean;
|
|
563
|
+
onClose: () => void;
|
|
564
|
+
onMarkRead: (id: string) => void;
|
|
565
|
+
onMarkAllRead: () => void;
|
|
566
|
+
onDismiss: (id: string) => void;
|
|
567
|
+
/** Element that the panel is positioned against. Strongly recommended. */
|
|
568
|
+
anchorRef?: RefObject<HTMLElement | null>;
|
|
569
|
+
title?: string;
|
|
570
|
+
emptyMessage?: string;
|
|
571
|
+
className?: string;
|
|
572
|
+
offset?: number;
|
|
573
|
+
scrollBehavior?: FloatingScrollBehavior;
|
|
574
|
+
}
|
|
575
|
+
declare function DNotificationPanel({ notifications, open, onClose, onMarkRead, onMarkAllRead, onDismiss, anchorRef, title, emptyMessage, className, offset, scrollBehavior, }: NotificationPanelProps): react.ReactPortal | null;
|
|
576
|
+
|
|
577
|
+
interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
578
|
+
value?: number;
|
|
579
|
+
label?: string;
|
|
580
|
+
}
|
|
581
|
+
declare function DProgress({ value, label, className, ...props }: ProgressProps): react.JSX.Element;
|
|
582
|
+
|
|
583
|
+
interface DateRangeValue {
|
|
584
|
+
start?: string;
|
|
585
|
+
end?: string;
|
|
586
|
+
}
|
|
587
|
+
interface RangeDatePickerProps {
|
|
588
|
+
label?: ReactNode;
|
|
589
|
+
placeholder?: string;
|
|
590
|
+
value?: DateRangeValue;
|
|
591
|
+
size?: InputSize;
|
|
592
|
+
onChange?: (value: DateRangeValue) => void;
|
|
593
|
+
error?: ReactNode;
|
|
594
|
+
hint?: ReactNode;
|
|
595
|
+
disabled?: boolean;
|
|
596
|
+
clearable?: boolean;
|
|
597
|
+
containerClassName?: string;
|
|
598
|
+
scrollBehavior?: FloatingScrollBehavior;
|
|
599
|
+
}
|
|
600
|
+
declare function DRangeDatePicker({ label, placeholder, value, size, onChange, error, hint, disabled, clearable, containerClassName, scrollBehavior }: RangeDatePickerProps): react.JSX.Element;
|
|
601
|
+
|
|
602
|
+
interface SearchInputProps {
|
|
603
|
+
value: string;
|
|
604
|
+
onChange: (value: string) => void;
|
|
605
|
+
placeholder?: string;
|
|
606
|
+
debounceMs?: number;
|
|
607
|
+
className?: string;
|
|
608
|
+
align?: 'left' | 'right';
|
|
609
|
+
expandedWidth?: string;
|
|
610
|
+
}
|
|
611
|
+
declare function DSearchInput({ value, onChange, placeholder, debounceMs, className, align, expandedWidth, }: SearchInputProps): react.JSX.Element;
|
|
612
|
+
|
|
613
|
+
interface SelectFilterProps {
|
|
614
|
+
label?: ReactNode;
|
|
615
|
+
placeholder?: ReactNode;
|
|
616
|
+
options: readonly SelectOption[];
|
|
617
|
+
value?: string | number | null;
|
|
618
|
+
onChange?: (value: string | number | null) => void;
|
|
619
|
+
error?: ReactNode;
|
|
620
|
+
hint?: ReactNode;
|
|
621
|
+
disabled?: boolean;
|
|
622
|
+
clearable?: boolean;
|
|
623
|
+
searchable?: boolean;
|
|
624
|
+
containerClassName?: string;
|
|
625
|
+
scrollBehavior?: FloatingScrollBehavior;
|
|
626
|
+
}
|
|
627
|
+
/** Filter-specific DSelect from oldUi: label lives inside the trigger, not above it. */
|
|
628
|
+
declare function DSelectFilter({ label, placeholder, options, value, onChange, error, hint, disabled, clearable, searchable, containerClassName, scrollBehavior, }: SelectFilterProps): react.JSX.Element;
|
|
629
|
+
|
|
630
|
+
type SkeletonRounded = 'sm' | 'md' | 'lg' | 'full';
|
|
631
|
+
interface SkeletonBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
632
|
+
width?: string | number;
|
|
633
|
+
height?: string | number;
|
|
634
|
+
rounded?: SkeletonRounded;
|
|
635
|
+
}
|
|
636
|
+
interface SkeletonProps extends SkeletonBlockProps {
|
|
637
|
+
count?: number;
|
|
638
|
+
}
|
|
639
|
+
declare function DSkeleton({ height, count, ...props }: SkeletonProps): react.JSX.Element;
|
|
640
|
+
declare function DTableSkeleton({ rows, cols }: {
|
|
641
|
+
rows?: number;
|
|
642
|
+
cols?: number;
|
|
643
|
+
}): react.JSX.Element;
|
|
644
|
+
declare function DCardSkeleton(): react.JSX.Element;
|
|
645
|
+
declare function DFormSkeleton({ fields }: {
|
|
646
|
+
fields?: number;
|
|
647
|
+
}): react.JSX.Element;
|
|
648
|
+
|
|
649
|
+
interface SplashScreenProps {
|
|
650
|
+
onFinish?: () => void;
|
|
651
|
+
minDuration?: number;
|
|
652
|
+
title?: ReactNode;
|
|
653
|
+
subtitle?: ReactNode;
|
|
654
|
+
mark?: ReactNode;
|
|
655
|
+
}
|
|
656
|
+
declare function DSplashScreen({ onFinish, minDuration, title, subtitle, mark }: SplashScreenProps): react.JSX.Element;
|
|
657
|
+
|
|
658
|
+
interface StatusOption {
|
|
659
|
+
label: ReactNode;
|
|
660
|
+
value: string;
|
|
661
|
+
count?: number;
|
|
662
|
+
}
|
|
663
|
+
interface StatusFilterProps {
|
|
664
|
+
label?: ReactNode;
|
|
665
|
+
options: readonly StatusOption[];
|
|
666
|
+
value: string;
|
|
667
|
+
onChange: (value: string) => void;
|
|
668
|
+
allLabel?: ReactNode;
|
|
669
|
+
}
|
|
670
|
+
declare function DStatusFilter({ label, options, value, onChange, allLabel }: StatusFilterProps): react.JSX.Element;
|
|
671
|
+
|
|
672
|
+
type SortDirection = 'asc' | 'desc';
|
|
673
|
+
type CellTransform = 'uppercase' | 'lowercase' | 'capitalize' | 'none' | ((value: unknown) => ReactNode);
|
|
674
|
+
type LegacyTableCellRenderer = Function & {
|
|
675
|
+
readonly __legacyTableCellRenderer?: never;
|
|
676
|
+
};
|
|
677
|
+
interface TableColumn<T> {
|
|
678
|
+
key: keyof T | string;
|
|
679
|
+
label: ReactNode;
|
|
680
|
+
render?: ((row: T, index: number) => ReactNode) | LegacyTableCellRenderer;
|
|
681
|
+
align?: 'left' | 'center' | 'right';
|
|
682
|
+
width?: string;
|
|
683
|
+
sortable?: boolean;
|
|
684
|
+
type?: 'text' | 'currency' | 'number' | 'date';
|
|
685
|
+
transform?: CellTransform;
|
|
686
|
+
trasform?: CellTransform;
|
|
687
|
+
}
|
|
688
|
+
interface TableAction<T> {
|
|
689
|
+
label: ReactNode;
|
|
690
|
+
onClick: (row: T) => void;
|
|
691
|
+
icon?: ReactNode;
|
|
692
|
+
variant?: 'default' | 'danger';
|
|
693
|
+
show?: (row: T) => boolean;
|
|
694
|
+
}
|
|
695
|
+
interface TablePagination {
|
|
696
|
+
page: number;
|
|
697
|
+
pageSize: number;
|
|
698
|
+
total: number;
|
|
699
|
+
}
|
|
700
|
+
declare function getPaginationPages(page: number, totalPages: number): number[];
|
|
701
|
+
interface DataTableProps<T> {
|
|
702
|
+
columns: readonly TableColumn<T>[];
|
|
703
|
+
data: readonly T[];
|
|
704
|
+
rowKey?: keyof T | ((row: T, index: number) => string);
|
|
705
|
+
loading?: boolean;
|
|
706
|
+
emptyMessage?: ReactNode;
|
|
707
|
+
onRowClick?: (row: T) => void;
|
|
708
|
+
sortBy?: string;
|
|
709
|
+
sortDirection?: SortDirection;
|
|
710
|
+
sortDir?: SortDirection;
|
|
711
|
+
onSort?: (key: string, direction: SortDirection) => void;
|
|
712
|
+
pagination?: TablePagination;
|
|
713
|
+
onPageChange?: (page: number) => void;
|
|
714
|
+
onPageSizeChange?: (size: number) => void;
|
|
715
|
+
actions?: readonly TableAction<T>[] | ((row: T, index: number) => ReactNode);
|
|
716
|
+
searchable?: boolean;
|
|
717
|
+
searchPlaceholder?: string;
|
|
718
|
+
searchValue?: string;
|
|
719
|
+
onSearchChange?: (query: string) => void;
|
|
720
|
+
headerActions?: ReactNode;
|
|
721
|
+
filters?: ReactNode;
|
|
722
|
+
}
|
|
723
|
+
declare function DDataTable<T>({ columns, data, rowKey, loading, emptyMessage, onRowClick, sortBy, sortDirection, sortDir, onSort, pagination, onPageChange, onPageSizeChange, actions, searchable, searchPlaceholder, searchValue, onSearchChange, headerActions, filters }: DataTableProps<T>): react.JSX.Element;
|
|
724
|
+
|
|
725
|
+
interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'> {
|
|
726
|
+
label?: ReactNode;
|
|
727
|
+
error?: ReactNode;
|
|
728
|
+
hint?: ReactNode;
|
|
729
|
+
clearable?: boolean;
|
|
730
|
+
onClear?: () => void;
|
|
731
|
+
onChange?: (value: string, event: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
732
|
+
onNativeChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
733
|
+
containerClassName?: string;
|
|
734
|
+
}
|
|
735
|
+
declare const DTextarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
736
|
+
|
|
737
|
+
type ToastVariant = 'info' | 'success' | 'warning' | 'danger';
|
|
738
|
+
interface ToastInput {
|
|
739
|
+
title: ReactNode;
|
|
740
|
+
description?: ReactNode;
|
|
741
|
+
variant?: ToastVariant;
|
|
742
|
+
duration?: number;
|
|
743
|
+
}
|
|
744
|
+
interface ToastItem extends ToastInput {
|
|
745
|
+
id: string;
|
|
746
|
+
}
|
|
747
|
+
interface ToastContextValue {
|
|
748
|
+
toasts: readonly ToastItem[];
|
|
749
|
+
showToast: (toast: ToastInput) => string;
|
|
750
|
+
dismissToast: (id: string) => void;
|
|
751
|
+
}
|
|
752
|
+
interface ToastProviderProps {
|
|
753
|
+
children: ReactNode;
|
|
754
|
+
limit?: number;
|
|
755
|
+
defaultDuration?: number;
|
|
756
|
+
}
|
|
757
|
+
/** App-scoped feedback queue; feature code owns when and what it announces. */
|
|
758
|
+
declare function DToastProvider({ children, limit, defaultDuration, }: ToastProviderProps): react.JSX.Element;
|
|
759
|
+
declare function useToast(): ToastContextValue;
|
|
760
|
+
type ControlledToastVariant = 'info' | 'success' | 'warning' | 'danger' | 'error';
|
|
761
|
+
interface ControlledToastItem {
|
|
762
|
+
id: string;
|
|
763
|
+
title: ReactNode;
|
|
764
|
+
description?: ReactNode;
|
|
765
|
+
variant?: ControlledToastVariant;
|
|
766
|
+
}
|
|
767
|
+
interface ToastContainerProps {
|
|
768
|
+
toasts: readonly ControlledToastItem[];
|
|
769
|
+
onDismiss: (id: string) => void;
|
|
770
|
+
className?: string;
|
|
771
|
+
}
|
|
772
|
+
/** Controlled viewport matching oldUi DToastContainer visuals without coupling UI to an app store. */
|
|
773
|
+
declare function DToastContainer({ toasts, onDismiss, className }: ToastContainerProps): react.JSX.Element | null;
|
|
774
|
+
|
|
775
|
+
type RadioProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
776
|
+
declare const DRadio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
777
|
+
|
|
778
|
+
interface ToggleProps {
|
|
779
|
+
label?: ReactNode;
|
|
780
|
+
checked?: boolean;
|
|
781
|
+
onChange?: (checked: boolean) => void;
|
|
782
|
+
disabled?: boolean;
|
|
783
|
+
fullWidth?: boolean;
|
|
784
|
+
size?: 'sm' | 'md';
|
|
785
|
+
labelPosition?: 'left' | 'right' | 'top' | 'bottom';
|
|
786
|
+
gap?: string;
|
|
787
|
+
className?: string;
|
|
788
|
+
ariaLabel?: string;
|
|
789
|
+
}
|
|
790
|
+
declare function DToggle({ label, checked, onChange, disabled, fullWidth, size, labelPosition, gap, className, ariaLabel, }: ToggleProps): react.JSX.Element;
|
|
791
|
+
|
|
792
|
+
type ThemeRadius = 'inherit' | 'compact' | 'default' | 'rounded';
|
|
793
|
+
type ThemeMode = 'inherit' | 'light' | 'dark';
|
|
794
|
+
interface ThemeTokens {
|
|
795
|
+
background?: string;
|
|
796
|
+
surface?: string;
|
|
797
|
+
surfaceMuted?: string;
|
|
798
|
+
text?: string;
|
|
799
|
+
textMuted?: string;
|
|
800
|
+
border?: string;
|
|
801
|
+
brand?: string;
|
|
802
|
+
brandHover?: string;
|
|
803
|
+
brandActive?: string;
|
|
804
|
+
brandForeground?: string;
|
|
805
|
+
secondary?: string;
|
|
806
|
+
secondaryHover?: string;
|
|
807
|
+
secondaryActive?: string;
|
|
808
|
+
secondaryForeground?: string;
|
|
809
|
+
focus?: string;
|
|
810
|
+
info?: string;
|
|
811
|
+
success?: string;
|
|
812
|
+
warning?: string;
|
|
813
|
+
danger?: string;
|
|
814
|
+
tooltip?: string;
|
|
815
|
+
accentYellow?: string;
|
|
816
|
+
accentMint?: string;
|
|
817
|
+
accentSky?: string;
|
|
818
|
+
accentLavender?: string;
|
|
819
|
+
accentCoral?: string;
|
|
820
|
+
radiusControl?: string;
|
|
821
|
+
radiusCard?: string;
|
|
822
|
+
radiusPanel?: string;
|
|
823
|
+
shadowSm?: string;
|
|
824
|
+
shadowMd?: string;
|
|
825
|
+
shadowLg?: string;
|
|
826
|
+
/** Legacy alias kept for existing themes. */
|
|
827
|
+
shadowPanel?: string;
|
|
828
|
+
fontSans?: string;
|
|
829
|
+
}
|
|
830
|
+
/** Semantic project palette. The design system maps these names to its internal tokens. */
|
|
831
|
+
interface ProjectThemeTokens {
|
|
832
|
+
primary?: string;
|
|
833
|
+
primaryHover?: string;
|
|
834
|
+
primaryActive?: string;
|
|
835
|
+
onPrimary?: string;
|
|
836
|
+
secondary?: string;
|
|
837
|
+
secondaryHover?: string;
|
|
838
|
+
secondaryActive?: string;
|
|
839
|
+
onSecondary?: string;
|
|
840
|
+
background?: string;
|
|
841
|
+
surface?: string;
|
|
842
|
+
surfaceMuted?: string;
|
|
843
|
+
text?: string;
|
|
844
|
+
textMuted?: string;
|
|
845
|
+
border?: string;
|
|
846
|
+
focus?: string;
|
|
847
|
+
info?: string;
|
|
848
|
+
success?: string;
|
|
849
|
+
warning?: string;
|
|
850
|
+
danger?: string;
|
|
851
|
+
tooltip?: string;
|
|
852
|
+
radiusControl?: string;
|
|
853
|
+
radiusCard?: string;
|
|
854
|
+
radiusPanel?: string;
|
|
855
|
+
shadowSm?: string;
|
|
856
|
+
shadowMd?: string;
|
|
857
|
+
shadowLg?: string;
|
|
858
|
+
fontSans?: string;
|
|
859
|
+
}
|
|
860
|
+
type CssVariableThemeMap = Partial<Record<keyof ProjectThemeTokens, string>>;
|
|
861
|
+
interface ThemeProviderProps {
|
|
862
|
+
children: ReactNode;
|
|
863
|
+
tokens?: ThemeTokens;
|
|
864
|
+
radius?: ThemeRadius;
|
|
865
|
+
mode?: ThemeMode;
|
|
866
|
+
}
|
|
867
|
+
declare const defaultThemeTokens: Required<ThemeTokens>;
|
|
868
|
+
declare function themeTokensToCss(tokens: ThemeTokens): string;
|
|
869
|
+
/** Maps project-oriented primary/secondary naming to Digvation semantic tokens. */
|
|
870
|
+
declare function createProjectThemeTokens(project: ProjectThemeTokens): ThemeTokens;
|
|
871
|
+
/**
|
|
872
|
+
* Creates a theme that reads values from CSS variables owned by the consumer project.
|
|
873
|
+
* Example: createCssVariableTheme({ primary: '--pos-primary', secondary: '--pos-secondary' }).
|
|
874
|
+
*/
|
|
875
|
+
declare function createCssVariableTheme(map: CssVariableThemeMap): ThemeTokens;
|
|
876
|
+
/**
|
|
877
|
+
* Applies only Digvation semantic variables. It does not reset body/html styles.
|
|
878
|
+
* `mode="inherit"` and `radius="inherit"` leave the consumer project's root attributes untouched.
|
|
879
|
+
* Portal-based components can still read the same variables because tokens are applied to documentElement.
|
|
880
|
+
*/
|
|
881
|
+
declare function DThemeProvider({ children, tokens, radius, mode }: ThemeProviderProps): react.JSX.Element;
|
|
882
|
+
|
|
883
|
+
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
884
|
+
interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
885
|
+
src?: string;
|
|
886
|
+
alt?: string;
|
|
887
|
+
name?: string;
|
|
888
|
+
fallback?: ReactNode;
|
|
889
|
+
size?: AvatarSize;
|
|
890
|
+
status?: 'online' | 'offline' | 'busy' | 'away';
|
|
891
|
+
}
|
|
892
|
+
declare function DAvatar({ src, alt, name, fallback, size, status, className, ...props }: AvatarProps): react.JSX.Element;
|
|
893
|
+
|
|
894
|
+
interface TooltipProps {
|
|
895
|
+
content: ReactNode;
|
|
896
|
+
children: ReactElement;
|
|
897
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
898
|
+
className?: string;
|
|
899
|
+
delayMs?: number;
|
|
900
|
+
}
|
|
901
|
+
declare function DTooltip({ content, children, placement, className, delayMs }: TooltipProps): react.JSX.Element;
|
|
902
|
+
|
|
903
|
+
interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
904
|
+
orientation?: 'horizontal' | 'vertical';
|
|
905
|
+
decorative?: boolean;
|
|
906
|
+
}
|
|
907
|
+
declare function DSeparator({ orientation, decorative, className, ...props }: SeparatorProps): react.JSX.Element;
|
|
908
|
+
|
|
909
|
+
interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
910
|
+
size?: 'sm' | 'md' | 'lg';
|
|
911
|
+
label?: string;
|
|
912
|
+
}
|
|
913
|
+
declare function DSpinner({ size, label, className, ...props }: SpinnerProps): react.JSX.Element;
|
|
914
|
+
|
|
915
|
+
interface PaginationProps {
|
|
916
|
+
page: number;
|
|
917
|
+
totalPages: number;
|
|
918
|
+
onChange: (page: number) => void;
|
|
919
|
+
siblingCount?: number;
|
|
920
|
+
disabled?: boolean;
|
|
921
|
+
className?: string;
|
|
922
|
+
}
|
|
923
|
+
declare function getPaginationItems(page: number, total: number, sibling?: number): (number | 'ellipsis')[];
|
|
924
|
+
declare function DPagination({ page, totalPages, onChange, siblingCount, disabled, className, }: PaginationProps): react.JSX.Element;
|
|
925
|
+
|
|
926
|
+
interface TabsProps extends HTMLAttributes<HTMLDivElement> {
|
|
927
|
+
value?: string;
|
|
928
|
+
defaultValue: string;
|
|
929
|
+
onValueChange?: (value: string) => void;
|
|
930
|
+
children: ReactNode;
|
|
931
|
+
}
|
|
932
|
+
declare function DTabs({ value, defaultValue, onValueChange, children, className, ...props }: TabsProps): react.JSX.Element;
|
|
933
|
+
declare function DTabsList({ className, onKeyDown, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
934
|
+
interface TabsTriggerProps extends HTMLAttributes<HTMLButtonElement> {
|
|
935
|
+
value: string;
|
|
936
|
+
disabled?: boolean;
|
|
937
|
+
}
|
|
938
|
+
declare function DTabsTrigger({ value, disabled, className, children, ...props }: TabsTriggerProps): react.JSX.Element;
|
|
939
|
+
interface TabsContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
940
|
+
value: string;
|
|
941
|
+
}
|
|
942
|
+
declare function DTabsContent({ value, className, ...props }: TabsContentProps): react.JSX.Element | null;
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* default = borderless disclosure list
|
|
946
|
+
* separator = borderless list with horizontal separators between items
|
|
947
|
+
* card = one bordered surface with separators inside
|
|
948
|
+
* separated = each item is its own bordered surface
|
|
949
|
+
*/
|
|
950
|
+
type AccordionVariant = 'default' | 'separator' | 'card' | 'separated';
|
|
951
|
+
interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
|
|
952
|
+
type?: 'single' | 'multiple';
|
|
953
|
+
value?: string[];
|
|
954
|
+
defaultValue?: string[];
|
|
955
|
+
onValueChange?: (value: string[]) => void;
|
|
956
|
+
variant?: AccordionVariant;
|
|
957
|
+
}
|
|
958
|
+
declare function DAccordion({ type, value, defaultValue, onValueChange, variant, className, ...props }: AccordionProps): react.JSX.Element;
|
|
959
|
+
interface AccordionItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
960
|
+
value: string;
|
|
961
|
+
title: ReactNode;
|
|
962
|
+
disabled?: boolean;
|
|
963
|
+
}
|
|
964
|
+
declare function DAccordionItem({ value, title, disabled, className, children, ...props }: AccordionItemProps): react.JSX.Element;
|
|
965
|
+
|
|
966
|
+
declare function DBreadcrumb({ className, ...props }: HTMLAttributes<HTMLElement>): react.JSX.Element;
|
|
967
|
+
declare function DBreadcrumbList({ className, ...props }: HTMLAttributes<HTMLOListElement>): react.JSX.Element;
|
|
968
|
+
declare function DBreadcrumbItem({ className, ...props }: HTMLAttributes<HTMLLIElement>): react.JSX.Element;
|
|
969
|
+
interface BreadcrumbLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
970
|
+
active?: boolean;
|
|
971
|
+
}
|
|
972
|
+
declare function DBreadcrumbLink({ active, className, ...props }: BreadcrumbLinkProps): react.JSX.Element;
|
|
973
|
+
declare function DBreadcrumbSeparator({ children, className, ...props }: HTMLAttributes<HTMLSpanElement> & {
|
|
974
|
+
children?: ReactNode;
|
|
975
|
+
}): react.JSX.Element;
|
|
976
|
+
|
|
977
|
+
export { type AccordionItemProps, type AccordionProps, type AccordionVariant, type AlertProps, type AlertVariant, type AvatarProps, type AvatarSize, type BadgeProps, type BadgeVariant, type BreadcrumbLinkProps, type BuiltInLocalizationKey, type ButtonProps, type ButtonSize, type ButtonVariant, type CardProps, type CardVariant, type CellTransform, type CheckboxProps, type ComboboxOption, type ComboboxProps, type ConfirmDialogProps, type ConnectionErrorProps, type ControlledToastItem, type ControlledToastVariant, type CssVariableThemeMap, type CurrencyFormatOptions, type CurrencyInputProps, DAccordion, DAccordionItem, DAlert, DAvatar, DBadge, DBreadcrumb, DBreadcrumbItem, DBreadcrumbLink, DBreadcrumbList, DBreadcrumbSeparator, DButton, DCard, DCardContent, DCardFooter, DCardHeader, DCardSkeleton, DCheckbox, DCombobox, DConfirmDialog, DConnectionError, DCurrencyInput, DDataTable, DDatePicker, DDateRangeFilter, DDecimalInput, DDialog, DDropdown, DEmptyState, DExportButton, DForm, DFormField, type DFormFieldProps, type DFormFieldState, type DFormProps, DFormSkeleton, DInfoNote, DInput, DLoadingIndicator, DLoadingOverlay, DLocalizationProvider, DNotificationPanel, DPagination, DProgress, DRadio, DRangeDatePicker, DSearchInput, DSelect, DSelectFilter, DSeparator, DSkeleton, DSpinner, DSplashScreen, DStatusFilter, DTableSkeleton, DTabs, DTabsContent, DTabsList, DTabsTrigger, DTextarea, DThemeProvider, DTimePicker, DToastContainer, DToastProvider, DToggle, DTooltip, DValidationMessage, type DValidationMessageProps, type DataTableProps, type DatePickerMinuteStep, type DatePickerProps, type DatePickerVariant, type DateRangeFilterProps, type DateRangeValue, type DecimalInputProps, type DecimalNormalizationOptions, type DialogProps, type DialogSize, DropdownContext, type DropdownContextValue, type DropdownProps, type ExportButtonProps, type ExportFormat, type FloatingPlacement, type FloatingScrollBehavior, type FormErrors, type FormRenderProps, type FormValidateOn, type FormValues, type InfoNoteProps, type InfoNoteVariant, type InputFormat, type InputProps, type InputSize, type InputType, type LocalizationContextValue, type LocalizationMessages, type LocalizationParams, type LocalizationProviderProps, type LocalizationTranslator, type NotificationItem, type NotificationPanelProps, type PaginationProps, type ProgressProps, type ProjectThemeTokens, type RadioProps, type RangeDatePickerProps, type SearchInputProps, type SelectFilterProps, type SelectOption, type SelectProps, type SeparatorProps, type SkeletonProps, type SkeletonRounded, type SortDirection, type SpinnerProps, type SplashScreenProps, type StatusFilterProps, type StatusOption, type TableAction, type TableColumn, type TablePagination, type TabsContentProps, type TabsProps, type TabsTriggerProps, type TextareaProps, type ThemeMode, type ThemeProviderProps, type ThemeRadius, type ThemeTokens, type TimePickerMinuteStep, type TimePickerProps, type TimePickerVariant, type ToastContainerProps, type ToastContextValue, type ToastInput, type ToastItem, type ToastProviderProps, type ToastVariant, type ToggleProps, type TooltipProps, type UseDFormFieldOptions, type ValidationContext, type ValidationIssue, type ValidationParams, type ValidationResult, type ValidationRule, type ValidationSchema, type ValidationValue, accepted, cn, createCssVariableTheme, createDTranslator, createProjectThemeTokens, customValidation, date, defaultThemeTokens, email, enMessages, formatCurrencyInputValue, getLocalizedMonthNames, getLocalizedWeekdayNames, getPaginationItems, getPaginationPages, idMessages, integer, maxLength, maxValue, minLength, minValue, normalizeDecimalInput, oneOf, parseCurrencyInputValue, pattern, required, sameAs, selectOptionsFromChildren, themeTokensToCss, time, url, useDFormField, useDLocalization, useDropdown, useDropdownClose, useToast, validateValue };
|