@stainless-api/ui-primitives 0.1.0-beta.3 → 0.1.0-beta.30

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.
Files changed (43) hide show
  1. package/dist/Accordion-CL3Oarbz.js +31 -0
  2. package/dist/Accordion-X9MBt29l.d.ts +26 -0
  3. package/dist/Button-DFAg4M-E.js +51 -0
  4. package/dist/Button-DMtVJEuK.d.ts +38 -0
  5. package/dist/Callout-BGkXD7D2.js +28 -0
  6. package/dist/Callout-DlwbfFHm.d.ts +18 -0
  7. package/dist/components/Accordion.d.ts +2 -0
  8. package/dist/components/Accordion.js +3 -0
  9. package/dist/components/Button.d.ts +2 -0
  10. package/dist/components/Button.js +3 -0
  11. package/dist/components/Callout.d.ts +2 -0
  12. package/dist/components/Callout.js +3 -0
  13. package/dist/index.d.ts +170 -0
  14. package/dist/index.js +180 -0
  15. package/dist/scripts/index.d.ts +23 -0
  16. package/dist/scripts/index.js +161 -0
  17. package/dist/styles/starlight-compat.css +151 -0
  18. package/dist/styles/starlight-compat.js +0 -0
  19. package/dist/styles.css +1041 -0
  20. package/dist/styles.js +0 -0
  21. package/package.json +38 -24
  22. package/.env +0 -1
  23. package/CHANGELOG.md +0 -21
  24. package/eslint.config.js +0 -2
  25. package/src/components/Button.tsx +0 -94
  26. package/src/components/Callout.tsx +0 -31
  27. package/src/components/DetailsGroup.tsx +0 -17
  28. package/src/components/DropdownButton.tsx +0 -98
  29. package/src/components/button.css +0 -157
  30. package/src/components/callout.css +0 -72
  31. package/src/components/details.css +0 -126
  32. package/src/components/dropdown-button.css +0 -162
  33. package/src/index.ts +0 -4
  34. package/src/scripts/dropdown-button.ts +0 -55
  35. package/src/scripts/index.ts +0 -1
  36. package/src/styles/layout.css +0 -11
  37. package/src/styles/scales.css +0 -129
  38. package/src/styles/starlight-compat.css +0 -125
  39. package/src/styles/swatches.css +0 -87
  40. package/src/styles/theme.css +0 -49
  41. package/src/styles/typography.css +0 -199
  42. package/src/styles.css +0 -11
  43. package/tsconfig.json +0 -15
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import clsx from "clsx";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/components/Accordion.tsx
6
+ function Accordion({ className, children, ...props }) {
7
+ return /* @__PURE__ */ jsx("details", {
8
+ className: clsx("stl-ui-accordion", className),
9
+ ...props,
10
+ children
11
+ });
12
+ }
13
+ function AccordionSummary({ children, className, ...props }) {
14
+ return /* @__PURE__ */ jsx("summary", {
15
+ className: clsx("stl-ui-accordion__summary", className),
16
+ ...props,
17
+ children
18
+ });
19
+ }
20
+ Accordion.Summary = AccordionSummary;
21
+ function AccordionGroup({ className, children, ...props }) {
22
+ return /* @__PURE__ */ jsx("div", {
23
+ className: clsx("stl-ui-accordion-group", className),
24
+ ...props,
25
+ children
26
+ });
27
+ }
28
+ Accordion.Group = AccordionGroup;
29
+
30
+ //#endregion
31
+ export { Accordion as t };
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import * as react_jsx_runtime2 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_runtime2.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_runtime2.JSX.Element;
20
+ declare function AccordionGroup({
21
+ className,
22
+ children,
23
+ ...props
24
+ }: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
25
+ //#endregion
26
+ export { AccordionProps as n, Accordion as t };
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import clsx from "clsx";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/components/Button.tsx
6
+ function Button(props) {
7
+ const { variant, children } = props;
8
+ const classes = clsx("stl-ui-button", {
9
+ "stl-ui-button--outline": variant === "outline",
10
+ "stl-ui-button--ghost": variant === "ghost",
11
+ "stl-ui-button--accent": variant === "accent",
12
+ "stl-ui-button--accent-muted": variant === "accent-muted",
13
+ "stl-ui-button--muted": variant === "muted",
14
+ "stl-ui-button--success": variant === "success",
15
+ "stl-ui-button--destructive": variant === "destructive"
16
+ }, {
17
+ "stl-ui-button--size-sm": props.size === "sm",
18
+ "stl-ui-button--size-lg": props.size === "lg"
19
+ }, "not-content", "stl-ui-not-prose", props.className);
20
+ if ("href" in props) {
21
+ const { href, ...rest$1 } = props;
22
+ return /* @__PURE__ */ jsx("a", {
23
+ href,
24
+ ...rest$1,
25
+ className: classes,
26
+ children
27
+ });
28
+ }
29
+ const { type, ...rest } = props;
30
+ return /* @__PURE__ */ jsx("button", {
31
+ type: type ?? "button",
32
+ ...rest,
33
+ className: classes,
34
+ children
35
+ });
36
+ }
37
+ Button.Label = function ButtonLabel({ className, ...rest }) {
38
+ return /* @__PURE__ */ jsx("span", {
39
+ className: clsx("stl-ui-button-label leading-none", className),
40
+ ...rest
41
+ });
42
+ };
43
+ Button.Icon = function ButtonIcon({ className, icon: Icon, size = 18 }) {
44
+ return /* @__PURE__ */ jsx("span", {
45
+ className: clsx("stl-ui-button__icon", className),
46
+ children: /* @__PURE__ */ jsx(Icon, { size })
47
+ });
48
+ };
49
+
50
+ //#endregion
51
+ export { Button as t };
@@ -0,0 +1,38 @@
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
+ };
13
+ type AnchorBranch = BaseProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'className' | 'children'> & {
14
+ href: string;
15
+ };
16
+ type ButtonBranch = BaseProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'children'> & {
17
+ href?: never;
18
+ };
19
+ type ButtonProps = AnchorBranch | ButtonBranch;
20
+ declare function Button(props: ButtonProps): react_jsx_runtime0.JSX.Element;
21
+ declare namespace Button {
22
+ var Label: ({
23
+ className,
24
+ ...rest
25
+ }: LabelProps) => react_jsx_runtime0.JSX.Element;
26
+ var Icon: ({
27
+ className,
28
+ icon: Icon,
29
+ size
30
+ }: IconProps) => react_jsx_runtime0.JSX.Element;
31
+ }
32
+ type LabelProps = React.HTMLAttributes<HTMLSpanElement>;
33
+ type IconProps = {
34
+ icon: LucideIcon;
35
+ size?: number;
36
+ } & React.HTMLAttributes<HTMLSpanElement>;
37
+ //#endregion
38
+ export { ButtonProps as n, ButtonVariant as r, Button as t };
@@ -0,0 +1,28 @@
1
+ import React from "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
+
6
+ //#region src/components/Callout.tsx
7
+ function Callout({ variant = "info", className, children, ...props }) {
8
+ const classes = clsx("stl-ui-callout", `stl-ui-callout--${variant}`, className);
9
+ const Icon = {
10
+ info: Info,
11
+ note: CircleAlert,
12
+ tip: Lightbulb,
13
+ success: Check,
14
+ warning: TriangleAlert,
15
+ danger: OctagonAlert
16
+ }[variant];
17
+ return /* @__PURE__ */ jsxs("aside", {
18
+ className: classes,
19
+ ...props,
20
+ children: [/* @__PURE__ */ jsx(Icon, { className: "stl-ui-callout__icon" }), /* @__PURE__ */ jsx("div", {
21
+ className: "stl-ui-callout__content",
22
+ children
23
+ })]
24
+ });
25
+ }
26
+
27
+ //#endregion
28
+ export { Callout as t };
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import * as react_jsx_runtime5 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_runtime5.JSX.Element;
17
+ //#endregion
18
+ export { CalloutProps as n, CalloutVariant as r, Callout as t };
@@ -0,0 +1,2 @@
1
+ import { n as AccordionProps, t as Accordion } from "../Accordion-X9MBt29l.js";
2
+ export { Accordion, AccordionProps };
@@ -0,0 +1,3 @@
1
+ import { t as Accordion } from "../Accordion-CL3Oarbz.js";
2
+
3
+ export { Accordion };
@@ -0,0 +1,2 @@
1
+ import { n as ButtonProps, r as ButtonVariant, t as Button } from "../Button-DMtVJEuK.js";
2
+ export { Button, ButtonProps, ButtonVariant };
@@ -0,0 +1,3 @@
1
+ import { t as Button } from "../Button-DFAg4M-E.js";
2
+
3
+ export { Button };
@@ -0,0 +1,2 @@
1
+ import { n as CalloutProps, r as CalloutVariant, t as Callout } from "../Callout-DlwbfFHm.js";
2
+ export { Callout, CalloutProps, CalloutVariant };
@@ -0,0 +1,3 @@
1
+ import { t as Callout } from "../Callout-BGkXD7D2.js";
2
+
3
+ export { Callout };
@@ -0,0 +1,170 @@
1
+ import { n as AccordionProps, t as Accordion } from "./Accordion-X9MBt29l.js";
2
+ import { n as ButtonProps, r as ButtonVariant, t as Button } from "./Button-DMtVJEuK.js";
3
+ import { n as CalloutProps, r as CalloutVariant, t as Callout } from "./Callout-DlwbfFHm.js";
4
+ import * as react3 from "react";
5
+ import { ComponentProps } from "react";
6
+ import * as react_jsx_runtime21 from "react/jsx-runtime";
7
+
8
+ //#region src/components/dropdown/DropdownMenu.d.ts
9
+ declare function Menu({
10
+ className,
11
+ ...props
12
+ }: ComponentProps<'div'>): react_jsx_runtime21.JSX.Element;
13
+ declare namespace Menu {
14
+ var Item: typeof MenuItem;
15
+ var ItemText: typeof MenuItemText;
16
+ var ItemTemplate: typeof MenuItemTemplate;
17
+ }
18
+ declare function MenuItemText({
19
+ className,
20
+ subtle,
21
+ ...props
22
+ }: ComponentProps<'span'> & {
23
+ subtle?: boolean;
24
+ }): react_jsx_runtime21.JSX.Element;
25
+ type MenuItemBaseProps = {
26
+ children?: React.ReactNode;
27
+ value: string;
28
+ isExternalLink?: boolean;
29
+ isSelected?: boolean;
30
+ };
31
+ type MenuItemWithHref = MenuItemBaseProps & ComponentProps<'a'> & {
32
+ href: string;
33
+ };
34
+ type MenuItemWithoutHref = MenuItemBaseProps & ComponentProps<'button'> & {
35
+ href?: never;
36
+ };
37
+ type MenuItemProps = MenuItemWithHref | MenuItemWithoutHref;
38
+ declare function MenuItem({
39
+ children,
40
+ value,
41
+ href,
42
+ isExternalLink,
43
+ isSelected,
44
+ ...props
45
+ }: MenuItemProps): react_jsx_runtime21.JSX.Element;
46
+ /**
47
+ * A template component that defines the content to be displayed in the dropdown trigger
48
+ * when a menu item is selected. This template is used to customize the appearance of
49
+ * the selected item in the trigger button.
50
+ *
51
+ * @param props - Standard HTML template element props
52
+ * @returns A template element marked with the "selected-template" data part
53
+ */
54
+ declare function MenuItemTemplate({
55
+ ...props
56
+ }: ComponentProps<'template'>): react_jsx_runtime21.JSX.Element;
57
+ //#endregion
58
+ //#region src/components/dropdown/Dropdown.d.ts
59
+ declare function Dropdown({
60
+ className,
61
+ ...props
62
+ }: ComponentProps<'div'>): react_jsx_runtime21.JSX.Element;
63
+ declare namespace Dropdown {
64
+ var Menu: typeof Menu;
65
+ var MenuItem: ({
66
+ children,
67
+ value,
68
+ href,
69
+ isExternalLink,
70
+ isSelected,
71
+ ...props
72
+ }: ({
73
+ children?: React.ReactNode;
74
+ value: string;
75
+ isExternalLink?: boolean;
76
+ isSelected?: boolean;
77
+ } & react3.ClassAttributes<HTMLAnchorElement> & react3.AnchorHTMLAttributes<HTMLAnchorElement> & {
78
+ href: string;
79
+ }) | ({
80
+ children?: React.ReactNode;
81
+ value: string;
82
+ isExternalLink?: boolean;
83
+ isSelected?: boolean;
84
+ } & react3.ClassAttributes<HTMLButtonElement> & react3.ButtonHTMLAttributes<HTMLButtonElement> & {
85
+ href?: never;
86
+ })) => react_jsx_runtime21.JSX.Element;
87
+ var MenuItemText: ({
88
+ className,
89
+ subtle,
90
+ ...props
91
+ }: ComponentProps<"span"> & {
92
+ subtle?: boolean;
93
+ }) => react_jsx_runtime21.JSX.Element;
94
+ var MenuItemTemplate: ({
95
+ ...props
96
+ }: ComponentProps<"template">) => react_jsx_runtime21.JSX.Element;
97
+ var Trigger: ({
98
+ className,
99
+ ...props
100
+ }: ComponentProps<"button">) => react_jsx_runtime21.JSX.Element;
101
+ var TriggerSelectedItem: ({
102
+ className,
103
+ ...props
104
+ }: ComponentProps<"div">) => react_jsx_runtime21.JSX.Element;
105
+ var TriggerIcon: ({
106
+ className,
107
+ ...props
108
+ }: ComponentProps<"span">) => react_jsx_runtime21.JSX.Element;
109
+ var Icon: ({
110
+ className,
111
+ ...props
112
+ }: ComponentProps<"div">) => react_jsx_runtime21.JSX.Element;
113
+ }
114
+ //#endregion
115
+ //#region src/components/dropdown/DropdownButton.d.ts
116
+ declare function DropdownButton({
117
+ className,
118
+ ...props
119
+ }: ComponentProps<'div'>): react_jsx_runtime21.JSX.Element;
120
+ declare namespace DropdownButton {
121
+ var Menu: typeof Menu;
122
+ var MenuItem: ({
123
+ children,
124
+ value,
125
+ href,
126
+ isExternalLink,
127
+ isSelected,
128
+ ...props
129
+ }: ({
130
+ children?: React.ReactNode;
131
+ value: string;
132
+ isExternalLink?: boolean;
133
+ isSelected?: boolean;
134
+ } & react3.ClassAttributes<HTMLAnchorElement> & react3.AnchorHTMLAttributes<HTMLAnchorElement> & {
135
+ href: string;
136
+ }) | ({
137
+ children?: React.ReactNode;
138
+ value: string;
139
+ isExternalLink?: boolean;
140
+ isSelected?: boolean;
141
+ } & react3.ClassAttributes<HTMLButtonElement> & react3.ButtonHTMLAttributes<HTMLButtonElement> & {
142
+ href?: never;
143
+ })) => react_jsx_runtime21.JSX.Element;
144
+ var MenuItemText: ({
145
+ className,
146
+ subtle,
147
+ ...props
148
+ }: ComponentProps<"span"> & {
149
+ subtle?: boolean;
150
+ }) => react_jsx_runtime21.JSX.Element;
151
+ var PrimaryAction: ({
152
+ className,
153
+ ...props
154
+ }: ComponentProps<"button">) => react_jsx_runtime21.JSX.Element;
155
+ var PrimaryActionText: ({
156
+ children
157
+ }: {
158
+ children?: React.ReactNode;
159
+ }) => react_jsx_runtime21.JSX.Element;
160
+ var Trigger: ({
161
+ className,
162
+ ...props
163
+ }: ComponentProps<"button">) => react_jsx_runtime21.JSX.Element;
164
+ var Icon: ({
165
+ className,
166
+ ...props
167
+ }: ComponentProps<"div">) => react_jsx_runtime21.JSX.Element;
168
+ }
169
+ //#endregion
170
+ export { Accordion, AccordionProps, Button, ButtonProps, ButtonVariant, Callout, CalloutProps, CalloutVariant, Dropdown, DropdownButton };
package/dist/index.js ADDED
@@ -0,0 +1,180 @@
1
+ import { t as Button } from "./Button-DFAg4M-E.js";
2
+ import { t as Callout } from "./Callout-BGkXD7D2.js";
3
+ import { t as Accordion } from "./Accordion-CL3Oarbz.js";
4
+ import clsx from "clsx";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { CheckIcon, ChevronsUpDown, ExternalLink } from "lucide-react";
7
+
8
+ //#region src/components/dropdown/DropdownMenu.tsx
9
+ function Menu({ className, ...props }) {
10
+ return /* @__PURE__ */ jsx("div", {
11
+ ...props,
12
+ role: "menu",
13
+ "data-state": "closed",
14
+ "data-part": "menu",
15
+ className: clsx("stl-ui-dropdown-menu", className)
16
+ });
17
+ }
18
+ function MenuItemText({ className, subtle, ...props }) {
19
+ return /* @__PURE__ */ jsx("span", {
20
+ ...props,
21
+ "data-part": "item-text",
22
+ className: clsx(`stl-ui-dropdown-menu__item-text`, { "stl-ui-dropdown-menu__item-text--subtle": subtle }, className)
23
+ });
24
+ }
25
+ function MenuItem({ children, value, href, isExternalLink, isSelected, ...props }) {
26
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
27
+ /* @__PURE__ */ jsx("div", {
28
+ className: "stl-ui-dropdown-menu__item-content",
29
+ children
30
+ }),
31
+ isSelected && /* @__PURE__ */ jsx("div", {
32
+ className: "stl-ui-dropdown-menu__item-icon",
33
+ "data-part": "item-selected-icon",
34
+ children: /* @__PURE__ */ jsx(CheckIcon, { size: 16 })
35
+ }),
36
+ isExternalLink && /* @__PURE__ */ jsx("div", {
37
+ className: "stl-ui-dropdown-menu__item-subtle-icon",
38
+ "data-part": "item-external-link-icon",
39
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 16 })
40
+ })
41
+ ] });
42
+ if (href) return /* @__PURE__ */ jsx("a", {
43
+ role: "menuitem",
44
+ "data-part": "item",
45
+ "data-value": value,
46
+ "aria-selected": isSelected,
47
+ href,
48
+ ...props,
49
+ className: clsx("stl-ui-dropdown-menu__item", "stl-ui-dropdown-menu__item-link", props.className),
50
+ children: inner
51
+ });
52
+ return /* @__PURE__ */ jsx("button", {
53
+ ...props,
54
+ role: "menuitem",
55
+ "data-part": "item",
56
+ "data-value": value,
57
+ "aria-selected": isSelected,
58
+ className: clsx("stl-ui-dropdown-menu__item", props.className),
59
+ children: inner
60
+ });
61
+ }
62
+ /**
63
+ * A template component that defines the content to be displayed in the dropdown trigger
64
+ * when a menu item is selected. This template is used to customize the appearance of
65
+ * the selected item in the trigger button.
66
+ *
67
+ * @param props - Standard HTML template element props
68
+ * @returns A template element marked with the "selected-template" data part
69
+ */
70
+ function MenuItemTemplate({ ...props }) {
71
+ return /* @__PURE__ */ jsx("template", {
72
+ "data-part": "selected-template",
73
+ ...props
74
+ });
75
+ }
76
+ Menu.Item = MenuItem;
77
+ Menu.ItemText = MenuItemText;
78
+ Menu.ItemTemplate = MenuItemTemplate;
79
+
80
+ //#endregion
81
+ //#region src/components/dropdown/Dropdown.tsx
82
+ function Trigger$1({ className, ...props }) {
83
+ return /* @__PURE__ */ jsx("button", {
84
+ "aria-label": "Select an option",
85
+ "aria-haspopup": "menu",
86
+ "aria-expanded": "false",
87
+ ...props,
88
+ "data-part": "trigger",
89
+ className: clsx("stl-ui-dropdown__button", className),
90
+ children: props.children
91
+ });
92
+ }
93
+ function TriggerSelectedItem({ className, ...props }) {
94
+ return /* @__PURE__ */ jsx("div", {
95
+ ...props,
96
+ "data-part": "trigger-selected",
97
+ className: clsx("stl-ui-dropdown__trigger-selected", className)
98
+ });
99
+ }
100
+ function TriggerIcon({ className, ...props }) {
101
+ return /* @__PURE__ */ jsx("span", {
102
+ ...props,
103
+ "data-part": "trigger-icon",
104
+ className: clsx("stl-ui-dropdown__trigger-icon", className)
105
+ });
106
+ }
107
+ function Icon$1({ className, ...props }) {
108
+ return /* @__PURE__ */ jsx("div", {
109
+ ...props,
110
+ "data-part": "item-icon",
111
+ className: clsx("stl-ui-dropdown__icon", className)
112
+ });
113
+ }
114
+ function Dropdown({ className, ...props }) {
115
+ return /* @__PURE__ */ jsx("div", {
116
+ ...props,
117
+ className: clsx("stl-ui-dropdown stl-ui-not-prose not-content", className)
118
+ });
119
+ }
120
+ Dropdown.Menu = Menu;
121
+ Dropdown.MenuItem = Menu.Item;
122
+ Dropdown.MenuItemText = Menu.ItemText;
123
+ Dropdown.MenuItemTemplate = Menu.ItemTemplate;
124
+ Dropdown.Trigger = Trigger$1;
125
+ Dropdown.TriggerSelectedItem = TriggerSelectedItem;
126
+ Dropdown.TriggerIcon = TriggerIcon;
127
+ Dropdown.Icon = Icon$1;
128
+
129
+ //#endregion
130
+ //#region src/components/dropdown/DropdownButton.tsx
131
+ function PrimaryActionText({ children }) {
132
+ return /* @__PURE__ */ jsx("span", {
133
+ "data-part": "primary-action-text",
134
+ children
135
+ });
136
+ }
137
+ function PrimaryAction({ className, ...props }) {
138
+ return /* @__PURE__ */ jsx("button", {
139
+ type: "button",
140
+ "aria-label": "Select primary option",
141
+ ...props,
142
+ "data-part": "primary-action",
143
+ className: clsx("stl-ui-dropdown__button stl-ui-dropdown-button--action", className)
144
+ });
145
+ }
146
+ function Trigger({ className, ...props }) {
147
+ return /* @__PURE__ */ jsx("button", {
148
+ type: "button",
149
+ "aria-haspopup": "menu",
150
+ "aria-expanded": "false",
151
+ "aria-label": "Select an option",
152
+ ...props,
153
+ "data-part": "trigger",
154
+ className: clsx("stl-ui-dropdown__button stl-ui-dropdown-button__trigger", className),
155
+ children: /* @__PURE__ */ jsx(ChevronsUpDown, { size: 16 })
156
+ });
157
+ }
158
+ function Icon({ className, ...props }) {
159
+ return /* @__PURE__ */ jsx("div", {
160
+ "data-part": "item-icon",
161
+ ...props,
162
+ className: clsx("stl-ui-dropdown__icon", className)
163
+ });
164
+ }
165
+ function DropdownButton({ className, ...props }) {
166
+ return /* @__PURE__ */ jsx("div", {
167
+ ...props,
168
+ className: clsx("stl-ui-dropdown stl-ui-not-prose not-content", className)
169
+ });
170
+ }
171
+ DropdownButton.Menu = Menu;
172
+ DropdownButton.MenuItem = Menu.Item;
173
+ DropdownButton.MenuItemText = Menu.ItemText;
174
+ DropdownButton.PrimaryAction = PrimaryAction;
175
+ DropdownButton.PrimaryActionText = PrimaryActionText;
176
+ DropdownButton.Trigger = Trigger;
177
+ DropdownButton.Icon = Icon;
178
+
179
+ //#endregion
180
+ export { Accordion, Button, Callout, Dropdown, DropdownButton };
@@ -0,0 +1,23 @@
1
+ //#region src/scripts/dropdown-button.d.ts
2
+ declare function initDropdownButton({
3
+ dropdown,
4
+ onSelect,
5
+ onPrimaryAction
6
+ }: {
7
+ dropdown: Element;
8
+ onSelect: (value: string) => void;
9
+ onPrimaryAction: (primaryActionElement: Element) => void;
10
+ }): void;
11
+ //#endregion
12
+ //#region src/scripts/dropdown.d.ts
13
+ declare function initDropdown({
14
+ root,
15
+ onSelect,
16
+ initialValue
17
+ }: {
18
+ root?: Element | null;
19
+ onSelect?: (value: string) => void;
20
+ initialValue?: string;
21
+ }): void;
22
+ //#endregion
23
+ export { initDropdown, initDropdownButton };