@epam/ai-dial-ui-kit 0.2.0-rc.1 → 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 +12 -12
- package/dist/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +283 -237
- package/dist/index.css +1 -1
- package/dist/src/components/Alert/Alert.d.ts +42 -0
- package/dist/src/components/Alert/constants.d.ts +5 -0
- package/dist/src/components/Tooltip/TooltipContext.d.ts +4 -4
- package/dist/src/index.d.ts +2 -0
- package/dist/src/types/alert.d.ts +6 -0
- package/package.json +1 -1
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
|
-
|
|
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
|
[](https://badge.fury.io/js/@epam%2Fai-dial-ui-kit)
|
|
11
12
|
[](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
|
-
- [✨
|
|
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
|
-
## ✨
|
|
40
|
+
## ✨ Highlights
|
|
41
41
|
|
|
42
|
-
- 🎨 **Unified User Experience**:
|
|
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**:
|
|
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. **
|
|
95
|
+
1. **Clone the repo**
|
|
96
96
|
```bash
|
|
97
|
-
git clone https://github.com/
|
|
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
|
|
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).
|
package/dist/dial-ui-kit.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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;
|
package/dist/dial-ui-kit.es.js
CHANGED
|
@@ -1,138 +1,182 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
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:
|
|
8
|
+
cssClass: r,
|
|
8
9
|
ref: n,
|
|
9
|
-
onClick:
|
|
10
|
-
disable:
|
|
11
|
-
iconAfter:
|
|
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
|
|
17
|
+
const m = u(
|
|
17
18
|
"dial-small-semi",
|
|
18
|
-
|
|
19
|
+
l ? "mr-2" : "",
|
|
19
20
|
a ? "ml-2" : "",
|
|
20
21
|
c ? "hidden sm:inline" : "inline"
|
|
21
|
-
),
|
|
22
|
-
|
|
22
|
+
), d = u(
|
|
23
|
+
r,
|
|
23
24
|
"focus-visible:outline outline-offset-0"
|
|
24
25
|
);
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ p(
|
|
26
27
|
"button",
|
|
27
28
|
{
|
|
28
29
|
ref: n,
|
|
29
30
|
type: "button",
|
|
30
|
-
className:
|
|
31
|
-
onClick: (f) =>
|
|
32
|
-
disabled:
|
|
31
|
+
className: d,
|
|
32
|
+
onClick: (f) => s?.(f),
|
|
33
|
+
disabled: o,
|
|
33
34
|
"aria-label": e || i,
|
|
34
35
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
e && /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
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__ */
|
|
42
|
+
}, S = ({ errorText: e }) => e && /* @__PURE__ */ t("span", { className: "text-error dial-tiny mt-1", children: e }), z = ({
|
|
42
43
|
fieldTitle: e,
|
|
43
|
-
htmlFor:
|
|
44
|
+
htmlFor: r,
|
|
44
45
|
optional: n,
|
|
45
|
-
optionalText:
|
|
46
|
-
cssClass:
|
|
47
|
-
}) => e ? /* @__PURE__ */
|
|
46
|
+
optionalText: s,
|
|
47
|
+
cssClass: o
|
|
48
|
+
}) => e ? /* @__PURE__ */ p(
|
|
48
49
|
"label",
|
|
49
50
|
{
|
|
50
|
-
className:
|
|
51
|
+
className: u(
|
|
51
52
|
"dial-tiny text-secondary",
|
|
52
|
-
|
|
53
|
-
!
|
|
53
|
+
o,
|
|
54
|
+
!o?.includes("mb") && "mb-2"
|
|
54
55
|
),
|
|
55
|
-
htmlFor:
|
|
56
|
+
htmlFor: r,
|
|
56
57
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
n && /* @__PURE__ */
|
|
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
|
|
62
|
-
|
|
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
|
-
},
|
|
110
|
+
}, ve = ({
|
|
67
111
|
initialOpen: e = !1,
|
|
68
|
-
placement:
|
|
112
|
+
placement: r = "bottom",
|
|
69
113
|
isTriggerClickable: n = !1,
|
|
70
|
-
open:
|
|
71
|
-
onOpenChange:
|
|
114
|
+
open: s,
|
|
115
|
+
onOpenChange: o
|
|
72
116
|
} = {}) => {
|
|
73
|
-
const [
|
|
74
|
-
placement:
|
|
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:
|
|
77
|
-
whileElementsMounted:
|
|
120
|
+
onOpenChange: m,
|
|
121
|
+
whileElementsMounted: J,
|
|
78
122
|
middleware: [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
crossAxis:
|
|
123
|
+
X(xe + Ne),
|
|
124
|
+
Y({
|
|
125
|
+
crossAxis: r.includes("-"),
|
|
82
126
|
fallbackAxisSideDirection: "start",
|
|
83
127
|
padding: 5
|
|
84
128
|
}),
|
|
85
|
-
|
|
86
|
-
|
|
129
|
+
Z({ padding: 5 }),
|
|
130
|
+
q({
|
|
87
131
|
element: c
|
|
88
132
|
})
|
|
89
133
|
]
|
|
90
|
-
}), f =
|
|
134
|
+
}), f = Q(d.context, {
|
|
91
135
|
move: !1,
|
|
92
|
-
enabled:
|
|
136
|
+
enabled: s == null,
|
|
93
137
|
mouseOnly: n,
|
|
94
138
|
delay: { open: 500, close: 0 }
|
|
95
|
-
}),
|
|
96
|
-
enabled:
|
|
97
|
-
}),
|
|
98
|
-
return
|
|
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:
|
|
145
|
+
setOpen: m,
|
|
102
146
|
arrowRef: c,
|
|
103
|
-
...
|
|
104
|
-
...
|
|
147
|
+
...g,
|
|
148
|
+
...d
|
|
105
149
|
}),
|
|
106
|
-
[i,
|
|
150
|
+
[i, m, g, d]
|
|
107
151
|
);
|
|
108
|
-
},
|
|
152
|
+
}, we = ({
|
|
109
153
|
children: e,
|
|
110
|
-
...
|
|
154
|
+
...r
|
|
111
155
|
}) => {
|
|
112
|
-
const n =
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
},
|
|
115
|
-
const
|
|
116
|
-
return
|
|
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:
|
|
163
|
+
ref: l,
|
|
120
164
|
style: {
|
|
121
|
-
...
|
|
122
|
-
...
|
|
165
|
+
...o.floatingStyles,
|
|
166
|
+
...r
|
|
123
167
|
},
|
|
124
|
-
...
|
|
125
|
-
className:
|
|
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
|
-
|
|
171
|
+
o.getFloatingProps(n).className
|
|
128
172
|
),
|
|
129
173
|
children: [
|
|
130
174
|
n.children,
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
175
|
+
/* @__PURE__ */ t(
|
|
176
|
+
oe,
|
|
133
177
|
{
|
|
134
|
-
ref:
|
|
135
|
-
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
|
-
}),
|
|
145
|
-
const
|
|
146
|
-
return n &&
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
...
|
|
151
|
-
...
|
|
194
|
+
...s,
|
|
195
|
+
...r.props
|
|
152
196
|
})
|
|
153
|
-
) : /* @__PURE__ */
|
|
197
|
+
) : /* @__PURE__ */ t(
|
|
154
198
|
"span",
|
|
155
199
|
{
|
|
156
200
|
ref: i,
|
|
157
|
-
...
|
|
158
|
-
className:
|
|
159
|
-
children:
|
|
201
|
+
...l.getReferenceProps(s),
|
|
202
|
+
className: s.className ?? "dial-tooltip-trigger text-left",
|
|
203
|
+
children: r
|
|
160
204
|
}
|
|
161
205
|
);
|
|
162
|
-
}),
|
|
206
|
+
}), D = ({
|
|
163
207
|
hideTooltip: e,
|
|
164
|
-
tooltip:
|
|
208
|
+
tooltip: r,
|
|
165
209
|
children: n,
|
|
166
|
-
triggerClassName:
|
|
167
|
-
contentClassName:
|
|
168
|
-
...
|
|
169
|
-
}) => e || !
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
|
|
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:
|
|
218
|
+
className: u(
|
|
175
219
|
"text-primary",
|
|
176
|
-
|
|
220
|
+
o,
|
|
177
221
|
"max-w-[300px]",
|
|
178
|
-
(e || !
|
|
222
|
+
(e || !r) && "hidden"
|
|
179
223
|
),
|
|
180
|
-
children:
|
|
224
|
+
children: r
|
|
181
225
|
}
|
|
182
226
|
)
|
|
183
|
-
] }),
|
|
227
|
+
] }), De = ({
|
|
184
228
|
value: e,
|
|
185
|
-
textareaId:
|
|
229
|
+
textareaId: r,
|
|
186
230
|
placeholder: n,
|
|
187
|
-
cssClass:
|
|
188
|
-
disabled:
|
|
189
|
-
invalid:
|
|
231
|
+
cssClass: s = "",
|
|
232
|
+
disabled: o,
|
|
233
|
+
invalid: l,
|
|
190
234
|
readonly: a,
|
|
191
235
|
onChange: c
|
|
192
|
-
}) => /* @__PURE__ */
|
|
236
|
+
}) => /* @__PURE__ */ t(D, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ t(
|
|
193
237
|
"textarea",
|
|
194
238
|
{
|
|
195
|
-
id:
|
|
239
|
+
id: r,
|
|
196
240
|
placeholder: n,
|
|
197
241
|
value: e || "",
|
|
198
|
-
disabled:
|
|
199
|
-
className:
|
|
242
|
+
disabled: o,
|
|
243
|
+
className: u(
|
|
200
244
|
"dial-textarea dial-input",
|
|
201
|
-
|
|
202
|
-
|
|
245
|
+
l ? "dial-input-error" : "",
|
|
246
|
+
o && "dial-input-disable",
|
|
203
247
|
a && "dial-input-readonly",
|
|
204
|
-
|
|
248
|
+
s
|
|
205
249
|
),
|
|
206
250
|
onChange: (i) => !a && c?.(i.currentTarget.value)
|
|
207
251
|
}
|
|
208
|
-
) }),
|
|
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
|
-
],
|
|
221
|
-
if ((
|
|
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 ||
|
|
227
|
-
const
|
|
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 (
|
|
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:
|
|
286
|
+
iconAfterInput: r,
|
|
243
287
|
hideBorder: n,
|
|
244
|
-
value:
|
|
245
|
-
elementId:
|
|
246
|
-
placeholder:
|
|
288
|
+
value: s,
|
|
289
|
+
elementId: o,
|
|
290
|
+
placeholder: l = "",
|
|
247
291
|
cssClass: a = "",
|
|
248
292
|
containerCssClass: c,
|
|
249
293
|
tooltipTriggerClassName: i,
|
|
250
|
-
type:
|
|
251
|
-
disabled:
|
|
294
|
+
type: m = "text",
|
|
295
|
+
disabled: d,
|
|
252
296
|
readonly: f,
|
|
253
|
-
invalid:
|
|
254
|
-
onChange:
|
|
255
|
-
min:
|
|
256
|
-
max:
|
|
257
|
-
prefix:
|
|
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:
|
|
304
|
+
textAfterInput: v
|
|
261
305
|
}) => {
|
|
262
|
-
const
|
|
263
|
-
|
|
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
|
|
266
|
-
if (H &&
|
|
267
|
-
const
|
|
268
|
-
if (isNaN(
|
|
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
|
-
|
|
315
|
+
k?.(w);
|
|
272
316
|
};
|
|
273
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ p(
|
|
274
318
|
"div",
|
|
275
319
|
{
|
|
276
|
-
className:
|
|
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
|
-
|
|
280
|
-
|
|
323
|
+
T && "dial-input-error",
|
|
324
|
+
d && "dial-input-disable",
|
|
281
325
|
f && "dial-input-readonly",
|
|
282
326
|
!N && "pl-1",
|
|
283
|
-
!
|
|
327
|
+
!v && "pr-1",
|
|
284
328
|
c
|
|
285
329
|
),
|
|
286
330
|
children: [
|
|
287
|
-
N && /* @__PURE__ */
|
|
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
|
-
|
|
342
|
+
I && /* @__PURE__ */ p("p", { className: "text-secondary dial-small pl-2", children: [
|
|
299
343
|
" ",
|
|
300
|
-
|
|
344
|
+
I
|
|
301
345
|
] }),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
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:
|
|
350
|
+
type: m,
|
|
307
351
|
autoComplete: "off",
|
|
308
|
-
id:
|
|
309
|
-
placeholder:
|
|
310
|
-
value:
|
|
311
|
-
title:
|
|
312
|
-
disabled:
|
|
313
|
-
className:
|
|
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:
|
|
316
|
-
onWheel:
|
|
317
|
-
min:
|
|
318
|
-
max:
|
|
359
|
+
onKeyDown: M,
|
|
360
|
+
onWheel: L,
|
|
361
|
+
min: h,
|
|
362
|
+
max: g
|
|
319
363
|
}
|
|
320
364
|
) }),
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
R && /* @__PURE__ */
|
|
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
|
-
|
|
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:
|
|
376
|
+
value: v,
|
|
333
377
|
disabled: !0,
|
|
334
|
-
elementId:
|
|
378
|
+
elementId: v + "textAfter"
|
|
335
379
|
}
|
|
336
380
|
) })
|
|
337
381
|
]
|
|
338
382
|
}
|
|
339
383
|
);
|
|
340
|
-
},
|
|
384
|
+
}, Fe = /^0+\.(\d+)?$/, Ie = /^0+/, j = ({
|
|
341
385
|
fieldTitle: e,
|
|
342
|
-
errorText:
|
|
386
|
+
errorText: r,
|
|
343
387
|
optional: n,
|
|
344
|
-
elementCssClass:
|
|
345
|
-
elementContainerCssClass:
|
|
346
|
-
elementId:
|
|
388
|
+
elementCssClass: s,
|
|
389
|
+
elementContainerCssClass: o,
|
|
390
|
+
elementId: l,
|
|
347
391
|
containerCssClass: a,
|
|
348
392
|
readonly: c,
|
|
349
393
|
defaultEmptyText: i,
|
|
350
|
-
min:
|
|
351
|
-
max:
|
|
394
|
+
min: m,
|
|
395
|
+
max: d,
|
|
352
396
|
...f
|
|
353
|
-
}) => /* @__PURE__ */
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
|
|
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:
|
|
403
|
+
htmlFor: l
|
|
360
404
|
}
|
|
361
405
|
),
|
|
362
|
-
c ? /* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
406
|
+
c ? /* @__PURE__ */ t("span", { children: f.value || (i ?? "None") }) : /* @__PURE__ */ p(_, { children: [
|
|
407
|
+
/* @__PURE__ */ t(
|
|
364
408
|
F,
|
|
365
409
|
{
|
|
366
|
-
elementId:
|
|
367
|
-
cssClass:
|
|
368
|
-
containerCssClass:
|
|
369
|
-
invalid:
|
|
370
|
-
min:
|
|
371
|
-
max:
|
|
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__ */
|
|
419
|
+
/* @__PURE__ */ t(S, { errorText: r })
|
|
376
420
|
] })
|
|
377
|
-
] }),
|
|
421
|
+
] }), We = ({
|
|
378
422
|
onChange: e,
|
|
379
|
-
value:
|
|
423
|
+
value: r,
|
|
380
424
|
min: n,
|
|
381
|
-
max:
|
|
382
|
-
...
|
|
425
|
+
max: s,
|
|
426
|
+
...o
|
|
383
427
|
}) => {
|
|
384
|
-
const
|
|
385
|
-
return /* @__PURE__ */
|
|
386
|
-
|
|
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?.(
|
|
390
|
-
value:
|
|
433
|
+
onChange: (a) => e?.(l(a)),
|
|
434
|
+
value: r,
|
|
391
435
|
min: n,
|
|
392
|
-
max:
|
|
393
|
-
...
|
|
436
|
+
max: s,
|
|
437
|
+
...o
|
|
394
438
|
}
|
|
395
439
|
);
|
|
396
|
-
},
|
|
440
|
+
}, je = ({
|
|
397
441
|
onChange: e,
|
|
398
|
-
...
|
|
399
|
-
}) => /* @__PURE__ */
|
|
400
|
-
|
|
442
|
+
...r
|
|
443
|
+
}) => /* @__PURE__ */ t(
|
|
444
|
+
j,
|
|
401
445
|
{
|
|
402
446
|
type: "text",
|
|
403
447
|
onChange: (n) => e?.(n),
|
|
404
|
-
...
|
|
448
|
+
...r
|
|
405
449
|
}
|
|
406
|
-
),
|
|
450
|
+
), Le = ({
|
|
407
451
|
fieldTitle: e,
|
|
408
|
-
optional:
|
|
452
|
+
optional: r,
|
|
409
453
|
elementId: n,
|
|
410
|
-
elementCssClass:
|
|
411
|
-
errorText:
|
|
412
|
-
...
|
|
413
|
-
}) => /* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
|
|
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:
|
|
462
|
+
optional: r,
|
|
419
463
|
htmlFor: n
|
|
420
464
|
}
|
|
421
465
|
),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
|
|
466
|
+
/* @__PURE__ */ t(
|
|
467
|
+
De,
|
|
424
468
|
{
|
|
425
469
|
textareaId: n,
|
|
426
|
-
cssClass:
|
|
427
|
-
...
|
|
470
|
+
cssClass: s,
|
|
471
|
+
...l
|
|
428
472
|
}
|
|
429
473
|
),
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
] }),
|
|
474
|
+
/* @__PURE__ */ t(S, { errorText: o })
|
|
475
|
+
] }), He = ({
|
|
432
476
|
title: e,
|
|
433
|
-
switchId:
|
|
477
|
+
switchId: r,
|
|
434
478
|
isOn: n = !1,
|
|
435
|
-
disabled:
|
|
436
|
-
onChange:
|
|
479
|
+
disabled: s,
|
|
480
|
+
onChange: o
|
|
437
481
|
}) => {
|
|
438
|
-
const
|
|
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
|
-
|
|
442
|
-
|
|
443
|
-
), a =
|
|
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(),
|
|
489
|
+
c.stopPropagation(), o?.(!n);
|
|
446
490
|
},
|
|
447
|
-
[
|
|
491
|
+
[o, n]
|
|
448
492
|
);
|
|
449
|
-
return /* @__PURE__ */
|
|
450
|
-
/* @__PURE__ */
|
|
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:
|
|
456
|
-
disabled:
|
|
499
|
+
id: r,
|
|
500
|
+
disabled: s,
|
|
457
501
|
className: "invisible w-0 h-0",
|
|
458
502
|
checked: n
|
|
459
503
|
}
|
|
460
504
|
),
|
|
461
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ t("label", { htmlFor: r, className: l, children: /* @__PURE__ */ t(
|
|
462
506
|
"span",
|
|
463
507
|
{
|
|
464
|
-
className:
|
|
508
|
+
className: u(
|
|
465
509
|
"size-3 rounded-full",
|
|
466
|
-
|
|
510
|
+
s ? n ? "bg-controls-disable" : "bg-layer-4" : "bg-controls-enable-primary"
|
|
467
511
|
)
|
|
468
512
|
}
|
|
469
513
|
) }),
|
|
470
|
-
e && /* @__PURE__ */
|
|
514
|
+
e && /* @__PURE__ */ t("span", { className: "h-[14px] pl-2 small text-primary", children: e })
|
|
471
515
|
] });
|
|
472
516
|
};
|
|
473
517
|
export {
|
|
474
|
-
|
|
518
|
+
x as AlertVariant,
|
|
519
|
+
Ae as DialAlert,
|
|
520
|
+
fe as DialButton,
|
|
475
521
|
S as DialErrorText,
|
|
476
|
-
|
|
477
|
-
|
|
522
|
+
z as DialFieldLabel,
|
|
523
|
+
C as DialIcon,
|
|
478
524
|
F as DialInput,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
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
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}.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}}
|
|
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;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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';
|