@cloudgrid-io/ui 0.31.6 → 0.32.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.
- package/dist/blocks/agent-prompt.d.ts.map +1 -1
- package/dist/blocks/agent-prompt.js +11 -1
- package/dist/blocks/agent-prompt.js.map +1 -1
- package/dist/blocks/compare-table.d.ts.map +1 -1
- package/dist/blocks/compare-table.js +1 -1
- package/dist/blocks/compare-table.js.map +1 -1
- package/dist/blocks/entity-card.d.ts.map +1 -1
- package/dist/blocks/entity-card.js +13 -33
- package/dist/blocks/entity-card.js.map +1 -1
- package/dist/blocks/eyebrow.d.ts +5 -0
- package/dist/blocks/eyebrow.d.ts.map +1 -1
- package/dist/blocks/eyebrow.js +6 -1
- package/dist/blocks/eyebrow.js.map +1 -1
- package/dist/blocks/feature-cells.d.ts.map +1 -1
- package/dist/blocks/feature-cells.js +1 -1
- package/dist/blocks/feature-cells.js.map +1 -1
- package/dist/blocks/icons.d.ts +13 -0
- package/dist/blocks/icons.d.ts.map +1 -1
- package/dist/blocks/icons.js +13 -0
- package/dist/blocks/icons.js.map +1 -1
- package/dist/blocks/phosphor-marks.d.ts +4 -0
- package/dist/blocks/phosphor-marks.d.ts.map +1 -1
- package/dist/blocks/phosphor-marks.js +6 -0
- package/dist/blocks/phosphor-marks.js.map +1 -1
- package/dist/blocks/pricing-tier-cards.d.ts.map +1 -1
- package/dist/blocks/pricing-tier-cards.js +1 -1
- package/dist/blocks/pricing-tier-cards.js.map +1 -1
- package/dist/blocks/side-nav.d.ts +6 -1
- package/dist/blocks/side-nav.d.ts.map +1 -1
- package/dist/blocks/side-nav.js.map +1 -1
- package/dist/blocks/stat-tile.d.ts.map +1 -1
- package/dist/blocks/stat-tile.js +6 -2
- package/dist/blocks/stat-tile.js.map +1 -1
- package/dist/blocks/tab-bar.d.ts +105 -2
- package/dist/blocks/tab-bar.d.ts.map +1 -1
- package/dist/blocks/tab-bar.js +15 -2
- package/dist/blocks/tab-bar.js.map +1 -1
- package/dist/blocks/tool-setup.js +1 -1
- package/dist/blocks/tool-setup.js.map +1 -1
- package/dist/brand/email/headline-access-request.png +0 -0
- package/dist/brand/email/headline-approval-needed.png +0 -0
- package/dist/brand/email/headline-new-reaction.png +0 -0
- package/dist/brand/email/headline-new-version.png +0 -0
- package/dist/brand/email/headline-picked-up.png +0 -0
- package/dist/brand/email/headline-remixed.png +0 -0
- package/dist/brand/email/headline-request-approved.png +0 -0
- package/dist/brand/email/headline-sign-in-link.png +0 -0
- package/dist/email/assets.d.ts +48 -0
- package/dist/email/assets.d.ts.map +1 -1
- package/dist/email/assets.js +8 -0
- package/dist/email/assets.js.map +1 -1
- package/dist/email/index.d.ts +34 -0
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +81 -25
- package/dist/email/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/shadcn.css +26 -0
- package/dist/ui/dialog.d.ts +1 -1
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +14 -3
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/drawer.d.ts +1 -1
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +11 -3
- package/dist/ui/drawer.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +14 -1
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +21 -2
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/popover.d.ts +1 -72
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +35 -9
- package/dist/ui/popover.js.map +1 -1
- package/dist/ui/progress-bar.d.ts +7 -0
- package/dist/ui/progress-bar.d.ts.map +1 -0
- package/dist/ui/progress-bar.js +44 -0
- package/dist/ui/progress-bar.js.map +1 -0
- package/dist/ui/separator.js +1 -1
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/spinner.d.ts +44 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/spinner.js +54 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/tabs.d.ts +6 -0
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +11 -5
- package/dist/ui/tabs.js.map +1 -1
- package/package.json +1 -1
package/dist/ui/dropdown-menu.js
CHANGED
|
@@ -29,8 +29,27 @@ function DropdownMenuGroup({ ...props }) {
|
|
|
29
29
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
30
30
|
return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("px-1.5 py-1 text-caption font-medium text-muted-foreground data-inset:pl-7", className), ...props }));
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* The item look, shared by the button item and the link item so the two cannot
|
|
34
|
+
* drift: a menu that mixes "Profile" (a link) with "Sign out" (an action) must
|
|
35
|
+
* not show two kinds of row.
|
|
36
|
+
*/
|
|
37
|
+
const ITEM_CLASS = "group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-body-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive";
|
|
32
38
|
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
33
|
-
return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn(
|
|
39
|
+
return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn(ITEM_CLASS, className), ...props }));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A menu row that is a real link (#163). `<a href>` rather than a button that
|
|
43
|
+
* calls `router.push`, so middle-click, open-in-new-tab and link semantics all
|
|
44
|
+
* work, and it is still a `menuitem` that arrow keys reach: Base UI's
|
|
45
|
+
* `Menu.LinkItem` takes part in the menu's roving focus like any other item.
|
|
46
|
+
*
|
|
47
|
+
* Same look as `DropdownMenuItem`, without the destructive variant: a link
|
|
48
|
+
* navigates, it does not destroy. For a framework router pass its link as
|
|
49
|
+
* `render`, e.g. `render={<Link href="/profile" />}`.
|
|
50
|
+
*/
|
|
51
|
+
function DropdownMenuLinkItem({ className, inset, ...props }) {
|
|
52
|
+
return (_jsx(MenuPrimitive.LinkItem, { "data-slot": "dropdown-menu-link-item", "data-inset": inset, "data-variant": "default", className: cn(ITEM_CLASS, "no-underline", className), ...props }));
|
|
34
53
|
}
|
|
35
54
|
function DropdownMenuSub({ ...props }) {
|
|
36
55
|
return _jsx(MenuPrimitive.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...props });
|
|
@@ -56,5 +75,5 @@ function DropdownMenuSeparator({ className, ...props }) {
|
|
|
56
75
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
57
76
|
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("ml-auto text-caption tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className), ...props }));
|
|
58
77
|
}
|
|
59
|
-
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
78
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuLinkItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
60
79
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../src/ui/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAE3D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEjE,SAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAA4B;IAC1D,OAAO,KAAC,aAAa,CAAC,IAAI,iBAAW,eAAe,KAAK,KAAK,GAAI,CAAA;AACpE,CAAC;AAED,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAA8B;IAClE,OAAO,KAAC,aAAa,CAAC,MAAM,iBAAW,sBAAsB,KAAK,KAAK,GAAI,CAAA;AAC7E,CAAC;AAED,SAAS,mBAAmB,CAAC,EAAE,GAAG,KAAK,EAA+B;IACpE,OAAO,KAAC,aAAa,CAAC,OAAO,iBAAW,uBAAuB,KAAK,KAAK,GAAI,CAAA;AAC/E,CAAC;AAED;;;;;;GAMG;AACH,SAAS,mBAAmB,CAAC,EAC3B,KAAK,GAAG,OAAO,EACf,WAAW,GAAG,CAAC,EACf,IAAI,GAAG,QAAQ,EACf,UAAU,GAAG,CAAC,EACd,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EAMqC;IAC7C,OAAO,CACL,KAAC,aAAa,CAAC,MAAM,IAAC,SAAS,EAAE,SAAS,YACx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AAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,CACL,KAAC,aAAa,CAAC,SAAS,iBACZ,yBAAyB,EACnC,SAAS,EAAE,EAAE,CAAC,2BAA2B,EAAE,SAAS,CAAC,KACjD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACqB;IAC7B,OAAO,CACL,4BACY,wBAAwB,EAClC,SAAS,EAAE,EAAE,CACX,kHAAkH,EAClH,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,CAAA"}
|
package/dist/ui/popover.d.ts
CHANGED
|
@@ -1,77 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
3
|
-
|
|
4
|
-
* An anchored panel: a button, and a container that opens against it (#228).
|
|
5
|
-
*
|
|
6
|
-
* The third overlay in this library and the first one that is neither centred
|
|
7
|
-
* nor a menu. `Dialog` is modal and sits in the middle of the viewport, which is
|
|
8
|
-
* wrong for an editor attached to the control that opened it. `DropdownMenu` is
|
|
9
|
-
* a menu: its children are `role="menuitem"`, arrow keys move between them, and
|
|
10
|
-
* typing jumps to a label. A panel holding two radio groups, a checkbox list and
|
|
11
|
-
* two buttons is not a menu, and announcing it as one tells a screen reader user
|
|
12
|
-
* that Escape and the arrow keys mean something they do not.
|
|
13
|
-
*
|
|
14
|
-
* The console hand-rolls exactly this in `HeaderVisibilityPopover.tsx` — its own
|
|
15
|
-
* portal, its own outside-click listener, its own Escape handler, its own focus
|
|
16
|
-
* return. All four are Base UI defaults here, which is the whole reason this is a
|
|
17
|
-
* library primitive rather than a copy of that file.
|
|
18
|
-
*
|
|
19
|
-
* ## What comes from Base UI, and is therefore asserted rather than written
|
|
20
|
-
*
|
|
21
|
-
* `role="dialog"` on the popup, `aria-labelledby` pointing at `PopoverTitle`
|
|
22
|
-
* whenever one is rendered and absent when one is not, Escape and outside-press
|
|
23
|
-
* dismiss, focus moving to the first tabbable element on open, and focus
|
|
24
|
-
* returning to the trigger on close. None of it is reimplemented here. All of it
|
|
25
|
-
* is covered in `registry/e2e/radio-group-popover.spec.ts`, because "the library
|
|
26
|
-
* gives us this" is a claim and this repo measures claims.
|
|
27
|
-
*
|
|
28
|
-
* It is NOT modal by default. Page scroll stays live and the rest of the document
|
|
29
|
-
* stays interactive, which is right for an editor anchored to a header button.
|
|
30
|
-
* Pass `modal` through to `Popover` for the other behaviour.
|
|
31
|
-
*
|
|
32
|
-
* ## `container`, and the surface it exists for
|
|
33
|
-
*
|
|
34
|
-
* Base UI portals the popup to `<body>`. Every `--cg-*` value in this system is
|
|
35
|
-
* inherited, and `data-cg-surface` is a container attribute, so a popup portaled
|
|
36
|
-
* to the body escapes its surface scope entirely: a popover opened from a button
|
|
37
|
-
* inside an ink header renders with the page's tokens, and looks completely
|
|
38
|
-
* correct in the only place anyone checks.
|
|
39
|
-
*
|
|
40
|
-
* `container` forwards to `Popover.Portal`'s own prop, so a consumer can anchor
|
|
41
|
-
* the portal inside the surface. The gallery uses it to render this component on
|
|
42
|
-
* the panel and on ink for real; without it the three frames would be three
|
|
43
|
-
* copies of the page one wearing different borders.
|
|
44
|
-
*
|
|
45
|
-
* ## Tokens, and the one thing an overlay cannot inherit
|
|
46
|
-
*
|
|
47
|
-
* Card ground, control border, raised shadow, per #228. `bg-popover` resolves to
|
|
48
|
-
* `--cg-surface-card` and `--popover` is declared once per surface scope, so the
|
|
49
|
-
* ground flips with the surface (rule 2).
|
|
50
|
-
*
|
|
51
|
-
* On the two dark surfaces that card ground is `transparent` (panel) and a 4%
|
|
52
|
-
* white wash (ink), because a CARD on a purple panel is meant to let the purple
|
|
53
|
-
* through — `shadcn.css` says so in as many words. An OVERLAY is the one thing
|
|
54
|
-
* that cannot: it is drawn over arbitrary content, and a transparent panel over a
|
|
55
|
-
* list renders both sets of words on top of each other. Measured, not assumed:
|
|
56
|
-
* the first version of this component was completely illegible on both dark
|
|
57
|
-
* frames in the gallery and completely correct on white, which is the only place
|
|
58
|
-
* anyone would have looked.
|
|
59
|
-
*
|
|
60
|
-
* So the ground is opaque in every scope, out of values this system already has:
|
|
61
|
-
* the card ground on the page, and each dark surface's OWN ground on the dark
|
|
62
|
-
* surfaces. No new token and no new colour — `bg-panel` is `--cg-surface-panel`
|
|
63
|
-
* and `bg-code` is `--cg-surface-code`. The panel is then told apart from what is
|
|
64
|
-
* behind it by the border and the shadow rather than by a tint, which is what
|
|
65
|
-
* both of those are for.
|
|
66
|
-
*
|
|
67
|
-
* KNOWN, and not fixed here: `Dialog`, `DropdownMenu`, `Select` and `Combobox`
|
|
68
|
-
* are all authored with `bg-popover` and have the same hole on the same two
|
|
69
|
-
* surfaces. The one-line fix is `--popover` per scope in `shadcn.css`, beside the
|
|
70
|
-
* four backgrounds that already get that treatment, and it changes what four
|
|
71
|
-
* shipped components render on dark grounds — which is a design-system decision
|
|
72
|
-
* rather than a line in a PR about two primitives.
|
|
73
|
-
*/
|
|
74
|
-
declare function Popover({ ...props }: PopoverPrimitive.Root.Props): React.JSX.Element;
|
|
3
|
+
declare function Popover({ modal, ...props }: PopoverPrimitive.Root.Props): React.JSX.Element;
|
|
75
4
|
declare function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props): React.JSX.Element;
|
|
76
5
|
declare function PopoverPortal({ ...props }: PopoverPrimitive.Portal.Props): React.JSX.Element;
|
|
77
6
|
declare function PopoverClose({ ...props }: PopoverPrimitive.Close.Props): React.JSX.Element;
|
package/dist/ui/popover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/ui/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/ui/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AA6FpE,iBAAS,OAAO,CAAC,EAAE,KAAa,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,qBAMxE;AAED,iBAAS,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,OAAO,CAAC,KAAK,qBAEnE;AAED,iBAAS,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,qBAEjE;AAED,iBAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,qBAQ/D;AAED,iBAAS,cAAc,CAAC,EACtB,KAAe,EACf,WAAe,EACf,IAAe,EACf,UAAc,EACd,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,GAC7B,IAAI,CACF,gBAAgB,CAAC,UAAU,CAAC,KAAK,EACjC,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,CAChD,GACD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,qBAkCjD;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,qBAW1E;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,CAAC,WAAW,CAAC,KAAK,qBAQpC;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ1E;AAED,OAAO,EACL,OAAO,EACP,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,GACf,CAAA"}
|
package/dist/ui/popover.js
CHANGED
|
@@ -67,15 +67,30 @@ import { cn } from "../lib/cloudgrid-cn.js";
|
|
|
67
67
|
* behind it by the border and the shadow rather than by a tint, which is what
|
|
68
68
|
* both of those are for.
|
|
69
69
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* rather than a line in a PR about two primitives.
|
|
70
|
+
* `Dialog`, `DropdownMenu`, `Select` and `Combobox` are authored with
|
|
71
|
+
* `bg-popover` and had the same hole on the same two surfaces. #230 closed it at
|
|
72
|
+
* the bridge: `shadcn.css` now declares `--popover` per scope with these same
|
|
73
|
+
* two values, so `bg-popover` alone is opaque everywhere. The explicit
|
|
74
|
+
* `bg-panel` / `bg-code` here are kept; they now agree with the bridge.
|
|
76
75
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
/**
|
|
77
|
+
* `aria-modal`, claimed only when the popover really is modal (#247).
|
|
78
|
+
*
|
|
79
|
+
* Base UI traps focus in a popover only when the root is `modal` AND a
|
|
80
|
+
* `Popover.Close` part is rendered inside the popup (`focusManagerModal` in
|
|
81
|
+
* `PopoverPopup`). It never sets `aria-modal`, and the popup cannot read either
|
|
82
|
+
* half from its own state. A popover that does not trap must not announce
|
|
83
|
+
* itself as modal, so the same two halves are tracked here: the root records
|
|
84
|
+
* `modal`, and each `PopoverClose` inside `PopoverContent` registers itself.
|
|
85
|
+
*
|
|
86
|
+
* A raw `PopoverPrimitive.Close` does not register, so a popover built with one
|
|
87
|
+
* traps focus without saying `aria-modal`. Use `PopoverClose`.
|
|
88
|
+
*/
|
|
89
|
+
const PopoverModalContext = React.createContext(false);
|
|
90
|
+
const PopoverCloseRegistry = React.createContext(null);
|
|
91
|
+
const useIsoLayoutEffect = typeof document === "undefined" ? React.useEffect : React.useLayoutEffect;
|
|
92
|
+
function Popover({ modal = false, ...props }) {
|
|
93
|
+
return (_jsx(PopoverModalContext.Provider, { value: modal, children: _jsx(PopoverPrimitive.Root, { modal: modal, ...props }) }));
|
|
79
94
|
}
|
|
80
95
|
function PopoverTrigger({ ...props }) {
|
|
81
96
|
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
@@ -84,10 +99,21 @@ function PopoverPortal({ ...props }) {
|
|
|
84
99
|
return _jsx(PopoverPrimitive.Portal, { "data-slot": "popover-portal", ...props });
|
|
85
100
|
}
|
|
86
101
|
function PopoverClose({ ...props }) {
|
|
102
|
+
const register = React.useContext(PopoverCloseRegistry);
|
|
103
|
+
useIsoLayoutEffect(() => {
|
|
104
|
+
if (!register)
|
|
105
|
+
return;
|
|
106
|
+
register(1);
|
|
107
|
+
return () => register(-1);
|
|
108
|
+
}, [register]);
|
|
87
109
|
return _jsx(PopoverPrimitive.Close, { "data-slot": "popover-close", ...props });
|
|
88
110
|
}
|
|
89
111
|
function PopoverContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 8, container, className, ...props }) {
|
|
90
|
-
|
|
112
|
+
const modal = React.useContext(PopoverModalContext);
|
|
113
|
+
const [closeParts, setCloseParts] = React.useState(0);
|
|
114
|
+
const register = React.useCallback((delta) => setCloseParts((n) => n + delta), []);
|
|
115
|
+
const trapsFocus = modal !== false && closeParts > 0;
|
|
116
|
+
return (_jsx(PopoverCloseRegistry.Provider, { value: register, children: _jsx(PopoverPrimitive.Portal, { container: container, children: _jsx(PopoverPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(PopoverPrimitive.Popup, { "data-slot": "popover-content", "aria-modal": trapsFocus ? true : undefined, className: cn("grid max-h-(--available-height) w-80 max-w-[calc(100vw-2rem)] origin-(--transform-origin) gap-3 overflow-y-auto rounded-xl border border-line bg-popover p-4 text-body-sm text-popover-foreground shadow-raised duration-100 outline-none in-data-[cg-surface=ink]:bg-code in-data-[cg-surface=panel]:bg-panel data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }) }));
|
|
91
117
|
}
|
|
92
118
|
function PopoverTitle({ className, ...props }) {
|
|
93
119
|
return (_jsx(PopoverPrimitive.Title, { "data-slot": "popover-title", className: cn("font-heading text-body-md leading-none font-medium", className), ...props }));
|
package/dist/ui/popover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/ui/popover.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/ui/popover.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC;;;;;;;;;;;;;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O,CACL,KAAC,gBAAgB,CAAC,KAAK,iBACX,eAAe,EACzB,SAAS,EAAE,EAAE,CACX,oDAAoD,EACpD,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EAC2B;IACnC,OAAO,CACL,KAAC,gBAAgB,CAAC,WAAW,iBACjB,qBAAqB,EAC/B,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,SAAS,CAAC,KAC9C,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACzE,OAAO,CACL,2BACY,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CAAC,uCAAuC,EAAE,SAAS,CAAC,KAC7D,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EACL,OAAO,EACP,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,GACf,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function ProgressBar({ label, className, ...props }: Omit<React.ComponentProps<"div">, "children" | "role"> & {
|
|
3
|
+
/** The accessible name. */
|
|
4
|
+
label?: string;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export { ProgressBar };
|
|
7
|
+
//# sourceMappingURL=progress-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../src/ui/progress-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAyC9B,iBAAS,WAAW,CAAC,EACnB,KAAiB,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG;IAC1D,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,qBAkBA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/cloudgrid-cn.js";
|
|
4
|
+
/**
|
|
5
|
+
* An indeterminate progress bar (#164): work is happening and its length is
|
|
6
|
+
* unknown (a grid provisioning, a build, a plug in flight).
|
|
7
|
+
*
|
|
8
|
+
* A segment slides across a track. The track is `--cg-hover`, the wash declared
|
|
9
|
+
* in all three scopes; the segment is `--cg-text-accent` (purple on the page,
|
|
10
|
+
* white on the panel, lime on ink), the same pair `Spinner` uses.
|
|
11
|
+
*
|
|
12
|
+
* ## Reduced motion keeps a bar, not a blank
|
|
13
|
+
*
|
|
14
|
+
* With `prefers-reduced-motion: reduce` the segment stops, parked at the start
|
|
15
|
+
* of the track, so the bar still reads as "in progress".
|
|
16
|
+
*
|
|
17
|
+
* ## The keyframes ship with the component
|
|
18
|
+
*
|
|
19
|
+
* Like `ShowcaseScroll`, the stylesheet is a React 19 hoisted `<style>` with an
|
|
20
|
+
* `href` and `precedence`, so it is emitted once however many bars render and
|
|
21
|
+
* needs nothing from the consumer's Tailwind config.
|
|
22
|
+
*
|
|
23
|
+
* ## It is a progressbar with no value
|
|
24
|
+
*
|
|
25
|
+
* `role="progressbar"` and an accessible name (`label`, default "Loading"), and
|
|
26
|
+
* deliberately no `aria-valuenow`: an indeterminate bar has no value to report.
|
|
27
|
+
*/
|
|
28
|
+
const PROGRESS_BAR_CSS = `
|
|
29
|
+
[data-slot="progress-bar-segment"] {
|
|
30
|
+
animation: cg-progress-indeterminate 1.4s var(--cg-ease-in-out, ease-in-out) infinite;
|
|
31
|
+
}
|
|
32
|
+
@media (prefers-reduced-motion: reduce) {
|
|
33
|
+
[data-slot="progress-bar-segment"] { animation: none; transform: none; }
|
|
34
|
+
}
|
|
35
|
+
@keyframes cg-progress-indeterminate {
|
|
36
|
+
from { transform: translateX(-100%); }
|
|
37
|
+
to { transform: translateX(250%); }
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
function ProgressBar({ label = "Loading", className, ...props }) {
|
|
41
|
+
return (_jsxs("div", { "data-slot": "progress-bar", role: "progressbar", "aria-label": label, className: cn("relative h-1 w-full overflow-hidden rounded-pill bg-(--cg-hover)", className), ...props, children: [_jsx("style", { href: "cg-progress-bar", precedence: "medium", children: PROGRESS_BAR_CSS }), _jsx("div", { "data-slot": "progress-bar-segment", className: "absolute inset-y-0 left-0 w-2/5 rounded-pill bg-(--cg-text-accent)" })] }));
|
|
42
|
+
}
|
|
43
|
+
export { ProgressBar };
|
|
44
|
+
//# sourceMappingURL=progress-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-bar.js","sourceRoot":"","sources":["../../src/ui/progress-bar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,gBAAgB,GAAG;;;;;;;;;;;CAWxB,CAAA;AAED,SAAS,WAAW,CAAC,EACnB,KAAK,GAAG,SAAS,EACjB,SAAS,EACT,GAAG,KAAK,EAIT;IACC,OAAO,CACL,4BACY,cAAc,EACxB,IAAI,EAAC,aAAa,gBACN,KAAK,EACjB,SAAS,EAAE,EAAE,CAAC,kEAAkE,EAAE,SAAS,CAAC,KACxF,KAAK,aAET,gBAAO,IAAI,EAAC,iBAAiB,EAAC,UAAU,EAAC,QAAQ,YAC9C,gBAAgB,GACX,EACR,2BACY,sBAAsB,EAChC,SAAS,EAAC,oEAAoE,GAC9E,IACE,CACP,CAAA;AACH,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
package/dist/ui/separator.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
4
4
|
import { cn } from "../lib/cloudgrid-cn.js";
|
|
5
5
|
function Separator({ className, orientation = "horizontal", ...props }) {
|
|
6
|
-
return (_jsx(SeparatorPrimitive, { "data-slot": "separator", orientation: orientation, className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className), ...props }));
|
|
6
|
+
return (_jsx(SeparatorPrimitive, { "data-slot": "separator", orientation: orientation, className: cn("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch", className), ...props }));
|
|
7
7
|
}
|
|
8
8
|
export { Separator };
|
|
9
9
|
//# sourceMappingURL=separator.js.map
|
package/dist/ui/separator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","sourceRoot":"","sources":["../../src/ui/separator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE1E,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC,SAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAAW,GAAG,YAAY,EAC1B,GAAG,KAAK,EACiB;IACzB,OAAO,CACL,KAAC,kBAAkB,iBACP,WAAW,EACrB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CACX,
|
|
1
|
+
{"version":3,"file":"separator.js","sourceRoot":"","sources":["../../src/ui/separator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE1E,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC,SAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAAW,GAAG,YAAY,EAC1B,GAAG,KAAK,EACiB;IACzB,OAAO,CACL,KAAC,kBAAkB,iBACP,WAAW,EACrB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CACX,sKAAsK,EACtK,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
/**
|
|
4
|
+
* A loading indicator for work with no known length (#164).
|
|
5
|
+
*
|
|
6
|
+
* Every consumer was hand-rolling one: the Console animated its provisioning
|
|
7
|
+
* rows with an opacity pulse that read as static. This is the library's.
|
|
8
|
+
*
|
|
9
|
+
* ## Sizes are Button's glyph sizes
|
|
10
|
+
*
|
|
11
|
+
* `xs` 12px, `sm` 14px, `default` 16px, `lg` 20px: the glyph rungs `Button`
|
|
12
|
+
* already uses at `xs`, `sm` and `default`, so a spinner swapped in for a
|
|
13
|
+
* button's icon while it works does not move the label.
|
|
14
|
+
*
|
|
15
|
+
* ## Colour reads tokens that flip
|
|
16
|
+
*
|
|
17
|
+
* The arc is `--cg-text-accent` (the brand purple on the page, white on the
|
|
18
|
+
* purple panel, lime on ink) and the track is `--cg-border-hairline`. Both are
|
|
19
|
+
* declared in all three scopes, so the spinner is visible on every surface.
|
|
20
|
+
* `--cg-primary` would be purple on purple inside a panel.
|
|
21
|
+
*
|
|
22
|
+
* ## Reduced motion keeps a glyph, not a blank
|
|
23
|
+
*
|
|
24
|
+
* The arc is drawn whether or not it turns: `motion-safe:animate-spin` only
|
|
25
|
+
* rotates it. With `prefers-reduced-motion: reduce` it is a still quarter-arc on
|
|
26
|
+
* its track, which still says "working" without moving.
|
|
27
|
+
*
|
|
28
|
+
* ## It announces itself
|
|
29
|
+
*
|
|
30
|
+
* `role="status"` with an accessible name (`label`, default "Loading"). Inside a
|
|
31
|
+
* control that already says what is happening (a button labelled "Plugging"),
|
|
32
|
+
* pass `decorative` and it is hidden from assistive technology instead.
|
|
33
|
+
*/
|
|
34
|
+
declare const spinnerVariants: (props?: ({
|
|
35
|
+
size?: "default" | "xs" | "sm" | "lg" | null | undefined;
|
|
36
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
37
|
+
declare function Spinner({ size, label, decorative, className, ...props }: Omit<React.ComponentProps<"span">, "children"> & VariantProps<typeof spinnerVariants> & {
|
|
38
|
+
/** The accessible name. Ignored when `decorative`. */
|
|
39
|
+
label?: string;
|
|
40
|
+
/** Hide it from assistive technology, for a control that already names the work. */
|
|
41
|
+
decorative?: boolean;
|
|
42
|
+
}): React.JSX.Element;
|
|
43
|
+
export { Spinner, spinnerVariants };
|
|
44
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/ui/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,QAAA,MAAM,eAAe;;8EAUnB,CAAA;AAEF,iBAAS,OAAO,CAAC,EACf,IAAgB,EAChB,KAAiB,EACjB,UAAkB,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAC/C,YAAY,CAAC,OAAO,eAAe,CAAC,GAAG;IACrC,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oFAAoF;IACpF,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,qBAkCF;AAED,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/cloudgrid-cn.js";
|
|
5
|
+
/**
|
|
6
|
+
* A loading indicator for work with no known length (#164).
|
|
7
|
+
*
|
|
8
|
+
* Every consumer was hand-rolling one: the Console animated its provisioning
|
|
9
|
+
* rows with an opacity pulse that read as static. This is the library's.
|
|
10
|
+
*
|
|
11
|
+
* ## Sizes are Button's glyph sizes
|
|
12
|
+
*
|
|
13
|
+
* `xs` 12px, `sm` 14px, `default` 16px, `lg` 20px: the glyph rungs `Button`
|
|
14
|
+
* already uses at `xs`, `sm` and `default`, so a spinner swapped in for a
|
|
15
|
+
* button's icon while it works does not move the label.
|
|
16
|
+
*
|
|
17
|
+
* ## Colour reads tokens that flip
|
|
18
|
+
*
|
|
19
|
+
* The arc is `--cg-text-accent` (the brand purple on the page, white on the
|
|
20
|
+
* purple panel, lime on ink) and the track is `--cg-border-hairline`. Both are
|
|
21
|
+
* declared in all three scopes, so the spinner is visible on every surface.
|
|
22
|
+
* `--cg-primary` would be purple on purple inside a panel.
|
|
23
|
+
*
|
|
24
|
+
* ## Reduced motion keeps a glyph, not a blank
|
|
25
|
+
*
|
|
26
|
+
* The arc is drawn whether or not it turns: `motion-safe:animate-spin` only
|
|
27
|
+
* rotates it. With `prefers-reduced-motion: reduce` it is a still quarter-arc on
|
|
28
|
+
* its track, which still says "working" without moving.
|
|
29
|
+
*
|
|
30
|
+
* ## It announces itself
|
|
31
|
+
*
|
|
32
|
+
* `role="status"` with an accessible name (`label`, default "Loading"). Inside a
|
|
33
|
+
* control that already says what is happening (a button labelled "Plugging"),
|
|
34
|
+
* pass `decorative` and it is hidden from assistive technology instead.
|
|
35
|
+
*/
|
|
36
|
+
const spinnerVariants = cva("inline-block shrink-0", {
|
|
37
|
+
variants: {
|
|
38
|
+
size: {
|
|
39
|
+
xs: "size-3",
|
|
40
|
+
sm: "size-3.5",
|
|
41
|
+
default: "size-4",
|
|
42
|
+
lg: "size-5",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: { size: "default" },
|
|
46
|
+
});
|
|
47
|
+
function Spinner({ size = "default", label = "Loading", decorative = false, className, ...props }) {
|
|
48
|
+
const a11y = decorative
|
|
49
|
+
? { "aria-hidden": true }
|
|
50
|
+
: { role: "status", "aria-label": label };
|
|
51
|
+
return (_jsx("span", { "data-slot": "spinner", "data-size": size, ...a11y, className: cn(spinnerVariants({ size }), className), ...props, children: _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", className: "size-full motion-safe:animate-spin", children: [_jsx("circle", { cx: "8", cy: "8", r: "6.5", strokeWidth: "1.5", className: "stroke-(--cg-border-hairline)" }), _jsx("path", { d: "M8 1.5a6.5 6.5 0 0 1 6.5 6.5", strokeWidth: "1.5", strokeLinecap: "round", className: "stroke-(--cg-text-accent)" })] }) }));
|
|
52
|
+
}
|
|
53
|
+
export { Spinner, spinnerVariants };
|
|
54
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/ui/spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,eAAe,GAAG,GAAG,CAAC,uBAAuB,EAAE;IACnD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,QAAQ;YACZ,EAAE,EAAE,UAAU;YACd,OAAO,EAAE,QAAQ;YACjB,EAAE,EAAE,QAAQ;SACb;KACF;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;CACrC,CAAC,CAAA;AAEF,SAAS,OAAO,CAAC,EACf,IAAI,GAAG,SAAS,EAChB,KAAK,GAAG,SAAS,EACjB,UAAU,GAAG,KAAK,EAClB,SAAS,EACT,GAAG,KAAK,EAOP;IACD,MAAM,IAAI,GAAG,UAAU;QACrB,CAAC,CAAC,EAAE,aAAa,EAAE,IAAa,EAAE;QAClC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,CAAA;IAC3C,OAAO,CACL,4BACY,SAAS,eACR,IAAI,KACX,IAAI,EACR,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KAC/C,KAAK,YAET,eACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,iBACC,MAAM,EAClB,SAAS,EAAC,oCAAoC,aAE9C,iBACE,EAAE,EAAC,GAAG,EACN,EAAE,EAAC,GAAG,EACN,CAAC,EAAC,KAAK,EACP,WAAW,EAAC,KAAK,EACjB,SAAS,EAAC,+BAA+B,GACzC,EACF,eACE,CAAC,EAAC,8BAA8B,EAChC,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,SAAS,EAAC,2BAA2B,GACrC,IACE,GACD,CACR,CAAA;AACH,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
package/dist/ui/tabs.d.ts
CHANGED
|
@@ -20,6 +20,12 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
20
20
|
* The cost of a scroller is that the active chip can start off-screen, which is
|
|
21
21
|
* the one thing a reader needs to see. `scrollActiveTabIntoView` pays it on
|
|
22
22
|
* mount.
|
|
23
|
+
*
|
|
24
|
+
* Orientation is matched as `data-[orientation=…]`, the attribute Base UI emits
|
|
25
|
+
* (#246). shadcn's `data-horizontal:` spelling compiles to `[data-horizontal]`
|
|
26
|
+
* unless the consumer imports `shadcn/tailwind.css`, which the Console does not,
|
|
27
|
+
* so every horizontal tab set there laid its list beside the panel. Guarded by
|
|
28
|
+
* `test/orientation-variant.test.mjs`.
|
|
23
29
|
*/
|
|
24
30
|
/**
|
|
25
31
|
* Bring the active chip into view inside its own scroll port, on mount.
|
package/dist/ui/tabs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/ui/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/ui/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,uBAAuB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,QAapE;AAUD,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,WAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,qBAY1B;AAED,QAAA,MAAM,gBAAgB;;8EAkCrB,CAAA;AAED,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,OAAmB,EACnB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,qBA+BlE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,qBAqCpE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,qBAmBtE;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,CAAA"}
|
package/dist/ui/tabs.js
CHANGED
|
@@ -23,6 +23,12 @@ import { cn } from "../lib/cloudgrid-cn.js";
|
|
|
23
23
|
* The cost of a scroller is that the active chip can start off-screen, which is
|
|
24
24
|
* the one thing a reader needs to see. `scrollActiveTabIntoView` pays it on
|
|
25
25
|
* mount.
|
|
26
|
+
*
|
|
27
|
+
* Orientation is matched as `data-[orientation=…]`, the attribute Base UI emits
|
|
28
|
+
* (#246). shadcn's `data-horizontal:` spelling compiles to `[data-horizontal]`
|
|
29
|
+
* unless the consumer imports `shadcn/tailwind.css`, which the Console does not,
|
|
30
|
+
* so every horizontal tab set there laid its list beside the panel. Guarded by
|
|
31
|
+
* `test/orientation-variant.test.mjs`.
|
|
26
32
|
*/
|
|
27
33
|
/**
|
|
28
34
|
* Bring the active chip into view inside its own scroll port, on mount.
|
|
@@ -66,9 +72,9 @@ function scrollActiveTabIntoView(list) {
|
|
|
66
72
|
*/
|
|
67
73
|
const useIsoLayoutEffect = typeof document === "undefined" ? React.useEffect : React.useLayoutEffect;
|
|
68
74
|
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
69
|
-
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, className: cn("group/tabs flex gap-2 data-horizontal:flex-col", className), ...props }));
|
|
75
|
+
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, className: cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", className), ...props }));
|
|
70
76
|
}
|
|
71
|
-
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
77
|
+
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-8 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
72
78
|
variants: {
|
|
73
79
|
variant: {
|
|
74
80
|
default: "bg-muted",
|
|
@@ -93,7 +99,7 @@ const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center jus
|
|
|
93
99
|
// Hiding it is safe here and would not be on a vertical list: the
|
|
94
100
|
// active chip is scrolled in on mount, arrow keys move between chips,
|
|
95
101
|
// and a touch reader drags.
|
|
96
|
-
pill: "relative w-full max-w-full justify-start gap-2 overflow-x-auto rounded-none bg-transparent p-0 py-1 group-data-horizontal/tabs:h-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
102
|
+
pill: "relative w-full max-w-full justify-start gap-2 overflow-x-auto rounded-none bg-transparent p-0 py-1 group-data-[orientation=horizontal]/tabs:h-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
97
103
|
},
|
|
98
104
|
},
|
|
99
105
|
defaultVariants: {
|
|
@@ -126,7 +132,7 @@ function TabsList({ className, variant = "default", ref, ...props }) {
|
|
|
126
132
|
}, className: cn(tabsListVariants({ variant }), className), ...props }));
|
|
127
133
|
}
|
|
128
134
|
function TabsTrigger({ className, ...props }) {
|
|
129
|
-
return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-body-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
135
|
+
return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-body-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
130
136
|
// THE PILL CHIP (ui#256).
|
|
131
137
|
//
|
|
132
138
|
// Every rule is scoped to the list's variant rather than added to the
|
|
@@ -148,7 +154,7 @@ function TabsTrigger({ className, ...props }) {
|
|
|
148
154
|
// `packages/ui/test/contrast-guardrail.test.mjs`. `text-brand` alone
|
|
149
155
|
// would be purple on purple inside a panel; the tint alone would be
|
|
150
156
|
// inherited body text on lavender.
|
|
151
|
-
"group-data-[variant=pill]/tabs-list:data-active:border-brand-200 group-data-[variant=pill]/tabs-list:data-active:bg-brand-tint group-data-[variant=pill]/tabs-list:data-active:text-brand", "group-data-[variant=pill]/tabs-list:hover:text-ink group-data-[variant=pill]/tabs-list:data-active:hover:text-brand", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className), ...props }));
|
|
157
|
+
"group-data-[variant=pill]/tabs-list:data-active:border-brand-200 group-data-[variant=pill]/tabs-list:data-active:bg-brand-tint group-data-[variant=pill]/tabs-list:data-active:text-brand", "group-data-[variant=pill]/tabs-list:hover:text-ink group-data-[variant=pill]/tabs-list:data-active:hover:text-brand", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className), ...props }));
|
|
152
158
|
}
|
|
153
159
|
function TabsContent({ className, ...props }) {
|
|
154
160
|
return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", className: cn("flex-1 text-body-sm outline-none",
|
package/dist/ui/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/ui/tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/ui/tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,uBAAuB,CAAC,IAAoC;IACnE,IAAI,CAAC,IAAI;QAAE,OAAM;IACjB,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAc,yCAAyC,CAAC,CAAA;IACzF,IAAI,CAAC,MAAM;QAAE,OAAM;IAEnB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;IACpD,6EAA6E;IAC7E,6EAA6E;IAC7E,gEAAgE;IAChE,IAAI,QAAQ,IAAI,CAAC;QAAE,OAAM;IAEzB,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,GAAG,CAAC,IAAI,C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