@brijbyte/agentic-ui 0.0.4 → 0.0.5
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.md +151 -21
- package/dist/accordion/index.d.ts +2 -2
- package/dist/accordion/index.js +2 -2
- package/dist/accordion/parts.d.ts +6 -14
- package/dist/accordion/parts.d.ts.map +1 -1
- package/dist/accordion/parts.js +7 -6
- package/dist/accordion/parts.js.map +1 -1
- package/dist/alert-dialog/parts.d.ts +4 -12
- package/dist/alert-dialog/parts.d.ts.map +1 -1
- package/dist/alert-dialog/parts.js +17 -19
- package/dist/alert-dialog/parts.js.map +1 -1
- package/dist/checkbox/parts.d.ts +2 -5
- package/dist/checkbox/parts.d.ts.map +1 -1
- package/dist/checkbox/parts.js +3 -2
- package/dist/checkbox/parts.js.map +1 -1
- package/dist/collapsible/parts.d.ts +3 -9
- package/dist/collapsible/parts.d.ts.map +1 -1
- package/dist/collapsible/parts.js +7 -6
- package/dist/collapsible/parts.js.map +1 -1
- package/dist/context-menu/parts.d.ts +6 -18
- package/dist/context-menu/parts.d.ts.map +1 -1
- package/dist/context-menu/parts.js +16 -16
- package/dist/context-menu/parts.js.map +1 -1
- package/dist/dialog/parts.d.ts +6 -18
- package/dist/dialog/parts.d.ts.map +1 -1
- package/dist/dialog/parts.js +8 -9
- package/dist/dialog/parts.js.map +1 -1
- package/dist/drawer/parts.d.ts +7 -19
- package/dist/drawer/parts.d.ts.map +1 -1
- package/dist/drawer/parts.js +14 -13
- package/dist/drawer/parts.js.map +1 -1
- package/dist/index.css +1375 -1375
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/menu/parts.d.ts +6 -18
- package/dist/menu/parts.d.ts.map +1 -1
- package/dist/menu/parts.js +7 -6
- package/dist/menu/parts.js.map +1 -1
- package/dist/meter/parts.d.ts +4 -10
- package/dist/meter/parts.d.ts.map +1 -1
- package/dist/meter/parts.js +5 -4
- package/dist/meter/parts.js.map +1 -1
- package/dist/number-field/parts.d.ts +6 -18
- package/dist/number-field/parts.d.ts.map +1 -1
- package/dist/number-field/parts.js +7 -6
- package/dist/number-field/parts.js.map +1 -1
- package/dist/popover/parts.d.ts +7 -21
- package/dist/popover/parts.d.ts.map +1 -1
- package/dist/popover/parts.js +8 -11
- package/dist/popover/parts.js.map +1 -1
- package/dist/progress/parts.d.ts +2 -4
- package/dist/progress/parts.d.ts.map +1 -1
- package/dist/progress/parts.js +3 -6
- package/dist/progress/parts.js.map +1 -1
- package/dist/radio/parts.d.ts +2 -6
- package/dist/radio/parts.d.ts.map +1 -1
- package/dist/radio/parts.js +3 -2
- package/dist/radio/parts.js.map +1 -1
- package/dist/radio-group/parts.d.ts +1 -3
- package/dist/radio-group/parts.d.ts.map +1 -1
- package/dist/radio-group/parts.js +2 -1
- package/dist/radio-group/parts.js.map +1 -1
- package/dist/reset-scoped.css +112 -0
- package/dist/select/parts.d.ts +11 -32
- package/dist/select/parts.d.ts.map +1 -1
- package/dist/select/parts.js +10 -9
- package/dist/select/parts.js.map +1 -1
- package/dist/slider/parts.d.ts +6 -18
- package/dist/slider/parts.d.ts.map +1 -1
- package/dist/slider/parts.js +7 -6
- package/dist/slider/parts.js.map +1 -1
- package/dist/switch/parts.d.ts +2 -6
- package/dist/switch/parts.d.ts.map +1 -1
- package/dist/switch/parts.js +3 -2
- package/dist/switch/parts.js.map +1 -1
- package/dist/tabs/parts.d.ts +3 -9
- package/dist/tabs/parts.d.ts.map +1 -1
- package/dist/tabs/parts.js +4 -3
- package/dist/tabs/parts.js.map +1 -1
- package/dist/toast/parts.d.ts +5 -15
- package/dist/toast/parts.d.ts.map +1 -1
- package/dist/toast/parts.js +6 -5
- package/dist/toast/parts.js.map +1 -1
- package/dist/tooltip/parts.d.ts +3 -9
- package/dist/tooltip/parts.d.ts.map +1 -1
- package/dist/tooltip/parts.js +4 -3
- package/dist/tooltip/parts.js.map +1 -1
- package/dist/utils/resolveClassName.js +25 -0
- package/dist/utils/resolveClassName.js.map +1 -0
- package/package.json +4 -3
- package/src/accordion/index.ts +1 -1
- package/src/accordion/parts.tsx +10 -17
- package/src/alert-dialog/parts.tsx +23 -31
- package/src/checkbox/parts.tsx +5 -7
- package/src/collapsible/parts.tsx +10 -15
- package/src/context-menu/parts.tsx +34 -34
- package/src/dialog/parts.tsx +14 -27
- package/src/drawer/parts.tsx +30 -38
- package/src/menu/parts.tsx +13 -24
- package/src/meter/parts.tsx +15 -14
- package/src/number-field/parts.tsx +33 -24
- package/src/popover/parts.tsx +17 -32
- package/src/progress/parts.tsx +13 -6
- package/src/radio/parts.tsx +7 -8
- package/src/radio-group/parts.tsx +3 -4
- package/src/select/parts.tsx +34 -41
- package/src/slider/parts.tsx +13 -24
- package/src/styles/reset-scoped.css +112 -0
- package/src/switch/parts.tsx +5 -8
- package/src/tabs/parts.tsx +7 -12
- package/src/toast/parts.tsx +11 -20
- package/src/tooltip/parts.tsx +7 -12
- package/src/utils/resolveClassName.ts +24 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","names":["BaseCollapsible","styles"],"sources":["../../src/collapsible/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Collapsible.\n *\n * @example\n * ```tsx\n * import { Collapsible } from '@base-ui/react/collapsible';\n * import { CollapsibleTrigger, CollapsiblePanel } from '@brijbyte/agentic-ui/collapsible';\n *\n * <
|
|
1
|
+
{"version":3,"file":"parts.js","names":["BaseCollapsible","styles"],"sources":["../../src/collapsible/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Collapsible.\n *\n * @example\n * ```tsx\n * import { Collapsible } from '@base-ui/react/collapsible';\n * import { CollapsibleRoot, CollapsibleTrigger, CollapsiblePanel } from '@brijbyte/agentic-ui/collapsible';\n *\n * <CollapsibleRoot>\n * <CollapsibleTrigger>Toggle</CollapsibleTrigger>\n * <CollapsiblePanel>Content</CollapsiblePanel>\n * </CollapsibleRoot>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\nimport styles from \"./collapsible.module.css\";\nimport { resolveClassName, cx } from \"../utils/resolveClassName\";\n\ntype BaseRootProps = ComponentPropsWithoutRef<typeof BaseCollapsible.Root>;\ntype BaseTriggerProps = ComponentPropsWithoutRef<typeof BaseCollapsible.Trigger>;\ntype BasePanelProps = ComponentPropsWithoutRef<typeof BaseCollapsible.Panel>;\n\nexport interface CollapsibleRootProps extends BaseRootProps {}\nexport interface CollapsibleTriggerProps extends BaseTriggerProps {}\nexport interface CollapsiblePanelProps extends BasePanelProps {}\n\nexport const CollapsibleRoot = forwardRef<ComponentRef<typeof BaseCollapsible.Root>, CollapsibleRootProps>(function CollapsibleRoot(\n { className, ...props },\n ref,\n) {\n return <BaseCollapsible.Root ref={ref} className={(state) => cx(styles.root, resolveClassName(className, state))} {...props} />;\n});\n\nexport const CollapsibleTrigger = forwardRef<ComponentRef<typeof BaseCollapsible.Trigger>, CollapsibleTriggerProps>(\n function CollapsibleTrigger({ className, ...props }, ref) {\n return <BaseCollapsible.Trigger ref={ref} className={(state) => cx(styles.trigger, resolveClassName(className, state))} {...props} />;\n },\n);\n\nexport const CollapsiblePanel = forwardRef<ComponentRef<typeof BaseCollapsible.Panel>, CollapsiblePanelProps>(function CollapsiblePanel(\n { className, ...props },\n ref,\n) {\n return <BaseCollapsible.Panel ref={ref} className={(state) => cx(styles.panel, resolveClassName(className, state))} {...props} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,kBAAkB,WAA4E,SAAS,gBAClH,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACA,YAAgB,MAAjB;EAA2B;EAAK,YAAY,UAAU,GAAGC,2BAAO,MAAM,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC/H;AAEF,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;AACxD,QAAO,oBAACD,YAAgB,SAAjB;EAA8B;EAAK,YAAY,UAAU,GAAGC,2BAAO,SAAS,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAExI;AAED,MAAa,mBAAmB,WAA8E,SAAS,iBACrH,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,YAAgB,OAAjB;EAA4B;EAAK,YAAY,UAAU,GAAGC,2BAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EACjI"}
|
|
@@ -9,24 +9,12 @@ type BaseSeparatorProps = ComponentPropsWithoutRef<typeof ContextMenu.Separator>
|
|
|
9
9
|
type BaseGroupProps = ComponentPropsWithoutRef<typeof ContextMenu.Group>;
|
|
10
10
|
type BaseGroupLabelProps = ComponentPropsWithoutRef<typeof ContextMenu.GroupLabel>;
|
|
11
11
|
type BaseSubmenuTriggerProps = ComponentPropsWithoutRef<typeof ContextMenu.SubmenuTrigger>;
|
|
12
|
-
interface ContextMenuPopupProps extends
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
interface
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
interface ContextMenuSeparatorProps extends Omit<BaseSeparatorProps, "className"> {
|
|
19
|
-
className?: string;
|
|
20
|
-
}
|
|
21
|
-
interface ContextMenuGroupProps extends Omit<BaseGroupProps, "className"> {
|
|
22
|
-
className?: string;
|
|
23
|
-
}
|
|
24
|
-
interface ContextMenuGroupLabelProps extends Omit<BaseGroupLabelProps, "className"> {
|
|
25
|
-
className?: string;
|
|
26
|
-
}
|
|
27
|
-
interface ContextMenuSubmenuTriggerProps extends Omit<BaseSubmenuTriggerProps, "className"> {
|
|
28
|
-
className?: string;
|
|
29
|
-
}
|
|
12
|
+
interface ContextMenuPopupProps extends BasePopupProps {}
|
|
13
|
+
interface ContextMenuItemProps extends BaseItemProps {}
|
|
14
|
+
interface ContextMenuSeparatorProps extends BaseSeparatorProps {}
|
|
15
|
+
interface ContextMenuGroupProps extends BaseGroupProps {}
|
|
16
|
+
interface ContextMenuGroupLabelProps extends BaseGroupLabelProps {}
|
|
17
|
+
interface ContextMenuSubmenuTriggerProps extends BaseSubmenuTriggerProps {}
|
|
30
18
|
declare const ContextMenuPopup: react.ForwardRefExoticComponent<ContextMenuPopupProps & react.RefAttributes<HTMLDivElement>>;
|
|
31
19
|
declare const ContextMenuItem: react.ForwardRefExoticComponent<ContextMenuItemProps & react.RefAttributes<HTMLElement>>;
|
|
32
20
|
declare const ContextMenuSeparator: react.ForwardRefExoticComponent<ContextMenuSeparatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/context-menu/parts.tsx"],"mappings":";;;;;KA4BK,cAAA,GAAiB,wBAAA,QAAgC,WAAA,CAAgB,KAAA;AAAA,KACjE,aAAA,GAAgB,wBAAA,QAAgC,WAAA,CAAgB,IAAA;AAAA,KAChE,kBAAA,GAAqB,wBAAA,QAAgC,WAAA,CAAgB,SAAA;AAAA,KACrE,cAAA,GAAiB,wBAAA,QAAgC,WAAA,CAAgB,KAAA;AAAA,KACjE,mBAAA,GAAsB,wBAAA,QAAgC,WAAA,CAAgB,UAAA;AAAA,KACtE,uBAAA,GAA0B,wBAAA,QAAgC,WAAA,CAAgB,cAAA;AAAA,UAE9D,qBAAA,SAA8B,
|
|
1
|
+
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/context-menu/parts.tsx"],"mappings":";;;;;KA4BK,cAAA,GAAiB,wBAAA,QAAgC,WAAA,CAAgB,KAAA;AAAA,KACjE,aAAA,GAAgB,wBAAA,QAAgC,WAAA,CAAgB,IAAA;AAAA,KAChE,kBAAA,GAAqB,wBAAA,QAAgC,WAAA,CAAgB,SAAA;AAAA,KACrE,cAAA,GAAiB,wBAAA,QAAgC,WAAA,CAAgB,KAAA;AAAA,KACjE,mBAAA,GAAsB,wBAAA,QAAgC,WAAA,CAAgB,UAAA;AAAA,KACtE,uBAAA,GAA0B,wBAAA,QAAgC,WAAA,CAAgB,cAAA;AAAA,UAE9D,qBAAA,SAA8B,cAAA;AAAA,UAC9B,oBAAA,SAA6B,aAAA;AAAA,UAC7B,yBAAA,SAAkC,kBAAA;AAAA,UAClC,qBAAA,SAA8B,cAAA;AAAA,UAC9B,0BAAA,SAAmC,mBAAA;AAAA,UACnC,8BAAA,SAAuC,uBAAA;AAAA,cAE3C,gBAAA,EAAgB,KAAA,CAAA,yBAAA,CAAA,qBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAOhB,eAAA,EAAe,KAAA,CAAA,yBAAA,CAAA,oBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,WAAA;AAAA,cAOf,oBAAA,EAAoB,KAAA,CAAA,yBAAA,CAAA,yBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAQpB,gBAAA,EAAgB,KAAA,CAAA,yBAAA,CAAA,qBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAOhB,qBAAA,EAAqB,KAAA,CAAA,yBAAA,CAAA,0BAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAYrB,yBAAA,EAAyB,KAAA,CAAA,yBAAA,CAAA,8BAAA,GAAA,KAAA,CAAA,aAAA,CAAA,WAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cx, resolveClassName } from "../utils/resolveClassName.js";
|
|
1
2
|
import context_menu_module_default from "./context-menu.module.js";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { forwardRef } from "react";
|
|
@@ -8,42 +9,41 @@ import { ContextMenu } from "@base-ui/react/context-menu";
|
|
|
8
9
|
*
|
|
9
10
|
* @example
|
|
10
11
|
* ```tsx
|
|
11
|
-
* import { ContextMenu
|
|
12
|
+
* import { ContextMenu } from '@base-ui/react/context-menu';
|
|
12
13
|
* import { ContextMenuPopup, ContextMenuItem, ContextMenuSeparator } from '@brijbyte/agentic-ui/context-menu';
|
|
13
14
|
*
|
|
14
|
-
* <
|
|
15
|
-
* <
|
|
16
|
-
* <
|
|
17
|
-
* <
|
|
15
|
+
* <ContextMenu.Root>
|
|
16
|
+
* <ContextMenu.Trigger render={<div>Right click me</div>} />
|
|
17
|
+
* <ContextMenu.Portal>
|
|
18
|
+
* <ContextMenu.Positioner>
|
|
18
19
|
* <ContextMenuPopup>
|
|
19
|
-
* <ContextMenuItem>
|
|
20
|
-
* <ContextMenuItem>Copy</ContextMenuItem>
|
|
20
|
+
* <ContextMenuItem>Action</ContextMenuItem>
|
|
21
21
|
* <ContextMenuSeparator />
|
|
22
|
-
* <ContextMenuItem>
|
|
22
|
+
* <ContextMenuItem>Another</ContextMenuItem>
|
|
23
23
|
* </ContextMenuPopup>
|
|
24
|
-
* </
|
|
25
|
-
* </
|
|
26
|
-
* </
|
|
24
|
+
* </ContextMenu.Positioner>
|
|
25
|
+
* </ContextMenu.Portal>
|
|
26
|
+
* </ContextMenu.Root>
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
const ContextMenuPopup = forwardRef(function ContextMenuPopup({ className, ...props }, ref) {
|
|
30
30
|
return /* @__PURE__ */ jsx(ContextMenu.Popup, {
|
|
31
31
|
ref,
|
|
32
|
-
className:
|
|
32
|
+
className: (state) => cx(context_menu_module_default.popup, resolveClassName(className, state)),
|
|
33
33
|
...props
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
const ContextMenuItem = forwardRef(function ContextMenuItem({ className, ...props }, ref) {
|
|
37
37
|
return /* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
38
38
|
ref,
|
|
39
|
-
className:
|
|
39
|
+
className: (state) => cx(context_menu_module_default.item, resolveClassName(className, state)),
|
|
40
40
|
...props
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
const ContextMenuSeparator = forwardRef(function ContextMenuSeparator({ className, ...props }, ref) {
|
|
44
44
|
return /* @__PURE__ */ jsx(ContextMenu.Separator, {
|
|
45
45
|
ref,
|
|
46
|
-
className:
|
|
46
|
+
className: (state) => cx(context_menu_module_default.separator, resolveClassName(className, state)),
|
|
47
47
|
...props
|
|
48
48
|
});
|
|
49
49
|
});
|
|
@@ -57,14 +57,14 @@ const ContextMenuGroup = forwardRef(function ContextMenuGroup({ className, ...pr
|
|
|
57
57
|
const ContextMenuGroupLabel = forwardRef(function ContextMenuGroupLabel({ className, ...props }, ref) {
|
|
58
58
|
return /* @__PURE__ */ jsx(ContextMenu.GroupLabel, {
|
|
59
59
|
ref,
|
|
60
|
-
className:
|
|
60
|
+
className: (state) => cx(context_menu_module_default["group-label"], resolveClassName(className, state)),
|
|
61
61
|
...props
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
64
|
const ContextMenuSubmenuTrigger = forwardRef(function ContextMenuSubmenuTrigger({ className, children, ...props }, ref) {
|
|
65
65
|
return /* @__PURE__ */ jsxs(ContextMenu.SubmenuTrigger, {
|
|
66
66
|
ref,
|
|
67
|
-
className:
|
|
67
|
+
className: (state) => cx(context_menu_module_default["submenu-trigger"], resolveClassName(className, state)),
|
|
68
68
|
...props,
|
|
69
69
|
children: [/* @__PURE__ */ jsx("span", {
|
|
70
70
|
style: { flex: 1 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","names":["BaseContextMenu","styles"],"sources":["../../src/context-menu/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for ContextMenu.\n *\n * @example\n * ```tsx\n * import { ContextMenu
|
|
1
|
+
{"version":3,"file":"parts.js","names":["BaseContextMenu","styles"],"sources":["../../src/context-menu/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for ContextMenu.\n *\n * @example\n * ```tsx\n * import { ContextMenu } from '@base-ui/react/context-menu';\n * import { ContextMenuPopup, ContextMenuItem, ContextMenuSeparator } from '@brijbyte/agentic-ui/context-menu';\n *\n * <ContextMenu.Root>\n * <ContextMenu.Trigger render={<div>Right click me</div>} />\n * <ContextMenu.Portal>\n * <ContextMenu.Positioner>\n * <ContextMenuPopup>\n * <ContextMenuItem>Action</ContextMenuItem>\n * <ContextMenuSeparator />\n * <ContextMenuItem>Another</ContextMenuItem>\n * </ContextMenuPopup>\n * </ContextMenu.Positioner>\n * </ContextMenu.Portal>\n * </ContextMenu.Root>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport styles from \"./context-menu.module.css\";\nimport { resolveClassName, cx } from \"../utils/resolveClassName\";\n\ntype BasePopupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Popup>;\ntype BaseItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Item>;\ntype BaseSeparatorProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Separator>;\ntype BaseGroupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Group>;\ntype BaseGroupLabelProps = ComponentPropsWithoutRef<typeof BaseContextMenu.GroupLabel>;\ntype BaseSubmenuTriggerProps = ComponentPropsWithoutRef<typeof BaseContextMenu.SubmenuTrigger>;\n\nexport interface ContextMenuPopupProps extends BasePopupProps {}\nexport interface ContextMenuItemProps extends BaseItemProps {}\nexport interface ContextMenuSeparatorProps extends BaseSeparatorProps {}\nexport interface ContextMenuGroupProps extends BaseGroupProps {}\nexport interface ContextMenuGroupLabelProps extends BaseGroupLabelProps {}\nexport interface ContextMenuSubmenuTriggerProps extends BaseSubmenuTriggerProps {}\n\nexport const ContextMenuPopup = forwardRef<ComponentRef<typeof BaseContextMenu.Popup>, ContextMenuPopupProps>(function ContextMenuPopup(\n { className, ...props },\n ref,\n) {\n return <BaseContextMenu.Popup ref={ref} className={(state) => cx(styles.popup, resolveClassName(className, state))} {...props} />;\n});\n\nexport const ContextMenuItem = forwardRef<ComponentRef<typeof BaseContextMenu.Item>, ContextMenuItemProps>(function ContextMenuItem(\n { className, ...props },\n ref,\n) {\n return <BaseContextMenu.Item ref={ref} className={(state) => cx(styles.item, resolveClassName(className, state))} {...props} />;\n});\n\nexport const ContextMenuSeparator = forwardRef<ComponentRef<typeof BaseContextMenu.Separator>, ContextMenuSeparatorProps>(\n function ContextMenuSeparator({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Separator ref={ref} className={(state) => cx(styles.separator, resolveClassName(className, state))} {...props} />\n );\n },\n);\n\nexport const ContextMenuGroup = forwardRef<ComponentRef<typeof BaseContextMenu.Group>, ContextMenuGroupProps>(function ContextMenuGroup(\n { className, ...props },\n ref,\n) {\n return <BaseContextMenu.Group ref={ref} className={className} {...props} />;\n});\n\nexport const ContextMenuGroupLabel = forwardRef<ComponentRef<typeof BaseContextMenu.GroupLabel>, ContextMenuGroupLabelProps>(\n function ContextMenuGroupLabel({ className, ...props }, ref) {\n return (\n <BaseContextMenu.GroupLabel\n ref={ref}\n className={(state) => cx(styles[\"group-label\"], resolveClassName(className, state))}\n {...props}\n />\n );\n },\n);\n\nexport const ContextMenuSubmenuTrigger = forwardRef<ComponentRef<typeof BaseContextMenu.SubmenuTrigger>, ContextMenuSubmenuTriggerProps>(\n function ContextMenuSubmenuTrigger({ className, children, ...props }, ref) {\n return (\n <BaseContextMenu.SubmenuTrigger\n ref={ref}\n className={(state) => cx(styles[\"submenu-trigger\"], resolveClassName(className, state))}\n {...props}\n >\n <span style={{ flex: 1 }}>{children}</span>\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" className={styles[\"submenu-icon\"]}>\n <path d=\"M3.5 9L7.5 5L3.5 1\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </BaseContextMenu.SubmenuTrigger>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,mBAAmB,WAA8E,SAAS,iBACrH,EAAE,WAAW,GAAG,SAChB,KACA;A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AAK;GAAO,WAAWA,4BAAO;aAC5E,oBAAC,QAAD;IAAM,GAAE;IAAqB,QAAO;IAAe,aAAY;IAAM,eAAc;IAAQ,gBAAe;IAAU,CAAA;GAChH,CAAA,CACyB;;EAGtC"}
|
package/dist/dialog/parts.d.ts
CHANGED
|
@@ -9,24 +9,12 @@ type BasePopupProps = ComponentPropsWithoutRef<typeof Dialog.Popup>;
|
|
|
9
9
|
type BaseTitleProps = ComponentPropsWithoutRef<typeof Dialog.Title>;
|
|
10
10
|
type BaseDescriptionProps = ComponentPropsWithoutRef<typeof Dialog.Description>;
|
|
11
11
|
type BaseCloseProps = ComponentPropsWithoutRef<typeof Dialog.Close>;
|
|
12
|
-
interface DialogBackdropProps extends
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
interface
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
interface DialogPopupProps extends Omit<BasePopupProps, "className"> {
|
|
19
|
-
className?: string;
|
|
20
|
-
}
|
|
21
|
-
interface DialogTitleProps extends Omit<BaseTitleProps, "className"> {
|
|
22
|
-
className?: string;
|
|
23
|
-
}
|
|
24
|
-
interface DialogDescriptionProps extends Omit<BaseDescriptionProps, "className"> {
|
|
25
|
-
className?: string;
|
|
26
|
-
}
|
|
27
|
-
interface DialogCloseProps extends Omit<BaseCloseProps, "className"> {
|
|
28
|
-
className?: string;
|
|
29
|
-
}
|
|
12
|
+
interface DialogBackdropProps extends BaseBackdropProps {}
|
|
13
|
+
interface DialogViewportProps extends BaseViewportProps {}
|
|
14
|
+
interface DialogPopupProps extends BasePopupProps {}
|
|
15
|
+
interface DialogTitleProps extends BaseTitleProps {}
|
|
16
|
+
interface DialogDescriptionProps extends BaseDescriptionProps {}
|
|
17
|
+
interface DialogCloseProps extends BaseCloseProps {}
|
|
30
18
|
declare const DialogBackdrop: react.ForwardRefExoticComponent<DialogBackdropProps & react.RefAttributes<HTMLDivElement>>;
|
|
31
19
|
declare const DialogViewport: react.ForwardRefExoticComponent<DialogViewportProps & react.RefAttributes<HTMLDivElement>>;
|
|
32
20
|
declare const DialogPopup: react.ForwardRefExoticComponent<DialogPopupProps & react.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/dialog/parts.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/dialog/parts.tsx"],"mappings":";;;;;KA4BK,iBAAA,GAAoB,wBAAA,QAAgC,MAAA,CAAW,QAAA;AAAA,KAC/D,iBAAA,GAAoB,wBAAA,QAAgC,MAAA,CAAW,QAAA;AAAA,KAC/D,cAAA,GAAiB,wBAAA,QAAgC,MAAA,CAAW,KAAA;AAAA,KAC5D,cAAA,GAAiB,wBAAA,QAAgC,MAAA,CAAW,KAAA;AAAA,KAC5D,oBAAA,GAAuB,wBAAA,QAAgC,MAAA,CAAW,WAAA;AAAA,KAClE,cAAA,GAAiB,wBAAA,QAAgC,MAAA,CAAW,KAAA;AAAA,UAEhD,mBAAA,SAA4B,iBAAA;AAAA,UAC5B,mBAAA,SAA4B,iBAAA;AAAA,UAC5B,gBAAA,SAAyB,cAAA;AAAA,UACzB,gBAAA,SAAyB,cAAA;AAAA,UACzB,sBAAA,SAA+B,oBAAA;AAAA,UAC/B,gBAAA,SAAyB,cAAA;AAAA,cAE7B,cAAA,EAAc,KAAA,CAAA,yBAAA,CAAA,mBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAOd,cAAA,EAAc,KAAA,CAAA,yBAAA,CAAA,mBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAOd,WAAA,EAAW,KAAA,CAAA,yBAAA,CAAA,gBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAOX,WAAA,EAAW,KAAA,CAAA,yBAAA,CAAA,gBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,kBAAA;AAAA,cAOX,iBAAA,EAAiB,KAAA,CAAA,yBAAA,CAAA,sBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,oBAAA;AAAA,cAOjB,WAAA,EAAW,KAAA,CAAA,yBAAA,CAAA,gBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,iBAAA"}
|
package/dist/dialog/parts.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { cx, resolveClassName } from "../utils/resolveClassName.js";
|
|
1
2
|
import dialog_module_default from "./dialog.module.js";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { forwardRef } from "react";
|
|
4
5
|
import { Dialog } from "@base-ui/react/dialog";
|
|
5
6
|
//#region src/dialog/parts.tsx
|
|
6
7
|
/**
|
|
7
|
-
* Styled primitives for Dialog
|
|
8
|
-
* Dialog part and pre-applies the agentic-ui CSS class. All base-ui props are
|
|
9
|
-
* forwarded so you can compose these with a raw `Dialog.Root` / `Dialog.Trigger`.
|
|
8
|
+
* Styled primitives for Dialog.
|
|
10
9
|
*
|
|
11
10
|
* @example
|
|
12
11
|
* ```tsx
|
|
@@ -30,42 +29,42 @@ import { Dialog } from "@base-ui/react/dialog";
|
|
|
30
29
|
const DialogBackdrop = forwardRef(function DialogBackdrop({ className, ...props }, ref) {
|
|
31
30
|
return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
32
31
|
ref,
|
|
33
|
-
className:
|
|
32
|
+
className: (state) => cx(dialog_module_default.backdrop, resolveClassName(className, state)),
|
|
34
33
|
...props
|
|
35
34
|
});
|
|
36
35
|
});
|
|
37
36
|
const DialogViewport = forwardRef(function DialogViewport({ className, ...props }, ref) {
|
|
38
37
|
return /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
39
38
|
ref,
|
|
40
|
-
className:
|
|
39
|
+
className: (state) => cx(dialog_module_default.viewport ?? "", resolveClassName(className, state)),
|
|
41
40
|
...props
|
|
42
41
|
});
|
|
43
42
|
});
|
|
44
43
|
const DialogPopup = forwardRef(function DialogPopup({ className, ...props }, ref) {
|
|
45
44
|
return /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
46
45
|
ref,
|
|
47
|
-
className:
|
|
46
|
+
className: (state) => cx(dialog_module_default.popup, resolveClassName(className, state)),
|
|
48
47
|
...props
|
|
49
48
|
});
|
|
50
49
|
});
|
|
51
50
|
const DialogTitle = forwardRef(function DialogTitle({ className, ...props }, ref) {
|
|
52
51
|
return /* @__PURE__ */ jsx(Dialog.Title, {
|
|
53
52
|
ref,
|
|
54
|
-
className:
|
|
53
|
+
className: (state) => cx(dialog_module_default.title, resolveClassName(className, state)),
|
|
55
54
|
...props
|
|
56
55
|
});
|
|
57
56
|
});
|
|
58
57
|
const DialogDescription = forwardRef(function DialogDescription({ className, ...props }, ref) {
|
|
59
58
|
return /* @__PURE__ */ jsx(Dialog.Description, {
|
|
60
59
|
ref,
|
|
61
|
-
className:
|
|
60
|
+
className: (state) => cx(dialog_module_default.description, resolveClassName(className, state)),
|
|
62
61
|
...props
|
|
63
62
|
});
|
|
64
63
|
});
|
|
65
64
|
const DialogClose = forwardRef(function DialogClose({ className, ...props }, ref) {
|
|
66
65
|
return /* @__PURE__ */ jsx(Dialog.Close, {
|
|
67
66
|
ref,
|
|
68
|
-
className:
|
|
67
|
+
className: (state) => cx(dialog_module_default.close, resolveClassName(className, state)),
|
|
69
68
|
...props
|
|
70
69
|
});
|
|
71
70
|
});
|
package/dist/dialog/parts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","names":["BaseDialog","styles"],"sources":["../../src/dialog/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Dialog
|
|
1
|
+
{"version":3,"file":"parts.js","names":["BaseDialog","styles"],"sources":["../../src/dialog/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Dialog.\n *\n * @example\n * ```tsx\n * import { Dialog } from '@base-ui/react/dialog';\n * import { DialogBackdrop, DialogViewport, DialogPopup, DialogTitle, DialogClose } from '@brijbyte/agentic-ui/dialog';\n *\n * <Dialog.Root>\n * <Dialog.Trigger render={<button>Open</button>} />\n * <Dialog.Portal>\n * <DialogBackdrop />\n * <DialogViewport>\n * <DialogPopup>\n * <DialogTitle>Hello</DialogTitle>\n * <DialogClose aria-label=\"Close\" />\n * </DialogPopup>\n * </DialogViewport>\n * </Dialog.Portal>\n * </Dialog.Root>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport styles from \"./dialog.module.css\";\nimport { resolveClassName, cx } from \"../utils/resolveClassName\";\n\ntype BaseBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\ntype BaseViewportProps = ComponentPropsWithoutRef<typeof BaseDialog.Viewport>;\ntype BasePopupProps = ComponentPropsWithoutRef<typeof BaseDialog.Popup>;\ntype BaseTitleProps = ComponentPropsWithoutRef<typeof BaseDialog.Title>;\ntype BaseDescriptionProps = ComponentPropsWithoutRef<typeof BaseDialog.Description>;\ntype BaseCloseProps = ComponentPropsWithoutRef<typeof BaseDialog.Close>;\n\nexport interface DialogBackdropProps extends BaseBackdropProps {}\nexport interface DialogViewportProps extends BaseViewportProps {}\nexport interface DialogPopupProps extends BasePopupProps {}\nexport interface DialogTitleProps extends BaseTitleProps {}\nexport interface DialogDescriptionProps extends BaseDescriptionProps {}\nexport interface DialogCloseProps extends BaseCloseProps {}\n\nexport const DialogBackdrop = forwardRef<ComponentRef<typeof BaseDialog.Backdrop>, DialogBackdropProps>(function DialogBackdrop(\n { className, ...props },\n ref,\n) {\n return <BaseDialog.Backdrop ref={ref} className={(state) => cx(styles.backdrop, resolveClassName(className, state))} {...props} />;\n});\n\nexport const DialogViewport = forwardRef<ComponentRef<typeof BaseDialog.Viewport>, DialogViewportProps>(function DialogViewport(\n { className, ...props },\n ref,\n) {\n return <BaseDialog.Viewport ref={ref} className={(state) => cx(styles.viewport ?? \"\", resolveClassName(className, state))} {...props} />;\n});\n\nexport const DialogPopup = forwardRef<ComponentRef<typeof BaseDialog.Popup>, DialogPopupProps>(function DialogPopup(\n { className, ...props },\n ref,\n) {\n return <BaseDialog.Popup ref={ref} className={(state) => cx(styles.popup, resolveClassName(className, state))} {...props} />;\n});\n\nexport const DialogTitle = forwardRef<ComponentRef<typeof BaseDialog.Title>, DialogTitleProps>(function DialogTitle(\n { className, ...props },\n ref,\n) {\n return <BaseDialog.Title ref={ref} className={(state) => cx(styles.title, resolveClassName(className, state))} {...props} />;\n});\n\nexport const DialogDescription = forwardRef<ComponentRef<typeof BaseDialog.Description>, DialogDescriptionProps>(function DialogDescription(\n { className, ...props },\n ref,\n) {\n return <BaseDialog.Description ref={ref} className={(state) => cx(styles.description, resolveClassName(className, state))} {...props} />;\n});\n\nexport const DialogClose = forwardRef<ComponentRef<typeof BaseDialog.Close>, DialogCloseProps>(function DialogClose(\n { className, ...props },\n ref,\n) {\n return <BaseDialog.Close ref={ref} className={(state) => cx(styles.close, resolveClassName(className, state))} {...props} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,iBAAiB,WAA0E,SAAS,eAC/G,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACA,OAAW,UAAZ;EAA0B;EAAK,YAAY,UAAU,GAAGC,sBAAO,UAAU,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAClI;AAEF,MAAa,iBAAiB,WAA0E,SAAS,eAC/G,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,OAAW,UAAZ;EAA0B;EAAK,YAAY,UAAU,GAAGC,sBAAO,YAAY,IAAI,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EACxI;AAEF,MAAa,cAAc,WAAoE,SAAS,YACtG,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,OAAW,OAAZ;EAAuB;EAAK,YAAY,UAAU,GAAGC,sBAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC5H;AAEF,MAAa,cAAc,WAAoE,SAAS,YACtG,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,OAAW,OAAZ;EAAuB;EAAK,YAAY,UAAU,GAAGC,sBAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC5H;AAEF,MAAa,oBAAoB,WAAgF,SAAS,kBACxH,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,OAAW,aAAZ;EAA6B;EAAK,YAAY,UAAU,GAAGC,sBAAO,aAAa,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EACxI;AAEF,MAAa,cAAc,WAAoE,SAAS,YACtG,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,OAAW,OAAZ;EAAuB;EAAK,YAAY,UAAU,GAAGC,sBAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC5H"}
|
package/dist/drawer/parts.d.ts
CHANGED
|
@@ -12,29 +12,17 @@ type BaseContentProps = ComponentPropsWithoutRef<typeof Drawer.Content>;
|
|
|
12
12
|
type BaseTitleProps = ComponentPropsWithoutRef<typeof Drawer.Title>;
|
|
13
13
|
type BaseDescriptionProps = ComponentPropsWithoutRef<typeof Drawer.Description>;
|
|
14
14
|
type BaseCloseProps = ComponentPropsWithoutRef<typeof Drawer.Close>;
|
|
15
|
-
interface DrawerBackdropProps extends
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
interface DrawerViewportProps extends Omit<BaseViewportProps, "className"> {
|
|
19
|
-
className?: string;
|
|
15
|
+
interface DrawerBackdropProps extends BaseBackdropProps {}
|
|
16
|
+
interface DrawerViewportProps extends BaseViewportProps {
|
|
20
17
|
side?: DrawerSide;
|
|
21
18
|
}
|
|
22
|
-
interface DrawerPopupProps extends
|
|
23
|
-
className?: string;
|
|
19
|
+
interface DrawerPopupProps extends BasePopupProps {
|
|
24
20
|
side?: DrawerSide;
|
|
25
21
|
}
|
|
26
|
-
interface DrawerContentProps extends
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
interface
|
|
30
|
-
className?: string;
|
|
31
|
-
}
|
|
32
|
-
interface DrawerDescriptionProps extends Omit<BaseDescriptionProps, "className"> {
|
|
33
|
-
className?: string;
|
|
34
|
-
}
|
|
35
|
-
interface DrawerCloseProps extends Omit<BaseCloseProps, "className"> {
|
|
36
|
-
className?: string;
|
|
37
|
-
}
|
|
22
|
+
interface DrawerContentProps extends BaseContentProps {}
|
|
23
|
+
interface DrawerTitleProps extends BaseTitleProps {}
|
|
24
|
+
interface DrawerDescriptionProps extends BaseDescriptionProps {}
|
|
25
|
+
interface DrawerCloseProps extends BaseCloseProps {}
|
|
38
26
|
declare const DrawerBackdrop: react.ForwardRefExoticComponent<DrawerBackdropProps & react.RefAttributes<HTMLDivElement>>;
|
|
39
27
|
declare const DrawerViewport: react.ForwardRefExoticComponent<DrawerViewportProps & react.RefAttributes<HTMLDivElement>>;
|
|
40
28
|
declare const DrawerPopup: react.ForwardRefExoticComponent<DrawerPopupProps & react.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/drawer/parts.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/drawer/parts.tsx"],"mappings":";;;;;;;KAmCK,iBAAA,GAAoB,wBAAA,QAAgC,MAAA,CAAW,QAAA;AAAA,KAC/D,iBAAA,GAAoB,wBAAA,QAAgC,MAAA,CAAW,QAAA;AAAA,KAC/D,cAAA,GAAiB,wBAAA,QAAgC,MAAA,CAAW,KAAA;AAAA,KAC5D,gBAAA,GAAmB,wBAAA,QAAgC,MAAA,CAAW,OAAA;AAAA,KAC9D,cAAA,GAAiB,wBAAA,QAAgC,MAAA,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S,KAAA,CAAM,cAAA,CAAe,cAAA,IAAe,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/drawer/parts.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cx, resolveClassName } from "../utils/resolveClassName.js";
|
|
1
2
|
import drawer_module_default from "./drawer.module.js";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { forwardRef } from "react";
|
|
@@ -31,59 +32,59 @@ import { Drawer } from "@base-ui/react/drawer";
|
|
|
31
32
|
* </Drawer.Root>
|
|
32
33
|
* ```
|
|
33
34
|
*/
|
|
35
|
+
const POPUP_CLASS = {
|
|
36
|
+
right: drawer_module_default["popup-right"],
|
|
37
|
+
left: drawer_module_default["popup-left"],
|
|
38
|
+
bottom: drawer_module_default["popup-bottom"],
|
|
39
|
+
top: drawer_module_default["popup-top"]
|
|
40
|
+
};
|
|
34
41
|
const DrawerBackdrop = forwardRef(function DrawerBackdrop({ className, ...props }, ref) {
|
|
35
42
|
return /* @__PURE__ */ jsx(Drawer.Backdrop, {
|
|
36
43
|
ref,
|
|
37
|
-
className:
|
|
44
|
+
className: (state) => cx(drawer_module_default.backdrop, resolveClassName(className, state)),
|
|
38
45
|
...props
|
|
39
46
|
});
|
|
40
47
|
});
|
|
41
48
|
const DrawerViewport = forwardRef(function DrawerViewport({ className, side = "right", ...props }, ref) {
|
|
42
49
|
return /* @__PURE__ */ jsx(Drawer.Viewport, {
|
|
43
50
|
ref,
|
|
44
|
-
className:
|
|
51
|
+
className: (state) => cx(drawer_module_default.viewport, resolveClassName(className, state)),
|
|
45
52
|
"data-side": side,
|
|
46
53
|
...props
|
|
47
54
|
});
|
|
48
55
|
});
|
|
49
|
-
const POPUP_CLASS = {
|
|
50
|
-
right: drawer_module_default["popup-right"],
|
|
51
|
-
left: drawer_module_default["popup-left"],
|
|
52
|
-
bottom: drawer_module_default["popup-bottom"],
|
|
53
|
-
top: drawer_module_default["popup-top"]
|
|
54
|
-
};
|
|
55
56
|
const DrawerPopup = forwardRef(function DrawerPopup({ className, side = "right", ...props }, ref) {
|
|
56
57
|
return /* @__PURE__ */ jsx(Drawer.Popup, {
|
|
57
58
|
ref,
|
|
58
|
-
className:
|
|
59
|
+
className: (state) => cx(drawer_module_default.popup, POPUP_CLASS[side], resolveClassName(className, state)),
|
|
59
60
|
...props
|
|
60
61
|
});
|
|
61
62
|
});
|
|
62
63
|
const DrawerContent = forwardRef(function DrawerContent({ className, ...props }, ref) {
|
|
63
64
|
return /* @__PURE__ */ jsx(Drawer.Content, {
|
|
64
65
|
ref,
|
|
65
|
-
className:
|
|
66
|
+
className: (state) => cx(drawer_module_default.content, resolveClassName(className, state)),
|
|
66
67
|
...props
|
|
67
68
|
});
|
|
68
69
|
});
|
|
69
70
|
const DrawerTitle = forwardRef(function DrawerTitle({ className, ...props }, ref) {
|
|
70
71
|
return /* @__PURE__ */ jsx(Drawer.Title, {
|
|
71
72
|
ref,
|
|
72
|
-
className:
|
|
73
|
+
className: (state) => cx(drawer_module_default.title, resolveClassName(className, state)),
|
|
73
74
|
...props
|
|
74
75
|
});
|
|
75
76
|
});
|
|
76
77
|
const DrawerDescription = forwardRef(function DrawerDescription({ className, ...props }, ref) {
|
|
77
78
|
return /* @__PURE__ */ jsx(Drawer.Description, {
|
|
78
79
|
ref,
|
|
79
|
-
className:
|
|
80
|
+
className: (state) => cx(drawer_module_default.description, resolveClassName(className, state)),
|
|
80
81
|
...props
|
|
81
82
|
});
|
|
82
83
|
});
|
|
83
84
|
const DrawerClose = forwardRef(function DrawerClose({ className, ...props }, ref) {
|
|
84
85
|
return /* @__PURE__ */ jsx(Drawer.Close, {
|
|
85
86
|
ref,
|
|
86
|
-
className:
|
|
87
|
+
className: (state) => cx(drawer_module_default.close, resolveClassName(className, state)),
|
|
87
88
|
...props
|
|
88
89
|
});
|
|
89
90
|
});
|
package/dist/drawer/parts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","names":["
|
|
1
|
+
{"version":3,"file":"parts.js","names":["styles","BaseDrawer"],"sources":["../../src/drawer/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Drawer.\n *\n * @example\n * ```tsx\n * import { Drawer } from '@base-ui/react/drawer';\n * import {\n * DrawerBackdrop, DrawerViewport, DrawerPopup,\n * DrawerContent, DrawerTitle, DrawerClose,\n * } from '@brijbyte/agentic-ui/drawer';\n *\n * <Drawer.Root swipeDirection=\"right\">\n * <Drawer.Trigger render={<button>Open</button>} />\n * <Drawer.Portal>\n * <DrawerBackdrop />\n * <DrawerViewport side=\"right\">\n * <DrawerPopup side=\"right\">\n * <DrawerContent>\n * <DrawerTitle>Title</DrawerTitle>\n * {children}\n * <DrawerClose />\n * </DrawerContent>\n * </DrawerPopup>\n * </DrawerViewport>\n * </Drawer.Portal>\n * </Drawer.Root>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport type { DrawerSide } from \"./drawer\";\nimport styles from \"./drawer.module.css\";\nimport { resolveClassName, cx } from \"../utils/resolveClassName\";\n\ntype BaseBackdropProps = ComponentPropsWithoutRef<typeof BaseDrawer.Backdrop>;\ntype BaseViewportProps = ComponentPropsWithoutRef<typeof BaseDrawer.Viewport>;\ntype BasePopupProps = ComponentPropsWithoutRef<typeof BaseDrawer.Popup>;\ntype BaseContentProps = ComponentPropsWithoutRef<typeof BaseDrawer.Content>;\ntype BaseTitleProps = ComponentPropsWithoutRef<typeof BaseDrawer.Title>;\ntype BaseDescriptionProps = ComponentPropsWithoutRef<typeof BaseDrawer.Description>;\ntype BaseCloseProps = ComponentPropsWithoutRef<typeof BaseDrawer.Close>;\n\nexport interface DrawerBackdropProps extends BaseBackdropProps {}\nexport interface DrawerViewportProps extends BaseViewportProps {\n side?: DrawerSide;\n}\nexport interface DrawerPopupProps extends BasePopupProps {\n side?: DrawerSide;\n}\nexport interface DrawerContentProps extends BaseContentProps {}\nexport interface DrawerTitleProps extends BaseTitleProps {}\nexport interface DrawerDescriptionProps extends BaseDescriptionProps {}\nexport interface DrawerCloseProps extends BaseCloseProps {}\n\nconst POPUP_CLASS: Record<DrawerSide, string> = {\n right: styles[\"popup-right\"] as string,\n left: styles[\"popup-left\"] as string,\n bottom: styles[\"popup-bottom\"] as string,\n top: styles[\"popup-top\"] as string,\n};\n\nexport const DrawerBackdrop = forwardRef<HTMLDivElement, DrawerBackdropProps>(function DrawerBackdrop({ className, ...props }, ref) {\n return <BaseDrawer.Backdrop ref={ref} className={(state) => cx(styles.backdrop, resolveClassName(className, state))} {...props} />;\n});\n\nexport const DrawerViewport = forwardRef<HTMLDivElement, DrawerViewportProps>(function DrawerViewport(\n { className, side = \"right\", ...props },\n ref,\n) {\n return (\n <BaseDrawer.Viewport\n ref={ref}\n className={(state) => cx(styles.viewport, resolveClassName(className, state))}\n data-side={side}\n {...props}\n />\n );\n});\n\nexport const DrawerPopup = forwardRef<HTMLDivElement, DrawerPopupProps>(function DrawerPopup({ className, side = \"right\", ...props }, ref) {\n return (\n <BaseDrawer.Popup ref={ref} className={(state) => cx(styles.popup, POPUP_CLASS[side], resolveClassName(className, state))} {...props} />\n );\n});\n\nexport const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(function DrawerContent({ className, ...props }, ref) {\n return <BaseDrawer.Content ref={ref} className={(state) => cx(styles.content, resolveClassName(className, state))} {...props} />;\n});\n\nexport const DrawerTitle = forwardRef<HTMLHeadingElement, DrawerTitleProps>(function DrawerTitle({ className, ...props }, ref) {\n return <BaseDrawer.Title ref={ref} className={(state) => cx(styles.title, resolveClassName(className, state))} {...props} />;\n});\n\nexport const DrawerDescription = forwardRef<HTMLParagraphElement, DrawerDescriptionProps>(function DrawerDescription(\n { className, ...props },\n ref,\n) {\n return <BaseDrawer.Description ref={ref} className={(state) => cx(styles.description, resolveClassName(className, state))} {...props} />;\n});\n\nexport const DrawerClose = forwardRef<HTMLButtonElement, DrawerCloseProps>(function DrawerClose({ className, ...props }, ref) {\n return <BaseDrawer.Close ref={ref} className={(state) => cx(styles.close, resolveClassName(className, state))} {...props} />;\n});\n\n/** A decorative drag handle bar. Place at the top of a bottom drawer or bottom of a top drawer. */\nexport function DrawerHandleBar({ className }: { className?: string }) {\n return <div className={`${styles[\"handle-bar\"]} ${className ?? \"\"}`} aria-hidden />;\n}\n\n/** Styled footer strip for action buttons. */\nexport function DrawerFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={`${styles.footer} ${className ?? \"\"}`} {...props} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAM,cAA0C;CAC9C,OAAOA,sBAAO;CACd,MAAMA,sBAAO;CACb,QAAQA,sBAAO;CACf,KAAKA,sBAAO;CACb;AAED,MAAa,iBAAiB,WAAgD,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;AAClI,QAAO,oBAACC,OAAW,UAAZ;EAA0B;EAAK,YAAY,UAAU,GAAGD,sBAAO,UAAU,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAClI;AAEF,MAAa,iBAAiB,WAAgD,SAAS,eACrF,EAAE,WAAW,OAAO,SAAS,GAAG,SAChC,KACA;AACA,QACE,oBAACC,OAAW,UAAZ;EACO;EACL,YAAY,UAAU,GAAGD,sBAAO,UAAU,iBAAiB,WAAW,MAAM,CAAC;EAC7E,aAAW;EACX,GAAI;EACJ,CAAA;EAEJ;AAEF,MAAa,cAAc,WAA6C,SAAS,YAAY,EAAE,WAAW,OAAO,SAAS,GAAG,SAAS,KAAK;AACzI,QACE,oBAACC,OAAW,OAAZ;EAAuB;EAAK,YAAY,UAAU,GAAGD,sBAAO,OAAO,YAAY,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAE1I;AAEF,MAAa,gBAAgB,WAA+C,SAAS,cAAc,EAAE,WAAW,GAAG,S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