@stainless-api/ui-primitives 0.1.0-beta.10 → 0.1.0-beta.12
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 +12 -0
- package/dist/Accordion-DLQE3Td6.js +31 -0
- package/dist/Accordion-_dikpfLR.d.ts +26 -0
- package/dist/Button-DBhd6kU7.js +51 -0
- package/dist/Button-sTZ6xvkU.d.ts +38 -0
- package/dist/Callout-Dsp2nbSy.d.ts +18 -0
- package/dist/Callout-UZQRuCQ5.js +28 -0
- package/dist/DropdownButton-CNJ5NyBS.d.ts +53 -0
- package/dist/DropdownButton-CStYzJ6s.js +83 -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 +35 -0
- package/dist/styles.css +1172 -0
- package/dist/styles.js +1 -0
- package/package.json +6 -6
- package/src/components/DropdownButton.tsx +53 -38
- package/src/components/accordion.css +6 -6
- package/src/styles/layout.css +2 -0
- package/src/styles/starlight-compat.css +0 -4
- package/src/styles/typography.css +8 -20
- package/.env +0 -1
package/dist/styles.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/ui-primitives",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.12",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"lucide-react": "^0.544.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/react": "^19.
|
|
31
|
-
"@types/react-dom": "^19.
|
|
32
|
-
"react": "^19.
|
|
33
|
-
"react-dom": "^19.
|
|
34
|
-
"typescript": "5.9.
|
|
30
|
+
"@types/react": "^19.2.2",
|
|
31
|
+
"@types/react-dom": "^19.2.2",
|
|
32
|
+
"react": "^19.2.0",
|
|
33
|
+
"react-dom": "^19.2.0",
|
|
34
|
+
"typescript": "5.9.3",
|
|
35
35
|
"@stainless/eslint-config": "0.0.0"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1,69 +1,73 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import { ChevronsUpDown, ExternalLink } from 'lucide-react';
|
|
3
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
3
4
|
|
|
4
5
|
function PrimaryActionText({ children }: { children?: React.ReactNode }) {
|
|
5
6
|
return <span data-part="primary-action-text">{children}</span>;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
function PrimaryAction({
|
|
9
|
+
function PrimaryAction({ className, ...props }: ComponentPropsWithoutRef<'button'>) {
|
|
9
10
|
return (
|
|
10
11
|
<button
|
|
11
|
-
type="button"
|
|
12
12
|
data-part="primary-action"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</button>
|
|
13
|
+
{...props}
|
|
14
|
+
className={clsx('stl-ui-dropdown-button__button stl-ui-dropdown-button--action', className)}
|
|
15
|
+
/>
|
|
17
16
|
);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
function Trigger() {
|
|
19
|
+
function Trigger({ className, ...props }: ComponentPropsWithoutRef<'button'>) {
|
|
21
20
|
return (
|
|
22
21
|
<button
|
|
23
|
-
className="stl-ui-dropdown-button__button stl-ui-dropdown-button__trigger"
|
|
24
22
|
aria-haspopup="listbox"
|
|
25
23
|
aria-expanded="false"
|
|
26
24
|
data-part="trigger"
|
|
25
|
+
{...props}
|
|
26
|
+
className={clsx('stl-ui-dropdown-button__button stl-ui-dropdown-button__trigger', className)}
|
|
27
27
|
>
|
|
28
28
|
<ChevronsUpDown size={16} />
|
|
29
29
|
</button>
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function Menu({
|
|
33
|
+
function Menu({ className, ...props }: ComponentPropsWithoutRef<'div'>) {
|
|
34
34
|
return (
|
|
35
|
-
<div
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
<div
|
|
36
|
+
data-state="closed"
|
|
37
|
+
data-part="menu"
|
|
38
|
+
{...props}
|
|
39
|
+
className={clsx('stl-ui-dropdown-button__menu', className)}
|
|
40
|
+
/>
|
|
38
41
|
);
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
function MenuItemIcon({
|
|
44
|
+
function MenuItemIcon({ className, ...props }: ComponentPropsWithoutRef<'div'>) {
|
|
42
45
|
return (
|
|
43
|
-
<div
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
<div
|
|
47
|
+
data-part="item-icon"
|
|
48
|
+
{...props}
|
|
49
|
+
className={clsx('stl-ui-dropdown-button__menu-item-icon', className)}
|
|
50
|
+
/>
|
|
46
51
|
);
|
|
47
52
|
}
|
|
48
53
|
|
|
49
|
-
function MenuItemText({
|
|
54
|
+
function MenuItemText({
|
|
55
|
+
className,
|
|
56
|
+
subtle,
|
|
57
|
+
...props
|
|
58
|
+
}: ComponentPropsWithoutRef<'span'> & { subtle?: boolean }) {
|
|
50
59
|
return (
|
|
51
60
|
<span
|
|
52
|
-
className={clsx(`stl-ui-dropdown-button__menu-item-text`, {
|
|
53
|
-
'stl-ui-dropdown-button__menu-item-text--subtle': subtle,
|
|
54
|
-
})}
|
|
55
61
|
data-part="item-text"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{children}
|
|
66
|
-
</span>
|
|
62
|
+
className={clsx(
|
|
63
|
+
`stl-ui-dropdown-button__menu-item-text`,
|
|
64
|
+
{
|
|
65
|
+
'stl-ui-dropdown-button__menu-item-text--subtle': subtle,
|
|
66
|
+
},
|
|
67
|
+
className,
|
|
68
|
+
)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
67
71
|
);
|
|
68
72
|
}
|
|
69
73
|
|
|
@@ -71,13 +75,19 @@ function MenuItem({
|
|
|
71
75
|
children,
|
|
72
76
|
value,
|
|
73
77
|
isExternalLink,
|
|
74
|
-
|
|
78
|
+
...props
|
|
79
|
+
}: ComponentPropsWithoutRef<'div'> & {
|
|
75
80
|
children?: React.ReactNode;
|
|
76
81
|
value: string;
|
|
77
82
|
isExternalLink?: boolean;
|
|
78
83
|
}) {
|
|
79
84
|
return (
|
|
80
|
-
<div
|
|
85
|
+
<div
|
|
86
|
+
data-part="item"
|
|
87
|
+
data-value={value}
|
|
88
|
+
{...props}
|
|
89
|
+
className={clsx('stl-ui-dropdown-button__menu-item', props.className)}
|
|
90
|
+
>
|
|
81
91
|
<div className="stl-ui-dropdown-button__menu-item-content">{children}</div>
|
|
82
92
|
{isExternalLink && (
|
|
83
93
|
<div
|
|
@@ -91,11 +101,17 @@ function MenuItem({
|
|
|
91
101
|
);
|
|
92
102
|
}
|
|
93
103
|
|
|
94
|
-
export function DropdownButton({
|
|
104
|
+
export function DropdownButton({
|
|
105
|
+
id,
|
|
106
|
+
className,
|
|
107
|
+
...props
|
|
108
|
+
}: ComponentPropsWithoutRef<'div'> & { id: string }) {
|
|
95
109
|
return (
|
|
96
|
-
<div
|
|
97
|
-
{
|
|
98
|
-
|
|
110
|
+
<div
|
|
111
|
+
id={id}
|
|
112
|
+
{...props}
|
|
113
|
+
className={clsx('stl-ui-dropdown-button stl-ui-not-prose not-content', className)}
|
|
114
|
+
/>
|
|
99
115
|
);
|
|
100
116
|
}
|
|
101
117
|
|
|
@@ -103,7 +119,6 @@ DropdownButton.Menu = Menu;
|
|
|
103
119
|
DropdownButton.MenuItem = MenuItem;
|
|
104
120
|
DropdownButton.MenuItemIcon = MenuItemIcon;
|
|
105
121
|
DropdownButton.MenuItemText = MenuItemText;
|
|
106
|
-
DropdownButton.MenuItemTextSubtle = MenuItemTextSubtle;
|
|
107
122
|
DropdownButton.PrimaryAction = PrimaryAction;
|
|
108
123
|
DropdownButton.PrimaryActionText = PrimaryActionText;
|
|
109
124
|
DropdownButton.Trigger = Trigger;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
/* indent content to line up with left edge of summary content */
|
|
36
36
|
padding-inline-start: var(--stl-ui--internal--accordion-padding-start);
|
|
37
37
|
|
|
38
|
-
.stl-ui-accordion__summary {
|
|
38
|
+
& > .stl-ui-accordion__summary {
|
|
39
39
|
display: block;
|
|
40
40
|
list-style: none;
|
|
41
41
|
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
border-color: var(--stl-ui-border-emphasis);
|
|
86
86
|
padding-bottom: calc(var(--stl-ui-accordion-padding) + var(--stl-ui-accordion-content-padding-bottom));
|
|
87
87
|
|
|
88
|
-
.stl-ui-accordion__summary {
|
|
88
|
+
& > .stl-ui-accordion__summary {
|
|
89
89
|
/* padding-bottom shouldn’t extend beyond the row gap while open, i.e. we shouldn’t be negative-margin-placing content overlapping summary */
|
|
90
90
|
--stl-ui--internal--summary-padding-bottom: min(
|
|
91
91
|
var(--stl-ui-accordion-padding),
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
&:has(.stl-ui-accordion__summary:hover) {
|
|
105
|
+
&:has(> .stl-ui-accordion__summary:hover) {
|
|
106
106
|
background-image: linear-gradient(
|
|
107
107
|
to bottom,
|
|
108
108
|
var(--stl-ui-accordion-hover-film-color),
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
border-color: var(--stl-ui-border-emphasis);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
.stl-ui-accordion__summary + * {
|
|
114
|
+
& > .stl-ui-accordion__summary + * {
|
|
115
115
|
margin-top: 0;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
& > .stl-ui-accordion:has(+ .stl-ui-accordion) {
|
|
121
121
|
border-bottom-left-radius: 0;
|
|
122
122
|
border-bottom-right-radius: 0;
|
|
123
|
-
.stl-ui-accordion__summary {
|
|
123
|
+
& > .stl-ui-accordion__summary {
|
|
124
124
|
border-bottom-left-radius: 0;
|
|
125
125
|
border-bottom-right-radius: 0;
|
|
126
126
|
}
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
border-top-left-radius: 0;
|
|
133
133
|
border-top-right-radius: 0;
|
|
134
134
|
|
|
135
|
-
.stl-ui-accordion__summary {
|
|
135
|
+
& > .stl-ui-accordion__summary {
|
|
136
136
|
border-top-left-radius: 0;
|
|
137
137
|
border-top-right-radius: 0;
|
|
138
138
|
}
|
package/src/styles/layout.css
CHANGED
|
@@ -64,10 +64,6 @@
|
|
|
64
64
|
|
|
65
65
|
/* Starlight Compatibility */
|
|
66
66
|
.stl-ui-prose {
|
|
67
|
-
:is(h1, h2, h3, h4, h5) code {
|
|
68
|
-
font-size: 0.9em;
|
|
69
|
-
font-weight: inherit;
|
|
70
|
-
}
|
|
71
67
|
/* TODO: Disable starlight headingLinks and replace with our own */
|
|
72
68
|
/* Duplicate styles from h1–5 in typography; TODO: move to mixins after adopting preprocessor */
|
|
73
69
|
.sl-heading-wrapper.level-h1 {
|
|
@@ -67,20 +67,10 @@ body {
|
|
|
67
67
|
color: var(--stl-ui-foreground);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
h1,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
h5,
|
|
75
|
-
h6 {
|
|
76
|
-
&:not(.stl-ui-not-prose *) {
|
|
77
|
-
&,
|
|
78
|
-
* {
|
|
79
|
-
color: var(--stl-ui-foreground);
|
|
80
|
-
font-weight: 500;
|
|
81
|
-
line-height: var(--stl-ui-typography-line-height-headings);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
70
|
+
:is(h1, h2, h3, h4, h5, h6):not(.stl-ui-not-prose *) {
|
|
71
|
+
color: var(--stl-ui-foreground);
|
|
72
|
+
font-weight: 500;
|
|
73
|
+
line-height: var(--stl-ui-typography-line-height-headings);
|
|
84
74
|
}
|
|
85
75
|
|
|
86
76
|
h1:not(.stl-ui-not-prose *) {
|
|
@@ -160,13 +150,11 @@ body {
|
|
|
160
150
|
|
|
161
151
|
/* Code/Regular */
|
|
162
152
|
font-family: var(--stl-ui-typography-font-mono);
|
|
163
|
-
font-size:
|
|
164
|
-
font-
|
|
165
|
-
font-weight: 400;
|
|
166
|
-
line-height: 150%; /* 21px */
|
|
153
|
+
font-size: 0.9em;
|
|
154
|
+
font-weight: inherit;
|
|
167
155
|
|
|
168
|
-
padding: 0
|
|
156
|
+
padding: 0 0.2em;
|
|
169
157
|
background-color: oklch(from var(--stl-ui-foreground) l c h / 0.1);
|
|
170
|
-
border-radius:
|
|
158
|
+
border-radius: 0.2em;
|
|
171
159
|
}
|
|
172
160
|
}
|
package/.env
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
STAINLESS_API_KEY=stl_sk_001uwmod48VpDm2a1bvB1tUTdJ1ooZ5I
|