analytica-frontend-lib 1.0.81 → 1.0.83
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/dist/Accordation/index.js +76 -130
- package/dist/Accordation/index.js.map +1 -1
- package/dist/Accordation/index.mjs +76 -130
- package/dist/Accordation/index.mjs.map +1 -1
- package/dist/AlertDialog/index.js +1 -1
- package/dist/AlertDialog/index.js.map +1 -1
- package/dist/AlertDialog/index.mjs +1 -1
- package/dist/AlertDialog/index.mjs.map +1 -1
- package/dist/Card/index.d.mts +0 -3
- package/dist/Card/index.d.ts +0 -3
- package/dist/Card/index.js +76 -130
- package/dist/Card/index.js.map +1 -1
- package/dist/Card/index.mjs +76 -130
- package/dist/Card/index.mjs.map +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/Modal/index.js.map +1 -1
- package/dist/Modal/index.mjs +1 -1
- package/dist/Modal/index.mjs.map +1 -1
- package/dist/Quiz/index.d.mts +29 -0
- package/dist/Quiz/index.d.ts +29 -0
- package/dist/Quiz/index.js +3662 -0
- package/dist/Quiz/index.js.map +1 -0
- package/dist/Quiz/index.mjs +3673 -0
- package/dist/Quiz/index.mjs.map +1 -0
- package/dist/Quiz/useQuizStore/index.d.mts +108 -0
- package/dist/Quiz/useQuizStore/index.d.ts +108 -0
- package/dist/Quiz/useQuizStore/index.js +274 -0
- package/dist/Quiz/useQuizStore/index.js.map +1 -0
- package/dist/Quiz/useQuizStore/index.mjs +249 -0
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -0
- package/dist/index.css +50 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +733 -132
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +731 -132
- package/dist/index.mjs.map +1 -1
- package/dist/simulated-result-QN5HCUY5.png +0 -0
- package/dist/styles.css +50 -3
- package/dist/styles.css.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n} from 'react';\nimport Button from '../Button/Button';\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'w-screen max-w-[324px]',\n small: 'w-screen max-w-[378px]',\n medium: 'w-screen max-w-[459px]',\n large: 'w-screen max-w-[578px]',\n 'extra-large': 'w-screen max-w-[912px]',\n} as const;\n\ninterface AlertDialogProps extends HTMLAttributes<HTMLDivElement> {\n /** Title of the alert dialog */\n title: string;\n /** Whether the alert dialog is open (controlled mode) */\n isOpen: boolean;\n /** Function called when the alert dialog is opened or closed (controlled mode) */\n onChangeOpen: (open: boolean) => void;\n /** Whether clicking the backdrop should close the alert dialog */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape should close the alert dialog */\n closeOnEscape?: boolean;\n /** Additional CSS classes for the alert dialog content */\n className?: string;\n /** Function called when submit button is clicked */\n onSubmit?: (value?: unknown) => void;\n /** Value to pass to onSubmit function */\n submitValue?: unknown;\n /** Function called when cancel button is clicked */\n onCancel?: (value?: unknown) => void;\n /** Value to pass to onCancel function */\n cancelValue?: unknown;\n /** Description of the alert dialog */\n description: string;\n /** Label of the cancel button */\n cancelButtonLabel?: string;\n /** Label of the submit button */\n submitButtonLabel?: string;\n /** Size of the alert dialog */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n}\n\nconst AlertDialog = forwardRef<HTMLDivElement, AlertDialogProps>(\n (\n {\n description,\n cancelButtonLabel = 'Cancelar',\n submitButtonLabel = 'Deletar',\n title,\n isOpen,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n className = '',\n onSubmit,\n onChangeOpen,\n submitValue,\n onCancel,\n cancelValue,\n size = 'medium',\n ...props\n },\n ref\n ) => {\n // Handle escape key\n useEffect(() => {\n if (!isOpen || !closeOnEscape) return;\n\n const handleEscape = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n onChangeOpen(false);\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => document.removeEventListener('keydown', handleEscape);\n }, [isOpen, closeOnEscape]);\n\n // Prevent body scroll when modal is open\n useEffect(() => {\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'unset';\n }\n\n return () => {\n document.body.style.overflow = 'unset';\n };\n }, [isOpen]);\n\n const handleBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && closeOnBackdropClick) {\n onChangeOpen(false);\n }\n };\n\n const handleBackdropKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && closeOnEscape) {\n onChangeOpen(false);\n }\n };\n\n const handleSubmit = () => {\n onChangeOpen(false);\n onSubmit?.(submitValue);\n };\n\n const handleCancel = () => {\n onChangeOpen(false);\n onCancel?.(cancelValue);\n };\n\n const sizeClasses = SIZE_CLASSES[size];\n\n return (\n <>\n {/* Alert Dialog Overlay */}\n {isOpen && (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm\"\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n data-testid=\"alert-dialog-overlay\"\n >\n {/* Alert Dialog Content */}\n <div\n ref={ref}\n className={`bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`}\n {...props}\n >\n <h2\n id=\"alert-dialog-title\"\n className=\"pb-3 text-xl font-semibold\"\n >\n {title}\n </h2>\n <p\n id=\"alert-dialog-description\"\n className=\"text-text-700 text-sm\"\n >\n {description}\n </p>\n\n <div className=\"flex flex-row items-center justify-end pt-4 gap-3\">\n <Button variant=\"outline\" size=\"small\" onClick={handleCancel}>\n {cancelButtonLabel}\n </Button>\n\n <Button\n variant=\"solid\"\n size=\"small\"\n action=\"negative\"\n onClick={handleSubmit}\n >\n {submitButtonLabel}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n);\n\nAlertDialog.displayName = 'AlertDialog';\n\nexport { AlertDialog };\n","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n 'bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n outline: {\n primary:\n 'bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n link: {\n primary:\n 'bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAMO;;;ACiGH;AAlGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AACF;AAKA,IAAM,eAAe;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AACjB;AA0CA,IAAM,SAAS,CAAC;AAAA,EACd;AAAA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R,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,SAAS;AAAA,oBAER;AAAA;AAAA,gBACH;AAAA,iBACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA,IACF,GAEJ;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["import_jsx_runtime","SIZE_CLASSES"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n} from 'react';\nimport Button from '../Button/Button';\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'w-screen max-w-[324px]',\n small: 'w-screen max-w-[378px]',\n medium: 'w-screen max-w-[459px]',\n large: 'w-screen max-w-[578px]',\n 'extra-large': 'w-screen max-w-[912px]',\n} as const;\n\ninterface AlertDialogProps extends HTMLAttributes<HTMLDivElement> {\n /** Title of the alert dialog */\n title: string;\n /** Whether the alert dialog is open (controlled mode) */\n isOpen: boolean;\n /** Function called when the alert dialog is opened or closed (controlled mode) */\n onChangeOpen: (open: boolean) => void;\n /** Whether clicking the backdrop should close the alert dialog */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape should close the alert dialog */\n closeOnEscape?: boolean;\n /** Additional CSS classes for the alert dialog content */\n className?: string;\n /** Function called when submit button is clicked */\n onSubmit?: (value?: unknown) => void;\n /** Value to pass to onSubmit function */\n submitValue?: unknown;\n /** Function called when cancel button is clicked */\n onCancel?: (value?: unknown) => void;\n /** Value to pass to onCancel function */\n cancelValue?: unknown;\n /** Description of the alert dialog */\n description: string;\n /** Label of the cancel button */\n cancelButtonLabel?: string;\n /** Label of the submit button */\n submitButtonLabel?: string;\n /** Size of the alert dialog */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n}\n\nconst AlertDialog = forwardRef<HTMLDivElement, AlertDialogProps>(\n (\n {\n description,\n cancelButtonLabel = 'Cancelar',\n submitButtonLabel = 'Deletar',\n title,\n isOpen,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n className = '',\n onSubmit,\n onChangeOpen,\n submitValue,\n onCancel,\n cancelValue,\n size = 'medium',\n ...props\n },\n ref\n ) => {\n // Handle escape key\n useEffect(() => {\n if (!isOpen || !closeOnEscape) return;\n\n const handleEscape = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n onChangeOpen(false);\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => document.removeEventListener('keydown', handleEscape);\n }, [isOpen, closeOnEscape]);\n\n // Prevent body scroll when modal is open\n useEffect(() => {\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'unset';\n }\n\n return () => {\n document.body.style.overflow = 'unset';\n };\n }, [isOpen]);\n\n const handleBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && closeOnBackdropClick) {\n onChangeOpen(false);\n }\n };\n\n const handleBackdropKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && closeOnEscape) {\n onChangeOpen(false);\n }\n };\n\n const handleSubmit = () => {\n onChangeOpen(false);\n onSubmit?.(submitValue);\n };\n\n const handleCancel = () => {\n onChangeOpen(false);\n onCancel?.(cancelValue);\n };\n\n const sizeClasses = SIZE_CLASSES[size];\n\n return (\n <>\n {/* Alert Dialog Overlay */}\n {isOpen && (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm\"\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n data-testid=\"alert-dialog-overlay\"\n >\n {/* Alert Dialog Content */}\n <div\n ref={ref}\n className={`bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`}\n {...props}\n >\n <h2\n id=\"alert-dialog-title\"\n className=\"pb-3 text-xl font-semibold text-text-950\"\n >\n {title}\n </h2>\n <p\n id=\"alert-dialog-description\"\n className=\"text-text-700 text-sm\"\n >\n {description}\n </p>\n\n <div className=\"flex flex-row items-center justify-end pt-4 gap-3\">\n <Button variant=\"outline\" size=\"small\" onClick={handleCancel}>\n {cancelButtonLabel}\n </Button>\n\n <Button\n variant=\"solid\"\n size=\"small\"\n action=\"negative\"\n onClick={handleSubmit}\n >\n {submitButtonLabel}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n);\n\nAlertDialog.displayName = 'AlertDialog';\n\nexport { AlertDialog };\n","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n 'bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n outline: {\n primary:\n 'bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n link: {\n primary:\n 'bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAMO;;;ACiGH;AAlGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA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AAAA,kBACH,WAAU;AAAA,kBAET;AAAA;AAAA,cACH;AAAA,cAEA,8CAAC,SAAI,WAAU,qDACb;AAAA,6DAAC,kBAAO,SAAQ,WAAU,MAAK,SAAQ,SAAS,cAC7C,6BACH;AAAA,gBAEA;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAQ;AAAA,oBACR,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,SAAS;AAAA,oBAER;AAAA;AAAA,gBACH;AAAA,iBACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA,IACF,GAEJ;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["import_jsx_runtime","SIZE_CLASSES"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n} from 'react';\nimport Button from '../Button/Button';\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'w-screen max-w-[324px]',\n small: 'w-screen max-w-[378px]',\n medium: 'w-screen max-w-[459px]',\n large: 'w-screen max-w-[578px]',\n 'extra-large': 'w-screen max-w-[912px]',\n} as const;\n\ninterface AlertDialogProps extends HTMLAttributes<HTMLDivElement> {\n /** Title of the alert dialog */\n title: string;\n /** Whether the alert dialog is open (controlled mode) */\n isOpen: boolean;\n /** Function called when the alert dialog is opened or closed (controlled mode) */\n onChangeOpen: (open: boolean) => void;\n /** Whether clicking the backdrop should close the alert dialog */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape should close the alert dialog */\n closeOnEscape?: boolean;\n /** Additional CSS classes for the alert dialog content */\n className?: string;\n /** Function called when submit button is clicked */\n onSubmit?: (value?: unknown) => void;\n /** Value to pass to onSubmit function */\n submitValue?: unknown;\n /** Function called when cancel button is clicked */\n onCancel?: (value?: unknown) => void;\n /** Value to pass to onCancel function */\n cancelValue?: unknown;\n /** Description of the alert dialog */\n description: string;\n /** Label of the cancel button */\n cancelButtonLabel?: string;\n /** Label of the submit button */\n submitButtonLabel?: string;\n /** Size of the alert dialog */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n}\n\nconst AlertDialog = forwardRef<HTMLDivElement, AlertDialogProps>(\n (\n {\n description,\n cancelButtonLabel = 'Cancelar',\n submitButtonLabel = 'Deletar',\n title,\n isOpen,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n className = '',\n onSubmit,\n onChangeOpen,\n submitValue,\n onCancel,\n cancelValue,\n size = 'medium',\n ...props\n },\n ref\n ) => {\n // Handle escape key\n useEffect(() => {\n if (!isOpen || !closeOnEscape) return;\n\n const handleEscape = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n onChangeOpen(false);\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => document.removeEventListener('keydown', handleEscape);\n }, [isOpen, closeOnEscape]);\n\n // Prevent body scroll when modal is open\n useEffect(() => {\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'unset';\n }\n\n return () => {\n document.body.style.overflow = 'unset';\n };\n }, [isOpen]);\n\n const handleBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && closeOnBackdropClick) {\n onChangeOpen(false);\n }\n };\n\n const handleBackdropKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && closeOnEscape) {\n onChangeOpen(false);\n }\n };\n\n const handleSubmit = () => {\n onChangeOpen(false);\n onSubmit?.(submitValue);\n };\n\n const handleCancel = () => {\n onChangeOpen(false);\n onCancel?.(cancelValue);\n };\n\n const sizeClasses = SIZE_CLASSES[size];\n\n return (\n <>\n {/* Alert Dialog Overlay */}\n {isOpen && (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm\"\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n data-testid=\"alert-dialog-overlay\"\n >\n {/* Alert Dialog Content */}\n <div\n ref={ref}\n className={`bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`}\n {...props}\n >\n <h2\n id=\"alert-dialog-title\"\n className=\"pb-3 text-xl font-semibold\"\n >\n {title}\n </h2>\n <p\n id=\"alert-dialog-description\"\n className=\"text-text-700 text-sm\"\n >\n {description}\n </p>\n\n <div className=\"flex flex-row items-center justify-end pt-4 gap-3\">\n <Button variant=\"outline\" size=\"small\" onClick={handleCancel}>\n {cancelButtonLabel}\n </Button>\n\n <Button\n variant=\"solid\"\n size=\"small\"\n action=\"negative\"\n onClick={handleSubmit}\n >\n {submitButtonLabel}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n);\n\nAlertDialog.displayName = 'AlertDialog';\n\nexport { AlertDialog };\n","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n 'bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n outline: {\n primary:\n 'bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n link: {\n primary:\n 'bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAEA;AAAA,OAGK;;;ACi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AA,QAGZ,0BAAAC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,WAAW,uEAAuE,WAAW,IAAI,SAAS;AAAA,YACzG,GAAG;AAAA,YAEJ;AAAA,8BAAAD;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,WAAU;AAAA,kBAET;AAAA;AAAA,cACH;AAAA,cACA,gBAAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,WAAU;AAAA,kBAET;AAAA;AAAA,cACH;AAAA,cAEA,gBAAAC,MAAC,SAAI,WAAU,qDACb;AAAA,gCAAAD,KAAC,kBAAO,SAAQ,WAAU,MAAK,SAAQ,SAAS,cAC7C,6BACH;AAAA,gBAEA,gBAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAQ;AAAA,oBACR,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,SAAS;AAAA,oBAER;AAAA;AAAA,gBACH;AAAA,iBACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA,IACF,GAEJ;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["jsx","jsxs","SIZE_CLASSES"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n} from 'react';\nimport Button from '../Button/Button';\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'w-screen max-w-[324px]',\n small: 'w-screen max-w-[378px]',\n medium: 'w-screen max-w-[459px]',\n large: 'w-screen max-w-[578px]',\n 'extra-large': 'w-screen max-w-[912px]',\n} as const;\n\ninterface AlertDialogProps extends HTMLAttributes<HTMLDivElement> {\n /** Title of the alert dialog */\n title: string;\n /** Whether the alert dialog is open (controlled mode) */\n isOpen: boolean;\n /** Function called when the alert dialog is opened or closed (controlled mode) */\n onChangeOpen: (open: boolean) => void;\n /** Whether clicking the backdrop should close the alert dialog */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape should close the alert dialog */\n closeOnEscape?: boolean;\n /** Additional CSS classes for the alert dialog content */\n className?: string;\n /** Function called when submit button is clicked */\n onSubmit?: (value?: unknown) => void;\n /** Value to pass to onSubmit function */\n submitValue?: unknown;\n /** Function called when cancel button is clicked */\n onCancel?: (value?: unknown) => void;\n /** Value to pass to onCancel function */\n cancelValue?: unknown;\n /** Description of the alert dialog */\n description: string;\n /** Label of the cancel button */\n cancelButtonLabel?: string;\n /** Label of the submit button */\n submitButtonLabel?: string;\n /** Size of the alert dialog */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n}\n\nconst AlertDialog = forwardRef<HTMLDivElement, AlertDialogProps>(\n (\n {\n description,\n cancelButtonLabel = 'Cancelar',\n submitButtonLabel = 'Deletar',\n title,\n isOpen,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n className = '',\n onSubmit,\n onChangeOpen,\n submitValue,\n onCancel,\n cancelValue,\n size = 'medium',\n ...props\n },\n ref\n ) => {\n // Handle escape key\n useEffect(() => {\n if (!isOpen || !closeOnEscape) return;\n\n const handleEscape = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n onChangeOpen(false);\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => document.removeEventListener('keydown', handleEscape);\n }, [isOpen, closeOnEscape]);\n\n // Prevent body scroll when modal is open\n useEffect(() => {\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'unset';\n }\n\n return () => {\n document.body.style.overflow = 'unset';\n };\n }, [isOpen]);\n\n const handleBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && closeOnBackdropClick) {\n onChangeOpen(false);\n }\n };\n\n const handleBackdropKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && closeOnEscape) {\n onChangeOpen(false);\n }\n };\n\n const handleSubmit = () => {\n onChangeOpen(false);\n onSubmit?.(submitValue);\n };\n\n const handleCancel = () => {\n onChangeOpen(false);\n onCancel?.(cancelValue);\n };\n\n const sizeClasses = SIZE_CLASSES[size];\n\n return (\n <>\n {/* Alert Dialog Overlay */}\n {isOpen && (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm\"\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n data-testid=\"alert-dialog-overlay\"\n >\n {/* Alert Dialog Content */}\n <div\n ref={ref}\n className={`bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`}\n {...props}\n >\n <h2\n id=\"alert-dialog-title\"\n className=\"pb-3 text-xl font-semibold text-text-950\"\n >\n {title}\n </h2>\n <p\n id=\"alert-dialog-description\"\n className=\"text-text-700 text-sm\"\n >\n {description}\n </p>\n\n <div className=\"flex flex-row items-center justify-end pt-4 gap-3\">\n <Button variant=\"outline\" size=\"small\" onClick={handleCancel}>\n {cancelButtonLabel}\n </Button>\n\n <Button\n variant=\"solid\"\n size=\"small\"\n action=\"negative\"\n onClick={handleSubmit}\n >\n {submitButtonLabel}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n);\n\nAlertDialog.displayName = 'AlertDialog';\n\nexport { AlertDialog };\n","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n 'bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n outline: {\n primary:\n 'bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n link: {\n primary:\n 'bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAEA;AAAA,OAGK;;;ACiGH,SAMe,KANf;AAlGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AACF;AAKA,IAAM,eAAe;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AACjB;AA0CA,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAmB;AAEjB,QAAM,cAAc,aAAa,IAAI;AACrC,QAAM,iBAAiB,uBAAuB,OAAO,EAAE,MAAM;AAE7D,QAAM,cACJ;AAEF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,WAAW,IAAI,cAAc,IAAI,WAAW,IAAI,SAAS;AAAA,MACvE;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,oBAAY,oBAAC,UAAK,WAAU,0BAA0B,oBAAS;AAAA,QAC/D;AAAA,QACA,aAAa,oBAAC,UAAK,WAAU,0BAA0B,qBAAU;AAAA;AAAA;AAAA,EACpE;A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mBAAa,KAAK;AAClB,iBAAW,WAAW;AAAA,IACxB;AAEA,UAAM,eAAe,MAAM;AACzB,mBAAa,KAAK;AAClB,iBAAW,WAAW;AAAA,IACxB;AAEA,UAAM,cAAcA,cAAa,IAAI;AAErC,WACE,gBAAAF,KAAA,YAEG,oBACC,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAY;AAAA,QAGZ,0BAAAC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,WAAW,uEAAuE,WAAW,IAAI,SAAS;AAAA,YACzG,GAAG;AAAA,YAEJ;AAAA,8BAAAD;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,WAAU;AAAA,kBAET;AAAA;AAAA,cACH;AAAA,cACA,gBAAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,WAAU;AAAA,kBAET;AAAA;AAAA,cACH;AAAA,cAEA,gBAAAC,MAAC,SAAI,WAAU,qDACb;AAAA,gCAAAD,KAAC,kBAAO,SAAQ,WAAU,MAAK,SAAQ,SAAS,cAC7C,6BACH;AAAA,gBAEA,gBAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAQ;AAAA,oBACR,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,SAAS;AAAA,oBAER;AAAA;AAAA,gBACH;AAAA,iBACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA,IACF,GAEJ;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["jsx","jsxs","SIZE_CLASSES"]}
|
package/dist/Card/index.d.mts
CHANGED
|
@@ -142,10 +142,7 @@ interface SimulationHistoryData {
|
|
|
142
142
|
simulations: SimulationItem[];
|
|
143
143
|
}
|
|
144
144
|
interface CardSimulationHistoryProps extends HTMLAttributes<HTMLDivElement> {
|
|
145
|
-
title?: string;
|
|
146
|
-
activeTab?: 'create' | 'history';
|
|
147
145
|
data: SimulationHistoryData[];
|
|
148
|
-
onTabChange?: (tab: 'create' | 'history') => void;
|
|
149
146
|
onSimulationClick?: (simulation: SimulationItem) => void;
|
|
150
147
|
}
|
|
151
148
|
declare const CardSimulationHistory: react.ForwardRefExoticComponent<CardSimulationHistoryProps & react.RefAttributes<HTMLDivElement>>;
|
package/dist/Card/index.d.ts
CHANGED
|
@@ -142,10 +142,7 @@ interface SimulationHistoryData {
|
|
|
142
142
|
simulations: SimulationItem[];
|
|
143
143
|
}
|
|
144
144
|
interface CardSimulationHistoryProps extends HTMLAttributes<HTMLDivElement> {
|
|
145
|
-
title?: string;
|
|
146
|
-
activeTab?: 'create' | 'history';
|
|
147
145
|
data: SimulationHistoryData[];
|
|
148
|
-
onTabChange?: (tab: 'create' | 'history') => void;
|
|
149
146
|
onSimulationClick?: (simulation: SimulationItem) => void;
|
|
150
147
|
}
|
|
151
148
|
declare const CardSimulationHistory: react.ForwardRefExoticComponent<CardSimulationHistoryProps & react.RefAttributes<HTMLDivElement>>;
|
package/dist/Card/index.js
CHANGED
|
@@ -1182,8 +1182,8 @@ var CardStatus = (0, import_react.forwardRef)(
|
|
|
1182
1182
|
...props,
|
|
1183
1183
|
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
|
|
1184
1184
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
1185
|
-
|
|
1186
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1185
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
|
|
1186
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1187
1187
|
Badge_default,
|
|
1188
1188
|
{
|
|
1189
1189
|
action: status == "correct" ? "success" : "error",
|
|
@@ -1742,144 +1742,90 @@ var SIMULATION_TYPE_STYLES = {
|
|
|
1742
1742
|
text: "Vestibular"
|
|
1743
1743
|
}
|
|
1744
1744
|
};
|
|
1745
|
-
var CardSimulationHistory = (0, import_react.forwardRef)(
|
|
1746
|
-
(
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
{
|
|
1758
|
-
ref,
|
|
1759
|
-
className: `w-full max-w-[992px] h-auto ${className}`,
|
|
1760
|
-
...props,
|
|
1761
|
-
children: [
|
|
1762
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-row items-end justify-between gap-4 mb-4", children: [
|
|
1763
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { size: "2xl", weight: "bold", className: "text-text-950 flex-1", children: title }),
|
|
1764
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-row gap-2", children: [
|
|
1765
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1766
|
-
"button",
|
|
1767
|
-
{
|
|
1768
|
-
type: "button",
|
|
1769
|
-
onClick: () => onTabChange?.("create"),
|
|
1770
|
-
className: `
|
|
1771
|
-
flex flex-row justify-center items-center px-4 py-3 gap-2 rounded-md relative
|
|
1772
|
-
${activeTab === "create" ? "text-text-950" : "text-text-950 hover:bg-background-50"}
|
|
1773
|
-
`,
|
|
1774
|
-
children: [
|
|
1775
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { size: "xs", weight: "bold", className: "leading-4 tracking-wide", children: "Criar Simulado" }),
|
|
1776
|
-
activeTab === "create" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "absolute bottom-0 left-2 right-2 h-1 bg-primary-950 rounded-lg" })
|
|
1777
|
-
]
|
|
1778
|
-
}
|
|
1779
|
-
),
|
|
1780
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1781
|
-
"button",
|
|
1782
|
-
{
|
|
1783
|
-
type: "button",
|
|
1784
|
-
onClick: () => onTabChange?.("history"),
|
|
1785
|
-
className: `
|
|
1786
|
-
flex flex-row justify-center items-center px-4 py-3 gap-2 rounded-md relative
|
|
1787
|
-
${activeTab === "history" ? "text-text-950" : "text-text-950 hover:bg-background-50"}
|
|
1788
|
-
`,
|
|
1789
|
-
children: [
|
|
1790
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { size: "xs", weight: "bold", className: "leading-4 tracking-wide", children: "Hist\xF3rico" }),
|
|
1791
|
-
activeTab === "history" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "absolute bottom-0 left-2 right-2 h-1 bg-primary-950 rounded-lg" })
|
|
1792
|
-
]
|
|
1793
|
-
}
|
|
1794
|
-
)
|
|
1795
|
-
] })
|
|
1796
|
-
] }),
|
|
1797
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-0", children: [
|
|
1798
|
-
data.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1799
|
-
"div",
|
|
1800
|
-
{
|
|
1801
|
-
className: `
|
|
1745
|
+
var CardSimulationHistory = (0, import_react.forwardRef)(({ data, onSimulationClick, className, ...props }, ref) => {
|
|
1746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1747
|
+
"div",
|
|
1748
|
+
{
|
|
1749
|
+
ref,
|
|
1750
|
+
className: `w-full max-w-[992px] h-auto ${className}`,
|
|
1751
|
+
...props,
|
|
1752
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-0", children: [
|
|
1753
|
+
data.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1754
|
+
"div",
|
|
1755
|
+
{
|
|
1756
|
+
className: `
|
|
1802
1757
|
flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-white
|
|
1803
1758
|
${sectionIndex === 0 ? "rounded-t-3xl" : ""}
|
|
1804
1759
|
`,
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1760
|
+
children: [
|
|
1761
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1762
|
+
Text_default,
|
|
1763
|
+
{
|
|
1764
|
+
size: "xs",
|
|
1765
|
+
weight: "bold",
|
|
1766
|
+
className: "text-text-800 w-11 flex-shrink-0",
|
|
1767
|
+
children: section.date
|
|
1768
|
+
}
|
|
1769
|
+
),
|
|
1770
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
|
|
1771
|
+
const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
|
|
1772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1773
|
+
CardBase,
|
|
1774
|
+
{
|
|
1775
|
+
layout: "horizontal",
|
|
1776
|
+
padding: "medium",
|
|
1777
|
+
minHeight: "none",
|
|
1778
|
+
cursor: "pointer",
|
|
1779
|
+
className: `
|
|
1825
1780
|
${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
|
|
1826
1781
|
transition-shadow duration-200 h-auto min-h-[61px]
|
|
1827
1782
|
`,
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1842
|
-
Badge_default,
|
|
1843
|
-
{
|
|
1844
|
-
variant: "examsOutlined",
|
|
1845
|
-
action: typeStyles.badge,
|
|
1846
|
-
size: "medium",
|
|
1847
|
-
children: typeStyles.text
|
|
1848
|
-
}
|
|
1849
|
-
),
|
|
1850
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1851
|
-
Text_default,
|
|
1852
|
-
{
|
|
1853
|
-
size: "sm",
|
|
1854
|
-
className: "text-text-800 truncate",
|
|
1855
|
-
children: simulation.info
|
|
1856
|
-
}
|
|
1857
|
-
)
|
|
1858
|
-
] })
|
|
1859
|
-
] }),
|
|
1783
|
+
onClick: () => onSimulationClick?.(simulation),
|
|
1784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex justify-between items-center w-full gap-2", children: [
|
|
1785
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
|
|
1786
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1787
|
+
Text_default,
|
|
1788
|
+
{
|
|
1789
|
+
size: "lg",
|
|
1790
|
+
weight: "bold",
|
|
1791
|
+
className: "text-text-950 truncate",
|
|
1792
|
+
children: simulation.title
|
|
1793
|
+
}
|
|
1794
|
+
),
|
|
1795
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1860
1796
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1861
|
-
|
|
1797
|
+
Badge_default,
|
|
1862
1798
|
{
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1799
|
+
variant: "examsOutlined",
|
|
1800
|
+
action: typeStyles.badge,
|
|
1801
|
+
size: "medium",
|
|
1802
|
+
children: typeStyles.text
|
|
1866
1803
|
}
|
|
1867
|
-
)
|
|
1804
|
+
),
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
|
|
1868
1806
|
] })
|
|
1869
|
-
},
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
)
|
|
1807
|
+
] }),
|
|
1808
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1809
|
+
import_phosphor_react2.CaretRight,
|
|
1810
|
+
{
|
|
1811
|
+
size: 24,
|
|
1812
|
+
className: "text-text-800 flex-shrink-0",
|
|
1813
|
+
"data-testid": "caret-icon"
|
|
1814
|
+
}
|
|
1815
|
+
)
|
|
1816
|
+
] })
|
|
1817
|
+
},
|
|
1818
|
+
simulation.id
|
|
1819
|
+
);
|
|
1820
|
+
}) })
|
|
1821
|
+
]
|
|
1822
|
+
}
|
|
1823
|
+
) }, section.date)),
|
|
1824
|
+
data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "w-full h-6 bg-white rounded-b-3xl" })
|
|
1825
|
+
] })
|
|
1826
|
+
}
|
|
1827
|
+
);
|
|
1828
|
+
});
|
|
1883
1829
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1884
1830
|
0 && (module.exports = {
|
|
1885
1831
|
CardActivitiesResults,
|