sodtrack-web-ui 0.59.1 → 0.60.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sodtrack-web-ui",
3
- "version": "0.59.1",
3
+ "version": "0.60.1",
4
4
  "description": "UI components for Sodtrack Web",
5
5
  "exports": {
6
6
  "./dist/index.css": "./dist/index.css",
@@ -27,14 +27,10 @@
27
27
  "author": "",
28
28
  "license": "ISC",
29
29
  "devDependencies": {
30
- "@chromatic-com/storybook": "3.2.6",
31
- "@storybook/addon-essentials": "8.6.14",
32
- "@storybook/addon-interactions": "8.6.14",
33
- "@storybook/addon-links": "8.6.14",
34
- "@storybook/blocks": "8.6.14",
35
- "@storybook/react": "8.6.14",
36
- "@storybook/react-vite": "8.6.14",
37
- "@storybook/test": "8.6.14",
30
+ "@chromatic-com/storybook": "4.0.0",
31
+ "@storybook/addon-docs": "9.0.3",
32
+ "@storybook/addon-links": "9.0.3",
33
+ "@storybook/react-vite": "9.0.3",
38
34
  "@types/react": "18.3.18",
39
35
  "@vitejs/plugin-react": "4.4.1",
40
36
  "autoprefixer": "10.4.21",
@@ -45,7 +41,7 @@
45
41
  "prettier-plugin-tailwindcss": "0.6.11",
46
42
  "react": "18.3.1",
47
43
  "react-dom": "18.3.1",
48
- "storybook": "8.6.14",
44
+ "storybook": "9.0.3",
49
45
  "tailwind-merge": "2.5.5",
50
46
  "tailwindcss": "3.4.17",
51
47
  "tailwindcss-animate": "1.0.7",
@@ -78,4 +74,4 @@
78
74
  "react-day-picker": "9.5.0",
79
75
  "tailwind-variants": "^1.0.0"
80
76
  }
81
- }
77
+ }
@@ -1 +0,0 @@
1
- import {a}from'./chunk-A7OUZRND.mjs';import {a as a$2}from'./chunk-QHBCNAWO.mjs';import {a as a$1}from'./chunk-2WINTZSS.mjs';import $,{useId,useRef,useState,useEffect}from'react';import*as R from'@radix-ui/react-portal';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var i=56,u=6,q=({options:n,noResults:w,selectedOption:L,onSelect:P,onChange:C,onClick:T,className:k,...I})=>{let N=useId(),l=useRef(null),o=useRef(null),g=useRef(null),[H,M]=useState("bottom"),[r,F]=useState(),[s,c]=useState(-1),[h,y]=useState(L??null),b=e=>{l.current.style.display="none",o.current.value=e.label,y(e),P?.(e);},A=e=>{if(e.key==="ArrowDown"){if(s===n.length-1)return;c(t=>t+1),l.current.style.display="flex",x();}else if(e.key==="ArrowUp"){if(s===0)return;c(t=>t-1),x();}else e.key==="Enter"&&(b(n[s]),c(-1));},x=()=>{let e=i*u;g.current.scroll({top:(s+2)*i<=e?0:i*(s+2)-e,behavior:"smooth"});};return useEffect(()=>{if(!o.current)return;let e=()=>{if(!o.current)return;let t=i*(n.length<u?n.length:u)+16,m=o.current.getBoundingClientRect();F(m);let B=window.innerHeight-m.bottom>t,D=m.top>t;M(B?"bottom":D?"top":"bottom");};return e(),o.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{o.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[o.current]),useEffect(()=>{function e(t){l.current&&!l.current.contains(t.target)&&(l.current.style.display="none",c(-1));}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[l.current]),jsxs(Fragment,{children:[jsx(a,{className:a$1("w-full !cursor-pointer",k),readOnly:true,ref:o,autoComplete:"off",list:"",selectMode:true,value:h?.label,showClearButton:false,onClick:e=>{l.current.style.display="flex",T?.(e);},onChange:e=>{c(-1),y(null),C?.(e);},onKeyDown:A,...I}),jsx(R.Root,{asChild:true,children:jsx("ul",{ref:l,className:"pointer-events-auto absolute z-[10000] hidden w-full",style:r?{width:`${r.width}px`,left:r.left,top:H==="bottom"?`${r.height+r.top+window.scrollY}px`:window.scrollY+r.top-(n.length<u?n.length:u)*i-16}:void 0,children:jsxs(a$2,{className:"elevation-8 my-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",ref:g,children:[n.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[$.cloneElement(w.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:w.message})]}),n.map((e,t)=>jsx("li",{onClick:()=>{b(e);},className:a$1("w-full flex-shrink-0 cursor-pointer py-4 pl-4 pr-6 text-left hover:bg-primary-100",h?.value===e.value&&"bg-primary-200",s===t&&"bg-primary-200"),children:e.label},`select-option-${N}-${e.key??e.value}`))]})})})]})};export{q as a};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-QWBSZY37.mjs';import {cva}from'cva';import {jsx}from'react/jsx-runtime';var p=cva({base:"h-12 w-12 animate-spin",variants:{variant:{primary:"text-primary-500",neutral:"text-neutral-100"}},defaultVariants:{variant:"primary"}}),c=({variant:a$1,className:n,...t})=>jsx(a,{className:p({variant:a$1,className:n}),...t});export{c as a};
@@ -1 +0,0 @@
1
- import {a as a$2}from'./chunk-DBADY3ZX.mjs';import {j as j$1}from'./chunk-D6V735GZ.mjs';import {c as c$1}from'./chunk-WS2F7JWJ.mjs';import {a as a$1}from'./chunk-QHBCNAWO.mjs';import {c}from'./chunk-4DF3NXNT.mjs';import {a}from'./chunk-2WINTZSS.mjs';import*as s from'react';import*as t from'@radix-ui/react-dialog';import*as v from'@radix-ui/react-visually-hidden';import {jsx,jsxs}from'react/jsx-runtime';var V=["sm","md","lg","xl"],h=({...r})=>jsx(t.Root,{...r});h.displayName="Drawer";var j=t.Trigger,B=t.Portal,k=t.Close,x=s.forwardRef(({className:r,...a$1},o)=>jsx(t.Overlay,{ref:o,className:a("fixed inset-0 z-50 bg-neutral-900/60","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=open]:animate-in data-[state=closed]:animate-out","transition-all",r),...a$1}));x.displayName=t.Overlay.displayName;var A=s.forwardRef(({className:r,size:a$3="sm",title:o,description:i,children:f,isLoading:c=false,loadingText:n="",buttons:d,hideHeader:D=false,onPointerDownOutside:b,...H},T)=>jsx(B,{children:jsx(x,{children:jsx(t.Content,{onPointerDownOutside:m=>{m.target instanceof Element&&m.target.closest(".pac-container")&&m.preventDefault(),b?.(m);},ref:T,...!i||D?{"aria-describedby":void 0}:{},className:a("fixed right-0 top-0 z-50 flex h-full flex-col bg-neutral-50",a$3==="sm"&&"w-[29.375rem] max-w-[29.375rem]",a$3==="md"&&"w-[47.5rem] max-w-[47.5rem]",a$3==="lg"&&"w-[58.75rem] max-w-[58.75rem]",a$3==="xl"&&"w-[78.125rem] max-w-[78.125rem]","data-[state=open]:animate-slideIn","data-[state=closed]:animate-swipeOut",r),...H,children:jsxs(a$1,{className:"h-full",viewPortClassName:"pr-8 pt-10 pl-6",children:[D?jsx(v.Root,{children:jsx(j$1,{children:"Drawer"})}):jsx(N,{title:o,description:i,buttons:d}),jsx("div",{className:a("flex flex-1 flex-col pb-6",r),children:c?jsxs("div",{className:"flex flex-1 flex-col items-center justify-center",children:[jsx(a$2,{}),n&&jsx("p",{children:n})]}):f})]})})})}));A.displayName="DrawerContent";var N=({className:r,title:a$1,description:o,buttons:i=[],...f})=>jsxs("div",{className:a("mb-7",r),...f,children:[jsxs("div",{className:"flex justify-between gap-2",children:[a$1&&jsx(C,{children:a$1}),!Array.isArray(i)&&i.visible!==false&&jsx(c,{size:"sm",variant:"ghost",...i}),Array.isArray(i)&&jsx("div",{className:"flex gap-1",children:i.map(({visible:c=true,...n},d)=>c?jsx(c$1,{variant:"ghost",size:"sm",...n},d):null)})]}),o&&jsx(P,{className:"mt-1",children:o})]});N.displayName="DrawerHeader";var O=({className:r,...a$1})=>jsx("div",{className:a("mt-auto flex pt-6",r),...a$1});O.displayName="DrawerFooter";var C=s.forwardRef(({className:r,...a$1},o)=>jsx(t.Title,{ref:o,className:a("font-jakarta text-2xl font-semibold leading-[130%] text-neutral-900",r),...a$1}));C.displayName=t.Title.displayName;var P=s.forwardRef(({className:r,...a$1},o)=>jsx(t.Description,{ref:o,className:a("text-sm leading-[130%] text-neutral-900",r),...a$1}));P.displayName=t.Description.displayName;export{V as a,h as b,j as c,B as d,k as e,x as f,A as g,N as h,O as i,C as j,P as k};