@stll/ui 0.65.0 → 0.65.1

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,14 @@
1
1
  import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
2
2
  //#region src/components/accordion.d.ts
3
- declare const Accordion: <Value = unknown>(props: Accordion$1.Root.Props<Value>) => import("react").JSX.Element;
3
+ /**
4
+ * Closed panels stay in the document. Once mounted they are
5
+ * `hidden="until-found"`, so find-in-page reaches their content and opens
6
+ * the section, as it would a native `<details>`; server-rendered markup
7
+ * carries a plain `hidden` until hydration. Pass `hiddenUntilFound={false}` (here, or on one
8
+ * `AccordionPanel`) to unmount closed content instead: a heavy panel that
9
+ * should not render until asked for.
10
+ */
11
+ declare const Accordion: <Value = unknown>({ hiddenUntilFound, ...props }: Accordion$1.Root.Props<Value>) => import("react").JSX.Element;
4
12
  declare const AccordionItem: ({ className, ...props }: Accordion$1.Item.Props) => import("react").JSX.Element;
5
13
  /**
6
14
  * - `default`: a section heading of a page or panel.
@@ -15,9 +23,17 @@ type AccordionSize = "default" | "sm" | "compact";
15
23
  * hover, for a disclosure that is secondary to what is around it.
16
24
  */
17
25
  type AccordionTriggerVariant = "default" | "muted";
18
- declare const AccordionTrigger: ({ className, children, size, variant, ...props }: Accordion$1.Trigger.Props & {
26
+ declare const AccordionTrigger: ({ className, children, size, variant, trailing, ...props }: Accordion$1.Trigger.Props & {
19
27
  size?: AccordionSize;
20
28
  variant?: AccordionTriggerVariant;
29
+ /**
30
+ * Status at the end of the row, before the chevron: a count, "2 unsaved",
31
+ * a last-updated date. It is part of the trigger, so it is read with the
32
+ * heading. It is typed as text so it can never be a control: a button
33
+ * inside the trigger's button is unreachable and its click would toggle
34
+ * the panel.
35
+ */
36
+ trailing?: string | number;
21
37
  }) => import("react").JSX.Element;
22
38
  declare const AccordionPanel: ({ className, children, size, ...props }: Accordion$1.Panel.Props & {
23
39
  size?: AccordionSize;
@@ -4,8 +4,17 @@ import { cn } from "../lib/utils.js";
4
4
  import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/accordion.tsx
7
- const Accordion = (props) => /* @__PURE__ */ jsx(Accordion$1.Root, {
7
+ /**
8
+ * Closed panels stay in the document. Once mounted they are
9
+ * `hidden="until-found"`, so find-in-page reaches their content and opens
10
+ * the section, as it would a native `<details>`; server-rendered markup
11
+ * carries a plain `hidden` until hydration. Pass `hiddenUntilFound={false}` (here, or on one
12
+ * `AccordionPanel`) to unmount closed content instead: a heavy panel that
13
+ * should not render until asked for.
14
+ */
15
+ const Accordion = ({ hiddenUntilFound = true, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Root, {
8
16
  "data-slot": "accordion",
17
+ hiddenUntilFound,
9
18
  ...props
10
19
  });
11
20
  const AccordionItem = ({ className, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Item, {
@@ -27,20 +36,28 @@ const TRIGGER_VARIANT_CLASS_NAME = {
27
36
  default: "font-medium",
28
37
  muted: "text-muted-foreground hover:text-foreground font-normal"
29
38
  };
30
- const AccordionTrigger = ({ className, children, size = "default", variant = "default", ...props }) => /* @__PURE__ */ jsx(Accordion$1.Header, {
39
+ const AccordionTrigger = ({ className, children, size = "default", variant = "default", trailing, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Header, {
31
40
  className: "flex",
32
41
  children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
33
42
  className: cn("focus-visible:ring-ring flex flex-1 cursor-pointer items-start justify-between gap-4 rounded-md text-start outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-64 data-panel-open:*:data-[slot=accordion-indicator]:rotate-180", TRIGGER_SIZE_CLASS_NAME[size], TRIGGER_VARIANT_CLASS_NAME[variant], className),
34
43
  "data-slot": "accordion-trigger",
35
44
  ...props,
36
- children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, {
37
- className: "pointer-events-none size-4 shrink-0 translate-y-0.5 opacity-80 transition-transform duration-200 ease-in-out",
38
- "data-slot": "accordion-indicator"
39
- })]
45
+ children: [
46
+ children,
47
+ trailing === void 0 ? null : /* @__PURE__ */ jsx("span", {
48
+ className: "text-muted-foreground ms-auto min-w-0 text-end text-xs font-normal tabular-nums",
49
+ "data-slot": "accordion-trigger-trailing",
50
+ children: trailing
51
+ }),
52
+ /* @__PURE__ */ jsx(ChevronDownIcon, {
53
+ className: "pointer-events-none size-4 shrink-0 translate-y-0.5 opacity-80 transition-transform duration-200 ease-in-out",
54
+ "data-slot": "accordion-indicator"
55
+ })
56
+ ]
40
57
  })
41
58
  });
42
59
  const AccordionPanel = ({ className, children, size = "default", ...props }) => /* @__PURE__ */ jsx(Accordion$1.Panel, {
43
- className: "text-muted-foreground h-(--accordion-panel-height) overflow-hidden text-sm transition-[height] duration-200 ease-in-out data-ending-style:h-0 data-starting-style:h-0",
60
+ className: "text-muted-foreground h-(--accordion-panel-height) overflow-hidden text-sm transition-[height] duration-200 ease-in-out data-ending-style:h-0 data-starting-style:h-0 motion-reduce:transition-none [&[hidden]:not([hidden=until-found])]:hidden",
44
61
  "data-slot": "accordion-panel",
45
62
  ...props,
46
63
  children: /* @__PURE__ */ jsx("div", {
@@ -10,16 +10,22 @@ import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
10
10
  * text toggle), so a disclosure reads like every other action of its size.
11
11
  */
12
12
  declare const Collapsible: (props: Collapsible$1.Root.Props) => import("react").JSX.Element;
13
- declare const CollapsibleTrigger: (props: Collapsible$1.Trigger.Props) => import("react").JSX.Element;
13
+ /**
14
+ * A bare trigger (plain text, no `render`) still gets the 44px touch target
15
+ * every control has under a coarse pointer, the same hit area `Button` adds.
16
+ */
17
+ declare const CollapsibleTrigger: ({ className, ...props }: Collapsible$1.Trigger.Props) => import("react").JSX.Element;
14
18
  /**
15
19
  * The disclosed content. It adds no padding or type, so opening it reveals
16
20
  * content at the rhythm of the surface around it, as a native `<details>`
17
21
  * does. Its height eases open and shut with the accordion's timing, so the
18
22
  * two disclosures move alike; under reduced motion it snaps.
19
23
  *
20
- * Closed, the content stays in the document as `hidden="until-found"` (as a
21
- * native `<details>` keeps it), so find-in-page still reaches it and opens
22
- * the panel. Pass `hiddenUntilFound={false}` to unmount it instead.
24
+ * Closed, the content stays in the document. Once mounted it is
25
+ * `hidden="until-found"` (as a native `<details>` keeps it), so find-in-page
26
+ * reaches it and opens the panel; server-rendered markup carries a plain
27
+ * `hidden` until hydration, so the search reaches it only after that. Pass
28
+ * `hiddenUntilFound={false}` to unmount it instead.
23
29
  */
24
30
  declare const CollapsiblePanel: ({ className, hiddenUntilFound, ...props }: Collapsible$1.Panel.Props) => import("react").JSX.Element;
25
31
  //#endregion
@@ -16,7 +16,12 @@ const Collapsible = (props) => /* @__PURE__ */ jsx(Collapsible$1.Root, {
16
16
  "data-slot": "collapsible",
17
17
  ...props
18
18
  });
19
- const CollapsibleTrigger = (props) => /* @__PURE__ */ jsx(Collapsible$1.Trigger, {
19
+ /**
20
+ * A bare trigger (plain text, no `render`) still gets the 44px touch target
21
+ * every control has under a coarse pointer, the same hit area `Button` adds.
22
+ */
23
+ const CollapsibleTrigger = ({ className, ...props }) => /* @__PURE__ */ jsx(Collapsible$1.Trigger, {
24
+ className: cn("relative pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11", className),
20
25
  "data-slot": "collapsible-trigger",
21
26
  ...props
22
27
  });
@@ -26,9 +31,11 @@ const CollapsibleTrigger = (props) => /* @__PURE__ */ jsx(Collapsible$1.Trigger,
26
31
  * does. Its height eases open and shut with the accordion's timing, so the
27
32
  * two disclosures move alike; under reduced motion it snaps.
28
33
  *
29
- * Closed, the content stays in the document as `hidden="until-found"` (as a
30
- * native `<details>` keeps it), so find-in-page still reaches it and opens
31
- * the panel. Pass `hiddenUntilFound={false}` to unmount it instead.
34
+ * Closed, the content stays in the document. Once mounted it is
35
+ * `hidden="until-found"` (as a native `<details>` keeps it), so find-in-page
36
+ * reaches it and opens the panel; server-rendered markup carries a plain
37
+ * `hidden` until hydration, so the search reaches it only after that. Pass
38
+ * `hiddenUntilFound={false}` to unmount it instead.
32
39
  */
33
40
  const CollapsiblePanel = ({ className, hiddenUntilFound = true, ...props }) => /* @__PURE__ */ jsx(Collapsible$1.Panel, {
34
41
  className: cn("h-(--collapsible-panel-height) min-w-0 overflow-hidden transition-[height] duration-200 ease-in-out data-ending-style:h-0 data-starting-style:h-0 motion-reduce:transition-none [&[hidden]:not([hidden=until-found])]:hidden", className),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/ui",
3
- "version": "0.65.0",
3
+ "version": "0.65.1",
4
4
  "description": "Stella's design system: bidi-aware React primitives built on Base UI, the dockable inspector pane, and the Tailwind v4 theme they are styled with.",
5
5
  "keywords": [
6
6
  "base-ui",