@fluentui/react-accordion 9.3.21 → 9.3.23

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/CHANGELOG.json CHANGED
@@ -2,7 +2,67 @@
2
2
  "name": "@fluentui/react-accordion",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 11 Oct 2023 13:50:07 GMT",
5
+ "date": "Wed, 18 Oct 2023 17:47:31 GMT",
6
+ "tag": "@fluentui/react-accordion_v9.3.23",
7
+ "version": "9.3.23",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-accordion",
13
+ "commit": "967882a55a7333effea42e4c24a64e8547309116",
14
+ "comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-accordion",
19
+ "comment": "Bump @fluentui/react-aria to v9.3.43",
20
+ "commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-accordion",
25
+ "comment": "Bump @fluentui/react-context-selector to v9.1.41",
26
+ "commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-accordion",
31
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.18",
32
+ "commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-accordion",
37
+ "comment": "Bump @fluentui/react-tabster to v9.14.0",
38
+ "commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-accordion",
43
+ "comment": "Bump @fluentui/react-utilities to v9.15.1",
44
+ "commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Thu, 12 Oct 2023 14:55:44 GMT",
51
+ "tag": "@fluentui/react-accordion_v9.3.22",
52
+ "version": "9.3.22",
53
+ "comments": {
54
+ "patch": [
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui/react-accordion",
58
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.17",
59
+ "commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
60
+ }
61
+ ]
62
+ }
63
+ },
64
+ {
65
+ "date": "Wed, 11 Oct 2023 13:54:26 GMT",
6
66
  "tag": "@fluentui/react-accordion_v9.3.21",
7
67
  "version": "9.3.21",
8
68
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,35 @@
1
1
  # Change Log - @fluentui/react-accordion
2
2
 
3
- This log was last generated on Wed, 11 Oct 2023 13:50:07 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 18 Oct 2023 17:47:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.3.23](https://github.com/microsoft/fluentui/tree/@fluentui/react-accordion_v9.3.23)
8
+
9
+ Wed, 18 Oct 2023 17:47:31 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-accordion_v9.3.22..@fluentui/react-accordion_v9.3.23)
11
+
12
+ ### Patches
13
+
14
+ - chore: migrate from getNativeElementProps to getIntrinsicElementProps ([PR #29499](https://github.com/microsoft/fluentui/pull/29499) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-aria to v9.3.43 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
16
+ - Bump @fluentui/react-context-selector to v9.1.41 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
17
+ - Bump @fluentui/react-jsx-runtime to v9.0.18 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.14.0 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.15.1 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
20
+
21
+ ## [9.3.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-accordion_v9.3.22)
22
+
23
+ Thu, 12 Oct 2023 14:55:44 GMT
24
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-accordion_v9.3.21..@fluentui/react-accordion_v9.3.22)
25
+
26
+ ### Patches
27
+
28
+ - Bump @fluentui/react-jsx-runtime to v9.0.17 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
29
+
7
30
  ## [9.3.21](https://github.com/microsoft/fluentui/tree/@fluentui/react-accordion_v9.3.21)
8
31
 
9
- Wed, 11 Oct 2023 13:50:07 GMT
32
+ Wed, 11 Oct 2023 13:54:26 GMT
10
33
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-accordion_v9.3.20..@fluentui/react-accordion_v9.3.21)
11
34
 
12
35
  ### Patches
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { getNativeElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';
2
+ import { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';
3
3
  import { useArrowNavigationGroup } from '@fluentui/react-tabster';
4
4
  /**
5
5
  * Returns the props and state required to render the component
@@ -38,10 +38,13 @@ import { useArrowNavigationGroup } from '@fluentui/react-tabster';
38
38
  components: {
39
39
  root: 'div'
40
40
  },
41
- root: slot.always(getNativeElementProps('div', {
41
+ root: slot.always(getIntrinsicElementProps('div', {
42
42
  ...props,
43
43
  ...navigation ? arrowNavigationProps : undefined,
44
- ref
44
+ // FIXME:
45
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
46
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
47
+ ref: ref
45
48
  }), {
46
49
  elementType: 'div'
47
50
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["useAccordion.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';\nimport type { AccordionProps, AccordionState } from './Accordion.types';\nimport type { AccordionItemValue } from '../AccordionItem/AccordionItem.types';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { AccordionRequestToggleData } from '../../contexts/accordion';\n\n/**\n * Returns the props and state required to render the component\n * @param props - Accordion properties\n * @param ref - reference to root HTMLElement of Accordion\n */\nexport const useAccordion_unstable = <Value = AccordionItemValue>(\n props: AccordionProps<Value>,\n ref: React.Ref<HTMLElement>,\n): AccordionState<Value> => {\n const {\n openItems: controlledOpenItems,\n defaultOpenItems,\n multiple = false,\n collapsible = false,\n onToggle,\n navigation,\n } = props;\n const [openItems, setOpenItems] = useControllableState({\n state: React.useMemo(() => normalizeValues(controlledOpenItems), [controlledOpenItems]),\n defaultState: () => initializeUncontrolledOpenItems({ defaultOpenItems, multiple }),\n initialState: [],\n });\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: navigation === 'circular',\n tabbable: true,\n });\n\n const requestToggle = useEventCallback((data: AccordionRequestToggleData<Value>) => {\n const nextOpenItems = updateOpenItems(data.value, openItems, multiple, collapsible);\n onToggle?.(data.event, { value: data.value, openItems: nextOpenItems });\n setOpenItems(nextOpenItems);\n });\n\n return {\n collapsible,\n multiple,\n navigation,\n openItems,\n requestToggle,\n components: {\n root: 'div',\n },\n root: slot.always(\n getNativeElementProps('div', {\n ...props,\n ...(navigation ? arrowNavigationProps : undefined),\n ref,\n }),\n { elementType: 'div' },\n ),\n };\n};\n\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */\nfunction initializeUncontrolledOpenItems<Value = AccordionItemValue>({\n defaultOpenItems,\n multiple,\n}: Pick<AccordionProps<Value>, 'defaultOpenItems' | 'multiple'>): Value[] {\n if (defaultOpenItems !== undefined) {\n if (Array.isArray(defaultOpenItems)) {\n return multiple ? defaultOpenItems : [defaultOpenItems[0]];\n }\n return [defaultOpenItems];\n }\n return [];\n}\n\n/**\n * Updates the list of open indexes based on an index that changes\n * @param value - the index that will change\n * @param previousOpenItems - list of current open indexes\n * @param multiple - if Accordion support multiple Panels opened at the same time\n * @param collapsible - if Accordion support multiple Panels closed at the same time\n */\nfunction updateOpenItems<Value = AccordionItemValue>(\n value: Value,\n previousOpenItems: Value[],\n multiple: boolean,\n collapsible: boolean,\n) {\n if (multiple) {\n if (previousOpenItems.includes(value)) {\n if (previousOpenItems.length > 1 || collapsible) {\n return previousOpenItems.filter(i => i !== value);\n }\n } else {\n return [...previousOpenItems, value].sort();\n }\n } else {\n return previousOpenItems[0] === value && collapsible ? [] : [value];\n }\n return previousOpenItems;\n}\n\n/**\n * Normalizes Accordion index into an array of indexes\n */\nfunction normalizeValues<Value = AccordionItemValue>(index?: Value | Value[]): Value[] | undefined {\n if (index === undefined) {\n return undefined;\n }\n return Array.isArray(index) ? index : [index];\n}\n"],"names":["React","getNativeElementProps","useControllableState","useEventCallback","slot","useArrowNavigationGroup","useAccordion_unstable","props","ref","openItems","controlledOpenItems","defaultOpenItems","multiple","collapsible","onToggle","navigation","setOpenItems","state","useMemo","normalizeValues","defaultState","initializeUncontrolledOpenItems","initialState","arrowNavigationProps","circular","tabbable","requestToggle","data","nextOpenItems","updateOpenItems","value","event","components","root","always","undefined","elementType","Array","isArray","previousOpenItems","includes","length","filter","i","sort","index"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAGhH,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE;;;;CAIC,GACD,OAAO,MAAMC,wBAAwB,CACnCC,OACAC;IAEA,MAAM,EACJC,WAAWC,mBAAmB,EAC9BC,gBAAgB,EAChBC,WAAW,KAAK,EAChBC,cAAc,KAAK,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGR;IACJ,MAAM,CAACE,WAAWO,aAAa,GAAGd,qBAAqB;QACrDe,OAAOjB,MAAMkB,OAAO,CAAC,IAAMC,gBAAgBT,sBAAsB;YAACA;SAAoB;QACtFU,cAAc,IAAMC,gCAAgC;gBAAEV;gBAAkBC;YAAS;QACjFU,cAAc,EAAE;IAClB;IAEA,MAAMC,uBAAuBlB,wBAAwB;QACnDmB,UAAUT,eAAe;QACzBU,UAAU;IACZ;IAEA,MAAMC,gBAAgBvB,iBAAiB,CAACwB;QACtC,MAAMC,gBAAgBC,gBAAgBF,KAAKG,KAAK,EAAErB,WAAWG,UAAUC;QACvEC,qBAAAA,+BAAAA,SAAWa,KAAKI,KAAK,EAAE;YAAED,OAAOH,KAAKG,KAAK;YAAErB,WAAWmB;QAAc;QACrEZ,aAAaY;IACf;IAEA,OAAO;QACLf;QACAD;QACAG;QACAN;QACAiB;QACAM,YAAY;YACVC,MAAM;QACR;QACAA,MAAM7B,KAAK8B,MAAM,CACfjC,sBAAsB,OAAO;YAC3B,GAAGM,KAAK;YACR,GAAIQ,aAAaQ,uBAAuBY,SAAS;YACjD3B;QACF,IACA;YAAE4B,aAAa;QAAM;IAEzB;AACF,EAAE;AAEF;;CAEC,GACD,SAASf,gCAA4D,EACnEV,gBAAgB,EAChBC,QAAQ,EACqD;IAC7D,IAAID,qBAAqBwB,WAAW;QAClC,IAAIE,MAAMC,OAAO,CAAC3B,mBAAmB;YACnC,OAAOC,WAAWD,mBAAmB;gBAACA,gBAAgB,CAAC,EAAE;aAAC;QAC5D;QACA,OAAO;YAACA;SAAiB;IAC3B;IACA,OAAO,EAAE;AACX;AAEA;;;;;;CAMC,GACD,SAASkB,gBACPC,KAAY,EACZS,iBAA0B,EAC1B3B,QAAiB,EACjBC,WAAoB;IAEpB,IAAID,UAAU;QACZ,IAAI2B,kBAAkBC,QAAQ,CAACV,QAAQ;YACrC,IAAIS,kBAAkBE,MAAM,GAAG,KAAK5B,aAAa;gBAC/C,OAAO0B,kBAAkBG,MAAM,CAACC,CAAAA,IAAKA,MAAMb;YAC7C;QACF,OAAO;YACL,OAAO;mBAAIS;gBAAmBT;aAAM,CAACc,IAAI;QAC3C;IACF,OAAO;QACL,OAAOL,iBAAiB,CAAC,EAAE,KAAKT,SAASjB,cAAc,EAAE,GAAG;YAACiB;SAAM;IACrE;IACA,OAAOS;AACT;AAEA;;CAEC,GACD,SAASpB,gBAA4C0B,KAAuB;IAC1E,IAAIA,UAAUV,WAAW;QACvB,OAAOA;IACT;IACA,OAAOE,MAAMC,OAAO,CAACO,SAASA,QAAQ;QAACA;KAAM;AAC/C"}
1
+ {"version":3,"sources":["useAccordion.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';\nimport type { AccordionProps, AccordionState } from './Accordion.types';\nimport type { AccordionItemValue } from '../AccordionItem/AccordionItem.types';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { AccordionRequestToggleData } from '../../contexts/accordion';\n\n/**\n * Returns the props and state required to render the component\n * @param props - Accordion properties\n * @param ref - reference to root HTMLElement of Accordion\n */\nexport const useAccordion_unstable = <Value = AccordionItemValue>(\n props: AccordionProps<Value>,\n ref: React.Ref<HTMLElement>,\n): AccordionState<Value> => {\n const {\n openItems: controlledOpenItems,\n defaultOpenItems,\n multiple = false,\n collapsible = false,\n onToggle,\n navigation,\n } = props;\n const [openItems, setOpenItems] = useControllableState({\n state: React.useMemo(() => normalizeValues(controlledOpenItems), [controlledOpenItems]),\n defaultState: () => initializeUncontrolledOpenItems({ defaultOpenItems, multiple }),\n initialState: [],\n });\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: navigation === 'circular',\n tabbable: true,\n });\n\n const requestToggle = useEventCallback((data: AccordionRequestToggleData<Value>) => {\n const nextOpenItems = updateOpenItems(data.value, openItems, multiple, collapsible);\n onToggle?.(data.event, { value: data.value, openItems: nextOpenItems });\n setOpenItems(nextOpenItems);\n });\n\n return {\n collapsible,\n multiple,\n navigation,\n openItems,\n requestToggle,\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ...props,\n ...(navigation ? arrowNavigationProps : undefined),\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n }),\n { elementType: 'div' },\n ),\n };\n};\n\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */\nfunction initializeUncontrolledOpenItems<Value = AccordionItemValue>({\n defaultOpenItems,\n multiple,\n}: Pick<AccordionProps<Value>, 'defaultOpenItems' | 'multiple'>): Value[] {\n if (defaultOpenItems !== undefined) {\n if (Array.isArray(defaultOpenItems)) {\n return multiple ? defaultOpenItems : [defaultOpenItems[0]];\n }\n return [defaultOpenItems];\n }\n return [];\n}\n\n/**\n * Updates the list of open indexes based on an index that changes\n * @param value - the index that will change\n * @param previousOpenItems - list of current open indexes\n * @param multiple - if Accordion support multiple Panels opened at the same time\n * @param collapsible - if Accordion support multiple Panels closed at the same time\n */\nfunction updateOpenItems<Value = AccordionItemValue>(\n value: Value,\n previousOpenItems: Value[],\n multiple: boolean,\n collapsible: boolean,\n) {\n if (multiple) {\n if (previousOpenItems.includes(value)) {\n if (previousOpenItems.length > 1 || collapsible) {\n return previousOpenItems.filter(i => i !== value);\n }\n } else {\n return [...previousOpenItems, value].sort();\n }\n } else {\n return previousOpenItems[0] === value && collapsible ? [] : [value];\n }\n return previousOpenItems;\n}\n\n/**\n * Normalizes Accordion index into an array of indexes\n */\nfunction normalizeValues<Value = AccordionItemValue>(index?: Value | Value[]): Value[] | undefined {\n if (index === undefined) {\n return undefined;\n }\n return Array.isArray(index) ? index : [index];\n}\n"],"names":["React","getIntrinsicElementProps","useControllableState","useEventCallback","slot","useArrowNavigationGroup","useAccordion_unstable","props","ref","openItems","controlledOpenItems","defaultOpenItems","multiple","collapsible","onToggle","navigation","setOpenItems","state","useMemo","normalizeValues","defaultState","initializeUncontrolledOpenItems","initialState","arrowNavigationProps","circular","tabbable","requestToggle","data","nextOpenItems","updateOpenItems","value","event","components","root","always","undefined","elementType","Array","isArray","previousOpenItems","includes","length","filter","i","sort","index"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAGnH,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE;;;;CAIC,GACD,OAAO,MAAMC,wBAAwB,CACnCC,OACAC;IAEA,MAAM,EACJC,WAAWC,mBAAmB,EAC9BC,gBAAgB,EAChBC,WAAW,KAAK,EAChBC,cAAc,KAAK,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGR;IACJ,MAAM,CAACE,WAAWO,aAAa,GAAGd,qBAAqB;QACrDe,OAAOjB,MAAMkB,OAAO,CAAC,IAAMC,gBAAgBT,sBAAsB;YAACA;SAAoB;QACtFU,cAAc,IAAMC,gCAAgC;gBAAEV;gBAAkBC;YAAS;QACjFU,cAAc,EAAE;IAClB;IAEA,MAAMC,uBAAuBlB,wBAAwB;QACnDmB,UAAUT,eAAe;QACzBU,UAAU;IACZ;IAEA,MAAMC,gBAAgBvB,iBAAiB,CAACwB;QACtC,MAAMC,gBAAgBC,gBAAgBF,KAAKG,KAAK,EAAErB,WAAWG,UAAUC;QACvEC,qBAAAA,+BAAAA,SAAWa,KAAKI,KAAK,EAAE;YAAED,OAAOH,KAAKG,KAAK;YAAErB,WAAWmB;QAAc;QACrEZ,aAAaY;IACf;IAEA,OAAO;QACLf;QACAD;QACAG;QACAN;QACAiB;QACAM,YAAY;YACVC,MAAM;QACR;QACAA,MAAM7B,KAAK8B,MAAM,CACfjC,yBAAyB,OAAO;YAC9B,GAAGM,KAAK;YACR,GAAIQ,aAAaQ,uBAAuBY,SAAS;YACjD,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5F3B,KAAKA;QACP,IACA;YAAE4B,aAAa;QAAM;IAEzB;AACF,EAAE;AAEF;;CAEC,GACD,SAASf,gCAA4D,EACnEV,gBAAgB,EAChBC,QAAQ,EACqD;IAC7D,IAAID,qBAAqBwB,WAAW;QAClC,IAAIE,MAAMC,OAAO,CAAC3B,mBAAmB;YACnC,OAAOC,WAAWD,mBAAmB;gBAACA,gBAAgB,CAAC,EAAE;aAAC;QAC5D;QACA,OAAO;YAACA;SAAiB;IAC3B;IACA,OAAO,EAAE;AACX;AAEA;;;;;;CAMC,GACD,SAASkB,gBACPC,KAAY,EACZS,iBAA0B,EAC1B3B,QAAiB,EACjBC,WAAoB;IAEpB,IAAID,UAAU;QACZ,IAAI2B,kBAAkBC,QAAQ,CAACV,QAAQ;YACrC,IAAIS,kBAAkBE,MAAM,GAAG,KAAK5B,aAAa;gBAC/C,OAAO0B,kBAAkBG,MAAM,CAACC,CAAAA,IAAKA,MAAMb;YAC7C;QACF,OAAO;YACL,OAAO;mBAAIS;gBAAmBT;aAAM,CAACc,IAAI;QAC3C;IACF,OAAO;QACL,OAAOL,iBAAiB,CAAC,EAAE,KAAKT,SAASjB,cAAc,EAAE,GAAG;YAACiB;SAAM;IACrE;IACA,OAAOS;AACT;AAEA;;CAEC,GACD,SAASpB,gBAA4C0B,KAAuB;IAC1E,IAAIA,UAAUV,WAAW;QACvB,OAAOA;IACT;IACA,OAAOE,MAAMC,OAAO,CAACO,SAASA,QAAQ;QAACA;KAAM;AAC/C"}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { getNativeElementProps, isResolvedShorthand, useEventCallback, slot } from '@fluentui/react-utilities';
2
+ import { getIntrinsicElementProps, isResolvedShorthand, useEventCallback, slot } from '@fluentui/react-utilities';
3
3
  import { useARIAButtonShorthand } from '@fluentui/react-aria';
4
4
  import { useAccordionContext_unstable } from '../../contexts/accordion';
5
5
  import { ChevronRightRegular } from '@fluentui/react-icons';
@@ -10,7 +10,7 @@ import { useAccordionItemContext_unstable } from '../../contexts/accordionItem';
10
10
  * @param props - AccordionHeader properties
11
11
  * @param ref - reference to root HTMLElement of AccordionHeader
12
12
  */ export const useAccordionHeader_unstable = (props, ref)=>{
13
- const { as, icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;
13
+ const { icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;
14
14
  const { value, disabled, open } = useAccordionItemContext_unstable();
15
15
  const requestToggle = useAccordionContext_unstable((ctx)=>ctx.requestToggle);
16
16
  /**
@@ -39,8 +39,11 @@ import { useAccordionItemContext_unstable } from '../../contexts/accordionItem';
39
39
  expandIcon: 'span',
40
40
  icon: 'div'
41
41
  },
42
- root: slot.always(getNativeElementProps(as || 'div', {
43
- ref,
42
+ root: slot.always(getIntrinsicElementProps('div', {
43
+ // FIXME:
44
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
45
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
46
+ ref: ref,
44
47
  ...props
45
48
  }), {
46
49
  elementType: 'div'
@@ -1 +1 @@
1
- {"version":3,"sources":["useAccordionHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, isResolvedShorthand, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';\nimport type { AccordionHeaderProps, AccordionHeaderState } from './AccordionHeader.types';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\nimport { ChevronRightRegular } from '@fluentui/react-icons';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAccordionItemContext_unstable } from '../../contexts/accordionItem';\n\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionHeader properties\n * @param ref - reference to root HTMLElement of AccordionHeader\n */\nexport const useAccordionHeader_unstable = (\n props: AccordionHeaderProps,\n ref: React.Ref<HTMLElement>,\n): AccordionHeaderState => {\n const { as, icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;\n const { value, disabled, open } = useAccordionItemContext_unstable();\n const requestToggle = useAccordionContext_unstable(ctx => ctx.requestToggle);\n\n /**\n * force disabled state on button if accordion isn't collapsible\n * and this is the only item opened\n */\n const disabledFocusable = useAccordionContext_unstable(ctx => !ctx.collapsible && ctx.openItems.length === 1 && open);\n\n const { dir } = useFluent();\n\n // Calculate how to rotate the expand icon [>] (ChevronRightRegular)\n let expandIconRotation: 0 | 90 | -90 | 180;\n if (expandIconPosition === 'end') {\n // If expand icon is at the end, the chevron points up [^] when open, and down [v] when closed\n expandIconRotation = open ? -90 : 90;\n } else {\n // Otherwise, the chevron points down [v] when open, and right [>] (or left [<] in RTL) when closed\n expandIconRotation = open ? 90 : dir !== 'rtl' ? 0 : 180;\n }\n\n return {\n disabled,\n open,\n size,\n inline,\n expandIconPosition,\n components: {\n root: 'div',\n button: 'button',\n expandIcon: 'span',\n icon: 'div',\n },\n root: slot.always(\n getNativeElementProps(as || 'div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n icon: slot.optional(icon, { elementType: 'div' }),\n expandIcon: slot.optional(expandIcon, {\n renderByDefault: true,\n defaultProps: {\n children: <ChevronRightRegular style={{ transform: `rotate(${expandIconRotation}deg)` }} />,\n 'aria-hidden': true,\n },\n elementType: 'span',\n }),\n button: slot.always<ARIAButtonSlotProps<'a'>>(\n {\n ...useARIAButtonShorthand(button, {\n required: true,\n defaultProps: {\n disabled,\n disabledFocusable,\n 'aria-expanded': open,\n type: 'button',\n },\n }),\n onClick: useEventCallback(event => {\n if (isResolvedShorthand(button)) {\n button.onClick?.(event);\n }\n if (!event.defaultPrevented) {\n requestToggle({ value, event });\n }\n }),\n },\n { elementType: 'button' },\n ),\n };\n};\n"],"names":["React","getNativeElementProps","isResolvedShorthand","useEventCallback","slot","useARIAButtonShorthand","useAccordionContext_unstable","ChevronRightRegular","useFluent_unstable","useFluent","useAccordionItemContext_unstable","useAccordionHeader_unstable","props","ref","as","icon","button","expandIcon","inline","size","expandIconPosition","value","disabled","open","requestToggle","ctx","disabledFocusable","collapsible","openItems","length","dir","expandIconRotation","components","root","always","elementType","optional","renderByDefault","defaultProps","children","style","transform","required","type","onClick","event","defaultPrevented"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,mBAAmB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAC/G,SAA8BC,sBAAsB,QAAQ,uBAAuB;AAEnF,SAASC,4BAA4B,QAAQ,2BAA2B;AACxE,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,gCAAgC,QAAQ,+BAA+B;AAEhF;;;;CAIC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,UAAU,EAAEC,SAAS,KAAK,EAAEC,OAAO,QAAQ,EAAEC,qBAAqB,OAAO,EAAE,GAAGR;IACxG,MAAM,EAAES,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGb;IAClC,MAAMc,gBAAgBlB,6BAA6BmB,CAAAA,MAAOA,IAAID,aAAa;IAE3E;;;GAGC,GACD,MAAME,oBAAoBpB,6BAA6BmB,CAAAA,MAAO,CAACA,IAAIE,WAAW,IAAIF,IAAIG,SAAS,CAACC,MAAM,KAAK,KAAKN;IAEhH,MAAM,EAAEO,GAAG,EAAE,GAAGrB;IAEhB,oEAAoE;IACpE,IAAIsB;IACJ,IAAIX,uBAAuB,OAAO;QAChC,8FAA8F;QAC9FW,qBAAqBR,OAAO,CAAC,KAAK;IACpC,OAAO;QACL,mGAAmG;QACnGQ,qBAAqBR,OAAO,KAAKO,QAAQ,QAAQ,IAAI;IACvD;IAEA,OAAO;QACLR;QACAC;QACAJ;QACAD;QACAE;QACAY,YAAY;YACVC,MAAM;YACNjB,QAAQ;YACRC,YAAY;YACZF,MAAM;QACR;QACAkB,MAAM7B,KAAK8B,MAAM,CACfjC,sBAAsBa,MAAM,OAAO;YACjCD;YACA,GAAGD,KAAK;QACV,IACA;YAAEuB,aAAa;QAAM;QAEvBpB,MAAMX,KAAKgC,QAAQ,CAACrB,MAAM;YAAEoB,aAAa;QAAM;QAC/ClB,YAAYb,KAAKgC,QAAQ,CAACnB,YAAY;YACpCoB,iBAAiB;YACjBC,cAAc;gBACZC,wBAAU,oBAAChC;oBAAoBiC,OAAO;wBAAEC,WAAW,CAAC,OAAO,EAAEV,mBAAmB,IAAI,CAAC;oBAAC;;gBACtF,eAAe;YACjB;YACAI,aAAa;QACf;QACAnB,QAAQZ,KAAK8B,MAAM,CACjB;YACE,GAAG7B,uBAAuBW,QAAQ;gBAChC0B,UAAU;gBACVJ,cAAc;oBACZhB;oBACAI;oBACA,iBAAiBH;oBACjBoB,MAAM;gBACR;YACF,EAAE;YACFC,SAASzC,iBAAiB0C,CAAAA;gBACxB,IAAI3C,oBAAoBc,SAAS;wBAC/BA;qBAAAA,kBAAAA,OAAO4B,OAAO,cAAd5B,sCAAAA,qBAAAA,QAAiB6B;gBACnB;gBACA,IAAI,CAACA,MAAMC,gBAAgB,EAAE;oBAC3BtB,cAAc;wBAAEH;wBAAOwB;oBAAM;gBAC/B;YACF;QACF,GACA;YAAEV,aAAa;QAAS;IAE5B;AACF,EAAE"}
1
+ {"version":3,"sources":["useAccordionHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, isResolvedShorthand, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';\nimport type { AccordionHeaderProps, AccordionHeaderState } from './AccordionHeader.types';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\nimport { ChevronRightRegular } from '@fluentui/react-icons';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAccordionItemContext_unstable } from '../../contexts/accordionItem';\n\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionHeader properties\n * @param ref - reference to root HTMLElement of AccordionHeader\n */\nexport const useAccordionHeader_unstable = (\n props: AccordionHeaderProps,\n ref: React.Ref<HTMLElement>,\n): AccordionHeaderState => {\n const { icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;\n const { value, disabled, open } = useAccordionItemContext_unstable();\n const requestToggle = useAccordionContext_unstable(ctx => ctx.requestToggle);\n\n /**\n * force disabled state on button if accordion isn't collapsible\n * and this is the only item opened\n */\n const disabledFocusable = useAccordionContext_unstable(ctx => !ctx.collapsible && ctx.openItems.length === 1 && open);\n\n const { dir } = useFluent();\n\n // Calculate how to rotate the expand icon [>] (ChevronRightRegular)\n let expandIconRotation: 0 | 90 | -90 | 180;\n if (expandIconPosition === 'end') {\n // If expand icon is at the end, the chevron points up [^] when open, and down [v] when closed\n expandIconRotation = open ? -90 : 90;\n } else {\n // Otherwise, the chevron points down [v] when open, and right [>] (or left [<] in RTL) when closed\n expandIconRotation = open ? 90 : dir !== 'rtl' ? 0 : 180;\n }\n\n return {\n disabled,\n open,\n size,\n inline,\n expandIconPosition,\n components: {\n root: 'div',\n button: 'button',\n expandIcon: 'span',\n icon: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n ...props,\n }),\n { elementType: 'div' },\n ),\n icon: slot.optional(icon, { elementType: 'div' }),\n expandIcon: slot.optional(expandIcon, {\n renderByDefault: true,\n defaultProps: {\n children: <ChevronRightRegular style={{ transform: `rotate(${expandIconRotation}deg)` }} />,\n 'aria-hidden': true,\n },\n elementType: 'span',\n }),\n button: slot.always<ARIAButtonSlotProps<'a'>>(\n {\n ...useARIAButtonShorthand(button, {\n required: true,\n defaultProps: {\n disabled,\n disabledFocusable,\n 'aria-expanded': open,\n type: 'button',\n },\n }),\n onClick: useEventCallback(event => {\n if (isResolvedShorthand(button)) {\n button.onClick?.(event);\n }\n if (!event.defaultPrevented) {\n requestToggle({ value, event });\n }\n }),\n },\n { elementType: 'button' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","isResolvedShorthand","useEventCallback","slot","useARIAButtonShorthand","useAccordionContext_unstable","ChevronRightRegular","useFluent_unstable","useFluent","useAccordionItemContext_unstable","useAccordionHeader_unstable","props","ref","icon","button","expandIcon","inline","size","expandIconPosition","value","disabled","open","requestToggle","ctx","disabledFocusable","collapsible","openItems","length","dir","expandIconRotation","components","root","always","elementType","optional","renderByDefault","defaultProps","children","style","transform","required","type","onClick","event","defaultPrevented"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,mBAAmB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAClH,SAA8BC,sBAAsB,QAAQ,uBAAuB;AAEnF,SAASC,4BAA4B,QAAQ,2BAA2B;AACxE,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,gCAAgC,QAAQ,+BAA+B;AAEhF;;;;CAIC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,UAAU,EAAEC,SAAS,KAAK,EAAEC,OAAO,QAAQ,EAAEC,qBAAqB,OAAO,EAAE,GAAGP;IACpG,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGZ;IAClC,MAAMa,gBAAgBjB,6BAA6BkB,CAAAA,MAAOA,IAAID,aAAa;IAE3E;;;GAGC,GACD,MAAME,oBAAoBnB,6BAA6BkB,CAAAA,MAAO,CAACA,IAAIE,WAAW,IAAIF,IAAIG,SAAS,CAACC,MAAM,KAAK,KAAKN;IAEhH,MAAM,EAAEO,GAAG,EAAE,GAAGpB;IAEhB,oEAAoE;IACpE,IAAIqB;IACJ,IAAIX,uBAAuB,OAAO;QAChC,8FAA8F;QAC9FW,qBAAqBR,OAAO,CAAC,KAAK;IACpC,OAAO;QACL,mGAAmG;QACnGQ,qBAAqBR,OAAO,KAAKO,QAAQ,QAAQ,IAAI;IACvD;IAEA,OAAO;QACLR;QACAC;QACAJ;QACAD;QACAE;QACAY,YAAY;YACVC,MAAM;YACNjB,QAAQ;YACRC,YAAY;YACZF,MAAM;QACR;QACAkB,MAAM5B,KAAK6B,MAAM,CACfhC,yBAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FY,KAAKA;YACL,GAAGD,KAAK;QACV,IACA;YAAEsB,aAAa;QAAM;QAEvBpB,MAAMV,KAAK+B,QAAQ,CAACrB,MAAM;YAAEoB,aAAa;QAAM;QAC/ClB,YAAYZ,KAAK+B,QAAQ,CAACnB,YAAY;YACpCoB,iBAAiB;YACjBC,cAAc;gBACZC,wBAAU,oBAAC/B;oBAAoBgC,OAAO;wBAAEC,WAAW,CAAC,OAAO,EAAEV,mBAAmB,IAAI,CAAC;oBAAC;;gBACtF,eAAe;YACjB;YACAI,aAAa;QACf;QACAnB,QAAQX,KAAK6B,MAAM,CACjB;YACE,GAAG5B,uBAAuBU,QAAQ;gBAChC0B,UAAU;gBACVJ,cAAc;oBACZhB;oBACAI;oBACA,iBAAiBH;oBACjBoB,MAAM;gBACR;YACF,EAAE;YACFC,SAASxC,iBAAiByC,CAAAA;gBACxB,IAAI1C,oBAAoBa,SAAS;wBAC/BA;qBAAAA,kBAAAA,OAAO4B,OAAO,cAAd5B,sCAAAA,qBAAAA,QAAiB6B;gBACnB;gBACA,IAAI,CAACA,MAAMC,gBAAgB,EAAE;oBAC3BtB,cAAc;wBAAEH;wBAAOwB;oBAAM;gBAC/B;YACF;QACF,GACA;YAAEV,aAAa;QAAS;IAE5B;AACF,EAAE"}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { getNativeElementProps, slot, useEventCallback } from '@fluentui/react-utilities';
2
+ import { getIntrinsicElementProps, slot, useEventCallback } from '@fluentui/react-utilities';
3
3
  import { useAccordionContext_unstable } from '../../contexts/accordion';
4
4
  /**
5
5
  * Returns the props and state required to render the component
@@ -21,8 +21,11 @@ import { useAccordionContext_unstable } from '../../contexts/accordion';
21
21
  components: {
22
22
  root: 'div'
23
23
  },
24
- root: slot.always(getNativeElementProps('div', {
25
- ref,
24
+ root: slot.always(getIntrinsicElementProps('div', {
25
+ // FIXME:
26
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
27
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
28
+ ref: ref,
26
29
  ...props
27
30
  }), {
28
31
  elementType: 'div'
@@ -1 +1 @@
1
- {"version":3,"sources":["useAccordionItem.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot, useEventCallback } from '@fluentui/react-utilities';\nimport type { AccordionItemProps, AccordionItemState } from './AccordionItem.types';\nimport type { AccordionToggleEvent } from '../Accordion/Accordion.types';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\n\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionItem properties\n * @param ref - reference to root HTMLElement of AccordionItem\n */\nexport const useAccordionItem_unstable = (\n props: AccordionItemProps,\n ref: React.Ref<HTMLElement>,\n): AccordionItemState => {\n const { value, disabled = false } = props;\n\n const requestToggle = useAccordionContext_unstable(ctx => ctx.requestToggle);\n const open = useAccordionContext_unstable(ctx => ctx.openItems.includes(value));\n const onAccordionHeaderClick = useEventCallback((event: AccordionToggleEvent) => requestToggle({ event, value }));\n\n return {\n open,\n value,\n disabled,\n onHeaderClick: onAccordionHeaderClick,\n components: {\n root: 'div',\n },\n root: slot.always(getNativeElementProps('div', { ref, ...props }), { elementType: 'div' }),\n };\n};\n"],"names":["React","getNativeElementProps","slot","useEventCallback","useAccordionContext_unstable","useAccordionItem_unstable","props","ref","value","disabled","requestToggle","ctx","open","openItems","includes","onAccordionHeaderClick","event","onHeaderClick","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAG1F,SAASC,4BAA4B,QAAQ,2BAA2B;AAExE;;;;CAIC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,KAAK,EAAEC,WAAW,KAAK,EAAE,GAAGH;IAEpC,MAAMI,gBAAgBN,6BAA6BO,CAAAA,MAAOA,IAAID,aAAa;IAC3E,MAAME,OAAOR,6BAA6BO,CAAAA,MAAOA,IAAIE,SAAS,CAACC,QAAQ,CAACN;IACxE,MAAMO,yBAAyBZ,iBAAiB,CAACa,QAAgCN,cAAc;YAAEM;YAAOR;QAAM;IAE9G,OAAO;QACLI;QACAJ;QACAC;QACAQ,eAAeF;QACfG,YAAY;YACVC,MAAM;QACR;QACAA,MAAMjB,KAAKkB,MAAM,CAACnB,sBAAsB,OAAO;YAAEM;YAAK,GAAGD,KAAK;QAAC,IAAI;YAAEe,aAAa;QAAM;IAC1F;AACF,EAAE"}
1
+ {"version":3,"sources":["useAccordionItem.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useEventCallback } from '@fluentui/react-utilities';\nimport type { AccordionItemProps, AccordionItemState } from './AccordionItem.types';\nimport type { AccordionToggleEvent } from '../Accordion/Accordion.types';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\n\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionItem properties\n * @param ref - reference to root HTMLElement of AccordionItem\n */\nexport const useAccordionItem_unstable = (\n props: AccordionItemProps,\n ref: React.Ref<HTMLElement>,\n): AccordionItemState => {\n const { value, disabled = false } = props;\n\n const requestToggle = useAccordionContext_unstable(ctx => ctx.requestToggle);\n const open = useAccordionContext_unstable(ctx => ctx.openItems.includes(value));\n const onAccordionHeaderClick = useEventCallback((event: AccordionToggleEvent) => requestToggle({ event, value }));\n\n return {\n open,\n value,\n disabled,\n onHeaderClick: onAccordionHeaderClick,\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useEventCallback","useAccordionContext_unstable","useAccordionItem_unstable","props","ref","value","disabled","requestToggle","ctx","open","openItems","includes","onAccordionHeaderClick","event","onHeaderClick","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAG7F,SAASC,4BAA4B,QAAQ,2BAA2B;AAExE;;;;CAIC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,KAAK,EAAEC,WAAW,KAAK,EAAE,GAAGH;IAEpC,MAAMI,gBAAgBN,6BAA6BO,CAAAA,MAAOA,IAAID,aAAa;IAC3E,MAAME,OAAOR,6BAA6BO,CAAAA,MAAOA,IAAIE,SAAS,CAACC,QAAQ,CAACN;IACxE,MAAMO,yBAAyBZ,iBAAiB,CAACa,QAAgCN,cAAc;YAAEM;YAAOR;QAAM;IAE9G,OAAO;QACLI;QACAJ;QACAC;QACAQ,eAAeF;QACfG,YAAY;YACVC,MAAM;QACR;QACAA,MAAMjB,KAAKkB,MAAM,CACfnB,yBAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FM,KAAKA;YACL,GAAGD,KAAK;QACV,IACA;YAAEe,aAAa;QAAM;IAEzB;AACF,EAAE"}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { getNativeElementProps, slot } from '@fluentui/react-utilities';
2
+ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
3
3
  import { useTabsterAttributes } from '@fluentui/react-tabster';
4
4
  import { useAccordionContext_unstable } from '../../contexts/accordion';
5
5
  import { useAccordionItemContext_unstable } from '../../contexts/accordionItem';
@@ -20,8 +20,11 @@ import { useAccordionItemContext_unstable } from '../../contexts/accordionItem';
20
20
  components: {
21
21
  root: 'div'
22
22
  },
23
- root: slot.always(getNativeElementProps('div', {
24
- ref,
23
+ root: slot.always(getIntrinsicElementProps('div', {
24
+ // FIXME:
25
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
26
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
27
+ ref: ref,
25
28
  ...props,
26
29
  ...navigation && focusableProps
27
30
  }), {
@@ -1 +1 @@
1
- {"version":3,"sources":["useAccordionPanel.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from '@fluentui/react-tabster';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\nimport type { AccordionPanelProps, AccordionPanelState } from './AccordionPanel.types';\nimport { useAccordionItemContext_unstable } from '../../contexts/accordionItem';\n\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionPanel properties\n * @param ref - reference to root HTMLElement of AccordionPanel\n */\nexport const useAccordionPanel_unstable = (\n props: AccordionPanelProps,\n ref: React.Ref<HTMLElement>,\n): AccordionPanelState => {\n const { open } = useAccordionItemContext_unstable();\n const focusableProps = useTabsterAttributes({ focusable: { excludeFromMover: true } });\n const navigation = useAccordionContext_unstable(ctx => ctx.navigation);\n\n return {\n open,\n components: {\n root: 'div',\n },\n root: slot.always(\n getNativeElementProps('div', {\n ref,\n ...props,\n ...(navigation && focusableProps),\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","getNativeElementProps","slot","useTabsterAttributes","useAccordionContext_unstable","useAccordionItemContext_unstable","useAccordionPanel_unstable","props","ref","open","focusableProps","focusable","excludeFromMover","navigation","ctx","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AACxE,SAASC,oBAAoB,QAAQ,0BAA0B;AAC/D,SAASC,4BAA4B,QAAQ,2BAA2B;AAExE,SAASC,gCAAgC,QAAQ,+BAA+B;AAEhF;;;;CAIC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAE,GAAGJ;IACjB,MAAMK,iBAAiBP,qBAAqB;QAAEQ,WAAW;YAAEC,kBAAkB;QAAK;IAAE;IACpF,MAAMC,aAAaT,6BAA6BU,CAAAA,MAAOA,IAAID,UAAU;IAErE,OAAO;QACLJ;QACAM,YAAY;YACVC,MAAM;QACR;QACAA,MAAMd,KAAKe,MAAM,CACfhB,sBAAsB,OAAO;YAC3BO;YACA,GAAGD,KAAK;YACR,GAAIM,cAAcH,cAAc;QAClC,IACA;YAAEQ,aAAa;QAAM;IAEzB;AACF,EAAE"}
1
+ {"version":3,"sources":["useAccordionPanel.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from '@fluentui/react-tabster';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\nimport type { AccordionPanelProps, AccordionPanelState } from './AccordionPanel.types';\nimport { useAccordionItemContext_unstable } from '../../contexts/accordionItem';\n\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionPanel properties\n * @param ref - reference to root HTMLElement of AccordionPanel\n */\nexport const useAccordionPanel_unstable = (\n props: AccordionPanelProps,\n ref: React.Ref<HTMLElement>,\n): AccordionPanelState => {\n const { open } = useAccordionItemContext_unstable();\n const focusableProps = useTabsterAttributes({ focusable: { excludeFromMover: true } });\n const navigation = useAccordionContext_unstable(ctx => ctx.navigation);\n\n return {\n open,\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n ...props,\n ...(navigation && focusableProps),\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useTabsterAttributes","useAccordionContext_unstable","useAccordionItemContext_unstable","useAccordionPanel_unstable","props","ref","open","focusableProps","focusable","excludeFromMover","navigation","ctx","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,oBAAoB,QAAQ,0BAA0B;AAC/D,SAASC,4BAA4B,QAAQ,2BAA2B;AAExE,SAASC,gCAAgC,QAAQ,+BAA+B;AAEhF;;;;CAIC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAE,GAAGJ;IACjB,MAAMK,iBAAiBP,qBAAqB;QAAEQ,WAAW;YAAEC,kBAAkB;QAAK;IAAE;IACpF,MAAMC,aAAaT,6BAA6BU,CAAAA,MAAOA,IAAID,UAAU;IAErE,OAAO;QACLJ;QACAM,YAAY;YACVC,MAAM;QACR;QACAA,MAAMd,KAAKe,MAAM,CACfhB,yBAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FO,KAAKA;YACL,GAAGD,KAAK;YACR,GAAIM,cAAcH,cAAc;QAClC,IACA;YAAEQ,aAAa;QAAM;IAEzB;AACF,EAAE"}
@@ -45,10 +45,13 @@ const useAccordion_unstable = (props, ref)=>{
45
45
  components: {
46
46
  root: 'div'
47
47
  },
48
- root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', {
48
+ root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
49
49
  ...props,
50
50
  ...navigation ? arrowNavigationProps : undefined,
51
- ref
51
+ // FIXME:
52
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
53
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
54
+ ref: ref
52
55
  }), {
53
56
  elementType: 'div'
54
57
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["useAccordion.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\n/**\n * Returns the props and state required to render the component\n * @param props - Accordion properties\n * @param ref - reference to root HTMLElement of Accordion\n */ export const useAccordion_unstable = (props, ref)=>{\n const { openItems: controlledOpenItems, defaultOpenItems, multiple = false, collapsible = false, onToggle, navigation } = props;\n const [openItems, setOpenItems] = useControllableState({\n state: React.useMemo(()=>normalizeValues(controlledOpenItems), [\n controlledOpenItems\n ]),\n defaultState: ()=>initializeUncontrolledOpenItems({\n defaultOpenItems,\n multiple\n }),\n initialState: []\n });\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: navigation === 'circular',\n tabbable: true\n });\n const requestToggle = useEventCallback((data)=>{\n const nextOpenItems = updateOpenItems(data.value, openItems, multiple, collapsible);\n onToggle === null || onToggle === void 0 ? void 0 : onToggle(data.event, {\n value: data.value,\n openItems: nextOpenItems\n });\n setOpenItems(nextOpenItems);\n });\n return {\n collapsible,\n multiple,\n navigation,\n openItems,\n requestToggle,\n components: {\n root: 'div'\n },\n root: slot.always(getNativeElementProps('div', {\n ...props,\n ...navigation ? arrowNavigationProps : undefined,\n ref\n }), {\n elementType: 'div'\n })\n };\n};\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */ function initializeUncontrolledOpenItems({ defaultOpenItems, multiple }) {\n if (defaultOpenItems !== undefined) {\n if (Array.isArray(defaultOpenItems)) {\n return multiple ? defaultOpenItems : [\n defaultOpenItems[0]\n ];\n }\n return [\n defaultOpenItems\n ];\n }\n return [];\n}\n/**\n * Updates the list of open indexes based on an index that changes\n * @param value - the index that will change\n * @param previousOpenItems - list of current open indexes\n * @param multiple - if Accordion support multiple Panels opened at the same time\n * @param collapsible - if Accordion support multiple Panels closed at the same time\n */ function updateOpenItems(value, previousOpenItems, multiple, collapsible) {\n if (multiple) {\n if (previousOpenItems.includes(value)) {\n if (previousOpenItems.length > 1 || collapsible) {\n return previousOpenItems.filter((i)=>i !== value);\n }\n } else {\n return [\n ...previousOpenItems,\n value\n ].sort();\n }\n } else {\n return previousOpenItems[0] === value && collapsible ? [] : [\n value\n ];\n }\n return previousOpenItems;\n}\n/**\n * Normalizes Accordion index into an array of indexes\n */ function normalizeValues(index) {\n if (index === undefined) {\n return undefined;\n }\n return Array.isArray(index) ? index : [\n index\n ];\n}\n"],"names":["useAccordion_unstable","props","ref","openItems","controlledOpenItems","defaultOpenItems","multiple","collapsible","onToggle","navigation","setOpenItems","useControllableState","state","React","useMemo","normalizeValues","defaultState","initializeUncontrolledOpenItems","initialState","arrowNavigationProps","useArrowNavigationGroup","circular","tabbable","requestToggle","useEventCallback","data","nextOpenItems","updateOpenItems","value","event","components","root","slot","always","getNativeElementProps","undefined","elementType","Array","isArray","previousOpenItems","includes","length","filter","i","sort","index"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;gCAC6D;8BAC5C;AAK7B,MAAMA,wBAAwB,CAACC,OAAOC;IAC7C,MAAM,EAAEC,WAAWC,mBAAmB,EAAEC,gBAAgB,EAAEC,WAAW,KAAK,EAAEC,cAAc,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGR;IAC1H,MAAM,CAACE,WAAWO,aAAa,GAAGC,IAAAA,oCAAoB,EAAC;QACnDC,OAAOC,OAAMC,OAAO,CAAC,IAAIC,gBAAgBX,sBAAsB;YAC3DA;SACH;QACDY,cAAc,IAAIC,gCAAgC;gBAC1CZ;gBACAC;YACJ;QACJY,cAAc,EAAE;IACpB;IACA,MAAMC,uBAAuBC,IAAAA,qCAAuB,EAAC;QACjDC,UAAUZ,eAAe;QACzBa,UAAU;IACd;IACA,MAAMC,gBAAgBC,IAAAA,gCAAgB,EAAC,CAACC;QACpC,MAAMC,gBAAgBC,gBAAgBF,KAAKG,KAAK,EAAEzB,WAAWG,UAAUC;QACvEC,aAAa,QAAQA,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASiB,KAAKI,KAAK,EAAE;YACrED,OAAOH,KAAKG,KAAK;YACjBzB,WAAWuB;QACf;QACAhB,aAAagB;IACjB;IACA,OAAO;QACHnB;QACAD;QACAG;QACAN;QACAoB;QACAO,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3C,GAAGjC,KAAK;YACR,GAAGQ,aAAaU,uBAAuBgB,SAAS;YAChDjC;QACJ,IAAI;YACAkC,aAAa;QACjB;IACJ;AACJ;AACA;;CAEC,GAAG,SAASnB,gCAAgC,EAAEZ,gBAAgB,EAAEC,QAAQ,EAAE;IACvE,IAAID,qBAAqB8B,WAAW;QAChC,IAAIE,MAAMC,OAAO,CAACjC,mBAAmB;YACjC,OAAOC,WAAWD,mBAAmB;gBACjCA,gBAAgB,CAAC,EAAE;aACtB;QACL;QACA,OAAO;YACHA;SACH;IACL;IACA,OAAO,EAAE;AACb;AACA;;;;;;CAMC,GAAG,SAASsB,gBAAgBC,KAAK,EAAEW,iBAAiB,EAAEjC,QAAQ,EAAEC,WAAW;IACxE,IAAID,UAAU;QACV,IAAIiC,kBAAkBC,QAAQ,CAACZ,QAAQ;YACnC,IAAIW,kBAAkBE,MAAM,GAAG,KAAKlC,aAAa;gBAC7C,OAAOgC,kBAAkBG,MAAM,CAAC,CAACC,IAAIA,MAAMf;YAC/C;QACJ,OAAO;YACH,OAAO;mBACAW;gBACHX;aACH,CAACgB,IAAI;QACV;IACJ,OAAO;QACH,OAAOL,iBAAiB,CAAC,EAAE,KAAKX,SAASrB,cAAc,EAAE,GAAG;YACxDqB;SACH;IACL;IACA,OAAOW;AACX;AACA;;CAEC,GAAG,SAASxB,gBAAgB8B,KAAK;IAC9B,IAAIA,UAAUV,WAAW;QACrB,OAAOA;IACX;IACA,OAAOE,MAAMC,OAAO,CAACO,SAASA,QAAQ;QAClCA;KACH;AACL"}
1
+ {"version":3,"sources":["useAccordion.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\n/**\n * Returns the props and state required to render the component\n * @param props - Accordion properties\n * @param ref - reference to root HTMLElement of Accordion\n */ export const useAccordion_unstable = (props, ref)=>{\n const { openItems: controlledOpenItems, defaultOpenItems, multiple = false, collapsible = false, onToggle, navigation } = props;\n const [openItems, setOpenItems] = useControllableState({\n state: React.useMemo(()=>normalizeValues(controlledOpenItems), [\n controlledOpenItems\n ]),\n defaultState: ()=>initializeUncontrolledOpenItems({\n defaultOpenItems,\n multiple\n }),\n initialState: []\n });\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: navigation === 'circular',\n tabbable: true\n });\n const requestToggle = useEventCallback((data)=>{\n const nextOpenItems = updateOpenItems(data.value, openItems, multiple, collapsible);\n onToggle === null || onToggle === void 0 ? void 0 : onToggle(data.event, {\n value: data.value,\n openItems: nextOpenItems\n });\n setOpenItems(nextOpenItems);\n });\n return {\n collapsible,\n multiple,\n navigation,\n openItems,\n requestToggle,\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n ...props,\n ...navigation ? arrowNavigationProps : undefined,\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref\n }), {\n elementType: 'div'\n })\n };\n};\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */ function initializeUncontrolledOpenItems({ defaultOpenItems, multiple }) {\n if (defaultOpenItems !== undefined) {\n if (Array.isArray(defaultOpenItems)) {\n return multiple ? defaultOpenItems : [\n defaultOpenItems[0]\n ];\n }\n return [\n defaultOpenItems\n ];\n }\n return [];\n}\n/**\n * Updates the list of open indexes based on an index that changes\n * @param value - the index that will change\n * @param previousOpenItems - list of current open indexes\n * @param multiple - if Accordion support multiple Panels opened at the same time\n * @param collapsible - if Accordion support multiple Panels closed at the same time\n */ function updateOpenItems(value, previousOpenItems, multiple, collapsible) {\n if (multiple) {\n if (previousOpenItems.includes(value)) {\n if (previousOpenItems.length > 1 || collapsible) {\n return previousOpenItems.filter((i)=>i !== value);\n }\n } else {\n return [\n ...previousOpenItems,\n value\n ].sort();\n }\n } else {\n return previousOpenItems[0] === value && collapsible ? [] : [\n value\n ];\n }\n return previousOpenItems;\n}\n/**\n * Normalizes Accordion index into an array of indexes\n */ function normalizeValues(index) {\n if (index === undefined) {\n return undefined;\n }\n return Array.isArray(index) ? index : [\n index\n ];\n}\n"],"names":["useAccordion_unstable","props","ref","openItems","controlledOpenItems","defaultOpenItems","multiple","collapsible","onToggle","navigation","setOpenItems","useControllableState","state","React","useMemo","normalizeValues","defaultState","initializeUncontrolledOpenItems","initialState","arrowNavigationProps","useArrowNavigationGroup","circular","tabbable","requestToggle","useEventCallback","data","nextOpenItems","updateOpenItems","value","event","components","root","slot","always","getIntrinsicElementProps","undefined","elementType","Array","isArray","previousOpenItems","includes","length","filter","i","sort","index"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;gCACgE;8BAC/C;AAK7B,MAAMA,wBAAwB,CAACC,OAAOC;IAC7C,MAAM,EAAEC,WAAWC,mBAAmB,EAAEC,gBAAgB,EAAEC,WAAW,KAAK,EAAEC,cAAc,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGR;IAC1H,MAAM,CAACE,WAAWO,aAAa,GAAGC,IAAAA,oCAAoB,EAAC;QACnDC,OAAOC,OAAMC,OAAO,CAAC,IAAIC,gBAAgBX,sBAAsB;YAC3DA;SACH;QACDY,cAAc,IAAIC,gCAAgC;gBAC1CZ;gBACAC;YACJ;QACJY,cAAc,EAAE;IACpB;IACA,MAAMC,uBAAuBC,IAAAA,qCAAuB,EAAC;QACjDC,UAAUZ,eAAe;QACzBa,UAAU;IACd;IACA,MAAMC,gBAAgBC,IAAAA,gCAAgB,EAAC,CAACC;QACpC,MAAMC,gBAAgBC,gBAAgBF,KAAKG,KAAK,EAAEzB,WAAWG,UAAUC;QACvEC,aAAa,QAAQA,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASiB,KAAKI,KAAK,EAAE;YACrED,OAAOH,KAAKG,KAAK;YACjBzB,WAAWuB;QACf;QACAhB,aAAagB;IACjB;IACA,OAAO;QACHnB;QACAD;QACAG;QACAN;QACAoB;QACAO,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,GAAGjC,KAAK;YACR,GAAGQ,aAAaU,uBAAuBgB,SAAS;YAChD,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FjC,KAAKA;QACT,IAAI;YACAkC,aAAa;QACjB;IACJ;AACJ;AACA;;CAEC,GAAG,SAASnB,gCAAgC,EAAEZ,gBAAgB,EAAEC,QAAQ,EAAE;IACvE,IAAID,qBAAqB8B,WAAW;QAChC,IAAIE,MAAMC,OAAO,CAACjC,mBAAmB;YACjC,OAAOC,WAAWD,mBAAmB;gBACjCA,gBAAgB,CAAC,EAAE;aACtB;QACL;QACA,OAAO;YACHA;SACH;IACL;IACA,OAAO,EAAE;AACb;AACA;;;;;;CAMC,GAAG,SAASsB,gBAAgBC,KAAK,EAAEW,iBAAiB,EAAEjC,QAAQ,EAAEC,WAAW;IACxE,IAAID,UAAU;QACV,IAAIiC,kBAAkBC,QAAQ,CAACZ,QAAQ;YACnC,IAAIW,kBAAkBE,MAAM,GAAG,KAAKlC,aAAa;gBAC7C,OAAOgC,kBAAkBG,MAAM,CAAC,CAACC,IAAIA,MAAMf;YAC/C;QACJ,OAAO;YACH,OAAO;mBACAW;gBACHX;aACH,CAACgB,IAAI;QACV;IACJ,OAAO;QACH,OAAOL,iBAAiB,CAAC,EAAE,KAAKX,SAASrB,cAAc,EAAE,GAAG;YACxDqB;SACH;IACL;IACA,OAAOW;AACX;AACA;;CAEC,GAAG,SAASxB,gBAAgB8B,KAAK;IAC9B,IAAIA,UAAUV,WAAW;QACrB,OAAOA;IACX;IACA,OAAOE,MAAMC,OAAO,CAACO,SAASA,QAAQ;QAClCA;KACH;AACL"}
@@ -17,7 +17,7 @@ const _reacticons = require("@fluentui/react-icons");
17
17
  const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
18
18
  const _accordionItem = require("../../contexts/accordionItem");
19
19
  const useAccordionHeader_unstable = (props, ref)=>{
20
- const { as, icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;
20
+ const { icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;
21
21
  const { value, disabled, open } = (0, _accordionItem.useAccordionItemContext_unstable)();
22
22
  const requestToggle = (0, _accordion.useAccordionContext_unstable)((ctx)=>ctx.requestToggle);
23
23
  /**
@@ -46,8 +46,11 @@ const useAccordionHeader_unstable = (props, ref)=>{
46
46
  expandIcon: 'span',
47
47
  icon: 'div'
48
48
  },
49
- root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)(as || 'div', {
50
- ref,
49
+ root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
50
+ // FIXME:
51
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
52
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
53
+ ref: ref,
51
54
  ...props
52
55
  }), {
53
56
  elementType: 'div'
@@ -1 +1 @@
1
- {"version":3,"sources":["useAccordionHeader.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, isResolvedShorthand, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\nimport { ChevronRightRegular } from '@fluentui/react-icons';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAccordionItemContext_unstable } from '../../contexts/accordionItem';\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionHeader properties\n * @param ref - reference to root HTMLElement of AccordionHeader\n */ export const useAccordionHeader_unstable = (props, ref)=>{\n const { as, icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;\n const { value, disabled, open } = useAccordionItemContext_unstable();\n const requestToggle = useAccordionContext_unstable((ctx)=>ctx.requestToggle);\n /**\n * force disabled state on button if accordion isn't collapsible\n * and this is the only item opened\n */ const disabledFocusable = useAccordionContext_unstable((ctx)=>!ctx.collapsible && ctx.openItems.length === 1 && open);\n const { dir } = useFluent();\n // Calculate how to rotate the expand icon [>] (ChevronRightRegular)\n let expandIconRotation;\n if (expandIconPosition === 'end') {\n // If expand icon is at the end, the chevron points up [^] when open, and down [v] when closed\n expandIconRotation = open ? -90 : 90;\n } else {\n // Otherwise, the chevron points down [v] when open, and right [>] (or left [<] in RTL) when closed\n expandIconRotation = open ? 90 : dir !== 'rtl' ? 0 : 180;\n }\n return {\n disabled,\n open,\n size,\n inline,\n expandIconPosition,\n components: {\n root: 'div',\n button: 'button',\n expandIcon: 'span',\n icon: 'div'\n },\n root: slot.always(getNativeElementProps(as || 'div', {\n ref,\n ...props\n }), {\n elementType: 'div'\n }),\n icon: slot.optional(icon, {\n elementType: 'div'\n }),\n expandIcon: slot.optional(expandIcon, {\n renderByDefault: true,\n defaultProps: {\n children: /*#__PURE__*/ React.createElement(ChevronRightRegular, {\n style: {\n transform: `rotate(${expandIconRotation}deg)`\n }\n }),\n 'aria-hidden': true\n },\n elementType: 'span'\n }),\n button: slot.always({\n ...useARIAButtonShorthand(button, {\n required: true,\n defaultProps: {\n disabled,\n disabledFocusable,\n 'aria-expanded': open,\n type: 'button'\n }\n }),\n onClick: useEventCallback((event)=>{\n if (isResolvedShorthand(button)) {\n var _button_onClick;\n (_button_onClick = button.onClick) === null || _button_onClick === void 0 ? void 0 : _button_onClick.call(button, event);\n }\n if (!event.defaultPrevented) {\n requestToggle({\n value,\n event\n });\n }\n })\n }, {\n elementType: 'button'\n })\n };\n};\n"],"names":["useAccordionHeader_unstable","props","ref","as","icon","button","expandIcon","inline","size","expandIconPosition","value","disabled","open","useAccordionItemContext_unstable","requestToggle","useAccordionContext_unstable","ctx","disabledFocusable","collapsible","openItems","length","dir","useFluent","expandIconRotation","components","root","slot","always","getNativeElementProps","elementType","optional","renderByDefault","defaultProps","children","React","createElement","ChevronRightRegular","style","transform","useARIAButtonShorthand","required","type","onClick","useEventCallback","event","isResolvedShorthand","_button_onClick","call","defaultPrevented"],"mappings":";;;;+BAWiBA;;;eAAAA;;;;iEAXM;gCAC4D;2BAC5C;2BACM;4BACT;qCACY;+BACC;AAKtC,MAAMA,8BAA8B,CAACC,OAAOC;IACnD,MAAM,EAAEC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,UAAU,EAAEC,SAAS,KAAK,EAAEC,OAAO,QAAQ,EAAEC,qBAAqB,OAAO,EAAE,GAAGR;IACxG,MAAM,EAAES,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGC,IAAAA,+CAAgC;IAClE,MAAMC,gBAAgBC,IAAAA,uCAA4B,EAAC,CAACC,MAAMA,IAAIF,aAAa;IAC3E;;;GAGD,GAAG,MAAMG,oBAAoBF,IAAAA,uCAA4B,EAAC,CAACC,MAAM,CAACA,IAAIE,WAAW,IAAIF,IAAIG,SAAS,CAACC,MAAM,KAAK,KAAKR;IAClH,MAAM,EAAES,GAAG,EAAE,GAAGC,IAAAA,uCAAS;IACzB,oEAAoE;IACpE,IAAIC;IACJ,IAAId,uBAAuB,OAAO;QAC9B,8FAA8F;QAC9Fc,qBAAqBX,OAAO,CAAC,KAAK;IACtC,OAAO;QACH,mGAAmG;QACnGW,qBAAqBX,OAAO,KAAKS,QAAQ,QAAQ,IAAI;IACzD;IACA,OAAO;QACHV;QACAC;QACAJ;QACAD;QACAE;QACAe,YAAY;YACRC,MAAM;YACNpB,QAAQ;YACRC,YAAY;YACZF,MAAM;QACV;QACAqB,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAACzB,MAAM,OAAO;YACjDD;YACA,GAAGD,KAAK;QACZ,IAAI;YACA4B,aAAa;QACjB;QACAzB,MAAMsB,oBAAI,CAACI,QAAQ,CAAC1B,MAAM;YACtByB,aAAa;QACjB;QACAvB,YAAYoB,oBAAI,CAACI,QAAQ,CAACxB,YAAY;YAClCyB,iBAAiB;YACjBC,cAAc;gBACVC,UAAU,WAAW,GAAGC,OAAMC,aAAa,CAACC,+BAAmB,EAAE;oBAC7DC,OAAO;wBACHC,WAAW,CAAC,OAAO,EAAEf,mBAAmB,IAAI,CAAC;oBACjD;gBACJ;gBACA,eAAe;YACnB;YACAM,aAAa;QACjB;QACAxB,QAAQqB,oBAAI,CAACC,MAAM,CAAC;YAChB,GAAGY,IAAAA,iCAAsB,EAAClC,QAAQ;gBAC9BmC,UAAU;gBACVR,cAAc;oBACVrB;oBACAM;oBACA,iBAAiBL;oBACjB6B,MAAM;gBACV;YACJ,EAAE;YACFC,SAASC,IAAAA,gCAAgB,EAAC,CAACC;gBACvB,IAAIC,IAAAA,mCAAmB,EAACxC,SAAS;oBAC7B,IAAIyC;oBACHA,CAAAA,kBAAkBzC,OAAOqC,OAAO,AAAD,MAAO,QAAQI,oBAAoB,KAAK,IAAI,KAAK,IAAIA,gBAAgBC,IAAI,CAAC1C,QAAQuC;gBACtH;gBACA,IAAI,CAACA,MAAMI,gBAAgB,EAAE;oBACzBlC,cAAc;wBACVJ;wBACAkC;oBACJ;gBACJ;YACJ;QACJ,GAAG;YACCf,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useAccordionHeader.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, isResolvedShorthand, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\nimport { ChevronRightRegular } from '@fluentui/react-icons';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAccordionItemContext_unstable } from '../../contexts/accordionItem';\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionHeader properties\n * @param ref - reference to root HTMLElement of AccordionHeader\n */ export const useAccordionHeader_unstable = (props, ref)=>{\n const { icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;\n const { value, disabled, open } = useAccordionItemContext_unstable();\n const requestToggle = useAccordionContext_unstable((ctx)=>ctx.requestToggle);\n /**\n * force disabled state on button if accordion isn't collapsible\n * and this is the only item opened\n */ const disabledFocusable = useAccordionContext_unstable((ctx)=>!ctx.collapsible && ctx.openItems.length === 1 && open);\n const { dir } = useFluent();\n // Calculate how to rotate the expand icon [>] (ChevronRightRegular)\n let expandIconRotation;\n if (expandIconPosition === 'end') {\n // If expand icon is at the end, the chevron points up [^] when open, and down [v] when closed\n expandIconRotation = open ? -90 : 90;\n } else {\n // Otherwise, the chevron points down [v] when open, and right [>] (or left [<] in RTL) when closed\n expandIconRotation = open ? 90 : dir !== 'rtl' ? 0 : 180;\n }\n return {\n disabled,\n open,\n size,\n inline,\n expandIconPosition,\n components: {\n root: 'div',\n button: 'button',\n expandIcon: 'span',\n icon: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref,\n ...props\n }), {\n elementType: 'div'\n }),\n icon: slot.optional(icon, {\n elementType: 'div'\n }),\n expandIcon: slot.optional(expandIcon, {\n renderByDefault: true,\n defaultProps: {\n children: /*#__PURE__*/ React.createElement(ChevronRightRegular, {\n style: {\n transform: `rotate(${expandIconRotation}deg)`\n }\n }),\n 'aria-hidden': true\n },\n elementType: 'span'\n }),\n button: slot.always({\n ...useARIAButtonShorthand(button, {\n required: true,\n defaultProps: {\n disabled,\n disabledFocusable,\n 'aria-expanded': open,\n type: 'button'\n }\n }),\n onClick: useEventCallback((event)=>{\n if (isResolvedShorthand(button)) {\n var _button_onClick;\n (_button_onClick = button.onClick) === null || _button_onClick === void 0 ? void 0 : _button_onClick.call(button, event);\n }\n if (!event.defaultPrevented) {\n requestToggle({\n value,\n event\n });\n }\n })\n }, {\n elementType: 'button'\n })\n };\n};\n"],"names":["useAccordionHeader_unstable","props","ref","icon","button","expandIcon","inline","size","expandIconPosition","value","disabled","open","useAccordionItemContext_unstable","requestToggle","useAccordionContext_unstable","ctx","disabledFocusable","collapsible","openItems","length","dir","useFluent","expandIconRotation","components","root","slot","always","getIntrinsicElementProps","elementType","optional","renderByDefault","defaultProps","children","React","createElement","ChevronRightRegular","style","transform","useARIAButtonShorthand","required","type","onClick","useEventCallback","event","isResolvedShorthand","_button_onClick","call","defaultPrevented"],"mappings":";;;;+BAWiBA;;;eAAAA;;;;iEAXM;gCAC+D;2BAC/C;2BACM;4BACT;qCACY;+BACC;AAKtC,MAAMA,8BAA8B,CAACC,OAAOC;IACnD,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,UAAU,EAAEC,SAAS,KAAK,EAAEC,OAAO,QAAQ,EAAEC,qBAAqB,OAAO,EAAE,GAAGP;IACpG,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGC,IAAAA,+CAAgC;IAClE,MAAMC,gBAAgBC,IAAAA,uCAA4B,EAAC,CAACC,MAAMA,IAAIF,aAAa;IAC3E;;;GAGD,GAAG,MAAMG,oBAAoBF,IAAAA,uCAA4B,EAAC,CAACC,MAAM,CAACA,IAAIE,WAAW,IAAIF,IAAIG,SAAS,CAACC,MAAM,KAAK,KAAKR;IAClH,MAAM,EAAES,GAAG,EAAE,GAAGC,IAAAA,uCAAS;IACzB,oEAAoE;IACpE,IAAIC;IACJ,IAAId,uBAAuB,OAAO;QAC9B,8FAA8F;QAC9Fc,qBAAqBX,OAAO,CAAC,KAAK;IACtC,OAAO;QACH,mGAAmG;QACnGW,qBAAqBX,OAAO,KAAKS,QAAQ,QAAQ,IAAI;IACzD;IACA,OAAO;QACHV;QACAC;QACAJ;QACAD;QACAE;QACAe,YAAY;YACRC,MAAM;YACNpB,QAAQ;YACRC,YAAY;YACZF,MAAM;QACV;QACAqB,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FzB,KAAKA;YACL,GAAGD,KAAK;QACZ,IAAI;YACA2B,aAAa;QACjB;QACAzB,MAAMsB,oBAAI,CAACI,QAAQ,CAAC1B,MAAM;YACtByB,aAAa;QACjB;QACAvB,YAAYoB,oBAAI,CAACI,QAAQ,CAACxB,YAAY;YAClCyB,iBAAiB;YACjBC,cAAc;gBACVC,UAAU,WAAW,GAAGC,OAAMC,aAAa,CAACC,+BAAmB,EAAE;oBAC7DC,OAAO;wBACHC,WAAW,CAAC,OAAO,EAAEf,mBAAmB,IAAI,CAAC;oBACjD;gBACJ;gBACA,eAAe;YACnB;YACAM,aAAa;QACjB;QACAxB,QAAQqB,oBAAI,CAACC,MAAM,CAAC;YAChB,GAAGY,IAAAA,iCAAsB,EAAClC,QAAQ;gBAC9BmC,UAAU;gBACVR,cAAc;oBACVrB;oBACAM;oBACA,iBAAiBL;oBACjB6B,MAAM;gBACV;YACJ,EAAE;YACFC,SAASC,IAAAA,gCAAgB,EAAC,CAACC;gBACvB,IAAIC,IAAAA,mCAAmB,EAACxC,SAAS;oBAC7B,IAAIyC;oBACHA,CAAAA,kBAAkBzC,OAAOqC,OAAO,AAAD,MAAO,QAAQI,oBAAoB,KAAK,IAAI,KAAK,IAAIA,gBAAgBC,IAAI,CAAC1C,QAAQuC;gBACtH;gBACA,IAAI,CAACA,MAAMI,gBAAgB,EAAE;oBACzBlC,cAAc;wBACVJ;wBACAkC;oBACJ;gBACJ;YACJ;QACJ,GAAG;YACCf,aAAa;QACjB;IACJ;AACJ"}
@@ -28,8 +28,11 @@ const useAccordionItem_unstable = (props, ref)=>{
28
28
  components: {
29
29
  root: 'div'
30
30
  },
31
- root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', {
32
- ref,
31
+ root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
32
+ // FIXME:
33
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
34
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
35
+ ref: ref,
33
36
  ...props
34
37
  }), {
35
38
  elementType: 'div'
@@ -1 +1 @@
1
- {"version":3,"sources":["useAccordionItem.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot, useEventCallback } from '@fluentui/react-utilities';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionItem properties\n * @param ref - reference to root HTMLElement of AccordionItem\n */ export const useAccordionItem_unstable = (props, ref)=>{\n const { value, disabled = false } = props;\n const requestToggle = useAccordionContext_unstable((ctx)=>ctx.requestToggle);\n const open = useAccordionContext_unstable((ctx)=>ctx.openItems.includes(value));\n const onAccordionHeaderClick = useEventCallback((event)=>requestToggle({\n event,\n value\n }));\n return {\n open,\n value,\n disabled,\n onHeaderClick: onAccordionHeaderClick,\n components: {\n root: 'div'\n },\n root: slot.always(getNativeElementProps('div', {\n ref,\n ...props\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useAccordionItem_unstable","props","ref","value","disabled","requestToggle","useAccordionContext_unstable","ctx","open","openItems","includes","onAccordionHeaderClick","useEventCallback","event","onHeaderClick","components","root","slot","always","getNativeElementProps","elementType"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;gCACuC;2BACjB;AAKlC,MAAMA,4BAA4B,CAACC,OAAOC;IACjD,MAAM,EAAEC,KAAK,EAAEC,WAAW,KAAK,EAAE,GAAGH;IACpC,MAAMI,gBAAgBC,IAAAA,uCAA4B,EAAC,CAACC,MAAMA,IAAIF,aAAa;IAC3E,MAAMG,OAAOF,IAAAA,uCAA4B,EAAC,CAACC,MAAMA,IAAIE,SAAS,CAACC,QAAQ,CAACP;IACxE,MAAMQ,yBAAyBC,IAAAA,gCAAgB,EAAC,CAACC,QAAQR,cAAc;YAC/DQ;YACAV;QACJ;IACJ,OAAO;QACHK;QACAL;QACAC;QACAU,eAAeH;QACfI,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3CjB;YACA,GAAGD,KAAK;QACZ,IAAI;YACAmB,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useAccordionItem.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useEventCallback } from '@fluentui/react-utilities';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionItem properties\n * @param ref - reference to root HTMLElement of AccordionItem\n */ export const useAccordionItem_unstable = (props, ref)=>{\n const { value, disabled = false } = props;\n const requestToggle = useAccordionContext_unstable((ctx)=>ctx.requestToggle);\n const open = useAccordionContext_unstable((ctx)=>ctx.openItems.includes(value));\n const onAccordionHeaderClick = useEventCallback((event)=>requestToggle({\n event,\n value\n }));\n return {\n open,\n value,\n disabled,\n onHeaderClick: onAccordionHeaderClick,\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref,\n ...props\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useAccordionItem_unstable","props","ref","value","disabled","requestToggle","useAccordionContext_unstable","ctx","open","openItems","includes","onAccordionHeaderClick","useEventCallback","event","onHeaderClick","components","root","slot","always","getIntrinsicElementProps","elementType"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;gCAC0C;2BACpB;AAKlC,MAAMA,4BAA4B,CAACC,OAAOC;IACjD,MAAM,EAAEC,KAAK,EAAEC,WAAW,KAAK,EAAE,GAAGH;IACpC,MAAMI,gBAAgBC,IAAAA,uCAA4B,EAAC,CAACC,MAAMA,IAAIF,aAAa;IAC3E,MAAMG,OAAOF,IAAAA,uCAA4B,EAAC,CAACC,MAAMA,IAAIE,SAAS,CAACC,QAAQ,CAACP;IACxE,MAAMQ,yBAAyBC,IAAAA,gCAAgB,EAAC,CAACC,QAAQR,cAAc;YAC/DQ;YACAV;QACJ;IACJ,OAAO;QACHK;QACAL;QACAC;QACAU,eAAeH;QACfI,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FjB,KAAKA;YACL,GAAGD,KAAK;QACZ,IAAI;YACAmB,aAAa;QACjB;IACJ;AACJ"}
@@ -27,8 +27,11 @@ const useAccordionPanel_unstable = (props, ref)=>{
27
27
  components: {
28
28
  root: 'div'
29
29
  },
30
- root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', {
31
- ref,
30
+ root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
31
+ // FIXME:
32
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
33
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
34
+ ref: ref,
32
35
  ...props,
33
36
  ...navigation && focusableProps
34
37
  }), {
@@ -1 +1 @@
1
- {"version":3,"sources":["useAccordionPanel.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from '@fluentui/react-tabster';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\nimport { useAccordionItemContext_unstable } from '../../contexts/accordionItem';\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionPanel properties\n * @param ref - reference to root HTMLElement of AccordionPanel\n */ export const useAccordionPanel_unstable = (props, ref)=>{\n const { open } = useAccordionItemContext_unstable();\n const focusableProps = useTabsterAttributes({\n focusable: {\n excludeFromMover: true\n }\n });\n const navigation = useAccordionContext_unstable((ctx)=>ctx.navigation);\n return {\n open,\n components: {\n root: 'div'\n },\n root: slot.always(getNativeElementProps('div', {\n ref,\n ...props,\n ...navigation && focusableProps\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useAccordionPanel_unstable","props","ref","open","useAccordionItemContext_unstable","focusableProps","useTabsterAttributes","focusable","excludeFromMover","navigation","useAccordionContext_unstable","ctx","components","root","slot","always","getNativeElementProps","elementType"],"mappings":";;;;+BASiBA;;;eAAAA;;;;iEATM;gCACqB;8BACP;2BACQ;+BACI;AAKtC,MAAMA,6BAA6B,CAACC,OAAOC;IAClD,MAAM,EAAEC,IAAI,EAAE,GAAGC,IAAAA,+CAAgC;IACjD,MAAMC,iBAAiBC,IAAAA,kCAAoB,EAAC;QACxCC,WAAW;YACPC,kBAAkB;QACtB;IACJ;IACA,MAAMC,aAAaC,IAAAA,uCAA4B,EAAC,CAACC,MAAMA,IAAIF,UAAU;IACrE,OAAO;QACHN;QACAS,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3Cd;YACA,GAAGD,KAAK;YACR,GAAGQ,cAAcJ,cAAc;QACnC,IAAI;YACAY,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useAccordionPanel.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from '@fluentui/react-tabster';\nimport { useAccordionContext_unstable } from '../../contexts/accordion';\nimport { useAccordionItemContext_unstable } from '../../contexts/accordionItem';\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionPanel properties\n * @param ref - reference to root HTMLElement of AccordionPanel\n */ export const useAccordionPanel_unstable = (props, ref)=>{\n const { open } = useAccordionItemContext_unstable();\n const focusableProps = useTabsterAttributes({\n focusable: {\n excludeFromMover: true\n }\n });\n const navigation = useAccordionContext_unstable((ctx)=>ctx.navigation);\n return {\n open,\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref,\n ...props,\n ...navigation && focusableProps\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useAccordionPanel_unstable","props","ref","open","useAccordionItemContext_unstable","focusableProps","useTabsterAttributes","focusable","excludeFromMover","navigation","useAccordionContext_unstable","ctx","components","root","slot","always","getIntrinsicElementProps","elementType"],"mappings":";;;;+BASiBA;;;eAAAA;;;;iEATM;gCACwB;8BACV;2BACQ;+BACI;AAKtC,MAAMA,6BAA6B,CAACC,OAAOC;IAClD,MAAM,EAAEC,IAAI,EAAE,GAAGC,IAAAA,+CAAgC;IACjD,MAAMC,iBAAiBC,IAAAA,kCAAoB,EAAC;QACxCC,WAAW;YACPC,kBAAkB;QACtB;IACJ;IACA,MAAMC,aAAaC,IAAAA,uCAA4B,EAAC,CAACC,MAAMA,IAAIF,UAAU;IACrE,OAAO;QACHN;QACAS,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5Fd,KAAKA;YACL,GAAGD,KAAK;YACR,GAAGQ,cAAcJ,cAAc;QACnC,IAAI;YACAY,aAAa;QACjB;IACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-accordion",
3
- "version": "9.3.21",
3
+ "version": "9.3.23",
4
4
  "description": "Fluent UI accordion component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -33,14 +33,14 @@
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-aria": "^9.3.42",
37
- "@fluentui/react-context-selector": "^9.1.40",
36
+ "@fluentui/react-aria": "^9.3.43",
37
+ "@fluentui/react-context-selector": "^9.1.41",
38
38
  "@fluentui/react-icons": "^2.0.217",
39
- "@fluentui/react-jsx-runtime": "^9.0.16",
39
+ "@fluentui/react-jsx-runtime": "^9.0.18",
40
40
  "@fluentui/react-shared-contexts": "^9.10.0",
41
- "@fluentui/react-tabster": "^9.13.6",
41
+ "@fluentui/react-tabster": "^9.14.0",
42
42
  "@fluentui/react-theme": "^9.1.14",
43
- "@fluentui/react-utilities": "^9.15.0",
43
+ "@fluentui/react-utilities": "^9.15.1",
44
44
  "@griffel/react": "^1.5.14",
45
45
  "@swc/helpers": "^0.5.1"
46
46
  },