@cdx-ui/components 0.3.2 → 0.3.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 (125) hide show
  1. package/README.md +2 -2
  2. package/coverage.svg +1 -1
  3. package/docs/components/color-field/content.md +2 -2
  4. package/docs/components/content.md +6 -4
  5. package/docs/components/data-grid/content.md +125 -1
  6. package/docs/components/date-field/content.md +2 -2
  7. package/docs/components/date-time-field/content.md +2 -2
  8. package/docs/components/input/content.md +20 -2
  9. package/docs/components/input/design.md +1 -1
  10. package/docs/components/insight/content.md +644 -0
  11. package/docs/components/insight-stack/content.md +231 -0
  12. package/docs/components/insurance-disclosure/content.md +1 -1
  13. package/docs/components/otp-input/content.md +2 -2
  14. package/docs/components/select/content.md +223 -24
  15. package/docs/components/text/content.md +97 -0
  16. package/docs/foundations/styles/tokens/all-tokens/content.md +23 -3
  17. package/docs/llms.txt +8 -4
  18. package/docs/patterns/forms/content.md +407 -0
  19. package/docs/resources/release-notes/0.3.2/content.md +17 -0
  20. package/docs/resources/release-notes/0.3.3/content.md +23 -0
  21. package/docs/resources/release-notes/content.md +2 -0
  22. package/lib/commonjs/components/Drawer/index.js +1 -1
  23. package/lib/commonjs/components/Drawer/index.js.map +1 -1
  24. package/lib/commonjs/components/Input/index.js.map +1 -1
  25. package/lib/commonjs/components/Input/styles.js +13 -6
  26. package/lib/commonjs/components/Input/styles.js.map +1 -1
  27. package/lib/commonjs/components/Insight/index.js +438 -0
  28. package/lib/commonjs/components/Insight/index.js.map +1 -0
  29. package/lib/commonjs/components/Insight/insetRadius.js +35 -0
  30. package/lib/commonjs/components/Insight/insetRadius.js.map +1 -0
  31. package/lib/commonjs/components/Insight/styles.js +186 -0
  32. package/lib/commonjs/components/Insight/styles.js.map +1 -0
  33. package/lib/commonjs/components/InsightStack/index.js +93 -0
  34. package/lib/commonjs/components/InsightStack/index.js.map +1 -0
  35. package/lib/commonjs/components/InsightStack/styles.js +61 -0
  36. package/lib/commonjs/components/InsightStack/styles.js.map +1 -0
  37. package/lib/commonjs/components/OtpInput/index.js.map +1 -1
  38. package/lib/commonjs/components/Select/index.js +326 -24
  39. package/lib/commonjs/components/Select/index.js.map +1 -1
  40. package/lib/commonjs/components/Select/styles.js +32 -1
  41. package/lib/commonjs/components/Select/styles.js.map +1 -1
  42. package/lib/commonjs/components/index.js +24 -0
  43. package/lib/commonjs/components/index.js.map +1 -1
  44. package/lib/commonjs/components/picker/surfaces.js +18 -3
  45. package/lib/commonjs/components/picker/surfaces.js.map +1 -1
  46. package/lib/commonjs/figma/Insight.figma.js +73 -0
  47. package/lib/commonjs/figma/Insight.figma.js.map +1 -0
  48. package/lib/commonjs/figma/InsightStack.figma.js +39 -0
  49. package/lib/commonjs/figma/InsightStack.figma.js.map +1 -0
  50. package/lib/module/components/Drawer/index.js +1 -1
  51. package/lib/module/components/Drawer/index.js.map +1 -1
  52. package/lib/module/components/Input/index.js.map +1 -1
  53. package/lib/module/components/Input/styles.js +14 -6
  54. package/lib/module/components/Input/styles.js.map +1 -1
  55. package/lib/module/components/Insight/index.js +433 -0
  56. package/lib/module/components/Insight/index.js.map +1 -0
  57. package/lib/module/components/Insight/insetRadius.js +30 -0
  58. package/lib/module/components/Insight/insetRadius.js.map +1 -0
  59. package/lib/module/components/Insight/styles.js +183 -0
  60. package/lib/module/components/Insight/styles.js.map +1 -0
  61. package/lib/module/components/InsightStack/index.js +89 -0
  62. package/lib/module/components/InsightStack/index.js.map +1 -0
  63. package/lib/module/components/InsightStack/styles.js +58 -0
  64. package/lib/module/components/InsightStack/styles.js.map +1 -0
  65. package/lib/module/components/OtpInput/index.js.map +1 -1
  66. package/lib/module/components/Select/index.js +328 -26
  67. package/lib/module/components/Select/index.js.map +1 -1
  68. package/lib/module/components/Select/styles.js +31 -0
  69. package/lib/module/components/Select/styles.js.map +1 -1
  70. package/lib/module/components/index.js +2 -0
  71. package/lib/module/components/index.js.map +1 -1
  72. package/lib/module/components/picker/surfaces.js +17 -3
  73. package/lib/module/components/picker/surfaces.js.map +1 -1
  74. package/lib/module/figma/Insight.figma.js +67 -0
  75. package/lib/module/figma/Insight.figma.js.map +1 -0
  76. package/lib/module/figma/InsightStack.figma.js +33 -0
  77. package/lib/module/figma/InsightStack.figma.js.map +1 -0
  78. package/lib/typescript/components/ColorField/styles.d.ts +4 -2
  79. package/lib/typescript/components/ColorField/styles.d.ts.map +1 -1
  80. package/lib/typescript/components/DateField/styles.d.ts +4 -2
  81. package/lib/typescript/components/DateField/styles.d.ts.map +1 -1
  82. package/lib/typescript/components/Input/index.d.ts +3 -2
  83. package/lib/typescript/components/Input/index.d.ts.map +1 -1
  84. package/lib/typescript/components/Input/styles.d.ts +1 -1
  85. package/lib/typescript/components/Input/styles.d.ts.map +1 -1
  86. package/lib/typescript/components/Insight/index.d.ts +87 -0
  87. package/lib/typescript/components/Insight/index.d.ts.map +1 -0
  88. package/lib/typescript/components/Insight/insetRadius.d.ts +8 -0
  89. package/lib/typescript/components/Insight/insetRadius.d.ts.map +1 -0
  90. package/lib/typescript/components/Insight/styles.d.ts +33 -0
  91. package/lib/typescript/components/Insight/styles.d.ts.map +1 -0
  92. package/lib/typescript/components/InsightStack/index.d.ts +21 -0
  93. package/lib/typescript/components/InsightStack/index.d.ts.map +1 -0
  94. package/lib/typescript/components/InsightStack/styles.d.ts +11 -0
  95. package/lib/typescript/components/InsightStack/styles.d.ts.map +1 -0
  96. package/lib/typescript/components/OtpInput/index.d.ts +3 -2
  97. package/lib/typescript/components/OtpInput/index.d.ts.map +1 -1
  98. package/lib/typescript/components/Select/index.d.ts +73 -6
  99. package/lib/typescript/components/Select/index.d.ts.map +1 -1
  100. package/lib/typescript/components/Select/styles.d.ts +9 -0
  101. package/lib/typescript/components/Select/styles.d.ts.map +1 -1
  102. package/lib/typescript/components/index.d.ts +2 -0
  103. package/lib/typescript/components/index.d.ts.map +1 -1
  104. package/lib/typescript/components/picker/surfaces.d.ts +14 -3
  105. package/lib/typescript/components/picker/surfaces.d.ts.map +1 -1
  106. package/lib/typescript/figma/Insight.figma.d.ts +8 -0
  107. package/lib/typescript/figma/Insight.figma.d.ts.map +1 -0
  108. package/lib/typescript/figma/InsightStack.figma.d.ts +8 -0
  109. package/lib/typescript/figma/InsightStack.figma.d.ts.map +1 -0
  110. package/package.json +5 -5
  111. package/src/components/ColorField/styles.ts +3 -1
  112. package/src/components/DateField/styles.ts +6 -1
  113. package/src/components/Drawer/index.tsx +1 -1
  114. package/src/components/Input/index.tsx +3 -2
  115. package/src/components/Input/styles.ts +35 -15
  116. package/src/components/Insight/index.tsx +531 -0
  117. package/src/components/Insight/insetRadius.ts +30 -0
  118. package/src/components/Insight/styles.ts +193 -0
  119. package/src/components/InsightStack/index.tsx +86 -0
  120. package/src/components/InsightStack/styles.ts +61 -0
  121. package/src/components/OtpInput/index.tsx +3 -2
  122. package/src/components/Select/index.tsx +411 -29
  123. package/src/components/Select/styles.ts +36 -0
  124. package/src/components/index.ts +2 -0
  125. package/src/components/picker/surfaces.tsx +29 -4
@@ -1,6 +1,7 @@
1
1
  import { useCallback, useEffect, useRef, useState, type ReactNode, type RefObject } from 'react';
2
2
  import { ScrollView, View } from 'react-native';
3
3
  import { FadeIn, FadeOut } from 'react-native-reanimated';
4
+ import { BottomSheetTextInput } from '@gorhom/bottom-sheet';
4
5
  import {
5
6
  dataAttributes,
6
7
  OverlayContainer,
@@ -41,23 +42,40 @@ export function PickerDialogSurface({
41
42
  type PickerBottomSheetSurfaceProps = {
42
43
  open: boolean;
43
44
  setOpen: (open: boolean) => void;
44
- registerSurface: (type: 'bottomSheet') => void;
45
+ registerSurface?: (type: 'bottomSheet') => void;
46
+ /**
47
+ * Lays the children out in a container that fills the sheet, so a fixed header can sit above a
48
+ * `BottomSheet.ScrollView`. By default the children size a `BottomSheet.View`.
49
+ */
50
+ fill?: boolean;
45
51
  children: ReactNode;
46
- } & Pick<BottomSheetModalProps, 'snapPoints' | 'enableDynamicSizing'>;
52
+ } & Pick<
53
+ BottomSheetModalProps,
54
+ 'snapPoints' | 'enableDynamicSizing' | 'keyboardBehavior' | 'keyboardBlurBehavior' | 'accessible'
55
+ >;
56
+
57
+ /**
58
+ * Text input for a picker sheet. It registers with the sheet's keyboard handling, which moves
59
+ * the sheet for a focused `BottomSheetTextInput` only; a plain `TextInput` stays under the
60
+ * keyboard.
61
+ */
62
+ export const PickerSheetTextInput = BottomSheetTextInput;
47
63
 
48
64
  export function PickerBottomSheetSurface({
49
65
  open,
50
66
  setOpen,
51
67
  registerSurface,
68
+ fill = false,
52
69
  children,
53
70
  snapPoints = ['70%', '90%'],
54
71
  enableDynamicSizing = false,
72
+ ...modalProps
55
73
  }: PickerBottomSheetSurfaceProps) {
56
74
  const { ref, dismiss } = useBottomSheet();
57
75
  const isPresentedRef = useRef(false);
58
76
 
59
77
  useEffect(() => {
60
- registerSurface('bottomSheet');
78
+ registerSurface?.('bottomSheet');
61
79
  }, [registerSurface]);
62
80
 
63
81
  const handleDismiss = useCallback(() => {
@@ -95,8 +113,15 @@ export function PickerBottomSheetSurface({
95
113
  onDismiss={handleDismiss}
96
114
  snapPoints={snapPoints}
97
115
  enableDynamicSizing={enableDynamicSizing}
116
+ {...modalProps}
98
117
  >
99
- <BottomSheet.View onLayout={tryPresent}>{children}</BottomSheet.View>
118
+ {fill ? (
119
+ <View className="flex-1" onLayout={tryPresent}>
120
+ {children}
121
+ </View>
122
+ ) : (
123
+ <BottomSheet.View onLayout={tryPresent}>{children}</BottomSheet.View>
124
+ )}
100
125
  </BottomSheet.Modal>
101
126
  );
102
127
  }