@agility/plenum-ui 2.0.2 → 2.0.3
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/.storybook/Layout.jsx +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/tailwind.css +1 -9
- package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +1 -0
- package/package.json +1 -1
- package/stories/molecules/inputs/InputLabel/InputLabel.tsx +6 -6
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +19 -32
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +4 -2
- package/tailwind.config.js +2 -2
package/dist/tailwind.css
CHANGED
|
@@ -50118,10 +50118,6 @@ select {
|
|
|
50118
50118
|
background-color: rgb(128 102 20 / 0.95);
|
|
50119
50119
|
}
|
|
50120
50120
|
|
|
50121
|
-
.bg-label-gradient-idle {
|
|
50122
|
-
background-image: linear-gradient(to top, #FFF 8px, transparent 8px);
|
|
50123
|
-
}
|
|
50124
|
-
|
|
50125
50121
|
.from-0\% {
|
|
50126
50122
|
--tw-gradient-from-position: 0%;
|
|
50127
50123
|
}
|
|
@@ -59098,11 +59094,7 @@ select {
|
|
|
59098
59094
|
}
|
|
59099
59095
|
|
|
59100
59096
|
.group:focus-within .group-focus-within\:\!bg-label-gradient-focus {
|
|
59101
|
-
background-image: linear-gradient(to top, #FFF
|
|
59102
|
-
}
|
|
59103
|
-
|
|
59104
|
-
.group:focus-within .group-focus-within\:bg-label-gradient-focus {
|
|
59105
|
-
background-image: linear-gradient(to top, #FFF 9px, transparent 9px);
|
|
59097
|
+
background-image: linear-gradient(to top, #FFF 10px, transparent 10px) !important;
|
|
59106
59098
|
}
|
|
59107
59099
|
|
|
59108
59100
|
.group:focus-within .group-focus-within\:\!text-xs {
|
|
@@ -13,6 +13,7 @@ export interface IAnimatedLabelInputProps extends Omit<IInputFieldProps, "handle
|
|
|
13
13
|
maxLength?: number;
|
|
14
14
|
label: ILabelProps;
|
|
15
15
|
handleChange: (value: string) => void;
|
|
16
|
+
labelClassName?: string;
|
|
16
17
|
}
|
|
17
18
|
declare const AnimatedLabelInput: React.FC<IAnimatedLabelInputProps>;
|
|
18
19
|
export default AnimatedLabelInput;
|
package/package.json
CHANGED
|
@@ -24,14 +24,14 @@ const InputLabel: FC<IInputLabelProps> = ({
|
|
|
24
24
|
label
|
|
25
25
|
}: IInputLabelProps) => {
|
|
26
26
|
const labelStyles = cn(
|
|
27
|
-
"z-[2]
|
|
28
|
-
{ "inline-block font-medium transition-all text-sm text-gray-700 ": !isPlaceholder },
|
|
27
|
+
"z-[2] ",
|
|
29
28
|
{ "inline-block font-medium ml-2 relative transition-all": isPlaceholder },
|
|
30
29
|
{ "text-sm text-gray-400 px-2 top-8": isPlaceholder && !isActive },
|
|
31
|
-
{ "text-xs text-gray-700 px-1 top-[10px] ": isPlaceholder && isActive },
|
|
32
|
-
{ "text-xs text-red-500 px-1 top-[10px] ": isPlaceholder && isError },
|
|
33
|
-
{ "text-red-500 ": !isPlaceholder && isError },
|
|
34
|
-
{ "text-gray-500/[.5]": isDisabled }
|
|
30
|
+
{ "text-xs text-gray-700 px-1 top-[10px] bg-white": isPlaceholder && isActive },
|
|
31
|
+
{ "text-xs text-red-500 px-1 top-[10px] bg-white": isPlaceholder && isError },
|
|
32
|
+
{ "text-red-500 bg-white": !isPlaceholder && isError },
|
|
33
|
+
{ "text-gray-500/[.5]": isDisabled },
|
|
34
|
+
{ "inline-block font-medium transition-all text-sm text-gray-700 mb-1": !isPlaceholder }
|
|
35
35
|
)
|
|
36
36
|
if (!label) return null
|
|
37
37
|
return (
|
|
@@ -5,47 +5,34 @@ const meta: Meta<typeof AnimatedLabelInput> = {
|
|
|
5
5
|
title: "Design System/organisms/Animated Label Input",
|
|
6
6
|
component: AnimatedLabelInput,
|
|
7
7
|
tags: ["autodocs"],
|
|
8
|
-
argTypes: {}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
argTypes: {}
|
|
9
|
+
}
|
|
10
|
+
const DefaultArgs: IAnimatedLabelInputProps = {
|
|
11
|
+
id: "test",
|
|
12
|
+
containerStyles: "w-full",
|
|
13
|
+
label: {
|
|
14
|
+
display: "Label with White BG"
|
|
15
|
+
},
|
|
16
|
+
handleChange: (value: string) => {
|
|
17
|
+
console.log(value)
|
|
18
|
+
},
|
|
19
|
+
type: "text",
|
|
20
|
+
value: ""
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export default meta
|
|
24
24
|
type Story = StoryObj<typeof AnimatedLabelInput>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
id: "test",
|
|
28
|
-
label: {
|
|
29
|
-
display: "Label"
|
|
30
|
-
}
|
|
31
|
-
} as IAnimatedLabelInputProps
|
|
32
|
-
}
|
|
33
|
-
export const DefaultAnimatedLabelInputsDarkBGStory: Story = {
|
|
25
|
+
|
|
26
|
+
export const DefaultStory: Story = {
|
|
34
27
|
args: {
|
|
35
|
-
|
|
36
|
-
label: {
|
|
37
|
-
display: "Label with Dark BG"
|
|
38
|
-
},
|
|
39
|
-
value: "Value"
|
|
28
|
+
...DefaultArgs
|
|
40
29
|
} as IAnimatedLabelInputProps
|
|
41
30
|
}
|
|
42
31
|
|
|
43
|
-
export const
|
|
32
|
+
export const WithPlaceHolderStory: Story = {
|
|
44
33
|
args: {
|
|
45
|
-
|
|
46
|
-
label: {
|
|
47
|
-
display: "Label"
|
|
48
|
-
},
|
|
34
|
+
...DefaultArgs,
|
|
35
|
+
label: { display: "label with placeholder" },
|
|
49
36
|
placeholder: "Placeholder"
|
|
50
37
|
} as IAnimatedLabelInputProps
|
|
51
38
|
}
|
|
@@ -17,6 +17,7 @@ export interface IAnimatedLabelInputProps extends Omit<IInputFieldProps, "handle
|
|
|
17
17
|
maxLength?: number
|
|
18
18
|
label: ILabelProps
|
|
19
19
|
handleChange: (value: string) => void
|
|
20
|
+
labelClassName?: string
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const AnimatedLabelInput: React.FC<IAnimatedLabelInputProps> = (props: IAnimatedLabelInputProps) => {
|
|
@@ -31,6 +32,7 @@ const AnimatedLabelInput: React.FC<IAnimatedLabelInputProps> = (props: IAnimated
|
|
|
31
32
|
isShowCounter,
|
|
32
33
|
maxLength,
|
|
33
34
|
handleChange,
|
|
35
|
+
labelClassName,
|
|
34
36
|
...input
|
|
35
37
|
} = props
|
|
36
38
|
|
|
@@ -53,7 +55,7 @@ const AnimatedLabelInput: React.FC<IAnimatedLabelInputProps> = (props: IAnimated
|
|
|
53
55
|
/>
|
|
54
56
|
<div
|
|
55
57
|
className={cn(
|
|
56
|
-
"absolute z-10 ml-[3px] inline-block bg-
|
|
58
|
+
"absolute z-10 ml-[3px] inline-block bg-white text-sm transition-all text-gray-500 left-1 px-1",
|
|
57
59
|
hasValue ? "!-top-[8px] !ml-[.172rem] !text-xs text-gray-600" : "top-[9px]",
|
|
58
60
|
"peer-placeholder-shown:!-top-[8px] peer-placeholder-shown:!ml-[.172rem] peer-placeholder-shown:!text-xs peer-placeholder-shown:text-gray-600",
|
|
59
61
|
"group-focus-within:!-top-[8px] group-focus-within:!bg-label-gradient-focus group-focus-within:!ml-[.172rem] group-focus-within:!text-xs group-focus-within:text-gray-600",
|
|
@@ -61,7 +63,7 @@ const AnimatedLabelInput: React.FC<IAnimatedLabelInputProps> = (props: IAnimated
|
|
|
61
63
|
isError && "!text-red-600"
|
|
62
64
|
)}
|
|
63
65
|
>
|
|
64
|
-
<label htmlFor={id}>
|
|
66
|
+
<label htmlFor={id} className={labelClassName}>
|
|
65
67
|
{label.display}
|
|
66
68
|
{required && <span className="text-red-600 ml-1">*</span>}
|
|
67
69
|
</label>
|
package/tailwind.config.js
CHANGED
|
@@ -40,8 +40,8 @@ module.exports = {
|
|
|
40
40
|
},
|
|
41
41
|
extend: {
|
|
42
42
|
backgroundImage: (theme) => ({
|
|
43
|
-
"label-gradient-focus": "linear-gradient(to top, #FFF
|
|
44
|
-
"label-gradient-idle": "linear-gradient(to top, #FFF
|
|
43
|
+
"label-gradient-focus": "linear-gradient(to top, #FFF 10px, transparent 10px)",
|
|
44
|
+
"label-gradient-idle": "linear-gradient(to top, #FFF 10px, transparent 10px)"
|
|
45
45
|
}),
|
|
46
46
|
gridTemplateColumns: {
|
|
47
47
|
// Simple 16 column grid
|