@epam/ai-dial-ui-kit 0.2.0-rc.0 → 0.2.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,8 @@
5
5
  src="https://avatars.githubusercontent.com/u/1589802?s=200&v=4"
6
6
  />](#)
7
7
 
8
- A comprehensive React-based UI components library specifically designed for building AI-driven applications with modern standards and enterprise-grade quality.
8
+
9
+ The AI DIAL UI Kit is an production-ready React component library designed to streamline your development process. It features a collection of base components, such as Buttons, Inputs, Dropdowns, and more — allowing you to effortlessly reuse elements, quick and easy.
9
10
 
10
11
  [![npm version](https://badge.fury.io/js/@epam%2Fai-dial-ui-kit.svg)](https://badge.fury.io/js/@epam%2Fai-dial-ui-kit)
11
12
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
@@ -14,7 +15,7 @@ A comprehensive React-based UI components library specifically designed for buil
14
15
 
15
16
  ## Table of Contents
16
17
 
17
- - [✨ Features](#-features)
18
+ - [✨ Highlights](#-highlights)
18
19
  - [📖 Documentation](#-documentation)
19
20
  - [🚀 Quick Start](#-quick-start)
20
21
  - [Prerequisites](#prerequisites)
@@ -30,22 +31,21 @@ A comprehensive React-based UI components library specifically designed for buil
30
31
  - [Production Build](#production-build)
31
32
  - [🚀 Usage in Projects](#-usage-in-projects)
32
33
  - [Next.js Integration](#nextjs-integration)
33
- - [Vite Integration](#vite-integration)
34
34
  - [Tree Shaking](#tree-shaking)
35
35
  - [🤝 Contributing](#-contributing)
36
36
  - [🔒 Security](#-security)
37
37
  - [📄 License](#-license)
38
38
  - [🌟 Related Projects](#-related-projects)
39
39
 
40
- ## ✨ Features
40
+ ## ✨ Highlights
41
41
 
42
- - 🎨 **Unified User Experience**: Consistent design language for all AI DIAL applications
42
+ - 🎨 **Unified User Experience**: Ui Kit usage helps with design consistency across AI DIAL applications
43
43
  - ⚡ **Modern Stack**: Built with latest React, TypeScript, Vite, and Tailwind CSS
44
44
  - 🎨 **Highly Customizable**: Deep theming capabilities with CSS custom properties
45
45
  - 🧪 **Well-Tested**: Comprehensive test coverage (70%+) with Vitest and React Testing Library
46
- - 📚 **Storybook Ready**: Interactive component documentation and development playground
47
- - 🛠️ **Developer Experience**: ESLint, Prettier, Husky for maintainable code quality
48
- - 📦 **Distribution Ready**: NPM package ready for easy integration
46
+ - 📚 **Storybook Ready**: Includes interactive component documentation and development playground
47
+ - 🛠️ **Developer Experience**: Leverage ESLint, Prettier, Husky for maintainable code quality
48
+ - 📦 **Distribution Ready**: Deployed as NPM package ready for easy integration
49
49
 
50
50
  ## 📖 Documentation
51
51
 
@@ -92,9 +92,9 @@ function App() {
92
92
 
93
93
  ### Development Setup
94
94
 
95
- 1. **Fork and Clone**
95
+ 1. **Clone the repo**
96
96
  ```bash
97
- git clone https://github.com/your-username/ai-dial-ui-kit.git
97
+ git clone https://github.com/epam/ai-dial-ui-kit.git
98
98
  cd ai-dial-ui-kit
99
99
  ```
100
100
 
@@ -163,7 +163,7 @@ Full list of variables is available [here](tailwind.config.js)
163
163
 
164
164
  ## 📖 Storybook
165
165
 
166
- Storybook is a frontend workshop for building UI components and pages in isolation.
166
+ Storybook is a handy library for documenting and developing of UI components.
167
167
 
168
168
  ### Stories
169
169
  To run fully interactive storybook:
@@ -248,6 +248,7 @@ export default function Home() {
248
248
  </div>
249
249
  );
250
250
  }
251
+ ```
251
252
  </details>
252
253
 
253
254
 
@@ -272,7 +273,6 @@ We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md)
272
273
  - Testing requirements
273
274
  - Pull request process
274
275
 
275
-
276
276
  ## 🔒 Security
277
277
 
278
278
  If you discover a security vulnerability, please refer to our [Security Policy](./SECURITY.md).
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),p=require("classnames"),u=require("@floating-ui/react"),f=require("react"),D=({icon:e,className:s})=>e?t.jsx("span",{className:p("flex-shrink-0",s),children:e}):null,H=({title:e,cssClass:s,ref:n,onClick:r,disable:l,iconAfter:a,iconBefore:o,hideTitleOnMobile:c,ariaLabel:i})=>{const x=p("dial-small-semi",a?"mr-2":"",o?"ml-2":"",c?"hidden sm:inline":"inline"),d=p(s,"focus-visible:outline outline-offset-0");return t.jsxs("button",{ref:n,type:"button",className:d,onClick:m=>r?.(m),disabled:l,"aria-label":e||i,children:[t.jsx(D,{icon:o}),e&&t.jsx("span",{className:x,children:e}),t.jsx(D,{icon:a})]})},R=({errorText:e})=>e&&t.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),k=({fieldTitle:e,htmlFor:s,optional:n,optionalText:r,cssClass:l})=>e?t.jsxs("label",{className:p("dial-tiny text-secondary",l,!l?.includes("mb")&&"mb-2"),htmlFor:s,children:[t.jsx("span",{className:"min-h-4",children:e}),n&&t.jsx("span",{className:"ml-1",children:r??"(Optional)"})]}):null,U=7,_=2,E=f.createContext(null),I=()=>{const e=f.useContext(E);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},K=({initialOpen:e=!1,placement:s="bottom",isTriggerClickable:n=!1,open:r,onOpenChange:l}={})=>{const[a,o]=f.useState(e),c=f.useRef(null),i=r??a,x=l??o,d=u.useFloating({placement:s,open:i,onOpenChange:x,whileElementsMounted:u.autoUpdate,middleware:[u.offset(U+_),u.flip({crossAxis:s.includes("-"),fallbackAxisSideDirection:"start",padding:5}),u.shift({padding:5}),u.arrow({element:c})]}),m=u.useHover(d.context,{move:!1,enabled:r==null,mouseOnly:n,delay:{open:500,close:0}}),T=u.useFocus(d.context,{enabled:r==null}),F=u.useDismiss(d.context),h=u.useRole(d.context,{role:"tooltip"}),g=u.useInteractions([m,T,F,h]);return f.useMemo(()=>({open:i,setOpen:x,arrowRef:c,...g,...d}),[i,x,g,d])},O=({children:e,...s})=>{const n=K(s);return t.jsx(E.Provider,{value:n,children:e})},$=f.forwardRef(function({style:s,...n},r){const l=I(),a=u.useMergeRefs([l.refs.setFloating,r]);return l.open?t.jsx(u.FloatingPortal,{id:"tooltip-portal",children:t.jsxs("div",{ref:a,style:{...l.floatingStyles,...s},...l.getFloatingProps(n),className:p("z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",l.getFloatingProps(n).className),children:[n.children,t.jsx(u.FloatingArrow,{ref:l.arrowRef,context:l.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),z=f.forwardRef(function({children:s,asChild:n=!1,...r},l){const a=I(),c=s&&typeof s=="object"&&"ref"in s&&s.ref!==void 0?s.ref:void 0,i=u.useMergeRefs([a.refs.setReference,l,c]);return n&&f.isValidElement(s)?f.cloneElement(s,a.getReferenceProps({ref:i,...r,...s.props})):t.jsx("span",{ref:i,...a.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-left",children:s})}),w=({hideTooltip:e,tooltip:s,children:n,triggerClassName:r,contentClassName:l,...a})=>e||!s?t.jsx("span",{className:r,children:n}):t.jsxs(O,{...a,children:[t.jsx(z,{className:p(r,"truncate"),children:n}),t.jsx($,{className:p("text-primary",l,"max-w-[300px]",(e||!s)&&"hidden"),children:s})]}),A=({value:e,textareaId:s,placeholder:n,cssClass:r="",disabled:l,invalid:a,readonly:o,onChange:c})=>t.jsx(w,{tooltip:e,triggerClassName:"flex",children:t.jsx("textarea",{id:s,placeholder:n,value:e||"",disabled:l,className:p("dial-textarea dial-input",a?"dial-input-error":"",l&&"dial-input-disable",o&&"dial-input-readonly",r),onChange:i=>!o&&c?.(i.currentTarget.value)})}),G=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],B=(e,s,n,r)=>{if((s==="number"||n!==void 0||r!==void 0)&&!G.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(n===void 0||n<0))&&!(e.key==="."&&s==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(n!==void 0||r!==void 0){const a=e.currentTarget.value,o=e.currentTarget.selectionStart||0,c=a.slice(0,o)+e.key+a.slice(o),i=parseFloat(c);if(!isNaN(i)){if(n!==void 0&&i<n){e.preventDefault();return}if(r!==void 0&&i>r){e.preventDefault();return}}}}},y=({iconBeforeInput:e,iconAfterInput:s,hideBorder:n,value:r,elementId:l,placeholder:a="",cssClass:o="",containerCssClass:c,tooltipTriggerClassName:i,type:x="text",disabled:d,readonly:m,invalid:T,onChange:F,min:h,max:g,prefix:P,suffix:S,textBeforeInput:j,textAfterInput:N})=>{const M=b=>b.target.blur(),V=x==="number"||h!==void 0||g!==void 0,W=b=>{B(b,x,h,g)},q=b=>{const v=b.currentTarget.value;if(V&&v!==""){const C=parseFloat(v);if(isNaN(C)&&v!=="-"&&v!=="."||!isNaN(C)&&(h!==void 0&&C<h||g!==void 0&&C>g))return}F?.(v)};return t.jsxs("div",{className:p("dial-input-field flex flex-row items-center justify-between",n?"dial-input-no-border":"dial-input",T&&"dial-input-error",d&&"dial-input-disable",m&&"dial-input-readonly",!j&&"pl-1",!N&&"pr-1",c),children:[j&&t.jsx(w,{tooltip:j,children:t.jsx(y,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"px-2 overflow-hidden overflow-ellipsis dial-small",value:j,disabled:!0,elementId:j+"textBefore"})}),P&&t.jsxs("p",{className:"text-secondary dial-small pl-2",children:[" ",P]}),t.jsx(D,{icon:e,className:"pl-2"}),t.jsx(w,{tooltip:r,triggerClassName:i,children:t.jsx("input",{type:x,autoComplete:"off",id:l,placeholder:a,value:r??"",title:r?String(r):"",disabled:d,className:p("border-0 bg-transparent px-2",o),onChange:b=>!m&&q?.(b),onKeyDown:W,onWheel:M,min:h,max:g})}),t.jsx(D,{icon:s,className:"pr-2"}),S&&t.jsxs("p",{className:"text-secondary dial-small pr-2",children:[" ",S]}),N&&t.jsx(w,{tooltip:N,children:t.jsx(y,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",cssClass:"px-2",value:N,disabled:!0,elementId:N+"textAfter"})})]})},Y=/^0+\.(\d+)?$/,Z=/^0+/,L=({fieldTitle:e,errorText:s,optional:n,elementCssClass:r,elementContainerCssClass:l,elementId:a,containerCssClass:o,readonly:c,defaultEmptyText:i,min:x,max:d,...m})=>t.jsxs("div",{className:p("flex flex-col",o),children:[t.jsx(k,{fieldTitle:e,optional:n,htmlFor:a}),c?t.jsx("span",{children:m.value||(i??"None")}):t.jsxs(t.Fragment,{children:[t.jsx(y,{elementId:a,cssClass:r,containerCssClass:l,invalid:s!=null,min:x,max:d,...m}),t.jsx(R,{errorText:s})]})]}),J=({onChange:e,value:s,min:n,max:r,...l})=>{const a=o=>String(o)?.match(Y)?String(o)?.replace(Z,"0"):Number(o);return t.jsx(L,{type:"number",onChange:o=>e?.(a(o)),value:s,min:n,max:r,...l})},Q=({onChange:e,...s})=>t.jsx(L,{type:"text",onChange:n=>e?.(n),...s}),X=({fieldTitle:e,optional:s,elementId:n,elementCssClass:r,errorText:l,...a})=>t.jsxs("div",{className:"flex flex-col",children:[t.jsx(k,{fieldTitle:e,optional:s,htmlFor:n}),t.jsx(A,{textareaId:n,cssClass:r,...a}),t.jsx(R,{errorText:l})]}),ee=({title:e,switchId:s,isOn:n=!1,disabled:r,onChange:l})=>{const a=p("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",n?"flex-row-reverse":"flex-row",r?"pointer-events-none":"",r?n?"bg-controls-disable":"bg-layer-4":n?"bg-accent-primary":"bg-layer-4"),o=f.useCallback(c=>{c.stopPropagation(),l?.(!n)},[l,n]);return t.jsxs("div",{className:"flex flex-row items-center",children:[t.jsx("input",{type:"checkbox",onChange:o,id:s,disabled:r,className:"invisible w-0 h-0",checked:n}),t.jsx("label",{htmlFor:s,className:a,children:t.jsx("span",{className:p("size-3 rounded-full",r?n?"bg-controls-disable":"bg-layer-4":"bg-controls-enable-primary")})}),e&&t.jsx("span",{className:"h-[14px] pl-2 small text-primary",children:e})]})};exports.DialButton=H;exports.DialErrorText=R;exports.DialFieldLabel=k;exports.DialIcon=D;exports.DialInput=y;exports.DialNumberInputField=J;exports.DialSwitch=ee;exports.DialTextAreaField=X;exports.DialTextInputField=Q;exports.DialTextarea=A;exports.DialTooltip=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("classnames"),y=require("@tabler/icons-react"),u=require("@floating-ui/react"),f=require("react"),N=({icon:e,className:r})=>e?s.jsx("span",{className:d("flex-shrink-0",r),children:e}):null,A=({title:e,cssClass:r,ref:t,onClick:n,disable:l,iconAfter:o,iconBefore:a,hideTitleOnMobile:c,ariaLabel:i})=>{const p=d("dial-small-semi",o?"mr-2":"",a?"ml-2":"",c?"hidden sm:inline":"inline"),x=d(r,"focus-visible:outline outline-offset-0");return s.jsxs("button",{ref:t,type:"button",className:x,onClick:m=>n?.(m),disabled:l,"aria-label":e||i,children:[s.jsx(N,{icon:a}),e&&s.jsx("span",{className:p,children:e}),s.jsx(N,{icon:o})]})},k=({errorText:e})=>e&&s.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),S=({fieldTitle:e,htmlFor:r,optional:t,optionalText:n,cssClass:l})=>e?s.jsxs("label",{className:d("dial-tiny text-secondary",l,!l?.includes("mb")&&"mb-2"),htmlFor:r,children:[s.jsx("span",{className:"min-h-4",children:e}),t&&s.jsx("span",{className:"ml-1",children:n??"(Optional)"})]}):null;var j=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(j||{});const _={info:s.jsx(y.IconInfoCircle,{size:24}),error:s.jsx(y.IconAlertCircle,{size:24}),warning:s.jsx(y.IconAlertTriangle,{size:24}),success:s.jsx(y.IconCircleCheck,{size:24})},B={[j.Info]:"bg-info border-info text-info",[j.Success]:"bg-success border-success text-success",[j.Warning]:"bg-warning border-warning text-warning",[j.Error]:"bg-error border-error text-error"},K="inline-flex items-center justify-between gap-2 px-3 py-2 border border-solid shadow text-sm w-auto rounded",O=({variant:e=j.Info,message:r,cssClass:t,closable:n=!0,onClose:l})=>s.jsxs("div",{role:"alert",className:d(K,B[e],t),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(N,{icon:_[e]}),s.jsx("div",{className:"text-primary",children:r})]}),n&&s.jsx(A,{cssClass:"ml-2 text-secondary hover:text-primary ml-2 text-secondary hover:text-primary ",ariaLabel:"Close alert",iconBefore:s.jsx(y.IconX,{size:16}),onClick:o=>l?.(o)})]}),$=7,G=2,z=f.createContext(null),W=()=>{const e=f.useContext(z);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},X=({initialOpen:e=!1,placement:r="bottom",isTriggerClickable:t=!1,open:n,onOpenChange:l}={})=>{const[o,a]=f.useState(e),c=f.useRef(null),i=n??o,p=l??a,x=u.useFloating({placement:r,open:i,onOpenChange:p,whileElementsMounted:u.autoUpdate,middleware:[u.offset($+G),u.flip({crossAxis:r.includes("-"),fallbackAxisSideDirection:"start",padding:5}),u.shift({padding:5}),u.arrow({element:c})]}),m=u.useHover(x.context,{move:!1,enabled:n==null,mouseOnly:t,delay:{open:500,close:0}}),I=u.useFocus(x.context,{enabled:n==null}),R=u.useDismiss(x.context),b=u.useRole(x.context,{role:"tooltip"}),g=u.useInteractions([m,I,R,b]);return f.useMemo(()=>({open:i,setOpen:p,arrowRef:c,...g,...x}),[i,p,g,x])},Y=({children:e,...r})=>{const t=X(r);return s.jsx(z.Provider,{value:t,children:e})},Z=f.forwardRef(function({style:r,...t},n){const l=W(),o=u.useMergeRefs([l.refs.setFloating,n]);return l.open?s.jsx(u.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...l.floatingStyles,...r},...l.getFloatingProps(t),className:d("z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",l.getFloatingProps(t).className),children:[t.children,s.jsx(u.FloatingArrow,{ref:l.arrowRef,context:l.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),J=f.forwardRef(function({children:r,asChild:t=!1,...n},l){const o=W(),c=r&&typeof r=="object"&&"ref"in r&&r.ref!==void 0?r.ref:void 0,i=u.useMergeRefs([o.refs.setReference,l,c]);return t&&f.isValidElement(r)?f.cloneElement(r,o.getReferenceProps({ref:i,...n,...r.props})):s.jsx("span",{ref:i,...o.getReferenceProps(n),className:n.className??"dial-tooltip-trigger text-left",children:r})}),D=({hideTooltip:e,tooltip:r,children:t,triggerClassName:n,contentClassName:l,...o})=>e||!r?s.jsx("span",{className:n,children:t}):s.jsxs(Y,{...o,children:[s.jsx(J,{className:d(n,"truncate"),children:t}),s.jsx(Z,{className:d("text-primary",l,"max-w-[300px]",(e||!r)&&"hidden"),children:r})]}),L=({value:e,textareaId:r,placeholder:t,cssClass:n="",disabled:l,invalid:o,readonly:a,onChange:c})=>s.jsx(D,{tooltip:e,triggerClassName:"flex",children:s.jsx("textarea",{id:r,placeholder:t,value:e||"",disabled:l,className:d("dial-textarea dial-input",o?"dial-input-error":"",l&&"dial-input-disable",a&&"dial-input-readonly",n),onChange:i=>!a&&c?.(i.currentTarget.value)})}),Q=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],ee=(e,r,t,n)=>{if((r==="number"||t!==void 0||n!==void 0)&&!Q.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(t===void 0||t<0))&&!(e.key==="."&&r==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(t!==void 0||n!==void 0){const o=e.currentTarget.value,a=e.currentTarget.selectionStart||0,c=o.slice(0,a)+e.key+o.slice(a),i=parseFloat(c);if(!isNaN(i)){if(t!==void 0&&i<t){e.preventDefault();return}if(n!==void 0&&i>n){e.preventDefault();return}}}}},F=({iconBeforeInput:e,iconAfterInput:r,hideBorder:t,value:n,elementId:l,placeholder:o="",cssClass:a="",containerCssClass:c,tooltipTriggerClassName:i,type:p="text",disabled:x,readonly:m,invalid:I,onChange:R,min:b,max:g,prefix:E,suffix:P,textBeforeInput:v,textAfterInput:w})=>{const q=h=>h.target.blur(),H=p==="number"||b!==void 0||g!==void 0,U=h=>{ee(h,p,b,g)},V=h=>{const C=h.currentTarget.value;if(H&&C!==""){const T=parseFloat(C);if(isNaN(T)&&C!=="-"&&C!=="."||!isNaN(T)&&(b!==void 0&&T<b||g!==void 0&&T>g))return}R?.(C)};return s.jsxs("div",{className:d("dial-input-field flex flex-row items-center justify-between",t?"dial-input-no-border":"dial-input",I&&"dial-input-error",x&&"dial-input-disable",m&&"dial-input-readonly",!v&&"pl-1",!w&&"pr-1",c),children:[v&&s.jsx(D,{tooltip:v,children:s.jsx(F,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"px-2 overflow-hidden overflow-ellipsis dial-small",value:v,disabled:!0,elementId:v+"textBefore"})}),E&&s.jsxs("p",{className:"text-secondary dial-small pl-2",children:[" ",E]}),s.jsx(N,{icon:e,className:"pl-2"}),s.jsx(D,{tooltip:n,triggerClassName:i,children:s.jsx("input",{type:p,autoComplete:"off",id:l,placeholder:o,value:n??"",title:n?String(n):"",disabled:x,className:d("border-0 bg-transparent px-2",a),onChange:h=>!m&&V?.(h),onKeyDown:U,onWheel:q,min:b,max:g})}),s.jsx(N,{icon:r,className:"pr-2"}),P&&s.jsxs("p",{className:"text-secondary dial-small pr-2",children:[" ",P]}),w&&s.jsx(D,{tooltip:w,children:s.jsx(F,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",cssClass:"px-2",value:w,disabled:!0,elementId:w+"textAfter"})})]})},se=/^0+\.(\d+)?$/,re=/^0+/,M=({fieldTitle:e,errorText:r,optional:t,elementCssClass:n,elementContainerCssClass:l,elementId:o,containerCssClass:a,readonly:c,defaultEmptyText:i,min:p,max:x,...m})=>s.jsxs("div",{className:d("flex flex-col",a),children:[s.jsx(S,{fieldTitle:e,optional:t,htmlFor:o}),c?s.jsx("span",{children:m.value||(i??"None")}):s.jsxs(s.Fragment,{children:[s.jsx(F,{elementId:o,cssClass:n,containerCssClass:l,invalid:r!=null,min:p,max:x,...m}),s.jsx(k,{errorText:r})]})]}),te=({onChange:e,value:r,min:t,max:n,...l})=>{const o=a=>String(a)?.match(se)?String(a)?.replace(re,"0"):Number(a);return s.jsx(M,{type:"number",onChange:a=>e?.(o(a)),value:r,min:t,max:n,...l})},ne=({onChange:e,...r})=>s.jsx(M,{type:"text",onChange:t=>e?.(t),...r}),le=({fieldTitle:e,optional:r,elementId:t,elementCssClass:n,errorText:l,...o})=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(S,{fieldTitle:e,optional:r,htmlFor:t}),s.jsx(L,{textareaId:t,cssClass:n,...o}),s.jsx(k,{errorText:l})]}),oe=({title:e,switchId:r,isOn:t=!1,disabled:n,onChange:l})=>{const o=d("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",t?"flex-row-reverse":"flex-row",n?"pointer-events-none":"",n?t?"bg-controls-disable":"bg-layer-4":t?"bg-accent-primary":"bg-layer-4"),a=f.useCallback(c=>{c.stopPropagation(),l?.(!t)},[l,t]);return s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx("input",{type:"checkbox",onChange:a,id:r,disabled:n,className:"invisible w-0 h-0",checked:t}),s.jsx("label",{htmlFor:r,className:o,children:s.jsx("span",{className:d("size-3 rounded-full",n?t?"bg-controls-disable":"bg-layer-4":"bg-controls-enable-primary")})}),e&&s.jsx("span",{className:"h-[14px] pl-2 small text-primary",children:e})]})};exports.AlertVariant=j;exports.DialAlert=O;exports.DialButton=A;exports.DialErrorText=k;exports.DialFieldLabel=S;exports.DialIcon=N;exports.DialInput=F;exports.DialNumberInputField=te;exports.DialSwitch=oe;exports.DialTextAreaField=le;exports.DialTextInputField=ne;exports.DialTextarea=L;exports.DialTooltip=D;
@@ -1,138 +1,182 @@
1
- import { jsx as l, jsxs as m, Fragment as _ } from "react/jsx-runtime";
2
- import d from "classnames";
3
- import { useFloating as K, offset as M, flip as z, shift as G, arrow as O, autoUpdate as $, useHover as Y, useFocus as Z, useDismiss as q, useRole as B, useInteractions as J, useMergeRefs as P, FloatingPortal as Q, FloatingArrow as X } from "@floating-ui/react";
4
- import { createContext as ee, useState as te, useRef as ne, useMemo as re, useContext as le, forwardRef as E, isValidElement as se, cloneElement as oe, useCallback as ae } from "react";
5
- const y = ({ icon: e, className: t }) => e ? /* @__PURE__ */ l("span", { className: d("flex-shrink-0", t), children: e }) : null, ye = ({
1
+ import { jsx as t, jsxs as p, Fragment as _ } from "react/jsx-runtime";
2
+ import u from "classnames";
3
+ import { IconCircleCheck as K, IconAlertTriangle as V, IconAlertCircle as B, IconInfoCircle as G, IconX as O } from "@tabler/icons-react";
4
+ import { useFloating as $, offset as X, flip as Y, shift as Z, arrow as q, autoUpdate as J, useHover as Q, useFocus as ee, useDismiss as re, useRole as ne, useInteractions as te, useMergeRefs as E, FloatingPortal as se, FloatingArrow as oe } from "@floating-ui/react";
5
+ import { createContext as le, useState as ae, useRef as ie, useMemo as ce, useContext as ue, forwardRef as P, isValidElement as de, cloneElement as pe, useCallback as me } from "react";
6
+ const C = ({ icon: e, className: r }) => e ? /* @__PURE__ */ t("span", { className: u("flex-shrink-0", r), children: e }) : null, fe = ({
6
7
  title: e,
7
- cssClass: t,
8
+ cssClass: r,
8
9
  ref: n,
9
- onClick: r,
10
- disable: s,
11
- iconAfter: o,
10
+ onClick: s,
11
+ disable: o,
12
+ iconAfter: l,
12
13
  iconBefore: a,
13
14
  hideTitleOnMobile: c,
14
15
  ariaLabel: i
15
16
  }) => {
16
- const p = d(
17
+ const m = u(
17
18
  "dial-small-semi",
18
- o ? "mr-2" : "",
19
+ l ? "mr-2" : "",
19
20
  a ? "ml-2" : "",
20
21
  c ? "hidden sm:inline" : "inline"
21
- ), u = d(
22
- t,
22
+ ), d = u(
23
+ r,
23
24
  "focus-visible:outline outline-offset-0"
24
25
  );
25
- return /* @__PURE__ */ m(
26
+ return /* @__PURE__ */ p(
26
27
  "button",
27
28
  {
28
29
  ref: n,
29
30
  type: "button",
30
- className: u,
31
- onClick: (f) => r?.(f),
32
- disabled: s,
31
+ className: d,
32
+ onClick: (f) => s?.(f),
33
+ disabled: o,
33
34
  "aria-label": e || i,
34
35
  children: [
35
- /* @__PURE__ */ l(y, { icon: a }),
36
- e && /* @__PURE__ */ l("span", { className: p, children: e }),
37
- /* @__PURE__ */ l(y, { icon: o })
36
+ /* @__PURE__ */ t(C, { icon: a }),
37
+ e && /* @__PURE__ */ t("span", { className: m, children: e }),
38
+ /* @__PURE__ */ t(C, { icon: l })
38
39
  ]
39
40
  }
40
41
  );
41
- }, S = ({ errorText: e }) => e && /* @__PURE__ */ l("span", { className: "text-error dial-tiny mt-1", children: e }), A = ({
42
+ }, S = ({ errorText: e }) => e && /* @__PURE__ */ t("span", { className: "text-error dial-tiny mt-1", children: e }), z = ({
42
43
  fieldTitle: e,
43
- htmlFor: t,
44
+ htmlFor: r,
44
45
  optional: n,
45
- optionalText: r,
46
- cssClass: s
47
- }) => e ? /* @__PURE__ */ m(
46
+ optionalText: s,
47
+ cssClass: o
48
+ }) => e ? /* @__PURE__ */ p(
48
49
  "label",
49
50
  {
50
- className: d(
51
+ className: u(
51
52
  "dial-tiny text-secondary",
52
- s,
53
- !s?.includes("mb") && "mb-2"
53
+ o,
54
+ !o?.includes("mb") && "mb-2"
54
55
  ),
55
- htmlFor: t,
56
+ htmlFor: r,
56
57
  children: [
57
- /* @__PURE__ */ l("span", { className: "min-h-4", children: e }),
58
- n && /* @__PURE__ */ l("span", { className: "ml-1", children: r ?? "(Optional)" })
58
+ /* @__PURE__ */ t("span", { className: "min-h-4", children: e }),
59
+ n && /* @__PURE__ */ t("span", { className: "ml-1", children: s ?? "(Optional)" })
59
60
  ]
60
61
  }
61
- ) : null, ie = 7, ce = 2, I = ee(null), V = () => {
62
- const e = le(I);
62
+ ) : null;
63
+ var x = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(x || {});
64
+ const ge = {
65
+ info: /* @__PURE__ */ t(G, { size: 24 }),
66
+ error: /* @__PURE__ */ t(B, { size: 24 }),
67
+ warning: /* @__PURE__ */ t(V, { size: 24 }),
68
+ success: /* @__PURE__ */ t(K, { size: 24 })
69
+ }, he = {
70
+ [x.Info]: "bg-info border-info text-info",
71
+ [x.Success]: "bg-success border-success text-success",
72
+ [x.Warning]: "bg-warning border-warning text-warning",
73
+ [x.Error]: "bg-error border-error text-error"
74
+ }, be = "inline-flex items-center justify-between gap-2 px-3 py-2 border border-solid shadow text-sm w-auto rounded", Ae = ({
75
+ variant: e = x.Info,
76
+ message: r,
77
+ cssClass: n,
78
+ closable: s = !0,
79
+ onClose: o
80
+ }) => /* @__PURE__ */ p(
81
+ "div",
82
+ {
83
+ role: "alert",
84
+ className: u(
85
+ be,
86
+ he[e],
87
+ n
88
+ ),
89
+ children: [
90
+ /* @__PURE__ */ p("div", { className: "flex items-center gap-2", children: [
91
+ /* @__PURE__ */ t(C, { icon: ge[e] }),
92
+ /* @__PURE__ */ t("div", { className: "text-primary", children: r })
93
+ ] }),
94
+ s && /* @__PURE__ */ t(
95
+ fe,
96
+ {
97
+ cssClass: "ml-2 text-secondary hover:text-primary ml-2 text-secondary hover:text-primary ",
98
+ ariaLabel: "Close alert",
99
+ iconBefore: /* @__PURE__ */ t(O, { size: 16 }),
100
+ onClick: (l) => o?.(l)
101
+ }
102
+ )
103
+ ]
104
+ }
105
+ ), xe = 7, Ne = 2, A = le(null), W = () => {
106
+ const e = ue(A);
63
107
  if (e == null)
64
108
  throw new Error("Tooltip components must be wrapped in <Tooltip />");
65
109
  return e;
66
- }, ue = ({
110
+ }, ve = ({
67
111
  initialOpen: e = !1,
68
- placement: t = "bottom",
112
+ placement: r = "bottom",
69
113
  isTriggerClickable: n = !1,
70
- open: r,
71
- onOpenChange: s
114
+ open: s,
115
+ onOpenChange: o
72
116
  } = {}) => {
73
- const [o, a] = te(e), c = ne(null), i = r ?? o, p = s ?? a, u = K({
74
- placement: t,
117
+ const [l, a] = ae(e), c = ie(null), i = s ?? l, m = o ?? a, d = $({
118
+ placement: r,
75
119
  open: i,
76
- onOpenChange: p,
77
- whileElementsMounted: $,
120
+ onOpenChange: m,
121
+ whileElementsMounted: J,
78
122
  middleware: [
79
- M(ie + ce),
80
- z({
81
- crossAxis: t.includes("-"),
123
+ X(xe + Ne),
124
+ Y({
125
+ crossAxis: r.includes("-"),
82
126
  fallbackAxisSideDirection: "start",
83
127
  padding: 5
84
128
  }),
85
- G({ padding: 5 }),
86
- O({
129
+ Z({ padding: 5 }),
130
+ q({
87
131
  element: c
88
132
  })
89
133
  ]
90
- }), f = Y(u.context, {
134
+ }), f = Q(d.context, {
91
135
  move: !1,
92
- enabled: r == null,
136
+ enabled: s == null,
93
137
  mouseOnly: n,
94
138
  delay: { open: 500, close: 0 }
95
- }), D = Z(u.context, {
96
- enabled: r == null
97
- }), T = q(u.context), g = B(u.context, { role: "tooltip" }), h = J([f, D, T, g]);
98
- return re(
139
+ }), T = ee(d.context, {
140
+ enabled: s == null
141
+ }), k = re(d.context), h = ne(d.context, { role: "tooltip" }), g = te([f, T, k, h]);
142
+ return ce(
99
143
  () => ({
100
144
  open: i,
101
- setOpen: p,
145
+ setOpen: m,
102
146
  arrowRef: c,
103
- ...h,
104
- ...u
147
+ ...g,
148
+ ...d
105
149
  }),
106
- [i, p, h, u]
150
+ [i, m, g, d]
107
151
  );
108
- }, de = ({
152
+ }, we = ({
109
153
  children: e,
110
- ...t
154
+ ...r
111
155
  }) => {
112
- const n = ue(t);
113
- return /* @__PURE__ */ l(I.Provider, { value: n, children: e });
114
- }, pe = E(function({ style: t, ...n }, r) {
115
- const s = V(), o = P([s.refs.setFloating, r]);
116
- return s.open ? /* @__PURE__ */ l(Q, { id: "tooltip-portal", children: /* @__PURE__ */ m(
156
+ const n = ve(r);
157
+ return /* @__PURE__ */ t(A.Provider, { value: n, children: e });
158
+ }, Ce = P(function({ style: r, ...n }, s) {
159
+ const o = W(), l = E([o.refs.setFloating, s]);
160
+ return o.open ? /* @__PURE__ */ t(se, { id: "tooltip-portal", children: /* @__PURE__ */ p(
117
161
  "div",
118
162
  {
119
- ref: o,
163
+ ref: l,
120
164
  style: {
121
- ...s.floatingStyles,
122
- ...t
165
+ ...o.floatingStyles,
166
+ ...r
123
167
  },
124
- ...s.getFloatingProps(n),
125
- className: d(
168
+ ...o.getFloatingProps(n),
169
+ className: u(
126
170
  "z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",
127
- s.getFloatingProps(n).className
171
+ o.getFloatingProps(n).className
128
172
  ),
129
173
  children: [
130
174
  n.children,
131
- /* @__PURE__ */ l(
132
- X,
175
+ /* @__PURE__ */ t(
176
+ oe,
133
177
  {
134
- ref: s.arrowRef,
135
- context: s.context,
178
+ ref: o.arrowRef,
179
+ context: o.context,
136
180
  fill: "currentColor",
137
181
  strokeWidth: 1,
138
182
  className: "stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"
@@ -141,71 +185,71 @@ const y = ({ icon: e, className: t }) => e ? /* @__PURE__ */ l("span", { classNa
141
185
  ]
142
186
  }
143
187
  ) }) : null;
144
- }), me = E(function({ children: t, asChild: n = !1, ...r }, s) {
145
- const o = V(), c = t && typeof t == "object" && "ref" in t && t.ref !== void 0 ? t.ref : void 0, i = P([o.refs.setReference, s, c]);
146
- return n && se(t) ? oe(
147
- t,
148
- o.getReferenceProps({
188
+ }), ye = P(function({ children: r, asChild: n = !1, ...s }, o) {
189
+ const l = W(), c = r && typeof r == "object" && "ref" in r && r.ref !== void 0 ? r.ref : void 0, i = E([l.refs.setReference, o, c]);
190
+ return n && de(r) ? pe(
191
+ r,
192
+ l.getReferenceProps({
149
193
  ref: i,
150
- ...r,
151
- ...t.props
194
+ ...s,
195
+ ...r.props
152
196
  })
153
- ) : /* @__PURE__ */ l(
197
+ ) : /* @__PURE__ */ t(
154
198
  "span",
155
199
  {
156
200
  ref: i,
157
- ...o.getReferenceProps(r),
158
- className: r.className ?? "dial-tooltip-trigger text-left",
159
- children: t
201
+ ...l.getReferenceProps(s),
202
+ className: s.className ?? "dial-tooltip-trigger text-left",
203
+ children: r
160
204
  }
161
205
  );
162
- }), C = ({
206
+ }), D = ({
163
207
  hideTooltip: e,
164
- tooltip: t,
208
+ tooltip: r,
165
209
  children: n,
166
- triggerClassName: r,
167
- contentClassName: s,
168
- ...o
169
- }) => e || !t ? /* @__PURE__ */ l("span", { className: r, children: n }) : /* @__PURE__ */ m(de, { ...o, children: [
170
- /* @__PURE__ */ l(me, { className: d(r, "truncate"), children: n }),
171
- /* @__PURE__ */ l(
172
- pe,
210
+ triggerClassName: s,
211
+ contentClassName: o,
212
+ ...l
213
+ }) => e || !r ? /* @__PURE__ */ t("span", { className: s, children: n }) : /* @__PURE__ */ p(we, { ...l, children: [
214
+ /* @__PURE__ */ t(ye, { className: u(s, "truncate"), children: n }),
215
+ /* @__PURE__ */ t(
216
+ Ce,
173
217
  {
174
- className: d(
218
+ className: u(
175
219
  "text-primary",
176
- s,
220
+ o,
177
221
  "max-w-[300px]",
178
- (e || !t) && "hidden"
222
+ (e || !r) && "hidden"
179
223
  ),
180
- children: t
224
+ children: r
181
225
  }
182
226
  )
183
- ] }), fe = ({
227
+ ] }), De = ({
184
228
  value: e,
185
- textareaId: t,
229
+ textareaId: r,
186
230
  placeholder: n,
187
- cssClass: r = "",
188
- disabled: s,
189
- invalid: o,
231
+ cssClass: s = "",
232
+ disabled: o,
233
+ invalid: l,
190
234
  readonly: a,
191
235
  onChange: c
192
- }) => /* @__PURE__ */ l(C, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ l(
236
+ }) => /* @__PURE__ */ t(D, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ t(
193
237
  "textarea",
194
238
  {
195
- id: t,
239
+ id: r,
196
240
  placeholder: n,
197
241
  value: e || "",
198
- disabled: s,
199
- className: d(
242
+ disabled: o,
243
+ className: u(
200
244
  "dial-textarea dial-input",
201
- o ? "dial-input-error" : "",
202
- s && "dial-input-disable",
245
+ l ? "dial-input-error" : "",
246
+ o && "dial-input-disable",
203
247
  a && "dial-input-readonly",
204
- r
248
+ s
205
249
  ),
206
250
  onChange: (i) => !a && c?.(i.currentTarget.value)
207
251
  }
208
- ) }), he = [
252
+ ) }), Te = [
209
253
  "ArrowLeft",
210
254
  "ArrowRight",
211
255
  "ArrowUp",
@@ -217,20 +261,20 @@ const y = ({ icon: e, className: t }) => e ? /* @__PURE__ */ l("span", { classNa
217
261
  "Escape",
218
262
  "Home",
219
263
  "End"
220
- ], ge = (e, t, n, r) => {
221
- if ((t === "number" || n !== void 0 || r !== void 0) && !he.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (n === void 0 || n < 0)) && !(e.key === "." && t === "number" && !e.currentTarget.value.includes("."))) {
264
+ ], ke = (e, r, n, s) => {
265
+ if ((r === "number" || n !== void 0 || s !== void 0) && !Te.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (n === void 0 || n < 0)) && !(e.key === "." && r === "number" && !e.currentTarget.value.includes("."))) {
222
266
  if (!/^[0-9]$/.test(e.key)) {
223
267
  e.preventDefault();
224
268
  return;
225
269
  }
226
- if (n !== void 0 || r !== void 0) {
227
- const o = e.currentTarget.value, a = e.currentTarget.selectionStart || 0, c = o.slice(0, a) + e.key + o.slice(a), i = parseFloat(c);
270
+ if (n !== void 0 || s !== void 0) {
271
+ const l = e.currentTarget.value, a = e.currentTarget.selectionStart || 0, c = l.slice(0, a) + e.key + l.slice(a), i = parseFloat(c);
228
272
  if (!isNaN(i)) {
229
273
  if (n !== void 0 && i < n) {
230
274
  e.preventDefault();
231
275
  return;
232
276
  }
233
- if (r !== void 0 && i > r) {
277
+ if (s !== void 0 && i > s) {
234
278
  e.preventDefault();
235
279
  return;
236
280
  }
@@ -239,52 +283,52 @@ const y = ({ icon: e, className: t }) => e ? /* @__PURE__ */ l("span", { classNa
239
283
  }
240
284
  }, F = ({
241
285
  iconBeforeInput: e,
242
- iconAfterInput: t,
286
+ iconAfterInput: r,
243
287
  hideBorder: n,
244
- value: r,
245
- elementId: s,
246
- placeholder: o = "",
288
+ value: s,
289
+ elementId: o,
290
+ placeholder: l = "",
247
291
  cssClass: a = "",
248
292
  containerCssClass: c,
249
293
  tooltipTriggerClassName: i,
250
- type: p = "text",
251
- disabled: u,
294
+ type: m = "text",
295
+ disabled: d,
252
296
  readonly: f,
253
- invalid: D,
254
- onChange: T,
255
- min: g,
256
- max: h,
257
- prefix: k,
297
+ invalid: T,
298
+ onChange: k,
299
+ min: h,
300
+ max: g,
301
+ prefix: I,
258
302
  suffix: R,
259
303
  textBeforeInput: N,
260
- textAfterInput: x
304
+ textAfterInput: v
261
305
  }) => {
262
- const j = (b) => b.target.blur(), H = p === "number" || g !== void 0 || h !== void 0, L = (b) => {
263
- ge(b, p, g, h);
306
+ const L = (b) => b.target.blur(), H = m === "number" || h !== void 0 || g !== void 0, M = (b) => {
307
+ ke(b, m, h, g);
264
308
  }, U = (b) => {
265
- const v = b.currentTarget.value;
266
- if (H && v !== "") {
267
- const w = parseFloat(v);
268
- if (isNaN(w) && v !== "-" && v !== "." || !isNaN(w) && (g !== void 0 && w < g || h !== void 0 && w > h))
309
+ const w = b.currentTarget.value;
310
+ if (H && w !== "") {
311
+ const y = parseFloat(w);
312
+ if (isNaN(y) && w !== "-" && w !== "." || !isNaN(y) && (h !== void 0 && y < h || g !== void 0 && y > g))
269
313
  return;
270
314
  }
271
- T?.(v);
315
+ k?.(w);
272
316
  };
273
- return /* @__PURE__ */ m(
317
+ return /* @__PURE__ */ p(
274
318
  "div",
275
319
  {
276
- className: d(
320
+ className: u(
277
321
  "dial-input-field flex flex-row items-center justify-between",
278
322
  n ? "dial-input-no-border" : "dial-input",
279
- D && "dial-input-error",
280
- u && "dial-input-disable",
323
+ T && "dial-input-error",
324
+ d && "dial-input-disable",
281
325
  f && "dial-input-readonly",
282
326
  !N && "pl-1",
283
- !x && "pr-1",
327
+ !v && "pr-1",
284
328
  c
285
329
  ),
286
330
  children: [
287
- N && /* @__PURE__ */ l(C, { tooltip: N, children: /* @__PURE__ */ l(
331
+ N && /* @__PURE__ */ t(D, { tooltip: N, children: /* @__PURE__ */ t(
288
332
  F,
289
333
  {
290
334
  hideBorder: !0,
@@ -295,191 +339,193 @@ const y = ({ icon: e, className: t }) => e ? /* @__PURE__ */ l("span", { classNa
295
339
  elementId: N + "textBefore"
296
340
  }
297
341
  ) }),
298
- k && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pl-2", children: [
342
+ I && /* @__PURE__ */ p("p", { className: "text-secondary dial-small pl-2", children: [
299
343
  " ",
300
- k
344
+ I
301
345
  ] }),
302
- /* @__PURE__ */ l(y, { icon: e, className: "pl-2" }),
303
- /* @__PURE__ */ l(C, { tooltip: r, triggerClassName: i, children: /* @__PURE__ */ l(
346
+ /* @__PURE__ */ t(C, { icon: e, className: "pl-2" }),
347
+ /* @__PURE__ */ t(D, { tooltip: s, triggerClassName: i, children: /* @__PURE__ */ t(
304
348
  "input",
305
349
  {
306
- type: p,
350
+ type: m,
307
351
  autoComplete: "off",
308
- id: s,
309
- placeholder: o,
310
- value: r ?? "",
311
- title: r ? String(r) : "",
312
- disabled: u,
313
- className: d("border-0 bg-transparent px-2", a),
352
+ id: o,
353
+ placeholder: l,
354
+ value: s ?? "",
355
+ title: s ? String(s) : "",
356
+ disabled: d,
357
+ className: u("border-0 bg-transparent px-2", a),
314
358
  onChange: (b) => !f && U?.(b),
315
- onKeyDown: L,
316
- onWheel: j,
317
- min: g,
318
- max: h
359
+ onKeyDown: M,
360
+ onWheel: L,
361
+ min: h,
362
+ max: g
319
363
  }
320
364
  ) }),
321
- /* @__PURE__ */ l(y, { icon: t, className: "pr-2" }),
322
- R && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pr-2", children: [
365
+ /* @__PURE__ */ t(C, { icon: r, className: "pr-2" }),
366
+ R && /* @__PURE__ */ p("p", { className: "text-secondary dial-small pr-2", children: [
323
367
  " ",
324
368
  R
325
369
  ] }),
326
- x && /* @__PURE__ */ l(C, { tooltip: x, children: /* @__PURE__ */ l(
370
+ v && /* @__PURE__ */ t(D, { tooltip: v, children: /* @__PURE__ */ t(
327
371
  F,
328
372
  {
329
373
  hideBorder: !0,
330
374
  containerCssClass: "rounded-l-none border-l-0",
331
375
  cssClass: "px-2",
332
- value: x,
376
+ value: v,
333
377
  disabled: !0,
334
- elementId: x + "textAfter"
378
+ elementId: v + "textAfter"
335
379
  }
336
380
  ) })
337
381
  ]
338
382
  }
339
383
  );
340
- }, be = /^0+\.(\d+)?$/, Ne = /^0+/, W = ({
384
+ }, Fe = /^0+\.(\d+)?$/, Ie = /^0+/, j = ({
341
385
  fieldTitle: e,
342
- errorText: t,
386
+ errorText: r,
343
387
  optional: n,
344
- elementCssClass: r,
345
- elementContainerCssClass: s,
346
- elementId: o,
388
+ elementCssClass: s,
389
+ elementContainerCssClass: o,
390
+ elementId: l,
347
391
  containerCssClass: a,
348
392
  readonly: c,
349
393
  defaultEmptyText: i,
350
- min: p,
351
- max: u,
394
+ min: m,
395
+ max: d,
352
396
  ...f
353
- }) => /* @__PURE__ */ m("div", { className: d("flex flex-col", a), children: [
354
- /* @__PURE__ */ l(
355
- A,
397
+ }) => /* @__PURE__ */ p("div", { className: u("flex flex-col", a), children: [
398
+ /* @__PURE__ */ t(
399
+ z,
356
400
  {
357
401
  fieldTitle: e,
358
402
  optional: n,
359
- htmlFor: o
403
+ htmlFor: l
360
404
  }
361
405
  ),
362
- c ? /* @__PURE__ */ l("span", { children: f.value || (i ?? "None") }) : /* @__PURE__ */ m(_, { children: [
363
- /* @__PURE__ */ l(
406
+ c ? /* @__PURE__ */ t("span", { children: f.value || (i ?? "None") }) : /* @__PURE__ */ p(_, { children: [
407
+ /* @__PURE__ */ t(
364
408
  F,
365
409
  {
366
- elementId: o,
367
- cssClass: r,
368
- containerCssClass: s,
369
- invalid: t != null,
370
- min: p,
371
- max: u,
410
+ elementId: l,
411
+ cssClass: s,
412
+ containerCssClass: o,
413
+ invalid: r != null,
414
+ min: m,
415
+ max: d,
372
416
  ...f
373
417
  }
374
418
  ),
375
- /* @__PURE__ */ l(S, { errorText: t })
419
+ /* @__PURE__ */ t(S, { errorText: r })
376
420
  ] })
377
- ] }), De = ({
421
+ ] }), We = ({
378
422
  onChange: e,
379
- value: t,
423
+ value: r,
380
424
  min: n,
381
- max: r,
382
- ...s
425
+ max: s,
426
+ ...o
383
427
  }) => {
384
- const o = (a) => String(a)?.match(be) ? String(a)?.replace(Ne, "0") : Number(a);
385
- return /* @__PURE__ */ l(
386
- W,
428
+ const l = (a) => String(a)?.match(Fe) ? String(a)?.replace(Ie, "0") : Number(a);
429
+ return /* @__PURE__ */ t(
430
+ j,
387
431
  {
388
432
  type: "number",
389
- onChange: (a) => e?.(o(a)),
390
- value: t,
433
+ onChange: (a) => e?.(l(a)),
434
+ value: r,
391
435
  min: n,
392
- max: r,
393
- ...s
436
+ max: s,
437
+ ...o
394
438
  }
395
439
  );
396
- }, Te = ({
440
+ }, je = ({
397
441
  onChange: e,
398
- ...t
399
- }) => /* @__PURE__ */ l(
400
- W,
442
+ ...r
443
+ }) => /* @__PURE__ */ t(
444
+ j,
401
445
  {
402
446
  type: "text",
403
447
  onChange: (n) => e?.(n),
404
- ...t
448
+ ...r
405
449
  }
406
- ), Fe = ({
450
+ ), Le = ({
407
451
  fieldTitle: e,
408
- optional: t,
452
+ optional: r,
409
453
  elementId: n,
410
- elementCssClass: r,
411
- errorText: s,
412
- ...o
413
- }) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
414
- /* @__PURE__ */ l(
415
- A,
454
+ elementCssClass: s,
455
+ errorText: o,
456
+ ...l
457
+ }) => /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
458
+ /* @__PURE__ */ t(
459
+ z,
416
460
  {
417
461
  fieldTitle: e,
418
- optional: t,
462
+ optional: r,
419
463
  htmlFor: n
420
464
  }
421
465
  ),
422
- /* @__PURE__ */ l(
423
- fe,
466
+ /* @__PURE__ */ t(
467
+ De,
424
468
  {
425
469
  textareaId: n,
426
- cssClass: r,
427
- ...o
470
+ cssClass: s,
471
+ ...l
428
472
  }
429
473
  ),
430
- /* @__PURE__ */ l(S, { errorText: s })
431
- ] }), ke = ({
474
+ /* @__PURE__ */ t(S, { errorText: o })
475
+ ] }), He = ({
432
476
  title: e,
433
- switchId: t,
477
+ switchId: r,
434
478
  isOn: n = !1,
435
- disabled: r,
436
- onChange: s
479
+ disabled: s,
480
+ onChange: o
437
481
  }) => {
438
- const o = d(
482
+ const l = u(
439
483
  "flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",
440
484
  n ? "flex-row-reverse" : "flex-row",
441
- r ? "pointer-events-none" : "",
442
- r ? n ? "bg-controls-disable" : "bg-layer-4" : n ? "bg-accent-primary" : "bg-layer-4"
443
- ), a = ae(
485
+ s ? "pointer-events-none" : "",
486
+ s ? n ? "bg-controls-disable" : "bg-layer-4" : n ? "bg-accent-primary" : "bg-layer-4"
487
+ ), a = me(
444
488
  (c) => {
445
- c.stopPropagation(), s?.(!n);
489
+ c.stopPropagation(), o?.(!n);
446
490
  },
447
- [s, n]
491
+ [o, n]
448
492
  );
449
- return /* @__PURE__ */ m("div", { className: "flex flex-row items-center", children: [
450
- /* @__PURE__ */ l(
493
+ return /* @__PURE__ */ p("div", { className: "flex flex-row items-center", children: [
494
+ /* @__PURE__ */ t(
451
495
  "input",
452
496
  {
453
497
  type: "checkbox",
454
498
  onChange: a,
455
- id: t,
456
- disabled: r,
499
+ id: r,
500
+ disabled: s,
457
501
  className: "invisible w-0 h-0",
458
502
  checked: n
459
503
  }
460
504
  ),
461
- /* @__PURE__ */ l("label", { htmlFor: t, className: o, children: /* @__PURE__ */ l(
505
+ /* @__PURE__ */ t("label", { htmlFor: r, className: l, children: /* @__PURE__ */ t(
462
506
  "span",
463
507
  {
464
- className: d(
508
+ className: u(
465
509
  "size-3 rounded-full",
466
- r ? n ? "bg-controls-disable" : "bg-layer-4" : "bg-controls-enable-primary"
510
+ s ? n ? "bg-controls-disable" : "bg-layer-4" : "bg-controls-enable-primary"
467
511
  )
468
512
  }
469
513
  ) }),
470
- e && /* @__PURE__ */ l("span", { className: "h-[14px] pl-2 small text-primary", children: e })
514
+ e && /* @__PURE__ */ t("span", { className: "h-[14px] pl-2 small text-primary", children: e })
471
515
  ] });
472
516
  };
473
517
  export {
474
- ye as DialButton,
518
+ x as AlertVariant,
519
+ Ae as DialAlert,
520
+ fe as DialButton,
475
521
  S as DialErrorText,
476
- A as DialFieldLabel,
477
- y as DialIcon,
522
+ z as DialFieldLabel,
523
+ C as DialIcon,
478
524
  F as DialInput,
479
- De as DialNumberInputField,
480
- ke as DialSwitch,
481
- Fe as DialTextAreaField,
482
- Te as DialTextInputField,
483
- fe as DialTextarea,
484
- C as DialTooltip
525
+ We as DialNumberInputField,
526
+ He as DialSwitch,
527
+ Le as DialTextAreaField,
528
+ je as DialTextInputField,
529
+ De as DialTextarea,
530
+ D as DialTooltip
485
531
  };
package/dist/index.css CHANGED
@@ -1,2 +1,2 @@
1
- .dial-h1{font-weight:600}.dial-h1,.dial-h2{font-size:20px;line-height:24px}.dial-h2{font-weight:400}.dial-h3{font-weight:600;line-height:18px}.dial-body,.dial-h3{font-size:16px}.dial-body{font-weight:400;line-height:28px}.dial-small{font-weight:400;font-size:14px;line-height:16px}.dial-small-semi{font-weight:400;font-size:14px;line-height:16px}.dial-small-medium{font-weight:400;font-size:14px;line-height:16px}.dial-small-150{font-weight:400;font-size:14px;line-height:21px}.dial-tiny{line-height:14px}.dial-tiny,.dial-tiny-150{font-weight:400;font-size:12px}.dial-tiny-150{line-height:18px}.dial-caption{font-weight:400;font-size:10px;line-height:12px}h1{font-weight:600}h1,h2{font-size:20px;line-height:24px}h2{font-weight:400}h3{font-weight:600;font-size:16px;line-height:18px}.dial-base-button{display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px}.dial-base-button-disable{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}.dial-primary-button{background-color:var(--controls-bg-accent,#5c8dea);color:var(--controls-primary,#fcfcfc);display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px;&:focus,&:hover{background-color:var(--controls-bg-accent-hover,#4878d2)}&:focus{border-color:var(--stroke-hover,#f3f4f6)}&:disabled{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}}.dial-secondary-button{background-color:transparent;color:var(--text-primary,#f3f4f6);display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px;border-color:var(--stroke-primary,#333942);&:focus,&:hover{background-color:var(--bg-layer-4,#333942)}&:focus{border-color:var(--stroke-hover,#f3f4f6)}&:disabled{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}}.dial-tertiary-button{background-color:transparent;color:var(--text-accent-primary,#5c8dea);display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px;&:focus,&:hover{background-color:var(--controls-bg-accent-alpha,#5c8dea2b)}&:active,&:focus{border-color:var(--stroke-accent-primary,#5c8dea)}&:disabled{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}}.dial-input{border-radius:3px;border-width:1px;border-style:solid;border-color:var(--stroke-primary,#333942);&:hover{border-color:var(--stroke-hover,#f3f4f6)}&:focus,&:focus-within{border-color:var(--stroke-accent-primary,#5c8dea)}}.dial-input,.dial-input-no-border{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:transparent;font-weight:400;font-size:14px;line-height:16px;width:100%;padding:.5rem .75rem;outline-width:0;&:not(:-moz-placeholder){color:var(--text-primary,#f3f4f6)}&:not(:placeholder-shown){color:var(--text-primary,#f3f4f6)}&:disabled{background-color:var(--bg-layer-3,#222932)}&:disabled:not(:-moz-placeholder){color:var(--text-secondary,#7f8792)}&:disabled,&:disabled:not(:placeholder-shown){color:var(--text-secondary,#7f8792)}}.dial-input-disable,.dial-input-readonly{background-color:var(--bg-layer-3,#222932)}.dial-input-disable:not(:-moz-placeholder){color:var(--text-secondary,#7f8792)}.dial-input-disable,.dial-input-disable:not(:placeholder-shown){color:var(--text-secondary,#7f8792)}.dial-input-error{border-color:var(--stroke-error,#f76464)}.dial-input-field{height:38px}input{-moz-appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}&:focus{outline:none}}.dial-textarea{min-height:72px;resize:both;overflow:auto;white-space:normal}@layer ui{*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }
2
- /*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.relative{position:relative}.z-\[55\]{z-index:55}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-3{width:.75rem;height:.75rem}.h-0{height:0}.h-\[14px\]{height:14px}.h-\[18px\]{height:18px}.h-\[300px\]{height:300px}.h-\[38px\]{height:38px}.min-h-4{min-height:1rem}.min-h-\[72px\]{min-height:72px}.w-0{width:0}.w-2{width:.5rem}.w-80{width:20rem}.w-\[36px\]{width:36px}.w-\[500px\]{width:500px}.w-full{width:100%}.min-w-\[800px\]{min-width:800px}.max-w-80{max-width:20rem}.max-w-\[1000px\]{max-width:1000px}.max-w-\[1200px\]{max-width:1200px}.max-w-\[1400px\]{max-width:1400px}.max-w-\[300px\]{max-width:300px}.flex-shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\[minmax\(0\2c 100px\)_1fr\]{grid-template-columns:minmax(0,100px) 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-\[160px\]{-moz-column-gap:160px;column-gap:160px}.gap-y-10{row-gap:2.5rem}.gap-y-\[80px\]{row-gap:80px}.overflow-hidden,.truncate{overflow:hidden}.truncate{white-space:nowrap}.overflow-ellipsis,.truncate{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-0{border-width:0}.border-l-0{border-left-width:0}.border-r-0{border-right-width:0}.border-solid{border-style:solid}.border-primary{border-color:var(--stroke-primary,#333942)}.bg-accent-primary{background-color:var(--bg-accent-primary,#5c8dea)}.bg-blackout{background-color:var(--bg-blackout,#090d13b3)}.bg-controls-accent{background-color:var(--controls-bg-accent,#5c8dea)}.bg-controls-disable{background-color:var(--controls-bg-disable,#7f8792)}.bg-controls-enable-primary{background-color:var(--controls-enable-primary,#fcfcfc)}.bg-layer-3{background-color:var(--bg-layer-3,#222932)}.bg-layer-4{background-color:var(--bg-layer-4,#333942)}.bg-transparent{background-color:transparent}.stroke-primary{stroke:var(--stroke-primary,#333942)}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-\[var\(--bg-layer-0\2c _\#000000\)\]{color:var(--bg-layer-0,#000)}.text-accent-primary{color:var(--text-accent-primary,#5c8dea)}.text-controls-disable{color:var(--controls-disable,#333942)}.text-error{color:var(--text-error,#f76464)}.text-icon-accent-primary{color:var(--icon-accent-primary,#5c8dea)}.text-icon-accent-secondary{color:var(--icon-accent-secondary,#37babc)}.text-primary{color:var(--text-primary,#f3f4f6)}.text-secondary{color:var(--text-secondary,#7f8792)}.shadow{--tw-shadow:0 0 4px 0 var(--bg-blackout,#090d13b3);--tw-shadow-colored:0 0 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.outline-offset-0{outline-offset:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}}.focus-visible\:outline:focus-visible{outline-style:solid}@media (min-width:640px){.sm\:inline{display:inline}}
1
+ .dial-h1{font-weight:600}.dial-h1,.dial-h2{font-size:20px;line-height:24px}.dial-h2{font-weight:400}.dial-h3{font-weight:600;line-height:18px}.dial-body,.dial-h3{font-size:16px}.dial-body{font-weight:400;line-height:28px}.dial-small{font-weight:400}.dial-small,.dial-small-semi{font-size:14px;line-height:16px}.dial-small-semi{font-weight:600}.dial-small-medium{font-weight:400;font-size:14px;line-height:16px}.dial-small-150{font-weight:400;font-size:14px;line-height:21px}.dial-tiny{line-height:14px}.dial-tiny,.dial-tiny-150{font-weight:400;font-size:12px}.dial-tiny-150{line-height:18px}.dial-caption{font-weight:400;font-size:10px;line-height:12px}h1{font-weight:600}h1,h2{font-size:20px;line-height:24px}h2{font-weight:400}h3{font-weight:600;font-size:16px;line-height:18px}.dial-base-button{display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px}.dial-base-button-disable{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}.dial-primary-button{background-color:var(--controls-bg-accent,#5c8dea);color:var(--controls-primary,#fcfcfc);display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px;&:focus,&:hover{background-color:var(--controls-bg-accent-hover,#4878d2)}&:focus{border-color:var(--stroke-hover,#f3f4f6)}&:disabled{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}}.dial-secondary-button{background-color:transparent;color:var(--text-primary,#f3f4f6);display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px;border-color:var(--stroke-primary,#333942);&:focus,&:hover{background-color:var(--bg-layer-4,#333942)}&:focus{border-color:var(--stroke-hover,#f3f4f6)}&:disabled{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}}.dial-tertiary-button{background-color:transparent;color:var(--text-accent-primary,#5c8dea);display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px;&:focus,&:hover{background-color:var(--controls-bg-accent-alpha,#5c8dea2b)}&:active,&:focus{border-color:var(--stroke-accent-primary,#5c8dea)}&:disabled{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}}.dial-input{border-radius:3px;border-width:1px;border-style:solid;border-color:var(--stroke-primary,#333942);&:hover{border-color:var(--stroke-hover,#f3f4f6)}&:focus,&:focus-within{border-color:var(--stroke-accent-primary,#5c8dea)}}.dial-input,.dial-input-no-border{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:transparent;font-weight:400;font-size:14px;line-height:16px;width:100%;padding:.5rem .75rem;outline-width:0;&:not(:-moz-placeholder){color:var(--text-primary,#f3f4f6)}&:not(:placeholder-shown){color:var(--text-primary,#f3f4f6)}&:disabled{background-color:var(--bg-layer-3,#222932)}&:disabled:not(:-moz-placeholder){color:var(--text-secondary,#7f8792)}&:disabled,&:disabled:not(:placeholder-shown){color:var(--text-secondary,#7f8792)}}.dial-input-disable,.dial-input-readonly{background-color:var(--bg-layer-3,#222932)}.dial-input-disable:not(:-moz-placeholder){color:var(--text-secondary,#7f8792)}.dial-input-disable,.dial-input-disable:not(:placeholder-shown){color:var(--text-secondary,#7f8792)}.dial-input-error{border-color:var(--stroke-error,#f76464)}.dial-input-field{height:38px}input{-moz-appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}&:focus{outline:none}}.dial-textarea{min-height:72px;resize:both;overflow:auto;white-space:normal}@layer ui{*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }
2
+ /*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.relative{position:relative}.z-\[55\]{z-index:55}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-3{width:.75rem;height:.75rem}.h-0{height:0}.h-\[14px\]{height:14px}.h-\[18px\]{height:18px}.h-\[300px\]{height:300px}.h-\[38px\]{height:38px}.min-h-4{min-height:1rem}.min-h-\[72px\]{min-height:72px}.w-0{width:0}.w-2{width:.5rem}.w-80{width:20rem}.w-\[36px\]{width:36px}.w-\[500px\]{width:500px}.w-auto{width:auto}.w-full{width:100%}.min-w-\[800px\]{min-width:800px}.max-w-80{max-width:20rem}.max-w-\[1000px\]{max-width:1000px}.max-w-\[1200px\]{max-width:1200px}.max-w-\[1400px\]{max-width:1400px}.max-w-\[300px\]{max-width:300px}.max-w-\[600px\]{max-width:600px}.flex-shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\[minmax\(0\2c 100px\)_1fr\]{grid-template-columns:minmax(0,100px) 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-\[160px\]{-moz-column-gap:160px;column-gap:160px}.gap-y-10{row-gap:2.5rem}.gap-y-\[80px\]{row-gap:80px}.overflow-hidden,.truncate{overflow:hidden}.truncate{white-space:nowrap}.overflow-ellipsis,.truncate{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-0{border-width:0}.border-l-0{border-left-width:0}.border-r-0{border-right-width:0}.border-solid{border-style:solid}.border-error{border-color:var(--stroke-error,#f76464)}.border-primary{border-color:var(--stroke-primary,#333942)}.bg-accent-primary{background-color:var(--bg-accent-primary,#5c8dea)}.bg-blackout{background-color:var(--bg-blackout,#090d13b3)}.bg-controls-accent{background-color:var(--controls-bg-accent,#5c8dea)}.bg-controls-disable{background-color:var(--controls-bg-disable,#7f8792)}.bg-controls-enable-primary{background-color:var(--controls-enable-primary,#fcfcfc)}.bg-error{background-color:var(--bg-error,#402027)}.bg-info{background-color:var(--bg-info,#1c2c47)}.bg-layer-3{background-color:var(--bg-layer-3,#222932)}.bg-layer-4{background-color:var(--bg-layer-4,#333942)}.bg-success{background-color:var(--bg-success,#1d3841)}.bg-transparent{background-color:transparent}.bg-warning{background-color:var(--bg-warning,#3f3d25)}.stroke-primary{stroke:var(--stroke-primary,#333942)}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-\[var\(--bg-layer-0\2c _\#000000\)\]{color:var(--bg-layer-0,#000)}.text-accent-primary{color:var(--text-accent-primary,#5c8dea)}.text-controls-disable{color:var(--controls-disable,#333942)}.text-error{color:var(--text-error,#f76464)}.text-icon-accent-primary{color:var(--icon-accent-primary,#5c8dea)}.text-icon-accent-secondary{color:var(--icon-accent-secondary,#37babc)}.text-info{color:var(--text-info,#5c8dea)}.text-primary{color:var(--text-primary,#f3f4f6)}.text-secondary{color:var(--text-secondary,#7f8792)}.text-success{color:var(--text-success,#37babc)}.text-warning{color:var(--text-warning,#f4ce46)}.shadow{--tw-shadow:0 0 4px 0 var(--bg-blackout,#090d13b3);--tw-shadow-colored:0 0 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.outline-offset-0{outline-offset:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}}.hover\:text-primary:hover{color:var(--text-primary,#f3f4f6)}.focus-visible\:outline:focus-visible{outline-style:solid}@media (min-width:640px){.sm\:inline{display:inline}}
@@ -0,0 +1,42 @@
1
+ import { FC, ReactNode, MouseEvent } from 'react';
2
+ import { AlertVariant } from '../../types/alert';
3
+ export interface DialAlertProps {
4
+ variant?: AlertVariant;
5
+ message: string | ReactNode;
6
+ cssClass?: string;
7
+ closable?: boolean;
8
+ onClose?: (e: MouseEvent<HTMLButtonElement>) => void;
9
+ }
10
+ /**
11
+ * A contextual feedback component for displaying important messages.
12
+ *
13
+ * Renders a colored container with an icon, message text, and an optional
14
+ * close button.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <DialAlert
19
+ * variant="info"
20
+ * message="This is an info alert."
21
+ * />
22
+ *
23
+ * <DialAlert
24
+ * variant="success"
25
+ * message="Changes saved successfully."
26
+ * onClose={(e) => console.log('closed', e)}
27
+ * />
28
+ *
29
+ * <DialAlert
30
+ * variant="error"
31
+ * closable={false}
32
+ * message="Something went wrong."
33
+ * />
34
+ * ```
35
+ *
36
+ * @param [variant=AlertVariant.Info] - Defines the visual style and icon of the alert
37
+ * @param message - Message text to display inside the alert
38
+ * @param [cssClass] - Additional CSS classes applied to the alert container
39
+ * @param [closable=true] - Whether the alert has a close button
40
+ * @param [onClose] - Callback fired when the close button is clicked
41
+ */
42
+ export declare const DialAlert: FC<DialAlertProps>;
@@ -0,0 +1,5 @@
1
+ import { AlertVariant } from '../../types/alert';
2
+ import { ReactNode } from 'react';
3
+ export declare const variantIcons: Record<AlertVariant, ReactNode>;
4
+ export declare const alertVariantClassMap: Record<AlertVariant, string>;
5
+ export declare const alertBaseClasses = "inline-flex items-center justify-between gap-2 px-3 py-2 border border-solid shadow text-sm w-auto rounded";
@@ -28,10 +28,10 @@ export declare const useTooltipContext: () => {
28
28
  floating: HTMLElement | null;
29
29
  } & import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
30
30
  context: {
31
- placement: Placement;
32
- strategy: import('@floating-ui/utils').Strategy;
33
31
  x: number;
34
32
  y: number;
33
+ placement: Placement;
34
+ strategy: import('@floating-ui/utils').Strategy;
35
35
  middlewareData: import('@floating-ui/core').MiddlewareData;
36
36
  isPositioned: boolean;
37
37
  update: () => void;
@@ -75,10 +75,10 @@ export declare const useTooltip: ({ initialOpen, placement, isTriggerClickable,
75
75
  floating: HTMLElement | null;
76
76
  } & import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
77
77
  context: {
78
- placement: Placement;
79
- strategy: import('@floating-ui/utils').Strategy;
80
78
  x: number;
81
79
  y: number;
80
+ placement: Placement;
81
+ strategy: import('@floating-ui/utils').Strategy;
82
82
  middlewareData: import('@floating-ui/core').MiddlewareData;
83
83
  isPositioned: boolean;
84
84
  update: () => void;
@@ -2,6 +2,7 @@ export { DialButton } from './components/Button/Button';
2
2
  export { DialErrorText } from './components/ErrorText/ErrorText';
3
3
  export { DialFieldLabel } from './components/Field/Field';
4
4
  export { DialIcon } from './components/Icon/Icon';
5
+ export { DialAlert } from './components/Alert/Alert';
5
6
  export { DialTextarea } from './components/Textarea/Textarea';
6
7
  export { DialTextAreaField } from './components/TextAreaField/TextAreaField';
7
8
  export { DialTooltip } from './components/Tooltip/Tooltip';
@@ -9,3 +10,4 @@ export { DialSwitch } from './components/Switch/Switch';
9
10
  export { DialInput } from './components/Input/Input';
10
11
  export { DialNumberInputField } from './components/InputField/InputField';
11
12
  export { DialTextInputField } from './components/InputField/InputField';
13
+ export { AlertVariant } from './types/alert';
@@ -0,0 +1,6 @@
1
+ export declare enum AlertVariant {
2
+ Info = "info",
3
+ Success = "success",
4
+ Warning = "warning",
5
+ Error = "error"
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.2.0-rc.0",
3
+ "version": "0.2.0-rc.2",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",