@conveyorhq/arrow-ds 1.143.0 → 1.144.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/package.json +1 -1
- package/public/components/Accordion/Accordion.js +9 -6
- package/public/components/LoadingDots/LoadingDots.d.ts +6 -0
- package/public/components/LoadingDots/LoadingDots.js +43 -0
- package/public/components/LoadingDots/index.d.ts +1 -0
- package/public/components/LoadingDots/index.js +17 -0
- package/public/components/SelectNew/shared/SelectControl.js +2 -12
- package/public/css/styles.css +44 -44
- package/public/css/styles.min.css +1 -1
- package/public/css/styles.min.css.map +1 -1
- package/public/index.d.ts +1 -0
- package/public/index.js +1 -0
- package/src/components/Accordion/Accordion.tsx +11 -7
- package/src/components/LoadingDots/LoadingDots.stories.mdx +41 -0
- package/src/components/LoadingDots/LoadingDots.tsx +33 -0
- package/src/components/LoadingDots/index.css +31 -0
- package/src/components/LoadingDots/index.ts +1 -0
- package/src/components/SelectNew/index.css +0 -32
- package/src/components/SelectNew/shared/SelectControl.tsx +2 -25
- package/src/css/components.css +1 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -147,6 +147,7 @@ const AccordionIcon = ({ className, direction = "down", color, disabled = false,
|
|
|
147
147
|
};
|
|
148
148
|
exports.AccordionIcon = AccordionIcon;
|
|
149
149
|
const AccordionContent = ({ children, maxHeight, style, className, scrollClassName, ...rest }) => {
|
|
150
|
+
const { disableAnimation } = (0, context_1.useAccordionGroupContext)();
|
|
150
151
|
const { buttonId, contentId, defaultIsOpen, isOpen, } = (0, context_1.useAccordionItemContext)();
|
|
151
152
|
const [childrenRef, setChildrenRef] = react_1.default.useState({ current: null });
|
|
152
153
|
const onRefChange = react_1.default.useCallback((node) => {
|
|
@@ -155,18 +156,20 @@ const AccordionContent = ({ children, maxHeight, style, className, scrollClassNa
|
|
|
155
156
|
}
|
|
156
157
|
}, []);
|
|
157
158
|
const [enableTransition, setEnableTransition] = react_1.default.useState(!defaultIsOpen);
|
|
158
|
-
const { height
|
|
159
|
-
const
|
|
160
|
-
height: isOpen ?
|
|
161
|
-
|
|
159
|
+
const { height } = (0, component_size_1.default)(childrenRef);
|
|
160
|
+
const props = (0, web_1.useSpring)({
|
|
161
|
+
height: isOpen ? height : 0,
|
|
162
|
+
opacity: isOpen ? 1 : 0,
|
|
163
|
+
config: { mass: 2, tension: 400, friction: 50 },
|
|
162
164
|
onRest: () => {
|
|
163
165
|
if (defaultIsOpen && isOpen) {
|
|
164
166
|
setEnableTransition(true);
|
|
165
167
|
}
|
|
166
168
|
},
|
|
169
|
+
immediate: disableAnimation || !enableTransition,
|
|
167
170
|
});
|
|
168
|
-
return (react_1.default.createElement(web_1.animated.div, { className: (0, classnames_1.default)("overflow-hidden box-content", className), style: { ...style,
|
|
169
|
-
react_1.default.createElement(Box_1.Box, { ref: onRefChange, className: (0, classnames_1.default)(maxHeight && "overflow-y-auto"), style: maxHeight ? { maxHeight } : undefined }, children)));
|
|
171
|
+
return (react_1.default.createElement(web_1.animated.div, { className: (0, classnames_1.default)("overflow-hidden box-content", className), style: { ...style, ...props }, "aria-labelledby": buttonId, id: contentId, role: "region", ...rest },
|
|
172
|
+
react_1.default.createElement(Box_1.Box, { ref: onRefChange, className: (0, classnames_1.default)(maxHeight && "overflow-y-auto", scrollClassName), style: maxHeight ? { maxHeight } : undefined }, children)));
|
|
170
173
|
};
|
|
171
174
|
exports.AccordionContent = AccordionContent;
|
|
172
175
|
const Accordion = (props) => {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.LoadingDots = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
32
|
+
const utilities_1 = require("../../utilities");
|
|
33
|
+
const Box_1 = require("../Box");
|
|
34
|
+
const cn = (0, utilities_1.bemHOF)("LoadingDots");
|
|
35
|
+
const LoadingDot = ({ delay }) => (react_1.default.createElement(Box_1.Box, { as: "span", className: cn({ e: "dot" }), style: {
|
|
36
|
+
animation: `loadingDot 1s ease-in-out ${delay}ms infinite`,
|
|
37
|
+
} }));
|
|
38
|
+
exports.LoadingDots = (0, react_1.forwardRef)(({ className, style }, ref) => {
|
|
39
|
+
return (react_1.default.createElement(Box_1.Box, { ref: ref, className: (0, classnames_1.default)(cn(), className), style: style },
|
|
40
|
+
react_1.default.createElement(LoadingDot, { delay: 0 }),
|
|
41
|
+
react_1.default.createElement(LoadingDot, { delay: 160 }),
|
|
42
|
+
react_1.default.createElement(LoadingDot, { delay: 320 })));
|
|
43
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LoadingDots";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./LoadingDots"), exports);
|
|
@@ -30,22 +30,12 @@ exports.SelectControl = void 0;
|
|
|
30
30
|
const classnames_1 = __importDefault(require("classnames"));
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
32
|
const react_merge_refs_1 = __importDefault(require("react-merge-refs"));
|
|
33
|
-
const utilities_1 = require("../../../utilities");
|
|
34
33
|
const Box_1 = require("../../Box");
|
|
35
34
|
const Flex_1 = require("../../Flex");
|
|
36
35
|
const Icon_1 = require("../../Icon");
|
|
37
36
|
const Label_1 = require("../../Label");
|
|
38
37
|
const VisuallyHidden_1 = require("../../VisuallyHidden");
|
|
39
|
-
const
|
|
40
|
-
const LoadingDot = ({ delay }) => (react_1.default.createElement(Box_1.Box, { as: "span", className: cn({ e: "loading-dot" }), style: {
|
|
41
|
-
animation: `loadingDot 1s ease-in-out ${delay}ms infinite`,
|
|
42
|
-
} }));
|
|
43
|
-
const SelectLoadingIndicator = () => {
|
|
44
|
-
return (react_1.default.createElement(Box_1.Box, { className: cn({ e: "loading-indicator" }) },
|
|
45
|
-
react_1.default.createElement(LoadingDot, { delay: 0 }),
|
|
46
|
-
react_1.default.createElement(LoadingDot, { delay: 160 }),
|
|
47
|
-
react_1.default.createElement(LoadingDot, { delay: 320 })));
|
|
48
|
-
};
|
|
38
|
+
const LoadingDots_1 = require("../../LoadingDots");
|
|
49
39
|
function SelectControl({ setReferenceElement, label, hasContextLabel, getLabelProps, getToggleButtonProps, isDisabled, children, isClearable, isLoading, onClear, hasSelection, className, }) {
|
|
50
40
|
const isClearBtnVisible = isClearable && hasSelection && !isLoading;
|
|
51
41
|
const clearBtnRef = (0, react_1.useRef)(null);
|
|
@@ -87,7 +77,7 @@ function SelectControl({ setReferenceElement, label, hasContextLabel, getLabelPr
|
|
|
87
77
|
}
|
|
88
78
|
} },
|
|
89
79
|
react_1.default.createElement(Icon_1.Icon, { icon: Icon_1.ICON_TYPE.TIMES }))),
|
|
90
|
-
isLoading && react_1.default.createElement(
|
|
80
|
+
isLoading && react_1.default.createElement(LoadingDots_1.LoadingDots, null)),
|
|
91
81
|
react_1.default.createElement(Icon_1.Icon, { icon: Icon_1.ICON_TYPE.CARET_DOWN, className: "text-gray-600" })))));
|
|
92
82
|
}
|
|
93
83
|
exports.SelectControl = SelectControl;
|
package/public/css/styles.css
CHANGED
|
@@ -4377,6 +4377,50 @@ override built-in Image component classes */
|
|
|
4377
4377
|
animation: spin 1.8s infinite linear both;
|
|
4378
4378
|
}
|
|
4379
4379
|
|
|
4380
|
+
@-webkit-keyframes loadingDot {
|
|
4381
|
+
0%,
|
|
4382
|
+
80%,
|
|
4383
|
+
100% {
|
|
4384
|
+
opacity: 0;
|
|
4385
|
+
}
|
|
4386
|
+
40% {
|
|
4387
|
+
opacity: 1;
|
|
4388
|
+
}
|
|
4389
|
+
}
|
|
4390
|
+
|
|
4391
|
+
@keyframes loadingDot {
|
|
4392
|
+
0%,
|
|
4393
|
+
80%,
|
|
4394
|
+
100% {
|
|
4395
|
+
opacity: 0;
|
|
4396
|
+
}
|
|
4397
|
+
40% {
|
|
4398
|
+
opacity: 1;
|
|
4399
|
+
}
|
|
4400
|
+
}
|
|
4401
|
+
|
|
4402
|
+
.ads-LoadingDots {
|
|
4403
|
+
display: inline-flex;
|
|
4404
|
+
width: 24px;
|
|
4405
|
+
justify-content: space-between;
|
|
4406
|
+
align-self: center;
|
|
4407
|
+
padding: 4px;
|
|
4408
|
+
text-align: center;
|
|
4409
|
+
vertical-align: middle;
|
|
4410
|
+
|
|
4411
|
+
transition: color 150ms;
|
|
4412
|
+
}
|
|
4413
|
+
|
|
4414
|
+
.ads-LoadingDots-dot {
|
|
4415
|
+
display: inline-block;
|
|
4416
|
+
height: 4px;
|
|
4417
|
+
width: 4px;
|
|
4418
|
+
border-radius: 9999px;
|
|
4419
|
+
--tw-bg-opacity: 1;
|
|
4420
|
+
background-color: rgb(134 163 181 / var(--tw-bg-opacity));
|
|
4421
|
+
vertical-align: top;
|
|
4422
|
+
}
|
|
4423
|
+
|
|
4380
4424
|
.ads-Markdown {
|
|
4381
4425
|
display: flex;
|
|
4382
4426
|
width: 100%;
|
|
@@ -5989,50 +6033,6 @@ override built-in Image component classes */
|
|
|
5989
6033
|
color: rgb(62 158 245 / var(--tw-text-opacity));
|
|
5990
6034
|
}
|
|
5991
6035
|
|
|
5992
|
-
@-webkit-keyframes loadingDot {
|
|
5993
|
-
0%,
|
|
5994
|
-
80%,
|
|
5995
|
-
100% {
|
|
5996
|
-
opacity: 0;
|
|
5997
|
-
}
|
|
5998
|
-
40% {
|
|
5999
|
-
opacity: 1;
|
|
6000
|
-
}
|
|
6001
|
-
}
|
|
6002
|
-
|
|
6003
|
-
@keyframes loadingDot {
|
|
6004
|
-
0%,
|
|
6005
|
-
80%,
|
|
6006
|
-
100% {
|
|
6007
|
-
opacity: 0;
|
|
6008
|
-
}
|
|
6009
|
-
40% {
|
|
6010
|
-
opacity: 1;
|
|
6011
|
-
}
|
|
6012
|
-
}
|
|
6013
|
-
|
|
6014
|
-
.ads-SelectNew-loading-dot {
|
|
6015
|
-
display: inline-block;
|
|
6016
|
-
height: 4px;
|
|
6017
|
-
width: 4px;
|
|
6018
|
-
border-radius: 9999px;
|
|
6019
|
-
--tw-bg-opacity: 1;
|
|
6020
|
-
background-color: rgb(134 163 181 / var(--tw-bg-opacity));
|
|
6021
|
-
vertical-align: top;
|
|
6022
|
-
}
|
|
6023
|
-
|
|
6024
|
-
.ads-SelectNew-loading-indicator {
|
|
6025
|
-
display: inline-flex;
|
|
6026
|
-
width: 24px;
|
|
6027
|
-
justify-content: space-between;
|
|
6028
|
-
align-self: center;
|
|
6029
|
-
padding: 4px;
|
|
6030
|
-
text-align: center;
|
|
6031
|
-
vertical-align: middle;
|
|
6032
|
-
|
|
6033
|
-
transition: color 150ms;
|
|
6034
|
-
}
|
|
6035
|
-
|
|
6036
6036
|
.ads-SelectNew-button:focus {
|
|
6037
6037
|
--tw-shadow: rgba(7, 114, 239, 0.2) 0 0 1px 3px;
|
|
6038
6038
|
--tw-shadow-colored: 0 0 1px 3px var(--tw-shadow-color);
|