@stll/ui 0.91.0 → 0.93.0

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.
@@ -6,7 +6,9 @@ type DateRangeFilterProps = Omit<DatePickerPopoverProps, "value" | "onChange" |
6
6
  onToChange: (value: string | null) => void;
7
7
  fromLabel: string;
8
8
  toLabel: string;
9
+ /** `horizontal` puts the bounds side by side, for wide filter bars. */
10
+ orientation?: "vertical" | "horizontal";
9
11
  };
10
12
  /** Both calendar bounds and the focus handoff belong to the range. */
11
- declare const DateRangeFilter: ({ from, to, onFromChange, onToChange, fromLabel, toLabel, className, maxDate, ...pickerProps }: DateRangeFilterProps) => import("react").JSX.Element;
13
+ declare const DateRangeFilter: ({ from, to, onFromChange, onToChange, fromLabel, toLabel, className, maxDate, orientation, ...pickerProps }: DateRangeFilterProps) => import("react").JSX.Element;
12
14
  export { DateRangeFilter, type DateRangeFilterProps };
@@ -5,13 +5,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { useId, useRef, useState } from "react";
6
6
  // src/components/date-range-filter.tsx
7
7
  /** Both calendar bounds and the focus handoff belong to the range. */
8
- const DateRangeFilter = ({ from, to, onFromChange, onToChange, fromLabel, toLabel, className, maxDate, ...pickerProps }) => {
8
+ const DateRangeFilter = ({ from, to, onFromChange, onToChange, fromLabel, toLabel, className, maxDate, orientation = "vertical", ...pickerProps }) => {
9
9
  const id = useId();
10
10
  const toRef = useRef(null);
11
11
  const [picker, setPicker] = useState({ type: "closed" });
12
12
  const fromMax = to && (!maxDate || to < maxDate) ? to : maxDate;
13
13
  return /* @__PURE__ */ jsxs("div", {
14
- className: cn("flex flex-col gap-1.5", className),
14
+ className: cn(orientation === "horizontal" ? "grid grid-cols-2 gap-2" : "flex flex-col gap-1.5", className),
15
15
  children: [/* @__PURE__ */ jsxs("div", {
16
16
  className: "flex min-w-0 flex-col gap-1.5",
17
17
  children: [/* @__PURE__ */ jsx("span", {
@@ -36,7 +36,7 @@ function documentIdentityMark(identity, size) {
36
36
  abbreviation,
37
37
  size,
38
38
  weight: identity.courtTier === void 0 ? "outline" : COURT_TIER_WEIGHT[identity.courtTier],
39
- className: cn("max-w-full overflow-hidden", abbreviation.length > 4 && "px-0.5 text-[9px] tracking-normal")
39
+ className: cn("max-w-full overflow-hidden", abbreviation.length > 4 && "px-0.5 text-[9px] leading-[inherit] tracking-normal")
40
40
  })
41
41
  });
42
42
  }
@@ -58,7 +58,7 @@ function documentIdentityMark(identity, size) {
58
58
  function referenceLabelMark(labels, kind) {
59
59
  const classes = statuteLabelClasses(labels.long.length);
60
60
  return /* @__PURE__ */ jsxs("span", {
61
- className: cn("@container/document-identity inline-flex max-w-full shrink-0 items-center justify-center font-mono leading-4 font-semibold tabular-nums", labels.short.length > 7 ? "text-[9px]" : "text-[10px]"),
61
+ className: cn("@container/document-identity inline-flex max-w-full shrink-0 items-center justify-center font-mono font-semibold tabular-nums", labels.short.length > 7 ? "text-[9px]" : "text-[10px]"),
62
62
  style: { width: `${labels.long.length + .25}ch` },
63
63
  "aria-label": labels.long,
64
64
  "data-slot": "document-identity-badge",
@@ -18,7 +18,7 @@ import { useSyncExternalStore } from "react";
18
18
  const Kbd = ({ className, children, keys, variant = "cap", ...props }) => {
19
19
  const platform = useKbdPlatform();
20
20
  return /* @__PURE__ */ jsx("kbd", {
21
- className: cn("inline-flex shrink-0 items-center justify-center gap-0.5 font-sans leading-none font-medium tabular-nums", KBD_VARIANT_CLASS_NAME[variant], className),
21
+ className: cn("inline-flex shrink-0 items-center justify-center gap-0.5 font-sans font-medium tabular-nums", KBD_VARIANT_CLASS_NAME[variant], className),
22
22
  "data-slot": "kbd",
23
23
  "data-variant": variant,
24
24
  ...props,
@@ -17,7 +17,7 @@ const OUTCOME_TILE_CLASS = "bg-card text-foreground shadow-outcome-tile relative
17
17
  const OutcomeStatusBadge = ({ className, tone }) => {
18
18
  const { className: toneClass, Icon } = TONE_BADGE[tone];
19
19
  return /* @__PURE__ */ jsx("span", {
20
- className: cn("text-background ring-background motion-safe:animate-outcome-badge flex size-5 items-center justify-center rounded-full ring-2", toneClass, className),
20
+ className: cn("text-background motion-safe:animate-outcome-badge flex size-5 items-center justify-center rounded-full", toneClass, className),
21
21
  "data-slot": "outcome-badge",
22
22
  "data-tone": tone,
23
23
  children: /* @__PURE__ */ jsx(Icon, {
@@ -32,7 +32,7 @@ const StellaOutcomeTile = () => /* @__PURE__ */ jsx("span", {
32
32
  children: /* @__PURE__ */ jsx(StellaMark, { className: "size-7" })
33
33
  });
34
34
  const OutcomeGlyph = ({ tone }) => /* @__PURE__ */ jsxs("div", {
35
- className: "relative",
35
+ className: "outcome-badge-cutout relative",
36
36
  "aria-hidden": "true",
37
37
  children: [/* @__PURE__ */ jsx(StellaOutcomeTile, {}), /* @__PURE__ */ jsx(OutcomeStatusBadge, {
38
38
  className: "absolute -end-1.25 -bottom-1.25",
@@ -13,7 +13,7 @@ const PairedOutcomeGlyph = ({ counterpart, tone }) => /* @__PURE__ */ jsxs("div"
13
13
  /* @__PURE__ */ jsxs("span", {
14
14
  className: "relative flex w-16 items-center justify-center",
15
15
  children: [/* @__PURE__ */ jsx("span", {
16
- className: "bg-border motion-safe:animate-outcome-connector h-px w-full",
16
+ className: "bg-border motion-safe:animate-outcome-connector outcome-connector-cutout h-px w-full",
17
17
  "data-slot": "outcome-connector"
18
18
  }), /* @__PURE__ */ jsx(OutcomeStatusBadge, {
19
19
  className: "absolute",
@@ -53,9 +53,9 @@ const HEAD_FRAME_CLASS = "[&_img]:origin-[50%_26%] [&_img]:scale-200 [&_img]:obj
53
53
  /** A row's faces, decorative: the row's text carries the names. */
54
54
  const OutlineRowPortraits = ({ portraits }) => /* @__PURE__ */ jsx("span", {
55
55
  "aria-hidden": true,
56
- className: "me-1.5 flex shrink-0 -space-x-1.5 rtl:space-x-reverse",
56
+ className: "overlap-stack overlap-stack-1.5 me-1.5 shrink-0",
57
57
  children: portraits.slice(0, MAX_ROW_PORTRAITS).map((portrait) => /* @__PURE__ */ jsx(ReviewAuthorAvatar, {
58
- className: cn("ring-background size-6 ring-2", HEAD_FRAME_CLASS),
58
+ className: cn("size-6", HEAD_FRAME_CLASS),
59
59
  fallbackClassName: "text-[10px]",
60
60
  image: portrait.image,
61
61
  name: portrait.name
@@ -41,6 +41,10 @@ declare const PopoverPanel: ({ children, contentClassName, ...props }: Component
41
41
  contentClassName?: string;
42
42
  }) => React.JSX.Element;
43
43
  declare const PopoverClose: ({ ...props }: Popover$1.Close.Props) => React.JSX.Element;
44
- declare const PopoverTitle: ({ className, ...props }: Popover$1.Title.Props) => React.JSX.Element;
44
+ type PopoverTitleSize = "default" | "sm";
45
+ type PopoverTitleProps = Popover$1.Title.Props & {
46
+ size?: PopoverTitleSize | undefined;
47
+ };
48
+ declare const PopoverTitle: ({ className, size, ...props }: PopoverTitleProps) => React.JSX.Element;
45
49
  declare const PopoverDescription: ({ className, ...props }: Popover$1.Description.Props) => React.JSX.Element;
46
50
  export { Popover, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverPanel, PopoverTitle, PopoverTrigger };
@@ -69,8 +69,14 @@ const PopoverClose = ({ ...props }) => /* @__PURE__ */ jsx(Popover$1.Close, {
69
69
  "data-slot": "popover-close",
70
70
  ...props
71
71
  });
72
- const PopoverTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(Popover$1.Title, {
73
- className: cn("text-lg leading-none font-semibold", className),
72
+ /** Each size states its own line height; `sm` heads a compact menu-like popover. */
73
+ const POPOVER_TITLE_SIZE_CLASS = {
74
+ default: "text-lg leading-none",
75
+ sm: "text-sm leading-(--text-sm--line-height)"
76
+ };
77
+ const PopoverTitle = ({ className, size = "default", ...props }) => /* @__PURE__ */ jsx(Popover$1.Title, {
78
+ className: cn(POPOVER_TITLE_SIZE_CLASS[size], "font-semibold", className),
79
+ "data-size": size,
74
80
  "data-slot": "popover-title",
75
81
  ...props
76
82
  });
@@ -1508,3 +1508,85 @@
1508
1508
  color: oklch(0.85 0.11 var(--cat-hue));
1509
1509
  }
1510
1510
  }
1511
+
1512
+ /* A row of equal round items (faces, avatars, "+N") that overlap, each cut
1513
+ * out of the one before it. The cut is a mask on the earlier item where the
1514
+ * next one sits, plus a gap, so the gap shows whatever lies behind the row:
1515
+ * a ring or border painted in the page colour shows as a frame on any other
1516
+ * surface, such as a row or button on hover. The mask also clips anything an
1517
+ * item paints outside its box, so a ring marking an item goes inside it.
1518
+ * `overlap-stack-<n>` sets the overlap in spacing steps. */
1519
+ @utility overlap-stack {
1520
+ --overlap-stack-step: var(--overlap-stack-overlap, --spacing(1));
1521
+ display: flex;
1522
+ align-items: center;
1523
+
1524
+ & > :not(:first-child) {
1525
+ margin-inline-start: calc(var(--overlap-stack-step) * -1);
1526
+ }
1527
+
1528
+ /* The cut is the next item's circle (radius 50%) grown by a 2px gap. The
1529
+ * gap sits in the colour stops: browsers reject a radius mixing % and px. */
1530
+ & > :not(:last-child) {
1531
+ mask-image: radial-gradient(
1532
+ 50% 50% at calc(150% - var(--overlap-stack-step)) 50%,
1533
+ transparent calc(100% + 2px),
1534
+ black calc(100% + 2.5px)
1535
+ );
1536
+ }
1537
+
1538
+ &:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) > :not(:last-child) {
1539
+ mask-image: radial-gradient(
1540
+ 50% 50% at calc(var(--overlap-stack-step) - 50%) 50%,
1541
+ transparent calc(100% + 2px),
1542
+ black calc(100% + 2.5px)
1543
+ );
1544
+ }
1545
+ }
1546
+
1547
+ /* On the outcome glyph: its tile is cut out under the status badge (20px,
1548
+ * 5px past the inline-end bottom corner) with a 2px gap, so the gap is
1549
+ * transparent on any page colour. */
1550
+ @utility outcome-badge-cutout {
1551
+ & > [data-slot="outcome-tile"] {
1552
+ mask-image: radial-gradient(
1553
+ circle at calc(100% - 5px) calc(100% - 5px),
1554
+ transparent 12px,
1555
+ black 12.5px
1556
+ );
1557
+ }
1558
+
1559
+ &:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) > [data-slot="outcome-tile"] {
1560
+ mask-image: radial-gradient(
1561
+ circle at 5px calc(100% - 5px),
1562
+ transparent 12px,
1563
+ black 12.5px
1564
+ );
1565
+ }
1566
+ }
1567
+
1568
+ /* An activity timeline line stops 4px short of its 28px marker (10px from
1569
+ * the entry's top), so the gap shows the panel behind on any surface. */
1570
+ @utility timeline-marker-cutout {
1571
+ mask-image: linear-gradient(
1572
+ to bottom,
1573
+ black 6px,
1574
+ transparent 6px 42px,
1575
+ black 42px
1576
+ );
1577
+ }
1578
+
1579
+ /* The connector between two outcome tiles stops 2px short of the 20px badge
1580
+ * centred on it, so the gap shows the page behind on any surface. */
1581
+ @utility outcome-connector-cutout {
1582
+ mask-image: linear-gradient(
1583
+ to right,
1584
+ black calc(50% - 12px),
1585
+ transparent calc(50% - 12px) calc(50% + 12px),
1586
+ black calc(50% + 12px)
1587
+ );
1588
+ }
1589
+
1590
+ @utility overlap-stack-* {
1591
+ --overlap-stack-overlap: --spacing(--value(number));
1592
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/ui",
3
- "version": "0.91.0",
3
+ "version": "0.93.0",
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",
@@ -1027,7 +1027,7 @@
1027
1027
  "clsx": "^2.1.1",
1028
1028
  "input-otp": "^1.5.0",
1029
1029
  "lucide-react": "1.74.0",
1030
- "tailwind-merge": "^3.7.0",
1030
+ "tailwind-merge": "^3.7.1",
1031
1031
  "temporal-polyfill": "1.0.8"
1032
1032
  },
1033
1033
  "devDependencies": {
@@ -1047,13 +1047,13 @@
1047
1047
  "@testing-library/react": "16.3.3",
1048
1048
  "@types/react": "^19.3.0",
1049
1049
  "@types/react-dom": "^19.3.0",
1050
- "bun-types": "1.4.4",
1050
+ "bun-types": "1.4.5",
1051
1051
  "fast-check": "^4.10.2",
1052
1052
  "react": "^19.3.1",
1053
1053
  "react-dom": "^19.3.1",
1054
1054
  "tailwindcss": "4.3.5",
1055
1055
  "tsdown": "0.23.7",
1056
- "tsrs": "0.23.0-ts7.1.0-beta",
1056
+ "tsrs": "7.1.0-beta.tsrs5",
1057
1057
  "vite": "8.3.8"
1058
1058
  },
1059
1059
  "peerDependencies": {