@fluentui/react-accordion 9.0.15 → 9.0.17

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.
Files changed (110) hide show
  1. package/CHANGELOG.json +93 -1
  2. package/CHANGELOG.md +28 -2
  3. package/lib/components/Accordion/Accordion.js +0 -1
  4. package/lib/components/Accordion/Accordion.js.map +1 -1
  5. package/lib/components/Accordion/AccordionContext.js +0 -2
  6. package/lib/components/Accordion/AccordionContext.js.map +1 -1
  7. package/lib/components/Accordion/renderAccordion.js +2 -2
  8. package/lib/components/Accordion/renderAccordion.js.map +1 -1
  9. package/lib/components/Accordion/useAccordion.js +2 -11
  10. package/lib/components/Accordion/useAccordion.js.map +1 -1
  11. package/lib/components/Accordion/useAccordionContextValues.js +2 -2
  12. package/lib/components/Accordion/useAccordionContextValues.js.map +1 -1
  13. package/lib/components/Accordion/useAccordionStyles.js.map +1 -1
  14. package/lib/components/AccordionHeader/AccordionHeader.js +0 -1
  15. package/lib/components/AccordionHeader/AccordionHeader.js.map +1 -1
  16. package/lib/components/AccordionHeader/AccordionHeaderContext.js +0 -1
  17. package/lib/components/AccordionHeader/AccordionHeaderContext.js.map +1 -1
  18. package/lib/components/AccordionHeader/renderAccordionHeader.js +10 -6
  19. package/lib/components/AccordionHeader/renderAccordionHeader.js.map +1 -1
  20. package/lib/components/AccordionHeader/useAccordionHeader.js +4 -9
  21. package/lib/components/AccordionHeader/useAccordionHeader.js.map +1 -1
  22. package/lib/components/AccordionHeader/useAccordionHeaderContextValues.js.map +1 -1
  23. package/lib/components/AccordionHeader/useAccordionHeaderStyles.js +130 -136
  24. package/lib/components/AccordionHeader/useAccordionHeaderStyles.js.map +1 -1
  25. package/lib/components/AccordionItem/AccordionItem.js +0 -1
  26. package/lib/components/AccordionItem/AccordionItem.js.map +1 -1
  27. package/lib/components/AccordionItem/AccordionItemContext.js +0 -2
  28. package/lib/components/AccordionItem/AccordionItemContext.js.map +1 -1
  29. package/lib/components/AccordionItem/renderAccordionItem.js +2 -2
  30. package/lib/components/AccordionItem/renderAccordionItem.js.map +1 -1
  31. package/lib/components/AccordionItem/useAccordionItem.js +0 -1
  32. package/lib/components/AccordionItem/useAccordionItem.js.map +1 -1
  33. package/lib/components/AccordionItem/useAccordionItemContextValues.js.map +1 -1
  34. package/lib/components/AccordionItem/useAccordionItemStyles.js.map +1 -1
  35. package/lib/components/AccordionPanel/AccordionPanel.js +0 -1
  36. package/lib/components/AccordionPanel/AccordionPanel.js.map +1 -1
  37. package/lib/components/AccordionPanel/renderAccordionPanel.js +2 -2
  38. package/lib/components/AccordionPanel/renderAccordionPanel.js.map +1 -1
  39. package/lib/components/AccordionPanel/useAccordionPanel.js +0 -1
  40. package/lib/components/AccordionPanel/useAccordionPanel.js.map +1 -1
  41. package/lib/components/AccordionPanel/useAccordionPanelStyles.js +6 -9
  42. package/lib/components/AccordionPanel/useAccordionPanelStyles.js.map +1 -1
  43. package/lib/index.js.map +1 -1
  44. package/lib-commonjs/Accordion.js +0 -2
  45. package/lib-commonjs/Accordion.js.map +1 -1
  46. package/lib-commonjs/AccordionHeader.js +0 -2
  47. package/lib-commonjs/AccordionHeader.js.map +1 -1
  48. package/lib-commonjs/AccordionItem.js +0 -2
  49. package/lib-commonjs/AccordionItem.js.map +1 -1
  50. package/lib-commonjs/AccordionPanel.js +0 -2
  51. package/lib-commonjs/AccordionPanel.js.map +1 -1
  52. package/lib-commonjs/components/Accordion/Accordion.js +0 -7
  53. package/lib-commonjs/components/Accordion/Accordion.js.map +1 -1
  54. package/lib-commonjs/components/Accordion/Accordion.types.js.map +1 -1
  55. package/lib-commonjs/components/Accordion/AccordionContext.js +0 -6
  56. package/lib-commonjs/components/Accordion/AccordionContext.js.map +1 -1
  57. package/lib-commonjs/components/Accordion/index.js +0 -8
  58. package/lib-commonjs/components/Accordion/index.js.map +1 -1
  59. package/lib-commonjs/components/Accordion/renderAccordion.js +2 -7
  60. package/lib-commonjs/components/Accordion/renderAccordion.js.map +1 -1
  61. package/lib-commonjs/components/Accordion/useAccordion.js +2 -16
  62. package/lib-commonjs/components/Accordion/useAccordion.js.map +1 -1
  63. package/lib-commonjs/components/Accordion/useAccordionContextValues.js +2 -4
  64. package/lib-commonjs/components/Accordion/useAccordionContextValues.js.map +1 -1
  65. package/lib-commonjs/components/Accordion/useAccordionStyles.js +0 -4
  66. package/lib-commonjs/components/Accordion/useAccordionStyles.js.map +1 -1
  67. package/lib-commonjs/components/AccordionHeader/AccordionHeader.js +0 -7
  68. package/lib-commonjs/components/AccordionHeader/AccordionHeader.js.map +1 -1
  69. package/lib-commonjs/components/AccordionHeader/AccordionHeader.types.js.map +1 -1
  70. package/lib-commonjs/components/AccordionHeader/AccordionHeaderContext.js +0 -5
  71. package/lib-commonjs/components/AccordionHeader/AccordionHeaderContext.js.map +1 -1
  72. package/lib-commonjs/components/AccordionHeader/index.js +0 -7
  73. package/lib-commonjs/components/AccordionHeader/index.js.map +1 -1
  74. package/lib-commonjs/components/AccordionHeader/renderAccordionHeader.js +10 -11
  75. package/lib-commonjs/components/AccordionHeader/renderAccordionHeader.js.map +1 -1
  76. package/lib-commonjs/components/AccordionHeader/useAccordionHeader.js +4 -18
  77. package/lib-commonjs/components/AccordionHeader/useAccordionHeader.js.map +1 -1
  78. package/lib-commonjs/components/AccordionHeader/useAccordionHeaderContextValues.js +0 -3
  79. package/lib-commonjs/components/AccordionHeader/useAccordionHeaderContextValues.js.map +1 -1
  80. package/lib-commonjs/components/AccordionHeader/useAccordionHeaderStyles.js +130 -141
  81. package/lib-commonjs/components/AccordionHeader/useAccordionHeaderStyles.js.map +1 -1
  82. package/lib-commonjs/components/AccordionItem/AccordionItem.js +0 -7
  83. package/lib-commonjs/components/AccordionItem/AccordionItem.js.map +1 -1
  84. package/lib-commonjs/components/AccordionItem/AccordionItem.types.js.map +1 -1
  85. package/lib-commonjs/components/AccordionItem/AccordionItemContext.js +0 -6
  86. package/lib-commonjs/components/AccordionItem/AccordionItemContext.js.map +1 -1
  87. package/lib-commonjs/components/AccordionItem/index.js +0 -8
  88. package/lib-commonjs/components/AccordionItem/index.js.map +1 -1
  89. package/lib-commonjs/components/AccordionItem/renderAccordionItem.js +2 -7
  90. package/lib-commonjs/components/AccordionItem/renderAccordionItem.js.map +1 -1
  91. package/lib-commonjs/components/AccordionItem/useAccordionItem.js +0 -6
  92. package/lib-commonjs/components/AccordionItem/useAccordionItem.js.map +1 -1
  93. package/lib-commonjs/components/AccordionItem/useAccordionItemContextValues.js +0 -3
  94. package/lib-commonjs/components/AccordionItem/useAccordionItemContextValues.js.map +1 -1
  95. package/lib-commonjs/components/AccordionItem/useAccordionItemStyles.js +0 -4
  96. package/lib-commonjs/components/AccordionItem/useAccordionItemStyles.js.map +1 -1
  97. package/lib-commonjs/components/AccordionPanel/AccordionPanel.js +0 -6
  98. package/lib-commonjs/components/AccordionPanel/AccordionPanel.js.map +1 -1
  99. package/lib-commonjs/components/AccordionPanel/AccordionPanel.types.js.map +1 -1
  100. package/lib-commonjs/components/AccordionPanel/index.js +0 -6
  101. package/lib-commonjs/components/AccordionPanel/index.js.map +1 -1
  102. package/lib-commonjs/components/AccordionPanel/renderAccordionPanel.js +2 -6
  103. package/lib-commonjs/components/AccordionPanel/renderAccordionPanel.js.map +1 -1
  104. package/lib-commonjs/components/AccordionPanel/useAccordionPanel.js +0 -7
  105. package/lib-commonjs/components/AccordionPanel/useAccordionPanel.js.map +1 -1
  106. package/lib-commonjs/components/AccordionPanel/useAccordionPanelStyles.js +6 -13
  107. package/lib-commonjs/components/AccordionPanel/useAccordionPanelStyles.js.map +1 -1
  108. package/lib-commonjs/index.js +0 -8
  109. package/lib-commonjs/index.js.map +1 -1
  110. package/package.json +8 -8
package/CHANGELOG.json CHANGED
@@ -2,7 +2,99 @@
2
2
  "name": "@fluentui/react-accordion",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 21 Dec 2022 10:17:16 GMT",
5
+ "date": "Mon, 09 Jan 2023 14:31:49 GMT",
6
+ "tag": "@fluentui/react-accordion_v9.0.17",
7
+ "version": "9.0.17",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-accordion",
13
+ "comment": "Bump @fluentui/react-aria to v9.3.5",
14
+ "commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-accordion",
19
+ "comment": "Bump @fluentui/react-context-selector to v9.1.5",
20
+ "commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-accordion",
25
+ "comment": "Bump @fluentui/react-tabster to v9.3.6",
26
+ "commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-accordion",
31
+ "comment": "Bump @fluentui/react-utilities to v9.4.0",
32
+ "commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Wed, 04 Jan 2023 01:40:48 GMT",
39
+ "tag": "@fluentui/react-accordion_v9.0.16",
40
+ "version": "9.0.16",
41
+ "comments": {
42
+ "patch": [
43
+ {
44
+ "author": "olfedias@microsoft.com",
45
+ "package": "@fluentui/react-accordion",
46
+ "commit": "2c38f1e4ae07b2b60df596efe11015a68f166dbf",
47
+ "comment": "chore: Update Griffel to latest version"
48
+ },
49
+ {
50
+ "author": "beachball",
51
+ "package": "@fluentui/react-accordion",
52
+ "comment": "Bump @fluentui/react-aria to v9.3.4",
53
+ "commit": "3e322d15529451be153e97298873253e21af4082"
54
+ },
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui/react-accordion",
58
+ "comment": "Bump @fluentui/react-context-selector to v9.1.4",
59
+ "commit": "3e322d15529451be153e97298873253e21af4082"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui/react-accordion",
64
+ "comment": "Bump @fluentui/react-tabster to v9.3.5",
65
+ "commit": "3e322d15529451be153e97298873253e21af4082"
66
+ },
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui/react-accordion",
70
+ "comment": "Bump @fluentui/react-utilities to v9.3.1",
71
+ "commit": "3e322d15529451be153e97298873253e21af4082"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-accordion",
76
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19",
77
+ "commit": "3e322d15529451be153e97298873253e21af4082"
78
+ }
79
+ ],
80
+ "none": [
81
+ {
82
+ "author": "martinhochel@microsoft.com",
83
+ "package": "@fluentui/react-accordion",
84
+ "commit": "4ec2b998b294d6d9c3196d3d82893bdd97d0c105",
85
+ "comment": "chore(scripts): move index.ts to to follow sub-folder domain packaging"
86
+ },
87
+ {
88
+ "author": "martinhochel@microsoft.com",
89
+ "package": "@fluentui/react-accordion",
90
+ "commit": "194b0cf0cc27c1c1233aa945f09b3ad29778d8ca",
91
+ "comment": "chore(scripts): use for @fluentui/scripts version within all package.json"
92
+ }
93
+ ]
94
+ }
95
+ },
96
+ {
97
+ "date": "Wed, 21 Dec 2022 10:20:33 GMT",
6
98
  "tag": "@fluentui/react-accordion_v9.0.15",
7
99
  "version": "9.0.15",
8
100
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,38 @@
1
1
  # Change Log - @fluentui/react-accordion
2
2
 
3
- This log was last generated on Wed, 21 Dec 2022 10:17:16 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 09 Jan 2023 14:31:49 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.17](https://github.com/microsoft/fluentui/tree/@fluentui/react-accordion_v9.0.17)
8
+
9
+ Mon, 09 Jan 2023 14:31:49 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-accordion_v9.0.16..@fluentui/react-accordion_v9.0.17)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-aria to v9.3.5 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
15
+ - Bump @fluentui/react-context-selector to v9.1.5 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
16
+ - Bump @fluentui/react-tabster to v9.3.6 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
17
+ - Bump @fluentui/react-utilities to v9.4.0 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
18
+
19
+ ## [9.0.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-accordion_v9.0.16)
20
+
21
+ Wed, 04 Jan 2023 01:40:48 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-accordion_v9.0.15..@fluentui/react-accordion_v9.0.16)
23
+
24
+ ### Patches
25
+
26
+ - chore: Update Griffel to latest version ([PR #26045](https://github.com/microsoft/fluentui/pull/26045) by olfedias@microsoft.com)
27
+ - Bump @fluentui/react-aria to v9.3.4 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
28
+ - Bump @fluentui/react-context-selector to v9.1.4 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
29
+ - Bump @fluentui/react-tabster to v9.3.5 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
30
+ - Bump @fluentui/react-utilities to v9.3.1 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
31
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
32
+
7
33
  ## [9.0.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-accordion_v9.0.15)
8
34
 
9
- Wed, 21 Dec 2022 10:17:16 GMT
35
+ Wed, 21 Dec 2022 10:20:33 GMT
10
36
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-accordion_v9.0.14..@fluentui/react-accordion_v9.0.15)
11
37
 
12
38
  ### Patches
@@ -6,7 +6,6 @@ import { useAccordionStyles_unstable } from './useAccordionStyles';
6
6
  /**
7
7
  * Define a styled Accordion, using the `useAccordion_unstable` and `useAccordionStyles_unstable` hooks.
8
8
  */
9
-
10
9
  export const Accordion = /*#__PURE__*/React.forwardRef((props, ref) => {
11
10
  const state = useAccordion_unstable(props, ref);
12
11
  const contextValues = useAccordionContextValues_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,wBAAT,QAAyC,mBAAzC;AACA,SAAS,qBAAT,QAAsC,gBAAtC;AACA,SAAS,kCAAT,QAAmD,6BAAnD;AAGA,SAAS,2BAAT,QAA4C,sBAA5C;AAEA;;AAEG;;AACH,OAAO,MAAM,SAAS,gBAAwC,KAAK,CAAC,UAAN,CAC5D,CAAC,KAAD,EAAQ,GAAR,KAAe;EACb,MAAM,KAAK,GAAG,qBAAqB,CAAC,KAAD,EAAQ,GAAR,CAAnC;EACA,MAAM,aAAa,GAAG,kCAAkC,CAAC,KAAD,CAAxD;EAEA,2BAA2B,CAAC,KAAD,CAA3B;EAEA,OAAO,wBAAwB,CAAC,KAAD,EAAQ,aAAR,CAA/B;AACD,CAR2D,CAAvD;AAWP,SAAS,CAAC,WAAV,GAAwB,WAAxB","sourcesContent":["import * as React from 'react';\nimport { renderAccordion_unstable } from './renderAccordion';\nimport { useAccordion_unstable } from './useAccordion';\nimport { useAccordionContextValues_unstable } from './useAccordionContextValues';\nimport type { AccordionProps } from './Accordion.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useAccordionStyles_unstable } from './useAccordionStyles';\n\n/**\n * Define a styled Accordion, using the `useAccordion_unstable` and `useAccordionStyles_unstable` hooks.\n */\nexport const Accordion: ForwardRefComponent<AccordionProps> = React.forwardRef<HTMLDivElement, AccordionProps>(\n (props, ref) => {\n const state = useAccordion_unstable(props, ref);\n const contextValues = useAccordionContextValues_unstable(state);\n\n useAccordionStyles_unstable(state);\n\n return renderAccordion_unstable(state, contextValues);\n },\n);\n\nAccordion.displayName = 'Accordion';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,wBAAwB,QAAQ,mBAAmB;AAC5D,SAASC,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,kCAAkC,QAAQ,6BAA6B;AAGhF,SAASC,2BAA2B,QAAQ,sBAAsB;AAElE;;;AAGA,OAAO,MAAMC,SAAS,gBAAwCL,KAAK,CAACM,UAAU,CAC5E,CAACC,KAAK,EAAEC,GAAG,KAAI;EACb,MAAMC,KAAK,GAAGP,qBAAqB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAC/C,MAAME,aAAa,GAAGP,kCAAkC,CAACM,KAAK,CAAC;EAE/DL,2BAA2B,CAACK,KAAK,CAAC;EAElC,OAAOR,wBAAwB,CAACQ,KAAK,EAAEC,aAAa,CAAC;AACvD,CAAC,CACF;AAEDL,SAAS,CAACM,WAAW,GAAG,WAAW","names":["React","renderAccordion_unstable","useAccordion_unstable","useAccordionContextValues_unstable","useAccordionStyles_unstable","Accordion","forwardRef","props","ref","state","contextValues","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/Accordion/Accordion.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderAccordion_unstable } from './renderAccordion';\nimport { useAccordion_unstable } from './useAccordion';\nimport { useAccordionContextValues_unstable } from './useAccordionContextValues';\nimport type { AccordionProps } from './Accordion.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useAccordionStyles_unstable } from './useAccordionStyles';\n\n/**\n * Define a styled Accordion, using the `useAccordion_unstable` and `useAccordionStyles_unstable` hooks.\n */\nexport const Accordion: ForwardRefComponent<AccordionProps> = React.forwardRef<HTMLDivElement, AccordionProps>(\n (props, ref) => {\n const state = useAccordion_unstable(props, ref);\n const contextValues = useAccordionContextValues_unstable(state);\n\n useAccordionStyles_unstable(state);\n\n return renderAccordion_unstable(state, contextValues);\n },\n);\n\nAccordion.displayName = 'Accordion';\n"]}
@@ -3,11 +3,9 @@ export const AccordionContext = /*#__PURE__*/createContext(undefined);
3
3
  const accordionContextDefaultValue = {
4
4
  openItems: [],
5
5
  collapsible: false,
6
-
7
6
  requestToggle() {
8
7
  /* noop */
9
8
  }
10
-
11
9
  };
12
10
  export const AccordionProvider = AccordionContext.Provider;
13
11
  export const useAccordionContext_unstable = selector => useContextSelector(AccordionContext, (ctx = accordionContextDefaultValue) => selector(ctx));
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/Accordion/AccordionContext.ts"],"names":[],"mappings":"AAAA,SAAS,aAAT,EAAyC,kBAAzC,QAAmE,kCAAnE;AAIA,OAAO,MAAM,gBAAgB,gBAAmC,aAAa,CAC3E,SAD2E,CAAtE;AAIP,MAAM,4BAA4B,GAA0B;EAC1D,SAAS,EAAE,EAD+C;EAE1D,WAAW,EAAE,KAF6C;;EAG1D,aAAa,GAAA;IACX;EACD;;AALyD,CAA5D;AAQA,OAAO,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,QAA3C;AACP,OAAO,MAAM,4BAA4B,GAAO,QAAJ,IAC1C,kBAAkB,CAAC,gBAAD,EAAmB,CAAC,GAAG,GAAG,4BAAP,KAAwC,QAAQ,CAAC,GAAD,CAAnE,CADb","sourcesContent":["import { createContext, ContextSelector, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { AccordionContextValue } from './Accordion.types';\n\nexport const AccordionContext: Context<AccordionContextValue> = createContext<AccordionContextValue | undefined>(\n undefined,\n) as Context<AccordionContextValue>;\n\nconst accordionContextDefaultValue: AccordionContextValue = {\n openItems: [],\n collapsible: false,\n requestToggle() {\n /* noop */\n },\n};\n\nexport const AccordionProvider = AccordionContext.Provider;\nexport const useAccordionContext_unstable = <T>(selector: ContextSelector<AccordionContextValue, T>): T =>\n useContextSelector(AccordionContext, (ctx = accordionContextDefaultValue) => selector(ctx));\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,SAASA,aAAa,EAAmBC,kBAAkB,QAAQ,kCAAkC;AAIrG,OAAO,MAAMC,gBAAgB,gBAAmCF,aAAa,CAC3EG,SAAS,CACwB;AAEnC,MAAMC,4BAA4B,GAA0B;EAC1DC,SAAS,EAAE,EAAE;EACbC,WAAW,EAAE,KAAK;EAClBC,aAAa;IACX;EAAA;CAEH;AAED,OAAO,MAAMC,iBAAiB,GAAGN,gBAAgB,CAACO,QAAQ;AAC1D,OAAO,MAAMC,4BAA4B,GAAOC,QAAmD,IACjGV,kBAAkB,CAACC,gBAAgB,EAAE,CAACU,GAAG,GAAGR,4BAA4B,KAAKO,QAAQ,CAACC,GAAG,CAAC,CAAC","names":["createContext","useContextSelector","AccordionContext","undefined","accordionContextDefaultValue","openItems","collapsible","requestToggle","AccordionProvider","Provider","useAccordionContext_unstable","selector","ctx"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/Accordion/AccordionContext.ts"],"sourcesContent":["import { createContext, ContextSelector, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { AccordionContextValue } from './Accordion.types';\n\nexport const AccordionContext: Context<AccordionContextValue> = createContext<AccordionContextValue | undefined>(\n undefined,\n) as Context<AccordionContextValue>;\n\nconst accordionContextDefaultValue: AccordionContextValue = {\n openItems: [],\n collapsible: false,\n requestToggle() {\n /* noop */\n },\n};\n\nexport const AccordionProvider = AccordionContext.Provider;\nexport const useAccordionContext_unstable = <T>(selector: ContextSelector<AccordionContextValue, T>): T =>\n useContextSelector(AccordionContext, (ctx = accordionContextDefaultValue) => selector(ctx));\n"]}
@@ -4,13 +4,13 @@ import { AccordionContext } from './AccordionContext';
4
4
  /**
5
5
  * Function that renders the final JSX of the component
6
6
  */
7
-
8
7
  export const renderAccordion_unstable = (state, contextValues) => {
9
8
  const {
10
9
  slots,
11
10
  slotProps
12
11
  } = getSlots(state);
13
- return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
12
+ return /*#__PURE__*/React.createElement(slots.root, {
13
+ ...slotProps.root
14
14
  }, /*#__PURE__*/React.createElement(AccordionContext.Provider, {
15
15
  value: contextValues.accordion
16
16
  }, slotProps.root.children));
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/Accordion/renderAccordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,gBAAT,QAAiC,oBAAjC;AAGA;;AAEG;;AACH,OAAO,MAAM,wBAAwB,GAAG,CAAC,KAAD,EAAwB,aAAxB,KAAiE;EACvG,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAiB,KAAjB,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,gBAAgB,CAAC,QAAlB,EAA0B;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAA1B,EAA4D,SAAS,CAAC,IAAV,CAAe,QAA3E,CADF,CADF;AAKD,CARM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n\nimport { AccordionContext } from './AccordionContext';\nimport type { AccordionState, AccordionSlots, AccordionContextValues } from './Accordion.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderAccordion_unstable = (state: AccordionState, contextValues: AccordionContextValues) => {\n const { slots, slotProps } = getSlots<AccordionSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <AccordionContext.Provider value={contextValues.accordion}>{slotProps.root.children}</AccordionContext.Provider>\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,gBAAgB,QAAQ,oBAAoB;AAGrD;;;AAGA,OAAO,MAAMC,wBAAwB,GAAG,CAACC,KAAqB,EAAEC,aAAqC,KAAI;EACvG,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGN,QAAQ,CAAiBG,KAAK,CAAC;EAE5D,oBACEJ,oBAACM,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,gBAC5BR,oBAACE,gBAAgB,CAACO,QAAQ;IAACC,KAAK,EAAEL,aAAa,CAACM;EAAS,GAAGJ,SAAS,CAACC,IAAI,CAACI,QAAQ,CAA6B,CACrG;AAEjB,CAAC","names":["React","getSlots","AccordionContext","renderAccordion_unstable","state","contextValues","slots","slotProps","root","Provider","value","accordion","children"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/Accordion/renderAccordion.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n\nimport { AccordionContext } from './AccordionContext';\nimport type { AccordionState, AccordionSlots, AccordionContextValues } from './Accordion.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderAccordion_unstable = (state: AccordionState, contextValues: AccordionContextValues) => {\n const { slots, slotProps } = getSlots<AccordionSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <AccordionContext.Provider value={contextValues.accordion}>{slotProps.root.children}</AccordionContext.Provider>\n </slots.root>\n );\n};\n"]}
@@ -6,7 +6,6 @@ import { useArrowNavigationGroup } from '@fluentui/react-tabster';
6
6
  * @param props - Accordion properties
7
7
  * @param ref - reference to root HTMLElement of Accordion
8
8
  */
9
-
10
9
  export const useAccordion_unstable = (props, ref) => {
11
10
  const {
12
11
  openItems: controlledOpenItems,
@@ -40,7 +39,8 @@ export const useAccordion_unstable = (props, ref) => {
40
39
  components: {
41
40
  root: 'div'
42
41
  },
43
- root: getNativeElementProps('div', { ...props,
42
+ root: getNativeElementProps('div', {
43
+ ...props,
44
44
  ...(navigation ? arrowNavigationProps : {}),
45
45
  ref
46
46
  })
@@ -49,7 +49,6 @@ export const useAccordion_unstable = (props, ref) => {
49
49
  /**
50
50
  * Initial value for the uncontrolled case of the list of open indexes
51
51
  */
52
-
53
52
  function initializeUncontrolledOpenItems({
54
53
  defaultOpenItems,
55
54
  multiple
@@ -58,10 +57,8 @@ function initializeUncontrolledOpenItems({
58
57
  if (Array.isArray(defaultOpenItems)) {
59
58
  return multiple ? defaultOpenItems : [defaultOpenItems[0]];
60
59
  }
61
-
62
60
  return [defaultOpenItems];
63
61
  }
64
-
65
62
  return [];
66
63
  }
67
64
  /**
@@ -71,8 +68,6 @@ function initializeUncontrolledOpenItems({
71
68
  * @param multiple - if Accordion support multiple Panels opened at the same time
72
69
  * @param collapsible - if Accordion support multiple Panels closed at the same time
73
70
  */
74
-
75
-
76
71
  function updateOpenItems(value, previousOpenItems, multiple, collapsible) {
77
72
  if (multiple) {
78
73
  if (previousOpenItems.includes(value)) {
@@ -85,19 +80,15 @@ function updateOpenItems(value, previousOpenItems, multiple, collapsible) {
85
80
  } else {
86
81
  return previousOpenItems[0] === value && collapsible ? [] : [value];
87
82
  }
88
-
89
83
  return previousOpenItems;
90
84
  }
91
85
  /**
92
86
  * Normalizes Accordion index into an array of indexes
93
87
  */
94
-
95
-
96
88
  function normalizeValues(index) {
97
89
  if (index === undefined) {
98
90
  return undefined;
99
91
  }
100
-
101
92
  return Array.isArray(index) ? index : [index];
102
93
  }
103
94
  //# sourceMappingURL=useAccordion.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/Accordion/useAccordion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,qBAAT,EAAgC,oBAAhC,EAAsD,gBAAtD,QAA8E,2BAA9E;AAGA,SAAS,uBAAT,QAAwC,yBAAxC;AAEA;;;;AAIG;;AACH,OAAO,MAAM,qB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gBADuC;EAEvC;AAFuC,CAAzC,EAGwD;EACtD,IAAI,gBAAgB,KAAK,SAAzB,EAAoC;IAClC,IAAI,KAAK,CAAC,OAAN,CAAc,gBAAd,CAAJ,EAAqC;MACnC,OAAO,QAAQ,GAAG,gBAAH,GAAsB,CAAC,gBAAgB,CAAC,CAAD,CAAjB,CAArC;IACD;;IACD,OAAO,CAAC,gBAAD,CAAP;EACD;;EACD,OAAO,EAAP;AACD;AAED;;;;;;AAMG;;;AACH,SAAS,eAAT,CACE,KADF,EAEE,iBAFF,EAGE,QAHF,EAIE,WAJF,EAIsB;EAEpB,IAAI,QAAJ,EAAc;IACZ,IAAI,iBAAiB,CAAC,QAAlB,CAA2B,KAA3B,CAAJ,EAAuC;MACrC,IAAI,iBAAiB,CAAC,MAAlB,GAA2B,CAA3B,IAAgC,WAApC,EAAiD;QAC/C,OAAO,iBAAiB,CAAC,MAAlB,CAAyB,CAAC,IAAI,CAAC,KAAK,KAApC,CAAP;MACD;IACF,CAJD,MAIO;MACL,OAAO,CAAC,GAAG,iBAAJ,EAAuB,KAAvB,EAA8B,IAA9B,EAAP;IACD;EACF,CARD,MAQO;IACL,OAAO,iBAAiB,CAAC,CAAD,CAAjB,KAAyB,KAAzB,IAAkC,WAAlC,GAAgD,EAAhD,GAAqD,CAAC,KAAD,CAA5D;EACD;;EACD,OAAO,iBAAP;AACD;AAED;;AAEG;;;AACH,SAAS,eAAT,CAAyB,KAAzB,EAA0E;EACxE,IAAI,KAAK,KAAK,SAAd,EAAyB;IACvB,OAAO,SAAP;EACD;;EACD,OAAO,KAAK,CAAC,OAAN,CAAc,KAAd,IAAuB,KAAvB,GAA+B,CAAC,KAAD,CAAtC;AACD","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { AccordionProps, AccordionState, AccordionToggleData, AccordionToggleEvent } from './Accordion.types';\nimport type { AccordionItemValue } from '../AccordionItem/AccordionItem.types';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\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 = (props: AccordionProps, ref: React.Ref<HTMLElement>): AccordionState => {\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((event: AccordionToggleEvent, data: AccordionToggleData) => {\n onToggle?.(event, data);\n setOpenItems(previousOpenItems => updateOpenItems(data.value, previousOpenItems, multiple, collapsible));\n });\n\n return {\n collapsible,\n navigation,\n openItems,\n requestToggle,\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ...props,\n ...(navigation ? arrowNavigationProps : {}),\n ref,\n }),\n };\n};\n\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */\nfunction initializeUncontrolledOpenItems({\n defaultOpenItems,\n multiple,\n}: Pick<AccordionProps, 'defaultOpenItems' | 'multiple'>): AccordionItemValue[] {\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(\n value: AccordionItemValue,\n previousOpenItems: AccordionItemValue[],\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(index?: AccordionItemValue | AccordionItemValue[]): AccordionItemValue[] | undefined {\n if (index === undefined) {\n return undefined;\n }\n return Array.isArray(index) ? index : [index];\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,qBAAqB,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ,2BAA2B;AAGzG,SAASC,uBAAuB,QAAQ,yBAAyB;AAEjE;;;;;AAKA,OAAO,MAAMC,qBAAqB,GAAG,CAACC,KAAqB,EAAEC,GAA2B,KAAoB;EAC1G,MAAM;IACJC,SAAS,EAAEC,mBAAmB;IAC9BC,gBAAgB;IAChBC,QAAQ,GAAG,KAAK;IAChBC,WAAW,GAAG,KAAK;IACnBC,QAAQ;IACRC;EAAU,CACX,GAAGR,KAAK;EACT,MAAM,CAACE,SAAS,EAAEO,YAAY,CAAC,GAAGb,oBAAoB,CAAC;IACrDc,KAAK,EAAEhB,KAAK,CAACiB,OAAO,CAAC,MAAMC,eAAe,CAACT,mBAAmB,CAAC,EAAE,CAACA,mBAAmB,CAAC,CAAC;IACvFU,YAAY,EAAE,MAAMC,+BAA+B,CAAC;MAAEV,gBAAgB;MAAEC;IAAQ,CAAE,CAAC;IACnFU,YAAY,EAAE;GACf,CAAC;EAEF,MAAMC,oBAAoB,GAAGlB,uBAAuB,CAAC;IACnDmB,QAAQ,EAAET,UAAU,KAAK,UAAU;IACnCU,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMC,aAAa,GAAGtB,gBAAgB,CAAC,CAACuB,KAA2B,EAAEC,IAAyB,KAAI;IAChGd,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGa,KAAK,EA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G,CAACkB,KAAK,CAAC;;EAErE,OAAOF,iBAAiB;AAC1B;AAEA;;;AAGA,SAASV,eAAe,CAACuB,KAAiD;EACxE,IAAIA,KAAK,KAAKR,SAAS,EAAE;IACvB,OAAOA,SAAS;;EAElB,OAAOC,KAAK,CAACC,OAAO,CAACM,KAAK,CAAC,GAAGA,KAAK,GAAG,CAACA,KAAK,CAAC;AAC/C","names":["React","getNativeElementProps","useControllableState","useEventCallback","useArrowNavigationGroup","useAccordion_unstable","props","ref","openItems","controlledOpenItems","defaultOpenItems","multiple","collapsible","onToggle","navigation","setOpenItems","state","useMemo","normalizeValues","defaultState","initializeUncontrolledOpenItems","initialState","arrowNavigationProps","circular","tabbable","requestToggle","event","data","previousOpenItems","updateOpenItems","value","components","root","undefined","Array","isArray","includes","length","filter","i","sort","index"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/Accordion/useAccordion.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { AccordionProps, AccordionState, AccordionToggleData, AccordionToggleEvent } from './Accordion.types';\nimport type { AccordionItemValue } from '../AccordionItem/AccordionItem.types';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\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 = (props: AccordionProps, ref: React.Ref<HTMLElement>): AccordionState => {\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((event: AccordionToggleEvent, data: AccordionToggleData) => {\n onToggle?.(event, data);\n setOpenItems(previousOpenItems => updateOpenItems(data.value, previousOpenItems, multiple, collapsible));\n });\n\n return {\n collapsible,\n navigation,\n openItems,\n requestToggle,\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ...props,\n ...(navigation ? arrowNavigationProps : {}),\n ref,\n }),\n };\n};\n\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */\nfunction initializeUncontrolledOpenItems({\n defaultOpenItems,\n multiple,\n}: Pick<AccordionProps, 'defaultOpenItems' | 'multiple'>): AccordionItemValue[] {\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(\n value: AccordionItemValue,\n previousOpenItems: AccordionItemValue[],\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(index?: AccordionItemValue | AccordionItemValue[]): AccordionItemValue[] | undefined {\n if (index === undefined) {\n return undefined;\n }\n return Array.isArray(index) ? index : [index];\n}\n"]}
@@ -4,8 +4,8 @@ export function useAccordionContextValues_unstable(state) {
4
4
  openItems,
5
5
  requestToggle,
6
6
  collapsible
7
- } = state; // This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
8
-
7
+ } = state;
8
+ // This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
9
9
  const accordion = {
10
10
  navigation,
11
11
  openItems,
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/Accordion/useAccordionContextValues.ts"],"names":[],"mappings":"AAEA,OAAM,SAAU,kCAAV,CAA6C,KAA7C,EAAkE;EACtE,MAAM;IAAE,UAAF;IAAc,SAAd;IAAyB,aAAzB;IAAwC;EAAxC,IAAwD,KAA9D,CADsE,CAGtE;;EACA,MAAM,SAAS,GAA0B;IACvC,UADuC;IAEvC,SAFuC;IAGvC,aAHuC;IAIvC;EAJuC,CAAzC;EAOA,OAAO;IAAE;EAAF,CAAP;AACD","sourcesContent":["import type { AccordionContextValue, AccordionContextValues, AccordionState } from './Accordion.types';\n\nexport function useAccordionContextValues_unstable(state: AccordionState): AccordionContextValues {\n const { navigation, openItems, requestToggle, collapsible } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const accordion: AccordionContextValue = {\n navigation,\n openItems,\n requestToggle,\n collapsible,\n };\n\n return { accordion };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAEA,OAAM,SAAUA,kCAAkC,CAACC,KAAqB;EACtE,MAAM;IAAEC,UAAU;IAAEC,SAAS;IAAEC,aAAa;IAAEC;EAAW,CAAE,GAAGJ,KAAK;EAEnE;EACA,MAAMK,SAAS,GAA0B;IACvCJ,UAAU;IACVC,SAAS;IACTC,aAAa;IACbC;GACD;EAED,OAAO;IAAEC;EAAS,CAAE;AACtB","names":["useAccordionContextValues_unstable","state","navigation","openItems","requestToggle","collapsible","accordion"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/Accordion/useAccordionContextValues.ts"],"sourcesContent":["import type { AccordionContextValue, AccordionContextValues, AccordionState } from './Accordion.types';\n\nexport function useAccordionContextValues_unstable(state: AccordionState): AccordionContextValues {\n const { navigation, openItems, requestToggle, collapsible } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const accordion: AccordionContextValue = {\n navigation,\n openItems,\n requestToggle,\n collapsible,\n };\n\n return { accordion };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/Accordion/useAccordionStyles.ts"],"names":[],"mappings":"AACA,SAAS,YAAT,QAA6B,gBAA7B;AAGA,OAAO,MAAM,mBAAmB,GAAmC;EACjE,IAAI,EAAE;AAD2D,CAA5D;AAIP,OAAO,MAAM,2BAA2B,GAAI,KAAD,IAA0B;EACnE,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,mBAAmB,CAAC,IAArB,EAA2B,KAAK,CAAC,IAAN,CAAW,SAAtC,CAAnC;EAEA,OAAO,KAAP;AACD,CAJM","sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { mergeClasses } from '@griffel/react';\nimport type { AccordionSlots, AccordionState } from './Accordion.types';\n\nexport const accordionClassNames: SlotClassNames<AccordionSlots> = {\n root: 'fui-Accordion',\n};\n\nexport const useAccordionStyles_unstable = (state: AccordionState) => {\n state.root.className = mergeClasses(accordionClassNames.root, state.root.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,SAASA,YAAY,QAAQ,gBAAgB;AAG7C,OAAO,MAAMC,mBAAmB,GAAmC;EACjEC,IAAI,EAAE;CACP;AAED,OAAO,MAAMC,2BAA2B,GAAIC,KAAqB,IAAI;EACnEA,KAAK,CAACF,IAAI,CAACG,SAAS,GAAGL,YAAY,CAACC,mBAAmB,CAACC,IAAI,EAAEE,KAAK,CAACF,IAAI,CAACG,SAAS,CAAC;EAEnF,OAAOD,KAAK;AACd,CAAC","names":["mergeClasses","accordionClassNames","root","useAccordionStyles_unstable","state","className"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/Accordion/useAccordionStyles.ts"],"sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { mergeClasses } from '@griffel/react';\nimport type { AccordionSlots, AccordionState } from './Accordion.types';\n\nexport const accordionClassNames: SlotClassNames<AccordionSlots> = {\n root: 'fui-Accordion',\n};\n\nexport const useAccordionStyles_unstable = (state: AccordionState) => {\n state.root.className = mergeClasses(accordionClassNames.root, state.root.className);\n\n return state;\n};\n"]}
@@ -7,7 +7,6 @@ import { useAccordionHeaderContextValues_unstable } from './useAccordionHeaderCo
7
7
  * Define a styled AccordionHeader, using the `useAccordionHeader_unstable` and `useAccordionHeaderStyles_unstable`
8
8
  * hooks.
9
9
  */
10
-
11
10
  export const AccordionHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
12
11
  const state = useAccordionHeader_unstable(props, ref);
13
12
  const contextValues = useAccordionHeaderContextValues_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/AccordionHeader/AccordionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,2BAAT,QAA4C,sBAA5C;AACA,SAAS,8BAAT,QAA+C,yBAA/C;AACA,SAAS,iCAAT,QAAkD,4BAAlD;AACA,SAAS,wCAAT,QAAyD,mCAAzD;AAIA;;;AAGG;;AACH,OAAO,MAAM,eAAe,gBAA8C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACxG,MAAM,KAAK,GAAG,2BAA2B,CAAC,KAAD,EAAQ,GAAR,CAAzC;EACA,MAAM,aAAa,GAAG,wCAAwC,CAAC,KAAD,CAA9D;EAEA,iCAAiC,CAAC,KAAD,CAAjC;EAEA,OAAO,8BAA8B,CAAC,KAAD,EAAQ,aAAR,CAArC;AACD,CAPyE,CAAnE;AASP,eAAe,CAAC,WAAhB,GAA8B,iBAA9B","sourcesContent":["import * as React from 'react';\nimport { useAccordionHeader_unstable } from './useAccordionHeader';\nimport { renderAccordionHeader_unstable } from './renderAccordionHeader';\nimport { useAccordionHeaderStyles_unstable } from './useAccordionHeaderStyles';\nimport { useAccordionHeaderContextValues_unstable } from './useAccordionHeaderContextValues';\nimport type { AccordionHeaderProps } from './AccordionHeader.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled AccordionHeader, using the `useAccordionHeader_unstable` and `useAccordionHeaderStyles_unstable`\n * hooks.\n */\nexport const AccordionHeader: ForwardRefComponent<AccordionHeaderProps> = React.forwardRef((props, ref) => {\n const state = useAccordionHeader_unstable(props, ref);\n const contextValues = useAccordionHeaderContextValues_unstable(state);\n\n useAccordionHeaderStyles_unstable(state);\n\n return renderAccordionHeader_unstable(state, contextValues);\n});\n\nAccordionHeader.displayName = 'AccordionHeader';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,2BAA2B,QAAQ,sBAAsB;AAClE,SAASC,8BAA8B,QAAQ,yBAAyB;AACxE,SAASC,iCAAiC,QAAQ,4BAA4B;AAC9E,SAASC,wCAAwC,QAAQ,mCAAmC;AAI5F;;;;AAIA,OAAO,MAAMC,eAAe,gBAA8CL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACxG,MAAMC,KAAK,GAAGR,2BAA2B,CAACM,KAAK,EAAEC,GAAG,CAAC;EACrD,MAAME,aAAa,GAAGN,wCAAwC,CAACK,KAAK,CAAC;EAErEN,iCAAiC,CAACM,KAAK,CAAC;EAExC,OAAOP,8BAA8B,CAACO,KAAK,EAAEC,aAAa,CAAC;AAC7D,CAAC,CAAC;AAEFL,eAAe,CAACM,WAAW,GAAG,iBAAiB","names":["React","useAccordionHeader_unstable","renderAccordionHeader_unstable","useAccordionHeaderStyles_unstable","useAccordionHeaderContextValues_unstable","AccordionHeader","forwardRef","props","ref","state","contextValues","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/AccordionHeader/AccordionHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAccordionHeader_unstable } from './useAccordionHeader';\nimport { renderAccordionHeader_unstable } from './renderAccordionHeader';\nimport { useAccordionHeaderStyles_unstable } from './useAccordionHeaderStyles';\nimport { useAccordionHeaderContextValues_unstable } from './useAccordionHeaderContextValues';\nimport type { AccordionHeaderProps } from './AccordionHeader.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled AccordionHeader, using the `useAccordionHeader_unstable` and `useAccordionHeaderStyles_unstable`\n * hooks.\n */\nexport const AccordionHeader: ForwardRefComponent<AccordionHeaderProps> = React.forwardRef((props, ref) => {\n const state = useAccordionHeader_unstable(props, ref);\n const contextValues = useAccordionHeaderContextValues_unstable(state);\n\n useAccordionHeaderStyles_unstable(state);\n\n return renderAccordionHeader_unstable(state, contextValues);\n});\n\nAccordionHeader.displayName = 'AccordionHeader';\n"]}
@@ -8,7 +8,6 @@ const accordionHeaderContextDefaultValue = {
8
8
  };
9
9
  export const useAccordionHeaderContext = () => {
10
10
  var _a;
11
-
12
11
  return (_a = React.useContext(AccordionHeaderContext)) !== null && _a !== void 0 ? _a : accordionHeaderContextDefaultValue;
13
12
  };
14
13
  //# sourceMappingURL=AccordionHeaderContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/AccordionHeader/AccordionHeaderContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,OAAO,MAAM,sBAAsB,gBAAG,KAAK,CAAC,aAAN,CAA6D,SAA7D,CAA/B;AAEP,MAAM,kCAAkC,GAAG;EACzC,IAAI,EAAE,KADmC;EAEzC,QAAQ,EAAE,KAF+B;EAGzC,IAAI,EAAE,QAHmC;EAIzC,kBAAkB,EAAE;AAJqB,CAA3C;AAOA,OAAO,MAAM,yBAAyB,GAAG,MAAK;EAAA,IAAA,EAAA;;EAC5C,OAAA,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,sBAAjB,CAAA,MAAwC,IAAxC,IAAwC,EAAA,KAAA,KAAA,CAAxC,GAAwC,EAAxC,GAA4C,kCAA5C;AAA8E,CADzE","sourcesContent":["import * as React from 'react';\nimport type { AccordionHeaderContextValue } from './AccordionHeader.types';\n\nexport const AccordionHeaderContext = React.createContext<AccordionHeaderContextValue | undefined>(undefined);\n\nconst accordionHeaderContextDefaultValue = {\n open: false,\n disabled: false,\n size: 'medium',\n expandIconPosition: 'start',\n};\n\nexport const useAccordionHeaderContext = () =>\n React.useContext(AccordionHeaderContext) ?? accordionHeaderContextDefaultValue;\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,OAAO,MAAMC,sBAAsB,gBAAGD,KAAK,CAACE,aAAa,CAA0CC,SAAS,CAAC;AAE7G,MAAMC,kCAAkC,GAAG;EACzCC,IAAI,EAAE,KAAK;EACXC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE,QAAQ;EACdC,kBAAkB,EAAE;CACrB;AAED,OAAO,MAAMC,yBAAyB,GAAG,MAAK;EAAA;EAC5C,kBAAK,CAACC,UAAU,CAACT,sBAAsB,CAAC,mCAAIG,kCAAkC;AAAA","names":["React","AccordionHeaderContext","createContext","undefined","accordionHeaderContextDefaultValue","open","disabled","size","expandIconPosition","useAccordionHeaderContext","useContext"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/AccordionHeader/AccordionHeaderContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { AccordionHeaderContextValue } from './AccordionHeader.types';\n\nexport const AccordionHeaderContext = React.createContext<AccordionHeaderContextValue | undefined>(undefined);\n\nconst accordionHeaderContextDefaultValue = {\n open: false,\n disabled: false,\n size: 'medium',\n expandIconPosition: 'start',\n};\n\nexport const useAccordionHeaderContext = () =>\n React.useContext(AccordionHeaderContext) ?? accordionHeaderContextDefaultValue;\n"]}
@@ -4,7 +4,6 @@ import { AccordionHeaderContext } from './AccordionHeaderContext';
4
4
  /**
5
5
  * Function that renders the final JSX of the component
6
6
  */
7
-
8
7
  export const renderAccordionHeader_unstable = (state, contextValues) => {
9
8
  const {
10
9
  slots,
@@ -12,11 +11,16 @@ export const renderAccordionHeader_unstable = (state, contextValues) => {
12
11
  } = getSlots(state);
13
12
  return /*#__PURE__*/React.createElement(AccordionHeaderContext.Provider, {
14
13
  value: contextValues.accordionHeader
15
- }, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
16
- }, /*#__PURE__*/React.createElement(slots.button, { ...slotProps.button
17
- }, state.expandIconPosition === 'start' && /*#__PURE__*/React.createElement(slots.expandIcon, { ...slotProps.expandIcon
18
- }), slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
19
- }), slotProps.root.children, state.expandIconPosition === 'end' && /*#__PURE__*/React.createElement(slots.expandIcon, { ...slotProps.expandIcon
14
+ }, /*#__PURE__*/React.createElement(slots.root, {
15
+ ...slotProps.root
16
+ }, /*#__PURE__*/React.createElement(slots.button, {
17
+ ...slotProps.button
18
+ }, state.expandIconPosition === 'start' && /*#__PURE__*/React.createElement(slots.expandIcon, {
19
+ ...slotProps.expandIcon
20
+ }), slots.icon && /*#__PURE__*/React.createElement(slots.icon, {
21
+ ...slotProps.icon
22
+ }), slotProps.root.children, state.expandIconPosition === 'end' && /*#__PURE__*/React.createElement(slots.expandIcon, {
23
+ ...slotProps.expandIcon
20
24
  }))));
21
25
  };
22
26
  //# sourceMappingURL=renderAccordionHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/AccordionHeader/renderAccordionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,sBAAT,QAAuC,0BAAvC;AAGA;;AAEG;;AACH,OAAO,MAAM,8BAA8B,GAAG,CAC5C,KAD4C,EAE5C,aAF4C,KAG1C;EACF,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAuB,KAAvB,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,sBAAsB,CAAC,QAAxB,EAAgC;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAAhC,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;EAAf,CAAb,EACG,KAAK,CAAC,kBAAN,KAA6B,OAA7B,iBAAwC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAjB,CAD3C,EAEG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAFjB,EAGG,SAAS,CAAC,IAAV,CAAe,QAHlB,EAIG,KAAK,CAAC,kBAAN,KAA6B,KAA7B,iBAAsC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAjB,CAJzC,CADF,CADF,CADF;AAYD,CAlBM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { AccordionHeaderContext } from './AccordionHeaderContext';\nimport type { AccordionHeaderState, AccordionHeaderSlots, AccordionHeaderContextValues } from './AccordionHeader.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderAccordionHeader_unstable = (\n state: AccordionHeaderState,\n contextValues: AccordionHeaderContextValues,\n) => {\n const { slots, slotProps } = getSlots<AccordionHeaderSlots>(state);\n\n return (\n <AccordionHeaderContext.Provider value={contextValues.accordionHeader}>\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button}>\n {state.expandIconPosition === 'start' && <slots.expandIcon {...slotProps.expandIcon} />}\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slotProps.root.children}\n {state.expandIconPosition === 'end' && <slots.expandIcon {...slotProps.expandIcon} />}\n </slots.button>\n </slots.root>\n </AccordionHeaderContext.Provider>\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,sBAAsB,QAAQ,0BAA0B;AAGjE;;;AAGA,OAAO,MAAMC,8BAA8B,GAAG,CAC5CC,KAA2B,EAC3BC,aAA2C,KACzC;EACF,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGN,QAAQ,CAAuBG,KAAK,CAAC;EAElE,oBACEJ,oBAACE,sBAAsB,CAACM,QAAQ;IAACC,KAAK,EAAEJ,aAAa,CAACK;EAAe,gBACnEV,oBAACM,KAAK,CAACK,IAAI;IAAA,GAAKJ,SAAS,CAACI;EAAI,gBAC5BX,oBAACM,KAAK,CAACM,MAAM;IAAA,GAAKL,SAAS,CAACK;EAAM,GAC/BR,KAAK,CAACS,kBAAkB,KAAK,OAAO,iBAAIb,oBAACM,KAAK,CAACQ,UAAU;IAAA,GAAKP,SAAS,CAACO;EAAU,EAAI,EACtFR,KAAK,CAACS,IAAI,iBAAIf,oBAACM,KAAK,CAACS,IAAI;IAAA,GAAKR,SAAS,CAACQ;EAAI,EAAI,EAChDR,SAAS,CAACI,IAAI,CAACK,QAAQ,EACvBZ,KAAK,CAACS,kBAAkB,KAAK,KAAK,iBAAIb,oBAACM,KAAK,CAACQ,UAAU;IAAA,GAAKP,SAAS,CAACO;EAAU,EAAI,CACxE,CACJ,CACmB;AAEtC,CAAC","names":["React","getSlots","AccordionHeaderContext","renderAccordionHeader_unstable","state","contextValues","slots","slotProps","Provider","value","accordionHeader","root","button","expandIconPosition","expandIcon","icon","children"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/AccordionHeader/renderAccordionHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { AccordionHeaderContext } from './AccordionHeaderContext';\nimport type { AccordionHeaderState, AccordionHeaderSlots, AccordionHeaderContextValues } from './AccordionHeader.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderAccordionHeader_unstable = (\n state: AccordionHeaderState,\n contextValues: AccordionHeaderContextValues,\n) => {\n const { slots, slotProps } = getSlots<AccordionHeaderSlots>(state);\n\n return (\n <AccordionHeaderContext.Provider value={contextValues.accordionHeader}>\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button}>\n {state.expandIconPosition === 'start' && <slots.expandIcon {...slotProps.expandIcon} />}\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slotProps.root.children}\n {state.expandIconPosition === 'end' && <slots.expandIcon {...slotProps.expandIcon} />}\n </slots.button>\n </slots.root>\n </AccordionHeaderContext.Provider>\n );\n};\n"]}
@@ -10,7 +10,6 @@ import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts
10
10
  * @param props - AccordionHeader properties
11
11
  * @param ref - reference to root HTMLElement of AccordionHeader
12
12
  */
13
-
14
13
  export const useAccordionHeader_unstable = (props, ref) => {
15
14
  const {
16
15
  as,
@@ -30,14 +29,12 @@ export const useAccordionHeader_unstable = (props, ref) => {
30
29
  * force disabled state on button if accordion isn't collapsible
31
30
  * and this is the only item opened
32
31
  */
33
-
34
32
  const disabledFocusable = useAccordionContext_unstable(ctx => !ctx.collapsible && ctx.openItems.length === 1 && open);
35
33
  const {
36
34
  dir
37
- } = useFluent(); // Calculate how to rotate the expand icon [>] (ChevronRightRegular)
38
-
35
+ } = useFluent();
36
+ // Calculate how to rotate the expand icon [>] (ChevronRightRegular)
39
37
  let expandIconRotation;
40
-
41
38
  if (expandIconPosition === 'end') {
42
39
  // If expand icon is at the end, the chevron points up [^] when open, and down [v] when closed
43
40
  expandIconRotation = open ? -90 : 90;
@@ -45,7 +42,6 @@ export const useAccordionHeader_unstable = (props, ref) => {
45
42
  // Otherwise, the chevron points down [v] when open, and right [>] (or left [<] in RTL) when closed
46
43
  expandIconRotation = open ? 90 : dir !== 'rtl' ? 0 : 180;
47
44
  }
48
-
49
45
  const buttonShorthand = useARIAButtonShorthand(button, {
50
46
  required: true,
51
47
  defaultProps: {
@@ -83,12 +79,11 @@ export const useAccordionHeader_unstable = (props, ref) => {
83
79
  'aria-hidden': true
84
80
  }
85
81
  }),
86
- button: { ...buttonShorthand,
82
+ button: {
83
+ ...buttonShorthand,
87
84
  onClick: useEventCallback(ev => {
88
85
  var _a;
89
-
90
86
  (_a = buttonShorthand.onClick) === null || _a === void 0 ? void 0 : _a.call(buttonShorthand, ev);
91
-
92
87
  if (!ev.defaultPrevented) {
93
88
  onAccordionHeaderClick(ev);
94
89
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/AccordionHeader/useAccordionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,qBAAT,EAAgC,gBAAhC,EAAkD,gBAAlD,QAA0E,2BAA1E;AACA,SAAS,gCAAT,QAAiD,wBAAjD;AACA,SAAS,sBAAT,QAAuC,sBAAvC;AAEA,SAAS,4BAAT,QAA6C,+BAA7C;AACA,SAAS,mBAAT,QAAoC,uBAApC;AACA,SAAS,kBAAkB,IAAI,SAA/B,QAAgD,iCAAhD;AAEA;;;;AAIG;;AACH,OAAO,MAAM,2BAA2B,GAAG,CACzC,KADyC,EAEzC,GAFyC,KAGjB;EACxB,MAAM;IAAE,EAAF;IAAM,IAAN;IAAY,MAAZ;IAAoB,UAApB;IAAgC,MAAM,GAAG,KAAzC;IAAgD,IAAI,GAAG,QAAvD;IAAiE,kBAAkB,GAAG;EAAtF,IAAkG,KAAxG;EACA,MAAM;IAAE,aAAa,EAAE,sBAAjB;IAAyC,QAAzC;IAAmD;EAAnD,IAA4D,gCAAgC,EAAlG;EAEA;;;AAGG;;EACH,MAAM,iBAAiB,GAAG,4BAA4B,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,WAAL,IAAoB,GAAG,CAAC,SAAJ,CAAc,M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AA,eAAe,CAAC,OAAhB,MAAuB,IAAvB,IAAuB,EAAA,KAAA,KAAA,CAAvB,GAAuB,KAAA,CAAvB,GAAuB,EAAA,CAAA,IAAA,CAAvB,eAAuB,EAAG,EAAH,CAAvB;;QACA,IAAI,CAAC,EAAE,CAAC,gBAAR,EAA0B;UACxB,sBAAsB,CAAC,EAAD,CAAtB;QACD;MACF,CANsB;IAFnB;EAxBH,CAAP;AAoCD,CAvEM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback } from '@fluentui/react-utilities';\nimport { useAccordionItemContext_unstable } from '../AccordionItem/index';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport type { AccordionHeaderProps, AccordionHeaderState } from './AccordionHeader.types';\nimport { useAccordionContext_unstable } from '../Accordion/AccordionContext';\nimport { ChevronRightRegular } from '@fluentui/react-icons';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\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 { onHeaderClick: onAccordionHeaderClick, disabled, open } = useAccordionItemContext_unstable();\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 const buttonShorthand = useARIAButtonShorthand(button, {\n required: true,\n defaultProps: {\n disabled,\n disabledFocusable,\n 'aria-expanded': open,\n type: 'button',\n },\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: getNativeElementProps(as || 'div', {\n ref,\n ...props,\n }),\n icon: resolveShorthand(icon),\n expandIcon: resolveShorthand(expandIcon, {\n required: true,\n defaultProps: {\n children: <ChevronRightRegular style={{ transform: `rotate(${expandIconRotation}deg)` }} />,\n 'aria-hidden': true,\n },\n }),\n button: {\n ...buttonShorthand,\n onClick: useEventCallback(\n (ev: React.MouseEvent<HTMLButtonElement & HTMLDivElement & HTMLSpanElement & HTMLAnchorElement>) => {\n buttonShorthand.onClick?.(ev);\n if (!ev.defaultPrevented) {\n onAccordionHeaderClick(ev);\n }\n },\n ),\n },\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,2BAA2B;AACrG,SAASC,gCAAgC,QAAQ,wBAAwB;AACzE,SAASC,sBAAsB,QAAQ,sBAAsB;AAE7D,SAASC,4BAA4B,QAAQ,+BAA+B;AAC5E,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,kBAAkB,IAAIC,SAAS,QAAQ,iCAAiC;AAEjF;;;;;AAKA,OAAO,MAAMC,2BAA2B,GAAG,CACzCC,KAA2B,EAC3BC,GAA2B,KACH;EACxB,MAAM;IAAEC,EAAE;IAAEC,IAAI;IAAEC,MAAM;IAAEC,UAAU;IAAEC,MAAM,GAAG,KAAK;IAAEC,IAAI,GAAG,QAAQ;IAAEC,kBAAkB,GAAG;EAAO,CAAE,GAAGR,KAAK;EAC7G,MAAM;IAAES,aAAa,EAAEC,sBAAsB;IAAEC,QAAQ;IA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a,EAAE;;KAElB,CAAC;IACFf,MAAM,EAAE;MACN,GAAGgB,eAAe;MAClBS,OAAO,EAAErC,gBAAgB,CACtBsC,EAA8F,IAAI;;QACjG,qBAAe,CAACD,OAAO,+CAAvBT,eAAe,EAAWU,EAAE,CAAC;QAC7B,IAAI,CAACA,EAAE,CAACC,gBAAgB,EAAE;UACxBrB,sBAAsB,CAACoB,EAAE,CAAC;;MAE9B,CAAC;;GAGN;AACH,CAAC","names":["React","getNativeElementProps","resolveShorthand","useEventCallback","useAccordionItemContext_unstable","useARIAButtonShorthand","useAccordionContext_unstable","ChevronRightRegular","useFluent_unstable","useFluent","useAccordionHeader_unstable","props","ref","as","icon","button","expandIcon","inline","size","expandIconPosition","onHeaderClick","onAccordionHeaderClick","disabled","open","disabledFocusable","ctx","collapsible","openItems","length","dir","expandIconRotation","buttonShorthand","required","defaultProps","type","components","root","children","style","transform","onClick","ev","defaultPrevented"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/AccordionHeader/useAccordionHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback } from '@fluentui/react-utilities';\nimport { useAccordionItemContext_unstable } from '../AccordionItem/index';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport type { AccordionHeaderProps, AccordionHeaderState } from './AccordionHeader.types';\nimport { useAccordionContext_unstable } from '../Accordion/AccordionContext';\nimport { ChevronRightRegular } from '@fluentui/react-icons';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\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 { onHeaderClick: onAccordionHeaderClick, disabled, open } = useAccordionItemContext_unstable();\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 const buttonShorthand = useARIAButtonShorthand(button, {\n required: true,\n defaultProps: {\n disabled,\n disabledFocusable,\n 'aria-expanded': open,\n type: 'button',\n },\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: getNativeElementProps(as || 'div', {\n ref,\n ...props,\n }),\n icon: resolveShorthand(icon),\n expandIcon: resolveShorthand(expandIcon, {\n required: true,\n defaultProps: {\n children: <ChevronRightRegular style={{ transform: `rotate(${expandIconRotation}deg)` }} />,\n 'aria-hidden': true,\n },\n }),\n button: {\n ...buttonShorthand,\n onClick: useEventCallback(\n (ev: React.MouseEvent<HTMLButtonElement & HTMLDivElement & HTMLSpanElement & HTMLAnchorElement>) => {\n buttonShorthand.onClick?.(ev);\n if (!ev.defaultPrevented) {\n onAccordionHeaderClick(ev);\n }\n },\n ),\n },\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-accordion/src/components/AccordionHeader/useAccordionHeaderContextValues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAOA,OAAM,SAAU,wCAAV,CAAmD,KAAnD,EAA8E;EAClF,MAAM;IAAE,QAAF;IAAY,kBAAZ;IAAgC,IAAhC;IAAsC;EAAtC,IAA+C,KAArD;EAEA,MAAM,eAAe,GAAG,KAAK,CAAC,OAAN,CACtB,OAAO;IACL,QADK;IAEL,kBAFK;IAGL,IAHK;IAIL;EAJK,CAAP,CADsB,EAOtB,CAAC,QAAD,EAAW,kBAAX,EAA+B,IAA/B,EAAqC,IAArC,CAPsB,CAAxB;EAUA,OAAO;IAAE;EAAF,CAAP;AACD","sourcesContent":["import * as React from 'react';\nimport type {\n AccordionHeaderContextValue,\n AccordionHeaderState,\n AccordionHeaderContextValues,\n} from './AccordionHeader.types';\n\nexport function useAccordionHeaderContextValues_unstable(state: AccordionHeaderState): AccordionHeaderContextValues {\n const { disabled, expandIconPosition, open, size } = state;\n\n const accordionHeader = React.useMemo<AccordionHeaderContextValue>(\n () => ({\n disabled,\n expandIconPosition,\n open,\n size,\n }),\n [disabled, expandIconPosition, open, size],\n );\n\n return { accordionHeader };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAO9B,OAAM,SAAUC,wCAAwC,CAACC,KAA2B;EAClF,MAAM;IAAEC,QAAQ;IAAEC,kBAAkB;IAAEC,IAAI;IAAEC;EAAI,CAAE,GAAGJ,KAAK;EAE1D,MAAMK,eAAe,GAAGP,KAAK,CAACQ,OAAO,CACnC,OAAO;IACLL,QAAQ;IACRC,kBAAkB;IAClBC,IAAI;IACJC;GACD,CAAC,EACF,CAACH,QAAQ,EAAEC,kBAAkB,EAAEC,IAAI,EAAEC,IAAI,CAAC,CAC3C;EAED,OAAO;IAAEC;EAAe,CAAE;AAC5B","names":["React","useAccordionHeaderContextValues_unstable","state","disabled","expandIconPosition","open","size","accordionHeader","useMemo"],"sourceRoot":"../src/","sources":["packages/react-components/react-accordion/src/components/AccordionHeader/useAccordionHeaderContextValues.ts"],"sourcesContent":["import * as React from 'react';\nimport type {\n AccordionHeaderContextValue,\n AccordionHeaderState,\n AccordionHeaderContextValues,\n} from './AccordionHeader.types';\n\nexport function useAccordionHeaderContextValues_unstable(state: AccordionHeaderState): AccordionHeaderContextValues {\n const { disabled, expandIconPosition, open, size } = state;\n\n const accordionHeader = React.useMemo<AccordionHeaderContextValue>(\n () => ({\n disabled,\n expandIconPosition,\n open,\n size,\n }),\n [disabled, expandIconPosition, open, size],\n );\n\n return { accordionHeader };\n}\n"]}