@delightui/components 0.1.3 → 0.1.5

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.
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import type { ListProps } from './List.types';
3
- declare const List: <T>(props: ListProps<T>) => React.JSX.Element;
4
- export default List;
2
+ import type { ListItemType, ListProps } from './List.types';
3
+ declare const ListWrapper: <T extends ListItemType>(props: ListProps<T>) => React.JSX.Element;
4
+ export default ListWrapper;
@@ -1,9 +1,12 @@
1
- import type { HTMLAttributes } from 'react';
1
+ import type { Dispatch, HTMLAttributes, SetStateAction } from 'react';
2
2
  /**
3
3
  * Enum for the alignment of the list.
4
4
  */
5
5
  export type ListAlignEnum = 'Horizontal' | 'Vertical';
6
- export type ListProps<T> = HTMLAttributes<HTMLUListElement> & {
6
+ export type ListItemType = object & {
7
+ id?: string | number;
8
+ };
9
+ export type ListProps<T extends ListItemType> = HTMLAttributes<HTMLUListElement> & {
7
10
  /**
8
11
  * The data to be rendered in the list.
9
12
  */
@@ -29,4 +32,15 @@ export type ListProps<T> = HTMLAttributes<HTMLUListElement> & {
29
32
  * Additional class for styling.
30
33
  */
31
34
  className?: string;
35
+ /**
36
+ * Flag to enable sorting of list items
37
+ */
38
+ sortable?: boolean;
39
+ /**
40
+ * callback function to update the current order of data
41
+ *
42
+ * @param data
43
+ * @returns
44
+ */
45
+ updateSortOrder?: Dispatch<SetStateAction<T[]>>;
32
46
  };
@@ -39,6 +39,11 @@ export interface TextProps {
39
39
  * @default false
40
40
  */
41
41
  noWrap?: boolean;
42
+ /**
43
+ * Flag to handle how white space inside an element is handled.
44
+ * @default false
45
+ */
46
+ whiteSpaceNoWrap?: boolean;
42
47
  /**
43
48
  * Flag to italicize the text.
44
49
  * @default false
@@ -1,3 +1,5 @@
1
+ import FlatPickr from 'react-flatpickr';
2
+ type DatePickerPosition = 'auto' | 'above' | 'below' | 'auto left' | 'auto center' | 'auto right' | 'above left' | 'above center' | 'above right' | 'below left' | 'below center' | 'below right';
1
3
  export type DatePickerProps = {
2
4
  /**
3
5
  * Additional class for styling.
@@ -53,4 +55,18 @@ export type DatePickerProps = {
53
55
  * render date picker inline
54
56
  */
55
57
  inline?: boolean;
58
+ /**
59
+ * Hide calendar for only time picker.
60
+ * @default false
61
+ */
62
+ noCalendar?: boolean;
63
+ /**
64
+ * The Flatpickr ref.
65
+ */
66
+ datePickerRef?: React.RefObject<FlatPickr>;
67
+ /**
68
+ * Datepicker position
69
+ */
70
+ position?: DatePickerPosition;
56
71
  };
72
+ export {};
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- import type { PopoverProps } from './Popover.types';
2
+ import type { PopoverHandle, PopoverProps } from './Popover.types';
3
3
  /**
4
- * Popover component definition.
4
+ * Popover component that displays a floating content element in relation to a target element.
5
+ * It can be triggered via different user actions like 'Click' or 'Hover'.
5
6
  */
6
- declare const Popover: (props: PopoverProps) => React.JSX.Element;
7
+ declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<PopoverHandle>>;
7
8
  export default Popover;
@@ -39,6 +39,10 @@ export type PopoverProps = {
39
39
  * Function to handle hiding the Popover.
40
40
  */
41
41
  onHide?: () => void;
42
+ /**
43
+ * Function to handle hiding the Popover.
44
+ */
45
+ onOpen?: () => void;
42
46
  /**
43
47
  * Direction in which the Popover should open.
44
48
  * @default 'Down'
@@ -78,8 +82,21 @@ export type PopoverProps = {
78
82
  * @default false
79
83
  */
80
84
  disabled?: boolean;
85
+ /**
86
+ * Indicates if content should change placement to stay on the screen.
87
+ * @default false
88
+ */
89
+ flip?: boolean;
81
90
  /**
82
91
  * Additional class for styling.
83
92
  */
84
93
  className?: string;
94
+ /**
95
+ * Additional class for overlay container styling.
96
+ */
97
+ overlayClassName?: string;
98
+ };
99
+ export type PopoverHandle = {
100
+ close: () => void;
101
+ open: () => void;
85
102
  };
@@ -1,4 +1,4 @@
1
1
  import Popover from './Popover';
2
- import type { PopoverProps } from './Popover.types';
3
- export type { PopoverProps };
2
+ import type { PopoverProps, PopoverHandle } from './Popover.types';
3
+ export type { PopoverProps, PopoverHandle };
4
4
  export default Popover;
@@ -121,6 +121,10 @@ export type SelectViewProps = Omit<HTMLAttributes<HTMLElement>, 'style' | 'child
121
121
  * Additional CSS classes for customization.
122
122
  */
123
123
  className?: string;
124
+ /**
125
+ * The component used to render each item in the list.
126
+ */
127
+ selectedView?: React.FC<any>;
124
128
  };
125
129
  /**
126
130
  * Props for the Select component, combining provider and view props.
@@ -15,6 +15,7 @@ export declare const renderChildren: (children: ReactNode, options?: {
15
15
  defaultWeight?: TextWeightEnum;
16
16
  defaultType?: TextTypeEnum;
17
17
  noWrap?: boolean;
18
+ whiteSpaceNoWrap?: boolean;
18
19
  as?: "span";
19
20
  }) => ReactElement;
20
21
  /**
@@ -494,6 +494,10 @@
494
494
  --text-wrap: nowrap;
495
495
  }
496
496
 
497
+ .Text-module_whiteSpaceNoWrap__GYqL2 {
498
+ white-space: nowrap;
499
+ }
500
+
497
501
  .Text-module_capitalize__r9qCk {
498
502
  text-transform: capitalize;
499
503
  }
@@ -1735,6 +1739,9 @@ span.flatpickr-weekday {
1735
1739
  .flatpickr-calendar .flatpickr-months .flatpickr-current-month {
1736
1740
  color: var(--datePicker-cur-month-color);
1737
1741
  }
1742
+ .flatpickr-calendar .flatpickr-months .flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
1743
+ background-color: var(--datePicker-background-color);
1744
+ }
1738
1745
  .flatpickr-calendar .flatpickr-months .arrowUp,
1739
1746
  .flatpickr-calendar .flatpickr-months .arrowDown {
1740
1747
  display: none;
@@ -2101,6 +2108,8 @@ span.flatpickr-weekday {
2101
2108
  border-radius: var(--select-options-border-radius);
2102
2109
  border: var(--select-options-border-width) solid var(--select-options-border-color);
2103
2110
  background-color: var(--select-options-background-color);
2111
+ max-height: 160px;
2112
+ overflow-y: auto;
2104
2113
  }
2105
2114
  .Select-module_select__sbUrw .Select-module_options__UwfeB .Select-module_resetOption__dvBeU {
2106
2115
  display: flex;