@karakuri-ui/react 0.3.3 → 0.3.4
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/README.md +27 -4
- package/dist/components/ui/accordion.js +27 -24
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/accordion.mjs +27 -24
- package/dist/components/ui/accordion.mjs.map +1 -1
- package/dist/components/ui/alert.js +45 -27
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/alert.mjs +45 -27
- package/dist/components/ui/alert.mjs.map +1 -1
- package/dist/components/ui/avatar.js +41 -32
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/avatar.mjs +41 -32
- package/dist/components/ui/avatar.mjs.map +1 -1
- package/dist/components/ui/badge.js +46 -43
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/badge.mjs +46 -43
- package/dist/components/ui/badge.mjs.map +1 -1
- package/dist/components/ui/breadcrumb.js +30 -25
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/breadcrumb.mjs +30 -25
- package/dist/components/ui/breadcrumb.mjs.map +1 -1
- package/dist/components/ui/button-group.js +6 -5
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button-group.mjs +6 -5
- package/dist/components/ui/button-group.mjs.map +1 -1
- package/dist/components/ui/button.js +24 -14
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/button.mjs +24 -14
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/card.js +53 -39
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/card.mjs +53 -39
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/chart.d.mts +1 -1
- package/dist/components/ui/chart.d.ts +1 -1
- package/dist/components/ui/chart.js +154 -130
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/chart.mjs +154 -130
- package/dist/components/ui/chart.mjs.map +1 -1
- package/dist/components/ui/checkbox.js +47 -40
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/checkbox.mjs +47 -40
- package/dist/components/ui/checkbox.mjs.map +1 -1
- package/dist/components/ui/divider.js +16 -13
- package/dist/components/ui/divider.js.map +1 -1
- package/dist/components/ui/divider.mjs +16 -13
- package/dist/components/ui/divider.mjs.map +1 -1
- package/dist/components/ui/drawer.js +44 -35
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/drawer.mjs +44 -35
- package/dist/components/ui/drawer.mjs.map +1 -1
- package/dist/components/ui/dropdown.js +31 -24
- package/dist/components/ui/dropdown.js.map +1 -1
- package/dist/components/ui/dropdown.mjs +31 -24
- package/dist/components/ui/dropdown.mjs.map +1 -1
- package/dist/components/ui/field.js +18 -15
- package/dist/components/ui/field.js.map +1 -1
- package/dist/components/ui/field.mjs +18 -15
- package/dist/components/ui/field.mjs.map +1 -1
- package/dist/components/ui/icon-button.js +17 -14
- package/dist/components/ui/icon-button.js.map +1 -1
- package/dist/components/ui/icon-button.mjs +17 -14
- package/dist/components/ui/icon-button.mjs.map +1 -1
- package/dist/components/ui/input.js +34 -29
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/input.mjs +34 -29
- package/dist/components/ui/input.mjs.map +1 -1
- package/dist/components/ui/metric-card.js +24 -21
- package/dist/components/ui/metric-card.js.map +1 -1
- package/dist/components/ui/metric-card.mjs +24 -21
- package/dist/components/ui/metric-card.mjs.map +1 -1
- package/dist/components/ui/modal.js +91 -74
- package/dist/components/ui/modal.js.map +1 -1
- package/dist/components/ui/modal.mjs +91 -74
- package/dist/components/ui/modal.mjs.map +1 -1
- package/dist/components/ui/navigation-menu.js +114 -93
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/navigation-menu.mjs +114 -93
- package/dist/components/ui/navigation-menu.mjs.map +1 -1
- package/dist/components/ui/pagination.js +66 -55
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/pagination.mjs +66 -55
- package/dist/components/ui/pagination.mjs.map +1 -1
- package/dist/components/ui/popover.js +39 -36
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/popover.mjs +39 -36
- package/dist/components/ui/popover.mjs.map +1 -1
- package/dist/components/ui/progress.js +73 -64
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/progress.mjs +73 -64
- package/dist/components/ui/progress.mjs.map +1 -1
- package/dist/components/ui/radio-group.js +23 -19
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/radio-group.mjs +23 -19
- package/dist/components/ui/radio-group.mjs.map +1 -1
- package/dist/components/ui/segmented.js +7 -6
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/segmented.mjs +7 -6
- package/dist/components/ui/segmented.mjs.map +1 -1
- package/dist/components/ui/select.js +55 -48
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/select.mjs +55 -48
- package/dist/components/ui/select.mjs.map +1 -1
- package/dist/components/ui/skeleton.js +20 -19
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/skeleton.mjs +20 -19
- package/dist/components/ui/skeleton.mjs.map +1 -1
- package/dist/components/ui/slider.js +68 -58
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/slider.mjs +68 -58
- package/dist/components/ui/slider.mjs.map +1 -1
- package/dist/components/ui/spinner.js +185 -176
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/spinner.mjs +185 -176
- package/dist/components/ui/spinner.mjs.map +1 -1
- package/dist/components/ui/switch.js +39 -28
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/switch.mjs +39 -28
- package/dist/components/ui/switch.mjs.map +1 -1
- package/dist/components/ui/table.js +26 -23
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/table.mjs +26 -23
- package/dist/components/ui/table.mjs.map +1 -1
- package/dist/components/ui/tabs.js +25 -9
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/tabs.mjs +25 -9
- package/dist/components/ui/tabs.mjs.map +1 -1
- package/dist/components/ui/textarea.js +2 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/textarea.mjs +2 -1
- package/dist/components/ui/textarea.mjs.map +1 -1
- package/dist/components/ui/toast.js +104 -80
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/components/ui/toast.mjs +104 -80
- package/dist/components/ui/toast.mjs.map +1 -1
- package/dist/components/ui/toggle-group.js +9 -8
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle-group.mjs +9 -8
- package/dist/components/ui/toggle-group.mjs.map +1 -1
- package/dist/components/ui/toggle.js +3 -2
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/toggle.mjs +3 -2
- package/dist/components/ui/toggle.mjs.map +1 -1
- package/dist/components/ui/tooltip.js +18 -15
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/tooltip.mjs +18 -15
- package/dist/components/ui/tooltip.mjs.map +1 -1
- package/package.json +27 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/slider.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as SliderPrimitive from '@radix-ui/react-slider'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\n\n// Slider root variants\nconst sliderVariants = cva(\n 'relative flex touch-none select-none',\n {\n variants: {\n size: {\n sm: '',\n default: '',\n lg: '',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\n// Track sizes per orientation\nconst trackSizes = {\n sm: 'h-1 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1',\n default: 'h-1.5 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1.5',\n lg: 'h-2 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-2',\n}\n\n// Thumb sizes\nconst thumbSizes = {\n sm: 'w-[var(--component-slider-thumb-sm)] h-[var(--component-slider-thumb-sm)]',\n default: 'w-[var(--component-slider-thumb-default)] h-[var(--component-slider-thumb-default)]',\n lg: 'w-[var(--component-slider-thumb-lg)] h-[var(--component-slider-thumb-lg)]',\n}\n\n// Content font sizes (for startContent / endContent)\nconst contentSizes = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n}\n\n// Color maps for range and thumb\nconst sliderColorMap = {\n default: {\n range: 'bg-foreground',\n thumb: 'bg-background border-foreground',\n thumbHover: 'hover:shadow-[0_0_0_4px_color-mix(in_srgb,var(--color-text)_16%,transparent)] hover:border-foreground',\n thumbActive: 'active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-text)_16%,transparent)]',\n },\n primary: {\n range: 'bg-primary',\n thumb: 'bg-primary-foreground border-primary',\n thumbHover: 'hover:shadow-primary-glow hover:border-primary-hover',\n thumbActive: 'active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-primary)_16%,transparent)]',\n },\n} as const\n\nexport type SliderColor = keyof typeof sliderColorMap\n\nexport interface SliderProps\n extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n VariantProps<typeof sliderVariants> {\n /** Track and thumb color */\n color?: SliderColor\n /** Tooltip display mode: auto (hover/drag), always, never */\n showTooltip?: 'auto' | 'always' | 'never'\n /** Custom formatter for tooltip value */\n formatLabel?: (value: number) => string\n /** Content to display before the slider (icon, label, etc.) */\n startContent?: React.ReactNode\n /** Content to display after the slider */\n endContent?: React.ReactNode\n}\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size, color = 'default', value, defaultValue, onValueChange, showTooltip = 'never', formatLabel, startContent, endContent, orientation, ...props }, ref) => {\n const resolvedSize = size || 'default'\n const thumbCount = value?.length ?? defaultValue?.length ?? 1\n const hasTooltip = showTooltip !== 'never'\n const hasWrapper = !!(startContent || endContent)\n const isVertical = orientation === 'vertical'\n\n // Track value internally for tooltip display\n const [internalValue, setInternalValue] = React.useState(\n () => value ?? defaultValue ?? Array(thumbCount).fill(props.min ?? 0)\n )\n const displayValues = value ?? internalValue\n\n const handleValueChange = React.useCallback((newValue: number[]) => {\n setInternalValue(newValue)\n onValueChange?.(newValue)\n }, [onValueChange])\n\n const sliderRoot = (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n sliderVariants({ size }),\n isVertical\n ? 'h-full w-auto flex-col items-center'\n : 'w-full items-center',\n hasWrapper && (isVertical ? 'flex-1 min-h-0' : 'flex-1 min-w-0'),\n !hasWrapper && className\n )}\n value={value}\n defaultValue={defaultValue}\n onValueChange={hasTooltip ? handleValueChange : onValueChange}\n orientation={orientation}\n {...props}\n >\n <SliderPrimitive.Track\n className={cn(\n 'relative grow overflow-hidden rounded-full bg-border',\n isVertical ? 'h-full' : 'w-full',\n trackSizes[resolvedSize]\n )}\n >\n <SliderPrimitive.Range\n className={cn(\n 'absolute rounded-full', sliderColorMap[color].range,\n isVertical\n ? 'w-full transition-[top,bottom] duration-fast ease-out'\n : 'h-full transition-[left,right] duration-fast ease-out'\n )}\n />\n </SliderPrimitive.Track>\n {Array.from({ length: thumbCount }).map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n className={cn(\n 'group/thumb block rounded-full border-2 shadow-sm', sliderColorMap[color].thumb,\n isVertical\n ? 'transition-[top,box-shadow,border-color] duration-fast ease-out'\n : 'transition-[left,box-shadow,border-color] duration-fast ease-out',\n sliderColorMap[color].thumbHover,\n sliderColorMap[color].thumbActive,\n 'focus-visible:focus-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n thumbSizes[resolvedSize]\n )}\n >\n {hasTooltip && (\n <div\n className={cn(\n 'absolute pointer-events-none',\n 'transition-all duration-fast ease-out',\n isVertical\n ? 'right-full top-1/2 -translate-y-1/2 mr-2 origin-right'\n : 'bottom-full left-1/2 -translate-x-1/2 mb-2 origin-bottom',\n showTooltip === 'always'\n ? 'opacity-100 scale-100'\n : [\n 'opacity-0 scale-95',\n 'group-hover/thumb:opacity-100 group-hover/thumb:scale-100',\n 'group-active/thumb:opacity-100 group-active/thumb:scale-100',\n 'group-focus-visible/thumb:opacity-100 group-focus-visible/thumb:scale-100',\n ]\n )}\n >\n <div className=\"relative bg-foreground text-background text-xs font-semibold font-mono tabular-nums px-2.5 py-1 rounded-md shadow-lg whitespace-nowrap\">\n {formatLabel ? formatLabel(displayValues[i]) : displayValues[i]}\n {/* Arrow */}\n {isVertical ? (\n <div className=\"absolute left-full top-1/2 -translate-y-1/2 border-4 border-transparent border-l-foreground\" />\n ) : (\n <div className=\"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-foreground\" />\n )}\n </div>\n </div>\n )}\n </SliderPrimitive.Thumb>\n ))}\n </SliderPrimitive.Root>\n )\n\n if (!hasWrapper) return sliderRoot\n\n return (\n <div className={cn(\n isVertical ? 'inline-flex flex-col items-center gap-2 h-full' : 'flex items-center gap-3',\n className\n )}>\n {startContent && (\n <span className={cn('shrink-0 text-text-muted select-none', contentSizes[resolvedSize], props.disabled && 'opacity-50')}>\n {startContent}\n </span>\n )}\n {sliderRoot}\n {endContent && (\n <span className={cn('shrink-0 text-text-muted select-none', contentSizes[resolvedSize], props.disabled && 'opacity-50')}>\n {endContent}\n </span>\n )}\n </div>\n )\n})\nSlider.displayName = 'Slider'\n\nexport { Slider, sliderVariants }\n"],"mappings":";AAEA,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,WAA8B;AACvC,SAAS,UAAU;AAGnB,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAGA,MAAM,aAAa;AAAA,EACjB,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,IAAI;AACN;AAGA,MAAM,aAAa;AAAA,EACjB,IAAI;AAAA,EACJ,SAAS;AAAA,E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C,oCAAC,UAAK,WAAW,GAAG,wCAAwC,aAAa,YAAY,GAAG,MAAM,YAAY,YAAY,KACnH,UACH,CAEJ;AAEJ,CAAC;AACD,OAAO,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/slider.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as SliderPrimitive from '@radix-ui/react-slider'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\n\n// Slider root variants\nconst sliderVariants = cva(\n 'relative flex touch-none select-none',\n {\n variants: {\n size: {\n sm: '',\n default: '',\n lg: '',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\n// Track sizes per orientation\nconst trackSizes = {\n sm: 'h-1 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1',\n default: 'h-1.5 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1.5',\n lg: 'h-2 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-2',\n}\n\n// Thumb sizes\nconst thumbSizes = {\n sm: 'w-[var(--component-slider-thumb-sm)] h-[var(--component-slider-thumb-sm)]',\n default: 'w-[var(--component-slider-thumb-default)] h-[var(--component-slider-thumb-default)]',\n lg: 'w-[var(--component-slider-thumb-lg)] h-[var(--component-slider-thumb-lg)]',\n}\n\n// Content font sizes (for startContent / endContent)\nconst contentSizes = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n}\n\n// Color maps for range and thumb\nconst sliderColorMap = {\n default: {\n range: 'bg-foreground',\n thumb: 'bg-background border-foreground',\n thumbHover: 'hover:shadow-[0_0_0_4px_color-mix(in_srgb,var(--color-text)_16%,transparent)] hover:border-foreground',\n thumbActive: 'active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-text)_16%,transparent)]',\n },\n primary: {\n range: 'bg-primary',\n thumb: 'bg-primary-foreground border-primary',\n thumbHover: 'hover:shadow-primary-glow hover:border-primary-hover',\n thumbActive: 'active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-primary)_16%,transparent)]',\n },\n} as const\n\nexport type SliderColor = keyof typeof sliderColorMap\n\nexport interface SliderProps\n extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n VariantProps<typeof sliderVariants> {\n /** Track and thumb color */\n color?: SliderColor\n /** Tooltip display mode: auto (hover/drag), always, never */\n showTooltip?: 'auto' | 'always' | 'never'\n /** Custom formatter for tooltip value */\n formatLabel?: (value: number) => string\n /** Content to display before the slider (icon, label, etc.) */\n startContent?: React.ReactNode\n /** Content to display after the slider */\n endContent?: React.ReactNode\n}\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size, color = 'default', value, defaultValue, onValueChange, showTooltip = 'never', formatLabel, startContent, endContent, orientation, ...props }, ref) => {\n const resolvedSize = size || 'default'\n const thumbCount = value?.length ?? defaultValue?.length ?? 1\n const hasTooltip = showTooltip !== 'never'\n const hasWrapper = !!(startContent || endContent)\n const isVertical = orientation === 'vertical'\n\n // Track value internally for tooltip display\n const [internalValue, setInternalValue] = React.useState(\n () => value ?? defaultValue ?? Array(thumbCount).fill(props.min ?? 0)\n )\n const displayValues = value ?? internalValue\n\n const handleValueChange = React.useCallback((newValue: number[]) => {\n setInternalValue(newValue)\n onValueChange?.(newValue)\n }, [onValueChange])\n\n const sliderRoot = (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n sliderVariants({ size }),\n isVertical\n ? 'h-full w-auto flex-col items-center'\n : 'w-full items-center',\n hasWrapper && (isVertical ? 'flex-1 min-h-0' : 'flex-1 min-w-0'),\n !hasWrapper && className\n )}\n value={value}\n defaultValue={defaultValue}\n onValueChange={hasTooltip ? handleValueChange : onValueChange}\n orientation={orientation}\n {...props}\n >\n <SliderPrimitive.Track\n className={cn(\n 'relative grow overflow-hidden rounded-full bg-border',\n isVertical ? 'h-full' : 'w-full',\n trackSizes[resolvedSize]\n )}\n >\n <SliderPrimitive.Range\n className={cn(\n 'absolute rounded-full', sliderColorMap[color].range,\n isVertical\n ? 'w-full transition-[top,bottom] duration-fast ease-out'\n : 'h-full transition-[left,right] duration-fast ease-out'\n )}\n />\n </SliderPrimitive.Track>\n {Array.from({ length: thumbCount }).map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n className={cn(\n 'group/thumb block rounded-full border-2 shadow-sm', sliderColorMap[color].thumb,\n isVertical\n ? 'transition-[top,box-shadow,border-color] duration-fast ease-out'\n : 'transition-[left,box-shadow,border-color] duration-fast ease-out',\n sliderColorMap[color].thumbHover,\n sliderColorMap[color].thumbActive,\n 'focus-visible:focus-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n thumbSizes[resolvedSize]\n )}\n >\n {hasTooltip && (\n <div\n className={cn(\n 'absolute pointer-events-none',\n 'transition-all duration-fast ease-out',\n isVertical\n ? 'right-full top-1/2 -translate-y-1/2 mr-2 origin-right'\n : 'bottom-full left-1/2 -translate-x-1/2 mb-2 origin-bottom',\n showTooltip === 'always'\n ? 'opacity-100 scale-100'\n : [\n 'opacity-0 scale-95',\n 'group-hover/thumb:opacity-100 group-hover/thumb:scale-100',\n 'group-active/thumb:opacity-100 group-active/thumb:scale-100',\n 'group-focus-visible/thumb:opacity-100 group-focus-visible/thumb:scale-100',\n ]\n )}\n >\n <div className=\"relative bg-foreground text-background text-xs font-semibold font-mono tabular-nums px-2.5 py-1 rounded-md shadow-lg whitespace-nowrap\">\n {formatLabel ? formatLabel(displayValues[i]) : displayValues[i]}\n {/* Arrow */}\n {isVertical ? (\n <div className=\"absolute left-full top-1/2 -translate-y-1/2 border-4 border-transparent border-l-foreground\" />\n ) : (\n <div className=\"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-foreground\" />\n )}\n </div>\n </div>\n )}\n </SliderPrimitive.Thumb>\n ))}\n </SliderPrimitive.Root>\n )\n\n if (!hasWrapper) return sliderRoot\n\n return (\n <div className={cn(\n isVertical ? 'inline-flex flex-col items-center gap-2 h-full' : 'flex items-center gap-3',\n className\n )}>\n {startContent && (\n <span className={cn('shrink-0 text-text-muted select-none', contentSizes[resolvedSize], props.disabled && 'opacity-50')}>\n {startContent}\n </span>\n )}\n {sliderRoot}\n {endContent && (\n <span className={cn('shrink-0 text-text-muted select-none', contentSizes[resolvedSize], props.disabled && 'opacity-50')}>\n {endContent}\n </span>\n )}\n </div>\n )\n})\nSlider.displayName = 'Slider'\n\nexport { Slider, sliderVariants }\n"],"mappings":";AA2HQ,cA0CM,YA1CN;AAzHR,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,WAA8B;AACvC,SAAS,UAAU;AAGnB,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAGA,MAAM,aAAa;AAAA,EACjB,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,IAAI;AACN;AAGA,MAAM,aAAa;AAAA,EACjB,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,IAAI;AACN;AAGA,MAAM,eAAe;AAAA,EACnB,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,IAAI;AACN;AAGA,MAAM,iBAAiB;AAAA,EACrB,SAAS;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,aAAa;AAAA,EACf;AACF;AAmBA,MAAM,SAAS,MAAM,WAGnB,CAAC,EAAE,WAAW,MAAM,QAAQ,WAAW,OAAO,cAAc,eAAe,cAAc,SAAS,aAAa,cAAc,YAAY,aAAa,GAAG,MAAM,GAAG,QAAQ;AAC1K,QAAM,eAAe,QAAQ;AAC7B,QA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Ae,KAAK,EAAE;AAAA,cACtB,eAAe,KAAK,EAAE;AAAA,cACtB;AAAA,cACA;AAAA,cACA,WAAW,YAAY;AAAA,YACzB;AAAA,YAEC,wBACC;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW;AAAA,kBACT;AAAA,kBACA;AAAA,kBACA,aACI,0DACA;AAAA,kBACJ,gBAAgB,WACZ,0BACA;AAAA,oBACE;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,kBACF;AAAA,gBACN;AAAA,gBAEA,+BAAC,SAAI,WAAU,0IACZ;AAAA,gCAAc,YAAY,cAAc,CAAC,CAAC,IAAI,cAAc,CAAC;AAAA,kBAE7D,aACC,oBAAC,SAAI,WAAU,+FAA8F,IAE7G,oBAAC,SAAI,WAAU,+FAA8F;AAAA,mBAEjH;AAAA;AAAA,YACF;AAAA;AAAA,UAxCG;AAAA,QA0CP,CACD;AAAA;AAAA;AAAA,EACH;AAGF,MAAI,CAAC,WAAY,QAAO;AAExB,SACE,qBAAC,SAAI,WAAW;AAAA,IACd,aAAa,mDAAmD;AAAA,IAChE;AAAA,EACF,GACG;AAAA,oBACC,oBAAC,UAAK,WAAW,GAAG,wCAAwC,aAAa,YAAY,GAAG,MAAM,YAAY,YAAY,GACnH,wBACH;AAAA,IAED;AAAA,IACA,cACC,oBAAC,UAAK,WAAW,GAAG,wCAAwC,aAAa,YAAY,GAAG,MAAM,YAAY,YAAY,GACnH,sBACH;AAAA,KAEJ;AAEJ,CAAC;AACD,OAAO,cAAc;","names":[]}
|
|
@@ -33,6 +33,7 @@ __export(spinner_exports, {
|
|
|
33
33
|
spinnerVariants: () => spinnerVariants
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(spinner_exports);
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
37
|
var React = __toESM(require("react"));
|
|
37
38
|
var import_class_variance_authority = require("class-variance-authority");
|
|
38
39
|
var import_utils = require("../../lib/utils");
|
|
@@ -131,22 +132,24 @@ const Spinner = React.forwardRef(
|
|
|
131
132
|
flip: OrbitFlipSpinner,
|
|
132
133
|
morph: OrbitMorphSpinner
|
|
133
134
|
};
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
135
136
|
"div",
|
|
136
137
|
{
|
|
137
138
|
ref,
|
|
138
139
|
role: "status",
|
|
139
140
|
"aria-label": label || "Loading",
|
|
140
141
|
className: (0, import_utils.cn)(spinnerVariants({ size }), className),
|
|
141
|
-
...props
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
...props,
|
|
143
|
+
children: [
|
|
144
|
+
variant === "ring" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RingSpinner, { size: resolvedSize, color, speed }),
|
|
145
|
+
variant === "dots" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DotsSpinner, { size: resolvedSize, color, speed }),
|
|
146
|
+
variant === "bars" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BarsSpinner, { size: resolvedSize, color, speed }),
|
|
147
|
+
variant === "orbit" && (() => {
|
|
148
|
+
const OrbitComponent = orbitMap[orbitStyle];
|
|
149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OrbitComponent, { size: resolvedSize, color, speed });
|
|
150
|
+
})()
|
|
151
|
+
]
|
|
152
|
+
}
|
|
150
153
|
);
|
|
151
154
|
}
|
|
152
155
|
);
|
|
@@ -156,7 +159,7 @@ function RingSpinner({ size, color, speed }) {
|
|
|
156
159
|
const stroke = RING_STROKE[size];
|
|
157
160
|
const r = (RING_VIEWBOX - stroke) / 2;
|
|
158
161
|
const circumference = 2 * Math.PI * r;
|
|
159
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
160
163
|
"svg",
|
|
161
164
|
{
|
|
162
165
|
viewBox: `0 0 ${RING_VIEWBOX} ${RING_VIEWBOX}`,
|
|
@@ -164,40 +167,41 @@ function RingSpinner({ size, color, speed }) {
|
|
|
164
167
|
height: diameter,
|
|
165
168
|
fill: "none",
|
|
166
169
|
className: "animate-spin",
|
|
167
|
-
style: { animationDuration: `${SPEED_MS[speed]}ms` }
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
170
|
+
style: { animationDuration: `${SPEED_MS[speed]}ms` },
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
|
+
"circle",
|
|
174
|
+
{
|
|
175
|
+
cx: RING_CENTER,
|
|
176
|
+
cy: RING_CENTER,
|
|
177
|
+
r,
|
|
178
|
+
className: "stroke-border",
|
|
179
|
+
strokeWidth: stroke
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
183
|
+
"circle",
|
|
184
|
+
{
|
|
185
|
+
cx: RING_CENTER,
|
|
186
|
+
cy: RING_CENTER,
|
|
187
|
+
r,
|
|
188
|
+
className: strokeColorMap[color],
|
|
189
|
+
strokeWidth: stroke,
|
|
190
|
+
strokeDasharray: circumference,
|
|
191
|
+
strokeDashoffset: circumference * 0.75,
|
|
192
|
+
strokeLinecap: "round"
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
]
|
|
196
|
+
}
|
|
192
197
|
);
|
|
193
198
|
}
|
|
194
199
|
function DotsSpinner({ size, color, speed }) {
|
|
195
200
|
const dotSize = DOT_SIZES[size];
|
|
196
201
|
const gap = DOT_GAP[size];
|
|
197
|
-
return /* @__PURE__ */
|
|
202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "inline-flex items-center", style: { gap }, children: Array.from({ length: DOT_COUNT }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
198
203
|
"div",
|
|
199
204
|
{
|
|
200
|
-
key: i,
|
|
201
205
|
className: (0, import_utils.cn)(
|
|
202
206
|
"rounded-full animate-spinner-dot",
|
|
203
207
|
bgColorMap[color]
|
|
@@ -208,17 +212,17 @@ function DotsSpinner({ size, color, speed }) {
|
|
|
208
212
|
animationDuration: `${SPEED_MS[speed]}ms`,
|
|
209
213
|
animationDelay: `${i * (SPEED_MS[speed] / DOT_COUNT / 1.5)}ms`
|
|
210
214
|
}
|
|
211
|
-
}
|
|
212
|
-
|
|
215
|
+
},
|
|
216
|
+
i
|
|
217
|
+
)) });
|
|
213
218
|
}
|
|
214
219
|
function BarsSpinner({ size, color, speed }) {
|
|
215
220
|
const barWidth = BAR_WIDTHS[size];
|
|
216
221
|
const barHeight = BAR_HEIGHTS[size];
|
|
217
222
|
const gap = BAR_GAP[size];
|
|
218
|
-
return /* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "inline-flex items-center", style: { gap, height: barHeight }, children: Array.from({ length: BAR_COUNT }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
219
224
|
"div",
|
|
220
225
|
{
|
|
221
|
-
key: i,
|
|
222
226
|
className: (0, import_utils.cn)(
|
|
223
227
|
"rounded-full animate-spinner-bar origin-center",
|
|
224
228
|
bgColorMap[color]
|
|
@@ -229,8 +233,9 @@ function BarsSpinner({ size, color, speed }) {
|
|
|
229
233
|
animationDuration: `${SPEED_MS[speed]}ms`,
|
|
230
234
|
animationDelay: `${i * (SPEED_MS[speed] / BAR_COUNT / 1.5)}ms`
|
|
231
235
|
}
|
|
232
|
-
}
|
|
233
|
-
|
|
236
|
+
},
|
|
237
|
+
i
|
|
238
|
+
)) });
|
|
234
239
|
}
|
|
235
240
|
const orbitTextColorMap = {
|
|
236
241
|
default: "text-foreground",
|
|
@@ -242,7 +247,7 @@ function OrbitSpinner({ size, color, speed }) {
|
|
|
242
247
|
const stroke = ORBIT_STROKE[size];
|
|
243
248
|
const r = (RING_VIEWBOX - stroke * 2) / 2;
|
|
244
249
|
const circumference = 2 * Math.PI * r;
|
|
245
|
-
return /* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
246
251
|
"div",
|
|
247
252
|
{
|
|
248
253
|
className: (0, import_utils.cn)(orbitTextColorMap[color]),
|
|
@@ -251,56 +256,58 @@ function OrbitSpinner({ size, color, speed }) {
|
|
|
251
256
|
height: diameter,
|
|
252
257
|
perspective: diameter * 3,
|
|
253
258
|
position: "relative"
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
/* @__PURE__ */ React.createElement(
|
|
257
|
-
"svg",
|
|
258
|
-
{
|
|
259
|
-
viewBox: `0 0 ${RING_VIEWBOX} ${RING_VIEWBOX}`,
|
|
260
|
-
width: diameter,
|
|
261
|
-
height: diameter,
|
|
262
|
-
fill: "none",
|
|
263
|
-
className: "absolute inset-0 animate-spinner-orbit",
|
|
264
|
-
style: { animationDuration: `${ORBIT_SPEED_MS[speed]}ms` }
|
|
265
259
|
},
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
262
|
+
"svg",
|
|
263
|
+
{
|
|
264
|
+
viewBox: `0 0 ${RING_VIEWBOX} ${RING_VIEWBOX}`,
|
|
265
|
+
width: diameter,
|
|
266
|
+
height: diameter,
|
|
267
|
+
fill: "none",
|
|
268
|
+
className: "absolute inset-0 animate-spinner-orbit",
|
|
269
|
+
style: { animationDuration: `${ORBIT_SPEED_MS[speed]}ms` },
|
|
270
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
271
|
+
"circle",
|
|
272
|
+
{
|
|
273
|
+
cx: RING_CENTER,
|
|
274
|
+
cy: RING_CENTER,
|
|
275
|
+
r,
|
|
276
|
+
stroke: "currentColor",
|
|
277
|
+
strokeWidth: stroke
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
}
|
|
281
|
+
),
|
|
282
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
283
|
+
"svg",
|
|
284
|
+
{
|
|
285
|
+
viewBox: `0 0 ${RING_VIEWBOX} ${RING_VIEWBOX}`,
|
|
286
|
+
width: diameter,
|
|
287
|
+
height: diameter,
|
|
288
|
+
fill: "none",
|
|
289
|
+
className: "absolute inset-0 animate-spinner-orbit",
|
|
290
|
+
style: {
|
|
291
|
+
animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
|
|
292
|
+
transform: "rotateZ(90deg)",
|
|
293
|
+
animationDirection: "reverse",
|
|
294
|
+
animationDelay: "-0.4s",
|
|
295
|
+
opacity: 0.35
|
|
296
|
+
},
|
|
297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
298
|
+
"circle",
|
|
299
|
+
{
|
|
300
|
+
cx: RING_CENTER,
|
|
301
|
+
cy: RING_CENTER,
|
|
302
|
+
r,
|
|
303
|
+
stroke: "currentColor",
|
|
304
|
+
strokeWidth: stroke
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
]
|
|
310
|
+
}
|
|
304
311
|
);
|
|
305
312
|
}
|
|
306
313
|
const ORBIT_DOT_SIZE = { sm: 3, default: 4, lg: 6 };
|
|
@@ -308,7 +315,7 @@ function OrbitDotsSpinner({ size, color, speed }) {
|
|
|
308
315
|
const diameter = ORBIT_SIZES[size];
|
|
309
316
|
const dotSize = ORBIT_DOT_SIZE[size];
|
|
310
317
|
const orbitRadius = (diameter - dotSize) / 2;
|
|
311
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
312
319
|
"div",
|
|
313
320
|
{
|
|
314
321
|
className: (0, import_utils.cn)(orbitTextColorMap[color]),
|
|
@@ -317,36 +324,36 @@ function OrbitDotsSpinner({ size, color, speed }) {
|
|
|
317
324
|
height: diameter,
|
|
318
325
|
perspective: diameter * 3,
|
|
319
326
|
position: "relative"
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
/* @__PURE__ */ React.createElement(
|
|
323
|
-
"div",
|
|
324
|
-
{
|
|
325
|
-
className: "animate-spinner-orbit",
|
|
326
|
-
style: {
|
|
327
|
-
animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
|
|
328
|
-
width: "100%",
|
|
329
|
-
height: "100%",
|
|
330
|
-
position: "relative",
|
|
331
|
-
transformStyle: "preserve-3d"
|
|
332
|
-
}
|
|
333
327
|
},
|
|
334
|
-
|
|
328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
335
329
|
"div",
|
|
336
330
|
{
|
|
337
|
-
|
|
338
|
-
className: "absolute rounded-full",
|
|
331
|
+
className: "animate-spinner-orbit",
|
|
339
332
|
style: {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
333
|
+
animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
|
|
334
|
+
width: "100%",
|
|
335
|
+
height: "100%",
|
|
336
|
+
position: "relative",
|
|
337
|
+
transformStyle: "preserve-3d"
|
|
338
|
+
},
|
|
339
|
+
children: [0, 120, 240].map((angle) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
340
|
+
"div",
|
|
341
|
+
{
|
|
342
|
+
className: "absolute rounded-full",
|
|
343
|
+
style: {
|
|
344
|
+
width: dotSize,
|
|
345
|
+
height: dotSize,
|
|
346
|
+
backgroundColor: "currentColor",
|
|
347
|
+
left: "50%",
|
|
348
|
+
top: "50%",
|
|
349
|
+
transform: `translate(-50%, -50%) rotate(${angle}deg) translateX(${orbitRadius}px)`
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
angle
|
|
353
|
+
))
|
|
347
354
|
}
|
|
348
|
-
)
|
|
349
|
-
|
|
355
|
+
)
|
|
356
|
+
}
|
|
350
357
|
);
|
|
351
358
|
}
|
|
352
359
|
const CUBE_SIZES = { sm: 12, default: 18, lg: 26 };
|
|
@@ -364,7 +371,7 @@ function OrbitCubeSpinner({ size, color, speed }) {
|
|
|
364
371
|
top: -overlap,
|
|
365
372
|
left: -overlap
|
|
366
373
|
};
|
|
367
|
-
return /* @__PURE__ */
|
|
374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
368
375
|
"div",
|
|
369
376
|
{
|
|
370
377
|
className: (0, import_utils.cn)(orbitTextColorMap[color]),
|
|
@@ -372,44 +379,46 @@ function OrbitCubeSpinner({ size, color, speed }) {
|
|
|
372
379
|
width: cubeSize,
|
|
373
380
|
height: cubeSize,
|
|
374
381
|
perspective: cubeSize * 6
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
/* @__PURE__ */ React.createElement(
|
|
378
|
-
"div",
|
|
379
|
-
{
|
|
380
|
-
style: {
|
|
381
|
-
width: cubeSize,
|
|
382
|
-
height: cubeSize,
|
|
383
|
-
transform: "rotateX(-25deg) rotateZ(15deg)",
|
|
384
|
-
transformStyle: "preserve-3d"
|
|
385
|
-
}
|
|
386
382
|
},
|
|
387
|
-
/* @__PURE__ */
|
|
383
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
388
384
|
"div",
|
|
389
385
|
{
|
|
390
|
-
className: "animate-spinner-orbit",
|
|
391
386
|
style: {
|
|
392
|
-
animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
|
|
393
387
|
width: cubeSize,
|
|
394
388
|
height: cubeSize,
|
|
395
|
-
|
|
389
|
+
transform: "rotateX(-25deg) rotateZ(15deg)",
|
|
396
390
|
transformStyle: "preserve-3d"
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
391
|
+
},
|
|
392
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
393
|
+
"div",
|
|
394
|
+
{
|
|
395
|
+
className: "animate-spinner-orbit",
|
|
396
|
+
style: {
|
|
397
|
+
animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
|
|
398
|
+
width: cubeSize,
|
|
399
|
+
height: cubeSize,
|
|
400
|
+
position: "relative",
|
|
401
|
+
transformStyle: "preserve-3d"
|
|
402
|
+
},
|
|
403
|
+
children: [
|
|
404
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...faceBase, transform: `translateZ(${half}px)`, opacity: 0.25 } }),
|
|
405
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...faceBase, transform: `translateZ(${-half}px)`, opacity: 0.1 } }),
|
|
406
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...faceBase, transform: `rotateY(-90deg) translateZ(${half}px)`, opacity: 0.2 } }),
|
|
407
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...faceBase, transform: `rotateY(90deg) translateZ(${half}px)`, opacity: 0.2 } }),
|
|
408
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...faceBase, transform: `rotateX(90deg) translateZ(${half}px)`, opacity: 0.15 } }),
|
|
409
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...faceBase, transform: `rotateX(-90deg) translateZ(${half}px)`, opacity: 0.08 } })
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
)
|
|
413
|
+
}
|
|
405
414
|
)
|
|
406
|
-
|
|
415
|
+
}
|
|
407
416
|
);
|
|
408
417
|
}
|
|
409
418
|
const FLIP_SIZES = { sm: 14, default: 20, lg: 28 };
|
|
410
419
|
function OrbitFlipSpinner({ size, color, speed }) {
|
|
411
420
|
const sqSize = FLIP_SIZES[size];
|
|
412
|
-
return /* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
413
422
|
"div",
|
|
414
423
|
{
|
|
415
424
|
className: (0, import_utils.cn)(orbitTextColorMap[color]),
|
|
@@ -417,28 +426,28 @@ function OrbitFlipSpinner({ size, color, speed }) {
|
|
|
417
426
|
width: sqSize,
|
|
418
427
|
height: sqSize,
|
|
419
428
|
perspective: sqSize * 4
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
429
|
+
},
|
|
430
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { transform: "rotateX(25deg)", transformStyle: "preserve-3d", width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
431
|
+
"div",
|
|
432
|
+
{
|
|
433
|
+
className: "animate-spinner-orbit",
|
|
434
|
+
style: {
|
|
435
|
+
animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
|
|
436
|
+
width: "100%",
|
|
437
|
+
height: "100%",
|
|
438
|
+
borderRadius: "25%",
|
|
439
|
+
backgroundColor: "currentColor",
|
|
440
|
+
opacity: 0.85
|
|
441
|
+
}
|
|
433
442
|
}
|
|
434
|
-
}
|
|
435
|
-
|
|
443
|
+
) })
|
|
444
|
+
}
|
|
436
445
|
);
|
|
437
446
|
}
|
|
438
447
|
const MORPH_SIZES = { sm: 16, default: 24, lg: 34 };
|
|
439
448
|
function OrbitMorphSpinner({ size, color, speed }) {
|
|
440
449
|
const morphSize = MORPH_SIZES[size];
|
|
441
|
-
return /* @__PURE__ */
|
|
450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
442
451
|
"div",
|
|
443
452
|
{
|
|
444
453
|
className: (0, import_utils.cn)(orbitTextColorMap[color]),
|
|
@@ -446,21 +455,21 @@ function OrbitMorphSpinner({ size, color, speed }) {
|
|
|
446
455
|
width: morphSize,
|
|
447
456
|
height: morphSize,
|
|
448
457
|
perspective: morphSize * 3
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
458
|
+
},
|
|
459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
460
|
+
"div",
|
|
461
|
+
{
|
|
462
|
+
className: "animate-spinner-morph",
|
|
463
|
+
style: {
|
|
464
|
+
animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
|
|
465
|
+
width: "100%",
|
|
466
|
+
height: "100%",
|
|
467
|
+
backgroundColor: "currentColor",
|
|
468
|
+
opacity: 0.85
|
|
469
|
+
}
|
|
461
470
|
}
|
|
462
|
-
|
|
463
|
-
|
|
471
|
+
)
|
|
472
|
+
}
|
|
464
473
|
);
|
|
465
474
|
}
|
|
466
475
|
// Annotate the CommonJS export names for ESM import in node:
|