@stainless-api/ui-primitives 0.1.0-beta.5 → 0.1.0-beta.50
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/DropdownMenu-H_J8MxM7.d.ts +54 -0
- package/dist/components/Accordion.d.ts +26 -0
- package/dist/components/Accordion.js +29 -0
- package/dist/components/Badge.d.ts +40 -0
- package/dist/components/Badge.js +63 -0
- package/dist/components/Button.d.ts +43 -0
- package/dist/components/Button.js +50 -0
- package/dist/components/Callout.d.ts +18 -0
- package/dist/components/Callout.js +26 -0
- package/dist/components/Steps.d.ts +17 -0
- package/dist/components/Steps.js +22 -0
- package/dist/components/dropdown/Dropdown.d.ts +63 -0
- package/dist/components/dropdown/Dropdown.js +52 -0
- package/dist/components/dropdown/DropdownButton.d.ts +61 -0
- package/dist/components/dropdown/DropdownButton.js +54 -0
- package/dist/components/dropdown/DropdownMenu.d.ts +2 -0
- package/dist/components/dropdown/DropdownMenu.js +76 -0
- package/dist/components/icons/Function.d.ts +9 -0
- package/dist/components/icons/Function.js +6 -0
- package/dist/components/icons/index.d.ts +2 -0
- package/dist/components/icons/index.js +2 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/scripts/index.d.ts +23 -0
- package/dist/scripts/index.js +162 -0
- package/dist/styles/starlight-compat.css +131 -0
- package/dist/styles/theme.css +183 -0
- package/dist/styles.css +1186 -0
- package/package.json +43 -24
- package/.env +0 -1
- package/CHANGELOG.md +0 -33
- package/eslint.config.js +0 -2
- package/src/components/Button.tsx +0 -94
- package/src/components/Callout.tsx +0 -31
- package/src/components/DetailsGroup.tsx +0 -17
- package/src/components/DropdownButton.tsx +0 -98
- package/src/components/button.css +0 -157
- package/src/components/callout.css +0 -72
- package/src/components/details.css +0 -126
- package/src/components/dropdown-button.css +0 -162
- package/src/index.ts +0 -4
- package/src/scripts/dropdown-button.ts +0 -55
- package/src/scripts/index.ts +0 -1
- package/src/styles/layout.css +0 -11
- package/src/styles/scales.css +0 -129
- package/src/styles/starlight-compat.css +0 -125
- package/src/styles/swatches.css +0 -87
- package/src/styles/theme.css +0 -49
- package/src/styles/typography.css +0 -199
- package/src/styles.css +0 -11
- package/tsconfig.json +0 -15
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/dropdown/DropdownMenu.d.ts
|
|
5
|
+
declare function Menu({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare namespace Menu {
|
|
10
|
+
var Item: typeof MenuItem;
|
|
11
|
+
var ItemText: typeof MenuItemText;
|
|
12
|
+
var ItemTemplate: typeof MenuItemTemplate;
|
|
13
|
+
}
|
|
14
|
+
declare function MenuItemText({
|
|
15
|
+
className,
|
|
16
|
+
subtle,
|
|
17
|
+
...props
|
|
18
|
+
}: ComponentProps<'span'> & {
|
|
19
|
+
subtle?: boolean;
|
|
20
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
21
|
+
type MenuItemBaseProps = {
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
value: string;
|
|
24
|
+
isExternalLink?: boolean;
|
|
25
|
+
isSelected?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type MenuItemWithHref = MenuItemBaseProps & ComponentProps<'a'> & {
|
|
28
|
+
href: string;
|
|
29
|
+
};
|
|
30
|
+
type MenuItemWithoutHref = MenuItemBaseProps & ComponentProps<'button'> & {
|
|
31
|
+
href?: never;
|
|
32
|
+
};
|
|
33
|
+
type MenuItemProps = MenuItemWithHref | MenuItemWithoutHref;
|
|
34
|
+
declare function MenuItem({
|
|
35
|
+
children,
|
|
36
|
+
value,
|
|
37
|
+
href,
|
|
38
|
+
isExternalLink,
|
|
39
|
+
isSelected,
|
|
40
|
+
...props
|
|
41
|
+
}: MenuItemProps): react_jsx_runtime0.JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* A template component that defines the content to be displayed in the dropdown trigger
|
|
44
|
+
* when a menu item is selected. This template is used to customize the appearance of
|
|
45
|
+
* the selected item in the trigger button.
|
|
46
|
+
*
|
|
47
|
+
* @param props - Standard HTML template element props
|
|
48
|
+
* @returns A template element marked with the "selected-template" data part
|
|
49
|
+
*/
|
|
50
|
+
declare function MenuItemTemplate({
|
|
51
|
+
...props
|
|
52
|
+
}: ComponentProps<'template'>): react_jsx_runtime0.JSX.Element;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { Menu as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Accordion.d.ts
|
|
5
|
+
type AccordionProps = React.ComponentProps<'details'>;
|
|
6
|
+
declare function Accordion({
|
|
7
|
+
className,
|
|
8
|
+
children,
|
|
9
|
+
...props
|
|
10
|
+
}: AccordionProps): react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare namespace Accordion {
|
|
12
|
+
var Summary: typeof AccordionSummary;
|
|
13
|
+
var Group: typeof AccordionGroup;
|
|
14
|
+
}
|
|
15
|
+
declare function AccordionSummary({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<'summary'>): react_jsx_runtime0.JSX.Element;
|
|
20
|
+
declare function AccordionGroup({
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Accordion, AccordionProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Accordion.tsx
|
|
5
|
+
function Accordion({ className, children, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("details", {
|
|
7
|
+
className: clsx("stl-ui-accordion", className),
|
|
8
|
+
...props,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function AccordionSummary({ children, className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("summary", {
|
|
14
|
+
className: clsx("stl-ui-accordion__summary", className),
|
|
15
|
+
...props,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
Accordion.Summary = AccordionSummary;
|
|
20
|
+
function AccordionGroup({ className, children, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx("div", {
|
|
22
|
+
className: clsx("stl-ui-accordion-group", className),
|
|
23
|
+
...props,
|
|
24
|
+
children
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
Accordion.Group = AccordionGroup;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Accordion };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime0 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_runtime0.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_runtime0.JSX.Element;
|
|
30
|
+
declare const Badge: (({
|
|
31
|
+
children,
|
|
32
|
+
intent,
|
|
33
|
+
...props
|
|
34
|
+
}: {
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
} & React.ComponentProps<typeof BaseBadge>) => react_jsx_runtime0.JSX.Element) & {
|
|
37
|
+
HTTP: typeof HTTPBadge;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Badge, BadgeIntent, HTTPMethod, getHttpMethod };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { ArrowDownLeftIcon, ArrowUpRightIcon, XIcon } from "lucide-react";
|
|
5
|
+
//#region src/components/Badge.tsx
|
|
6
|
+
function BaseBadge({ children, icon = null, intent, size = "md", solid = false, ...props }) {
|
|
7
|
+
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);
|
|
8
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
9
|
+
...props,
|
|
10
|
+
className: classes,
|
|
11
|
+
children: [icon, !!children && /* @__PURE__ */ jsx("span", {
|
|
12
|
+
className: "stl-ui-badge__content",
|
|
13
|
+
children
|
|
14
|
+
})]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const PublicBadge = function Badge({ children, intent = "none", ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(BaseBadge, {
|
|
19
|
+
intent,
|
|
20
|
+
...props,
|
|
21
|
+
children
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
function isHttpMethod(method) {
|
|
25
|
+
return method === "GET" || method === "POST" || method === "PUT" || method === "PATCH" || method === "DELETE";
|
|
26
|
+
}
|
|
27
|
+
function getHttpMethod(method) {
|
|
28
|
+
const upper = method?.toUpperCase();
|
|
29
|
+
return isHttpMethod(upper) ? upper : null;
|
|
30
|
+
}
|
|
31
|
+
function HTTPBadge({ method, iconOnly = false, ...props }) {
|
|
32
|
+
const classes = clsx("stl-ui-badge--http", `stl-ui-badge--http-${method.toLowerCase()}`, props.className);
|
|
33
|
+
return /* @__PURE__ */ jsx(BaseBadge, {
|
|
34
|
+
...props,
|
|
35
|
+
className: classes,
|
|
36
|
+
icon: {
|
|
37
|
+
GET: /* @__PURE__ */ jsx(ArrowDownLeftIcon, {
|
|
38
|
+
"aria-hidden": !iconOnly,
|
|
39
|
+
"aria-label": "GET"
|
|
40
|
+
}),
|
|
41
|
+
POST: /* @__PURE__ */ jsx(ArrowUpRightIcon, {
|
|
42
|
+
"aria-hidden": !iconOnly,
|
|
43
|
+
"aria-label": "POST"
|
|
44
|
+
}),
|
|
45
|
+
PUT: /* @__PURE__ */ jsx(ArrowUpRightIcon, {
|
|
46
|
+
"aria-hidden": !iconOnly,
|
|
47
|
+
"aria-label": "PUT"
|
|
48
|
+
}),
|
|
49
|
+
PATCH: /* @__PURE__ */ jsx(ArrowUpRightIcon, {
|
|
50
|
+
"aria-hidden": !iconOnly,
|
|
51
|
+
"aria-label": "PATCH"
|
|
52
|
+
}),
|
|
53
|
+
DELETE: /* @__PURE__ */ jsx(XIcon, {
|
|
54
|
+
"aria-hidden": !iconOnly,
|
|
55
|
+
"aria-label": "DELETE"
|
|
56
|
+
})
|
|
57
|
+
}[method],
|
|
58
|
+
children: !iconOnly && method
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const Badge = Object.assign(PublicBadge, { HTTP: HTTPBadge });
|
|
62
|
+
//#endregion
|
|
63
|
+
export { Badge, getHttpMethod };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { LucideIcon } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Button.d.ts
|
|
6
|
+
type ButtonVariant = 'outline' | 'ghost' | 'accent' | 'accent-muted' | 'muted' | 'success' | 'destructive' | 'default';
|
|
7
|
+
type BaseProps = {
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
className?: string;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
size?: 'sm' | 'lg' | 'default';
|
|
12
|
+
border?: boolean;
|
|
13
|
+
loading?: {
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
type AnchorBranch = BaseProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'className' | 'children'> & {
|
|
18
|
+
href: string;
|
|
19
|
+
};
|
|
20
|
+
type ButtonBranch = BaseProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'children'> & {
|
|
21
|
+
href?: never;
|
|
22
|
+
};
|
|
23
|
+
type ButtonProps = AnchorBranch | ButtonBranch;
|
|
24
|
+
declare function Button(props: ButtonProps): react_jsx_runtime0.JSX.Element;
|
|
25
|
+
declare namespace Button {
|
|
26
|
+
var Label: ({
|
|
27
|
+
className,
|
|
28
|
+
...rest
|
|
29
|
+
}: LabelProps) => react_jsx_runtime0.JSX.Element;
|
|
30
|
+
var Icon: ({
|
|
31
|
+
className,
|
|
32
|
+
icon: Icon,
|
|
33
|
+
size,
|
|
34
|
+
...rest
|
|
35
|
+
}: IconProps) => react_jsx_runtime0.JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
type LabelProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
38
|
+
type IconProps = {
|
|
39
|
+
icon: LucideIcon;
|
|
40
|
+
size?: number;
|
|
41
|
+
} & React.HTMLAttributes<HTMLSpanElement>;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Button, ButtonProps, ButtonVariant };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Button.tsx
|
|
5
|
+
function Button(props) {
|
|
6
|
+
const { variant, children, border, loading, size, className, ...rest } = props;
|
|
7
|
+
const classes = clsx("stl-ui-button", {
|
|
8
|
+
"stl-ui-button--outline": variant === "outline",
|
|
9
|
+
"stl-ui-button--ghost": variant === "ghost",
|
|
10
|
+
"stl-ui-button--accent": variant === "accent",
|
|
11
|
+
"stl-ui-button--accent-muted": variant === "accent-muted",
|
|
12
|
+
"stl-ui-button--muted": variant === "muted",
|
|
13
|
+
"stl-ui-button--success": variant === "success",
|
|
14
|
+
"stl-ui-button--destructive": variant === "destructive"
|
|
15
|
+
}, {
|
|
16
|
+
"stl-ui-button--size-sm": size === "sm",
|
|
17
|
+
"stl-ui-button--size-lg": size === "lg"
|
|
18
|
+
}, { "stl-ui-button--with-border": variant === "outline" || border }, { "stl-ui-button--loading": !!loading }, "not-content", "stl-ui-not-prose", className);
|
|
19
|
+
if (loading) {
|
|
20
|
+
rest["aria-disabled"] = "true";
|
|
21
|
+
rest["aria-label"] = loading.label;
|
|
22
|
+
rest["title"] = loading.label;
|
|
23
|
+
}
|
|
24
|
+
if ("href" in rest) return /* @__PURE__ */ jsx("a", {
|
|
25
|
+
...rest,
|
|
26
|
+
className: classes,
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ jsx("button", {
|
|
30
|
+
...rest,
|
|
31
|
+
type: rest.type ?? "button",
|
|
32
|
+
className: classes,
|
|
33
|
+
children
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
Button.Label = function ButtonLabel({ className, ...rest }) {
|
|
37
|
+
return /* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: clsx("stl-ui-button-label leading-none", className),
|
|
39
|
+
...rest
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
Button.Icon = function ButtonIcon({ className, icon: Icon, size = 18, ...rest }) {
|
|
43
|
+
return /* @__PURE__ */ jsx("span", {
|
|
44
|
+
className: clsx("stl-ui-button__icon", className),
|
|
45
|
+
...rest,
|
|
46
|
+
children: /* @__PURE__ */ jsx(Icon, { size })
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Button };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Callout.d.ts
|
|
5
|
+
type CalloutVariant = 'info' | 'note' | 'tip' | 'success' | 'warning' | 'danger';
|
|
6
|
+
type CalloutProps = {
|
|
7
|
+
variant?: CalloutVariant;
|
|
8
|
+
className?: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
} & Omit<React.ComponentProps<'aside'>, 'className' | 'children'>;
|
|
11
|
+
declare function Callout({
|
|
12
|
+
variant,
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
...props
|
|
16
|
+
}: CalloutProps): react_jsx_runtime0.JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Callout, CalloutProps, CalloutVariant };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Check, CircleAlert, Info, Lightbulb, OctagonAlert, TriangleAlert } from "lucide-react";
|
|
5
|
+
//#region src/components/Callout.tsx
|
|
6
|
+
function Callout({ variant = "info", className, children, ...props }) {
|
|
7
|
+
const classes = clsx("stl-ui-callout", `stl-ui-callout--${variant}`, className);
|
|
8
|
+
const Icon = {
|
|
9
|
+
info: Info,
|
|
10
|
+
note: CircleAlert,
|
|
11
|
+
tip: Lightbulb,
|
|
12
|
+
success: Check,
|
|
13
|
+
warning: TriangleAlert,
|
|
14
|
+
danger: OctagonAlert
|
|
15
|
+
}[variant];
|
|
16
|
+
return /* @__PURE__ */ jsxs("aside", {
|
|
17
|
+
className: classes,
|
|
18
|
+
...props,
|
|
19
|
+
children: [/* @__PURE__ */ jsx(Icon, { className: "stl-ui-callout__icon" }), /* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: "stl-ui-callout__content",
|
|
21
|
+
children
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Callout };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/Steps.d.ts
|
|
4
|
+
declare function Steps({
|
|
5
|
+
children
|
|
6
|
+
}: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function Step({
|
|
10
|
+
children,
|
|
11
|
+
title
|
|
12
|
+
}: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
title: string;
|
|
15
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Step, Steps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/Steps.tsx
|
|
3
|
+
function Steps({ children }) {
|
|
4
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
5
|
+
className: "stl-ui-steps",
|
|
6
|
+
children
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function Step({ children, title }) {
|
|
10
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
11
|
+
className: "stl-ui-steps__step",
|
|
12
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: "stl-ui-steps__step-title",
|
|
14
|
+
children: title
|
|
15
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
16
|
+
className: "stl-ui-steps__step-content",
|
|
17
|
+
children
|
|
18
|
+
})]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Step, Steps };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { t as Menu } from "../../DropdownMenu-H_J8MxM7.js";
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/dropdown/Dropdown.d.ts
|
|
7
|
+
declare function Dropdown({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare namespace Dropdown {
|
|
12
|
+
var Menu: typeof Menu;
|
|
13
|
+
var MenuItem: ({
|
|
14
|
+
children,
|
|
15
|
+
value,
|
|
16
|
+
href,
|
|
17
|
+
isExternalLink,
|
|
18
|
+
isSelected,
|
|
19
|
+
...props
|
|
20
|
+
}: ({
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
value: string;
|
|
23
|
+
isExternalLink?: boolean;
|
|
24
|
+
isSelected?: boolean;
|
|
25
|
+
} & react.ClassAttributes<HTMLAnchorElement> & react.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
26
|
+
href: string;
|
|
27
|
+
}) | ({
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
value: string;
|
|
30
|
+
isExternalLink?: boolean;
|
|
31
|
+
isSelected?: boolean;
|
|
32
|
+
} & react.ClassAttributes<HTMLButtonElement> & react.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
33
|
+
href?: never;
|
|
34
|
+
})) => react_jsx_runtime0.JSX.Element;
|
|
35
|
+
var MenuItemText: ({
|
|
36
|
+
className,
|
|
37
|
+
subtle,
|
|
38
|
+
...props
|
|
39
|
+
}: ComponentProps<"span"> & {
|
|
40
|
+
subtle?: boolean;
|
|
41
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
42
|
+
var MenuItemTemplate: ({
|
|
43
|
+
...props
|
|
44
|
+
}: ComponentProps<"template">) => react_jsx_runtime0.JSX.Element;
|
|
45
|
+
var Trigger: ({
|
|
46
|
+
className,
|
|
47
|
+
...props
|
|
48
|
+
}: ComponentProps<"button">) => react_jsx_runtime0.JSX.Element;
|
|
49
|
+
var TriggerSelectedItem: ({
|
|
50
|
+
className,
|
|
51
|
+
...props
|
|
52
|
+
}: ComponentProps<"div">) => react_jsx_runtime0.JSX.Element;
|
|
53
|
+
var TriggerIcon: ({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}: ComponentProps<"span">) => react_jsx_runtime0.JSX.Element;
|
|
57
|
+
var Icon: ({
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}: ComponentProps<"div">) => react_jsx_runtime0.JSX.Element;
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { Dropdown };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Menu } from "./DropdownMenu.js";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/dropdown/Dropdown.tsx
|
|
5
|
+
function Trigger({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("button", {
|
|
7
|
+
"aria-label": "Select an option",
|
|
8
|
+
"aria-haspopup": "menu",
|
|
9
|
+
"aria-expanded": "false",
|
|
10
|
+
...props,
|
|
11
|
+
"data-part": "trigger",
|
|
12
|
+
className: clsx("stl-ui-dropdown__button", className),
|
|
13
|
+
children: props.children
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function TriggerSelectedItem({ className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx("div", {
|
|
18
|
+
...props,
|
|
19
|
+
"data-part": "trigger-selected",
|
|
20
|
+
className: clsx("stl-ui-dropdown__trigger-selected", className)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function TriggerIcon({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("span", {
|
|
25
|
+
...props,
|
|
26
|
+
"data-part": "trigger-icon",
|
|
27
|
+
className: clsx("stl-ui-dropdown__trigger-icon", className)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function Icon({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
...props,
|
|
33
|
+
"data-part": "item-icon",
|
|
34
|
+
className: clsx("stl-ui-dropdown__icon", className)
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function Dropdown({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
...props,
|
|
40
|
+
className: clsx("stl-ui-dropdown stl-ui-not-prose not-content", className)
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
Dropdown.Menu = Menu;
|
|
44
|
+
Dropdown.MenuItem = Menu.Item;
|
|
45
|
+
Dropdown.MenuItemText = Menu.ItemText;
|
|
46
|
+
Dropdown.MenuItemTemplate = Menu.ItemTemplate;
|
|
47
|
+
Dropdown.Trigger = Trigger;
|
|
48
|
+
Dropdown.TriggerSelectedItem = TriggerSelectedItem;
|
|
49
|
+
Dropdown.TriggerIcon = TriggerIcon;
|
|
50
|
+
Dropdown.Icon = Icon;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Dropdown };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { t as Menu } from "../../DropdownMenu-H_J8MxM7.js";
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/dropdown/DropdownButton.d.ts
|
|
7
|
+
declare function DropdownButton({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare namespace DropdownButton {
|
|
12
|
+
var Menu: typeof Menu;
|
|
13
|
+
var MenuItem: ({
|
|
14
|
+
children,
|
|
15
|
+
value,
|
|
16
|
+
href,
|
|
17
|
+
isExternalLink,
|
|
18
|
+
isSelected,
|
|
19
|
+
...props
|
|
20
|
+
}: ({
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
value: string;
|
|
23
|
+
isExternalLink?: boolean;
|
|
24
|
+
isSelected?: boolean;
|
|
25
|
+
} & react.ClassAttributes<HTMLAnchorElement> & react.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
26
|
+
href: string;
|
|
27
|
+
}) | ({
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
value: string;
|
|
30
|
+
isExternalLink?: boolean;
|
|
31
|
+
isSelected?: boolean;
|
|
32
|
+
} & react.ClassAttributes<HTMLButtonElement> & react.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
33
|
+
href?: never;
|
|
34
|
+
})) => react_jsx_runtime0.JSX.Element;
|
|
35
|
+
var MenuItemText: ({
|
|
36
|
+
className,
|
|
37
|
+
subtle,
|
|
38
|
+
...props
|
|
39
|
+
}: ComponentProps<"span"> & {
|
|
40
|
+
subtle?: boolean;
|
|
41
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
42
|
+
var PrimaryAction: ({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: ComponentProps<"button">) => react_jsx_runtime0.JSX.Element;
|
|
46
|
+
var PrimaryActionText: ({
|
|
47
|
+
children
|
|
48
|
+
}: {
|
|
49
|
+
children?: React.ReactNode;
|
|
50
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
51
|
+
var Trigger: ({
|
|
52
|
+
className,
|
|
53
|
+
...props
|
|
54
|
+
}: ComponentProps<"button">) => react_jsx_runtime0.JSX.Element;
|
|
55
|
+
var Icon: ({
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: ComponentProps<"div">) => react_jsx_runtime0.JSX.Element;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { DropdownButton };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Menu } from "./DropdownMenu.js";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
5
|
+
//#region src/components/dropdown/DropdownButton.tsx
|
|
6
|
+
function PrimaryActionText({ children }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("span", {
|
|
8
|
+
"data-part": "primary-action-text",
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function PrimaryAction({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("button", {
|
|
14
|
+
type: "button",
|
|
15
|
+
"aria-label": "Select primary option",
|
|
16
|
+
...props,
|
|
17
|
+
"data-part": "primary-action",
|
|
18
|
+
className: clsx("stl-ui-dropdown__button stl-ui-dropdown-button--action", className)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function Trigger({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx("button", {
|
|
23
|
+
type: "button",
|
|
24
|
+
"aria-haspopup": "menu",
|
|
25
|
+
"aria-expanded": "false",
|
|
26
|
+
"aria-label": "Select an option",
|
|
27
|
+
...props,
|
|
28
|
+
"data-part": "trigger",
|
|
29
|
+
className: clsx("stl-ui-dropdown__button stl-ui-dropdown-button__trigger", className),
|
|
30
|
+
children: /* @__PURE__ */ jsx(ChevronsUpDown, { size: 16 })
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function Icon({ className, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx("div", {
|
|
35
|
+
"data-part": "item-icon",
|
|
36
|
+
...props,
|
|
37
|
+
className: clsx("stl-ui-dropdown__icon", className)
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function DropdownButton({ className, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsx("div", {
|
|
42
|
+
...props,
|
|
43
|
+
className: clsx("stl-ui-dropdown stl-ui-not-prose not-content", className)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
DropdownButton.Menu = Menu;
|
|
47
|
+
DropdownButton.MenuItem = Menu.Item;
|
|
48
|
+
DropdownButton.MenuItemText = Menu.ItemText;
|
|
49
|
+
DropdownButton.PrimaryAction = PrimaryAction;
|
|
50
|
+
DropdownButton.PrimaryActionText = PrimaryActionText;
|
|
51
|
+
DropdownButton.Trigger = Trigger;
|
|
52
|
+
DropdownButton.Icon = Icon;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { DropdownButton };
|