@parasutcom/fds 0.1.7 → 0.1.8
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/dist/index.d.ts +70 -45
- package/dist/index.js +7466 -7226
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -69,51 +69,7 @@ declare const alertVariants: (props?: ({
|
|
|
69
69
|
variant?: "default" | "destructive" | null | undefined;
|
|
70
70
|
} & ClassProp) | undefined) => string;
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
* Autocomplete component with form validation support.
|
|
74
|
-
* Accepts error prop as string or string[] for seamless integration with form libraries.
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* // Standalone with controlled state
|
|
78
|
-
* const [city, setCity] = useState(null)
|
|
79
|
-
*
|
|
80
|
-
* <Autocomplete
|
|
81
|
-
* name="city"
|
|
82
|
-
* options={cities}
|
|
83
|
-
* value={city}
|
|
84
|
-
* onValueChange={setCity}
|
|
85
|
-
* description="Select your city"
|
|
86
|
-
* />
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* // With TanStack Form + Zod (in your project)
|
|
90
|
-
* // 1. Define schema in your project:
|
|
91
|
-
* // const citySchema = z.object({ value: z.string(), label: z.string() }).nullable()
|
|
92
|
-
* // .refine(val => val !== null, { message: 'City required' })
|
|
93
|
-
*
|
|
94
|
-
* // 2. Use in form:
|
|
95
|
-
* <form.Field
|
|
96
|
-
* name="city"
|
|
97
|
-
* validators={{
|
|
98
|
-
* onChange: ({ value }) => {
|
|
99
|
-
* const result = citySchema.safeParse(value)
|
|
100
|
-
* return result.success ? undefined : result.error.issues[0]?.message
|
|
101
|
-
* }
|
|
102
|
-
* }}
|
|
103
|
-
* >
|
|
104
|
-
* {(field) => (
|
|
105
|
-
* <Autocomplete
|
|
106
|
-
* name="city"
|
|
107
|
-
* options={cities}
|
|
108
|
-
* value={field.state.value}
|
|
109
|
-
* onValueChange={field.handleChange}
|
|
110
|
-
* onBlur={field.handleBlur}
|
|
111
|
-
* error={field.state.meta.errors}
|
|
112
|
-
* />
|
|
113
|
-
* )}
|
|
114
|
-
* </form.Field>
|
|
115
|
-
*/
|
|
116
|
-
export declare function Autocomplete<T extends AutocompleteOption>({ options, value, defaultValue, onValueChange, description, error, emptyMessage, name, placeholder, disabled, variant, size, ...props }: AutocompleteProps<T>): JSX.Element;
|
|
72
|
+
export declare function Autocomplete<T extends AutocompleteOption>({ options, value, defaultValue, onValueChange, description, error, emptyMessage, name, placeholder, disabled, variant, size, allowCustomValue, createOption, ...props }: AutocompleteProps<T>): JSX.Element;
|
|
117
73
|
|
|
118
74
|
export declare interface AutocompleteOption {
|
|
119
75
|
value: string;
|
|
@@ -129,6 +85,10 @@ export declare interface AutocompleteProps<T extends AutocompleteOption> extends
|
|
|
129
85
|
error?: string | string[];
|
|
130
86
|
emptyMessage?: string;
|
|
131
87
|
name: string;
|
|
88
|
+
/** Allows creating new options by typing values not in the list. */
|
|
89
|
+
allowCustomValue?: boolean;
|
|
90
|
+
/** Custom function to create option from input. Defaults to { value: input, label: input }. */
|
|
91
|
+
createOption?: (inputValue: string) => T;
|
|
132
92
|
}
|
|
133
93
|
|
|
134
94
|
export declare function Avatar({ className, size, ...props }: Avatar_2.Root.Props & {
|
|
@@ -423,6 +383,14 @@ declare const fieldVariants: (props?: ({
|
|
|
423
383
|
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
424
384
|
} & ClassProp) | undefined) => string;
|
|
425
385
|
|
|
386
|
+
export declare function IbanField({ value, onChange, showPrefix, error, placeholder, ...props }: IbanFieldProps): JSX.Element;
|
|
387
|
+
|
|
388
|
+
export declare interface IbanFieldProps extends Omit<TextFieldProps, 'type' | 'value' | 'onChange' | 'prefix'> {
|
|
389
|
+
value: string;
|
|
390
|
+
onChange: (value: string) => void;
|
|
391
|
+
showPrefix?: boolean;
|
|
392
|
+
}
|
|
393
|
+
|
|
426
394
|
export declare function Input({ className, type, variant, size, ...props }: InputProps): JSX.Element;
|
|
427
395
|
|
|
428
396
|
export declare function InputGroup({ className, variant, size, ...props }: React_2.ComponentProps<"div"> & VariantProps<typeof inputGroupVariants>): JSX.Element;
|
|
@@ -447,6 +415,8 @@ export declare function InputGroupText({ className, ...props }: React_2.Componen
|
|
|
447
415
|
|
|
448
416
|
export declare function InputGroupTextarea({ className, ...props }: React_2.ComponentProps<"textarea">): JSX.Element;
|
|
449
417
|
|
|
418
|
+
declare type InputGroupVariants = Pick<React_2.ComponentProps<typeof InputGroup>, 'variant' | 'size'>;
|
|
419
|
+
|
|
450
420
|
declare const inputGroupVariants: (props?: ({
|
|
451
421
|
variant?: "default" | "outline" | null | undefined;
|
|
452
422
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
@@ -506,6 +476,61 @@ export declare function KbdGroup({ className, ...props }: React.ComponentProps<"
|
|
|
506
476
|
|
|
507
477
|
export declare function Label({ className, ...props }: React_2.ComponentProps<"label">): JSX.Element;
|
|
508
478
|
|
|
479
|
+
/**
|
|
480
|
+
* NumericField - A one-way numeric input component with Turkish formatting
|
|
481
|
+
*
|
|
482
|
+
* @description
|
|
483
|
+
* Provides a numeric input that:
|
|
484
|
+
* - Formats numbers with Turkish locale (dot for thousands, comma for decimals)
|
|
485
|
+
* - Supports configurable decimal places
|
|
486
|
+
* - Can be readonly (display-only) or controlled
|
|
487
|
+
* - Follows the same pattern as TextField component
|
|
488
|
+
* - Handles validation states and descriptions
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* // Basic usage (readonly display)
|
|
492
|
+
* <NumericField
|
|
493
|
+
* name="price"
|
|
494
|
+
* value={1234.56}
|
|
495
|
+
* readonly
|
|
496
|
+
* />
|
|
497
|
+
*
|
|
498
|
+
* @example
|
|
499
|
+
* // Controlled input
|
|
500
|
+
* <NumericField
|
|
501
|
+
* name="amount"
|
|
502
|
+
* value={amount}
|
|
503
|
+
* onChange={setAmount}
|
|
504
|
+
* decimalPlaces={2}
|
|
505
|
+
* description="Tutar giriniz"
|
|
506
|
+
* />
|
|
507
|
+
*
|
|
508
|
+
* @example
|
|
509
|
+
* // With error state
|
|
510
|
+
* <NumericField
|
|
511
|
+
* name="quantity"
|
|
512
|
+
* value={quantity}
|
|
513
|
+
* onChange={setQuantity}
|
|
514
|
+
* error="Miktar 0'dan büyük olmalıdır"
|
|
515
|
+
* decimalPlaces={0}
|
|
516
|
+
* />
|
|
517
|
+
*/
|
|
518
|
+
export declare function NumericField({ name, value, onChange, description, error, variant, size, decimalPlaces, readonly, prefix, suffix, className, disabled, ...props }: NumericFieldProps): JSX.Element;
|
|
519
|
+
|
|
520
|
+
export declare interface NumericFieldProps extends Omit<React_2.ComponentPropsWithoutRef<typeof InputGroupInput>, 'value' | 'onChange' | 'type' | 'inputMode' | 'prefix' | 'ref'> {
|
|
521
|
+
name: string;
|
|
522
|
+
value: number | null | undefined;
|
|
523
|
+
onChange?: (value: number | null) => void;
|
|
524
|
+
description?: string;
|
|
525
|
+
error?: string | string[];
|
|
526
|
+
variant?: InputGroupVariants['variant'];
|
|
527
|
+
size?: InputGroupVariants['size'];
|
|
528
|
+
decimalPlaces?: number;
|
|
529
|
+
readonly?: boolean;
|
|
530
|
+
prefix?: React_2.ReactNode;
|
|
531
|
+
suffix?: React_2.ReactNode;
|
|
532
|
+
}
|
|
533
|
+
|
|
509
534
|
export declare function Pagination({ className, ...props }: React_2.ComponentProps<'nav'>): JSX.Element;
|
|
510
535
|
|
|
511
536
|
export declare function PaginationContent({ className, ...props }: React_2.ComponentProps<'ul'>): JSX.Element;
|