@tribepad/themis 1.3.0 → 1.3.2
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/CHANGELOG.md +20 -0
- package/dist/elements/AlertDialog/index.js +1 -1
- package/dist/elements/AlertDialog/index.js.map +1 -1
- package/dist/elements/AlertDialog/index.mjs +1 -1
- package/dist/elements/AlertDialog/index.mjs.map +1 -1
- package/dist/elements/Card/Card.types.d.ts +1 -1
- package/dist/elements/Card/Card.types.d.ts.map +1 -1
- package/dist/elements/Card/index.js +1 -1
- package/dist/elements/Card/index.js.map +1 -1
- package/dist/elements/Card/index.mjs +1 -1
- package/dist/elements/Card/index.mjs.map +1 -1
- package/dist/elements/FormLayout/index.js +1 -1
- package/dist/elements/FormLayout/index.js.map +1 -1
- package/dist/elements/FormLayout/index.mjs +1 -1
- package/dist/elements/FormLayout/index.mjs.map +1 -1
- package/dist/elements/Modal/index.js +1 -1
- package/dist/elements/Modal/index.js.map +1 -1
- package/dist/elements/Modal/index.mjs +1 -1
- package/dist/elements/Modal/index.mjs.map +1 -1
- package/dist/elements/OTPInput/index.js +1 -1
- package/dist/elements/OTPInput/index.js.map +1 -1
- package/dist/elements/OTPInput/index.mjs +1 -1
- package/dist/elements/OTPInput/index.mjs.map +1 -1
- package/dist/elements/PageTitle/index.js +1 -1
- package/dist/elements/PageTitle/index.js.map +1 -1
- package/dist/elements/PageTitle/index.mjs +1 -1
- package/dist/elements/PageTitle/index.mjs.map +1 -1
- package/dist/elements/PasswordField/index.css +1 -1
- package/dist/elements/PasswordField/index.css.map +1 -1
- package/dist/elements/PasswordField/index.js +1 -1
- package/dist/elements/PasswordField/index.js.map +1 -1
- package/dist/elements/PasswordField/index.mjs +1 -1
- package/dist/elements/PasswordField/index.mjs.map +1 -1
- package/dist/elements/SearchField/index.css +1 -1
- package/dist/elements/SearchField/index.css.map +1 -1
- package/dist/elements/SearchField/index.js +1 -1
- package/dist/elements/SearchField/index.js.map +1 -1
- package/dist/elements/SearchField/index.mjs +1 -1
- package/dist/elements/SearchField/index.mjs.map +1 -1
- package/dist/elements/Select/Select.styles.d.ts.map +1 -1
- package/dist/elements/Select/index.js +1 -1
- package/dist/elements/Select/index.js.map +1 -1
- package/dist/elements/Select/index.mjs +1 -1
- package/dist/elements/Select/index.mjs.map +1 -1
- package/dist/elements/TextField/TextField.styles.d.ts +6 -0
- package/dist/elements/TextField/TextField.styles.d.ts.map +1 -1
- package/dist/elements/TextField/index.css +1 -1
- package/dist/elements/TextField/index.css.map +1 -1
- package/dist/elements/TextField/index.js +1 -1
- package/dist/elements/TextField/index.js.map +1 -1
- package/dist/elements/TextField/index.mjs +1 -1
- package/dist/elements/TextField/index.mjs.map +1 -1
- package/dist/elements/index.css +1 -1
- package/dist/elements/index.css.map +1 -1
- package/dist/elements/index.js +1 -1
- package/dist/elements/index.js.map +1 -1
- package/dist/elements/index.mjs +1 -1
- package/dist/elements/index.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/elements/Card/Card.stories.tsx +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/Button/Button.styles.ts","../../../src/styles/interaction-states.ts","../../../src/elements/ButtonGroup/ButtonGroupContext.tsx","../../../src/elements/ButtonGroup/ButtonGroup.variants.ts","../../../src/elements/Button/Button.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/Card/Card.types.ts","../../../src/elements/Card/Card.tsx"],"names":["cn","inputs","twMerge","clsx","buttonOuterVariants","cva","buttonVisualVariants","PRESSED_STYLES","HOVER_STYLES","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","ButtonGroupContext","createContext","useButtonGroupContext","useContext","ButtonGroupItemContext","useButtonGroupItemContext","buttonGroupItemVariants","Button","memo","forwardRef","className","buttonVisualClassName","variant","size","visualSize","fullWidth","loading","loadingText","shortcut","children","isDisabled","paywall","paywallRedirect","paywallDescription","onPress","props","ref","paywallDescriptionId","useId","groupContext","itemContext","effectiveVariant","effectiveSize","effectiveIsDisabled","isInVerticalGroup","effectiveFullWidth","positionClassName","effectiveVisualSize","jsx","AriaButton","e","renderProps","jsxs","Fragment","Loader2","Zap","BaseComponentPropsSchema","z","FlipButtonPositionSchema","FlipButtonLabelSchema","FlipButtonIconSchema","CardPropsSchema","CardHeaderPropsSchema","CardTitlePropsSchema","CardDescriptionPropsSchema","CardContentPropsSchema","CardFooterPropsSchema","CardActionPropsSchema","flipButtonPositionVariants","DEFAULT_FLIP_ICON","RotateCcw","FlipButton","label","icon","position","FlippableCard","backContent","controlledFlipped","defaultFlipped","onFlipChange","flipButtonPosition","flipButtonLabel","flipButtonIcon","flipDuration","rest","internalFlipped","setInternalFlipped","useState","isControlled","flipped","handleFlip","useCallback","newState","showLabel","hideLabel","frontIcon","backIcon","Card","flippable","isFlipped","CardHeader","CardTitle","Comp","CardDescription","CardContent","CardFooter","CardAction"],"mappings":"kWAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCLO,IAAMG,CAAAA,CAAsBC,GAAAA,CACjC,0PACA,CACE,QAAA,CAAU,CACR,SAAA,CAAW,CACT,KAAM,QAAA,CACN,KAAA,CAAO,EACT,CAAA,CACA,gBAAiB,CACf,IAAA,CAAM,gBACN,KAAA,CAAO,cACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,SAAA,CAAW,KAAA,CACX,gBAAiB,KACnB,CACF,CACF,CAAA,CAQaC,CAAAA,CAAuBD,IAClC,2WAAA,CACA,CACE,QAAA,CAAU,CACR,QAAS,CACP,OAAA,CACE,2IACF,WAAA,CACE,iMAAA,CACF,QACE,gGAAA,CACF,SAAA,CACE,uHAAA,CACF,KAAA,CAC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AAA,CAAKZ,EACL,SAAA,CAAWrC,CAAAA,CAAG,UAAWqB,CAAS,CAAA,CACjC,GAAGe,CAAAA,CAEH,QAAA,CAAAN,EACH,CAEJ,EAEA6E,GAAW,WAAA,CAAc,YAAA","file":"index.mjs","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { cva } from 'class-variance-authority';\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * Handles WCAG 2.2 AAA touch target requirement\n * Always transparent, centers the visual button inside\n * IMPORTANT: Focus ring stays on Layer 1 for AAA compliance (2.4.13)\n *\n * In vertical ButtonGroups, uses items-stretch so the visual layer (Layer 2)\n * can fill the full touch target height, eliminating gaps between buttons.\n */\nexport const buttonOuterVariants = cva(\n \"inline-flex justify-center min-h-[44px] min-w-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n inVerticalGroup: {\n true: \"items-stretch\",\n false: \"items-center\",\n },\n },\n defaultVariants: {\n fullWidth: false,\n inVerticalGroup: false,\n },\n }\n);\n\n/**\n * Layer 2: Visual button appearance (adjustable size)\n * Provides the visual appearance with configurable size\n * Can be smaller than touch target for use cases like carousel dots\n * NOTE: NO focus-visible styles here - focus ring is on Layer 1\n */\nexport const buttonVisualVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background motion-safe:transition-transform motion-safe:duration-200 motion-safe:[transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer\",\n {\n variants: {\n variant: {\n default:\n \"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] hover:-translate-y-1\",\n destructive:\n \"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background-hover,var(--destructive-background))] motion-safe:hover:btn-warn-shake\",\n outline:\n \"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)]\",\n secondary:\n \"bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary-hover,var(--secondary))]\",\n ghost:\n \"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]\",\n link: \"text-[var(--text-link)] underline underline-offset-4 hover:bg-[var(--accent)] hover:text-[var(--text-link-hover)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n visualSize: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3 text-xs\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n dot: \"h-5 w-5 rounded-full p-0 min-h-0 min-w-0\",\n },\n paywall: {\n true: \"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n visualSize: \"default\",\n paywall: false,\n },\n }\n);\n\n/**\n * @deprecated Use buttonVisualVariants instead. This alias is kept for backward compatibility.\n */\nexport const buttonVariants = buttonVisualVariants;\n","/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"data-[hovered]:shadow-md\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","\"use client\";\n\nimport { createContext, useContext } from 'react';\nimport type {\n ButtonGroupContextValue,\n ButtonGroupItemContextValue,\n} from './ButtonGroup.types';\n\n/**\n * ButtonGroup Context System (Two-Level)\n *\n * Provides a two-level context pattern for ButtonGroup:\n *\n * 1. ButtonGroupContext (group-level):\n * - Provides: orientation, variant, size, isDisabled\n * - Consumed by: Button (for prop inheritance), Separator (for orientation)\n *\n * 2. ButtonGroupItemContext (item-level):\n * - Provides: position ('first' | 'middle' | 'last' | 'only')\n * - Consumed by: Button (for border-radius styling)\n *\n * Both contexts return null when not in a provider, allowing Button\n * to work standalone without any group context.\n *\n * @see plan.md for architecture details\n * @see ButtonGroup.tsx for Provider implementation\n */\n\n// =============================================================================\n// Group-Level Context\n// =============================================================================\n\n/**\n * Context for group-level props (orientation, variant, size, isDisabled)\n * Default value is null to indicate \"not in a group\"\n */\nconst ButtonGroupContext = createContext<ButtonGroupContextValue | null>(null);\n\nButtonGroupContext.displayName = 'ButtonGroupContext';\n\n/**\n * Hook to access group-level context\n * @returns ButtonGroupContextValue if inside a ButtonGroup, null otherwise\n */\nexport function useButtonGroupContext(): ButtonGroupContextValue | null {\n return useContext(ButtonGroupContext);\n}\n\n// =============================================================================\n// Item-Level Context\n// =============================================================================\n\n/**\n * Context for per-button position information\n * Default value is null to indicate \"not wrapped with position context\"\n */\nconst ButtonGroupItemContext =\n createContext<ButtonGroupItemContextValue | null>(null);\n\nButtonGroupItemContext.displayName = 'ButtonGroupItemContext';\n\n/**\n * Hook to access item-level context (position)\n * @returns ButtonGroupItemContextValue if wrapped with position context, null otherwise\n */\nexport function useButtonGroupItemContext(): ButtonGroupItemContextValue | null {\n return useContext(ButtonGroupItemContext);\n}\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroupContext, ButtonGroupItemContext };\n","import { cva } from 'class-variance-authority';\n\n/**\n * ButtonGroup CVA Variants\n *\n * Defines Class Variance Authority (CVA) variants for:\n * - ButtonGroup container (orientation-based layout)\n * - ButtonGroupItem (position-based border-radius)\n * - ButtonGroupSeparator (orientation-based styling)\n *\n * @see plan.md Phase 1: Design & Contracts - CVA Variants\n * @see constitution.md Principle V (Component Quality Standards)\n */\n\n// =============================================================================\n// Container Variants\n// =============================================================================\n\n/**\n * ButtonGroup container variants\n * Controls the layout direction based on orientation\n * Uses gap-0 to ensure buttons are connected (share borders)\n */\nexport const buttonGroupVariants = cva('inline-flex items-center gap-0', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col w-full',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// =============================================================================\n// Item Position Variants\n// =============================================================================\n\n/**\n * ButtonGroupItem position variants\n * Applied to Button's visual layer (Layer 2) for position-aware border-radius\n *\n * Compound variants handle both orientation and position combinations:\n * - Horizontal: left/right borders and radii\n * - Vertical: top/bottom borders and radii\n */\nexport const buttonGroupItemVariants = cva('', {\n variants: {\n orientation: {\n // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)\n horizontal: 'min-w-[44px]',\n // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,\n // eliminating gaps between stacked buttons in vertical orientation\n vertical: 'flex min-h-[44px]',\n },\n position: {\n first: '',\n middle: '',\n last: '',\n only: '', // Single button - no modifications needed\n },\n },\n compoundVariants: [\n // ==========================================================================\n // Horizontal Orientation\n // ==========================================================================\n {\n orientation: 'horizontal',\n position: 'first',\n className: 'rounded-r-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'middle',\n className: 'rounded-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'last',\n className: 'rounded-l-none',\n },\n // ==========================================================================\n // Vertical Orientation\n // Note: w-full is handled by Button's effectiveFullWidth for both layers\n // ==========================================================================\n {\n orientation: 'vertical',\n position: 'first',\n className: 'rounded-b-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'middle',\n className: 'rounded-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'last',\n className: 'rounded-t-none',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n position: 'only',\n },\n});\n\n// =============================================================================\n// Separator Variants\n// =============================================================================\n\n/**\n * ButtonGroupSeparator variants\n * Orientation-aware visual divider between button groups\n */\nexport const buttonGroupSeparatorVariants = cva('bg-[var(--border)]', {\n variants: {\n orientation: {\n horizontal: 'w-px h-6 mx-1',\n vertical: 'h-px w-full my-1',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n","\"use client\";\n\n/**\n * Button Component - 3-Layer Architecture\n * Accessible button with React Aria primitives and CVA styling\n *\n * Architecture:\n * - Layer 1: Touch Target (44x44px WCAG AAA compliant, transparent)\n * - Layer 2: Visual Button (configurable size, colors, borders)\n * - Layer 3: Content & Effects (text, icons, ripple, loading spinner)\n *\n * @see 3layer-plan.md for architecture details\n * @see spec.md FR-029 to FR-037 (Button Component Requirements)\n * @see spec.md FR-009 (WCAG 2.2 AAA - 7:1 contrast ratio)\n * @see spec.md FR-014 (44x44px minimum touch targets)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, useId } from 'react';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { Loader2, Zap } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { ButtonProps } from './Button.types';\nimport { buttonOuterVariants, buttonVisualVariants, buttonVariants } from './Button.styles';\nimport { PRESSED_STYLES, HOVER_STYLES, HIGH_CONTRAST_HOVER, HIGH_CONTRAST_PRESSED } from '../../styles/interaction-states';\nimport {\n useButtonGroupContext,\n useButtonGroupItemContext,\n} from '../ButtonGroup/ButtonGroupContext';\nimport { buttonGroupItemVariants } from '../ButtonGroup/ButtonGroup.variants';\n\n/**\n * Button Component - 3-Layer Architecture\n * Fully accessible button with React Aria and themed styling\n *\n * Layer 1: Touch Target (AriaButton) - 44x44px WCAG AAA compliant\n * Layer 2: Visual Button (span) - configurable appearance\n * Layer 3: Content (children) - text, icons, effects\n */\nconst Button = memo(forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n buttonVisualClassName,\n variant,\n size,\n visualSize,\n fullWidth,\n loading = false,\n loadingText = \"Loading...\",\n shortcut,\n children,\n isDisabled,\n paywall = false,\n paywallRedirect,\n paywallDescription,\n onPress,\n ...props\n },\n ref\n ) => {\n const paywallDescriptionId = useId();\n\n // ==========================================================================\n // ButtonGroup Context Integration\n // ==========================================================================\n\n // Consume group-level context (variant, size, isDisabled, orientation)\n const groupContext = useButtonGroupContext();\n\n // Consume item-level context (position for border-radius styling)\n const itemContext = useButtonGroupItemContext();\n\n // Merge context values with props (props take precedence)\n const effectiveVariant = variant ?? groupContext?.variant ?? 'default';\n const effectiveSize = size ?? groupContext?.size;\n const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;\n\n // In vertical groups, buttons should be full width automatically\n const isInVerticalGroup = groupContext?.orientation === 'vertical';\n const effectiveFullWidth = fullWidth || isInVerticalGroup;\n\n // Position styling for ButtonGroup (only applied when in a group)\n const positionClassName = itemContext\n ? buttonGroupItemVariants({\n orientation: groupContext?.orientation ?? 'horizontal',\n position: itemContext.position,\n })\n : '';\n\n // Default visualSize to size for backward compatibility\n const effectiveVisualSize = visualSize ?? effectiveSize ?? 'default';\n\n // AAA Accessibility: Warn in dev/test if icon/dot variant lacks accessible name\n if (process.env.NODE_ENV !== 'production') {\n if (\n (effectiveVisualSize === 'dot' || effectiveVisualSize === 'icon') &&\n !props['aria-label'] &&\n !children\n ) {\n console.warn(\n '[Button] visualSize=\"dot\" or \"icon\" requires aria-label when no visible text is provided (WCAG 1.1.1)'\n );\n }\n }\n\n /**\n * Handle button press - intercepts action when paywalled\n * If paywalled with redirect URL, opens in new tab\n * Otherwise, calls the normal onPress handler\n */\n const handlePress = (e: Parameters<NonNullable<AriaButtonProps['onPress']>>[0]): void => {\n if (paywall) {\n if (paywallRedirect) {\n window.open(paywallRedirect, '_blank', 'noopener,noreferrer');\n }\n // Don't call onPress when paywalled\n return;\n }\n onPress?.(e);\n };\n\n // Only set isDisabled when we have a reason to disable\n // Otherwise, let slot system control disabled state (e.g., in NumberField)\n const computedIsDisabled = effectiveIsDisabled || loading || undefined;\n\n return (\n <AriaButton\n ref={ref}\n isDisabled={computedIsDisabled}\n aria-disabled={paywall ? true : undefined}\n aria-describedby={paywall ? paywallDescriptionId : undefined}\n onPress={handlePress}\n className={cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className)}\n {...props}\n >\n {(renderProps) => (\n /* Layer 2: Visual Button */\n <span\n className={cn(\n buttonVisualVariants({\n variant: effectiveVariant,\n visualSize: effectiveVisualSize,\n paywall,\n fullWidth: effectiveFullWidth,\n }),\n // Position styling from ButtonGroup context (border-radius adjustments)\n positionClassName,\n buttonVisualClassName,\n // Layer 2 interaction styles (no focus - focus ring is on Layer 1)\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED\n )}\n data-pressed={renderProps.isPressed || undefined}\n >\n {/* Layer 3: Content & Effects */}\n\n {/* FR-033: Loading spinner with screen reader announcement */}\n {/* Uses motion-safe: for WCAG 2.3.3 AAA (Animation from Interactions) */}\n {loading && (\n <>\n <Loader2 className=\"motion-safe:animate-spin\" aria-hidden=\"true\" />\n <span className=\"sr-only\" aria-live=\"polite\">\n {loadingText}\n </span>\n </>\n )}\n\n {/* Hide children during loading */}\n {!loading && children}\n\n {/* Paywall: Lightning bolt icon */}\n {paywall && (\n <Zap\n data-testid=\"zap-icon\"\n aria-hidden=\"true\"\n className=\"ml-1\"\n />\n )}\n\n {/* Paywall: Screen reader description */}\n {paywall && (\n <span id={paywallDescriptionId} className=\"sr-only\">\n Premium feature: {paywallDescription || \"Upgrade required to access this feature\"}\n </span>\n )}\n\n {/* FR-034: Keyboard shortcut display on focus */}\n {renderProps.isFocusVisible && shortcut && (\n <kbd className=\"ml-auto hidden text-xs opacity-60 lg:inline\">\n {shortcut}\n </kbd>\n )}\n\n </span>\n )}\n </AriaButton>\n );\n }\n));\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants, buttonOuterVariants, buttonVisualVariants };\nexport type { ButtonProps } from './Button.types';\n","import { z } from 'zod';\n\n/**\n * Base props schema for all Themis components\n * Ensures consistent accessibility and styling APIs across the library\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements)\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AA minimum)\n */\nexport const BaseComponentPropsSchema = z.object({\n // Styling\n className: z.string().optional(),\n\n // React\n children: z.any().optional(), // ReactNode not directly supported by Zod\n id: z.string().optional(),\n\n // Accessibility (WCAG 2.2 AA requirements)\n 'aria-label': z.string().optional(),\n 'aria-labelledby': z.string().optional(),\n 'aria-describedby': z.string().optional(),\n 'aria-live': z.enum(['off', 'polite', 'assertive']).optional(),\n 'aria-hidden': z.boolean().optional(),\n\n // Testing & Development\n 'data-testid': z.string().optional(),\n});\n\nexport type BaseComponentProps = z.infer<typeof BaseComponentPropsSchema>;\n","import { z } from 'zod';\nimport { cva } from 'class-variance-authority';\nimport { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\nimport type { ReactNode } from 'react';\n\n/**\n * Flip button position variants\n * Controls where the flip button appears on the card\n *\n * @see card-prd.md US-5 (Flip Button Position)\n */\nexport const FlipButtonPositionSchema = z.enum([\n 'top-right',\n 'top-left',\n 'bottom-right',\n 'bottom-left',\n]);\nexport type FlipButtonPosition = z.infer<typeof FlipButtonPositionSchema>;\n\n/**\n * Flip button label configuration\n * Custom labels for the flip button title attribute\n *\n * @see card-prd.md US-6 (Custom Labels)\n */\nexport const FlipButtonLabelSchema = z.object({\n show: z.string().optional(),\n hide: z.string().optional(),\n});\nexport type FlipButtonLabel = z.infer<typeof FlipButtonLabelSchema>;\n\n/**\n * Flip button icon configuration\n * Custom icons for the front and back flip buttons\n */\nexport const FlipButtonIconSchema = z.object({\n /** Icon to show on front side button (default: RotateCcw) */\n front: z.custom<ReactNode>().optional(),\n /** Icon to show on back side button (default: same as front or RotateCcw) */\n back: z.custom<ReactNode>().optional(),\n});\nexport type FlipButtonIcon = z.infer<typeof FlipButtonIconSchema>;\n\n/**\n * Card root component props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n * @see card-prd.md US-2 (Flippable Card)\n * @see card-prd.md US-3 (Controlled/Uncontrolled State)\n */\nexport const CardPropsSchema = BaseComponentPropsSchema.extend({\n // Flip functionality\n /** Enable flip animation feature (defaults to false in component) */\n flippable: z.boolean().optional(),\n\n /** Content to display on the back side of the card */\n backContent: z.custom<ReactNode>().optional(),\n\n /** Controlled mode: current flip state */\n isFlipped: z.boolean().optional(),\n\n /** Uncontrolled mode: initial flip state (defaults to false in component) */\n defaultFlipped: z.boolean().optional(),\n\n /** Callback fired when flip state changes */\n onFlipChange: z.custom<(isFlipped: boolean) => void>().optional(),\n\n // Flip button configuration\n /** Position of the flip button on the card (defaults to 'top-right' in component) */\n flipButtonPosition: FlipButtonPositionSchema.optional(),\n\n /** Custom labels for the flip button title attribute */\n flipButtonLabel: FlipButtonLabelSchema.optional(),\n\n /** Custom icons for the flip button (default: RotateCcw) */\n flipButtonIcon: FlipButtonIconSchema.optional(),\n\n /** Duration of flip animation in milliseconds (defaults to 600 in component) */\n flipDuration: z.number().optional(),\n});\n\n/**\n * Explicit interface to avoid Zod 4 d.ts inference issues where\n * z.infer resolves optional fields as required through complex generics.\n */\nexport interface CardProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-live'?: 'off' | 'polite' | 'assertive';\n 'aria-hidden'?: boolean;\n 'data-testid'?: string;\n flippable?: boolean;\n backContent?: ReactNode;\n isFlipped?: boolean;\n defaultFlipped?: boolean;\n onFlipChange?: (isFlipped: boolean) => void;\n flipButtonPosition?: FlipButtonPosition;\n flipButtonLabel?: FlipButtonLabel;\n flipButtonIcon?: FlipButtonIcon;\n flipDuration?: number;\n}\n\n/**\n * Explicit variant for flippable cards.\n *\n * Prefer `FlippableCard` over `<Card flippable>` for clearer intent.\n * The `flippable` boolean is not needed — FlippableCard is always flippable.\n *\n * @see card-prd.md US-2 (Flippable Card)\n */\nexport interface FlippableCardProps {\n className?: string;\n /** Content for the front face */\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-live'?: 'off' | 'polite' | 'assertive';\n 'aria-hidden'?: boolean;\n 'data-testid'?: string;\n /** Content to display on the back side of the card */\n backContent?: ReactNode;\n /** Controlled mode: current flip state */\n isFlipped?: boolean;\n /** Uncontrolled mode: initial flip state (defaults to false) */\n defaultFlipped?: boolean;\n /** Callback fired when flip state changes */\n onFlipChange?: (isFlipped: boolean) => void;\n /** Position of the flip button (defaults to 'top-right') */\n flipButtonPosition?: FlipButtonPosition;\n /** Custom labels for the flip button aria-label */\n flipButtonLabel?: FlipButtonLabel;\n /** Custom icons for the flip button (default: RotateCcw) */\n flipButtonIcon?: FlipButtonIcon;\n /** Duration of flip animation in milliseconds (defaults to 600) */\n flipDuration?: number;\n}\n\n/**\n * CardHeader props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardHeaderPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardHeaderProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardTitle props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardTitlePropsSchema = BaseComponentPropsSchema.extend({\n /** Heading level (h1-h6) - defaults to h3 in component */\n as: z.enum(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']).optional(),\n\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardTitleProps {\n className?: string;\n children?: ReactNode;\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardDescription props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardDescriptionPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardDescriptionProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardContent props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardContentPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardContentProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardFooter props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardFooterPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardFooterProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardAction props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardActionPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardActionProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CVA variants for flip button positioning\n *\n * Provides consistent positioning classes for the flip button\n * based on the flipButtonPosition prop.\n *\n * Buttons are rendered INSIDE both front and back sides so they\n * flip along with the card content for a more natural feel.\n *\n * @see card-prd.md US-5 (Flip Button Position)\n */\nexport const flipButtonPositionVariants = cva(\n [\n 'absolute z-10 min-h-[44px] min-w-[44px] p-2',\n 'flex items-center justify-center',\n 'rounded-full bg-[var(--accent-background)]',\n 'text-[var(--primary-action)] hover:text-[var(--primary-action-hover)]',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]',\n ],\n {\n variants: {\n position: {\n 'top-right': 'top-2 right-2',\n 'top-left': 'top-2 left-2',\n 'bottom-right': 'bottom-2 right-2',\n 'bottom-left': 'bottom-2 left-2',\n },\n },\n defaultVariants: {\n position: 'top-right',\n },\n }\n);\n","'use client';\n\n/**\n * Card Component (TDD Stub)\n *\n * This is a minimal stub to allow tests to run during the RED phase.\n * Full implementation will be added in the GREEN phase.\n *\n * @see card-prd.md (Product Requirements)\n * @see plan.md (Implementation Plan)\n */\n\nimport { forwardRef, useState, useCallback, type HTMLAttributes, type ReactNode } from 'react';\nimport { RotateCcw } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport {\n flipButtonPositionVariants,\n type CardProps,\n type FlippableCardProps,\n type CardHeaderProps,\n type CardTitleProps,\n type CardDescriptionProps,\n type CardContentProps,\n type CardFooterProps,\n type CardActionProps,\n type FlipButtonPosition,\n} from './Card.types';\n\n// Hoisted static JSX — avoids re-creation on every render\nconst DEFAULT_FLIP_ICON = <RotateCcw className=\"h-5 w-5\" aria-hidden=\"true\" />;\n\n// Extracted from Card body — prevents new component type on every render\nfunction FlipButton({\n label,\n icon,\n onPress,\n position,\n}: {\n label: string;\n icon: ReactNode;\n onPress: () => void;\n position: FlipButtonPosition;\n}) {\n return (\n <Button\n variant=\"ghost\"\n visualSize=\"icon\"\n aria-hidden={true}\n excludeFromTabOrder\n onPress={onPress}\n className={flipButtonPositionVariants({ position })}\n aria-label={label}\n >\n {icon}\n </Button>\n );\n}\n\n// ============================================================================\n// FlippableCard (Explicit Variant)\n// ============================================================================\n\n/**\n * Explicit flippable card variant.\n *\n * Prefer this over `<Card flippable>` — it's self-documenting and avoids\n * a boolean mode gate inside Card's render.\n *\n * @example\n * ```tsx\n * <FlippableCard backContent={<div>Back side</div>}>\n * <CardContent>Front side</CardContent>\n * </FlippableCard>\n * ```\n */\nexport const FlippableCard = forwardRef<HTMLElement, FlippableCardProps & HTMLAttributes<HTMLElement>>(\n (props, ref) => {\n const {\n children,\n className,\n backContent,\n isFlipped: controlledFlipped,\n defaultFlipped = false,\n onFlipChange,\n flipButtonPosition = 'top-right',\n flipButtonLabel,\n flipButtonIcon,\n flipDuration = 600,\n ...rest\n } = props;\n\n // Controlled/uncontrolled state\n const [internalFlipped, setInternalFlipped] = useState(defaultFlipped);\n const isControlled = controlledFlipped !== undefined;\n const flipped = isControlled ? controlledFlipped : internalFlipped;\n\n const handleFlip = useCallback(() => {\n const newState = !flipped;\n if (!isControlled) {\n setInternalFlipped(newState);\n }\n onFlipChange?.(newState);\n }, [flipped, isControlled, onFlipChange]);\n\n const showLabel = flipButtonLabel?.show ?? 'Show more details';\n const hideLabel = flipButtonLabel?.hide ?? 'Show less details';\n\n // Custom icons (back defaults to front if not specified)\n const frontIcon = flipButtonIcon?.front ?? DEFAULT_FLIP_ICON;\n const backIcon = flipButtonIcon?.back ?? flipButtonIcon?.front ?? DEFAULT_FLIP_ICON;\n\n return (\n <article\n ref={ref}\n className={cn('relative', className)}\n style={{ perspective: '1000px' }}\n {...rest}\n >\n {/* Flipper container - handles 3D transform */}\n <div\n className={cn(\n 'relative transition-transform',\n 'motion-reduce:transition-none'\n )}\n style={{\n transformStyle: 'preserve-3d',\n transitionDuration: `${flipDuration}ms`,\n transform: flipped ? 'rotateY(180deg)' : 'rotateY(0deg)',\n }}\n data-flipped={flipped}\n >\n {/* Front side */}\n <div\n className=\"relative rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm\"\n style={{ backfaceVisibility: 'hidden' }}\n data-side=\"front\"\n >\n {children}\n <FlipButton label={showLabel} icon={frontIcon} onPress={handleFlip} position={flipButtonPosition} />\n </div>\n\n {/* Back side - scrollable if content overflows */}\n <div\n className=\"absolute inset-0 overflow-y-auto rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm\"\n style={{\n backfaceVisibility: 'hidden',\n transform: 'rotateY(180deg)',\n }}\n data-side=\"back\"\n >\n {backContent}\n <FlipButton label={hideLabel} icon={backIcon} onPress={handleFlip} position={flipButtonPosition} />\n </div>\n </div>\n </article>\n );\n }\n);\n\nFlippableCard.displayName = 'FlippableCard';\n\n// ============================================================================\n// Card (Root Component)\n// ============================================================================\n\n/**\n * Basic card container.\n *\n * For flippable cards, prefer the explicit `<FlippableCard>` variant.\n * The `flippable` prop is supported for backward compatibility.\n */\nexport const Card = forwardRef<HTMLElement, CardProps & HTMLAttributes<HTMLElement>>(\n (props, ref) => {\n const {\n children,\n className,\n flippable = false,\n backContent,\n isFlipped,\n defaultFlipped,\n onFlipChange,\n flipButtonPosition,\n flipButtonLabel,\n flipButtonIcon,\n flipDuration,\n ...rest\n } = props;\n\n // Delegate to FlippableCard when flippable mode is enabled\n if (flippable) {\n return (\n <FlippableCard\n ref={ref}\n className={className}\n backContent={backContent}\n isFlipped={isFlipped}\n defaultFlipped={defaultFlipped}\n onFlipChange={onFlipChange}\n flipButtonPosition={flipButtonPosition}\n flipButtonLabel={flipButtonLabel}\n flipButtonIcon={flipButtonIcon}\n flipDuration={flipDuration}\n {...rest}\n >\n {children}\n </FlippableCard>\n );\n }\n\n return (\n <article\n ref={ref}\n className={cn(\n 'rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm',\n className\n )}\n {...rest}\n >\n {children}\n </article>\n );\n }\n);\n\nCard.displayName = 'Card';\n\n// ============================================================================\n// CardHeader\n// ============================================================================\n\nexport const CardHeader = forwardRef<HTMLElement, CardHeaderProps & HTMLAttributes<HTMLElement>>(\n ({ className, children, ...props }, ref) => (\n <header\n ref={ref}\n className={cn('flex flex-col space-y-1.5 p-6', className)}\n {...props}\n >\n {children}\n </header>\n )\n);\n\nCardHeader.displayName = 'CardHeader';\n\n// ============================================================================\n// CardTitle\n// ============================================================================\n\nexport const CardTitle = forwardRef<HTMLHeadingElement, CardTitleProps & HTMLAttributes<HTMLHeadingElement>>(\n ({ className, as: Comp = 'h3', children, ...props }, ref) => (\n <Comp\n ref={ref}\n className={cn('text-2xl font-semibold leading-none tracking-tight', className)}\n {...props}\n >\n {children}\n </Comp>\n )\n);\n\nCardTitle.displayName = 'CardTitle';\n\n// ============================================================================\n// CardDescription\n// ============================================================================\n\nexport const CardDescription = forwardRef<HTMLParagraphElement, CardDescriptionProps & HTMLAttributes<HTMLParagraphElement>>(\n ({ className, children, ...props }, ref) => (\n <p\n ref={ref}\n className={cn('text-sm text-[var(--content-foreground-muted)]', className)}\n {...props}\n >\n {children}\n </p>\n )\n);\n\nCardDescription.displayName = 'CardDescription';\n\n// ============================================================================\n// CardContent\n// ============================================================================\n\nexport const CardContent = forwardRef<HTMLDivElement, CardContentProps & HTMLAttributes<HTMLDivElement>>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={cn('p-6 pt-0', className)} {...props}>\n {children}\n </div>\n )\n);\n\nCardContent.displayName = 'CardContent';\n\n// ============================================================================\n// CardFooter\n// ============================================================================\n\nexport const CardFooter = forwardRef<HTMLElement, CardFooterProps & HTMLAttributes<HTMLElement>>(\n ({ className, children, ...props }, ref) => (\n <footer\n ref={ref}\n className={cn('flex items-center p-6 pt-0', className)}\n {...props}\n >\n {children}\n </footer>\n )\n);\n\nCardFooter.displayName = 'CardFooter';\n\n// ============================================================================\n// CardAction\n// ============================================================================\n\nexport const CardAction = forwardRef<HTMLDivElement, CardActionProps & HTMLAttributes<HTMLDivElement>>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('ml-auto', className)}\n {...props}\n >\n {children}\n </div>\n )\n);\n\nCardAction.displayName = 'CardAction';\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/Button/Button.styles.ts","../../../src/styles/interaction-states.ts","../../../src/elements/ButtonGroup/ButtonGroupContext.tsx","../../../src/elements/ButtonGroup/ButtonGroup.variants.ts","../../../src/elements/Button/Button.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/Card/Card.types.ts","../../../src/elements/Card/Card.tsx"],"names":["cn","inputs","twMerge","clsx","buttonOuterVariants","cva","buttonVisualVariants","PRESSED_STYLES","HOVER_STYLES","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","ButtonGroupContext","createContext","useButtonGroupContext","useContext","ButtonGroupItemContext","useButtonGroupItemContext","buttonGroupItemVariants","Button","memo","forwardRef","className","buttonVisualClassName","variant","size","visualSize","fullWidth","loading","loadingText","shortcut","children","isDisabled","paywall","paywallRedirect","paywallDescription","onPress","props","ref","paywallDescriptionId","useId","groupContext","itemContext","effectiveVariant","effectiveSize","effectiveIsDisabled","isInVerticalGroup","effectiveFullWidth","positionClassName","effectiveVisualSize","jsx","AriaButton","e","renderProps","jsxs","Fragment","Loader2","Zap","BaseComponentPropsSchema","z","FlipButtonPositionSchema","FlipButtonLabelSchema","FlipButtonIconSchema","CardPropsSchema","CardHeaderPropsSchema","CardTitlePropsSchema","CardDescriptionPropsSchema","CardContentPropsSchema","CardFooterPropsSchema","CardActionPropsSchema","flipButtonPositionVariants","DEFAULT_FLIP_ICON","RotateCcw","FlipButton","label","icon","position","FlippableCard","backContent","controlledFlipped","defaultFlipped","onFlipChange","flipButtonPosition","flipButtonLabel","flipButtonIcon","flipDuration","rest","internalFlipped","setInternalFlipped","useState","isControlled","flipped","handleFlip","useCallback","newState","showLabel","hideLabel","frontIcon","backIcon","Card","flippable","isFlipped","CardHeader","CardTitle","Comp","CardDescription","CardContent","CardFooter","CardAction"],"mappings":"kWAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCLO,IAAMG,CAAAA,CAAsBC,GAAAA,CACjC,0PACA,CACE,QAAA,CAAU,CACR,SAAA,CAAW,CACT,KAAM,QAAA,CACN,KAAA,CAAO,EACT,CAAA,CACA,gBAAiB,CACf,IAAA,CAAM,gBACN,KAAA,CAAO,cACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,SAAA,CAAW,KAAA,CACX,gBAAiB,KACnB,CACF,CACF,CAAA,CAQaC,CAAAA,CAAuBD,IAClC,2WAAA,CACA,CACE,QAAA,CAAU,CACR,QAAS,CACP,OAAA,CACE,2IACF,WAAA,CACE,iMAAA,CACF,QACE,gGAAA,CACF,SAAA,CACE,uHAAA,CACF,KAAA,CACE,iEACF,IAAA,CAAM,mHACR,EACA,SAAA,CAAW,CACT,KAAM,QAAA,CACN,KAAA,CAAO,EACT,CAAA,CACA,WAAY,CACV,OAAA,CAAS,iBACT,EAAA,CAAI,6BAAA,CACJ,GAAI,sBAAA,CACJ,IAAA,CAAM,YACN,GAAA,CAAK,0CACP,EACA,OAAA,CAAS,CACP,KAAM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/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { cva } from 'class-variance-authority';\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * Handles WCAG 2.2 AAA touch target requirement\n * Always transparent, centers the visual button inside\n * IMPORTANT: Focus ring stays on Layer 1 for AAA compliance (2.4.13)\n *\n * In vertical ButtonGroups, uses items-stretch so the visual layer (Layer 2)\n * can fill the full touch target height, eliminating gaps between buttons.\n */\nexport const buttonOuterVariants = cva(\n \"inline-flex justify-center min-h-[44px] min-w-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n inVerticalGroup: {\n true: \"items-stretch\",\n false: \"items-center\",\n },\n },\n defaultVariants: {\n fullWidth: false,\n inVerticalGroup: false,\n },\n }\n);\n\n/**\n * Layer 2: Visual button appearance (adjustable size)\n * Provides the visual appearance with configurable size\n * Can be smaller than touch target for use cases like carousel dots\n * NOTE: NO focus-visible styles here - focus ring is on Layer 1\n */\nexport const buttonVisualVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background motion-safe:transition-transform motion-safe:duration-200 motion-safe:[transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer\",\n {\n variants: {\n variant: {\n default:\n \"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] hover:-translate-y-1\",\n destructive:\n \"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background-hover,var(--destructive-background))] motion-safe:hover:btn-warn-shake\",\n outline:\n \"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)]\",\n secondary:\n \"bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary-hover,var(--secondary))]\",\n ghost:\n \"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]\",\n link: \"text-[var(--text-link)] underline underline-offset-4 hover:bg-[var(--accent)] hover:text-[var(--text-link-hover)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n visualSize: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3 text-xs\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n dot: \"h-5 w-5 rounded-full p-0 min-h-0 min-w-0\",\n },\n paywall: {\n true: \"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n visualSize: \"default\",\n paywall: false,\n },\n }\n);\n\n/**\n * @deprecated Use buttonVisualVariants instead. This alias is kept for backward compatibility.\n */\nexport const buttonVariants = buttonVisualVariants;\n","/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"data-[hovered]:shadow-md\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","\"use client\";\n\nimport { createContext, useContext } from 'react';\nimport type {\n ButtonGroupContextValue,\n ButtonGroupItemContextValue,\n} from './ButtonGroup.types';\n\n/**\n * ButtonGroup Context System (Two-Level)\n *\n * Provides a two-level context pattern for ButtonGroup:\n *\n * 1. ButtonGroupContext (group-level):\n * - Provides: orientation, variant, size, isDisabled\n * - Consumed by: Button (for prop inheritance), Separator (for orientation)\n *\n * 2. ButtonGroupItemContext (item-level):\n * - Provides: position ('first' | 'middle' | 'last' | 'only')\n * - Consumed by: Button (for border-radius styling)\n *\n * Both contexts return null when not in a provider, allowing Button\n * to work standalone without any group context.\n *\n * @see plan.md for architecture details\n * @see ButtonGroup.tsx for Provider implementation\n */\n\n// =============================================================================\n// Group-Level Context\n// =============================================================================\n\n/**\n * Context for group-level props (orientation, variant, size, isDisabled)\n * Default value is null to indicate \"not in a group\"\n */\nconst ButtonGroupContext = createContext<ButtonGroupContextValue | null>(null);\n\nButtonGroupContext.displayName = 'ButtonGroupContext';\n\n/**\n * Hook to access group-level context\n * @returns ButtonGroupContextValue if inside a ButtonGroup, null otherwise\n */\nexport function useButtonGroupContext(): ButtonGroupContextValue | null {\n return useContext(ButtonGroupContext);\n}\n\n// =============================================================================\n// Item-Level Context\n// =============================================================================\n\n/**\n * Context for per-button position information\n * Default value is null to indicate \"not wrapped with position context\"\n */\nconst ButtonGroupItemContext =\n createContext<ButtonGroupItemContextValue | null>(null);\n\nButtonGroupItemContext.displayName = 'ButtonGroupItemContext';\n\n/**\n * Hook to access item-level context (position)\n * @returns ButtonGroupItemContextValue if wrapped with position context, null otherwise\n */\nexport function useButtonGroupItemContext(): ButtonGroupItemContextValue | null {\n return useContext(ButtonGroupItemContext);\n}\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroupContext, ButtonGroupItemContext };\n","import { cva } from 'class-variance-authority';\n\n/**\n * ButtonGroup CVA Variants\n *\n * Defines Class Variance Authority (CVA) variants for:\n * - ButtonGroup container (orientation-based layout)\n * - ButtonGroupItem (position-based border-radius)\n * - ButtonGroupSeparator (orientation-based styling)\n *\n * @see plan.md Phase 1: Design & Contracts - CVA Variants\n * @see constitution.md Principle V (Component Quality Standards)\n */\n\n// =============================================================================\n// Container Variants\n// =============================================================================\n\n/**\n * ButtonGroup container variants\n * Controls the layout direction based on orientation\n * Uses gap-0 to ensure buttons are connected (share borders)\n */\nexport const buttonGroupVariants = cva('inline-flex items-center gap-0', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col w-full',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// =============================================================================\n// Item Position Variants\n// =============================================================================\n\n/**\n * ButtonGroupItem position variants\n * Applied to Button's visual layer (Layer 2) for position-aware border-radius\n *\n * Compound variants handle both orientation and position combinations:\n * - Horizontal: left/right borders and radii\n * - Vertical: top/bottom borders and radii\n */\nexport const buttonGroupItemVariants = cva('', {\n variants: {\n orientation: {\n // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)\n horizontal: 'min-w-[44px]',\n // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,\n // eliminating gaps between stacked buttons in vertical orientation\n vertical: 'flex min-h-[44px]',\n },\n position: {\n first: '',\n middle: '',\n last: '',\n only: '', // Single button - no modifications needed\n },\n },\n compoundVariants: [\n // ==========================================================================\n // Horizontal Orientation\n // ==========================================================================\n {\n orientation: 'horizontal',\n position: 'first',\n className: 'rounded-r-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'middle',\n className: 'rounded-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'last',\n className: 'rounded-l-none',\n },\n // ==========================================================================\n // Vertical Orientation\n // Note: w-full is handled by Button's effectiveFullWidth for both layers\n // ==========================================================================\n {\n orientation: 'vertical',\n position: 'first',\n className: 'rounded-b-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'middle',\n className: 'rounded-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'last',\n className: 'rounded-t-none',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n position: 'only',\n },\n});\n\n// =============================================================================\n// Separator Variants\n// =============================================================================\n\n/**\n * ButtonGroupSeparator variants\n * Orientation-aware visual divider between button groups\n */\nexport const buttonGroupSeparatorVariants = cva('bg-[var(--border)]', {\n variants: {\n orientation: {\n horizontal: 'w-px h-6 mx-1',\n vertical: 'h-px w-full my-1',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n","\"use client\";\n\n/**\n * Button Component - 3-Layer Architecture\n * Accessible button with React Aria primitives and CVA styling\n *\n * Architecture:\n * - Layer 1: Touch Target (44x44px WCAG AAA compliant, transparent)\n * - Layer 2: Visual Button (configurable size, colors, borders)\n * - Layer 3: Content & Effects (text, icons, ripple, loading spinner)\n *\n * @see 3layer-plan.md for architecture details\n * @see spec.md FR-029 to FR-037 (Button Component Requirements)\n * @see spec.md FR-009 (WCAG 2.2 AAA - 7:1 contrast ratio)\n * @see spec.md FR-014 (44x44px minimum touch targets)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, useId } from 'react';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { Loader2, Zap } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { ButtonProps } from './Button.types';\nimport { buttonOuterVariants, buttonVisualVariants, buttonVariants } from './Button.styles';\nimport { PRESSED_STYLES, HOVER_STYLES, HIGH_CONTRAST_HOVER, HIGH_CONTRAST_PRESSED } from '../../styles/interaction-states';\nimport {\n useButtonGroupContext,\n useButtonGroupItemContext,\n} from '../ButtonGroup/ButtonGroupContext';\nimport { buttonGroupItemVariants } from '../ButtonGroup/ButtonGroup.variants';\n\n/**\n * Button Component - 3-Layer Architecture\n * Fully accessible button with React Aria and themed styling\n *\n * Layer 1: Touch Target (AriaButton) - 44x44px WCAG AAA compliant\n * Layer 2: Visual Button (span) - configurable appearance\n * Layer 3: Content (children) - text, icons, effects\n */\nconst Button = memo(forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n buttonVisualClassName,\n variant,\n size,\n visualSize,\n fullWidth,\n loading = false,\n loadingText = \"Loading...\",\n shortcut,\n children,\n isDisabled,\n paywall = false,\n paywallRedirect,\n paywallDescription,\n onPress,\n ...props\n },\n ref\n ) => {\n const paywallDescriptionId = useId();\n\n // ==========================================================================\n // ButtonGroup Context Integration\n // ==========================================================================\n\n // Consume group-level context (variant, size, isDisabled, orientation)\n const groupContext = useButtonGroupContext();\n\n // Consume item-level context (position for border-radius styling)\n const itemContext = useButtonGroupItemContext();\n\n // Merge context values with props (props take precedence)\n const effectiveVariant = variant ?? groupContext?.variant ?? 'default';\n const effectiveSize = size ?? groupContext?.size;\n const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;\n\n // In vertical groups, buttons should be full width automatically\n const isInVerticalGroup = groupContext?.orientation === 'vertical';\n const effectiveFullWidth = fullWidth || isInVerticalGroup;\n\n // Position styling for ButtonGroup (only applied when in a group)\n const positionClassName = itemContext\n ? buttonGroupItemVariants({\n orientation: groupContext?.orientation ?? 'horizontal',\n position: itemContext.position,\n })\n : '';\n\n // Default visualSize to size for backward compatibility\n const effectiveVisualSize = visualSize ?? effectiveSize ?? 'default';\n\n // AAA Accessibility: Warn in dev/test if icon/dot variant lacks accessible name\n if (process.env.NODE_ENV !== 'production') {\n if (\n (effectiveVisualSize === 'dot' || effectiveVisualSize === 'icon') &&\n !props['aria-label'] &&\n !children\n ) {\n console.warn(\n '[Button] visualSize=\"dot\" or \"icon\" requires aria-label when no visible text is provided (WCAG 1.1.1)'\n );\n }\n }\n\n /**\n * Handle button press - intercepts action when paywalled\n * If paywalled with redirect URL, opens in new tab\n * Otherwise, calls the normal onPress handler\n */\n const handlePress = (e: Parameters<NonNullable<AriaButtonProps['onPress']>>[0]): void => {\n if (paywall) {\n if (paywallRedirect) {\n window.open(paywallRedirect, '_blank', 'noopener,noreferrer');\n }\n // Don't call onPress when paywalled\n return;\n }\n onPress?.(e);\n };\n\n // Only set isDisabled when we have a reason to disable\n // Otherwise, let slot system control disabled state (e.g., in NumberField)\n const computedIsDisabled = effectiveIsDisabled || loading || undefined;\n\n return (\n <AriaButton\n ref={ref}\n isDisabled={computedIsDisabled}\n aria-disabled={paywall ? true : undefined}\n aria-describedby={paywall ? paywallDescriptionId : undefined}\n onPress={handlePress}\n className={cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className)}\n {...props}\n >\n {(renderProps) => (\n /* Layer 2: Visual Button */\n <span\n className={cn(\n buttonVisualVariants({\n variant: effectiveVariant,\n visualSize: effectiveVisualSize,\n paywall,\n fullWidth: effectiveFullWidth,\n }),\n // Position styling from ButtonGroup context (border-radius adjustments)\n positionClassName,\n buttonVisualClassName,\n // Layer 2 interaction styles (no focus - focus ring is on Layer 1)\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED\n )}\n data-pressed={renderProps.isPressed || undefined}\n >\n {/* Layer 3: Content & Effects */}\n\n {/* FR-033: Loading spinner with screen reader announcement */}\n {/* Uses motion-safe: for WCAG 2.3.3 AAA (Animation from Interactions) */}\n {loading && (\n <>\n <Loader2 className=\"motion-safe:animate-spin\" aria-hidden=\"true\" />\n <span className=\"sr-only\" aria-live=\"polite\">\n {loadingText}\n </span>\n </>\n )}\n\n {/* Hide children during loading */}\n {!loading && children}\n\n {/* Paywall: Lightning bolt icon */}\n {paywall && (\n <Zap\n data-testid=\"zap-icon\"\n aria-hidden=\"true\"\n className=\"ml-1\"\n />\n )}\n\n {/* Paywall: Screen reader description */}\n {paywall && (\n <span id={paywallDescriptionId} className=\"sr-only\">\n Premium feature: {paywallDescription || \"Upgrade required to access this feature\"}\n </span>\n )}\n\n {/* FR-034: Keyboard shortcut display on focus */}\n {renderProps.isFocusVisible && shortcut && (\n <kbd className=\"ml-auto hidden text-xs opacity-60 lg:inline\">\n {shortcut}\n </kbd>\n )}\n\n </span>\n )}\n </AriaButton>\n );\n }\n));\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants, buttonOuterVariants, buttonVisualVariants };\nexport type { ButtonProps } from './Button.types';\n","import { z } from 'zod';\n\n/**\n * Base props schema for all Themis components\n * Ensures consistent accessibility and styling APIs across the library\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements)\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AA minimum)\n */\nexport const BaseComponentPropsSchema = z.object({\n // Styling\n className: z.string().optional(),\n\n // React\n children: z.any().optional(), // ReactNode not directly supported by Zod\n id: z.string().optional(),\n\n // Accessibility (WCAG 2.2 AA requirements)\n 'aria-label': z.string().optional(),\n 'aria-labelledby': z.string().optional(),\n 'aria-describedby': z.string().optional(),\n 'aria-live': z.enum(['off', 'polite', 'assertive']).optional(),\n 'aria-hidden': z.boolean().optional(),\n\n // Testing & Development\n 'data-testid': z.string().optional(),\n});\n\nexport type BaseComponentProps = z.infer<typeof BaseComponentPropsSchema>;\n","import { z } from 'zod';\nimport { cva } from 'class-variance-authority';\nimport { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\nimport type { ReactNode } from 'react';\n\n/**\n * Flip button position variants\n * Controls where the flip button appears on the card\n *\n * @see card-prd.md US-5 (Flip Button Position)\n */\nexport const FlipButtonPositionSchema = z.enum([\n 'top-right',\n 'top-left',\n 'bottom-right',\n 'bottom-left',\n]);\nexport type FlipButtonPosition = z.infer<typeof FlipButtonPositionSchema>;\n\n/**\n * Flip button label configuration\n * Custom labels for the flip button title attribute\n *\n * @see card-prd.md US-6 (Custom Labels)\n */\nexport const FlipButtonLabelSchema = z.object({\n show: z.string().optional(),\n hide: z.string().optional(),\n});\nexport type FlipButtonLabel = z.infer<typeof FlipButtonLabelSchema>;\n\n/**\n * Flip button icon configuration\n * Custom icons for the front and back flip buttons\n */\nexport const FlipButtonIconSchema = z.object({\n /** Icon to show on front side button (default: RotateCcw) */\n front: z.custom<ReactNode>().optional(),\n /** Icon to show on back side button (default: same as front or RotateCcw) */\n back: z.custom<ReactNode>().optional(),\n});\nexport type FlipButtonIcon = z.infer<typeof FlipButtonIconSchema>;\n\n/**\n * Card root component props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n * @see card-prd.md US-2 (Flippable Card)\n * @see card-prd.md US-3 (Controlled/Uncontrolled State)\n */\nexport const CardPropsSchema = BaseComponentPropsSchema.extend({\n // Flip functionality\n /** Enable flip animation feature (defaults to false in component) */\n flippable: z.boolean().optional(),\n\n /** Content to display on the back side of the card */\n backContent: z.custom<ReactNode>().optional(),\n\n /** Controlled mode: current flip state */\n isFlipped: z.boolean().optional(),\n\n /** Uncontrolled mode: initial flip state (defaults to false in component) */\n defaultFlipped: z.boolean().optional(),\n\n /** Callback fired when flip state changes */\n onFlipChange: z.custom<(isFlipped: boolean) => void>().optional(),\n\n // Flip button configuration\n /** Position of the flip button on the card (defaults to 'top-right' in component) */\n flipButtonPosition: FlipButtonPositionSchema.optional(),\n\n /** Custom labels for the flip button title attribute */\n flipButtonLabel: FlipButtonLabelSchema.optional(),\n\n /** Custom icons for the flip button (default: RotateCcw) */\n flipButtonIcon: FlipButtonIconSchema.optional(),\n\n /** Duration of flip animation in milliseconds (0–350ms, defaults to 250 in component) */\n flipDuration: z.number().min(0).max(350).optional(),\n});\n\n/**\n * Explicit interface to avoid Zod 4 d.ts inference issues where\n * z.infer resolves optional fields as required through complex generics.\n */\nexport interface CardProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-live'?: 'off' | 'polite' | 'assertive';\n 'aria-hidden'?: boolean;\n 'data-testid'?: string;\n flippable?: boolean;\n backContent?: ReactNode;\n isFlipped?: boolean;\n defaultFlipped?: boolean;\n onFlipChange?: (isFlipped: boolean) => void;\n flipButtonPosition?: FlipButtonPosition;\n flipButtonLabel?: FlipButtonLabel;\n flipButtonIcon?: FlipButtonIcon;\n flipDuration?: number;\n}\n\n/**\n * Explicit variant for flippable cards.\n *\n * Prefer `FlippableCard` over `<Card flippable>` for clearer intent.\n * The `flippable` boolean is not needed — FlippableCard is always flippable.\n *\n * @see card-prd.md US-2 (Flippable Card)\n */\nexport interface FlippableCardProps {\n className?: string;\n /** Content for the front face */\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-live'?: 'off' | 'polite' | 'assertive';\n 'aria-hidden'?: boolean;\n 'data-testid'?: string;\n /** Content to display on the back side of the card */\n backContent?: ReactNode;\n /** Controlled mode: current flip state */\n isFlipped?: boolean;\n /** Uncontrolled mode: initial flip state (defaults to false) */\n defaultFlipped?: boolean;\n /** Callback fired when flip state changes */\n onFlipChange?: (isFlipped: boolean) => void;\n /** Position of the flip button (defaults to 'top-right') */\n flipButtonPosition?: FlipButtonPosition;\n /** Custom labels for the flip button aria-label */\n flipButtonLabel?: FlipButtonLabel;\n /** Custom icons for the flip button (default: RotateCcw) */\n flipButtonIcon?: FlipButtonIcon;\n /** Duration of flip animation in milliseconds (0–350ms, defaults to 250) */\n flipDuration?: number;\n}\n\n/**\n * CardHeader props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardHeaderPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardHeaderProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardTitle props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardTitlePropsSchema = BaseComponentPropsSchema.extend({\n /** Heading level (h1-h6) - defaults to h3 in component */\n as: z.enum(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']).optional(),\n\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardTitleProps {\n className?: string;\n children?: ReactNode;\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardDescription props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardDescriptionPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardDescriptionProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardContent props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardContentPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardContentProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardFooter props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardFooterPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardFooterProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CardAction props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardActionPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport interface CardActionProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'data-testid'?: string;\n}\n\n/**\n * CVA variants for flip button positioning\n *\n * Provides consistent positioning classes for the flip button\n * based on the flipButtonPosition prop.\n *\n * Buttons are rendered INSIDE both front and back sides so they\n * flip along with the card content for a more natural feel.\n *\n * @see card-prd.md US-5 (Flip Button Position)\n */\nexport const flipButtonPositionVariants = cva(\n [\n 'absolute z-10 min-h-[44px] min-w-[44px] p-2',\n 'flex items-center justify-center',\n 'rounded-full bg-[var(--accent-background)]',\n 'text-[var(--primary-action)] hover:text-[var(--primary-action-hover)]',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]',\n ],\n {\n variants: {\n position: {\n 'top-right': 'top-2 right-2',\n 'top-left': 'top-2 left-2',\n 'bottom-right': 'bottom-2 right-2',\n 'bottom-left': 'bottom-2 left-2',\n },\n },\n defaultVariants: {\n position: 'top-right',\n },\n }\n);\n","'use client';\n\n/**\n * Card Component (TDD Stub)\n *\n * This is a minimal stub to allow tests to run during the RED phase.\n * Full implementation will be added in the GREEN phase.\n *\n * @see card-prd.md (Product Requirements)\n * @see plan.md (Implementation Plan)\n */\n\nimport { forwardRef, useState, useCallback, type HTMLAttributes, type ReactNode } from 'react';\nimport { RotateCcw } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport {\n flipButtonPositionVariants,\n type CardProps,\n type FlippableCardProps,\n type CardHeaderProps,\n type CardTitleProps,\n type CardDescriptionProps,\n type CardContentProps,\n type CardFooterProps,\n type CardActionProps,\n type FlipButtonPosition,\n} from './Card.types';\n\n// Hoisted static JSX — avoids re-creation on every render\nconst DEFAULT_FLIP_ICON = <RotateCcw className=\"h-5 w-5\" aria-hidden=\"true\" />;\n\n// Extracted from Card body — prevents new component type on every render\nfunction FlipButton({\n label,\n icon,\n onPress,\n position,\n}: {\n label: string;\n icon: ReactNode;\n onPress: () => void;\n position: FlipButtonPosition;\n}) {\n return (\n <Button\n variant=\"ghost\"\n visualSize=\"icon\"\n aria-hidden={true}\n excludeFromTabOrder\n onPress={onPress}\n className={flipButtonPositionVariants({ position })}\n aria-label={label}\n >\n {icon}\n </Button>\n );\n}\n\n// ============================================================================\n// FlippableCard (Explicit Variant)\n// ============================================================================\n\n/**\n * Explicit flippable card variant.\n *\n * Prefer this over `<Card flippable>` — it's self-documenting and avoids\n * a boolean mode gate inside Card's render.\n *\n * @example\n * ```tsx\n * <FlippableCard backContent={<div>Back side</div>}>\n * <CardContent>Front side</CardContent>\n * </FlippableCard>\n * ```\n */\nexport const FlippableCard = forwardRef<HTMLElement, FlippableCardProps & HTMLAttributes<HTMLElement>>(\n (props, ref) => {\n const {\n children,\n className,\n backContent,\n isFlipped: controlledFlipped,\n defaultFlipped = false,\n onFlipChange,\n flipButtonPosition = 'top-right',\n flipButtonLabel,\n flipButtonIcon,\n flipDuration = 250,\n ...rest\n } = props;\n\n // Controlled/uncontrolled state\n const [internalFlipped, setInternalFlipped] = useState(defaultFlipped);\n const isControlled = controlledFlipped !== undefined;\n const flipped = isControlled ? controlledFlipped : internalFlipped;\n\n const handleFlip = useCallback(() => {\n const newState = !flipped;\n if (!isControlled) {\n setInternalFlipped(newState);\n }\n onFlipChange?.(newState);\n }, [flipped, isControlled, onFlipChange]);\n\n const showLabel = flipButtonLabel?.show ?? 'Show more details';\n const hideLabel = flipButtonLabel?.hide ?? 'Show less details';\n\n // Custom icons (back defaults to front if not specified)\n const frontIcon = flipButtonIcon?.front ?? DEFAULT_FLIP_ICON;\n const backIcon = flipButtonIcon?.back ?? flipButtonIcon?.front ?? DEFAULT_FLIP_ICON;\n\n return (\n <article\n ref={ref}\n className={cn('relative', className)}\n style={{ perspective: '1000px' }}\n {...rest}\n >\n {/* Flipper container - handles 3D transform */}\n <div\n className={cn(\n 'relative transition-transform',\n 'motion-reduce:transition-none'\n )}\n style={{\n transformStyle: 'preserve-3d',\n transitionDuration: `${flipDuration}ms`,\n transform: flipped ? 'rotateY(180deg)' : 'rotateY(0deg)',\n }}\n data-flipped={flipped}\n >\n {/* Front side */}\n <div\n className=\"relative rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm\"\n style={{ backfaceVisibility: 'hidden' }}\n data-side=\"front\"\n >\n {children}\n <FlipButton label={showLabel} icon={frontIcon} onPress={handleFlip} position={flipButtonPosition} />\n </div>\n\n {/* Back side - scrollable if content overflows */}\n <div\n className=\"absolute inset-0 overflow-y-auto rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm\"\n style={{\n backfaceVisibility: 'hidden',\n transform: 'rotateY(180deg)',\n }}\n data-side=\"back\"\n >\n {backContent}\n <FlipButton label={hideLabel} icon={backIcon} onPress={handleFlip} position={flipButtonPosition} />\n </div>\n </div>\n </article>\n );\n }\n);\n\nFlippableCard.displayName = 'FlippableCard';\n\n// ============================================================================\n// Card (Root Component)\n// ============================================================================\n\n/**\n * Basic card container.\n *\n * For flippable cards, prefer the explicit `<FlippableCard>` variant.\n * The `flippable` prop is supported for backward compatibility.\n */\nexport const Card = forwardRef<HTMLElement, CardProps & HTMLAttributes<HTMLElement>>(\n (props, ref) => {\n const {\n children,\n className,\n flippable = false,\n backContent,\n isFlipped,\n defaultFlipped,\n onFlipChange,\n flipButtonPosition,\n flipButtonLabel,\n flipButtonIcon,\n flipDuration,\n ...rest\n } = props;\n\n // Delegate to FlippableCard when flippable mode is enabled\n if (flippable) {\n return (\n <FlippableCard\n ref={ref}\n className={className}\n backContent={backContent}\n isFlipped={isFlipped}\n defaultFlipped={defaultFlipped}\n onFlipChange={onFlipChange}\n flipButtonPosition={flipButtonPosition}\n flipButtonLabel={flipButtonLabel}\n flipButtonIcon={flipButtonIcon}\n flipDuration={flipDuration}\n {...rest}\n >\n {children}\n </FlippableCard>\n );\n }\n\n return (\n <article\n ref={ref}\n className={cn(\n 'rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm',\n className\n )}\n {...rest}\n >\n {children}\n </article>\n );\n }\n);\n\nCard.displayName = 'Card';\n\n// ============================================================================\n// CardHeader\n// ============================================================================\n\nexport const CardHeader = forwardRef<HTMLElement, CardHeaderProps & HTMLAttributes<HTMLElement>>(\n ({ className, children, ...props }, ref) => (\n <header\n ref={ref}\n className={cn('flex flex-col space-y-1.5 p-6', className)}\n {...props}\n >\n {children}\n </header>\n )\n);\n\nCardHeader.displayName = 'CardHeader';\n\n// ============================================================================\n// CardTitle\n// ============================================================================\n\nexport const CardTitle = forwardRef<HTMLHeadingElement, CardTitleProps & HTMLAttributes<HTMLHeadingElement>>(\n ({ className, as: Comp = 'h3', children, ...props }, ref) => (\n <Comp\n ref={ref}\n className={cn('text-2xl font-semibold leading-none tracking-tight', className)}\n {...props}\n >\n {children}\n </Comp>\n )\n);\n\nCardTitle.displayName = 'CardTitle';\n\n// ============================================================================\n// CardDescription\n// ============================================================================\n\nexport const CardDescription = forwardRef<HTMLParagraphElement, CardDescriptionProps & HTMLAttributes<HTMLParagraphElement>>(\n ({ className, children, ...props }, ref) => (\n <p\n ref={ref}\n className={cn('text-sm text-[var(--content-foreground-muted)]', className)}\n {...props}\n >\n {children}\n </p>\n )\n);\n\nCardDescription.displayName = 'CardDescription';\n\n// ============================================================================\n// CardContent\n// ============================================================================\n\nexport const CardContent = forwardRef<HTMLDivElement, CardContentProps & HTMLAttributes<HTMLDivElement>>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={cn('p-6 pt-0', className)} {...props}>\n {children}\n </div>\n )\n);\n\nCardContent.displayName = 'CardContent';\n\n// ============================================================================\n// CardFooter\n// ============================================================================\n\nexport const CardFooter = forwardRef<HTMLElement, CardFooterProps & HTMLAttributes<HTMLElement>>(\n ({ className, children, ...props }, ref) => (\n <footer\n ref={ref}\n className={cn('flex items-center p-6 pt-0', className)}\n {...props}\n >\n {children}\n </footer>\n )\n);\n\nCardFooter.displayName = 'CardFooter';\n\n// ============================================================================\n// CardAction\n// ============================================================================\n\nexport const CardAction = forwardRef<HTMLDivElement, CardActionProps & HTMLAttributes<HTMLDivElement>>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('ml-auto', className)}\n {...props}\n >\n {children}\n </div>\n )\n);\n\nCardAction.displayName = 'CardAction';\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var react=require('react'),classVarianceAuthority=require('class-variance-authority'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function r(...a){return tailwindMerge.twMerge(clsx.clsx(a))}var g=classVarianceAuthority.cva("grid grid-cols-1 mt-6",{variants:{columns:{1:"",2:"md:grid-cols-2"},density:{default:"gap-4",compact:"gap-2",comfortable:"gap-
|
|
2
|
+
'use strict';var react=require('react'),classVarianceAuthority=require('class-variance-authority'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function r(...a){return tailwindMerge.twMerge(clsx.clsx(a))}var g=classVarianceAuthority.cva("grid grid-cols-1 mt-6",{variants:{columns:{1:"",2:"md:grid-cols-2"},density:{default:"gap-4",compact:"gap-2",comfortable:"gap-5"}},defaultVariants:{columns:1,density:"default"}}),_=({level:a,id:l,className:o,children:d})=>{let i=`h${a}`;return jsxRuntime.jsx(i,{id:l,className:o,children:d})},x=react.forwardRef(({title:a,requiredNote:l,description:o,columns:d=1,headingLevel:i=2,density:b="default",errorMessage:n,successMessage:s,fieldErrors:j,autoHideSuccess:c=false,autoHideDuration:f=5e3,className:N,children:h,actions:u,id:m,"data-testid":L,"aria-label":p,"aria-labelledby":F,"aria-describedby":w,...C},k)=>{let E=react.useId(),y=m?`${m}-title`:E,H=F||y,[S,v]=react.useState(true);return react.useEffect(()=>{if(v(true),s&&c){let P=setTimeout(()=>{v(false);},f);return ()=>clearTimeout(P)}},[s,c,f]),jsxRuntime.jsxs("section",{ref:k,id:m,"data-testid":L,"aria-label":p,"aria-labelledby":p?void 0:H,"aria-describedby":w,className:r("form-layout w-full",N),...C,children:[n&&jsxRuntime.jsxs("div",{role:"alert","aria-live":"assertive","data-testid":"form-layout-error",className:r("rounded-lg border px-4 py-3 mb-6 text-sm","border-[var(--destructive-background)] bg-[var(--destructive-foreground)] text-[var(--destructive-background)]","flex items-start gap-3"),children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-5 w-5 flex-shrink-0 mt-0.5","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"font-medium",children:"Error"}),jsxRuntime.jsx("p",{className:"mt-1",children:n})]})]}),s&&S&&jsxRuntime.jsxs("div",{role:"status","aria-live":"polite","data-testid":"form-layout-success",className:r("rounded-lg border px-4 py-3 mb-6 text-sm","border-success bg-success/10 text-success","flex items-start gap-3"),children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"h-5 w-5 flex-shrink-0 mt-0.5","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"font-medium",children:"Success"}),jsxRuntime.jsx("p",{className:"mt-1",children:s})]})]}),jsxRuntime.jsxs("header",{className:"form-layout-header mb-6",children:[jsxRuntime.jsx(_,{level:i,id:y,className:"text-[var(--content-foreground)] font-semibold",children:a}),o&&jsxRuntime.jsx("p",{className:"text-sm text-[var(--content-foreground)] leading-relaxed mt-2",children:o}),jsxRuntime.jsx("p",{className:"text-sm text-[var(--content-foreground)]",children:l})]}),jsxRuntime.jsx("div",{"data-testid":"form-layout-body",className:r(g({columns:d,density:b})),children:h}),u&&jsxRuntime.jsx("div",{"data-testid":"form-layout-actions",className:"flex justify-between items-center mt-4 gap-2 max-md:flex-col max-md:w-full",children:u})]})});x.displayName="FormLayout";exports.FormLayout=x;exports.formLayoutBodyVariants=g;//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/FormLayout/FormLayout.tsx"],"names":["cn","inputs","twMerge","clsx","formLayoutBodyVariants","cva","Heading","level","id","className","children","Tag","jsx","FormLayout","forwardRef","title","requiredNote","description","columns","headingLevel","density","errorMessage","successMessage","_fieldErrors","autoHideSuccess","autoHideDuration","actions","dataTestId","ariaLabel","ariaLabelledby","ariaDescribedby","props","ref","headingId","useId","finalHeadingId","finalAriaLabelledby","showSuccess","setShowSuccess","useState","useEffect","timer","jsxs","AlertCircle","CheckCircle2"],"mappings":"4OAcO,SAASA,KAAMC,CAAAA,CAA8B,CAClD,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCMA,IAAMG,CAAAA,CAAyBC,0BAAAA,CAE7B,uBAAA,CACA,CACE,QAAA,CAAU,CAER,QAAS,CACP,CAAA,CAAG,GACH,CAAA,CAAG,gBACL,EAEA,OAAA,CAAS,CACP,QAAS,OAAA,CACT,OAAA,CAAS,QACT,WAAA,CAAa,OACf,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,CAAA,CACT,QAAS,SACX,CACF,CACF,CAAA,CAaMC,CAAAA,CAA4B,CAAC,CAAE,KAAA,CAAAC,EAAO,EAAA,CAAAC,CAAAA,CAAI,UAAAC,CAAAA,CAAW,QAAA,CAAAC,CAAS,CAAA,GAAM,CACxE,IAAMC,CAAAA,CAAM,CAAA,CAAA,EAAIJ,CAAK,CAAA,CAAA,CAErB,OACEK,cAAAA,CAACD,EAAA,CAAI,EAAA,CAAIH,EAAI,SAAA,CAA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C,UAAO,SAAA,CAAU,yBAAA,CAEhB,UAAA9B,cAAAA,CAACN,CAAAA,CAAA,CACC,KAAA,CAAOa,CAAAA,CACP,GAAIgB,CAAAA,CACJ,SAAA,CAAU,gDAAA,CAET,QAAA,CAAApB,CAAAA,CACH,CAAA,CAGCE,GACCL,cAAAA,CAAC,GAAA,CAAA,CAAE,UAAU,+DAAA,CACV,QAAA,CAAAK,EACH,CAAA,CAIFL,cAAAA,CAAC,KAAE,SAAA,CAAU,0CAAA,CACV,SAAAI,CAAAA,CACH,CAAA,CAAA,CACF,EAGAJ,cAAAA,CAAC,KAAA,CAAA,CACC,cAAY,kBAAA,CACZ,SAAA,CAAWZ,CAAAA,CACTI,CAAAA,CAAuB,CACrB,OAAA,CAAAc,EACA,OAAA,CAAAE,CACF,CAAC,CACH,CAAA,CAEC,SAAAV,CAAAA,CACH,CAAA,CAGCgB,GACCd,cAAAA,CAAC,KAAA,CAAA,CAAI,cAAY,qBAAA,CAAsB,SAAA,CAAU,6EAC9C,QAAA,CAAAc,CAAAA,CACH,GAEJ,CAEJ,CACF,EAEAb,CAAAA,CAAW,WAAA,CAAc,YAAA","file":"index.js","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\n/**\n * FormLayout Component\n * Structural layout component for consistent form presentation\n *\n * @see FormLayout-plan.md (Component API Design)\n * @see FormLayout-design-decisions.md (Approved design specifications)\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements - WCAG 2.2 AAA)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { JSX, forwardRef, FC, useId, ReactNode, useState, useEffect } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { AlertCircle, CheckCircle2 } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { FormLayoutProps, HeadingLevel } from './FormLayout.types';\n\n/**\n * Body variant styles using CVA\n * Controls column layout and field spacing (density)\n */\nconst formLayoutBodyVariants = cva(\n // Base styles - grid layout with responsive columns\n \"grid grid-cols-1 mt-6\",\n {\n variants: {\n // Column variants (responsive: mobile single, desktop optional double)\n columns: {\n 1: \"\", // Single column (no additional classes needed)\n 2: \"md:grid-cols-2\", // Double column on md breakpoint and up\n },\n // Density variants (controls gap between form fields)\n density: {\n default: \"gap-4\", // 16px gap\n compact: \"gap-2\", // 8px gap\n comfortable: \"gap-6\", // 24px gap\n },\n },\n defaultVariants: {\n columns: 1,\n density: \"default\",\n },\n }\n);\n\n/**\n * Polymorphic Heading Component\n * Renders h1-h6 based on headingLevel prop for proper document hierarchy\n */\ninterface HeadingProps {\n level: HeadingLevel;\n id: string;\n className?: string;\n children: ReactNode;\n}\n\nconst Heading: FC<HeadingProps> = ({ level, id, className, children }) => {\n const Tag = `h${level}` as keyof JSX.IntrinsicElements;\n\n return (\n <Tag id={id} className={className}>\n {children}\n </Tag>\n );\n};\n\n/**\n * FormLayout Component\n * Provides consistent form structure with header, body, and optional actions\n */\nexport const FormLayout = forwardRef<HTMLElement, FormLayoutProps>(\n (\n {\n title,\n requiredNote,\n description,\n columns = 1,\n headingLevel = 2,\n density = 'default',\n errorMessage,\n successMessage,\n fieldErrors: _fieldErrors,\n autoHideSuccess = false,\n autoHideDuration = 5000,\n className,\n children,\n actions,\n id,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n ...props\n },\n ref\n ) => {\n // Generate unique IDs for accessibility\n const headingId = useId();\n const finalHeadingId = id ? `${id}-title` : headingId;\n\n // Determine aria-labelledby (use prop if provided, otherwise point to heading)\n const finalAriaLabelledby = ariaLabelledby || finalHeadingId;\n\n // Auto-hide success message state\n const [showSuccess, setShowSuccess] = useState(true);\n\n // Auto-hide success message after duration\n useEffect(() => {\n // Reset show state when message changes (must come first!)\n setShowSuccess(true);\n\n // Set timeout to hide if autoHideSuccess is enabled\n if (successMessage && autoHideSuccess) {\n const timer = setTimeout(() => {\n setShowSuccess(false);\n }, autoHideDuration);\n\n return (): void => clearTimeout(timer);\n }\n }, [successMessage, autoHideSuccess, autoHideDuration]);\n\n return (\n <section\n ref={ref}\n id={id}\n data-testid={dataTestId}\n aria-label={ariaLabel}\n aria-labelledby={!ariaLabel ? finalAriaLabelledby : undefined}\n aria-describedby={ariaDescribedby}\n className={cn(\"form-layout w-full\", className)}\n {...props}\n >\n {/* Error Message Alert */}\n {errorMessage && (\n <div\n role=\"alert\"\n aria-live=\"assertive\"\n data-testid=\"form-layout-error\"\n className={cn(\n \"rounded-lg border px-4 py-3 mb-6 text-sm\",\n \"border-[var(--destructive-background)] bg-[var(--destructive-foreground)] text-[var(--destructive-background)]\",\n \"flex items-start gap-3\"\n )}\n >\n <AlertCircle className=\"h-5 w-5 flex-shrink-0 mt-0.5\" aria-hidden=\"true\" />\n <div className=\"flex-1\">\n <p className=\"font-medium\">Error</p>\n <p className=\"mt-1\">{errorMessage}</p>\n </div>\n </div>\n )}\n\n {/* Success Message Alert */}\n {successMessage && showSuccess && (\n <div\n role=\"status\"\n aria-live=\"polite\"\n data-testid=\"form-layout-success\"\n className={cn(\n \"rounded-lg border px-4 py-3 mb-6 text-sm\",\n \"border-success bg-success/10 text-success\",\n \"flex items-start gap-3\"\n )}\n >\n <CheckCircle2 className=\"h-5 w-5 flex-shrink-0 mt-0.5\" aria-hidden=\"true\" />\n <div className=\"flex-1\">\n <p className=\"font-medium\">Success</p>\n <p className=\"mt-1\">{successMessage}</p>\n </div>\n </div>\n )}\n\n {/* Header Section: Title → Description → Required Note */}\n <header className=\"form-layout-header mb-6\">\n {/* Title (configurable heading level) */}\n <Heading\n level={headingLevel}\n id={finalHeadingId}\n className=\"text-[var(--content-foreground)] font-semibold\"\n >\n {title}\n </Heading>\n\n {/* Description (optional) */}\n {description && (\n <p className=\"text-sm text-[var(--content-foreground)] leading-relaxed mt-2\">\n {description}\n </p>\n )}\n\n {/* Required Note (always visible) */}\n <p className=\"text-sm text-[var(--content-foreground)]\">\n {requiredNote}\n </p>\n </header>\n\n {/* Body Section: Form fields with configurable layout */}\n <div\n data-testid=\"form-layout-body\"\n className={cn(\n formLayoutBodyVariants({\n columns,\n density,\n })\n )}\n >\n {children}\n </div>\n\n {/* Actions Section: Optional footer for buttons */}\n {actions && (\n <div data-testid=\"form-layout-actions\" className=\"flex justify-between items-center mt-4 gap-2 max-md:flex-col max-md:w-full\">\n {actions}\n </div>\n )}\n </section>\n );\n }\n);\n\nFormLayout.displayName = \"FormLayout\";\n\nexport { formLayoutBodyVariants };\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/FormLayout/FormLayout.tsx"],"names":["cn","inputs","twMerge","clsx","formLayoutBodyVariants","cva","Heading","level","id","className","children","Tag","jsx","FormLayout","forwardRef","title","requiredNote","description","columns","headingLevel","density","errorMessage","successMessage","_fieldErrors","autoHideSuccess","autoHideDuration","actions","dataTestId","ariaLabel","ariaLabelledby","ariaDescribedby","props","ref","headingId","useId","finalHeadingId","finalAriaLabelledby","showSuccess","setShowSuccess","useState","useEffect","timer","jsxs","AlertCircle","CheckCircle2"],"mappings":"4OAcO,SAASA,KAAMC,CAAAA,CAA8B,CAClD,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCMA,IAAMG,CAAAA,CAAyBC,0BAAAA,CAE7B,uBAAA,CACA,CACE,QAAA,CAAU,CAER,QAAS,CACP,CAAA,CAAG,GACH,CAAA,CAAG,gBACL,EAEA,OAAA,CAAS,CACP,QAAS,OAAA,CACT,OAAA,CAAS,QACT,WAAA,CAAa,OACf,CACF,CAAA,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,cAAAA,CAACgC,wBAAAA,CAAA,CAAa,SAAA,CAAU,8BAAA,CAA+B,cAAY,MAAA,CAAO,CAAA,CAC1EF,gBAAC,KAAA,CAAA,CAAI,SAAA,CAAU,SACb,QAAA,CAAA,CAAA9B,cAAAA,CAAC,KAAE,SAAA,CAAU,aAAA,CAAc,mBAAO,CAAA,CAClCA,cAAAA,CAAC,KAAE,SAAA,CAAU,MAAA,CAAQ,SAAAU,CAAAA,CAAe,CAAA,CAAA,CACtC,GACF,CAAA,CAIFoB,eAAAA,CAAC,UAAO,SAAA,CAAU,yBAAA,CAEhB,UAAA9B,cAAAA,CAACN,CAAAA,CAAA,CACC,KAAA,CAAOa,CAAAA,CACP,GAAIgB,CAAAA,CACJ,SAAA,CAAU,gDAAA,CAET,QAAA,CAAApB,CAAAA,CACH,CAAA,CAGCE,GACCL,cAAAA,CAAC,GAAA,CAAA,CAAE,UAAU,+DAAA,CACV,QAAA,CAAAK,EACH,CAAA,CAIFL,cAAAA,CAAC,KAAE,SAAA,CAAU,0CAAA,CACV,SAAAI,CAAAA,CACH,CAAA,CAAA,CACF,EAGAJ,cAAAA,CAAC,KAAA,CAAA,CACC,cAAY,kBAAA,CACZ,SAAA,CAAWZ,CAAAA,CACTI,CAAAA,CAAuB,CACrB,OAAA,CAAAc,EACA,OAAA,CAAAE,CACF,CAAC,CACH,CAAA,CAEC,SAAAV,CAAAA,CACH,CAAA,CAGCgB,GACCd,cAAAA,CAAC,KAAA,CAAA,CAAI,cAAY,qBAAA,CAAsB,SAAA,CAAU,6EAC9C,QAAA,CAAAc,CAAAA,CACH,GAEJ,CAEJ,CACF,EAEAb,CAAAA,CAAW,WAAA,CAAc,YAAA","file":"index.js","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\n/**\n * FormLayout Component\n * Structural layout component for consistent form presentation\n *\n * @see FormLayout-plan.md (Component API Design)\n * @see FormLayout-design-decisions.md (Approved design specifications)\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements - WCAG 2.2 AAA)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { JSX, forwardRef, FC, useId, ReactNode, useState, useEffect } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { AlertCircle, CheckCircle2 } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { FormLayoutProps, HeadingLevel } from './FormLayout.types';\n\n/**\n * Body variant styles using CVA\n * Controls column layout and field spacing (density)\n */\nconst formLayoutBodyVariants = cva(\n // Base styles - grid layout with responsive columns\n \"grid grid-cols-1 mt-6\",\n {\n variants: {\n // Column variants (responsive: mobile single, desktop optional double)\n columns: {\n 1: \"\", // Single column (no additional classes needed)\n 2: \"md:grid-cols-2\", // Double column on md breakpoint and up\n },\n // Density variants (controls gap between form fields)\n density: {\n default: \"gap-4\", // 16px gap\n compact: \"gap-2\", // 8px gap\n comfortable: \"gap-5\", // 20px gap (24px is reserved for section-level spacing per design spec)\n },\n },\n defaultVariants: {\n columns: 1,\n density: \"default\",\n },\n }\n);\n\n/**\n * Polymorphic Heading Component\n * Renders h1-h6 based on headingLevel prop for proper document hierarchy\n */\ninterface HeadingProps {\n level: HeadingLevel;\n id: string;\n className?: string;\n children: ReactNode;\n}\n\nconst Heading: FC<HeadingProps> = ({ level, id, className, children }) => {\n const Tag = `h${level}` as keyof JSX.IntrinsicElements;\n\n return (\n <Tag id={id} className={className}>\n {children}\n </Tag>\n );\n};\n\n/**\n * FormLayout Component\n * Provides consistent form structure with header, body, and optional actions\n */\nexport const FormLayout = forwardRef<HTMLElement, FormLayoutProps>(\n (\n {\n title,\n requiredNote,\n description,\n columns = 1,\n headingLevel = 2,\n density = 'default',\n errorMessage,\n successMessage,\n fieldErrors: _fieldErrors,\n autoHideSuccess = false,\n autoHideDuration = 5000,\n className,\n children,\n actions,\n id,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n ...props\n },\n ref\n ) => {\n // Generate unique IDs for accessibility\n const headingId = useId();\n const finalHeadingId = id ? `${id}-title` : headingId;\n\n // Determine aria-labelledby (use prop if provided, otherwise point to heading)\n const finalAriaLabelledby = ariaLabelledby || finalHeadingId;\n\n // Auto-hide success message state\n const [showSuccess, setShowSuccess] = useState(true);\n\n // Auto-hide success message after duration\n useEffect(() => {\n // Reset show state when message changes (must come first!)\n setShowSuccess(true);\n\n // Set timeout to hide if autoHideSuccess is enabled\n if (successMessage && autoHideSuccess) {\n const timer = setTimeout(() => {\n setShowSuccess(false);\n }, autoHideDuration);\n\n return (): void => clearTimeout(timer);\n }\n }, [successMessage, autoHideSuccess, autoHideDuration]);\n\n return (\n <section\n ref={ref}\n id={id}\n data-testid={dataTestId}\n aria-label={ariaLabel}\n aria-labelledby={!ariaLabel ? finalAriaLabelledby : undefined}\n aria-describedby={ariaDescribedby}\n className={cn(\"form-layout w-full\", className)}\n {...props}\n >\n {/* Error Message Alert */}\n {errorMessage && (\n <div\n role=\"alert\"\n aria-live=\"assertive\"\n data-testid=\"form-layout-error\"\n className={cn(\n \"rounded-lg border px-4 py-3 mb-6 text-sm\",\n \"border-[var(--destructive-background)] bg-[var(--destructive-foreground)] text-[var(--destructive-background)]\",\n \"flex items-start gap-3\"\n )}\n >\n <AlertCircle className=\"h-5 w-5 flex-shrink-0 mt-0.5\" aria-hidden=\"true\" />\n <div className=\"flex-1\">\n <p className=\"font-medium\">Error</p>\n <p className=\"mt-1\">{errorMessage}</p>\n </div>\n </div>\n )}\n\n {/* Success Message Alert */}\n {successMessage && showSuccess && (\n <div\n role=\"status\"\n aria-live=\"polite\"\n data-testid=\"form-layout-success\"\n className={cn(\n \"rounded-lg border px-4 py-3 mb-6 text-sm\",\n \"border-success bg-success/10 text-success\",\n \"flex items-start gap-3\"\n )}\n >\n <CheckCircle2 className=\"h-5 w-5 flex-shrink-0 mt-0.5\" aria-hidden=\"true\" />\n <div className=\"flex-1\">\n <p className=\"font-medium\">Success</p>\n <p className=\"mt-1\">{successMessage}</p>\n </div>\n </div>\n )}\n\n {/* Header Section: Title → Description → Required Note */}\n <header className=\"form-layout-header mb-6\">\n {/* Title (configurable heading level) */}\n <Heading\n level={headingLevel}\n id={finalHeadingId}\n className=\"text-[var(--content-foreground)] font-semibold\"\n >\n {title}\n </Heading>\n\n {/* Description (optional) */}\n {description && (\n <p className=\"text-sm text-[var(--content-foreground)] leading-relaxed mt-2\">\n {description}\n </p>\n )}\n\n {/* Required Note (always visible) */}\n <p className=\"text-sm text-[var(--content-foreground)]\">\n {requiredNote}\n </p>\n </header>\n\n {/* Body Section: Form fields with configurable layout */}\n <div\n data-testid=\"form-layout-body\"\n className={cn(\n formLayoutBodyVariants({\n columns,\n density,\n })\n )}\n >\n {children}\n </div>\n\n {/* Actions Section: Optional footer for buttons */}\n {actions && (\n <div data-testid=\"form-layout-actions\" className=\"flex justify-between items-center mt-4 gap-2 max-md:flex-col max-md:w-full\">\n {actions}\n </div>\n )}\n </section>\n );\n }\n);\n\nFormLayout.displayName = \"FormLayout\";\n\nexport { formLayoutBodyVariants };\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {forwardRef,useId,useState,useEffect}from'react';import {cva}from'class-variance-authority';import {AlertCircle,CheckCircle2}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';function r(...a){return twMerge(clsx(a))}var g=cva("grid grid-cols-1 mt-6",{variants:{columns:{1:"",2:"md:grid-cols-2"},density:{default:"gap-4",compact:"gap-2",comfortable:"gap-
|
|
2
|
+
import {forwardRef,useId,useState,useEffect}from'react';import {cva}from'class-variance-authority';import {AlertCircle,CheckCircle2}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';function r(...a){return twMerge(clsx(a))}var g=cva("grid grid-cols-1 mt-6",{variants:{columns:{1:"",2:"md:grid-cols-2"},density:{default:"gap-4",compact:"gap-2",comfortable:"gap-5"}},defaultVariants:{columns:1,density:"default"}}),_=({level:a,id:l,className:o,children:d})=>{let i=`h${a}`;return jsx(i,{id:l,className:o,children:d})},x=forwardRef(({title:a,requiredNote:l,description:o,columns:d=1,headingLevel:i=2,density:b="default",errorMessage:n,successMessage:s,fieldErrors:j,autoHideSuccess:c=false,autoHideDuration:f=5e3,className:N,children:h,actions:u,id:m,"data-testid":L,"aria-label":p,"aria-labelledby":F,"aria-describedby":w,...C},k)=>{let E=useId(),y=m?`${m}-title`:E,H=F||y,[S,v]=useState(true);return useEffect(()=>{if(v(true),s&&c){let P=setTimeout(()=>{v(false);},f);return ()=>clearTimeout(P)}},[s,c,f]),jsxs("section",{ref:k,id:m,"data-testid":L,"aria-label":p,"aria-labelledby":p?void 0:H,"aria-describedby":w,className:r("form-layout w-full",N),...C,children:[n&&jsxs("div",{role:"alert","aria-live":"assertive","data-testid":"form-layout-error",className:r("rounded-lg border px-4 py-3 mb-6 text-sm","border-[var(--destructive-background)] bg-[var(--destructive-foreground)] text-[var(--destructive-background)]","flex items-start gap-3"),children:[jsx(AlertCircle,{className:"h-5 w-5 flex-shrink-0 mt-0.5","aria-hidden":"true"}),jsxs("div",{className:"flex-1",children:[jsx("p",{className:"font-medium",children:"Error"}),jsx("p",{className:"mt-1",children:n})]})]}),s&&S&&jsxs("div",{role:"status","aria-live":"polite","data-testid":"form-layout-success",className:r("rounded-lg border px-4 py-3 mb-6 text-sm","border-success bg-success/10 text-success","flex items-start gap-3"),children:[jsx(CheckCircle2,{className:"h-5 w-5 flex-shrink-0 mt-0.5","aria-hidden":"true"}),jsxs("div",{className:"flex-1",children:[jsx("p",{className:"font-medium",children:"Success"}),jsx("p",{className:"mt-1",children:s})]})]}),jsxs("header",{className:"form-layout-header mb-6",children:[jsx(_,{level:i,id:y,className:"text-[var(--content-foreground)] font-semibold",children:a}),o&&jsx("p",{className:"text-sm text-[var(--content-foreground)] leading-relaxed mt-2",children:o}),jsx("p",{className:"text-sm text-[var(--content-foreground)]",children:l})]}),jsx("div",{"data-testid":"form-layout-body",className:r(g({columns:d,density:b})),children:h}),u&&jsx("div",{"data-testid":"form-layout-actions",className:"flex justify-between items-center mt-4 gap-2 max-md:flex-col max-md:w-full",children:u})]})});x.displayName="FormLayout";export{x as FormLayout,g as formLayoutBodyVariants};//# sourceMappingURL=index.mjs.map
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/FormLayout/FormLayout.tsx"],"names":["cn","inputs","twMerge","clsx","formLayoutBodyVariants","cva","Heading","level","id","className","children","Tag","jsx","FormLayout","forwardRef","title","requiredNote","description","columns","headingLevel","density","errorMessage","successMessage","_fieldErrors","autoHideSuccess","autoHideDuration","actions","dataTestId","ariaLabel","ariaLabelledby","ariaDescribedby","props","ref","headingId","useId","finalHeadingId","finalAriaLabelledby","showSuccess","setShowSuccess","useState","useEffect","timer","jsxs","AlertCircle","CheckCircle2"],"mappings":"6PAcO,SAASA,KAAMC,CAAAA,CAA8B,CAClD,OAAOC,OAAAA,CAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCMA,IAAMG,CAAAA,CAAyBC,GAAAA,CAE7B,uBAAA,CACA,CACE,QAAA,CAAU,CAER,QAAS,CACP,CAAA,CAAG,GACH,CAAA,CAAG,gBACL,EAEA,OAAA,CAAS,CACP,QAAS,OAAA,CACT,OAAA,CAAS,QACT,WAAA,CAAa,OACf,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,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,CAAU,8BAAA,CAA+B,cAAY,MAAA,CAAO,CAAA,CAC1EF,KAAC,KAAA,CAAA,CAAI,SAAA,CAAU,SACb,QAAA,CAAA,CAAA9B,GAAAA,CAAC,KAAE,SAAA,CAAU,aAAA,CAAc,mBAAO,CAAA,CAClCA,GAAAA,CAAC,KAAE,SAAA,CAAU,MAAA,CAAQ,SAAAU,CAAAA,CAAe,CAAA,CAAA,CACtC,GACF,CAAA,CAIFoB,IAAAA,CAAC,UAAO,SAAA,CAAU,yBAAA,CAEhB,UAAA9B,GAAAA,CAACN,CAAAA,CAAA,CACC,KAAA,CAAOa,CAAAA,CACP,GAAIgB,CAAAA,CACJ,SAAA,CAAU,gDAAA,CAET,QAAA,CAAApB,CAAAA,CACH,CAAA,CAGCE,GACCL,GAAAA,CAAC,GAAA,CAAA,CAAE,UAAU,+DAAA,CACV,QAAA,CAAAK,EACH,CAAA,CAIFL,GAAAA,CAAC,KAAE,SAAA,CAAU,0CAAA,CACV,SAAAI,CAAAA,CACH,CAAA,CAAA,CACF,EAGAJ,GAAAA,CAAC,KAAA,CAAA,CACC,cAAY,kBAAA,CACZ,SAAA,CAAWZ,CAAAA,CACTI,CAAAA,CAAuB,CACrB,OAAA,CAAAc,EACA,OAAA,CAAAE,CACF,CAAC,CACH,CAAA,CAEC,SAAAV,CAAAA,CACH,CAAA,CAGCgB,GACCd,GAAAA,CAAC,KAAA,CAAA,CAAI,cAAY,qBAAA,CAAsB,SAAA,CAAU,6EAC9C,QAAA,CAAAc,CAAAA,CACH,GAEJ,CAEJ,CACF,EAEAb,CAAAA,CAAW,WAAA,CAAc,YAAA","file":"index.mjs","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\n/**\n * FormLayout Component\n * Structural layout component for consistent form presentation\n *\n * @see FormLayout-plan.md (Component API Design)\n * @see FormLayout-design-decisions.md (Approved design specifications)\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements - WCAG 2.2 AAA)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { JSX, forwardRef, FC, useId, ReactNode, useState, useEffect } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { AlertCircle, CheckCircle2 } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { FormLayoutProps, HeadingLevel } from './FormLayout.types';\n\n/**\n * Body variant styles using CVA\n * Controls column layout and field spacing (density)\n */\nconst formLayoutBodyVariants = cva(\n // Base styles - grid layout with responsive columns\n \"grid grid-cols-1 mt-6\",\n {\n variants: {\n // Column variants (responsive: mobile single, desktop optional double)\n columns: {\n 1: \"\", // Single column (no additional classes needed)\n 2: \"md:grid-cols-2\", // Double column on md breakpoint and up\n },\n // Density variants (controls gap between form fields)\n density: {\n default: \"gap-4\", // 16px gap\n compact: \"gap-2\", // 8px gap\n comfortable: \"gap-6\", // 24px gap\n },\n },\n defaultVariants: {\n columns: 1,\n density: \"default\",\n },\n }\n);\n\n/**\n * Polymorphic Heading Component\n * Renders h1-h6 based on headingLevel prop for proper document hierarchy\n */\ninterface HeadingProps {\n level: HeadingLevel;\n id: string;\n className?: string;\n children: ReactNode;\n}\n\nconst Heading: FC<HeadingProps> = ({ level, id, className, children }) => {\n const Tag = `h${level}` as keyof JSX.IntrinsicElements;\n\n return (\n <Tag id={id} className={className}>\n {children}\n </Tag>\n );\n};\n\n/**\n * FormLayout Component\n * Provides consistent form structure with header, body, and optional actions\n */\nexport const FormLayout = forwardRef<HTMLElement, FormLayoutProps>(\n (\n {\n title,\n requiredNote,\n description,\n columns = 1,\n headingLevel = 2,\n density = 'default',\n errorMessage,\n successMessage,\n fieldErrors: _fieldErrors,\n autoHideSuccess = false,\n autoHideDuration = 5000,\n className,\n children,\n actions,\n id,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n ...props\n },\n ref\n ) => {\n // Generate unique IDs for accessibility\n const headingId = useId();\n const finalHeadingId = id ? `${id}-title` : headingId;\n\n // Determine aria-labelledby (use prop if provided, otherwise point to heading)\n const finalAriaLabelledby = ariaLabelledby || finalHeadingId;\n\n // Auto-hide success message state\n const [showSuccess, setShowSuccess] = useState(true);\n\n // Auto-hide success message after duration\n useEffect(() => {\n // Reset show state when message changes (must come first!)\n setShowSuccess(true);\n\n // Set timeout to hide if autoHideSuccess is enabled\n if (successMessage && autoHideSuccess) {\n const timer = setTimeout(() => {\n setShowSuccess(false);\n }, autoHideDuration);\n\n return (): void => clearTimeout(timer);\n }\n }, [successMessage, autoHideSuccess, autoHideDuration]);\n\n return (\n <section\n ref={ref}\n id={id}\n data-testid={dataTestId}\n aria-label={ariaLabel}\n aria-labelledby={!ariaLabel ? finalAriaLabelledby : undefined}\n aria-describedby={ariaDescribedby}\n className={cn(\"form-layout w-full\", className)}\n {...props}\n >\n {/* Error Message Alert */}\n {errorMessage && (\n <div\n role=\"alert\"\n aria-live=\"assertive\"\n data-testid=\"form-layout-error\"\n className={cn(\n \"rounded-lg border px-4 py-3 mb-6 text-sm\",\n \"border-[var(--destructive-background)] bg-[var(--destructive-foreground)] text-[var(--destructive-background)]\",\n \"flex items-start gap-3\"\n )}\n >\n <AlertCircle className=\"h-5 w-5 flex-shrink-0 mt-0.5\" aria-hidden=\"true\" />\n <div className=\"flex-1\">\n <p className=\"font-medium\">Error</p>\n <p className=\"mt-1\">{errorMessage}</p>\n </div>\n </div>\n )}\n\n {/* Success Message Alert */}\n {successMessage && showSuccess && (\n <div\n role=\"status\"\n aria-live=\"polite\"\n data-testid=\"form-layout-success\"\n className={cn(\n \"rounded-lg border px-4 py-3 mb-6 text-sm\",\n \"border-success bg-success/10 text-success\",\n \"flex items-start gap-3\"\n )}\n >\n <CheckCircle2 className=\"h-5 w-5 flex-shrink-0 mt-0.5\" aria-hidden=\"true\" />\n <div className=\"flex-1\">\n <p className=\"font-medium\">Success</p>\n <p className=\"mt-1\">{successMessage}</p>\n </div>\n </div>\n )}\n\n {/* Header Section: Title → Description → Required Note */}\n <header className=\"form-layout-header mb-6\">\n {/* Title (configurable heading level) */}\n <Heading\n level={headingLevel}\n id={finalHeadingId}\n className=\"text-[var(--content-foreground)] font-semibold\"\n >\n {title}\n </Heading>\n\n {/* Description (optional) */}\n {description && (\n <p className=\"text-sm text-[var(--content-foreground)] leading-relaxed mt-2\">\n {description}\n </p>\n )}\n\n {/* Required Note (always visible) */}\n <p className=\"text-sm text-[var(--content-foreground)]\">\n {requiredNote}\n </p>\n </header>\n\n {/* Body Section: Form fields with configurable layout */}\n <div\n data-testid=\"form-layout-body\"\n className={cn(\n formLayoutBodyVariants({\n columns,\n density,\n })\n )}\n >\n {children}\n </div>\n\n {/* Actions Section: Optional footer for buttons */}\n {actions && (\n <div data-testid=\"form-layout-actions\" className=\"flex justify-between items-center mt-4 gap-2 max-md:flex-col max-md:w-full\">\n {actions}\n </div>\n )}\n </section>\n );\n }\n);\n\nFormLayout.displayName = \"FormLayout\";\n\nexport { formLayoutBodyVariants };\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/FormLayout/FormLayout.tsx"],"names":["cn","inputs","twMerge","clsx","formLayoutBodyVariants","cva","Heading","level","id","className","children","Tag","jsx","FormLayout","forwardRef","title","requiredNote","description","columns","headingLevel","density","errorMessage","successMessage","_fieldErrors","autoHideSuccess","autoHideDuration","actions","dataTestId","ariaLabel","ariaLabelledby","ariaDescribedby","props","ref","headingId","useId","finalHeadingId","finalAriaLabelledby","showSuccess","setShowSuccess","useState","useEffect","timer","jsxs","AlertCircle","CheckCircle2"],"mappings":"6PAcO,SAAS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CAAU,6EAC9C,QAAA,CAAAc,CAAAA,CACH,GAEJ,CAEJ,CACF,EAEAb,CAAAA,CAAW,WAAA,CAAc,YAAA","file":"index.mjs","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\n/**\n * FormLayout Component\n * Structural layout component for consistent form presentation\n *\n * @see FormLayout-plan.md (Component API Design)\n * @see FormLayout-design-decisions.md (Approved design specifications)\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements - WCAG 2.2 AAA)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { JSX, forwardRef, FC, useId, ReactNode, useState, useEffect } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { AlertCircle, CheckCircle2 } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { FormLayoutProps, HeadingLevel } from './FormLayout.types';\n\n/**\n * Body variant styles using CVA\n * Controls column layout and field spacing (density)\n */\nconst formLayoutBodyVariants = cva(\n // Base styles - grid layout with responsive columns\n \"grid grid-cols-1 mt-6\",\n {\n variants: {\n // Column variants (responsive: mobile single, desktop optional double)\n columns: {\n 1: \"\", // Single column (no additional classes needed)\n 2: \"md:grid-cols-2\", // Double column on md breakpoint and up\n },\n // Density variants (controls gap between form fields)\n density: {\n default: \"gap-4\", // 16px gap\n compact: \"gap-2\", // 8px gap\n comfortable: \"gap-5\", // 20px gap (24px is reserved for section-level spacing per design spec)\n },\n },\n defaultVariants: {\n columns: 1,\n density: \"default\",\n },\n }\n);\n\n/**\n * Polymorphic Heading Component\n * Renders h1-h6 based on headingLevel prop for proper document hierarchy\n */\ninterface HeadingProps {\n level: HeadingLevel;\n id: string;\n className?: string;\n children: ReactNode;\n}\n\nconst Heading: FC<HeadingProps> = ({ level, id, className, children }) => {\n const Tag = `h${level}` as keyof JSX.IntrinsicElements;\n\n return (\n <Tag id={id} className={className}>\n {children}\n </Tag>\n );\n};\n\n/**\n * FormLayout Component\n * Provides consistent form structure with header, body, and optional actions\n */\nexport const FormLayout = forwardRef<HTMLElement, FormLayoutProps>(\n (\n {\n title,\n requiredNote,\n description,\n columns = 1,\n headingLevel = 2,\n density = 'default',\n errorMessage,\n successMessage,\n fieldErrors: _fieldErrors,\n autoHideSuccess = false,\n autoHideDuration = 5000,\n className,\n children,\n actions,\n id,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n ...props\n },\n ref\n ) => {\n // Generate unique IDs for accessibility\n const headingId = useId();\n const finalHeadingId = id ? `${id}-title` : headingId;\n\n // Determine aria-labelledby (use prop if provided, otherwise point to heading)\n const finalAriaLabelledby = ariaLabelledby || finalHeadingId;\n\n // Auto-hide success message state\n const [showSuccess, setShowSuccess] = useState(true);\n\n // Auto-hide success message after duration\n useEffect(() => {\n // Reset show state when message changes (must come first!)\n setShowSuccess(true);\n\n // Set timeout to hide if autoHideSuccess is enabled\n if (successMessage && autoHideSuccess) {\n const timer = setTimeout(() => {\n setShowSuccess(false);\n }, autoHideDuration);\n\n return (): void => clearTimeout(timer);\n }\n }, [successMessage, autoHideSuccess, autoHideDuration]);\n\n return (\n <section\n ref={ref}\n id={id}\n data-testid={dataTestId}\n aria-label={ariaLabel}\n aria-labelledby={!ariaLabel ? finalAriaLabelledby : undefined}\n aria-describedby={ariaDescribedby}\n className={cn(\"form-layout w-full\", className)}\n {...props}\n >\n {/* Error Message Alert */}\n {errorMessage && (\n <div\n role=\"alert\"\n aria-live=\"assertive\"\n data-testid=\"form-layout-error\"\n className={cn(\n \"rounded-lg border px-4 py-3 mb-6 text-sm\",\n \"border-[var(--destructive-background)] bg-[var(--destructive-foreground)] text-[var(--destructive-background)]\",\n \"flex items-start gap-3\"\n )}\n >\n <AlertCircle className=\"h-5 w-5 flex-shrink-0 mt-0.5\" aria-hidden=\"true\" />\n <div className=\"flex-1\">\n <p className=\"font-medium\">Error</p>\n <p className=\"mt-1\">{errorMessage}</p>\n </div>\n </div>\n )}\n\n {/* Success Message Alert */}\n {successMessage && showSuccess && (\n <div\n role=\"status\"\n aria-live=\"polite\"\n data-testid=\"form-layout-success\"\n className={cn(\n \"rounded-lg border px-4 py-3 mb-6 text-sm\",\n \"border-success bg-success/10 text-success\",\n \"flex items-start gap-3\"\n )}\n >\n <CheckCircle2 className=\"h-5 w-5 flex-shrink-0 mt-0.5\" aria-hidden=\"true\" />\n <div className=\"flex-1\">\n <p className=\"font-medium\">Success</p>\n <p className=\"mt-1\">{successMessage}</p>\n </div>\n </div>\n )}\n\n {/* Header Section: Title → Description → Required Note */}\n <header className=\"form-layout-header mb-6\">\n {/* Title (configurable heading level) */}\n <Heading\n level={headingLevel}\n id={finalHeadingId}\n className=\"text-[var(--content-foreground)] font-semibold\"\n >\n {title}\n </Heading>\n\n {/* Description (optional) */}\n {description && (\n <p className=\"text-sm text-[var(--content-foreground)] leading-relaxed mt-2\">\n {description}\n </p>\n )}\n\n {/* Required Note (always visible) */}\n <p className=\"text-sm text-[var(--content-foreground)]\">\n {requiredNote}\n </p>\n </header>\n\n {/* Body Section: Form fields with configurable layout */}\n <div\n data-testid=\"form-layout-body\"\n className={cn(\n formLayoutBodyVariants({\n columns,\n density,\n })\n )}\n >\n {children}\n </div>\n\n {/* Actions Section: Optional footer for buttons */}\n {actions && (\n <div data-testid=\"form-layout-actions\" className=\"flex justify-between items-center mt-4 gap-2 max-md:flex-col max-md:w-full\">\n {actions}\n </div>\n )}\n </section>\n );\n }\n);\n\nFormLayout.displayName = \"FormLayout\";\n\nexport { formLayoutBodyVariants };\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var react=require('react'),reactAriaComponents=require('react-aria-components'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime');function l(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var S=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95","data-[entering]:duration-200","data-[entering]:ease-out"],b=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95","data-[exiting]:duration-150","data-[exiting]:ease-in"],h=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:slide-in-from-bottom-4","data-[entering]:duration-200","data-[entering]:ease-out"],L=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:slide-out-to-bottom-4","data-[exiting]:duration-150","data-[exiting]:ease-in"],u=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:duration-200"],x=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:duration-150"],A=["motion-reduce:transition-none","motion-reduce:animate-none"];var f=classVarianceAuthority.cva(["relative","bg-[var(--content-background)]","text-[var(--content-foreground)]","rounded-lg","shadow-lg","p-6","w-full","outline-none","mx-4","sm:mx-0",...A],{variants:{size:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-2xl",full:"max-w-full min-h-screen rounded-none"},animation:{"fade-zoom":[...S,...b],fade:["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:duration-200","data-[entering]:ease-out","data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:duration-150","data-[exiting]:ease-in"],slide:[...h,...L],none:""}},defaultVariants:{size:"md",animation:"fade-zoom"}}),M=classVarianceAuthority.cva(["fixed","inset-0","z-50","flex","items-center","justify-center","bg-black/50","backdrop-blur-sm",...A],{variants:{animation:{"fade-zoom":[...u,...x],fade:[...u,...x],slide:[...u,...x],none:""}},defaultVariants:{animation:"fade-zoom"}});var C=react.createContext(void 0);function H({children:t,defaultOpen:e,isOpen:o,onOpenChange:r,role:s="dialog"}){let i=react.Children.toArray(t);if(process.env.NODE_ENV!=="production"&&!i.some(d=>react.isValidElement(d)&&(d.type===p||d.type.displayName==="ModalContent")))throw new Error("Modal requires a Modal.Content as a child");let m=i.find(n=>react.isValidElement(n)&&(n.type===O||n.type.displayName==="ModalTrigger")),E=i.find(n=>react.isValidElement(n)&&(n.type===p||n.type.displayName==="ModalContent"));if(!m)return jsxRuntime.jsx(C.Provider,{value:{role:s},children:jsxRuntime.jsx(reactAriaComponents.DialogTrigger,{defaultOpen:e,isOpen:o,onOpenChange:r,children:E})});let g=m,y=react.isValidElement(g)?g.props.children:null;return jsxRuntime.jsx(C.Provider,{value:{role:s},children:jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{defaultOpen:e,isOpen:o,onOpenChange:r,children:[y,E]})})}H.displayName="Modal";function O({children:t}){return t}O.displayName="ModalTrigger";function p({children:t,size:e="md",animation:o="fade-zoom",animationDuration:r=
|
|
2
|
+
'use strict';var react=require('react'),reactAriaComponents=require('react-aria-components'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime');function l(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var S=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95","data-[entering]:duration-200","data-[entering]:ease-out"],b=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95","data-[exiting]:duration-150","data-[exiting]:ease-in"],h=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:slide-in-from-bottom-4","data-[entering]:duration-200","data-[entering]:ease-out"],L=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:slide-out-to-bottom-4","data-[exiting]:duration-150","data-[exiting]:ease-in"],u=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:duration-200"],x=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:duration-150"],A=["motion-reduce:transition-none","motion-reduce:animate-none"];var f=classVarianceAuthority.cva(["relative","bg-[var(--content-background)]","text-[var(--content-foreground)]","rounded-lg","shadow-lg","p-6","w-full","outline-none","mx-4","sm:mx-0",...A],{variants:{size:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-2xl",full:"max-w-full min-h-screen rounded-none"},animation:{"fade-zoom":[...S,...b],fade:["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:duration-200","data-[entering]:ease-out","data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:duration-150","data-[exiting]:ease-in"],slide:[...h,...L],none:""}},defaultVariants:{size:"md",animation:"fade-zoom"}}),M=classVarianceAuthority.cva(["fixed","inset-0","z-50","flex","items-center","justify-center","bg-black/50","backdrop-blur-sm",...A],{variants:{animation:{"fade-zoom":[...u,...x],fade:[...u,...x],slide:[...u,...x],none:""}},defaultVariants:{animation:"fade-zoom"}});var C=react.createContext(void 0);function H({children:t,defaultOpen:e,isOpen:o,onOpenChange:r,role:s="dialog"}){let i=react.Children.toArray(t);if(process.env.NODE_ENV!=="production"&&!i.some(d=>react.isValidElement(d)&&(d.type===p||d.type.displayName==="ModalContent")))throw new Error("Modal requires a Modal.Content as a child");let m=i.find(n=>react.isValidElement(n)&&(n.type===O||n.type.displayName==="ModalTrigger")),E=i.find(n=>react.isValidElement(n)&&(n.type===p||n.type.displayName==="ModalContent"));if(!m)return jsxRuntime.jsx(C.Provider,{value:{role:s},children:jsxRuntime.jsx(reactAriaComponents.DialogTrigger,{defaultOpen:e,isOpen:o,onOpenChange:r,children:E})});let g=m,y=react.isValidElement(g)?g.props.children:null;return jsxRuntime.jsx(C.Provider,{value:{role:s},children:jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{defaultOpen:e,isOpen:o,onOpenChange:r,children:[y,E]})})}H.displayName="Modal";function O({children:t}){return t}O.displayName="ModalTrigger";function p({children:t,size:e="md",animation:o="fade-zoom",animationDuration:r=250,isDismissable:s=true,isKeyboardDismissDisabled:i=false,showClose:m=true,className:R}){let g=react.useContext(C)?.role??"dialog",y=M({animation:o}),n=f({size:e,animation:o}),d=l(n,R);return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{isDismissable:s,isKeyboardDismissDisabled:i,className:y,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:d,style:{transitionDuration:`${r}ms`},children:jsxRuntime.jsx(reactAriaComponents.Dialog,{role:g,className:"outline-none",children:({close:z})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[m&&jsxRuntime.jsx(reactAriaComponents.Button,{onPress:z,className:"absolute right-0 top-0 flex items-center justify-center rounded-sm opacity-70 ring-offset-[var(--content-background)] transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[var(--ring)] focus:ring-offset-2 disabled:pointer-events-none min-h-[44px] min-w-[44px]","aria-label":"Close modal",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4","aria-hidden":"true"})}),t]})})})})}p.displayName="ModalContent";function N(t){return null}N.displayName="ModalOverlay";function _({children:t,className:e}){return jsxRuntime.jsx("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left",e),children:t})}_.displayName="ModalHeader";function T({children:t,as:e="h2",className:o}){return jsxRuntime.jsx(reactAriaComponents.Heading,{slot:"title",level:parseInt(e[1]??"2"),className:l("text-lg font-semibold leading-none tracking-tight",o),children:t})}T.displayName="ModalTitle";function I({children:t,className:e}){return jsxRuntime.jsx("p",{slot:"description",className:l("text-sm text-[var(--menu-muted)]",e),children:t})}I.displayName="ModalDescription";function D({children:t,className:e}){return jsxRuntime.jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end gap-2",e),children:t})}D.displayName="ModalFooter";function P({children:t}){let e=react.useContext(reactAriaComponents.OverlayTriggerStateContext);if(!e)throw new Error("Modal.Close must be used inside Modal.Content");if(!react.isValidElement(t))throw new Error("Modal.Close requires a valid React element as a child");let o=t,r=()=>{e.close();},s=o.props?.onPress;return react.cloneElement(o,{onPress:s?()=>{s(),r();}:r})}P.displayName="ModalClose";var J=Object.assign(H,{Trigger:O,Content:p,Overlay:N,Header:_,Title:T,Description:I,Footer:D,Close:P});exports.Modal=J;exports.ModalClose=P;exports.ModalContent=p;exports.ModalDescription=I;exports.ModalFooter=D;exports.ModalHeader=_;exports.ModalOverlay=N;exports.ModalTitle=T;exports.ModalTrigger=O;exports.modalContentVariants=f;exports.modalOverlayVariants=M;//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|