@synertech/ui 0.46.3 → 0.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/use-synertech-ui/SKILL.md +102 -3
- package/README.md +50 -0
- package/dist/components/area-chart/AreaChart.cjs +1 -1
- package/dist/components/area-chart/AreaChart.js +1 -1
- package/dist/components/badge/Badge.cjs +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/bar-chart/BarChart.cjs +1 -1
- package/dist/components/bar-chart/BarChart.js +1 -1
- package/dist/components/box-plot/BoxPlot.cjs +1 -1
- package/dist/components/box-plot/BoxPlot.js +1 -1
- package/dist/components/breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/bullet-chart/BulletChart.cjs +1 -1
- package/dist/components/bullet-chart/BulletChart.js +1 -1
- package/dist/components/button/Button.cjs +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/calendar/Calendar.cjs +1 -1
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/candlestick-chart/CandlestickChart.cjs +1 -1
- package/dist/components/candlestick-chart/CandlestickChart.js +1 -1
- package/dist/components/chart/ChartBrush.cjs +1 -1
- package/dist/components/chart/ChartBrush.js +1 -1
- package/dist/components/chart/ChartContainer.cjs +1 -1
- package/dist/components/chart/ChartContainer.js +1 -1
- package/dist/components/chart/ChartExportButton.cjs +1 -1
- package/dist/components/chart/ChartExportButton.js +1 -1
- package/dist/components/chart/ChartLegend.cjs +1 -1
- package/dist/components/chart/ChartLegend.js +1 -1
- package/dist/components/chart/ChartPeriodPicker.cjs +1 -1
- package/dist/components/chart/ChartPeriodPicker.js +1 -1
- package/dist/components/checkbox/Checkbox.cjs +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/checkbox/CheckboxGroup.cjs +1 -1
- package/dist/components/checkbox/CheckboxGroup.js +1 -1
- package/dist/components/chip/Chip.cjs +1 -1
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/circular-progress/CircularProgress.cjs +1 -1
- package/dist/components/circular-progress/CircularProgress.js +1 -1
- package/dist/components/datagrid/DataGrid.cjs +1 -1
- package/dist/components/datagrid/DataGrid.js +1 -1
- package/dist/components/dropdown/DropdownCheckboxItem.cjs +1 -1
- package/dist/components/dropdown/DropdownCheckboxItem.js +1 -1
- package/dist/components/dropdown/DropdownRadio.cjs +1 -1
- package/dist/components/dropdown/DropdownRadio.js +1 -1
- package/dist/components/dropdown/DropdownTrigger.cjs +1 -1
- package/dist/components/dropdown/DropdownTrigger.js +1 -1
- package/dist/components/dumbbell-chart/DumbbellChart.cjs +1 -1
- package/dist/components/dumbbell-chart/DumbbellChart.js +1 -1
- package/dist/components/file-selector/FileSelector.cjs +1 -1
- package/dist/components/file-selector/FileSelector.js +1 -1
- package/dist/components/footer/FooterLink.cjs +1 -1
- package/dist/components/footer/FooterLink.js +1 -1
- package/dist/components/footer/FooterSocial.cjs +1 -1
- package/dist/components/footer/FooterSocial.js +1 -1
- package/dist/components/form/number-input/NumberInput.cjs +1 -1
- package/dist/components/form/number-input/NumberInput.js +1 -1
- package/dist/components/funnel-chart/FunnelChart.cjs +1 -1
- package/dist/components/funnel-chart/FunnelChart.js +1 -1
- package/dist/components/gantt-chart/GanttChart.cjs +1 -1
- package/dist/components/gantt-chart/GanttChart.js +1 -1
- package/dist/components/header/Header.cjs +1 -1
- package/dist/components/header/Header.js +1 -1
- package/dist/components/heat-map/Heatmap.cjs +1 -1
- package/dist/components/heat-map/Heatmap.js +1 -1
- package/dist/components/help-button/HelpButton.cjs +6 -6
- package/dist/components/help-button/HelpButton.js +7 -7
- package/dist/components/help-button/sanitize-html.cjs +1 -0
- package/dist/components/help-button/sanitize-html.js +1 -0
- package/dist/components/image-uploader/ImageUploader.cjs +1 -1
- package/dist/components/image-uploader/ImageUploader.js +1 -1
- package/dist/components/indicator/Indicator.cjs +1 -1
- package/dist/components/indicator/Indicator.js +1 -1
- package/dist/components/label/Label.cjs +1 -1
- package/dist/components/label/Label.js +1 -1
- package/dist/components/line-chart/LineChart.cjs +1 -1
- package/dist/components/line-chart/LineChart.js +1 -1
- package/dist/components/modal/Modal.cjs +1 -1
- package/dist/components/modal/Modal.js +1 -1
- package/dist/components/pagination/Pagination.cjs +1 -1
- package/dist/components/pagination/Pagination.js +1 -1
- package/dist/components/pie-chart/PieChart.cjs +1 -1
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/progress-bar/ProgressBar.cjs +1 -1
- package/dist/components/progress-bar/ProgressBar.js +1 -1
- package/dist/components/radio-button/RadioButton.cjs +1 -1
- package/dist/components/radio-button/RadioButton.js +1 -1
- package/dist/components/scatter-chart/ScatterChart.cjs +1 -1
- package/dist/components/scatter-chart/ScatterChart.js +1 -1
- package/dist/components/schema-editor/SchemaEditor.cjs +1 -1
- package/dist/components/schema-editor/SchemaEditor.js +1 -1
- package/dist/components/schema-editor/tables/SchemaTableRenderer.cjs +1 -1
- package/dist/components/schema-editor/tables/SchemaTableRenderer.js +1 -1
- package/dist/components/select/Select.cjs +1 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/sidebar/Sidebar.cjs +1 -1
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/slider/Slider.cjs +1 -1
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/tabs/TabsContent.cjs +1 -1
- package/dist/components/tabs/TabsContent.js +1 -1
- package/dist/components/tabs/TabsTrigger.cjs +1 -1
- package/dist/components/tabs/TabsTrigger.js +1 -1
- package/dist/components/waterfall-chart/WaterfallChart.cjs +1 -1
- package/dist/components/waterfall-chart/WaterfallChart.js +1 -1
- package/dist/components/wizard/Wizard.cjs +1 -1
- package/dist/components/wizard/Wizard.js +1 -1
- package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.cjs +1 -1
- package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.js +1 -1
- package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.cjs +1 -1
- package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.js +1 -1
- package/dist/index.d.cts +170 -12
- package/dist/index.d.ts +170 -12
- package/dist/lib/safe-href.cjs +1 -0
- package/dist/lib/safe-href.js +1 -0
- package/dist/styles.css +618 -249
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var V=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var
|
|
1
|
+
"use strict";"use client";var V=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var i in e)V(t,i,{get:e[i],enumerable:!0})},ae=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ee(e))!te.call(t,n)&&n!==i&&V(t,n,{get:()=>e[n],enumerable:!(s=$(e,n))||s.enumerable});return t};var ne=t=>ae(V({},"__esModule",{value:!0}),t);var oe={};re(oe,{Wizard:()=>I,WizardActions:()=>J,WizardContent:()=>q,WizardNext:()=>D,WizardPanel:()=>U,WizardPrevious:()=>E,WizardSteps:()=>H,useWizard:()=>v});module.exports=ne(oe);var p=require("react"),o=require("../../lib/cn.cjs"),A=require("../../lib/i18n.cjs"),r=require("react/jsx-runtime"),F=(0,p.createContext)(null);function v(){let t=(0,p.useContext)(F);if(!t)throw new Error("useWizard and Wizard sub-components must be used within <Wizard>");return t}var B=(t,e,i)=>Math.max(e,Math.min(t,i)),j={sm:{circle:"h-7 w-7 text-xs",dot:"h-2.5 w-2.5",icon:"h-3.5 w-3.5",title:"text-xs",desc:"text-[11px]",connector:"h-0.5"},md:{circle:"h-9 w-9 text-sm",dot:"h-3 w-3",icon:"h-4 w-4",title:"text-sm",desc:"text-xs",connector:"h-0.5"},lg:{circle:"h-11 w-11 text-base",dot:"h-3.5 w-3.5",icon:"h-5 w-5",title:"text-base",desc:"text-sm",connector:"h-1"}},x={primary:{solid:"bg-synertech-primary-600 text-synertech-on-primary",bg:"bg-synertech-primary-600",text:"text-synertech-primary-600 dark:text-synertech-primary-400",ring:"focus-visible:ring-synertech-primary-500",ringSoft:"ring-synertech-primary-500/20"},secondary:{solid:"bg-gray-700 text-white",bg:"bg-gray-700",text:"text-gray-700 dark:text-gray-300",ring:"focus-visible:ring-gray-500",ringSoft:"ring-gray-500/20"},success:{solid:"bg-green-700 text-white",bg:"bg-green-700",text:"text-green-700 dark:text-green-400",ring:"focus-visible:ring-green-500",ringSoft:"ring-green-500/20"},warning:{solid:"bg-amber-500 text-gray-900",bg:"bg-amber-500",text:"text-amber-700 dark:text-amber-400",ring:"focus-visible:ring-amber-500",ringSoft:"ring-amber-500/20"},error:{solid:"bg-red-600 text-white",bg:"bg-red-600",text:"text-red-600 dark:text-red-400",ring:"focus-visible:ring-red-500",ringSoft:"ring-red-500/20"}};function ie({className:t}){return(0,r.jsx)("svg",{className:t,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}function I({steps:t,step:e,defaultStep:i=0,onStepChange:s,onComplete:n,orientation:c="horizontal",variant:l="default",size:u="md",color:d="primary",linear:g=!0,className:b,children:z}){let C=t.length,W=Math.max(0,C-1),N=e!==void 0,[P,R]=(0,p.useState)(()=>B(i,0,W)),a=B(N?e:P,0,W),[f,w]=(0,p.useState)(a);f<a&&w(a);let y=a<=0,h=a>=W,S=(0,p.useCallback)((m,M)=>{let L=B(m,0,W);L!==a&&(N||R(L),w(_=>Math.max(_,L)),s?.(L,{previous:a,direction:M}))},[a,N,W,s]),k=(0,p.useCallback)(m=>{let M=t[m];return!M||M.disabled?!1:g?m<=f:!0},[t,g,f]),K=(0,p.useCallback)(m=>{k(m)&&S(m,m>a?"jump":"backward")},[k,S,a]),Q=(0,p.useCallback)(()=>{if(h){n?.();return}S(a+1,"forward")},[h,n,S,a]),X=(0,p.useCallback)(()=>{y||S(a-1,"backward")},[y,S,a]),Y=(0,p.useCallback)(m=>t[m]?.error?"error":m===a?"active":m<a?"completed":"upcoming",[t,a]),Z={steps:t,activeStep:a,totalSteps:C,isFirstStep:y,isLastStep:h,orientation:c,variant:l,size:u,color:d,linear:g,goToStep:K,goNext:Q,goBack:X,getStepStatus:Y,isStepAccessible:k};return(0,r.jsx)(F.Provider,{value:Z,children:(0,r.jsx)("div",{className:(0,o.cn)("flex w-full flex-col gap-6",b),"data-testid":"wizard","data-orientation":c,children:z})})}function O({index:t,status:e}){let{variant:i,size:s,color:n,steps:c}=v(),l=j[s],u=c[t];if(i==="dots"){let b=e==="upcoming"?"bg-gray-300 dark:bg-gray-600":e==="error"?"bg-red-600":x[n].bg;return(0,r.jsx)("span",{className:(0,o.cn)("shrink-0 rounded-full transition-colors",l.dot,b),"aria-hidden":"true"})}let d=e==="completed"?(0,o.cn)(x[n].solid,"border-transparent"):e==="active"?(0,o.cn)(x[n].solid,"border-transparent ring-4",x[n].ringSoft):e==="error"?"border-transparent bg-red-600 text-white":"border-2 border-gray-300 bg-white text-gray-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400",g=e==="completed"?(0,r.jsx)(ie,{className:l.icon}):e==="error"?(0,r.jsx)("span",{className:"font-semibold leading-none",children:"!"}):u.icon??(0,r.jsx)("span",{className:"font-medium leading-none",children:t+1});return(0,r.jsx)("span",{className:(0,o.cn)("flex shrink-0 items-center justify-center rounded-full transition-all",l.circle,d),"aria-hidden":"true",children:g})}function T({index:t,status:e,optionalLabel:i}){let{steps:s,size:n,color:c,variant:l}=v(),u=j[n],d=s[t],b=e==="active"?x[c].text:e==="completed"?"text-gray-900 dark:text-gray-100":e==="error"?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-gray-400";return(0,r.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,r.jsxs)("span",{className:(0,o.cn)("font-medium leading-tight",u.title,b),children:[l==="simple"&&(0,r.jsxs)("span",{className:"mr-1 tabular-nums",children:[t+1,"."]}),d.title,d.optional&&(0,r.jsx)("span",{className:"ml-1 text-xs font-normal text-gray-500 dark:text-gray-400",children:i})]}),d.description&&(0,r.jsx)("span",{className:(0,o.cn)("mt-0.5 text-gray-500 dark:text-gray-400",u.desc),children:d.description})]})}function H({className:t,hideConnector:e=!1,hideLabels:i=!1,optionalLabel:s}){let n=v(),c=(0,A.useUILabels)(),l=s??c.wizardOptional,{steps:u,orientation:d,size:g,variant:b,color:z,activeStep:C}=n,W=j[g],N=d==="vertical",P=b!=="simple";return(0,r.jsx)("ol",{className:(0,o.cn)("flex w-full",N?"flex-col":"items-start",t),"data-testid":"wizard-steps","data-orientation":d,children:u.map((R,a)=>{let f=n.getStepStatus(a),w=a===C,y=n.isStepAccessible(a)&&!w,h=a===u.length-1,k=a<C?x[z].bg:"bg-gray-200 dark:bg-gray-700";return N?(0,r.jsx)("li",{className:"flex","aria-current":w?"step":void 0,"data-status":f,"data-testid":"wizard-step",children:(0,r.jsxs)("button",{type:"button",disabled:!y,onClick:()=>n.goToStep(a),className:(0,o.cn)("flex items-stretch gap-3 rounded-md text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",x[z].ring,y?"cursor-pointer":"cursor-default"),children:[(0,r.jsxs)("span",{className:"flex flex-col items-center",children:[P&&(0,r.jsx)(O,{index:a,status:f}),!e&&!h&&(0,r.jsx)("span",{className:(0,o.cn)("my-1 w-0.5 flex-1 rounded",k),"aria-hidden":"true"})]}),!i&&(0,r.jsx)("span",{className:(0,o.cn)(h?"pb-0":"pb-6"),children:(0,r.jsx)(T,{index:a,status:f,optionalLabel:l})})]})},R.id??a):(0,r.jsxs)("li",{className:(0,o.cn)("flex items-center",!h&&"flex-1"),"aria-current":w?"step":void 0,"data-status":f,"data-testid":"wizard-step",children:[(0,r.jsxs)("button",{type:"button",disabled:!y,onClick:()=>n.goToStep(a),className:(0,o.cn)("flex items-center gap-2.5 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",x[z].ring,y?"cursor-pointer":"cursor-default"),children:[P&&(0,r.jsx)(O,{index:a,status:f}),!i&&(0,r.jsx)(T,{index:a,status:f,optionalLabel:l})]}),!e&&!h&&(0,r.jsx)("span",{className:(0,o.cn)("mx-2 flex-1 rounded",W.connector,k),"aria-hidden":"true"})]},R.id??a)})})}function U({index:t,keepMounted:e=!1,className:i,children:s}){let{activeStep:n}=v(),c=t===n;return!c&&!e?null:(0,r.jsx)("div",{role:"tabpanel",hidden:!c,"data-testid":"wizard-panel","data-active":c,"data-step":t,className:(0,o.cn)("w-full",i),children:s})}function q({className:t,children:e}){let i=v();return(0,r.jsx)("div",{className:(0,o.cn)("w-full",t),"data-testid":"wizard-content",children:typeof e=="function"?e(i):e})}var G="inline-flex cursor-pointer items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";function E({children:t,label:e,className:i,onClick:s,disabled:n,...c}){let{goBack:l,isFirstStep:u}=v(),d=(0,A.useUILabels)();return(0,r.jsx)("button",{type:"button",onClick:b=>{s?.(b),b.defaultPrevented||l()},disabled:n??u,"data-testid":"wizard-previous",className:(0,o.cn)(G,"border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus-visible:ring-gray-400 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",i),...c,children:t??e??d.wizardPrevious})}function D({children:t,label:e,finishLabel:i,className:s,onClick:n,...c}){let{goNext:l,isLastStep:u,color:d}=v(),g=(0,A.useUILabels)();return(0,r.jsx)("button",{type:"button",onClick:z=>{n?.(z),z.defaultPrevented||l()},"data-testid":"wizard-next",className:(0,o.cn)(G,x[d].solid,x[d].ring,"hover:opacity-90",s),...c,children:t??(u?i??g.wizardFinish:e??g.wizardNext)})}function J({className:t,children:e,align:i="between"}){let s={between:"justify-between",start:"justify-start",center:"justify-center",end:"justify-end"}[i];return(0,r.jsx)("div",{className:(0,o.cn)("flex items-center gap-3",s,t),"data-testid":"wizard-actions",children:e??(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E,{}),(0,r.jsx)(D,{})]})})}I.displayName="Wizard";H.displayName="WizardSteps";U.displayName="WizardPanel";q.displayName="WizardContent";J.displayName="WizardActions";E.displayName="WizardPrevious";D.displayName="WizardNext";0&&(module.exports={Wizard,WizardActions,WizardContent,WizardNext,WizardPanel,WizardPrevious,WizardSteps,useWizard});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{createContext as X,useCallback as C,useContext as Y,useState as E}from"react";import{cn as o}from"../../lib/cn.js";import{useUILabels as B}from"../../lib/i18n.js";import{Fragment as ae,jsx as a,jsxs as
|
|
1
|
+
"use client";import{createContext as X,useCallback as C,useContext as Y,useState as E}from"react";import{cn as o}from"../../lib/cn.js";import{useUILabels as B}from"../../lib/i18n.js";import{Fragment as ae,jsx as a,jsxs as h}from"react/jsx-runtime";var T=X(null);function S(){let e=Y(T);if(!e)throw new Error("useWizard and Wizard sub-components must be used within <Wizard>");return e}var V=(e,r,i)=>Math.max(r,Math.min(e,i)),j={sm:{circle:"h-7 w-7 text-xs",dot:"h-2.5 w-2.5",icon:"h-3.5 w-3.5",title:"text-xs",desc:"text-[11px]",connector:"h-0.5"},md:{circle:"h-9 w-9 text-sm",dot:"h-3 w-3",icon:"h-4 w-4",title:"text-sm",desc:"text-xs",connector:"h-0.5"},lg:{circle:"h-11 w-11 text-base",dot:"h-3.5 w-3.5",icon:"h-5 w-5",title:"text-base",desc:"text-sm",connector:"h-1"}},f={primary:{solid:"bg-synertech-primary-600 text-synertech-on-primary",bg:"bg-synertech-primary-600",text:"text-synertech-primary-600 dark:text-synertech-primary-400",ring:"focus-visible:ring-synertech-primary-500",ringSoft:"ring-synertech-primary-500/20"},secondary:{solid:"bg-gray-700 text-white",bg:"bg-gray-700",text:"text-gray-700 dark:text-gray-300",ring:"focus-visible:ring-gray-500",ringSoft:"ring-gray-500/20"},success:{solid:"bg-green-700 text-white",bg:"bg-green-700",text:"text-green-700 dark:text-green-400",ring:"focus-visible:ring-green-500",ringSoft:"ring-green-500/20"},warning:{solid:"bg-amber-500 text-gray-900",bg:"bg-amber-500",text:"text-amber-700 dark:text-amber-400",ring:"focus-visible:ring-amber-500",ringSoft:"ring-amber-500/20"},error:{solid:"bg-red-600 text-white",bg:"bg-red-600",text:"text-red-600 dark:text-red-400",ring:"focus-visible:ring-red-500",ringSoft:"ring-red-500/20"}};function Z({className:e}){return a("svg",{className:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:a("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}function _({steps:e,step:r,defaultStep:i=0,onStepChange:s,onComplete:n,orientation:c="horizontal",variant:l="default",size:p="md",color:d="primary",linear:u=!0,className:m,children:x}){let P=e.length,v=Math.max(0,P-1),N=r!==void 0,[R,M]=E(()=>V(i,0,v)),t=V(N?r:R,0,v),[b,w]=E(t);b<t&&w(t);let z=t<=0,y=t>=v,W=C((g,L)=>{let A=V(g,0,v);A!==t&&(N||M(A),w(Q=>Math.max(Q,A)),s?.(A,{previous:t,direction:L}))},[t,N,v,s]),k=C(g=>{let L=e[g];return!L||L.disabled?!1:u?g<=b:!0},[e,u,b]),U=C(g=>{k(g)&&W(g,g>t?"jump":"backward")},[k,W,t]),q=C(()=>{if(y){n?.();return}W(t+1,"forward")},[y,n,W,t]),G=C(()=>{z||W(t-1,"backward")},[z,W,t]),J=C(g=>e[g]?.error?"error":g===t?"active":g<t?"completed":"upcoming",[e,t]),K={steps:e,activeStep:t,totalSteps:P,isFirstStep:z,isLastStep:y,orientation:c,variant:l,size:p,color:d,linear:u,goToStep:U,goNext:q,goBack:G,getStepStatus:J,isStepAccessible:k};return a(T.Provider,{value:K,children:a("div",{className:o("flex w-full flex-col gap-6",m),"data-testid":"wizard","data-orientation":c,children:x})})}function D({index:e,status:r}){let{variant:i,size:s,color:n,steps:c}=S(),l=j[s],p=c[e];if(i==="dots"){let m=r==="upcoming"?"bg-gray-300 dark:bg-gray-600":r==="error"?"bg-red-600":f[n].bg;return a("span",{className:o("shrink-0 rounded-full transition-colors",l.dot,m),"aria-hidden":"true"})}let d=r==="completed"?o(f[n].solid,"border-transparent"):r==="active"?o(f[n].solid,"border-transparent ring-4",f[n].ringSoft):r==="error"?"border-transparent bg-red-600 text-white":"border-2 border-gray-300 bg-white text-gray-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400",u=r==="completed"?a(Z,{className:l.icon}):r==="error"?a("span",{className:"font-semibold leading-none",children:"!"}):p.icon??a("span",{className:"font-medium leading-none",children:e+1});return a("span",{className:o("flex shrink-0 items-center justify-center rounded-full transition-all",l.circle,d),"aria-hidden":"true",children:u})}function O({index:e,status:r,optionalLabel:i}){let{steps:s,size:n,color:c,variant:l}=S(),p=j[n],d=s[e],m=r==="active"?f[c].text:r==="completed"?"text-gray-900 dark:text-gray-100":r==="error"?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-gray-400";return h("span",{className:"flex min-w-0 flex-col",children:[h("span",{className:o("font-medium leading-tight",p.title,m),children:[l==="simple"&&h("span",{className:"mr-1 tabular-nums",children:[e+1,"."]}),d.title,d.optional&&a("span",{className:"ml-1 text-xs font-normal text-gray-500 dark:text-gray-400",children:i})]}),d.description&&a("span",{className:o("mt-0.5 text-gray-500 dark:text-gray-400",p.desc),children:d.description})]})}function $({className:e,hideConnector:r=!1,hideLabels:i=!1,optionalLabel:s}){let n=S(),c=B(),l=s??c.wizardOptional,{steps:p,orientation:d,size:u,variant:m,color:x,activeStep:P}=n,v=j[u],N=d==="vertical",R=m!=="simple";return a("ol",{className:o("flex w-full",N?"flex-col":"items-start",e),"data-testid":"wizard-steps","data-orientation":d,children:p.map((M,t)=>{let b=n.getStepStatus(t),w=t===P,z=n.isStepAccessible(t)&&!w,y=t===p.length-1,k=t<P?f[x].bg:"bg-gray-200 dark:bg-gray-700";return N?a("li",{className:"flex","aria-current":w?"step":void 0,"data-status":b,"data-testid":"wizard-step",children:h("button",{type:"button",disabled:!z,onClick:()=>n.goToStep(t),className:o("flex items-stretch gap-3 rounded-md text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",f[x].ring,z?"cursor-pointer":"cursor-default"),children:[h("span",{className:"flex flex-col items-center",children:[R&&a(D,{index:t,status:b}),!r&&!y&&a("span",{className:o("my-1 w-0.5 flex-1 rounded",k),"aria-hidden":"true"})]}),!i&&a("span",{className:o(y?"pb-0":"pb-6"),children:a(O,{index:t,status:b,optionalLabel:l})})]})},M.id??t):h("li",{className:o("flex items-center",!y&&"flex-1"),"aria-current":w?"step":void 0,"data-status":b,"data-testid":"wizard-step",children:[h("button",{type:"button",disabled:!z,onClick:()=>n.goToStep(t),className:o("flex items-center gap-2.5 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",f[x].ring,z?"cursor-pointer":"cursor-default"),children:[R&&a(D,{index:t,status:b}),!i&&a(O,{index:t,status:b,optionalLabel:l})]}),!r&&!y&&a("span",{className:o("mx-2 flex-1 rounded",v.connector,k),"aria-hidden":"true"})]},M.id??t)})})}function ee({index:e,keepMounted:r=!1,className:i,children:s}){let{activeStep:n}=S(),c=e===n;return!c&&!r?null:a("div",{role:"tabpanel",hidden:!c,"data-testid":"wizard-panel","data-active":c,"data-step":e,className:o("w-full",i),children:s})}function te({className:e,children:r}){let i=S();return a("div",{className:o("w-full",e),"data-testid":"wizard-content",children:typeof r=="function"?r(i):r})}var F="inline-flex cursor-pointer items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";function I({children:e,label:r,className:i,onClick:s,disabled:n,...c}){let{goBack:l,isFirstStep:p}=S(),d=B();return a("button",{type:"button",onClick:m=>{s?.(m),m.defaultPrevented||l()},disabled:n??p,"data-testid":"wizard-previous",className:o(F,"border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus-visible:ring-gray-400 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",i),...c,children:e??r??d.wizardPrevious})}function H({children:e,label:r,finishLabel:i,className:s,onClick:n,...c}){let{goNext:l,isLastStep:p,color:d}=S(),u=B();return a("button",{type:"button",onClick:x=>{n?.(x),x.defaultPrevented||l()},"data-testid":"wizard-next",className:o(F,f[d].solid,f[d].ring,"hover:opacity-90",s),...c,children:e??(p?i??u.wizardFinish:r??u.wizardNext)})}function re({className:e,children:r,align:i="between"}){let s={between:"justify-between",start:"justify-start",center:"justify-center",end:"justify-end"}[i];return a("div",{className:o("flex items-center gap-3",s,e),"data-testid":"wizard-actions",children:r??h(ae,{children:[a(I,{}),a(H,{})]})})}_.displayName="Wizard";$.displayName="WizardSteps";ee.displayName="WizardPanel";te.displayName="WizardContent";re.displayName="WizardActions";I.displayName="WizardPrevious";H.displayName="WizardNext";export{_ as Wizard,re as WizardActions,te as WizardContent,H as WizardNext,ee as WizardPanel,I as WizardPrevious,$ as WizardSteps,S as useWizard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var
|
|
1
|
+
"use strict";var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var h=(n,o)=>{for(var e in o)p(n,e,{get:o[e],enumerable:!0})},v=(n,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of b(o))!E.call(n,t)&&t!==e&&p(n,t,{get:()=>o[t],enumerable:!(i=y(o,t))||i.enumerable});return n};var x=n=>v(p({},"__esModule",{value:!0}),n);var I={};h(I,{WorkflowEdgeRenderer:()=>N});module.exports=x(I);var f=require("react"),g=require("../../../lib/cn.cjs"),u=require("../utils/geometry.cjs"),s=require("react/jsx-runtime");function w(n,o,e,i,t="horizontal"){let l=e.find(r=>r.id===n);if(!l)return null;let a=i(l),d=a.find(r=>r.id===o);return d?(0,u.getPortAbsolutePosition)(l,d,a,t):null}var P=(0,f.memo)(function({edge:o,fromPos:e,toPos:i,selected:t,disabled:l,direction:a,onClick:d}){let r=(0,u.computeBezierPath)(e.x,e.y,i.x,i.y,a),c=(e.x+i.x)/2,k=(e.y+i.y)/2,W=(0,f.useCallback)(m=>{m.stopPropagation(),d(o.id,m)},[o.id,d]);return(0,s.jsxs)("g",{"data-testid":`workflow-edge-${o.id}`,children:[(0,s.jsx)("path",{d:r,fill:"none",stroke:"transparent",strokeWidth:16,className:"cursor-pointer",onClick:W}),(0,s.jsx)("path",{d:r,fill:"none",className:(0,g.cn)("transition-colors pointer-events-none",l||o.disabled?"stroke-gray-300":t?"stroke-synertech-primary-500":"stroke-gray-400"),strokeWidth:t?2.5:2,strokeDasharray:o.disabled?"6 3":void 0}),o.label&&(0,s.jsx)("text",{x:c,y:k-8,textAnchor:"middle",className:"fill-gray-600 dark:fill-gray-300 text-xs pointer-events-none select-none",fontSize:11,children:o.label})]})}),N=(0,f.memo)(function({edges:o,nodes:e,selectedEdgeId:i,disabled:t,direction:l,onEdgeClick:a,getNodePorts:d}){return(0,s.jsx)("svg",{className:"absolute pointer-events-none",style:{top:0,left:0,width:1,height:1,overflow:"visible"},children:(0,s.jsx)("g",{className:"pointer-events-auto",children:o.map(r=>{let c=w(r.from.nodeId,r.from.portId,e,d,l),k=w(r.to.nodeId,r.to.portId,e,d,l);return!c||!k?null:(0,s.jsx)(P,{edge:r,fromPos:c,toPos:k,selected:r.id===i,disabled:t,direction:l,onClick:a},r.id)})})})});0&&(module.exports={WorkflowEdgeRenderer});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{memo as p,useCallback as w}from"react";import{cn as g}from"../../../lib/cn.js";import{computeBezierPath as W,getPortAbsolutePosition as
|
|
1
|
+
import{memo as p,useCallback as w}from"react";import{cn as g}from"../../../lib/cn.js";import{computeBezierPath as W,getPortAbsolutePosition as y}from"../utils/geometry.js";import{jsx as d,jsxs as E}from"react/jsx-runtime";function u(c,e,r,n,l="horizontal"){let t=r.find(o=>o.id===c);if(!t)return null;let s=n(t),i=s.find(o=>o.id===e);return i?y(t,i,s,l):null}var b=p(function({edge:e,fromPos:r,toPos:n,selected:l,disabled:t,direction:s,onClick:i}){let o=W(r.x,r.y,n.x,n.y,s),a=(r.x+n.x)/2,f=(r.y+n.y)/2,m=w(k=>{k.stopPropagation(),i(e.id,k)},[e.id,i]);return E("g",{"data-testid":`workflow-edge-${e.id}`,children:[d("path",{d:o,fill:"none",stroke:"transparent",strokeWidth:16,className:"cursor-pointer",onClick:m}),d("path",{d:o,fill:"none",className:g("transition-colors pointer-events-none",t||e.disabled?"stroke-gray-300":l?"stroke-synertech-primary-500":"stroke-gray-400"),strokeWidth:l?2.5:2,strokeDasharray:e.disabled?"6 3":void 0}),e.label&&d("text",{x:a,y:f-8,textAnchor:"middle",className:"fill-gray-600 dark:fill-gray-300 text-xs pointer-events-none select-none",fontSize:11,children:e.label})]})}),P=p(function({edges:e,nodes:r,selectedEdgeId:n,disabled:l,direction:t,onEdgeClick:s,getNodePorts:i}){return d("svg",{className:"absolute pointer-events-none",style:{top:0,left:0,width:1,height:1,overflow:"visible"},children:d("g",{className:"pointer-events-auto",children:e.map(o=>{let a=u(o.from.nodeId,o.from.portId,r,i,t),f=u(o.to.nodeId,o.to.portId,r,i,t);return!a||!f?null:d(b,{edge:o,fromPos:a,toPos:f,selected:o.id===n,disabled:l,direction:t,onClick:s},o.id)})})})});export{P as WorkflowEdgeRenderer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var v=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var M=(o,t)=>{for(var r in t)v(o,r,{get:t[r],enumerable:!0})},T=(o,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of A(t))!D.call(o,e)&&e!==r&&v(o,e,{get:()=>t[e],enumerable:!(s=I(t,e))||s.enumerable});return o};var x=o=>T(v({},"__esModule",{value:!0}),o);var F={};M(F,{WorkflowNodeRenderer:()=>z});module.exports=x(F);var p=require("react"),k=require("../../../lib/cn.cjs"),W=require("../utils/geometry.cjs"),c=require("react/jsx-runtime"),R=180,S=60,y=12,g=28,N=24,_=-8;function O(o,t,r,s,e="horizontal"){let i=o.side??(0,W.getPortDefaultSide)(o.kind,e),f=t.filter(a=>(a.side??(0,W.getPortDefaultSide)(a.kind,e))===i),u=f.findIndex(a=>a.id===o.id),l=f.length,n=l===1?.5:(u+1)/(l+1);switch(i){case"left":return{left:0,top:s*n};case"right":return{left:r,top:s*n};case"top":return{left:r*n,top:0};case"bottom":return{left:r*n,top:s}}}function C({port:o,allPorts:t,nodeId:r,nodeWidth:s,nodeHeight:e,disabled:i,direction:f,onMouseUp:u}){let l=O(o,t,s,e,f),n=i||o.disabled,a=(0,p.useCallback)(b=>{n||(b.stopPropagation(),u(r,o.id))},[n,r,o.id,u]);return(0,c.jsx)("div",{"data-testid":`port-${r}-${o.id}`,"data-port-id":o.id,"data-port-kind":o.kind,"data-node-id":r,className:"absolute",style:{left:l.left-g/2,top:l.top-g/2,width:g,height:g,zIndex:20},onMouseUp:a,title:o.label??o.id,children:(0,c.jsx)("div",{className:(0,k.cn)("absolute rounded-full border-2 transition-colors",n?"bg-gray-300 border-gray-400 cursor-not-allowed":o.kind==="in"?"bg-synertech-primary-400 border-synertech-primary-600 hover:bg-synertech-primary-300 cursor-crosshair":"bg-green-400 border-green-600 hover:bg-green-300 cursor-crosshair"),style:{width:y,height:y,left:(g-y)/2,top:(g-y)/2}})})}function U(o,t,r){let s=o??"top-right",e=_,i=t*(N+4);switch(s){case"top-right":return{top:e,right:e-i};case"top-left":return{top:e,left:e+i};case"bottom-right":return{bottom:e,right:e-i};case"bottom-left":return{bottom:e,left:e+i}}}function $({action:o,nodeId:t,index:r,nodeWidth:s,disabled:e,onActionClick:i}){let f=(0,p.useCallback)(n=>{n.stopPropagation(),n.preventDefault(),!e&&i(t,o.id,n.nativeEvent)},[e,t,o.id,i]),u=(0,p.useCallback)(n=>{n.stopPropagation()},[]),l=U(o.position,r,s);return(0,c.jsx)("button",{"data-testid":`action-${t}-${o.id}`,"data-action-id":o.id,"data-node-id":t,type:"button",className:(0,k.cn)("absolute flex items-center justify-center rounded-full border shadow-sm transition-all","bg-white border-gray-300 text-gray-600","hover:bg-gray-50 hover:border-gray-400 hover:text-gray-800 hover:shadow-md","active:scale-95",e&&"opacity-50 cursor-not-allowed",!e&&"cursor-pointer",o.className),style:{...l,width:N,height:N,zIndex:30},onClick:f,onMouseDown:u,title:o.label,disabled:e,children:(0,c.jsx)("span",{className:"flex items-center justify-center w-3.5 h-3.5 [&>svg]:w-full [&>svg]:h-full",children:o.icon})})}var z=(0,p.memo)(function({node:t,registry:r,ports:s,selected:e,disabled:i,draggable:f,direction:u,onPortMouseUp:l,onActionClick:n}){let a=t.width??R,b=t.height??S,E=r.render({node:t,selected:e,disabled:i}),P=(typeof r.actions=="function"?r.actions(t):r.actions)?.filter(d=>typeof d.hidden=="function"?!d.hidden(t):!d.hidden),w=new Map;if(P)for(let d of P){let h=d.position??"top-right",m=w.get(h)??[];m.push(d),w.set(h,m)}return(0,c.jsxs)("div",{"data-testid":`workflow-node-${t.id}`,"data-node-id":t.id,className:(0,k.cn)("absolute select-none group/node",f&&!t.locked&&"cursor-grab active:cursor-grabbing",t.locked&&"cursor-not-allowed opacity-75",e&&"ring-2 ring-synertech-primary-500 ring-offset-1 rounded-lg"),style:{left:t.x,top:t.y,width:a,height:b,overflow:"visible"},children:[E,s.map(d=>(0,c.jsx)(C,{port:d,allPorts:s,nodeId:t.id,nodeWidth:a,nodeHeight:b,disabled:i,direction:u,onMouseUp:l},d.id)),n&&w.size>0&&Array.from(w.entries()).map(([,d])=>d.map((h,m)=>(0,c.jsx)($,{action:h,nodeId:t.id,index:m,nodeWidth:a,disabled:i,onActionClick:n},h.id)))]})});0&&(module.exports={WorkflowNodeRenderer});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{memo as E,useCallback as
|
|
1
|
+
import{memo as E,useCallback as y}from"react";import{cn as v}from"../../../lib/cn.js";import{getPortDefaultSide as N}from"../utils/geometry.js";import{jsx as g,jsxs as S}from"react/jsx-runtime";var I=180,A=60,m=12,u=28,k=24,D=-8;function M(o,t,n,s,e="horizontal"){let i=o.side??N(o.kind,e),c=t.filter(a=>(a.side??N(a.kind,e))===i),f=c.findIndex(a=>a.id===o.id),l=c.length,r=l===1?.5:(f+1)/(l+1);switch(i){case"left":return{left:0,top:s*r};case"right":return{left:n,top:s*r};case"top":return{left:n*r,top:0};case"bottom":return{left:n*r,top:s}}}function T({port:o,allPorts:t,nodeId:n,nodeWidth:s,nodeHeight:e,disabled:i,direction:c,onMouseUp:f}){let l=M(o,t,s,e,c),r=i||o.disabled,a=y(h=>{r||(h.stopPropagation(),f(n,o.id))},[r,n,o.id,f]);return g("div",{"data-testid":`port-${n}-${o.id}`,"data-port-id":o.id,"data-port-kind":o.kind,"data-node-id":n,className:"absolute",style:{left:l.left-u/2,top:l.top-u/2,width:u,height:u,zIndex:20},onMouseUp:a,title:o.label??o.id,children:g("div",{className:v("absolute rounded-full border-2 transition-colors",r?"bg-gray-300 border-gray-400 cursor-not-allowed":o.kind==="in"?"bg-synertech-primary-400 border-synertech-primary-600 hover:bg-synertech-primary-300 cursor-crosshair":"bg-green-400 border-green-600 hover:bg-green-300 cursor-crosshair"),style:{width:m,height:m,left:(u-m)/2,top:(u-m)/2}})})}function x(o,t,n){let s=o??"top-right",e=D,i=t*(k+4);switch(s){case"top-right":return{top:e,right:e-i};case"top-left":return{top:e,left:e+i};case"bottom-right":return{bottom:e,right:e-i};case"bottom-left":return{bottom:e,left:e+i}}}function R({action:o,nodeId:t,index:n,nodeWidth:s,disabled:e,onActionClick:i}){let c=y(r=>{r.stopPropagation(),r.preventDefault(),!e&&i(t,o.id,r.nativeEvent)},[e,t,o.id,i]),f=y(r=>{r.stopPropagation()},[]),l=x(o.position,n,s);return g("button",{"data-testid":`action-${t}-${o.id}`,"data-action-id":o.id,"data-node-id":t,type:"button",className:v("absolute flex items-center justify-center rounded-full border shadow-sm transition-all","bg-white border-gray-300 text-gray-600","hover:bg-gray-50 hover:border-gray-400 hover:text-gray-800 hover:shadow-md","active:scale-95",e&&"opacity-50 cursor-not-allowed",!e&&"cursor-pointer",o.className),style:{...l,width:k,height:k,zIndex:30},onClick:c,onMouseDown:f,title:o.label,disabled:e,children:g("span",{className:"flex items-center justify-center w-3.5 h-3.5 [&>svg]:w-full [&>svg]:h-full",children:o.icon})})}var $=E(function({node:t,registry:n,ports:s,selected:e,disabled:i,draggable:c,direction:f,onPortMouseUp:l,onActionClick:r}){let a=t.width??I,h=t.height??A,P=n.render({node:t,selected:e,disabled:i}),W=(typeof n.actions=="function"?n.actions(t):n.actions)?.filter(d=>typeof d.hidden=="function"?!d.hidden(t):!d.hidden),b=new Map;if(W)for(let d of W){let p=d.position??"top-right",w=b.get(p)??[];w.push(d),b.set(p,w)}return S("div",{"data-testid":`workflow-node-${t.id}`,"data-node-id":t.id,className:v("absolute select-none group/node",c&&!t.locked&&"cursor-grab active:cursor-grabbing",t.locked&&"cursor-not-allowed opacity-75",e&&"ring-2 ring-synertech-primary-500 ring-offset-1 rounded-lg"),style:{left:t.x,top:t.y,width:a,height:h,overflow:"visible"},children:[P,s.map(d=>g(T,{port:d,allPorts:s,nodeId:t.id,nodeWidth:a,nodeHeight:h,disabled:i,direction:f,onMouseUp:l},d.id)),r&&b.size>0&&Array.from(b.entries()).map(([,d])=>d.map((p,w)=>g(R,{action:p,nodeId:t.id,index:w,nodeWidth:a,disabled:i,onActionClick:r},p.id)))]})});export{$ as WorkflowNodeRenderer};
|
package/dist/index.d.cts
CHANGED
|
@@ -895,6 +895,11 @@ declare namespace Banner {
|
|
|
895
895
|
|
|
896
896
|
interface BreadcrumbItem {
|
|
897
897
|
label: string;
|
|
898
|
+
/**
|
|
899
|
+
* Where it leads. An `http:`, `https:`, `mailto:`, `tel:` or relative address
|
|
900
|
+
* makes a link; any other (`javascript:`, `data:`…) leaves it without one,
|
|
901
|
+
* and the console says so once.
|
|
902
|
+
*/
|
|
898
903
|
href?: string;
|
|
899
904
|
icon?: ReactNode;
|
|
900
905
|
onClick?: () => void;
|
|
@@ -1010,6 +1015,11 @@ interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
|
|
|
1010
1015
|
fullWidth?: boolean;
|
|
1011
1016
|
rounded?: "none" | "sm" | "md" | "lg" | "full";
|
|
1012
1017
|
bgColor?: string;
|
|
1018
|
+
/**
|
|
1019
|
+
* Classes of the text. Left out, it is the colour the brand is written in
|
|
1020
|
+
* (`text-synertech-on-primary`) on the default fill, and `text-white` on a
|
|
1021
|
+
* fill passed as `bgColor`.
|
|
1022
|
+
*/
|
|
1013
1023
|
textColor?: string;
|
|
1014
1024
|
focusColor?: string;
|
|
1015
1025
|
selected?: boolean;
|
|
@@ -2977,6 +2987,12 @@ interface CheckboxProps extends Omit<ComponentPropsWithoutRef<"input">, "size" |
|
|
|
2977
2987
|
borderColor?: string;
|
|
2978
2988
|
labelColor?: string;
|
|
2979
2989
|
errorColor?: string;
|
|
2990
|
+
/**
|
|
2991
|
+
* Classes of the check mark. Left out, it is the colour the brand is
|
|
2992
|
+
* written in (`text-synertech-on-primary`) on the default fill, and
|
|
2993
|
+
* `text-white` on a fill passed as `checkedColor`. The `outlined` variant
|
|
2994
|
+
* has no fill: its mark is drawn in the colour of its outline.
|
|
2995
|
+
*/
|
|
2980
2996
|
checkmarkColor?: string;
|
|
2981
2997
|
hoverColor?: string;
|
|
2982
2998
|
focusRingColor?: string;
|
|
@@ -2997,6 +3013,12 @@ interface CheckboxGroupProps extends Omit<ComponentPropsWithoutRef<"div">, "onCh
|
|
|
2997
3013
|
value?: string[];
|
|
2998
3014
|
defaultValue?: string[];
|
|
2999
3015
|
onChange?: (values: string[]) => void;
|
|
3016
|
+
/**
|
|
3017
|
+
* The name the checked items are submitted under, each with its own
|
|
3018
|
+
* `value`: a form gets one entry per checked item. The `name` of an item
|
|
3019
|
+
* wins over it.
|
|
3020
|
+
*/
|
|
3021
|
+
name?: string;
|
|
3000
3022
|
orientation?: "horizontal" | "vertical";
|
|
3001
3023
|
spacing?: "sm" | "md" | "lg";
|
|
3002
3024
|
disabled?: boolean;
|
|
@@ -3008,7 +3030,7 @@ interface CheckboxGroupProps extends Omit<ComponentPropsWithoutRef<"div">, "onCh
|
|
|
3008
3030
|
labelClassName?: string;
|
|
3009
3031
|
}
|
|
3010
3032
|
declare const CheckboxGroup: {
|
|
3011
|
-
({ label, description, value: controlledValue, defaultValue, onChange, orientation, spacing, disabled, size, error, required, children, className, labelClassName, ...rest }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
|
|
3033
|
+
({ label, description, value: controlledValue, defaultValue, onChange, name, orientation, spacing, disabled, size, error, required, children, className, labelClassName, ...rest }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
|
|
3012
3034
|
displayName: string;
|
|
3013
3035
|
};
|
|
3014
3036
|
interface CheckboxGroupItemProps extends Omit<CheckboxProps, "checked" | "onChange"> {
|
|
@@ -4445,7 +4467,7 @@ interface MentionInputProps extends InputStyleProps {
|
|
|
4445
4467
|
}
|
|
4446
4468
|
declare const MentionInput: react.ForwardRefExoticComponent<MentionInputProps & react.RefAttributes<HTMLDivElement>>;
|
|
4447
4469
|
|
|
4448
|
-
interface NumberInputProps extends Omit<React.ComponentPropsWithoutRef<"input">, "size" | "type" | "onChange" | "value">, InputStyleProps {
|
|
4470
|
+
interface NumberInputProps extends Omit<React.ComponentPropsWithoutRef<"input">, "size" | "type" | "onChange" | "value" | "defaultValue">, InputStyleProps {
|
|
4449
4471
|
label?: string;
|
|
4450
4472
|
inline?: boolean;
|
|
4451
4473
|
labelColor?: string;
|
|
@@ -4455,6 +4477,11 @@ interface NumberInputProps extends Omit<React.ComponentPropsWithoutRef<"input">,
|
|
|
4455
4477
|
error?: boolean;
|
|
4456
4478
|
hideLabel?: boolean;
|
|
4457
4479
|
value?: number | null;
|
|
4480
|
+
/**
|
|
4481
|
+
* The value the field starts with when `value` is not passed. The field
|
|
4482
|
+
* then keeps what is typed in it by itself; `onChange` still reports it.
|
|
4483
|
+
*/
|
|
4484
|
+
defaultValue?: number | null;
|
|
4458
4485
|
onChange?: (value: number | null) => void;
|
|
4459
4486
|
format?: "number" | "currency" | "percentage" | "decimal";
|
|
4460
4487
|
currency?: string;
|
|
@@ -4462,6 +4489,10 @@ interface NumberInputProps extends Omit<React.ComponentPropsWithoutRef<"input">,
|
|
|
4462
4489
|
decimals?: number;
|
|
4463
4490
|
min?: number;
|
|
4464
4491
|
max?: number;
|
|
4492
|
+
/**
|
|
4493
|
+
* How much the up and down arrow keys add or take away, within `min` and
|
|
4494
|
+
* `max`.
|
|
4495
|
+
*/
|
|
4465
4496
|
step?: number;
|
|
4466
4497
|
prefix?: string;
|
|
4467
4498
|
suffix?: string;
|
|
@@ -4472,6 +4503,11 @@ declare const NumberInput: react.ForwardRefExoticComponent<NumberInputProps & re
|
|
|
4472
4503
|
|
|
4473
4504
|
interface NavItem {
|
|
4474
4505
|
label: string;
|
|
4506
|
+
/**
|
|
4507
|
+
* Where it leads. An `http:`, `https:`, `mailto:`, `tel:` or relative address
|
|
4508
|
+
* makes a link; any other (`javascript:`, `data:`…) leaves it without one,
|
|
4509
|
+
* and the console says so once.
|
|
4510
|
+
*/
|
|
4475
4511
|
href?: string;
|
|
4476
4512
|
icon?: ReactNode;
|
|
4477
4513
|
badge?: string | number;
|
|
@@ -4482,6 +4518,11 @@ interface NavItem {
|
|
|
4482
4518
|
}
|
|
4483
4519
|
interface HeaderProps {
|
|
4484
4520
|
logo?: ReactNode;
|
|
4521
|
+
/**
|
|
4522
|
+
* Where the logo leads. Any other address than an `http:`, `https:`,
|
|
4523
|
+
* `mailto:`, `tel:` or relative one (`javascript:`…) leaves the logo
|
|
4524
|
+
* without a link.
|
|
4525
|
+
*/
|
|
4485
4526
|
logoHref?: string;
|
|
4486
4527
|
onLogoClick?: () => void;
|
|
4487
4528
|
navItems?: NavItem[];
|
|
@@ -4509,6 +4550,15 @@ interface HeaderProps {
|
|
|
4509
4550
|
declare function Header({ logo, logoHref, onLogoClick, navItems, actions, rightContent, variant, size, backgroundColor, textColor, hoverColor, navItemTextColor, navItemHoverColor, navItemBgHover, navItemActiveColor, sticky, fixed, showSearch, onSearch, searchPlaceholder: searchPlaceholderProp, menuLabel, className, containerClassName, }: HeaderProps): react_jsx_runtime.JSX.Element;
|
|
4510
4551
|
|
|
4511
4552
|
interface HelpButtonProps {
|
|
4553
|
+
/**
|
|
4554
|
+
* What the bubble shows: a node as it is, a string as Markdown under
|
|
4555
|
+
* `markdown`, and as HTML otherwise. That HTML keeps the formatting Markdown
|
|
4556
|
+
* produces — headings, paragraphs, lists, links, code, quotes, tables — and
|
|
4557
|
+
* nothing else: `<style>`, forms and their fields, images and frames are
|
|
4558
|
+
* dropped, and so are `class`, `style`, `id` and `name`. A link keeps an
|
|
4559
|
+
* `http:`, `https:`, `mailto:`, `tel:` or relative address. Neither mode
|
|
4560
|
+
* shows an image: a help that needs one is given as a node.
|
|
4561
|
+
*/
|
|
4512
4562
|
content: string | ReactNode;
|
|
4513
4563
|
markdown?: boolean;
|
|
4514
4564
|
position?: "top" | "bottom" | "left" | "right";
|
|
@@ -4797,20 +4847,72 @@ interface LineChartProps extends CartesianChartBaseProps, Omit<ComponentPropsWit
|
|
|
4797
4847
|
declare function LineChart({ data, series, x, y, height, width, size, grid, legend, tooltip, tableView, emphasis, title, description, loading, emptyState, error, errorState, onRetry, actions, onPointClick, curve, forecastFrom, forecastLabel, markers, connectNulls, referenceLines, annotations, overlay, legendToggle, maxPoints, brush, onBrush, brushLabel, sync, margin, locale, plotLabel, className, ...props }: LineChartProps): react_jsx_runtime.JSX.Element;
|
|
4798
4848
|
|
|
4799
4849
|
interface ModalProps {
|
|
4800
|
-
|
|
4850
|
+
/**
|
|
4851
|
+
* Whether the modal is shown. `open` is the same prop under the name `Drawer`
|
|
4852
|
+
* gives it: pass one of the two, a modal given neither stays closed.
|
|
4853
|
+
*/
|
|
4854
|
+
isOpen?: boolean;
|
|
4855
|
+
/** Whether the modal is shown, under the name `Drawer` uses. Wins over `isOpen` when both are passed. */
|
|
4856
|
+
open?: boolean;
|
|
4857
|
+
/**
|
|
4858
|
+
* Called when the modal asks to be closed: the close button, Escape, and a
|
|
4859
|
+
* footer button once its handler has let it.
|
|
4860
|
+
*/
|
|
4801
4861
|
onClose: () => void;
|
|
4862
|
+
/**
|
|
4863
|
+
* Title of the dialog, and its accessible name. `title=""` renders none: name
|
|
4864
|
+
* the dialog with `aria-label` then. Left out with no `aria-label` either, a
|
|
4865
|
+
* placeholder is shown in its place and a warning says so once.
|
|
4866
|
+
*/
|
|
4802
4867
|
title?: string;
|
|
4803
4868
|
children?: ReactNode;
|
|
4804
4869
|
buttonLabel?: string;
|
|
4805
|
-
|
|
4870
|
+
/** The older name of `onSubmitClick`. Wins over it when both are passed. */
|
|
4871
|
+
onButtonClick?: () => void | boolean | Promise<void | boolean>;
|
|
4872
|
+
/**
|
|
4873
|
+
* Classes of the backdrop, the layer that covers the page. The dialog itself
|
|
4874
|
+
* takes `panelClassName`.
|
|
4875
|
+
*/
|
|
4806
4876
|
className?: string;
|
|
4877
|
+
/**
|
|
4878
|
+
* Classes of the dialog panel: a height, a border, a shadow. The width stays
|
|
4879
|
+
* on `size`; for another one, `size="full"` and a `max-w-*` with `mx-auto`
|
|
4880
|
+
* here.
|
|
4881
|
+
*/
|
|
4882
|
+
panelClassName?: string;
|
|
4807
4883
|
allowFullScreen?: boolean;
|
|
4884
|
+
/**
|
|
4885
|
+
* Show the confirm button. Default `true`: a modal given no footer prop has a
|
|
4886
|
+
* Confirm button, which closes it. `false` on a modal that brings its own
|
|
4887
|
+
* buttons.
|
|
4888
|
+
*/
|
|
4808
4889
|
showSubmit?: boolean;
|
|
4809
4890
|
submitLabel?: string;
|
|
4810
|
-
|
|
4891
|
+
/**
|
|
4892
|
+
* Called by the confirm button. A promise is awaited: both footer buttons
|
|
4893
|
+
* are disabled meanwhile and the one that was pressed is `aria-busy`. The
|
|
4894
|
+
* modal then closes, unless the handler returns or resolves `false`, or
|
|
4895
|
+
* throws — a form that did not validate, a request the server refused.
|
|
4896
|
+
*/
|
|
4897
|
+
onSubmitClick?: () => void | boolean | Promise<void | boolean>;
|
|
4898
|
+
/**
|
|
4899
|
+
* Close the modal once the confirm handler is done. Default `true`. `false`
|
|
4900
|
+
* leaves closing to the application, whatever the handler returns.
|
|
4901
|
+
*/
|
|
4902
|
+
closeOnSubmit?: boolean;
|
|
4903
|
+
/**
|
|
4904
|
+
* Receives what the confirm handler threw, or what its promise rejected
|
|
4905
|
+
* with. The modal stays open. Without it the error is not caught: it reaches
|
|
4906
|
+
* the page as it would from any event handler.
|
|
4907
|
+
*/
|
|
4908
|
+
onSubmitError?: (error: unknown) => void;
|
|
4811
4909
|
showCancel?: boolean;
|
|
4812
4910
|
cancelLabel?: string;
|
|
4813
|
-
|
|
4911
|
+
/**
|
|
4912
|
+
* Called by the cancel button, with the rules of `onSubmitClick`: awaited,
|
|
4913
|
+
* and the modal stays open on `false` or on an error.
|
|
4914
|
+
*/
|
|
4915
|
+
onCancelClick?: () => void | boolean | Promise<void | boolean>;
|
|
4814
4916
|
buttonsPosition?: "left" | "center" | "right";
|
|
4815
4917
|
showHeaderDivider?: boolean;
|
|
4816
4918
|
showFooterDivider?: boolean;
|
|
@@ -4835,8 +4937,9 @@ interface ModalProps {
|
|
|
4835
4937
|
/** Accessible name of the "collapse" button. Defaults to the `exitFullScreen` label. */
|
|
4836
4938
|
exitFullScreenLabel?: string;
|
|
4837
4939
|
/**
|
|
4838
|
-
* Accessible name of the dialog when no visible `title` is rendered
|
|
4839
|
-
*
|
|
4940
|
+
* Accessible name of the dialog when no visible `title` is rendered:
|
|
4941
|
+
* `title=""`, or no `title` at all. Ignored otherwise: the title labels the
|
|
4942
|
+
* dialog.
|
|
4840
4943
|
*/
|
|
4841
4944
|
"aria-label"?: string;
|
|
4842
4945
|
/** Close the modal when Escape is pressed. Default `true`. */
|
|
@@ -4956,12 +5059,42 @@ interface ProgressBarProps extends Omit<ComponentPropsWithoutRef<"div">, "childr
|
|
|
4956
5059
|
size?: ProgressBarSize;
|
|
4957
5060
|
color?: ProgressBarColor;
|
|
4958
5061
|
variant?: ProgressBarVariant;
|
|
5062
|
+
/**
|
|
5063
|
+
* Classes that colour the fill, in place of the ones `color` and `variant`
|
|
5064
|
+
* pick: `"bg-orange-600"`, or a gradient. The same prop as on
|
|
5065
|
+
* `CircularProgress`.
|
|
5066
|
+
*/
|
|
5067
|
+
progressColor?: string;
|
|
5068
|
+
/** Classes that colour the track behind the fill, in place of the grey one. */
|
|
5069
|
+
trackColor?: string;
|
|
4959
5070
|
showValue?: boolean;
|
|
4960
5071
|
valueFormat?: (value: number) => string;
|
|
5072
|
+
/**
|
|
5073
|
+
* Text shown above the bar, which also names it. A page that already shows a
|
|
5074
|
+
* label of its own names the bar with `aria-labelledby` or `aria-label`
|
|
5075
|
+
* instead.
|
|
5076
|
+
*/
|
|
4961
5077
|
label?: string;
|
|
4962
5078
|
animated?: boolean;
|
|
5079
|
+
/**
|
|
5080
|
+
* Accessible name of the bar. Goes to the element that holds the
|
|
5081
|
+
* `progressbar` role, not to the wrapper, and wins over `label`.
|
|
5082
|
+
*/
|
|
5083
|
+
"aria-label"?: string;
|
|
5084
|
+
/**
|
|
5085
|
+
* Id of the element that names the bar: a label the page already shows.
|
|
5086
|
+
* Goes to the element that holds the `progressbar` role.
|
|
5087
|
+
*/
|
|
5088
|
+
"aria-labelledby"?: string;
|
|
5089
|
+
/** Id of the element that describes the bar. Goes to the element that holds the `progressbar` role. */
|
|
5090
|
+
"aria-describedby"?: string;
|
|
5091
|
+
/**
|
|
5092
|
+
* The value as a reader should hear it, when a percentage is not it:
|
|
5093
|
+
* `"3 of 10 files"`. Goes to the element that holds the `progressbar` role.
|
|
5094
|
+
*/
|
|
5095
|
+
"aria-valuetext"?: string;
|
|
4963
5096
|
}
|
|
4964
|
-
declare function ProgressBar({ value, indeterminate, size, color, variant, showValue, valueFormat, label, animated, className, ...props }: ProgressBarProps): react_jsx_runtime.JSX.Element;
|
|
5097
|
+
declare function ProgressBar({ value, indeterminate, size, color, variant, progressColor, trackColor, showValue, valueFormat, label, animated, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-valuetext": ariaValueText, ...props }: ProgressBarProps): react_jsx_runtime.JSX.Element;
|
|
4965
5098
|
declare namespace ProgressBar {
|
|
4966
5099
|
var displayName: string;
|
|
4967
5100
|
}
|
|
@@ -5115,7 +5248,11 @@ interface SidebarItemProps {
|
|
|
5115
5248
|
active?: boolean;
|
|
5116
5249
|
/** Disabled state */
|
|
5117
5250
|
disabled?: boolean;
|
|
5118
|
-
/**
|
|
5251
|
+
/**
|
|
5252
|
+
* Where the item leads, rendered as a link. Any other address than an
|
|
5253
|
+
* `http:`, `https:`, `mailto:`, `tel:` or relative one (`javascript:`…)
|
|
5254
|
+
* leaves it a button, and the console says so once.
|
|
5255
|
+
*/
|
|
5119
5256
|
href?: string;
|
|
5120
5257
|
/** Click handler */
|
|
5121
5258
|
onClick?: () => void;
|
|
@@ -5483,9 +5620,19 @@ declare namespace FooterColumn {
|
|
|
5483
5620
|
}
|
|
5484
5621
|
|
|
5485
5622
|
interface FooterLinkProps extends ComponentPropsWithoutRef<"a"> {
|
|
5623
|
+
/**
|
|
5624
|
+
* Where it leads. An `http:`, `https:`, `mailto:`, `tel:` or relative address
|
|
5625
|
+
* makes a link; any other (`javascript:`, `data:`…) leaves it without one,
|
|
5626
|
+
* and the console says so once.
|
|
5627
|
+
*/
|
|
5628
|
+
href?: string;
|
|
5629
|
+
/**
|
|
5630
|
+
* Opens the link in a new tab, with `noopener noreferrer` added to the
|
|
5631
|
+
* `rel` it is given.
|
|
5632
|
+
*/
|
|
5486
5633
|
external?: boolean;
|
|
5487
5634
|
}
|
|
5488
|
-
declare function FooterLink({ external, className, children, ...props }: FooterLinkProps): react_jsx_runtime.JSX.Element;
|
|
5635
|
+
declare function FooterLink({ external, href, rel, className, children, ...props }: FooterLinkProps): react_jsx_runtime.JSX.Element;
|
|
5489
5636
|
declare namespace FooterLink {
|
|
5490
5637
|
var displayName: string;
|
|
5491
5638
|
}
|
|
@@ -5503,6 +5650,17 @@ interface FooterSocialProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
5503
5650
|
children?: ReactNode;
|
|
5504
5651
|
}
|
|
5505
5652
|
interface FooterSocialLinkProps extends ComponentPropsWithoutRef<"a"> {
|
|
5653
|
+
/**
|
|
5654
|
+
* Where it leads. An `http:`, `https:`, `mailto:`, `tel:` or relative address
|
|
5655
|
+
* makes a link; any other (`javascript:`, `data:`…) leaves it without one,
|
|
5656
|
+
* and the console says so once.
|
|
5657
|
+
*/
|
|
5658
|
+
href?: string;
|
|
5659
|
+
/**
|
|
5660
|
+
* Added to `noopener noreferrer`, which the link always carries: it opens
|
|
5661
|
+
* in a new tab.
|
|
5662
|
+
*/
|
|
5663
|
+
rel?: string;
|
|
5506
5664
|
icon: ReactNode;
|
|
5507
5665
|
label: string;
|
|
5508
5666
|
}
|
|
@@ -5510,7 +5668,7 @@ declare function FooterSocial({ className, children, ...props }: FooterSocialPro
|
|
|
5510
5668
|
declare namespace FooterSocial {
|
|
5511
5669
|
var displayName: string;
|
|
5512
5670
|
}
|
|
5513
|
-
declare function FooterSocialLink({ icon, label, className, ...props }: FooterSocialLinkProps): react_jsx_runtime.JSX.Element;
|
|
5671
|
+
declare function FooterSocialLink({ icon, label, href, rel, className, ...props }: FooterSocialLinkProps): react_jsx_runtime.JSX.Element;
|
|
5514
5672
|
declare namespace FooterSocialLink {
|
|
5515
5673
|
var displayName: string;
|
|
5516
5674
|
}
|