@shipfox/react-ui 0.7.0 → 0.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.
- package/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-check.log +2 -2
- package/.turbo/turbo-type.log +1 -1
- package/CHANGELOG.md +7 -0
- package/dist/components/button/button.d.ts +2 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +17 -2
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button/button.stories.js +25 -0
- package/dist/components/button/button.stories.js.map +1 -1
- package/dist/components/button/icon-button.d.ts +2 -1
- package/dist/components/button/icon-button.d.ts.map +1 -1
- package/dist/components/button/icon-button.js +17 -2
- package/dist/components/button/icon-button.js.map +1 -1
- package/dist/components/button/icon-button.stories.js +90 -0
- package/dist/components/button/icon-button.stories.js.map +1 -1
- package/dist/components/form/form.d.ts +11 -0
- package/dist/components/form/form.d.ts.map +1 -0
- package/dist/components/form/form.js +106 -0
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/form/form.stories.js +582 -0
- package/dist/components/form/form.stories.js.map +1 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +3 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/icon/custom/spinner.d.ts +1 -1
- package/dist/components/icon/custom/spinner.d.ts.map +1 -1
- package/dist/components/icon/custom/spinner.js +84 -30
- package/dist/components/icon/custom/spinner.js.map +1 -1
- package/dist/components/icon/icon.d.ts +19 -18
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +17 -17
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -1
- package/src/components/button/button.stories.tsx +18 -0
- package/src/components/button/button.tsx +27 -2
- package/src/components/button/icon-button.stories.tsx +46 -0
- package/src/components/button/icon-button.tsx +26 -1
- package/src/components/form/form.stories.tsx +500 -0
- package/src/components/form/form.tsx +154 -0
- package/src/components/form/index.ts +1 -0
- package/src/components/icon/custom/spinner.tsx +64 -18
- package/src/components/icon/icon.tsx +18 -18
- package/src/components/index.ts +1 -0
|
@@ -1,12 +1,56 @@
|
|
|
1
1
|
import type {RemixiconComponentType} from '@remixicon/react';
|
|
2
|
+
import {motion, type SVGMotionProps, type Variants} from 'framer-motion';
|
|
2
3
|
import type {ComponentProps} from 'react';
|
|
4
|
+
import {cn} from 'utils/cn';
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
const SEGMENT_COUNT = 8;
|
|
7
|
+
const DURATION = 1.2;
|
|
8
|
+
const BASE_OPACITY = 0;
|
|
9
|
+
|
|
10
|
+
const CLOCKWISE_ORDER = [1, 8, 4, 6, 2, 7, 3, 5];
|
|
11
|
+
|
|
12
|
+
const segmentVariants: Record<string, Variants> = {};
|
|
13
|
+
|
|
14
|
+
for (let i = 0; i < SEGMENT_COUNT; i++) {
|
|
15
|
+
const segmentIndex = CLOCKWISE_ORDER[i];
|
|
16
|
+
const delay = (i * DURATION) / SEGMENT_COUNT;
|
|
17
|
+
|
|
18
|
+
segmentVariants[`segment${segmentIndex}`] = {
|
|
19
|
+
initial: {opacity: BASE_OPACITY},
|
|
20
|
+
animate: {
|
|
21
|
+
opacity: [BASE_OPACITY, 1, BASE_OPACITY],
|
|
22
|
+
transition: {
|
|
23
|
+
duration: DURATION,
|
|
24
|
+
ease: 'easeInOut',
|
|
25
|
+
repeat: Infinity,
|
|
26
|
+
repeatType: 'loop',
|
|
27
|
+
delay,
|
|
28
|
+
times: [0, 0.5, 1],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function SpinnerIcon(props: ComponentProps<RemixiconComponentType>) {
|
|
35
|
+
const {className, size, ...restProps} = props;
|
|
36
|
+
|
|
37
|
+
const iconSize = size ?? 24;
|
|
38
|
+
|
|
39
|
+
const svgProps: SVGMotionProps<SVGSVGElement> = {
|
|
40
|
+
width: typeof iconSize === 'number' ? String(iconSize) : iconSize,
|
|
41
|
+
height: typeof iconSize === 'number' ? String(iconSize) : iconSize,
|
|
42
|
+
viewBox: '0 0 24 24',
|
|
43
|
+
fill: 'none',
|
|
44
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
45
|
+
className: cn(className),
|
|
46
|
+
initial: 'initial',
|
|
47
|
+
animate: 'animate',
|
|
48
|
+
...(restProps as SVGMotionProps<SVGSVGElement>),
|
|
49
|
+
};
|
|
5
50
|
return (
|
|
6
|
-
<svg
|
|
51
|
+
<motion.svg {...svgProps}>
|
|
7
52
|
<title>Spinner</title>
|
|
8
|
-
<path
|
|
9
|
-
opacity="0.55"
|
|
53
|
+
<motion.path
|
|
10
54
|
d="M10.583 1.91667C10.583 1.41041 10.9934 1 11.4997 1C12.0059 1 12.4163 1.41041 12.4163 1.91667V5.58333C12.4163 6.08959 12.0059 6.5 11.4997 6.5C10.9934 6.5 10.583 6.08959 10.583 5.58333V1.91667Z"
|
|
11
55
|
fill="currentColor"
|
|
12
56
|
stroke="currentColor"
|
|
@@ -14,8 +58,9 @@ export function SpinnerIcon(_props: ComponentProps<RemixiconComponentType>) {
|
|
|
14
58
|
strokeWidth="0.916667"
|
|
15
59
|
strokeLinecap="round"
|
|
16
60
|
strokeLinejoin="round"
|
|
61
|
+
variants={segmentVariants.segment1}
|
|
17
62
|
/>
|
|
18
|
-
<rect
|
|
63
|
+
<motion.rect
|
|
19
64
|
x="10.583"
|
|
20
65
|
y="17.5"
|
|
21
66
|
width="1.83333"
|
|
@@ -27,9 +72,9 @@ export function SpinnerIcon(_props: ComponentProps<RemixiconComponentType>) {
|
|
|
27
72
|
strokeWidth="0.916667"
|
|
28
73
|
strokeLinecap="round"
|
|
29
74
|
strokeLinejoin="round"
|
|
75
|
+
variants={segmentVariants.segment2}
|
|
30
76
|
/>
|
|
31
|
-
<path
|
|
32
|
-
opacity="0.25"
|
|
77
|
+
<motion.path
|
|
33
78
|
d="M1.41667 12.918C0.910406 12.918 0.5 12.5076 0.5 12.0013C0.5 11.495 0.910405 11.0846 1.41667 11.0846L5.08333 11.0846C5.58959 11.0846 6 11.495 6 12.0013C6 12.5076 5.58959 12.918 5.08333 12.918L1.41667 12.918Z"
|
|
34
79
|
fill="currentColor"
|
|
35
80
|
stroke="currentColor"
|
|
@@ -37,9 +82,9 @@ export function SpinnerIcon(_props: ComponentProps<RemixiconComponentType>) {
|
|
|
37
82
|
strokeWidth="0.916667"
|
|
38
83
|
strokeLinecap="round"
|
|
39
84
|
strokeLinejoin="round"
|
|
85
|
+
variants={segmentVariants.segment3}
|
|
40
86
|
/>
|
|
41
|
-
<path
|
|
42
|
-
opacity="0.75"
|
|
87
|
+
<motion.path
|
|
43
88
|
d="M17.9167 12.918C17.4104 12.918 17 12.5076 17 12.0013C17 11.495 17.4104 11.0846 17.9167 11.0846L21.5833 11.0846C22.0896 11.0846 22.5 11.495 22.5 12.0013C22.5 12.5076 22.0896 12.918 21.5833 12.918L17.9167 12.918Z"
|
|
44
89
|
fill="currentColor"
|
|
45
90
|
stroke="currentColor"
|
|
@@ -47,9 +92,9 @@ export function SpinnerIcon(_props: ComponentProps<RemixiconComponentType>) {
|
|
|
47
92
|
strokeWidth="0.916667"
|
|
48
93
|
strokeLinecap="round"
|
|
49
94
|
strokeLinejoin="round"
|
|
95
|
+
variants={segmentVariants.segment4}
|
|
50
96
|
/>
|
|
51
|
-
<path
|
|
52
|
-
opacity="0.38"
|
|
97
|
+
<motion.path
|
|
53
98
|
d="M3.7224 5.52123C3.36442 5.16325 3.36442 4.58285 3.7224 4.22487C4.08038 3.86689 4.66078 3.86688 5.01876 4.22487L7.61149 6.81759C7.96947 7.17557 7.96947 7.75597 7.61149 8.11395C7.25351 8.47193 6.67311 8.47193 6.31512 8.11395L3.7224 5.52123Z"
|
|
54
99
|
fill="currentColor"
|
|
55
100
|
stroke="currentColor"
|
|
@@ -57,9 +102,9 @@ export function SpinnerIcon(_props: ComponentProps<RemixiconComponentType>) {
|
|
|
57
102
|
strokeWidth="0.916667"
|
|
58
103
|
strokeLinecap="round"
|
|
59
104
|
strokeLinejoin="round"
|
|
105
|
+
variants={segmentVariants.segment5}
|
|
60
106
|
/>
|
|
61
|
-
<rect
|
|
62
|
-
opacity="0.88"
|
|
107
|
+
<motion.rect
|
|
63
108
|
x="14.7412"
|
|
64
109
|
y="16.5391"
|
|
65
110
|
width="1.83333"
|
|
@@ -72,9 +117,9 @@ export function SpinnerIcon(_props: ComponentProps<RemixiconComponentType>) {
|
|
|
72
117
|
strokeWidth="0.916667"
|
|
73
118
|
strokeLinecap="round"
|
|
74
119
|
strokeLinejoin="round"
|
|
120
|
+
variants={segmentVariants.segment6}
|
|
75
121
|
/>
|
|
76
|
-
<path
|
|
77
|
-
opacity="0.13"
|
|
122
|
+
<motion.path
|
|
78
123
|
d="M5.0183 19.7796C4.66032 20.1375 4.07992 20.1375 3.72194 19.7796C3.36396 19.4216 3.36396 18.8412 3.72194 18.4832L6.31466 15.8905C6.67264 15.5325 7.25304 15.5325 7.61102 15.8905C7.969 16.2484 7.969 16.8288 7.61102 17.1868L5.0183 19.7796Z"
|
|
79
124
|
fill="currentColor"
|
|
80
125
|
stroke="currentColor"
|
|
@@ -82,9 +127,9 @@ export function SpinnerIcon(_props: ComponentProps<RemixiconComponentType>) {
|
|
|
82
127
|
strokeWidth="0.916667"
|
|
83
128
|
strokeLinecap="round"
|
|
84
129
|
strokeLinejoin="round"
|
|
130
|
+
variants={segmentVariants.segment7}
|
|
85
131
|
/>
|
|
86
|
-
<path
|
|
87
|
-
opacity="0.63"
|
|
132
|
+
<motion.path
|
|
88
133
|
d="M16.6853 8.11354C16.3273 8.47152 15.7469 8.47152 15.3889 8.11354C15.0309 7.75556 15.0309 7.17516 15.3889 6.81718L17.9817 4.22445C18.3396 3.86647 18.92 3.86647 19.278 4.22445C19.636 4.58243 19.636 5.16283 19.278 5.52081L16.6853 8.11354Z"
|
|
89
134
|
fill="currentColor"
|
|
90
135
|
stroke="currentColor"
|
|
@@ -92,7 +137,8 @@ export function SpinnerIcon(_props: ComponentProps<RemixiconComponentType>) {
|
|
|
92
137
|
strokeWidth="0.916667"
|
|
93
138
|
strokeLinecap="round"
|
|
94
139
|
strokeLinejoin="round"
|
|
140
|
+
variants={segmentVariants.segment8}
|
|
95
141
|
/>
|
|
96
|
-
</svg>
|
|
142
|
+
</motion.svg>
|
|
97
143
|
);
|
|
98
144
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type {RemixiconComponentType} from '@remixicon/react';
|
|
1
2
|
import {
|
|
2
|
-
type RemixiconComponentType,
|
|
3
3
|
RiAddLine,
|
|
4
4
|
RiArrowRightSLine,
|
|
5
5
|
RiBookOpenFill,
|
|
@@ -36,32 +36,32 @@ import {
|
|
|
36
36
|
const iconsMap = {
|
|
37
37
|
google: RiGoogleFill,
|
|
38
38
|
microsoft: RiMicrosoftFill,
|
|
39
|
+
github: RiGithubFill,
|
|
40
|
+
shipfox: ShipfoxLogo,
|
|
41
|
+
slack: SlackLogo,
|
|
42
|
+
stripe: StripeLogo,
|
|
39
43
|
badge: BadgeIcon,
|
|
40
44
|
checkCircleSolid: CheckCircleSolidIcon,
|
|
41
45
|
circleDottedLine: CircleDottedLineIcon,
|
|
42
46
|
componentFill: ComponentFillIcon,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
resize: ResizeIcon,
|
|
47
|
+
componentLine: ComponentLineIcon,
|
|
48
|
+
ellipseMiniSolid: EllipseMiniSolidIcon,
|
|
46
49
|
infoTooltipFill: InfoTooltipFillIcon,
|
|
50
|
+
resize: ResizeIcon,
|
|
47
51
|
spinner: SpinnerIcon,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
shipfox: ShipfoxLogo,
|
|
53
|
-
slack: SlackLogo,
|
|
54
|
-
stripe: StripeLogo,
|
|
55
|
-
github: RiGithubFill,
|
|
52
|
+
thunder: ThunderIcon,
|
|
53
|
+
xCircleSolid: XCircleSolidIcon,
|
|
54
|
+
addLine: RiAddLine,
|
|
55
|
+
bookOpen: RiBookOpenFill,
|
|
56
56
|
check: RiCheckLine,
|
|
57
|
-
|
|
57
|
+
chevronRight: RiArrowRightSLine,
|
|
58
|
+
close: RiCloseLine,
|
|
59
|
+
copy: RiFileCopyLine,
|
|
60
|
+
homeSmile: RiHomeSmileFill,
|
|
61
|
+
imageAdd: RiImageAddFill,
|
|
58
62
|
info: RiInformationFill,
|
|
59
63
|
money: RiMoneyDollarCircleLine,
|
|
60
|
-
|
|
61
|
-
copy: RiFileCopyLine,
|
|
62
|
-
addLine: RiAddLine,
|
|
63
|
-
chevronRight: RiArrowRightSLine,
|
|
64
|
-
bookOpen: RiBookOpenFill,
|
|
64
|
+
subtractLine: RiSubtractLine,
|
|
65
65
|
} as const satisfies Record<string, RemixiconComponentType>;
|
|
66
66
|
|
|
67
67
|
export type IconName = keyof typeof iconsMap;
|
package/src/components/index.ts
CHANGED