@parasutcom/fds 0.1.7 → 0.1.9

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 CHANGED
@@ -39,7 +39,7 @@ export declare function AlertDescription({ className, ...props }: React_2.Compon
39
39
 
40
40
  export declare function AlertDialog({ ...props }: AlertDialog_2.Root.Props): JSX.Element;
41
41
 
42
- export declare function AlertDialogAction({ className, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
42
+ export declare function AlertDialogAction({ className, variant, size, ...props }: AlertDialog_2.Close.Props & Pick<React_2.ComponentProps<typeof Button>, 'variant' | 'size'>): JSX.Element;
43
43
 
44
44
  export declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialog_2.Close.Props & Pick<React_2.ComponentProps<typeof Button>, 'variant' | 'size'>): JSX.Element;
45
45
 
@@ -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 & {
@@ -314,6 +274,45 @@ export declare function CommandSeparator({ className, ...props }: React_2.Compon
314
274
 
315
275
  export declare function CommandShortcut({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
316
276
 
277
+ export declare function DeleteDialog({ onConfirm, children, mode, count, open: controlledOpen, onOpenChange: controlledOnOpenChange, title, description, }: DeleteDialogProps): JSX.Element;
278
+
279
+ declare interface DeleteDialogProps {
280
+ /**
281
+ * Callback when delete is confirmed
282
+ */
283
+ onConfirm: () => void;
284
+ /**
285
+ * Custom trigger element (defaults to a button with generic delete text)
286
+ */
287
+ children?: ReactElement;
288
+ /**
289
+ * Delete mode: single item or bulk items
290
+ * @default 'single'
291
+ */
292
+ mode?: 'single' | 'bulk';
293
+ /**
294
+ * Number of items to delete (used in bulk mode)
295
+ * @default 1
296
+ */
297
+ count?: number;
298
+ /**
299
+ * Controlled open state
300
+ */
301
+ open?: boolean;
302
+ /**
303
+ * Controlled open state handler
304
+ */
305
+ onOpenChange?: (open: boolean) => void;
306
+ /**
307
+ * Override dialog title (otherwise uses i18n default)
308
+ */
309
+ title?: string;
310
+ /**
311
+ * Override dialog description (otherwise uses i18n default based on mode)
312
+ */
313
+ description?: string;
314
+ }
315
+
317
316
  export declare function Dialog({ ...props }: Dialog_2.Root.Props): JSX.Element;
318
317
 
319
318
  export declare function DialogClose({ ...props }: Dialog_2.Close.Props): JSX.Element;
@@ -423,6 +422,14 @@ declare const fieldVariants: (props?: ({
423
422
  orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
424
423
  } & ClassProp) | undefined) => string;
425
424
 
425
+ export declare function IbanField({ value, onChange, showPrefix, error, placeholder, ...props }: IbanFieldProps): JSX.Element;
426
+
427
+ export declare interface IbanFieldProps extends Omit<TextFieldProps, 'type' | 'value' | 'onChange' | 'prefix'> {
428
+ value: string;
429
+ onChange: (value: string) => void;
430
+ showPrefix?: boolean;
431
+ }
432
+
426
433
  export declare function Input({ className, type, variant, size, ...props }: InputProps): JSX.Element;
427
434
 
428
435
  export declare function InputGroup({ className, variant, size, ...props }: React_2.ComponentProps<"div"> & VariantProps<typeof inputGroupVariants>): JSX.Element;
@@ -447,6 +454,8 @@ export declare function InputGroupText({ className, ...props }: React_2.Componen
447
454
 
448
455
  export declare function InputGroupTextarea({ className, ...props }: React_2.ComponentProps<"textarea">): JSX.Element;
449
456
 
457
+ declare type InputGroupVariants = Pick<React_2.ComponentProps<typeof InputGroup>, 'variant' | 'size'>;
458
+
450
459
  declare const inputGroupVariants: (props?: ({
451
460
  variant?: "default" | "outline" | null | undefined;
452
461
  size?: "default" | "sm" | "lg" | null | undefined;
@@ -506,6 +515,61 @@ export declare function KbdGroup({ className, ...props }: React.ComponentProps<"
506
515
 
507
516
  export declare function Label({ className, ...props }: React_2.ComponentProps<"label">): JSX.Element;
508
517
 
518
+ /**
519
+ * NumericField - A one-way numeric input component with Turkish formatting
520
+ *
521
+ * @description
522
+ * Provides a numeric input that:
523
+ * - Formats numbers with Turkish locale (dot for thousands, comma for decimals)
524
+ * - Supports configurable decimal places
525
+ * - Can be readonly (display-only) or controlled
526
+ * - Follows the same pattern as TextField component
527
+ * - Handles validation states and descriptions
528
+ *
529
+ * @example
530
+ * // Basic usage (readonly display)
531
+ * <NumericField
532
+ * name="price"
533
+ * value={1234.56}
534
+ * readonly
535
+ * />
536
+ *
537
+ * @example
538
+ * // Controlled input
539
+ * <NumericField
540
+ * name="amount"
541
+ * value={amount}
542
+ * onChange={setAmount}
543
+ * decimalPlaces={2}
544
+ * description="Tutar giriniz"
545
+ * />
546
+ *
547
+ * @example
548
+ * // With error state
549
+ * <NumericField
550
+ * name="quantity"
551
+ * value={quantity}
552
+ * onChange={setQuantity}
553
+ * error="Miktar 0'dan büyük olmalıdır"
554
+ * decimalPlaces={0}
555
+ * />
556
+ */
557
+ export declare function NumericField({ name, value, onChange, description, error, variant, size, decimalPlaces, readonly, prefix, suffix, className, disabled, ...props }: NumericFieldProps): JSX.Element;
558
+
559
+ export declare interface NumericFieldProps extends Omit<React_2.ComponentPropsWithoutRef<typeof InputGroupInput>, 'value' | 'onChange' | 'type' | 'inputMode' | 'prefix' | 'ref'> {
560
+ name: string;
561
+ value: number | null | undefined;
562
+ onChange?: (value: number | null) => void;
563
+ description?: string;
564
+ error?: string | string[];
565
+ variant?: InputGroupVariants['variant'];
566
+ size?: InputGroupVariants['size'];
567
+ decimalPlaces?: number;
568
+ readonly?: boolean;
569
+ prefix?: React_2.ReactNode;
570
+ suffix?: React_2.ReactNode;
571
+ }
572
+
509
573
  export declare function Pagination({ className, ...props }: React_2.ComponentProps<'nav'>): JSX.Element;
510
574
 
511
575
  export declare function PaginationContent({ className, ...props }: React_2.ComponentProps<'ul'>): JSX.Element;