@brosco/ui 0.0.130 → 0.0.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -1 +1 @@
1
- "use client";import{t as e}from"./menu-DOI75GlK.js";import{Fragment as t,createContext as n,useContext as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=n(null),s=({link:e=e=>/* @__PURE__ */ i(`a`,{...e}),pathname:t=`/`,children:n})=>/* @__PURE__ */ i(o,{value:{link:e,pathname:t},children:n}),c=()=>{let e=r(o);if(!e)throw Error(`useUIContext must be used within UIProvider`);return e},l=({menu:n,...r})=>{let{link:o,pathname:s}=c();return/* @__PURE__ */ a(e.Root,{children:[/* @__PURE__ */ i(e.Trigger,{...r}),/* @__PURE__ */ i(e.Portal,{children:/* @__PURE__ */ i(e.Positioner,{children:/* @__PURE__ */ i(e.Popup,{children:n.map(({items:r,groupLabel:c},l)=>/* @__PURE__ */ a(t,{children:[/* @__PURE__ */ a(e.Group,{children:[c&&/* @__PURE__ */ i(e.GroupLabel,{children:c}),r.map(({label:t,isDanger:n,icon:r,href:c,disabled:l,onClick:u})=>/* @__PURE__ */ a(e.Item,{disabled:l,isActive:s===c,isDanger:n,render:c?/* @__PURE__ */ i(o,{href:c}):void 0,onClick:u,children:[r,t]},c||t))]}),n.length-l>1&&/* @__PURE__ */ i(e.Separator,{})]},r[0].label))})})})]})};export{l as DropdownMenu,s as UIProvider,c as useUIContext};
1
+ "use client";import{t as e}from"./menu-CQ1VFBav.js";import{Fragment as t,createContext as n,useContext as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=n(null),s=({link:e=e=>/* @__PURE__ */ i(`a`,{...e}),pathname:t=`/`,children:n})=>/* @__PURE__ */ i(o,{value:{link:e,pathname:t},children:n}),c=()=>{let e=r(o);if(!e)throw Error(`useUIContext must be used within UIProvider`);return e},l=({menu:n,...r})=>{let{link:o,pathname:s}=c();return/* @__PURE__ */ a(e.Root,{children:[/* @__PURE__ */ i(e.Trigger,{...r}),/* @__PURE__ */ i(e.Portal,{children:/* @__PURE__ */ i(e.Positioner,{children:/* @__PURE__ */ i(e.Popup,{children:n.map(({items:r,groupLabel:c},l)=>/* @__PURE__ */ a(t,{children:[/* @__PURE__ */ a(e.Group,{children:[c&&/* @__PURE__ */ i(e.GroupLabel,{children:c}),r.map(({label:t,isDanger:n,icon:r,href:c,disabled:l,onClick:u})=>/* @__PURE__ */ a(e.Item,{disabled:l,isActive:s===c,isDanger:n,render:c?/* @__PURE__ */ i(o,{href:c}):void 0,onClick:u,children:[r,t]},c||t))]}),n.length-l>1&&/* @__PURE__ */ i(e.Separator,{})]},r[0].label))})})})]})};export{l as DropdownMenu,s as UIProvider,c as useUIContext};
@@ -0,0 +1 @@
1
+ import{isValidElement as e}from"react";import{jsx as t}from"react/jsx-runtime";import{Menu as n}from"@base-ui/react";import{cn as r,tv as i}from"tailwind-variants";var a=t=>e(t)&&typeof t.props==`object`&&t.props&&`href`in t.props,o=i({variants:{isActive:{true:`menu--item-active`},isDanger:{true:`menu--item-danger`}}}),s={Positioner:e=>/* @__PURE__ */ t(n.Positioner,{sideOffset:8,...e}),Popup:({className:e,...i})=>/* @__PURE__ */ t(n.Popup,{className:r(`menu--popup`,e),...i}),Separator:({className:e,...i})=>/* @__PURE__ */ t(n.Separator,{className:r(`menu--separator`,e),...i}),Item:({isActive:e,isDanger:i,className:s,disabled:c,render:l,...u})=>{let d=a(l);return/* @__PURE__ */ t(n.Item,{className:r(`menu--item`,o({isActive:e,isDanger:i}),s,e&&`opacity-100`),disabled:e||c,nativeButton:!d,render:l,...u})},Group:({className:e,...i})=>/* @__PURE__ */ t(n.Group,{className:r(`menu--group`,e),...i}),GroupLabel:({className:e,...i})=>/* @__PURE__ */ t(n.GroupLabel,{className:r(`menu--group-label`,e),...i}),Root:n.Root,Trigger:n.Trigger,Portal:n.Portal};export{a as n,s as t};
package/dist/server.js CHANGED
@@ -1 +1 @@
1
- import{n as e,t}from"./menu-DOI75GlK.js";import{Button as n}from"@base-ui/react";import{cn as r}from"cn";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{tv as o}from"tailwind-variants";var s=({className:e,size:t=24,...n})=>/* @__PURE__ */ i(`svg`,{className:r(`spinner`,e),fill:`currentColor`,height:t,stroke:`currentColor`,strokeWidth:`0`,version:`1.1`,viewBox:`0 0 16 16`,width:t,xmlns:`http://www.w3.org/2000/svg`,...n,children:/* @__PURE__ */ i(`path`,{d:`M16 8c-0.020-1.045-0.247-2.086-0.665-3.038-0.417-0.953-1.023-1.817-1.766-2.53s-1.624-1.278-2.578-1.651c-0.953-0.374-1.978-0.552-2.991-0.531-1.013 0.020-2.021 0.24-2.943 0.646-0.923 0.405-1.758 0.992-2.449 1.712s-1.237 1.574-1.597 2.497c-0.361 0.923-0.533 1.914-0.512 2.895 0.020 0.981 0.234 1.955 0.627 2.847 0.392 0.892 0.961 1.7 1.658 2.368s1.523 1.195 2.416 1.543c0.892 0.348 1.851 0.514 2.799 0.493 0.949-0.020 1.89-0.227 2.751-0.608 0.862-0.379 1.642-0.929 2.287-1.604s1.154-1.472 1.488-2.335c0.204-0.523 0.342-1.069 0.415-1.622 0.019 0.001 0.039 0.002 0.059 0.002 0.552 0 1-0.448 1-1 0-0.028-0.001-0.056-0.004-0.083h0.004zM14.411 10.655c-0.367 0.831-0.898 1.584-1.55 2.206s-1.422 1.112-2.254 1.434c-0.832 0.323-1.723 0.476-2.608 0.454-0.884-0.020-1.759-0.215-2.56-0.57-0.801-0.354-1.526-0.867-2.125-1.495s-1.071-1.371-1.38-2.173c-0.31-0.801-0.457-1.66-0.435-2.512s0.208-1.694 0.551-2.464c0.342-0.77 0.836-1.468 1.441-2.044s1.321-1.029 2.092-1.326c0.771-0.298 1.596-0.438 2.416-0.416s1.629 0.202 2.368 0.532c0.74 0.329 1.41 0.805 1.963 1.387s0.988 1.27 1.272 2.011c0.285 0.74 0.418 1.532 0.397 2.32h0.004c-0.002 0.027-0.004 0.055-0.004 0.083 0 0.516 0.39 0.94 0.892 0.994-0.097 0.544-0.258 1.075-0.481 1.578z`})}),c=o({base:`button`,variants:{variant:{solid:`button--solid`,bordered:`button--bordered`,light:`button--light`},color:{primary:`button--primary`,secondary:`button--secondary`,success:`button--success`,danger:`button--danger`},rounded:{full:`rounded-full`,lg:`rounded-lg`,md:`rounded-md`,sm:`rounded-sm`,none:`rounded-none`},size:{sm:`button--sm`,md:`button--md`,lg:`button--lg`},isIconOnly:{true:`button--icon-only`,false:`px-4`},fullWidth:{true:`w-full`}},defaultVariants:{variant:`light`,color:`primary`,rounded:`lg`,size:`md`}}),l=o({extend:c,defaultVariants:{variant:`solid`}}),u=({children:t,className:o,render:u,icon:d,isPending:f,disabled:p,variant:m,color:h,rounded:g,size:_,isIconOnly:v,fullWidth:y,...b})=>{let x={variant:m,color:h,rounded:g,size:_,isIconOnly:v,fullWidth:y},S=e(u);return/* @__PURE__ */ a(n,{className:r(S?c(x):l(x),o),disabled:f||p,nativeButton:!S,render:u,...b,children:[f?/* @__PURE__ */ i(s,{}):d,!v&&t]})};export{u as Button,t as Menu,s as Spinner};
1
+ import{n as e,t}from"./menu-CQ1VFBav.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{Button as i}from"@base-ui/react";import{tv as a}from"tailwind-variants";import{cn as o}from"cn";var s=({className:e,size:t=24,...r})=>/* @__PURE__ */ n(`svg`,{className:o(`spinner`,e),fill:`currentColor`,height:t,stroke:`currentColor`,strokeWidth:`0`,version:`1.1`,viewBox:`0 0 16 16`,width:t,xmlns:`http://www.w3.org/2000/svg`,...r,children:/* @__PURE__ */ n(`path`,{d:`M16 8c-0.020-1.045-0.247-2.086-0.665-3.038-0.417-0.953-1.023-1.817-1.766-2.53s-1.624-1.278-2.578-1.651c-0.953-0.374-1.978-0.552-2.991-0.531-1.013 0.020-2.021 0.24-2.943 0.646-0.923 0.405-1.758 0.992-2.449 1.712s-1.237 1.574-1.597 2.497c-0.361 0.923-0.533 1.914-0.512 2.895 0.020 0.981 0.234 1.955 0.627 2.847 0.392 0.892 0.961 1.7 1.658 2.368s1.523 1.195 2.416 1.543c0.892 0.348 1.851 0.514 2.799 0.493 0.949-0.020 1.89-0.227 2.751-0.608 0.862-0.379 1.642-0.929 2.287-1.604s1.154-1.472 1.488-2.335c0.204-0.523 0.342-1.069 0.415-1.622 0.019 0.001 0.039 0.002 0.059 0.002 0.552 0 1-0.448 1-1 0-0.028-0.001-0.056-0.004-0.083h0.004zM14.411 10.655c-0.367 0.831-0.898 1.584-1.55 2.206s-1.422 1.112-2.254 1.434c-0.832 0.323-1.723 0.476-2.608 0.454-0.884-0.020-1.759-0.215-2.56-0.57-0.801-0.354-1.526-0.867-2.125-1.495s-1.071-1.371-1.38-2.173c-0.31-0.801-0.457-1.66-0.435-2.512s0.208-1.694 0.551-2.464c0.342-0.77 0.836-1.468 1.441-2.044s1.321-1.029 2.092-1.326c0.771-0.298 1.596-0.438 2.416-0.416s1.629 0.202 2.368 0.532c0.74 0.329 1.41 0.805 1.963 1.387s0.988 1.27 1.272 2.011c0.285 0.74 0.418 1.532 0.397 2.32h0.004c-0.002 0.027-0.004 0.055-0.004 0.083 0 0.516 0.39 0.94 0.892 0.994-0.097 0.544-0.258 1.075-0.481 1.578z`})}),c=a({base:`button`,variants:{variant:{solid:`button--solid`,bordered:`button--bordered`,light:`button--light`},color:{primary:`button--primary`,secondary:`button--secondary`,success:`button--success`,danger:`button--danger`},rounded:{full:`rounded-full`,lg:`rounded-lg`,md:`rounded-md`,sm:`rounded-sm`,none:`rounded-none`},size:{sm:`button--sm`,md:`button--md`,lg:`button--lg`},isIconOnly:{true:`button--icon-only`,false:`px-4`},fullWidth:{true:`w-full`}},defaultVariants:{variant:`light`,color:`primary`,rounded:`lg`,size:`md`}}),l=a({extend:c,defaultVariants:{variant:`solid`}}),u=({children:t,className:a,render:u,icon:d,isPending:f,disabled:p,variant:m,color:h,rounded:g,size:_,isIconOnly:v,fullWidth:y,...b})=>{let x={variant:m,color:h,rounded:g,size:_,isIconOnly:v,fullWidth:y},S=e(u);return/* @__PURE__ */ r(i,{className:o(S?c(x):l(x),a),disabled:f||p,nativeButton:!S,render:u,...b,children:[f?/* @__PURE__ */ n(s,{}):d,!v&&t]})};export{u as Button,t as Menu,s as Spinner};
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@brosco/ui",
3
- "version": "0.0.130",
3
+ "version": "0.0.131",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./dist/server.d.ts",
11
- "import": "./dist/server.js"
12
- },
13
- "./client": {
14
10
  "types": "./dist/client.d.ts",
15
11
  "import": "./dist/client.js"
16
12
  },
13
+ "./rsc": {
14
+ "types": "./dist/server.d.ts",
15
+ "import": "./dist/server.js"
16
+ },
17
17
  "./styles.css": "./dist/styles.css"
18
18
  },
19
19
  "scripts": {
@@ -1 +0,0 @@
1
- import{Menu as e}from"@base-ui/react";import{isValidElement as t}from"react";import{jsx as n}from"react/jsx-runtime";import{cn as r,tv as i}from"tailwind-variants";var a=e=>t(e)&&typeof e.props==`object`&&e.props&&`href`in e.props,o=i({variants:{isActive:{true:`menu--item-active`},isDanger:{true:`menu--item-danger`}}}),s={Positioner:t=>/* @__PURE__ */ n(e.Positioner,{sideOffset:8,...t}),Popup:({className:t,...i})=>/* @__PURE__ */ n(e.Popup,{className:r(`menu--popup`,t),...i}),Separator:({className:t,...i})=>/* @__PURE__ */ n(e.Separator,{className:r(`menu--separator`,t),...i}),Item:({isActive:t,isDanger:i,className:s,disabled:c,render:l,...u})=>{let d=a(l);return/* @__PURE__ */ n(e.Item,{className:r(`menu--item`,o({isActive:t,isDanger:i}),s,t&&`opacity-100`),disabled:t||c,nativeButton:!d,render:l,...u})},Group:({className:t,...i})=>/* @__PURE__ */ n(e.Group,{className:r(`menu--group`,t),...i}),GroupLabel:({className:t,...i})=>/* @__PURE__ */ n(e.GroupLabel,{className:r(`menu--group-label`,t),...i}),Root:e.Root,Trigger:e.Trigger,Portal:e.Portal};export{a as n,s as t};