freemium-ui 2.0.0-beta.45 → 2.0.0-beta.46

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 CHANGED
@@ -16079,18 +16079,19 @@ disabled:t?.disabled,className:"DropdownMenuItem",key:t?.[i],onSelect:()=>c?.(t)
16079
16079
  exports.CardActions=Sn,exports.CardContent=En,exports.CardDescription=Hn,
16080
16080
  exports.CardText=Dn,
16081
16081
  exports.CardTitle=_n,exports.Checkbox=Ac,exports.ChevronUp=rr,
16082
- exports.Confirmation=({isOpen:t,title:n,description:r,onConfirm:a,onDismiss:o,cancelButtonText:i,children:l,cancelButtonDisabled:c,confirmButtonDisabled:s,confirmButtonText:u,bodyStyles:d,contentStyles:h,footerStyles:p,width:f="520px"})=>e.createElement(Ds,{
16082
+ exports.Confirmation=({isOpen:t,title:n,description:r,onConfirm:a,onDismiss:o,cancelButtonText:i,children:l,cancelButtonDisabled:c,confirmButtonDisabled:s,confirmButtonText:u,clickOutToClose:d=!1,bodyStyles:h,contentStyles:p,footerStyles:f,width:m="520px"})=>e.createElement(Ds,{
16083
16083
  open:t,onOpenChange:e=>{e||o?.("root")}
16084
- },e.createElement(Ls,null,e.createElement(ks,{forceMount:!0,style:d,
16085
- className:"AlertDialogOverlay",onClick:()=>o?.("overlay")}),e.createElement(Ts,{
16086
- forceMount:!0,className:"AlertDialogContent",style:{...h,width:f}
16087
- },n&&e.createElement(Rs,{className:"AlertDialogTitle"
16084
+ },e.createElement(Ls,null,e.createElement(ks,{forceMount:!0,style:h,
16085
+ className:"AlertDialogOverlay",onClick:e=>{d&&o?.("overlay",e)}
16086
+ }),e.createElement(Ts,{forceMount:!0,className:"AlertDialogContent",style:{...p,
16087
+ width:m}},n&&e.createElement(Rs,{className:"AlertDialogTitle"
16088
16088
  },n),r&&e.createElement(Ps,{$hasChildren:!!l,className:"AlertDialogDescription"
16089
- },r),l?e.createElement(e.Fragment,null,l):null,e.createElement(Is,{style:p
16089
+ },r),l?e.createElement(e.Fragment,null,l):null,e.createElement(Is,{style:f
16090
16090
  },i&&e.createElement(Vs,{asChild:!0},e.createElement(tr,{variant:"secondary",
16091
- autoFocus:!0,"aria-disabled":c,disabled:c,onClick:()=>o?.("button"),
16092
- "aria-label":i},i)),u&&e.createElement(As,{asChild:!0},e.createElement(tr,{
16093
- variant:"primary","aria-disabled":s,disabled:s,onClick:()=>a?.(),"aria-label":u
16091
+ autoFocus:!0,"aria-disabled":c,disabled:c,onClick:e=>{
16092
+ e.preventDefault(),o?.("button",e)},"aria-label":i},i)),u&&e.createElement(As,{
16093
+ asChild:!0},e.createElement(tr,{variant:"primary","aria-disabled":s,disabled:s,
16094
+ onClick:e=>{e.preventDefault(),a?.(e)},"aria-label":u
16094
16095
  },u)))))),exports.CrossIcon=qn,exports.DatePicker=t=>{
16095
16096
  const{placeholder:n,name:r,isRequired:a,label:o,isErrored:i,errorText:l,id:c,disabled:s,displayFormat:u="YYYY-MM-DD",...d}=t
16096
16097
  ;return e.createElement(jR,{id:`date-picker-container-${c??""}`.trim(),
package/index.d.ts CHANGED
@@ -253,6 +253,10 @@ interface ConfirmationProps {
253
253
  * Is the cancel button disabled
254
254
  */
255
255
  cancelButtonDisabled?: boolean;
256
+ /**
257
+ * Should the confirmation close when clicking outside
258
+ */
259
+ clickOutToClose?: boolean;
256
260
  /**
257
261
  * Title of the confirmation
258
262
  */
@@ -268,11 +272,11 @@ interface ConfirmationProps {
268
272
  /**
269
273
  * Function to be called when the confirmation is dismissed
270
274
  */
271
- onDismiss?: (type: 'overlay' | 'button' | 'root') => void;
275
+ onDismiss?: (type: 'overlay' | 'button' | 'root', event?: React.MouseEvent<HTMLElement, MouseEvent>) => void;
272
276
  /**
273
277
  * Function to be called when the confirmation is confirmed
274
278
  */
275
- onConfirm?: () => void;
279
+ onConfirm?: React.DOMAttributes<HTMLButtonElement>['onClick'];
276
280
  /**
277
281
  * Confirm button text
278
282
  */
@@ -298,7 +302,7 @@ interface ConfirmationProps {
298
302
  /**
299
303
  * Confirmation component is used to show a confirmation dialog to the user. It is used to confirm an action before it is executed.
300
304
  */
301
- declare const Confirmation: ({ isOpen, title, description, onConfirm, onDismiss, cancelButtonText, children, cancelButtonDisabled, confirmButtonDisabled, confirmButtonText, bodyStyles, contentStyles, footerStyles, width, }: ConfirmationProps) => react__default.JSX.Element;
305
+ declare const Confirmation: ({ isOpen, title, description, onConfirm, onDismiss, cancelButtonText, children, cancelButtonDisabled, confirmButtonDisabled, confirmButtonText, clickOutToClose, bodyStyles, contentStyles, footerStyles, width, }: ConfirmationProps) => react__default.JSX.Element;
302
306
 
303
307
  type DrawerSizeType = 'default' | 'medium' | 'small' | 'large' | 'x-large';
304
308
  type DrawerPlacement = 'left' | 'right';
package/index.js CHANGED
@@ -2068,21 +2068,21 @@ const{__scopeAlertDialog:t,...n}=e,r=Is(t);return i(_s,Ln({},r,n,{modal:!0}))
2068
2068
  padding: 16px;
2069
2069
  gap: 8px;
2070
2070
  justify-content: flex-end;
2071
- `,lu=({isOpen:e,title:n,description:r,onConfirm:a,onDismiss:o,cancelButtonText:i,children:l,cancelButtonDisabled:c,confirmButtonDisabled:s,confirmButtonText:u,bodyStyles:d,contentStyles:h,footerStyles:p,width:f="520px"})=>t.createElement(Qs,{
2071
+ `,lu=({isOpen:e,title:n,description:r,onConfirm:a,onDismiss:o,cancelButtonText:i,children:l,cancelButtonDisabled:c,confirmButtonDisabled:s,confirmButtonText:u,clickOutToClose:d=!1,bodyStyles:h,contentStyles:p,footerStyles:f,width:m="520px"})=>t.createElement(Qs,{
2072
2072
  open:e,onOpenChange:e=>{e||o?.("root")}
2073
- },t.createElement(Js,null,t.createElement(nu,{forceMount:!0,style:d,
2074
- className:"AlertDialogOverlay",onClick:()=>o?.("overlay")}),t.createElement(ru,{
2075
- forceMount:!0,className:"AlertDialogContent",style:{...h,width:f}
2076
- },n&&t.createElement(au,{className:"AlertDialogTitle"
2073
+ },t.createElement(Js,null,t.createElement(nu,{forceMount:!0,style:h,
2074
+ className:"AlertDialogOverlay",onClick:e=>{d&&o?.("overlay",e)}
2075
+ }),t.createElement(ru,{forceMount:!0,className:"AlertDialogContent",style:{...p,
2076
+ width:m}},n&&t.createElement(au,{className:"AlertDialogTitle"
2077
2077
  },n),r&&t.createElement(ou,{$hasChildren:!!l,className:"AlertDialogDescription"
2078
- },r),l?t.createElement(t.Fragment,null,l):null,t.createElement(iu,{style:p
2078
+ },r),l?t.createElement(t.Fragment,null,l):null,t.createElement(iu,{style:f
2079
2079
  },i&&t.createElement(eu,{asChild:!0},t.createElement(zr,{variant:"secondary",
2080
- autoFocus:!0,"aria-disabled":c,disabled:c,onClick:()=>o?.("button"),
2081
- "aria-label":i},i)),u&&t.createElement(tu,{asChild:!0},t.createElement(zr,{
2082
- variant:"primary","aria-disabled":s,disabled:s,onClick:()=>a?.(),"aria-label":u
2083
- },u)))))),cu={right:{x:"0",right:"0",top:"0"},left:{x:"0",left:"0",top:"0"}
2084
- },su={small:"424px",default:"600px",medium:"720px",large:"800px",
2085
- "x-large":"1200px"},uu=Hn`
2080
+ autoFocus:!0,"aria-disabled":c,disabled:c,onClick:e=>{
2081
+ e.preventDefault(),o?.("button",e)},"aria-label":i},i)),u&&t.createElement(tu,{
2082
+ asChild:!0},t.createElement(zr,{variant:"primary","aria-disabled":s,disabled:s,
2083
+ onClick:e=>{e.preventDefault(),a?.(e)},"aria-label":u},u)))))),cu={right:{x:"0",
2084
+ right:"0",top:"0"},left:{x:"0",left:"0",top:"0"}},su={small:"424px",
2085
+ default:"600px",medium:"720px",large:"800px","x-large":"1200px"},uu=Hn`
2086
2086
  from {
2087
2087
  opacity: 1;
2088
2088
  transform: translate(0px, 0px);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.0-beta.45",
3
+ "version": "2.0.0-beta.46",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",