@react-fabric/core 1.0.0-beta.46 → 1.0.0-beta.48
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/css/theme/_utilities.css +4 -8
- package/css/theme/index.css +1 -0
- package/dist/cjs/components/menu/Menu.js +7 -3
- package/dist/cjs/context/Global.js +3 -0
- package/dist/cjs/core/responsive/Responsive.js +3 -2
- package/dist/cjs/hooks/useResizeObserver.js +1 -1
- package/dist/cjs/types/icons.js +2 -1
- package/dist/cjs/typography/Abbr.js +2 -2
- package/dist/esm/components/menu/Menu.js +7 -3
- package/dist/esm/context/Global.js +3 -0
- package/dist/esm/core/responsive/Responsive.js +3 -2
- package/dist/esm/hooks/useResizeObserver.js +1 -1
- package/dist/esm/types/icons.js +2 -1
- package/dist/esm/typography/Abbr.js +2 -2
- package/dist/types/components/card/FlipContent.d.ts +7 -0
- package/dist/types/components/menu/types.d.ts +1 -0
- package/dist/types/core/responsive/Responsive.d.ts +5 -1
- package/dist/types/types/icons.d.ts +2 -1
- package/package.json +5 -5
- package/src/components/card/FlipContent.tsx +69 -0
- package/src/components/menu/Menu.tsx +7 -2
- package/src/components/menu/types.ts +1 -0
- package/src/context/Global.tsx +4 -0
- package/src/core/responsive/Responsive.tsx +6 -0
- package/src/hooks/useResizeObserver.ts +12 -8
- package/src/types/icons.ts +4 -2
- package/src/typography/Abbr.tsx +1 -1
package/css/theme/_utilities.css
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
@variant dark (&:where([data-color-scheme="dark"], [data-color-scheme="dark"] *));
|
|
41
41
|
|
|
42
42
|
@utility area-* {
|
|
43
|
-
grid-area: --value([*]);
|
|
43
|
+
grid-area: --value([ *]);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
@utility area-content {
|
|
@@ -89,12 +89,8 @@
|
|
|
89
89
|
flex: 1 1 100%;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
@utility
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
@utility rounded-capped {
|
|
97
|
-
border-radius: var(--rounding-cap);
|
|
92
|
+
@utility font-smallcaps {
|
|
93
|
+
font-variant: small-caps;
|
|
98
94
|
}
|
|
99
95
|
|
|
100
96
|
@utility scroll-hide {
|
|
@@ -227,7 +223,7 @@
|
|
|
227
223
|
background-color: var(--bg-color-invert);
|
|
228
224
|
}
|
|
229
225
|
|
|
230
|
-
@utility text-
|
|
226
|
+
@utility text-reset {
|
|
231
227
|
color: var(--text-color-base);
|
|
232
228
|
}
|
|
233
229
|
|
package/css/theme/index.css
CHANGED
|
@@ -14,7 +14,7 @@ var nodeCheck = require('../../utils/nodeCheck.js');
|
|
|
14
14
|
var MenuItem = require('./MenuItem.js');
|
|
15
15
|
var jsxRuntime = require('react/jsx-runtime');
|
|
16
16
|
|
|
17
|
-
var _excluded = ["children", "minimal", "menuClassName", "onClick", "ref"];
|
|
17
|
+
var _excluded = ["children", "minimal", "menuClassName", "onClick", "trigger", "ref"];
|
|
18
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
20
|
// FIXME: refactor menu implementation to differentiate between static and floating menus, implement context wrapper for each menu level
|
|
@@ -25,6 +25,8 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
25
25
|
minimal = _ref.minimal,
|
|
26
26
|
menuClassName = _ref.menuClassName,
|
|
27
27
|
onClick = _ref.onClick,
|
|
28
|
+
_ref$trigger = _ref.trigger,
|
|
29
|
+
trigger = _ref$trigger === void 0 ? "hover" : _ref$trigger,
|
|
28
30
|
ref = _ref.ref,
|
|
29
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
32
|
var _useState = react$1.useState(false),
|
|
@@ -46,6 +48,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
46
48
|
open: !isNested || isOpen,
|
|
47
49
|
onOpenChange: function onOpenChange(open, event, reason) {
|
|
48
50
|
isNested && setIsOpen(open);
|
|
51
|
+
if (reason === "outside-press" && trigger === "click") tree === null || tree === void 0 || tree.events.emit("close");
|
|
49
52
|
},
|
|
50
53
|
placement: isNested ? "right-start" : "bottom-start",
|
|
51
54
|
middleware: [react.offset({
|
|
@@ -58,6 +61,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
58
61
|
refs = _useFloating.refs,
|
|
59
62
|
context = _useFloating.context;
|
|
60
63
|
var hover = react.useHover(context, {
|
|
64
|
+
enabled: trigger === "hover",
|
|
61
65
|
delay: {
|
|
62
66
|
open: 75
|
|
63
67
|
},
|
|
@@ -67,8 +71,8 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
67
71
|
});
|
|
68
72
|
var click = react.useClick(context, {
|
|
69
73
|
event: "mousedown",
|
|
70
|
-
toggle: !isNested,
|
|
71
|
-
ignoreMouse: isNested
|
|
74
|
+
toggle: trigger === "click" || !isNested,
|
|
75
|
+
ignoreMouse: trigger === "hover" && !isNested
|
|
72
76
|
});
|
|
73
77
|
var role = react.useRole(context, {
|
|
74
78
|
role: "menu"
|
|
@@ -68,6 +68,9 @@ var ApplicationProvider = function ApplicationProvider(_ref3) {
|
|
|
68
68
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
69
69
|
locale = _useState8[0],
|
|
70
70
|
setLocale = _useState8[1];
|
|
71
|
+
react.useEffect(function () {
|
|
72
|
+
defaultColorScheme && setColorScheme(defaultColorScheme);
|
|
73
|
+
}, [defaultColorScheme]);
|
|
71
74
|
|
|
72
75
|
/** ***************** set initial theme and locale dir *******************/
|
|
73
76
|
react.useEffect(function () {
|
|
@@ -7,7 +7,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
|
|
8
8
|
var _excluded = ["children", "fullWidth", "className", "gutter"],
|
|
9
9
|
_excluded2 = ["children", "gutter", "noWrap", "orient", "align", "justify", "className"],
|
|
10
|
-
_excluded3 = ["children", "flex", "align", "className", "stretchContent"];
|
|
10
|
+
_excluded3 = ["children", "flex", "align", "truncate", "className", "stretchContent"];
|
|
11
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
13
|
/**
|
|
@@ -48,11 +48,12 @@ var Col = function Col(_ref3) {
|
|
|
48
48
|
var children = _ref3.children,
|
|
49
49
|
flex = _ref3.flex,
|
|
50
50
|
align = _ref3.align,
|
|
51
|
+
truncate = _ref3.truncate,
|
|
51
52
|
className = _ref3.className,
|
|
52
53
|
stretchContent = _ref3.stretchContent,
|
|
53
54
|
aria = _objectWithoutProperties(_ref3, _excluded3);
|
|
54
55
|
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({
|
|
55
|
-
className: classNames("fabric-col", className, stretchContent && "stretchContent", flex === "fill" && "flex-1", flex === "full" && "flex-full", flex === "auto" && "flex-auto", flex === "initial" && "flex-initial", flex === "content" && "flex-none", align && "self-".concat(align))
|
|
56
|
+
className: classNames("fabric-col", className, stretchContent && "stretchContent", flex === "fill" && "flex-1", flex === "full" && "flex-full", flex === "auto" && "flex-auto", flex === "initial" && "flex-initial", flex === "content" && "flex-none", align && "self-".concat(align), truncate && "truncate")
|
|
56
57
|
}, aria), {}, {
|
|
57
58
|
children: children
|
|
58
59
|
}));
|
package/dist/cjs/types/icons.js
CHANGED
|
@@ -66,9 +66,10 @@ exports.CoreIcons = void 0;
|
|
|
66
66
|
_CoreIcons.sortAsc = "M19 7H22L18 3L14 7H17V21H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z";
|
|
67
67
|
_CoreIcons.refresh = "M19.547 14.667c-0.736 2.083-2.245 3.67-4.094 4.553s-4.031 1.061-6.114 0.325-3.67-2.245-4.553-4.094-1.061-4.031-0.325-6.114 2.245-3.67 4.094-4.553 4.031-1.061 6.114-0.325c1.188 0.42 2.209 1.088 2.987 1.882l2.824 2.659h-3.48c-0.552 0-1 0.448-1 1s0.448 1 1 1h5.997c0.004 0 0.009 0 0.013 0 0.137-0.001 0.267-0.030 0.386-0.082 0.119-0.051 0.229-0.126 0.324-0.225 0.012-0.012 0.023-0.025 0.034-0.038 0.076-0.087 0.134-0.184 0.175-0.287s0.065-0.213 0.069-0.328c0.002-0.014 0.002-0.028 0.002-0.042v-5.998c0-0.552-0.448-1-1-1s-1 0.448-1 1v3.685l-2.916-2.745c-0.993-1.012-2.274-1.846-3.748-2.366-2.604-0.921-5.336-0.698-7.644 0.405s-4.197 3.088-5.117 5.692-0.696 5.335 0.406 7.643 3.088 4.197 5.692 5.117 5.335 0.697 7.643-0.406 4.197-3.088 5.117-5.692c0.184-0.521-0.089-1.092-0.61-1.276s-1.092 0.089-1.276 0.61z";
|
|
68
68
|
_CoreIcons.search = "M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z";
|
|
69
|
+
_CoreIcons.ellipsis = "M14 12c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 5c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 19c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414z";
|
|
69
70
|
_CoreIcons.filter = "M6,13H18V11H6M3,6V8H21V6M10,18H14V16H10V18Z";
|
|
70
71
|
_CoreIcons.funnel = "M19.845 4l-6.609 7.814c-0.147 0.173-0.236 0.399-0.236 0.646v6.922l-2-1v-5.922c0.001-0.227-0.077-0.457-0.236-0.646l-6.609-7.814zM22 2h-20c-0.552 0-1 0.448-1 1 0 0.247 0.089 0.473 0.236 0.646l7.764 9.18v6.174c0 0.389 0.222 0.727 0.553 0.894l4 2c0.494 0.247 1.095 0.047 1.342-0.447 0.072-0.146 0.106-0.301 0.105-0.447v-8.174l7.764-9.18c0.357-0.422 0.304-1.053-0.118-1.409-0.189-0.16-0.419-0.238-0.646-0.237z";
|
|
71
|
-
_CoreIcons.
|
|
72
|
+
_CoreIcons.funnelFull = "M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z";
|
|
72
73
|
_CoreIcons.funnelPlus = "M15 17H18V14H20V17H23V19H20V22H18V19H15V17M13 19.88C13.04 20.18 12.94 20.5 12.72 20.71C12.32 21.1 11.69 21.1 11.3 20.71L7.29 16.7C7.06 16.47 6.96 16.16 7 15.87V10.75L2.21 4.62C1.87 4.19 1.95 3.56 2.38 3.22C2.57 3.08 2.78 3 3 3V3H17V3C17.22 3 17.43 3.08 17.62 3.22C18.05 3.56 18.13 4.19 17.79 4.62L13 10.75V19.88M5.04 5L9 10.07V15.58L11 17.58V10.05L14.96 5H5.04Z";
|
|
73
74
|
_CoreIcons.funnelRemove = "M14.73,20.83L17.58,18L14.73,15.17L16.15,13.76L19,16.57L21.8,13.76L23.22,15.17L20.41,18L23.22,20.83L21.8,22.24L19,19.4L16.15,22.24L14.73,20.83M13,19.88C13.04,20.18 12.94,20.5 12.71,20.71C12.32,21.1 11.69,21.1 11.3,20.71L7.29,16.7C7.06,16.47 6.96,16.16 7,15.87V10.75L2.21,4.62C1.87,4.19 1.95,3.56 2.38,3.22C2.57,3.08 2.78,3 3,3V3H17V3C17.22,3 17.43,3.08 17.62,3.22C18.05,3.56 18.13,4.19 17.79,4.62L13,10.75V19.88M5.04,5L9,10.06V15.58L11,17.58V10.05L14.96,5H5.04Z";
|
|
74
75
|
_CoreIcons.funnelMinus = "M15 17H23V19H15V17M13 19.88C13.04 20.18 12.94 20.5 12.72 20.71C12.32 21.1 11.69 21.1 11.3 20.71L7.29 16.7C7.06 16.47 6.96 16.16 7 15.87V10.75L2.21 4.62C1.87 4.19 1.95 3.56 2.38 3.22C2.57 3.08 2.78 3 3 3V3H17V3C17.22 3 17.43 3.08 17.62 3.22C18.05 3.56 18.13 4.19 17.79 4.62L13 10.75V19.88M5.04 5L9 10.07V15.58L11 17.58V10.05L14.96 5H5.04Z";
|
|
@@ -21,9 +21,9 @@ var AbbrText = function AbbrText(_ref) {
|
|
|
21
21
|
return tooltip ? Tooltip.Tooltip : react.Fragment;
|
|
22
22
|
}, [tooltip]);
|
|
23
23
|
var tooltipProps = react.useMemo(function () {
|
|
24
|
-
return _objectSpread(_objectSpread({}, Tooltip.getTooltipProps(tooltip)), {}, {
|
|
24
|
+
return tooltip ? _objectSpread(_objectSpread({}, Tooltip.getTooltipProps(tooltip)), {}, {
|
|
25
25
|
copyContent: content
|
|
26
|
-
});
|
|
26
|
+
}) : {};
|
|
27
27
|
}, [tooltip, content]);
|
|
28
28
|
return /*#__PURE__*/jsxRuntime.jsx(TooltipWrapper, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
29
29
|
children: /*#__PURE__*/jsxRuntime.jsx("abbr", {
|
|
@@ -14,7 +14,7 @@ import { nodeCheck } from '../../utils/nodeCheck.js';
|
|
|
14
14
|
import { MenuItem } from './MenuItem.js';
|
|
15
15
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
16
16
|
|
|
17
|
-
var _excluded = ["children", "minimal", "menuClassName", "onClick", "ref"];
|
|
17
|
+
var _excluded = ["children", "minimal", "menuClassName", "onClick", "trigger", "ref"];
|
|
18
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
20
|
// FIXME: refactor menu implementation to differentiate between static and floating menus, implement context wrapper for each menu level
|
|
@@ -25,6 +25,8 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
25
25
|
minimal = _ref.minimal,
|
|
26
26
|
menuClassName = _ref.menuClassName,
|
|
27
27
|
onClick = _ref.onClick,
|
|
28
|
+
_ref$trigger = _ref.trigger,
|
|
29
|
+
trigger = _ref$trigger === void 0 ? "hover" : _ref$trigger,
|
|
28
30
|
ref = _ref.ref,
|
|
29
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
32
|
var _useState = useState(false),
|
|
@@ -46,6 +48,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
46
48
|
open: !isNested || isOpen,
|
|
47
49
|
onOpenChange: function onOpenChange(open, event, reason) {
|
|
48
50
|
isNested && setIsOpen(open);
|
|
51
|
+
if (reason === "outside-press" && trigger === "click") tree === null || tree === void 0 || tree.events.emit("close");
|
|
49
52
|
},
|
|
50
53
|
placement: isNested ? "right-start" : "bottom-start",
|
|
51
54
|
middleware: [offset({
|
|
@@ -58,6 +61,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
58
61
|
refs = _useFloating.refs,
|
|
59
62
|
context = _useFloating.context;
|
|
60
63
|
var hover = useHover(context, {
|
|
64
|
+
enabled: trigger === "hover",
|
|
61
65
|
delay: {
|
|
62
66
|
open: 75
|
|
63
67
|
},
|
|
@@ -67,8 +71,8 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
67
71
|
});
|
|
68
72
|
var click = useClick(context, {
|
|
69
73
|
event: "mousedown",
|
|
70
|
-
toggle: !isNested,
|
|
71
|
-
ignoreMouse: isNested
|
|
74
|
+
toggle: trigger === "click" || !isNested,
|
|
75
|
+
ignoreMouse: trigger === "hover" && !isNested
|
|
72
76
|
});
|
|
73
77
|
var role = useRole(context, {
|
|
74
78
|
role: "menu"
|
|
@@ -68,6 +68,9 @@ var ApplicationProvider = function ApplicationProvider(_ref3) {
|
|
|
68
68
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
69
69
|
locale = _useState8[0],
|
|
70
70
|
setLocale = _useState8[1];
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
defaultColorScheme && setColorScheme(defaultColorScheme);
|
|
73
|
+
}, [defaultColorScheme]);
|
|
71
74
|
|
|
72
75
|
/** ***************** set initial theme and locale dir *******************/
|
|
73
76
|
useEffect(function () {
|
|
@@ -7,7 +7,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
7
7
|
|
|
8
8
|
var _excluded = ["children", "fullWidth", "className", "gutter"],
|
|
9
9
|
_excluded2 = ["children", "gutter", "noWrap", "orient", "align", "justify", "className"],
|
|
10
|
-
_excluded3 = ["children", "flex", "align", "className", "stretchContent"];
|
|
10
|
+
_excluded3 = ["children", "flex", "align", "truncate", "className", "stretchContent"];
|
|
11
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
13
|
/**
|
|
@@ -48,11 +48,12 @@ var Col = function Col(_ref3) {
|
|
|
48
48
|
var children = _ref3.children,
|
|
49
49
|
flex = _ref3.flex,
|
|
50
50
|
align = _ref3.align,
|
|
51
|
+
truncate = _ref3.truncate,
|
|
51
52
|
className = _ref3.className,
|
|
52
53
|
stretchContent = _ref3.stretchContent,
|
|
53
54
|
aria = _objectWithoutProperties(_ref3, _excluded3);
|
|
54
55
|
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
55
|
-
className: classNames("fabric-col", className, stretchContent && "stretchContent", flex === "fill" && "flex-1", flex === "full" && "flex-full", flex === "auto" && "flex-auto", flex === "initial" && "flex-initial", flex === "content" && "flex-none", align && "self-".concat(align))
|
|
56
|
+
className: classNames("fabric-col", className, stretchContent && "stretchContent", flex === "fill" && "flex-1", flex === "full" && "flex-full", flex === "auto" && "flex-auto", flex === "initial" && "flex-initial", flex === "content" && "flex-none", align && "self-".concat(align), truncate && "truncate")
|
|
56
57
|
}, aria), {}, {
|
|
57
58
|
children: children
|
|
58
59
|
}));
|
package/dist/esm/types/icons.js
CHANGED
|
@@ -66,9 +66,10 @@ var CoreIcons;
|
|
|
66
66
|
_CoreIcons.sortAsc = "M19 7H22L18 3L14 7H17V21H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z";
|
|
67
67
|
_CoreIcons.refresh = "M19.547 14.667c-0.736 2.083-2.245 3.67-4.094 4.553s-4.031 1.061-6.114 0.325-3.67-2.245-4.553-4.094-1.061-4.031-0.325-6.114 2.245-3.67 4.094-4.553 4.031-1.061 6.114-0.325c1.188 0.42 2.209 1.088 2.987 1.882l2.824 2.659h-3.48c-0.552 0-1 0.448-1 1s0.448 1 1 1h5.997c0.004 0 0.009 0 0.013 0 0.137-0.001 0.267-0.030 0.386-0.082 0.119-0.051 0.229-0.126 0.324-0.225 0.012-0.012 0.023-0.025 0.034-0.038 0.076-0.087 0.134-0.184 0.175-0.287s0.065-0.213 0.069-0.328c0.002-0.014 0.002-0.028 0.002-0.042v-5.998c0-0.552-0.448-1-1-1s-1 0.448-1 1v3.685l-2.916-2.745c-0.993-1.012-2.274-1.846-3.748-2.366-2.604-0.921-5.336-0.698-7.644 0.405s-4.197 3.088-5.117 5.692-0.696 5.335 0.406 7.643 3.088 4.197 5.692 5.117 5.335 0.697 7.643-0.406 4.197-3.088 5.117-5.692c0.184-0.521-0.089-1.092-0.61-1.276s-1.092 0.089-1.276 0.61z";
|
|
68
68
|
_CoreIcons.search = "M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z";
|
|
69
|
+
_CoreIcons.ellipsis = "M14 12c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 5c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 19c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414z";
|
|
69
70
|
_CoreIcons.filter = "M6,13H18V11H6M3,6V8H21V6M10,18H14V16H10V18Z";
|
|
70
71
|
_CoreIcons.funnel = "M19.845 4l-6.609 7.814c-0.147 0.173-0.236 0.399-0.236 0.646v6.922l-2-1v-5.922c0.001-0.227-0.077-0.457-0.236-0.646l-6.609-7.814zM22 2h-20c-0.552 0-1 0.448-1 1 0 0.247 0.089 0.473 0.236 0.646l7.764 9.18v6.174c0 0.389 0.222 0.727 0.553 0.894l4 2c0.494 0.247 1.095 0.047 1.342-0.447 0.072-0.146 0.106-0.301 0.105-0.447v-8.174l7.764-9.18c0.357-0.422 0.304-1.053-0.118-1.409-0.189-0.16-0.419-0.238-0.646-0.237z";
|
|
71
|
-
_CoreIcons.
|
|
72
|
+
_CoreIcons.funnelFull = "M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z";
|
|
72
73
|
_CoreIcons.funnelPlus = "M15 17H18V14H20V17H23V19H20V22H18V19H15V17M13 19.88C13.04 20.18 12.94 20.5 12.72 20.71C12.32 21.1 11.69 21.1 11.3 20.71L7.29 16.7C7.06 16.47 6.96 16.16 7 15.87V10.75L2.21 4.62C1.87 4.19 1.95 3.56 2.38 3.22C2.57 3.08 2.78 3 3 3V3H17V3C17.22 3 17.43 3.08 17.62 3.22C18.05 3.56 18.13 4.19 17.79 4.62L13 10.75V19.88M5.04 5L9 10.07V15.58L11 17.58V10.05L14.96 5H5.04Z";
|
|
73
74
|
_CoreIcons.funnelRemove = "M14.73,20.83L17.58,18L14.73,15.17L16.15,13.76L19,16.57L21.8,13.76L23.22,15.17L20.41,18L23.22,20.83L21.8,22.24L19,19.4L16.15,22.24L14.73,20.83M13,19.88C13.04,20.18 12.94,20.5 12.71,20.71C12.32,21.1 11.69,21.1 11.3,20.71L7.29,16.7C7.06,16.47 6.96,16.16 7,15.87V10.75L2.21,4.62C1.87,4.19 1.95,3.56 2.38,3.22C2.57,3.08 2.78,3 3,3V3H17V3C17.22,3 17.43,3.08 17.62,3.22C18.05,3.56 18.13,4.19 17.79,4.62L13,10.75V19.88M5.04,5L9,10.06V15.58L11,17.58V10.05L14.96,5H5.04Z";
|
|
74
75
|
_CoreIcons.funnelMinus = "M15 17H23V19H15V17M13 19.88C13.04 20.18 12.94 20.5 12.72 20.71C12.32 21.1 11.69 21.1 11.3 20.71L7.29 16.7C7.06 16.47 6.96 16.16 7 15.87V10.75L2.21 4.62C1.87 4.19 1.95 3.56 2.38 3.22C2.57 3.08 2.78 3 3 3V3H17V3C17.22 3 17.43 3.08 17.62 3.22C18.05 3.56 18.13 4.19 17.79 4.62L13 10.75V19.88M5.04 5L9 10.07V15.58L11 17.58V10.05L14.96 5H5.04Z";
|
|
@@ -21,9 +21,9 @@ var AbbrText = function AbbrText(_ref) {
|
|
|
21
21
|
return tooltip ? Tooltip : Fragment;
|
|
22
22
|
}, [tooltip]);
|
|
23
23
|
var tooltipProps = useMemo(function () {
|
|
24
|
-
return _objectSpread(_objectSpread({}, getTooltipProps(tooltip)), {}, {
|
|
24
|
+
return tooltip ? _objectSpread(_objectSpread({}, getTooltipProps(tooltip)), {}, {
|
|
25
25
|
copyContent: content
|
|
26
|
-
});
|
|
26
|
+
}) : {};
|
|
27
27
|
}, [tooltip, content]);
|
|
28
28
|
return /*#__PURE__*/jsx(TooltipWrapper, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
29
29
|
children: /*#__PURE__*/jsx("abbr", {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ChildrenProp, type RefProp } from "../../types";
|
|
2
|
+
export interface FlipContentRef {
|
|
3
|
+
flipCard: () => void;
|
|
4
|
+
}
|
|
5
|
+
export interface Props extends ChildrenProp, RefProp<FlipContentRef> {
|
|
6
|
+
}
|
|
7
|
+
export declare const FlipContent: ({ ref, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -44,10 +44,14 @@ export interface ColProps extends AriaProps, CssProp, TestProps, Partial<Childre
|
|
|
44
44
|
* stretch inner content
|
|
45
45
|
*/
|
|
46
46
|
stretchContent?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* truncate text
|
|
49
|
+
*/
|
|
50
|
+
truncate?: boolean;
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
53
|
* Responsive layout container
|
|
50
54
|
*/
|
|
51
55
|
export declare const Container: ({ children, fullWidth, className, gutter, ...aria }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
56
|
export declare const Row: ({ children, gutter, noWrap, orient, align, justify, className, ...aria }: RowProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
export declare const Col: ({ children, flex, align, className, stretchContent, ...aria }: ColProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare const Col: ({ children, flex, align, truncate, className, stretchContent, ...aria }: ColProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -48,9 +48,10 @@ export declare namespace CoreIcons {
|
|
|
48
48
|
const sortAsc = "M19 7H22L18 3L14 7H17V21H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z";
|
|
49
49
|
const refresh = "M19.547 14.667c-0.736 2.083-2.245 3.67-4.094 4.553s-4.031 1.061-6.114 0.325-3.67-2.245-4.553-4.094-1.061-4.031-0.325-6.114 2.245-3.67 4.094-4.553 4.031-1.061 6.114-0.325c1.188 0.42 2.209 1.088 2.987 1.882l2.824 2.659h-3.48c-0.552 0-1 0.448-1 1s0.448 1 1 1h5.997c0.004 0 0.009 0 0.013 0 0.137-0.001 0.267-0.030 0.386-0.082 0.119-0.051 0.229-0.126 0.324-0.225 0.012-0.012 0.023-0.025 0.034-0.038 0.076-0.087 0.134-0.184 0.175-0.287s0.065-0.213 0.069-0.328c0.002-0.014 0.002-0.028 0.002-0.042v-5.998c0-0.552-0.448-1-1-1s-1 0.448-1 1v3.685l-2.916-2.745c-0.993-1.012-2.274-1.846-3.748-2.366-2.604-0.921-5.336-0.698-7.644 0.405s-4.197 3.088-5.117 5.692-0.696 5.335 0.406 7.643 3.088 4.197 5.692 5.117 5.335 0.697 7.643-0.406 4.197-3.088 5.117-5.692c0.184-0.521-0.089-1.092-0.61-1.276s-1.092 0.089-1.276 0.61z";
|
|
50
50
|
const search = "M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z";
|
|
51
|
+
const ellipsis = "M14 12c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 5c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 19c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414z";
|
|
51
52
|
const filter = "M6,13H18V11H6M3,6V8H21V6M10,18H14V16H10V18Z";
|
|
52
53
|
const funnel = "M19.845 4l-6.609 7.814c-0.147 0.173-0.236 0.399-0.236 0.646v6.922l-2-1v-5.922c0.001-0.227-0.077-0.457-0.236-0.646l-6.609-7.814zM22 2h-20c-0.552 0-1 0.448-1 1 0 0.247 0.089 0.473 0.236 0.646l7.764 9.18v6.174c0 0.389 0.222 0.727 0.553 0.894l4 2c0.494 0.247 1.095 0.047 1.342-0.447 0.072-0.146 0.106-0.301 0.105-0.447v-8.174l7.764-9.18c0.357-0.422 0.304-1.053-0.118-1.409-0.189-0.16-0.419-0.238-0.646-0.237z";
|
|
53
|
-
const
|
|
54
|
+
const funnelFull = "M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z";
|
|
54
55
|
const funnelPlus = "M15 17H18V14H20V17H23V19H20V22H18V19H15V17M13 19.88C13.04 20.18 12.94 20.5 12.72 20.71C12.32 21.1 11.69 21.1 11.3 20.71L7.29 16.7C7.06 16.47 6.96 16.16 7 15.87V10.75L2.21 4.62C1.87 4.19 1.95 3.56 2.38 3.22C2.57 3.08 2.78 3 3 3V3H17V3C17.22 3 17.43 3.08 17.62 3.22C18.05 3.56 18.13 4.19 17.79 4.62L13 10.75V19.88M5.04 5L9 10.07V15.58L11 17.58V10.05L14.96 5H5.04Z";
|
|
55
56
|
const funnelRemove = "M14.73,20.83L17.58,18L14.73,15.17L16.15,13.76L19,16.57L21.8,13.76L23.22,15.17L20.41,18L23.22,20.83L21.8,22.24L19,19.4L16.15,22.24L14.73,20.83M13,19.88C13.04,20.18 12.94,20.5 12.71,20.71C12.32,21.1 11.69,21.1 11.3,20.71L7.29,16.7C7.06,16.47 6.96,16.16 7,15.87V10.75L2.21,4.62C1.87,4.19 1.95,3.56 2.38,3.22C2.57,3.08 2.78,3 3,3V3H17V3C17.22,3 17.43,3.08 17.62,3.22C18.05,3.56 18.13,4.19 17.79,4.62L13,10.75V19.88M5.04,5L9,10.06V15.58L11,17.58V10.05L14.96,5H5.04Z";
|
|
56
57
|
const funnelMinus = "M15 17H23V19H15V17M13 19.88C13.04 20.18 12.94 20.5 12.72 20.71C12.32 21.1 11.69 21.1 11.3 20.71L7.29 16.7C7.06 16.47 6.96 16.16 7 15.87V10.75L2.21 4.62C1.87 4.19 1.95 3.56 2.38 3.22C2.57 3.08 2.78 3 3 3V3H17V3C17.22 3 17.43 3.08 17.62 3.22C18.05 3.56 18.13 4.19 17.79 4.62L13 10.75V19.88M5.04 5L9 10.07V15.58L11 17.58V10.05L14.96 5H5.04Z";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.48",
|
|
4
4
|
"description": "RUF: Core package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@floating-ui/react": "^0.
|
|
39
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
38
|
+
"@floating-ui/react": "^0.27.9",
|
|
39
|
+
"@react-fabric/utilities": "^1.0.0-beta.48",
|
|
40
40
|
"@tailwindcss/postcss": "~4.0.14",
|
|
41
|
-
"boring-avatars": "^1.
|
|
41
|
+
"boring-avatars": "^1.11.2",
|
|
42
42
|
"classnames": "^2.5.1",
|
|
43
43
|
"color": "^4.2.3",
|
|
44
44
|
"resize-observer-polyfill": "^1.5.1",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"node": ">=18.12.0",
|
|
55
55
|
"npm": ">=8.19.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "0b1001b4ae1ee67f8e1817d6395d1f3945321897"
|
|
58
58
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* React Fabric
|
|
3
|
+
* @version: 1.0.0
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* The MIT License (MIT)
|
|
7
|
+
* Copyright (c) 2025 Adarsh Pastakia
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
10
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
11
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
12
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
+
* subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
16
|
+
* portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import classNames from "classnames";
|
|
25
|
+
import {
|
|
26
|
+
Children,
|
|
27
|
+
cloneElement,
|
|
28
|
+
isValidElement,
|
|
29
|
+
useImperativeHandle,
|
|
30
|
+
useState,
|
|
31
|
+
} from "react";
|
|
32
|
+
import { type ChildrenProp, type CssProp, type RefProp } from "../../types";
|
|
33
|
+
|
|
34
|
+
export interface FlipContentRef {
|
|
35
|
+
flipCard: () => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Props extends ChildrenProp, RefProp<FlipContentRef> {
|
|
39
|
+
//
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const FlipContent = ({ ref, children }: Props) => {
|
|
43
|
+
const [showBack, setShowBack] = useState(false);
|
|
44
|
+
|
|
45
|
+
useImperativeHandle(
|
|
46
|
+
ref,
|
|
47
|
+
() => ({
|
|
48
|
+
flipCard: () => setShowBack(!showBack),
|
|
49
|
+
}),
|
|
50
|
+
[showBack],
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className="relative flex-1" data-card-flip={showBack}>
|
|
55
|
+
{Children.map(
|
|
56
|
+
children,
|
|
57
|
+
(child, idx) =>
|
|
58
|
+
isValidElement<CssProp>(child) &&
|
|
59
|
+
cloneElement(child, {
|
|
60
|
+
className: classNames(
|
|
61
|
+
child.props?.className ?? "",
|
|
62
|
+
idx === 0 ? "bg-base relative" : "bg-base absolute inset-0",
|
|
63
|
+
),
|
|
64
|
+
"data-card-flip-face": idx === 0 ? "front" : "back",
|
|
65
|
+
} as AnyObject),
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
@@ -69,6 +69,8 @@ const MenuComponent = ({
|
|
|
69
69
|
menuClassName,
|
|
70
70
|
onClick,
|
|
71
71
|
// @ts-expect-error ignore
|
|
72
|
+
trigger = "hover",
|
|
73
|
+
// @ts-expect-error ignore
|
|
72
74
|
ref,
|
|
73
75
|
...rest
|
|
74
76
|
}: Partial<MenuProps>) => {
|
|
@@ -89,6 +91,8 @@ const MenuComponent = ({
|
|
|
89
91
|
open: !isNested || isOpen,
|
|
90
92
|
onOpenChange(open, event, reason) {
|
|
91
93
|
isNested && setIsOpen(open);
|
|
94
|
+
if (reason === "outside-press" && trigger === "click")
|
|
95
|
+
tree?.events.emit("close");
|
|
92
96
|
},
|
|
93
97
|
placement: isNested ? "right-start" : "bottom-start",
|
|
94
98
|
middleware: [
|
|
@@ -100,13 +104,14 @@ const MenuComponent = ({
|
|
|
100
104
|
});
|
|
101
105
|
|
|
102
106
|
const hover = useHover(context, {
|
|
107
|
+
enabled: trigger === "hover",
|
|
103
108
|
delay: { open: 75 },
|
|
104
109
|
handleClose: safePolygon({ blockPointerEvents: true }),
|
|
105
110
|
});
|
|
106
111
|
const click = useClick(context, {
|
|
107
112
|
event: "mousedown",
|
|
108
|
-
toggle: !isNested,
|
|
109
|
-
ignoreMouse: isNested,
|
|
113
|
+
toggle: trigger === "click" || !isNested,
|
|
114
|
+
ignoreMouse: trigger === "hover" && !isNested,
|
|
110
115
|
});
|
|
111
116
|
const role = useRole(context, { role: "menu" });
|
|
112
117
|
const dismiss = useDismiss(context, { bubbles: true });
|
package/src/context/Global.tsx
CHANGED
|
@@ -146,6 +146,10 @@ export const ApplicationProvider: FC<GlobalProps> = ({
|
|
|
146
146
|
defaultLocale ?? systemLocale(),
|
|
147
147
|
);
|
|
148
148
|
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
defaultColorScheme && setColorScheme(defaultColorScheme);
|
|
151
|
+
}, [defaultColorScheme]);
|
|
152
|
+
|
|
149
153
|
/** ***************** set initial theme and locale dir *******************/
|
|
150
154
|
useEffect(() => {
|
|
151
155
|
document.documentElement.lang = locale;
|
|
@@ -85,6 +85,10 @@ export interface ColProps
|
|
|
85
85
|
* stretch inner content
|
|
86
86
|
*/
|
|
87
87
|
stretchContent?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* truncate text
|
|
90
|
+
*/
|
|
91
|
+
truncate?: boolean;
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
/**
|
|
@@ -148,6 +152,7 @@ export const Col = ({
|
|
|
148
152
|
children,
|
|
149
153
|
flex,
|
|
150
154
|
align,
|
|
155
|
+
truncate,
|
|
151
156
|
className,
|
|
152
157
|
stretchContent,
|
|
153
158
|
...aria
|
|
@@ -164,6 +169,7 @@ export const Col = ({
|
|
|
164
169
|
flex === "initial" && "flex-initial",
|
|
165
170
|
flex === "content" && "flex-none",
|
|
166
171
|
align && `self-${align}`,
|
|
172
|
+
truncate && "truncate",
|
|
167
173
|
)}
|
|
168
174
|
{...aria}
|
|
169
175
|
>
|
|
@@ -32,14 +32,18 @@ export const useResizeObserver = <T extends HTMLElement = HTMLDivElement>(
|
|
|
32
32
|
const ref = useRef<T>(null);
|
|
33
33
|
const [, startTransition] = useTransition();
|
|
34
34
|
|
|
35
|
-
const callbackResize = useDebounce(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
const callbackResize = useDebounce(
|
|
36
|
+
() => {
|
|
37
|
+
startTransition(() => {
|
|
38
|
+
if (onResize && ref.current != null) {
|
|
39
|
+
const { offsetWidth: width, offsetHeight: height } = ref.current;
|
|
40
|
+
onResize?.({ width, height });
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
[onResize],
|
|
45
|
+
0,
|
|
46
|
+
);
|
|
43
47
|
|
|
44
48
|
useEffect(() => {
|
|
45
49
|
if (ref.current != null) {
|
package/src/types/icons.ts
CHANGED
|
@@ -124,11 +124,13 @@ export module CoreIcons {
|
|
|
124
124
|
"M19.547 14.667c-0.736 2.083-2.245 3.67-4.094 4.553s-4.031 1.061-6.114 0.325-3.67-2.245-4.553-4.094-1.061-4.031-0.325-6.114 2.245-3.67 4.094-4.553 4.031-1.061 6.114-0.325c1.188 0.42 2.209 1.088 2.987 1.882l2.824 2.659h-3.48c-0.552 0-1 0.448-1 1s0.448 1 1 1h5.997c0.004 0 0.009 0 0.013 0 0.137-0.001 0.267-0.030 0.386-0.082 0.119-0.051 0.229-0.126 0.324-0.225 0.012-0.012 0.023-0.025 0.034-0.038 0.076-0.087 0.134-0.184 0.175-0.287s0.065-0.213 0.069-0.328c0.002-0.014 0.002-0.028 0.002-0.042v-5.998c0-0.552-0.448-1-1-1s-1 0.448-1 1v3.685l-2.916-2.745c-0.993-1.012-2.274-1.846-3.748-2.366-2.604-0.921-5.336-0.698-7.644 0.405s-4.197 3.088-5.117 5.692-0.696 5.335 0.406 7.643 3.088 4.197 5.692 5.117 5.335 0.697 7.643-0.406 4.197-3.088 5.117-5.692c0.184-0.521-0.089-1.092-0.61-1.276s-1.092 0.089-1.276 0.61z";
|
|
125
125
|
export const search =
|
|
126
126
|
"M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z";
|
|
127
|
+
export const ellipsis =
|
|
128
|
+
"M14 12c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 5c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 19c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414z";
|
|
127
129
|
export const filter = "M6,13H18V11H6M3,6V8H21V6M10,18H14V16H10V18Z";
|
|
128
130
|
export const funnel =
|
|
129
131
|
"M19.845 4l-6.609 7.814c-0.147 0.173-0.236 0.399-0.236 0.646v6.922l-2-1v-5.922c0.001-0.227-0.077-0.457-0.236-0.646l-6.609-7.814zM22 2h-20c-0.552 0-1 0.448-1 1 0 0.247 0.089 0.473 0.236 0.646l7.764 9.18v6.174c0 0.389 0.222 0.727 0.553 0.894l4 2c0.494 0.247 1.095 0.047 1.342-0.447 0.072-0.146 0.106-0.301 0.105-0.447v-8.174l7.764-9.18c0.357-0.422 0.304-1.053-0.118-1.409-0.189-0.16-0.419-0.238-0.646-0.237z";
|
|
130
|
-
export const
|
|
131
|
-
"M14
|
|
132
|
+
export const funnelFull =
|
|
133
|
+
"M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z";
|
|
132
134
|
export const funnelPlus =
|
|
133
135
|
"M15 17H18V14H20V17H23V19H20V22H18V19H15V17M13 19.88C13.04 20.18 12.94 20.5 12.72 20.71C12.32 21.1 11.69 21.1 11.3 20.71L7.29 16.7C7.06 16.47 6.96 16.16 7 15.87V10.75L2.21 4.62C1.87 4.19 1.95 3.56 2.38 3.22C2.57 3.08 2.78 3 3 3V3H17V3C17.22 3 17.43 3.08 17.62 3.22C18.05 3.56 18.13 4.19 17.79 4.62L13 10.75V19.88M5.04 5L9 10.07V15.58L11 17.58V10.05L14.96 5H5.04Z";
|
|
134
136
|
export const funnelRemove =
|
package/src/typography/Abbr.tsx
CHANGED
|
@@ -47,7 +47,7 @@ const AbbrText = ({ color, children, tooltip, content }: AbbrTextProps) => {
|
|
|
47
47
|
[tooltip],
|
|
48
48
|
);
|
|
49
49
|
const tooltipProps = useMemo(() => {
|
|
50
|
-
return { ...getTooltipProps(tooltip), copyContent: content };
|
|
50
|
+
return tooltip ? { ...getTooltipProps(tooltip), copyContent: content } : {};
|
|
51
51
|
}, [tooltip, content]);
|
|
52
52
|
|
|
53
53
|
return (
|