freemium-ui 2.0.0-beta.64 → 2.0.0-beta.66
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 +47 -45
- package/index.d.ts +8 -2
- package/index.js +813 -811
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -2042,7 +2042,7 @@ name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:Cn((e=>{
|
|
|
2042
2042
|
font-size: 12px;
|
|
2043
2043
|
font-weight: 400;
|
|
2044
2044
|
line-height: 20px;
|
|
2045
|
-
`,ws=t=>e.createElement(bs,{
|
|
2045
|
+
`,ws=t=>e.createElement(bs,{"aria-live":"polite",role:"status",...t,
|
|
2046
2046
|
className:`input-helper ${t.className??""}`.trim()
|
|
2047
2047
|
},t.children),Cs="Checkbox",[zs,Ms]=dn(Cs),[xs,Es]=zs(Cs),Ss=e.forwardRef(((t,n)=>{
|
|
2048
2048
|
const{__scopeCheckbox: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({
|
|
@@ -2259,7 +2259,8 @@ modal:!0}))}))``,Au=on(xu)``,ku=on(Hu)``,Tu=on(_u)``,Ru=on(Eu)`
|
|
|
2259
2259
|
line-height: ${({theme:e})=>e.typography.heading4.lineHeight};
|
|
2260
2260
|
font-weight: ${({theme:e})=>e.typography.fontWeight["semi-bold"]};
|
|
2261
2261
|
margin: 0;
|
|
2262
|
-
padding: 32px 32px
|
|
2262
|
+
padding: 32px 32px
|
|
2263
|
+
${({$hasdescription:e})=>e?"0px":"16px"} 32px;
|
|
2263
2264
|
`,Ou=on(Vu)`
|
|
2264
2265
|
font-family: ${({theme:e})=>e.typography.fontFamily};
|
|
2265
2266
|
font-size: ${({theme:e})=>e.typography.primary.fontSize};
|
|
@@ -2267,7 +2268,7 @@ modal:!0}))}))``,Au=on(xu)``,ku=on(Hu)``,Tu=on(_u)``,Ru=on(Eu)`
|
|
|
2267
2268
|
line-height: ${({theme:e})=>e.typography.primary.lineHeight};
|
|
2268
2269
|
letter-spacing: 0px;
|
|
2269
2270
|
text-align: left;
|
|
2270
|
-
padding: 0 32px
|
|
2271
|
+
padding: 0 32px 0px 32px;
|
|
2271
2272
|
`,Nu=on.div`
|
|
2272
2273
|
border-top: 1px solid ${({theme:e})=>e.colors.border.light};
|
|
2273
2274
|
border-bottom-right-radius: 8px;
|
|
@@ -12785,16 +12786,16 @@ ref:n}))})),mI=on(oI)`
|
|
|
12785
12786
|
}
|
|
12786
12787
|
`,vI=on(fI)`
|
|
12787
12788
|
fill: white;
|
|
12788
|
-
`,gI=on(uI)``,yI=on(dI)``,bI=on(hI)``,wI=on(pI)``,CI=({children:t,trigger:n,arrow:r,hoverOutToClose:a,align:o,hoverToOpen:i,avoidCollisions:l=!0,replaceTrigger:c=!1,side:s,disabled:u,onClose:d,
|
|
12789
|
-
const[
|
|
12790
|
-
;return e.createElement(gI,{open:
|
|
12789
|
+
`,gI=on(uI)``,yI=on(dI)``,bI=on(hI)``,wI=on(pI)``,CI=({children:t,trigger:n,arrow:r,hoverOutToClose:a,align:o,hoverToOpen:i,avoidCollisions:l=!0,replaceTrigger:c=!1,side:s,disabled:u,onClose:d,popoverContentProps:h,popoverRootProps:p,anchorOrigin:f,autoCloseDuration:m,clickOutToClose:v,transformOrigin:g})=>{
|
|
12790
|
+
const[y,b]=e.useState(!1),w=s??("bottom"===f?.vertical&&f.horizontal?"bottom":void 0)??("top"===f?.vertical&&f.horizontal?"top":void 0)??("center"===f?.vertical&&"left"===f.horizontal?"left":void 0)??("center"===f?.vertical&&"right"===f.horizontal?"right":void 0)??"bottom"
|
|
12791
|
+
;return e.createElement(gI,{open:y,onOpenChange:e=>{b(e)},...p
|
|
12791
12792
|
},c?e.createElement(e.Fragment,null,n):e.createElement(yI,{asChild:!0,
|
|
12792
12793
|
className:"PopoverTrigger",disabled:u},e.createElement(Zr,{
|
|
12793
|
-
className:"TriggerButtonWrapper",onMouseEnter:()=>{i&&
|
|
12794
|
+
className:"TriggerButtonWrapper",onMouseEnter:()=>{i&&b(!0)}
|
|
12794
12795
|
},n)),e.createElement(bI,null,e.createElement(mI,{forceMount:!0,
|
|
12795
|
-
className:"PopoverContent",onMouseLeave:()=>{a&&(
|
|
12796
|
-
onInteractOutside:()=>d?.(),side:
|
|
12797
|
-
},t,r&&e.createElement(vI,null))))},zI=on.div``,MI=on(ls)`
|
|
12796
|
+
className:"PopoverContent",onMouseLeave:()=>{a&&(b(!1),d?.())},
|
|
12797
|
+
onInteractOutside:()=>{b(!1),d?.()},side:w,align:o,sideOffset:8,
|
|
12798
|
+
avoidCollisions:l,...h},t,r&&e.createElement(vI,null))))},zI=on.div``,MI=on(ls)`
|
|
12798
12799
|
display: flex;
|
|
12799
12800
|
flex-direction: column;
|
|
12800
12801
|
gap: 4px;
|
|
@@ -16295,8 +16296,9 @@ open:t,onOpenChange:e=>{e||o?.("root")}
|
|
|
16295
16296
|
},e.createElement(Au,null,e.createElement(Ru,{forceMount:!0,style:h,
|
|
16296
16297
|
className:"AlertDialogOverlay",onClick:e=>{d&&o?.("overlay",e)}
|
|
16297
16298
|
}),e.createElement(Pu,{forceMount:!0,className:"AlertDialogContent",style:{...p,
|
|
16298
|
-
width:m}},n&&e.createElement(Iu,{
|
|
16299
|
-
},n),r&&e.createElement(Ou,{$hasChildren:!!l,
|
|
16299
|
+
width:m}},n&&e.createElement(Iu,{$hasdescription:!!r,
|
|
16300
|
+
className:"AlertDialogTitle"},n),r&&e.createElement(Ou,{$hasChildren:!!l,
|
|
16301
|
+
className:"AlertDialogDescription"
|
|
16300
16302
|
},r),l?e.createElement(e.Fragment,null,l):null,e.createElement(Nu,{style:f
|
|
16301
16303
|
},i&&e.createElement(ku,{asChild:!0},e.createElement(wa,{variant:"secondary",
|
|
16302
16304
|
autoFocus:!0,"aria-disabled":c,disabled:c,onClick:e=>{
|
|
@@ -16378,54 +16380,54 @@ open:t,onOpenChange:e=>{e||l?.()}},e.createElement(dv,null,e.createElement(hv,{
|
|
|
16378
16380
|
forceMount:!0,className:"DialogOverlay",onClick:()=>l?.()}),e.createElement(pv,{
|
|
16379
16381
|
forceMount:!0,className:`DialogContent ${a??""}`.trim(),size:s??"default",
|
|
16380
16382
|
fullWidth:o,align:r,position:c,style:i
|
|
16381
|
-
},n))),exports.MoreVertical=Vr,exports.MultiSelectDropdown=({itemIdentifier:t="id",label:n,id:r,items:a=[],onChange:o,placeholder:i,readOnly:l=!1,disabled:c=!1,isRequired:s=!1,itemToString:u,name:d,filterKey:h,width:p,useComboboxProps:f,useMultipleSelectionProps:m,emptyItemsText:v,getCustomMessage:g,onCustomValueAdd:y,customValues:b,inputValue:w,hideClear:C,
|
|
16382
|
-
const
|
|
16383
|
-
initialSelectedItems:
|
|
16383
|
+
},n))),exports.MoreVertical=Vr,exports.MultiSelectDropdown=({itemIdentifier:t="id",label:n,id:r,items:a=[],onChange:o,placeholder:i,readOnly:l=!1,disabled:c=!1,isRequired:s=!1,itemToString:u,name:d,filterKey:h,width:p,useComboboxProps:f,useMultipleSelectionProps:m,emptyItemsText:v,getCustomMessage:g,onCustomValueAdd:y,customValues:b,inputValue:w,hideClear:C,hideArrow:z,removeSelectedItem:M,defaultSelectedItems:x=[],handleInputChange:E,isErrored:S,isMenuLoading:_,errorText:H,InputProps:D,itemComponent:V,isDynamicMenu:L,locale:A,maxAllowedLength:k,minAllowedLength:T,hideChips:R=!1,hideSelectedItem:P=!1,onBackSpace:I})=>{
|
|
16384
|
+
const O=qt(),[N,F]=e.useState(w??""),{getSelectedItemProps:B,getDropdownProps:j,selectedItems:$,removeSelectedItem:U,setSelectedItems:Y,addSelectedItem:W}=Bm({
|
|
16385
|
+
initialSelectedItems:x,onStateChange:({selectedItems:e,type:t})=>{switch(t){
|
|
16384
16386
|
case Bm.stateChangeTypes.FunctionSetSelectedItems:
|
|
16385
16387
|
case Bm.stateChangeTypes.SelectedItemKeyDownBackspace:
|
|
16386
16388
|
case Bm.stateChangeTypes.SelectedItemKeyDownDelete:
|
|
16387
16389
|
case Bm.stateChangeTypes.DropdownKeyDownBackspace:
|
|
16388
16390
|
case Bm.stateChangeTypes.FunctionRemoveSelectedItem:
|
|
16389
16391
|
case Bm.stateChangeTypes.FunctionAddSelectedItem:e&&o?.(e)}},...m
|
|
16390
|
-
}),
|
|
16391
|
-
;return!(
|
|
16392
|
-
}))),[a,
|
|
16393
|
-
id:r,items:
|
|
16394
|
-
inputValue:
|
|
16392
|
+
}),G=e.useMemo((()=>a.filter((e=>{const n="string"==typeof e?e:e?.[h||t]
|
|
16393
|
+
;return!(P&&$.some((t=>u?.(t)===u?.(e))))&&(!N||n.toLowerCase().includes(N.toLowerCase()))
|
|
16394
|
+
}))),[a,N,h,t,P,$,u]),{isOpen:K,getToggleButtonProps:q,getLabelProps:Z,getMenuProps:X,getInputProps:Q,highlightedIndex:J,getItemProps:ee}=fm({
|
|
16395
|
+
id:r,items:G,itemToString:e=>e&&u?u(e,"downshift"):"",selectedItem:null,
|
|
16396
|
+
inputValue:N,stateReducer:(e,t)=>{const{changes:n,type:r}=t;switch(r){
|
|
16395
16397
|
case fm.stateChangeTypes.InputKeyDownEnter:case fm.stateChangeTypes.ItemClick:
|
|
16396
|
-
return{...n,isOpen:!
|
|
16398
|
+
return{...n,isOpen:!N};default:return n}},
|
|
16397
16399
|
onStateChange:({inputValue:e,type:n,selectedItem:r})=>{switch(n){
|
|
16398
16400
|
case fm.stateChangeTypes.InputKeyDownEnter:case fm.stateChangeTypes.ItemClick:
|
|
16399
16401
|
case fm.stateChangeTypes.InputBlur:
|
|
16400
|
-
r&&(
|
|
16401
|
-
;case fm.stateChangeTypes.InputChange:
|
|
16402
|
-
}),
|
|
16403
|
-
})),
|
|
16402
|
+
r&&($.find((e=>e?.[t]===r?.[t]))?U(r):W(r),F(""),E?.(""));break
|
|
16403
|
+
;case fm.stateChangeTypes.InputChange:F(e??""),E?.(e??"")}},...f
|
|
16404
|
+
}),te=!c&&!l&&K,ne=Q(j({preventKeyAction:K,name:d,disabled:c,readOnly:l
|
|
16405
|
+
})),re=e=>{if(e&&b&&y&&J<0){const t=y({inputValue:e,customValues:!0});W(t),F("")
|
|
16404
16406
|
}};return e.createElement(ch,{width:p},e.createElement(Fr,{
|
|
16405
|
-
className:"input-label",...
|
|
16407
|
+
className:"input-label",...Z({disabled:c,readOnly:l})
|
|
16406
16408
|
},n,n&&s&&e.createElement(jr,null,"*")),e.createElement(sh,{disabled:c,
|
|
16407
|
-
$isErrored:!!
|
|
16408
|
-
},e.createElement(fv,null,!
|
|
16409
|
-
key:`selected-item-${n}`,...
|
|
16409
|
+
$isErrored:!!S,"aria-invalid":S,className:"dropdown-toggle-button"
|
|
16410
|
+
},e.createElement(fv,null,!R&&$.map(((t,n)=>e.createElement(Hv,{
|
|
16411
|
+
key:`selected-item-${n}`,...B({selectedItem:t,index:n}),"aria-disabled":c,
|
|
16410
16412
|
"aria-readonly":l,iconProps:{"aria-disabled":c,disabled:c},onClose:e=>{
|
|
16411
|
-
c||l||(e.stopPropagation()
|
|
16412
|
-
placeholder:i,...
|
|
16413
|
-
"Backspace"!==e.key||
|
|
16414
|
-
"Enter"===e.key&&
|
|
16413
|
+
c||l||(e.stopPropagation(),U(t))}},u?.(t)??""))),e.createElement("input",{
|
|
16414
|
+
placeholder:i,...ne,onKeyDown:e=>{
|
|
16415
|
+
"Backspace"!==e.key||N||(U($[$.length-1]),I?.()),
|
|
16416
|
+
"Enter"===e.key&&re(N),ne?.onKeyDown?.(e)},...D})),!C&&e.createElement($r,{
|
|
16415
16417
|
"aria-label":"Clear",onClick:e=>{
|
|
16416
|
-
|
|
16417
|
-
fill:
|
|
16418
|
-
},e.createElement(lh,{$isOpen:
|
|
16419
|
-
}))),!l&&!c&&e.createElement(uh,{$isOpen:
|
|
16420
|
-
},
|
|
16418
|
+
Y([]),F(""),e.stopPropagation(),e.preventDefault()}},e.createElement(Mr,{
|
|
16419
|
+
fill:O.colors.text.primary})),!z&&e.createElement($r,{...q({disabled:c,
|
|
16420
|
+
readOnly:l})},e.createElement(lh,{$isOpen:te,fill:O.colors.text.primary,width:8,
|
|
16421
|
+
height:8}))),!l&&!c&&e.createElement(uh,{$isOpen:K,...X({disabled:c,readOnly:l})
|
|
16422
|
+
},_?e.createElement(ph,null,e.createElement(tv,null)):e.createElement(e.Fragment,null,K&&(0===G.length||b)&&e.createElement(dh,{
|
|
16421
16423
|
readOnly:!0},b?e.createElement(hh,{tabIndex:0,onClick:e=>{
|
|
16422
|
-
e.stopPropagation(),
|
|
16423
|
-
},g?.(
|
|
16424
|
-
const a="string"==typeof n?`${n}${r}`.trim():`${n?.[t]??""}${r}`.trim(),o
|
|
16425
|
-
;return e.createElement(dh,{$isHilighted:
|
|
16426
|
-
index:r})
|
|
16427
|
-
},
|
|
16428
|
-
fill:
|
|
16424
|
+
e.stopPropagation(),re(N)}
|
|
16425
|
+
},g?.(N)??"Click to add"):v??"No items"),K&&G.map(((n,r)=>{
|
|
16426
|
+
const a="string"==typeof n?`${n}${r}`.trim():`${n?.[t]??""}${r}`.trim(),o=$.map((e=>e?.[t])).filter(Boolean).indexOf(n?.[t]??"")>-1
|
|
16427
|
+
;return e.createElement(dh,{$isHilighted:J===r,$isSelected:o,key:a,...ee({
|
|
16428
|
+
item:n,index:r})
|
|
16429
|
+
},V?V(n):e.createElement(e.Fragment,null,u?.(n)??"",o&&e.createElement(xr,{
|
|
16430
|
+
fill:O.colors.common.accent})))})))),S&&H&&e.createElement(ws,null,H))
|
|
16429
16431
|
},exports.Popover=CI,
|
|
16430
16432
|
exports.PopoverClose=wI,exports.PopoverTrigger=yI,exports.Radio=({checked:t,className:n,disabled:r,id:a,isRequired:o,label:i,name:l,readOnly:c,...s})=>e.createElement(MI,{
|
|
16431
16433
|
className:`RadioGroupRoot ${n??""}`.trim(),id:a,name:l,
|
package/index.d.ts
CHANGED
|
@@ -819,6 +819,10 @@ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem = De
|
|
|
819
819
|
* Whether to allow hide or clear when click
|
|
820
820
|
*/
|
|
821
821
|
hideClear?: boolean;
|
|
822
|
+
/**
|
|
823
|
+
* Whether to hide or show arrow
|
|
824
|
+
*/
|
|
825
|
+
hideArrow?: boolean;
|
|
822
826
|
/**
|
|
823
827
|
* Error text to be shown
|
|
824
828
|
*/
|
|
@@ -873,7 +877,7 @@ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem = De
|
|
|
873
877
|
/**
|
|
874
878
|
* MultiSelectDropdown displays a list or drop-down box that enables selection of an option or multiple options from an available list of values.
|
|
875
879
|
*/
|
|
876
|
-
declare const MultiSelectDropdown: <T extends DefaultMultiSelectDropdownItem>({ itemIdentifier, label, id, items, onChange, placeholder, readOnly, disabled, isRequired, itemToString, name, filterKey, width, useComboboxProps, useMultipleSelectionProps, emptyItemsText, getCustomMessage, onCustomValueAdd, customValues, inputValue: iV, hideClear, removeSelectedItem: rSelectedItem, defaultSelectedItems, handleInputChange, isErrored, isMenuLoading, errorText, InputProps, itemComponent, isDynamicMenu, locale, maxAllowedLength, minAllowedLength, hideChips, hideSelectedItem, onBackSpace, }: MultiSelectDropdownProps<T>) => react__default.JSX.Element;
|
|
880
|
+
declare const MultiSelectDropdown: <T extends DefaultMultiSelectDropdownItem>({ itemIdentifier, label, id, items, onChange, placeholder, readOnly, disabled, isRequired, itemToString, name, filterKey, width, useComboboxProps, useMultipleSelectionProps, emptyItemsText, getCustomMessage, onCustomValueAdd, customValues, inputValue: iV, hideClear, hideArrow, removeSelectedItem: rSelectedItem, defaultSelectedItems, handleInputChange, isErrored, isMenuLoading, errorText, InputProps, itemComponent, isDynamicMenu, locale, maxAllowedLength, minAllowedLength, hideChips, hideSelectedItem, onBackSpace, }: MultiSelectDropdownProps<T>) => react__default.JSX.Element;
|
|
877
881
|
|
|
878
882
|
type DefaultProps = {
|
|
879
883
|
/**
|
|
@@ -973,6 +977,8 @@ interface PopoverProps {
|
|
|
973
977
|
*/
|
|
974
978
|
disabled?: boolean;
|
|
975
979
|
replaceTrigger?: boolean;
|
|
980
|
+
popoverContentProps?: Popover$1.PopoverContentProps;
|
|
981
|
+
popoverRootProps?: Popover$1.PopoverProps;
|
|
976
982
|
/**
|
|
977
983
|
* The children or label
|
|
978
984
|
*/
|
|
@@ -1030,7 +1036,7 @@ interface PopoverProps {
|
|
|
1030
1036
|
/**
|
|
1031
1037
|
* Popover need two slots popover-trigger and popover-content. By default on clicking the trigger the content will be displayed. The props can be used to change the position of the content, width of the component and the distance between the trigger and the content.
|
|
1032
1038
|
*/
|
|
1033
|
-
declare const Popover: ({ children, trigger, arrow, hoverOutToClose, align, hoverToOpen, avoidCollisions, replaceTrigger, side: s, disabled, onClose, anchorOrigin, autoCloseDuration, clickOutToClose, transformOrigin, }: PopoverProps) => react__default.JSX.Element;
|
|
1039
|
+
declare const Popover: ({ children, trigger, arrow, hoverOutToClose, align, hoverToOpen, avoidCollisions, replaceTrigger, side: s, disabled, onClose, popoverContentProps, popoverRootProps, anchorOrigin, autoCloseDuration, clickOutToClose, transformOrigin, }: PopoverProps) => react__default.JSX.Element;
|
|
1034
1040
|
|
|
1035
1041
|
declare const PopoverTrigger: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Popover$1.PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
1036
1042
|
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
|