reaxify 1.3.0 → 1.3.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/dist/components/Tooltip/index.cjs.js +1 -1
- package/dist/components/Tooltip/index.es.js +6 -6
- package/dist/storybook/argTypes.d.ts +47 -0
- package/dist/storybook/argTypes.d.ts.map +1 -0
- package/dist/storybook/parameters.d.ts +8 -0
- package/dist/storybook/parameters.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const v=require("react/jsx-runtime"),s=require("react"),L=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),F=require("../Portal/index.cjs.js"),E=require("../../hooks/useClasses.cjs.js"),G=require("../../helpers/anchorPointer.cjs.js"),I=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),N=s.createContext({placement:"top",color:"dark",transitionState:"unmounted"});function W(){return s.useContext(N)}function H({open:l=!1,anchorEl:u=null,anchorPointer:r=!1,placement:t="top",color:g="dark",duration:w=300,onEnter:b,onEntering:n,onEntered:
|
|
1
|
+
"use client";"use strict";const v=require("react/jsx-runtime"),s=require("react"),L=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),F=require("../Portal/index.cjs.js"),E=require("../../hooks/useClasses.cjs.js"),G=require("../../helpers/anchorPointer.cjs.js"),I=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),N=s.createContext({placement:"top",color:"dark",transitionState:"unmounted"});function W(){return s.useContext(N)}function H({open:l=!1,anchorEl:u=null,anchorPointer:r=!1,placement:t="top",color:g="dark",duration:w=300,onEnter:b,onEntering:n,onEntered:d,onExit:$,onExiting:B,onExited:S,className:O,children:A}){const c=E(e=>e.tooltip),p=s.useRef(null),y=0,C=16,X={entering:"scale-100 opacity-100",entered:"scale-100 opacity-100",exiting:"scale-75 opacity-0",exited:"scale-75 opacity-0",unmounted:""},Y=s.useMemo(()=>{var f;return[t==="top"||t==="bottom"?"flex-col":"flex-row",{top:"flex-col origin-bottom",bottom:"flex-col-reverse origin-top",start:"flex-row origin-right rtl:origin-left",end:"flex-row-reverse origin-left rtl:origin-right"}[t],(f=c==null?void 0:c.placement)==null?void 0:f[t]]},[t,c==null?void 0:c.placement]),D=s.useCallback(e=>{var a,f,i;(a=p.current)==null||a.style.setProperty("--left",`${e.left}px`),(f=p.current)==null||f.style.setProperty("--right",`${e.right}px`),(i=p.current)==null||i.style.setProperty("--top",`${e.top}px`)},[]),M=s.useCallback(()=>{if(!l||!u||!p.current)return;const e=p.current,a=window.innerWidth,f=window.innerHeight,i=e.offsetWidth,j=e.offsetHeight;let P,R,z,T,k,q;if(r){const o=G.getAnchorPointer(u);if(!o)return;P=o.x,R=o.x,z=o.y,T=o.y,k=o.x,q=o.y}else{const o=u.getBoundingClientRect();P=o.left,R=o.right,z=o.top,T=o.bottom,k=o.left+o.width/2,q=o.top+o.height/2}let h,x,m;switch(t){case"top":h=k-i/2,x=a-k-i/2,m=z-j-y;break;case"bottom":h=k-i/2,x=a-k-i/2,m=T+y;break;case"start":h=P-i-y,x=a-R-y-i,m=q-j/2;break;case"end":h=R+y,x=a-P+y,m=q-j/2;break}h=Math.min(Math.max(h,C),a-i-C),x=Math.min(Math.max(x,C),a-i-C),m=Math.min(Math.max(m,C),f-j-C),D({left:h,right:x,top:m})},[l,u,r,t,D]);return s.useEffect(()=>{M()},[M,A]),s.useEffect(()=>{const e=()=>M();return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}},[M]),v.jsx(F,{children:v.jsx(I.default,{nodeRef:p,in:l,timeout:w,unmountOnExit:!0,onEnter:b,onEntering:n,onEntered:d,onExit:$,onExiting:B,onExited:S,children:e=>v.jsx(N.Provider,{value:{placement:t,color:g,transitionState:e},children:v.jsx("div",{ref:p,"data-name":"tooltip","data-open":l,style:{transitionDuration:`${w}ms`},className:L.twMerge("flex items-center justify-center fixed z-1 pointer-events-none top-(--top) left-(--left) right-auto origin-top-left rtl:left-auto rtl:right-(--right) rtl:origin-top-right transition-[scale,opacity]",c==null?void 0:c.base,Y,X[e],O),children:A})})})})}function J({className:l,children:u,...r}){const t=E(b=>{var n;return(n=b.tooltip)==null?void 0:n.content}),{color:g}=W(),w=s.useMemo(()=>{var n;return[{primary:"bg-primary text-white",secondary:"bg-secondary text-white",success:"bg-success text-white",info:"bg-info text-white",warning:"bg-warning text-white",danger:"bg-danger text-white",dark:"bg-dark text-white",light:"bg-light text-dark"}[g],(n=t==null?void 0:t.color)==null?void 0:n[g]]},[g,t==null?void 0:t.color]);return v.jsx("span",{role:"tooltip","data-name":"tooltip-content",className:L.twMerge("relative block size-fit min-w-fit min-h-fit text-sm rounded px-3 py-1 whitespace-nowrap z-1",t==null?void 0:t.base,w,l),...r,children:u})}function K({className:l,...u}){const r=E(n=>{var d;return(d=n.tooltip)==null?void 0:d.arrow}),{color:t,placement:g}=W(),w=s.useMemo(()=>({top:"-translate-y-3/5",bottom:"translate-y-3/5",start:"-translate-x-3/5 rtl:translate-x-3/5",end:"translate-x-3/5 rtl:-translate-x-3/5"})[g],[g]),b=s.useMemo(()=>{var d;return[{primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",info:"bg-info",warning:"bg-warning",danger:"bg-danger",dark:"bg-dark",light:"bg-light"}[t],(d=r==null?void 0:r.color)==null?void 0:d[t]]},[t,r==null?void 0:r.color]);return v.jsx("span",{"data-name":"tooltip-arrow",className:L.twMerge("block size-2.5 min-w-2.5 min-h-2.5 rotate-45 rounded-sm shrink-0",r==null?void 0:r.base,w,b,l),...u})}H.Content=J;H.Arrow=K;module.exports=H;
|
|
@@ -149,7 +149,7 @@ function Z({
|
|
|
149
149
|
role: "tooltip",
|
|
150
150
|
"data-name": "tooltip-content",
|
|
151
151
|
className: $(
|
|
152
|
-
"relative block size-fit min-w-fit min-h-fit text-sm rounded px-
|
|
152
|
+
"relative block size-fit min-w-fit min-h-fit text-sm rounded px-3 py-1 whitespace-nowrap z-1",
|
|
153
153
|
t == null ? void 0 : t.base,
|
|
154
154
|
x,
|
|
155
155
|
l
|
|
@@ -167,10 +167,10 @@ function _({
|
|
|
167
167
|
var g;
|
|
168
168
|
return (g = n.tooltip) == null ? void 0 : g.arrow;
|
|
169
169
|
}), { color: t, placement: p } = B(), x = R(() => ({
|
|
170
|
-
top: "-translate-y-
|
|
171
|
-
bottom: "translate-y-
|
|
172
|
-
start: "-translate-x-
|
|
173
|
-
end: "translate-x-
|
|
170
|
+
top: "-translate-y-3/5",
|
|
171
|
+
bottom: "translate-y-3/5",
|
|
172
|
+
start: "-translate-x-3/5 rtl:translate-x-3/5",
|
|
173
|
+
end: "translate-x-3/5 rtl:-translate-x-3/5"
|
|
174
174
|
})[p], [p]), w = R(() => {
|
|
175
175
|
var g;
|
|
176
176
|
return [{
|
|
@@ -189,7 +189,7 @@ function _({
|
|
|
189
189
|
{
|
|
190
190
|
"data-name": "tooltip-arrow",
|
|
191
191
|
className: $(
|
|
192
|
-
"block size-
|
|
192
|
+
"block size-2.5 min-w-2.5 min-h-2.5 rotate-45 rounded-sm shrink-0",
|
|
193
193
|
r == null ? void 0 : r.base,
|
|
194
194
|
x,
|
|
195
195
|
w,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { InputType } from '@storybook/core/csf';
|
|
2
|
+
export declare const COLORS: readonly ["primary", "secondary", "success", "info", "warning", "danger", "dark", "light"];
|
|
3
|
+
export declare const SIZES: readonly ["sm", "md", "lg"];
|
|
4
|
+
export declare const BUTTON_SIZES: readonly ["sm", "md", "lg", "icon"];
|
|
5
|
+
export declare const BADGE_VARIANTS: readonly ["solid", "outline", "soft"];
|
|
6
|
+
export declare const BUTTON_VARIANTS: readonly ["solid", "outline", "text", "soft"];
|
|
7
|
+
export declare const ALERT_VARIANTS: readonly ["solid", "outline", "soft"];
|
|
8
|
+
export declare const TYPOGRAPHY_VARIANTS: readonly ["heading-1", "heading-2", "heading-3", "heading-4", "heading-5", "heading-6", "body-1", "body-2", "body-3"];
|
|
9
|
+
export declare const DIVIDER_ORIENTATIONS: readonly ["horizontal", "vertical"];
|
|
10
|
+
export declare const DIVIDER_VARIANTS: readonly ["solid", "dashed", "dotted"];
|
|
11
|
+
export declare const STACK_DIRECTIONS: readonly ["row", "column"];
|
|
12
|
+
export declare const DRAWER_ANCHORS: readonly ["start", "end", "top", "bottom"];
|
|
13
|
+
export declare const TOOLTIP_PLACEMENTS: readonly ["top", "end", "bottom", "start"];
|
|
14
|
+
export declare const TOGGLE_TRIGGER_ON: readonly ["hover", "click", "contextMenu"];
|
|
15
|
+
export declare const BUTTON_GROUP_ORIENTATIONS: readonly ["horizontal", "vertical"];
|
|
16
|
+
export declare const ACCORDION_VARIANTS: readonly ["single", "multiple"];
|
|
17
|
+
type ArgControl = NonNullable<InputType["control"]>;
|
|
18
|
+
export declare function argType(description: string, defaultValue: string | number | boolean, control: ArgControl, options?: readonly string[]): InputType;
|
|
19
|
+
export declare const hidden: InputType;
|
|
20
|
+
export declare const actionHidden: InputType;
|
|
21
|
+
export declare const colorArgType: InputType;
|
|
22
|
+
export declare const sizeArgType: InputType;
|
|
23
|
+
export declare const buttonSizeArgType: InputType;
|
|
24
|
+
export declare const badgeVariantArgType: InputType;
|
|
25
|
+
export declare const buttonVariantArgType: InputType;
|
|
26
|
+
export declare const alertVariantArgType: InputType;
|
|
27
|
+
export declare const typographyVariantArgType: InputType;
|
|
28
|
+
export declare const dividerOrientationArgType: InputType;
|
|
29
|
+
export declare const dividerVariantArgType: InputType;
|
|
30
|
+
export declare const stackDirectionArgType: InputType;
|
|
31
|
+
export declare const drawerAnchorArgType: InputType;
|
|
32
|
+
export declare const tooltipPlacementArgType: InputType;
|
|
33
|
+
export declare const toggleTriggerOnArgType: InputType;
|
|
34
|
+
export declare const buttonGroupOrientationArgType: InputType;
|
|
35
|
+
export declare const accordionVariantArgType: InputType;
|
|
36
|
+
export declare function booleanArg(description: string, defaultValue: boolean): InputType;
|
|
37
|
+
export declare function textArg(description: string, defaultValue: string): InputType;
|
|
38
|
+
export declare function numberArg(description: string, defaultValue: number): InputType;
|
|
39
|
+
export declare function rangeArg(description: string, defaultValue: number, min: number, max: number, step?: number): InputType;
|
|
40
|
+
export declare const polymorphicHidden: {
|
|
41
|
+
as: InputType;
|
|
42
|
+
className: InputType;
|
|
43
|
+
ref: InputType;
|
|
44
|
+
children: InputType;
|
|
45
|
+
};
|
|
46
|
+
export type { InputType };
|
|
47
|
+
//# sourceMappingURL=argTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argTypes.d.ts","sourceRoot":"","sources":["../../src/storybook/argTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,eAAO,MAAM,MAAM,4FAST,CAAC;AAEX,eAAO,MAAM,KAAK,6BAA8B,CAAC;AAEjD,eAAO,MAAM,YAAY,qCAAsC,CAAC;AAEhE,eAAO,MAAM,cAAc,uCAAwC,CAAC;AAEpE,eAAO,MAAM,eAAe,+CAAgD,CAAC;AAE7E,eAAO,MAAM,cAAc,uCAAwC,CAAC;AAEpE,eAAO,MAAM,mBAAmB,uHAUtB,CAAC;AAEX,eAAO,MAAM,oBAAoB,qCAAsC,CAAC;AAExE,eAAO,MAAM,gBAAgB,wCAAyC,CAAC;AAEvE,eAAO,MAAM,gBAAgB,4BAA6B,CAAC;AAE3D,eAAO,MAAM,cAAc,4CAA6C,CAAC;AAEzE,eAAO,MAAM,kBAAkB,4CAA6C,CAAC;AAE7E,eAAO,MAAM,iBAAiB,4CAA6C,CAAC;AAE5E,eAAO,MAAM,yBAAyB,qCAAsC,CAAC;AAE7E,eAAO,MAAM,kBAAkB,iCAAkC,CAAC;AAElE,KAAK,UAAU,GAAG,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;AAQpD,wBAAgB,OAAO,CACrB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MA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