@texturehq/edges 0.0.18 → 0.0.19

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
@@ -4,6 +4,19 @@ import React__default, { ComponentProps, ReactNode, Component, ErrorInfo } from
4
4
  import { Key, ValidationResult, ButtonProps as ButtonProps$1, DateValue, CalendarProps as CalendarProps$1, CheckboxProps as CheckboxProps$1, CheckboxRenderProps, DateFieldProps as DateFieldProps$1, DateRangePickerProps as DateRangePickerProps$1, DialogProps, TextProps, FormProps, ListBoxProps as ListBoxProps$1, ListBoxItemProps, NumberFieldProps as NumberFieldProps$1, PopoverProps as PopoverProps$1, ProgressBarProps as ProgressBarProps$1, RangeCalendarProps as RangeCalendarProps$1, SelectProps as SelectProps$1, SwitchProps as SwitchProps$1, TabProps as TabProps$1, TabListProps, TabPanelProps, TabsProps, TextFieldProps as TextFieldProps$1, TimeFieldProps as TimeFieldProps$1, TimeValue, TooltipProps as TooltipProps$1 } from 'react-aria-components';
5
5
  import * as _phosphor_icons_react from '@phosphor-icons/react';
6
6
 
7
+ /**
8
+ * Control-specific style utilities for form elements and interactive components.
9
+ * These styles use CSS variables defined in the theme for consistent sizing
10
+ * and spacing across all control elements.
11
+ *
12
+ * Text sizes follow the relationships defined in theme.css:
13
+ * sm: --control-text-sm (maps to --text-xs)
14
+ * md: --control-text-md (maps to --text-sm)
15
+ * lg: --control-text-lg (maps to --text-base)
16
+ * xl: --control-text-xl (maps to --text-lg)
17
+ */
18
+ type Size = "sm" | "md" | "lg" | "xl";
19
+
7
20
  interface Item {
8
21
  id: string;
9
22
  name: string;
@@ -33,6 +46,11 @@ interface GraphQLRequestConfig extends BaseRequestConfig {
33
46
  shouldLoad?: (filterText: string) => boolean;
34
47
  }
35
48
  type AutocompleteRequestConfig = RestRequestConfig | GraphQLRequestConfig;
49
+ /**
50
+ * Autocomplete
51
+ *
52
+ * Text input with typeahead suggestions and keyboard navigation.
53
+ */
36
54
  interface AutocompleteProps {
37
55
  label?: string;
38
56
  staticItems?: Item[];
@@ -47,16 +65,16 @@ interface AutocompleteProps {
47
65
  renderLeftIcon?: (isLoading: boolean) => React__default.ReactNode;
48
66
  errorMessage?: string | ((validation: ValidationResult) => string);
49
67
  description?: string;
50
- size?: "sm" | "md" | "lg" | "xl";
68
+ size?: Size;
51
69
  tooltip?: string;
52
70
  isRequired?: boolean;
53
71
  isDisabled?: boolean;
72
+ isInvalid?: boolean;
54
73
  validationResult?: ValidationResult;
55
74
  showErrors?: boolean;
56
75
  autoFocus?: boolean;
57
- onLoadError?: (error: Error) => void;
58
76
  }
59
- declare function Autocomplete({ label, staticItems, sections, selectedKey, defaultSelectedKey, onSelectionChange, requestConfig, defaultFilter, errorMessage, size, tooltip, isRequired, isDisabled, renderLeftIcon, autoFocus, onLoadError, }: AutocompleteProps): react_jsx_runtime.JSX.Element;
77
+ declare function Autocomplete({ label, staticItems, sections, selectedKey, defaultSelectedKey, onSelectionChange, requestConfig, defaultFilter, placeholder, errorMessage, description, size, tooltip, isRequired, isDisabled, isInvalid, validationResult, showErrors, renderItem, renderLeftIcon, autoFocus, }: AutocompleteProps): react_jsx_runtime.JSX.Element;
60
78
 
61
79
  declare const iconMapping: {
62
80
  readonly AppWindow: _phosphor_icons_react.Icon;
@@ -199,21 +217,20 @@ interface ExtendedIconProps {
199
217
  }
200
218
  declare const Icon: React$1.MemoExoticComponent<({ name, size, color, weight, className, title, ariaLabel, grow, variant, rounded, bgColor, ...props }: ExtendedIconProps) => react_jsx_runtime.JSX.Element | null>;
201
219
 
220
+ type IconName$1 = ComponentProps<typeof Icon>["name"];
221
+ type BaseButtonProps = Omit<ButtonProps$1, "className">;
202
222
  /**
203
- * Control-specific style utilities for form elements and interactive components.
204
- * These styles use CSS variables defined in the theme for consistent sizing
205
- * and spacing across all control elements.
223
+ * Button
206
224
  *
207
- * Text sizes follow the relationships defined in theme.css:
208
- * sm: --control-text-sm (maps to --text-xs)
209
- * md: --control-text-md (maps to --text-sm)
210
- * lg: --control-text-lg (maps to --text-base)
211
- * xl: --control-text-xl (maps to --text-lg)
225
+ * A versatile action component that supports multiple visual variants, sizes,
226
+ * optional icons, a loading state, and badge indicators. Follows the Edges
227
+ * design system tokens and composes `react-aria-components` under the hood.
228
+ *
229
+ * Example usage:
230
+ * ```tsx
231
+ * <Button variant="primary" size="md" icon="Check">Save</Button>
232
+ * ```
212
233
  */
213
- type Size = "sm" | "md" | "lg" | "xl";
214
-
215
- type IconName$1 = ComponentProps<typeof Icon>["name"];
216
- type BaseButtonProps = Omit<ButtonProps$1, "className">;
217
234
  interface ButtonProps extends BaseButtonProps {
218
235
  variant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
219
236
  size?: Size;
@@ -233,13 +250,27 @@ interface ButtonProps extends BaseButtonProps {
233
250
  rel?: string;
234
251
  style?: React.CSSProperties;
235
252
  }
253
+ /**
254
+ * Renders an Edges Button. When `href` is provided, renders a link-styled
255
+ * button using the same visual system.
256
+ */
236
257
  declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
237
258
 
259
+ /**
260
+ * Calendar
261
+ *
262
+ * Single-date calendar primitive with Edges styling.
263
+ */
238
264
  interface CalendarProps<T extends DateValue> extends Omit<CalendarProps$1<T>, "visibleDuration"> {
239
265
  errorMessage?: string;
240
266
  }
241
267
  declare function Calendar<T extends DateValue>({ errorMessage, ...props }: CalendarProps<T>): react_jsx_runtime.JSX.Element;
242
268
 
269
+ /**
270
+ * Card
271
+ *
272
+ * Surface container with optional heading and actions.
273
+ */
243
274
  interface CardProps {
244
275
  heading?: React__default.ReactNode;
245
276
  upperRightText?: React__default.ReactNode;
@@ -251,6 +282,11 @@ interface CardProps {
251
282
  }
252
283
  declare const Card: React__default.FC<CardProps>;
253
284
 
285
+ /**
286
+ * Checkbox
287
+ *
288
+ * Single checkbox with Edges visuals.
289
+ */
254
290
  interface CheckboxProps extends Omit<CheckboxProps$1, "children"> {
255
291
  children?: ReactNode | ((props: CheckboxRenderProps) => ReactNode);
256
292
  }
@@ -276,6 +312,11 @@ interface CopyToClipboardProps {
276
312
  }
277
313
  declare function CopyToClipboard({ value, children, className, size }: CopyToClipboardProps): react_jsx_runtime.JSX.Element;
278
314
 
315
+ /**
316
+ * DateField
317
+ *
318
+ * Segmented date input with Edges styling.
319
+ */
279
320
  interface DateFieldProps<T extends DateValue> extends DateFieldProps$1<T> {
280
321
  label?: string;
281
322
  description?: string;
@@ -283,6 +324,11 @@ interface DateFieldProps<T extends DateValue> extends DateFieldProps$1<T> {
283
324
  }
284
325
  declare function DateField<T extends DateValue>({ label, description, errorMessage, ...props }: DateFieldProps<T>): react_jsx_runtime.JSX.Element;
285
326
 
327
+ /**
328
+ * DateRangePicker
329
+ *
330
+ * Composed date range input with popover calendar.
331
+ */
286
332
  interface DateRangePickerProps<T extends DateValue> extends DateRangePickerProps$1<T> {
287
333
  label?: string;
288
334
  description?: string;
@@ -290,6 +336,11 @@ interface DateRangePickerProps<T extends DateValue> extends DateRangePickerProps
290
336
  }
291
337
  declare function DateRangePicker<T extends DateValue>({ label, description, errorMessage, ...props }: DateRangePickerProps<T>): react_jsx_runtime.JSX.Element;
292
338
 
339
+ /**
340
+ * Dialog
341
+ *
342
+ * Generic modal/dialog surface with Edges defaults.
343
+ */
293
344
  declare function Dialog(props: DialogProps): react_jsx_runtime.JSX.Element;
294
345
 
295
346
  type BaseDialogHeaderProps = {
@@ -306,6 +357,11 @@ type WithoutBackArrow = BaseDialogHeaderProps & {
306
357
  hasBackArrow?: false;
307
358
  onBack?: never;
308
359
  };
360
+ /**
361
+ * DialogHeader
362
+ *
363
+ * Header area for dialogs with optional back arrow.
364
+ */
309
365
  type DialogHeaderProps = WithBackArrow | WithoutBackArrow;
310
366
  declare const DialogHeader: React__default.FC<DialogHeaderProps>;
311
367
 
@@ -317,6 +373,11 @@ interface DrawerAction {
317
373
  isLoading?: boolean;
318
374
  isDisabled?: boolean;
319
375
  }
376
+ /**
377
+ * Drawer
378
+ *
379
+ * Sliding panel that anchors to screen edges.
380
+ */
320
381
  interface DrawerProps {
321
382
  title?: string;
322
383
  headerContent?: React__default.ReactNode;
@@ -548,6 +609,11 @@ declare function Input({ size, isInvalid, isDisabled, isFocused, transparent, cl
548
609
  */
549
610
  declare function FieldGroup(props: FieldGroupProps): react_jsx_runtime.JSX.Element;
550
611
 
612
+ /**
613
+ * Form
614
+ *
615
+ * Accessibility-first form wrapper with consistent spacing.
616
+ */
551
617
  declare function Form(props: FormProps): react_jsx_runtime.JSX.Element;
552
618
 
553
619
  declare const sizeVariants: {
@@ -562,6 +628,11 @@ declare const heightVariants: {
562
628
  };
563
629
  type HeadingSize = keyof typeof sizeVariants;
564
630
  type HeadingHeight = keyof typeof heightVariants;
631
+ /**
632
+ * Heading
633
+ *
634
+ * Typography component for page/section headings with size and height options.
635
+ */
565
636
  interface HeadingProps {
566
637
  tag?: keyof JSX.IntrinsicElements;
567
638
  size?: HeadingSize;
@@ -571,10 +642,22 @@ interface HeadingProps {
571
642
  }
572
643
  declare function Heading({ tag: Tag, size, height, className, children }: HeadingProps): react_jsx_runtime.JSX.Element;
573
644
 
645
+ /**
646
+ * ListBox
647
+ *
648
+ * Styled wrapper around `react-aria-components` ListBox and related parts
649
+ * used in dropdowns and menus.
650
+ */
574
651
  interface ListBoxProps<T> extends Omit<ListBoxProps$1<T>, "layout" | "orientation"> {
575
652
  }
576
653
  declare function ListBox<T extends object>({ children, ...props }: ListBoxProps<T>): react_jsx_runtime.JSX.Element;
577
654
 
655
+ /**
656
+ * ListBoxItem
657
+ *
658
+ * A styled wrapper around `react-aria-components` ListBoxItem with size
659
+ * variants that align with Edges typography.
660
+ */
578
661
  interface ExtendedListBoxItemProps extends Omit<ListBoxItemProps, "className"> {
579
662
  size?: "sm" | "md" | "lg" | "xl";
580
663
  className?: string;
@@ -605,6 +688,11 @@ interface LogoProps {
605
688
  }
606
689
  declare const Logo: ({ className, showWordmark }: LogoProps) => react_jsx_runtime.JSX.Element;
607
690
 
691
+ /**
692
+ * NumberField
693
+ *
694
+ * Numeric input with stepper controls and validation.
695
+ */
608
696
  interface NumberFieldProps extends Omit<NumberFieldProps$1, "size" | "className">, BaseInputProps {
609
697
  value?: number;
610
698
  defaultValue?: number;
@@ -631,6 +719,12 @@ interface Place {
631
719
  center: [number, number];
632
720
  }
633
721
  type SearchType = "country" | "region" | "district" | "place" | "locality" | "neighborhood" | "address" | "street";
722
+ /**
723
+ * PlaceSearch
724
+ *
725
+ * Location search component with autocomplete; emits a `Place` value on
726
+ * selection.
727
+ */
634
728
  interface PlaceSearchProps {
635
729
  label?: string;
636
730
  selectedKey?: Key | null;
@@ -654,12 +748,23 @@ interface PlaceSearchProps {
654
748
  }
655
749
  declare function PlaceSearch({ label, selectedKey, defaultSelectedKey, onSelectionChange, placeholder, errorMessage, description, size, tooltip, isRequired, isDisabled, showErrors, autoFocus, onSelect, searchTypes, defaultFilter, validationResult, countryRestrictions, proximity, }: PlaceSearchProps): react_jsx_runtime.JSX.Element;
656
750
 
751
+ /**
752
+ * Popover
753
+ *
754
+ * Positioned overlay container with optional arrow, built on
755
+ * `react-aria-components` Popover.
756
+ */
657
757
  interface PopoverProps extends Omit<PopoverProps$1, "children"> {
658
758
  showArrow?: boolean;
659
759
  children: React__default.ReactNode;
660
760
  }
661
761
  declare function Popover({ children, showArrow, className, ...props }: PopoverProps): react_jsx_runtime.JSX.Element;
662
762
 
763
+ /**
764
+ * ProgressBar
765
+ *
766
+ * Linear progress indicator with optional labels.
767
+ */
663
768
  interface ProgressBarProps extends ProgressBarProps$1 {
664
769
  label?: string;
665
770
  rightLabel?: string;
@@ -668,6 +773,11 @@ interface ProgressBarProps extends ProgressBarProps$1 {
668
773
  }
669
774
  declare function ProgressBar({ label, rightLabel, progressWidth, hideLabels, ...props }: ProgressBarProps): react_jsx_runtime.JSX.Element;
670
775
 
776
+ /**
777
+ * RangeCalendar
778
+ *
779
+ * Calendar allowing selection of a date range.
780
+ */
671
781
  interface RangeCalendarProps<T extends DateValue> extends Omit<RangeCalendarProps$1<T>, "visibleDuration"> {
672
782
  errorMessage?: string;
673
783
  }
@@ -746,11 +856,30 @@ type TabProps = TabProps$1 & {
746
856
  isSelected?: boolean;
747
857
  id?: string;
748
858
  };
859
+ /**
860
+ * Tabs
861
+ *
862
+ * Tabbed interface with styled tabs and panels.
863
+ */
749
864
  declare function Tabs(props: TabsProps): react_jsx_runtime.JSX.Element;
865
+ /**
866
+ * TabList container.
867
+ */
750
868
  declare function TabList<T extends object>(props: TabListProps<T>): react_jsx_runtime.JSX.Element;
869
+ /**
870
+ * Tab trigger element.
871
+ */
751
872
  declare function Tab(props: TabProps): react_jsx_runtime.JSX.Element;
873
+ /**
874
+ * TabPanel content area.
875
+ */
752
876
  declare function TabPanel(props: TabPanelProps): react_jsx_runtime.JSX.Element;
753
877
 
878
+ /**
879
+ * TextArea
880
+ *
881
+ * Multi-line text input with Edges styling, label, description, and error.
882
+ */
754
883
  interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, "size">, BaseInputProps {
755
884
  label?: string;
756
885
  description?: string;
@@ -762,6 +891,14 @@ interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLT
762
891
  }
763
892
  declare function TextArea({ label, description, errorMessage, size, tooltip, required, transparent, isInvalid, className, validationResult, ...props }: TextAreaProps): react_jsx_runtime.JSX.Element;
764
893
 
894
+ /**
895
+ * TextField
896
+ *
897
+ * A controlled or uncontrolled text input with Edges styling, label,
898
+ * description, error messaging, and optional affordances like a search icon,
899
+ * clear button, and password visibility toggle. Wraps
900
+ * `react-aria-components` TextField for accessible behavior.
901
+ */
765
902
  interface TextFieldProps extends Omit<TextFieldProps$1, "isRequired" | "size" | "className">, BaseInputProps {
766
903
  label?: string;
767
904
  description?: string;
@@ -772,6 +909,10 @@ interface TextFieldProps extends Omit<TextFieldProps$1, "isRequired" | "size" |
772
909
  className?: string;
773
910
  validationResult?: ValidationResult;
774
911
  }
912
+ /**
913
+ * Renders an Edges TextField with label, description, validation states and
914
+ * optional search/clear/password affordances.
915
+ */
775
916
  declare function TextField({ label, description, errorMessage, size, tooltip, isRequired, transparent, showSearchIcon, isClearable, onClear, type, validationResult, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
776
917
 
777
918
  interface TextLinkProps {
@@ -788,6 +929,12 @@ interface TextLinkProps {
788
929
  }
789
930
  declare const TextLink: ({ href, children, className, external, title, variant, onClick, asButton, onPress, showArrow, }: TextLinkProps) => react_jsx_runtime.JSX.Element;
790
931
 
932
+ /**
933
+ * TimeField
934
+ *
935
+ * Input segmented time with Edges styling and accessible behavior via
936
+ * `react-aria-components`. Supports labels, descriptions and validation.
937
+ */
791
938
  interface TimeFieldProps extends Omit<TimeFieldProps$1<TimeValue>, "size" | "className">, BaseInputProps {
792
939
  label?: string;
793
940
  description?: string;
@@ -798,6 +945,9 @@ interface TimeFieldProps extends Omit<TimeFieldProps$1<TimeValue>, "size" | "cla
798
945
  className?: string;
799
946
  validationResult?: ValidationResult;
800
947
  }
948
+ /**
949
+ * Renders an Edges TimeField composed from segmented date parts.
950
+ */
801
951
  declare function TimeField({ label, description, errorMessage, size, tooltip, isRequired, transparent, validationResult, ...props }: TimeFieldProps): react_jsx_runtime.JSX.Element;
802
952
 
803
953
  type IconName = ComponentProps<typeof Icon>["name"];
@@ -827,10 +977,17 @@ interface ToggleButtonProps {
827
977
  }
828
978
  declare function ToggleButton(props: ToggleButtonProps): react_jsx_runtime.JSX.Element;
829
979
 
980
+ /**
981
+ * Tooltip
982
+ *
983
+ * Lightweight content container that appears on hover/focus/press.
984
+ */
830
985
  interface TooltipProps extends Omit<TooltipProps$1, "children"> {
831
986
  children: React__default.ReactNode;
832
987
  content: React__default.ReactNode;
833
988
  }
834
989
  declare function Tooltip({ children, content, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
835
990
 
836
- 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, RangeCalendar, Select, Skeleton, Switch, Tab, TabList, TabPanel, Tabs, TextArea, TextField, TextLink, TimeField, ToggleButton, Tooltip, getFieldGroupStyles, getInputBackgroundStyles, getInputBaseStyles, getInputStateStyles, useInputFocus };
991
+ declare function useDebounce<T>(value: T, delay?: number): T;
992
+
993
+ 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, RangeCalendar, Select, Skeleton, Switch, Tab, TabList, TabPanel, Tabs, TextArea, TextField, TextLink, TimeField, ToggleButton, Tooltip, getFieldGroupStyles, getInputBackgroundStyles, getInputBaseStyles, getInputStateStyles, useDebounce, useInputFocus };