@cdx-ui/components 0.2.3 → 0.2.4

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 (248) hide show
  1. package/AGENTS.md +24 -0
  2. package/README.md +2 -0
  3. package/coverage.svg +1 -1
  4. package/docs/components/accordion/content.md +538 -0
  5. package/docs/components/alert/content.md +203 -0
  6. package/docs/components/alert-dialog/content.md +319 -0
  7. package/docs/components/avatar/content.md +368 -0
  8. package/docs/components/avatar/design.md +202 -0
  9. package/docs/components/badge/content.md +235 -0
  10. package/docs/components/bottom-sheet/content.md +351 -0
  11. package/docs/components/bottom-sheet/design.md +249 -0
  12. package/docs/components/breadcrumbs/content.md +169 -0
  13. package/docs/components/button/content.md +398 -0
  14. package/docs/components/button/design.md +258 -0
  15. package/docs/components/calendar/content.md +137 -0
  16. package/docs/components/card/content.md +283 -0
  17. package/docs/components/carousel/content.md +416 -0
  18. package/docs/components/checkbox/content.md +236 -0
  19. package/docs/components/checkbox/design.md +214 -0
  20. package/docs/components/chip/content.md +439 -0
  21. package/docs/components/chip/design.md +418 -0
  22. package/docs/components/color-area/content.md +86 -0
  23. package/docs/components/color-field/content.md +134 -0
  24. package/docs/components/color-picker/content.md +208 -0
  25. package/docs/components/color-slider/content.md +120 -0
  26. package/docs/components/color-swatch/content.md +64 -0
  27. package/docs/components/color-swatch-picker/content.md +126 -0
  28. package/docs/components/content.md +97 -0
  29. package/docs/components/currency-input/content.md +205 -0
  30. package/docs/components/data-grid/content.md +522 -0
  31. package/docs/components/date-field/content.md +147 -0
  32. package/docs/components/date-picker/content.md +360 -0
  33. package/docs/components/date-range-picker/content.md +301 -0
  34. package/docs/components/date-time-field/content.md +157 -0
  35. package/docs/components/date-time-list/content.md +105 -0
  36. package/docs/components/date-time-picker/content.md +272 -0
  37. package/docs/components/dialog/content.md +436 -0
  38. package/docs/components/dialog/design.md +192 -0
  39. package/docs/components/divider/content.md +112 -0
  40. package/docs/components/drawer/content.md +436 -0
  41. package/docs/components/field/content.md +277 -0
  42. package/docs/components/form/content.md +62 -0
  43. package/docs/components/full-screen-dialog/content.md +881 -0
  44. package/docs/components/heading/content.md +55 -0
  45. package/docs/components/icon/content.md +190 -0
  46. package/docs/components/icon-button/content.md +200 -0
  47. package/docs/components/icon-button/design.md +165 -0
  48. package/docs/components/image/content.md +104 -0
  49. package/docs/components/input/content.md +281 -0
  50. package/docs/components/input/design.md +389 -0
  51. package/docs/components/insurance-disclosure/content.md +103 -0
  52. package/docs/components/link/content.md +180 -0
  53. package/docs/components/link/design.md +160 -0
  54. package/docs/components/list-item/content.md +695 -0
  55. package/docs/components/menu/content.md +1247 -0
  56. package/docs/components/month-calendar/content.md +84 -0
  57. package/docs/components/month-picker/content.md +273 -0
  58. package/docs/components/otp-input/content.md +327 -0
  59. package/docs/components/progress-bar/content.md +87 -0
  60. package/docs/components/progress-circle/content.md +176 -0
  61. package/docs/components/progress-segmented/content.md +119 -0
  62. package/docs/components/quick-action-button/content.md +154 -0
  63. package/docs/components/quick-action-button/design.md +170 -0
  64. package/docs/components/radio/content.md +224 -0
  65. package/docs/components/range-calendar/content.md +123 -0
  66. package/docs/components/reorderable-list/content.md +309 -0
  67. package/docs/components/scoped-theme/content.md +47 -0
  68. package/docs/components/scroll-shadow/content.md +686 -0
  69. package/docs/components/select/content.md +400 -0
  70. package/docs/components/select/design.md +301 -0
  71. package/docs/components/skeleton/content.md +103 -0
  72. package/docs/components/slider/content.md +423 -0
  73. package/docs/components/stack/content.md +161 -0
  74. package/docs/components/switch/content.md +150 -0
  75. package/docs/components/switch/design.md +208 -0
  76. package/docs/components/table/content.md +548 -0
  77. package/docs/components/table-pagination/content.md +177 -0
  78. package/docs/components/tabs/content.md +292 -0
  79. package/docs/components/text/content.md +142 -0
  80. package/docs/components/textarea/content.md +222 -0
  81. package/docs/components/tile/content.md +703 -0
  82. package/docs/components/toast/content.md +456 -0
  83. package/docs/components/toggle-button/content.md +505 -0
  84. package/docs/components/tooltip/content.md +350 -0
  85. package/docs/components/virtualized-list/content.md +250 -0
  86. package/docs/foundations/content.md +9 -0
  87. package/docs/foundations/expressions/icons/content.md +19 -0
  88. package/docs/foundations/styles/tokens/all-tokens/content.md +192 -0
  89. package/docs/foundations/styles/tokens/what-are-tokens/content.md +33 -0
  90. package/docs/foundations/styles/tokens/what-are-tokens/design.md +33 -0
  91. package/docs/getting-started/content.md +4 -0
  92. package/docs/getting-started/designers/content.md +13 -0
  93. package/docs/getting-started/designers/design.md +13 -0
  94. package/docs/getting-started/developers/accessibility/content.md +31 -0
  95. package/docs/getting-started/developers/content.md +612 -0
  96. package/docs/getting-started/developers/styling/content.md +193 -0
  97. package/docs/llms.txt +193 -0
  98. package/docs/patterns/account-management/content.md +75 -0
  99. package/docs/patterns/authentication/content.md +52 -0
  100. package/docs/patterns/content.md +10 -0
  101. package/docs/patterns/dashboard/content.md +39 -0
  102. package/docs/patterns/empty-states/content.md +31 -0
  103. package/docs/patterns/forms/content.md +109 -0
  104. package/docs/patterns/onboarding/content.md +69 -0
  105. package/docs/patterns/payments/content.md +35 -0
  106. package/docs/patterns/settings/content.md +72 -0
  107. package/docs/resources/content.md +9 -0
  108. package/docs/resources/figma-libraries/content.md +42 -0
  109. package/docs/resources/release-notes/0.0.1-beta.118/content.md +27 -0
  110. package/docs/resources/release-notes/0.0.1-beta.122/content.md +21 -0
  111. package/docs/resources/release-notes/0.0.1-beta.124/content.md +16 -0
  112. package/docs/resources/release-notes/0.0.1-beta.126/content.md +10 -0
  113. package/docs/resources/release-notes/0.0.1-beta.127/content.md +14 -0
  114. package/docs/resources/release-notes/0.0.1-beta.128/content.md +9 -0
  115. package/docs/resources/release-notes/0.0.1-beta.129/content.md +18 -0
  116. package/docs/resources/release-notes/0.0.1-beta.130/content.md +18 -0
  117. package/docs/resources/release-notes/0.0.1-beta.133/content.md +7 -0
  118. package/docs/resources/release-notes/0.0.1-beta.134/content.md +17 -0
  119. package/docs/resources/release-notes/0.0.1-beta.136/content.md +7 -0
  120. package/docs/resources/release-notes/0.0.1-beta.137/content.md +10 -0
  121. package/docs/resources/release-notes/0.0.1-beta.138/content.md +7 -0
  122. package/docs/resources/release-notes/0.0.1-beta.139/content.md +13 -0
  123. package/docs/resources/release-notes/0.0.1-beta.140/content.md +26 -0
  124. package/docs/resources/release-notes/0.0.1-beta.141/content.md +63 -0
  125. package/docs/resources/release-notes/0.0.1-beta.142/content.md +7 -0
  126. package/docs/resources/release-notes/0.0.1-beta.143/content.md +12 -0
  127. package/docs/resources/release-notes/0.0.1-beta.144/content.md +7 -0
  128. package/docs/resources/release-notes/0.0.1-beta.145/content.md +7 -0
  129. package/docs/resources/release-notes/0.0.1-beta.147/content.md +10 -0
  130. package/docs/resources/release-notes/0.0.1-beta.149/content.md +10 -0
  131. package/docs/resources/release-notes/0.0.1-beta.150/content.md +13 -0
  132. package/docs/resources/release-notes/0.0.1-beta.152/content.md +7 -0
  133. package/docs/resources/release-notes/0.0.1-beta.154/content.md +15 -0
  134. package/docs/resources/release-notes/0.0.1-beta.156/content.md +7 -0
  135. package/docs/resources/release-notes/0.0.1-beta.158/content.md +9 -0
  136. package/docs/resources/release-notes/0.0.1-beta.159/content.md +11 -0
  137. package/docs/resources/release-notes/0.0.1-beta.160/content.md +7 -0
  138. package/docs/resources/release-notes/0.0.1-beta.161/content.md +7 -0
  139. package/docs/resources/release-notes/0.0.1-beta.163/content.md +7 -0
  140. package/docs/resources/release-notes/0.0.1-beta.164/content.md +9 -0
  141. package/docs/resources/release-notes/0.0.1-beta.166/content.md +17 -0
  142. package/docs/resources/release-notes/0.0.1-beta.167/content.md +7 -0
  143. package/docs/resources/release-notes/0.0.1-beta.168/content.md +7 -0
  144. package/docs/resources/release-notes/0.0.1-beta.169/content.md +7 -0
  145. package/docs/resources/release-notes/0.0.1-beta.171/content.md +16 -0
  146. package/docs/resources/release-notes/0.0.1-beta.172/content.md +24 -0
  147. package/docs/resources/release-notes/0.0.1-beta.173/content.md +15 -0
  148. package/docs/resources/release-notes/0.0.1-beta.174/content.md +7 -0
  149. package/docs/resources/release-notes/0.0.1-beta.176/content.md +32 -0
  150. package/docs/resources/release-notes/0.0.1-beta.179/content.md +11 -0
  151. package/docs/resources/release-notes/0.0.1-beta.182/content.md +13 -0
  152. package/docs/resources/release-notes/0.0.1-beta.185/content.md +7 -0
  153. package/docs/resources/release-notes/0.0.1-beta.187/content.md +27 -0
  154. package/docs/resources/release-notes/0.1.1/content.md +23 -0
  155. package/docs/resources/release-notes/0.1.2/content.md +7 -0
  156. package/docs/resources/release-notes/0.1.4/content.md +19 -0
  157. package/docs/resources/release-notes/0.1.5/content.md +7 -0
  158. package/docs/resources/release-notes/0.1.6/content.md +7 -0
  159. package/docs/resources/release-notes/0.2.0/content.md +31 -0
  160. package/docs/resources/release-notes/0.2.1/content.md +17 -0
  161. package/docs/resources/release-notes/0.2.2/content.md +11 -0
  162. package/docs/resources/release-notes/0.2.3/content.md +15 -0
  163. package/docs/resources/release-notes/content.md +64 -0
  164. package/lib/commonjs/components/DateTimeList/index.js +11 -26
  165. package/lib/commonjs/components/DateTimeList/index.js.map +1 -1
  166. package/lib/commonjs/components/DateTimeList/styles.js +2 -12
  167. package/lib/commonjs/components/DateTimeList/styles.js.map +1 -1
  168. package/lib/commonjs/components/ListItem/index.js.map +1 -1
  169. package/lib/commonjs/components/ListItem/styles.js +2 -1
  170. package/lib/commonjs/components/ListItem/styles.js.map +1 -1
  171. package/lib/commonjs/components/Menu/index.js +11 -5
  172. package/lib/commonjs/components/Menu/index.js.map +1 -1
  173. package/lib/commonjs/components/ScrollShadow/gradient.js +29 -0
  174. package/lib/commonjs/components/ScrollShadow/gradient.js.map +1 -0
  175. package/lib/commonjs/components/ScrollShadow/index.js +171 -44
  176. package/lib/commonjs/components/ScrollShadow/index.js.map +1 -1
  177. package/lib/commonjs/components/ScrollShadow/styles.js +58 -14
  178. package/lib/commonjs/components/ScrollShadow/styles.js.map +1 -1
  179. package/lib/commonjs/components/ScrollShadow/useComposedScrollHandler.js +63 -0
  180. package/lib/commonjs/components/ScrollShadow/useComposedScrollHandler.js.map +1 -0
  181. package/lib/commonjs/components/ScrollShadow/useScrollShadow.js +48 -8
  182. package/lib/commonjs/components/ScrollShadow/useScrollShadow.js.map +1 -1
  183. package/lib/commonjs/components/Tabs/index.js +16 -23
  184. package/lib/commonjs/components/Tabs/index.js.map +1 -1
  185. package/lib/commonjs/components/Tabs/styles.js +1 -10
  186. package/lib/commonjs/components/Tabs/styles.js.map +1 -1
  187. package/lib/commonjs/figma/ListItem.SectionHeader.figma.js +20 -5
  188. package/lib/commonjs/figma/ListItem.SectionHeader.figma.js.map +1 -1
  189. package/lib/module/components/DateTimeList/index.js +12 -27
  190. package/lib/module/components/DateTimeList/index.js.map +1 -1
  191. package/lib/module/components/DateTimeList/styles.js +1 -11
  192. package/lib/module/components/DateTimeList/styles.js.map +1 -1
  193. package/lib/module/components/ListItem/index.js.map +1 -1
  194. package/lib/module/components/ListItem/styles.js +2 -1
  195. package/lib/module/components/ListItem/styles.js.map +1 -1
  196. package/lib/module/components/Menu/index.js +11 -5
  197. package/lib/module/components/Menu/index.js.map +1 -1
  198. package/lib/module/components/ScrollShadow/gradient.js +24 -0
  199. package/lib/module/components/ScrollShadow/gradient.js.map +1 -0
  200. package/lib/module/components/ScrollShadow/index.js +170 -48
  201. package/lib/module/components/ScrollShadow/index.js.map +1 -1
  202. package/lib/module/components/ScrollShadow/styles.js +57 -13
  203. package/lib/module/components/ScrollShadow/styles.js.map +1 -1
  204. package/lib/module/components/ScrollShadow/useComposedScrollHandler.js +57 -0
  205. package/lib/module/components/ScrollShadow/useComposedScrollHandler.js.map +1 -0
  206. package/lib/module/components/ScrollShadow/useScrollShadow.js +46 -8
  207. package/lib/module/components/ScrollShadow/useScrollShadow.js.map +1 -1
  208. package/lib/module/components/Tabs/index.js +17 -24
  209. package/lib/module/components/Tabs/index.js.map +1 -1
  210. package/lib/module/components/Tabs/styles.js +0 -9
  211. package/lib/module/components/Tabs/styles.js.map +1 -1
  212. package/lib/module/figma/ListItem.SectionHeader.figma.js +20 -5
  213. package/lib/module/figma/ListItem.SectionHeader.figma.js.map +1 -1
  214. package/lib/typescript/components/DateTimeList/index.d.ts.map +1 -1
  215. package/lib/typescript/components/DateTimeList/styles.d.ts +1 -4
  216. package/lib/typescript/components/DateTimeList/styles.d.ts.map +1 -1
  217. package/lib/typescript/components/ListItem/index.d.ts +5 -4
  218. package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
  219. package/lib/typescript/components/ListItem/styles.d.ts +1 -1
  220. package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
  221. package/lib/typescript/components/Menu/index.d.ts.map +1 -1
  222. package/lib/typescript/components/ScrollShadow/gradient.d.ts +7 -0
  223. package/lib/typescript/components/ScrollShadow/gradient.d.ts.map +1 -0
  224. package/lib/typescript/components/ScrollShadow/index.d.ts +57 -15
  225. package/lib/typescript/components/ScrollShadow/index.d.ts.map +1 -1
  226. package/lib/typescript/components/ScrollShadow/styles.d.ts +8 -2
  227. package/lib/typescript/components/ScrollShadow/styles.d.ts.map +1 -1
  228. package/lib/typescript/components/ScrollShadow/useComposedScrollHandler.d.ts +13 -0
  229. package/lib/typescript/components/ScrollShadow/useComposedScrollHandler.d.ts.map +1 -0
  230. package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts +15 -2
  231. package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts.map +1 -1
  232. package/lib/typescript/components/Tabs/index.d.ts.map +1 -1
  233. package/lib/typescript/components/Tabs/styles.d.ts +0 -7
  234. package/lib/typescript/components/Tabs/styles.d.ts.map +1 -1
  235. package/lib/typescript/figma/ListItem.SectionHeader.figma.d.ts.map +1 -1
  236. package/package.json +8 -6
  237. package/src/components/DateTimeList/index.tsx +13 -26
  238. package/src/components/DateTimeList/styles.ts +1 -10
  239. package/src/components/ListItem/index.tsx +5 -4
  240. package/src/components/ListItem/styles.ts +1 -0
  241. package/src/components/Menu/index.tsx +11 -8
  242. package/src/components/ScrollShadow/gradient.ts +48 -0
  243. package/src/components/ScrollShadow/index.tsx +300 -69
  244. package/src/components/ScrollShadow/styles.ts +45 -28
  245. package/src/components/ScrollShadow/useComposedScrollHandler.ts +58 -0
  246. package/src/components/ScrollShadow/useScrollShadow.ts +72 -10
  247. package/src/components/Tabs/index.tsx +25 -35
  248. package/src/components/Tabs/styles.ts +0 -9
package/AGENTS.md ADDED
@@ -0,0 +1,24 @@
1
+ # @cdx-ui/components — agent guide
2
+
3
+ This package ships its own Forge UI documentation in `docs/`, generated from the docs site
4
+ at the commit this version was released from. It matches the installed version exactly.
5
+
6
+ ## Use the bundled docs first
7
+
8
+ - Prefer `docs/` over https://design.candescent.com. The live site tracks the latest
9
+ unreleased source, so its APIs and examples can be ahead of this install.
10
+ - Start at `docs/llms.txt`: an index of every page, linking each to its local file.
11
+ - For a page at site path `<path>` (for example `components/button` or
12
+ `getting-started/developers`):
13
+ - `docs/<path>/content.md` has the page prose, demo source and generated prop tables.
14
+ - `docs/<path>/design.md` has design guidance. Only some pages have one.
15
+ - Search the folder directly (for example `grep -rl "BottomSheet" docs/`) instead of
16
+ fetching a concatenated file.
17
+
18
+ ## When sources disagree
19
+
20
+ The installed type declarations in `lib/typescript/` are the final word on props and
21
+ exports. If they disagree with `docs/`, trust the types.
22
+
23
+ Links inside `content.md` and `design.md` use absolute site URLs, so they open the live
24
+ site rather than this version. Prefer the local file for the same `<path>`.
package/README.md CHANGED
@@ -46,6 +46,8 @@ export function Example() {
46
46
 
47
47
  The [component reference](https://design.candescent.com/docs/components) is the source of truth for the catalog — every component has a page there with live examples, props, and accessibility notes.
48
48
 
49
+ The package also ships that reference as markdown in `docs/`, matched to the installed version; coding agents should start at `AGENTS.md` in the package root.
50
+
49
51
  > `Box` is exported but deprecated — use React Native's `View` directly.
50
52
 
51
53
  ### Providers
package/coverage.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="108" height="20" role="img" aria-label="coverage: 92.3%"><title>coverage: 92.3%</title><filter id="blur"><feGaussianBlur stdDeviation="16"/></filter><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="108" height="20" rx="3"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="47" height="20" fill="#4b0"/><rect width="108" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><g transform="scale(.1)"><g aria-hidden="true" fill="#010101"><text x="315" y="150" fill-opacity=".8" filter="url(#blur)" textLength="510">coverage</text><text x="315" y="150" fill-opacity=".3" textLength="510">coverage</text></g><text x="315" y="140" textLength="510">coverage</text></g><g transform="scale(.1)"><g aria-hidden="true" fill="#010101"><text x="835" y="150" fill-opacity=".8" filter="url(#blur)" textLength="370">92.3%</text><text x="835" y="150" fill-opacity=".3" textLength="370">92.3%</text></g><text x="835" y="140" textLength="370">92.3%</text></g></g></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="108" height="20" role="img" aria-label="coverage: 92.6%"><title>coverage: 92.6%</title><filter id="blur"><feGaussianBlur stdDeviation="16"/></filter><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="108" height="20" rx="3"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="47" height="20" fill="#4b0"/><rect width="108" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><g transform="scale(.1)"><g aria-hidden="true" fill="#010101"><text x="315" y="150" fill-opacity=".8" filter="url(#blur)" textLength="510">coverage</text><text x="315" y="150" fill-opacity=".3" textLength="510">coverage</text></g><text x="315" y="140" textLength="510">coverage</text></g><g transform="scale(.1)"><g aria-hidden="true" fill="#010101"><text x="835" y="150" fill-opacity=".8" filter="url(#blur)" textLength="370">92.6%</text><text x="835" y="150" fill-opacity=".3" textLength="370">92.6%</text></g><text x="835" y="140" textLength="370">92.6%</text></g></g></svg>
@@ -0,0 +1,538 @@
1
+ # Accordion (https://design.candescent.com/docs/components/accordion)
2
+
3
+ Resources: [Figma](https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=11210-5320), [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/surfaces-accordion--default)
4
+
5
+ Use `Accordion` for FAQs, settings, and other sections where people reveal content as needed. Compose each item from a trigger and content region.
6
+
7
+ ```tsx
8
+ import { Accordion } from '@cdx-ui/components';
9
+ ```
10
+
11
+ ## Basic
12
+
13
+ Use `type="single"` when only one item should be open. Control the open item with `value` and `onValueChange`, or provide `defaultValue` for uncontrolled usage.
14
+
15
+ ```tsx
16
+ import { useState } from 'react';
17
+ import { Accordion, Text } from '@cdx-ui/components';
18
+
19
+ export default function AccordionBasicDemo() {
20
+ const [value, setValue] = useState<string | undefined>('shipping');
21
+
22
+ return (
23
+ <Accordion
24
+ type="single"
25
+ value={value}
26
+ onValueChange={setValue}
27
+ aria-label="Store policies"
28
+ className="w-full max-w-md"
29
+ >
30
+ <Accordion.Item value="shipping">
31
+ <Accordion.Trigger>
32
+ <Accordion.Label>
33
+ <Accordion.Title>Shipping policy</Accordion.Title>
34
+ </Accordion.Label>
35
+ </Accordion.Trigger>
36
+ <Accordion.Content>
37
+ <Text size="sm" color="secondary">
38
+ Standard shipping is free on orders over $50.
39
+ </Text>
40
+ </Accordion.Content>
41
+ </Accordion.Item>
42
+ <Accordion.Item value="returns" showSeparator={false}>
43
+ <Accordion.Trigger>
44
+ <Accordion.Label>
45
+ <Accordion.Title>Returns</Accordion.Title>
46
+ </Accordion.Label>
47
+ </Accordion.Trigger>
48
+ <Accordion.Content>
49
+ <Text size="sm" color="secondary">
50
+ Return unused items within 30 days for a full refund.
51
+ </Text>
52
+ </Accordion.Content>
53
+ </Accordion.Item>
54
+ </Accordion>
55
+ );
56
+ }
57
+ ```
58
+
59
+ ## Multiple
60
+
61
+ Use `type="multiple"` to let people open and close items independently.
62
+
63
+ ```tsx
64
+ import { Accordion, Text } from '@cdx-ui/components';
65
+
66
+ export default function AccordionMultipleDemo() {
67
+ return (
68
+ <Accordion
69
+ type="multiple"
70
+ defaultValue={['alerts', 'security']}
71
+ aria-label="Account settings"
72
+ className="w-full max-w-md"
73
+ >
74
+ <Accordion.Item value="alerts">
75
+ <Accordion.Trigger>
76
+ <Accordion.Label>
77
+ <Accordion.Title>Alerts</Accordion.Title>
78
+ </Accordion.Label>
79
+ </Accordion.Trigger>
80
+ <Accordion.Content>
81
+ <Text size="sm" color="secondary">
82
+ Receive balance, deposit, and payment notifications.
83
+ </Text>
84
+ </Accordion.Content>
85
+ </Accordion.Item>
86
+ <Accordion.Item value="security" showSeparator={false}>
87
+ <Accordion.Trigger>
88
+ <Accordion.Label>
89
+ <Accordion.Title>Security</Accordion.Title>
90
+ </Accordion.Label>
91
+ </Accordion.Trigger>
92
+ <Accordion.Content>
93
+ <Text size="sm" color="secondary">
94
+ Review sign-in and device security preferences.
95
+ </Text>
96
+ </Accordion.Content>
97
+ </Accordion.Item>
98
+ </Accordion>
99
+ );
100
+ }
101
+ ```
102
+
103
+ ## Rich labels
104
+
105
+ Compose `Accordion.LeadingSlot`, `Accordion.Description`, and `Accordion.Meta` when a trigger needs more context than a title alone.
106
+
107
+ ```tsx
108
+ import { Accordion, Icon, Text } from '@cdx-ui/components';
109
+ import { Notifications } from '@cdx-ui/icons';
110
+
111
+ export default function AccordionRichLabelDemo() {
112
+ return (
113
+ <Accordion
114
+ type="single"
115
+ defaultValue="notifications"
116
+ aria-label="Notification preferences"
117
+ className="w-full max-w-md"
118
+ >
119
+ <Accordion.Item value="notifications" showSeparator={false}>
120
+ <Accordion.Trigger>
121
+ <Accordion.LeadingSlot>
122
+ <Icon as={Notifications} />
123
+ </Accordion.LeadingSlot>
124
+ <Accordion.Label>
125
+ <Accordion.Title>Notifications</Accordion.Title>
126
+ <Accordion.Description>Manage account alerts</Accordion.Description>
127
+ <Accordion.Meta>3 channels enabled</Accordion.Meta>
128
+ </Accordion.Label>
129
+ </Accordion.Trigger>
130
+ <Accordion.Content>
131
+ <Text size="sm" color="secondary">
132
+ Choose when Forge sends push, email, and SMS notifications.
133
+ </Text>
134
+ </Accordion.Content>
135
+ </Accordion.Item>
136
+ </Accordion>
137
+ );
138
+ }
139
+ ```
140
+
141
+ ## Full bleed
142
+
143
+ Set `fullBleed` on items nested in an already-padded surface to avoid a second horizontal inset. Here the payment summary, Accordion details, and card action all align to the Card's shared gutter.
144
+
145
+ ```tsx
146
+ import {
147
+ Accordion,
148
+ Button,
149
+ Card,
150
+ Chip,
151
+ Divider,
152
+ Heading,
153
+ HStack,
154
+ Icon,
155
+ Text,
156
+ VStack,
157
+ } from '@cdx-ui/components';
158
+ import { AccountBalance, ReceiptLong } from '@cdx-ui/icons';
159
+
160
+ export default function AccordionFullBleedDemo() {
161
+ return (
162
+ <Card className="w-full max-w-md">
163
+ <Card.Header>
164
+ <VStack className="gap-0.5">
165
+ <Text size="sm" color="secondary">
166
+ Upcoming payment
167
+ </Text>
168
+ <Heading size="sm">Visa Platinum · 0275</Heading>
169
+ </VStack>
170
+ <Chip color="success" size="small">
171
+ <Chip.Label>AutoPay on</Chip.Label>
172
+ </Chip>
173
+ </Card.Header>
174
+ <Card.Content>
175
+ <VStack space="lg">
176
+ <VStack space="xs">
177
+ <Text size="sm" color="secondary">
178
+ Statement balance
179
+ </Text>
180
+ <Text size="xl" weight="semibold">
181
+ $842.17
182
+ </Text>
183
+ <Text size="sm" color="secondary">
184
+ Due September 18
185
+ </Text>
186
+ </VStack>
187
+ <Divider />
188
+ <Accordion type="single" defaultValue="breakdown" aria-label="Payment details">
189
+ <Accordion.Item value="breakdown" fullBleed>
190
+ <Accordion.Trigger>
191
+ <Accordion.LeadingSlot>
192
+ <Icon as={ReceiptLong} />
193
+ </Accordion.LeadingSlot>
194
+ <Accordion.Label>
195
+ <Accordion.Title>Payment breakdown</Accordion.Title>
196
+ <Accordion.Description>How the amount was calculated</Accordion.Description>
197
+ </Accordion.Label>
198
+ </Accordion.Trigger>
199
+ <Accordion.Content>
200
+ <VStack space="sm">
201
+ <HStack space="lg" className="justify-between">
202
+ <Text size="sm" color="secondary">
203
+ Purchases
204
+ </Text>
205
+ <Text size="sm">$796.42</Text>
206
+ </HStack>
207
+ <HStack space="lg" className="justify-between">
208
+ <Text size="sm" color="secondary">
209
+ Interest
210
+ </Text>
211
+ <Text size="sm">$34.75</Text>
212
+ </HStack>
213
+ <HStack space="lg" className="justify-between">
214
+ <Text size="sm" color="secondary">
215
+ Fees
216
+ </Text>
217
+ <Text size="sm">$11.00</Text>
218
+ </HStack>
219
+ </VStack>
220
+ </Accordion.Content>
221
+ </Accordion.Item>
222
+ <Accordion.Item value="account" fullBleed showSeparator={false}>
223
+ <Accordion.Trigger>
224
+ <Accordion.LeadingSlot>
225
+ <Icon as={AccountBalance} />
226
+ </Accordion.LeadingSlot>
227
+ <Accordion.Label>
228
+ <Accordion.Title>Payment account</Accordion.Title>
229
+ <Accordion.Description>Joint Checking · 4821</Accordion.Description>
230
+ </Accordion.Label>
231
+ </Accordion.Trigger>
232
+ <Accordion.Content>
233
+ <HStack space="lg" className="justify-between">
234
+ <Text size="sm" color="secondary">
235
+ Available balance
236
+ </Text>
237
+ <Text size="sm">$4,250.18</Text>
238
+ </HStack>
239
+ </Accordion.Content>
240
+ </Accordion.Item>
241
+ </Accordion>
242
+ </VStack>
243
+ </Card.Content>
244
+ <Card.Footer>
245
+ <Button color="action" fullWidth>
246
+ <Button.Label>Review payment</Button.Label>
247
+ </Button>
248
+ </Card.Footer>
249
+ </Card>
250
+ );
251
+ }
252
+ ```
253
+
254
+ ## Indicator overrides
255
+
256
+ Pass an `indicator` to `Accordion.Trigger` to replace the default chevron, or pass `null` to suppress it.
257
+
258
+ ```tsx
259
+ import { Accordion, Icon, Text } from '@cdx-ui/components';
260
+ import { Hexagon } from '@cdx-ui/icons';
261
+
262
+ export default function AccordionIndicatorOverridesDemo() {
263
+ return (
264
+ <Accordion
265
+ type="multiple"
266
+ defaultValue={['custom', 'hidden']}
267
+ aria-label="Indicator options"
268
+ className="w-full max-w-md"
269
+ >
270
+ <Accordion.Item value="custom">
271
+ <Accordion.Trigger
272
+ indicator={
273
+ <Accordion.Indicator>
274
+ <Icon as={Hexagon} />
275
+ </Accordion.Indicator>
276
+ }
277
+ >
278
+ <Accordion.Label>
279
+ <Accordion.Title>Custom indicator</Accordion.Title>
280
+ </Accordion.Label>
281
+ </Accordion.Trigger>
282
+ <Accordion.Content>
283
+ <Text size="sm" color="secondary">
284
+ Replace the default chevron with another visual.
285
+ </Text>
286
+ </Accordion.Content>
287
+ </Accordion.Item>
288
+ <Accordion.Item value="hidden" showSeparator={false}>
289
+ <Accordion.Trigger indicator={null}>
290
+ <Accordion.Label>
291
+ <Accordion.Title>No indicator</Accordion.Title>
292
+ </Accordion.Label>
293
+ </Accordion.Trigger>
294
+ <Accordion.Content>
295
+ <Text size="sm" color="secondary">
296
+ Pass null when the surrounding design provides the open-state affordance.
297
+ </Text>
298
+ </Accordion.Content>
299
+ </Accordion.Item>
300
+ </Accordion>
301
+ );
302
+ }
303
+ ```
304
+
305
+ ## Disabled
306
+
307
+ Set `disabled` on an item, or `isDisabled` on `Accordion` to disable the entire group.
308
+
309
+ ```tsx
310
+ import { Accordion, Text } from '@cdx-ui/components';
311
+
312
+ export default function AccordionDisabledDemo() {
313
+ return (
314
+ <Accordion
315
+ type="single"
316
+ defaultValue="enabled"
317
+ aria-label="Account options"
318
+ className="w-full max-w-md"
319
+ >
320
+ <Accordion.Item value="enabled">
321
+ <Accordion.Trigger>
322
+ <Accordion.Label>
323
+ <Accordion.Title>Enabled option</Accordion.Title>
324
+ </Accordion.Label>
325
+ </Accordion.Trigger>
326
+ <Accordion.Content>
327
+ <Text size="sm" color="secondary">
328
+ This item can be opened and closed.
329
+ </Text>
330
+ </Accordion.Content>
331
+ </Accordion.Item>
332
+ <Accordion.Item value="disabled" disabled showSeparator={false}>
333
+ <Accordion.Trigger>
334
+ <Accordion.Label>
335
+ <Accordion.Title>Unavailable option</Accordion.Title>
336
+ </Accordion.Label>
337
+ </Accordion.Trigger>
338
+ <Accordion.Content>
339
+ <Text size="sm" color="secondary">
340
+ Disabled content cannot be opened.
341
+ </Text>
342
+ </Accordion.Content>
343
+ </Accordion.Item>
344
+ </Accordion>
345
+ );
346
+ }
347
+ ```
348
+
349
+ ## API
350
+
351
+ ### Accordion
352
+
353
+ Root container that manages the open item value or values. The `type` discriminant determines the controlled and uncontrolled value shape.
354
+
355
+ | Prop | Type | Default | Description |
356
+ | --- | --- | --- | --- |
357
+ | `className?` | `string` | — | — |
358
+ | `children?` | `ReactNode` | — | — |
359
+ | `type?` | `'single' \| 'multiple'` | — | — |
360
+ | `value?` | `string \| string[]` | — | — |
361
+ | `defaultValue?` | `string \| string[]` | — | — |
362
+ | `onValueChange?` | `((value: string) => void) \| ((value: string[]) => void)` | — | — |
363
+ | `collapsible?` | `boolean` | — | — |
364
+ | `isDisabled?` | `boolean` | — | — |
365
+ | `asChild?` | `boolean` | — | — |
366
+
367
+ Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props). Single mode uses `string | undefined`; multiple mode uses `string[]`. `collapsible` applies only to single mode.
368
+
369
+ | Attribute | Values | Description |
370
+ | ----------- | ----------- | -------------- |
371
+ | `data-slot` | `accordion` | Root container |
372
+
373
+ ## Sub-components
374
+
375
+ ### Accordion.Item
376
+
377
+ One disclosure item. Requires a unique `value`; `fullBleed` and `showSeparator` control its layout.
378
+
379
+ | Prop | Type | Default | Description |
380
+ | --- | --- | --- | --- |
381
+ | `className?` | `string` | — | — |
382
+ | `children?` | `ReactNode` | — | — |
383
+ | `asChild?` | `boolean` | — | — |
384
+ | `fullBleed?` | `boolean` | `false` | Removes horizontal padding so trigger and content can render edge to edge. |
385
+ | `showSeparator?` | `boolean` | `true` | Renders a separator below the item when true. |
386
+ | `value` | `string` | — | Required stable id within the Accordion. |
387
+ | `disabled?` | `boolean` | — | — |
388
+
389
+ Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
390
+
391
+ | Attribute | Values | Description |
392
+ | --------------- | ------------------ | -------------------------------------- |
393
+ | `data-slot` | `accordion-item` | Item container |
394
+ | `data-state` | `open` \| `closed` | Disclosure state |
395
+ | `data-disabled` | `true` \| `false` | Effective item or group disabled state |
396
+
397
+ ### Accordion.Trigger
398
+
399
+ Pressable header control that toggles its item. It renders the default chevron unless `indicator` replaces or suppresses it.
400
+
401
+ | Prop | Type | Default | Description |
402
+ | --- | --- | --- | --- |
403
+ | `className?` | `string` | — | — |
404
+ | `children?` | `ReactNode` | — | Either children or a render prop that receives a boolean reflecting whether the component is currently pressed. |
405
+ | `asChild?` | `boolean` | — | Substitute the rendered trigger element with the single child. The child must be another Forge primitive (IconButton, Chip, Button) — anything whose underlying Pressable accepts Pressable-shaped handlers. When set, the auto-injected expand indicator is skipped and `accordionTriggerVariants` is not applied so the substituted component's own appearance wins. |
406
+ | `indicator?` | `ReactNode` | — | Replaces the default open/closed chevron. Pass `null` to suppress the indicator. When `asChild` is set, only an explicitly provided indicator is appended to the substituted child. |
407
+
408
+ Inherits all [`PressableProps`](https://reactnative.dev/docs/pressable#props) (including `onPress`).
409
+
410
+ | Attribute | Values | Description |
411
+ | -------------------- | ------------------- | ------------------------- |
412
+ | `data-slot` | `accordion-trigger` | Trigger pressable |
413
+ | `data-state` | `open` \| `closed` | Disclosure state |
414
+ | `data-disabled` | `true` \| `false` | Effective disabled state |
415
+ | `data-hover` | `true` \| `false` | Pointer hover state |
416
+ | `data-active` | `true` \| `false` | Pressed state |
417
+ | `data-focus-visible` | `true` \| `false` | Keyboard focus-ring state |
418
+
419
+ ### Accordion.LeadingSlot
420
+
421
+ Optional leading adornment such as an icon, avatar, or badge. Decorative content is hidden from the accessibility tree by default.
422
+
423
+ | Prop | Type | Default | Description |
424
+ | --- | --- | --- | --- |
425
+ | `className?` | `string` | — | — |
426
+ | `children?` | `ReactNode` | — | — |
427
+ | `asChild?` | `boolean` | — | — |
428
+
429
+ Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
430
+
431
+ ### Accordion.Label
432
+
433
+ Flexible column for `Accordion.Title`, `Accordion.Description`, and `Accordion.Meta`.
434
+
435
+ | Prop | Type | Default | Description |
436
+ | --- | --- | --- | --- |
437
+ | `className?` | `string` | — | — |
438
+ | `children?` | `ReactNode` | — | — |
439
+ | `asChild?` | `boolean` | — | — |
440
+
441
+ Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
442
+
443
+ ### Accordion.Title
444
+
445
+ Primary trigger label.
446
+
447
+ | Prop | Type | Default | Description |
448
+ | --- | --- | --- | --- |
449
+ | `className?` | `string` | — | — |
450
+ | `children?` | `ReactNode` | — | — |
451
+ | `asChild?` | `boolean` | — | — |
452
+
453
+ Inherits all [`TextProps`](https://reactnative.dev/docs/text#props).
454
+
455
+ ### Accordion.Description
456
+
457
+ Supporting text displayed below the title.
458
+
459
+ | Prop | Type | Default | Description |
460
+ | --- | --- | --- | --- |
461
+ | `className?` | `string` | — | — |
462
+ | `children?` | `ReactNode` | — | — |
463
+ | `asChild?` | `boolean` | — | — |
464
+
465
+ Inherits all [`TextProps`](https://reactnative.dev/docs/text#props).
466
+
467
+ ### Accordion.Meta
468
+
469
+ Tertiary trigger metadata displayed below the description.
470
+
471
+ | Prop | Type | Default | Description |
472
+ | --- | --- | --- | --- |
473
+ | `className?` | `string` | — | — |
474
+ | `children?` | `ReactNode` | — | — |
475
+ | `asChild?` | `boolean` | — | — |
476
+
477
+ Inherits all [`TextProps`](https://reactnative.dev/docs/text#props).
478
+
479
+ ### Accordion.Indicator
480
+
481
+ Visual open-state affordance. It renders `KeyboardArrowDown` by default and rotates while open; compose custom children to replace the glyph.
482
+
483
+ | Prop | Type | Default | Description |
484
+ | --- | --- | --- | --- |
485
+ | `className?` | `string` | — | — |
486
+ | `children?` | `ReactNode` | — | — |
487
+ | `asChild?` | `boolean` | — | — |
488
+
489
+ Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
490
+
491
+ | Attribute | Values | Description |
492
+ | ------------ | --------------------- | ------------------- |
493
+ | `data-slot` | `accordion-indicator` | Indicator container |
494
+ | `data-state` | `open` \| `closed` | Disclosure state |
495
+
496
+ ### Accordion.Content
497
+
498
+ Revealed content associated with its trigger. It is not mounted while the item is closed.
499
+
500
+ | Prop | Type | Default | Description |
501
+ | --- | --- | --- | --- |
502
+ | `className?` | `string` | — | — |
503
+ | `children?` | `ReactNode` | — | — |
504
+ | `asChild?` | `boolean` | — | — |
505
+
506
+ Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
507
+
508
+ | Attribute | Values | Description |
509
+ | ------------ | ------------------- | ----------------------- |
510
+ | `data-slot` | `accordion-content` | Revealed content region |
511
+ | `data-state` | `open` | Present while mounted |
512
+
513
+ ## Anatomy
514
+
515
+ | `data-slot` | Element |
516
+ | ----------------------- | ----------------------- |
517
+ | `accordion` | Root container |
518
+ | `accordion-item` | Disclosure item |
519
+ | `accordion-trigger` | Trigger pressable |
520
+ | `accordion-leading` | Leading adornment |
521
+ | `accordion-label` | Trigger text stack |
522
+ | `accordion-title` | Primary label |
523
+ | `accordion-description` | Supporting label |
524
+ | `accordion-meta` | Tertiary metadata |
525
+ | `accordion-indicator` | Open-state affordance |
526
+ | `accordion-content` | Revealed content region |
527
+
528
+ ## Accessibility
529
+
530
+ | Attribute | Behavior |
531
+ | --------------------- | ---------------------------------------------------------------------------------- |
532
+ | **Role** | Each `Accordion.Trigger` is a button. Open content is exposed as a region on web. |
533
+ | **Expanded state** | `aria-expanded` / `accessibilityState.expanded` reflects whether the item is open. |
534
+ | **Relationship** | `aria-controls` links the trigger to Content; Content is labelled by its trigger. |
535
+ | **Keyboard** | Focus triggers with Tab and toggle them with Enter or Space. |
536
+ | **Disabled** | `disabled` prevents one item from toggling; root `isDisabled` disables every item. |
537
+ | **Leading content** | `Accordion.LeadingSlot` is hidden from the accessibility tree by default. |
538
+ | **Content lifecycle** | Closed content is unmounted and therefore absent from the accessibility tree. |