@jbpark/ui-kit 8.0.0 → 9.0.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/Button.d.mts +48 -12
- package/dist/Button.d.mts.map +1 -1
- package/dist/Button.mjs +62 -11
- package/dist/Button.mjs.map +1 -1
- package/dist/Tag.d.mts +8 -11
- package/dist/Tag.d.mts.map +1 -1
- package/dist/Tag.mjs +8 -7
- package/dist/Tag.mjs.map +1 -1
- package/dist/components/atoms/date-picker.mjs +1 -1
- package/dist/components/atoms/float-button/float-button.d.mts.map +1 -1
- package/dist/components/atoms/float-button/float-button.mjs +2 -1
- package/dist/components/atoms/float-button/float-button.mjs.map +1 -1
- package/dist/components/atoms/input/search.mjs +1 -1
- package/dist/components/atoms/radio/group.mjs +1 -1
- package/dist/components/atoms/radio/radio.d.mts +1 -1
- package/dist/components/molecules/dropdown.d.mts.map +1 -1
- package/dist/components/molecules/dropdown.mjs +2 -1
- package/dist/components/molecules/dropdown.mjs.map +1 -1
- package/dist/components/molecules/marquees/item.d.mts +2 -1
- package/dist/components/molecules/marquees/item.d.mts.map +1 -1
- package/dist/components/molecules/marquees/item.mjs +20 -5
- package/dist/components/molecules/marquees/item.mjs.map +1 -1
- package/dist/components/molecules/marquees/marquees.d.mts +2 -1
- package/dist/components/molecules/marquees/marquees.d.mts.map +1 -1
- package/dist/components/molecules/marquees/marquees.mjs +3 -2
- package/dist/components/molecules/marquees/marquees.mjs.map +1 -1
- package/dist/components/organisms/drawer.mjs +8 -8
- package/dist/components/organisms/drawer.mjs.map +1 -1
- package/dist/components/organisms/modal.d.mts +4 -5
- package/dist/components/organisms/modal.d.mts.map +1 -1
- package/dist/components/organisms/modal.mjs +5 -6
- package/dist/components/organisms/modal.mjs.map +1 -1
- package/dist/components/organisms/toast.d.mts +2 -8
- package/dist/components/organisms/toast.d.mts.map +1 -1
- package/dist/components/organisms/toast.mjs +4 -5
- package/dist/components/organisms/toast.mjs.map +1 -1
- package/dist/components/templates/layout/header.d.mts.map +1 -1
- package/dist/components/templates/layout/header.mjs +2 -1
- package/dist/components/templates/layout/header.mjs.map +1 -1
- package/dist/components/templates/layout/sider.mjs.map +1 -1
- package/dist/components/templates/page-header.mjs +4 -4
- package/dist/components/templates/page-header.mjs.map +1 -1
- package/dist/core/badge.d.mts +25 -2
- package/dist/core/badge.d.mts.map +1 -0
- package/dist/core/badge.mjs +47 -0
- package/dist/core/badge.mjs.map +1 -0
- package/dist/core/button.d.mts +14 -2
- package/dist/core/button.d.mts.map +1 -0
- package/dist/core/dialog.mjs +5 -5
- package/dist/core/dialog.mjs.map +1 -1
- package/dist/core/drawer.mjs +3 -2
- package/dist/core/drawer.mjs.map +1 -1
- package/dist/core/field.d.mts +1 -1
- package/dist/core/popover.mjs +3 -2
- package/dist/core/popover.mjs.map +1 -1
- package/dist/core/select.d.mts.map +1 -1
- package/dist/core/select.mjs +3 -2
- package/dist/core/select.mjs.map +1 -1
- package/dist/lib/colors.d.mts +6 -31
- package/dist/lib/colors.d.mts.map +1 -1
- package/dist/lib/z-layers.mjs +33 -0
- package/dist/lib/z-layers.mjs.map +1 -0
- package/dist/style.css +32 -34
- package/dist/utils.d.mts +12 -0
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs +12 -0
- package/dist/utils.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/lib/chassis.mjs +0 -23
- package/dist/lib/chassis.mjs.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cn } from "../utils.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
//#region src/core/badge.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Vendored from shadcn's `new-york-v4` badge registry entry.
|
|
9
|
+
*
|
|
10
|
+
* Two deliberate local adaptations, both of which must survive the next sync:
|
|
11
|
+
* - upstream imports `Slot` from the unified `radix-ui` package; this repo
|
|
12
|
+
* installs the individual `@radix-ui/*` packages (13 of them) and has no
|
|
13
|
+
* `radix-ui` dependency, so the import stays on `@radix-ui/react-slot`.
|
|
14
|
+
* - `cn` resolves through `@repo/ui/utils` rather than upstream's `cn` alias.
|
|
15
|
+
*
|
|
16
|
+
* Everything else is upstream verbatim, including the `rounded-full` /
|
|
17
|
+
* `border-transparent` base and the `ghost` / `link` variants.
|
|
18
|
+
*/
|
|
19
|
+
const badgeVariants = cva(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden
|
|
20
|
+
rounded-full border border-transparent px-2 py-0.5 text-xs font-medium
|
|
21
|
+
whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring
|
|
22
|
+
focus-visible:ring-[3px] focus-visible:ring-ring/50
|
|
23
|
+
aria-invalid:border-destructive aria-invalid:ring-destructive/20
|
|
24
|
+
dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none
|
|
25
|
+
[&>svg]:size-3`, {
|
|
26
|
+
variants: { variant: {
|
|
27
|
+
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
28
|
+
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
29
|
+
destructive: "bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
|
|
30
|
+
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
31
|
+
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
32
|
+
link: "text-primary underline-offset-4 [a&]:hover:underline"
|
|
33
|
+
} },
|
|
34
|
+
defaultVariants: { variant: "default" }
|
|
35
|
+
});
|
|
36
|
+
function Badge({ className, variant = "default", asChild = false, ...props }) {
|
|
37
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "span", {
|
|
38
|
+
"data-slot": "badge",
|
|
39
|
+
"data-variant": variant,
|
|
40
|
+
className: cn(badgeVariants({ variant }), className),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { Badge, badgeVariants };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=badge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.mjs","names":[],"sources":["../../src/core/badge.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps, cva } from 'class-variance-authority';\n\nimport { cn } from '@repo/ui/utils';\n\n/**\n * Vendored from shadcn's `new-york-v4` badge registry entry.\n *\n * Two deliberate local adaptations, both of which must survive the next sync:\n * - upstream imports `Slot` from the unified `radix-ui` package; this repo\n * installs the individual `@radix-ui/*` packages (13 of them) and has no\n * `radix-ui` dependency, so the import stays on `@radix-ui/react-slot`.\n * - `cn` resolves through `@repo/ui/utils` rather than upstream's `cn` alias.\n *\n * Everything else is upstream verbatim, including the `rounded-full` /\n * `border-transparent` base and the `ghost` / `link` variants.\n */\nconst badgeVariants = cva(\n `inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden\n rounded-full border border-transparent px-2 py-0.5 text-xs font-medium\n whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring\n focus-visible:ring-[3px] focus-visible:ring-ring/50\n aria-invalid:border-destructive aria-invalid:ring-destructive/20\n dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\n [&>svg]:size-3`,\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground [a&]:hover:bg-primary/90',\n secondary:\n 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',\n destructive:\n 'bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90',\n outline:\n 'border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n ghost: '[a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 [a&]:hover:underline',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\ntype Props = React.ComponentProps<'span'> &\n VariantProps<typeof badgeVariants> & {\n asChild?: boolean;\n };\n\nfunction Badge({\n className,\n variant = 'default',\n asChild = false,\n ...props\n}: Props) {\n const Comp = asChild ? Slot : 'span';\n\n return (\n <Comp\n data-slot=\"badge\"\n data-variant={variant}\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport { Badge, badgeVariants, type Props };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAM,gBAAgB,IACpB;;;;;;mBAOA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,WACE;EACF,aACE;EACF,SACE;EACF,OAAO;EACP,MAAM;CACR,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;AAOA,SAAS,MAAM,EACb,WACA,UAAU,WACV,UAAU,OACV,GAAG,SACK;CAGR,OACE,oBAHW,UAAU,OAAO,QAG5B;EACE,aAAU;EACV,gBAAc;EACd,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;EACnD,GAAI;CACL,CAAA;AAEL"}
|
package/dist/core/button.d.mts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import "class-variance-authority";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/core/button.d.ts
|
|
4
|
+
declare const buttonVariants: (props?: ({
|
|
5
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
6
|
+
size?: "icon" | "default" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
type Props = React$1.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare function Button({ className, variant, size, asChild, ...props }: Props): React$1.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Button, type Props, buttonVariants };
|
|
14
|
+
//# sourceMappingURL=button.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.mts","names":[],"sources":["../../src/core/button.tsx"],"mappings":";;;cAOM,iBAAc;;;6CAgCnB;KAEI,QAAQ,QAAM,2BACjB,oBAAoB;EAClB;;iBAGK,SACP,WACA,SACA,MACA,YACG,SACF,QAAK,QAAA,IAAA"}
|
package/dist/core/dialog.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
4
|
import { useConfig } from "../providers/config/context.mjs";
|
|
5
|
+
import { OVERLAY_LAYER } from "../lib/z-layers.mjs";
|
|
5
6
|
import Button from "../Button.mjs";
|
|
6
7
|
import "react";
|
|
7
8
|
import { XIcon } from "lucide-react";
|
|
@@ -49,7 +50,7 @@ function DialogOverlay({ className, ...props }) {
|
|
|
49
50
|
"data-slot": "dialog-overlay",
|
|
50
51
|
className: cn(`data-[state=open]:animate-in data-[state=closed]:animate-out
|
|
51
52
|
data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0
|
|
52
|
-
|
|
53
|
+
bg-black/50`, OVERLAY_LAYER, className),
|
|
53
54
|
...props
|
|
54
55
|
});
|
|
55
56
|
}
|
|
@@ -73,10 +74,9 @@ function DialogContent({ className, children, classNames, closeIcon: _closeIcon,
|
|
|
73
74
|
className: cn(`bg-background data-[state=open]:animate-in
|
|
74
75
|
data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
75
76
|
data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95
|
|
76
|
-
data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%]
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
sm:max-w-lg`, className),
|
|
77
|
+
data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full
|
|
78
|
+
max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4
|
|
79
|
+
rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg`, OVERLAY_LAYER, className),
|
|
80
80
|
...props,
|
|
81
81
|
children: [children, closable && closeIcon]
|
|
82
82
|
})]
|
package/dist/core/dialog.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.mjs","names":[],"sources":["../../src/core/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport Button from '../components/atoms/button';\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n `data-[state=open]:animate-in data-[state=closed]:animate-out\n data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0\n
|
|
1
|
+
{"version":3,"file":"dialog.mjs","names":[],"sources":["../../src/core/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport Button from '../components/atoms/button';\nimport { OVERLAY_LAYER } from '../lib/z-layers';\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n `data-[state=open]:animate-in data-[state=closed]:animate-out\n data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0\n bg-black/50`,\n OVERLAY_LAYER,\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface CustomContentProps {\n classNames?: Record<string, string>;\n closeIcon?: React.ReactNode;\n closable?: boolean | { disabled?: boolean };\n container?: HTMLElement;\n}\n\nfunction DialogContent({\n className,\n children,\n classNames,\n closeIcon: _closeIcon,\n closable,\n container,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & CustomContentProps) {\n const { getContainer } = useConfig();\n const resolvedContainer = container ?? getContainer();\n\n const closeIcon = (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring\n data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\n absolute top-4 right-4 rounded-xs opacity-70 transition-opacity\n hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden\n disabled:pointer-events-none [&_svg]:pointer-events-none\n [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n disabled={typeof closable === 'object' && closable.disabled}\n >\n {_closeIcon || <XIcon />}\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n );\n\n return (\n <DialogPortal data-slot=\"dialog-portal\" container={resolvedContainer}>\n <DialogOverlay className={cn(classNames?.mask)} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n `bg-background data-[state=open]:animate-in\n data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95\n data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full\n max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4\n rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg`,\n OVERLAY_LAYER,\n className,\n )}\n {...props}\n >\n {children}\n {closable && closeIcon}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<'div'> & {\n showCloseButton?: boolean;\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outlined\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,SAAS,OAAO,EACd,GAAG,SACiD;CACpD,OAAO,oBAAC,gBAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;AAEA,SAAS,cAAc,EACrB,GAAG,SACoD;CACvD,OAAO,oBAAC,gBAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aAAa,EACpB,GAAG,SACmD;CACtD,OAAO,oBAAC,gBAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAEA,SAAS,YAAY,EACnB,GAAG,SACkD;CACrD,OAAO,oBAAC,gBAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,oBAAC,gBAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT;;sBAGA,eACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AASA,SAAS,cAAc,EACrB,WACA,UACA,YACA,WAAW,YACX,UACA,WACA,GAAG,SACyE;CAC5E,MAAM,EAAE,iBAAiB,UAAU;CACnC,MAAM,oBAAoB,aAAa,aAAa;CAEpD,MAAM,YACJ,qBAAC,gBAAgB,OAAjB;EACE,aAAU;EACV,WAAU;EAMV,UAAU,OAAO,aAAa,YAAY,SAAS;EARrD,UAAA,CAUG,cAAc,oBAAC,OAAD,CAAQ,CAAA,GACvB,oBAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAW,CAAA,CAChB;;CAGzB,OACE,qBAAC,cAAD;EAAc,aAAU;EAAgB,WAAW;EAAnD,UAAA,CACE,oBAAC,eAAD,EAAe,WAAW,GAAG,YAAY,IAAI,EAAI,CAAA,GACjD,qBAAC,gBAAgB,SAAjB;GACE,aAAU;GACV,WAAW,GACT;;;;;kFAMA,eACA,SACF;GACA,GAAI;GAZN,UAAA,CAcG,UACA,YAAY,SACU;EACb,CAAA,CAAA;;AAElB;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,gDAAgD,SAAS;EACvE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EACpB,WACA,kBAAkB,OAClB,UACA,GAAG,SAGF;CACD,OACE,qBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,0DACA,SACF;EACA,GAAI;EANN,UAAA,CAQG,UACA,mBACC,oBAAC,gBAAgB,OAAjB;GAAuB,SAAA;GACrB,UAAA,oBAAC,QAAD;IAAQ,SAAQ;IAAW,UAAA;GAAa,CAAA;EACnB,CAAA,CAEtB;;AAET;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,oBAAC,gBAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,sCAAsC,SAAS;EAC7D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAAC,gBAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL"}
|
package/dist/core/drawer.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
4
|
import { useConfig } from "../providers/config/context.mjs";
|
|
5
|
+
import { OVERLAY_LAYER } from "../lib/z-layers.mjs";
|
|
5
6
|
import "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { Drawer } from "vaul";
|
|
@@ -50,7 +51,7 @@ function DrawerOverlay({ className, ...props }) {
|
|
|
50
51
|
"data-slot": "drawer-overlay",
|
|
51
52
|
className: cn(`data-[state=open]:animate-in data-[state=closed]:animate-out
|
|
52
53
|
data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0
|
|
53
|
-
|
|
54
|
+
bg-black/50`, OVERLAY_LAYER, className),
|
|
54
55
|
...props
|
|
55
56
|
});
|
|
56
57
|
}
|
|
@@ -59,7 +60,7 @@ function DrawerContent({ className, children, classNames = {}, handlebar, mask,
|
|
|
59
60
|
"data-slot": "drawer-portal",
|
|
60
61
|
children: [/* @__PURE__ */ jsx(DrawerOverlay, { className: cn(classNames?.mask || "", !mask && "hidden") }), /* @__PURE__ */ jsxs(Drawer.Content, {
|
|
61
62
|
"data-slot": "drawer-content",
|
|
62
|
-
className: cn("group/drawer-content bg-background fixed
|
|
63
|
+
className: cn("group/drawer-content bg-background fixed flex h-auto flex-col", OVERLAY_LAYER, `data-[vaul-drawer-direction=top]:inset-x-0
|
|
63
64
|
data-[vaul-drawer-direction=top]:top-0
|
|
64
65
|
data-[vaul-drawer-direction=top]:mb-24
|
|
65
66
|
data-[vaul-drawer-direction=top]:max-h-[80vh]
|
package/dist/core/drawer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.mjs","names":["Drawer","DrawerPrimitive"],"sources":["../../src/core/drawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\ninterface CustomProps {\n draggable?: boolean;\n}\n\nfunction Drawer({\n draggable,\n container,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root> & CustomProps) {\n const { getContainer } = useConfig();\n\n return (\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n handleOnly={!draggable}\n container={container ?? getContainer()}\n {...props}\n />\n );\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n `data-[state=open]:animate-in data-[state=closed]:animate-out\n data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0\n
|
|
1
|
+
{"version":3,"file":"drawer.mjs","names":["Drawer","DrawerPrimitive"],"sources":["../../src/core/drawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport { OVERLAY_LAYER } from '../lib/z-layers';\n\ninterface CustomProps {\n draggable?: boolean;\n}\n\nfunction Drawer({\n draggable,\n container,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root> & CustomProps) {\n const { getContainer } = useConfig();\n\n return (\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n handleOnly={!draggable}\n container={container ?? getContainer()}\n {...props}\n />\n );\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n `data-[state=open]:animate-in data-[state=closed]:animate-out\n data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0\n bg-black/50`,\n OVERLAY_LAYER,\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface CustomContentProps {\n classNames?: Record<string, string>;\n handlebar?: boolean;\n mask?: boolean;\n}\n\nfunction DrawerContent({\n className,\n children,\n classNames = {},\n handlebar,\n mask,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content> & CustomContentProps) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay\n className={cn(\n classNames?.mask || '',\n !mask && 'hidden',\n //\n )}\n />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content bg-background fixed flex h-auto flex-col',\n OVERLAY_LAYER,\n `data-[vaul-drawer-direction=top]:inset-x-0\n data-[vaul-drawer-direction=top]:top-0\n data-[vaul-drawer-direction=top]:mb-24\n data-[vaul-drawer-direction=top]:max-h-[80vh]\n data-[vaul-drawer-direction=top]:rounded-b-lg\n data-[vaul-drawer-direction=top]:border-b`,\n `data-[vaul-drawer-direction=bottom]:inset-x-0\n data-[vaul-drawer-direction=bottom]:bottom-0\n data-[vaul-drawer-direction=bottom]:mt-24\n data-[vaul-drawer-direction=bottom]:max-h-[80vh]\n data-[vaul-drawer-direction=bottom]:rounded-t-lg\n data-[vaul-drawer-direction=bottom]:border-t`,\n `data-[vaul-drawer-direction=right]:inset-y-0\n data-[vaul-drawer-direction=right]:right-0\n data-[vaul-drawer-direction=right]:w-3/4\n data-[vaul-drawer-direction=right]:border-l\n data-[vaul-drawer-direction=right]:sm:max-w-sm`,\n `data-[vaul-drawer-direction=left]:inset-y-0\n data-[vaul-drawer-direction=left]:left-0\n data-[vaul-drawer-direction=left]:w-3/4\n data-[vaul-drawer-direction=left]:border-r\n data-[vaul-drawer-direction=left]:sm:max-w-sm`,\n className,\n )}\n {...props}\n >\n {handlebar && (\n <div\n className={cn(\n `bg-muted mx-auto mt-4 hidden h-2 w-25 shrink-0 rounded-full\n group-data-[vaul-drawer-direction=bottom]/drawer-content:block`,\n classNames?.handlebar,\n )}\n />\n )}\n {/* <div\n className=\"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full\n group-data-[vaul-drawer-direction=bottom]/drawer-content:block\"\n /> */}\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n `flex flex-col gap-0.5 p-4\n group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center\n group-data-[vaul-drawer-direction=top]/drawer-content:text-center\n md:gap-1.5 md:text-left`,\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('mt-auto flex flex-col gap-2 p-4', className)}\n {...props}\n />\n );\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-foreground font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA,SAASA,SAAO,EACd,WACA,WACA,GAAG,SAC+D;CAClE,MAAM,EAAE,iBAAiB,UAAU;CAEnC,OACE,oBAACC,OAAgB,MAAjB;EACE,aAAU;EACV,YAAY,CAAC;EACb,WAAW,aAAa,aAAa;EACrC,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cAAc,EACrB,GAAG,SACoD;CACvD,OAAO,oBAACA,OAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aAAa,EACpB,GAAG,SACmD;CACtD,OAAO,oBAACA,OAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAEA,SAAS,YAAY,EACnB,GAAG,SACkD;CACrD,OAAO,oBAACA,OAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,oBAACA,OAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT;;sBAGA,eACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAQA,SAAS,cAAc,EACrB,WACA,UACA,aAAa,CAAC,GACd,WACA,MACA,GAAG,SACyE;CAC5E,OACE,qBAAC,cAAD;EAAc,aAAU;EAAxB,UAAA,CACE,oBAAC,eAAD,EACE,WAAW,GACT,YAAY,QAAQ,IACpB,CAAC,QAAQ,QAEX,EACD,CAAA,GACD,qBAACA,OAAgB,SAAjB;GACE,aAAU;GACV,WAAW,GACT,iEACA,eACA;;;;;sDAMA;;;;;yDAMA;;;;2DAKA;;;;0DAKA,SACF;GACA,GAAI;GA7BN,UAAA,CA+BG,aACC,oBAAC,OAAD,EACE,WAAW,GACT;+EAEA,YAAY,SACd,EACD,CAAA,GAMF,QACsB;EACb,CAAA,CAAA;;AAElB;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT;;;kCAIA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,OAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,OAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL"}
|
package/dist/core/field.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "./label.mjs";
|
|
2
|
-
import "class-variance-authority";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
package/dist/core/popover.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
4
|
import { useConfig } from "../providers/config/context.mjs";
|
|
5
|
+
import { OVERLAY_LAYER } from "../lib/z-layers.mjs";
|
|
5
6
|
import "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
@@ -41,9 +42,9 @@ function PopoverContent({ className, align = "center", sideOffset = 4, container
|
|
|
41
42
|
data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2
|
|
42
43
|
data-[side=left]:slide-in-from-right-2
|
|
43
44
|
data-[side=right]:slide-in-from-left-2
|
|
44
|
-
data-[side=top]:slide-in-from-bottom-2
|
|
45
|
+
data-[side=top]:slide-in-from-bottom-2 w-72
|
|
45
46
|
origin-(--radix-popover-content-transform-origin) rounded-md border
|
|
46
|
-
p-4 shadow-md outline-hidden`, className),
|
|
47
|
+
p-4 shadow-md outline-hidden`, OVERLAY_LAYER, className),
|
|
47
48
|
...props
|
|
48
49
|
})
|
|
49
50
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.mjs","names":[],"sources":["../../src/core/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n container,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content> & {\n container?: HTMLElement;\n}) {\n const { getContainer } = useConfig();\n\n return (\n <PopoverPrimitive.Portal container={container ?? getContainer()}>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n `bg-popover text-popover-foreground data-[state=open]:animate-in\n data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95\n data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2\n data-[side=left]:slide-in-from-right-2\n data-[side=right]:slide-in-from-left-2\n data-[side=top]:slide-in-from-bottom-2
|
|
1
|
+
{"version":3,"file":"popover.mjs","names":[],"sources":["../../src/core/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport { OVERLAY_LAYER } from '../lib/z-layers';\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n container,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content> & {\n container?: HTMLElement;\n}) {\n const { getContainer } = useConfig();\n\n return (\n <PopoverPrimitive.Portal container={container ?? getContainer()}>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n `bg-popover text-popover-foreground data-[state=open]:animate-in\n data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95\n data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2\n data-[side=left]:slide-in-from-right-2\n data-[side=right]:slide-in-from-left-2\n data-[side=top]:slide-in-from-bottom-2 w-72\n origin-(--radix-popover-content-transform-origin) rounded-md border\n p-4 shadow-md outline-hidden`,\n OVERLAY_LAYER,\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn('flex flex-col gap-1 text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction PopoverTitle({ className, ...props }: React.ComponentProps<'h2'>) {\n return (\n <div\n data-slot=\"popover-title\"\n className={cn('font-medium', className)}\n {...props}\n />\n );\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: React.ComponentProps<'p'>) {\n return (\n <p\n data-slot=\"popover-description\"\n className={cn('text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n PopoverHeader,\n PopoverTitle,\n PopoverDescription,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAWA,SAAS,QAAQ,EACf,GAAG,SACkD;CACrD,OAAO,oBAAC,iBAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ,CAAA;AAChE;AAEA,SAAS,eAAe,EACtB,GAAG,SACqD;CACxD,OAAO,oBAAC,iBAAiB,SAAlB;EAA0B,aAAU;EAAkB,GAAI;CAAQ,CAAA;AAC3E;AAEA,SAAS,eAAe,EACtB,WACA,QAAQ,UACR,aAAa,GACb,WACA,GAAG,SAGF;CACD,MAAM,EAAE,iBAAiB,UAAU;CAEnC,OACE,oBAAC,iBAAiB,QAAlB;EAAyB,WAAW,aAAa,aAAa;EAC5D,UAAA,oBAAC,iBAAiB,SAAlB;GACE,aAAU;GACH;GACK;GACZ,WAAW,GACT;;;;;;;;yCASA,eACA,SACF;GACA,GAAI;EACL,CAAA;CACsB,CAAA;AAE7B;AAEA,SAAS,cAAc,EACrB,GAAG,SACoD;CACvD,OAAO,oBAAC,iBAAiB,QAAlB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,cAAc,EAAE,WAAW,GAAG,SAAsC;CAC3E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAqC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,eAAe,SAAS;EACtC,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyB;CAC5B,OACE,oBAAC,KAAD;EACE,aAAU;EACV,WAAW,GAAG,yBAAyB,SAAS;EAChD,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.mts","names":[],"sources":["../../src/core/select.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"select.d.mts","names":[],"sources":["../../src/core/select.tsx"],"mappings":";;;iBAYS,YACJ,SACF,QAAM,sBAAsB,gBAAgB,QAAK,QAAA,IAAA"}
|
package/dist/core/select.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
4
|
import { useConfig } from "../providers/config/context.mjs";
|
|
5
|
+
import { OVERLAY_LAYER } from "../lib/z-layers.mjs";
|
|
5
6
|
import "react";
|
|
6
7
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -73,10 +74,10 @@ function SelectContent({ className, children, position = "item-aligned", align =
|
|
|
73
74
|
data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2
|
|
74
75
|
data-[side=left]:slide-in-from-right-2
|
|
75
76
|
data-[side=right]:slide-in-from-left-2
|
|
76
|
-
data-[side=top]:slide-in-from-bottom-2 relative
|
|
77
|
+
data-[side=top]:slide-in-from-bottom-2 relative
|
|
77
78
|
max-h-(--radix-select-content-available-height) min-w-[8rem]
|
|
78
79
|
origin-(--radix-select-content-transform-origin) overflow-x-hidden
|
|
79
|
-
overflow-y-auto rounded-md border shadow-md`, position === "popper" && `data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1
|
|
80
|
+
overflow-y-auto rounded-md border shadow-md`, OVERLAY_LAYER, position === "popper" && `data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1
|
|
80
81
|
data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`, className),
|
|
81
82
|
position,
|
|
82
83
|
align,
|
package/dist/core/select.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.mjs","names":[],"sources":["../../src/core/select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nfunction SelectTrigger({\n className,\n size = 'default',\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: 'sm' | 'default';\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n `border-input data-[placeholder]:text-muted-foreground\n [&_svg:not([class*='text-'])]:text-muted-foreground\n focus-visible:border-ring focus-visible:ring-ring/50\n aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40\n aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50\n flex w-fit items-center justify-between gap-2 rounded-md border\n bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs\n transition-[color,box-shadow] outline-none focus-visible:ring-[3px]\n disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9\n data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1\n *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center\n *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none\n [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = 'item-aligned',\n align = 'center',\n container,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content> & {\n container?: HTMLElement;\n}) {\n const { getContainer } = useConfig();\n\n return (\n <SelectPrimitive.Portal container={container ?? getContainer()}>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n `bg-popover text-popover-foreground data-[state=open]:animate-in\n data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95\n data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2\n data-[side=left]:slide-in-from-right-2\n data-[side=right]:slide-in-from-left-2\n data-[side=top]:slide-in-from-bottom-2 relative
|
|
1
|
+
{"version":3,"file":"select.mjs","names":[],"sources":["../../src/core/select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport { OVERLAY_LAYER } from '../lib/z-layers';\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nfunction SelectTrigger({\n className,\n size = 'default',\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: 'sm' | 'default';\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n `border-input data-[placeholder]:text-muted-foreground\n [&_svg:not([class*='text-'])]:text-muted-foreground\n focus-visible:border-ring focus-visible:ring-ring/50\n aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40\n aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50\n flex w-fit items-center justify-between gap-2 rounded-md border\n bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs\n transition-[color,box-shadow] outline-none focus-visible:ring-[3px]\n disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9\n data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1\n *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center\n *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none\n [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = 'item-aligned',\n align = 'center',\n container,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content> & {\n container?: HTMLElement;\n}) {\n const { getContainer } = useConfig();\n\n return (\n <SelectPrimitive.Portal container={container ?? getContainer()}>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n `bg-popover text-popover-foreground data-[state=open]:animate-in\n data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95\n data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2\n data-[side=left]:slide-in-from-right-2\n data-[side=right]:slide-in-from-left-2\n data-[side=top]:slide-in-from-bottom-2 relative\n max-h-(--radix-select-content-available-height) min-w-[8rem]\n origin-(--radix-select-content-transform-origin) overflow-x-hidden\n overflow-y-auto rounded-md border shadow-md`,\n OVERLAY_LAYER,\n position === 'popper' &&\n `data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1\n data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,\n className,\n )}\n position={position}\n align={align}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n `h-[var(--radix-select-trigger-height)] w-full\n min-w-[var(--radix-select-trigger-width)] scroll-my-1`,\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn('text-muted-foreground px-2 py-1.5 text-xs', className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n `focus:bg-accent focus:text-accent-foreground\n [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full\n cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm\n outline-hidden select-none data-[disabled]:pointer-events-none\n data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\n [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex\n *:[span]:last:items-center *:[span]:last:gap-2`,\n className,\n )}\n {...props}\n >\n <span\n data-slot=\"select-item-indicator\"\n className=\"absolute right-2 flex size-3.5 items-center justify-center\"\n >\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn('bg-border pointer-events-none -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,OAAO,EACd,GAAG,SACiD;CACpD,OAAO,oBAAC,gBAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;AAEA,SAAS,YAAY,EACnB,GAAG,SACkD;CACrD,OAAO,oBAAC,gBAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,YAAY,EACnB,GAAG,SACkD;CACrD,OAAO,oBAAC,gBAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,OAAO,WACP,UACA,GAAG,SAGF;CACD,OACE,qBAAC,gBAAgB,SAAjB;EACE,aAAU;EACV,aAAW;EACX,WAAW,GACT;;;;;;;;;;;;gEAaA,SACF;EACA,GAAI;EAnBN,UAAA,CAqBG,UACD,oBAAC,gBAAgB,MAAjB;GAAsB,SAAA;GACpB,UAAA,oBAAC,iBAAD,EAAiB,WAAU,oBAAqB,CAAA;EAC5B,CAAA,CACC;;AAE7B;AAEA,SAAS,cAAc,EACrB,WACA,UACA,WAAW,gBACX,QAAQ,UACR,WACA,GAAG,SAGF;CACD,MAAM,EAAE,iBAAiB,UAAU;CAEnC,OACE,oBAAC,gBAAgB,QAAjB;EAAwB,WAAW,aAAa,aAAa;EAC3D,UAAA,qBAAC,gBAAgB,SAAjB;GACE,aAAU;GACV,WAAW,GACT;;;;;;;;;wDAUA,eACA,aAAa,YACX;6EAEF,SACF;GACU;GACH;GACP,GAAI;GArBN,UAAA;IAuBE,oBAAC,sBAAD,CAAuB,CAAA;IACvB,oBAAC,gBAAgB,UAAjB;KACE,WAAW,GACT,OACA,aAAa,YACX;oEAEJ;KAEC;IACuB,CAAA;IAC1B,oBAAC,wBAAD,CAAyB,CAAA;GACF;;CACH,CAAA;AAE5B;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,oBAAC,gBAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,6CAA6C,SAAS;EACpE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAClB,WACA,UACA,GAAG,SACiD;CACpD,OACE,qBAAC,gBAAgB,MAAjB;EACE,aAAU;EACV,WAAW,GACT;;;;;;yDAOA,SACF;EACA,GAAI;EAZN,UAAA,CAcE,oBAAC,QAAD;GACE,aAAU;GACV,WAAU;GAEV,UAAA,oBAAC,gBAAgB,eAAjB,EAAA,UACE,oBAAC,WAAD,EAAW,WAAU,SAAU,CAAA,EACF,CAAA;EAC3B,CAAA,GACN,oBAAC,gBAAgB,UAAjB,EAA2B,SAAmC,CAAA,CAC1C;;AAE1B;AAEA,SAAS,gBAAgB,EACvB,WACA,GAAG,SACsD;CACzD,OACE,oBAAC,gBAAgB,WAAjB;EACE,aAAU;EACV,WAAW,GAAG,iDAAiD,SAAS;EACxE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,qBAAqB,EAC5B,WACA,GAAG,SAC2D;CAC9D,OACE,oBAAC,gBAAgB,gBAAjB;EACE,aAAU;EACV,WAAW,GACT,wDACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,eAAD,EAAe,WAAU,SAAU,CAAA;CACL,CAAA;AAEpC;AAEA,SAAS,uBAAuB,EAC9B,WACA,GAAG,SAC6D;CAChE,OACE,oBAAC,gBAAgB,kBAAjB;EACE,aAAU;EACV,WAAW,GACT,wDACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,iBAAD,EAAiB,WAAU,SAAU,CAAA;CACL,CAAA;AAEtC"}
|
package/dist/lib/colors.d.mts
CHANGED
|
@@ -5,41 +5,16 @@
|
|
|
5
5
|
* `data-color`), so the same word means the same hue on either component
|
|
6
6
|
* (#320).
|
|
7
7
|
*
|
|
8
|
-
* The names track **Tailwind's own palette names** (#342)
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* the value agree, and lets `globals.css` resolve each entry straight from the
|
|
14
|
-
* matching `--color-*` theme variable instead of a hand-copied hex.
|
|
8
|
+
* The names track **Tailwind's own palette names** (#342): every preset is a
|
|
9
|
+
* Tailwind hue spelled the way Tailwind spells it, so the name and the value
|
|
10
|
+
* agree and `globals.css` can resolve each entry straight from the matching
|
|
11
|
+
* `--color-*` theme variable instead of a hand-copied hex. The pre-8.0 antd
|
|
12
|
+
* spellings were removed in 9.0.0.
|
|
15
13
|
*
|
|
16
14
|
* Keep this list in sync with the `[data-color='…']` rules there.
|
|
17
15
|
*/
|
|
18
16
|
declare const PRESET_COLORS: readonly ["blue", "purple", "cyan", "green", "fuchsia", "pink", "red", "orange", "yellow", "indigo", "lime", "amber"];
|
|
19
17
|
type PresetColor = (typeof PRESET_COLORS)[number];
|
|
20
|
-
/**
|
|
21
|
-
* Pre-8.0 spellings, still accepted and still rendering exactly what they
|
|
22
|
-
* rendered before — they are aliases, not a behaviour change:
|
|
23
|
-
*
|
|
24
|
-
* | deprecated | renders | canonical spelling |
|
|
25
|
-
* | ---------- | ----------------- | ----------------------------- |
|
|
26
|
-
* | `magenta` | `--color-fuchsia-500` | `fuchsia` |
|
|
27
|
-
* | `geekblue` | `--color-indigo-500` | `indigo` |
|
|
28
|
-
* | `gold` | `--color-amber-500` | `amber` |
|
|
29
|
-
* | `volcano` | `--color-orange-600` | *(none — see below)* |
|
|
30
|
-
*
|
|
31
|
-
* `volcano` is the odd one out and has no canonical successor. Every other
|
|
32
|
-
* preset is a distinct hue at Tailwind's `500` step, but `volcano` is
|
|
33
|
-
* `orange-600` — the same hue as `orange`, one step darker. That makes it a
|
|
34
|
-
* lightness variant masquerading as a hue, so it doesn't belong in a list
|
|
35
|
-
* whose axis is "one entry per hue". It keeps rendering `orange-600` until the
|
|
36
|
-
* next major; callers who want that exact shade can set `--btn-bg`/`--tag-bg`
|
|
37
|
-
* directly.
|
|
38
|
-
*
|
|
39
|
-
* All four are removed in the next major.
|
|
40
|
-
*/
|
|
41
|
-
declare const DEPRECATED_PRESET_COLORS: readonly ["magenta", "geekblue", "gold", "volcano"];
|
|
42
|
-
type DeprecatedPresetColor = (typeof DEPRECATED_PRESET_COLORS)[number];
|
|
43
18
|
//#endregion
|
|
44
|
-
export {
|
|
19
|
+
export { PRESET_COLORS, PresetColor };
|
|
45
20
|
//# sourceMappingURL=colors.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.mts","names":[],"sources":["../../src/lib/colors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"colors.d.mts","names":[],"sources":["../../src/lib/colors.ts"],"mappings":";;;;;;;;;;;;;;;cAca;KAeD,sBAAsB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/lib/z-layers.ts
|
|
2
|
+
/**
|
|
3
|
+
* The single stacking layer every floating/overlay primitive in this library
|
|
4
|
+
* shares — dialog and drawer (mask + content), popover, select, dropdown,
|
|
5
|
+
* float button, and `Layout.Header`.
|
|
6
|
+
*
|
|
7
|
+
* **They are all deliberately equal.** Nothing here ranks against anything else
|
|
8
|
+
* here by z-index; relative order falls out of DOM order, which is what puts a
|
|
9
|
+
* Select popup above the Drawer it was opened from (Radix appends each portal to
|
|
10
|
+
* `body` as it opens) and a Drawer above `Layout.Header`. Give one of them a
|
|
11
|
+
* different value and those pairs silently invert. `Modal.confirm` and the
|
|
12
|
+
* imperative `Toast`/`Modal` stack roots sit above this on purpose (`z-10000` /
|
|
13
|
+
* `zIndex = '10000'`), so an imperative confirm opened from inside a declarative
|
|
14
|
+
* Modal still lands on top.
|
|
15
|
+
*
|
|
16
|
+
* **Why 1000 and not shadcn's default of 50.** 50 assumes you own the whole app
|
|
17
|
+
* and keep its chrome below that. This package is published, so it doesn't get
|
|
18
|
+
* that assumption: Infima (Docusaurus) puts its navbar at `--ifm-z-index-fixed: 200`
|
|
19
|
+
* and its own overlay at 400, so on this repo's own docs site a right-anchored
|
|
20
|
+
* Drawer had its top 60px — the entire header, title and close button — painted
|
|
21
|
+
* under the navbar. It still hit-tested fine, because vaul/Radix mark outside
|
|
22
|
+
* content `pointer-events: none` while a modal is open, so the close button was
|
|
23
|
+
* clickable but invisible. 1000 clears Infima's whole scale and sits in the band
|
|
24
|
+
* every major library reserves for modals (antd 1000, Bootstrap 1055, MUI 1300).
|
|
25
|
+
*
|
|
26
|
+
* Retune per call site with `className` / `classNames.mask` — both land after
|
|
27
|
+
* this in `cn()`, so `tailwind-merge` lets them win.
|
|
28
|
+
*/
|
|
29
|
+
const OVERLAY_LAYER = "z-1000";
|
|
30
|
+
//#endregion
|
|
31
|
+
export { OVERLAY_LAYER };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=z-layers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"z-layers.mjs","names":[],"sources":["../../src/lib/z-layers.ts"],"sourcesContent":["/**\n * The single stacking layer every floating/overlay primitive in this library\n * shares — dialog and drawer (mask + content), popover, select, dropdown,\n * float button, and `Layout.Header`.\n *\n * **They are all deliberately equal.** Nothing here ranks against anything else\n * here by z-index; relative order falls out of DOM order, which is what puts a\n * Select popup above the Drawer it was opened from (Radix appends each portal to\n * `body` as it opens) and a Drawer above `Layout.Header`. Give one of them a\n * different value and those pairs silently invert. `Modal.confirm` and the\n * imperative `Toast`/`Modal` stack roots sit above this on purpose (`z-10000` /\n * `zIndex = '10000'`), so an imperative confirm opened from inside a declarative\n * Modal still lands on top.\n *\n * **Why 1000 and not shadcn's default of 50.** 50 assumes you own the whole app\n * and keep its chrome below that. This package is published, so it doesn't get\n * that assumption: Infima (Docusaurus) puts its navbar at `--ifm-z-index-fixed: 200`\n * and its own overlay at 400, so on this repo's own docs site a right-anchored\n * Drawer had its top 60px — the entire header, title and close button — painted\n * under the navbar. It still hit-tested fine, because vaul/Radix mark outside\n * content `pointer-events: none` while a modal is open, so the close button was\n * clickable but invisible. 1000 clears Infima's whole scale and sits in the band\n * every major library reserves for modals (antd 1000, Bootstrap 1055, MUI 1300).\n *\n * Retune per call site with `className` / `classNames.mask` — both land after\n * this in `cn()`, so `tailwind-merge` lets them win.\n */\nexport const OVERLAY_LAYER = 'z-1000';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,gBAAgB"}
|
package/dist/style.css
CHANGED
|
@@ -103,54 +103,42 @@
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
@layer components {
|
|
106
|
-
:is([data-slot="button"], [data-slot="
|
|
106
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="blue"] {
|
|
107
107
|
--preset-color: var(--color-blue-500);
|
|
108
108
|
}
|
|
109
|
-
:is([data-slot="button"], [data-slot="
|
|
109
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="purple"] {
|
|
110
110
|
--preset-color: var(--color-purple-500);
|
|
111
111
|
}
|
|
112
|
-
:is([data-slot="button"], [data-slot="
|
|
112
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="cyan"] {
|
|
113
113
|
--preset-color: var(--color-cyan-500);
|
|
114
114
|
}
|
|
115
|
-
:is([data-slot="button"], [data-slot="
|
|
115
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="green"] {
|
|
116
116
|
--preset-color: var(--color-green-500);
|
|
117
117
|
}
|
|
118
|
-
:is([data-slot="button"], [data-slot="
|
|
118
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="fuchsia"] {
|
|
119
119
|
--preset-color: var(--color-fuchsia-500);
|
|
120
120
|
}
|
|
121
|
-
:is([data-slot="button"], [data-slot="
|
|
121
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="pink"] {
|
|
122
122
|
--preset-color: var(--color-pink-500);
|
|
123
123
|
}
|
|
124
|
-
:is([data-slot="button"], [data-slot="
|
|
124
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="red"] {
|
|
125
125
|
--preset-color: var(--color-red-500);
|
|
126
126
|
}
|
|
127
|
-
:is([data-slot="button"], [data-slot="
|
|
127
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="orange"] {
|
|
128
128
|
--preset-color: var(--color-orange-500);
|
|
129
129
|
}
|
|
130
|
-
:is([data-slot="button"], [data-slot="
|
|
130
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="yellow"] {
|
|
131
131
|
--preset-color: var(--color-yellow-500);
|
|
132
132
|
}
|
|
133
|
-
:is([data-slot="button"], [data-slot="
|
|
133
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="indigo"] {
|
|
134
134
|
--preset-color: var(--color-indigo-500);
|
|
135
135
|
}
|
|
136
|
-
:is([data-slot="button"], [data-slot="
|
|
136
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="lime"] {
|
|
137
137
|
--preset-color: var(--color-lime-500);
|
|
138
138
|
}
|
|
139
|
-
:is([data-slot="button"], [data-slot="
|
|
139
|
+
:is([data-slot="button"], [data-slot="tag"])[data-color="amber"] {
|
|
140
140
|
--preset-color: var(--color-amber-500);
|
|
141
141
|
}
|
|
142
|
-
:is([data-slot="button"], [data-slot="badge"])[data-color="magenta"] {
|
|
143
|
-
--preset-color: var(--color-fuchsia-500);
|
|
144
|
-
}
|
|
145
|
-
:is([data-slot="button"], [data-slot="badge"])[data-color="geekblue"] {
|
|
146
|
-
--preset-color: var(--color-indigo-500);
|
|
147
|
-
}
|
|
148
|
-
:is([data-slot="button"], [data-slot="badge"])[data-color="gold"] {
|
|
149
|
-
--preset-color: var(--color-amber-500);
|
|
150
|
-
}
|
|
151
|
-
:is([data-slot="button"], [data-slot="badge"])[data-color="volcano"] {
|
|
152
|
-
--preset-color: var(--color-orange-600);
|
|
153
|
-
}
|
|
154
142
|
[data-slot="button"][data-color] {
|
|
155
143
|
--btn-bg: var(--preset-color);
|
|
156
144
|
--btn-fg: white;
|
|
@@ -164,7 +152,7 @@
|
|
|
164
152
|
--btn-bg-active: color-mix(in oklch, var(--btn-bg), black 22%);
|
|
165
153
|
}
|
|
166
154
|
}
|
|
167
|
-
[data-slot="button"][data-color="yellow"], [data-slot="button"][data-color="lime"], [data-slot="button"][data-color="amber"]
|
|
155
|
+
[data-slot="button"][data-color="yellow"], [data-slot="button"][data-color="lime"], [data-slot="button"][data-color="amber"] {
|
|
168
156
|
--btn-fg: black;
|
|
169
157
|
}
|
|
170
158
|
[data-slot="button"][data-color="default"] {
|
|
@@ -178,7 +166,7 @@
|
|
|
178
166
|
[data-slot="button"][data-color="danger"] {
|
|
179
167
|
--btn-bg: var(--destructive);
|
|
180
168
|
}
|
|
181
|
-
[data-slot="
|
|
169
|
+
[data-slot="tag"][data-color] {
|
|
182
170
|
--tag-bg: var(--preset-color);
|
|
183
171
|
--tag-fg: var(--tag-bg);
|
|
184
172
|
--tag-tint: var(--tag-bg);
|
|
@@ -186,32 +174,32 @@
|
|
|
186
174
|
--tag-tint: color-mix(in oklab, var(--tag-bg), transparent 90%);
|
|
187
175
|
}
|
|
188
176
|
}
|
|
189
|
-
[data-slot="
|
|
177
|
+
[data-slot="tag"][data-color="default"] {
|
|
190
178
|
--tag-bg: var(--border);
|
|
191
179
|
--tag-tint: var(--muted);
|
|
192
180
|
--tag-fg: var(--muted-foreground);
|
|
193
181
|
}
|
|
194
|
-
[data-slot="
|
|
182
|
+
[data-slot="tag"][data-color="default"][data-variant="outlined"] {
|
|
195
183
|
--tag-fg: var(--foreground);
|
|
196
184
|
}
|
|
197
|
-
[data-slot="
|
|
185
|
+
[data-slot="tag"][data-color="primary"] {
|
|
198
186
|
--tag-bg: var(--primary);
|
|
199
187
|
}
|
|
200
|
-
[data-slot="
|
|
188
|
+
[data-slot="tag"][data-color="danger"] {
|
|
201
189
|
--tag-bg: var(--destructive);
|
|
202
190
|
}
|
|
203
|
-
[data-slot="
|
|
191
|
+
[data-slot="tag"][data-color="success"] {
|
|
204
192
|
--tag-bg: var(--color-green-500);
|
|
205
193
|
--tag-fg: var(--color-green-600);
|
|
206
194
|
}
|
|
207
|
-
[data-slot="
|
|
195
|
+
[data-slot="tag"][data-color="warning"] {
|
|
208
196
|
--tag-bg: var(--color-yellow-500);
|
|
209
197
|
--tag-fg: var(--color-yellow-600);
|
|
210
198
|
}
|
|
211
|
-
:is(.dark, [data-theme="dark"]) [data-slot="
|
|
199
|
+
:is(.dark, [data-theme="dark"]) [data-slot="tag"][data-color="success"] {
|
|
212
200
|
--tag-fg: var(--color-green-400);
|
|
213
201
|
}
|
|
214
|
-
:is(.dark, [data-theme="dark"]) [data-slot="
|
|
202
|
+
:is(.dark, [data-theme="dark"]) [data-slot="tag"][data-color="warning"] {
|
|
215
203
|
--tag-fg: var(--color-yellow-400);
|
|
216
204
|
}
|
|
217
205
|
[data-slot="col"] {
|
|
@@ -367,6 +355,9 @@
|
|
|
367
355
|
.z-50 {
|
|
368
356
|
z-index: 50;
|
|
369
357
|
}
|
|
358
|
+
.z-1000 {
|
|
359
|
+
z-index: 1000;
|
|
360
|
+
}
|
|
370
361
|
.z-10000 {
|
|
371
362
|
z-index: 10000;
|
|
372
363
|
}
|
|
@@ -1560,6 +1551,10 @@
|
|
|
1560
1551
|
--tw-blur: blur(8px);
|
|
1561
1552
|
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
1562
1553
|
}
|
|
1554
|
+
.invert {
|
|
1555
|
+
--tw-invert: invert(100%);
|
|
1556
|
+
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
1557
|
+
}
|
|
1563
1558
|
.filter {
|
|
1564
1559
|
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
1565
1560
|
}
|
|
@@ -3027,6 +3022,9 @@
|
|
|
3027
3022
|
a.\[a\&\]\:hover\:text-accent-foreground:hover {
|
|
3028
3023
|
color: var(--accent-foreground);
|
|
3029
3024
|
}
|
|
3025
|
+
a.\[a\&\]\:hover\:underline:hover {
|
|
3026
|
+
text-decoration-line: underline;
|
|
3027
|
+
}
|
|
3030
3028
|
}
|
|
3031
3029
|
}
|
|
3032
3030
|
:root {
|
package/dist/utils.d.mts
CHANGED
|
@@ -2,6 +2,18 @@ import * as React$1 from "react";
|
|
|
2
2
|
import { ClassValue } from "clsx";
|
|
3
3
|
//#region src/lib/utils/index.d.ts
|
|
4
4
|
declare const cn: (...inputs: ClassValue[]) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Renders a slot value, applying `wrapper` only to values that aren't already
|
|
7
|
+
* a React element. Passing an element opts out of the wrapper entirely.
|
|
8
|
+
*
|
|
9
|
+
* **Only use this for content slots where that opt-out is the point** — a
|
|
10
|
+
* `title` the caller may want to supply as their own heading, so we don't end
|
|
11
|
+
* up nesting `<h6><h3>`. Do *not* use it for a wrapper that carries layout the
|
|
12
|
+
* component owns (padding, `shrink-0`, a footer bar): the common case is an
|
|
13
|
+
* element, so the wrapper would be skipped exactly when it's needed, and any
|
|
14
|
+
* `classNames.*` threaded through it would silently do nothing. Write those as
|
|
15
|
+
* a plain `{value != null && <Wrapper>{value}</Wrapper>}`.
|
|
16
|
+
*/
|
|
5
17
|
declare const renderConditional: <T extends React$1.ReactNode>(value: T, wrapper?: (value: NonNullable<T>) => React$1.ReactNode) => React$1.ReactNode;
|
|
6
18
|
//#endregion
|
|
7
19
|
export { cn, renderConditional };
|
package/dist/utils.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.mts","names":[],"sources":["../src/lib/utils/index.ts"],"mappings":";;;cAKa,QAAS,QAAQ
|
|
1
|
+
{"version":3,"file":"utils.d.mts","names":[],"sources":["../src/lib/utils/index.ts"],"mappings":";;;cAKa,QAAS,QAAQ;;;;;;;;;;;;;cAgBjB,oBAAqB,UAAU,QAAM,WAChD,OAAO,GACP,WAAW,OAAO,YAAY,OAAO,QAAM,cAC1C,QAAM"}
|