@fibery/ui-kit 9.0.1 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/lib/a11y-color.js +12 -10
  2. package/lib/actions-menu/actions-menu-item.js +1 -1
  3. package/lib/actions-menu/actions-menu-props.d.ts +2 -0
  4. package/lib/actions-menu/actions-menu-separator.d.ts +2 -2
  5. package/lib/actions-menu/actions-menu-sub-command-menu.js +5 -4
  6. package/lib/actions-menu/actions-menu.d.ts +1 -1
  7. package/lib/actions-menu/actions-menu.js +2 -1
  8. package/lib/actions-menu/contexts/actions-menu-context.js +12 -11
  9. package/lib/actions-menu/index.d.ts +3 -3
  10. package/lib/ai/max-tokens.js +6 -5
  11. package/lib/antd/ant-modal.d.ts +1 -1
  12. package/lib/antd/ant-modal.js +28 -1
  13. package/lib/antd/ant-upload.d.ts +1 -1
  14. package/lib/antd/ant-upload.js +23 -18
  15. package/lib/antd/input-number.js +2 -2
  16. package/lib/antd/input.js +7 -6
  17. package/lib/antd/utils.js +2 -1
  18. package/lib/avatar-colors.js +1 -1
  19. package/lib/avatar.d.ts +1 -10
  20. package/lib/avatar.js +48 -38
  21. package/lib/avatar.wyw-in-js.css +1 -1
  22. package/lib/banner/banner-action.js +2 -1
  23. package/lib/board-table-loader.js +1 -1
  24. package/lib/button/button.js +1 -1
  25. package/lib/button/icon-button.js +1 -1
  26. package/lib/canvas-colors.js +2 -2
  27. package/lib/card-container.d.ts +2 -6
  28. package/lib/card-container.js +5 -5
  29. package/lib/color-filter.js +2 -2
  30. package/lib/color-inspect.js +1 -1
  31. package/lib/color-picker/color-picker-or-loader.d.ts +2 -2
  32. package/lib/color-utils.js +1 -1
  33. package/lib/comment.d.ts +1 -0
  34. package/lib/comment.js +29 -20
  35. package/lib/comment.wyw-in-js.css +9 -7
  36. package/lib/context-menu/index.js +1 -0
  37. package/lib/context-menu/index.wyw-in-js.css +1 -1
  38. package/lib/copy-to-clipboard.js +2 -1
  39. package/lib/date-picker/autocomplete.js +12 -10
  40. package/lib/date-picker/date-range-input.js +9 -7
  41. package/lib/date-picker/day-with-start-end-buttons.js +0 -2
  42. package/lib/date-picker/get-weekends-for-month.js +4 -2
  43. package/lib/date-picker/relative-date-picker.js +5 -3
  44. package/lib/date-picker/single-date-input.js +9 -7
  45. package/lib/date-picker/single-date-picker.d.ts +1 -2
  46. package/lib/date-picker/single-date-picker.js +2 -1
  47. package/lib/date-picker/types.d.ts +1 -2
  48. package/lib/day-select/day-select.js +2 -1
  49. package/lib/day-select/week-day-select.d.ts +2 -2
  50. package/lib/day-select/week-day-select.js +4 -3
  51. package/lib/design-system/alpha.d.ts +6 -0
  52. package/lib/design-system/alpha.js +11 -7
  53. package/lib/design-system/colors-charts.d.ts +4 -0
  54. package/lib/design-system/colors-charts.js +14 -0
  55. package/lib/design-system/colors-js.d.ts +2 -4
  56. package/lib/design-system/colors-js.js +8 -10
  57. package/lib/design-system/fns.enum.js +7 -4
  58. package/lib/design-system/fns.icon.js +1 -1
  59. package/lib/design-system/fns.js +7 -4
  60. package/lib/design-system/theme.d.ts +7 -7
  61. package/lib/design-system/theme.js +7 -12
  62. package/lib/design-system/vars.js +1 -2
  63. package/lib/design-system.d.ts +3 -2
  64. package/lib/design-system.js +3 -2
  65. package/lib/emoji-picker/app-icon-picker.d.ts +2 -2
  66. package/lib/emoji-picker/emoji-picker-content-with-color.d.ts +2 -2
  67. package/lib/emoji-picker/emoji-picker.d.ts +2 -2
  68. package/lib/emoji-picker/icon-emoji-picker.d.ts +1 -2
  69. package/lib/emoji-picker/primitives/content.js +10 -9
  70. package/lib/emoji-picker/primitives/emoji.js +22 -14
  71. package/lib/emoji-picker/primitives/emoji.wyw-in-js.css +4 -3
  72. package/lib/emoji-picker/primitives/grid.js +0 -1
  73. package/lib/emoji-picker/primitives/preview-provider.js +4 -3
  74. package/lib/emoji-picker/primitives/root.js +10 -9
  75. package/lib/emoji-picker/primitives/skin-provider.js +5 -4
  76. package/lib/emoji-picker/stores/emoji-data-store.d.ts +2 -2
  77. package/lib/emoji-picker/stores/emoji-data-store.js +8 -8
  78. package/lib/emoji-picker/stores/static-emoji-data-store.js +2 -1
  79. package/lib/emoji.js +5 -2
  80. package/lib/errors.d.ts +2 -3
  81. package/lib/fibermoji-placeholder.js +5 -7
  82. package/lib/field-type-icon.js +2 -1
  83. package/lib/file-item/file-icon.js +2 -1
  84. package/lib/file-item.js +3 -10
  85. package/lib/guide-link.js +1 -1
  86. package/lib/highlight-colors.js +2 -1
  87. package/lib/hotkey-scope.js +2 -1
  88. package/lib/icons/ast/build.d.ts +5 -0
  89. package/lib/icons/ast/build.js +25 -0
  90. package/lib/icons/ast/index.d.ts +2 -4
  91. package/lib/icons/ast/index.js +5 -7
  92. package/lib/icons/ast/spinner.js +8 -15
  93. package/lib/icons/icon.js +4 -3
  94. package/lib/icons/react/{plus.d.ts → build.d.ts} +4 -4
  95. package/lib/icons/react/{plus.js → build.js} +6 -6
  96. package/lib/icons/react/index.d.ts +2 -4
  97. package/lib/icons/react/index.js +5 -7
  98. package/lib/images-gallery/get-gallery-src.js +1 -1
  99. package/lib/images-gallery/slide-buttons.js +8 -4
  100. package/lib/images-gallery/thumbnails-mime-types-white-list.js +1 -1
  101. package/lib/integration-compact-info-button.js +1 -2
  102. package/lib/is-in-popup.d.ts +1 -2
  103. package/lib/is-in-popup.js +6 -0
  104. package/lib/loaders.d.ts +1 -9
  105. package/lib/loaders.js +2 -39
  106. package/lib/loaders.wyw-in-js.css +2 -4
  107. package/lib/loading-sausage.js +7 -6
  108. package/lib/mobile-drawer.d.ts +2 -1
  109. package/lib/mobile-drawer.js +24 -12
  110. package/lib/mobile-drawer.wyw-in-js.css +4 -3
  111. package/lib/mobile-keyboard-aware-popup.js +6 -5
  112. package/lib/modal-menu/contexts/modal-menu-context.d.ts +1 -0
  113. package/lib/modal-menu/modal-menu-content.d.ts +1 -1
  114. package/lib/modal-menu/modal-menu-content.js +16 -6
  115. package/lib/modal-menu/modal-menu-drawer-content.d.ts +7 -0
  116. package/lib/modal-menu/modal-menu-drawer-content.js +13 -0
  117. package/lib/modal-menu/modal-menu-root.d.ts +2 -1
  118. package/lib/modal-menu/modal-menu-root.js +24 -21
  119. package/lib/modal-menu/modal-submenu.js +10 -9
  120. package/lib/nested-menu-item.d.ts +1 -1
  121. package/lib/number-input/number-input-inline-with-autosize.d.ts +1 -2
  122. package/lib/number-input/number-input-inline-with-autosize.js +9 -6
  123. package/lib/number-input/number-input-inline-with-autosize.wyw-in-js.css +0 -1
  124. package/lib/number-input/number-input.js +13 -11
  125. package/lib/number-input/styles.d.ts +1 -9
  126. package/lib/number-input/styles.js +3 -9
  127. package/lib/number-input/styles.wyw-in-js.css +2 -3
  128. package/lib/number-input/text-area-auto-sized.d.ts +1 -2
  129. package/lib/number-input/text-area-auto-sized.js +2 -2
  130. package/lib/number-input/text-input-auto-sized.d.ts +1 -2
  131. package/lib/number-input/text-input-auto-sized.js +2 -2
  132. package/lib/online-users.js +2 -2
  133. package/lib/open-popover-tracker.js +7 -6
  134. package/lib/palettes/neutral.js +1 -1
  135. package/lib/palettes/warm.js +1 -1
  136. package/lib/phone.js +1 -1
  137. package/lib/popover/index.d.ts +9 -12
  138. package/lib/popover/index.js +66 -75
  139. package/lib/popover/mobile-popover-context.js +12 -11
  140. package/lib/popover/mobile-popover.d.ts +2 -2
  141. package/lib/popover/mobile-popover.js +16 -15
  142. package/lib/popover/modifiers.js +4 -4
  143. package/lib/popover/popup-modifiers-context.d.ts +3 -5
  144. package/lib/preference-setting.js +6 -8
  145. package/lib/reactions/reaction-button.js +36 -25
  146. package/lib/reactions/reaction-button.wyw-in-js.css +16 -16
  147. package/lib/reactions/reaction-picker.js +22 -10
  148. package/lib/reactions/reaction-picker.wyw-in-js.css +1 -0
  149. package/lib/reactions/tootltip.js +2 -1
  150. package/lib/select/components/drop-down-indicator.js +1 -1
  151. package/lib/select/components/menu-list-virtualized.js +1 -1
  152. package/lib/select/components/option.js +2 -1
  153. package/lib/select/index.d.ts +2 -1
  154. package/lib/select/select-in-popover.js +1 -1
  155. package/lib/select/select-trigger.d.ts +4 -0
  156. package/lib/select/select-trigger.js +25 -0
  157. package/lib/select/select-trigger.wyw-in-js.css +1 -0
  158. package/lib/select/select.d.ts +6 -2
  159. package/lib/select/select.js +13 -8
  160. package/lib/select/styles.js +2 -2
  161. package/lib/spinner.d.ts +5 -0
  162. package/lib/spinner.js +17 -0
  163. package/lib/spinner.wyw-in-js.css +1 -0
  164. package/lib/tab-nav/tab-nav.d.ts +4 -2
  165. package/lib/tab-nav/tab-nav.js +2 -2
  166. package/lib/thematic.js +322 -321
  167. package/lib/theme-provider.d.ts +1 -3
  168. package/lib/theme-settings-core.d.ts +13 -1
  169. package/lib/theme-settings-core.js +37 -1
  170. package/lib/theme-settings.d.ts +3 -2
  171. package/lib/theme-settings.js +7 -2
  172. package/lib/toast/toast-action.js +2 -1
  173. package/lib/toast/toast-provider.d.ts +1 -2
  174. package/lib/toast/toast-queue.d.ts +1 -2
  175. package/lib/toast/toast-queue.js +7 -8
  176. package/lib/toast/toast.js +7 -6
  177. package/lib/toggle.js +3 -3
  178. package/lib/tooltip-if-overflown.js +2 -1
  179. package/lib/tooltip.js +1 -1
  180. package/lib/type-badge.d.ts +8 -28
  181. package/lib/type-badge.js +39 -50
  182. package/lib/type-badge.wyw-in-js.css +11 -10
  183. package/lib/unit/container.d.ts +12 -0
  184. package/lib/unit/container.js +50 -0
  185. package/lib/unit/context.d.ts +29 -0
  186. package/lib/unit/context.js +9 -0
  187. package/lib/unit/index.d.ts +4 -2
  188. package/lib/unit/index.js +2 -1
  189. package/lib/unit/nav-button.d.ts +12 -0
  190. package/lib/unit/nav-button.js +18 -0
  191. package/lib/unit/styles.d.ts +6 -9
  192. package/lib/unit/styles.js +13 -16
  193. package/lib/unit/styles.wyw-in-js.css +10 -16
  194. package/lib/unit/unit-content-layout.d.ts +4 -3
  195. package/lib/unit/unit-content-layout.js +9 -9
  196. package/lib/unit/unit-content.d.ts +6 -5
  197. package/lib/unit/unit-content.js +83 -18
  198. package/lib/unit/unit-content.wyw-in-js.css +6 -2
  199. package/lib/unit/unit.d.ts +38 -5
  200. package/lib/unit/unit.js +43 -12
  201. package/lib/use-long-press.d.ts +6 -6
  202. package/lib/with-data.d.ts +35 -37
  203. package/lib/with-data.js +23 -22
  204. package/lib/workflow-progress-icon.js +2 -2
  205. package/package.json +4 -4
  206. package/lib/beta-badge.d.ts +0 -8
  207. package/lib/beta-badge.js +0 -13
  208. package/lib/beta-badge.wyw-in-js.css +0 -1
  209. package/lib/checkbox-multi-select.d.ts +0 -21
  210. package/lib/checkbox-multi-select.js +0 -41
  211. package/lib/checkbox-multi-select.wyw-in-js.css +0 -3
  212. package/lib/country-selector.d.ts +0 -9
  213. package/lib/country-selector.js +0 -21
  214. package/lib/features.d.ts +0 -8
  215. package/lib/features.js +0 -15
  216. package/lib/flags.d.ts +0 -4
  217. package/lib/flags.js +0 -7
  218. package/lib/icons/ast/alert-triangle.d.ts +0 -5
  219. package/lib/icons/ast/alert-triangle.js +0 -25
  220. package/lib/icons/ast/field-units-large.d.ts +0 -5
  221. package/lib/icons/ast/field-units-large.js +0 -25
  222. package/lib/icons/ast/plus.d.ts +0 -5
  223. package/lib/icons/ast/plus.js +0 -25
  224. package/lib/icons/react/alert-triangle.d.ts +0 -15
  225. package/lib/icons/react/alert-triangle.js +0 -21
  226. package/lib/icons/react/field-units-large.d.ts +0 -15
  227. package/lib/icons/react/field-units-large.js +0 -21
  228. package/lib/layout.d.ts +0 -28
  229. package/lib/layout.js +0 -66
  230. package/lib/layout.wyw-in-js.css +0 -2
  231. package/lib/new-card-placeholder.d.ts +0 -26
  232. package/lib/new-card-placeholder.js +0 -141
  233. package/lib/new-card-placeholder.wyw-in-js.css +0 -5
  234. package/lib/unit/primitive.d.ts +0 -5
  235. package/lib/unit/primitive.js +0 -108
  236. package/lib/unit/primitive.wyw-in-js.css +0 -3
  237. package/lib/unit/types.d.ts +0 -34
  238. package/lib/unit/types.js +0 -0
  239. package/lib/unit/unit-button-group.d.ts +0 -13
  240. package/lib/unit/unit-button-group.js +0 -23
@@ -1,2 +1,4 @@
1
- import { Unit, UnitProps, UnitSize, UnitVariant } from "./unit.js";
2
- export { Unit, type UnitProps, type UnitSize, type UnitVariant };
1
+ import { UnitChipProps, UnitSize, UnitTooltipConfig, useUnitContext } from "./context.js";
2
+ import { UnitContainerProps } from "./container.js";
3
+ import { Unit, UnitProps, UnitVariant } from "./unit.js";
4
+ export { Unit, type UnitChipProps, type UnitContainerProps, type UnitProps, type UnitSize, type UnitTooltipConfig, type UnitVariant, useUnitContext };
package/lib/unit/index.js CHANGED
@@ -1,2 +1,3 @@
1
+ import { useUnitContext } from "./context.js";
1
2
  import { Unit } from "./unit.js";
2
- export { Unit };
3
+ export { Unit, useUnitContext };
@@ -0,0 +1,12 @@
1
+ import { UnitSize } from "./context.js";
2
+ import { ReactElement, ReactNode } from "react";
3
+ //#region src/unit/nav-button.d.ts
4
+ type UnitNavButtonProps = {
5
+ children: ReactNode;
6
+ };
7
+ declare const getNavButtonSize: (size: UnitSize) => number;
8
+ declare const UnitNavButton: ({ children }: UnitNavButtonProps) => ReactElement<{
9
+ style?: React.CSSProperties;
10
+ }, string | import("react").JSXElementConstructor<any>>;
11
+ //#endregion
12
+ export { UnitNavButton, UnitNavButtonProps, getNavButtonSize };
@@ -0,0 +1,18 @@
1
+ import { space } from "../design-system/layout.js";
2
+ import { useUnitContext } from "./context.js";
3
+ import { getHeight } from "./unit-content-layout.js";
4
+ import { Children, cloneElement } from "react";
5
+ //#region src/unit/nav-button.tsx
6
+ var getNavButtonSize = (size) => getHeight(size) + 2 * space.s2;
7
+ var UnitNavButton = ({ children }) => {
8
+ const { size } = useUnitContext();
9
+ const element = Children.only(children);
10
+ const slotSize = getNavButtonSize(size);
11
+ return cloneElement(element, { style: {
12
+ ...element.props.style,
13
+ width: slotSize,
14
+ height: slotSize
15
+ } });
16
+ };
17
+ //#endregion
18
+ export { UnitNavButton, getNavButtonSize };
@@ -1,19 +1,16 @@
1
1
  //#region src/unit/styles.d.ts
2
- declare const textEllipsisClassName: import("@linaria/core").LinariaClassName;
3
2
  declare const basicUnitClassName: import("@linaria/core").LinariaClassName;
4
3
  declare const alignCenterClassName: import("@linaria/core").LinariaClassName;
5
- declare const regularTextUnitSize: number;
4
+ declare const mediumTextUnitSize: number;
6
5
  declare const smallTextUnitSize: number;
7
- declare const bigSizeUnitClassName: import("@linaria/core").LinariaClassName;
8
- declare const bigSizeUnitMinWidthClassName: import("@linaria/core").LinariaClassName;
9
- declare const regularSizeUnitClassName: import("@linaria/core").LinariaClassName;
10
- declare const regularSizeUnitMinWidthClassName: import("@linaria/core").LinariaClassName;
6
+ declare const mediumSizeCss: import("@linaria/core").LinariaClassName;
7
+ declare const mediumSizeMinWidthCss: import("@linaria/core").LinariaClassName;
8
+ declare const smallSizeCss: import("@linaria/core").LinariaClassName;
9
+ declare const smallSizeMinWidthCss: import("@linaria/core").LinariaClassName;
11
10
  declare const unitMinHeightClassName: import("@linaria/core").LinariaClassName;
12
11
  declare const invalidUnitClassName: import("@linaria/core").LinariaClassName;
13
12
  declare const clickableClassName: import("@linaria/core").LinariaClassName;
14
13
  declare const borderClassName: import("@linaria/core").LinariaClassName;
15
- declare const pillRadiusClassName: import("@linaria/core").LinariaClassName;
16
- declare const fullUnitWrapperClassName: import("@linaria/core").LinariaClassName;
17
14
  declare const positionUnitClass: import("@linaria/core").LinariaClassName;
18
15
  //#endregion
19
- export { alignCenterClassName, basicUnitClassName, bigSizeUnitClassName, bigSizeUnitMinWidthClassName, borderClassName, clickableClassName, fullUnitWrapperClassName, invalidUnitClassName, pillRadiusClassName, positionUnitClass, regularSizeUnitClassName, regularSizeUnitMinWidthClassName, regularTextUnitSize, smallTextUnitSize, textEllipsisClassName, unitMinHeightClassName };
16
+ export { alignCenterClassName, basicUnitClassName, borderClassName, clickableClassName, invalidUnitClassName, mediumSizeCss, mediumSizeMinWidthCss, mediumTextUnitSize, positionUnitClass, smallSizeCss, smallSizeMinWidthCss, smallTextUnitSize, unitMinHeightClassName };
@@ -3,21 +3,18 @@ import { space } from "../design-system/layout.js";
3
3
  import { fontSize } from "../design-system/typography.js";
4
4
  /* empty css */
5
5
  //#region src/unit/styles.ts
6
- var textEllipsisClassName = "tnbrrsv-textEllipsis";
7
- var basicUnitClassName = "b60xcpq-basicUnit";
8
- var alignCenterClassName = "au50b8v-alignCenter";
9
- var regularTextUnitSize = fontSize.sm + space.s8;
6
+ var basicUnitClassName = "bnbrrsv-basicUnit";
7
+ var alignCenterClassName = "a60xcpq-alignCenter";
8
+ var mediumTextUnitSize = fontSize.sm + space.s8;
10
9
  var smallTextUnitSize = fontSize.xs + space.s8;
11
- var bigSizeUnitClassName = "b1yn8ezw-bigSizeUnit";
12
- var bigSizeUnitMinWidthClassName = "b1v5rpy3-bigSizeUnitMinWidth";
13
- var regularSizeUnitClassName = "r45fj0l-regularSizeUnit";
14
- var regularSizeUnitMinWidthClassName = "rpdarf0-regularSizeUnitMinWidth";
15
- var unitMinHeightClassName = "ubaz4qk-unitMinHeight";
16
- var invalidUnitClassName = "i14l2yxo-invalidUnit";
17
- var clickableClassName = "c18mqj2f-clickable";
18
- var borderClassName = "b4mqgwc-border";
19
- var pillRadiusClassName = "p1ebg4ic-pillRadius";
20
- var fullUnitWrapperClassName = "f1kzkp39-fullUnitWrapper";
21
- var positionUnitClass = "prmh9nr-positionUnit";
10
+ var mediumSizeCss = "mu50b8v-mediumSize";
11
+ var mediumSizeMinWidthCss = "m1yn8ezw-mediumSizeMinWidth";
12
+ var smallSizeCss = "s1v5rpy3-smallSize";
13
+ var smallSizeMinWidthCss = "s45fj0l-smallSizeMinWidth";
14
+ var unitMinHeightClassName = "updarf0-unitMinHeight";
15
+ var invalidUnitClassName = "ibaz4qk-invalidUnit";
16
+ var clickableClassName = "c14l2yxo-clickable";
17
+ var borderClassName = "b18mqj2f-border";
18
+ var positionUnitClass = "p4mqgwc-positionUnit";
22
19
  //#endregion
23
- export { alignCenterClassName, basicUnitClassName, bigSizeUnitClassName, bigSizeUnitMinWidthClassName, borderClassName, clickableClassName, fullUnitWrapperClassName, invalidUnitClassName, pillRadiusClassName, positionUnitClass, regularSizeUnitClassName, regularSizeUnitMinWidthClassName, regularTextUnitSize, smallTextUnitSize, textEllipsisClassName, unitMinHeightClassName };
20
+ export { alignCenterClassName, basicUnitClassName, borderClassName, clickableClassName, invalidUnitClassName, mediumSizeCss, mediumSizeMinWidthCss, mediumTextUnitSize, positionUnitClass, smallSizeCss, smallSizeMinWidthCss, smallTextUnitSize, unitMinHeightClassName };
@@ -1,17 +1,11 @@
1
- .tnbrrsv-textEllipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
2
- .b60xcpq-basicUnit{border-radius:6px;border:none;}
3
- .au50b8v-alignCenter{display:flex;align-items:center;justify-content:center;line-height:0;}
4
- .b1yn8ezw-bigSizeUnit{font-family:"Inter Variable","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:14px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;letter-spacing:normal;line-height:22px;}
5
- .b1v5rpy3-bigSizeUnitMinWidth{min-width:26px;justify-content:center;}
6
- .r45fj0l-regularSizeUnit{font-family:"Inter Variable","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:12px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;line-height:20px;}
7
- .rpdarf0-regularSizeUnitMinWidth{min-width:24px;justify-content:center;}
8
- .ubaz4qk-unitMinHeight{min-height:24px;}
1
+ .bnbrrsv-basicUnit{border-radius:6px;border:none;}
2
+ .a60xcpq-alignCenter{display:flex;align-items:center;justify-content:center;line-height:0;}
3
+ .mu50b8v-mediumSize{font-family:"Inter Variable","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:14px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;letter-spacing:normal;line-height:22px;}
4
+ .m1yn8ezw-mediumSizeMinWidth{min-width:26px;justify-content:center;}
5
+ .s1v5rpy3-smallSize{font-family:"Inter Variable","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:12px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;line-height:20px;}
6
+ .s45fj0l-smallSizeMinWidth{min-width:24px;justify-content:center;}
7
+ .updarf0-unitMinHeight{min-height:24px;}
9
8
 
10
- .c18mqj2f-clickable{cursor:pointer;}
11
- .b4mqgwc-border{position:relative;}.b4mqgwc-border:focus{outline:none;}.b4mqgwc-border::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:var(--inputBorderColor) inset;mix-blend-mode:var(--inputBorderBlendMode);border-radius:6px;pointer-events:none;}.b4mqgwc-border.c18mqj2f-clickable:hover::before{box-shadow:var(--inputBorderHoverColor) inset;}.b4mqgwc-border.c18mqj2f-clickable:focus::before{box-shadow:var(--inputBorderFocusColor) inset;}.b4mqgwc-border.i14l2yxo-invalidUnit::before{box-shadow:none;border:1px solid var(--colorBorderButtonOutlineAccentDefault);}.b4mqgwc-border.i14l2yxo-invalidUnit.c18mqj2f-clickable:hover::before{box-shadow:none;border:1px solid var(--colorBorderReactionsSelectedHover);}.b4mqgwc-border.i14l2yxo-invalidUnit.c18mqj2f-clickable:focus::before{box-shadow:var(--inputBorderFocusColor) inset;border:none;}
12
- .p1ebg4ic-pillRadius{border-radius:16px;}.p1ebg4ic-pillRadius::before{border-radius:16px;box-shadow:var(--inputBorderColorThin) inset;}.p1ebg4ic-pillRadius.c18mqj2f-clickable:hover{background-image:linear-gradient(
13
- var(--colorBgButtonGhostNeutralHover),
14
- var(--colorBgButtonGhostNeutralHover)
15
- );}.p1ebg4ic-pillRadius.c18mqj2f-clickable:hover::before{box-shadow:var(--inputBorderHoverColorThin) inset;}.p1ebg4ic-pillRadius.c18mqj2f-clickable:focus::before{box-shadow:var(--inputBorderFocusColorThin) inset;}
16
- .f1kzkp39-fullUnitWrapper{display:flex;align-items:center;padding:6px;border-radius:6px;background-color:var(--cardBg);margin-bottom:4px;}
17
- .prmh9nr-positionUnit{line-height:0;position:relative;}
9
+ .c14l2yxo-clickable{cursor:pointer;}
10
+ .b18mqj2f-border{position:relative;}.b18mqj2f-border:focus{outline:none;}.b18mqj2f-border::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:var(--inputBorderColor) inset;mix-blend-mode:var(--inputBorderBlendMode);border-radius:6px;pointer-events:none;}.b18mqj2f-border.c14l2yxo-clickable:hover::before{box-shadow:var(--inputBorderHoverColor) inset;}.b18mqj2f-border.c14l2yxo-clickable:focus::before{box-shadow:var(--inputBorderFocusColor) inset;}.b18mqj2f-border.ibaz4qk-invalidUnit::before{box-shadow:none;border:1px solid var(--colorBorderButtonOutlineAccentDefault);}.b18mqj2f-border.ibaz4qk-invalidUnit.c14l2yxo-clickable:hover::before{box-shadow:none;border:1px solid var(--colorBorderReactionsSelectedHover);}.b18mqj2f-border.ibaz4qk-invalidUnit.c14l2yxo-clickable:focus::before{box-shadow:var(--inputBorderFocusColor) inset;border:none;}
11
+ .p4mqgwc-positionUnit{line-height:0;position:relative;}
@@ -1,11 +1,12 @@
1
+ import { UnitSize } from "./context.js";
1
2
  //#region src/unit/unit-content-layout.d.ts
2
3
  type Props = {
3
- big: boolean;
4
- iconsLength: number;
4
+ size: UnitSize;
5
+ hasIcon: boolean;
5
6
  hasChildren: boolean;
6
7
  shrinkable?: boolean;
7
8
  };
8
- declare const getHeight: (big: boolean) => number;
9
+ declare const getHeight: (size: UnitSize) => number;
9
10
  declare const UnitContentLayout: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Props>;
10
11
  //#endregion
11
12
  export { UnitContentLayout, getHeight };
@@ -1,19 +1,19 @@
1
1
  import "./unit-content-layout.wyw-in-js.css";
2
- import { regularTextUnitSize, smallTextUnitSize } from "./styles.js";
2
+ import { mediumTextUnitSize, smallTextUnitSize } from "./styles.js";
3
3
  /* empty css */
4
4
  import { styled } from "@linaria/react";
5
5
  //#region src/unit/unit-content-layout.tsx
6
- var getHeight = (big) => {
7
- return big ? regularTextUnitSize : smallTextUnitSize;
6
+ var getHeight = (size) => {
7
+ return size === "medium" ? mediumTextUnitSize : smallTextUnitSize;
8
8
  };
9
- var getUnitGridTemplateRows = ({ big, iconsLength }) => {
10
- if (iconsLength === 0) return "auto";
11
- return `minmax(${getHeight(big)}px, max-content)`;
9
+ var getUnitGridTemplateRows = ({ size, hasIcon }) => {
10
+ if (!hasIcon) return "auto";
11
+ return `minmax(${getHeight(size)}px, max-content)`;
12
12
  };
13
- var getUnitGridTemplateColumns = ({ big, iconsLength, shrinkable = true, hasChildren }) => {
13
+ var getUnitGridTemplateColumns = ({ size, hasIcon, shrinkable = true, hasChildren }) => {
14
14
  const fitContent = "fit-content(200px)";
15
- if (iconsLength === 0) return shrinkable ? "auto" : fitContent;
16
- return `repeat(${iconsLength}, minmax(${getHeight(big)}px, max-content)) ${hasChildren ? shrinkable ? `minmax(auto, 1fr)` : fitContent : ""}`;
15
+ if (!hasIcon) return shrinkable ? "auto" : fitContent;
16
+ return `minmax(${getHeight(size)}px, max-content) ${hasChildren ? shrinkable ? `minmax(auto, 1fr)` : fitContent : ""}`;
17
17
  };
18
18
  var _exp2 = () => getUnitGridTemplateRows;
19
19
  var _exp3 = () => getUnitGridTemplateColumns;
@@ -1,13 +1,14 @@
1
- import { ReactNode } from "react";
1
+ import { KeyboardEvent, ReactNode } from "react";
2
2
  //#region src/unit/unit-content.d.ts
3
3
  type Props = {
4
- big: boolean;
5
- icons?: React.ReactNode[];
4
+ button?: boolean;
5
+ icon?: ReactNode;
6
6
  shrinkable?: boolean;
7
7
  truncate?: boolean;
8
- setNode?: (element: HTMLElement | null) => void;
8
+ onClick?: (e: React.MouseEvent<HTMLElement>) => void;
9
+ onKeyDown?: (e: KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => void;
9
10
  children?: ReactNode;
10
11
  };
11
- declare const UnitContent: ({ big, icons, shrinkable, truncate, setNode, children }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ declare const UnitContent: ({ button, icon, shrinkable, truncate, onClick, onKeyDown, children }: Props) => import("react/jsx-runtime").JSX.Element;
12
13
  //#endregion
13
14
  export { UnitContent };
@@ -1,29 +1,94 @@
1
1
  import "./unit-content.wyw-in-js.css";
2
- import { alignCenterClassName } from "./styles.js";
2
+ import { themeVars } from "../theming.generated.js";
3
+ import { Tooltip } from "../tooltip.js";
4
+ import { useTruncated } from "../tooltip-if-overflown.js";
5
+ import "../styles-utils.js";
6
+ import { FieldIcon } from "../field-icon.js";
7
+ import { useUnitContext } from "./context.js";
8
+ import "./styles.js";
9
+ import { UnitContainer } from "./container.js";
3
10
  import { UnitContentLayout } from "./unit-content-layout.js";
4
11
  /* empty css */
5
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
+ import { forwardRef } from "react";
6
14
  import { cx } from "@linaria/core";
7
15
  //#region src/unit/unit-content.tsx
8
- var contentContainerCss = "c96bd8z-contentContainer";
9
- var contentCss = "ccx18o4-content";
10
- var UnitContent = ({ big, icons, shrinkable, truncate, setNode, children }) => {
11
- return /* @__PURE__ */ jsxs(UnitContentLayout, {
12
- big,
13
- hasChildren: Boolean(children),
14
- iconsLength: icons ? icons.length : 0,
15
- shrinkable,
16
- children: [icons ? icons.map((icon, index) => /* @__PURE__ */ jsx("div", {
17
- className: alignCenterClassName,
18
- children: icon
19
- }, index)) : null, children && /* @__PURE__ */ jsx("div", {
20
- className: contentContainerCss,
21
- children: /* @__PURE__ */ jsx("div", {
22
- ref: setNode,
23
- className: cx(contentCss, truncate && "tnbrrsv-textEllipsis"),
16
+ var resetButtonStylesCss = "r96bd8z-resetButtonStyles";
17
+ var ButtonComponent = forwardRef((props, ref) => {
18
+ return /* @__PURE__ */ jsx("button", {
19
+ ref,
20
+ type: "button",
21
+ ...props,
22
+ className: cx(props.className, resetButtonStylesCss)
23
+ });
24
+ });
25
+ var DivComponent = forwardRef((props, ref) => /* @__PURE__ */ jsx("div", {
26
+ ref,
27
+ ...props
28
+ }));
29
+ var contentContainerCss = "ccx18o4-contentContainer";
30
+ var contentCss = "c1l394rk-content";
31
+ var unitDescriptionCss = "u1he4b8w-unitDescription";
32
+ var fullUnitPreviewCss = "fcmj1jm-fullUnitPreview";
33
+ var tooltipTitleCss = "tum1nu9-tooltipTitle";
34
+ var UnitContent = ({ button = false, icon, shrinkable, truncate, onClick, onKeyDown, children }) => {
35
+ const { size, chipProps, tooltip } = useUnitContext();
36
+ const { truncated, setNode } = useTruncated();
37
+ const body = /* @__PURE__ */ jsx(button ? ButtonComponent : DivComponent, {
38
+ onClick,
39
+ onKeyDown,
40
+ children: jsxs(UnitContentLayout, {
41
+ size,
42
+ hasChildren: Boolean(children),
43
+ hasIcon: Boolean(icon),
44
+ shrinkable,
45
+ children: [icon && /* @__PURE__ */ jsx("div", {
46
+ className: "a60xcpq-alignCenter",
47
+ children: icon
48
+ }), children && /* @__PURE__ */ jsx("div", {
49
+ className: contentContainerCss,
50
+ children: /* @__PURE__ */ jsx("div", {
51
+ ref: tooltip ? setNode : void 0,
52
+ className: cx(contentCss, truncate && "e190sqpi-ellipsis"),
53
+ children
54
+ })
55
+ })]
56
+ })
57
+ });
58
+ if (!tooltip) return body;
59
+ const { title, fieldIcon, description, hint } = tooltip;
60
+ const tooltipTitle = /* @__PURE__ */ jsxs("div", {
61
+ className: tooltipTitleCss,
62
+ children: [fieldIcon && /* @__PURE__ */ jsx(FieldIcon, {
63
+ iconName: fieldIcon,
64
+ iconSize: 14,
65
+ color: themeVars.whiteColor
66
+ }), title]
67
+ });
68
+ const preview = truncated && /* @__PURE__ */ jsx("div", {
69
+ className: fullUnitPreviewCss,
70
+ children: jsx(UnitContainer, {
71
+ ...chipProps,
72
+ children: /* @__PURE__ */ jsx(UnitContent, {
73
+ icon,
24
74
  children
25
75
  })
26
- })]
76
+ })
77
+ });
78
+ return /* @__PURE__ */ jsx(Tooltip, {
79
+ side: "bottom",
80
+ align: "start",
81
+ openOnFocus: false,
82
+ title: tooltipTitle,
83
+ description: (description || preview || hint) && /* @__PURE__ */ jsxs("div", { children: [
84
+ description && /* @__PURE__ */ jsx("div", {
85
+ className: unitDescriptionCss,
86
+ children: description
87
+ }),
88
+ preview,
89
+ hint
90
+ ] }),
91
+ children: body
27
92
  });
28
93
  };
29
94
  //#endregion
@@ -1,2 +1,6 @@
1
- .c96bd8z-contentContainer{overflow:hidden;}
2
- .ccx18o4-content{padding-left:4px;padding-right:4px;}
1
+ .r96bd8z-resetButtonStyles{all:unset;background-color:var(--transparent);--input-focus-border:0 0 0 1px var(--colorAccentStrokeFocus) inset;--input-focus-shadow:0 0 0 2px var(--colorAccentStroke);border-radius:6px;}.r96bd8z-resetButtonStyles:focus{outline:none;box-shadow:var(--input-focus-border, 0 0 0 1px var(--colorAccentStroke)),var(--input-focus-shadow)!important;transition:box-shadow 120ms ease-in-out;}.r96bd8z-resetButtonStyles:focus:not(:focus-visible){outline:none;box-shadow:none!important;}.r96bd8z-resetButtonStyles:focus-visible{outline:none;box-shadow:var(--input-focus-border, 0 0 0 1px var(--colorAccentStroke)),var(--input-focus-shadow)!important;transition:box-shadow 120ms ease-in-out;}
2
+ .ccx18o4-contentContainer{overflow:hidden;}
3
+ .c1l394rk-content{padding-left:4px;padding-right:4px;}
4
+ .u1he4b8w-unitDescription{margin-bottom:1px;}
5
+ .fcmj1jm-fullUnitPreview{display:flex;align-items:center;padding:6px;border-radius:6px;background-color:var(--cardBg);margin-top:4px;margin-bottom:4px;}
6
+ .tum1nu9-tooltipTitle{display:flex;align-items:center;gap:4px;}
@@ -1,12 +1,45 @@
1
- import { UnitPrimitiveProps } from "./types.js";
1
+ import { UnitSize } from "./context.js";
2
+ import { UnitContainer } from "./container.js";
3
+ import { UnitNavButton } from "./nav-button.js";
4
+ import { UnitContent } from "./unit-content.js";
5
+ import { KeyboardEvent, ReactNode } from "react";
2
6
  //#region src/unit/unit.d.ts
3
7
  type UnitVariant = "outlined" | "plain";
4
- type UnitSize = "small" | "medium";
5
- type UnitProps = Omit<UnitPrimitiveProps, "big"> & {
8
+ type UnitProps = {
6
9
  variant?: UnitVariant;
7
10
  size?: UnitSize;
8
11
  readOnly?: boolean;
12
+ overflow?: boolean;
13
+ inline?: boolean;
14
+ button?: boolean;
15
+ multiline?: boolean;
16
+ children?: ReactNode;
17
+ title?: ReactNode;
18
+ fieldIcon?: string;
19
+ description?: ReactNode;
20
+ icon?: ReactNode;
21
+ hint?: ReactNode;
22
+ navButton?: ReactNode;
23
+ tooltip?: boolean;
24
+ /** Render the field label above the value (full-size presentation). */
25
+ withLabel?: boolean;
26
+ border?: boolean;
27
+ color?: string;
28
+ bgColor?: string | null;
29
+ fontWeight?: number;
30
+ shrinkable?: boolean;
31
+ clickable?: boolean;
32
+ setMinWidth?: boolean;
33
+ setMinHeight?: boolean;
34
+ onKeyDown?: (e: KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => void;
35
+ onClick?: (e: React.MouseEvent<HTMLElement>) => void;
36
+ invalid?: boolean;
37
+ };
38
+ declare const UnitComponent: ({ variant, size, readOnly, overflow, inline, button, multiline, children, title, fieldIcon, description, hint, icon, navButton, tooltip, withLabel, border, color, bgColor, fontWeight, shrinkable, clickable, setMinWidth, setMinHeight, onClick, onKeyDown, invalid }: UnitProps) => import("react/jsx-runtime").JSX.Element;
39
+ declare const Unit: typeof UnitComponent & {
40
+ Container: typeof UnitContainer;
41
+ Content: typeof UnitContent;
42
+ NavButton: typeof UnitNavButton;
9
43
  };
10
- declare const Unit: ({ variant, size, readOnly, withLabel, invalid, color, bgColor, border, button, clickable, onClick, ...rest }: UnitProps) => import("react/jsx-runtime").JSX.Element;
11
44
  //#endregion
12
- export { Unit, UnitProps, UnitSize, UnitVariant };
45
+ export { Unit, UnitProps, type UnitSize, UnitVariant };
package/lib/unit/unit.js CHANGED
@@ -1,22 +1,53 @@
1
1
  import { themeVars } from "../theming.generated.js";
2
- import { UnitPrimitive } from "./primitive.js";
3
- import { jsx } from "react/jsx-runtime";
2
+ import { positionUnitClass } from "./styles.js";
3
+ import { UnitContainer } from "./container.js";
4
+ import { LabeledUnit } from "./labeled-unit.js";
5
+ import { UnitNavButton } from "./nav-button.js";
6
+ import { UnitContent } from "./unit-content.js";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
4
8
  //#region src/unit/unit.tsx
5
9
  var getVariantBgColor = (variant, readOnly) => variant === "outlined" && readOnly ? themeVars.inputDisabledBgColor : themeVars.transparent;
6
- var Unit = ({ variant = "outlined", size = "small", readOnly = false, withLabel = false, invalid, color, bgColor, border, button, clickable, onClick, ...rest }) => {
10
+ var UnitComponent = ({ variant = "outlined", size = "small", readOnly = false, overflow = true, inline = true, button, multiline = false, children, title, fieldIcon, description = null, hint = null, icon, navButton, tooltip = true, withLabel = false, border, color = themeVars.textColor, bgColor, fontWeight, shrinkable = true, clickable, setMinWidth = true, setMinHeight = true, onClick, onKeyDown, invalid }) => {
7
11
  const interactive = variant === "outlined" && !readOnly;
8
- return /* @__PURE__ */ jsx(UnitPrimitive, {
9
- ...rest,
10
- big: size === "medium",
11
- border: border ?? (variant === "outlined" && !readOnly),
12
- bgColor: bgColor ?? getVariantBgColor(variant, readOnly),
13
- button: button ?? (interactive || Boolean(onClick)),
14
- clickable: clickable ?? interactive,
15
- withLabel,
12
+ const content = /* @__PURE__ */ jsxs(UnitContainer, {
13
+ size,
14
+ inline,
15
+ border: border ?? interactive,
16
16
  invalid,
17
+ clickable: clickable ?? interactive,
18
+ setMinWidth,
19
+ setMinHeight,
17
20
  color,
18
- onClick
21
+ bgColor: bgColor ?? getVariantBgColor(variant, readOnly),
22
+ fontWeight,
23
+ tooltip: tooltip ? {
24
+ title,
25
+ fieldIcon,
26
+ description,
27
+ hint
28
+ } : void 0,
29
+ children: [/* @__PURE__ */ jsx(UnitContent, {
30
+ button: button ?? (interactive || Boolean(onClick)),
31
+ icon,
32
+ shrinkable,
33
+ truncate: !multiline && overflow,
34
+ onClick,
35
+ onKeyDown,
36
+ children
37
+ }), navButton && /* @__PURE__ */ jsx(UnitNavButton, { children: navButton })]
38
+ });
39
+ return /* @__PURE__ */ jsx("div", {
40
+ className: positionUnitClass,
41
+ children: withLabel ? /* @__PURE__ */ jsx(LabeledUnit, {
42
+ label: title,
43
+ children: content
44
+ }) : content
19
45
  });
20
46
  };
47
+ var Unit = Object.assign(UnitComponent, {
48
+ Container: UnitContainer,
49
+ Content: UnitContent,
50
+ NavButton: UnitNavButton
51
+ });
21
52
  //#endregion
22
53
  export { Unit };
@@ -1,4 +1,4 @@
1
- import { $TSFixMe } from "./tsfixme.js";
1
+ import { MouseEvent, TouchEvent } from "react";
2
2
  //#region src/use-long-press.d.ts
3
3
  declare function off<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T["removeEventListener"]> | [string, Function | null, ...any]): void;
4
4
  interface Options {
@@ -6,11 +6,11 @@ interface Options {
6
6
  delay?: number;
7
7
  }
8
8
  declare const useLongPress: (callback: (e: TouchEvent | MouseEvent) => void, { isPreventDefault, delay }?: Options) => {
9
- readonly onMouseDown: (e: $TSFixMe) => void;
10
- readonly onTouchStart: (e: $TSFixMe) => void;
11
- readonly onMouseUp: (e: $TSFixMe) => void;
12
- readonly onMouseLeave: (e: $TSFixMe) => void;
13
- readonly onTouchEnd: (e: $TSFixMe) => void;
9
+ readonly onMouseDown: (e: MouseEvent) => void;
10
+ readonly onTouchStart: (e: TouchEvent) => void;
11
+ readonly onMouseUp: (e: TouchEvent | MouseEvent) => void;
12
+ readonly onMouseLeave: (e: TouchEvent | MouseEvent) => void;
13
+ readonly onTouchEnd: (e: TouchEvent | MouseEvent) => void;
14
14
  };
15
15
  //#endregion
16
16
  export { off, useLongPress };
@@ -1,76 +1,74 @@
1
- import { $TSFixMe } from "./tsfixme.js";
2
1
  import { ComponentType } from "react";
3
2
  //#region src/with-data.d.ts
4
- type FetchState = {
3
+ type FetchState<Value = unknown> = {
5
4
  fetchState: ":fetch-state/start";
6
5
  fetchError: null;
7
6
  fetchValue: null;
8
7
  } | {
9
8
  fetchState: ":fetch-state/success";
10
- fetchValue: $TSFixMe;
9
+ fetchValue: Value;
11
10
  fetchError: null;
12
11
  } | {
13
12
  fetchState: ":fetch-state/error";
14
13
  fetchError: Error;
15
14
  fetchValue: null;
16
15
  };
17
- type ProvidedState = Record<string, FetchState>;
18
- declare function provideData<T>({ sources }: {
19
- sources: Record<string, () => Promise<$TSFixMe>>;
20
- }): (Component: ComponentType<T & ProvidedState>) => {
21
- new (props: T): {
22
- state: {
23
- [x: string]: FetchState;
24
- };
25
- _prefetch: (key: string, fetch: () => Promise<$TSFixMe>) => Promise<void>;
16
+ type DataSources = Record<string, () => Promise<unknown>>;
17
+ type ProvidedState<Sources extends DataSources> = { [Key in keyof Sources]: FetchState<Awaited<ReturnType<Sources[Key]>>>; };
18
+ declare function provideData<Sources extends DataSources>({ sources }: {
19
+ sources: Sources;
20
+ }): <OwnProps extends object>(Component: ComponentType<OwnProps & ProvidedState<Sources>>) => {
21
+ new (props: OwnProps): {
22
+ state: ProvidedState<Sources>;
23
+ _prefetch: <Key extends keyof Sources>(key: Key, fetch: Sources[Key]) => Promise<void>;
24
+ setSourceState<Key extends keyof Sources>(key: Key, value: ProvidedState<Sources>[Key]): void;
26
25
  componentDidMount(): void;
27
- setStateIfMounted(updater: (prevState: ProvidedState) => ProvidedState): void;
26
+ setStateIfMounted(updater: (prevState: ProvidedState<Sources>) => ProvidedState<Sources>): void;
28
27
  componentWillUnmount(): void;
29
28
  render(): import("react/jsx-runtime").JSX.Element;
30
29
  context: unknown;
31
- setState<K extends string>(state: Pick<ProvidedState, K> | ProvidedState | ((prevState: Readonly<ProvidedState>, props: Readonly<T>) => Pick<ProvidedState, K> | ProvidedState | null) | null, callback?: (() => void) | undefined): void;
30
+ setState<K extends keyof Sources>(state: Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | ((prevState: Readonly<ProvidedState<Sources>>, props: Readonly<OwnProps>) => Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | null) | null, callback?: (() => void) | undefined): void;
32
31
  forceUpdate(callback?: (() => void) | undefined): void;
33
- readonly props: Readonly<T>;
32
+ readonly props: Readonly<OwnProps>;
34
33
  refs: {
35
34
  [key: string]: import("react").ReactInstance;
36
35
  };
37
- shouldComponentUpdate?(nextProps: Readonly<T>, nextState: Readonly<ProvidedState>, nextContext: any): boolean;
36
+ shouldComponentUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): boolean;
38
37
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
39
- getSnapshotBeforeUpdate?(prevProps: Readonly<T>, prevState: Readonly<ProvidedState>): any;
40
- componentDidUpdate?(prevProps: Readonly<T>, prevState: Readonly<ProvidedState>, snapshot?: any): void;
38
+ getSnapshotBeforeUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>): any;
39
+ componentDidUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>, snapshot?: any): void;
41
40
  componentWillMount?(): void;
42
41
  UNSAFE_componentWillMount?(): void;
43
- componentWillReceiveProps?(nextProps: Readonly<T>, nextContext: any): void;
44
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<T>, nextContext: any): void;
45
- componentWillUpdate?(nextProps: Readonly<T>, nextState: Readonly<ProvidedState>, nextContext: any): void;
46
- UNSAFE_componentWillUpdate?(nextProps: Readonly<T>, nextState: Readonly<ProvidedState>, nextContext: any): void;
42
+ componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
43
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
44
+ componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
45
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
47
46
  };
48
- new (props: T, context: any): {
49
- state: {
50
- [x: string]: FetchState;
51
- };
52
- _prefetch: (key: string, fetch: () => Promise<$TSFixMe>) => Promise<void>;
47
+ new (props: OwnProps, context: any): {
48
+ state: ProvidedState<Sources>;
49
+ _prefetch: <Key extends keyof Sources>(key: Key, fetch: Sources[Key]) => Promise<void>;
50
+ setSourceState<Key extends keyof Sources>(key: Key, value: ProvidedState<Sources>[Key]): void;
53
51
  componentDidMount(): void;
54
- setStateIfMounted(updater: (prevState: ProvidedState) => ProvidedState): void;
52
+ setStateIfMounted(updater: (prevState: ProvidedState<Sources>) => ProvidedState<Sources>): void;
55
53
  componentWillUnmount(): void;
56
54
  render(): import("react/jsx-runtime").JSX.Element;
57
55
  context: unknown;
58
- setState<K extends string>(state: Pick<ProvidedState, K> | ProvidedState | ((prevState: Readonly<ProvidedState>, props: Readonly<T>) => Pick<ProvidedState, K> | ProvidedState | null) | null, callback?: (() => void) | undefined): void;
56
+ setState<K extends keyof Sources>(state: Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | ((prevState: Readonly<ProvidedState<Sources>>, props: Readonly<OwnProps>) => Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | null) | null, callback?: (() => void) | undefined): void;
59
57
  forceUpdate(callback?: (() => void) | undefined): void;
60
- readonly props: Readonly<T>;
58
+ readonly props: Readonly<OwnProps>;
61
59
  refs: {
62
60
  [key: string]: import("react").ReactInstance;
63
61
  };
64
- shouldComponentUpdate?(nextProps: Readonly<T>, nextState: Readonly<ProvidedState>, nextContext: any): boolean;
62
+ shouldComponentUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): boolean;
65
63
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
66
- getSnapshotBeforeUpdate?(prevProps: Readonly<T>, prevState: Readonly<ProvidedState>): any;
67
- componentDidUpdate?(prevProps: Readonly<T>, prevState: Readonly<ProvidedState>, snapshot?: any): void;
64
+ getSnapshotBeforeUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>): any;
65
+ componentDidUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>, snapshot?: any): void;
68
66
  componentWillMount?(): void;
69
67
  UNSAFE_componentWillMount?(): void;
70
- componentWillReceiveProps?(nextProps: Readonly<T>, nextContext: any): void;
71
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<T>, nextContext: any): void;
72
- componentWillUpdate?(nextProps: Readonly<T>, nextState: Readonly<ProvidedState>, nextContext: any): void;
73
- UNSAFE_componentWillUpdate?(nextProps: Readonly<T>, nextState: Readonly<ProvidedState>, nextContext: any): void;
68
+ componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
69
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
70
+ componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
71
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
74
72
  };
75
73
  contextType?: import("react").Context<any> | undefined;
76
74
  };