@texturehq/edges 0.1.6 → 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.cts CHANGED
@@ -294,6 +294,32 @@ interface CheckboxProps extends Omit<CheckboxProps$1, "children"> {
294
294
  }
295
295
  declare function Checkbox(props: CheckboxProps): react_jsx_runtime.JSX.Element;
296
296
 
297
+ interface ChipProps {
298
+ /** The content to display inside the chip */
299
+ children: React__default.ReactNode;
300
+ /** Callback when the remove button is clicked */
301
+ onRemove?: () => void;
302
+ /** Size variant of the chip */
303
+ size?: Size;
304
+ /** Visual variant of the chip */
305
+ variant?: "default" | "primary" | "secondary";
306
+ /** Whether the chip can be removed (shows X button) */
307
+ isRemovable?: boolean;
308
+ /** Whether the chip is disabled */
309
+ isDisabled?: boolean;
310
+ /** Additional CSS classes */
311
+ className?: string;
312
+ /** Click handler for the chip itself (not the remove button) */
313
+ onClick?: () => void;
314
+ }
315
+ /**
316
+ * Chip
317
+ *
318
+ * A compact element that represents an input, attribute, or action.
319
+ * Can be removable with an X button and supports different variants and sizes.
320
+ */
321
+ declare function Chip({ children, onRemove, size, variant, isRemovable, isDisabled, className, onClick, }: ChipProps): react_jsx_runtime.JSX.Element;
322
+
297
323
  interface CopyToClipboardProps {
298
324
  /**
299
325
  * The value to copy to clipboard. If not provided, will use the text content of children
@@ -395,6 +421,8 @@ interface DrawerProps {
395
421
  footerContent?: React__default.ReactNode;
396
422
  /** Whether to include padding inside the content area. Defaults to true. */
397
423
  contentPadding?: boolean;
424
+ /** Maximum width of the drawer. Defaults to "400px". Can be any valid CSS width value. */
425
+ maxWidth?: string;
398
426
  }
399
427
  declare const Drawer: React__default.FC<DrawerProps>;
400
428
 
@@ -815,7 +843,9 @@ interface SelectProps<T extends SelectItem> extends Omit<SelectProps$1<T>, "chil
815
843
  /** Size variant of the select */
816
844
  size?: Size;
817
845
  /** Render function for items or static children */
818
- children: React__default.ReactNode | ((item: T) => React__default.ReactNode);
846
+ children?: React__default.ReactNode | ((item: T) => React__default.ReactNode);
847
+ /** Custom render function for individual items. When provided, items prop is used to render items automatically */
848
+ renderItem?: (item: T) => React__default.ReactNode;
819
849
  /** Currently selected item's id. Uses the SelectItem's `id` field for stable selection tracking */
820
850
  selectedKey?: Key;
821
851
  /** Default selected item's id for uncontrolled usage */
@@ -833,7 +863,7 @@ interface SelectProps<T extends SelectItem> extends Omit<SelectProps$1<T>, "chil
833
863
  /** Whether to use transparent background */
834
864
  transparent?: boolean;
835
865
  }
836
- declare function Select<T extends SelectItem>({ label, description, errorMessage, children, items, size, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, placeholder, showErrors, tooltip, isRequired, transparent, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
866
+ declare function Select<T extends SelectItem>({ label, description, errorMessage, children, items, renderItem, size, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, placeholder, showErrors, tooltip, isRequired, transparent, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
837
867
 
838
868
  interface SkeletonProps {
839
869
  width?: number | string;
@@ -885,16 +915,49 @@ declare function TabPanel(props: TabPanelProps): react_jsx_runtime.JSX.Element;
885
915
  *
886
916
  * Multi-line text input with Edges styling, label, description, and error.
887
917
  */
888
- interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, "size">, BaseInputProps {
918
+ interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "disabled">, BaseInputProps {
889
919
  label?: string;
890
920
  description?: string;
891
921
  errorMessage?: string | ((validation: ValidationResult) => string);
892
922
  tooltip?: string;
893
923
  size?: Size;
894
924
  isInvalid?: boolean;
925
+ isDisabled?: boolean;
895
926
  validationResult?: ValidationResult;
896
927
  }
897
- declare function TextArea({ label, description, errorMessage, size, tooltip, required, transparent, isInvalid, className, validationResult, ...props }: TextAreaProps): react_jsx_runtime.JSX.Element;
928
+ declare function TextArea({ label, description, errorMessage, size, tooltip, required, transparent, isInvalid, isDisabled, className, validationResult, ...props }: TextAreaProps): react_jsx_runtime.JSX.Element;
929
+
930
+ interface ChipData {
931
+ id: string;
932
+ label: string;
933
+ value: unknown;
934
+ }
935
+ interface TriggerInfo {
936
+ query: string;
937
+ position: number;
938
+ startIndex: number;
939
+ }
940
+ interface TextAreaWithChipsProps extends Omit<React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "value" | "onChange" | "disabled">, BaseInputProps {
941
+ label?: string;
942
+ description?: string;
943
+ errorMessage?: string | ((validation: ValidationResult) => string);
944
+ tooltip?: string;
945
+ size?: Size;
946
+ isInvalid?: boolean;
947
+ isDisabled?: boolean;
948
+ validationResult?: ValidationResult;
949
+ value?: string;
950
+ onChange?: (value: string) => void;
951
+ chips?: ChipData[];
952
+ onChipsChange?: (chips: ChipData[]) => void;
953
+ triggerPattern?: string | RegExp;
954
+ onTriggerDetected?: (triggerInfo: TriggerInfo) => void;
955
+ onTriggerDismissed?: () => void;
956
+ renderChip?: (chip: ChipData, onRemove: () => void) => React__default.ReactNode;
957
+ chipVariant?: "default" | "primary" | "secondary";
958
+ chipSize?: Size;
959
+ }
960
+ declare function TextAreaWithChips({ label, description, errorMessage, size, tooltip, required, transparent, isInvalid, isDisabled, className, validationResult, value, onChange, chips, onChipsChange, triggerPattern, onTriggerDetected, onTriggerDismissed, renderChip, chipVariant, chipSize, ...props }: TextAreaWithChipsProps): react_jsx_runtime.JSX.Element;
898
961
 
899
962
  /**
900
963
  * TextField
@@ -1029,4 +1092,4 @@ declare function Radio(props: RadioProps): react_jsx_runtime.JSX.Element;
1029
1092
 
1030
1093
  declare function useDebounce<T>(value: T, delay?: number): T;
1031
1094
 
1032
- export { Autocomplete, type BaseInputProps, type BaseProps, Button, Calendar, Card, Checkbox, ClearButton, CopyToClipboard, DateField, DateRangePicker, Description, type DescriptionProps, Dialog, DialogHeader, Drawer, ErrorBoundary, FieldError, type FieldErrorProps, FieldGroup, type FieldGroupProps, Form, Heading, Icon, Input, type InputProps, type InputStyleProps, InputWrapper, Label, type LabelProps, ListBox, ListBoxItem, Loader, Logo, NumberField, PlaceSearch, Popover, ProgressBar, Radio, RadioGroup, RangeCalendar, Select, Skeleton, Slider, Switch, Tab, TabList, TabPanel, Tabs, TextArea, TextField, TextLink, TimeField, ToggleButton, Tooltip, getFieldGroupStyles, getInputBackgroundStyles, getInputBaseStyles, getInputStateStyles, useDebounce, useInputFocus };
1095
+ export { Autocomplete, type BaseInputProps, type BaseProps, Button, Calendar, Card, Checkbox, Chip, ClearButton, CopyToClipboard, DateField, DateRangePicker, Description, type DescriptionProps, Dialog, DialogHeader, Drawer, ErrorBoundary, FieldError, type FieldErrorProps, FieldGroup, type FieldGroupProps, Form, Heading, Icon, Input, type InputProps, type InputStyleProps, InputWrapper, Label, type LabelProps, ListBox, ListBoxItem, Loader, Logo, NumberField, PlaceSearch, Popover, ProgressBar, Radio, RadioGroup, RangeCalendar, Select, Skeleton, Slider, Switch, Tab, TabList, TabPanel, Tabs, TextArea, TextAreaWithChips, TextField, TextLink, TimeField, ToggleButton, Tooltip, getFieldGroupStyles, getInputBackgroundStyles, getInputBaseStyles, getInputStateStyles, useDebounce, useInputFocus };
package/dist/index.d.ts CHANGED
@@ -294,6 +294,32 @@ interface CheckboxProps extends Omit<CheckboxProps$1, "children"> {
294
294
  }
295
295
  declare function Checkbox(props: CheckboxProps): react_jsx_runtime.JSX.Element;
296
296
 
297
+ interface ChipProps {
298
+ /** The content to display inside the chip */
299
+ children: React__default.ReactNode;
300
+ /** Callback when the remove button is clicked */
301
+ onRemove?: () => void;
302
+ /** Size variant of the chip */
303
+ size?: Size;
304
+ /** Visual variant of the chip */
305
+ variant?: "default" | "primary" | "secondary";
306
+ /** Whether the chip can be removed (shows X button) */
307
+ isRemovable?: boolean;
308
+ /** Whether the chip is disabled */
309
+ isDisabled?: boolean;
310
+ /** Additional CSS classes */
311
+ className?: string;
312
+ /** Click handler for the chip itself (not the remove button) */
313
+ onClick?: () => void;
314
+ }
315
+ /**
316
+ * Chip
317
+ *
318
+ * A compact element that represents an input, attribute, or action.
319
+ * Can be removable with an X button and supports different variants and sizes.
320
+ */
321
+ declare function Chip({ children, onRemove, size, variant, isRemovable, isDisabled, className, onClick, }: ChipProps): react_jsx_runtime.JSX.Element;
322
+
297
323
  interface CopyToClipboardProps {
298
324
  /**
299
325
  * The value to copy to clipboard. If not provided, will use the text content of children
@@ -395,6 +421,8 @@ interface DrawerProps {
395
421
  footerContent?: React__default.ReactNode;
396
422
  /** Whether to include padding inside the content area. Defaults to true. */
397
423
  contentPadding?: boolean;
424
+ /** Maximum width of the drawer. Defaults to "400px". Can be any valid CSS width value. */
425
+ maxWidth?: string;
398
426
  }
399
427
  declare const Drawer: React__default.FC<DrawerProps>;
400
428
 
@@ -815,7 +843,9 @@ interface SelectProps<T extends SelectItem> extends Omit<SelectProps$1<T>, "chil
815
843
  /** Size variant of the select */
816
844
  size?: Size;
817
845
  /** Render function for items or static children */
818
- children: React__default.ReactNode | ((item: T) => React__default.ReactNode);
846
+ children?: React__default.ReactNode | ((item: T) => React__default.ReactNode);
847
+ /** Custom render function for individual items. When provided, items prop is used to render items automatically */
848
+ renderItem?: (item: T) => React__default.ReactNode;
819
849
  /** Currently selected item's id. Uses the SelectItem's `id` field for stable selection tracking */
820
850
  selectedKey?: Key;
821
851
  /** Default selected item's id for uncontrolled usage */
@@ -833,7 +863,7 @@ interface SelectProps<T extends SelectItem> extends Omit<SelectProps$1<T>, "chil
833
863
  /** Whether to use transparent background */
834
864
  transparent?: boolean;
835
865
  }
836
- declare function Select<T extends SelectItem>({ label, description, errorMessage, children, items, size, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, placeholder, showErrors, tooltip, isRequired, transparent, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
866
+ declare function Select<T extends SelectItem>({ label, description, errorMessage, children, items, renderItem, size, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, placeholder, showErrors, tooltip, isRequired, transparent, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
837
867
 
838
868
  interface SkeletonProps {
839
869
  width?: number | string;
@@ -885,16 +915,49 @@ declare function TabPanel(props: TabPanelProps): react_jsx_runtime.JSX.Element;
885
915
  *
886
916
  * Multi-line text input with Edges styling, label, description, and error.
887
917
  */
888
- interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, "size">, BaseInputProps {
918
+ interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "disabled">, BaseInputProps {
889
919
  label?: string;
890
920
  description?: string;
891
921
  errorMessage?: string | ((validation: ValidationResult) => string);
892
922
  tooltip?: string;
893
923
  size?: Size;
894
924
  isInvalid?: boolean;
925
+ isDisabled?: boolean;
895
926
  validationResult?: ValidationResult;
896
927
  }
897
- declare function TextArea({ label, description, errorMessage, size, tooltip, required, transparent, isInvalid, className, validationResult, ...props }: TextAreaProps): react_jsx_runtime.JSX.Element;
928
+ declare function TextArea({ label, description, errorMessage, size, tooltip, required, transparent, isInvalid, isDisabled, className, validationResult, ...props }: TextAreaProps): react_jsx_runtime.JSX.Element;
929
+
930
+ interface ChipData {
931
+ id: string;
932
+ label: string;
933
+ value: unknown;
934
+ }
935
+ interface TriggerInfo {
936
+ query: string;
937
+ position: number;
938
+ startIndex: number;
939
+ }
940
+ interface TextAreaWithChipsProps extends Omit<React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "value" | "onChange" | "disabled">, BaseInputProps {
941
+ label?: string;
942
+ description?: string;
943
+ errorMessage?: string | ((validation: ValidationResult) => string);
944
+ tooltip?: string;
945
+ size?: Size;
946
+ isInvalid?: boolean;
947
+ isDisabled?: boolean;
948
+ validationResult?: ValidationResult;
949
+ value?: string;
950
+ onChange?: (value: string) => void;
951
+ chips?: ChipData[];
952
+ onChipsChange?: (chips: ChipData[]) => void;
953
+ triggerPattern?: string | RegExp;
954
+ onTriggerDetected?: (triggerInfo: TriggerInfo) => void;
955
+ onTriggerDismissed?: () => void;
956
+ renderChip?: (chip: ChipData, onRemove: () => void) => React__default.ReactNode;
957
+ chipVariant?: "default" | "primary" | "secondary";
958
+ chipSize?: Size;
959
+ }
960
+ declare function TextAreaWithChips({ label, description, errorMessage, size, tooltip, required, transparent, isInvalid, isDisabled, className, validationResult, value, onChange, chips, onChipsChange, triggerPattern, onTriggerDetected, onTriggerDismissed, renderChip, chipVariant, chipSize, ...props }: TextAreaWithChipsProps): react_jsx_runtime.JSX.Element;
898
961
 
899
962
  /**
900
963
  * TextField
@@ -1029,4 +1092,4 @@ declare function Radio(props: RadioProps): react_jsx_runtime.JSX.Element;
1029
1092
 
1030
1093
  declare function useDebounce<T>(value: T, delay?: number): T;
1031
1094
 
1032
- export { Autocomplete, type BaseInputProps, type BaseProps, Button, Calendar, Card, Checkbox, ClearButton, CopyToClipboard, DateField, DateRangePicker, Description, type DescriptionProps, Dialog, DialogHeader, Drawer, ErrorBoundary, FieldError, type FieldErrorProps, FieldGroup, type FieldGroupProps, Form, Heading, Icon, Input, type InputProps, type InputStyleProps, InputWrapper, Label, type LabelProps, ListBox, ListBoxItem, Loader, Logo, NumberField, PlaceSearch, Popover, ProgressBar, Radio, RadioGroup, RangeCalendar, Select, Skeleton, Slider, Switch, Tab, TabList, TabPanel, Tabs, TextArea, TextField, TextLink, TimeField, ToggleButton, Tooltip, getFieldGroupStyles, getInputBackgroundStyles, getInputBaseStyles, getInputStateStyles, useDebounce, useInputFocus };
1095
+ export { Autocomplete, type BaseInputProps, type BaseProps, Button, Calendar, Card, Checkbox, Chip, ClearButton, CopyToClipboard, DateField, DateRangePicker, Description, type DescriptionProps, Dialog, DialogHeader, Drawer, ErrorBoundary, FieldError, type FieldErrorProps, FieldGroup, type FieldGroupProps, Form, Heading, Icon, Input, type InputProps, type InputStyleProps, InputWrapper, Label, type LabelProps, ListBox, ListBoxItem, Loader, Logo, NumberField, PlaceSearch, Popover, ProgressBar, Radio, RadioGroup, RangeCalendar, Select, Skeleton, Slider, Switch, Tab, TabList, TabPanel, Tabs, TextArea, TextAreaWithChips, TextField, TextLink, TimeField, ToggleButton, Tooltip, getFieldGroupStyles, getInputBackgroundStyles, getInputBaseStyles, getInputStateStyles, useDebounce, useInputFocus };