@noya-app/noya-designsystem 0.1.38 → 0.1.40

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 (50) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/CHANGELOG.md +16 -0
  3. package/dist/index.css +1 -1
  4. package/dist/index.d.mts +416 -321
  5. package/dist/index.d.ts +416 -321
  6. package/dist/index.js +9555 -11325
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +5057 -6832
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +4 -4
  11. package/src/components/ActivityIndicator.tsx +13 -4
  12. package/src/components/AnimatePresence.tsx +261 -0
  13. package/src/components/Avatar.tsx +202 -80
  14. package/src/components/Button.tsx +10 -6
  15. package/src/components/Checkbox.tsx +10 -9
  16. package/src/components/Chip.tsx +88 -132
  17. package/src/components/{InputFieldWithCompletions.tsx → Combobox.tsx} +10 -3
  18. package/src/components/ContextMenu.tsx +9 -5
  19. package/src/components/Dialog.tsx +20 -23
  20. package/src/components/Divider.tsx +15 -7
  21. package/src/components/DraggableMenuButton.tsx +9 -5
  22. package/src/components/DropdownMenu.tsx +8 -5
  23. package/src/components/FillInputField.tsx +5 -1
  24. package/src/components/FillPreviewBackground.tsx +1 -5
  25. package/src/components/GridView.tsx +71 -46
  26. package/src/components/InputField.tsx +140 -75
  27. package/src/components/InspectorPrimitives.tsx +17 -11
  28. package/src/components/Label.tsx +5 -1
  29. package/src/components/ListView.tsx +28 -15
  30. package/src/components/Progress.tsx +10 -7
  31. package/src/components/SelectMenu.tsx +20 -8
  32. package/src/components/Slider.tsx +70 -8
  33. package/src/components/Sortable.tsx +3 -3
  34. package/src/components/Switch.tsx +19 -2
  35. package/src/components/Text.tsx +5 -1
  36. package/src/components/TextArea.tsx +5 -1
  37. package/src/components/TreeView.tsx +4 -10
  38. package/src/components/UserPointer.tsx +170 -0
  39. package/src/components/WorkspaceLayout.tsx +5 -0
  40. package/src/components/internal/Menu.tsx +14 -5
  41. package/src/components/internal/TextInput.tsx +13 -0
  42. package/src/contexts/DialogContext.tsx +30 -18
  43. package/src/hooks/useTheme.ts +50 -0
  44. package/src/index.css +16 -13
  45. package/src/index.tsx +14 -26
  46. package/src/utils/classNames.ts +5 -0
  47. package/src/utils/colorFromString.ts +44 -0
  48. package/tailwind.config.ts +16 -13
  49. package/src/hooks/useDarkMode.ts +0 -14
  50. package/src/utils/tailwind.ts +0 -9
package/dist/index.d.mts CHANGED
@@ -1,17 +1,17 @@
1
- import * as React$1 from 'react';
2
- import React__default, { CSSProperties, ReactNode, InputHTMLAttributes, ComponentProps, SyntheticEvent, AriaRole, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, FocusEventHandler, Ref, LabelHTMLAttributes, ReactHTML } from 'react';
1
+ import * as React from 'react';
2
+ import React__default, { CSSProperties, ReactNode, InputHTMLAttributes, AriaRole, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, FocusEventHandler, Ref, HTMLAttributes, ComponentProps, SyntheticEvent, LabelHTMLAttributes, ReactHTML } from 'react';
3
+ import * as _noya_app_noya_geometry from '@noya-app/noya-geometry';
4
+ import { Size } from '@noya-app/noya-geometry';
5
+ import { IItemScore } from 'vscode-fuzzy-scorer';
6
+ import { Property } from 'csstype';
3
7
  import * as Icons from '@noya-app/noya-icons';
4
8
  export { Icons };
9
+ import { useSortable } from '@dnd-kit/sortable';
5
10
  import * as DialogPrimitive from '@radix-ui/react-dialog';
6
11
  import * as RadixDropdownMenu from '@radix-ui/react-dropdown-menu';
7
12
  import { Sketch } from '@noya-app/noya-file-format';
8
13
  import * as _noya_app_noya_keymap from '@noya-app/noya-keymap';
9
14
  import { KeyModifiers, PlatformName } from '@noya-app/noya-keymap';
10
- import { Property } from 'csstype';
11
- import * as _noya_app_noya_geometry from '@noya-app/noya-geometry';
12
- import { Size } from '@noya-app/noya-geometry';
13
- import { IItemScore } from 'vscode-fuzzy-scorer';
14
- import { useSortable } from '@dnd-kit/sortable';
15
15
  import * as PopoverPrimitive from '@radix-ui/react-popover';
16
16
  import { SelectProps } from '@radix-ui/react-select';
17
17
  import { ImperativePanelGroupHandle } from 'react-resizable-panels';
@@ -23,21 +23,57 @@ interface Props$f {
23
23
  color?: string;
24
24
  trackColor?: string;
25
25
  }
26
- declare const ActivityIndicator: (props: Props$f) => React__default.ReactElement | null;
26
+ declare const ActivityIndicator: React__default.NamedExoticComponent<Props$f>;
27
27
 
28
- declare const Avatar: (props: {
28
+ type AnimatePresenceProps = {
29
+ children: React__default.ReactNode;
30
+ /**
31
+ * Duration of enter/exit animations in milliseconds
32
+ * @default 200
33
+ */
34
+ duration?: number;
35
+ /**
36
+ * Custom styles to apply during animations
37
+ */
38
+ animationStyles?: {
39
+ entering?: React__default.CSSProperties;
40
+ entered?: React__default.CSSProperties;
41
+ exiting?: React__default.CSSProperties;
42
+ };
43
+ /** @default false */
44
+ skipInitialAnimation?: boolean;
45
+ /**
46
+ * @default "wait"
47
+ * "wait" - wait for the previous animation to finish before starting the next one
48
+ * "crossfade" - crossfade between the previous and next animation
49
+ */
50
+ mode?: "wait" | "crossfade";
51
+ };
52
+ declare const AnimatePresence: ({ children, duration, animationStyles, skipInitialAnimation, mode, }: AnimatePresenceProps) => React__default.JSX.Element;
53
+
54
+ type AvatarProps = {
29
55
  image?: string;
30
56
  name?: string;
31
- fallback?: string;
57
+ /** string used to generate a fallback monogram. more unique strings are better. */
58
+ userId?: string;
32
59
  size?: number;
33
60
  overflow?: number;
34
61
  style?: React__default.CSSProperties;
35
62
  className?: string;
36
- } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
37
- declare function AvatarStack({ size, children, }: {
63
+ /** colors are generated from the fallback string or title, but you can override it here */
64
+ backgroundColor?: string;
65
+ /** @default normal */
66
+ variant?: "normal" | "bare";
67
+ disabled?: boolean;
68
+ };
69
+ declare const Avatar: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<AvatarProps & React__default.RefAttributes<HTMLDivElement>>>;
70
+ declare const AvatarStack: React__default.NamedExoticComponent<{
38
71
  size?: number;
72
+ /** @default 3 */
73
+ max?: number;
39
74
  children: React__default.ReactNode;
40
- }): React__default.JSX.Element;
75
+ className?: string;
76
+ }>;
41
77
 
42
78
  type ButtonVariant = "normal" | "primary" | "secondary" | "secondaryBright" | "thin" | "floating" | "none";
43
79
  type ButtonSize = "small" | "normal" | "large" | "floating";
@@ -61,12 +97,12 @@ interface ButtonRootProps {
61
97
  target?: string;
62
98
  rel?: string;
63
99
  }
64
- declare const Button: (props: ButtonRootProps & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement | null;
100
+ declare const Button: React__default.ForwardRefExoticComponent<ButtonRootProps & React__default.RefAttributes<HTMLButtonElement>>;
65
101
 
66
102
  interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
67
103
  colorScheme?: "primary" | "secondary";
68
104
  }
69
- declare const Checkbox$1: (props: CheckboxProps & React__default.RefAttributes<HTMLInputElement>) => React__default.ReactElement | null;
105
+ declare const Checkbox$1: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<CheckboxProps & React__default.RefAttributes<HTMLInputElement>>>;
70
106
 
71
107
  type ChipColorScheme = "primary" | "secondary" | "error";
72
108
  type ChipSize = "small" | "medium" | "large";
@@ -89,7 +125,50 @@ interface ChipProps {
89
125
  style?: React__default.CSSProperties;
90
126
  tabIndex?: number;
91
127
  }
92
- declare const Chip: (props: ChipProps & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement | null;
128
+ declare const Chip: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<ChipProps & React__default.RefAttributes<HTMLSpanElement>>>;
129
+
130
+ declare function fuzzyScore({ item, query }: {
131
+ item: string;
132
+ query: string;
133
+ }): IItemScore;
134
+ type IScoredItem = IItemScore & {
135
+ index: number;
136
+ };
137
+ declare function fuzzyFilter({ items, query, scoreThreshold, }: {
138
+ items: string[];
139
+ query: string;
140
+ scoreThreshold?: number;
141
+ }): IScoredItem[];
142
+ type IToken = {
143
+ type: 'text';
144
+ text: string;
145
+ } | {
146
+ type: 'match';
147
+ text: string;
148
+ };
149
+ type MatchRange = {
150
+ start: number;
151
+ end: number;
152
+ };
153
+ declare function fuzzyTokenize({ item, itemScore, }: {
154
+ item: string;
155
+ itemScore: IItemScore;
156
+ }): IToken[];
157
+
158
+ type CompletionItem = {
159
+ type?: undefined;
160
+ id: string;
161
+ name: string;
162
+ icon?: ReactNode;
163
+ alwaysInclude?: boolean;
164
+ };
165
+ type CompletionSectionHeader = {
166
+ type: 'sectionHeader';
167
+ id: string;
168
+ name: string;
169
+ maxVisibleItems?: number;
170
+ };
171
+ type CompletionListItem = (CompletionItem & IScoredItem) | CompletionSectionHeader;
93
172
 
94
173
  type IconName = keyof typeof Icons;
95
174
 
@@ -109,180 +188,11 @@ type RegularMenuItem<T extends string> = {
109
188
  };
110
189
  type MenuItem<T extends string> = typeof SEPARATOR_ITEM | RegularMenuItem<T>;
111
190
  type ExtractMenuItemType<T> = T extends RegularMenuItem<infer U> ? U : never;
112
- declare const KeyboardShortcut: (props: {
191
+ declare const KeyboardShortcut: React__default.NamedExoticComponent<{
113
192
  shortcut: string;
114
- }) => React__default.ReactElement | null;
115
-
116
- interface MenuItemProps<T extends string> {
117
- value?: T;
118
- children: ReactNode;
119
- onSelect: (value: T) => void;
120
- checked: boolean;
121
- disabled: boolean;
122
- indented: boolean;
123
- shortcut?: string;
124
- icon?: ReactNode;
125
- items?: MenuItem<T>[];
126
- }
127
- interface MenuProps<T extends string> {
128
- children: ReactNode;
129
- items: MenuItem<T>[];
130
- onSelect: (value: T) => void;
131
- isNested?: boolean;
132
- shouldBindKeyboardShortcuts?: boolean;
133
- onOpenChange?: (open: boolean) => void;
134
- }
135
- declare const ContextMenu: <T extends string>(props: MenuProps<T>) => React__default.ReactElement | null;
136
-
137
- declare const StyledContent: (props: Omit<DialogPrimitive.DialogContentProps & React__default.RefAttributes<HTMLDivElement>, "ref"> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
138
- interface IDialog {
139
- containsElement: (element: HTMLElement) => boolean;
140
- }
141
- interface Props$e {
142
- title?: ReactNode;
143
- description?: ReactNode;
144
- children?: ReactNode;
145
- style?: ComponentProps<typeof StyledContent>["style"];
146
- open: ComponentProps<typeof DialogPrimitive.Root>["open"];
147
- onOpenChange?: ComponentProps<typeof DialogPrimitive.Root>["onOpenChange"];
148
- onOpenAutoFocus?: ComponentProps<typeof DialogPrimitive.Content>["onOpenAutoFocus"];
149
- closeOnInteractOutside?: boolean;
150
- }
151
- declare const Dialog: (props: Props$e & React__default.RefAttributes<IDialog>) => React__default.ReactElement | null;
152
- declare const FullscreenDialog: (props: Props$e & React__default.RefAttributes<IDialog>) => React__default.ReactElement | null;
153
-
154
- type DividerVariant = "normal" | "subtle" | "strong";
155
- interface DividerProps {
156
- variant?: DividerVariant;
157
- overflow?: number | string;
158
- className?: string;
159
- style?: React__default.CSSProperties;
160
- }
161
- declare const Divider: (props: DividerProps) => React__default.ReactElement | null;
162
- declare const DividerVertical: (props: DividerProps) => React__default.ReactElement | null;
163
-
164
- /**
165
- * A button that opens a menu when clicked, but also allows dragging the
166
- */
167
- declare const DraggableMenuButton: <T extends string>(props: {
168
- items?: MenuItem<T>[];
169
- onSelect?: (value: T) => void;
170
- isVisible?: boolean;
171
- }) => React__default.ReactElement | null;
193
+ }>;
172
194
 
173
- declare const DropdownMenu: <T extends string>(props: MenuProps<T> & {
174
- open?: boolean;
175
- onCloseAutoFocus?: React__default.EventHandler<SyntheticEvent<unknown>>;
176
- emptyState?: React__default.ReactNode;
177
- } & Pick<RadixDropdownMenu.DropdownMenuContentProps & React__default.RefAttributes<HTMLDivElement>, "align" | "side" | "sideOffset" | "alignOffset" | "collisionPadding"> & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
178
-
179
- declare const SUPPORTED_IMAGE_UPLOAD_TYPES: ("image/png" | "image/jpeg" | "image/webp" | "image/svg+xml" | "application/pdf")[];
180
- declare const SUPPORTED_CANVAS_UPLOAD_TYPES: ("" | "image/png" | "image/jpeg" | "image/webp" | "image/svg+xml" | "application/pdf")[];
181
- type SupportedImageUploadType = (typeof SUPPORTED_IMAGE_UPLOAD_TYPES)[number];
182
- type SupportedCanvasUploadType = (typeof SUPPORTED_CANVAS_UPLOAD_TYPES)[number];
183
- type SketchPattern = {
184
- _class: 'pattern';
185
- image?: Sketch.FileRef | Sketch.DataRef;
186
- patternFillType: Sketch.PatternFillType;
187
- patternTileScale: number;
188
- };
189
-
190
- interface Props$d {
191
- id?: string;
192
- value?: Sketch.Color | Sketch.Gradient | SketchPattern;
193
- }
194
- declare const FillInputField: (props: Props$d & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement | null;
195
-
196
- declare const PatternPreviewBackground: (props: {
197
- fillType: Sketch.PatternFillType;
198
- tileScale: number;
199
- imageRef: string;
200
- }) => React__default.ReactElement | null;
201
- interface Props$c {
202
- value?: Sketch.Color | Sketch.Gradient | SketchPattern;
203
- }
204
- declare const FillPreviewBackground: (props: Props$c) => React__default.ReactElement | null;
205
-
206
- interface FloatingWindowProps {
207
- title?: string;
208
- onClose?: () => void;
209
- children: React__default.ReactNode;
210
- initialWidth?: number;
211
- initialHeight?: number;
212
- initialX?: number;
213
- initialY?: number;
214
- minWidth?: number;
215
- minHeight?: number;
216
- toolbarContent?: React__default.ReactNode;
217
- renderToolbar?: (props: {
218
- title?: string;
219
- toolbarContent?: React__default.ReactNode;
220
- onClose?: () => void;
221
- }) => React__default.ReactNode;
222
- }
223
- declare const FloatingWindow: React__default.FC<FloatingWindowProps>;
224
-
225
- interface Props$b {
226
- value: Sketch.GradientStop[];
227
- selectedStop: number;
228
- onChangeColor: (color: Sketch.Color) => void;
229
- onChangePosition: (position: number) => void;
230
- onAdd: (color: Sketch.Color, position: number) => void;
231
- onDelete: () => void;
232
- onSelectStop: (index: number) => void;
233
- }
234
- declare const GradientPicker: (props: Props$b) => React__default.ReactElement | null;
235
-
236
- type GridViewSize = "xxs" | "xs" | "small" | "medium" | "large" | "xl";
237
- interface ItemProps$2<MenuItemType extends string = string> {
238
- id: string;
239
- title?: ReactNode;
240
- subtitle?: ReactNode;
241
- loading?: boolean;
242
- selected?: boolean;
243
- onClick?: (event: React__default.MouseEvent) => void;
244
- onPress?: (options: KeyModifiers) => void;
245
- onDoubleClick?: () => void;
246
- onHoverChange?: (isHovering: boolean) => void;
247
- children?: ReactNode;
248
- menuItems?: MenuItem<MenuItemType>[];
249
- onSelectMenuItem?: (value: MenuItemType) => void;
250
- onContextMenu?: () => void;
251
- style?: CSSProperties;
252
- }
253
- type GridViewContextValue = {
254
- size: GridViewSize;
255
- textPosition: "overlay" | "below" | "toolip";
256
- bordered: boolean;
257
- disabled: boolean;
258
- };
259
- interface GridViewRootProps extends Partial<GridViewContextValue> {
260
- children: ReactNode;
261
- onClick?: () => void;
262
- scrollable?: boolean;
263
- }
264
- declare namespace GridView {
265
- const Root: (props: GridViewRootProps) => React__default.ReactElement | null;
266
- const Item: <MenuItemType extends string>(props: ItemProps$2<MenuItemType> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
267
- const Section: (props: {
268
- children?: ReactNode;
269
- className?: string;
270
- }) => React__default.ReactElement | null;
271
- const SectionHeader: (props: {
272
- title: string;
273
- }) => React__default.ReactElement | null;
274
- }
275
-
276
- declare const IconButton: (props: Omit<ButtonRootProps, "size" | "children" | "flex" | "variant"> & {
277
- iconName: IconName;
278
- className?: string;
279
- style?: CSSProperties;
280
- selected?: boolean;
281
- color?: string;
282
- size?: number;
283
- } & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement | null;
284
-
285
- type Props$a = {
195
+ type Props$e = {
286
196
  id?: string;
287
197
  style?: any;
288
198
  className?: string;
@@ -300,13 +210,15 @@ type Props$a = {
300
210
  onFocusChange?: (isFocused: boolean) => void;
301
211
  onBlur?: FocusEventHandler;
302
212
  } & Pick<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "autoCapitalize" | "autoCorrect" | "spellCheck" | "autoFocus">;
303
- type ReadOnlyProps = Props$a & {
213
+ type ReadOnlyProps = Props$e & {
304
214
  readOnly: true;
305
215
  };
306
- type ControlledProps = Props$a & {
216
+ type ControlledProps = Props$e & {
307
217
  onChange: (value: string) => void;
218
+ onFocus?: FocusEventHandler;
219
+ onBlur?: FocusEventHandler;
308
220
  };
309
- type SubmittableProps = Props$a & {
221
+ type SubmittableProps = Props$e & {
310
222
  onSubmit: (value: string) => void;
311
223
  allowSubmittingWithSameValue?: boolean;
312
224
  submitAutomaticallyAfterDelay?: number;
@@ -329,11 +241,14 @@ type InputFieldNumberInputProps = Omit<TextInputProps, "value" | "onChange" | "o
329
241
  value: number | undefined;
330
242
  onNudge?: (value: number) => void;
331
243
  variant?: "bare";
244
+ onFocus?: FocusEventHandler;
245
+ onBlur?: FocusEventHandler;
332
246
  } & ({
333
247
  onChange: (value: number) => void;
334
248
  } | {
335
249
  onSubmit: (value: number) => void;
336
250
  });
251
+ declare function InputFieldNumberInput(props: InputFieldNumberInputProps): React__default.JSX.Element;
337
252
  interface InputFieldRootProps {
338
253
  id?: string;
339
254
  flex?: string;
@@ -352,71 +267,29 @@ interface InputFieldRootProps {
352
267
  style?: React__default.CSSProperties;
353
268
  className?: string;
354
269
  }
270
+ declare function InputFieldRoot({ id, flex, children, width, labelPosition, labelSize, size, renderPopoverContent, onFocusChange, style, className, }: InputFieldRootProps): React__default.JSX.Element;
355
271
  declare namespace InputField {
356
- const Root: (props: InputFieldRootProps) => React__default.ReactElement | null;
357
- const Input: (props: InputFieldInputProps & React__default.RefAttributes<HTMLInputElement>) => React__default.ReactElement | null;
358
- const Typeahead: (props: {
272
+ const Root: React__default.MemoExoticComponent<typeof InputFieldRoot>;
273
+ const Input: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<InputFieldInputProps & React__default.RefAttributes<HTMLInputElement>>>;
274
+ const Typeahead: React__default.MemoExoticComponent<(props: {
359
275
  prefix: string;
360
276
  value: string;
361
- }) => React__default.ReactElement | null;
362
- const NumberInput: (props: InputFieldNumberInputProps) => React__default.ReactElement | null;
277
+ }) => React__default.JSX.Element>;
278
+ const NumberInput: React__default.MemoExoticComponent<typeof InputFieldNumberInput>;
363
279
  const DropdownMenu: <T extends string>(props: InputFieldDropdownProps<T>) => React__default.ReactElement | null;
364
- const Button: (props: React__default.ButtonHTMLAttributes<HTMLButtonElement> & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement | null;
365
- const Label: (props: React__default.LabelHTMLAttributes<HTMLLabelElement> & React__default.RefAttributes<HTMLLabelElement>) => React__default.ReactElement | null;
366
- const PrimitiveElement: ({ readOnly, disabled, className, ...props }: {
280
+ const Button: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<React__default.ButtonHTMLAttributes<HTMLButtonElement> & React__default.RefAttributes<HTMLButtonElement>>>;
281
+ const Label: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<React__default.LabelHTMLAttributes<HTMLLabelElement> & React__default.RefAttributes<HTMLLabelElement>>>;
282
+ const PrimitiveElement: ({ readOnly, disabled, className, style, ...props }: {
367
283
  readOnly?: boolean;
368
284
  disabled?: boolean;
369
285
  } & React__default.DetailedHTMLProps<React__default.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>) => React__default.JSX.Element;
370
286
  }
371
287
 
372
- declare function fuzzyScore({ item, query }: {
373
- item: string;
374
- query: string;
375
- }): IItemScore;
376
- type IScoredItem = IItemScore & {
377
- index: number;
378
- };
379
- declare function fuzzyFilter({ items, query, scoreThreshold, }: {
380
- items: string[];
381
- query: string;
382
- scoreThreshold?: number;
383
- }): IScoredItem[];
384
- type IToken = {
385
- type: 'text';
386
- text: string;
387
- } | {
388
- type: 'match';
389
- text: string;
390
- };
391
- type MatchRange = {
392
- start: number;
393
- end: number;
394
- };
395
- declare function fuzzyTokenize({ item, itemScore, }: {
396
- item: string;
397
- itemScore: IItemScore;
398
- }): IToken[];
399
-
400
- type CompletionItem = {
401
- type?: undefined;
402
- id: string;
403
- name: string;
404
- icon?: ReactNode;
405
- alwaysInclude?: boolean;
406
- };
407
- type CompletionSectionHeader = {
408
- type: 'sectionHeader';
409
- id: string;
410
- name: string;
411
- maxVisibleItems?: number;
412
- };
413
- type CompletionListItem = (CompletionItem & IScoredItem) | CompletionSectionHeader;
414
-
415
288
  type RelativeDropPosition = "above" | "below" | "inside";
416
289
  type DropValidator = (sourceIndex: number, destinationIndex: number, position: RelativeDropPosition) => boolean;
417
290
  declare const normalizeListDestinationIndex: (index: number, position: "above" | "below") => number;
418
291
  type UseSortableReturnType = ReturnType<typeof useSortable>;
419
- interface ItemProps$1<T> {
292
+ interface ItemProps$2<T> {
420
293
  id: string;
421
294
  disabled?: boolean;
422
295
  children: (props: {
@@ -434,7 +307,7 @@ interface RootProps {
434
307
  axis?: "x" | "y";
435
308
  }
436
309
  declare namespace Sortable {
437
- const Item: <T extends HTMLElement>(props: ItemProps$1<T>) => React__default.ReactElement | null;
310
+ const Item: <T extends HTMLElement>(props: ItemProps$2<T>) => React__default.ReactElement | null;
438
311
  const Root: (props: RootProps) => React__default.ReactElement | null;
439
312
  }
440
313
 
@@ -461,6 +334,7 @@ interface EditableRowProps {
461
334
  autoFocus: boolean;
462
335
  placeholder?: string;
463
336
  }
337
+ declare function ListViewEditableRowTitle({ value, onSubmitEditing, autoFocus, placeholder, }: EditableRowProps): React__default.JSX.Element;
464
338
  interface ListViewClickInfo {
465
339
  shiftKey: boolean;
466
340
  altKey: boolean;
@@ -537,11 +411,11 @@ type ListViewRootProps = {
537
411
  colorScheme?: ListColorScheme;
538
412
  };
539
413
  declare namespace ListView {
540
- const RowTitle: (props: {
414
+ const RowTitle: React__default.MemoExoticComponent<({ className, children, ...props }: {
541
415
  className?: string;
542
416
  children: React__default.ReactNode;
543
- } & React__default.HTMLAttributes<HTMLSpanElement>) => React__default.ReactElement | null;
544
- const EditableRowTitle: (props: EditableRowProps) => React__default.ReactElement | null;
417
+ } & HTMLAttributes<HTMLSpanElement>) => React__default.JSX.Element>;
418
+ const EditableRowTitle: React__default.MemoExoticComponent<typeof ListViewEditableRowTitle>;
545
419
  const Row: <MenuItemType extends string>(props: ListViewRowProps<MenuItemType> & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
546
420
  const Root: <T = any>(props: ((ChildrenProps | RenderProps<T>) & ListViewRootProps) & React__default.RefAttributes<IVirtualizedList>) => React__default.ReactElement | null;
547
421
  const RowContext: React__default.Context<ListRowContextValue>;
@@ -549,12 +423,12 @@ declare namespace ListView {
549
423
  type ItemInfo = ListViewItemInfo;
550
424
  type RowProps<MenuItemType extends string = string> = ListViewRowProps<MenuItemType>;
551
425
  type VirtualizedList = IVirtualizedList;
552
- const DragIndicator: (props: React__default.HTMLAttributes<HTMLDivElement> & {
426
+ const DragIndicator: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & {
553
427
  $relativeDropPosition: RelativeDropPosition;
554
428
  $gap: number;
555
429
  $offsetLeft: number;
556
430
  $colorScheme: ListColorScheme;
557
- } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
431
+ } & React__default.RefAttributes<HTMLDivElement>>;
558
432
  const rowHeight = 31;
559
433
  const sectionHeaderLabelHeight = 27;
560
434
  const calculateHeight: (items: number, headerCount: number, headerVariant: ListViewSectionHeaderVariant) => number;
@@ -568,8 +442,9 @@ interface CompletionMenuProps {
568
442
  onHoverIndex: (index: number) => void;
569
443
  listSize: Size;
570
444
  }
571
- declare const CompletionMenu: (props: CompletionMenuProps & React__default.RefAttributes<IVirtualizedList>) => React__default.ReactElement | null;
445
+ declare const CompletionMenu: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<CompletionMenuProps & React__default.RefAttributes<IVirtualizedList>>>;
572
446
  type InputFieldWithCompletionsProps = {
447
+ id?: string;
573
448
  loading?: boolean;
574
449
  initialValue?: string;
575
450
  placeholder?: string;
@@ -583,6 +458,7 @@ type InputFieldWithCompletionsProps = {
583
458
  size?: InputFieldSize;
584
459
  style?: React__default.CSSProperties;
585
460
  className?: string;
461
+ label?: React__default.ReactNode;
586
462
  children?: React__default.ReactNode;
587
463
  hideChildrenWhenFocused?: boolean;
588
464
  hideMenuWhenEmptyValue?: boolean;
@@ -592,9 +468,182 @@ interface InputFieldWithCompletionsRef {
592
468
  setValue(value: string): void;
593
469
  selectAllInputText(): void;
594
470
  }
595
- declare const InputFieldWithCompletions: (props: InputFieldWithCompletionsProps & React__default.RefAttributes<InputFieldWithCompletionsRef>) => React__default.ReactElement | null;
471
+ declare const Combobox: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<InputFieldWithCompletionsProps & React__default.RefAttributes<InputFieldWithCompletionsRef>>>;
472
+
473
+ interface MenuItemProps<T extends string> {
474
+ value?: T;
475
+ children: ReactNode;
476
+ onSelect: (value: T) => void;
477
+ checked: boolean;
478
+ disabled: boolean;
479
+ indented: boolean;
480
+ shortcut?: string;
481
+ icon?: ReactNode;
482
+ items?: MenuItem<T>[];
483
+ }
484
+ interface MenuProps<T extends string> {
485
+ children: ReactNode;
486
+ items: MenuItem<T>[];
487
+ onSelect: (value: T) => void;
488
+ isNested?: boolean;
489
+ shouldBindKeyboardShortcuts?: boolean;
490
+ onOpenChange?: (open: boolean) => void;
491
+ }
492
+ declare const ContextMenu: <T extends string>(props: MenuProps<T>) => React__default.ReactElement | null;
493
+
494
+ declare const StyledContent: React__default.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React__default.RefAttributes<HTMLDivElement>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
495
+ interface IDialog {
496
+ containsElement: (element: HTMLElement) => boolean;
497
+ }
498
+ interface Props$d {
499
+ title?: ReactNode;
500
+ description?: ReactNode;
501
+ children?: ReactNode;
502
+ style?: ComponentProps<typeof StyledContent>["style"];
503
+ open: ComponentProps<typeof DialogPrimitive.Root>["open"];
504
+ onOpenChange?: ComponentProps<typeof DialogPrimitive.Root>["onOpenChange"];
505
+ onOpenAutoFocus?: ComponentProps<typeof DialogPrimitive.Content>["onOpenAutoFocus"];
506
+ closeOnInteractOutside?: boolean;
507
+ className?: string;
508
+ }
509
+ declare const Dialog: React__default.ForwardRefExoticComponent<Props$d & React__default.RefAttributes<IDialog>>;
510
+ declare const FullscreenDialog: React__default.ForwardRefExoticComponent<Props$d & React__default.RefAttributes<IDialog>>;
511
+
512
+ type DividerVariant = "normal" | "subtle" | "strong";
513
+ interface DividerProps {
514
+ variant?: DividerVariant;
515
+ overflow?: number | string;
516
+ className?: string;
517
+ style?: React__default.CSSProperties;
518
+ }
519
+ declare const Divider: React__default.NamedExoticComponent<DividerProps>;
520
+ declare const DividerVertical: React__default.NamedExoticComponent<DividerProps>;
521
+
522
+ /**
523
+ * A button that opens a menu when clicked, but also allows dragging the
524
+ */
525
+ declare const DraggableMenuButton: <T extends string>(props: {
526
+ items?: MenuItem<T>[];
527
+ onSelect?: (value: T) => void;
528
+ isVisible?: boolean;
529
+ }) => React__default.ReactElement | null;
530
+
531
+ declare const DropdownMenu: <T extends string>(props: MenuProps<T> & {
532
+ open?: boolean;
533
+ onCloseAutoFocus?: React__default.EventHandler<SyntheticEvent<unknown>>;
534
+ emptyState?: React__default.ReactNode;
535
+ } & Pick<RadixDropdownMenu.DropdownMenuContentProps & React__default.RefAttributes<HTMLDivElement>, "align" | "side" | "sideOffset" | "alignOffset" | "collisionPadding"> & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
536
+
537
+ declare const SUPPORTED_IMAGE_UPLOAD_TYPES: ("image/png" | "image/jpeg" | "image/webp" | "image/svg+xml" | "application/pdf")[];
538
+ declare const SUPPORTED_CANVAS_UPLOAD_TYPES: ("" | "image/png" | "image/jpeg" | "image/webp" | "image/svg+xml" | "application/pdf")[];
539
+ type SupportedImageUploadType = (typeof SUPPORTED_IMAGE_UPLOAD_TYPES)[number];
540
+ type SupportedCanvasUploadType = (typeof SUPPORTED_CANVAS_UPLOAD_TYPES)[number];
541
+ type SketchPattern = {
542
+ _class: 'pattern';
543
+ image?: Sketch.FileRef | Sketch.DataRef;
544
+ patternFillType: Sketch.PatternFillType;
545
+ patternTileScale: number;
546
+ };
547
+
548
+ interface Props$c {
549
+ id?: string;
550
+ value?: Sketch.Color | Sketch.Gradient | SketchPattern;
551
+ }
552
+ declare const FillInputField: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<Props$c & React__default.RefAttributes<HTMLButtonElement>>>;
553
+
554
+ declare const PatternPreviewBackground: React__default.NamedExoticComponent<{
555
+ fillType: Sketch.PatternFillType;
556
+ tileScale: number;
557
+ imageRef: string;
558
+ }>;
559
+ interface Props$b {
560
+ value?: Sketch.Color | Sketch.Gradient | SketchPattern;
561
+ }
562
+ declare const FillPreviewBackground: React__default.NamedExoticComponent<Props$b>;
563
+
564
+ interface FloatingWindowProps {
565
+ title?: string;
566
+ onClose?: () => void;
567
+ children: React__default.ReactNode;
568
+ initialWidth?: number;
569
+ initialHeight?: number;
570
+ initialX?: number;
571
+ initialY?: number;
572
+ minWidth?: number;
573
+ minHeight?: number;
574
+ toolbarContent?: React__default.ReactNode;
575
+ renderToolbar?: (props: {
576
+ title?: string;
577
+ toolbarContent?: React__default.ReactNode;
578
+ onClose?: () => void;
579
+ }) => React__default.ReactNode;
580
+ }
581
+ declare const FloatingWindow: React__default.FC<FloatingWindowProps>;
582
+
583
+ interface Props$a {
584
+ value: Sketch.GradientStop[];
585
+ selectedStop: number;
586
+ onChangeColor: (color: Sketch.Color) => void;
587
+ onChangePosition: (position: number) => void;
588
+ onAdd: (color: Sketch.Color, position: number) => void;
589
+ onDelete: () => void;
590
+ onSelectStop: (index: number) => void;
591
+ }
592
+ declare const GradientPicker: React__default.NamedExoticComponent<Props$a>;
596
593
 
597
- declare const InspectorContainer: (props: {
594
+ type GridViewSize = "xxs" | "xs" | "small" | "medium" | "large" | "xl";
595
+ interface ItemProps$1<MenuItemType extends string = string> {
596
+ id: string;
597
+ title?: ReactNode;
598
+ subtitle?: ReactNode;
599
+ loading?: boolean;
600
+ selected?: boolean;
601
+ onClick?: (event: React__default.MouseEvent) => void;
602
+ onPress?: (options: KeyModifiers) => void;
603
+ onDoubleClick?: () => void;
604
+ onHoverChange?: (isHovering: boolean) => void;
605
+ children?: ReactNode;
606
+ menuItems?: MenuItem<MenuItemType>[];
607
+ onSelectMenuItem?: (value: MenuItemType) => void;
608
+ onContextMenu?: () => void;
609
+ style?: CSSProperties;
610
+ }
611
+ type GridViewContextValue = {
612
+ size: GridViewSize;
613
+ textPosition: "overlay" | "below" | "toolip";
614
+ bordered: boolean;
615
+ disabled: boolean;
616
+ };
617
+ interface GridViewRootProps extends Partial<GridViewContextValue> {
618
+ children: ReactNode;
619
+ onClick?: () => void;
620
+ scrollable?: boolean;
621
+ }
622
+ declare function GridViewRoot({ size, children, scrollable, onClick, textPosition, bordered, disabled, }: GridViewRootProps): React__default.JSX.Element;
623
+ declare function GridViewSection({ children, className, }: {
624
+ children?: ReactNode;
625
+ className?: string;
626
+ }): React__default.JSX.Element;
627
+ declare function GridViewSectionHeader({ title }: {
628
+ title: string;
629
+ }): React__default.JSX.Element;
630
+ declare namespace GridView {
631
+ const Root: React__default.MemoExoticComponent<typeof GridViewRoot>;
632
+ const Item: React__default.MemoExoticComponent<(<MenuItemType extends string>(props: ItemProps$1<MenuItemType> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null)>;
633
+ const Section: React__default.MemoExoticComponent<typeof GridViewSection>;
634
+ const SectionHeader: React__default.MemoExoticComponent<typeof GridViewSectionHeader>;
635
+ }
636
+
637
+ declare const IconButton: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<Omit<ButtonRootProps, "size" | "children" | "variant" | "flex"> & {
638
+ iconName: IconName;
639
+ className?: string;
640
+ style?: CSSProperties;
641
+ selected?: boolean;
642
+ color?: string;
643
+ size?: number;
644
+ } & React__default.RefAttributes<HTMLButtonElement>>>;
645
+
646
+ declare const InspectorContainer: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<{
598
647
  header?: React__default.ReactNode;
599
648
  children?: React__default.ReactNode;
600
649
  fallback?: React__default.ReactNode;
@@ -602,11 +651,11 @@ declare const InspectorContainer: (props: {
602
651
  id?: string;
603
652
  className?: string;
604
653
  style?: React__default.CSSProperties;
605
- } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
654
+ } & React__default.RefAttributes<HTMLDivElement>>>;
606
655
 
607
656
  interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
608
657
  }
609
- declare const Label: (props: LabelProps & React__default.RefAttributes<HTMLLabelElement>) => React__default.ReactElement | null;
658
+ declare const Label: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<LabelProps & React__default.RefAttributes<HTMLLabelElement>>>;
610
659
 
611
660
  interface ContainerProps {
612
661
  children: ReactNode;
@@ -615,7 +664,7 @@ interface ContainerProps {
615
664
  index: number;
616
665
  }) => ReactNode;
617
666
  }
618
- declare const LabeledElementView: (props: ContainerProps) => React__default.ReactElement | null;
667
+ declare const LabeledElementView: React__default.NamedExoticComponent<ContainerProps>;
619
668
 
620
669
  type PopoverVariant = "normal" | "large";
621
670
  interface Props$9 extends Pick<ComponentProps<(typeof PopoverPrimitive)["Content"]>, "onOpenAutoFocus" | "onCloseAutoFocus" | "onPointerDownOutside" | "onInteractOutside" | "onFocusOutside" | "side"> {
@@ -654,15 +703,16 @@ interface Props$8 {
654
703
  allowEmpty?: boolean;
655
704
  children: ReactNode;
656
705
  }
706
+ declare function ToggleGroupRoot({ id, value, onValueChange, colorScheme, allowEmpty, children, }: Props$8): React__default.JSX.Element;
657
707
  declare namespace RadioGroup {
658
- const Root: (props: Props$8) => React__default.ReactElement | null;
659
- const Item: (props: ItemProps & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement | null;
708
+ const Root: React__default.MemoExoticComponent<typeof ToggleGroupRoot>;
709
+ const Item: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<ItemProps & React__default.RefAttributes<HTMLButtonElement>>>;
660
710
  }
661
711
 
662
712
  interface Props$7 {
663
713
  children?: ReactNode | ((scrollElementRef: HTMLDivElement) => ReactNode);
664
714
  }
665
- declare const ScrollArea: (props: Props$7) => React__default.ReactElement | null;
715
+ declare const ScrollArea: React__default.NamedExoticComponent<Props$7>;
666
716
 
667
717
  type Props$6<T extends string> = {
668
718
  id?: string;
@@ -675,25 +725,34 @@ type Props$6<T extends string> = {
675
725
  disabled?: boolean;
676
726
  readOnly?: boolean;
677
727
  label?: React__default.ReactNode;
728
+ onFocus?: FocusEventHandler;
729
+ onBlur?: FocusEventHandler;
678
730
  } & Pick<SelectProps, "open">;
679
731
  declare const SelectMenu: <T extends string = string>(props: Props$6<T>) => React__default.ReactElement | null;
680
732
 
733
+ type ColorScheme = "primary" | "secondary";
681
734
  interface Props$5 {
682
735
  id?: string;
736
+ style?: React__default.CSSProperties;
737
+ className?: string;
683
738
  value: number;
684
739
  onValueChange: (value: number) => void;
685
740
  min: number;
686
741
  max: number;
742
+ colorScheme?: ColorScheme;
743
+ label?: React__default.ReactNode;
744
+ onFocus?: FocusEventHandler;
745
+ onBlur?: FocusEventHandler;
687
746
  }
688
- declare const Slider: ({ id, value, onValueChange, min, max, }: Props$5) => React__default.JSX.Element;
747
+ declare const Slider: ({ id, style, className, value, onValueChange, min, max, colorScheme, label, onFocus, onBlur, }: Props$5) => React__default.JSX.Element;
689
748
 
690
749
  interface Props$4 {
691
750
  size?: number | string;
692
751
  inline?: boolean;
693
752
  }
694
753
  declare namespace Spacer {
695
- const Vertical: (props: Props$4 & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement | null;
696
- const Horizontal: (props: Props$4 & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement | null;
754
+ const Vertical: React__default.ForwardRefExoticComponent<Props$4 & React__default.RefAttributes<HTMLSpanElement>>;
755
+ const Horizontal: React__default.ForwardRefExoticComponent<Props$4 & React__default.RefAttributes<HTMLSpanElement>>;
697
756
  }
698
757
 
699
758
  type SwitchColorScheme = "normal" | "primary" | "secondary";
@@ -704,8 +763,12 @@ interface Props$3 {
704
763
  /** @default normal */
705
764
  colorScheme?: SwitchColorScheme;
706
765
  disabled?: boolean;
766
+ onFocus?: FocusEventHandler;
767
+ onBlur?: FocusEventHandler;
768
+ className?: string;
769
+ style?: CSSProperties;
707
770
  }
708
- declare const Switch: ({ id, value, onChange, colorScheme, disabled, }: Props$3) => React__default.JSX.Element;
771
+ declare const Switch: ({ id, value, onChange, colorScheme, disabled, onFocus, onBlur, style, className, }: Props$3) => React__default.JSX.Element;
709
772
 
710
773
  declare const config: {
711
774
  content: string[];
@@ -779,6 +842,7 @@ declare const config: {
779
842
  "chip-secondary-shadow": string;
780
843
  "chip-error-shadow": string;
781
844
  "chip-default-shadow": string;
845
+ "floating-button": string;
782
846
  };
783
847
  fontFamily: {
784
848
  sans: [string, string, string, string, string, string, string, string, string, string];
@@ -870,6 +934,7 @@ declare const config: {
870
934
  zIndex: {
871
935
  interactable: string;
872
936
  label: string;
937
+ menu: string;
873
938
  };
874
939
  };
875
940
  };
@@ -944,6 +1009,7 @@ declare const cssVars: {
944
1009
  chipSecondaryShadow: string;
945
1010
  chipErrorShadow: string;
946
1011
  chipDefaultShadow: string;
1012
+ floatingButton: string;
947
1013
  };
948
1014
  fontFamily: {
949
1015
  sans: [string, string, string, string, string, string, string, string, string, string];
@@ -1035,6 +1101,7 @@ declare const cssVars: {
1035
1101
  zIndex: {
1036
1102
  interactable: string;
1037
1103
  label: string;
1104
+ menu: string;
1038
1105
  };
1039
1106
  };
1040
1107
 
@@ -1055,24 +1122,24 @@ type TextProps = {
1055
1122
  onKeyDown?: (event: React__default.KeyboardEvent<HTMLSpanElement>) => void;
1056
1123
  tabIndex?: number;
1057
1124
  };
1058
- declare const Text$1: (props: TextProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
1125
+ declare const Text$1: React__default.ForwardRefExoticComponent<TextProps & React__default.RefAttributes<HTMLElement>>;
1059
1126
  type PresetProps = Omit<TextProps, "variant">;
1060
- declare const Heading1: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
1061
- declare const Heading2: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
1062
- declare const Heading3: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
1063
- declare const Heading4: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
1064
- declare const Heading5: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
1065
- declare const Body: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
1066
- declare const Small: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
1127
+ declare const Heading1: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1128
+ declare const Heading2: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1129
+ declare const Heading3: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1130
+ declare const Heading4: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1131
+ declare const Heading5: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1132
+ declare const Body: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1133
+ declare const Small: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1067
1134
  declare const Italic: ({ children }: {
1068
1135
  children: ReactNode;
1069
1136
  }) => React__default.JSX.Element;
1070
1137
 
1071
1138
  declare const useAutoResize: (value: string) => React__default.MutableRefObject<HTMLTextAreaElement | null>;
1072
- declare const AutoResizingTextArea: (props: {
1139
+ declare const AutoResizingTextArea: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<{
1073
1140
  onChangeText: (value: string) => void;
1074
1141
  value?: string;
1075
- } & React__default.TextareaHTMLAttributes<HTMLTextAreaElement> & React__default.RefAttributes<HTMLTextAreaElement>) => React__default.ReactElement | null;
1142
+ } & React__default.TextareaHTMLAttributes<HTMLTextAreaElement> & React__default.RefAttributes<HTMLTextAreaElement>>>;
1076
1143
 
1077
1144
  declare const Toast: ({ title, content, children, ...props }: {
1078
1145
  title?: string;
@@ -1087,7 +1154,7 @@ interface Props$2 {
1087
1154
  children: ReactNode;
1088
1155
  content: ReactNode;
1089
1156
  }
1090
- declare const Tooltip: (props: Props$2) => React__default.ReactElement | null;
1157
+ declare const Tooltip: React__default.NamedExoticComponent<Props$2>;
1091
1158
 
1092
1159
  type TreeRowBaseProps = {
1093
1160
  icon?: Exclude<ReactNode, string> | IconName;
@@ -1120,21 +1187,38 @@ declare namespace TreeView {
1120
1187
  acceptsDrop?: DropValidator;
1121
1188
  pressEventName?: "onClick" | "onPointerDown";
1122
1189
  variant?: "normal" | "bare" | "padded";
1123
- sectionHeaderVariant?: "label" | "normal";
1190
+ sectionHeaderVariant?: "normal" | "label";
1124
1191
  divider?: boolean;
1125
1192
  gap?: number;
1126
1193
  colorScheme?: "primary" | "secondary";
1127
1194
  }) & React__default.RefAttributes<IVirtualizedList>) => React__default.ReactElement | null;
1128
- const RowTitle: (props: {
1195
+ const RowTitle: React__default.MemoExoticComponent<({ className, children, ...props }: {
1129
1196
  className?: string;
1130
1197
  children: React__default.ReactNode;
1131
- } & React__default.HTMLAttributes<HTMLSpanElement>) => React__default.ReactElement | null;
1132
- const EditableRowTitle: (props: EditableRowProps) => React__default.ReactElement | null;
1198
+ } & React__default.HTMLAttributes<HTMLSpanElement>) => React__default.JSX.Element>;
1199
+ const EditableRowTitle: React__default.MemoExoticComponent<({ value, onSubmitEditing, autoFocus, placeholder, }: EditableRowProps) => React__default.JSX.Element>;
1133
1200
  const Row: <MenuItemType extends string>(props: ListView.RowProps<MenuItemType> & TreeRowBaseProps & React__default.RefAttributes<HTMLLIElement>) => React__default.ReactElement | null;
1134
1201
  type ClickInfo = ListView.ClickInfo;
1135
1202
  type RowProps<MenuItemType extends string> = TreeViewRowProps<MenuItemType>;
1136
1203
  }
1137
1204
 
1205
+ type Point = {
1206
+ x: number;
1207
+ y: number;
1208
+ };
1209
+ type UserPointerProps = {
1210
+ userId?: string;
1211
+ name?: string;
1212
+ /** label to display in the tooltip next to the Pointer */
1213
+ visible?: boolean;
1214
+ point: Point;
1215
+ /** defaults to a random color based on the key, but can optionally be overridden */
1216
+ backgroundColor?: string;
1217
+ style?: React__default.CSSProperties;
1218
+ className?: string;
1219
+ };
1220
+ declare const UserPointer: React__default.NamedExoticComponent<UserPointerProps>;
1221
+
1138
1222
  declare const EDITOR_PANEL_GROUP_ID = "editor-panel-group";
1139
1223
  declare const LEFT_SIDEBAR_ID = "editor-left-sidebar";
1140
1224
  declare const RIGHT_SIDEBAR_ID = "editor-right-sidebar";
@@ -1154,6 +1238,7 @@ interface Props$1 {
1154
1238
  hasLeftSidebar?: boolean;
1155
1239
  onChangeLayoutState?: (layoutState: PanelLayoutState) => void;
1156
1240
  leftSidebarCanResize?: boolean;
1241
+ rightSidebarCanResize?: boolean;
1157
1242
  id?: string;
1158
1243
  className?: string;
1159
1244
  style?: React__default.CSSProperties;
@@ -1177,25 +1262,35 @@ type IWorkspaceLayout = {
1177
1262
  toggleLeftSidebar: () => void;
1178
1263
  toggleRightSidebar: () => void;
1179
1264
  };
1180
- declare const WorkspaceLayout: (props: Props$1 & React__default.RefAttributes<IWorkspaceLayout>) => React__default.ReactElement | null;
1265
+ declare const WorkspaceLayout: React__default.ForwardRefExoticComponent<Props$1 & React__default.RefAttributes<IWorkspaceLayout>>;
1181
1266
 
1182
1267
  type DesignSystemConfigurationContextValue = {
1183
1268
  platform: PlatformName;
1184
1269
  };
1185
- declare const DesignSystemConfigurationProvider: (props: {
1270
+ declare const DesignSystemConfigurationProvider: React__default.NamedExoticComponent<{
1186
1271
  children: ReactNode;
1187
1272
  platform?: PlatformName;
1188
- }) => React__default.ReactElement | null;
1273
+ }>;
1189
1274
  declare function useDesignSystemConfiguration(): DesignSystemConfigurationContextValue;
1190
1275
 
1191
1276
  type DialogContextValue = {
1192
- openInputDialog(title: string, inputValue?: string): Promise<string | undefined>;
1277
+ openInputDialog(options: string | {
1278
+ title: string;
1279
+ description?: ReactNode;
1280
+ placeholder?: string;
1281
+ initialValue?: string;
1282
+ }): Promise<string | undefined>;
1193
1283
  containsElement(element: HTMLElement): boolean;
1194
1284
  };
1195
1285
  declare const DialogProvider: ({ children, }: {
1196
1286
  children: ReactNode;
1197
1287
  }) => React__default.JSX.Element;
1198
- declare function useOpenInputDialog(): (title: string, inputValue?: string) => Promise<string | undefined>;
1288
+ declare function useOpenInputDialog(): (options: string | {
1289
+ title: string;
1290
+ description?: ReactNode;
1291
+ placeholder?: string;
1292
+ initialValue?: string;
1293
+ }) => Promise<string | undefined>;
1199
1294
  declare function useDialogContainsElement(): (element: HTMLElement) => boolean;
1200
1295
 
1201
1296
  type FloatingWindowContextValue = {
@@ -1211,21 +1306,12 @@ declare const FloatingWindowProvider: ({ children, }: {
1211
1306
  declare const useFloatingWindowManager: () => FloatingWindowContextValue;
1212
1307
  declare const useCurrentFloatingWindowInternal: () => CurrentWindowContextValue;
1213
1308
 
1214
- type ImageDataContextValue = {
1215
- getImageData: (ref: string) => ArrayBuffer | undefined;
1216
- };
1217
- declare const ImageDataProvider: (props: {
1218
- children: ReactNode;
1219
- getImageData?: (ref: string) => ArrayBuffer | undefined;
1220
- }) => React__default.ReactElement | null;
1221
- declare function useImageData(ref: string): ArrayBuffer | undefined;
1222
-
1223
1309
  type GlobalInputBlurContextValue = {
1224
1310
  addListener: (f: () => void) => void;
1225
1311
  removeListener: (f: () => void) => void;
1226
1312
  trigger: () => void;
1227
1313
  };
1228
- declare const GlobalInputBlurProvider: React$1.Provider<GlobalInputBlurContextValue>;
1314
+ declare const GlobalInputBlurProvider: React.Provider<GlobalInputBlurContextValue>;
1229
1315
  /**
1230
1316
  * Some components store their editable state internally.
1231
1317
  * We trigger this event before selection changes so that they can commit their
@@ -1237,6 +1323,15 @@ declare const useGlobalInputBlur: () => GlobalInputBlurContextValue;
1237
1323
  declare function useGlobalInputBlurListener(f: () => void): void;
1238
1324
  declare function useGlobalInputBlurTrigger(): () => void;
1239
1325
 
1326
+ type ImageDataContextValue = {
1327
+ getImageData: (ref: string) => ArrayBuffer | undefined;
1328
+ };
1329
+ declare const ImageDataProvider: React__default.NamedExoticComponent<{
1330
+ children: ReactNode;
1331
+ getImageData?: (ref: string) => ArrayBuffer | undefined;
1332
+ }>;
1333
+ declare function useImageData(ref: string): ArrayBuffer | undefined;
1334
+
1240
1335
  interface HoverEvent {
1241
1336
  /** The type of hover event being fired. */
1242
1337
  type: 'hoverstart' | 'hoverend';
@@ -1259,7 +1354,7 @@ interface HoverProps extends HoverEvents {
1259
1354
  }
1260
1355
  interface HoverResult {
1261
1356
  /** Props to spread on the target element. */
1262
- hoverProps: React$1.HTMLAttributes<HTMLElement>;
1357
+ hoverProps: React.HTMLAttributes<HTMLElement>;
1263
1358
  isHovered: boolean;
1264
1359
  }
1265
1360
  /**
@@ -1274,6 +1369,14 @@ declare function usePlatform(): _noya_app_noya_keymap.PlatformName;
1274
1369
  */
1275
1370
  declare function usePlatformModKey(): 'ctrlKey' | 'metaKey';
1276
1371
 
1372
+ /** @default light */
1373
+ type UseThemeReturnType = "dark" | "light";
1374
+ /**
1375
+ * Hook to get the current theme of the app via the `data-theme` attribute on the body element.
1376
+ * @returns The current theme.
1377
+ */
1378
+ declare function useTheme(): UseThemeReturnType;
1379
+
1277
1380
  declare const size: {
1278
1381
  medium: string;
1279
1382
  large: string;
@@ -1287,12 +1390,7 @@ declare const mediaQuery: {
1287
1390
  xlarge: string;
1288
1391
  };
1289
1392
 
1290
- /**
1291
- * Utility for merging classes conditionally. Right side will override left side if there are any conflicts.
1292
- * Usage: cn('bg-red-500 text-white', 'bg-blue-500') // Returns: 'text-white bg-blue-500'
1293
- * @danger do not use this function to concatenate class names. Use it to merge classes conditionally.
1294
- */
1295
- declare const cn: (...classes: (string | boolean | undefined | null)[]) => string;
1393
+ declare function cx(...args: Array<string | number | boolean | null | undefined>): string;
1296
1394
 
1297
1395
  type Optional<T> = T | false | null | undefined;
1298
1396
  type MenuConfig<T extends string> = Optional<Optional<RegularMenuItem<T>>[]>[];
@@ -1300,10 +1398,12 @@ declare function createSectionedMenu<T extends string>(...sections: MenuConfig<T
1300
1398
 
1301
1399
  declare function getGradientBackground(value: Sketch.GradientStop[], type: Sketch.GradientType, direction?: number): string;
1302
1400
 
1303
- declare function useDarkMode(elementRef: React.RefObject<HTMLElement>): {
1304
- isDark: boolean;
1305
- elementRef: React$1.RefObject<HTMLElement>;
1306
- };
1401
+ declare const colorForStringValues: Record<string, string>;
1402
+ /**
1403
+ * Create a background color and initials from a name
1404
+ * Adapted from (MIT) https://mui.com/material-ui/react-avatar/
1405
+ */
1406
+ declare function colorFromString(str: string): string;
1307
1407
 
1308
1408
  declare function sketchColorToRgba(value: Sketch.Color): RgbaColor;
1309
1409
  declare function sketchColorToRgbaString(value: Sketch.Color): string;
@@ -1328,23 +1428,23 @@ interface Props {
1328
1428
  disabled?: boolean;
1329
1429
  trigger?: "change" | "submit";
1330
1430
  }
1331
- declare const DimensionInput: (props: Props) => React__default.ReactElement | null;
1431
+ declare const DimensionInput: React__default.NamedExoticComponent<Props>;
1332
1432
 
1333
- declare const Section: (props: React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
1334
- declare const SectionHeader: (props: React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
1433
+ declare const Section: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
1434
+ declare const SectionHeader: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
1335
1435
  type TitleTextStyle = "small" | "heading5" | "heading4" | "heading3";
1336
- declare const Title: (props: React__default.HTMLAttributes<HTMLDivElement> & {
1436
+ declare const Title: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & {
1337
1437
  $textStyle?: TitleTextStyle;
1338
- } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
1339
- declare const Row: (props: React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
1340
- declare const Column: (props: React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
1341
- declare const Checkbox: (props: React__default.InputHTMLAttributes<HTMLInputElement> & React__default.RefAttributes<HTMLInputElement>) => React__default.ReactElement | null;
1342
- declare const Text: (props: React__default.HTMLAttributes<HTMLSpanElement> & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement | null;
1438
+ } & React__default.RefAttributes<HTMLDivElement>>;
1439
+ declare const Row: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
1440
+ declare const Column: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
1441
+ declare const Checkbox: React__default.ForwardRefExoticComponent<React__default.InputHTMLAttributes<HTMLInputElement> & React__default.RefAttributes<HTMLInputElement>>;
1442
+ declare const Text: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLSpanElement> & React__default.RefAttributes<HTMLSpanElement>>;
1343
1443
  declare const VerticalSeparator: () => React__default.JSX.Element;
1344
1444
  declare const HorizontalSeparator: () => React__default.JSX.Element;
1345
- declare const RowLabel: (props: React__default.LabelHTMLAttributes<HTMLLabelElement> & {
1445
+ declare const RowLabel: React__default.ForwardRefExoticComponent<React__default.LabelHTMLAttributes<HTMLLabelElement> & {
1346
1446
  $textStyle?: TitleTextStyle | "label";
1347
- } & React__default.RefAttributes<HTMLLabelElement>) => React__default.ReactElement | null;
1447
+ } & React__default.RefAttributes<HTMLLabelElement>>;
1348
1448
  interface LabeledRowProps {
1349
1449
  id?: string;
1350
1450
  children: ReactNode;
@@ -1353,7 +1453,7 @@ interface LabeledRowProps {
1353
1453
  right?: ReactNode;
1354
1454
  className?: string;
1355
1455
  }
1356
- declare const LabeledRow: (props: LabeledRowProps) => React__default.ReactElement | null;
1456
+ declare const LabeledRow: React__default.NamedExoticComponent<LabeledRowProps>;
1357
1457
 
1358
1458
  declare const InspectorPrimitives_Checkbox: typeof Checkbox;
1359
1459
  declare const InspectorPrimitives_Column: typeof Column;
@@ -1370,9 +1470,4 @@ declare namespace InspectorPrimitives {
1370
1470
  export { InspectorPrimitives_Checkbox as Checkbox, InspectorPrimitives_Column as Column, InspectorPrimitives_HorizontalSeparator as HorizontalSeparator, InspectorPrimitives_LabeledRow as LabeledRow, InspectorPrimitives_Row as Row, InspectorPrimitives_RowLabel as RowLabel, InspectorPrimitives_Section as Section, InspectorPrimitives_SectionHeader as SectionHeader, InspectorPrimitives_Text as Text, InspectorPrimitives_Title as Title, InspectorPrimitives_VerticalSeparator as VerticalSeparator };
1371
1471
  }
1372
1472
 
1373
- declare module "react" {
1374
- function memo<A, B>(Component: (props: A) => B): (props: A) => React.ReactElement | null;
1375
- function forwardRef<T, P = {}>(render: (props: P, ref: React.ForwardedRef<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
1376
- }
1377
-
1378
- export { ActivityIndicator, AutoResizingTextArea, Avatar, AvatarStack, Body, Button, type ButtonRootProps, CONTENT_AREA_ID, Checkbox$1 as Checkbox, Chip, type ChipProps, type CompletionItem, type CompletionListItem, CompletionMenu, type CompletionSectionHeader, ContextMenu, type DesignSystemConfigurationContextValue, DesignSystemConfigurationProvider, Dialog, type DialogContextValue, DialogProvider, DimensionInput, type DimensionValue, Divider, DividerVertical, DraggableMenuButton, type DropValidator, DropdownMenu, EDITOR_PANEL_GROUP_ID, type EditableRowProps, type ExtractMenuItemType, FillInputField, FillPreviewBackground, FloatingWindow, FloatingWindowProvider, FullscreenDialog, type GlobalInputBlurContextValue, GlobalInputBlurProvider, GradientPicker, GridView, type GridViewSize, Heading1, Heading2, Heading3, Heading4, Heading5, type HoverEvent, type HoverEvents, type HoverProps, type IDialog, type IScoredItem, type IToken, type IVirtualizedList, type IWorkspaceLayout, IconButton, type IconName, type ImageDataContextValue, ImageDataProvider, InputField, type InputFieldInputProps, type InputFieldSize, InputFieldWithCompletions, type InputFieldWithCompletionsProps, type InputFieldWithCompletionsRef, InspectorContainer, InspectorPrimitives, Italic, KeyboardShortcut, LEFT_SIDEBAR_ID, Label, LabeledElementView, type ListRowMarginType, type ListRowPosition, ListView, type MatchRange, type MenuConfig, type MenuItem, type MenuItemProps, type MenuProps, type Optional, type PanelLayoutState, PatternPreviewBackground, Popover, Progress, RIGHT_SIDEBAR_ID, RadioGroup, type RegularMenuItem, type RelativeDropPosition, SEPARATOR_ITEM, SUPPORTED_CANVAS_UPLOAD_TYPES, SUPPORTED_IMAGE_UPLOAD_TYPES, ScrollArea, SelectMenu, type SetNumberMode, type SketchPattern, Slider, Small, Sortable, Spacer, type SupportedCanvasUploadType, type SupportedImageUploadType, Switch, Text$1 as Text, type TextProps, type Theme, type ThemeColor, Toast, ToastProvider, Tooltip, TreeView, WorkspaceLayout, cn, createSectionedMenu, cssVars, fuzzyFilter, fuzzyScore, fuzzyTokenize, getGradientBackground, getNewValue, mediaQuery, normalizeListDestinationIndex, renderIcon, rgbaToSketchColor, size, sketchColorToHex, sketchColorToRgba, sketchColorToRgbaString, textStyles, useAutoResize, useCurrentFloatingWindowInternal, useDarkMode, useDesignSystemConfiguration, useDialogContainsElement, useFloatingWindowManager, useGlobalInputBlur, useGlobalInputBlurListener, useGlobalInputBlurTrigger, useHover, useImageData, useOpenInputDialog, usePlatform, usePlatformModKey, usePreservePanelSize, withSeparatorElements };
1473
+ export { ActivityIndicator, AnimatePresence, type AnimatePresenceProps, AutoResizingTextArea, Avatar, type AvatarProps, AvatarStack, Body, Button, type ButtonRootProps, CONTENT_AREA_ID, Checkbox$1 as Checkbox, Chip, type ChipProps, Combobox, type CompletionItem, type CompletionListItem, CompletionMenu, type CompletionSectionHeader, ContextMenu, type DesignSystemConfigurationContextValue, DesignSystemConfigurationProvider, Dialog, type DialogContextValue, DialogProvider, DimensionInput, type DimensionValue, Divider, DividerVertical, DraggableMenuButton, type DropValidator, DropdownMenu, EDITOR_PANEL_GROUP_ID, type EditableRowProps, type ExtractMenuItemType, FillInputField, FillPreviewBackground, FloatingWindow, FloatingWindowProvider, FullscreenDialog, type GlobalInputBlurContextValue, GlobalInputBlurProvider, GradientPicker, GridView, type GridViewSize, Heading1, Heading2, Heading3, Heading4, Heading5, type HoverEvent, type HoverEvents, type HoverProps, type IDialog, type IScoredItem, type IToken, type IVirtualizedList, type IWorkspaceLayout, IconButton, type IconName, type ImageDataContextValue, ImageDataProvider, InputField, type InputFieldInputProps, type InputFieldSize, type InputFieldWithCompletionsProps, type InputFieldWithCompletionsRef, InspectorContainer, InspectorPrimitives, Italic, KeyboardShortcut, LEFT_SIDEBAR_ID, Label, LabeledElementView, type ListRowMarginType, type ListRowPosition, ListView, type MatchRange, type MenuConfig, type MenuItem, type MenuItemProps, type MenuProps, type Optional, type PanelLayoutState, PatternPreviewBackground, Popover, Progress, RIGHT_SIDEBAR_ID, RadioGroup, type RegularMenuItem, type RelativeDropPosition, SEPARATOR_ITEM, SUPPORTED_CANVAS_UPLOAD_TYPES, SUPPORTED_IMAGE_UPLOAD_TYPES, ScrollArea, SelectMenu, type SetNumberMode, type SketchPattern, Slider, Small, Sortable, Spacer, type SupportedCanvasUploadType, type SupportedImageUploadType, Switch, Text$1 as Text, type TextProps, type Theme, type ThemeColor, Toast, ToastProvider, Tooltip, TreeView, type UseThemeReturnType, UserPointer, type UserPointerProps, WorkspaceLayout, colorForStringValues, colorFromString, createSectionedMenu, cssVars, cx, fuzzyFilter, fuzzyScore, fuzzyTokenize, getGradientBackground, getNewValue, mediaQuery, normalizeListDestinationIndex, renderIcon, rgbaToSketchColor, size, sketchColorToHex, sketchColorToRgba, sketchColorToRgbaString, textStyles, useAutoResize, useCurrentFloatingWindowInternal, useDesignSystemConfiguration, useDialogContainsElement, useFloatingWindowManager, useGlobalInputBlur, useGlobalInputBlurListener, useGlobalInputBlurTrigger, useHover, useImageData, useOpenInputDialog, usePlatform, usePlatformModKey, usePreservePanelSize, useTheme, withSeparatorElements };