datocms-react-ui 2.2.5 → 2.2.7

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 (212) hide show
  1. package/README.md +39 -7
  2. package/dist/cjs/Button/index.js +2 -3
  3. package/dist/cjs/Button/index.js.map +1 -1
  4. package/dist/cjs/ButtonGroup/Button/index.js +1 -2
  5. package/dist/cjs/ButtonGroup/Button/index.js.map +1 -1
  6. package/dist/cjs/ButtonGroup/Group/index.js +1 -2
  7. package/dist/cjs/ButtonGroup/Group/index.js.map +1 -1
  8. package/dist/cjs/Canvas/index.js +3 -3
  9. package/dist/cjs/Canvas/index.js.map +1 -1
  10. package/dist/cjs/ContextInspector/index.js +2 -3
  11. package/dist/cjs/ContextInspector/index.js.map +1 -1
  12. package/dist/cjs/Dropdown/Dropdown.js +1 -2
  13. package/dist/cjs/Dropdown/Dropdown.js.map +1 -1
  14. package/dist/cjs/Dropdown/Menu.js.map +1 -1
  15. package/dist/cjs/Dropdown/Option.js.map +1 -1
  16. package/dist/cjs/Dropdown/OptionAction.js.map +1 -1
  17. package/dist/cjs/Dropdown/Portal.js +1 -2
  18. package/dist/cjs/Dropdown/Portal.js.map +1 -1
  19. package/dist/cjs/Dropdown/Separator.js.map +1 -1
  20. package/dist/cjs/Dropdown/Text.js +1 -2
  21. package/dist/cjs/Dropdown/Text.js.map +1 -1
  22. package/dist/cjs/FieldError/index.js +1 -2
  23. package/dist/cjs/FieldError/index.js.map +1 -1
  24. package/dist/cjs/FieldGroup/index.js +1 -2
  25. package/dist/cjs/FieldGroup/index.js.map +1 -1
  26. package/dist/cjs/FieldHint/index.js +1 -2
  27. package/dist/cjs/FieldHint/index.js.map +1 -1
  28. package/dist/cjs/FieldWrapper/index.js +1 -2
  29. package/dist/cjs/FieldWrapper/index.js.map +1 -1
  30. package/dist/cjs/Form/index.js.map +1 -1
  31. package/dist/cjs/HotKey/index.js +1 -2
  32. package/dist/cjs/HotKey/index.js.map +1 -1
  33. package/dist/cjs/Section/index.js +1 -2
  34. package/dist/cjs/Section/index.js.map +1 -1
  35. package/dist/cjs/SelectField/index.js +4 -5
  36. package/dist/cjs/SelectField/index.js.map +1 -1
  37. package/dist/cjs/SelectInput/index.js +4 -5
  38. package/dist/cjs/SelectInput/index.js.map +1 -1
  39. package/dist/cjs/SidebarPanel/index.js +1 -2
  40. package/dist/cjs/SidebarPanel/index.js.map +1 -1
  41. package/dist/cjs/Spinner/index.js +1 -2
  42. package/dist/cjs/Spinner/index.js.map +1 -1
  43. package/dist/cjs/SplitView/SplitViewPane/index.js +1 -2
  44. package/dist/cjs/SplitView/SplitViewPane/index.js.map +1 -1
  45. package/dist/cjs/SplitView/SplitViewSash/index.js +1 -2
  46. package/dist/cjs/SplitView/SplitViewSash/index.js.map +1 -1
  47. package/dist/cjs/SplitView/index.js.map +1 -1
  48. package/dist/cjs/SwitchField/index.js +3 -4
  49. package/dist/cjs/SwitchField/index.js.map +1 -1
  50. package/dist/cjs/SwitchField/styles.module.css.json +1 -1
  51. package/dist/cjs/SwitchInput/index.js +1 -2
  52. package/dist/cjs/SwitchInput/index.js.map +1 -1
  53. package/dist/cjs/SwitchInput/styles.module.css.json +1 -1
  54. package/dist/cjs/TextField/index.js +1 -2
  55. package/dist/cjs/TextField/index.js.map +1 -1
  56. package/dist/cjs/TextInput/index.js.map +1 -1
  57. package/dist/cjs/TextareaField/index.js +1 -2
  58. package/dist/cjs/TextareaField/index.js.map +1 -1
  59. package/dist/cjs/TextareaInput/index.js.map +1 -1
  60. package/dist/cjs/Toolbar/Button/index.js +1 -2
  61. package/dist/cjs/Toolbar/Button/index.js.map +1 -1
  62. package/dist/cjs/Toolbar/Stack/index.js +1 -2
  63. package/dist/cjs/Toolbar/Stack/index.js.map +1 -1
  64. package/dist/cjs/Toolbar/Title/index.js +1 -2
  65. package/dist/cjs/Toolbar/Title/index.js.map +1 -1
  66. package/dist/cjs/Toolbar/Toolbar/index.js +1 -2
  67. package/dist/cjs/Toolbar/Toolbar/index.js.map +1 -1
  68. package/dist/cjs/Tooltip/Tooltip/index.js +1 -2
  69. package/dist/cjs/Tooltip/Tooltip/index.js.map +1 -1
  70. package/dist/cjs/Tooltip/TooltipDelayGroup/index.js +1 -2
  71. package/dist/cjs/Tooltip/TooltipDelayGroup/index.js.map +1 -1
  72. package/dist/cjs/Tooltip/TooltipTrigger/index.js.map +1 -1
  73. package/dist/cjs/Tooltip/utils.js +4 -4
  74. package/dist/cjs/Tooltip/utils.js.map +1 -1
  75. package/dist/cjs/VerticalSplit/index.js +1 -2
  76. package/dist/cjs/VerticalSplit/index.js.map +1 -1
  77. package/dist/cjs/generateStyleFromCtx/index.js +1 -2
  78. package/dist/cjs/generateStyleFromCtx/index.js.map +1 -1
  79. package/dist/cjs/icons.js +8 -9
  80. package/dist/cjs/icons.js.map +1 -1
  81. package/dist/cjs/mergeRefs/index.js.map +1 -1
  82. package/dist/cjs/useClickOutside/index.js +1 -2
  83. package/dist/cjs/useClickOutside/index.js.map +1 -1
  84. package/dist/cjs/useMediaQuery/index.js +3 -4
  85. package/dist/cjs/useMediaQuery/index.js.map +1 -1
  86. package/dist/esm/Button/index.d.ts +2 -2
  87. package/dist/esm/ButtonGroup/Button/index.d.ts +1 -1
  88. package/dist/esm/ButtonGroup/Group/index.d.ts +1 -1
  89. package/dist/esm/Canvas/index.d.ts +2 -2
  90. package/dist/esm/Canvas/index.js.map +1 -1
  91. package/dist/esm/ContextInspector/index.d.ts +0 -1
  92. package/dist/esm/ContextInspector/index.js.map +1 -1
  93. package/dist/esm/Dropdown/Dropdown.d.ts +2 -2
  94. package/dist/esm/Dropdown/Dropdown.js.map +1 -1
  95. package/dist/esm/Dropdown/DropdownContext.d.ts +1 -2
  96. package/dist/esm/Dropdown/Group.d.ts +1 -1
  97. package/dist/esm/Dropdown/Menu.d.ts +1 -1
  98. package/dist/esm/Dropdown/Menu.js.map +1 -1
  99. package/dist/esm/Dropdown/MenuContext.d.ts +1 -1
  100. package/dist/esm/Dropdown/Option.d.ts +1 -1
  101. package/dist/esm/Dropdown/Option.js.map +1 -1
  102. package/dist/esm/Dropdown/OptionAction.d.ts +1 -1
  103. package/dist/esm/Dropdown/OptionAction.js.map +1 -1
  104. package/dist/esm/Dropdown/Portal.js.map +1 -1
  105. package/dist/esm/Dropdown/Separator.d.ts +0 -1
  106. package/dist/esm/Dropdown/Separator.js.map +1 -1
  107. package/dist/esm/Dropdown/Text.d.ts +1 -1
  108. package/dist/esm/FieldError/index.d.ts +1 -1
  109. package/dist/esm/FieldHint/index.d.ts +1 -1
  110. package/dist/esm/FieldWrapper/index.d.ts +1 -1
  111. package/dist/esm/Form/index.js.map +1 -1
  112. package/dist/esm/HotKey/index.d.ts +3 -3
  113. package/dist/esm/Section/index.d.ts +1 -1
  114. package/dist/esm/SelectField/index.d.ts +4 -4
  115. package/dist/esm/SelectInput/index.d.ts +5 -6
  116. package/dist/esm/SelectInput/index.js.map +1 -1
  117. package/dist/esm/SidebarPanel/index.d.ts +1 -1
  118. package/dist/esm/Spinner/index.d.ts +1 -1
  119. package/dist/esm/Spinner/index.js.map +1 -1
  120. package/dist/esm/SplitView/SplitViewPane/index.d.ts +2 -2
  121. package/dist/esm/SplitView/SplitViewSash/index.d.ts +3 -3
  122. package/dist/esm/SplitView/index.d.ts +3 -3
  123. package/dist/esm/SplitView/index.js.map +1 -1
  124. package/dist/esm/SplitView/types.d.ts +2 -2
  125. package/dist/esm/SwitchField/index.d.ts +1 -1
  126. package/dist/esm/SwitchField/index.js +2 -2
  127. package/dist/esm/SwitchField/index.js.map +1 -1
  128. package/dist/esm/SwitchField/styles.module.css.json +1 -1
  129. package/dist/esm/SwitchInput/index.d.ts +1 -1
  130. package/dist/esm/SwitchInput/index.js.map +1 -1
  131. package/dist/esm/SwitchInput/styles.module.css.json +1 -1
  132. package/dist/esm/TextField/index.d.ts +1 -1
  133. package/dist/esm/TextInput/index.d.ts +2 -2
  134. package/dist/esm/TextInput/index.js.map +1 -1
  135. package/dist/esm/TextareaField/index.d.ts +1 -1
  136. package/dist/esm/TextareaInput/index.d.ts +2 -2
  137. package/dist/esm/TextareaInput/index.js.map +1 -1
  138. package/dist/esm/Toolbar/Button/index.d.ts +1 -1
  139. package/dist/esm/Toolbar/Stack/index.d.ts +1 -1
  140. package/dist/esm/Toolbar/Title/index.d.ts +1 -1
  141. package/dist/esm/Toolbar/Toolbar/index.d.ts +1 -1
  142. package/dist/esm/Tooltip/Tooltip/index.d.ts +2 -2
  143. package/dist/esm/Tooltip/TooltipContent/index.d.ts +1 -1
  144. package/dist/esm/Tooltip/TooltipDelayGroup/index.d.ts +2 -2
  145. package/dist/esm/Tooltip/TooltipTrigger/index.d.ts +1 -1
  146. package/dist/esm/Tooltip/TooltipTrigger/index.js.map +1 -1
  147. package/dist/esm/Tooltip/utils.d.ts +11 -11
  148. package/dist/esm/Tooltip/utils.js.map +1 -1
  149. package/dist/esm/VerticalSplit/index.d.ts +2 -2
  150. package/dist/esm/VerticalSplit/index.js.map +1 -1
  151. package/dist/esm/generateStyleFromCtx/index.js.map +1 -1
  152. package/dist/esm/icons.d.ts +1 -1
  153. package/dist/esm/mergeRefs/index.d.ts +1 -2
  154. package/dist/esm/mergeRefs/index.js.map +1 -1
  155. package/dist/esm/useClickOutside/index.d.ts +0 -1
  156. package/dist/esm/useClickOutside/index.js.map +1 -1
  157. package/dist/esm/useMediaQuery/index.d.ts +1 -1
  158. package/dist/esm/useMediaQuery/index.js.map +1 -1
  159. package/dist/types/Button/index.d.ts +2 -2
  160. package/dist/types/ButtonGroup/Button/index.d.ts +1 -1
  161. package/dist/types/ButtonGroup/Group/index.d.ts +1 -1
  162. package/dist/types/Canvas/index.d.ts +2 -2
  163. package/dist/types/ContextInspector/index.d.ts +0 -1
  164. package/dist/types/Dropdown/Dropdown.d.ts +2 -2
  165. package/dist/types/Dropdown/DropdownContext.d.ts +1 -2
  166. package/dist/types/Dropdown/Group.d.ts +1 -1
  167. package/dist/types/Dropdown/Menu.d.ts +1 -1
  168. package/dist/types/Dropdown/MenuContext.d.ts +1 -1
  169. package/dist/types/Dropdown/Option.d.ts +1 -1
  170. package/dist/types/Dropdown/OptionAction.d.ts +1 -1
  171. package/dist/types/Dropdown/Separator.d.ts +0 -1
  172. package/dist/types/Dropdown/Text.d.ts +1 -1
  173. package/dist/types/FieldError/index.d.ts +1 -1
  174. package/dist/types/FieldHint/index.d.ts +1 -1
  175. package/dist/types/FieldWrapper/index.d.ts +1 -1
  176. package/dist/types/HotKey/index.d.ts +3 -3
  177. package/dist/types/Section/index.d.ts +1 -1
  178. package/dist/types/SelectField/index.d.ts +4 -4
  179. package/dist/types/SelectInput/index.d.ts +5 -6
  180. package/dist/types/SidebarPanel/index.d.ts +1 -1
  181. package/dist/types/Spinner/index.d.ts +1 -1
  182. package/dist/types/SplitView/SplitViewPane/index.d.ts +2 -2
  183. package/dist/types/SplitView/SplitViewSash/index.d.ts +3 -3
  184. package/dist/types/SplitView/index.d.ts +3 -3
  185. package/dist/types/SplitView/types.d.ts +2 -2
  186. package/dist/types/SwitchField/index.d.ts +1 -1
  187. package/dist/types/SwitchInput/index.d.ts +1 -1
  188. package/dist/types/TextField/index.d.ts +1 -1
  189. package/dist/types/TextInput/index.d.ts +2 -2
  190. package/dist/types/TextareaField/index.d.ts +1 -1
  191. package/dist/types/TextareaInput/index.d.ts +2 -2
  192. package/dist/types/Toolbar/Button/index.d.ts +1 -1
  193. package/dist/types/Toolbar/Stack/index.d.ts +1 -1
  194. package/dist/types/Toolbar/Title/index.d.ts +1 -1
  195. package/dist/types/Toolbar/Toolbar/index.d.ts +1 -1
  196. package/dist/types/Tooltip/Tooltip/index.d.ts +2 -2
  197. package/dist/types/Tooltip/TooltipContent/index.d.ts +1 -1
  198. package/dist/types/Tooltip/TooltipDelayGroup/index.d.ts +2 -2
  199. package/dist/types/Tooltip/TooltipTrigger/index.d.ts +1 -1
  200. package/dist/types/Tooltip/utils.d.ts +11 -11
  201. package/dist/types/VerticalSplit/index.d.ts +2 -2
  202. package/dist/types/icons.d.ts +1 -1
  203. package/dist/types/mergeRefs/index.d.ts +1 -2
  204. package/dist/types/useClickOutside/index.d.ts +0 -1
  205. package/dist/types/useMediaQuery/index.d.ts +1 -1
  206. package/package.json +5 -3
  207. package/src/SwitchField/index.tsx +6 -1
  208. package/src/SwitchField/styles.module.css +6 -5
  209. package/src/SwitchField/styles.module.css.json +1 -1
  210. package/src/SwitchInput/styles.module.css.json +1 -1
  211. package/styles.css +1 -1
  212. package/types.json +3913 -3085
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type MenuProps = {
2
+ export type MenuProps = {
3
3
  children: React.ReactNode;
4
4
  alignment?: 'left' | 'right';
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { type SyntheticEvent } from 'react';
2
- declare type Context = {
2
+ type Context = {
3
3
  searchTerm: string;
4
4
  addOption: (id: string) => void;
5
5
  setClickHandlerForOption: (id: string, handler: (e: SyntheticEvent) => void) => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type OptionProps = {
2
+ export type OptionProps = {
3
3
  onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
4
4
  to?: string;
5
5
  active?: boolean;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { ReactNode } from 'react';
3
- export declare type OptionActionProps = {
3
+ export type OptionActionProps = {
4
4
  icon: ReactNode;
5
5
  red?: boolean;
6
6
  onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Separator: () => JSX.Element | null;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type TextProps = {
2
+ export type TextProps = {
3
3
  children: React.ReactNode;
4
4
  };
5
5
  export declare function Text({ children }: TextProps): JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- declare type FieldErrorProps = {
2
+ type FieldErrorProps = {
3
3
  children: ReactNode;
4
4
  };
5
5
  export declare function FieldError({ children }: FieldErrorProps): JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- declare type FieldHintProps = {
2
+ type FieldHintProps = {
3
3
  children: ReactNode;
4
4
  };
5
5
  export declare function FieldHint({ children }: FieldHintProps): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type FormLabelProps } from '..';
3
- declare type FieldWrapperProps = {
3
+ type FieldWrapperProps = {
4
4
  id: string;
5
5
  label: ReactNode;
6
6
  hint?: ReactNode;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
- export declare type HotKeyProps = {
1
+ import * as React from 'react';
2
+ export type HotKeyProps = {
3
3
  /**
4
4
  * Keyboard shortcut string. Use "mod" for platform-specific modifier (Cmd on Mac, Ctrl elsewhere).
5
5
  * Separate keys with "+". Examples: "mod+s", "mod+shift+p", "alt+enter"
@@ -67,4 +67,4 @@ export declare type HotKeyProps = {
67
67
  * </Canvas>;
68
68
  * ```
69
69
  */
70
- export declare function HotKey({ hotkey, label }: HotKeyProps): JSX.Element;
70
+ export declare function HotKey({ hotkey, label }: HotKeyProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
- declare type SectionProps = {
2
+ type SectionProps = {
3
3
  title: ReactNode;
4
4
  children?: ReactNode;
5
5
  highlighted?: boolean;
@@ -1,7 +1,7 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { GroupBase } from 'react-select';
3
3
  import { type AsyncCreatableSelectInputProps, type AsyncSelectInputProps, type CreatableSelectInputProps, type FormLabelProps, type SelectInputProps } from '..';
4
- declare type SelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
4
+ type SelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
5
5
  id: string;
6
6
  name: string;
7
7
  label: ReactNode;
@@ -15,7 +15,7 @@ declare type SelectFieldProps<Option, IsMulti extends boolean, Group extends Gro
15
15
  selectInputProps?: SelectInputProps<Option, IsMulti, Group>;
16
16
  };
17
17
  export declare function SelectField<Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ id, name, label, hint, error, required, placeholder, formLabelProps, value, onChange, selectInputProps, }: SelectFieldProps<Option, IsMulti, Group>): JSX.Element;
18
- declare type AsyncSelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
18
+ type AsyncSelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
19
19
  id: string;
20
20
  name: string;
21
21
  label: ReactNode;
@@ -29,7 +29,7 @@ declare type AsyncSelectFieldProps<Option, IsMulti extends boolean, Group extend
29
29
  selectInputProps?: AsyncSelectInputProps<Option, IsMulti, Group>;
30
30
  };
31
31
  export declare function AsyncSelectField<Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ id, name, label, hint, error, required, placeholder, formLabelProps, value, onChange, selectInputProps, }: AsyncSelectFieldProps<Option, IsMulti, Group>): JSX.Element;
32
- declare type CreatableSelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
32
+ type CreatableSelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
33
33
  id: string;
34
34
  name: string;
35
35
  label: ReactNode;
@@ -43,7 +43,7 @@ declare type CreatableSelectFieldProps<Option, IsMulti extends boolean, Group ex
43
43
  selectInputProps?: CreatableSelectInputProps<Option, IsMulti, Group>;
44
44
  };
45
45
  export declare function CreatableSelectField<Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ id, name, label, hint, error, required, placeholder, formLabelProps, value, onChange, selectInputProps, }: CreatableSelectFieldProps<Option, IsMulti, Group>): JSX.Element;
46
- declare type AsyncCreatableSelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
46
+ type AsyncCreatableSelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
47
47
  id: string;
48
48
  name: string;
49
49
  label: ReactNode;
@@ -1,17 +1,16 @@
1
- /// <reference types="react" />
2
1
  import { type Props as RawSelectProps, type GroupBase } from 'react-select';
3
2
  import { type AsyncProps } from 'react-select/async';
4
3
  import { type AsyncCreatableProps } from 'react-select/async-creatable';
5
4
  import { type CreatableProps } from 'react-select/creatable';
6
- declare type ErrorProp = {
5
+ type ErrorProp = {
7
6
  error?: boolean;
8
7
  };
9
- export declare type SelectInputProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<RawSelectProps<Option, IsMulti, Group>, 'theme' | 'styles'> & ErrorProp;
8
+ export type SelectInputProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<RawSelectProps<Option, IsMulti, Group>, 'theme' | 'styles'> & ErrorProp;
10
9
  export declare function SelectInput<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ isDisabled, error, ...other }: SelectInputProps<Option, IsMulti, Group>): JSX.Element;
11
- export declare type AsyncSelectInputProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<AsyncProps<Option, IsMulti, Group>, 'theme' | 'styles'> & ErrorProp;
10
+ export type AsyncSelectInputProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<AsyncProps<Option, IsMulti, Group>, 'theme' | 'styles'> & ErrorProp;
12
11
  export declare function AsyncSelectInput<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ isDisabled, error, ...other }: AsyncSelectInputProps<Option, IsMulti, Group>): JSX.Element;
13
- export declare type CreatableSelectInputProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<CreatableProps<Option, IsMulti, Group>, 'theme' | 'styles'> & ErrorProp;
12
+ export type CreatableSelectInputProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<CreatableProps<Option, IsMulti, Group>, 'theme' | 'styles'> & ErrorProp;
14
13
  export declare function CreatableSelectInput<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ isDisabled, error, ...other }: CreatableSelectInputProps<Option, IsMulti, Group>): JSX.Element;
15
- export declare type AsyncCreatableSelectInputProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<AsyncCreatableProps<Option, IsMulti, Group>, 'theme' | 'styles'> & ErrorProp;
14
+ export type AsyncCreatableSelectInputProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<AsyncCreatableProps<Option, IsMulti, Group>, 'theme' | 'styles'> & ErrorProp;
16
15
  export declare function AsyncCreatableSelectInput<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ isDisabled, error, ...other }: AsyncCreatableSelectInputProps<Option, IsMulti, Group>): JSX.Element;
17
16
  export {};
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- export declare type SidebarPanelProps = {
2
+ export type SidebarPanelProps = {
3
3
  title?: ReactNode;
4
4
  startOpen?: boolean;
5
5
  children: ReactNode;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type SpinnerProps = {
2
+ type SpinnerProps = {
3
3
  size?: number;
4
4
  placement?: 'inline' | 'centered';
5
5
  style?: React.CSSProperties;
@@ -1,7 +1,7 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- export declare type SplitViewPaneProps = {
2
+ export type SplitViewPaneProps = {
3
3
  maxSize?: number | string;
4
4
  minSize?: number | string;
5
5
  style?: React.CSSProperties;
6
6
  };
7
- export declare function SplitViewPane({ style, children, }: PropsWithChildren<SplitViewPaneProps>): JSX.Element;
7
+ export declare function SplitViewPane({ style, children, }: PropsWithChildren<SplitViewPaneProps>): React.JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import React, { ReactNode } from 'react';
2
- export declare type SashAction = {
2
+ export type SashAction = {
3
3
  icon: ReactNode;
4
4
  onClick: () => void;
5
5
  };
6
- declare type SplitViewSashProps = {
6
+ type SplitViewSashProps = {
7
7
  className?: string;
8
8
  style: React.CSSProperties;
9
9
  split: 'vertical' | 'horizontal';
@@ -13,5 +13,5 @@ declare type SplitViewSashProps = {
13
13
  onMouseMove: (x: number, y: number) => void;
14
14
  onMouseUp: () => void;
15
15
  };
16
- export declare function SplitViewSash({ onMouseDown, onMouseMove, onMouseUp, style, split, allowResize, action, }: SplitViewSashProps): JSX.Element;
16
+ export declare function SplitViewSash({ onMouseDown, onMouseMove, onMouseUp, style, split, allowResize, action, }: SplitViewSashProps): React.JSX.Element;
17
17
  export {};
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { SashAction } from './SplitViewSash';
3
- declare type SplitViewProps = {
3
+ type SplitViewProps = {
4
4
  children: JSX.Element[];
5
5
  allowResize?: boolean;
6
6
  split?: 'vertical' | 'horizontal';
@@ -12,5 +12,5 @@ declare type SplitViewProps = {
12
12
  resizerSize?: number;
13
13
  sashAction?: SashAction;
14
14
  };
15
- export declare const SplitView: ({ children, sizes: propSizes, allowResize, split, resizerSize, performanceMode, onChange, onDragStart, onDragEnd, sashAction, }: SplitViewProps) => JSX.Element;
15
+ export declare const SplitView: ({ children, sizes: propSizes, allowResize, split, resizerSize, performanceMode, onChange, onDragStart, onDragEnd, sashAction, }: SplitViewProps) => React.JSX.Element;
16
16
  export {};
@@ -1,8 +1,8 @@
1
- export declare type IAxis = {
1
+ export type IAxis = {
2
2
  x: number;
3
3
  y: number;
4
4
  };
5
- export declare type ICacheSizes = {
5
+ export type ICacheSizes = {
6
6
  sizes: (string | number)[];
7
7
  sashPosSizes: (string | number)[];
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type FormLabelProps, type SwitchInputProps } from '..';
3
- declare type SwitchFieldProps = {
3
+ type SwitchFieldProps = {
4
4
  id: string;
5
5
  name: string;
6
6
  label: ReactNode;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type SwitchInputChangeEventHandler = (newValue: boolean, event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
2
+ export type SwitchInputChangeEventHandler = (newValue: boolean, event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
3
3
  export interface SwitchInputProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'onChange'> {
4
4
  name: string;
5
5
  disabled?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type FormLabelProps, type TextInputProps } from '..';
3
- declare type TextFieldProps = {
3
+ type TextFieldProps = {
4
4
  id: string;
5
5
  name: string;
6
6
  label: ReactNode;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type RefObject } from 'react';
3
- export declare type TextInputChangeEventHandler = (newValue: string, event: React.ChangeEvent<HTMLInputElement>) => void;
4
- export declare type TextInputProps = {
3
+ export type TextInputChangeEventHandler = (newValue: string, event: React.ChangeEvent<HTMLInputElement>) => void;
4
+ export type TextInputProps = {
5
5
  type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'url' | 'date' | 'time';
6
6
  name?: string;
7
7
  labelText?: string;
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type FormLabelProps, type TextareaInputProps } from '..';
3
- declare type TextareaFieldProps = {
3
+ type TextareaFieldProps = {
4
4
  id: string;
5
5
  name: string;
6
6
  label: ReactNode;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type RefObject } from 'react';
3
- export declare type TextareaInputChangeEventHandler = (newValue: string, event: React.ChangeEvent<HTMLTextAreaElement>) => void;
4
- export declare type TextareaInputProps = {
3
+ export type TextareaInputChangeEventHandler = (newValue: string, event: React.ChangeEvent<HTMLTextAreaElement>) => void;
4
+ export type TextareaInputProps = {
5
5
  name?: string;
6
6
  labelText?: string;
7
7
  id?: string;
@@ -1,5 +1,5 @@
1
1
  import { type CSSProperties, type MouseEventHandler, type ReactNode } from 'react';
2
- export declare type ButtonProps = {
2
+ export type ButtonProps = {
3
3
  children?: ReactNode;
4
4
  className?: string;
5
5
  style?: CSSProperties;
@@ -1,5 +1,5 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
- export declare type StackProps = {
2
+ export type StackProps = {
3
3
  children?: ReactNode;
4
4
  className?: string;
5
5
  stackSize?: 's' | 'm' | 'l';
@@ -1,5 +1,5 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
- export declare type TitleProps = {
2
+ export type TitleProps = {
3
3
  children?: ReactNode;
4
4
  className?: string;
5
5
  style?: CSSProperties;
@@ -1,5 +1,5 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
- export declare type ToolbarProps = {
2
+ export type ToolbarProps = {
3
3
  children?: ReactNode;
4
4
  className?: string;
5
5
  style?: CSSProperties;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { TooltipOptions } from '../utils';
3
- export declare type TooltipProps = {
3
+ export type TooltipProps = {
4
4
  children?: React.ReactNode;
5
5
  } & TooltipOptions;
6
6
  /**
@@ -71,4 +71,4 @@ export declare type TooltipProps = {
71
71
  * </Canvas>;
72
72
  * ```
73
73
  */
74
- export declare function Tooltip({ children, ...options }: TooltipProps): JSX.Element;
74
+ export declare function Tooltip({ children, ...options }: TooltipProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- export declare type TooltipContentProps = {
2
+ export type TooltipContentProps = {
3
3
  children?: React.ReactNode;
4
4
  };
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- export declare type TooltipDelayGroupProps = {
2
+ export type TooltipDelayGroupProps = {
3
3
  children?: React.ReactNode;
4
4
  /** The delay in milliseconds before a tooltip opens on hover (default: 1000) */
5
5
  delay?: number | {
@@ -115,4 +115,4 @@ export declare type TooltipDelayGroupProps = {
115
115
  * </Canvas>;
116
116
  * ```
117
117
  */
118
- export declare function TooltipDelayGroup({ children, delay, timeoutMs, }: TooltipDelayGroupProps): JSX.Element;
118
+ export declare function TooltipDelayGroup({ children, delay, timeoutMs, }: TooltipDelayGroupProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- export declare type TooltipTriggerProps = {
2
+ export type TooltipTriggerProps = {
3
3
  children: React.ReactElement;
4
4
  };
5
5
  /**
@@ -98,7 +98,7 @@ export declare function useTooltip({ initialOpen, placement, open: controlledOpe
98
98
  update: () => void;
99
99
  floatingStyles: React.CSSProperties;
100
100
  open: boolean;
101
- onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
101
+ onOpenChange: (open: boolean, event?: Event, reason?: import("@floating-ui/react").OpenChangeReason) => void;
102
102
  events: import("@floating-ui/react").FloatingEvents;
103
103
  dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
104
104
  nodeId: string | undefined;
@@ -106,16 +106,16 @@ export declare function useTooltip({ initialOpen, placement, open: controlledOpe
106
106
  refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
107
107
  elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
108
108
  };
109
- getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
110
- getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
111
- getItemProps: (userProps?: (Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
109
+ getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
110
+ getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
111
+ getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
112
112
  active?: boolean | undefined;
113
113
  selected?: boolean | undefined;
114
- }) | undefined) => Record<string, unknown>;
114
+ }) => Record<string, unknown>;
115
115
  open: boolean;
116
116
  setOpen: (open: boolean) => void;
117
117
  };
118
- declare type ContextType = ReturnType<typeof useTooltip> | null;
118
+ type ContextType = ReturnType<typeof useTooltip> | null;
119
119
  export declare const TooltipContext: React.Context<ContextType>;
120
120
  export declare const useTooltipState: () => {
121
121
  placement: Placement;
@@ -146,7 +146,7 @@ export declare const useTooltipState: () => {
146
146
  update: () => void;
147
147
  floatingStyles: React.CSSProperties;
148
148
  open: boolean;
149
- onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
149
+ onOpenChange: (open: boolean, event?: Event, reason?: import("@floating-ui/react").OpenChangeReason) => void;
150
150
  events: import("@floating-ui/react").FloatingEvents;
151
151
  dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
152
152
  nodeId: string | undefined;
@@ -154,12 +154,12 @@ export declare const useTooltipState: () => {
154
154
  refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
155
155
  elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
156
156
  };
157
- getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
158
- getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
159
- getItemProps: (userProps?: (Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
157
+ getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
158
+ getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
159
+ getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
160
160
  active?: boolean | undefined;
161
161
  selected?: boolean | undefined;
162
- }) | undefined) => Record<string, unknown>;
162
+ }) => Record<string, unknown>;
163
163
  open: boolean;
164
164
  setOpen: (open: boolean) => void;
165
165
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type VerticalSplitProps = {
2
+ export type VerticalSplitProps = {
3
3
  mode?: 'overlay' | 'split';
4
4
  minSize?: number | string;
5
5
  maxSize?: number | string;
@@ -235,4 +235,4 @@ export declare type VerticalSplitProps = {
235
235
  * </Canvas>;
236
236
  * ```
237
237
  */
238
- export declare function VerticalSplit({ mode, minSize, maxSize, size, primaryPane, children, allowResize, onDragFinished, onSecondaryToggle, isSecondaryCollapsed, }: VerticalSplitProps): JSX.Element;
238
+ export declare function VerticalSplit({ mode, minSize, maxSize, size, primaryPane, children, allowResize, onDragFinished, onSecondaryToggle, isSecondaryCollapsed, }: VerticalSplitProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { type CSSProperties } from 'react';
2
- export declare type IconProps = {
2
+ export type IconProps = {
3
3
  width?: string | number;
4
4
  height?: string | number;
5
5
  className?: string;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
- export declare const mergeRefs: <T>(...refs: import("react").Ref<T>[]) => (instance: T | null) => void;
1
+ export declare const mergeRefs: <T>(...refs: React.Ref<T>[]) => React.RefCallback<T>;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function useClickOutside<T extends HTMLElement>(handler: (event: MouseEvent | TouchEvent) => void): React.RefObject<T>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export declare function useMediaQuery(media: string): MediaQueryList;
3
- export declare type MediaQueryProps = {
3
+ export type MediaQueryProps = {
4
4
  media: string;
5
5
  children: (mql: MediaQueryList) => JSX.Element;
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datocms-react-ui",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
4
4
  "description": "React components to use inside DatoCMS plugins",
5
5
  "keywords": [
6
6
  "datocms",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@floating-ui/react": "^0.27.16",
44
44
  "classnames": "^2.3.1",
45
- "datocms-plugin-sdk": "^2.2.5",
45
+ "datocms-plugin-sdk": "^2.2.7",
46
46
  "react-intersection-observer": "^8.31.0",
47
47
  "react-select": "^5.2.1",
48
48
  "scroll-into-view-if-needed": "^2.2.20"
@@ -56,7 +56,9 @@
56
56
  "postcss-import": "^14.0.2",
57
57
  "postcss-modules": "^4.2.2",
58
58
  "postcss-nested": "^5.0.6",
59
+ "react": "^17.0.2",
60
+ "react-dom": "^17.0.2",
59
61
  "typedoc": "^0.26.7"
60
62
  },
61
- "gitHead": "71205870c9cb7fbd7365bbdcc0de8b4759841b2e"
63
+ "gitHead": "6b88a998f0807c7da1e17afa6a8f0336aed7497f"
62
64
  }
@@ -41,6 +41,7 @@ export function SwitchField({
41
41
  <div className={s.switchField__switchInput}>
42
42
  <SwitchInput
43
43
  {...switchInputProps}
44
+ id={id}
44
45
  name={name}
45
46
  value={value}
46
47
  onChange={onChange}
@@ -50,7 +51,11 @@ export function SwitchField({
50
51
  {...formLabelProps}
51
52
  htmlFor={id}
52
53
  required={required}
53
- className={cn(s.switchField__label, formLabelProps?.className)}
54
+ className={cn(
55
+ s.switchField__label,
56
+ switchInputProps?.disabled && s['switchField__label--disabled'],
57
+ formLabelProps?.className,
58
+ )}
54
59
  error={!!error}
55
60
  >
56
61
  {label}
@@ -8,15 +8,16 @@
8
8
  }
9
9
 
10
10
  .switchField__label {
11
- line-height: 1.1;
12
11
  flex: 1;
13
12
  line-height: 20px;
14
- pointer-events: none;
15
- -moz-user-select: text;
16
- -ms-user-select: text;
17
- user-select: text;
18
13
  margin-bottom: 0;
19
14
  color: var(--color--ink);
15
+
16
+ /* Match the button cursors */
17
+ cursor: pointer;
18
+ &--disabled {
19
+ cursor: no-drop;
20
+ }
20
21
  }
21
22
 
22
23
  .switchField__below {
@@ -1 +1 @@
1
- {"switchField__flex":"_switchField__flex_ietsf_1","switchField__switchInput":"_switchField__switchInput_ietsf_6","switchField__label":"_switchField__label_ietsf_10","switchField__below":"_switchField__below_ietsf_22"}
1
+ {"switchField__flex":"_switchField__flex_1b1b5_1","switchField__switchInput":"_switchField__switchInput_1b1b5_6","switchField__label":"_switchField__label_1b1b5_10","switchField__label--disabled":"_switchField__label--disabled_1b1b5_1","switchField__below":"_switchField__below_1b1b5_23"}
@@ -1 +1 @@
1
- {"switchInput__inner":"_switchInput__inner_vh6pt_1","switchInput":"_switchInput_vh6pt_1","switchInput__off":"_switchInput__off_vh6pt_1","switchInput__on":"_switchInput__on_vh6pt_1","switchInput__checked":"_switchInput__checked_vh6pt_50","switchInput__disabled":"_switchInput__disabled_vh6pt_63","none":"_none_vh6pt_1"}
1
+ {"switchInput__inner":"_switchInput__inner_vh6pt_1","switchInput":"_switchInput_vh6pt_1","switchInput__off":"_switchInput__off_vh6pt_1","switchInput__on":"_switchInput__on_vh6pt_1","switchInput__checked":"_switchInput__checked_vh6pt_50","switchInput__disabled":"_switchInput__disabled_vh6pt_63"}