freemium-ui 2.0.0-beta.13 → 2.0.0-beta.14

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.
Files changed (4) hide show
  1. package/index.cjs.js +4364 -4284
  2. package/index.d.ts +123 -29
  3. package/index.js +4708 -4629
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -6,10 +6,10 @@ import * as Popover$1 from '@radix-ui/react-popover';
6
6
  import { PopperContentProps } from '@radix-ui/react-popover';
7
7
  import { RadioGroupContextValue, RadioGroupProps as RadioGroupProps$1 } from '@radix-ui/react-radio-group';
8
8
  import { CheckboxProps as CheckboxProps$1 } from '@radix-ui/react-checkbox';
9
- import { UseSelectProps, UseComboboxProps } from 'downshift';
9
+ import { UseSelectProps, UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
10
10
  import * as _radix_ui_react_label from '@radix-ui/react-label';
11
11
  import { LabelProps } from '@radix-ui/react-label';
12
- import { DateInput3Props, DateRangeInput3Props } from '@blueprintjs/datetime2';
12
+ import { DateInput3Props, DateRangeInput3Props, TimePrecision } from '@blueprintjs/datetime2';
13
13
  import * as styled_components from 'styled-components';
14
14
  import { DraggableSyntheticListeners } from '@dnd-kit/core';
15
15
  import { CoreOptions } from '@tanstack/react-table';
@@ -130,6 +130,14 @@ interface ButtonDropdownProps<T extends ButtonDropdownItemProps = ButtonDropdown
130
130
  * name Accessor of menu
131
131
  */
132
132
  nameAccessor?: string;
133
+ /**
134
+ * name Accessor of menu
135
+ */
136
+ id?: string;
137
+ /**
138
+ * name Accessor of menu
139
+ */
140
+ name?: string;
133
141
  disabled?: React.ButtonHTMLAttributes<HTMLButtonElement>['disabled'];
134
142
  size?: ButtonProps['size'];
135
143
  variant?: ButtonProps['variant'];
@@ -140,12 +148,9 @@ interface ButtonDropdownProps<T extends ButtonDropdownItemProps = ButtonDropdown
140
148
  /**
141
149
  * ButtonDropdown is a button with a dropdown menu. It is used to select an item from a list of items.
142
150
  */
143
- declare const ButtonDropdown: ({ size, variant, loading, inline, defaultSelectedItem, idAccessor, nameAccessor, onClick, options, side, sideOffset, align, alignOffset, arrowPadding, avoidCollisions, disabled, }: ButtonDropdownProps) => react__default.JSX.Element;
151
+ declare const ButtonDropdown: ({ size, variant, loading, inline, defaultSelectedItem, idAccessor, nameAccessor, onClick, options, side, sideOffset, align, alignOffset, arrowPadding, avoidCollisions, disabled, id, name, }: ButtonDropdownProps) => react__default.JSX.Element;
144
152
 
145
153
  interface BoxedRadioItemProps {
146
- id: string;
147
- name: string;
148
- hide?: boolean;
149
154
  disabled?: boolean;
150
155
  [key: string]: any;
151
156
  }
@@ -158,6 +163,10 @@ type BoxedRadioProps<T extends BoxedRadioItemProps = BoxedRadioItemProps> = {
158
163
  * Select options
159
164
  */
160
165
  disabled?: boolean;
166
+ /**
167
+ * Select options
168
+ */
169
+ readOnly?: boolean;
161
170
  /**
162
171
  * Id accessor of radio button
163
172
  */
@@ -175,13 +184,17 @@ type BoxedRadioProps<T extends BoxedRadioItemProps = BoxedRadioItemProps> = {
175
184
  */
176
185
  onChange?: RadioGroupContextValue['onValueChange'];
177
186
  /**
178
- * Name accesssor of radio button
187
+ * The description of the content
179
188
  */
180
- nameAccessor?: string;
189
+ label?: string;
181
190
  /**
182
191
  * The description of the content
183
192
  */
184
- label?: string;
193
+ getTextContent: (item: T, type: 'name' | 'description') => string;
194
+ /**
195
+ * The description of the content
196
+ */
197
+ renderOption?: (item: T) => React.ReactNode | string | null;
185
198
  /**
186
199
  * class Name of Radio button
187
200
  */
@@ -195,7 +208,7 @@ type BoxedRadioProps<T extends BoxedRadioItemProps = BoxedRadioItemProps> = {
195
208
  /**
196
209
  * BoxedRadio displays a group of options with radio buttons and enables selection of one option from the list.
197
210
  */
198
- declare const BoxedRadio: ({ options, defaultValue, idAccessor, nameAccessor, onChange, disabled, className, id, label, value, }: BoxedRadioProps) => react__default.JSX.Element;
211
+ declare const BoxedRadio: <T extends BoxedRadioItemProps>({ options, defaultValue, idAccessor, onChange, disabled, getTextContent, className, id, readOnly, renderOption, label, value, }: BoxedRadioProps<T>) => react__default.JSX.Element;
199
212
 
200
213
  interface CheckboxProps extends CheckboxProps$1 {
201
214
  /**
@@ -333,9 +346,6 @@ declare const Drawer: ({ isOpen, children, hideDismissIcon, customClass, size, i
333
346
 
334
347
  type DropdownTypes = 'button' | 'input';
335
348
  type DefaultDropdownItem = {
336
- id: string | number;
337
- name?: string;
338
- disabled?: boolean;
339
349
  [key: string]: any;
340
350
  };
341
351
  interface DropdownProps<T extends DefaultDropdownItem = DefaultDropdownItem> {
@@ -354,11 +364,11 @@ interface DropdownProps<T extends DefaultDropdownItem = DefaultDropdownItem> {
354
364
  /**
355
365
  * Function to be called when the selected item changes
356
366
  */
357
- onChange?: (item?: T | null) => void;
367
+ onChange?: (item: T | null) => void;
358
368
  /**
359
369
  * Fuction to give the string representation of the item
360
370
  */
361
- itemToString: (item: T | null, type?: 'list-item' | 'display') => string;
371
+ itemToString: (item: T, type?: 'list-item' | 'display' | 'downshift') => string;
362
372
  /**
363
373
  * Fuction to give the string representation of the item
364
374
  */
@@ -371,6 +381,10 @@ interface DropdownProps<T extends DefaultDropdownItem = DefaultDropdownItem> {
371
381
  * Is the dropdown read only
372
382
  */
373
383
  readOnly?: boolean;
384
+ /**
385
+ * Is the dropdown read only
386
+ */
387
+ showTick?: boolean;
374
388
  /**
375
389
  * Whether disabled select
376
390
  */
@@ -602,7 +616,7 @@ type MenuProps<T extends MenuItemProps = MenuItemProps> = {
602
616
  * Menu is a container for Menu Item components.
603
617
  * Menu item is a component to define each row of a menu components. It takes in prefix, suffix and default slot to place content either at beginning or end or middle of the row respectively.
604
618
  */
605
- declare const Menu: (props: MenuProps) => react__default.JSX.Element;
619
+ declare const Menu: <T extends MenuItemProps>(props: MenuProps<T>) => react__default.JSX.Element;
606
620
 
607
621
  type ModalAlignType = 'top' | 'center' | 'bottom';
608
622
  type ModalPositionType = 'left' | 'center' | 'right';
@@ -651,8 +665,10 @@ interface ModalProps {
651
665
  */
652
666
  declare const Modal: ({ isOpen, children, align, customClass, fullWidth, customModalContentStyles, onDismiss, position, size, }: ModalProps) => react__default.JSX.Element;
653
667
 
654
- type DefaultMultiSelectDropdownItem = {};
655
- interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem> {
668
+ type DefaultMultiSelectDropdownItem = {
669
+ [key: string]: any;
670
+ };
671
+ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem = DefaultMultiSelectDropdownItem> {
656
672
  /**
657
673
  * dropdown item content
658
674
  */
@@ -662,14 +678,18 @@ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem> {
662
678
  */
663
679
  itemIdentifier?: string;
664
680
  /**
665
- * default selected item of dropdown
681
+ * selected item of dropdown
666
682
  */
667
- defaultSelectedItem?: T | null;
683
+ selectedItem?: T[];
668
684
  /**
669
685
  * Called when select an option or input value change
670
686
  */
671
- onChange?: (item?: T | null) => void;
672
- itemToString: (item: T | null) => string;
687
+ onChange?: (item: T[]) => void;
688
+ itemToString?: (item: T, type?: 'list-item' | 'display' | 'downshift') => string;
689
+ /**
690
+ * Fuction to give the string representation of the item
691
+ */
692
+ itemComponent?: (item: T) => React.ReactNode | string;
673
693
  /**
674
694
  * Is the dropdown readonly
675
695
  */
@@ -712,11 +732,13 @@ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem> {
712
732
  * Is menu loading?
713
733
  */
714
734
  isMenuLoading?: boolean;
735
+ inputValue?: string | null;
715
736
  handleInputChange?: (inputValue: string) => void;
716
737
  onCustomValueAdd?: (item: {
717
738
  inputValue: string;
718
739
  customValues: boolean;
719
740
  }) => void;
741
+ removeSelectedItem?: (item: T, index: number) => void;
720
742
  /**
721
743
  * Is this custom value
722
744
  */
@@ -730,14 +752,23 @@ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem> {
730
752
  */
731
753
  label?: string;
732
754
  placeholder?: string;
733
- useSelectProps?: UseSelectProps<T>;
755
+ useMultipleSelectionProps?: UseMultipleSelectionProps<T>;
734
756
  useComboboxProps?: UseComboboxProps<T>;
757
+ InputProps?: React.InputHTMLAttributes<HTMLInputElement>;
758
+ onBackSpace?: () => void;
759
+ maxAllowedLength?: number;
760
+ isDynamicMenu?: boolean;
761
+ minAllowedLength?: number;
762
+ locale?: {
763
+ createText: string;
764
+ deleteText: string;
765
+ };
735
766
  }
736
767
 
737
768
  /**
738
769
  * MultiSelectDropdown displays a list or drop-down box that enables selection of an option or multiple options from an available list of values.
739
770
  */
740
- declare const MultiSelectDropdown: <T extends DefaultMultiSelectDropdownItem>({ itemIdentifier, label, id, items, onChange, placeholder, readOnly, disabled, isRequired, itemToString, name, filterKey, width, useSelectProps, emptyItemsText, getCustomMessage, onCustomValueAdd, customValues, hideClear, defaultSelectedItem, handleInputChange, isErrored, isMenuLoading, errorText, }: MultiSelectDropdownProps<T>) => react__default.JSX.Element;
771
+ 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, selectedItem, handleInputChange, isErrored, isMenuLoading, errorText, InputProps, itemComponent, isDynamicMenu, locale, maxAllowedLength, minAllowedLength, onBackSpace, }: MultiSelectDropdownProps<T>) => react__default.JSX.Element;
741
772
 
742
773
  type DefaultProps = {
743
774
  /**
@@ -782,6 +813,13 @@ type DateTimePickerProps = DefaultProps & Partial<DateInput3Props> & {
782
813
  type DateTimeRangePickerProps = DefaultProps & Partial<DateRangeInput3Props> & {
783
814
  displayFormat?: string;
784
815
  };
816
+ type TimePickerProps = DefaultProps & {
817
+ displayFormat?: string;
818
+ value?: string;
819
+ onChange?: (dateString: string | null) => void;
820
+ useAmPm?: boolean;
821
+ precision?: TimePrecision;
822
+ };
785
823
 
786
824
  /**
787
825
  * Datepicker displays an input box with a calendar that enables selecting a date or date range. The values preselected in the input box and calendar are based on the fw-datepicker attribute values.
@@ -807,6 +845,11 @@ declare const DateRangePicker: (props: DateRangePickerProps) => react__default.J
807
845
  */
808
846
  declare const DateTimeRangePicker: (props: DateTimeRangePickerProps) => react__default.JSX.Element;
809
847
 
848
+ /**
849
+ * TimePicker displays an input box with a calendar that enables selecting a date or date range. The values preselected in the input box and calendar are based on the fw-datepicker attribute values.
850
+ */
851
+ declare const TimePicker: (props: TimePickerProps) => react__default.JSX.Element;
852
+
810
853
  type Origin = {
811
854
  vertical?: 'top' | 'center' | 'bottom';
812
855
  horizontal?: 'left' | 'center' | 'right';
@@ -1297,13 +1340,64 @@ type ReorderProps<T extends ReorderItemType = ReorderItemType> = {
1297
1340
  declare const Reorder: <T extends ReorderItemType = ReorderItemType>(props: ReorderProps<T>) => react__default.JSX.Element;
1298
1341
 
1299
1342
  type RowData = unknown | object | any[];
1343
+ interface FuiTableColumnType<T extends RowData> {
1344
+ id: string;
1345
+ Header: string;
1346
+ accessorFn: (row: T) => React.ReactNode | string | null;
1347
+ disableSortBy?: boolean;
1348
+ }
1300
1349
  interface TableProps<T extends RowData> {
1301
1350
  /**
1302
1351
  * How large should the button be?
1303
1352
  */
1304
1353
  data: CoreOptions<T>['data'];
1305
- columns: CoreOptions<T>['columns'];
1354
+ columns: FuiTableColumnType<T>[];
1306
1355
  showFooter?: boolean;
1356
+ count?: number;
1357
+ pageSize?: number;
1358
+ pageIndex?: number;
1359
+ columnOrder?: string[];
1360
+ hiddenColumns?: string[];
1361
+ selectedRowIds?: Record<string, boolean>;
1362
+ disableSelectMenuOptionIds?: string[];
1363
+ hideSelectMenuOptionIds?: string[];
1364
+ selectMenuOptions?: any[];
1365
+ selectMenuOptionsHandler?: (option: any) => void;
1366
+ setPageIndex?: (pageIndex: number) => void | React.Dispatch<React.SetStateAction<number>>;
1367
+ setSelectedRowIds?: (selectedRowIds: Record<string, boolean>) => void | React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
1368
+ onRowClick?: (row: any, column: any) => void;
1369
+ onNextPageClick?: () => void;
1370
+ onPreviousPageClick?: () => void;
1371
+ rowPropGetter?: (row: any) => any;
1372
+ cellPropGetter?: (cell: any) => any;
1373
+ rowMenuOptions?: (rowData?: any) => any[];
1374
+ onSelectAllRows?: (checked: boolean) => void;
1375
+ onRowSelect?: (row: any, checked: boolean) => void;
1376
+ onMenuOptionSelect?: (optionId: string, row: any) => void;
1377
+ tableOptions?: any;
1378
+ enableNextPage?: boolean;
1379
+ enablePreviousPage?: boolean;
1380
+ isLoading?: boolean;
1381
+ isFetching?: boolean;
1382
+ hideActions?: boolean;
1383
+ hideFilters?: boolean;
1384
+ hideTableOnEmpty?: boolean;
1385
+ disableSelectMenuOptions?: boolean;
1386
+ disableRowSelect?: boolean;
1387
+ hideTopPagination?: boolean;
1388
+ showTableOnLoading?: boolean;
1389
+ indeterminateCount?: boolean;
1390
+ hideSelectAllInTable?: boolean;
1391
+ hideBottomPagination?: boolean;
1392
+ hideLoaderOnTopPagination?: boolean;
1393
+ dataKey?: string;
1394
+ loaderStyles?: React.CSSProperties;
1395
+ infoComponent?: React.ReactElement;
1396
+ actionComponent?: React.ReactElement;
1397
+ filterComponent?: React.ReactElement;
1398
+ headerComponent?: React.ReactElement;
1399
+ emptyComponent?: React.ReactElement;
1400
+ loadingComponent?: React.ReactElement;
1307
1401
  }
1308
1402
 
1309
1403
  /**
@@ -2486,7 +2580,7 @@ interface TagProps {
2486
2580
  /**
2487
2581
  * Function to be called when the tag is closed
2488
2582
  */
2489
- onClose?: () => void;
2583
+ onClose?: React.MouseEventHandler<HTMLButtonElement>;
2490
2584
  /**
2491
2585
  * Children of the tag
2492
2586
  */
@@ -2494,7 +2588,7 @@ interface TagProps {
2494
2588
  /**
2495
2589
  * Props for the icon
2496
2590
  */
2497
- iconProps?: React.HTMLAttributes<HTMLButtonElement>;
2591
+ iconProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
2498
2592
  }
2499
2593
 
2500
2594
  /**
@@ -2649,7 +2743,7 @@ interface ToastType {
2649
2743
  /**
2650
2744
  * How large should the button be?
2651
2745
  */
2652
- text?: string;
2746
+ text?: string | React.ReactNode;
2653
2747
  /**
2654
2748
  * How large should the button be?
2655
2749
  */
@@ -5943,4 +6037,4 @@ declare const slideRightAndFade: () => styled_components.RuleSet<object>;
5943
6037
  declare const slideDownAndFade: () => styled_components.RuleSet<object>;
5944
6038
  declare const slideLeftAndFade: () => styled_components.RuleSet<object>;
5945
6039
 
5946
- export { Alert, type AlertProps, type BaseProps, BoxedRadio, type BoxedRadioItemProps, type BoxedRadioProps, Button, ButtonDropdown, type ButtonDropdownItemProps, type ButtonDropdownProps, type ButtonProps, type ButtonSizeKey, type ButtonVariant, CardActions, CardContent, CardDescription, CardText, CardTitle, Checkbox, type CheckboxProps, ChevronUp, Confirmation, type ConfirmationProps, Cross as CrossIcon, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, DateTimePicker, type DateTimePickerProps, DateTimeRangePicker, type DateTimeRangePickerProps, type DefaultDropdownItem, type DefaultMultiSelectDropdownItem, type DefaultProps, Drawer, type DrawerPlacement, type DrawerProps, type DrawerSizeType, Dropdown, type DropdownProps, type DropdownTypes, ErrorText, Fade, type FadeProps, type FreemiumUiTheme, FreshLink, type FreshworksPalette, type FuiContextType, IconButton, Input, InputLabel, type InputProps, type LevelType, Loader, type LoaderPropTypes, type LoaderSizes, type LoaderSpeeds, Menu, type MenuItemProps, type MenuProps, Modal, type ModalAlignType, type ModalCssType, type ModalPositionType, type ModalProps, type ModalSizeType, MultiSelectDropdown, type MultiSelectDropdownProps, type Origin, Popover, PopoverClose, type PopoverProps, Radio, RadioGroup, type RadioGroupProps, type RadioItemProps, type RadioProps, Reorder, type ReorderItemType, type ReorderProps, RequiredIndicator, type RowData, Slide, SlideFade, type SlideFadeProps, type SlidePlacement, type SlideProps, StyledLabel, Table, type TableProps, Tabs, TabsContent, type TabsItemProps, TabsList, type TabsProps, TabsRoot, TabsTrigger, Tag, type TagProps, TextArea, type TextAreaProps, ThemeProvider, type ThemeProviderType, TickIcon, type ToastContextType, type ToastItemProps, ToastProvider, type ToastType, type ToastTypes, type ToastWithID, Toggle, type ToggleProps, type ToggleSizes, Tooltip, type TooltipAlign, type TooltipPosition, type TooltipProps, type TooltipSide, Transition, type TransitionProps, type TransitionStyleState, type TransitionStyles, TriggerButtonWrapper, Typography, type TypographyProps, type TypographyVariantType, type TypographyWeightType, type UpdateToastsFunction, Warning, basicHide, basicShow, contentHide, contentShow, slideDownAndFade, slideLeftAndFade, slideRightAndFade, slideUpAndFade, useToasts };
6040
+ export { Alert, type AlertProps, type BaseProps, BoxedRadio, type BoxedRadioItemProps, type BoxedRadioProps, Button, ButtonDropdown, type ButtonDropdownItemProps, type ButtonDropdownProps, type ButtonProps, type ButtonSizeKey, type ButtonVariant, CardActions, CardContent, CardDescription, CardText, CardTitle, Checkbox, type CheckboxProps, ChevronUp, Confirmation, type ConfirmationProps, Cross as CrossIcon, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, DateTimePicker, type DateTimePickerProps, DateTimeRangePicker, type DateTimeRangePickerProps, type DefaultDropdownItem, type DefaultMultiSelectDropdownItem, type DefaultProps, Drawer, type DrawerPlacement, type DrawerProps, type DrawerSizeType, Dropdown, type DropdownProps, type DropdownTypes, ErrorText, Fade, type FadeProps, type FreemiumUiTheme, FreshLink, type FreshworksPalette, type FuiContextType, IconButton, Input, InputLabel, type InputProps, type LevelType, Loader, type LoaderPropTypes, type LoaderSizes, type LoaderSpeeds, Menu, type MenuItemProps, type MenuProps, Modal, type ModalAlignType, type ModalCssType, type ModalPositionType, type ModalProps, type ModalSizeType, MultiSelectDropdown, type MultiSelectDropdownProps, type Origin, Popover, PopoverClose, type PopoverProps, Radio, RadioGroup, type RadioGroupProps, type RadioItemProps, type RadioProps, Reorder, type ReorderItemType, type ReorderProps, RequiredIndicator, type RowData, Slide, SlideFade, type SlideFadeProps, type SlidePlacement, type SlideProps, StyledLabel, Table, type TableProps, Tabs, TabsContent, type TabsItemProps, TabsList, type TabsProps, TabsRoot, TabsTrigger, Tag, type TagProps, TextArea, type TextAreaProps, ThemeProvider, type ThemeProviderType, TickIcon, TimePicker, type TimePickerProps, type ToastContextType, type ToastItemProps, ToastProvider, type ToastType, type ToastTypes, type ToastWithID, Toggle, type ToggleProps, type ToggleSizes, Tooltip, type TooltipAlign, type TooltipPosition, type TooltipProps, type TooltipSide, Transition, type TransitionProps, type TransitionStyleState, type TransitionStyles, TriggerButtonWrapper, Typography, type TypographyProps, type TypographyVariantType, type TypographyWeightType, type UpdateToastsFunction, Warning, basicHide, basicShow, contentHide, contentShow, slideDownAndFade, slideLeftAndFade, slideRightAndFade, slideUpAndFade, useToasts };