react-aria-components 3.0.0-nightly-ab9fd5c68-241125 → 3.0.0-nightly-10a43de88-241127
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/Breadcrumbs.main.js +2 -5
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +3 -6
- package/dist/Breadcrumbs.module.js +3 -6
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +2 -5
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +2 -5
- package/dist/Button.module.js +2 -5
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +9 -22
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +9 -22
- package/dist/Calendar.module.js +9 -22
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +5 -12
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +6 -13
- package/dist/Checkbox.module.js +6 -13
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/ColorArea.main.js +2 -5
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +3 -6
- package/dist/ColorArea.module.js +3 -6
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +2 -5
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +2 -5
- package/dist/ColorField.module.js +2 -5
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +2 -5
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +2 -5
- package/dist/ColorSlider.module.js +2 -5
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +2 -5
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +2 -5
- package/dist/ColorSwatch.module.js +2 -5
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js +4 -8
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +5 -9
- package/dist/ColorSwatchPicker.module.js +5 -9
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +2 -5
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -6
- package/dist/ColorThumb.module.js +3 -6
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +5 -11
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +6 -12
- package/dist/ColorWheel.module.js +6 -12
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +2 -5
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +3 -6
- package/dist/ComboBox.module.js +3 -6
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +8 -23
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +9 -24
- package/dist/DateField.module.js +9 -24
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +4 -11
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +5 -12
- package/dist/DatePicker.module.js +5 -12
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +2 -5
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +3 -6
- package/dist/Dialog.module.js +3 -6
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +6 -16
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +6 -16
- package/dist/Disclosure.module.js +6 -16
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +2 -5
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +3 -6
- package/dist/DragAndDrop.module.js +3 -6
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +2 -5
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +3 -6
- package/dist/DropZone.module.js +3 -6
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +2 -5
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -6
- package/dist/FieldError.module.js +3 -6
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +2 -5
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +2 -5
- package/dist/FileTrigger.module.js +2 -5
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js +2 -6
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.mjs +2 -6
- package/dist/Form.module.js +2 -6
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +2 -6
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +3 -7
- package/dist/GridList.module.js +3 -7
- package/dist/GridList.module.js.map +1 -1
- package/dist/Group.main.js +2 -5
- package/dist/Group.main.js.map +1 -1
- package/dist/Group.mjs +2 -5
- package/dist/Group.module.js +2 -5
- package/dist/Group.module.js.map +1 -1
- package/dist/Heading.main.js +2 -3
- package/dist/Heading.main.js.map +1 -1
- package/dist/Heading.mjs +2 -3
- package/dist/Heading.module.js +2 -3
- package/dist/Heading.module.js.map +1 -1
- package/dist/Input.main.js +2 -5
- package/dist/Input.main.js.map +1 -1
- package/dist/Input.mjs +2 -5
- package/dist/Input.module.js +2 -5
- package/dist/Input.module.js.map +1 -1
- package/dist/Keyboard.main.js +2 -3
- package/dist/Keyboard.main.js.map +1 -1
- package/dist/Keyboard.mjs +2 -3
- package/dist/Keyboard.module.js +2 -3
- package/dist/Keyboard.module.js.map +1 -1
- package/dist/Label.main.js +2 -3
- package/dist/Label.main.js.map +1 -1
- package/dist/Label.mjs +2 -3
- package/dist/Label.module.js +2 -3
- package/dist/Label.module.js.map +1 -1
- package/dist/Link.main.js +2 -6
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +2 -6
- package/dist/Link.module.js +2 -6
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +5 -10
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +6 -11
- package/dist/ListBox.module.js +6 -11
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +5 -10
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +5 -10
- package/dist/Menu.module.js +5 -10
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +2 -5
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +2 -5
- package/dist/Meter.module.js +2 -5
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +3 -6
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +4 -7
- package/dist/Modal.module.js +4 -7
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +2 -5
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +3 -6
- package/dist/NumberField.module.js +3 -6
- package/dist/NumberField.module.js.map +1 -1
- package/dist/OverlayArrow.main.js +2 -6
- package/dist/OverlayArrow.main.js.map +1 -1
- package/dist/OverlayArrow.mjs +2 -6
- package/dist/OverlayArrow.module.js +2 -6
- package/dist/OverlayArrow.module.js.map +1 -1
- package/dist/Popover.main.js +2 -5
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +3 -6
- package/dist/Popover.module.js +3 -6
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +2 -6
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +2 -6
- package/dist/ProgressBar.module.js +2 -6
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +4 -10
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +4 -10
- package/dist/RadioGroup.module.js +4 -10
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +2 -5
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +3 -6
- package/dist/SearchField.module.js +3 -6
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +5 -12
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +6 -13
- package/dist/Select.module.js +6 -13
- package/dist/Select.module.js.map +1 -1
- package/dist/Slider.main.js +8 -20
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +9 -21
- package/dist/Slider.module.js +9 -21
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +2 -5
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +2 -5
- package/dist/Switch.module.js +2 -5
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +6 -12
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +7 -13
- package/dist/Table.module.js +7 -13
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +6 -16
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +7 -17
- package/dist/Tabs.module.js +7 -17
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +4 -10
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +5 -11
- package/dist/TagGroup.module.js +5 -11
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/Text.main.js +2 -3
- package/dist/Text.main.js.map +1 -1
- package/dist/Text.mjs +2 -3
- package/dist/Text.module.js +2 -3
- package/dist/Text.module.js.map +1 -1
- package/dist/TextArea.main.js +2 -5
- package/dist/TextArea.main.js.map +1 -1
- package/dist/TextArea.mjs +2 -5
- package/dist/TextArea.module.js +2 -5
- package/dist/TextArea.module.js.map +1 -1
- package/dist/TextField.main.js +2 -5
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +3 -6
- package/dist/TextField.module.js +3 -6
- package/dist/TextField.module.js.map +1 -1
- package/dist/ToggleButton.main.js +2 -5
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +3 -6
- package/dist/ToggleButton.module.js +3 -6
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +2 -5
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +2 -5
- package/dist/ToggleButtonGroup.module.js +2 -5
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +2 -6
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +2 -6
- package/dist/Toolbar.module.js +2 -6
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +2 -5
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +3 -6
- package/dist/Tooltip.module.js +3 -6
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +2 -6
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +3 -7
- package/dist/Tree.module.js +3 -7
- package/dist/Tree.module.js.map +1 -1
- package/dist/types.d.ts +10 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/Breadcrumbs.tsx +5 -8
- package/src/Button.tsx +5 -8
- package/src/Calendar.tsx +19 -31
- package/src/Checkbox.tsx +11 -17
- package/src/ColorArea.tsx +5 -8
- package/src/ColorField.tsx +5 -8
- package/src/ColorSlider.tsx +5 -8
- package/src/ColorSwatch.tsx +5 -8
- package/src/ColorSwatchPicker.tsx +7 -13
- package/src/ColorThumb.tsx +5 -8
- package/src/ColorWheel.tsx +10 -16
- package/src/ComboBox.tsx +5 -8
- package/src/DateField.tsx +21 -33
- package/src/DatePicker.tsx +9 -15
- package/src/Dialog.tsx +5 -8
- package/src/Disclosure.tsx +16 -25
- package/src/DragAndDrop.tsx +5 -8
- package/src/DropZone.tsx +5 -8
- package/src/FieldError.tsx +5 -8
- package/src/FileTrigger.tsx +5 -8
- package/src/Form.tsx +6 -9
- package/src/GridList.tsx +6 -9
- package/src/Group.tsx +5 -8
- package/src/Heading.tsx +2 -5
- package/src/Input.tsx +5 -8
- package/src/Keyboard.tsx +2 -5
- package/src/Label.tsx +2 -5
- package/src/Link.tsx +6 -9
- package/src/ListBox.tsx +8 -12
- package/src/Menu.tsx +8 -12
- package/src/Meter.tsx +5 -8
- package/src/Modal.tsx +5 -8
- package/src/NumberField.tsx +5 -8
- package/src/OverlayArrow.tsx +6 -9
- package/src/Popover.tsx +5 -8
- package/src/ProgressBar.tsx +6 -9
- package/src/RadioGroup.tsx +10 -16
- package/src/SearchField.tsx +5 -8
- package/src/Select.tsx +11 -17
- package/src/Slider.tsx +20 -32
- package/src/Switch.tsx +5 -8
- package/src/Table.tsx +10 -19
- package/src/Tabs.tsx +14 -23
- package/src/TagGroup.tsx +8 -14
- package/src/Text.tsx +2 -5
- package/src/TextArea.tsx +5 -7
- package/src/TextField.tsx +5 -8
- package/src/ToggleButton.tsx +5 -8
- package/src/ToggleButtonGroup.tsx +5 -8
- package/src/Toolbar.tsx +6 -9
- package/src/Tooltip.tsx +5 -8
- package/src/Tree.tsx +6 -9
package/dist/Slider.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAChG,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D;AAmB5G,SAAS,6BAAoC,KAAqB,EAAE,GAAiC;IACnG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAkB;IACtC,IAAI,kBAAkB,CAAA,GAAA,mCAAiB,EAAE,MAAM,aAAa;IAC5D,IAAI,QAAQ,CAAA,GAAA,kCAAa,EAAE;QAAC,GAAG,KA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AAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;SAC/C;OACA,YAAY,QAAQ;AAI7B;AAEA;;CAEC,GACD,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB","sources":["packages/react-aria-components/src/Slider.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaSliderProps, AriaSliderThumbProps, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps {\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext = createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderOutputContext = createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the slider is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the slider.\n */\n state: SliderState\n}\n\nfunction Slider<T extends number | number[]>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot();\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider({...props, label}, state, trackRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <div\n {...DOMProps}\n {...groupProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nconst _Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(Slider);\nexport {_Slider as Slider};\n\nexport interface SliderOutputProps extends RenderProps<SliderRenderProps> {}\ninterface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {}\n\nfunction SliderOutput(props: SliderOutputProps, ref: ForwardedRef<HTMLOutputElement>) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n defaultChildren: state.getThumbValueLabel(0),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nconst _SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(SliderOutput);\nexport {_SliderOutput as SliderOutput};\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean\n}\n\nexport interface SliderTrackProps extends HoverEvents, RenderProps<SliderTrackRenderProps> {}\ninterface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, SliderTrackProps {}\n\nfunction SliderTrack(props: SliderTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nconst _SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(SliderTrack);\nexport {_SliderTrack as SliderTrack};\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState,\n /**\n * Whether this thumb is currently being dragged.\n * @selector [data-dragging]\n */\n isDragging: boolean,\n /**\n * Whether the thumb is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the thumb is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the thumb is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the thumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface SliderThumbProps extends Omit<AriaSliderThumbProps, 'label' | 'validationState'>, HoverEvents, RenderProps<SliderThumbRenderProps> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nfunction SliderThumb(props: SliderThumbProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n inputRef: userInputRef = null\n } = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot();\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb({\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n }, state);\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nconst _SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(SliderThumb);\nexport {_SliderThumb as SliderThumb};\n"],"names":[],"version":3,"file":"Slider.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAChG,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D;AAsBrG,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAoC,KAAqB,EAAE,GAAiC;IACtK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAkB;IACtC,IAAI,kBAAkB,CAAA,GAAA,mCAAiB,EAAE,MAAM,aAAa;IAC5D,IAAI,QAAQ,CAAA,GAAA,kCAAa,EAAE;QAAC,GAAG,KAAK;yBAAE;IAAe;IACrD,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM;IAC9B,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,eACV,WAAW,EACZ,GAAG,CAAA,GAAA,0BAAQ,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK,GAAG,OAAO;IAExC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YACN,aAAa,MAAM,WAAW;YAC9B,YAAY,MAAM,UAAU;mBAC5B;QACF;QACA,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,OAAO,S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A,GAAA,6BAAW;IAC9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IAEvC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;mBACN;uBACA;wBACA;uBACA;4BACA;wBACA;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,YAAY,WAAW;QAC/C,GAAG,WAAW;QACf,KAAK;QACL,OAAO;YAAC,GAAG,WAAW,KAAK;YAAE,GAAG,YAAY,KAAK;QAAA;QACjD,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;qBAC7B,0DAAC,CAAA,GAAA,+BAAa,uBACZ,0DAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;uBAE9D,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;SAC/C;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Slider.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaSliderProps, AriaSliderThumbProps, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps {\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext = createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderOutputContext = createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the slider is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the slider.\n */\n state: SliderState\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nexport const Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(function Slider<T extends number | number[]>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot();\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider({...props, label}, state, trackRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <div\n {...DOMProps}\n {...groupProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n});\n\nexport interface SliderOutputProps extends RenderProps<SliderRenderProps> {}\ninterface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nexport const SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderOutput(props: SliderOutputProps, ref: ForwardedRef<HTMLOutputElement>) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n defaultChildren: state.getThumbValueLabel(0),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean\n}\n\nexport interface SliderTrackProps extends HoverEvents, RenderProps<SliderTrackRenderProps> {}\ninterface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, SliderTrackProps {}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nexport const SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderTrack(props: SliderTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState,\n /**\n * Whether this thumb is currently being dragged.\n * @selector [data-dragging]\n */\n isDragging: boolean,\n /**\n * Whether the thumb is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the thumb is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the thumb is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the thumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface SliderThumbProps extends Omit<AriaSliderThumbProps, 'label' | 'validationState'>, HoverEvents, RenderProps<SliderThumbRenderProps> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nexport const SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderThumb(props: SliderThumbProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n inputRef: userInputRef = null\n } = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot();\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb({\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n }, state);\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Slider.main.js.map"}
|
package/dist/Slider.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps a
|
|
|
2
2
|
import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.mjs";
|
|
3
3
|
import {useNumberFormatter as $6YMke$useNumberFormatter, useSlider as $6YMke$useSlider, useHover as $6YMke$useHover, mergeProps as $6YMke$mergeProps, useSliderThumb as $6YMke$useSliderThumb, useFocusRing as $6YMke$useFocusRing, VisuallyHidden as $6YMke$VisuallyHidden} from "react-aria";
|
|
4
4
|
import {filterDOMProps as $6YMke$filterDOMProps} from "@react-aria/utils";
|
|
5
|
-
import $6YMke$react, {createContext as $6YMke$createContext,
|
|
5
|
+
import $6YMke$react, {createContext as $6YMke$createContext, forwardRef as $6YMke$forwardRef, useRef as $6YMke$useRef, useContext as $6YMke$useContext} from "react";
|
|
6
6
|
import {useSliderState as $6YMke$useSliderState} from "react-stately";
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -25,7 +25,7 @@ const $6f909507e6374d18$export$e99164f0030f3bff = /*#__PURE__*/ (0, $6YMke$creat
|
|
|
25
25
|
const $6f909507e6374d18$export$1e7083018727fa60 = /*#__PURE__*/ (0, $6YMke$createContext)(null);
|
|
26
26
|
const $6f909507e6374d18$export$f1fce0420cc6d8ee = /*#__PURE__*/ (0, $6YMke$createContext)(null);
|
|
27
27
|
const $6f909507e6374d18$export$6189c2744041d8f8 = /*#__PURE__*/ (0, $6YMke$createContext)(null);
|
|
28
|
-
|
|
28
|
+
const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwardRef)(function Slider(props, ref) {
|
|
29
29
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $6f909507e6374d18$export$e99164f0030f3bff);
|
|
30
30
|
let trackRef = (0, $6YMke$useRef)(null);
|
|
31
31
|
let numberFormatter = (0, $6YMke$useNumberFormatter)(props.formatOptions);
|
|
@@ -83,11 +83,8 @@ function $6f909507e6374d18$var$Slider(props, ref) {
|
|
|
83
83
|
"data-orientation": state.orientation,
|
|
84
84
|
"data-disabled": state.isDisabled || undefined
|
|
85
85
|
}));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
* A slider allows a user to select one or more values within a range.
|
|
89
|
-
*/ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwardRef)($6f909507e6374d18$var$Slider);
|
|
90
|
-
function $6f909507e6374d18$var$SliderOutput(props, ref) {
|
|
86
|
+
});
|
|
87
|
+
const $6f909507e6374d18$export$a590f758a961cb5b = /*#__PURE__*/ (0, $6YMke$forwardRef)(function SliderOutput(props, ref) {
|
|
91
88
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $6f909507e6374d18$export$6189c2744041d8f8);
|
|
92
89
|
let { children: children, style: style, className: className, ...otherProps } = props;
|
|
93
90
|
let state = (0, $6YMke$useContext)($6f909507e6374d18$export$1e7083018727fa60);
|
|
@@ -110,11 +107,8 @@ function $6f909507e6374d18$var$SliderOutput(props, ref) {
|
|
|
110
107
|
"data-orientation": state.orientation || undefined,
|
|
111
108
|
"data-disabled": state.isDisabled || undefined
|
|
112
109
|
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
* A slider output displays the current value of a slider as text.
|
|
116
|
-
*/ const $6f909507e6374d18$export$a590f758a961cb5b = /*#__PURE__*/ (0, $6YMke$forwardRef)($6f909507e6374d18$var$SliderOutput);
|
|
117
|
-
function $6f909507e6374d18$var$SliderTrack(props, ref) {
|
|
110
|
+
});
|
|
111
|
+
const $6f909507e6374d18$export$105594979f116971 = /*#__PURE__*/ (0, $6YMke$forwardRef)(function SliderTrack(props, ref) {
|
|
118
112
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $6f909507e6374d18$export$f1fce0420cc6d8ee);
|
|
119
113
|
let state = (0, $6YMke$useContext)($6f909507e6374d18$export$1e7083018727fa60);
|
|
120
114
|
let { onHoverStart: onHoverStart, onHoverEnd: onHoverEnd, onHoverChange: onHoverChange, ...otherProps } = props;
|
|
@@ -141,11 +135,8 @@ function $6f909507e6374d18$var$SliderTrack(props, ref) {
|
|
|
141
135
|
"data-orientation": state.orientation || undefined,
|
|
142
136
|
"data-disabled": state.isDisabled || undefined
|
|
143
137
|
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
* A slider track is a container for one or more slider thumbs.
|
|
147
|
-
*/ const $6f909507e6374d18$export$105594979f116971 = /*#__PURE__*/ (0, $6YMke$forwardRef)($6f909507e6374d18$var$SliderTrack);
|
|
148
|
-
function $6f909507e6374d18$var$SliderThumb(props, ref) {
|
|
138
|
+
});
|
|
139
|
+
const $6f909507e6374d18$export$2c1b491743890dec = /*#__PURE__*/ (0, $6YMke$forwardRef)(function SliderThumb(props, ref) {
|
|
149
140
|
let { inputRef: userInputRef = null } = props;
|
|
150
141
|
let state = (0, $6YMke$useContext)($6f909507e6374d18$export$1e7083018727fa60);
|
|
151
142
|
let { ref: trackRef } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($6f909507e6374d18$export$f1fce0420cc6d8ee);
|
|
@@ -203,10 +194,7 @@ function $6f909507e6374d18$var$SliderThumb(props, ref) {
|
|
|
203
194
|
]
|
|
204
195
|
]
|
|
205
196
|
}, renderProps.children));
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* A slider thumb represents an individual value that the user can adjust within a slider track.
|
|
209
|
-
*/ const $6f909507e6374d18$export$2c1b491743890dec = /*#__PURE__*/ (0, $6YMke$forwardRef)($6f909507e6374d18$var$SliderThumb);
|
|
197
|
+
});
|
|
210
198
|
|
|
211
199
|
|
|
212
200
|
export {$6f909507e6374d18$export$e99164f0030f3bff as SliderContext, $6f909507e6374d18$export$1e7083018727fa60 as SliderStateContext, $6f909507e6374d18$export$f1fce0420cc6d8ee as SliderTrackContext, $6f909507e6374d18$export$6189c2744041d8f8 as SliderOutputContext, $6f909507e6374d18$export$472062a354075cee as Slider, $6f909507e6374d18$export$a590f758a961cb5b as SliderOutput, $6f909507e6374d18$export$105594979f116971 as SliderTrack, $6f909507e6374d18$export$2c1b491743890dec as SliderThumb};
|
package/dist/Slider.module.js
CHANGED
|
@@ -2,7 +2,7 @@ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps a
|
|
|
2
2
|
import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.module.js";
|
|
3
3
|
import {useNumberFormatter as $6YMke$useNumberFormatter, useSlider as $6YMke$useSlider, useHover as $6YMke$useHover, mergeProps as $6YMke$mergeProps, useSliderThumb as $6YMke$useSliderThumb, useFocusRing as $6YMke$useFocusRing, VisuallyHidden as $6YMke$VisuallyHidden} from "react-aria";
|
|
4
4
|
import {filterDOMProps as $6YMke$filterDOMProps} from "@react-aria/utils";
|
|
5
|
-
import $6YMke$react, {createContext as $6YMke$createContext,
|
|
5
|
+
import $6YMke$react, {createContext as $6YMke$createContext, forwardRef as $6YMke$forwardRef, useRef as $6YMke$useRef, useContext as $6YMke$useContext} from "react";
|
|
6
6
|
import {useSliderState as $6YMke$useSliderState} from "react-stately";
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -25,7 +25,7 @@ const $6f909507e6374d18$export$e99164f0030f3bff = /*#__PURE__*/ (0, $6YMke$creat
|
|
|
25
25
|
const $6f909507e6374d18$export$1e7083018727fa60 = /*#__PURE__*/ (0, $6YMke$createContext)(null);
|
|
26
26
|
const $6f909507e6374d18$export$f1fce0420cc6d8ee = /*#__PURE__*/ (0, $6YMke$createContext)(null);
|
|
27
27
|
const $6f909507e6374d18$export$6189c2744041d8f8 = /*#__PURE__*/ (0, $6YMke$createContext)(null);
|
|
28
|
-
|
|
28
|
+
const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwardRef)(function Slider(props, ref) {
|
|
29
29
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $6f909507e6374d18$export$e99164f0030f3bff);
|
|
30
30
|
let trackRef = (0, $6YMke$useRef)(null);
|
|
31
31
|
let numberFormatter = (0, $6YMke$useNumberFormatter)(props.formatOptions);
|
|
@@ -83,11 +83,8 @@ function $6f909507e6374d18$var$Slider(props, ref) {
|
|
|
83
83
|
"data-orientation": state.orientation,
|
|
84
84
|
"data-disabled": state.isDisabled || undefined
|
|
85
85
|
}));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
* A slider allows a user to select one or more values within a range.
|
|
89
|
-
*/ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwardRef)($6f909507e6374d18$var$Slider);
|
|
90
|
-
function $6f909507e6374d18$var$SliderOutput(props, ref) {
|
|
86
|
+
});
|
|
87
|
+
const $6f909507e6374d18$export$a590f758a961cb5b = /*#__PURE__*/ (0, $6YMke$forwardRef)(function SliderOutput(props, ref) {
|
|
91
88
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $6f909507e6374d18$export$6189c2744041d8f8);
|
|
92
89
|
let { children: children, style: style, className: className, ...otherProps } = props;
|
|
93
90
|
let state = (0, $6YMke$useContext)($6f909507e6374d18$export$1e7083018727fa60);
|
|
@@ -110,11 +107,8 @@ function $6f909507e6374d18$var$SliderOutput(props, ref) {
|
|
|
110
107
|
"data-orientation": state.orientation || undefined,
|
|
111
108
|
"data-disabled": state.isDisabled || undefined
|
|
112
109
|
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
* A slider output displays the current value of a slider as text.
|
|
116
|
-
*/ const $6f909507e6374d18$export$a590f758a961cb5b = /*#__PURE__*/ (0, $6YMke$forwardRef)($6f909507e6374d18$var$SliderOutput);
|
|
117
|
-
function $6f909507e6374d18$var$SliderTrack(props, ref) {
|
|
110
|
+
});
|
|
111
|
+
const $6f909507e6374d18$export$105594979f116971 = /*#__PURE__*/ (0, $6YMke$forwardRef)(function SliderTrack(props, ref) {
|
|
118
112
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $6f909507e6374d18$export$f1fce0420cc6d8ee);
|
|
119
113
|
let state = (0, $6YMke$useContext)($6f909507e6374d18$export$1e7083018727fa60);
|
|
120
114
|
let { onHoverStart: onHoverStart, onHoverEnd: onHoverEnd, onHoverChange: onHoverChange, ...otherProps } = props;
|
|
@@ -141,11 +135,8 @@ function $6f909507e6374d18$var$SliderTrack(props, ref) {
|
|
|
141
135
|
"data-orientation": state.orientation || undefined,
|
|
142
136
|
"data-disabled": state.isDisabled || undefined
|
|
143
137
|
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
* A slider track is a container for one or more slider thumbs.
|
|
147
|
-
*/ const $6f909507e6374d18$export$105594979f116971 = /*#__PURE__*/ (0, $6YMke$forwardRef)($6f909507e6374d18$var$SliderTrack);
|
|
148
|
-
function $6f909507e6374d18$var$SliderThumb(props, ref) {
|
|
138
|
+
});
|
|
139
|
+
const $6f909507e6374d18$export$2c1b491743890dec = /*#__PURE__*/ (0, $6YMke$forwardRef)(function SliderThumb(props, ref) {
|
|
149
140
|
let { inputRef: userInputRef = null } = props;
|
|
150
141
|
let state = (0, $6YMke$useContext)($6f909507e6374d18$export$1e7083018727fa60);
|
|
151
142
|
let { ref: trackRef } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($6f909507e6374d18$export$f1fce0420cc6d8ee);
|
|
@@ -203,10 +194,7 @@ function $6f909507e6374d18$var$SliderThumb(props, ref) {
|
|
|
203
194
|
]
|
|
204
195
|
]
|
|
205
196
|
}, renderProps.children));
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* A slider thumb represents an individual value that the user can adjust within a slider track.
|
|
209
|
-
*/ const $6f909507e6374d18$export$2c1b491743890dec = /*#__PURE__*/ (0, $6YMke$forwardRef)($6f909507e6374d18$var$SliderThumb);
|
|
197
|
+
});
|
|
210
198
|
|
|
211
199
|
|
|
212
200
|
export {$6f909507e6374d18$export$e99164f0030f3bff as SliderContext, $6f909507e6374d18$export$1e7083018727fa60 as SliderStateContext, $6f909507e6374d18$export$f1fce0420cc6d8ee as SliderTrackContext, $6f909507e6374d18$export$6189c2744041d8f8 as SliderOutputContext, $6f909507e6374d18$export$472062a354075cee as Slider, $6f909507e6374d18$export$a590f758a961cb5b as SliderOutput, $6f909507e6374d18$export$105594979f116971 as SliderTrack, $6f909507e6374d18$export$2c1b491743890dec as SliderThumb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA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AG,WAAW,KAAK;YAAE,GAAG,YAAY,KAAK;QAAA;QACjD,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;qBAC7B,gCAAC,CAAA,GAAA,qBAAa,uBACZ,gCAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;uBAE9D,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;SAC/C;OACA,YAAY,QAAQ;AAI7B;AAEA;;CAEC,GACD,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB","sources":["packages/react-aria-components/src/Slider.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaSliderProps, AriaSliderThumbProps, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps {\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext = createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderOutputContext = createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the slider is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the slider.\n */\n state: SliderState\n}\n\nfunction Slider<T extends number | number[]>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot();\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider({...props, label}, state, trackRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <div\n {...DOMProps}\n {...groupProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nconst _Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(Slider);\nexport {_Slider as Slider};\n\nexport interface SliderOutputProps extends RenderProps<SliderRenderProps> {}\ninterface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {}\n\nfunction SliderOutput(props: SliderOutputProps, ref: ForwardedRef<HTMLOutputElement>) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n defaultChildren: state.getThumbValueLabel(0),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nconst _SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(SliderOutput);\nexport {_SliderOutput as SliderOutput};\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean\n}\n\nexport interface SliderTrackProps extends HoverEvents, RenderProps<SliderTrackRenderProps> {}\ninterface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, SliderTrackProps {}\n\nfunction SliderTrack(props: SliderTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nconst _SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(SliderTrack);\nexport {_SliderTrack as SliderTrack};\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState,\n /**\n * Whether this thumb is currently being dragged.\n * @selector [data-dragging]\n */\n isDragging: boolean,\n /**\n * Whether the thumb is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the thumb is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the thumb is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the thumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface SliderThumbProps extends Omit<AriaSliderThumbProps, 'label' | 'validationState'>, HoverEvents, RenderProps<SliderThumbRenderProps> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nfunction SliderThumb(props: SliderThumbProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n inputRef: userInputRef = null\n } = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot();\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb({\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n }, state);\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nconst _SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(SliderThumb);\nexport {_SliderThumb as SliderThumb};\n"],"names":[],"version":3,"file":"Slider.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAChG,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA6D;AAsBrG,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,OAAoC,KAAqB,EAAE,GAAiC;IACtK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,WAAW,CAAA,GAAA,aAAK,EAAkB;IACtC,IAAI,kBAAkB,CAAA,GAAA,yBAAiB,EAAE,MAAM,aAAa;IAC5D,IAAI,QAAQ,CAAA,GAAA,qBAAa,EAAE;QAAC,GAAG,KAAK;yBAAE;IAAe;IACrD,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM;IAC9B,IAAI,cACF,UAAU,cACV,UAAU,cACV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IAAI,WAAW,gBAAgB;IAC/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM;IAC9B,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;QAC3F,GAAG,KAAK;eACR;QACA,UAAU;kBACV;eACA;IACF,GAAG;IAEH,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IAC9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IAEvC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;mBACN;uBACA;wBACA;uBACA;4BACA;wBACA;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAC9B,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,YAAY,WAAW;QAC/C,GAAG,WAAW;QACf,KAAK;QACL,OAAO;YAAC,GAAG,WAAW,KAAK;YAAE,GAAG,YAAY,KAAK;QAAA;QACjD,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;qBAC7B,gCAAC,CAAA,GAAA,qBAAa,uBACZ,gCAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;uBAE9D,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;SAC/C;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Slider.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaSliderProps, AriaSliderThumbProps, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps {\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext = createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderOutputContext = createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the slider is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the slider.\n */\n state: SliderState\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nexport const Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(function Slider<T extends number | number[]>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot();\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider({...props, label}, state, trackRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <div\n {...DOMProps}\n {...groupProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n});\n\nexport interface SliderOutputProps extends RenderProps<SliderRenderProps> {}\ninterface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nexport const SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderOutput(props: SliderOutputProps, ref: ForwardedRef<HTMLOutputElement>) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n defaultChildren: state.getThumbValueLabel(0),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean\n}\n\nexport interface SliderTrackProps extends HoverEvents, RenderProps<SliderTrackRenderProps> {}\ninterface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, SliderTrackProps {}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nexport const SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderTrack(props: SliderTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState,\n /**\n * Whether this thumb is currently being dragged.\n * @selector [data-dragging]\n */\n isDragging: boolean,\n /**\n * Whether the thumb is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the thumb is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the thumb is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the thumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface SliderThumbProps extends Omit<AriaSliderThumbProps, 'label' | 'validationState'>, HoverEvents, RenderProps<SliderThumbRenderProps> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nexport const SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderThumb(props: SliderThumbProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n inputRef: userInputRef = null\n } = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot();\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb({\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n }, state);\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Slider.module.js.map"}
|
package/dist/Switch.main.js
CHANGED
|
@@ -31,7 +31,7 @@ $parcel$export(module.exports, "Switch", () => $8d81efc5c2ff8011$export$b5d5cf89
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
const $8d81efc5c2ff8011$export$8699e3b644d5a28a = /*#__PURE__*/ (0, $hNQDK$react.createContext)(null);
|
|
34
|
-
|
|
34
|
+
const $8d81efc5c2ff8011$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hNQDK$react.forwardRef)(function Switch(props, ref) {
|
|
35
35
|
let { inputRef: userProvidedInputRef = null, ...otherProps } = props;
|
|
36
36
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(otherProps, ref, $8d81efc5c2ff8011$export$8699e3b644d5a28a);
|
|
37
37
|
let inputRef = (0, $hNQDK$reactariautils.useObjectRef)((0, $hNQDK$reactariautils.mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));
|
|
@@ -80,10 +80,7 @@ function $8d81efc5c2ff8011$var$Switch(props, ref) {
|
|
|
80
80
|
...(0, $hNQDK$reactaria.mergeProps)(inputProps, focusProps),
|
|
81
81
|
ref: inputRef
|
|
82
82
|
})), renderProps.children);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* A switch allows a user to turn a setting on or off.
|
|
86
|
-
*/ const $8d81efc5c2ff8011$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hNQDK$react.forwardRef)($8d81efc5c2ff8011$var$Switch);
|
|
83
|
+
});
|
|
87
84
|
|
|
88
85
|
|
|
89
86
|
//# sourceMappingURL=Switch.main.js.map
|
package/dist/Switch.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA+C;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA+C;AAKjF,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAO,KAAkB,EAAE,GAAmC;IACxI,IAAI,EACF,UAAU,uBAAuB,IAAI,EACrC,GAAG,YAC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AC7B,0DAAC,CAAA,GAAA,+BAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Switch.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaSwitchProps, HoverEvents, mergeProps, useFocusRing, useHover, useSwitch, VisuallyHidden} from 'react-aria';\nimport {ContextValue, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'children'>, HoverEvents, RenderProps<SwitchRenderProps>, SlotProps {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface SwitchRenderProps {\n /**\n * Whether the switch is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the switch is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the switch is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the switch is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the switch is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the switch is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the switch is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * State of the switch.\n */\n state: ToggleState\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\n/**\n * A switch allows a user to turn a setting on or off.\n */\nexport const Switch = /*#__PURE__*/ (forwardRef as forwardRefType)(function Switch(props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, SwitchContext);\n let inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));\n let state = useToggleState(props);\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed} = useSwitch({\n ...removeDataAttributes(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = props.isDisabled || props.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Switch',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Switch.main.js.map"}
|
package/dist/Switch.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import {useToggleState as $hYf9o$useToggleState} from "react-stately";
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
const $8e59e948500a8fe1$export$8699e3b644d5a28a = /*#__PURE__*/ (0, $hYf9o$createContext)(null);
|
|
23
|
-
|
|
23
|
+
const $8e59e948500a8fe1$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hYf9o$forwardRef)(function Switch(props, ref) {
|
|
24
24
|
let { inputRef: userProvidedInputRef = null, ...otherProps } = props;
|
|
25
25
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(otherProps, ref, $8e59e948500a8fe1$export$8699e3b644d5a28a);
|
|
26
26
|
let inputRef = (0, $hYf9o$useObjectRef)((0, $hYf9o$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));
|
|
@@ -69,10 +69,7 @@ function $8e59e948500a8fe1$var$Switch(props, ref) {
|
|
|
69
69
|
...(0, $hYf9o$mergeProps)(inputProps, focusProps),
|
|
70
70
|
ref: inputRef
|
|
71
71
|
})), renderProps.children);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A switch allows a user to turn a setting on or off.
|
|
75
|
-
*/ const $8e59e948500a8fe1$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hYf9o$forwardRef)($8e59e948500a8fe1$var$Switch);
|
|
72
|
+
});
|
|
76
73
|
|
|
77
74
|
|
|
78
75
|
export {$8e59e948500a8fe1$export$8699e3b644d5a28a as SwitchContext, $8e59e948500a8fe1$export$b5d5cf8927ab7262 as Switch};
|
package/dist/Switch.module.js
CHANGED
|
@@ -20,7 +20,7 @@ import {useToggleState as $hYf9o$useToggleState} from "react-stately";
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
const $8e59e948500a8fe1$export$8699e3b644d5a28a = /*#__PURE__*/ (0, $hYf9o$createContext)(null);
|
|
23
|
-
|
|
23
|
+
const $8e59e948500a8fe1$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hYf9o$forwardRef)(function Switch(props, ref) {
|
|
24
24
|
let { inputRef: userProvidedInputRef = null, ...otherProps } = props;
|
|
25
25
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(otherProps, ref, $8e59e948500a8fe1$export$8699e3b644d5a28a);
|
|
26
26
|
let inputRef = (0, $hYf9o$useObjectRef)((0, $hYf9o$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));
|
|
@@ -69,10 +69,7 @@ function $8e59e948500a8fe1$var$Switch(props, ref) {
|
|
|
69
69
|
...(0, $hYf9o$mergeProps)(inputProps, focusProps),
|
|
70
70
|
ref: inputRef
|
|
71
71
|
})), renderProps.children);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A switch allows a user to turn a setting on or off.
|
|
75
|
-
*/ const $8e59e948500a8fe1$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hYf9o$forwardRef)($8e59e948500a8fe1$var$Switch);
|
|
72
|
+
});
|
|
76
73
|
|
|
77
74
|
|
|
78
75
|
export {$8e59e948500a8fe1$export$8699e3b644d5a28a as SwitchContext, $8e59e948500a8fe1$export$b5d5cf8927ab7262 as Switch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA+C;
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA+C;AAKjF,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,OAAO,KAAkB,EAAE,GAAmC;IACxI,IAAI,EACF,UAAU,uBAAuB,IAAI,EACrC,GAAG,YACJ,GAAG;IACJ,CAAC,OAAO,IAAI,GA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,aAAY;qBAC1B,gCAAC;QAAO,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Switch.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaSwitchProps, HoverEvents, mergeProps, useFocusRing, useHover, useSwitch, VisuallyHidden} from 'react-aria';\nimport {ContextValue, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'children'>, HoverEvents, RenderProps<SwitchRenderProps>, SlotProps {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface SwitchRenderProps {\n /**\n * Whether the switch is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the switch is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the switch is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the switch is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the switch is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the switch is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the switch is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * State of the switch.\n */\n state: ToggleState\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\n/**\n * A switch allows a user to turn a setting on or off.\n */\nexport const Switch = /*#__PURE__*/ (forwardRef as forwardRefType)(function Switch(props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, SwitchContext);\n let inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));\n let state = useToggleState(props);\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed} = useSwitch({\n ...removeDataAttributes(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = props.isDisabled || props.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Switch',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Switch.module.js.map"}
|
package/dist/Table.main.js
CHANGED
|
@@ -152,7 +152,7 @@ class $37b9a5d4bd0d4ded$var$TableCollection extends (0, $5VUTk$reactariacollecti
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
const $37b9a5d4bd0d4ded$var$ResizableTableContainerContext = /*#__PURE__*/ (0, $5VUTk$react.createContext)(null);
|
|
155
|
-
|
|
155
|
+
const $37b9a5d4bd0d4ded$export$7063e69b8a954175 = /*#__PURE__*/ (0, $5VUTk$react.forwardRef)(function ResizableTableContainer(props, ref) {
|
|
156
156
|
let containerRef = (0, $5VUTk$reactariautils.useObjectRef)(ref);
|
|
157
157
|
let tableRef = (0, $5VUTk$react.useRef)(null);
|
|
158
158
|
let scrollRef = (0, $5VUTk$react.useRef)(null);
|
|
@@ -207,12 +207,11 @@ function $37b9a5d4bd0d4ded$var$ResizableTableContainer(props, ref) {
|
|
|
207
207
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement($37b9a5d4bd0d4ded$var$ResizableTableContainerContext.Provider, {
|
|
208
208
|
value: ctx
|
|
209
209
|
}, props.children));
|
|
210
|
-
}
|
|
211
|
-
const $37b9a5d4bd0d4ded$export$7063e69b8a954175 = /*#__PURE__*/ (0, $5VUTk$react.forwardRef)($37b9a5d4bd0d4ded$var$ResizableTableContainer);
|
|
210
|
+
});
|
|
212
211
|
const $37b9a5d4bd0d4ded$export$93e4b0b2cc49b648 = /*#__PURE__*/ (0, $5VUTk$react.createContext)(null);
|
|
213
212
|
const $37b9a5d4bd0d4ded$export$38de1cb0526c21fb = /*#__PURE__*/ (0, $5VUTk$react.createContext)(null);
|
|
214
213
|
const $37b9a5d4bd0d4ded$export$a2680a798823803c = /*#__PURE__*/ (0, $5VUTk$react.createContext)(null);
|
|
215
|
-
|
|
214
|
+
const $37b9a5d4bd0d4ded$export$54ec01a60f47d33d = /*#__PURE__*/ (0, $5VUTk$react.forwardRef)(function Table(props, ref) {
|
|
216
215
|
var _props_dragAndDropHooks;
|
|
217
216
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $37b9a5d4bd0d4ded$export$93e4b0b2cc49b648);
|
|
218
217
|
// Separate selection state so we have access to it from collection components via useTableOptions.
|
|
@@ -242,7 +241,7 @@ function $37b9a5d4bd0d4ded$var$Table(props, ref) {
|
|
|
242
241
|
selectionState: selectionState,
|
|
243
242
|
collection: collection
|
|
244
243
|
}));
|
|
245
|
-
}
|
|
244
|
+
});
|
|
246
245
|
function $37b9a5d4bd0d4ded$var$TableInner({ props: props, forwardedRef: ref, selectionState: selectionState, collection: collection }) {
|
|
247
246
|
let tableContainerContext = (0, $5VUTk$react.useContext)($37b9a5d4bd0d4ded$var$ResizableTableContainerContext);
|
|
248
247
|
ref = (0, $5VUTk$reactariautils.useObjectRef)((0, $5VUTk$react.useMemo)(()=>(0, $5VUTk$reactariautils.mergeRefs)(ref, tableContainerContext === null || tableContainerContext === void 0 ? void 0 : tableContainerContext.tableRef), [
|
|
@@ -383,10 +382,6 @@ function $37b9a5d4bd0d4ded$var$TableInner({ props: props, forwardedRef: ref, sel
|
|
|
383
382
|
persistedKeys: (0, $0c2289d253cb4544$exports.useDndPersistedKeys)(selectionManager, dragAndDropHooks, dropState)
|
|
384
383
|
}))), dragPreview);
|
|
385
384
|
}
|
|
386
|
-
/**
|
|
387
|
-
* A table displays data in rows and columns and enables a user to navigate its contents via directional navigation keys,
|
|
388
|
-
* and optionally supports row selection and sorting.
|
|
389
|
-
*/ const $37b9a5d4bd0d4ded$export$54ec01a60f47d33d = /*#__PURE__*/ (0, $5VUTk$react.forwardRef)($37b9a5d4bd0d4ded$var$Table);
|
|
390
385
|
function $37b9a5d4bd0d4ded$var$useElementType(element) {
|
|
391
386
|
let { isVirtualized: isVirtualized } = (0, $5VUTk$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
|
|
392
387
|
return isVirtualized ? 'div' : element;
|
|
@@ -546,7 +541,7 @@ const $37b9a5d4bd0d4ded$export$816b5d811295e6bc = /*#__PURE__*/ (0, $5VUTk$react
|
|
|
546
541
|
}, renderProps.children));
|
|
547
542
|
});
|
|
548
543
|
const $37b9a5d4bd0d4ded$var$ColumnResizerContext = /*#__PURE__*/ (0, $5VUTk$react.createContext)(null);
|
|
549
|
-
|
|
544
|
+
const $37b9a5d4bd0d4ded$export$ee689e97a7664bfd = /*#__PURE__*/ (0, $5VUTk$react.forwardRef)(function ColumnResizer(props, ref) {
|
|
550
545
|
let layoutState = (0, $5VUTk$react.useContext)($37b9a5d4bd0d4ded$export$a2680a798823803c);
|
|
551
546
|
if (!layoutState) throw new Error('Wrap your <Table> in a <ResizableTableContainer> to enable column resizing');
|
|
552
547
|
let stringFormatter = (0, $5VUTk$reactaria.useLocalizedStringFormatter)((0, ($parcel$interopDefault($d72d752ea1c67b9a$exports))), 'react-aria-components');
|
|
@@ -622,8 +617,7 @@ function $37b9a5d4bd0d4ded$var$ColumnResizer(props, ref) {
|
|
|
622
617
|
cursor: cursor
|
|
623
618
|
}
|
|
624
619
|
}), document.body));
|
|
625
|
-
}
|
|
626
|
-
const $37b9a5d4bd0d4ded$export$ee689e97a7664bfd = /*#__PURE__*/ (0, $5VUTk$react.forwardRef)($37b9a5d4bd0d4ded$var$ColumnResizer);
|
|
620
|
+
});
|
|
627
621
|
const $37b9a5d4bd0d4ded$export$76ccd210b9029917 = /*#__PURE__*/ (0, $5VUTk$reactariacollections.createBranchComponent)('tablebody', (props, ref)=>{
|
|
628
622
|
let state = (0, $5VUTk$react.useContext)($37b9a5d4bd0d4ded$export$38de1cb0526c21fb);
|
|
629
623
|
let { isVirtualized: isVirtualized } = (0, $5VUTk$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
|