freemium-ui 2.0.0-beta.56 → 2.0.0-beta.58
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/index.cjs.js +24 -21
- package/index.d.ts +6 -2
- package/index.js +24 -21
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -2267,7 +2267,7 @@ modal:!0}))}))``,Au=on(xu)``,ku=on(Hu)``,Tu=on(_u)``,Ru=on(Eu)`
|
|
|
2267
2267
|
line-height: ${({theme:e})=>e.typography.primary.lineHeight};
|
|
2268
2268
|
letter-spacing: 0px;
|
|
2269
2269
|
text-align: left;
|
|
2270
|
-
padding: 0 32px ${({$hasChildren:e})=>e?"
|
|
2270
|
+
padding: 0 32px ${({$hasChildren:e})=>e?"0px":"32px"} 32px;
|
|
2271
2271
|
`,Nu=on.div`
|
|
2272
2272
|
border-top: 1px solid ${({theme:e})=>e.colors.border.light};
|
|
2273
2273
|
border-bottom-right-radius: 8px;
|
|
@@ -15840,19 +15840,20 @@ const jj=Ej,$j=Hj,Uj=kj,Yj=Tj,Wj=on(Cj)``;on.div`
|
|
|
15840
15840
|
}
|
|
15841
15841
|
`,Jj=on.div`
|
|
15842
15842
|
display: flex;
|
|
15843
|
-
align-items:
|
|
15843
|
+
align-items: center;
|
|
15844
15844
|
padding: 16px;
|
|
15845
15845
|
gap: 16px;
|
|
15846
15846
|
`,e$=on.div`
|
|
15847
15847
|
height: 4px;
|
|
15848
|
-
background-color: ${({theme:e,toastType:t})=>e.colors.text.semantic[t
|
|
15849
|
-
width: 0%;
|
|
15848
|
+
background-color: ${({theme:e,toastType:t="success"})=>e.colors.text.semantic[t]};
|
|
15850
15849
|
border-radius: 4px 4px 0 0;
|
|
15851
|
-
|
|
15852
|
-
|
|
15853
|
-
|
|
15854
|
-
|
|
15855
|
-
|
|
15850
|
+
|
|
15851
|
+
${({delay:e,windowState:t})=>"none"===e?"width: 100%;":nn`
|
|
15852
|
+
width: 0%;
|
|
15853
|
+
animation: ${Kj} ${e}ms linear
|
|
15854
|
+
${"focus"===t?"running":"paused"};
|
|
15855
|
+
will-change: width;
|
|
15856
|
+
`}
|
|
15856
15857
|
`,t$=()=>{const[t,n]=e.useState(!1);return e.useEffect((()=>{
|
|
15857
15858
|
n(Boolean("undefined"!=typeof window&&window.document&&window.document.createElement))
|
|
15858
15859
|
}),[]),{isBrowser:t,isServer:!t}},n$=e=>{const t=document.createElement("div")
|
|
@@ -15874,20 +15875,22 @@ fill:n.colors.text.semantic.warning}))},o$=t=>{const n=qt()
|
|
|
15874
15875
|
fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{
|
|
15875
15876
|
fillRule:"evenodd",clipRule:"evenodd",
|
|
15876
15877
|
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",
|
|
15877
|
-
fill:n.colors.text.semantic.error}))},i$=({index:t,...
|
|
15878
|
-
const
|
|
15878
|
+
fill:n.colors.text.semantic.error}))},i$=({index:t,showProgress:n=!0,...r})=>{
|
|
15879
|
+
const a=qt(),{updateToasts:o,windowState:i}=e.useContext(hj)??{},l=e.useRef(null)
|
|
15879
15880
|
;return e.createElement(e.Fragment,null,e.createElement(qj,{role:"alert",
|
|
15880
|
-
"aria-live":"polite",ref:
|
|
15881
|
-
className:`ToastRoot Toast-${
|
|
15882
|
-
|
|
15883
|
-
|
|
15884
|
-
|
|
15885
|
-
|
|
15886
|
-
|
|
15887
|
-
fill:
|
|
15888
|
-
|
|
15881
|
+
"aria-live":"polite",ref:l,toastType:r.type,toastIndex:t,
|
|
15882
|
+
className:`ToastRoot Toast-${r.id??""}`.trim(),
|
|
15883
|
+
duration:r.fixed?1/0:r.delay??3e3,onOpenChange:e=>{
|
|
15884
|
+
e||o((e=>e.filter((e=>e.id!==r.id))))}},e.createElement(e$,{
|
|
15885
|
+
className:"ToastProgress",windowState:i,toastType:r.type,
|
|
15886
|
+
delay:!r.fixed&&n?r.delay??3e3:"none"
|
|
15887
|
+
}),e.createElement(Jj,null,r.customIcon?e.createElement(e.Fragment,null,r.customIcon):e.createElement(e.Fragment,null,"success"===r.type&&e.createElement(r$,{
|
|
15888
|
+
fill:a.colors.text.semantic.success}),"warning"===r.type&&e.createElement(a$,{
|
|
15889
|
+
fill:a.colors.text.semantic.warning}),"error"===r.type&&e.createElement(o$,{
|
|
15890
|
+
fill:a.colors.text.semantic.error})),e.createElement(Zj,{className:"ToastTitle"
|
|
15891
|
+
},r.text),e.createElement(Xj,{className:"ToastAction",asChild:!0,
|
|
15889
15892
|
altText:"Close","aria-label":"Close"
|
|
15890
|
-
},e.createElement(Zr,null,e.createElement(Mr,{fill:
|
|
15893
|
+
},e.createElement(Zr,null,e.createElement(Mr,{fill:a.colors.text.primary}))))))
|
|
15891
15894
|
},l$=()=>{const n=((t=gF())=>{
|
|
15892
15895
|
const n=`ui-${t}`,{isBrowser:r}=t$(),[a,o]=e.useState(r?n$(n):null)
|
|
15893
15896
|
;return e.useEffect((()=>{const e=document.querySelector(`#${n}`),t=e||n$(n)
|
package/index.d.ts
CHANGED
|
@@ -1482,11 +1482,15 @@ interface ToastType {
|
|
|
1482
1482
|
*/
|
|
1483
1483
|
customIcon?: React.ReactNode;
|
|
1484
1484
|
/**
|
|
1485
|
-
*
|
|
1485
|
+
* fixed toast on the screen
|
|
1486
|
+
* @default false
|
|
1487
|
+
*
|
|
1486
1488
|
*/
|
|
1487
1489
|
fixed?: boolean;
|
|
1488
1490
|
/**
|
|
1489
|
-
*
|
|
1491
|
+
* shows progress bar in the toast
|
|
1492
|
+
* takes delay as the duration
|
|
1493
|
+
* @default true
|
|
1490
1494
|
*/
|
|
1491
1495
|
showProgress?: boolean;
|
|
1492
1496
|
}
|
package/index.js
CHANGED
|
@@ -2266,7 +2266,7 @@ const{__scopeAlertDialog:t,...n}=e,r=Nu(t);return i(Vu,Vn({},r,n,{modal:!0}))
|
|
|
2266
2266
|
line-height: ${({theme:e})=>e.typography.primary.lineHeight};
|
|
2267
2267
|
letter-spacing: 0px;
|
|
2268
2268
|
text-align: left;
|
|
2269
|
-
padding: 0 32px ${({$hasChildren:e})=>e?"
|
|
2269
|
+
padding: 0 32px ${({$hasChildren:e})=>e?"0px":"32px"} 32px;
|
|
2270
2270
|
`,sd=En.div`
|
|
2271
2271
|
border-top: 1px solid ${({theme:e})=>e.colors.border.light};
|
|
2272
2272
|
border-bottom-right-radius: 8px;
|
|
@@ -16031,19 +16031,20 @@ const x$=l$,S$=u$,E$=m$,_$=v$,H$=En(r$)``;En.div`
|
|
|
16031
16031
|
}
|
|
16032
16032
|
`,I$=En.div`
|
|
16033
16033
|
display: flex;
|
|
16034
|
-
align-items:
|
|
16034
|
+
align-items: center;
|
|
16035
16035
|
padding: 16px;
|
|
16036
16036
|
gap: 16px;
|
|
16037
16037
|
`,P$=En.div`
|
|
16038
16038
|
height: 4px;
|
|
16039
|
-
background-color: ${({theme:e,toastType:t})=>e.colors.text.semantic[t
|
|
16040
|
-
width: 0%;
|
|
16039
|
+
background-color: ${({theme:e,toastType:t="success"})=>e.colors.text.semantic[t]};
|
|
16041
16040
|
border-radius: 4px 4px 0 0;
|
|
16042
|
-
|
|
16043
|
-
|
|
16044
|
-
|
|
16045
|
-
|
|
16046
|
-
|
|
16041
|
+
|
|
16042
|
+
${({delay:e,windowState:t})=>"none"===e?"width: 100%;":Mn`
|
|
16043
|
+
width: 0%;
|
|
16044
|
+
animation: ${V$} ${e}ms linear
|
|
16045
|
+
${"focus"===t?"running":"paused"};
|
|
16046
|
+
will-change: width;
|
|
16047
|
+
`}
|
|
16047
16048
|
`,R$=()=>{const[e,t]=m(!1);return f((()=>{
|
|
16048
16049
|
t(Boolean("undefined"!=typeof window&&window.document&&window.document.createElement))
|
|
16049
16050
|
}),[]),{isBrowser:e,isServer:!e}},O$=e=>{const t=document.createElement("div")
|
|
@@ -16065,20 +16066,22 @@ fill:n.colors.text.semantic.warning}))},B$=e=>{const n=vn()
|
|
|
16065
16066
|
fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{
|
|
16066
16067
|
fillRule:"evenodd",clipRule:"evenodd",
|
|
16067
16068
|
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",
|
|
16068
|
-
fill:n.colors.text.semantic.error}))},j$=({index:e,...
|
|
16069
|
-
const
|
|
16069
|
+
fill:n.colors.text.semantic.error}))},j$=({index:e,showProgress:n=!0,...r})=>{
|
|
16070
|
+
const a=vn(),{updateToasts:o,windowState:i}=t.useContext(Kj)??{},l=t.useRef(null)
|
|
16070
16071
|
;return t.createElement(t.Fragment,null,t.createElement(L$,{role:"alert",
|
|
16071
|
-
"aria-live":"polite",ref:
|
|
16072
|
-
className:`ToastRoot Toast-${
|
|
16073
|
-
onOpenChange:e=>{
|
|
16074
|
-
|
|
16075
|
-
|
|
16076
|
-
|
|
16077
|
-
|
|
16078
|
-
fill:
|
|
16079
|
-
|
|
16072
|
+
"aria-live":"polite",ref:l,toastType:r.type,toastIndex:e,
|
|
16073
|
+
className:`ToastRoot Toast-${r.id??""}`.trim(),
|
|
16074
|
+
duration:r.fixed?1/0:r.delay??3e3,onOpenChange:e=>{
|
|
16075
|
+
e||o((e=>e.filter((e=>e.id!==r.id))))}},t.createElement(P$,{
|
|
16076
|
+
className:"ToastProgress",windowState:i,toastType:r.type,
|
|
16077
|
+
delay:!r.fixed&&n?r.delay??3e3:"none"
|
|
16078
|
+
}),t.createElement(I$,null,r.customIcon?t.createElement(t.Fragment,null,r.customIcon):t.createElement(t.Fragment,null,"success"===r.type&&t.createElement(N$,{
|
|
16079
|
+
fill:a.colors.text.semantic.success}),"warning"===r.type&&t.createElement(F$,{
|
|
16080
|
+
fill:a.colors.text.semantic.warning}),"error"===r.type&&t.createElement(B$,{
|
|
16081
|
+
fill:a.colors.text.semantic.error})),t.createElement(A$,{className:"ToastTitle"
|
|
16082
|
+
},r.text),t.createElement(k$,{className:"ToastAction",asChild:!0,
|
|
16080
16083
|
altText:"Close","aria-label":"Close"
|
|
16081
|
-
},t.createElement(ga,null,t.createElement($r,{fill:
|
|
16084
|
+
},t.createElement(ga,null,t.createElement($r,{fill:a.colors.text.primary}))))))
|
|
16082
16085
|
},$$=()=>{const e=((e=XF())=>{
|
|
16083
16086
|
const t=`ui-${e}`,{isBrowser:n}=R$(),[r,a]=m(n?O$(t):null);return f((()=>{
|
|
16084
16087
|
const e=document.querySelector(`#${t}`),n=e||O$(t)
|