@clicktap/ui 0.14.18 → 0.14.25

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 (198) hide show
  1. package/components/ContextMenu/ContextMenu.js +1 -1
  2. package/components/Dialog/Dialog.js +1 -1
  3. package/components/DialogTrigger/DialogTrigger.js +1 -1
  4. package/components/Drawer/Drawer.js +1 -1
  5. package/components/ModalOverlay/ModalOverlay.js +1 -1
  6. package/components/PinInput/PinInput.js +1 -1
  7. package/components/Select/Select.js +1 -1
  8. package/components/Tabs/Tabs.context.d.ts +3 -0
  9. package/package.json +1 -1
  10. package/components/Accordion/Accordion.tsx +0 -82
  11. package/components/Accordion/index.ts +0 -3
  12. package/components/Avatar/Avatar.stories.tsx +0 -99
  13. package/components/Avatar/Avatar.tsx +0 -120
  14. package/components/Avatar/Avatar.types.ts +0 -3
  15. package/components/Avatar/AvatarGroup/AvatarGroup.tsx +0 -32
  16. package/components/Avatar/AvatarGroup/AvatarGroup.types.ts +0 -8
  17. package/components/Avatar/index.ts +0 -4
  18. package/components/Badge/Badge.stories.tsx +0 -72
  19. package/components/Badge/Badge.tsx +0 -169
  20. package/components/Badge/Badge.types.ts +0 -3
  21. package/components/Badge/index.ts +0 -2
  22. package/components/Breadcrumbs/BreadcrumbEllipsis.tsx +0 -47
  23. package/components/Breadcrumbs/BreadcrumbEllipsis.types.ts +0 -5
  24. package/components/Breadcrumbs/BreadcrumbItem.tsx +0 -23
  25. package/components/Breadcrumbs/BreadcrumbItem.types.ts +0 -3
  26. package/components/Breadcrumbs/BreadcrumbLink.tsx +0 -30
  27. package/components/Breadcrumbs/BreadcrumbLink.types.ts +0 -3
  28. package/components/Breadcrumbs/BreadcrumbSeparator.tsx +0 -41
  29. package/components/Breadcrumbs/BreadcrumbSeparator.types.ts +0 -9
  30. package/components/Breadcrumbs/Breadcrumbs.tsx +0 -28
  31. package/components/Breadcrumbs/Breadcrumbs.types.ts +0 -6
  32. package/components/Breadcrumbs/index.ts +0 -10
  33. package/components/Button/Button.tsx +0 -72
  34. package/components/Button/Button.types.ts +0 -7
  35. package/components/Button/index.ts +0 -2
  36. package/components/Card/Card.tsx +0 -15
  37. package/components/Card/Card.types.ts +0 -3
  38. package/components/Card/index.ts +0 -2
  39. package/components/Checkbox/Checkbox.tsx +0 -122
  40. package/components/Checkbox/Checkbox.types.ts +0 -15
  41. package/components/Checkbox/index.ts +0 -2
  42. package/components/Collapsible/Collapsible.tsx +0 -34
  43. package/components/Collapsible/Collapsible.types.ts +0 -5
  44. package/components/Collapsible/CollapsibleTrigger.tsx +0 -57
  45. package/components/Collapsible/CollapsibleTrigger.types.ts +0 -14
  46. package/components/Collapsible/index.ts +0 -10
  47. package/components/Container/Container.tsx +0 -26
  48. package/components/Container/Container.types.ts +0 -3
  49. package/components/Container/index.ts +0 -2
  50. package/components/ContextMenu/ContextMenu.tsx +0 -74
  51. package/components/ContextMenu/ContextMenu.types.ts +0 -17
  52. package/components/ContextMenu/index.ts +0 -2
  53. package/components/CreditCardExpirationInput/CreditCardExpirationInput.tsx +0 -115
  54. package/components/CreditCardExpirationInput/CreditCardExpirationInput.types.ts +0 -10
  55. package/components/CreditCardExpirationInput/index.ts +0 -2
  56. package/components/CreditCardInput/CreditCardInput.tsx +0 -147
  57. package/components/CreditCardInput/CreditCardInput.types.ts +0 -12
  58. package/components/CreditCardInput/index.ts +0 -2
  59. package/components/DateInput/DateInput.tsx +0 -81
  60. package/components/DateInput/DateInput.types.ts +0 -15
  61. package/components/DateInput/index.ts +0 -2
  62. package/components/DateTimeFormat/DateTimeFormat.tsx +0 -16
  63. package/components/DateTimeFormat/DateTimeFormat.types.ts +0 -7
  64. package/components/DateTimeFormat/index.ts +0 -2
  65. package/components/Dialog/Dialog.tsx +0 -65
  66. package/components/Dialog/Dialog.types.ts +0 -9
  67. package/components/Dialog/index.ts +0 -2
  68. package/components/DialogTrigger/DialogTrigger.tsx +0 -45
  69. package/components/DialogTrigger/DialogTrigger.types.ts +0 -6
  70. package/components/DialogTrigger/index.ts +0 -5
  71. package/components/Divider/Divider.stories.tsx +0 -37
  72. package/components/Divider/Divider.tsx +0 -34
  73. package/components/Divider/Divider.types.ts +0 -5
  74. package/components/Divider/index.ts +0 -2
  75. package/components/DobInput/DobInput.tsx +0 -120
  76. package/components/DobInput/index.ts +0 -2
  77. package/components/Drawer/Drawer.tsx +0 -126
  78. package/components/Drawer/Drawer.types.ts +0 -11
  79. package/components/Drawer/index.ts +0 -2
  80. package/components/Icon/Account.tsx +0 -50
  81. package/components/Icon/Cart.tsx +0 -43
  82. package/components/Icon/Checkmark.tsx +0 -34
  83. package/components/Icon/Cross.tsx +0 -36
  84. package/components/Icon/DownArrow.tsx +0 -23
  85. package/components/Icon/Hamburger.tsx +0 -23
  86. package/components/Icon/Icon.types.ts +0 -8
  87. package/components/Icon/LinkArrow.tsx +0 -32
  88. package/components/Icon/Minus.tsx +0 -20
  89. package/components/Icon/Plus.tsx +0 -20
  90. package/components/Icon/Search.tsx +0 -36
  91. package/components/Icon/Trash.tsx +0 -27
  92. package/components/Icon/Verified.tsx +0 -20
  93. package/components/Icon/index.ts +0 -14
  94. package/components/Image/Image.tsx +0 -32
  95. package/components/Image/index.ts +0 -2
  96. package/components/Input/Input.tsx +0 -109
  97. package/components/Input/Input.types.ts +0 -17
  98. package/components/Input/index.ts +0 -2
  99. package/components/Link/Link.stories.tsx +0 -96
  100. package/components/Link/Link.tsx +0 -39
  101. package/components/Link/Link.types.ts +0 -3
  102. package/components/Link/index.ts +0 -2
  103. package/components/Loader/CircularEasing.tsx +0 -66
  104. package/components/Loader/CircularEasing.types.ts +0 -8
  105. package/components/Loader/Pulse.tsx +0 -45
  106. package/components/Loader/Pulse.types.ts +0 -5
  107. package/components/Loader/index.ts +0 -4
  108. package/components/Menu/ContextMenu.tsx +0 -83
  109. package/components/Menu/Menu.tsx +0 -143
  110. package/components/Menu/Menu.types.ts +0 -44
  111. package/components/Menu/index.ts +0 -4
  112. package/components/Meter/Meter.stories.tsx +0 -111
  113. package/components/Meter/Meter.tsx +0 -68
  114. package/components/Meter/Meter.types.ts +0 -10
  115. package/components/Meter/index.ts +0 -2
  116. package/components/Modal/Modal.tsx +0 -16
  117. package/components/Modal/Modal.types.ts +0 -6
  118. package/components/Modal/index.ts +0 -2
  119. package/components/ModalOverlay/ModalOverlay.tsx +0 -121
  120. package/components/ModalOverlay/ModalOverlay.types.ts +0 -18
  121. package/components/ModalOverlay/index.ts +0 -2
  122. package/components/NumberFormat/NumberFormat.tsx +0 -19
  123. package/components/NumberFormat/NumberFormat.types.ts +0 -8
  124. package/components/NumberFormat/index.ts +0 -2
  125. package/components/NumberInput/NumberInput.tsx +0 -164
  126. package/components/NumberInput/NumberInput.types.ts +0 -22
  127. package/components/NumberInput/index.ts +0 -2
  128. package/components/NumberTicker/DigitResolver.tsx +0 -119
  129. package/components/NumberTicker/DigitResolver.types.ts +0 -18
  130. package/components/NumberTicker/NumberTicker.tsx +0 -56
  131. package/components/NumberTicker/NumberTicker.types.ts +0 -96
  132. package/components/NumberTicker/hooks/useColumnTransition.ts +0 -36
  133. package/components/NumberTicker/hooks/useNumberDelta.ts +0 -19
  134. package/components/NumberTicker/hooks/useNumberTicker.ts +0 -36
  135. package/components/NumberTicker/index.ts +0 -10
  136. package/components/Pagination/Pagination.tsx +0 -44
  137. package/components/Pagination/index.ts +0 -2
  138. package/components/PasswordCheck/PasswordCheck.tsx +0 -59
  139. package/components/PasswordCheck/PasswordCheck.types.ts +0 -4
  140. package/components/PasswordCheck/PasswordCheck.utils.ts +0 -47
  141. package/components/PasswordCheck/index.ts +0 -2
  142. package/components/PhoneInput/PhoneInput.tsx +0 -191
  143. package/components/PhoneInput/index.ts +0 -2
  144. package/components/PinInput/PinInput.tsx +0 -314
  145. package/components/PinInput/PinInput.types.ts +0 -21
  146. package/components/PinInput/index.ts +0 -2
  147. package/components/Progressbar/CircularProgressbar.tsx +0 -71
  148. package/components/Progressbar/CircularProgressbar.types.ts +0 -10
  149. package/components/Progressbar/LinearProgressbar.tsx +0 -75
  150. package/components/Progressbar/LinearProgressbar.types.ts +0 -11
  151. package/components/Progressbar/index.ts +0 -4
  152. package/components/Radio/Radio.tsx +0 -88
  153. package/components/Radio/Radio.types.ts +0 -16
  154. package/components/Radio/index.ts +0 -2
  155. package/components/RadioGroup/RadioGroup.tsx +0 -49
  156. package/components/RadioGroup/RadioGroup.types.ts +0 -7
  157. package/components/RadioGroup/index.ts +0 -2
  158. package/components/Select/Option.tsx +0 -32
  159. package/components/Select/Option.types.ts +0 -3
  160. package/components/Select/Select.tsx +0 -272
  161. package/components/Select/Select.types.ts +0 -48
  162. package/components/Select/index.ts +0 -8
  163. package/components/Skeleton/Skeleton.tsx +0 -15
  164. package/components/Skeleton/Skeleton.types.ts +0 -3
  165. package/components/Skeleton/index.ts +0 -2
  166. package/components/Slider/Slider.tsx +0 -110
  167. package/components/Slider/Slider.types.ts +0 -11
  168. package/components/Slider/index.ts +0 -2
  169. package/components/Switch/Switch.tsx +0 -63
  170. package/components/Switch/Switch.types.ts +0 -8
  171. package/components/Switch/index.ts +0 -2
  172. package/components/Table/Table.tsx +0 -52
  173. package/components/Table/Table.types.ts +0 -22
  174. package/components/Table/index.ts +0 -2
  175. package/components/Tabs/Tab.tsx +0 -118
  176. package/components/Tabs/Tab.types.ts +0 -10
  177. package/components/Tabs/TabList.tsx +0 -51
  178. package/components/Tabs/TabList.types.ts +0 -12
  179. package/components/Tabs/TabPanel.tsx +0 -19
  180. package/components/Tabs/TabPanel.types.ts +0 -3
  181. package/components/Tabs/Tabs.context.tsx +0 -9
  182. package/components/Tabs/Tabs.tsx +0 -39
  183. package/components/Tabs/Tabs.types.ts +0 -3
  184. package/components/Tabs/index.ts +0 -9
  185. package/components/TimeInput/TimeInput.stories.tsx +0 -125
  186. package/components/TimeInput/TimeInput.tsx +0 -81
  187. package/components/TimeInput/TimeInput.types.ts +0 -15
  188. package/components/TimeInput/index.ts +0 -2
  189. package/components/ToggleButton/ToggleButton.stories.tsx +0 -89
  190. package/components/ToggleButton/ToggleButton.tsx +0 -69
  191. package/components/ToggleButton/ToggleButton.types.ts +0 -6
  192. package/components/ToggleButton/index.ts +0 -2
  193. package/components/Tooltip/Tooltip.tsx +0 -59
  194. package/components/Tooltip/Tooltip.types.ts +0 -3
  195. package/components/Tooltip/index.ts +0 -2
  196. package/components/UploadImage/UploadImage.tsx +0 -206
  197. package/components/UploadImage/UploadImage.types.ts +0 -15
  198. package/components/UploadImage/index.ts +0 -2
@@ -1,23 +0,0 @@
1
- 'use client';
2
-
3
- import { cn } from '../../utils/cn';
4
- import type { IconProps } from './Icon.types';
5
-
6
- export function Hamburger({ className, ...rest }: IconProps) {
7
- return (
8
- <svg
9
- xmlns="http://www.w3.org/2000/svg"
10
- viewBox="0 0 21 14"
11
- width="20"
12
- height="20"
13
- fill="#20293A"
14
- className={cn(className)}
15
- // eslint-disable-next-line react/jsx-props-no-spreading
16
- {...rest}
17
- >
18
- <path d="M0.583333 14H20.4167C20.7433 14 21 13.7433 21 13.4167V12.25C21 11.9233 20.7433 11.6667 20.4167 11.6667H0.583333C0.256667 11.6667 0 11.9233 0 12.25V13.4167C0 13.7433 0.256667 14 0.583333 14ZM0.583333 8.16667H20.4167C20.7433 8.16667 21 7.91 21 7.58333V6.41667C21 6.09 20.7433 5.83333 20.4167 5.83333H0.583333C0.256667 5.83333 0 6.09 0 6.41667V7.58333C0 7.91 0.256667 8.16667 0.583333 8.16667ZM0 0.583333V1.75C0 2.07667 0.256667 2.33333 0.583333 2.33333H20.4167C20.7433 2.33333 21 2.07667 21 1.75V0.583333C21 0.256667 20.7433 0 20.4167 0H0.583333C0.256667 0 0 0.256667 0 0.583333Z" />
19
- </svg>
20
- );
21
- }
22
-
23
- export default Hamburger;
@@ -1,8 +0,0 @@
1
- import type { CSSProperties } from 'react';
2
-
3
- export type IconProps = {
4
- // eslint-disable-next-line react/require-default-props
5
- className?: string;
6
- // eslint-disable-next-line react/require-default-props
7
- style?: CSSProperties;
8
- };
@@ -1,32 +0,0 @@
1
- 'use client';
2
-
3
- import { cn } from '../../utils/cn';
4
- import type { IconProps } from './Icon.types';
5
-
6
- export function LinkArrow({ className, ...rest }: IconProps) {
7
- return (
8
- <svg
9
- width="20"
10
- height="20"
11
- viewBox="0 0 20 20"
12
- fill="none"
13
- xmlns="http://www.w3.org/2000/svg"
14
- className={cn(
15
- 'text-inherit transition duration-100 ease-linear',
16
- className
17
- )}
18
- // eslint-disable-next-line react/jsx-props-no-spreading
19
- {...rest}
20
- >
21
- <path
22
- d="M7.5 15L12.5 10L7.5 5"
23
- stroke="#20293A"
24
- strokeWidth="1.5"
25
- strokeLinecap="round"
26
- strokeLinejoin="round"
27
- />
28
- </svg>
29
- );
30
- }
31
-
32
- export default LinkArrow;
@@ -1,20 +0,0 @@
1
- 'use client';
2
-
3
- export function Minus() {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- width="7"
8
- height="3"
9
- viewBox="0 0 7 3"
10
- fill="none"
11
- >
12
- <path
13
- d="M6.36603 0.684659V2.09091H0.638761V0.684659H6.36603Z"
14
- fill="#D5D5D5"
15
- />
16
- </svg>
17
- );
18
- }
19
-
20
- export default Minus;
@@ -1,20 +0,0 @@
1
- 'use client';
2
-
3
- export function Plus() {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- width="9"
8
- height="10"
9
- viewBox="0 0 9 10"
10
- fill="none"
11
- >
12
- <path
13
- d="M3.78329 9.10511V0.667613H5.21511V9.10511H3.78329ZM0.280451 5.60227V4.17045H8.71795V5.60227H0.280451Z"
14
- fill="#D5D5D5"
15
- />
16
- </svg>
17
- );
18
- }
19
-
20
- export default Plus;
@@ -1,36 +0,0 @@
1
- 'use client';
2
-
3
- import { cn } from '../../utils/cn';
4
- import type { IconProps } from './Icon.types';
5
-
6
- export function Search({ className, ...rest }: IconProps) {
7
- return (
8
- <svg
9
- xmlns="http://www.w3.org/2000/svg"
10
- width="20"
11
- height="20"
12
- viewBox="0 0 20 20"
13
- fill="none"
14
- className={cn('', className)}
15
- // eslint-disable-next-line react/jsx-props-no-spreading
16
- {...rest}
17
- >
18
- <path
19
- d="M9.16667 15.8333C12.8486 15.8333 15.8333 12.8486 15.8333 9.16667C15.8333 5.48477 12.8486 2.5 9.16667 2.5C5.48477 2.5 2.5 5.48477 2.5 9.16667C2.5 12.8486 5.48477 15.8333 9.16667 15.8333Z"
20
- stroke="#20293A"
21
- strokeWidth="1.5"
22
- strokeLinecap="round"
23
- strokeLinejoin="round"
24
- />
25
- <path
26
- d="M17.5001 17.5013L13.9167 13.918"
27
- stroke="#20293A"
28
- strokeWidth="1.5"
29
- strokeLinecap="round"
30
- strokeLinejoin="round"
31
- />
32
- </svg>
33
- );
34
- }
35
-
36
- export default Search;
@@ -1,27 +0,0 @@
1
- 'use client';
2
-
3
- export function Trash() {
4
- return (
5
- <svg
6
- width="14"
7
- height="18"
8
- viewBox="0 0 14 18"
9
- fill="none"
10
- xmlns="http://www.w3.org/2000/svg"
11
- >
12
- <g clipPath="url(#clip0_1432_3747)">
13
- <path
14
- d="M1 16C1 17.1 1.9 18 3 18H11C12.1 18 13 17.1 13 16V4H1V16ZM3 6H11V16H3V6ZM10.5 1L9.5 0H4.5L3.5 1H0V3H14V1H10.5Z"
15
- fill="white"
16
- />
17
- </g>
18
- <defs>
19
- <clipPath id="clip0_1432_3747">
20
- <rect width="14" height="18" fill="white" />
21
- </clipPath>
22
- </defs>
23
- </svg>
24
- );
25
- }
26
-
27
- export default Trash;
@@ -1,20 +0,0 @@
1
- 'use client';
2
-
3
- export function Verified() {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- width="21"
8
- height="21"
9
- fill="none"
10
- viewBox="0 0 21 21"
11
- >
12
- <path
13
- fill="currentColor"
14
- d="M10.5 0a10.5 10.5 0 1 0 0 21 10.5 10.5 0 0 0 0-21ZM8.4 15.8l-5.3-5.3L4.7 9l3.8 3.8 8-8 1.5 1.5-9.5 9.4Z"
15
- />
16
- </svg>
17
- );
18
- }
19
-
20
- export default Verified;
@@ -1,14 +0,0 @@
1
- export { Account } from './Account';
2
- export { Cart } from './Cart';
3
- export { Checkmark } from './Checkmark';
4
- export { Cross } from './Cross';
5
- export { DownArrow } from './DownArrow';
6
- export { Hamburger } from './Hamburger';
7
- export { LinkArrow } from './LinkArrow';
8
- export { Minus } from './Minus';
9
- export { Plus } from './Plus';
10
- export { Search } from './Search';
11
- export { Trash } from './Trash';
12
- export { Verified } from './Verified';
13
-
14
- export type { IconProps } from './Icon.types';
@@ -1,32 +0,0 @@
1
- 'use client';
2
-
3
- import type { ImageProps } from 'next/image';
4
- import { useState, useEffect } from 'react';
5
- import NextImage from 'next/image';
6
- import { cn } from '../../utils/cn';
7
-
8
- export function Image({ src, className, ...rest }: ImageProps) {
9
- const [loadingImg, setLoadingImg] = useState(true);
10
- const [image, setImage] = useState(src);
11
- const [isClient, setIsClient] = useState(false);
12
-
13
- useEffect(() => setImage(src), [src]);
14
- useEffect(() => setIsClient(true), []);
15
-
16
- return (
17
- <NextImage
18
- src={image}
19
- className={cn(
20
- 'transition-[filter] ease-linear duration-200',
21
- isClient && loadingImg && 'blur-md',
22
- className
23
- )}
24
- onError={() => setImage('/images/placeholder.jpg')}
25
- onLoad={() => setLoadingImg(false)}
26
- // eslint-disable-next-line react/jsx-props-no-spreading
27
- {...rest}
28
- />
29
- );
30
- }
31
-
32
- export default Image;
@@ -1,2 +0,0 @@
1
- // eslint-disable-next-line import/prefer-default-export
2
- export { Image } from './Image';
@@ -1,109 +0,0 @@
1
- 'use client';
2
-
3
- import {
4
- FieldError,
5
- Input as AriaInput,
6
- Label,
7
- Text,
8
- TextField,
9
- } from 'react-aria-components';
10
- import { forwardRef } from 'react';
11
- import { cn } from '../../utils/cn';
12
- import type { InputProps } from './Input.types';
13
- import { Skeleton } from '../Skeleton/Skeleton';
14
- import { useIsClient } from '../../hooks/useIsClient';
15
-
16
- function InputSkeleton({
17
- className,
18
- }: {
19
- className: NonNullable<InputProps['classNames']>['skeleton'];
20
- }) {
21
- return (
22
- <Skeleton
23
- className={cn('w-full h-10 rounded-md z-20 relative', className)}
24
- />
25
- );
26
- }
27
-
28
- export const Input = forwardRef<HTMLInputElement, InputProps>(
29
- (
30
- {
31
- inputProps,
32
- label,
33
- description,
34
- errorMessage,
35
- placeholder,
36
- className,
37
- classNames,
38
- ...props
39
- },
40
- ref
41
- ) => {
42
- const isClient = useIsClient();
43
-
44
- if (!isClient) {
45
- return (
46
- <div className={cn('flex flex-col w-full text-slate-900', className)}>
47
- {label ? (
48
- <Label
49
- className={cn('flex text-slate-500 text-xs', classNames?.label)}
50
- >
51
- {label}
52
- </Label>
53
- ) : null}
54
- <InputSkeleton className={classNames?.skeleton} />
55
- </div>
56
- );
57
- }
58
-
59
- return (
60
- <TextField
61
- className={cn('flex flex-col w-full text-slate-900', className)}
62
- // eslint-disable-next-line react/jsx-props-no-spreading
63
- {...props}
64
- >
65
- <Label className={cn('flex text-slate-500 text-xs', classNames?.label)}>
66
- {label}
67
- </Label>
68
- <AriaInput
69
- ref={ref}
70
- placeholder={placeholder}
71
- className={cn(
72
- 'border-solid border border-slate-300 rounded-md',
73
- 'text-sm text-slate-900 placeholder-slate-400',
74
- 'h-10 px-2 py-0 m-0 w-full',
75
- 'bg-white',
76
- 'transition-all duration-200 ease-in-out',
77
- 'hover:border-slate-400',
78
- 'focus:outline-2 focus:outline focus:outline-slate-200 focus:border-slate-400',
79
- 'disabled:border-slate-200 disabled:bg-slate-100',
80
- 'invalid:border-red-500 invalid:bg-red-100 invalid:text-red-600',
81
- 'invalid:hover:border-red-600 invalid:focus:border-red-600 invalid:focus:outline-red-200',
82
- classNames?.input
83
- )}
84
- // eslint-disable-next-line react/jsx-props-no-spreading
85
- {...inputProps}
86
- />
87
-
88
- {description && (
89
- <Text
90
- className={cn(
91
- 'flex text-slate-500 text-sm',
92
- classNames?.description
93
- )}
94
- slot="description"
95
- >
96
- {description}
97
- </Text>
98
- )}
99
- <FieldError
100
- className={cn('flex text-red-500 text-sm', classNames?.error)}
101
- >
102
- {errorMessage}
103
- </FieldError>
104
- </TextField>
105
- );
106
- }
107
- );
108
-
109
- export default Input;
@@ -1,17 +0,0 @@
1
- import type {
2
- InputProps as AriaInputProps,
3
- TextFieldProps,
4
- ValidationResult,
5
- } from 'react-aria-components';
6
- import type { SlotsToClasses } from '../../types/SlotsToClasses';
7
-
8
- export interface InputProps extends TextFieldProps {
9
- label?: string;
10
- description?: string;
11
- errorMessage?: string | ((validation: ValidationResult) => string);
12
- placeholder?: string;
13
- classNames?: SlotsToClasses<
14
- 'label' | 'input' | 'description' | 'error' | 'skeleton'
15
- >;
16
- inputProps?: AriaInputProps;
17
- }
@@ -1,2 +0,0 @@
1
- export { Input } from './Input';
2
- export type { InputProps } from './Input.types';
@@ -1,96 +0,0 @@
1
- import { LinkProps } from 'react-aria-components';
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import { action } from '@storybook/addon-actions';
4
- import { Link } from './Link';
5
-
6
- type Story = StoryObj<typeof Link>;
7
-
8
- function Component({ children, ...props }: LinkProps) {
9
- return <Link {...props}>{children}</Link>;
10
- }
11
-
12
- const meta: Meta<typeof Link> = {
13
- component: Component,
14
- };
15
-
16
- export default meta;
17
-
18
- export const Example: Story = {
19
- argTypes: {
20
- href: {
21
- control: 'text',
22
- },
23
- target: {
24
- options: ['_blank', '_self', '_parent', '_top'],
25
- control: 'select',
26
- },
27
- isDisabled: {
28
- control: 'boolean',
29
- },
30
- autoFocus: {
31
- control: 'boolean',
32
- },
33
- rel: {
34
- control: 'text',
35
- },
36
- download: {
37
- control: 'object',
38
- },
39
- ping: {
40
- control: 'text',
41
- },
42
- referrerPolicy: {
43
- options: [
44
- 'no-referrer',
45
- 'origin-when-cross-origin',
46
- 'same-origin',
47
- 'strict-origin',
48
- 'strict-origin-when-cross-origin',
49
- 'unsafe-url',
50
- ],
51
- control: 'select',
52
- },
53
- children: {
54
- control: 'text',
55
- },
56
- className: {
57
- control: 'object',
58
- },
59
- style: {
60
- control: 'object',
61
- },
62
- onPress: {},
63
- onBlur: {},
64
- onFocus: {},
65
- onFocusChange: {},
66
- onHoverChange: {},
67
- onHoverEnd: {},
68
- onHoverStart: {},
69
- onKeyDown: {},
70
- onKeyUp: {},
71
- onPressChange: {},
72
- onPressEnd: {},
73
- onPressStart: {},
74
- onPressUp: {},
75
- },
76
- args: {
77
- href: '/',
78
- target: '_blank',
79
- isDisabled: false,
80
- autoFocus: false,
81
- children: 'Press me',
82
- onPress: action('onPress'),
83
- onBlur: action('onBlur'),
84
- onFocus: action('onFocus'),
85
- onFocusChange: action('onFocusChange'),
86
- onHoverChange: action('onHoverChange'),
87
- onHoverEnd: action('onHoverEnd'),
88
- onHoverStart: action('onHoverStart'),
89
- onKeyDown: action('onKeyDown'),
90
- onKeyUp: action('onKeyUp'),
91
- onPressChange: action('onPressChange'),
92
- onPressEnd: action('onPressEnd'),
93
- onPressStart: action('onPressStart'),
94
- onPressUp: action('onPressUp'),
95
- },
96
- };
@@ -1,39 +0,0 @@
1
- 'use client';
2
-
3
- import { forwardRef } from 'react';
4
- import { Link as UiLink } from 'react-aria-components';
5
- import { cn } from '../../utils/cn';
6
- import type { LinkProps } from './Link.types';
7
-
8
- export const Link = forwardRef<HTMLAnchorElement, LinkProps>(
9
- ({ children, isDisabled, className, ...props }, ref) => (
10
- <UiLink
11
- // eslint-disable-next-line react/jsx-props-no-spreading
12
- {...props}
13
- isDisabled={isDisabled}
14
- className={(renderProps) => {
15
- const userClasses =
16
- typeof className === 'function' ? className(renderProps) : className;
17
-
18
- return cn(
19
- 'flex items-center cursor-pointer',
20
- 'text-slate-500',
21
- 'no-underline',
22
- 'transition-colors duration-300',
23
- 'hover:text-slate-800',
24
- [
25
- 'data-[disabled="true"]:cursor-default',
26
- 'data-[disabled="true"]:text-slate-300',
27
- 'data-[disabled="true"]:hover:text-slate-300',
28
- ],
29
- userClasses
30
- );
31
- }}
32
- ref={ref}
33
- >
34
- {children}
35
- </UiLink>
36
- )
37
- );
38
-
39
- export default Link;
@@ -1,3 +0,0 @@
1
- import type { LinkProps as UILinkProps } from 'react-aria-components';
2
-
3
- export type LinkProps = UILinkProps;
@@ -1,2 +0,0 @@
1
- export { Link } from './Link';
2
- export type { LinkProps } from './Link.types';
@@ -1,66 +0,0 @@
1
- 'use client';
2
-
3
- import { motion } from 'framer-motion';
4
- import type { CSSProperties } from 'react';
5
- import { cn } from '../../utils/cn';
6
- import type { CircularEasingProps } from './CircularEasing.types';
7
-
8
- export function CircularEasing({
9
- width,
10
- stroke,
11
- strokeLinecap = 'round',
12
- strokeWidth = 5,
13
- className,
14
- style,
15
- ...props
16
- }: CircularEasingProps) {
17
- return (
18
- <div
19
- style={{ '--circularWidth': `${width}px`, ...style } as CSSProperties}
20
- // eslint-disable-next-line react/jsx-props-no-spreading
21
- {...props}
22
- className={cn(
23
- 'relative',
24
- 'm-0',
25
- 'w-[--circularWidth]',
26
- 'aspect-square',
27
- className
28
- )}
29
- >
30
- <motion.svg
31
- animate={{
32
- transform: 'rotate(360deg)',
33
- transition: { repeat: Infinity, duration: 2, ease: 'linear' },
34
- }}
35
- viewBox="25 25 50 50"
36
- className={cn(
37
- 'w-full h-full',
38
- 'absolute inset-x-0 inset-y-0',
39
- 'origin-center',
40
- 'm-auto'
41
- )}
42
- >
43
- <motion.circle
44
- animate={{
45
- strokeDasharray: ['1, 200', '89, 200', '89, 200'],
46
- strokeDashoffset: [0, -35, -124],
47
- transition: { repeat: Infinity, duration: 1.5, ease: 'easeInOut' },
48
- }}
49
- className="path"
50
- cx="50"
51
- cy="50"
52
- fill="none"
53
- r="20"
54
- strokeDasharray="1, 200"
55
- strokeDashoffset="0"
56
- stroke={stroke}
57
- strokeLinecap={strokeLinecap}
58
- strokeMiterlimit="10"
59
- strokeWidth={strokeWidth}
60
- />
61
- </motion.svg>
62
- </div>
63
- );
64
- }
65
-
66
- export default CircularEasing;
@@ -1,8 +0,0 @@
1
- import type { HTMLAttributes } from 'react';
2
-
3
- export type CircularEasingProps = HTMLAttributes<HTMLDivElement> & {
4
- stroke: string;
5
- strokeLinecap?: 'butt' | 'round' | 'square';
6
- strokeWidth?: number;
7
- width: number;
8
- };
@@ -1,45 +0,0 @@
1
- 'use client';
2
-
3
- import { motion } from 'framer-motion';
4
- import { cn } from '../../utils/cn';
5
- import type { PulseProps } from './Pulse.types';
6
-
7
- export function Pulse({ classNames }: PulseProps) {
8
- return (
9
- <span className={cn(classNames?.base)}>
10
- {Array.from(new Array(3)).map((_, i) => (
11
- <motion.div
12
- // eslint-disable-next-line react/no-array-index-key
13
- key={i}
14
- animate={{
15
- opacity: [1, 1, 0.7, 1, 1],
16
- transform: [
17
- 'scale(1)',
18
- 'scale(1)',
19
- 'scale(0.1)',
20
- 'scale(1)',
21
- 'scale(1)',
22
- ],
23
- transition: {
24
- repeat: Infinity,
25
- duration: 0.75,
26
- delay: i * 0.1,
27
- // ease: [0.2, 0.68, 0.18, 1.08],
28
- },
29
- }}
30
- className={cn(
31
- 'bg-slate-300',
32
- 'inline-block',
33
- 'w-2',
34
- 'h-2',
35
- 'm-0.5',
36
- 'rounded-lg',
37
- classNames?.dot
38
- )}
39
- />
40
- ))}
41
- </span>
42
- );
43
- }
44
-
45
- export default Pulse;
@@ -1,5 +0,0 @@
1
- import type { SlotsToClasses } from '../../types/SlotsToClasses';
2
-
3
- export interface PulseProps {
4
- classNames?: SlotsToClasses<'base' | 'dot'>;
5
- }
@@ -1,4 +0,0 @@
1
- export { CircularEasing } from './CircularEasing';
2
- export { Pulse } from './Pulse';
3
- export type { CircularEasingProps } from './CircularEasing.types';
4
- export type { PulseProps } from './Pulse.types';