@react-aria/steplist 3.0.0-alpha.25 → 3.0.0-alpha.26
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/import.mjs +3 -3
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +3 -3
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +4 -0
- package/package.json +15 -16
- package/src/index.ts +4 -4
- package/dist/ar-AE.main.js +0 -6
- package/dist/ar-AE.main.js.map +0 -1
- package/dist/ar-AE.mjs +0 -8
- package/dist/ar-AE.module.js +0 -8
- package/dist/ar-AE.module.js.map +0 -1
- package/dist/bg-BG.main.js +0 -6
- package/dist/bg-BG.main.js.map +0 -1
- package/dist/bg-BG.mjs +0 -8
- package/dist/bg-BG.module.js +0 -8
- package/dist/bg-BG.module.js.map +0 -1
- package/dist/cs-CZ.main.js +0 -6
- package/dist/cs-CZ.main.js.map +0 -1
- package/dist/cs-CZ.mjs +0 -8
- package/dist/cs-CZ.module.js +0 -8
- package/dist/cs-CZ.module.js.map +0 -1
- package/dist/da-DK.main.js +0 -6
- package/dist/da-DK.main.js.map +0 -1
- package/dist/da-DK.mjs +0 -8
- package/dist/da-DK.module.js +0 -8
- package/dist/da-DK.module.js.map +0 -1
- package/dist/de-DE.main.js +0 -6
- package/dist/de-DE.main.js.map +0 -1
- package/dist/de-DE.mjs +0 -8
- package/dist/de-DE.module.js +0 -8
- package/dist/de-DE.module.js.map +0 -1
- package/dist/el-GR.main.js +0 -6
- package/dist/el-GR.main.js.map +0 -1
- package/dist/el-GR.mjs +0 -8
- package/dist/el-GR.module.js +0 -8
- package/dist/el-GR.module.js.map +0 -1
- package/dist/en-US.main.js +0 -6
- package/dist/en-US.main.js.map +0 -1
- package/dist/en-US.mjs +0 -8
- package/dist/en-US.module.js +0 -8
- package/dist/en-US.module.js.map +0 -1
- package/dist/es-ES.main.js +0 -6
- package/dist/es-ES.main.js.map +0 -1
- package/dist/es-ES.mjs +0 -8
- package/dist/es-ES.module.js +0 -8
- package/dist/es-ES.module.js.map +0 -1
- package/dist/et-EE.main.js +0 -6
- package/dist/et-EE.main.js.map +0 -1
- package/dist/et-EE.mjs +0 -8
- package/dist/et-EE.module.js +0 -8
- package/dist/et-EE.module.js.map +0 -1
- package/dist/fi-FI.main.js +0 -6
- package/dist/fi-FI.main.js.map +0 -1
- package/dist/fi-FI.mjs +0 -8
- package/dist/fi-FI.module.js +0 -8
- package/dist/fi-FI.module.js.map +0 -1
- package/dist/fr-FR.main.js +0 -6
- package/dist/fr-FR.main.js.map +0 -1
- package/dist/fr-FR.mjs +0 -8
- package/dist/fr-FR.module.js +0 -8
- package/dist/fr-FR.module.js.map +0 -1
- package/dist/he-IL.main.js +0 -6
- package/dist/he-IL.main.js.map +0 -1
- package/dist/he-IL.mjs +0 -8
- package/dist/he-IL.module.js +0 -8
- package/dist/he-IL.module.js.map +0 -1
- package/dist/hr-HR.main.js +0 -6
- package/dist/hr-HR.main.js.map +0 -1
- package/dist/hr-HR.mjs +0 -8
- package/dist/hr-HR.module.js +0 -8
- package/dist/hr-HR.module.js.map +0 -1
- package/dist/hu-HU.main.js +0 -6
- package/dist/hu-HU.main.js.map +0 -1
- package/dist/hu-HU.mjs +0 -8
- package/dist/hu-HU.module.js +0 -8
- package/dist/hu-HU.module.js.map +0 -1
- package/dist/intlStrings.main.js +0 -108
- package/dist/intlStrings.main.js.map +0 -1
- package/dist/intlStrings.mjs +0 -110
- package/dist/intlStrings.module.js +0 -110
- package/dist/intlStrings.module.js.map +0 -1
- package/dist/it-IT.main.js +0 -6
- package/dist/it-IT.main.js.map +0 -1
- package/dist/it-IT.mjs +0 -8
- package/dist/it-IT.module.js +0 -8
- package/dist/it-IT.module.js.map +0 -1
- package/dist/ja-JP.main.js +0 -6
- package/dist/ja-JP.main.js.map +0 -1
- package/dist/ja-JP.mjs +0 -8
- package/dist/ja-JP.module.js +0 -8
- package/dist/ja-JP.module.js.map +0 -1
- package/dist/ko-KR.main.js +0 -6
- package/dist/ko-KR.main.js.map +0 -1
- package/dist/ko-KR.mjs +0 -8
- package/dist/ko-KR.module.js +0 -8
- package/dist/ko-KR.module.js.map +0 -1
- package/dist/lt-LT.main.js +0 -6
- package/dist/lt-LT.main.js.map +0 -1
- package/dist/lt-LT.mjs +0 -8
- package/dist/lt-LT.module.js +0 -8
- package/dist/lt-LT.module.js.map +0 -1
- package/dist/lv-LV.main.js +0 -6
- package/dist/lv-LV.main.js.map +0 -1
- package/dist/lv-LV.mjs +0 -8
- package/dist/lv-LV.module.js +0 -8
- package/dist/lv-LV.module.js.map +0 -1
- package/dist/nb-NO.main.js +0 -6
- package/dist/nb-NO.main.js.map +0 -1
- package/dist/nb-NO.mjs +0 -8
- package/dist/nb-NO.module.js +0 -8
- package/dist/nb-NO.module.js.map +0 -1
- package/dist/nl-NL.main.js +0 -6
- package/dist/nl-NL.main.js.map +0 -1
- package/dist/nl-NL.mjs +0 -8
- package/dist/nl-NL.module.js +0 -8
- package/dist/nl-NL.module.js.map +0 -1
- package/dist/pl-PL.main.js +0 -6
- package/dist/pl-PL.main.js.map +0 -1
- package/dist/pl-PL.mjs +0 -8
- package/dist/pl-PL.module.js +0 -8
- package/dist/pl-PL.module.js.map +0 -1
- package/dist/pt-BR.main.js +0 -6
- package/dist/pt-BR.main.js.map +0 -1
- package/dist/pt-BR.mjs +0 -8
- package/dist/pt-BR.module.js +0 -8
- package/dist/pt-BR.module.js.map +0 -1
- package/dist/pt-PT.main.js +0 -6
- package/dist/pt-PT.main.js.map +0 -1
- package/dist/pt-PT.mjs +0 -8
- package/dist/pt-PT.module.js +0 -8
- package/dist/pt-PT.module.js.map +0 -1
- package/dist/ro-RO.main.js +0 -6
- package/dist/ro-RO.main.js.map +0 -1
- package/dist/ro-RO.mjs +0 -8
- package/dist/ro-RO.module.js +0 -8
- package/dist/ro-RO.module.js.map +0 -1
- package/dist/ru-RU.main.js +0 -6
- package/dist/ru-RU.main.js.map +0 -1
- package/dist/ru-RU.mjs +0 -8
- package/dist/ru-RU.module.js +0 -8
- package/dist/ru-RU.module.js.map +0 -1
- package/dist/sk-SK.main.js +0 -6
- package/dist/sk-SK.main.js.map +0 -1
- package/dist/sk-SK.mjs +0 -8
- package/dist/sk-SK.module.js +0 -8
- package/dist/sk-SK.module.js.map +0 -1
- package/dist/sl-SI.main.js +0 -6
- package/dist/sl-SI.main.js.map +0 -1
- package/dist/sl-SI.mjs +0 -8
- package/dist/sl-SI.module.js +0 -8
- package/dist/sl-SI.module.js.map +0 -1
- package/dist/sr-SP.main.js +0 -6
- package/dist/sr-SP.main.js.map +0 -1
- package/dist/sr-SP.mjs +0 -8
- package/dist/sr-SP.module.js +0 -8
- package/dist/sr-SP.module.js.map +0 -1
- package/dist/sv-SE.main.js +0 -6
- package/dist/sv-SE.main.js.map +0 -1
- package/dist/sv-SE.mjs +0 -8
- package/dist/sv-SE.module.js +0 -8
- package/dist/sv-SE.module.js.map +0 -1
- package/dist/tr-TR.main.js +0 -6
- package/dist/tr-TR.main.js.map +0 -1
- package/dist/tr-TR.mjs +0 -8
- package/dist/tr-TR.module.js +0 -8
- package/dist/tr-TR.module.js.map +0 -1
- package/dist/types.d.ts +0 -23
- package/dist/types.d.ts.map +0 -1
- package/dist/uk-UA.main.js +0 -6
- package/dist/uk-UA.main.js.map +0 -1
- package/dist/uk-UA.mjs +0 -8
- package/dist/uk-UA.module.js +0 -8
- package/dist/uk-UA.module.js.map +0 -1
- package/dist/useStepList.main.js +0 -54
- package/dist/useStepList.main.js.map +0 -1
- package/dist/useStepList.mjs +0 -49
- package/dist/useStepList.module.js +0 -49
- package/dist/useStepList.module.js.map +0 -1
- package/dist/useStepListItem.main.js +0 -53
- package/dist/useStepListItem.main.js.map +0 -1
- package/dist/useStepListItem.mjs +0 -48
- package/dist/useStepListItem.module.js +0 -48
- package/dist/useStepListItem.module.js.map +0 -1
- package/dist/zh-CN.main.js +0 -6
- package/dist/zh-CN.main.js.map +0 -1
- package/dist/zh-CN.mjs +0 -8
- package/dist/zh-CN.module.js +0 -8
- package/dist/zh-CN.module.js.map +0 -1
- package/dist/zh-TW.main.js +0 -6
- package/dist/zh-TW.main.js.map +0 -1
- package/dist/zh-TW.mjs +0 -8
- package/dist/zh-TW.module.js +0 -8
- package/dist/zh-TW.module.js.map +0 -1
- package/src/useStepList.ts +0 -53
- package/src/useStepListItem.ts +0 -67
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAoBM,SAAS,0CAAmB,KAA4B,EAAE,KAAuB,EAAE,GAAkC;IAC1H,MAAM,OAAC,GAAG,EAAC,GAAG;IACd,IAAI,EAAC,kBAAkB,OAAO,eAAE,WAAW,EAAC,GAAG;IAE/C,IAAI,aAAa,CAAC,MAAM,YAAY,CAAC;IAErC,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;oBAClC;aACA;aACA;QACA,kBAAkB;IACpB;IAEA,MAAM,aAAa,gBAAgB;IAEnC,IAAI,YAAY,CAAC;YAQf;QAPA,MAAM,EAAC,KAAK,QAAQ,EAAC,GAAG;QAExB,IAAI,aAAa,eAAe,aAAa,WAAW;YACtD,MAAM,cAAc;YACpB,MAAM,eAAe;QACvB;SAEA,uBAAA,UAAU,SAAS,cAAnB,2CAAA,0BAAA,WAAsB;IACxB;IAEA,OAAO;QACL,WAAW;YACT,GAAG,SAAS;uBACZ;YACA,MAAM;YACN,gBAAgB,aAAa,SAAS;YACtC,iBAAiB,aAAa,OAAO;YACrC,UAAU,CAAC,aAAa,IAAI;QAC9B;IACF;AACF","sources":["packages/@react-aria/steplist/src/useStepListItem.ts"],"sourcesContent":["/*\n * Copyright 2023 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 {HTMLAttributes} from 'react';\nimport {Key, RefObject} from '@react-types/shared';\nimport {StepListState} from '@react-stately/steplist';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface AriaStepListItemProps {\n key: Key\n}\n\nexport interface StepListItemAria {\n /** Props for the step link element. */\n stepProps: HTMLAttributes<HTMLElement>,\n /** Props for the visually hidden element indicating the step state. */\n stepStateProps?: HTMLAttributes<HTMLElement>,\n /** Text content for the visually hidden message indicating the status of the step state. */\n stepStateText?: String\n}\n\nexport function useStepListItem<T>(props: AriaStepListItemProps, state: StepListState<T>, ref: RefObject<HTMLElement | null>): StepListItemAria {\n const {key} = props;\n let {selectionManager: manager, selectedKey} = state;\n\n let isDisabled = !state.isSelectable(key);\n\n let {itemProps} = useSelectableItem({\n isDisabled,\n key,\n ref,\n selectionManager: manager\n });\n\n const isSelected = selectedKey === key;\n\n let onKeyDown = (event) => {\n const {key: eventKey} = event;\n\n if (eventKey === 'ArrowDown' || eventKey === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n }\n\n itemProps.onKeyDown?.(event);\n };\n\n return {\n stepProps: {\n ...itemProps,\n onKeyDown,\n role: 'link',\n 'aria-current': isSelected ? 'step' : undefined,\n 'aria-disabled': isDisabled ? true : undefined,\n tabIndex: !isDisabled ? 0 : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useStepListItem.main.js.map"}
|
package/dist/useStepListItem.mjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import {useSelectableItem as $12xzF$useSelectableItem} from "@react-aria/selection";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
5
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
*
|
|
9
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
-
* governing permissions and limitations under the License.
|
|
13
|
-
*/
|
|
14
|
-
function $dd7f9f4bee5b11b8$export$fd9dc107b7325b53(props, state, ref) {
|
|
15
|
-
const { key: key } = props;
|
|
16
|
-
let { selectionManager: manager, selectedKey: selectedKey } = state;
|
|
17
|
-
let isDisabled = !state.isSelectable(key);
|
|
18
|
-
let { itemProps: itemProps } = (0, $12xzF$useSelectableItem)({
|
|
19
|
-
isDisabled: isDisabled,
|
|
20
|
-
key: key,
|
|
21
|
-
ref: ref,
|
|
22
|
-
selectionManager: manager
|
|
23
|
-
});
|
|
24
|
-
const isSelected = selectedKey === key;
|
|
25
|
-
let onKeyDown = (event)=>{
|
|
26
|
-
var _itemProps_onKeyDown;
|
|
27
|
-
const { key: eventKey } = event;
|
|
28
|
-
if (eventKey === 'ArrowDown' || eventKey === 'ArrowUp') {
|
|
29
|
-
event.preventDefault();
|
|
30
|
-
event.stopPropagation();
|
|
31
|
-
}
|
|
32
|
-
(_itemProps_onKeyDown = itemProps.onKeyDown) === null || _itemProps_onKeyDown === void 0 ? void 0 : _itemProps_onKeyDown.call(itemProps, event);
|
|
33
|
-
};
|
|
34
|
-
return {
|
|
35
|
-
stepProps: {
|
|
36
|
-
...itemProps,
|
|
37
|
-
onKeyDown: onKeyDown,
|
|
38
|
-
role: 'link',
|
|
39
|
-
'aria-current': isSelected ? 'step' : undefined,
|
|
40
|
-
'aria-disabled': isDisabled ? true : undefined,
|
|
41
|
-
tabIndex: !isDisabled ? 0 : undefined
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export {$dd7f9f4bee5b11b8$export$fd9dc107b7325b53 as useStepListItem};
|
|
48
|
-
//# sourceMappingURL=useStepListItem.module.js.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import {useSelectableItem as $12xzF$useSelectableItem} from "@react-aria/selection";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
5
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
*
|
|
9
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
-
* governing permissions and limitations under the License.
|
|
13
|
-
*/
|
|
14
|
-
function $dd7f9f4bee5b11b8$export$fd9dc107b7325b53(props, state, ref) {
|
|
15
|
-
const { key: key } = props;
|
|
16
|
-
let { selectionManager: manager, selectedKey: selectedKey } = state;
|
|
17
|
-
let isDisabled = !state.isSelectable(key);
|
|
18
|
-
let { itemProps: itemProps } = (0, $12xzF$useSelectableItem)({
|
|
19
|
-
isDisabled: isDisabled,
|
|
20
|
-
key: key,
|
|
21
|
-
ref: ref,
|
|
22
|
-
selectionManager: manager
|
|
23
|
-
});
|
|
24
|
-
const isSelected = selectedKey === key;
|
|
25
|
-
let onKeyDown = (event)=>{
|
|
26
|
-
var _itemProps_onKeyDown;
|
|
27
|
-
const { key: eventKey } = event;
|
|
28
|
-
if (eventKey === 'ArrowDown' || eventKey === 'ArrowUp') {
|
|
29
|
-
event.preventDefault();
|
|
30
|
-
event.stopPropagation();
|
|
31
|
-
}
|
|
32
|
-
(_itemProps_onKeyDown = itemProps.onKeyDown) === null || _itemProps_onKeyDown === void 0 ? void 0 : _itemProps_onKeyDown.call(itemProps, event);
|
|
33
|
-
};
|
|
34
|
-
return {
|
|
35
|
-
stepProps: {
|
|
36
|
-
...itemProps,
|
|
37
|
-
onKeyDown: onKeyDown,
|
|
38
|
-
role: 'link',
|
|
39
|
-
'aria-current': isSelected ? 'step' : undefined,
|
|
40
|
-
'aria-disabled': isDisabled ? true : undefined,
|
|
41
|
-
tabIndex: !isDisabled ? 0 : undefined
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export {$dd7f9f4bee5b11b8$export$fd9dc107b7325b53 as useStepListItem};
|
|
48
|
-
//# sourceMappingURL=useStepListItem.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAoBM,SAAS,0CAAmB,KAA4B,EAAE,KAAuB,EAAE,GAAkC;IAC1H,MAAM,OAAC,GAAG,EAAC,GAAG;IACd,IAAI,EAAC,kBAAkB,OAAO,eAAE,WAAW,EAAC,GAAG;IAE/C,IAAI,aAAa,CAAC,MAAM,YAAY,CAAC;IAErC,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;oBAClC;aACA;aACA;QACA,kBAAkB;IACpB;IAEA,MAAM,aAAa,gBAAgB;IAEnC,IAAI,YAAY,CAAC;YAQf;QAPA,MAAM,EAAC,KAAK,QAAQ,EAAC,GAAG;QAExB,IAAI,aAAa,eAAe,aAAa,WAAW;YACtD,MAAM,cAAc;YACpB,MAAM,eAAe;QACvB;SAEA,uBAAA,UAAU,SAAS,cAAnB,2CAAA,0BAAA,WAAsB;IACxB;IAEA,OAAO;QACL,WAAW;YACT,GAAG,SAAS;uBACZ;YACA,MAAM;YACN,gBAAgB,aAAa,SAAS;YACtC,iBAAiB,aAAa,OAAO;YACrC,UAAU,CAAC,aAAa,IAAI;QAC9B;IACF;AACF","sources":["packages/@react-aria/steplist/src/useStepListItem.ts"],"sourcesContent":["/*\n * Copyright 2023 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 {HTMLAttributes} from 'react';\nimport {Key, RefObject} from '@react-types/shared';\nimport {StepListState} from '@react-stately/steplist';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface AriaStepListItemProps {\n key: Key\n}\n\nexport interface StepListItemAria {\n /** Props for the step link element. */\n stepProps: HTMLAttributes<HTMLElement>,\n /** Props for the visually hidden element indicating the step state. */\n stepStateProps?: HTMLAttributes<HTMLElement>,\n /** Text content for the visually hidden message indicating the status of the step state. */\n stepStateText?: String\n}\n\nexport function useStepListItem<T>(props: AriaStepListItemProps, state: StepListState<T>, ref: RefObject<HTMLElement | null>): StepListItemAria {\n const {key} = props;\n let {selectionManager: manager, selectedKey} = state;\n\n let isDisabled = !state.isSelectable(key);\n\n let {itemProps} = useSelectableItem({\n isDisabled,\n key,\n ref,\n selectionManager: manager\n });\n\n const isSelected = selectedKey === key;\n\n let onKeyDown = (event) => {\n const {key: eventKey} = event;\n\n if (eventKey === 'ArrowDown' || eventKey === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n }\n\n itemProps.onKeyDown?.(event);\n };\n\n return {\n stepProps: {\n ...itemProps,\n onKeyDown,\n role: 'link',\n 'aria-current': isSelected ? 'step' : undefined,\n 'aria-disabled': isDisabled ? true : undefined,\n tabIndex: !isDisabled ? 0 : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useStepListItem.module.js.map"}
|
package/dist/zh-CN.main.js
DELETED
package/dist/zh-CN.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,YAAY,CAAC,gCAAI,CAAC;AACtC","sources":["packages/@react-aria/steplist/intl/zh-CN.json"],"sourcesContent":["{\n \"steplist\": \"步骤列表\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
|
package/dist/zh-CN.mjs
DELETED
package/dist/zh-CN.module.js
DELETED
package/dist/zh-CN.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,YAAY,CAAC,gCAAI,CAAC;AACtC","sources":["packages/@react-aria/steplist/intl/zh-CN.json"],"sourcesContent":["{\n \"steplist\": \"步骤列表\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}
|
package/dist/zh-TW.main.js
DELETED
package/dist/zh-TW.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,YAAY,CAAC,gCAAI,CAAC;AACtC","sources":["packages/@react-aria/steplist/intl/zh-TW.json"],"sourcesContent":["{\n \"steplist\": \"步驟清單\"\n}\n"],"names":[],"version":3,"file":"zh-TW.main.js.map"}
|
package/dist/zh-TW.mjs
DELETED
package/dist/zh-TW.module.js
DELETED
package/dist/zh-TW.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,YAAY,CAAC,gCAAI,CAAC;AACtC","sources":["packages/@react-aria/steplist/intl/zh-TW.json"],"sourcesContent":["{\n \"steplist\": \"步驟清單\"\n}\n"],"names":[],"version":3,"file":"zh-TW.module.js.map"}
|
package/src/useStepList.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
3
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
* governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import {AriaLabelingProps, DOMProps, RefObject} from '@react-types/shared';
|
|
14
|
-
import {filterDOMProps, mergeProps} from '@react-aria/utils';
|
|
15
|
-
import {HTMLAttributes} from 'react';
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
import intlMessages from '../intl/*.json';
|
|
18
|
-
import {StepListProps, StepListState} from '@react-stately/steplist';
|
|
19
|
-
import {useLocalizedStringFormatter} from '@react-aria/i18n';
|
|
20
|
-
import {useSelectableList} from '@react-aria/selection';
|
|
21
|
-
|
|
22
|
-
export interface AriaStepListProps<T> extends StepListProps<T>, AriaLabelingProps, DOMProps {}
|
|
23
|
-
|
|
24
|
-
export interface StepListAria {
|
|
25
|
-
listProps: HTMLAttributes<HTMLElement>
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function useStepList<T>(props: AriaStepListProps<T>, state: StepListState<T>, ref: RefObject<HTMLOListElement | null>): StepListAria {
|
|
29
|
-
let {
|
|
30
|
-
'aria-label': ariaLabel
|
|
31
|
-
} = props;
|
|
32
|
-
let {listProps} = useSelectableList({
|
|
33
|
-
...props,
|
|
34
|
-
...state,
|
|
35
|
-
allowsTabNavigation: true,
|
|
36
|
-
ref
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const strings = useLocalizedStringFormatter(intlMessages, '@react-aria/steplist');
|
|
40
|
-
const stepListProps: HTMLAttributes<HTMLElement> = {
|
|
41
|
-
...mergeProps(listProps, filterDOMProps(props, {labelable: true})),
|
|
42
|
-
'aria-label': ariaLabel || strings.format('steplist')
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
listProps: {
|
|
47
|
-
...stepListProps,
|
|
48
|
-
tabIndex: undefined
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
package/src/useStepListItem.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
3
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
* governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import {HTMLAttributes} from 'react';
|
|
14
|
-
import {Key, RefObject} from '@react-types/shared';
|
|
15
|
-
import {StepListState} from '@react-stately/steplist';
|
|
16
|
-
import {useSelectableItem} from '@react-aria/selection';
|
|
17
|
-
|
|
18
|
-
export interface AriaStepListItemProps {
|
|
19
|
-
key: Key
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface StepListItemAria {
|
|
23
|
-
/** Props for the step link element. */
|
|
24
|
-
stepProps: HTMLAttributes<HTMLElement>,
|
|
25
|
-
/** Props for the visually hidden element indicating the step state. */
|
|
26
|
-
stepStateProps?: HTMLAttributes<HTMLElement>,
|
|
27
|
-
/** Text content for the visually hidden message indicating the status of the step state. */
|
|
28
|
-
stepStateText?: String
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function useStepListItem<T>(props: AriaStepListItemProps, state: StepListState<T>, ref: RefObject<HTMLElement | null>): StepListItemAria {
|
|
32
|
-
const {key} = props;
|
|
33
|
-
let {selectionManager: manager, selectedKey} = state;
|
|
34
|
-
|
|
35
|
-
let isDisabled = !state.isSelectable(key);
|
|
36
|
-
|
|
37
|
-
let {itemProps} = useSelectableItem({
|
|
38
|
-
isDisabled,
|
|
39
|
-
key,
|
|
40
|
-
ref,
|
|
41
|
-
selectionManager: manager
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const isSelected = selectedKey === key;
|
|
45
|
-
|
|
46
|
-
let onKeyDown = (event) => {
|
|
47
|
-
const {key: eventKey} = event;
|
|
48
|
-
|
|
49
|
-
if (eventKey === 'ArrowDown' || eventKey === 'ArrowUp') {
|
|
50
|
-
event.preventDefault();
|
|
51
|
-
event.stopPropagation();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
itemProps.onKeyDown?.(event);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
stepProps: {
|
|
59
|
-
...itemProps,
|
|
60
|
-
onKeyDown,
|
|
61
|
-
role: 'link',
|
|
62
|
-
'aria-current': isSelected ? 'step' : undefined,
|
|
63
|
-
'aria-disabled': isDisabled ? true : undefined,
|
|
64
|
-
tabIndex: !isDisabled ? 0 : undefined
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|