@fibery/ui-kit 3.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/esfint.config.mjs +0 -17
- package/package.json +18 -13
- package/scripts/generate-icons.mjs +45 -44
- package/src/actions-menu/actions-menu-item.tsx +2 -1
- package/src/actions-menu/actions-menu.tsx +1 -3
- package/src/actions-menu/context-actions-menu.tsx +1 -1
- package/src/animated-height-container.tsx +1 -1
- package/src/antd/ant-modal.tsx +158 -9
- package/src/antd/ant-upload.tsx +285 -27
- package/src/antd/auto-complete.tsx +145 -0
- package/src/antd/auto-width-transparent-textarea.tsx +9 -2
- package/src/antd/global-overrides.ts +352 -0
- package/src/antd/index.tsx +3 -2
- package/src/antd/input-number.tsx +97 -11
- package/src/antd/input.tsx +127 -8
- package/src/antd/styles.ts +92 -32
- package/src/antd/tabs.tsx +139 -27
- package/src/app-icon-with-fallback.tsx +3 -7
- package/src/app-icon-wrapper.tsx +1 -13
- package/src/avatar.tsx +2 -56
- package/src/breadcrumb.tsx +5 -1
- package/src/color-adjuster.ts +24 -1
- package/src/color-utils.test.ts +2 -2
- package/src/color-utils.ts +2 -2
- package/src/copy-to-clipboard.ts +14 -3
- package/src/count-badge.tsx +10 -1
- package/src/date-picker/contexts.ts +6 -3
- package/src/date-picker/date-range-picker.tsx +7 -8
- package/src/date-picker/single-date-picker.tsx +3 -5
- package/src/date-picker/types.ts +1 -1
- package/src/date-picker/with-popup-control.tsx +3 -9
- package/src/day-select/iso-week-day-select.tsx +2 -2
- package/src/design-system/colors-callout.warm-dark.test.ts +22 -22
- package/src/design-system/colors-callout.warm-light.test.ts +19 -19
- package/src/design-system/colors-css.ts +1 -1
- package/src/design-system/colors-enum.dark.warm.test.ts +63 -63
- package/src/design-system/colors-enum.light.warm.test.ts +54 -54
- package/src/design-system/colors-highlight.warm-dark.test.ts +21 -21
- package/src/design-system/colors-highlight.warm-light.test.ts +21 -21
- package/src/design-system/colors.ts +4 -4
- package/src/design-system/fns.badge.dark.warm.test.ts +34 -34
- package/src/design-system/fns.badge.light.warm.test.ts +31 -31
- package/src/design-system/fns.deneutralize.test.ts +44 -0
- package/src/design-system/fns.icon.dark.warm.test.ts +21 -21
- package/src/design-system/fns.icon.light.warm.test.ts +17 -17
- package/src/design-system/fns.icon.ts +21 -13
- package/src/design-system/fns.ts +27 -3
- package/src/design-system/typography.ts +1 -1
- package/src/design-system.ts +1 -1
- package/src/emoji-picker/icon-emoji-picker.tsx +3 -3
- package/src/fibermoji-placeholder.tsx +2 -3
- package/src/icons/ast/index.tsx +446 -446
- package/src/icons/icon.tsx +23 -1
- package/src/icons/icons-integrity.test.ts +145 -0
- package/src/icons/react/index.tsx +446 -446
- package/src/icons/types.ts +1 -1
- package/src/images-gallery/images-gallery.tsx +2 -2
- package/src/images-gallery/slide-buttons.tsx +2 -4
- package/src/layout-styles.ts +5 -1
- package/src/link-input/components/ant-text-area-with-custom-read-state.tsx +2 -1
- package/src/lists/actions-menu-row-surface.tsx +1 -1
- package/src/media-query-utils.ts +5 -14
- package/src/mobile-keyboard-aware-popup.tsx +1 -1
- package/src/number-input/decimal.ts +6 -9
- package/src/number-input/number-input-inline-with-autosize.tsx +1 -1
- package/src/online-users.tsx +4 -5
- package/src/palettes/inspect.defs.colors.neutral-arch.test.ts +4 -4
- package/src/palettes/inspect.defs.colors.neutral-user.test.ts +4 -4
- package/src/palettes/inspect.defs.colors.warm-arch.test.ts +141 -141
- package/src/palettes/inspect.defs.colors.warm-user.test.ts +141 -141
- package/src/palettes/warm.ts +2 -0
- package/src/popover/index.tsx +4 -4
- package/src/popover/mobile-popover-context.tsx +1 -1
- package/src/popover/modifiers.tsx +1 -1
- package/src/rich-input-loader.tsx +1 -1
- package/src/root-theme-provider.test.tsx +1 -1
- package/src/select/components/menu-list-virtua.tsx +15 -16
- package/src/select/components/menu-list-virtualized.tsx +26 -29
- package/src/select/components/menu.tsx +3 -3
- package/src/select/index.tsx +4 -4
- package/src/select/reflection.ts +4 -5
- package/src/select/select-in-popover.tsx +34 -51
- package/src/select/select.tsx +5 -5
- package/src/select/styles.ts +1 -7
- package/src/select/util.ts +2 -2
- package/src/theme-provider.test.tsx +1 -1
- package/src/theme-provider.tsx +3 -9
- package/src/theme-snapshots.test.ts +9 -13
- package/src/{theming/build.ts → theming.build.ts} +6 -9
- package/src/{theming/theming-fibery.snapshot.css → theming.generated.css} +60 -60
- package/src/{theming/theming-fibery.snapshot.ts → theming.generated.ts} +60 -60
- package/src/type-badge.tsx +1 -2
- package/src/{themed-ink.tsx → type-label.tsx} +2 -5
- package/src/use-on-screen-keyboard-data.tsx +1 -1
- package/src/with-data.tsx +1 -1
- package/src/antd/auto-complete.d.ts +0 -2
- package/src/antd/auto-complete.ts +0 -37
- package/src/antd/tabs.d.ts +0 -5
- package/src/theming/index.ts +0 -20
- package/src/theming/theming-vzdbery.snapshot.css +0 -2001
- package/src/theming/theming-vzdbery.snapshot.ts +0 -2519
package/src/icons/types.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type IconBaseProps = Omit<SVGProps<SVGSVGElement>, "ref" | "color"> & {
|
|
|
26
26
|
iconSize?: number;
|
|
27
27
|
/** Pass null to inherit parent's color */
|
|
28
28
|
color?: string | null | undefined;
|
|
29
|
-
/** Skip
|
|
29
|
+
/** Skip deneutralize&normalize when the color is already processed for display (e.g. a11y-adjusted) */
|
|
30
30
|
colorProcessed?: boolean;
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {noop} from "@fibery/helpers/src/_";
|
|
2
2
|
|
|
3
3
|
import "photoswipe/style.css";
|
|
4
|
+
import {createContext} from "@fibery/react/src/create-context";
|
|
4
5
|
import {css} from "@linaria/core";
|
|
5
|
-
import noop from "lodash/noop";
|
|
6
6
|
/* eslint-disable max-lines */
|
|
7
7
|
import PhotoSwipeLightbox, {type PhotoSwipeEventsMap, type PhotoSwipeOptions} from "photoswipe/lightbox";
|
|
8
8
|
import type {PropsWithChildren} from "react";
|
|
@@ -245,11 +245,9 @@ function CopyURLButton({pswp, showUI}: {pswp: PhotoSwipe; showUI: () => void}) {
|
|
|
245
245
|
if (src) {
|
|
246
246
|
copyUrlToClipboard({url: src, label: pswp.currSlide.data.label})
|
|
247
247
|
.then(() => {
|
|
248
|
-
toast.success({title: "
|
|
248
|
+
toast.success({title: "Link copied to clipboard"});
|
|
249
249
|
})
|
|
250
|
-
.catch(() => {
|
|
251
|
-
toast.error({title: "Unable to copy."});
|
|
252
|
-
});
|
|
250
|
+
.catch((error) => toast.error({title: "Unable to copy link to clipboard", subTitle: error.message}));
|
|
253
251
|
}
|
|
254
252
|
}}
|
|
255
253
|
size={isPhone ? "large" : "medium"}
|
package/src/layout-styles.ts
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
sidebarMenuItemHeightVar,
|
|
17
17
|
sidebarMenuIconSizeVar,
|
|
18
18
|
menuItemHeightVar,
|
|
19
|
-
} from "./theming";
|
|
19
|
+
} from "./theming.generated";
|
|
20
20
|
|
|
21
21
|
export const layoutStyles = css`
|
|
22
22
|
:global() {
|
|
@@ -40,5 +40,9 @@ export const layoutStyles = css`
|
|
|
40
40
|
${listRowSurfaceFontSizeVar}: ${fontSize.md}px;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
:focus:not(:focus-visible) {
|
|
45
|
+
outline: none;
|
|
46
|
+
}
|
|
43
47
|
}
|
|
44
48
|
`;
|
|
@@ -2,6 +2,7 @@ import {css} from "@linaria/core";
|
|
|
2
2
|
import {useCallback, useRef, useState} from "react";
|
|
3
3
|
|
|
4
4
|
import {AntTextArea} from "../../antd";
|
|
5
|
+
import type {TextAreaRef} from "../../antd/input";
|
|
5
6
|
|
|
6
7
|
const wrapperStyle = css`
|
|
7
8
|
${{
|
|
@@ -33,7 +34,7 @@ export const AntTextAreaWithCustomReadState = ({
|
|
|
33
34
|
...rest
|
|
34
35
|
}: AntTextAreaWithCustomReadStateProps) => {
|
|
35
36
|
const [focus, setFocus] = useState(false);
|
|
36
|
-
const input = useRef<
|
|
37
|
+
const input = useRef<TextAreaRef>(null);
|
|
37
38
|
|
|
38
39
|
const handleFocus = useCallback(
|
|
39
40
|
(e: React.FocusEvent<HTMLTextAreaElement>) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import {noop} from "@fibery/helpers/src/_";
|
|
1
2
|
import {stopPropagation} from "@fibery/react/src/stop-propagation";
|
|
2
3
|
import {useCallbackRef} from "@fibery/react/src/use-callback-ref";
|
|
3
4
|
import {css, cx} from "@linaria/core";
|
|
4
|
-
import noop from "lodash/noop";
|
|
5
5
|
import {forwardRef, useId} from "react";
|
|
6
6
|
|
|
7
7
|
import {useActionsMenuContext} from "../actions-menu";
|
package/src/media-query-utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import noop from "
|
|
1
|
+
import {noop} from "@fibery/helpers/src/_";
|
|
2
2
|
export function getMediaQueryList(query: string) {
|
|
3
3
|
// need for test
|
|
4
4
|
return typeof window !== "undefined" && window.matchMedia
|
|
@@ -7,17 +7,8 @@ export function getMediaQueryList(query: string) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function subscribeOnChange(mediaQueryList: MediaQueryList, cb: (evt: MediaQueryListEvent) => void): () => void {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
mediaQueryList.
|
|
13
|
-
|
|
14
|
-
mediaQueryList.removeEventListener("change", cb);
|
|
15
|
-
};
|
|
16
|
-
} else if (mediaQueryList.addListener) {
|
|
17
|
-
mediaQueryList.addListener(cb);
|
|
18
|
-
return () => {
|
|
19
|
-
mediaQueryList.removeListener(cb);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return noop;
|
|
10
|
+
mediaQueryList.addEventListener("change", cb);
|
|
11
|
+
return () => {
|
|
12
|
+
mediaQueryList.removeEventListener("change", cb);
|
|
13
|
+
};
|
|
23
14
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import trimEnd from "lodash/trimEnd";
|
|
1
|
+
import {truthy} from "@fibery/helpers/src/_";
|
|
3
2
|
|
|
4
3
|
type NumericValue = string | number | null | undefined;
|
|
5
4
|
|
|
6
|
-
const isEmpty = (value: NumericValue): value is null | undefined | "" => isNil(value) || value === "";
|
|
7
|
-
|
|
8
5
|
const getPrecision = (value: NumericValue) => {
|
|
9
|
-
if (
|
|
6
|
+
if (!truthy(value)) {
|
|
10
7
|
return 0;
|
|
11
8
|
}
|
|
12
9
|
const [, decimalPart = ""] = String(value).split(".");
|
|
@@ -14,11 +11,11 @@ const getPrecision = (value: NumericValue) => {
|
|
|
14
11
|
};
|
|
15
12
|
|
|
16
13
|
const removeTrailingZeros = (value: string) => {
|
|
17
|
-
if (
|
|
14
|
+
if (!truthy(value)) {
|
|
18
15
|
return value;
|
|
19
16
|
}
|
|
20
17
|
const hasDecimalPart = value.indexOf(".") > 0;
|
|
21
|
-
return hasDecimalPart ?
|
|
18
|
+
return hasDecimalPart ? value.replace(/\.?0+$/, "") : value;
|
|
22
19
|
};
|
|
23
20
|
|
|
24
21
|
export const add = (first: NumericValue, second: NumericValue) => {
|
|
@@ -32,7 +29,7 @@ export const sub = (first: NumericValue, second: NumericValue) => {
|
|
|
32
29
|
};
|
|
33
30
|
|
|
34
31
|
export const multiplyByHundred = (value: NumericValue) => {
|
|
35
|
-
if (
|
|
32
|
+
if (!truthy(value)) {
|
|
36
33
|
return value;
|
|
37
34
|
}
|
|
38
35
|
const result = Number(value) * 100;
|
|
@@ -41,7 +38,7 @@ export const multiplyByHundred = (value: NumericValue) => {
|
|
|
41
38
|
};
|
|
42
39
|
|
|
43
40
|
export const divideByHundred = (value: NumericValue) => {
|
|
44
|
-
if (
|
|
41
|
+
if (!truthy(value)) {
|
|
45
42
|
return value;
|
|
46
43
|
}
|
|
47
44
|
const result = Number(value) / 100;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import {identity} from "@fibery/helpers/src/_";
|
|
1
2
|
import {stopPropagation} from "@fibery/react/src/stop-propagation";
|
|
2
3
|
import {css, cx} from "@linaria/core";
|
|
3
|
-
import identity from "lodash/identity";
|
|
4
4
|
import InputNumber from "rc-input-number";
|
|
5
5
|
import {useCallback, useMemo, useRef, useState} from "react";
|
|
6
6
|
|
package/src/online-users.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {css, cx} from "@linaria/core";
|
|
2
|
-
import take from "lodash/take";
|
|
3
2
|
import {useEffect, useRef, useState} from "react";
|
|
4
3
|
|
|
5
4
|
import {AvatarImage} from "./avatar";
|
|
@@ -151,8 +150,9 @@ export function OnlineUsers({
|
|
|
151
150
|
</Tooltip>
|
|
152
151
|
</div>
|
|
153
152
|
|
|
154
|
-
{
|
|
155
|
-
(
|
|
153
|
+
{users
|
|
154
|
+
.slice(0, users.length === maxVisibleUsers ? maxVisibleUsers : maxVisibleUsers - 1)
|
|
155
|
+
.map(({id, avatarUrl, hasAccess, name, callBack, isFollowed}, index) => {
|
|
156
156
|
const tooltipDescription = callBack ? "Click to follow" : "";
|
|
157
157
|
const tooltipTitle = hasAccess ? name : "Private User";
|
|
158
158
|
const userBorderColor = theme.fns.deneutralize(getObjectColorMemoized(name));
|
|
@@ -187,8 +187,7 @@ export function OnlineUsers({
|
|
|
187
187
|
</Tooltip>
|
|
188
188
|
</div>
|
|
189
189
|
);
|
|
190
|
-
}
|
|
191
|
-
)}
|
|
190
|
+
})}
|
|
192
191
|
</div>
|
|
193
192
|
{Boolean(triggerElement) && users.length > maxVisibleUsers && (
|
|
194
193
|
<Popover.Root open={visible} onOpen={() => onShow()} onClose={() => onHide()}>
|
|
@@ -741,19 +741,19 @@ test("snapshot", () => {
|
|
|
741
741
|
"#292929 | hsl(none 0% 16%) | oklch(0.28 0 none)",
|
|
742
742
|
],
|
|
743
743
|
"colorBgListItemGeneralSelected": [
|
|
744
|
-
"#
|
|
745
|
-
"#
|
|
744
|
+
"#F7E0D3 | hsl( 22 69% 90%) | oklch(0.92 0.03 52 )",
|
|
745
|
+
"#4C2A16 | hsl( 22 55% 19%) | oklch(0.32 0.06 50 )",
|
|
746
746
|
],
|
|
747
747
|
"colorBgListItemGeneralSelectedDisabled": [
|
|
748
748
|
"#F7E0D3 | hsl( 22 69% 90%) | oklch(0.92 0.03 52 )",
|
|
749
749
|
"#4C2A16 | hsl( 22 55% 19%) | oklch(0.32 0.06 50 )",
|
|
750
750
|
],
|
|
751
751
|
"colorBgListItemGeneralSelectedFocus": [
|
|
752
|
-
"#
|
|
752
|
+
"#F1D1C0 | hsl( 21 64% 85%) | oklch(0.88 0.04 50 )",
|
|
753
753
|
"#58321C | hsl( 22 52% 23%) | oklch(0.36 0.06 50 )",
|
|
754
754
|
],
|
|
755
755
|
"colorBgListItemGeneralSelectedHover": [
|
|
756
|
-
"#
|
|
756
|
+
"#F1D1C0 | hsl( 21 64% 85%) | oklch(0.88 0.04 50 )",
|
|
757
757
|
"#58321C | hsl( 22 52% 23%) | oklch(0.36 0.06 50 )",
|
|
758
758
|
],
|
|
759
759
|
"colorBgLogoCardDark": [
|
|
@@ -741,19 +741,19 @@ test("snapshot", () => {
|
|
|
741
741
|
"#292929 | hsl(none 0% 16%) | oklch(0.28 0 none)",
|
|
742
742
|
],
|
|
743
743
|
"colorBgListItemGeneralSelected": [
|
|
744
|
-
"#
|
|
745
|
-
"#
|
|
744
|
+
"#DBE5FA | hsl( 221 76% 92%) | oklch(0.92 0.03 265 )",
|
|
745
|
+
"#223259 | hsl( 223 45% 24%) | oklch(0.32 0.07 266 )",
|
|
746
746
|
],
|
|
747
747
|
"colorBgListItemGeneralSelectedDisabled": [
|
|
748
748
|
"#DBE5FA | hsl( 221 76% 92%) | oklch(0.92 0.03 265 )",
|
|
749
749
|
"#223259 | hsl( 223 45% 24%) | oklch(0.32 0.07 266 )",
|
|
750
750
|
],
|
|
751
751
|
"colorBgListItemGeneralSelectedFocus": [
|
|
752
|
-
"#
|
|
752
|
+
"#CAD9F6 | hsl( 220 71% 88%) | oklch(0.88 0.04 264 )",
|
|
753
753
|
"#293B66 | hsl( 222 43% 28%) | oklch(0.36 0.08 266 )",
|
|
754
754
|
],
|
|
755
755
|
"colorBgListItemGeneralSelectedHover": [
|
|
756
|
-
"#
|
|
756
|
+
"#CAD9F6 | hsl( 220 71% 88%) | oklch(0.88 0.04 264 )",
|
|
757
757
|
"#293B66 | hsl( 222 43% 28%) | oklch(0.36 0.08 266 )",
|
|
758
758
|
],
|
|
759
759
|
"colorBgLogoCardDark": [
|