@agility/plenum-ui 2.0.0-rc47 → 2.0.0-rc49
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/.eslintrc.json +6 -6
- package/.prettierrc +13 -13
- package/.storybook/Layout.jsx +12 -12
- package/.storybook/head.tsx +4 -4
- package/.storybook/main.ts +18 -18
- package/.storybook/manager-head.html +1 -1
- package/.storybook/manager.ts +25 -25
- package/.storybook/plenumTheme.ts +8 -8
- package/.storybook/preview-head.html +3 -3
- package/.storybook/preview.tsx +28 -28
- package/.vscode/settings.json +3 -3
- package/README.md +271 -271
- package/app/globals.css +99 -99
- package/app/head.tsx +59 -59
- package/app/layout.tsx +28 -28
- package/app/page.tsx +7 -7
- package/build.js +45 -45
- package/dist/index.d.ts +232 -230
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/types/stories/molecules/inputs/select/Select.d.ts +2 -0
- package/local.sh +100 -100
- package/next.config.js +8 -8
- package/package.json +82 -82
- package/pages/api/hello.ts +13 -13
- package/postcss.config.js +6 -6
- package/rollup.config.mjs +41 -41
- package/scripts/create-component.js +97 -97
- package/stories/Introduction.mdx +314 -314
- package/stories/assets/stackalt.svg +1 -1
- package/stories/atoms/Avatar/Avatar.stories.tsx +96 -96
- package/stories/atoms/Avatar/Avatar.tsx +123 -123
- package/stories/atoms/Avatar/index.ts +3 -3
- package/stories/atoms/badges/Badge.tsx +127 -127
- package/stories/atoms/badges/Pill/Pill.stories.tsx +75 -75
- package/stories/atoms/badges/Rounded/Rounded.stories.tsx +75 -75
- package/stories/atoms/badges/index.ts +3 -3
- package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +86 -86
- package/stories/atoms/buttons/Button/Button.tsx +232 -232
- package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +90 -90
- package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +97 -97
- package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +93 -93
- package/stories/atoms/buttons/Button/defaultArgs.ts +9 -9
- package/stories/atoms/buttons/Button/index.ts +3 -3
- package/stories/atoms/buttons/Capsule/Alternative/Alternative.stories.ts +27 -27
- package/stories/atoms/buttons/Capsule/Capsule.tsx +88 -88
- package/stories/atoms/buttons/Capsule/Danger/Danger.stories.ts +27 -27
- package/stories/atoms/buttons/Capsule/Primary/Primary.stories.ts +27 -27
- package/stories/atoms/buttons/Capsule/Secondary/Secondary.stories.ts +27 -27
- package/stories/atoms/buttons/Capsule/index.ts +3 -3
- package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.stories.tsx +15 -15
- package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.tsx +22 -22
- package/stories/atoms/buttons/FloatingActionButton/index.tsx +3 -3
- package/stories/atoms/buttons/index.ts +4 -4
- package/stories/atoms/crumb/Crumb.stories.tsx +18 -18
- package/stories/atoms/crumb/Crumb.tsx +22 -22
- package/stories/atoms/crumb/index.tsx +3 -3
- package/stories/atoms/icons/DynamicIcon.stories.ts +43 -43
- package/stories/atoms/icons/DynamicIcon.tsx +90 -90
- package/stories/atoms/icons/IconWithShadow.stories.ts +43 -43
- package/stories/atoms/icons/IconWithShadow.tsx +16 -16
- package/stories/atoms/icons/TablerIcon.tsx +22 -22
- package/stories/atoms/icons/index.tsx +14 -14
- package/stories/atoms/icons/tablerIconNames.ts +4336 -4336
- package/stories/atoms/index.ts +46 -46
- package/stories/atoms/loaders/Loader.stories.ts +15 -15
- package/stories/atoms/loaders/Loader.tsx +21 -21
- package/stories/atoms/loaders/NProgress/RadialProgress.stories.tsx +19 -19
- package/stories/atoms/loaders/NProgress/RadialProgress.tsx +74 -74
- package/stories/atoms/loaders/NProgress/index.ts +3 -3
- package/stories/atoms/loaders/index.ts +4 -4
- package/stories/index.ts +136 -136
- package/stories/molecules/index.ts +51 -51
- package/stories/molecules/inputs/InputCounter/InputCounter.stories.tsx +18 -18
- package/stories/molecules/inputs/InputCounter/InputCounter.tsx +24 -24
- package/stories/molecules/inputs/InputCounter/index.tsx +3 -3
- package/stories/molecules/inputs/InputField/InputField.stories.tsx +29 -29
- package/stories/molecules/inputs/InputField/InputField.tsx +96 -96
- package/stories/molecules/inputs/InputField/index.tsx +3 -3
- package/stories/molecules/inputs/InputLabel/InputLabel.stories.tsx +19 -19
- package/stories/molecules/inputs/InputLabel/InputLabel.tsx +45 -45
- package/stories/molecules/inputs/InputLabel/index.tsx +3 -3
- package/stories/molecules/inputs/NestedInputButton/NestedInputButton.stories.tsx +52 -52
- package/stories/molecules/inputs/NestedInputButton/NestedInputButton.tsx +64 -64
- package/stories/molecules/inputs/NestedInputButton/index.tsx +3 -3
- package/stories/molecules/inputs/TextInput/TextInput.stories.tsx +32 -32
- package/stories/molecules/inputs/TextInput/TextInput.tsx +165 -165
- package/stories/molecules/inputs/TextInput/index.tsx +5 -5
- package/stories/molecules/inputs/checkbox/Checkbox.stories.ts +23 -23
- package/stories/molecules/inputs/checkbox/Checkbox.tsx +98 -98
- package/stories/molecules/inputs/checkbox/index.ts +3 -3
- package/stories/molecules/inputs/combobox/ComboBox.stories.ts +41 -41
- package/stories/molecules/inputs/combobox/ComboBox.tsx +185 -185
- package/stories/molecules/inputs/combobox/index.ts +3 -3
- package/stories/molecules/inputs/index.ts +38 -38
- package/stories/molecules/inputs/radio/Radio.stories.ts +27 -27
- package/stories/molecules/inputs/radio/Radio.tsx +92 -92
- package/stories/molecules/inputs/radio/index.ts +3 -3
- package/stories/molecules/inputs/select/Select.stories.ts +23 -23
- package/stories/molecules/inputs/select/Select.tsx +108 -100
- package/stories/molecules/inputs/select/index.ts +3 -3
- package/stories/molecules/inputs/textArea/TextArea.stories.ts +22 -22
- package/stories/molecules/inputs/textArea/TextArea.tsx +158 -158
- package/stories/molecules/inputs/textArea/index.ts +3 -3
- package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.stories.tsx +118 -118
- package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +81 -81
- package/stories/molecules/inputs/toggleSwitch/index.ts +3 -3
- package/stories/molecules/tabs/Tabs.stories.tsx +18 -18
- package/stories/molecules/tabs/Tabs.tsx +22 -22
- package/stories/molecules/tabs/index.tsx +2 -2
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +30 -30
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +66 -66
- package/stories/organisms/AnimatedLabelInput/index.tsx +3 -3
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -26
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -61
- package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -3
- package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +125 -125
- package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +86 -86
- package/stories/organisms/ButtonDropdown/index.tsx +3 -3
- package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +73 -73
- package/stories/organisms/DropdownComponent/DropdownComponent.tsx +346 -346
- package/stories/organisms/DropdownComponent/dropdownItems.ts +122 -122
- package/stories/organisms/DropdownComponent/index.ts +4 -4
- package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +76 -76
- package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.tsx +52 -52
- package/stories/organisms/EmptySectionPlaceholder/index.tsx +4 -4
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +29 -29
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +145 -145
- package/stories/organisms/FormInputWithAddons/index.tsx +3 -3
- package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -59
- package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -33
- package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -186
- package/stories/organisms/TextInputSelect/index.tsx +3 -3
- package/stories/organisms/index.ts +27 -27
- package/tailwind.config.js +192 -192
- package/tsconfig.json +29 -29
- package/tsconfig.lib.json +25 -25
- package/utils/types.d.ts +2 -2
- package/utils/types.ts +3 -3
- package/utils/useId.d.ts +1 -1
- package/utils/useId.tsx +16 -16
package/stories/atoms/index.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import Avatar, { IAvatarProps } from "./Avatar"
|
|
2
|
-
import Badge, { IBadgeProps } from "./badges"
|
|
3
|
-
import { Button, Capsule, BTNActionType, IButtonProps, ICapsuleProps } from "./buttons"
|
|
4
|
-
import {
|
|
5
|
-
DynamicIcon,
|
|
6
|
-
FAIconName,
|
|
7
|
-
IDynamicIconProps,
|
|
8
|
-
IIconWithShadowProps,
|
|
9
|
-
IconName,
|
|
10
|
-
IconWithShadow,
|
|
11
|
-
UnifiedIconName,
|
|
12
|
-
isFAIcon,
|
|
13
|
-
isHeroIcon,
|
|
14
|
-
isTablerIcon,
|
|
15
|
-
isUnifiedIconName
|
|
16
|
-
} from "./icons"
|
|
17
|
-
import { ILoaderProps, IRadialProgressProps, Loader, RadialProgress } from "./loaders"
|
|
18
|
-
|
|
19
|
-
export type {
|
|
20
|
-
IAvatarProps,
|
|
21
|
-
IBadgeProps,
|
|
22
|
-
IButtonProps,
|
|
23
|
-
ICapsuleProps,
|
|
24
|
-
IDynamicIconProps,
|
|
25
|
-
IIconWithShadowProps,
|
|
26
|
-
ILoaderProps,
|
|
27
|
-
IRadialProgressProps,
|
|
28
|
-
UnifiedIconName,
|
|
29
|
-
IconName,
|
|
30
|
-
FAIconName,
|
|
31
|
-
BTNActionType
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
Avatar,
|
|
35
|
-
Badge,
|
|
36
|
-
Button,
|
|
37
|
-
Capsule,
|
|
38
|
-
DynamicIcon,
|
|
39
|
-
IconWithShadow,
|
|
40
|
-
Loader,
|
|
41
|
-
RadialProgress,
|
|
42
|
-
isFAIcon,
|
|
43
|
-
isHeroIcon,
|
|
44
|
-
isTablerIcon,
|
|
45
|
-
isUnifiedIconName
|
|
46
|
-
}
|
|
1
|
+
import Avatar, { IAvatarProps } from "./Avatar"
|
|
2
|
+
import Badge, { IBadgeProps } from "./badges"
|
|
3
|
+
import { Button, Capsule, BTNActionType, IButtonProps, ICapsuleProps } from "./buttons"
|
|
4
|
+
import {
|
|
5
|
+
DynamicIcon,
|
|
6
|
+
FAIconName,
|
|
7
|
+
IDynamicIconProps,
|
|
8
|
+
IIconWithShadowProps,
|
|
9
|
+
IconName,
|
|
10
|
+
IconWithShadow,
|
|
11
|
+
UnifiedIconName,
|
|
12
|
+
isFAIcon,
|
|
13
|
+
isHeroIcon,
|
|
14
|
+
isTablerIcon,
|
|
15
|
+
isUnifiedIconName
|
|
16
|
+
} from "./icons"
|
|
17
|
+
import { ILoaderProps, IRadialProgressProps, Loader, RadialProgress } from "./loaders"
|
|
18
|
+
|
|
19
|
+
export type {
|
|
20
|
+
IAvatarProps,
|
|
21
|
+
IBadgeProps,
|
|
22
|
+
IButtonProps,
|
|
23
|
+
ICapsuleProps,
|
|
24
|
+
IDynamicIconProps,
|
|
25
|
+
IIconWithShadowProps,
|
|
26
|
+
ILoaderProps,
|
|
27
|
+
IRadialProgressProps,
|
|
28
|
+
UnifiedIconName,
|
|
29
|
+
IconName,
|
|
30
|
+
FAIconName,
|
|
31
|
+
BTNActionType
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
Avatar,
|
|
35
|
+
Badge,
|
|
36
|
+
Button,
|
|
37
|
+
Capsule,
|
|
38
|
+
DynamicIcon,
|
|
39
|
+
IconWithShadow,
|
|
40
|
+
Loader,
|
|
41
|
+
RadialProgress,
|
|
42
|
+
isFAIcon,
|
|
43
|
+
isHeroIcon,
|
|
44
|
+
isTablerIcon,
|
|
45
|
+
isUnifiedIconName
|
|
46
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
import Loader from "./Loader"
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Loader> = {
|
|
5
|
-
title: "Design System/atoms/Loaders/Loader",
|
|
6
|
-
component: Loader
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
type Story = StoryObj<typeof Loader>
|
|
10
|
-
|
|
11
|
-
export const DefaultLoader: Story = {
|
|
12
|
-
args: { className: "" },
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default meta
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import Loader from "./Loader"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Loader> = {
|
|
5
|
+
title: "Design System/atoms/Loaders/Loader",
|
|
6
|
+
component: Loader
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Loader>
|
|
10
|
+
|
|
11
|
+
export const DefaultLoader: Story = {
|
|
12
|
+
args: { className: "" },
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default meta
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { default as cn } from "classnames"
|
|
3
|
-
|
|
4
|
-
export interface ILoaderProps {
|
|
5
|
-
className?: string
|
|
6
|
-
}
|
|
7
|
-
const Loader: React.FC<ILoaderProps> = ({ className }) => {
|
|
8
|
-
return (
|
|
9
|
-
<>
|
|
10
|
-
<i
|
|
11
|
-
className={cn(
|
|
12
|
-
"rounded-full w-16 h-16 inline-block border-8 animate-spin m-auto",
|
|
13
|
-
className ? className : "border-purple-700 border-r-gray-200"
|
|
14
|
-
)}
|
|
15
|
-
role="status"
|
|
16
|
-
/>
|
|
17
|
-
</>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default Loader
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
|
|
4
|
+
export interface ILoaderProps {
|
|
5
|
+
className?: string
|
|
6
|
+
}
|
|
7
|
+
const Loader: React.FC<ILoaderProps> = ({ className }) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<i
|
|
11
|
+
className={cn(
|
|
12
|
+
"rounded-full w-16 h-16 inline-block border-8 animate-spin m-auto",
|
|
13
|
+
className ? className : "border-purple-700 border-r-gray-200"
|
|
14
|
+
)}
|
|
15
|
+
role="status"
|
|
16
|
+
/>
|
|
17
|
+
</>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default Loader
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
import RadialProgress from "./RadialProgress"
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof RadialProgress> = {
|
|
5
|
-
title: "Design System/atoms/Loaders/NProgress/RadialProgress",
|
|
6
|
-
component: RadialProgress
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
type Story = StoryObj<typeof RadialProgress>
|
|
10
|
-
|
|
11
|
-
export const DefaultRadialProgress: Story = {
|
|
12
|
-
args: {
|
|
13
|
-
inputValue: 33,
|
|
14
|
-
radius: 20,
|
|
15
|
-
children: <></>
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default meta
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import RadialProgress from "./RadialProgress"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof RadialProgress> = {
|
|
5
|
+
title: "Design System/atoms/Loaders/NProgress/RadialProgress",
|
|
6
|
+
component: RadialProgress
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof RadialProgress>
|
|
10
|
+
|
|
11
|
+
export const DefaultRadialProgress: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
inputValue: 33,
|
|
14
|
+
radius: 20,
|
|
15
|
+
children: <></>
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import React, { useMemo } from "react"
|
|
2
|
-
import { default as cn } from "classnames"
|
|
3
|
-
export interface IRadialProgressProps extends React.PropsWithChildren {
|
|
4
|
-
/** Percentage value to display */
|
|
5
|
-
inputValue: number
|
|
6
|
-
/** Radius for the circle - Max value of 100 */
|
|
7
|
-
radius: number
|
|
8
|
-
/** Additional classnames */
|
|
9
|
-
className?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const RadialProgress: React.FC<IRadialProgressProps> = ({
|
|
13
|
-
inputValue,
|
|
14
|
-
radius,
|
|
15
|
-
children,
|
|
16
|
-
className,
|
|
17
|
-
}) => {
|
|
18
|
-
const r = radius / 2
|
|
19
|
-
|
|
20
|
-
if (inputValue < 0) {
|
|
21
|
-
inputValue = 0
|
|
22
|
-
}
|
|
23
|
-
if (inputValue > 100) {
|
|
24
|
-
inputValue = 100
|
|
25
|
-
}
|
|
26
|
-
if (radius < 0) {
|
|
27
|
-
radius = 0
|
|
28
|
-
}
|
|
29
|
-
if (radius > 100) {
|
|
30
|
-
radius = 100
|
|
31
|
-
}
|
|
32
|
-
const drawPercentage = useMemo(() => {
|
|
33
|
-
const roundCircum = Math.round(2 * r * Math.PI)
|
|
34
|
-
return (inputValue * roundCircum) / 50
|
|
35
|
-
}, [inputValue, r])
|
|
36
|
-
|
|
37
|
-
const xyPos = (radius + 2) * -1
|
|
38
|
-
const viewPortXY = (radius + 2) * 2
|
|
39
|
-
return (
|
|
40
|
-
<div
|
|
41
|
-
className={cn(`overflow-visible`, className && className)}
|
|
42
|
-
style={{ height: `${viewPortXY}px`, width: `${viewPortXY}px` }}
|
|
43
|
-
>
|
|
44
|
-
<svg
|
|
45
|
-
viewBox={`${xyPos} ${xyPos} ${viewPortXY} ${viewPortXY}`}
|
|
46
|
-
data-percent={drawPercentage}
|
|
47
|
-
fill="none"
|
|
48
|
-
>
|
|
49
|
-
<circle
|
|
50
|
-
className="-rotate-90 stroke-gray-200 stroke-1"
|
|
51
|
-
cx={0}
|
|
52
|
-
cy={0}
|
|
53
|
-
r={radius}
|
|
54
|
-
></circle>
|
|
55
|
-
<circle
|
|
56
|
-
strokeDasharray={`${drawPercentage} 999`}
|
|
57
|
-
className="m-1 -rotate-90 stroke-purple-600 stroke-1 transition-all"
|
|
58
|
-
cx={0}
|
|
59
|
-
cy={0}
|
|
60
|
-
r={radius}
|
|
61
|
-
></circle>
|
|
62
|
-
</svg>
|
|
63
|
-
<div
|
|
64
|
-
className={cn(
|
|
65
|
-
`h-[${viewPortXY}px] w-[${viewPortXY}px] absolute inset-0 flex items-center justify-center overflow-hidden `
|
|
66
|
-
)}
|
|
67
|
-
>
|
|
68
|
-
{children}
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default RadialProgress
|
|
1
|
+
import React, { useMemo } from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
export interface IRadialProgressProps extends React.PropsWithChildren {
|
|
4
|
+
/** Percentage value to display */
|
|
5
|
+
inputValue: number
|
|
6
|
+
/** Radius for the circle - Max value of 100 */
|
|
7
|
+
radius: number
|
|
8
|
+
/** Additional classnames */
|
|
9
|
+
className?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const RadialProgress: React.FC<IRadialProgressProps> = ({
|
|
13
|
+
inputValue,
|
|
14
|
+
radius,
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
}) => {
|
|
18
|
+
const r = radius / 2
|
|
19
|
+
|
|
20
|
+
if (inputValue < 0) {
|
|
21
|
+
inputValue = 0
|
|
22
|
+
}
|
|
23
|
+
if (inputValue > 100) {
|
|
24
|
+
inputValue = 100
|
|
25
|
+
}
|
|
26
|
+
if (radius < 0) {
|
|
27
|
+
radius = 0
|
|
28
|
+
}
|
|
29
|
+
if (radius > 100) {
|
|
30
|
+
radius = 100
|
|
31
|
+
}
|
|
32
|
+
const drawPercentage = useMemo(() => {
|
|
33
|
+
const roundCircum = Math.round(2 * r * Math.PI)
|
|
34
|
+
return (inputValue * roundCircum) / 50
|
|
35
|
+
}, [inputValue, r])
|
|
36
|
+
|
|
37
|
+
const xyPos = (radius + 2) * -1
|
|
38
|
+
const viewPortXY = (radius + 2) * 2
|
|
39
|
+
return (
|
|
40
|
+
<div
|
|
41
|
+
className={cn(`overflow-visible`, className && className)}
|
|
42
|
+
style={{ height: `${viewPortXY}px`, width: `${viewPortXY}px` }}
|
|
43
|
+
>
|
|
44
|
+
<svg
|
|
45
|
+
viewBox={`${xyPos} ${xyPos} ${viewPortXY} ${viewPortXY}`}
|
|
46
|
+
data-percent={drawPercentage}
|
|
47
|
+
fill="none"
|
|
48
|
+
>
|
|
49
|
+
<circle
|
|
50
|
+
className="-rotate-90 stroke-gray-200 stroke-1"
|
|
51
|
+
cx={0}
|
|
52
|
+
cy={0}
|
|
53
|
+
r={radius}
|
|
54
|
+
></circle>
|
|
55
|
+
<circle
|
|
56
|
+
strokeDasharray={`${drawPercentage} 999`}
|
|
57
|
+
className="m-1 -rotate-90 stroke-purple-600 stroke-1 transition-all"
|
|
58
|
+
cx={0}
|
|
59
|
+
cy={0}
|
|
60
|
+
r={radius}
|
|
61
|
+
></circle>
|
|
62
|
+
</svg>
|
|
63
|
+
<div
|
|
64
|
+
className={cn(
|
|
65
|
+
`h-[${viewPortXY}px] w-[${viewPortXY}px] absolute inset-0 flex items-center justify-center overflow-hidden `
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default RadialProgress
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import RadialProgress, { IRadialProgressProps } from "./RadialProgress"
|
|
2
|
-
export default RadialProgress
|
|
3
|
-
export type { IRadialProgressProps }
|
|
1
|
+
import RadialProgress, { IRadialProgressProps } from "./RadialProgress"
|
|
2
|
+
export default RadialProgress
|
|
3
|
+
export type { IRadialProgressProps }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Loader, { ILoaderProps } from "./Loader"
|
|
2
|
-
import RadialProgress, { IRadialProgressProps } from "./NProgress"
|
|
3
|
-
export { Loader, RadialProgress }
|
|
4
|
-
export type { ILoaderProps, IRadialProgressProps }
|
|
1
|
+
import Loader, { ILoaderProps } from "./Loader"
|
|
2
|
+
import RadialProgress, { IRadialProgressProps } from "./NProgress"
|
|
3
|
+
export { Loader, RadialProgress }
|
|
4
|
+
export type { ILoaderProps, IRadialProgressProps }
|
package/stories/index.ts
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
//Atomic Components, props, and type gaurds.
|
|
2
|
-
import {
|
|
3
|
-
IAvatarProps,
|
|
4
|
-
IBadgeProps,
|
|
5
|
-
IButtonProps,
|
|
6
|
-
ICapsuleProps,
|
|
7
|
-
IDynamicIconProps,
|
|
8
|
-
IIconWithShadowProps,
|
|
9
|
-
ILoaderProps,
|
|
10
|
-
IRadialProgressProps,
|
|
11
|
-
UnifiedIconName,
|
|
12
|
-
IconName,
|
|
13
|
-
FAIconName,
|
|
14
|
-
BTNActionType,
|
|
15
|
-
Avatar,
|
|
16
|
-
Badge,
|
|
17
|
-
Button,
|
|
18
|
-
Capsule,
|
|
19
|
-
DynamicIcon,
|
|
20
|
-
IconWithShadow,
|
|
21
|
-
Loader,
|
|
22
|
-
RadialProgress,
|
|
23
|
-
isFAIcon,
|
|
24
|
-
isHeroIcon,
|
|
25
|
-
isTablerIcon,
|
|
26
|
-
isUnifiedIconName
|
|
27
|
-
} from "./atoms"
|
|
28
|
-
// Molecular Components, props, and type gaurds.
|
|
29
|
-
import {
|
|
30
|
-
ICheckboxProps,
|
|
31
|
-
IComboboxProps,
|
|
32
|
-
IInputFieldProps,
|
|
33
|
-
IInputLabelProps,
|
|
34
|
-
INestedInputButtonProps,
|
|
35
|
-
IRadioProps,
|
|
36
|
-
ISelectProps,
|
|
37
|
-
ITextareaProps,
|
|
38
|
-
IToggleSwitchProps,
|
|
39
|
-
AcceptedInputTypes,
|
|
40
|
-
Checkbox,
|
|
41
|
-
Combobox,
|
|
42
|
-
InputField,
|
|
43
|
-
InputLabel,
|
|
44
|
-
NestedInputButton,
|
|
45
|
-
Radio,
|
|
46
|
-
Select,
|
|
47
|
-
Textarea,
|
|
48
|
-
ToggleSwitch,
|
|
49
|
-
TextInput,
|
|
50
|
-
ITextInputProps,
|
|
51
|
-
ISimpleSelectOptions
|
|
52
|
-
} from "./molecules"
|
|
53
|
-
// Organism Components, props, and type gaurds.
|
|
54
|
-
import {
|
|
55
|
-
IAnimatedLabelInputProps,
|
|
56
|
-
AnimatedLabelTextArea,
|
|
57
|
-
IAnimatedLabelTextAreaProps,
|
|
58
|
-
IButtonDropdownProps,
|
|
59
|
-
IDropdownProps,
|
|
60
|
-
IEmptySectionPlaceholderProps,
|
|
61
|
-
IItemProp,
|
|
62
|
-
IFormInputWithAddonsProps,
|
|
63
|
-
AnimatedLabelInput,
|
|
64
|
-
ButtonDropdown,
|
|
65
|
-
Dropdown,
|
|
66
|
-
EmptySectionPlaceholder,
|
|
67
|
-
FormInputWithAddons,
|
|
68
|
-
TextInputSelect,
|
|
69
|
-
ITextInputSelectProps
|
|
70
|
-
} from "./organisms"
|
|
71
|
-
|
|
72
|
-
export type {
|
|
73
|
-
IAvatarProps,
|
|
74
|
-
IBadgeProps,
|
|
75
|
-
IButtonProps,
|
|
76
|
-
ICapsuleProps,
|
|
77
|
-
ITextInputSelectProps,
|
|
78
|
-
IDynamicIconProps,
|
|
79
|
-
IIconWithShadowProps,
|
|
80
|
-
ILoaderProps,
|
|
81
|
-
IRadialProgressProps,
|
|
82
|
-
ICheckboxProps,
|
|
83
|
-
IComboboxProps,
|
|
84
|
-
IInputFieldProps,
|
|
85
|
-
IInputLabelProps,
|
|
86
|
-
INestedInputButtonProps,
|
|
87
|
-
IRadioProps,
|
|
88
|
-
ISelectProps,
|
|
89
|
-
ITextareaProps,
|
|
90
|
-
IToggleSwitchProps,
|
|
91
|
-
AcceptedInputTypes,
|
|
92
|
-
IAnimatedLabelInputProps,
|
|
93
|
-
IAnimatedLabelTextAreaProps,
|
|
94
|
-
IButtonDropdownProps,
|
|
95
|
-
IDropdownProps,
|
|
96
|
-
IEmptySectionPlaceholderProps,
|
|
97
|
-
IItemProp,
|
|
98
|
-
IFormInputWithAddonsProps,
|
|
99
|
-
UnifiedIconName,
|
|
100
|
-
IconName,
|
|
101
|
-
FAIconName,
|
|
102
|
-
BTNActionType,
|
|
103
|
-
ITextInputProps,
|
|
104
|
-
ISimpleSelectOptions
|
|
105
|
-
}
|
|
106
|
-
export {
|
|
107
|
-
Avatar,
|
|
108
|
-
Checkbox,
|
|
109
|
-
Combobox,
|
|
110
|
-
InputField,
|
|
111
|
-
InputLabel,
|
|
112
|
-
NestedInputButton,
|
|
113
|
-
Radio,
|
|
114
|
-
Select,
|
|
115
|
-
Textarea,
|
|
116
|
-
ToggleSwitch,
|
|
117
|
-
AnimatedLabelInput,
|
|
118
|
-
AnimatedLabelTextArea,
|
|
119
|
-
ButtonDropdown,
|
|
120
|
-
Dropdown,
|
|
121
|
-
EmptySectionPlaceholder,
|
|
122
|
-
FormInputWithAddons,
|
|
123
|
-
Badge,
|
|
124
|
-
Button,
|
|
125
|
-
Capsule,
|
|
126
|
-
DynamicIcon,
|
|
127
|
-
IconWithShadow,
|
|
128
|
-
Loader,
|
|
129
|
-
RadialProgress,
|
|
130
|
-
isFAIcon,
|
|
131
|
-
isHeroIcon,
|
|
132
|
-
isTablerIcon,
|
|
133
|
-
isUnifiedIconName,
|
|
134
|
-
TextInput,
|
|
135
|
-
TextInputSelect
|
|
136
|
-
}
|
|
1
|
+
//Atomic Components, props, and type gaurds.
|
|
2
|
+
import {
|
|
3
|
+
IAvatarProps,
|
|
4
|
+
IBadgeProps,
|
|
5
|
+
IButtonProps,
|
|
6
|
+
ICapsuleProps,
|
|
7
|
+
IDynamicIconProps,
|
|
8
|
+
IIconWithShadowProps,
|
|
9
|
+
ILoaderProps,
|
|
10
|
+
IRadialProgressProps,
|
|
11
|
+
UnifiedIconName,
|
|
12
|
+
IconName,
|
|
13
|
+
FAIconName,
|
|
14
|
+
BTNActionType,
|
|
15
|
+
Avatar,
|
|
16
|
+
Badge,
|
|
17
|
+
Button,
|
|
18
|
+
Capsule,
|
|
19
|
+
DynamicIcon,
|
|
20
|
+
IconWithShadow,
|
|
21
|
+
Loader,
|
|
22
|
+
RadialProgress,
|
|
23
|
+
isFAIcon,
|
|
24
|
+
isHeroIcon,
|
|
25
|
+
isTablerIcon,
|
|
26
|
+
isUnifiedIconName
|
|
27
|
+
} from "./atoms"
|
|
28
|
+
// Molecular Components, props, and type gaurds.
|
|
29
|
+
import {
|
|
30
|
+
ICheckboxProps,
|
|
31
|
+
IComboboxProps,
|
|
32
|
+
IInputFieldProps,
|
|
33
|
+
IInputLabelProps,
|
|
34
|
+
INestedInputButtonProps,
|
|
35
|
+
IRadioProps,
|
|
36
|
+
ISelectProps,
|
|
37
|
+
ITextareaProps,
|
|
38
|
+
IToggleSwitchProps,
|
|
39
|
+
AcceptedInputTypes,
|
|
40
|
+
Checkbox,
|
|
41
|
+
Combobox,
|
|
42
|
+
InputField,
|
|
43
|
+
InputLabel,
|
|
44
|
+
NestedInputButton,
|
|
45
|
+
Radio,
|
|
46
|
+
Select,
|
|
47
|
+
Textarea,
|
|
48
|
+
ToggleSwitch,
|
|
49
|
+
TextInput,
|
|
50
|
+
ITextInputProps,
|
|
51
|
+
ISimpleSelectOptions
|
|
52
|
+
} from "./molecules"
|
|
53
|
+
// Organism Components, props, and type gaurds.
|
|
54
|
+
import {
|
|
55
|
+
IAnimatedLabelInputProps,
|
|
56
|
+
AnimatedLabelTextArea,
|
|
57
|
+
IAnimatedLabelTextAreaProps,
|
|
58
|
+
IButtonDropdownProps,
|
|
59
|
+
IDropdownProps,
|
|
60
|
+
IEmptySectionPlaceholderProps,
|
|
61
|
+
IItemProp,
|
|
62
|
+
IFormInputWithAddonsProps,
|
|
63
|
+
AnimatedLabelInput,
|
|
64
|
+
ButtonDropdown,
|
|
65
|
+
Dropdown,
|
|
66
|
+
EmptySectionPlaceholder,
|
|
67
|
+
FormInputWithAddons,
|
|
68
|
+
TextInputSelect,
|
|
69
|
+
ITextInputSelectProps
|
|
70
|
+
} from "./organisms"
|
|
71
|
+
|
|
72
|
+
export type {
|
|
73
|
+
IAvatarProps,
|
|
74
|
+
IBadgeProps,
|
|
75
|
+
IButtonProps,
|
|
76
|
+
ICapsuleProps,
|
|
77
|
+
ITextInputSelectProps,
|
|
78
|
+
IDynamicIconProps,
|
|
79
|
+
IIconWithShadowProps,
|
|
80
|
+
ILoaderProps,
|
|
81
|
+
IRadialProgressProps,
|
|
82
|
+
ICheckboxProps,
|
|
83
|
+
IComboboxProps,
|
|
84
|
+
IInputFieldProps,
|
|
85
|
+
IInputLabelProps,
|
|
86
|
+
INestedInputButtonProps,
|
|
87
|
+
IRadioProps,
|
|
88
|
+
ISelectProps,
|
|
89
|
+
ITextareaProps,
|
|
90
|
+
IToggleSwitchProps,
|
|
91
|
+
AcceptedInputTypes,
|
|
92
|
+
IAnimatedLabelInputProps,
|
|
93
|
+
IAnimatedLabelTextAreaProps,
|
|
94
|
+
IButtonDropdownProps,
|
|
95
|
+
IDropdownProps,
|
|
96
|
+
IEmptySectionPlaceholderProps,
|
|
97
|
+
IItemProp,
|
|
98
|
+
IFormInputWithAddonsProps,
|
|
99
|
+
UnifiedIconName,
|
|
100
|
+
IconName,
|
|
101
|
+
FAIconName,
|
|
102
|
+
BTNActionType,
|
|
103
|
+
ITextInputProps,
|
|
104
|
+
ISimpleSelectOptions
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
Avatar,
|
|
108
|
+
Checkbox,
|
|
109
|
+
Combobox,
|
|
110
|
+
InputField,
|
|
111
|
+
InputLabel,
|
|
112
|
+
NestedInputButton,
|
|
113
|
+
Radio,
|
|
114
|
+
Select,
|
|
115
|
+
Textarea,
|
|
116
|
+
ToggleSwitch,
|
|
117
|
+
AnimatedLabelInput,
|
|
118
|
+
AnimatedLabelTextArea,
|
|
119
|
+
ButtonDropdown,
|
|
120
|
+
Dropdown,
|
|
121
|
+
EmptySectionPlaceholder,
|
|
122
|
+
FormInputWithAddons,
|
|
123
|
+
Badge,
|
|
124
|
+
Button,
|
|
125
|
+
Capsule,
|
|
126
|
+
DynamicIcon,
|
|
127
|
+
IconWithShadow,
|
|
128
|
+
Loader,
|
|
129
|
+
RadialProgress,
|
|
130
|
+
isFAIcon,
|
|
131
|
+
isHeroIcon,
|
|
132
|
+
isTablerIcon,
|
|
133
|
+
isUnifiedIconName,
|
|
134
|
+
TextInput,
|
|
135
|
+
TextInputSelect
|
|
136
|
+
}
|