@stainless-api/ui-primitives 0.1.0-beta.44 → 0.1.0-beta.46

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.
@@ -0,0 +1,54 @@
1
+ import { ComponentProps } from "react";
2
+ import * as react_jsx_runtime26 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_runtime26.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_runtime26.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_runtime26.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_runtime26.JSX.Element;
53
+ //#endregion
54
+ export { Menu as t };
@@ -0,0 +1,78 @@
1
+ import clsx from "clsx";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { CheckIcon, ExternalLink } from "lucide-react";
4
+
5
+ //#region src/components/dropdown/DropdownMenu.tsx
6
+ function Menu({ className, ...props }) {
7
+ return /* @__PURE__ */ jsx("div", {
8
+ ...props,
9
+ role: "menu",
10
+ "data-state": "closed",
11
+ "data-part": "menu",
12
+ className: clsx("stl-ui-dropdown-menu", className)
13
+ });
14
+ }
15
+ function MenuItemText({ className, subtle, ...props }) {
16
+ return /* @__PURE__ */ jsx("span", {
17
+ ...props,
18
+ "data-part": "item-text",
19
+ className: clsx(`stl-ui-dropdown-menu__item-text`, { "stl-ui-dropdown-menu__item-text--subtle": subtle }, className)
20
+ });
21
+ }
22
+ function MenuItem({ children, value, href, isExternalLink, isSelected, ...props }) {
23
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
24
+ /* @__PURE__ */ jsx("div", {
25
+ className: "stl-ui-dropdown-menu__item-content",
26
+ children
27
+ }),
28
+ isSelected && /* @__PURE__ */ jsx("div", {
29
+ className: "stl-ui-dropdown-menu__item-icon",
30
+ "data-part": "item-selected-icon",
31
+ children: /* @__PURE__ */ jsx(CheckIcon, { size: 16 })
32
+ }),
33
+ isExternalLink && /* @__PURE__ */ jsx("div", {
34
+ className: "stl-ui-dropdown-menu__item-subtle-icon",
35
+ "data-part": "item-external-link-icon",
36
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 16 })
37
+ })
38
+ ] });
39
+ if (href) return /* @__PURE__ */ jsx("a", {
40
+ role: "menuitem",
41
+ "data-part": "item",
42
+ "data-value": value,
43
+ "aria-selected": isSelected,
44
+ href,
45
+ ...props,
46
+ className: clsx("stl-ui-dropdown-menu__item", "stl-ui-dropdown-menu__item-link", props.className),
47
+ children: inner
48
+ });
49
+ return /* @__PURE__ */ jsx("button", {
50
+ ...props,
51
+ role: "menuitem",
52
+ "data-part": "item",
53
+ "data-value": value,
54
+ "aria-selected": isSelected,
55
+ className: clsx("stl-ui-dropdown-menu__item", props.className),
56
+ children: inner
57
+ });
58
+ }
59
+ /**
60
+ * A template component that defines the content to be displayed in the dropdown trigger
61
+ * when a menu item is selected. This template is used to customize the appearance of
62
+ * the selected item in the trigger button.
63
+ *
64
+ * @param props - Standard HTML template element props
65
+ * @returns A template element marked with the "selected-template" data part
66
+ */
67
+ function MenuItemTemplate({ ...props }) {
68
+ return /* @__PURE__ */ jsx("template", {
69
+ "data-part": "selected-template",
70
+ ...props
71
+ });
72
+ }
73
+ Menu.Item = MenuItem;
74
+ Menu.ItemText = MenuItemText;
75
+ Menu.ItemTemplate = MenuItemTemplate;
76
+
77
+ //#endregion
78
+ export { Menu as t };
@@ -0,0 +1,54 @@
1
+ import { ComponentProps } from "react";
2
+ import * as react_jsx_runtime23 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_runtime23.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_runtime23.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_runtime23.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_runtime23.JSX.Element;
53
+ //#endregion
54
+ export { Menu as t };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime5 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime12 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): react_jsx_runtime5.JSX.Element;
24
+ declare function Button(props: ButtonProps): react_jsx_runtime12.JSX.Element;
25
25
  declare namespace Button {
26
26
  var Label: ({
27
27
  className,
28
28
  ...rest
29
- }: LabelProps) => react_jsx_runtime5.JSX.Element;
29
+ }: LabelProps) => react_jsx_runtime12.JSX.Element;
30
30
  var Icon: ({
31
31
  className,
32
32
  icon: Icon,
33
33
  size,
34
34
  ...rest
35
- }: IconProps) => react_jsx_runtime5.JSX.Element;
35
+ }: IconProps) => react_jsx_runtime12.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 react_jsx_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime23 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): react_jsx_runtime8.JSX.Element;
16
+ }: CalloutProps): react_jsx_runtime23.JSX.Element;
17
17
  //#endregion
18
18
  export { Callout, CalloutProps, CalloutVariant };
@@ -1,17 +1,17 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime24 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
- }): react_jsx_runtime9.JSX.Element;
8
+ }): react_jsx_runtime24.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
- }): react_jsx_runtime9.JSX.Element;
15
+ }): react_jsx_runtime24.JSX.Element;
16
16
  //#endregion
17
17
  export { Step, Steps };
@@ -0,0 +1,63 @@
1
+ import { t as Menu } from "../../DropdownMenu-BdFlK_CM.js";
2
+ import * as react3 from "react";
3
+ import { ComponentProps } from "react";
4
+ import * as react_jsx_runtime15 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_runtime15.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
+ } & react3.ClassAttributes<HTMLAnchorElement> & react3.AnchorHTMLAttributes<HTMLAnchorElement> & {
26
+ href: string;
27
+ }) | ({
28
+ children?: React.ReactNode;
29
+ value: string;
30
+ isExternalLink?: boolean;
31
+ isSelected?: boolean;
32
+ } & react3.ClassAttributes<HTMLButtonElement> & react3.ButtonHTMLAttributes<HTMLButtonElement> & {
33
+ href?: never;
34
+ })) => react_jsx_runtime15.JSX.Element;
35
+ var MenuItemText: ({
36
+ className,
37
+ subtle,
38
+ ...props
39
+ }: ComponentProps<"span"> & {
40
+ subtle?: boolean;
41
+ }) => react_jsx_runtime15.JSX.Element;
42
+ var MenuItemTemplate: ({
43
+ ...props
44
+ }: ComponentProps<"template">) => react_jsx_runtime15.JSX.Element;
45
+ var Trigger: ({
46
+ className,
47
+ ...props
48
+ }: ComponentProps<"button">) => react_jsx_runtime15.JSX.Element;
49
+ var TriggerSelectedItem: ({
50
+ className,
51
+ ...props
52
+ }: ComponentProps<"div">) => react_jsx_runtime15.JSX.Element;
53
+ var TriggerIcon: ({
54
+ className,
55
+ ...props
56
+ }: ComponentProps<"span">) => react_jsx_runtime15.JSX.Element;
57
+ var Icon: ({
58
+ className,
59
+ ...props
60
+ }: ComponentProps<"div">) => react_jsx_runtime15.JSX.Element;
61
+ }
62
+ //#endregion
63
+ export { Dropdown };
@@ -0,0 +1,54 @@
1
+ import { t as Menu } from "../../DropdownMenu-Bj6SQIH-.js";
2
+ import clsx from "clsx";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/components/dropdown/Dropdown.tsx
6
+ function Trigger({ className, ...props }) {
7
+ return /* @__PURE__ */ jsx("button", {
8
+ "aria-label": "Select an option",
9
+ "aria-haspopup": "menu",
10
+ "aria-expanded": "false",
11
+ ...props,
12
+ "data-part": "trigger",
13
+ className: clsx("stl-ui-dropdown__button", className),
14
+ children: props.children
15
+ });
16
+ }
17
+ function TriggerSelectedItem({ className, ...props }) {
18
+ return /* @__PURE__ */ jsx("div", {
19
+ ...props,
20
+ "data-part": "trigger-selected",
21
+ className: clsx("stl-ui-dropdown__trigger-selected", className)
22
+ });
23
+ }
24
+ function TriggerIcon({ className, ...props }) {
25
+ return /* @__PURE__ */ jsx("span", {
26
+ ...props,
27
+ "data-part": "trigger-icon",
28
+ className: clsx("stl-ui-dropdown__trigger-icon", className)
29
+ });
30
+ }
31
+ function Icon({ className, ...props }) {
32
+ return /* @__PURE__ */ jsx("div", {
33
+ ...props,
34
+ "data-part": "item-icon",
35
+ className: clsx("stl-ui-dropdown__icon", className)
36
+ });
37
+ }
38
+ function Dropdown({ className, ...props }) {
39
+ return /* @__PURE__ */ jsx("div", {
40
+ ...props,
41
+ className: clsx("stl-ui-dropdown stl-ui-not-prose not-content", className)
42
+ });
43
+ }
44
+ Dropdown.Menu = Menu;
45
+ Dropdown.MenuItem = Menu.Item;
46
+ Dropdown.MenuItemText = Menu.ItemText;
47
+ Dropdown.MenuItemTemplate = Menu.ItemTemplate;
48
+ Dropdown.Trigger = Trigger;
49
+ Dropdown.TriggerSelectedItem = TriggerSelectedItem;
50
+ Dropdown.TriggerIcon = TriggerIcon;
51
+ Dropdown.Icon = Icon;
52
+
53
+ //#endregion
54
+ export { Dropdown };
@@ -0,0 +1,61 @@
1
+ import { t as Menu } from "../../DropdownMenu-BdFlK_CM.js";
2
+ import * as react0 from "react";
3
+ import { ComponentProps } from "react";
4
+ import * as react_jsx_runtime5 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_runtime5.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
+ } & react0.ClassAttributes<HTMLAnchorElement> & react0.AnchorHTMLAttributes<HTMLAnchorElement> & {
26
+ href: string;
27
+ }) | ({
28
+ children?: React.ReactNode;
29
+ value: string;
30
+ isExternalLink?: boolean;
31
+ isSelected?: boolean;
32
+ } & react0.ClassAttributes<HTMLButtonElement> & react0.ButtonHTMLAttributes<HTMLButtonElement> & {
33
+ href?: never;
34
+ })) => react_jsx_runtime5.JSX.Element;
35
+ var MenuItemText: ({
36
+ className,
37
+ subtle,
38
+ ...props
39
+ }: ComponentProps<"span"> & {
40
+ subtle?: boolean;
41
+ }) => react_jsx_runtime5.JSX.Element;
42
+ var PrimaryAction: ({
43
+ className,
44
+ ...props
45
+ }: ComponentProps<"button">) => react_jsx_runtime5.JSX.Element;
46
+ var PrimaryActionText: ({
47
+ children
48
+ }: {
49
+ children?: React.ReactNode;
50
+ }) => react_jsx_runtime5.JSX.Element;
51
+ var Trigger: ({
52
+ className,
53
+ ...props
54
+ }: ComponentProps<"button">) => react_jsx_runtime5.JSX.Element;
55
+ var Icon: ({
56
+ className,
57
+ ...props
58
+ }: ComponentProps<"div">) => react_jsx_runtime5.JSX.Element;
59
+ }
60
+ //#endregion
61
+ export { DropdownButton };
@@ -0,0 +1,56 @@
1
+ import { t as Menu } from "../../DropdownMenu-Bj6SQIH-.js";
2
+ import clsx from "clsx";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { ChevronsUpDown } from "lucide-react";
5
+
6
+ //#region src/components/dropdown/DropdownButton.tsx
7
+ function PrimaryActionText({ children }) {
8
+ return /* @__PURE__ */ jsx("span", {
9
+ "data-part": "primary-action-text",
10
+ children
11
+ });
12
+ }
13
+ function PrimaryAction({ className, ...props }) {
14
+ return /* @__PURE__ */ jsx("button", {
15
+ type: "button",
16
+ "aria-label": "Select primary option",
17
+ ...props,
18
+ "data-part": "primary-action",
19
+ className: clsx("stl-ui-dropdown__button stl-ui-dropdown-button--action", className)
20
+ });
21
+ }
22
+ function Trigger({ className, ...props }) {
23
+ return /* @__PURE__ */ jsx("button", {
24
+ type: "button",
25
+ "aria-haspopup": "menu",
26
+ "aria-expanded": "false",
27
+ "aria-label": "Select an option",
28
+ ...props,
29
+ "data-part": "trigger",
30
+ className: clsx("stl-ui-dropdown__button stl-ui-dropdown-button__trigger", className),
31
+ children: /* @__PURE__ */ jsx(ChevronsUpDown, { size: 16 })
32
+ });
33
+ }
34
+ function Icon({ className, ...props }) {
35
+ return /* @__PURE__ */ jsx("div", {
36
+ "data-part": "item-icon",
37
+ ...props,
38
+ className: clsx("stl-ui-dropdown__icon", className)
39
+ });
40
+ }
41
+ function DropdownButton({ className, ...props }) {
42
+ return /* @__PURE__ */ jsx("div", {
43
+ ...props,
44
+ className: clsx("stl-ui-dropdown stl-ui-not-prose not-content", className)
45
+ });
46
+ }
47
+ DropdownButton.Menu = Menu;
48
+ DropdownButton.MenuItem = Menu.Item;
49
+ DropdownButton.MenuItemText = Menu.ItemText;
50
+ DropdownButton.PrimaryAction = PrimaryAction;
51
+ DropdownButton.PrimaryActionText = PrimaryActionText;
52
+ DropdownButton.Trigger = Trigger;
53
+ DropdownButton.Icon = Icon;
54
+
55
+ //#endregion
56
+ export { DropdownButton };
@@ -0,0 +1,2 @@
1
+ import { t as Menu } from "../../DropdownMenu-BdFlK_CM.js";
2
+ export { Menu };
@@ -0,0 +1,3 @@
1
+ import { t as Menu } from "../../DropdownMenu-Bj6SQIH-.js";
2
+
3
+ export { Menu };
@@ -0,0 +1,7 @@
1
+ import { IconNode } from "lucide-react";
2
+
3
+ //#region src/components/icons/Function.d.ts
4
+ declare const __iconNode: IconNode;
5
+ declare const FunctionIcon: react.ForwardRefExoticComponent<any>;
6
+ //#endregion
7
+ export { FunctionIcon, __iconNode };
@@ -0,0 +1,8 @@
1
+ import { createLucideIcon } from "lucide-react";
2
+
3
+ //#region src/components/icons/Function.tsx
4
+ const __iconNode = [["path", { d: "m 7.5982756,10.85526 h 8.3632754 m -8.3632756,8.509999 c 2.9344826,0 4.1082756,-1.467241 4.1082756,-4.108276 V 9.0945701 c 0,-2.9344826 1.467243,-4.8418966 4.695174,-4.4017241" }]];
5
+ const FunctionIcon = createLucideIcon("function", __iconNode);
6
+
7
+ //#endregion
8
+ export { FunctionIcon, __iconNode };
@@ -0,0 +1,2 @@
1
+ import { FunctionIcon } from "./Function.js";
2
+ export { FunctionIcon };
@@ -0,0 +1,3 @@
1
+ import { FunctionIcon } from "./Function.js";
2
+
3
+ export { FunctionIcon };
package/dist/index.d.ts CHANGED
@@ -3,170 +3,7 @@ import { Badge, BadgeIntent, HTTPMethod, getHttpMethod } from "./components/Badg
3
3
  import { Button, ButtonProps, ButtonVariant } from "./components/Button.js";
4
4
  import { Callout, CalloutProps, CalloutVariant } from "./components/Callout.js";
5
5
  import { Step, Steps } from "./components/Steps.js";
6
- import * as react3 from "react";
7
- import { ComponentProps } from "react";
8
- import * as react_jsx_runtime26 from "react/jsx-runtime";
9
-
10
- //#region src/components/dropdown/DropdownMenu.d.ts
11
- declare function Menu({
12
- className,
13
- ...props
14
- }: ComponentProps<'div'>): react_jsx_runtime26.JSX.Element;
15
- declare namespace Menu {
16
- var Item: typeof MenuItem;
17
- var ItemText: typeof MenuItemText;
18
- var ItemTemplate: typeof MenuItemTemplate;
19
- }
20
- declare function MenuItemText({
21
- className,
22
- subtle,
23
- ...props
24
- }: ComponentProps<'span'> & {
25
- subtle?: boolean;
26
- }): react_jsx_runtime26.JSX.Element;
27
- type MenuItemBaseProps = {
28
- children?: React.ReactNode;
29
- value: string;
30
- isExternalLink?: boolean;
31
- isSelected?: boolean;
32
- };
33
- type MenuItemWithHref = MenuItemBaseProps & ComponentProps<'a'> & {
34
- href: string;
35
- };
36
- type MenuItemWithoutHref = MenuItemBaseProps & ComponentProps<'button'> & {
37
- href?: never;
38
- };
39
- type MenuItemProps = MenuItemWithHref | MenuItemWithoutHref;
40
- declare function MenuItem({
41
- children,
42
- value,
43
- href,
44
- isExternalLink,
45
- isSelected,
46
- ...props
47
- }: MenuItemProps): react_jsx_runtime26.JSX.Element;
48
- /**
49
- * A template component that defines the content to be displayed in the dropdown trigger
50
- * when a menu item is selected. This template is used to customize the appearance of
51
- * the selected item in the trigger button.
52
- *
53
- * @param props - Standard HTML template element props
54
- * @returns A template element marked with the "selected-template" data part
55
- */
56
- declare function MenuItemTemplate({
57
- ...props
58
- }: ComponentProps<'template'>): react_jsx_runtime26.JSX.Element;
59
- //#endregion
60
- //#region src/components/dropdown/Dropdown.d.ts
61
- declare function Dropdown({
62
- className,
63
- ...props
64
- }: ComponentProps<'div'>): react_jsx_runtime26.JSX.Element;
65
- declare namespace Dropdown {
66
- var Menu: typeof Menu;
67
- var MenuItem: ({
68
- children,
69
- value,
70
- href,
71
- isExternalLink,
72
- isSelected,
73
- ...props
74
- }: ({
75
- children?: React.ReactNode;
76
- value: string;
77
- isExternalLink?: boolean;
78
- isSelected?: boolean;
79
- } & react3.ClassAttributes<HTMLAnchorElement> & react3.AnchorHTMLAttributes<HTMLAnchorElement> & {
80
- href: string;
81
- }) | ({
82
- children?: React.ReactNode;
83
- value: string;
84
- isExternalLink?: boolean;
85
- isSelected?: boolean;
86
- } & react3.ClassAttributes<HTMLButtonElement> & react3.ButtonHTMLAttributes<HTMLButtonElement> & {
87
- href?: never;
88
- })) => react_jsx_runtime26.JSX.Element;
89
- var MenuItemText: ({
90
- className,
91
- subtle,
92
- ...props
93
- }: ComponentProps<"span"> & {
94
- subtle?: boolean;
95
- }) => react_jsx_runtime26.JSX.Element;
96
- var MenuItemTemplate: ({
97
- ...props
98
- }: ComponentProps<"template">) => react_jsx_runtime26.JSX.Element;
99
- var Trigger: ({
100
- className,
101
- ...props
102
- }: ComponentProps<"button">) => react_jsx_runtime26.JSX.Element;
103
- var TriggerSelectedItem: ({
104
- className,
105
- ...props
106
- }: ComponentProps<"div">) => react_jsx_runtime26.JSX.Element;
107
- var TriggerIcon: ({
108
- className,
109
- ...props
110
- }: ComponentProps<"span">) => react_jsx_runtime26.JSX.Element;
111
- var Icon: ({
112
- className,
113
- ...props
114
- }: ComponentProps<"div">) => react_jsx_runtime26.JSX.Element;
115
- }
116
- //#endregion
117
- //#region src/components/dropdown/DropdownButton.d.ts
118
- declare function DropdownButton({
119
- className,
120
- ...props
121
- }: ComponentProps<'div'>): react_jsx_runtime26.JSX.Element;
122
- declare namespace DropdownButton {
123
- var Menu: typeof Menu;
124
- var MenuItem: ({
125
- children,
126
- value,
127
- href,
128
- isExternalLink,
129
- isSelected,
130
- ...props
131
- }: ({
132
- children?: React.ReactNode;
133
- value: string;
134
- isExternalLink?: boolean;
135
- isSelected?: boolean;
136
- } & react3.ClassAttributes<HTMLAnchorElement> & react3.AnchorHTMLAttributes<HTMLAnchorElement> & {
137
- href: string;
138
- }) | ({
139
- children?: React.ReactNode;
140
- value: string;
141
- isExternalLink?: boolean;
142
- isSelected?: boolean;
143
- } & react3.ClassAttributes<HTMLButtonElement> & react3.ButtonHTMLAttributes<HTMLButtonElement> & {
144
- href?: never;
145
- })) => react_jsx_runtime26.JSX.Element;
146
- var MenuItemText: ({
147
- className,
148
- subtle,
149
- ...props
150
- }: ComponentProps<"span"> & {
151
- subtle?: boolean;
152
- }) => react_jsx_runtime26.JSX.Element;
153
- var PrimaryAction: ({
154
- className,
155
- ...props
156
- }: ComponentProps<"button">) => react_jsx_runtime26.JSX.Element;
157
- var PrimaryActionText: ({
158
- children
159
- }: {
160
- children?: React.ReactNode;
161
- }) => react_jsx_runtime26.JSX.Element;
162
- var Trigger: ({
163
- className,
164
- ...props
165
- }: ComponentProps<"button">) => react_jsx_runtime26.JSX.Element;
166
- var Icon: ({
167
- className,
168
- ...props
169
- }: ComponentProps<"div">) => react_jsx_runtime26.JSX.Element;
170
- }
171
- //#endregion
6
+ import "./DropdownMenu-BdFlK_CM.js";
7
+ import { Dropdown } from "./components/dropdown/Dropdown.js";
8
+ import { DropdownButton } from "./components/dropdown/DropdownButton.js";
172
9
  export { Accordion, AccordionProps, Badge, BadgeIntent, Button, ButtonProps, ButtonVariant, Callout, CalloutProps, CalloutVariant, Dropdown, DropdownButton, HTTPMethod, Step, Steps, getHttpMethod };
package/dist/index.js CHANGED
@@ -1,182 +1,10 @@
1
1
  import { Button } from "./components/Button.js";
2
+ import "./DropdownMenu-Bj6SQIH-.js";
3
+ import { Dropdown } from "./components/dropdown/Dropdown.js";
4
+ import { DropdownButton } from "./components/dropdown/DropdownButton.js";
2
5
  import { Callout } from "./components/Callout.js";
3
6
  import { Accordion } from "./components/Accordion.js";
4
7
  import { Step, Steps } from "./components/Steps.js";
5
8
  import { Badge, getHttpMethod } from "./components/Badge.js";
6
- import clsx from "clsx";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- import { CheckIcon, ChevronsUpDown, ExternalLink } from "lucide-react";
9
9
 
10
- //#region src/components/dropdown/DropdownMenu.tsx
11
- function Menu({ className, ...props }) {
12
- return /* @__PURE__ */ jsx("div", {
13
- ...props,
14
- role: "menu",
15
- "data-state": "closed",
16
- "data-part": "menu",
17
- className: clsx("stl-ui-dropdown-menu", className)
18
- });
19
- }
20
- function MenuItemText({ className, subtle, ...props }) {
21
- return /* @__PURE__ */ jsx("span", {
22
- ...props,
23
- "data-part": "item-text",
24
- className: clsx(`stl-ui-dropdown-menu__item-text`, { "stl-ui-dropdown-menu__item-text--subtle": subtle }, className)
25
- });
26
- }
27
- function MenuItem({ children, value, href, isExternalLink, isSelected, ...props }) {
28
- const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
29
- /* @__PURE__ */ jsx("div", {
30
- className: "stl-ui-dropdown-menu__item-content",
31
- children
32
- }),
33
- isSelected && /* @__PURE__ */ jsx("div", {
34
- className: "stl-ui-dropdown-menu__item-icon",
35
- "data-part": "item-selected-icon",
36
- children: /* @__PURE__ */ jsx(CheckIcon, { size: 16 })
37
- }),
38
- isExternalLink && /* @__PURE__ */ jsx("div", {
39
- className: "stl-ui-dropdown-menu__item-subtle-icon",
40
- "data-part": "item-external-link-icon",
41
- children: /* @__PURE__ */ jsx(ExternalLink, { size: 16 })
42
- })
43
- ] });
44
- if (href) return /* @__PURE__ */ jsx("a", {
45
- role: "menuitem",
46
- "data-part": "item",
47
- "data-value": value,
48
- "aria-selected": isSelected,
49
- href,
50
- ...props,
51
- className: clsx("stl-ui-dropdown-menu__item", "stl-ui-dropdown-menu__item-link", props.className),
52
- children: inner
53
- });
54
- return /* @__PURE__ */ jsx("button", {
55
- ...props,
56
- role: "menuitem",
57
- "data-part": "item",
58
- "data-value": value,
59
- "aria-selected": isSelected,
60
- className: clsx("stl-ui-dropdown-menu__item", props.className),
61
- children: inner
62
- });
63
- }
64
- /**
65
- * A template component that defines the content to be displayed in the dropdown trigger
66
- * when a menu item is selected. This template is used to customize the appearance of
67
- * the selected item in the trigger button.
68
- *
69
- * @param props - Standard HTML template element props
70
- * @returns A template element marked with the "selected-template" data part
71
- */
72
- function MenuItemTemplate({ ...props }) {
73
- return /* @__PURE__ */ jsx("template", {
74
- "data-part": "selected-template",
75
- ...props
76
- });
77
- }
78
- Menu.Item = MenuItem;
79
- Menu.ItemText = MenuItemText;
80
- Menu.ItemTemplate = MenuItemTemplate;
81
-
82
- //#endregion
83
- //#region src/components/dropdown/Dropdown.tsx
84
- function Trigger$1({ className, ...props }) {
85
- return /* @__PURE__ */ jsx("button", {
86
- "aria-label": "Select an option",
87
- "aria-haspopup": "menu",
88
- "aria-expanded": "false",
89
- ...props,
90
- "data-part": "trigger",
91
- className: clsx("stl-ui-dropdown__button", className),
92
- children: props.children
93
- });
94
- }
95
- function TriggerSelectedItem({ className, ...props }) {
96
- return /* @__PURE__ */ jsx("div", {
97
- ...props,
98
- "data-part": "trigger-selected",
99
- className: clsx("stl-ui-dropdown__trigger-selected", className)
100
- });
101
- }
102
- function TriggerIcon({ className, ...props }) {
103
- return /* @__PURE__ */ jsx("span", {
104
- ...props,
105
- "data-part": "trigger-icon",
106
- className: clsx("stl-ui-dropdown__trigger-icon", className)
107
- });
108
- }
109
- function Icon$1({ className, ...props }) {
110
- return /* @__PURE__ */ jsx("div", {
111
- ...props,
112
- "data-part": "item-icon",
113
- className: clsx("stl-ui-dropdown__icon", className)
114
- });
115
- }
116
- function Dropdown({ className, ...props }) {
117
- return /* @__PURE__ */ jsx("div", {
118
- ...props,
119
- className: clsx("stl-ui-dropdown stl-ui-not-prose not-content", className)
120
- });
121
- }
122
- Dropdown.Menu = Menu;
123
- Dropdown.MenuItem = Menu.Item;
124
- Dropdown.MenuItemText = Menu.ItemText;
125
- Dropdown.MenuItemTemplate = Menu.ItemTemplate;
126
- Dropdown.Trigger = Trigger$1;
127
- Dropdown.TriggerSelectedItem = TriggerSelectedItem;
128
- Dropdown.TriggerIcon = TriggerIcon;
129
- Dropdown.Icon = Icon$1;
130
-
131
- //#endregion
132
- //#region src/components/dropdown/DropdownButton.tsx
133
- function PrimaryActionText({ children }) {
134
- return /* @__PURE__ */ jsx("span", {
135
- "data-part": "primary-action-text",
136
- children
137
- });
138
- }
139
- function PrimaryAction({ className, ...props }) {
140
- return /* @__PURE__ */ jsx("button", {
141
- type: "button",
142
- "aria-label": "Select primary option",
143
- ...props,
144
- "data-part": "primary-action",
145
- className: clsx("stl-ui-dropdown__button stl-ui-dropdown-button--action", className)
146
- });
147
- }
148
- function Trigger({ className, ...props }) {
149
- return /* @__PURE__ */ jsx("button", {
150
- type: "button",
151
- "aria-haspopup": "menu",
152
- "aria-expanded": "false",
153
- "aria-label": "Select an option",
154
- ...props,
155
- "data-part": "trigger",
156
- className: clsx("stl-ui-dropdown__button stl-ui-dropdown-button__trigger", className),
157
- children: /* @__PURE__ */ jsx(ChevronsUpDown, { size: 16 })
158
- });
159
- }
160
- function Icon({ className, ...props }) {
161
- return /* @__PURE__ */ jsx("div", {
162
- "data-part": "item-icon",
163
- ...props,
164
- className: clsx("stl-ui-dropdown__icon", className)
165
- });
166
- }
167
- function DropdownButton({ className, ...props }) {
168
- return /* @__PURE__ */ jsx("div", {
169
- ...props,
170
- className: clsx("stl-ui-dropdown stl-ui-not-prose not-content", className)
171
- });
172
- }
173
- DropdownButton.Menu = Menu;
174
- DropdownButton.MenuItem = Menu.Item;
175
- DropdownButton.MenuItemText = Menu.ItemText;
176
- DropdownButton.PrimaryAction = PrimaryAction;
177
- DropdownButton.PrimaryActionText = PrimaryActionText;
178
- DropdownButton.Trigger = Trigger;
179
- DropdownButton.Icon = Icon;
180
-
181
- //#endregion
182
10
  export { Accordion, Badge, Button, Callout, Dropdown, DropdownButton, Step, Steps, getHttpMethod };
package/dist/styles.css CHANGED
@@ -87,6 +87,11 @@ body {
87
87
  font-weight: 500;
88
88
  line-height: var(--stl-typography-line-height-heading);
89
89
  font-family: var(--stl-typography-font-heading);
90
+
91
+ text-wrap: pretty;
92
+ &:where(h1, h2, h3) {
93
+ text-wrap: balance;
94
+ }
90
95
  }
91
96
 
92
97
  :where(h1:not(.stl-ui-not-prose *), .stl-ui-not-prose .stl-ui-prose h1) {
@@ -188,7 +193,7 @@ body {
188
193
  letter-spacing: normal;
189
194
 
190
195
  /* inline code */
191
- &:where(:not(pre > &)) {
196
+ &:where(:not(pre > code)) {
192
197
  color: var(--stl-color-foreground);
193
198
  padding: 0 0.2em;
194
199
  background-color: rgb(from var(--stl-color-foreground) r g b / 0.1);
@@ -1213,8 +1218,7 @@ a.stl-ui-button {
1213
1218
  }
1214
1219
  &.stl-ui-badge--intent-info {
1215
1220
  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);
1221
+ color: var(--stl-color-foreground);
1218
1222
  border-color: var(--stl-color-border);
1219
1223
  &.stl-ui-badge--solid {
1220
1224
  background-color: var(--stl-color-inverse-background);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stainless-api/ui-primitives",
3
- "version": "0.1.0-beta.44",
3
+ "version": "0.1.0-beta.46",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,9 +21,9 @@
21
21
  "@types/react-dom": "^19.2.3",
22
22
  "react": "^19.2.3",
23
23
  "react-dom": "^19.2.3",
24
- "rolldown": "1.0.0-beta.60",
24
+ "rolldown": "1.0.0-rc.1",
25
25
  "sass": "^1.97.2",
26
- "tsdown": "^0.20.0-beta.3",
26
+ "tsdown": "^0.20.0",
27
27
  "typescript": "5.9.3",
28
28
  "@stainless/eslint-config": "0.1.0-beta.1"
29
29
  },
@@ -42,6 +42,9 @@
42
42
  },
43
43
  "./*": {
44
44
  "default": "./dist/*"
45
+ },
46
+ "./icons": {
47
+ "default": "./dist/components/icons/index.js"
45
48
  }
46
49
  },
47
50
  "scripts": {