freemium-ui 2.0.0-beta.33 → 2.0.0-beta.34

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/LICENSE ADDED
@@ -0,0 +1,21 @@
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 ADDED
@@ -0,0 +1,86 @@
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
+ ```
@@ -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:T})=>{
16158
- const R=qt(),[P,I]=e.useState(""),[O,N]=e.useState([]),F=e.useMemo((()=>a.filter((e=>!P||("string"==typeof e?e:e?.[h||t]).toLowerCase().includes(P.toLowerCase())))),[a,h,t,P]),{getSelectedItemProps:B,getDropdownProps:j,removeSelectedItem:U,setSelectedItems:$}=Bf({
16159
- selectedItems:O,onStateChange:({selectedItems:e,type:t})=>{switch(t){
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&&N(e)}},...m
16164
- }),{isOpen:Y,getToggleButtonProps:W,getLabelProps:G,getMenuProps:K,getInputProps:q,highlightedIndex:Z,getItemProps:X}=ff({
16165
- items:F,itemToString:e=>e&&u?u(e,"downshift"):"",selectedItem:null,inputValue:P,
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&&(O.indexOf(r)>-1?N(O.filter((e=>e?.[t]!==r?.[t]))):N([...O,r]),I(""));break
16173
- ;case ff.stateChangeTypes.InputChange:I(e||"")}},...f});e.useEffect((()=>{x?.(P)
16174
- }),[x,P]),e.useEffect((()=>{o?.(O)}),[o,O]),e.useEffect((()=>{N(M??[])
16175
- }),[M]),e.useEffect((()=>{I(w??"")}),[w]);const Q=!c&&!l&&Y
16176
- ;return e.createElement(ld,{width:p,isOpen:Q},e.createElement(wn,{
16177
- className:"input-label",...G({disabled:c,readOnly:l})
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,O.map(((t,n)=>e.createElement(_m,{
16181
- key:`selected-item-${n}`,...B({selectedItem:t,index:n}),"aria-disabled":c,
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(),U(t),z?.(t,n))}
16184
- },u?.(t)??""))),e.createElement("input",{placeholder:i,...q(j({
16185
- preventKeyAction:Y,name:d,id:r,disabled:c,readOnly:l})),onKeyDown:e=>{
16186
- "Backspace"!==e.key||P||(U(O[O.length-1]),
16187
- T?.()),"Enter"===e.key&&P&&b&&Z<0&&y?.({inputValue:P,customValues:!0})},...H
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
- $([]),e.stopPropagation(),e.preventDefault()}},e.createElement(qn,{
16190
- fill:R.colors.text.primary})),e.createElement(Mn,{...W({disabled:c,readOnly:l})
16191
- },e.createElement(id,{isOpen:Q,fill:R.colors.text.primary,width:8,height:8
16192
- }))),!l&&!c&&e.createElement(sd,{isOpen:Y,...K({disabled:c,readOnly:l})
16193
- },S?e.createElement(hd,null,e.createElement(tm,null)):e.createElement(e.Fragment,null,Y&&(0===F.length||b)&&e.createElement(ud,{
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:P,customValues:!0})}
16196
- },g?.(P)||"Click to add"):v||"No items"),Y&&F.map(((n,r)=>{
16197
- const a="string"==typeof n?n:n?.[t],o=O.indexOf(n)>-1
16198
- ;return e.createElement(ud,{isHilighted:Z===r,isSelected:o,key:a,...X({item:n,
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:R.colors.common.accent})))})))),E&&_&&e.createElement(vc,null,_))
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,
@@ -791,12 +791,13 @@ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem = De
791
791
  createText: string;
792
792
  deleteText: string;
793
793
  };
794
+ hideChips?: boolean;
794
795
  }
795
796
 
796
797
  /**
797
798
  * MultiSelectDropdown displays a list or drop-down box that enables selection of an option or multiple options from an available list of values.
798
799
  */
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;
800
+ 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
801
 
801
802
  type DefaultProps = {
802
803
  /**
@@ -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:T})=>{
3893
- const P=vn(),[I,R]=t.useState(""),[O,N]=t.useState([]),F=t.useMemo((()=>a.filter((t=>!I||("string"==typeof t?t:t?.[h||e]).toLowerCase().includes(I.toLowerCase())))),[a,h,e,I]),{getSelectedItemProps:B,getDropdownProps:j,removeSelectedItem:U,setSelectedItems:$}=hm({
3894
- selectedItems:O,onStateChange:({selectedItems:e,type:t})=>{switch(t){
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&&N(e)}},...m
3899
- }),{isOpen:Y,getToggleButtonProps:W,getLabelProps:G,getMenuProps:K,getInputProps:q,highlightedIndex:Z,getItemProps:X}=Nf({
3900
- items:F,itemToString:e=>e&&u?u(e,"downshift"):"",selectedItem:null,inputValue:I,
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&&(O.indexOf(r)>-1?N(O.filter((t=>t?.[e]!==r?.[e]))):N([...O,r]),R(""));break
3908
- ;case Nf.stateChangeTypes.InputChange:R(t||"")}},...f});t.useEffect((()=>{x?.(I)
3909
- }),[x,I]),t.useEffect((()=>{o?.(O)}),[o,O]),t.useEffect((()=>{N(M??[])
3910
- }),[M]),t.useEffect((()=>{R(w??"")}),[w]);const Q=!c&&!l&&Y
3911
- ;return t.createElement(Ad,{width:p,isOpen:Q},t.createElement(Fn,{
3912
- className:"input-label",...G({disabled:c,readOnly:l})
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,O.map(((e,n)=>t.createElement(Jm,{
3916
- key:`selected-item-${n}`,...B({selectedItem:e,index:n}),"aria-disabled":c,
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(),U(e),z?.(e,n))}
3919
- },u?.(e)??""))),t.createElement("input",{placeholder:i,...q(j({
3920
- preventKeyAction:Y,name:d,id:r,disabled:c,readOnly:l})),onKeyDown:e=>{
3921
- "Backspace"!==e.key||I||(U(O[O.length-1]),
3922
- T?.()),"Enter"===e.key&&I&&b&&Z<0&&y?.({inputValue:I,customValues:!0})},...H
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
- $([]),e.stopPropagation(),e.preventDefault()}},t.createElement(mr,{
3925
- fill:P.colors.text.primary})),t.createElement(Un,{...W({disabled:c,readOnly:l})
3926
- },t.createElement(Vd,{isOpen:Q,fill:P.colors.text.primary,width:8,height:8
3927
- }))),!l&&!c&&t.createElement(Td,{isOpen:Y,...K({disabled:c,readOnly:l})
3928
- },E?t.createElement(Rd,null,t.createElement(Em,null)):t.createElement(t.Fragment,null,Y&&(0===F.length||b)&&t.createElement(Pd,{
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:I,customValues:!0})}
3931
- },g?.(I)||"Click to add"):v||"No items"),Y&&F.map(((n,r)=>{
3932
- const a="string"==typeof n?n:n?.[e],o=O.indexOf(n)>-1
3933
- ;return t.createElement(Pd,{isHilighted:Z===r,isSelected:o,key:a,...X({item:n,
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:P.colors.common.accent})))})))),S&&_&&t.createElement(Oc,null,_))}
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(){
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "freemium-ui",
3
+ "version": "2.0.0-beta.34",
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.2",
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-alert-dialog": "^1.0.5",
15
+ "@radix-ui/react-avatar": "^1.0.4",
16
+ "@radix-ui/react-checkbox": "^1.0.4",
17
+ "@radix-ui/react-dropdown-menu": "^2.0.6",
18
+ "@radix-ui/react-label": "^2.0.2",
19
+ "@radix-ui/react-popover": "^1.0.7",
20
+ "@radix-ui/react-radio-group": "^1.1.3",
21
+ "@radix-ui/react-select": "^2.0.0",
22
+ "@radix-ui/react-switch": "^1.0.3",
23
+ "@radix-ui/react-tabs": "^1.0.4",
24
+ "@radix-ui/react-toast": "^1.1.5",
25
+ "@radix-ui/react-tooltip": "^1.0.7",
26
+ "@tanstack/react-table": "^8.13.2",
27
+ "downshift": "^8.4.0",
28
+ "moment": "^2.30.1",
29
+ "react": "^18.2.0",
30
+ "react-dom": "^18.2.0",
31
+ "react-scripts": "5.0.1",
32
+ "react-transition-group": "^4.4.5",
33
+ "styled-components": "^6.1.8",
34
+ "typescript": "^4.9.5",
35
+ "web-vitals": "^2.1.4"
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
+ "react-app/jest",
59
+ "plugin:storybook/recommended"
60
+ ]
61
+ },
62
+ "browserslist": {
63
+ "production": [
64
+ ">0.2%",
65
+ "not dead",
66
+ "not op_mini all"
67
+ ],
68
+ "development": [
69
+ "last 1 chrome version",
70
+ "last 1 firefox version",
71
+ "last 1 safari version"
72
+ ]
73
+ },
74
+ "private": false
75
+ }
Binary file
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.0-beta.33",
3
+ "version": "2.0.0-beta.34",
4
4
  "description": "React Ui Components for Freemium Apps",
5
- "main": "./index.js",
6
- "module": "./index.js",
7
- "typings": "./index.d.ts",
5
+ "main": "dist/index.cjs.js",
6
+ "module": "dist/index.js",
7
+ "typings": "dist/index.d.ts",
8
8
  "dependencies": {
9
9
  "@blueprintjs/datetime2": "^2.3.2",
10
10
  "@dnd-kit/core": "^6.1.0",
@@ -34,6 +34,65 @@
34
34
  "typescript": "^4.9.5",
35
35
  "web-vitals": "^2.1.4"
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.0",
44
+ "@storybook/addon-interactions": "^8.0.0",
45
+ "@storybook/addon-links": "^8.0.0",
46
+ "@storybook/addon-onboarding": "^8.0.0",
47
+ "@storybook/blocks": "^8.0.0",
48
+ "@storybook/preset-create-react-app": "^8.0.0",
49
+ "@storybook/preview-api": "^8.0.0",
50
+ "@storybook/react": "^8.0.0",
51
+ "@storybook/react-webpack5": "^8.0.0",
52
+ "@storybook/test": "^8.0.0",
53
+ "@testing-library/jest-dom": "^5.17.0",
54
+ "@testing-library/react": "^13.4.0",
55
+ "@testing-library/user-event": "^13.5.0",
56
+ "@types/jest": "^27.5.2",
57
+ "@types/node": "^16.18.64",
58
+ "@types/react": "^18.2.63",
59
+ "@types/react-dom": "^18.2.19",
60
+ "@types/react-transition-group": "^4.4.10",
61
+ "@types/rollup-plugin-generate-package-json": "^3.2.8",
62
+ "@types/rollup-plugin-peer-deps-external": "^2.2.5",
63
+ "@types/styled-components": "^5.1.34",
64
+ "babel-plugin-named-exports-order": "^0.0.2",
65
+ "eslint-plugin-storybook": "^0.8.0",
66
+ "husky": "^8.0.3",
67
+ "postcss": "^8.4.35",
68
+ "prettier": "^3.2.5",
69
+ "prop-types": "^15.8.1",
70
+ "rollup": "^4.12.0",
71
+ "rollup-plugin-dts": "^6.1.0",
72
+ "rollup-plugin-generate-package-json": "^3.2.0",
73
+ "rollup-plugin-peer-deps-external": "^2.2.4",
74
+ "storybook": "^8.0.0",
75
+ "webpack": "^5.90.3"
76
+ },
77
+ "scripts": {
78
+ "version:beta": "npm version prerelease --preid=beta",
79
+ "publish:beta": "npm publish ./dist --tag beta",
80
+ "publish": "npm publish ./dist",
81
+ "prepublishOnly": "npm run build",
82
+ "start": "react-scripts start",
83
+ "build:react-app": "react-scripts build",
84
+ "build": "npm run rollup && npm run post:build",
85
+ "post:build": "node ./scripts/frankBuild.js",
86
+ "rollup": "rm -rf dist && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
87
+ "test": "react-scripts test",
88
+ "eject": "react-scripts eject",
89
+ "check": "prettier --check .",
90
+ "format": "prettier --write .",
91
+ "storybook": "storybook dev -p 6006",
92
+ "build-storybook": "storybook build",
93
+ "typescript": "tsc -p tsconfig.json",
94
+ "prepare": "husky install"
95
+ },
37
96
  "repository": {
38
97
  "type": "git",
39
98
  "url": "git+https://github.com/freshdesk/freemium-ui.git"
@@ -70,6 +129,5 @@
70
129
  "last 1 firefox version",
71
130
  "last 1 safari version"
72
131
  ]
73
- },
74
- "private": false
75
- }
132
+ }
133
+ }