@udixio/ui-react 2.10.13 → 2.10.15

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 (173) hide show
  1. package/package.json +4 -2
  2. package/.eslintrc.mjs +0 -22
  3. package/.storybook/main.ts +0 -20
  4. package/.storybook/preview.ts +0 -1
  5. package/CHANGELOG.md +0 -1144
  6. package/postcss.config.mjs +0 -5
  7. package/src/index.css +0 -4
  8. package/src/index.ts +0 -1
  9. package/src/lib/components/AnchorPositioner.tsx +0 -185
  10. package/src/lib/components/Button.tsx +0 -208
  11. package/src/lib/components/Card.tsx +0 -47
  12. package/src/lib/components/Carousel.tsx +0 -437
  13. package/src/lib/components/CarouselItem.tsx +0 -61
  14. package/src/lib/components/Checkbox.tsx +0 -120
  15. package/src/lib/components/Chip.tsx +0 -341
  16. package/src/lib/components/Chips.tsx +0 -331
  17. package/src/lib/components/ContextMenu.tsx +0 -109
  18. package/src/lib/components/DatePicker.tsx +0 -432
  19. package/src/lib/components/Divider.tsx +0 -20
  20. package/src/lib/components/Fab.tsx +0 -127
  21. package/src/lib/components/FabMenu.tsx +0 -239
  22. package/src/lib/components/IconButton.tsx +0 -146
  23. package/src/lib/components/Menu.tsx +0 -88
  24. package/src/lib/components/MenuGroup.tsx +0 -34
  25. package/src/lib/components/MenuHeadline.tsx +0 -9
  26. package/src/lib/components/MenuItem.tsx +0 -215
  27. package/src/lib/components/NavigationRail.tsx +0 -186
  28. package/src/lib/components/NavigationRailItem.tsx +0 -227
  29. package/src/lib/components/ProgressIndicator.tsx +0 -214
  30. package/src/lib/components/SideSheet.tsx +0 -135
  31. package/src/lib/components/Slider.tsx +0 -374
  32. package/src/lib/components/Snackbar.tsx +0 -77
  33. package/src/lib/components/Switch.tsx +0 -107
  34. package/src/lib/components/Tab.tsx +0 -123
  35. package/src/lib/components/TabGroup.tsx +0 -66
  36. package/src/lib/components/TabGroupContext.tsx +0 -16
  37. package/src/lib/components/TabPanel.tsx +0 -27
  38. package/src/lib/components/TabPanels.tsx +0 -76
  39. package/src/lib/components/Tabs.tsx +0 -105
  40. package/src/lib/components/TextField.tsx +0 -586
  41. package/src/lib/components/Tooltip.tsx +0 -217
  42. package/src/lib/components/index.ts +0 -34
  43. package/src/lib/config/config.interface.ts +0 -9
  44. package/src/lib/config/define-config.ts +0 -16
  45. package/src/lib/config/index.ts +0 -2
  46. package/src/lib/effects/AnimateOnScroll.ts +0 -391
  47. package/src/lib/effects/State.tsx +0 -90
  48. package/src/lib/effects/SyncedFixedWrapper.tsx +0 -62
  49. package/src/lib/effects/ThemeProvider.tsx +0 -174
  50. package/src/lib/effects/block-scroll.effect.tsx +0 -313
  51. package/src/lib/effects/custom-scroll/custom-scroll.effect.tsx +0 -407
  52. package/src/lib/effects/custom-scroll/custom-scroll.interface.ts +0 -29
  53. package/src/lib/effects/custom-scroll/custom-scroll.style.ts +0 -32
  54. package/src/lib/effects/custom-scroll/index.ts +0 -3
  55. package/src/lib/effects/index.ts +0 -7
  56. package/src/lib/effects/ripple/RippleEffect.tsx +0 -116
  57. package/src/lib/effects/ripple/index.tsx +0 -1
  58. package/src/lib/effects/scrollDriven.ts +0 -239
  59. package/src/lib/effects/smooth-scroll.effect.tsx +0 -112
  60. package/src/lib/effects/theme.worker.ts +0 -97
  61. package/src/lib/hooks/index.ts +0 -10
  62. package/src/lib/hooks/useTooltipTrigger.ts +0 -270
  63. package/src/lib/icon/icon.tsx +0 -125
  64. package/src/lib/icon/index.ts +0 -1
  65. package/src/lib/index.ts +0 -8
  66. package/src/lib/interfaces/button.interface.ts +0 -65
  67. package/src/lib/interfaces/card.interface.ts +0 -11
  68. package/src/lib/interfaces/carousel-item.interface.ts +0 -12
  69. package/src/lib/interfaces/carousel.interface.ts +0 -41
  70. package/src/lib/interfaces/checkbox.interface.ts +0 -39
  71. package/src/lib/interfaces/chip.interface.ts +0 -97
  72. package/src/lib/interfaces/chips.interface.ts +0 -37
  73. package/src/lib/interfaces/date-picker.interface.ts +0 -79
  74. package/src/lib/interfaces/divider.interface.ts +0 -7
  75. package/src/lib/interfaces/fab-menu.interface.ts +0 -12
  76. package/src/lib/interfaces/fab.interface.ts +0 -27
  77. package/src/lib/interfaces/icon-button.interface.ts +0 -38
  78. package/src/lib/interfaces/index.ts +0 -26
  79. package/src/lib/interfaces/menu-group.interface.ts +0 -13
  80. package/src/lib/interfaces/menu-item.interface.ts +0 -29
  81. package/src/lib/interfaces/menu.interface.ts +0 -19
  82. package/src/lib/interfaces/navigation-rail-item.interface.ts +0 -39
  83. package/src/lib/interfaces/navigation-rail.interface.ts +0 -39
  84. package/src/lib/interfaces/progress-indicator.interface.ts +0 -41
  85. package/src/lib/interfaces/side-sheet.interface.tsx +0 -28
  86. package/src/lib/interfaces/slider.interface.ts +0 -27
  87. package/src/lib/interfaces/snackbar.interface.ts +0 -13
  88. package/src/lib/interfaces/switch.interface.ts +0 -14
  89. package/src/lib/interfaces/tab-group.interface.ts +0 -13
  90. package/src/lib/interfaces/tab-panels.interface.ts +0 -21
  91. package/src/lib/interfaces/tab.interface.ts +0 -31
  92. package/src/lib/interfaces/tabs.interface.ts +0 -22
  93. package/src/lib/interfaces/text-field.interface.ts +0 -61
  94. package/src/lib/interfaces/tooltip.interface.ts +0 -61
  95. package/src/lib/styles/button.style.ts +0 -136
  96. package/src/lib/styles/card.style.ts +0 -29
  97. package/src/lib/styles/carousel-item.style.ts +0 -24
  98. package/src/lib/styles/carousel.style.ts +0 -22
  99. package/src/lib/styles/checkbox.style.ts +0 -64
  100. package/src/lib/styles/chip.style.ts +0 -62
  101. package/src/lib/styles/chips.style.ts +0 -20
  102. package/src/lib/styles/date-picker.style.ts +0 -43
  103. package/src/lib/styles/divider.style.ts +0 -31
  104. package/src/lib/styles/fab-menu.style.ts +0 -29
  105. package/src/lib/styles/fab.style.ts +0 -49
  106. package/src/lib/styles/icon-button.style.ts +0 -168
  107. package/src/lib/styles/index.ts +0 -25
  108. package/src/lib/styles/menu-group.style.ts +0 -34
  109. package/src/lib/styles/menu-headline.style.ts +0 -20
  110. package/src/lib/styles/menu-item.style.ts +0 -45
  111. package/src/lib/styles/menu.style.ts +0 -32
  112. package/src/lib/styles/navigation-rail-item.style.ts +0 -56
  113. package/src/lib/styles/navigation-rail.style.ts +0 -36
  114. package/src/lib/styles/progress-indicator.style.ts +0 -72
  115. package/src/lib/styles/side-sheet.style.ts +0 -45
  116. package/src/lib/styles/slider.style.ts +0 -41
  117. package/src/lib/styles/snackbar.style.ts +0 -26
  118. package/src/lib/styles/switch.style.ts +0 -67
  119. package/src/lib/styles/tab-panels.style.ts +0 -35
  120. package/src/lib/styles/tab.style.ts +0 -78
  121. package/src/lib/styles/tabs.style.ts +0 -22
  122. package/src/lib/styles/text-field.style.ts +0 -115
  123. package/src/lib/styles/tooltip.style.ts +0 -48
  124. package/src/lib/utils/component-helper.ts +0 -134
  125. package/src/lib/utils/component.ts +0 -34
  126. package/src/lib/utils/index.ts +0 -7
  127. package/src/lib/utils/string.ts +0 -9
  128. package/src/lib/utils/styles/classnames.ts +0 -49
  129. package/src/lib/utils/styles/get-classname.ts +0 -96
  130. package/src/lib/utils/styles/index.ts +0 -4
  131. package/src/lib/utils/styles/use-classnames.ts +0 -25
  132. package/src/stories/action/button.stories.tsx +0 -86
  133. package/src/stories/action/fab.stories.tsx +0 -54
  134. package/src/stories/action/icon-button.stories.tsx +0 -134
  135. package/src/stories/assets/accessibility.png +0 -0
  136. package/src/stories/assets/accessibility.svg +0 -5
  137. package/src/stories/assets/addon-library.png +0 -0
  138. package/src/stories/assets/assets.png +0 -0
  139. package/src/stories/assets/context.png +0 -0
  140. package/src/stories/assets/discord.svg +0 -15
  141. package/src/stories/assets/docs.png +0 -0
  142. package/src/stories/assets/figma-plugin.png +0 -0
  143. package/src/stories/assets/github.svg +0 -3
  144. package/src/stories/assets/share.png +0 -0
  145. package/src/stories/assets/styling.png +0 -0
  146. package/src/stories/assets/testing.png +0 -0
  147. package/src/stories/assets/theming.png +0 -0
  148. package/src/stories/assets/tutorials.svg +0 -12
  149. package/src/stories/assets/youtube.svg +0 -4
  150. package/src/stories/communication/ProgressIndicator.stories.tsx +0 -57
  151. package/src/stories/communication/SnackBar.stories.tsx +0 -32
  152. package/src/stories/communication/tool-tip.stories.tsx +0 -133
  153. package/src/stories/containment/card.stories.tsx +0 -42
  154. package/src/stories/containment/carousel.stories.tsx +0 -65
  155. package/src/stories/containment/divider.stories.tsx +0 -35
  156. package/src/stories/containment/slide-sheet.stories.tsx +0 -45
  157. package/src/stories/effect/smooth-scroll.stories.tsx +0 -54
  158. package/src/stories/navigation/navigation-rail/navigation-rail-item.stories.tsx +0 -65
  159. package/src/stories/navigation/navigation-rail/navigation-rail.stories.tsx +0 -122
  160. package/src/stories/navigation/tabs/tab.stories.tsx +0 -57
  161. package/src/stories/navigation/tabs/tabs.stories.tsx +0 -102
  162. package/src/stories/selection/slider.stories.tsx +0 -85
  163. package/src/stories/selection/switch.stories.tsx +0 -46
  164. package/src/stories/text-inputs/text-field.stories.tsx +0 -135
  165. package/src/tests/Button.spec.tsx +0 -67
  166. package/src/tests/useClassNames.spec.tsx +0 -82
  167. package/src/udixio.css +0 -120
  168. package/theme.config.ts +0 -7
  169. package/tsconfig.json +0 -16
  170. package/tsconfig.lib.json +0 -51
  171. package/tsconfig.spec.json +0 -37
  172. package/tsconfig.storybook.json +0 -38
  173. package/vite.config.ts +0 -96
@@ -1,214 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { ProgressIndicatorInterface } from '../interfaces/progress-indicator.interface';
3
-
4
- import { motion } from 'motion/react';
5
- import { useProgressIndicatorStyle } from '../styles/progress-indicator.style';
6
- import { ReactProps } from '../utils/component';
7
-
8
- /**
9
- * @status beta
10
- * @category Communication
11
- * @devx
12
- * - `value` is clamped to 0–100; indeterminate variants ignore it.
13
- * @a11y
14
- * - Missing `role="progressbar"` and aria-* attributes.
15
- * @limitations
16
- * - Visibility auto-hides at 100% (no controlled open prop).
17
- */
18
- export const ProgressIndicator = ({
19
- variant = 'linear-determinate',
20
- value = 0,
21
- transitionDuration = 1000,
22
- className,
23
- ...restProps
24
- }: ReactProps<ProgressIndicatorInterface>): any => {
25
- const [completedPercentage, setCompletedPercentage] = useState(value);
26
-
27
- const [transitionRotate] = useState(1.5);
28
-
29
- useEffect(() => {
30
- if (value > 100) {
31
- value = 100;
32
- }
33
- if (value < 0) {
34
- value = 0;
35
- }
36
- setCompletedPercentage(value);
37
- }, [value]);
38
-
39
- const [togglePercentage, setTogglePercentage] = useState(true);
40
-
41
- const getTransitionRotate = () => {
42
- return togglePercentage ? transitionRotate : transitionRotate * 0.5;
43
- };
44
-
45
- useEffect(() => {
46
- if (variant === 'circular-indeterminate' && completedPercentage !== 100) {
47
- const interval = setInterval(() => {
48
- setCompletedPercentage(togglePercentage ? 20 : 40);
49
- setTogglePercentage(!togglePercentage);
50
- }, getTransitionRotate() * 1000);
51
- return () => clearInterval(interval);
52
- }
53
- return;
54
- }, [variant, togglePercentage, completedPercentage]);
55
-
56
- const [isVisible, setIsVisible] = useState(false);
57
-
58
- useEffect(() => {
59
- if (completedPercentage >= 100) {
60
- const timeoutId = setTimeout(() => {
61
- setIsVisible(false);
62
- }, transitionDuration);
63
- return () => {
64
- clearTimeout(timeoutId);
65
- };
66
- } else {
67
- setIsVisible(true);
68
- }
69
- return;
70
- }, [completedPercentage, transitionDuration]);
71
-
72
- const styles = useProgressIndicatorStyle({
73
- className,
74
- variant,
75
- value,
76
- transitionDuration,
77
- isVisible,
78
- });
79
-
80
- return (
81
- <>
82
- {variant === 'linear-indeterminate' && (
83
- <div className={styles.progressIndicator} {...restProps}>
84
- <motion.div
85
- animate={{
86
- width: ['0%', '0%', '0%', '20%'],
87
- marginLeft: ['0px', '0px', '6px', '6px'],
88
- marginRight: ['0px', '0px', '6px', '6px'],
89
- }}
90
- transition={{
91
- duration: 1.5,
92
- repeat: Infinity,
93
- ease: 'easeInOut',
94
- times: [0, 0.499, 0.5, 1],
95
- }}
96
- style={{ flexShrink: 0 }}
97
- className={styles.activeIndicator}
98
- />
99
- <motion.div
100
- animate={{ width: ['0%', '40%', '100%'] }}
101
- transition={{ duration: 1.5, repeat: Infinity, ease: 'easeInOut' }}
102
- style={{ flexShrink: 0 }}
103
- className={styles.firstTrack}
104
- />
105
- <motion.div
106
- animate={{ width: ['20%', '60%', '20%'] }}
107
- transition={{
108
- duration: 1.5,
109
- repeat: Infinity,
110
- ease: 'easeInOut',
111
- times: [0, 0.5, 1],
112
- }}
113
- style={{ flexShrink: 0, marginLeft: '6px' }}
114
- className={styles.activeIndicator}
115
- />
116
- <div style={{ marginLeft: '6px' }} className={styles.lastTrack} />
117
- </div>
118
- )}
119
- {variant === 'linear-determinate' && (
120
- <div className={styles.progressIndicator} {...restProps}>
121
- <div
122
- style={{
123
- width: `${completedPercentage}%`,
124
- transition: `width ${transitionDuration}ms ease-in-out ${completedPercentage == 100 ? ', max-height 200ms 0.5s ease-in-out' : ''}`,
125
- }}
126
- className={styles.activeIndicator}
127
- ></div>
128
- <div
129
- style={{
130
- marginLeft: completedPercentage != 100 ? '6px' : '0px',
131
- transition: `width ${transitionDuration}ms ease-in-out ${completedPercentage == 100 ? `, max-height 200ms 0.5s ease-in-out, margin-left ${transitionDuration}ms ${transitionDuration / 1.5}ms` : ''}`,
132
- }}
133
- className={styles.lastTrack}
134
- ></div>
135
- <div
136
- style={{
137
- width: `4px`,
138
- transition: `width ${transitionDuration}ms ease-in-out, max-height 200ms 0.5s ease-in-out`,
139
- }}
140
- className={styles.stop}
141
- ></div>
142
- </div>
143
- )}
144
- {(variant === 'circular-determinate' ||
145
- variant == 'circular-indeterminate') && (
146
- <motion.svg
147
- key={
148
- variant === 'circular-indeterminate'
149
- ? togglePercentage + ''
150
- : 'static'
151
- }
152
- width="48"
153
- height="48"
154
- viewBox="0 0 48 48"
155
- initial={{ rotate: -90 }}
156
- animate={{ rotate: variant === 'circular-indeterminate' ? 270 : -90 }}
157
- transition={
158
- variant === 'circular-indeterminate'
159
- ? {
160
- repeat: Infinity,
161
- duration: getTransitionRotate(),
162
- ease: 'linear',
163
- }
164
- : { duration: transitionDuration / 1000 }
165
- }
166
- className={styles.progressIndicator}
167
- {...(restProps as any)}
168
- >
169
- <motion.circle
170
- cx="50%"
171
- cy="50%"
172
- r={isVisible ? 'calc(50% - 2px)' : '50%'}
173
- style={{
174
- strokeLinecap: 'round',
175
- }}
176
- initial={
177
- variant === 'circular-indeterminate' ? 'hidden' : 'determinate'
178
- }
179
- animate={
180
- variant === 'circular-indeterminate' ? 'visible' : 'determinate'
181
- }
182
- className={styles.activeIndicator}
183
- variants={{
184
- hidden: {
185
- pathLength: togglePercentage ? 10 / 100 : 90 / 100,
186
- },
187
- visible: {
188
- pathLength: togglePercentage ? 90 / 100 : 10 / 100,
189
- },
190
- determinate: {
191
- pathLength: completedPercentage / 100,
192
- },
193
- }}
194
- transition={{
195
- pathLength:
196
- variant === 'circular-indeterminate'
197
- ? {
198
- type: 'tween',
199
- ease: 'linear',
200
- duration: getTransitionRotate(),
201
- bounce: 0,
202
- }
203
- : {
204
- type: 'tween',
205
- ease: 'easeInOut',
206
- duration: transitionDuration / 1000,
207
- },
208
- }}
209
- />
210
- </motion.svg>
211
- )}
212
- </>
213
- );
214
- };
@@ -1,135 +0,0 @@
1
- import { MotionProps } from '../utils';
2
- import { SideSheetInterface } from '../interfaces';
3
- import { Divider } from './Divider';
4
-
5
- import { faXmark } from '@fortawesome/free-solid-svg-icons';
6
- import { IconButton } from './IconButton';
7
- import { useEffect, useState } from 'react';
8
- import { createPortal } from 'react-dom';
9
- import { AnimatePresence, motion } from 'motion/react';
10
- import { sideSheetStyle } from '../styles';
11
-
12
- /**
13
- * Side sheets show secondary content anchored to the side of the screen
14
- * @status beta
15
- * @category Layout
16
- * @devx
17
- * - Controlled via `extended`/`onExtendedChange` or internal state.
18
- * - `variant="modal"` renders into a portal on `document.body`.
19
- * @a11y
20
- * - No focus trap, Escape handling, or `aria-modal` attributes.
21
- * @limitations
22
- * - No body scroll lock when open.
23
- */
24
- export const SideSheet = ({
25
- variant = 'standard',
26
- className,
27
- children,
28
- title,
29
- position = 'right',
30
- extended,
31
- divider,
32
- onExtendedChange,
33
- closeIcon = faXmark,
34
- transition,
35
- ...rest
36
- }: MotionProps<SideSheetInterface>) => {
37
- transition = { duration: 0.3, ...transition };
38
-
39
- const [isExtended, setIsExtended] = useState(extended ?? true);
40
-
41
- const styles = sideSheetStyle({
42
- transition,
43
- title,
44
- position,
45
- closeIcon,
46
- className,
47
- children,
48
- onExtendedChange,
49
- divider,
50
- isExtended,
51
- extended: isExtended,
52
- variant,
53
- });
54
-
55
- useEffect(() => {
56
- onExtendedChange?.(isExtended ?? false);
57
- }, [isExtended]);
58
-
59
- useEffect(() => {
60
- if (extended != undefined) {
61
- setIsExtended(extended);
62
- }
63
- }, [extended]);
64
-
65
- const variants = {
66
- close: {
67
- width: 0,
68
- },
69
- open: {
70
- width: 'auto',
71
- },
72
- };
73
-
74
- const render = () => (
75
- <>
76
- <AnimatePresence>
77
- {variant == 'modal' && isExtended && (
78
- <motion.div
79
- initial={{ opacity: 0 }}
80
- animate={{ opacity: 1 }}
81
- exit={{ opacity: 0 }}
82
- transition={transition}
83
- onClick={() => setIsExtended(false)}
84
- className={styles.overlay}
85
- ></motion.div>
86
- )}
87
- </AnimatePresence>
88
- <AnimatePresence>
89
- {isExtended && (
90
- <div
91
- {...rest}
92
- className={styles.sideSheet}
93
- style={{ transition: transition.duration + 's' }}
94
- >
95
- <motion.div
96
- variants={variants}
97
- initial={extended === false ? 'open' : 'close'}
98
- animate={'open'}
99
- exit={'close'}
100
- className={styles.container}
101
- >
102
- <div className={styles.header}>
103
- {title && <p className={styles.title}>{title}</p>}
104
- <IconButton
105
- size={'small'}
106
- label={'close'}
107
- icon={closeIcon}
108
- onClick={() => setIsExtended(false)}
109
- className={styles.closeButton}
110
- ></IconButton>
111
- </div>
112
- <div
113
- className={styles.content}
114
- style={{ transition: transition.duration + 's' }}
115
- >
116
- {children}
117
- </div>
118
- </motion.div>
119
- {(divider == undefined && variant == 'standard'
120
- ? true
121
- : divider) && (
122
- <Divider className={styles.divider} orientation="vertical" />
123
- )}
124
- </div>
125
- )}
126
- </AnimatePresence>
127
- </>
128
- );
129
-
130
- if (variant == 'modal') {
131
- return createPortal(render(), document.body);
132
- }
133
-
134
- return render();
135
- };