freemium-ui 2.0.0-beta.33 → 2.0.0-beta.35
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 +33 -33
- package/index.d.ts +5 -3
- package/index.js +33 -33
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -1804,7 +1804,7 @@ name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:rr((e=>{
|
|
|
1804
1804
|
}
|
|
1805
1805
|
&:hover:not([data-disabled]) {
|
|
1806
1806
|
box-shadow: 0 0 0 5px
|
|
1807
|
-
${({theme:e,disabled:t})=>t?"transparent"
|
|
1807
|
+
${({theme:e,disabled:t})=>t?"transparent":e.colors.fill.hover};
|
|
1808
1808
|
}
|
|
1809
1809
|
&:focus-within {
|
|
1810
1810
|
box-shadow: ${({theme:e,isErrored:t})=>t?e.colors.border.error:e.colors.border.active}
|
|
@@ -16034,18 +16034,18 @@ fill:u.colors.text.semantic.warning
|
|
|
16034
16034
|
target:"_blank",rel:"noreferrer",href:i?.href??"#"
|
|
16035
16035
|
},i.linkText)),t&&e.createElement(Mn,{onClick:()=>{h(!1),n?.()}
|
|
16036
16036
|
},e.createElement(qn,{fill:u.colors.text.primary}))):null
|
|
16037
|
-
},exports.BoxedRadio=({options:t,defaultValue:n,idAccessor:r="id",onChange:a,isErrored:o,errorText:i,disabled:l=!1,getTextContent:c,className:s,id:u,isRequired:d,readOnly:h,itemComponent:p,label:f,value:m,...
|
|
16037
|
+
},exports.BoxedRadio=({options:t,defaultValue:n,idAccessor:r="id",onChange:a,isErrored:o,errorText:i,disabled:l=!1,getTextContent:c,className:s,id:u,isRequired:d,readOnly:h,itemComponent:p,label:f,value:m,customIndicator:v,...g})=>e.createElement(ic,{
|
|
16038
16038
|
className:"StyledBoxedRadio"},f&&e.createElement(wn,{htmlFor:u,
|
|
16039
16039
|
className:"input-label"},f,d&&e.createElement(zn,null,"*")),e.createElement(lc,{
|
|
16040
16040
|
defaultValue:n,value:m,onValueChange:e=>a?.(e),"aria-readonly":h,id:u,
|
|
16041
16041
|
"aria-label":f,"aria-labelledby":u,"aria-invalid":o,
|
|
16042
|
-
className:`BoxedRadioGroupRoot ${s??""}`.trim(),...
|
|
16042
|
+
className:`BoxedRadioGroupRoot ${s??""}`.trim(),...g},t?.map((t=>{
|
|
16043
16043
|
const n=c?.(t,"name")??"",a=c?.(t,"description")??"";return e.createElement(dc,{
|
|
16044
16044
|
isErrored:!1,disabled:t.disabled||l,key:t?.[r],className:"BoxedRadioContainer"
|
|
16045
16045
|
},e.createElement(uc,{className:"BoxedRadioGroupItem",disabled:t.disabled||l,
|
|
16046
16046
|
value:t?.[r],id:t?.[r],"aria-label":n,hasDescription:!!a},e.createElement(cc,{
|
|
16047
16047
|
hasDescription:!!a,className:"BoxedRadioGroupIndicatorHolder"
|
|
16048
|
-
},e.createElement(sc,{className:"BoxedRadioGroupIndicator"
|
|
16048
|
+
},v??e.createElement(sc,{className:"BoxedRadioGroupIndicator"
|
|
16049
16049
|
}))),e.createElement(fc,{className:"BoxedRadioLabel",htmlFor:t?.[r]
|
|
16050
16050
|
},p?p(t):e.createElement(e.Fragment,null,a?e.createElement(hc,{
|
|
16051
16051
|
className:"BoxedRadioLabelHeading"
|
|
@@ -16154,51 +16154,51 @@ open:t,onOpenChange:e=>{e||l?.()}},e.createElement(um,null,e.createElement(dm,{
|
|
|
16154
16154
|
forceMount:!0,className:"DialogOverlay",onClick:()=>l?.()}),e.createElement(hm,{
|
|
16155
16155
|
forceMount:!0,className:`DialogContent ${a??""}`.trim(),size:s??"default",
|
|
16156
16156
|
fullWidth:o,align:r,position:c,style:i
|
|
16157
|
-
},n))),exports.MoreVertical=od,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,removeSelectedItem:z,defaultSelectedItems:M=[],handleInputChange:x,isErrored:E,isMenuLoading:S,errorText:_,InputProps:H,itemComponent:D,isDynamicMenu:L,locale:V,maxAllowedLength:A,minAllowedLength:k,onBackSpace:
|
|
16158
|
-
const
|
|
16159
|
-
selectedItems:
|
|
16157
|
+
},n))),exports.MoreVertical=od,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,removeSelectedItem:z,defaultSelectedItems:M=[],handleInputChange:x,isErrored:E,isMenuLoading:S,errorText:_,InputProps:H,itemComponent:D,isDynamicMenu:L,locale:V,maxAllowedLength:A,minAllowedLength:k,hideChips:T=!1,onBackSpace:R})=>{
|
|
16158
|
+
const P=qt(),[I,O]=e.useState(""),[N,F]=e.useState([...M]),B=e.useMemo((()=>a.filter((e=>!I||("string"==typeof e?e:e?.[h||t]).toLowerCase().includes(I.toLowerCase())))),[a,h,t,I]),{getSelectedItemProps:j,getDropdownProps:U,removeSelectedItem:$,setSelectedItems:Y}=Bf({
|
|
16159
|
+
selectedItems:N,onStateChange:({selectedItems:e,type:t})=>{switch(t){
|
|
16160
16160
|
case Bf.stateChangeTypes.SelectedItemKeyDownBackspace:
|
|
16161
16161
|
case Bf.stateChangeTypes.SelectedItemKeyDownDelete:
|
|
16162
16162
|
case Bf.stateChangeTypes.DropdownKeyDownBackspace:
|
|
16163
|
-
case Bf.stateChangeTypes.FunctionRemoveSelectedItem:e&&
|
|
16164
|
-
}),{isOpen:
|
|
16165
|
-
items:
|
|
16163
|
+
case Bf.stateChangeTypes.FunctionRemoveSelectedItem:e&&F(e)}},...m
|
|
16164
|
+
}),{isOpen:W,getToggleButtonProps:G,getLabelProps:K,getMenuProps:q,getInputProps:Z,highlightedIndex:X,getItemProps:Q}=ff({
|
|
16165
|
+
items:B,itemToString:e=>e&&u?u(e,"downshift"):"",selectedItem:null,inputValue:I,
|
|
16166
16166
|
stateReducer:(e,t)=>{const{changes:n,type:r}=t;switch(r){
|
|
16167
16167
|
case ff.stateChangeTypes.InputKeyDownEnter:case ff.stateChangeTypes.ItemClick:
|
|
16168
16168
|
return{...n,isOpen:!0};default:return n}},
|
|
16169
16169
|
onStateChange({inputValue:e,type:n,selectedItem:r}){switch(n){
|
|
16170
16170
|
case ff.stateChangeTypes.InputKeyDownEnter:case ff.stateChangeTypes.ItemClick:
|
|
16171
16171
|
case ff.stateChangeTypes.InputBlur:
|
|
16172
|
-
r&&(
|
|
16173
|
-
;case ff.stateChangeTypes.InputChange:
|
|
16174
|
-
}),[x,
|
|
16175
|
-
}),[M]),e.useEffect((()=>{
|
|
16176
|
-
;return e.createElement(ld,{width:p,isOpen:
|
|
16177
|
-
className:"input-label",...
|
|
16172
|
+
r&&(N.indexOf(r)>-1?F(N.filter((e=>e?.[t]!==r?.[t]))):F([...N,r]),O(""));break
|
|
16173
|
+
;case ff.stateChangeTypes.InputChange:O(e||"")}},...f});e.useEffect((()=>{x?.(I)
|
|
16174
|
+
}),[x,I]),e.useEffect((()=>{o?.(N)}),[o,N]),e.useEffect((()=>{
|
|
16175
|
+
M.length>0&&Y([...M])}),[M]),e.useEffect((()=>{O(w??"")}),[w]);const J=!c&&!l&&W
|
|
16176
|
+
;return e.createElement(ld,{width:p,isOpen:J},e.createElement(wn,{
|
|
16177
|
+
className:"input-label",...K({disabled:c,readOnly:l})
|
|
16178
16178
|
},n,s&&e.createElement(zn,null,"*")),e.createElement(cd,{disabled:c,
|
|
16179
16179
|
isErrored:!!E,"aria-invalid":E
|
|
16180
|
-
},e.createElement(pm,null
|
|
16181
|
-
key:`selected-item-${n}`,...
|
|
16180
|
+
},e.createElement(pm,null,!T&&N.map(((t,n)=>e.createElement(_m,{
|
|
16181
|
+
key:`selected-item-${n}`,...j({selectedItem:t,index:n}),"aria-disabled":c,
|
|
16182
16182
|
"aria-readonly":l,iconProps:{"aria-disabled":c,disabled:c},onClose:e=>{
|
|
16183
|
-
c||l||(e.stopPropagation()
|
|
16184
|
-
},u?.(t)??""))),e.createElement("input",{placeholder:i,...
|
|
16185
|
-
preventKeyAction:
|
|
16186
|
-
"Backspace"!==e.key||
|
|
16187
|
-
|
|
16183
|
+
c||l||(e.stopPropagation(),$(t),z?.(t,n))}
|
|
16184
|
+
},u?.(t)??""))),e.createElement("input",{placeholder:i,...Z(U({
|
|
16185
|
+
preventKeyAction:W,name:d,id:r,disabled:c,readOnly:l})),onKeyDown:e=>{
|
|
16186
|
+
"Backspace"!==e.key||I||($(N[N.length-1]),
|
|
16187
|
+
R?.()),"Enter"===e.key&&I&&b&&X<0&&y?.({inputValue:I,customValues:!0})},...H
|
|
16188
16188
|
})),!C&&e.createElement(Mn,{onClick:e=>{
|
|
16189
|
-
|
|
16190
|
-
fill:
|
|
16191
|
-
},e.createElement(id,{isOpen:
|
|
16192
|
-
}))),!l&&!c&&e.createElement(sd,{isOpen:
|
|
16193
|
-
},S?e.createElement(hd,null,e.createElement(tm,null)):e.createElement(e.Fragment,null,
|
|
16189
|
+
Y([]),e.stopPropagation(),e.preventDefault()}},e.createElement(qn,{
|
|
16190
|
+
fill:P.colors.text.primary})),e.createElement(Mn,{...G({disabled:c,readOnly:l})
|
|
16191
|
+
},e.createElement(id,{isOpen:J,fill:P.colors.text.primary,width:8,height:8
|
|
16192
|
+
}))),!l&&!c&&e.createElement(sd,{isOpen:W,...q({disabled:c,readOnly:l})
|
|
16193
|
+
},S?e.createElement(hd,null,e.createElement(tm,null)):e.createElement(e.Fragment,null,W&&(0===B.length||b)&&e.createElement(ud,{
|
|
16194
16194
|
readOnly:!0},b?e.createElement(dd,{tabIndex:0,onClick:e=>{
|
|
16195
|
-
e.stopPropagation(),y&&y({inputValue:
|
|
16196
|
-
},g?.(
|
|
16197
|
-
const a="string"==typeof n?n:n?.[t],o=
|
|
16198
|
-
;return e.createElement(ud,{isHilighted:
|
|
16195
|
+
e.stopPropagation(),y&&y({inputValue:I,customValues:!0})}
|
|
16196
|
+
},g?.(I)||"Click to add"):v||"No items"),W&&B.map(((n,r)=>{
|
|
16197
|
+
const a="string"==typeof n?n:n?.[t],o=N.indexOf(n)>-1
|
|
16198
|
+
;return e.createElement(ud,{isHilighted:X===r,isSelected:o,key:a,...Q({item:n,
|
|
16199
16199
|
index:r})
|
|
16200
16200
|
},D?D(n):e.createElement(e.Fragment,null,u?.(n)??"",o&&e.createElement(Lc,{
|
|
16201
|
-
fill:
|
|
16201
|
+
fill:P.colors.common.accent})))})))),E&&_&&e.createElement(vc,null,_))
|
|
16202
16202
|
},exports.Popover=bP,
|
|
16203
16203
|
exports.PopoverClose=yP,exports.Radio=({checked:t,className:n,disabled:r,id:a,isRequired:o,label:i,name:l,readOnly:c,...s})=>e.createElement(CP,{
|
|
16204
16204
|
className:`RadioGroupRoot ${n??""}`.trim(),id:a,name:l,"aria-label":i,
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import react__default, { HTMLAttributes } from 'react';
|
|
3
|
+
import react__default, { ReactNode, HTMLAttributes } from 'react';
|
|
4
4
|
import * as Popover$1 from '@radix-ui/react-popover';
|
|
5
5
|
import { PopperContentProps } from '@radix-ui/react-popover';
|
|
6
6
|
import { RadioGroupProps as RadioGroupProps$1, RadioGroupContextValue } from '@radix-ui/react-radio-group';
|
|
@@ -196,6 +196,7 @@ type BoxedRadioProps<T extends BoxedRadioItemProps = BoxedRadioItemProps> = Omit
|
|
|
196
196
|
errorText?: string;
|
|
197
197
|
isRequired?: boolean;
|
|
198
198
|
isErrored?: boolean;
|
|
199
|
+
customIndicator?: ReactNode;
|
|
199
200
|
/**
|
|
200
201
|
* The description of the content
|
|
201
202
|
*/
|
|
@@ -209,7 +210,7 @@ type BoxedRadioProps<T extends BoxedRadioItemProps = BoxedRadioItemProps> = Omit
|
|
|
209
210
|
/**
|
|
210
211
|
* BoxedRadio displays a group of options with radio buttons and enables selection of one option from the list.
|
|
211
212
|
*/
|
|
212
|
-
declare const BoxedRadio: <T extends BoxedRadioItemProps>({ options, defaultValue, idAccessor, onChange, isErrored, errorText, disabled, getTextContent, className, id, isRequired, readOnly, itemComponent, label, value, ...props }: BoxedRadioProps<T>) => react__default.JSX.Element;
|
|
213
|
+
declare const BoxedRadio: <T extends BoxedRadioItemProps>({ options, defaultValue, idAccessor, onChange, isErrored, errorText, disabled, getTextContent, className, id, isRequired, readOnly, itemComponent, label, value, customIndicator, ...props }: BoxedRadioProps<T>) => react__default.JSX.Element;
|
|
213
214
|
|
|
214
215
|
interface CheckboxProps extends CheckboxProps$1 {
|
|
215
216
|
/**
|
|
@@ -791,12 +792,13 @@ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem = De
|
|
|
791
792
|
createText: string;
|
|
792
793
|
deleteText: string;
|
|
793
794
|
};
|
|
795
|
+
hideChips?: boolean;
|
|
794
796
|
}
|
|
795
797
|
|
|
796
798
|
/**
|
|
797
799
|
* MultiSelectDropdown displays a list or drop-down box that enables selection of an option or multiple options from an available list of values.
|
|
798
800
|
*/
|
|
799
|
-
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, onBackSpace, }: MultiSelectDropdownProps<T>) => react__default.JSX.Element;
|
|
801
|
+
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, onBackSpace, }: MultiSelectDropdownProps<T>) => react__default.JSX.Element;
|
|
800
802
|
|
|
801
803
|
type DefaultProps = {
|
|
802
804
|
/**
|
package/index.js
CHANGED
|
@@ -1792,7 +1792,7 @@ onCheck:()=>l.onValueChange(o.value),onKeyDown:xr((e=>{
|
|
|
1792
1792
|
}
|
|
1793
1793
|
&:hover:not([data-disabled]) {
|
|
1794
1794
|
box-shadow: 0 0 0 5px
|
|
1795
|
-
${({theme:e,disabled:t})=>t?"transparent"
|
|
1795
|
+
${({theme:e,disabled:t})=>t?"transparent":e.colors.fill.hover};
|
|
1796
1796
|
}
|
|
1797
1797
|
&:focus-within {
|
|
1798
1798
|
box-shadow: ${({theme:e,isErrored:t})=>t?e.colors.border.error:e.colors.border.active}
|
|
@@ -1833,18 +1833,18 @@ onCheck:()=>l.onValueChange(o.value),onKeyDown:xr((e=>{
|
|
|
1833
1833
|
line-height: 20px;
|
|
1834
1834
|
`,Oc=e=>t.createElement(Rc,{...e,
|
|
1835
1835
|
className:`input-helper ${e.className??""}`.trim()
|
|
1836
|
-
},e.children),Nc=({options:e,defaultValue:n,idAccessor:r="id",onChange:a,isErrored:o,errorText:i,disabled:l=!1,getTextContent:c,className:s,id:u,isRequired:d,readOnly:h,itemComponent:p,label:f,value:m,...
|
|
1836
|
+
},e.children),Nc=({options:e,defaultValue:n,idAccessor:r="id",onChange:a,isErrored:o,errorText:i,disabled:l=!1,getTextContent:c,className:s,id:u,isRequired:d,readOnly:h,itemComponent:p,label:f,value:m,customIndicator:v,...g})=>t.createElement(Hc,{
|
|
1837
1837
|
className:"StyledBoxedRadio"},f&&t.createElement(Fn,{htmlFor:u,
|
|
1838
1838
|
className:"input-label"},f,d&&t.createElement(jn,null,"*")),t.createElement(Dc,{
|
|
1839
1839
|
defaultValue:n,value:m,onValueChange:e=>a?.(e),"aria-readonly":h,id:u,
|
|
1840
1840
|
"aria-label":f,"aria-labelledby":u,"aria-invalid":o,
|
|
1841
|
-
className:`BoxedRadioGroupRoot ${s??""}`.trim(),...
|
|
1841
|
+
className:`BoxedRadioGroupRoot ${s??""}`.trim(),...g},e?.map((e=>{
|
|
1842
1842
|
const n=c?.(e,"name")??"",a=c?.(e,"description")??"";return t.createElement(kc,{
|
|
1843
1843
|
isErrored:!1,disabled:e.disabled||l,key:e?.[r],className:"BoxedRadioContainer"
|
|
1844
1844
|
},t.createElement(Ac,{className:"BoxedRadioGroupItem",disabled:e.disabled||l,
|
|
1845
1845
|
value:e?.[r],id:e?.[r],"aria-label":n,hasDescription:!!a},t.createElement(Lc,{
|
|
1846
1846
|
hasDescription:!!a,className:"BoxedRadioGroupIndicatorHolder"
|
|
1847
|
-
},t.createElement(Vc,{className:"BoxedRadioGroupIndicator"
|
|
1847
|
+
},v??t.createElement(Vc,{className:"BoxedRadioGroupIndicator"
|
|
1848
1848
|
}))),t.createElement(Ic,{className:"BoxedRadioLabel",htmlFor:e?.[r]
|
|
1849
1849
|
},p?p(e):t.createElement(t.Fragment,null,a?t.createElement(Tc,{
|
|
1850
1850
|
className:"BoxedRadioLabelHeading"
|
|
@@ -3889,51 +3889,51 @@ className:"StyledTag"},i||l?t.createElement(Km,{className:"AvatarRoot"
|
|
|
3889
3889
|
className:"AvatarFallback",delayMs:600
|
|
3890
3890
|
},l)):t.createElement("div",null),e,t.createElement(Xm,{...n,onClick:r
|
|
3891
3891
|
},t.createElement(mr,{fill:u.colors.text.primary})))
|
|
3892
|
-
},ev=({itemIdentifier:e="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,removeSelectedItem:z,defaultSelectedItems:M=[],handleInputChange:x,isErrored:S,isMenuLoading:E,errorText:_,InputProps:H,itemComponent:D,isDynamicMenu:L,locale:V,maxAllowedLength:A,minAllowedLength:k,onBackSpace:
|
|
3893
|
-
const
|
|
3894
|
-
selectedItems:
|
|
3892
|
+
},ev=({itemIdentifier:e="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,removeSelectedItem:z,defaultSelectedItems:M=[],handleInputChange:x,isErrored:S,isMenuLoading:E,errorText:_,InputProps:H,itemComponent:D,isDynamicMenu:L,locale:V,maxAllowedLength:A,minAllowedLength:k,hideChips:T=!1,onBackSpace:P})=>{
|
|
3893
|
+
const I=vn(),[R,O]=t.useState(""),[N,F]=t.useState([...M]),B=t.useMemo((()=>a.filter((t=>!R||("string"==typeof t?t:t?.[h||e]).toLowerCase().includes(R.toLowerCase())))),[a,h,e,R]),{getSelectedItemProps:j,getDropdownProps:U,removeSelectedItem:$,setSelectedItems:Y}=hm({
|
|
3894
|
+
selectedItems:N,onStateChange:({selectedItems:e,type:t})=>{switch(t){
|
|
3895
3895
|
case hm.stateChangeTypes.SelectedItemKeyDownBackspace:
|
|
3896
3896
|
case hm.stateChangeTypes.SelectedItemKeyDownDelete:
|
|
3897
3897
|
case hm.stateChangeTypes.DropdownKeyDownBackspace:
|
|
3898
|
-
case hm.stateChangeTypes.FunctionRemoveSelectedItem:e&&
|
|
3899
|
-
}),{isOpen:
|
|
3900
|
-
items:
|
|
3898
|
+
case hm.stateChangeTypes.FunctionRemoveSelectedItem:e&&F(e)}},...m
|
|
3899
|
+
}),{isOpen:W,getToggleButtonProps:G,getLabelProps:K,getMenuProps:q,getInputProps:Z,highlightedIndex:X,getItemProps:Q}=Nf({
|
|
3900
|
+
items:B,itemToString:e=>e&&u?u(e,"downshift"):"",selectedItem:null,inputValue:R,
|
|
3901
3901
|
stateReducer:(e,t)=>{const{changes:n,type:r}=t;switch(r){
|
|
3902
3902
|
case Nf.stateChangeTypes.InputKeyDownEnter:case Nf.stateChangeTypes.ItemClick:
|
|
3903
3903
|
return{...n,isOpen:!0};default:return n}},
|
|
3904
3904
|
onStateChange({inputValue:t,type:n,selectedItem:r}){switch(n){
|
|
3905
3905
|
case Nf.stateChangeTypes.InputKeyDownEnter:case Nf.stateChangeTypes.ItemClick:
|
|
3906
3906
|
case Nf.stateChangeTypes.InputBlur:
|
|
3907
|
-
r&&(
|
|
3908
|
-
;case Nf.stateChangeTypes.InputChange:
|
|
3909
|
-
}),[x,
|
|
3910
|
-
}),[M]),t.useEffect((()=>{
|
|
3911
|
-
;return t.createElement(Ad,{width:p,isOpen:
|
|
3912
|
-
className:"input-label",...
|
|
3907
|
+
r&&(N.indexOf(r)>-1?F(N.filter((t=>t?.[e]!==r?.[e]))):F([...N,r]),O(""));break
|
|
3908
|
+
;case Nf.stateChangeTypes.InputChange:O(t||"")}},...f});t.useEffect((()=>{x?.(R)
|
|
3909
|
+
}),[x,R]),t.useEffect((()=>{o?.(N)}),[o,N]),t.useEffect((()=>{
|
|
3910
|
+
M.length>0&&Y([...M])}),[M]),t.useEffect((()=>{O(w??"")}),[w]);const J=!c&&!l&&W
|
|
3911
|
+
;return t.createElement(Ad,{width:p,isOpen:J},t.createElement(Fn,{
|
|
3912
|
+
className:"input-label",...K({disabled:c,readOnly:l})
|
|
3913
3913
|
},n,s&&t.createElement(jn,null,"*")),t.createElement(kd,{disabled:c,
|
|
3914
3914
|
isErrored:!!S,"aria-invalid":S
|
|
3915
|
-
},t.createElement(Nm,null
|
|
3916
|
-
key:`selected-item-${n}`,...
|
|
3915
|
+
},t.createElement(Nm,null,!T&&N.map(((e,n)=>t.createElement(Jm,{
|
|
3916
|
+
key:`selected-item-${n}`,...j({selectedItem:e,index:n}),"aria-disabled":c,
|
|
3917
3917
|
"aria-readonly":l,iconProps:{"aria-disabled":c,disabled:c},onClose:t=>{
|
|
3918
|
-
c||l||(t.stopPropagation()
|
|
3919
|
-
},u?.(e)??""))),t.createElement("input",{placeholder:i,...
|
|
3920
|
-
preventKeyAction:
|
|
3921
|
-
"Backspace"!==e.key||
|
|
3922
|
-
|
|
3918
|
+
c||l||(t.stopPropagation(),$(e),z?.(e,n))}
|
|
3919
|
+
},u?.(e)??""))),t.createElement("input",{placeholder:i,...Z(U({
|
|
3920
|
+
preventKeyAction:W,name:d,id:r,disabled:c,readOnly:l})),onKeyDown:e=>{
|
|
3921
|
+
"Backspace"!==e.key||R||($(N[N.length-1]),
|
|
3922
|
+
P?.()),"Enter"===e.key&&R&&b&&X<0&&y?.({inputValue:R,customValues:!0})},...H
|
|
3923
3923
|
})),!C&&t.createElement(Un,{onClick:e=>{
|
|
3924
|
-
|
|
3925
|
-
fill:
|
|
3926
|
-
},t.createElement(Vd,{isOpen:
|
|
3927
|
-
}))),!l&&!c&&t.createElement(Td,{isOpen:
|
|
3928
|
-
},E?t.createElement(Rd,null,t.createElement(Em,null)):t.createElement(t.Fragment,null,
|
|
3924
|
+
Y([]),e.stopPropagation(),e.preventDefault()}},t.createElement(mr,{
|
|
3925
|
+
fill:I.colors.text.primary})),t.createElement(Un,{...G({disabled:c,readOnly:l})
|
|
3926
|
+
},t.createElement(Vd,{isOpen:J,fill:I.colors.text.primary,width:8,height:8
|
|
3927
|
+
}))),!l&&!c&&t.createElement(Td,{isOpen:W,...q({disabled:c,readOnly:l})
|
|
3928
|
+
},E?t.createElement(Rd,null,t.createElement(Em,null)):t.createElement(t.Fragment,null,W&&(0===B.length||b)&&t.createElement(Pd,{
|
|
3929
3929
|
readOnly:!0},b?t.createElement(Id,{tabIndex:0,onClick:e=>{
|
|
3930
|
-
e.stopPropagation(),y&&y({inputValue:
|
|
3931
|
-
},g?.(
|
|
3932
|
-
const a="string"==typeof n?n:n?.[e],o=
|
|
3933
|
-
;return t.createElement(Pd,{isHilighted:
|
|
3930
|
+
e.stopPropagation(),y&&y({inputValue:R,customValues:!0})}
|
|
3931
|
+
},g?.(R)||"Click to add"):v||"No items"),W&&B.map(((n,r)=>{
|
|
3932
|
+
const a="string"==typeof n?n:n?.[e],o=N.indexOf(n)>-1
|
|
3933
|
+
;return t.createElement(Pd,{isHilighted:X===r,isSelected:o,key:a,...Q({item:n,
|
|
3934
3934
|
index:r})
|
|
3935
3935
|
},D?D(n):t.createElement(t.Fragment,null,u?.(n)??"",o&&t.createElement(Jc,{
|
|
3936
|
-
fill:
|
|
3936
|
+
fill:I.colors.common.accent})))})))),S&&_&&t.createElement(Oc,null,_))}
|
|
3937
3937
|
;function tv(e){
|
|
3938
3938
|
throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')
|
|
3939
3939
|
}var nv,rv={exports:{}};(nv=rv).exports=function(){var e,t;function n(){
|