freemium-ui 2.0.0-beta.67 → 2.0.0-beta.68
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.js → index.cjs.js} +33 -29
- package/{dist/index.d.ts → index.d.ts} +8 -6
- package/{dist/index.js → index.js} +33 -29
- package/package.json +7 -61
- package/LICENSE +0 -21
- package/dist/README.md +0 -86
- package/dist/package.json +0 -74
|
@@ -15685,8 +15685,8 @@ animationDuration:h.current?"0s":void 0}}),r&&i)))
|
|
|
15685
15685
|
color: ${({theme:e})=>e.colors.text.disabled};
|
|
15686
15686
|
cursor: not-allowed;
|
|
15687
15687
|
}
|
|
15688
|
-
`,gj=e.createContext({toasts:[],windowState:"focus",
|
|
15689
|
-
updateToasts:()=>{}
|
|
15688
|
+
`,gj=e.createContext({toasts:[],windowState:"focus",retainOnHover:!0,
|
|
15689
|
+
retainOnWindowBlur:!1,addToast:()=>{},updateToasts:()=>{}
|
|
15690
15690
|
}),yj="ToastProvider",[bj,wj,Cj]=wn("Toast"),[zj,Mj]=dn("Toast",[Cj]),[xj,Ej]=zj(yj),Sj=t=>{
|
|
15691
15691
|
const{__scopeToast:n,label:r="Notification",duration:a=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:l}=t,[c,s]=e.useState(null),[u,d]=e.useState(0),h=e.useRef(!1),p=e.useRef(!1)
|
|
15692
15692
|
;return e.createElement(bj.Provider,{scope:n},e.createElement(xj,{scope:n,
|
|
@@ -15949,7 +15949,7 @@ const Gj=Vj,Kj=kj,qj=Oj,Zj=Nj,Xj=on(Sj)``;on.div`
|
|
|
15949
15949
|
display: flex;
|
|
15950
15950
|
align-items: center;
|
|
15951
15951
|
padding: 16px;
|
|
15952
|
-
gap:
|
|
15952
|
+
gap: 8px;
|
|
15953
15953
|
`,o$=on.div`
|
|
15954
15954
|
height: 4px;
|
|
15955
15955
|
background-color: ${({theme:e,toastType:t="success"})=>e.colors.text.semantic[t]};
|
|
@@ -15982,39 +15982,43 @@ fill:n.colors.text.semantic.warning}))},u$=t=>{const n=qt()
|
|
|
15982
15982
|
fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{
|
|
15983
15983
|
fillRule:"evenodd",clipRule:"evenodd",
|
|
15984
15984
|
d:"M8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C12.4183 16 16 12.4183 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0ZM8 14.6C4.35492 14.6 1.4 11.6451 1.4 8C1.4 4.35492 4.35492 1.4 8 1.4C11.6451 1.4 14.6 4.35492 14.6 8C14.5945 11.6428 11.6428 14.5945 8 14.6ZM9 8L10.82 6.17L10.83 6.18C11.1061 5.90386 11.1061 5.45614 10.83 5.18C10.5539 4.90386 10.1061 4.90386 9.83 5.18L8 7L6.18 5.17C5.90386 4.89386 5.45614 4.89386 5.18 5.17C4.90386 5.44614 4.90386 5.89386 5.18 6.17L7 8L5.17 9.82C4.89386 10.0961 4.89386 10.5439 5.17 10.82C5.44614 11.0961 5.89386 11.0961 6.17 10.82L8 9L9.83 10.83C10.1061 11.1061 10.5539 11.1061 10.83 10.83C11.1061 10.5539 11.1061 10.1061 10.83 9.83L9 8Z",
|
|
15985
|
-
fill:n.colors.text.semantic.error}))
|
|
15986
|
-
|
|
15985
|
+
fill:n.colors.text.semantic.error}))
|
|
15986
|
+
},d$=({index:t,customIcon:n,id:r,fixed:a,text:o,showProgress:i=!1,delay:l=3e3,type:c="info"})=>{
|
|
15987
|
+
const s=qt(),{updateToasts:u,windowState:d,retainOnWindowBlur:h,retainOnHover:p}=e.useContext(gj)??{},f=e.useRef(null),[m,v]=e.useState(!1)
|
|
15988
|
+
;e.useEffect((()=>{const e=window.setTimeout((()=>{
|
|
15989
|
+
a||m&&p||h||u((e=>e.filter((e=>e.id!==r))))}),l);return()=>clearTimeout(e)
|
|
15990
|
+
}),[l,a,r,u,m,p,h]);const g={success:e.createElement(c$,{
|
|
15991
|
+
fill:s.colors.text.semantic.success}),warning:e.createElement(s$,{
|
|
15992
|
+
fill:s.colors.text.semantic.warning}),error:e.createElement(u$,{
|
|
15993
|
+
fill:s.colors.text.semantic.error}),info:e.createElement(Hr,{
|
|
15994
|
+
fill:s.colors.text.semantic.info})}
|
|
15987
15995
|
;return e.createElement(e.Fragment,null,e.createElement(e$,{role:"alert",
|
|
15988
|
-
"aria-live":"polite",ref:
|
|
15989
|
-
|
|
15990
|
-
|
|
15991
|
-
e||
|
|
15992
|
-
className:"ToastProgress",windowState:
|
|
15993
|
-
|
|
15994
|
-
}),e.createElement(
|
|
15995
|
-
|
|
15996
|
-
fill:
|
|
15997
|
-
fill:a.colors.text.semantic.error})),e.createElement(t$,{className:"ToastTitle"
|
|
15998
|
-
},r.text),e.createElement(n$,{className:"ToastAction",asChild:!0,
|
|
15999
|
-
altText:"Close","aria-label":"Close"
|
|
16000
|
-
},e.createElement(Zr,null,e.createElement(Mr,{fill:a.colors.text.primary}))))))
|
|
16001
|
-
},h$=()=>{const n=((t=zF())=>{
|
|
15996
|
+
"aria-live":"polite",ref:f,toastType:c,style:a||!i?{border:"none"}:void 0,
|
|
15997
|
+
toastIndex:t,className:`ToastRoot Toast-${r??""}`.trim(),duration:a?1/0:l,
|
|
15998
|
+
onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onOpenChange:e=>{
|
|
15999
|
+
e||u((e=>e.filter((e=>e.id!==r))))}},e.createElement(o$,{
|
|
16000
|
+
className:"ToastProgress",windowState:d,toastType:c,delay:!a&&i?l:"none"
|
|
16001
|
+
}),e.createElement(a$,null,n??g[c],e.createElement(t$,{className:"ToastTitle"
|
|
16002
|
+
},o),e.createElement(n$,{className:"ToastAction",asChild:!0,altText:"Close",
|
|
16003
|
+
"aria-label":"Close"},e.createElement(Zr,null,e.createElement(Mr,{
|
|
16004
|
+
fill:s.colors.text.primary}))))))},h$=()=>{const n=((t=zF())=>{
|
|
16002
16005
|
const n=`ui-${t}`,{isBrowser:r}=i$(),[a,o]=e.useState(r?l$(n):null)
|
|
16003
16006
|
;return e.useEffect((()=>{const e=document.querySelector(`#${n}`),t=e||l$(n)
|
|
16004
16007
|
;e||document.body.appendChild(t),o(t)}),[]),a
|
|
16005
16008
|
})("toast"),{toasts:r}=e.useContext(gj)??{}
|
|
16006
16009
|
;return n?t.createPortal(e.createElement(e.Fragment,null,e.createElement(Xj,{
|
|
16007
16010
|
swipeDirection:"up"},r.map(((t,n)=>e.createElement(d$,{key:`Toast-${t.id}`,...t,
|
|
16008
|
-
index:n}))),e.createElement(r$,{className:"ToastViewport"}))),n):null
|
|
16009
|
-
|
|
16010
|
-
o
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16015
|
-
window.
|
|
16016
|
-
window.removeEventListener("
|
|
16017
|
-
|
|
16011
|
+
index:n}))),e.createElement(r$,{className:"ToastViewport"}))),n):null
|
|
16012
|
+
},p$=({children:t,retainOnHover:n=!0,retainOnWindowBlur:r=!1})=>{
|
|
16013
|
+
const[a,o]=e.useState("focus"),[i,l]=e.useState([]),c=e.useCallback((e=>{
|
|
16014
|
+
l((t=>[{...e,id:zF(),state:"open"},...t]))}),[]),s=e.useCallback((e=>{
|
|
16015
|
+
l((t=>e(t)))}),[]),u=e.useMemo((()=>({toasts:i,addToast:c,windowState:a,
|
|
16016
|
+
updateToasts:s,retainOnWindowBlur:r,retainOnHover:n})),[i,c,a,s])
|
|
16017
|
+
;return e.useEffect((()=>(window.addEventListener&&r&&(window.addEventListener("focus",(()=>{
|
|
16018
|
+
o("focus")}),!1),window.addEventListener("blur",(()=>{o("blur")}),!1)),()=>{
|
|
16019
|
+
r&&(window.removeEventListener("focus",(()=>{})),
|
|
16020
|
+
window.removeEventListener("blur",(()=>{})))
|
|
16021
|
+
})),[r]),e.createElement(gj.Provider,{value:u},e.createElement(h$,null),t)
|
|
16018
16022
|
},f$="Switch",[m$,v$]=dn(f$),[g$,y$]=m$(f$),b$=e.forwardRef(((t,n)=>{
|
|
16019
16023
|
const{__scopeSwitch:r,name:a,checked:o,defaultChecked:i,required:l,disabled:c,value:s="on",onCheckedChange:u,...d}=t,[h,p]=e.useState(null),f=fn(n,(e=>p(e))),m=e.useRef(!1),v=!h||Boolean(h.closest("form")),[g=!1,y]=Mn({
|
|
16020
16024
|
prop:o,defaultProp:i,onChange:u});return e.createElement(g$,{scope:r,checked:g,
|
|
@@ -1472,11 +1472,6 @@ type ThemeProviderType<Theme> = React.ComponentType<{
|
|
|
1472
1472
|
|
|
1473
1473
|
declare const ThemeProvider: ThemeProviderType<FreemiumUiTheme>;
|
|
1474
1474
|
|
|
1475
|
-
type ToastProviderProps = {
|
|
1476
|
-
children: react__default.ReactNode;
|
|
1477
|
-
};
|
|
1478
|
-
declare const ToastProvider: (props: ToastProviderProps) => react__default.JSX.Element;
|
|
1479
|
-
|
|
1480
1475
|
type ToastTypes = 'success' | 'warning' | 'error' | 'info';
|
|
1481
1476
|
interface ToastType {
|
|
1482
1477
|
/**
|
|
@@ -1504,7 +1499,7 @@ interface ToastType {
|
|
|
1504
1499
|
/**
|
|
1505
1500
|
* shows progress bar in the toast
|
|
1506
1501
|
* takes delay as the duration
|
|
1507
|
-
* @default
|
|
1502
|
+
* @default false
|
|
1508
1503
|
*/
|
|
1509
1504
|
showProgress?: boolean;
|
|
1510
1505
|
}
|
|
@@ -1518,10 +1513,17 @@ type UpdateToastsFunction<T> = (fn: (toasts: Array<T>) => Array<T>) => void;
|
|
|
1518
1513
|
interface ToastContextType {
|
|
1519
1514
|
toasts: Array<ToastWithID>;
|
|
1520
1515
|
windowState: 'focus' | 'blur';
|
|
1516
|
+
retainOnWindowBlur?: boolean;
|
|
1517
|
+
retainOnHover?: boolean;
|
|
1521
1518
|
addToast: (toast: ToastType) => void;
|
|
1522
1519
|
updateToasts: (fn: (oldToasts: ToastWithID[]) => ToastWithID[]) => void;
|
|
1523
1520
|
}
|
|
1524
1521
|
|
|
1522
|
+
interface ToastProviderProps extends Pick<ToastContextType, 'retainOnHover' | 'retainOnWindowBlur'> {
|
|
1523
|
+
children: react__default.ReactNode;
|
|
1524
|
+
}
|
|
1525
|
+
declare const ToastProvider: ({ children, retainOnHover, retainOnWindowBlur, }: ToastProviderProps) => react__default.JSX.Element;
|
|
1526
|
+
|
|
1525
1527
|
/**
|
|
1526
1528
|
* useToasts is a custom hook that returns the toasts and a function to add a new toast.
|
|
1527
1529
|
*/
|
|
@@ -15886,7 +15886,7 @@ className:"TabsRoot",value:s,defaultValue:i,onValueChange:o
|
|
|
15886
15886
|
disabled:e?.[a]},e?.[r])))),e.map((e=>t.createElement(qj,{
|
|
15887
15887
|
className:"TabsContent",value:e?.[n],key:e?.[n]
|
|
15888
15888
|
},c?c(e):null)))),Jj=t.createContext({toasts:[],windowState:"focus",
|
|
15889
|
-
addToast:()=>{},updateToasts:()=>{}
|
|
15889
|
+
retainOnHover:!0,retainOnWindowBlur:!1,addToast:()=>{},updateToasts:()=>{}
|
|
15890
15890
|
}),e$="ToastProvider",[t$,n$,r$]=Fn("Toast"),[a$,o$]=An("Toast",[r$]),[i$,l$]=a$(e$),c$=e=>{
|
|
15891
15891
|
const{__scopeToast:t,label:n="Notification",duration:a=5e3,swipeDirection:o="right",swipeThreshold:l=50,children:s}=e,[u,d]=m(null),[h,p]=m(0),f=r(!1),v=r(!1)
|
|
15892
15892
|
;return i(t$.Provider,{scope:t},i(i$,{scope:t,label:n,duration:a,
|
|
@@ -16142,7 +16142,7 @@ const D$=h$,V$=m$,A$=w$,L$=C$,k$=En(c$)``;En.div`
|
|
|
16142
16142
|
display: flex;
|
|
16143
16143
|
align-items: center;
|
|
16144
16144
|
padding: 16px;
|
|
16145
|
-
gap:
|
|
16145
|
+
gap: 8px;
|
|
16146
16146
|
`,B$=En.div`
|
|
16147
16147
|
height: 4px;
|
|
16148
16148
|
background-color: ${({theme:e,toastType:t="success"})=>e.colors.text.semantic[t]};
|
|
@@ -16175,40 +16175,44 @@ fill:n.colors.text.semantic.warning}))},W$=e=>{const n=vn()
|
|
|
16175
16175
|
fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{
|
|
16176
16176
|
fillRule:"evenodd",clipRule:"evenodd",
|
|
16177
16177
|
d:"M8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C12.4183 16 16 12.4183 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0ZM8 14.6C4.35492 14.6 1.4 11.6451 1.4 8C1.4 4.35492 4.35492 1.4 8 1.4C11.6451 1.4 14.6 4.35492 14.6 8C14.5945 11.6428 11.6428 14.5945 8 14.6ZM9 8L10.82 6.17L10.83 6.18C11.1061 5.90386 11.1061 5.45614 10.83 5.18C10.5539 4.90386 10.1061 4.90386 9.83 5.18L8 7L6.18 5.17C5.90386 4.89386 5.45614 4.89386 5.18 5.17C4.90386 5.44614 4.90386 5.89386 5.18 6.17L7 8L5.17 9.82C4.89386 10.0961 4.89386 10.5439 5.17 10.82C5.44614 11.0961 5.89386 11.0961 6.17 10.82L8 9L9.83 10.83C10.1061 11.1061 10.5539 11.1061 10.83 10.83C11.1061 10.5539 11.1061 10.1061 10.83 9.83L9 8Z",
|
|
16178
|
-
fill:n.colors.text.semantic.error}))
|
|
16179
|
-
|
|
16178
|
+
fill:n.colors.text.semantic.error}))
|
|
16179
|
+
},G$=({index:e,customIcon:n,id:r,fixed:a,text:o,showProgress:i=!1,delay:l=3e3,type:c="info"})=>{
|
|
16180
|
+
const s=vn(),{updateToasts:u,windowState:d,retainOnWindowBlur:h,retainOnHover:p}=t.useContext(Jj)??{},f=t.useRef(null),[m,v]=t.useState(!1)
|
|
16181
|
+
;t.useEffect((()=>{const e=window.setTimeout((()=>{
|
|
16182
|
+
a||m&&p||h||u((e=>e.filter((e=>e.id!==r))))}),l);return()=>clearTimeout(e)
|
|
16183
|
+
}),[l,a,r,u,m,p,h]);const g={success:t.createElement(U$,{
|
|
16184
|
+
fill:s.colors.text.semantic.success}),warning:t.createElement(Y$,{
|
|
16185
|
+
fill:s.colors.text.semantic.warning}),error:t.createElement(W$,{
|
|
16186
|
+
fill:s.colors.text.semantic.error}),info:t.createElement(Kr,{
|
|
16187
|
+
fill:s.colors.text.semantic.info})}
|
|
16180
16188
|
;return t.createElement(t.Fragment,null,t.createElement(P$,{role:"alert",
|
|
16181
|
-
"aria-live":"polite",ref:
|
|
16182
|
-
|
|
16183
|
-
|
|
16184
|
-
e||
|
|
16185
|
-
className:"ToastProgress",windowState:
|
|
16186
|
-
|
|
16187
|
-
}),t.createElement(
|
|
16188
|
-
|
|
16189
|
-
fill:
|
|
16190
|
-
fill:a.colors.text.semantic.error})),t.createElement(R$,{className:"ToastTitle"
|
|
16191
|
-
},r.text),t.createElement(O$,{className:"ToastAction",asChild:!0,
|
|
16192
|
-
altText:"Close","aria-label":"Close"
|
|
16193
|
-
},t.createElement(ga,null,t.createElement($r,{fill:a.colors.text.primary}))))))
|
|
16194
|
-
},K$=()=>{const e=((e=nB())=>{
|
|
16189
|
+
"aria-live":"polite",ref:f,toastType:c,style:a||!i?{border:"none"}:void 0,
|
|
16190
|
+
toastIndex:e,className:`ToastRoot Toast-${r??""}`.trim(),duration:a?1/0:l,
|
|
16191
|
+
onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onOpenChange:e=>{
|
|
16192
|
+
e||u((e=>e.filter((e=>e.id!==r))))}},t.createElement(B$,{
|
|
16193
|
+
className:"ToastProgress",windowState:d,toastType:c,delay:!a&&i?l:"none"
|
|
16194
|
+
}),t.createElement(F$,null,n??g[c],t.createElement(R$,{className:"ToastTitle"
|
|
16195
|
+
},o),t.createElement(O$,{className:"ToastAction",asChild:!0,altText:"Close",
|
|
16196
|
+
"aria-label":"Close"},t.createElement(ga,null,t.createElement($r,{
|
|
16197
|
+
fill:s.colors.text.primary}))))))},K$=()=>{const e=((e=nB())=>{
|
|
16195
16198
|
const t=`ui-${e}`,{isBrowser:n}=j$(),[r,a]=m(n?$$(t):null);return f((()=>{
|
|
16196
16199
|
const e=document.querySelector(`#${t}`),n=e||$$(t)
|
|
16197
16200
|
;e||document.body.appendChild(n),a(n)}),[]),r
|
|
16198
16201
|
})("toast"),{toasts:n}=t.useContext(Jj)??{}
|
|
16199
16202
|
;return e?M(t.createElement(t.Fragment,null,t.createElement(k$,{
|
|
16200
16203
|
swipeDirection:"up"},n.map(((e,n)=>t.createElement(G$,{key:`Toast-${e.id}`,...e,
|
|
16201
|
-
index:n}))),t.createElement(N$,{className:"ToastViewport"}))),e):null
|
|
16202
|
-
|
|
16203
|
-
o
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
window.
|
|
16209
|
-
window.removeEventListener("
|
|
16210
|
-
|
|
16211
|
-
|
|
16204
|
+
index:n}))),t.createElement(N$,{className:"ToastViewport"}))),e):null
|
|
16205
|
+
},q$=({children:e,retainOnHover:n=!0,retainOnWindowBlur:r=!1})=>{
|
|
16206
|
+
const[a,o]=t.useState("focus"),[i,l]=t.useState([]),c=t.useCallback((e=>{
|
|
16207
|
+
l((t=>[{...e,id:nB(),state:"open"},...t]))}),[]),s=t.useCallback((e=>{
|
|
16208
|
+
l((t=>e(t)))}),[]),u=t.useMemo((()=>({toasts:i,addToast:c,windowState:a,
|
|
16209
|
+
updateToasts:s,retainOnWindowBlur:r,retainOnHover:n})),[i,c,a,s])
|
|
16210
|
+
;return t.useEffect((()=>(window.addEventListener&&r&&(window.addEventListener("focus",(()=>{
|
|
16211
|
+
o("focus")}),!1),window.addEventListener("blur",(()=>{o("blur")}),!1)),()=>{
|
|
16212
|
+
r&&(window.removeEventListener("focus",(()=>{})),
|
|
16213
|
+
window.removeEventListener("blur",(()=>{})))
|
|
16214
|
+
})),[r]),t.createElement(Jj.Provider,{value:u},t.createElement(K$,null),e)
|
|
16215
|
+
},Z$=()=>{const{toasts:e,addToast:n}=t.useContext(Jj)??{};return[e,n]
|
|
16212
16216
|
},X$=e=>t.createElement(gn,{theme:e.theme
|
|
16213
16217
|
},t.createElement(q$,null,e.children)),Q$="Switch",[J$,eU]=An(Q$),[tU,nU]=J$(Q$),rU=s(((e,t)=>{
|
|
16214
16218
|
const{__scopeSwitch:n,name:a,checked:o,defaultChecked:l,required:c,disabled:s,value:u="on",onCheckedChange:d,...h}=e,[p,f]=m(null),v=Tn(t,(e=>f(e))),g=r(!1),y=!p||Boolean(p.closest("form")),[b=!1,w]=$n({
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "freemium-ui",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.68",
|
|
4
4
|
"description": "React Ui Components for Freemium Apps",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "
|
|
7
|
-
"typings": "
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"typings": "./index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@blueprintjs/datetime2": "^2.3.3",
|
|
10
10
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -34,61 +34,6 @@
|
|
|
34
34
|
"styled-components": "^6.1.8",
|
|
35
35
|
"typescript": "^4.9.5"
|
|
36
36
|
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
39
|
-
"@rollup/plugin-commonjs": "^25.0.7",
|
|
40
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
41
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
42
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
43
|
-
"@storybook/addon-essentials": "^8.0.5",
|
|
44
|
-
"@storybook/addon-interactions": "^8.0.5",
|
|
45
|
-
"@storybook/addon-links": "^8.0.5",
|
|
46
|
-
"@storybook/addon-onboarding": "^8.0.5",
|
|
47
|
-
"@storybook/blocks": "^8.0.5",
|
|
48
|
-
"@storybook/preset-create-react-app": "^8.0.5",
|
|
49
|
-
"@storybook/preview-api": "^8.0.5",
|
|
50
|
-
"@storybook/react": "^8.0.5",
|
|
51
|
-
"@storybook/react-webpack5": "^8.0.5",
|
|
52
|
-
"@types/node": "^16.18.64",
|
|
53
|
-
"@types/react": "^18.2.73",
|
|
54
|
-
"@types/react-dom": "^18.2.22",
|
|
55
|
-
"@types/react-transition-group": "^4.4.10",
|
|
56
|
-
"@types/rollup-plugin-generate-package-json": "^3.2.9",
|
|
57
|
-
"@types/rollup-plugin-peer-deps-external": "^2.2.5",
|
|
58
|
-
"@types/styled-components": "^5.1.34",
|
|
59
|
-
"babel-plugin-named-exports-order": "^0.0.2",
|
|
60
|
-
"eslint-plugin-storybook": "^0.8.0",
|
|
61
|
-
"husky": "^9.0.11",
|
|
62
|
-
"postcss": "^8.4.38",
|
|
63
|
-
"prettier": "^3.2.5",
|
|
64
|
-
"prop-types": "^15.8.1",
|
|
65
|
-
"rollup": "^4.13.1",
|
|
66
|
-
"rollup-plugin-dts": "^6.1.0",
|
|
67
|
-
"rollup-plugin-generate-package-json": "^3.2.0",
|
|
68
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
69
|
-
"storybook": "^8.0.5",
|
|
70
|
-
"webpack": "^5.91.0"
|
|
71
|
-
},
|
|
72
|
-
"scripts": {
|
|
73
|
-
"version:beta": "npm version prerelease --preid=beta",
|
|
74
|
-
"publish:beta": "npm publish ./dist --tag beta",
|
|
75
|
-
"publish": "npm publish ./dist",
|
|
76
|
-
"prepublishOnly": "npm run build",
|
|
77
|
-
"start": "react-scripts start",
|
|
78
|
-
"build:react-app": "react-scripts build",
|
|
79
|
-
"build": "npm run rollup && npm run post:build",
|
|
80
|
-
"post:build": "node ./scripts/frankBuild.js",
|
|
81
|
-
"rollup": "rm -rf dist && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
82
|
-
"test": "react-scripts test",
|
|
83
|
-
"eject": "react-scripts eject",
|
|
84
|
-
"check": "prettier --check .",
|
|
85
|
-
"format": "prettier --write .",
|
|
86
|
-
"storybook": "storybook dev -p 6006",
|
|
87
|
-
"build-storybook": "storybook build",
|
|
88
|
-
"typescript": "tsc -p tsconfig.json",
|
|
89
|
-
"upgrade-packages": "npx npm-check-updates -i",
|
|
90
|
-
"prepare": "husky install"
|
|
91
|
-
},
|
|
92
37
|
"repository": {
|
|
93
38
|
"type": "git",
|
|
94
39
|
"url": "git+https://github.com/freshdesk/freemium-ui.git"
|
|
@@ -124,5 +69,6 @@
|
|
|
124
69
|
"last 1 firefox version",
|
|
125
70
|
"last 1 safari version"
|
|
126
71
|
]
|
|
127
|
-
}
|
|
128
|
-
|
|
72
|
+
},
|
|
73
|
+
"private": false
|
|
74
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Freshworks
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/README.md
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<h1 align="center">Freemium Ui</h1>
|
|
2
|
-
|
|
3
|
-
## [DEMO](https://freemium-ui.netlify.app)
|
|
4
|
-
|
|
5
|
-
[React](https://reactjs.org/) based light weight ui components based on [Styled Components](https://styled-components.com/)
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
Peer Dependencies to be installed
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
npm install styled-components
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Install the package
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
npm install freemium-ui
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Please note that `@next` will only point to pre-releases; to get the latest stable release use `@latest` instead.
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
Here is a quick example to get you started, **it's all you need**:
|
|
26
|
-
|
|
27
|
-
```jsx
|
|
28
|
-
import React from 'react';
|
|
29
|
-
import ReactDOM from 'react-dom';
|
|
30
|
-
import { Button } from 'freemium-ui';
|
|
31
|
-
// import { Button } from 'freemium-ui/Button';
|
|
32
|
-
|
|
33
|
-
function App() {
|
|
34
|
-
return <Button>Freemium Button</Button>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
ReactDOM.render(<App />, document.querySelector('#app'));
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Contribution
|
|
41
|
-
|
|
42
|
-
Install Dependencies
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
npm install
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Start the app using storybook
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
npm run storybook
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Build Freemium Ui Core Components
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
npm run build
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
JavaScript heap out of memory could lead to build failure. Check the [official docs](https://rollupjs.org/troubleshooting/#error-javascript-heap-out-of-memory). Or execute any of the required below config
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
export NODE_OPTIONS="--max-old-space-size=8192"
|
|
64
|
-
export NODE_OPTIONS="--max-old-space-size=12288"
|
|
65
|
-
export NODE_OPTIONS="--max-old-space-size=16384"
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
To check the heap size in MB
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))'
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Generate a PAT with `admin:org`, `write:packages`, `read:packages`, `delete:packages`
|
|
75
|
-
|
|
76
|
-
Authenticate to npm github package
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
npm login --registry=https://registry.npmjs.org/
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Publish the package to npm
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
npm publish
|
|
86
|
-
```
|
package/dist/package.json
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "freemium-ui",
|
|
3
|
-
"version": "2.0.0-beta.67",
|
|
4
|
-
"description": "React Ui Components for Freemium Apps",
|
|
5
|
-
"main": "./index.js",
|
|
6
|
-
"module": "./index.js",
|
|
7
|
-
"typings": "./index.d.ts",
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"@blueprintjs/datetime2": "^2.3.3",
|
|
10
|
-
"@dnd-kit/core": "^6.1.0",
|
|
11
|
-
"@dnd-kit/modifiers": "^7.0.0",
|
|
12
|
-
"@dnd-kit/sortable": "^8.0.0",
|
|
13
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
14
|
-
"@radix-ui/react-accordion": "^1.1.2",
|
|
15
|
-
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
16
|
-
"@radix-ui/react-avatar": "^1.0.4",
|
|
17
|
-
"@radix-ui/react-checkbox": "^1.0.4",
|
|
18
|
-
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
|
19
|
-
"@radix-ui/react-label": "^2.0.2",
|
|
20
|
-
"@radix-ui/react-popover": "^1.0.7",
|
|
21
|
-
"@radix-ui/react-radio-group": "^1.1.3",
|
|
22
|
-
"@radix-ui/react-select": "^2.0.0",
|
|
23
|
-
"@radix-ui/react-switch": "^1.0.3",
|
|
24
|
-
"@radix-ui/react-tabs": "^1.0.4",
|
|
25
|
-
"@radix-ui/react-toast": "^1.1.5",
|
|
26
|
-
"@radix-ui/react-tooltip": "^1.0.7",
|
|
27
|
-
"@tanstack/react-table": "^8.15.0",
|
|
28
|
-
"downshift": "^9.0.0",
|
|
29
|
-
"moment": "^2.30.1",
|
|
30
|
-
"react": "^18.2.0",
|
|
31
|
-
"react-dom": "^18.2.0",
|
|
32
|
-
"react-quill": "^2.0.0",
|
|
33
|
-
"react-scripts": "5.0.1",
|
|
34
|
-
"styled-components": "^6.1.8",
|
|
35
|
-
"typescript": "^4.9.5"
|
|
36
|
-
},
|
|
37
|
-
"repository": {
|
|
38
|
-
"type": "git",
|
|
39
|
-
"url": "git+https://github.com/freshdesk/freemium-ui.git"
|
|
40
|
-
},
|
|
41
|
-
"publishConfig": {
|
|
42
|
-
"registry": "https://registry.npmjs.org/"
|
|
43
|
-
},
|
|
44
|
-
"keywords": [
|
|
45
|
-
"Freemiui",
|
|
46
|
-
"React",
|
|
47
|
-
"UI",
|
|
48
|
-
"Material"
|
|
49
|
-
],
|
|
50
|
-
"author": "Freshworks",
|
|
51
|
-
"bugs": {
|
|
52
|
-
"url": "https://github.com/freshdesk/freemium-ui/issues"
|
|
53
|
-
},
|
|
54
|
-
"homepage": "https://github.com/freshdesk/freemium-ui#readme",
|
|
55
|
-
"eslintConfig": {
|
|
56
|
-
"extends": [
|
|
57
|
-
"react-app",
|
|
58
|
-
"plugin:storybook/recommended"
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
"browserslist": {
|
|
62
|
-
"production": [
|
|
63
|
-
">0.2%",
|
|
64
|
-
"not dead",
|
|
65
|
-
"not op_mini all"
|
|
66
|
-
],
|
|
67
|
-
"development": [
|
|
68
|
-
"last 1 chrome version",
|
|
69
|
-
"last 1 firefox version",
|
|
70
|
-
"last 1 safari version"
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
"private": false
|
|
74
|
-
}
|