@sproutsocial/seeds-react-accordion 0.4.32 → 0.4.46
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/accordion.css +159 -0
- package/dist/esm/index.js +236 -78
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +21 -10
- package/dist/index.d.ts +21 -10
- package/dist/index.js +235 -79
- package/dist/index.js.map +1 -1
- package/package.json +21 -10
- package/.eslintignore +0 -6
- package/.eslintrc.js +0 -4
- package/.turbo/turbo-build.log +0 -21
- package/CHANGELOG.md +0 -527
- package/jest.config.js +0 -9
- package/src/Accordion.stories.tsx +0 -844
- package/src/Accordion.tsx +0 -83
- package/src/AccordionContent.tsx +0 -23
- package/src/AccordionItem.tsx +0 -11
- package/src/AccordionTrigger.tsx +0 -161
- package/src/AccordionTypes.ts +0 -80
- package/src/__tests__/accordion.test.tsx +0 -536
- package/src/index.ts +0 -7
- package/src/styled.d.ts +0 -7
- package/src/styles.ts +0 -164
- package/tsconfig.json +0 -9
- package/tsup.config.ts +0 -12
package/src/styles.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import styled, { css } from "styled-components";
|
|
2
|
-
import * as RadixAccordion from "@radix-ui/react-accordion";
|
|
3
|
-
import {
|
|
4
|
-
BORDER,
|
|
5
|
-
COMMON,
|
|
6
|
-
FLEXBOX,
|
|
7
|
-
LAYOUT,
|
|
8
|
-
TYPOGRAPHY,
|
|
9
|
-
} from "@sproutsocial/seeds-react-system-props";
|
|
10
|
-
import { type TypeAccordionSystemProps } from "./AccordionTypes";
|
|
11
|
-
|
|
12
|
-
interface StyledAccordionProps extends TypeAccordionSystemProps {
|
|
13
|
-
$styled?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const StyledAccordionItem = styled(RadixAccordion.Item)``;
|
|
17
|
-
|
|
18
|
-
const animations = css`
|
|
19
|
-
@keyframes slideDown {
|
|
20
|
-
from {
|
|
21
|
-
height: 0;
|
|
22
|
-
}
|
|
23
|
-
to {
|
|
24
|
-
height: var(--radix-accordion-content-height);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@keyframes slideUp {
|
|
29
|
-
from {
|
|
30
|
-
height: var(--radix-accordion-content-height);
|
|
31
|
-
}
|
|
32
|
-
to {
|
|
33
|
-
height: 0;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
|
|
38
|
-
export const StyledRadixAccordionContent = styled(
|
|
39
|
-
RadixAccordion.Content
|
|
40
|
-
)<StyledAccordionProps>`
|
|
41
|
-
${animations}
|
|
42
|
-
|
|
43
|
-
overflow: hidden;
|
|
44
|
-
|
|
45
|
-
&[data-state="open"] {
|
|
46
|
-
animation: slideDown 300ms ease-in-out;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&[data-state="closed"] {
|
|
50
|
-
animation: slideUp 300ms ease-in-out;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&[data-styled="true"] {
|
|
54
|
-
border-left: ${({ theme }) =>
|
|
55
|
-
`${theme.borderWidths[500]} solid ${theme.colors.container.border.base}`};
|
|
56
|
-
border-right: ${({ theme }) =>
|
|
57
|
-
`${theme.borderWidths[500]} solid ${theme.colors.container.border.base}`};
|
|
58
|
-
background: ${({ theme }) => theme.colors.container.background.base};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.accordion-item:last-child[data-state="open"] &[data-styled="true"],
|
|
62
|
-
.accordion-item:last-child[data-state="closed"] &[data-styled="true"] {
|
|
63
|
-
border-bottom: ${({ theme }) =>
|
|
64
|
-
`${theme.borderWidths[500]} solid ${theme.colors.container.border.base}`};
|
|
65
|
-
border-bottom-left-radius: ${({ theme }) => theme.radii.outer};
|
|
66
|
-
border-bottom-right-radius: ${({ theme }) => theme.radii.outer};
|
|
67
|
-
}
|
|
68
|
-
`;
|
|
69
|
-
|
|
70
|
-
export const ContentContainer = styled.div<StyledAccordionProps>`
|
|
71
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
72
|
-
background: transparent;
|
|
73
|
-
font-family: ${({ theme }) => theme.fontFamily};
|
|
74
|
-
|
|
75
|
-
&[data-styled="true"] {
|
|
76
|
-
padding: ${({ theme }) => theme.space[400]};
|
|
77
|
-
${({ theme }) => theme.typography[200]};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.accordion-item:last-child[data-state="open"] &[data-styled="true"],
|
|
81
|
-
.accordion-item:last-child[data-state="closed"] &[data-styled="true"] {
|
|
82
|
-
border-bottom-left-radius: ${({ theme }) => theme.radii.outer};
|
|
83
|
-
border-bottom-right-radius: ${({ theme }) => theme.radii.outer};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
${COMMON}
|
|
87
|
-
${TYPOGRAPHY}
|
|
88
|
-
${BORDER}
|
|
89
|
-
${LAYOUT}
|
|
90
|
-
${FLEXBOX}
|
|
91
|
-
`;
|
|
92
|
-
|
|
93
|
-
export const TriggerContainer = styled.div<StyledAccordionProps>`
|
|
94
|
-
display: flex;
|
|
95
|
-
align-items: center;
|
|
96
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
97
|
-
${({ theme }) => theme.typography[200]};
|
|
98
|
-
|
|
99
|
-
/* Override Text.Headline styles to match original accordion trigger typography */
|
|
100
|
-
h1,
|
|
101
|
-
h2,
|
|
102
|
-
h3,
|
|
103
|
-
h4,
|
|
104
|
-
h5,
|
|
105
|
-
h6 {
|
|
106
|
-
font-size: inherit;
|
|
107
|
-
font-weight: normal;
|
|
108
|
-
line-height: inherit;
|
|
109
|
-
color: inherit;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&[data-styled="true"] {
|
|
113
|
-
h1,
|
|
114
|
-
h2,
|
|
115
|
-
h3,
|
|
116
|
-
h4,
|
|
117
|
-
h5,
|
|
118
|
-
h6 {
|
|
119
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
120
|
-
color: ${({ theme }) => theme.colors.text.headline};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
${({ $styled, theme }) =>
|
|
125
|
-
$styled &&
|
|
126
|
-
`
|
|
127
|
-
border-top: ${theme.borderWidths[500]} solid ${theme.colors.container.border.base};
|
|
128
|
-
border-left: ${theme.borderWidths[500]} solid ${theme.colors.container.border.base};
|
|
129
|
-
border-right: ${theme.borderWidths[500]} solid ${theme.colors.container.border.base};
|
|
130
|
-
background: ${theme.colors.container.background.base};
|
|
131
|
-
`}
|
|
132
|
-
|
|
133
|
-
.accordion-item[data-state="open"] &[data-styled="true"] {
|
|
134
|
-
border-bottom: ${({ theme }) =>
|
|
135
|
-
`${theme.borderWidths[500]} solid ${theme.colors.container.border.base}`};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.accordion-item[data-state="closed"] &[data-styled="true"] {
|
|
139
|
-
transition: border-bottom-color 0s ease-in-out 0.3s;
|
|
140
|
-
border-bottom: ${({ theme }) =>
|
|
141
|
-
`${theme.borderWidths[500]} solid transparent`};
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.accordion-item:first-child &[data-styled="true"] {
|
|
145
|
-
border-top-left-radius: ${({ theme }) => theme.radii.outer};
|
|
146
|
-
border-top-right-radius: ${({ theme }) => theme.radii.outer};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.accordion-item:last-child &[data-styled="true"] {
|
|
150
|
-
border-bottom: ${({ theme }) =>
|
|
151
|
-
`${theme.borderWidths[500]} solid ${theme.colors.container.border.base}`};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.accordion-item:last-child[data-state="closed"] &[data-styled="true"] {
|
|
155
|
-
transition: border-radius 0s linear 0.3s;
|
|
156
|
-
border-bottom-left-radius: ${({ theme }) => theme.radii.outer};
|
|
157
|
-
border-bottom-right-radius: ${({ theme }) => theme.radii.outer};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
${COMMON}
|
|
161
|
-
${BORDER}
|
|
162
|
-
${LAYOUT}
|
|
163
|
-
${FLEXBOX}
|
|
164
|
-
`;
|
package/tsconfig.json
DELETED
package/tsup.config.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig((options) => ({
|
|
4
|
-
entry: ["src/index.ts"],
|
|
5
|
-
format: ["cjs", "esm"],
|
|
6
|
-
clean: true,
|
|
7
|
-
legacyOutput: true,
|
|
8
|
-
dts: options.dts,
|
|
9
|
-
external: ["react"],
|
|
10
|
-
sourcemap: true,
|
|
11
|
-
metafile: options.metafile,
|
|
12
|
-
}));
|