@cdx-ui/components 0.2.4 → 0.3.0

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 (165) hide show
  1. package/docs/components/accordion/content.md +2 -2
  2. package/docs/components/alert/content.md +1 -1
  3. package/docs/components/badge/content.md +5 -15
  4. package/docs/components/bottom-sheet/content.md +18 -14
  5. package/docs/components/box/content.md +141 -0
  6. package/docs/components/breadcrumbs/content.md +9 -9
  7. package/docs/components/button/content.md +19 -19
  8. package/docs/components/calendar/content.md +25 -1
  9. package/docs/components/card/content.md +2 -2
  10. package/docs/components/carousel/content.md +9 -8
  11. package/docs/components/chip/content.md +1 -1
  12. package/docs/components/color-area/content.md +3 -5
  13. package/docs/components/color-field/content.md +3 -5
  14. package/docs/components/color-picker/content.md +5 -4
  15. package/docs/components/color-slider/content.md +3 -5
  16. package/docs/components/color-swatch/content.md +3 -5
  17. package/docs/components/color-swatch-picker/content.md +3 -5
  18. package/docs/components/content.md +10 -9
  19. package/docs/components/data-grid/content.md +10 -11
  20. package/docs/components/drawer/content.md +17 -25
  21. package/docs/components/full-screen-dialog/content.md +2 -2
  22. package/docs/components/icon/content.md +1 -1
  23. package/docs/components/icon-button/content.md +3 -3
  24. package/docs/components/input/content.md +65 -0
  25. package/docs/components/list-item/content.md +9 -9
  26. package/docs/components/menu/content.md +57 -50
  27. package/docs/components/month-calendar/content.md +2 -0
  28. package/docs/components/range-calendar/content.md +3 -1
  29. package/docs/components/reorderable-list/content.md +5 -3
  30. package/docs/components/scoped-theme/content.md +1 -1
  31. package/docs/components/scroll-shadow/content.md +43 -36
  32. package/docs/components/select/content.md +80 -7
  33. package/docs/components/skeleton/content.md +7 -6
  34. package/docs/components/table/content.md +2 -2
  35. package/docs/components/tabs/content.md +14 -9
  36. package/docs/components/tile/content.md +9 -10
  37. package/docs/components/toggle-button/content.md +1 -1
  38. package/docs/components/tooltip/content.md +9 -9
  39. package/docs/components/virtualized-list/content.md +14 -14
  40. package/docs/getting-started/developers/content.md +2 -2
  41. package/docs/getting-started/developers/styling/content.md +20 -18
  42. package/docs/llms.txt +12 -9
  43. package/docs/patterns/authentication/content.md +4 -6
  44. package/docs/patterns/dashboard/content.md +8 -13
  45. package/docs/patterns/empty-states/content.md +7 -6
  46. package/docs/patterns/forms/content.md +6 -7
  47. package/docs/patterns/onboarding/content.md +4 -4
  48. package/docs/patterns/settings/content.md +5 -5
  49. package/docs/resources/release-notes/0.2.4/content.md +17 -0
  50. package/docs/resources/release-notes/0.2.5/content.md +25 -0
  51. package/docs/resources/release-notes/content.md +2 -0
  52. package/lib/commonjs/components/BottomSheet/index.js +25 -1
  53. package/lib/commonjs/components/BottomSheet/index.js.map +1 -1
  54. package/lib/commonjs/components/BottomSheet/styles.js +8 -2
  55. package/lib/commonjs/components/BottomSheet/styles.js.map +1 -1
  56. package/lib/commonjs/components/Box/Box.js +9 -1
  57. package/lib/commonjs/components/Box/Box.js.map +1 -1
  58. package/lib/commonjs/components/Breadcrumbs/index.js +28 -3
  59. package/lib/commonjs/components/Breadcrumbs/index.js.map +1 -1
  60. package/lib/commonjs/components/Breadcrumbs/styles.js +27 -0
  61. package/lib/commonjs/components/Breadcrumbs/styles.js.map +1 -1
  62. package/lib/commonjs/components/Calendar/CalendarMonthHeader.js +15 -5
  63. package/lib/commonjs/components/Calendar/CalendarMonthHeader.js.map +1 -1
  64. package/lib/commonjs/components/Calendar/CalendarYearList.js +116 -0
  65. package/lib/commonjs/components/Calendar/CalendarYearList.js.map +1 -0
  66. package/lib/commonjs/components/Calendar/CalendarYearPickerGrid.js +58 -31
  67. package/lib/commonjs/components/Calendar/CalendarYearPickerGrid.js.map +1 -1
  68. package/lib/commonjs/components/Calendar/flashCalendarAdapter.js +22 -3
  69. package/lib/commonjs/components/Calendar/flashCalendarAdapter.js.map +1 -1
  70. package/lib/commonjs/components/Calendar/index.js +6 -2
  71. package/lib/commonjs/components/Calendar/index.js.map +1 -1
  72. package/lib/commonjs/components/Calendar/styles.js +16 -2
  73. package/lib/commonjs/components/Calendar/styles.js.map +1 -1
  74. package/lib/commonjs/components/MonthCalendar/index.js +39 -13
  75. package/lib/commonjs/components/MonthCalendar/index.js.map +1 -1
  76. package/lib/commonjs/components/RangeCalendar/index.js +6 -2
  77. package/lib/commonjs/components/RangeCalendar/index.js.map +1 -1
  78. package/lib/commonjs/components/Stack/HStack.js +6 -2
  79. package/lib/commonjs/components/Stack/HStack.js.map +1 -1
  80. package/lib/commonjs/components/Stack/VStack.js +6 -2
  81. package/lib/commonjs/components/Stack/VStack.js.map +1 -1
  82. package/lib/commonjs/index.js +10 -10
  83. package/lib/commonjs/index.js.map +1 -1
  84. package/lib/module/components/BottomSheet/index.js +27 -3
  85. package/lib/module/components/BottomSheet/index.js.map +1 -1
  86. package/lib/module/components/BottomSheet/styles.js +8 -2
  87. package/lib/module/components/BottomSheet/styles.js.map +1 -1
  88. package/lib/module/components/Box/Box.js +9 -1
  89. package/lib/module/components/Box/Box.js.map +1 -1
  90. package/lib/module/components/Breadcrumbs/index.js +29 -4
  91. package/lib/module/components/Breadcrumbs/index.js.map +1 -1
  92. package/lib/module/components/Breadcrumbs/styles.js +26 -0
  93. package/lib/module/components/Breadcrumbs/styles.js.map +1 -1
  94. package/lib/module/components/Calendar/CalendarMonthHeader.js +15 -5
  95. package/lib/module/components/Calendar/CalendarMonthHeader.js.map +1 -1
  96. package/lib/module/components/Calendar/CalendarYearList.js +112 -0
  97. package/lib/module/components/Calendar/CalendarYearList.js.map +1 -0
  98. package/lib/module/components/Calendar/CalendarYearPickerGrid.js +61 -34
  99. package/lib/module/components/Calendar/CalendarYearPickerGrid.js.map +1 -1
  100. package/lib/module/components/Calendar/flashCalendarAdapter.js +20 -2
  101. package/lib/module/components/Calendar/flashCalendarAdapter.js.map +1 -1
  102. package/lib/module/components/Calendar/index.js +7 -3
  103. package/lib/module/components/Calendar/index.js.map +1 -1
  104. package/lib/module/components/Calendar/styles.js +15 -1
  105. package/lib/module/components/Calendar/styles.js.map +1 -1
  106. package/lib/module/components/MonthCalendar/index.js +42 -15
  107. package/lib/module/components/MonthCalendar/index.js.map +1 -1
  108. package/lib/module/components/RangeCalendar/index.js +7 -3
  109. package/lib/module/components/RangeCalendar/index.js.map +1 -1
  110. package/lib/module/components/Stack/HStack.js +6 -2
  111. package/lib/module/components/Stack/HStack.js.map +1 -1
  112. package/lib/module/components/Stack/VStack.js +6 -2
  113. package/lib/module/components/Stack/VStack.js.map +1 -1
  114. package/lib/module/index.js +6 -1
  115. package/lib/module/index.js.map +1 -1
  116. package/lib/typescript/animation/hooks/usePopupDialogContentAnimation.d.ts +2 -2
  117. package/lib/typescript/animation/hooks/usePopupOverlayAnimation.d.ts +2 -2
  118. package/lib/typescript/components/BottomSheet/index.d.ts +8 -0
  119. package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -1
  120. package/lib/typescript/components/BottomSheet/styles.d.ts +5 -1
  121. package/lib/typescript/components/BottomSheet/styles.d.ts.map +1 -1
  122. package/lib/typescript/components/Box/Box.d.ts +4 -0
  123. package/lib/typescript/components/Box/Box.d.ts.map +1 -1
  124. package/lib/typescript/components/Breadcrumbs/index.d.ts +3 -1
  125. package/lib/typescript/components/Breadcrumbs/index.d.ts.map +1 -1
  126. package/lib/typescript/components/Breadcrumbs/styles.d.ts +2 -0
  127. package/lib/typescript/components/Breadcrumbs/styles.d.ts.map +1 -1
  128. package/lib/typescript/components/Calendar/CalendarMonthHeader.d.ts.map +1 -1
  129. package/lib/typescript/components/Calendar/CalendarYearList.d.ts +23 -0
  130. package/lib/typescript/components/Calendar/CalendarYearList.d.ts.map +1 -0
  131. package/lib/typescript/components/Calendar/CalendarYearPickerGrid.d.ts +5 -1
  132. package/lib/typescript/components/Calendar/CalendarYearPickerGrid.d.ts.map +1 -1
  133. package/lib/typescript/components/Calendar/flashCalendarAdapter.d.ts +8 -0
  134. package/lib/typescript/components/Calendar/flashCalendarAdapter.d.ts.map +1 -1
  135. package/lib/typescript/components/Calendar/index.d.ts.map +1 -1
  136. package/lib/typescript/components/Calendar/styles.d.ts +7 -1
  137. package/lib/typescript/components/Calendar/styles.d.ts.map +1 -1
  138. package/lib/typescript/components/MonthCalendar/index.d.ts.map +1 -1
  139. package/lib/typescript/components/RangeCalendar/index.d.ts.map +1 -1
  140. package/lib/typescript/components/Stack/HStack.d.ts +3 -2
  141. package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
  142. package/lib/typescript/components/Stack/VStack.d.ts +3 -2
  143. package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
  144. package/lib/typescript/components/Toast/animation.d.ts +3 -3
  145. package/lib/typescript/components/Toast/animation.d.ts.map +1 -1
  146. package/lib/typescript/components/ToggleButton/styles.d.ts +1 -1
  147. package/lib/typescript/index.d.ts +6 -1
  148. package/lib/typescript/index.d.ts.map +1 -1
  149. package/package.json +8 -8
  150. package/src/components/BottomSheet/index.tsx +174 -138
  151. package/src/components/BottomSheet/styles.ts +11 -3
  152. package/src/components/Box/Box.tsx +18 -4
  153. package/src/components/Breadcrumbs/index.tsx +28 -4
  154. package/src/components/Breadcrumbs/styles.ts +30 -0
  155. package/src/components/Calendar/CalendarMonthHeader.tsx +29 -22
  156. package/src/components/Calendar/CalendarYearList.tsx +136 -0
  157. package/src/components/Calendar/CalendarYearPickerGrid.tsx +60 -33
  158. package/src/components/Calendar/flashCalendarAdapter.ts +27 -2
  159. package/src/components/Calendar/index.tsx +8 -3
  160. package/src/components/Calendar/styles.ts +17 -1
  161. package/src/components/MonthCalendar/index.tsx +55 -33
  162. package/src/components/RangeCalendar/index.tsx +8 -3
  163. package/src/components/Stack/HStack.tsx +8 -4
  164. package/src/components/Stack/VStack.tsx +8 -4
  165. package/src/index.ts +8 -1
@@ -8,8 +8,14 @@ export declare const calendarMonthHeaderLabelVariants: (props?: ({
8
8
  export declare const calendarMonthHeaderIconVariants: (props?: ({
9
9
  isYearView?: boolean | null | undefined;
10
10
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
- export declare const calendarMonthHeaderNavVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
11
+ export declare const calendarMonthHeaderNavVariants: (props?: ({
12
+ hidden?: boolean | null | undefined;
13
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
14
  export declare const calendarYearPickerGridVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
15
+ export declare const calendarYearPickerListVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
16
+ export declare const calendarYearPickerListContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
17
+ export declare const calendarYearPickerRowVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
18
+ export declare const calendarYearPickerPlaceholderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
19
  export declare const calendarPillCellVariants: (props?: ({
14
20
  selected?: boolean | null | undefined;
15
21
  disabled?: boolean | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Calendar/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGvD,eAAO,MAAM,oBAAoB,oFAI/B,CAAC;AAEH,eAAO,MAAM,2BAA2B,oFAA0D,CAAC;AAEnG,eAAO,MAAM,iCAAiC,oFAAoD,CAAC;AAEnG,eAAO,MAAM,gCAAgC;;8EAQ3C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;8EAQ1C,CAAC;AAEH,eAAO,MAAM,8BAA8B,oFAAqC,CAAC;AAEjF,eAAO,MAAM,8BAA8B,oFAE1C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;8EAwBpC,CAAC;AAEF,eAAO,MAAM,4BAA4B;;8EAQvC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACjF,MAAM,MAAM,oCAAoC,GAAG,YAAY,CAC7D,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,4BAA4B,GAAG,YAAY,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Calendar/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGvD,eAAO,MAAM,oBAAoB,oFAI/B,CAAC;AAEH,eAAO,MAAM,2BAA2B,oFAA0D,CAAC;AAEnG,eAAO,MAAM,iCAAiC,oFAAoD,CAAC;AAEnG,eAAO,MAAM,gCAAgC;;8EAQ3C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;8EAQ1C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;8EAQzC,CAAC;AAEH,eAAO,MAAM,8BAA8B,oFAE1C,CAAC;AAEF,eAAO,MAAM,8BAA8B,oFAAgB,CAAC;AAE5D,eAAO,MAAM,qCAAqC,oFAAc,CAAC;AAEjE,eAAO,MAAM,6BAA6B,oFAA+C,CAAC;AAE1F,eAAO,MAAM,qCAAqC,oFAAiB,CAAC;AAEpE,eAAO,MAAM,wBAAwB;;;8EAwBpC,CAAC;AAEF,eAAO,MAAM,4BAA4B;;8EAQvC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACjF,MAAM,MAAM,oCAAoC,GAAG,YAAY,CAC7D,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,4BAA4B,GAAG,YAAY,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/MonthCalendar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAmB,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAOL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAyB5B,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAWD,QAAA,MAAM,iBAAiB,qGAYtB,CAAC;AAIF,QAAA,MAAM,mBAAmB,4FAqEvB,CAAC;AAIH,QAAA,MAAM,iBAAiB,4FAqCrB,CAAC;AAIH,QAAA,MAAM,iBAAiB;WAEZ,MAAM;gBAAc,MAAM;eAAa,SAAS;wCAwBzD,CAAC;AAIH,QAAA,MAAM,qBAAqB;UAEjB,MAAM;gBAAc,MAAM;eAAa,SAAS;wCAuBxD,CAAC;AAIH,KAAK,qBAAqB,GAAG,OAAO,iBAAiB,GAAG;IACtD,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,IAAI,EAAE,OAAO,iBAAiB,CAAC;IAC/B,IAAI,EAAE,OAAO,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,OAAO,qBAAqB,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,aAAa,EAKpB,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/MonthCalendar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAmB,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAOL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAkC5B,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAWD,QAAA,MAAM,iBAAiB,qGAYtB,CAAC;AAIF,QAAA,MAAM,mBAAmB,4FA4EvB,CAAC;AAIH,QAAA,MAAM,iBAAiB,4FA2CrB,CAAC;AAIH,QAAA,MAAM,iBAAiB;WAEZ,MAAM;gBAAc,MAAM;eAAa,SAAS;wCAwBzD,CAAC;AAIH,QAAA,MAAM,qBAAqB;UAEjB,MAAM;gBAAc,MAAM;eAAa,SAAS;wCAuBxD,CAAC;AAIH,KAAK,qBAAqB,GAAG,OAAO,iBAAiB,GAAG;IACtD,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,IAAI,EAAE,OAAO,iBAAiB,CAAC;IAC/B,IAAI,EAAE,OAAO,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,OAAO,qBAAqB,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,aAAa,EAKpB,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/RangeCalendar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAa5B,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7E,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAYD,QAAA,MAAM,iBAAiB,qGAYtB,CAAC;AAIF,QAAA,MAAM,mBAAmB,4FAkBvB,CAAC;AAIH,QAAA,MAAM,uBAAuB,4FAiB5B,CAAC;AAIF,QAAA,MAAM,iBAAiB,4FAkDrB,CAAC;AAIH,KAAK,qBAAqB,GAAG,OAAO,iBAAiB,GAAG;IACtD,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,IAAI,EAAE,OAAO,iBAAiB,CAAC;IAC/B,UAAU,EAAE,OAAO,uBAAuB,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,aAAa,EAIpB,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/RangeCalendar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAe5B,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7E,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAYD,QAAA,MAAM,iBAAiB,qGAYtB,CAAC;AAIF,QAAA,MAAM,mBAAmB,4FAkBvB,CAAC;AAIH,QAAA,MAAM,uBAAuB,4FAoB5B,CAAC;AAIF,QAAA,MAAM,iBAAiB,4FAkDrB,CAAC;AAIH,KAAK,qBAAqB,GAAG,OAAO,iBAAiB,GAAG;IACtD,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,IAAI,EAAE,OAAO,iBAAiB,CAAC;IAC/B,UAAU,EAAE,OAAO,uBAAuB,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,aAAa,EAIpB,qBAAqB,CAAC"}
@@ -1,6 +1,7 @@
1
- import { View, type ViewProps } from 'react-native';
1
+ import type { View } from 'react-native';
2
+ import { type BoxProps } from '../Box';
2
3
  import { type StackSpace } from './styles';
3
- export interface HStackProps extends ViewProps {
4
+ export interface HStackProps extends Omit<BoxProps, 'asChild'> {
4
5
  className?: string;
5
6
  /** Token-based gap between children. */
6
7
  space?: StackSpace;
@@ -1 +1 @@
1
- {"version":3,"file":"HStack.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/HStack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,8FAgBlB,CAAC"}
1
+ {"version":3,"file":"HStack.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/HStack.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,8FAkBlB,CAAC"}
@@ -1,6 +1,7 @@
1
- import { View, type ViewProps } from 'react-native';
1
+ import type { View } from 'react-native';
2
+ import { type BoxProps } from '../Box';
2
3
  import { type StackSpace } from './styles';
3
- export interface VStackProps extends ViewProps {
4
+ export interface VStackProps extends Omit<BoxProps, 'asChild'> {
4
5
  className?: string;
5
6
  /** Token-based gap between children. */
6
7
  space?: StackSpace;
@@ -1 +1 @@
1
- {"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/VStack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,8FAgBlB,CAAC"}
1
+ {"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/VStack.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,8FAkBlB,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { Gesture } from 'react-native-gesture-handler';
2
- import { EntryOrExitLayoutType, useAnimatedStyle } from 'react-native-reanimated';
2
+ import { EntryOrExitLayoutType, FadeInDown, FadeInUp, useAnimatedStyle } from 'react-native-reanimated';
3
3
  import type { UseToastRootAnimationOptions } from './types';
4
- export declare const enteringTop: import("react-native-reanimated").ComplexAnimationBuilder;
4
+ export declare const enteringTop: FadeInUp;
5
5
  export declare const exitingTop: import("react-native-reanimated").ReanimatedKeyframe;
6
- export declare const enteringBottom: import("react-native-reanimated").ComplexAnimationBuilder;
6
+ export declare const enteringBottom: FadeInDown;
7
7
  export declare const exitingBottom: import("react-native-reanimated").ReanimatedKeyframe;
8
8
  export interface UseToastRootAnimationResult {
9
9
  rContainerStyle: ReturnType<typeof useAnimatedStyle>;
@@ -1 +1 @@
1
- {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAEL,qBAAqB,EAMrB,gBAAgB,EAKjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAI5D,eAAO,MAAM,WAAW,2DAKd,CAAC;AAEX,eAAO,MAAM,UAAU,sDAUP,CAAC;AAEjB,eAAO,MAAM,cAAc,2DAKjB,CAAC;AAEX,eAAO,MAAM,aAAa,sDAUV,CAAC;AAEjB,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IACrD,uBAAuB,EAAE,OAAO,CAAC;IACjC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC5C,OAAO,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC3C,UAAU,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5C;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,2BAA2B,CAiU7B"}
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAEL,qBAAqB,EAErB,UAAU,EACV,QAAQ,EAGR,gBAAgB,EAKjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAI5D,eAAO,MAAM,WAAW,UAKd,CAAC;AAEX,eAAO,MAAM,UAAU,sDAUP,CAAC;AAEjB,eAAO,MAAM,cAAc,YAKjB,CAAC;AAEX,eAAO,MAAM,aAAa,sDAUV,CAAC;AAEjB,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IACrD,uBAAuB,EAAE,OAAO,CAAC;IACjC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC5C,OAAO,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC3C,UAAU,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5C;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,2BAA2B,CAiU7B"}
@@ -12,7 +12,7 @@ export declare const toggleButtonRootVariants: (props?: ({
12
12
  */
13
13
  export declare const toggleButtonAttachedVariants: (props?: ({
14
14
  orientation?: "vertical" | "horizontal" | null | undefined;
15
- position?: "middle" | "first" | "only" | "last" | null | undefined;
15
+ position?: "middle" | "first" | "last" | "only" | null | undefined;
16
16
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
17
17
  export type ToggleButtonAttachedPosition = NonNullable<VariantProps<typeof toggleButtonAttachedVariants>['position']>;
18
18
  export declare const toggleButtonGroupVariants: (props?: ({
@@ -1,4 +1,5 @@
1
1
  /// <reference types="uniwind/types" preserve="true" />
2
+ import { View as RNView } from 'react-native';
2
3
  export * from './components';
3
4
  export * from './hooks';
4
5
  export * from './navigation';
@@ -6,6 +7,10 @@ export { ToastProvider, useToast } from './providers/toast';
6
7
  export type * from './providers/toast';
7
8
  export { ForgeDesignProvider } from './providers/forge-design';
8
9
  export type { ForgeDesignConfig, ForgeDesignProviderProps } from './providers/forge-design';
9
- export { View, ScrollView, KeyboardAvoidingView } from 'react-native';
10
+ export { ScrollView, KeyboardAvoidingView } from 'react-native';
10
11
  export { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
12
+ /** @deprecated Use `Box` instead. */
13
+ export declare const View: typeof RNView;
14
+ /** @deprecated Use `BoxRef` for refs and `BoxProps` for props instead. */
15
+ export type View = RNView;
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,mBAAmB,mBAAmB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAE9C,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,mBAAmB,mBAAmB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEjF,qCAAqC;AACrC,eAAO,MAAM,IAAI,eAAS,CAAC;AAC3B,0EAA0E;AAC1E,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdx-ui/components",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -106,20 +106,20 @@
106
106
  "@marceloterreiro/flash-calendar": "2.0.0",
107
107
  "react-native-reanimated-carousel": "5.0.0-beta.5",
108
108
  "uniwind": "1.10.0",
109
- "@cdx-ui/formatters": "0.2.4",
110
- "@cdx-ui/primitives": "0.2.4",
111
- "@cdx-ui/icons": "0.2.4",
112
- "@cdx-ui/utils": "0.2.4"
109
+ "@cdx-ui/icons": "0.3.0",
110
+ "@cdx-ui/primitives": "0.3.0",
111
+ "@cdx-ui/formatters": "0.3.0",
112
+ "@cdx-ui/utils": "0.3.0"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@dnd-kit/core": "6.3.1",
116
116
  "@dnd-kit/sortable": "10.0.0",
117
117
  "@dnd-kit/utilities": "3.2.2",
118
118
  "@react-navigation/bottom-tabs": "*",
119
- "@types/react": "19.1.17",
119
+ "@types/react": "19.2.14",
120
120
  "@types/react-dom": "*",
121
- "react": "19.1.0",
122
- "react-dom": "19.1.0",
121
+ "react": "19.2.3",
122
+ "react-dom": "19.2.3",
123
123
  "react-native": "*",
124
124
  "react-native-builder-bob": "*",
125
125
  "react-native-screens": "*",
@@ -5,6 +5,7 @@ import React, {
5
5
  useEffect,
6
6
  useId,
7
7
  useImperativeHandle,
8
+ useMemo,
8
9
  useRef,
9
10
  useState,
10
11
  type ReactNode,
@@ -25,15 +26,21 @@ import {
25
26
  type BottomSheetModalProps as GorhomBottomSheetModalProps,
26
27
  } from '@gorhom/bottom-sheet';
27
28
  import { useEscapeKey, useOverlayStackRegistration } from '@cdx-ui/primitives';
28
- import { cn } from '@cdx-ui/utils';
29
+ import { cn, ParentContext, useParentContext, useStyleContext } from '@cdx-ui/utils';
29
30
  import { SheetHeader } from '../sheet-header';
30
31
  import {
31
32
  bottomSheetBackgroundClassName,
32
33
  bottomSheetContentVariants,
33
34
  bottomSheetFooterVariants,
34
35
  bottomSheetModalContainerClassName,
36
+ type BottomSheetContentVariantProps,
35
37
  } from './styles';
36
38
 
39
+ const SCOPE = 'BOTTOM_SHEET';
40
+
41
+ const useBottomSheetStyleContext = () =>
42
+ (useStyleContext(SCOPE) ?? {}) as BottomSheetContentVariantProps;
43
+
37
44
  const ZERO_INSETS: EdgeInsets = { top: 0, bottom: 0, left: 0, right: 0 };
38
45
 
39
46
  function useSafeInsets(): EdgeInsets {
@@ -100,13 +107,19 @@ export interface BottomSheetContentProps {
100
107
  className?: string;
101
108
  /** Adds bottom padding equal to the safe-area inset. */
102
109
  hasSafeAreaInset?: boolean;
110
+ /** Removes horizontal padding. Inherits the parent `BottomSheet.Modal`'s `fullBleed` when omitted. */
111
+ fullBleed?: BottomSheetContentVariantProps['fullBleed'];
103
112
  style?: ViewStyle;
104
113
  }
105
114
 
106
115
  const BottomSheetContent = forwardRef<View, BottomSheetContentProps>(
107
- ({ children, className, hasSafeAreaInset, style }, ref) => {
116
+ ({ children, className, hasSafeAreaInset, fullBleed, style }, ref) => {
108
117
  const insets = useSafeInsets();
109
- const computedClassName = cn(bottomSheetContentVariants(), className);
118
+ const { fullBleed: fullBleedFromContext } = useBottomSheetStyleContext();
119
+ const computedClassName = cn(
120
+ bottomSheetContentVariants({ fullBleed: fullBleed ?? fullBleedFromContext }),
121
+ className,
122
+ );
110
123
  return (
111
124
  <View
112
125
  ref={ref}
@@ -162,6 +175,11 @@ export interface BottomSheetModalProps extends GorhomBottomSheetModalProps {
162
175
  * Pass it through this prop; a footer placed as a child does not animate with the sheet.
163
176
  */
164
177
  footer?: ReactNode;
178
+ /**
179
+ * Removes `BottomSheet.Content`'s horizontal padding so content can span the sheet edge to edge.
180
+ * `BottomSheet.Content` inherits this unless it sets its own `fullBleed`. The footer keeps its padding.
181
+ */
182
+ fullBleed?: BottomSheetContentVariantProps['fullBleed'];
165
183
  }
166
184
 
167
185
  const MAX_DYNAMIC_CONTENT_SIZE = Dimensions.get('window').height * 0.9;
@@ -185,151 +203,169 @@ const CustomBackground = (props: React.ComponentPropsWithoutRef<typeof View>) =>
185
203
  const BottomSheetModalStyled = forwardRef<
186
204
  React.ComponentRef<typeof BottomSheetModal>,
187
205
  BottomSheetModalProps
188
- >(({ handleVisible = true, footer, onDismiss, onChange, onAnimate, ...rest }, ref) => {
189
- const renderFooter = useCallback(
190
- (props: GorhomBottomSheetFooterProps) => (
191
- <GorhomBottomSheetFooter {...props}>{footer}</GorhomBottomSheetFooter>
192
- ),
193
- [footer],
194
- );
195
-
196
- const modalRef = useRef<BottomSheetModalRef | null>(null);
197
- const dismissedRef = useRef(false);
198
- const sheetMountedRef = useRef(false);
199
- const mountPendingRef = useRef(false);
200
- const pendingDismissRef = useRef<Parameters<BottomSheetModalRef['dismiss']> | null>(null);
201
- const [presented, setPresented] = useState(false);
202
-
203
- // Must stay a callback ref: gorhom hands this ref to its modal provider, which
204
- // reads `.current` to minimize and restore stacked sheets. A ref object would
205
- // switch that stacking on.
206
- const setModalRef = useCallback((instance: BottomSheetModalRef | null) => {
207
- modalRef.current = instance;
208
- }, []);
209
-
210
- // gorhom mounts the sheet a frame after `present()` and silently drops a
211
- // `dismiss()` that arrives before then, never reporting `onDismiss`. Holding
212
- // it until the sheet mounts keeps the early Escape/back claim releasable.
213
- const dismissSheet = useCallback((...args: Parameters<BottomSheetModalRef['dismiss']>) => {
214
- if (mountPendingRef.current) {
215
- pendingDismissRef.current = args;
216
- return;
217
- }
218
- modalRef.current?.dismiss(...args);
219
- }, []);
206
+ >(
207
+ (
208
+ { handleVisible = true, footer, fullBleed, children, onDismiss, onChange, onAnimate, ...rest },
209
+ ref,
210
+ ) => {
211
+ const parent = useParentContext();
212
+ const ctx = useMemo(() => ({ ...parent, [SCOPE]: { fullBleed } }), [parent, fullBleed]);
213
+
214
+ const renderFooter = useCallback(
215
+ (props: GorhomBottomSheetFooterProps) => (
216
+ <GorhomBottomSheetFooter {...props}>{footer}</GorhomBottomSheetFooter>
217
+ ),
218
+ [footer],
219
+ );
220
220
 
221
- const markSheetMounted = useCallback(() => {
222
- sheetMountedRef.current = true;
223
- if (!mountPendingRef.current) return;
224
- mountPendingRef.current = false;
225
- const pendingDismiss = pendingDismissRef.current;
226
- pendingDismissRef.current = null;
227
- if (pendingDismiss) modalRef.current?.dismiss(...pendingDismiss);
228
- }, []);
221
+ const modalRef = useRef<BottomSheetModalRef | null>(null);
222
+ const dismissedRef = useRef(false);
223
+ const sheetMountedRef = useRef(false);
224
+ const mountPendingRef = useRef(false);
225
+ const pendingDismissRef = useRef<Parameters<BottomSheetModalRef['dismiss']> | null>(null);
226
+ const [presented, setPresented] = useState(false);
227
+
228
+ // Must stay a callback ref: gorhom hands this ref to its modal provider, which
229
+ // reads `.current` to minimize and restore stacked sheets. A ref object would
230
+ // switch that stacking on.
231
+ const setModalRef = useCallback((instance: BottomSheetModalRef | null) => {
232
+ modalRef.current = instance;
233
+ }, []);
234
+
235
+ // gorhom mounts the sheet a frame after `present()` and silently drops a
236
+ // `dismiss()` that arrives before then, never reporting `onDismiss`. Holding
237
+ // it until the sheet mounts keeps the early Escape/back claim releasable.
238
+ const dismissSheet = useCallback((...args: Parameters<BottomSheetModalRef['dismiss']>) => {
239
+ if (mountPendingRef.current) {
240
+ pendingDismissRef.current = args;
241
+ return;
242
+ }
243
+ modalRef.current?.dismiss(...args);
244
+ }, []);
245
+
246
+ const markSheetMounted = useCallback(() => {
247
+ sheetMountedRef.current = true;
248
+ if (!mountPendingRef.current) return;
249
+ mountPendingRef.current = false;
250
+ const pendingDismiss = pendingDismissRef.current;
251
+ pendingDismissRef.current = null;
252
+ if (pendingDismiss) modalRef.current?.dismiss(...pendingDismiss);
253
+ }, []);
254
+
255
+ // `present()` claims Escape and back immediately; waiting for the first
256
+ // `onChange` would leave the overlay beneath in charge for the whole open animation.
257
+ useImperativeHandle(
258
+ ref,
259
+ (): BottomSheetModalRef => ({
260
+ present: (...args) => {
261
+ dismissedRef.current = false;
262
+ if (!sheetMountedRef.current) mountPendingRef.current = true;
263
+ setPresented(true);
264
+ modalRef.current?.present(...args);
265
+ },
266
+ dismiss: dismissSheet,
267
+ snapToIndex: (...args) => modalRef.current?.snapToIndex(...args),
268
+ snapToPosition: (...args) => modalRef.current?.snapToPosition(...args),
269
+ expand: (...args) => modalRef.current?.expand(...args),
270
+ collapse: (...args) => modalRef.current?.collapse(...args),
271
+ close: (...args) => modalRef.current?.close(...args),
272
+ forceClose: (...args) => modalRef.current?.forceClose(...args),
273
+ }),
274
+ [dismissSheet],
275
+ );
229
276
 
230
- // `present()` claims Escape and back immediately; waiting for the first
231
- // `onChange` would leave the overlay beneath in charge for the whole open animation.
232
- useImperativeHandle(
233
- ref,
234
- (): BottomSheetModalRef => ({
235
- present: (...args) => {
277
+ const handleDismiss = useCallback(() => {
278
+ sheetMountedRef.current = false;
279
+ mountPendingRef.current = false;
280
+ pendingDismissRef.current = null;
281
+ setPresented(false);
282
+ if (dismissedRef.current) return;
283
+ dismissedRef.current = true;
284
+ onDismiss?.();
285
+ }, [onDismiss]);
286
+
287
+ const handleChange = useCallback(
288
+ (...args: Parameters<NonNullable<BottomSheetModalProps['onChange']>>) => {
236
289
  dismissedRef.current = false;
237
- if (!sheetMountedRef.current) mountPendingRef.current = true;
238
- setPresented(true);
239
- modalRef.current?.present(...args);
290
+ setPresented(args[0] >= 0);
291
+ if (args[0] >= 0) markSheetMounted();
292
+ onChange?.(...args);
240
293
  },
241
- dismiss: dismissSheet,
242
- snapToIndex: (...args) => modalRef.current?.snapToIndex(...args),
243
- snapToPosition: (...args) => modalRef.current?.snapToPosition(...args),
244
- expand: (...args) => modalRef.current?.expand(...args),
245
- collapse: (...args) => modalRef.current?.collapse(...args),
246
- close: (...args) => modalRef.current?.close(...args),
247
- forceClose: (...args) => modalRef.current?.forceClose(...args),
248
- }),
249
- [dismissSheet],
250
- );
251
-
252
- const handleDismiss = useCallback(() => {
253
- sheetMountedRef.current = false;
254
- mountPendingRef.current = false;
255
- pendingDismissRef.current = null;
256
- setPresented(false);
257
- if (dismissedRef.current) return;
258
- dismissedRef.current = true;
259
- onDismiss?.();
260
- }, [onDismiss]);
261
-
262
- const handleChange = useCallback(
263
- (...args: Parameters<NonNullable<BottomSheetModalProps['onChange']>>) => {
264
- dismissedRef.current = false;
265
- setPresented(args[0] >= 0);
266
- if (args[0] >= 0) markSheetMounted();
267
- onChange?.(...args);
268
- },
269
- [markSheetMounted, onChange],
270
- );
294
+ [markSheetMounted, onChange],
295
+ );
271
296
 
272
- const handleAnimate = useCallback(
273
- (...args: Parameters<NonNullable<BottomSheetModalProps['onAnimate']>>) => {
274
- if (args[1] >= 0) markSheetMounted();
275
- onAnimate?.(...args);
276
- },
277
- [markSheetMounted, onAnimate],
278
- );
297
+ const handleAnimate = useCallback(
298
+ (...args: Parameters<NonNullable<BottomSheetModalProps['onAnimate']>>) => {
299
+ if (args[1] >= 0) markSheetMounted();
300
+ onAnimate?.(...args);
301
+ },
302
+ [markSheetMounted, onAnimate],
303
+ );
279
304
 
280
- const id = useId();
281
- const overlayId = `bottom-sheet-${id}`;
282
- useEscapeKey(presented, dismissSheet, {
283
- id: overlayId,
284
- groupId: overlayId,
285
- layer: 'modal',
286
- });
287
- const { isTopmost } = useOverlayStackRegistration({
288
- active: presented && Platform.OS !== 'web',
289
- capabilities: ['back'],
290
- id: overlayId,
291
- groupId: overlayId,
292
- layer: 'modal',
293
- });
294
-
295
- useEffect(() => {
296
- // BackHandler is native-only; react-native-web warns on every subscription.
297
- if (!presented || Platform.OS === 'web') return;
298
-
299
- const backHandler = BackHandler.addEventListener('hardwareBackPress', () => {
300
- if (!isTopmost('back')) return false;
301
- dismissSheet();
302
- return true;
305
+ const id = useId();
306
+ const overlayId = `bottom-sheet-${id}`;
307
+ useEscapeKey(presented, dismissSheet, {
308
+ id: overlayId,
309
+ groupId: overlayId,
310
+ layer: 'modal',
311
+ });
312
+ const { isTopmost } = useOverlayStackRegistration({
313
+ active: presented && Platform.OS !== 'web',
314
+ capabilities: ['back'],
315
+ id: overlayId,
316
+ groupId: overlayId,
317
+ layer: 'modal',
303
318
  });
304
319
 
305
- return () => {
306
- backHandler.remove();
307
- };
308
- }, [dismissSheet, isTopmost, presented]);
320
+ useEffect(() => {
321
+ // BackHandler is native-only; react-native-web warns on every subscription.
322
+ if (!presented || Platform.OS === 'web') return;
309
323
 
310
- const sheetContainerStyle = useResolveClassNames(bottomSheetModalContainerClassName);
311
- const handleIndicatorStyle = useResolveClassNames(
312
- 'bg-surface-neutral-subtle w-9 h-[5px] rounded-full',
313
- );
324
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', () => {
325
+ if (!isTopmost('back')) return false;
326
+ dismissSheet();
327
+ return true;
328
+ });
314
329
 
315
- return (
316
- <BottomSheetModal
317
- ref={setModalRef}
318
- enableDynamicSizing
319
- maxDynamicContentSize={MAX_DYNAMIC_CONTENT_SIZE}
320
- style={sheetContainerStyle}
321
- handleComponent={handleVisible ? undefined : null}
322
- handleIndicatorStyle={handleVisible ? handleIndicatorStyle : undefined}
323
- backdropComponent={CustomBackdrop}
324
- backgroundComponent={CustomBackground}
325
- {...rest}
326
- onDismiss={handleDismiss}
327
- onChange={handleChange}
328
- onAnimate={handleAnimate}
329
- {...(footer != null && { footerComponent: renderFooter })}
330
- />
331
- );
332
- });
330
+ return () => {
331
+ backHandler.remove();
332
+ };
333
+ }, [dismissSheet, isTopmost, presented]);
334
+
335
+ const sheetContainerStyle = useResolveClassNames(bottomSheetModalContainerClassName);
336
+ const handleIndicatorStyle = useResolveClassNames(
337
+ 'bg-surface-neutral-subtle w-9 h-[5px] rounded-full',
338
+ );
339
+
340
+ return (
341
+ <BottomSheetModal
342
+ ref={setModalRef}
343
+ enableDynamicSizing
344
+ maxDynamicContentSize={MAX_DYNAMIC_CONTENT_SIZE}
345
+ style={sheetContainerStyle}
346
+ handleComponent={handleVisible ? undefined : null}
347
+ handleIndicatorStyle={handleVisible ? handleIndicatorStyle : undefined}
348
+ backdropComponent={CustomBackdrop}
349
+ backgroundComponent={CustomBackground}
350
+ {...rest}
351
+ onDismiss={handleDismiss}
352
+ onChange={handleChange}
353
+ onAnimate={handleAnimate}
354
+ {...(footer != null && { footerComponent: renderFooter })}
355
+ >
356
+ {typeof children === 'function' ? (
357
+ (props: { data?: unknown }) => (
358
+ <ParentContext.Provider value={ctx}>
359
+ {children(props) as ReactNode}
360
+ </ParentContext.Provider>
361
+ )
362
+ ) : (
363
+ <ParentContext.Provider value={ctx}>{children}</ParentContext.Provider>
364
+ )}
365
+ </BottomSheetModal>
366
+ );
367
+ },
368
+ );
333
369
 
334
370
  BottomSheetModalStyled.displayName = 'BottomSheet.Modal';
335
371
 
@@ -1,4 +1,4 @@
1
- import { cva } from '@cdx-ui/utils';
1
+ import { cva, type VariantProps } from '@cdx-ui/utils';
2
2
 
3
3
  /** Keep gorhom's animated container unclipped so web transforms can settle correctly. */
4
4
  export const bottomSheetModalContainerClassName = 'rounded-t-4xl';
@@ -6,6 +6,14 @@ export const bottomSheetModalContainerClassName = 'rounded-t-4xl';
6
6
  /** Clip the static background for rounded corners without clipping the animated sheet. */
7
7
  export const bottomSheetBackgroundClassName = `${bottomSheetModalContainerClassName} overflow-hidden bg-surface-primary`;
8
8
 
9
- export const bottomSheetContentVariants = cva(['bg-surface-primary', 'px-5 pb-5 gap-3']);
9
+ export const bottomSheetContentVariants = cva(['bg-surface-primary', 'px-4 pb-4 gap-3'], {
10
+ variants: {
11
+ fullBleed: {
12
+ true: 'px-0',
13
+ },
14
+ },
15
+ });
10
16
 
11
- export const bottomSheetFooterVariants = cva(['px-5 pb-5 gap-2', 'bg-surface-primary']);
17
+ export type BottomSheetContentVariantProps = VariantProps<typeof bottomSheetContentVariants>;
18
+
19
+ export const bottomSheetFooterVariants = cva(['px-4 pb-5 gap-2', 'bg-surface-primary']);
@@ -1,16 +1,30 @@
1
1
  import { type ForwardedRef, forwardRef } from 'react';
2
2
  import { View, type ViewProps } from 'react-native';
3
+ import { Slot, dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
3
4
 
4
5
  export interface BoxProps extends ViewProps {
5
6
  className?: string;
7
+ /** Renders the child element in place of the default `View`, merging Box's props onto it. */
8
+ asChild?: boolean;
6
9
  }
7
10
 
8
- export const Box = forwardRef<View, BoxProps>(
9
- ({ children, ...restProps }, ref: ForwardedRef<View>) => {
11
+ /** The instance type of a `Box` ref, e.g. `useRef<BoxRef>(null)`. */
12
+ export type BoxRef = View;
13
+
14
+ export const Box = forwardRef<BoxRef, BoxProps>(
15
+ ({ asChild, children, ...restProps }, ref: ForwardedRef<BoxRef>) => {
16
+ const Comp = asChild ? Slot : View;
17
+
10
18
  return (
11
- <View ref={ref} {...restProps}>
19
+ <Comp
20
+ ref={ref}
21
+ {...restProps}
22
+ // Caller-supplied data attributes win so components composed on Box
23
+ // (HStack, VStack and their consumers) can replace the default slot.
24
+ {...mergeDataAttributes(dataAttributes({ slot: 'box' }), restProps)}
25
+ >
12
26
  {children}
13
- </View>
27
+ </Comp>
14
28
  );
15
29
  },
16
30
  );