@stainless-api/ui-primitives 0.1.0-beta.2 → 0.1.0-beta.21
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 +35 -0
- package/CHANGELOG.md +118 -0
- package/dist/Accordion-CJL9SWwS.d.ts +26 -0
- package/dist/Accordion-DLQE3Td6.js +31 -0
- package/dist/Button-DBhd6kU7.js +51 -0
- package/dist/Button-DwndlytB.d.ts +38 -0
- package/dist/Callout-CMz3Yl_5.d.ts +18 -0
- package/dist/Callout-UZQRuCQ5.js +28 -0
- package/dist/DropdownButton-DoYDi8tB.js +82 -0
- package/dist/DropdownButton-zcvep_xH.d.ts +50 -0
- package/dist/components/Accordion.d.ts +2 -0
- package/dist/components/Accordion.js +3 -0
- package/dist/components/Button.d.ts +2 -0
- package/dist/components/Button.js +3 -0
- package/dist/components/Callout.d.ts +2 -0
- package/dist/components/Callout.js +3 -0
- package/dist/components/DropdownButton.d.ts +2 -0
- package/dist/components/DropdownButton.js +3 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/scripts/index.d.ts +12 -0
- package/dist/scripts/index.js +33 -0
- package/dist/styles.css +1181 -0
- package/dist/styles.js +1 -0
- package/package.json +9 -9
- package/src/components/Accordion.tsx +41 -0
- package/src/components/Button.tsx +1 -0
- package/src/components/accordion.css +145 -0
- package/src/components/button.css +165 -135
- package/src/components/callout.css +78 -57
- package/src/components/dropdown/Dropdown.tsx +51 -0
- package/src/components/dropdown/DropdownButton.tsx +54 -0
- package/src/components/dropdown/DropdownMenu.tsx +113 -0
- package/src/components/dropdown/dropdown.css +232 -0
- package/src/index.ts +3 -2
- package/src/scripts/dropdown-button.ts +20 -36
- package/src/scripts/dropdown.ts +193 -0
- package/src/scripts/index.ts +1 -0
- package/src/styles/layout.css +3 -1
- package/src/styles/scales.css +1 -1
- package/src/styles/starlight-compat.css +138 -107
- package/src/styles/swatches.css +2 -2
- package/src/styles/theme.css +2 -2
- package/src/styles/typography.css +117 -147
- package/src/styles.css +2 -2
- package/tsconfig.json +3 -7
- package/.env +0 -1
- package/src/components/DetailsGroup.tsx +0 -17
- package/src/components/DropdownButton.tsx +0 -98
- package/src/components/details.css +0 -126
- package/src/components/dropdown-button.css +0 -162
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* Typography - Stainless */
|
|
2
|
+
@layer stl-ui.tokens {
|
|
3
3
|
:root {
|
|
4
4
|
--stl-ui-typography-font: 'Geist', system-ui, sans-serif;
|
|
5
5
|
--stl-ui-typography-font-mono: 'Geist Mono', ui-monospace, monospace;
|
|
@@ -30,170 +30,140 @@
|
|
|
30
30
|
--stl-ui-type-scale-text-5xl: 42px;
|
|
31
31
|
--stl-ui-type-scale-text-6xl: 64px;
|
|
32
32
|
}
|
|
33
|
+
}
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.stl-ui-prose {
|
|
47
|
-
color: var(--stl-ui-foreground-secondary);
|
|
48
|
-
|
|
49
|
-
/* Body/Regular */
|
|
50
|
-
font-size: var(--stl-ui-typography-text-body);
|
|
51
|
-
font-style: normal;
|
|
52
|
-
font-weight: 400;
|
|
53
|
-
line-height: var(--stl-ui-typography-line-height);
|
|
54
|
-
letter-spacing: -0.01em;
|
|
55
|
-
|
|
56
|
-
* {
|
|
57
|
-
margin: 0;
|
|
58
|
-
}
|
|
35
|
+
/* Prose exists in its own sub-layer for easy reverting */
|
|
36
|
+
body {
|
|
37
|
+
font-family: var(--stl-ui-typography-font);
|
|
38
|
+
font-feature-settings:
|
|
39
|
+
'ss01' on,
|
|
40
|
+
'ss03' on,
|
|
41
|
+
'ss04' on,
|
|
42
|
+
'ss06' on,
|
|
43
|
+
'ss08' on;
|
|
44
|
+
}
|
|
59
45
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
46
|
+
.stl-ui-prose {
|
|
47
|
+
letter-spacing: -0.01em;
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
line-height: var(--stl-ui-typography-line-height);
|
|
50
|
+
font-size: var(--stl-ui-typography-text-body);
|
|
51
|
+
color: var(--stl-ui-foreground-secondary);
|
|
52
|
+
|
|
53
|
+
:where(.stl-ui-not-prose) {
|
|
54
|
+
letter-spacing: initial;
|
|
55
|
+
font-weight: initial;
|
|
56
|
+
line-height: initial;
|
|
57
|
+
font-size: initial;
|
|
58
|
+
color: initial;
|
|
59
|
+
}
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
61
|
+
:where(p):not(.stl-ui-not-prose *) {
|
|
62
|
+
margin-top: 16px;
|
|
63
|
+
}
|
|
68
64
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
:where(p, li) {
|
|
66
|
+
&:not(.stl-ui-not-prose *) {
|
|
67
|
+
color: var(--stl-ui-foreground-secondary);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
72
70
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
color: var(--stl-ui-foreground);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
71
|
+
:where(strong):not(.stl-ui-not-prose *) {
|
|
72
|
+
color: var(--stl-ui-foreground);
|
|
73
|
+
}
|
|
79
74
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/* Body/Link */
|
|
84
|
-
font-weight: 600;
|
|
85
|
-
text-decoration-line: underline;
|
|
86
|
-
text-decoration-style: solid;
|
|
87
|
-
text-decoration-skip-ink: auto;
|
|
88
|
-
text-decoration-thickness: auto;
|
|
89
|
-
text-underline-offset: auto;
|
|
90
|
-
text-underline-position: from-font;
|
|
91
|
-
}
|
|
75
|
+
:where(aside):not(.stl-ui-not-prose *) {
|
|
76
|
+
color: var(--stl-ui-foreground);
|
|
77
|
+
}
|
|
92
78
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
h6 {
|
|
99
|
-
color: var(--stl-ui-foreground);
|
|
100
|
-
font-weight: 500;
|
|
101
|
-
line-height: var(--stl-ui-typography-line-height-headings);
|
|
102
|
-
}
|
|
79
|
+
:is(h1, h2, h3, h4, h5, h6):not(.stl-ui-not-prose *) {
|
|
80
|
+
color: var(--stl-ui-foreground);
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
line-height: var(--stl-ui-typography-line-height-headings);
|
|
83
|
+
}
|
|
103
84
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
85
|
+
h1:not(.stl-ui-not-prose *) {
|
|
86
|
+
/* Heading 1/Medium */
|
|
87
|
+
font-size: var(--stl-ui-typography-text-h1);
|
|
88
|
+
letter-spacing: -0.03em;
|
|
108
89
|
|
|
109
|
-
|
|
110
|
-
|
|
90
|
+
margin-top: 64px;
|
|
91
|
+
}
|
|
111
92
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
margin-top: 48px;
|
|
117
|
-
}
|
|
93
|
+
h2:not(.stl-ui-not-prose *) {
|
|
94
|
+
/* Heading 2/Medium */
|
|
95
|
+
font-size: var(--stl-ui-typography-text-h2);
|
|
96
|
+
letter-spacing: -0.03em;
|
|
118
97
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
font-size: var(--stl-ui-typography-text-h3);
|
|
122
|
-
letter-spacing: -0.02em;
|
|
123
|
-
margin-top: 40px;
|
|
124
|
-
}
|
|
98
|
+
margin-top: 48px;
|
|
99
|
+
}
|
|
125
100
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
101
|
+
h3:not(.stl-ui-not-prose *) {
|
|
102
|
+
/* Heading 3/Medium */
|
|
103
|
+
font-size: var(--stl-ui-typography-text-h3);
|
|
104
|
+
letter-spacing: -0.02em;
|
|
105
|
+
margin-top: 40px;
|
|
106
|
+
}
|
|
132
107
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
108
|
+
h4:not(.stl-ui-not-prose *) {
|
|
109
|
+
/* Heading 4/Medium */
|
|
110
|
+
font-size: var(--stl-ui-typography-text-h4);
|
|
111
|
+
letter-spacing: -0.02em;
|
|
112
|
+
margin-top: 32px;
|
|
113
|
+
}
|
|
139
114
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
h2,
|
|
147
|
-
h3,
|
|
148
|
-
h4,
|
|
149
|
-
h5,
|
|
150
|
-
p,
|
|
151
|
-
a {
|
|
152
|
-
&:first-child {
|
|
153
|
-
display: inline;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
115
|
+
h5:not(.stl-ui-not-prose *) {
|
|
116
|
+
/* Heading 5/Medium */
|
|
117
|
+
font-size: var(--stl-ui-typography-text-h5);
|
|
118
|
+
letter-spacing: -0.02em;
|
|
119
|
+
margin-top: 24px;
|
|
120
|
+
}
|
|
157
121
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
122
|
+
li:not(.stl-ui-not-prose *) {
|
|
123
|
+
&:not(:last-child) {
|
|
124
|
+
margin-bottom: 8px;
|
|
125
|
+
}
|
|
162
126
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
127
|
+
h1,
|
|
128
|
+
h2,
|
|
129
|
+
h3,
|
|
130
|
+
h4,
|
|
131
|
+
h5,
|
|
132
|
+
p,
|
|
133
|
+
a {
|
|
134
|
+
&:first-child {
|
|
135
|
+
display: inline;
|
|
171
136
|
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
172
139
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
'ss04' on,
|
|
179
|
-
'ss06' on;
|
|
180
|
-
|
|
181
|
-
/* Code/Regular */
|
|
182
|
-
font-family: var(--stl-ui-typography-font-mono);
|
|
183
|
-
font-size: var(--stl-ui-typography-text-body-sm);
|
|
184
|
-
font-style: normal;
|
|
185
|
-
font-weight: 400;
|
|
186
|
-
line-height: 150%; /* 21px */
|
|
187
|
-
|
|
188
|
-
padding: 0 4px;
|
|
189
|
-
background-color: oklch(from var(--stl-ui-foreground) l c h / 0.1);
|
|
190
|
-
border-radius: var(--stl-ui-layout-border-radius-xs);
|
|
191
|
-
}
|
|
140
|
+
:where(ol, ul) {
|
|
141
|
+
&:not(.stl-ui-not-prose *) {
|
|
142
|
+
padding-left: 26px;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
192
145
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
146
|
+
:where(ol, ul, aside, img, figure, details) {
|
|
147
|
+
&:not(.stl-ui-not-prose *) {
|
|
148
|
+
margin-top: 16px;
|
|
197
149
|
}
|
|
198
150
|
}
|
|
151
|
+
|
|
152
|
+
:where(:not(pre) > code):not(.stl-ui-not-prose *) {
|
|
153
|
+
color: var(--stl-ui-foreground);
|
|
154
|
+
font-feature-settings:
|
|
155
|
+
'ss01' on,
|
|
156
|
+
'ss03' on,
|
|
157
|
+
'ss04' on,
|
|
158
|
+
'ss06' on;
|
|
159
|
+
|
|
160
|
+
/* Code/Regular */
|
|
161
|
+
font-family: var(--stl-ui-typography-font-mono);
|
|
162
|
+
font-size: 0.9em;
|
|
163
|
+
font-weight: inherit;
|
|
164
|
+
|
|
165
|
+
padding: 0 0.2em;
|
|
166
|
+
background-color: oklch(from var(--stl-ui-foreground) l c h / 0.1);
|
|
167
|
+
border-radius: 0.2em;
|
|
168
|
+
}
|
|
199
169
|
}
|
package/src/styles.css
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
@import './styles/starlight-compat.css';
|
|
7
7
|
|
|
8
8
|
@import './components/button.css';
|
|
9
|
-
@import './components/dropdown
|
|
9
|
+
@import './components/dropdown/dropdown.css';
|
|
10
10
|
@import './components/callout.css';
|
|
11
|
-
@import './components/
|
|
11
|
+
@import './components/accordion.css';
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"module": "ESNext",
|
|
4
|
+
"noEmit": false,
|
|
5
5
|
"declaration": true,
|
|
6
6
|
"declarationDir": "dist",
|
|
7
7
|
"outDir": "dist",
|
|
8
|
-
"jsx": "react-jsx"
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"moduleResolution": "Node",
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"strict": true
|
|
8
|
+
"jsx": "react-jsx"
|
|
13
9
|
},
|
|
14
10
|
"include": ["src"]
|
|
15
11
|
}
|
package/.env
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
STAINLESS_API_KEY=stl_sk_001uwmod48VpDm2a1bvB1tUTdJ1ooZ5I
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
|
|
4
|
-
export type DetailsGroupProps = React.ComponentProps<'div'>;
|
|
5
|
-
|
|
6
|
-
export function DetailsGroup({ className, children, ...props }: DetailsGroupProps) {
|
|
7
|
-
const classes = clsx('stl-ui-details-group', className);
|
|
8
|
-
|
|
9
|
-
// TODO: boolean `exclusive` prop assigns a unique `name` to each of the child <details> elements
|
|
10
|
-
// For now this can be handled by the user
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<div className={classes} {...props}>
|
|
14
|
-
{children}
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { ChevronsUpDown, ExternalLink } from 'lucide-react';
|
|
2
|
-
|
|
3
|
-
export function DropdownButtonPrimaryActionText({ children }: { children?: React.ReactNode }) {
|
|
4
|
-
return <span data-part="primary-action-text">{children}</span>;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function DropdownButtonPrimaryAction({ children }: { children?: React.ReactNode }) {
|
|
8
|
-
return (
|
|
9
|
-
<button
|
|
10
|
-
type="button"
|
|
11
|
-
data-part="primary-action"
|
|
12
|
-
className="stl-ui-dropdown-button__button stl-ui-dropdown-button--action"
|
|
13
|
-
>
|
|
14
|
-
{children}
|
|
15
|
-
</button>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function DropdownButtonTrigger() {
|
|
20
|
-
return (
|
|
21
|
-
<button
|
|
22
|
-
className="stl-ui-dropdown-button__button stl-ui-dropdown-button__trigger"
|
|
23
|
-
aria-haspopup="listbox"
|
|
24
|
-
aria-expanded="false"
|
|
25
|
-
data-part="trigger"
|
|
26
|
-
>
|
|
27
|
-
<ChevronsUpDown size={16} />
|
|
28
|
-
</button>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function DropdownButtonMenu({ children }: { children?: React.ReactNode }) {
|
|
33
|
-
return (
|
|
34
|
-
<div className="stl-ui-dropdown-button__menu" data-state="closed" data-part="menu">
|
|
35
|
-
{children}
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function DropdownButtonItemIcon({ children }: { children?: React.ReactNode }) {
|
|
41
|
-
return (
|
|
42
|
-
<div className="stl-ui-dropdown-button__menu-item-icon" data-part="item-icon">
|
|
43
|
-
{children}
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function DropdownButtonItemText({ children }: { children?: React.ReactNode }) {
|
|
49
|
-
return (
|
|
50
|
-
<span className="stl-ui-dropdown-button__menu-item-text" data-part="item-text">
|
|
51
|
-
{children}
|
|
52
|
-
</span>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function DropdownButtonItemTextSubtle({ children }: { children?: React.ReactNode }) {
|
|
57
|
-
return (
|
|
58
|
-
<span className="stl-ui-dropdown-button__menu-item-text-subtle" data-part="item-text-subtle">
|
|
59
|
-
{children}
|
|
60
|
-
</span>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function DropdownButtonItem({
|
|
65
|
-
children,
|
|
66
|
-
value,
|
|
67
|
-
isExternalLink,
|
|
68
|
-
}: {
|
|
69
|
-
children?: React.ReactNode;
|
|
70
|
-
value: string;
|
|
71
|
-
isExternalLink?: boolean;
|
|
72
|
-
}) {
|
|
73
|
-
return (
|
|
74
|
-
<div className="stl-ui-dropdown-button__menu-item" data-part="item" data-value={value}>
|
|
75
|
-
<div className="stl-ui-dropdown-button__menu-item-content">{children}</div>
|
|
76
|
-
{isExternalLink && (
|
|
77
|
-
<div
|
|
78
|
-
className="stl-ui-dropdown-button__menu-item-external-link-icon"
|
|
79
|
-
data-part="item-external-link-icon"
|
|
80
|
-
>
|
|
81
|
-
<ExternalLink size={16} />
|
|
82
|
-
</div>
|
|
83
|
-
)}
|
|
84
|
-
</div>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function DropdownButtonDivider() {
|
|
89
|
-
return <div className="stl-ui-dropdown-button__divider" data-part="divider" />;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export function DropdownButton({ id, children }: { id: string; children?: React.ReactNode }) {
|
|
93
|
-
return (
|
|
94
|
-
<div className="stl-ui-dropdown-button stl-ui-not-prose not-content" id={id}>
|
|
95
|
-
{children}
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/* revert starlight details styles */
|
|
2
|
-
@layer starlight.content {
|
|
3
|
-
/* artificially increase specificity to outcompete selectors in the same layer whose styles we want to revert */
|
|
4
|
-
.stl-ui-prose .sl-markdown-content.sl-markdown-content.sl-markdown-content {
|
|
5
|
-
details,
|
|
6
|
-
summary,
|
|
7
|
-
summary::before,
|
|
8
|
-
summary::marker {
|
|
9
|
-
all: revert-layer;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@layer stl-ui {
|
|
15
|
-
@layer typography {
|
|
16
|
-
.stl-ui-prose {
|
|
17
|
-
details {
|
|
18
|
-
--stl-ui-details-padding: 12px;
|
|
19
|
-
--stl-ui-details-content-padding-bottom: 4px;
|
|
20
|
-
--stl-ui-details-marker-size: 1em;
|
|
21
|
-
--stl-ui-details-marker-margin: calc((1lh - var(--stl-ui-details-marker-size)) / 2);
|
|
22
|
-
--stl-ui-details-row-gap: 8px;
|
|
23
|
-
--stl-ui-details-summary-column-gap: 8px;
|
|
24
|
-
--stl-ui-details-border-radius: var(--stl-ui-layout-border-radius);
|
|
25
|
-
/* left inset to make content line up with summary content (after chevron) */
|
|
26
|
-
--stl-ui--internal--details-padding-start: calc(
|
|
27
|
-
var(--stl-ui-details-padding)
|
|
28
|
-
+ var(--stl-ui-details-marker-size)
|
|
29
|
-
+ var(--stl-ui-details-marker-margin) * 2
|
|
30
|
-
+ var(--stl-ui-details-summary-column-gap)
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
background-color: var(--stl-ui-card-background);
|
|
34
|
-
border: 1px solid var(--stl-ui-border);
|
|
35
|
-
border-radius: var(--stl-ui-details-border-radius);
|
|
36
|
-
font-size: var(--stl-ui-typography-text-body);
|
|
37
|
-
|
|
38
|
-
padding: var(--stl-ui-details-padding);
|
|
39
|
-
/* indent content to line up with left edge of summary content */
|
|
40
|
-
padding-inline-start: var(--stl-ui--internal--details-padding-start);
|
|
41
|
-
|
|
42
|
-
summary {
|
|
43
|
-
display: block;
|
|
44
|
-
list-style: none;
|
|
45
|
-
|
|
46
|
-
/* summary extends to the edges of the element in order to increase click target */
|
|
47
|
-
padding: var(--stl-ui-details-padding);
|
|
48
|
-
padding-inline-start: var(--stl-ui--internal--details-padding-start);
|
|
49
|
-
margin: calc(-1 * var(--stl-ui-details-padding));
|
|
50
|
-
margin-inline-start: calc(-1 * var(--stl-ui--internal--details-padding-start));
|
|
51
|
-
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
font-weight: 500;
|
|
54
|
-
|
|
55
|
-
border-radius: var(--stl-ui-details-border-radius);
|
|
56
|
-
|
|
57
|
-
&::before {
|
|
58
|
-
content: '';
|
|
59
|
-
width: var(--stl-ui-details-marker-size);
|
|
60
|
-
height: var(--stl-ui-details-marker-size);
|
|
61
|
-
margin: var(--stl-ui-details-marker-margin);
|
|
62
|
-
background-color: currentColor;
|
|
63
|
-
display: block;
|
|
64
|
-
position: absolute;
|
|
65
|
-
--stl-ui-details--internal--marker-width: calc(var(--stl-ui-details-marker-size) + var(--stl-ui-details-marker-margin) * 2);
|
|
66
|
-
--stl-ui-details--internal--summary-marker-transform: translateX(calc(-1 * var(--stl-ui-details--internal--marker-width) - var(--stl-ui-details-summary-column-gap)));
|
|
67
|
-
transform: var(--stl-ui-details--internal--summary-marker-transform);
|
|
68
|
-
|
|
69
|
-
--lucide-chevron-right: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQtaWNvbiBsdWNpZGUtY2hldnJvbi1yaWdodCI+PHBhdGggZD0ibTkgMTggNi02LTYtNiIvPjwvc3ZnPg==');
|
|
70
|
-
mask-image: var(--lucide-chevron-right);
|
|
71
|
-
mask-size: contain;
|
|
72
|
-
mask-repeat: no-repeat;
|
|
73
|
-
|
|
74
|
-
transition: transform 0.1s ease-out;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
& > :first-child {
|
|
78
|
-
margin-top: 0;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
&[open] {
|
|
83
|
-
padding-bottom: calc(var(--stl-ui-details-padding) + var(--stl-ui-details-content-padding-bottom));
|
|
84
|
-
|
|
85
|
-
summary {
|
|
86
|
-
/* padding-bottom shouldn’t extend beyond the row gap while open, i.e. we shouldn’t be negative-margin-placing content overlapping summary */
|
|
87
|
-
--stl-ui--internal--summary-padding-bottom: min(var(--stl-ui-details-padding), var(--stl-ui-details-row-gap));
|
|
88
|
-
padding-bottom: var(--stl-ui--internal--summary-padding-bottom);
|
|
89
|
-
margin-bottom: calc(var(--stl-ui-details-row-gap) - var(--stl-ui--internal--summary-padding-bottom));
|
|
90
|
-
border-bottom-left-radius: 0;
|
|
91
|
-
border-bottom-right-radius: 0;
|
|
92
|
-
|
|
93
|
-
&::before {
|
|
94
|
-
transform: var(--stl-ui-details--internal--summary-marker-transform) rotate(90deg);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
summary + * {
|
|
100
|
-
margin-top: 0;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.stl-ui-details-group {
|
|
106
|
-
& > details:has(+ details) {
|
|
107
|
-
border-bottom-left-radius: 0;
|
|
108
|
-
border-bottom-right-radius: 0;
|
|
109
|
-
summary {
|
|
110
|
-
border-bottom-left-radius: 0;
|
|
111
|
-
border-bottom-right-radius: 0;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
& > details + details {
|
|
115
|
-
margin-top: 0;
|
|
116
|
-
border-top: 0;
|
|
117
|
-
border-top-left-radius: 0;
|
|
118
|
-
border-top-right-radius: 0;
|
|
119
|
-
summary {
|
|
120
|
-
border-top-left-radius: 0;
|
|
121
|
-
border-top-right-radius: 0;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|