@stainless-api/ui-primitives 0.1.0-beta.17 → 0.1.0-beta.18

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.
@@ -1,35 +1,5 @@
1
1
 
2
2
  
3
- > @stainless-api/ui-primitives@0.1.0-beta.10 build /Users/maxfreundlich/code/work/stl-api-docs/packages/ui-primitives
4
- > tsdown
3
+ > @stainless-api/ui-primitives@0.1.0-beta.10 build /Users/segphault/Development/stl-api-docs/packages/ui-primitives
4
+ > tsc
5
5
 
6
- ℹ tsdown v0.15.12 powered by rolldown v1.0.0-beta.45
7
- ℹ Using tsdown config: /Users/maxfreundlich/code/work/stl-api-docs/packages/ui-primitives/tsdown.config.ts
8
- ℹ entry: src/index.ts, src/styles.css, src/components/Accordion.tsx, src/components/Button.tsx, src/components/Callout.tsx, src/components/DropdownButton.tsx, src/scripts/index.ts
9
- ℹ tsconfig: tsconfig.json
10
- ℹ Build start
11
- ℹ Cleaning 24 files
12
- ℹ dist/scripts/index.js  1.29 kB │ gzip: 0.51 kB
13
- ℹ dist/index.js  0.29 kB │ gzip: 0.16 kB
14
- ℹ dist/components/DropdownButton.js  0.10 kB │ gzip: 0.09 kB
15
- ℹ dist/components/Accordion.js  0.08 kB │ gzip: 0.08 kB
16
- ℹ dist/components/Callout.js  0.07 kB │ gzip: 0.08 kB
17
- ℹ dist/components/Button.js  0.07 kB │ gzip: 0.08 kB
18
- ℹ dist/styles.js  0.01 kB │ gzip: 0.03 kB
19
- ℹ dist/styles.css 40.23 kB │ gzip: 6.91 kB
20
- ℹ dist/DropdownButton-CStYzJ6s.js  2.70 kB │ gzip: 0.70 kB
21
- ℹ dist/Button-DBhd6kU7.js  1.51 kB │ gzip: 0.55 kB
22
- ℹ dist/Callout-UZQRuCQ5.js  0.82 kB │ gzip: 0.44 kB
23
- ℹ dist/Accordion-DLQE3Td6.js  0.80 kB │ gzip: 0.30 kB
24
- ℹ dist/index.d.ts  0.46 kB │ gzip: 0.20 kB
25
- ℹ dist/scripts/index.d.ts  0.30 kB │ gzip: 0.19 kB
26
- ℹ dist/components/Callout.d.ts  0.14 kB │ gzip: 0.11 kB
27
- ℹ dist/components/Button.d.ts  0.14 kB │ gzip: 0.10 kB
28
- ℹ dist/components/Accordion.d.ts  0.12 kB │ gzip: 0.09 kB
29
- ℹ dist/components/DropdownButton.d.ts  0.10 kB │ gzip: 0.08 kB
30
- ℹ dist/DropdownButton-CNJ5NyBS.d.ts  1.40 kB │ gzip: 0.42 kB
31
- ℹ dist/Button-sTZ6xvkU.d.ts  1.27 kB │ gzip: 0.52 kB
32
- ℹ dist/Accordion-_dikpfLR.d.ts  0.74 kB │ gzip: 0.31 kB
33
- ℹ dist/Callout-Dsp2nbSy.d.ts  0.57 kB │ gzip: 0.33 kB
34
- ℹ 22 files, total: 53.22 kB
35
- ✔ Build complete in 756ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @stainless-api/ui-primitives
2
2
 
3
+ ## 0.1.0-beta.18
4
+
5
+ ### Minor Changes
6
+
7
+ - c635741: Updated worker and fixed docs-ui jsx issue
8
+
3
9
  ## 0.1.0-beta.17
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stainless-api/ui-primitives",
3
- "version": "0.1.0-beta.17",
3
+ "version": "0.1.0-beta.18",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,6 +32,6 @@
32
32
  "react": "^19.2.0",
33
33
  "react-dom": "^19.2.0",
34
34
  "typescript": "5.9.3",
35
- "@stainless/eslint-config": "0.0.0"
35
+ "@stainless/eslint-config": "0.1.0-beta.0"
36
36
  }
37
37
  }
@@ -1,31 +0,0 @@
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 };
@@ -1,26 +0,0 @@
1
- import React from "react";
2
- import * as react_jsx_runtime8 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_runtime8.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_runtime8.JSX.Element;
20
- declare function AccordionGroup({
21
- className,
22
- children,
23
- ...props
24
- }: React.ComponentProps<'div'>): react_jsx_runtime8.JSX.Element;
25
- //#endregion
26
- export { AccordionProps as n, Accordion as t };
@@ -1,51 +0,0 @@
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 };
@@ -1,38 +0,0 @@
1
- import React from "react";
2
- import * as react_jsx_runtime11 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_runtime11.JSX.Element;
21
- declare namespace Button {
22
- var Label: ({
23
- className,
24
- ...rest
25
- }: LabelProps) => react_jsx_runtime11.JSX.Element;
26
- var Icon: ({
27
- className,
28
- icon: Icon,
29
- size
30
- }: IconProps) => react_jsx_runtime11.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 };
@@ -1,18 +0,0 @@
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 { CalloutProps as n, CalloutVariant as r, Callout as t };
@@ -1,28 +0,0 @@
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 };
@@ -1,53 +0,0 @@
1
- import { ComponentPropsWithoutRef } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
-
4
- //#region src/components/DropdownButton.d.ts
5
- declare function DropdownButton({
6
- id,
7
- className,
8
- ...props
9
- }: ComponentPropsWithoutRef<'div'> & {
10
- id: string;
11
- }): react_jsx_runtime0.JSX.Element;
12
- declare namespace DropdownButton {
13
- var Menu: ({
14
- className,
15
- ...props
16
- }: ComponentPropsWithoutRef<"div">) => react_jsx_runtime0.JSX.Element;
17
- var MenuItem: ({
18
- children,
19
- value,
20
- isExternalLink,
21
- ...props
22
- }: ComponentPropsWithoutRef<"div"> & {
23
- children?: React.ReactNode;
24
- value: string;
25
- isExternalLink?: boolean;
26
- }) => react_jsx_runtime0.JSX.Element;
27
- var MenuItemIcon: ({
28
- className,
29
- ...props
30
- }: ComponentPropsWithoutRef<"div">) => react_jsx_runtime0.JSX.Element;
31
- var MenuItemText: ({
32
- className,
33
- subtle,
34
- ...props
35
- }: ComponentPropsWithoutRef<"span"> & {
36
- subtle?: boolean;
37
- }) => react_jsx_runtime0.JSX.Element;
38
- var PrimaryAction: ({
39
- className,
40
- ...props
41
- }: ComponentPropsWithoutRef<"button">) => react_jsx_runtime0.JSX.Element;
42
- var PrimaryActionText: ({
43
- children
44
- }: {
45
- children?: React.ReactNode;
46
- }) => react_jsx_runtime0.JSX.Element;
47
- var Trigger: ({
48
- className,
49
- ...props
50
- }: ComponentPropsWithoutRef<"button">) => react_jsx_runtime0.JSX.Element;
51
- }
52
- //#endregion
53
- export { DropdownButton as t };
@@ -1,83 +0,0 @@
1
- import clsx from "clsx";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { ChevronsUpDown, ExternalLink } from "lucide-react";
4
-
5
- //#region src/components/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
- "data-part": "primary-action",
15
- ...props,
16
- className: clsx("stl-ui-dropdown-button__button stl-ui-dropdown-button--action", className)
17
- });
18
- }
19
- function Trigger({ className,...props }) {
20
- return /* @__PURE__ */ jsx("button", {
21
- "aria-haspopup": "listbox",
22
- "aria-expanded": "false",
23
- "data-part": "trigger",
24
- ...props,
25
- className: clsx("stl-ui-dropdown-button__button stl-ui-dropdown-button__trigger", className),
26
- children: /* @__PURE__ */ jsx(ChevronsUpDown, { size: 16 })
27
- });
28
- }
29
- function Menu({ className,...props }) {
30
- return /* @__PURE__ */ jsx("div", {
31
- "data-state": "closed",
32
- "data-part": "menu",
33
- ...props,
34
- className: clsx("stl-ui-dropdown-button__menu", className)
35
- });
36
- }
37
- function MenuItemIcon({ className,...props }) {
38
- return /* @__PURE__ */ jsx("div", {
39
- "data-part": "item-icon",
40
- ...props,
41
- className: clsx("stl-ui-dropdown-button__menu-item-icon", className)
42
- });
43
- }
44
- function MenuItemText({ className, subtle,...props }) {
45
- return /* @__PURE__ */ jsx("span", {
46
- "data-part": "item-text",
47
- className: clsx(`stl-ui-dropdown-button__menu-item-text`, { "stl-ui-dropdown-button__menu-item-text--subtle": subtle }, className),
48
- ...props
49
- });
50
- }
51
- function MenuItem({ children, value, isExternalLink,...props }) {
52
- return /* @__PURE__ */ jsxs("div", {
53
- "data-part": "item",
54
- "data-value": value,
55
- ...props,
56
- className: clsx("stl-ui-dropdown-button__menu-item", props.className),
57
- children: [/* @__PURE__ */ jsx("div", {
58
- className: "stl-ui-dropdown-button__menu-item-content",
59
- children
60
- }), isExternalLink && /* @__PURE__ */ jsx("div", {
61
- className: "stl-ui-dropdown-button__menu-item-external-link-icon",
62
- "data-part": "item-external-link-icon",
63
- children: /* @__PURE__ */ jsx(ExternalLink, { size: 16 })
64
- })]
65
- });
66
- }
67
- function DropdownButton({ id, className,...props }) {
68
- return /* @__PURE__ */ jsx("div", {
69
- id,
70
- ...props,
71
- className: clsx("stl-ui-dropdown-button stl-ui-not-prose not-content", className)
72
- });
73
- }
74
- DropdownButton.Menu = Menu;
75
- DropdownButton.MenuItem = MenuItem;
76
- DropdownButton.MenuItemIcon = MenuItemIcon;
77
- DropdownButton.MenuItemText = MenuItemText;
78
- DropdownButton.PrimaryAction = PrimaryAction;
79
- DropdownButton.PrimaryActionText = PrimaryActionText;
80
- DropdownButton.Trigger = Trigger;
81
-
82
- //#endregion
83
- export { DropdownButton as t };
@@ -1,2 +0,0 @@
1
- import { n as AccordionProps, t as Accordion } from "../Accordion-_dikpfLR.js";
2
- export { Accordion, AccordionProps };
@@ -1,3 +0,0 @@
1
- import { t as Accordion } from "../Accordion-DLQE3Td6.js";
2
-
3
- export { Accordion };
@@ -1,2 +0,0 @@
1
- import { n as ButtonProps, r as ButtonVariant, t as Button } from "../Button-sTZ6xvkU.js";
2
- export { Button, ButtonProps, ButtonVariant };
@@ -1,3 +0,0 @@
1
- import { t as Button } from "../Button-DBhd6kU7.js";
2
-
3
- export { Button };
@@ -1,2 +0,0 @@
1
- import { n as CalloutProps, r as CalloutVariant, t as Callout } from "../Callout-Dsp2nbSy.js";
2
- export { Callout, CalloutProps, CalloutVariant };
@@ -1,3 +0,0 @@
1
- import { t as Callout } from "../Callout-UZQRuCQ5.js";
2
-
3
- export { Callout };
@@ -1,2 +0,0 @@
1
- import { t as DropdownButton } from "../DropdownButton-CNJ5NyBS.js";
2
- export { DropdownButton };
@@ -1,3 +0,0 @@
1
- import { t as DropdownButton } from "../DropdownButton-CStYzJ6s.js";
2
-
3
- export { DropdownButton };
package/dist/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { n as AccordionProps, t as Accordion } from "./Accordion-_dikpfLR.js";
2
- import { n as ButtonProps, r as ButtonVariant, t as Button } from "./Button-sTZ6xvkU.js";
3
- import { n as CalloutProps, r as CalloutVariant, t as Callout } from "./Callout-Dsp2nbSy.js";
4
- import { t as DropdownButton } from "./DropdownButton-CNJ5NyBS.js";
5
- export { Accordion, AccordionProps, Button, ButtonProps, ButtonVariant, Callout, CalloutProps, CalloutVariant, DropdownButton };
package/dist/index.js DELETED
@@ -1,6 +0,0 @@
1
- import { t as Button } from "./Button-DBhd6kU7.js";
2
- import { t as DropdownButton } from "./DropdownButton-CStYzJ6s.js";
3
- import { t as Callout } from "./Callout-UZQRuCQ5.js";
4
- import { t as Accordion } from "./Accordion-DLQE3Td6.js";
5
-
6
- export { Accordion, Button, Callout, DropdownButton };
@@ -1,12 +0,0 @@
1
- //#region src/scripts/dropdown-button.d.ts
2
- declare function initDropdownButton({
3
- dropdownId,
4
- onSelect,
5
- onPrimaryAction
6
- }: {
7
- dropdownId: string;
8
- onSelect: (value: string) => void;
9
- onPrimaryAction: (primaryActionElement: Element) => void;
10
- }): void;
11
- //#endregion
12
- export { initDropdownButton };
@@ -1,35 +0,0 @@
1
- //#region src/scripts/dropdown-button.ts
2
- function initDropdownButton({ dropdownId, onSelect, onPrimaryAction }) {
3
- const dropdown = document.getElementById(dropdownId);
4
- if (!dropdown) return;
5
- const trigger = dropdown.querySelector("[data-part=\"trigger\"]");
6
- const menu = dropdown.querySelector("[data-part=\"menu\"]");
7
- const primaryAction = dropdown.querySelector("[data-part=\"primary-action\"]");
8
- if (!trigger || !menu || !primaryAction) return;
9
- let isOpen = false;
10
- function toggleDropdown() {
11
- if (!trigger || !menu) return;
12
- isOpen = !isOpen;
13
- menu.dataset.state = isOpen ? "open" : "closed";
14
- trigger.setAttribute("aria-expanded", String(isOpen));
15
- }
16
- trigger.addEventListener("click", toggleDropdown);
17
- document.addEventListener("click", (event) => {
18
- if (!isOpen) return;
19
- if (!dropdown.contains(event.target)) toggleDropdown();
20
- if (primaryAction && primaryAction.contains(event.target)) toggleDropdown();
21
- });
22
- dropdown.querySelectorAll("[data-part=\"item\"]").forEach((item) => {
23
- item.addEventListener("click", () => {
24
- const value = item.getAttribute("data-value");
25
- if (value) onSelect(value);
26
- toggleDropdown();
27
- });
28
- });
29
- primaryAction.addEventListener("click", () => {
30
- onPrimaryAction(primaryAction);
31
- });
32
- }
33
-
34
- //#endregion
35
- export { initDropdownButton };