@tea-ui/core 0.1.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/LICENSE +21 -0
- package/README.md +33 -0
- package/dist/card.d.ts +60 -0
- package/dist/card.js +116 -0
- package/dist/card.js.map +1 -0
- package/dist/feedback/alert.d.ts +57 -0
- package/dist/feedback/alert.js +104 -0
- package/dist/feedback/alert.js.map +1 -0
- package/dist/feedback/badge.d.ts +34 -0
- package/dist/feedback/badge.js +62 -0
- package/dist/feedback/badge.js.map +1 -0
- package/dist/feedback/index.d.ts +13 -0
- package/dist/feedback/index.js +62 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/feedback/progress.d.ts +25 -0
- package/dist/feedback/progress.js +49 -0
- package/dist/feedback/progress.js.map +1 -0
- package/dist/feedback/skeleton.d.ts +38 -0
- package/dist/feedback/skeleton.js +49 -0
- package/dist/feedback/skeleton.js.map +1 -0
- package/dist/feedback/spinner.d.ts +31 -0
- package/dist/feedback/spinner.js +55 -0
- package/dist/feedback/spinner.js.map +1 -0
- package/dist/feedback/status.d.ts +63 -0
- package/dist/feedback/status.js +156 -0
- package/dist/feedback/status.js.map +1 -0
- package/dist/feedback/toast.d.ts +72 -0
- package/dist/feedback/toast.js +211 -0
- package/dist/feedback/toast.js.map +1 -0
- package/dist/format/index.d.ts +63 -0
- package/dist/format/index.js +84 -0
- package/dist/format/index.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +163 -0
- package/dist/index.js.map +1 -0
- package/dist/inputs/button-group.d.ts +70 -0
- package/dist/inputs/button-group.js +59 -0
- package/dist/inputs/button-group.js.map +1 -0
- package/dist/inputs/button.d.ts +52 -0
- package/dist/inputs/button.js +84 -0
- package/dist/inputs/button.js.map +1 -0
- package/dist/inputs/checkbox.d.ts +48 -0
- package/dist/inputs/checkbox.js +74 -0
- package/dist/inputs/checkbox.js.map +1 -0
- package/dist/inputs/combobox.d.ts +77 -0
- package/dist/inputs/combobox.js +273 -0
- package/dist/inputs/combobox.js.map +1 -0
- package/dist/inputs/field.d.ts +220 -0
- package/dist/inputs/field.js +183 -0
- package/dist/inputs/field.js.map +1 -0
- package/dist/inputs/icon-button.d.ts +44 -0
- package/dist/inputs/icon-button.js +30 -0
- package/dist/inputs/icon-button.js.map +1 -0
- package/dist/inputs/index.d.ts +22 -0
- package/dist/inputs/index.js +92 -0
- package/dist/inputs/index.js.map +1 -0
- package/dist/inputs/input-group.d.ts +77 -0
- package/dist/inputs/input-group.js +76 -0
- package/dist/inputs/input-group.js.map +1 -0
- package/dist/inputs/input.d.ts +58 -0
- package/dist/inputs/input.js +68 -0
- package/dist/inputs/input.js.map +1 -0
- package/dist/inputs/label.d.ts +47 -0
- package/dist/inputs/label.js +29 -0
- package/dist/inputs/label.js.map +1 -0
- package/dist/inputs/number-input.d.ts +62 -0
- package/dist/inputs/number-input.js +86 -0
- package/dist/inputs/number-input.js.map +1 -0
- package/dist/inputs/password-input.d.ts +66 -0
- package/dist/inputs/password-input.js +73 -0
- package/dist/inputs/password-input.js.map +1 -0
- package/dist/inputs/radio.d.ts +66 -0
- package/dist/inputs/radio.js +96 -0
- package/dist/inputs/radio.js.map +1 -0
- package/dist/inputs/search-input.d.ts +66 -0
- package/dist/inputs/search-input.js +76 -0
- package/dist/inputs/search-input.js.map +1 -0
- package/dist/inputs/select.d.ts +65 -0
- package/dist/inputs/select.js +139 -0
- package/dist/inputs/select.js.map +1 -0
- package/dist/inputs/slider.d.ts +67 -0
- package/dist/inputs/slider.js +107 -0
- package/dist/inputs/slider.js.map +1 -0
- package/dist/inputs/switch.d.ts +42 -0
- package/dist/inputs/switch.js +69 -0
- package/dist/inputs/switch.js.map +1 -0
- package/dist/inputs/textarea.d.ts +51 -0
- package/dist/inputs/textarea.js +82 -0
- package/dist/inputs/textarea.js.map +1 -0
- package/dist/inputs/toggle.d.ts +57 -0
- package/dist/inputs/toggle.js +91 -0
- package/dist/inputs/toggle.js.map +1 -0
- package/dist/internal/index.d.ts +5 -0
- package/dist/internal/index.js +19 -0
- package/dist/internal/index.js.map +1 -0
- package/dist/internal/refs.d.ts +31 -0
- package/dist/internal/refs.js +34 -0
- package/dist/internal/refs.js.map +1 -0
- package/dist/internal/slot.d.ts +76 -0
- package/dist/internal/slot.js +40 -0
- package/dist/internal/slot.js.map +1 -0
- package/dist/internal/use-controllable-state.d.ts +25 -0
- package/dist/internal/use-controllable-state.js +38 -0
- package/dist/internal/use-controllable-state.js.map +1 -0
- package/dist/layout/index.d.ts +131 -0
- package/dist/layout/index.js +212 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/navigation/index.d.ts +114 -0
- package/dist/navigation/index.js +523 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/overlays/alert-dialog.d.ts +75 -0
- package/dist/overlays/alert-dialog.js +163 -0
- package/dist/overlays/alert-dialog.js.map +1 -0
- package/dist/overlays/dialog.d.ts +44 -0
- package/dist/overlays/dialog.js +121 -0
- package/dist/overlays/dialog.js.map +1 -0
- package/dist/overlays/drawer.d.ts +49 -0
- package/dist/overlays/drawer.js +125 -0
- package/dist/overlays/drawer.js.map +1 -0
- package/dist/overlays/dropdown-menu.d.ts +53 -0
- package/dist/overlays/dropdown-menu.js +192 -0
- package/dist/overlays/dropdown-menu.js.map +1 -0
- package/dist/overlays/index.d.ts +10 -0
- package/dist/overlays/index.js +169 -0
- package/dist/overlays/index.js.map +1 -0
- package/dist/overlays/popover.d.ts +58 -0
- package/dist/overlays/popover.js +105 -0
- package/dist/overlays/popover.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/typography/index.d.ts +79 -0
- package/dist/typography/index.js +280 -0
- package/dist/typography/index.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
4
|
+
import { cn, cva } from "@tea-ui/utils";
|
|
5
|
+
import { COPY } from "@tea-ui/ux-standards";
|
|
6
|
+
import { dataSlot } from "../internal/index.js";
|
|
7
|
+
import { DialogOverlay } from "./dialog.js";
|
|
8
|
+
const drawerVariants = cva(
|
|
9
|
+
[
|
|
10
|
+
"fixed z-modal flex flex-col border-line bg-surface shadow-modal",
|
|
11
|
+
"transition-transform data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
12
|
+
"duration-normal ease-standard"
|
|
13
|
+
],
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
side: {
|
|
17
|
+
start: [
|
|
18
|
+
"inset-y-0 start-0 w-[min(20rem,85vw)] border-e",
|
|
19
|
+
"data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left"
|
|
20
|
+
],
|
|
21
|
+
end: [
|
|
22
|
+
"inset-y-0 end-0 w-[min(24rem,90vw)] border-s",
|
|
23
|
+
"data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right"
|
|
24
|
+
],
|
|
25
|
+
top: [
|
|
26
|
+
"inset-x-0 top-0 max-h-[80dvh] border-b",
|
|
27
|
+
"data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top"
|
|
28
|
+
],
|
|
29
|
+
bottom: [
|
|
30
|
+
"inset-x-0 bottom-0 max-h-[85dvh] border-t rounded-t-none",
|
|
31
|
+
"data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: { side: "end" }
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
const Drawer = DialogPrimitive.Root;
|
|
39
|
+
const DrawerTrigger = DialogPrimitive.Trigger;
|
|
40
|
+
const DrawerClose = DialogPrimitive.Close;
|
|
41
|
+
const DrawerPortal = DialogPrimitive.Portal;
|
|
42
|
+
const DrawerContent = React.forwardRef(
|
|
43
|
+
function DrawerContent2({ className, side = "end", children, showCloseButton = true, closeLabel, ...props }, ref) {
|
|
44
|
+
return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
46
|
+
/* @__PURE__ */ jsxs(
|
|
47
|
+
DialogPrimitive.Content,
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
className: cn(drawerVariants({ side }), className),
|
|
51
|
+
...dataSlot("drawer", "content"),
|
|
52
|
+
...props,
|
|
53
|
+
children: [
|
|
54
|
+
showCloseButton ? /* @__PURE__ */ jsx(DrawerCloseButton, { label: closeLabel }) : null,
|
|
55
|
+
children
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] });
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
function DrawerCloseButton({ label }) {
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
DialogPrimitive.Close,
|
|
65
|
+
{
|
|
66
|
+
"aria-label": label ?? COPY.a11y.close,
|
|
67
|
+
className: "absolute end-3 top-3 p-1 text-fg-muted transition-colors hover:text-fg",
|
|
68
|
+
...dataSlot("drawer", "close"),
|
|
69
|
+
children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\xD7" })
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
const DrawerHeader = React.forwardRef(
|
|
74
|
+
function DrawerHeader2({ className, ...props }, ref) {
|
|
75
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("shrink-0 border-b border-line p-4 pe-12", className), ...dataSlot("drawer", "header"), ...props });
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
const DrawerTitle = React.forwardRef(function DrawerTitle2({ className, ...props }, ref) {
|
|
79
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, className: cn("text-title font-semibold text-fg", className), ...dataSlot("drawer", "title"), ...props });
|
|
80
|
+
});
|
|
81
|
+
const DrawerDescription = React.forwardRef(function DrawerDescription2({ className, ...props }, ref) {
|
|
82
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ref, className: cn("text-micro text-fg-muted", className), ...dataSlot("drawer", "description"), ...props });
|
|
83
|
+
});
|
|
84
|
+
const DrawerBody = React.forwardRef(
|
|
85
|
+
function DrawerBody2({ className, ...props }, ref) {
|
|
86
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("min-h-0 flex-1 overflow-y-auto p-4", className), ...dataSlot("drawer", "body"), ...props });
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
const DrawerFooter = React.forwardRef(
|
|
90
|
+
function DrawerFooter2({ className, ...props }, ref) {
|
|
91
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("shrink-0 border-t border-line p-4", className), ...dataSlot("drawer", "footer"), ...props });
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
const Sheet = Drawer;
|
|
95
|
+
const SheetTrigger = DrawerTrigger;
|
|
96
|
+
const SheetClose = DrawerClose;
|
|
97
|
+
const SheetContent = React.forwardRef(
|
|
98
|
+
function SheetContent2({ className, ...props }, ref) {
|
|
99
|
+
return /* @__PURE__ */ jsx(DrawerContent, { ref, side: "bottom", className: cn("w-full", className), ...props });
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
const SheetHeader = DrawerHeader;
|
|
103
|
+
const SheetBody = DrawerBody;
|
|
104
|
+
const SheetFooter = DrawerFooter;
|
|
105
|
+
export {
|
|
106
|
+
Drawer,
|
|
107
|
+
DrawerBody,
|
|
108
|
+
DrawerClose,
|
|
109
|
+
DrawerContent,
|
|
110
|
+
DrawerDescription,
|
|
111
|
+
DrawerFooter,
|
|
112
|
+
DrawerHeader,
|
|
113
|
+
DrawerPortal,
|
|
114
|
+
DrawerTitle,
|
|
115
|
+
DrawerTrigger,
|
|
116
|
+
Sheet,
|
|
117
|
+
SheetBody,
|
|
118
|
+
SheetClose,
|
|
119
|
+
SheetContent,
|
|
120
|
+
SheetFooter,
|
|
121
|
+
SheetHeader,
|
|
122
|
+
SheetTrigger,
|
|
123
|
+
drawerVariants
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/overlays/drawer.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"@tea-ui/utils\";\nimport { COPY } from \"@tea-ui/ux-standards\";\n\nimport { dataSlot } from \"../internal\";\nimport { DialogOverlay } from \"./dialog\";\n\n/**\n * TEA UI — Drawer and Sheet.\n *\n * The one primitive that replaces three copy-pasted \"right drawer\" overrides in\n * the audit, and the answer to the behaviour *both* source products needed and\n * each implemented separately: below 1024px the sidebar stops being information\n * and becomes an obstruction, so it collapses into an edge panel.\n *\n * `Drawer` is an edge panel on `Dialog`, so it inherits the focus trap, the\n * scroll lock, Escape and focus restoration. `Sheet` is the bottom variant for\n * small screens, where a side panel would fight the system back gesture.\n */\nexport const drawerVariants = cva(\n [\n \"fixed z-modal flex flex-col border-line bg-surface shadow-modal\",\n \"transition-transform data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"duration-normal ease-standard\",\n ],\n {\n variants: {\n side: {\n start: [\n \"inset-y-0 start-0 w-[min(20rem,85vw)] border-e\",\n \"data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left\",\n ],\n end: [\n \"inset-y-0 end-0 w-[min(24rem,90vw)] border-s\",\n \"data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right\",\n ],\n top: [\n \"inset-x-0 top-0 max-h-[80dvh] border-b\",\n \"data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top\",\n ],\n bottom: [\n \"inset-x-0 bottom-0 max-h-[85dvh] border-t rounded-t-none\",\n \"data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom\",\n ],\n },\n },\n defaultVariants: { side: \"end\" },\n },\n);\n\nexport const Drawer = DialogPrimitive.Root;\nexport const DrawerTrigger = DialogPrimitive.Trigger;\nexport const DrawerClose = DialogPrimitive.Close;\nexport const DrawerPortal = DialogPrimitive.Portal;\n\nexport interface DrawerContentProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof drawerVariants> {\n showCloseButton?: boolean | undefined;\n closeLabel?: string | undefined;\n}\n\nexport const DrawerContent = React.forwardRef<HTMLDivElement, DrawerContentProps>(\n function DrawerContent(\n { className, side = \"end\", children, showCloseButton = true, closeLabel, ...props },\n ref,\n ) {\n return (\n <DialogPrimitive.Portal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(drawerVariants({ side }), className)}\n {...dataSlot(\"drawer\", \"content\")}\n {...props}\n >\n {showCloseButton ? <DrawerCloseButton label={closeLabel} /> : null}\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n },\n);\n\nfunction DrawerCloseButton({ label }: { label?: string | undefined }): React.ReactElement {\n return (\n <DialogPrimitive.Close\n aria-label={label ?? COPY.a11y.close}\n className=\"absolute end-3 top-3 p-1 text-fg-muted transition-colors hover:text-fg\"\n {...dataSlot(\"drawer\", \"close\")}\n >\n <span aria-hidden=\"true\">×</span>\n </DialogPrimitive.Close>\n );\n}\n\nexport const DrawerHeader = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(\n function DrawerHeader({ className, ...props }, ref) {\n return (\n <div ref={ref} className={cn(\"shrink-0 border-b border-line p-4 pe-12\", className)} {...dataSlot(\"drawer\", \"header\")} {...props} />\n );\n },\n);\n\n/**\n * A drawer, like a dialog, must have an accessible name. Radix wires the title\n * into the content, so a drawer without one is an unnamed dialog — which is why\n * this exists as a part rather than a bare heading.\n */\nexport const DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(function DrawerTitle({ className, ...props }, ref) {\n return <DialogPrimitive.Title ref={ref} className={cn(\"text-title font-semibold text-fg\", className)} {...dataSlot(\"drawer\", \"title\")} {...props} />;\n});\n\nexport const DrawerDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(function DrawerDescription({ className, ...props }, ref) {\n return <DialogPrimitive.Description ref={ref} className={cn(\"text-micro text-fg-muted\", className)} {...dataSlot(\"drawer\", \"description\")} {...props} />;\n});\n\nexport const DrawerBody = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(\n function DrawerBody({ className, ...props }, ref) {\n return <div ref={ref} className={cn(\"min-h-0 flex-1 overflow-y-auto p-4\", className)} {...dataSlot(\"drawer\", \"body\")} {...props} />;\n },\n);\n\nexport const DrawerFooter = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(\n function DrawerFooter({ className, ...props }, ref) {\n return <div ref={ref} className={cn(\"shrink-0 border-t border-line p-4\", className)} {...dataSlot(\"drawer\", \"footer\")} {...props} />;\n },\n);\n\n/** A bottom sheet: the mobile-safe drawer. */\nexport const Sheet = Drawer;\nexport const SheetTrigger = DrawerTrigger;\nexport const SheetClose = DrawerClose;\nexport const SheetContent = React.forwardRef<HTMLDivElement, DrawerContentProps>(\n function SheetContent({ className, ...props }, ref) {\n return <DrawerContent ref={ref} side=\"bottom\" className={cn(\"w-full\", className)} {...props} />;\n },\n);\nexport const SheetHeader = DrawerHeader;\nexport const SheetBody = DrawerBody;\nexport const SheetFooter = DrawerFooter;\n"],"mappings":"AAsEQ,cACA,YADA;AAtEP,YAAY,WAAW;AACxB,SAAS,UAAU,uBAAuB;AAC1C,SAAS,IAAI,WAA8B;AAC3C,SAAS,YAAY;AAErB,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAcvB,MAAM,iBAAiB;AAAA,EAC5B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,OAAO;AAAA,UACL;AAAA,UACA;AAAA,QACF;AAAA,QACA,KAAK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|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ContextMenu as ContextMenu$1, DropdownMenu as DropdownMenu$1 } from 'radix-ui';
|
|
3
|
+
export { COPY as menuCopy } from '@tea-ui/ux-standards';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* TEA UI — DropdownMenu and ContextMenu.
|
|
7
|
+
*
|
|
8
|
+
* Both source projects shipped a fully built `DropdownMenu` and used it in
|
|
9
|
+
* exactly one place, hand-rolling the rest. This is the one implementation, and
|
|
10
|
+
* the styling defect it fixes is worth naming: the source project's dropdown
|
|
11
|
+
* item highlighted with `bg-muted` while its select item highlighted with
|
|
12
|
+
* `bg-accent`. The same "you are here" moment therefore looked like two
|
|
13
|
+
* different things depending on which control the user was in. Here, a
|
|
14
|
+
* highlighted item is always `bg-accent-subtle` with the foreground brought up.
|
|
15
|
+
*/
|
|
16
|
+
declare const menuContentVariants: string;
|
|
17
|
+
declare const DropdownMenu: React.FC<DropdownMenu$1.DropdownMenuProps>;
|
|
18
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenu$1.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenu$1.DropdownMenuPortalProps>;
|
|
20
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenu$1.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare const DropdownMenuSub: React.FC<DropdownMenu$1.DropdownMenuSubProps>;
|
|
22
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenu$1.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenu$1.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenu$1.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
25
|
+
inset?: boolean | undefined;
|
|
26
|
+
variant?: "default" | "destructive" | undefined;
|
|
27
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenu$1.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenu$1.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenu$1.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
31
|
+
inset?: boolean | undefined;
|
|
32
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenu$1.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
/** A right-aligned keyboard hint. Decorative unless it is the only key shown. */
|
|
35
|
+
declare const DropdownMenuShortcut: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
36
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenu$1.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
37
|
+
inset?: boolean | undefined;
|
|
38
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenu$1.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
declare const ContextMenu: React.FC<ContextMenu$1.ContextMenuProps>;
|
|
41
|
+
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenu$1.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
42
|
+
declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenu$1.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
declare const ContextMenuSub: React.FC<ContextMenu$1.ContextMenuSubProps>;
|
|
44
|
+
declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenu$1.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenu$1.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenu$1.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
47
|
+
inset?: boolean | undefined;
|
|
48
|
+
variant?: "default" | "destructive" | undefined;
|
|
49
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
50
|
+
declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenu$1.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
51
|
+
declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenu$1.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
+
|
|
53
|
+
export { ContextMenu, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuSeparator, ContextMenuSub, ContextMenuTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, menuContentVariants };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { DropdownMenu as DropdownPrimitive, ContextMenu as ContextPrimitive } from "radix-ui";
|
|
4
|
+
import { Check, ChevronRight } from "@tea-ui/icons";
|
|
5
|
+
import { cn } from "@tea-ui/utils";
|
|
6
|
+
import { COPY } from "@tea-ui/ux-standards";
|
|
7
|
+
import { dataSlot } from "../internal/index.js";
|
|
8
|
+
const menuContentVariants = cn(
|
|
9
|
+
"z-dropdown min-w-48 border border-line bg-surface-2 p-1 shadow-overlay",
|
|
10
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
11
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
12
|
+
);
|
|
13
|
+
const itemVariants = cn(
|
|
14
|
+
"relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-ui text-fg outline-none",
|
|
15
|
+
"data-[highlighted]:bg-accent-subtle data-[highlighted]:text-fg",
|
|
16
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
17
|
+
"[&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-fg-muted"
|
|
18
|
+
);
|
|
19
|
+
const DropdownMenu = DropdownPrimitive.Root;
|
|
20
|
+
const DropdownMenuTrigger = DropdownPrimitive.Trigger;
|
|
21
|
+
const DropdownMenuPortal = DropdownPrimitive.Portal;
|
|
22
|
+
const DropdownMenuGroup = DropdownPrimitive.Group;
|
|
23
|
+
const DropdownMenuSub = DropdownPrimitive.Sub;
|
|
24
|
+
const DropdownMenuRadioGroup = DropdownPrimitive.RadioGroup;
|
|
25
|
+
const DropdownMenuContent = React.forwardRef(function DropdownMenuContent2({ className, sideOffset = 4, align = "start", ...props }, ref) {
|
|
26
|
+
return /* @__PURE__ */ jsx(DropdownPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
27
|
+
DropdownPrimitive.Content,
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
sideOffset,
|
|
31
|
+
align,
|
|
32
|
+
collisionPadding: 12,
|
|
33
|
+
className: cn(menuContentVariants, className),
|
|
34
|
+
...dataSlot("menu", "content"),
|
|
35
|
+
...props
|
|
36
|
+
}
|
|
37
|
+
) });
|
|
38
|
+
});
|
|
39
|
+
const DropdownMenuItem = React.forwardRef(function DropdownMenuItem2({ className, inset, variant = "default", ...props }, ref) {
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
DropdownPrimitive.Item,
|
|
42
|
+
{
|
|
43
|
+
ref,
|
|
44
|
+
className: cn(
|
|
45
|
+
itemVariants,
|
|
46
|
+
inset && "ps-8",
|
|
47
|
+
variant === "destructive" && "text-critical data-[highlighted]:bg-critical-subtle data-[highlighted]:text-critical",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...dataSlot("menu", "item"),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
const DropdownMenuCheckboxItem = React.forwardRef(function DropdownMenuCheckboxItem2({ className, children, checked, ...props }, ref) {
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
DropdownPrimitive.CheckboxItem,
|
|
58
|
+
{
|
|
59
|
+
ref,
|
|
60
|
+
checked,
|
|
61
|
+
className: cn(itemVariants, "ps-8", className),
|
|
62
|
+
...dataSlot("menu", "checkbox-item"),
|
|
63
|
+
...props,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx("span", { className: "absolute start-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { size: 14, "aria-hidden": "true" }) }) }),
|
|
66
|
+
children
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
});
|
|
71
|
+
const DropdownMenuRadioItem = React.forwardRef(function DropdownMenuRadioItem2({ className, children, ...props }, ref) {
|
|
72
|
+
return /* @__PURE__ */ jsxs(
|
|
73
|
+
DropdownPrimitive.RadioItem,
|
|
74
|
+
{
|
|
75
|
+
ref,
|
|
76
|
+
className: cn(itemVariants, "ps-8", className),
|
|
77
|
+
...dataSlot("menu", "radio-item"),
|
|
78
|
+
...props,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx("span", { className: "absolute start-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "size-1.5 rounded-pill bg-current" }) }) }),
|
|
81
|
+
children
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
const DropdownMenuLabel = React.forwardRef(function DropdownMenuLabel2({ className, inset, ...props }, ref) {
|
|
87
|
+
return /* @__PURE__ */ jsx(
|
|
88
|
+
DropdownPrimitive.Label,
|
|
89
|
+
{
|
|
90
|
+
ref,
|
|
91
|
+
className: cn("px-2 py-1.5 text-label font-semibold uppercase tracking-widest text-fg-muted", inset && "ps-8", className),
|
|
92
|
+
...dataSlot("menu", "label"),
|
|
93
|
+
...props
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
const DropdownMenuSeparator = React.forwardRef(function DropdownMenuSeparator2({ className, ...props }, ref) {
|
|
98
|
+
return /* @__PURE__ */ jsx(DropdownPrimitive.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-line", className), ...dataSlot("menu", "separator"), ...props });
|
|
99
|
+
});
|
|
100
|
+
const DropdownMenuShortcut = React.forwardRef(
|
|
101
|
+
function DropdownMenuShortcut2({ className, ...props }, ref) {
|
|
102
|
+
return /* @__PURE__ */ jsx("span", { ref, className: cn("ms-auto text-label text-fg-subtle", className), ...dataSlot("menu", "shortcut"), ...props });
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
const DropdownMenuSubTrigger = React.forwardRef(function DropdownMenuSubTrigger2({ className, inset, children, ...props }, ref) {
|
|
106
|
+
return /* @__PURE__ */ jsxs(
|
|
107
|
+
DropdownPrimitive.SubTrigger,
|
|
108
|
+
{
|
|
109
|
+
ref,
|
|
110
|
+
className: cn(itemVariants, inset && "ps-8", className),
|
|
111
|
+
...dataSlot("menu", "sub-trigger"),
|
|
112
|
+
...props,
|
|
113
|
+
children: [
|
|
114
|
+
children,
|
|
115
|
+
/* @__PURE__ */ jsx(ChevronRight, { size: 14, "aria-hidden": "true", className: "ms-auto" })
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
const DropdownMenuSubContent = React.forwardRef(function DropdownMenuSubContent2({ className, ...props }, ref) {
|
|
121
|
+
return /* @__PURE__ */ jsx(DropdownPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
122
|
+
DropdownPrimitive.SubContent,
|
|
123
|
+
{
|
|
124
|
+
ref,
|
|
125
|
+
className: cn(menuContentVariants, className),
|
|
126
|
+
...dataSlot("menu", "sub-content"),
|
|
127
|
+
...props
|
|
128
|
+
}
|
|
129
|
+
) });
|
|
130
|
+
});
|
|
131
|
+
const ContextMenu = ContextPrimitive.Root;
|
|
132
|
+
const ContextMenuTrigger = ContextPrimitive.Trigger;
|
|
133
|
+
const ContextMenuGroup = ContextPrimitive.Group;
|
|
134
|
+
const ContextMenuSub = ContextPrimitive.Sub;
|
|
135
|
+
const ContextMenuRadioGroup = ContextPrimitive.RadioGroup;
|
|
136
|
+
const ContextMenuContent = React.forwardRef(function ContextMenuContent2({ className, ...props }, ref) {
|
|
137
|
+
return /* @__PURE__ */ jsx(ContextPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
138
|
+
ContextPrimitive.Content,
|
|
139
|
+
{
|
|
140
|
+
ref,
|
|
141
|
+
className: cn(menuContentVariants, className),
|
|
142
|
+
...dataSlot("context-menu", "content"),
|
|
143
|
+
...props
|
|
144
|
+
}
|
|
145
|
+
) });
|
|
146
|
+
});
|
|
147
|
+
const ContextMenuItem = React.forwardRef(function ContextMenuItem2({ className, inset, variant = "default", ...props }, ref) {
|
|
148
|
+
return /* @__PURE__ */ jsx(
|
|
149
|
+
ContextPrimitive.Item,
|
|
150
|
+
{
|
|
151
|
+
ref,
|
|
152
|
+
className: cn(itemVariants, inset && "ps-8", variant === "destructive" && "text-critical", className),
|
|
153
|
+
...dataSlot("context-menu", "item"),
|
|
154
|
+
...props
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
});
|
|
158
|
+
const ContextMenuSeparator = React.forwardRef(function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
159
|
+
return /* @__PURE__ */ jsx(ContextPrimitive.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-line", className), ...dataSlot("context-menu", "separator"), ...props });
|
|
160
|
+
});
|
|
161
|
+
const ContextMenuLabel = React.forwardRef(function ContextMenuLabel2({ className, ...props }, ref) {
|
|
162
|
+
return /* @__PURE__ */ jsx(ContextPrimitive.Label, { ref, className: cn("px-2 py-1.5 text-label uppercase tracking-widest text-fg-muted", className), ...dataSlot("context-menu", "label"), ...props });
|
|
163
|
+
});
|
|
164
|
+
export {
|
|
165
|
+
ContextMenu,
|
|
166
|
+
ContextMenuContent,
|
|
167
|
+
ContextMenuGroup,
|
|
168
|
+
ContextMenuItem,
|
|
169
|
+
ContextMenuLabel,
|
|
170
|
+
ContextMenuRadioGroup,
|
|
171
|
+
ContextMenuSeparator,
|
|
172
|
+
ContextMenuSub,
|
|
173
|
+
ContextMenuTrigger,
|
|
174
|
+
DropdownMenu,
|
|
175
|
+
DropdownMenuCheckboxItem,
|
|
176
|
+
DropdownMenuContent,
|
|
177
|
+
DropdownMenuGroup,
|
|
178
|
+
DropdownMenuItem,
|
|
179
|
+
DropdownMenuLabel,
|
|
180
|
+
DropdownMenuPortal,
|
|
181
|
+
DropdownMenuRadioGroup,
|
|
182
|
+
DropdownMenuRadioItem,
|
|
183
|
+
DropdownMenuSeparator,
|
|
184
|
+
DropdownMenuShortcut,
|
|
185
|
+
DropdownMenuSub,
|
|
186
|
+
DropdownMenuSubContent,
|
|
187
|
+
DropdownMenuSubTrigger,
|
|
188
|
+
DropdownMenuTrigger,
|
|
189
|
+
menuContentVariants,
|
|
190
|
+
COPY as menuCopy
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/overlays/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownPrimitive, ContextMenu as ContextPrimitive } from \"radix-ui\";\nimport { Check, ChevronRight } from \"@tea-ui/icons\";\nimport { cn } from \"@tea-ui/utils\";\nimport { COPY } from \"@tea-ui/ux-standards\";\n\nimport { dataSlot } from \"../internal\";\n\n/**\n * TEA UI — DropdownMenu and ContextMenu.\n *\n * Both source projects shipped a fully built `DropdownMenu` and used it in\n * exactly one place, hand-rolling the rest. This is the one implementation, and\n * the styling defect it fixes is worth naming: the source project's dropdown\n * item highlighted with `bg-muted` while its select item highlighted with\n * `bg-accent`. The same \"you are here\" moment therefore looked like two\n * different things depending on which control the user was in. Here, a\n * highlighted item is always `bg-accent-subtle` with the foreground brought up.\n */\nexport const menuContentVariants = cn(\n \"z-dropdown min-w-48 border border-line bg-surface-2 p-1 shadow-overlay\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n);\n\nconst itemVariants = cn(\n \"relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-ui text-fg outline-none\",\n \"data-[highlighted]:bg-accent-subtle data-[highlighted]:text-fg\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"[&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-fg-muted\",\n);\n\nexport const DropdownMenu = DropdownPrimitive.Root;\nexport const DropdownMenuTrigger = DropdownPrimitive.Trigger;\nexport const DropdownMenuPortal = DropdownPrimitive.Portal;\nexport const DropdownMenuGroup = DropdownPrimitive.Group;\nexport const DropdownMenuSub = DropdownPrimitive.Sub;\nexport const DropdownMenuRadioGroup = DropdownPrimitive.RadioGroup;\n\nexport const DropdownMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DropdownPrimitive.Content>\n>(function DropdownMenuContent({ className, sideOffset = 4, align = \"start\", ...props }, ref) {\n return (\n <DropdownPrimitive.Portal>\n <DropdownPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n align={align}\n collisionPadding={12}\n className={cn(menuContentVariants, className)}\n {...dataSlot(\"menu\", \"content\")}\n {...props}\n />\n </DropdownPrimitive.Portal>\n );\n});\n\nexport const DropdownMenuItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DropdownPrimitive.Item> & { inset?: boolean | undefined; variant?: \"default\" | \"destructive\" | undefined }\n>(function DropdownMenuItem({ className, inset, variant = \"default\", ...props }, ref) {\n return (\n <DropdownPrimitive.Item\n ref={ref}\n className={cn(\n itemVariants,\n inset && \"ps-8\",\n variant === \"destructive\" && \"text-critical data-[highlighted]:bg-critical-subtle data-[highlighted]:text-critical\",\n className,\n )}\n {...dataSlot(\"menu\", \"item\")}\n {...props}\n />\n );\n});\n\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DropdownPrimitive.CheckboxItem>\n>(function DropdownMenuCheckboxItem({ className, children, checked, ...props }, ref) {\n return (\n <DropdownPrimitive.CheckboxItem\n ref={ref}\n checked={checked}\n className={cn(itemVariants, \"ps-8\", className)}\n {...dataSlot(\"menu\", \"checkbox-item\")}\n {...props}\n >\n <span className=\"absolute start-2 flex size-4 items-center justify-center\">\n <DropdownPrimitive.ItemIndicator>\n <Check size={14} aria-hidden=\"true\" />\n </DropdownPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownPrimitive.CheckboxItem>\n );\n});\n\nexport const DropdownMenuRadioItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DropdownPrimitive.RadioItem>\n>(function DropdownMenuRadioItem({ className, children, ...props }, ref) {\n return (\n <DropdownPrimitive.RadioItem\n ref={ref}\n className={cn(itemVariants, \"ps-8\", className)}\n {...dataSlot(\"menu\", \"radio-item\")}\n {...props}\n >\n <span className=\"absolute start-2 flex size-4 items-center justify-center\">\n <DropdownPrimitive.ItemIndicator>\n <span aria-hidden=\"true\" className=\"size-1.5 rounded-pill bg-current\" />\n </DropdownPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownPrimitive.RadioItem>\n );\n});\n\nexport const DropdownMenuLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DropdownPrimitive.Label> & { inset?: boolean | undefined }\n>(function DropdownMenuLabel({ className, inset, ...props }, ref) {\n return (\n <DropdownPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-label font-semibold uppercase tracking-widest text-fg-muted\", inset && \"ps-8\", className)}\n {...dataSlot(\"menu\", \"label\")}\n {...props}\n />\n );\n});\n\nexport const DropdownMenuSeparator = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DropdownPrimitive.Separator>\n>(function DropdownMenuSeparator({ className, ...props }, ref) {\n return (\n <DropdownPrimitive.Separator ref={ref} className={cn(\"-mx-1 my-1 h-px bg-line\", className)} {...dataSlot(\"menu\", \"separator\")} {...props} />\n );\n});\n\n/** A right-aligned keyboard hint. Decorative unless it is the only key shown. */\nexport const DropdownMenuShortcut = React.forwardRef<HTMLSpanElement, React.ComponentProps<\"span\">>(\n function DropdownMenuShortcut({ className, ...props }, ref) {\n return <span ref={ref} className={cn(\"ms-auto text-label text-fg-subtle\", className)} {...dataSlot(\"menu\", \"shortcut\")} {...props} />;\n },\n);\n\nexport const DropdownMenuSubTrigger = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DropdownPrimitive.SubTrigger> & { inset?: boolean | undefined }\n>(function DropdownMenuSubTrigger({ className, inset, children, ...props }, ref) {\n return (\n <DropdownPrimitive.SubTrigger\n ref={ref}\n className={cn(itemVariants, inset && \"ps-8\", className)}\n {...dataSlot(\"menu\", \"sub-trigger\")}\n {...props}\n >\n {children}\n <ChevronRight size={14} aria-hidden=\"true\" className=\"ms-auto\" />\n </DropdownPrimitive.SubTrigger>\n );\n});\n\nexport const DropdownMenuSubContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DropdownPrimitive.SubContent>\n>(function DropdownMenuSubContent({ className, ...props }, ref) {\n return (\n <DropdownPrimitive.Portal>\n <DropdownPrimitive.SubContent\n ref={ref}\n className={cn(menuContentVariants, className)}\n {...dataSlot(\"menu\", \"sub-content\")}\n {...props}\n />\n </DropdownPrimitive.Portal>\n );\n});\n\n/* -------------------------------------------------------------------------- */\n\nexport const ContextMenu = ContextPrimitive.Root;\nexport const ContextMenuTrigger = ContextPrimitive.Trigger;\nexport const ContextMenuGroup = ContextPrimitive.Group;\nexport const ContextMenuSub = ContextPrimitive.Sub;\nexport const ContextMenuRadioGroup = ContextPrimitive.RadioGroup;\n\nexport const ContextMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof ContextPrimitive.Content>\n>(function ContextMenuContent({ className, ...props }, ref) {\n return (\n <ContextPrimitive.Portal>\n <ContextPrimitive.Content\n ref={ref}\n className={cn(menuContentVariants, className)}\n {...dataSlot(\"context-menu\", \"content\")}\n {...props}\n />\n </ContextPrimitive.Portal>\n );\n});\n\nexport const ContextMenuItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof ContextPrimitive.Item> & { inset?: boolean | undefined; variant?: \"default\" | \"destructive\" | undefined }\n>(function ContextMenuItem({ className, inset, variant = \"default\", ...props }, ref) {\n return (\n <ContextPrimitive.Item\n ref={ref}\n className={cn(itemVariants, inset && \"ps-8\", variant === \"destructive\" && \"text-critical\", className)}\n {...dataSlot(\"context-menu\", \"item\")}\n {...props}\n />\n );\n});\n\nexport const ContextMenuSeparator = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof ContextPrimitive.Separator>\n>(function ContextMenuSeparator({ className, ...props }, ref) {\n return <ContextPrimitive.Separator ref={ref} className={cn(\"-mx-1 my-1 h-px bg-line\", className)} {...dataSlot(\"context-menu\", \"separator\")} {...props} />;\n});\n\nexport const ContextMenuLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof ContextPrimitive.Label>\n>(function ContextMenuLabel({ className, ...props }, ref) {\n return <ContextPrimitive.Label ref={ref} className={cn(\"px-2 py-1.5 text-label uppercase tracking-widest text-fg-muted\", className)} {...dataSlot(\"context-menu\", \"label\")} {...props} />;\n});\n\nexport { COPY as menuCopy };\n"],"mappings":"AA6CM,cAqCF,YArCE;AA7CL,YAAY,WAAW;AACxB,SAAS,gBAAgB,mBAAmB,eAAe,wBAAwB;AACnF,SAAS,OAAO,oBAAoB;AACpC,SAAS,UAAU;AACnB,SAAS,YAAY;AAErB,SAAS,gBAAgB;AAalB,MAAM,sBAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,eAAe,kBAAkB;AACvC,MAAM,sBAAsB,kBAAkB;AAC9C,MAAM,qBAAqB,kBAAkB;AAC7C,MAAM,oBAAoB,kBAAkB;AAC5C,MA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AAAA,MAClC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAEM,MAAM,uBAAuB,MAAM,WAGxC,SAASC,sBAAqB,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AAC5D,SAAO,oBAAC,iBAAiB,WAAjB,EAA2B,KAAU,WAAW,GAAG,2BAA2B,SAAS,GAAI,GAAG,SAAS,gBAAgB,WAAW,GAAI,GAAG,OAAO;AAC1J,CAAC;AAEM,MAAM,mBAAmB,MAAM,WAGpC,SAASC,kBAAiB,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AACxD,SAAO,oBAAC,iBAAiB,OAAjB,EAAuB,KAAU,WAAW,GAAG,kEAAkE,SAAS,GAAI,GAAG,SAAS,gBAAgB,OAAO,GAAI,GAAG,OAAO;AACzL,CAAC;","names":["DropdownMenuContent","DropdownMenuItem","DropdownMenuCheckboxItem","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSubTrigger","DropdownMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuSeparator","ContextMenuLabel"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, dialogContentVariants, dialogOverlayVariants } from './dialog.js';
|
|
2
|
+
export { AlertDialog, AlertDialogOverlay, AlertDialogPortal, AlertDialogTrigger, ConfirmDialog, ConfirmDialogProps, ConfirmFn, ConfirmOptions, useConfirm } from './alert-dialog.js';
|
|
3
|
+
export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPortal, DrawerTitle, DrawerTrigger, Sheet, SheetBody, SheetClose, SheetContent, SheetFooter, SheetHeader, SheetTrigger, drawerVariants } from './drawer.js';
|
|
4
|
+
export { HoverCard, HoverCardContent, HoverCardContentProps, HoverCardPortal, HoverCardTrigger, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverContentProps, PopoverTrigger, Tooltip, TooltipContent, TooltipContentProps, TooltipProvider, TooltipTrigger, hoverCardContentVariants, popoverContentVariants, tooltipContentVariants } from './popover.js';
|
|
5
|
+
export { ContextMenu, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuSeparator, ContextMenuSub, ContextMenuTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './dropdown-menu.js';
|
|
6
|
+
import 'class-variance-authority/types';
|
|
7
|
+
import 'react';
|
|
8
|
+
import 'radix-ui';
|
|
9
|
+
import '@tea-ui/utils';
|
|
10
|
+
import '@tea-ui/ux-standards';
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Dialog,
|
|
3
|
+
DialogBody,
|
|
4
|
+
DialogClose,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogDescription,
|
|
7
|
+
DialogFooter,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogOverlay,
|
|
10
|
+
DialogPortal,
|
|
11
|
+
DialogTitle,
|
|
12
|
+
DialogTrigger,
|
|
13
|
+
dialogContentVariants,
|
|
14
|
+
dialogOverlayVariants
|
|
15
|
+
} from "./dialog.js";
|
|
16
|
+
import {
|
|
17
|
+
AlertDialog,
|
|
18
|
+
AlertDialogOverlay,
|
|
19
|
+
AlertDialogPortal,
|
|
20
|
+
AlertDialogTrigger,
|
|
21
|
+
ConfirmDialog,
|
|
22
|
+
useConfirm
|
|
23
|
+
} from "./alert-dialog.js";
|
|
24
|
+
import {
|
|
25
|
+
Drawer,
|
|
26
|
+
DrawerBody,
|
|
27
|
+
DrawerClose,
|
|
28
|
+
DrawerContent,
|
|
29
|
+
DrawerFooter,
|
|
30
|
+
DrawerHeader,
|
|
31
|
+
DrawerDescription,
|
|
32
|
+
DrawerPortal,
|
|
33
|
+
DrawerTitle,
|
|
34
|
+
DrawerTrigger,
|
|
35
|
+
Sheet,
|
|
36
|
+
SheetBody,
|
|
37
|
+
SheetClose,
|
|
38
|
+
SheetContent,
|
|
39
|
+
SheetFooter,
|
|
40
|
+
SheetHeader,
|
|
41
|
+
SheetTrigger,
|
|
42
|
+
drawerVariants
|
|
43
|
+
} from "./drawer.js";
|
|
44
|
+
import {
|
|
45
|
+
HoverCard,
|
|
46
|
+
HoverCardContent,
|
|
47
|
+
HoverCardPortal,
|
|
48
|
+
HoverCardTrigger,
|
|
49
|
+
Popover,
|
|
50
|
+
PopoverAnchor,
|
|
51
|
+
PopoverArrow,
|
|
52
|
+
PopoverClose,
|
|
53
|
+
PopoverContent,
|
|
54
|
+
PopoverTrigger,
|
|
55
|
+
Tooltip,
|
|
56
|
+
TooltipContent,
|
|
57
|
+
TooltipProvider,
|
|
58
|
+
TooltipTrigger,
|
|
59
|
+
hoverCardContentVariants,
|
|
60
|
+
popoverContentVariants,
|
|
61
|
+
tooltipContentVariants
|
|
62
|
+
} from "./popover.js";
|
|
63
|
+
import {
|
|
64
|
+
ContextMenu,
|
|
65
|
+
ContextMenuContent,
|
|
66
|
+
ContextMenuGroup,
|
|
67
|
+
ContextMenuItem,
|
|
68
|
+
ContextMenuLabel,
|
|
69
|
+
ContextMenuRadioGroup,
|
|
70
|
+
ContextMenuSeparator,
|
|
71
|
+
ContextMenuSub,
|
|
72
|
+
ContextMenuTrigger,
|
|
73
|
+
DropdownMenu,
|
|
74
|
+
DropdownMenuCheckboxItem,
|
|
75
|
+
DropdownMenuContent,
|
|
76
|
+
DropdownMenuGroup,
|
|
77
|
+
DropdownMenuItem,
|
|
78
|
+
DropdownMenuLabel,
|
|
79
|
+
DropdownMenuPortal,
|
|
80
|
+
DropdownMenuRadioGroup,
|
|
81
|
+
DropdownMenuRadioItem,
|
|
82
|
+
DropdownMenuSeparator,
|
|
83
|
+
DropdownMenuShortcut,
|
|
84
|
+
DropdownMenuSub,
|
|
85
|
+
DropdownMenuSubContent,
|
|
86
|
+
DropdownMenuSubTrigger,
|
|
87
|
+
DropdownMenuTrigger
|
|
88
|
+
} from "./dropdown-menu.js";
|
|
89
|
+
export {
|
|
90
|
+
AlertDialog,
|
|
91
|
+
AlertDialogOverlay,
|
|
92
|
+
AlertDialogPortal,
|
|
93
|
+
AlertDialogTrigger,
|
|
94
|
+
ConfirmDialog,
|
|
95
|
+
ContextMenu,
|
|
96
|
+
ContextMenuContent,
|
|
97
|
+
ContextMenuGroup,
|
|
98
|
+
ContextMenuItem,
|
|
99
|
+
ContextMenuLabel,
|
|
100
|
+
ContextMenuRadioGroup,
|
|
101
|
+
ContextMenuSeparator,
|
|
102
|
+
ContextMenuSub,
|
|
103
|
+
ContextMenuTrigger,
|
|
104
|
+
Dialog,
|
|
105
|
+
DialogBody,
|
|
106
|
+
DialogClose,
|
|
107
|
+
DialogContent,
|
|
108
|
+
DialogDescription,
|
|
109
|
+
DialogFooter,
|
|
110
|
+
DialogHeader,
|
|
111
|
+
DialogOverlay,
|
|
112
|
+
DialogPortal,
|
|
113
|
+
DialogTitle,
|
|
114
|
+
DialogTrigger,
|
|
115
|
+
Drawer,
|
|
116
|
+
DrawerBody,
|
|
117
|
+
DrawerClose,
|
|
118
|
+
DrawerContent,
|
|
119
|
+
DrawerDescription,
|
|
120
|
+
DrawerFooter,
|
|
121
|
+
DrawerHeader,
|
|
122
|
+
DrawerPortal,
|
|
123
|
+
DrawerTitle,
|
|
124
|
+
DrawerTrigger,
|
|
125
|
+
DropdownMenu,
|
|
126
|
+
DropdownMenuCheckboxItem,
|
|
127
|
+
DropdownMenuContent,
|
|
128
|
+
DropdownMenuGroup,
|
|
129
|
+
DropdownMenuItem,
|
|
130
|
+
DropdownMenuLabel,
|
|
131
|
+
DropdownMenuPortal,
|
|
132
|
+
DropdownMenuRadioGroup,
|
|
133
|
+
DropdownMenuRadioItem,
|
|
134
|
+
DropdownMenuSeparator,
|
|
135
|
+
DropdownMenuShortcut,
|
|
136
|
+
DropdownMenuSub,
|
|
137
|
+
DropdownMenuSubContent,
|
|
138
|
+
DropdownMenuSubTrigger,
|
|
139
|
+
DropdownMenuTrigger,
|
|
140
|
+
HoverCard,
|
|
141
|
+
HoverCardContent,
|
|
142
|
+
HoverCardPortal,
|
|
143
|
+
HoverCardTrigger,
|
|
144
|
+
Popover,
|
|
145
|
+
PopoverAnchor,
|
|
146
|
+
PopoverArrow,
|
|
147
|
+
PopoverClose,
|
|
148
|
+
PopoverContent,
|
|
149
|
+
PopoverTrigger,
|
|
150
|
+
Sheet,
|
|
151
|
+
SheetBody,
|
|
152
|
+
SheetClose,
|
|
153
|
+
SheetContent,
|
|
154
|
+
SheetFooter,
|
|
155
|
+
SheetHeader,
|
|
156
|
+
SheetTrigger,
|
|
157
|
+
Tooltip,
|
|
158
|
+
TooltipContent,
|
|
159
|
+
TooltipProvider,
|
|
160
|
+
TooltipTrigger,
|
|
161
|
+
dialogContentVariants,
|
|
162
|
+
dialogOverlayVariants,
|
|
163
|
+
drawerVariants,
|
|
164
|
+
hoverCardContentVariants,
|
|
165
|
+
popoverContentVariants,
|
|
166
|
+
tooltipContentVariants,
|
|
167
|
+
useConfirm
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/overlays/index.ts"],"sourcesContent":["/**\n * TEA UI — overlays.\n *\n * Everything that floats above the page. The universal guarantees across all\n * of them: portal to `document.body`, focus moved in on open and restored to the\n * trigger on close, Escape closes, no keyboard trap, background scroll locked,\n * a z-index taken from the token scale rather than an ad-hoc value, and a focus\n * indicator that is never removed without a replacement.\n */\nexport {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n dialogContentVariants,\n dialogOverlayVariants,\n type DialogContentProps,\n} from \"./dialog\";\n\nexport {\n AlertDialog,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTrigger,\n ConfirmDialog,\n useConfirm,\n type ConfirmDialogProps,\n type ConfirmFn,\n type ConfirmOptions,\n} from \"./alert-dialog\";\n\nexport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerFooter,\n DrawerHeader,\n DrawerDescription,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n Sheet,\n SheetBody,\n SheetClose,\n SheetContent,\n SheetFooter,\n SheetHeader,\n SheetTrigger,\n drawerVariants,\n type DrawerContentProps,\n} from \"./drawer\";\n\nexport {\n HoverCard,\n HoverCardContent,\n HoverCardPortal,\n HoverCardTrigger,\n Popover,\n PopoverAnchor,\n PopoverArrow,\n PopoverClose,\n PopoverContent,\n PopoverTrigger,\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n hoverCardContentVariants,\n popoverContentVariants,\n tooltipContentVariants,\n type HoverCardContentProps,\n type PopoverContentProps,\n type TooltipContentProps,\n} from \"./popover\";\n\nexport {\n ContextMenu,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuRadioGroup,\n ContextMenuSeparator,\n ContextMenuSub,\n ContextMenuTrigger,\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\n"],"mappings":"AASA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|