@adam-milo/ui 1.0.59 → 1.0.61
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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +1 -1
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +1 -1
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +1 -1
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +3 -1
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +1 -1
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +1 -1
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +1 -1
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +1 -2
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +1 -1
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +1 -1
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +2 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +1 -1
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +1 -1
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +1 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +1 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +1 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +10 -10
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +9 -2
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +2 -2
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +2 -2
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +2 -2
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +2 -2
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +2 -2
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -2
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +2 -2
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +2 -2
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +2 -4
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +4 -4
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +4 -8
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +8 -2
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +2 -4
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +4 -8
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +8 -4
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +4 -2
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +2 -5
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +5 -2
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +2 -10
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +10 -2
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +2 -3
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +2 -2
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +2 -2
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +2 -6
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +6 -3
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +3 -2
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +2 -2
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +2 -2
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +2 -2
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +2 -10
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +10 -11
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +11 -1
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +1 -1
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +1 -1
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +1 -1
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +1 -1
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +1 -1
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +1 -15
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +1 -1
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +15 -1
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +1 -1
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +1 -1
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +1 -1
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +1 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +1 -1
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +1 -1
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +1 -1
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +1 -1
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +1 -1
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +5 -1
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +1 -1
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +1 -1
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +1 -1
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +1 -1
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +1 -1
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +1 -1
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +1 -1
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +1 -1
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +1 -1
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +1 -1
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +1 -1
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +1 -1
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +1 -1
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +1 -1
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +1 -1
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +1 -1
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +1 -1
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +1 -1
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +1 -1
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +1 -1
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +1 -5
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +1 -1
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +1 -1
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +1 -1
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +1 -1
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +1 -2
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +1 -1
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +1 -1
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +2 -4
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +1 -1
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +1 -1
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +4 -1
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +1 -3
- package/dist/src/components/core/icon-button/IconButton.component.d.ts.map +1 -1
- package/dist/src/components/core/icon-button/IconButton.styles.d.ts +1 -0
- package/dist/src/components/core/icon-button/IconButton.styles.d.ts.map +1 -1
- package/dist/src/components/core/icon-button/IconButton.types.d.ts +3 -1
- package/dist/src/components/core/icon-button/IconButton.types.d.ts.map +1 -1
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/phone-input/PhoneInput.styles.d.ts +1 -1
- package/dist/src/components/forms/phone-input/PhoneInput.styles.d.ts.map +1 -1
- package/dist/src/components/forms/textarea/Textarea.component.d.ts +5 -0
- package/dist/src/components/forms/textarea/Textarea.component.d.ts.map +1 -0
- package/dist/src/components/forms/textarea/Textarea.styles.d.ts +13 -0
- package/dist/src/components/forms/textarea/Textarea.styles.d.ts.map +1 -0
- package/dist/src/components/forms/textarea/Textarea.types.d.ts +34 -0
- package/dist/src/components/forms/textarea/Textarea.types.d.ts.map +1 -0
- package/dist/src/components/forms/toggle/Toggle.styles.d.ts +3 -3
- package/dist/src/components/forms/toggle/Toggle.styles.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/utils/validation.d.ts +142 -0
- package/dist/src/utils/validation.d.ts.map +1 -0
- package/dist/src/utils/validation.spec.d.ts +2 -0
- package/dist/src/utils/validation.spec.d.ts.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index95.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react/jsx-runtime");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const o in e)if("default"!==o){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}return t.default=e,Object.freeze(t)}const r=o(e);function n(...e){const t=e[0];if(1===e.length)return t;const o=()=>{const o=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=o.reduce((t,{useScope:o,scopeName:r})=>({...t,...o(e)[`__scope${r}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return o.scopeName=t.scopeName,o}exports.createContextScope=function(e,o=[]){let c=[];const s=()=>{const t=c.map(e=>r.createContext(e));return function(o){const n=o?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...o,[e]:n}}),[o,n])}};return s.scopeName=e,[function(o,n){const s=r.createContext(n),u=c.length;c=[...c,n];const i=o=>{const{scope:n,children:c,...i}=o,a=n?.[e]?.[u]||s,p=r.useMemo(()=>i,Object.values(i));return t.jsx(a.Provider,{value:p,children:c})};return i.displayName=o+"Provider",[i,function(t,c){const i=c?.[e]?.[u]||s,a=r.useContext(i);if(a)return a;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${o}\``)}]},n(s,...o)]};
|
package/dist/index95.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import{
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
return u("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[n]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:/* @__PURE__ */u(p,{...o,ref:r,style:{...o.style,display:"block"}})})});function Y(e){return null!==e}W.displayName=H;var E=e=>({name:"transformOrigin",options:e,fn(r){const{placement:t,rects:o,middlewareData:i}=r,n=0!==i.arrow?.centerOffset,a=n?0:e.arrowWidth,s=n?0:e.arrowHeight,[d,p]=N(t),l={start:"0%",center:"50%",end:"100%"}[p],c=(i.arrow?.x??0)+a/2,f=(i.arrow?.y??0)+s/2;let m="",h="";return"bottom"===d?(m=n?l:`${c}px`,h=-s+"px"):"top"===d?(m=n?l:`${c}px`,h=`${o.floating.height+s}px`):"right"===d?(m=-s+"px",h=n?l:`${f}px`):"left"===d&&(m=`${o.floating.width+s}px`,h=n?l:`${f}px`),{data:{x:m,y:h}}}});function N(e){const[r,t="center"]=e.split("-");return[r,t]}var X=A,z=S,D=C,k=W;export{z as Anchor,k as Arrow,D as Content,A as Popper,S as PopperAnchor,W as PopperArrow,C as PopperContent,X as Root,v as createPopperScope};
|
|
1
|
+
import*as e from"react";import{jsx as t}from"react/jsx-runtime";function o(o,r=[]){let c=[];const s=()=>{const t=c.map(t=>e.createContext(t));return function(n){const r=n?.[o]||t;return e.useMemo(()=>({[`__scope${o}`]:{...n,[o]:r}}),[n,r])}};return s.scopeName=o,[function(n,r){const s=e.createContext(r),u=c.length;c=[...c,r];const i=n=>{const{scope:r,children:c,...i}=n,m=r?.[o]?.[u]||s,p=e.useMemo(()=>i,Object.values(i));/* @__PURE__ */
|
|
2
|
+
return t(m.Provider,{value:p,children:c})};return i.displayName=n+"Provider",[i,function(t,c){const i=c?.[o]?.[u]||s,m=e.useContext(i);if(m)return m;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},n(s,...r)]}function n(...t){const o=t[0];if(1===t.length)return o;const n=()=>{const n=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const r=n.reduce((e,{useScope:o,scopeName:n})=>({...e,...o(t)[`__scope${n}`]}),{});return e.useMemo(()=>({[`__scope${o.scopeName}`]:r}),[r])}};return n.scopeName=o.scopeName,n}export{o as createContextScope};
|
package/dist/index96.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index93.cjs"),n=require("./index101.cjs"),r=require("./index94.cjs"),s=require("./index105.cjs"),i=require("./index106.cjs"),o=require("react/jsx-runtime");function u(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const a=u(e);var c,d="dismissableLayer.update",l="dismissableLayer.pointerDownOutside",f="dismissableLayer.focusOutside",v=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),m=a.forwardRef((e,u)=>{const{disableOutsidePointerEvents:m=!1,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:w,onInteractOutside:D,onDismiss:h,...C}=e,O=a.useContext(v),[P,g]=a.useState(null),L=P?.ownerDocument??globalThis?.document,[,x]=a.useState({}),j=r.useComposedRefs(u,e=>g(e)),R=Array.from(O.layers),[S]=[...O.layersWithOutsidePointerEventsDisabled].slice(-1),T=R.indexOf(S),q=P?R.indexOf(P):-1,W=O.layersWithOutsidePointerEventsDisabled.size>0,k=q>=T,B=function(e,t=globalThis?.document){const n=s.useCallbackRef(e),r=a.useRef(!1),i=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){b(l,n,s,{discrete:!0})};const s={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=r,t.addEventListener("click",i.current,{once:!0})):r()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...O.branches].some(e=>e.contains(t));k&&!n&&(y?.(e),D?.(e),e.defaultPrevented||h?.())},L),z=function(e,t=globalThis?.document){const n=s.useCallbackRef(e),r=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!r.current){b(f,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...O.branches].some(e=>e.contains(t))||(w?.(e),D?.(e),e.defaultPrevented||h?.())},L);return i.useEscapeKeydown(e=>{q===O.layers.size-1&&(p?.(e),!e.defaultPrevented&&h&&(e.preventDefault(),h()))},L),a.useEffect(()=>{if(P)return m&&(0===O.layersWithOutsidePointerEventsDisabled.size&&(c=L.body.style.pointerEvents,L.body.style.pointerEvents="none"),O.layersWithOutsidePointerEventsDisabled.add(P)),O.layers.add(P),E(),()=>{m&&1===O.layersWithOutsidePointerEventsDisabled.size&&(L.body.style.pointerEvents=c)}},[P,L,m,O]),a.useEffect(()=>()=>{P&&(O.layers.delete(P),O.layersWithOutsidePointerEventsDisabled.delete(P),E())},[P,O]),a.useEffect(()=>{const e=()=>x({});return document.addEventListener(d,e),()=>document.removeEventListener(d,e)},[]),o.jsx(n.Primitive.div,{...C,ref:j,style:{pointerEvents:W?k?"auto":"none":void 0,...e.style},onFocusCapture:t.composeEventHandlers(e.onFocusCapture,z.onFocusCapture),onBlurCapture:t.composeEventHandlers(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:t.composeEventHandlers(e.onPointerDownCapture,B.onPointerDownCapture)})});m.displayName="DismissableLayer";var p=a.forwardRef((e,t)=>{const s=a.useContext(v),i=a.useRef(null),u=r.useComposedRefs(t,i);return a.useEffect(()=>{const e=i.current;if(e)return s.branches.add(e),()=>{s.branches.delete(e)}},[s.branches]),o.jsx(n.Primitive.div,{...e,ref:u})});function E(){const e=new CustomEvent(d);document.dispatchEvent(e)}function b(e,t,r,{discrete:s}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),s?n.dispatchDiscreteCustomEvent(i,o):i.dispatchEvent(o)}p.displayName="DismissableLayerBranch",exports.DismissableLayer=m,exports.DismissableLayerBranch=p;
|
package/dist/index96.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as e from"react";import{composeEventHandlers as t}from"./index93.js";import{Primitive as n,dispatchDiscreteCustomEvent as r}from"./index101.js";import{useComposedRefs as s}from"./index94.js";import{useCallbackRef as o}from"./index105.js";import{useEscapeKeydown as i}from"./index106.js";import{jsx as a}from"react/jsx-runtime";var u,c="dismissableLayer.update",d="dismissableLayer.pointerDownOutside",l="dismissableLayer.focusOutside",f=e.createContext({layers:/* @__PURE__ */new Set,layersWithOutsidePointerEventsDisabled:/* @__PURE__ */new Set,branches:/* @__PURE__ */new Set}),v=e.forwardRef((r,v)=>{const{disableOutsidePointerEvents:m=!1,onEscapeKeyDown:y,onPointerDownOutside:b,onFocusOutside:w,onInteractOutside:h,onDismiss:D,...C}=r,L=e.useContext(f),[P,O]=e.useState(null),x=P?.ownerDocument??globalThis?.document,[,g]=e.useState({}),W=s(v,e=>O(e)),j=Array.from(L.layers),[R]=[...L.layersWithOutsidePointerEventsDisabled].slice(-1),T=j.indexOf(R),B=P?j.indexOf(P):-1,F=L.layersWithOutsidePointerEventsDisabled.size>0,S=B>=T,k=function(t,n=globalThis?.document){const r=o(t),s=e.useRef(!1),i=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!s.current){let t=function(){p(d,r,s,{discrete:!0})};const s={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=t,n.addEventListener("click",i.current,{once:!0})):t()}else n.removeEventListener("click",i.current);s.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}},[n,r]),{onPointerDownCapture:()=>s.current=!0}}(e=>{const t=e.target,n=[...L.branches].some(e=>e.contains(t));S&&!n&&(b?.(e),h?.(e),e.defaultPrevented||D?.())},x),z=function(t,n=globalThis?.document){const r=o(t),s=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!s.current){p(l,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}(e=>{const t=e.target;[...L.branches].some(e=>e.contains(t))||(w?.(e),h?.(e),e.defaultPrevented||D?.())},x);return i(e=>{B===L.layers.size-1&&(y?.(e),!e.defaultPrevented&&D&&(e.preventDefault(),D()))},x),e.useEffect(()=>{if(P)return m&&(0===L.layersWithOutsidePointerEventsDisabled.size&&(u=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),L.layersWithOutsidePointerEventsDisabled.add(P)),L.layers.add(P),E(),()=>{m&&1===L.layersWithOutsidePointerEventsDisabled.size&&(x.body.style.pointerEvents=u)}},[P,x,m,L]),e.useEffect(()=>()=>{P&&(L.layers.delete(P),L.layersWithOutsidePointerEventsDisabled.delete(P),E())},[P,L]),e.useEffect(()=>{const e=()=>g({});return document.addEventListener(c,e),()=>document.removeEventListener(c,e)},[]),/* @__PURE__ */a(n.div,{...C,ref:W,style:{pointerEvents:F?S?"auto":"none":void 0,...r.style},onFocusCapture:t(r.onFocusCapture,z.onFocusCapture),onBlurCapture:t(r.onBlurCapture,z.onBlurCapture),onPointerDownCapture:t(r.onPointerDownCapture,k.onPointerDownCapture)})});v.displayName="DismissableLayer";var m=e.forwardRef((t,r)=>{const o=e.useContext(f),i=e.useRef(null),u=s(r,i);return e.useEffect(()=>{const e=i.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),/* @__PURE__ */a(n.div,{...t,ref:u})});function E(){const e=new CustomEvent(c);document.dispatchEvent(e)}function p(e,t,n,{discrete:s}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),s?r(o,i):o.dispatchEvent(i)}m.displayName="DismissableLayerBranch";export{v as DismissableLayer,m as DismissableLayerBranch};
|
package/dist/index97.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index107.cjs");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const n=r(e);var o=n[" useId ".trim().toString()]||(()=>{}),u=0;exports.useId=function(e){const[r,c]=n.useState(o());return t.useLayoutEffect(()=>{c(e=>e??String(u++))},[e]),r?`radix-${r}`:""};
|
package/dist/index97.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as t from"react";import{useLayoutEffect as r}from"./index107.js";var e=t[" useId ".trim().toString()]||(()=>{}),o=0;function i(i){const[a,n]=t.useState(e());return r(()=>{n(t=>t??String(o++))},[i]),a?`radix-${a}`:""}export{i as useId};
|
package/dist/index98.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index108.cjs"),t=require("./index109.cjs"),o=require("./index94.cjs"),i=require("./index95.cjs"),n=require("./index101.cjs"),a=require("./index105.cjs"),s=require("./index107.cjs"),p=require("./index110.cjs"),l=require("react/jsx-runtime"),d=require("./index111.cjs");function c(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const f=c(e);var u="Popper",[h,x]=i.createContextScope(u),[g,m]=h(u),y=e=>{const{__scopePopper:r,children:t}=e,[o,i]=f.useState(null);return l.jsx(g,{scope:r,anchor:o,onAnchorChange:i,children:t})};y.displayName=u;var w="PopperAnchor",P=f.forwardRef((e,r)=>{const{__scopePopper:t,virtualRef:i,...a}=e,s=m(w,t),p=f.useRef(null),d=o.useComposedRefs(r,p),c=f.useRef(null);return f.useEffect(()=>{const e=c.current;c.current=i?.current||p.current,e!==c.current&&s.onAnchorChange(c.current)}),i?null:l.jsx(n.Primitive.div,{...a,ref:d})});P.displayName=w;var b="PopperContent",[v,j]=h(b),S=f.forwardRef((e,t)=>{const{__scopePopper:i,side:c="bottom",sideOffset:u=0,align:h="center",alignOffset:x=0,arrowPadding:g=0,avoidCollisions:y=!0,collisionBoundary:w=[],collisionPadding:P=0,sticky:j="partial",hideWhenDetached:S=!1,updatePositionStrategy:A="optimized",onPlaced:O,...C}=e,_=m(b,i),[H,z]=f.useState(null),E=o.useComposedRefs(t,e=>z(e)),[W,Y]=f.useState(null),D=p.useSize(W),N=D?.width??0,X=D?.height??0,k=c+("center"!==h?"-"+h:""),F="number"==typeof P?P:{top:0,right:0,bottom:0,left:0,...P},M=Array.isArray(w)?w:[w],B=M.length>0,I={padding:F,boundary:M.filter(q),altBoundary:B},{refs:L,floatingStyles:T,placement:U,isPositioned:G,middlewareData:J}=r.useFloating({strategy:"fixed",placement:k,whileElementsMounted:(...e)=>d.autoUpdate(...e,{animationFrame:"always"===A}),elements:{reference:_.anchor},middleware:[r.offset({mainAxis:u+X,alignmentAxis:x}),y&&r.shift({mainAxis:!0,crossAxis:!1,limiter:"partial"===j?r.limitShift():void 0,...I}),y&&r.flip({...I}),r.size({...I,apply:({elements:e,rects:r,availableWidth:t,availableHeight:o})=>{const{width:i,height:n}=r.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${t}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${i}px`),a.setProperty("--radix-popper-anchor-height",`${n}px`)}}),W&&r.arrow({element:W,padding:g}),R({arrowWidth:N,arrowHeight:X}),S&&r.hide({strategy:"referenceHidden",...I})]}),[K,Q]=$(U),V=a.useCallbackRef(O);s.useLayoutEffect(()=>{G&&V?.()},[G,V]);const Z=J.arrow?.x,ee=J.arrow?.y,re=0!==J.arrow?.centerOffset,[te,oe]=f.useState();return s.useLayoutEffect(()=>{H&&oe(window.getComputedStyle(H).zIndex)},[H]),l.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:G?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[J.transformOrigin?.x,J.transformOrigin?.y].join(" "),...J.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(v,{scope:i,placedSide:K,onArrowChange:Y,arrowX:Z,arrowY:ee,shouldHideArrow:re,children:l.jsx(n.Primitive.div,{"data-side":K,"data-align":Q,...C,ref:E,style:{...C.style,animation:G?void 0:"none"}})})})});S.displayName=b;var A="PopperArrow",O={top:"bottom",right:"left",bottom:"top",left:"right"},C=f.forwardRef(function(e,r){const{__scopePopper:o,...i}=e,n=j(A,o),a=O[n.placedSide];return l.jsx("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:l.jsx(t.Root,{...i,ref:r,style:{...i.style,display:"block"}})})});function q(e){return null!==e}C.displayName=A;var R=e=>({name:"transformOrigin",options:e,fn(r){const{placement:t,rects:o,middlewareData:i}=r,n=0!==i.arrow?.centerOffset,a=n?0:e.arrowWidth,s=n?0:e.arrowHeight,[p,l]=$(t),d={start:"0%",center:"50%",end:"100%"}[l],c=(i.arrow?.x??0)+a/2,f=(i.arrow?.y??0)+s/2;let u="",h="";return"bottom"===p?(u=n?d:`${c}px`,h=-s+"px"):"top"===p?(u=n?d:`${c}px`,h=`${o.floating.height+s}px`):"right"===p?(u=-s+"px",h=n?d:`${f}px`):"left"===p&&(u=`${o.floating.width+s}px`,h=n?d:`${f}px`),{data:{x:u,y:h}}}});function $(e){const[r,t="center"]=e.split("-");return[r,t]}var _=y,H=P,z=S,E=C;exports.Anchor=H,exports.Arrow=E,exports.Content=z,exports.Popper=y,exports.PopperAnchor=P,exports.PopperArrow=C,exports.PopperContent=S,exports.Root=_,exports.createPopperScope=x;
|
package/dist/index98.js
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as e from"react";import{useFloating as r,offset as t,shift as o,flip as i,size as n,arrow as a,hide as s,limitShift as d}from"./index108.js";import{Root as p}from"./index109.js";import{useComposedRefs as l}from"./index94.js";import{createContextScope as c}from"./index95.js";import{Primitive as f}from"./index101.js";import{useCallbackRef as m}from"./index105.js";import{useLayoutEffect as h}from"./index107.js";import{useSize as g}from"./index110.js";import{jsx as u}from"react/jsx-runtime";import{autoUpdate as x}from"./index111.js";var y="Popper",[w,v]=c(y),[b,P]=w(y),A=r=>{const{__scopePopper:t,children:o}=r,[i,n]=e.useState(null);/* @__PURE__ */
|
|
2
|
+
return u(b,{scope:t,anchor:i,onAnchorChange:n,children:o})};A.displayName=y;var j="PopperAnchor",S=e.forwardRef((r,t)=>{const{__scopePopper:o,virtualRef:i,...n}=r,a=P(j,o),s=e.useRef(null),d=l(t,s),p=e.useRef(null);return e.useEffect(()=>{const e=p.current;p.current=i?.current||s.current,e!==p.current&&a.onAnchorChange(p.current)}),i?null:/* @__PURE__ */u(f.div,{...n,ref:d})});S.displayName=j;var $="PopperContent",[O,_]=w($),C=e.forwardRef((p,c)=>{const{__scopePopper:y,side:w="bottom",sideOffset:v=0,align:b="center",alignOffset:A=0,arrowPadding:j=0,avoidCollisions:S=!0,collisionBoundary:_=[],collisionPadding:C=0,sticky:H="partial",hideWhenDetached:R=!1,updatePositionStrategy:W="optimized",onPlaced:X,...z}=p,D=P($,y),[k,B]=e.useState(null),F=l(c,e=>B(e)),[I,L]=e.useState(null),M=g(I),q=M?.width??0,G=M?.height??0,J=w+("center"!==b?"-"+b:""),K="number"==typeof C?C:{top:0,right:0,bottom:0,left:0,...C},Q=Array.isArray(_)?_:[_],T=Q.length>0,U={padding:K,boundary:Q.filter(Y),altBoundary:T},{refs:V,floatingStyles:Z,placement:ee,isPositioned:re,middlewareData:te}=r({strategy:"fixed",placement:J,whileElementsMounted:(...e)=>x(...e,{animationFrame:"always"===W}),elements:{reference:D.anchor},middleware:[t({mainAxis:v+G,alignmentAxis:A}),S&&o({mainAxis:!0,crossAxis:!1,limiter:"partial"===H?d():void 0,...U}),S&&i({...U}),n({...U,apply:({elements:e,rects:r,availableWidth:t,availableHeight:o})=>{const{width:i,height:n}=r.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${t}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${i}px`),a.setProperty("--radix-popper-anchor-height",`${n}px`)}}),I&&a({element:I,padding:j}),E({arrowWidth:q,arrowHeight:G}),R&&s({strategy:"referenceHidden",...U})]}),[oe,ie]=N(ee),ne=m(X);h(()=>{re&&ne?.()},[re,ne]);const ae=te.arrow?.x,se=te.arrow?.y,de=0!==te.arrow?.centerOffset,[pe,le]=e.useState();return h(()=>{k&&le(window.getComputedStyle(k).zIndex)},[k]),/* @__PURE__ */u("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:re?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:p.dir,children:/* @__PURE__ */u(O,{scope:y,placedSide:oe,onArrowChange:L,arrowX:ae,arrowY:se,shouldHideArrow:de,children:/* @__PURE__ */u(f.div,{"data-side":oe,"data-align":ie,...z,ref:F,style:{...z.style,animation:re?void 0:"none"}})})})});C.displayName=$;var H="PopperArrow",R={top:"bottom",right:"left",bottom:"top",left:"right"},W=e.forwardRef(function(e,r){const{__scopePopper:t,...o}=e,i=_(H,t),n=R[i.placedSide];
|
|
3
|
+
/* @__PURE__ */
|
|
4
|
+
return u("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[n]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:/* @__PURE__ */u(p,{...o,ref:r,style:{...o.style,display:"block"}})})});function Y(e){return null!==e}W.displayName=H;var E=e=>({name:"transformOrigin",options:e,fn(r){const{placement:t,rects:o,middlewareData:i}=r,n=0!==i.arrow?.centerOffset,a=n?0:e.arrowWidth,s=n?0:e.arrowHeight,[d,p]=N(t),l={start:"0%",center:"50%",end:"100%"}[p],c=(i.arrow?.x??0)+a/2,f=(i.arrow?.y??0)+s/2;let m="",h="";return"bottom"===d?(m=n?l:`${c}px`,h=-s+"px"):"top"===d?(m=n?l:`${c}px`,h=`${o.floating.height+s}px`):"right"===d?(m=-s+"px",h=n?l:`${f}px`):"left"===d&&(m=`${o.floating.width+s}px`,h=n?l:`${f}px`),{data:{x:m,y:h}}}});function N(e){const[r,t="center"]=e.split("-");return[r,t]}var X=A,z=S,D=C,k=W;export{z as Anchor,k as Arrow,D as Content,A as Popper,S as PopperAnchor,W as PopperArrow,C as PopperContent,X as Root,v as createPopperScope};
|
package/dist/index99.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),r=require("./index101.cjs"),o=require("./index107.cjs"),n=require("react/jsx-runtime");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const i=c(e);var a=i.forwardRef((e,c)=>{const{container:a,...u}=e,[s,l]=i.useState(!1);o.useLayoutEffect(()=>l(!0),[]);const d=a||s&&globalThis?.document?.body;return d?t.createPortal(n.jsx(r.Primitive.div,{...u,ref:c}),d):null});a.displayName="Portal",exports.Portal=a;
|
package/dist/index99.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
return e(t,{...l,ref:i,children:n.isValidElement(r)?n.cloneElement(r,void 0,o):null})}/* @__PURE__ */
|
|
3
|
-
return e(t,{...l,ref:i,children:o})});return i.displayName=`${r}.Slot`,i}function o(e){const t=n.forwardRef((e,t)=>{const{children:i,...o}=e;if(n.isValidElement(i)){const e=function(n){let r=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,e=r&&"isReactWarning"in r&&r.isReactWarning;if(e)return n.ref;if(r=Object.getOwnPropertyDescriptor(n,"ref")?.get,e=r&&"isReactWarning"in r&&r.isReactWarning,e)return n.props.ref;return n.props.ref||n.ref}(i),l=function(n,r){const e={...r};for(const t in r){const i=n[t],o=r[t];/^on[A-Z]/.test(t)?i&&o?e[t]=(...n)=>{const r=o(...n);return i(...n),r}:i&&(e[t]=i):"style"===t?e[t]={...i,...o}:"className"===t&&(e[t]=[i,o].filter(Boolean).join(" "))}return{...n,...e}}(o,i.props);return i.type!==n.Fragment&&(l.ref=t?r(t,e):e),n.cloneElement(i,l)}return n.Children.count(i)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var l=/* @__PURE__ */Symbol("radix.slottable");function c(n){const r=({children:n})=>/* @__PURE__ */e(t,{children:n});return r.displayName=`${n}.Slottable`,r.__radixId=l,r}function s(r){return n.isValidElement(r)&&"function"==typeof r.type&&"__radixId"in r.type&&r.type.__radixId===l}export{i as createSlot,c as createSlottable};
|
|
1
|
+
import*as r from"react";import o from"react-dom";import{Primitive as t}from"./index101.js";import{useLayoutEffect as e}from"./index107.js";import{jsx as a}from"react/jsx-runtime";var m=r.forwardRef((m,i)=>{const{container:s,...f}=m,[n,c]=r.useState(!1);e(()=>c(!0),[]);const d=s||n&&globalThis?.document?.body;return d?o.createPortal(/* @__PURE__ */a(t.div,{...f,ref:i}),d):null});m.displayName="Portal";export{m as Portal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButton.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.component.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAc1D,eAAO,MAAM,UAAU,+GAwFtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"IconButton.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAUZ,CAAC;AAEZ,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,EAAE,MAAM,CAa1F,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,MAAM,CAIzD,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { IconName } from '@adam-milo/icons';
|
|
3
3
|
|
|
4
|
-
export interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, '
|
|
4
|
+
export interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className'> {
|
|
5
5
|
icon: IconName;
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
variant?: 'rainbow-overlay' | 'outlined-green' | 'default';
|
|
9
|
+
loading?: boolean;
|
|
8
10
|
'aria-label'?: string;
|
|
9
11
|
'data-testid'?: string;
|
|
10
12
|
'data-cy'?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,
|
|
1
|
+
{"version":3,"file":"IconButton.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,WAAW,CACZ;IACC,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/phone-input/PhoneInput.component.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA2B1D,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"PhoneInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/phone-input/PhoneInput.component.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA2B1D,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,UAAU,8GA4XtB,CAAC;AAIF,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -12,7 +12,7 @@ export declare const flagStyles = "flex items-center justify-center w-5 h-5 text
|
|
|
12
12
|
export declare const dialCodeStyles = "text-base text-[var(--color-text)] whitespace-nowrap shrink-0";
|
|
13
13
|
export declare const inputStyles = "m-0 p-0 border-none bg-transparent flex-1 min-w-0 text-base text-[var(--color-text)] leading-none focus:outline-none placeholder:text-[var(--color-icon-secondary)] text-start";
|
|
14
14
|
/** Outer container: rounded corners, shadow. Matches Select Content structure. */
|
|
15
|
-
export declare const dropdownStyles = "phone-dropdown-animate fixed z-[100] flex flex-col min-w-[20rem] overflow-hidden bg-[var(--color-card)] rounded-[var(--radius-md)] shadow-[0_0.
|
|
15
|
+
export declare const dropdownStyles = "phone-dropdown-animate fixed z-[100] flex flex-col min-w-[20rem] overflow-hidden bg-[var(--color-card)] rounded-[var(--radius-md)] shadow-[0_0.25rem_1rem_var(--shadow-color-md)]";
|
|
16
16
|
/** Inner scrollable viewport: same structure as Select Viewport for scrollbar border-radius. */
|
|
17
17
|
export declare const dropdownViewportStyles = "select-viewport-scrollbar p-1 max-h-[12rem] overflow-y-scroll [-webkit-overflow-scrolling:touch] flex flex-col";
|
|
18
18
|
export declare const optionBaseStyles: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/phone-input/PhoneInput.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,+DAA+D,CAAC;AAC1F,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAE/C,eAAO,MAAM,WAAW,mFAC0D,CAAC;AAEnF,eAAO,MAAM,mBAAmB,QAGrB,CAAC;AACZ,eAAO,MAAM,wBAAwB,WAAW,CAAC;AACjD,eAAO,MAAM,oBAAoB,sCAAsC,CAAC;AACxE,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,uBAAuB,sDAAsD,CAAC;AAC3F,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,eAAO,M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AY,mEAAmE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TextareaProps } from './Textarea.types';
|
|
2
|
+
|
|
3
|
+
export declare const Textarea: import('react').ForwardRefExoticComponent<TextareaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
4
|
+
export type { TextareaProps } from './Textarea.types';
|
|
5
|
+
//# sourceMappingURL=Textarea.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/textarea/Textarea.component.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBtD,eAAO,MAAM,QAAQ,+GAmXpB,CAAC;AAIF,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const wrapperStyles = "flex flex-col justify-center items-start gap-2 w-full";
|
|
2
|
+
export declare const labelRowStyles = "flex items-center justify-between h-4 w-full";
|
|
3
|
+
export declare const labelStyles = "text-sm font-normal text-[var(--color-grey-07)] leading-none";
|
|
4
|
+
export declare const tooltipTriggerStyles: string;
|
|
5
|
+
export declare const tooltipContentStyles: string;
|
|
6
|
+
export declare const textareaBaseStyles: string;
|
|
7
|
+
export declare const textareaErrorStyles = "border-[var(--color-error)] focus:border-[var(--color-error)] hover:enabled:border-[var(--color-error)]";
|
|
8
|
+
export declare const helperStyles = "text-xs leading-none text-[var(--color-grey-07)]";
|
|
9
|
+
export declare const errorStyles = "text-[0.75rem] font-normal leading-none text-[var(--Error-Red,var(--color-error))]";
|
|
10
|
+
export declare const charCountStyles = "text-xs leading-none text-[var(--color-grey-06)] text-end";
|
|
11
|
+
export declare const charCountExceededStyles = "text-[var(--color-error)]";
|
|
12
|
+
export declare const footerStyles = "flex items-center justify-between w-full";
|
|
13
|
+
//# sourceMappingURL=Textarea.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/textarea/Textarea.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,0DAA0D,CAAC;AACrF,eAAO,MAAM,cAAc,iDAAiD,CAAC;AAC7E,eAAO,MAAM,WAAW,iEAAiE,CAAC;AAE1F,eAAO,MAAM,oBAAoB,QAQtB,CAAC;AAEZ,eAAO,MAAM,oBAAoB,QAKtB,CAAC;AAEZ,eAAO,MAAM,kBAAkB,QAWpB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,4GAC2E,CAAC;AAE5G,eAAO,MAAM,YAAY,qDAAqD,CAAC;AAC/E,eAAO,MAAM,WAAW,uFAC8D,CAAC;AAEvF,eAAO,MAAM,eAAe,8DAA8D,CAAC;AAC3F,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAEnE,eAAO,MAAM,YAAY,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
label?: string;
|
|
5
|
+
tooltip?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
autoResize?: boolean;
|
|
10
|
+
minRows?: number;
|
|
11
|
+
maxRows?: number;
|
|
12
|
+
showCharCount?: boolean;
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Validation function. Defaults to `defaultValidation` which blocks SQL, HTML, shell, and template injections.
|
|
16
|
+
* Pass `undefined` to disable validation, or provide a custom validator.
|
|
17
|
+
* @default defaultValidation
|
|
18
|
+
*/
|
|
19
|
+
validate?: ((value: string) => string | undefined) | null;
|
|
20
|
+
onValidationChange?: (isValid: boolean) => void;
|
|
21
|
+
/** Custom header content (replaces label/tooltip) */
|
|
22
|
+
customHeader?: ReactNode;
|
|
23
|
+
/** Custom footer actions inside the container (replaces helperText/charCount footer) */
|
|
24
|
+
customFooterActions?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Border variant for custom styling.
|
|
27
|
+
* - 'default': Standard border styling
|
|
28
|
+
* - 'green-accent': Gradient border (green-to-blue) with hover/focus effects
|
|
29
|
+
*/
|
|
30
|
+
borderVariant?: 'default' | 'green-accent';
|
|
31
|
+
'data-cy'?: string;
|
|
32
|
+
'data-testid'?: string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=Textarea.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/textarea/Textarea.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,MAAM,WAAW,aAAc,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;IAC1D,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAEhD,qDAAqD;IACrD,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB,wFAAwF;IACxF,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAEhC;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IAE3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -15,9 +15,9 @@ export declare const labelContainerReversedStyles = "flex-row-reverse";
|
|
|
15
15
|
export declare const labelTextStyles = "text-sm font-normal leading-snug text-[var(--color-text)] select-none disabled:text-[var(--color-system-text)]";
|
|
16
16
|
export declare const inputSrOnlyStyles = "peer absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0 [clip:rect(0,0,0,0)] focus-visible:outline-none";
|
|
17
17
|
export declare const trackBaseStyles = "relative flex items-center shrink-0 rounded-2xl bg-[var(--color-icon-secondary)] transition-[background-color,background-image] duration-200 ease-in-out peer-checked:bg-[var(--color-clickable)] peer-checked:justify-end peer-disabled:bg-[var(--color-border)] peer-disabled:bg-none peer-disabled:peer-checked:bg-[var(--color-icon-secondary)] peer-focus-visible:outline-2 peer-focus-visible:outline-[var(--color-clickable)] peer-focus-visible:outline-offset-2";
|
|
18
|
-
export declare const trackHoverStyles = "bg-[linear-gradient(90deg,
|
|
19
|
-
export declare const trackHoverCheckedStyles = "peer-checked:bg-[linear-gradient(90deg,
|
|
18
|
+
export declare const trackHoverStyles = "bg-[linear-gradient(90deg,var(--overlay-dark-24)_0%,var(--overlay-dark-24)_100%),linear-gradient(90deg,var(--color-icon-secondary)_0%,var(--color-icon-secondary)_100%)]";
|
|
19
|
+
export declare const trackHoverCheckedStyles = "peer-checked:bg-[linear-gradient(90deg,var(--overlay-dark-40)_0%,var(--overlay-dark-40)_100%),linear-gradient(90deg,var(--color-clickable)_0%,var(--color-clickable)_100%)]";
|
|
20
20
|
export declare const knobBaseStyles = "rounded-full bg-[var(--color-card)] transition-shadow duration-200";
|
|
21
|
-
export declare const knobHoverShadowStyles = "shadow-[0_0.125rem_0.
|
|
21
|
+
export declare const knobHoverShadowStyles = "shadow-[0_0.125rem_0.25rem_0_var(--shadow-color-knob)]";
|
|
22
22
|
export declare const helperStyles = "text-xs font-normal leading-snug text-[var(--color-system-text)] ms-0";
|
|
23
23
|
//# sourceMappingURL=Toggle.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/toggle/Toggle.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,eAAO,MAAM,aAAa,iCAAiC,CAAC;AAC5D,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AACrE,eAAO,MAAM,oBAAoB,2EACyC,CAAC;AAC3E,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAC/D,eAAO,MAAM,eAAe,mHACsF,CAAC;AACnH,eAAO,MAAM,iBAAiB,iIACkG,CAAC;AACjI,eAAO,MAAM,eAAe,6cACgb,CAAC;AAC7c,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Toggle.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/toggle/Toggle.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,eAAO,MAAM,aAAa,iCAAiC,CAAC;AAC5D,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AACrE,eAAO,MAAM,oBAAoB,2EACyC,CAAC;AAC3E,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAC/D,eAAO,MAAM,eAAe,mHACsF,CAAC;AACnH,eAAO,MAAM,iBAAiB,iIACkG,CAAC;AACjI,eAAO,MAAM,eAAe,6cACgb,CAAC;AAC7c,eAAO,MAAM,gBAAgB,6KAC+I,CAAC;AAC7K,eAAO,MAAM,uBAAuB,gLAC2I,CAAC;AAChL,eAAO,MAAM,cAAc,uEAAuE,CAAC;AACnG,eAAO,MAAM,qBAAqB,2DAA2D,CAAC;AAC9F,eAAO,MAAM,YAAY,0EAA0E,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export { OTPInput } from './components/forms/otp-input/OTPInput.component';
|
|
|
29
29
|
export type { OTPInputProps, OTPInputRef, OTPInputSize, } from './components/forms/otp-input/OTPInput.component';
|
|
30
30
|
export { Toggle } from './components/forms/toggle/Toggle.component';
|
|
31
31
|
export type { ToggleProps } from './components/forms/toggle/Toggle.component';
|
|
32
|
+
export { Textarea } from './components/forms/textarea/Textarea.component';
|
|
33
|
+
export type { TextareaProps } from './components/forms/textarea/Textarea.component';
|
|
32
34
|
export { Form } from './components/forms/controlled/form/Form.component';
|
|
33
35
|
export type { FormProps } from './components/forms/controlled/form/Form.component';
|
|
34
36
|
export { FormField } from './components/forms/controlled/FormField.component';
|
|
@@ -96,4 +98,6 @@ export { AiLoader } from './components/feedback/ai-loader/AiLoader.component';
|
|
|
96
98
|
export type { AiLoaderProps, AiLoaderSize, } from './components/feedback/ai-loader/AiLoader.component';
|
|
97
99
|
export { cn, generateId, getResponsiveClasses, getResponsiveBase, getResponsiveSizeClasses, isResponsiveObject, } from './lib';
|
|
98
100
|
export type { ResponsiveValue } from './lib';
|
|
101
|
+
export { textValidators, defaultValidation, normalizeWhitespace } from './utils/validation';
|
|
102
|
+
export type { ValidationFunction } from './utils/validation';
|
|
99
103
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAE7E,OAAO,EA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,EAAE,MAAM,6CAA6C,CAAC;AACnE,YAAY,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,GACX,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,iDAAiD,CAAC;AAC1E,YAAY,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,cAAc,GACf,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAC9E,YAAY,EACV,aAAa,EACb,YAAY,GACb,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EACL,EAAE,EACF,UAAU,EACV,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,OAAO,CAAC;AACf,YAAY,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text validation utilities for form inputs.
|
|
3
|
+
* These validators are designed for client-side UX feedback only.
|
|
4
|
+
*
|
|
5
|
+
* ⚠️ IMPORTANT: Client-side validation is NOT security.
|
|
6
|
+
* Always validate and sanitize user input on the server side.
|
|
7
|
+
*/
|
|
8
|
+
export type ValidationFunction = (value: string) => string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Normalizes line endings from \r\n (Windows) to \n (Unix).
|
|
11
|
+
* Also trims trailing whitespace from each line.
|
|
12
|
+
*/
|
|
13
|
+
export declare const normalizeWhitespace: (value: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Text validation utilities.
|
|
16
|
+
*/
|
|
17
|
+
export declare const textValidators: {
|
|
18
|
+
/**
|
|
19
|
+
* Allows letters, numbers, basic punctuation, and whitespace.
|
|
20
|
+
* Supports Unicode letters and numbers for international text.
|
|
21
|
+
*
|
|
22
|
+
* Allowed characters:
|
|
23
|
+
* - Letters: All Unicode letters (a-z, A-Z, é, ñ, 中, etc.)
|
|
24
|
+
* - Numbers: All Unicode numbers (0-9, ٠-٩, etc.)
|
|
25
|
+
* - Whitespace: spaces, tabs, newlines
|
|
26
|
+
* - Punctuation: . , ; : ! ? - _ ( ) [ ] { } ' " / \ @ # & + = * %
|
|
27
|
+
* - Currency: $ € £ ₪
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Textarea validate={textValidators.safeText} />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
safeText: (value: string) => string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Blocks common injection patterns (basic client-side check).
|
|
37
|
+
*
|
|
38
|
+
* Detects:
|
|
39
|
+
* - HTML tags: Any tag like <div>, <script>, <span>, etc.
|
|
40
|
+
* - JavaScript: javascript: protocol, event handlers (onclick, etc.)
|
|
41
|
+
* - SQL: SELECT...FROM, DROP TABLE, INSERT INTO, etc.
|
|
42
|
+
* - Template literals: ${...}, backticks
|
|
43
|
+
* - Shell commands: | bash, | sh, etc.
|
|
44
|
+
*
|
|
45
|
+
* Note: This is a UX helper, not a security measure.
|
|
46
|
+
* False positives may occur (e.g., "SELECT your option" in normal text).
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <Textarea validate={textValidators.noInjection} />
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
noInjection: (value: string) => string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Allows only alphanumeric characters (letters + numbers).
|
|
56
|
+
* Supports Unicode letters and numbers.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <Textarea validate={textValidators.alphanumeric} />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
alphanumeric: (value: string) => string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Allows alphanumeric + spaces only.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <Textarea validate={textValidators.alphanumericWithSpaces} />
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
alphanumericWithSpaces: (value: string) => string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Validates minimum length (after trimming).
|
|
75
|
+
*
|
|
76
|
+
* @param minLength Minimum number of characters required
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* <Textarea validate={textValidators.minLength(20)} />
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
minLength: (minLength: number) => ValidationFunction;
|
|
83
|
+
/**
|
|
84
|
+
* Validates maximum length.
|
|
85
|
+
*
|
|
86
|
+
* @param maxLength Maximum number of characters allowed
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* <Textarea validate={textValidators.maxLength(500)} />
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
maxLength: (maxLength: number) => ValidationFunction;
|
|
93
|
+
/**
|
|
94
|
+
* Validates that value is not empty (after trimming).
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* <Textarea validate={textValidators.required} />
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
required: (value: string) => string | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Blocks excessive whitespace (more than 2 consecutive spaces/newlines).
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```tsx
|
|
107
|
+
* <Textarea validate={textValidators.noExcessiveWhitespace} />
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
noExcessiveWhitespace: (value: string) => string | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Composes multiple validators into a single validation function.
|
|
113
|
+
* Validators are executed in order. Returns the first error encountered.
|
|
114
|
+
*
|
|
115
|
+
* @param validators Array of validation functions to compose
|
|
116
|
+
* @example
|
|
117
|
+
* ```tsx
|
|
118
|
+
* <Textarea
|
|
119
|
+
* validate={textValidators.compose(
|
|
120
|
+
* textValidators.required,
|
|
121
|
+
* textValidators.minLength(20),
|
|
122
|
+
* textValidators.safeText,
|
|
123
|
+
* textValidators.noInjection
|
|
124
|
+
* )}
|
|
125
|
+
* />
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
compose: (...validators: ValidationFunction[]) => ValidationFunction;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Default validation that only blocks dangerous patterns (SQL, HTML, shell, templates).
|
|
132
|
+
* Allows all characters including special symbols, pipes, etc.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```tsx
|
|
136
|
+
* import { defaultValidation } from '@adam-milo/ui';
|
|
137
|
+
*
|
|
138
|
+
* <Textarea validate={defaultValidation} />
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export declare const defaultValidation: (value: string) => string | undefined;
|
|
142
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,KAAG,MAInD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB;;;;;;;;;;;;;;;OAeG;sBACe,MAAM,KAAG,MAAM,GAAG,SAAS;IAc7C;;;;;;;;;;;;;;;;;OAiBG;yBACkB,MAAM,KAAG,MAAM,GAAG,SAAS;IAqBhD;;;;;;;;OAQG;0BACmB,MAAM,KAAG,MAAM,GAAG,SAAS;IAQjD;;;;;;;OAOG;oCAC6B,MAAM,KAAG,MAAM,GAAG,SAAS;IAQ3D;;;;;;;;OAQG;2BACoB,MAAM,KAAG,kBAAkB;IAUlD;;;;;;;;OAQG;2BACoB,MAAM,KAAG,kBAAkB;IASlD;;;;;;;OAOG;sBACe,MAAM,KAAG,MAAM,GAAG,SAAS;IAO7C;;;;;;;OAOG;mCAC4B,MAAM,KAAG,MAAM,GAAG,SAAS;IAO1D;;;;;;;;;;;;;;;;OAgBG;6BACsB,kBAAkB,EAAE,KAAG,kBAAkB;CAWnE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,UAlKP,MAAM,KAAG,MAAM,GAAG,SAkKkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.spec.d.ts","sourceRoot":"","sources":["../../../src/utils/validation.spec.ts"],"names":[],"mappings":""}
|