@noya-app/noya-designsystem 0.1.39 → 0.1.41

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 +419 -323
  5. package/dist/index.d.ts +419 -323
  6. package/dist/index.js +6583 -8325
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +5721 -7468
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +5 -5
  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 +7 -2
  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 +104 -10
  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 +19 -16
  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 +17 -14
  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,35 @@ 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
+ step?: number;
743
+ colorScheme?: ColorScheme;
744
+ label?: React__default.ReactNode;
745
+ onFocus?: FocusEventHandler;
746
+ onBlur?: FocusEventHandler;
687
747
  }
688
- declare const Slider: ({ id, value, onValueChange, min, max, }: Props$5) => React__default.JSX.Element;
748
+ declare const Slider: React__default.NamedExoticComponent<Props$5>;
689
749
 
690
750
  interface Props$4 {
691
751
  size?: number | string;
692
752
  inline?: boolean;
693
753
  }
694
754
  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;
755
+ const Vertical: React__default.ForwardRefExoticComponent<Props$4 & React__default.RefAttributes<HTMLSpanElement>>;
756
+ const Horizontal: React__default.ForwardRefExoticComponent<Props$4 & React__default.RefAttributes<HTMLSpanElement>>;
697
757
  }
698
758
 
699
759
  type SwitchColorScheme = "normal" | "primary" | "secondary";
@@ -704,8 +764,12 @@ interface Props$3 {
704
764
  /** @default normal */
705
765
  colorScheme?: SwitchColorScheme;
706
766
  disabled?: boolean;
767
+ onFocus?: FocusEventHandler;
768
+ onBlur?: FocusEventHandler;
769
+ className?: string;
770
+ style?: CSSProperties;
707
771
  }
708
- declare const Switch: ({ id, value, onChange, colorScheme, disabled, }: Props$3) => React__default.JSX.Element;
772
+ declare const Switch: ({ id, value, onChange, colorScheme, disabled, onFocus, onBlur, style, className, }: Props$3) => React__default.JSX.Element;
709
773
 
710
774
  declare const config: {
711
775
  content: string[];
@@ -749,7 +813,7 @@ declare const config: {
749
813
  "popover-divider": string;
750
814
  "listview-raised-background": string;
751
815
  "listview-editing-background": string;
752
- "slider-background": string;
816
+ "slider-thumb-background": string;
753
817
  "slider-border": string;
754
818
  "radio-group-background": string;
755
819
  mask: string;
@@ -779,6 +843,7 @@ declare const config: {
779
843
  "chip-secondary-shadow": string;
780
844
  "chip-error-shadow": string;
781
845
  "chip-default-shadow": string;
846
+ "floating-button": string;
782
847
  };
783
848
  fontFamily: {
784
849
  sans: [string, string, string, string, string, string, string, string, string, string];
@@ -870,6 +935,7 @@ declare const config: {
870
935
  zIndex: {
871
936
  interactable: string;
872
937
  label: string;
938
+ menu: string;
873
939
  };
874
940
  };
875
941
  };
@@ -914,7 +980,7 @@ declare const cssVars: {
914
980
  popoverDivider: string;
915
981
  listviewRaisedBackground: string;
916
982
  listviewEditingBackground: string;
917
- sliderBackground: string;
983
+ sliderThumbBackground: string;
918
984
  sliderBorder: string;
919
985
  radioGroupBackground: string;
920
986
  mask: string;
@@ -944,6 +1010,7 @@ declare const cssVars: {
944
1010
  chipSecondaryShadow: string;
945
1011
  chipErrorShadow: string;
946
1012
  chipDefaultShadow: string;
1013
+ floatingButton: string;
947
1014
  };
948
1015
  fontFamily: {
949
1016
  sans: [string, string, string, string, string, string, string, string, string, string];
@@ -1035,6 +1102,7 @@ declare const cssVars: {
1035
1102
  zIndex: {
1036
1103
  interactable: string;
1037
1104
  label: string;
1105
+ menu: string;
1038
1106
  };
1039
1107
  };
1040
1108
 
@@ -1055,24 +1123,24 @@ type TextProps = {
1055
1123
  onKeyDown?: (event: React__default.KeyboardEvent<HTMLSpanElement>) => void;
1056
1124
  tabIndex?: number;
1057
1125
  };
1058
- declare const Text$1: (props: TextProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement | null;
1126
+ declare const Text$1: React__default.ForwardRefExoticComponent<TextProps & React__default.RefAttributes<HTMLElement>>;
1059
1127
  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;
1128
+ declare const Heading1: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1129
+ declare const Heading2: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1130
+ declare const Heading3: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1131
+ declare const Heading4: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1132
+ declare const Heading5: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1133
+ declare const Body: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1134
+ declare const Small: React__default.ForwardRefExoticComponent<PresetProps & React__default.RefAttributes<HTMLElement>>;
1067
1135
  declare const Italic: ({ children }: {
1068
1136
  children: ReactNode;
1069
1137
  }) => React__default.JSX.Element;
1070
1138
 
1071
1139
  declare const useAutoResize: (value: string) => React__default.MutableRefObject<HTMLTextAreaElement | null>;
1072
- declare const AutoResizingTextArea: (props: {
1140
+ declare const AutoResizingTextArea: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<{
1073
1141
  onChangeText: (value: string) => void;
1074
1142
  value?: string;
1075
- } & React__default.TextareaHTMLAttributes<HTMLTextAreaElement> & React__default.RefAttributes<HTMLTextAreaElement>) => React__default.ReactElement | null;
1143
+ } & React__default.TextareaHTMLAttributes<HTMLTextAreaElement> & React__default.RefAttributes<HTMLTextAreaElement>>>;
1076
1144
 
1077
1145
  declare const Toast: ({ title, content, children, ...props }: {
1078
1146
  title?: string;
@@ -1087,7 +1155,7 @@ interface Props$2 {
1087
1155
  children: ReactNode;
1088
1156
  content: ReactNode;
1089
1157
  }
1090
- declare const Tooltip: (props: Props$2) => React__default.ReactElement | null;
1158
+ declare const Tooltip: React__default.NamedExoticComponent<Props$2>;
1091
1159
 
1092
1160
  type TreeRowBaseProps = {
1093
1161
  icon?: Exclude<ReactNode, string> | IconName;
@@ -1120,21 +1188,38 @@ declare namespace TreeView {
1120
1188
  acceptsDrop?: DropValidator;
1121
1189
  pressEventName?: "onClick" | "onPointerDown";
1122
1190
  variant?: "normal" | "bare" | "padded";
1123
- sectionHeaderVariant?: "label" | "normal";
1191
+ sectionHeaderVariant?: "normal" | "label";
1124
1192
  divider?: boolean;
1125
1193
  gap?: number;
1126
1194
  colorScheme?: "primary" | "secondary";
1127
1195
  }) & React__default.RefAttributes<IVirtualizedList>) => React__default.ReactElement | null;
1128
- const RowTitle: (props: {
1196
+ const RowTitle: React__default.MemoExoticComponent<({ className, children, ...props }: {
1129
1197
  className?: string;
1130
1198
  children: React__default.ReactNode;
1131
- } & React__default.HTMLAttributes<HTMLSpanElement>) => React__default.ReactElement | null;
1132
- const EditableRowTitle: (props: EditableRowProps) => React__default.ReactElement | null;
1199
+ } & React__default.HTMLAttributes<HTMLSpanElement>) => React__default.JSX.Element>;
1200
+ const EditableRowTitle: React__default.MemoExoticComponent<({ value, onSubmitEditing, autoFocus, placeholder, }: EditableRowProps) => React__default.JSX.Element>;
1133
1201
  const Row: <MenuItemType extends string>(props: ListView.RowProps<MenuItemType> & TreeRowBaseProps & React__default.RefAttributes<HTMLLIElement>) => React__default.ReactElement | null;
1134
1202
  type ClickInfo = ListView.ClickInfo;
1135
1203
  type RowProps<MenuItemType extends string> = TreeViewRowProps<MenuItemType>;
1136
1204
  }
1137
1205
 
1206
+ type Point = {
1207
+ x: number;
1208
+ y: number;
1209
+ };
1210
+ type UserPointerProps = {
1211
+ userId?: string;
1212
+ name?: string;
1213
+ /** label to display in the tooltip next to the Pointer */
1214
+ visible?: boolean;
1215
+ point: Point;
1216
+ /** defaults to a random color based on the key, but can optionally be overridden */
1217
+ backgroundColor?: string;
1218
+ style?: React__default.CSSProperties;
1219
+ className?: string;
1220
+ };
1221
+ declare const UserPointer: React__default.NamedExoticComponent<UserPointerProps>;
1222
+
1138
1223
  declare const EDITOR_PANEL_GROUP_ID = "editor-panel-group";
1139
1224
  declare const LEFT_SIDEBAR_ID = "editor-left-sidebar";
1140
1225
  declare const RIGHT_SIDEBAR_ID = "editor-right-sidebar";
@@ -1154,6 +1239,7 @@ interface Props$1 {
1154
1239
  hasLeftSidebar?: boolean;
1155
1240
  onChangeLayoutState?: (layoutState: PanelLayoutState) => void;
1156
1241
  leftSidebarCanResize?: boolean;
1242
+ rightSidebarCanResize?: boolean;
1157
1243
  id?: string;
1158
1244
  className?: string;
1159
1245
  style?: React__default.CSSProperties;
@@ -1177,25 +1263,35 @@ type IWorkspaceLayout = {
1177
1263
  toggleLeftSidebar: () => void;
1178
1264
  toggleRightSidebar: () => void;
1179
1265
  };
1180
- declare const WorkspaceLayout: (props: Props$1 & React__default.RefAttributes<IWorkspaceLayout>) => React__default.ReactElement | null;
1266
+ declare const WorkspaceLayout: React__default.ForwardRefExoticComponent<Props$1 & React__default.RefAttributes<IWorkspaceLayout>>;
1181
1267
 
1182
1268
  type DesignSystemConfigurationContextValue = {
1183
1269
  platform: PlatformName;
1184
1270
  };
1185
- declare const DesignSystemConfigurationProvider: (props: {
1271
+ declare const DesignSystemConfigurationProvider: React__default.NamedExoticComponent<{
1186
1272
  children: ReactNode;
1187
1273
  platform?: PlatformName;
1188
- }) => React__default.ReactElement | null;
1274
+ }>;
1189
1275
  declare function useDesignSystemConfiguration(): DesignSystemConfigurationContextValue;
1190
1276
 
1191
1277
  type DialogContextValue = {
1192
- openInputDialog(title: string, inputValue?: string): Promise<string | undefined>;
1278
+ openInputDialog(options: string | {
1279
+ title: string;
1280
+ description?: ReactNode;
1281
+ placeholder?: string;
1282
+ initialValue?: string;
1283
+ }): Promise<string | undefined>;
1193
1284
  containsElement(element: HTMLElement): boolean;
1194
1285
  };
1195
1286
  declare const DialogProvider: ({ children, }: {
1196
1287
  children: ReactNode;
1197
1288
  }) => React__default.JSX.Element;
1198
- declare function useOpenInputDialog(): (title: string, inputValue?: string) => Promise<string | undefined>;
1289
+ declare function useOpenInputDialog(): (options: string | {
1290
+ title: string;
1291
+ description?: ReactNode;
1292
+ placeholder?: string;
1293
+ initialValue?: string;
1294
+ }) => Promise<string | undefined>;
1199
1295
  declare function useDialogContainsElement(): (element: HTMLElement) => boolean;
1200
1296
 
1201
1297
  type FloatingWindowContextValue = {
@@ -1211,21 +1307,12 @@ declare const FloatingWindowProvider: ({ children, }: {
1211
1307
  declare const useFloatingWindowManager: () => FloatingWindowContextValue;
1212
1308
  declare const useCurrentFloatingWindowInternal: () => CurrentWindowContextValue;
1213
1309
 
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
1310
  type GlobalInputBlurContextValue = {
1224
1311
  addListener: (f: () => void) => void;
1225
1312
  removeListener: (f: () => void) => void;
1226
1313
  trigger: () => void;
1227
1314
  };
1228
- declare const GlobalInputBlurProvider: React$1.Provider<GlobalInputBlurContextValue>;
1315
+ declare const GlobalInputBlurProvider: React.Provider<GlobalInputBlurContextValue>;
1229
1316
  /**
1230
1317
  * Some components store their editable state internally.
1231
1318
  * We trigger this event before selection changes so that they can commit their
@@ -1237,6 +1324,15 @@ declare const useGlobalInputBlur: () => GlobalInputBlurContextValue;
1237
1324
  declare function useGlobalInputBlurListener(f: () => void): void;
1238
1325
  declare function useGlobalInputBlurTrigger(): () => void;
1239
1326
 
1327
+ type ImageDataContextValue = {
1328
+ getImageData: (ref: string) => ArrayBuffer | undefined;
1329
+ };
1330
+ declare const ImageDataProvider: React__default.NamedExoticComponent<{
1331
+ children: ReactNode;
1332
+ getImageData?: (ref: string) => ArrayBuffer | undefined;
1333
+ }>;
1334
+ declare function useImageData(ref: string): ArrayBuffer | undefined;
1335
+
1240
1336
  interface HoverEvent {
1241
1337
  /** The type of hover event being fired. */
1242
1338
  type: 'hoverstart' | 'hoverend';
@@ -1259,7 +1355,7 @@ interface HoverProps extends HoverEvents {
1259
1355
  }
1260
1356
  interface HoverResult {
1261
1357
  /** Props to spread on the target element. */
1262
- hoverProps: React$1.HTMLAttributes<HTMLElement>;
1358
+ hoverProps: React.HTMLAttributes<HTMLElement>;
1263
1359
  isHovered: boolean;
1264
1360
  }
1265
1361
  /**
@@ -1274,6 +1370,14 @@ declare function usePlatform(): _noya_app_noya_keymap.PlatformName;
1274
1370
  */
1275
1371
  declare function usePlatformModKey(): 'ctrlKey' | 'metaKey';
1276
1372
 
1373
+ /** @default light */
1374
+ type UseThemeReturnType = "dark" | "light";
1375
+ /**
1376
+ * Hook to get the current theme of the app via the `data-theme` attribute on the body element.
1377
+ * @returns The current theme.
1378
+ */
1379
+ declare function useTheme(): UseThemeReturnType;
1380
+
1277
1381
  declare const size: {
1278
1382
  medium: string;
1279
1383
  large: string;
@@ -1287,12 +1391,7 @@ declare const mediaQuery: {
1287
1391
  xlarge: string;
1288
1392
  };
1289
1393
 
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;
1394
+ declare function cx(...args: Array<string | number | boolean | null | undefined>): string;
1296
1395
 
1297
1396
  type Optional<T> = T | false | null | undefined;
1298
1397
  type MenuConfig<T extends string> = Optional<Optional<RegularMenuItem<T>>[]>[];
@@ -1300,10 +1399,12 @@ declare function createSectionedMenu<T extends string>(...sections: MenuConfig<T
1300
1399
 
1301
1400
  declare function getGradientBackground(value: Sketch.GradientStop[], type: Sketch.GradientType, direction?: number): string;
1302
1401
 
1303
- declare function useDarkMode(elementRef: React.RefObject<HTMLElement>): {
1304
- isDark: boolean;
1305
- elementRef: React$1.RefObject<HTMLElement>;
1306
- };
1402
+ declare const colorForStringValues: Record<string, string>;
1403
+ /**
1404
+ * Create a background color and initials from a name
1405
+ * Adapted from (MIT) https://mui.com/material-ui/react-avatar/
1406
+ */
1407
+ declare function colorFromString(str: string): string;
1307
1408
 
1308
1409
  declare function sketchColorToRgba(value: Sketch.Color): RgbaColor;
1309
1410
  declare function sketchColorToRgbaString(value: Sketch.Color): string;
@@ -1328,23 +1429,23 @@ interface Props {
1328
1429
  disabled?: boolean;
1329
1430
  trigger?: "change" | "submit";
1330
1431
  }
1331
- declare const DimensionInput: (props: Props) => React__default.ReactElement | null;
1432
+ declare const DimensionInput: React__default.NamedExoticComponent<Props>;
1332
1433
 
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;
1434
+ declare const Section: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
1435
+ declare const SectionHeader: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
1335
1436
  type TitleTextStyle = "small" | "heading5" | "heading4" | "heading3";
1336
- declare const Title: (props: React__default.HTMLAttributes<HTMLDivElement> & {
1437
+ declare const Title: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & {
1337
1438
  $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;
1439
+ } & React__default.RefAttributes<HTMLDivElement>>;
1440
+ declare const Row: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
1441
+ declare const Column: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
1442
+ declare const Checkbox: React__default.ForwardRefExoticComponent<React__default.InputHTMLAttributes<HTMLInputElement> & React__default.RefAttributes<HTMLInputElement>>;
1443
+ declare const Text: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLSpanElement> & React__default.RefAttributes<HTMLSpanElement>>;
1343
1444
  declare const VerticalSeparator: () => React__default.JSX.Element;
1344
1445
  declare const HorizontalSeparator: () => React__default.JSX.Element;
1345
- declare const RowLabel: (props: React__default.LabelHTMLAttributes<HTMLLabelElement> & {
1446
+ declare const RowLabel: React__default.ForwardRefExoticComponent<React__default.LabelHTMLAttributes<HTMLLabelElement> & {
1346
1447
  $textStyle?: TitleTextStyle | "label";
1347
- } & React__default.RefAttributes<HTMLLabelElement>) => React__default.ReactElement | null;
1448
+ } & React__default.RefAttributes<HTMLLabelElement>>;
1348
1449
  interface LabeledRowProps {
1349
1450
  id?: string;
1350
1451
  children: ReactNode;
@@ -1353,7 +1454,7 @@ interface LabeledRowProps {
1353
1454
  right?: ReactNode;
1354
1455
  className?: string;
1355
1456
  }
1356
- declare const LabeledRow: (props: LabeledRowProps) => React__default.ReactElement | null;
1457
+ declare const LabeledRow: React__default.NamedExoticComponent<LabeledRowProps>;
1357
1458
 
1358
1459
  declare const InspectorPrimitives_Checkbox: typeof Checkbox;
1359
1460
  declare const InspectorPrimitives_Column: typeof Column;
@@ -1370,9 +1471,4 @@ declare namespace InspectorPrimitives {
1370
1471
  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
1472
  }
1372
1473
 
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 };
1474
+ 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 };