@fibery/ui-kit 13.0.1 → 14.0.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/actions-menu/actions-menu-item.js +4 -3
- package/lib/actions-menu/actions-menu-sub-command-menu.d.ts +2 -0
- package/lib/actions-menu/actions-menu-sub-command-menu.js +3 -2
- package/lib/actions-menu/actions-menu.js +2 -2
- package/lib/actions-menu/context-actions-menu.js +2 -2
- package/lib/banner/banner.wyw-in-js.css +2 -2
- package/lib/button/button.js +2 -1
- package/lib/color-picker/color-picker-or-loader.d.ts +5 -0
- package/lib/color-picker/color-picker-or-loader.js +18 -5
- package/lib/color-picker/color-picker-or-loader.wyw-in-js.css +1 -1
- package/lib/color-picker/index.js +5 -5
- package/lib/color-picker/index.wyw-in-js.css +4 -5
- package/lib/color-picker/swatch-grid.d.ts +11 -0
- package/lib/color-picker/swatch-grid.js +14 -0
- package/lib/color-picker/swatch-grid.wyw-in-js.css +1 -0
- package/lib/color-picker/swatch.js +2 -9
- package/lib/command-menu/nested-command-menu.js +1 -1
- package/lib/date-picker/date-range-picker-popup-content.js +7 -3
- package/lib/date-picker/date-range-picker.js +3 -2
- package/lib/date-picker/single-date-picker-popup-content.js +1 -1
- package/lib/date-picker/single-date-picker.js +3 -2
- package/lib/emoji-picker/utils/store.js +3 -2
- package/lib/file-item/file-item-preview.d.ts +7 -0
- package/lib/file-item/file-item-preview.js +31 -0
- package/lib/file-item/file-item-preview.wyw-in-js.css +4 -0
- package/lib/form-field-loader.d.ts +5 -6
- package/lib/form-field-loader.js +7 -10
- package/lib/form-field-loader.wyw-in-js.css +2 -1
- package/lib/lists/list-row-surface.wyw-in-js.css +1 -1
- package/lib/open-popover-tracker.d.ts +2 -4
- package/lib/open-popover-tracker.js +14 -22
- package/lib/popover/index.js +2 -2
- package/lib/preference-setting.d.ts +2 -1
- package/lib/preference-setting.js +4 -4
- package/lib/reactions/get-word-divider.d.ts +1 -1
- package/lib/reactions/get-word-divider.js +7 -6
- package/lib/rich-text-skeleton.d.ts +9 -0
- package/lib/rich-text-skeleton.js +32 -0
- package/lib/rich-text-skeleton.wyw-in-js.css +2 -0
- package/lib/select/components/menu-list-virtua.js +2 -1
- package/lib/select/components/menu-list-virtualized.js +37 -44
- package/lib/select/components/menu.d.ts +1 -4
- package/lib/select/components/menu.js +2 -9
- package/lib/select/components/option.js +5 -2
- package/lib/select/select-loader.js +5 -2
- package/lib/select/select.d.ts +1 -1
- package/lib/select/select.js +2 -2
- package/lib/select/styles.js +4 -3
- package/lib/select/util.d.ts +2 -0
- package/lib/select/util.js +3 -1
- package/lib/storage-keys.d.ts +12 -0
- package/lib/storage-keys.js +20 -0
- package/lib/storage.d.ts +9 -0
- package/lib/storage.js +5 -0
- package/lib/text.d.ts +5 -0
- package/lib/text.js +5 -0
- package/lib/thematic-cvd.js +2 -2
- package/lib/thematic-state.js +1 -0
- package/lib/thematic.js +8 -18
- package/lib/theme-bootstrap.js +3 -1
- package/lib/theme-css-fallback.d.ts +5 -0
- package/lib/theme-css-fallback.js +29 -0
- package/lib/theme-css-snapshot.d.ts +8 -1
- package/lib/theme-css-snapshot.js +34 -8
- package/lib/theme-settings-core.js +7 -8
- package/lib/theme-styles.js +5 -8
- package/lib/unit/labeled-unit.d.ts +2 -0
- package/lib/unit/labeled-unit.js +3 -3
- package/lib/unit/labeled-unit.wyw-in-js.css +1 -1
- package/package.json +4 -4
- package/lib/rich-input-loader.d.ts +0 -7
- package/lib/rich-input-loader.js +0 -34
- package/lib/rich-input-loader.wyw-in-js.css +0 -2
|
@@ -2,6 +2,7 @@ import "./actions-menu-item.wyw-in-js.css";
|
|
|
2
2
|
import { useIsPhone } from "../use-is-phone.js";
|
|
3
3
|
import { lineHeightClasses, textClasses } from "../design-system/typography.js";
|
|
4
4
|
import { Spinner } from "../spinner.js";
|
|
5
|
+
import { Text } from "../text.js";
|
|
5
6
|
import { Kbd, KbdGroup } from "../kbd.js";
|
|
6
7
|
import { useActionsMenuContext } from "./contexts/actions-menu-context.js";
|
|
7
8
|
import { useActiveDangerousRow, useSetActiveDangerousRow } from "./contexts/actions-menu-dangerous-rows.js";
|
|
@@ -88,9 +89,9 @@ var ActionsMenuItemComponent = function ActionsMenuItemComponent({ id, testId, t
|
|
|
88
89
|
dangerous && !hideConfirmationText && /* @__PURE__ */ jsxs("div", {
|
|
89
90
|
className: cx(hiddenTextCss, showWarning && visibleTextCss),
|
|
90
91
|
children: [
|
|
91
|
-
"Really ",
|
|
92
|
-
typeof children === "string" ? firstLetterToLowerCase(children) : children,
|
|
93
|
-
"?"
|
|
92
|
+
/* @__PURE__ */ jsx(Text, { children: "Really " }),
|
|
93
|
+
typeof children === "string" ? /* @__PURE__ */ jsx(Text, { children: firstLetterToLowerCase(children) }) : children,
|
|
94
|
+
/* @__PURE__ */ jsx(Text, { children: "?" })
|
|
94
95
|
]
|
|
95
96
|
}),
|
|
96
97
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -6,6 +6,8 @@ type ActionsMenuSubCommandMenuProps = React.PropsWithChildren<{
|
|
|
6
6
|
trigger?: React.ReactNode;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
Icon?: FunctionComponent<IconBaseProps>;
|
|
9
|
+
container?: HTMLElement | null;
|
|
10
|
+
contentClassName?: string;
|
|
9
11
|
}>;
|
|
10
12
|
export declare const ActionsMenuSubCommandMenu: React.FC<ActionsMenuSubCommandMenuProps>;
|
|
11
13
|
export declare const ActionsMenuSubCommandMenuRoot: React.FC<React.ComponentPropsWithoutRef<typeof CommandMenuRoot>>;
|
|
@@ -12,7 +12,7 @@ import { composeEventHandlers } from "@fibery/react/src/compose-event-handlers";
|
|
|
12
12
|
import { stopPropagation } from "@fibery/react/src/stop-propagation";
|
|
13
13
|
//#region src/actions-menu/actions-menu-sub-command-menu.tsx
|
|
14
14
|
var [ActionsMenuSubCommandMenuProvider, useActionsMenuSubCommandMenuCtx] = createContext$1("ActionsMenuSubCommandMenu");
|
|
15
|
-
var ActionsMenuSubCommandMenu = ({ disabled, trigger, children, Icon }) => {
|
|
15
|
+
var ActionsMenuSubCommandMenu = ({ disabled, trigger, children, Icon, container, contentClassName }) => {
|
|
16
16
|
const [open, onOpenChange] = useState(false);
|
|
17
17
|
const triggerRef = useRef(null);
|
|
18
18
|
const openRef = useRef(false);
|
|
@@ -30,7 +30,8 @@ var ActionsMenuSubCommandMenu = ({ disabled, trigger, children, Icon }) => {
|
|
|
30
30
|
trigger,
|
|
31
31
|
Icon,
|
|
32
32
|
triggerRef,
|
|
33
|
-
|
|
33
|
+
container,
|
|
34
|
+
contentClassName: cx("c199nm2d-content", contentClassName),
|
|
34
35
|
children: jsx(ActionsMenuSubCommandMenuProvider, {
|
|
35
36
|
value: ctx,
|
|
36
37
|
children
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./actions-menu.wyw-in-js.css";
|
|
2
2
|
import { useIsPhone } from "../use-is-phone.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useOpenPopoverChange } from "../open-popover-tracker.js";
|
|
4
4
|
import { ActionsMenuContextProvider } from "./contexts/actions-menu-context.js";
|
|
5
5
|
import { dropdown_menu_exports } from "../dropdown-menu/index.js";
|
|
6
6
|
import { modal_menu_exports } from "../modal-menu/index.js";
|
|
@@ -25,7 +25,7 @@ var ActionsMenu = ({ trigger, triggerEvent = "click", wide, align = "start", ali
|
|
|
25
25
|
});
|
|
26
26
|
const isPhone = useIsPhone();
|
|
27
27
|
const [confirmation, setConfirmation] = useState(null);
|
|
28
|
-
const
|
|
28
|
+
const onOpenPopoverChange = useOpenPopoverChange();
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
onOpenPopoverChange(isOpen);
|
|
31
31
|
return () => onOpenPopoverChange(false);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useIsPhone } from "../use-is-phone.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useOpenPopoverChange } from "../open-popover-tracker.js";
|
|
3
3
|
import { ActionsMenuContextProvider } from "./contexts/actions-menu-context.js";
|
|
4
4
|
import { ActionsMenuConfirmation } from "./actions-menu-confirmation.js";
|
|
5
5
|
import { ActionsMenuDangerousRowsProvider } from "./contexts/actions-menu-dangerous-rows.js";
|
|
@@ -18,7 +18,7 @@ var ContextActionsMenu = ({ open, onOpenChange = noop, trigger, children, disabl
|
|
|
18
18
|
onChange: onOpenChange
|
|
19
19
|
});
|
|
20
20
|
const [confirmation, setConfirmation] = useState(null);
|
|
21
|
-
const
|
|
21
|
+
const onOpenPopoverChange = useOpenPopoverChange();
|
|
22
22
|
const handleOpenChange = (nextOpen) => {
|
|
23
23
|
if (!(isPhone && supportsMobile)) onOpenPopoverChange(nextOpen);
|
|
24
24
|
setOpen(nextOpen);
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
.s1cq53t0-success{background-color:var(--bg-banner-success);--dynamic-fg-icon:var(--fg-banner-icon-success);color:var(--fg-banner-success);}
|
|
6
6
|
.b13duqg1-banner{padding:10px 12px;display:flex;align-items:center;gap:8px;border-radius:8px;--dynamic-size-icon:16px;}
|
|
7
7
|
.buy371b-bannerContent{display:grid;min-height:24px;align-items:center;flex-grow:1;min-width:0;gap:2px;padding-inline:2px;}
|
|
8
|
-
.bo9ubv-bannerTitle.bo9ubv-bannerTitle{font-weight:500;line-height:1.3;color:inherit;}
|
|
9
|
-
.b1nbuqez-bannerDescription.b1nbuqez-bannerDescription{font-weight:410;line-height:1.3;color:inherit;}
|
|
8
|
+
.bo9ubv-bannerTitle.bo9ubv-bannerTitle{font-weight:500;line-height:1.3;color:inherit;text-wrap:balance;}
|
|
9
|
+
.b1nbuqez-bannerDescription.b1nbuqez-bannerDescription{font-weight:410;line-height:1.3;color:inherit;text-wrap:pretty;}
|
package/lib/button/button.js
CHANGED
|
@@ -3,6 +3,7 @@ import { useIsPhone } from "../use-is-phone.js";
|
|
|
3
3
|
import { useIsSupportHardwareKeyboard } from "../use-is-support-hardware-keyboard.js";
|
|
4
4
|
import { Spinner } from "../spinner.js";
|
|
5
5
|
import { BaseButton } from "./base-button.js";
|
|
6
|
+
import { Text } from "../text.js";
|
|
6
7
|
/* empty css */
|
|
7
8
|
import { cx } from "@linaria/core";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -34,7 +35,7 @@ var Button = forwardRef(({ size = "medium", iconStart, supportMobile, iconEnd, c
|
|
|
34
35
|
...buttonProps,
|
|
35
36
|
children: jsxs(Component, { children: [
|
|
36
37
|
pending ? /* @__PURE__ */ jsx(Spinner, {}) : iconStart,
|
|
37
|
-
/* @__PURE__ */ jsx(Slottable, { children }),
|
|
38
|
+
/* @__PURE__ */ jsx(Slottable, { children: typeof children === "string" ? /* @__PURE__ */ jsx(Text, { children }) : children }),
|
|
38
39
|
iconEnd,
|
|
39
40
|
shortcut && isSupportHardwareKeyboard ? /* @__PURE__ */ jsx("span", {
|
|
40
41
|
className: shortcutContainer,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ColorPicker } from "./index.js";
|
|
2
2
|
//#region src/color-picker/color-picker-or-loader.d.ts
|
|
3
|
+
type SkeletonProps = {
|
|
4
|
+
colors?: readonly string[];
|
|
5
|
+
containerClassName?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const ColorPickerSkeleton: ({ colors, containerClassName }: SkeletonProps) => import("react").JSX.Element | null;
|
|
3
8
|
declare const LazyColorPicker: import("react").LazyExoticComponent<typeof ColorPicker>;
|
|
4
9
|
export declare const ColorPickerOrLoader: (props: React.ComponentProps<typeof LazyColorPicker>) => import("react").JSX.Element;
|
|
5
10
|
//#endregion
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import "./color-picker-or-loader.wyw-in-js.css";
|
|
2
|
+
import { Skeleton } from "../skeleton.js";
|
|
3
|
+
import { colorSwatchContainerCss, swatchIconSizes } from "./swatch-grid.js";
|
|
2
4
|
/* empty css */
|
|
3
5
|
import { jsx } from "react/jsx-runtime";
|
|
4
6
|
import { Suspense, lazy } from "react";
|
|
5
7
|
//#region src/color-picker/color-picker-or-loader.tsx
|
|
6
|
-
var
|
|
8
|
+
var cellCss = "c12dxv9h-cell";
|
|
9
|
+
var ColorPickerSkeleton = ({ colors, containerClassName = colorSwatchContainerCss }) => colors ? /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className: containerClassName,
|
|
11
|
+
children: [...colors, "custom"].map((key) => /* @__PURE__ */ jsx("div", {
|
|
12
|
+
className: cellCss,
|
|
13
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
14
|
+
shape: "ellipse",
|
|
15
|
+
size: swatchIconSizes.large,
|
|
16
|
+
margins: false
|
|
17
|
+
})
|
|
18
|
+
}, key))
|
|
19
|
+
}) : null;
|
|
7
20
|
var LazyColorPicker = lazy(async () => {
|
|
8
21
|
const { ColorPicker } = await import("./index.js");
|
|
9
22
|
return { default: ColorPicker };
|
|
10
23
|
});
|
|
11
24
|
var ColorPickerOrLoader = (props) => /* @__PURE__ */ jsx(Suspense, {
|
|
12
|
-
fallback: jsx(
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
fallback: jsx(ColorPickerSkeleton, {
|
|
26
|
+
colors: props.colors,
|
|
27
|
+
containerClassName: props.containerClassName
|
|
15
28
|
}),
|
|
16
29
|
children: jsx(LazyColorPicker, { ...props })
|
|
17
30
|
});
|
|
18
31
|
//#endregion
|
|
19
|
-
export { ColorPickerOrLoader };
|
|
32
|
+
export { ColorPickerOrLoader, ColorPickerSkeleton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.c12dxv9h-
|
|
1
|
+
.c12dxv9h-cell{display:flex;padding:6px;}
|
|
@@ -2,6 +2,7 @@ import "./index.wyw-in-js.css";
|
|
|
2
2
|
import { textClasses } from "../design-system/typography.js";
|
|
3
3
|
import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from "../collapsible/index.js";
|
|
4
4
|
import { SliderPointer } from "./slider-pointer.js";
|
|
5
|
+
import { colorSwatchContainerCss } from "./swatch-grid.js";
|
|
5
6
|
import { Swatch } from "./swatch.js";
|
|
6
7
|
/* empty css */
|
|
7
8
|
import { cx } from "@linaria/core";
|
|
@@ -10,11 +11,10 @@ import { useEffect, useRef, useState } from "react";
|
|
|
10
11
|
import { ColorWrap, Hue, Saturation } from "react-color/lib/components/common";
|
|
11
12
|
//#region src/color-picker/index.tsx
|
|
12
13
|
var pickerWrapperCss = "pgyd1to-pickerWrapper";
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var hexInputCss = cx(textClasses.regular, "h1q4fcfd-hexInput");
|
|
14
|
+
var saturationWrapperCss = "szk9p38-saturationWrapper";
|
|
15
|
+
var hueWrapperCss = "h1iw6096-hueWrapper";
|
|
16
|
+
var hexInpuWrapperCss = "h1xsfooc-hexInpuWrapper";
|
|
17
|
+
var hexInputCss = cx(textClasses.regular, "h1vzio84-hexInput");
|
|
18
18
|
var HexInput = ({ value, onPreview, onCommit }) => {
|
|
19
19
|
const ref = useRef(null);
|
|
20
20
|
const focused = useRef(false);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.pgyd1to-pickerWrapper{filter:var(--filter-swatch-picker);}
|
|
2
|
-
.
|
|
3
|
-
.
|
|
4
|
-
.h1xsfooc-
|
|
5
|
-
.h1vzio84-
|
|
6
|
-
.h1q4fcfd-hexInput{padding:6px 12px;width:100%;border:none;border-radius:6px;background-color:var(--bg-action-menu);box-shadow:var(--shadow-input);outline:none;}
|
|
2
|
+
.szk9p38-saturationWrapper{margin-top:6px;position:relative;height:100px;}
|
|
3
|
+
.h1iw6096-hueWrapper{height:12px;position:relative;}
|
|
4
|
+
.h1xsfooc-hexInpuWrapper{position:relative;margin-top:12px;}
|
|
5
|
+
.h1vzio84-hexInput{padding:6px 12px;width:100%;border:none;border-radius:6px;background-color:var(--bg-action-menu);box-shadow:var(--shadow-input);outline:none;}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/color-picker/swatch-grid.d.ts
|
|
2
|
+
export declare const colorSwatchContainerCss: import("@linaria/core").LinariaClassName;
|
|
3
|
+
export declare const swatchIconSizes: {
|
|
4
|
+
tiny: number;
|
|
5
|
+
small: number;
|
|
6
|
+
medium: number;
|
|
7
|
+
large: number;
|
|
8
|
+
huge: number;
|
|
9
|
+
xLarge: number;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./swatch-grid.wyw-in-js.css";
|
|
2
|
+
/* empty css */
|
|
3
|
+
//#region src/color-picker/swatch-grid.ts
|
|
4
|
+
var colorSwatchContainerCss = "caik4yw-colorSwatchContainer";
|
|
5
|
+
var swatchIconSizes = {
|
|
6
|
+
tiny: 16,
|
|
7
|
+
small: 16,
|
|
8
|
+
medium: 18,
|
|
9
|
+
large: 20,
|
|
10
|
+
huge: 22,
|
|
11
|
+
xLarge: 22
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { colorSwatchContainerCss, swatchIconSizes };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.caik4yw-colorSwatchContainer{display:grid;grid-template-columns:repeat(9, 1fr);}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "./swatch.wyw-in-js.css";
|
|
2
2
|
import { IconButton } from "../button/icon-button.js";
|
|
3
|
+
import { swatchIconSizes } from "./swatch-grid.js";
|
|
3
4
|
/* empty css */
|
|
4
5
|
import { cx } from "@linaria/core";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -12,14 +13,6 @@ var swatchContainerCss = "s1fctybm-swatchContainer";
|
|
|
12
13
|
var swatchCss = "s1setbi4-swatch";
|
|
13
14
|
var selectedCss = "s1b2q3nt-selected";
|
|
14
15
|
var customCss = "crhscs1-custom";
|
|
15
|
-
var iconSizes = {
|
|
16
|
-
tiny: 16,
|
|
17
|
-
small: 16,
|
|
18
|
-
medium: 18,
|
|
19
|
-
large: 20,
|
|
20
|
-
huge: 22,
|
|
21
|
-
xLarge: 22
|
|
22
|
-
};
|
|
23
16
|
var Swatch = forwardRef(({ size = "large", color, hoverColor, selected, custom, className, ...rest }, ref) => {
|
|
24
17
|
return /* @__PURE__ */ jsx(IconButton, {
|
|
25
18
|
ref,
|
|
@@ -28,7 +21,7 @@ var Swatch = forwardRef(({ size = "large", color, hoverColor, selected, custom,
|
|
|
28
21
|
style: {
|
|
29
22
|
[swatchColorVar]: color,
|
|
30
23
|
[swatchHoverColorVar]: hoverColor,
|
|
31
|
-
[swatchIconSizeVar]: `${
|
|
24
|
+
[swatchIconSizeVar]: `${swatchIconSizes[size]}px`
|
|
32
25
|
},
|
|
33
26
|
className: cx(swatchContainerCss, className),
|
|
34
27
|
...rest,
|
|
@@ -80,7 +80,7 @@ function NestedCommandMenu({ defaultStack, defaultValue, rootItems, onChange, fi
|
|
|
80
80
|
children: [/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ArrowBack, {
|
|
81
81
|
iconSize: 16,
|
|
82
82
|
"aria-hidden": true
|
|
83
|
-
}) }), /* @__PURE__ */
|
|
83
|
+
}) }), /* @__PURE__ */ jsx("div", { children: `Back${stack.length > 1 ? ` to ${stack[stack.length - 2].item.title}` : ""}` })]
|
|
84
84
|
}), /* @__PURE__ */ jsx("div", { className: "cnp3is8" })] }), /* @__PURE__ */ jsxs(CommandMenuRoot, {
|
|
85
85
|
shouldFilter: false,
|
|
86
86
|
value,
|
|
@@ -11,7 +11,7 @@ import { cx } from "@linaria/core";
|
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { forwardRef, useCallback, useMemo, useRef, useState } from "react";
|
|
13
13
|
import { noop } from "@fibery/helpers/src/_";
|
|
14
|
-
import enGB from "date-fns/locale/en-GB";
|
|
14
|
+
import { enGB } from "date-fns/locale/en-GB";
|
|
15
15
|
import { DayPicker } from "react-day-picker";
|
|
16
16
|
import { formatDuration, intervalToDuration, roundToNearestMinutes } from "date-fns";
|
|
17
17
|
//#region src/date-picker/date-range-picker-popup-content.tsx
|
|
@@ -64,9 +64,13 @@ var DateRangePickerPopupContent = forwardRef((props, ref) => {
|
|
|
64
64
|
dateFormat,
|
|
65
65
|
dateTimeFormat
|
|
66
66
|
});
|
|
67
|
-
const
|
|
67
|
+
const roundedEnd = currentEndValue && roundToNearestMinutes(currentEndValue);
|
|
68
|
+
const duration = currentStartValue && roundedEnd ? formatDuration(intervalToDuration(currentStartValue <= roundedEnd ? {
|
|
68
69
|
start: currentStartValue,
|
|
69
|
-
end:
|
|
70
|
+
end: roundedEnd
|
|
71
|
+
} : {
|
|
72
|
+
start: roundedEnd,
|
|
73
|
+
end: currentStartValue
|
|
70
74
|
}), showTime ? { format: [
|
|
71
75
|
"years",
|
|
72
76
|
"months",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./date-range-picker.wyw-in-js.css";
|
|
2
2
|
import { useIsPhone } from "../use-is-phone.js";
|
|
3
3
|
import { space } from "../design-system/layout.js";
|
|
4
|
+
import { Text } from "../text.js";
|
|
4
5
|
import { Popover } from "../popover/index.js";
|
|
5
6
|
import { MobileDrawer } from "../mobile-drawer.js";
|
|
6
7
|
import { EmptyValue } from "../empty-value.js";
|
|
@@ -9,7 +10,7 @@ import { formatDateRangeInputValue } from "./utils.js";
|
|
|
9
10
|
import { FakeDateInputWrapper } from "./fake-date-input.js";
|
|
10
11
|
import { DateRangePickerPopupContent } from "./date-range-picker-popup-content.js";
|
|
11
12
|
/* empty css */
|
|
12
|
-
import {
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { forwardRef, useCallback, useRef } from "react";
|
|
14
15
|
import { stopPropagation } from "@fibery/react/src/stop-propagation";
|
|
15
16
|
import moment from "moment";
|
|
@@ -28,7 +29,7 @@ var DateRangePicker = forwardRef((props, ref) => {
|
|
|
28
29
|
ref: fakeWrapperRef,
|
|
29
30
|
disabled,
|
|
30
31
|
isPickerOpen: open,
|
|
31
|
-
children: !dateValue[0] && !dateValue[1] ? /* @__PURE__ */ jsx(EmptyValue, { children: placeholder }) : /* @__PURE__ */ jsx(
|
|
32
|
+
children: !dateValue[0] && !dateValue[1] ? /* @__PURE__ */ jsx(EmptyValue, { children: placeholder }) : /* @__PURE__ */ jsx(Text, { children: formatDateRangeInputValue(dateValue[0], dateValue[1], {
|
|
32
33
|
showTime,
|
|
33
34
|
short: true,
|
|
34
35
|
dateFormat,
|
|
@@ -5,7 +5,7 @@ import { getWeekendsForMonth } from "./get-weekends-for-month.js";
|
|
|
5
5
|
import { SingleDateInput } from "./single-date-input.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { forwardRef, useCallback, useMemo, useRef, useState } from "react";
|
|
8
|
-
import enGB from "date-fns/locale/en-GB";
|
|
8
|
+
import { enGB } from "date-fns/locale/en-GB";
|
|
9
9
|
import { DayPicker } from "react-day-picker";
|
|
10
10
|
//#region src/date-picker/single-date-picker-popup-content.tsx
|
|
11
11
|
var SingleDatePickerPopupContent = forwardRef(function SingleDatePickerPopupContent(props, ref) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./single-date-picker.wyw-in-js.css";
|
|
2
2
|
import { useIsPhone } from "../use-is-phone.js";
|
|
3
3
|
import { space } from "../design-system/layout.js";
|
|
4
|
+
import { Text } from "../text.js";
|
|
4
5
|
import { Popover } from "../popover/index.js";
|
|
5
6
|
import { MobileDrawer } from "../mobile-drawer.js";
|
|
6
7
|
import { EmptyValue } from "../empty-value.js";
|
|
@@ -12,7 +13,7 @@ import { RelativeDatePicker } from "./relative-date-picker.js";
|
|
|
12
13
|
import { SingleDatePickerPopupContent } from "./single-date-picker-popup-content.js";
|
|
13
14
|
/* empty css */
|
|
14
15
|
import { cx } from "@linaria/core";
|
|
15
|
-
import {
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
17
|
import { forwardRef, useCallback, useRef, useState } from "react";
|
|
17
18
|
import { stopPropagation } from "@fibery/react/src/stop-propagation";
|
|
18
19
|
import moment from "moment";
|
|
@@ -100,7 +101,7 @@ var SingleDatePicker = forwardRef((props, ref) => {
|
|
|
100
101
|
disabled,
|
|
101
102
|
isPickerOpen: open,
|
|
102
103
|
size,
|
|
103
|
-
children: !dateValueFormatted ? /* @__PURE__ */ jsx(EmptyValue, { children: placeholder }) : /* @__PURE__ */ jsx(
|
|
104
|
+
children: !dateValueFormatted ? /* @__PURE__ */ jsx(EmptyValue, { children: placeholder }) : /* @__PURE__ */ jsx(Text, { children: dateValueFormatted })
|
|
104
105
|
});
|
|
105
106
|
if (disabled) return pickerValue;
|
|
106
107
|
if (isPhone) return /* @__PURE__ */ jsx(MobileDrawer, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { localStorage } from "../../storage.js";
|
|
1
2
|
//#region src/emoji-picker/utils/store.ts
|
|
2
3
|
/** "hard-forked" as is from https://github.dev/missive/emoji-mart/blob/v3.0.1/src/utils/store.js */
|
|
3
4
|
var NAMESPACE = "emoji-mart";
|
|
@@ -11,13 +12,13 @@ function update(state) {
|
|
|
11
12
|
function set(key, value) {
|
|
12
13
|
if (!isLocalStorageSupported) return;
|
|
13
14
|
try {
|
|
14
|
-
|
|
15
|
+
localStorage.setItem(`${NAMESPACE}.${key}`, JSON.stringify(value));
|
|
15
16
|
} catch (e) {}
|
|
16
17
|
}
|
|
17
18
|
function get(key) {
|
|
18
19
|
if (!isLocalStorageSupported) return;
|
|
19
20
|
try {
|
|
20
|
-
const value =
|
|
21
|
+
const value = localStorage.getItem(`${NAMESPACE}.${key}`);
|
|
21
22
|
if (value) return JSON.parse(value);
|
|
22
23
|
} catch (e) {
|
|
23
24
|
return;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "./file-item-preview.wyw-in-js.css";
|
|
2
|
+
import { prettySize } from "../pretty-size.js";
|
|
3
|
+
import { FileTitle } from "./file-title.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/file-item/file-item-preview.tsx
|
|
7
|
+
function FileItemPreview({ url, name, size }) {
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
9
|
+
className: "cohm7dd",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx("img", {
|
|
12
|
+
className: "c6i3xzf",
|
|
13
|
+
alt: "",
|
|
14
|
+
src: url
|
|
15
|
+
}),
|
|
16
|
+
name && /* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: "ct3uap9",
|
|
18
|
+
children: /* @__PURE__ */ jsx(FileTitle, {
|
|
19
|
+
title: name,
|
|
20
|
+
maxWidth: 160
|
|
21
|
+
})
|
|
22
|
+
}),
|
|
23
|
+
typeof size === "number" && /* @__PURE__ */ jsx("div", {
|
|
24
|
+
className: "cedwxvn",
|
|
25
|
+
children: prettySize(size, "short")
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { FileItemPreview };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
.cohm7dd{overflow:hidden;display:flex;flex-direction:column;gap:6px;width:160px;}
|
|
2
|
+
.c6i3xzf{border:var(--stroke-shortcut);border-radius:2px;object-fit:cover;overflow:hidden;flex-shrink:0;}
|
|
3
|
+
.ct3uap9{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-weight:500;font-size:12px;color:var(--fg-shortcut);}
|
|
4
|
+
.cedwxvn{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-weight:500;font-size:12px;color:var(--fg-subtle);}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
//#region src/form-field-loader.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type Props = {
|
|
4
|
+
control?: "input" | "select";
|
|
5
5
|
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
};
|
|
7
|
+
export declare function FormFieldLoader({ control, children }: Props): import("react").JSX.Element;
|
|
9
8
|
//#endregion
|
package/lib/form-field-loader.js
CHANGED
|
@@ -2,17 +2,14 @@ import "./form-field-loader.wyw-in-js.css";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { cx } from "@linaria/core";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { PureComponent } from "react";
|
|
6
5
|
//#region src/form-field-loader.tsx
|
|
7
6
|
var loaderStyle = "l1dzhgi2-loader";
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
};
|
|
7
|
+
var selectStyle = "spfwcta-select";
|
|
8
|
+
function FormFieldLoader({ control = "input", children }) {
|
|
9
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className: cx(loaderStyle, control === "select" && selectStyle),
|
|
11
|
+
children
|
|
12
|
+
});
|
|
13
|
+
}
|
|
17
14
|
//#endregion
|
|
18
15
|
export { FormFieldLoader };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
.l1dzhgi2-loader{
|
|
1
|
+
.l1dzhgi2-loader{display:flex;align-items:center;box-sizing:border-box;height:36px;padding:0 12px;border-radius:6px;box-shadow:var(--shadow-input) inset;background-color:var(--bg-input);}
|
|
2
|
+
.spfwcta-select{padding-left:10px;}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.lq7y9uh-listRowSurfaceStylesBase{max-width:100%;flex-basis:100%;display:flex;cursor:pointer;align-items:center;align-content:center;padding:0 4px;column-gap:4px;color:var(--fg);border-radius:6px;
|
|
1
|
+
.lq7y9uh-listRowSurfaceStylesBase{max-width:100%;flex-basis:100%;display:flex;cursor:pointer;align-items:center;align-content:center;padding:0 4px;column-gap:4px;color:var(--fg);border-radius:6px;}.lq7y9uh-listRowSurfaceStylesBase:focus{outline:none;}.lq7y9uh-listRowSurfaceStylesBase.natural-hover:hover,.lq7y9uh-listRowSurfaceStylesBase.hover{cursor:pointer;}.lq7y9uh-listRowSurfaceStylesBase.done{cursor:not-allowed;opacity:var(--opacity-list-item_disabled);}.lq7y9uh-listRowSurfaceStylesBase.selected{cursor:default;}
|
|
2
2
|
.lvun1on-listRowSurfaceStatesDefault{background-color:var(--bg-list-item);}.lvun1on-listRowSurfaceStatesDefault.natural-hover:hover,.lvun1on-listRowSurfaceStatesDefault.hover{cursor:pointer;background-color:var(--bg-list-item_hover);}.lvun1on-listRowSurfaceStatesDefault[data-highlighted]{background-color:var(--bg-list-item_focus);}.lvun1on-listRowSurfaceStatesDefault.natural-focus:focus,.lvun1on-listRowSurfaceStatesDefault.focus{background-color:var(--bg-list-item_focus);}.lvun1on-listRowSurfaceStatesDefault.natural-focus:focus.natural-hover:hover,.lvun1on-listRowSurfaceStatesDefault.focus.natural-hover:hover,.lvun1on-listRowSurfaceStatesDefault.natural-focus:focus.hover,.lvun1on-listRowSurfaceStatesDefault.focus.hover{background-color:var(--bg-list-item_focus);}.lvun1on-listRowSurfaceStatesDefault.done,.lvun1on-listRowSurfaceStatesDefault[data-disabled]{cursor:not-allowed;opacity:var(--opacity-list-item_disabled);background-color:var(--bg-list-item_disabled);}.lvun1on-listRowSurfaceStatesDefault.done.natural-hover:hover,.lvun1on-listRowSurfaceStatesDefault[data-disabled].natural-hover:hover,.lvun1on-listRowSurfaceStatesDefault.done.hover,.lvun1on-listRowSurfaceStatesDefault[data-disabled].hover,.lvun1on-listRowSurfaceStatesDefault.done.natural-focus:focus,.lvun1on-listRowSurfaceStatesDefault[data-disabled].natural-focus:focus,.lvun1on-listRowSurfaceStatesDefault.done.focus,.lvun1on-listRowSurfaceStatesDefault[data-disabled].focus{background-color:var(--bg-list-item_disabled);}.lvun1on-listRowSurfaceStatesDefault.selected{cursor:default;background-color:var(--bg-list-item_selected);}.lvun1on-listRowSurfaceStatesDefault.selected.natural-hover:hover,.lvun1on-listRowSurfaceStatesDefault.selected.hover{background-color:var(--bg-list-item_selected_hover);}.lvun1on-listRowSurfaceStatesDefault.selected.natural-focus:focus,.lvun1on-listRowSurfaceStatesDefault.selected.focus{background-color:var(--bg-list-item_selected_focus);}
|
|
3
3
|
.l1sgv498-listRowSurfaceStatesDark{background-color:var(--bg-navigation-item);}.l1sgv498-listRowSurfaceStatesDark.natural-hover:hover,.l1sgv498-listRowSurfaceStatesDark.hover{cursor:pointer;background-color:var(--bg-navigation-item_hover);}.l1sgv498-listRowSurfaceStatesDark.natural-focus:focus,.l1sgv498-listRowSurfaceStatesDark.focus{background-color:var(--bg-navigation-item_focus);}.l1sgv498-listRowSurfaceStatesDark.natural-focus:focus.natural-hover:hover,.l1sgv498-listRowSurfaceStatesDark.focus.natural-hover:hover,.l1sgv498-listRowSurfaceStatesDark.natural-focus:focus.hover,.l1sgv498-listRowSurfaceStatesDark.focus.hover{background-color:var(--bg-navigation-item_focus);}.l1sgv498-listRowSurfaceStatesDark.done{cursor:not-allowed;opacity:var(--opacity-list-item_disabled);background-color:var(--bg-list-item_disabled);}.l1sgv498-listRowSurfaceStatesDark.done.natural-hover:hover,.l1sgv498-listRowSurfaceStatesDark.done.hover,.l1sgv498-listRowSurfaceStatesDark.done.natural-focus:focus,.l1sgv498-listRowSurfaceStatesDark.done.focus{background-color:var(--bg-list-item_disabled);}.l1sgv498-listRowSurfaceStatesDark.selected{cursor:default;background-color:var(--bg-navigation-item_selected);}.l1sgv498-listRowSurfaceStatesDark.selected.natural-hover:hover,.l1sgv498-listRowSurfaceStatesDark.selected.hover{background-color:var(--bg-navigation-item_selected_hover);cursor:default;}.l1sgv498-listRowSurfaceStatesDark.selected.natural-focus:focus,.l1sgv498-listRowSurfaceStatesDark.selected.focus{background-color:var(--bg-navigation-item_selected_focus);}
|
|
4
4
|
.lzpqa66-ListRowContentRoot{flex-basis:100%;display:flex;justify-content:stretch;align-items:center;overflow:hidden;gap:4px;}
|
|
@@ -3,8 +3,6 @@ import { ReactNode } from "react";
|
|
|
3
3
|
export declare const OpenPopoverTrackerProvider: ({ children }: {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
}) => import("react").JSX.Element;
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
onOpenChange: (open: boolean) => void;
|
|
9
|
-
};
|
|
6
|
+
export declare const useHasOpenPopover: () => boolean;
|
|
7
|
+
export declare const useOpenPopoverChange: () => (open: boolean) => void;
|
|
10
8
|
//#endregion
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useId,
|
|
2
|
+
import { useCallback, useEffect, useId, useState } from "react";
|
|
3
3
|
import { createContext as createContext$1 } from "@fibery/react/src/create-context";
|
|
4
4
|
//#region src/open-popover-tracker.tsx
|
|
5
|
-
var [
|
|
6
|
-
|
|
7
|
-
setOpenPopovers: () => {}
|
|
8
|
-
});
|
|
5
|
+
var [OpenPopoversProvider, useOpenPopovers] = createContext$1("OpenPopoversContext", /* @__PURE__ */ new Set());
|
|
6
|
+
var [SetOpenPopoversProvider, useSetOpenPopovers] = createContext$1("SetOpenPopoversContext", () => {});
|
|
9
7
|
var OpenPopoverTrackerProvider = ({ children }) => {
|
|
10
8
|
const [openPopovers, setOpenPopovers] = useState(/* @__PURE__ */ new Set());
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return /* @__PURE__ */ jsx(Provider, {
|
|
18
|
-
value,
|
|
19
|
-
children
|
|
9
|
+
return /* @__PURE__ */ jsx(SetOpenPopoversProvider, {
|
|
10
|
+
value: setOpenPopovers,
|
|
11
|
+
children: /* @__PURE__ */ jsx(OpenPopoversProvider, {
|
|
12
|
+
value: openPopovers,
|
|
13
|
+
children
|
|
14
|
+
})
|
|
20
15
|
});
|
|
21
16
|
};
|
|
22
|
-
var
|
|
23
|
-
|
|
17
|
+
var useHasOpenPopover = () => useOpenPopovers().size > 0;
|
|
18
|
+
var useOpenPopoverChange = () => {
|
|
19
|
+
const setOpenPopovers = useSetOpenPopovers();
|
|
24
20
|
const popoverId = useId();
|
|
25
21
|
const cleanup = useCallback(() => {
|
|
26
22
|
setOpenPopovers((prev) => {
|
|
@@ -35,7 +31,7 @@ var useOpenPopoverTracker = () => {
|
|
|
35
31
|
cleanup();
|
|
36
32
|
};
|
|
37
33
|
}, []);
|
|
38
|
-
|
|
34
|
+
return useCallback((open) => {
|
|
39
35
|
setOpenPopovers((prev) => {
|
|
40
36
|
if (open) {
|
|
41
37
|
const next = new Set(prev);
|
|
@@ -48,10 +44,6 @@ var useOpenPopoverTracker = () => {
|
|
|
48
44
|
} else return prev;
|
|
49
45
|
});
|
|
50
46
|
}, [popoverId, setOpenPopovers]);
|
|
51
|
-
return {
|
|
52
|
-
hasOpenPopover: openPopovers.size > 0,
|
|
53
|
-
onOpenChange
|
|
54
|
-
};
|
|
55
47
|
};
|
|
56
48
|
//#endregion
|
|
57
|
-
export { OpenPopoverTrackerProvider,
|
|
49
|
+
export { OpenPopoverTrackerProvider, useHasOpenPopover, useOpenPopoverChange };
|
package/lib/popover/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import "./index.wyw-in-js.css";
|
|
|
2
2
|
import { useIsPhone } from "../use-is-phone.js";
|
|
3
3
|
import { ThemeProvider } from "../theme-provider.js";
|
|
4
4
|
import { space } from "../design-system/layout.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useOpenPopoverChange } from "../open-popover-tracker.js";
|
|
6
6
|
import { getElementRef } from "./get-element-ref.js";
|
|
7
7
|
import { MobilePopoverProvider } from "./mobile-popover-context.js";
|
|
8
8
|
import { MobilePopover } from "./mobile-popover.js";
|
|
@@ -40,7 +40,7 @@ var PopoverRoot = (props) => {
|
|
|
40
40
|
onOpenChange?.(false);
|
|
41
41
|
onClose?.(event);
|
|
42
42
|
}, [onOpenChange, onClose]);
|
|
43
|
-
const
|
|
43
|
+
const onOpenPopoverChange = useOpenPopoverChange();
|
|
44
44
|
useEffect(() => {
|
|
45
45
|
onOpenPopoverChange(open);
|
|
46
46
|
return () => onOpenPopoverChange(false);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { UiKitStorageKey } from "./storage.js";
|
|
1
2
|
//#region src/preference-setting.d.ts
|
|
2
3
|
export declare function createPreferenceSetting<T>({ key, parse, stringify, defaultValue }: {
|
|
3
|
-
key:
|
|
4
|
+
key: UiKitStorageKey;
|
|
4
5
|
parse: (raw: string) => T | undefined;
|
|
5
6
|
stringify: (value: T) => string;
|
|
6
7
|
defaultValue: T;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { localStorage } from "./storage.js";
|
|
1
2
|
import { makeSubject } from "@fibery/helpers/src/subject";
|
|
2
3
|
//#region src/preference-setting.ts
|
|
3
4
|
function createPreferenceSetting({ key, parse, stringify, defaultValue }) {
|
|
@@ -34,16 +35,15 @@ function createPreferenceSetting({ key, parse, stringify, defaultValue }) {
|
|
|
34
35
|
cb(value);
|
|
35
36
|
};
|
|
36
37
|
const unsubscribe = values.subscribe(tracked);
|
|
37
|
-
const
|
|
38
|
+
const unsubscribeOtherTabs = localStorage.subscribe(key, () => {
|
|
38
39
|
const next = load();
|
|
39
40
|
if (prev !== next) {
|
|
40
41
|
prev = next;
|
|
41
42
|
cb(next);
|
|
42
43
|
}
|
|
43
|
-
};
|
|
44
|
-
window.addEventListener("storage", storageListener);
|
|
44
|
+
});
|
|
45
45
|
return () => {
|
|
46
|
-
|
|
46
|
+
unsubscribeOtherTabs();
|
|
47
47
|
unsubscribe();
|
|
48
48
|
};
|
|
49
49
|
}
|