@stainless-api/ui-primitives 0.1.0-beta.42 → 0.1.0-beta.43
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/components/Accordion.d.ts +4 -4
- package/dist/components/Badge.d.ts +40 -0
- package/dist/components/Badge.js +65 -0
- package/dist/components/Button.d.ts +4 -4
- package/dist/components/Callout.d.ts +2 -2
- package/dist/components/Steps.d.ts +3 -3
- package/dist/index.d.ts +22 -21
- package/dist/index.js +2 -1
- package/dist/styles.css +150 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Accordion.d.ts
|
|
5
5
|
type AccordionProps = React.ComponentProps<'details'>;
|
|
@@ -7,7 +7,7 @@ declare function Accordion({
|
|
|
7
7
|
className,
|
|
8
8
|
children,
|
|
9
9
|
...props
|
|
10
|
-
}: AccordionProps):
|
|
10
|
+
}: AccordionProps): react_jsx_runtime0.JSX.Element;
|
|
11
11
|
declare namespace Accordion {
|
|
12
12
|
var Summary: typeof AccordionSummary;
|
|
13
13
|
var Group: typeof AccordionGroup;
|
|
@@ -16,11 +16,11 @@ declare function AccordionSummary({
|
|
|
16
16
|
children,
|
|
17
17
|
className,
|
|
18
18
|
...props
|
|
19
|
-
}: React.ComponentProps<'summary'>):
|
|
19
|
+
}: React.ComponentProps<'summary'>): react_jsx_runtime0.JSX.Element;
|
|
20
20
|
declare function AccordionGroup({
|
|
21
21
|
className,
|
|
22
22
|
children,
|
|
23
23
|
...props
|
|
24
|
-
}: React.ComponentProps<'div'>):
|
|
24
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { Accordion, AccordionProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Badge.d.ts
|
|
5
|
+
type BadgeIntent = 'none' | 'info' | 'success' | 'warning' | 'danger' | 'note' | 'tip' | 'accent';
|
|
6
|
+
declare function BaseBadge({
|
|
7
|
+
children,
|
|
8
|
+
icon,
|
|
9
|
+
intent,
|
|
10
|
+
size,
|
|
11
|
+
solid,
|
|
12
|
+
...props
|
|
13
|
+
}: {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
intent?: BadgeIntent;
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
solid?: boolean;
|
|
19
|
+
} & React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime2.JSX.Element;
|
|
20
|
+
type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
21
|
+
declare function getHttpMethod(method?: string): HTTPMethod | null;
|
|
22
|
+
declare function HTTPBadge({
|
|
23
|
+
method,
|
|
24
|
+
iconOnly,
|
|
25
|
+
...props
|
|
26
|
+
}: {
|
|
27
|
+
method: HTTPMethod;
|
|
28
|
+
iconOnly?: boolean;
|
|
29
|
+
} & Omit<React.ComponentProps<typeof Badge>, 'children' | 'intent'>): react_jsx_runtime2.JSX.Element;
|
|
30
|
+
declare const Badge: (({
|
|
31
|
+
children,
|
|
32
|
+
intent,
|
|
33
|
+
...props
|
|
34
|
+
}: {
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
} & React.ComponentProps<typeof BaseBadge>) => react_jsx_runtime2.JSX.Element) & {
|
|
37
|
+
HTTP: typeof HTTPBadge;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Badge, BadgeIntent, HTTPMethod, getHttpMethod };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { ArrowDownLeftIcon, ArrowUpRightIcon, XIcon } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/Badge.tsx
|
|
7
|
+
function BaseBadge({ children, icon = null, intent, size = "md", solid = false, ...props }) {
|
|
8
|
+
const classes = clsx("stl-ui-badge", intent && `stl-ui-badge--intent-${intent}`, `stl-ui-badge--size-${size}`, solid && "stl-ui-badge--solid", "not-content", "stl-ui-not-prose", props.className);
|
|
9
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
10
|
+
...props,
|
|
11
|
+
className: classes,
|
|
12
|
+
children: [icon, children && /* @__PURE__ */ jsx("span", {
|
|
13
|
+
className: "stl-ui-badge__content",
|
|
14
|
+
children
|
|
15
|
+
})]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const PublicBadge = function Badge$1({ children, intent = "none", ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(BaseBadge, {
|
|
20
|
+
intent,
|
|
21
|
+
...props,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
function isHttpMethod(method) {
|
|
26
|
+
return method === "GET" || method === "POST" || method === "PUT" || method === "PATCH" || method === "DELETE";
|
|
27
|
+
}
|
|
28
|
+
function getHttpMethod(method) {
|
|
29
|
+
const upper = method?.toUpperCase();
|
|
30
|
+
return isHttpMethod(upper) ? upper : null;
|
|
31
|
+
}
|
|
32
|
+
function HTTPBadge({ method, iconOnly = false, ...props }) {
|
|
33
|
+
const classes = clsx("stl-ui-badge--http", `stl-ui-badge--http-${method.toLowerCase()}`, props.className);
|
|
34
|
+
return /* @__PURE__ */ jsx(BaseBadge, {
|
|
35
|
+
...props,
|
|
36
|
+
className: classes,
|
|
37
|
+
icon: {
|
|
38
|
+
GET: /* @__PURE__ */ jsx(ArrowDownLeftIcon, {
|
|
39
|
+
"aria-hidden": !iconOnly,
|
|
40
|
+
"aria-label": "GET"
|
|
41
|
+
}),
|
|
42
|
+
POST: /* @__PURE__ */ jsx(ArrowUpRightIcon, {
|
|
43
|
+
"aria-hidden": !iconOnly,
|
|
44
|
+
"aria-label": "POST"
|
|
45
|
+
}),
|
|
46
|
+
PUT: /* @__PURE__ */ jsx(ArrowUpRightIcon, {
|
|
47
|
+
"aria-hidden": !iconOnly,
|
|
48
|
+
"aria-label": "PUT"
|
|
49
|
+
}),
|
|
50
|
+
PATCH: /* @__PURE__ */ jsx(ArrowUpRightIcon, {
|
|
51
|
+
"aria-hidden": !iconOnly,
|
|
52
|
+
"aria-label": "PATCH"
|
|
53
|
+
}),
|
|
54
|
+
DELETE: /* @__PURE__ */ jsx(XIcon, {
|
|
55
|
+
"aria-hidden": !iconOnly,
|
|
56
|
+
"aria-label": "DELETE"
|
|
57
|
+
})
|
|
58
|
+
}[method],
|
|
59
|
+
children: !iconOnly && method
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const Badge = Object.assign(PublicBadge, { HTTP: HTTPBadge });
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { Badge, getHttpMethod };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
3
|
import { LucideIcon } from "lucide-react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/Button.d.ts
|
|
@@ -21,18 +21,18 @@ type ButtonBranch = BaseProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
21
21
|
href?: never;
|
|
22
22
|
};
|
|
23
23
|
type ButtonProps = AnchorBranch | ButtonBranch;
|
|
24
|
-
declare function Button(props: ButtonProps):
|
|
24
|
+
declare function Button(props: ButtonProps): react_jsx_runtime5.JSX.Element;
|
|
25
25
|
declare namespace Button {
|
|
26
26
|
var Label: ({
|
|
27
27
|
className,
|
|
28
28
|
...rest
|
|
29
|
-
}: LabelProps) =>
|
|
29
|
+
}: LabelProps) => react_jsx_runtime5.JSX.Element;
|
|
30
30
|
var Icon: ({
|
|
31
31
|
className,
|
|
32
32
|
icon: Icon,
|
|
33
33
|
size,
|
|
34
34
|
...rest
|
|
35
|
-
}: IconProps) =>
|
|
35
|
+
}: IconProps) => react_jsx_runtime5.JSX.Element;
|
|
36
36
|
}
|
|
37
37
|
type LabelProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
38
38
|
type IconProps = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Callout.d.ts
|
|
5
5
|
type CalloutVariant = 'info' | 'note' | 'tip' | 'success' | 'warning' | 'danger';
|
|
@@ -13,6 +13,6 @@ declare function Callout({
|
|
|
13
13
|
className,
|
|
14
14
|
children,
|
|
15
15
|
...props
|
|
16
|
-
}: CalloutProps):
|
|
16
|
+
}: CalloutProps): react_jsx_runtime8.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { Callout, CalloutProps, CalloutVariant };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Steps.d.ts
|
|
4
4
|
declare function Steps({
|
|
5
5
|
children
|
|
6
6
|
}: {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
-
}):
|
|
8
|
+
}): react_jsx_runtime9.JSX.Element;
|
|
9
9
|
declare function Step({
|
|
10
10
|
children,
|
|
11
11
|
title
|
|
12
12
|
}: {
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
title: string;
|
|
15
|
-
}):
|
|
15
|
+
}): react_jsx_runtime9.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { Step, Steps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Accordion, AccordionProps } from "./components/Accordion.js";
|
|
2
|
+
import { Badge, BadgeIntent, HTTPMethod, getHttpMethod } from "./components/Badge.js";
|
|
2
3
|
import { Button, ButtonProps, ButtonVariant } from "./components/Button.js";
|
|
3
4
|
import { Callout, CalloutProps, CalloutVariant } from "./components/Callout.js";
|
|
4
5
|
import { Step, Steps } from "./components/Steps.js";
|
|
5
6
|
import * as react3 from "react";
|
|
6
7
|
import { ComponentProps } from "react";
|
|
7
|
-
import * as
|
|
8
|
+
import * as react_jsx_runtime26 from "react/jsx-runtime";
|
|
8
9
|
|
|
9
10
|
//#region src/components/dropdown/DropdownMenu.d.ts
|
|
10
11
|
declare function Menu({
|
|
11
12
|
className,
|
|
12
13
|
...props
|
|
13
|
-
}: ComponentProps<'div'>):
|
|
14
|
+
}: ComponentProps<'div'>): react_jsx_runtime26.JSX.Element;
|
|
14
15
|
declare namespace Menu {
|
|
15
16
|
var Item: typeof MenuItem;
|
|
16
17
|
var ItemText: typeof MenuItemText;
|
|
@@ -22,7 +23,7 @@ declare function MenuItemText({
|
|
|
22
23
|
...props
|
|
23
24
|
}: ComponentProps<'span'> & {
|
|
24
25
|
subtle?: boolean;
|
|
25
|
-
}):
|
|
26
|
+
}): react_jsx_runtime26.JSX.Element;
|
|
26
27
|
type MenuItemBaseProps = {
|
|
27
28
|
children?: React.ReactNode;
|
|
28
29
|
value: string;
|
|
@@ -43,7 +44,7 @@ declare function MenuItem({
|
|
|
43
44
|
isExternalLink,
|
|
44
45
|
isSelected,
|
|
45
46
|
...props
|
|
46
|
-
}: MenuItemProps):
|
|
47
|
+
}: MenuItemProps): react_jsx_runtime26.JSX.Element;
|
|
47
48
|
/**
|
|
48
49
|
* A template component that defines the content to be displayed in the dropdown trigger
|
|
49
50
|
* when a menu item is selected. This template is used to customize the appearance of
|
|
@@ -54,13 +55,13 @@ declare function MenuItem({
|
|
|
54
55
|
*/
|
|
55
56
|
declare function MenuItemTemplate({
|
|
56
57
|
...props
|
|
57
|
-
}: ComponentProps<'template'>):
|
|
58
|
+
}: ComponentProps<'template'>): react_jsx_runtime26.JSX.Element;
|
|
58
59
|
//#endregion
|
|
59
60
|
//#region src/components/dropdown/Dropdown.d.ts
|
|
60
61
|
declare function Dropdown({
|
|
61
62
|
className,
|
|
62
63
|
...props
|
|
63
|
-
}: ComponentProps<'div'>):
|
|
64
|
+
}: ComponentProps<'div'>): react_jsx_runtime26.JSX.Element;
|
|
64
65
|
declare namespace Dropdown {
|
|
65
66
|
var Menu: typeof Menu;
|
|
66
67
|
var MenuItem: ({
|
|
@@ -84,40 +85,40 @@ declare namespace Dropdown {
|
|
|
84
85
|
isSelected?: boolean;
|
|
85
86
|
} & react3.ClassAttributes<HTMLButtonElement> & react3.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
86
87
|
href?: never;
|
|
87
|
-
})) =>
|
|
88
|
+
})) => react_jsx_runtime26.JSX.Element;
|
|
88
89
|
var MenuItemText: ({
|
|
89
90
|
className,
|
|
90
91
|
subtle,
|
|
91
92
|
...props
|
|
92
93
|
}: ComponentProps<"span"> & {
|
|
93
94
|
subtle?: boolean;
|
|
94
|
-
}) =>
|
|
95
|
+
}) => react_jsx_runtime26.JSX.Element;
|
|
95
96
|
var MenuItemTemplate: ({
|
|
96
97
|
...props
|
|
97
|
-
}: ComponentProps<"template">) =>
|
|
98
|
+
}: ComponentProps<"template">) => react_jsx_runtime26.JSX.Element;
|
|
98
99
|
var Trigger: ({
|
|
99
100
|
className,
|
|
100
101
|
...props
|
|
101
|
-
}: ComponentProps<"button">) =>
|
|
102
|
+
}: ComponentProps<"button">) => react_jsx_runtime26.JSX.Element;
|
|
102
103
|
var TriggerSelectedItem: ({
|
|
103
104
|
className,
|
|
104
105
|
...props
|
|
105
|
-
}: ComponentProps<"div">) =>
|
|
106
|
+
}: ComponentProps<"div">) => react_jsx_runtime26.JSX.Element;
|
|
106
107
|
var TriggerIcon: ({
|
|
107
108
|
className,
|
|
108
109
|
...props
|
|
109
|
-
}: ComponentProps<"span">) =>
|
|
110
|
+
}: ComponentProps<"span">) => react_jsx_runtime26.JSX.Element;
|
|
110
111
|
var Icon: ({
|
|
111
112
|
className,
|
|
112
113
|
...props
|
|
113
|
-
}: ComponentProps<"div">) =>
|
|
114
|
+
}: ComponentProps<"div">) => react_jsx_runtime26.JSX.Element;
|
|
114
115
|
}
|
|
115
116
|
//#endregion
|
|
116
117
|
//#region src/components/dropdown/DropdownButton.d.ts
|
|
117
118
|
declare function DropdownButton({
|
|
118
119
|
className,
|
|
119
120
|
...props
|
|
120
|
-
}: ComponentProps<'div'>):
|
|
121
|
+
}: ComponentProps<'div'>): react_jsx_runtime26.JSX.Element;
|
|
121
122
|
declare namespace DropdownButton {
|
|
122
123
|
var Menu: typeof Menu;
|
|
123
124
|
var MenuItem: ({
|
|
@@ -141,31 +142,31 @@ declare namespace DropdownButton {
|
|
|
141
142
|
isSelected?: boolean;
|
|
142
143
|
} & react3.ClassAttributes<HTMLButtonElement> & react3.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
143
144
|
href?: never;
|
|
144
|
-
})) =>
|
|
145
|
+
})) => react_jsx_runtime26.JSX.Element;
|
|
145
146
|
var MenuItemText: ({
|
|
146
147
|
className,
|
|
147
148
|
subtle,
|
|
148
149
|
...props
|
|
149
150
|
}: ComponentProps<"span"> & {
|
|
150
151
|
subtle?: boolean;
|
|
151
|
-
}) =>
|
|
152
|
+
}) => react_jsx_runtime26.JSX.Element;
|
|
152
153
|
var PrimaryAction: ({
|
|
153
154
|
className,
|
|
154
155
|
...props
|
|
155
|
-
}: ComponentProps<"button">) =>
|
|
156
|
+
}: ComponentProps<"button">) => react_jsx_runtime26.JSX.Element;
|
|
156
157
|
var PrimaryActionText: ({
|
|
157
158
|
children
|
|
158
159
|
}: {
|
|
159
160
|
children?: React.ReactNode;
|
|
160
|
-
}) =>
|
|
161
|
+
}) => react_jsx_runtime26.JSX.Element;
|
|
161
162
|
var Trigger: ({
|
|
162
163
|
className,
|
|
163
164
|
...props
|
|
164
|
-
}: ComponentProps<"button">) =>
|
|
165
|
+
}: ComponentProps<"button">) => react_jsx_runtime26.JSX.Element;
|
|
165
166
|
var Icon: ({
|
|
166
167
|
className,
|
|
167
168
|
...props
|
|
168
|
-
}: ComponentProps<"div">) =>
|
|
169
|
+
}: ComponentProps<"div">) => react_jsx_runtime26.JSX.Element;
|
|
169
170
|
}
|
|
170
171
|
//#endregion
|
|
171
|
-
export { Accordion, AccordionProps, Button, ButtonProps, ButtonVariant, Callout, CalloutProps, CalloutVariant, Dropdown, DropdownButton, Step, Steps };
|
|
172
|
+
export { Accordion, AccordionProps, Badge, BadgeIntent, Button, ButtonProps, ButtonVariant, Callout, CalloutProps, CalloutVariant, Dropdown, DropdownButton, HTTPMethod, Step, Steps, getHttpMethod };
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Button } from "./components/Button.js";
|
|
|
2
2
|
import { Callout } from "./components/Callout.js";
|
|
3
3
|
import { Accordion } from "./components/Accordion.js";
|
|
4
4
|
import { Step, Steps } from "./components/Steps.js";
|
|
5
|
+
import { Badge, getHttpMethod } from "./components/Badge.js";
|
|
5
6
|
import clsx from "clsx";
|
|
6
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { CheckIcon, ChevronsUpDown, ExternalLink } from "lucide-react";
|
|
@@ -178,4 +179,4 @@ DropdownButton.Trigger = Trigger;
|
|
|
178
179
|
DropdownButton.Icon = Icon;
|
|
179
180
|
|
|
180
181
|
//#endregion
|
|
181
|
-
export { Accordion, Button, Callout, Dropdown, DropdownButton, Step, Steps };
|
|
182
|
+
export { Accordion, Badge, Button, Callout, Dropdown, DropdownButton, Step, Steps, getHttpMethod };
|
package/dist/styles.css
CHANGED
|
@@ -1169,6 +1169,156 @@ a.stl-ui-button {
|
|
|
1169
1169
|
margin-top: 4px;
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
|
+
.stl-ui-badge {
|
|
1173
|
+
display: inline-flex;
|
|
1174
|
+
align-items: center;
|
|
1175
|
+
gap: 0.125em;
|
|
1176
|
+
|
|
1177
|
+
font-weight: 500;
|
|
1178
|
+
letter-spacing: normal;
|
|
1179
|
+
|
|
1180
|
+
border-width: 1px;
|
|
1181
|
+
border-style: solid;
|
|
1182
|
+
|
|
1183
|
+
/* sizes */
|
|
1184
|
+
&.stl-ui-badge--size-sm {
|
|
1185
|
+
height: 20px;
|
|
1186
|
+
font-size: var(--stl-typography-scale-xs);
|
|
1187
|
+
padding: 0 2px;
|
|
1188
|
+
border-radius: var(--stl-ui-layout-border-radius-xs);
|
|
1189
|
+
--stl-ui-badge-icon-size: 14px;
|
|
1190
|
+
}
|
|
1191
|
+
&,
|
|
1192
|
+
&.stl-ui-badge--size-md {
|
|
1193
|
+
height: 24px;
|
|
1194
|
+
font-size: var(--stl-typography-scale-sm);
|
|
1195
|
+
padding: 0 4px;
|
|
1196
|
+
border-radius: var(--stl-ui-layout-border-radius-xs);
|
|
1197
|
+
--stl-ui-badge-icon-size: 14px;
|
|
1198
|
+
}
|
|
1199
|
+
&.stl-ui-badge--size-lg {
|
|
1200
|
+
height: 32px;
|
|
1201
|
+
font-size: var(--stl-typography-scale-md);
|
|
1202
|
+
padding: 0 6px;
|
|
1203
|
+
border-radius: var(--stl-ui-layout-border-radius-sml);
|
|
1204
|
+
--stl-ui-badge-icon-size: 16px;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
/* intents */
|
|
1208
|
+
&.stl-ui-badge--intent-none {
|
|
1209
|
+
background-color: var(--stl-color-ui-background);
|
|
1210
|
+
color: var(--stl-color-foreground-muted);
|
|
1211
|
+
--stl-ui-badge-icon-opacity: var(--stl-opacity-level-040);
|
|
1212
|
+
border-color: var(--stl-color-border);
|
|
1213
|
+
}
|
|
1214
|
+
&.stl-ui-badge--intent-info {
|
|
1215
|
+
background-color: var(--stl-color-muted-background);
|
|
1216
|
+
color: var(--stl-color-foreground-muted);
|
|
1217
|
+
--stl-ui-badge-icon-opacity: var(--stl-opacity-level-040);
|
|
1218
|
+
border-color: var(--stl-color-border);
|
|
1219
|
+
&.stl-ui-badge--solid {
|
|
1220
|
+
background-color: var(--stl-color-inverse-background);
|
|
1221
|
+
color: var(--stl-color-inverse-foreground);
|
|
1222
|
+
--stl-ui-badge-icon-opacity: 1;
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
&.stl-ui-badge--intent-success,
|
|
1226
|
+
&.stl-ui-badge--http-get {
|
|
1227
|
+
background-color: var(--stl-color-green-muted-background);
|
|
1228
|
+
color: var(--stl-color-green-foreground);
|
|
1229
|
+
border-color: var(--stl-color-green-border);
|
|
1230
|
+
&.stl-ui-badge--solid {
|
|
1231
|
+
background-color: var(--stl-color-green-inverse-background);
|
|
1232
|
+
color: var(--stl-color-green-inverse-foreground);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
&.stl-ui-badge--intent-warning {
|
|
1236
|
+
background-color: var(--stl-color-yellow-muted-background);
|
|
1237
|
+
color: var(--stl-color-yellow-foreground);
|
|
1238
|
+
border-color: var(--stl-color-yellow-border);
|
|
1239
|
+
&.stl-ui-badge--solid {
|
|
1240
|
+
background-color: var(--stl-color-yellow-inverse-background);
|
|
1241
|
+
color: var(--stl-color-yellow-inverse-foreground);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
&.stl-ui-badge--intent-danger,
|
|
1245
|
+
&.stl-ui-badge--http-delete {
|
|
1246
|
+
background-color: var(--stl-color-red-muted-background);
|
|
1247
|
+
color: var(--stl-color-red-foreground);
|
|
1248
|
+
border-color: var(--stl-color-red-border);
|
|
1249
|
+
&.stl-ui-badge--solid {
|
|
1250
|
+
background-color: var(--stl-color-red-inverse-background);
|
|
1251
|
+
color: var(--stl-color-red-inverse-foreground);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
&.stl-ui-badge--intent-note,
|
|
1255
|
+
&.stl-ui-badge--http-post {
|
|
1256
|
+
background-color: var(--stl-color-blue-muted-background);
|
|
1257
|
+
color: var(--stl-color-blue-foreground);
|
|
1258
|
+
border-color: var(--stl-color-blue-border);
|
|
1259
|
+
&.stl-ui-badge--solid {
|
|
1260
|
+
background-color: var(--stl-color-blue-inverse-background);
|
|
1261
|
+
color: var(--stl-color-blue-inverse-foreground);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
&.stl-ui-badge--intent-tip {
|
|
1265
|
+
background-color: var(--stl-color-purple-muted-background);
|
|
1266
|
+
color: var(--stl-color-purple-foreground);
|
|
1267
|
+
border-color: var(--stl-color-purple-border);
|
|
1268
|
+
&.stl-ui-badge--solid {
|
|
1269
|
+
background-color: var(--stl-color-purple-inverse-background);
|
|
1270
|
+
color: var(--stl-color-purple-inverse-foreground);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
&.stl-ui-badge--intent-accent {
|
|
1274
|
+
background-color: var(--stl-color-accent-muted-background);
|
|
1275
|
+
color: var(--stl-color-accent-foreground);
|
|
1276
|
+
border-color: var(--stl-color-accent-border);
|
|
1277
|
+
&.stl-ui-badge--solid {
|
|
1278
|
+
background-color: var(--stl-color-accent-inverse-background);
|
|
1279
|
+
color: var(--stl-color-accent-inverse-foreground);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
&.stl-ui-badge--http-put,
|
|
1283
|
+
&.stl-ui-badge--http-patch {
|
|
1284
|
+
background-color: var(--stl-color-orange-muted-background);
|
|
1285
|
+
color: var(--stl-color-orange-foreground);
|
|
1286
|
+
border-color: var(--stl-color-orange-border);
|
|
1287
|
+
&.stl-ui-badge--solid {
|
|
1288
|
+
background-color: var(--stl-color-orange-inverse-background);
|
|
1289
|
+
color: var(--stl-color-orange-inverse-foreground);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
/* Text content */
|
|
1294
|
+
.stl-ui-badge__content {
|
|
1295
|
+
display: inline-block;
|
|
1296
|
+
padding: 0.25em;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
/* Icons */
|
|
1300
|
+
svg {
|
|
1301
|
+
flex-shrink: 0;
|
|
1302
|
+
display: inline-block;
|
|
1303
|
+
color: rgb(from currentColor r g b / 1);
|
|
1304
|
+
opacity: var(--stl-ui-badge-icon-opacity, 1);
|
|
1305
|
+
width: var(--stl-ui-badge-icon-size);
|
|
1306
|
+
height: var(--stl-ui-badge-icon-size);
|
|
1307
|
+
}
|
|
1308
|
+
&:has(> svg:only-child) {
|
|
1309
|
+
padding: 0;
|
|
1310
|
+
aspect-ratio: 1;
|
|
1311
|
+
justify-content: center;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
/* HTTP */
|
|
1315
|
+
&.stl-ui-badge--http {
|
|
1316
|
+
font-family: var(--stl-typography-font-mono);
|
|
1317
|
+
font-variant-numeric: tabular-nums;
|
|
1318
|
+
text-transform: uppercase;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1172
1322
|
/* design system variables */
|
|
1173
1323
|
|
|
1174
1324
|
/* components */
|