@tribepad/themis 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/elements/Accordion/Accordion.d.ts +3 -1
- package/dist/elements/Accordion/Accordion.d.ts.map +1 -1
- package/dist/elements/Accordion/index.js +1 -1
- package/dist/elements/Accordion/index.js.map +1 -1
- package/dist/elements/Accordion/index.mjs +1 -1
- package/dist/elements/Accordion/index.mjs.map +1 -1
- 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/Breadcrumbs/index.js +1 -1
- package/dist/elements/Breadcrumbs/index.js.map +1 -1
- package/dist/elements/Breadcrumbs/index.mjs +1 -1
- package/dist/elements/Breadcrumbs/index.mjs.map +1 -1
- package/dist/elements/Button/Button.d.ts.map +1 -1
- package/dist/elements/Button/index.js +1 -1
- package/dist/elements/Button/index.js.map +1 -1
- package/dist/elements/Button/index.mjs +1 -1
- package/dist/elements/Button/index.mjs.map +1 -1
- package/dist/elements/Card/Card.d.ts +21 -1
- package/dist/elements/Card/Card.d.ts.map +1 -1
- package/dist/elements/Card/Card.types.d.ts +36 -0
- package/dist/elements/Card/Card.types.d.ts.map +1 -1
- package/dist/elements/Card/index.d.ts +10 -3
- package/dist/elements/Card/index.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/Carousel/Carousel.d.ts.map +1 -1
- package/dist/elements/Carousel/index.js +1 -1
- package/dist/elements/Carousel/index.js.map +1 -1
- package/dist/elements/Carousel/index.mjs +1 -1
- package/dist/elements/Carousel/index.mjs.map +1 -1
- package/dist/elements/Chart/Chart.d.ts.map +1 -1
- package/dist/elements/Chart/Chart.types.d.ts +21 -4
- package/dist/elements/Chart/Chart.types.d.ts.map +1 -1
- package/dist/elements/Chart/ChartAreaSeries.d.ts +32 -0
- package/dist/elements/Chart/ChartAreaSeries.d.ts.map +1 -0
- package/dist/elements/Chart/ChartContext.d.ts +4 -1
- package/dist/elements/Chart/ChartContext.d.ts.map +1 -1
- package/dist/elements/Chart/ChartLegend.d.ts +2 -2
- package/dist/elements/Chart/ChartLegend.d.ts.map +1 -1
- package/dist/elements/Chart/ChartPieSeries.d.ts +28 -0
- package/dist/elements/Chart/ChartPieSeries.d.ts.map +1 -0
- package/dist/elements/Chart/ChartRadarSeries.d.ts +28 -0
- package/dist/elements/Chart/ChartRadarSeries.d.ts.map +1 -0
- package/dist/elements/Chart/ChartSVG.d.ts +7 -1
- package/dist/elements/Chart/ChartSVG.d.ts.map +1 -1
- package/dist/elements/Chart/ChartScatterSeries.d.ts +31 -0
- package/dist/elements/Chart/ChartScatterSeries.d.ts.map +1 -0
- package/dist/elements/Chart/index.js +1 -1
- package/dist/elements/Chart/index.js.map +1 -1
- package/dist/elements/Chart/index.mjs +1 -1
- package/dist/elements/Chart/index.mjs.map +1 -1
- package/dist/elements/Checkbox/index.js +1 -1
- package/dist/elements/Checkbox/index.js.map +1 -1
- package/dist/elements/Checkbox/index.mjs +1 -1
- package/dist/elements/Checkbox/index.mjs.map +1 -1
- package/dist/elements/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/elements/ColorPicker/ColorPicker.styles.d.ts +3 -1
- package/dist/elements/ColorPicker/ColorPicker.styles.d.ts.map +1 -1
- package/dist/elements/ColorPicker/index.js +1 -1
- package/dist/elements/ColorPicker/index.js.map +1 -1
- package/dist/elements/ColorPicker/index.mjs +1 -1
- package/dist/elements/ColorPicker/index.mjs.map +1 -1
- package/dist/elements/Combobox/Combobox.d.ts +1 -1
- package/dist/elements/Combobox/Combobox.d.ts.map +1 -1
- package/dist/elements/Combobox/Combobox.styles.d.ts.map +1 -1
- package/dist/elements/Combobox/index.js +1 -1
- package/dist/elements/Combobox/index.js.map +1 -1
- package/dist/elements/Combobox/index.mjs +1 -1
- package/dist/elements/Combobox/index.mjs.map +1 -1
- package/dist/elements/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/elements/DatePicker/index.js +1 -1
- package/dist/elements/DatePicker/index.js.map +1 -1
- package/dist/elements/DatePicker/index.mjs +1 -1
- package/dist/elements/DatePicker/index.mjs.map +1 -1
- package/dist/elements/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/elements/Dropdown/index.js +1 -1
- package/dist/elements/Dropdown/index.js.map +1 -1
- package/dist/elements/Dropdown/index.mjs +1 -1
- package/dist/elements/Dropdown/index.mjs.map +1 -1
- package/dist/elements/FileField/index.js +1 -1
- package/dist/elements/FileField/index.js.map +1 -1
- package/dist/elements/FileField/index.mjs +1 -1
- package/dist/elements/FileField/index.mjs.map +1 -1
- package/dist/elements/Modal/Modal.d.ts +2 -1
- package/dist/elements/Modal/Modal.d.ts.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/NumberField/NumberField.d.ts.map +1 -1
- package/dist/elements/NumberField/NumberField.types.d.ts +1 -1
- package/dist/elements/NumberField/NumberField.variants.d.ts.map +1 -1
- package/dist/elements/NumberField/index.js +1 -1
- package/dist/elements/NumberField/index.js.map +1 -1
- package/dist/elements/NumberField/index.mjs +1 -1
- package/dist/elements/NumberField/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/Pagination/index.js +1 -1
- package/dist/elements/Pagination/index.js.map +1 -1
- package/dist/elements/Pagination/index.mjs +1 -1
- package/dist/elements/Pagination/index.mjs.map +1 -1
- package/dist/elements/Panel/index.js +1 -1
- package/dist/elements/Panel/index.js.map +1 -1
- package/dist/elements/Panel/index.mjs +1 -1
- package/dist/elements/Panel/index.mjs.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/Progress/index.js +1 -1
- package/dist/elements/Progress/index.js.map +1 -1
- package/dist/elements/Progress/index.mjs +1 -1
- package/dist/elements/Progress/index.mjs.map +1 -1
- package/dist/elements/RatingScale/index.js +1 -1
- package/dist/elements/RatingScale/index.js.map +1 -1
- package/dist/elements/RatingScale/index.mjs +1 -1
- package/dist/elements/RatingScale/index.mjs.map +1 -1
- package/dist/elements/Resizable/index.js +1 -1
- package/dist/elements/Resizable/index.js.map +1 -1
- package/dist/elements/Resizable/index.mjs +1 -1
- package/dist/elements/Resizable/index.mjs.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.d.ts.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/SituationalJudgement/index.js +1 -1
- package/dist/elements/SituationalJudgement/index.js.map +1 -1
- package/dist/elements/SituationalJudgement/index.mjs +1 -1
- package/dist/elements/SituationalJudgement/index.mjs.map +1 -1
- package/dist/elements/Table/index.js +1 -1
- package/dist/elements/Table/index.js.map +1 -1
- package/dist/elements/Table/index.mjs +1 -1
- package/dist/elements/Table/index.mjs.map +1 -1
- package/dist/elements/Tabs/index.js +1 -1
- package/dist/elements/Tabs/index.js.map +1 -1
- package/dist/elements/Tabs/index.mjs +1 -1
- package/dist/elements/Tabs/index.mjs.map +1 -1
- package/dist/elements/TextField/TextField.d.ts.map +1 -1
- package/dist/elements/TextField/TextField.styles.d.ts.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/TimeField/TimeField.d.ts.map +1 -1
- package/dist/elements/TimeField/TimeField.types.d.ts.map +1 -1
- package/dist/elements/TimeField/index.js +1 -1
- package/dist/elements/TimeField/index.js.map +1 -1
- package/dist/elements/TimeField/index.mjs +1 -1
- package/dist/elements/TimeField/index.mjs.map +1 -1
- package/dist/elements/Toast/Toast.d.ts +21 -43
- package/dist/elements/Toast/Toast.d.ts.map +1 -1
- package/dist/elements/Toast/Toast.types.d.ts +27 -1
- package/dist/elements/Toast/Toast.types.d.ts.map +1 -1
- package/dist/elements/Toast/Toaster.d.ts +0 -12
- package/dist/elements/Toast/Toaster.d.ts.map +1 -1
- package/dist/elements/Toast/index.d.ts +1 -1
- package/dist/elements/Toast/index.d.ts.map +1 -1
- package/dist/elements/Toast/index.js +1 -1
- package/dist/elements/Toast/index.js.map +1 -1
- package/dist/elements/Toast/index.mjs +1 -1
- package/dist/elements/Toast/index.mjs.map +1 -1
- package/dist/elements/Tooltip/index.js +1 -1
- package/dist/elements/Tooltip/index.js.map +1 -1
- package/dist/elements/Tooltip/index.mjs +1 -1
- package/dist/elements/Tooltip/index.mjs.map +1 -1
- package/dist/elements/index.d.ts +1 -1
- package/dist/elements/index.d.ts.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.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/styles/animations.css +110 -0
- package/dist/styles/defaults.css +32 -0
- package/dist/styles/index.d.ts +1 -1
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/index.mjs +1 -1
- package/dist/styles/index.mjs.map +1 -1
- package/dist/styles/shared-variants.d.ts +21 -2
- package/dist/styles/shared-variants.d.ts.map +1 -1
- package/package.json +35 -34
- package/src/elements/Chart/Chart.stories.tsx +186 -2
- package/src/elements/Modal/Modal.stories.tsx +6 -9
- package/src/elements/Toast/Toast.stories.tsx +745 -648
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/styles/interaction-states.ts","../../../src/elements/RatingScale/RatingScale.styles.ts","../../../src/elements/RatingScale/RatingScale.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/RatingScale/RatingScale.types.ts"],"names":["cn","inputs","twMerge","clsx","FOCUS_STYLES","HIGH_CONTRAST_FOCUS","ratingScaleContainerVariants","cva","ratingScaleRowVariants","ratingScaleButtonOuterVariants","ratingScaleButtonVisualVariants","ratingScaleStarOuterVariants","ratingScaleStarVisualVariants","ratingScaleSliderTrackVariants","ratingScaleSliderFillVariants","ratingScaleSliderThumbVariants","ratingScaleSliderTickVariants","ratingScaleNAButtonVariants","getStepValues","min","max","step","values","v","ButtonsRenderer","currentValue","onValueChange","size","isDisabled","isReadOnly","isInvalid","name","groupId","jsx","AriaRadioGroup","val","AriaRadio","isSelected","StarsRenderer","isFilled","Star","SliderRenderer","effectiveValue","jsxs","AriaSlider","SliderOutput","state","SliderTrack","Fragment","percent","SliderThumb","RatingScale","forwardRef","props","ref","value","onChange","displayStyle","label","description","errorMessage","lowLabel","highLabel","valueLabels","showNA","isRequired","className","id","ariaLabel","ariaDescribedby","dataTestId","generatedId","useId","labelId","descriptionId","errorId","describedByParts","isControlled","internalValue","setInternalValue","useState","handleValueChange","useCallback","newValue","handleNAToggle","currentValueLabel","rendererProps","Label","Text","BaseComponentPropsSchema","z","RatingScaleDisplayStyleSchema","RatingScaleSizeSchema","RatingScalePropsSch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","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","/**\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","import { cva } from 'class-variance-authority';\nimport { FOCUS_STYLES, HIGH_CONTRAST_FOCUS } from '../../styles/interaction-states';\n\n/**\n * RatingScale CVA Variant Definitions\n *\n * Organised by display style (buttons, stars, slider) and shared elements.\n * All interactive elements maintain 44x44px minimum touch targets (WCAG 2.2 AAA).\n */\n\n// =============================================================================\n// Shared / Container\n// =============================================================================\n\n/** Root wrapper */\nexport const ratingScaleContainerVariants = cva(\"flex flex-col gap-1.5\", {\n variants: {\n size: {\n sm: \"text-sm\",\n default: \"text-sm\",\n lg: \"text-base\",\n },\n },\n defaultVariants: { size: \"default\" },\n});\n\n/** Horizontal row containing scale items + endpoint labels */\nexport const ratingScaleRowVariants = cva(\"flex items-center\", {\n variants: {\n size: {\n sm: \"gap-1\",\n default: \"gap-1.5\",\n lg: \"gap-2\",\n },\n },\n defaultVariants: { size: \"default\" },\n});\n\n// =============================================================================\n// Buttons Display Style\n// =============================================================================\n\n/** Layer 1: Touch target for each button (44x44px minimum, transparent) */\nexport const ratingScaleButtonOuterVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"min-h-[44px] min-w-[44px]\",\n \"cursor-pointer\",\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n \"data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n ].join(\" \"),\n);\n\n/** Layer 2: Visual button */\nexport const ratingScaleButtonVisualVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"rounded-md border font-medium\",\n \"transition-colors duration-200\",\n \"motion-reduce:transition-none\",\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"h-8 w-8 text-xs\",\n default: \"h-9 w-9 text-sm\",\n lg: \"h-11 w-11 text-base\",\n },\n isSelected: {\n true: \"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] border-[var(--primary-action)]\",\n false: \"bg-[var(--content-background)] text-[var(--content-foreground)] border-[var(--border)] hover:bg-[var(--accent)]\",\n },\n isInvalid: {\n true: \"border-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: {\n size: \"default\",\n isSelected: false,\n isInvalid: false,\n },\n }\n);\n\n// =============================================================================\n// Stars Display Style\n// =============================================================================\n\n/** Layer 1: Touch target for each star (44x44px minimum, transparent) */\nexport const ratingScaleStarOuterVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"min-h-[44px] min-w-[44px]\",\n \"cursor-pointer\",\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n \"data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n ].join(\" \"),\n);\n\n/** Layer 2: Star icon visual */\nexport const ratingScaleStarVisualVariants = cva(\n [\n \"transition-colors duration-200\",\n \"motion-reduce:transition-none\",\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"h-5 w-5\",\n default: \"h-6 w-6\",\n lg: \"h-8 w-8\",\n },\n isFilled: {\n true: \"fill-[var(--primary-action)] text-[var(--primary-action)]\",\n false: \"fill-none text-[var(--border)] hover:text-[var(--primary-action)]/50\",\n },\n isInvalid: {\n true: \"text-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: {\n size: \"default\",\n isFilled: false,\n isInvalid: false,\n },\n }\n);\n\n// =============================================================================\n// Slider Display Style\n// =============================================================================\n\n/** Slider track — overflow-visible so thumb + ticks render outside the thin bar */\nexport const ratingScaleSliderTrackVariants = cva(\n [\n \"relative w-full rounded-full overflow-visible\",\n \"bg-[var(--border)]\",\n \"cursor-pointer\",\n \"data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed\",\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"h-1.5\",\n default: \"h-2\",\n lg: \"h-3\",\n },\n },\n defaultVariants: { size: \"default\" },\n }\n);\n\n/** Slider filled portion of track */\nexport const ratingScaleSliderFillVariants = cva(\n \"absolute top-0 left-0 h-full rounded-full bg-[var(--primary-action)]\",\n {\n variants: {\n isInvalid: {\n true: \"bg-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: { isInvalid: false },\n }\n);\n\n/** Slider thumb — Layer 1 is handled by React Aria's SliderThumb (44px touch target) */\nexport const ratingScaleSliderThumbVariants = cva(\n [\n \"rounded-full bg-[var(--primary-action)] border-2 border-[var(--content-background)]\",\n \"shadow-md\",\n \"transition-transform duration-200\",\n \"motion-reduce:transition-none\",\n \"data-[dragging]:scale-110\",\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"h-4 w-4\",\n default: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: { size: \"default\" },\n }\n);\n\n/** Slider tick mark at each step — vertical lines below the track */\nexport const ratingScaleSliderTickVariants = cva(\n \"absolute bg-[var(--content-foreground)]/30\",\n {\n variants: {\n size: {\n sm: \"w-px h-2 top-[calc(100%+2px)]\",\n default: \"w-px h-2.5 top-[calc(100%+3px)]\",\n lg: \"w-px h-3 top-[calc(100%+4px)]\",\n },\n },\n defaultVariants: { size: \"default\" },\n }\n);\n\n// =============================================================================\n// N/A Button\n// =============================================================================\n\n/** N/A toggle button */\nexport const ratingScaleNAButtonVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"min-h-[44px] min-w-[44px] px-3\",\n \"rounded-md border font-medium\",\n \"cursor-pointer\",\n \"transition-colors duration-200\",\n \"motion-reduce:transition-none\",\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n \"disabled:pointer-events-none disabled:opacity-50\",\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"text-xs\",\n default: \"text-sm\",\n lg: \"text-base\",\n },\n isSelected: {\n true: \"bg-[var(--muted)] text-[var(--content-foreground)] border-[var(--content-foreground)]\",\n false: \"bg-[var(--content-background)] text-[var(--muted-foreground)] border-[var(--border)] hover:bg-[var(--accent)]\",\n },\n },\n defaultVariants: {\n size: \"default\",\n isSelected: false,\n },\n }\n);\n","\"use client\";\n\n/**\n * RatingScale Component\n * Configurable scale with 3 display styles for scoring/evaluation.\n *\n * Display styles:\n * - buttons: Numbered buttons in a RadioGroup\n * - stars: Star icons that fill up to selected value\n * - slider: Discrete step slider with tick marks\n *\n * Built on React Aria RadioGroup (buttons/stars) and Slider primitives.\n *\n * @see WCAG 2.2 AAA — 44x44px touch targets, 7:1 contrast, keyboard navigation\n */\n\nimport {\n forwardRef,\n useState,\n useId,\n useCallback,\n type ReactNode,\n type ForwardedRef,\n} from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n Slider as AriaSlider,\n SliderTrack,\n SliderThumb,\n SliderOutput,\n Label,\n Text,\n} from 'react-aria-components';\nimport { Star } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { RatingScaleProps, RatingScaleSize } from './RatingScale.types';\nimport {\n ratingScaleContainerVariants,\n ratingScaleRowVariants,\n ratingScaleButtonOuterVariants,\n ratingScaleButtonVisualVariants,\n ratingScaleStarOuterVariants,\n ratingScaleStarVisualVariants,\n ratingScaleSliderTrackVariants,\n ratingScaleSliderFillVariants,\n ratingScaleSliderThumbVariants,\n ratingScaleSliderTickVariants,\n ratingScaleNAButtonVariants,\n} from './RatingScale.styles';\n\n// =============================================================================\n// Helpers\n// =============================================================================\n\n/** Generate the array of step values for the scale */\nfunction getStepValues(min: number, max: number, step: number): number[] {\n const values: number[] = [];\n for (let v = min; v <= max; v += step) {\n values.push(v);\n }\n return values;\n}\n\n// =============================================================================\n// Sub-renderers\n// =============================================================================\n\ninterface RendererProps {\n values: number[];\n currentValue: number | null;\n onValueChange: (value: number) => void;\n size: RatingScaleSize;\n isDisabled: boolean;\n isReadOnly: boolean;\n isInvalid: boolean;\n name?: string;\n groupId: string;\n min: number;\n max: number;\n step: number;\n}\n\n/** Buttons display: numbered buttons in a RadioGroup */\nfunction ButtonsRenderer({\n values,\n currentValue,\n onValueChange,\n size,\n isDisabled,\n isReadOnly,\n isInvalid,\n name,\n groupId,\n}: RendererProps): ReactNode {\n return (\n <AriaRadioGroup\n aria-labelledby={`${groupId}-label`}\n value={currentValue !== null ? String(currentValue) : undefined}\n onChange={(val: string) => onValueChange(Number(val))}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n orientation=\"horizontal\"\n name={name}\n className=\"flex items-center gap-0\"\n >\n <div className={ratingScaleRowVariants({ size })}>\n {values.map((v) => (\n <AriaRadio\n key={v}\n value={String(v)}\n aria-label={String(v)}\n className={ratingScaleButtonOuterVariants()}\n >\n {({ isSelected }) => (\n <span\n className={ratingScaleButtonVisualVariants({\n size,\n isSelected,\n isInvalid,\n })}\n >\n {v}\n </span>\n )}\n </AriaRadio>\n ))}\n </div>\n </AriaRadioGroup>\n );\n}\n\n/** Stars display: star icons that fill up to selected value */\nfunction StarsRenderer({\n values,\n currentValue,\n onValueChange,\n size,\n isDisabled,\n isReadOnly,\n isInvalid,\n name,\n groupId,\n}: RendererProps): ReactNode {\n return (\n <AriaRadioGroup\n aria-labelledby={`${groupId}-label`}\n value={currentValue !== null ? String(currentValue) : undefined}\n onChange={(val: string) => onValueChange(Number(val))}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n orientation=\"horizontal\"\n name={name}\n className=\"flex items-center gap-0\"\n >\n <div className={ratingScaleRowVariants({ size })}>\n {values.map((v) => {\n const isFilled = currentValue !== null && v <= currentValue;\n return (\n <AriaRadio\n key={v}\n value={String(v)}\n aria-label={`${v} star${v !== 1 ? 's' : ''}`}\n className={ratingScaleStarOuterVariants()}\n >\n <Star\n aria-hidden=\"true\"\n className={ratingScaleStarVisualVariants({\n size,\n isFilled,\n isInvalid,\n })}\n />\n </AriaRadio>\n );\n })}\n </div>\n </AriaRadioGroup>\n );\n}\n\n/** Slider display: discrete step slider with tick marks */\nfunction SliderRenderer({\n values,\n currentValue,\n onValueChange,\n size,\n isDisabled,\n isInvalid,\n min,\n max,\n step,\n groupId,\n}: RendererProps): ReactNode {\n const effectiveValue = currentValue ?? min;\n\n return (\n <AriaSlider\n aria-labelledby={`${groupId}-label`}\n value={effectiveValue}\n onChange={onValueChange}\n minValue={min}\n maxValue={max}\n step={step}\n isDisabled={isDisabled}\n className=\"flex w-full flex-col gap-1 pb-4\"\n >\n <div className=\"flex items-center justify-between\">\n <SliderOutput className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {({ state }) => state.values[0]}\n </SliderOutput>\n </div>\n <SliderTrack className={cn(ratingScaleSliderTrackVariants({ size }), \"relative\")}>\n {({ state }) => (\n <>\n {/* Filled portion */}\n <div\n className={ratingScaleSliderFillVariants({ isInvalid })}\n style={{ width: `${(((state.values[0] ?? min) - min) / (max - min)) * 100}%` }}\n />\n\n {/* Tick marks */}\n {values.map((v) => {\n const percent = ((v - min) / (max - min)) * 100;\n return (\n <div\n key={v}\n className={ratingScaleSliderTickVariants({ size })}\n style={{ left: `${percent}%`, transform: 'translateX(-50%)' }}\n aria-hidden=\"true\"\n />\n );\n })}\n\n {/* Thumb — override React Aria's top:0 to center on track */}\n <SliderThumb\n className={ratingScaleSliderThumbVariants({ size })}\n style={{ top: '50%' }}\n />\n </>\n )}\n </SliderTrack>\n </AriaSlider>\n );\n}\n\n// =============================================================================\n// RatingScale Component\n// =============================================================================\n\nconst RatingScale = forwardRef<HTMLDivElement, RatingScaleProps>(\n function RatingScale(props: RatingScaleProps, ref: ForwardedRef<HTMLDivElement>) {\n const {\n // Value\n value,\n onChange,\n // Range\n min = 1,\n max = 5,\n step = 1,\n // Display\n displayStyle = 'buttons',\n // Labels\n label,\n description,\n errorMessage,\n lowLabel,\n highLabel,\n valueLabels,\n // N/A\n showNA = false,\n // State\n isRequired = false,\n isDisabled = false,\n isReadOnly = false,\n isInvalid = false,\n // Sizing\n size = 'default',\n // Form\n name,\n // Standard\n className,\n id,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'data-testid': dataTestId,\n } = props;\n\n const generatedId = useId();\n const groupId = id ?? generatedId;\n const labelId = `${groupId}-label`;\n const descriptionId = `${groupId}-description`;\n const errorId = `${groupId}-error`;\n\n const describedByParts: string[] = [];\n if (ariaDescribedby) describedByParts.push(ariaDescribedby);\n if (description) describedByParts.push(descriptionId);\n if (isInvalid && errorMessage) describedByParts.push(errorId);\n\n const values = getStepValues(min, max, step);\n\n // Controlled vs uncontrolled state management\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<number | null>(null);\n const currentValue = isControlled ? (value ?? null) : internalValue;\n\n const handleValueChange = useCallback(\n (newValue: number) => {\n if (isReadOnly) return;\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n },\n [onChange, isReadOnly, isControlled],\n );\n\n const handleNAToggle = useCallback(() => {\n if (isDisabled || isReadOnly) return;\n if (currentValue === null) {\n // Deselect N/A — revert to min value\n if (!isControlled) {\n setInternalValue(min);\n }\n onChange?.(min);\n } else {\n if (!isControlled) {\n setInternalValue(null);\n }\n onChange?.(null);\n }\n }, [currentValue, onChange, min, isDisabled, isReadOnly, isControlled]);\n\n const currentValueLabel =\n currentValue !== null && valueLabels\n ? valueLabels[String(currentValue)]\n : undefined;\n\n const rendererProps: RendererProps = {\n values,\n currentValue,\n onValueChange: handleValueChange,\n size,\n isDisabled,\n isReadOnly,\n isInvalid,\n name,\n groupId,\n min,\n max,\n step,\n };\n\n return (\n <div\n ref={ref}\n id={groupId}\n role=\"group\"\n aria-label={ariaLabel}\n aria-labelledby={label ? labelId : undefined}\n aria-describedby={describedByParts.length > 0 ? describedByParts.join(' ') : undefined}\n data-testid={dataTestId}\n className={cn(ratingScaleContainerVariants({ size }), className)}\n >\n {/* Label */}\n {label && (\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && (\n <span className=\"ml-1 text-[var(--destructive-background)]\" aria-hidden=\"true\">\n *\n </span>\n )}\n </Label>\n )}\n\n {/* Description */}\n {description && (\n <Text\n id={descriptionId}\n slot=\"description\"\n className=\"text-sm text-[var(--menu-muted)]\"\n >\n {description}\n </Text>\n )}\n\n {/* Scale row with endpoint labels */}\n <div className=\"flex items-center gap-2\">\n {lowLabel && (\n <span className=\"text-sm text-[var(--muted-foreground)] whitespace-nowrap\">\n {lowLabel}\n </span>\n )}\n\n <div className=\"flex-1\">\n {displayStyle === 'buttons' && <ButtonsRenderer {...rendererProps} />}\n {displayStyle === 'stars' && <StarsRenderer {...rendererProps} />}\n {displayStyle === 'slider' && <SliderRenderer {...rendererProps} />}\n </div>\n\n {highLabel && (\n <span className=\"text-sm text-[var(--muted-foreground)] whitespace-nowrap\">\n {highLabel}\n </span>\n )}\n\n {/* N/A Button */}\n {showNA && (\n <button\n type=\"button\"\n aria-pressed={currentValue === null}\n disabled={isDisabled}\n onClick={handleNAToggle}\n className={ratingScaleNAButtonVariants({\n size,\n isSelected: currentValue === null,\n })}\n >\n N/A\n </button>\n )}\n </div>\n\n {/* Value label */}\n {currentValueLabel && (\n <span\n className=\"text-sm font-medium text-[var(--content-foreground)]\"\n aria-live=\"polite\"\n >\n {currentValueLabel}\n </span>\n )}\n\n {/* Error message */}\n {isInvalid && errorMessage && (\n <div\n id={errorId}\n role=\"alert\"\n className=\"text-sm text-[var(--destructive-background)]\"\n >\n {errorMessage}\n </div>\n )}\n </div>\n );\n },\n);\n\nRatingScale.displayName = \"RatingScale\";\n\nexport { RatingScale };\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 { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\n\n/**\n * RatingScale display style schema\n * Determines the visual rendering of the scale\n */\nexport const RatingScaleDisplayStyleSchema = z.enum(['buttons', 'stars', 'slider']);\nexport type RatingScaleDisplayStyle = z.infer<typeof RatingScaleDisplayStyleSchema>;\n\n/**\n * RatingScale size schema\n * All sizes maintain 44px minimum touch targets (WCAG 2.2 AAA)\n */\nexport const RatingScaleSizeSchema = z.enum(['sm', 'default', 'lg']);\nexport type RatingScaleSize = z.infer<typeof RatingScaleSizeSchema>;\n\n/**\n * RatingScale props schema\n *\n * Configurable rating scale with 3 display styles:\n * - buttons: RadioGroup with numbered buttons\n * - stars: RadioGroup with star icons (fill up to selected)\n * - slider: Slider with discrete steps and tick marks\n */\nexport const RatingScalePropsSchema = BaseComponentPropsSchema.extend({\n // Value props — number | null (null = N/A selected)\n value: z.number().nullable().optional(),\n onChange: z.custom<(value: number | null) => void>().optional(),\n\n // Range props\n min: z.number().optional().default(1),\n max: z.number().optional().default(5),\n step: z.number().optional().default(1),\n\n // Display\n displayStyle: RatingScaleDisplayStyleSchema.optional().default('buttons'),\n\n // Labels\n label: z.string().optional(),\n description: z.string().optional(),\n errorMessage: z.string().optional(),\n lowLabel: z.string().optional(),\n highLabel: z.string().optional(),\n valueLabels: z.record(z.string(), z.string()).optional(),\n\n // N/A support\n showNA: z.boolean().optional().default(false),\n\n // State props\n isRequired: z.boolean().optional().default(false),\n isDisabled: z.boolean().optional().default(false),\n isReadOnly: z.boolean().optional().default(false),\n isInvalid: z.boolean().optional().default(false),\n\n // Sizing\n size: RatingScaleSizeSchema.optional().default('default'),\n\n // Form integration\n name: z.string().optional(),\n});\n\nexport interface RatingScaleProps {\n className?: string;\n children?: unknown;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-hidden'?: boolean;\n 'data-testid'?: string;\n value?: number | null;\n onChange?: (value: number | null) => void;\n min?: number;\n max?: number;\n step?: number;\n displayStyle?: RatingScaleDisplayStyle;\n label?: string;\n description?: string;\n errorMessage?: string;\n lowLabel?: string;\n highLabel?: string;\n valueLabels?: Record<string, string>;\n showNA?: boolean;\n isRequired?: boolean;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n size?: RatingScaleSize;\n name?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/styles/interaction-states.ts","../../../src/elements/RatingScale/RatingScale.styles.ts","../../../src/elements/RatingScale/RatingScale.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/RatingScale/RatingScale.types.ts"],"names":["cn","inputs","twMerge","clsx","FOCUS_STYLES","HIGH_CONTRAST_FOCUS","ratingScaleContainerVariants","cva","ratingScaleRowVariants","ratingScaleButtonOuterVariants","ratingScaleButtonVisualVariants","ratingScaleStarOuterVariants","ratingScaleStarVisualVariants","ratingScaleSliderTrackVariants","ratingScaleSliderFillVariants","ratingScaleSliderThumbVariants","ratingScaleSliderTickVariants","ratingScaleNAButtonVariants","getStepValues","min","max","step","values","v","ButtonsRenderer","currentValue","onValueChange","size","isDisabled","isReadOnly","isInvalid","name","groupId","jsx","AriaRadioGroup","val","AriaRadio","isSelected","StarsRenderer","isFilled","Star","SliderRenderer","effectiveValue","jsxs","AriaSlider","SliderOutput","state","SliderTrack","Fragment","percent","SliderThumb","RatingScale","forwardRef","props","ref","value","onChange","displayStyle","label","description","errorMessage","lowLabel","highLabel","valueLabels","showNA","isRequired","className","id","ariaLabel","ariaDescribedby","dataTestId","generatedId","useId","labelId","descriptionId","errorId","describedByParts","isControlled","internalValue","setInternalValue","useState","handleValueChange","useCallback","newValue","handleNAToggle","currentValueLabel","rendererProps","Label","Text","BaseComponentPropsSchema","z","RatingScaleDisplayStyleSchema","RatingScaleSizeSchema","RatingScalePropsSchema"],"mappings":"oXAcO,SAASA,CAAAA,CAAAA,GAAMC,EAA8B,CAClD,OAAOC,OAAAA,CAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCIO,IAAMG,EAAe,+GAAA,CAsCrB,IAAMC,CAAAA,CAAsB,wJC3C5B,IAAMC,EAA+BC,GAAAA,CAAI,uBAAA,CAAyB,CACvE,QAAA,CAAU,CACR,KAAM,CACJ,EAAA,CAAI,UACJ,OAAA,CAAS,SAAA,CACT,GAAI,WACN,CACF,EACA,eAAA,CAAiB,CAAE,KAAM,SAAU,CACrC,CAAC,CAAA,CAGYC,CAAAA,CAAyBD,IAAI,mBAAA,CAAqB,CAC7D,SAAU,CACR,IAAA,CAAM,CACJ,EAAA,CAAI,OAAA,CACJ,QAAS,SAAA,CACT,EAAA,CAAI,OACN,CACF,CAAA,CACA,eAAA,CAAiB,CAAE,KAAM,SAAU,CACrC,CAAC,CAAA,CAOYE,CAAAA,CAAiCF,IAC5C,CACE,yCAAA,CACA,4BACA,gBAAA,CACAH,CAAAA,CACAC,EACA,gEACF,CAAA,CAAE,KAAK,GAAG,CACZ,EAGaK,CAAAA,CAAkCH,GAAAA,CAC7C,CACE,yCAAA,CACA,+BAAA,CACA,iCACA,+BACF,CAAA,CAAE,KAAK,GAAG,CAAA,CACV,CACE,QAAA,CAAU,CACR,KAAM,CACJ,EAAA,CAAI,kBACJ,OAAA,CAAS,iBAAA,CACT,GAAI,qBACN,CAAA,CACA,WAAY,CACV,IAAA,CAAM,+HAAA,CACN,KAAA,CAAO,iHACT,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,wCAAA,CACN,MAAO,EACT,CACF,EACA,eAAA,CAAiB,CACf,KAAM,SAAA,CACN,UAAA,CAAY,MACZ,SAAA,CAAW,KACb,CACF,CACF,CAAA,CAOaI,EAA+BJ,GAAAA,CAC1C,CACE,0CACA,2BAAA,CACA,gB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GxD,IAAA,CAAMF,CAAAA,CAAE,QAAO,CAAE,QAAA,EACnB,CAAC","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","/**\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","import { cva } from 'class-variance-authority';\nimport { FOCUS_STYLES, HIGH_CONTRAST_FOCUS } from '../../styles/interaction-states';\n\n/**\n * RatingScale CVA Variant Definitions\n *\n * Organised by display style (buttons, stars, slider) and shared elements.\n * All interactive elements maintain 44x44px minimum touch targets (WCAG 2.2 AAA).\n */\n\n// =============================================================================\n// Shared / Container\n// =============================================================================\n\n/** Root wrapper */\nexport const ratingScaleContainerVariants = cva(\"flex flex-col gap-1.5\", {\n variants: {\n size: {\n sm: \"text-sm\",\n default: \"text-sm\",\n lg: \"text-base\",\n },\n },\n defaultVariants: { size: \"default\" },\n});\n\n/** Horizontal row containing scale items + endpoint labels */\nexport const ratingScaleRowVariants = cva(\"flex items-center\", {\n variants: {\n size: {\n sm: \"gap-1\",\n default: \"gap-1.5\",\n lg: \"gap-2\",\n },\n },\n defaultVariants: { size: \"default\" },\n});\n\n// =============================================================================\n// Buttons Display Style\n// =============================================================================\n\n/** Layer 1: Touch target for each button (44x44px minimum, transparent) */\nexport const ratingScaleButtonOuterVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"min-h-[44px] min-w-[44px]\",\n \"cursor-pointer\",\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n \"data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n ].join(\" \"),\n);\n\n/** Layer 2: Visual button */\nexport const ratingScaleButtonVisualVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"rounded-md border font-medium\",\n \"transition-colors duration-200\",\n \"motion-reduce:transition-none\",\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"h-8 w-8 text-xs\",\n default: \"h-9 w-9 text-sm\",\n lg: \"h-11 w-11 text-base\",\n },\n isSelected: {\n true: \"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] border-[var(--primary-action)] motion-safe:selection-pulse\",\n false: \"bg-[var(--content-background)] text-[var(--content-foreground)] border-[var(--border)] hover:bg-[var(--accent)]\",\n },\n isInvalid: {\n true: \"border-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: {\n size: \"default\",\n isSelected: false,\n isInvalid: false,\n },\n }\n);\n\n// =============================================================================\n// Stars Display Style\n// =============================================================================\n\n/** Layer 1: Touch target for each star (44x44px minimum, transparent) */\nexport const ratingScaleStarOuterVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"min-h-[44px] min-w-[44px]\",\n \"cursor-pointer\",\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n \"data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n ].join(\" \"),\n);\n\n/** Layer 2: Star icon visual */\nexport const ratingScaleStarVisualVariants = cva(\n [\n \"transition-colors duration-200\",\n \"motion-reduce:transition-none\",\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"h-5 w-5\",\n default: \"h-6 w-6\",\n lg: \"h-8 w-8\",\n },\n isFilled: {\n true: \"fill-[var(--primary-action)] text-[var(--primary-action)] motion-safe:selection-pulse\",\n false: \"fill-none text-[var(--border)] hover:text-[var(--primary-action)]/50\",\n },\n isInvalid: {\n true: \"text-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: {\n size: \"default\",\n isFilled: false,\n isInvalid: false,\n },\n }\n);\n\n// =============================================================================\n// Slider Display Style\n// =============================================================================\n\n/** Slider track — overflow-visible so thumb + ticks render outside the thin bar */\nexport const ratingScaleSliderTrackVariants = cva(\n [\n \"relative w-full rounded-full overflow-visible\",\n \"bg-[var(--border)]\",\n \"cursor-pointer\",\n \"data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed\",\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"h-1.5\",\n default: \"h-2\",\n lg: \"h-3\",\n },\n },\n defaultVariants: { size: \"default\" },\n }\n);\n\n/** Slider filled portion of track */\nexport const ratingScaleSliderFillVariants = cva(\n \"absolute top-0 left-0 h-full rounded-full bg-[var(--primary-action)]\",\n {\n variants: {\n isInvalid: {\n true: \"bg-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: { isInvalid: false },\n }\n);\n\n/** Slider thumb — Layer 1 is handled by React Aria's SliderThumb (44px touch target) */\nexport const ratingScaleSliderThumbVariants = cva(\n [\n \"rounded-full bg-[var(--primary-action)] border-2 border-[var(--content-background)]\",\n \"shadow-md\",\n \"transition-transform duration-200\",\n \"motion-reduce:transition-none\",\n \"data-[dragging]:scale-110\",\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"h-4 w-4\",\n default: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: { size: \"default\" },\n }\n);\n\n/** Slider tick mark at each step — vertical lines below the track */\nexport const ratingScaleSliderTickVariants = cva(\n \"absolute bg-[var(--content-foreground)]/30\",\n {\n variants: {\n size: {\n sm: \"w-px h-2 top-[calc(100%+2px)]\",\n default: \"w-px h-2.5 top-[calc(100%+3px)]\",\n lg: \"w-px h-3 top-[calc(100%+4px)]\",\n },\n },\n defaultVariants: { size: \"default\" },\n }\n);\n\n// =============================================================================\n// N/A Button\n// =============================================================================\n\n/** N/A toggle button */\nexport const ratingScaleNAButtonVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"min-h-[44px] min-w-[44px] px-3\",\n \"rounded-md border font-medium\",\n \"cursor-pointer\",\n \"transition-colors duration-200\",\n \"motion-reduce:transition-none\",\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n \"disabled:pointer-events-none disabled:opacity-50\",\n ].join(\" \"),\n {\n variants: {\n size: {\n sm: \"text-xs\",\n default: \"text-sm\",\n lg: \"text-base\",\n },\n isSelected: {\n true: \"bg-[var(--muted)] text-[var(--content-foreground)] border-[var(--content-foreground)]\",\n false: \"bg-[var(--content-background)] text-[var(--muted-foreground)] border-[var(--border)] hover:bg-[var(--accent)]\",\n },\n },\n defaultVariants: {\n size: \"default\",\n isSelected: false,\n },\n }\n);\n","\"use client\";\n\n/**\n * RatingScale Component\n * Configurable scale with 3 display styles for scoring/evaluation.\n *\n * Display styles:\n * - buttons: Numbered buttons in a RadioGroup\n * - stars: Star icons that fill up to selected value\n * - slider: Discrete step slider with tick marks\n *\n * Built on React Aria RadioGroup (buttons/stars) and Slider primitives.\n *\n * @see WCAG 2.2 AAA — 44x44px touch targets, 7:1 contrast, keyboard navigation\n */\n\nimport {\n forwardRef,\n useState,\n useId,\n useCallback,\n type ReactNode,\n type ForwardedRef,\n} from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n Slider as AriaSlider,\n SliderTrack,\n SliderThumb,\n SliderOutput,\n Label,\n Text,\n} from 'react-aria-components';\nimport { Star } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { RatingScaleProps, RatingScaleSize } from './RatingScale.types';\nimport {\n ratingScaleContainerVariants,\n ratingScaleRowVariants,\n ratingScaleButtonOuterVariants,\n ratingScaleButtonVisualVariants,\n ratingScaleStarOuterVariants,\n ratingScaleStarVisualVariants,\n ratingScaleSliderTrackVariants,\n ratingScaleSliderFillVariants,\n ratingScaleSliderThumbVariants,\n ratingScaleSliderTickVariants,\n ratingScaleNAButtonVariants,\n} from './RatingScale.styles';\n\n// =============================================================================\n// Helpers\n// =============================================================================\n\n/** Generate the array of step values for the scale */\nfunction getStepValues(min: number, max: number, step: number): number[] {\n const values: number[] = [];\n for (let v = min; v <= max; v += step) {\n values.push(v);\n }\n return values;\n}\n\n// =============================================================================\n// Sub-renderers\n// =============================================================================\n\ninterface RendererProps {\n values: number[];\n currentValue: number | null;\n onValueChange: (value: number) => void;\n size: RatingScaleSize;\n isDisabled: boolean;\n isReadOnly: boolean;\n isInvalid: boolean;\n name?: string;\n groupId: string;\n min: number;\n max: number;\n step: number;\n}\n\n/** Buttons display: numbered buttons in a RadioGroup */\nfunction ButtonsRenderer({\n values,\n currentValue,\n onValueChange,\n size,\n isDisabled,\n isReadOnly,\n isInvalid,\n name,\n groupId,\n}: RendererProps): ReactNode {\n return (\n <AriaRadioGroup\n aria-labelledby={`${groupId}-label`}\n value={currentValue !== null ? String(currentValue) : undefined}\n onChange={(val: string) => onValueChange(Number(val))}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n orientation=\"horizontal\"\n name={name}\n className=\"flex items-center gap-0\"\n >\n <div className={ratingScaleRowVariants({ size })}>\n {values.map((v) => (\n <AriaRadio\n key={v}\n value={String(v)}\n aria-label={String(v)}\n className={ratingScaleButtonOuterVariants()}\n >\n {({ isSelected }) => (\n <span\n className={ratingScaleButtonVisualVariants({\n size,\n isSelected,\n isInvalid,\n })}\n >\n {v}\n </span>\n )}\n </AriaRadio>\n ))}\n </div>\n </AriaRadioGroup>\n );\n}\n\n/** Stars display: star icons that fill up to selected value */\nfunction StarsRenderer({\n values,\n currentValue,\n onValueChange,\n size,\n isDisabled,\n isReadOnly,\n isInvalid,\n name,\n groupId,\n}: RendererProps): ReactNode {\n return (\n <AriaRadioGroup\n aria-labelledby={`${groupId}-label`}\n value={currentValue !== null ? String(currentValue) : undefined}\n onChange={(val: string) => onValueChange(Number(val))}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n orientation=\"horizontal\"\n name={name}\n className=\"flex items-center gap-0\"\n >\n <div className={ratingScaleRowVariants({ size })}>\n {values.map((v) => {\n const isFilled = currentValue !== null && v <= currentValue;\n return (\n <AriaRadio\n key={v}\n value={String(v)}\n aria-label={`${v} star${v !== 1 ? 's' : ''}`}\n className={ratingScaleStarOuterVariants()}\n >\n <Star\n aria-hidden=\"true\"\n className={ratingScaleStarVisualVariants({\n size,\n isFilled,\n isInvalid,\n })}\n />\n </AriaRadio>\n );\n })}\n </div>\n </AriaRadioGroup>\n );\n}\n\n/** Slider display: discrete step slider with tick marks */\nfunction SliderRenderer({\n values,\n currentValue,\n onValueChange,\n size,\n isDisabled,\n isInvalid,\n min,\n max,\n step,\n groupId,\n}: RendererProps): ReactNode {\n const effectiveValue = currentValue ?? min;\n\n return (\n <AriaSlider\n aria-labelledby={`${groupId}-label`}\n value={effectiveValue}\n onChange={onValueChange}\n minValue={min}\n maxValue={max}\n step={step}\n isDisabled={isDisabled}\n className=\"flex w-full flex-col gap-1 pb-4\"\n >\n <div className=\"flex items-center justify-between\">\n <SliderOutput className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {({ state }) => state.values[0]}\n </SliderOutput>\n </div>\n <SliderTrack className={cn(ratingScaleSliderTrackVariants({ size }), \"relative\")}>\n {({ state }) => (\n <>\n {/* Filled portion */}\n <div\n className={ratingScaleSliderFillVariants({ isInvalid })}\n style={{ width: `${(((state.values[0] ?? min) - min) / (max - min)) * 100}%` }}\n />\n\n {/* Tick marks */}\n {values.map((v) => {\n const percent = ((v - min) / (max - min)) * 100;\n return (\n <div\n key={v}\n className={ratingScaleSliderTickVariants({ size })}\n style={{ left: `${percent}%`, transform: 'translateX(-50%)' }}\n aria-hidden=\"true\"\n />\n );\n })}\n\n {/* Thumb — override React Aria's top:0 to center on track */}\n <SliderThumb\n className={ratingScaleSliderThumbVariants({ size })}\n style={{ top: '50%' }}\n />\n </>\n )}\n </SliderTrack>\n </AriaSlider>\n );\n}\n\n// =============================================================================\n// RatingScale Component\n// =============================================================================\n\nconst RatingScale = forwardRef<HTMLDivElement, RatingScaleProps>(\n function RatingScale(props: RatingScaleProps, ref: ForwardedRef<HTMLDivElement>) {\n const {\n // Value\n value,\n onChange,\n // Range\n min = 1,\n max = 5,\n step = 1,\n // Display\n displayStyle = 'buttons',\n // Labels\n label,\n description,\n errorMessage,\n lowLabel,\n highLabel,\n valueLabels,\n // N/A\n showNA = false,\n // State\n isRequired = false,\n isDisabled = false,\n isReadOnly = false,\n isInvalid = false,\n // Sizing\n size = 'default',\n // Form\n name,\n // Standard\n className,\n id,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'data-testid': dataTestId,\n } = props;\n\n const generatedId = useId();\n const groupId = id ?? generatedId;\n const labelId = `${groupId}-label`;\n const descriptionId = `${groupId}-description`;\n const errorId = `${groupId}-error`;\n\n const describedByParts: string[] = [];\n if (ariaDescribedby) describedByParts.push(ariaDescribedby);\n if (description) describedByParts.push(descriptionId);\n if (isInvalid && errorMessage) describedByParts.push(errorId);\n\n const values = getStepValues(min, max, step);\n\n // Controlled vs uncontrolled state management\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<number | null>(null);\n const currentValue = isControlled ? (value ?? null) : internalValue;\n\n const handleValueChange = useCallback(\n (newValue: number) => {\n if (isReadOnly) return;\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n },\n [onChange, isReadOnly, isControlled],\n );\n\n const handleNAToggle = useCallback(() => {\n if (isDisabled || isReadOnly) return;\n if (currentValue === null) {\n // Deselect N/A — revert to min value\n if (!isControlled) {\n setInternalValue(min);\n }\n onChange?.(min);\n } else {\n if (!isControlled) {\n setInternalValue(null);\n }\n onChange?.(null);\n }\n }, [currentValue, onChange, min, isDisabled, isReadOnly, isControlled]);\n\n const currentValueLabel =\n currentValue !== null && valueLabels\n ? valueLabels[String(currentValue)]\n : undefined;\n\n const rendererProps: RendererProps = {\n values,\n currentValue,\n onValueChange: handleValueChange,\n size,\n isDisabled,\n isReadOnly,\n isInvalid,\n name,\n groupId,\n min,\n max,\n step,\n };\n\n return (\n <div\n ref={ref}\n id={groupId}\n role=\"group\"\n aria-label={ariaLabel}\n aria-labelledby={label ? labelId : undefined}\n aria-describedby={describedByParts.length > 0 ? describedByParts.join(' ') : undefined}\n data-testid={dataTestId}\n className={cn(ratingScaleContainerVariants({ size }), className)}\n >\n {/* Label */}\n {label && (\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && (\n <span className=\"ml-1 text-[var(--destructive-background)]\" aria-hidden=\"true\">\n *\n </span>\n )}\n </Label>\n )}\n\n {/* Description */}\n {description && (\n <Text\n id={descriptionId}\n slot=\"description\"\n className=\"text-sm text-[var(--menu-muted)]\"\n >\n {description}\n </Text>\n )}\n\n {/* Scale row with endpoint labels */}\n <div className=\"flex items-center gap-2\">\n {lowLabel && (\n <span className=\"text-sm text-[var(--muted-foreground)] whitespace-nowrap\">\n {lowLabel}\n </span>\n )}\n\n <div className=\"flex-1\">\n {displayStyle === 'buttons' && <ButtonsRenderer {...rendererProps} />}\n {displayStyle === 'stars' && <StarsRenderer {...rendererProps} />}\n {displayStyle === 'slider' && <SliderRenderer {...rendererProps} />}\n </div>\n\n {highLabel && (\n <span className=\"text-sm text-[var(--muted-foreground)] whitespace-nowrap\">\n {highLabel}\n </span>\n )}\n\n {/* N/A Button */}\n {showNA && (\n <button\n type=\"button\"\n aria-pressed={currentValue === null}\n disabled={isDisabled}\n onClick={handleNAToggle}\n className={ratingScaleNAButtonVariants({\n size,\n isSelected: currentValue === null,\n })}\n >\n N/A\n </button>\n )}\n </div>\n\n {/* Value label */}\n {currentValueLabel && (\n <span\n className=\"text-sm font-medium text-[var(--content-foreground)]\"\n aria-live=\"polite\"\n >\n {currentValueLabel}\n </span>\n )}\n\n {/* Error message */}\n {isInvalid && errorMessage && (\n <div\n id={errorId}\n role=\"alert\"\n className=\"text-sm text-[var(--destructive-background)]\"\n >\n {errorMessage}\n </div>\n )}\n </div>\n );\n },\n);\n\nRatingScale.displayName = \"RatingScale\";\n\nexport { RatingScale };\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 { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\n\n/**\n * RatingScale display style schema\n * Determines the visual rendering of the scale\n */\nexport const RatingScaleDisplayStyleSchema = z.enum(['buttons', 'stars', 'slider']);\nexport type RatingScaleDisplayStyle = z.infer<typeof RatingScaleDisplayStyleSchema>;\n\n/**\n * RatingScale size schema\n * All sizes maintain 44px minimum touch targets (WCAG 2.2 AAA)\n */\nexport const RatingScaleSizeSchema = z.enum(['sm', 'default', 'lg']);\nexport type RatingScaleSize = z.infer<typeof RatingScaleSizeSchema>;\n\n/**\n * RatingScale props schema\n *\n * Configurable rating scale with 3 display styles:\n * - buttons: RadioGroup with numbered buttons\n * - stars: RadioGroup with star icons (fill up to selected)\n * - slider: Slider with discrete steps and tick marks\n */\nexport const RatingScalePropsSchema = BaseComponentPropsSchema.extend({\n // Value props — number | null (null = N/A selected)\n value: z.number().nullable().optional(),\n onChange: z.custom<(value: number | null) => void>().optional(),\n\n // Range props\n min: z.number().optional().default(1),\n max: z.number().optional().default(5),\n step: z.number().optional().default(1),\n\n // Display\n displayStyle: RatingScaleDisplayStyleSchema.optional().default('buttons'),\n\n // Labels\n label: z.string().optional(),\n description: z.string().optional(),\n errorMessage: z.string().optional(),\n lowLabel: z.string().optional(),\n highLabel: z.string().optional(),\n valueLabels: z.record(z.string(), z.string()).optional(),\n\n // N/A support\n showNA: z.boolean().optional().default(false),\n\n // State props\n isRequired: z.boolean().optional().default(false),\n isDisabled: z.boolean().optional().default(false),\n isReadOnly: z.boolean().optional().default(false),\n isInvalid: z.boolean().optional().default(false),\n\n // Sizing\n size: RatingScaleSizeSchema.optional().default('default'),\n\n // Form integration\n name: z.string().optional(),\n});\n\nexport interface RatingScaleProps {\n className?: string;\n children?: unknown;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-hidden'?: boolean;\n 'data-testid'?: string;\n value?: number | null;\n onChange?: (value: number | null) => void;\n min?: number;\n max?: number;\n step?: number;\n displayStyle?: RatingScaleDisplayStyle;\n label?: string;\n description?: string;\n errorMessage?: string;\n lowLabel?: string;\n highLabel?: string;\n valueLabels?: Record<string, string>;\n showNA?: boolean;\n isRequired?: boolean;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n size?: RatingScaleSize;\n name?: string;\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var react=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod'),classVarianceAuthority=require('class-variance-authority'),lucideReact=require('lucide-react'),reactAriaComponents=require('react-aria-components');function S(...o){return tailwindMerge.twMerge(clsx.clsx(o))}var oe=react.createContext(null);oe.displayName="ResizableContext";function Q(){let o=react.useContext(oe);if(!o)throw new Error("useResizableContext must be used within a ResizablePanelGroup. Make sure ResizablePanel and ResizableHandle are children of ResizablePanelGroup.");return o}function we({direction:o,groupLabel:e,sizes:a,onSizesChange:t}){let[d,n]=react.useState([]),[i,l]=react.useState([]),r=react.useRef(null),u=react.useRef(null),x=react.useRef(null),f=react.useRef(false),P=a!==void 0,R=P?a:d,z=react.useCallback(b=>{P?t?.(b):n(b);},[P,t]),L=react.useCallback((b,s)=>{l(E=>{let V=[...E];return V[b]=s,V});},[]),C=react.useCallback(b=>{l(s=>{let E=[...s];return delete E[b],E.filter(Boolean)});},[]);react.useEffect(()=>{if(P||f.current)return;let s=i.filter(Boolean).length;if(s<2)return;if(R.length<s||R.some(V=>V===void 0)){let V=[],p=100/s;for(let m=0;m<s;m++)V[m]=p;f.current=true,n(V);}},[i,R,P]),react.useEffect(()=>()=>{x.current&&clearTimeout(x.current),u.current&&(document.body.removeChild(u.current),u.current=null);},[]);let y=react.useCallback(b=>{if(!u.current){let s=document.createElement("div");s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true"),s.className="sr-only",s.style.cssText="position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;",document.body.appendChild(s),u.current=s;}u.current.textContent=b,x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{u.current&&(u.current.textContent="");},1e3);},[]);return {direction:o,groupLabel:e,sizes:R,setSizes:z,panels:i,registerPanel:L,unregisterPanel:C,announce:y,containerRef:r}}var Te=react.forwardRef(function({direction:e,groupLabel:a,sizes:t,onSizesChange:d,className:n,children:i},l){let r=we({direction:e,groupLabel:a,sizes:t,onSizesChange:d});return react.useImperativeHandle(l,()=>r.containerRef.current,[r.containerRef]),jsxRuntime.jsx(oe.Provider,{value:r,children:jsxRuntime.jsx("div",{ref:r.containerRef,role:"group","aria-label":`${a}, ${e}`,"data-direction":e,className:S("flex h-full w-full",e==="horizontal"?"flex-row":"flex-col",n),children:i})})});Te.displayName="ResizablePanelGroup";var $=10,j=90,ae=300,Ae=zod.z.object({label:zod.z.string().min(1),sizes:zod.z.array(zod.z.number().min(0).max(100))}),bt=zod.z.object({direction:zod.z.enum(["horizontal","vertical"]),groupLabel:zod.z.string().min(1),sizes:zod.z.array(zod.z.number().min(0).max(100)).optional(),onSizesChange:zod.z.function().optional(),className:zod.z.string().optional(),children:zod.z.custom()}),vt=zod.z.object({name:zod.z.string().min(1),defaultSize:zod.z.number().min(0).max(100).optional(),minSize:zod.z.number().min(0).max(100).optional().default($),maxSize:zod.z.number().min(0).max(100).optional().default(j),collapsible:zod.z.boolean().optional().default(false),onCollapse:zod.z.function().optional(),onExpand:zod.z.function().optional(),onResize:zod.z.function().optional(),className:zod.z.string().optional(),children:zod.z.custom()}),xt=zod.z.object({withHandle:zod.z.boolean().optional().default(true),presets:zod.z.array(Ae).optional(),disabled:zod.z.boolean().optional().default(false),className:zod.z.string().optional()}),pe=classVarianceAuthority.cva(["relative flex items-center justify-center","shrink-0","bg-transparent","transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2","touch-none select-none"],{variants:{direction:{horizontal:["w-3 min-w-[12px]","cursor-col-resize","hover:bg-[var(--accent)]/50","before:absolute before:inset-y-0 before:-inset-x-4","before:min-w-[44px]"],vertical:["h-3 min-h-[12px]","cursor-row-resize","hover:bg-[var(--accent)]/50","before:absolute before:inset-x-0 before:-inset-y-4","before:min-h-[44px]"]},disabled:{true:"cursor-not-allowed opacity-50 pointer-events-none",false:""},isDragging:{true:"bg-[var(--accent)]",false:""}},defaultVariants:{direction:"horizontal",disabled:false,isDragging:false}}),fe=classVarianceAuthority.cva(["flex items-center justify-center","rounded-full","bg-[var(--border)]","text-[var(--menu-muted)]"],{variants:{direction:{horizontal:"h-8 w-1",vertical:"h-1 w-8"}},defaultVariants:{direction:"horizontal"}});var De=react.forwardRef(function({name:e,defaultSize:a,minSize:t=$,maxSize:d=j,collapsible:n=false,onCollapse:i,onExpand:l,onResize:r,className:u,children:x},f){let{sizes:P,registerPanel:R,unregisterPanel:z,containerRef:L}=Q(),C=react.useRef(null),[y,b]=react.useState(-1),s=react.useRef(null),E=react.useRef(false),V=react.useRef(-1);react.useEffect(()=>{let m=C.current,v=L.current;if(!m||!v)return;let N=v.querySelectorAll("[data-resizable-panel]"),T=-1;for(let M=0;M<N.length;M++)if(N[M]===m){T=M;break}if(T!==-1)return y!==T&&b(T),E.current||(E.current=true,V.current=T,R(T,{name:e,minSize:t,maxSize:d,collapsible:n})),()=>{E.current&&(z(V.current),E.current=false);}},[L,R,z,e,t,d,n,y]);let p=y>=0?P[y]??50:50;return react.useEffect(()=>{if(s.current===null){s.current=p;return}let m=s.current===0,v=p===0;!m&&v&&i?i():m&&!v&&l&&l(),r&&s.current!==p&&r(p),s.current=p;},[p,i,l,r]),jsxRuntime.jsx("div",{ref:m=>{C.current=m,typeof f=="function"?f(m):f&&(f.current=m);},role:"region","aria-label":e,"data-resizable-panel":"","data-panel-name":e,"data-panel-index":y,"data-collapsed":p===0,style:{flexBasis:`${p}%`,flexGrow:0,flexShrink:0,overflow:"hidden"},className:S("relative",u),children:x})});De.displayName="ResizablePanel";function Ie(o,e,a){return Math.max(e,Math.min(a,o))}function Me(o,e,a,t,d){let n=[...o],i=e[a],l=e[t];if(!i||!l)return o;let r=o[a]??50,u=o[t]??50,x=r+d,f=u-d,P=i.collapsible?0:i.minSize,R=i.maxSize,z=l.collapsible?0:l.minSize,L=l.maxSize;return x=Ie(x,P,R),f=r+u-x,f=Ie(f,z,L),x=r+u-f,n[a]=x,n[t]=f,n}function Fe({direction:o,sizes:e,setSizes:a,panels:t,containerRef:d,leftPanelIndex:n,rightPanelIndex:i,disabled:l=false,announce:r,groupLabel:u,onOpenPopover:x}){let[f,P]=react.useState(false),R=react.useRef(null),z=react.useRef(null),L=react.useRef(0),C=react.useRef(false),y=react.useRef(t),b=react.useRef(e),s=react.useRef(a),E=react.useRef(()=>{}),V=react.useRef(()=>{});react.useEffect(()=>{y.current=t,b.current=e,s.current=a;},[t,e,a]);let p=react.useCallback(()=>{let h=d.current;return h?o==="horizontal"?h.offsetWidth:h.offsetHeight:0},[d,o]),m=react.useCallback(h=>{let A=p();return A===0?0:h/A*100},[p]),v=react.useCallback(h=>{E.current(h);},[]),N=react.useCallback(()=>{V.current();},[]),T=react.useCallback(h=>{if(!R.current||l)return;let I=(o==="horizontal"?h.clientX:h.clientY)-R.current.position,w=m(I),D=Me(R.current.sizes,y.current,n,i,w);s.current(D);},[o,l,n,m,i]),M=react.useCallback(()=>{if(z.current&&(clearTimeout(z.current),z.current=null),Date.now()-L.current<ae&&!C.current&&x&&!l&&x(),f){P(false);let I=y.current[n],w=Math.round(b.current[n]??50);r&&I&&u&&r(`${I.name} in ${u} resized to ${w} percent`);}R.current=null,C.current=false,document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",N),document.removeEventListener("pointercancel",N),document.body.style.cursor="",document.body.style.userSelect="";},[r,l,u,f,n,x,v,N]);react.useEffect(()=>{E.current=T,V.current=M;});let O=react.useCallback(h=>{if(l)return;h.preventDefault();let A=o==="horizontal"?h.clientX:h.clientY;L.current=Date.now(),C.current=false,R.current={position:A,sizes:[...e],containerSize:p()},z.current=setTimeout(()=>{C.current=true,P(true),document.body.style.cursor=o==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none";},ae),document.addEventListener("pointermove",v),document.addEventListener("pointerup",N),document.addEventListener("pointercancel",N),h.pointerType==="mouse"&&(z.current&&(clearTimeout(z.current),z.current=null),C.current=true,P(true),document.body.style.cursor=o==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none");},[o,l,p,v,N,e]),F=react.useCallback(h=>{if(l)return;let A=h.shiftKey?10:1,I=0;switch(h.key){case "ArrowLeft":case "ArrowUp":I=-A;break;case "ArrowRight":case "ArrowDown":I=A;break;case "Home":{let w=t[n];w&&(I=(w.collapsible?0:w.minSize)-(e[n]??50));break}case "End":{let w=t[n];w&&(I=w.maxSize-(e[n]??50));break}case "Enter":case " ":h.preventDefault(),x?.();return;default:return}if(I!==0){h.preventDefault();let w=Me(e,t,n,i,I);a(w);let D=t[n],G=Math.round(w[n]??50);r&&D&&u&&r(`${D.name} in ${u} resized to ${G} percent`);}},[r,l,u,n,x,t,i,a,e]);return react.useEffect(()=>{let h=v,A=N;return ()=>{z.current&&clearTimeout(z.current),document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",A),document.removeEventListener("pointercancel",A);}},[v,N]),{isDragging:f,handlePointerDown:O,handleKeyDown:F}}var ve=classVarianceAuthority.cva("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",{variants:{fullWidth:{true:"w-full",false:""},inVerticalGroup:{true:"items-stretch",false:"items-center"}},defaultVariants:{fullWidth:false,inVerticalGroup:false}}),xe=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer",{variants:{variant:{default:"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] data-[pressed]:bg-[var(--primary-action)]/80",destructive:"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80",outline:"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]",secondary:"bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70",ghost:"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]",link:"text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]"},fullWidth:{true:"w-full",false:""},visualSize:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-xs",lg:"h-11 rounded-md px-8",icon:"h-10 w-10",dot:"h-5 w-5 rounded-full p-0 min-h-0 min-w-0"},paywall:{true:"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent",false:""}},defaultVariants:{variant:"default",visualSize:"default",paywall:false}});var he="data-[pressed]:scale-[0.97]";var ge="data-[hovered]:shadow-md";var se="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",le="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";var ke=react.createContext(null);ke.displayName="ButtonGroupContext";function Oe(){return react.useContext(ke)}var Ue=react.createContext(null);Ue.displayName="ButtonGroupItemContext";function $e(){return react.useContext(Ue)}classVarianceAuthority.cva("inline-flex items-center gap-0",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col w-full"}},defaultVariants:{orientation:"horizontal"}});var je=classVarianceAuthority.cva("",{variants:{orientation:{horizontal:"min-w-[44px]",vertical:"flex min-h-[44px]"},position:{first:"",middle:"",last:"",only:""}},compoundVariants:[{orientation:"horizontal",position:"first",className:"rounded-r-none border-r-0"},{orientation:"horizontal",position:"middle",className:"rounded-none border-r-0"},{orientation:"horizontal",position:"last",className:"rounded-l-none"},{orientation:"vertical",position:"first",className:"rounded-b-none border-b-0"},{orientation:"vertical",position:"middle",className:"rounded-none border-b-0"},{orientation:"vertical",position:"last",className:"rounded-t-none"}],defaultVariants:{orientation:"horizontal",position:"only"}});classVarianceAuthority.cva("bg-[var(--border)]",{variants:{orientation:{horizontal:"w-px h-6 mx-1",vertical:"h-px w-full my-1"}},defaultVariants:{orientation:"horizontal"}});var B=react.memo(react.forwardRef(({className:o,buttonVisualClassName:e,variant:a,size:t,visualSize:d,fullWidth:n,loading:i=false,loadingText:l="Loading...",shortcut:r,children:u,isDisabled:x,paywall:f=false,paywallRedirect:P,paywallDescription:R,onPress:z,...L},C)=>{let y=react.useId(),b=Oe(),s=$e(),E=a??b?.variant??"default",V=t??b?.size,p=x??b?.isDisabled??false,m=b?.orientation==="vertical",v=n||m,N=s?je({orientation:b?.orientation??"horizontal",position:s.position}):"",T=d??V??"default";return process.env.NODE_ENV!=="production"&&(T==="dot"||T==="icon")&&!L["aria-label"]&&!u&&console.warn('[Button] visualSize="dot" or "icon" requires aria-label when no visible text is provided (WCAG 1.1.1)'),jsxRuntime.jsx(reactAriaComponents.Button,{ref:C,isDisabled:p||i||void 0,"aria-disabled":f?true:void 0,"aria-describedby":f?y:void 0,onPress:F=>{if(f){P&&window.open(P,"_blank","noopener,noreferrer");return}z?.(F);},className:S(ve({fullWidth:v,inVerticalGroup:m}),o),...L,children:F=>jsxRuntime.jsxs("span",{className:S(xe({variant:E,visualSize:T,paywall:f,fullWidth:v}),N,e,he,ge,se,le),"data-pressed":F.isPressed||void 0,children:[i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"motion-safe:animate-spin","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"sr-only","aria-live":"polite",children:l})]}),!i&&u,f&&jsxRuntime.jsx(lucideReact.Zap,{"data-testid":"zap-icon","aria-hidden":"true",className:"ml-1"}),f&&jsxRuntime.jsxs("span",{id:y,className:"sr-only",children:["Premium feature: ",R||"Upgrade required to access this feature"]}),F.isFocusVisible&&r&&jsxRuntime.jsx("kbd",{className:"ml-auto hidden text-xs opacity-60 lg:inline",children:r}),F.isPressed&&jsxRuntime.jsx("span",{className:"absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95","aria-hidden":"true"})]})})}));B.displayName="Button";function qe(o,e){return !(o===false||e)}var Ye="(prefers-reduced-motion: reduce)";function Ct(){return typeof window>"u"?false:window.matchMedia(Ye).matches}function We(){let[o,e]=react.useState(Ct);return react.useEffect(()=>{let a=window.matchMedia(Ye);e(a.matches);let t=d=>{e(d.matches);};return a.addEventListener("change",t),()=>a.removeEventListener("change",t)},[]),o}var Xe=4294967295,Ze=0,Ke=-2147483647;zod.z.object({value:zod.z.number().nullable().optional(),defaultValue:zod.z.number().optional(),minValue:zod.z.number().optional(),maxValue:zod.z.number().optional(),allowNegative:zod.z.boolean().optional(),step:zod.z.number().positive().optional(),formatOptions:zod.z.custom().optional(),isDisabled:zod.z.boolean().optional(),isReadOnly:zod.z.boolean().optional(),isRequired:zod.z.boolean().optional(),isInvalid:zod.z.boolean().optional(),isWheelDisabled:zod.z.boolean().optional(),validate:zod.z.function().optional(),validationBehavior:zod.z.enum(["native","aria"]).default("native"),label:zod.z.string(),description:zod.z.string().optional(),errorMessage:zod.z.union([zod.z.string(),zod.z.function()]).optional(),stepperLayout:zod.z.enum(["sides","stacked","hidden"]).default("sides"),incrementAriaLabel:zod.z.string().optional(),decrementAriaLabel:zod.z.string().optional(),name:zod.z.string().optional(),size:zod.z.enum(["sm","default","lg"]).default("default"),onChange:zod.z.function().optional(),onFocus:zod.z.function().optional(),onBlur:zod.z.function().optional(),onFocusChange:zod.z.function().optional(),animated:zod.z.boolean().optional().default(true),springConfig:zod.z.object({stiffness:zod.z.number(),damping:zod.z.number()}).optional(),className:zod.z.string().optional(),autoFocus:zod.z.boolean().optional()});var Qe=classVarianceAuthority.cva(["inline-flex items-center rounded-md border","bg-[var(--content-background)] text-[var(--content-foreground)]","transition-colors duration-200","focus-within:ring-2 focus-within:ring-[var(--ring)] focus-within:ring-offset-2","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50"],{variants:{size:{sm:"h-9 text-sm",default:"h-10 text-base",lg:"h-12 text-lg"},isInvalid:{true:"border-[var(--destructive-background)] focus-within:ring-[var(--destructive-background)]",false:"border-[var(--input-border)] hover:border-[var(--input-border)]/80"}},defaultVariants:{size:"default",isInvalid:false}}),Je=classVarianceAuthority.cva(["flex-1 bg-transparent text-center tabular-nums","min-w-0","focus:outline-none","[appearance:textfield]","[&::-webkit-outer-spin-button]:appearance-none","[&::-webkit-inner-spin-button]:appearance-none"],{variants:{size:{sm:"px-2 text-sm",default:"px-3 text-base",lg:"px-4 text-lg"}},defaultVariants:{size:"default"}}),J=classVarianceAuthority.cva(["flex items-center justify-center","transition-colors duration-150","select-none","hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]","focus-visible:ring-inset","active:bg-[var(--accent)]/80","disabled:pointer-events-none disabled:opacity-50"],{variants:{size:{sm:"min-w-8 min-h-8 text-sm",default:"min-w-10 min-h-10 text-base",lg:"min-w-12 min-h-12 text-lg"},position:{left:"rounded-l-md border-r border-[var(--input-border)]",right:"rounded-r-md border-l border-[var(--input-border)]",top:"rounded-tr-md border-b border-l border-[var(--input-border)] h-1/2",bottom:"rounded-br-md border-l border-[var(--input-border)] h-1/2"}},defaultVariants:{size:"default"}}),et=classVarianceAuthority.cva(["block font-medium text-[var(--content-foreground)]","mb-1.5",'data-[required]:after:content-["*"] data-[required]:after:ml-0.5',"data-[required]:after:text-[var(--destructive-background)]"],{variants:{size:{sm:"text-sm",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),tt=classVarianceAuthority.cva(["text-[var(--menu-muted)]","mt-1"],{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),nt=classVarianceAuthority.cva(["flex items-center gap-1","text-[var(--destructive-background)]","mt-1"],{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}});var ee;function Bt(){return ee!==void 0?Promise.resolve(ee):import('motion').then(o=>(ee=o.animate,ee)).catch(()=>(ee=null,null))}function kt(o,e){if(e)try{let a={...e};return a.style==="currency"&&!a.currencyDisplay&&(a.currencyDisplay="narrowSymbol"),new Intl.NumberFormat(void 0,a).format(o)}catch{return String(Math.round(o))}return String(Math.round(o))}var de=react.forwardRef(({label:o,description:e,errorMessage:a,size:t="default",stepperLayout:d="sides",allowNegative:n=false,incrementAriaLabel:i,decrementAriaLabel:l,animated:r,springConfig:u,onChange:x,value:f,defaultValue:P,formatOptions:R,minValue:z,maxValue:L,className:C,isInvalid:y,isRequired:b,isDisabled:s,isReadOnly:E,...V},p)=>{let m=z??(n?Ke:Ze),v=L??Xe,N=d!=="hidden"&&!E,T=We(),M=qe(r,T)&&N,O=react.useRef(null),F=react.useRef(f??P??0),h=react.useRef(void 0),A=react.useRef(null);react.useEffect(()=>{M&&Bt().then(D=>{h.current=D??null;});},[M]),react.useEffect(()=>()=>{A.current?.stop();},[]);let I=D=>{let G=F.current;if(M&&h.current&&O.current&&G!==D){A.current?.stop();let K=D,q=O.current,Y=q.parentElement?.querySelector("input");q.style.display="",Y&&(Y.style.color="transparent"),A.current=h.current(G,K,{type:"spring",stiffness:u?.stiffness??500,damping:u?.damping??30,onUpdate:Pe=>{F.current=Pe,q.textContent=kt(Pe,R);},onComplete:()=>{q.style.display="none",Y&&(Y.style.color=""),A.current=null,F.current=K;}});}else F.current=D;x?.(D);},w=d==="stacked";return jsxRuntime.jsxs(reactAriaComponents.NumberField,{ref:p,className:S("group flex flex-col",C),minValue:m,maxValue:v,isInvalid:y,isRequired:b,isDisabled:s,isReadOnly:E,value:f,defaultValue:P,formatOptions:R,onChange:I,...V,children:[jsxRuntime.jsx(reactAriaComponents.Label,{className:S(et({size:t})),"data-required":b||void 0,children:o}),jsxRuntime.jsxs(reactAriaComponents.Group,{className:S(Qe({size:t,isInvalid:y??false}),w&&"pr-0"),children:[N&&!w&&jsxRuntime.jsx(B,{slot:"decrement",variant:"ghost",className:"!min-h-0 !min-w-0",buttonVisualClassName:S(J({size:t,position:"left"})),"aria-label":l??"Decrease value",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-4 w-4","aria-hidden":"true"})}),jsxRuntime.jsxs("div",{className:"relative flex flex-1",children:[jsxRuntime.jsx(reactAriaComponents.Input,{className:S(Je({size:t}),"w-full")}),M&&jsxRuntime.jsx("span",{ref:O,className:S("absolute inset-0 flex items-center justify-center","pointer-events-none bg-[var(--content-background)] tabular-nums",t==="sm"&&"px-2 text-sm",t==="default"&&"px-3 text-base",t==="lg"&&"px-4 text-lg"),style:{display:"none"},"aria-hidden":"true"})]}),N&&w&&jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx(B,{slot:"increment",variant:"ghost",className:"!min-h-0 !min-w-0",buttonVisualClassName:S(J({size:t,position:"top"})),"aria-label":i??"Increase value",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-3 w-3","aria-hidden":"true"})}),jsxRuntime.jsx(B,{slot:"decrement",variant:"ghost",className:"!min-h-0 !min-w-0",buttonVisualClassName:S(J({size:t,position:"bottom"})),"aria-label":l??"Decrease value",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-3 w-3","aria-hidden":"true"})})]}),N&&!w&&jsxRuntime.jsx(B,{slot:"increment",variant:"ghost",className:"!min-h-0 !min-w-0",buttonVisualClassName:S(J({size:t,position:"right"})),"aria-label":i??"Increase value",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4","aria-hidden":"true"})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"description",className:S(tt({size:t})),children:e}),jsxRuntime.jsx(reactAriaComponents.FieldError,{className:S(nt({size:t})),children:a})]})});de.displayName="NumberField";var Se=react.forwardRef(function({isOpen:e,onOpenChange:a,groupLabel:t,leftPanel:d,rightPanel:n,leftSize:i,rightSize:l,onSizesChange:r,presets:u,triggerRef:x,direction:f},P){let[R,z]=react.useState({left:i,right:l}),L=react.useRef(false);react.useEffect(()=>{e&&!L.current&&z({left:i,right:l}),L.current=e;},[e,i,l]);let C=react.useCallback(p=>{if(p===null)return;let m=Math.max(d.collapsible?0:d.minSize,Math.min(d.maxSize,p)),v=100-m,N=n.collapsible?0:n.minSize,T=n.maxSize;v<N||v>T||r(m,v);},[d,n,r]),y=react.useCallback(p=>{if(p===null)return;let m=Math.max(n.collapsible?0:n.minSize,Math.min(n.maxSize,p)),v=100-m,N=d.collapsible?0:d.minSize,T=d.maxSize;v<N||v>T||r(v,m);},[d,n,r]),b=react.useCallback(p=>{let m=p.sizes[0],v=p.sizes[1];m!==void 0&&v!==void 0&&r(m,v);},[r]),s=react.useCallback(()=>{r(R.left,R.right),a(false);},[r,a,R]),E=react.useCallback(()=>{a(false);},[a]);return e?jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:e,onOpenChange:a,children:[jsxRuntime.jsx(reactAriaComponents.Button,{className:"sr-only",children:"Open resize controls"}),jsxRuntime.jsx(reactAriaComponents.Popover,{triggerRef:x,placement:f==="horizontal"?"bottom":"right",offset:8,className:S("w-72","rounded-lg border border-[var(--border)]","bg-[var(--content-background)] text-[var(--content-foreground)]","shadow-lg","outline-none","animate-in fade-in-0 zoom-in-95","data-[exiting]:animate-out data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95"),children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:"outline-none",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[jsxRuntime.jsxs("h3",{className:"text-sm font-medium",children:["Resize: ",t]}),jsxRuntime.jsx(reactAriaComponents.Button,{onPress:E,className:S("inline-flex items-center justify-center rounded-md","min-h-[44px] min-w-[44px]","text-[var(--menu-muted)]","hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2"),"aria-label":"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"space-y-4 px-4 py-4",children:[jsxRuntime.jsx("div",{children:jsxRuntime.jsx(de,{label:`${d.name} (%)`,value:Math.round(i),onChange:C,minValue:d.collapsible?0:d.minSize,maxValue:d.maxSize,step:1,stepperLayout:"sides"})}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(de,{label:`${n.name} (%)`,value:Math.round(l),onChange:y,minValue:n.collapsible?0:n.minSize,maxValue:n.maxSize,step:1,stepperLayout:"sides"})}),u&&u.length>0&&jsxRuntime.jsxs("div",{className:"border-t border-[var(--border)] pt-4",children:[jsxRuntime.jsx("div",{className:"mb-2 text-xs font-medium text-[var(--menu-muted)]",children:"Presets"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:u.map((p,m)=>jsxRuntime.jsx(B,{variant:"outline",size:"sm",onPress:()=>b(p),children:p.label},m))})]})]}),jsxRuntime.jsx("div",{className:"flex justify-end border-t border-[var(--border)] px-4 py-3",children:jsxRuntime.jsx(B,{variant:"ghost",size:"sm",onPress:s,children:"Cancel"})})]})})]}):null});Se.displayName="ResizablePopover";var lt=react.forwardRef(function({withHandle:e=true,presets:a,disabled:t=false,className:d},n){let{direction:i,groupLabel:l,sizes:r,setSizes:u,panels:x,announce:f,containerRef:P}=Q(),R=react.useRef(null),z=n||R,[L,C]=react.useState(0);react.useEffect(()=>{let w=z.current,D=P.current;if(!w||!D)return;let G=D.querySelectorAll('[role="slider"]'),K=0;G.forEach((q,Y)=>{q===w&&(K=Y);}),C(K);},[P,z]);let y=L,b=L+1,s=x[y],E=x[b],V=r[y]??50,p=r[b]??50,[m,v]=react.useState(false),N=react.useCallback((w,D)=>{let G=[...r];G[y]=w,G[b]=D,u(G);},[r,u,y,b]),{isDragging:T,handlePointerDown:M,handleKeyDown:O}=Fe({direction:i,sizes:r,setSizes:u,panels:x,containerRef:P,leftPanelIndex:y,rightPanelIndex:b,disabled:t,announce:f,groupLabel:l,onOpenPopover:()=>v(true)}),F=s&&E?`Resize handle between ${s.name} and ${E.name} in ${l}`:`Resize handle in ${l}`,h=i==="horizontal"?lucideReact.GripVertical:lucideReact.GripHorizontal,A=s??{name:"Panel 1",minSize:$,maxSize:j,collapsible:false},I=E??{name:"Panel 2",minSize:$,maxSize:j,collapsible:false};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{ref:z,role:"slider",tabIndex:t?-1:0,"aria-label":F,"aria-valuenow":Math.round(V),"aria-valuemin":s?.collapsible?0:s?.minSize??0,"aria-valuemax":s?.maxSize??100,"aria-orientation":i,"aria-disabled":t,"data-direction":i,"data-dragging":T,"data-disabled":t,onPointerDown:M,onKeyDown:O,className:S(pe({direction:i,disabled:t,isDragging:T}),d),children:e&&jsxRuntime.jsx("div",{className:S(fe({direction:i})),"aria-hidden":"true",children:jsxRuntime.jsx(h,{className:"h-4 w-4"})})}),jsxRuntime.jsx(Se,{isOpen:m,onOpenChange:v,groupLabel:l,leftPanel:A,rightPanel:I,leftSize:V,rightSize:p,onSizesChange:N,presets:a,triggerRef:z,direction:i})]})});lt.displayName="ResizableHandle";exports.DEFAULT_MAX_SIZE=j;exports.DEFAULT_MIN_SIZE=$;exports.LONG_PRESS_THRESHOLD=ae;exports.ResizableHandle=lt;exports.ResizableHandlePropsSchema=xt;exports.ResizablePanel=De;exports.ResizablePanelGroup=Te;exports.ResizablePanelGroupPropsSchema=bt;exports.ResizablePanelPropsSchema=vt;exports.ResizePresetSchema=Ae;exports.resizableGripVariants=fe;exports.resizableHandleVariants=pe;exports.useResizableContext=Q;//# sourceMappingURL=index.js.map
|
|
2
|
+
'use strict';var react=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod'),classVarianceAuthority=require('class-variance-authority'),lucideReact=require('lucide-react'),reactAriaComponents=require('react-aria-components');function z(...o){return tailwindMerge.twMerge(clsx.clsx(o))}var ie=react.createContext(null);ie.displayName="ResizableContext";function K(){let o=react.useContext(ie);if(!o)throw new Error("useResizableContext must be used within a ResizablePanelGroup. Make sure ResizablePanel and ResizableHandle are children of ResizablePanelGroup.");return o}function we({direction:o,groupLabel:e,sizes:a,onSizesChange:t}){let[d,n]=react.useState([]),[i,l]=react.useState([]),r=react.useRef(null),u=react.useRef(null),x=react.useRef(null),f=react.useRef(false),N=a!==void 0,h=N?a:d,S=react.useCallback(b=>{N?t?.(b):n(b);},[N,t]),P=react.useCallback((b,s)=>{l(T=>{let A=[...T];return A[b]=s,A});},[]),L=react.useCallback(b=>{l(s=>{let T=[...s];return delete T[b],T.filter(Boolean)});},[]);react.useEffect(()=>{if(N||f.current)return;let s=i.filter(Boolean).length;if(s<2)return;if(h.length<s||h.some(A=>A===void 0)){let A=[],p=100/s;for(let m=0;m<s;m++)A[m]=p;f.current=true,n(A);}},[i,h,N]),react.useEffect(()=>()=>{x.current&&clearTimeout(x.current),u.current&&(document.body.removeChild(u.current),u.current=null);},[]);let E=react.useCallback(b=>{if(!u.current){let s=document.createElement("div");s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true"),s.className="sr-only",s.style.cssText="position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;",document.body.appendChild(s),u.current=s;}u.current.textContent=b,x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{u.current&&(u.current.textContent="");},1e3);},[]);return {direction:o,groupLabel:e,sizes:h,setSizes:S,panels:i,registerPanel:P,unregisterPanel:L,announce:E,containerRef:r}}var Ve=react.forwardRef(function({direction:e,groupLabel:a,sizes:t,onSizesChange:d,className:n,children:i},l){let r=we({direction:e,groupLabel:a,sizes:t,onSizesChange:d});return react.useImperativeHandle(l,()=>r.containerRef.current,[r.containerRef]),jsxRuntime.jsx(ie.Provider,{value:r,children:jsxRuntime.jsx("div",{ref:r.containerRef,role:"group","aria-label":`${a}, ${e}`,"data-direction":e,className:z("flex h-full w-full",e==="horizontal"?"flex-row":"flex-col",n),children:i})})});Ve.displayName="ResizablePanelGroup";var $=10,Y=90,se=300,De=zod.z.object({label:zod.z.string().min(1),sizes:zod.z.array(zod.z.number().min(0).max(100))}),Rt=zod.z.object({direction:zod.z.enum(["horizontal","vertical"]),groupLabel:zod.z.string().min(1),sizes:zod.z.array(zod.z.number().min(0).max(100)).optional(),onSizesChange:zod.z.function().optional(),className:zod.z.string().optional(),children:zod.z.custom()}),St=zod.z.object({name:zod.z.string().min(1),defaultSize:zod.z.number().min(0).max(100).optional(),minSize:zod.z.number().min(0).max(100).optional().default($),maxSize:zod.z.number().min(0).max(100).optional().default(Y),collapsible:zod.z.boolean().optional().default(false),onCollapse:zod.z.function().optional(),onExpand:zod.z.function().optional(),onResize:zod.z.function().optional(),className:zod.z.string().optional(),children:zod.z.custom()}),ht=zod.z.object({withHandle:zod.z.boolean().optional().default(true),presets:zod.z.array(De).optional(),disabled:zod.z.boolean().optional().default(false),className:zod.z.string().optional()}),ve=classVarianceAuthority.cva(["relative flex items-center justify-center","shrink-0","bg-transparent","transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2","touch-none select-none"],{variants:{direction:{horizontal:["w-3 min-w-[12px]","cursor-col-resize","hover:bg-[var(--accent)]/50","before:absolute before:inset-y-0 before:-inset-x-4","before:min-w-[44px]"],vertical:["h-3 min-h-[12px]","cursor-row-resize","hover:bg-[var(--accent)]/50","before:absolute before:inset-x-0 before:-inset-y-4","before:min-h-[44px]"]},disabled:{true:"cursor-not-allowed opacity-50 pointer-events-none",false:""},isDragging:{true:"bg-[var(--accent)]",false:""}},defaultVariants:{direction:"horizontal",disabled:false,isDragging:false}}),xe=classVarianceAuthority.cva(["flex items-center justify-center","rounded-full","bg-[var(--border)]","text-[var(--menu-muted)]"],{variants:{direction:{horizontal:"h-8 w-1",vertical:"h-1 w-8"}},defaultVariants:{direction:"horizontal"}});var Me=react.forwardRef(function({name:e,defaultSize:a,minSize:t=$,maxSize:d=Y,collapsible:n=false,onCollapse:i,onExpand:l,onResize:r,className:u,children:x},f){let{sizes:N,registerPanel:h,unregisterPanel:S,containerRef:P}=K(),L=react.useRef(null),[E,b]=react.useState(-1),s=react.useRef(null),T=react.useRef(false),A=react.useRef(-1);react.useEffect(()=>{let m=L.current,v=P.current;if(!m||!v)return;let I=v.querySelectorAll("[data-resizable-panel]"),y=-1;for(let D=0;D<I.length;D++)if(I[D]===m){y=D;break}if(y!==-1)return E!==y&&b(y),T.current||(T.current=true,A.current=y,h(y,{name:e,minSize:t,maxSize:d,collapsible:n})),()=>{T.current&&(S(A.current),T.current=false);}},[P,h,S,e,t,d,n,E]);let p=E>=0?N[E]??50:50;return react.useEffect(()=>{if(s.current===null){s.current=p;return}let m=s.current===0,v=p===0;!m&&v&&i?i():m&&!v&&l&&l(),r&&s.current!==p&&r(p),s.current=p;},[p,i,l,r]),jsxRuntime.jsx("div",{ref:m=>{L.current=m,typeof f=="function"?f(m):f&&(f.current=m);},role:"region","aria-label":e,"data-resizable-panel":"","data-panel-name":e,"data-panel-index":E,"data-collapsed":p===0,style:{flexBasis:`${p}%`,flexGrow:0,flexShrink:0,overflow:"hidden"},className:z("relative",u),children:x})});Me.displayName="ResizablePanel";function He(o,e,a){return Math.max(e,Math.min(a,o))}function Fe(o,e,a,t,d){let n=[...o],i=e[a],l=e[t];if(!i||!l)return o;let r=o[a]??50,u=o[t]??50,x=r+d,f=u-d,N=i.collapsible?0:i.minSize,h=i.maxSize,S=l.collapsible?0:l.minSize,P=l.maxSize;return x=He(x,N,h),f=r+u-x,f=He(f,S,P),x=r+u-f,n[a]=x,n[t]=f,n}function Ge({direction:o,sizes:e,setSizes:a,panels:t,containerRef:d,leftPanelIndex:n,rightPanelIndex:i,disabled:l=false,announce:r,groupLabel:u,onOpenPopover:x}){let[f,N]=react.useState(false),h=react.useRef(null),S=react.useRef(null),P=react.useRef(0),L=react.useRef(false),E=react.useRef(t),b=react.useRef(e),s=react.useRef(a),T=react.useRef(()=>{}),A=react.useRef(()=>{});react.useEffect(()=>{E.current=t,b.current=e,s.current=a;},[t,e,a]);let p=react.useCallback(()=>{let g=d.current;return g?o==="horizontal"?g.offsetWidth:g.offsetHeight:0},[d,o]),m=react.useCallback(g=>{let w=p();return w===0?0:g/w*100},[p]),v=react.useCallback(g=>{T.current(g);},[]),I=react.useCallback(()=>{A.current();},[]),y=react.useCallback(g=>{if(!h.current||l)return;let C=(o==="horizontal"?g.clientX:g.clientY)-h.current.position,_=m(C),V=Fe(h.current.sizes,E.current,n,i,_);s.current(V);},[o,l,n,m,i]),D=react.useCallback(()=>{if(S.current&&(clearTimeout(S.current),S.current=null),Date.now()-P.current<se&&!L.current&&x&&!l&&x(),f){N(false);let C=E.current[n],_=Math.round(b.current[n]??50);r&&C&&u&&r(`${C.name} in ${u} resized to ${_} percent`);}h.current=null,L.current=false,document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",I),document.removeEventListener("pointercancel",I),document.body.style.cursor="",document.body.style.userSelect="";},[r,l,u,f,n,x,v,I]);react.useEffect(()=>{T.current=y,A.current=D;});let U=react.useCallback(g=>{if(l)return;g.preventDefault();let w=o==="horizontal"?g.clientX:g.clientY;P.current=Date.now(),L.current=false,h.current={position:w,sizes:[...e],containerSize:p()},S.current=setTimeout(()=>{L.current=true,N(true),document.body.style.cursor=o==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none";},se),document.addEventListener("pointermove",v),document.addEventListener("pointerup",I),document.addEventListener("pointercancel",I),g.pointerType==="mouse"&&(S.current&&(clearTimeout(S.current),S.current=null),L.current=true,N(true),document.body.style.cursor=o==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none");},[o,l,p,v,I,e]),O=react.useCallback(g=>{if(l)return;let w=g.shiftKey?10:1,C=0;switch(g.key){case "ArrowLeft":case "ArrowUp":C=-w;break;case "ArrowRight":case "ArrowDown":C=w;break;case "Home":{let _=t[n];_&&(C=(_.collapsible?0:_.minSize)-(e[n]??50));break}case "End":{let _=t[n];_&&(C=_.maxSize-(e[n]??50));break}case "Enter":case " ":g.preventDefault(),x?.();return;default:return}if(C!==0){g.preventDefault();let _=Fe(e,t,n,i,C);a(_);let V=t[n],F=Math.round(_[n]??50);r&&V&&u&&r(`${V.name} in ${u} resized to ${F} percent`);}},[r,l,u,n,x,t,i,a,e]);return react.useEffect(()=>{let g=v,w=I;return ()=>{S.current&&clearTimeout(S.current),document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",w),document.removeEventListener("pointercancel",w);}},[v,I]),{isDragging:f,handlePointerDown:U,handleKeyDown:O}}var Re=classVarianceAuthority.cva("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",{variants:{fullWidth:{true:"w-full",false:""},inVerticalGroup:{true:"items-stretch",false:"items-center"}},defaultVariants:{fullWidth:false,inVerticalGroup:false}}),Se=classVarianceAuthority.cva("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",{variants:{variant:{default:"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] hover:-translate-y-1",destructive:"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",outline:"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)]",secondary:"bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary-hover,var(--secondary))]",ghost:"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]",link:"text-[var(--text-link)] underline underline-offset-4 hover:bg-[var(--accent)] hover:text-[var(--text-link-hover)]"},fullWidth:{true:"w-full",false:""},visualSize:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-xs",lg:"h-11 rounded-md px-8",icon:"h-10 w-10",dot:"h-5 w-5 rounded-full p-0 min-h-0 min-w-0"},paywall:{true:"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent",false:""}},defaultVariants:{variant:"default",visualSize:"default",paywall:false}});var he="data-[pressed]:scale-[0.97]";var Ee="data-[hovered]:shadow-md";var ue="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",ce="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";var Ye=react.createContext(null);Ye.displayName="ButtonGroupContext";function Ze(){return react.useContext(Ye)}var je=react.createContext(null);je.displayName="ButtonGroupItemContext";function Xe(){return react.useContext(je)}classVarianceAuthority.cva("inline-flex items-center gap-0",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col w-full"}},defaultVariants:{orientation:"horizontal"}});var qe=classVarianceAuthority.cva("",{variants:{orientation:{horizontal:"min-w-[44px]",vertical:"flex min-h-[44px]"},position:{first:"",middle:"",last:"",only:""}},compoundVariants:[{orientation:"horizontal",position:"first",className:"rounded-r-none border-r-0"},{orientation:"horizontal",position:"middle",className:"rounded-none border-r-0"},{orientation:"horizontal",position:"last",className:"rounded-l-none"},{orientation:"vertical",position:"first",className:"rounded-b-none border-b-0"},{orientation:"vertical",position:"middle",className:"rounded-none border-b-0"},{orientation:"vertical",position:"last",className:"rounded-t-none"}],defaultVariants:{orientation:"horizontal",position:"only"}});classVarianceAuthority.cva("bg-[var(--border)]",{variants:{orientation:{horizontal:"w-px h-6 mx-1",vertical:"h-px w-full my-1"}},defaultVariants:{orientation:"horizontal"}});var G=react.memo(react.forwardRef(({className:o,buttonVisualClassName:e,variant:a,size:t,visualSize:d,fullWidth:n,loading:i=false,loadingText:l="Loading...",shortcut:r,children:u,isDisabled:x,paywall:f=false,paywallRedirect:N,paywallDescription:h,onPress:S,...P},L)=>{let E=react.useId(),b=Ze(),s=Xe(),T=a??b?.variant??"default",A=t??b?.size,p=x??b?.isDisabled??false,m=b?.orientation==="vertical",v=n||m,I=s?qe({orientation:b?.orientation??"horizontal",position:s.position}):"",y=d??A??"default";return process.env.NODE_ENV!=="production"&&(y==="dot"||y==="icon")&&!P["aria-label"]&&!u&&console.warn('[Button] visualSize="dot" or "icon" requires aria-label when no visible text is provided (WCAG 1.1.1)'),jsxRuntime.jsx(reactAriaComponents.Button,{ref:L,isDisabled:p||i||void 0,"aria-disabled":f?true:void 0,"aria-describedby":f?E:void 0,onPress:O=>{if(f){N&&window.open(N,"_blank","noopener,noreferrer");return}S?.(O);},className:z(Re({fullWidth:v,inVerticalGroup:m}),o),...P,children:O=>jsxRuntime.jsxs("span",{className:z(Se({variant:T,visualSize:y,paywall:f,fullWidth:v}),I,e,he,Ee,ue,ce),"data-pressed":O.isPressed||void 0,children:[i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"motion-safe:animate-spin","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"sr-only","aria-live":"polite",children:l})]}),!i&&u,f&&jsxRuntime.jsx(lucideReact.Zap,{"data-testid":"zap-icon","aria-hidden":"true",className:"ml-1"}),f&&jsxRuntime.jsxs("span",{id:E,className:"sr-only",children:["Premium feature: ",h||"Upgrade required to access this feature"]}),O.isFocusVisible&&r&&jsxRuntime.jsx("kbd",{className:"ml-auto hidden text-xs opacity-60 lg:inline",children:r})]})})}));G.displayName="Button";var J={sm:"text-xs",default:"text-sm",lg:"text-base"};var de={sm:"h-9",default:"h-10",lg:"h-11"},ee={sm:`${de.sm} px-2 text-xs`,default:`${de.default} px-3 text-sm`,lg:`${de.lg} px-4 text-base`},Ie="min-h-[44px] flex items-center";function We(o,e){return !(o===false||e)}var Ke="(prefers-reduced-motion: reduce)";function Ot(){return typeof window>"u"?false:window.matchMedia(Ke).matches}function Qe(){let[o,e]=react.useState(Ot);return react.useEffect(()=>{let a=window.matchMedia(Ke);e(a.matches);let t=d=>{e(d.matches);};return a.addEventListener("change",t),()=>a.removeEventListener("change",t)},[]),o}var Je=4294967295,et=0,tt=-2147483647;zod.z.object({value:zod.z.number().nullable().optional(),defaultValue:zod.z.number().optional(),minValue:zod.z.number().optional(),maxValue:zod.z.number().optional(),allowNegative:zod.z.boolean().optional(),step:zod.z.number().positive().optional(),formatOptions:zod.z.custom().optional(),isDisabled:zod.z.boolean().optional(),isReadOnly:zod.z.boolean().optional(),isRequired:zod.z.boolean().optional(),isInvalid:zod.z.boolean().optional(),isWheelDisabled:zod.z.boolean().optional(),validate:zod.z.function().optional(),validationBehavior:zod.z.enum(["native","aria"]).default("native"),label:zod.z.string(),description:zod.z.string().optional(),errorMessage:zod.z.union([zod.z.string(),zod.z.function()]).optional(),stepperLayout:zod.z.enum(["sides","stacked","hidden"]).default("sides"),incrementAriaLabel:zod.z.string().optional(),decrementAriaLabel:zod.z.string().optional(),name:zod.z.string().optional(),size:zod.z.enum(["sm","default","lg"]).default("default"),onChange:zod.z.function().optional(),onFocus:zod.z.function().optional(),onBlur:zod.z.function().optional(),onFocusChange:zod.z.function().optional(),animated:zod.z.boolean().optional().default(true),springConfig:zod.z.object({stiffness:zod.z.number(),damping:zod.z.number()}).optional(),className:zod.z.string().optional(),autoFocus:zod.z.boolean().optional()});var nt=classVarianceAuthority.cva(["inline-flex items-center rounded-md border","bg-[var(--content-background)] text-[var(--content-foreground)]","transition-colors duration-200","focus-within:ring-2 focus-within:ring-[var(--ring)] focus-within:ring-offset-2","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50"],{variants:{size:{sm:`${ee.sm}`,default:`${ee.default}`,lg:`${ee.lg}`},isInvalid:{true:"border-[var(--destructive-background)] focus-within:ring-[var(--destructive-background)]",false:"border-[var(--input-border)] hover:border-[var(--input-border)]/80"}},defaultVariants:{size:"default",isInvalid:false}}),rt=classVarianceAuthority.cva(["flex-1 bg-transparent text-center tabular-nums","min-w-0","focus:outline-none","[appearance:textfield]","[&::-webkit-outer-spin-button]:appearance-none","[&::-webkit-inner-spin-button]:appearance-none"],{variants:{size:{sm:`px-2 ${J.sm}`,default:`px-3 ${J.default}`,lg:`px-4 ${J.lg}`}},defaultVariants:{size:"default"}}),te=classVarianceAuthority.cva(["flex items-center justify-center","transition-colors duration-150","select-none","hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]","focus-visible:ring-inset","active:bg-[var(--accent)]/80","disabled:pointer-events-none disabled:opacity-50"],{variants:{size:{sm:"min-w-8 min-h-8 text-sm",default:"min-w-10 min-h-10 text-base",lg:"min-w-12 min-h-12 text-lg"},position:{left:"rounded-l-md border-r border-[var(--input-border)]",right:"rounded-r-md border-l border-[var(--input-border)]",top:"rounded-tr-md border-b border-l border-[var(--input-border)] h-1/2",bottom:"rounded-br-md border-l border-[var(--input-border)] h-1/2"}},defaultVariants:{size:"default"}}),ot=classVarianceAuthority.cva(["block font-medium text-[var(--content-foreground)]","mb-1.5",'data-[required]:after:content-["*"] data-[required]:after:ml-0.5',"data-[required]:after:text-[var(--destructive-background)]"],{variants:{size:{sm:"text-sm",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),at=classVarianceAuthority.cva(["text-[var(--menu-muted)]","mt-1"],{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),it=classVarianceAuthority.cva(["flex items-center gap-1","text-[var(--destructive-background)]","mt-1"],{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}});var ne;function $t(){return ne!==void 0?Promise.resolve(ne):import('motion').then(o=>(ne=o.animate,ne)).catch(()=>(ne=null,null))}function Yt(o,e){if(e)try{let a={...e};return a.style==="currency"&&!a.currencyDisplay&&(a.currencyDisplay="narrowSymbol"),new Intl.NumberFormat(void 0,a).format(o)}catch{return String(Math.round(o))}return String(Math.round(o))}var fe=react.forwardRef(({label:o,description:e,errorMessage:a,size:t="default",stepperLayout:d="sides",allowNegative:n=false,incrementAriaLabel:i,decrementAriaLabel:l,animated:r,springConfig:u,onChange:x,value:f,defaultValue:N,formatOptions:h,minValue:S,maxValue:P,className:L,isInvalid:E,isRequired:b,isDisabled:s,isReadOnly:T,...A},p)=>{let m=S??(n?tt:et),v=P??Je,I=d!=="hidden"&&!T,y=Qe(),D=We(r,y)&&I,U=react.useRef(null),O=react.useRef(f??N??0),g=react.useRef(void 0),w=react.useRef(null);react.useEffect(()=>{D&&$t().then(V=>{g.current=V??null;});},[D]),react.useEffect(()=>()=>{w.current?.stop();},[]);let C=V=>{let F=O.current;if(D&&g.current&&U.current&&F!==V){w.current?.stop();let W=V,Z=U.current,j=Z.parentElement?.querySelector("input");Z.style.display="",j&&(j.style.color="transparent"),w.current=g.current(F,W,{type:"spring",stiffness:u?.stiffness??500,damping:u?.damping??30,onUpdate:Ae=>{O.current=Ae,Z.textContent=Yt(Ae,h);},onComplete:()=>{Z.style.display="none",j&&(j.style.color=""),w.current=null,O.current=W;}});}else O.current=V;x?.(V);},_=d==="stacked";return jsxRuntime.jsxs(reactAriaComponents.NumberField,{ref:p,className:z("group flex flex-col",L),minValue:m,maxValue:v,isInvalid:E,isRequired:b,isDisabled:s,isReadOnly:T,value:f,defaultValue:N,formatOptions:h,onChange:C,...A,children:[jsxRuntime.jsx(reactAriaComponents.Label,{className:z(ot({size:t})),"data-required":b||void 0,children:o}),jsxRuntime.jsxs(reactAriaComponents.Group,{className:z(Ie,nt({size:t,isInvalid:E??false}),_&&"pr-0"),children:[I&&!_&&jsxRuntime.jsx(G,{slot:"decrement",variant:"ghost",className:"!min-h-0 !min-w-0",buttonVisualClassName:z(te({size:t,position:"left"})),"aria-label":l??"Decrease value",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-4 w-4","aria-hidden":"true"})}),jsxRuntime.jsxs("div",{className:"relative flex flex-1",children:[jsxRuntime.jsx(reactAriaComponents.Input,{className:z(rt({size:t}),"w-full")}),D&&jsxRuntime.jsx("span",{ref:U,className:z("absolute inset-0 flex items-center justify-center","pointer-events-none bg-[var(--content-background)] tabular-nums",t==="sm"&&"px-2 text-sm",t==="default"&&"px-3 text-base",t==="lg"&&"px-4 text-lg"),style:{display:"none"},"aria-hidden":"true"})]}),I&&_&&jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx(G,{slot:"increment",variant:"ghost",className:"!min-h-0 !min-w-0",buttonVisualClassName:z(te({size:t,position:"top"})),"aria-label":i??"Increase value",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-3 w-3","aria-hidden":"true"})}),jsxRuntime.jsx(G,{slot:"decrement",variant:"ghost",className:"!min-h-0 !min-w-0",buttonVisualClassName:z(te({size:t,position:"bottom"})),"aria-label":l??"Decrease value",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-3 w-3","aria-hidden":"true"})})]}),I&&!_&&jsxRuntime.jsx(G,{slot:"increment",variant:"ghost",className:"!min-h-0 !min-w-0",buttonVisualClassName:z(te({size:t,position:"right"})),"aria-label":i??"Increase value",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4","aria-hidden":"true"})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"description",className:z(at({size:t})),children:e}),jsxRuntime.jsx(reactAriaComponents.FieldError,{className:z(it({size:t})),children:a})]})});fe.displayName="NumberField";var _e=react.forwardRef(function({isOpen:e,onOpenChange:a,groupLabel:t,leftPanel:d,rightPanel:n,leftSize:i,rightSize:l,onSizesChange:r,presets:u,triggerRef:x,direction:f},N){let[h,S]=react.useState({left:i,right:l}),P=react.useRef(false);react.useEffect(()=>{e&&!P.current&&S({left:i,right:l}),P.current=e;},[e,i,l]);let L=react.useCallback(p=>{if(p===null)return;let m=Math.max(d.collapsible?0:d.minSize,Math.min(d.maxSize,p)),v=100-m,I=n.collapsible?0:n.minSize,y=n.maxSize;v<I||v>y||r(m,v);},[d,n,r]),E=react.useCallback(p=>{if(p===null)return;let m=Math.max(n.collapsible?0:n.minSize,Math.min(n.maxSize,p)),v=100-m,I=d.collapsible?0:d.minSize,y=d.maxSize;v<I||v>y||r(v,m);},[d,n,r]),b=react.useCallback(p=>{let m=p.sizes[0],v=p.sizes[1];m!==void 0&&v!==void 0&&r(m,v);},[r]),s=react.useCallback(()=>{r(h.left,h.right),a(false);},[r,a,h]),T=react.useCallback(()=>{a(false);},[a]);return e?jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:e,onOpenChange:a,children:[jsxRuntime.jsx(reactAriaComponents.Button,{className:"sr-only",children:"Open resize controls"}),jsxRuntime.jsx(reactAriaComponents.Popover,{triggerRef:x,placement:f==="horizontal"?"bottom":"right",offset:8,className:z("w-72","rounded-lg border border-[var(--border)]","bg-[var(--content-background)] text-[var(--content-foreground)]","shadow-lg","outline-none","motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95","data-[exiting]:motion-safe:animate-out data-[exiting]:motion-safe:fade-out-0 data-[exiting]:motion-safe:zoom-out-95"),children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:"outline-none",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[jsxRuntime.jsxs("h3",{className:"text-sm font-medium",children:["Resize: ",t]}),jsxRuntime.jsx(reactAriaComponents.Button,{onPress:T,className:z("inline-flex items-center justify-center rounded-md","min-h-[44px] min-w-[44px]","text-[var(--menu-muted)]","hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2"),"aria-label":"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"space-y-4 px-4 py-4",children:[jsxRuntime.jsx("div",{children:jsxRuntime.jsx(fe,{label:`${d.name} (%)`,value:Math.round(i),onChange:L,minValue:d.collapsible?0:d.minSize,maxValue:d.maxSize,step:1,stepperLayout:"sides"})}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(fe,{label:`${n.name} (%)`,value:Math.round(l),onChange:E,minValue:n.collapsible?0:n.minSize,maxValue:n.maxSize,step:1,stepperLayout:"sides"})}),u&&u.length>0&&jsxRuntime.jsxs("div",{className:"border-t border-[var(--border)] pt-4",children:[jsxRuntime.jsx("div",{className:"mb-2 text-xs font-medium text-[var(--menu-muted)]",children:"Presets"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:u.map((p,m)=>jsxRuntime.jsx(G,{variant:"outline",size:"sm",onPress:()=>b(p),children:p.label},m))})]})]}),jsxRuntime.jsx("div",{className:"flex justify-end border-t border-[var(--border)] px-4 py-3",children:jsxRuntime.jsx(G,{variant:"ghost",size:"sm",onPress:s,children:"Cancel"})})]})})]}):null});_e.displayName="ResizablePopover";var mt=react.forwardRef(function({withHandle:e=true,presets:a,disabled:t=false,className:d},n){let{direction:i,groupLabel:l,sizes:r,setSizes:u,panels:x,announce:f,containerRef:N}=K(),h=react.useRef(null),S=n||h,[P,L]=react.useState(0);react.useEffect(()=>{let _=S.current,V=N.current;if(!_||!V)return;let F=V.querySelectorAll('[role="slider"]'),W=0;F.forEach((Z,j)=>{Z===_&&(W=j);}),L(W);},[N,S]);let E=P,b=P+1,s=x[E],T=x[b],A=r[E]??50,p=r[b]??50,[m,v]=react.useState(false),I=react.useCallback((_,V)=>{let F=[...r];F[E]=_,F[b]=V,u(F);},[r,u,E,b]),{isDragging:y,handlePointerDown:D,handleKeyDown:U}=Ge({direction:i,sizes:r,setSizes:u,panels:x,containerRef:N,leftPanelIndex:E,rightPanelIndex:b,disabled:t,announce:f,groupLabel:l,onOpenPopover:()=>v(true)}),O=s&&T?`Resize handle between ${s.name} and ${T.name} in ${l}`:`Resize handle in ${l}`,g=i==="horizontal"?lucideReact.GripVertical:lucideReact.GripHorizontal,w=s??{name:"Panel 1",minSize:$,maxSize:Y,collapsible:false},C=T??{name:"Panel 2",minSize:$,maxSize:Y,collapsible:false};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{ref:S,role:"slider",tabIndex:t?-1:0,"aria-label":O,"aria-valuenow":Math.round(A),"aria-valuemin":s?.collapsible?0:s?.minSize??0,"aria-valuemax":s?.maxSize??100,"aria-orientation":i,"aria-disabled":t,"data-direction":i,"data-dragging":y,"data-disabled":t,onPointerDown:D,onKeyDown:U,className:z(ve({direction:i,disabled:t,isDragging:y}),d),children:e&&jsxRuntime.jsx("div",{className:z(xe({direction:i})),"aria-hidden":"true",children:jsxRuntime.jsx(g,{className:"h-4 w-4"})})}),jsxRuntime.jsx(_e,{isOpen:m,onOpenChange:v,groupLabel:l,leftPanel:w,rightPanel:C,leftSize:A,rightSize:p,onSizesChange:I,presets:a,triggerRef:S,direction:i})]})});mt.displayName="ResizableHandle";exports.DEFAULT_MAX_SIZE=Y;exports.DEFAULT_MIN_SIZE=$;exports.LONG_PRESS_THRESHOLD=se;exports.ResizableHandle=mt;exports.ResizableHandlePropsSchema=ht;exports.ResizablePanel=Me;exports.ResizablePanelGroup=Ve;exports.ResizablePanelGroupPropsSchema=Rt;exports.ResizablePanelPropsSchema=St;exports.ResizePresetSchema=De;exports.resizableGripVariants=xe;exports.resizableHandleVariants=ve;exports.useResizableContext=K;//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|