diff --git a/.changeset/dirty-roses-happen.md b/.changeset/dirty-roses-happen.md new file mode 100644 index 0000000..a8a9a6e --- /dev/null +++ b/.changeset/dirty-roses-happen.md @@ -0,0 +1,5 @@ +--- +'@groovy-box/ui': patch +--- + +framer-motion animation diff --git a/apps/ui/lib/components/Button/index.tsx b/apps/ui/lib/components/Button/index.tsx index 2d07ff1..7438fd6 100644 --- a/apps/ui/lib/components/Button/index.tsx +++ b/apps/ui/lib/components/Button/index.tsx @@ -5,52 +5,52 @@ import { cva, type VariantProps } from 'class-variance-authority'; import { cn } from '@utils/utils'; const buttonVariants = cva( - 'grv-inline-flex grv-items-center grv-justify-center grv-whitespace-nowrap grv-rounded-md grv-text-sm grv-font-medium grv-ring-offset-background grv-transition-colors focus-visible:grv-outline-none focus-visible:grv-ring-2 focus-visible:grv-ring-ring focus-visible:grv-ring-offset-2 disabled:grv-pointer-events-none disabled:grv-opacity-50', - { - variants: { - variant: { - default: - 'grv-bg-primary-700 grv-text-text-primary hover:grv-bg-primary-500 grv-border-none', - destructive: - 'grv-bg-error-900 grv-text-text-primary hover:grv-bg-error-700 grv-border-none grv-outline-0 grv-shadow-none', - outline: - ' grv-border-none hover:grv-bg-bgopacity grv-text-accent grv-bg-primary-100/0 grv-outline grv-font-medium grv-outline-2 grv-outline-primary-500 grv-shadow-none', - secondary: - 'grv-bg-secondary-700 grv-text-text-primary hover:grv-bg-secondary-500 grv-border-none grv-outline-0 grv-shadow-none', - link: 'grv-text-accent grv-underline-offset-4 hover:grv-underline grv-bg-primary-100/0 grv-font-medium grv-border-none hover:grv-cursor-pointer p-0 m-0', - }, - size: { - default: 'grv-h-10 grv-px-4 grv-py-2', - sm: 'grv-h-9 grv-rounded-md grv-px-3', - lg: 'grv-h-11 grv-rounded-md grv-px-8', - icon: 'grv-h-10 grv-w-10', - }, - }, - defaultVariants: { - variant: 'default', - size: 'default', - }, - } + 'grv-inline-flex grv-items-center grv-justify-center grv-whitespace-nowrap grv-rounded-md grv-text-sm grv-font-medium grv-ring-offset-background grv-transition-colors focus-visible:grv-outline-none focus-visible:grv-ring-2 focus-visible:grv-ring-ring focus-visible:grv-ring-offset-2 disabled:grv-pointer-events-none disabled:grv-opacity-50', + { + variants: { + variant: { + default: + 'grv-bg-primary-700 grv-text-text-primary hover:grv-bg-primary-500 grv-border-none', + destructive: + 'grv-bg-error-900 grv-text-text-primary hover:grv-bg-error-700 grv-border-none grv-outline-0 grv-shadow-none', + outline: + ' grv-border-none hover:grv-bg-bgopacity grv-text-accent grv-bg-primary-100/0 grv-outline grv-font-medium grv-outline-2 grv-outline-primary-500 grv-shadow-none', + secondary: + 'grv-bg-secondary-700 grv-text-text-primary hover:grv-bg-secondary-500 grv-border-none grv-outline-0 grv-shadow-none', + link: 'grv-text-accent grv-underline-offset-4 hover:grv-underline grv-bg-primary-100/0 grv-font-medium grv-border-none hover:grv-cursor-pointer p-0 m-0', + }, + size: { + default: 'grv-h-10 grv-px-4 grv-py-2', + sm: 'grv-h-9 grv-rounded-md grv-px-3', + lg: 'grv-h-11 grv-rounded-md grv-px-8', + icon: 'grv-h-10 grv-w-10', + }, + }, + defaultVariants: { + variant: 'default', + size: 'default', + }, + } ); export interface ButtonProps - extends React.ButtonHTMLAttributes, + extends React.ButtonHTMLAttributes, VariantProps { - asChild?: boolean; + asChild?: boolean; } const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : 'button'; + ({ className, variant, size, asChild = false, ...props }, ref) => { + const Comp = asChild ? Slot : 'button'; - return ( - - ); - } + return ( + + ); + } ); Button.displayName = 'Button'; diff --git a/apps/ui/lib/components/Chip/Chip.tsx b/apps/ui/lib/components/Chip/Chip.tsx index fdac16d..1791133 100644 --- a/apps/ui/lib/components/Chip/Chip.tsx +++ b/apps/ui/lib/components/Chip/Chip.tsx @@ -6,132 +6,131 @@ import { X as CloseIcon } from 'lucide-react'; import { cn } from '@utils/utils'; const chipVariants = cva( - 'grv-inline-flex ui grv-items-center grv-rounded-full grv-text-sm grv-font-medium grv-transition-colors focus:grv-outline-none focus:grv-ring-2 grv-ring-ring grv-ring-offset-2', - { - variants: { - variant: { - filled: 'grv-bg-primary-500 ui', - outlined: 'grv-border-2 grv-border-solid grv-border-accent ui', - }, - size: { - sm: 'grv-h-6 grv-px-3 ui', - md: 'grv-h-8 grv-px-4 ui', - lg: 'grv-h-10 grv-px-5 ui', - }, - clickable: { - true: 'grv-cursor-pointer', - false: '', - }, - }, - defaultVariants: { - variant: 'filled', - size: 'md', - clickable: false, - }, - } + 'grv-inline-flex ui grv-items-center grv-rounded-full grv-text-sm grv-font-medium grv-transition-colors focus:grv-outline-none focus:grv-ring-2 grv-ring-ring grv-ring-offset-2', + { + variants: { + variant: { + filled: 'grv-bg-primary-500 ui', + outlined: 'grv-border-2 grv-border-solid grv-border-accent ui', + }, + size: { + sm: 'grv-h-6 grv-px-3 ui', + md: 'grv-h-8 grv-px-4 ui', + lg: 'grv-h-10 grv-px-5 ui', + }, + clickable: { + true: 'grv-cursor-pointer', + false: '', + }, + }, + defaultVariants: { + variant: 'filled', + size: 'md', + clickable: false, + }, + } ); export interface ChipDivProps - extends React.HTMLAttributes, + extends React.HTMLAttributes, VariantProps { - onDelete?: () => void; - as?: React.ElementType; - href?: never; - beforeChildren?: React.ReactNode; - afterChildren?: React.ReactNode; + onDelete?: () => void; + as?: React.ElementType; + href?: never; + beforeChildren?: React.ReactNode; + afterChildren?: React.ReactNode; } export interface ChipAnchorProps - extends React.HTMLAttributes, + extends React.HTMLAttributes, VariantProps { - onDelete?: () => void; - href?: string; - target?: string; - as?: React.ElementType; - beforeChildren?: React.ReactNode; - afterChildren?: React.ReactNode; + onDelete?: () => void; + href?: string; + target?: string; + as?: React.ElementType; + beforeChildren?: React.ReactNode; + afterChildren?: React.ReactNode; } export type ChipProps = ChipAnchorProps | ChipDivProps; const Chip = React.forwardRef( - ( - { - className, - variant, - size, - clickable, - onDelete, - href, - as, - beforeChildren, - afterChildren, - children, - ...props - }, - ref - ) => { - const Component = as || (href ? 'a' : 'div'); - const isClickable = Boolean(clickable || href || props.onClick); - - const textColor = - variant === 'outlined' ? 'grv-text-accent' : 'grv-text-text-primary'; + ( + { + className, + variant, + size, + clickable, + onDelete, + href, + as, + beforeChildren, + afterChildren, + children, + ...props + }, + ref + ) => { + const Component = as || (href ? 'a' : 'div'); + const isClickable = Boolean(clickable || href || props.onClick); + const textColor = + variant === 'outlined' ? 'grv-text-accent' : 'grv-text-text-primary'; - const textSize = - size === 'sm' - ? 'grv-text-[10px]' - : size === 'md' - ? 'grv-text-[12px]' - : 'grv-text-[14px]'; + const textSize = + size === 'sm' + ? 'grv-text-[10px]' + : size === 'md' + ? 'grv-text-[12px]' + : 'grv-text-[14px]'; - return ( - - {beforeChildren && ( -
- {beforeChildren} -
- )} -
{children}
- {afterChildren && ( -
- {afterChildren} -
- )} - {onDelete && ( -
{ - e.stopPropagation(); - onDelete(); - }} - > - -
- )} -
- ); - } + return ( + + {beforeChildren && ( +
+ {beforeChildren} +
+ )} +
{children}
+ {afterChildren && ( +
+ {afterChildren} +
+ )} + {onDelete && ( +
{ + e.stopPropagation(); + onDelete(); + }} + > + +
+ )} +
+ ); + } ); Chip.displayName = 'Chip'; diff --git a/apps/ui/lib/components/Modal/Modal.stories.tsx b/apps/ui/lib/components/Modal/Modal.stories.tsx index bc4b8ac..032b743 100644 --- a/apps/ui/lib/components/Modal/Modal.stories.tsx +++ b/apps/ui/lib/components/Modal/Modal.stories.tsx @@ -1,12 +1,12 @@ import { - Dialog, - DialogTrigger, - DialogContent, - DialogHeader, - DialogFooter, - DialogTitle, - DialogDescription, - DialogClose, + Dialog, + DialogTrigger, + DialogContent, + DialogHeader, + DialogFooter, + DialogTitle, + DialogDescription, + DialogClose, } from './Modal'; import { Text } from '../Typography'; import { Button } from '../Button'; @@ -17,157 +17,156 @@ import { useState } from 'react'; import { Eye, EyeOff, Lock, Mail } from 'lucide-react'; export default { - title: 'Components/Modal', - component: Dialog, - decorators: [withGlobalStyles], + title: 'Components/Modal', + component: Dialog, + decorators: [withGlobalStyles], }; const BasicDialog = () => ( - - - - - - - - - Dialog Title - - This is a description for the dialog content. - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam pulvinar - risus non rikus. - - - + + + + + + + + + Dialog Title + + This is a description for the dialog content. + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam pulvinar + risus non rikus. + + + ); export const Basic = () => ; const ModalWithFooter = () => ( - - - - - - - - - Dialog Title - - This is a description for the dialog content. - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam pulvinar - risus non rikus. - - - - - - - + + + + + + + + + Dialog Title + + This is a description for the dialog content. + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam pulvinar + risus non rikus. + + + + + + + ); export const WithFooter = () => ; const ModalWithImage = () => ( - - - - - - - - Hello 2025 - - - - Random Image - - - Wish you a very happy new year. May this year bring you joy and - happiness. - - - + + + + + + + + Hello 2025 + + + + Random Image + + + Wish you a very happy new year. May this year bring you joy and + happiness. + + + ); export const WithImage = () => ; export const LoginModal = { - render: () => { - const [showPassword, setShowPassword] = useState(false); - return ( - - - - - - - - Login - - Please enter your credentials to login. - - -
-
- - - - - - - - Please enter a valid email address - - -
-
- - - - - - - - - - -
- -
-
-
- ) - } + render: () => { + const [showPassword, setShowPassword] = useState(false); + return ( + + + + + + + + Login + + Please enter your credentials to login. + + +
+
+ + + + + + + + Please enter a valid email address + + +
+
+ + + + + + + + + + +
+ +
+
+
+ ); + }, }; - diff --git a/apps/ui/lib/components/Textfield/Textfield.stories.tsx b/apps/ui/lib/components/Textfield/Textfield.stories.tsx index 65e4777..730d298 100644 --- a/apps/ui/lib/components/Textfield/Textfield.stories.tsx +++ b/apps/ui/lib/components/Textfield/Textfield.stories.tsx @@ -1,29 +1,38 @@ import type { Meta, StoryObj } from '@storybook/react'; import { TextField } from './index'; -import { Mail, Lock, Eye, EyeOff, Search, User, Check, AlertCircle } from 'lucide-react'; +import { + Mail, + Lock, + Eye, + EyeOff, + Search, + User, + Check, + AlertCircle, +} from 'lucide-react'; import { useState } from 'react'; import { Button } from '../Button'; const meta: Meta = { - title: 'Components/TextField', - component: TextField.Root, - tags: ['autodocs'], - argTypes: { - variant: { - control: 'select', - options: ['standard', 'outlined', 'filled'], - description: 'The visual style of the text field', - }, - size: { - control: 'select', - options: ['sm', 'md', 'lg'], - description: 'The size of the text field', - }, - error: { - control: 'boolean', - description: 'Whether the text field is in an error state', - }, + title: 'Components/TextField', + component: TextField.Root, + tags: ['autodocs'], + argTypes: { + variant: { + control: 'select', + options: ['standard', 'outlined', 'filled'], + description: 'The visual style of the text field', }, + size: { + control: 'select', + options: ['sm', 'md', 'lg'], + description: 'The size of the text field', + }, + error: { + control: 'boolean', + description: 'Whether the text field is in an error state', + }, + }, }; export default meta; @@ -31,189 +40,177 @@ type Story = StoryObj; // Basic TextField export const Basic: Story = { - render: (args) => ( - - - - ), + render: (args) => ( + + + + ), }; // With Icons export const WithIcons: Story = { - render: () => ( -
- - - - - - - - - - - - - - - - -
- ), + render: () => ( +
+ + + + + + + + + + + + + + + + +
+ ), }; // Password Input with Toggle export const PasswordInput: Story = { - render: () => { - const [showPassword, setShowPassword] = useState(false); - return ( - - - - - - - - - - ); - }, + render: () => { + const [showPassword, setShowPassword] = useState(false); + return ( + + + + + + + + + + ); + }, }; // Different Variants export const Variants: Story = { - render: () => ( -
- - - - - - - - - - - -
- ), + render: () => ( +
+ + + + + + + + + + + +
+ ), }; // Different Sizes export const Sizes: Story = { - render: () => ( -
- - - - - - - - - - - -
- ), + render: () => ( +
+ + + + + + + + + + + +
+ ), }; // With Helper Text export const WithHelperText: Story = { - render: () => ( -
- - - - This is a helpful message - - - - - - - This field is required - - -
- ), + render: () => ( +
+ + + This is a helpful message + + + + + This field is required + +
+ ), }; // Form Example export const FormExample: Story = { - render: () => ( -
- - - - - - - - - - Username is available - - - - - - - - - - Please enter a valid email address - - - - - - - - - - Must be at least 8 characters - - -
- ), + render: () => ( +
+ + + + + + + + + Username is available + + + + + + + + + Please enter a valid email address + + + + + + + + + + Must be at least 8 characters + + +
+ ), }; // Disabled State export const DisabledStates: Story = { - render: () => ( -
- - - - - - - - - - - - - -
- ), -}; \ No newline at end of file + render: () => ( +
+ + + + + + + + + + + + + +
+ ), +}; diff --git a/apps/ui/lib/components/Textfield/index.tsx b/apps/ui/lib/components/Textfield/index.tsx index 1ca5296..8e62359 100644 --- a/apps/ui/lib/components/Textfield/index.tsx +++ b/apps/ui/lib/components/Textfield/index.tsx @@ -5,211 +5,234 @@ import { cn } from '@utils/utils'; import { Text } from '../Typography'; const textFieldVariants = cva( - 'grv-w-full grv-rounded-md grv-transition-all grv-duration-200 grv-ease-in-out', - { - variants: { - variant: { - filled: 'grv-bg-secondary-100 focus:bg-primary-50 grv-border-b-2 grv-border-primary focus:grv-outline-secondary-500 focus:grv-outline-2 focus:grv-border-secondary-500 ', - outlined: 'grv-bg-transparent grv-outline-2 focus:grv-outline-secondary-300 focus:border-primary-500 focus:grv-outline-2 focus:grv-border-secondary-500', - standard: 'grv-bg-transparent grv-border-none grv-outline-none grv-relative', - }, - size: { - sm: 'grv-py-1 grv-px-2 grv-text-sm', - md: 'grv-py-2 grv-px-3 grv-text-base', - lg: 'grv-py-3 grv-px-4 grv-text-lg', - }, - error: { - true: 'grv-border-error-500 focus:grv-border-error-500', - false: '', - }, - }, - defaultVariants: { - variant: 'standard', - size: 'md', - error: false, - }, - } + 'grv-w-full grv-rounded-md grv-transition-all grv-duration-200 grv-ease-in-out', + { + variants: { + variant: { + filled: + 'grv-bg-secondary-100 focus:bg-primary-50 grv-border-b-2 grv-border-primary focus:grv-outline-secondary-500 focus:grv-outline-2 focus:grv-border-secondary-500 ', + outlined: + 'grv-bg-transparent grv-outline-2 focus:grv-outline-secondary-300 focus:border-primary-500 focus:grv-outline-2 focus:grv-border-secondary-500', + standard: + 'grv-bg-transparent grv-border-none grv-outline-none grv-relative', + }, + size: { + sm: 'grv-py-1 grv-px-2 grv-text-sm', + md: 'grv-py-2 grv-px-3 grv-text-base', + lg: 'grv-py-3 grv-px-4 grv-text-lg', + }, + error: { + true: 'grv-border-error-500 focus:grv-border-error-500', + false: '', + }, + }, + defaultVariants: { + variant: 'standard', + size: 'md', + error: false, + }, + } ); type TextFieldContextType = { - variant?: VariantProps['variant']; - size?: VariantProps['size']; - error?: boolean; - isFocused: boolean; - setIsFocused: (value: boolean) => void; + variant?: VariantProps['variant']; + size?: VariantProps['size']; + error?: boolean; + isFocused: boolean; + setIsFocused: (value: boolean) => void; }; -const TextFieldContext = createContext(undefined); +const TextFieldContext = createContext( + undefined +); const useTextField = () => { - const context = useContext(TextFieldContext); - if (!context) { - throw new Error('TextField components must be used within a TextField.Root'); - } - return context; + const context = useContext(TextFieldContext); + if (!context) { + throw new Error( + 'TextField components must be used within a TextField.Root' + ); + } + return context; }; interface TextFieldRootProps extends MotionProps { - children: React.ReactNode; - variant?: VariantProps['variant']; - size?: VariantProps['size']; - error?: boolean; - className?: string; + children: React.ReactNode; + variant?: VariantProps['variant']; + size?: VariantProps['size']; + error?: boolean; + className?: string; } -interface TextFieldInputProps extends Omit, 'size'> { - className?: string; +interface TextFieldInputProps + extends Omit, 'size'> { + className?: string; } interface TextFieldIconProps { - children: React.ReactNode; - position: 'start' | 'end'; - className?: string; + children: React.ReactNode; + position: 'start' | 'end'; + className?: string; } interface TextFieldHelperTextProps { - children: React.ReactNode; - className?: string; + children: React.ReactNode; + className?: string; } -const Root = ({ children, variant, size, error = false, className, ...props }: TextFieldRootProps) => { - const [isFocused, setIsFocused] = useState(false); - - const containerVariants = { - initial: { scale: 1 }, - focus: { scale: 1.01 }, - }; - - const dashVariants = { - initial: { - scaleX: 1, - backgroundColor: '#e5e7eb' - }, - focus: { - scaleX: 1, - backgroundColor: '#3b82f6' - }, - }; - - return ( - -
- -
- {children} -
- {variant === 'standard' && ( - - )} - -
-
- ); +const Root = ({ + children, + variant, + size, + error = false, + className, + ...props +}: TextFieldRootProps) => { + const [isFocused, setIsFocused] = useState(false); + + const containerVariants = { + initial: { scale: 1 }, + focus: { scale: 1.01 }, + }; + + const dashVariants = { + initial: { + scaleX: 1, + backgroundColor: '#e5e7eb', + }, + focus: { + scaleX: 1, + backgroundColor: '#3b82f6', + }, + }; + + return ( + +
+ +
{children}
+ {variant === 'standard' && ( + + )} + +
+
+ ); }; const Input = forwardRef( - ({ className, type = 'text', placeholder, disabled, required, readOnly, onFocus, onBlur, ...props }, ref) => { - const { variant, size, error, setIsFocused } = useTextField(); - - return ( - { - setIsFocused(true); - onFocus?.(e); - }} - onBlur={(e) => { - setIsFocused(false); - onBlur?.(e); - }} - {...props} - /> - ); - } -); - -const Icon = ({ children, position, className }: TextFieldIconProps) => { - const { isFocused } = useTextField(); - - const iconVariants = { - initial: { opacity: 0.7 }, - focus: { opacity: 1 }, - }; + ( + { + className, + type = 'text', + placeholder, + disabled, + required, + readOnly, + onFocus, + onBlur, + ...props + }, + ref + ) => { + const { variant, size, error, setIsFocused } = useTextField(); return ( - - {children} - + { + setIsFocused(true); + onFocus?.(e); + }} + onBlur={(e) => { + setIsFocused(false); + onBlur?.(e); + }} + {...props} + /> ); + } +); + +const Icon = ({ children, position, className }: TextFieldIconProps) => { + const { isFocused } = useTextField(); + + const iconVariants = { + initial: { opacity: 0.7 }, + focus: { opacity: 1 }, + }; + + return ( + + {children} + + ); }; const HelperText = ({ children, className }: TextFieldHelperTextProps) => { - const { error } = useTextField(); - - return ( - - - - {children} - - - - ); + const { error } = useTextField(); + + return ( + + + {children} + + + ); }; export const TextField = { - Root, - Input: Input, - Icon, - HelperText, + Root, + Input: Input, + Icon, + HelperText, }; -Input.displayName = 'TextField.Input'; \ No newline at end of file +Input.displayName = 'TextField.Input'; diff --git a/apps/ui/lib/components/Typography/Typography.stories.tsx b/apps/ui/lib/components/Typography/Typography.stories.tsx index 834b414..4b8f1d4 100644 --- a/apps/ui/lib/components/Typography/Typography.stories.tsx +++ b/apps/ui/lib/components/Typography/Typography.stories.tsx @@ -1,292 +1,275 @@ import { Text } from '../..'; export default { - title: 'Components/Text', - component: Text, - parameters: { - layout: 'centered', + title: 'Components/Text', + component: Text, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], + argTypes: { + variant: { + control: { + type: 'select', + options: [ + 'body-1', + 'body-2', + 'body-3', + 'button-1', + 'button-2', + 'button-3', + 'heading-1', + 'heading-2', + 'heading-3', + 'heading-4', + 'heading-5', + 'heading-6', + 'label-1', + 'label-2', + 'label-2-strong', + 'label-3', + 'subtitle-1', + 'subtitle-2', + 'subtitle-3', + ], + }, + defaultValue: 'body-1', + description: 'The variant of the Text component.', }, - tags: ['autodocs'], - argTypes: { - variant: { - control: { - type: 'select', - options: [ - 'body-1', - 'body-2', - 'body-3', - 'button-1', - 'button-2', - 'button-3', - 'heading-1', - 'heading-2', - 'heading-3', - 'heading-4', - 'heading-5', - 'heading-6', - 'label-1', - 'label-2', - 'label-2-strong', - 'label-3', - 'subtitle-1', - 'subtitle-2', - 'subtitle-3', - ], - }, - defaultValue: 'body-1', - description: 'The variant of the Text component.', - }, - alignment: { - control: { - type: 'select', - options: ['left', 'right', 'center', 'justify'], - }, - defaultValue: 'left', - description: 'The text alignment of the Text component.', - }, - color: { - control: 'color', - defaultValue: '#2A2C35', - description: 'The color of the text in the Text component.', - }, - asChild: { - control: 'text', - description: - 'The type of child element to render within the Text component.', - }, - children: { - control: 'text', - description: 'The text content of the Text component.', - }, + alignment: { + control: { + type: 'select', + options: ['left', 'right', 'center', 'justify'], + }, + defaultValue: 'left', + description: 'The text alignment of the Text component.', }, + color: { + control: 'color', + defaultValue: '#2A2C35', + description: 'The color of the text in the Text component.', + }, + asChild: { + control: 'text', + description: + 'The type of child element to render within the Text component.', + }, + children: { + control: 'text', + description: 'The text content of the Text component.', + }, + }, }; - export const Default = () => ( - + ); // Combined Story export const AllVariants = () => { - return ( - <> - {/* Body-1 */} -
- - body-1 - -
+ return ( + <> + {/* Body-1 */} +
+ + body-1 + +
- {/* Body-2 */} -
- - body-2 - -
+ {/* Body-2 */} +
+ + body-2 + +
- {/* Body-3 */} -
- - body-3 - -
+ {/* Body-3 */} +
+ + body-3 + +
- {/* Button-1 */} -
- - Button-1 - -
+ {/* Button-1 */} +
+ + Button-1 + +
- {/* Button-2 */} -
- - Button-2 - -
+ {/* Button-2 */} +
+ + Button-2 + +
- {/* Heading-1 */} -
- - Heading-1 - -
+ {/* Heading-1 */} +
+ + Heading-1 + +
- {/* Heading-2 */} -
- - Heading-2 - -
+ {/* Heading-2 */} +
+ + Heading-2 + +
- {/* Heading-3 */} -
- - Heading-3 - -
+ {/* Heading-3 */} +
+ + Heading-3 + +
- {/* Heading-4 */} -
- - Heading-4 - -
+ {/* Heading-4 */} +
+ + Heading-4 + +
- {/* Heading-5 */} -
- - Heading-5 - -
+ {/* Heading-5 */} +
+ + Heading-5 + +
- {/* Heading-6 */} -
- - Heading-6 - -
+ {/* Heading-6 */} +
+ + Heading-6 + +
- {/* Label-1 */} -
- - label-1 - -
+ {/* Label-1 */} +
+ + label-1 + +
- {/* Label-2 */} -
- - label-2 - -
+ {/* Label-2 */} +
+ + label-2 + +
- {/* Subtitle-1 */} -
- - subtitle-1 - -
+ {/* Subtitle-1 */} +
+ + subtitle-1 + +
- {/* Subtitle-2*/} -
- - subtitle-2 - -
+ {/* Subtitle-2*/} +
+ + subtitle-2 + +
- {/* Subtitle-3 */} -
- - subtitle-3 - -
- - ); + {/* Subtitle-3 */} +
+ + subtitle-3 + +
+ + ); }; - export const withTailwind = () => { - return ( -
- - With extensible tailwind classes - -
- ); + return ( +
+ + With extensible tailwind classes + +
+ ); }; export const withTailwindAndVariant = () => { - return ( -
- - with tailwind classes and variant - -
- ); + return ( +
+ + with tailwind classes and variant + +
+ ); }; export const withTailwindAndVariant2 = () => { - return ( -
- - with tailwind classes and variant - -
- ); + return ( +
+ + with tailwind classes and variant + +
+ ); }; export const AlignmentCenter = () => ( - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. - + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo + consequat. + ); // Alignment Left export const AlignmentLeft = () => ( - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi. - + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi. + ); // Alignment Right export const AlignmentRight = () => ( - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi. - + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi. + ); // Alignment Justify export const AlignmentJustify = () => ( - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi. - + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi. + ); // Max Lines Example export const MaxLinesEllipsis = () => ( - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi. - + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi. + ); // As Child Example export const AsChildExample = () => ( - -

This is heading 1

-
-); \ No newline at end of file + +

This is heading 1

+
+); diff --git a/apps/ui/package.json b/apps/ui/package.json index b2e8b98..a3f706c 100644 --- a/apps/ui/package.json +++ b/apps/ui/package.json @@ -49,6 +49,7 @@ "@radix-ui/react-select": "^2.0.0", "class-variance-authority": "^0.7.0", "classnames": "^2.5.1", + "framer-motion": "^11.17.0", "lucide-react": "^0.377.0", "postcss-prefix-selector": "^1.16.1", "tailwind-merge": "^2.3.0", diff --git a/package-lock.json b/package-lock.json index 76549d2..8a6e418 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,6 +90,7 @@ "@radix-ui/react-select": "^2.0.0", "class-variance-authority": "^0.7.0", "classnames": "^2.5.1", + "framer-motion": "^11.17.0", "lucide-react": "^0.377.0", "postcss-prefix-selector": "^1.16.1", "tailwind-merge": "^2.3.0", @@ -17059,16 +17060,18 @@ } }, "node_modules/framer-motion": { - "version": "11.5.6", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.5.6.tgz", - "integrity": "sha512-JMwUpAxv/DWgul9vPgX0ElKn0G66sUc6O9tOXsYwn3zxwvhxFljSXC0XT2QCzuTYBshwC8nyDAa1SYcV0Ldbhw==", + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.17.0.tgz", + "integrity": "sha512-uTNLH9JPMD3ad14WBt3KYRTR+If4tGPLgKTKTIIPaEBMkvazs6EkWNcmCh65qA/tyinOqIbQiuCorXX0qQsNoQ==", "dependencies": { + "motion-dom": "^11.16.4", + "motion-utils": "^11.16.0", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@emotion/is-prop-valid": { @@ -22584,6 +22587,19 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/motion-dom": { + "version": "11.16.4", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-11.16.4.tgz", + "integrity": "sha512-2wuCie206pCiP2K23uvwJeci4pMFfyQKpWI0Vy6HrCTDzDCer4TsYtT7IVnuGbDeoIV37UuZiUr6SZMHEc1Vww==", + "dependencies": { + "motion-utils": "^11.16.0" + } + }, + "node_modules/motion-utils": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-11.16.0.tgz", + "integrity": "sha512-ngdWPjg31rD4WGXFi0eZ00DQQqKKu04QExyv/ymlC+3k+WIgYVFbt6gS5JsFPbJODTF/r8XiE/X+SsoT9c0ocw==" + }, "node_modules/mri": { "version": "1.2.0", "license": "MIT",