analytica-frontend-lib 1.0.43 → 1.0.45
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/Calendar/index.js +12 -12
- package/dist/Calendar/index.js.map +1 -1
- package/dist/Calendar/index.mjs +18 -13
- package/dist/Calendar/index.mjs.map +1 -1
- package/dist/DropdownMenu/index.d.mts +1 -1
- package/dist/DropdownMenu/index.d.ts +1 -1
- package/dist/DropdownMenu/index.js +16 -12
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +16 -12
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/Input/index.js +5 -2
- package/dist/Input/index.js.map +1 -1
- package/dist/Input/index.mjs +5 -2
- package/dist/Input/index.mjs.map +1 -1
- package/dist/ProgressBar/index.d.mts +36 -1
- package/dist/ProgressBar/index.d.ts +36 -1
- package/dist/ProgressBar/index.js +371 -75
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/ProgressBar/index.mjs +372 -76
- package/dist/ProgressBar/index.mjs.map +1 -1
- package/dist/Select/index.js +15 -8
- package/dist/Select/index.js.map +1 -1
- package/dist/Select/index.mjs +15 -8
- package/dist/Select/index.mjs.map +1 -1
- package/dist/index.css +138 -5
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +66 -2
- package/dist/index.d.ts +66 -2
- package/dist/index.js +600 -192
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +572 -160
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +138 -5
- package/dist/styles.css.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/ProgressBar/ProgressBar.tsx","../../src/components/Text/Text.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport Text from '../Text/Text';\n\n/**\n * Progress bar size variants\n */\ntype ProgressBarSize = 'small' | 'medium';\n\n/**\n * Progress bar color variants\n */\ntype ProgressBarVariant = 'blue' | 'green';\n\n/**\n * Size configurations using Tailwind classes\n */\nconst SIZE_CLASSES = {\n small: {\n container: 'h-1', // 4px height (h-1 = 4px in Tailwind)\n bar: 'h-1', // 4px height for the fill bar\n spacing: 'gap-2', // 8px gap between label and progress bar\n layout: 'flex-col', // vertical layout for small\n borderRadius: 'rounded-full', // 9999px border radius\n },\n medium: {\n container: 'h-2', // 8px height (h-2 = 8px in Tailwind)\n bar: 'h-2', // 8px height for the fill bar\n spacing: 'gap-2', // 8px gap between progress bar and label\n layout: 'flex-row items-center', // horizontal layout for medium\n borderRadius: 'rounded-lg', // 8px border radius\n },\n} as const;\n\n/**\n * Color configurations using design system colors\n */\nconst VARIANT_CLASSES = {\n blue: {\n background: 'bg-background-300', // Background track color (#D5D4D4)\n fill: 'bg-primary-700', // Blue for activity progress (#2271C4)\n },\n green: {\n background: 'bg-background-300', // Background track color (#D5D4D4)\n fill: 'bg-success-200', // Green for performance (#84D3A2)\n },\n} as const;\n\n/**\n * ProgressBar component props interface\n */\nexport type ProgressBarProps = {\n /** Progress value between 0 and 100 */\n value: number;\n /** Maximum value (defaults to 100) */\n max?: number;\n /** Size variant of the progress bar */\n size?: ProgressBarSize;\n /** Color variant of the progress bar */\n variant?: ProgressBarVariant;\n /** Optional label to display */\n label?: ReactNode;\n /** Show percentage text */\n showPercentage?: boolean;\n /** Additional CSS classes */\n className?: string;\n /** Label CSS classes */\n labelClassName?: string;\n /** Percentage text CSS classes */\n percentageClassName?: string;\n};\n\n/**\n * ProgressBar component for Analytica Ensino platforms\n *\n * A progress bar component with size and color variants designed for tracking\n * activity progress (blue) and performance metrics (green).\n * Uses the Analytica Ensino Design System colors from styles.css with automatic\n * light/dark mode support. Includes Text component integration for consistent typography.\n *\n * @example\n * ```tsx\n * // Basic progress bar\n * <ProgressBar value={65} />\n *\n * // Activity progress (blue)\n * <ProgressBar variant=\"blue\" value={45} label=\"Progress\" showPercentage />\n *\n * // Performance metrics (green)\n * <ProgressBar variant=\"green\" size=\"medium\" value={85} label=\"Performance\" />\n *\n * // Small size with custom max value\n * <ProgressBar size=\"small\" value={3} max={5} showPercentage />\n * ```\n */\nconst ProgressBar = ({\n value,\n max = 100,\n size = 'medium',\n variant = 'blue',\n label,\n showPercentage = false,\n className = '',\n labelClassName = '',\n percentageClassName = '',\n}: ProgressBarProps) => {\n // Ensure value is within bounds and handle NaN/Infinity\n const safeValue = isNaN(value) ? 0 : value;\n const clampedValue = Math.max(0, Math.min(safeValue, max));\n const percentage = max === 0 ? 0 : (clampedValue / max) * 100;\n\n // Get size and variant classes\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_CLASSES[variant];\n\n return (\n <div\n className={`flex ${sizeClasses.layout} ${size === 'medium' ? 'gap-2' : sizeClasses.spacing} ${className}`}\n >\n {/* For small size: vertical layout with label/percentage on top */}\n {size === 'small' && (label || showPercentage) && (\n <div className=\"flex flex-row items-center justify-between w-full\">\n {/* Label */}\n {label && (\n <Text\n as=\"div\"\n size=\"xs\"\n weight=\"medium\"\n className={`text-text-950 leading-none tracking-normal text-center ${labelClassName}`}\n >\n {label}\n </Text>\n )}\n\n {/* Percentage */}\n {showPercentage && (\n <Text\n size=\"xs\"\n weight=\"medium\"\n className={`text-text-950 leading-none tracking-normal text-center ${percentageClassName}`}\n >\n {Math.round(percentage)}%\n </Text>\n )}\n </div>\n )}\n\n {/* Progress bar container */}\n <div\n className={`${size === 'medium' ? 'flex-grow' : 'w-full'} ${sizeClasses.container} ${variantClasses.background} ${sizeClasses.borderRadius} overflow-hidden relative`}\n >\n {/* Native progress element for accessibility */}\n <progress\n value={clampedValue}\n max={max}\n aria-label={typeof label === 'string' ? label : 'Progress'}\n className=\"absolute inset-0 w-full h-full opacity-0\"\n />\n\n {/* Progress bar fill */}\n <div\n className={`${sizeClasses.bar} ${variantClasses.fill} ${sizeClasses.borderRadius} transition-all duration-300 ease-out shadow-hard-shadow-3`}\n style={{ width: `${percentage}%` }}\n />\n </div>\n\n {/* For medium size: horizontal layout with percentage on the right */}\n {size === 'medium' && showPercentage && (\n <Text\n size=\"xs\"\n weight=\"medium\"\n className={`text-text-950 leading-none tracking-normal text-center flex-none ${percentageClassName}`}\n >\n {Math.round(percentage)}%\n </Text>\n )}\n\n {/* For medium size: label below if provided */}\n {size === 'medium' && label && !showPercentage && (\n <Text\n as=\"div\"\n size=\"xs\"\n weight=\"medium\"\n className={`text-text-950 leading-none tracking-normal text-center flex-none ${labelClassName}`}\n >\n {label}\n </Text>\n )}\n </div>\n );\n};\n\nexport default ProgressBar;\n","import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\n\n/**\n * Base text component props\n */\ntype BaseTextProps = {\n /** Content to be displayed */\n children?: ReactNode;\n /** Text size variant */\n size?:\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | '4xl'\n | '5xl'\n | '6xl';\n /** Font weight variant */\n weight?:\n | 'hairline'\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'extrabold'\n | 'black';\n /** Color variant - white for light backgrounds, black for dark backgrounds */\n color?: string;\n /** Additional CSS classes to apply */\n className?: string;\n};\n\n/**\n * Polymorphic text component props that ensures type safety based on the 'as' prop\n */\ntype TextProps<T extends ElementType = 'p'> = BaseTextProps & {\n /** HTML tag to render */\n as?: T;\n} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;\n\n/**\n * Text component for Analytica Ensino platforms\n *\n * A flexible polymorphic text component with multiple sizes, weights, and colors.\n * Automatically adapts to dark and light themes with full type safety.\n *\n * @param children - The content to display\n * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)\n * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)\n * @param color - The color variant - adapts to theme\n * @param as - The HTML tag to render - determines allowed attributes via TypeScript\n * @param className - Additional CSS classes\n * @param props - HTML attributes valid for the chosen tag only\n * @returns A styled text element with type-safe attributes\n *\n * @example\n * ```tsx\n * <Text size=\"lg\" weight=\"bold\" color=\"text-info-800\">\n * This is a large, bold text\n * </Text>\n *\n * <Text as=\"a\" href=\"/link\" target=\"_blank\">\n * Link with type-safe anchor attributes\n * </Text>\n *\n * <Text as=\"button\" onClick={handleClick} disabled>\n * Button with type-safe button attributes\n * </Text>\n * ```\n */\nconst Text = <T extends ElementType = 'p'>({\n children,\n size = 'md',\n weight = 'normal',\n color = 'text-text-950',\n as,\n className = '',\n ...props\n}: TextProps<T>) => {\n let sizeClasses = '';\n let weightClasses = '';\n\n // Text size classes mapping\n const sizeClassMap = {\n '2xs': 'text-2xs',\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n '2xl': 'text-2xl',\n '3xl': 'text-3xl',\n '4xl': 'text-4xl',\n '5xl': 'text-5xl',\n '6xl': 'text-6xl',\n } as const;\n\n sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;\n\n // Font weight classes mapping\n const weightClassMap = {\n hairline: 'font-hairline',\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extrabold: 'font-extrabold',\n black: 'font-black',\n } as const;\n\n weightClasses = weightClassMap[weight] ?? weightClassMap.normal;\n\n const baseClasses = 'font-primary';\n const Component = as ?? ('p' as ElementType);\n\n return (\n <Component\n className={`${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`}\n {...props}\n >\n {children}\n </Component>\n );\n};\n\nexport default Text;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC0HI;AA/CJ,IAAM,OAAO,CAA8B;AAAA,EACzC;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,MAAoB;AAClB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAGpB,QAAM,eAAe;A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YAAY,GAAG,IAAI,eAAe,IAAI,IAAI,YAAY,YAAY;AAAA,kBAChF,OAAO,EAAE,OAAO,GAAG,UAAU,IAAI;AAAA;AAAA,cACnC;AAAA;AAAA;AAAA,QACF;AAAA,QAGC,SAAS,YAAY,kBACpB;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,QAAO;AAAA,YACP,WAAW,oEAAoE,mBAAmB;AAAA,YAEjG;AAAA,mBAAK,MAAM,UAAU;AAAA,cAAE;AAAA;AAAA;AAAA,QAC1B;AAAA,QAID,SAAS,YAAY,SAAS,CAAC,kBAC9B;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,MAAK;AAAA,YACL,QAAO;AAAA,YACP,WAAW,oEAAoE,cAAc;AAAA,YAE5F;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,IAAO,sBAAQ;","names":["import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/ProgressBar/ProgressBar.tsx","../../src/components/Text/Text.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport Text from '../Text/Text';\n\n/**\n * Progress bar size variants\n */\ntype ProgressBarSize = 'small' | 'medium';\n\n/**\n * Progress bar color variants\n */\ntype ProgressBarVariant = 'blue' | 'green';\n\n/**\n * Progress bar layout variants\n */\ntype ProgressBarLayout = 'default' | 'stacked' | 'compact';\n\n/**\n * Size configurations using Tailwind classes\n */\nconst SIZE_CLASSES = {\n small: {\n container: 'h-1', // 4px height (h-1 = 4px in Tailwind)\n bar: 'h-1', // 4px height for the fill bar\n spacing: 'gap-2', // 8px gap between label and progress bar\n layout: 'flex-col', // vertical layout for small\n borderRadius: 'rounded-full', // 9999px border radius\n },\n medium: {\n container: 'h-2', // 8px height (h-2 = 8px in Tailwind)\n bar: 'h-2', // 8px height for the fill bar\n spacing: 'gap-2', // 8px gap between progress bar and label\n layout: 'flex-row items-center', // horizontal layout for medium\n borderRadius: 'rounded-lg', // 8px border radius\n },\n} as const;\n\n/**\n * Color configurations using design system colors\n */\nconst VARIANT_CLASSES = {\n blue: {\n background: 'bg-background-300', // Background track color (#D5D4D4)\n fill: 'bg-primary-700', // Blue for activity progress (#2271C4)\n },\n green: {\n background: 'bg-background-300', // Background track color (#D5D4D4)\n fill: 'bg-success-200', // Green for performance (#84D3A2)\n },\n} as const;\n\n/**\n * Type for size classes\n */\ntype SizeClassType = (typeof SIZE_CLASSES)[keyof typeof SIZE_CLASSES];\n\n/**\n * Type for variant classes\n */\ntype VariantClassType = (typeof VARIANT_CLASSES)[keyof typeof VARIANT_CLASSES];\n\n/**\n * Common props shared across all layout components\n */\ninterface BaseLayoutProps {\n className: string;\n label: ReactNode;\n showPercentage: boolean;\n showHitCount: boolean;\n labelClassName: string;\n percentageClassName: string;\n clampedValue: number;\n max: number;\n percentage: number;\n variantClasses: VariantClassType;\n}\n\n/**\n * Dimensions configuration for layouts\n */\ninterface LayoutDimensions {\n width: string;\n height: string;\n}\n\n/**\n * Props for StackedLayout component\n */\ninterface StackedLayoutProps extends BaseLayoutProps {\n dimensions: LayoutDimensions;\n}\n\n/**\n * Props for CompactLayout component\n */\ninterface CompactLayoutProps extends BaseLayoutProps {\n dimensions: LayoutDimensions;\n}\n\n/**\n * Props for DefaultLayout component\n */\ninterface DefaultLayoutProps {\n className: string;\n size: ProgressBarSize;\n sizeClasses: SizeClassType;\n variantClasses: VariantClassType;\n label: ReactNode;\n showPercentage: boolean;\n labelClassName: string;\n percentageClassName: string;\n clampedValue: number;\n max: number;\n percentage: number;\n}\n\n/**\n * ProgressBar component props interface\n */\nexport type ProgressBarProps = {\n /** Progress value between 0 and 100 */\n value: number;\n /** Maximum value (defaults to 100) */\n max?: number;\n /** Size variant of the progress bar */\n size?: ProgressBarSize;\n /** Color variant of the progress bar */\n variant?: ProgressBarVariant;\n /** Layout variant of the progress bar */\n layout?: ProgressBarLayout;\n /** Optional label to display */\n label?: ReactNode;\n /** Show percentage text */\n showPercentage?: boolean;\n /**\n * Show hit count (e.g., \"28 de 30\") instead of percentage\n *\n * PRIORITY: When both showHitCount and showPercentage are true,\n * showHitCount takes precedence (stacked and compact layouts only).\n * Default layout does not support showHitCount.\n */\n showHitCount?: boolean;\n /** Additional CSS classes */\n className?: string;\n /** Label CSS classes */\n labelClassName?: string;\n /** Percentage text CSS classes */\n percentageClassName?: string;\n /** Custom width for stacked layout (defaults to w-[380px]) */\n stackedWidth?: string;\n /** Custom height for stacked layout (defaults to h-[35px]) */\n stackedHeight?: string;\n /** Custom width for compact layout (defaults to w-[131px]) */\n compactWidth?: string;\n /** Custom height for compact layout (defaults to h-[24px]) */\n compactHeight?: string;\n};\n\n/**\n * Helper function to calculate safe progress values\n */\nconst calculateProgressValues = (value: number, max: number) => {\n const safeValue = isNaN(value) ? 0 : value;\n const clampedValue = Math.max(0, Math.min(safeValue, max));\n const percentage = max === 0 ? 0 : (clampedValue / max) * 100;\n\n return { clampedValue, percentage };\n};\n\n/**\n * Helper function to determine if header content should be shown\n */\nconst shouldShowHeader = (\n label: ReactNode,\n showPercentage: boolean,\n showHitCount: boolean\n): boolean => {\n return !!(label || showPercentage || showHitCount);\n};\n\n/**\n * Centralized function to determine display priority and content\n *\n * PRIORITY ORDER (consistent across all layouts):\n * 1. showHitCount (highest priority) - displays \"X de Y\" format\n * 2. showPercentage - displays \"X%\" format\n * 3. label (lowest priority) - displays custom label\n *\n * @param showHitCount - Whether to show hit count format\n * @param showPercentage - Whether to show percentage format\n * @param label - Custom label to display\n * @param clampedValue - Current progress value\n * @param max - Maximum progress value\n * @param percentage - Calculated percentage value\n * @returns Object with content type and formatted content\n */\nconst getDisplayPriority = (\n showHitCount: boolean,\n showPercentage: boolean,\n label: ReactNode,\n clampedValue: number,\n max: number,\n percentage: number\n) => {\n if (showHitCount) {\n return {\n type: 'hitCount' as const,\n content: `${Math.round(clampedValue)} de ${max}`,\n hasMetrics: true,\n };\n }\n\n if (showPercentage) {\n return {\n type: 'percentage' as const,\n content: `${Math.round(percentage)}%`,\n hasMetrics: true,\n };\n }\n\n return {\n type: 'label' as const,\n content: label,\n hasMetrics: false,\n };\n};\n\n/**\n * Parameters for compact layout configuration\n */\ninterface CompactLayoutConfigParams {\n showPercentage: boolean;\n showHitCount: boolean;\n percentage: number;\n clampedValue: number;\n max: number;\n label: ReactNode;\n percentageClassName: string;\n labelClassName: string;\n}\n\n/**\n * Helper function to get compact layout configuration\n *\n * PRIORITY ORDER (consistent across all layouts):\n * 1. showHitCount (highest priority) - displays \"X de Y\" format\n * 2. showPercentage - displays \"X%\" format\n * 3. label (lowest priority) - displays custom label\n *\n * When both showHitCount and showPercentage are true, showHitCount takes precedence.\n */\nconst getCompactLayoutConfig = ({\n showPercentage,\n showHitCount,\n percentage,\n clampedValue,\n max,\n label,\n percentageClassName,\n labelClassName,\n}: CompactLayoutConfigParams) => {\n // Use centralized priority logic for consistency\n const displayPriority = getDisplayPriority(\n showHitCount,\n showPercentage,\n label,\n clampedValue,\n max,\n percentage\n );\n\n return {\n color: displayPriority.hasMetrics ? 'text-primary-600' : 'text-primary-700',\n className: displayPriority.hasMetrics\n ? percentageClassName\n : labelClassName,\n content: displayPriority.content,\n };\n};\n\n/**\n * Helper function to get default layout display configuration\n *\n * PRIORITY ORDER for default layout (showHitCount is not supported):\n * 1. showPercentage (when enabled, takes precedence over label)\n * 2. label (shown only when showPercentage is false)\n *\n * Note: Default layout does not support showHitCount feature.\n */\nconst getDefaultLayoutDisplayConfig = (\n size: ProgressBarSize,\n label: ReactNode,\n showPercentage: boolean\n) => ({\n showHeader: size === 'small' && !!(label || showPercentage),\n showPercentage: size === 'medium' && showPercentage,\n showLabel: size === 'medium' && !!label && !showPercentage, // Only show label when percentage is not shown\n});\n\n/**\n * Helper function to render hit count or percentage display for stacked layout\n *\n * PRIORITY ORDER (consistent across all layouts):\n * 1. showHitCount (highest priority) - displays \"X de Y\" format\n * 2. showPercentage - displays \"X%\" format\n *\n * When both showHitCount and showPercentage are true, showHitCount takes precedence.\n */\nconst renderStackedHitCountDisplay = (\n showHitCount: boolean,\n showPercentage: boolean,\n clampedValue: number,\n max: number,\n percentage: number,\n percentageClassName: string\n): ReactNode => {\n if (!showHitCount && !showPercentage) return null;\n\n // Use centralized priority logic for consistency\n const displayPriority = getDisplayPriority(\n showHitCount,\n showPercentage,\n null, // label is not relevant for stacked layout metrics display\n clampedValue,\n max,\n percentage\n );\n\n return (\n <div\n className={`text-xs font-medium leading-[14px] text-right ${percentageClassName}`}\n >\n {displayPriority.type === 'hitCount' ? (\n <>\n <span className=\"text-success-200\">{Math.round(clampedValue)}</span>\n <span className=\"text-text-600\"> de {max}</span>\n </>\n ) : (\n <Text size=\"xs\" weight=\"medium\" className=\"text-success-200\">\n {Math.round(percentage)}%\n </Text>\n )}\n </div>\n );\n};\n\n/**\n * Base progress bar component with common rendering logic\n */\nconst ProgressBarBase = ({\n clampedValue,\n max,\n percentage,\n label,\n variantClasses,\n containerClassName,\n fillClassName,\n}: {\n clampedValue: number;\n max: number;\n percentage: number;\n label: ReactNode;\n variantClasses: VariantClassType;\n containerClassName: string;\n fillClassName: string;\n}) => (\n <div\n className={`${containerClassName} ${variantClasses.background} overflow-hidden relative`}\n >\n <progress\n value={clampedValue}\n max={max}\n aria-label={\n typeof label === 'string'\n ? `${label}: ${Math.round(percentage)}% complete`\n : `Progress: ${Math.round(percentage)}% of ${max}`\n }\n className=\"absolute inset-0 w-full h-full opacity-0\"\n />\n <div\n className={`${fillClassName} ${variantClasses.fill} transition-all duration-300 ease-out`}\n style={{ width: `${percentage}%` }}\n />\n </div>\n);\n\n/**\n * Stacked layout component\n */\nconst StackedLayout = ({\n className,\n label,\n showPercentage,\n showHitCount,\n labelClassName,\n percentageClassName,\n clampedValue,\n max,\n percentage,\n variantClasses,\n dimensions,\n}: StackedLayoutProps) => (\n <div\n className={`flex flex-col items-start gap-2 ${dimensions.width} ${dimensions.height} ${className}`}\n >\n {shouldShowHeader(label, showPercentage, showHitCount) && (\n <div className=\"flex flex-row justify-between items-center w-full h-[19px]\">\n {label && (\n <Text\n as=\"div\"\n size=\"md\"\n weight=\"medium\"\n className={`text-text-600 leading-[19px] ${labelClassName}`}\n >\n {label}\n </Text>\n )}\n\n {renderStackedHitCountDisplay(\n showHitCount,\n showPercentage,\n clampedValue,\n max,\n percentage,\n percentageClassName\n )}\n </div>\n )}\n\n <ProgressBarBase\n clampedValue={clampedValue}\n max={max}\n percentage={percentage}\n label={label}\n variantClasses={variantClasses}\n containerClassName=\"w-full h-2 rounded-lg\"\n fillClassName=\"h-2 rounded-lg shadow-hard-shadow-3\"\n />\n </div>\n);\n\n/**\n * Compact layout component\n */\nconst CompactLayout = ({\n className,\n label,\n showPercentage,\n showHitCount,\n labelClassName,\n percentageClassName,\n clampedValue,\n max,\n percentage,\n variantClasses,\n dimensions,\n}: CompactLayoutProps) => {\n const {\n color,\n className: compactClassName,\n content,\n } = getCompactLayoutConfig({\n showPercentage,\n showHitCount,\n percentage,\n clampedValue,\n max,\n label,\n percentageClassName,\n labelClassName,\n });\n\n return (\n <div\n className={`flex flex-col items-start gap-1 ${dimensions.width} ${dimensions.height} ${className}`}\n >\n {shouldShowHeader(label, showPercentage, showHitCount) && (\n <Text\n as=\"div\"\n size=\"sm\"\n weight=\"medium\"\n color={color}\n className={`leading-4 w-full ${compactClassName}`}\n >\n {content}\n </Text>\n )}\n\n <ProgressBarBase\n clampedValue={clampedValue}\n max={max}\n percentage={percentage}\n label={label}\n variantClasses={variantClasses}\n containerClassName=\"w-full h-1 rounded-full\"\n fillClassName=\"h-1 rounded-full\"\n />\n </div>\n );\n};\n\n/**\n * Default layout component\n */\nconst DefaultLayout = ({\n className,\n size,\n sizeClasses,\n variantClasses,\n label,\n showPercentage,\n labelClassName,\n percentageClassName,\n clampedValue,\n max,\n percentage,\n}: DefaultLayoutProps) => {\n const gapClass = size === 'medium' ? 'gap-2' : sizeClasses.spacing;\n const progressBarClass = size === 'medium' ? 'flex-grow' : 'w-full';\n const displayConfig = getDefaultLayoutDisplayConfig(\n size,\n label,\n showPercentage\n );\n\n return (\n <div className={`flex ${sizeClasses.layout} ${gapClass} ${className}`}>\n {displayConfig.showHeader && (\n <div className=\"flex flex-row items-center justify-between w-full\">\n {label && (\n <Text\n as=\"div\"\n size=\"xs\"\n weight=\"medium\"\n className={`text-text-950 leading-none tracking-normal text-center ${labelClassName}`}\n >\n {label}\n </Text>\n )}\n\n {showPercentage && (\n <Text\n size=\"xs\"\n weight=\"medium\"\n className={`text-text-950 leading-none tracking-normal text-center ${percentageClassName}`}\n >\n {Math.round(percentage)}%\n </Text>\n )}\n </div>\n )}\n\n <ProgressBarBase\n clampedValue={clampedValue}\n max={max}\n percentage={percentage}\n label={label}\n variantClasses={variantClasses}\n containerClassName={`${progressBarClass} ${sizeClasses.container} ${sizeClasses.borderRadius}`}\n fillClassName={`${sizeClasses.bar} ${sizeClasses.borderRadius} shadow-hard-shadow-3`}\n />\n\n {displayConfig.showPercentage && (\n <Text\n size=\"xs\"\n weight=\"medium\"\n className={`text-text-950 leading-none tracking-normal text-center flex-none ${percentageClassName}`}\n >\n {Math.round(percentage)}%\n </Text>\n )}\n\n {displayConfig.showLabel && (\n <Text\n as=\"div\"\n size=\"xs\"\n weight=\"medium\"\n className={`text-text-950 leading-none tracking-normal text-center flex-none ${labelClassName}`}\n >\n {label}\n </Text>\n )}\n </div>\n );\n};\n\n/**\n * ProgressBar component for Analytica Ensino platforms\n *\n * A progress bar component with size and color variants designed for tracking\n * activity progress (blue) and performance metrics (green).\n * Uses the Analytica Ensino Design System colors from styles.css with automatic\n * light/dark mode support. Includes Text component integration for consistent typography.\n *\n * CONTENT DISPLAY PRIORITY (Consistent across all layouts):\n * 1. showHitCount (highest) - \"X de Y\" format (stacked/compact only)\n * 2. showPercentage - \"X%\" format\n * 3. label (lowest) - Custom label text\n *\n * When multiple display options are enabled, higher priority options take precedence.\n *\n * @example\n * ```tsx\n * // Basic progress bar\n * <ProgressBar value={65} />\n *\n * // Activity progress (blue)\n * <ProgressBar variant=\"blue\" value={45} label=\"Progress\" showPercentage />\n *\n * // Performance metrics (green)\n * <ProgressBar variant=\"green\" size=\"medium\" value={85} label=\"Performance\" />\n *\n * // Small size with custom max value\n * <ProgressBar size=\"small\" value={3} max={5} showPercentage />\n *\n * // Stacked layout with fixed width and hit count\n * <ProgressBar layout=\"stacked\" variant=\"green\" value={28} max={30} label=\"Fáceis\" showHitCount />\n *\n * // Compact layout for small cards\n * <ProgressBar layout=\"compact\" variant=\"blue\" value={70} label=\"Questão 08\" />\n * ```\n */\nconst ProgressBar = ({\n value,\n max = 100,\n size = 'medium',\n variant = 'blue',\n layout = 'default',\n label,\n showPercentage = false,\n showHitCount = false,\n className = '',\n labelClassName = '',\n percentageClassName = '',\n stackedWidth,\n stackedHeight,\n compactWidth,\n compactHeight,\n}: ProgressBarProps) => {\n const { clampedValue, percentage } = calculateProgressValues(value, max);\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_CLASSES[variant];\n\n if (layout === 'stacked') {\n return (\n <StackedLayout\n className={className}\n label={label}\n showPercentage={showPercentage}\n showHitCount={showHitCount}\n labelClassName={labelClassName}\n percentageClassName={percentageClassName}\n clampedValue={clampedValue}\n max={max}\n percentage={percentage}\n variantClasses={variantClasses}\n dimensions={{\n width: stackedWidth ?? 'w-[380px]',\n height: stackedHeight ?? 'h-[35px]',\n }}\n />\n );\n }\n\n if (layout === 'compact') {\n return (\n <CompactLayout\n className={className}\n label={label}\n showPercentage={showPercentage}\n showHitCount={showHitCount}\n labelClassName={labelClassName}\n percentageClassName={percentageClassName}\n clampedValue={clampedValue}\n max={max}\n percentage={percentage}\n variantClasses={variantClasses}\n dimensions={{\n width: compactWidth ?? 'w-[131px]',\n height: compactHeight ?? 'h-[24px]',\n }}\n />\n );\n }\n\n return (\n <DefaultLayout\n className={className}\n size={size}\n sizeClasses={sizeClasses}\n variantClasses={variantClasses}\n label={label}\n showPercentage={showPercentage}\n labelClassName={labelClassName}\n percentageClassName={percentageClassName}\n clampedValue={clampedValue}\n max={max}\n percentage={percentage}\n />\n );\n};\n\nexport default ProgressBar;\n","import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\n\n/**\n * Base text component props\n */\ntype BaseTextProps = {\n /** Content to be displayed */\n children?: ReactNode;\n /** Text size variant */\n size?:\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | '4xl'\n | '5xl'\n | '6xl';\n /** Font weight variant */\n weight?:\n | 'hairline'\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'extrabold'\n | 'black';\n /** Color variant - white for light backgrounds, black for dark backgrounds */\n color?: string;\n /** Additional CSS classes to apply */\n className?: string;\n};\n\n/**\n * Polymorphic text component props that ensures type safety based on the 'as' prop\n */\ntype TextProps<T extends ElementType = 'p'> = BaseTextProps & {\n /** HTML tag to render */\n as?: T;\n} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;\n\n/**\n * Text component for Analytica Ensino platforms\n *\n * A flexible polymorphic text component with multiple sizes, weights, and colors.\n * Automatically adapts to dark and light themes with full type safety.\n *\n * @param children - The content to display\n * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)\n * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)\n * @param color - The color variant - adapts to theme\n * @param as - The HTML tag to render - determines allowed attributes via TypeScript\n * @param className - Additional CSS classes\n * @param props - HTML attributes valid for the chosen tag only\n * @returns A styled text element with type-safe attributes\n *\n * @example\n * ```tsx\n * <Text size=\"lg\" weight=\"bold\" color=\"text-info-800\">\n * This is a large, bold text\n * </Text>\n *\n * <Text as=\"a\" href=\"/link\" target=\"_blank\">\n * Link with type-safe anchor attributes\n * </Text>\n *\n * <Text as=\"button\" onClick={handleClick} disabled>\n * Button with type-safe button attributes\n * </Text>\n * ```\n */\nconst Text = <T extends ElementType = 'p'>({\n children,\n size = 'md',\n weight = 'normal',\n color = 'text-text-950',\n as,\n className = '',\n ...props\n}: TextProps<T>) => {\n let sizeClasses = '';\n let weightClasses = '';\n\n // Text size classes mapping\n const sizeClassMap = {\n '2xs': 'text-2xs',\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n '2xl': 'text-2xl',\n '3xl': 'text-3xl',\n '4xl': 'text-4xl',\n '5xl': 'text-5xl',\n '6xl': 'text-6xl',\n } as const;\n\n sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;\n\n // Font weight classes mapping\n const weightClassMap = {\n hairline: 'font-hairline',\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extrabold: 'font-extrabold',\n black: 'font-black',\n } as const;\n\n weightClasses = weightClassMap[weight] ?? weightClassMap.normal;\n\n const baseClasses = 'font-primary';\n const Component = as ?? ('p' as ElementType);\n\n return (\n <Component\n className={`${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`}\n {...props}\n >\n {children}\n </Component>\n );\n};\n\nexport default Text;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC0HI;AA/CJ,IAAM,OAAO,CAA8B;AAAA,EACzC;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,MAAoB;AAClB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAGpB,QAAM,eAAe;AAAA,IACnB,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAEA,gBAAc,aAAa,IAAI,KAAK,aAAa;AAGjD,QAAM,iBAAiB;AAAA,IAC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
@@ -50,7 +50,7 @@ var Text = ({
|
|
|
50
50
|
var Text_default = Text;
|
|
51
51
|
|
|
52
52
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
53
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
53
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
54
54
|
var SIZE_CLASSES = {
|
|
55
55
|
small: {
|
|
56
56
|
container: "h-1",
|
|
@@ -91,101 +91,397 @@ var VARIANT_CLASSES = {
|
|
|
91
91
|
// Green for performance (#84D3A2)
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
var
|
|
95
|
-
value,
|
|
96
|
-
max = 100,
|
|
97
|
-
size = "medium",
|
|
98
|
-
variant = "blue",
|
|
99
|
-
label,
|
|
100
|
-
showPercentage = false,
|
|
101
|
-
className = "",
|
|
102
|
-
labelClassName = "",
|
|
103
|
-
percentageClassName = ""
|
|
104
|
-
}) => {
|
|
94
|
+
var calculateProgressValues = (value, max) => {
|
|
105
95
|
const safeValue = isNaN(value) ? 0 : value;
|
|
106
96
|
const clampedValue = Math.max(0, Math.min(safeValue, max));
|
|
107
97
|
const percentage = max === 0 ? 0 : clampedValue / max * 100;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
return { clampedValue, percentage };
|
|
99
|
+
};
|
|
100
|
+
var shouldShowHeader = (label, showPercentage, showHitCount) => {
|
|
101
|
+
return !!(label || showPercentage || showHitCount);
|
|
102
|
+
};
|
|
103
|
+
var getDisplayPriority = (showHitCount, showPercentage, label, clampedValue, max, percentage) => {
|
|
104
|
+
if (showHitCount) {
|
|
105
|
+
return {
|
|
106
|
+
type: "hitCount",
|
|
107
|
+
content: `${Math.round(clampedValue)} de ${max}`,
|
|
108
|
+
hasMetrics: true
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (showPercentage) {
|
|
112
|
+
return {
|
|
113
|
+
type: "percentage",
|
|
114
|
+
content: `${Math.round(percentage)}%`,
|
|
115
|
+
hasMetrics: true
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
type: "label",
|
|
120
|
+
content: label,
|
|
121
|
+
hasMetrics: false
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
var getCompactLayoutConfig = ({
|
|
125
|
+
showPercentage,
|
|
126
|
+
showHitCount,
|
|
127
|
+
percentage,
|
|
128
|
+
clampedValue,
|
|
129
|
+
max,
|
|
130
|
+
label,
|
|
131
|
+
percentageClassName,
|
|
132
|
+
labelClassName
|
|
133
|
+
}) => {
|
|
134
|
+
const displayPriority = getDisplayPriority(
|
|
135
|
+
showHitCount,
|
|
136
|
+
showPercentage,
|
|
137
|
+
label,
|
|
138
|
+
clampedValue,
|
|
139
|
+
max,
|
|
140
|
+
percentage
|
|
141
|
+
);
|
|
142
|
+
return {
|
|
143
|
+
color: displayPriority.hasMetrics ? "text-primary-600" : "text-primary-700",
|
|
144
|
+
className: displayPriority.hasMetrics ? percentageClassName : labelClassName,
|
|
145
|
+
content: displayPriority.content
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
var getDefaultLayoutDisplayConfig = (size, label, showPercentage) => ({
|
|
149
|
+
showHeader: size === "small" && !!(label || showPercentage),
|
|
150
|
+
showPercentage: size === "medium" && showPercentage,
|
|
151
|
+
showLabel: size === "medium" && !!label && !showPercentage
|
|
152
|
+
// Only show label when percentage is not shown
|
|
153
|
+
});
|
|
154
|
+
var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue, max, percentage, percentageClassName) => {
|
|
155
|
+
if (!showHitCount && !showPercentage) return null;
|
|
156
|
+
const displayPriority = getDisplayPriority(
|
|
157
|
+
showHitCount,
|
|
158
|
+
showPercentage,
|
|
159
|
+
null,
|
|
160
|
+
// label is not relevant for stacked layout metrics display
|
|
161
|
+
clampedValue,
|
|
162
|
+
max,
|
|
163
|
+
percentage
|
|
164
|
+
);
|
|
165
|
+
return /* @__PURE__ */ jsx2(
|
|
111
166
|
"div",
|
|
112
167
|
{
|
|
113
|
-
className: `
|
|
114
|
-
children: [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
168
|
+
className: `text-xs font-medium leading-[14px] text-right ${percentageClassName}`,
|
|
169
|
+
children: displayPriority.type === "hitCount" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
170
|
+
/* @__PURE__ */ jsx2("span", { className: "text-success-200", children: Math.round(clampedValue) }),
|
|
171
|
+
/* @__PURE__ */ jsxs("span", { className: "text-text-600", children: [
|
|
172
|
+
" de ",
|
|
173
|
+
max
|
|
174
|
+
] })
|
|
175
|
+
] }) : /* @__PURE__ */ jsxs(Text_default, { size: "xs", weight: "medium", className: "text-success-200", children: [
|
|
176
|
+
Math.round(percentage),
|
|
177
|
+
"%"
|
|
178
|
+
] })
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
var ProgressBarBase = ({
|
|
183
|
+
clampedValue,
|
|
184
|
+
max,
|
|
185
|
+
percentage,
|
|
186
|
+
label,
|
|
187
|
+
variantClasses,
|
|
188
|
+
containerClassName,
|
|
189
|
+
fillClassName
|
|
190
|
+
}) => /* @__PURE__ */ jsxs(
|
|
191
|
+
"div",
|
|
192
|
+
{
|
|
193
|
+
className: `${containerClassName} ${variantClasses.background} overflow-hidden relative`,
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ jsx2(
|
|
196
|
+
"progress",
|
|
197
|
+
{
|
|
198
|
+
value: clampedValue,
|
|
199
|
+
max,
|
|
200
|
+
"aria-label": typeof label === "string" ? `${label}: ${Math.round(percentage)}% complete` : `Progress: ${Math.round(percentage)}% of ${max}`,
|
|
201
|
+
className: "absolute inset-0 w-full h-full opacity-0"
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
/* @__PURE__ */ jsx2(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
className: `${fillClassName} ${variantClasses.fill} transition-all duration-300 ease-out`,
|
|
208
|
+
style: { width: `${percentage}%` }
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
var StackedLayout = ({
|
|
215
|
+
className,
|
|
216
|
+
label,
|
|
217
|
+
showPercentage,
|
|
218
|
+
showHitCount,
|
|
219
|
+
labelClassName,
|
|
220
|
+
percentageClassName,
|
|
221
|
+
clampedValue,
|
|
222
|
+
max,
|
|
223
|
+
percentage,
|
|
224
|
+
variantClasses,
|
|
225
|
+
dimensions
|
|
226
|
+
}) => /* @__PURE__ */ jsxs(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
className: `flex flex-col items-start gap-2 ${dimensions.width} ${dimensions.height} ${className}`,
|
|
230
|
+
children: [
|
|
231
|
+
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsxs("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
|
|
232
|
+
label && /* @__PURE__ */ jsx2(
|
|
164
233
|
Text_default,
|
|
165
234
|
{
|
|
166
|
-
|
|
235
|
+
as: "div",
|
|
236
|
+
size: "md",
|
|
167
237
|
weight: "medium",
|
|
168
|
-
className: `text-text-
|
|
169
|
-
children:
|
|
170
|
-
Math.round(percentage),
|
|
171
|
-
"%"
|
|
172
|
-
]
|
|
238
|
+
className: `text-text-600 leading-[19px] ${labelClassName}`,
|
|
239
|
+
children: label
|
|
173
240
|
}
|
|
174
241
|
),
|
|
175
|
-
|
|
242
|
+
renderStackedHitCountDisplay(
|
|
243
|
+
showHitCount,
|
|
244
|
+
showPercentage,
|
|
245
|
+
clampedValue,
|
|
246
|
+
max,
|
|
247
|
+
percentage,
|
|
248
|
+
percentageClassName
|
|
249
|
+
)
|
|
250
|
+
] }),
|
|
251
|
+
/* @__PURE__ */ jsx2(
|
|
252
|
+
ProgressBarBase,
|
|
253
|
+
{
|
|
254
|
+
clampedValue,
|
|
255
|
+
max,
|
|
256
|
+
percentage,
|
|
257
|
+
label,
|
|
258
|
+
variantClasses,
|
|
259
|
+
containerClassName: "w-full h-2 rounded-lg",
|
|
260
|
+
fillClassName: "h-2 rounded-lg shadow-hard-shadow-3"
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
var CompactLayout = ({
|
|
267
|
+
className,
|
|
268
|
+
label,
|
|
269
|
+
showPercentage,
|
|
270
|
+
showHitCount,
|
|
271
|
+
labelClassName,
|
|
272
|
+
percentageClassName,
|
|
273
|
+
clampedValue,
|
|
274
|
+
max,
|
|
275
|
+
percentage,
|
|
276
|
+
variantClasses,
|
|
277
|
+
dimensions
|
|
278
|
+
}) => {
|
|
279
|
+
const {
|
|
280
|
+
color,
|
|
281
|
+
className: compactClassName,
|
|
282
|
+
content
|
|
283
|
+
} = getCompactLayoutConfig({
|
|
284
|
+
showPercentage,
|
|
285
|
+
showHitCount,
|
|
286
|
+
percentage,
|
|
287
|
+
clampedValue,
|
|
288
|
+
max,
|
|
289
|
+
label,
|
|
290
|
+
percentageClassName,
|
|
291
|
+
labelClassName
|
|
292
|
+
});
|
|
293
|
+
return /* @__PURE__ */ jsxs(
|
|
294
|
+
"div",
|
|
295
|
+
{
|
|
296
|
+
className: `flex flex-col items-start gap-1 ${dimensions.width} ${dimensions.height} ${className}`,
|
|
297
|
+
children: [
|
|
298
|
+
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsx2(
|
|
176
299
|
Text_default,
|
|
177
300
|
{
|
|
178
301
|
as: "div",
|
|
179
|
-
size: "
|
|
302
|
+
size: "sm",
|
|
180
303
|
weight: "medium",
|
|
181
|
-
|
|
182
|
-
|
|
304
|
+
color,
|
|
305
|
+
className: `leading-4 w-full ${compactClassName}`,
|
|
306
|
+
children: content
|
|
307
|
+
}
|
|
308
|
+
),
|
|
309
|
+
/* @__PURE__ */ jsx2(
|
|
310
|
+
ProgressBarBase,
|
|
311
|
+
{
|
|
312
|
+
clampedValue,
|
|
313
|
+
max,
|
|
314
|
+
percentage,
|
|
315
|
+
label,
|
|
316
|
+
variantClasses,
|
|
317
|
+
containerClassName: "w-full h-1 rounded-full",
|
|
318
|
+
fillClassName: "h-1 rounded-full"
|
|
183
319
|
}
|
|
184
320
|
)
|
|
185
321
|
]
|
|
186
322
|
}
|
|
187
323
|
);
|
|
188
324
|
};
|
|
325
|
+
var DefaultLayout = ({
|
|
326
|
+
className,
|
|
327
|
+
size,
|
|
328
|
+
sizeClasses,
|
|
329
|
+
variantClasses,
|
|
330
|
+
label,
|
|
331
|
+
showPercentage,
|
|
332
|
+
labelClassName,
|
|
333
|
+
percentageClassName,
|
|
334
|
+
clampedValue,
|
|
335
|
+
max,
|
|
336
|
+
percentage
|
|
337
|
+
}) => {
|
|
338
|
+
const gapClass = size === "medium" ? "gap-2" : sizeClasses.spacing;
|
|
339
|
+
const progressBarClass = size === "medium" ? "flex-grow" : "w-full";
|
|
340
|
+
const displayConfig = getDefaultLayoutDisplayConfig(
|
|
341
|
+
size,
|
|
342
|
+
label,
|
|
343
|
+
showPercentage
|
|
344
|
+
);
|
|
345
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex ${sizeClasses.layout} ${gapClass} ${className}`, children: [
|
|
346
|
+
displayConfig.showHeader && /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
347
|
+
label && /* @__PURE__ */ jsx2(
|
|
348
|
+
Text_default,
|
|
349
|
+
{
|
|
350
|
+
as: "div",
|
|
351
|
+
size: "xs",
|
|
352
|
+
weight: "medium",
|
|
353
|
+
className: `text-text-950 leading-none tracking-normal text-center ${labelClassName}`,
|
|
354
|
+
children: label
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
showPercentage && /* @__PURE__ */ jsxs(
|
|
358
|
+
Text_default,
|
|
359
|
+
{
|
|
360
|
+
size: "xs",
|
|
361
|
+
weight: "medium",
|
|
362
|
+
className: `text-text-950 leading-none tracking-normal text-center ${percentageClassName}`,
|
|
363
|
+
children: [
|
|
364
|
+
Math.round(percentage),
|
|
365
|
+
"%"
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
)
|
|
369
|
+
] }),
|
|
370
|
+
/* @__PURE__ */ jsx2(
|
|
371
|
+
ProgressBarBase,
|
|
372
|
+
{
|
|
373
|
+
clampedValue,
|
|
374
|
+
max,
|
|
375
|
+
percentage,
|
|
376
|
+
label,
|
|
377
|
+
variantClasses,
|
|
378
|
+
containerClassName: `${progressBarClass} ${sizeClasses.container} ${sizeClasses.borderRadius}`,
|
|
379
|
+
fillClassName: `${sizeClasses.bar} ${sizeClasses.borderRadius} shadow-hard-shadow-3`
|
|
380
|
+
}
|
|
381
|
+
),
|
|
382
|
+
displayConfig.showPercentage && /* @__PURE__ */ jsxs(
|
|
383
|
+
Text_default,
|
|
384
|
+
{
|
|
385
|
+
size: "xs",
|
|
386
|
+
weight: "medium",
|
|
387
|
+
className: `text-text-950 leading-none tracking-normal text-center flex-none ${percentageClassName}`,
|
|
388
|
+
children: [
|
|
389
|
+
Math.round(percentage),
|
|
390
|
+
"%"
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
),
|
|
394
|
+
displayConfig.showLabel && /* @__PURE__ */ jsx2(
|
|
395
|
+
Text_default,
|
|
396
|
+
{
|
|
397
|
+
as: "div",
|
|
398
|
+
size: "xs",
|
|
399
|
+
weight: "medium",
|
|
400
|
+
className: `text-text-950 leading-none tracking-normal text-center flex-none ${labelClassName}`,
|
|
401
|
+
children: label
|
|
402
|
+
}
|
|
403
|
+
)
|
|
404
|
+
] });
|
|
405
|
+
};
|
|
406
|
+
var ProgressBar = ({
|
|
407
|
+
value,
|
|
408
|
+
max = 100,
|
|
409
|
+
size = "medium",
|
|
410
|
+
variant = "blue",
|
|
411
|
+
layout = "default",
|
|
412
|
+
label,
|
|
413
|
+
showPercentage = false,
|
|
414
|
+
showHitCount = false,
|
|
415
|
+
className = "",
|
|
416
|
+
labelClassName = "",
|
|
417
|
+
percentageClassName = "",
|
|
418
|
+
stackedWidth,
|
|
419
|
+
stackedHeight,
|
|
420
|
+
compactWidth,
|
|
421
|
+
compactHeight
|
|
422
|
+
}) => {
|
|
423
|
+
const { clampedValue, percentage } = calculateProgressValues(value, max);
|
|
424
|
+
const sizeClasses = SIZE_CLASSES[size];
|
|
425
|
+
const variantClasses = VARIANT_CLASSES[variant];
|
|
426
|
+
if (layout === "stacked") {
|
|
427
|
+
return /* @__PURE__ */ jsx2(
|
|
428
|
+
StackedLayout,
|
|
429
|
+
{
|
|
430
|
+
className,
|
|
431
|
+
label,
|
|
432
|
+
showPercentage,
|
|
433
|
+
showHitCount,
|
|
434
|
+
labelClassName,
|
|
435
|
+
percentageClassName,
|
|
436
|
+
clampedValue,
|
|
437
|
+
max,
|
|
438
|
+
percentage,
|
|
439
|
+
variantClasses,
|
|
440
|
+
dimensions: {
|
|
441
|
+
width: stackedWidth ?? "w-[380px]",
|
|
442
|
+
height: stackedHeight ?? "h-[35px]"
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
if (layout === "compact") {
|
|
448
|
+
return /* @__PURE__ */ jsx2(
|
|
449
|
+
CompactLayout,
|
|
450
|
+
{
|
|
451
|
+
className,
|
|
452
|
+
label,
|
|
453
|
+
showPercentage,
|
|
454
|
+
showHitCount,
|
|
455
|
+
labelClassName,
|
|
456
|
+
percentageClassName,
|
|
457
|
+
clampedValue,
|
|
458
|
+
max,
|
|
459
|
+
percentage,
|
|
460
|
+
variantClasses,
|
|
461
|
+
dimensions: {
|
|
462
|
+
width: compactWidth ?? "w-[131px]",
|
|
463
|
+
height: compactHeight ?? "h-[24px]"
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
return /* @__PURE__ */ jsx2(
|
|
469
|
+
DefaultLayout,
|
|
470
|
+
{
|
|
471
|
+
className,
|
|
472
|
+
size,
|
|
473
|
+
sizeClasses,
|
|
474
|
+
variantClasses,
|
|
475
|
+
label,
|
|
476
|
+
showPercentage,
|
|
477
|
+
labelClassName,
|
|
478
|
+
percentageClassName,
|
|
479
|
+
clampedValue,
|
|
480
|
+
max,
|
|
481
|
+
percentage
|
|
482
|
+
}
|
|
483
|
+
);
|
|
484
|
+
};
|
|
189
485
|
var ProgressBar_default = ProgressBar;
|
|
190
486
|
export {
|
|
191
487
|
ProgressBar_default as default
|