@rovula/ui 0.0.4 → 0.0.6

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 (84) hide show
  1. package/dist/cjs/bundle.css +1477 -0
  2. package/dist/cjs/bundle.js +2 -0
  3. package/dist/cjs/bundle.js.map +1 -0
  4. package/dist/cjs/types/components/Button/Button.d.ts +15 -0
  5. package/dist/cjs/types/components/Button/Button.styles.d.ts +7 -0
  6. package/dist/cjs/types/components/Button/Buttons.stories.d.ts +375 -0
  7. package/dist/cjs/types/components/Text/Text.d.ts +12 -0
  8. package/dist/cjs/types/components/Text/Text.stories.d.ts +35 -0
  9. package/dist/cjs/types/components/TextInput/TextInput.d.ts +19 -0
  10. package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +338 -0
  11. package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +26 -0
  12. package/dist/cjs/types/index.d.ts +7 -0
  13. package/dist/components/Button/Button.js +31 -0
  14. package/dist/components/Button/Button.styles.js +90 -0
  15. package/dist/components/Button/Buttons.stories.js +66 -0
  16. package/dist/components/Form/Form.js +106 -0
  17. package/dist/components/Form/Text.js +6 -0
  18. package/dist/components/Form/TextInput.js +6 -0
  19. package/dist/components/Table/Table.js +6 -0
  20. package/dist/components/Tabs/Tabs.js +8 -0
  21. package/dist/components/Text/Text.js +6 -0
  22. package/dist/components/Text/Text.stories.js +73 -0
  23. package/dist/components/TextInput/TextInput.js +61 -0
  24. package/dist/components/TextInput/TextInput.stories.js +39 -0
  25. package/dist/components/TextInput/TextInput.styles.js +155 -0
  26. package/dist/esm/bundle.css +1477 -0
  27. package/dist/esm/bundle.js +2 -0
  28. package/dist/esm/bundle.js.map +1 -0
  29. package/dist/esm/types/components/Button/Button.d.ts +15 -0
  30. package/dist/esm/types/components/Button/Button.styles.d.ts +7 -0
  31. package/dist/esm/types/components/Button/Buttons.stories.d.ts +375 -0
  32. package/dist/esm/types/components/Form/Form.d.ts +12 -0
  33. package/dist/esm/types/components/Form/Text.d.ts +9 -0
  34. package/dist/esm/types/components/Form/TextInput.d.ts +11 -0
  35. package/dist/esm/types/components/Table/Table.d.ts +11 -0
  36. package/dist/esm/types/components/Tabs/Tabs.d.ts +11 -0
  37. package/dist/esm/types/components/Text/Text.d.ts +12 -0
  38. package/dist/esm/types/components/Text/Text.stories.d.ts +35 -0
  39. package/dist/esm/types/components/TextInput/TextInput.d.ts +19 -0
  40. package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +338 -0
  41. package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +26 -0
  42. package/dist/esm/types/index.d.ts +7 -0
  43. package/dist/esm/types/utils/datetime.d.ts +9 -0
  44. package/dist/index.d.ts +67 -0
  45. package/dist/index.js +12 -0
  46. package/dist/src/theme/global.css +1825 -0
  47. package/dist/theme/global.css +149 -0
  48. package/dist/theme/main-preset.js +159 -0
  49. package/dist/theme/plugins/utilities/typography.js +69 -0
  50. package/dist/theme/presets/colors.js +166 -0
  51. package/dist/utils/datetime.js +30 -0
  52. package/package.json +41 -10
  53. package/src/components/Button/Button.styles.ts +98 -0
  54. package/src/components/Button/Button.tsx +48 -18
  55. package/src/components/Button/Buttons.stories.tsx +120 -0
  56. package/src/components/Text/Text.stories.tsx +112 -0
  57. package/src/components/Text/Text.tsx +59 -0
  58. package/src/components/TextInput/TextInput.stories.tsx +44 -0
  59. package/src/components/TextInput/TextInput.styles.ts +177 -0
  60. package/src/components/TextInput/TextInput.tsx +119 -0
  61. package/src/index.ts +21 -0
  62. package/src/stories/Typography.mdx +160 -0
  63. package/src/theme/global.css +149 -0
  64. package/src/theme/main-preset.js +159 -0
  65. package/src/theme/plugins/utilities/typography.js +69 -0
  66. package/src/theme/presets/colors.js +166 -0
  67. package/dist/main.d.ts +0 -7
  68. package/dist/main.js +0 -25
  69. package/dist/src/components/Button/Button.d.ts +0 -12
  70. package/dist/src/components/Button/Button.js +0 -10
  71. package/dist/src/components/Form/Form.js +0 -91
  72. package/dist/src/components/Form/Text.js +0 -10
  73. package/dist/src/components/Form/TextInput.js +0 -10
  74. package/dist/src/components/Table/Table.js +0 -13
  75. package/dist/src/components/Tabs/Tabs.js +0 -33
  76. package/dist/src/style.css +0 -3
  77. package/dist/src/utils/datetime.js +0 -37
  78. package/src/style.css +0 -3
  79. /package/dist/{src → cjs/types}/components/Form/Form.d.ts +0 -0
  80. /package/dist/{src → cjs/types}/components/Form/Text.d.ts +0 -0
  81. /package/dist/{src → cjs/types}/components/Form/TextInput.d.ts +0 -0
  82. /package/dist/{src → cjs/types}/components/Table/Table.d.ts +0 -0
  83. /package/dist/{src → cjs/types}/components/Tabs/Tabs.d.ts +0 -0
  84. /package/dist/{src → cjs/types}/utils/datetime.d.ts +0 -0
@@ -0,0 +1,98 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ export const buttonCva = cva(
4
+ [
5
+ // "inline-flex items-center justify-center align-middle no-underline transition-colors ease-in-out duration-300",
6
+ // "font-sans appearance-none select-none rounded-sm border font-medium tracking-[.02857em]",
7
+ // "aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:cursor-not-allowed",
8
+ "gap-2 font-bold text-white hover:bg-opacity-90 active:scale-[98%]",
9
+ ],
10
+ {
11
+ variants: {
12
+ color: {
13
+ primary: "bg-primary border-primary text-primary hover:bg-primary-80",
14
+ secondary:
15
+ "border-secondary bg-secondary-100 text-secondary-foreground hover:bg-secondary-120",
16
+ tertiary:
17
+ "border-tertiary-120 bg-tertiary-120 text-tertiary-120 hover:bg-tertiary-100",
18
+ success: "border-success bg-success text-success hover:bg-success-120",
19
+ info: "border-info bg-info text-info hover:bg-info-100",
20
+ warning:
21
+ "border-warning bg-warning text-warning hover:bg-warning-100 hover:border-warning-100",
22
+ error:
23
+ "border-error bg-error text-error hover:bg-error-120 hover:border-error-120",
24
+ },
25
+ size: {
26
+ sm: "px-3 py-1 text-sm rounded-[--btn-rounded-sm]",
27
+ md: "px-4 py-2 text-sm rounded-[--btn-rounded-md]",
28
+ lg: "px-6 py-4 text-base rounded-[--btn-rounded-lg]",
29
+ },
30
+ variant: {
31
+ solid: "border",
32
+ outline: "border bg-transparent hover:bg-opacity-20",
33
+ flat: "bg-transparent hover:bg-opacity-20",
34
+ link: "bg-transparent underline underline-offset-4 hover:bg-transparent hover:text-opacity-80",
35
+ },
36
+ disabled: {
37
+ true: "pointer-events-none border-transparent bg-secondary-110 text-secondary-130",
38
+ },
39
+ fullwidth: {
40
+ true: "w-full",
41
+ },
42
+ },
43
+ compoundVariants: [
44
+ {
45
+ variant: ["flat", "link"],
46
+ disabled: true,
47
+ class: "border-transparent bg-transparent",
48
+ },
49
+ {
50
+ variant: "solid",
51
+ color: "primary",
52
+ class: "text-primary-foreground",
53
+ },
54
+ {
55
+ variant: "solid",
56
+ color: "secondary",
57
+ class: "text-secondary-foreground",
58
+ },
59
+ {
60
+ variant: "solid",
61
+ disabled: true,
62
+ color: "secondary",
63
+ class: "text-white",
64
+ },
65
+ {
66
+ variant: "solid",
67
+ color: "tertiary",
68
+ class: "text-tertiary-foreground",
69
+ },
70
+ {
71
+ variant: "solid",
72
+ color: "success",
73
+ class: "text-success-foreground",
74
+ },
75
+ {
76
+ variant: "solid",
77
+ color: "info",
78
+ class: "text-info-foreground",
79
+ },
80
+ {
81
+ variant: "solid",
82
+ color: "warning",
83
+ class: "text-warning-foreground",
84
+ },
85
+ {
86
+ variant: "solid",
87
+ color: "error",
88
+ class: "text-error-foreground",
89
+ },
90
+ ],
91
+ defaultVariants: {
92
+ size: "md",
93
+ color: "primary",
94
+ variant: "solid",
95
+ fullwidth: true,
96
+ },
97
+ }
98
+ );
@@ -1,32 +1,62 @@
1
- import React from "react";
1
+ import React, { FC, ReactElement } from "react";
2
+ import { twMerge } from "tailwind-merge";
3
+ import { buttonCva } from "./Button.styles";
2
4
 
3
- interface ButtonProps {
4
- children: React.ReactNode;
5
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
6
- type?: "button" | "submit" | "reset";
5
+ type ButtonProps = {
6
+ title?: string;
7
+ size?: "sm" | "md" | "lg";
8
+ color?:
9
+ | "primary"
10
+ | "secondary"
11
+ | "success"
12
+ | "tertiary"
13
+ | "info"
14
+ | "warning"
15
+ | "error";
16
+ variant?: "solid" | "outline" | "flat" | "link";
7
17
  disabled?: boolean;
8
- className?: string;
9
18
  isLoading?: boolean;
10
- variant?: "primary" | "secondary";
11
- }
19
+ fullwidth?: boolean;
20
+ children?: React.ReactNode;
21
+ startIcon?: ReactElement;
22
+ endIcon?: ReactElement;
23
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>;
12
24
 
13
- const Button: React.FC<ButtonProps> = ({
25
+ const Button: FC<ButtonProps> = ({
26
+ size = "md",
27
+ color = "primary",
28
+ variant = "solid",
29
+ title,
14
30
  children,
15
- onClick,
16
- type = "button",
31
+ startIcon,
32
+ endIcon,
17
33
  disabled = false,
18
- className = "",
34
+ fullwidth = false,
19
35
  isLoading = false,
20
- variant = "primary",
36
+ className,
37
+ ...props
21
38
  }) => {
39
+ const isDisabled = disabled || isLoading;
40
+
22
41
  return (
23
42
  <button
24
- className={`btn ${className} ${variant}`}
25
- onClick={onClick}
26
- type={type}
27
- disabled={disabled || isLoading}
43
+ type="button"
44
+ {...props}
45
+ aria-disabled={isDisabled || undefined}
46
+ tabIndex={isDisabled ? -1 : 0}
47
+ className={twMerge(
48
+ buttonCva({ size, color, variant, disabled, fullwidth }),
49
+ className
50
+ )}
51
+ disabled={isDisabled}
28
52
  >
29
- {isLoading ? "Loading..." : children}
53
+ {
54
+ <>
55
+ {startIcon}
56
+ {children || title}
57
+ {endIcon}
58
+ </>
59
+ }
30
60
  </button>
31
61
  );
32
62
  };
@@ -0,0 +1,120 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+
4
+ import Button from "./Button";
5
+
6
+ // More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
7
+ const meta = {
8
+ title: "Components/Button",
9
+ component: Button,
10
+ tags: ["autodocs"],
11
+ parameters: {
12
+ // More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout
13
+ layout: "fullscreen",
14
+ },
15
+ decorators: [
16
+ (Story) => (
17
+ <div className="p-5">
18
+ <Story />
19
+ </div>
20
+ ),
21
+ ],
22
+ } satisfies Meta<typeof Button>;
23
+
24
+ export default meta;
25
+ type Story = StoryObj<typeof Button>;
26
+
27
+ export const Solid = {
28
+ args: {
29
+ title: "Button",
30
+ },
31
+ render: (args) => {
32
+ const props: typeof args = {
33
+ ...args,
34
+ className: "capitalize",
35
+ };
36
+ return (
37
+ <div className="flex gap-2">
38
+ <Button color="primary" {...props} title="primary" />
39
+ <Button color="secondary" {...props} title="secondary" />
40
+ <Button color="tertiary" {...props} title="tertiary" />
41
+ <Button color="info" {...props} title="info" />
42
+ <Button color="success" {...props} title="success" />
43
+ <Button color="warning" {...props} title="warning" />
44
+ <Button color="error" {...props} title="error" />
45
+ </div>
46
+ );
47
+ },
48
+ } satisfies Story;
49
+
50
+ export const Outline = {
51
+ args: {
52
+ title: "Button",
53
+ variant: "outline",
54
+ },
55
+ render: (args) => {
56
+ const props: typeof args = {
57
+ ...args,
58
+ className: "capitalize",
59
+ };
60
+ return (
61
+ <div className="flex gap-2">
62
+ <Button color="primary" {...props} title="primary" />
63
+ <Button color="secondary" {...props} title="secondary" />
64
+ <Button color="tertiary" {...props} title="tertiary" />
65
+ <Button color="info" {...props} title="info" />
66
+ <Button color="success" {...props} title="success" />
67
+ <Button color="warning" {...props} title="warning" />
68
+ <Button color="error" {...props} title="error" />
69
+ </div>
70
+ );
71
+ },
72
+ } satisfies Story;
73
+
74
+ export const Flat = {
75
+ args: {
76
+ title: "Button",
77
+ variant: "flat",
78
+ },
79
+ render: (args) => {
80
+ const props: typeof args = {
81
+ ...args,
82
+ className: "capitalize",
83
+ };
84
+ return (
85
+ <div className="flex gap-2">
86
+ <Button color="primary" {...props} title="primary" />
87
+ <Button color="secondary" {...props} title="secondary" />
88
+ <Button color="tertiary" {...props} title="tertiary" />
89
+ <Button color="info" {...props} title="info" />
90
+ <Button color="success" {...props} title="success" />
91
+ <Button color="warning" {...props} title="warning" />
92
+ <Button color="error" {...props} title="error" />
93
+ </div>
94
+ );
95
+ },
96
+ } satisfies Story;
97
+
98
+ export const Link = {
99
+ args: {
100
+ title: "Button",
101
+ variant: "link",
102
+ },
103
+ render: (args) => {
104
+ const props: typeof args = {
105
+ ...args,
106
+ className: "capitalize",
107
+ };
108
+ return (
109
+ <div className="flex gap-2">
110
+ <Button color="primary" {...props} title="primary" />
111
+ <Button color="secondary" {...props} title="secondary" />
112
+ <Button color="tertiary" {...props} title="tertiary" />
113
+ <Button color="info" {...props} title="info" />
114
+ <Button color="success" {...props} title="success" />
115
+ <Button color="warning" {...props} title="warning" />
116
+ <Button color="error" {...props} title="error" />
117
+ </div>
118
+ );
119
+ },
120
+ } satisfies Story;
@@ -0,0 +1,112 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+
4
+ import Text from "./Text";
5
+
6
+ // More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
7
+ const meta = {
8
+ title: "Components/Text",
9
+ component: Text,
10
+ tags: ["autodocs"],
11
+ parameters: {
12
+ // More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout
13
+ layout: "fullscreen",
14
+ },
15
+ decorators: [
16
+ (Story) => (
17
+ <div className="p-5 flex w-full">
18
+ <Story />
19
+ </div>
20
+ ),
21
+ ],
22
+ } satisfies Meta<typeof Text>;
23
+
24
+ export default meta;
25
+
26
+ const variant: any = [
27
+ "h1",
28
+ "h2",
29
+ "h3",
30
+ "h4",
31
+ "h5",
32
+ "h6",
33
+ "subtitile1",
34
+ "subtitile2",
35
+ "subtitile3",
36
+ "subtitile4",
37
+ "subtitile5",
38
+ "subtitile6",
39
+ "body1",
40
+ "body2",
41
+ "body3",
42
+ "body4",
43
+ "small1",
44
+ "small2",
45
+ "small3",
46
+ "label1",
47
+ "label2",
48
+ ];
49
+
50
+ const color = [
51
+ "primary",
52
+ "secondary",
53
+ "tertiary",
54
+ "success",
55
+ "info",
56
+ "warning",
57
+ "error",
58
+ ];
59
+
60
+ export const Default = {
61
+ args: {},
62
+ render: (args) => {
63
+ const props: typeof args = {
64
+ ...args,
65
+ };
66
+ return (
67
+ <div className="flex flex-col gap-2 gap-y-6 w-full">
68
+ {variant.map((value: any) => (
69
+ <div key={value} className="flex flex-row ">
70
+ <div className="w-[200px]">
71
+ <Text variant={value} color="primary">
72
+ {value}
73
+ </Text>
74
+ </div>
75
+ <div className="w-full">
76
+ <Text variant={value} color="primary">
77
+ Lorem ipsum dolor sit amet, adipiscing elit.
78
+ </Text>
79
+ </div>
80
+ </div>
81
+ ))}
82
+ </div>
83
+ );
84
+ },
85
+ } satisfies StoryObj;
86
+
87
+ export const Color = {
88
+ args: {},
89
+ render: (args) => {
90
+ const props: typeof args = {
91
+ ...args,
92
+ };
93
+ return (
94
+ <div className="flex flex-col gap-2 gap-y-6 w-full">
95
+ {color.map((color: any, i) => (
96
+ <div key={color} className="flex flex-row ">
97
+ <div className="w-[400px]">
98
+ <Text variant={variant?.[i]} color={color}>
99
+ {color}
100
+ </Text>
101
+ </div>
102
+ <div className="w-full">
103
+ <Text variant={variant?.[i]} color={color}>
104
+ Lorem ipsum dolor sit amet, adipiscing elit.
105
+ </Text>
106
+ </div>
107
+ </div>
108
+ ))}
109
+ </div>
110
+ );
111
+ },
112
+ } satisfies StoryObj;
@@ -0,0 +1,59 @@
1
+ import React, { FC } from "react";
2
+
3
+ type TextProps = {
4
+ variant?:
5
+ | "h1"
6
+ | "h2"
7
+ | "h3"
8
+ | "h4"
9
+ | "h5"
10
+ | "h6"
11
+ | "subtitile1"
12
+ | "subtitile2"
13
+ | "subtitile3"
14
+ | "subtitile4"
15
+ | "subtitile5"
16
+ | "subtitile6"
17
+ | "body1"
18
+ | "body2"
19
+ | "body3"
20
+ | "body4"
21
+ | "small1"
22
+ | "small2"
23
+ | "small3"
24
+ | "label1"
25
+ | "label2";
26
+ color?:
27
+ | "primary"
28
+ | "secondary"
29
+ | "success"
30
+ | "tertiary"
31
+ | "info"
32
+ | "warning"
33
+ | "error";
34
+ children?: React.ReactNode;
35
+ className?: string;
36
+ tag?: keyof JSX.IntrinsicElements;
37
+ style?: React.CSSProperties;
38
+ id?: string;
39
+ };
40
+
41
+ const Text: FC<TextProps> = ({
42
+ variant = "body1",
43
+ tag: Tag = "p",
44
+ children,
45
+ className,
46
+ color,
47
+ style,
48
+ }) => {
49
+ return (
50
+ <Tag
51
+ className={`typography-${variant} text-${color} ${className}`}
52
+ style={style}
53
+ >
54
+ {children}
55
+ </Tag>
56
+ );
57
+ };
58
+
59
+ export default Text;
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import TextInput from "./TextInput";
4
+
5
+ // More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
6
+ const meta = {
7
+ title: "Components/TextInput",
8
+ component: TextInput,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ // More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout
12
+ layout: "fullscreen",
13
+ },
14
+ decorators: [
15
+ (Story) => (
16
+ <div className="p-5 flex w-full">
17
+ <Story />
18
+ </div>
19
+ ),
20
+ ],
21
+ } satisfies Meta<typeof TextInput>;
22
+
23
+ export default meta;
24
+
25
+ export const Default = {
26
+ args: {
27
+ label: "Lorem Ipsum",
28
+ // value: "Lorem Ipsum",
29
+ fullwidth: true,
30
+ },
31
+ render: (args) => {
32
+ console.log("args ", args);
33
+ const props: typeof args = {
34
+ ...args,
35
+ };
36
+ return (
37
+ <div className="flex flex-row gap-4 w-full">
38
+ <TextInput id="1" placeholder="placeholder" size="lg" {...args} />
39
+ <TextInput id="2" placeholder="placeholder" size="md" {...args} />
40
+ <TextInput id="3" placeholder="placeholder" size="sm" {...args} />
41
+ </div>
42
+ );
43
+ },
44
+ } satisfies StoryObj;
@@ -0,0 +1,177 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ export const inputVariant = cva(
4
+ [
5
+ "border-0 outline-none",
6
+ "p-1 flex",
7
+ "peer text-black placeholder:text-transparent",
8
+ ],
9
+ {
10
+ variants: {
11
+ size: {
12
+ sm: "p-2 px-3 typography-small1",
13
+ md: "py-2 px-3 typography-subtitile4",
14
+ lg: "p-4 typography-subtitile1",
15
+ },
16
+ rounded: {
17
+ none: "rounded-none",
18
+ normal: "rounded-xl",
19
+ full: "rounded-full",
20
+ },
21
+ variant: {
22
+ flat: "",
23
+ outline:
24
+ "ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-2 focus:ring-inset focus:ring-input-active",
25
+ underline:
26
+ "border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke",
27
+ },
28
+ fullwidth: {
29
+ true: "w-full",
30
+ },
31
+ disabled: {
32
+ true: "text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled",
33
+ },
34
+ error: {
35
+ true: "ring-error",
36
+ },
37
+ hasClearIcon: {
38
+ true: "",
39
+ },
40
+ },
41
+ compoundVariants: [
42
+ {
43
+ variant: "underline",
44
+ className: "rounded-none",
45
+ },
46
+ {
47
+ hasClearIcon: true,
48
+ size: "sm",
49
+ class: "focus:pe-6",
50
+ },
51
+ {
52
+ hasClearIcon: true,
53
+ size: "md",
54
+ class: "focus:pe-8",
55
+ },
56
+ {
57
+ hasClearIcon: true,
58
+ size: "lg",
59
+ class: "focus:pe-10",
60
+ },
61
+ ],
62
+ defaultVariants: {
63
+ size: "md",
64
+ variant: "outline",
65
+ rounded: "normal",
66
+ fullwidth: false,
67
+ disabled: false,
68
+ error: false,
69
+ hasClearIcon: false,
70
+ },
71
+ }
72
+ );
73
+
74
+ export const labelVariant = cva(
75
+ [
76
+ "absolute block transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background",
77
+ ],
78
+ {
79
+ variants: {
80
+ size: {
81
+ sm: [
82
+ "left-3 top-2 typography-small1 peer-focus:-top-1.5 peer-focus:typography-label2",
83
+ "bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label2",
84
+ ],
85
+ md: [
86
+ "left-3 top-2 typography-subtitile4 peer-focus:-top-1.5 peer-focus:typography-label1",
87
+ "bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1",
88
+ ],
89
+ lg: [
90
+ "left-4 top-4 typography-subtitile1 peer-focus:-top-1.5 peer-focus:typography-label1",
91
+ "bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1",
92
+ ],
93
+ },
94
+ disabled: {
95
+ true: "text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled",
96
+ },
97
+ error: {
98
+ true: "ring-error",
99
+ },
100
+ isFloating: {
101
+ true: "-top-1.5 typography-label1 bg-input-label-background",
102
+ },
103
+ },
104
+ compoundVariants: [
105
+ {
106
+ size: "sm",
107
+ isFloating: true,
108
+ class: "-top-1.5 typography-label2 bg-input-label-background",
109
+ },
110
+ ],
111
+ defaultVariants: {
112
+ size: "md",
113
+ disabled: false,
114
+ error: false,
115
+ isFloating: false,
116
+ },
117
+ }
118
+ );
119
+
120
+ export const helperTextVariant = cva(
121
+ ["text-small1 flex flex-row items-center gap-1"],
122
+ {
123
+ variants: {
124
+ size: {
125
+ sm: "mt-1",
126
+ md: "mt-[6px]",
127
+ lg: "mt-[6px]",
128
+ },
129
+ disabled: {
130
+ true: "text-input-text-disabled",
131
+ },
132
+ error: {
133
+ true: "text-error",
134
+ false: "text-input-text",
135
+ },
136
+ },
137
+ defaultVariants: {
138
+ size: "md",
139
+ disabled: false,
140
+ error: false,
141
+ },
142
+ }
143
+ );
144
+
145
+ export const iconWrapperVariant = cva(
146
+ [
147
+ "absolute inset-y-0 right-0 items-center justify-center hidden peer-focus:flex",
148
+ ],
149
+ {
150
+ variants: {
151
+ size: {
152
+ sm: "mr-2",
153
+ md: "mr-3",
154
+ lg: "mr-4",
155
+ },
156
+ },
157
+ defaultVariants: {
158
+ size: "md",
159
+ },
160
+ }
161
+ );
162
+
163
+ export const iconVariant = cva(
164
+ ["cursor-pointer z-50 fill-input-stroke-active hover:fill-input-text"],
165
+ {
166
+ variants: {
167
+ size: {
168
+ sm: "size-3",
169
+ md: "size-4",
170
+ lg: "size-5",
171
+ },
172
+ },
173
+ defaultVariants: {
174
+ size: "md",
175
+ },
176
+ }
177
+ );