@alkimi.org/ui-kit 0.13.1 → 0.13.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alkimi.org/ui-kit",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "packageManager": "pnpm@10.26.0",
5
5
  "description": "A React component library built with shadcn/ui and Tailwind CSS",
6
6
  "main": "./dist/index.js",
@@ -1,3 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
2
- var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _reacttabs = require('@radix-ui/react-tabs'); var e = _interopRequireWildcard(_reacttabs);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var C=e.Root,y= exports.b =_react.forwardRef.call(void 0, ({className:r,...s},t)=>{let[l,d]=_react.useState.call(void 0, {left:0,width:0}),n=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{let i=()=>{if(!n.current)return;let f=n.current.querySelector('[data-state="active"]');if(f){let v=n.current.getBoundingClientRect(),m=f.getBoundingClientRect();d({left:m.left-v.left,width:m.width})}};i();let u=new MutationObserver(i);return n.current&&u.observe(n.current,{attributes:!0,attributeFilter:["data-state"],subtree:!0}),window.addEventListener("resize",i),()=>{u.disconnect(),window.removeEventListener("resize",i)}},[]);let b=_react.useCallback.call(void 0, i=>{n.current=i,typeof t=="function"?t(i):t&&(t.current=i)},[t]);return _jsxruntime.jsxs.call(void 0, e.List,{ref:b,className:_chunkFUYXCJOQjs.a.call(void 0, "relative inline-flex items-center justify-center rounded-4xl bg-muted p-1 gap-1 text-muted-foreground",r),...s,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute h-[calc(100%-0.5rem)] rounded-4xl bg-background shadow-sm transition-all duration-200 ease-out",style:{left:`${l.left}px`,width:`${l.width}px`}}),s.children]})});y.displayName=e.List.displayName;var P=_react.forwardRef.call(void 0, ({className:r,...s},t)=>_jsxruntime.jsx.call(void 0, e.Trigger,{ref:t,className:_chunkFUYXCJOQjs.a.call(void 0, "cursor-pointer relative inline-flex items-center justify-center whitespace-nowrap data-[state=inactive]:not-disabled:hover:bg-secondary rounded-4xl px-3 py-1 text-sm font-medium ring-offset-background transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=active]:text-foreground z-10",r),...s}));P.displayName=e.Trigger.displayName;var w=_react.forwardRef.call(void 0, ({className:r,...s},t)=>_jsxruntime.jsx.call(void 0, e.Content,{ref:t,className:_chunkFUYXCJOQjs.a.call(void 0, "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...s}));w.displayName=e.Content.displayName;exports.a = C; exports.b = y; exports.c = P; exports.d = w;
3
- //# sourceMappingURL=chunk-VBPIXXIA.js.map
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a}from"./chunk-S5TKCF6T.mjs";import*as e from"@radix-ui/react-tabs";import{forwardRef as o,useCallback as p,useEffect as g,useRef as T,useState as R}from"react";import{jsx as c,jsxs as h}from"react/jsx-runtime";var C=e.Root,y=o(({className:r,...s},t)=>{let[l,d]=R({left:0,width:0}),n=T(null);g(()=>{let i=()=>{if(!n.current)return;let f=n.current.querySelector('[data-state="active"]');if(f){let v=n.current.getBoundingClientRect(),m=f.getBoundingClientRect();d({left:m.left-v.left,width:m.width})}};i();let u=new MutationObserver(i);return n.current&&u.observe(n.current,{attributes:!0,attributeFilter:["data-state"],subtree:!0}),window.addEventListener("resize",i),()=>{u.disconnect(),window.removeEventListener("resize",i)}},[]);let b=p(i=>{n.current=i,typeof t=="function"?t(i):t&&(t.current=i)},[t]);return h(e.List,{ref:b,className:a("relative inline-flex items-center justify-center rounded-4xl bg-muted p-1 gap-1 text-muted-foreground",r),...s,children:[c("span",{className:"absolute h-[calc(100%-0.5rem)] rounded-4xl bg-background shadow-sm transition-all duration-200 ease-out",style:{left:`${l.left}px`,width:`${l.width}px`}}),s.children]})});y.displayName=e.List.displayName;var P=o(({className:r,...s},t)=>c(e.Trigger,{ref:t,className:a("cursor-pointer relative inline-flex items-center justify-center whitespace-nowrap data-[state=inactive]:not-disabled:hover:bg-secondary rounded-4xl px-3 py-1 text-sm font-medium ring-offset-background transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=active]:text-foreground z-10",r),...s}));P.displayName=e.Trigger.displayName;var w=o(({className:r,...s},t)=>c(e.Content,{ref:t,className:a("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...s}));w.displayName=e.Content.displayName;export{C as a,y as b,P as c,w as d};
3
- //# sourceMappingURL=chunk-WZ5F5VT3.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/tabs.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\nimport { forwardRef, useCallback, useEffect, useRef, useState } from \"react\"\n\nconst Tabs = TabsPrimitive.Root\n\nconst TabsList = forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const [indicatorStyle, setIndicatorStyle] = useState({\n left: 0,\n width: 0,\n })\n const listRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const updateIndicator = () => {\n if (!listRef.current) return\n\n const activeTab = listRef.current.querySelector(\n '[data-state=\"active\"]'\n ) as HTMLElement\n\n if (activeTab) {\n const listRect = listRef.current.getBoundingClientRect()\n const tabRect = activeTab.getBoundingClientRect()\n\n setIndicatorStyle({\n left: tabRect.left - listRect.left,\n width: tabRect.width,\n })\n }\n }\n\n updateIndicator()\n\n // Use MutationObserver to detect when data-state changes\n const observer = new MutationObserver(updateIndicator)\n\n if (listRef.current) {\n observer.observe(listRef.current, {\n attributes: true,\n attributeFilter: [\"data-state\"],\n subtree: true,\n })\n }\n\n // Also update on window resize\n window.addEventListener(\"resize\", updateIndicator)\n\n return () => {\n observer.disconnect()\n window.removeEventListener(\"resize\", updateIndicator)\n }\n }, [])\n\n // Combine refs\n const combinedRef = useCallback(\n (node: HTMLDivElement | null) => {\n ;(listRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n\n if (typeof ref === \"function\") {\n ref(node)\n } else if (ref) {\n ;(ref as React.MutableRefObject<HTMLDivElement | null>).current = node\n }\n },\n [ref]\n )\n\n return (\n <TabsPrimitive.List\n ref={combinedRef}\n className={cn(\n \"relative inline-flex items-center justify-center rounded-4xl bg-muted p-1 gap-1 text-muted-foreground\",\n className\n )}\n {...props}\n >\n {/* Animated indicator */}\n <span\n className=\"absolute h-[calc(100%-0.5rem)] rounded-4xl bg-background shadow-sm transition-all duration-200 ease-out\"\n style={{\n left: `${indicatorStyle.left}px`,\n width: `${indicatorStyle.width}px`,\n }}\n />\n {props.children}\n </TabsPrimitive.List>\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"cursor-pointer relative inline-flex items-center justify-center whitespace-nowrap data-[state=inactive]:not-disabled:hover:bg-secondary rounded-4xl px-3 py-1 text-sm font-medium ring-offset-background transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=active]:text-foreground z-10\",\n className\n )}\n {...props}\n />\n))\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className\n )}\n {...props}\n />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],"mappings":";oCAAA,UAAYA,MAAmB,uBAG/B,OAAS,cAAAC,EAAY,eAAAC,EAAa,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QAsEjE,OASE,OAAAC,EATF,QAAAC,MAAA,oBApEJ,IAAMC,EAAqB,OAErBC,EAAWR,EAGf,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAAQ,CAClC,GAAM,CAACC,EAAgBC,CAAiB,EAAIT,EAAS,CACnD,KAAM,EACN,MAAO,CACT,CAAC,EACKU,EAAUX,EAAuB,IAAI,EAE3CD,EAAU,IAAM,CACd,IAAMa,EAAkB,IAAM,CAC5B,GAAI,CAACD,EAAQ,QAAS,OAEtB,IAAME,EAAYF,EAAQ,QAAQ,cAChC,uBACF,EAEA,GAAIE,EAAW,CACb,IAAMC,EAAWH,EAAQ,QAAQ,sBAAsB,EACjDI,EAAUF,EAAU,sBAAsB,EAEhDH,EAAkB,CAChB,KAAMK,EAAQ,KAAOD,EAAS,KAC9B,MAAOC,EAAQ,KACjB,CAAC,CACH,CACF,EAEAH,EAAgB,EAGhB,IAAMI,EAAW,IAAI,iBAAiBJ,CAAe,EAErD,OAAID,EAAQ,SACVK,EAAS,QAAQL,EAAQ,QAAS,CAChC,WAAY,GACZ,gBAAiB,CAAC,YAAY,EAC9B,QAAS,EACX,CAAC,EAIH,OAAO,iBAAiB,SAAUC,CAAe,EAE1C,IAAM,CACXI,EAAS,WAAW,EACpB,OAAO,oBAAoB,SAAUJ,CAAe,CACtD,CACF,EAAG,CAAC,CAAC,EAGL,IAAMK,EAAcnB,EACjBoB,GAAgC,CAC7BP,EAA0D,QAAUO,EAElE,OAAOV,GAAQ,WACjBA,EAAIU,CAAI,EACCV,IACPA,EAAsD,QAAUU,EAEtE,EACA,CAACV,CAAG,CACN,EAEA,OACEL,EAAe,OAAd,CACC,IAAKc,EACL,UAAWE,EACT,wGACAb,CACF,EACC,GAAGC,EAGJ,UAAAL,EAAC,QACC,UAAU,0GACV,MAAO,CACL,KAAM,GAAGO,EAAe,IAAI,KAC5B,MAAO,GAAGA,EAAe,KAAK,IAChC,EACF,EACCF,EAAM,UACT,CAEJ,CAAC,EACDF,EAAS,YAA4B,OAAK,YAE1C,IAAMe,EAAcvB,EAGlB,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1BN,EAAe,UAAd,CACC,IAAKM,EACL,UAAWW,EACT,ybACAb,CACF,EACC,GAAGC,EACN,CACD,EACDa,EAAY,YAA4B,UAAQ,YAEhD,IAAMC,EAAcxB,EAGlB,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1BN,EAAe,UAAd,CACC,IAAKM,EACL,UAAWW,EACT,kIACAb,CACF,EACC,GAAGC,EACN,CACD,EACDc,EAAY,YAA4B,UAAQ","names":["TabsPrimitive","forwardRef","useCallback","useEffect","useRef","useState","jsx","jsxs","Tabs","TabsList","className","props","ref","indicatorStyle","setIndicatorStyle","listRef","updateIndicator","activeTab","listRect","tabRect","observer","combinedRef","node","cn","TabsTrigger","TabsContent"]}