@react-aria/steplist 3.0.0-alpha.4 → 3.0.0-alpha.6
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/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/intlStrings.mjs +1 -1
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useStepList.main.js +3 -3
- package/dist/useStepList.main.js.map +1 -1
- package/dist/useStepList.mjs +4 -4
- package/dist/useStepList.module.js +3 -3
- package/dist/useStepList.module.js.map +1 -1
- package/dist/useStepListItem.main.js +4 -4
- package/dist/useStepListItem.main.js.map +1 -1
- package/dist/useStepListItem.mjs +5 -5
- package/dist/useStepListItem.module.js +4 -4
- package/dist/useStepListItem.module.js.map +1 -1
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +9 -9
- package/src/useStepList.ts +3 -3
- package/src/useStepListItem.ts +3 -3
package/dist/ar-AE.mjs
CHANGED
package/dist/bg-BG.mjs
CHANGED
package/dist/cs-CZ.mjs
CHANGED
package/dist/da-DK.mjs
CHANGED
package/dist/de-DE.mjs
CHANGED
package/dist/el-GR.mjs
CHANGED
package/dist/en-US.mjs
CHANGED
package/dist/es-ES.mjs
CHANGED
package/dist/et-EE.mjs
CHANGED
package/dist/fi-FI.mjs
CHANGED
package/dist/fr-FR.mjs
CHANGED
package/dist/he-IL.mjs
CHANGED
package/dist/hr-HR.mjs
CHANGED
package/dist/hu-HU.mjs
CHANGED
package/dist/intlStrings.mjs
CHANGED
package/dist/it-IT.mjs
CHANGED
package/dist/ja-JP.mjs
CHANGED
package/dist/ko-KR.mjs
CHANGED
package/dist/lt-LT.mjs
CHANGED
package/dist/lv-LV.mjs
CHANGED
package/dist/nb-NO.mjs
CHANGED
package/dist/nl-NL.mjs
CHANGED
package/dist/pl-PL.mjs
CHANGED
package/dist/pt-BR.mjs
CHANGED
package/dist/pt-PT.mjs
CHANGED
package/dist/ro-RO.mjs
CHANGED
package/dist/ru-RU.mjs
CHANGED
package/dist/sk-SK.mjs
CHANGED
package/dist/sl-SI.mjs
CHANGED
package/dist/sr-SP.mjs
CHANGED
package/dist/sv-SE.mjs
CHANGED
package/dist/tr-TR.mjs
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AriaLabelingProps, DOMProps, Key } from "@react-types/shared";
|
|
2
|
-
import { HTMLAttributes
|
|
1
|
+
import { AriaLabelingProps, DOMProps, RefObject, Key } from "@react-types/shared";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
3
|
import { StepListProps, StepListState } from "@react-stately/steplist";
|
|
4
4
|
export interface AriaStepListProps<T> extends StepListProps<T>, AriaLabelingProps, DOMProps {
|
|
5
5
|
}
|
|
6
6
|
export interface StepListAria {
|
|
7
7
|
listProps: HTMLAttributes<HTMLElement>;
|
|
8
8
|
}
|
|
9
|
-
export function useStepList<T>(props: AriaStepListProps<T>, state: StepListState<T>, ref: RefObject<HTMLOListElement>): StepListAria;
|
|
9
|
+
export function useStepList<T>(props: AriaStepListProps<T>, state: StepListState<T>, ref: RefObject<HTMLOListElement | null>): StepListAria;
|
|
10
10
|
export interface AriaStepListItemProps {
|
|
11
11
|
key: Key;
|
|
12
12
|
}
|
|
@@ -18,6 +18,6 @@ export interface StepListItemAria {
|
|
|
18
18
|
/** Text content for the visually hidden message indicating the status of the step state. */
|
|
19
19
|
stepStateText?: String;
|
|
20
20
|
}
|
|
21
|
-
export function useStepListItem<T>(props: AriaStepListItemProps, state: StepListState<T>, ref: RefObject<HTMLElement>): StepListItemAria;
|
|
21
|
+
export function useStepListItem<T>(props: AriaStepListItemProps, state: StepListState<T>, ref: RefObject<HTMLElement | null>): StepListItemAria;
|
|
22
22
|
|
|
23
23
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAqBA,mCAAmC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,EAAE,iBAAiB,EAAE,QAAQ;CAAG;AAE9F;IACE,SAAS,EAAE,eAAe,WAAW,CAAC,CAAA;CACvC;AAED,4BAA4B,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,CAAC,GAAG,YAAY,
|
|
1
|
+
{"mappings":";;;AAqBA,mCAAmC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,EAAE,iBAAiB,EAAE,QAAQ;CAAG;AAE9F;IACE,SAAS,EAAE,eAAe,WAAW,CAAC,CAAA;CACvC;AAED,4BAA4B,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,GAAG,YAAY,CAuB1I;ACjCD;IACE,GAAG,EAAE,GAAG,CAAA;CACT;AAED;IACE,uCAAuC;IACvC,SAAS,EAAE,eAAe,WAAW,CAAC,CAAC;IACvC,uEAAuE;IACvE,cAAc,CAAC,EAAE,eAAe,WAAW,CAAC,CAAC;IAC7C,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,gCAAgC,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,GAAG,gBAAgB,CAoC9I","sources":["packages/@react-aria/steplist/src/packages/@react-aria/steplist/src/useStepList.ts","packages/@react-aria/steplist/src/packages/@react-aria/steplist/src/useStepListItem.ts","packages/@react-aria/steplist/src/packages/@react-aria/steplist/src/index.ts","packages/@react-aria/steplist/src/index.ts"],"sourcesContent":[null,null,null,"/*\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\nexport {useStepList} from './useStepList';\nexport {useStepListItem} from './useStepListItem';\n\nexport type {AriaStepListProps, StepListAria} from './useStepList';\nexport type {AriaStepListItemProps, StepListItemAria} from './useStepListItem';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/dist/uk-UA.mjs
CHANGED
package/dist/useStepList.main.js
CHANGED
|
@@ -28,19 +28,19 @@ $parcel$export(module.exports, "useStepList", () => $900a30dd63582698$export$c51
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
function $900a30dd63582698$export$c51c7b7354499d04(props, state, ref) {
|
|
31
|
-
let {
|
|
31
|
+
let { 'aria-label': ariaLabel } = props;
|
|
32
32
|
let { listProps: listProps } = (0, $7WRFn$reactariaselection.useSelectableList)({
|
|
33
33
|
...props,
|
|
34
34
|
...state,
|
|
35
35
|
allowsTabNavigation: true,
|
|
36
36
|
ref: ref
|
|
37
37
|
});
|
|
38
|
-
const strings = (0, $7WRFn$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($819d2f6398427998$exports))),
|
|
38
|
+
const strings = (0, $7WRFn$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($819d2f6398427998$exports))), '@react-aria/steplist');
|
|
39
39
|
const stepListProps = {
|
|
40
40
|
...(0, $7WRFn$reactariautils.mergeProps)(listProps, (0, $7WRFn$reactariautils.filterDOMProps)(props, {
|
|
41
41
|
labelable: true
|
|
42
42
|
})),
|
|
43
|
-
|
|
43
|
+
'aria-label': ariaLabel || strings.format('steplist')
|
|
44
44
|
};
|
|
45
45
|
return {
|
|
46
46
|
listProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAiBM,SAAS,0CAAe,KAA2B,EAAE,KAAuB,EAAE,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAiBM,SAAS,0CAAe,KAA2B,EAAE,KAAuB,EAAE,GAAuC;IAC1H,IAAI,EACF,cAAc,SAAS,EACxB,GAAG;IACJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;QAClC,GAAG,KAAK;QACR,GAAG,KAAK;QACR,qBAAqB;aACrB;IACF;IAEA,MAAM,UAAU,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAC1D,MAAM,gBAA6C;QACjD,GAAG,CAAA,GAAA,gCAAS,EAAE,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;YAAC,WAAW;QAAI,GAAG;QAClE,cAAc,aAAa,QAAQ,MAAM,CAAC;IAC5C;IAEA,OAAO;QACL,WAAW;YACT,GAAG,aAAa;YAChB,UAAU;QACZ;IACF;AACF","sources":["packages/@react-aria/steplist/src/useStepList.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 {AriaLabelingProps, DOMProps, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {StepListProps, StepListState} from '@react-stately/steplist';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSelectableList} from '@react-aria/selection';\n\nexport interface AriaStepListProps<T> extends StepListProps<T>, AriaLabelingProps, DOMProps {}\n\nexport interface StepListAria {\n listProps: HTMLAttributes<HTMLElement>\n}\n\nexport function useStepList<T>(props: AriaStepListProps<T>, state: StepListState<T>, ref: RefObject<HTMLOListElement | null>): StepListAria {\n let {\n 'aria-label': ariaLabel\n } = props;\n let {listProps} = useSelectableList({\n ...props,\n ...state,\n allowsTabNavigation: true,\n ref\n });\n\n const strings = useLocalizedStringFormatter(intlMessages, '@react-aria/steplist');\n const stepListProps: HTMLAttributes<HTMLElement> = {\n ...mergeProps(listProps, filterDOMProps(props, {labelable: true})),\n 'aria-label': ariaLabel || strings.format('steplist')\n };\n\n return {\n listProps: {\n ...stepListProps,\n tabIndex: undefined\n }\n };\n}\n\n\n"],"names":[],"version":3,"file":"useStepList.main.js.map"}
|
package/dist/useStepList.mjs
CHANGED
|
@@ -22,19 +22,19 @@ function $parcel$interopDefault(a) {
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
function $8ca870e256ef9d32$export$c51c7b7354499d04(props, state, ref) {
|
|
25
|
-
let {
|
|
25
|
+
let { 'aria-label': ariaLabel } = props;
|
|
26
26
|
let { listProps: listProps } = (0, $lejUC$useSelectableList)({
|
|
27
27
|
...props,
|
|
28
28
|
...state,
|
|
29
29
|
allowsTabNavigation: true,
|
|
30
30
|
ref: ref
|
|
31
31
|
});
|
|
32
|
-
const strings = (0, $lejUC$useLocalizedStringFormatter)((0, ($parcel$interopDefault($lejUC$intlStringsmodulejs))),
|
|
32
|
+
const strings = (0, $lejUC$useLocalizedStringFormatter)((0, ($parcel$interopDefault($lejUC$intlStringsmodulejs))), '@react-aria/steplist');
|
|
33
33
|
const stepListProps = {
|
|
34
34
|
...(0, $lejUC$mergeProps)(listProps, (0, $lejUC$filterDOMProps)(props, {
|
|
35
35
|
labelable: true
|
|
36
36
|
})),
|
|
37
|
-
|
|
37
|
+
'aria-label': ariaLabel || strings.format('steplist')
|
|
38
38
|
};
|
|
39
39
|
return {
|
|
40
40
|
listProps: {
|
|
@@ -46,4 +46,4 @@ function $8ca870e256ef9d32$export$c51c7b7354499d04(props, state, ref) {
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
export {$8ca870e256ef9d32$export$c51c7b7354499d04 as useStepList};
|
|
49
|
-
//# sourceMappingURL=useStepList.
|
|
49
|
+
//# sourceMappingURL=useStepList.module.js.map
|
|
@@ -22,19 +22,19 @@ function $parcel$interopDefault(a) {
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
function $8ca870e256ef9d32$export$c51c7b7354499d04(props, state, ref) {
|
|
25
|
-
let {
|
|
25
|
+
let { 'aria-label': ariaLabel } = props;
|
|
26
26
|
let { listProps: listProps } = (0, $lejUC$useSelectableList)({
|
|
27
27
|
...props,
|
|
28
28
|
...state,
|
|
29
29
|
allowsTabNavigation: true,
|
|
30
30
|
ref: ref
|
|
31
31
|
});
|
|
32
|
-
const strings = (0, $lejUC$useLocalizedStringFormatter)((0, ($parcel$interopDefault($lejUC$intlStringsmodulejs))),
|
|
32
|
+
const strings = (0, $lejUC$useLocalizedStringFormatter)((0, ($parcel$interopDefault($lejUC$intlStringsmodulejs))), '@react-aria/steplist');
|
|
33
33
|
const stepListProps = {
|
|
34
34
|
...(0, $lejUC$mergeProps)(listProps, (0, $lejUC$filterDOMProps)(props, {
|
|
35
35
|
labelable: true
|
|
36
36
|
})),
|
|
37
|
-
|
|
37
|
+
'aria-label': ariaLabel || strings.format('steplist')
|
|
38
38
|
};
|
|
39
39
|
return {
|
|
40
40
|
listProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAiBM,SAAS,0CAAe,KAA2B,EAAE,KAAuB,EAAE,
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAiBM,SAAS,0CAAe,KAA2B,EAAE,KAAuB,EAAE,GAAuC;IAC1H,IAAI,EACF,cAAc,SAAS,EACxB,GAAG;IACJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QAClC,GAAG,KAAK;QACR,GAAG,KAAK;QACR,qBAAqB;aACrB;IACF;IAEA,MAAM,UAAU,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAC1D,MAAM,gBAA6C;QACjD,GAAG,CAAA,GAAA,iBAAS,EAAE,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;YAAC,WAAW;QAAI,GAAG;QAClE,cAAc,aAAa,QAAQ,MAAM,CAAC;IAC5C;IAEA,OAAO;QACL,WAAW;YACT,GAAG,aAAa;YAChB,UAAU;QACZ;IACF;AACF","sources":["packages/@react-aria/steplist/src/useStepList.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 {AriaLabelingProps, DOMProps, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {StepListProps, StepListState} from '@react-stately/steplist';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSelectableList} from '@react-aria/selection';\n\nexport interface AriaStepListProps<T> extends StepListProps<T>, AriaLabelingProps, DOMProps {}\n\nexport interface StepListAria {\n listProps: HTMLAttributes<HTMLElement>\n}\n\nexport function useStepList<T>(props: AriaStepListProps<T>, state: StepListState<T>, ref: RefObject<HTMLOListElement | null>): StepListAria {\n let {\n 'aria-label': ariaLabel\n } = props;\n let {listProps} = useSelectableList({\n ...props,\n ...state,\n allowsTabNavigation: true,\n ref\n });\n\n const strings = useLocalizedStringFormatter(intlMessages, '@react-aria/steplist');\n const stepListProps: HTMLAttributes<HTMLElement> = {\n ...mergeProps(listProps, filterDOMProps(props, {labelable: true})),\n 'aria-label': ariaLabel || strings.format('steplist')\n };\n\n return {\n listProps: {\n ...stepListProps,\n tabIndex: undefined\n }\n };\n}\n\n\n"],"names":[],"version":3,"file":"useStepList.module.js.map"}
|
|
@@ -31,7 +31,7 @@ function $0246bc8e841080a9$export$fd9dc107b7325b53(props, state, ref) {
|
|
|
31
31
|
let onKeyDown = (event)=>{
|
|
32
32
|
var _itemProps_onKeyDown;
|
|
33
33
|
const { key: eventKey } = event;
|
|
34
|
-
if (eventKey ===
|
|
34
|
+
if (eventKey === 'ArrowDown' || eventKey === 'ArrowUp') {
|
|
35
35
|
event.preventDefault();
|
|
36
36
|
event.stopPropagation();
|
|
37
37
|
}
|
|
@@ -41,9 +41,9 @@ function $0246bc8e841080a9$export$fd9dc107b7325b53(props, state, ref) {
|
|
|
41
41
|
stepProps: {
|
|
42
42
|
...itemProps,
|
|
43
43
|
onKeyDown: onKeyDown,
|
|
44
|
-
role:
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
role: 'link',
|
|
45
|
+
'aria-current': isSelected ? 'step' : undefined,
|
|
46
|
+
'aria-disabled': isDisabled ? true : undefined,
|
|
47
47
|
tabIndex: !isDisabled ? 0 : undefined
|
|
48
48
|
}
|
|
49
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAoBM,SAAS,0CAAmB,KAA4B,EAAE,KAAuB,EAAE,
|
|
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
CHANGED
|
@@ -25,7 +25,7 @@ function $dd7f9f4bee5b11b8$export$fd9dc107b7325b53(props, state, ref) {
|
|
|
25
25
|
let onKeyDown = (event)=>{
|
|
26
26
|
var _itemProps_onKeyDown;
|
|
27
27
|
const { key: eventKey } = event;
|
|
28
|
-
if (eventKey ===
|
|
28
|
+
if (eventKey === 'ArrowDown' || eventKey === 'ArrowUp') {
|
|
29
29
|
event.preventDefault();
|
|
30
30
|
event.stopPropagation();
|
|
31
31
|
}
|
|
@@ -35,9 +35,9 @@ function $dd7f9f4bee5b11b8$export$fd9dc107b7325b53(props, state, ref) {
|
|
|
35
35
|
stepProps: {
|
|
36
36
|
...itemProps,
|
|
37
37
|
onKeyDown: onKeyDown,
|
|
38
|
-
role:
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
role: 'link',
|
|
39
|
+
'aria-current': isSelected ? 'step' : undefined,
|
|
40
|
+
'aria-disabled': isDisabled ? true : undefined,
|
|
41
41
|
tabIndex: !isDisabled ? 0 : undefined
|
|
42
42
|
}
|
|
43
43
|
};
|
|
@@ -45,4 +45,4 @@ function $dd7f9f4bee5b11b8$export$fd9dc107b7325b53(props, state, ref) {
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
export {$dd7f9f4bee5b11b8$export$fd9dc107b7325b53 as useStepListItem};
|
|
48
|
-
//# sourceMappingURL=useStepListItem.
|
|
48
|
+
//# sourceMappingURL=useStepListItem.module.js.map
|
|
@@ -25,7 +25,7 @@ function $dd7f9f4bee5b11b8$export$fd9dc107b7325b53(props, state, ref) {
|
|
|
25
25
|
let onKeyDown = (event)=>{
|
|
26
26
|
var _itemProps_onKeyDown;
|
|
27
27
|
const { key: eventKey } = event;
|
|
28
|
-
if (eventKey ===
|
|
28
|
+
if (eventKey === 'ArrowDown' || eventKey === 'ArrowUp') {
|
|
29
29
|
event.preventDefault();
|
|
30
30
|
event.stopPropagation();
|
|
31
31
|
}
|
|
@@ -35,9 +35,9 @@ function $dd7f9f4bee5b11b8$export$fd9dc107b7325b53(props, state, ref) {
|
|
|
35
35
|
stepProps: {
|
|
36
36
|
...itemProps,
|
|
37
37
|
onKeyDown: onKeyDown,
|
|
38
|
-
role:
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
role: 'link',
|
|
39
|
+
'aria-current': isSelected ? 'step' : undefined,
|
|
40
|
+
'aria-disabled': isDisabled ? true : undefined,
|
|
41
41
|
tabIndex: !isDisabled ? 0 : undefined
|
|
42
42
|
}
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAoBM,SAAS,0CAAmB,KAA4B,EAAE,KAAuB,EAAE,
|
|
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.mjs
CHANGED
package/dist/zh-TW.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/steplist",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.6",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/i18n": "^3.
|
|
26
|
-
"@react-aria/selection": "^3.
|
|
27
|
-
"@react-aria/utils": "^3.
|
|
28
|
-
"@react-stately/steplist": "3.0.0-alpha.
|
|
29
|
-
"@react-types/shared": "^3.
|
|
25
|
+
"@react-aria/i18n": "^3.12.0",
|
|
26
|
+
"@react-aria/selection": "^3.19.0",
|
|
27
|
+
"@react-aria/utils": "^3.25.0",
|
|
28
|
+
"@react-stately/steplist": "3.0.0-alpha.6",
|
|
29
|
+
"@react-types/shared": "^3.24.0",
|
|
30
30
|
"@swc/helpers": "^0.5.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
|
|
34
|
-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
33
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
|
|
34
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "86d80e3216bc32e75108831cf3a5a720bc849206"
|
|
40
40
|
}
|
package/src/useStepList.ts
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {AriaLabelingProps, DOMProps} from '@react-types/shared';
|
|
13
|
+
import {AriaLabelingProps, DOMProps, RefObject} from '@react-types/shared';
|
|
14
14
|
import {filterDOMProps, mergeProps} from '@react-aria/utils';
|
|
15
|
-
import {HTMLAttributes
|
|
15
|
+
import {HTMLAttributes} from 'react';
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
import intlMessages from '../intl/*.json';
|
|
18
18
|
import {StepListProps, StepListState} from '@react-stately/steplist';
|
|
@@ -25,7 +25,7 @@ export interface StepListAria {
|
|
|
25
25
|
listProps: HTMLAttributes<HTMLElement>
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export function useStepList<T>(props: AriaStepListProps<T>, state: StepListState<T>, ref: RefObject<HTMLOListElement>): StepListAria {
|
|
28
|
+
export function useStepList<T>(props: AriaStepListProps<T>, state: StepListState<T>, ref: RefObject<HTMLOListElement | null>): StepListAria {
|
|
29
29
|
let {
|
|
30
30
|
'aria-label': ariaLabel
|
|
31
31
|
} = props;
|
package/src/useStepListItem.ts
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {HTMLAttributes
|
|
14
|
-
import {Key} from '@react-types/shared';
|
|
13
|
+
import {HTMLAttributes} from 'react';
|
|
14
|
+
import {Key, RefObject} from '@react-types/shared';
|
|
15
15
|
import {StepListState} from '@react-stately/steplist';
|
|
16
16
|
import {useSelectableItem} from '@react-aria/selection';
|
|
17
17
|
|
|
@@ -28,7 +28,7 @@ export interface StepListItemAria {
|
|
|
28
28
|
stepStateText?: String
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export function useStepListItem<T>(props: AriaStepListItemProps, state: StepListState<T>, ref: RefObject<HTMLElement>): StepListItemAria {
|
|
31
|
+
export function useStepListItem<T>(props: AriaStepListItemProps, state: StepListState<T>, ref: RefObject<HTMLElement | null>): StepListItemAria {
|
|
32
32
|
const {key} = props;
|
|
33
33
|
let {selectionManager: manager, selectedKey} = state;
|
|
34
34
|
|