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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAUM,MAAM,0DAAU,CAAA,GAAA,iBAAS,EAAE,SAAS,QAAQ,KAAmB,EAAE,GAAqC;IAC3G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,yCAAa;IACxD,IAAI,YAAC,QAAQ,SAAE,QAAQ,cAAG,SAAS,EAAE,GAAG,UAAS,GAAG;IACpD,IAAI,UAAU,CAAC,CAAC,EAAE,OAAO;IAEzB,qBACE,gCAAC;QAAS,GAAG,QAAQ;QAAE,KAAK;QAAK,WAAW,sBAAA,uBAAA,YAAa;OACtD;AAGP","sources":["packages/react-aria-components/src/Heading.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 {HeadingContext} from './RSPContexts';\nimport React, {ElementType, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\nimport {useContextProps} from './utils';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLElement> {\n level?: number\n}\n\nexport const Heading = forwardRef(function Heading(props: HeadingProps, ref: ForwardedRef<HTMLHeadingElement>) {\n [props, ref] = useContextProps(props, ref, HeadingContext);\n let {children, level = 3, className, ...domProps} = props;\n let Element = `h${level}` as ElementType;\n\n return (\n <Element {...domProps} ref={ref} className={className ?? 'react-aria-Heading'}>\n {children}\n </Element>\n );\n});\n"],"names":[],"version":3,"file":"Heading.module.js.map"}
|
package/dist/Input.main.js
CHANGED
|
@@ -34,7 +34,7 @@ let $1bcfcef5af644e13$var$filterHoverProps = (props)=>{
|
|
|
34
34
|
let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
|
|
35
35
|
return otherProps;
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
const $1bcfcef5af644e13$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $fA2o8$reactariacollections.createHideableComponent)(function Input(props, ref) {
|
|
38
38
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $1bcfcef5af644e13$export$37fb8590cf2c088c);
|
|
39
39
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fA2o8$reactaria.useHover)(props);
|
|
40
40
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $fA2o8$reactaria.useFocusRing)({
|
|
@@ -63,10 +63,7 @@ function $1bcfcef5af644e13$var$Input(props, ref) {
|
|
|
63
63
|
"data-focus-visible": isFocusVisible || undefined,
|
|
64
64
|
"data-invalid": isInvalid || undefined
|
|
65
65
|
});
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* An input allows a user to input text.
|
|
69
|
-
*/ const $1bcfcef5af644e13$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $fA2o8$reactariacollections.createHideableComponent)($1bcfcef5af644e13$var$Input);
|
|
66
|
+
});
|
|
70
67
|
|
|
71
68
|
|
|
72
69
|
//# sourceMappingURL=Input.main.js.map
|
package/dist/Input.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAqCM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAA8C,CAAC;AAEvF,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAqCM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAA8C,CAAC;AAEvF,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,4CAAQ,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE,SAAS,MAAM,KAAiB,EAAE,GAAmC;IAC9H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/Input.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 {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport React, {createContext, ForwardedRef, InputHTMLAttributes} from 'react';\n\nexport interface InputRenderProps {\n /**\n * Whether the input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the input is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {}\n\nexport const InputContext = createContext<ContextValue<InputProps, HTMLInputElement>>({});\n\nlet filterHoverProps = (props: InputProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * An input allows a user to input text.\n */\nexport const Input = /*#__PURE__*/ createHideableComponent(function Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n [props, ref] = useContextProps(props, ref, InputContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-Input'\n });\n\n return (\n <input\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Input.main.js.map"}
|
package/dist/Input.mjs
CHANGED
|
@@ -23,7 +23,7 @@ let $3985021b0ad6602f$var$filterHoverProps = (props)=>{
|
|
|
23
23
|
let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
|
|
24
24
|
return otherProps;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const $3985021b0ad6602f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $jMZTB$createHideableComponent)(function Input(props, ref) {
|
|
27
27
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $3985021b0ad6602f$export$37fb8590cf2c088c);
|
|
28
28
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jMZTB$useHover)(props);
|
|
29
29
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $jMZTB$useFocusRing)({
|
|
@@ -52,10 +52,7 @@ function $3985021b0ad6602f$var$Input(props, ref) {
|
|
|
52
52
|
"data-focus-visible": isFocusVisible || undefined,
|
|
53
53
|
"data-invalid": isInvalid || undefined
|
|
54
54
|
});
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* An input allows a user to input text.
|
|
58
|
-
*/ const $3985021b0ad6602f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $jMZTB$createHideableComponent)($3985021b0ad6602f$var$Input);
|
|
55
|
+
});
|
|
59
56
|
|
|
60
57
|
|
|
61
58
|
export {$3985021b0ad6602f$export$37fb8590cf2c088c as InputContext, $3985021b0ad6602f$export$f5b8910cec6cf069 as Input};
|
package/dist/Input.module.js
CHANGED
|
@@ -23,7 +23,7 @@ let $3985021b0ad6602f$var$filterHoverProps = (props)=>{
|
|
|
23
23
|
let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
|
|
24
24
|
return otherProps;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const $3985021b0ad6602f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $jMZTB$createHideableComponent)(function Input(props, ref) {
|
|
27
27
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $3985021b0ad6602f$export$37fb8590cf2c088c);
|
|
28
28
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jMZTB$useHover)(props);
|
|
29
29
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $jMZTB$useFocusRing)({
|
|
@@ -52,10 +52,7 @@ function $3985021b0ad6602f$var$Input(props, ref) {
|
|
|
52
52
|
"data-focus-visible": isFocusVisible || undefined,
|
|
53
53
|
"data-invalid": isInvalid || undefined
|
|
54
54
|
});
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* An input allows a user to input text.
|
|
58
|
-
*/ const $3985021b0ad6602f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $jMZTB$createHideableComponent)($3985021b0ad6602f$var$Input);
|
|
55
|
+
});
|
|
59
56
|
|
|
60
57
|
|
|
61
58
|
export {$3985021b0ad6602f$export$37fb8590cf2c088c as InputContext, $3985021b0ad6602f$export$f5b8910cec6cf069 as Input};
|
package/dist/Input.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAqCM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA8C,CAAC;AAEvF,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;
|
|
1
|
+
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAqCM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA8C,CAAC;AAEvF,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,4CAAQ,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,MAAM,KAAiB,EAAE,GAAmC;IAC9H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/Input.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 {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport React, {createContext, ForwardedRef, InputHTMLAttributes} from 'react';\n\nexport interface InputRenderProps {\n /**\n * Whether the input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the input is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {}\n\nexport const InputContext = createContext<ContextValue<InputProps, HTMLInputElement>>({});\n\nlet filterHoverProps = (props: InputProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * An input allows a user to input text.\n */\nexport const Input = /*#__PURE__*/ createHideableComponent(function Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n [props, ref] = useContextProps(props, ref, InputContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-Input'\n });\n\n return (\n <input\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Input.module.js.map"}
|
package/dist/Keyboard.main.js
CHANGED
|
@@ -25,15 +25,14 @@ $parcel$export(module.exports, "Keyboard", () => $70c886ca98ebdc2b$export$16e4d7
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
const $70c886ca98ebdc2b$export$744d98a3b8a94e1c = /*#__PURE__*/ (0, $jeUoS$react.createContext)({});
|
|
28
|
-
|
|
28
|
+
const $70c886ca98ebdc2b$export$16e4d70cc375e707 = /*#__PURE__*/ (0, $jeUoS$react.forwardRef)(function Keyboard(props, ref) {
|
|
29
29
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $70c886ca98ebdc2b$export$744d98a3b8a94e1c);
|
|
30
30
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($jeUoS$react))).createElement("kbd", {
|
|
31
31
|
dir: "ltr",
|
|
32
32
|
...props,
|
|
33
33
|
ref: ref
|
|
34
34
|
});
|
|
35
|
-
}
|
|
36
|
-
const $70c886ca98ebdc2b$export$16e4d70cc375e707 = /*#__PURE__*/ (0, $jeUoS$react.forwardRef)($70c886ca98ebdc2b$var$Keyboard);
|
|
35
|
+
});
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
//# sourceMappingURL=Keyboard.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAKM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA0D,CAAC;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAKM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA0D,CAAC;AAE/F,MAAM,0DAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAAS,KAAkC,EAAE,GAA8B;IACrH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBAAO,0DAAC;QAAI,KAAI;QAAO,GAAG,KAAK;QAAE,KAAK;;AACxC","sources":["packages/react-aria-components/src/Keyboard.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 {ContextValue, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport const KeyboardContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>>({});\n\nexport const Keyboard = forwardRef(function Keyboard(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, KeyboardContext);\n return <kbd dir=\"ltr\" {...props} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Keyboard.main.js.map"}
|
package/dist/Keyboard.mjs
CHANGED
|
@@ -14,15 +14,14 @@ import $3zqIJ$react, {createContext as $3zqIJ$createContext, forwardRef as $3zqI
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const $63df2425e2108aa8$export$744d98a3b8a94e1c = /*#__PURE__*/ (0, $3zqIJ$createContext)({});
|
|
17
|
-
|
|
17
|
+
const $63df2425e2108aa8$export$16e4d70cc375e707 = /*#__PURE__*/ (0, $3zqIJ$forwardRef)(function Keyboard(props, ref) {
|
|
18
18
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $63df2425e2108aa8$export$744d98a3b8a94e1c);
|
|
19
19
|
return /*#__PURE__*/ (0, $3zqIJ$react).createElement("kbd", {
|
|
20
20
|
dir: "ltr",
|
|
21
21
|
...props,
|
|
22
22
|
ref: ref
|
|
23
23
|
});
|
|
24
|
-
}
|
|
25
|
-
const $63df2425e2108aa8$export$16e4d70cc375e707 = /*#__PURE__*/ (0, $3zqIJ$forwardRef)($63df2425e2108aa8$var$Keyboard);
|
|
24
|
+
});
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
export {$63df2425e2108aa8$export$744d98a3b8a94e1c as KeyboardContext, $63df2425e2108aa8$export$16e4d70cc375e707 as Keyboard};
|
package/dist/Keyboard.module.js
CHANGED
|
@@ -14,15 +14,14 @@ import $3zqIJ$react, {createContext as $3zqIJ$createContext, forwardRef as $3zqI
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const $63df2425e2108aa8$export$744d98a3b8a94e1c = /*#__PURE__*/ (0, $3zqIJ$createContext)({});
|
|
17
|
-
|
|
17
|
+
const $63df2425e2108aa8$export$16e4d70cc375e707 = /*#__PURE__*/ (0, $3zqIJ$forwardRef)(function Keyboard(props, ref) {
|
|
18
18
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $63df2425e2108aa8$export$744d98a3b8a94e1c);
|
|
19
19
|
return /*#__PURE__*/ (0, $3zqIJ$react).createElement("kbd", {
|
|
20
20
|
dir: "ltr",
|
|
21
21
|
...props,
|
|
22
22
|
ref: ref
|
|
23
23
|
});
|
|
24
|
-
}
|
|
25
|
-
const $63df2425e2108aa8$export$16e4d70cc375e707 = /*#__PURE__*/ (0, $3zqIJ$forwardRef)($63df2425e2108aa8$var$Keyboard);
|
|
24
|
+
});
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
export {$63df2425e2108aa8$export$744d98a3b8a94e1c as KeyboardContext, $63df2425e2108aa8$export$16e4d70cc375e707 as Keyboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAKM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA0D,CAAC;
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAKM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA0D,CAAC;AAE/F,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAAS,KAAkC,EAAE,GAA8B;IACrH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBAAO,gCAAC;QAAI,KAAI;QAAO,GAAG,KAAK;QAAE,KAAK;;AACxC","sources":["packages/react-aria-components/src/Keyboard.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 {ContextValue, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport const KeyboardContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>>({});\n\nexport const Keyboard = forwardRef(function Keyboard(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, KeyboardContext);\n return <kbd dir=\"ltr\" {...props} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Keyboard.module.js.map"}
|
package/dist/Label.main.js
CHANGED
|
@@ -27,7 +27,7 @@ $parcel$export(module.exports, "Label", () => $84ae0bf5bd8e2a5f$export$b04be29aa
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
const $84ae0bf5bd8e2a5f$export$75b6ee27786ba447 = /*#__PURE__*/ (0, $4aAuT$react.createContext)({});
|
|
30
|
-
|
|
30
|
+
const $84ae0bf5bd8e2a5f$export$b04be29aa201d4f5 = /*#__PURE__*/ (0, $4aAuT$reactariacollections.createHideableComponent)(function Label(props, ref) {
|
|
31
31
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $84ae0bf5bd8e2a5f$export$75b6ee27786ba447);
|
|
32
32
|
let { elementType: ElementType = 'label', ...labelProps } = props;
|
|
33
33
|
// @ts-ignore
|
|
@@ -36,8 +36,7 @@ function $84ae0bf5bd8e2a5f$var$Label(props, ref) {
|
|
|
36
36
|
...labelProps,
|
|
37
37
|
ref: ref
|
|
38
38
|
});
|
|
39
|
-
}
|
|
40
|
-
const $84ae0bf5bd8e2a5f$export$b04be29aa201d4f5 = /*#__PURE__*/ (0, $4aAuT$reactariacollections.createHideableComponent)($84ae0bf5bd8e2a5f$var$Label);
|
|
39
|
+
});
|
|
41
40
|
|
|
42
41
|
|
|
43
42
|
//# sourceMappingURL=Label.main.js.map
|
package/dist/Label.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAUM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAA8C,CAAC;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAUM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAA8C,CAAC;AAEhF,MAAM,4CAAQ,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE,SAAS,MAAM,KAAiB,EAAE,GAAmC;IAC9H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,aAAa,cAAc,OAAO,EAAE,GAAG,YAAW,GAAG;IAC1D,aAAa;IACb,qBAAO,0DAAC;QAAY,WAAU;QAAoB,GAAG,UAAU;QAAE,KAAK;;AACxE","sources":["packages/react-aria-components/src/Label.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 {ContextValue, useContextProps} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport React, {createContext, ForwardedRef, LabelHTMLAttributes} from 'react';\n\nexport interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n elementType?: string\n}\n\nexport const LabelContext = createContext<ContextValue<LabelProps, HTMLLabelElement>>({});\n\nexport const Label = /*#__PURE__*/ createHideableComponent(function Label(props: LabelProps, ref: ForwardedRef<HTMLLabelElement>) {\n [props, ref] = useContextProps(props, ref, LabelContext);\n let {elementType: ElementType = 'label', ...labelProps} = props;\n // @ts-ignore\n return <ElementType className=\"react-aria-Label\" {...labelProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Label.main.js.map"}
|
package/dist/Label.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import $kc2Tc$react, {createContext as $kc2Tc$createContext} from "react";
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const $01b77f81d0f07f68$export$75b6ee27786ba447 = /*#__PURE__*/ (0, $kc2Tc$createContext)({});
|
|
19
|
-
|
|
19
|
+
const $01b77f81d0f07f68$export$b04be29aa201d4f5 = /*#__PURE__*/ (0, $kc2Tc$createHideableComponent)(function Label(props, ref) {
|
|
20
20
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $01b77f81d0f07f68$export$75b6ee27786ba447);
|
|
21
21
|
let { elementType: ElementType = 'label', ...labelProps } = props;
|
|
22
22
|
// @ts-ignore
|
|
@@ -25,8 +25,7 @@ function $01b77f81d0f07f68$var$Label(props, ref) {
|
|
|
25
25
|
...labelProps,
|
|
26
26
|
ref: ref
|
|
27
27
|
});
|
|
28
|
-
}
|
|
29
|
-
const $01b77f81d0f07f68$export$b04be29aa201d4f5 = /*#__PURE__*/ (0, $kc2Tc$createHideableComponent)($01b77f81d0f07f68$var$Label);
|
|
28
|
+
});
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
export {$01b77f81d0f07f68$export$75b6ee27786ba447 as LabelContext, $01b77f81d0f07f68$export$b04be29aa201d4f5 as Label};
|
package/dist/Label.module.js
CHANGED
|
@@ -16,7 +16,7 @@ import $kc2Tc$react, {createContext as $kc2Tc$createContext} from "react";
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const $01b77f81d0f07f68$export$75b6ee27786ba447 = /*#__PURE__*/ (0, $kc2Tc$createContext)({});
|
|
19
|
-
|
|
19
|
+
const $01b77f81d0f07f68$export$b04be29aa201d4f5 = /*#__PURE__*/ (0, $kc2Tc$createHideableComponent)(function Label(props, ref) {
|
|
20
20
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $01b77f81d0f07f68$export$75b6ee27786ba447);
|
|
21
21
|
let { elementType: ElementType = 'label', ...labelProps } = props;
|
|
22
22
|
// @ts-ignore
|
|
@@ -25,8 +25,7 @@ function $01b77f81d0f07f68$var$Label(props, ref) {
|
|
|
25
25
|
...labelProps,
|
|
26
26
|
ref: ref
|
|
27
27
|
});
|
|
28
|
-
}
|
|
29
|
-
const $01b77f81d0f07f68$export$b04be29aa201d4f5 = /*#__PURE__*/ (0, $kc2Tc$createHideableComponent)($01b77f81d0f07f68$var$Label);
|
|
28
|
+
});
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
export {$01b77f81d0f07f68$export$75b6ee27786ba447 as LabelContext, $01b77f81d0f07f68$export$b04be29aa201d4f5 as Label};
|
package/dist/Label.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAUM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA8C,CAAC;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAUM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA8C,CAAC;AAEhF,MAAM,4CAAQ,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,MAAM,KAAiB,EAAE,GAAmC;IAC9H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,aAAa,cAAc,OAAO,EAAE,GAAG,YAAW,GAAG;IAC1D,aAAa;IACb,qBAAO,gCAAC;QAAY,WAAU;QAAoB,GAAG,UAAU;QAAE,KAAK;;AACxE","sources":["packages/react-aria-components/src/Label.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 {ContextValue, useContextProps} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport React, {createContext, ForwardedRef, LabelHTMLAttributes} from 'react';\n\nexport interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n elementType?: string\n}\n\nexport const LabelContext = createContext<ContextValue<LabelProps, HTMLLabelElement>>({});\n\nexport const Label = /*#__PURE__*/ createHideableComponent(function Label(props: LabelProps, ref: ForwardedRef<HTMLLabelElement>) {\n [props, ref] = useContextProps(props, ref, LabelContext);\n let {elementType: ElementType = 'label', ...labelProps} = props;\n // @ts-ignore\n return <ElementType className=\"react-aria-Label\" {...labelProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Label.module.js.map"}
|
package/dist/Link.main.js
CHANGED
|
@@ -27,7 +27,7 @@ $parcel$export(module.exports, "Link", () => $c87397ee936d2bda$export$a6c7ac8248
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
const $c87397ee936d2bda$export$e2509388b49734e7 = /*#__PURE__*/ (0, $7KWRi$react.createContext)(null);
|
|
30
|
-
|
|
30
|
+
const $c87397ee936d2bda$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $7KWRi$react.forwardRef)(function Link(props, ref) {
|
|
31
31
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $c87397ee936d2bda$export$e2509388b49734e7);
|
|
32
32
|
let ElementType = props.href && !props.isDisabled ? 'a' : 'span';
|
|
33
33
|
let { linkProps: linkProps, isPressed: isPressed } = (0, $7KWRi$reactaria.useLink)({
|
|
@@ -59,11 +59,7 @@ function $c87397ee936d2bda$var$Link(props, ref) {
|
|
|
59
59
|
"data-current": !!props['aria-current'] || undefined,
|
|
60
60
|
"data-disabled": props.isDisabled || undefined
|
|
61
61
|
}, renderProps.children);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* A link allows a user to navigate to another page or resource within a web page
|
|
65
|
-
* or application.
|
|
66
|
-
*/ const $c87397ee936d2bda$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $7KWRi$react.forwardRef)($c87397ee936d2bda$var$Link);
|
|
62
|
+
});
|
|
67
63
|
|
|
68
64
|
|
|
69
65
|
//# sourceMappingURL=Link.main.js.map
|
package/dist/Link.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAA8C;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAA8C;AAM9E,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAoC;IACnI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAA2B,MAAM,IAAI,IAAI,CAAC,MAAM,UAAU,GAAG,MAAM;IACvE,IAAI,aAAC,SAAS,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,wBAAM,EAAE;QAAC,GAAG,KAAK;QAAE,aAAa;IAAW,GAAG;IAE3E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW;IAEzD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,WAAW,CAAC,CAAC,KAAK,CAAC,eAAe;YAClC,YAAY,MAAM,UAAU,IAAI;uBAChC;uBACA;uBACA;4BACA;QACF;IACF;IAEA,qBACE,0DAAC;QACC,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACnB,GAAG,CAAA,GAAA,2BAAS,EAAE,aAAa,WAAW,YAAY,WAAW;QAC9D,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI;QACzC,iBAAe,MAAM,UAAU,IAAK;OACnC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Link.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 {AriaLinkOptions, HoverEvents, mergeProps, useFocusRing, useHover, useLink} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {forwardRefType} from '@react-types/shared';\nimport React, {createContext, ElementType, ForwardedRef, forwardRef} from 'react';\n\nexport interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, HoverEvents, RenderProps<LinkRenderProps>, SlotProps {}\n\nexport interface LinkRenderProps {\n /**\n * Whether the link is the current item within a list.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the link is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the link is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the link is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the link is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the link is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport const LinkContext = createContext<ContextValue<LinkProps, HTMLAnchorElement>>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport const Link = /*#__PURE__*/ (forwardRef as forwardRefType)(function Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n [props, ref] = useContextProps(props, ref, LinkContext);\n\n let ElementType: ElementType = props.href && !props.isDisabled ? 'a' : 'span';\n let {linkProps, isPressed} = useLink({...props, elementType: ElementType}, ref);\n\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Link',\n values: {\n isCurrent: !!props['aria-current'],\n isDisabled: props.isDisabled || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <ElementType\n ref={ref}\n slot={props.slot || undefined}\n {...mergeProps(renderProps, linkProps, hoverProps, focusProps)}\n data-focused={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-pressed={isPressed || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-current={!!props['aria-current'] || undefined}\n data-disabled={props.isDisabled || undefined}>\n {renderProps.children}\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Link.main.js.map"}
|
package/dist/Link.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import $115DY$react, {createContext as $115DY$createContext, forwardRef as $115D
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const $4f118338184dc1d9$export$e2509388b49734e7 = /*#__PURE__*/ (0, $115DY$createContext)(null);
|
|
19
|
-
|
|
19
|
+
const $4f118338184dc1d9$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $115DY$forwardRef)(function Link(props, ref) {
|
|
20
20
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $4f118338184dc1d9$export$e2509388b49734e7);
|
|
21
21
|
let ElementType = props.href && !props.isDisabled ? 'a' : 'span';
|
|
22
22
|
let { linkProps: linkProps, isPressed: isPressed } = (0, $115DY$useLink)({
|
|
@@ -48,11 +48,7 @@ function $4f118338184dc1d9$var$Link(props, ref) {
|
|
|
48
48
|
"data-current": !!props['aria-current'] || undefined,
|
|
49
49
|
"data-disabled": props.isDisabled || undefined
|
|
50
50
|
}, renderProps.children);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* A link allows a user to navigate to another page or resource within a web page
|
|
54
|
-
* or application.
|
|
55
|
-
*/ const $4f118338184dc1d9$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $115DY$forwardRef)($4f118338184dc1d9$var$Link);
|
|
51
|
+
});
|
|
56
52
|
|
|
57
53
|
|
|
58
54
|
export {$4f118338184dc1d9$export$e2509388b49734e7 as LinkContext, $4f118338184dc1d9$export$a6c7ac8248d6e38a as Link};
|
package/dist/Link.module.js
CHANGED
|
@@ -16,7 +16,7 @@ import $115DY$react, {createContext as $115DY$createContext, forwardRef as $115D
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const $4f118338184dc1d9$export$e2509388b49734e7 = /*#__PURE__*/ (0, $115DY$createContext)(null);
|
|
19
|
-
|
|
19
|
+
const $4f118338184dc1d9$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $115DY$forwardRef)(function Link(props, ref) {
|
|
20
20
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $4f118338184dc1d9$export$e2509388b49734e7);
|
|
21
21
|
let ElementType = props.href && !props.isDisabled ? 'a' : 'span';
|
|
22
22
|
let { linkProps: linkProps, isPressed: isPressed } = (0, $115DY$useLink)({
|
|
@@ -48,11 +48,7 @@ function $4f118338184dc1d9$var$Link(props, ref) {
|
|
|
48
48
|
"data-current": !!props['aria-current'] || undefined,
|
|
49
49
|
"data-disabled": props.isDisabled || undefined
|
|
50
50
|
}, renderProps.children);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* A link allows a user to navigate to another page or resource within a web page
|
|
54
|
-
* or application.
|
|
55
|
-
*/ const $4f118338184dc1d9$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $115DY$forwardRef)($4f118338184dc1d9$var$Link);
|
|
51
|
+
});
|
|
56
52
|
|
|
57
53
|
|
|
58
54
|
export {$4f118338184dc1d9$export$e2509388b49734e7 as LinkContext, $4f118338184dc1d9$export$a6c7ac8248d6e38a as Link};
|
package/dist/Link.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA8C;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA8C;AAM9E,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAoC;IACnI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAA2B,MAAM,IAAI,IAAI,CAAC,MAAM,UAAU,GAAG,MAAM;IACvE,IAAI,aAAC,SAAS,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,cAAM,EAAE;QAAC,GAAG,KAAK;QAAE,aAAa;IAAW,GAAG;IAE3E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IAEzD,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,WAAW,CAAC,CAAC,KAAK,CAAC,eAAe;YAClC,YAAY,MAAM,UAAU,IAAI;uBAChC;uBACA;uBACA;4BACA;QACF;IACF;IAEA,qBACE,gCAAC;QACC,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,WAAW,YAAY,WAAW;QAC9D,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI;QACzC,iBAAe,MAAM,UAAU,IAAK;OACnC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Link.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 {AriaLinkOptions, HoverEvents, mergeProps, useFocusRing, useHover, useLink} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {forwardRefType} from '@react-types/shared';\nimport React, {createContext, ElementType, ForwardedRef, forwardRef} from 'react';\n\nexport interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, HoverEvents, RenderProps<LinkRenderProps>, SlotProps {}\n\nexport interface LinkRenderProps {\n /**\n * Whether the link is the current item within a list.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the link is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the link is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the link is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the link is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the link is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport const LinkContext = createContext<ContextValue<LinkProps, HTMLAnchorElement>>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport const Link = /*#__PURE__*/ (forwardRef as forwardRefType)(function Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n [props, ref] = useContextProps(props, ref, LinkContext);\n\n let ElementType: ElementType = props.href && !props.isDisabled ? 'a' : 'span';\n let {linkProps, isPressed} = useLink({...props, elementType: ElementType}, ref);\n\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Link',\n values: {\n isCurrent: !!props['aria-current'],\n isDisabled: props.isDisabled || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <ElementType\n ref={ref}\n slot={props.slot || undefined}\n {...mergeProps(renderProps, linkProps, hoverProps, focusProps)}\n data-focused={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-pressed={isPressed || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-current={!!props['aria-current'] || undefined}\n data-disabled={props.isDisabled || undefined}>\n {renderProps.children}\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Link.module.js.map"}
|
package/dist/ListBox.main.js
CHANGED
|
@@ -47,7 +47,7 @@ $parcel$export(module.exports, "ListBoxItem", () => $a03b42240404b420$export$a11
|
|
|
47
47
|
|
|
48
48
|
const $a03b42240404b420$export$7ff8f37d2d81a48d = /*#__PURE__*/ (0, $59TRP$react.createContext)(null);
|
|
49
49
|
const $a03b42240404b420$export$7c5906fe4f1f2af2 = /*#__PURE__*/ (0, $59TRP$react.createContext)(null);
|
|
50
|
-
|
|
50
|
+
const $a03b42240404b420$export$41f133550aa26f48 = /*#__PURE__*/ (0, $59TRP$react.forwardRef)(function ListBox(props, ref) {
|
|
51
51
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $a03b42240404b420$export$7ff8f37d2d81a48d);
|
|
52
52
|
let state = (0, $59TRP$react.useContext)($a03b42240404b420$export$7c5906fe4f1f2af2);
|
|
53
53
|
// The structure of ListBox is a bit strange because it needs to work inside other components like ComboBox and Select.
|
|
@@ -67,7 +67,7 @@ function $a03b42240404b420$var$ListBox(props, ref) {
|
|
|
67
67
|
listBoxRef: ref,
|
|
68
68
|
collection: collection
|
|
69
69
|
}));
|
|
70
|
-
}
|
|
70
|
+
});
|
|
71
71
|
function $a03b42240404b420$var$StandaloneListBox({ props: props, listBoxRef: listBoxRef, collection: collection }) {
|
|
72
72
|
props = {
|
|
73
73
|
...props,
|
|
@@ -86,9 +86,6 @@ function $a03b42240404b420$var$StandaloneListBox({ props: props, listBoxRef: lis
|
|
|
86
86
|
listBoxRef: listBoxRef
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
/**
|
|
90
|
-
* A listbox displays a list of options and allows a user to select one or more of them.
|
|
91
|
-
*/ const $a03b42240404b420$export$41f133550aa26f48 = /*#__PURE__*/ (0, $59TRP$react.forwardRef)($a03b42240404b420$var$ListBox);
|
|
92
89
|
function $a03b42240404b420$var$ListBoxInner({ state: state, props: props, listBoxRef: listBoxRef }) {
|
|
93
90
|
let { dragAndDropHooks: dragAndDropHooks, layout: layout = 'stack', orientation: orientation = 'vertical' } = props;
|
|
94
91
|
let { collection: collection, selectionManager: selectionManager } = state;
|
|
@@ -244,7 +241,7 @@ function $a03b42240404b420$var$ListBoxInner({ state: state, props: props, listBo
|
|
|
244
241
|
(0, $3114c2382242bdc0$exports.SectionContext),
|
|
245
242
|
{
|
|
246
243
|
name: 'ListBoxSection',
|
|
247
|
-
render: $a03b42240404b420$var$
|
|
244
|
+
render: $a03b42240404b420$var$ListBoxSectionInner
|
|
248
245
|
}
|
|
249
246
|
]
|
|
250
247
|
]
|
|
@@ -255,7 +252,7 @@ function $a03b42240404b420$var$ListBoxInner({ state: state, props: props, listBo
|
|
|
255
252
|
renderDropIndicator: (0, $0c2289d253cb4544$exports.useRenderDropIndicator)(dragAndDropHooks, dropState)
|
|
256
253
|
})), emptyState, dragPreview));
|
|
257
254
|
}
|
|
258
|
-
function $a03b42240404b420$var$
|
|
255
|
+
function $a03b42240404b420$var$ListBoxSectionInner(props, ref, section, className = 'react-aria-ListBoxSection') {
|
|
259
256
|
let state = (0, $59TRP$react.useContext)($a03b42240404b420$export$7c5906fe4f1f2af2);
|
|
260
257
|
let { dragAndDropHooks: dragAndDropHooks, dropState: dropState } = (0, $59TRP$react.useContext)((0, $0c2289d253cb4544$exports.DragAndDropContext));
|
|
261
258
|
let { CollectionBranch: CollectionBranch } = (0, $59TRP$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
|
|
@@ -287,9 +284,7 @@ function $a03b42240404b420$var$ListBoxSection(props, ref, section, className = '
|
|
|
287
284
|
renderDropIndicator: (0, $0c2289d253cb4544$exports.useRenderDropIndicator)(dragAndDropHooks, dropState)
|
|
288
285
|
})));
|
|
289
286
|
}
|
|
290
|
-
|
|
291
|
-
* A ListBoxSection represents a section within a ListBox.
|
|
292
|
-
*/ const $a03b42240404b420$export$dca12b0bb56e4fc = /*#__PURE__*/ (0, $59TRP$reactariacollections.createBranchComponent)('section', $a03b42240404b420$var$ListBoxSection);
|
|
287
|
+
const $a03b42240404b420$export$dca12b0bb56e4fc = /*#__PURE__*/ (0, $59TRP$reactariacollections.createBranchComponent)('section', $a03b42240404b420$var$ListBoxSectionInner);
|
|
293
288
|
const $a03b42240404b420$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $59TRP$reactariacollections.createLeafComponent)('item', function ListBoxItem(props, forwardedRef, item) {
|
|
294
289
|
let ref = (0, $59TRP$reactariautils.useObjectRef)(forwardedRef);
|
|
295
290
|
let state = (0, $59TRP$react.useContext)($a03b42240404b420$export$7c5906fe4f1f2af2);
|
package/dist/ListBox.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAoEM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AACtF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAErE,SAAS,8BAA0B,KAAsB,EAAE,GAAiC;IAC1F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,uBAAS,EAAE;IAEvB,uHAAuH;IACvH,4HAA4H;IAC5H,qGAAqG;IACrG,wHAAwH;IACxH,kGAAkG;IAElG,IAAI,OACF,qBAAO,0DAAC;QAAa,OAAO;QAAO,OAAO;QAAO,YAAY;;IAG/D,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,uBAAS,0DAAC,CAAA,GAAA,sCAAS,GAAM;OACzC,CAAA,2BAAc,0DAAC;YAAkB,OAAO;YAAO,YAAY;YAAK,YAAY;;AAGnF;AAEA,SAAS,wCAAkB,SAAC,KAAK,cAAE,UAAU,cAAE,UAAU,EAAC;IACxD,QAAQ;QAAC,GAAG,KAAK;oBAAE;QAAY,UAAU;QAAM,OAAO;IAAI;IAC1D,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IAC1D,IAAI,QAAQ,CAAA,GAAA,gCAAW,EAAE;QAAC,GAAG,KAAK;wBAA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,KAAK;QAAE,oBAAoB;QAAoB,cAAc;QAAc,KAAK;;AAExH;AAOA,SAAS,2CAAqB,KAAgC,EAAE,GAA8B;IAC5F,IAAI,sBACF,kBAAkB,gBAClB,YAAY,EACZ,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,kBAAkB;QAClB,QAAQ;0BACN;QACF;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,kBAAkB;QACrB,GAAG,WAAW;QACf,2BAA2B;QAC3B,MAAK;QACL,KAAK;QACL,oBAAkB,gBAAgB;;AAExC;AAEA,MAAM,qEAAiC,CAAA,GAAA,uBAAS,EAAE","sources":["packages/react-aria-components/src/ListBox.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 {AriaListBoxOptions, AriaListBoxProps, DraggableItemResult, DragPreviewRenderer, DroppableCollectionResult, DroppableItemResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useHover, useListBox, useListBoxSection, useLocale, useOption} from 'react-aria';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps} from './Collection';\nimport {ContextValue, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, ListState, Node, Orientation, SelectionBehavior, useListState} from 'react-stately';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\n\nexport interface ListBoxRenderProps {\n /**\n * Whether the listbox has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the listbox is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the listbox is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the listbox is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the listbox.\n */\n state: ListState<unknown>\n}\n\nexport interface ListBoxProps<T> extends Omit<AriaListBoxProps<T>, 'children' | 'label'>, CollectionProps<T>, StyleRenderProps<ListBoxRenderProps>, SlotProps, ScrollableProps<HTMLDivElement> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListBox. */\n dragAndDropHooks?: DragAndDropHooks,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: ListBoxRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation\n}\n\nexport const ListBoxContext = createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\nexport const ListStateContext = createContext<ListState<any> | null>(null);\n\nfunction ListBox<T extends object>(props: ListBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ListBoxContext);\n let state = useContext(ListStateContext);\n\n // The structure of ListBox is a bit strange because it needs to work inside other components like ComboBox and Select.\n // Those components render two copies of their children so that the collection can be built even when the popover is closed.\n // The first copy sends a collection document via context which we render the collection portal into.\n // The second copy sends a ListState object via context which we use to render the ListBox without rebuilding the state.\n // Otherwise, we have a standalone ListBox, so we need to create a collection and state ourselves.\n\n if (state) {\n return <ListBoxInner state={state} props={props} listBoxRef={ref} />;\n }\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <StandaloneListBox props={props} listBoxRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n}\n\nfunction StandaloneListBox({props, listBoxRef, collection}) {\n props = {...props, collection, children: null, items: null};\n let {layoutDelegate} = useContext(CollectionRendererContext);\n let state = useListState({...props, layoutDelegate});\n return <ListBoxInner state={state} props={props} listBoxRef={listBoxRef} />;\n}\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nconst _ListBox = /*#__PURE__*/ (forwardRef as forwardRefType)(ListBox);\nexport {_ListBox as ListBox};\n\ninterface ListBoxInnerProps<T> {\n state: ListState<T>,\n props: ListBoxProps<T> & AriaListBoxOptions<T>,\n listBoxRef: RefObject<HTMLDivElement | null>\n}\n\nfunction ListBoxInner<T extends object>({state, props, listBoxRef}: ListBoxInnerProps<T>) {\n let {dragAndDropHooks, layout = 'stack', orientation = 'vertical'} = props;\n let {collection, selectionManager} = state;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let {direction} = useLocale();\n let {disabledBehavior, disabledKeys} = selectionManager;\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate, CollectionRoot} = useContext(CollectionRendererContext);\n let keyboardDelegate = useMemo(() => (\n props.keyboardDelegate || new ListKeyboardDelegate({\n collection,\n collator,\n ref: listBoxRef,\n disabledKeys,\n disabledBehavior,\n layout,\n orientation,\n direction,\n layoutDelegate\n })\n ), [collection, collator, listBoxRef, disabledBehavior, disabledKeys, orientation, direction, props.keyboardDelegate, layout, layoutDelegate]);\n\n let {listBoxProps} = useListBox({\n ...props,\n shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp,\n keyboardDelegate,\n isVirtualized\n }, state, listBoxRef);\n\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, listBoxRef);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, listBoxRef, {orientation, layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, listBoxRef);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n layout: props.layout || 'stack',\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-ListBox',\n values: renderValues\n });\n\n let emptyState: JSX.Element | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n emptyState = (\n <div\n // eslint-disable-next-line\n role=\"option\"\n style={{display: 'contents'}}>\n {props.renderEmptyState(renderValues)}\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...mergeProps(listBoxProps, focusProps, droppableCollection?.collectionProps)}\n {...renderProps}\n ref={listBoxRef}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={props.layout || 'stack'}\n data-orientation={props.orientation || 'vertical'}>\n <Provider\n values={[\n [ListBoxContext, props],\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [SeparatorContext, {elementType: 'div'}],\n [DropIndicatorContext, {render: ListBoxDropIndicatorWrapper}],\n [SectionContext, {name: 'ListBoxSection', render: ListBoxSection}]\n ]}>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface ListBoxSectionProps<T> extends SectionProps<T> {}\n\nfunction ListBoxSection<T extends object>(props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-ListBoxSection') {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useListBoxSection({\n heading,\n 'aria-label': props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: props.className,\n style: props.style,\n values: {}\n });\n\n return (\n <section\n {...filterDOMProps(props as any)}\n {...groupProps}\n {...renderProps}\n ref={ref}>\n <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>\n <CollectionBranch\n collection={state.collection}\n parent={section}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </HeaderContext.Provider>\n </section>\n );\n}\n\n/**\n * A ListBoxSection represents a section within a ListBox.\n */\nconst _ListBoxSection = /*#__PURE__*/ createBranchComponent('section', ListBoxSection);\nexport {_ListBoxSection as ListBoxSection};\n\nexport interface ListBoxItemRenderProps extends ItemRenderProps {}\n\nexport interface ListBoxItemProps<T = object> extends RenderProps<ListBoxItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A ListBoxItem represents an individual option in a ListBox.\n */\nexport const ListBoxItem = /*#__PURE__*/ createLeafComponent('item', function ListBoxItem<T extends object>(props: ListBoxItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let ref = useObjectRef<any>(forwardedRef);\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext)!;\n let {optionProps, labelProps, descriptionProps, ...states} = useOption(\n {key: item.key, 'aria-label': props?.['aria-label']},\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key}, dragState);\n }\n\n let droppableItem: DroppableItemResult | null = null;\n if (dropState && dragAndDropHooks) {\n droppableItem = dragAndDropHooks.useDroppableItem!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, ref);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: props.children,\n defaultClassName: 'react-aria-ListBoxItem',\n values: {\n ...states,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: droppableItem?.isDropTarget\n }\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(optionProps, hoverProps, draggableItem?.dragProps, droppableItem?.dropProps)}\n {...renderProps}\n ref={ref}\n data-allows-dragging={!!dragState || undefined}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={droppableItem?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n label: labelProps,\n description: descriptionProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n\nfunction ListBoxDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n ref\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} ref={ref} />\n );\n}\n\ninterface ListBoxDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean\n}\n\nfunction ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n ...otherProps\n } = props;\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...dropIndicatorProps}\n {...renderProps}\n // eslint-disable-next-line\n role=\"option\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined} />\n );\n}\n\nconst ListBoxDropIndicatorForwardRef = forwardRef(ListBoxDropIndicator);\n"],"names":[],"version":3,"file":"ListBox.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAoEM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AACtF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAK9D,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,QAA0B,KAAsB,EAAE,GAAiC;IAC9J,CAAC,OAAO,I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KAAI;QACjD,uBAAqB,MAAM,gBAAgB,CAAC,aAAa,KAAK,SAAS,YAAY,MAAM,gBAAgB,CAAC,aAAa;qBACvH,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;SACH;OACA,YAAY,QAAQ;AAI7B;AAEA,SAAS,kDAA4B,KAAyB,EAAE,GAA8B;IAC5F,MAAM,CAAA,GAAA,kCAAW,EAAE;IACnB,IAAI,oBAAC,gBAAgB,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,4CAAiB;IAChE,IAAI,sBAAC,kBAAkB,YAAE,QAAQ,gBAAE,YAAY,EAAC,GAAG,iBAAkB,gBAAgB,CACnF,OACA,WACA;IAGF,IAAI,UACF,OAAO;IAGT,qBACE,0DAAC;QAAgC,GAAG,KAAK;QAAE,oBAAoB;QAAoB,cAAc;QAAc,KAAK;;AAExH;AAOA,SAAS,2CAAqB,KAAgC,EAAE,GAA8B;IAC5F,IAAI,sBACF,kBAAkB,gBAClB,YAAY,EACZ,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,kBAAkB;QAClB,QAAQ;0BACN;QACF;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,kBAAkB;QACrB,GAAG,WAAW;QACf,2BAA2B;QAC3B,MAAK;QACL,KAAK;QACL,oBAAkB,gBAAgB;;AAExC;AAEA,MAAM,qEAAiC,CAAA,GAAA,uBAAS,EAAE","sources":["packages/react-aria-components/src/ListBox.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 {AriaListBoxOptions, AriaListBoxProps, DraggableItemResult, DragPreviewRenderer, DroppableCollectionResult, DroppableItemResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useHover, useListBox, useListBoxSection, useLocale, useOption} from 'react-aria';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps} from './Collection';\nimport {ContextValue, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, ListState, Node, Orientation, SelectionBehavior, useListState} from 'react-stately';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\n\nexport interface ListBoxRenderProps {\n /**\n * Whether the listbox has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the listbox is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the listbox is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the listbox is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the listbox.\n */\n state: ListState<unknown>\n}\n\nexport interface ListBoxProps<T> extends Omit<AriaListBoxProps<T>, 'children' | 'label'>, CollectionProps<T>, StyleRenderProps<ListBoxRenderProps>, SlotProps, ScrollableProps<HTMLDivElement> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListBox. */\n dragAndDropHooks?: DragAndDropHooks,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: ListBoxRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation\n}\n\nexport const ListBoxContext = createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\nexport const ListStateContext = createContext<ListState<any> | null>(null);\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport const ListBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function ListBox<T extends object>(props: ListBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ListBoxContext);\n let state = useContext(ListStateContext);\n\n // The structure of ListBox is a bit strange because it needs to work inside other components like ComboBox and Select.\n // Those components render two copies of their children so that the collection can be built even when the popover is closed.\n // The first copy sends a collection document via context which we render the collection portal into.\n // The second copy sends a ListState object via context which we use to render the ListBox without rebuilding the state.\n // Otherwise, we have a standalone ListBox, so we need to create a collection and state ourselves.\n\n if (state) {\n return <ListBoxInner state={state} props={props} listBoxRef={ref} />;\n }\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <StandaloneListBox props={props} listBoxRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\nfunction StandaloneListBox({props, listBoxRef, collection}) {\n props = {...props, collection, children: null, items: null};\n let {layoutDelegate} = useContext(CollectionRendererContext);\n let state = useListState({...props, layoutDelegate});\n return <ListBoxInner state={state} props={props} listBoxRef={listBoxRef} />;\n}\n\ninterface ListBoxInnerProps<T> {\n state: ListState<T>,\n props: ListBoxProps<T> & AriaListBoxOptions<T>,\n listBoxRef: RefObject<HTMLDivElement | null>\n}\n\nfunction ListBoxInner<T extends object>({state, props, listBoxRef}: ListBoxInnerProps<T>) {\n let {dragAndDropHooks, layout = 'stack', orientation = 'vertical'} = props;\n let {collection, selectionManager} = state;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let {direction} = useLocale();\n let {disabledBehavior, disabledKeys} = selectionManager;\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate, CollectionRoot} = useContext(CollectionRendererContext);\n let keyboardDelegate = useMemo(() => (\n props.keyboardDelegate || new ListKeyboardDelegate({\n collection,\n collator,\n ref: listBoxRef,\n disabledKeys,\n disabledBehavior,\n layout,\n orientation,\n direction,\n layoutDelegate\n })\n ), [collection, collator, listBoxRef, disabledBehavior, disabledKeys, orientation, direction, props.keyboardDelegate, layout, layoutDelegate]);\n\n let {listBoxProps} = useListBox({\n ...props,\n shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp,\n keyboardDelegate,\n isVirtualized\n }, state, listBoxRef);\n\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, listBoxRef);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, listBoxRef, {orientation, layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, listBoxRef);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n layout: props.layout || 'stack',\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-ListBox',\n values: renderValues\n });\n\n let emptyState: JSX.Element | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n emptyState = (\n <div\n // eslint-disable-next-line\n role=\"option\"\n style={{display: 'contents'}}>\n {props.renderEmptyState(renderValues)}\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...mergeProps(listBoxProps, focusProps, droppableCollection?.collectionProps)}\n {...renderProps}\n ref={listBoxRef}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={props.layout || 'stack'}\n data-orientation={props.orientation || 'vertical'}>\n <Provider\n values={[\n [ListBoxContext, props],\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [SeparatorContext, {elementType: 'div'}],\n [DropIndicatorContext, {render: ListBoxDropIndicatorWrapper}],\n [SectionContext, {name: 'ListBoxSection', render: ListBoxSectionInner}]\n ]}>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface ListBoxSectionProps<T> extends SectionProps<T> {}\n\nfunction ListBoxSectionInner<T extends object>(props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-ListBoxSection') {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useListBoxSection({\n heading,\n 'aria-label': props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: props.className,\n style: props.style,\n values: {}\n });\n\n return (\n <section\n {...filterDOMProps(props as any)}\n {...groupProps}\n {...renderProps}\n ref={ref}>\n <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>\n <CollectionBranch\n collection={state.collection}\n parent={section}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </HeaderContext.Provider>\n </section>\n );\n}\n\n/**\n * A ListBoxSection represents a section within a ListBox.\n */\nexport const ListBoxSection = /*#__PURE__*/ createBranchComponent('section', ListBoxSectionInner);\n\nexport interface ListBoxItemRenderProps extends ItemRenderProps {}\n\nexport interface ListBoxItemProps<T = object> extends RenderProps<ListBoxItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A ListBoxItem represents an individual option in a ListBox.\n */\nexport const ListBoxItem = /*#__PURE__*/ createLeafComponent('item', function ListBoxItem<T extends object>(props: ListBoxItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let ref = useObjectRef<any>(forwardedRef);\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext)!;\n let {optionProps, labelProps, descriptionProps, ...states} = useOption(\n {key: item.key, 'aria-label': props?.['aria-label']},\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key}, dragState);\n }\n\n let droppableItem: DroppableItemResult | null = null;\n if (dropState && dragAndDropHooks) {\n droppableItem = dragAndDropHooks.useDroppableItem!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, ref);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: props.children,\n defaultClassName: 'react-aria-ListBoxItem',\n values: {\n ...states,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: droppableItem?.isDropTarget\n }\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(optionProps, hoverProps, draggableItem?.dragProps, droppableItem?.dropProps)}\n {...renderProps}\n ref={ref}\n data-allows-dragging={!!dragState || undefined}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={droppableItem?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n label: labelProps,\n description: descriptionProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n\nfunction ListBoxDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n ref\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} ref={ref} />\n );\n}\n\ninterface ListBoxDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean\n}\n\nfunction ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n ...otherProps\n } = props;\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...dropIndicatorProps}\n {...renderProps}\n // eslint-disable-next-line\n role=\"option\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined} />\n );\n}\n\nconst ListBoxDropIndicatorForwardRef = forwardRef(ListBoxDropIndicator);\n"],"names":[],"version":3,"file":"ListBox.main.js.map"}
|