@peerbots/core 0.1.0
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/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.github/workflows/publish.yml +42 -0
- package/.github/workflows/storybook.yml +46 -0
- package/.storybook/main.ts +28 -0
- package/.storybook/preview.ts +22 -0
- package/README.md +9 -0
- package/dist/index.css +1 -0
- package/dist/index.d.mts +704 -0
- package/dist/index.d.ts +704 -0
- package/dist/index.js +5 -0
- package/dist/index.mjs +5 -0
- package/package.json +60 -0
- package/src/charts/DistributionBarChart.stories.tsx +41 -0
- package/src/charts/DistributionBarChart.tsx +170 -0
- package/src/charts/DistributionHistogram.stories.tsx +56 -0
- package/src/charts/DistributionHistogram.tsx +193 -0
- package/src/charts/index.ts +10 -0
- package/src/global.d.ts +1 -0
- package/src/helpers/SEO.tsx +41 -0
- package/src/index.ts +6 -0
- package/src/styles/theme.css +60 -0
- package/src/ui/Alert.stories.tsx +41 -0
- package/src/ui/Alert.tsx +72 -0
- package/src/ui/Anchor.stories.tsx +25 -0
- package/src/ui/Anchor.tsx +32 -0
- package/src/ui/AuthFormUI.stories.tsx +67 -0
- package/src/ui/AuthFormUI.tsx +217 -0
- package/src/ui/BasePanel.stories.tsx +36 -0
- package/src/ui/BasePanel.tsx +59 -0
- package/src/ui/Button.stories.tsx +108 -0
- package/src/ui/Button.tsx +121 -0
- package/src/ui/Checkbox.stories.tsx +61 -0
- package/src/ui/Checkbox.tsx +45 -0
- package/src/ui/Collapsible.stories.tsx +91 -0
- package/src/ui/Collapsible.tsx +52 -0
- package/src/ui/Colors.stories.tsx +67 -0
- package/src/ui/Dialog.stories.tsx +29 -0
- package/src/ui/Dialog.tsx +56 -0
- package/src/ui/Dropdown.tsx +66 -0
- package/src/ui/Field.stories.tsx +181 -0
- package/src/ui/Field.tsx +108 -0
- package/src/ui/Icon.stories.tsx +192 -0
- package/src/ui/Icon.tsx +42 -0
- package/src/ui/IconRegistry.tsx +189 -0
- package/src/ui/Input.stories.tsx +67 -0
- package/src/ui/Input.tsx +43 -0
- package/src/ui/Label.stories.tsx +42 -0
- package/src/ui/Label.tsx +26 -0
- package/src/ui/NumberField.stories.tsx +86 -0
- package/src/ui/NumberField.tsx +116 -0
- package/src/ui/Popover.tsx +42 -0
- package/src/ui/Select.stories.tsx +74 -0
- package/src/ui/Select.tsx +122 -0
- package/src/ui/Separator.stories.tsx +61 -0
- package/src/ui/Separator.tsx +28 -0
- package/src/ui/SettingsPanel.stories.tsx +83 -0
- package/src/ui/SettingsPanel.tsx +81 -0
- package/src/ui/Skeleton.stories.tsx +43 -0
- package/src/ui/Skeleton.tsx +15 -0
- package/src/ui/Slider.stories.tsx +140 -0
- package/src/ui/Slider.tsx +95 -0
- package/src/ui/SliderWithNumberField.stories.tsx +101 -0
- package/src/ui/SliderWithNumberField.tsx +88 -0
- package/src/ui/Switch.stories.tsx +81 -0
- package/src/ui/Switch.tsx +60 -0
- package/src/ui/TabRadio.stories.tsx +153 -0
- package/src/ui/TabRadio.tsx +68 -0
- package/src/ui/TabSelection.stories.tsx +44 -0
- package/src/ui/TabSelection.tsx +91 -0
- package/src/ui/TextArea.stories.tsx +64 -0
- package/src/ui/TextArea.tsx +24 -0
- package/src/ui/Tooltip.stories.tsx +84 -0
- package/src/ui/Tooltip.tsx +61 -0
- package/src/ui/Typography.stories.tsx +87 -0
- package/src/ui/Typography.tsx +80 -0
- package/src/ui/index.ts +28 -0
- package/src/ui/utils.ts +6 -0
- package/tsconfig.json +12 -0
- package/vitest.config.ts +36 -0
- package/vitest.shims.d.ts +1 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var ht=Object.create;var se=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,yt=Object.prototype.hasOwnProperty;var wt=(e,t)=>{for(var r in t)se(e,r,{get:t[r],enumerable:!0})},Pe=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xt(t))!yt.call(e,o)&&o!==r&&se(e,o,{get:()=>t[o],enumerable:!(a=bt(t,o))||a.enumerable});return e};var w=(e,t,r)=>(r=e!=null?ht(vt(e)):{},Pe(t||!e||!e.__esModule?se(r,"default",{value:e,enumerable:!0}):r,e)),Nt=e=>Pe(se({},"__esModule",{value:!0}),e);var Ut={};wt(Ut,{Alert:()=>Et,Anchor:()=>tt,AuthFormUI:()=>Vt,BasePanel:()=>Ht,Button:()=>x,Checkbox:()=>it,Collapsible:()=>xe,Dialog:()=>Ct,DialogClose:()=>Lt,DialogDescription:()=>Pt,DialogTitle:()=>Tt,DistributionBarChart:()=>gt,DistributionHistogram:()=>ut,Dropdown:()=>St,DropdownItem:()=>Xe,DropdownSeparator:()=>Je,Field:()=>oe,Heading:()=>A,HelperTooltip:()=>be,Icon:()=>u,Input:()=>te,Label:()=>we,NumberField:()=>de,Popover:()=>Bt,SEO:()=>Wt,Select:()=>Ee,Separator:()=>lt,SettingsPanel:()=>At,Skeleton:()=>zt,Slider:()=>le,SliderWithNumberField:()=>qe,Switch:()=>Qe,TabRadio:()=>It,TabSelection:()=>Ft,Text:()=>C,TextArea:()=>ot,Tooltip:()=>$e,TypographyList:()=>Mt,cn:()=>l});module.exports=Nt(Ut);var Se=require("@base-ui/react"),He=w(require("react"));var Le=require("clsx"),Be=require("tailwind-merge");function l(...e){return(0,Be.twMerge)((0,Le.clsx)(e))}var _=require("react/jsx-runtime"),x=He.default.forwardRef(({className:e,variant:t="primary",size:r="md",isLoading:a=!1,leftIcon:o,rightIcon:n,children:s,disabled:g,render:f,nativeButton:v,isIconOnly:p,...b},h)=>{let m=p||!s&&(!!o||!!n),y={primary:"bg-primary hover:bg-dark-primary text-gray-900 shadow-sm border border-transparent font-bold disabled:bg-gray-400 disabled:hover:bg-gray-300",secondary:"bg-gray-100 hover:bg-gray-200 text-gray-800 border-gray-200 border font-normal disabled:bg-gray-400 disabled:hover:bg-gray-300",danger:"bg-danger hover:opacity-80 text-gray-900 shadow-sm border border-transparent font-bold disabled:bg-gray-400 disabled:hover:bg-gray-300",ghost:"bg-transparent hover:bg-gray-100 text-gray-700 hover:text-gray-900 font-medium","ghostly-danger":"bg-transparent hover:bg-danger/10 text-red-700 border border-red-700 font-medium disabled:border-gray-400 disabled:text-gray-400"},F={sm:m?"p-1 text-xs":"px-2 py-1 text-xs",md:m?"p-2 text-sm":"px-4 py-2 text-sm",lg:m?"p-3 text-base":"px-6 py-3 text-base"};return(0,_.jsxs)(Se.Button,{ref:h,render:f,nativeButton:v,className:l("inline-flex items-center justify-center rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed cursor-pointer",y[t],F[r],e),disabled:g||a,...b,children:[a&&(0,_.jsxs)("svg",{className:l("animate-spin h-4 w-4",!m&&"mr-2 -ml-1"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,_.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,_.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),!a&&o&&(0,_.jsx)("span",{className:l("inline-flex items-center justify-center",!m&&"mr-2 -ml-1"),children:o}),s,!a&&n&&(0,_.jsx)("span",{className:l("inline-flex items-center justify-center",!m&&"ml-2 -mr-1"),children:n})]})});x.displayName="Button";var ge=require("@base-ui/react"),De=w(require("react"));var Z=require("react/jsx-runtime"),te=De.default.forwardRef(({className:e,leftIcon:t,rightIcon:r,id:a,...o},n)=>{let s=l("block w-full rounded-md border-0 px-1.5 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6 bg-primary/10 appearance-none",t&&"pl-10",r&&"pr-10",e);return!t&&!r?(0,Z.jsx)(ge.Input,{ref:n,id:a,className:s,...o}):(0,Z.jsxs)("div",{className:"relative",children:[t&&(0,Z.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:(0,Z.jsx)("span",{className:"text-gray-500 sm:text-sm",children:t})}),(0,Z.jsx)(ge.Input,{ref:n,id:a,className:s,...o}),r&&(0,Z.jsx)("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:(0,Z.jsx)("span",{className:"text-gray-500 sm:text-sm",children:r})})]})});te.displayName="Input";var ue=w(require("react")),I=require("@base-ui/react");var ze=w(require("react"));var i=require("react/jsx-runtime"),d={check:"M20 6 9 17l-5-5",x:"M18 6 6 18M6 6l12 12",edit:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125",close:"M6 18L18 6M6 6l12 12",plus:"M12 4.5v15m7.5-7.5h-15",arrowDown:"M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3",arrowUp:"M4.5 10.5L12 3m0 0l7.5 7.5M12 3v18",clipboard:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75",cloudArrowUp:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z",arrowDownToLine:"M9 12l3 3m0 0 3-3m-3 3V2.25",folder:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15m0-3-3-3m0 0-3 3m3-3V15",arrowUpFromLine:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15m0-3-3-3m0 0-3 3m3-3V15",squares:"M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 0 1-1.125-1.125v-3.75ZM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-8.25ZM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-2.25Z",tableCells:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5",arrowsRightLeft:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5",document:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z",externalLink:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25",lock:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z",shoppingCart:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z",minus:"M5 12h14",pencilSquare:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z",pencilSquareContinued:"M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z",chevronUpSmall:"M4.5 15.75l7.5-7.5 7.5 7.5",chevronDownSmall:"M19.5 8.25l-7.5 7.5-7.5-7.5",chevronUpTable:"M8.25 6.75 12 3m0 0 3.75 3.75M12 3v18",chevronDownTable:"M15.75 17.25 12 21m0 0-3.75-3.75M12 21V3",speakerWave:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z",zap:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z",code:"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5",questionMarkCircle:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z",search:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z",exclamationCircle:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z",exclamationTriangle:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z",checkCircle:"M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z",megaphone:"M10.34 15.84c-.688-.06-1.386-.09-2.09-.09H7.5a4.5 4.5 0 1 1 0-9h.75c.704 0 1.402-.03 2.09-.09m0 9.18c.253.962.584 1.892.985 2.783.247.55.06 1.21-.463 1.511l-.657.38c-.551.318-1.26.117-1.527-.461a20.845 20.845 0 0 1-1.44-4.282m3.102.069a18.03 18.03 0 0 1-.59-4.59c0-1.586.205-3.124.59-4.59m0 9.18a23.848 23.848 0 0 1 8.835 2.535M10.34 6.66a23.847 23.847 0 0 0 8.835-2.535m0 0A23.74 23.74 0 0 0 18.795 3m.38 1.125a23.91 23.91 0 0 1 1.014 5.395m-1.014 8.855c-.118.38-.245.754-.38 1.125m.38-1.125a23.91 23.91 0 0 0 1.014-5.395m0-3.46c.495.413.811 1.035.811 1.73 0 .695-.316 1.317-.811 1.73m0-3.46a24.347 24.347 0 0 1 0 3.46",xCircle:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z",arrowsPointingIn:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25",arrowsPointingOut:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15",arrowPath:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3",arrowUturnLeft:"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3",magnifyingGlassPlus:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6",arrowsUpDown:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5",envelope:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",lockClosed:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",userCircle:"M17.982 18.725A7.488 7.488 0 0012 15.75a7.488 7.488 0 00-5.982 2.975m11.963 0a9 9 0 10-11.963 0m11.963 0A8.966 8.966 0 0112 21a8.966 8.966 0 01-5.982-2.275M15 9.75a3 3 0 11-6 0 3 3 0 016 0z",arrowRightOnRectangle:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9",chevronRight:"m8.25 4.5 7.5 7.5-7.5 7.5",arrowDownTray:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3",arrowUpTray:"M3 7.5V5.25A2.25 2.25 0 0 1 5.25 3h13.5A2.25 2.25 0 0 1 21 5.25V7.5m-4.5 4.5L12 7.5m0 0L7.5 12m4.5-4.5v13.5",import:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25",export:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15m0-3-3-3m0 0-3 3m3-3V15",home:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25",play:"M5 3l14 9-14 9V3z"},Ie={eye:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),(0,i.jsx)("path",{d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),google:(0,i.jsxs)("g",{transform:"matrix(1, 0, 0, 1, 27.009001, -39.238998)",children:[(0,i.jsx)("path",{fill:"#4285F4",stroke:"none",d:"M -3.264 51.509 C -3.264 50.719 -3.334 49.969 -3.454 49.239 L -14.754 49.239 L -14.754 53.749 L -8.284 53.749 C -8.574 55.229 -9.424 56.479 -10.684 57.329 L -10.684 60.329 L -6.824 60.329 C -4.564 58.239 -3.264 55.159 -3.264 51.509 Z"}),(0,i.jsx)("path",{fill:"#34A853",stroke:"none",d:"M -14.754 63.239 C -11.514 63.239 -8.804 62.159 -6.824 60.329 L -10.684 57.329 C -11.764 58.049 -13.134 58.489 -14.754 58.489 C -17.884 58.489 -20.534 56.379 -21.484 53.529 L -25.464 53.529 L -25.464 56.619 C -23.494 60.539 -19.444 63.239 -14.754 63.239 Z"}),(0,i.jsx)("path",{fill:"#FBBC05",stroke:"none",d:"M -21.484 53.529 C -21.734 52.809 -21.864 52.039 -21.864 51.239 C -21.864 50.439 -21.724 49.669 -21.484 48.949 L -21.484 45.859 L -25.464 45.859 C -26.284 47.479 -26.754 49.299 -26.754 51.239 C -26.754 53.179 -26.284 54.999 -25.464 56.619 L -21.484 53.529 Z"}),(0,i.jsx)("path",{fill:"#EA4335",stroke:"none",d:"M -14.754 43.989 C -12.984 43.989 -11.404 44.599 -10.154 45.789 L -6.734 42.369 C -8.804 40.429 -11.514 39.239 -14.754 39.239 C -19.444 39.239 -23.494 41.939 -25.464 45.859 L -21.484 48.949 C -20.534 46.099 -17.884 43.989 -14.754 43.989 Z"})]})},Ae={check:(0,i.jsx)("path",{d:d.check}),x:(0,i.jsx)("path",{d:d.x}),edit:(0,i.jsx)("path",{d:d.edit}),close:(0,i.jsx)("path",{d:d.close}),plus:(0,i.jsx)("path",{d:d.plus}),arrowDown:(0,i.jsx)("path",{d:d.arrowDown}),arrowUp:(0,i.jsx)("path",{d:d.arrowUp}),clipboard:(0,i.jsx)("path",{d:d.clipboard}),cloudArrowUp:(0,i.jsx)("path",{d:d.cloudArrowUp}),arrowDownToLine:(0,i.jsx)("path",{d:d.arrowDownToLine}),folder:(0,i.jsx)("path",{d:d.folder}),arrowUpFromLine:(0,i.jsx)("path",{d:d.arrowUpFromLine}),arrowRightOnRectangle:(0,i.jsx)("path",{d:d.arrowRightOnRectangle}),squares:(0,i.jsx)("path",{d:d.squares}),tableCells:(0,i.jsx)("path",{d:d.tableCells}),arrowsRightLeft:(0,i.jsx)("path",{d:d.arrowsRightLeft}),document:(0,i.jsx)("path",{d:d.document}),externalLink:(0,i.jsx)("path",{d:d.externalLink}),lock:(0,i.jsx)("path",{d:d.lock}),shoppingCart:(0,i.jsx)("path",{d:d.shoppingCart}),minus:(0,i.jsx)("path",{d:d.minus}),pencilSquare:(0,i.jsx)("path",{d:d.pencilSquare}),pencilSquareContinued:(0,i.jsx)("path",{d:d.pencilSquareContinued}),chevronDownSmall:(0,i.jsx)("path",{d:d.chevronDownSmall}),chevronUpSmall:(0,i.jsx)("path",{d:d.chevronUpSmall}),chevronDownTable:(0,i.jsx)("path",{d:d.chevronDownTable}),chevronUpTable:(0,i.jsx)("path",{d:d.chevronUpTable}),speakerWave:(0,i.jsx)("path",{d:d.speakerWave}),zap:(0,i.jsx)("path",{d:d.zap}),code:(0,i.jsx)("path",{d:d.code}),questionMarkCircle:(0,i.jsx)("path",{d:d.questionMarkCircle}),search:(0,i.jsx)("path",{d:d.search}),exclamationCircle:(0,i.jsx)("path",{d:d.exclamationCircle}),exclamationTriangle:(0,i.jsx)("path",{d:d.exclamationTriangle}),checkCircle:(0,i.jsx)("path",{d:d.checkCircle}),megaphone:(0,i.jsx)("path",{d:d.megaphone}),xCircle:(0,i.jsx)("path",{d:d.xCircle}),arrowsPointingIn:(0,i.jsx)("path",{d:d.arrowsPointingIn}),arrowsPointingOut:(0,i.jsx)("path",{d:d.arrowsPointingOut}),arrowPath:(0,i.jsx)("path",{d:d.arrowPath}),arrowUturnLeft:(0,i.jsx)("path",{d:d.arrowUturnLeft}),magnifyingGlassPlus:(0,i.jsx)("path",{d:d.magnifyingGlassPlus}),arrowsUpDown:(0,i.jsx)("path",{d:d.arrowsUpDown}),envelope:(0,i.jsx)("path",{d:d.envelope}),lockClosed:(0,i.jsx)("path",{d:d.lockClosed}),userCircle:(0,i.jsx)("path",{d:d.userCircle}),chevronRight:(0,i.jsx)("path",{d:d.chevronRight}),arrowDownTray:(0,i.jsx)("path",{d:d.arrowDownTray}),arrowUpTray:(0,i.jsx)("path",{d:d.arrowUpTray}),import:(0,i.jsx)("path",{d:d.import}),export:(0,i.jsx)("path",{d:d.export}),home:(0,i.jsx)("path",{d:d.home}),play:(0,i.jsx)("path",{d:d.play}),eye:Ie.eye,google:Ie.google};var Ve=require("react/jsx-runtime"),u=ze.default.forwardRef(({className:e,size:t="md",name:r,children:a,...o},n)=>{let s={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-6 h-6",xl:"w-8 h-8"},g=r?Ae[r]:a;return(0,Ve.jsx)("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:l(s[t],"inline-block",e),...o,children:g})});u.displayName="Icon";var N=require("react/jsx-runtime"),Ee=ue.default.forwardRef(({className:e,options:t,id:r,value:a,defaultValue:o,onChange:n,disabled:s,placeholder:g="Select...",onFocus:f,...v},p)=>{let b=ue.default.useId(),h=r||b;return(0,N.jsx)("div",{className:"w-full",children:(0,N.jsxs)(I.Select.Root,{value:a===void 0?null:String(a),defaultValue:o===void 0?void 0:String(o),onValueChange:(m,y)=>{if(n){let F=y?.event||y;n(m,F)}},disabled:s,children:[(0,N.jsxs)(I.Select.Trigger,{ref:p,id:h,className:l("flex w-full items-center justify-between rounded-md border-0 py-1.5 pl-3 pr-3 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-primary sm:text-sm sm:leading-6 bg-primary/10 min-h-[36px]",s&&"opacity-50 cursor-not-allowed",e),onFocus:f,...v,children:[(0,N.jsx)(I.Select.Value,{placeholder:g}),(0,N.jsx)(I.Select.Icon,{children:(0,N.jsx)(u,{size:"sm",children:(0,N.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})})]}),(0,N.jsx)(I.Select.Portal,{children:(0,N.jsx)(I.Select.Positioner,{sideOffset:4,className:"z-50 w-[var(--anchor-width)]",children:(0,N.jsx)(I.Select.Popup,{className:"max-h-60 overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:t.map((m,y)=>{let F=typeof m=="object"?m.label:m,K=typeof m=="object"?m.value:m;return(0,N.jsxs)(I.Select.Item,{value:K,className:"relative cursor-default select-none py-2 pl-3 pr-9 text-gray-900 hover:bg-gray-100 data-[highlighted]:bg-gray-100 data-[selected]:font-semibold",children:[(0,N.jsx)(I.Select.ItemText,{children:F}),(0,N.jsx)(I.Select.ItemIndicator,{className:"absolute inset-y-0 right-0 flex items-center pr-4 text-primary",children:(0,N.jsx)(u,{size:"sm",children:(0,N.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})})]},`${K}-${y}`)})})})})]})})});Ee.displayName="Select";var fe=w(require("react")),Fe=require("clsx"),We=require("tailwind-merge"),W=require("react/jsx-runtime");function Ue(...e){return(0,We.twMerge)((0,Fe.clsx)(e))}var kt={1:"text-4xl font-bold",2:"text-3xl font-bold",3:"text-2xl font-bold",4:"text-xl font-bold",5:"text-lg font-bold",6:"text-base font-bold"},Rt={default:"text-base text-slate-950",muted:"text-sm text-slate-600",error:"text-sm text-red-600 font-medium",small:"text-xs text-slate-600"},A=({level:e=1,className:t,children:r,...a})=>fe.default.createElement(`h${e}`,{className:Ue(kt[e],t),...a},r),C=({variant:e="default",as:t="p",className:r,children:a,...o})=>fe.default.createElement(t,{className:Ue(Rt[e],r),...o},a),Mt=({args:e})=>(0,W.jsxs)("div",{className:"space-y-4",...e,children:[(0,W.jsx)(A,{level:1,children:"Heading 1"}),(0,W.jsx)(A,{level:2,children:"Heading 2"}),(0,W.jsx)(A,{level:3,children:"Heading 3"}),(0,W.jsx)(C,{children:"Body text"}),(0,W.jsx)(C,{variant:"muted",children:"Caption text"}),(0,W.jsx)(C,{variant:"small",children:"Small text"}),(0,W.jsx)(C,{variant:"small",as:"span",children:"Small span text"})]});var Oe=w(require("react")),j=require("@base-ui/react");var z=require("react/jsx-runtime"),le=Oe.default.forwardRef(({className:e,min:t=0,max:r=100,step:a=1,value:o,defaultValue:n,disabled:s,onChange:g,name:f,icon:v,...p},b)=>{let h=(m,y)=>{g&&g(m,y)};return(0,z.jsxs)("div",{className:l("w-full flex items-center gap-4",e),children:[v&&(0,z.jsx)("div",{className:"text-gray-500 shrink-0",children:v}),(0,z.jsx)("div",{className:"flex-grow flex items-center h-8 min-w-[120px]",children:(0,z.jsx)(j.Slider.Root,{ref:b,min:t,max:r,step:a,value:o!==void 0?Array.isArray(o)?o:[o]:void 0,defaultValue:n!==void 0?Array.isArray(n)?n:[n]:void 0,disabled:s,orientation:"horizontal",...p,onValueChange:(m,y)=>{let F=y?.event||window.event;h(m,F)},className:l("relative flex items-center w-full h-full group touch-none select-none",s&&"opacity-50 cursor-not-allowed",e),children:(0,z.jsxs)(j.Slider.Control,{className:"flex items-center w-full h-full relative cursor-pointer",children:[(0,z.jsx)(j.Slider.Track,{className:"relative bg-gray-200 rounded-full w-full h-1.5 overflow-hidden transition-colors group-hover:bg-gray-300",children:(0,z.jsx)(j.Slider.Indicator,{className:"absolute bg-primary rounded-full h-full"})}),(0,z.jsx)(j.Slider.Thumb,{className:"z-10 block w-4.5 h-4.5 bg-white shadow-md rounded-full border-2 border-primary focus:outline-none focus:ring-4 focus:ring-primary/20 cursor-grab active:cursor-grabbing hover:scale-110 active:scale-95 transition-transform"})]})})}),f&&(0,z.jsx)("input",{type:"hidden",name:f,value:o})]})});le.displayName="Slider";var Ze=w(require("react"));var he=w(require("react")),ee=require("@base-ui/react");var L=require("react/jsx-runtime"),de=he.default.forwardRef(({className:e,value:t,defaultValue:r,min:a,max:o,step:n,onChange:s,disabled:g,readOnly:f,id:v,placeholder:p,showButtons:b=!1,...h},m)=>{let y=he.default.useId(),F=v||y;return(0,L.jsx)("div",{className:"w-full",children:(0,L.jsx)(ee.NumberField.Root,{ref:m,value:t,defaultValue:r,min:a,max:o,step:n,onValueChange:(K,ie)=>{if(s){let ft=ie?.event||ie;s(K,ft)}},disabled:g,readOnly:f,className:l("flex flex-col gap-1",e),...h,children:(0,L.jsxs)("div",{className:l("group relative flex items-center rounded-md border-0 bg-primary/10 ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary shadow-sm",g&&"opacity-50 cursor-not-allowed"),children:[b&&(0,L.jsx)(ee.NumberField.Decrement,{"aria-label":"Decrement",className:"relative z-20 flex items-center justify-center w-8 h-9 text-gray-500 hover:text-gray-700 hover:bg-gray-100/50 rounded-l-md border-r border-gray-300 disabled:opacity-30 cursor-pointer",children:(0,L.jsx)(u,{size:"sm",children:(0,L.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15"})})}),(0,L.jsx)(ee.NumberField.Input,{id:F,placeholder:p,className:l("block w-full bg-transparent border-0 px-3 py-1.5 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm sm:leading-6 text-center appearance-none relative z-0",!b&&"rounded-md")}),b&&(0,L.jsx)(ee.NumberField.Increment,{"aria-label":"Increment",className:"relative z-20 flex items-center justify-center w-8 h-9 text-gray-500 hover:text-gray-700 hover:bg-gray-100/50 rounded-r-md border-l border-gray-300 disabled:opacity-30 cursor-pointer",children:(0,L.jsx)(u,{size:"sm",children:(0,L.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})}),(0,L.jsx)(ee.NumberField.ScrubArea,{className:"absolute inset-0 z-10 cursor-ew-resize opacity-0 hover:opacity-10 transition-opacity bg-primary/5 rounded-md pointer-events-none group-hover:pointer-events-auto"})]})})})});de.displayName="NumberField";var Q=require("react/jsx-runtime"),qe=Ze.default.forwardRef(({className:e,min:t=0,max:r=100,step:a=1,value:o,defaultValue:n,disabled:s,onChange:g,inputWidth:f="w-20",...v},p)=>{let b=(h,m)=>{if(g){let y=Array.isArray(h)?h[0]:h;g(y,m)}};return(0,Q.jsxs)("div",{ref:p,className:l("flex flex-row items-center gap-4 w-full min-w-0 sm:flex-nowrap flex-wrap",e),...v,children:[(0,Q.jsx)("div",{className:"flex-grow min-w-[120px]",children:(0,Q.jsx)(le,{min:t,max:r,step:a,value:o,defaultValue:n,disabled:s,onChange:b,className:"w-full"})}),(0,Q.jsx)("div",{className:l(f,"shrink-0"),children:(0,Q.jsx)(de,{value:o,defaultValue:n,min:t,max:r,step:a,disabled:s,onChange:(h,m)=>{h!==null&&b(h,m)},showButtons:!1})})]})});qe.displayName="SliderWithNumberField";var Ge=w(require("react")),q=require("@base-ui/react");var B=require("react/jsx-runtime");function $e({content:e,children:t,className:r,delay:a="normal"}){return(0,B.jsx)(q.Tooltip.Provider,{delay:a==="slow"?1e3:0,children:(0,B.jsxs)(q.Tooltip.Root,{children:[Ge.default.isValidElement(t)?(0,B.jsx)(q.Tooltip.Trigger,{render:t}):(0,B.jsx)(q.Tooltip.Trigger,{children:t}),(0,B.jsx)(q.Tooltip.Portal,{children:(0,B.jsx)(q.Tooltip.Positioner,{sideOffset:8,children:(0,B.jsxs)(q.Tooltip.Popup,{className:l("z-50 rounded shadow-lg bg-white p-2 text-xs text-center whitespace-normal max-w-xs text-gray-900 border border-gray-200",r),children:[e,(0,B.jsx)(q.Tooltip.Arrow,{className:"fill-white stroke-gray-200"})]})})})]})})}function be({content:e,className:t}){return(0,B.jsx)($e,{content:e,className:t,children:(0,B.jsx)(u,{size:"md",className:"text-gray-500 hover:text-gray-700 cursor-help",children:(0,B.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})})})}var _e=w(require("react")),U=require("@base-ui/react");var V=require("react/jsx-runtime");function Ct({open:e,onOpenChange:t,trigger:r,children:a,className:o}){return(0,V.jsxs)(U.Dialog.Root,{open:e,onOpenChange:(n,s)=>{t?.(n,s?.event)},children:[r&&(_e.default.isValidElement(r)?(0,V.jsx)(U.Dialog.Trigger,{render:r}):(0,V.jsx)(U.Dialog.Trigger,{children:r})),(0,V.jsxs)(U.Dialog.Portal,{children:[(0,V.jsx)(U.Dialog.Backdrop,{className:"fixed inset-0 z-50 bg-black/40 transition-all duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),(0,V.jsx)(U.Dialog.Popup,{className:l("fixed left-[50%] top-[50%] z-50 grid w-auto max-w-[90vw] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o),children:a})]})]})}var Tt=e=>(0,V.jsx)(U.Dialog.Title,{...e}),Pt=e=>(0,V.jsx)(U.Dialog.Description,{...e}),Lt=e=>(0,V.jsx)(U.Dialog.Close,{...e});var Y=require("@base-ui/react");var X=require("react/jsx-runtime");function Bt({trigger:e,children:t,side:r="bottom",align:a="center",className:o,open:n,onOpenChange:s}){return(0,X.jsxs)(Y.Popover.Root,{open:n,onOpenChange:s,children:[(0,X.jsx)(Y.Popover.Trigger,{children:e}),(0,X.jsx)(Y.Popover.Portal,{children:(0,X.jsx)(Y.Popover.Positioner,{side:r,align:a,sideOffset:5,children:(0,X.jsxs)(Y.Popover.Popup,{className:l("z-50 w-72 rounded-md border bg-white p-4 shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",o),children:[t,(0,X.jsx)(Y.Popover.Arrow,{className:"fill-white stroke-gray-200"})]})})})]})}var ce=w(require("react")),G=require("@base-ui/react");var O=require("react/jsx-runtime");function St({trigger:e,children:t,align:r="end",className:a}){return(0,O.jsxs)(G.Menu.Root,{children:[ce.default.isValidElement(e)?(0,O.jsx)(G.Menu.Trigger,{render:e}):(0,O.jsx)(G.Menu.Trigger,{children:e}),(0,O.jsx)(G.Menu.Portal,{children:(0,O.jsx)(G.Menu.Positioner,{align:r,sideOffset:5,children:(0,O.jsx)(G.Menu.Popup,{className:l("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-white p-1 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",a),children:t})})})]})}var Xe=ce.default.forwardRef(({className:e,...t},r)=>(0,O.jsx)(G.Menu.Item,{ref:r,className:l("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-gray-100 data-[highlighted]:text-gray-900",e),...t}));Xe.displayName="DropdownItem";var Je=ce.default.forwardRef(({className:e,...t},r)=>(0,O.jsx)(G.Menu.Separator,{ref:r,className:l("-mx-1 my-1 h-px bg-gray-100",e),...t}));Je.displayName="DropdownSeparator";var Ke=require("react");var $=require("react/jsx-runtime");function xe({title:e,children:t,variant:r="secondary",size:a="md",defaultOpen:o=!1,className:n}){let[s,g]=(0,Ke.useState)(o);return(0,$.jsxs)("div",{className:l("w-full",n),children:[(0,$.jsx)(x,{variant:r,size:a,className:"w-full justify-between font-medium",onClick:()=>g(!s),"aria-expanded":s,rightIcon:(0,$.jsx)(u,{className:"h-5 w-5 text-gray-600",strokeWidth:"2.5",children:s?(0,$.jsx)("path",{d:"M4.5 15.75l7.5-7.5 7.5 7.5"}):(0,$.jsx)("path",{d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),children:(0,$.jsx)("span",{children:e})}),s&&(0,$.jsx)("div",{className:"px-4 pt-4 pb-2 text-sm text-gray-500",children:t})]})}var ve=w(require("react")),ye=require("@base-ui/react");var me=require("react/jsx-runtime"),Qe=ve.default.forwardRef(({checked:e,defaultChecked:t,onChange:r,disabled:a,className:o,id:n,...s},g)=>{let f=ve.default.useId(),v=n??f;return(0,me.jsx)("div",{className:l("flex items-center gap-2",o),children:(0,me.jsx)(ye.Switch.Root,{ref:g,id:v,checked:e,defaultChecked:t,onCheckedChange:(p,b)=>{r?.(p,b?.event)},disabled:a,className:l("relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2","data-[checked]:bg-primary data-[unchecked]:bg-gray-200",a&&"opacity-50 cursor-not-allowed"),...s,children:(0,me.jsx)(ye.Switch.Thumb,{className:l("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out","data-[checked]:translate-x-5 data-[unchecked]:translate-x-0")})})})});Qe.displayName="Switch";var re=require("react/jsx-runtime");function we({children:e,tooltip:t,className:r,...a}){return(0,re.jsx)("label",{className:l("relative block text-sm font-bold leading-6 text-gray-600 mb-1 group-focus-within:text-gray-800",r),...a,children:(0,re.jsxs)("div",{className:"flex items-center gap-1",children:[e,t&&(0,re.jsx)(be,{content:t})]})})}var J=require("react/jsx-runtime");function Ht({title:e,children:t,onClose:r,className:a="",headerClassName:o="",headingLevel:n=2,setPanel:s=g=>{}}){let g=()=>{r?r():s("None")};return(0,J.jsxs)("div",{className:`space-y-1 p-1 ${a}`,children:[(0,J.jsxs)("div",{className:`flex items-center justify-between px-1 mb-1 border-b border-solid border-gray-400 pb-1 ${o}`,children:[(0,J.jsx)(A,{level:n,className:"text-lg",children:e}),(0,J.jsx)(x,{variant:"ghost",size:"sm",onClick:g,className:"p-1 rounded hover:bg-gray-100 h-auto","aria-label":`Close ${e} Panel`,children:(0,J.jsx)(u,{size:"md",className:"h-5 w-5",children:(0,J.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]}),t]})}var pe=require("@base-ui/react"),Ne=require("react/jsx-runtime"),Dt={default:"data-[pressed]:bg-white data-[pressed]:text-gray-900 data-[pressed]:shadow-sm data-[pressed]:ring-1 data-[pressed]:ring-gray-200",primary:"data-[pressed]:bg-primary/20 data-[pressed]:shadow-sm data-[pressed]:ring-1 data-[pressed]:ring-primary",danger:"data-[pressed]:bg-danger/20 data-[pressed]:shadow-sm data-[pressed]:ring-1 data-[pressed]:ring-danger"};function It({options:e,value:t,onChange:r,className:a,variant:o="default","aria-label":n}){return(0,Ne.jsx)(pe.ToggleGroup,{value:t?[t]:[],onValueChange:s=>{r(s[0])},"aria-label":n,className:l("inline-flex p-1 space-x-1 bg-gray-100 rounded-lg border border-gray-200",a),children:e.map(s=>(0,Ne.jsx)(pe.Toggle,{value:s.value,disabled:s.disabled,className:l("relative cursor-pointer px-3 py-1.5 text-sm font-medium rounded-md transition-all flex items-center justify-center outline-none","text-gray-600 hover:text-gray-900 hover:bg-gray-200","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-gray-600",Dt[o]),children:s.label},s.value))})}var ae=require("@base-ui/react"),Ye=w(require("react"));var H=require("react/jsx-runtime"),oe=Ye.default.forwardRef(({label:e,description:t,error:r,tooltip:a,children:o,className:n,icon:s,labelPlacement:g="top",labelWeight:f="bold",...v},p)=>{let b=g==="left"||g==="right",h=g==="right";return(0,H.jsxs)(ae.Field.Root,{ref:p,className:l("flex w-full",b?"flex-col gap-1":"flex-col gap-1.5",n),...v,children:[(0,H.jsxs)("div",{className:l("flex",b?"flex-row items-center gap-2":"flex-col gap-1.5"),children:[h&&(0,H.jsx)("div",{className:"relative",children:o}),e&&(0,H.jsx)(ae.Field.Label,{render:m=>(0,H.jsx)(we,{tooltip:a,className:l("mb-0",f==="normal"&&"font-normal"),...m,children:(0,H.jsxs)("span",{className:"flex items-center gap-1",children:[s&&(0,H.jsx)("span",{className:"flex-shrink-0",children:s}),e]})})}),!h&&(0,H.jsx)("div",{className:"relative",children:o})]}),t&&(0,H.jsx)(ae.Field.Description,{className:l("text-xs text-gray-500",h&&"ml-7"),children:t}),r&&(0,H.jsx)(ae.Field.Error,{className:l("text-xs text-red-600 font-medium",h&&"ml-7"),children:r})]})});oe.displayName="Field";var je=w(require("react")),et=require("react-router-dom");var ke=require("react/jsx-runtime"),tt=je.forwardRef(({className:e,href:t,target:r,...a},o)=>{let n=t&&!t.startsWith("http")&&!r,s=l("font-medium text-teal-700 underline underline-offset-4 hover:text-teal-900 cursor-pointer",e);return n?(0,ke.jsx)(et.Link,{to:t,ref:o,className:s,...a}):(0,ke.jsx)("a",{href:t,target:r,ref:o,className:s,...a})});tt.displayName="Anchor";var rt=require("@base-ui/react"),at=w(require("react"));var Re=require("react/jsx-runtime"),ot=at.default.forwardRef(({className:e,id:t,...r},a)=>(0,Re.jsx)(rt.Input,{render:(0,Re.jsx)("textarea",{}),ref:a,id:t,className:l("block w-full rounded-md border-0 px-1.5 py-1.5 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6 bg-primary/10 appearance-none",e),...r}));ot.displayName="TextArea";var Me=require("@base-ui/react"),nt=w(require("react"));var ne=require("react/jsx-runtime"),it=nt.default.forwardRef(({className:e,id:t,checked:r,onChange:a,...o},n)=>(0,ne.jsx)(Me.Checkbox.Root,{ref:n,id:t,checked:r,onCheckedChange:s=>{a&&a({target:{checked:s===!0}})},className:l("flex h-5 w-5 shrink-0 items-center justify-center rounded border border-gray-300 bg-white shadow-sm transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","hover:border-primary hover:bg-primary/5","data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-white",e),...o,children:(0,ne.jsx)(Me.Checkbox.Indicator,{children:(0,ne.jsx)(u,{size:"sm",strokeWidth:3,className:"text-dark-primary",children:(0,ne.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})})})}));it.displayName="Checkbox";var E=require("react/jsx-runtime");function At({title:e,children:t,className:r,contentClassName:a,collapsible:o,defaultOpen:n=!0,headingLevel:s=3}){let g=(0,E.jsx)("div",{className:l("flex flex-col",a),children:t});return(0,E.jsx)("div",{className:l("m-2 p-4 bg-white shadow-xl rounded-lg flex flex-1 flex-col",r),children:o?(0,E.jsx)(xe,{title:typeof e=="string"?(0,E.jsx)(A,{level:s,className:"text-gray-600",children:e}):e,variant:"ghost",defaultOpen:n,children:g}):(0,E.jsxs)(E.Fragment,{children:[e&&(0,E.jsx)("div",{className:"flex items-center justify-between mb-2 empty:hidden",children:typeof e=="string"?(0,E.jsx)(A,{level:s,className:"text-gray-600",children:e}):e}),g]})})}var st=w(require("react")),Ce=require("@base-ui/react/separator");var dt=require("react/jsx-runtime"),lt=st.forwardRef(({className:e,orientation:t="horizontal",...r},a)=>(0,dt.jsx)(Ce.Separator,{ref:a,orientation:t,className:l("shrink-0 bg-gray-200",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));lt.displayName=Ce.Separator.displayName;var ct=require("react/jsx-runtime");function zt({className:e,...t}){return(0,ct.jsx)("div",{className:l("animate-pulse rounded-md bg-gray-200/50",e),...t})}var mt=require("react-dom");var c=require("react/jsx-runtime");function Te({label:e}){let{pending:t}=(0,mt.useFormStatus)();return(0,c.jsx)(x,{type:"submit",variant:"primary",isLoading:t,disabled:t,children:e})}function Vt({mode:e,onModeChange:t,formAction:r,actionState:a,onGoogleSignIn:o,title:n,description:s}){return(0,c.jsxs)("div",{className:"text-left overflow-hidden",children:[(0,c.jsx)(A,{level:2,className:"text-center mb-2",children:n||(e==="signing up"?"Sign up":e==="signing in"?"Sign In":"Reset Password")}),(0,c.jsxs)("form",{className:"md:m-10 sm:m-4 space-y-4",action:r,children:[s&&(0,c.jsx)(C,{className:"text-center mb-6",variant:"muted",children:s}),e==="resetting password"&&(0,c.jsx)(C,{className:"text-center font-bold text-dark-primary",children:a.message}),(0,c.jsx)(C,{className:"text-center",variant:"error",children:a.error}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(oe,{id:"email",label:"Email",error:a.error&&a.error.includes("email")?a.error:"",children:(0,c.jsx)(te,{name:"email",type:"email",required:!0,placeholder:"Email",leftIcon:(0,c.jsx)(u,{name:"envelope"})})}),e!=="resetting password"&&(0,c.jsx)(oe,{id:"password",label:"Password",error:a.error&&a.error.includes("password")?a.error:"",children:(0,c.jsx)(te,{name:"password",type:"password",required:!0,placeholder:"Password",leftIcon:(0,c.jsx)(u,{name:"lockClosed"})})})]}),(0,c.jsxs)("div",{className:"text-center mt-6 space-y-4",children:[e==="signing up"&&(0,c.jsx)(Te,{label:"Sign Up"}),e==="signing in"&&(0,c.jsx)(Te,{label:"Sign In"}),e==="resetting password"&&(0,c.jsx)(Te,{label:"Reset Password"}),(0,c.jsxs)("div",{className:"text-center text-sm text-gray-500",children:[e==="signing up"&&(0,c.jsxs)(C,{children:["Already have an account?"," ",(0,c.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>t("signing in"),className:"underline p-0 h-auto hover:bg-transparent",children:"Sign in"})]}),e==="signing in"&&(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsxs)(C,{children:["Forgot your password?"," ",(0,c.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>t("resetting password"),className:"underline p-0 h-auto hover:bg-transparent",children:"Reset password."})]}),(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,c.jsx)("div",{className:"w-full border-t border-gray-300"})}),(0,c.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,c.jsx)("span",{className:"px-2 bg-white text-gray-500",children:"or"})})]}),(0,c.jsxs)(C,{children:["Don't have an account?"," ",(0,c.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>t("signing up"),className:"underline p-0 h-auto hover:bg-transparent",children:"Sign up"})]})]}),e==="resetting password"&&(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsxs)(C,{children:["Don't have an account?"," ",(0,c.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>t("signing up"),className:"underline p-0 h-auto hover:bg-transparent",children:"Sign up"})]}),(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,c.jsx)("div",{className:"w-full border-t border-gray-300"})}),(0,c.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,c.jsx)("span",{className:"px-2 bg-white text-gray-500",children:"or"})})]}),(0,c.jsxs)(C,{children:["Remembered your password?",(0,c.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>t("signing in"),className:"underline p-0 h-auto hover:bg-transparent",children:"Sign In"})]})]})]})]}),e!=="resetting password"&&o&&(0,c.jsx)("div",{className:"text-center mt-4",children:(0,c.jsxs)(x,{variant:"secondary",onClick:o,type:"button",className:"w-full flex items-center justify-center gap-2",children:[(0,c.jsx)(u,{name:"google",stroke:"none"}),e==="signing up"&&(0,c.jsx)("span",{children:"Sign up with Google"}),e==="signing in"&&(0,c.jsx)("span",{children:"Sign in with Google"})]})})]})]})}var pt=require("react");var D=require("react/jsx-runtime");function Et({level:e,message:t,action:r}){let[a,o]=(0,pt.useState)(!0);return(0,D.jsxs)("div",{className:"flex w-full p-4 m-1 text-sm rounded-lg bg-white border border-solid transition-opacity ease-in-out delay-150 duration-300 "+(a?" ":" hidden"),children:[(0,D.jsxs)("span",{children:[e==="Error"&&(0,D.jsx)(u,{name:"exclamationCircle",size:"lg",className:"m-2",stroke:"red"}),e==="Warning"&&(0,D.jsx)(u,{name:"exclamationTriangle",size:"lg",className:"m-2",stroke:"yellow"}),e==="Success"&&(0,D.jsx)(u,{name:"checkCircle",size:"lg",className:"m-2",stroke:"green"}),e==="Info"&&(0,D.jsx)(u,{name:"megaphone",size:"lg",className:"m-2"})]}),(0,D.jsx)("span",{className:"flex flex-1 ml-2",children:t}),r&&(0,D.jsx)(x,{onClick:()=>{r.callback(),o(!1)},children:r.name}),(0,D.jsx)("span",{className:"cursor-pointer",onClick:()=>{o(!1)},children:(0,D.jsx)(u,{name:"xCircle",size:"lg",className:"m-1"})})]})}var S=require("react/jsx-runtime");function Ft({tabs:e,activeTabId:t,onTabClick:r,onAddClick:a,className:o=""}){return(0,S.jsxs)("div",{className:`overflow-x-auto max-h-20 text-sm whitespace-nowrap ${o}`,children:[e.map(n=>{let s=n.id===t;return(0,S.jsxs)("div",{className:"inline-block align-middle m-1 px-2 py-2 cursor-pointer rounded-sm "+(s?"font-bold bg-primary/30":"font-gray-300 bg-gray-200"),onClick:()=>r(n.id),children:[(0,S.jsx)("span",{className:"inline-block align-middle",children:n.label}),s&&(n.onEdit||n.onClose)&&(0,S.jsxs)("span",{className:"inline-flex items-center ml-2 align-middle",children:[n.onEdit&&(0,S.jsx)(x,{variant:"ghost",size:"sm","aria-label":"Edit Tab",onClick:g=>{g.stopPropagation(),n.onEdit()},leftIcon:(0,S.jsx)(u,{name:"edit",size:"sm"})}),n.onEdit&&n.onClose&&(0,S.jsx)("span",{className:"opacity-10 align-middle mx-1",children:" | "}),n.onClose&&(0,S.jsx)(x,{variant:"ghost",size:"sm","aria-label":"Close Tab",onClick:g=>{g.stopPropagation(),n.onClose()},leftIcon:(0,S.jsx)(u,{name:"close",size:"sm"})})]})]},n.id)}),a&&(0,S.jsx)(x,{variant:"primary",size:"sm","aria-label":"Create New Tab",onClick:a,leftIcon:(0,S.jsx)(u,{name:"plus",size:"sm"}),className:"m-1 align-middle inline-flex"})]})}var k=require("react/jsx-runtime");function Wt({title:e,description:t="Peerbots platform: social robots for everyone, powered by experts.",image:r="/peerbots-logo.png",url:a,type:o="website"}){let n="Peerbots App",s=e==="Home"?n:`${e} | ${n}`,g=a||(typeof window<"u"?window.location.href:"");return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("title",{children:s}),(0,k.jsx)("meta",{name:"description",content:t}),(0,k.jsx)("meta",{property:"og:title",content:s}),(0,k.jsx)("meta",{property:"og:description",content:t}),(0,k.jsx)("meta",{property:"og:image",content:r}),(0,k.jsx)("meta",{property:"og:url",content:g}),(0,k.jsx)("meta",{property:"og:type",content:o}),(0,k.jsx)("meta",{property:"og:site_name",content:n}),(0,k.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,k.jsx)("meta",{name:"twitter:title",content:s}),(0,k.jsx)("meta",{name:"twitter:description",content:t}),(0,k.jsx)("meta",{name:"twitter:image",content:r})]})}var R=require("victory"),T=require("react/jsx-runtime");function gt({data:e,alt:t,chartWidth:r=600,chartHeight:a=400,average:o,referenceLineValue:n,referenceLineLabel:s="Reference",label:g}){let f=Math.max(...e.map(p=>p.count),5),v=e.map(p=>p.label);return e.length===0?null:(0,T.jsxs)("div",{className:"mb-6",role:"img","aria-label":t,children:[g&&(0,T.jsx)("label",{className:"text-xs uppercase font-bold text-gray-400 block mb-2 px-1",children:g}),(0,T.jsxs)(R.VictoryChart,{width:r,height:a,padding:{left:100,right:50,top:40,bottom:60},containerComponent:(0,T.jsx)(R.VictoryVoronoiContainer,{}),children:[(0,T.jsx)(R.VictoryAxis,{horizontal:!0,tickValues:v,style:{axis:{stroke:"#cbd5e1"},tickLabels:{fontSize:18,padding:5,fill:"#334155"}}}),(0,T.jsx)(R.VictoryAxis,{dependentAxis:!0,domain:[0,f],tickFormat:p=>typeof p=="number"?Math.round(p):p,style:{axis:{stroke:"#cbd5e1"},tickLabels:{fontSize:18,padding:5,fill:"#334155"},grid:{stroke:"#f1f5f9"}}}),(0,T.jsx)(R.VictoryBar,{horizontal:!0,domain:{x:[.5,v.length+.5],y:[0,f]},data:e,x:"label",y:"count",labels:({datum:p})=>{if(!p||p.count===0)return"";if(!p.items||p.items.length===0)return`${p.count}`;let h=p.items.slice(0,5).join(`
|
|
2
|
+
`);return p.items.length>5&&(h+=`
|
|
3
|
+
...and ${p.items.length-5} more`),h},labelComponent:(0,T.jsx)(R.VictoryTooltip,{style:{fontSize:18},flyoutStyle:{fill:"white",stroke:"#cbd5e1"},pointerLength:5,cornerRadius:2,constrainToVisibleArea:!0}),style:{data:{fill:({datum:p})=>p?.fill?p.fill==="White"?"#f3f4f6":p.fill:"#46d9d9",width:14,stroke:({datum:p})=>p?.stroke?p.stroke:p?.fill==="White"?"#d1d5db":"none",strokeWidth:({datum:p})=>p?.stroke||p?.fill==="White"?.5:0,cursor:"pointer"}},cornerRadius:2}),o!==void 0&&(0,T.jsx)(R.VictoryLine,{y:()=>o,style:{data:{stroke:"#9ca3af",strokeWidth:2,strokeDasharray:"4, 4"}},labels:["Average"],labelComponent:(0,T.jsx)(R.VictoryLabel,{y:45,style:{fill:"#475569",fontSize:18,fontWeight:"bold"},backgroundStyle:{fill:"white"},backgroundPadding:12})}),n!==void 0&&(0,T.jsx)(R.VictoryLine,{y:()=>n,labels:[s],labelComponent:(0,T.jsx)(R.VictoryLabel,{y:45,style:{fill:"#ef4444",fontSize:18,fontWeight:"bold"},backgroundStyle:{fill:"white"},backgroundPadding:12}),style:{data:{stroke:"#ef4444",strokeWidth:2,strokeDasharray:"4, 4"}}})]})]})}var M=require("victory"),P=require("react/jsx-runtime");function ut({data:e,alt:t,label:r,average:a,referenceLineValue:o,referenceLineLabel:n="Reference",chartWidth:s=600,chartHeight:g=400}){if(e.length===0)return null;let f=10,v=Math.max(...e.map(m=>m.x),o??0,f),p=Math.ceil(v/f)*f+f,b=[];for(let m=0;m<=p;m+=f)b.push(m);return(0,P.jsxs)("div",{className:"mb-6",role:"img","aria-label":t,children:[(0,P.jsx)("label",{className:"text-xs uppercase font-bold text-gray-400 block mb-2 px-1",children:r}),(0,P.jsxs)(M.VictoryChart,{width:s,height:g,padding:{left:60,right:30,top:20,bottom:70},containerComponent:(0,P.jsx)(M.VictoryVoronoiContainer,{}),children:[(0,P.jsx)(M.VictoryAxis,{label:"Length",tickValues:b,tickFormat:m=>typeof m=="number"?Math.round(m):m,style:{axis:{stroke:"#cbd5e1"},axisLabel:{fontSize:18,padding:45,fill:"#334155",fontWeight:"bold"},tickLabels:{fontSize:18,padding:5,fill:"#334155",angle:45,textAnchor:"start"}}}),(0,P.jsx)(M.VictoryAxis,{dependentAxis:!0,label:"Count",tickFormat:m=>typeof m=="number"?Math.round(m):m,style:{axis:{stroke:"#cbd5e1"},axisLabel:{fontSize:18,padding:40,fill:"#334155",fontWeight:"bold"},tickLabels:{fontSize:18,padding:5,fill:"#334155"},grid:{stroke:"#f1f5f9"}}}),(0,P.jsx)(M.VictoryHistogram,{data:e,bins:b,x:"x",labels:({datum:m})=>{if(!m||m.y===0||!m.binnedData)return"";let y=m.binnedData.map(ie=>ie.text),K=y.slice(0,5).join(`
|
|
4
|
+
`);return y.length>5&&(K+=`
|
|
5
|
+
...and ${y.length-5} more`),K},labelComponent:(0,P.jsx)(M.VictoryTooltip,{style:{fontSize:18},flyoutStyle:{fill:"white",stroke:"#cbd5e1"},pointerLength:5,cornerRadius:2,constrainToVisibleArea:!0}),style:{data:{fill:"#46d9d9",stroke:"#fff",strokeWidth:1,cursor:"pointer"}}}),a!==void 0&&(0,P.jsx)(M.VictoryLine,{x:()=>a,style:{data:{stroke:"#9ca3af",strokeWidth:2,strokeDasharray:"4, 4"}},labels:["Average"],labelComponent:(0,P.jsx)(M.VictoryLabel,{y:45,style:{fill:"#475569",fontSize:18,fontWeight:"bold"},backgroundStyle:{fill:"white"},backgroundPadding:12})}),o!==void 0&&(0,P.jsx)(M.VictoryLine,{x:()=>o,labels:[n],labelComponent:(0,P.jsx)(M.VictoryLabel,{y:45,style:{fill:"#ef4444",fontSize:18,fontWeight:"bold"},backgroundStyle:{fill:"white"},backgroundPadding:12}),style:{data:{stroke:"#ef4444",strokeWidth:2,strokeDasharray:"4, 4"}}})]})]})}0&&(module.exports={Alert,Anchor,AuthFormUI,BasePanel,Button,Checkbox,Collapsible,Dialog,DialogClose,DialogDescription,DialogTitle,DistributionBarChart,DistributionHistogram,Dropdown,DropdownItem,DropdownSeparator,Field,Heading,HelperTooltip,Icon,Input,Label,NumberField,Popover,SEO,Select,Separator,SettingsPanel,Skeleton,Slider,SliderWithNumberField,Switch,TabRadio,TabSelection,Text,TextArea,Tooltip,TypographyList,cn});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{Button as Qe}from"@base-ui/react";import Ye from"react";import{clsx as Je}from"clsx";import{twMerge as Ke}from"tailwind-merge";function s(...e){return Ke(Je(e))}import{jsx as K,jsxs as pe}from"react/jsx-runtime";var v=Ye.forwardRef(({className:e,variant:t="primary",size:r="md",isLoading:a=!1,leftIcon:i,rightIcon:o,children:n,disabled:p,render:f,nativeButton:x,isIconOnly:m,...b},h)=>{let c=m||!n&&(!!i||!!o),y={primary:"bg-primary hover:bg-dark-primary text-gray-900 shadow-sm border border-transparent font-bold disabled:bg-gray-400 disabled:hover:bg-gray-300",secondary:"bg-gray-100 hover:bg-gray-200 text-gray-800 border-gray-200 border font-normal disabled:bg-gray-400 disabled:hover:bg-gray-300",danger:"bg-danger hover:opacity-80 text-gray-900 shadow-sm border border-transparent font-bold disabled:bg-gray-400 disabled:hover:bg-gray-300",ghost:"bg-transparent hover:bg-gray-100 text-gray-700 hover:text-gray-900 font-medium","ghostly-danger":"bg-transparent hover:bg-danger/10 text-red-700 border border-red-700 font-medium disabled:border-gray-400 disabled:text-gray-400"},M={sm:c?"p-1 text-xs":"px-2 py-1 text-xs",md:c?"p-2 text-sm":"px-4 py-2 text-sm",lg:c?"p-3 text-base":"px-6 py-3 text-base"};return pe(Qe,{ref:h,render:f,nativeButton:x,className:s("inline-flex items-center justify-center rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed cursor-pointer",y[t],M[r],e),disabled:p||a,...b,children:[a&&pe("svg",{className:s("animate-spin h-4 w-4",!c&&"mr-2 -ml-1"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[K("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),K("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),!a&&i&&K("span",{className:s("inline-flex items-center justify-center",!c&&"mr-2 -ml-1"),children:i}),n,!a&&o&&K("span",{className:s("inline-flex items-center justify-center",!c&&"ml-2 -mr-1"),children:o})]})});v.displayName="Button";import{Input as ge}from"@base-ui/react";import je from"react";import{jsx as Z,jsxs as et}from"react/jsx-runtime";var Q=je.forwardRef(({className:e,leftIcon:t,rightIcon:r,id:a,...i},o)=>{let n=s("block w-full rounded-md border-0 px-1.5 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6 bg-primary/10 appearance-none",t&&"pl-10",r&&"pr-10",e);return!t&&!r?Z(ge,{ref:o,id:a,className:n,...i}):et("div",{className:"relative",children:[t&&Z("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:Z("span",{className:"text-gray-500 sm:text-sm",children:t})}),Z(ge,{ref:o,id:a,className:n,...i}),r&&Z("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:Z("span",{className:"text-gray-500 sm:text-sm",children:r})})]})});Q.displayName="Input";import be from"react";import{Select as C}from"@base-ui/react";import rt from"react";import{Fragment as tt,jsx as l,jsxs as fe}from"react/jsx-runtime";var d={check:"M20 6 9 17l-5-5",x:"M18 6 6 18M6 6l12 12",edit:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125",close:"M6 18L18 6M6 6l12 12",plus:"M12 4.5v15m7.5-7.5h-15",arrowDown:"M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3",arrowUp:"M4.5 10.5L12 3m0 0l7.5 7.5M12 3v18",clipboard:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75",cloudArrowUp:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z",arrowDownToLine:"M9 12l3 3m0 0 3-3m-3 3V2.25",folder:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15m0-3-3-3m0 0-3 3m3-3V15",arrowUpFromLine:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15m0-3-3-3m0 0-3 3m3-3V15",squares:"M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 0 1-1.125-1.125v-3.75ZM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-8.25ZM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-2.25Z",tableCells:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5",arrowsRightLeft:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5",document:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z",externalLink:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25",lock:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z",shoppingCart:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z",minus:"M5 12h14",pencilSquare:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z",pencilSquareContinued:"M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z",chevronUpSmall:"M4.5 15.75l7.5-7.5 7.5 7.5",chevronDownSmall:"M19.5 8.25l-7.5 7.5-7.5-7.5",chevronUpTable:"M8.25 6.75 12 3m0 0 3.75 3.75M12 3v18",chevronDownTable:"M15.75 17.25 12 21m0 0-3.75-3.75M12 21V3",speakerWave:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z",zap:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z",code:"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5",questionMarkCircle:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z",search:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z",exclamationCircle:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z",exclamationTriangle:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z",checkCircle:"M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z",megaphone:"M10.34 15.84c-.688-.06-1.386-.09-2.09-.09H7.5a4.5 4.5 0 1 1 0-9h.75c.704 0 1.402-.03 2.09-.09m0 9.18c.253.962.584 1.892.985 2.783.247.55.06 1.21-.463 1.511l-.657.38c-.551.318-1.26.117-1.527-.461a20.845 20.845 0 0 1-1.44-4.282m3.102.069a18.03 18.03 0 0 1-.59-4.59c0-1.586.205-3.124.59-4.59m0 9.18a23.848 23.848 0 0 1 8.835 2.535M10.34 6.66a23.847 23.847 0 0 0 8.835-2.535m0 0A23.74 23.74 0 0 0 18.795 3m.38 1.125a23.91 23.91 0 0 1 1.014 5.395m-1.014 8.855c-.118.38-.245.754-.38 1.125m.38-1.125a23.91 23.91 0 0 0 1.014-5.395m0-3.46c.495.413.811 1.035.811 1.73 0 .695-.316 1.317-.811 1.73m0-3.46a24.347 24.347 0 0 1 0 3.46",xCircle:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z",arrowsPointingIn:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25",arrowsPointingOut:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15",arrowPath:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3",arrowUturnLeft:"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3",magnifyingGlassPlus:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6",arrowsUpDown:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5",envelope:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",lockClosed:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",userCircle:"M17.982 18.725A7.488 7.488 0 0012 15.75a7.488 7.488 0 00-5.982 2.975m11.963 0a9 9 0 10-11.963 0m11.963 0A8.966 8.966 0 0112 21a8.966 8.966 0 01-5.982-2.275M15 9.75a3 3 0 11-6 0 3 3 0 016 0z",arrowRightOnRectangle:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9",chevronRight:"m8.25 4.5 7.5 7.5-7.5 7.5",arrowDownTray:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3",arrowUpTray:"M3 7.5V5.25A2.25 2.25 0 0 1 5.25 3h13.5A2.25 2.25 0 0 1 21 5.25V7.5m-4.5 4.5L12 7.5m0 0L7.5 12m4.5-4.5v13.5",import:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25",export:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15m0-3-3-3m0 0-3 3m3-3V15",home:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25",play:"M5 3l14 9-14 9V3z"},ue={eye:fe(tt,{children:[l("path",{d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),l("path",{d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),google:fe("g",{transform:"matrix(1, 0, 0, 1, 27.009001, -39.238998)",children:[l("path",{fill:"#4285F4",stroke:"none",d:"M -3.264 51.509 C -3.264 50.719 -3.334 49.969 -3.454 49.239 L -14.754 49.239 L -14.754 53.749 L -8.284 53.749 C -8.574 55.229 -9.424 56.479 -10.684 57.329 L -10.684 60.329 L -6.824 60.329 C -4.564 58.239 -3.264 55.159 -3.264 51.509 Z"}),l("path",{fill:"#34A853",stroke:"none",d:"M -14.754 63.239 C -11.514 63.239 -8.804 62.159 -6.824 60.329 L -10.684 57.329 C -11.764 58.049 -13.134 58.489 -14.754 58.489 C -17.884 58.489 -20.534 56.379 -21.484 53.529 L -25.464 53.529 L -25.464 56.619 C -23.494 60.539 -19.444 63.239 -14.754 63.239 Z"}),l("path",{fill:"#FBBC05",stroke:"none",d:"M -21.484 53.529 C -21.734 52.809 -21.864 52.039 -21.864 51.239 C -21.864 50.439 -21.724 49.669 -21.484 48.949 L -21.484 45.859 L -25.464 45.859 C -26.284 47.479 -26.754 49.299 -26.754 51.239 C -26.754 53.179 -26.284 54.999 -25.464 56.619 L -21.484 53.529 Z"}),l("path",{fill:"#EA4335",stroke:"none",d:"M -14.754 43.989 C -12.984 43.989 -11.404 44.599 -10.154 45.789 L -6.734 42.369 C -8.804 40.429 -11.514 39.239 -14.754 39.239 C -19.444 39.239 -23.494 41.939 -25.464 45.859 L -21.484 48.949 C -20.534 46.099 -17.884 43.989 -14.754 43.989 Z"})]})},he={check:l("path",{d:d.check}),x:l("path",{d:d.x}),edit:l("path",{d:d.edit}),close:l("path",{d:d.close}),plus:l("path",{d:d.plus}),arrowDown:l("path",{d:d.arrowDown}),arrowUp:l("path",{d:d.arrowUp}),clipboard:l("path",{d:d.clipboard}),cloudArrowUp:l("path",{d:d.cloudArrowUp}),arrowDownToLine:l("path",{d:d.arrowDownToLine}),folder:l("path",{d:d.folder}),arrowUpFromLine:l("path",{d:d.arrowUpFromLine}),arrowRightOnRectangle:l("path",{d:d.arrowRightOnRectangle}),squares:l("path",{d:d.squares}),tableCells:l("path",{d:d.tableCells}),arrowsRightLeft:l("path",{d:d.arrowsRightLeft}),document:l("path",{d:d.document}),externalLink:l("path",{d:d.externalLink}),lock:l("path",{d:d.lock}),shoppingCart:l("path",{d:d.shoppingCart}),minus:l("path",{d:d.minus}),pencilSquare:l("path",{d:d.pencilSquare}),pencilSquareContinued:l("path",{d:d.pencilSquareContinued}),chevronDownSmall:l("path",{d:d.chevronDownSmall}),chevronUpSmall:l("path",{d:d.chevronUpSmall}),chevronDownTable:l("path",{d:d.chevronDownTable}),chevronUpTable:l("path",{d:d.chevronUpTable}),speakerWave:l("path",{d:d.speakerWave}),zap:l("path",{d:d.zap}),code:l("path",{d:d.code}),questionMarkCircle:l("path",{d:d.questionMarkCircle}),search:l("path",{d:d.search}),exclamationCircle:l("path",{d:d.exclamationCircle}),exclamationTriangle:l("path",{d:d.exclamationTriangle}),checkCircle:l("path",{d:d.checkCircle}),megaphone:l("path",{d:d.megaphone}),xCircle:l("path",{d:d.xCircle}),arrowsPointingIn:l("path",{d:d.arrowsPointingIn}),arrowsPointingOut:l("path",{d:d.arrowsPointingOut}),arrowPath:l("path",{d:d.arrowPath}),arrowUturnLeft:l("path",{d:d.arrowUturnLeft}),magnifyingGlassPlus:l("path",{d:d.magnifyingGlassPlus}),arrowsUpDown:l("path",{d:d.arrowsUpDown}),envelope:l("path",{d:d.envelope}),lockClosed:l("path",{d:d.lockClosed}),userCircle:l("path",{d:d.userCircle}),chevronRight:l("path",{d:d.chevronRight}),arrowDownTray:l("path",{d:d.arrowDownTray}),arrowUpTray:l("path",{d:d.arrowUpTray}),import:l("path",{d:d.import}),export:l("path",{d:d.export}),home:l("path",{d:d.home}),play:l("path",{d:d.play}),eye:ue.eye,google:ue.google};import{jsx as at}from"react/jsx-runtime";var u=rt.forwardRef(({className:e,size:t="md",name:r,children:a,...i},o)=>{let n={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-6 h-6",xl:"w-8 h-8"},p=r?he[r]:a;return at("svg",{ref:o,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:s(n[t],"inline-block",e),...i,children:p})});u.displayName="Icon";import{jsx as k,jsxs as oe}from"react/jsx-runtime";var ot=be.forwardRef(({className:e,options:t,id:r,value:a,defaultValue:i,onChange:o,disabled:n,placeholder:p="Select...",onFocus:f,...x},m)=>{let b=be.useId(),h=r||b;return k("div",{className:"w-full",children:oe(C.Root,{value:a===void 0?null:String(a),defaultValue:i===void 0?void 0:String(i),onValueChange:(c,y)=>{if(o){let M=y?.event||y;o(c,M)}},disabled:n,children:[oe(C.Trigger,{ref:m,id:h,className:s("flex w-full items-center justify-between rounded-md border-0 py-1.5 pl-3 pr-3 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-primary sm:text-sm sm:leading-6 bg-primary/10 min-h-[36px]",n&&"opacity-50 cursor-not-allowed",e),onFocus:f,...x,children:[k(C.Value,{placeholder:p}),k(C.Icon,{children:k(u,{size:"sm",children:k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})})]}),k(C.Portal,{children:k(C.Positioner,{sideOffset:4,className:"z-50 w-[var(--anchor-width)]",children:k(C.Popup,{className:"max-h-60 overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:t.map((c,y)=>{let M=typeof c=="object"?c.label:c,V=typeof c=="object"?c.value:c;return oe(C.Item,{value:V,className:"relative cursor-default select-none py-2 pl-3 pr-9 text-gray-900 hover:bg-gray-100 data-[highlighted]:bg-gray-100 data-[selected]:font-semibold",children:[k(C.ItemText,{children:M}),k(C.ItemIndicator,{className:"absolute inset-y-0 right-0 flex items-center pr-4 text-primary",children:k(u,{size:"sm",children:k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})})]},`${V}-${y}`)})})})})]})})});ot.displayName="Select";import xe from"react";import{clsx as nt}from"clsx";import{twMerge as it}from"tailwind-merge";import{jsx as E,jsxs as dt}from"react/jsx-runtime";function ve(...e){return it(nt(e))}var st={1:"text-4xl font-bold",2:"text-3xl font-bold",3:"text-2xl font-bold",4:"text-xl font-bold",5:"text-lg font-bold",6:"text-base font-bold"},lt={default:"text-base text-slate-950",muted:"text-sm text-slate-600",error:"text-sm text-red-600 font-medium",small:"text-xs text-slate-600"},T=({level:e=1,className:t,children:r,...a})=>xe.createElement(`h${e}`,{className:ve(st[e],t),...a},r),N=({variant:e="default",as:t="p",className:r,children:a,...i})=>xe.createElement(t,{className:ve(lt[e],r),...i},a),Dr=({args:e})=>dt("div",{className:"space-y-4",...e,children:[E(T,{level:1,children:"Heading 1"}),E(T,{level:2,children:"Heading 2"}),E(T,{level:3,children:"Heading 3"}),E(N,{children:"Body text"}),E(N,{variant:"muted",children:"Caption text"}),E(N,{variant:"small",children:"Small text"}),E(N,{variant:"small",as:"span",children:"Small span text"})]});import ct from"react";import{Slider as _}from"@base-ui/react";import{jsx as F,jsxs as ye}from"react/jsx-runtime";var ne=ct.forwardRef(({className:e,min:t=0,max:r=100,step:a=1,value:i,defaultValue:o,disabled:n,onChange:p,name:f,icon:x,...m},b)=>{let h=(c,y)=>{p&&p(c,y)};return ye("div",{className:s("w-full flex items-center gap-4",e),children:[x&&F("div",{className:"text-gray-500 shrink-0",children:x}),F("div",{className:"flex-grow flex items-center h-8 min-w-[120px]",children:F(_.Root,{ref:b,min:t,max:r,step:a,value:i!==void 0?Array.isArray(i)?i:[i]:void 0,defaultValue:o!==void 0?Array.isArray(o)?o:[o]:void 0,disabled:n,orientation:"horizontal",...m,onValueChange:(c,y)=>{let M=y?.event||window.event;h(c,M)},className:s("relative flex items-center w-full h-full group touch-none select-none",n&&"opacity-50 cursor-not-allowed",e),children:ye(_.Control,{className:"flex items-center w-full h-full relative cursor-pointer",children:[F(_.Track,{className:"relative bg-gray-200 rounded-full w-full h-1.5 overflow-hidden transition-colors group-hover:bg-gray-300",children:F(_.Indicator,{className:"absolute bg-primary rounded-full h-full"})}),F(_.Thumb,{className:"z-10 block w-4.5 h-4.5 bg-white shadow-md rounded-full border-2 border-primary focus:outline-none focus:ring-4 focus:ring-primary/20 cursor-grab active:cursor-grabbing hover:scale-110 active:scale-95 transition-transform"})]})})}),f&&F("input",{type:"hidden",name:f,value:i})]})});ne.displayName="Slider";import pt from"react";import we from"react";import{NumberField as X}from"@base-ui/react";import{jsx as P,jsxs as mt}from"react/jsx-runtime";var ie=we.forwardRef(({className:e,value:t,defaultValue:r,min:a,max:i,step:o,onChange:n,disabled:p,readOnly:f,id:x,placeholder:m,showButtons:b=!1,...h},c)=>{let y=we.useId(),M=x||y;return P("div",{className:"w-full",children:P(X.Root,{ref:c,value:t,defaultValue:r,min:a,max:i,step:o,onValueChange:(V,J)=>{if(n){let Xe=J?.event||J;n(V,Xe)}},disabled:p,readOnly:f,className:s("flex flex-col gap-1",e),...h,children:mt("div",{className:s("group relative flex items-center rounded-md border-0 bg-primary/10 ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary shadow-sm",p&&"opacity-50 cursor-not-allowed"),children:[b&&P(X.Decrement,{"aria-label":"Decrement",className:"relative z-20 flex items-center justify-center w-8 h-9 text-gray-500 hover:text-gray-700 hover:bg-gray-100/50 rounded-l-md border-r border-gray-300 disabled:opacity-30 cursor-pointer",children:P(u,{size:"sm",children:P("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15"})})}),P(X.Input,{id:M,placeholder:m,className:s("block w-full bg-transparent border-0 px-3 py-1.5 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm sm:leading-6 text-center appearance-none relative z-0",!b&&"rounded-md")}),b&&P(X.Increment,{"aria-label":"Increment",className:"relative z-20 flex items-center justify-center w-8 h-9 text-gray-500 hover:text-gray-700 hover:bg-gray-100/50 rounded-r-md border-l border-gray-300 disabled:opacity-30 cursor-pointer",children:P(u,{size:"sm",children:P("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})}),P(X.ScrubArea,{className:"absolute inset-0 z-10 cursor-ew-resize opacity-0 hover:opacity-10 transition-opacity bg-primary/5 rounded-md pointer-events-none group-hover:pointer-events-auto"})]})})})});ie.displayName="NumberField";import{jsx as Y,jsxs as ut}from"react/jsx-runtime";var gt=pt.forwardRef(({className:e,min:t=0,max:r=100,step:a=1,value:i,defaultValue:o,disabled:n,onChange:p,inputWidth:f="w-20",...x},m)=>{let b=(h,c)=>{if(p){let y=Array.isArray(h)?h[0]:h;p(y,c)}};return ut("div",{ref:m,className:s("flex flex-row items-center gap-4 w-full min-w-0 sm:flex-nowrap flex-wrap",e),...x,children:[Y("div",{className:"flex-grow min-w-[120px]",children:Y(ne,{min:t,max:r,step:a,value:i,defaultValue:o,disabled:n,onChange:b,className:"w-full"})}),Y("div",{className:s(f,"shrink-0"),children:Y(ie,{value:i,defaultValue:o,min:t,max:r,step:a,disabled:n,onChange:(h,c)=>{h!==null&&b(h,c)},showButtons:!1})})]})});gt.displayName="SliderWithNumberField";import ft from"react";import{Tooltip as D}from"@base-ui/react";import{jsx as S,jsxs as Ne}from"react/jsx-runtime";function ht({content:e,children:t,className:r,delay:a="normal"}){return S(D.Provider,{delay:a==="slow"?1e3:0,children:Ne(D.Root,{children:[ft.isValidElement(t)?S(D.Trigger,{render:t}):S(D.Trigger,{children:t}),S(D.Portal,{children:S(D.Positioner,{sideOffset:8,children:Ne(D.Popup,{className:s("z-50 rounded shadow-lg bg-white p-2 text-xs text-center whitespace-normal max-w-xs text-gray-900 border border-gray-200",r),children:[e,S(D.Arrow,{className:"fill-white stroke-gray-200"})]})})})]})})}function ke({content:e,className:t}){return S(ht,{content:e,className:t,children:S(u,{size:"md",className:"text-gray-500 hover:text-gray-700 cursor-help",children:S("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})})})}import bt from"react";import{Dialog as H}from"@base-ui/react";import{jsx as W,jsxs as Re}from"react/jsx-runtime";function la({open:e,onOpenChange:t,trigger:r,children:a,className:i}){return Re(H.Root,{open:e,onOpenChange:(o,n)=>{t?.(o,n?.event)},children:[r&&(bt.isValidElement(r)?W(H.Trigger,{render:r}):W(H.Trigger,{children:r})),Re(H.Portal,{children:[W(H.Backdrop,{className:"fixed inset-0 z-50 bg-black/40 transition-all duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),W(H.Popup,{className:s("fixed left-[50%] top-[50%] z-50 grid w-auto max-w-[90vw] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",i),children:a})]})]})}var da=e=>W(H.Title,{...e}),ca=e=>W(H.Description,{...e}),ma=e=>W(H.Close,{...e});import{Popover as q}from"@base-ui/react";import{jsx as j,jsxs as Me}from"react/jsx-runtime";function ha({trigger:e,children:t,side:r="bottom",align:a="center",className:i,open:o,onOpenChange:n}){return Me(q.Root,{open:o,onOpenChange:n,children:[j(q.Trigger,{children:e}),j(q.Portal,{children:j(q.Positioner,{side:r,align:a,sideOffset:5,children:Me(q.Popup,{className:s("z-50 w-72 rounded-md border bg-white p-4 shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",i),children:[t,j(q.Arrow,{className:"fill-white stroke-gray-200"})]})})})]})}import se from"react";import{Menu as I}from"@base-ui/react";import{jsx as U,jsxs as yt}from"react/jsx-runtime";function Na({trigger:e,children:t,align:r="end",className:a}){return yt(I.Root,{children:[se.isValidElement(e)?U(I.Trigger,{render:e}):U(I.Trigger,{children:e}),U(I.Portal,{children:U(I.Positioner,{align:r,sideOffset:5,children:U(I.Popup,{className:s("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-white p-1 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",a),children:t})})})]})}var xt=se.forwardRef(({className:e,...t},r)=>U(I.Item,{ref:r,className:s("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-gray-100 data-[highlighted]:text-gray-900",e),...t}));xt.displayName="DropdownItem";var vt=se.forwardRef(({className:e,...t},r)=>U(I.Separator,{ref:r,className:s("-mx-1 my-1 h-px bg-gray-100",e),...t}));vt.displayName="DropdownSeparator";import{useState as wt}from"react";import{jsx as G,jsxs as Nt}from"react/jsx-runtime";function Ce({title:e,children:t,variant:r="secondary",size:a="md",defaultOpen:i=!1,className:o}){let[n,p]=wt(i);return Nt("div",{className:s("w-full",o),children:[G(v,{variant:r,size:a,className:"w-full justify-between font-medium",onClick:()=>p(!n),"aria-expanded":n,rightIcon:G(u,{className:"h-5 w-5 text-gray-600",strokeWidth:"2.5",children:n?G("path",{d:"M4.5 15.75l7.5-7.5 7.5 7.5"}):G("path",{d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),children:G("span",{children:e})}),n&&G("div",{className:"px-4 pt-4 pb-2 text-sm text-gray-500",children:t})]})}import Te from"react";import{Switch as Pe}from"@base-ui/react";import{jsx as le}from"react/jsx-runtime";var kt=Te.forwardRef(({checked:e,defaultChecked:t,onChange:r,disabled:a,className:i,id:o,...n},p)=>{let f=Te.useId(),x=o??f;return le("div",{className:s("flex items-center gap-2",i),children:le(Pe.Root,{ref:p,id:x,checked:e,defaultChecked:t,onCheckedChange:(m,b)=>{r?.(m,b?.event)},disabled:a,className:s("relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2","data-[checked]:bg-primary data-[unchecked]:bg-gray-200",a&&"opacity-50 cursor-not-allowed"),...n,children:le(Pe.Thumb,{className:s("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out","data-[checked]:translate-x-5 data-[unchecked]:translate-x-0")})})})});kt.displayName="Switch";import{jsx as Le,jsxs as Rt}from"react/jsx-runtime";function Be({children:e,tooltip:t,className:r,...a}){return Le("label",{className:s("relative block text-sm font-bold leading-6 text-gray-600 mb-1 group-focus-within:text-gray-800",r),...a,children:Rt("div",{className:"flex items-center gap-1",children:[e,t&&Le(ke,{content:t})]})})}import{jsx as ee,jsxs as Se}from"react/jsx-runtime";function Za({title:e,children:t,onClose:r,className:a="",headerClassName:i="",headingLevel:o=2,setPanel:n=p=>{}}){let p=()=>{r?r():n("None")};return Se("div",{className:`space-y-1 p-1 ${a}`,children:[Se("div",{className:`flex items-center justify-between px-1 mb-1 border-b border-solid border-gray-400 pb-1 ${i}`,children:[ee(T,{level:o,className:"text-lg",children:e}),ee(v,{variant:"ghost",size:"sm",onClick:p,className:"p-1 rounded hover:bg-gray-100 h-auto","aria-label":`Close ${e} Panel`,children:ee(u,{size:"md",className:"h-5 w-5",children:ee("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]}),t]})}import{Toggle as Mt,ToggleGroup as Ct}from"@base-ui/react";import{jsx as He}from"react/jsx-runtime";var Tt={default:"data-[pressed]:bg-white data-[pressed]:text-gray-900 data-[pressed]:shadow-sm data-[pressed]:ring-1 data-[pressed]:ring-gray-200",primary:"data-[pressed]:bg-primary/20 data-[pressed]:shadow-sm data-[pressed]:ring-1 data-[pressed]:ring-primary",danger:"data-[pressed]:bg-danger/20 data-[pressed]:shadow-sm data-[pressed]:ring-1 data-[pressed]:ring-danger"};function Xa({options:e,value:t,onChange:r,className:a,variant:i="default","aria-label":o}){return He(Ct,{value:t?[t]:[],onValueChange:n=>{r(n[0])},"aria-label":o,className:s("inline-flex p-1 space-x-1 bg-gray-100 rounded-lg border border-gray-200",a),children:e.map(n=>He(Mt,{value:n.value,disabled:n.disabled,className:s("relative cursor-pointer px-3 py-1.5 text-sm font-medium rounded-md transition-all flex items-center justify-center outline-none","text-gray-600 hover:text-gray-900 hover:bg-gray-200","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-gray-600",Tt[i]),children:n.label},n.value))})}import{Field as te}from"@base-ui/react";import Pt from"react";import{jsx as O,jsxs as de}from"react/jsx-runtime";var re=Pt.forwardRef(({label:e,description:t,error:r,tooltip:a,children:i,className:o,icon:n,labelPlacement:p="top",labelWeight:f="bold",...x},m)=>{let b=p==="left"||p==="right",h=p==="right";return de(te.Root,{ref:m,className:s("flex w-full",b?"flex-col gap-1":"flex-col gap-1.5",o),...x,children:[de("div",{className:s("flex",b?"flex-row items-center gap-2":"flex-col gap-1.5"),children:[h&&O("div",{className:"relative",children:i}),e&&O(te.Label,{render:c=>O(Be,{tooltip:a,className:s("mb-0",f==="normal"&&"font-normal"),...c,children:de("span",{className:"flex items-center gap-1",children:[n&&O("span",{className:"flex-shrink-0",children:n}),e]})})}),!h&&O("div",{className:"relative",children:i})]}),t&&O(te.Description,{className:s("text-xs text-gray-500",h&&"ml-7"),children:t}),r&&O(te.Error,{className:s("text-xs text-red-600 font-medium",h&&"ml-7"),children:r})]})});re.displayName="Field";import*as Ie from"react";import{Link as Lt}from"react-router-dom";import{jsx as De}from"react/jsx-runtime";var Bt=Ie.forwardRef(({className:e,href:t,target:r,...a},i)=>{let o=t&&!t.startsWith("http")&&!r,n=s("font-medium text-teal-700 underline underline-offset-4 hover:text-teal-900 cursor-pointer",e);return o?De(Lt,{to:t,ref:i,className:n,...a}):De("a",{href:t,target:r,ref:i,className:n,...a})});Bt.displayName="Anchor";import{Input as St}from"@base-ui/react";import Ht from"react";import{jsx as Ae}from"react/jsx-runtime";var Dt=Ht.forwardRef(({className:e,id:t,...r},a)=>Ae(St,{render:Ae("textarea",{}),ref:a,id:t,className:s("block w-full rounded-md border-0 px-1.5 py-1.5 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6 bg-primary/10 appearance-none",e),...r}));Dt.displayName="TextArea";import{Checkbox as ze}from"@base-ui/react";import It from"react";import{jsx as ae}from"react/jsx-runtime";var At=It.forwardRef(({className:e,id:t,checked:r,onChange:a,...i},o)=>ae(ze.Root,{ref:o,id:t,checked:r,onCheckedChange:n=>{a&&a({target:{checked:n===!0}})},className:s("flex h-5 w-5 shrink-0 items-center justify-center rounded border border-gray-300 bg-white shadow-sm transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","hover:border-primary hover:bg-primary/5","data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-white",e),...i,children:ae(ze.Indicator,{children:ae(u,{size:"sm",strokeWidth:3,className:"text-dark-primary",children:ae("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})})})}));At.displayName="Checkbox";import{Fragment as zt,jsx as $,jsxs as Vt}from"react/jsx-runtime";function Ro({title:e,children:t,className:r,contentClassName:a,collapsible:i,defaultOpen:o=!0,headingLevel:n=3}){let p=$("div",{className:s("flex flex-col",a),children:t});return $("div",{className:s("m-2 p-4 bg-white shadow-xl rounded-lg flex flex-1 flex-col",r),children:i?$(Ce,{title:typeof e=="string"?$(T,{level:n,className:"text-gray-600",children:e}):e,variant:"ghost",defaultOpen:o,children:p}):Vt(zt,{children:[e&&$("div",{className:"flex items-center justify-between mb-2 empty:hidden",children:typeof e=="string"?$(T,{level:n,className:"text-gray-600",children:e}):e}),p]})})}import*as Ve from"react";import{Separator as Ee}from"@base-ui/react/separator";import{jsx as Ft}from"react/jsx-runtime";var Et=Ve.forwardRef(({className:e,orientation:t="horizontal",...r},a)=>Ft(Ee,{ref:a,orientation:t,className:s("shrink-0 bg-gray-200",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Et.displayName=Ee.displayName;import{jsx as Wt}from"react/jsx-runtime";function Ho({className:e,...t}){return Wt("div",{className:s("animate-pulse rounded-md bg-gray-200/50",e),...t})}import{useFormStatus as Ut}from"react-dom";import{jsx as g,jsxs as w}from"react/jsx-runtime";function ce({label:e}){let{pending:t}=Ut();return g(v,{type:"submit",variant:"primary",isLoading:t,disabled:t,children:e})}function Vo({mode:e,onModeChange:t,formAction:r,actionState:a,onGoogleSignIn:i,title:o,description:n}){return w("div",{className:"text-left overflow-hidden",children:[g(T,{level:2,className:"text-center mb-2",children:o||(e==="signing up"?"Sign up":e==="signing in"?"Sign In":"Reset Password")}),w("form",{className:"md:m-10 sm:m-4 space-y-4",action:r,children:[n&&g(N,{className:"text-center mb-6",variant:"muted",children:n}),e==="resetting password"&&g(N,{className:"text-center font-bold text-dark-primary",children:a.message}),g(N,{className:"text-center",variant:"error",children:a.error}),w("div",{className:"space-y-4",children:[g(re,{id:"email",label:"Email",error:a.error&&a.error.includes("email")?a.error:"",children:g(Q,{name:"email",type:"email",required:!0,placeholder:"Email",leftIcon:g(u,{name:"envelope"})})}),e!=="resetting password"&&g(re,{id:"password",label:"Password",error:a.error&&a.error.includes("password")?a.error:"",children:g(Q,{name:"password",type:"password",required:!0,placeholder:"Password",leftIcon:g(u,{name:"lockClosed"})})})]}),w("div",{className:"text-center mt-6 space-y-4",children:[e==="signing up"&&g(ce,{label:"Sign Up"}),e==="signing in"&&g(ce,{label:"Sign In"}),e==="resetting password"&&g(ce,{label:"Reset Password"}),w("div",{className:"text-center text-sm text-gray-500",children:[e==="signing up"&&w(N,{children:["Already have an account?"," ",g(v,{variant:"ghost",size:"sm",onClick:()=>t("signing in"),className:"underline p-0 h-auto hover:bg-transparent",children:"Sign in"})]}),e==="signing in"&&w("div",{className:"flex flex-col gap-2",children:[w(N,{children:["Forgot your password?"," ",g(v,{variant:"ghost",size:"sm",onClick:()=>t("resetting password"),className:"underline p-0 h-auto hover:bg-transparent",children:"Reset password."})]}),w("div",{className:"relative",children:[g("div",{className:"absolute inset-0 flex items-center",children:g("div",{className:"w-full border-t border-gray-300"})}),g("div",{className:"relative flex justify-center text-sm",children:g("span",{className:"px-2 bg-white text-gray-500",children:"or"})})]}),w(N,{children:["Don't have an account?"," ",g(v,{variant:"ghost",size:"sm",onClick:()=>t("signing up"),className:"underline p-0 h-auto hover:bg-transparent",children:"Sign up"})]})]}),e==="resetting password"&&w("div",{className:"flex flex-col gap-2",children:[w(N,{children:["Don't have an account?"," ",g(v,{variant:"ghost",size:"sm",onClick:()=>t("signing up"),className:"underline p-0 h-auto hover:bg-transparent",children:"Sign up"})]}),w("div",{className:"relative",children:[g("div",{className:"absolute inset-0 flex items-center",children:g("div",{className:"w-full border-t border-gray-300"})}),g("div",{className:"relative flex justify-center text-sm",children:g("span",{className:"px-2 bg-white text-gray-500",children:"or"})})]}),w(N,{children:["Remembered your password?",g(v,{variant:"ghost",size:"sm",onClick:()=>t("signing in"),className:"underline p-0 h-auto hover:bg-transparent",children:"Sign In"})]})]})]})]}),e!=="resetting password"&&i&&g("div",{className:"text-center mt-4",children:w(v,{variant:"secondary",onClick:i,type:"button",className:"w-full flex items-center justify-center gap-2",children:[g(u,{name:"google",stroke:"none"}),e==="signing up"&&g("span",{children:"Sign up with Google"}),e==="signing in"&&g("span",{children:"Sign in with Google"})]})})]})]})}import{useState as Ot}from"react";import{jsx as A,jsxs as Fe}from"react/jsx-runtime";function Oo({level:e,message:t,action:r}){let[a,i]=Ot(!0);return Fe("div",{className:"flex w-full p-4 m-1 text-sm rounded-lg bg-white border border-solid transition-opacity ease-in-out delay-150 duration-300 "+(a?" ":" hidden"),children:[Fe("span",{children:[e==="Error"&&A(u,{name:"exclamationCircle",size:"lg",className:"m-2",stroke:"red"}),e==="Warning"&&A(u,{name:"exclamationTriangle",size:"lg",className:"m-2",stroke:"yellow"}),e==="Success"&&A(u,{name:"checkCircle",size:"lg",className:"m-2",stroke:"green"}),e==="Info"&&A(u,{name:"megaphone",size:"lg",className:"m-2"})]}),A("span",{className:"flex flex-1 ml-2",children:t}),r&&A(v,{onClick:()=>{r.callback(),i(!1)},children:r.name}),A("span",{className:"cursor-pointer",onClick:()=>{i(!1)},children:A(u,{name:"xCircle",size:"lg",className:"m-1"})})]})}import{jsx as z,jsxs as me}from"react/jsx-runtime";function $o({tabs:e,activeTabId:t,onTabClick:r,onAddClick:a,className:i=""}){return me("div",{className:`overflow-x-auto max-h-20 text-sm whitespace-nowrap ${i}`,children:[e.map(o=>{let n=o.id===t;return me("div",{className:"inline-block align-middle m-1 px-2 py-2 cursor-pointer rounded-sm "+(n?"font-bold bg-primary/30":"font-gray-300 bg-gray-200"),onClick:()=>r(o.id),children:[z("span",{className:"inline-block align-middle",children:o.label}),n&&(o.onEdit||o.onClose)&&me("span",{className:"inline-flex items-center ml-2 align-middle",children:[o.onEdit&&z(v,{variant:"ghost",size:"sm","aria-label":"Edit Tab",onClick:p=>{p.stopPropagation(),o.onEdit()},leftIcon:z(u,{name:"edit",size:"sm"})}),o.onEdit&&o.onClose&&z("span",{className:"opacity-10 align-middle mx-1",children:" | "}),o.onClose&&z(v,{variant:"ghost",size:"sm","aria-label":"Close Tab",onClick:p=>{p.stopPropagation(),o.onClose()},leftIcon:z(u,{name:"close",size:"sm"})})]})]},o.id)}),a&&z(v,{variant:"primary",size:"sm","aria-label":"Create New Tab",onClick:a,leftIcon:z(u,{name:"plus",size:"sm"}),className:"m-1 align-middle inline-flex"})]})}import{Fragment as Zt,jsx as R,jsxs as qt}from"react/jsx-runtime";function Mn({title:e,description:t="Peerbots platform: social robots for everyone, powered by experts.",image:r="/peerbots-logo.png",url:a,type:i="website"}){let o="Peerbots App",n=e==="Home"?o:`${e} | ${o}`,p=a||(typeof window<"u"?window.location.href:"");return qt(Zt,{children:[R("title",{children:n}),R("meta",{name:"description",content:t}),R("meta",{property:"og:title",content:n}),R("meta",{property:"og:description",content:t}),R("meta",{property:"og:image",content:r}),R("meta",{property:"og:url",content:p}),R("meta",{property:"og:type",content:i}),R("meta",{property:"og:site_name",content:o}),R("meta",{name:"twitter:card",content:"summary_large_image"}),R("meta",{name:"twitter:title",content:n}),R("meta",{name:"twitter:description",content:t}),R("meta",{name:"twitter:image",content:r})]})}import{VictoryChart as Gt,VictoryBar as $t,VictoryAxis as We,VictoryTooltip as _t,VictoryVoronoiContainer as Xt,VictoryLine as Ue,VictoryLabel as Oe}from"victory";import{jsx as L,jsxs as Ze}from"react/jsx-runtime";function Jt({data:e,alt:t,chartWidth:r=600,chartHeight:a=400,average:i,referenceLineValue:o,referenceLineLabel:n="Reference",label:p}){let f=Math.max(...e.map(m=>m.count),5),x=e.map(m=>m.label);return e.length===0?null:Ze("div",{className:"mb-6",role:"img","aria-label":t,children:[p&&L("label",{className:"text-xs uppercase font-bold text-gray-400 block mb-2 px-1",children:p}),Ze(Gt,{width:r,height:a,padding:{left:100,right:50,top:40,bottom:60},containerComponent:L(Xt,{}),children:[L(We,{horizontal:!0,tickValues:x,style:{axis:{stroke:"#cbd5e1"},tickLabels:{fontSize:18,padding:5,fill:"#334155"}}}),L(We,{dependentAxis:!0,domain:[0,f],tickFormat:m=>typeof m=="number"?Math.round(m):m,style:{axis:{stroke:"#cbd5e1"},tickLabels:{fontSize:18,padding:5,fill:"#334155"},grid:{stroke:"#f1f5f9"}}}),L($t,{horizontal:!0,domain:{x:[.5,x.length+.5],y:[0,f]},data:e,x:"label",y:"count",labels:({datum:m})=>{if(!m||m.count===0)return"";if(!m.items||m.items.length===0)return`${m.count}`;let h=m.items.slice(0,5).join(`
|
|
2
|
+
`);return m.items.length>5&&(h+=`
|
|
3
|
+
...and ${m.items.length-5} more`),h},labelComponent:L(_t,{style:{fontSize:18},flyoutStyle:{fill:"white",stroke:"#cbd5e1"},pointerLength:5,cornerRadius:2,constrainToVisibleArea:!0}),style:{data:{fill:({datum:m})=>m?.fill?m.fill==="White"?"#f3f4f6":m.fill:"#46d9d9",width:14,stroke:({datum:m})=>m?.stroke?m.stroke:m?.fill==="White"?"#d1d5db":"none",strokeWidth:({datum:m})=>m?.stroke||m?.fill==="White"?.5:0,cursor:"pointer"}},cornerRadius:2}),i!==void 0&&L(Ue,{y:()=>i,style:{data:{stroke:"#9ca3af",strokeWidth:2,strokeDasharray:"4, 4"}},labels:["Average"],labelComponent:L(Oe,{y:45,style:{fill:"#475569",fontSize:18,fontWeight:"bold"},backgroundStyle:{fill:"white"},backgroundPadding:12})}),o!==void 0&&L(Ue,{y:()=>o,labels:[n],labelComponent:L(Oe,{y:45,style:{fill:"#ef4444",fontSize:18,fontWeight:"bold"},backgroundStyle:{fill:"white"},backgroundPadding:12}),style:{data:{stroke:"#ef4444",strokeWidth:2,strokeDasharray:"4, 4"}}})]})]})}import{VictoryChart as Kt,VictoryAxis as qe,VictoryLabel as Ge,VictoryLine as $e,VictoryHistogram as Qt,VictoryTooltip as Yt,VictoryVoronoiContainer as jt}from"victory";import{jsx as B,jsxs as _e}from"react/jsx-runtime";function er({data:e,alt:t,label:r,average:a,referenceLineValue:i,referenceLineLabel:o="Reference",chartWidth:n=600,chartHeight:p=400}){if(e.length===0)return null;let f=10,x=Math.max(...e.map(c=>c.x),i??0,f),m=Math.ceil(x/f)*f+f,b=[];for(let c=0;c<=m;c+=f)b.push(c);return _e("div",{className:"mb-6",role:"img","aria-label":t,children:[B("label",{className:"text-xs uppercase font-bold text-gray-400 block mb-2 px-1",children:r}),_e(Kt,{width:n,height:p,padding:{left:60,right:30,top:20,bottom:70},containerComponent:B(jt,{}),children:[B(qe,{label:"Length",tickValues:b,tickFormat:c=>typeof c=="number"?Math.round(c):c,style:{axis:{stroke:"#cbd5e1"},axisLabel:{fontSize:18,padding:45,fill:"#334155",fontWeight:"bold"},tickLabels:{fontSize:18,padding:5,fill:"#334155",angle:45,textAnchor:"start"}}}),B(qe,{dependentAxis:!0,label:"Count",tickFormat:c=>typeof c=="number"?Math.round(c):c,style:{axis:{stroke:"#cbd5e1"},axisLabel:{fontSize:18,padding:40,fill:"#334155",fontWeight:"bold"},tickLabels:{fontSize:18,padding:5,fill:"#334155"},grid:{stroke:"#f1f5f9"}}}),B(Qt,{data:e,bins:b,x:"x",labels:({datum:c})=>{if(!c||c.y===0||!c.binnedData)return"";let y=c.binnedData.map(J=>J.text),V=y.slice(0,5).join(`
|
|
4
|
+
`);return y.length>5&&(V+=`
|
|
5
|
+
...and ${y.length-5} more`),V},labelComponent:B(Yt,{style:{fontSize:18},flyoutStyle:{fill:"white",stroke:"#cbd5e1"},pointerLength:5,cornerRadius:2,constrainToVisibleArea:!0}),style:{data:{fill:"#46d9d9",stroke:"#fff",strokeWidth:1,cursor:"pointer"}}}),a!==void 0&&B($e,{x:()=>a,style:{data:{stroke:"#9ca3af",strokeWidth:2,strokeDasharray:"4, 4"}},labels:["Average"],labelComponent:B(Ge,{y:45,style:{fill:"#475569",fontSize:18,fontWeight:"bold"},backgroundStyle:{fill:"white"},backgroundPadding:12})}),i!==void 0&&B($e,{x:()=>i,labels:[o],labelComponent:B(Ge,{y:45,style:{fill:"#ef4444",fontSize:18,fontWeight:"bold"},backgroundStyle:{fill:"white"},backgroundPadding:12}),style:{data:{stroke:"#ef4444",strokeWidth:2,strokeDasharray:"4, 4"}}})]})]})}export{Oo as Alert,Bt as Anchor,Vo as AuthFormUI,Za as BasePanel,v as Button,At as Checkbox,Ce as Collapsible,la as Dialog,ma as DialogClose,ca as DialogDescription,da as DialogTitle,Jt as DistributionBarChart,er as DistributionHistogram,Na as Dropdown,xt as DropdownItem,vt as DropdownSeparator,re as Field,T as Heading,ke as HelperTooltip,u as Icon,Q as Input,Be as Label,ie as NumberField,ha as Popover,Mn as SEO,ot as Select,Et as Separator,Ro as SettingsPanel,Ho as Skeleton,ne as Slider,gt as SliderWithNumberField,kt as Switch,Xa as TabRadio,$o as TabSelection,N as Text,Dt as TextArea,ht as Tooltip,Dr as TypographyList,s as cn};
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@peerbots/core",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"license": "GPL-3.0-only",
|
|
10
|
+
"author": "Peerbots",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/peerbots/peerbots-core.git"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --minify",
|
|
17
|
+
"changeset": "changeset",
|
|
18
|
+
"release": "changeset publish",
|
|
19
|
+
"storybook": "storybook dev -p 6006",
|
|
20
|
+
"build-storybook": "storybook build"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"clsx": "^2.1.1",
|
|
24
|
+
"tailwind-merge": "^3.4.1"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@base-ui/react": "^1.2.0",
|
|
28
|
+
"react": "^19.2.4",
|
|
29
|
+
"react-dom": "^19.2.4",
|
|
30
|
+
"react-router-dom": "^7",
|
|
31
|
+
"tailwindcss": "^4.2.0",
|
|
32
|
+
"victory": "^37.3.6"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@changesets/cli": "^2.30.0",
|
|
36
|
+
"@chromatic-com/storybook": "^5.1.1",
|
|
37
|
+
"@storybook/addon-a11y": "^10.3.3",
|
|
38
|
+
"@storybook/addon-docs": "^10.3.3",
|
|
39
|
+
"@storybook/addon-onboarding": "^10.3.3",
|
|
40
|
+
"@storybook/addon-vitest": "^10.3.3",
|
|
41
|
+
"@storybook/react-vite": "^10.3.3",
|
|
42
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
43
|
+
"@types/react": "^19.2.14",
|
|
44
|
+
"@types/react-dom": "^19.2.3",
|
|
45
|
+
"@vitest/browser-playwright": "^4.1.2",
|
|
46
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
47
|
+
"playwright": "^1.58.2",
|
|
48
|
+
"react": "^19.2.4",
|
|
49
|
+
"react-dom": "^19.2.4",
|
|
50
|
+
"storybook": "^10.3.3",
|
|
51
|
+
"tsup": "^8.5.1",
|
|
52
|
+
"typescript": "^6.0.2",
|
|
53
|
+
"vitest": "^4.1.2"
|
|
54
|
+
},
|
|
55
|
+
"description": "The core shared components, styles and helpers for Peerbots web applications.",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/peerbots/peerbots-core/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/peerbots/peerbots-core#readme"
|
|
60
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { DistributionBarChart } from "./DistributionBarChart";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof DistributionBarChart> = {
|
|
5
|
+
title: "Charts/DistributionBarChart",
|
|
6
|
+
component: DistributionBarChart,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "padded",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
args: {
|
|
17
|
+
alt: "Default emotion distribution bar chart.",
|
|
18
|
+
data: [
|
|
19
|
+
{ label: "Happy", count: 12, items: ["Hello!", "How are you?"] },
|
|
20
|
+
{ label: "Sad", count: 3, items: ["I am sad."] },
|
|
21
|
+
{ label: "Neutral", count: 20, items: ["Okay.", "Yes.", "No."] },
|
|
22
|
+
],
|
|
23
|
+
average: 11,
|
|
24
|
+
referenceLineValue: 15,
|
|
25
|
+
referenceLineLabel: "Target",
|
|
26
|
+
label: "Emotion",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Variations: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
alt: "Color variation bar chart.",
|
|
33
|
+
data: [
|
|
34
|
+
{ label: "Red", count: 15, fill: "Red" },
|
|
35
|
+
{ label: "Blue", count: 8, fill: "Blue" },
|
|
36
|
+
{ label: "White", count: 5, fill: "White" },
|
|
37
|
+
{ label: "Custom", count: 10, fill: "#ff00ff", stroke: "#000" },
|
|
38
|
+
],
|
|
39
|
+
label: "Color Variations",
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {
|
|
2
|
+
VictoryChart,
|
|
3
|
+
VictoryBar,
|
|
4
|
+
VictoryAxis,
|
|
5
|
+
VictoryTooltip,
|
|
6
|
+
VictoryVoronoiContainer,
|
|
7
|
+
VictoryLine,
|
|
8
|
+
VictoryLabel,
|
|
9
|
+
} from "victory";
|
|
10
|
+
|
|
11
|
+
export interface DistributionBarData {
|
|
12
|
+
label: string;
|
|
13
|
+
count: number;
|
|
14
|
+
items?: string[];
|
|
15
|
+
fill?: string;
|
|
16
|
+
stroke?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DistributionBarChartProps {
|
|
20
|
+
data: DistributionBarData[];
|
|
21
|
+
alt: string;
|
|
22
|
+
chartWidth?: number;
|
|
23
|
+
chartHeight?: number;
|
|
24
|
+
average?: number;
|
|
25
|
+
referenceLineValue?: number;
|
|
26
|
+
referenceLineLabel?: string;
|
|
27
|
+
label?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function DistributionBarChart({
|
|
31
|
+
data,
|
|
32
|
+
alt,
|
|
33
|
+
chartWidth = 600,
|
|
34
|
+
chartHeight = 400,
|
|
35
|
+
average,
|
|
36
|
+
referenceLineValue,
|
|
37
|
+
referenceLineLabel = "Reference",
|
|
38
|
+
label,
|
|
39
|
+
}: DistributionBarChartProps) {
|
|
40
|
+
const maxCount = Math.max(...data.map((d) => d.count), 5);
|
|
41
|
+
const labels = data.map((d) => d.label);
|
|
42
|
+
|
|
43
|
+
if (data.length === 0) return null;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div className="mb-6" role="img" aria-label={alt}>
|
|
47
|
+
{label && (
|
|
48
|
+
<label className="text-xs uppercase font-bold text-gray-400 block mb-2 px-1">
|
|
49
|
+
{label}
|
|
50
|
+
</label>
|
|
51
|
+
)}
|
|
52
|
+
<VictoryChart
|
|
53
|
+
width={chartWidth}
|
|
54
|
+
height={chartHeight}
|
|
55
|
+
padding={{ left: 100, right: 50, top: 40, bottom: 60 }}
|
|
56
|
+
containerComponent={<VictoryVoronoiContainer />}
|
|
57
|
+
>
|
|
58
|
+
<VictoryAxis
|
|
59
|
+
horizontal
|
|
60
|
+
tickValues={labels}
|
|
61
|
+
style={{
|
|
62
|
+
axis: { stroke: "#cbd5e1" },
|
|
63
|
+
tickLabels: { fontSize: 18, padding: 5, fill: "#334155" },
|
|
64
|
+
}}
|
|
65
|
+
/>
|
|
66
|
+
<VictoryAxis
|
|
67
|
+
dependentAxis
|
|
68
|
+
domain={[0, maxCount]}
|
|
69
|
+
tickFormat={(x: number | string) =>
|
|
70
|
+
typeof x === "number" ? Math.round(x) : x
|
|
71
|
+
}
|
|
72
|
+
style={{
|
|
73
|
+
axis: { stroke: "#cbd5e1" },
|
|
74
|
+
tickLabels: { fontSize: 18, padding: 5, fill: "#334155" },
|
|
75
|
+
grid: { stroke: "#f1f5f9" },
|
|
76
|
+
}}
|
|
77
|
+
/>
|
|
78
|
+
<VictoryBar
|
|
79
|
+
horizontal
|
|
80
|
+
domain={{ x: [0.5, labels.length + 0.5], y: [0, maxCount] }}
|
|
81
|
+
data={data}
|
|
82
|
+
x={"label"}
|
|
83
|
+
y={"count"}
|
|
84
|
+
labels={({ datum }: { datum?: DistributionBarData }) => {
|
|
85
|
+
if (!datum || datum.count === 0) return "";
|
|
86
|
+
if (!datum.items || datum.items.length === 0)
|
|
87
|
+
return `${datum.count}`;
|
|
88
|
+
const displayItems = datum.items.slice(0, 5);
|
|
89
|
+
let labelText = displayItems.join("\n");
|
|
90
|
+
if (datum.items.length > 5)
|
|
91
|
+
labelText += `\n...and ${datum.items.length - 5} more`;
|
|
92
|
+
return labelText;
|
|
93
|
+
}}
|
|
94
|
+
labelComponent={
|
|
95
|
+
<VictoryTooltip
|
|
96
|
+
style={{ fontSize: 18 }}
|
|
97
|
+
flyoutStyle={{ fill: "white", stroke: "#cbd5e1" }}
|
|
98
|
+
pointerLength={5}
|
|
99
|
+
cornerRadius={2}
|
|
100
|
+
constrainToVisibleArea
|
|
101
|
+
/>
|
|
102
|
+
}
|
|
103
|
+
style={{
|
|
104
|
+
data: {
|
|
105
|
+
fill: ({ datum }: { datum?: DistributionBarData }) =>
|
|
106
|
+
datum?.fill
|
|
107
|
+
? datum.fill === "White"
|
|
108
|
+
? "#f3f4f6"
|
|
109
|
+
: datum.fill
|
|
110
|
+
: "#46d9d9",
|
|
111
|
+
width: 14,
|
|
112
|
+
stroke: ({ datum }: { datum?: DistributionBarData }) =>
|
|
113
|
+
datum?.stroke
|
|
114
|
+
? datum.stroke
|
|
115
|
+
: datum?.fill === "White"
|
|
116
|
+
? "#d1d5db"
|
|
117
|
+
: "none",
|
|
118
|
+
strokeWidth: ({ datum }: { datum?: DistributionBarData }) =>
|
|
119
|
+
datum?.stroke || datum?.fill === "White" ? 0.5 : 0,
|
|
120
|
+
cursor: "pointer",
|
|
121
|
+
},
|
|
122
|
+
}}
|
|
123
|
+
cornerRadius={2}
|
|
124
|
+
/>
|
|
125
|
+
{average !== undefined && (
|
|
126
|
+
<VictoryLine
|
|
127
|
+
y={() => average}
|
|
128
|
+
style={{
|
|
129
|
+
data: {
|
|
130
|
+
stroke: "#9ca3af",
|
|
131
|
+
strokeWidth: 2,
|
|
132
|
+
strokeDasharray: "4, 4",
|
|
133
|
+
},
|
|
134
|
+
}}
|
|
135
|
+
labels={["Average"]}
|
|
136
|
+
labelComponent={
|
|
137
|
+
<VictoryLabel
|
|
138
|
+
y={45}
|
|
139
|
+
style={{ fill: "#475569", fontSize: 18, fontWeight: "bold" }}
|
|
140
|
+
backgroundStyle={{ fill: "white" }}
|
|
141
|
+
backgroundPadding={12}
|
|
142
|
+
/>
|
|
143
|
+
}
|
|
144
|
+
/>
|
|
145
|
+
)}
|
|
146
|
+
{referenceLineValue !== undefined && (
|
|
147
|
+
<VictoryLine
|
|
148
|
+
y={() => referenceLineValue}
|
|
149
|
+
labels={[referenceLineLabel]}
|
|
150
|
+
labelComponent={
|
|
151
|
+
<VictoryLabel
|
|
152
|
+
y={45}
|
|
153
|
+
style={{ fill: "#ef4444", fontSize: 18, fontWeight: "bold" }}
|
|
154
|
+
backgroundStyle={{ fill: "white" }}
|
|
155
|
+
backgroundPadding={12}
|
|
156
|
+
/>
|
|
157
|
+
}
|
|
158
|
+
style={{
|
|
159
|
+
data: {
|
|
160
|
+
stroke: "#ef4444",
|
|
161
|
+
strokeWidth: 2,
|
|
162
|
+
strokeDasharray: "4, 4",
|
|
163
|
+
},
|
|
164
|
+
}}
|
|
165
|
+
/>
|
|
166
|
+
)}
|
|
167
|
+
</VictoryChart>
|
|
168
|
+
</div>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { DistributionHistogram } from "./DistributionHistogram";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof DistributionHistogram> = {
|
|
5
|
+
title: "Charts/DistributionHistogram",
|
|
6
|
+
component: DistributionHistogram,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "padded",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
|
|
15
|
+
const fakeData = Array.from({ length: 50 }).map((_, i) => ({
|
|
16
|
+
x: Math.floor(Math.abs(Math.sin(i * 123.45)) * 100),
|
|
17
|
+
text: `Fake message ${i}`,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export const Default: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
alt: "Default distribution histogram showing fake data.",
|
|
23
|
+
data: fakeData,
|
|
24
|
+
label: "Data",
|
|
25
|
+
average: 45,
|
|
26
|
+
referenceLineValue: 80,
|
|
27
|
+
referenceLineLabel: "Reference",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const WithoutReferenceLine: Story = {
|
|
32
|
+
args: {
|
|
33
|
+
alt: "Distribution histogram without reference line.",
|
|
34
|
+
data: fakeData,
|
|
35
|
+
label: "Data With Average",
|
|
36
|
+
average: 45,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const WithoutAverage: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
alt: "Distribution histogram without average line.",
|
|
43
|
+
data: fakeData,
|
|
44
|
+
label: "Data With Reference Line",
|
|
45
|
+
referenceLineValue: 80,
|
|
46
|
+
referenceLineLabel: "Reference Label",
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const WithoutAverageOrReferenceLine: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
alt: "Distribution histogram without average or reference lines.",
|
|
53
|
+
data: fakeData,
|
|
54
|
+
label: "Data",
|
|
55
|
+
},
|
|
56
|
+
};
|