@texturehq/edges 1.18.1 → 1.19.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.
Files changed (39) hide show
  1. package/dist/FileUpload-DXTcfLIh.d.cts +348 -0
  2. package/dist/FileUpload-DXTcfLIh.d.ts +348 -0
  3. package/dist/TimeField-B4J8gA8E.d.ts +393 -0
  4. package/dist/TimeField-D2AOjQ1K.d.cts +393 -0
  5. package/dist/{colors-Kck1-4Zq.d.cts → colors-BUEmaPXY.d.ts} +4 -122
  6. package/dist/{colors-Kck1-4Zq.d.ts → colors-BniWNyzj.d.cts} +4 -122
  7. package/dist/components.manifest.json +13 -9
  8. package/dist/form/index.cjs +2 -0
  9. package/dist/form/index.cjs.map +1 -0
  10. package/dist/form/index.d.cts +3 -0
  11. package/dist/form/index.d.ts +3 -0
  12. package/dist/form/index.js +2 -0
  13. package/dist/form/index.js.map +1 -0
  14. package/dist/generated/tailwind-tokens-dark.css +1 -0
  15. package/dist/generated/tailwind-tokens-light.css +1 -0
  16. package/dist/index-DKA9NMRw.d.cts +311 -0
  17. package/dist/index-DKA9NMRw.d.ts +311 -0
  18. package/dist/index.cjs +8 -8
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +24 -794
  21. package/dist/index.d.ts +24 -794
  22. package/dist/index.js +8 -8
  23. package/dist/index.js.map +1 -1
  24. package/dist/rhf/index.cjs +2 -0
  25. package/dist/rhf/index.cjs.map +1 -0
  26. package/dist/rhf/index.d.cts +147 -0
  27. package/dist/rhf/index.d.ts +147 -0
  28. package/dist/rhf/index.js +2 -0
  29. package/dist/rhf/index.js.map +1 -0
  30. package/dist/server.cjs +1 -1
  31. package/dist/server.cjs.map +1 -1
  32. package/dist/server.d.cts +2 -1
  33. package/dist/server.d.ts +2 -1
  34. package/dist/server.js +1 -1
  35. package/dist/server.js.map +1 -1
  36. package/dist/styles.css +92 -27
  37. package/dist/utilities.manifest.json +2 -2
  38. package/package.json +30 -3
  39. package/scripts/generate-edges-docs.js +43 -0
@@ -0,0 +1,393 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default, { ComponentProps, ReactNode } from 'react';
3
+ import { Key, ValidationResult, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, CheckboxRenderProps, CheckboxGroupProps as CheckboxGroupProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, RadioProps, RadioGroupProps as RadioGroupProps$1, SelectProps as SelectProps$1, SwitchProps as SwitchProps$1, TimeFieldProps as TimeFieldProps$1, TimeValue } from 'react-aria-components';
4
+ import { S as Size, I as Icon, B as BaseInputProps } from './FileUpload-DXTcfLIh.js';
5
+
6
+ interface Item {
7
+ id: string;
8
+ name: string;
9
+ }
10
+ interface Section {
11
+ name: string;
12
+ items: Item[];
13
+ }
14
+ type RequestMethod = "GET" | "POST";
15
+ interface BaseRequestConfig {
16
+ url: string;
17
+ headers?: Record<string, string>;
18
+ transformResponse: (data: unknown) => Item[];
19
+ }
20
+ interface RestRequestConfig extends BaseRequestConfig {
21
+ requestType: "REST";
22
+ method?: RequestMethod;
23
+ queryKey?: string;
24
+ extraParams?: Record<string, string>;
25
+ shouldLoad?: (filterText: string) => boolean;
26
+ }
27
+ interface GraphQLRequestConfig extends BaseRequestConfig {
28
+ requestType: "GraphQL";
29
+ graphqlQuery: string;
30
+ variableKey?: string;
31
+ responsePath?: string;
32
+ shouldLoad?: (filterText: string) => boolean;
33
+ }
34
+ type AutocompleteRequestConfig = RestRequestConfig | GraphQLRequestConfig;
35
+ /**
36
+ * Autocomplete
37
+ *
38
+ * Text input with typeahead suggestions and keyboard navigation.
39
+ */
40
+ interface AutocompleteProps {
41
+ label?: string;
42
+ staticItems?: Item[];
43
+ sections?: Section[];
44
+ selectedKey?: Key | null;
45
+ defaultSelectedKey?: Key | null;
46
+ onSelectionChange?: (key: Key | null) => void;
47
+ requestConfig?: AutocompleteRequestConfig;
48
+ defaultFilter?: (textValue: string, inputValue: string) => boolean;
49
+ placeholder?: string;
50
+ renderItem?: (item: Item) => React__default.ReactNode;
51
+ renderLeftIcon?: (isLoading: boolean) => React__default.ReactNode;
52
+ renderSection?: (section: Section, children: React__default.ReactNode) => React__default.ReactNode;
53
+ errorMessage?: string | ((validation: ValidationResult) => string);
54
+ description?: string;
55
+ size?: Size;
56
+ tooltip?: string;
57
+ isRequired?: boolean;
58
+ isDisabled?: boolean;
59
+ isInvalid?: boolean;
60
+ validationResult?: ValidationResult;
61
+ showErrors?: boolean;
62
+ autoFocus?: boolean;
63
+ /**
64
+ * Whether to reserve space for error messages to prevent layout shift
65
+ * @default false
66
+ */
67
+ reserveErrorSpace?: boolean;
68
+ }
69
+ declare function Autocomplete({ label, staticItems, sections, selectedKey, defaultSelectedKey, onSelectionChange, requestConfig, defaultFilter, placeholder, errorMessage, description, size, tooltip, isRequired, isDisabled, isInvalid, validationResult, showErrors, renderItem, renderLeftIcon, renderSection, autoFocus, reserveErrorSpace, }: AutocompleteProps): react_jsx_runtime.JSX.Element;
70
+
71
+ type IconName = ComponentProps<typeof Icon>["name"];
72
+ type BaseButtonProps = Omit<ButtonProps$1, "className">;
73
+ /**
74
+ * Button
75
+ *
76
+ * A versatile action component that supports multiple visual variants, sizes,
77
+ * optional icons, a loading state, and badge indicators. Follows the Edges
78
+ * design system tokens and composes `react-aria-components` under the hood.
79
+ *
80
+ * Example usage:
81
+ * ```tsx
82
+ * <Button variant="brand" size="md" icon="Check">Save</Button>
83
+ * ```
84
+ */
85
+ interface ButtonProps extends BaseButtonProps {
86
+ variant?: "default" | "brand" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost" | "primary";
87
+ size?: Size;
88
+ badgeNumber?: number;
89
+ badgeVariant?: "primary" | "destructive";
90
+ badgePosition?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
91
+ fullWidth?: boolean;
92
+ icon?: IconName;
93
+ iconWeight?: "thin" | "light" | "regular" | "bold" | "fill" | "duotone";
94
+ iconPosition?: "left" | "right";
95
+ isLoading?: boolean;
96
+ loadingText?: string;
97
+ loadingIndicator?: React.ReactNode;
98
+ className?: string;
99
+ href?: string;
100
+ target?: string;
101
+ rel?: string;
102
+ style?: React.CSSProperties;
103
+ }
104
+ /**
105
+ * Renders an Edges Button. When `href` is provided, renders a link-styled
106
+ * button using the same visual system.
107
+ */
108
+ declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
109
+
110
+ /**
111
+ * CheckboxGroup
112
+ *
113
+ * Groups multiple checkboxes with shared label/description.
114
+ */
115
+ interface CheckboxGroupProps extends Omit<CheckboxGroupProps$1, "children"> {
116
+ label?: string;
117
+ children?: ReactNode;
118
+ description?: string;
119
+ errorMessage?: string | ((validation: ValidationResult) => string);
120
+ }
121
+ /**
122
+ * Checkbox
123
+ *
124
+ * Single checkbox with Edges visuals.
125
+ */
126
+ interface CheckboxProps extends Omit<CheckboxProps$1, "children"> {
127
+ children?: ReactNode | ((props: CheckboxRenderProps) => ReactNode);
128
+ /**
129
+ * Visual variant of the checkbox
130
+ * @default "default"
131
+ */
132
+ variant?: "default" | "brand";
133
+ }
134
+ declare function CheckboxGroup(props: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
135
+ declare function Checkbox(props: CheckboxProps): react_jsx_runtime.JSX.Element;
136
+
137
+ /**
138
+ * ColorField Props
139
+ */
140
+ interface ColorFieldProps extends Omit<TextFieldProps$1, "isRequired" | "size" | "className">, BaseInputProps {
141
+ /** Label text displayed above the color field */
142
+ label?: string;
143
+ /** Helper text displayed below the color field */
144
+ description?: string;
145
+ /** Error message or function to generate error message */
146
+ errorMessage?: string | ((validation: ValidationResult) => string);
147
+ /** Placeholder text for the input */
148
+ placeholder?: string;
149
+ /** Optional tooltip text to show next to the label */
150
+ tooltip?: string;
151
+ /** Whether the field is required */
152
+ isRequired?: boolean;
153
+ /** Additional CSS classes to apply */
154
+ className?: string;
155
+ /** Validation result object */
156
+ validationResult?: ValidationResult;
157
+ /** The current hex color value (controlled) */
158
+ value?: string;
159
+ /** Default hex color value (uncontrolled) */
160
+ defaultValue?: string;
161
+ /** Callback when the color changes */
162
+ onChange?: (color: string) => void;
163
+ /** Whether to show the color swatch preview */
164
+ showColorSwatch?: boolean;
165
+ }
166
+ /**
167
+ * ColorField Component
168
+ *
169
+ * A form control that allows users to input hex color codes manually
170
+ * or select colors using a visual color picker. Integrates seamlessly
171
+ * with the Edges design system.
172
+ *
173
+ * @example
174
+ * ```tsx
175
+ * <ColorField
176
+ * label="Brand Color"
177
+ * value={color}
178
+ * onChange={setColor}
179
+ * description="Choose your primary brand color"
180
+ * />
181
+ * ```
182
+ */
183
+ declare function ColorField({ label, description, errorMessage, size, tooltip, isRequired, transparent, className, validationResult, value: controlledValue, defaultValue, onChange, placeholder, showColorSwatch, reserveErrorSpace, ...props }: ColorFieldProps): react_jsx_runtime.JSX.Element;
184
+
185
+ /**
186
+ * NumberField
187
+ *
188
+ * Numeric input with stepper controls and validation.
189
+ */
190
+ interface NumberFieldProps extends Omit<NumberFieldProps$1, "size" | "className">, BaseInputProps {
191
+ value?: number;
192
+ defaultValue?: number;
193
+ onChange?: (value: number) => void;
194
+ minValue?: number;
195
+ maxValue?: number;
196
+ step?: number;
197
+ formatOptions?: Intl.NumberFormatOptions;
198
+ id?: string;
199
+ label?: string;
200
+ description?: string;
201
+ errorMessage?: string | ((validation: ValidationResult) => string);
202
+ tooltip?: string;
203
+ isRequired?: boolean;
204
+ className?: string;
205
+ validationResult?: ValidationResult;
206
+ }
207
+ declare function NumberField({ label, description, errorMessage, size, tooltip, isRequired, transparent, validationResult, reserveErrorSpace, ...props }: NumberFieldProps): react_jsx_runtime.JSX.Element;
208
+
209
+ interface RadioGroupProps extends Omit<RadioGroupProps$1, "children"> {
210
+ /** Label for the radio group */
211
+ label?: string;
212
+ /** Children elements */
213
+ children?: ReactNode;
214
+ /** Optional description for the radio group */
215
+ description?: string;
216
+ /** Error message to display when validation fails */
217
+ errorMessage?: string | ((validation: ValidationResult) => string);
218
+ /** Validation result object for functional errorMessage */
219
+ validationResult?: ValidationResult;
220
+ /**
221
+ * Visual variant of the radio buttons
222
+ * @default "default"
223
+ */
224
+ variant?: "default" | "brand";
225
+ }
226
+ declare function RadioGroup(props: RadioGroupProps): react_jsx_runtime.JSX.Element;
227
+ declare function Radio(props: RadioProps): react_jsx_runtime.JSX.Element;
228
+
229
+ /**
230
+ * Interface defining the shape of items in the Select component
231
+ */
232
+ interface SelectItem<T = unknown> {
233
+ /** Unique identifier for the item */
234
+ id: string;
235
+ /** Display label for the item */
236
+ label: string;
237
+ /** Value associated with the item */
238
+ value: T;
239
+ }
240
+ /**
241
+ * Props for the Select component
242
+ * @template T - The type of the items, must extend SelectItem
243
+ */
244
+ interface SelectProps<T extends SelectItem> extends Omit<SelectProps$1<T>, "children" | "onSelectionChange"> {
245
+ /** Label text displayed above the select */
246
+ label?: string;
247
+ /** Helper text displayed below the select */
248
+ description?: string;
249
+ /** Error message or function to generate error message */
250
+ errorMessage?: string | ((validation: ValidationResult) => React__default.ReactNode);
251
+ /** Collection of items to display in the select */
252
+ items?: Iterable<T>;
253
+ /** Size variant of the select */
254
+ size?: Size;
255
+ /** Render function for items or static children */
256
+ children?: React__default.ReactNode | ((item: T) => React__default.ReactNode);
257
+ /** Custom render function for individual items. When provided, items prop is used to render items automatically */
258
+ renderItem?: (item: T) => React__default.ReactNode;
259
+ /** Currently selected item's id. Uses the SelectItem's `id` field for stable selection tracking */
260
+ selectedKey?: Key;
261
+ /** Default selected item's id for uncontrolled usage */
262
+ defaultSelectedKey?: Key;
263
+ /** Callback when selection changes, provides the selected item's id */
264
+ onSelectionChange?: (key: Key) => void;
265
+ /** Whether to show error states */
266
+ showErrors?: boolean;
267
+ /** Tooltip text */
268
+ tooltip?: string;
269
+ /** Whether the field is required */
270
+ isRequired?: boolean;
271
+ /** Validation result object */
272
+ validationResult?: ValidationResult;
273
+ /** Whether to use transparent background */
274
+ transparent?: boolean;
275
+ /**
276
+ * Whether to reserve space for error messages to prevent layout shift
277
+ * @default false
278
+ */
279
+ reserveErrorSpace?: boolean;
280
+ /** Placement of the dropdown menu relative to the trigger. Defaults to "bottom start" */
281
+ placement?: "bottom" | "bottom left" | "bottom right" | "bottom start" | "bottom end" | "top" | "top left" | "top right" | "top start" | "top end" | "left" | "left top" | "left bottom" | "start" | "start top" | "start bottom" | "right" | "right top" | "right bottom" | "end" | "end top" | "end bottom";
282
+ /** Whether the menu should flip to the opposite side when there's not enough space. Defaults to true */
283
+ shouldFlip?: boolean;
284
+ /**
285
+ * Controls the menu width behavior relative to the trigger.
286
+ * - "match": Menu width matches trigger width exactly (default)
287
+ * - "auto": Menu width grows to fit content, with minimum of trigger width
288
+ * @default "match"
289
+ */
290
+ menuWidth?: "match" | "auto";
291
+ }
292
+ declare function Select<T extends SelectItem>({ label, description, errorMessage, children, items, renderItem, size, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, placeholder, showErrors, tooltip, isRequired, transparent, reserveErrorSpace, placement, shouldFlip, menuWidth, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
293
+
294
+ interface SwitchProps extends Omit<SwitchProps$1, "children"> {
295
+ children: React__default.ReactNode;
296
+ /**
297
+ * Visual variant of the switch
298
+ * @default "default"
299
+ */
300
+ variant?: "default" | "brand";
301
+ /**
302
+ * Size of the switch
303
+ * @default "md"
304
+ */
305
+ size?: Size;
306
+ }
307
+ /**
308
+ * Switch
309
+ *
310
+ * Toggle switch component for binary on/off states.
311
+ * Provides an accessible alternative to checkboxes for settings and preferences.
312
+ */
313
+ declare function Switch({ children, variant, size, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
314
+
315
+ /**
316
+ * TextArea
317
+ *
318
+ * Multi-line text input with Edges styling, label, description, and error.
319
+ */
320
+ interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "disabled">, BaseInputProps {
321
+ label?: string;
322
+ description?: string;
323
+ errorMessage?: string | ((validation: ValidationResult) => string);
324
+ tooltip?: string;
325
+ size?: Size;
326
+ isInvalid?: boolean;
327
+ isDisabled?: boolean;
328
+ /**
329
+ * Allow user resizing of the textarea. Defaults to false (non-resizable).
330
+ * When true, enables vertical resize.
331
+ */
332
+ isResizable?: boolean;
333
+ validationResult?: ValidationResult;
334
+ }
335
+ declare function TextArea({ label, description, errorMessage, size, tooltip, required, transparent, isInvalid, isDisabled, isResizable, className, validationResult, reserveErrorSpace, ...props }: TextAreaProps): react_jsx_runtime.JSX.Element;
336
+
337
+ /**
338
+ * TextField
339
+ *
340
+ * A controlled or uncontrolled text input with Edges styling, label,
341
+ * description, error messaging, and optional affordances like a search icon,
342
+ * clear button, and password visibility toggle. Wraps
343
+ * `react-aria-components` TextField for accessible behavior.
344
+ */
345
+ interface TextFieldProps extends Omit<TextFieldProps$1, "isRequired" | "size" | "className">, BaseInputProps {
346
+ label?: string;
347
+ description?: string;
348
+ errorMessage?: string | ((validation: ValidationResult) => string);
349
+ placeholder?: string;
350
+ tooltip?: string;
351
+ isRequired?: boolean;
352
+ className?: string;
353
+ validationResult?: ValidationResult;
354
+ /**
355
+ * Whether to reserve space for error messages to prevent layout shift
356
+ * @default true
357
+ */
358
+ reserveErrorSpace?: boolean;
359
+ }
360
+ /**
361
+ * Renders an Edges TextField with label, description, validation states and
362
+ * optional search/clear/password affordances.
363
+ */
364
+ declare function TextField({ label, description, errorMessage, size, tooltip, isRequired, transparent, showSearchIcon, isClearable, onClear, type, validationResult, reserveErrorSpace, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
365
+
366
+ /**
367
+ * TimeField
368
+ *
369
+ * A segmented time input with Edges styling. Matches the API and styling
370
+ * of TextField and DateField for consistency across form controls.
371
+ */
372
+ interface TimeFieldProps extends Omit<TimeFieldProps$1<TimeValue>, "isRequired" | "size" | "className">, Omit<BaseInputProps, "transparent" | "isClearable" | "onClear"> {
373
+ label?: string;
374
+ description?: string;
375
+ errorMessage?: string | ((validation: ValidationResult) => string);
376
+ placeholder?: string;
377
+ tooltip?: string;
378
+ isRequired?: boolean;
379
+ className?: string;
380
+ validationResult?: ValidationResult;
381
+ /**
382
+ * Whether to reserve space for error messages to prevent layout shift
383
+ * @default true
384
+ */
385
+ reserveErrorSpace?: boolean;
386
+ }
387
+ /**
388
+ * Renders an Edges TimeField with label, description, validation states,
389
+ * and segmented time input.
390
+ */
391
+ declare function TimeField({ label, description, errorMessage, size, tooltip, isRequired, isDisabled, isInvalid, reserveErrorSpace, validationResult, className, ...props }: TimeFieldProps): react_jsx_runtime.JSX.Element;
392
+
393
+ export { Autocomplete as A, Button as B, Checkbox as C, NumberField as N, RadioGroup as R, Select as S, TextArea as T, CheckboxGroup as a, ColorField as b, Switch as c, TextField as d, type TimeFieldProps as e, type ColorFieldProps as f, Radio as g, TimeField as h };