@fibery/ui-kit 9.0.1 → 9.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/lib/a11y-color.js +12 -10
- package/lib/actions-menu/actions-menu-item.js +1 -1
- package/lib/actions-menu/actions-menu-props.d.ts +2 -0
- package/lib/actions-menu/actions-menu-separator.d.ts +2 -2
- 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/actions-menu/index.d.ts +3 -3
- 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-number.js +2 -2
- package/lib/antd/input.js +7 -6
- 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/board-table-loader.js +1 -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 +5 -5
- 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 +1 -0
- package/lib/comment.js +29 -20
- package/lib/comment.wyw-in-js.css +9 -7
- package/lib/context-menu/index.js +1 -0
- package/lib/context-menu/index.wyw-in-js.css +1 -1
- package/lib/copy-to-clipboard.js +2 -1
- package/lib/date-picker/autocomplete.js +12 -10
- package/lib/date-picker/date-range-input.js +9 -7
- 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/relative-date-picker.js +5 -3
- package/lib/date-picker/single-date-input.js +9 -7
- package/lib/date-picker/single-date-picker.d.ts +1 -2
- package/lib/date-picker/single-date-picker.js +2 -1
- package/lib/date-picker/types.d.ts +1 -2
- 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.d.ts +6 -0
- package/lib/design-system/alpha.js +11 -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/app-icon-picker.d.ts +2 -2
- package/lib/emoji-picker/emoji-picker-content-with-color.d.ts +2 -2
- package/lib/emoji-picker/emoji-picker.d.ts +2 -2
- package/lib/emoji-picker/icon-emoji-picker.d.ts +1 -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/errors.d.ts +2 -3
- 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/guide-link.js +1 -1
- package/lib/highlight-colors.js +2 -1
- package/lib/hotkey-scope.js +2 -1
- package/lib/icons/ast/build.d.ts +5 -0
- package/lib/icons/ast/build.js +25 -0
- package/lib/icons/ast/index.d.ts +2 -4
- package/lib/icons/ast/index.js +5 -7
- package/lib/icons/ast/spinner.js +8 -15
- package/lib/icons/icon.js +4 -3
- package/lib/icons/react/{plus.d.ts → build.d.ts} +4 -4
- package/lib/icons/react/{plus.js → build.js} +6 -6
- package/lib/icons/react/index.d.ts +2 -4
- package/lib/icons/react/index.js +5 -7
- 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 -2
- package/lib/is-in-popup.d.ts +1 -2
- package/lib/is-in-popup.js +6 -0
- package/lib/loaders.d.ts +1 -9
- package/lib/loaders.js +2 -39
- package/lib/loaders.wyw-in-js.css +2 -4
- 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 +4 -3
- 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 +9 -12
- package/lib/popover/index.js +66 -75
- package/lib/popover/mobile-popover-context.js +12 -11
- package/lib/popover/mobile-popover.d.ts +2 -2
- package/lib/popover/mobile-popover.js +16 -15
- package/lib/popover/modifiers.js +4 -4
- package/lib/popover/popup-modifiers-context.d.ts +3 -5
- 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/drop-down-indicator.js +1 -1
- package/lib/select/components/menu-list-virtualized.js +1 -1
- package/lib/select/components/option.js +2 -1
- package/lib/select/index.d.ts +2 -1
- package/lib/select/select-in-popover.js +1 -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 +13 -8
- package/lib/select/styles.js +2 -2
- package/lib/spinner.d.ts +5 -0
- package/lib/spinner.js +17 -0
- 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/theme-settings-core.d.ts +13 -1
- package/lib/theme-settings-core.js +37 -1
- package/lib/theme-settings.d.ts +3 -2
- package/lib/theme-settings.js +7 -2
- 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/use-long-press.d.ts +6 -6
- package/lib/with-data.d.ts +35 -37
- package/lib/with-data.js +23 -22
- package/lib/workflow-progress-icon.js +2 -2
- package/package.json +4 -4
- package/lib/beta-badge.d.ts +0 -8
- package/lib/beta-badge.js +0 -13
- package/lib/beta-badge.wyw-in-js.css +0 -1
- package/lib/checkbox-multi-select.d.ts +0 -21
- package/lib/checkbox-multi-select.js +0 -41
- package/lib/checkbox-multi-select.wyw-in-js.css +0 -3
- package/lib/country-selector.d.ts +0 -9
- package/lib/country-selector.js +0 -21
- 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/layout.d.ts +0 -28
- package/lib/layout.js +0 -66
- package/lib/layout.wyw-in-js.css +0 -2
- package/lib/new-card-placeholder.d.ts +0 -26
- package/lib/new-card-placeholder.js +0 -141
- package/lib/new-card-placeholder.wyw-in-js.css +0 -5
- 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
package/lib/card-container.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./card-container.wyw-in-js.css";
|
|
2
2
|
import { visuallyHidden } from "./styles-utils.js";
|
|
3
|
-
import { getBg } from "./box.js";
|
|
4
3
|
import { CardHiddenLink } from "./card-hidden-link.js";
|
|
4
|
+
import { getBg } from "./box.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import cx from "classnames";
|
|
@@ -158,13 +158,13 @@ var CompactCardContainer = ({ title, floating, backgroundColors }) => {
|
|
|
158
158
|
};
|
|
159
159
|
var titleUnitsContainerClassName = "t5lzfm0-titleUnitsContainer";
|
|
160
160
|
var UnitGroup = ({ renderedUnits }) => {
|
|
161
|
-
return renderedUnits ? /* @__PURE__ */ jsx(Fragment, { children: renderedUnits
|
|
161
|
+
return renderedUnits ? /* @__PURE__ */ jsx(Fragment, { children: renderedUnits }) : null;
|
|
162
162
|
};
|
|
163
163
|
var TitleUnitGroup = ({ renderedUnits, className }) => {
|
|
164
|
-
return renderedUnits ? /* @__PURE__ */ jsx(Fragment, { children: renderedUnits.map((
|
|
164
|
+
return renderedUnits ? /* @__PURE__ */ jsx(Fragment, { children: renderedUnits.map((element) => /* @__PURE__ */ jsx("div", {
|
|
165
165
|
className: cx(titleUnitsContainerClassName, className),
|
|
166
|
-
children:
|
|
167
|
-
},
|
|
166
|
+
children: element
|
|
167
|
+
}, element.key)) }) : null;
|
|
168
168
|
};
|
|
169
169
|
//#endregion
|
|
170
170
|
export { CardContainer, CompactCardContainer, TitleUnitGroup, UnitGroup, afterFeedSize, afterListSize, beforeClassName, coverHeightBySize, titleTimelineClassName, titleUnitsContainerClassName };
|
package/lib/color-filter.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { colorFromUnsafe, cssFromColor, oklchFrom, rgbFrom } from "./color-utils.js";
|
|
2
|
+
import { memoizeColor } from "./memoize.js";
|
|
2
3
|
import { makeAdjust } from "./color-adjuster.js";
|
|
3
4
|
import { makeDoubleApplyDetector } from "./double-apply.js";
|
|
4
5
|
import { shiftHueTowards } from "./palette-generator.js";
|
|
5
|
-
import { memoize } from "@fibery/helpers/src/_";
|
|
6
6
|
import { clampRgb, filterDeficiencyDeuter, filterDeficiencyProt, filterDeficiencyTrit, filterHueRotate, filterInvert } from "culori";
|
|
7
7
|
//#region src/color-filter.ts
|
|
8
8
|
var cvdChannels = [
|
|
@@ -33,7 +33,7 @@ function makeColorFilter(spec) {
|
|
|
33
33
|
if (!spec) return (x) => x;
|
|
34
34
|
const adjust = spec.adjust && makeAdjust(spec.adjust);
|
|
35
35
|
const detect = makeDoubleApplyDetector();
|
|
36
|
-
return
|
|
36
|
+
return memoizeColor(function filterColor(color) {
|
|
37
37
|
if (!color) return color;
|
|
38
38
|
color = spec.swatches?.[color.toUpperCase()] ?? color;
|
|
39
39
|
const parsed = oklchFrom(color);
|
package/lib/color-inspect.js
CHANGED
|
@@ -9,7 +9,7 @@ function alignColorComponents(formatted) {
|
|
|
9
9
|
pad: (s) => s.padStart(COMPONENT_PAD, " ")
|
|
10
10
|
}, {
|
|
11
11
|
prefix: "oklch(",
|
|
12
|
-
pad: (s, i, total) => i === total - 1 ? s.padStart(
|
|
12
|
+
pad: (s, i, total) => i === total - 1 ? s.padStart(3, " ").padEnd(COMPONENT_PAD, " ") : s.padEnd(COMPONENT_PAD, " ")
|
|
13
13
|
}].find((m) => formatted.startsWith(m.prefix));
|
|
14
14
|
if (!mode || !formatted.endsWith(")")) return formatted;
|
|
15
15
|
const inner = formatted.slice(mode.prefix.length, -1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColorPicker } from "./index.js";
|
|
2
2
|
//#region src/color-picker/color-picker-or-loader.d.ts
|
|
3
|
-
declare const LazyColorPicker: import("react").LazyExoticComponent<
|
|
3
|
+
declare const LazyColorPicker: import("react").LazyExoticComponent<typeof ColorPicker>;
|
|
4
4
|
declare const ColorPickerOrLoader: (props: React.ComponentProps<typeof LazyColorPicker>) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { ColorPickerOrLoader };
|
package/lib/color-utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveColorArg } from "./design-system/vars.js";
|
|
2
|
-
import { isFlagPresent } from "
|
|
2
|
+
import { isFlagPresent } from "@fibery/helpers/src/flags";
|
|
3
3
|
import { blend, differenceCie76, formatCss, formatRgb, hsl as hslFrom, interpolate, oklch as oklchFrom, parse, rgb as rgbFrom, serializeHex, serializeHex8, toGamut, wcagLuminance } from "culori";
|
|
4
4
|
//#region src/color-utils.ts
|
|
5
5
|
var useOklchDefs = isFlagPresent("oklch-defs");
|
package/lib/comment.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ interface CommentProps {
|
|
|
18
18
|
dateTimeFormat?: string;
|
|
19
19
|
commentContentStyleClassName?: string;
|
|
20
20
|
actionsShowed?: boolean;
|
|
21
|
+
badge?: ReactNode;
|
|
21
22
|
}
|
|
22
23
|
declare const actionsClassName: import("@linaria/core").LinariaClassName;
|
|
23
24
|
declare const Comment: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<CommentProps & import("react").RefAttributes<HTMLDivElement>>>;
|
package/lib/comment.js
CHANGED
|
@@ -15,18 +15,20 @@ var commentContentStyle = "c4bd082-commentContent";
|
|
|
15
15
|
var commentStyle = "c99co57-comment";
|
|
16
16
|
var avatarContainerStyle = "alj6rui-avatarContainer";
|
|
17
17
|
var infoContainerStyle = "i1jz7n7h-infoContainer";
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
18
|
+
var infoRowStyle = "i1ftwecl-infoRow";
|
|
19
|
+
var authorStyle = "a1uq6781-author";
|
|
20
|
+
var dateStyle = "d1fgzzhc-date";
|
|
21
|
+
var badgeStyle = "b6fpn3e-badge";
|
|
22
|
+
var defaultCommentStyle = "d1j9f4o5-defaultComment";
|
|
23
|
+
var actionsClassName = "a1slvpm7-actions";
|
|
22
24
|
var Comment = memo(forwardRef((props, ref) => {
|
|
23
|
-
const { author, authorTitle, authorStyleClassName, commentContentStyleClassName = commentContentStyle, date, avatarUrl, hasAccessToAuthor = true, actions, children, customItemStyle, dateTimeFormat, icon, avatarSize = 24, actionsShowed = false } = props;
|
|
25
|
+
const { author, authorTitle, authorStyleClassName, commentContentStyleClassName = commentContentStyle, date, avatarUrl, hasAccessToAuthor = true, actions, children, customItemStyle, dateTimeFormat, icon, avatarSize = 24, actionsShowed = false, badge } = props;
|
|
24
26
|
const { formatted, relative } = formatDateFromNow(date, { format: dateTimeFormat });
|
|
25
27
|
const IconComponent = icon ? icon : null;
|
|
26
28
|
const isPhone = useIsPhone();
|
|
27
29
|
return /* @__PURE__ */ jsxs("div", {
|
|
28
30
|
ref,
|
|
29
|
-
className: cx("
|
|
31
|
+
className: cx("cjnlt45", defaultCommentStyle, customItemStyle ?? "c99co57-comment"),
|
|
30
32
|
children: [
|
|
31
33
|
/* @__PURE__ */ jsx("div", { children: IconComponent ? IconComponent : /* @__PURE__ */ jsx(AvatarImage, {
|
|
32
34
|
avatarUrl,
|
|
@@ -35,22 +37,29 @@ var Comment = memo(forwardRef((props, ref) => {
|
|
|
35
37
|
hasAccess: hasAccessToAuthor
|
|
36
38
|
}) }),
|
|
37
39
|
/* @__PURE__ */ jsxs("div", {
|
|
38
|
-
className: "
|
|
40
|
+
className: "c1gf494l",
|
|
39
41
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
40
|
-
className:
|
|
41
|
-
children: [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
children:
|
|
42
|
+
className: infoRowStyle,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx("div", {
|
|
45
|
+
className: cx(authorStyle, authorStyleClassName),
|
|
46
|
+
children: author
|
|
47
|
+
}),
|
|
48
|
+
date && /* @__PURE__ */ jsx(Tooltip, {
|
|
49
|
+
title: formatted,
|
|
50
|
+
side: "top",
|
|
51
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: dateStyle,
|
|
53
|
+
children: relative
|
|
54
|
+
})
|
|
55
|
+
}),
|
|
56
|
+
badge && /* @__PURE__ */ jsx("span", {
|
|
57
|
+
className: badgeStyle,
|
|
58
|
+
children: badge
|
|
50
59
|
})
|
|
51
|
-
|
|
60
|
+
]
|
|
52
61
|
}), actions ? /* @__PURE__ */ jsx("div", {
|
|
53
|
-
className: cx(actionsClassName, (actionsShowed || isPhone) && "
|
|
62
|
+
className: cx(actionsClassName, (actionsShowed || isPhone) && "c14sd9dn"),
|
|
54
63
|
children: actions
|
|
55
64
|
}) : null]
|
|
56
65
|
}),
|
|
@@ -84,7 +93,7 @@ var CommentPlaceholder = () => {
|
|
|
84
93
|
};
|
|
85
94
|
var ErrorComment = ({ error }) => {
|
|
86
95
|
return /* @__PURE__ */ jsx("div", { children: jsx(Item, {
|
|
87
|
-
itemClassName: cx(commentStyle, "
|
|
96
|
+
itemClassName: cx(commentStyle, "i1fgpr5b-item"),
|
|
88
97
|
multiline: true,
|
|
89
98
|
leftContainer: /* @__PURE__ */ jsx("div", {
|
|
90
99
|
className: avatarContainerStyle,
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
.c99co57-comment{border-radius:6px;padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:6px;margin-bottom:1px;background-color:var(--actionMenuBg);transition:box-shadow 120ms ease-in-out;overflow-x:auto;}
|
|
3
3
|
.alj6rui-avatarContainer{margin-right:8px;}
|
|
4
4
|
.i1jz7n7h-infoContainer{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:20px;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:14px;line-height:1.3;font-weight:600;color:var(--textColor);}
|
|
5
|
-
.
|
|
6
|
-
.
|
|
5
|
+
.i1ftwecl-infoRow{display:flex;align-items:center;min-width:0;min-height:20px;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:14px;line-height:1.3;font-weight:600;color:var(--textColor);}
|
|
6
|
+
.a1uq6781-author{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline;margin-right:8px;min-width:0;}
|
|
7
|
+
.d1fgzzhc-date{display:inline;white-space:no-wrap;padding-right:8px;flex-shrink:0;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:1.5;font-weight:410;color:var(--accentTextColor);text-transform:none;}
|
|
8
|
+
.b6fpn3e-badge{display:flex;flex-shrink:0;}
|
|
7
9
|
|
|
8
|
-
.
|
|
9
|
-
.
|
|
10
|
-
.
|
|
11
|
-
.
|
|
12
|
-
.
|
|
10
|
+
.a1slvpm7-actions{display:none;position:absolute;top:0;right:0;z-index:1;padding:3px;background-color:var(--colorBgFloatingPanel);border-radius:8px;box-shadow:var(--shadowFloatingPanel);gap:2px;}.d1j9f4o5-defaultComment:hover .a1slvpm7-actions{display:flex;}.fibery-mobile .a1slvpm7-actions{top:-6px;}
|
|
11
|
+
.cjnlt45{display:grid;grid-template-columns:auto minmax(150px, 1fr);align-items:center;column-gap:12px;}
|
|
12
|
+
.c1gf494l{display:grid;position:relative;grid-template-columns:1fr auto;align-items:center;min-height:24px;}.fibery-mobile .c1gf494l{min-height:36px;}
|
|
13
|
+
.c14sd9dn{display:flex;}
|
|
14
|
+
.i1fgpr5b-item{background-color:var(--warningBgColor);}
|
|
@@ -104,6 +104,7 @@ var SubContent = forwardRef(function DropdownMenuSubContent({ className, ...rest
|
|
|
104
104
|
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: jsx(RadixPortalThemeProvider, { children: /* @__PURE__ */ jsx(ContextMenuPrimitive.SubContent, {
|
|
105
105
|
ref,
|
|
106
106
|
className: cx(dropdownMenuContentStyles, className),
|
|
107
|
+
collisionPadding: space.s12 + space.s8,
|
|
107
108
|
...rest
|
|
108
109
|
}) }) });
|
|
109
110
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.d12eukli-dropdownMenuContent{overflow-y:auto;overflow-x:hidden;z-index:1001;max-height:min(var(--radix-
|
|
1
|
+
.d12eukli-dropdownMenuContent{overflow-y:auto;overflow-x:hidden;z-index:1001;max-height:min(var(--radix-context-menu-content-available-height), 680px);padding-top:4px;padding-bottom:4px;min-width:200px;box-shadow:var(--actionMenuShadow);border-radius:8px;background-color:var(--colorBgActionsMenu);}@keyframes slideDown-d12eukli-dropdownMenuContent{from{opacity:0;transform:translateY(-2px);}to{opacity:1;transform:translateY(0);}}@media (prefers-reduced-motion: no-preference){.d12eukli-dropdownMenuContent{animation-duration:400ms;animation-timing-function:cubic-bezier(0.16, 1, 0.3, 1);animation-fill-mode:forwards;will-change:transform,opacity;}.d12eukli-dropdownMenuContent[data-state="open"]{animation-name:slideDown-d12eukli-dropdownMenuContent;}}
|
|
2
2
|
.i1a6wz4q-Item{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:14px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;letter-spacing:normal;display:flex;align-items:center;min-height:32px;outline:none;border-radius:0;padding:0px 8px;margin:0px 4px;cursor:pointer;}.i1a6wz4q-Item:hover,.i1a6wz4q-Item[data-highlighted],.i1a6wz4q-Item[aria-expanded="true"]{inset:10px 4px;margin-left:4px;margin-right:4px;background-color:var(--colorBgActionsMenuItemHover);border-radius:6px;}.i1a6wz4q-Item[data-disabled]{cursor:default;color:var(--disabledTextColor);--actions-menu-item-icon-color:var(--disabledTextColor);}.i1a6wz4q-Item[data-disabled]:hover{color:var(--disabledTextColor);background-color:var(--transparent);}.fibery-mobile .i1a6wz4q-Item{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:16px;line-height:1.5;font-weight:410;color:var(--textColor);min-height:44px;padding:0px 12px;}
|
|
3
3
|
.cz86ubx-CheckboxItem{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:14px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;letter-spacing:normal;display:flex;align-items:center;min-height:32px;outline:none;border-radius:0;padding:0px 8px;margin:0px 4px;cursor:pointer;}.cz86ubx-CheckboxItem:hover,.cz86ubx-CheckboxItem[data-highlighted],.cz86ubx-CheckboxItem[aria-expanded="true"]{inset:10px 4px;margin-left:4px;margin-right:4px;background-color:var(--colorBgActionsMenuItemHover);border-radius:6px;}.cz86ubx-CheckboxItem[data-disabled]{cursor:default;color:var(--disabledTextColor);--actions-menu-item-icon-color:var(--disabledTextColor);}.cz86ubx-CheckboxItem[data-disabled]:hover{color:var(--disabledTextColor);background-color:var(--transparent);}.fibery-mobile .cz86ubx-CheckboxItem{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:16px;line-height:1.5;font-weight:410;color:var(--textColor);min-height:44px;padding:0px 12px;}
|
|
4
4
|
.sbtigvo-Separator{background-color:var(--actionMenuSeparatorColor);height:0.5px;margin:4px 0;}
|
package/lib/copy-to-clipboard.js
CHANGED
|
@@ -6,9 +6,10 @@ var copyToClipboard = async (text) => {
|
|
|
6
6
|
checkClipboard();
|
|
7
7
|
await navigator.clipboard.writeText(text);
|
|
8
8
|
};
|
|
9
|
+
var escapeLabel = (label) => label.replace(/\p{Cc}/gu, " ").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").trim();
|
|
9
10
|
var copyUrlToClipboard = async ({ url, label }) => {
|
|
10
11
|
checkClipboard();
|
|
11
|
-
const htmlString = `<a href="${url}" target="_blank">${label || url}</a>`;
|
|
12
|
+
const htmlString = `<a href="${url}" target="_blank">${(label ? escapeLabel(label) : "") || url}</a>`;
|
|
12
13
|
await navigator.clipboard.write([new ClipboardItem({
|
|
13
14
|
"text/html": new Blob([htmlString], { type: "text/html" }),
|
|
14
15
|
"text/plain": url
|
|
@@ -12,30 +12,32 @@ var AutoComplete = ({ value, timeFormat: timeFormat$1 = timeFormat, onChange, me
|
|
|
12
12
|
const isPhone = useIsPhone();
|
|
13
13
|
const options = useMemo(() => Array.from({ length: 1440 / step }, (value, index) => {
|
|
14
14
|
const hour = Math.floor(index * step / 60);
|
|
15
|
+
const minute = index * step - hour * 60;
|
|
15
16
|
const label = moment({
|
|
16
17
|
hour,
|
|
17
|
-
minute
|
|
18
|
+
minute
|
|
18
19
|
}).format(timeFormat$1);
|
|
19
20
|
return {
|
|
20
21
|
value: label,
|
|
21
22
|
label
|
|
22
23
|
};
|
|
23
24
|
}), [timeFormat$1]);
|
|
25
|
+
const selectedOption = useMemo(() => {
|
|
26
|
+
if (!value) return null;
|
|
27
|
+
const timeValue = moment(value).format(timeFormat$1);
|
|
28
|
+
return options.find((option) => option.value === timeValue);
|
|
29
|
+
}, [
|
|
30
|
+
value,
|
|
31
|
+
timeFormat$1,
|
|
32
|
+
options
|
|
33
|
+
]);
|
|
24
34
|
return /* @__PURE__ */ jsx(SelectControlSettingsProvider, {
|
|
25
35
|
getPopupContainerElement: void 0,
|
|
26
36
|
children: /* @__PURE__ */ jsx(Select, {
|
|
27
37
|
inline: true,
|
|
28
38
|
options,
|
|
29
39
|
menuIsOpen,
|
|
30
|
-
value:
|
|
31
|
-
if (!value) return null;
|
|
32
|
-
const timeValue = moment(value).format(timeFormat$1);
|
|
33
|
-
return options.find((option) => option.value === timeValue);
|
|
34
|
-
}, [
|
|
35
|
-
value,
|
|
36
|
-
timeFormat$1,
|
|
37
|
-
options
|
|
38
|
-
]),
|
|
40
|
+
value: selectedOption,
|
|
39
41
|
onChange,
|
|
40
42
|
components: { Control: () => null },
|
|
41
43
|
styles: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./date-range-input.wyw-in-js.css";
|
|
2
2
|
import { IconButton } from "../button/icon-button.js";
|
|
3
|
-
import { AntTransparentInput, AntTransparentTextArea } from "../antd/input.js";
|
|
4
3
|
import Remove from "../icons/react/remove.js";
|
|
4
|
+
import { AntTransparentInput, AntTransparentTextArea } from "../antd/input.js";
|
|
5
5
|
import { datesSeparator } from "./constants.js";
|
|
6
6
|
import { formatDateInputValue, formatDateRangeInputValue, getDateRangeIntervals, getDateTimeRangeIntervals, getLocaleSpecificChrono, setTime } from "./utils.js";
|
|
7
7
|
import { disabledStyle, selectedStyle } from "./styles.js";
|
|
@@ -117,12 +117,14 @@ var DateRangeInput = forwardRef(({ startValue, endValue, showTime, dateFormat, t
|
|
|
117
117
|
}, [onReset]);
|
|
118
118
|
const onSaveValue = useCallback((e) => {
|
|
119
119
|
e.preventDefault();
|
|
120
|
-
if (inputValue === "")
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
if (inputValue === "") {
|
|
121
|
+
if (allowClear) onClear();
|
|
122
|
+
else setInputValue(formatDateRangeInputValue(startValue, endValue, {
|
|
123
|
+
showTime,
|
|
124
|
+
dateFormat,
|
|
125
|
+
dateTimeFormat
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
126
128
|
const [result] = getLocaleSpecificChrono(dateFormat).parse(inputValue.replace(datesSeparator, " - "));
|
|
127
129
|
let start;
|
|
128
130
|
let end;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { eachDayOfInterval, endOfMonth, getISODay, startOfMonth } from "date-fns";
|
|
2
2
|
//#region src/date-picker/get-weekends-for-month.ts
|
|
3
3
|
var getWeekendsForMonth = (date, weekends) => {
|
|
4
|
+
const start = startOfMonth(date);
|
|
5
|
+
const end = endOfMonth(date);
|
|
4
6
|
return eachDayOfInterval({
|
|
5
|
-
start
|
|
6
|
-
end
|
|
7
|
+
start,
|
|
8
|
+
end
|
|
7
9
|
}).filter((date) => weekends.includes(getISODay(date)));
|
|
8
10
|
};
|
|
9
11
|
//#endregion
|
|
@@ -54,8 +54,10 @@ var RelativeDatePicker = (props) => {
|
|
|
54
54
|
const [amount, setAmount] = useState(valueWithDefault.amount);
|
|
55
55
|
const onAmountChange = useCallback((newAmount) => {
|
|
56
56
|
if (newAmount === null) return;
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const numericAmount = Number(newAmount);
|
|
58
|
+
if (!Number.isFinite(numericAmount)) return;
|
|
59
|
+
if (numericAmount < 0) setAmount(0);
|
|
60
|
+
else setAmount(Math.floor(numericAmount));
|
|
59
61
|
}, []);
|
|
60
62
|
const onKeyDown = useCallback((e) => {
|
|
61
63
|
if (e.key === "Enter") {
|
|
@@ -63,7 +65,7 @@ var RelativeDatePicker = (props) => {
|
|
|
63
65
|
...valueWithDefault,
|
|
64
66
|
amount
|
|
65
67
|
});
|
|
66
|
-
e.
|
|
68
|
+
e.currentTarget.blur();
|
|
67
69
|
}
|
|
68
70
|
}, [
|
|
69
71
|
amount,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./single-date-input.wyw-in-js.css";
|
|
2
2
|
import { IconButton } from "../button/icon-button.js";
|
|
3
|
-
import { AntTransparentInput } from "../antd/input.js";
|
|
4
3
|
import Remove from "../icons/react/remove.js";
|
|
4
|
+
import { AntTransparentInput } from "../antd/input.js";
|
|
5
5
|
import { formatDateInputValue, getLocaleSpecificChrono, getTimeIntervals, setTime } from "./utils.js";
|
|
6
6
|
import { disabledStyle, selectedStyle } from "./styles.js";
|
|
7
7
|
import { AutoComplete } from "./autocomplete.js";
|
|
@@ -71,12 +71,14 @@ var SingleDateInput = forwardRef(({ value, showTime, dateFormat, timeFormat, dat
|
|
|
71
71
|
}, [onChange]);
|
|
72
72
|
const onSaveValue = useCallback((e) => {
|
|
73
73
|
e.preventDefault();
|
|
74
|
-
if (inputValue === "")
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
if (inputValue === "") {
|
|
75
|
+
if (allowClear) onClear();
|
|
76
|
+
else setInputValue(formatDateInputValue(value, {
|
|
77
|
+
showTime,
|
|
78
|
+
dateFormat,
|
|
79
|
+
dateTimeFormat
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
80
82
|
const [result] = getLocaleSpecificChrono(dateFormat).parse(inputValue);
|
|
81
83
|
if (result && result.start) {
|
|
82
84
|
const newValue = result.start.date();
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { $TSFixMe } from "../tsfixme.js";
|
|
2
1
|
import { ControlledDatePickerProps, RelativeDateValue, SingleDatePickerPopoverContentProps, SingleDatePickerProps } from "./types.js";
|
|
3
2
|
import "react-day-picker/dist/style.css";
|
|
4
3
|
//#region src/date-picker/single-date-picker.d.ts
|
|
5
|
-
declare const isRelativeDatePlaceholder: (value:
|
|
4
|
+
declare const isRelativeDatePlaceholder: (value: unknown) => value is RelativeDateValue;
|
|
6
5
|
declare const formatRelativeDate: (value: RelativeDateValue) => string;
|
|
7
6
|
type UncontrolledSingleDatePickerProps<IsRelativeDate extends boolean = false> = Omit<SingleDatePickerProps<IsRelativeDate>, keyof ControlledDatePickerProps>;
|
|
8
7
|
interface SingleDatePickerWithForwardRefType extends React.FC<SingleDatePickerProps<boolean>> {
|
|
@@ -22,7 +22,8 @@ import { focusable } from "tabbable";
|
|
|
22
22
|
var tabItemClassName = "tg67n1g-tabItem";
|
|
23
23
|
var tabNavLinkClassName = "t17qtdvh-tabNavLink";
|
|
24
24
|
var isRelativeDatePlaceholder = (value) => {
|
|
25
|
-
|
|
25
|
+
if (typeof value !== "object" || value === null) return false;
|
|
26
|
+
return Object.hasOwn(value, "isBeforeNow") && Object.hasOwn(value, "unit") && Object.hasOwn(value, "amount");
|
|
26
27
|
};
|
|
27
28
|
var formatRelativeDate = (value) => {
|
|
28
29
|
if (value.amount === 0) return "today";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { $TSFixMe } from "../tsfixme.js";
|
|
2
1
|
import { ReactNode } from "react";
|
|
3
2
|
import { Moment, unitOfTime } from "moment";
|
|
4
3
|
//#region src/date-picker/types.d.ts
|
|
@@ -24,7 +23,7 @@ type DatePickerCommonProps = {
|
|
|
24
23
|
children?: JSX.Element;
|
|
25
24
|
allowClear?: boolean;
|
|
26
25
|
disabled?: boolean;
|
|
27
|
-
onKeyDown?: React.KeyboardEventHandler
|
|
26
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
28
27
|
placeholder: string;
|
|
29
28
|
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
30
29
|
dateFormat?: string;
|
|
@@ -5,9 +5,10 @@ import { RoundToggleButton } from "../toggle-button/round-toggle-button.js";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/day-select/day-select.tsx
|
|
7
7
|
function DaySelect({ value = [], onChange, days, allowEmpty = false }) {
|
|
8
|
+
const stringifiedValue = value.map((v) => v.toString());
|
|
8
9
|
return /* @__PURE__ */ jsx(ToggleButtonGroup, {
|
|
9
10
|
type: "multiple",
|
|
10
|
-
value:
|
|
11
|
+
value: stringifiedValue,
|
|
11
12
|
onValueChange: (v) => {
|
|
12
13
|
if (v.length === 0 && !allowEmpty) return;
|
|
13
14
|
onChange(v.map(Number));
|
|
@@ -9,11 +9,11 @@ declare enum Days {
|
|
|
9
9
|
SA = 5,
|
|
10
10
|
SU = 6
|
|
11
11
|
}
|
|
12
|
-
declare const getDays: ((arg:
|
|
12
|
+
declare const getDays: ((arg: number) => {
|
|
13
13
|
key: string;
|
|
14
14
|
title: string;
|
|
15
15
|
value: Days;
|
|
16
|
-
}[]) & import("@fibery/helpers/src/_").MemoizedFunction<
|
|
16
|
+
}[]) & import("@fibery/helpers/src/_").MemoizedFunction<number, {
|
|
17
17
|
key: string;
|
|
18
18
|
title: string;
|
|
19
19
|
value: Days;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DaySelect } from "./day-select.js";
|
|
2
|
-
import {
|
|
2
|
+
import { memoizeLeak } from "@fibery/helpers/src/_";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/day-select/week-day-select.tsx
|
|
5
5
|
var Days = /* @__PURE__ */ function(Days) {
|
|
@@ -21,7 +21,7 @@ var WeekDayMap = {
|
|
|
21
21
|
SA: 5,
|
|
22
22
|
SU: 6
|
|
23
23
|
};
|
|
24
|
-
var getDays =
|
|
24
|
+
var getDays = memoizeLeak((firstDay) => {
|
|
25
25
|
const entries = Object.entries(WeekDayMap);
|
|
26
26
|
const firstDayIndex = entries.findIndex((entry) => entry[1] === firstDay);
|
|
27
27
|
const partA = entries.slice(firstDayIndex);
|
|
@@ -35,10 +35,11 @@ var getDays = memoize((firstDay) => {
|
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
function WeekdaySelect({ value = [], onChange, firstDay }) {
|
|
38
|
+
const days = getDays(firstDay);
|
|
38
39
|
return /* @__PURE__ */ jsx(DaySelect, {
|
|
39
40
|
value,
|
|
40
41
|
onChange,
|
|
41
|
-
days
|
|
42
|
+
days
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
//#endregion
|
|
@@ -10,6 +10,8 @@ declare const opacity: {
|
|
|
10
10
|
readonly opacity70: 0.7;
|
|
11
11
|
readonly opacity65: 0.65;
|
|
12
12
|
readonly opacity60: 0.6;
|
|
13
|
+
readonly opacity59: 0.59;
|
|
14
|
+
readonly opacity57: 0.57;
|
|
13
15
|
readonly opacity55: 0.55;
|
|
14
16
|
readonly opacity50: 0.5;
|
|
15
17
|
readonly opacity45: 0.45;
|
|
@@ -18,9 +20,13 @@ declare const opacity: {
|
|
|
18
20
|
readonly opacity30: 0.3;
|
|
19
21
|
readonly opacity25: 0.25;
|
|
20
22
|
readonly opacity20: 0.2;
|
|
23
|
+
readonly opacity18: 0.18;
|
|
21
24
|
readonly opacity15: 0.15;
|
|
25
|
+
readonly opacity14: 0.14;
|
|
22
26
|
readonly opacity10: 0.1;
|
|
27
|
+
readonly opacity9: 0.09;
|
|
23
28
|
readonly opacity5: 0.05;
|
|
29
|
+
readonly opacity3: 0.03;
|
|
24
30
|
readonly opacity0: 0;
|
|
25
31
|
};
|
|
26
32
|
type AlphaValue = (typeof opacity)[keyof typeof opacity];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { produceColor } from "../color-utils.js";
|
|
2
|
-
import {
|
|
2
|
+
import { memoizeColor } from "../memoize.js";
|
|
3
3
|
//#region src/design-system/alpha.ts
|
|
4
4
|
var transparent = "rgba(255, 255, 255, 0)";
|
|
5
5
|
var opacity = {
|
|
@@ -12,6 +12,8 @@ var opacity = {
|
|
|
12
12
|
opacity70: .7,
|
|
13
13
|
opacity65: .65,
|
|
14
14
|
opacity60: .6,
|
|
15
|
+
opacity59: .59,
|
|
16
|
+
opacity57: .57,
|
|
15
17
|
opacity55: .55,
|
|
16
18
|
opacity50: .5,
|
|
17
19
|
opacity45: .45,
|
|
@@ -20,17 +22,19 @@ var opacity = {
|
|
|
20
22
|
opacity30: .3,
|
|
21
23
|
opacity25: .25,
|
|
22
24
|
opacity20: .2,
|
|
25
|
+
opacity18: .18,
|
|
23
26
|
opacity15: .15,
|
|
27
|
+
opacity14: .14,
|
|
24
28
|
opacity10: .1,
|
|
29
|
+
opacity9: .09,
|
|
25
30
|
opacity5: .05,
|
|
31
|
+
opacity3: .03,
|
|
26
32
|
opacity0: 0
|
|
27
33
|
};
|
|
28
34
|
var defineAlphaCoefficient = (value) => value;
|
|
29
|
-
var alpha =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}));
|
|
34
|
-
}, (a, b) => a + b);
|
|
35
|
+
var alpha = memoizeColor((color, alpha) => produceColor(color, (oklch) => ({
|
|
36
|
+
...oklch,
|
|
37
|
+
alpha
|
|
38
|
+
})), (color, alpha) => `${color}/${alpha}`);
|
|
35
39
|
//#endregion
|
|
36
40
|
export { alpha, defineAlphaCoefficient, opacity, transparent };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ThemeMode } from "../theme-settings-core.js";
|
|
2
2
|
//#region src/design-system/colors-js.d.ts
|
|
3
3
|
declare const getDarkenColor: ((arg: string) => string) & import("@fibery/helpers/src/_").MemoizedFunction<string, string>;
|
|
4
|
-
|
|
5
|
-
declare const getTextColor: ((arg: string) => string) & import("@fibery/helpers/src/_").MemoizedFunction<string, string>;
|
|
6
|
-
declare const getObjectColorMemoized: ((arg: string | null | undefined) => string) & import("@fibery/helpers/src/_").MemoizedFunction<string | null | undefined, string>;
|
|
4
|
+
declare function getObjectColor(name: string | null | undefined): string;
|
|
7
5
|
declare function makeSelect(mode: ThemeMode): <T>(values: {
|
|
8
6
|
light: T;
|
|
9
7
|
dark: T;
|
|
10
8
|
}) => T;
|
|
11
9
|
//#endregion
|
|
12
|
-
export { getDarkenColor,
|
|
10
|
+
export { getDarkenColor, getObjectColor, makeSelect };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { produceColor } from "../color-utils.js";
|
|
2
|
+
import { memoizeColor } from "../memoize.js";
|
|
3
3
|
import { clampChroma } from "culori";
|
|
4
4
|
import ColorHash from "color-hash";
|
|
5
5
|
//#region src/design-system/colors-js.ts
|
|
6
|
-
var getDarkenColor =
|
|
6
|
+
var getDarkenColor = memoizeColor((color) => {
|
|
7
7
|
return produceColor(color, (oklch) => {
|
|
8
8
|
return clampChroma({
|
|
9
9
|
...oklch,
|
|
@@ -12,12 +12,7 @@ var getDarkenColor = memoize((color) => {
|
|
|
12
12
|
}, "oklch");
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
var getTextColor = memoize((color) => {
|
|
17
|
-
return cssFromUnsafe(color);
|
|
18
|
-
});
|
|
19
|
-
var getObjectColorMemoized = memoize((name) => {
|
|
20
|
-
if (!name) return "#999999";
|
|
15
|
+
var getObjectColorMemoized = memoizeColor((name) => {
|
|
21
16
|
return new ColorHash({
|
|
22
17
|
lightness: [
|
|
23
18
|
.5,
|
|
@@ -33,6 +28,9 @@ var getObjectColorMemoized = memoize((name) => {
|
|
|
33
28
|
]
|
|
34
29
|
}).hex(name);
|
|
35
30
|
});
|
|
31
|
+
function getObjectColor(name) {
|
|
32
|
+
return name ? getObjectColorMemoized(name) : "#999999";
|
|
33
|
+
}
|
|
36
34
|
function makeSelect(mode) {
|
|
37
35
|
return function select(values) {
|
|
38
36
|
if (mode in values) return values[mode];
|
|
@@ -40,4 +38,4 @@ function makeSelect(mode) {
|
|
|
40
38
|
};
|
|
41
39
|
}
|
|
42
40
|
//#endregion
|
|
43
|
-
export { getDarkenColor,
|
|
41
|
+
export { getDarkenColor, getObjectColor, makeSelect };
|