@noya-app/noya-designsystem 0.0.2

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 (73) hide show
  1. package/.turbo/turbo-build.log +17 -0
  2. package/CHANGELOG.md +7 -0
  3. package/README.md +1 -0
  4. package/dist/index.d.mts +1178 -0
  5. package/dist/index.d.ts +1178 -0
  6. package/dist/index.js +15651 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/index.mjs +15684 -0
  9. package/dist/index.mjs.map +1 -0
  10. package/package.json +49 -0
  11. package/src/__tests__/__snapshots__/fuzzyScorer.test.ts.snap +41 -0
  12. package/src/__tests__/fuzzyScorer.test.ts +85 -0
  13. package/src/components/ActivityIndicator.tsx +44 -0
  14. package/src/components/Avatar.tsx +64 -0
  15. package/src/components/Button.tsx +209 -0
  16. package/src/components/Chip.tsx +214 -0
  17. package/src/components/ContextMenu.tsx +224 -0
  18. package/src/components/Dialog.tsx +143 -0
  19. package/src/components/Divider.tsx +40 -0
  20. package/src/components/DropdownMenu.tsx +208 -0
  21. package/src/components/FillInputField.tsx +43 -0
  22. package/src/components/FillPreviewBackground.tsx +132 -0
  23. package/src/components/GradientPicker.tsx +88 -0
  24. package/src/components/Grid.tsx +54 -0
  25. package/src/components/GridView.tsx +468 -0
  26. package/src/components/IconButton.tsx +46 -0
  27. package/src/components/InputField.tsx +568 -0
  28. package/src/components/InputFieldWithCompletions.tsx +477 -0
  29. package/src/components/Label.tsx +62 -0
  30. package/src/components/LabeledElementView.tsx +185 -0
  31. package/src/components/ListView.tsx +950 -0
  32. package/src/components/Popover.tsx +113 -0
  33. package/src/components/Progress.tsx +57 -0
  34. package/src/components/RadioGroup.tsx +163 -0
  35. package/src/components/ScrollArea.tsx +70 -0
  36. package/src/components/Select.tsx +152 -0
  37. package/src/components/Slider.tsx +82 -0
  38. package/src/components/Sortable.tsx +296 -0
  39. package/src/components/Spacer.tsx +29 -0
  40. package/src/components/Stack.tsx +142 -0
  41. package/src/components/Switch.tsx +67 -0
  42. package/src/components/Text.tsx +164 -0
  43. package/src/components/Toast.tsx +86 -0
  44. package/src/components/Tooltip.tsx +43 -0
  45. package/src/components/TreeView.tsx +85 -0
  46. package/src/components/internal/Menu.tsx +222 -0
  47. package/src/components/internal/TextInput.tsx +296 -0
  48. package/src/components/internal/__tests__/TextInput.test.tsx +144 -0
  49. package/src/contexts/DesignSystemConfiguration.tsx +57 -0
  50. package/src/contexts/DialogContext.tsx +190 -0
  51. package/src/contexts/GlobalInputBlurContext.tsx +61 -0
  52. package/src/contexts/ImageDataContext.tsx +44 -0
  53. package/src/hooks/__tests__/mergeEventHandlers.test.ts +47 -0
  54. package/src/hooks/mergeEventHandlers.ts +55 -0
  55. package/src/hooks/useHover.ts +173 -0
  56. package/src/hooks/useObjectURL.ts +22 -0
  57. package/src/hooks/usePlatform.ts +13 -0
  58. package/src/index.tsx +77 -0
  59. package/src/mediaQuery.ts +13 -0
  60. package/src/theme/dark.ts +37 -0
  61. package/src/theme/index.ts +17 -0
  62. package/src/theme/light.ts +178 -0
  63. package/src/utils/breakpoints.ts +45 -0
  64. package/src/utils/completions.ts +21 -0
  65. package/src/utils/createSectionedMenu.ts +38 -0
  66. package/src/utils/fuzzyScorer.ts +105 -0
  67. package/src/utils/getGradientBackground.tsx +33 -0
  68. package/src/utils/handleNudge.ts +30 -0
  69. package/src/utils/mouseEvent.ts +7 -0
  70. package/src/utils/sketchColor.ts +34 -0
  71. package/src/utils/sketchPattern.ts +29 -0
  72. package/src/utils/withSeparatorElements.ts +31 -0
  73. package/tsconfig.json +3 -0
@@ -0,0 +1,1178 @@
1
+ import * as React$1 from 'react';
2
+ import React__default, { CSSProperties, ReactNode, ReactElement, ComponentProps, AriaRole, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, FocusEventHandler, InputHTMLAttributes, Ref, ReactHTML } from 'react';
3
+ import * as styled_components from 'styled-components';
4
+ import { CSSObject, CSSProperties as CSSProperties$1 } from 'styled-components';
5
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
6
+ import { Sketch } from '@noya-app/noya-file-format';
7
+ import * as csstype from 'csstype';
8
+ import { Property } from 'csstype';
9
+ import * as _noya_app_noya_keymap from '@noya-app/noya-keymap';
10
+ import { KeyModifiers, PlatformName, KeyMap } from '@noya-app/noya-keymap';
11
+ import * as Icons from '@noya-app/noya-icons';
12
+ import * as _noya_app_noya_geometry from '@noya-app/noya-geometry';
13
+ import { Size } from '@noya-app/noya-geometry';
14
+ import { IItemScore } from 'vscode-fuzzy-scorer';
15
+ import { useSortable } from '@dnd-kit/sortable';
16
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
17
+ import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
18
+ import { useGesture } from 'react-use-gesture';
19
+ import { RgbaColor } from '@noya-app/noya-colorpicker';
20
+
21
+ interface Props$g {
22
+ size?: number;
23
+ opacity?: number;
24
+ color?: string;
25
+ trackColor?: string;
26
+ }
27
+ declare const ActivityIndicator: (props: Props$g) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
28
+
29
+ declare function Avatar({ image, name, fallback, size, overflow, }: {
30
+ image?: string;
31
+ name?: string;
32
+ fallback?: string;
33
+ size?: number;
34
+ overflow?: number;
35
+ }): React__default.JSX.Element;
36
+
37
+ type ButtonVariant = 'normal' | 'primary' | 'secondary' | 'secondaryBright' | 'white' | 'thin' | 'floating' | 'none';
38
+ type ButtonSize = 'normal' | 'large';
39
+ declare const ButtonElement: styled_components.StyledComponent<"button", styled_components.DefaultTheme, {
40
+ active: boolean;
41
+ variant: ButtonVariant;
42
+ size: ButtonSize;
43
+ flex?: CSSProperties['flex'];
44
+ }, never>;
45
+ interface ButtonRootProps {
46
+ id?: string;
47
+ flex?: CSSProperties['flex'];
48
+ tabIndex?: number;
49
+ children: ReactNode;
50
+ active?: boolean;
51
+ disabled?: boolean;
52
+ variant?: ButtonVariant;
53
+ size?: ButtonSize;
54
+ tooltip?: ReactNode;
55
+ onClick?: (event: React__default.MouseEvent) => void;
56
+ onPointerDown?: (event: React__default.PointerEvent) => void;
57
+ contentStyle?: CSSProperties;
58
+ as?: React__default.ElementType;
59
+ href?: string;
60
+ target?: string;
61
+ rel?: string;
62
+ }
63
+ declare const Button: (props: ButtonRootProps & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
64
+
65
+ type ChipColorScheme = 'primary' | 'secondary' | 'error';
66
+ type ChipSize = 'small' | 'medium';
67
+ type ChipVariant = 'solid' | 'outlined' | 'ghost';
68
+ interface ChipProps {
69
+ colorScheme?: ChipColorScheme;
70
+ variant?: ChipVariant;
71
+ size?: ChipSize;
72
+ children?: React__default.ReactNode;
73
+ deletable?: boolean;
74
+ addable?: boolean;
75
+ monospace?: boolean;
76
+ onDelete?: () => void;
77
+ onAdd?: () => void;
78
+ onClick?: () => void;
79
+ onHoverDeleteChange?: (hovering: boolean) => void;
80
+ style?: React__default.CSSProperties;
81
+ tabIndex?: number;
82
+ }
83
+ declare const Chip: (props: ChipProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
84
+
85
+ declare const colors$1: {
86
+ logo: {
87
+ fill: string;
88
+ highlight: string;
89
+ };
90
+ text: string;
91
+ textMuted: string;
92
+ textSubtle: string;
93
+ textDisabled: string;
94
+ dividerSubtle: string;
95
+ divider: string;
96
+ dividerStrong: string;
97
+ primary: string;
98
+ primaryLight: string;
99
+ secondary: string;
100
+ secondaryLight: string;
101
+ secondaryBright: string;
102
+ warning: string;
103
+ neutralBackground: string;
104
+ inputBackground: string;
105
+ inputBackgroundLight: string;
106
+ codeBackground: string;
107
+ selectedBackground: string;
108
+ transparentChecker: string;
109
+ activeBackground: string;
110
+ scrollbar: string;
111
+ placeholderDots: string;
112
+ listView: {
113
+ raisedBackground: string;
114
+ editingBackground: string;
115
+ };
116
+ canvas: {
117
+ background: string;
118
+ readonly selectionStroke: string;
119
+ dragHandleStroke: string;
120
+ measurement: string;
121
+ sliceOutline: string;
122
+ grid: string;
123
+ };
124
+ sidebar: {
125
+ background: string;
126
+ };
127
+ popover: {
128
+ background: string;
129
+ divider: string;
130
+ };
131
+ slider: {
132
+ background: string;
133
+ border: string;
134
+ };
135
+ radioGroup: {
136
+ background: string;
137
+ };
138
+ icon: string;
139
+ iconSelected: string;
140
+ mask: string;
141
+ imageOverlay: string;
142
+ readonly dragOutline: string;
143
+ selection: string;
144
+ thumbnailBackground: string;
145
+ };
146
+ declare const fonts: {
147
+ normal: string;
148
+ monospace: string;
149
+ };
150
+ declare const textStyles: {
151
+ title: CSSObject;
152
+ subtitle: CSSObject;
153
+ heading1: CSSObject;
154
+ heading2: CSSObject;
155
+ heading3: CSSObject;
156
+ heading4: CSSObject;
157
+ heading5: CSSObject;
158
+ body: CSSObject;
159
+ small: CSSObject;
160
+ code: CSSObject;
161
+ label: CSSObject;
162
+ };
163
+ declare const sizes: {
164
+ sidebarWidth: number;
165
+ toolbar: {
166
+ height: number;
167
+ itemSeparator: number;
168
+ };
169
+ inspector: {
170
+ horizontalSeparator: number;
171
+ verticalSeparator: number;
172
+ };
173
+ spacing: {
174
+ nano: number;
175
+ micro: number;
176
+ small: number;
177
+ medium: number;
178
+ large: number;
179
+ xlarge: number;
180
+ xxlarge: number;
181
+ };
182
+ dialog: {
183
+ padding: number;
184
+ };
185
+ };
186
+
187
+ declare const lightTheme_fonts: typeof fonts;
188
+ declare const lightTheme_sizes: typeof sizes;
189
+ declare const lightTheme_textStyles: typeof textStyles;
190
+ declare namespace lightTheme {
191
+ export { colors$1 as colors, lightTheme_fonts as fonts, lightTheme_sizes as sizes, lightTheme_textStyles as textStyles };
192
+ }
193
+
194
+ type Theme = typeof lightTheme;
195
+ declare module 'styled-components' {
196
+ interface DefaultTheme extends Theme {
197
+ }
198
+ }
199
+ interface Colors {
200
+ }
201
+ type PickByValue<T, V> = Pick<T, {
202
+ [K in keyof T]-?: T[K] extends V ? K : never;
203
+ }[keyof T]>;
204
+ type ThemeColorName = keyof PickByValue<Theme['colors'], string>;
205
+
206
+ declare const SEPARATOR_ITEM = "separator";
207
+ type MenuItemRole = "undo" | "redo" | "cut" | "copy" | "paste" | "pasteAndMatchStyle" | "delete" | "selectAll" | "reload" | "forceReload" | "toggleDevTools" | "resetZoom" | "zoomIn" | "zoomOut" | "toggleSpellChecker" | "togglefullscreen" | "window" | "minimize" | "close" | "help" | "about" | "services" | "hide" | "hideOthers" | "unhide" | "quit" | "showSubstitutions" | "toggleSmartQuotes" | "toggleSmartDashes" | "toggleTextReplacement" | "startSpeaking" | "stopSpeaking" | "zoom" | "front" | "appMenu" | "fileMenu" | "editMenu" | "viewMenu" | "shareMenu" | "recentDocuments" | "toggleTabBar" | "selectNextTab" | "selectPreviousTab" | "mergeAllWindows" | "clearRecentDocuments" | "moveTabToNewWindow" | "windowMenu";
208
+ type RegularMenuItem<T extends string> = {
209
+ value?: T;
210
+ title: ReactNode;
211
+ shortcut?: string;
212
+ checked?: boolean;
213
+ disabled?: boolean;
214
+ icon?: ReactElement;
215
+ items?: MenuItem<T>[];
216
+ role?: MenuItemRole;
217
+ };
218
+ type MenuItem<T extends string> = typeof SEPARATOR_ITEM | RegularMenuItem<T>;
219
+ type ExtractMenuItemType<T> = T extends RegularMenuItem<infer U> ? U : never;
220
+ declare const KeyboardShortcut: (props: {
221
+ shortcut: string;
222
+ }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
223
+
224
+ interface MenuItemProps<T extends string> {
225
+ value?: T;
226
+ children: ReactNode;
227
+ onSelect: (value: T) => void;
228
+ checked: boolean;
229
+ disabled: boolean;
230
+ indented: boolean;
231
+ shortcut?: string;
232
+ icon?: ReactElement;
233
+ items?: MenuItem<T>[];
234
+ }
235
+ interface MenuProps<T extends string> {
236
+ children: ReactNode;
237
+ items: MenuItem<T>[];
238
+ onSelect: (value: T) => void;
239
+ isNested?: boolean;
240
+ shouldBindKeyboardShortcuts?: boolean;
241
+ onOpenChange?: (open: boolean) => void;
242
+ }
243
+ declare const ContextMenu: <T extends string>(props: MenuProps<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
244
+
245
+ declare const StyledContent: styled_components.StyledComponent<React__default.ForwardRefExoticComponent<DialogPrimitive.DialogContentProps & React__default.RefAttributes<HTMLDivElement>>, styled_components.DefaultTheme, {}, never>;
246
+ declare const CloseButtonContainer: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
247
+ interface IDialog {
248
+ containsElement: (element: HTMLElement) => boolean;
249
+ }
250
+ interface Props$f {
251
+ title?: ReactNode;
252
+ description?: ReactNode;
253
+ children?: ReactNode;
254
+ style?: ComponentProps<typeof StyledContent>['style'];
255
+ open: ComponentProps<typeof DialogPrimitive.Root>['open'];
256
+ onOpenChange?: ComponentProps<typeof DialogPrimitive.Root>['onOpenChange'];
257
+ onOpenAutoFocus?: ComponentProps<typeof DialogPrimitive.Content>['onOpenAutoFocus'];
258
+ closeOnInteractOutside?: boolean;
259
+ }
260
+ declare const Dialog: (props: Props$f & React__default.RefAttributes<IDialog>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
261
+
262
+ type DividerVariant = 'normal' | 'strong' | 'subtle';
263
+ interface DividerProps {
264
+ variant?: DividerVariant;
265
+ overflow?: number;
266
+ }
267
+ declare const Divider: (props: DividerProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
268
+ declare const DividerVertical: (props: DividerProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
269
+
270
+ declare const DropdownMenu: <T extends string>(props: MenuProps<T> & {
271
+ open?: boolean | undefined;
272
+ onCloseAutoFocus?: ((event: React__default.SyntheticEvent<unknown, Event>) => void) | undefined;
273
+ } & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
274
+
275
+ declare const SUPPORTED_IMAGE_UPLOAD_TYPES: ("image/png" | "image/jpeg" | "image/webp" | "application/pdf" | "image/svg+xml")[];
276
+ declare const SUPPORTED_CANVAS_UPLOAD_TYPES: ("" | "image/png" | "image/jpeg" | "image/webp" | "application/pdf" | "image/svg+xml")[];
277
+ type SupportedImageUploadType = (typeof SUPPORTED_IMAGE_UPLOAD_TYPES)[number];
278
+ type SupportedCanvasUploadType = (typeof SUPPORTED_CANVAS_UPLOAD_TYPES)[number];
279
+ type SketchPattern = {
280
+ _class: 'pattern';
281
+ image?: Sketch.FileRef | Sketch.DataRef;
282
+ patternFillType: Sketch.PatternFillType;
283
+ patternTileScale: number;
284
+ };
285
+
286
+ interface Props$e {
287
+ id?: string;
288
+ value?: Sketch.Color | Sketch.Gradient | SketchPattern;
289
+ flex?: CSSProperties['flex'];
290
+ }
291
+ declare const FillInputField: (props: Props$e & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
292
+
293
+ declare const PatternPreviewBackground: (props: {
294
+ fillType: Sketch.PatternFillType;
295
+ tileScale: number;
296
+ imageRef: string;
297
+ }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
298
+ interface Props$d {
299
+ value?: Sketch.Color | Sketch.Gradient | SketchPattern;
300
+ }
301
+ declare const FillPreviewBackground: (props: Props$d) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
302
+
303
+ interface Props$c {
304
+ value: Sketch.GradientStop[];
305
+ selectedStop: number;
306
+ onChangeColor: (color: Sketch.Color) => void;
307
+ onChangePosition: (position: number) => void;
308
+ onAdd: (color: Sketch.Color, position: number) => void;
309
+ onDelete: () => void;
310
+ onSelectStop: (index: number) => void;
311
+ }
312
+ declare const GradientPicker: (props: Props$c) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
313
+
314
+ type GridProps = {
315
+ columns?: string;
316
+ rows?: string;
317
+ alignItems?: 'start' | 'center' | 'end';
318
+ justifyItems?: 'start' | 'center' | 'end';
319
+ placeItems?: 'start' | 'center' | 'end';
320
+ width?: number | string;
321
+ minWidth?: number | string;
322
+ maxWidth?: number | string;
323
+ height?: number | string;
324
+ minHeight?: number | string;
325
+ maxHeight?: number | string;
326
+ padding?: number | string;
327
+ paddingX?: number | string;
328
+ paddingXStart?: number | string;
329
+ paddingXEnd?: number | string;
330
+ paddingY?: number | string;
331
+ paddingYStart?: number | string;
332
+ paddingYEnd?: number | string;
333
+ gap?: number | string;
334
+ gapX?: number | string;
335
+ gapY?: number | string;
336
+ background?: keyof Colors;
337
+ };
338
+
339
+ type GridViewSize = 'xxs' | 'xs' | 'small' | 'large';
340
+ interface ItemProps$2<MenuItemType extends string = string> {
341
+ id: string;
342
+ title?: ReactNode;
343
+ subtitle?: ReactNode;
344
+ loading?: boolean;
345
+ selected?: boolean;
346
+ onClick?: (event: React__default.MouseEvent) => void;
347
+ onPress?: (options: KeyModifiers) => void;
348
+ onDoubleClick?: () => void;
349
+ onHoverChange?: (isHovering: boolean) => void;
350
+ children?: ReactNode;
351
+ menuItems?: MenuItem<MenuItemType>[];
352
+ onSelectMenuItem?: (value: MenuItemType) => void;
353
+ onContextMenu?: () => void;
354
+ }
355
+ type GridViewContextValue = {
356
+ size: GridViewSize;
357
+ textPosition: 'overlay' | 'below' | 'toolip';
358
+ bordered: boolean;
359
+ disabled: boolean;
360
+ };
361
+ interface GridViewRootProps extends Partial<GridViewContextValue> {
362
+ children: ReactNode;
363
+ onClick?: () => void;
364
+ scrollable?: boolean;
365
+ }
366
+ declare namespace GridView {
367
+ const Root: (props: GridViewRootProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
368
+ const Item: <MenuItemType extends string>(props: ItemProps$2<MenuItemType> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
369
+ const Section: (props: {
370
+ children?: React__default.ReactNode;
371
+ padding?: csstype.Property.Padding<string | number> | undefined;
372
+ }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
373
+ const SectionHeader: (props: {
374
+ title: string;
375
+ }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
376
+ }
377
+
378
+ declare const IconButton: (props: Omit<ButtonRootProps, "children" | "size" | "flex" | "variant"> & {
379
+ iconName: keyof typeof Icons;
380
+ selected?: boolean | undefined;
381
+ color?: string | undefined;
382
+ size?: number | undefined;
383
+ } & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
384
+
385
+ type Props$b = {
386
+ id?: string;
387
+ style?: any;
388
+ className?: string;
389
+ type?: "text" | "search";
390
+ disabled?: boolean;
391
+ value: string;
392
+ placeholder?: string;
393
+ role?: AriaRole;
394
+ name?: HTMLInputElement["name"];
395
+ onKeyDown?: KeyboardEventHandler;
396
+ onClick?: MouseEventHandler;
397
+ onDoubleClick?: MouseEventHandler;
398
+ onPointerDown?: PointerEventHandler;
399
+ onFocusCapture?: FocusEventHandler;
400
+ onFocusChange?: (isFocused: boolean) => void;
401
+ onBlur?: FocusEventHandler;
402
+ } & Pick<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "autoCapitalize" | "autoCorrect" | "spellCheck" | "autoFocus">;
403
+ type ReadOnlyProps = Props$b & {
404
+ readOnly: true;
405
+ };
406
+ type ControlledProps = Props$b & {
407
+ onChange: (value: string) => void;
408
+ };
409
+ type SubmittableProps = Props$b & {
410
+ onSubmit: (value: string) => void;
411
+ allowSubmittingWithSameValue?: boolean;
412
+ submitAutomaticallyAfterDelay?: number;
413
+ };
414
+ type TextInputProps = ReadOnlyProps | ControlledProps | SubmittableProps;
415
+
416
+ type LabelPosition = 'start' | 'end';
417
+ type InputFieldSize = 'small' | 'medium' | 'large';
418
+ interface InputFieldLabelProps {
419
+ children?: ReactNode;
420
+ pointerEvents?: Property.PointerEvents;
421
+ }
422
+ interface InputFieldDropdownProps<T extends string> {
423
+ id?: string;
424
+ items: MenuItem<T>[];
425
+ onSelect: (value: T) => void;
426
+ children?: ReactNode;
427
+ }
428
+ type InputFieldVariant = 'normal' | 'bare';
429
+ declare const InputElement: styled_components.StyledComponent<(props: TextInputProps & React__default.RefAttributes<HTMLInputElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null, styled_components.DefaultTheme, {
430
+ labelPosition: LabelPosition;
431
+ labelSize: number;
432
+ hasLabel: boolean;
433
+ hasDropdown: boolean;
434
+ textAlign?: Property.TextAlign | undefined;
435
+ disabled?: boolean | undefined;
436
+ variant?: InputFieldVariant | undefined;
437
+ readOnly?: boolean | undefined;
438
+ size: InputFieldSize;
439
+ }, never>;
440
+ type InputFieldNumberInputProps = Omit<TextInputProps, 'value' | 'onChange' | 'onKeyDown' | 'onSubmit'> & {
441
+ value: number | undefined;
442
+ onNudge?: (value: number) => void;
443
+ variant?: 'bare';
444
+ } & ({
445
+ onChange: (value: number) => void;
446
+ } | {
447
+ onSubmit: (value: number) => void;
448
+ });
449
+ interface InputFieldRootProps {
450
+ id?: string;
451
+ flex?: string;
452
+ children?: ReactNode;
453
+ width?: number;
454
+ labelPosition?: LabelPosition;
455
+ labelSize?: number;
456
+ hasDropdown?: boolean;
457
+ size?: InputFieldSize;
458
+ renderPopoverContent?: (options: {
459
+ width: number;
460
+ }) => ReactNode;
461
+ onFocusChange?: (isFocused: boolean) => void;
462
+ }
463
+ declare namespace InputField {
464
+ const Root: (props: InputFieldRootProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
465
+ const Input: (props: (TextInputProps & {
466
+ textAlign?: Property.TextAlign | undefined;
467
+ variant?: "bare" | undefined;
468
+ }) & React__default.RefAttributes<HTMLInputElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
469
+ const NumberInput: (props: InputFieldNumberInputProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
470
+ const DropdownMenu: <T extends string>(props: InputFieldDropdownProps<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
471
+ const Button: (props: {
472
+ children?: React__default.ReactNode;
473
+ onClick?: (() => void) | undefined;
474
+ }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
475
+ const Label: (props: InputFieldLabelProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
476
+ }
477
+
478
+ declare function fuzzyScore({ item, query }: {
479
+ item: string;
480
+ query: string;
481
+ }): IItemScore;
482
+ type IScoredItem = IItemScore & {
483
+ index: number;
484
+ };
485
+ declare function fuzzyFilter({ items, query, scoreThreshold, }: {
486
+ items: string[];
487
+ query: string;
488
+ scoreThreshold?: number;
489
+ }): IScoredItem[];
490
+ type IToken = {
491
+ type: 'text';
492
+ text: string;
493
+ } | {
494
+ type: 'match';
495
+ text: string;
496
+ };
497
+ type MatchRange = {
498
+ start: number;
499
+ end: number;
500
+ };
501
+ declare function fuzzyTokenize({ item, itemScore, }: {
502
+ item: string;
503
+ itemScore: IItemScore;
504
+ }): IToken[];
505
+
506
+ type CompletionItem = {
507
+ type?: undefined;
508
+ id: string;
509
+ name: string;
510
+ icon?: ReactNode;
511
+ alwaysInclude?: boolean;
512
+ };
513
+ type CompletionSectionHeader = {
514
+ type: 'sectionHeader';
515
+ id: string;
516
+ name: string;
517
+ maxVisibleItems?: number;
518
+ };
519
+ type CompletionListItem = (CompletionItem & IScoredItem) | CompletionSectionHeader;
520
+
521
+ type RelativeDropPosition = 'above' | 'below' | 'inside';
522
+ type DropValidator = (sourceIndex: number, destinationIndex: number, position: RelativeDropPosition) => boolean;
523
+ declare const normalizeListIndex: (index: number, position: 'above' | 'below') => number;
524
+ type UseSortableReturnType = ReturnType<typeof useSortable>;
525
+ interface ItemProps$1<T> {
526
+ id: string;
527
+ disabled?: boolean;
528
+ children: (props: {
529
+ ref: Ref<T>;
530
+ relativeDropPosition?: RelativeDropPosition;
531
+ [key: string]: any;
532
+ } & UseSortableReturnType['attributes']) => JSX.Element;
533
+ }
534
+ interface RootProps {
535
+ keys: string[];
536
+ children: ReactNode;
537
+ renderOverlay?: (index: number) => ReactNode;
538
+ onMoveItem?: (sourceIndex: number, destinationIndex: number, position: RelativeDropPosition) => void;
539
+ acceptsDrop?: DropValidator;
540
+ }
541
+ declare namespace Sortable {
542
+ const Item: <T extends HTMLElement>(props: ItemProps$1<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
543
+ const Root: (props: RootProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
544
+ }
545
+
546
+ type ListRowMarginType = "none" | "top" | "bottom" | "vertical";
547
+ type ListRowPosition = "only" | "first" | "middle" | "last";
548
+ type ListColorScheme = "primary" | "secondary";
549
+ type PressEventName = "onClick" | "onPointerDown";
550
+ type ListRowContextValue = {
551
+ marginType: ListRowMarginType;
552
+ selectedPosition: ListRowPosition;
553
+ sortable: boolean;
554
+ expandable: boolean;
555
+ divider: boolean;
556
+ gap: number;
557
+ variant: ListViewVariant;
558
+ sectionHeaderVariant: ListViewSectionHeaderVariant;
559
+ indentation: number;
560
+ pressEventName: PressEventName;
561
+ isSectionHeader: boolean;
562
+ colorScheme: ListColorScheme;
563
+ };
564
+ interface EditableRowProps {
565
+ value: string;
566
+ onSubmitEditing: (value: string) => void;
567
+ autoFocus: boolean;
568
+ placeholder?: string;
569
+ }
570
+ interface ListViewClickInfo {
571
+ shiftKey: boolean;
572
+ altKey: boolean;
573
+ metaKey: boolean;
574
+ ctrlKey: boolean;
575
+ }
576
+ interface ListViewRowProps<MenuItemType extends string = string> {
577
+ id?: string;
578
+ tabIndex?: number;
579
+ selected?: boolean;
580
+ depth?: number;
581
+ disabled?: boolean;
582
+ draggable?: boolean;
583
+ hovered?: boolean;
584
+ sortable?: boolean;
585
+ gap?: number;
586
+ backgroundColor?: CSSProperties["backgroundColor"];
587
+ onPress?: (info: ListViewClickInfo) => void;
588
+ onDoubleClick?: () => void;
589
+ onHoverChange?: (isHovering: boolean) => void;
590
+ children?: ReactNode;
591
+ isSectionHeader?: boolean;
592
+ menuItems?: MenuItem<MenuItemType>[];
593
+ onSelectMenuItem?: (value: MenuItemType) => void;
594
+ onContextMenu?: () => void;
595
+ onMenuOpenChange?: (isOpen: boolean) => void;
596
+ onKeyDown?: (event: React__default.KeyboardEvent) => void;
597
+ }
598
+ interface IVirtualizedList {
599
+ scrollToIndex(index: number): void;
600
+ }
601
+ type ListViewItemInfo = {
602
+ isDragging: boolean;
603
+ };
604
+ type ChildrenProps$1 = {
605
+ children: ReactNode;
606
+ };
607
+ type RenderProps<T> = {
608
+ data: T[];
609
+ renderItem: (item: T, index: number, info: ListViewItemInfo) => ReactNode;
610
+ keyExtractor: (item: T, index: number) => string;
611
+ /**
612
+ * Each item must have an `id` in order to be sortable
613
+ */
614
+ sortable?: boolean;
615
+ virtualized?: Size;
616
+ };
617
+ type ListViewVariant = "normal" | "padded" | "bare";
618
+ type ListViewSectionHeaderVariant = "normal" | "label";
619
+ type ListViewRootProps = {
620
+ onPress?: () => void;
621
+ scrollable?: boolean;
622
+ expandable?: boolean;
623
+ onMoveItem?: (sourceIndex: number, destinationIndex: number, position: RelativeDropPosition) => void;
624
+ indentation?: number;
625
+ acceptsDrop?: DropValidator;
626
+ pressEventName?: PressEventName;
627
+ variant?: ListViewVariant;
628
+ sectionHeaderVariant?: ListViewSectionHeaderVariant;
629
+ divider?: boolean;
630
+ gap?: number;
631
+ colorScheme?: ListColorScheme;
632
+ };
633
+ declare namespace ListView {
634
+ const RowTitle: React__default.MemoExoticComponent<styled_components.StyledComponent<"span", styled_components.DefaultTheme, {}, never>>;
635
+ const EditableRowTitle: (props: EditableRowProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
636
+ const Row: <MenuItemType extends string>(props: ListViewRowProps<MenuItemType> & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
637
+ const Root: <T = any>(props: ((ChildrenProps$1 | RenderProps<T>) & ListViewRootProps) & React__default.RefAttributes<IVirtualizedList>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
638
+ const RowContext: React__default.Context<ListRowContextValue>;
639
+ type ClickInfo = ListViewClickInfo;
640
+ type ItemInfo = ListViewItemInfo;
641
+ type RowProps<MenuItemType extends string = string> = ListViewRowProps<MenuItemType>;
642
+ type VirtualizedList = IVirtualizedList;
643
+ const DragIndicator: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {
644
+ relativeDropPosition: RelativeDropPosition;
645
+ gap: number;
646
+ offsetLeft: number;
647
+ colorScheme: ListColorScheme;
648
+ }, never>;
649
+ const rowHeight = 31;
650
+ const sectionHeaderLabelHeight = 27;
651
+ const calculateHeight: (items: number, headerCount: number, headerVariant: ListViewSectionHeaderVariant) => number;
652
+ const normalizeIndex: (index: number, position: "above" | "below") => number;
653
+ }
654
+
655
+ declare const CompletionToken: styled_components.StyledComponent<"span", styled_components.DefaultTheme, {
656
+ type: IToken["type"];
657
+ }, never>;
658
+ interface CompletionMenuProps {
659
+ items: CompletionListItem[];
660
+ selectedIndex: number;
661
+ onSelectItem: (item: CompletionListItem) => void;
662
+ onHoverIndex: (index: number) => void;
663
+ listSize: Size;
664
+ }
665
+ declare const CompletionMenu: (props: CompletionMenuProps & React__default.RefAttributes<IVirtualizedList>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
666
+ interface Props$a {
667
+ loading?: boolean;
668
+ initialValue?: string;
669
+ placeholder?: string;
670
+ items: (CompletionItem | CompletionSectionHeader)[];
671
+ onChange?: (value: string) => void;
672
+ onHoverItem?: (item: CompletionItem | undefined) => void;
673
+ onSelectItem?: (item: CompletionItem) => void;
674
+ onFocus?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
675
+ onBlur?: (didSubmit: boolean, value: string) => void;
676
+ onDeleteWhenEmpty?: () => void;
677
+ size?: InputFieldSize;
678
+ style?: React__default.CSSProperties;
679
+ children?: React__default.ReactNode;
680
+ hideChildrenWhenFocused?: boolean;
681
+ hideMenuWhenEmptyValue?: boolean;
682
+ }
683
+ declare const InputFieldWithCompletions: (props: Props$a & React__default.RefAttributes<HTMLInputElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
684
+
685
+ interface LabelRootProps {
686
+ label: ReactNode;
687
+ children: ReactNode;
688
+ }
689
+ declare namespace Label {
690
+ const Label: React__default.MemoExoticComponent<styled_components.StyledComponent<"label", styled_components.DefaultTheme, {
691
+ selected?: boolean | undefined;
692
+ }, never>>;
693
+ const Root: (props: LabelRootProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
694
+ }
695
+
696
+ interface ContainerProps {
697
+ children: ReactNode;
698
+ renderLabel: (provided: {
699
+ id: string;
700
+ index: number;
701
+ }) => ReactNode;
702
+ }
703
+ declare const LabeledElementView: (props: ContainerProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
704
+
705
+ type PopoverVariant = 'normal' | 'large';
706
+ interface Props$9 extends Pick<ComponentProps<typeof PopoverPrimitive['Content']>, 'onOpenAutoFocus' | 'onCloseAutoFocus' | 'onPointerDownOutside' | 'onInteractOutside' | 'onFocusOutside' | 'side'> {
707
+ children: React__default.ReactNode;
708
+ trigger: React__default.ReactNode;
709
+ variant?: PopoverVariant;
710
+ closable?: boolean;
711
+ open?: boolean;
712
+ onOpenChange?: (open: boolean) => void;
713
+ sideOffset?: number;
714
+ onClickClose?: () => void;
715
+ showArrow?: boolean;
716
+ }
717
+ declare function Popover({ children, trigger, variant, closable, open, side, sideOffset, showArrow, onOpenChange, onOpenAutoFocus, onCloseAutoFocus, onPointerDownOutside, onInteractOutside, onFocusOutside, onClickClose, }: Props$9): React__default.JSX.Element;
718
+
719
+ type ProgressVariant = 'normal' | 'warning' | 'primary' | 'secondary';
720
+ declare function Progress({ value, width, height, flex, variant, }: {
721
+ value: number;
722
+ height?: CSSProperties['height'];
723
+ width?: CSSProperties['width'];
724
+ flex?: CSSProperties['flex'];
725
+ variant?: ProgressVariant;
726
+ }): React__default.JSX.Element;
727
+
728
+ type RadioGroupColorScheme = 'primary' | 'secondary';
729
+ declare const StyledRoot: styled_components.StyledComponent<React__default.ForwardRefExoticComponent<(ToggleGroupPrimitive.ToggleGroupSingleProps | ToggleGroupPrimitive.ToggleGroupMultipleProps) & React__default.RefAttributes<HTMLDivElement>>, styled_components.DefaultTheme, {
730
+ colorScheme?: RadioGroupColorScheme | undefined;
731
+ }, never>;
732
+ interface ItemProps {
733
+ value: string;
734
+ tooltip?: ReactNode;
735
+ children: ReactNode;
736
+ disabled?: boolean;
737
+ }
738
+ interface Props$8 {
739
+ id?: string;
740
+ value?: string;
741
+ onValueChange?: ComponentProps<typeof StyledRoot>['onValueChange'];
742
+ colorScheme?: RadioGroupColorScheme;
743
+ allowEmpty?: boolean;
744
+ children: ReactNode;
745
+ }
746
+ declare namespace RadioGroup {
747
+ const Root: (props: Props$8) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
748
+ const Item: (props: ItemProps & React__default.RefAttributes<HTMLButtonElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
749
+ }
750
+
751
+ interface Props$7 {
752
+ children?: ReactNode | ((scrollElementRef: HTMLDivElement) => ReactNode);
753
+ }
754
+ declare const ScrollArea: (props: Props$7) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
755
+
756
+ interface SelectOptionProps<T extends string> {
757
+ value: T;
758
+ title?: string;
759
+ onSelect?: () => void;
760
+ }
761
+ declare const SelectOption: <T extends string>(props: SelectOptionProps<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
762
+ type ChildrenProps<T> = {
763
+ children: ReactNode;
764
+ } | {
765
+ options: T[];
766
+ getTitle?: (option: T, index: number) => string;
767
+ onChange: (value: T) => void;
768
+ };
769
+ type Props$6<T extends string> = ChildrenProps<T> & {
770
+ id: string;
771
+ flex?: CSSProperties["flex"];
772
+ value: T;
773
+ };
774
+ declare const Select: <T extends string>(props: Props$6<T>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
775
+
776
+ interface Props$5 {
777
+ id?: string;
778
+ value: number;
779
+ onValueChange: (value: number) => void;
780
+ min: number;
781
+ max: number;
782
+ }
783
+ declare const Slider: ({ id, value, onValueChange, min, max, }: Props$5) => React__default.JSX.Element;
784
+
785
+ interface Props$4 {
786
+ size?: number | string;
787
+ inline?: boolean;
788
+ }
789
+ declare namespace Spacer {
790
+ const Vertical: styled_components.StyledComponent<"span", styled_components.DefaultTheme, Props$4, never>;
791
+ const Horizontal: styled_components.StyledComponent<"span", styled_components.DefaultTheme, Props$4, never>;
792
+ }
793
+
794
+ type BreakpointKey = number | string;
795
+ type Breakpoint<T extends object> = [BreakpointKey, T];
796
+ type BreakpointCollection<T extends object> = Breakpoint<T>[] | Record<BreakpointKey, T>;
797
+
798
+ declare function withSeparatorElements(elements: ReactNode, separator: ReactNode | (() => ReactNode)): (string | number | React$1.ReactElement<any, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | React$1.ReactPortal)[];
799
+
800
+ interface StyleProps$1 {
801
+ display?: 'flex' | 'inline-flex' | 'none' | 'block';
802
+ visibility?: CSSProperties['visibility'];
803
+ position?: CSSProperties['position'];
804
+ zIndex?: CSSProperties['zIndex'];
805
+ gap?: CSSProperties['gap'];
806
+ inset?: CSSProperties['inset'];
807
+ top?: CSSProperties['top'];
808
+ right?: CSSProperties['right'];
809
+ bottom?: CSSProperties['bottom'];
810
+ left?: CSSProperties['left'];
811
+ flexDirection?: CSSProperties['flexDirection'];
812
+ justifyContent?: CSSProperties['justifyContent'];
813
+ alignItems?: CSSProperties['alignItems'];
814
+ alignSelf?: CSSProperties['alignSelf'];
815
+ flex?: CSSProperties['flex'];
816
+ flexWrap?: CSSProperties['flexWrap'];
817
+ height?: CSSProperties['height'];
818
+ minHeight?: CSSProperties['minHeight'];
819
+ maxHeight?: CSSProperties['maxHeight'];
820
+ width?: CSSProperties['width'];
821
+ minWidth?: CSSProperties['minWidth'];
822
+ maxWidth?: CSSProperties['maxWidth'];
823
+ aspectRatio?: CSSProperties['aspectRatio'];
824
+ padding?: CSSProperties['padding'];
825
+ paddingVertical?: string | number;
826
+ paddingHorizontal?: string | number;
827
+ margin?: CSSProperties['margin'];
828
+ background?: CSSProperties['background'];
829
+ backgroundSize?: CSSProperties['backgroundSize'];
830
+ backgroundPosition?: CSSProperties['backgroundPosition'];
831
+ borderRadius?: CSSProperties['borderRadius'];
832
+ overflowX?: CSSProperties['overflowX'];
833
+ overflowY?: CSSProperties['overflowY'];
834
+ overflow?: CSSProperties['overflow'];
835
+ textOverflow?: CSSProperties['textOverflow'];
836
+ boxShadow?: CSSProperties['boxShadow'];
837
+ outline?: CSSProperties['outline'];
838
+ border?: CSSProperties['border'];
839
+ borderTop?: CSSProperties['borderTop'];
840
+ borderRight?: CSSProperties['borderRight'];
841
+ borderBottom?: CSSProperties['borderBottom'];
842
+ borderLeft?: CSSProperties['borderLeft'];
843
+ cursor?: CSSProperties['cursor'];
844
+ userSelect?: CSSProperties['userSelect'];
845
+ transition?: CSSProperties['transition'];
846
+ opacity?: CSSProperties['opacity'];
847
+ filter?: CSSProperties['filter'];
848
+ color?: CSSProperties['color'];
849
+ order?: CSSProperties['order'];
850
+ pointerEvents?: CSSProperties['pointerEvents'];
851
+ lineHeight?: CSSProperties['lineHeight'];
852
+ }
853
+ type StackBreakpointList = BreakpointCollection<StyleProps$1>;
854
+ interface Props$3 extends StyleProps$1 {
855
+ id?: string;
856
+ as?: keyof ReactHTML;
857
+ className?: string;
858
+ children?: ReactNode;
859
+ separator?: Parameters<typeof withSeparatorElements>[1];
860
+ breakpoints?: StackBreakpointList | null | false;
861
+ href?: string;
862
+ tabIndex?: number;
863
+ }
864
+ type StackProps = Omit<Props$3, 'flexDirection'>;
865
+ declare const Stack: {
866
+ V: (props: StackProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
867
+ H: (props: StackProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
868
+ };
869
+
870
+ type SwitchVariant = 'normal' | 'primary' | 'secondary';
871
+ interface Props$2 {
872
+ value: boolean;
873
+ onChange: (value: boolean) => void;
874
+ variant?: SwitchVariant;
875
+ }
876
+ declare const Switch: ({ value, onChange, variant, }: Props$2) => React__default.JSX.Element;
877
+
878
+ type StyleProps = {
879
+ flex?: CSSProperties$1['flex'];
880
+ padding?: CSSProperties$1['padding'];
881
+ background?: CSSProperties$1['background'];
882
+ borderRadius?: CSSProperties$1['borderRadius'];
883
+ textAlign?: CSSProperties$1['textAlign'];
884
+ fontWeight?: CSSProperties$1['fontWeight'];
885
+ fontStyle?: CSSProperties$1['fontStyle'];
886
+ fontSize?: CSSProperties$1['fontSize'];
887
+ lineHeight?: CSSProperties$1['lineHeight'];
888
+ fontFamily?: CSSProperties$1['fontFamily'];
889
+ wordBreak?: CSSProperties$1['wordBreak'];
890
+ whiteSpace?: CSSProperties$1['whiteSpace'];
891
+ height?: CSSProperties$1['height'];
892
+ width?: CSSProperties$1['width'];
893
+ opacity?: CSSProperties$1['opacity'];
894
+ position?: CSSProperties$1['position'];
895
+ overflow?: CSSProperties$1['overflow'];
896
+ textOverflow?: CSSProperties$1['textOverflow'];
897
+ textDecoration?: CSSProperties$1['textDecoration'];
898
+ display?: CSSProperties$1['display'];
899
+ top?: CSSProperties$1['top'];
900
+ right?: CSSProperties$1['right'];
901
+ bottom?: CSSProperties$1['bottom'];
902
+ left?: CSSProperties$1['left'];
903
+ userSelect?: CSSProperties$1['userSelect'];
904
+ };
905
+ type TextBreakpointList = BreakpointCollection<StyleProps>;
906
+ interface Props$1 extends StyleProps {
907
+ as?: keyof ReactHTML;
908
+ href?: string;
909
+ className?: string;
910
+ variant: keyof Theme['textStyles'];
911
+ breakpoints?: BreakpointCollection<StyleProps> | null | false;
912
+ color?: ThemeColorName;
913
+ children: ReactNode;
914
+ onClick?: () => void;
915
+ }
916
+ declare const Text: (props: Props$1 & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
917
+ type PresetProps = Omit<Props$1, 'variant'>;
918
+ declare const Heading1: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
919
+ declare const Heading2: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
920
+ declare const Heading3: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
921
+ declare const Heading4: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
922
+ declare const Heading5: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
923
+ declare const Body: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
924
+ declare const Small: (props: PresetProps & React__default.RefAttributes<HTMLElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
925
+ declare const Italic: ({ children }: {
926
+ children: ReactNode;
927
+ }) => React__default.JSX.Element;
928
+
929
+ declare const Toast: ({ title, content, children, ...props }: {
930
+ title?: string | undefined;
931
+ content: ReactNode;
932
+ children?: React__default.ReactNode;
933
+ }) => React__default.JSX.Element;
934
+ declare const ToastProvider: ({ children }: {
935
+ children: React__default.ReactNode;
936
+ }) => React__default.JSX.Element;
937
+
938
+ interface Props {
939
+ children: ReactNode;
940
+ content: ReactNode;
941
+ }
942
+ declare const Tooltip: (props: Props) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
943
+
944
+ type TreeRowBaseProps = {
945
+ icon?: ReactNode;
946
+ expanded?: boolean;
947
+ onClickChevron?: ({ altKey }: {
948
+ altKey: boolean;
949
+ }) => void;
950
+ };
951
+ type TreeViewRowProps<MenuItemType extends string> = ListView.RowProps<MenuItemType> & TreeRowBaseProps;
952
+ declare namespace TreeView {
953
+ const Root: <T = any>(props: (({
954
+ children: React__default.ReactNode;
955
+ } | {
956
+ data: T[];
957
+ renderItem: (item: T, index: number, info: {
958
+ isDragging: boolean;
959
+ }) => React__default.ReactNode;
960
+ keyExtractor: (item: T, index: number) => string;
961
+ sortable?: boolean | undefined;
962
+ virtualized?: _noya_app_noya_geometry.Size | undefined;
963
+ }) & {
964
+ onPress?: (() => void) | undefined;
965
+ scrollable?: boolean | undefined;
966
+ expandable?: boolean | undefined;
967
+ onMoveItem?: ((sourceIndex: number, destinationIndex: number, position: RelativeDropPosition) => void) | undefined;
968
+ indentation?: number | undefined;
969
+ acceptsDrop?: DropValidator | undefined;
970
+ pressEventName?: ("onClick" | "onPointerDown") | undefined;
971
+ variant?: ("normal" | "bare" | "padded") | undefined;
972
+ sectionHeaderVariant?: ("label" | "normal") | undefined;
973
+ divider?: boolean | undefined;
974
+ gap?: number | undefined;
975
+ colorScheme?: ("primary" | "secondary") | undefined;
976
+ }) & React__default.RefAttributes<IVirtualizedList>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
977
+ const RowTitle: React__default.MemoExoticComponent<styled_components.StyledComponent<"span", styled_components.DefaultTheme, {}, never>>;
978
+ const EditableRowTitle: (props: EditableRowProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
979
+ const Row: <MenuItemType extends string>(props: ListView.RowProps<MenuItemType> & TreeRowBaseProps & React__default.RefAttributes<HTMLLIElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
980
+ type ClickInfo = ListView.ClickInfo;
981
+ type RowProps<MenuItemType extends string> = TreeViewRowProps<MenuItemType>;
982
+ }
983
+
984
+ type DesignSystemConfigurationContextValue = {
985
+ platform: PlatformName;
986
+ };
987
+ declare const DesignSystemConfigurationProvider: (props: {
988
+ children: ReactNode;
989
+ theme: Theme;
990
+ } & DesignSystemConfigurationContextValue) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
991
+ declare function useDesignSystemConfiguration(): DesignSystemConfigurationContextValue;
992
+ declare function useDesignSystemTheme(): styled_components.DefaultTheme;
993
+
994
+ declare const Row: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
995
+ type DialogContextValue = {
996
+ openInputDialog(title: string, inputValue?: string): Promise<string | undefined>;
997
+ containsElement(element: HTMLElement): boolean;
998
+ };
999
+ declare const DialogProvider: ({ children, }: {
1000
+ children: ReactNode;
1001
+ }) => React__default.JSX.Element;
1002
+ declare function useOpenInputDialog(): (title: string, inputValue?: string | undefined) => Promise<string | undefined>;
1003
+ declare function useDialogContainsElement(): (element: HTMLElement) => boolean;
1004
+
1005
+ type GlobalInputBlurContextValue = {
1006
+ addListener: (f: () => void) => void;
1007
+ removeListener: (f: () => void) => void;
1008
+ trigger: () => void;
1009
+ };
1010
+ declare const GlobalInputBlurProvider: React$1.Provider<GlobalInputBlurContextValue>;
1011
+ /**
1012
+ * Some components store their editable state internally.
1013
+ * We trigger this event before selection changes so that they can commit their
1014
+ * edits before they unmount. This is more manual but simpler than doing so during
1015
+ * the unmount phase (e.g. the return function of `useEffect`), since handlers are
1016
+ * guaranteed to be called with the current data.
1017
+ */
1018
+ declare const useGlobalInputBlur: () => GlobalInputBlurContextValue;
1019
+ declare function useGlobalInputBlurListener(f: () => void): void;
1020
+ declare function useGlobalInputBlurTrigger(): () => void;
1021
+
1022
+ type Optional<T> = T | false | null | undefined;
1023
+ type MenuConfig<T extends string> = Optional<Optional<RegularMenuItem<T>>[]>[];
1024
+ declare function createSectionedMenu<T extends string>(...sections: MenuConfig<T>): MenuItem<T>[];
1025
+
1026
+ type ReactDOMEventHandlers = ReturnType<ReturnType<typeof useGesture>> & {
1027
+ onKeyDown?: (e: React.KeyboardEvent) => void;
1028
+ onKeyDownCapture?: (e: React.KeyboardEvent) => void;
1029
+ onKeyUp?: (e: React.KeyboardEvent) => void;
1030
+ onKeyUpCapture?: (e: React.KeyboardEvent) => void;
1031
+ onKeyPress?: (e: React.KeyboardEvent) => void;
1032
+ onKeyPressCapture?: (e: React.KeyboardEvent) => void;
1033
+ onBeforeInput?: (e: InputEvent) => void;
1034
+ };
1035
+ type ReactEventHandlers<MenuItemType extends string = string> = ReactDOMEventHandlers & {
1036
+ onContributeMenuItems?: () => Optional<RegularMenuItem<MenuItemType>>[];
1037
+ keyboardShortcuts?: KeyMap;
1038
+ onSelectMenuItem?: (id: string) => void;
1039
+ };
1040
+ type EventName = keyof ReactEventHandlers;
1041
+ declare function mergeEventHandlers(...handlerMaps: ReactEventHandlers[]): ReactEventHandlers;
1042
+
1043
+ interface HoverEvent {
1044
+ /** The type of hover event being fired. */
1045
+ type: 'hoverstart' | 'hoverend';
1046
+ /** The pointer type that triggered the hover event. */
1047
+ pointerType: 'mouse' | 'pen';
1048
+ /** The target element of the hover event. */
1049
+ target: HTMLElement;
1050
+ }
1051
+ interface HoverEvents {
1052
+ /** Handler that is called when a hover interaction starts. */
1053
+ onHoverStart?(e: HoverEvent): void;
1054
+ /** Handler that is called when a hover interaction ends. */
1055
+ onHoverEnd?(e: HoverEvent): void;
1056
+ /** Handler that is called when the hover state changes. */
1057
+ onHoverChange?(isHovering: boolean): void;
1058
+ }
1059
+ interface HoverProps extends HoverEvents {
1060
+ /** Whether the hover events should be disabled. */
1061
+ isDisabled?: boolean;
1062
+ }
1063
+ interface HoverResult {
1064
+ /** Props to spread on the target element. */
1065
+ hoverProps: React$1.HTMLAttributes<HTMLElement>;
1066
+ isHovered: boolean;
1067
+ }
1068
+ /**
1069
+ * Handles pointer hover interactions for an element. Normalizes behavior
1070
+ * across browsers and platforms, and ignores emulated mouse events on touch devices.
1071
+ */
1072
+ declare function useHover(props?: HoverProps): HoverResult;
1073
+
1074
+ declare function usePlatform(): _noya_app_noya_keymap.PlatformName;
1075
+ /**
1076
+ * Either ctrl or meta, depending on the platform
1077
+ */
1078
+ declare function usePlatformModKey(): 'ctrlKey' | 'metaKey';
1079
+
1080
+ declare const size: {
1081
+ medium: string;
1082
+ large: string;
1083
+ xlarge: string;
1084
+ xxlarge: string;
1085
+ };
1086
+ declare const mediaQuery: {
1087
+ small: string;
1088
+ medium: string;
1089
+ large: string;
1090
+ xlarge: string;
1091
+ };
1092
+
1093
+ declare const colors: {
1094
+ logo: {
1095
+ fill: string;
1096
+ highlight: string;
1097
+ };
1098
+ text: string;
1099
+ textMuted: string;
1100
+ textSubtle: string;
1101
+ textDisabled: string;
1102
+ dividerSubtle: string;
1103
+ divider: string;
1104
+ dividerStrong: string;
1105
+ primary: string;
1106
+ primaryLight: string;
1107
+ secondary: string;
1108
+ secondaryLight: string;
1109
+ secondaryBright: string;
1110
+ warning: string;
1111
+ neutralBackground: string;
1112
+ inputBackground: string;
1113
+ inputBackgroundLight: string;
1114
+ codeBackground: string;
1115
+ selectedBackground: string;
1116
+ transparentChecker: string;
1117
+ activeBackground: string;
1118
+ scrollbar: string;
1119
+ placeholderDots: string;
1120
+ listView: {
1121
+ raisedBackground: string;
1122
+ editingBackground: string;
1123
+ };
1124
+ canvas: {
1125
+ background: string;
1126
+ readonly selectionStroke: string;
1127
+ dragHandleStroke: string;
1128
+ measurement: string;
1129
+ sliceOutline: string;
1130
+ grid: string;
1131
+ };
1132
+ sidebar: {
1133
+ background: string;
1134
+ };
1135
+ popover: {
1136
+ background: string;
1137
+ divider: string;
1138
+ };
1139
+ slider: {
1140
+ background: string;
1141
+ border: string;
1142
+ };
1143
+ radioGroup: {
1144
+ background: string;
1145
+ };
1146
+ icon: string;
1147
+ iconSelected: string;
1148
+ mask: string;
1149
+ imageOverlay: string;
1150
+ readonly dragOutline: string;
1151
+ selection: string;
1152
+ thumbnailBackground: string;
1153
+ };
1154
+
1155
+ declare const dark_colors: typeof colors;
1156
+ declare const dark_fonts: typeof fonts;
1157
+ declare const dark_sizes: typeof sizes;
1158
+ declare const dark_textStyles: typeof textStyles;
1159
+ declare namespace dark {
1160
+ export { dark_colors as colors, dark_fonts as fonts, dark_sizes as sizes, dark_textStyles as textStyles };
1161
+ }
1162
+
1163
+ declare function getGradientBackground(value: Sketch.GradientStop[], type: Sketch.GradientType, direction?: number): string;
1164
+
1165
+ declare function isLeftButtonClicked(event: React.MouseEvent): boolean;
1166
+ declare function isRightButtonClicked(event: React.MouseEvent): boolean;
1167
+
1168
+ declare function sketchColorToRgba(value: Sketch.Color): RgbaColor;
1169
+ declare function sketchColorToRgbaString(value: Sketch.Color): string;
1170
+ declare function rgbaToSketchColor(value: RgbaColor): Sketch.Color;
1171
+ declare function sketchColorToHex(value: Sketch.Color): string;
1172
+
1173
+ declare module "react" {
1174
+ function memo<A, B>(Component: (props: A) => B): (props: A) => React.ReactElement | null;
1175
+ function forwardRef<T, P = {}>(render: (props: P, ref: React.ForwardedRef<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
1176
+ }
1177
+
1178
+ export { ActivityIndicator, Avatar, Body, Button, ButtonElement, type ButtonRootProps, Chip, type ChipProps, CloseButtonContainer, type Colors, type CompletionItem, type CompletionListItem, CompletionMenu, type CompletionSectionHeader, CompletionToken, ContextMenu, type DesignSystemConfigurationContextValue, DesignSystemConfigurationProvider, Dialog, type DialogContextValue, DialogProvider, Divider, DividerVertical, type DropValidator, DropdownMenu, type EditableRowProps, type EventName, type ExtractMenuItemType, FillInputField, FillPreviewBackground, type GlobalInputBlurContextValue, GlobalInputBlurProvider, GradientPicker, type GridProps, GridView, type GridViewSize, Heading1, Heading2, Heading3, Heading4, Heading5, type HoverEvent, type HoverEvents, type HoverProps, type IDialog, type IScoredItem, type IToken, type IVirtualizedList, IconButton, InputElement, InputField, type InputFieldSize, InputFieldWithCompletions, Italic, KeyboardShortcut, Label, LabeledElementView, type ListRowMarginType, type ListRowPosition, ListView, type MatchRange, type MenuConfig, type MenuItem, type MenuItemProps, type MenuProps, type Optional, PatternPreviewBackground, Popover, Progress, RadioGroup, type ReactDOMEventHandlers, type ReactEventHandlers, type RegularMenuItem, type RelativeDropPosition, Row, SEPARATOR_ITEM, SUPPORTED_CANVAS_UPLOAD_TYPES, SUPPORTED_IMAGE_UPLOAD_TYPES, ScrollArea, Select, SelectOption, type SketchPattern, Slider, Small, Sortable, Spacer, Stack, type StackBreakpointList, type SupportedCanvasUploadType, type SupportedImageUploadType, Switch, Text, type TextBreakpointList, type Theme, type ThemeColorName, Toast, ToastProvider, Tooltip, TreeView, createSectionedMenu, dark as darkTheme, fuzzyFilter, fuzzyScore, fuzzyTokenize, getGradientBackground, isLeftButtonClicked, isRightButtonClicked, lightTheme, mediaQuery, mergeEventHandlers, normalizeListIndex, rgbaToSketchColor, size, sketchColorToHex, sketchColorToRgba, sketchColorToRgbaString, useDesignSystemConfiguration, useDesignSystemTheme, useDialogContainsElement, useGlobalInputBlur, useGlobalInputBlurListener, useGlobalInputBlurTrigger, useHover, useOpenInputDialog, usePlatform, usePlatformModKey, withSeparatorElements };