@jbpark/ui-kit 9.1.1 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +18 -17
- package/README.md +18 -17
- package/dist/Button.d.mts +1 -1
- package/dist/Button.d.mts.map +1 -1
- package/dist/Button.mjs +4 -5
- package/dist/Button.mjs.map +1 -1
- package/dist/Tag.d.mts.map +1 -1
- package/dist/Tag.mjs.map +1 -1
- package/dist/components/atoms/checkbox/checkbox.mjs.map +1 -1
- package/dist/components/atoms/option-group.mjs.map +1 -1
- package/dist/components/atoms/popover.d.mts +3 -1
- package/dist/components/atoms/popover.d.mts.map +1 -1
- package/dist/components/atoms/popover.mjs +10 -111
- package/dist/components/atoms/popover.mjs.map +1 -1
- package/dist/components/atoms/progress.mjs +3 -4
- package/dist/components/atoms/progress.mjs.map +1 -1
- package/dist/components/atoms/radio/context.mjs +2 -2
- package/dist/components/atoms/radio/context.mjs.map +1 -1
- package/dist/components/atoms/radio/group.mjs +6 -6
- package/dist/components/atoms/radio/group.mjs.map +1 -1
- package/dist/components/atoms/radio/radio.d.mts +2 -5
- package/dist/components/atoms/radio/radio.d.mts.map +1 -1
- package/dist/components/atoms/radio/radio.mjs +0 -1
- package/dist/components/atoms/radio/radio.mjs.map +1 -1
- package/dist/components/atoms/rich-text-editor/content-classes.mjs +1 -1
- package/dist/components/atoms/rich-text-editor/content-classes.mjs.map +1 -1
- package/dist/components/atoms/rich-text-editor/rich-text-editor.mjs +1 -1
- package/dist/components/atoms/rich-text-editor/rich-text-editor.mjs.map +1 -1
- package/dist/components/atoms/rich-text-editor/toolbar-button.mjs.map +1 -1
- package/dist/components/atoms/rich-text-editor/toolbar-presets.mjs.map +1 -1
- package/dist/components/atoms/rich-text-editor/toolbar.mjs +1 -1
- package/dist/components/atoms/rich-text-editor/toolbar.mjs.map +1 -1
- package/dist/components/atoms/select.mjs +5 -1
- package/dist/components/atoms/select.mjs.map +1 -1
- package/dist/components/atoms/skeleton/node.mjs +1 -1
- package/dist/components/atoms/skeleton/node.mjs.map +1 -1
- package/dist/components/atoms/skeleton/skeleton.mjs +2 -2
- package/dist/components/atoms/skeleton/skeleton.mjs.map +1 -1
- package/dist/components/atoms/slider/slider.mjs.map +1 -1
- package/dist/components/atoms/switch.d.mts +1 -1
- package/dist/components/atoms/switch.d.mts.map +1 -1
- package/dist/components/atoms/switch.mjs +3 -3
- package/dist/components/atoms/switch.mjs.map +1 -1
- package/dist/components/molecules/collapse.mjs +3 -10
- package/dist/components/molecules/collapse.mjs.map +1 -1
- package/dist/components/molecules/reveals/reveals.mjs +1 -1
- package/dist/components/molecules/reveals/reveals.mjs.map +1 -1
- package/dist/components/organisms/drawer.d.mts +1 -2
- package/dist/components/organisms/drawer.d.mts.map +1 -1
- package/dist/components/organisms/drawer.mjs +5 -7
- package/dist/components/organisms/drawer.mjs.map +1 -1
- package/dist/components/organisms/modal.d.mts.map +1 -1
- package/dist/components/organisms/modal.mjs +1 -3
- package/dist/components/organisms/modal.mjs.map +1 -1
- package/dist/components/templates/container.d.mts +4 -3
- package/dist/components/templates/container.d.mts.map +1 -1
- package/dist/components/templates/container.mjs +10 -6
- package/dist/components/templates/container.mjs.map +1 -1
- package/dist/components/templates/index.d.mts +13 -0
- package/dist/components/templates/layout/content.d.mts +4 -3
- package/dist/components/templates/layout/content.d.mts.map +1 -1
- package/dist/components/templates/layout/content.mjs +14 -9
- package/dist/components/templates/layout/content.mjs.map +1 -1
- package/dist/core/accordion.d.mts +1 -1
- package/dist/core/accordion.mjs +12 -12
- package/dist/core/accordion.mjs.map +1 -1
- package/dist/core/badge.d.mts +5 -17
- package/dist/core/badge.d.mts.map +1 -1
- package/dist/core/badge.mjs +12 -21
- package/dist/core/badge.mjs.map +1 -1
- package/dist/core/button.d.mts +7 -6
- package/dist/core/button.d.mts.map +1 -1
- package/dist/core/button.mjs +4 -4
- package/dist/core/button.mjs.map +1 -1
- package/dist/core/calendar.mjs +2 -1
- package/dist/core/calendar.mjs.map +1 -1
- package/dist/core/checkbox.d.mts +1 -1
- package/dist/core/checkbox.mjs +14 -14
- package/dist/core/checkbox.mjs.map +1 -1
- package/dist/core/dialog.d.mts +1 -1
- package/dist/core/dialog.mjs +25 -33
- package/dist/core/dialog.mjs.map +1 -1
- package/dist/core/drawer.d.mts +1 -1
- package/dist/core/drawer.mjs +45 -46
- package/dist/core/drawer.mjs.map +1 -1
- package/dist/core/label.d.mts +1 -2
- package/dist/core/label.mjs +1 -3
- package/dist/core/label.mjs.map +1 -1
- package/dist/core/popover.d.mts +1 -1
- package/dist/core/popover.mjs +42 -37
- package/dist/core/popover.mjs.map +1 -1
- package/dist/core/progress.d.mts +1 -1
- package/dist/core/progress.mjs +7 -10
- package/dist/core/progress.mjs.map +1 -1
- package/dist/core/radio-group.d.mts +3 -7
- package/dist/core/radio-group.mjs +14 -13
- package/dist/core/radio-group.mjs.map +1 -1
- package/dist/core/select.d.mts +7 -3
- package/dist/core/select.d.mts.map +1 -1
- package/dist/core/select.mjs +60 -56
- package/dist/core/select.mjs.map +1 -1
- package/dist/core/separator.d.mts +1 -1
- package/dist/core/separator.mjs +6 -5
- package/dist/core/separator.mjs.map +1 -1
- package/dist/core/slider.d.mts +1 -1
- package/dist/core/slider.mjs +38 -27
- package/dist/core/slider.mjs.map +1 -1
- package/dist/core/switch.d.mts +1 -1
- package/dist/core/switch.mjs +15 -15
- package/dist/core/switch.mjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/lib/z-layers.mjs +4 -6
- package/dist/lib/z-layers.mjs.map +1 -1
- package/dist/providers/config/config.mjs +2 -2
- package/dist/providers/config/config.mjs.map +1 -1
- package/dist/style.css +327 -462
- package/package.json +7 -20
- package/dist/core/radio-group.d.mts.map +0 -1
package/dist/core/drawer.mjs
CHANGED
|
@@ -5,10 +5,10 @@ import { useConfig } from "../providers/config/context.mjs";
|
|
|
5
5
|
import { OVERLAY_LAYER } from "../lib/z-layers.mjs";
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import {
|
|
8
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
9
9
|
//#region src/core/drawer.tsx
|
|
10
10
|
var drawer_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
-
Drawer: () => Drawer
|
|
11
|
+
Drawer: () => Drawer,
|
|
12
12
|
DrawerClose: () => DrawerClose,
|
|
13
13
|
DrawerContent: () => DrawerContent,
|
|
14
14
|
DrawerDescription: () => DrawerDescription,
|
|
@@ -19,69 +19,68 @@ var drawer_exports = /* @__PURE__ */ __exportAll({
|
|
|
19
19
|
DrawerTitle: () => DrawerTitle,
|
|
20
20
|
DrawerTrigger: () => DrawerTrigger
|
|
21
21
|
});
|
|
22
|
-
function Drawer
|
|
23
|
-
|
|
24
|
-
return /* @__PURE__ */ jsx(Drawer.Root, {
|
|
22
|
+
function Drawer({ ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
25
24
|
"data-slot": "drawer",
|
|
26
|
-
handleOnly: !draggable,
|
|
27
|
-
container: container ?? getContainer(),
|
|
28
25
|
...props
|
|
29
26
|
});
|
|
30
27
|
}
|
|
31
28
|
function DrawerTrigger({ ...props }) {
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
33
30
|
"data-slot": "drawer-trigger",
|
|
34
31
|
...props
|
|
35
32
|
});
|
|
36
33
|
}
|
|
37
34
|
function DrawerPortal({ ...props }) {
|
|
38
|
-
return /* @__PURE__ */ jsx(
|
|
39
|
-
"data-slot": "drawer-portal",
|
|
40
|
-
...props
|
|
41
|
-
});
|
|
35
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, { ...props });
|
|
42
36
|
}
|
|
43
37
|
function DrawerClose({ ...props }) {
|
|
44
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
+
return /* @__PURE__ */ jsx(Dialog.Close, {
|
|
45
39
|
"data-slot": "drawer-close",
|
|
46
40
|
...props
|
|
47
41
|
});
|
|
48
42
|
}
|
|
49
43
|
function DrawerOverlay({ className, ...props }) {
|
|
50
|
-
return /* @__PURE__ */ jsx(
|
|
44
|
+
return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
51
45
|
"data-slot": "drawer-overlay",
|
|
52
|
-
className: cn(`
|
|
53
|
-
data-
|
|
54
|
-
bg-black/50`, OVERLAY_LAYER, className),
|
|
46
|
+
className: cn(`fixed inset-0 bg-black/50 transition-opacity duration-300
|
|
47
|
+
data-ending-style:opacity-0 data-starting-style:opacity-0`, OVERLAY_LAYER, className),
|
|
55
48
|
...props
|
|
56
49
|
});
|
|
57
50
|
}
|
|
58
|
-
function DrawerContent({ className, children, classNames = {}, handlebar, mask, ...props }) {
|
|
51
|
+
function DrawerContent({ className, children, classNames = {}, handlebar, mask = true, direction = "bottom", container, ...props }) {
|
|
52
|
+
const { getContainer } = useConfig();
|
|
53
|
+
const resolvedContainer = container ?? getContainer();
|
|
59
54
|
return /* @__PURE__ */ jsxs(DrawerPortal, {
|
|
60
|
-
|
|
61
|
-
children: [/* @__PURE__ */ jsx(DrawerOverlay, { className: cn(classNames?.mask
|
|
55
|
+
container: resolvedContainer,
|
|
56
|
+
children: [mask && /* @__PURE__ */ jsx(DrawerOverlay, { className: cn(classNames?.mask) }), /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
62
57
|
"data-slot": "drawer-content",
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
data-[
|
|
66
|
-
data-[
|
|
67
|
-
data-[
|
|
68
|
-
data-[
|
|
69
|
-
data-[
|
|
70
|
-
data-[
|
|
71
|
-
data-[
|
|
72
|
-
data-[
|
|
73
|
-
data-[
|
|
74
|
-
data-[
|
|
75
|
-
data-[
|
|
76
|
-
data-[
|
|
77
|
-
data-[
|
|
78
|
-
data-[
|
|
79
|
-
data-[
|
|
80
|
-
data-[
|
|
81
|
-
data-[
|
|
58
|
+
"data-direction": direction,
|
|
59
|
+
className: cn(`group/drawer-content bg-background fixed flex h-auto flex-col
|
|
60
|
+
transition-transform duration-300 ease-in-out`, OVERLAY_LAYER, `data-[direction=top]:inset-x-0 data-[direction=top]:top-0
|
|
61
|
+
data-[direction=top]:mb-24 data-[direction=top]:max-h-[80vh]
|
|
62
|
+
data-[direction=top]:w-full data-[direction=top]:rounded-b-lg
|
|
63
|
+
data-[direction=top]:border-b
|
|
64
|
+
data-[direction=top]:data-ending-style:-translate-y-full
|
|
65
|
+
data-[direction=top]:data-starting-style:-translate-y-full`, `data-[direction=bottom]:inset-x-0 data-[direction=bottom]:bottom-0
|
|
66
|
+
data-[direction=bottom]:mt-24 data-[direction=bottom]:max-h-[80vh]
|
|
67
|
+
data-[direction=bottom]:w-full data-[direction=bottom]:rounded-t-lg
|
|
68
|
+
data-[direction=bottom]:border-t
|
|
69
|
+
data-[direction=bottom]:data-ending-style:translate-y-full
|
|
70
|
+
data-[direction=bottom]:data-starting-style:translate-y-full`, `data-[direction=right]:inset-y-0 data-[direction=right]:right-0
|
|
71
|
+
data-[direction=right]:h-full data-[direction=right]:w-3/4
|
|
72
|
+
data-[direction=right]:border-l
|
|
73
|
+
data-[direction=right]:data-ending-style:translate-x-full
|
|
74
|
+
data-[direction=right]:data-starting-style:translate-x-full
|
|
75
|
+
data-[direction=right]:sm:max-w-sm`, `data-[direction=left]:inset-y-0 data-[direction=left]:left-0
|
|
76
|
+
data-[direction=left]:h-full data-[direction=left]:w-3/4
|
|
77
|
+
data-[direction=left]:border-r
|
|
78
|
+
data-[direction=left]:data-ending-style:-translate-x-full
|
|
79
|
+
data-[direction=left]:data-starting-style:-translate-x-full
|
|
80
|
+
data-[direction=left]:sm:max-w-sm`, className),
|
|
82
81
|
...props,
|
|
83
82
|
children: [handlebar && /* @__PURE__ */ jsx("div", { className: cn(`bg-muted mx-auto mt-4 hidden h-2 w-25 shrink-0 rounded-full
|
|
84
|
-
group-data-[
|
|
83
|
+
group-data-[direction=bottom]/drawer-content:block`, classNames?.handlebar) }), children]
|
|
85
84
|
})]
|
|
86
85
|
});
|
|
87
86
|
}
|
|
@@ -89,9 +88,9 @@ function DrawerHeader({ className, ...props }) {
|
|
|
89
88
|
return /* @__PURE__ */ jsx("div", {
|
|
90
89
|
"data-slot": "drawer-header",
|
|
91
90
|
className: cn(`flex flex-col gap-0.5 p-4
|
|
92
|
-
group-data-[
|
|
93
|
-
group-data-[
|
|
94
|
-
md:
|
|
91
|
+
group-data-[direction=bottom]/drawer-content:text-center
|
|
92
|
+
group-data-[direction=top]/drawer-content:text-center md:gap-1.5
|
|
93
|
+
md:text-left`, className),
|
|
95
94
|
...props
|
|
96
95
|
});
|
|
97
96
|
}
|
|
@@ -103,20 +102,20 @@ function DrawerFooter({ className, ...props }) {
|
|
|
103
102
|
});
|
|
104
103
|
}
|
|
105
104
|
function DrawerTitle({ className, ...props }) {
|
|
106
|
-
return /* @__PURE__ */ jsx(
|
|
105
|
+
return /* @__PURE__ */ jsx(Dialog.Title, {
|
|
107
106
|
"data-slot": "drawer-title",
|
|
108
107
|
className: cn("text-foreground font-semibold", className),
|
|
109
108
|
...props
|
|
110
109
|
});
|
|
111
110
|
}
|
|
112
111
|
function DrawerDescription({ className, ...props }) {
|
|
113
|
-
return /* @__PURE__ */ jsx(
|
|
112
|
+
return /* @__PURE__ */ jsx(Dialog.Description, {
|
|
114
113
|
"data-slot": "drawer-description",
|
|
115
114
|
className: cn("text-muted-foreground text-sm", className),
|
|
116
115
|
...props
|
|
117
116
|
});
|
|
118
117
|
}
|
|
119
118
|
//#endregion
|
|
120
|
-
export { Drawer
|
|
119
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, drawer_exports };
|
|
121
120
|
|
|
122
121
|
//# sourceMappingURL=drawer.mjs.map
|
package/dist/core/drawer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.mjs","names":["
|
|
1
|
+
{"version":3,"file":"drawer.mjs","names":["DialogPrimitive"],"sources":["../../src/core/drawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport { OVERLAY_LAYER } from '../lib/z-layers';\n\n/*\n * Drawer rebuilt on Base UI's Dialog primitives (ui-kit#375, Decision #2) —\n * no longer `vaul`. Base UI has no dedicated Drawer, so the side-sheet is a\n * Dialog whose popup is anchored to an edge and slides in/out.\n *\n * Consequences of dropping vaul:\n * - No drag-to-dismiss / snap points. The `handlebar` stays as a visual\n * affordance on bottom drawers but is no longer draggable.\n * - `direction` is a local `DrawerContent` prop (top/bottom/left/right) exposed\n * as `data-direction`, which drives both the popup's own placement/slide and\n * the `group-data-[direction=…]` hooks the header/handlebar rely on. It\n * replaces vaul's `data-vaul-drawer-direction`.\n * - Pointer-outside dismissal (`maskClosable`) is a root concern\n * (`disablePointerDismissal`), and mask/modal behaviour is driven by the\n * consumer — see `organisms/drawer`.\n *\n * Retained local patches: `OVERLAY_LAYER` (#359) over upstream's z-index, the\n * themed portal `container` (default `useConfig().getContainer()`), and the\n * `classNames`/`handlebar`/`mask` custom props.\n */\ntype Direction = 'top' | 'bottom' | 'left' | 'right';\n\nfunction Drawer({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"drawer-overlay\"\n className={cn(\n `fixed inset-0 bg-black/50 transition-opacity duration-300\n data-ending-style:opacity-0 data-starting-style:opacity-0`,\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 direction?: Direction;\n container?: HTMLElement;\n}\n\nfunction DrawerContent({\n className,\n children,\n classNames = {},\n handlebar,\n mask = true,\n direction = 'bottom',\n container,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & CustomContentProps) {\n const { getContainer } = useConfig();\n const resolvedContainer = container ?? getContainer();\n\n return (\n <DrawerPortal container={resolvedContainer}>\n {mask && <DrawerOverlay className={cn(classNames?.mask)} />}\n <DialogPrimitive.Popup\n data-slot=\"drawer-content\"\n data-direction={direction}\n className={cn(\n `group/drawer-content bg-background fixed flex h-auto flex-col\n transition-transform duration-300 ease-in-out`,\n OVERLAY_LAYER,\n `data-[direction=top]:inset-x-0 data-[direction=top]:top-0\n data-[direction=top]:mb-24 data-[direction=top]:max-h-[80vh]\n data-[direction=top]:w-full data-[direction=top]:rounded-b-lg\n data-[direction=top]:border-b\n data-[direction=top]:data-ending-style:-translate-y-full\n data-[direction=top]:data-starting-style:-translate-y-full`,\n `data-[direction=bottom]:inset-x-0 data-[direction=bottom]:bottom-0\n data-[direction=bottom]:mt-24 data-[direction=bottom]:max-h-[80vh]\n data-[direction=bottom]:w-full data-[direction=bottom]:rounded-t-lg\n data-[direction=bottom]:border-t\n data-[direction=bottom]:data-ending-style:translate-y-full\n data-[direction=bottom]:data-starting-style:translate-y-full`,\n `data-[direction=right]:inset-y-0 data-[direction=right]:right-0\n data-[direction=right]:h-full data-[direction=right]:w-3/4\n data-[direction=right]:border-l\n data-[direction=right]:data-ending-style:translate-x-full\n data-[direction=right]:data-starting-style:translate-x-full\n data-[direction=right]:sm:max-w-sm`,\n `data-[direction=left]:inset-y-0 data-[direction=left]:left-0\n data-[direction=left]:h-full data-[direction=left]:w-3/4\n data-[direction=left]:border-r\n data-[direction=left]:data-ending-style:-translate-x-full\n data-[direction=left]:data-starting-style:-translate-x-full\n data-[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-[direction=bottom]/drawer-content:block`,\n classNames?.handlebar,\n )}\n />\n )}\n {children}\n </DialogPrimitive.Popup>\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-[direction=bottom]/drawer-content:text-center\n group-data-[direction=top]/drawer-content:text-center md:gap-1.5\n 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 DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.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 DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.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":";;;;;;;;;;;;;;;;;;;;;AAiCA,SAAS,OAAO,EACd,GAAG,SACiD;CACpD,OAAO,oBAACA,OAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;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,GAAI,MAAQ,CAAA;AAC7C;AAEA,SAAS,YAAY,EACnB,GAAG,SACkD;CACrD,OAAO,oBAACA,OAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACqD;CACxD,OACE,oBAACA,OAAgB,UAAjB;EACE,aAAU;EACV,WAAW,GACT;oEAEA,eACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAUA,SAAS,cAAc,EACrB,WACA,UACA,aAAa,CAAC,GACd,WACA,OAAO,MACP,YAAY,UACZ,WACA,GAAG,SACuE;CAC1E,MAAM,EAAE,iBAAiB,UAAU;CACnC,MAAM,oBAAoB,aAAa,aAAa;CAEpD,OACE,qBAAC,cAAD;EAAc,WAAW;EAAzB,UAAA,CACG,QAAQ,oBAAC,eAAD,EAAe,WAAW,GAAG,YAAY,IAAI,EAAI,CAAA,GAC1D,qBAACA,OAAgB,OAAjB;GACE,aAAU;GACV,kBAAgB;GAChB,WAAW,GACT;0DAEA,eACA;;;;;uEAMA;;;;;yEAMA;;;;;+CAMA;;;;;8CAMA,SACF;GACA,GAAI;GAjCN,UAAA,CAmCG,aACC,oBAAC,OAAD,EACE,WAAW,GACT;mEAEA,YAAY,SACd,EACD,CAAA,GAEF,QACoB;EACX,CAAA,CAAA;;AAElB;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT;;;uBAIA,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/label.d.mts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import "@radix-ui/react-label";
|
|
1
|
+
import "react";
|
package/dist/core/label.mjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
2
|
import { cn } from "../utils.mjs";
|
|
4
3
|
import "react";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7
5
|
//#region src/core/label.tsx
|
|
8
6
|
var label_exports = /* @__PURE__ */ __exportAll({ Label: () => Label });
|
|
9
7
|
function Label({ className, ...props }) {
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
+
return /* @__PURE__ */ jsx("label", {
|
|
11
9
|
"data-slot": "label",
|
|
12
10
|
className: cn(`flex items-center gap-2 text-sm leading-none font-medium select-none
|
|
13
11
|
group-data-[disabled=true]:pointer-events-none
|
package/dist/core/label.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.mjs","names":[],"sources":["../../src/core/label.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"label.mjs","names":[],"sources":["../../src/core/label.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@repo/ui/utils';\n\nfunction Label({ className, ...props }: React.ComponentProps<'label'>) {\n return (\n <label\n data-slot=\"label\"\n className={cn(\n `flex items-center gap-2 text-sm leading-none font-medium select-none\n group-data-[disabled=true]:pointer-events-none\n group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed\n peer-disabled:opacity-50`,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":";;;;;;AAIA,SAAS,MAAM,EAAE,WAAW,GAAG,SAAwC;CACrE,OACE,oBAAC,SAAD;EACE,aAAU;EACV,WAAW,GACT;;;mCAIA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
package/dist/core/popover.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import "@
|
|
2
|
+
import { Popover } from "@base-ui/react/popover";
|
package/dist/core/popover.mjs
CHANGED
|
@@ -4,55 +4,60 @@ import { cn } from "../utils.mjs";
|
|
|
4
4
|
import { useConfig } from "../providers/config/context.mjs";
|
|
5
5
|
import { OVERLAY_LAYER } from "../lib/z-layers.mjs";
|
|
6
6
|
import "react";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
import
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Popover } from "@base-ui/react/popover";
|
|
9
9
|
//#region src/core/popover.tsx
|
|
10
10
|
var popover_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
-
Popover: () => Popover,
|
|
12
|
-
|
|
11
|
+
Popover: () => Popover$1,
|
|
12
|
+
PopoverArrow: () => PopoverArrow,
|
|
13
13
|
PopoverContent: () => PopoverContent,
|
|
14
14
|
PopoverDescription: () => PopoverDescription,
|
|
15
15
|
PopoverHeader: () => PopoverHeader,
|
|
16
16
|
PopoverTitle: () => PopoverTitle,
|
|
17
17
|
PopoverTrigger: () => PopoverTrigger
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...props
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
function PopoverTrigger({ ...props }) {
|
|
26
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
|
|
27
|
-
"data-slot": "popover-trigger",
|
|
28
|
-
...props
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function PopoverContent({ className, align = "center", sideOffset = 4, container, ...props }) {
|
|
19
|
+
const Popover$1 = Popover.Root;
|
|
20
|
+
const PopoverTrigger = Popover.Trigger;
|
|
21
|
+
function PopoverContent({ className, align = "center", side = "bottom", sideOffset = 4, container, ...props }) {
|
|
32
22
|
const { getContainer } = useConfig();
|
|
33
|
-
return /* @__PURE__ */ jsx(
|
|
23
|
+
return /* @__PURE__ */ jsx(Popover.Portal, {
|
|
34
24
|
container: container ?? getContainer(),
|
|
35
|
-
children: /* @__PURE__ */ jsx(
|
|
36
|
-
|
|
25
|
+
children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
26
|
+
side,
|
|
37
27
|
align,
|
|
38
28
|
sideOffset,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
arrowPadding: 16,
|
|
30
|
+
className: OVERLAY_LAYER,
|
|
31
|
+
children: /* @__PURE__ */ jsx(Popover.Popup, {
|
|
32
|
+
"data-slot": "popover-content",
|
|
33
|
+
className: cn(`bg-popover text-popover-foreground w-72 origin-(--transform-origin)
|
|
34
|
+
rounded-md border p-4 shadow-md outline-hidden
|
|
35
|
+
transition-[opacity,transform] duration-150
|
|
36
|
+
data-ending-style:scale-95 data-ending-style:opacity-0
|
|
37
|
+
data-starting-style:scale-95 data-starting-style:opacity-0`, className),
|
|
38
|
+
...props
|
|
39
|
+
})
|
|
49
40
|
})
|
|
50
41
|
});
|
|
51
42
|
}
|
|
52
|
-
function
|
|
53
|
-
return /* @__PURE__ */ jsx(
|
|
54
|
-
"data-slot": "popover-
|
|
55
|
-
|
|
43
|
+
function PopoverArrow() {
|
|
44
|
+
return /* @__PURE__ */ jsx(Popover.Arrow, {
|
|
45
|
+
"data-slot": "popover-arrow",
|
|
46
|
+
className: "data-[side=bottom]:-top-2 data-[side=left]:-right-[13px]\n data-[side=left]:rotate-90 data-[side=right]:-left-[13px]\n data-[side=right]:-rotate-90 data-[side=top]:-bottom-2\n data-[side=top]:rotate-180",
|
|
47
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
48
|
+
className: "block",
|
|
49
|
+
width: "18",
|
|
50
|
+
height: "9",
|
|
51
|
+
viewBox: "0 0 18 9",
|
|
52
|
+
fill: "none",
|
|
53
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
54
|
+
d: "M0 9 9 0 18 9",
|
|
55
|
+
className: "fill-border"
|
|
56
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
57
|
+
d: "M1 9 9 1 17 9",
|
|
58
|
+
className: "fill-popover"
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
56
61
|
});
|
|
57
62
|
}
|
|
58
63
|
function PopoverHeader({ className, ...props }) {
|
|
@@ -63,20 +68,20 @@ function PopoverHeader({ className, ...props }) {
|
|
|
63
68
|
});
|
|
64
69
|
}
|
|
65
70
|
function PopoverTitle({ className, ...props }) {
|
|
66
|
-
return /* @__PURE__ */ jsx(
|
|
71
|
+
return /* @__PURE__ */ jsx(Popover.Title, {
|
|
67
72
|
"data-slot": "popover-title",
|
|
68
73
|
className: cn("font-medium", className),
|
|
69
74
|
...props
|
|
70
75
|
});
|
|
71
76
|
}
|
|
72
77
|
function PopoverDescription({ className, ...props }) {
|
|
73
|
-
return /* @__PURE__ */ jsx(
|
|
78
|
+
return /* @__PURE__ */ jsx(Popover.Description, {
|
|
74
79
|
"data-slot": "popover-description",
|
|
75
80
|
className: cn("text-muted-foreground", className),
|
|
76
81
|
...props
|
|
77
82
|
});
|
|
78
83
|
}
|
|
79
84
|
//#endregion
|
|
80
|
-
export { Popover,
|
|
85
|
+
export { Popover$1 as Popover, PopoverArrow, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, popover_exports };
|
|
81
86
|
|
|
82
87
|
//# sourceMappingURL=popover.mjs.map
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"popover.mjs","names":["Popover","PopoverPrimitive"],"sources":["../../src/core/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Popover as PopoverPrimitive } from '@base-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\n// Base UI primitives with repo-owned styling; no longer vendored from shadcn.\nconst Popover = PopoverPrimitive.Root;\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nfunction PopoverContent({\n className,\n align = 'center',\n side = 'bottom',\n sideOffset = 4,\n container,\n ...props\n}: Omit<React.ComponentProps<typeof PopoverPrimitive.Popup>, 'className'> & {\n className?: string;\n align?: PopoverPrimitive.Positioner.Props['align'];\n side?: PopoverPrimitive.Positioner.Props['side'];\n sideOffset?: number;\n container?: HTMLElement;\n}) {\n const { getContainer } = useConfig();\n\n return (\n <PopoverPrimitive.Portal container={container ?? getContainer()}>\n <PopoverPrimitive.Positioner\n side={side}\n align={align}\n sideOffset={sideOffset}\n arrowPadding={16}\n className={OVERLAY_LAYER}\n >\n <PopoverPrimitive.Popup\n data-slot=\"popover-content\"\n className={cn(\n `bg-popover text-popover-foreground w-72 origin-(--transform-origin)\n rounded-md border p-4 shadow-md outline-hidden\n transition-[opacity,transform] duration-150\n data-ending-style:scale-95 data-ending-style:opacity-0\n data-starting-style:scale-95 data-starting-style:opacity-0`,\n className,\n //\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverArrow() {\n return (\n <PopoverPrimitive.Arrow\n data-slot=\"popover-arrow\"\n className=\"data-[side=bottom]:-top-2 data-[side=left]:-right-[13px]\n data-[side=left]:rotate-90 data-[side=right]:-left-[13px]\n data-[side=right]:-rotate-90 data-[side=top]:-bottom-2\n data-[side=top]:rotate-180\"\n >\n {/* `block` keeps the arrow box exactly as tall as the SVG. Left inline,\n the SVG sits on a text baseline and the wrapper inherits the popup's\n line-height instead (26px, not 9px), which pushes the triangle down\n inside the popup and rotates it about the wrong centre. */}\n <svg\n className=\"block\"\n width=\"18\"\n height=\"9\"\n viewBox=\"0 0 18 9\"\n fill=\"none\"\n >\n <path d=\"M0 9 9 0 18 9\" className=\"fill-border\" />\n <path d=\"M1 9 9 1 17 9\" className=\"fill-popover\" />\n </svg>\n </PopoverPrimitive.Arrow>\n );\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({\n className,\n ...props\n}: Omit<React.ComponentProps<typeof PopoverPrimitive.Title>, 'className'> & {\n className?: string;\n}) {\n return (\n <PopoverPrimitive.Title\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 <PopoverPrimitive.Description\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 PopoverArrow,\n PopoverHeader,\n PopoverTitle,\n PopoverDescription,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAYA,MAAMA,YAAUC,QAAiB;AACjC,MAAM,iBAAiBA,QAAiB;AAExC,SAAS,eAAe,EACtB,WACA,QAAQ,UACR,OAAO,UACP,aAAa,GACb,WACA,GAAG,SAOF;CACD,MAAM,EAAE,iBAAiB,UAAU;CAEnC,OACE,oBAACA,QAAiB,QAAlB;EAAyB,WAAW,aAAa,aAAa;EAC5D,UAAA,oBAACA,QAAiB,YAAlB;GACQ;GACC;GACK;GACZ,cAAc;GACd,WAAW;GAEX,UAAA,oBAACA,QAAiB,OAAlB;IACE,aAAU;IACV,WAAW,GACT;;;;yEAKA,SAEF;IACA,GAAI;GACL,CAAA;EAC0B,CAAA;CACN,CAAA;AAE7B;AAEA,SAAS,eAAe;CACtB,OACE,oBAACA,QAAiB,OAAlB;EACE,aAAU;EACV,WAAU;EASV,UAAA,qBAAC,OAAD;GACE,WAAU;GACV,OAAM;GACN,QAAO;GACP,SAAQ;GACR,MAAK;GALP,UAAA,CAOE,oBAAC,QAAD;IAAM,GAAE;IAAgB,WAAU;GAAe,CAAA,GACjD,oBAAC,QAAD;IAAM,GAAE;IAAgB,WAAU;GAAgB,CAAA,CAC/C;;CACiB,CAAA;AAE5B;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,EACpB,WACA,GAAG,SAGF;CACD,OACE,oBAACA,QAAiB,OAAlB;EACE,aAAU;EACV,WAAW,GAAG,eAAe,SAAS;EACtC,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyB;CAC5B,OACE,oBAACA,QAAiB,aAAlB;EACE,aAAU;EACV,WAAW,GAAG,yBAAyB,SAAS;EAChD,GAAI;CACL,CAAA;AAEL"}
|
package/dist/core/progress.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import "@
|
|
2
|
+
import { Progress } from "@base-ui/react/progress";
|
package/dist/core/progress.mjs
CHANGED
|
@@ -3,25 +3,22 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import
|
|
6
|
+
import { Progress } from "@base-ui/react/progress";
|
|
7
7
|
//#region src/core/progress.tsx
|
|
8
|
-
var progress_exports = /* @__PURE__ */ __exportAll({ Progress: () => Progress });
|
|
9
|
-
function Progress({ className,
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
+
var progress_exports = /* @__PURE__ */ __exportAll({ Progress: () => Progress$1 });
|
|
9
|
+
function Progress$1({ className, barClassName, barStyle, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Progress.Root, {
|
|
11
11
|
"data-slot": "progress",
|
|
12
12
|
className: cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className),
|
|
13
13
|
...props,
|
|
14
|
-
children: /* @__PURE__ */ jsx(
|
|
14
|
+
children: /* @__PURE__ */ jsx(Progress.Indicator, {
|
|
15
15
|
"data-slot": "progress-indicator",
|
|
16
16
|
className: cn("bg-primary h-full w-full flex-1 transition-all", barClassName),
|
|
17
|
-
style:
|
|
18
|
-
transform: `translateX(-${100 - (value || 0)}%)`,
|
|
19
|
-
...barStyle
|
|
20
|
-
}
|
|
17
|
+
style: barStyle
|
|
21
18
|
})
|
|
22
19
|
});
|
|
23
20
|
}
|
|
24
21
|
//#endregion
|
|
25
|
-
export { Progress, progress_exports };
|
|
22
|
+
export { Progress$1 as Progress, progress_exports };
|
|
26
23
|
|
|
27
24
|
//# sourceMappingURL=progress.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.mjs","names":[],"sources":["../../src/core/progress.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"progress.mjs","names":["Progress","ProgressPrimitive"],"sources":["../../src/core/progress.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\n\nimport { cn } from '@repo/ui/utils';\n\ninterface CustomProps {\n barClassName?: string;\n barStyle?: React.CSSProperties;\n}\n\n// Base UI primitive with repo-owned styling; no longer vendored from shadcn.\nfunction Progress({\n className,\n barClassName,\n barStyle,\n ...props\n}: React.ComponentProps<typeof ProgressPrimitive.Root> & CustomProps) {\n return (\n <ProgressPrimitive.Root\n data-slot=\"progress\"\n className={cn(\n 'bg-primary/20 relative h-2 w-full overflow-hidden rounded-full',\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn(\n 'bg-primary h-full w-full flex-1 transition-all',\n barClassName,\n //\n )}\n style={barStyle}\n />\n </ProgressPrimitive.Root>\n );\n}\n\nexport { Progress };\n"],"mappings":";;;;;;;;AAcA,SAASA,WAAS,EAChB,WACA,cACA,UACA,GAAG,SACiE;CACpE,OACE,oBAACC,SAAkB,MAAnB;EACE,aAAU;EACV,WAAW,GACT,kEACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAACA,SAAkB,WAAnB;GACE,aAAU;GACV,WAAW,GACT,kDACA,YAEF;GACA,OAAO;EACR,CAAA;CACqB,CAAA;AAE5B"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
declare function RadioGroup({ className, ...props }: React$1.ComponentProps<typeof RadioGroupPrimitive.Root>): React$1.JSX.Element;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { RadioGroup };
|
|
7
|
-
//# sourceMappingURL=radio-group.d.mts.map
|
|
1
|
+
import "react";
|
|
2
|
+
import { Radio } from "@base-ui/react/radio";
|
|
3
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
@@ -4,38 +4,39 @@ import { cn } from "../utils.mjs";
|
|
|
4
4
|
import "react";
|
|
5
5
|
import { CircleIcon } from "lucide-react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import
|
|
7
|
+
import { Radio } from "@base-ui/react/radio";
|
|
8
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
8
9
|
//#region src/core/radio-group.tsx
|
|
9
10
|
var radio_group_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
-
RadioGroup: () => RadioGroup,
|
|
11
|
+
RadioGroup: () => RadioGroup$1,
|
|
11
12
|
RadioGroupItem: () => RadioGroupItem
|
|
12
13
|
});
|
|
13
|
-
function RadioGroup({ className, ...props }) {
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
+
function RadioGroup$1({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
15
16
|
"data-slot": "radio-group",
|
|
16
17
|
className: cn("grid gap-3", className),
|
|
17
18
|
...props
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
function RadioGroupItem({ className, ...props }) {
|
|
21
|
-
return /* @__PURE__ */ jsx(
|
|
22
|
+
return /* @__PURE__ */ jsx(Radio.Root, {
|
|
22
23
|
"data-slot": "radio-group-item",
|
|
23
24
|
className: cn(`border-input text-primary focus-visible:border-ring
|
|
24
25
|
focus-visible:ring-ring/50 aria-invalid:ring-destructive/20
|
|
25
26
|
dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive
|
|
26
|
-
dark:bg-input/30 aspect-square size-4 shrink-0
|
|
27
|
-
|
|
28
|
-
focus-visible:ring-[3px]
|
|
29
|
-
disabled:opacity-50`, className),
|
|
27
|
+
dark:bg-input/30 inline-flex aspect-square size-4 shrink-0 items-center
|
|
28
|
+
justify-center rounded-full border shadow-xs
|
|
29
|
+
transition-[color,box-shadow] outline-none focus-visible:ring-[3px]
|
|
30
|
+
data-disabled:cursor-not-allowed data-disabled:opacity-50`, className),
|
|
30
31
|
...props,
|
|
31
|
-
children: /* @__PURE__ */ jsx(
|
|
32
|
+
children: /* @__PURE__ */ jsx(Radio.Indicator, {
|
|
32
33
|
"data-slot": "radio-group-indicator",
|
|
33
|
-
className: "
|
|
34
|
-
children: /* @__PURE__ */ jsx(CircleIcon, { className: "fill-primary
|
|
34
|
+
className: "flex items-center justify-center",
|
|
35
|
+
children: /* @__PURE__ */ jsx(CircleIcon, { className: "fill-primary size-2" })
|
|
35
36
|
})
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
//#endregion
|
|
39
|
-
export { RadioGroup, RadioGroupItem, radio_group_exports };
|
|
40
|
+
export { RadioGroup$1 as RadioGroup, RadioGroupItem, radio_group_exports };
|
|
40
41
|
|
|
41
42
|
//# sourceMappingURL=radio-group.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.mjs","names":[],"sources":["../../src/core/radio-group.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"radio-group.mjs","names":["RadioGroup","RadioGroupPrimitive","RadioPrimitive"],"sources":["../../src/core/radio-group.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio';\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';\nimport { CircleIcon } from 'lucide-react';\n\nimport { cn } from '@repo/ui/utils';\n\n// Base UI primitives with repo-owned styling; no longer vendored from shadcn.\n// Base UI splits Radix's `RadioGroup.Item` into a standalone `Radio.Root`\n// (from `@base-ui/react/radio`) plus a `Radio.Indicator`.\n//\n// `Radio.Root` renders a `<span role=\"radio\">`, where Radix rendered a\n// `<button>`. That matters for centering: a button centers its content through\n// the UA's own anonymous box, so the indicator — which collapses to zero height\n// once its only child is taken out of flow — still landed on the centre line. A\n// span gets no such treatment, so the same markup anchored the dot to the top\n// of the control and it sat 7px high. The root therefore centers explicitly,\n// matching `core/checkbox`, and the dot stays in flow rather than being\n// absolutely positioned against a zero-height parent.\n//\n// Base UI's `RadioGroup` is generic over the item value; this library always\n// addresses items by their stringified value (see atoms/radio), so pin it to\n// `string` — otherwise `React.ComponentProps` erases the generic to `unknown`\n// and `value`/`onValueChange` stop lining up with the string callers.\nfunction RadioGroup({\n className,\n ...props\n}: RadioGroupPrimitive.Props<string>) {\n return (\n <RadioGroupPrimitive\n data-slot=\"radio-group\"\n className={cn('grid gap-3', className)}\n {...props}\n />\n );\n}\n\nfunction RadioGroupItem({\n className,\n ...props\n}: React.ComponentProps<typeof RadioPrimitive.Root>) {\n return (\n <RadioPrimitive.Root\n data-slot=\"radio-group-item\"\n className={cn(\n `border-input text-primary focus-visible:border-ring\n focus-visible:ring-ring/50 aria-invalid:ring-destructive/20\n dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\n dark:bg-input/30 inline-flex aspect-square size-4 shrink-0 items-center\n justify-center rounded-full border shadow-xs\n transition-[color,box-shadow] outline-none focus-visible:ring-[3px]\n data-disabled:cursor-not-allowed data-disabled:opacity-50`,\n className,\n )}\n {...props}\n >\n <RadioPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n className=\"flex items-center justify-center\"\n >\n <CircleIcon className=\"fill-primary size-2\" />\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n"],"mappings":";;;;;;;;;;;;;AA2BA,SAASA,aAAW,EAClB,WACA,GAAG,SACiC;CACpC,OACE,oBAACC,YAAD;EACE,aAAU;EACV,WAAW,GAAG,cAAc,SAAS;EACrC,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,eAAe,EACtB,WACA,GAAG,SACgD;CACnD,OACE,oBAACC,MAAe,MAAhB;EACE,aAAU;EACV,WAAW,GACT;;;;;;oEAOA,SACF;EACA,GAAI;EAEJ,UAAA,oBAACA,MAAe,WAAhB;GACE,aAAU;GACV,WAAU;GAEV,UAAA,oBAAC,YAAD,EAAY,WAAU,sBAAuB,CAAA;EACrB,CAAA;CACP,CAAA;AAEzB"}
|
package/dist/core/select.d.mts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import
|
|
2
|
+
import { Select } from "@base-ui/react/select";
|
|
3
3
|
//#region src/core/select.d.ts
|
|
4
|
-
|
|
4
|
+
type SelectRootProps = Select.Root.Props<string> & {
|
|
5
|
+
/** Explicit reading direction, retained from the previous Radix API. */
|
|
6
|
+
dir?: 'ltr' | 'rtl';
|
|
7
|
+
};
|
|
8
|
+
declare function Select$1({ dir, ...props }: SelectRootProps): React$1.JSX.Element;
|
|
5
9
|
//#endregion
|
|
6
|
-
export { Select };
|
|
10
|
+
export { Select$1 as Select };
|
|
7
11
|
//# sourceMappingURL=select.d.mts.map
|
|
@@ -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":";;;KAcK,kBAAkB,OAAgB,KAAK;;EAE1C;;iBAGO,WAAS,QAAQ,SAAS,kBAAe,QAAA,IAAA"}
|