@fibery/ui-kit 13.0.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/actions-menu/actions-menu-item.js +4 -3
- 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/index.js +1 -1
- package/lib/command-menu/nested-command-menu.js +1 -1
- package/lib/date-picker/contexts.d.ts +2 -0
- package/lib/date-picker/contexts.js +2 -1
- package/lib/date-picker/date-range-picker-popup-content.js +12 -8
- package/lib/date-picker/date-range-picker.js +3 -2
- package/lib/date-picker/day-with-start-end-buttons.js +13 -18
- 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/empty-state/empty-state.wyw-in-js.css +2 -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 +3 -3
- package/lib/preference-setting.d.ts +2 -1
- package/lib/preference-setting.js +4 -4
- 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 +19 -12
- 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 +3 -3
- 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/tab-nav/tab-nav.js +1 -1
- 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/type-badge.js +3 -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", {
|
|
@@ -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,
|
|
@@ -6,9 +6,9 @@ import ClearInputFilled from "../icons/react/clear-input-filled.js";
|
|
|
6
6
|
import { cx } from "@linaria/core";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { forwardRef, useRef, useState } from "react";
|
|
9
|
+
import { useComposedRefs } from "@fibery/react/src/use-composed-refs";
|
|
9
10
|
import { useControllableState } from "@fibery/react/src/use-controllable-state";
|
|
10
11
|
import { styled } from "@linaria/react";
|
|
11
|
-
import { useComposedRefs } from "@fibery/react/src/use-composed-refs";
|
|
12
12
|
import { CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandRoot, CommandSeparator } from "cmdk";
|
|
13
13
|
//#region src/command-menu/index.tsx
|
|
14
14
|
var _exp = () => CommandRoot;
|
|
@@ -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,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { DateRange } from "react-day-picker";
|
|
2
3
|
//#region src/date-picker/contexts.d.ts
|
|
3
4
|
export declare const StartEndFocusContext: import("react").Context<{
|
|
4
5
|
focusOnStart: boolean;
|
|
5
6
|
setFocusOnStart: Dispatch<SetStateAction<boolean>>;
|
|
7
|
+
onRangeClick: (range: DateRange) => void;
|
|
6
8
|
}>;
|
|
7
9
|
//#endregion
|
|
@@ -3,7 +3,8 @@ import { noop } from "@fibery/helpers/src/_";
|
|
|
3
3
|
//#region src/date-picker/contexts.ts
|
|
4
4
|
var StartEndFocusContext = createContext({
|
|
5
5
|
focusOnStart: true,
|
|
6
|
-
setFocusOnStart: noop
|
|
6
|
+
setFocusOnStart: noop,
|
|
7
|
+
onRangeClick: noop
|
|
7
8
|
});
|
|
8
9
|
//#endregion
|
|
9
10
|
export { StartEndFocusContext };
|
|
@@ -10,7 +10,8 @@ import { DateRangeInput } from "./date-range-input.js";
|
|
|
10
10
|
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
|
-
import
|
|
13
|
+
import { noop } from "@fibery/helpers/src/_";
|
|
14
|
+
import { enGB } from "date-fns/locale/en-GB";
|
|
14
15
|
import { DayPicker } from "react-day-picker";
|
|
15
16
|
import { formatDuration, intervalToDuration, roundToNearestMinutes } from "date-fns";
|
|
16
17
|
//#region src/date-picker/date-range-picker-popup-content.tsx
|
|
@@ -44,7 +45,7 @@ var DateRangePickerPopupContent = forwardRef((props, ref) => {
|
|
|
44
45
|
setPrevEndValue(null);
|
|
45
46
|
setCurrentEndValue(null);
|
|
46
47
|
}, [onChange]);
|
|
47
|
-
const
|
|
48
|
+
const onRangeClick = useCallback(({ from, to }) => {
|
|
48
49
|
if (!to) setCurrentStartValue(from ?? null);
|
|
49
50
|
else {
|
|
50
51
|
const { from: sortedFrom, to: sortedTo } = sortDates({
|
|
@@ -63,9 +64,13 @@ var DateRangePickerPopupContent = forwardRef((props, ref) => {
|
|
|
63
64
|
dateFormat,
|
|
64
65
|
dateTimeFormat
|
|
65
66
|
});
|
|
66
|
-
const
|
|
67
|
+
const roundedEnd = currentEndValue && roundToNearestMinutes(currentEndValue);
|
|
68
|
+
const duration = currentStartValue && roundedEnd ? formatDuration(intervalToDuration(currentStartValue <= roundedEnd ? {
|
|
67
69
|
start: currentStartValue,
|
|
68
|
-
end:
|
|
70
|
+
end: roundedEnd
|
|
71
|
+
} : {
|
|
72
|
+
start: roundedEnd,
|
|
73
|
+
end: currentStartValue
|
|
69
74
|
}), showTime ? { format: [
|
|
70
75
|
"years",
|
|
71
76
|
"months",
|
|
@@ -111,7 +116,8 @@ var DateRangePickerPopupContent = forwardRef((props, ref) => {
|
|
|
111
116
|
/* @__PURE__ */ jsx(StartEndFocusContext.Provider, {
|
|
112
117
|
value: {
|
|
113
118
|
focusOnStart,
|
|
114
|
-
setFocusOnStart
|
|
119
|
+
setFocusOnStart,
|
|
120
|
+
onRangeClick
|
|
115
121
|
},
|
|
116
122
|
children: /* @__PURE__ */ jsx(DayPicker, {
|
|
117
123
|
mode: "default",
|
|
@@ -137,12 +143,10 @@ var DateRangePickerPopupContent = forwardRef((props, ref) => {
|
|
|
137
143
|
from: currentStartValue || void 0,
|
|
138
144
|
to: currentEndValue || void 0
|
|
139
145
|
},
|
|
140
|
-
onDayClick,
|
|
146
|
+
onDayClick: noop,
|
|
141
147
|
disabled,
|
|
142
148
|
locale: enGB,
|
|
143
149
|
weekStartsOn,
|
|
144
|
-
focusOnStart,
|
|
145
|
-
setFocusOnStart,
|
|
146
150
|
fixedWeeks: true
|
|
147
151
|
})
|
|
148
152
|
}),
|
|
@@ -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,
|
|
@@ -19,7 +19,7 @@ var DayWithStartEndButtons = (props) => {
|
|
|
19
19
|
const dayRender = useDayRender(props.date, props.displayMonth, buttonRef);
|
|
20
20
|
const { focusDayAfter, focusDayBefore, focusWeekAfter, focusWeekBefore, focusMonthBefore, focusMonthAfter, focusYearBefore, focusYearAfter, focusStartOfWeek, focusEndOfWeek } = useFocusContext();
|
|
21
21
|
const dayPicker = useDayPicker();
|
|
22
|
-
const { focusOnStart, setFocusOnStart } = useContext(StartEndFocusContext);
|
|
22
|
+
const { focusOnStart, setFocusOnStart, onRangeClick } = useContext(StartEndFocusContext);
|
|
23
23
|
const onKeyDown = (e) => {
|
|
24
24
|
switch (e.key) {
|
|
25
25
|
case "ArrowLeft":
|
|
@@ -68,28 +68,23 @@ var DayWithStartEndButtons = (props) => {
|
|
|
68
68
|
};
|
|
69
69
|
if (dayRender.isHidden) return /* @__PURE__ */ jsx(Fragment, {});
|
|
70
70
|
if (!dayRender.isButton) return /* @__PURE__ */ jsx("div", { ...dayRender.divProps });
|
|
71
|
-
const onDayClick = dayPicker.onDayClick;
|
|
72
71
|
const selected = dayPicker?.selected;
|
|
73
72
|
const from = selected?.from;
|
|
74
73
|
const to = selected?.to;
|
|
75
74
|
const current = props.date;
|
|
76
|
-
const handleClickStart = (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
setFocusOnStart(true);
|
|
83
|
-
}
|
|
75
|
+
const handleClickStart = () => {
|
|
76
|
+
onRangeClick({
|
|
77
|
+
from: current,
|
|
78
|
+
to
|
|
79
|
+
});
|
|
80
|
+
setFocusOnStart(true);
|
|
84
81
|
};
|
|
85
|
-
const handleClickEnd = (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
setFocusOnStart(false);
|
|
92
|
-
}
|
|
82
|
+
const handleClickEnd = () => {
|
|
83
|
+
onRangeClick({
|
|
84
|
+
from,
|
|
85
|
+
to: current
|
|
86
|
+
});
|
|
87
|
+
setFocusOnStart(false);
|
|
93
88
|
};
|
|
94
89
|
const renderStart = from === void 0 || to === void 0 && isBefore(current, from) || isAfter(to, current) || isSameDay(to, current);
|
|
95
90
|
const renderEnd = from !== void 0 && (isBefore(from, current) || isSameDay(from, current));
|
|
@@ -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;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
.e1a8t525-emptyState{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:16px;padding:0 12px 48px 12px;}.evd7pvk-emptyStateAnchor .e1a8t525-emptyState{position:absolute;inset:0;justify-content:flex-start;padding:112px 12px 160px;pointer-events:none;}.evd7pvk-emptyStateAnchor .e1a8t525-emptyState >*{pointer-events:auto;}.evd7pvk-emptyStateAnchor .e1a8t525-emptyState >:first-child{margin-top:auto;}.evd7pvk-emptyStateAnchor .e1a8t525-emptyState >:last-child{margin-bottom:auto;}
|
|
3
3
|
.s4xl8iq-stretch{height:100%;}
|
|
4
4
|
.ccb77kb-content{display:flex;max-width:100%;flex-direction:column;align-items:center;gap:6px;}
|
|
5
|
-
.h1tsx60n-heading{color:var(--fg);margin:0;}
|
|
6
|
-
.drng4yd-description{color:var(--fg-subtle);margin:0;max-width:100%;}
|
|
5
|
+
.h1tsx60n-heading{color:var(--fg);margin:0;text-wrap:balance;}
|
|
6
|
+
.drng4yd-description{color:var(--fg-subtle);margin:0;text-wrap:balance;max-width:100%;}
|
|
@@ -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
|