@cypress-design/react-accordion 0.2.1 → 0.4.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/.turbo/turbo-build.log +6 -0
- package/Accordion.tsx +2 -2
- package/AccordionReact.cy.tsx +1 -1
- package/CHANGELOG.md +23 -0
- package/ReadMe.md +17 -17
- package/dist/{react/Accordion.d.ts → Accordion.d.ts} +1 -1
- package/dist/Accordion.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.mjs +10 -9
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +19 -22
- package/dist/index.umd.js.map +1 -1
- package/package.json +30 -25
- package/tsconfig.build.json +2 -2
- package/tsconfig.json +3 -0
- package/Accordion.stories.mdx +0 -142
- package/dist/constants.d.ts +0 -53
- package/dist/constants.d.ts.map +0 -1
- package/dist/react/Accordion.d.ts.map +0 -1
- package/dist/react/index.d.ts.map +0 -1
- /package/dist/{react/index.d.ts → index.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
"name": "@cypress-design/react-accordion",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"files": [
|
|
5
|
+
"*"
|
|
6
|
+
],
|
|
7
|
+
"typings": "./dist/index.d.ts",
|
|
8
|
+
"module": "./dist/index.es.mjs",
|
|
9
|
+
"main": "./dist/index.umd.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.es.mjs",
|
|
13
|
+
"require": "./dist/index.umd.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "yarn build:module && yarn build:types",
|
|
19
|
+
"build:module": "rollup -c ./rollup.config.mjs",
|
|
20
|
+
"build:types": "tsc --project ./tsconfig.build.json"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"clsx": "*",
|
|
24
|
+
"@cypress-design/details-animation": "*",
|
|
25
|
+
"@cypress-design/react-icon": "*"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@cypress-design/constants-accordion": "*",
|
|
29
|
+
"@cypress-design/css": "*"
|
|
30
|
+
},
|
|
31
|
+
"license": "MIT"
|
|
27
32
|
}
|
package/tsconfig.build.json
CHANGED
package/tsconfig.json
CHANGED
package/Accordion.stories.mdx
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { ArgsTable, Canvas, Meta, Story, Description } from '@storybook/addon-docs'
|
|
2
|
-
import { version } from "./package.json"
|
|
3
|
-
import changelog from "./CHANGELOG.md"
|
|
4
|
-
import readMe from "./ReadMe.md"
|
|
5
|
-
import AccordionStory from './Accordion.rootstory'
|
|
6
|
-
import { FIGMA_URL } from '../constants'
|
|
7
|
-
|
|
8
|
-
import { Accordion } from './Accordion'
|
|
9
|
-
import { IconActionQuestionMarkCircle } from '@cypress-design/react-icon'
|
|
10
|
-
|
|
11
|
-
<h1>Accordion<span className="text-lg font-normal"> - v{version}</span></h1>
|
|
12
|
-
|
|
13
|
-
<Meta title="Accordion" component={Accordion} parameters={{
|
|
14
|
-
design: {
|
|
15
|
-
type: "figma",
|
|
16
|
-
url: FIGMA_URL,
|
|
17
|
-
}
|
|
18
|
-
}} />
|
|
19
|
-
|
|
20
|
-
### Usage
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import Accordion from '@cypress-design/react-accordion'
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
<Canvas withSource="none">
|
|
27
|
-
<Story name="Accordion">
|
|
28
|
-
<AccordionStory />
|
|
29
|
-
</Story>
|
|
30
|
-
</Canvas>
|
|
31
|
-
|
|
32
|
-
```tsx
|
|
33
|
-
<Accordion
|
|
34
|
-
icon={IconActionQuestionMarkCircle}
|
|
35
|
-
title="Accordion Title"
|
|
36
|
-
description="Vestibulum id ligula porta felis euismod semper. Nulla... "
|
|
37
|
-
separator
|
|
38
|
-
>
|
|
39
|
-
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Odio dolore omnis nemo minus, sapiente magni ...
|
|
40
|
-
</Accordion>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Minimal
|
|
44
|
-
|
|
45
|
-
<Canvas withSource="none">
|
|
46
|
-
<Story name="Minimal">
|
|
47
|
-
<AccordionStory description={null} icon={null} />
|
|
48
|
-
</Story>
|
|
49
|
-
</Canvas>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```tsx
|
|
53
|
-
<Accordion title="Accordion Title">
|
|
54
|
-
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Odio dolore omnis nemo minus, sapiente magni ...
|
|
55
|
-
</Accordion>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Without separator
|
|
59
|
-
|
|
60
|
-
<Canvas withSource="none">
|
|
61
|
-
<Story name="No Separator">
|
|
62
|
-
<AccordionStory separator={false} />
|
|
63
|
-
</Story>
|
|
64
|
-
</Canvas>
|
|
65
|
-
|
|
66
|
-
```tsx
|
|
67
|
-
<Accordion
|
|
68
|
-
icon={IconActionQuestionMarkCircle}
|
|
69
|
-
title="Accordion Title"
|
|
70
|
-
description="Vestibulum id ligula porta felis euismod semper. Nulla... "
|
|
71
|
-
>
|
|
72
|
-
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Odio dolore omnis nemo minus, sapiente magni ...
|
|
73
|
-
</Accordion>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Without description
|
|
77
|
-
|
|
78
|
-
<Canvas withSource="none">
|
|
79
|
-
<Story name="No Description">
|
|
80
|
-
<AccordionStory description={null} />
|
|
81
|
-
</Story>
|
|
82
|
-
</Canvas>
|
|
83
|
-
|
|
84
|
-
```tsx
|
|
85
|
-
<Accordion
|
|
86
|
-
icon={IconActionQuestionMarkCircle}
|
|
87
|
-
title="Accordion Title"
|
|
88
|
-
separator
|
|
89
|
-
>
|
|
90
|
-
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Odio dolore omnis nemo minus, sapiente magni ...
|
|
91
|
-
</Accordion>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Open by default
|
|
95
|
-
|
|
96
|
-
<Canvas withSource="none">
|
|
97
|
-
<Story name="Open">
|
|
98
|
-
<AccordionStory open />
|
|
99
|
-
</Story>
|
|
100
|
-
</Canvas>
|
|
101
|
-
|
|
102
|
-
```tsx
|
|
103
|
-
<Accordion
|
|
104
|
-
icon={IconActionQuestionMarkCircle}
|
|
105
|
-
title="Accordion Title"
|
|
106
|
-
description="Vestibulum id ligula porta felis euismod semper. Nulla... "
|
|
107
|
-
separator
|
|
108
|
-
open
|
|
109
|
-
>
|
|
110
|
-
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Odio dolore omnis nemo minus, sapiente magni ...
|
|
111
|
-
</Accordion>
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Icon as element
|
|
115
|
-
|
|
116
|
-
If you need classes or props for your icon, you can pass it in as an element with props.
|
|
117
|
-
|
|
118
|
-
<Canvas withSource="none">
|
|
119
|
-
<Story name="Icon as element">
|
|
120
|
-
<AccordionStory iconEl={<IconActionQuestionMarkCircle strokeColor="red-600" fillColor="red-50" />} />
|
|
121
|
-
</Story>
|
|
122
|
-
</Canvas>
|
|
123
|
-
|
|
124
|
-
```tsx
|
|
125
|
-
<Accordion
|
|
126
|
-
iconEl={
|
|
127
|
-
<IconActionQuestionMarkCircle strokeColor="red-600" fillColor="red-50" />
|
|
128
|
-
}
|
|
129
|
-
title="Accordion Title"
|
|
130
|
-
description="Vestibulum id ligula porta felis euismod semper. Nulla... "
|
|
131
|
-
separator
|
|
132
|
-
open
|
|
133
|
-
>
|
|
134
|
-
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Odio dolore omnis nemo minus, sapiente magni ...
|
|
135
|
-
</Accordion>
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
<ArgsTable />
|
|
139
|
-
|
|
140
|
-
<Description>
|
|
141
|
-
{changelog.replace(/^# .+/, '## Changelog')}
|
|
142
|
-
</Description>
|
package/dist/constants.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export declare const CssClasses: {
|
|
2
|
-
summary: string;
|
|
3
|
-
summaryDiv: string;
|
|
4
|
-
summaryColor: string;
|
|
5
|
-
summaryTitle: string;
|
|
6
|
-
summaryTitleColor: string;
|
|
7
|
-
summaryDescription: string;
|
|
8
|
-
summaryDescriptionColor: string;
|
|
9
|
-
icon: string;
|
|
10
|
-
separator: string;
|
|
11
|
-
chevron: string;
|
|
12
|
-
contentWrapper: string;
|
|
13
|
-
content: string;
|
|
14
|
-
};
|
|
15
|
-
export interface AccordionProps {
|
|
16
|
-
/**
|
|
17
|
-
* Main indigo title.
|
|
18
|
-
* > [NOTE] Its color and font can be customized using `titleClassName`.
|
|
19
|
-
*/
|
|
20
|
-
title: string;
|
|
21
|
-
/**
|
|
22
|
-
* Second line in the heading.
|
|
23
|
-
*/
|
|
24
|
-
description?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Icon to be displayed on the left of the the heading.
|
|
27
|
-
*/
|
|
28
|
-
icon?: any;
|
|
29
|
-
/**
|
|
30
|
-
* Should we add a vertical separator between the icon and the text.
|
|
31
|
-
*/
|
|
32
|
-
separator?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Change the font and color of the heading title
|
|
35
|
-
*/
|
|
36
|
-
titleClassName?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Change the font and color of the heading description
|
|
39
|
-
*/
|
|
40
|
-
descriptionClassName?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Additional classes to add to the header of the accordion
|
|
43
|
-
* > [NOTE] useful to change the background color of the header
|
|
44
|
-
*/
|
|
45
|
-
headingClassName?: string;
|
|
46
|
-
/**
|
|
47
|
-
* When using content that needs ti be edge to edge,
|
|
48
|
-
* removes the content wrapper from the content.
|
|
49
|
-
*/
|
|
50
|
-
fullWidthContent?: boolean;
|
|
51
|
-
}
|
|
52
|
-
export declare const FIGMA_URL = "https://www.figma.com/file/1WJ3GVQyMV5e7xVxPg3yID/Design-System?node-id=2232%3A3477";
|
|
53
|
-
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;CActB,CAAA;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAA;IACV;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,SAAS,wFACiE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAIlD,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAA;IAC9C;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAC9B,mBAAmB,GAAG,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAwE1D,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA"}
|
|
File without changes
|