@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
package/dist/switch/parts.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cx, resolveClassName } from "../utils/resolveClassName.js";
|
|
1
2
|
import switch_module_default from "./switch.module.js";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { forwardRef } from "react";
|
|
@@ -22,14 +23,14 @@ import { Switch } from "@base-ui/react/switch";
|
|
|
22
23
|
const SwitchRoot = forwardRef(function SwitchRoot({ className, ...props }, ref) {
|
|
23
24
|
return /* @__PURE__ */ jsx(Switch.Root, {
|
|
24
25
|
ref,
|
|
25
|
-
className:
|
|
26
|
+
className: (state) => cx(switch_module_default["thumb-track"], resolveClassName(className, state)),
|
|
26
27
|
...props
|
|
27
28
|
});
|
|
28
29
|
});
|
|
29
30
|
const SwitchThumb = forwardRef(function SwitchThumb({ className, ...props }, ref) {
|
|
30
31
|
return /* @__PURE__ */ jsx(Switch.Thumb, {
|
|
31
32
|
ref,
|
|
32
|
-
className:
|
|
33
|
+
className: (state) => cx(switch_module_default.thumb, resolveClassName(className, state)),
|
|
33
34
|
...props
|
|
34
35
|
});
|
|
35
36
|
});
|
package/dist/switch/parts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","names":["BaseSwitch","styles"],"sources":["../../src/switch/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Switch.\n *\n * @example\n * ```tsx\n * import { Switch } from '@base-ui/react/switch';\n * import { SwitchRoot, SwitchThumb } from '@brijbyte/agentic-ui/switch';\n *\n * <label htmlFor=\"sw\">\n * <SwitchRoot id=\"sw\" onCheckedChange={...}>\n * <SwitchThumb />\n * </SwitchRoot>\n * Dark mode\n * </label>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport styles from \"./switch.module.css\";\n\ntype BaseRootProps = ComponentPropsWithoutRef<typeof BaseSwitch.Root>;\ntype BaseThumbProps = ComponentPropsWithoutRef<typeof BaseSwitch.Thumb>;\n\nexport interface SwitchRootProps extends
|
|
1
|
+
{"version":3,"file":"parts.js","names":["BaseSwitch","styles"],"sources":["../../src/switch/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Switch.\n *\n * @example\n * ```tsx\n * import { Switch } from '@base-ui/react/switch';\n * import { SwitchRoot, SwitchThumb } from '@brijbyte/agentic-ui/switch';\n *\n * <label htmlFor=\"sw\">\n * <SwitchRoot id=\"sw\" onCheckedChange={...}>\n * <SwitchThumb />\n * </SwitchRoot>\n * Dark mode\n * </label>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport styles from \"./switch.module.css\";\nimport { resolveClassName, cx } from \"../utils/resolveClassName\";\n\ntype BaseRootProps = ComponentPropsWithoutRef<typeof BaseSwitch.Root>;\ntype BaseThumbProps = ComponentPropsWithoutRef<typeof BaseSwitch.Thumb>;\n\nexport interface SwitchRootProps extends BaseRootProps {}\nexport interface SwitchThumbProps extends BaseThumbProps {}\n\nexport const SwitchRoot = forwardRef<ComponentRef<typeof BaseSwitch.Root>, SwitchRootProps>(function SwitchRoot(\n { className, ...props },\n ref,\n) {\n return <BaseSwitch.Root ref={ref} className={(state) => cx(styles[\"thumb-track\"], resolveClassName(className, state))} {...props} />;\n});\n\nexport const SwitchThumb = forwardRef<ComponentRef<typeof BaseSwitch.Thumb>, SwitchThumbProps>(function SwitchThumb(\n { className, ...props },\n ref,\n) {\n return <BaseSwitch.Thumb ref={ref} className={(state) => cx(styles.thumb, resolveClassName(className, state))} {...props} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,aAAa,WAAkE,SAAS,WACnG,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACA,OAAW,MAAZ;EAAsB;EAAK,YAAY,UAAU,GAAGC,sBAAO,gBAAgB,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EACpI;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/tabs/parts.d.ts
CHANGED
|
@@ -6,15 +6,9 @@ import { Tabs } from "@base-ui/react/tabs";
|
|
|
6
6
|
type BaseListProps = ComponentPropsWithoutRef<typeof Tabs.List>;
|
|
7
7
|
type BaseTabProps = ComponentPropsWithoutRef<typeof Tabs.Tab>;
|
|
8
8
|
type BasePanelProps = ComponentPropsWithoutRef<typeof Tabs.Panel>;
|
|
9
|
-
interface TabsListProps extends
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
interface TabsTabProps extends Omit<BaseTabProps, "className"> {
|
|
13
|
-
className?: string;
|
|
14
|
-
}
|
|
15
|
-
interface TabsPanelProps extends Omit<BasePanelProps, "className"> {
|
|
16
|
-
className?: string;
|
|
17
|
-
}
|
|
9
|
+
interface TabsListProps extends BaseListProps {}
|
|
10
|
+
interface TabsTabProps extends BaseTabProps {}
|
|
11
|
+
interface TabsPanelProps extends BasePanelProps {}
|
|
18
12
|
declare const TabsList: react.ForwardRefExoticComponent<TabsListProps & react.RefAttributes<HTMLDivElement>>;
|
|
19
13
|
declare const TabsTab: react.ForwardRefExoticComponent<TabsTabProps & react.RefAttributes<HTMLElement>>;
|
|
20
14
|
declare const TabsPanel: react.ForwardRefExoticComponent<TabsPanelProps & react.RefAttributes<HTMLDivElement>>;
|
package/dist/tabs/parts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/tabs/parts.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/tabs/parts.tsx"],"mappings":";;;;;KAwBK,aAAA,GAAgB,wBAAA,QAAgC,IAAA,CAAS,IAAA;AAAA,KACzD,YAAA,GAAe,wBAAA,QAAgC,IAAA,CAAS,GAAA;AAAA,KACxD,cAAA,GAAiB,wBAAA,QAAgC,IAAA,CAAS,KAAA;AAAA,UAE9C,aAAA,SAAsB,aAAA;AAAA,UACtB,YAAA,SAAqB,YAAA;AAAA,UACrB,cAAA,SAAuB,cAAA;AAAA,cAE3B,QAAA,EAAQ,KAAA,CAAA,yBAAA,CAAA,aAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAIR,OAAA,EAAO,KAAA,CAAA,yBAAA,CAAA,YAAA,GAAA,KAAA,CAAA,aAAA,CAAA,WAAA;AAAA,cAIP,SAAA,EAAS,KAAA,CAAA,yBAAA,CAAA,cAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA"}
|
package/dist/tabs/parts.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cx, resolveClassName } from "../utils/resolveClassName.js";
|
|
1
2
|
import tabs_module_default from "./tabs.module.js";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { forwardRef } from "react";
|
|
@@ -24,21 +25,21 @@ import { Tabs } from "@base-ui/react/tabs";
|
|
|
24
25
|
const TabsList = forwardRef(function TabsList({ className, ...props }, ref) {
|
|
25
26
|
return /* @__PURE__ */ jsx(Tabs.List, {
|
|
26
27
|
ref,
|
|
27
|
-
className:
|
|
28
|
+
className: (state) => cx(tabs_module_default.list, resolveClassName(className, state)),
|
|
28
29
|
...props
|
|
29
30
|
});
|
|
30
31
|
});
|
|
31
32
|
const TabsTab = forwardRef(function TabsTab({ className, ...props }, ref) {
|
|
32
33
|
return /* @__PURE__ */ jsx(Tabs.Tab, {
|
|
33
34
|
ref,
|
|
34
|
-
className:
|
|
35
|
+
className: (state) => cx(tabs_module_default.tab, resolveClassName(className, state)),
|
|
35
36
|
...props
|
|
36
37
|
});
|
|
37
38
|
});
|
|
38
39
|
const TabsPanel = forwardRef(function TabsPanel({ className, ...props }, ref) {
|
|
39
40
|
return /* @__PURE__ */ jsx(Tabs.Panel, {
|
|
40
41
|
ref,
|
|
41
|
-
className:
|
|
42
|
+
className: (state) => cx(tabs_module_default.panel, resolveClassName(className, state)),
|
|
42
43
|
...props
|
|
43
44
|
});
|
|
44
45
|
});
|
package/dist/tabs/parts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","names":["BaseTabs","styles"],"sources":["../../src/tabs/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Tabs.\n *\n * @example\n * ```tsx\n * import { Tabs } from '@base-ui/react/tabs';\n * import { TabsList, TabsTab, TabsPanel } from '@brijbyte/agentic-ui/tabs';\n *\n * <Tabs.Root defaultValue=\"a\">\n * <TabsList>\n * <TabsTab value=\"a\">Tab A</TabsTab>\n * <TabsTab value=\"b\">Tab B</TabsTab>\n * </TabsList>\n * <TabsPanel value=\"a\">Content A</TabsPanel>\n * <TabsPanel value=\"b\">Content B</TabsPanel>\n * </Tabs.Root>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\nimport styles from \"./tabs.module.css\";\n\ntype BaseListProps = ComponentPropsWithoutRef<typeof BaseTabs.List>;\ntype BaseTabProps = ComponentPropsWithoutRef<typeof BaseTabs.Tab>;\ntype BasePanelProps = ComponentPropsWithoutRef<typeof BaseTabs.Panel>;\n\nexport interface TabsListProps extends
|
|
1
|
+
{"version":3,"file":"parts.js","names":["BaseTabs","styles"],"sources":["../../src/tabs/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Tabs.\n *\n * @example\n * ```tsx\n * import { Tabs } from '@base-ui/react/tabs';\n * import { TabsList, TabsTab, TabsPanel } from '@brijbyte/agentic-ui/tabs';\n *\n * <Tabs.Root defaultValue=\"a\">\n * <TabsList>\n * <TabsTab value=\"a\">Tab A</TabsTab>\n * <TabsTab value=\"b\">Tab B</TabsTab>\n * </TabsList>\n * <TabsPanel value=\"a\">Content A</TabsPanel>\n * <TabsPanel value=\"b\">Content B</TabsPanel>\n * </Tabs.Root>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\nimport styles from \"./tabs.module.css\";\nimport { resolveClassName, cx } from \"../utils/resolveClassName\";\n\ntype BaseListProps = ComponentPropsWithoutRef<typeof BaseTabs.List>;\ntype BaseTabProps = ComponentPropsWithoutRef<typeof BaseTabs.Tab>;\ntype BasePanelProps = ComponentPropsWithoutRef<typeof BaseTabs.Panel>;\n\nexport interface TabsListProps extends BaseListProps {}\nexport interface TabsTabProps extends BaseTabProps {}\nexport interface TabsPanelProps extends BasePanelProps {}\n\nexport const TabsList = forwardRef<ComponentRef<typeof BaseTabs.List>, TabsListProps>(function TabsList({ className, ...props }, ref) {\n return <BaseTabs.List ref={ref} className={(state) => cx(styles.list, resolveClassName(className, state))} {...props} />;\n});\n\nexport const TabsTab = forwardRef<ComponentRef<typeof BaseTabs.Tab>, TabsTabProps>(function TabsTab({ className, ...props }, ref) {\n return <BaseTabs.Tab ref={ref} className={(state) => cx(styles.tab, resolveClassName(className, state))} {...props} />;\n});\n\nexport const TabsPanel = forwardRef<ComponentRef<typeof BaseTabs.Panel>, TabsPanelProps>(function TabsPanel({ className, ...props }, ref) {\n return <BaseTabs.Panel ref={ref} className={(state) => cx(styles.panel, resolveClassName(className, state))} {...props} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAa,WAAW,WAA8D,SAAS,SAAS,EAAE,WAAW,GAAG,SAAS,KAAK;AACpI,QAAO,oBAACA,KAAS,MAAV;EAAoB;EAAK,YAAY,UAAU,GAAGC,oBAAO,MAAM,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EACxH;AAEF,MAAa,UAAU,WAA4D,SAAS,QAAQ,EAAE,WAAW,GAAG,SAAS,KAAK;AAChI,QAAO,oBAACD,KAAS,KAAV;EAAmB;EAAK,YAAY,UAAU,GAAGC,oBAAO,KAAK,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EACtH;AAEF,MAAa,YAAY,WAAgE,SAAS,UAAU,EAAE,WAAW,GAAG,SAAS,KAAK;AACxI,QAAO,oBAACD,KAAS,OAAV;EAAqB;EAAK,YAAY,UAAU,GAAGC,oBAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC1H"}
|
package/dist/toast/parts.d.ts
CHANGED
|
@@ -8,21 +8,11 @@ type BaseTitleProps = ComponentPropsWithoutRef<typeof Toast.Title>;
|
|
|
8
8
|
type BaseDescriptionProps = ComponentPropsWithoutRef<typeof Toast.Description>;
|
|
9
9
|
type BaseCloseProps = ComponentPropsWithoutRef<typeof Toast.Close>;
|
|
10
10
|
type BaseViewportProps = ComponentPropsWithoutRef<typeof Toast.Viewport>;
|
|
11
|
-
interface ToastRootProps extends
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
interface
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
interface ToastDescriptionProps extends Omit<BaseDescriptionProps, "className"> {
|
|
18
|
-
className?: string;
|
|
19
|
-
}
|
|
20
|
-
interface ToastCloseProps extends Omit<BaseCloseProps, "className"> {
|
|
21
|
-
className?: string;
|
|
22
|
-
}
|
|
23
|
-
interface ToastViewportPartProps extends Omit<BaseViewportProps, "className"> {
|
|
24
|
-
className?: string;
|
|
25
|
-
}
|
|
11
|
+
interface ToastRootProps extends BaseRootProps {}
|
|
12
|
+
interface ToastTitleProps extends BaseTitleProps {}
|
|
13
|
+
interface ToastDescriptionProps extends BaseDescriptionProps {}
|
|
14
|
+
interface ToastCloseProps extends BaseCloseProps {}
|
|
15
|
+
interface ToastViewportPartProps extends BaseViewportProps {}
|
|
26
16
|
declare const ToastRoot: react.ForwardRefExoticComponent<ToastRootProps & react.RefAttributes<HTMLDivElement>>;
|
|
27
17
|
declare const ToastTitle: react.ForwardRefExoticComponent<ToastTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
28
18
|
declare const ToastDescription: react.ForwardRefExoticComponent<ToastDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/toast/parts.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/toast/parts.tsx"],"mappings":";;;;;KAwBK,aAAA,GAAgB,wBAAA,QAAgC,KAAA,CAAU,IAAA;AAAA,KAC1D,cAAA,GAAiB,wBAAA,QAAgC,KAAA,CAAU,KAAA;AAAA,KAC3D,oBAAA,GAAuB,wBAAA,QAAgC,KAAA,CAAU,WAAA;AAAA,KACjE,cAAA,GAAiB,wBAAA,QAAgC,KAAA,CAAU,KAAA;AAAA,KAC3D,iBAAA,GAAoB,wBAAA,QAAgC,KAAA,CAAU,QAAA;AAAA,UAElD,cAAA,SAAuB,aAAA;AAAA,UACvB,eAAA,SAAwB,cAAA;AAAA,UACxB,qBAAA,SAA8B,oBAAA;AAAA,UAC9B,eAAA,SAAwB,cAAA;AAAA,UACxB,sBAAA,SAA+B,iBAAA;AAAA,cAEnC,SAAA,EAAS,KAAA,CAAA,yBAAA,CAAA,cAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAIT,UAAA,EAAU,KAAA,CAAA,yBAAA,CAAA,eAAA,GAAA,KAAA,CAAA,aAAA,CAAA,kBAAA;AAAA,cAOV,gBAAA,EAAgB,KAAA,CAAA,yBAAA,CAAA,qBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,oBAAA;AAAA,cAOhB,UAAA,EAAU,KAAA,CAAA,yBAAA,CAAA,eAAA,GAAA,KAAA,CAAA,aAAA,CAAA,iBAAA;AAAA,cAOV,iBAAA,EAAiB,KAAA,CAAA,yBAAA,CAAA,sBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA"}
|
package/dist/toast/parts.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cx, resolveClassName } from "../utils/resolveClassName.js";
|
|
1
2
|
import toast_module_default from "./toast.module.js";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { forwardRef } from "react";
|
|
@@ -24,35 +25,35 @@ import { Toast } from "@base-ui/react/toast";
|
|
|
24
25
|
const ToastRoot = forwardRef(function ToastRoot({ className, ...props }, ref) {
|
|
25
26
|
return /* @__PURE__ */ jsx(Toast.Root, {
|
|
26
27
|
ref,
|
|
27
|
-
className:
|
|
28
|
+
className: (state) => cx(toast_module_default.toast, resolveClassName(className, state)),
|
|
28
29
|
...props
|
|
29
30
|
});
|
|
30
31
|
});
|
|
31
32
|
const ToastTitle = forwardRef(function ToastTitle({ className, ...props }, ref) {
|
|
32
33
|
return /* @__PURE__ */ jsx(Toast.Title, {
|
|
33
34
|
ref,
|
|
34
|
-
className:
|
|
35
|
+
className: (state) => cx(toast_module_default.title, resolveClassName(className, state)),
|
|
35
36
|
...props
|
|
36
37
|
});
|
|
37
38
|
});
|
|
38
39
|
const ToastDescription = forwardRef(function ToastDescription({ className, ...props }, ref) {
|
|
39
40
|
return /* @__PURE__ */ jsx(Toast.Description, {
|
|
40
41
|
ref,
|
|
41
|
-
className:
|
|
42
|
+
className: (state) => cx(toast_module_default.description, resolveClassName(className, state)),
|
|
42
43
|
...props
|
|
43
44
|
});
|
|
44
45
|
});
|
|
45
46
|
const ToastClose = forwardRef(function ToastClose({ className, ...props }, ref) {
|
|
46
47
|
return /* @__PURE__ */ jsx(Toast.Close, {
|
|
47
48
|
ref,
|
|
48
|
-
className:
|
|
49
|
+
className: (state) => cx(toast_module_default.close, resolveClassName(className, state)),
|
|
49
50
|
...props
|
|
50
51
|
});
|
|
51
52
|
});
|
|
52
53
|
const ToastViewportPart = forwardRef(function ToastViewportPart({ className, ...props }, ref) {
|
|
53
54
|
return /* @__PURE__ */ jsx(Toast.Viewport, {
|
|
54
55
|
ref,
|
|
55
|
-
className:
|
|
56
|
+
className: (state) => cx(toast_module_default.viewport, resolveClassName(className, state)),
|
|
56
57
|
...props
|
|
57
58
|
});
|
|
58
59
|
});
|
package/dist/toast/parts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","names":["BaseToast","styles"],"sources":["../../src/toast/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Toast.\n *\n * @example\n * ```tsx\n * import { Toast } from '@base-ui/react/toast';\n * import { ToastRoot, ToastTitle, ToastDescription, ToastClose } from '@brijbyte/agentic-ui/toast';\n *\n * // Inside a Toast.Viewport or custom viewport:\n * manager.toasts.map((toast) => (\n * <ToastRoot key={toast.id} toast={toast}>\n * <ToastTitle />\n * <ToastDescription />\n * <ToastClose aria-label=\"Dismiss\" />\n * </ToastRoot>\n * ))\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport styles from \"./toast.module.css\";\n\ntype BaseRootProps = ComponentPropsWithoutRef<typeof BaseToast.Root>;\ntype BaseTitleProps = ComponentPropsWithoutRef<typeof BaseToast.Title>;\ntype BaseDescriptionProps = ComponentPropsWithoutRef<typeof BaseToast.Description>;\ntype BaseCloseProps = ComponentPropsWithoutRef<typeof BaseToast.Close>;\ntype BaseViewportProps = ComponentPropsWithoutRef<typeof BaseToast.Viewport>;\n\nexport interface ToastRootProps extends
|
|
1
|
+
{"version":3,"file":"parts.js","names":["BaseToast","styles"],"sources":["../../src/toast/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Toast.\n *\n * @example\n * ```tsx\n * import { Toast } from '@base-ui/react/toast';\n * import { ToastRoot, ToastTitle, ToastDescription, ToastClose } from '@brijbyte/agentic-ui/toast';\n *\n * // Inside a Toast.Viewport or custom viewport:\n * manager.toasts.map((toast) => (\n * <ToastRoot key={toast.id} toast={toast}>\n * <ToastTitle />\n * <ToastDescription />\n * <ToastClose aria-label=\"Dismiss\" />\n * </ToastRoot>\n * ))\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport styles from \"./toast.module.css\";\nimport { resolveClassName, cx } from \"../utils/resolveClassName\";\n\ntype BaseRootProps = ComponentPropsWithoutRef<typeof BaseToast.Root>;\ntype BaseTitleProps = ComponentPropsWithoutRef<typeof BaseToast.Title>;\ntype BaseDescriptionProps = ComponentPropsWithoutRef<typeof BaseToast.Description>;\ntype BaseCloseProps = ComponentPropsWithoutRef<typeof BaseToast.Close>;\ntype BaseViewportProps = ComponentPropsWithoutRef<typeof BaseToast.Viewport>;\n\nexport interface ToastRootProps extends BaseRootProps {}\nexport interface ToastTitleProps extends BaseTitleProps {}\nexport interface ToastDescriptionProps extends BaseDescriptionProps {}\nexport interface ToastCloseProps extends BaseCloseProps {}\nexport interface ToastViewportPartProps extends BaseViewportProps {}\n\nexport const ToastRoot = forwardRef<ComponentRef<typeof BaseToast.Root>, ToastRootProps>(function ToastRoot({ className, ...props }, ref) {\n return <BaseToast.Root ref={ref} className={(state) => cx(styles.toast, resolveClassName(className, state))} {...props} />;\n});\n\nexport const ToastTitle = forwardRef<ComponentRef<typeof BaseToast.Title>, ToastTitleProps>(function ToastTitle(\n { className, ...props },\n ref,\n) {\n return <BaseToast.Title ref={ref} className={(state) => cx(styles.title, resolveClassName(className, state))} {...props} />;\n});\n\nexport const ToastDescription = forwardRef<ComponentRef<typeof BaseToast.Description>, ToastDescriptionProps>(function ToastDescription(\n { className, ...props },\n ref,\n) {\n return <BaseToast.Description ref={ref} className={(state) => cx(styles.description, resolveClassName(className, state))} {...props} />;\n});\n\nexport const ToastClose = forwardRef<ComponentRef<typeof BaseToast.Close>, ToastCloseProps>(function ToastClose(\n { className, ...props },\n ref,\n) {\n return <BaseToast.Close ref={ref} className={(state) => cx(styles.close, resolveClassName(className, state))} {...props} />;\n});\n\nexport const ToastViewportPart = forwardRef<ComponentRef<typeof BaseToast.Viewport>, ToastViewportPartProps>(function ToastViewportPart(\n { className, ...props },\n ref,\n) {\n return <BaseToast.Viewport ref={ref} className={(state) => cx(styles.viewport, resolveClassName(className, state))} {...props} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,YAAY,WAAgE,SAAS,UAAU,EAAE,WAAW,GAAG,SAAS,KAAK;AACxI,QAAO,oBAACA,MAAU,MAAX;EAAqB;EAAK,YAAY,UAAU,GAAGC,qBAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC1H;AAEF,MAAa,aAAa,WAAkE,SAAS,WACnG,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,MAAU,OAAX;EAAsB;EAAK,YAAY,UAAU,GAAGC,qBAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC3H;AAEF,MAAa,mBAAmB,WAA8E,SAAS,iBACrH,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,MAAU,aAAX;EAA4B;EAAK,YAAY,UAAU,GAAGC,qBAAO,aAAa,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EACvI;AAEF,MAAa,aAAa,WAAkE,SAAS,WACnG,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,MAAU,OAAX;EAAsB;EAAK,YAAY,UAAU,GAAGC,qBAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC3H;AAEF,MAAa,oBAAoB,WAA4E,SAAS,kBACpH,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,MAAU,UAAX;EAAyB;EAAK,YAAY,UAAU,GAAGC,qBAAO,UAAU,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EACjI"}
|
package/dist/tooltip/parts.d.ts
CHANGED
|
@@ -6,15 +6,9 @@ import { Tooltip } from "@base-ui/react/tooltip";
|
|
|
6
6
|
type BasePositionerProps = ComponentPropsWithoutRef<typeof Tooltip.Positioner>;
|
|
7
7
|
type BasePopupProps = ComponentPropsWithoutRef<typeof Tooltip.Popup>;
|
|
8
8
|
type BaseArrowProps = ComponentPropsWithoutRef<typeof Tooltip.Arrow>;
|
|
9
|
-
interface TooltipPositionerProps extends
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
interface TooltipPopupProps extends Omit<BasePopupProps, "className"> {
|
|
13
|
-
className?: string;
|
|
14
|
-
}
|
|
15
|
-
interface TooltipArrowProps extends Omit<BaseArrowProps, "className"> {
|
|
16
|
-
className?: string;
|
|
17
|
-
}
|
|
9
|
+
interface TooltipPositionerProps extends BasePositionerProps {}
|
|
10
|
+
interface TooltipPopupProps extends BasePopupProps {}
|
|
11
|
+
interface TooltipArrowProps extends BaseArrowProps {}
|
|
18
12
|
declare const TooltipPositioner: react.ForwardRefExoticComponent<TooltipPositionerProps & react.RefAttributes<HTMLDivElement>>;
|
|
19
13
|
declare const TooltipPopup: react.ForwardRefExoticComponent<TooltipPopupProps & react.RefAttributes<HTMLDivElement>>;
|
|
20
14
|
declare const TooltipArrow: react.ForwardRefExoticComponent<TooltipArrowProps & react.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/tooltip/parts.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"parts.d.ts","names":[],"sources":["../../src/tooltip/parts.tsx"],"mappings":";;;;;KA6BK,mBAAA,GAAsB,wBAAA,QAAgC,OAAA,CAAY,UAAA;AAAA,KAClE,cAAA,GAAiB,wBAAA,QAAgC,OAAA,CAAY,KAAA;AAAA,KAC7D,cAAA,GAAiB,wBAAA,QAAgC,OAAA,CAAY,KAAA;AAAA,UAEjD,sBAAA,SAA+B,mBAAA;AAAA,UAC/B,iBAAA,SAA0B,cAAA;AAAA,UAC1B,iBAAA,SAA0B,cAAA;AAAA,cAE9B,iBAAA,EAAiB,KAAA,CAAA,yBAAA,CAAA,sBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAOjB,YAAA,EAAY,KAAA,CAAA,yBAAA,CAAA,iBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAOZ,YAAA,EAAY,KAAA,CAAA,yBAAA,CAAA,iBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA"}
|
package/dist/tooltip/parts.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cx, resolveClassName } from "../utils/resolveClassName.js";
|
|
1
2
|
import tooltip_module_default from "./tooltip.module.js";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { forwardRef } from "react";
|
|
@@ -29,21 +30,21 @@ import { Tooltip } from "@base-ui/react/tooltip";
|
|
|
29
30
|
const TooltipPositioner = forwardRef(function TooltipPositioner({ className, ...props }, ref) {
|
|
30
31
|
return /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
31
32
|
ref,
|
|
32
|
-
className:
|
|
33
|
+
className: (state) => cx(tooltip_module_default.positioner, resolveClassName(className, state)),
|
|
33
34
|
...props
|
|
34
35
|
});
|
|
35
36
|
});
|
|
36
37
|
const TooltipPopup = forwardRef(function TooltipPopup({ className, ...props }, ref) {
|
|
37
38
|
return /* @__PURE__ */ jsx(Tooltip.Popup, {
|
|
38
39
|
ref,
|
|
39
|
-
className:
|
|
40
|
+
className: (state) => cx(tooltip_module_default.popup, resolveClassName(className, state)),
|
|
40
41
|
...props
|
|
41
42
|
});
|
|
42
43
|
});
|
|
43
44
|
const TooltipArrow = forwardRef(function TooltipArrow({ className, ...props }, ref) {
|
|
44
45
|
return /* @__PURE__ */ jsx(Tooltip.Arrow, {
|
|
45
46
|
ref,
|
|
46
|
-
className:
|
|
47
|
+
className: (state) => cx(tooltip_module_default.arrow, resolveClassName(className, state)),
|
|
47
48
|
...props
|
|
48
49
|
});
|
|
49
50
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","names":["BaseTooltip","styles"],"sources":["../../src/tooltip/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Tooltip.\n *\n * @example\n * ```tsx\n * import { Tooltip } from '@base-ui/react/tooltip';\n * import { TooltipPositioner, TooltipPopup, TooltipArrow } from '@brijbyte/agentic-ui/tooltip';\n *\n * <Tooltip.Provider>\n * <Tooltip.Root>\n * <Tooltip.Trigger render={<button>Hover me</button>} />\n * <Tooltip.Portal>\n * <TooltipPositioner side=\"top\" sideOffset={6}>\n * <TooltipPopup>\n * <TooltipArrow />\n * Tooltip content\n * </TooltipPopup>\n * </TooltipPositioner>\n * </Tooltip.Portal>\n * </Tooltip.Root>\n * </Tooltip.Provider>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport styles from \"./tooltip.module.css\";\n\ntype BasePositionerProps = ComponentPropsWithoutRef<typeof BaseTooltip.Positioner>;\ntype BasePopupProps = ComponentPropsWithoutRef<typeof BaseTooltip.Popup>;\ntype BaseArrowProps = ComponentPropsWithoutRef<typeof BaseTooltip.Arrow>;\n\nexport interface TooltipPositionerProps extends
|
|
1
|
+
{"version":3,"file":"parts.js","names":["BaseTooltip","styles"],"sources":["../../src/tooltip/parts.tsx"],"sourcesContent":["/**\n * Styled primitives for Tooltip.\n *\n * @example\n * ```tsx\n * import { Tooltip } from '@base-ui/react/tooltip';\n * import { TooltipPositioner, TooltipPopup, TooltipArrow } from '@brijbyte/agentic-ui/tooltip';\n *\n * <Tooltip.Provider>\n * <Tooltip.Root>\n * <Tooltip.Trigger render={<button>Hover me</button>} />\n * <Tooltip.Portal>\n * <TooltipPositioner side=\"top\" sideOffset={6}>\n * <TooltipPopup>\n * <TooltipArrow />\n * Tooltip content\n * </TooltipPopup>\n * </TooltipPositioner>\n * </Tooltip.Portal>\n * </Tooltip.Root>\n * </Tooltip.Provider>\n * ```\n */\nimport { forwardRef } from \"react\";\nimport type { ComponentRef, ComponentPropsWithoutRef } from \"react\";\nimport { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport styles from \"./tooltip.module.css\";\nimport { resolveClassName, cx } from \"../utils/resolveClassName\";\n\ntype BasePositionerProps = ComponentPropsWithoutRef<typeof BaseTooltip.Positioner>;\ntype BasePopupProps = ComponentPropsWithoutRef<typeof BaseTooltip.Popup>;\ntype BaseArrowProps = ComponentPropsWithoutRef<typeof BaseTooltip.Arrow>;\n\nexport interface TooltipPositionerProps extends BasePositionerProps {}\nexport interface TooltipPopupProps extends BasePopupProps {}\nexport interface TooltipArrowProps extends BaseArrowProps {}\n\nexport const TooltipPositioner = forwardRef<ComponentRef<typeof BaseTooltip.Positioner>, TooltipPositionerProps>(function TooltipPositioner(\n { className, ...props },\n ref,\n) {\n return <BaseTooltip.Positioner ref={ref} className={(state) => cx(styles.positioner, resolveClassName(className, state))} {...props} />;\n});\n\nexport const TooltipPopup = forwardRef<ComponentRef<typeof BaseTooltip.Popup>, TooltipPopupProps>(function TooltipPopup(\n { className, ...props },\n ref,\n) {\n return <BaseTooltip.Popup ref={ref} className={(state) => cx(styles.popup, resolveClassName(className, state))} {...props} />;\n});\n\nexport const TooltipArrow = forwardRef<ComponentRef<typeof BaseTooltip.Arrow>, TooltipArrowProps>(function TooltipArrow(\n { className, ...props },\n ref,\n) {\n return <BaseTooltip.Arrow ref={ref} className={(state) => cx(styles.arrow, resolveClassName(className, state))} {...props} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAa,oBAAoB,WAAgF,SAAS,kBACxH,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACA,QAAY,YAAb;EAA6B;EAAK,YAAY,UAAU,GAAGC,uBAAO,YAAY,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EACvI;AAEF,MAAa,eAAe,WAAsE,SAAS,aACzG,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,QAAY,OAAb;EAAwB;EAAK,YAAY,UAAU,GAAGC,uBAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC7H;AAEF,MAAa,eAAe,WAAsE,SAAS,aACzG,EAAE,WAAW,GAAG,SAChB,KACA;AACA,QAAO,oBAACD,QAAY,OAAb;EAAwB;EAAK,YAAY,UAAU,GAAGC,uBAAO,OAAO,iBAAiB,WAAW,MAAM,CAAC;EAAE,GAAI;EAAS,CAAA;EAC7H"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/utils/resolveClassName.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a base-ui className prop (string | function | undefined) into a string.
|
|
4
|
+
* When the className is a function, it is called with the component state.
|
|
5
|
+
* Used by styled parts to merge our fixed style class with the consumer's className.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* // In a styled part, prepend our class while preserving function className support:
|
|
10
|
+
* className={(state) => cx(styles.root, resolveClassName(className, state))}
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
function resolveClassName(className, state) {
|
|
14
|
+
return typeof className === "function" ? className(state) : className;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Joins class name strings, filtering out falsy values.
|
|
18
|
+
*/
|
|
19
|
+
function cx(...classes) {
|
|
20
|
+
return classes.filter(Boolean).join(" ");
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { cx, resolveClassName };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=resolveClassName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveClassName.js","names":[],"sources":["../../src/utils/resolveClassName.ts"],"sourcesContent":["/**\n * Resolves a base-ui className prop (string | function | undefined) into a string.\n * When the className is a function, it is called with the component state.\n * Used by styled parts to merge our fixed style class with the consumer's className.\n *\n * @example\n * ```tsx\n * // In a styled part, prepend our class while preserving function className support:\n * className={(state) => cx(styles.root, resolveClassName(className, state))}\n * ```\n */\nexport function resolveClassName<State>(\n className: string | ((state: State) => string | undefined) | undefined,\n state: State,\n): string | undefined {\n return typeof className === \"function\" ? className(state) : className;\n}\n\n/**\n * Joins class name strings, filtering out falsy values.\n */\nexport function cx(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,iBACd,WACA,OACoB;AACpB,QAAO,OAAO,cAAc,aAAa,UAAU,MAAM,GAAG;;;;;AAM9D,SAAgB,GAAG,GAAG,SAAwD;AAC5E,QAAO,QAAQ,OAAO,QAAQ,CAAC,KAAK,IAAI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brijbyte/agentic-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"./layer-order": "./dist/layer-order.css",
|
|
29
29
|
"./tokens": "./dist/tokens.css",
|
|
30
30
|
"./reset": "./dist/reset.css",
|
|
31
|
+
"./reset-scoped": "./dist/reset-scoped.css",
|
|
31
32
|
"./tailwind-theme": "./dist/tailwind-theme.css",
|
|
32
33
|
"./alert-dialog": {
|
|
33
34
|
"import": "./dist/alert-dialog/index.js",
|
|
@@ -163,8 +164,8 @@
|
|
|
163
164
|
"@base-ui/react": "^1.3.0"
|
|
164
165
|
},
|
|
165
166
|
"devDependencies": {
|
|
166
|
-
"@types/react": "^19.
|
|
167
|
-
"@types/react-dom": "^19.
|
|
167
|
+
"@types/react": "^19.2.14",
|
|
168
|
+
"@types/react-dom": "^19.2.3"
|
|
168
169
|
},
|
|
169
170
|
"peerDependencies": {
|
|
170
171
|
"react": "^19.0.0",
|
package/src/accordion/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Accordion } from "./accordion";
|
|
2
2
|
export type { AccordionProps, AccordionItem } from "./accordion";
|
|
3
3
|
|
|
4
|
-
export {
|
|
4
|
+
export { AccordionItemPart, AccordionHeader, AccordionTrigger, AccordionPanel } from "./parts";
|
|
5
5
|
export type { AccordionItemProps, AccordionHeaderProps, AccordionTriggerProps, AccordionPanelProps } from "./parts";
|
|
6
6
|
export { AccordionStyles } from "./accordion";
|
package/src/accordion/parts.tsx
CHANGED
|
@@ -20,49 +20,42 @@ import { forwardRef } from "react";
|
|
|
20
20
|
import type { ComponentRef, ComponentPropsWithoutRef } from "react";
|
|
21
21
|
import { Accordion as BaseAccordion } from "@base-ui/react/accordion";
|
|
22
22
|
import styles from "./accordion.module.css";
|
|
23
|
+
import { resolveClassName, cx } from "../utils/resolveClassName";
|
|
23
24
|
|
|
24
25
|
type BaseItemProps = ComponentPropsWithoutRef<typeof BaseAccordion.Item>;
|
|
25
26
|
type BaseHeaderProps = ComponentPropsWithoutRef<typeof BaseAccordion.Header>;
|
|
26
27
|
type BaseTriggerProps = ComponentPropsWithoutRef<typeof BaseAccordion.Trigger>;
|
|
27
28
|
type BasePanelProps = ComponentPropsWithoutRef<typeof BaseAccordion.Panel>;
|
|
28
29
|
|
|
29
|
-
export interface AccordionItemProps extends
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
export interface
|
|
33
|
-
className?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface AccordionTriggerProps extends Omit<BaseTriggerProps, "className"> {
|
|
36
|
-
className?: string;
|
|
37
|
-
}
|
|
38
|
-
export interface AccordionPanelProps extends Omit<BasePanelProps, "className"> {
|
|
39
|
-
className?: string;
|
|
40
|
-
}
|
|
30
|
+
export interface AccordionItemProps extends BaseItemProps {}
|
|
31
|
+
export interface AccordionHeaderProps extends BaseHeaderProps {}
|
|
32
|
+
export interface AccordionTriggerProps extends BaseTriggerProps {}
|
|
33
|
+
export interface AccordionPanelProps extends BasePanelProps {}
|
|
41
34
|
|
|
42
|
-
export const
|
|
35
|
+
export const AccordionItemPart = forwardRef<ComponentRef<typeof BaseAccordion.Item>, AccordionItemProps>(function AccordionItemPart(
|
|
43
36
|
{ className, ...props },
|
|
44
37
|
ref,
|
|
45
38
|
) {
|
|
46
|
-
return <BaseAccordion.Item ref={ref} className={
|
|
39
|
+
return <BaseAccordion.Item ref={ref} className={(state) => cx(styles.item, resolveClassName(className, state))} {...props} />;
|
|
47
40
|
});
|
|
48
41
|
|
|
49
42
|
export const AccordionHeader = forwardRef<ComponentRef<typeof BaseAccordion.Header>, AccordionHeaderProps>(function AccordionHeader(
|
|
50
43
|
{ className, ...props },
|
|
51
44
|
ref,
|
|
52
45
|
) {
|
|
53
|
-
return <BaseAccordion.Header ref={ref} className={
|
|
46
|
+
return <BaseAccordion.Header ref={ref} className={(state) => cx(styles.header, resolveClassName(className, state))} {...props} />;
|
|
54
47
|
});
|
|
55
48
|
|
|
56
49
|
export const AccordionTrigger = forwardRef<ComponentRef<typeof BaseAccordion.Trigger>, AccordionTriggerProps>(function AccordionTrigger(
|
|
57
50
|
{ className, ...props },
|
|
58
51
|
ref,
|
|
59
52
|
) {
|
|
60
|
-
return <BaseAccordion.Trigger ref={ref} className={
|
|
53
|
+
return <BaseAccordion.Trigger ref={ref} className={(state) => cx(styles.trigger, resolveClassName(className, state))} {...props} />;
|
|
61
54
|
});
|
|
62
55
|
|
|
63
56
|
export const AccordionPanel = forwardRef<ComponentRef<typeof BaseAccordion.Panel>, AccordionPanelProps>(function AccordionPanel(
|
|
64
57
|
{ className, ...props },
|
|
65
58
|
ref,
|
|
66
59
|
) {
|
|
67
|
-
return <BaseAccordion.Panel ref={ref} className={
|
|
60
|
+
return <BaseAccordion.Panel ref={ref} className={(state) => cx(styles.panel, resolveClassName(className, state))} {...props} />;
|
|
68
61
|
});
|
|
@@ -3,52 +3,42 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @example
|
|
5
5
|
* ```tsx
|
|
6
|
-
* import { AlertDialog
|
|
7
|
-
* import { Button } from '@brijbyte/agentic-ui/button';
|
|
6
|
+
* import { AlertDialog } from '@base-ui/react/alert-dialog';
|
|
8
7
|
* import { AlertDialogBackdrop, AlertDialogPopup, AlertDialogTitle, AlertDialogDescription } from '@brijbyte/agentic-ui/alert-dialog';
|
|
9
8
|
*
|
|
10
|
-
* <
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
9
|
+
* <AlertDialog.Root>
|
|
10
|
+
* <AlertDialog.Trigger render={<button>Open</button>} />
|
|
11
|
+
* <AlertDialog.Portal>
|
|
13
12
|
* <AlertDialogBackdrop />
|
|
14
|
-
* <
|
|
15
|
-
* <
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* </BaseAlertDialog.Portal>
|
|
23
|
-
* </BaseAlertDialog.Root>
|
|
13
|
+
* <AlertDialog.Viewport>
|
|
14
|
+
* <AlertDialogPopup>
|
|
15
|
+
* <AlertDialogTitle>Confirm</AlertDialogTitle>
|
|
16
|
+
* <AlertDialogDescription>Are you sure?</AlertDialogDescription>
|
|
17
|
+
* </AlertDialogPopup>
|
|
18
|
+
* </AlertDialog.Viewport>
|
|
19
|
+
* </AlertDialog.Portal>
|
|
20
|
+
* </AlertDialog.Root>
|
|
24
21
|
* ```
|
|
25
22
|
*/
|
|
26
23
|
import { forwardRef } from "react";
|
|
27
24
|
import type { ComponentRef, ComponentPropsWithoutRef } from "react";
|
|
28
25
|
import { AlertDialog as BaseAlertDialog } from "@base-ui/react/alert-dialog";
|
|
29
26
|
import styles from "./alert-dialog.module.css";
|
|
27
|
+
import { resolveClassName, cx } from "../utils/resolveClassName";
|
|
30
28
|
|
|
31
29
|
type BaseBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;
|
|
32
30
|
type BasePopupProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup>;
|
|
33
31
|
type BaseTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;
|
|
34
32
|
type BaseDescriptionProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Description>;
|
|
35
33
|
|
|
36
|
-
export interface AlertDialogBackdropProps extends
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
export interface
|
|
40
|
-
className?: string;
|
|
41
|
-
}
|
|
42
|
-
export interface AlertDialogTitleProps extends Omit<BaseTitleProps, "className"> {
|
|
43
|
-
className?: string;
|
|
44
|
-
}
|
|
45
|
-
export interface AlertDialogDescriptionProps extends Omit<BaseDescriptionProps, "className"> {
|
|
46
|
-
className?: string;
|
|
47
|
-
}
|
|
34
|
+
export interface AlertDialogBackdropProps extends BaseBackdropProps {}
|
|
35
|
+
export interface AlertDialogPopupProps extends BasePopupProps {}
|
|
36
|
+
export interface AlertDialogTitleProps extends BaseTitleProps {}
|
|
37
|
+
export interface AlertDialogDescriptionProps extends BaseDescriptionProps {}
|
|
48
38
|
|
|
49
39
|
export const AlertDialogBackdrop = forwardRef<ComponentRef<typeof BaseAlertDialog.Backdrop>, AlertDialogBackdropProps>(
|
|
50
40
|
function AlertDialogBackdrop({ className, ...props }, ref) {
|
|
51
|
-
return <BaseAlertDialog.Backdrop ref={ref} className={
|
|
41
|
+
return <BaseAlertDialog.Backdrop ref={ref} className={(state) => cx(styles.backdrop, resolveClassName(className, state))} {...props} />;
|
|
52
42
|
},
|
|
53
43
|
);
|
|
54
44
|
|
|
@@ -56,18 +46,20 @@ export const AlertDialogPopup = forwardRef<ComponentRef<typeof BaseAlertDialog.P
|
|
|
56
46
|
{ className, ...props },
|
|
57
47
|
ref,
|
|
58
48
|
) {
|
|
59
|
-
return <BaseAlertDialog.Popup ref={ref} className={
|
|
49
|
+
return <BaseAlertDialog.Popup ref={ref} className={(state) => cx(styles.popup, resolveClassName(className, state))} {...props} />;
|
|
60
50
|
});
|
|
61
51
|
|
|
62
52
|
export const AlertDialogTitle = forwardRef<ComponentRef<typeof BaseAlertDialog.Title>, AlertDialogTitleProps>(function AlertDialogTitle(
|
|
63
53
|
{ className, ...props },
|
|
64
54
|
ref,
|
|
65
55
|
) {
|
|
66
|
-
return <BaseAlertDialog.Title ref={ref} className={
|
|
56
|
+
return <BaseAlertDialog.Title ref={ref} className={(state) => cx(styles.title, resolveClassName(className, state))} {...props} />;
|
|
67
57
|
});
|
|
68
58
|
|
|
69
59
|
export const AlertDialogDescription = forwardRef<ComponentRef<typeof BaseAlertDialog.Description>, AlertDialogDescriptionProps>(
|
|
70
60
|
function AlertDialogDescription({ className, ...props }, ref) {
|
|
71
|
-
return
|
|
61
|
+
return (
|
|
62
|
+
<BaseAlertDialog.Description ref={ref} className={(state) => cx(styles.description, resolveClassName(className, state))} {...props} />
|
|
63
|
+
);
|
|
72
64
|
},
|
|
73
65
|
);
|
package/src/checkbox/parts.tsx
CHANGED
|
@@ -18,15 +18,13 @@ import { forwardRef } from "react";
|
|
|
18
18
|
import type { ComponentRef, ComponentPropsWithoutRef, ReactNode } from "react";
|
|
19
19
|
import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox";
|
|
20
20
|
import styles from "./checkbox.module.css";
|
|
21
|
+
import { resolveClassName, cx } from "../utils/resolveClassName";
|
|
21
22
|
|
|
22
23
|
type BaseRootProps = ComponentPropsWithoutRef<typeof BaseCheckbox.Root>;
|
|
23
24
|
type BaseIndicatorProps = ComponentPropsWithoutRef<typeof BaseCheckbox.Indicator>;
|
|
24
25
|
|
|
25
|
-
export interface CheckboxRootProps extends
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
export interface CheckboxIndicatorProps extends Omit<BaseIndicatorProps, "className"> {
|
|
29
|
-
className?: string;
|
|
26
|
+
export interface CheckboxRootProps extends BaseRootProps {}
|
|
27
|
+
export interface CheckboxIndicatorProps extends BaseIndicatorProps {
|
|
30
28
|
/** Custom icon rendered inside the indicator. Defaults to an SVG checkmark. */
|
|
31
29
|
children?: ReactNode;
|
|
32
30
|
}
|
|
@@ -35,7 +33,7 @@ export const CheckboxRoot = forwardRef<ComponentRef<typeof BaseCheckbox.Root>, C
|
|
|
35
33
|
{ className, ...props },
|
|
36
34
|
ref,
|
|
37
35
|
) {
|
|
38
|
-
return <BaseCheckbox.Root ref={ref} className={
|
|
36
|
+
return <BaseCheckbox.Root ref={ref} className={(state) => cx(styles.indicator, resolveClassName(className, state))} {...props} />;
|
|
39
37
|
});
|
|
40
38
|
|
|
41
39
|
export const CheckboxIndicator = forwardRef<ComponentRef<typeof BaseCheckbox.Indicator>, CheckboxIndicatorProps>(function CheckboxIndicator(
|
|
@@ -43,7 +41,7 @@ export const CheckboxIndicator = forwardRef<ComponentRef<typeof BaseCheckbox.Ind
|
|
|
43
41
|
ref,
|
|
44
42
|
) {
|
|
45
43
|
return (
|
|
46
|
-
<BaseCheckbox.Indicator ref={ref} className={
|
|
44
|
+
<BaseCheckbox.Indicator ref={ref} className={(state) => cx(styles.icon, resolveClassName(className, state))} {...props}>
|
|
47
45
|
{children ?? (
|
|
48
46
|
<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
49
47
|
<path d="M1.5 5L3.5 7.5L8.5 2.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
|