react-aria-components 1.10.1 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Autocomplete.main.js +7 -20
- package/dist/Autocomplete.main.js.map +1 -1
- package/dist/Autocomplete.mjs +8 -20
- package/dist/Autocomplete.module.js +8 -20
- package/dist/Autocomplete.module.js.map +1 -1
- package/dist/Breadcrumbs.main.js +13 -3
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +15 -5
- package/dist/Breadcrumbs.module.js +15 -5
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +7 -17
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +7 -17
- package/dist/Button.module.js +7 -17
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +36 -14
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +38 -16
- package/dist/Calendar.module.js +38 -16
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +8 -3
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +10 -5
- package/dist/Checkbox.module.js +10 -5
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +4 -4
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +5 -5
- package/dist/ColorArea.module.js +5 -5
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +14 -1
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +14 -1
- package/dist/ColorField.module.js +14 -1
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +3 -1
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +3 -1
- package/dist/ColorSlider.module.js +3 -1
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +6 -2
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +6 -2
- package/dist/ColorSwatch.module.js +6 -2
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +3 -1
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -1
- package/dist/ColorThumb.module.js +3 -1
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +3 -1
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +3 -1
- package/dist/ColorWheel.module.js +3 -1
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +4 -1
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +4 -1
- package/dist/ComboBox.module.js +4 -1
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +16 -3
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +16 -3
- package/dist/DateField.module.js +16 -3
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +15 -8
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +16 -9
- package/dist/DatePicker.module.js +16 -9
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +4 -3
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +5 -4
- package/dist/Dialog.module.js +5 -4
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +12 -10
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +13 -11
- package/dist/Disclosure.module.js +13 -11
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +31 -3
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +31 -3
- package/dist/DragAndDrop.module.js +31 -3
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +4 -3
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +4 -3
- package/dist/DropZone.module.js +4 -3
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +3 -1
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -1
- package/dist/FieldError.module.js +3 -1
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +3 -1
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +3 -1
- package/dist/FileTrigger.module.js +3 -1
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +114 -26
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +116 -30
- package/dist/GridList.module.js +116 -30
- package/dist/GridList.module.js.map +1 -1
- package/dist/Header.main.js +1 -1
- package/dist/Header.main.js.map +1 -1
- package/dist/Header.mjs +2 -2
- package/dist/Header.module.js +2 -2
- package/dist/Header.module.js.map +1 -1
- package/dist/HiddenDateInput.main.js +118 -0
- package/dist/HiddenDateInput.main.js.map +1 -0
- package/dist/HiddenDateInput.mjs +109 -0
- package/dist/HiddenDateInput.module.js +109 -0
- package/dist/HiddenDateInput.module.js.map +1 -0
- package/dist/Link.main.js +7 -1
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +7 -1
- package/dist/Link.module.js +7 -1
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +27 -36
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +29 -38
- package/dist/ListBox.module.js +29 -38
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +44 -23
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +47 -26
- package/dist/Menu.module.js +47 -26
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +6 -2
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +6 -2
- package/dist/Meter.module.js +6 -2
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +31 -6
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +31 -6
- package/dist/Modal.module.js +31 -6
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +4 -1
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +4 -1
- package/dist/NumberField.module.js +4 -1
- package/dist/NumberField.module.js.map +1 -1
- package/dist/Popover.main.js +10 -12
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +11 -13
- package/dist/Popover.module.js +11 -13
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +6 -2
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +6 -2
- package/dist/ProgressBar.module.js +6 -2
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +8 -3
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +9 -4
- package/dist/RadioGroup.module.js +9 -4
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +9 -5
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +10 -6
- package/dist/SearchField.module.js +10 -6
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +12 -14
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +13 -15
- package/dist/Select.module.js +13 -15
- package/dist/Select.module.js.map +1 -1
- package/dist/Separator.main.js +17 -3
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +20 -6
- package/dist/Separator.module.js +20 -6
- package/dist/Separator.module.js.map +1 -1
- package/dist/Slider.main.js +7 -5
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +8 -6
- package/dist/Slider.module.js +8 -6
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +4 -1
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +4 -1
- package/dist/Switch.module.js +4 -1
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +104 -42
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +107 -45
- package/dist/Table.module.js +107 -45
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +24 -11
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +26 -13
- package/dist/Tabs.module.js +26 -13
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +27 -12
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +29 -14
- package/dist/TagGroup.module.js +29 -14
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextField.main.js +20 -6
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +21 -7
- package/dist/TextField.module.js +21 -7
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js +9 -5
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.mjs +9 -5
- package/dist/Toast.module.js +9 -5
- package/dist/Toast.module.js.map +1 -1
- package/dist/ToggleButton.main.js +8 -2
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +8 -2
- package/dist/ToggleButton.module.js +8 -2
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +6 -2
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +6 -2
- package/dist/ToggleButtonGroup.module.js +6 -2
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +4 -3
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +4 -3
- package/dist/Toolbar.module.js +4 -3
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +9 -14
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +10 -15
- package/dist/Tooltip.module.js +10 -15
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +81 -28
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +83 -30
- package/dist/Tree.module.js +83 -30
- package/dist/Tree.module.js.map +1 -1
- package/dist/TreeDropTargetDelegate.main.js +8 -5
- package/dist/TreeDropTargetDelegate.main.js.map +1 -1
- package/dist/TreeDropTargetDelegate.mjs +8 -5
- package/dist/TreeDropTargetDelegate.module.js +8 -5
- package/dist/TreeDropTargetDelegate.module.js.map +1 -1
- package/dist/context.main.js +25 -0
- package/dist/context.main.js.map +1 -0
- package/dist/context.mjs +19 -0
- package/dist/context.module.js +19 -0
- package/dist/context.module.js.map +1 -0
- package/dist/import.mjs +6 -6
- package/dist/main.js +7 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +6 -6
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +358 -342
- package/dist/types.d.ts.map +1 -1
- package/dist/useDragAndDrop.main.js.map +1 -1
- package/dist/useDragAndDrop.module.js.map +1 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/package.json +27 -26
- package/src/Autocomplete.tsx +14 -25
- package/src/Breadcrumbs.tsx +16 -8
- package/src/Button.tsx +8 -30
- package/src/Calendar.tsx +41 -24
- package/src/Checkbox.tsx +8 -6
- package/src/Collection.tsx +2 -2
- package/src/ColorArea.tsx +5 -6
- package/src/ColorField.tsx +6 -4
- package/src/ColorSlider.tsx +3 -2
- package/src/ColorSwatch.tsx +6 -3
- package/src/ColorSwatchPicker.tsx +3 -3
- package/src/ColorThumb.tsx +3 -3
- package/src/ColorWheel.tsx +6 -5
- package/src/ComboBox.tsx +4 -4
- package/src/DateField.tsx +15 -10
- package/src/DatePicker.tsx +14 -12
- package/src/Dialog.tsx +6 -6
- package/src/Disclosure.tsx +10 -14
- package/src/DragAndDrop.tsx +31 -1
- package/src/DropZone.tsx +4 -5
- package/src/FieldError.tsx +3 -3
- package/src/FileTrigger.tsx +4 -3
- package/src/Form.tsx +2 -1
- package/src/GridList.tsx +112 -37
- package/src/Header.tsx +2 -2
- package/src/HiddenDateInput.tsx +142 -0
- package/src/Link.tsx +7 -3
- package/src/ListBox.tsx +40 -39
- package/src/Menu.tsx +52 -29
- package/src/Meter.tsx +6 -3
- package/src/Modal.tsx +16 -5
- package/src/NumberField.tsx +4 -4
- package/src/Popover.tsx +14 -14
- package/src/ProgressBar.tsx +6 -2
- package/src/RadioGroup.tsx +8 -6
- package/src/SearchField.tsx +8 -6
- package/src/Select.tsx +13 -16
- package/src/Separator.tsx +23 -6
- package/src/Slider.tsx +9 -11
- package/src/Switch.tsx +4 -3
- package/src/Table.tsx +119 -74
- package/src/Tabs.tsx +24 -17
- package/src/TagGroup.tsx +28 -18
- package/src/TextField.tsx +13 -9
- package/src/Toast.tsx +10 -8
- package/src/ToggleButton.tsx +8 -4
- package/src/ToggleButtonGroup.tsx +6 -4
- package/src/Toolbar.tsx +4 -5
- package/src/Tooltip.tsx +15 -18
- package/src/Tree.tsx +102 -46
- package/src/TreeDropTargetDelegate.ts +5 -1
- package/src/context.tsx +34 -0
- package/src/index.ts +9 -9
- package/src/useDragAndDrop.tsx +11 -11
- package/src/utils.tsx +9 -9
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
var $
|
|
1
|
+
var $09cb5ee89bb327e1$exports = require("./context.main.js");
|
|
2
2
|
var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
3
|
-
var $a83c69b310385d53$exports = require("./SearchField.main.js");
|
|
4
|
-
var $3f2c5af9d7d8905b$exports = require("./TextField.main.js");
|
|
5
3
|
var $5lGAV$reactariaautocomplete = require("@react-aria/autocomplete");
|
|
6
4
|
var $5lGAV$reactstatelyautocomplete = require("@react-stately/autocomplete");
|
|
7
5
|
var $5lGAV$reactariautils = require("@react-aria/utils");
|
|
@@ -18,7 +16,6 @@ function $parcel$export(e, n, v, s) {
|
|
|
18
16
|
|
|
19
17
|
$parcel$export(module.exports, "AutocompleteContext", () => $33f48720060787fa$export$36e687af51cd0967);
|
|
20
18
|
$parcel$export(module.exports, "AutocompleteStateContext", () => $33f48720060787fa$export$68ee3368b6d68148);
|
|
21
|
-
$parcel$export(module.exports, "UNSTABLE_InternalAutocompleteContext", () => $33f48720060787fa$export$65d2a03b8800d6e3);
|
|
22
19
|
$parcel$export(module.exports, "Autocomplete", () => $33f48720060787fa$export$2f2b9559550c7bbc);
|
|
23
20
|
/*
|
|
24
21
|
* Copyright 2024 Adobe. All rights reserved.
|
|
@@ -36,11 +33,8 @@ $parcel$export(module.exports, "Autocomplete", () => $33f48720060787fa$export$2f
|
|
|
36
33
|
|
|
37
34
|
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
36
|
const $33f48720060787fa$export$36e687af51cd0967 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
|
|
42
37
|
const $33f48720060787fa$export$68ee3368b6d68148 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
|
|
43
|
-
const $33f48720060787fa$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
|
|
44
38
|
function $33f48720060787fa$export$2f2b9559550c7bbc(props) {
|
|
45
39
|
let ctx = (0, $c5ccf687772c0422$exports.useSlottedContext)($33f48720060787fa$export$36e687af51cd0967, props.slot);
|
|
46
40
|
props = (0, $5lGAV$reactariautils.mergeProps)(ctx, props);
|
|
@@ -48,7 +42,7 @@ function $33f48720060787fa$export$2f2b9559550c7bbc(props) {
|
|
|
48
42
|
let state = (0, $5lGAV$reactstatelyautocomplete.useAutocompleteState)(props);
|
|
49
43
|
let inputRef = (0, $5lGAV$react.useRef)(null);
|
|
50
44
|
let collectionRef = (0, $5lGAV$react.useRef)(null);
|
|
51
|
-
let {
|
|
45
|
+
let { inputProps: inputProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filter: filterFn } = (0, $5lGAV$reactariaautocomplete.useAutocomplete)({
|
|
52
46
|
...(0, $c5ccf687772c0422$exports.removeDataAttributes)(props),
|
|
53
47
|
filter: filter,
|
|
54
48
|
disableAutoFocusFirst: disableAutoFocusFirst,
|
|
@@ -62,25 +56,18 @@ function $33f48720060787fa$export$2f2b9559550c7bbc(props) {
|
|
|
62
56
|
state
|
|
63
57
|
],
|
|
64
58
|
[
|
|
65
|
-
(0, $
|
|
66
|
-
textFieldProps
|
|
67
|
-
],
|
|
68
|
-
[
|
|
69
|
-
(0, $3f2c5af9d7d8905b$exports.TextFieldContext),
|
|
70
|
-
textFieldProps
|
|
71
|
-
],
|
|
72
|
-
[
|
|
73
|
-
(0, $1bcfcef5af644e13$exports.InputContext),
|
|
59
|
+
(0, $09cb5ee89bb327e1$exports.FieldInputContext),
|
|
74
60
|
{
|
|
61
|
+
...inputProps,
|
|
75
62
|
ref: inputRef
|
|
76
63
|
}
|
|
77
64
|
],
|
|
78
65
|
[
|
|
79
|
-
$
|
|
66
|
+
(0, $09cb5ee89bb327e1$exports.SelectableCollectionContext),
|
|
80
67
|
{
|
|
68
|
+
...collectionProps,
|
|
81
69
|
filter: filterFn,
|
|
82
|
-
|
|
83
|
-
collectionRef: mergedCollectionRef
|
|
70
|
+
ref: mergedCollectionRef
|
|
84
71
|
}
|
|
85
72
|
]
|
|
86
73
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAUM,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAwD;AAChG,MAAM,0DAA2B,CAAA,GAAA,0BAAY,EAA4B;AAKzE,SAAS,0CAA+B,KAA2B;IACxE,IAAI,MAAM,CAAA,GAAA,2CAAgB,EAAE,2CAAqB,MAAM,IAAI;IAC3D,QAAQ,CAAA,GAAA,gCAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,yBAAE,qBAAqB,EAAC,GAAG;IACtC,IAAI,QAAQ,CAAA,GAAA,oDAAmB,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,gBAAgB,CAAA,GAAA,mBAAK,EAAe;IACxC,IAAI,cACF,UAAU,mBACV,eAAe,EACf,eAAe,mBAAmB,EAClC,QAAQ,QAAQ,EACjB,GAAG,CAAA,GAAA,4CAAc,EAAE;QAClB,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;gBAC9B;+BACA;kBACA;uBACA;IACF,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAA0B;aAAM;YACjC;gBAAC,CAAA,GAAA,2CAAgB;gBAAG;oBAClB,GAAG,UAAU;oBACb,KAAK;gBACP;aAAE;YACF;gBAAC,CAAA,GAAA,qDAA0B;gBAAG;oBAC5B,GAAG,eAAe;oBAClB,QAAQ;oBACR,KAAK;gBACP;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaAutocompleteProps, useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, useAutocompleteState} from '@react-stately/autocomplete';\nimport {FieldInputContext, SelectableCollectionContext} from './context';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, JSX, useRef} from 'react';\n\nexport interface AutocompleteProps<T = object> extends AriaAutocompleteProps<T>, SlotProps {}\nexport const AutocompleteContext = createContext<SlottedContextValue<Partial<AutocompleteProps<any>>>>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n\n/**\n * An autocomplete combines a TextField or SearchField with a Menu or ListBox, allowing users to search or filter a list of suggestions.\n */\nexport function Autocomplete<T extends object>(props: AutocompleteProps<T>): JSX.Element {\n let ctx = useSlottedContext(AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter, disableAutoFocusFirst} = props;\n let state = useAutocompleteState(props);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let collectionRef = useRef<HTMLElement>(null);\n let {\n inputProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filter: filterFn\n } = useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n disableAutoFocusFirst,\n inputRef,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [AutocompleteStateContext, state],\n [FieldInputContext, {\n ...inputProps,\n ref: inputRef\n }],\n [SelectableCollectionContext, {\n ...collectionProps,\n filter: filterFn,\n ref: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.main.js.map"}
|
package/dist/Autocomplete.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {FieldInputContext as $8e6cc465cc68f603$export$698f465ec27e93df, SelectableCollectionContext as $8e6cc465cc68f603$export$b0d3ecf7112093a7} from "./context.mjs";
|
|
2
2
|
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
|
|
3
|
-
import {SearchFieldContext as $440f4836bcb56932$export$d1c4e4c63cb03a11} from "./SearchField.mjs";
|
|
4
|
-
import {TextFieldContext as $bcdf0525bf22703d$export$2129e27b3ef0d483} from "./TextField.mjs";
|
|
5
3
|
import {useAutocomplete as $llkzs$useAutocomplete} from "@react-aria/autocomplete";
|
|
6
4
|
import {useAutocompleteState as $llkzs$useAutocompleteState} from "@react-stately/autocomplete";
|
|
7
5
|
import {mergeProps as $llkzs$mergeProps} from "@react-aria/utils";
|
|
@@ -23,11 +21,8 @@ import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$us
|
|
|
23
21
|
|
|
24
22
|
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
24
|
const $d2f53cda644affe3$export$36e687af51cd0967 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
|
|
29
25
|
const $d2f53cda644affe3$export$68ee3368b6d68148 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
|
|
30
|
-
const $d2f53cda644affe3$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
|
|
31
26
|
function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
|
|
32
27
|
let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$36e687af51cd0967, props.slot);
|
|
33
28
|
props = (0, $llkzs$mergeProps)(ctx, props);
|
|
@@ -35,7 +30,7 @@ function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
|
|
|
35
30
|
let state = (0, $llkzs$useAutocompleteState)(props);
|
|
36
31
|
let inputRef = (0, $llkzs$useRef)(null);
|
|
37
32
|
let collectionRef = (0, $llkzs$useRef)(null);
|
|
38
|
-
let {
|
|
33
|
+
let { inputProps: inputProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filter: filterFn } = (0, $llkzs$useAutocomplete)({
|
|
39
34
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
40
35
|
filter: filter,
|
|
41
36
|
disableAutoFocusFirst: disableAutoFocusFirst,
|
|
@@ -49,25 +44,18 @@ function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
|
|
|
49
44
|
state
|
|
50
45
|
],
|
|
51
46
|
[
|
|
52
|
-
(0, $
|
|
53
|
-
textFieldProps
|
|
54
|
-
],
|
|
55
|
-
[
|
|
56
|
-
(0, $bcdf0525bf22703d$export$2129e27b3ef0d483),
|
|
57
|
-
textFieldProps
|
|
58
|
-
],
|
|
59
|
-
[
|
|
60
|
-
(0, $3985021b0ad6602f$export$37fb8590cf2c088c),
|
|
47
|
+
(0, $8e6cc465cc68f603$export$698f465ec27e93df),
|
|
61
48
|
{
|
|
49
|
+
...inputProps,
|
|
62
50
|
ref: inputRef
|
|
63
51
|
}
|
|
64
52
|
],
|
|
65
53
|
[
|
|
66
|
-
$
|
|
54
|
+
(0, $8e6cc465cc68f603$export$b0d3ecf7112093a7),
|
|
67
55
|
{
|
|
56
|
+
...collectionProps,
|
|
68
57
|
filter: filterFn,
|
|
69
|
-
|
|
70
|
-
collectionRef: mergedCollectionRef
|
|
58
|
+
ref: mergedCollectionRef
|
|
71
59
|
}
|
|
72
60
|
]
|
|
73
61
|
]
|
|
@@ -75,5 +63,5 @@ function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
|
|
|
75
63
|
}
|
|
76
64
|
|
|
77
65
|
|
|
78
|
-
export {$d2f53cda644affe3$export$36e687af51cd0967 as AutocompleteContext, $d2f53cda644affe3$export$68ee3368b6d68148 as AutocompleteStateContext, $d2f53cda644affe3$export$
|
|
66
|
+
export {$d2f53cda644affe3$export$36e687af51cd0967 as AutocompleteContext, $d2f53cda644affe3$export$68ee3368b6d68148 as AutocompleteStateContext, $d2f53cda644affe3$export$2f2b9559550c7bbc as Autocomplete};
|
|
79
67
|
//# sourceMappingURL=Autocomplete.module.js.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {FieldInputContext as $8e6cc465cc68f603$export$698f465ec27e93df, SelectableCollectionContext as $8e6cc465cc68f603$export$b0d3ecf7112093a7} from "./context.module.js";
|
|
2
2
|
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
|
|
3
|
-
import {SearchFieldContext as $440f4836bcb56932$export$d1c4e4c63cb03a11} from "./SearchField.module.js";
|
|
4
|
-
import {TextFieldContext as $bcdf0525bf22703d$export$2129e27b3ef0d483} from "./TextField.module.js";
|
|
5
3
|
import {useAutocomplete as $llkzs$useAutocomplete} from "@react-aria/autocomplete";
|
|
6
4
|
import {useAutocompleteState as $llkzs$useAutocompleteState} from "@react-stately/autocomplete";
|
|
7
5
|
import {mergeProps as $llkzs$mergeProps} from "@react-aria/utils";
|
|
@@ -23,11 +21,8 @@ import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$us
|
|
|
23
21
|
|
|
24
22
|
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
24
|
const $d2f53cda644affe3$export$36e687af51cd0967 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
|
|
29
25
|
const $d2f53cda644affe3$export$68ee3368b6d68148 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
|
|
30
|
-
const $d2f53cda644affe3$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
|
|
31
26
|
function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
|
|
32
27
|
let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$36e687af51cd0967, props.slot);
|
|
33
28
|
props = (0, $llkzs$mergeProps)(ctx, props);
|
|
@@ -35,7 +30,7 @@ function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
|
|
|
35
30
|
let state = (0, $llkzs$useAutocompleteState)(props);
|
|
36
31
|
let inputRef = (0, $llkzs$useRef)(null);
|
|
37
32
|
let collectionRef = (0, $llkzs$useRef)(null);
|
|
38
|
-
let {
|
|
33
|
+
let { inputProps: inputProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filter: filterFn } = (0, $llkzs$useAutocomplete)({
|
|
39
34
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
40
35
|
filter: filter,
|
|
41
36
|
disableAutoFocusFirst: disableAutoFocusFirst,
|
|
@@ -49,25 +44,18 @@ function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
|
|
|
49
44
|
state
|
|
50
45
|
],
|
|
51
46
|
[
|
|
52
|
-
(0, $
|
|
53
|
-
textFieldProps
|
|
54
|
-
],
|
|
55
|
-
[
|
|
56
|
-
(0, $bcdf0525bf22703d$export$2129e27b3ef0d483),
|
|
57
|
-
textFieldProps
|
|
58
|
-
],
|
|
59
|
-
[
|
|
60
|
-
(0, $3985021b0ad6602f$export$37fb8590cf2c088c),
|
|
47
|
+
(0, $8e6cc465cc68f603$export$698f465ec27e93df),
|
|
61
48
|
{
|
|
49
|
+
...inputProps,
|
|
62
50
|
ref: inputRef
|
|
63
51
|
}
|
|
64
52
|
],
|
|
65
53
|
[
|
|
66
|
-
$
|
|
54
|
+
(0, $8e6cc465cc68f603$export$b0d3ecf7112093a7),
|
|
67
55
|
{
|
|
56
|
+
...collectionProps,
|
|
68
57
|
filter: filterFn,
|
|
69
|
-
|
|
70
|
-
collectionRef: mergedCollectionRef
|
|
58
|
+
ref: mergedCollectionRef
|
|
71
59
|
}
|
|
72
60
|
]
|
|
73
61
|
]
|
|
@@ -75,5 +63,5 @@ function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
|
|
|
75
63
|
}
|
|
76
64
|
|
|
77
65
|
|
|
78
|
-
export {$d2f53cda644affe3$export$36e687af51cd0967 as AutocompleteContext, $d2f53cda644affe3$export$68ee3368b6d68148 as AutocompleteStateContext, $d2f53cda644affe3$export$
|
|
66
|
+
export {$d2f53cda644affe3$export$36e687af51cd0967 as AutocompleteContext, $d2f53cda644affe3$export$68ee3368b6d68148 as AutocompleteStateContext, $d2f53cda644affe3$export$2f2b9559550c7bbc as Autocomplete};
|
|
79
67
|
//# sourceMappingURL=Autocomplete.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAUM,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAwD;AAChG,MAAM,0DAA2B,CAAA,GAAA,oBAAY,EAA4B;AAKzE,SAAS,0CAA+B,KAA2B;IACxE,IAAI,MAAM,CAAA,GAAA,yCAAgB,EAAE,2CAAqB,MAAM,IAAI;IAC3D,QAAQ,CAAA,GAAA,iBAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,yBAAE,qBAAqB,EAAC,GAAG;IACtC,IAAI,QAAQ,CAAA,GAAA,2BAAmB,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,gBAAgB,CAAA,GAAA,aAAK,EAAe;IACxC,IAAI,cACF,UAAU,mBACV,eAAe,EACf,eAAe,mBAAmB,EAClC,QAAQ,QAAQ,EACjB,GAAG,CAAA,GAAA,sBAAc,EAAE;QAClB,GAAG,CAAA,GAAA,yCAAmB,EAAE,MAAM;gBAC9B;+BACA;kBACA;uBACA;IACF,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAA0B;aAAM;YACjC;gBAAC,CAAA,GAAA,yCAAgB;gBAAG;oBAClB,GAAG,UAAU;oBACb,KAAK;gBACP;aAAE;YACF;gBAAC,CAAA,GAAA,yCAA0B;gBAAG;oBAC5B,GAAG,eAAe;oBAClB,QAAQ;oBACR,KAAK;gBACP;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaAutocompleteProps, useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, useAutocompleteState} from '@react-stately/autocomplete';\nimport {FieldInputContext, SelectableCollectionContext} from './context';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, JSX, useRef} from 'react';\n\nexport interface AutocompleteProps<T = object> extends AriaAutocompleteProps<T>, SlotProps {}\nexport const AutocompleteContext = createContext<SlottedContextValue<Partial<AutocompleteProps<any>>>>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n\n/**\n * An autocomplete combines a TextField or SearchField with a Menu or ListBox, allowing users to search or filter a list of suggestions.\n */\nexport function Autocomplete<T extends object>(props: AutocompleteProps<T>): JSX.Element {\n let ctx = useSlottedContext(AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter, disableAutoFocusFirst} = props;\n let state = useAutocompleteState(props);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let collectionRef = useRef<HTMLElement>(null);\n let {\n inputProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filter: filterFn\n } = useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n disableAutoFocusFirst,\n inputRef,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [AutocompleteStateContext, state],\n [FieldInputContext, {\n ...inputProps,\n ref: inputRef\n }],\n [SelectableCollectionContext, {\n ...collectionProps,\n filter: filterFn,\n ref: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.module.js.map"}
|
package/dist/Breadcrumbs.main.js
CHANGED
|
@@ -40,13 +40,16 @@ const $afa44b644f65ed30$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $l7mU3$react.
|
|
|
40
40
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $afa44b644f65ed30$export$65596d3621b0a4a0);
|
|
41
41
|
let { CollectionRoot: CollectionRoot } = (0, $l7mU3$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
|
|
42
42
|
let { navProps: navProps } = (0, $l7mU3$reactaria.useBreadcrumbs)(props);
|
|
43
|
+
let DOMProps = (0, $l7mU3$reactariautils.filterDOMProps)(props, {
|
|
44
|
+
global: true
|
|
45
|
+
});
|
|
43
46
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement((0, $l7mU3$reactariacollections.CollectionBuilder), {
|
|
44
47
|
content: /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement((0, $l7mU3$reactariacollections.Collection), props)
|
|
45
48
|
}, (collection)=>{
|
|
46
49
|
var _props_className;
|
|
47
50
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement("ol", {
|
|
48
51
|
ref: ref,
|
|
49
|
-
...navProps,
|
|
52
|
+
...(0, $l7mU3$reactariautils.mergeProps)(DOMProps, navProps),
|
|
50
53
|
slot: props.slot || undefined,
|
|
51
54
|
style: props.style,
|
|
52
55
|
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
|
|
@@ -57,7 +60,10 @@ const $afa44b644f65ed30$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $l7mU3$react.
|
|
|
57
60
|
})));
|
|
58
61
|
});
|
|
59
62
|
});
|
|
60
|
-
|
|
63
|
+
class $afa44b644f65ed30$var$BreadcrumbNode extends (0, $l7mU3$reactariacollections.CollectionNode) {
|
|
64
|
+
}
|
|
65
|
+
$afa44b644f65ed30$var$BreadcrumbNode.type = 'item';
|
|
66
|
+
const $afa44b644f65ed30$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $l7mU3$reactariacollections.createLeafComponent)($afa44b644f65ed30$var$BreadcrumbNode, function Breadcrumb(props, ref, node) {
|
|
61
67
|
// Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.
|
|
62
68
|
let isCurrent = node.nextKey == null;
|
|
63
69
|
let { isDisabled: isDisabled, onAction: onAction } = (0, $c5ccf687772c0422$exports.useSlottedContext)($afa44b644f65ed30$export$65596d3621b0a4a0);
|
|
@@ -75,8 +81,12 @@ const $afa44b644f65ed30$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $l7mU3$react
|
|
|
75
81
|
},
|
|
76
82
|
defaultClassName: 'react-aria-Breadcrumb'
|
|
77
83
|
});
|
|
84
|
+
let DOMProps = (0, $l7mU3$reactariautils.filterDOMProps)(props, {
|
|
85
|
+
global: true
|
|
86
|
+
});
|
|
87
|
+
delete DOMProps.id;
|
|
78
88
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement("li", {
|
|
79
|
-
...
|
|
89
|
+
...DOMProps,
|
|
80
90
|
...renderProps,
|
|
81
91
|
ref: ref,
|
|
82
92
|
"data-disabled": isDisabled || isCurrent || undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE;IAChC,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,uBAAS,0DAAC,CAAA,GAAA,sCAAS,GAAM;OACzC,CAAA;YAMc;6BALb,0DAAC;YACC,KAAK;YACJ,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,SAAS;YAClC,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,0DAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,0DAAC;YAAe,YAAY;;;AAMxC;AAoBA,MAAM,6CAAuB,CAAA,GAAA,0CAAa;AAE1C;AAFM,qCACY,OAAO;AAMlB,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,+CAAkB,EAAE,sCAAgB,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IAC3K,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,0DAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, CollectionNode, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLOListElement> {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...mergeProps(DOMProps, navProps)}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps>, GlobalDOMAttributes<HTMLLIElement> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\nclass BreadcrumbNode extends CollectionNode<unknown> {\n static readonly type = 'item';\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent(BreadcrumbNode, function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <li\n {...DOMProps}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.main.js.map"}
|
package/dist/Breadcrumbs.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5}
|
|
|
2
2
|
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
|
|
3
3
|
import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.mjs";
|
|
4
4
|
import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
|
|
5
|
-
import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
|
|
6
|
-
import {filterDOMProps as $c5cc5$filterDOMProps} from "@react-aria/utils";
|
|
5
|
+
import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, CollectionNode as $c5cc5$CollectionNode, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
|
|
6
|
+
import {filterDOMProps as $c5cc5$filterDOMProps, mergeProps as $c5cc5$mergeProps} from "@react-aria/utils";
|
|
7
7
|
import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
|
|
8
8
|
|
|
9
9
|
/*
|
|
@@ -28,13 +28,16 @@ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwar
|
|
|
28
28
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
|
|
29
29
|
let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
30
30
|
let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
|
|
31
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
32
|
+
global: true
|
|
33
|
+
});
|
|
31
34
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
|
|
32
35
|
content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
|
|
33
36
|
}, (collection)=>{
|
|
34
37
|
var _props_className;
|
|
35
38
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement("ol", {
|
|
36
39
|
ref: ref,
|
|
37
|
-
...navProps,
|
|
40
|
+
...(0, $c5cc5$mergeProps)(DOMProps, navProps),
|
|
38
41
|
slot: props.slot || undefined,
|
|
39
42
|
style: props.style,
|
|
40
43
|
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
|
|
@@ -45,7 +48,10 @@ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwar
|
|
|
45
48
|
})));
|
|
46
49
|
});
|
|
47
50
|
});
|
|
48
|
-
|
|
51
|
+
class $778035c5624f61e7$var$BreadcrumbNode extends (0, $c5cc5$CollectionNode) {
|
|
52
|
+
}
|
|
53
|
+
$778035c5624f61e7$var$BreadcrumbNode.type = 'item';
|
|
54
|
+
const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$createLeafComponent)($778035c5624f61e7$var$BreadcrumbNode, function Breadcrumb(props, ref, node) {
|
|
49
55
|
// Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.
|
|
50
56
|
let isCurrent = node.nextKey == null;
|
|
51
57
|
let { isDisabled: isDisabled, onAction: onAction } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($778035c5624f61e7$export$65596d3621b0a4a0);
|
|
@@ -63,8 +69,12 @@ const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$creat
|
|
|
63
69
|
},
|
|
64
70
|
defaultClassName: 'react-aria-Breadcrumb'
|
|
65
71
|
});
|
|
72
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
73
|
+
global: true
|
|
74
|
+
});
|
|
75
|
+
delete DOMProps.id;
|
|
66
76
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement("li", {
|
|
67
|
-
...
|
|
77
|
+
...DOMProps,
|
|
68
78
|
...renderProps,
|
|
69
79
|
ref: ref,
|
|
70
80
|
"data-disabled": isDisabled || isCurrent || undefined,
|
|
@@ -2,8 +2,8 @@ import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5}
|
|
|
2
2
|
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
|
|
3
3
|
import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.module.js";
|
|
4
4
|
import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
|
|
5
|
-
import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
|
|
6
|
-
import {filterDOMProps as $c5cc5$filterDOMProps} from "@react-aria/utils";
|
|
5
|
+
import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, CollectionNode as $c5cc5$CollectionNode, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
|
|
6
|
+
import {filterDOMProps as $c5cc5$filterDOMProps, mergeProps as $c5cc5$mergeProps} from "@react-aria/utils";
|
|
7
7
|
import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
|
|
8
8
|
|
|
9
9
|
/*
|
|
@@ -28,13 +28,16 @@ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwar
|
|
|
28
28
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
|
|
29
29
|
let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
30
30
|
let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
|
|
31
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
32
|
+
global: true
|
|
33
|
+
});
|
|
31
34
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
|
|
32
35
|
content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
|
|
33
36
|
}, (collection)=>{
|
|
34
37
|
var _props_className;
|
|
35
38
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement("ol", {
|
|
36
39
|
ref: ref,
|
|
37
|
-
...navProps,
|
|
40
|
+
...(0, $c5cc5$mergeProps)(DOMProps, navProps),
|
|
38
41
|
slot: props.slot || undefined,
|
|
39
42
|
style: props.style,
|
|
40
43
|
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
|
|
@@ -45,7 +48,10 @@ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwar
|
|
|
45
48
|
})));
|
|
46
49
|
});
|
|
47
50
|
});
|
|
48
|
-
|
|
51
|
+
class $778035c5624f61e7$var$BreadcrumbNode extends (0, $c5cc5$CollectionNode) {
|
|
52
|
+
}
|
|
53
|
+
$778035c5624f61e7$var$BreadcrumbNode.type = 'item';
|
|
54
|
+
const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$createLeafComponent)($778035c5624f61e7$var$BreadcrumbNode, function Breadcrumb(props, ref, node) {
|
|
49
55
|
// Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.
|
|
50
56
|
let isCurrent = node.nextKey == null;
|
|
51
57
|
let { isDisabled: isDisabled, onAction: onAction } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($778035c5624f61e7$export$65596d3621b0a4a0);
|
|
@@ -63,8 +69,12 @@ const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$creat
|
|
|
63
69
|
},
|
|
64
70
|
defaultClassName: 'react-aria-Breadcrumb'
|
|
65
71
|
});
|
|
72
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
73
|
+
global: true
|
|
74
|
+
});
|
|
75
|
+
delete DOMProps.id;
|
|
66
76
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement("li", {
|
|
67
|
-
...
|
|
77
|
+
...DOMProps,
|
|
68
78
|
...renderProps,
|
|
69
79
|
ref: ref,
|
|
70
80
|
"data-disabled": isDisabled || isCurrent || undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAChC,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,uBAAS,gCAAC,CAAA,GAAA,iBAAS,GAAM;OACzC,CAAA;YAMc;6BALb,gCAAC;YACC,KAAK;YACJ,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,SAAS;YAClC,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,gCAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,gCAAC;YAAe,YAAY;;;AAMxC;AAoBA,MAAM,6CAAuB,CAAA,GAAA,qBAAa;AAE1C;AAFM,qCACY,OAAO;AAMlB,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,sCAAgB,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IAC3K,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, CollectionNode, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLOListElement> {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...mergeProps(DOMProps, navProps)}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps>, GlobalDOMAttributes<HTMLLIElement> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\nclass BreadcrumbNode extends CollectionNode<unknown> {\n static readonly type = 'item';\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent(BreadcrumbNode, function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <li\n {...DOMProps}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.module.js.map"}
|
package/dist/Button.main.js
CHANGED
|
@@ -34,16 +34,6 @@ $parcel$export(module.exports, "Button", () => $b856e6788a7ea5bf$export$353f5b6f
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
const $b856e6788a7ea5bf$var$additionalButtonHTMLAttributes = new Set([
|
|
38
|
-
'form',
|
|
39
|
-
'formAction',
|
|
40
|
-
'formEncType',
|
|
41
|
-
'formMethod',
|
|
42
|
-
'formNoValidate',
|
|
43
|
-
'formTarget',
|
|
44
|
-
'name',
|
|
45
|
-
'value'
|
|
46
|
-
]);
|
|
47
37
|
const $b856e6788a7ea5bf$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $3vfYa$react.createContext)({});
|
|
48
38
|
const $b856e6788a7ea5bf$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3vfYa$reactariacollections.createHideableComponent)(function Button(props, ref) {
|
|
49
39
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $b856e6788a7ea5bf$export$24d547caef80ccd1);
|
|
@@ -92,14 +82,14 @@ const $b856e6788a7ea5bf$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3vfYa$react
|
|
|
92
82
|
ariaLabelledby,
|
|
93
83
|
buttonId
|
|
94
84
|
]);
|
|
95
|
-
|
|
96
|
-
|
|
85
|
+
let DOMProps = (0, $3vfYa$reactariautils.filterDOMProps)(props, {
|
|
86
|
+
global: true
|
|
87
|
+
});
|
|
88
|
+
delete DOMProps.onClick;
|
|
97
89
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($3vfYa$react))).createElement("button", {
|
|
98
|
-
...(0, $3vfYa$
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
...(0, $3vfYa$reactaria.mergeProps)(buttonProps, focusProps, hoverProps),
|
|
102
|
-
...renderProps,
|
|
90
|
+
...(0, $3vfYa$reactaria.mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
91
|
+
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
92
|
+
// We do this by changing the button's type to button.
|
|
103
93
|
type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
|
|
104
94
|
id: buttonId,
|
|
105
95
|
ref: ref,
|
package/dist/Button.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAsEM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAuD,CAAC;AAK1F,MAAM,4CAAS,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE,SAAS,OAAO,KAAkB,EAAE,GAAoC;IAClI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,QAAQ,0CAAoB;IAC5B,IAAI,MAAM;IACV,IAAI,aAAC,SAAS,EAAC,GAAG;IAClB,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,0BAAQ,EAAE,OAAO;IAChD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;IAC3D,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;QACrC,GAAG,KAAK;QACR,YAAY,MAAM,UAAU,IAAI;IAClC;IACA,IAAI,eAAe;mBACjB;QACA,WAAW,AAAC,CAAA,IAAI,SAAS,IAAI,SAAQ,KAAM,CAAC;mBAC5C;wBACA;QACA,YAAY,MAAM,UAAU,IAAI;QAChC,WAAW,sBAAA,uBAAA,YAAa;IAC1B;IAEA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;QACR,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,sBAAI,EAAE,YAAY,EAAE;IACnC,IAAI,aAAa,CAAA,GAAA,sBAAI;IAErB,IAAI,iBAAiB,WAAW,CAAC,kBAAkB;IACnD,IAAI,WAAW;QACb,uCAAuC;QACvC,uDAAuD;QACvD,IAAI,gBACF,iBAAiB,GAAG,eAAe,CAAC,EAAE,YAAY;aAC7C,IAAI,WAAW,CAAC,aAAa,EAClC,iBAAiB,GAAG,SAAS,CAAC,EAAE,YAAY;IAEhD;IAEA,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAE;IACxB,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,UAAU;YAAC,mBAAmB,kBAAkB;QAAQ;QAC5D,IAAI,CAAC,WAAW,OAAO,IAAI,aAAa,WACtC,CAAA,GAAA,sCAAO,EAAE,SAAS;aACb,IAAI,WAAW,OAAO,IAAI,aAAa,CAAC,WAC7C,CAAA,GAAA,sCAAO,EAAE,SAAS;QAEpB,WAAW,OAAO,GAAG;IACvB,GAAG;QAAC;QAAW;QAAW;QAAgB;KAAS;IAEnD,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,OAAO;IAEvB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,aAAa,aAAa,YAAY,WAAW;QAC1E,qIAAqI;QACrI,sDAAsD;QACtD,MAAM,YAAY,IAAI,KAAK,YAAY,YAAY,WAAW,YAAY,IAAI;QAC9E,IAAI;QACJ,KAAK;QACL,mBAAiB;QACjB,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,YAAY,SAAS,WAAW,CAAC,gBAAgB;QAChE,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,aAAa,SAAS,IAAI;QACxC,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,0DAAC,CAAA,GAAA,4CAAiB,EAAE,QAAQ;QAAC,OAAO;YAAC,IAAI;QAAU;OAChD,YAAY,QAAQ;AAI7B;AAEA,SAAS,0CAAoB,KAAK;IAChC,kDAAkD;IAClD,IAAI,MAAM,SAAS,EAAE;QACnB,MAAM,OAAO,GAAG;QAChB,MAAM,YAAY,GAAG;QACrB,MAAM,UAAU,GAAG;QACnB,MAAM,aAAa,GAAG;QACtB,MAAM,SAAS,GAAG;QAClB,MAAM,SAAS,GAAG;QAClB,MAAM,OAAO,GAAG;QAChB,MAAM,OAAO,GAAG;QAChB,MAAM,IAAI,GAAG;IACf;IACA,OAAO;AACT","sources":["packages/react-aria-components/src/Button.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 {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n props = disablePendingProps(props);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.onClick;\n\n return (\n <button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </button>\n );\n});\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.main.js.map"}
|
package/dist/Button.mjs
CHANGED
|
@@ -23,16 +23,6 @@ import $fM325$react, {createContext as $fM325$createContext, useRef as $fM325$us
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = new Set([
|
|
27
|
-
'form',
|
|
28
|
-
'formAction',
|
|
29
|
-
'formEncType',
|
|
30
|
-
'formMethod',
|
|
31
|
-
'formNoValidate',
|
|
32
|
-
'formTarget',
|
|
33
|
-
'name',
|
|
34
|
-
'value'
|
|
35
|
-
]);
|
|
36
26
|
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $fM325$createContext)({});
|
|
37
27
|
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)(function Button(props, ref) {
|
|
38
28
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
@@ -81,14 +71,14 @@ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$creat
|
|
|
81
71
|
ariaLabelledby,
|
|
82
72
|
buttonId
|
|
83
73
|
]);
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
let DOMProps = (0, $fM325$filterDOMProps)(props, {
|
|
75
|
+
global: true
|
|
76
|
+
});
|
|
77
|
+
delete DOMProps.onClick;
|
|
86
78
|
return /*#__PURE__*/ (0, $fM325$react).createElement("button", {
|
|
87
|
-
...(0, $fM325$
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
...(0, $fM325$mergeProps)(buttonProps, focusProps, hoverProps),
|
|
91
|
-
...renderProps,
|
|
79
|
+
...(0, $fM325$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
80
|
+
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
81
|
+
// We do this by changing the button's type to button.
|
|
92
82
|
type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
|
|
93
83
|
id: buttonId,
|
|
94
84
|
ref: ref,
|