@udixio/ui-react 1.0.1 → 1.2.0
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/CHANGELOG.md +26 -0
- package/dist/index.cjs +4 -4
- package/dist/index.js +1191 -1144
- package/dist/lib/components/Button.d.ts +1 -1
- package/dist/lib/components/Button.d.ts.map +1 -1
- package/dist/lib/icon/icon.d.ts +8 -1
- package/dist/lib/icon/icon.d.ts.map +1 -1
- package/dist/lib/interfaces/button.interface.d.ts +8 -2
- package/dist/lib/interfaces/button.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/fab.interface.d.ts +2 -2
- package/dist/lib/interfaces/fab.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/icon-button.interface.d.ts +2 -1
- package/dist/lib/interfaces/icon-button.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/navigation-rail-item.interface.d.ts +2 -1
- package/dist/lib/interfaces/navigation-rail-item.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/navigation-rail.interface.d.ts +2 -2
- package/dist/lib/interfaces/navigation-rail.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/snackbar.interface.d.ts +2 -2
- package/dist/lib/interfaces/snackbar.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/switch.interface.d.ts +3 -3
- package/dist/lib/interfaces/switch.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/tab.interface.d.ts +2 -2
- package/dist/lib/interfaces/tab.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/text-field.interface.d.ts +3 -3
- package/dist/lib/interfaces/text-field.interface.d.ts.map +1 -1
- package/dist/lib/styles/button.style.d.ts +7 -3
- package/dist/lib/styles/button.style.d.ts.map +1 -1
- package/dist/lib/styles/fab.style.d.ts +3 -3
- package/dist/lib/styles/icon-button.style.d.ts +3 -3
- package/dist/lib/styles/navigation-rail-item.style.d.ts +1 -1
- package/dist/lib/styles/navigation-rail-item.style.d.ts.map +1 -1
- package/dist/lib/styles/navigation-rail.style.d.ts +2 -2
- package/dist/lib/styles/snackbar.style.d.ts +1 -1
- package/dist/lib/styles/switch.style.d.ts +2 -2
- package/dist/lib/styles/tab.style.d.ts +1 -1
- package/dist/lib/styles/text-field.style.d.ts +2 -2
- package/package.json +8 -8
- package/src/lib/components/Button.tsx +2 -0
- package/src/lib/icon/icon.tsx +67 -5
- package/src/lib/interfaces/button.interface.ts +9 -2
- package/src/lib/interfaces/fab.interface.ts +2 -2
- package/src/lib/interfaces/icon-button.interface.ts +2 -1
- package/src/lib/interfaces/navigation-rail-item.interface.ts +2 -1
- package/src/lib/interfaces/navigation-rail.interface.ts +3 -3
- package/src/lib/interfaces/snackbar.interface.ts +2 -2
- package/src/lib/interfaces/switch.interface.ts +3 -3
- package/src/lib/interfaces/tab.interface.ts +3 -3
- package/src/lib/interfaces/text-field.interface.ts +3 -3
- package/src/lib/styles/button.style.ts +12 -9
- package/src/lib/styles/navigation-rail-item.style.ts +13 -10
|
@@ -2,11 +2,12 @@ import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
|
2
2
|
import { IconButtonVariant } from '../components/IconButton';
|
|
3
3
|
import { ActionOrLink } from '../utils/component';
|
|
4
4
|
import { Transition } from 'motion';
|
|
5
|
+
import { Icon } from '../icon';
|
|
5
6
|
|
|
6
7
|
type Props = {
|
|
7
8
|
label?: string;
|
|
8
9
|
children?: string;
|
|
9
|
-
icon:
|
|
10
|
+
icon: Icon;
|
|
10
11
|
size?: 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge';
|
|
11
12
|
width?: 'default' | 'narrow' | 'wide';
|
|
12
13
|
iconSelected?: IconDefinition;
|
|
@@ -2,13 +2,14 @@ import { ActionOrLink } from '../utils';
|
|
|
2
2
|
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
3
|
import { Dispatch, RefObject, SetStateAction } from 'react';
|
|
4
4
|
import { Transition } from 'motion';
|
|
5
|
+
import { Icon } from '../icon';
|
|
5
6
|
|
|
6
7
|
export type NavProps = {
|
|
7
8
|
selected?: boolean;
|
|
8
9
|
variant?: 'vertical' | 'horizontal';
|
|
9
10
|
label?: string;
|
|
10
11
|
children?: string;
|
|
11
|
-
icon:
|
|
12
|
+
icon: Icon;
|
|
12
13
|
iconSelected: IconDefinition;
|
|
13
14
|
selectedItem?: number | null;
|
|
14
15
|
setSelectedItem?: Dispatch<SetStateAction<number | null>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Dispatch, ReactNode, RefObject, SetStateAction } from 'react';
|
|
2
|
-
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
2
|
import { Transition } from 'motion';
|
|
4
3
|
import { ReactProps } from '../utils';
|
|
5
4
|
import { NavigationRailItemInterface } from './navigation-rail-item.interface';
|
|
5
|
+
import { Icon } from '../icon';
|
|
6
6
|
|
|
7
7
|
type MenuState = {
|
|
8
|
-
icon:
|
|
8
|
+
icon: Icon;
|
|
9
9
|
label: string;
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -19,7 +19,7 @@ export interface NavigationRailInterface {
|
|
|
19
19
|
'label' | 'icon'
|
|
20
20
|
> & {
|
|
21
21
|
ref: RefObject<any>;
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
23
|
) => void;
|
|
24
24
|
children: ReactNode;
|
|
25
25
|
selectedItem?: number | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon } from '../icon';
|
|
2
2
|
|
|
3
3
|
export interface SnackbarInterface {
|
|
4
4
|
type: 'div';
|
|
@@ -6,7 +6,7 @@ export interface SnackbarInterface {
|
|
|
6
6
|
duration?: number;
|
|
7
7
|
onClose?: () => void;
|
|
8
8
|
message: string;
|
|
9
|
-
closeIcon?:
|
|
9
|
+
closeIcon?: Icon;
|
|
10
10
|
};
|
|
11
11
|
states: { isVisible: boolean };
|
|
12
12
|
elements: ['snackbar', 'container', 'supportingText', 'action', 'icon'];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon } from '../icon';
|
|
2
2
|
|
|
3
3
|
export interface SwitchInterface {
|
|
4
4
|
type: 'div';
|
|
5
5
|
props: {
|
|
6
6
|
selected?: boolean;
|
|
7
|
-
activeIcon?:
|
|
8
|
-
inactiveIcon?:
|
|
7
|
+
activeIcon?: Icon;
|
|
8
|
+
inactiveIcon?: Icon;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
onChange?: (checked: boolean) => void;
|
|
11
11
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { ActionOrLink } from '../utils/component';
|
|
2
|
-
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
2
|
import { TabsVariant } from './tabs.interface';
|
|
4
3
|
import { Dispatch, RefObject, SetStateAction } from 'react';
|
|
4
|
+
import { Icon } from '../icon';
|
|
5
5
|
|
|
6
6
|
export type TabProps = {
|
|
7
7
|
selected?: boolean;
|
|
8
8
|
variant?: TabsVariant;
|
|
9
9
|
label?: string;
|
|
10
|
-
icon?:
|
|
10
|
+
icon?: Icon;
|
|
11
11
|
selectedTab?: number | null;
|
|
12
12
|
setSelectedTab?: Dispatch<SetStateAction<number | null>>;
|
|
13
13
|
tabsId?: string;
|
|
14
14
|
onTabSelected?: (
|
|
15
15
|
args: { index: number } & Pick<TabProps, 'label' | 'icon'> & {
|
|
16
16
|
ref: RefObject<any>;
|
|
17
|
-
}
|
|
17
|
+
},
|
|
18
18
|
) => void;
|
|
19
19
|
index?: number;
|
|
20
20
|
scrollable?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { IconButton } from '../components/IconButton';
|
|
3
|
+
import { Icon } from '../icon';
|
|
4
4
|
|
|
5
5
|
export type TextFieldVariant = 'filled' | 'outlined';
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@ type Props = {
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
errorText?: string | null;
|
|
13
13
|
supportingText?: string;
|
|
14
|
-
trailingIcon?: React.ReactElement<typeof IconButton> |
|
|
15
|
-
leadingIcon?: React.ReactElement<typeof IconButton> |
|
|
14
|
+
trailingIcon?: React.ReactElement<typeof IconButton> | Icon;
|
|
15
|
+
leadingIcon?: React.ReactElement<typeof IconButton> | Icon;
|
|
16
16
|
onChange?: (value: string) => void;
|
|
17
17
|
showSupportingText?: boolean;
|
|
18
18
|
suffix?: string;
|
|
@@ -5,6 +5,7 @@ export const buttonStyle = defaultClassNames<ButtonInterface>(
|
|
|
5
5
|
'button',
|
|
6
6
|
({
|
|
7
7
|
variant,
|
|
8
|
+
disableTextMargins,
|
|
8
9
|
disabled,
|
|
9
10
|
iconPosition,
|
|
10
11
|
icon,
|
|
@@ -76,15 +77,17 @@ export const buttonStyle = defaultClassNames<ButtonInterface>(
|
|
|
76
77
|
'text-primary': !disabled,
|
|
77
78
|
'text-on-surface/[0.38]': disabled,
|
|
78
79
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
disableTextMargins && [
|
|
81
|
+
size === 'xSmall' && '-mx-3 ',
|
|
82
|
+
size === 'small' && '-mx-4 ',
|
|
83
|
+
size === 'medium' && '-mx-6 ',
|
|
84
|
+
size === 'large' && '-mx-12',
|
|
85
|
+
size === 'xLarge' && '-mx-16 ',
|
|
86
|
+
// size === 'small' && ' -my-2.5',
|
|
87
|
+
// size === 'medium' && ' -my-4',
|
|
88
|
+
// size === 'large' && '-my-8',
|
|
89
|
+
// size === 'xLarge' && ' -my-12',
|
|
90
|
+
],
|
|
88
91
|
],
|
|
89
92
|
disabled && 'cursor-default',
|
|
90
93
|
),
|
|
@@ -5,12 +5,15 @@ export const navigationRailItemStyle =
|
|
|
5
5
|
defaultClassNames<NavigationRailItemInterface>(
|
|
6
6
|
'navigationRailItem',
|
|
7
7
|
({ isSelected, icon, label, variant }) => ({
|
|
8
|
-
navigationRailItem: classNames(
|
|
9
|
-
'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
navigationRailItem: classNames(
|
|
9
|
+
' group flex flex-col pt-1 pb-1.5 cursor-pointer',
|
|
10
|
+
{
|
|
11
|
+
'text-on-surface-variant': !isSelected,
|
|
12
|
+
'text-on-secondary-container': isSelected,
|
|
13
|
+
'gap-2 h-[68px]': variant == 'vertical',
|
|
14
|
+
'gap-0 h-[66px]': variant == 'horizontal',
|
|
15
|
+
},
|
|
16
|
+
),
|
|
14
17
|
container: classNames(
|
|
15
18
|
' w-fit flex justify-center relative rounded-full items-center mx-5',
|
|
16
19
|
{
|
|
@@ -25,20 +28,20 @@ export const navigationRailItemStyle =
|
|
|
25
28
|
'py-1 ': variant == 'vertical',
|
|
26
29
|
'py-4 ': variant == 'horizontal',
|
|
27
30
|
},
|
|
28
|
-
]
|
|
31
|
+
],
|
|
29
32
|
),
|
|
30
33
|
stateLayer: classNames(
|
|
31
34
|
' absolute w-full rounded-full h-full left-0 top-0 ',
|
|
32
35
|
{
|
|
33
36
|
'group-state-on-surface': !isSelected,
|
|
34
37
|
'group-state-on-secondary-container': isSelected,
|
|
35
|
-
}
|
|
38
|
+
},
|
|
36
39
|
),
|
|
37
40
|
|
|
38
41
|
icon: classNames('size-6 flex'),
|
|
39
|
-
label: classNames('w-fit mx-auto', {
|
|
42
|
+
label: classNames('w-fit mx-auto text-nowrap', {
|
|
40
43
|
'text-label-large ': variant == 'horizontal',
|
|
41
44
|
'text-label-medium': variant == 'vertical',
|
|
42
45
|
}),
|
|
43
|
-
})
|
|
46
|
+
}),
|
|
44
47
|
);
|