@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.
- package/lib/a11y-color.js +12 -10
- package/lib/actions-menu/actions-menu-props.d.ts +2 -0
- package/lib/actions-menu/actions-menu-sub-command-menu.js +5 -4
- package/lib/actions-menu/actions-menu.d.ts +1 -1
- package/lib/actions-menu/actions-menu.js +2 -1
- package/lib/actions-menu/contexts/actions-menu-context.js +12 -11
- package/lib/ai/max-tokens.js +6 -5
- package/lib/antd/ant-modal.d.ts +1 -1
- package/lib/antd/ant-modal.js +28 -1
- package/lib/antd/ant-upload.d.ts +1 -1
- package/lib/antd/ant-upload.js +23 -18
- package/lib/antd/input.js +5 -4
- package/lib/antd/utils.js +2 -1
- package/lib/avatar-colors.js +1 -1
- package/lib/avatar.d.ts +1 -10
- package/lib/avatar.js +48 -38
- package/lib/avatar.wyw-in-js.css +1 -1
- package/lib/banner/banner-action.js +2 -1
- package/lib/button/button.js +1 -1
- package/lib/button/icon-button.js +1 -1
- package/lib/canvas-colors.js +2 -2
- package/lib/card-container.d.ts +2 -6
- package/lib/card-container.js +4 -4
- package/lib/color-filter.js +2 -2
- package/lib/color-inspect.js +1 -1
- package/lib/color-picker/color-picker-or-loader.d.ts +2 -2
- package/lib/color-utils.js +1 -1
- package/lib/comment.d.ts +2 -1
- package/lib/comment.js +44 -27
- package/lib/comment.wyw-in-js.css +11 -8
- package/lib/context-menu/index.js +1 -0
- package/lib/context-menu/index.wyw-in-js.css +1 -1
- package/lib/date-picker/autocomplete.js +12 -10
- package/lib/date-picker/date-range-input.js +8 -6
- package/lib/date-picker/day-with-start-end-buttons.js +0 -2
- package/lib/date-picker/get-weekends-for-month.js +4 -2
- package/lib/date-picker/single-date-input.js +8 -6
- package/lib/day-select/day-select.js +2 -1
- package/lib/day-select/week-day-select.d.ts +2 -2
- package/lib/day-select/week-day-select.js +4 -3
- package/lib/design-system/alpha.js +5 -7
- package/lib/design-system/colors-charts.d.ts +4 -0
- package/lib/design-system/colors-charts.js +14 -0
- package/lib/design-system/colors-js.d.ts +2 -4
- package/lib/design-system/colors-js.js +8 -10
- package/lib/design-system/fns.enum.js +7 -4
- package/lib/design-system/fns.icon.js +1 -1
- package/lib/design-system/fns.js +7 -4
- package/lib/design-system/theme.d.ts +7 -7
- package/lib/design-system/theme.js +7 -12
- package/lib/design-system/vars.js +1 -2
- package/lib/design-system.d.ts +3 -2
- package/lib/design-system.js +3 -2
- package/lib/emoji-picker/primitives/content.js +10 -9
- package/lib/emoji-picker/primitives/emoji.js +22 -14
- package/lib/emoji-picker/primitives/emoji.wyw-in-js.css +4 -3
- package/lib/emoji-picker/primitives/grid.js +0 -1
- package/lib/emoji-picker/primitives/preview-provider.js +4 -3
- package/lib/emoji-picker/primitives/root.js +10 -9
- package/lib/emoji-picker/primitives/skin-provider.js +5 -4
- package/lib/emoji-picker/stores/emoji-data-store.d.ts +2 -2
- package/lib/emoji-picker/stores/emoji-data-store.js +8 -8
- package/lib/emoji-picker/stores/static-emoji-data-store.js +2 -1
- package/lib/emoji.js +5 -2
- package/lib/fibermoji-placeholder.js +5 -7
- package/lib/field-type-icon.js +2 -1
- package/lib/file-item/file-icon.js +2 -1
- package/lib/file-item.js +3 -10
- package/lib/highlight-colors.js +2 -1
- package/lib/hotkey-scope.js +2 -1
- package/lib/icons/ast/index.d.ts +1 -4
- package/lib/icons/ast/index.js +2 -5
- package/lib/icons/ast/spinner.js +1 -14
- package/lib/icons/icon.js +4 -3
- package/lib/icons/react/index.d.ts +1 -4
- package/lib/icons/react/index.js +2 -5
- package/lib/images-gallery/get-gallery-src.js +1 -1
- package/lib/images-gallery/slide-buttons.js +8 -4
- package/lib/images-gallery/thumbnails-mime-types-white-list.js +1 -1
- package/lib/integration-compact-info-button.js +1 -1
- package/lib/loading-sausage.js +7 -6
- package/lib/mobile-drawer.d.ts +2 -1
- package/lib/mobile-drawer.js +24 -12
- package/lib/mobile-drawer.wyw-in-js.css +3 -2
- package/lib/mobile-keyboard-aware-popup.js +6 -5
- package/lib/modal-menu/contexts/modal-menu-context.d.ts +1 -0
- package/lib/modal-menu/modal-menu-content.d.ts +1 -1
- package/lib/modal-menu/modal-menu-content.js +16 -6
- package/lib/modal-menu/modal-menu-drawer-content.d.ts +7 -0
- package/lib/modal-menu/modal-menu-drawer-content.js +13 -0
- package/lib/modal-menu/modal-menu-root.d.ts +2 -1
- package/lib/modal-menu/modal-menu-root.js +24 -21
- package/lib/modal-menu/modal-submenu.js +10 -9
- package/lib/nested-menu-item.d.ts +1 -1
- package/lib/number-input/number-input-inline-with-autosize.d.ts +1 -2
- package/lib/number-input/number-input-inline-with-autosize.js +9 -6
- package/lib/number-input/number-input-inline-with-autosize.wyw-in-js.css +0 -1
- package/lib/number-input/number-input.js +13 -11
- package/lib/number-input/styles.d.ts +1 -9
- package/lib/number-input/styles.js +3 -9
- package/lib/number-input/styles.wyw-in-js.css +2 -3
- package/lib/number-input/text-area-auto-sized.d.ts +1 -2
- package/lib/number-input/text-area-auto-sized.js +2 -2
- package/lib/number-input/text-input-auto-sized.d.ts +1 -2
- package/lib/number-input/text-input-auto-sized.js +2 -2
- package/lib/online-users.js +2 -2
- package/lib/open-popover-tracker.js +7 -6
- package/lib/palettes/neutral.js +1 -1
- package/lib/palettes/warm.js +1 -1
- package/lib/phone.js +1 -1
- package/lib/popover/index.d.ts +4 -2
- package/lib/popover/index.js +61 -59
- package/lib/popover/mobile-popover-context.js +12 -11
- package/lib/popover/mobile-popover.js +16 -15
- package/lib/popover/modifiers.js +4 -4
- package/lib/preference-setting.js +6 -8
- package/lib/reactions/reaction-button.js +36 -25
- package/lib/reactions/reaction-button.wyw-in-js.css +16 -16
- package/lib/reactions/reaction-picker.js +22 -10
- package/lib/reactions/reaction-picker.wyw-in-js.css +1 -0
- package/lib/reactions/tootltip.js +2 -1
- package/lib/select/components/option.js +2 -1
- package/lib/select/index.d.ts +2 -1
- package/lib/select/select-trigger.d.ts +4 -0
- package/lib/select/select-trigger.js +25 -0
- package/lib/select/select-trigger.wyw-in-js.css +1 -0
- package/lib/select/select.d.ts +6 -2
- package/lib/select/select.js +10 -5
- package/lib/spinner.d.ts +2 -6
- package/lib/spinner.js +11 -7
- package/lib/spinner.wyw-in-js.css +1 -0
- package/lib/tab-nav/tab-nav.d.ts +4 -2
- package/lib/tab-nav/tab-nav.js +2 -2
- package/lib/thematic.js +322 -321
- package/lib/theme-provider.d.ts +1 -3
- package/lib/toast/toast-action.js +2 -1
- package/lib/toast/toast-provider.d.ts +1 -2
- package/lib/toast/toast-queue.d.ts +1 -2
- package/lib/toast/toast-queue.js +7 -8
- package/lib/toast/toast.js +7 -6
- package/lib/toggle.js +3 -3
- package/lib/tooltip-if-overflown.js +2 -1
- package/lib/tooltip.js +1 -1
- package/lib/type-badge.d.ts +8 -28
- package/lib/type-badge.js +39 -50
- package/lib/type-badge.wyw-in-js.css +11 -10
- package/lib/unit/container.d.ts +12 -0
- package/lib/unit/container.js +50 -0
- package/lib/unit/context.d.ts +29 -0
- package/lib/unit/context.js +9 -0
- package/lib/unit/index.d.ts +4 -2
- package/lib/unit/index.js +2 -1
- package/lib/unit/nav-button.d.ts +12 -0
- package/lib/unit/nav-button.js +18 -0
- package/lib/unit/styles.d.ts +6 -9
- package/lib/unit/styles.js +13 -16
- package/lib/unit/styles.wyw-in-js.css +10 -16
- package/lib/unit/unit-content-layout.d.ts +4 -3
- package/lib/unit/unit-content-layout.js +9 -9
- package/lib/unit/unit-content.d.ts +6 -5
- package/lib/unit/unit-content.js +83 -18
- package/lib/unit/unit-content.wyw-in-js.css +6 -2
- package/lib/unit/unit.d.ts +38 -5
- package/lib/unit/unit.js +43 -12
- package/lib/workflow-progress-icon.js +2 -2
- package/package.json +6 -6
- package/lib/features.d.ts +0 -8
- package/lib/features.js +0 -15
- package/lib/flags.d.ts +0 -4
- package/lib/flags.js +0 -7
- package/lib/icons/ast/alert-triangle.d.ts +0 -5
- package/lib/icons/ast/alert-triangle.js +0 -25
- package/lib/icons/ast/field-units-large.d.ts +0 -5
- package/lib/icons/ast/field-units-large.js +0 -25
- package/lib/icons/ast/plus.d.ts +0 -5
- package/lib/icons/ast/plus.js +0 -25
- package/lib/icons/react/alert-triangle.d.ts +0 -15
- package/lib/icons/react/alert-triangle.js +0 -21
- package/lib/icons/react/field-units-large.d.ts +0 -15
- package/lib/icons/react/field-units-large.js +0 -21
- package/lib/icons/react/plus.d.ts +0 -15
- package/lib/icons/react/plus.js +0 -21
- package/lib/unit/primitive.d.ts +0 -5
- package/lib/unit/primitive.js +0 -108
- package/lib/unit/primitive.wyw-in-js.css +0 -3
- package/lib/unit/types.d.ts +0 -34
- package/lib/unit/types.js +0 -0
- package/lib/unit/unit-button-group.d.ts +0 -13
- 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,
|
|
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 = "
|
|
36
|
-
var textAreaCss = "
|
|
29
|
+
var textInlineCss = "t1rgjq48-textInline";
|
|
30
|
+
var textAreaCss = "t103b4ms-textArea";
|
|
37
31
|
//#endregion
|
|
38
|
-
export { hiddenCss, inputCss, inputStyle,
|
|
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
|
-
.
|
|
4
|
-
.t103b4ms-
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
32
|
+
className: cx(inputCss, invalid && "i12d2tbj-invalidInput")
|
|
33
33
|
})
|
|
34
34
|
});
|
|
35
35
|
};
|
package/lib/online-users.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./online-users.wyw-in-js.css";
|
|
2
2
|
import { tooltipDelay } from "./design-system/animation.js";
|
|
3
|
-
import {
|
|
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(
|
|
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
|
|
13
|
-
return {
|
|
14
|
-
openPopovers,
|
|
15
|
-
setOpenPopovers
|
|
16
|
-
};
|
|
17
|
-
}, [openPopovers, setOpenPopovers]),
|
|
18
|
+
value,
|
|
18
19
|
children
|
|
19
20
|
});
|
|
20
21
|
};
|
package/lib/palettes/neutral.js
CHANGED
|
@@ -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",
|
package/lib/palettes/warm.js
CHANGED
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__;
|
package/lib/popover/index.d.ts
CHANGED
|
@@ -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:
|
|
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:
|
|
87
|
+
Portal: typeof PopoverPortal;
|
|
86
88
|
Content: import("react").ForwardRefExoticComponent<Omit<PopoverContentProps, "ref"> & import("react").RefAttributes<ContentRef>>;
|
|
87
89
|
};
|
|
88
90
|
//#endregion
|
package/lib/popover/index.js
CHANGED
|
@@ -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
|
-
|
|
52
|
-
|
|
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
|
|
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:
|
|
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:
|
|
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
|
package/lib/popover/modifiers.js
CHANGED
|
@@ -26,11 +26,11 @@ var observeWidthEffect = ({ state, instance }) => {
|
|
|
26
26
|
const onResize = () => {
|
|
27
27
|
instance.update();
|
|
28
28
|
};
|
|
29
|
-
resizeListener.subscribe(popper, onResize);
|
|
30
|
-
|
|
29
|
+
const unsubscribePopper = resizeListener.subscribe(popper, onResize);
|
|
30
|
+
const unsubscribeReference = isElementReference(reference) ? resizeListener.subscribe(reference, onResize) : void 0;
|
|
31
31
|
return () => {
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
47
|
+
unsubscribe();
|
|
50
48
|
};
|
|
51
49
|
}
|
|
52
50
|
return {
|
|
53
51
|
load,
|
|
54
52
|
has,
|
|
55
53
|
store,
|
|
56
|
-
notify:
|
|
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
|
|
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:
|
|
37
|
-
|
|
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: "
|
|
47
|
+
className: "c1ce8695",
|
|
46
48
|
children: content
|
|
47
49
|
})]
|
|
48
50
|
})
|
|
49
51
|
}), getPopupContainerElement());
|
|
50
52
|
}
|
|
51
|
-
var navLinkClassName = "
|
|
52
|
-
var 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: "
|
|
60
|
+
className: "c2vgbrn",
|
|
59
61
|
children: reactions.map((reaction) => /* @__PURE__ */ jsxs("div", {
|
|
60
|
-
className: "
|
|
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: "
|
|
67
|
+
className: "czoxmhd",
|
|
66
68
|
children: reaction.alias || reaction.key
|
|
67
69
|
}), reaction.users ? /* @__PURE__ */ jsx("div", {
|
|
68
|
-
className: "
|
|
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: "
|
|
78
|
+
className: "c1qgjat1",
|
|
77
79
|
children: [/* @__PURE__ */ jsx("div", {
|
|
78
|
-
className: "
|
|
80
|
+
className: "cfl9ju8",
|
|
79
81
|
children: reaction.alias || reaction.key
|
|
80
82
|
}), reaction.users?.map(({ name: userName, avatarUrl }) => /* @__PURE__ */ jsxs("div", {
|
|
81
|
-
className: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
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,
|