@sendoutcards/quantum-design-ui 1.8.39-alpha.2 → 1.8.39-alpha.4
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/dist/index.es.js +189 -133
- package/dist/src/atoms/anchor/anchor.d.ts +1 -1
- package/dist/src/atoms/aside/aside.d.ts +2 -2
- package/dist/src/atoms/div/div.d.ts +2 -2
- package/dist/src/atoms/flex/flex.d.ts +1 -1
- package/dist/src/atoms/flex/flexItem.d.ts +1 -1
- package/dist/src/atoms/hStack/hStack.d.ts +1 -1
- package/dist/src/atoms/list/list.d.ts +2 -2
- package/dist/src/atoms/listItem/listItem.d.ts +1 -1
- package/dist/src/atoms/section/section.d.ts +2 -2
- package/dist/src/atoms/span/span.d.ts +1 -1
- package/dist/src/atoms/vStack/vStack.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect, createContext,
|
|
1
|
+
import React, { useState, useEffect, createContext, useRef, useMemo, useCallback, useContext, useLayoutEffect, useImperativeHandle } from 'react';
|
|
2
2
|
import { jsx, ThemeProvider, Global, css, useTheme } from '@emotion/react';
|
|
3
3
|
import Color$1 from 'color';
|
|
4
4
|
import { motion, useMotionValue, useTransform, animate, AnimatePresence, useElementScroll, AnimateSharedLayout, useAnimation } from 'framer-motion';
|
|
@@ -12351,6 +12351,12 @@ var styles$R = {
|
|
|
12351
12351
|
var templateObject_1$V;
|
|
12352
12352
|
|
|
12353
12353
|
var useOutsideClick = function (ref, handler, targetIdBypass) {
|
|
12354
|
+
// Store handler in a ref so we can access latest version without dependency
|
|
12355
|
+
var handlerRef = useRef(handler);
|
|
12356
|
+
// Update ref when handler changes
|
|
12357
|
+
useEffect(function () {
|
|
12358
|
+
handlerRef.current = handler;
|
|
12359
|
+
}, [handler]);
|
|
12354
12360
|
useEffect(function () {
|
|
12355
12361
|
var listener = function (event) {
|
|
12356
12362
|
// Do nothing if clicking ref's element or descendent elements
|
|
@@ -12369,7 +12375,7 @@ var useOutsideClick = function (ref, handler, targetIdBypass) {
|
|
|
12369
12375
|
if (!(ref === null || ref === void 0 ? void 0 : ref.current) || (ref === null || ref === void 0 ? void 0 : ref.current.contains(event.target))) {
|
|
12370
12376
|
return;
|
|
12371
12377
|
}
|
|
12372
|
-
|
|
12378
|
+
handlerRef.current(event);
|
|
12373
12379
|
};
|
|
12374
12380
|
document.addEventListener('mousedown', listener);
|
|
12375
12381
|
document.addEventListener('touchstart', listener);
|
|
@@ -12377,20 +12383,24 @@ var useOutsideClick = function (ref, handler, targetIdBypass) {
|
|
|
12377
12383
|
document.removeEventListener('mousedown', listener);
|
|
12378
12384
|
document.removeEventListener('touchstart', listener);
|
|
12379
12385
|
};
|
|
12380
|
-
},
|
|
12381
|
-
// Add ref and handler to effect dependencies
|
|
12382
|
-
// It's worth noting that because passed in handler is a new ...
|
|
12383
|
-
// ... function on every render that will cause this effect ...
|
|
12384
|
-
// ... callback/cleanup to run every render. It's not a big deal ...
|
|
12385
|
-
// ... but to optimize you can wrap handler in useCallback before ...
|
|
12386
|
-
// ... passing it into this hook.
|
|
12387
|
-
[ref, handler, targetIdBypass]);
|
|
12386
|
+
}, [ref, targetIdBypass]);
|
|
12388
12387
|
};
|
|
12389
12388
|
|
|
12390
|
-
var Div = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12391
|
-
var
|
|
12389
|
+
var Div = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12390
|
+
var onMouseEvent = props.onMouseEvent,
|
|
12391
|
+
onClick = props.onClick,
|
|
12392
|
+
rest = __rest(props, ["onMouseEvent", "onClick"]);
|
|
12392
12393
|
var entities = useEntities();
|
|
12393
|
-
var generatedDivStyles =
|
|
12394
|
+
var generatedDivStyles = useMemo(function () {
|
|
12395
|
+
return generateStyles(props, entities);
|
|
12396
|
+
}, [props, entities]);
|
|
12397
|
+
var handleClick = useCallback(function (e) {
|
|
12398
|
+
if (onMouseEvent) {
|
|
12399
|
+
onMouseEvent(e);
|
|
12400
|
+
} else {
|
|
12401
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
12402
|
+
}
|
|
12403
|
+
}, [onMouseEvent, onClick]);
|
|
12394
12404
|
useOutsideClick(ref, function () {
|
|
12395
12405
|
props.outsideClick && props.outsideClick();
|
|
12396
12406
|
}, props.clickElementBypass);
|
|
@@ -12398,17 +12408,11 @@ var Div = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
12398
12408
|
key: props.motionKey,
|
|
12399
12409
|
ref: ref,
|
|
12400
12410
|
animate: process.env.NODE_ENV === 'test' ? undefined : props.animate,
|
|
12401
|
-
onClick:
|
|
12402
|
-
var _a;
|
|
12403
|
-
return (_a = props.onMouseEvent) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
12404
|
-
} : function () {
|
|
12405
|
-
var _a;
|
|
12406
|
-
return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
12407
|
-
},
|
|
12411
|
+
onClick: handleClick,
|
|
12408
12412
|
css: styles$R.divStyles(generatedDivStyles),
|
|
12409
12413
|
className: "".concat(props.className ? props.className : '')
|
|
12410
12414
|
}, rest), props.children);
|
|
12411
|
-
});
|
|
12415
|
+
}));
|
|
12412
12416
|
|
|
12413
12417
|
var useWindowSize = function () {
|
|
12414
12418
|
return useContext(WindowSizeContext);
|
|
@@ -12557,7 +12561,7 @@ var computeTextTypeFromInfoBlockSize = function (size) {
|
|
|
12557
12561
|
});
|
|
12558
12562
|
};
|
|
12559
12563
|
|
|
12560
|
-
var Anchor = function (props) {
|
|
12564
|
+
var Anchor = /*#__PURE__*/React.memo(function (props) {
|
|
12561
12565
|
var entities = useEntities();
|
|
12562
12566
|
var _a = props.color,
|
|
12563
12567
|
color = _a === void 0 ? 'primaryBody' : _a,
|
|
@@ -12567,29 +12571,34 @@ var Anchor = function (props) {
|
|
|
12567
12571
|
_c = props.display,
|
|
12568
12572
|
display = _c === void 0 ? 'inline-block' : _c,
|
|
12569
12573
|
shouldDownload = props.shouldDownload,
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
display
|
|
12573
|
-
|
|
12574
|
+
onMouseEvent = props.onMouseEvent,
|
|
12575
|
+
onClick = props.onClick,
|
|
12576
|
+
rest = __rest(props, ["color", "size", "isDecorated", "display", "shouldDownload", "onMouseEvent", "onClick"]);
|
|
12577
|
+
var generatedDivStyles = useMemo(function () {
|
|
12578
|
+
return generateStyles(__assign({
|
|
12579
|
+
display: display
|
|
12580
|
+
}, rest), entities);
|
|
12581
|
+
}, [display, rest, entities]);
|
|
12582
|
+
var handleClick = useCallback(function (e) {
|
|
12583
|
+
if (onMouseEvent) {
|
|
12584
|
+
onMouseEvent(e);
|
|
12585
|
+
} else {
|
|
12586
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
12587
|
+
}
|
|
12588
|
+
}, [onMouseEvent, onClick]);
|
|
12574
12589
|
return jsx(motion.a, _extends({
|
|
12575
12590
|
rel: "noopener noreferrer",
|
|
12576
12591
|
target: rest.target
|
|
12577
12592
|
}, rest, {
|
|
12578
12593
|
href: rest.href,
|
|
12579
|
-
onClick:
|
|
12580
|
-
var _a;
|
|
12581
|
-
return (_a = rest.onMouseEvent) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
12582
|
-
} : function () {
|
|
12583
|
-
var _a;
|
|
12584
|
-
return (_a = rest.onClick) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
12585
|
-
},
|
|
12594
|
+
onClick: handleClick,
|
|
12586
12595
|
download: shouldDownload,
|
|
12587
12596
|
css: styles$T.anchorStyles(generatedDivStyles, entities, color, isDecorated)
|
|
12588
12597
|
}), jsx(Text, {
|
|
12589
12598
|
type: computeTextTypeFromSize(size),
|
|
12590
12599
|
color: color
|
|
12591
12600
|
}, rest.title || rest.children));
|
|
12592
|
-
};
|
|
12601
|
+
});
|
|
12593
12602
|
|
|
12594
12603
|
var styles$Q = {
|
|
12595
12604
|
spanStyles: function (generatedStyles) {
|
|
@@ -12598,21 +12607,27 @@ var styles$Q = {
|
|
|
12598
12607
|
};
|
|
12599
12608
|
var templateObject_1$U;
|
|
12600
12609
|
|
|
12601
|
-
var Span = function (props) {
|
|
12610
|
+
var Span = /*#__PURE__*/React.memo(function (props) {
|
|
12611
|
+
var onMouseEvent = props.onMouseEvent,
|
|
12612
|
+
onClick = props.onClick,
|
|
12613
|
+
rest = __rest(props, ["onMouseEvent", "onClick"]);
|
|
12602
12614
|
var entities = useEntities();
|
|
12603
|
-
var generatedDivStyles =
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
}
|
|
12615
|
+
var generatedDivStyles = useMemo(function () {
|
|
12616
|
+
return generateStyles(props, entities);
|
|
12617
|
+
}, [props, entities]);
|
|
12618
|
+
var handleClick = useCallback(function (e) {
|
|
12619
|
+
if (onMouseEvent) {
|
|
12620
|
+
onMouseEvent(e);
|
|
12621
|
+
} else {
|
|
12622
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
12623
|
+
}
|
|
12624
|
+
}, [onMouseEvent, onClick]);
|
|
12625
|
+
return jsx(motion.span, _extends({}, rest, {
|
|
12626
|
+
onClick: handleClick,
|
|
12612
12627
|
css: styles$Q.spanStyles(generatedDivStyles),
|
|
12613
|
-
className: "".concat(
|
|
12614
|
-
}),
|
|
12615
|
-
};
|
|
12628
|
+
className: "".concat(rest.className ? rest.className : '')
|
|
12629
|
+
}), rest.children);
|
|
12630
|
+
});
|
|
12616
12631
|
|
|
12617
12632
|
var styles$P = {
|
|
12618
12633
|
listContainer: function (orientation, alignment, listStyle, generatedStyles) {
|
|
@@ -12621,18 +12636,20 @@ var styles$P = {
|
|
|
12621
12636
|
};
|
|
12622
12637
|
var templateObject_1$T;
|
|
12623
12638
|
|
|
12624
|
-
var List = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12639
|
+
var List = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12625
12640
|
var _a = props.listStyle,
|
|
12626
12641
|
listStyle = _a === void 0 ? 'none' : _a,
|
|
12627
12642
|
rest = __rest(props, ["listStyle"]);
|
|
12628
12643
|
var entities = useEntities();
|
|
12629
|
-
var generatedStyles =
|
|
12644
|
+
var generatedStyles = useMemo(function () {
|
|
12645
|
+
return generateStyles(rest, entities);
|
|
12646
|
+
}, [rest, entities]);
|
|
12630
12647
|
return jsx(motion.ul, _extends({}, rest, {
|
|
12631
12648
|
css: styles$P.listContainer(rest.orientation, rest.alignment, listStyle, generatedStyles),
|
|
12632
12649
|
className: "\n ".concat(rest.className ? rest.className : ''),
|
|
12633
12650
|
ref: ref
|
|
12634
12651
|
}), rest.children);
|
|
12635
|
-
});
|
|
12652
|
+
}));
|
|
12636
12653
|
|
|
12637
12654
|
var computeAvatarProperties = function (size, sizeMap) {
|
|
12638
12655
|
return mapSizeType(size, sizeMap);
|
|
@@ -12879,20 +12896,26 @@ var styles$M = {
|
|
|
12879
12896
|
};
|
|
12880
12897
|
var templateObject_1$P;
|
|
12881
12898
|
|
|
12882
|
-
var ListItem = function (props) {
|
|
12899
|
+
var ListItem = /*#__PURE__*/React.memo(function (props) {
|
|
12900
|
+
var onMouseEvent = props.onMouseEvent,
|
|
12901
|
+
onClick = props.onClick,
|
|
12902
|
+
rest = __rest(props, ["onMouseEvent", "onClick"]);
|
|
12883
12903
|
var entities = useEntities();
|
|
12884
|
-
var generatedStyles =
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
}
|
|
12893
|
-
|
|
12894
|
-
}
|
|
12895
|
-
|
|
12904
|
+
var generatedStyles = useMemo(function () {
|
|
12905
|
+
return generateStyles(props, entities);
|
|
12906
|
+
}, [props, entities]);
|
|
12907
|
+
var handleClick = useCallback(function (e) {
|
|
12908
|
+
if (onMouseEvent) {
|
|
12909
|
+
onMouseEvent(e);
|
|
12910
|
+
} else {
|
|
12911
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
12912
|
+
}
|
|
12913
|
+
}, [onMouseEvent, onClick]);
|
|
12914
|
+
return jsx(motion.li, _extends({}, rest, {
|
|
12915
|
+
onClick: handleClick,
|
|
12916
|
+
css: styles$M.listItem(generatedStyles, rest.orientation, entities)
|
|
12917
|
+
}), rest.children);
|
|
12918
|
+
});
|
|
12896
12919
|
|
|
12897
12920
|
var Bar = function (_a) {
|
|
12898
12921
|
var height = _a.height,
|
|
@@ -12921,31 +12944,36 @@ var styles$L = {
|
|
|
12921
12944
|
};
|
|
12922
12945
|
var templateObject_1$O, templateObject_2$s;
|
|
12923
12946
|
|
|
12924
|
-
var Flex = function (props) {
|
|
12947
|
+
var Flex = /*#__PURE__*/React.memo(function (props) {
|
|
12925
12948
|
var entities = useEntities();
|
|
12926
12949
|
var _a = props.display,
|
|
12927
12950
|
display = _a === void 0 ? 'flex' : _a,
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
display
|
|
12931
|
-
|
|
12951
|
+
onMouseEvent = props.onMouseEvent,
|
|
12952
|
+
onClick = props.onClick,
|
|
12953
|
+
rest = __rest(props, ["display", "onMouseEvent", "onClick"]);
|
|
12954
|
+
var generatedDivStyles = useMemo(function () {
|
|
12955
|
+
return generateStyles(__assign({
|
|
12956
|
+
display: display
|
|
12957
|
+
}, rest), entities);
|
|
12958
|
+
}, [display, rest, entities]);
|
|
12932
12959
|
var ref = useRef(null);
|
|
12960
|
+
var handleClick = useCallback(function (e) {
|
|
12961
|
+
if (onMouseEvent) {
|
|
12962
|
+
onMouseEvent(e);
|
|
12963
|
+
} else {
|
|
12964
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
12965
|
+
}
|
|
12966
|
+
}, [onMouseEvent, onClick]);
|
|
12933
12967
|
useOutsideClick(ref, function () {
|
|
12934
|
-
|
|
12968
|
+
rest.outsideClick && rest.outsideClick();
|
|
12935
12969
|
});
|
|
12936
12970
|
return jsx(motion.main, _extends({}, rest, {
|
|
12937
12971
|
ref: ref,
|
|
12938
|
-
onClick:
|
|
12939
|
-
var _a;
|
|
12940
|
-
return (_a = props.onMouseEvent) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
12941
|
-
} : function () {
|
|
12942
|
-
var _a;
|
|
12943
|
-
return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
12944
|
-
},
|
|
12972
|
+
onClick: handleClick,
|
|
12945
12973
|
css: styles$L.flexStyles(generatedDivStyles),
|
|
12946
|
-
className: "".concat(
|
|
12947
|
-
}),
|
|
12948
|
-
};
|
|
12974
|
+
className: "".concat(rest.className ? rest.className : '')
|
|
12975
|
+
}), rest.children);
|
|
12976
|
+
});
|
|
12949
12977
|
|
|
12950
12978
|
var LoadingSpinner = function (_a) {
|
|
12951
12979
|
var size = _a.size,
|
|
@@ -13020,23 +13048,27 @@ var styles$K = {
|
|
|
13020
13048
|
};
|
|
13021
13049
|
var templateObject_1$M;
|
|
13022
13050
|
|
|
13023
|
-
var Section = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13051
|
+
var Section = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13052
|
+
var onClick = props.onClick,
|
|
13053
|
+
rest = __rest(props, ["onClick"]);
|
|
13024
13054
|
var entities = useEntities();
|
|
13025
|
-
var generatedDivStyles =
|
|
13055
|
+
var generatedDivStyles = useMemo(function () {
|
|
13056
|
+
return generateStyles(props, entities);
|
|
13057
|
+
}, [props, entities]);
|
|
13058
|
+
var handleClick = useCallback(function () {
|
|
13059
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
13060
|
+
}, [onClick]);
|
|
13026
13061
|
useOutsideClick(ref, function () {
|
|
13027
|
-
|
|
13028
|
-
},
|
|
13029
|
-
return jsx(motion.section, _extends({},
|
|
13062
|
+
rest.outsideClick && rest.outsideClick();
|
|
13063
|
+
}, rest.clickElementBypass);
|
|
13064
|
+
return jsx(motion.section, _extends({}, rest, {
|
|
13030
13065
|
ref: ref,
|
|
13031
|
-
animate: process.env.NODE_ENV === 'test' ? undefined :
|
|
13032
|
-
onClick:
|
|
13033
|
-
var _a;
|
|
13034
|
-
return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
13035
|
-
},
|
|
13066
|
+
animate: process.env.NODE_ENV === 'test' ? undefined : rest.animate,
|
|
13067
|
+
onClick: handleClick,
|
|
13036
13068
|
css: styles$K.sectionStyles(generatedDivStyles),
|
|
13037
|
-
className: "".concat(
|
|
13038
|
-
}),
|
|
13039
|
-
});
|
|
13069
|
+
className: "".concat(rest.className ? rest.className : '')
|
|
13070
|
+
}), rest.children);
|
|
13071
|
+
}));
|
|
13040
13072
|
|
|
13041
13073
|
var styles$J = {
|
|
13042
13074
|
asideStyles: function (generatedStyles) {
|
|
@@ -13045,28 +13077,34 @@ var styles$J = {
|
|
|
13045
13077
|
};
|
|
13046
13078
|
var templateObject_1$L;
|
|
13047
13079
|
|
|
13048
|
-
var Aside = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13080
|
+
var Aside = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13081
|
+
var onMouseEvent = props.onMouseEvent,
|
|
13082
|
+
onClick = props.onClick,
|
|
13083
|
+
rest = __rest(props, ["onMouseEvent", "onClick"]);
|
|
13049
13084
|
var entities = useEntities();
|
|
13050
|
-
var generatedDivStyles =
|
|
13085
|
+
var generatedDivStyles = useMemo(function () {
|
|
13086
|
+
return generateStyles(props, entities);
|
|
13087
|
+
}, [props, entities]);
|
|
13088
|
+
var handleClick = useCallback(function (e) {
|
|
13089
|
+
if (onMouseEvent) {
|
|
13090
|
+
onMouseEvent(e);
|
|
13091
|
+
} else {
|
|
13092
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
13093
|
+
}
|
|
13094
|
+
}, [onMouseEvent, onClick]);
|
|
13051
13095
|
useOutsideClick(ref, function () {
|
|
13052
|
-
|
|
13096
|
+
rest.outsideClick && rest.outsideClick();
|
|
13053
13097
|
});
|
|
13054
|
-
return jsx(motion.aside, _extends({},
|
|
13098
|
+
return jsx(motion.aside, _extends({}, rest, {
|
|
13055
13099
|
ref: ref,
|
|
13056
|
-
animate: process.env.NODE_ENV === 'test' ? undefined :
|
|
13057
|
-
onClick:
|
|
13058
|
-
var _a;
|
|
13059
|
-
return (_a = props.onMouseEvent) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
13060
|
-
} : function () {
|
|
13061
|
-
var _a;
|
|
13062
|
-
return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
13063
|
-
},
|
|
13100
|
+
animate: process.env.NODE_ENV === 'test' ? undefined : rest.animate,
|
|
13101
|
+
onClick: handleClick,
|
|
13064
13102
|
css: styles$J.asideStyles(generatedDivStyles),
|
|
13065
|
-
className: "".concat(
|
|
13066
|
-
}),
|
|
13067
|
-
});
|
|
13103
|
+
className: "".concat(rest.className ? rest.className : '')
|
|
13104
|
+
}), rest.children);
|
|
13105
|
+
}));
|
|
13068
13106
|
|
|
13069
|
-
var VStack = function (_a) {
|
|
13107
|
+
var VStack = /*#__PURE__*/React.memo(function (_a) {
|
|
13070
13108
|
var children = _a.children,
|
|
13071
13109
|
gap = _a.gap,
|
|
13072
13110
|
justifyContent = _a.justifyContent,
|
|
@@ -13090,9 +13128,9 @@ var VStack = function (_a) {
|
|
|
13090
13128
|
inset: inset,
|
|
13091
13129
|
outset: outset
|
|
13092
13130
|
}, children);
|
|
13093
|
-
};
|
|
13131
|
+
});
|
|
13094
13132
|
|
|
13095
|
-
var HStack = function (_a) {
|
|
13133
|
+
var HStack = /*#__PURE__*/React.memo(function (_a) {
|
|
13096
13134
|
var children = _a.children,
|
|
13097
13135
|
gap = _a.gap,
|
|
13098
13136
|
_b = _a.justify,
|
|
@@ -13105,7 +13143,9 @@ var HStack = function (_a) {
|
|
|
13105
13143
|
outset = _a.outset,
|
|
13106
13144
|
_e = _a.childWidth,
|
|
13107
13145
|
childWidth = _e === void 0 ? 'initial' : _e;
|
|
13108
|
-
var childrenArray =
|
|
13146
|
+
var childrenArray = useMemo(function () {
|
|
13147
|
+
return React.Children.toArray(children);
|
|
13148
|
+
}, [children]);
|
|
13109
13149
|
return jsx(Flex, {
|
|
13110
13150
|
width: "auto",
|
|
13111
13151
|
inset: inset,
|
|
@@ -13127,7 +13167,7 @@ var HStack = function (_a) {
|
|
|
13127
13167
|
}
|
|
13128
13168
|
return jsx(React.Fragment, null);
|
|
13129
13169
|
}));
|
|
13130
|
-
};
|
|
13170
|
+
});
|
|
13131
13171
|
|
|
13132
13172
|
var Card = function (props) {
|
|
13133
13173
|
var _a, _b;
|
|
@@ -13761,26 +13801,32 @@ var DragBox = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
13761
13801
|
});
|
|
13762
13802
|
});
|
|
13763
13803
|
|
|
13764
|
-
var FlexItem = function (props) {
|
|
13804
|
+
var FlexItem = /*#__PURE__*/React.memo(function (props) {
|
|
13805
|
+
var onMouseEvent = props.onMouseEvent,
|
|
13806
|
+
onClick = props.onClick,
|
|
13807
|
+
rest = __rest(props, ["onMouseEvent", "onClick"]);
|
|
13765
13808
|
var entities = useEntities();
|
|
13766
|
-
var generatedDivStyles =
|
|
13809
|
+
var generatedDivStyles = useMemo(function () {
|
|
13810
|
+
return generateStyles(props, entities);
|
|
13811
|
+
}, [props, entities]);
|
|
13767
13812
|
var ref = useRef(null);
|
|
13813
|
+
var handleClick = useCallback(function (e) {
|
|
13814
|
+
if (onMouseEvent) {
|
|
13815
|
+
onMouseEvent(e);
|
|
13816
|
+
} else {
|
|
13817
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
13818
|
+
}
|
|
13819
|
+
}, [onMouseEvent, onClick]);
|
|
13768
13820
|
useOutsideClick(ref, function () {
|
|
13769
|
-
|
|
13821
|
+
rest.outsideClick && rest.outsideClick();
|
|
13770
13822
|
});
|
|
13771
|
-
return jsx(motion.section, _extends({},
|
|
13823
|
+
return jsx(motion.section, _extends({}, rest, {
|
|
13772
13824
|
ref: ref,
|
|
13773
|
-
onClick:
|
|
13774
|
-
var _a;
|
|
13775
|
-
return (_a = props.onMouseEvent) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
13776
|
-
} : function () {
|
|
13777
|
-
var _a;
|
|
13778
|
-
return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
13779
|
-
},
|
|
13825
|
+
onClick: handleClick,
|
|
13780
13826
|
css: styles$L.flexItemStyles(generatedDivStyles),
|
|
13781
|
-
className: "".concat(
|
|
13782
|
-
}),
|
|
13783
|
-
};
|
|
13827
|
+
className: "".concat(rest.className ? rest.className : '')
|
|
13828
|
+
}), rest.children);
|
|
13829
|
+
});
|
|
13784
13830
|
|
|
13785
13831
|
var styles$B = {
|
|
13786
13832
|
sideNav: function (navigationEntity) {
|
|
@@ -16241,10 +16287,14 @@ var Tabs = function (_a) {
|
|
|
16241
16287
|
_d = _a.justify,
|
|
16242
16288
|
justify = _d === void 0 ? 'flex-start' : _d,
|
|
16243
16289
|
children = _a.children;
|
|
16244
|
-
var tabChildren =
|
|
16245
|
-
|
|
16246
|
-
|
|
16247
|
-
|
|
16290
|
+
var tabChildren = useMemo(function () {
|
|
16291
|
+
return React.Children.toArray(children);
|
|
16292
|
+
}, [children]);
|
|
16293
|
+
var tabKeys = useMemo(function () {
|
|
16294
|
+
return tabChildren.map(function (tabChild) {
|
|
16295
|
+
return tabChild.props.tabKey;
|
|
16296
|
+
});
|
|
16297
|
+
}, [tabChildren]);
|
|
16248
16298
|
var ref = useRef(null);
|
|
16249
16299
|
var hocs = useEntities().hocs;
|
|
16250
16300
|
var _e = useState(tabKeys.indexOf(defaultActiveKey) || 0),
|
|
@@ -16357,7 +16407,9 @@ var Stoplight = function (_a) {
|
|
|
16357
16407
|
_d = _a.isCollapsible,
|
|
16358
16408
|
isCollapsible = _d === void 0 ? false : _d,
|
|
16359
16409
|
children = _a.children;
|
|
16360
|
-
var stoplightChildren =
|
|
16410
|
+
var stoplightChildren = useMemo(function () {
|
|
16411
|
+
return React.Children.toArray(children);
|
|
16412
|
+
}, [children]);
|
|
16361
16413
|
var stoplightRef = useRef(null);
|
|
16362
16414
|
var colorOption = useEntities().colorOption;
|
|
16363
16415
|
var computeBorderRadiusFromSize = function (size) {
|
|
@@ -20616,8 +20668,12 @@ var AnimatedGrid = function (_a) {
|
|
|
20616
20668
|
_j = _a.maxWidth,
|
|
20617
20669
|
maxWidth = _j === void 0 ? 1000 : _j,
|
|
20618
20670
|
children = _a.children;
|
|
20619
|
-
var gridChildren =
|
|
20620
|
-
|
|
20671
|
+
var gridChildren = useMemo(function () {
|
|
20672
|
+
return React.Children.toArray(children);
|
|
20673
|
+
}, [children]);
|
|
20674
|
+
var numChildren = useMemo(function () {
|
|
20675
|
+
return gridChildren.length + (gridImages ? gridImages.length : 0);
|
|
20676
|
+
}, [gridChildren, gridImages]);
|
|
20621
20677
|
var rowHeight = rowSize + gap;
|
|
20622
20678
|
var colWidth = columnSize + gap;
|
|
20623
20679
|
var numCols = Math.floor(maxWidth / colWidth);
|
|
@@ -13,4 +13,4 @@ export declare type AnchorProps = {
|
|
|
13
13
|
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
14
14
|
shouldDownload?: boolean;
|
|
15
15
|
} & HOCBaseProps & HOCMotionProps;
|
|
16
|
-
export declare const Anchor: (props: AnchorProps) => React.JSX.Element
|
|
16
|
+
export declare const Anchor: React.MemoExoticComponent<(props: AnchorProps) => React.JSX.Element>;
|
|
@@ -6,7 +6,7 @@ export declare type AsideProps = {
|
|
|
6
6
|
outsideClick?: () => void;
|
|
7
7
|
clickElementBypass?: string;
|
|
8
8
|
} & HOCBaseProps & HOCMotionProps;
|
|
9
|
-
export declare const Aside: React.ForwardRefExoticComponent<{
|
|
9
|
+
export declare const Aside: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
outsideClick?: (() => void) | undefined;
|
|
12
12
|
clickElementBypass?: string | undefined;
|
|
@@ -14,4 +14,4 @@ export declare const Aside: React.ForwardRefExoticComponent<{
|
|
|
14
14
|
className?: string | undefined;
|
|
15
15
|
motionKey?: string | number | undefined;
|
|
16
16
|
id?: string | undefined;
|
|
17
|
-
} & import("framer-motion").MotionProps & React.RefAttributes<HTMLElement
|
|
17
|
+
} & import("framer-motion").MotionProps & React.RefAttributes<HTMLElement>>>;
|
|
@@ -7,7 +7,7 @@ export declare type DivProps = {
|
|
|
7
7
|
clickElementBypass?: string;
|
|
8
8
|
tabIndex?: number;
|
|
9
9
|
} & HOCBaseProps & HOCMotionProps;
|
|
10
|
-
export declare const Div: React.ForwardRefExoticComponent<{
|
|
10
|
+
export declare const Div: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
outsideClick?: (() => void) | undefined;
|
|
13
13
|
clickElementBypass?: string | undefined;
|
|
@@ -16,4 +16,4 @@ export declare const Div: React.ForwardRefExoticComponent<{
|
|
|
16
16
|
className?: string | undefined;
|
|
17
17
|
motionKey?: string | number | undefined;
|
|
18
18
|
id?: string | undefined;
|
|
19
|
-
} & import("framer-motion").MotionProps & React.RefAttributes<HTMLDivElement
|
|
19
|
+
} & import("framer-motion").MotionProps & React.RefAttributes<HTMLDivElement>>>;
|
|
@@ -5,4 +5,4 @@ export declare type FlexProps = {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
outsideClick?: () => void;
|
|
7
7
|
} & HOCBaseProps & HOCMotionProps;
|
|
8
|
-
export declare const Flex: (props: FlexProps) => React.JSX.Element
|
|
8
|
+
export declare const Flex: React.MemoExoticComponent<(props: FlexProps) => React.JSX.Element>;
|
|
@@ -5,4 +5,4 @@ export declare type FlexItemPropTypes = {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
outsideClick?: () => void;
|
|
7
7
|
} & HOCBaseProps & HOCMotionProps;
|
|
8
|
-
export declare const FlexItem: (props: FlexItemPropTypes) => React.JSX.Element
|
|
8
|
+
export declare const FlexItem: React.MemoExoticComponent<(props: FlexItemPropTypes) => React.JSX.Element>;
|
|
@@ -11,4 +11,4 @@ export declare type HStackProps = {
|
|
|
11
11
|
childWidth?: string;
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
};
|
|
14
|
-
export declare const HStack: ({ children, gap, justify, alignItems, shouldWrap, inset, outset, childWidth, }: HStackProps) => React.JSX.Element
|
|
14
|
+
export declare const HStack: React.MemoExoticComponent<({ children, gap, justify, alignItems, shouldWrap, inset, outset, childWidth, }: HStackProps) => React.JSX.Element>;
|
|
@@ -10,7 +10,7 @@ export declare type ListProps = {
|
|
|
10
10
|
export declare type ListOrientation = 'vertical' | 'horizontal';
|
|
11
11
|
export declare type AlignmentOptions = 'left' | 'center' | 'right';
|
|
12
12
|
export declare type ListStyleType = 'disc' | 'none' | 'circle';
|
|
13
|
-
export declare const List: React.ForwardRefExoticComponent<{
|
|
13
|
+
export declare const List: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
14
14
|
orientation: ListOrientation;
|
|
15
15
|
alignment: AlignmentOptions;
|
|
16
16
|
children?: React.ReactNode;
|
|
@@ -19,4 +19,4 @@ export declare const List: React.ForwardRefExoticComponent<{
|
|
|
19
19
|
className?: string | undefined;
|
|
20
20
|
motionKey?: string | number | undefined;
|
|
21
21
|
id?: string | undefined;
|
|
22
|
-
} & import("framer-motion").MotionProps & React.RefAttributes<HTMLUListElement
|
|
22
|
+
} & import("framer-motion").MotionProps & React.RefAttributes<HTMLUListElement>>>;
|
|
@@ -10,4 +10,4 @@ export declare type ListItemProps = {
|
|
|
10
10
|
initial?: string;
|
|
11
11
|
transition?: {};
|
|
12
12
|
} & HOCBaseProps & HOCMotionProps;
|
|
13
|
-
export declare const ListItem: (props: ListItemProps) => React.JSX.Element
|
|
13
|
+
export declare const ListItem: React.MemoExoticComponent<(props: ListItemProps) => React.JSX.Element>;
|
|
@@ -6,7 +6,7 @@ export declare type SectionProps = {
|
|
|
6
6
|
outsideClick?: () => void;
|
|
7
7
|
clickElementBypass?: string;
|
|
8
8
|
} & HOCBaseProps & HOCMotionProps;
|
|
9
|
-
export declare const Section: React.ForwardRefExoticComponent<{
|
|
9
|
+
export declare const Section: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
outsideClick?: (() => void) | undefined;
|
|
12
12
|
clickElementBypass?: string | undefined;
|
|
@@ -14,4 +14,4 @@ export declare const Section: React.ForwardRefExoticComponent<{
|
|
|
14
14
|
className?: string | undefined;
|
|
15
15
|
motionKey?: string | number | undefined;
|
|
16
16
|
id?: string | undefined;
|
|
17
|
-
} & import("framer-motion").MotionProps & React.RefAttributes<HTMLElement
|
|
17
|
+
} & import("framer-motion").MotionProps & React.RefAttributes<HTMLElement>>>;
|
|
@@ -4,4 +4,4 @@ import { HOCMotionProps } from "../../helpers/hoc-types/hocMotionTypes";
|
|
|
4
4
|
export declare type SpanProps = {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
} & HOCBaseProps & HOCMotionProps;
|
|
7
|
-
export declare const Span: (props: SpanProps) => React.JSX.Element
|
|
7
|
+
export declare const Span: React.MemoExoticComponent<(props: SpanProps) => React.JSX.Element>;
|
|
@@ -14,4 +14,4 @@ export declare type VStackProps = {
|
|
|
14
14
|
overflow?: Overflow;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
16
|
};
|
|
17
|
-
export declare const VStack: ({ children, gap, justifyContent, alignItems, alignContent, inset, outset, width, height, overflow, }: VStackProps) => React.JSX.Element
|
|
17
|
+
export declare const VStack: React.MemoExoticComponent<({ children, gap, justifyContent, alignItems, alignContent, inset, outset, width, height, overflow, }: VStackProps) => React.JSX.Element>;
|
package/package.json
CHANGED