@wavv/ui 2.0.0-alpha.0 → 2.0.0-alpha.2

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,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { InputFocusEvent, ThemeProp } from './types';
2
+ import { InputFocusEvent, MarginPadding, ThemeProp, WidthHeight } from './types';
3
3
  type FocusCallBack = (event?: InputFocusEvent) => void;
4
4
  export declare const useInputFocus: (onFocus?: FocusCallBack, onBlur?: FocusCallBack, focusCondition?: boolean) => {
5
5
  focused: boolean;
@@ -7,6 +7,21 @@ export declare const useInputFocus: (onFocus?: FocusCallBack, onBlur?: FocusCall
7
7
  handleBlur: (event?: InputFocusEvent) => void;
8
8
  };
9
9
  export declare const isInputFilled: (value?: string | number) => boolean;
10
+ export type InputContainerProps = {
11
+ backgroundColor?: string;
12
+ borderRadius?: number | string;
13
+ borderless?: boolean;
14
+ borderColor?: string;
15
+ fontSize?: number | string;
16
+ placeholderColor?: string;
17
+ pointer?: boolean;
18
+ readOnly?: boolean;
19
+ textOnly?: boolean;
20
+ focused?: boolean;
21
+ invalid?: boolean;
22
+ disabled?: boolean;
23
+ hasLabel?: boolean;
24
+ } & WidthHeight & MarginPadding & ThemeProp;
10
25
  export declare const InputContainer: import("@emotion/styled").StyledComponent<{
11
26
  theme?: import("@emotion/react").Theme | undefined;
12
27
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -15,6 +30,8 @@ export declare const InputContainer: import("@emotion/styled").StyledComponent<{
15
30
  borderRadius?: string | number | undefined;
16
31
  borderless?: boolean | undefined;
17
32
  borderColor?: string | undefined;
33
+ fontSize?: string | number | undefined;
34
+ placeholderColor?: string | undefined;
18
35
  pointer?: boolean | undefined;
19
36
  readOnly?: boolean | undefined;
20
37
  textOnly?: boolean | undefined;
@@ -52,6 +69,8 @@ declare const _default: {
52
69
  borderRadius?: string | number | undefined;
53
70
  borderless?: boolean | undefined;
54
71
  borderColor?: string | undefined;
72
+ fontSize?: string | number | undefined;
73
+ placeholderColor?: string | undefined;
55
74
  pointer?: boolean | undefined;
56
75
  readOnly?: boolean | undefined;
57
76
  textOnly?: boolean | undefined;
@@ -0,0 +1,65 @@
1
+ /// <reference types="react" />
2
+ import { OptionItem } from './Dropdown/DropdownUtils';
3
+ import { Margin, WidthHeight } from './types';
4
+ type SelectProps<OptionType> = {
5
+ /** The function to be called when an option is selected */
6
+ onChange?: (item: OptionType | null) => void;
7
+ /** The value of the Select */
8
+ value?: string;
9
+ /** The function to be called when the Select is opened */
10
+ afterShow?: () => void;
11
+ /** The function to be called when the Select is closed */
12
+ afterHide?: () => void;
13
+ /** Sets the input placeholder text */
14
+ placeholder?: string;
15
+ /** Sets the input placeholder color */
16
+ placeholderColor?: string;
17
+ /** The options to be displayed */
18
+ options?: OptionType[];
19
+ /** Removes the border from the Select input */
20
+ borderless?: boolean;
21
+ /** Sets the input borderColor */
22
+ borderColor?: string;
23
+ /** Sets the input backgroundColor */
24
+ backgroundColor?: string;
25
+ /** Removes the border and background-color from the Select input */
26
+ textOnly?: boolean;
27
+ /** Adds a label to the Select input */
28
+ label?: string;
29
+ /** Sets the id of the Select input or trigger */
30
+ id?: string;
31
+ /** Sets the Select fontSize */
32
+ fontSize?: number | string;
33
+ /** Places a description message below the Select */
34
+ description?: string;
35
+ /** Disables the Select */
36
+ disabled?: boolean;
37
+ /** Sets the Select's bottom border and description text to red */
38
+ invalid?: boolean;
39
+ /** zIndex of the menu's portal container */
40
+ zIndex?: number;
41
+ /** Controls the open state of the menu */
42
+ open?: boolean;
43
+ } & WidthHeight & Margin;
44
+ declare const Select: <OptionType extends OptionItem>({ onChange, afterShow, afterHide, placeholder, placeholderColor, value, options, borderless, borderColor, backgroundColor, textOnly, width, label, id, fontSize, description, disabled, invalid, zIndex, open, ...props }: SelectProps<OptionType>) => import("react/jsx-runtime").JSX.Element;
45
+ export declare const Trigger: import("@emotion/styled").StyledComponent<{
46
+ theme?: import("@emotion/react").Theme | undefined;
47
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
48
+ } & {
49
+ backgroundColor?: string | undefined;
50
+ borderRadius?: string | number | undefined;
51
+ borderless?: boolean | undefined;
52
+ borderColor?: string | undefined;
53
+ fontSize?: string | number | undefined;
54
+ placeholderColor?: string | undefined;
55
+ pointer?: boolean | undefined;
56
+ readOnly?: boolean | undefined;
57
+ textOnly?: boolean | undefined;
58
+ focused?: boolean | undefined;
59
+ invalid?: boolean | undefined;
60
+ disabled?: boolean | undefined;
61
+ hasLabel?: boolean | undefined;
62
+ } & import("./types").Width & import("./types").Height & Margin & import("./types").Padding & import("./types").ThemeProp & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
63
+ theme?: import("@emotion/react").Theme | undefined;
64
+ }, {}, {}>;
65
+ export default Select;
@@ -29,36 +29,37 @@ export { default as Pagination } from './components/Pagination';
29
29
  export { default as PieChart } from './components/PieChart';
30
30
  export { default as Progress } from './components/Progress';
31
31
  export { default as Radio } from './components/Radio';
32
- export { default as ResetStyles } from './global-styles/ResetStyles';
33
- export { default as ScrollbarStyles } from './global-styles/ScrollbarStyles';
34
- export { default as ToastStyles } from './global-styles/ToastStyles';
32
+ export { default as Select } from './components/Select';
35
33
  export { default as Slider } from './components/Slider';
36
34
  export { default as Spacer } from './components/Spacer';
37
35
  export { default as Spinner } from './components/Spinner';
38
- export { default as TransferList } from './components/TransferList';
39
36
  export { default as Table } from './components/Table';
37
+ export { default as Tabs } from './components/Tabs';
40
38
  export { default as Toggle } from './components/Toggle';
41
39
  export { default as Tooltip } from './components/Tooltip';
42
- export { default as Tabs } from './components/Tabs';
40
+ export { default as TransferList } from './components/TransferList';
41
+ export { default as ResetStyles } from './global-styles/ResetStyles';
42
+ export { default as ScrollbarStyles } from './global-styles/ScrollbarStyles';
43
+ export { default as ToastStyles } from './global-styles/ToastStyles';
43
44
  export { default as theme } from './theme';
44
45
  export { default as colors } from './theme/colors';
45
46
  export { default as darkScale } from './theme/darkScale';
46
47
  export { default as lightScale } from './theme/lightScale';
47
- export type { ITheme, ThemeProp } from './theme/ThemeTypes';
48
+ export type { DropdownOption } from './components/Dropdown';
48
49
  export type { IconNames } from './components/Icon/icons';
49
50
  export type { TabItem } from './components/Tabs';
50
- export type { DropdownOption } from './components/Dropdown';
51
- export type { Item as TransferItem, Action as TransferAction, Next as TransferNext } from './components/TransferList';
52
- export type { AudioRef, DraftEditorRef, InputRef, MultiSelectRef, Margin, Padding, Position, MinWidth, MaxWidth, MinHeight, MaxHeight, MinWidthHeight, MaxWidthHeight, Width, Height, WidthHeight, MarginPadding, FlexPosition, AsProp as As, } from './components/types';
51
+ export type { Action as TransferAction, Item as TransferItem, Next as TransferNext } from './components/TransferList';
52
+ export type { AsProp as As, AudioRef, DraftEditorRef, FlexPosition, Height, InputRef, Margin, MarginPadding, MaxHeight, MaxWidth, MaxWidthHeight, MinHeight, MinWidth, MinWidthHeight, MultiSelectRef, Padding, Position, Width, WidthHeight, } from './components/types';
53
+ export type { ITheme, ThemeProp } from './theme/ThemeTypes';
54
+ export { default as useConfirm } from './hooks/useConfirm';
55
+ export { default as useElementObserver } from './hooks/useElementObserver';
53
56
  export { default as useEventListener } from './hooks/useEventListener';
54
57
  export { default as useOnClickOutside } from './hooks/useOnClickOutside';
58
+ export { default as usePrevious } from './hooks/usePrevious';
55
59
  export { default as useSelect } from './hooks/useSelect';
56
60
  export { default as useSelectAll } from './hooks/useSelectAll';
57
61
  export { default as useWindowSize } from './hooks/useWindowSize';
58
- export { default as useConfirm } from './hooks/useConfirm';
59
- export { default as useElementObserver } from './hooks/useElementObserver';
60
- export { default as usePrevious } from './hooks/usePrevious';
61
- export { default as formatDate } from './utils/formatDate';
62
+ export { marginProps, paddingProps, positionProps, widthHeightProps } from './components/helpers/styledProps';
62
63
  export { default as copyToClipboard } from './utils/copyToClipboard';
64
+ export { default as formatDate } from './utils/formatDate';
63
65
  export { default as numberWithCommas } from './utils/numberWithCommas';
64
- export { widthHeightProps, paddingProps, marginProps, positionProps } from './components/helpers/styledProps';
package/build/index.d.ts CHANGED
@@ -2034,6 +2034,8 @@ declare const _default: {
2034
2034
  borderRadius?: string | number | undefined;
2035
2035
  borderless?: boolean | undefined;
2036
2036
  borderColor?: string | undefined;
2037
+ fontSize?: string | number | undefined;
2038
+ placeholderColor?: string | undefined;
2037
2039
  pointer?: boolean | undefined;
2038
2040
  readOnly?: boolean | undefined;
2039
2041
  textOnly?: boolean | undefined;
@@ -2378,17 +2380,47 @@ type RadioProps = {
2378
2380
  } & Margin & AsProp & HTMLProps<HTMLInputElement>;
2379
2381
  declare const Radio: ({ id, label, labelPosition, checked, disabled, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: RadioProps) => react_jsx_runtime.JSX.Element;
2380
2382
 
2381
- type ResetStylesProps = {
2382
- /** An array of font families to pass to the font loader */
2383
- families?: string[];
2384
- /** The default font family to set */
2385
- fontFamily?: string;
2386
- };
2387
- declare const ResetStyles: ({ families, fontFamily }: ResetStylesProps) => react_jsx_runtime.JSX.Element;
2388
-
2389
- declare const ScrollbarStyles: () => react_jsx_runtime.JSX.Element;
2390
-
2391
- declare const ToastStyles: () => react_jsx_runtime.JSX.Element;
2383
+ type SelectProps<OptionType> = {
2384
+ /** The function to be called when an option is selected */
2385
+ onChange?: (item: OptionType | null) => void;
2386
+ /** The value of the Select */
2387
+ value?: string;
2388
+ /** The function to be called when the Select is opened */
2389
+ afterShow?: () => void;
2390
+ /** The function to be called when the Select is closed */
2391
+ afterHide?: () => void;
2392
+ /** Sets the input placeholder text */
2393
+ placeholder?: string;
2394
+ /** Sets the input placeholder color */
2395
+ placeholderColor?: string;
2396
+ /** The options to be displayed */
2397
+ options?: OptionType[];
2398
+ /** Removes the border from the Select input */
2399
+ borderless?: boolean;
2400
+ /** Sets the input borderColor */
2401
+ borderColor?: string;
2402
+ /** Sets the input backgroundColor */
2403
+ backgroundColor?: string;
2404
+ /** Removes the border and background-color from the Select input */
2405
+ textOnly?: boolean;
2406
+ /** Adds a label to the Select input */
2407
+ label?: string;
2408
+ /** Sets the id of the Select input or trigger */
2409
+ id?: string;
2410
+ /** Sets the Select fontSize */
2411
+ fontSize?: number | string;
2412
+ /** Places a description message below the Select */
2413
+ description?: string;
2414
+ /** Disables the Select */
2415
+ disabled?: boolean;
2416
+ /** Sets the Select's bottom border and description text to red */
2417
+ invalid?: boolean;
2418
+ /** zIndex of the menu's portal container */
2419
+ zIndex?: number;
2420
+ /** Controls the open state of the menu */
2421
+ open?: boolean;
2422
+ } & WidthHeight & Margin;
2423
+ declare const Select: <OptionType extends OptionItem>({ onChange, afterShow, afterHide, placeholder, placeholderColor, value, options, borderless, borderColor, backgroundColor, textOnly, width, label, id, fontSize, description, disabled, invalid, zIndex, open, ...props }: SelectProps<OptionType>) => react_jsx_runtime.JSX.Element;
2392
2424
 
2393
2425
  type SliderProps = {
2394
2426
  /** The current position of the slider knob */
@@ -2423,50 +2455,6 @@ type SpinnerProps = {
2423
2455
  } & Margin & Position;
2424
2456
  declare const Spinner: ({ size, color, center, background, zIndex, margin, marginTop, marginBottom, marginRight, marginLeft, position, top, bottom, right, left, ...props }: SpinnerProps) => react_jsx_runtime.JSX.Element;
2425
2457
 
2426
- type Color = ColorNames | CSSProperties['color'];
2427
- type Item = {
2428
- /** Unique ID of the item */
2429
- id: number | string;
2430
- /** The text displayed for the transfer item */
2431
- label: string;
2432
- /** Used as the data of the item */
2433
- value?: unknown;
2434
- /** If both `header` and `body` are provided, this text will be styled as the transfer item's header */
2435
- header?: string;
2436
- /** If both `header` and `body` are provided, this text will be styled as the transfer item's body */
2437
- body?: string;
2438
- /** Any element to be displayed to the left of the item's label/header/body */
2439
- leftElement?: ReactElement;
2440
- /** Any element to be displayed to the right of the item's label/header/body */
2441
- rightElement?: ReactElement;
2442
- /** The left border color of the transfer item */
2443
- color?: Color;
2444
- /** Used to preselect an item */
2445
- selected?: boolean;
2446
- [key: string]: unknown;
2447
- };
2448
- type Action = 'select' | 'remove';
2449
- type Next = (item?: Item) => void;
2450
- type TransferListProps = {
2451
- /** Array of objects that will be rendered as individual items in the list */
2452
- items: Item[];
2453
- /** The function called when an item is selected or removed. It passes the entire list of selected items. */
2454
- onChange: (list: Item[]) => void;
2455
- /** The function called before an item is selected or removed */
2456
- beforeItemChange?: (item: Item, action: Action, next: Next) => void;
2457
- /** The header title of the transfer list */
2458
- listTitle?: string;
2459
- /** The text to display in a readOnly state where there are no selected items */
2460
- noItemsMessage?: string;
2461
- /** Disables moving items and only displays the list of selected items */
2462
- readOnly?: boolean;
2463
- /** Hides the select all button */
2464
- hideSelectAll?: boolean;
2465
- /** Hides the remove all button */
2466
- hideRemoveAll?: boolean;
2467
- } & Width & Margin;
2468
- declare const TransferList: ({ items, onChange, beforeItemChange, listTitle, noItemsMessage, hideSelectAll, hideRemoveAll, readOnly, width, margin, marginTop, marginBottom, marginRight, marginLeft, }: TransferListProps) => react_jsx_runtime.JSX.Element;
2469
-
2470
2458
  type Data = {
2471
2459
  [key: string]: unknown;
2472
2460
  };
@@ -2533,22 +2521,6 @@ declare const Table: {
2533
2521
  } & Omit<react.HTMLProps<HTMLDivElement>, "as"> & AsProp) => react_jsx_runtime.JSX.Element;
2534
2522
  };
2535
2523
 
2536
- type ToggleProps = {
2537
- /** Id of the input element */
2538
- id?: string;
2539
- /** Places a label element beside the toggle. The value will set the text of the label */
2540
- label?: string;
2541
- /** Sets the label on the left or right of the toggle */
2542
- labelPosition?: 'left' | 'right';
2543
- /** Disables the toggle */
2544
- disabled?: boolean;
2545
- /** Controls the checked property of the toggle */
2546
- checked?: boolean;
2547
- /** The function called with the toggle value after the toggle is changed */
2548
- onChange: (val: boolean) => void;
2549
- } & Margin & AsProp & CheckboxAttributes;
2550
- declare const Toggle: ({ id, label, labelPosition, checked, disabled, onChange, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: ToggleProps) => react_jsx_runtime.JSX.Element;
2551
-
2552
2524
  type TabItem = {
2553
2525
  /** The id of the tab */
2554
2526
  id: string | number;
@@ -2577,6 +2549,78 @@ type Props$1<ItemType> = {
2577
2549
  } & Margin;
2578
2550
  declare const Tabs: <ItemType extends TabItem>({ items, activeItem, itemWidth, itemGap, onChange, ...props }: Props$1<ItemType>) => react_jsx_runtime.JSX.Element;
2579
2551
 
2552
+ type ToggleProps = {
2553
+ /** Id of the input element */
2554
+ id?: string;
2555
+ /** Places a label element beside the toggle. The value will set the text of the label */
2556
+ label?: string;
2557
+ /** Sets the label on the left or right of the toggle */
2558
+ labelPosition?: 'left' | 'right';
2559
+ /** Disables the toggle */
2560
+ disabled?: boolean;
2561
+ /** Controls the checked property of the toggle */
2562
+ checked?: boolean;
2563
+ /** The function called with the toggle value after the toggle is changed */
2564
+ onChange: (val: boolean) => void;
2565
+ } & Margin & AsProp & CheckboxAttributes;
2566
+ declare const Toggle: ({ id, label, labelPosition, checked, disabled, onChange, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: ToggleProps) => react_jsx_runtime.JSX.Element;
2567
+
2568
+ type Color = ColorNames | CSSProperties['color'];
2569
+ type Item = {
2570
+ /** Unique ID of the item */
2571
+ id: number | string;
2572
+ /** The text displayed for the transfer item */
2573
+ label: string;
2574
+ /** Used as the data of the item */
2575
+ value?: unknown;
2576
+ /** If both `header` and `body` are provided, this text will be styled as the transfer item's header */
2577
+ header?: string;
2578
+ /** If both `header` and `body` are provided, this text will be styled as the transfer item's body */
2579
+ body?: string;
2580
+ /** Any element to be displayed to the left of the item's label/header/body */
2581
+ leftElement?: ReactElement;
2582
+ /** Any element to be displayed to the right of the item's label/header/body */
2583
+ rightElement?: ReactElement;
2584
+ /** The left border color of the transfer item */
2585
+ color?: Color;
2586
+ /** Used to preselect an item */
2587
+ selected?: boolean;
2588
+ [key: string]: unknown;
2589
+ };
2590
+ type Action = 'select' | 'remove';
2591
+ type Next = (item?: Item) => void;
2592
+ type TransferListProps = {
2593
+ /** Array of objects that will be rendered as individual items in the list */
2594
+ items: Item[];
2595
+ /** The function called when an item is selected or removed. It passes the entire list of selected items. */
2596
+ onChange: (list: Item[]) => void;
2597
+ /** The function called before an item is selected or removed */
2598
+ beforeItemChange?: (item: Item, action: Action, next: Next) => void;
2599
+ /** The header title of the transfer list */
2600
+ listTitle?: string;
2601
+ /** The text to display in a readOnly state where there are no selected items */
2602
+ noItemsMessage?: string;
2603
+ /** Disables moving items and only displays the list of selected items */
2604
+ readOnly?: boolean;
2605
+ /** Hides the select all button */
2606
+ hideSelectAll?: boolean;
2607
+ /** Hides the remove all button */
2608
+ hideRemoveAll?: boolean;
2609
+ } & Width & Margin;
2610
+ declare const TransferList: ({ items, onChange, beforeItemChange, listTitle, noItemsMessage, hideSelectAll, hideRemoveAll, readOnly, width, margin, marginTop, marginBottom, marginRight, marginLeft, }: TransferListProps) => react_jsx_runtime.JSX.Element;
2611
+
2612
+ type ResetStylesProps = {
2613
+ /** An array of font families to pass to the font loader */
2614
+ families?: string[];
2615
+ /** The default font family to set */
2616
+ fontFamily?: string;
2617
+ };
2618
+ declare const ResetStyles: ({ families, fontFamily }: ResetStylesProps) => react_jsx_runtime.JSX.Element;
2619
+
2620
+ declare const ScrollbarStyles: () => react_jsx_runtime.JSX.Element;
2621
+
2622
+ declare const ToastStyles: () => react_jsx_runtime.JSX.Element;
2623
+
2580
2624
  declare const darkScale: {
2581
2625
  scale0: string;
2582
2626
  scale1: string;
@@ -2621,10 +2665,32 @@ declare const lightScale: {
2621
2665
  background5: string;
2622
2666
  };
2623
2667
 
2668
+ type Props = {
2669
+ header?: string;
2670
+ text?: string;
2671
+ cancelText?: string;
2672
+ confirmText?: string;
2673
+ input?: boolean;
2674
+ inputLabel?: string;
2675
+ inputPlaceholder?: string;
2676
+ inputValue?: string;
2677
+ negative?: boolean;
2678
+ };
2679
+ declare const useConfirm: ({ header, text, cancelText, confirmText, negative, input, inputLabel, inputPlaceholder, inputValue, }?: Props) => readonly [() => Promise<boolean | string>, () => react_jsx_runtime.JSX.Element];
2680
+
2681
+ /**
2682
+ * A React hook that fires a callback whenever ResizeObserver detects a change to its size
2683
+ * @param target A React ref created by useRef()
2684
+ * @param callback Invoked with a single HTMLElement any time the target resizes
2685
+ */
2686
+ declare const useElementObserver: <T extends HTMLElement>(target: RefObject<T>, callback: (node: T) => void) => void;
2687
+
2624
2688
  declare const useEventListener: <T extends Event>(element: MutableRefObject<HTMLElement> | HTMLElement | Document | Window, type: keyof WindowEventMap, listener: (event: T) => void, condition?: boolean, dependencies?: unknown[]) => void;
2625
2689
 
2626
2690
  declare const useOnClickOutside: <T extends HTMLElement>(onClickOutside: () => void, condition?: boolean, exclusions?: string[]) => MutableRefObject<T | null>;
2627
2691
 
2692
+ declare const usePrevious: <T>(value: T) => T;
2693
+
2628
2694
  type UseSelectProps<OptionType> = {
2629
2695
  /** The options that will be displayed in the list */
2630
2696
  options: OptionType[];
@@ -2661,39 +2727,6 @@ declare const useWindowSize: () => {
2661
2727
  height: number | null;
2662
2728
  };
2663
2729
 
2664
- type Props = {
2665
- header?: string;
2666
- text?: string;
2667
- cancelText?: string;
2668
- confirmText?: string;
2669
- input?: boolean;
2670
- inputLabel?: string;
2671
- inputPlaceholder?: string;
2672
- inputValue?: string;
2673
- negative?: boolean;
2674
- };
2675
- declare const useConfirm: ({ header, text, cancelText, confirmText, negative, input, inputLabel, inputPlaceholder, inputValue, }?: Props) => readonly [() => Promise<boolean | string>, () => react_jsx_runtime.JSX.Element];
2676
-
2677
- /**
2678
- * A React hook that fires a callback whenever ResizeObserver detects a change to its size
2679
- * @param target A React ref created by useRef()
2680
- * @param callback Invoked with a single HTMLElement any time the target resizes
2681
- */
2682
- declare const useElementObserver: <T extends HTMLElement>(target: RefObject<T>, callback: (node: T) => void) => void;
2683
-
2684
- declare const usePrevious: <T>(value: T) => T;
2685
-
2686
- type TimeSpec = 'onlyTime' | 'withTime' | 'relative';
2687
- type TimeOptions = {
2688
- time?: TimeSpec;
2689
- lowercase?: boolean;
2690
- };
2691
- declare const formatDate: (value: Date, option?: TimeSpec | TimeOptions) => string;
2692
-
2693
- declare const copyToClipboard: (text: string) => void;
2694
-
2695
- declare const numberWithCommas: (number: number) => string;
2696
-
2697
2730
  declare const widthHeightProps: ({ width, height }: WidthHeight) => {
2698
2731
  width: string | number | undefined;
2699
2732
  height: string | number | undefined;
@@ -2720,4 +2753,15 @@ declare const positionProps: ({ position, top, bottom, right, left }: Position)
2720
2753
  left: string | number | undefined;
2721
2754
  };
2722
2755
 
2723
- export { Accordion, type AsProp as As, Audio, type AudioRef, BarChart, Button, Calendar, Checkbox, Code, Table$1 as DocTable, DraftEditor, type DraftEditorRef, Dropdown, DropdownMenu, type OptionItem as DropdownOption, type FlexPosition, Form, Grid, type Height, type ITheme, Icon, type IconNames, ImageViewer, InlineCode, Input, type InputRef, _default as InputUtils, Label, LineChart, type Margin, type MarginPadding, type MaxHeight, type MaxWidth, type MaxWidthHeight, Menu, Message, MessageHr, type MinHeight, type MinWidth, type MinWidthHeight, Modal, MultiSelect, type MultiSelectRef, Notification, Options, type Padding, Pagination, PieChart, type Position, Progress, Radio, ResetStyles, ScrollbarStyles, Slider, Spacer, Spinner, type TabItem, Table, Tabs, type ThemeProp, ToastStyles, Toggle, Tooltip, type Action as TransferAction, type Item as TransferItem, TransferList, type Next as TransferNext, type Width, type WidthHeight, colors, copyToClipboard, darkScale, formatDate, lightScale, marginProps, numberWithCommas, paddingProps, positionProps, theme, useConfirm, useElementObserver, useEventListener, useOnClickOutside, usePrevious, useSelect, useSelectAll, useWindowSize, widthHeightProps };
2756
+ declare const copyToClipboard: (text: string) => void;
2757
+
2758
+ type TimeSpec = 'onlyTime' | 'withTime' | 'relative';
2759
+ type TimeOptions = {
2760
+ time?: TimeSpec;
2761
+ lowercase?: boolean;
2762
+ };
2763
+ declare const formatDate: (value: Date, option?: TimeSpec | TimeOptions) => string;
2764
+
2765
+ declare const numberWithCommas: (number: number) => string;
2766
+
2767
+ export { Accordion, type AsProp as As, Audio, type AudioRef, BarChart, Button, Calendar, Checkbox, Code, Table$1 as DocTable, DraftEditor, type DraftEditorRef, Dropdown, DropdownMenu, type OptionItem as DropdownOption, type FlexPosition, Form, Grid, type Height, type ITheme, Icon, type IconNames, ImageViewer, InlineCode, Input, type InputRef, _default as InputUtils, Label, LineChart, type Margin, type MarginPadding, type MaxHeight, type MaxWidth, type MaxWidthHeight, Menu, Message, MessageHr, type MinHeight, type MinWidth, type MinWidthHeight, Modal, MultiSelect, type MultiSelectRef, Notification, Options, type Padding, Pagination, PieChart, type Position, Progress, Radio, ResetStyles, ScrollbarStyles, Select, Slider, Spacer, Spinner, type TabItem, Table, Tabs, type ThemeProp, ToastStyles, Toggle, Tooltip, type Action as TransferAction, type Item as TransferItem, TransferList, type Next as TransferNext, type Width, type WidthHeight, colors, copyToClipboard, darkScale, formatDate, lightScale, marginProps, numberWithCommas, paddingProps, positionProps, theme, useConfirm, useElementObserver, useEventListener, useOnClickOutside, usePrevious, useSelect, useSelectAll, useWindowSize, widthHeightProps };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { InputFocusEvent, ThemeProp } from './types';
2
+ import { InputFocusEvent, MarginPadding, ThemeProp, WidthHeight } from './types';
3
3
  type FocusCallBack = (event?: InputFocusEvent) => void;
4
4
  export declare const useInputFocus: (onFocus?: FocusCallBack, onBlur?: FocusCallBack, focusCondition?: boolean) => {
5
5
  focused: boolean;
@@ -7,6 +7,21 @@ export declare const useInputFocus: (onFocus?: FocusCallBack, onBlur?: FocusCall
7
7
  handleBlur: (event?: InputFocusEvent) => void;
8
8
  };
9
9
  export declare const isInputFilled: (value?: string | number) => boolean;
10
+ export type InputContainerProps = {
11
+ backgroundColor?: string;
12
+ borderRadius?: number | string;
13
+ borderless?: boolean;
14
+ borderColor?: string;
15
+ fontSize?: number | string;
16
+ placeholderColor?: string;
17
+ pointer?: boolean;
18
+ readOnly?: boolean;
19
+ textOnly?: boolean;
20
+ focused?: boolean;
21
+ invalid?: boolean;
22
+ disabled?: boolean;
23
+ hasLabel?: boolean;
24
+ } & WidthHeight & MarginPadding & ThemeProp;
10
25
  export declare const InputContainer: import("@emotion/styled").StyledComponent<{
11
26
  theme?: import("@emotion/react").Theme | undefined;
12
27
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -15,6 +30,8 @@ export declare const InputContainer: import("@emotion/styled").StyledComponent<{
15
30
  borderRadius?: string | number | undefined;
16
31
  borderless?: boolean | undefined;
17
32
  borderColor?: string | undefined;
33
+ fontSize?: string | number | undefined;
34
+ placeholderColor?: string | undefined;
18
35
  pointer?: boolean | undefined;
19
36
  readOnly?: boolean | undefined;
20
37
  textOnly?: boolean | undefined;
@@ -52,6 +69,8 @@ declare const _default: {
52
69
  borderRadius?: string | number | undefined;
53
70
  borderless?: boolean | undefined;
54
71
  borderColor?: string | undefined;
72
+ fontSize?: string | number | undefined;
73
+ placeholderColor?: string | undefined;
55
74
  pointer?: boolean | undefined;
56
75
  readOnly?: boolean | undefined;
57
76
  textOnly?: boolean | undefined;
@@ -0,0 +1,65 @@
1
+ /// <reference types="react" />
2
+ import { OptionItem } from './Dropdown/DropdownUtils';
3
+ import { Margin, WidthHeight } from './types';
4
+ type SelectProps<OptionType> = {
5
+ /** The function to be called when an option is selected */
6
+ onChange?: (item: OptionType | null) => void;
7
+ /** The value of the Select */
8
+ value?: string;
9
+ /** The function to be called when the Select is opened */
10
+ afterShow?: () => void;
11
+ /** The function to be called when the Select is closed */
12
+ afterHide?: () => void;
13
+ /** Sets the input placeholder text */
14
+ placeholder?: string;
15
+ /** Sets the input placeholder color */
16
+ placeholderColor?: string;
17
+ /** The options to be displayed */
18
+ options?: OptionType[];
19
+ /** Removes the border from the Select input */
20
+ borderless?: boolean;
21
+ /** Sets the input borderColor */
22
+ borderColor?: string;
23
+ /** Sets the input backgroundColor */
24
+ backgroundColor?: string;
25
+ /** Removes the border and background-color from the Select input */
26
+ textOnly?: boolean;
27
+ /** Adds a label to the Select input */
28
+ label?: string;
29
+ /** Sets the id of the Select input or trigger */
30
+ id?: string;
31
+ /** Sets the Select fontSize */
32
+ fontSize?: number | string;
33
+ /** Places a description message below the Select */
34
+ description?: string;
35
+ /** Disables the Select */
36
+ disabled?: boolean;
37
+ /** Sets the Select's bottom border and description text to red */
38
+ invalid?: boolean;
39
+ /** zIndex of the menu's portal container */
40
+ zIndex?: number;
41
+ /** Controls the open state of the menu */
42
+ open?: boolean;
43
+ } & WidthHeight & Margin;
44
+ declare const Select: <OptionType extends OptionItem>({ onChange, afterShow, afterHide, placeholder, placeholderColor, value, options, borderless, borderColor, backgroundColor, textOnly, width, label, id, fontSize, description, disabled, invalid, zIndex, open, ...props }: SelectProps<OptionType>) => import("react/jsx-runtime").JSX.Element;
45
+ export declare const Trigger: import("@emotion/styled").StyledComponent<{
46
+ theme?: import("@emotion/react").Theme | undefined;
47
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
48
+ } & {
49
+ backgroundColor?: string | undefined;
50
+ borderRadius?: string | number | undefined;
51
+ borderless?: boolean | undefined;
52
+ borderColor?: string | undefined;
53
+ fontSize?: string | number | undefined;
54
+ placeholderColor?: string | undefined;
55
+ pointer?: boolean | undefined;
56
+ readOnly?: boolean | undefined;
57
+ textOnly?: boolean | undefined;
58
+ focused?: boolean | undefined;
59
+ invalid?: boolean | undefined;
60
+ disabled?: boolean | undefined;
61
+ hasLabel?: boolean | undefined;
62
+ } & import("./types").Width & import("./types").Height & Margin & import("./types").Padding & import("./types").ThemeProp & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
63
+ theme?: import("@emotion/react").Theme | undefined;
64
+ }, {}, {}>;
65
+ export default Select;
@@ -29,36 +29,37 @@ export { default as Pagination } from './components/Pagination';
29
29
  export { default as PieChart } from './components/PieChart';
30
30
  export { default as Progress } from './components/Progress';
31
31
  export { default as Radio } from './components/Radio';
32
- export { default as ResetStyles } from './global-styles/ResetStyles';
33
- export { default as ScrollbarStyles } from './global-styles/ScrollbarStyles';
34
- export { default as ToastStyles } from './global-styles/ToastStyles';
32
+ export { default as Select } from './components/Select';
35
33
  export { default as Slider } from './components/Slider';
36
34
  export { default as Spacer } from './components/Spacer';
37
35
  export { default as Spinner } from './components/Spinner';
38
- export { default as TransferList } from './components/TransferList';
39
36
  export { default as Table } from './components/Table';
37
+ export { default as Tabs } from './components/Tabs';
40
38
  export { default as Toggle } from './components/Toggle';
41
39
  export { default as Tooltip } from './components/Tooltip';
42
- export { default as Tabs } from './components/Tabs';
40
+ export { default as TransferList } from './components/TransferList';
41
+ export { default as ResetStyles } from './global-styles/ResetStyles';
42
+ export { default as ScrollbarStyles } from './global-styles/ScrollbarStyles';
43
+ export { default as ToastStyles } from './global-styles/ToastStyles';
43
44
  export { default as theme } from './theme';
44
45
  export { default as colors } from './theme/colors';
45
46
  export { default as darkScale } from './theme/darkScale';
46
47
  export { default as lightScale } from './theme/lightScale';
47
- export type { ITheme, ThemeProp } from './theme/ThemeTypes';
48
+ export type { DropdownOption } from './components/Dropdown';
48
49
  export type { IconNames } from './components/Icon/icons';
49
50
  export type { TabItem } from './components/Tabs';
50
- export type { DropdownOption } from './components/Dropdown';
51
- export type { Item as TransferItem, Action as TransferAction, Next as TransferNext } from './components/TransferList';
52
- export type { AudioRef, DraftEditorRef, InputRef, MultiSelectRef, Margin, Padding, Position, MinWidth, MaxWidth, MinHeight, MaxHeight, MinWidthHeight, MaxWidthHeight, Width, Height, WidthHeight, MarginPadding, FlexPosition, AsProp as As, } from './components/types';
51
+ export type { Action as TransferAction, Item as TransferItem, Next as TransferNext } from './components/TransferList';
52
+ export type { AsProp as As, AudioRef, DraftEditorRef, FlexPosition, Height, InputRef, Margin, MarginPadding, MaxHeight, MaxWidth, MaxWidthHeight, MinHeight, MinWidth, MinWidthHeight, MultiSelectRef, Padding, Position, Width, WidthHeight, } from './components/types';
53
+ export type { ITheme, ThemeProp } from './theme/ThemeTypes';
54
+ export { default as useConfirm } from './hooks/useConfirm';
55
+ export { default as useElementObserver } from './hooks/useElementObserver';
53
56
  export { default as useEventListener } from './hooks/useEventListener';
54
57
  export { default as useOnClickOutside } from './hooks/useOnClickOutside';
58
+ export { default as usePrevious } from './hooks/usePrevious';
55
59
  export { default as useSelect } from './hooks/useSelect';
56
60
  export { default as useSelectAll } from './hooks/useSelectAll';
57
61
  export { default as useWindowSize } from './hooks/useWindowSize';
58
- export { default as useConfirm } from './hooks/useConfirm';
59
- export { default as useElementObserver } from './hooks/useElementObserver';
60
- export { default as usePrevious } from './hooks/usePrevious';
61
- export { default as formatDate } from './utils/formatDate';
62
+ export { marginProps, paddingProps, positionProps, widthHeightProps } from './components/helpers/styledProps';
62
63
  export { default as copyToClipboard } from './utils/copyToClipboard';
64
+ export { default as formatDate } from './utils/formatDate';
63
65
  export { default as numberWithCommas } from './utils/numberWithCommas';
64
- export { widthHeightProps, paddingProps, marginProps, positionProps } from './components/helpers/styledProps';