@spark-ui/components 14.1.1 → 15.0.0
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/FormFieldRequiredIndicator-CHfcoT2y.js +2 -0
- package/dist/FormFieldRequiredIndicator-CHfcoT2y.js.map +1 -0
- package/dist/FormFieldRequiredIndicator-DTnCGiX2.mjs +13 -0
- package/dist/FormFieldRequiredIndicator-DTnCGiX2.mjs.map +1 -0
- package/dist/form-field/index.js +1 -1
- package/dist/form-field/index.js.map +1 -1
- package/dist/form-field/index.mjs +76 -81
- package/dist/form-field/index.mjs.map +1 -1
- package/dist/meter/MeterValue.d.ts +5 -3
- package/dist/meter/index.js +1 -1
- package/dist/meter/index.js.map +1 -1
- package/dist/meter/index.mjs +17 -18
- package/dist/meter/index.mjs.map +1 -1
- package/dist/progress/index.js +1 -1
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +13 -13
- package/dist/progress/index.mjs.map +1 -1
- package/dist/slider/Slider.d.ts +8 -13
- package/dist/slider/SliderContext.d.ts +7 -1
- package/dist/slider/SliderControl.d.ts +7 -0
- package/dist/slider/SliderIndicator.d.ts +7 -0
- package/dist/slider/SliderLabel.d.ts +13 -0
- package/dist/slider/SliderMaxValue.d.ts +6 -0
- package/dist/slider/SliderMinValue.d.ts +6 -0
- package/dist/slider/SliderThumb.d.ts +4 -11
- package/dist/slider/SliderThumbContext.d.ts +5 -0
- package/dist/slider/SliderTrack.d.ts +4 -11
- package/dist/slider/SliderTrack.styles.d.ts +1 -4
- package/dist/slider/SliderValue.d.ts +10 -0
- package/dist/slider/index.d.mts +13 -1
- package/dist/slider/index.d.ts +13 -1
- package/dist/slider/index.js +1 -1
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs +290 -127
- package/dist/slider/index.mjs.map +1 -1
- package/dist/slider/useSliderValueBoundaries.d.ts +12 -0
- package/dist/toast/index.js +1 -1
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/index.mjs +154 -129
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toast/types.d.ts +4 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/progress/ProgressContext.tsx","../../src/progress/ProgressIndicator.tsx","../../src/progress/ProgressTrack.tsx","../../src/progress/Progress.tsx","../../src/progress/ProgressLabel.tsx","../../src/progress/ProgressValue.tsx","../../src/progress/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport { ProgressIndicatorStylesProps } from './ProgressIndicator'\n\nexport interface ProgressContextValue {\n value: number | null\n max: number\n min: number\n shape: 'square' | 'rounded'\n intent: ProgressIndicatorStylesProps['intent']\n onLabelId: (id?: string) => void\n onComplete?: () => void\n}\n\nexport const ProgressContext = createContext<ProgressContextValue | null>(null)\n\nexport const ID_PREFIX = ':progress'\n\nexport const useProgress = () => {\n const context = useContext(ProgressContext)\n\n if (!context) {\n throw new Error('useProgress must be used within a Progress provider')\n }\n\n return context\n}\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { cva, cx, VariantProps } from 'class-variance-authority'\nimport { ComponentProps, PropsWithChildren } from 'react'\n\nimport { useProgress } from './ProgressContext'\n\nexport const progressIndicatorStyles = cva(['h-full w-full', 'transition-width duration-400'], {\n variants: {\n /**\n * Color scheme of the progress component.\n */\n intent: {\n basic: ['bg-basic'],\n main: ['bg-main'],\n support: ['bg-support'],\n accent: ['bg-accent'],\n success: ['bg-success'],\n alert: ['bg-alert'],\n danger: ['bg-error'],\n info: ['bg-info'],\n neutral: ['bg-neutral'],\n },\n /**\n * Shape of the progress component.\n */\n shape: {\n square: [],\n rounded: ['rounded-sm'],\n },\n },\n})\n\nexport type ProgressIndicatorStylesProps = VariantProps<typeof progressIndicatorStyles>\n\nexport type ProgressIndicatorProps = Omit<ComponentProps<typeof BaseProgress.Indicator>, 'render'>\n\nexport const ProgressIndicator = ({\n className,\n style,\n ref,\n onTransitionEnd,\n ...others\n}: PropsWithChildren<ProgressIndicatorProps>) => {\n const { value, max, min, intent, shape, onComplete } = useProgress()\n\n const percentage = value !== null ? ((value - min) / (max - min)) * 100 : 0\n const isIndeterminate = value === null\n\n const handleTransitionEnd = (event: Parameters<NonNullable<ProgressIndicatorProps['onTransitionEnd']>>[0]) => {\n // Call the original onTransitionEnd if provided\n onTransitionEnd?.(event)\n\n // If progress is complete and we have a callback, call it\n if (value !== null && value >= max && onComplete) {\n onComplete()\n }\n }\n\n return (\n <BaseProgress.Indicator\n data-spark-component=\"progress-indicator\"\n className={cx(\n progressIndicatorStyles({\n className,\n intent,\n shape,\n }),\n isIndeterminate && 'animate-standalone-indeterminate-bar absolute -translate-x-1/2'\n )}\n style={{\n ...style,\n ...(!isIndeterminate && value !== null && { width: `${percentage}%` }),\n }}\n ref={ref}\n onTransitionEnd={handleTransitionEnd}\n {...others}\n />\n )\n}\n\nProgressIndicator.displayName = 'ProgressIndicator'\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps } from 'react'\n\nimport { useProgress } from './ProgressContext'\nimport { ProgressIndicator } from './ProgressIndicator'\n\nexport type ProgressTrackProps = Omit<ComponentProps<typeof BaseProgress.Track>, 'render'>\n\nexport const ProgressTrack = ({ className, ...others }: ProgressTrackProps) => {\n const { shape } = useProgress()\n\n return (\n <BaseProgress.Track\n data-spark-component=\"progress-track\"\n className={cx(\n 'h-sz-4 relative col-span-2 w-full',\n 'transform-gpu',\n 'overflow-hidden',\n 'bg-on-background/dim-4',\n { 'rounded-sm': shape === 'rounded' },\n className\n )}\n {...others}\n >\n <ProgressIndicator />\n </BaseProgress.Track>\n )\n}\n\nProgressTrack.displayName = 'Progress.Track'\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, PropsWithChildren, Ref, useMemo, useState } from 'react'\n\nimport { ProgressContext } from './ProgressContext'\nimport { ProgressIndicatorStylesProps } from './ProgressIndicator'\nimport { ProgressTrack } from './ProgressTrack'\n\nexport interface ProgressProps\n extends Omit<ComponentProps<typeof BaseProgress.Root>, 'render'>,\n Pick<ProgressIndicatorStylesProps, 'intent'> {\n shape?: 'square' | 'rounded'\n /**\n * Callback called when the progress reaches its maximum value and the transition animation completes.\n */\n onComplete?: () => void\n /**\n * Function that returns a string value that provides a human-readable text alternative for the current value of the progress bar.\n * @deprecated Use `getAriaValueText` instead. This prop is kept for backward compatibility.\n */\n getValueLabel?: (value: number, max: number) => string\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Progress = ({\n className,\n value: valueProp,\n max = 100,\n min = 0,\n shape = 'square',\n intent = 'basic',\n onComplete,\n getValueLabel,\n getAriaValueText: getAriaValueTextProp,\n children = <ProgressTrack />,\n ref,\n ...others\n}: PropsWithChildren<ProgressProps>) => {\n const [labelId, setLabelId] = useState<string>()\n\n const contextValue = useMemo(() => {\n return {\n value: valueProp ?? null,\n max,\n min,\n intent,\n shape,\n onLabelId: setLabelId,\n onComplete,\n }\n }, [max, min, valueProp, intent, shape, setLabelId, onComplete])\n\n // Map getValueLabel to getAriaValueText for backward compatibility\n const getAriaValueText =\n getAriaValueTextProp ||\n (getValueLabel\n ? (formattedValue: string | null, value: number | null) => {\n if (value === null) return formattedValue ?? ''\n\n return getValueLabel(value, max)\n }\n : undefined)\n\n return (\n <ProgressContext.Provider value={contextValue}>\n <BaseProgress.Root\n data-spark-component=\"progress\"\n ref={ref}\n className={cx('gap-sm focus-visible:u-outline grid grid-cols-2', className)}\n value={valueProp ?? null}\n max={max}\n min={min}\n aria-labelledby={labelId}\n getAriaValueText={getAriaValueText}\n {...others}\n >\n {children}\n </BaseProgress.Root>\n </ProgressContext.Provider>\n )\n}\n\nProgress.displayName = 'Progress'\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { ComponentProps, useCallback, useId } from 'react'\n\nimport { ID_PREFIX, useProgress } from './ProgressContext'\n\nexport type ProgressLabelProps = Omit<ComponentProps<typeof BaseProgress.Label>, 'render'>\n\nexport const ProgressLabel = ({\n id: idProp,\n children,\n ref: forwardedRef,\n ...others\n}: ProgressLabelProps) => {\n const internalID = `${ID_PREFIX}-label-${useId()}`\n const id = idProp || internalID\n\n const { onLabelId } = useProgress()\n const rootRef = useCallback(\n (el: HTMLSpanElement) => {\n onLabelId(el ? id : undefined)\n },\n [id, onLabelId]\n )\n const ref = useMergeRefs(forwardedRef, rootRef)\n\n return (\n <BaseProgress.Label\n data-spark-component=\"progress-label\"\n id={id}\n className=\"default:text-body-1 text-on-surface default:font-bold\"\n ref={ref}\n {...others}\n >\n {children}\n </BaseProgress.Label>\n )\n}\n\nProgressLabel.displayName = 'Progress.Label'\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, PropsWithChildren } from 'react'\n\nexport type ProgressValueProps = Omit<ComponentProps<typeof BaseProgress.Value>, 'render'>\n\nexport const ProgressValue = ({\n className,\n children,\n ...others\n}: PropsWithChildren<ProgressValueProps>) => {\n return (\n <BaseProgress.Value\n data-spark-component=\"progress-value\"\n className={cx('default:text-body-1 text-on-surface col-start-2 text-right', className)}\n {...others}\n >\n {children}\n </BaseProgress.Value>\n )\n}\n\nProgressValue.displayName = 'Progress.Value'\n","import { Progress as Root } from './Progress'\nimport { ProgressLabel } from './ProgressLabel'\nimport { ProgressTrack } from './ProgressTrack'\nimport { ProgressValue } from './ProgressValue'\n\nexport const Progress: typeof Root & {\n Label: typeof ProgressLabel\n Track: typeof ProgressTrack\n Value: typeof ProgressValue\n} = Object.assign(Root, {\n Label: ProgressLabel,\n Track: ProgressTrack,\n Value: ProgressValue,\n})\n\nProgress.displayName = 'Progress'\nProgressLabel.displayName = 'Progress.Label'\nProgressTrack.displayName = 'Progress.Track'\nProgressValue.displayName = 'Progress.Value'\n\nexport { type ProgressProps } from './Progress'\nexport { type ProgressLabelProps } from './ProgressLabel'\nexport { type ProgressTrackProps } from './ProgressTrack'\nexport { type ProgressValueProps } from './ProgressValue'\n"],"names":["ProgressContext","createContext","ID_PREFIX","useProgress","context","useContext","progressIndicatorStyles","cva","ProgressIndicator","className","style","ref","onTransitionEnd","others","value","max","min","intent","shape","onComplete","percentage","isIndeterminate","handleTransitionEnd","event","jsx","BaseProgress","cx","ProgressTrack","Progress","valueProp","getValueLabel","getAriaValueTextProp","children","labelId","setLabelId","useState","contextValue","useMemo","getAriaValueText","formattedValue","ProgressLabel","idProp","forwardedRef","internalID","useId","id","onLabelId","rootRef","useCallback","el","useMergeRefs","ProgressValue","Root"],"mappings":";;;;;AAcO,MAAMA,IAAkBC,EAA2C,IAAI,GAEjEC,IAAY,aAEZC,IAAc,MAAM;AAC/B,QAAMC,IAAUC,EAAWL,CAAe;AAE1C,MAAI,CAACI;AACH,UAAM,IAAI,MAAM,qDAAqD;AAGvE,SAAOA;AACT,GCpBaE,IAA0BC,EAAI,CAAC,iBAAiB,+BAA+B,GAAG;AAAA,EAC7F,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,QAAQ;AAAA,MACN,OAAO,CAAC,UAAU;AAAA,MAClB,MAAM,CAAC,SAAS;AAAA,MAChB,SAAS,CAAC,YAAY;AAAA,MACtB,QAAQ,CAAC,WAAW;AAAA,MACpB,SAAS,CAAC,YAAY;AAAA,MACtB,OAAO,CAAC,UAAU;AAAA,MAClB,QAAQ,CAAC,UAAU;AAAA,MACnB,MAAM,CAAC,SAAS;AAAA,MAChB,SAAS,CAAC,YAAY;AAAA,IAAA;AAAA;AAAA;AAAA;AAAA,IAKxB,OAAO;AAAA,MACL,QAAQ,CAAA;AAAA,MACR,SAAS,CAAC,YAAY;AAAA,IAAA;AAAA,EACxB;AAEJ,CAAC,GAMYC,IAAoB,CAAC;AAAA,EAChC,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,KAAAC;AAAA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,GAAGzC,CAAS,UAAU0C,GAAO,IAC1CC,IAAKJ,KAAUE,GAEf,EAAE,WAAAG,EAAA,IAAc3C,EAAA,GAChB4C,IAAUC;AAAA,IACd,CAACC,MAAwB;AACvB,MAAAH,EAAUG,IAAKJ,IAAK,MAAS;AAAA,IAC/B;AAAA,IACA,CAACA,GAAIC,CAAS;AAAA,EAAA,GAEVnC,IAAMuC,EAAaR,GAAcK,CAAO;AAE9C,SACE,gBAAAvB;AAAA,IAACC,EAAa;AAAA,IAAb;AAAA,MACC,wBAAqB;AAAA,MACrB,IAAAoB;AAAA,MACA,WAAU;AAAA,MACV,KAAAlC;AAAA,MACC,GAAGE;AAAA,MAEH,UAAAmB;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAQ,EAAc,cAAc;ACjCrB,MAAMW,IAAgB,CAAC;AAAA,EAC5B,WAAA1C;AAAA,EACA,UAAAuB;AAAA,EACA,GAAGnB;AACL,MAEI,gBAAAW;AAAA,EAACC,EAAa;AAAA,EAAb;AAAA,IACC,wBAAqB;AAAA,IACrB,WAAWC,EAAG,8DAA8DjB,CAAS;AAAA,IACpF,GAAGI;AAAA,IAEH,UAAAmB;AAAA,EAAA;AAAA;AAKPmB,EAAc,cAAc;ACjBrB,MAAMvB,IAIT,OAAO,OAAOwB,GAAM;AAAA,EACtB,OAAOZ;AAAA,EACP,OAAOb;AAAA,EACP,OAAOwB;AACT,CAAC;AAEDvB,EAAS,cAAc;AACvBY,EAAc,cAAc;AAC5Bb,EAAc,cAAc;AAC5BwB,EAAc,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/progress/ProgressContext.tsx","../../src/progress/ProgressIndicator.tsx","../../src/progress/ProgressTrack.tsx","../../src/progress/Progress.tsx","../../src/progress/ProgressLabel.tsx","../../src/progress/ProgressValue.tsx","../../src/progress/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport { ProgressIndicatorStylesProps } from './ProgressIndicator'\n\nexport interface ProgressContextValue {\n value: number | null\n max: number\n min: number\n shape: 'square' | 'rounded'\n intent: ProgressIndicatorStylesProps['intent']\n onLabelId: (id?: string) => void\n onComplete?: () => void\n}\n\nexport const ProgressContext = createContext<ProgressContextValue | null>(null)\n\nexport const ID_PREFIX = ':progress'\n\nexport const useProgress = () => {\n const context = useContext(ProgressContext)\n\n if (!context) {\n throw new Error('useProgress must be used within a Progress provider')\n }\n\n return context\n}\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { cva, cx, VariantProps } from 'class-variance-authority'\nimport { ComponentProps, PropsWithChildren } from 'react'\n\nimport { useProgress } from './ProgressContext'\n\nexport const progressIndicatorStyles = cva(['h-full w-full', 'transition-width duration-400'], {\n variants: {\n /**\n * Color scheme of the progress component.\n */\n intent: {\n basic: ['bg-basic'],\n main: ['bg-main'],\n support: ['bg-support'],\n accent: ['bg-accent'],\n success: ['bg-success'],\n alert: ['bg-alert'],\n danger: ['bg-error'],\n info: ['bg-info'],\n neutral: ['bg-neutral'],\n },\n /**\n * Shape of the progress component.\n */\n shape: {\n square: [],\n rounded: ['rounded-sm'],\n },\n },\n})\n\nexport type ProgressIndicatorStylesProps = VariantProps<typeof progressIndicatorStyles>\n\nexport type ProgressIndicatorProps = Omit<ComponentProps<typeof BaseProgress.Indicator>, 'render'>\n\nexport const ProgressIndicator = ({\n className,\n style,\n ref,\n onTransitionEnd,\n ...others\n}: PropsWithChildren<ProgressIndicatorProps>) => {\n const { value, max, min, intent, shape, onComplete } = useProgress()\n\n const percentage = value !== null ? ((value - min) / (max - min)) * 100 : 0\n const isIndeterminate = value === null\n\n const handleTransitionEnd = (event: Parameters<NonNullable<ProgressIndicatorProps['onTransitionEnd']>>[0]) => {\n // Call the original onTransitionEnd if provided\n onTransitionEnd?.(event)\n\n // If progress is complete and we have a callback, call it\n if (value !== null && value >= max && onComplete) {\n onComplete()\n }\n }\n\n return (\n <BaseProgress.Indicator\n data-spark-component=\"progress-indicator\"\n className={cx(\n progressIndicatorStyles({\n className,\n intent,\n shape,\n }),\n isIndeterminate && 'animate-standalone-indeterminate-bar absolute -translate-x-1/2'\n )}\n style={{\n ...style,\n ...(!isIndeterminate && value !== null && { width: `${percentage}%` }),\n }}\n ref={ref}\n onTransitionEnd={handleTransitionEnd}\n {...others}\n />\n )\n}\n\nProgressIndicator.displayName = 'ProgressIndicator'\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps } from 'react'\n\nimport { useProgress } from './ProgressContext'\nimport { ProgressIndicator } from './ProgressIndicator'\n\nexport type ProgressTrackProps = Omit<ComponentProps<typeof BaseProgress.Track>, 'render'>\n\nexport const ProgressTrack = ({ className, ...others }: ProgressTrackProps) => {\n const { shape } = useProgress()\n\n return (\n <BaseProgress.Track\n data-spark-component=\"progress-track\"\n className={cx(\n 'h-sz-4 relative col-span-2 w-full',\n 'transform-gpu',\n 'overflow-hidden',\n 'bg-on-background/dim-4',\n { 'rounded-sm': shape === 'rounded' },\n className\n )}\n {...others}\n >\n <ProgressIndicator />\n </BaseProgress.Track>\n )\n}\n\nProgressTrack.displayName = 'Progress.Track'\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, PropsWithChildren, Ref, useMemo, useState } from 'react'\n\nimport { ProgressContext } from './ProgressContext'\nimport { ProgressIndicatorStylesProps } from './ProgressIndicator'\nimport { ProgressTrack } from './ProgressTrack'\n\nexport interface ProgressProps\n extends Omit<ComponentProps<typeof BaseProgress.Root>, 'render'>,\n Pick<ProgressIndicatorStylesProps, 'intent'> {\n shape?: 'square' | 'rounded'\n /**\n * Callback called when the progress reaches its maximum value and the transition animation completes.\n */\n onComplete?: () => void\n /**\n * Function that returns a string value that provides a human-readable text alternative for the current value of the progress bar.\n * @deprecated Use `getAriaValueText` instead. This prop is kept for backward compatibility.\n */\n getValueLabel?: (value: number, max: number) => string\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Progress = ({\n className,\n value: valueProp,\n max = 100,\n min = 0,\n shape = 'square',\n intent = 'basic',\n onComplete,\n getValueLabel,\n getAriaValueText: getAriaValueTextProp,\n children = <ProgressTrack />,\n ref,\n ...others\n}: PropsWithChildren<ProgressProps>) => {\n const [labelId, setLabelId] = useState<string>()\n\n const contextValue = useMemo(() => {\n return {\n value: valueProp ?? null,\n max,\n min,\n intent,\n shape,\n onLabelId: setLabelId,\n onComplete,\n }\n }, [max, min, valueProp, intent, shape, setLabelId, onComplete])\n\n // Map getValueLabel to getAriaValueText for backward compatibility\n const getAriaValueText =\n getAriaValueTextProp ||\n (getValueLabel\n ? (formattedValue: string | null, value: number | null) => {\n if (value === null) return formattedValue ?? ''\n\n return getValueLabel(value, max)\n }\n : undefined)\n\n return (\n <ProgressContext.Provider value={contextValue}>\n <BaseProgress.Root\n data-spark-component=\"progress\"\n ref={ref}\n className={cx('gap-sm focus-visible:u-outline grid grid-cols-[1fr_auto]', className)}\n value={valueProp ?? null}\n max={max}\n min={min}\n aria-labelledby={labelId}\n getAriaValueText={getAriaValueText}\n {...others}\n >\n {children}\n </BaseProgress.Root>\n </ProgressContext.Provider>\n )\n}\n\nProgress.displayName = 'Progress'\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { ComponentProps, useCallback, useId } from 'react'\n\nimport { ID_PREFIX, useProgress } from './ProgressContext'\n\nexport type ProgressLabelProps = Omit<ComponentProps<typeof BaseProgress.Label>, 'render'>\n\nexport const ProgressLabel = ({\n id: idProp,\n children,\n ref: forwardedRef,\n ...others\n}: ProgressLabelProps) => {\n const internalID = `${ID_PREFIX}-label-${useId()}`\n const id = idProp || internalID\n\n const { onLabelId } = useProgress()\n const rootRef = useCallback(\n (el: HTMLSpanElement) => {\n onLabelId(el ? id : undefined)\n },\n [id, onLabelId]\n )\n const ref = useMergeRefs(forwardedRef, rootRef)\n\n return (\n <BaseProgress.Label\n data-spark-component=\"progress-label\"\n id={id}\n className=\"default:text-body-1 text-on-surface default:font-bold\"\n ref={ref}\n {...others}\n >\n {children}\n </BaseProgress.Label>\n )\n}\n\nProgressLabel.displayName = 'Progress.Label'\n","import { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, PropsWithChildren } from 'react'\n\nexport type ProgressValueProps = Omit<ComponentProps<typeof BaseProgress.Value>, 'render'>\n\nexport const ProgressValue = ({\n className,\n children,\n ...others\n}: PropsWithChildren<ProgressValueProps>) => {\n return (\n <BaseProgress.Value\n data-spark-component=\"progress-value\"\n className={cx('default:text-body-1 text-on-surface col-start-2 text-right', className)}\n {...others}\n >\n {children}\n </BaseProgress.Value>\n )\n}\n\nProgressValue.displayName = 'Progress.Value'\n","import { Progress as Root } from './Progress'\nimport { ProgressLabel } from './ProgressLabel'\nimport { ProgressTrack } from './ProgressTrack'\nimport { ProgressValue } from './ProgressValue'\n\nexport const Progress: typeof Root & {\n Label: typeof ProgressLabel\n Track: typeof ProgressTrack\n Value: typeof ProgressValue\n} = Object.assign(Root, {\n Label: ProgressLabel,\n Track: ProgressTrack,\n Value: ProgressValue,\n})\n\nProgress.displayName = 'Progress'\nProgressLabel.displayName = 'Progress.Label'\nProgressTrack.displayName = 'Progress.Track'\nProgressValue.displayName = 'Progress.Value'\n\nexport { type ProgressProps } from './Progress'\nexport { type ProgressLabelProps } from './ProgressLabel'\nexport { type ProgressTrackProps } from './ProgressTrack'\nexport { type ProgressValueProps } from './ProgressValue'\n"],"names":["ProgressContext","createContext","ID_PREFIX","useProgress","context","useContext","progressIndicatorStyles","cva","ProgressIndicator","className","style","ref","onTransitionEnd","others","value","max","min","intent","shape","onComplete","percentage","isIndeterminate","handleTransitionEnd","event","jsx","BaseProgress","cx","ProgressTrack","Progress","valueProp","getValueLabel","getAriaValueTextProp","children","labelId","setLabelId","useState","contextValue","useMemo","getAriaValueText","formattedValue","ProgressLabel","idProp","forwardedRef","internalID","useId","id","onLabelId","rootRef","useCallback","el","useMergeRefs","ProgressValue","Root"],"mappings":";;;;;AAcO,MAAMA,IAAkBC,EAA2C,IAAI,GAEjEC,IAAY,aAEZC,IAAc,MAAM;AAC/B,QAAMC,IAAUC,EAAWL,CAAe;AAE1C,MAAI,CAACI;AACH,UAAM,IAAI,MAAM,qDAAqD;AAGvE,SAAOA;AACT,GCpBaE,IAA0BC,EAAI,CAAC,iBAAiB,+BAA+B,GAAG;AAAA,EAC7F,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,QAAQ;AAAA,MACN,OAAO,CAAC,UAAU;AAAA,MAClB,MAAM,CAAC,SAAS;AAAA,MAChB,SAAS,CAAC,YAAY;AAAA,MACtB,QAAQ,CAAC,WAAW;AAAA,MACpB,SAAS,CAAC,YAAY;AAAA,MACtB,OAAO,CAAC,UAAU;AAAA,MAClB,QAAQ,CAAC,UAAU;AAAA,MACnB,MAAM,CAAC,SAAS;AAAA,MAChB,SAAS,CAAC,YAAY;AAAA,IAAA;AAAA;AAAA;AAAA;AAAA,IAKxB,OAAO;AAAA,MACL,QAAQ,CAAA;AAAA,MACR,SAAS,CAAC,YAAY;AAAA,IAAA;AAAA,EACxB;AAEJ,CAAC,GAMYC,IAAoB,CAAC;AAAA,EAChC,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,KAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,GAAGC;AACL,MAAiD;AAC/C,QAAM,EAAE,OAAAC,GAAO,KAAAC,GAAK,KAAAC,GAAK,QAAAC,GAAQ,OAAAC,GAAO,YAAAC,EAAA,IAAehB,EAAA,GAEjDiB,IAAaN,MAAU,QAASA,IAAQE,MAAQD,IAAMC,KAAQ,MAAM,GACpEK,IAAkBP,MAAU,MAE5BQ,IAAsB,CAACC,MAAiF;AAE5G,IAAAX,IAAkBW,CAAK,GAGnBT,MAAU,QAAQA,KAASC,KAAOI,KACpCA,EAAA;AAAA,EAEJ;AAE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,WAAU;AAAA,MACV,KAAAlC;AAAA,MACC,GAAGE;AAAA,MAEH,UAAAmB;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAQ,EAAc,cAAc;ACjCrB,MAAMW,IAAgB,CAAC;AAAA,EAC5B,WAAA1C;AAAA,EACA,UAAAuB;AAAA,EACA,GAAGnB;AACL,MAEI,gBAAAW;AAAA,EAACC,EAAa;AAAA,EAAb;AAAA,IACC,wBAAqB;AAAA,IACrB,WAAWC,EAAG,8DAA8DjB,CAAS;AAAA,IACpF,GAAGI;AAAA,IAEH,UAAAmB;AAAA,EAAA;AAAA;AAKPmB,EAAc,cAAc;ACjBrB,MAAMvB,IAIT,OAAO,OAAOwB,GAAM;AAAA,EACtB,OAAOZ;AAAA,EACP,OAAOb;AAAA,EACP,OAAOwB;AACT,CAAC;AAEDvB,EAAS,cAAc;AACvBY,EAAc,cAAc;AAC5Bb,EAAc,cAAc;AAC5BwB,EAAc,cAAc;"}
|
package/dist/slider/Slider.d.ts
CHANGED
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import { Slider as
|
|
2
|
-
import { PropsWithChildren, Ref } from 'react';
|
|
1
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider';
|
|
2
|
+
import { ComponentProps, PropsWithChildren, Ref } from 'react';
|
|
3
3
|
import { SliderRangeVariantsProps } from './SliderTrack.styles';
|
|
4
|
-
export interface SliderProps extends Omit<
|
|
5
|
-
/**
|
|
6
|
-
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
7
|
-
* @default false
|
|
8
|
-
*/
|
|
9
|
-
asChild?: boolean;
|
|
4
|
+
export interface SliderProps extends Omit<ComponentProps<typeof BaseSlider.Root>, 'render' | 'orientation' | 'onValueChange' | 'onValueCommitted'>, PropsWithChildren<SliderRangeVariantsProps> {
|
|
10
5
|
/**
|
|
11
6
|
* The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
|
|
12
7
|
*/
|
|
13
|
-
defaultValue?: number
|
|
8
|
+
defaultValue?: number;
|
|
14
9
|
/**
|
|
15
10
|
* The controlled value of the slider. Must be used in conjunction with `onValueChange`.
|
|
16
11
|
*/
|
|
17
|
-
value?: number
|
|
12
|
+
value?: number;
|
|
18
13
|
/**
|
|
19
14
|
* Event handler called when the value changes.
|
|
20
15
|
*/
|
|
21
|
-
onValueChange?: (value: number
|
|
16
|
+
onValueChange?: (value: number) => void;
|
|
22
17
|
/**
|
|
23
18
|
* Event handler called when the value changes at the end of an interaction. Useful when you only need to capture a final value e.g. to update a backend service.
|
|
24
19
|
*/
|
|
25
|
-
onValueCommit?: (value: number
|
|
20
|
+
onValueCommit?: (value: number) => void;
|
|
26
21
|
/**
|
|
27
22
|
* The name of the slider. Submitted with its owning form as part of a name/value pair.
|
|
28
23
|
* If wrapped with a FormField with a name, will be inherited from it.
|
|
@@ -55,6 +50,6 @@ export interface SliderProps extends Omit<RadixSlider.SliderProps, 'dir' | 'orie
|
|
|
55
50
|
ref?: Ref<HTMLDivElement>;
|
|
56
51
|
}
|
|
57
52
|
export declare const Slider: {
|
|
58
|
-
({
|
|
53
|
+
({ intent, children, className, ref, value: valueProp, defaultValue: defaultValueProp, disabled: disabledProp, readOnly: readOnlyProp, name: nameProp, onValueChange, onValueCommit, min, max, ...rest }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
59
54
|
displayName: string;
|
|
60
55
|
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
1
2
|
import { SliderProps } from './Slider';
|
|
2
|
-
export type SliderContextInterface = Pick<SliderProps, 'intent' | '
|
|
3
|
+
export type SliderContextInterface = Pick<SliderProps, 'intent' | 'min' | 'max'> & {
|
|
3
4
|
fieldLabelId?: string;
|
|
4
5
|
fieldId?: string;
|
|
6
|
+
onLabelId?: (id: string | undefined) => void;
|
|
7
|
+
hasValueInThumb: boolean;
|
|
8
|
+
registerValueInThumb: () => () => void;
|
|
9
|
+
controlRef: RefObject<HTMLElement | null>;
|
|
10
|
+
thumbRef: RefObject<HTMLElement | null>;
|
|
5
11
|
};
|
|
6
12
|
export declare const SliderContext: import('react').Context<SliderContextInterface>;
|
|
7
13
|
export declare const useSliderContext: () => SliderContextInterface;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
export type SliderControlProps = Omit<ComponentProps<typeof BaseSlider.Control>, 'render'>;
|
|
4
|
+
export declare const SliderControl: {
|
|
5
|
+
({ className, ref, ...rest }: SliderControlProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
export type SliderIndicatorProps = Omit<ComponentProps<typeof BaseSlider.Indicator>, 'render'>;
|
|
4
|
+
export declare const SliderIndicator: {
|
|
5
|
+
({ className, ref, ...rest }: SliderIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
|
+
import { LabelProps } from '../label';
|
|
3
|
+
export interface SliderLabelProps extends LabelProps {
|
|
4
|
+
/**
|
|
5
|
+
* Element shown when the input is required inside the label.
|
|
6
|
+
*/
|
|
7
|
+
requiredIndicator?: ReactNode;
|
|
8
|
+
ref?: Ref<HTMLLabelElement>;
|
|
9
|
+
}
|
|
10
|
+
export declare const SliderLabel: {
|
|
11
|
+
({ htmlFor: htmlForProp, id: idProp, className, children, requiredIndicator, asChild, ref, ...others }: SliderLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SliderMaxValueProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: (value: number) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const SliderMaxValue: import('react').ForwardRefExoticComponent<SliderMaxValueProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SliderMinValueProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: (value: number) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const SliderMinValue: import('react').ForwardRefExoticComponent<SliderMinValueProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import { Slider as
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
/**
|
|
5
|
-
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
6
|
-
* @default false
|
|
7
|
-
*/
|
|
8
|
-
asChild?: boolean;
|
|
9
|
-
ref?: Ref<HTMLSpanElement>;
|
|
10
|
-
}
|
|
1
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider';
|
|
2
|
+
import { ComponentProps, PropsWithChildren } from 'react';
|
|
3
|
+
export type SliderThumbProps = Omit<ComponentProps<typeof BaseSlider.Thumb>, 'render' | 'index'> & PropsWithChildren;
|
|
11
4
|
export declare const SliderThumb: {
|
|
12
|
-
({
|
|
5
|
+
({ className, ref: forwardedRef, children, ...rest }: SliderThumbProps): import("react/jsx-runtime").JSX.Element;
|
|
13
6
|
displayName: string;
|
|
14
7
|
};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import { Slider as
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
/**
|
|
5
|
-
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
6
|
-
* @default false
|
|
7
|
-
*/
|
|
8
|
-
asChild?: boolean;
|
|
9
|
-
ref?: Ref<HTMLDivElement>;
|
|
10
|
-
}
|
|
1
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
export type SliderTrackProps = Omit<ComponentProps<typeof BaseSlider.Track>, 'render'>;
|
|
11
4
|
export declare const SliderTrack: {
|
|
12
|
-
({
|
|
5
|
+
({ className, ref, ...rest }: SliderTrackProps): import("react/jsx-runtime").JSX.Element;
|
|
13
6
|
displayName: string;
|
|
14
7
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
export declare const trackVariants: (props?: (
|
|
3
|
-
shape?: "square" | "rounded" | null | undefined;
|
|
4
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
2
|
+
export declare const trackVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
5
3
|
export declare const rangeVariants: (props?: ({
|
|
6
4
|
intent?: "main" | "alert" | "error" | "support" | "accent" | "basic" | "success" | "info" | "neutral" | null | undefined;
|
|
7
|
-
shape?: "square" | "rounded" | null | undefined;
|
|
8
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
6
|
export type SliderRangeVariantsProps = VariantProps<typeof rangeVariants>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
export type SliderValueProps = Omit<ComponentProps<typeof BaseSlider.Value>, 'render'>;
|
|
4
|
+
/**
|
|
5
|
+
* Normalizes Base UI's (formattedValues, values) to single (formatted, value) for the render prop.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SliderValue: {
|
|
8
|
+
({ className, children, ref, ...rest }: SliderValueProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
package/dist/slider/index.d.mts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { Slider as Root, SliderProps } from './Slider';
|
|
2
|
+
import { SliderControl as Control, SliderControlProps } from './SliderControl';
|
|
3
|
+
import { SliderIndicator as Indicator, SliderIndicatorProps } from './SliderIndicator';
|
|
4
|
+
import { SliderLabel as Label, SliderLabelProps } from './SliderLabel';
|
|
5
|
+
import { SliderMaxValue as MaxValue, SliderMaxValueProps } from './SliderMaxValue';
|
|
6
|
+
import { SliderMinValue as MinValue, SliderMinValueProps } from './SliderMinValue';
|
|
2
7
|
import { SliderThumb as Thumb, SliderThumbProps } from './SliderThumb';
|
|
3
8
|
import { SliderTrack as Track, SliderTrackProps } from './SliderTrack';
|
|
9
|
+
import { SliderValue as Value, SliderValueProps } from './SliderValue';
|
|
4
10
|
export declare const Slider: typeof Root & {
|
|
11
|
+
Control: typeof Control;
|
|
12
|
+
Indicator: typeof Indicator;
|
|
13
|
+
Label: typeof Label;
|
|
14
|
+
MaxValue: typeof MaxValue;
|
|
15
|
+
MinValue: typeof MinValue;
|
|
5
16
|
Thumb: typeof Thumb;
|
|
6
17
|
Track: typeof Track;
|
|
18
|
+
Value: typeof Value;
|
|
7
19
|
};
|
|
8
|
-
export type { SliderProps, SliderThumbProps, SliderTrackProps };
|
|
20
|
+
export type { SliderProps, SliderControlProps, SliderIndicatorProps, SliderLabelProps, SliderMaxValueProps, SliderMinValueProps, SliderThumbProps, SliderTrackProps, SliderValueProps, };
|
package/dist/slider/index.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { Slider as Root, SliderProps } from './Slider';
|
|
2
|
+
import { SliderControl as Control, SliderControlProps } from './SliderControl';
|
|
3
|
+
import { SliderIndicator as Indicator, SliderIndicatorProps } from './SliderIndicator';
|
|
4
|
+
import { SliderLabel as Label, SliderLabelProps } from './SliderLabel';
|
|
5
|
+
import { SliderMaxValue as MaxValue, SliderMaxValueProps } from './SliderMaxValue';
|
|
6
|
+
import { SliderMinValue as MinValue, SliderMinValueProps } from './SliderMinValue';
|
|
2
7
|
import { SliderThumb as Thumb, SliderThumbProps } from './SliderThumb';
|
|
3
8
|
import { SliderTrack as Track, SliderTrackProps } from './SliderTrack';
|
|
9
|
+
import { SliderValue as Value, SliderValueProps } from './SliderValue';
|
|
4
10
|
export declare const Slider: typeof Root & {
|
|
11
|
+
Control: typeof Control;
|
|
12
|
+
Indicator: typeof Indicator;
|
|
13
|
+
Label: typeof Label;
|
|
14
|
+
MaxValue: typeof MaxValue;
|
|
15
|
+
MinValue: typeof MinValue;
|
|
5
16
|
Thumb: typeof Thumb;
|
|
6
17
|
Track: typeof Track;
|
|
18
|
+
Value: typeof Value;
|
|
7
19
|
};
|
|
8
|
-
export type { SliderProps, SliderThumbProps, SliderTrackProps };
|
|
20
|
+
export type { SliderProps, SliderControlProps, SliderIndicatorProps, SliderLabelProps, SliderMaxValueProps, SliderMinValueProps, SliderThumbProps, SliderTrackProps, SliderValueProps, };
|
package/dist/slider/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),N=require("@base-ui/react/slider"),X=require("@spark-ui/components/form-field"),t=require("react"),S=require("class-variance-authority"),M=require("@spark-ui/hooks/use-merge-refs"),H=require("../FormFieldRequiredIndicator-CHfcoT2y.js"),J=require("../label/index.js"),K=require("../Slot-DQ8z2zsy.js"),Q=S.cva(["grid grid-cols-[1fr_auto] gap-y-sm gap-x-md relative","touch-none select-none","data-disabled:cursor-not-allowed data-disabled:opacity-dim-3"]),$=t.createContext({}),C=()=>t.useContext($),B=({intent:r="basic",children:e,className:a,ref:n,value:o,defaultValue:d,disabled:f,readOnly:v,name:s,onValueChange:c,onValueCommit:m,min:b=0,max:g=100,...h})=>{const l=X.useFormFieldControl(),x=l.disabled??f,p=l.readOnly??v,y=l.name??s,[I,R]=t.useState(l.labelId),[V,T]=t.useState(0),k=t.useRef(null),_=t.useRef(null),D=t.useCallback(u=>{R(u)},[]),G=t.useCallback(()=>(T(u=>u+1),()=>T(u=>u-1)),[]);return i.jsx($.Provider,{value:{intent:r,min:b,max:g,fieldLabelId:l.labelId||I,fieldId:l.id,onLabelId:D,hasValueInThumb:V>0,registerValueInThumb:G,controlRef:k,thumbRef:_},children:i.jsx(N.Slider.Root,{ref:n,"data-spark-component":"slider",className:Q({className:a}),orientation:"horizontal",disabled:x||p,thumbAlignment:"edge",name:y,"aria-describedby":l.description,"aria-invalid":l.isInvalid,"aria-disabled":x||p?!0:void 0,value:o!==void 0?[o]:void 0,defaultValue:d!==void 0?[d]:void 0,onValueChange:c?u=>{const j=Array.isArray(u)?u[0]??0:u;c(j)}:void 0,onValueCommitted:m?u=>{const j=Array.isArray(u)?u[0]??0:u;m(j)}:void 0,min:b,max:g,...h,children:e})})};B.displayName="Slider";const z=({className:r,ref:e,...a})=>{const{hasValueInThumb:n,controlRef:o}=C(),d=M.useMergeRefs(o,e);return i.jsx(N.Slider.Control,{"data-spark-component":"slider-control",ref:d,className:S.cx("min-h-sz-24 relative col-span-2 flex w-full min-w-0 flex-1 items-center",n&&"mt-xl",r),...a})};z.displayName="Slider.Control";const U=S.cva(["relative grow h-sz-4 bg-on-background/dim-4 rounded-sm"]),Y=S.cva(["absolute h-full rounded-sm","transition-none"],{variants:{intent:{main:["bg-main"],support:["bg-support"],accent:["bg-accent"],basic:["bg-basic"],info:["bg-info"],neutral:["bg-neutral"],success:["bg-success"],alert:["bg-alert"],error:["bg-error"]}},defaultVariants:{intent:"basic"}}),q=({className:r,ref:e,...a})=>{const{intent:n}=C();return i.jsx(N.Slider.Indicator,{"data-spark-component":"slider-indicator",ref:e,className:Y({intent:n,className:r}),...a})};q.displayName="Slider.Indicator";const Z=":slider-label",F=({htmlFor:r,id:e,className:a,children:n,requiredIndicator:o=i.jsx(H.FormFieldRequiredIndicator,{}),asChild:d,ref:f,...v})=>{const s=X.useFormFieldControl(),{fieldLabelId:c,fieldId:m,onLabelId:b}=C(),g=t.useId(),h=`${Z}-${g}`,l=e||c||s.labelId||h,x=d?void 0:r||m||s.id,p=s.disabled,y=s.isRequired,I=t.useRef(null),R=M.useMergeRefs(f,I);return t.useEffect(()=>{b&&!c&&!s.labelId&&b(l)},[b,c,s.labelId,l]),i.jsx(J.Label,{ref:R,id:l,"data-spark-component":"slider-label",htmlFor:x,className:S.cx(p?"text-on-surface/dim-3 pointer-events-none":void 0,a),asChild:d,...v,children:i.jsxs(i.Fragment,{children:[i.jsx(K.Slottable,{children:n}),y&&o]})})};F.displayName="Slider.Label";const L=t.forwardRef(({className:r,children:e},a)=>{const{max:n=100}=C(),o=e?e(n):n;return i.jsx("div",{"data-spark-component":"slider-max-value",ref:a,className:S.cx("text-on-surface/dim-1 text-body-2 col-start-2 text-right",r),children:o})});L.displayName="Slider.MaxValue";const w=t.forwardRef(({className:r,children:e},a)=>{const{min:n=0}=C(),o=e?e(n):n;return i.jsx("div",{"data-spark-component":"slider-min-value",ref:a,className:S.cx("text-on-surface/dim-1 text-body-2 col-start-1 text-left",r),children:o})});w.displayName="Slider.MinValue";const P=t.createContext(null),ee=()=>t.useContext(P),te=S.cva(["relative block size-sz-24 rounded-full cursor-pointer","outline-hidden","has-focus-visible:ring-2 has-focus-visible:ring-offset-2 has-focus-visible:ring-focus","data-disabled:hover:ring-0 data-disabled:cursor-not-allowed data-disabled:before:hidden","after:absolute after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2","after:size-sz-24 after:rounded-full","before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2","before:size-sz-24 before:rounded-full before:border-solid before:border-sm before:transition-all before:duration-75","hover:before:size-sz-32 data-dragging:before:size-sz-32"],{variants:{intent:{main:["after:bg-main","before:bg-main-container before:border-main"],support:["after:bg-support","before:bg-support-container before:border-support"],accent:["after:bg-accent","before:bg-accent-container before:border-accent"],basic:["after:bg-basic","before:bg-basic-container before:border-basic"],info:["after:bg-info","before:bg-info-container before:border-info"],neutral:["after:bg-neutral","before:bg-neutral-container before:border-neutral"],success:["after:bg-success","before:bg-success-container before:border-success"],alert:["after:bg-alert","before:bg-alert-container before:border-alert"],error:["after:bg-error","before:bg-error-container before:border-error"]}},defaultVariants:{intent:"basic"}}),A=({className:r,ref:e,children:a,...n})=>{const{intent:o,fieldLabelId:d,fieldId:f,thumbRef:v}=C(),s=t.useRef(null),c=M.useMergeRefs(v,e??s);return i.jsx(P.Provider,{value:{isInsideThumb:!0},children:i.jsx(N.Slider.Thumb,{"data-spark-component":"slider-thumb",ref:c,id:f,className:te({intent:o,className:r}),"aria-labelledby":d,...n,children:a})})};A.displayName="Slider.Thumb";const O=({className:r,ref:e,...a})=>i.jsx(N.Slider.Track,{"data-spark-component":"slider-track",ref:e,className:U({className:r}),...a});O.displayName="Slider.Track";function re(r,e,a,n){const[o,d]=t.useState(0),[f,v]=t.useState(!1);return t.useLayoutEffect(()=>{const s=r.current,c=e.current,m=a.current;if(!s||!c||!m){d(0),f||requestAnimationFrame(()=>v(!0));return}let b=!1;const g=()=>{if(b)return;const l=s.getBoundingClientRect(),x=c.getBoundingClientRect(),p=m.scrollWidth;if(p===0){requestAnimationFrame(g);return}const y=x.left-l.left+x.width/2,I=p/2,R=l.width-p/2,T=Math.max(I,Math.min(R,y))-y;d(k=>k!==T?T:k)};g();const h=new ResizeObserver(g);return h.observe(s),h.observe(m),()=>{b=!0,h.disconnect()}},[r,e,a,n,f]),o}const E=({className:r,children:e,ref:a,...n})=>{const{registerValueInThumb:o,controlRef:d,thumbRef:f}=C(),s=ee()!==null,c=t.useRef(null),m=M.useMergeRefs(c,a),[b,g]=t.useState(0),h=re(d,f,c,b);t.useEffect(()=>{if(s)return o()},[s,o]);const l=S.cx(s?"absolute left-1/2 -translate-x-1/2 top-[calc(-100%-var(--spacing-sm))] text-body-1 font-bold whitespace-nowrap":"default:text-body-1 col-start-2 text-right default:font-bold",r),x=t.useCallback((y,I)=>{const R=y[0]??String(I[0]??""),V=I[0]??0;return g(V),typeof e=="function"?e(R,V):R},[e]),p=s?{transform:`translate(calc(0% + ${h}px), 0)`}:void 0;return i.jsx(N.Slider.Value,{"data-spark-component":"slider-value",ref:m,className:l,style:p,...n,children:x})};E.displayName="Slider.Value";const W=Object.assign(B,{Control:z,Indicator:q,Label:F,MaxValue:L,MinValue:w,Thumb:A,Track:O,Value:E});W.displayName="Slider";z.displayName="Slider.Control";q.displayName="Slider.Indicator";F.displayName="Slider.Label";L.displayName="Slider.MaxValue";w.displayName="Slider.MinValue";A.displayName="Slider.Thumb";O.displayName="Slider.Track";E.displayName="Slider.Value";exports.Slider=W;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/slider/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/slider/Slider.styles.ts","../../src/slider/SliderContext.tsx","../../src/slider/Slider.tsx","../../src/slider/SliderThumb.styles.ts","../../src/slider/SliderThumb.tsx","../../src/slider/SliderTrack.styles.ts","../../src/slider/SliderTrack.tsx","../../src/slider/index.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex relative h-sz-24 items-center',\n 'touch-none select-none',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-dim-3',\n])\n","import { createContext, useContext } from 'react'\n\nimport type { SliderProps } from './Slider'\n\nexport type SliderContextInterface = Pick<SliderProps, 'intent' | 'shape'> & {\n fieldLabelId?: string\n fieldId?: string\n}\n\nexport const SliderContext = createContext<SliderContextInterface>({} as SliderContextInterface)\n\nexport const useSliderContext = () => useContext(SliderContext)\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { Slider as RadixSlider } from 'radix-ui'\nimport { type PropsWithChildren, Ref } from 'react'\n\nimport { rootStyles } from './Slider.styles'\nimport { SliderContext } from './SliderContext'\nimport type { SliderRangeVariantsProps } from './SliderTrack.styles'\n\nexport interface SliderProps\n extends Omit<\n RadixSlider.SliderProps,\n 'dir' | 'orientation' | 'inverted' | 'minStepsBetweenThumbs'\n >,\n PropsWithChildren<SliderRangeVariantsProps> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean\n /**\n * The value of the slider when initially rendered. Use when you do not need to control the state of the slider.\n */\n defaultValue?: number[]\n /**\n * The controlled value of the slider. Must be used in conjunction with `onValueChange`.\n */\n value?: number[]\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: number[]) => void\n /**\n * Event handler called when the value changes at the end of an interaction. Useful when you only need to capture a final value e.g. to update a backend service.\n */\n onValueCommit?: (value: number[]) => void\n /**\n * The name of the slider. Submitted with its owning form as part of a name/value pair.\n * If wrapped with a FormField with a name, will be inherited from it.\n */\n name?: string\n /**\n * When `true`, prevents the user from interacting with the slider.\n * @default false\n */\n disabled?: boolean\n /**\n * Sets the slider as interactive or not.\n */\n readOnly?: boolean\n /**\n * The minimum value for the range.\n * @default 0\n */\n min?: number\n /**\n * The maximum value for the range.\n * @default 100\n */\n max?: number\n /**\n * The stepping interval.\n * @default 1\n */\n step?: number\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Slider = ({\n asChild = false,\n intent = 'basic',\n shape = 'square',\n children,\n className,\n ref,\n disabled: disabledProp,\n readOnly: readOnlyProp,\n name: nameProp,\n ...rest\n}: SliderProps) => {\n const field = useFormFieldControl()\n\n const disabled = field.disabled ?? disabledProp\n const readOnly = field.readOnly ?? readOnlyProp\n const name = field.name ?? nameProp\n\n console.log('✅ field ', field.disabled)\n\n return (\n <SliderContext.Provider\n value={{\n intent,\n shape,\n fieldLabelId: field.labelId,\n fieldId: field.id,\n }}\n >\n <RadixSlider.Root\n ref={ref}\n data-spark-component=\"slider\"\n asChild={asChild}\n className={rootStyles({ className })}\n dir=\"ltr\"\n orientation=\"horizontal\"\n inverted={false}\n minStepsBetweenThumbs={0}\n disabled={disabled || readOnly}\n name={name}\n aria-describedby={field.description}\n aria-invalid={field.isInvalid}\n {...rest}\n >\n {children}\n </RadixSlider.Root>\n </SliderContext.Provider>\n )\n}\n\nSlider.displayName = 'Slider'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const thumbVariants = cva(\n [\n 'block h-sz-24 w-sz-24 rounded-full cursor-pointer',\n 'outline-hidden',\n 'focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-focus',\n 'data-[interaction=pointerdown]:focus-visible:ring-0!',\n 'data-disabled:hover:ring-0 data-disabled:hover:after:w-0 data-disabled:hover:after:h-0 data-disabled:cursor-not-allowed',\n 'after:absolute after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2 after:z-hide',\n 'after:w-0 after:h-0 after:rounded-full after:border-solid after:border-sm after:transition-all duration-300',\n 'hover:after:w-sz-32 hover:after:h-sz-32',\n ],\n {\n variants: {\n intent: {\n main: ['bg-main', 'after:bg-main-container after:border-main'],\n support: ['bg-support', 'after:bg-support-container after:border-support'],\n accent: ['bg-accent', 'after:bg-accent-container after:border-accent'],\n basic: ['bg-basic', 'after:bg-basic-container after:border-basic'],\n info: ['bg-info', 'after:bg-info-container after:border-info'],\n neutral: ['bg-neutral', 'after:bg-neutral-container after:border-neutral'],\n success: ['bg-success', 'after:bg-success-container after:border-success'],\n alert: ['bg-alert', 'after:bg-alert-container after:border-alert'],\n error: ['bg-error', 'after:bg-error-container after:border-error'],\n },\n },\n defaultVariants: {\n intent: 'basic',\n },\n }\n)\n\nexport type SliderThumbVariantsProps = VariantProps<typeof thumbVariants>\n","import { Slider as RadixSlider } from 'radix-ui'\nimport { type FocusEvent, type KeyboardEvent, type PointerEvent, Ref, useRef } from 'react'\n\nimport { useSliderContext } from './SliderContext'\nimport { thumbVariants } from './SliderThumb.styles'\n\nexport interface SliderThumbProps extends RadixSlider.SliderThumbProps {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const SliderThumb = ({\n asChild = false,\n className,\n onPointerDown,\n onKeyDown,\n onBlur,\n ref: forwardedRef,\n ...rest\n}: SliderThumbProps) => {\n const { intent, fieldLabelId, fieldId } = useSliderContext()\n\n const innerRef = useRef(null)\n const ref = forwardedRef || innerRef\n\n const setInteractionType = (e: KeyboardEvent | FocusEvent | PointerEvent) => {\n /**\n * Radix Slider implementation uses `.focus()` and thus prevent us to handle\n * distinctively focus/focus-visible styles. So we use a `data-interaction` attribute to stay\n * aware of the type of event, and adapt styles if needed.\n */\n if (typeof ref === 'function' || !ref.current) return\n ref.current.dataset.interaction = e.type\n }\n\n return (\n <RadixSlider.Thumb\n data-spark-component=\"slider-thumb\"\n ref={ref}\n asChild={asChild}\n id={fieldId}\n onPointerDown={(e: PointerEvent<HTMLSpanElement>) => {\n setInteractionType(e)\n onPointerDown?.(e)\n }}\n onKeyDown={(e: KeyboardEvent<HTMLSpanElement>) => {\n setInteractionType(e)\n onKeyDown?.(e)\n }}\n onBlur={(e: FocusEvent<HTMLSpanElement>) => {\n setInteractionType(e)\n onBlur?.(e)\n }}\n className={thumbVariants({ intent, className })}\n aria-labelledby={fieldLabelId}\n {...rest}\n />\n )\n}\n\nSliderThumb.displayName = 'Slider.Thumb'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const trackVariants = cva(['relative grow h-sz-4 bg-on-background/dim-4'], {\n variants: {\n shape: {\n rounded: 'rounded-sm',\n square: 'rounded-0',\n },\n },\n defaultVariants: {\n shape: 'square',\n },\n})\n\nexport const rangeVariants = cva(['absolute h-full'], {\n variants: {\n intent: {\n main: ['bg-main'],\n support: ['bg-support'],\n accent: ['bg-accent'],\n basic: ['bg-basic'],\n info: ['bg-info'],\n neutral: ['bg-neutral'],\n success: ['bg-success'],\n alert: ['bg-alert'],\n error: ['bg-error'],\n },\n shape: {\n rounded: 'rounded-sm',\n square: 'rounded-0',\n },\n },\n defaultVariants: {\n intent: 'basic',\n shape: 'square',\n },\n})\n\nexport type SliderRangeVariantsProps = VariantProps<typeof rangeVariants>\n","import { Slider as RadixSlider } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { useSliderContext } from './SliderContext'\nimport { rangeVariants, trackVariants } from './SliderTrack.styles'\n\nexport interface SliderTrackProps\n extends RadixSlider.SliderTrackProps,\n RadixSlider.SliderRangeProps {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const SliderTrack = ({ asChild = false, className, ref, ...rest }: SliderTrackProps) => {\n const { intent, shape } = useSliderContext()\n\n return (\n <RadixSlider.Track\n data-spark-component=\"slider-track\"\n ref={ref}\n asChild={asChild}\n className={trackVariants({ shape })}\n {...rest}\n >\n <RadixSlider.Range className={rangeVariants({ intent, shape, className })} />\n </RadixSlider.Track>\n )\n}\n\nSliderTrack.displayName = 'Slider.Track'\n","import { Slider as Root, type SliderProps } from './Slider'\nimport { SliderThumb as Thumb, type SliderThumbProps } from './SliderThumb'\nimport { SliderTrack as Track, type SliderTrackProps } from './SliderTrack'\n\nexport const Slider: typeof Root & {\n Thumb: typeof Thumb\n Track: typeof Track\n} = Object.assign(Root, {\n Thumb,\n Track,\n})\n\nSlider.displayName = 'Slider'\nThumb.displayName = 'Slider.Thumb'\nTrack.displayName = 'Slider.Track'\n\nexport type { SliderProps, SliderThumbProps, SliderTrackProps }\n"],"names":["rootStyles","cva","SliderContext","createContext","useSliderContext","useContext","Slider","asChild","intent","shape","children","className","ref","disabledProp","readOnlyProp","nameProp","rest","field","useFormFieldControl","disabled","readOnly","name","jsx","RadixSlider","thumbVariants","SliderThumb","onPointerDown","onKeyDown","onBlur","forwardedRef","fieldLabelId","fieldId","innerRef","useRef","setInteractionType","trackVariants","rangeVariants","SliderTrack","Root","Thumb","Track"],"mappings":"iPAEaA,EAAaC,EAAAA,IAAI,CAC5B,qCACA,yBACA,8DACF,CAAC,ECGYC,EAAgBC,EAAAA,cAAsC,EAA4B,EAElFC,EAAmB,IAAMC,EAAAA,WAAWH,CAAa,ECwDjDI,EAAS,CAAC,CACrB,QAAAC,EAAU,GACV,OAAAC,EA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T,OAAQ,WAAA,CACV,EAEF,gBAAiB,CACf,OAAQ,QACR,MAAO,QAAA,CAEX,CAAC,ECnBYoC,EAAc,CAAC,CAAE,QAAA9B,EAAU,GAAO,UAAAI,EAAW,IAAAC,EAAK,GAAGI,KAA6B,CAC7F,KAAM,CAAE,OAAAR,EAAQ,MAAAC,CAAA,EAAUL,EAAA,EAE1B,OACEkB,EAAAA,IAACC,EAAAA,OAAY,MAAZ,CACC,uBAAqB,eACrB,IAAAX,EACA,QAAAL,EACA,UAAW4B,EAAc,CAAE,MAAA1B,EAAO,EACjC,GAAGO,EAEJ,SAAAM,EAAAA,IAACC,SAAY,MAAZ,CAAkB,UAAWa,EAAc,CAAE,OAAA5B,EAAQ,MAAAC,EAAO,UAAAE,CAAA,CAAW,CAAA,CAAG,CAAA,CAAA,CAGjF,EAEA0B,EAAY,YAAc,eC7BnB,MAAM/B,EAGT,OAAO,OAAOgC,EAAM,CAAA,MACtBC,EAAA,MACAC,CACF,CAAC,EAEDlC,EAAO,YAAc,SACrBiC,EAAM,YAAc,eACpBC,EAAM,YAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/slider/Slider.styles.ts","../../src/slider/SliderContext.tsx","../../src/slider/Slider.tsx","../../src/slider/SliderControl.tsx","../../src/slider/SliderTrack.styles.ts","../../src/slider/SliderIndicator.tsx","../../src/slider/SliderLabel.tsx","../../src/slider/SliderMaxValue.tsx","../../src/slider/SliderMinValue.tsx","../../src/slider/SliderThumbContext.tsx","../../src/slider/SliderThumb.styles.ts","../../src/slider/SliderThumb.tsx","../../src/slider/SliderTrack.tsx","../../src/slider/useSliderValueBoundaries.ts","../../src/slider/SliderValue.tsx","../../src/slider/index.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'grid grid-cols-[1fr_auto] gap-y-sm gap-x-md relative',\n 'touch-none select-none',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-dim-3',\n])\n","import type { RefObject } from 'react'\nimport { createContext, useContext } from 'react'\n\nimport type { SliderProps } from './Slider'\n\nexport type SliderContextInterface = Pick<SliderProps, 'intent' | 'min' | 'max'> & {\n fieldLabelId?: string\n fieldId?: string\n onLabelId?: (id: string | undefined) => void\n hasValueInThumb: boolean\n registerValueInThumb: () => () => void\n controlRef: RefObject<HTMLElement | null>\n thumbRef: RefObject<HTMLElement | null>\n}\n\nexport const SliderContext = createContext<SliderContextInterface>({} as SliderContextInterface)\n\nexport const useSliderContext = () => useContext(SliderContext)\n","import { Slider as BaseSlider } from '@base-ui/react/slider'\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { ComponentProps, type PropsWithChildren, Ref, useCallback, useRef, useState } from 'react'\n\nimport { rootStyles } from './Slider.styles'\nimport { SliderContext } from './SliderContext'\nimport type { SliderRangeVariantsProps } from './SliderTrack.styles'\n\nexport interface SliderProps\n extends Omit<\n ComponentProps<typeof BaseSlider.Root>,\n 'render' | 'orientation' | 'onValueChange' | 'onValueCommitted'\n >,\n PropsWithChildren<SliderRangeVariantsProps> {\n /**\n * The value of the slider when initially rendered. Use when you do not need to control the state of the slider.\n */\n defaultValue?: number\n /**\n * The controlled value of the slider. Must be used in conjunction with `onValueChange`.\n */\n value?: number\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: number) => void\n /**\n * Event handler called when the value changes at the end of an interaction. Useful when you only need to capture a final value e.g. to update a backend service.\n */\n onValueCommit?: (value: number) => void\n /**\n * The name of the slider. Submitted with its owning form as part of a name/value pair.\n * If wrapped with a FormField with a name, will be inherited from it.\n */\n name?: string\n /**\n * When `true`, prevents the user from interacting with the slider.\n * @default false\n */\n disabled?: boolean\n /**\n * Sets the slider as interactive or not.\n */\n readOnly?: boolean\n /**\n * The minimum value for the range.\n * @default 0\n */\n min?: number\n /**\n * The maximum value for the range.\n * @default 100\n */\n max?: number\n /**\n * The stepping interval.\n * @default 1\n */\n step?: number\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Slider = ({\n intent = 'basic',\n children,\n className,\n ref,\n value: valueProp,\n defaultValue: defaultValueProp,\n disabled: disabledProp,\n readOnly: readOnlyProp,\n name: nameProp,\n onValueChange,\n onValueCommit,\n min = 0,\n max = 100,\n ...rest\n}: SliderProps) => {\n const field = useFormFieldControl()\n\n const disabled = field.disabled ?? disabledProp\n const readOnly = field.readOnly ?? readOnlyProp\n const name = field.name ?? nameProp\n\n const [labelId, setLabelId] = useState<string | undefined>(field.labelId)\n const [valueInThumbCount, setValueInThumbCount] = useState(0)\n const controlRef = useRef<HTMLElement | null>(null)\n const thumbRef = useRef<HTMLElement | null>(null)\n\n const handleLabelId = useCallback((id: string | undefined) => {\n setLabelId(id)\n }, [])\n\n const registerValueInThumb = useCallback(() => {\n setValueInThumbCount(c => c + 1)\n return () => setValueInThumbCount(c => c - 1)\n }, [])\n\n return (\n <SliderContext.Provider\n value={{\n intent,\n min,\n max,\n fieldLabelId: field.labelId || labelId,\n fieldId: field.id,\n onLabelId: handleLabelId,\n hasValueInThumb: valueInThumbCount > 0,\n registerValueInThumb,\n controlRef,\n thumbRef,\n }}\n >\n <BaseSlider.Root\n ref={ref}\n data-spark-component=\"slider\"\n className={rootStyles({ className })}\n orientation=\"horizontal\"\n disabled={disabled || readOnly}\n thumbAlignment=\"edge\"\n name={name}\n aria-describedby={field.description}\n aria-invalid={field.isInvalid}\n aria-disabled={disabled || readOnly ? true : undefined}\n value={valueProp !== undefined ? [valueProp] : undefined}\n defaultValue={\n defaultValueProp !== undefined ? [defaultValueProp] : undefined\n }\n onValueChange={\n onValueChange\n ? (value: number | readonly number[]) => {\n const v = Array.isArray(value) ? value[0] ?? 0 : value\n onValueChange(v)\n }\n : undefined\n }\n onValueCommitted={\n onValueCommit\n ? (value: number | readonly number[]) => {\n const v = Array.isArray(value) ? value[0] ?? 0 : value\n onValueCommit(v)\n }\n : undefined\n }\n min={min}\n max={max}\n {...rest}\n >\n {children}\n </BaseSlider.Root>\n </SliderContext.Provider>\n )\n}\n\nSlider.displayName = 'Slider'\n","import { Slider as BaseSlider } from '@base-ui/react/slider'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps } from 'react'\n\nimport { useSliderContext } from './SliderContext'\n\nexport type SliderControlProps = Omit<ComponentProps<typeof BaseSlider.Control>, 'render'>\n\nexport const SliderControl = ({ className, ref, ...rest }: SliderControlProps) => {\n const { hasValueInThumb, controlRef } = useSliderContext()\n const mergedRef = useMergeRefs(controlRef, ref)\n\n return (\n <BaseSlider.Control\n data-spark-component=\"slider-control\"\n ref={mergedRef}\n className={cx(\n 'min-h-sz-24 relative col-span-2 flex w-full min-w-0 flex-1 items-center',\n hasValueInThumb && 'mt-xl',\n className\n )}\n {...rest}\n />\n )\n}\n\nSliderControl.displayName = 'Slider.Control'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const trackVariants = cva(['relative grow h-sz-4 bg-on-background/dim-4 rounded-sm'])\n\nexport const rangeVariants = cva(\n [\n 'absolute h-full rounded-sm',\n // Disable transitions during drag to eliminate latency\n 'transition-none',\n ],\n {\n variants: {\n intent: {\n main: ['bg-main'],\n support: ['bg-support'],\n accent: ['bg-accent'],\n basic: ['bg-basic'],\n info: ['bg-info'],\n neutral: ['bg-neutral'],\n success: ['bg-success'],\n alert: ['bg-alert'],\n error: ['bg-error'],\n },\n },\n defaultVariants: {\n intent: 'basic',\n },\n }\n)\n\nexport type SliderRangeVariantsProps = VariantProps<typeof rangeVariants>\n","import { Slider as BaseSlider } from '@base-ui/react/slider'\nimport { ComponentProps } from 'react'\n\nimport { useSliderContext } from './SliderContext'\nimport { rangeVariants } from './SliderTrack.styles'\n\nexport type SliderIndicatorProps = Omit<ComponentProps<typeof BaseSlider.Indicator>, 'render'>\n\nexport const SliderIndicator = ({ className, ref, ...rest }: SliderIndicatorProps) => {\n const { intent } = useSliderContext()\n\n return (\n <BaseSlider.Indicator\n data-spark-component=\"slider-indicator\"\n ref={ref}\n className={rangeVariants({ intent, className })}\n {...rest}\n />\n )\n}\n\nSliderIndicator.displayName = 'Slider.Indicator'\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { cx } from 'class-variance-authority'\nimport { ReactNode, Ref, useEffect, useId, useRef } from 'react'\n\nimport { FormFieldRequiredIndicator } from '../form-field/FormFieldRequiredIndicator'\nimport { Label, LabelProps } from '../label'\nimport { Slottable } from '../slot'\nimport { useSliderContext } from './SliderContext'\n\nconst ID_PREFIX = ':slider-label'\n\nexport interface SliderLabelProps extends LabelProps {\n /**\n * Element shown when the input is required inside the label.\n */\n requiredIndicator?: ReactNode\n ref?: Ref<HTMLLabelElement>\n}\n\nexport const SliderLabel = ({\n htmlFor: htmlForProp,\n id: idProp,\n className,\n children,\n requiredIndicator = <FormFieldRequiredIndicator />,\n asChild,\n ref,\n ...others\n}: SliderLabelProps) => {\n const field = useFormFieldControl()\n const { fieldLabelId, fieldId, onLabelId } = useSliderContext()\n\n // Generate an id if not provided and no FormField labelId is available\n const internalId = useId()\n const generatedId = `${ID_PREFIX}-${internalId}`\n const labelId = idProp || fieldLabelId || field.labelId || generatedId\n\n // Use FormField id for htmlFor if present, otherwise use fieldId from context, or the prop\n const htmlFor = asChild ? undefined : htmlForProp || fieldId || field.id\n\n // Get disabled and required state from FormField if present\n const disabled = field.disabled\n const isRequired = field.isRequired\n\n // Notify SliderContext of the label id if no FormField is present\n const labelRef = useRef<HTMLLabelElement>(null)\n const mergedRef = useMergeRefs(ref, labelRef)\n\n useEffect(() => {\n if (onLabelId && !fieldLabelId && !field.labelId) {\n onLabelId(labelId)\n }\n }, [onLabelId, fieldLabelId, field.labelId, labelId])\n\n return (\n <Label\n ref={mergedRef}\n id={labelId}\n data-spark-component=\"slider-label\"\n htmlFor={htmlFor}\n className={cx(disabled ? 'text-on-surface/dim-3 pointer-events-none' : undefined, className)}\n asChild={asChild}\n {...others}\n >\n <>\n <Slottable>{children}</Slottable>\n {isRequired && requiredIndicator}\n </>\n </Label>\n )\n}\n\nSliderLabel.displayName = 'Slider.Label'\n","import { cx } from 'class-variance-authority'\nimport { forwardRef, type ReactNode } from 'react'\n\nimport { useSliderContext } from './SliderContext'\n\nexport interface SliderMaxValueProps {\n className?: string\n children?: (value: number) => ReactNode\n}\n\nexport const SliderMaxValue = forwardRef<HTMLDivElement, SliderMaxValueProps>(\n ({ className, children }, ref) => {\n const { max = 100 } = useSliderContext()\n\n const content = children ? children(max) : max\n\n return (\n <div\n data-spark-component=\"slider-max-value\"\n ref={ref}\n className={cx('text-on-surface/dim-1 text-body-2 col-start-2 text-right', className)}\n >\n {content}\n </div>\n )\n }\n)\n\nSliderMaxValue.displayName = 'Slider.MaxValue'\n","import { cx } from 'class-variance-authority'\nimport { forwardRef, type ReactNode } from 'react'\n\nimport { useSliderContext } from './SliderContext'\n\nexport interface SliderMinValueProps {\n className?: string\n children?: (value: number) => ReactNode\n}\n\nexport const SliderMinValue = forwardRef<HTMLDivElement, SliderMinValueProps>(\n ({ className, children }, ref) => {\n const { min = 0 } = useSliderContext()\n\n const content = children ? children(min) : min\n\n return (\n <div\n data-spark-component=\"slider-min-value\"\n ref={ref}\n className={cx('text-on-surface/dim-1 text-body-2 col-start-1 text-left', className)}\n >\n {content}\n </div>\n )\n }\n)\n\nSliderMinValue.displayName = 'Slider.MinValue'\n","import { createContext, useContext } from 'react'\n\nexport interface SliderThumbContextValue {\n isInsideThumb: true\n}\n\nexport const SliderThumbContext = createContext<SliderThumbContextValue | null>(null)\n\nexport const useSliderThumbContext = () => useContext(SliderThumbContext)\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const thumbVariants = cva(\n [\n 'relative block size-sz-24 rounded-full cursor-pointer',\n 'outline-hidden',\n 'has-focus-visible:ring-2 has-focus-visible:ring-offset-2 has-focus-visible:ring-focus',\n 'data-disabled:hover:ring-0 data-disabled:cursor-not-allowed data-disabled:before:hidden',\n // visual thumb\n 'after:absolute after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2',\n 'after:size-sz-24 after:rounded-full',\n // hover effect\n 'before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2',\n 'before:size-sz-24 before:rounded-full before:border-solid before:border-sm before:transition-all before:duration-75',\n 'hover:before:size-sz-32 data-dragging:before:size-sz-32',\n ],\n {\n variants: {\n intent: {\n main: ['after:bg-main', 'before:bg-main-container before:border-main'],\n support: ['after:bg-support', 'before:bg-support-container before:border-support'],\n accent: ['after:bg-accent', 'before:bg-accent-container before:border-accent'],\n basic: ['after:bg-basic', 'before:bg-basic-container before:border-basic'],\n info: ['after:bg-info', 'before:bg-info-container before:border-info'],\n neutral: ['after:bg-neutral', 'before:bg-neutral-container before:border-neutral'],\n success: ['after:bg-success', 'before:bg-success-container before:border-success'],\n alert: ['after:bg-alert', 'before:bg-alert-container before:border-alert'],\n error: ['after:bg-error', 'before:bg-error-container before:border-error'],\n },\n },\n defaultVariants: {\n intent: 'basic',\n },\n }\n)\n\nexport type SliderThumbVariantsProps = VariantProps<typeof thumbVariants>\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { Slider as BaseSlider } from '@base-ui/react/slider'\nimport { ComponentProps, type PropsWithChildren, useRef } from 'react'\n\nimport { useSliderContext } from './SliderContext'\nimport { SliderThumbContext } from './SliderThumbContext'\nimport { thumbVariants } from './SliderThumb.styles'\n\nexport type SliderThumbProps = Omit<\n ComponentProps<typeof BaseSlider.Thumb>,\n 'render' | 'index'\n> &\n PropsWithChildren\n\nexport const SliderThumb = ({\n className,\n ref: forwardedRef,\n children,\n ...rest\n}: SliderThumbProps) => {\n const { intent, fieldLabelId, fieldId, thumbRef: contextThumbRef } = useSliderContext()\n\n const innerRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(contextThumbRef, forwardedRef ?? innerRef)\n\n return (\n <SliderThumbContext.Provider value={{ isInsideThumb: true }}>\n <BaseSlider.Thumb\n data-spark-component=\"slider-thumb\"\n ref={ref}\n id={fieldId}\n className={thumbVariants({ intent, className })}\n aria-labelledby={fieldLabelId}\n {...rest}\n >\n {children}\n </BaseSlider.Thumb>\n </SliderThumbContext.Provider>\n )\n}\n\nSliderThumb.displayName = 'Slider.Thumb'\n","import { Slider as BaseSlider } from '@base-ui/react/slider'\nimport { ComponentProps } from 'react'\n\nimport { trackVariants } from './SliderTrack.styles'\n\nexport type SliderTrackProps = Omit<ComponentProps<typeof BaseSlider.Track>, 'render'>\n\nexport const SliderTrack = ({ className, ref, ...rest }: SliderTrackProps) => {\n return (\n <BaseSlider.Track\n data-spark-component=\"slider-track\"\n ref={ref}\n className={trackVariants({ className })}\n {...rest}\n />\n )\n}\n\nSliderTrack.displayName = 'Slider.Track'\n","import type { RefObject } from 'react'\nimport { useLayoutEffect, useState } from 'react'\n\n/**\n * Computes the translateX (in pixels) to apply to the value element so it stays\n * within the horizontal bounds of the slider control when displayed inside the thumb.\n *\n * @param controlRef - Ref to the slider control (track container)\n * @param thumbRef - Ref to the thumb element\n * @param valueRef - Ref to the value label element\n * @param value - Current slider value (0–100 or min–max), used to re-run when thumb moves\n * @returns translateX in pixels (positive = right, negative = left), or 0 if refs are missing\n */\nexport function useSliderValueBoundaries(\n controlRef: RefObject<HTMLElement | null>,\n thumbRef: RefObject<HTMLElement | null>,\n valueRef: RefObject<HTMLElement | null>,\n value: number\n): number {\n const [translateX, setTranslateX] = useState(0)\n const [refsRetryScheduled, setRefsRetryScheduled] = useState(false)\n\n useLayoutEffect(() => {\n const control = controlRef.current\n const thumb = thumbRef.current\n const valueEl = valueRef.current\n\n if (!control || !thumb || !valueEl) {\n setTranslateX(0)\n // Re-run once on next frame when refs may be set (e.g. Slider.Value mounts after Control/Thumb)\n if (!refsRetryScheduled) {\n requestAnimationFrame(() => setRefsRetryScheduled(true))\n }\n\n return\n }\n\n let cancelled = false\n\n const compute = () => {\n if (cancelled) return\n\n const controlRect = control.getBoundingClientRect()\n const thumbRect = thumb.getBoundingClientRect()\n const valueWidth = valueEl.scrollWidth\n\n // Skip until value label has been laid out (content from render prop may not be ready on first paint)\n if (valueWidth === 0) {\n requestAnimationFrame(compute)\n\n return\n }\n\n const thumbCenterPx = thumbRect.left - controlRect.left + thumbRect.width / 2\n\n const valueCenterMin = valueWidth / 2\n const valueCenterMax = controlRect.width - valueWidth / 2\n\n const clampedCenter = Math.max(valueCenterMin, Math.min(valueCenterMax, thumbCenterPx))\n const nextTranslateX = clampedCenter - thumbCenterPx\n\n setTranslateX(prev => (prev !== nextTranslateX ? nextTranslateX : prev))\n }\n\n compute()\n\n const resizeObserver = new ResizeObserver(compute)\n resizeObserver.observe(control)\n resizeObserver.observe(valueEl)\n\n return () => {\n cancelled = true\n resizeObserver.disconnect()\n }\n }, [controlRef, thumbRef, valueRef, value, refsRetryScheduled])\n\n return translateX\n}\n","import { Slider as BaseSlider } from '@base-ui/react/slider'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { cx } from 'class-variance-authority'\nimport type { ReactNode } from 'react'\nimport { ComponentProps, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { useSliderContext } from './SliderContext'\nimport { useSliderThumbContext } from './SliderThumbContext'\nimport { useSliderValueBoundaries } from './useSliderValueBoundaries'\n\nexport type SliderValueProps = Omit<ComponentProps<typeof BaseSlider.Value>, 'render'>\n\n/**\n * Normalizes Base UI's (formattedValues, values) to single (formatted, value) for the render prop.\n */\nexport const SliderValue = ({ className, children, ref, ...rest }: SliderValueProps) => {\n const { registerValueInThumb, controlRef, thumbRef } = useSliderContext()\n const thumbContext = useSliderThumbContext()\n const isInsideThumb = thumbContext !== null\n\n const valueRef = useRef<HTMLOutputElement | null>(null)\n const mergedRef = useMergeRefs(valueRef, ref)\n\n const [currentValue, setCurrentValue] = useState(0)\n const translateX = useSliderValueBoundaries(controlRef, thumbRef, valueRef, currentValue)\n\n useEffect(() => {\n if (!isInsideThumb) return\n\n return registerValueInThumb()\n }, [isInsideThumb, registerValueInThumb])\n\n const resolvedClassName = cx(\n isInsideThumb\n ? 'absolute left-1/2 -translate-x-1/2 top-[calc(-100%-var(--spacing-sm))] text-body-1 font-bold whitespace-nowrap'\n : 'default:text-body-1 col-start-2 text-right default:font-bold',\n className\n )\n\n const normalizedChildren = useCallback(\n (formattedValues: readonly string[], values: readonly number[]) => {\n const formatted = formattedValues[0] ?? String(values[0] ?? '')\n const value = values[0] ?? 0\n setCurrentValue(value)\n if (typeof children === 'function') {\n return (children as unknown as (formatted: string, value: number) => ReactNode)(\n formatted,\n value\n )\n }\n\n return formatted\n },\n [children]\n )\n\n const style = isInsideThumb\n ? { transform: `translate(calc(0% + ${translateX}px), 0)` }\n : undefined\n\n return (\n <BaseSlider.Value\n data-spark-component=\"slider-value\"\n ref={mergedRef}\n className={resolvedClassName}\n style={style}\n {...rest}\n >\n {normalizedChildren}\n </BaseSlider.Value>\n )\n}\n\nSliderValue.displayName = 'Slider.Value'\n","import { Slider as Root, type SliderProps } from './Slider'\nimport { SliderControl as Control, type SliderControlProps } from './SliderControl'\nimport { SliderIndicator as Indicator, type SliderIndicatorProps } from './SliderIndicator'\nimport { SliderLabel as Label, type SliderLabelProps } from './SliderLabel'\nimport { SliderMaxValue as MaxValue, type SliderMaxValueProps } from './SliderMaxValue'\nimport { SliderMinValue as MinValue, type SliderMinValueProps } from './SliderMinValue'\nimport { SliderThumb as Thumb, type SliderThumbProps } from './SliderThumb'\nimport { SliderTrack as Track, type SliderTrackProps } from './SliderTrack'\nimport { SliderValue as Value, type SliderValueProps } from './SliderValue'\n\nexport const Slider: typeof Root & {\n Control: typeof Control\n Indicator: typeof Indicator\n Label: typeof Label\n MaxValue: typeof MaxValue\n MinValue: typeof MinValue\n Thumb: typeof Thumb\n Track: typeof Track\n Value: typeof Value\n} = Object.assign(Root, {\n Control,\n Indicator,\n Label,\n MaxValue,\n MinValue,\n Thumb,\n Track,\n Value,\n})\n\nSlider.displayName = 'Slider'\nControl.displayName = 'Slider.Control'\nIndicator.displayName = 'Slider.Indicator'\nLabel.displayName = 'Slider.Label'\nMaxValue.displayName = 'Slider.MaxValue'\nMinValue.displayName = 'Slider.MinValue'\nThumb.displayName = 'Slider.Thumb'\nTrack.displayName = 'Slider.Track'\nValue.displayName = 'Slider.Value'\n\nexport type {\n SliderProps,\n SliderControlProps,\n SliderIndicatorProps,\n SliderLabelProps,\n SliderMaxValueProps,\n SliderMinValueProps,\n SliderThumbProps,\n SliderTrackProps,\n SliderValueProps,\n}\n"],"names":["rootStyles","cva","SliderContext","createContext","useSliderContext","useContext","Slider","intent","children","className","ref","valueProp","defaultValueProp","disabledProp","readOnlyProp","nameProp","onValueChange","onValueCommit","min","max","rest","field","useFormFieldControl","disabled","readOnly","name","labelId","setLabelId","useState","valueInThumbCount","setValueInThumbCount","controlRef","useRef","thumbRef","handleLabelId","useCallback","id","registerValueInThumb","c","jsx","BaseSlider","value","v","SliderControl","hasValueInThumb","mergedRef","useMergeRefs","cx","trackVariants","rangeVariants","SliderIndicator","ID_PREFIX","SliderLabel","htmlForProp","idProp","requiredIndicator","FormFieldRequiredIndicator","asChild","others","fieldLabelId","fieldId","onLabelId","internalId","useId","generatedId","htmlFor","isRequired","labelRef","useEffect","Label","jsxs","Fragment","Slottable","SliderMaxValue","forwardRef","content","SliderMinValue","SliderThumbContext","useSliderThumbContext","thumbVariants","SliderThumb","forwardedRef","contextThumbRef","innerRef","SliderTrack","useSliderValueBoundaries","valueRef","translateX","setTranslateX","refsRetryScheduled","setRefsRetryScheduled","useLayoutEffect","control","thumb","valueEl","cancelled","compute","controlRect","thumbRect","valueWidth","thumbCenterPx","valueCenterMin","valueCenterMax","nextTranslateX","prev","resizeObserver","SliderValue","isInsideThumb","currentValue","setCurrentValue","resolvedClassName","normalizedChildren","formattedValues","values","formatted","style","Root","Control","Indicator","MaxValue","MinValue","Thumb","Track","Value"],"mappings":"iaAEaA,EAAaC,EAAAA,IAAI,CAC5B,uDACA,yBACA,8DACF,CAAC,ECSYC,EAAgBC,EAAAA,cAAsC,EAA4B,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