@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
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import "./new-card-placeholder.wyw-in-js.css";
|
|
2
|
-
import { textStyles } from "./design-system/typography.js";
|
|
3
|
-
import { AntTransparentInput, AntTransparentTextArea } from "./antd/input.js";
|
|
4
|
-
import { Box } from "./box.js";
|
|
5
|
-
import { Button } from "./button/button.js";
|
|
6
|
-
import { CardContainer, titleUnitsContainerClassName } from "./card-container.js";
|
|
7
|
-
import { ignoreEnter } from "./form-utils.js";
|
|
8
|
-
/* empty css */
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { useCallback, useEffect, useState } from "react";
|
|
11
|
-
import cx from "classnames";
|
|
12
|
-
import { styled } from "@linaria/react";
|
|
13
|
-
import { useFocusOutside } from "@fibery/react/src/use-focus-outside";
|
|
14
|
-
//#region src/new-card-placeholder.tsx
|
|
15
|
-
var disabledTextClassName = "d147c4dk-disabledText";
|
|
16
|
-
var titleAreaContainerClassName = "t11jol8j-titleAreaContainer";
|
|
17
|
-
var _exp4 = () => (({ backgroundColor }) => backgroundColor || "");
|
|
18
|
-
var AuxWrapper = /*#__PURE__*/ styled("div")({
|
|
19
|
-
name: "AuxWrapper",
|
|
20
|
-
class: "asb1482-AuxWrapper",
|
|
21
|
-
propsAsIs: false,
|
|
22
|
-
vars: { "asb1482-0": [_exp4()] }
|
|
23
|
-
});
|
|
24
|
-
var singleLineClassName = "sxvk75e-singleLine";
|
|
25
|
-
var autosize = {
|
|
26
|
-
minRows: 1,
|
|
27
|
-
maxRows: 10
|
|
28
|
-
};
|
|
29
|
-
var outlineNoneClassName = "o1l7moht-outlineNone";
|
|
30
|
-
var NewCardPlaceholder = (props) => {
|
|
31
|
-
const { leftContainer, typeTitle, containerClassName, inputStyle, bypassedRef, onSubmit, onHide, onHideByEsc = onHide, referenceSelector, selectorOpen, readOnly, scrollToInput = true, size } = props;
|
|
32
|
-
const [title, setTitle] = useState("");
|
|
33
|
-
const multiline = size !== ":card-size/timeline" && size !== ":card-size/list" && size !== ":card-size/cell";
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (readOnly) bypassedRef.current?.focus();
|
|
36
|
-
}, [bypassedRef, readOnly]);
|
|
37
|
-
const onChange = useCallback((e) => {
|
|
38
|
-
setTitle(e.target.value);
|
|
39
|
-
e.stopPropagation();
|
|
40
|
-
}, []);
|
|
41
|
-
const submit = useCallback(async (event) => {
|
|
42
|
-
setTitle("");
|
|
43
|
-
try {
|
|
44
|
-
await onSubmit({
|
|
45
|
-
event,
|
|
46
|
-
title
|
|
47
|
-
});
|
|
48
|
-
} catch (e) {}
|
|
49
|
-
}, [onSubmit, title]);
|
|
50
|
-
const onPressEnter = useCallback(async (e) => {
|
|
51
|
-
e.stopPropagation();
|
|
52
|
-
submit(e);
|
|
53
|
-
}, [submit]);
|
|
54
|
-
const onBlur = useCallback(async (e) => {
|
|
55
|
-
if (!selectorOpen) {
|
|
56
|
-
if (title) submit(e);
|
|
57
|
-
onHide();
|
|
58
|
-
}
|
|
59
|
-
}, [
|
|
60
|
-
onHide,
|
|
61
|
-
selectorOpen,
|
|
62
|
-
submit,
|
|
63
|
-
title
|
|
64
|
-
]);
|
|
65
|
-
const hasTitle = title.length > 0;
|
|
66
|
-
const onKeyDown = useCallback((e) => {
|
|
67
|
-
ignoreEnter(e);
|
|
68
|
-
if (e.key === "Escape") {
|
|
69
|
-
e.stopPropagation();
|
|
70
|
-
if (hasTitle) setTitle("");
|
|
71
|
-
else onHideByEsc();
|
|
72
|
-
}
|
|
73
|
-
}, [hasTitle, onHideByEsc]);
|
|
74
|
-
const onAddCardButtonClick = useCallback((e) => {
|
|
75
|
-
submit(e);
|
|
76
|
-
}, [submit]);
|
|
77
|
-
const [containerElement, setContainerElement] = useState(null);
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
if (containerElement && scrollToInput) containerElement.scrollIntoView({
|
|
80
|
-
behavior: "smooth",
|
|
81
|
-
block: "center",
|
|
82
|
-
inline: "nearest"
|
|
83
|
-
});
|
|
84
|
-
}, [
|
|
85
|
-
containerElement,
|
|
86
|
-
title === "",
|
|
87
|
-
scrollToInput
|
|
88
|
-
]);
|
|
89
|
-
const { onBlurCapture, onFocusCapture } = useFocusOutside(onBlur);
|
|
90
|
-
return /* @__PURE__ */ jsx(Box, {
|
|
91
|
-
focused: true,
|
|
92
|
-
hovered: false,
|
|
93
|
-
ref: setContainerElement,
|
|
94
|
-
className: containerClassName,
|
|
95
|
-
onBlurCapture,
|
|
96
|
-
onFocusCapture,
|
|
97
|
-
children: jsx(CardContainer, {
|
|
98
|
-
before: leftContainer && /* @__PURE__ */ jsx("div", { children: leftContainer }),
|
|
99
|
-
title: readOnly ? /* @__PURE__ */ jsx("div", {
|
|
100
|
-
ref: bypassedRef,
|
|
101
|
-
tabIndex: 0,
|
|
102
|
-
className: titleUnitsContainerClassName,
|
|
103
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
104
|
-
className: cx(disabledTextClassName, outlineNoneClassName, { [singleLineClassName]: !multiline }),
|
|
105
|
-
children: "Name will be generated by a formula"
|
|
106
|
-
})
|
|
107
|
-
}) : /* @__PURE__ */ jsx("div", {
|
|
108
|
-
className: titleAreaContainerClassName,
|
|
109
|
-
children: /* @__PURE__ */ jsx(multiline ? AntTransparentTextArea : AntTransparentInput, {
|
|
110
|
-
bypassedRef,
|
|
111
|
-
value: title,
|
|
112
|
-
readOnly: false,
|
|
113
|
-
onChange,
|
|
114
|
-
onPressEnter,
|
|
115
|
-
autoFocus: true,
|
|
116
|
-
onKeyDown,
|
|
117
|
-
placeholder: readOnly ? "" : `New ${typeTitle}`,
|
|
118
|
-
style: {
|
|
119
|
-
...textStyles.regular,
|
|
120
|
-
...inputStyle
|
|
121
|
-
},
|
|
122
|
-
...multiline ? { autoSize: autosize } : {}
|
|
123
|
-
})
|
|
124
|
-
}),
|
|
125
|
-
size,
|
|
126
|
-
after: (referenceSelector || readOnly) && /* @__PURE__ */ jsxs(AuxWrapper, { children: [
|
|
127
|
-
referenceSelector && /* @__PURE__ */ jsx("div", { children: referenceSelector }),
|
|
128
|
-
readOnly && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
|
|
129
|
-
style: { width: 40 },
|
|
130
|
-
size: "small",
|
|
131
|
-
onClick: onAddCardButtonClick,
|
|
132
|
-
children: "Add"
|
|
133
|
-
}) }),
|
|
134
|
-
multiline && /* @__PURE__ */ jsx("div", {})
|
|
135
|
-
] }),
|
|
136
|
-
input: !readOnly
|
|
137
|
-
})
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
//#endregion
|
|
141
|
-
export { NewCardPlaceholder, outlineNoneClassName };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
.d147c4dk-disabledText{color:var(--disabledTextColor);}
|
|
2
|
-
.t11jol8j-titleAreaContainer{width:100%;}
|
|
3
|
-
.asb1482-AuxWrapper{display:flex;gap:4px;background-color:var(--asb1482-0);}
|
|
4
|
-
.sxvk75e-singleLine{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
|
5
|
-
.o1l7moht-outlineNone{outline:none;}
|
package/lib/unit/primitive.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { UnitPrimitiveProps } from "./types.js";
|
|
2
|
-
//#region src/unit/primitive.d.ts
|
|
3
|
-
declare const UnitPrimitive: ({ overflow, inline, button, multiline, children, title, fieldIcon, description, hint, icons, navButton, big, pill, tooltip, withLabel, border, color, bgColor, fontWeight, shrinkable, clickable, setMinWidth, setMinHeight, onClick, onKeyDown, invalid }: UnitPrimitiveProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { UnitPrimitive };
|
package/lib/unit/primitive.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import "./primitive.wyw-in-js.css";
|
|
2
|
-
import { themeVars } from "../theming.generated.js";
|
|
3
|
-
import { Tooltip } from "../tooltip.js";
|
|
4
|
-
import { useTruncated } from "../tooltip-if-overflown.js";
|
|
5
|
-
import { FieldIcon } from "../field-icon.js";
|
|
6
|
-
import { LabeledUnit } from "./labeled-unit.js";
|
|
7
|
-
import { basicUnitClassName, bigSizeUnitClassName, positionUnitClass, regularSizeUnitClassName } from "./styles.js";
|
|
8
|
-
import { UnitButtonGroup } from "./unit-button-group.js";
|
|
9
|
-
import { UnitContent } from "./unit-content.js";
|
|
10
|
-
/* empty css */
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { forwardRef } from "react";
|
|
13
|
-
import cx from "classnames";
|
|
14
|
-
//#region src/unit/primitive.tsx
|
|
15
|
-
var unitDescriptionClassName = "uha1rmp-unitDescription";
|
|
16
|
-
var resetButtonStylesClassName = "rlbybtz-resetButtonStyles";
|
|
17
|
-
var ButtonComponent = forwardRef((props, ref) => {
|
|
18
|
-
return /* @__PURE__ */ jsx("button", {
|
|
19
|
-
ref,
|
|
20
|
-
type: "button",
|
|
21
|
-
...props,
|
|
22
|
-
className: cx(props.className, resetButtonStylesClassName)
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
var DivComponent = forwardRef((props, ref) => /* @__PURE__ */ jsx("div", {
|
|
26
|
-
ref,
|
|
27
|
-
...props
|
|
28
|
-
}));
|
|
29
|
-
var UnitPrimitive = ({ overflow = true, inline = true, button = false, multiline = false, children, title, fieldIcon, description = null, hint = null, icons, navButton, big = false, pill = false, tooltip = true, withLabel = false, border = true, color = themeVars.textColor, bgColor = themeVars.transparent, fontWeight, shrinkable = true, clickable = false, setMinWidth = true, setMinHeight = true, onClick, onKeyDown, invalid }) => {
|
|
30
|
-
const { truncated, setNode } = useTruncated();
|
|
31
|
-
const truncate = !multiline && overflow;
|
|
32
|
-
const unitWrapperStyle = {
|
|
33
|
-
color,
|
|
34
|
-
backgroundColor: bgColor || themeVars.inputDisabledBgColor,
|
|
35
|
-
fontWeight
|
|
36
|
-
};
|
|
37
|
-
const unitWrapperClassName = cx(basicUnitClassName, big ? bigSizeUnitClassName : regularSizeUnitClassName, setMinWidth && (big ? "b1v5rpy3-bigSizeUnitMinWidth" : "rpdarf0-regularSizeUnitMinWidth"), setMinHeight && "ubaz4qk-unitMinHeight", border && "b4mqgwc-border", pill && "p1ebg4ic-pillRadius", invalid && "i14l2yxo-invalidUnit", clickable && "c18mqj2f-clickable");
|
|
38
|
-
const UnitContentComponent = button ? ButtonComponent : DivComponent;
|
|
39
|
-
const unitBody = /* @__PURE__ */ jsx(UnitContentComponent, {
|
|
40
|
-
onKeyDown,
|
|
41
|
-
onClick,
|
|
42
|
-
children: jsx(UnitContent, {
|
|
43
|
-
big,
|
|
44
|
-
icons,
|
|
45
|
-
shrinkable,
|
|
46
|
-
truncate,
|
|
47
|
-
setNode,
|
|
48
|
-
children
|
|
49
|
-
})
|
|
50
|
-
});
|
|
51
|
-
const renderUnit = (unit) => {
|
|
52
|
-
const content = /* @__PURE__ */ jsx(UnitButtonGroup, {
|
|
53
|
-
big,
|
|
54
|
-
inline,
|
|
55
|
-
style: unitWrapperStyle,
|
|
56
|
-
className: unitWrapperClassName,
|
|
57
|
-
unit,
|
|
58
|
-
navButton
|
|
59
|
-
});
|
|
60
|
-
return /* @__PURE__ */ jsx("div", {
|
|
61
|
-
className: positionUnitClass,
|
|
62
|
-
children: withLabel ? /* @__PURE__ */ jsx(LabeledUnit, {
|
|
63
|
-
label: title,
|
|
64
|
-
children: content
|
|
65
|
-
}) : content
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
if (!tooltip) return renderUnit(unitBody);
|
|
69
|
-
const tooltipTitle = /* @__PURE__ */ jsxs("div", {
|
|
70
|
-
className: "c1lb5dtf",
|
|
71
|
-
children: [fieldIcon && /* @__PURE__ */ jsx(FieldIcon, {
|
|
72
|
-
iconName: fieldIcon,
|
|
73
|
-
iconSize: 14,
|
|
74
|
-
color: themeVars.whiteColor
|
|
75
|
-
}), title]
|
|
76
|
-
});
|
|
77
|
-
const tooltipContent = truncated && /* @__PURE__ */ jsx("div", {
|
|
78
|
-
className: "f1kzkp39-fullUnitWrapper",
|
|
79
|
-
children: jsx(UnitButtonGroup, {
|
|
80
|
-
big,
|
|
81
|
-
inline,
|
|
82
|
-
style: unitWrapperStyle,
|
|
83
|
-
className: unitWrapperClassName,
|
|
84
|
-
unit: /* @__PURE__ */ jsx(UnitContentComponent, { children: /* @__PURE__ */ jsx(UnitContent, {
|
|
85
|
-
big,
|
|
86
|
-
icons,
|
|
87
|
-
children
|
|
88
|
-
}) })
|
|
89
|
-
})
|
|
90
|
-
});
|
|
91
|
-
return renderUnit(/* @__PURE__ */ jsx(Tooltip, {
|
|
92
|
-
side: "bottom",
|
|
93
|
-
align: "start",
|
|
94
|
-
openOnFocus: false,
|
|
95
|
-
title: tooltipTitle,
|
|
96
|
-
description: (description || tooltipContent || hint) && /* @__PURE__ */ jsxs("div", { children: [
|
|
97
|
-
description && /* @__PURE__ */ jsx("div", {
|
|
98
|
-
className: unitDescriptionClassName,
|
|
99
|
-
children: description
|
|
100
|
-
}),
|
|
101
|
-
tooltipContent,
|
|
102
|
-
hint
|
|
103
|
-
] }),
|
|
104
|
-
children: unitBody
|
|
105
|
-
}));
|
|
106
|
-
};
|
|
107
|
-
//#endregion
|
|
108
|
-
export { UnitPrimitive };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
.uha1rmp-unitDescription{margin-bottom:1px;}
|
|
2
|
-
.rlbybtz-resetButtonStyles{all:unset;background-color:var(--transparent);--input-focus-border:0 0 0 1px var(--colorAccentStrokeFocus) inset;--input-focus-shadow:0 0 0 2px var(--colorAccentStroke);border-radius:6px;}.rlbybtz-resetButtonStyles:focus{outline:none;box-shadow:var(--input-focus-border, 0 0 0 1px var(--colorAccentStroke)),var(--input-focus-shadow)!important;transition:box-shadow 120ms ease-in-out;}.rlbybtz-resetButtonStyles:focus:not(:focus-visible){outline:none;box-shadow:none!important;}.rlbybtz-resetButtonStyles:focus-visible{outline:none;box-shadow:var(--input-focus-border, 0 0 0 1px var(--colorAccentStroke)),var(--input-focus-shadow)!important;transition:box-shadow 120ms ease-in-out;}
|
|
3
|
-
.c1lb5dtf{display:flex;align-items:center;gap:4px;}
|
package/lib/unit/types.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { KeyboardEvent, ReactNode } from "react";
|
|
2
|
-
//#region src/unit/types.d.ts
|
|
3
|
-
type UnitPrimitiveProps = {
|
|
4
|
-
overflow?: boolean;
|
|
5
|
-
inline?: boolean;
|
|
6
|
-
button?: boolean;
|
|
7
|
-
multiline?: boolean;
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
title?: ReactNode;
|
|
10
|
-
fieldIcon?: string;
|
|
11
|
-
description?: ReactNode;
|
|
12
|
-
icons?: React.ReactNode[];
|
|
13
|
-
hint?: ReactNode;
|
|
14
|
-
navButton?: ReactNode;
|
|
15
|
-
big?: boolean;
|
|
16
|
-
/** Round corners to half the height (pill/stadium shape). */
|
|
17
|
-
pill?: boolean;
|
|
18
|
-
tooltip?: boolean;
|
|
19
|
-
/** Render the field label above the value (full-size presentation). */
|
|
20
|
-
withLabel?: boolean;
|
|
21
|
-
border?: boolean;
|
|
22
|
-
color?: string;
|
|
23
|
-
bgColor?: string | null;
|
|
24
|
-
fontWeight?: number;
|
|
25
|
-
shrinkable?: boolean;
|
|
26
|
-
clickable?: boolean;
|
|
27
|
-
setMinWidth?: boolean;
|
|
28
|
-
setMinHeight?: boolean;
|
|
29
|
-
onKeyDown?: (e: KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => void;
|
|
30
|
-
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
31
|
-
invalid?: boolean;
|
|
32
|
-
};
|
|
33
|
-
//#endregion
|
|
34
|
-
export { UnitPrimitiveProps };
|
package/lib/unit/types.js
DELETED
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
//#region src/unit/unit-button-group.d.ts
|
|
3
|
-
type Props = {
|
|
4
|
-
big: boolean;
|
|
5
|
-
inline: boolean;
|
|
6
|
-
style: React.CSSProperties;
|
|
7
|
-
className: string;
|
|
8
|
-
unit?: ReactNode;
|
|
9
|
-
navButton?: ReactNode;
|
|
10
|
-
};
|
|
11
|
-
declare const UnitButtonGroup: ({ big, inline, style, className, unit, navButton }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { UnitButtonGroup };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { space } from "../design-system/layout.js";
|
|
2
|
-
import { getHeight } from "./unit-content-layout.js";
|
|
3
|
-
import { jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { Children, cloneElement } from "react";
|
|
5
|
-
//#region src/unit/unit-button-group.tsx
|
|
6
|
-
var UnitButtonGroup = ({ big, inline, style, className, unit, navButton }) => {
|
|
7
|
-
const navButtonNode = navButton && Children.only(navButton);
|
|
8
|
-
const navButtonSize = getHeight(big) + 2 * space.s2;
|
|
9
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
-
style: {
|
|
11
|
-
display: inline ? `inline-flex` : `flex`,
|
|
12
|
-
...style
|
|
13
|
-
},
|
|
14
|
-
className,
|
|
15
|
-
children: [unit, navButtonNode && cloneElement(navButtonNode, { style: {
|
|
16
|
-
...navButtonNode.props.style,
|
|
17
|
-
width: navButtonSize,
|
|
18
|
-
height: navButtonSize
|
|
19
|
-
} })]
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
export { UnitButtonGroup };
|