@fibery/ui-kit 8.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/actions-menu/actions-menu-toggle-item.d.ts +15 -0
- package/lib/actions-menu/actions-menu-toggle-item.js +54 -0
- package/lib/actions-menu/actions-menu-toggle-item.wyw-in-js.css +4 -0
- package/lib/actions-menu/index.d.ts +2 -1
- package/lib/actions-menu/index.js +2 -1
- package/lib/antd/input-number.js +1 -0
- package/lib/design-system/colors.d.ts +6 -0
- package/lib/design-system/colors.js +3 -0
- package/lib/design-system/theme.d.ts +15 -0
- package/lib/embed.d.ts +21 -0
- package/lib/embed.js +150 -0
- package/lib/embed.wyw-in-js.css +1 -0
- package/lib/layout-variables.d.ts +21 -0
- package/lib/layout-variables.js +25 -0
- package/lib/number-input/number-input-inline-with-autosize.js +1 -0
- package/lib/number-input/number-input-inline.js +1 -0
- package/lib/root-theme-provider.d.ts +11 -0
- package/lib/root-theme-provider.js +107 -0
- package/lib/root-theme-provider.wyw-in-js.css +1 -0
- package/lib/thematic-state.js +1 -1
- package/lib/thematic.js +1 -1
- package/lib/theme-provider.d.ts +623 -8
- package/lib/theme-provider.js +25 -102
- package/lib/theme-provider.wyw-in-js.css +1 -2
- package/lib/theme.d.ts +2 -0
- package/lib/theme.js +2 -0
- package/lib/theming.generated.d.ts +15 -0
- package/lib/theming.generated.js +15 -0
- package/lib/unit/primitive.js +52 -47
- package/package.json +18 -1
package/lib/unit/primitive.js
CHANGED
|
@@ -9,18 +9,23 @@ import { UnitButtonGroup } from "./unit-button-group.js";
|
|
|
9
9
|
import { UnitContent } from "./unit-content.js";
|
|
10
10
|
/* empty css */
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { forwardRef } from "react";
|
|
12
13
|
import cx from "classnames";
|
|
13
14
|
//#region src/unit/primitive.tsx
|
|
14
15
|
var unitDescriptionClassName = "uha1rmp-unitDescription";
|
|
15
16
|
var resetButtonStylesClassName = "rlbybtz-resetButtonStyles";
|
|
16
|
-
var ButtonComponent = (props) => {
|
|
17
|
+
var ButtonComponent = forwardRef((props, ref) => {
|
|
17
18
|
return /* @__PURE__ */ jsx("button", {
|
|
19
|
+
ref,
|
|
18
20
|
type: "button",
|
|
19
21
|
...props,
|
|
20
22
|
className: cx(props.className, resetButtonStylesClassName)
|
|
21
23
|
});
|
|
22
|
-
};
|
|
23
|
-
var DivComponent = (props) => /* @__PURE__ */ jsx("div", {
|
|
24
|
+
});
|
|
25
|
+
var DivComponent = forwardRef((props, ref) => /* @__PURE__ */ jsx("div", {
|
|
26
|
+
ref,
|
|
27
|
+
...props
|
|
28
|
+
}));
|
|
24
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 }) => {
|
|
25
30
|
const { truncated, setNode } = useTruncated();
|
|
26
31
|
const truncate = !multiline && overflow;
|
|
@@ -31,33 +36,36 @@ var UnitPrimitive = ({ overflow = true, inline = true, button = false, multiline
|
|
|
31
36
|
};
|
|
32
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");
|
|
33
38
|
const UnitContentComponent = button ? ButtonComponent : DivComponent;
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
shrinkable,
|
|
46
|
-
truncate,
|
|
47
|
-
setNode,
|
|
48
|
-
children
|
|
49
|
-
})
|
|
50
|
-
}),
|
|
51
|
-
navButton
|
|
52
|
-
});
|
|
53
|
-
const labeledContent = withLabel ? /* @__PURE__ */ jsx(LabeledUnit, {
|
|
54
|
-
label: title,
|
|
55
|
-
children: content
|
|
56
|
-
}) : content;
|
|
57
|
-
if (!tooltip) return /* @__PURE__ */ jsx("div", {
|
|
58
|
-
className: positionUnitClass,
|
|
59
|
-
children: labeledContent
|
|
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
|
+
})
|
|
60
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);
|
|
61
69
|
const tooltipTitle = /* @__PURE__ */ jsxs("div", {
|
|
62
70
|
className: "c1lb5dtf",
|
|
63
71
|
children: [fieldIcon && /* @__PURE__ */ jsx(FieldIcon, {
|
|
@@ -80,24 +88,21 @@ var UnitPrimitive = ({ overflow = true, inline = true, button = false, multiline
|
|
|
80
88
|
}) })
|
|
81
89
|
})
|
|
82
90
|
});
|
|
83
|
-
return /* @__PURE__ */ jsx(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
description
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
children: /* @__PURE__ */ jsx("div", { children: labeledContent })
|
|
99
|
-
})
|
|
100
|
-
});
|
|
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
|
+
}));
|
|
101
106
|
};
|
|
102
107
|
//#endregion
|
|
103
108
|
export { UnitPrimitive };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/ui-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
@@ -72,6 +72,23 @@
|
|
|
72
72
|
"./src/icons/svg/*.svg": {
|
|
73
73
|
"default": null
|
|
74
74
|
},
|
|
75
|
+
"./src/embed": {
|
|
76
|
+
"types": "./lib/embed.d.ts",
|
|
77
|
+
"default": "./lib/embed.js"
|
|
78
|
+
},
|
|
79
|
+
"./src/theme": {
|
|
80
|
+
"types": "./lib/theme.d.ts",
|
|
81
|
+
"default": "./lib/theme.js"
|
|
82
|
+
},
|
|
83
|
+
"./src/theme-provider": {
|
|
84
|
+
"default": null
|
|
85
|
+
},
|
|
86
|
+
"./src/root-theme-provider": {
|
|
87
|
+
"default": null
|
|
88
|
+
},
|
|
89
|
+
"./src/layout-variables": {
|
|
90
|
+
"default": null
|
|
91
|
+
},
|
|
75
92
|
"./src/*": {
|
|
76
93
|
"types": "./lib/*.d.ts",
|
|
77
94
|
"default": "./lib/*.js"
|