@cypress-design/react-accordion 0.4.4 → 1.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/.turbo/turbo-build.log +3 -1
- package/Accordion.tsx +3 -3
- package/AccordionReact.cy.tsx +3 -3
- package/CHANGELOG.md +22 -0
- package/dist/index.es.mjs +11 -100
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +20 -109
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/rollup.config.mjs +5 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
$ yarn build:module && yarn build:types
|
|
2
2
|
$ rollup -c ./rollup.config.mjs
|
|
3
|
+
(node:4038) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
|
|
4
|
+
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
3
5
|
[36m
|
|
4
6
|
[1m./index.ts[22m → [1m./dist/index.umd.js, ./dist/index.es.mjs[22m...[39m
|
|
5
|
-
[32mcreated [1m./dist/index.umd.js, ./dist/index.es.mjs[22m in [
|
|
7
|
+
[32mcreated [1m./dist/index.umd.js, ./dist/index.es.mjs[22m in [1m13.8s[22m[39m
|
|
6
8
|
$ tsc --project ./tsconfig.build.json
|
package/Accordion.tsx
CHANGED
|
@@ -43,7 +43,7 @@ export const Accordion: React.FC<
|
|
|
43
43
|
<summary
|
|
44
44
|
className={clsx(
|
|
45
45
|
CssClasses.summary,
|
|
46
|
-
headingClassName ?? CssClasses.summaryColor
|
|
46
|
+
headingClassName ?? CssClasses.summaryColor,
|
|
47
47
|
)}
|
|
48
48
|
>
|
|
49
49
|
<span className={CssClasses.summaryDiv}>
|
|
@@ -58,7 +58,7 @@ export const Accordion: React.FC<
|
|
|
58
58
|
<span
|
|
59
59
|
className={clsx(
|
|
60
60
|
titleClassName ?? CssClasses.summaryTitleColor,
|
|
61
|
-
CssClasses.summaryTitle
|
|
61
|
+
CssClasses.summaryTitle,
|
|
62
62
|
)}
|
|
63
63
|
>
|
|
64
64
|
{title}
|
|
@@ -67,7 +67,7 @@ export const Accordion: React.FC<
|
|
|
67
67
|
<span
|
|
68
68
|
className={clsx(
|
|
69
69
|
CssClasses.summaryDescription,
|
|
70
|
-
descriptionClassName ?? CssClasses.summaryDescriptionColor
|
|
70
|
+
descriptionClassName ?? CssClasses.summaryDescriptionColor,
|
|
71
71
|
)}
|
|
72
72
|
>
|
|
73
73
|
{description}
|
package/AccordionReact.cy.tsx
CHANGED
|
@@ -16,7 +16,7 @@ describe('Accordion', () => {
|
|
|
16
16
|
|
|
17
17
|
it('can be passed an icon as a prop', () => {
|
|
18
18
|
mount(
|
|
19
|
-
<Accordion title="hi" icon={IconActionQuestionMarkCircle}></Accordion
|
|
19
|
+
<Accordion title="hi" icon={IconActionQuestionMarkCircle}></Accordion>,
|
|
20
20
|
).get('summary svg')
|
|
21
21
|
})
|
|
22
22
|
|
|
@@ -31,7 +31,7 @@ describe('Accordion', () => {
|
|
|
31
31
|
fillColor="red-50"
|
|
32
32
|
/>
|
|
33
33
|
}
|
|
34
|
-
></Accordion
|
|
34
|
+
></Accordion>,
|
|
35
35
|
).get('[data-cy=icon-element]')
|
|
36
36
|
})
|
|
37
37
|
|
|
@@ -47,7 +47,7 @@ describe('Accordion', () => {
|
|
|
47
47
|
fillColor="red-50"
|
|
48
48
|
/>
|
|
49
49
|
}
|
|
50
|
-
></Accordion
|
|
50
|
+
></Accordion>,
|
|
51
51
|
).get('[data-cy=icon-element]')
|
|
52
52
|
|
|
53
53
|
cy.get('summary').find('svg').should('have.length', 2)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @cypress-design/react-accordion
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#450](https://github.com/cypress-io/cypress-design/pull/450) [`927097f`](https://github.com/cypress-io/cypress-design/commit/927097f409235ac78c98b281c4d9b2ec70dfe01d) Thanks [@elevatebart](https://github.com/elevatebart)! - optim: do not package dependencies
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`927097f`](https://github.com/cypress-io/cypress-design/commit/927097f409235ac78c98b281c4d9b2ec70dfe01d), [`927097f`](https://github.com/cypress-io/cypress-design/commit/927097f409235ac78c98b281c4d9b2ec70dfe01d)]:
|
|
10
|
+
- @cypress-design/react-icon@1.1.0
|
|
11
|
+
|
|
12
|
+
## 1.0.0
|
|
13
|
+
|
|
14
|
+
### Major Changes
|
|
15
|
+
|
|
16
|
+
- [`63fb4d9`](https://github.com/cypress-io/cypress-design/commit/63fb4d9e60f6c56c563d17e3b983d0ebd25e0e87) Thanks [@elevatebart](https://github.com/elevatebart)! - Create 1.0
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`63fb4d9`](https://github.com/cypress-io/cypress-design/commit/63fb4d9e60f6c56c563d17e3b983d0ebd25e0e87)]:
|
|
21
|
+
- @cypress-design/constants-accordion@1.0.0
|
|
22
|
+
- @cypress-design/react-icon@1.0.0
|
|
23
|
+
- @cypress-design/details-animation@1.0.0
|
|
24
|
+
|
|
3
25
|
## 0.4.4
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/index.es.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import { CssClasses } from '@cypress-design/constants-accordion';
|
|
3
4
|
import { DetailsAnimation } from '@cypress-design/details-animation';
|
|
4
|
-
import
|
|
5
|
-
import { ICON_COLOR_PROP_NAMES } from '@cypress-design/icon-registry';
|
|
5
|
+
import { IconChevronDownSmall } from '@cypress-design/react-icon';
|
|
6
6
|
|
|
7
7
|
/******************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -18,62 +18,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
18
18
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
19
|
PERFORMANCE OF THIS SOFTWARE.
|
|
20
20
|
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var __assign$1 = function() {
|
|
25
|
-
__assign$1 = Object.assign || function __assign(t) {
|
|
26
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
27
|
-
s = arguments[i];
|
|
28
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
};
|
|
32
|
-
return __assign$1.apply(this, arguments);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
function __rest$1(s, e) {
|
|
36
|
-
var t = {};
|
|
37
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
-
t[p] = s[p];
|
|
39
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
-
t[p[i]] = s[p[i]];
|
|
43
|
-
}
|
|
44
|
-
return t;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const CssClasses = {
|
|
48
|
-
summary: 'details-none card open:rounded-b-none',
|
|
49
|
-
summaryDiv: 'flex flex-row py-[12px] px-[24px] flex-nowrap items-center min-h-[63px]',
|
|
50
|
-
summaryColor: 'bg-white',
|
|
51
|
-
summaryTitle: 'text-[18px] leading-[28px] font-medium',
|
|
52
|
-
summaryTitleColor: 'text-indigo-500 block',
|
|
53
|
-
summaryDescription: 'text-[14px] leading-[20px] font-normal block',
|
|
54
|
-
summaryDescriptionColor: 'text-gray-700',
|
|
55
|
-
icon: 'mr-[24px] flex-shrink-0',
|
|
56
|
-
separator: 'w-[1px] h-[40px] bg-gray-100 mr-[16px]',
|
|
57
|
-
chevron: 'flex-shrink-0 transition transform rotate-0 open:rotate-180',
|
|
58
|
-
contentWrapper: 'border border-gray-100 rounded-b-md border-t-0',
|
|
59
|
-
content: 'px-[24px] py-[16px]',
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/******************************************************************************
|
|
63
|
-
Copyright (c) Microsoft Corporation.
|
|
64
|
-
|
|
65
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
66
|
-
purpose with or without fee is hereby granted.
|
|
67
|
-
|
|
68
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
69
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
70
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
71
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
72
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
73
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
74
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
75
|
-
***************************************************************************** */
|
|
76
|
-
/* global Reflect, Promise */
|
|
21
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
77
22
|
|
|
78
23
|
|
|
79
24
|
var __assign = function() {
|
|
@@ -97,49 +42,15 @@ function __rest(s, e) {
|
|
|
97
42
|
t[p[i]] = s[p[i]];
|
|
98
43
|
}
|
|
99
44
|
return t;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
if (!ICON_COLOR_PROP_NAMES.includes(attrName) &&
|
|
106
|
-
attrName !== 'name') {
|
|
107
|
-
// @ts-expect-error the ky of React's SVGProps is too broad and
|
|
108
|
-
// breaks here. Since we do not need to check for it. We keep the expect error
|
|
109
|
-
newAttributes[attrName] =
|
|
110
|
-
attributes[attrName];
|
|
111
|
-
}
|
|
112
|
-
return newAttributes;
|
|
113
|
-
}, {});
|
|
114
|
-
var componentProps = __assign({ width: size, height: size, viewBox: "0 0 ".concat(size, " ").concat(size), fill: 'none', dangerouslySetInnerHTML: {
|
|
115
|
-
__html: body,
|
|
116
|
-
}, className: undefined }, filteredAttributes);
|
|
117
|
-
if (attributes.className) {
|
|
118
|
-
compiledClasses.push(attributes.className);
|
|
119
|
-
}
|
|
120
|
-
if (compiledClasses.length) {
|
|
121
|
-
componentProps.className = compiledClasses.join(' ');
|
|
122
|
-
}
|
|
123
|
-
return componentProps;
|
|
124
|
-
};
|
|
125
|
-
var IconChevronDownSmall = function (props) {
|
|
126
|
-
var _a = iconsRegistry.getComponentAttributes(__assign(__assign({}, props), { availableSizes: ["8", "16"] })), size = _a.sizeWithDefault, compiledClasses = _a.compiledClasses;
|
|
127
|
-
var iconBodies = {
|
|
128
|
-
"8": "<path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m1 2.5 3 3 3-3\" class=\"icon-dark\"/>",
|
|
129
|
-
"16": "<path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m4 6 4 4 4-4\" class=\"icon-dark\"/>"
|
|
130
|
-
};
|
|
131
|
-
var body = iconBodies[size];
|
|
132
|
-
if (!body) {
|
|
133
|
-
throw Error("Icon \"chevron-down-small\" is not available in size ".concat(size));
|
|
134
|
-
}
|
|
135
|
-
return React.createElement('svg', compileReactIconProperties(__assign(__assign({}, props), { size: size, body: body, compiledClasses: compiledClasses })));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
48
|
+
var e = new Error(message);
|
|
49
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
136
50
|
};
|
|
137
51
|
|
|
138
|
-
|
|
139
|
-
/* <wind-keep class="filter"> */
|
|
140
|
-
|
|
141
52
|
var Accordion = function (_a) {
|
|
142
|
-
var title = _a.title, description = _a.description, Icon = _a.icon, iconEl = _a.iconEl, _b = _a.separator, separator = _b === void 0 ? false : _b, children = _a.children, headingClassName = _a.headingClassName, titleClassName = _a.titleClassName, descriptionClassName = _a.descriptionClassName, fullWidthContent = _a.fullWidthContent, rest = __rest
|
|
53
|
+
var title = _a.title, description = _a.description, Icon = _a.icon, iconEl = _a.iconEl, _b = _a.separator, separator = _b === void 0 ? false : _b, children = _a.children, headingClassName = _a.headingClassName, titleClassName = _a.titleClassName, descriptionClassName = _a.descriptionClassName, fullWidthContent = _a.fullWidthContent, rest = __rest(_a, ["title", "description", "icon", "iconEl", "separator", "children", "headingClassName", "titleClassName", "descriptionClassName", "fullWidthContent"]);
|
|
143
54
|
var details = React.useRef(null);
|
|
144
55
|
var content = React.useRef(null);
|
|
145
56
|
React.useEffect(function () {
|
|
@@ -147,7 +58,7 @@ var Accordion = function (_a) {
|
|
|
147
58
|
new DetailsAnimation(details.current, content.current);
|
|
148
59
|
}
|
|
149
60
|
}, []);
|
|
150
|
-
return (React.createElement("details", __assign
|
|
61
|
+
return (React.createElement("details", __assign({}, rest, { className: clsx(rest.className), ref: details }),
|
|
151
62
|
React.createElement("summary", { className: clsx(CssClasses.summary, headingClassName !== null && headingClassName !== void 0 ? headingClassName : CssClasses.summaryColor) },
|
|
152
63
|
React.createElement("span", { className: CssClasses.summaryDiv },
|
|
153
64
|
Boolean(iconEl) && React.createElement("span", { className: CssClasses.icon }, iconEl),
|
|
@@ -163,4 +74,4 @@ var Accordion = function (_a) {
|
|
|
163
74
|
export { Accordion as default };
|
|
164
75
|
//# sourceMappingURL=index.es.mjs.map
|
|
165
76
|
|
|
166
|
-
/* <wind-keep class="flex-grow grow pr-[16px] open:
|
|
77
|
+
/* <wind-keep class="flex-grow grow pr-[16px] open:icon-dark-gray-500"> */
|