@fibery/ui-kit 9.0.2 → 9.1.1

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 (189) hide show
  1. package/lib/a11y-color.js +12 -10
  2. package/lib/actions-menu/actions-menu-props.d.ts +2 -0
  3. package/lib/actions-menu/actions-menu-sub-command-menu.js +5 -4
  4. package/lib/actions-menu/actions-menu.d.ts +1 -1
  5. package/lib/actions-menu/actions-menu.js +2 -1
  6. package/lib/actions-menu/contexts/actions-menu-context.js +12 -11
  7. package/lib/ai/max-tokens.js +6 -5
  8. package/lib/antd/ant-modal.d.ts +1 -1
  9. package/lib/antd/ant-modal.js +28 -1
  10. package/lib/antd/ant-upload.d.ts +1 -1
  11. package/lib/antd/ant-upload.js +23 -18
  12. package/lib/antd/input.js +5 -4
  13. package/lib/antd/utils.js +2 -1
  14. package/lib/avatar-colors.js +1 -1
  15. package/lib/avatar.d.ts +1 -10
  16. package/lib/avatar.js +48 -38
  17. package/lib/avatar.wyw-in-js.css +1 -1
  18. package/lib/banner/banner-action.js +2 -1
  19. package/lib/button/button.js +1 -1
  20. package/lib/button/icon-button.js +1 -1
  21. package/lib/canvas-colors.js +2 -2
  22. package/lib/card-container.d.ts +2 -6
  23. package/lib/card-container.js +4 -4
  24. package/lib/color-filter.js +2 -2
  25. package/lib/color-inspect.js +1 -1
  26. package/lib/color-picker/color-picker-or-loader.d.ts +2 -2
  27. package/lib/color-utils.js +1 -1
  28. package/lib/comment.d.ts +2 -1
  29. package/lib/comment.js +44 -27
  30. package/lib/comment.wyw-in-js.css +11 -8
  31. package/lib/context-menu/index.js +1 -0
  32. package/lib/context-menu/index.wyw-in-js.css +1 -1
  33. package/lib/date-picker/autocomplete.js +12 -10
  34. package/lib/date-picker/date-range-input.js +8 -6
  35. package/lib/date-picker/day-with-start-end-buttons.js +0 -2
  36. package/lib/date-picker/get-weekends-for-month.js +4 -2
  37. package/lib/date-picker/single-date-input.js +8 -6
  38. package/lib/day-select/day-select.js +2 -1
  39. package/lib/day-select/week-day-select.d.ts +2 -2
  40. package/lib/day-select/week-day-select.js +4 -3
  41. package/lib/design-system/alpha.js +5 -7
  42. package/lib/design-system/colors-charts.d.ts +4 -0
  43. package/lib/design-system/colors-charts.js +14 -0
  44. package/lib/design-system/colors-js.d.ts +2 -4
  45. package/lib/design-system/colors-js.js +8 -10
  46. package/lib/design-system/fns.enum.js +7 -4
  47. package/lib/design-system/fns.icon.js +1 -1
  48. package/lib/design-system/fns.js +7 -4
  49. package/lib/design-system/theme.d.ts +7 -7
  50. package/lib/design-system/theme.js +7 -12
  51. package/lib/design-system/vars.js +1 -2
  52. package/lib/design-system.d.ts +3 -2
  53. package/lib/design-system.js +3 -2
  54. package/lib/emoji-picker/primitives/content.js +10 -9
  55. package/lib/emoji-picker/primitives/emoji.js +22 -14
  56. package/lib/emoji-picker/primitives/emoji.wyw-in-js.css +4 -3
  57. package/lib/emoji-picker/primitives/grid.js +0 -1
  58. package/lib/emoji-picker/primitives/preview-provider.js +4 -3
  59. package/lib/emoji-picker/primitives/root.js +10 -9
  60. package/lib/emoji-picker/primitives/skin-provider.js +5 -4
  61. package/lib/emoji-picker/stores/emoji-data-store.d.ts +2 -2
  62. package/lib/emoji-picker/stores/emoji-data-store.js +8 -8
  63. package/lib/emoji-picker/stores/static-emoji-data-store.js +2 -1
  64. package/lib/emoji.js +5 -2
  65. package/lib/fibermoji-placeholder.js +5 -7
  66. package/lib/field-type-icon.js +2 -1
  67. package/lib/file-item/file-icon.js +2 -1
  68. package/lib/file-item.js +3 -10
  69. package/lib/highlight-colors.js +2 -1
  70. package/lib/hotkey-scope.js +2 -1
  71. package/lib/icons/ast/index.d.ts +1 -4
  72. package/lib/icons/ast/index.js +2 -5
  73. package/lib/icons/ast/spinner.js +1 -14
  74. package/lib/icons/icon.js +4 -3
  75. package/lib/icons/react/index.d.ts +1 -4
  76. package/lib/icons/react/index.js +2 -5
  77. package/lib/images-gallery/get-gallery-src.js +1 -1
  78. package/lib/images-gallery/slide-buttons.js +8 -4
  79. package/lib/images-gallery/thumbnails-mime-types-white-list.js +1 -1
  80. package/lib/integration-compact-info-button.js +1 -1
  81. package/lib/loading-sausage.js +7 -6
  82. package/lib/mobile-drawer.d.ts +2 -1
  83. package/lib/mobile-drawer.js +24 -12
  84. package/lib/mobile-drawer.wyw-in-js.css +3 -2
  85. package/lib/mobile-keyboard-aware-popup.js +6 -5
  86. package/lib/modal-menu/contexts/modal-menu-context.d.ts +1 -0
  87. package/lib/modal-menu/modal-menu-content.d.ts +1 -1
  88. package/lib/modal-menu/modal-menu-content.js +16 -6
  89. package/lib/modal-menu/modal-menu-drawer-content.d.ts +7 -0
  90. package/lib/modal-menu/modal-menu-drawer-content.js +13 -0
  91. package/lib/modal-menu/modal-menu-root.d.ts +2 -1
  92. package/lib/modal-menu/modal-menu-root.js +24 -21
  93. package/lib/modal-menu/modal-submenu.js +10 -9
  94. package/lib/nested-menu-item.d.ts +1 -1
  95. package/lib/number-input/number-input-inline-with-autosize.d.ts +1 -2
  96. package/lib/number-input/number-input-inline-with-autosize.js +9 -6
  97. package/lib/number-input/number-input-inline-with-autosize.wyw-in-js.css +0 -1
  98. package/lib/number-input/number-input.js +13 -11
  99. package/lib/number-input/styles.d.ts +1 -9
  100. package/lib/number-input/styles.js +3 -9
  101. package/lib/number-input/styles.wyw-in-js.css +2 -3
  102. package/lib/number-input/text-area-auto-sized.d.ts +1 -2
  103. package/lib/number-input/text-area-auto-sized.js +2 -2
  104. package/lib/number-input/text-input-auto-sized.d.ts +1 -2
  105. package/lib/number-input/text-input-auto-sized.js +2 -2
  106. package/lib/online-users.js +2 -2
  107. package/lib/open-popover-tracker.js +7 -6
  108. package/lib/palettes/neutral.js +1 -1
  109. package/lib/palettes/warm.js +1 -1
  110. package/lib/phone.js +1 -1
  111. package/lib/popover/index.d.ts +4 -2
  112. package/lib/popover/index.js +61 -59
  113. package/lib/popover/mobile-popover-context.js +12 -11
  114. package/lib/popover/mobile-popover.js +16 -15
  115. package/lib/popover/modifiers.js +4 -4
  116. package/lib/preference-setting.js +6 -8
  117. package/lib/reactions/reaction-button.js +36 -25
  118. package/lib/reactions/reaction-button.wyw-in-js.css +16 -16
  119. package/lib/reactions/reaction-picker.js +22 -10
  120. package/lib/reactions/reaction-picker.wyw-in-js.css +1 -0
  121. package/lib/reactions/tootltip.js +2 -1
  122. package/lib/select/components/option.js +2 -1
  123. package/lib/select/index.d.ts +2 -1
  124. package/lib/select/select-trigger.d.ts +4 -0
  125. package/lib/select/select-trigger.js +25 -0
  126. package/lib/select/select-trigger.wyw-in-js.css +1 -0
  127. package/lib/select/select.d.ts +6 -2
  128. package/lib/select/select.js +10 -5
  129. package/lib/spinner.d.ts +2 -6
  130. package/lib/spinner.js +11 -7
  131. package/lib/spinner.wyw-in-js.css +1 -0
  132. package/lib/tab-nav/tab-nav.d.ts +4 -2
  133. package/lib/tab-nav/tab-nav.js +2 -2
  134. package/lib/thematic.js +322 -321
  135. package/lib/theme-provider.d.ts +1 -3
  136. package/lib/toast/toast-action.js +2 -1
  137. package/lib/toast/toast-provider.d.ts +1 -2
  138. package/lib/toast/toast-queue.d.ts +1 -2
  139. package/lib/toast/toast-queue.js +7 -8
  140. package/lib/toast/toast.js +7 -6
  141. package/lib/toggle.js +3 -3
  142. package/lib/tooltip-if-overflown.js +2 -1
  143. package/lib/tooltip.js +1 -1
  144. package/lib/type-badge.d.ts +8 -28
  145. package/lib/type-badge.js +39 -50
  146. package/lib/type-badge.wyw-in-js.css +11 -10
  147. package/lib/unit/container.d.ts +12 -0
  148. package/lib/unit/container.js +50 -0
  149. package/lib/unit/context.d.ts +29 -0
  150. package/lib/unit/context.js +9 -0
  151. package/lib/unit/index.d.ts +4 -2
  152. package/lib/unit/index.js +2 -1
  153. package/lib/unit/nav-button.d.ts +12 -0
  154. package/lib/unit/nav-button.js +18 -0
  155. package/lib/unit/styles.d.ts +6 -9
  156. package/lib/unit/styles.js +13 -16
  157. package/lib/unit/styles.wyw-in-js.css +10 -16
  158. package/lib/unit/unit-content-layout.d.ts +4 -3
  159. package/lib/unit/unit-content-layout.js +9 -9
  160. package/lib/unit/unit-content.d.ts +6 -5
  161. package/lib/unit/unit-content.js +83 -18
  162. package/lib/unit/unit-content.wyw-in-js.css +6 -2
  163. package/lib/unit/unit.d.ts +38 -5
  164. package/lib/unit/unit.js +43 -12
  165. package/lib/workflow-progress-icon.js +2 -2
  166. package/package.json +6 -6
  167. package/lib/features.d.ts +0 -8
  168. package/lib/features.js +0 -15
  169. package/lib/flags.d.ts +0 -4
  170. package/lib/flags.js +0 -7
  171. package/lib/icons/ast/alert-triangle.d.ts +0 -5
  172. package/lib/icons/ast/alert-triangle.js +0 -25
  173. package/lib/icons/ast/field-units-large.d.ts +0 -5
  174. package/lib/icons/ast/field-units-large.js +0 -25
  175. package/lib/icons/ast/plus.d.ts +0 -5
  176. package/lib/icons/ast/plus.js +0 -25
  177. package/lib/icons/react/alert-triangle.d.ts +0 -15
  178. package/lib/icons/react/alert-triangle.js +0 -21
  179. package/lib/icons/react/field-units-large.d.ts +0 -15
  180. package/lib/icons/react/field-units-large.js +0 -21
  181. package/lib/icons/react/plus.d.ts +0 -15
  182. package/lib/icons/react/plus.js +0 -21
  183. package/lib/unit/primitive.d.ts +0 -5
  184. package/lib/unit/primitive.js +0 -108
  185. package/lib/unit/primitive.wyw-in-js.css +0 -3
  186. package/lib/unit/types.d.ts +0 -34
  187. package/lib/unit/types.js +0 -0
  188. package/lib/unit/unit-button-group.d.ts +0 -13
  189. package/lib/unit/unit-button-group.js +0 -23
@@ -23,14 +23,6 @@ declare const inputStyle: {
23
23
  };
24
24
  };
25
25
  declare const inputCss: import("@linaria/core").LinariaClassName;
26
- declare const pillInputStyle: {
27
- borderRadius: 16;
28
- boxShadow: string;
29
- "&:focus": {
30
- boxShadow: string;
31
- };
32
- };
33
- declare const pillInputCss: import("@linaria/core").LinariaClassName;
34
26
  declare const textInlineStyle: {
35
27
  textWrap: string;
36
28
  textOverflow: string;
@@ -40,4 +32,4 @@ declare const textInlineStyle: {
40
32
  declare const textInlineCss: import("@linaria/core").LinariaClassName;
41
33
  declare const textAreaCss: import("@linaria/core").LinariaClassName;
42
34
  //#endregion
43
- export { hiddenCss, inputCss, inputStyle, pillInputCss, pillInputStyle, textAreaCss, textInlineCss, textInlineStyle };
35
+ export { hiddenCss, inputCss, inputStyle, textAreaCss, textInlineCss, textInlineStyle };
@@ -20,19 +20,13 @@ var inputStyle = {
20
20
  "&:focus": { boxShadow: `${themeVars.inputBorderFocusColor} inset` }
21
21
  };
22
22
  var inputCss = "ifv2880-input";
23
- var pillInputStyle = {
24
- borderRadius: border.radius16,
25
- boxShadow: `inset 0 0 0 0.5px ${themeVars.separatorColorDimmed}`,
26
- "&:focus": { boxShadow: `${themeVars.inputBorderFocusColorThin} inset` }
27
- };
28
- var pillInputCss = "p1rgjq48-pillInput";
29
23
  var textInlineStyle = {
30
24
  textWrap: "normal",
31
25
  textOverflow: "ellipsis",
32
26
  whiteSpace: "nowrap",
33
27
  overflow: "hidden"
34
28
  };
35
- var textInlineCss = "t103b4ms-textInline";
36
- var textAreaCss = "tf7r9zf-textArea";
29
+ var textInlineCss = "t1rgjq48-textInline";
30
+ var textAreaCss = "t103b4ms-textArea";
37
31
  //#endregion
38
- export { hiddenCss, inputCss, inputStyle, pillInputCss, pillInputStyle, textAreaCss, textInlineCss, textInlineStyle };
32
+ export { hiddenCss, inputCss, inputStyle, textAreaCss, textInlineCss, textInlineStyle };
@@ -1,5 +1,4 @@
1
1
  .h1ugjm3f-hidden{visibility:hidden;}
2
2
  .ifv2880-input{position:relative;background-color:var(--inputBgColor);border:none;box-shadow:inset 0 0 0 1px var(--separatorColorDimmed);border-radius:6px;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:20px;font-weight:410;color:var(--textColor);text-transform:none;padding:2px 6px;margin:0;outline:none;}.ifv2880-input::placeholder{color:var(--inputPlaceholderTextColor);}.ifv2880-input:focus{box-shadow:var(--inputBorderFocusColor) inset;}
3
- .p1rgjq48-pillInput{border-radius:16px;box-shadow:inset 0 0 0 0.5px var(--separatorColorDimmed);}.p1rgjq48-pillInput:focus{box-shadow:var(--inputBorderFocusColorThin) inset;}
4
- .t103b4ms-textInline{text-wrap:normal;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}
5
- .tf7r9zf-textArea{display:block;resize:none;white-space:pre-wrap;overflow:hidden;}
3
+ .t1rgjq48-textInline{text-wrap:normal;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}
4
+ .t103b4ms-textArea{display:block;resize:none;white-space:pre-wrap;overflow:hidden;}
@@ -3,8 +3,7 @@ type Props = {
3
3
  width?: number;
4
4
  invalid?: boolean;
5
5
  autoSelect?: boolean;
6
- pill?: boolean;
7
6
  } & React.ComponentProps<"textarea">;
8
- declare const TextAreaAutoSized: ({ value, placeholder, invalid, autoSelect, pill, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ declare const TextAreaAutoSized: ({ value, placeholder, invalid, autoSelect, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
9
8
  //#endregion
10
9
  export { TextAreaAutoSized };
@@ -8,7 +8,7 @@ import { useEffect, useMemo, useRef } from "react";
8
8
  import { cx } from "@linaria/core";
9
9
  import { stopPropagation } from "@fibery/react/src/stop-propagation";
10
10
  //#region src/number-input/text-area-auto-sized.tsx
11
- var TextAreaAutoSized = ({ value, placeholder, invalid, autoSelect, pill, ...rest }) => {
11
+ var TextAreaAutoSized = ({ value, placeholder, invalid, autoSelect, ...rest }) => {
12
12
  const ref = useRef(null);
13
13
  const initialValue = useRef(value);
14
14
  const hiddenValue = useMemo(() => {
@@ -30,7 +30,7 @@ var TextAreaAutoSized = ({ value, placeholder, invalid, autoSelect, pill, ...res
30
30
  placeholder,
31
31
  onClick: stopPropagation,
32
32
  ...rest,
33
- className: cx(inputCss, textAreaCss, pill && "p1rgjq48-pillInput", invalid && "i12d2tbj-invalidInput")
33
+ className: cx(inputCss, textAreaCss, invalid && "i12d2tbj-invalidInput")
34
34
  })
35
35
  });
36
36
  };
@@ -4,8 +4,7 @@ type Props = {
4
4
  width?: number;
5
5
  invalid?: boolean;
6
6
  autoSelect?: boolean;
7
- pill?: boolean;
8
7
  } & Omit<React.ComponentProps<"input">, "value">;
9
- declare const TextInputAutoSized: ({ value, placeholder, invalid, autoSelect, pill, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ declare const TextInputAutoSized: ({ value, placeholder, invalid, autoSelect, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
10
9
  //#endregion
11
10
  export { TextInputAutoSized };
@@ -6,7 +6,7 @@ import { useEffect, useMemo, useRef } from "react";
6
6
  import { cx } from "@linaria/core";
7
7
  import { stopPropagation } from "@fibery/react/src/stop-propagation";
8
8
  //#region src/number-input/text-input-auto-sized.tsx
9
- var TextInputAutoSized = ({ value, placeholder, invalid, autoSelect, pill, ...rest }) => {
9
+ var TextInputAutoSized = ({ value, placeholder, invalid, autoSelect, ...rest }) => {
10
10
  const ref = useRef(null);
11
11
  const hiddenValue = useMemo(() => {
12
12
  let hiddenValue = placeholder || "";
@@ -29,7 +29,7 @@ var TextInputAutoSized = ({ value, placeholder, invalid, autoSelect, pill, ...re
29
29
  placeholder,
30
30
  onClick: stopPropagation,
31
31
  ...rest,
32
- className: cx(inputCss, pill && "p1rgjq48-pillInput", invalid && "i12d2tbj-invalidInput")
32
+ className: cx(inputCss, invalid && "i12d2tbj-invalidInput")
33
33
  })
34
34
  });
35
35
  };
@@ -1,6 +1,6 @@
1
1
  import "./online-users.wyw-in-js.css";
2
2
  import { tooltipDelay } from "./design-system/animation.js";
3
- import { getObjectColorMemoized } from "./design-system/colors-js.js";
3
+ import { getObjectColor } from "./design-system/colors-js.js";
4
4
  import { themeVars } from "./theming.generated.js";
5
5
  import { space } from "./design-system/layout.js";
6
6
  import { useTheme } from "./theme-provider.js";
@@ -75,7 +75,7 @@ function OnlineUsers({ users }) {
75
75
  }), users.slice(0, users.length === 6 ? 6 : 5).map(({ id, avatarUrl, hasAccess, name, callBack, isFollowed }, index) => {
76
76
  const tooltipDescription = callBack ? "Click to follow" : "";
77
77
  const tooltipTitle = hasAccess ? name : "Private User";
78
- const userBorderColor = theme.fns.deneutralize(getObjectColorMemoized(name));
78
+ const userBorderColor = theme.fns.deneutralize(getObjectColor(name));
79
79
  return /* @__PURE__ */ jsx("div", {
80
80
  className: cx(userClassName, userClassNameHover),
81
81
  children: /* @__PURE__ */ jsx(Tooltip, {
@@ -8,13 +8,14 @@ var [Provider, useContext$1] = createContext$1("OpenPopoverTrackerContext", {
8
8
  });
9
9
  var OpenPopoverTrackerProvider = ({ children }) => {
10
10
  const [openPopovers, setOpenPopovers] = useState(/* @__PURE__ */ new Set());
11
+ const value = useMemo(() => {
12
+ return {
13
+ openPopovers,
14
+ setOpenPopovers
15
+ };
16
+ }, [openPopovers, setOpenPopovers]);
11
17
  return /* @__PURE__ */ jsx(Provider, {
12
- value: useMemo(() => {
13
- return {
14
- openPopovers,
15
- setOpenPopovers
16
- };
17
- }, [openPopovers, setOpenPopovers]),
18
+ value,
18
19
  children
19
20
  });
20
21
  };
@@ -1,6 +1,6 @@
1
- import { isFlagPresent } from "../flags.js";
2
1
  import { Swatch } from "../design-system/colors-swatches.js";
3
2
  import { common } from "./common.js";
3
+ import { isFlagPresent } from "@fibery/helpers/src/flags";
4
4
  //#region src/palettes/neutral.ts
5
5
  var deneutralize = isFlagPresent("no-neutral-swatches") ? void 0 : { swatches: {
6
6
  [Swatch.GreyDark]: "#4A4A4A",
@@ -1,6 +1,6 @@
1
- import { isFlagPresent } from "../flags.js";
2
1
  import { Swatch } from "../design-system/colors-swatches.js";
3
2
  import { common } from "./common.js";
3
+ import { isFlagPresent } from "@fibery/helpers/src/flags";
4
4
  var warmer = {
5
5
  points: [
6
6
  {
package/lib/phone.js CHANGED
@@ -1,5 +1,5 @@
1
- import { isFlagPresent } from "./flags.js";
2
1
  import { getMediaQueryList } from "./media-query-utils.js";
2
+ import { isFlagPresent } from "@fibery/helpers/src/flags";
3
3
  //#region src/phone.ts
4
4
  var isPhoneApp = () => Boolean(window.__FIBERY_MOBILE_APP_API);
5
5
  var disableStatic = typeof __DISABLE_VERTICAL_MOBILE_BREAKPOINT__ !== "undefined" && __DISABLE_VERTICAL_MOBILE_BREAKPOINT__;
@@ -16,11 +16,13 @@ type PopoverRootProps = {
16
16
  /** @deprecated Use onOpenChange prop instead **/
17
17
  onClose?: (event: Event) => unknown;
18
18
  };
19
+ declare const PopoverRoot: (props: PopoverRootProps) => import("react/jsx-runtime").JSX.Element;
19
20
  type PopoverPortalProps = {
20
21
  /** Portal target element. Defaults to document.body, same as Radix Portal. */
21
22
  container?: HTMLElement;
22
23
  children: ReactNode;
23
24
  };
25
+ declare const PopoverPortal: ({ container: containerProp, children }: PopoverPortalProps) => import("react").ReactPortal | null;
24
26
  type PopoverTriggerProps = {
25
27
  asChild?: boolean;
26
28
  /** Custom reference element for popover positioning. Use when the trigger element differs from the anchor point (e.g., virtual/detached elements). */
@@ -74,7 +76,7 @@ type ContentRef = {
74
76
  update: (() => Promise<unknown>) | null;
75
77
  };
76
78
  declare const Popover: {
77
- Root: (props: PopoverRootProps) => import("react/jsx-runtime").JSX.Element;
79
+ Root: typeof PopoverRoot;
78
80
  Trigger: import("react").ForwardRefExoticComponent<{
79
81
  asChild?: boolean;
80
82
  /** Custom reference element for popover positioning. Use when the trigger element differs from the anchor point (e.g., virtual/detached elements). */
@@ -82,7 +84,7 @@ declare const Popover: {
82
84
  /** Event that opens the popover. "click" allows proper focus handling inside popover content. Default: "mousedown" */
83
85
  triggerEvent?: "mousedown" | "click";
84
86
  } & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
85
- Portal: ({ container: containerProp, children }: PopoverPortalProps) => import("react").ReactPortal | null;
87
+ Portal: typeof PopoverPortal;
86
88
  Content: import("react").ForwardRefExoticComponent<Omit<PopoverContentProps, "ref"> & import("react").RefAttributes<ContentRef>>;
87
89
  };
88
90
  //#endregion
@@ -48,30 +48,31 @@ var PopoverRoot = (props) => {
48
48
  const [triggerElement, setTriggerElement] = useControllableState({});
49
49
  const [popupElement, setPopupElement] = useControllableState({ onChange: rest.setPopupElement });
50
50
  const composedSetPopupElement = useComposedRefs(setPopupElement, rest.setPopupElement);
51
- return /* @__PURE__ */ jsx(PopoverProvider, {
52
- value: useMemo(() => {
53
- return {
54
- contentId,
55
- disabled,
56
- triggerElement,
57
- setTriggerElement,
58
- popupElement,
59
- setPopupElement: composedSetPopupElement,
60
- open,
61
- onOpen: onOpenComposed,
62
- onClose: onCloseComposed
63
- };
64
- }, [
51
+ const contextValue = useMemo(() => {
52
+ return {
65
53
  contentId,
66
54
  disabled,
67
55
  triggerElement,
68
56
  setTriggerElement,
69
57
  popupElement,
70
- composedSetPopupElement,
58
+ setPopupElement: composedSetPopupElement,
71
59
  open,
72
- onOpenComposed,
73
- onCloseComposed
74
- ]),
60
+ onOpen: onOpenComposed,
61
+ onClose: onCloseComposed
62
+ };
63
+ }, [
64
+ contentId,
65
+ disabled,
66
+ triggerElement,
67
+ setTriggerElement,
68
+ popupElement,
69
+ composedSetPopupElement,
70
+ open,
71
+ onOpenComposed,
72
+ onCloseComposed
73
+ ]);
74
+ return /* @__PURE__ */ jsx(PopoverProvider, {
75
+ value: contextValue,
75
76
  children
76
77
  });
77
78
  };
@@ -179,50 +180,51 @@ var Popover = {
179
180
  ...preventOverflowOptions
180
181
  }), applyMaxSize] : [];
181
182
  }, [preventOverflowOptions, shrinkable]);
183
+ const modifiers = useMemo(() => {
184
+ return [
185
+ {
186
+ name: "flip",
187
+ options: {
188
+ padding: POPUP_OVERFLOW_PADDING,
189
+ ...popupModifiers.flipOptions,
190
+ ...flipOptions
191
+ }
192
+ },
193
+ {
194
+ name: "preventOverflow",
195
+ options: {
196
+ tether: false,
197
+ padding: POPUP_OVERFLOW_PADDING,
198
+ ...popupModifiers.preventOverflowOptions,
199
+ ...preventOverflowOptions
200
+ }
201
+ },
202
+ {
203
+ name: "offset",
204
+ options: { offset }
205
+ },
206
+ !transform && {
207
+ name: "computeStyles",
208
+ options: { gpuAcceleration: false }
209
+ },
210
+ observeWidth,
211
+ ...shrinkableModifiers,
212
+ ...additionalModifiers,
213
+ ...popupModifiers.additionalModifiers ?? []
214
+ ].filter(truthy);
215
+ }, [
216
+ additionalModifiers,
217
+ flipOptions,
218
+ offset,
219
+ popupModifiers,
220
+ preventOverflowOptions,
221
+ shrinkableModifiers,
222
+ transform
223
+ ]);
182
224
  const { styles, attributes, update } = usePopper(triggerElement, popupElement, {
183
225
  placement,
184
226
  onFirstUpdate,
185
- modifiers: useMemo(() => {
186
- return [
187
- {
188
- name: "flip",
189
- options: {
190
- padding: POPUP_OVERFLOW_PADDING,
191
- ...popupModifiers.flipOptions,
192
- ...flipOptions
193
- }
194
- },
195
- {
196
- name: "preventOverflow",
197
- options: {
198
- tether: false,
199
- padding: POPUP_OVERFLOW_PADDING,
200
- ...popupModifiers.preventOverflowOptions,
201
- ...preventOverflowOptions
202
- }
203
- },
204
- {
205
- name: "offset",
206
- options: { offset }
207
- },
208
- !transform && {
209
- name: "computeStyles",
210
- options: { gpuAcceleration: false }
211
- },
212
- observeWidth,
213
- ...shrinkableModifiers,
214
- ...additionalModifiers,
215
- ...popupModifiers.additionalModifiers ?? []
216
- ].filter(truthy);
217
- }, [
218
- additionalModifiers,
219
- flipOptions,
220
- offset,
221
- popupModifiers,
222
- preventOverflowOptions,
223
- shrinkableModifiers,
224
- transform
225
- ])
227
+ modifiers
226
228
  });
227
229
  useImperativeHandle(ref, () => ({ update }), [update]);
228
230
  const hasInteractedOutsideRef = useRef(false);
@@ -10,18 +10,19 @@ var [Provider, useMobilePopover] = createContext$1("MobilePopoverContext", {
10
10
  var MobilePopoverProvider = ({ children }) => {
11
11
  const [title, setTitle] = useState();
12
12
  const [headerSlot, setHeader] = useState();
13
+ const contextValue = useMemo(() => ({
14
+ title,
15
+ headerSlot,
16
+ setTitle,
17
+ setHeader
18
+ }), [
19
+ title,
20
+ headerSlot,
21
+ setTitle,
22
+ setHeader
23
+ ]);
13
24
  return /* @__PURE__ */ jsx(Provider, {
14
- value: useMemo(() => ({
15
- title,
16
- headerSlot,
17
- setTitle,
18
- setHeader
19
- }), [
20
- title,
21
- headerSlot,
22
- setTitle,
23
- setHeader
24
- ]),
25
+ value: contextValue,
25
26
  children
26
27
  });
27
28
  };
@@ -38,23 +38,24 @@ function MobilePopover({ content, mobilePopupStyle, mobilePopupContentClassName,
38
38
  className: cx("ciuf78p", mobilePopupContentClassName),
39
39
  children: content
40
40
  })] });
41
+ const res = /* @__PURE__ */ jsx("div", {
42
+ className: cx("cs2dkzn", !height && mobileAnimationClassName, !height && popupContentClassName, height && "c1rcf8rf"),
43
+ style: {
44
+ ...mobilePopupStyle,
45
+ ...height ? { gridTemplateRows: `1fr ${height}` } : {}
46
+ },
47
+ onClick: stopPropagation,
48
+ children: height ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
49
+ onClick: onClose,
50
+ className: "c1s9g0po"
51
+ }), /* @__PURE__ */ jsx("div", {
52
+ className: cx("c11inctn", mobileAnimationClassName, popupContentClassName),
53
+ children: popupContent
54
+ })] }) : popupContent
55
+ });
41
56
  return /* @__PURE__ */ jsx(ThemeProvider, {
42
57
  portal: true,
43
- children: /* @__PURE__ */ jsx("div", {
44
- className: cx("cs2dkzn", !height && mobileAnimationClassName, !height && popupContentClassName, height && "c1rcf8rf"),
45
- style: {
46
- ...mobilePopupStyle,
47
- ...height ? { gridTemplateRows: `1fr ${height}` } : {}
48
- },
49
- onClick: stopPropagation,
50
- children: height ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
51
- onClick: onClose,
52
- className: "c1s9g0po"
53
- }), /* @__PURE__ */ jsx("div", {
54
- className: cx("c11inctn", mobileAnimationClassName, popupContentClassName),
55
- children: popupContent
56
- })] }) : popupContent
57
- })
58
+ children: res
58
59
  });
59
60
  }
60
61
  //#endregion
@@ -26,11 +26,11 @@ var observeWidthEffect = ({ state, instance }) => {
26
26
  const onResize = () => {
27
27
  instance.update();
28
28
  };
29
- resizeListener.subscribe(popper, onResize);
30
- if (isElementReference(reference)) resizeListener.subscribe(reference, onResize);
29
+ const unsubscribePopper = resizeListener.subscribe(popper, onResize);
30
+ const unsubscribeReference = isElementReference(reference) ? resizeListener.subscribe(reference, onResize) : void 0;
31
31
  return () => {
32
- resizeListener.unsubscribe(popper, onResize);
33
- if (isElementReference(reference)) resizeListener.unsubscribe(reference, onResize);
32
+ unsubscribePopper();
33
+ unsubscribeReference?.();
34
34
  };
35
35
  };
36
36
  var observeWidth = {
@@ -1,9 +1,7 @@
1
+ import { makeSubject } from "@fibery/helpers/src/subject";
1
2
  //#region src/preference-setting.ts
2
3
  function createPreferenceSetting({ key, parse, stringify, defaultValue }) {
3
- const listeners = /* @__PURE__ */ new Set();
4
- function broadcast(value) {
5
- listeners.forEach((cb) => cb(value));
6
- }
4
+ const values = makeSubject();
7
5
  function load() {
8
6
  try {
9
7
  const raw = localStorage.getItem(key);
@@ -27,7 +25,7 @@ function createPreferenceSetting({ key, parse, stringify, defaultValue }) {
27
25
  try {
28
26
  localStorage.setItem(key, stringify(value));
29
27
  } catch {}
30
- broadcast(value);
28
+ values.publish(value);
31
29
  }
32
30
  function subscribe(cb) {
33
31
  let prev = load();
@@ -35,7 +33,7 @@ function createPreferenceSetting({ key, parse, stringify, defaultValue }) {
35
33
  prev = value;
36
34
  cb(value);
37
35
  };
38
- listeners.add(tracked);
36
+ const unsubscribe = values.subscribe(tracked);
39
37
  const storageListener = () => {
40
38
  const next = load();
41
39
  if (prev !== next) {
@@ -46,14 +44,14 @@ function createPreferenceSetting({ key, parse, stringify, defaultValue }) {
46
44
  window.addEventListener("storage", storageListener);
47
45
  return () => {
48
46
  window.removeEventListener("storage", storageListener);
49
- listeners.delete(tracked);
47
+ unsubscribe();
50
48
  };
51
49
  }
52
50
  return {
53
51
  load,
54
52
  has,
55
53
  store,
56
- notify: broadcast,
54
+ notify: values.publish,
57
55
  subscribe
58
56
  };
59
57
  }
@@ -17,7 +17,8 @@ import { Fragment as Fragment$1, useCallback, useRef, useState } from "react";
17
17
  import { createPortal } from "react-dom";
18
18
  //#region src/reactions/reaction-button.tsx
19
19
  var reactionButtonCss = "rv145dc-reactionButton";
20
- var overlayClassName = "o1h22put-overlay";
20
+ var emojiSlotCss = "e1h22put-emojiSlot";
21
+ var overlayClassName = "o1dzgtj7-overlay";
21
22
  function TouchOverlay({ onClick }) {
22
23
  return createPortal(/* @__PURE__ */ jsx(ThemeProvider, {
23
24
  portal: true,
@@ -28,44 +29,45 @@ function TouchOverlay({ onClick }) {
28
29
  }), getPopupContainerElement());
29
30
  }
30
31
  function MobileOverlay({ content, onClose }) {
32
+ const handleClose = useCallback((e) => {
33
+ e.stopPropagation();
34
+ onClose();
35
+ }, [onClose]);
31
36
  return createPortal(/* @__PURE__ */ jsx(ThemeProvider, {
32
37
  portal: true,
33
38
  children: /* @__PURE__ */ jsxs("div", {
34
39
  className: overlayClassName,
35
40
  children: [/* @__PURE__ */ jsx("div", {
36
- onPointerDown: useCallback((e) => {
37
- e.stopPropagation();
38
- onClose();
39
- }, [onClose]),
40
- className: "c1dzgtj7"
41
+ onPointerDown: handleClose,
42
+ className: "cq405te"
41
43
  }), /* @__PURE__ */ jsx("div", {
42
44
  onPointerDown: (e) => {
43
45
  e.stopPropagation();
44
46
  },
45
- className: "cq405te",
47
+ className: "c1ce8695",
46
48
  children: content
47
49
  })]
48
50
  })
49
51
  }), getPopupContainerElement());
50
52
  }
51
- var navLinkClassName = "n1ce8695-navLink";
52
- var tabNavRootWithShadow = "t1b4qxjg-tabNavRootWithShadow";
53
+ var navLinkClassName = "n1b4qxjg-navLink";
54
+ var tabNavRootWithShadow = "t15bt0sq-tabNavRootWithShadow";
53
55
  function PhoneTooltipContent({ reactions }) {
54
56
  const [selectedTab, setSelectedTab] = useState("all");
55
57
  const listRef = useRef(null);
56
58
  const hasMultipleReactions = reactions.length > 1;
57
59
  const allReactionsContent = /* @__PURE__ */ jsx("div", {
58
- className: "c15bt0sq",
60
+ className: "c2vgbrn",
59
61
  children: reactions.map((reaction) => /* @__PURE__ */ jsxs("div", {
60
- className: "c2vgbrn",
62
+ className: "c22d8hq",
61
63
  children: [/* @__PURE__ */ jsx(Emoji, {
62
64
  size: 24,
63
65
  emoji: reaction.key
64
66
  }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
65
- className: "c22d8hq",
67
+ className: "czoxmhd",
66
68
  children: reaction.alias || reaction.key
67
69
  }), reaction.users ? /* @__PURE__ */ jsx("div", {
68
- className: "czoxmhd",
70
+ className: "c1s3fkw3",
69
71
  children: /* @__PURE__ */ jsx(PrintNames, { users: reaction.users })
70
72
  }) : null] })]
71
73
  }, reaction.key))
@@ -73,18 +75,18 @@ function PhoneTooltipContent({ reactions }) {
73
75
  const singleReactionContent = (reaction) => {
74
76
  if (!reaction) return null;
75
77
  return /* @__PURE__ */ jsxs("div", {
76
- className: "c1s3fkw3",
78
+ className: "c1qgjat1",
77
79
  children: [/* @__PURE__ */ jsx("div", {
78
- className: "c1qgjat1",
80
+ className: "cfl9ju8",
79
81
  children: reaction.alias || reaction.key
80
82
  }), reaction.users?.map(({ name: userName, avatarUrl }) => /* @__PURE__ */ jsxs("div", {
81
- className: "cfl9ju8",
83
+ className: "cciqw09",
82
84
  children: [/* @__PURE__ */ jsx(AvatarImage, {
83
85
  avatarUrl,
84
86
  title: userName,
85
87
  size: 24
86
88
  }), /* @__PURE__ */ jsx("span", {
87
- className: "cciqw09",
89
+ className: "czzpq0p",
88
90
  children: userName
89
91
  })]
90
92
  }, userName))]
@@ -110,14 +112,14 @@ function PhoneTooltipContent({ reactions }) {
110
112
  }, reaction.key))]
111
113
  })
112
114
  }), /* @__PURE__ */ jsx("div", {
113
- className: "czzpq0p",
115
+ className: "cu8y17z",
114
116
  children: selectedTab === "all" && hasMultipleReactions ? allReactionsContent : singleReactionContent(hasMultipleReactions ? reactions.find((r) => r.key === selectedTab) : reactions[0])
115
117
  })] });
116
118
  }
117
119
  function PrintNames({ users }) {
118
120
  return /* @__PURE__ */ jsxs(Fragment, { children: [users.map(({ name }, index, names) => {
119
121
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
120
- className: "cu8y17z",
122
+ className: "cred4fn",
121
123
  children: name
122
124
  }), getWordDivider(names.length, index)] }, index);
123
125
  }), " "] });
@@ -139,16 +141,25 @@ var ReactionButton = ({ reaction, disabled, onSelect, reactions }) => {
139
141
  document.body.style.webkitUserSelect = "";
140
142
  }
141
143
  };
144
+ const longPressEvent = useLongPress(onLongPress, {
145
+ isPreventDefault: true,
146
+ delay: 300
147
+ });
148
+ const emojiSlotPx = isPhone ? 18 : 16;
142
149
  const button = /* @__PURE__ */ jsx(ToggleButton, {
143
150
  className: reactionButtonCss,
144
151
  disabled,
145
152
  iconStart: jsx("div", {
146
- className: "cred4fn",
147
- ...useLongPress(onLongPress, {
148
- isPreventDefault: true,
149
- delay: 300
150
- }),
151
- children: /* @__PURE__ */ jsx(Emoji, { emoji: reaction.key })
153
+ className: emojiSlotCss,
154
+ style: {
155
+ width: emojiSlotPx,
156
+ height: emojiSlotPx
157
+ },
158
+ ...longPressEvent,
159
+ children: /* @__PURE__ */ jsx(Emoji, {
160
+ emoji: reaction.key,
161
+ size: emojiSlotPx
162
+ })
152
163
  }),
153
164
  onPressedChange: () => onSelect(reaction.key),
154
165
  pressed: reaction.selected,