@homecode/ui 4.30.16 → 5.0.1
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/dist/esm/index.js +6 -0
- package/dist/esm/src/components/AssistiveText/AssistiveText.styl.js +2 -2
- package/dist/esm/src/components/Autocomplete/Autocomplete.js +9 -0
- package/dist/esm/src/components/Button/Button.styl.js +2 -2
- package/dist/esm/src/components/Calendar/Calendar.styl.js +2 -2
- package/dist/esm/src/components/Card/Card.js +55 -0
- package/dist/esm/src/components/Card/Card.styl.js +7 -0
- package/dist/esm/src/components/Checkbox/Checkbox.styl.js +2 -2
- package/dist/esm/src/components/Chip/Chip.js +2 -3
- package/dist/esm/src/components/Chip/Chip.styl.js +2 -2
- package/dist/esm/src/components/Container/Container.styl.js +2 -2
- package/dist/esm/src/components/DatePicker/DatePicker.styl.js +1 -1
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.styl.js +2 -2
- package/dist/esm/src/components/Dialogue/Dialogue.js +107 -0
- package/dist/esm/src/components/Dialogue/Dialogue.styl.js +7 -0
- package/dist/esm/src/components/Expand/Expand.styl.js +1 -1
- package/dist/esm/src/components/Input/Input.styl.js +2 -2
- package/dist/esm/src/components/InputFile/InputFile.js +7 -0
- package/dist/esm/src/components/InputFile/InputFile.styl.js +2 -2
- package/dist/esm/src/components/InputFile/Item/Item.styl.js +2 -2
- package/dist/esm/src/components/Label/Label.styl.js +2 -2
- package/dist/esm/src/components/Menu/Menu.styl.js +2 -2
- package/dist/esm/src/components/Notifications/Notifications.styl.js +1 -1
- package/dist/esm/src/components/Popup/Popup.js +1 -1
- package/dist/esm/src/components/Popup/Popup.styl.js +2 -2
- package/dist/esm/src/components/Progress/Progress.styl.js +2 -2
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.js +1 -0
- package/dist/esm/src/components/RadioButton/RadioButton.js +33 -0
- package/dist/esm/src/components/RadioButton/RadioButton.styl.js +7 -0
- package/dist/esm/src/components/RadioGroup/RadioGroup.js +31 -0
- package/dist/esm/src/components/RadioGroup/RadioGroup.styl.js +7 -0
- package/dist/esm/src/components/RadioGroup/RadioGroupContext.js +8 -0
- package/dist/esm/src/components/Scroll/Scroll.styl.js +2 -2
- package/dist/esm/src/components/Select/Select.styl.js +2 -2
- package/dist/esm/src/components/Shimmer/Shimmer.styl.js +2 -2
- package/dist/esm/src/components/Spinner/Spinner.styl.js +2 -2
- package/dist/esm/src/components/Table/Table.styl.js +1 -1
- package/dist/esm/src/components/Tabs/Tabs.styl.js +2 -2
- package/dist/esm/src/components/Theme/Theme.defaults.js +12 -9
- package/dist/esm/src/components/Theme/Theme.js +2 -0
- package/dist/esm/src/components/Theme/ThemeProvider.js +50 -0
- package/dist/esm/src/components/Toggle/Toggle.styl.js +2 -2
- package/dist/esm/types/src/components/AssistiveText/AssistiveText.types.d.ts +2 -1
- package/dist/esm/types/src/components/Card/Card.d.ts +13 -0
- package/dist/esm/types/src/components/Card/Card.subtypes.d.ts +25 -0
- package/dist/esm/types/src/components/Card/Card.types.d.ts +4 -0
- package/dist/esm/types/src/components/Card/index.d.ts +3 -0
- package/dist/esm/types/src/components/Chip/Chip.d.ts +2 -2
- package/dist/esm/types/src/components/Container/Container.types.d.ts +1 -1
- package/dist/esm/types/src/components/Dialogue/Dialogue.d.ts +3 -0
- package/dist/esm/types/src/components/Dialogue/Dialogue.types.d.ts +24 -0
- package/dist/esm/types/src/components/Dialogue/index.d.ts +2 -0
- package/dist/esm/types/src/components/Icon/Icon.types.d.ts +1 -1
- package/dist/esm/types/src/components/RadioButton/RadioButton.d.ts +3 -0
- package/dist/esm/types/src/components/RadioButton/RadioButton.types.d.ts +12 -0
- package/dist/esm/types/src/components/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/esm/types/src/components/RadioGroup/RadioGroup.types.d.ts +30 -0
- package/dist/esm/types/src/components/RadioGroup/RadioGroupContext.d.ts +3 -0
- package/dist/esm/types/src/components/Scroll/Scroll.d.ts +1 -1
- package/dist/esm/types/src/components/Scroll/Scroll.types.d.ts +1 -1
- package/dist/esm/types/src/components/Theme/Theme.defaults.d.ts +0 -3
- package/dist/esm/types/src/components/Theme/ThemeProvider.d.ts +18 -0
- package/dist/esm/types/src/components/index.d.ts +6 -0
- package/dist/esm/types/src/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { Size } from 'uilib/types';
|
|
3
3
|
type Props = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
className?: string;
|
|
@@ -7,7 +7,7 @@ type Props = {
|
|
|
7
7
|
onRemove?: () => void;
|
|
8
8
|
onClick?: () => void;
|
|
9
9
|
removeTooltip?: ReactNode;
|
|
10
|
-
size?:
|
|
10
|
+
size?: Size;
|
|
11
11
|
};
|
|
12
12
|
export declare function Chip({ children, className, selected, onRemove, onClick, removeTooltip, size, }: Props): JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Props as DialogueProps } from './Dialogue.types';
|
|
2
|
+
export declare function Dialogue({ open, onOpenChange, disabled, trigger, title, subtitle, icon, content, contentClassName, footer, footerAlignment, size, className, noScroll, maxHeight, autoScrollBottom, width, }: DialogueProps): JSX.Element;
|
|
3
|
+
export { default as DialogueStyles } from './Dialogue.styl';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export type Props = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onOpenChange: (isOpen: boolean) => void;
|
|
6
|
+
trigger?: ReactNode;
|
|
7
|
+
triggerClassName?: string;
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
titleClassName?: string;
|
|
10
|
+
subtitle?: ReactNode;
|
|
11
|
+
subtitleClassName?: string;
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
content?: ReactNode;
|
|
14
|
+
contentClassName?: string;
|
|
15
|
+
footer?: ReactNode;
|
|
16
|
+
footerClassName?: string;
|
|
17
|
+
footerAlignment?: 'left' | 'center' | 'right';
|
|
18
|
+
size?: 'login' | 'wide' | 'default';
|
|
19
|
+
className?: string;
|
|
20
|
+
noScroll?: boolean;
|
|
21
|
+
autoScrollBottom?: boolean;
|
|
22
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
23
|
+
width?: CSSProperties['width'];
|
|
24
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType, Size } from 'uilib/types';
|
|
2
2
|
import * as CUSTOM_ICONS from './icons';
|
|
3
|
-
export type IconSize =
|
|
3
|
+
export type IconSize = Size;
|
|
4
4
|
export type IconType = keyof typeof CUSTOM_ICONS;
|
|
5
5
|
export type Props = ComponentType & {
|
|
6
6
|
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { Size, ComponentType } from '../../types';
|
|
3
|
+
export type Props = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'value'> & ComponentType & {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
/** Option value; compared to the group’s `value` when inside `RadioGroup` */
|
|
6
|
+
value: string | number;
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
error?: string | boolean;
|
|
10
|
+
size?: Size;
|
|
11
|
+
variant?: 'default' | 'outlined';
|
|
12
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { Size, ComponentType } from '../../types';
|
|
3
|
+
export type RadioGroupContextValue = {
|
|
4
|
+
name: string;
|
|
5
|
+
value: string | number | undefined;
|
|
6
|
+
onChange: (value: string | number) => void;
|
|
7
|
+
size: Size;
|
|
8
|
+
variant: 'default' | 'outlined';
|
|
9
|
+
error?: string | boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type Props = Omit<HTMLAttributes<HTMLFieldSetElement>, 'onChange'> & ComponentType & {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/** Current value when controlled */
|
|
15
|
+
value?: string | number;
|
|
16
|
+
/** Initial value when uncontrolled */
|
|
17
|
+
defaultValue?: string | number;
|
|
18
|
+
/** Called when the selected option changes */
|
|
19
|
+
onChange?: (value: string | number) => void;
|
|
20
|
+
/** Shared `name` for native radio inputs; generated if omitted */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** Group heading; renders as `legend` */
|
|
23
|
+
label?: ReactNode;
|
|
24
|
+
/** Size passed to `RadioButton` children via context */
|
|
25
|
+
size?: Size;
|
|
26
|
+
variant?: 'default' | 'outlined';
|
|
27
|
+
error?: string | boolean;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
orientation?: 'vertical' | 'horizontal';
|
|
30
|
+
};
|
|
@@ -13,7 +13,7 @@ export declare const Scroll: import("react").ForwardRefExoticComponent<import(".
|
|
|
13
13
|
x?: boolean;
|
|
14
14
|
y?: boolean;
|
|
15
15
|
size?: import("../../types").Size;
|
|
16
|
-
fadeSize?: import("../../types").Size
|
|
16
|
+
fadeSize?: import("../../types").Size;
|
|
17
17
|
smooth?: boolean;
|
|
18
18
|
autoHide?: boolean;
|
|
19
19
|
offset?: {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type ThemeProviderProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
getThemeConfig: (theme: 'light' | 'dark', activeColor: string) => Record<string, string>;
|
|
5
|
+
initialTheme?: 'light' | 'dark';
|
|
6
|
+
initialActiveColor: string;
|
|
7
|
+
};
|
|
8
|
+
export type ThemeContextValue = {
|
|
9
|
+
currThemeConfig: Record<string, string>;
|
|
10
|
+
theme: 'light' | 'dark';
|
|
11
|
+
isDarkTheme: boolean;
|
|
12
|
+
toggleTheme: () => void;
|
|
13
|
+
setTheme: (theme: 'light' | 'dark') => void;
|
|
14
|
+
setActiveColor: (color: string) => void;
|
|
15
|
+
activeColor: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function ThemeProvider({ children, getThemeConfig, initialTheme, initialActiveColor, }: ThemeProviderProps): JSX.Element;
|
|
18
|
+
export declare function useTheme(): ThemeContextValue;
|
|
@@ -5,10 +5,12 @@ export * from './ButtonGroup/ButtonGroup';
|
|
|
5
5
|
export * from './Calendar/Calendar';
|
|
6
6
|
export * from './Checkbox/Checkbox';
|
|
7
7
|
export * from './Chip/Chip';
|
|
8
|
+
export * from './Card';
|
|
8
9
|
export * from './Container/Container';
|
|
9
10
|
export * from './DatePicker/DatePicker';
|
|
10
11
|
export * from './DatePickerInput/DatePickerInput';
|
|
11
12
|
export * from './DateTime/DateTime';
|
|
13
|
+
export * from './Dialogue';
|
|
12
14
|
export * from './Draggable/Draggable';
|
|
13
15
|
export * from './Expand/Expand';
|
|
14
16
|
export * from './Flex/Flex';
|
|
@@ -30,6 +32,8 @@ export * from './Portal/Portal';
|
|
|
30
32
|
export * from './PopupMenu/PopupMenu';
|
|
31
33
|
export * from './Progress/Progress';
|
|
32
34
|
export * from './ProgressCircular/ProgressCircular';
|
|
35
|
+
export * from './RadioButton/RadioButton';
|
|
36
|
+
export * from './RadioGroup/RadioGroup';
|
|
33
37
|
export * from './Router/Router';
|
|
34
38
|
export * from './RequiredStar/RequiredStar';
|
|
35
39
|
export * from './Select/Select';
|
|
@@ -42,6 +46,8 @@ export * from './Tabs/Tabs';
|
|
|
42
46
|
export * from './Tooltip/Tooltip';
|
|
43
47
|
export * from './Text/Text';
|
|
44
48
|
export * from './Theme/Theme';
|
|
49
|
+
export { ThemeProvider, useTheme } from './Theme/ThemeProvider';
|
|
50
|
+
export type { ThemeContextValue, ThemeProviderProps, } from './Theme/ThemeProvider';
|
|
45
51
|
export * from './VH/VH';
|
|
46
52
|
export * from './Virtualized';
|
|
47
53
|
export * from './Toggle/Toggle';
|