@udixio/ui-react 2.6.0 → 2.8.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.
Files changed (130) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.js +2300 -1971
  4. package/dist/lib/components/Button.d.ts.map +1 -1
  5. package/dist/lib/components/Card.d.ts.map +1 -1
  6. package/dist/lib/components/Fab.d.ts +1 -1
  7. package/dist/lib/components/Fab.d.ts.map +1 -1
  8. package/dist/lib/components/FabMenu.d.ts +9 -0
  9. package/dist/lib/components/FabMenu.d.ts.map +1 -0
  10. package/dist/lib/components/IconButton.d.ts.map +1 -1
  11. package/dist/lib/components/NavigationRail.d.ts.map +1 -1
  12. package/dist/lib/components/NavigationRailItem.d.ts.map +1 -1
  13. package/dist/lib/components/Tab.d.ts.map +1 -1
  14. package/dist/lib/components/ToolTip.d.ts.map +1 -1
  15. package/dist/lib/components/index.d.ts +1 -0
  16. package/dist/lib/components/index.d.ts.map +1 -1
  17. package/dist/lib/effects/State.d.ts +26 -0
  18. package/dist/lib/effects/State.d.ts.map +1 -0
  19. package/dist/lib/effects/index.d.ts +1 -0
  20. package/dist/lib/effects/index.d.ts.map +1 -1
  21. package/dist/lib/effects/ripple/RippleEffect.d.ts.map +1 -1
  22. package/dist/lib/interfaces/button.interface.d.ts +4 -1
  23. package/dist/lib/interfaces/button.interface.d.ts.map +1 -1
  24. package/dist/lib/interfaces/fab-menu.interface.d.ts +12 -0
  25. package/dist/lib/interfaces/fab-menu.interface.d.ts.map +1 -0
  26. package/dist/lib/interfaces/fab.interface.d.ts +2 -2
  27. package/dist/lib/interfaces/fab.interface.d.ts.map +1 -1
  28. package/dist/lib/interfaces/index.d.ts +1 -0
  29. package/dist/lib/interfaces/index.d.ts.map +1 -1
  30. package/dist/lib/interfaces/side-sheet.interface.d.ts +1 -1
  31. package/dist/lib/interfaces/side-sheet.interface.d.ts.map +1 -1
  32. package/dist/lib/styles/button.style.d.ts +43 -3
  33. package/dist/lib/styles/button.style.d.ts.map +1 -1
  34. package/dist/lib/styles/card.style.d.ts +9 -1
  35. package/dist/lib/styles/card.style.d.ts.map +1 -1
  36. package/dist/lib/styles/carousel-item.style.d.ts +11 -1
  37. package/dist/lib/styles/carousel-item.style.d.ts.map +1 -1
  38. package/dist/lib/styles/carousel.style.d.ts +16 -1
  39. package/dist/lib/styles/carousel.style.d.ts.map +1 -1
  40. package/dist/lib/styles/divider.style.d.ts +8 -2
  41. package/dist/lib/styles/divider.style.d.ts.map +1 -1
  42. package/dist/lib/styles/fab-menu.style.d.ts +83 -0
  43. package/dist/lib/styles/fab-menu.style.d.ts.map +1 -0
  44. package/dist/lib/styles/fab.style.d.ts +29 -5
  45. package/dist/lib/styles/fab.style.d.ts.map +1 -1
  46. package/dist/lib/styles/icon-button.style.d.ts +37 -1
  47. package/dist/lib/styles/icon-button.style.d.ts.map +1 -1
  48. package/dist/lib/styles/index.d.ts +2 -0
  49. package/dist/lib/styles/index.d.ts.map +1 -1
  50. package/dist/lib/styles/navigation-rail-item.style.d.ts +11 -1
  51. package/dist/lib/styles/navigation-rail-item.style.d.ts.map +1 -1
  52. package/dist/lib/styles/navigation-rail.style.d.ts +31 -1
  53. package/dist/lib/styles/navigation-rail.style.d.ts.map +1 -1
  54. package/dist/lib/styles/progress-indicator.style.d.ts +12 -1
  55. package/dist/lib/styles/progress-indicator.style.d.ts.map +1 -1
  56. package/dist/lib/styles/side-sheet.style.d.ts +20 -3
  57. package/dist/lib/styles/side-sheet.style.d.ts.map +1 -1
  58. package/dist/lib/styles/slider.style.d.ts +21 -2
  59. package/dist/lib/styles/slider.style.d.ts.map +1 -1
  60. package/dist/lib/styles/snackbar.style.d.ts +14 -3
  61. package/dist/lib/styles/snackbar.style.d.ts.map +1 -1
  62. package/dist/lib/styles/switch.style.d.ts +14 -2
  63. package/dist/lib/styles/switch.style.d.ts.map +1 -1
  64. package/dist/lib/styles/tab.style.d.ts +12 -2
  65. package/dist/lib/styles/tab.style.d.ts.map +1 -1
  66. package/dist/lib/styles/tabs.style.d.ts +17 -2
  67. package/dist/lib/styles/tabs.style.d.ts.map +1 -1
  68. package/dist/lib/styles/text-field.style.d.ts +23 -2
  69. package/dist/lib/styles/text-field.style.d.ts.map +1 -1
  70. package/dist/lib/styles/tooltip.style.d.ts +20 -3
  71. package/dist/lib/styles/tooltip.style.d.ts.map +1 -1
  72. package/dist/lib/utils/styles/get-classname.d.ts +3 -0
  73. package/dist/lib/utils/styles/get-classname.d.ts.map +1 -1
  74. package/dist/lib/utils/styles/index.d.ts +1 -0
  75. package/dist/lib/utils/styles/index.d.ts.map +1 -1
  76. package/dist/lib/utils/styles/use-classnames.d.ts +6 -0
  77. package/dist/lib/utils/styles/use-classnames.d.ts.map +1 -0
  78. package/package.json +2 -2
  79. package/src/lib/components/Button.tsx +54 -20
  80. package/src/lib/components/Card.tsx +11 -9
  81. package/src/lib/components/Carousel.tsx +2 -2
  82. package/src/lib/components/CarouselItem.tsx +2 -2
  83. package/src/lib/components/Divider.tsx +2 -2
  84. package/src/lib/components/Fab.tsx +22 -21
  85. package/src/lib/components/FabMenu.tsx +229 -0
  86. package/src/lib/components/IconButton.tsx +24 -30
  87. package/src/lib/components/NavigationRail.tsx +7 -4
  88. package/src/lib/components/NavigationRailItem.tsx +13 -4
  89. package/src/lib/components/ProgressIndicator.tsx +2 -2
  90. package/src/lib/components/SideSheet.tsx +2 -2
  91. package/src/lib/components/Slider.tsx +2 -2
  92. package/src/lib/components/Snackbar.tsx +2 -2
  93. package/src/lib/components/Switch.tsx +2 -2
  94. package/src/lib/components/Tab.tsx +11 -11
  95. package/src/lib/components/Tabs.tsx +2 -2
  96. package/src/lib/components/TextField.tsx +2 -2
  97. package/src/lib/components/ToolTip.tsx +9 -3
  98. package/src/lib/components/index.ts +1 -0
  99. package/src/lib/effects/State.tsx +83 -0
  100. package/src/lib/effects/index.ts +1 -0
  101. package/src/lib/effects/ripple/RippleEffect.tsx +40 -27
  102. package/src/lib/interfaces/button.interface.ts +5 -1
  103. package/src/lib/interfaces/fab-menu.interface.ts +12 -0
  104. package/src/lib/interfaces/fab.interface.ts +8 -2
  105. package/src/lib/interfaces/index.ts +1 -0
  106. package/src/lib/interfaces/side-sheet.interface.tsx +1 -1
  107. package/src/lib/styles/button.style.ts +127 -136
  108. package/src/lib/styles/card.style.ts +22 -17
  109. package/src/lib/styles/carousel-item.style.ts +23 -9
  110. package/src/lib/styles/carousel.style.ts +17 -5
  111. package/src/lib/styles/divider.style.ts +27 -13
  112. package/src/lib/styles/fab-menu.style.ts +28 -0
  113. package/src/lib/styles/fab.style.ts +45 -43
  114. package/src/lib/styles/icon-button.style.ts +160 -149
  115. package/src/lib/styles/index.ts +2 -0
  116. package/src/lib/styles/navigation-rail-item.style.ts +49 -40
  117. package/src/lib/styles/navigation-rail.style.ts +31 -15
  118. package/src/lib/styles/progress-indicator.style.ts +49 -36
  119. package/src/lib/styles/side-sheet.style.ts +41 -27
  120. package/src/lib/styles/slider.style.ts +37 -23
  121. package/src/lib/styles/snackbar.style.ts +22 -10
  122. package/src/lib/styles/switch.style.ts +61 -45
  123. package/src/lib/styles/tab.style.ts +76 -66
  124. package/src/lib/styles/tabs.style.ts +19 -10
  125. package/src/lib/styles/text-field.style.ts +108 -97
  126. package/src/lib/styles/tooltip.style.ts +42 -33
  127. package/src/lib/utils/styles/get-classname.ts +23 -0
  128. package/src/lib/utils/styles/index.ts +1 -0
  129. package/src/lib/utils/styles/use-classnames.ts +25 -0
  130. package/src/tests/useClassNames.spec.tsx +82 -0
@@ -1,6 +1,5 @@
1
1
  import { MotionProps } from '../utils';
2
2
  import { SideSheetInterface } from '../interfaces';
3
- import { sideSheetStyle } from '../styles';
4
3
  import { Divider } from './Divider';
5
4
 
6
5
  import { faXmark } from '@fortawesome/free-solid-svg-icons';
@@ -8,6 +7,7 @@ import { IconButton } from './IconButton';
8
7
  import { useEffect, useState } from 'react';
9
8
  import { createPortal } from 'react-dom';
10
9
  import { AnimatePresence, motion } from 'motion/react';
10
+ import { sideSheetStyle } from '../styles';
11
11
 
12
12
  /**
13
13
  * Side sheets show secondary content anchored to the side of the screen
@@ -82,7 +82,7 @@ export const SideSheet = ({
82
82
  {isExtended && (
83
83
  <div
84
84
  {...rest}
85
- className={styles.slideSheet}
85
+ className={styles.sideSheet}
86
86
  style={{ transition: transition.duration + 's' }}
87
87
  >
88
88
  <motion.div
@@ -1,6 +1,6 @@
1
1
  import { AnimatePresence, motion } from 'motion/react';
2
2
  import { SliderInterface } from '../interfaces';
3
- import { sliderStyle } from '../styles';
3
+ import { useSliderStyle } from '../styles';
4
4
  import { classNames, ReactProps } from '../utils';
5
5
  import { useEffect, useRef, useState } from 'react';
6
6
 
@@ -106,7 +106,7 @@ export const Slider = ({
106
106
  };
107
107
  }, [mouseDown]);
108
108
 
109
- const styles = sliderStyle({
109
+ const styles = useSliderStyle({
110
110
  className,
111
111
  isChanging,
112
112
  marks,
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
2
2
  import { AnimatePresence, motion } from 'motion/react';
3
3
  import { faXmark } from '@fortawesome/free-solid-svg-icons';
4
4
  import { SnackbarInterface } from '../interfaces/snackbar.interface';
5
- import { snackbarStyle } from '../styles/snackbar.style';
5
+ import { useSnackbarStyle } from '../styles/snackbar.style';
6
6
 
7
7
  import { MotionProps } from '../utils/component';
8
8
  import { IconButton } from './IconButton';
@@ -22,7 +22,7 @@ export const Snackbar = ({
22
22
  }: MotionProps<SnackbarInterface>) => {
23
23
  const [isVisible, setIsVisible] = useState(true);
24
24
 
25
- const styles = snackbarStyle({
25
+ const styles = useSnackbarStyle({
26
26
  className,
27
27
  closeIcon,
28
28
  duration,
@@ -3,7 +3,7 @@ import React, { useRef, useState } from 'react';
3
3
  import { Icon } from '../icon';
4
4
  import { motion } from 'motion/react';
5
5
  import { SwitchInterface } from '../interfaces/switch.interface';
6
- import { switchStyle } from '../styles/switch.style';
6
+ import { useSwitchStyle } from '../styles/switch.style';
7
7
  import { MotionProps } from '../utils/component';
8
8
 
9
9
  /**
@@ -48,7 +48,7 @@ export const Switch = ({
48
48
  setIsSelected(!isSelected);
49
49
  onChange?.(!isSelected);
50
50
  };
51
- const styles = switchStyle({
51
+ const styles = useSwitchStyle({
52
52
  className,
53
53
  isSelected,
54
54
  activeIcon,
@@ -2,10 +2,10 @@ import { motion } from 'motion/react';
2
2
  import React, { useEffect, useRef, useState } from 'react';
3
3
 
4
4
  import { Icon } from '../icon';
5
- import { RippleEffect } from '../effects/ripple';
6
- import { tabStyle } from '../styles/tab.style';
5
+ import { useTabStyle } from '../styles/tab.style';
7
6
  import { TabInterface } from '../interfaces/tab.interface';
8
7
  import { ReactProps } from '../utils/component';
8
+ import { State } from '../effects';
9
9
 
10
10
  /**
11
11
  * @status beta
@@ -63,7 +63,7 @@ export const Tab = ({
63
63
  }
64
64
  };
65
65
 
66
- const styles = tabStyle({
66
+ const styles = useTabStyle({
67
67
  className,
68
68
  onTabSelected,
69
69
  scrollable,
@@ -90,14 +90,14 @@ export const Tab = ({
90
90
  onClick={handleClick}
91
91
  {...(restProps as any)}
92
92
  >
93
- <span className={styles.stateLayer}>
94
- <RippleEffect
95
- colorName={
96
- variant === 'primary' && isSelected ? 'primary' : 'on-surface'
97
- }
98
- triggerRef={resolvedRef}
99
- />
100
- </span>
93
+ <State
94
+ style={{ transition: 0.3 + 's' }}
95
+ className={styles.stateLayer}
96
+ colorName={
97
+ variant === 'primary' && isSelected ? 'primary' : 'on-surface'
98
+ }
99
+ stateClassName={'state-ripple-group-[tab]'}
100
+ />
101
101
  <span className={styles.content}>
102
102
  {icon && <Icon icon={icon} className={styles.icon} />}
103
103
  <span className={styles.label}>{label}</span>
@@ -2,7 +2,7 @@ import React, { useMemo, useState } from 'react';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import { TabsInterface } from '../interfaces/tabs.interface';
4
4
 
5
- import { tabsStyle } from '../styles/tabs.style';
5
+ import { useTabsStyle } from '../styles/tabs.style';
6
6
  import { ReactProps } from '../utils/component';
7
7
  import { TabProps } from '../interfaces/tab.interface';
8
8
  import { Tab } from './Tab';
@@ -62,7 +62,7 @@ export const Tabs = ({
62
62
 
63
63
  const tabsId = useMemo(() => uuidv4(), []);
64
64
 
65
- const styles = tabsStyle({
65
+ const styles = useTabsStyle({
66
66
  children,
67
67
  onTabSelected,
68
68
  scrollable,
@@ -5,7 +5,7 @@ import { motion } from 'motion/react';
5
5
  import { v4 as uuidv4 } from 'uuid';
6
6
 
7
7
  import TextareaAutosize from 'react-textarea-autosize';
8
- import { textFieldStyle } from '../styles/text-field.style';
8
+ import { useTextFieldStyle } from '../styles/text-field.style';
9
9
  import { classNames } from '../utils';
10
10
  import { ReactProps } from '../utils/component';
11
11
  import { TextFieldInterface } from '../interfaces/text-field.interface';
@@ -102,7 +102,7 @@ export const TextField = ({
102
102
  setIsFocused(false);
103
103
  };
104
104
 
105
- const styles = textFieldStyle({
105
+ const styles = useTextFieldStyle({
106
106
  showSupportingText,
107
107
  isFocused,
108
108
  showErrorIcon,
@@ -1,8 +1,14 @@
1
- import { cloneElement, isValidElement, useEffect, useRef, useState } from 'react';
1
+ import {
2
+ cloneElement,
3
+ isValidElement,
4
+ useEffect,
5
+ useRef,
6
+ useState,
7
+ } from 'react';
2
8
  import { MotionProps } from '../utils';
3
9
  import { Button } from './Button';
4
10
  import { ToolTipInterface } from '../interfaces';
5
- import { toolStyle } from '../styles';
11
+ import { useToolTipStyle } from '../styles';
6
12
  import { v4 } from 'uuid';
7
13
  import { AnimatePresence, motion } from 'motion/react';
8
14
  import { SyncedFixedWrapper } from '../effects';
@@ -170,7 +176,7 @@ export const ToolTip = ({
170
176
  }
171
177
  }
172
178
 
173
- const styles = toolStyle({
179
+ const styles = useToolTipStyle({
174
180
  variant,
175
181
  buttons,
176
182
  className,
@@ -5,6 +5,7 @@ export * from './CarouselItem';
5
5
  export * from './CarouselItem';
6
6
  export * from './Divider';
7
7
  export * from './Fab';
8
+ export * from './FabMenu';
8
9
  export * from './IconButton';
9
10
  export * from './IconButton';
10
11
  export * from './ProgressIndicator';
@@ -0,0 +1,83 @@
1
+ import { RippleEffect } from './ripple';
2
+ import {
3
+ ClassNameComponent,
4
+ classNames,
5
+ createUseClassNames,
6
+ ReactProps,
7
+ } from '../utils';
8
+ import { useEffect, useRef, useState } from 'react';
9
+
10
+ export interface StateInterface {
11
+ type: 'div';
12
+ props: {
13
+ colorName: string;
14
+ stateClassName?:
15
+ | string
16
+ | 'state-ripple-group'
17
+ | 'state-group'
18
+ | 'state-layer';
19
+ className?: string;
20
+ style?: React.CSSProperties;
21
+ };
22
+ states: { isClient: boolean };
23
+ elements: ['stateLayer'];
24
+ }
25
+
26
+ export const State = ({
27
+ style,
28
+ colorName,
29
+ stateClassName = 'state-ripple-group',
30
+ className,
31
+ }: ReactProps<StateInterface>) => {
32
+ const ref = useRef<HTMLDivElement>(null);
33
+ const groupStateRef = useRef<HTMLElement | null>(null);
34
+
35
+ const [isClient, setIsClient] = useState(false);
36
+ const styles = useStateStyle({
37
+ isClient,
38
+ stateClassName,
39
+ className,
40
+ colorName,
41
+ });
42
+
43
+ useEffect(() => {
44
+ if (ref.current && stateClassName !== 'state-layer') {
45
+ const groupName = !stateClassName.includes('[')
46
+ ? 'group'
47
+ : stateClassName.split('[')[1].split(']')[0];
48
+ const furthestGroupState = ref.current.closest(
49
+ `.${groupName}:not(.${groupName} .${groupName})`,
50
+ );
51
+ groupStateRef.current = furthestGroupState as HTMLElement | null;
52
+ }
53
+ setIsClient(true);
54
+ }, []);
55
+
56
+ return (
57
+ <div
58
+ ref={ref}
59
+ className={styles.stateLayer}
60
+ style={{
61
+ ['--state-color' as any]: `var(--default-color, var(--color-${colorName}))`,
62
+ ...style,
63
+ }}
64
+ >
65
+ {isClient && <RippleEffect triggerRef={groupStateRef} />}
66
+ </div>
67
+ );
68
+ };
69
+ // ... existing code ...
70
+ const cardConfig: ClassNameComponent<StateInterface> = ({
71
+ isClient,
72
+ stateClassName,
73
+ }) => ({
74
+ stateLayer: classNames([
75
+ stateClassName,
76
+ 'w-full top-0 left-0 h-full absolute pointer-events-none overflow-hidden',
77
+ ]),
78
+ });
79
+
80
+ export const useStateStyle = createUseClassNames<StateInterface>(
81
+ 'stateLayer',
82
+ cardConfig,
83
+ );
@@ -1,6 +1,7 @@
1
1
  export * from './ripple';
2
2
  export * from './custom-scroll';
3
3
  export * from './smooth-scroll.effect';
4
+ export * from './State';
4
5
  export * from './SyncedFixedWrapper';
5
6
  export * from './ThemeProvider';
6
7
  export * from './AnimateOnScroll';
@@ -12,37 +12,38 @@ const RippleEffect: React.FC<RippleEffectProps> = ({
12
12
  }) => {
13
13
  const ripple = {
14
14
  initial: {
15
- opacity: 0,
16
- borderRadius: '50%',
17
- width: '25%',
18
- height: '25%',
15
+ opacity: 1,
16
+ ['--r' as any]: '25%',
19
17
  },
20
18
  animate: {
21
19
  opacity: 1,
22
- borderRadius: 0,
23
- width: '200%',
24
- height: '200%',
20
+ ['--r' as any]: '100%',
21
+ transition: {
22
+ duration: 0.5,
23
+ },
24
+ },
25
+ exit: {
26
+ opacity: 0,
27
+ ['--r' as any]: '100%',
25
28
  transition: {
26
29
  duration: 0.3,
27
- borderRadius: { duration: 0.3, delay: 0.3 },
28
30
  },
29
31
  },
30
- };
32
+ } as const;
31
33
 
32
34
  const [isCompleted, setIsCompleted] = useState(true);
33
35
  const [isActive, setIsActive] = useState(false);
34
- const [coordinates, setCoordinates] = useState({ x: 0, y: 0 });
36
+ const [coordinates, setCoordinates] = useState({ x: 50, y: 50 });
35
37
 
36
38
  useEffect(() => {
37
39
  if (isActive) {
40
+ // restart presence cycle to allow exit animation after mouse up
38
41
  setIsCompleted(true);
39
42
  setIsCompleted(false);
40
43
  }
41
44
  }, [isActive]);
42
45
 
43
46
  useEffect(() => {
44
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
45
- // @ts-expect-error
46
47
  const element = triggerRef?.current;
47
48
  if (element) {
48
49
  element.addEventListener('mousedown', handleMouseDown);
@@ -59,7 +60,10 @@ const RippleEffect: React.FC<RippleEffectProps> = ({
59
60
  const handleMouseDown = (e: MouseEvent) => {
60
61
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
61
62
  // @ts-expect-error
62
- const el = triggerRef?.current as Element;
63
+ const el = triggerRef?.current as Element & {
64
+ clientWidth: number;
65
+ clientHeight: number;
66
+ };
63
67
  const rect = el.getBoundingClientRect();
64
68
  setIsActive(true);
65
69
  setCoordinates({
@@ -67,33 +71,42 @@ const RippleEffect: React.FC<RippleEffectProps> = ({
67
71
  y: ((e.clientY - rect.top) / el.clientHeight) * 100,
68
72
  });
69
73
  };
70
- const handleMouseLeave = (e: MouseEvent) => {
74
+ const handleMouseLeave = (_e: MouseEvent) => {
71
75
  setIsActive(false);
72
76
  };
73
77
 
74
- const handleMouseUp = (e: MouseEvent) => {
78
+ const handleMouseUp = (_e: MouseEvent) => {
75
79
  setIsActive(false);
76
80
  };
77
81
 
82
+ // Build the background as a function of state.
83
+ // color token mixed to a subtle alpha
84
+ const colorMix = `color-mix(in srgb, var(--state-color,_var(--color-${colorName})) 10%, transparent)`;
85
+ // const colorMix = `red`;
86
+
87
+ const style: React.CSSProperties & Record<string, any> = {
88
+ position: 'absolute',
89
+ inset: 0,
90
+ width: '100%',
91
+ height: '100%',
92
+ // supply CSS variables for gradient center and radius
93
+ ['--x' as any]: coordinates.x + '%',
94
+ ['--y' as any]: coordinates.y + '%',
95
+ ['--r' as any]: '0%', // will be animated by motion
96
+ background: `radial-gradient(ellipse at var(--x) var(--y), ${colorMix} var(--r), transparent calc(var(--r) * 2))`,
97
+ pointerEvents: 'none',
98
+ };
99
+
78
100
  return (
79
101
  <AnimatePresence mode="wait">
80
102
  {(isActive || (!isActive && !isCompleted)) && (
81
103
  <motion.div
82
- style={{
83
- position: 'absolute',
84
- width: '100%',
85
- height: '100%',
86
- top: coordinates.y + '%',
87
- left: coordinates.x + '%',
88
- background: `color-mix(in srgb, var(--color-${colorName}) 12%, transparent)`,
89
- pointerEvents: 'none',
90
- }}
104
+ style={style}
91
105
  variants={ripple}
92
106
  initial="initial"
93
- animate={'animate'}
94
- exit={{ opacity: 0, transition: { duration: 0 } }}
107
+ animate="animate"
108
+ exit="exit"
95
109
  onAnimationComplete={() => setIsCompleted(true)}
96
- className={'transform -translate-x-1/2 -translate-y-1/2'}
97
110
  />
98
111
  )}
99
112
  </AnimatePresence>
@@ -2,6 +2,9 @@ import { ActionOrLink } from '../utils';
2
2
  import { Transition } from 'motion';
3
3
  import { Icon } from '../icon';
4
4
 
5
+ type ButtonVariant = 'filled' | 'elevated' | 'tonal' | 'outlined' | 'text';
6
+ type ButtonVariantAlias = 'primary' | 'secondary';
7
+
5
8
  type Props = {
6
9
  /**
7
10
  * The label is the text that is displayed on the button.
@@ -14,8 +17,9 @@ type Props = {
14
17
 
15
18
  /**
16
19
  * The button variant determines the style of the button.
20
+ * Aliases: 'primary' maps to 'filled', 'secondary' maps to 'tonal'
17
21
  */
18
- variant?: 'filled' | 'elevated' | 'tonal' | 'outlined' | 'text';
22
+ variant?: ButtonVariant | ButtonVariantAlias;
19
23
 
20
24
  /**
21
25
  * Disables the button if set to true.
@@ -0,0 +1,12 @@
1
+ import { FabInterface } from './fab.interface';
2
+
3
+ export interface FabMenuInterface {
4
+ type: 'div';
5
+ props: FabInterface['props'] & {
6
+ variant?: 'primary' | 'secondary' | 'tertiary';
7
+ open?: boolean;
8
+ defaultOpen?: boolean;
9
+ onOpenChange?: (open: boolean) => void;
10
+ };
11
+ elements: ['fabMenu', 'fab', 'actions', 'action'];
12
+ }
@@ -2,14 +2,20 @@ import { ActionOrLink } from '../utils/component';
2
2
  import { Transition } from 'motion';
3
3
  import { Icon } from '../icon';
4
4
 
5
- export type FabVariant = 'surface' | 'primary' | 'secondary' | 'tertiary';
5
+ export type FabVariant =
6
+ | 'primary'
7
+ | 'secondary'
8
+ | 'tertiary'
9
+ | 'primaryContainer'
10
+ | 'secondaryContainer'
11
+ | 'tertiaryContainer';
6
12
  type Props = {
7
13
  variant?: FabVariant;
8
14
  label?: string;
9
15
  children?: string;
10
16
  icon: Icon;
11
17
  size?: 'small' | 'medium' | 'large';
12
- isExtended?: boolean;
18
+ extended?: boolean;
13
19
  transition?: Transition;
14
20
  };
15
21
 
@@ -4,6 +4,7 @@ export * from './carousel-item.interface';
4
4
  export * from './carousel.interface';
5
5
  export * from './divider.interface';
6
6
  export * from './fab.interface';
7
+ export * from './fab-menu.interface';
7
8
  export * from './icon-button.interface';
8
9
  export * from './progress-indicator.interface';
9
10
  export * from './side-sheet.interface';
@@ -16,7 +16,7 @@ export interface SideSheetInterface {
16
16
  };
17
17
  states: { isExtended: boolean };
18
18
  elements: [
19
- 'slideSheet',
19
+ 'sideSheet',
20
20
  'container',
21
21
  'title',
22
22
  'content',