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

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,6 +1,6 @@
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
3
+ > @stainless-api/ui-primitives@0.1.0-beta.17 build /Users/maxfreundlich/code/work/stl-api-docs/packages/ui-primitives
4
4
  > tsdown
5
5
 
6
6
  ℹ tsdown v0.15.12 powered by rolldown v1.0.0-beta.45
@@ -9,15 +9,15 @@
9
9
  ℹ tsconfig: tsconfig.json
10
10
  ℹ Build start
11
11
  ℹ Cleaning 24 files
12
- ℹ dist/scripts/index.js  1.29 kB │ gzip: 0.51 kB
12
+ ℹ dist/scripts/index.js  1.21 kB │ gzip: 0.48 kB
13
13
  ℹ dist/index.js  0.29 kB │ gzip: 0.16 kB
14
14
  ℹ dist/components/DropdownButton.js  0.10 kB │ gzip: 0.09 kB
15
15
  ℹ dist/components/Accordion.js  0.08 kB │ gzip: 0.08 kB
16
16
  ℹ dist/components/Callout.js  0.07 kB │ gzip: 0.08 kB
17
17
  ℹ dist/components/Button.js  0.07 kB │ gzip: 0.08 kB
18
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
19
+ ℹ dist/styles.css 40.38 kB │ gzip: 6.94 kB
20
+ ℹ dist/DropdownButton-DoYDi8tB.js  2.69 kB │ gzip: 0.70 kB
21
21
  ℹ dist/Button-DBhd6kU7.js  1.51 kB │ gzip: 0.55 kB
22
22
  ℹ dist/Callout-UZQRuCQ5.js  0.82 kB │ gzip: 0.44 kB
23
23
  ℹ dist/Accordion-DLQE3Td6.js  0.80 kB │ gzip: 0.30 kB
@@ -27,9 +27,9 @@
27
27
  ℹ dist/components/Button.d.ts  0.14 kB │ gzip: 0.10 kB
28
28
  ℹ dist/components/Accordion.d.ts  0.12 kB │ gzip: 0.09 kB
29
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
30
+ ℹ dist/DropdownButton-zcvep_xH.d.ts  1.38 kB │ gzip: 0.40 kB
31
+ ℹ dist/Button-DwndlytB.d.ts  1.27 kB │ gzip: 0.52 kB
32
+ ℹ dist/Accordion-CJL9SWwS.d.ts  0.74 kB │ gzip: 0.32 kB
33
+ ℹ dist/Callout-CMz3Yl_5.d.ts  0.57 kB │ gzip: 0.33 kB
34
+ ℹ 22 files, total: 53.24 kB
35
+ ✔ Build complete in 761ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @stainless-api/ui-primitives
2
2
 
3
+ ## 0.1.0-beta.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 58040d8: feat: ui primitives updates, cursor support
8
+
9
+ ## 0.1.0-beta.18
10
+
11
+ ### Minor Changes
12
+
13
+ - c635741: Updated worker and fixed docs-ui jsx issue
14
+
3
15
  ## 0.1.0-beta.17
4
16
 
5
17
  ### Patch Changes
@@ -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_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/Accordion.d.ts
5
5
  type AccordionProps = React.ComponentProps<'details'>;
@@ -7,7 +7,7 @@ declare function Accordion({
7
7
  className,
8
8
  children,
9
9
  ...props
10
- }: AccordionProps): react_jsx_runtime8.JSX.Element;
10
+ }: AccordionProps): react_jsx_runtime3.JSX.Element;
11
11
  declare namespace Accordion {
12
12
  var Summary: typeof AccordionSummary;
13
13
  var Group: typeof AccordionGroup;
@@ -16,11 +16,11 @@ declare function AccordionSummary({
16
16
  children,
17
17
  className,
18
18
  ...props
19
- }: React.ComponentProps<'summary'>): react_jsx_runtime8.JSX.Element;
19
+ }: React.ComponentProps<'summary'>): react_jsx_runtime3.JSX.Element;
20
20
  declare function AccordionGroup({
21
21
  className,
22
22
  children,
23
23
  ...props
24
- }: React.ComponentProps<'div'>): react_jsx_runtime8.JSX.Element;
24
+ }: React.ComponentProps<'div'>): react_jsx_runtime3.JSX.Element;
25
25
  //#endregion
26
26
  export { AccordionProps as n, Accordion as t };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime11 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { LucideIcon } from "lucide-react";
4
4
 
5
5
  //#region src/components/Button.d.ts
@@ -17,17 +17,17 @@ type ButtonBranch = BaseProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElemen
17
17
  href?: never;
18
18
  };
19
19
  type ButtonProps = AnchorBranch | ButtonBranch;
20
- declare function Button(props: ButtonProps): react_jsx_runtime11.JSX.Element;
20
+ declare function Button(props: ButtonProps): react_jsx_runtime0.JSX.Element;
21
21
  declare namespace Button {
22
22
  var Label: ({
23
23
  className,
24
24
  ...rest
25
- }: LabelProps) => react_jsx_runtime11.JSX.Element;
25
+ }: LabelProps) => react_jsx_runtime0.JSX.Element;
26
26
  var Icon: ({
27
27
  className,
28
28
  icon: Icon,
29
29
  size
30
- }: IconProps) => react_jsx_runtime11.JSX.Element;
30
+ }: IconProps) => react_jsx_runtime0.JSX.Element;
31
31
  }
32
32
  type LabelProps = React.HTMLAttributes<HTMLSpanElement>;
33
33
  type IconProps = {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 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_runtime0.JSX.Element;
16
+ }: CalloutProps): react_jsx_runtime2.JSX.Element;
17
17
  //#endregion
18
18
  export { CalloutProps as n, CalloutVariant as r, Callout as t };
@@ -64,9 +64,8 @@ function MenuItem({ children, value, isExternalLink,...props }) {
64
64
  })]
65
65
  });
66
66
  }
67
- function DropdownButton({ id, className,...props }) {
67
+ function DropdownButton({ className,...props }) {
68
68
  return /* @__PURE__ */ jsx("div", {
69
- id,
70
69
  ...props,
71
70
  className: clsx("stl-ui-dropdown-button stl-ui-not-prose not-content", className)
72
71
  });
@@ -1,19 +1,16 @@
1
1
  import { ComponentPropsWithoutRef } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/DropdownButton.d.ts
5
5
  declare function DropdownButton({
6
- id,
7
6
  className,
8
7
  ...props
9
- }: ComponentPropsWithoutRef<'div'> & {
10
- id: string;
11
- }): react_jsx_runtime0.JSX.Element;
8
+ }: ComponentPropsWithoutRef<'div'>): react_jsx_runtime6.JSX.Element;
12
9
  declare namespace DropdownButton {
13
10
  var Menu: ({
14
11
  className,
15
12
  ...props
16
- }: ComponentPropsWithoutRef<"div">) => react_jsx_runtime0.JSX.Element;
13
+ }: ComponentPropsWithoutRef<"div">) => react_jsx_runtime6.JSX.Element;
17
14
  var MenuItem: ({
18
15
  children,
19
16
  value,
@@ -23,31 +20,31 @@ declare namespace DropdownButton {
23
20
  children?: React.ReactNode;
24
21
  value: string;
25
22
  isExternalLink?: boolean;
26
- }) => react_jsx_runtime0.JSX.Element;
23
+ }) => react_jsx_runtime6.JSX.Element;
27
24
  var MenuItemIcon: ({
28
25
  className,
29
26
  ...props
30
- }: ComponentPropsWithoutRef<"div">) => react_jsx_runtime0.JSX.Element;
27
+ }: ComponentPropsWithoutRef<"div">) => react_jsx_runtime6.JSX.Element;
31
28
  var MenuItemText: ({
32
29
  className,
33
30
  subtle,
34
31
  ...props
35
32
  }: ComponentPropsWithoutRef<"span"> & {
36
33
  subtle?: boolean;
37
- }) => react_jsx_runtime0.JSX.Element;
34
+ }) => react_jsx_runtime6.JSX.Element;
38
35
  var PrimaryAction: ({
39
36
  className,
40
37
  ...props
41
- }: ComponentPropsWithoutRef<"button">) => react_jsx_runtime0.JSX.Element;
38
+ }: ComponentPropsWithoutRef<"button">) => react_jsx_runtime6.JSX.Element;
42
39
  var PrimaryActionText: ({
43
40
  children
44
41
  }: {
45
42
  children?: React.ReactNode;
46
- }) => react_jsx_runtime0.JSX.Element;
43
+ }) => react_jsx_runtime6.JSX.Element;
47
44
  var Trigger: ({
48
45
  className,
49
46
  ...props
50
- }: ComponentPropsWithoutRef<"button">) => react_jsx_runtime0.JSX.Element;
47
+ }: ComponentPropsWithoutRef<"button">) => react_jsx_runtime6.JSX.Element;
51
48
  }
52
49
  //#endregion
53
50
  export { DropdownButton as t };
@@ -1,2 +1,2 @@
1
- import { n as AccordionProps, t as Accordion } from "../Accordion-_dikpfLR.js";
1
+ import { n as AccordionProps, t as Accordion } from "../Accordion-CJL9SWwS.js";
2
2
  export { Accordion, AccordionProps };
@@ -1,2 +1,2 @@
1
- import { n as ButtonProps, r as ButtonVariant, t as Button } from "../Button-sTZ6xvkU.js";
1
+ import { n as ButtonProps, r as ButtonVariant, t as Button } from "../Button-DwndlytB.js";
2
2
  export { Button, ButtonProps, ButtonVariant };
@@ -1,2 +1,2 @@
1
- import { n as CalloutProps, r as CalloutVariant, t as Callout } from "../Callout-Dsp2nbSy.js";
1
+ import { n as CalloutProps, r as CalloutVariant, t as Callout } from "../Callout-CMz3Yl_5.js";
2
2
  export { Callout, CalloutProps, CalloutVariant };
@@ -1,2 +1,2 @@
1
- import { t as DropdownButton } from "../DropdownButton-CNJ5NyBS.js";
1
+ import { t as DropdownButton } from "../DropdownButton-zcvep_xH.js";
2
2
  export { DropdownButton };
@@ -1,3 +1,3 @@
1
- import { t as DropdownButton } from "../DropdownButton-CStYzJ6s.js";
1
+ import { t as DropdownButton } from "../DropdownButton-DoYDi8tB.js";
2
2
 
3
3
  export { DropdownButton };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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";
1
+ import { n as AccordionProps, t as Accordion } from "./Accordion-CJL9SWwS.js";
2
+ import { n as ButtonProps, r as ButtonVariant, t as Button } from "./Button-DwndlytB.js";
3
+ import { n as CalloutProps, r as CalloutVariant, t as Callout } from "./Callout-CMz3Yl_5.js";
4
+ import { t as DropdownButton } from "./DropdownButton-zcvep_xH.js";
5
5
  export { Accordion, AccordionProps, Button, ButtonProps, ButtonVariant, Callout, CalloutProps, CalloutVariant, DropdownButton };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as Button } from "./Button-DBhd6kU7.js";
2
- import { t as DropdownButton } from "./DropdownButton-CStYzJ6s.js";
2
+ import { t as DropdownButton } from "./DropdownButton-DoYDi8tB.js";
3
3
  import { t as Callout } from "./Callout-UZQRuCQ5.js";
4
4
  import { t as Accordion } from "./Accordion-DLQE3Td6.js";
5
5
 
@@ -1,10 +1,10 @@
1
1
  //#region src/scripts/dropdown-button.d.ts
2
2
  declare function initDropdownButton({
3
- dropdownId,
3
+ dropdown,
4
4
  onSelect,
5
5
  onPrimaryAction
6
6
  }: {
7
- dropdownId: string;
7
+ dropdown: Element;
8
8
  onSelect: (value: string) => void;
9
9
  onPrimaryAction: (primaryActionElement: Element) => void;
10
10
  }): void;
@@ -1,7 +1,5 @@
1
1
  //#region src/scripts/dropdown-button.ts
2
- function initDropdownButton({ dropdownId, onSelect, onPrimaryAction }) {
3
- const dropdown = document.getElementById(dropdownId);
4
- if (!dropdown) return;
2
+ function initDropdownButton({ dropdown, onSelect, onPrimaryAction }) {
5
3
  const trigger = dropdown.querySelector("[data-part=\"trigger\"]");
6
4
  const menu = dropdown.querySelector("[data-part=\"menu\"]");
7
5
  const primaryAction = dropdown.querySelector("[data-part=\"primary-action\"]");
package/dist/styles.css CHANGED
@@ -262,12 +262,21 @@ body {
262
262
  }
263
263
 
264
264
  .stl-ui-prose {
265
+ letter-spacing: -0.01em;
266
+ font-weight: 400;
267
+ line-height: var(--stl-ui-typography-line-height);
268
+ font-size: var(--stl-ui-typography-text-body);
269
+ color: var(--stl-ui-foreground-secondary);
270
+
271
+ :where(.stl-ui-not-prose) {
272
+ letter-spacing: initial;
273
+ font-weight: initial;
274
+ line-height: initial;
275
+ font-size: initial;
276
+ color: initial;
277
+ }
278
+
265
279
  :where(p):not(.stl-ui-not-prose *) {
266
- color: var(--stl-ui-foreground-secondary);
267
- font-weight: 400;
268
- line-height: var(--stl-ui-typography-line-height);
269
- letter-spacing: -0.01em;
270
- font-size: var(--stl-ui-typography-text-body);
271
280
  margin-top: 16px;
272
281
  }
273
282
 
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.19",
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
  }
@@ -2,6 +2,8 @@
2
2
  --stl-ui-callout-background-color: var(--stl-ui-muted-background);
3
3
  --stl-ui-callout-border-color: var(--stl-ui-border);
4
4
  --stl-ui-callout-accent-color: var(--stl-ui-foreground-muted);
5
+ --stl-ui-callout-strong-color: var(--stl-ui-callout-accent-color);
6
+ --stl-ui-callout-selection-background: var(--stl-ui-swatch-gray-gray-6);
5
7
 
6
8
  border: 1px solid var(--stl-ui-callout-border-color);
7
9
  background-color: var(--stl-ui-callout-background-color);
@@ -14,42 +16,63 @@
14
16
  display: flex;
15
17
  align-items: flex-start;
16
18
  gap: 8px;
19
+
20
+ :where(a) {
21
+ color: var(--stl-ui-callout-strong-color);
22
+ text-decoration-color: rgba(from currentColor r g b / 0.4);
23
+ transition: text-decoration-color 0.1s ease;
24
+ &:hover {
25
+ text-decoration-color: rgba(from currentColor r g b / 0.8);
26
+ }
27
+ }
28
+
29
+ ::selection {
30
+ background-color: var(--stl-ui-callout-selection-background);
31
+ color: var(--stl-ui-foreground);
32
+ }
17
33
  }
18
34
 
19
35
  .stl-ui-callout--info {
20
36
  --stl-ui-callout-background-color: var(--stl-ui-muted-background);
21
37
  --stl-ui-callout-border-color: var(--stl-ui-border);
22
38
  --stl-ui-callout-accent-color: var(--stl-ui-foreground-muted);
39
+ --stl-ui-callout-strong-color: var(--stl-ui-foreground);
40
+ --stl-ui-callout-selection-background: var(--stl-ui-swatch-gray-gray-6);
23
41
  }
24
42
 
25
43
  .stl-ui-callout--note {
26
44
  --stl-ui-callout-background-color: var(--stl-ui-swatch-blue-faint);
27
45
  --stl-ui-callout-border-color: var(--stl-ui-swatch-blue-muted);
28
46
  --stl-ui-callout-accent-color: var(--stl-ui-swatch-blue-base);
47
+ --stl-ui-callout-selection-background: var(--stl-ui-swatch-blue-muted);
29
48
  }
30
49
 
31
50
  .stl-ui-callout--tip {
32
51
  --stl-ui-callout-background-color: var(--stl-ui-swatch-purple-faint);
33
52
  --stl-ui-callout-border-color: var(--stl-ui-swatch-purple-muted);
34
53
  --stl-ui-callout-accent-color: var(--stl-ui-swatch-purple-base);
54
+ --stl-ui-callout-selection-background: var(--stl-ui-swatch-purple-muted);
35
55
  }
36
56
 
37
57
  .stl-ui-callout--success {
38
58
  --stl-ui-callout-background-color: var(--stl-ui-swatch-green-faint);
39
59
  --stl-ui-callout-border-color: var(--stl-ui-swatch-green-muted);
40
60
  --stl-ui-callout-accent-color: var(--stl-ui-swatch-green-base);
61
+ --stl-ui-callout-selection-background: var(--stl-ui-swatch-green-muted);
41
62
  }
42
63
 
43
64
  .stl-ui-callout--warning {
44
65
  --stl-ui-callout-background-color: var(--stl-ui-swatch-yellow-faint);
45
66
  --stl-ui-callout-border-color: var(--stl-ui-swatch-yellow-muted);
46
67
  --stl-ui-callout-accent-color: var(--stl-ui-swatch-yellow-base);
68
+ --stl-ui-callout-selection-background: var(--stl-ui-swatch-yellow-muted);
47
69
  }
48
70
 
49
71
  .stl-ui-callout--danger {
50
72
  --stl-ui-callout-background-color: var(--stl-ui-swatch-red-faint);
51
73
  --stl-ui-callout-border-color: var(--stl-ui-swatch-red-muted);
52
74
  --stl-ui-callout-accent-color: var(--stl-ui-swatch-red-base);
75
+ --stl-ui-callout-selection-background: var(--stl-ui-swatch-red-muted);
53
76
  }
54
77
 
55
78
  .stl-ui-callout__icon {
@@ -32,6 +32,7 @@
32
32
  display: flex;
33
33
  align-items: center;
34
34
  justify-content: center;
35
+ color: inherit;
35
36
 
36
37
  &:hover {
37
38
  background-color: oklch(from var(--stl-ui-foreground) l c h / 0.05);