@udixio/ui-react 2.10.13 → 2.10.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.
- package/package.json +4 -1
- package/.eslintrc.mjs +0 -22
- package/.storybook/main.ts +0 -20
- package/.storybook/preview.ts +0 -1
- package/CHANGELOG.md +0 -1144
- package/postcss.config.mjs +0 -5
- package/src/index.css +0 -4
- package/src/index.ts +0 -1
- package/src/lib/components/AnchorPositioner.tsx +0 -185
- package/src/lib/components/Button.tsx +0 -208
- package/src/lib/components/Card.tsx +0 -47
- package/src/lib/components/Carousel.tsx +0 -437
- package/src/lib/components/CarouselItem.tsx +0 -61
- package/src/lib/components/Checkbox.tsx +0 -120
- package/src/lib/components/Chip.tsx +0 -341
- package/src/lib/components/Chips.tsx +0 -331
- package/src/lib/components/ContextMenu.tsx +0 -109
- package/src/lib/components/DatePicker.tsx +0 -432
- package/src/lib/components/Divider.tsx +0 -20
- package/src/lib/components/Fab.tsx +0 -127
- package/src/lib/components/FabMenu.tsx +0 -239
- package/src/lib/components/IconButton.tsx +0 -146
- package/src/lib/components/Menu.tsx +0 -88
- package/src/lib/components/MenuGroup.tsx +0 -34
- package/src/lib/components/MenuHeadline.tsx +0 -9
- package/src/lib/components/MenuItem.tsx +0 -215
- package/src/lib/components/NavigationRail.tsx +0 -186
- package/src/lib/components/NavigationRailItem.tsx +0 -227
- package/src/lib/components/ProgressIndicator.tsx +0 -214
- package/src/lib/components/SideSheet.tsx +0 -135
- package/src/lib/components/Slider.tsx +0 -374
- package/src/lib/components/Snackbar.tsx +0 -77
- package/src/lib/components/Switch.tsx +0 -107
- package/src/lib/components/Tab.tsx +0 -123
- package/src/lib/components/TabGroup.tsx +0 -66
- package/src/lib/components/TabGroupContext.tsx +0 -16
- package/src/lib/components/TabPanel.tsx +0 -27
- package/src/lib/components/TabPanels.tsx +0 -76
- package/src/lib/components/Tabs.tsx +0 -105
- package/src/lib/components/TextField.tsx +0 -586
- package/src/lib/components/Tooltip.tsx +0 -217
- package/src/lib/components/index.ts +0 -34
- package/src/lib/config/config.interface.ts +0 -9
- package/src/lib/config/define-config.ts +0 -16
- package/src/lib/config/index.ts +0 -2
- package/src/lib/effects/AnimateOnScroll.ts +0 -391
- package/src/lib/effects/State.tsx +0 -90
- package/src/lib/effects/SyncedFixedWrapper.tsx +0 -62
- package/src/lib/effects/ThemeProvider.tsx +0 -174
- package/src/lib/effects/block-scroll.effect.tsx +0 -313
- package/src/lib/effects/custom-scroll/custom-scroll.effect.tsx +0 -407
- package/src/lib/effects/custom-scroll/custom-scroll.interface.ts +0 -29
- package/src/lib/effects/custom-scroll/custom-scroll.style.ts +0 -32
- package/src/lib/effects/custom-scroll/index.ts +0 -3
- package/src/lib/effects/index.ts +0 -7
- package/src/lib/effects/ripple/RippleEffect.tsx +0 -116
- package/src/lib/effects/ripple/index.tsx +0 -1
- package/src/lib/effects/scrollDriven.ts +0 -239
- package/src/lib/effects/smooth-scroll.effect.tsx +0 -112
- package/src/lib/effects/theme.worker.ts +0 -97
- package/src/lib/hooks/index.ts +0 -10
- package/src/lib/hooks/useTooltipTrigger.ts +0 -270
- package/src/lib/icon/icon.tsx +0 -125
- package/src/lib/icon/index.ts +0 -1
- package/src/lib/index.ts +0 -8
- package/src/lib/interfaces/button.interface.ts +0 -65
- package/src/lib/interfaces/card.interface.ts +0 -11
- package/src/lib/interfaces/carousel-item.interface.ts +0 -12
- package/src/lib/interfaces/carousel.interface.ts +0 -41
- package/src/lib/interfaces/checkbox.interface.ts +0 -39
- package/src/lib/interfaces/chip.interface.ts +0 -97
- package/src/lib/interfaces/chips.interface.ts +0 -37
- package/src/lib/interfaces/date-picker.interface.ts +0 -79
- package/src/lib/interfaces/divider.interface.ts +0 -7
- package/src/lib/interfaces/fab-menu.interface.ts +0 -12
- package/src/lib/interfaces/fab.interface.ts +0 -27
- package/src/lib/interfaces/icon-button.interface.ts +0 -38
- package/src/lib/interfaces/index.ts +0 -26
- package/src/lib/interfaces/menu-group.interface.ts +0 -13
- package/src/lib/interfaces/menu-item.interface.ts +0 -29
- package/src/lib/interfaces/menu.interface.ts +0 -19
- package/src/lib/interfaces/navigation-rail-item.interface.ts +0 -39
- package/src/lib/interfaces/navigation-rail.interface.ts +0 -39
- package/src/lib/interfaces/progress-indicator.interface.ts +0 -41
- package/src/lib/interfaces/side-sheet.interface.tsx +0 -28
- package/src/lib/interfaces/slider.interface.ts +0 -27
- package/src/lib/interfaces/snackbar.interface.ts +0 -13
- package/src/lib/interfaces/switch.interface.ts +0 -14
- package/src/lib/interfaces/tab-group.interface.ts +0 -13
- package/src/lib/interfaces/tab-panels.interface.ts +0 -21
- package/src/lib/interfaces/tab.interface.ts +0 -31
- package/src/lib/interfaces/tabs.interface.ts +0 -22
- package/src/lib/interfaces/text-field.interface.ts +0 -61
- package/src/lib/interfaces/tooltip.interface.ts +0 -61
- package/src/lib/styles/button.style.ts +0 -136
- package/src/lib/styles/card.style.ts +0 -29
- package/src/lib/styles/carousel-item.style.ts +0 -24
- package/src/lib/styles/carousel.style.ts +0 -22
- package/src/lib/styles/checkbox.style.ts +0 -64
- package/src/lib/styles/chip.style.ts +0 -62
- package/src/lib/styles/chips.style.ts +0 -20
- package/src/lib/styles/date-picker.style.ts +0 -43
- package/src/lib/styles/divider.style.ts +0 -31
- package/src/lib/styles/fab-menu.style.ts +0 -29
- package/src/lib/styles/fab.style.ts +0 -49
- package/src/lib/styles/icon-button.style.ts +0 -168
- package/src/lib/styles/index.ts +0 -25
- package/src/lib/styles/menu-group.style.ts +0 -34
- package/src/lib/styles/menu-headline.style.ts +0 -20
- package/src/lib/styles/menu-item.style.ts +0 -45
- package/src/lib/styles/menu.style.ts +0 -32
- package/src/lib/styles/navigation-rail-item.style.ts +0 -56
- package/src/lib/styles/navigation-rail.style.ts +0 -36
- package/src/lib/styles/progress-indicator.style.ts +0 -72
- package/src/lib/styles/side-sheet.style.ts +0 -45
- package/src/lib/styles/slider.style.ts +0 -41
- package/src/lib/styles/snackbar.style.ts +0 -26
- package/src/lib/styles/switch.style.ts +0 -67
- package/src/lib/styles/tab-panels.style.ts +0 -35
- package/src/lib/styles/tab.style.ts +0 -78
- package/src/lib/styles/tabs.style.ts +0 -22
- package/src/lib/styles/text-field.style.ts +0 -115
- package/src/lib/styles/tooltip.style.ts +0 -48
- package/src/lib/utils/component-helper.ts +0 -134
- package/src/lib/utils/component.ts +0 -34
- package/src/lib/utils/index.ts +0 -7
- package/src/lib/utils/string.ts +0 -9
- package/src/lib/utils/styles/classnames.ts +0 -49
- package/src/lib/utils/styles/get-classname.ts +0 -96
- package/src/lib/utils/styles/index.ts +0 -4
- package/src/lib/utils/styles/use-classnames.ts +0 -25
- package/src/stories/action/button.stories.tsx +0 -86
- package/src/stories/action/fab.stories.tsx +0 -54
- package/src/stories/action/icon-button.stories.tsx +0 -134
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -5
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -15
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -3
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -12
- package/src/stories/assets/youtube.svg +0 -4
- package/src/stories/communication/ProgressIndicator.stories.tsx +0 -57
- package/src/stories/communication/SnackBar.stories.tsx +0 -32
- package/src/stories/communication/tool-tip.stories.tsx +0 -133
- package/src/stories/containment/card.stories.tsx +0 -42
- package/src/stories/containment/carousel.stories.tsx +0 -65
- package/src/stories/containment/divider.stories.tsx +0 -35
- package/src/stories/containment/slide-sheet.stories.tsx +0 -45
- package/src/stories/effect/smooth-scroll.stories.tsx +0 -54
- package/src/stories/navigation/navigation-rail/navigation-rail-item.stories.tsx +0 -65
- package/src/stories/navigation/navigation-rail/navigation-rail.stories.tsx +0 -122
- package/src/stories/navigation/tabs/tab.stories.tsx +0 -57
- package/src/stories/navigation/tabs/tabs.stories.tsx +0 -102
- package/src/stories/selection/slider.stories.tsx +0 -85
- package/src/stories/selection/switch.stories.tsx +0 -46
- package/src/stories/text-inputs/text-field.stories.tsx +0 -135
- package/src/tests/Button.spec.tsx +0 -67
- package/src/tests/useClassNames.spec.tsx +0 -82
- package/src/udixio.css +0 -120
- package/theme.config.ts +0 -7
- package/tsconfig.json +0 -16
- package/tsconfig.lib.json +0 -51
- package/tsconfig.spec.json +0 -37
- package/tsconfig.storybook.json +0 -38
- package/vite.config.ts +0 -96
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { IconButtonInterface } from '../interfaces/icon-button.interface';
|
|
2
|
-
import {
|
|
3
|
-
type ClassNameComponent,
|
|
4
|
-
classNames,
|
|
5
|
-
createUseClassNames,
|
|
6
|
-
defaultClassNames,
|
|
7
|
-
} from '../utils';
|
|
8
|
-
|
|
9
|
-
const iconButtonConfig: ClassNameComponent<IconButtonInterface> = ({
|
|
10
|
-
variant,
|
|
11
|
-
disabled,
|
|
12
|
-
onToggle,
|
|
13
|
-
isActive,
|
|
14
|
-
size,
|
|
15
|
-
width,
|
|
16
|
-
shape,
|
|
17
|
-
allowShapeTransformation,
|
|
18
|
-
}) => {
|
|
19
|
-
return {
|
|
20
|
-
iconButton: classNames(
|
|
21
|
-
'rounded-full relative flex transition-all duration-300',
|
|
22
|
-
'group/icon-button cursor-pointer',
|
|
23
|
-
{
|
|
24
|
-
'cursor-default': disabled,
|
|
25
|
-
},
|
|
26
|
-
shape === 'rounded' && {
|
|
27
|
-
'rounded-[30px]': size === 'xSmall' || size == 'small',
|
|
28
|
-
'rounded-[40px]': size === 'medium',
|
|
29
|
-
'rounded-[70px]': size === 'large' || size == 'xLarge',
|
|
30
|
-
},
|
|
31
|
-
(shape === 'squared' || (allowShapeTransformation && isActive)) && {
|
|
32
|
-
'rounded-[12px]': size === 'xSmall' || size == 'small',
|
|
33
|
-
'rounded-[16px]': size === 'medium',
|
|
34
|
-
'rounded-[28px]': size === 'large' || size == 'xLarge',
|
|
35
|
-
},
|
|
36
|
-
allowShapeTransformation &&
|
|
37
|
-
!disabled && {
|
|
38
|
-
'active:rounded-[12px]': size === 'xSmall' || size == 'small',
|
|
39
|
-
'active:rounded-[16px]': size === 'medium',
|
|
40
|
-
'active:rounded-[28px]': size === 'large' || size == 'xLarge',
|
|
41
|
-
},
|
|
42
|
-
variant === 'filled' && [
|
|
43
|
-
!disabled && {
|
|
44
|
-
'bg-surface-container': !isActive && Boolean(onToggle),
|
|
45
|
-
'bg-primary': isActive || !onToggle,
|
|
46
|
-
},
|
|
47
|
-
Boolean(disabled) && 'bg-on-surface/[0.12]',
|
|
48
|
-
],
|
|
49
|
-
variant === 'tonal' && [
|
|
50
|
-
!disabled && {
|
|
51
|
-
'bg-secondary-container text-on-secondary-container':
|
|
52
|
-
!isActive && Boolean(onToggle),
|
|
53
|
-
'bg-secondary text-on-secondary': isActive || !onToggle,
|
|
54
|
-
},
|
|
55
|
-
Boolean(disabled) && 'bg-on-surface/[0.12]',
|
|
56
|
-
],
|
|
57
|
-
variant === 'outlined' && [
|
|
58
|
-
!disabled && {
|
|
59
|
-
'border border-outline': !isActive,
|
|
60
|
-
'border border-transparent bg-inverse-surface': isActive,
|
|
61
|
-
},
|
|
62
|
-
Boolean(disabled) && {
|
|
63
|
-
'border border-on-surface/[0.12]': !isActive,
|
|
64
|
-
'border border-transparent bg-on-surface/[0.12]': isActive,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
),
|
|
68
|
-
touchTarget: classNames(
|
|
69
|
-
'absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full',
|
|
70
|
-
),
|
|
71
|
-
stateLayer: classNames(
|
|
72
|
-
'absolute top-0 left-0 h-full w-full overflow-hidden',
|
|
73
|
-
(shape === 'rounded' ||
|
|
74
|
-
(shape === 'squared' &&
|
|
75
|
-
onToggle &&
|
|
76
|
-
!disabled &&
|
|
77
|
-
isActive &&
|
|
78
|
-
allowShapeTransformation)) && {
|
|
79
|
-
'rounded-[30px]': size === 'xSmall' || size == 'small',
|
|
80
|
-
'rounded-[40px]': size === 'medium',
|
|
81
|
-
'rounded-[70px]': size === 'large' || size == 'xLarge',
|
|
82
|
-
},
|
|
83
|
-
(shape === 'squared' ||
|
|
84
|
-
(shape === 'rounded' &&
|
|
85
|
-
onToggle &&
|
|
86
|
-
!disabled &&
|
|
87
|
-
isActive &&
|
|
88
|
-
allowShapeTransformation)) && {
|
|
89
|
-
'rounded-[12px]': size === 'xSmall' || size == 'small',
|
|
90
|
-
'rounded-[16px]': size === 'medium',
|
|
91
|
-
'rounded-[28px]': size === 'large' || size == 'xLarge',
|
|
92
|
-
},
|
|
93
|
-
allowShapeTransformation &&
|
|
94
|
-
!disabled && {
|
|
95
|
-
'group-active/icon-button:rounded-[12px]':
|
|
96
|
-
size === 'xSmall' || size == 'small',
|
|
97
|
-
'group-active/icon-button:rounded-[16px]': size === 'medium',
|
|
98
|
-
'group-active/icon-button:rounded-[28px]':
|
|
99
|
-
size === 'large' || size == 'xLarge',
|
|
100
|
-
},
|
|
101
|
-
!disabled && [
|
|
102
|
-
variant === 'standard' && {
|
|
103
|
-
'state-on-surface-variant': !isActive,
|
|
104
|
-
'state-primary': isActive,
|
|
105
|
-
},
|
|
106
|
-
variant === 'filled' && {
|
|
107
|
-
'state-primary': !isActive && Boolean(onToggle),
|
|
108
|
-
'state-inverse-on-surface': isActive || !onToggle,
|
|
109
|
-
},
|
|
110
|
-
variant === 'tonal' && {
|
|
111
|
-
'state-on-surface-variant': !isActive && Boolean(onToggle),
|
|
112
|
-
'state-on-secondary-container': isActive || !onToggle,
|
|
113
|
-
},
|
|
114
|
-
variant === 'outlined' && {
|
|
115
|
-
'state-on-surface-variant': !isActive,
|
|
116
|
-
'state-on-primary': isActive,
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
),
|
|
120
|
-
icon: classNames(
|
|
121
|
-
' transition-all duration-300',
|
|
122
|
-
{ 'size-5 p-1.5': size === 'xSmall' },
|
|
123
|
-
{ 'size-6 p-2': size === 'small' },
|
|
124
|
-
{ 'size-6 p-4': size === 'medium' },
|
|
125
|
-
{ 'size-8 p-8': size === 'large' },
|
|
126
|
-
{ 'size-10 p-12': size === 'xLarge' },
|
|
127
|
-
width == 'narrow' && [
|
|
128
|
-
{ 'px-1': size === 'xSmall' },
|
|
129
|
-
{ 'px-1': size === 'small' },
|
|
130
|
-
{ 'px-3': size === 'medium' },
|
|
131
|
-
{ 'px-4': size === 'large' },
|
|
132
|
-
{ 'px-8': size === 'xLarge' },
|
|
133
|
-
],
|
|
134
|
-
width == 'wide' && [
|
|
135
|
-
{ 'px-2.5': size === 'xSmall' },
|
|
136
|
-
{ 'px-3.5': size === 'small' },
|
|
137
|
-
{ 'px-6': size === 'medium' },
|
|
138
|
-
{ 'px-12': size === 'large' },
|
|
139
|
-
{ 'px-[72px]': size === 'xLarge' },
|
|
140
|
-
],
|
|
141
|
-
!disabled && [
|
|
142
|
-
variant === 'standard' && {
|
|
143
|
-
'text-on-surface-variant': !isActive,
|
|
144
|
-
'text-primary': isActive,
|
|
145
|
-
},
|
|
146
|
-
variant === 'filled' && {
|
|
147
|
-
'text-primary': !isActive && Boolean(onToggle),
|
|
148
|
-
'text-on-primary': isActive || !onToggle,
|
|
149
|
-
},
|
|
150
|
-
variant === 'outlined' && {
|
|
151
|
-
'text-on-surface-variant': !isActive,
|
|
152
|
-
'text-inverse-on-surface': isActive,
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
Boolean(disabled) && 'text-on-surface/[0.38]',
|
|
156
|
-
),
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export const iconButtonStyle = defaultClassNames<IconButtonInterface>(
|
|
161
|
-
'iconButton',
|
|
162
|
-
iconButtonConfig,
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
export const useIconButtonStyle = createUseClassNames<IconButtonInterface>(
|
|
166
|
-
'iconButton',
|
|
167
|
-
iconButtonConfig,
|
|
168
|
-
);
|
package/src/lib/styles/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export * from './button.style';
|
|
2
|
-
export * from './card.style';
|
|
3
|
-
export * from './carousel-item.style';
|
|
4
|
-
export * from './carousel.style';
|
|
5
|
-
export * from './checkbox.style';
|
|
6
|
-
export * from './chip.style';
|
|
7
|
-
export * from './chips.style';
|
|
8
|
-
export * from './divider.style';
|
|
9
|
-
export * from './fab.style';
|
|
10
|
-
export * from './fab-menu.style';
|
|
11
|
-
export * from './icon-button.style';
|
|
12
|
-
export * from './menu.style';
|
|
13
|
-
export * from './menu-group.style';
|
|
14
|
-
export * from './progress-indicator.style';
|
|
15
|
-
export * from './side-sheet.style';
|
|
16
|
-
export * from './slider.style';
|
|
17
|
-
export * from './snackbar.style';
|
|
18
|
-
export * from './switch.style';
|
|
19
|
-
export * from './tab.style';
|
|
20
|
-
export * from './tabs.style';
|
|
21
|
-
export * from './tab-panels.style';
|
|
22
|
-
export * from './text-field.style';
|
|
23
|
-
export * from './tooltip.style';
|
|
24
|
-
export { useButtonStyle } from './button.style';
|
|
25
|
-
export { useMenuStyle } from './menu.style';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ClassNameComponent,
|
|
3
|
-
classNames,
|
|
4
|
-
createUseClassNames,
|
|
5
|
-
defaultClassNames,
|
|
6
|
-
} from '../utils';
|
|
7
|
-
import { MenuGroupInterface } from '../interfaces/menu-group.interface';
|
|
8
|
-
|
|
9
|
-
const menuGroupConfig: ClassNameComponent<MenuGroupInterface> = ({
|
|
10
|
-
variant,
|
|
11
|
-
}) => ({
|
|
12
|
-
menuGroup: classNames(
|
|
13
|
-
'flex flex-col gap-0.5 mb-0.5 last:mb-0',
|
|
14
|
-
'rounded-lg py-0.5 px-1 shadow-2 first:rounded-t-2xl last:rounded-b-2xl',
|
|
15
|
-
{
|
|
16
|
-
'bg-surface-container': variant === 'standard',
|
|
17
|
-
'bg-tertiary-container text-on-tertiary-container': variant === 'vibrant',
|
|
18
|
-
},
|
|
19
|
-
),
|
|
20
|
-
groupLabel: classNames('px-3 pt-2 text-label-small tracking-wide ', {
|
|
21
|
-
'text-on-surface-variant': variant === 'standard',
|
|
22
|
-
'text-on-tertiary-container opacity-80': variant === 'vibrant',
|
|
23
|
-
}),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export const menuGroupStyle = defaultClassNames<MenuGroupInterface>(
|
|
27
|
-
'menuGroup',
|
|
28
|
-
menuGroupConfig,
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
export const useMenuGroupStyle = createUseClassNames<MenuGroupInterface>(
|
|
32
|
-
'menuGroup',
|
|
33
|
-
menuGroupConfig,
|
|
34
|
-
);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { type ClassNameComponent, classNames, defaultClassNames, createUseClassNames } from '../utils';
|
|
3
|
-
|
|
4
|
-
export interface MenuHeadlineInterface {
|
|
5
|
-
label?: string;
|
|
6
|
-
variant?: 'standard' | 'vibrant';
|
|
7
|
-
type: 'div';
|
|
8
|
-
props: { label?: string; variant?: 'standard' | 'vibrant' };
|
|
9
|
-
states: Record<string, any>;
|
|
10
|
-
elements: ['headline'];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const menuHeadlineConfig: ClassNameComponent<MenuHeadlineInterface> = ({ props }) => ({
|
|
14
|
-
headline: classNames('px-3 py-1 text-label-small opacity-60 mt-1', {
|
|
15
|
-
'text-on-surface-variant': !props?.variant || props.variant === 'standard',
|
|
16
|
-
// Vibrant treatment if different
|
|
17
|
-
}),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export const useMenuHeadlineStyle = createUseClassNames<MenuHeadlineInterface>('menu-headline', menuHeadlineConfig);
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ClassNameComponent,
|
|
3
|
-
classNames,
|
|
4
|
-
createUseClassNames,
|
|
5
|
-
defaultClassNames,
|
|
6
|
-
} from '../utils';
|
|
7
|
-
import { MenuItemInterface } from '../interfaces/menu-item.interface';
|
|
8
|
-
|
|
9
|
-
const menuItemConfig: ClassNameComponent<MenuItemInterface> = ({
|
|
10
|
-
variant,
|
|
11
|
-
disabled,
|
|
12
|
-
isActive,
|
|
13
|
-
}) => ({
|
|
14
|
-
menuItem: classNames(
|
|
15
|
-
'group/menu-item text-start overflow-hidden flex items-center h-12 px-3 cursor-pointer outline-none select-none shrink-0 ',
|
|
16
|
-
'text-label-large',
|
|
17
|
-
'transition-colors duration-200',
|
|
18
|
-
'rounded-xl',
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
'text-on-surface': !variant || variant === 'standard',
|
|
22
|
-
// 'hover:bg-on-surface/[0.08] focus:bg-on-surface/[0.12]': !props?.variant || props.variant === 'standard', // Handled by State
|
|
23
|
-
// 'hover:bg-on-tertiary-container/[0.08] focus:bg-on-tertiary-container/[0.12]': props?.variant === 'vibrant', // Handled by State
|
|
24
|
-
'opacity-38 pointer-events-none': disabled,
|
|
25
|
-
},
|
|
26
|
-
(variant === 'vibrant' || isActive) && [
|
|
27
|
-
'bg-secondary-container text-on-secondary-container',
|
|
28
|
-
],
|
|
29
|
-
),
|
|
30
|
-
itemLabel: classNames('flex-1 truncate'),
|
|
31
|
-
itemIcon: classNames(
|
|
32
|
-
'w-6 h-6 flex items-center justify-center menu-item-icon',
|
|
33
|
-
),
|
|
34
|
-
leadingIcon: classNames('mr-3'),
|
|
35
|
-
trailingIcon: classNames('ml-3'),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const menuItemStyle = defaultClassNames<MenuItemInterface>(
|
|
39
|
-
'menuItem',
|
|
40
|
-
menuItemConfig,
|
|
41
|
-
);
|
|
42
|
-
export const useMenuItemStyle = createUseClassNames<MenuItemInterface>(
|
|
43
|
-
'menuItem',
|
|
44
|
-
menuItemConfig,
|
|
45
|
-
);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ClassNameComponent,
|
|
3
|
-
classNames,
|
|
4
|
-
createUseClassNames,
|
|
5
|
-
defaultClassNames,
|
|
6
|
-
} from '../utils';
|
|
7
|
-
import { MenuInterface } from '../interfaces';
|
|
8
|
-
|
|
9
|
-
const menuConfig: ClassNameComponent<MenuInterface> = ({
|
|
10
|
-
variant,
|
|
11
|
-
hasGroups,
|
|
12
|
-
}) => ({
|
|
13
|
-
menu: classNames(
|
|
14
|
-
'z-50 min-w-[112px] max-w-[280px] max-h-[300px] ',
|
|
15
|
-
'flex flex-col',
|
|
16
|
-
{ 'overflow-y-auto': !hasGroups },
|
|
17
|
-
{
|
|
18
|
-
'bg-surface-container': !variant || variant === 'standard',
|
|
19
|
-
// Vibrant uses tertiary-container (approximated) or just colored surface
|
|
20
|
-
'bg-tertiary-container text-on-tertiary-container': variant === 'vibrant',
|
|
21
|
-
'py-0.5 shadow-2 px-1 rounded-2xl': !hasGroups,
|
|
22
|
-
'bg-transparent ': hasGroups,
|
|
23
|
-
},
|
|
24
|
-
),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const menuStyle = defaultClassNames<MenuInterface>('menu', menuConfig);
|
|
28
|
-
|
|
29
|
-
export const useMenuStyle = createUseClassNames<MenuInterface>(
|
|
30
|
-
'menu',
|
|
31
|
-
menuConfig,
|
|
32
|
-
);
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ClassNameComponent,
|
|
3
|
-
classNames,
|
|
4
|
-
createUseClassNames,
|
|
5
|
-
defaultClassNames,
|
|
6
|
-
} from '../utils';
|
|
7
|
-
import { NavigationRailItemInterface } from '../interfaces';
|
|
8
|
-
|
|
9
|
-
const navigationRailItemConfig: ClassNameComponent<
|
|
10
|
-
NavigationRailItemInterface
|
|
11
|
-
> = ({ isSelected, icon, label, variant }) => ({
|
|
12
|
-
navigationRailItem: classNames(
|
|
13
|
-
' group/navigation-rail-item flex flex-col pt-1 pb-1.5 cursor-pointer',
|
|
14
|
-
{
|
|
15
|
-
'text-on-surface-variant': !isSelected,
|
|
16
|
-
'text-on-secondary-container': isSelected,
|
|
17
|
-
'gap-2 h-[68px]': variant == 'vertical',
|
|
18
|
-
'gap-0 h-[66px]': variant == 'horizontal',
|
|
19
|
-
},
|
|
20
|
-
),
|
|
21
|
-
container: classNames(
|
|
22
|
-
' w-fit flex justify-center relative rounded-full items-center mx-5',
|
|
23
|
-
{
|
|
24
|
-
'bg-secondary-container overflow-hidden': isSelected,
|
|
25
|
-
'gap-2 ': variant == 'horizontal',
|
|
26
|
-
'gap-0 ': variant == 'vertical',
|
|
27
|
-
'p-4': !label,
|
|
28
|
-
},
|
|
29
|
-
label && [
|
|
30
|
-
'px-4',
|
|
31
|
-
{
|
|
32
|
-
'py-1 ': variant == 'vertical',
|
|
33
|
-
'py-4 ': variant == 'horizontal',
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
),
|
|
37
|
-
stateLayer: classNames('rounded-full'),
|
|
38
|
-
|
|
39
|
-
icon: classNames('size-6 flex'),
|
|
40
|
-
label: classNames('w-fit mx-auto text-nowrap', {
|
|
41
|
-
'text-label-large ': variant == 'horizontal',
|
|
42
|
-
'text-label-medium': variant == 'vertical',
|
|
43
|
-
}),
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export const navigationRailItemStyle =
|
|
47
|
-
defaultClassNames<NavigationRailItemInterface>(
|
|
48
|
-
'navigationRailItem',
|
|
49
|
-
navigationRailItemConfig,
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
export const useNavigationRailItemStyle =
|
|
53
|
-
createUseClassNames<NavigationRailItemInterface>(
|
|
54
|
-
'navigationRailItem',
|
|
55
|
-
navigationRailItemConfig,
|
|
56
|
-
);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ClassNameComponent,
|
|
3
|
-
classNames,
|
|
4
|
-
createUseClassNames,
|
|
5
|
-
defaultClassNames,
|
|
6
|
-
} from '../utils';
|
|
7
|
-
import { NavigationRailInterface } from '../interfaces/navigation-rail.interface';
|
|
8
|
-
|
|
9
|
-
const navigationRailConfig: ClassNameComponent<NavigationRailInterface> = ({
|
|
10
|
-
isExtended,
|
|
11
|
-
alignment,
|
|
12
|
-
}) => ({
|
|
13
|
-
navigationRail: classNames('flex flex-col left-0 h-full top-0 pt-11', {
|
|
14
|
-
'w-fit max-w-24': !isExtended,
|
|
15
|
-
'w-fit min-w-[220px] max-w-[360px]': isExtended,
|
|
16
|
-
'justify-between': alignment == 'middle',
|
|
17
|
-
'justify-start': alignment == 'top',
|
|
18
|
-
}),
|
|
19
|
-
header: classNames('flex flex-col gap-1 items-start'),
|
|
20
|
-
menuIcon: 'mx-5',
|
|
21
|
-
segments: classNames(' flex flex-col overflow-auto min-w-full mt-10', {
|
|
22
|
-
'w-full': !isExtended,
|
|
23
|
-
'w-fit items-start': isExtended,
|
|
24
|
-
}),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const navigationRailStyle = defaultClassNames<NavigationRailInterface>(
|
|
28
|
-
'navigationRail',
|
|
29
|
-
navigationRailConfig,
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
export const useNavigationRailStyle =
|
|
33
|
-
createUseClassNames<NavigationRailInterface>(
|
|
34
|
-
'navigationRail',
|
|
35
|
-
navigationRailConfig,
|
|
36
|
-
);
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ProgressIndicatorInterface } from '../interfaces/progress-indicator.interface';
|
|
2
|
-
import {
|
|
3
|
-
type ClassNameComponent,
|
|
4
|
-
classNames,
|
|
5
|
-
createUseClassNames,
|
|
6
|
-
defaultClassNames,
|
|
7
|
-
} from '../utils';
|
|
8
|
-
|
|
9
|
-
const progressIndicatorConfig: ClassNameComponent<
|
|
10
|
-
ProgressIndicatorInterface
|
|
11
|
-
> = ({ variant, isVisible }) => ({
|
|
12
|
-
progressIndicator: classNames(
|
|
13
|
-
(variant === 'linear-determinate' || variant == 'linear-indeterminate') &&
|
|
14
|
-
'flex w-full h-1',
|
|
15
|
-
variant === 'linear-indeterminate' &&
|
|
16
|
-
'relative overflow-hidden rounded-full',
|
|
17
|
-
),
|
|
18
|
-
firstTrack: classNames(
|
|
19
|
-
(variant === 'linear-determinate' || variant === 'linear-indeterminate') &&
|
|
20
|
-
'h-full rounded-full bg-primary-container',
|
|
21
|
-
{
|
|
22
|
-
'max-h-0': !isVisible,
|
|
23
|
-
'max-h-full': isVisible,
|
|
24
|
-
},
|
|
25
|
-
),
|
|
26
|
-
activeIndicator: classNames(
|
|
27
|
-
'h-full rounded-full bg-primary',
|
|
28
|
-
variant === 'linear-determinate' && {
|
|
29
|
-
'rounded-l-full': true,
|
|
30
|
-
},
|
|
31
|
-
(variant === 'linear-indeterminate' ||
|
|
32
|
-
variant === 'linear-determinate') && {
|
|
33
|
-
'max-h-0': !isVisible,
|
|
34
|
-
'max-h-full': isVisible,
|
|
35
|
-
},
|
|
36
|
-
(variant === 'circular-determinate' ||
|
|
37
|
-
variant == 'circular-indeterminate') && [
|
|
38
|
-
'stroke-primary fill-transparent ',
|
|
39
|
-
{
|
|
40
|
-
'stroke-[4px]': isVisible,
|
|
41
|
-
'stroke-[0px]': !isVisible,
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
),
|
|
45
|
-
lastTrack: classNames(
|
|
46
|
-
(variant === 'linear-determinate' || variant == 'linear-indeterminate') &&
|
|
47
|
-
'h-full flex-1 rounded-full bg-primary-container',
|
|
48
|
-
{
|
|
49
|
-
'max-h-0': !isVisible,
|
|
50
|
-
'max-h-full': isVisible,
|
|
51
|
-
},
|
|
52
|
-
),
|
|
53
|
-
stop: classNames(
|
|
54
|
-
'absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1',
|
|
55
|
-
{
|
|
56
|
-
'max-h-0': !isVisible,
|
|
57
|
-
'max-h-full': isVisible,
|
|
58
|
-
},
|
|
59
|
-
),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
export const progressIndicatorStyle =
|
|
63
|
-
defaultClassNames<ProgressIndicatorInterface>(
|
|
64
|
-
'progressIndicator',
|
|
65
|
-
progressIndicatorConfig,
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
export const useProgressIndicatorStyle =
|
|
69
|
-
createUseClassNames<ProgressIndicatorInterface>(
|
|
70
|
-
'progressIndicator',
|
|
71
|
-
progressIndicatorConfig,
|
|
72
|
-
);
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ClassNameComponent,
|
|
3
|
-
classNames,
|
|
4
|
-
createUseClassNames,
|
|
5
|
-
defaultClassNames,
|
|
6
|
-
} from '../utils';
|
|
7
|
-
|
|
8
|
-
import { SideSheetInterface } from '../interfaces';
|
|
9
|
-
|
|
10
|
-
export const sideSheetConfig: ClassNameComponent<SideSheetInterface> = ({
|
|
11
|
-
variant,
|
|
12
|
-
position,
|
|
13
|
-
}) => ({
|
|
14
|
-
sideSheet: classNames(
|
|
15
|
-
'bg-surface flex justify-between max-w-xs z-10',
|
|
16
|
-
{
|
|
17
|
-
'flex-row-reverse': position == 'right',
|
|
18
|
-
'h-full': variant == 'standard',
|
|
19
|
-
},
|
|
20
|
-
variant == 'modal' && [
|
|
21
|
-
'rounded-2xl fixed top-0 m-[1rem] h-[calc(100dvh-2rem)]',
|
|
22
|
-
{
|
|
23
|
-
'right-0': position == 'right',
|
|
24
|
-
'left-0': position == 'left',
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
),
|
|
28
|
-
container: classNames('w-full overflow-hidden flex flex-col', {}),
|
|
29
|
-
header: classNames('p-4 flex items-center gap-2'),
|
|
30
|
-
content: classNames('flex-1 overflow-y-auto'),
|
|
31
|
-
title: classNames('text-on-surface-variant text-title-large'),
|
|
32
|
-
closeButton: classNames('ml-auto'),
|
|
33
|
-
divider: classNames({ hidden: variant == 'modal' }),
|
|
34
|
-
overlay: classNames('bg-[black]/[0.32] fixed top-0 left-0 w-screen h-screen'),
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export const sideSheetStyle = defaultClassNames<SideSheetInterface>(
|
|
38
|
-
'sideSheet',
|
|
39
|
-
sideSheetConfig,
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
export const useSideSheetStyle = createUseClassNames<SideSheetInterface>(
|
|
43
|
-
'sideSheet',
|
|
44
|
-
sideSheetConfig,
|
|
45
|
-
);
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ClassNameComponent,
|
|
3
|
-
classNames,
|
|
4
|
-
createUseClassNames,
|
|
5
|
-
defaultClassNames,
|
|
6
|
-
} from '../utils';
|
|
7
|
-
import { SliderInterface } from '../interfaces';
|
|
8
|
-
|
|
9
|
-
export const sliderConfig: ClassNameComponent<SliderInterface> = ({
|
|
10
|
-
isChanging,
|
|
11
|
-
}) => ({
|
|
12
|
-
slider: classNames([
|
|
13
|
-
'relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer min-w-32',
|
|
14
|
-
]),
|
|
15
|
-
activeTrack: classNames([
|
|
16
|
-
'h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full ',
|
|
17
|
-
]),
|
|
18
|
-
inactiveTrack: classNames([
|
|
19
|
-
'h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden',
|
|
20
|
-
]),
|
|
21
|
-
handle: classNames([
|
|
22
|
-
'transform relative transition-all duration-100 bg-primary h-full rounded-full ',
|
|
23
|
-
{ 'w-0.5': isChanging, 'w-1': !isChanging },
|
|
24
|
-
]),
|
|
25
|
-
valueIndicator: classNames([
|
|
26
|
-
'absolute select-none bg-inverse-surface text-inverse-on-surface py-3 px-4 text-label-large rounded-full bottom-[calc(100%+4px)] transform left-1/2 -translate-x-1/2',
|
|
27
|
-
]),
|
|
28
|
-
dot: classNames([
|
|
29
|
-
'h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full',
|
|
30
|
-
]),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export const sliderStyle = defaultClassNames<SliderInterface>(
|
|
34
|
-
'slider',
|
|
35
|
-
sliderConfig,
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
export const useSliderStyle = createUseClassNames<SliderInterface>(
|
|
39
|
-
'slider',
|
|
40
|
-
sliderConfig,
|
|
41
|
-
);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ClassNameComponent,
|
|
3
|
-
classNames,
|
|
4
|
-
createUseClassNames,
|
|
5
|
-
defaultClassNames,
|
|
6
|
-
} from '../utils';
|
|
7
|
-
import { SnackbarInterface } from '../interfaces';
|
|
8
|
-
|
|
9
|
-
const snackbarConfig: ClassNameComponent<SnackbarInterface> = () => ({
|
|
10
|
-
snackbar: classNames(' rounded bg-inverse-surface '),
|
|
11
|
-
container: classNames(
|
|
12
|
-
'pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap',
|
|
13
|
-
),
|
|
14
|
-
supportingText: classNames('text-body-medium text-inverse-on-surface '),
|
|
15
|
-
icon: classNames(' ml-auto mr-0 text-inverse-on-surface block dark'),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const snackbarStyle = defaultClassNames<SnackbarInterface>(
|
|
19
|
-
'snackbar',
|
|
20
|
-
snackbarConfig,
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export const useSnackbarStyle = createUseClassNames<SnackbarInterface>(
|
|
24
|
-
'snackbar',
|
|
25
|
-
snackbarConfig,
|
|
26
|
-
);
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ClassNameComponent,
|
|
3
|
-
classNames,
|
|
4
|
-
createUseClassNames,
|
|
5
|
-
defaultClassNames,
|
|
6
|
-
} from '../utils';
|
|
7
|
-
import { SwitchInterface } from '../interfaces';
|
|
8
|
-
|
|
9
|
-
const switchConfig: ClassNameComponent<SwitchInterface> = ({
|
|
10
|
-
isSelected,
|
|
11
|
-
disabled,
|
|
12
|
-
inactiveIcon,
|
|
13
|
-
}) => ({
|
|
14
|
-
switch: classNames(
|
|
15
|
-
'group/switch w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center',
|
|
16
|
-
|
|
17
|
-
{ 'bg-on-surface/[0.12] border-transparent': disabled },
|
|
18
|
-
!disabled && [
|
|
19
|
-
'cursor-pointer ',
|
|
20
|
-
{ 'bg-primary border-primary': isSelected },
|
|
21
|
-
{ 'bg-surface-container border-outline': !isSelected },
|
|
22
|
-
],
|
|
23
|
-
|
|
24
|
-
// { 'justify-start': !isSelected },
|
|
25
|
-
// { 'justify-end': isSelected },
|
|
26
|
-
),
|
|
27
|
-
handleContainer: classNames(
|
|
28
|
-
'flex items-center justify-center absolute',
|
|
29
|
-
{ 'left-[14px]': !isSelected },
|
|
30
|
-
{ 'right-[14px]': isSelected },
|
|
31
|
-
),
|
|
32
|
-
handle: classNames(
|
|
33
|
-
'transition-all duration-100 z-10 rounded-full flex items-center justify-center',
|
|
34
|
-
{ 'w-[16px] h-[16px]': !isSelected && !inactiveIcon },
|
|
35
|
-
{ 'w-[24px] h-[24px]': !(!isSelected && !inactiveIcon) },
|
|
36
|
-
!disabled && [
|
|
37
|
-
'cursor-pointer group-active/switch:h-[28px] group-active/switch:w-[28px]',
|
|
38
|
-
{ 'bg-on-primary group-hover/switch:bg-primary-container': isSelected },
|
|
39
|
-
{ 'bg-outline group-hover/switch:bg-on-surface-variant': !isSelected },
|
|
40
|
-
],
|
|
41
|
-
|
|
42
|
-
{ 'bg-surface': disabled },
|
|
43
|
-
),
|
|
44
|
-
handleStateLayer: classNames(
|
|
45
|
-
'w-[40px] h-[40px] -z-10 rounded-full absolute',
|
|
46
|
-
{ 'group-state-primary': !disabled },
|
|
47
|
-
),
|
|
48
|
-
icon: classNames(
|
|
49
|
-
'w-[16px] h-[16px]',
|
|
50
|
-
!disabled && [
|
|
51
|
-
{ 'text-on-primary-container': isSelected },
|
|
52
|
-
{ 'text-on-primary': !isSelected },
|
|
53
|
-
],
|
|
54
|
-
|
|
55
|
-
{ 'text-on-surface/[0.38]': disabled },
|
|
56
|
-
),
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
export const switchStyle = defaultClassNames<SwitchInterface>(
|
|
60
|
-
'switch',
|
|
61
|
-
switchConfig,
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
export const useSwitchStyle = createUseClassNames<SwitchInterface>(
|
|
65
|
-
'switch',
|
|
66
|
-
switchConfig,
|
|
67
|
-
);
|