@platform-blocks/ui 0.6.1 → 0.7.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 (50) hide show
  1. package/README.md +0 -24
  2. package/lib/cjs/index.js +18 -15
  3. package/lib/cjs/index.js.map +1 -1
  4. package/lib/components/Accordion/types.d.ts +5 -5
  5. package/lib/components/AutoComplete/types.d.ts +3 -3
  6. package/lib/components/Avatar/types.d.ts +3 -3
  7. package/lib/components/Badge/types.d.ts +3 -3
  8. package/lib/components/Block/types.d.ts +2 -2
  9. package/lib/components/Blockquote/types.d.ts +2 -2
  10. package/lib/components/Breadcrumbs/types.d.ts +4 -4
  11. package/lib/components/Calendar/types.d.ts +2 -2
  12. package/lib/components/Carousel/types.d.ts +3 -3
  13. package/lib/components/Chip/types.d.ts +3 -3
  14. package/lib/components/CodeBlock/types.d.ts +4 -4
  15. package/lib/components/ColorPicker/types.d.ts +4 -4
  16. package/lib/components/CopyButton/types.d.ts +2 -2
  17. package/lib/components/DatePicker/types.d.ts +2 -2
  18. package/lib/components/Divider/types.d.ts +2 -2
  19. package/lib/components/Grid/types.d.ts +3 -3
  20. package/lib/components/HoverCard/types.d.ts +2 -2
  21. package/lib/components/Image/types.d.ts +3 -3
  22. package/lib/components/Indicator/types.d.ts +2 -2
  23. package/lib/components/Knob/components/SurfaceLayers.d.ts +2 -2
  24. package/lib/components/Knob/components/ThumbLayer.d.ts +1 -1
  25. package/lib/components/Knob/components/TickLayers.d.ts +2 -2
  26. package/lib/components/Knob/types.d.ts +11 -11
  27. package/lib/components/ListGroup/types.d.ts +4 -4
  28. package/lib/components/Loader/types.d.ts +2 -2
  29. package/lib/components/Masonry/types.d.ts +4 -4
  30. package/lib/components/Navigation/types.d.ts +2 -2
  31. package/lib/components/Notice/types.d.ts +2 -2
  32. package/lib/components/Pagination/types.d.ts +6 -6
  33. package/lib/components/Progress/types.d.ts +3 -3
  34. package/lib/components/QRCode/types.d.ts +2 -2
  35. package/lib/components/Rating/types.d.ts +2 -2
  36. package/lib/components/Ring/types.d.ts +7 -7
  37. package/lib/components/SegmentedControl/types.d.ts +4 -4
  38. package/lib/components/Skeleton/types.d.ts +2 -2
  39. package/lib/components/Slider/types.d.ts +7 -7
  40. package/lib/components/Spotlight/types.d.ts +6 -6
  41. package/lib/components/Tabs/types.d.ts +5 -5
  42. package/lib/components/Toast/types.d.ts +2 -2
  43. package/lib/components/Tooltip/types.d.ts +2 -2
  44. package/lib/components/Video/NativeVideoPlayer.d.ts +2 -2
  45. package/lib/components/Video/VideoControls.d.ts +2 -2
  46. package/lib/components/Video/YouTubePlayer.d.ts +2 -2
  47. package/lib/components/Video/types.d.ts +4 -4
  48. package/lib/esm/index.js +18 -15
  49. package/lib/esm/index.js.map +1 -1
  50. package/package.json +1 -1
package/README.md CHANGED
@@ -34,27 +34,3 @@ export function App() {
34
34
  );
35
35
  }
36
36
  ```
37
-
38
- Refer to the documentation site for component examples and API details. A dedicated “Keyboard Management” guide is available at `/keyboard` within the docs app.
39
-
40
- ## Keyboard Management
41
-
42
- Packages that render focusable inputs can opt into shared keyboard state by wrapping their tree in `KeyboardManagerProvider`. This unlocks the `useKeyboardManager()` hook and ensures components like `AutoComplete` and `Select` dismiss or refocus the keyboard consistently across web and native platforms.
43
-
44
- ```tsx
45
- import { KeyboardManagerProvider, KeyboardAwareLayout } from '@platform-blocks/ui';
46
-
47
- export function App() {
48
- return (
49
- <KeyboardManagerProvider>
50
- <KeyboardAwareLayout>
51
- {/* form inputs */}
52
- </KeyboardAwareLayout>
53
- </KeyboardManagerProvider>
54
- );
55
- }
56
- ```
57
-
58
- `KeyboardAwareLayout` is optional but recommended for screens where the on-screen keyboard could obscure lower inputs. Components expose a `refocusAfterSelect` prop that lets you override the default dismissal behavior when selections complete.
59
-
60
- For direct inputs, you can pass `keyboardFocusId` to make a field eligible for deferred refocus requests triggered via `KeyboardManagerProvider` (for example, when an overlay completes a selection and needs to restore focus to a specific input).
package/lib/cjs/index.js CHANGED
@@ -6722,23 +6722,25 @@ function Dialog({ visible, variant = 'modal', title, children, closable = true,
6722
6722
  }, visible && closable);
6723
6723
  // Pan responder for bottomsheet swipe-to-dismiss
6724
6724
  const panResponder = React.useRef(reactNative.PanResponder.create({
6725
+ onStartShouldSetPanResponderCapture: () => {
6726
+ // Never capture on touch start — let events reach children (buttons) first
6727
+ return false;
6728
+ },
6725
6729
  onStartShouldSetPanResponder: () => {
6726
- // Only allow responder when swipe gestures are enabled for bottom sheet
6730
+ // Claim in bubble phase (after children had their chance to claim).
6731
+ // If a Button/Pressable already claimed the touch, this won't fire.
6732
+ // If nothing claimed (e.g. drag handle, empty space), we take over for swipe tracking.
6727
6733
  return variant === 'bottomsheet' && bottomSheetSwipeZone !== 'none';
6728
6734
  },
6729
- onStartShouldSetPanResponderCapture: () => {
6730
- // Capture immediately for bottom sheet to ensure gesture responsiveness on native
6731
- return variant === 'bottomsheet' && bottomSheetSwipeZone !== 'none';
6735
+ onMoveShouldSetPanResponderCapture: () => {
6736
+ // Never capture moves let children handle their own gestures
6737
+ return false;
6732
6738
  },
6733
6739
  onMoveShouldSetPanResponder: (_, gestureState) => {
6734
- // Allow movement in any direction but prioritize downward movement
6740
+ // Claim the gesture when there's a clear vertical swipe movement
6735
6741
  return variant === 'bottomsheet' && bottomSheetSwipeZone !== 'none' && (Math.abs(gestureState.dy) > Math.abs(gestureState.dx) &&
6736
6742
  Math.abs(gestureState.dy) > 2);
6737
6743
  },
6738
- onMoveShouldSetPanResponderCapture: () => {
6739
- // Already captured on start; keep returning true for consistency
6740
- return variant === 'bottomsheet' && bottomSheetSwipeZone !== 'none';
6741
- },
6742
6744
  onPanResponderGrant: (evt) => {
6743
6745
  // Prevent default browser behavior (text selection, etc.) on web
6744
6746
  if (reactNative.Platform.OS === 'web') {
@@ -10842,7 +10844,7 @@ const Masonry = factory((props, ref) => {
10842
10844
  };
10843
10845
  const containerStyle = {
10844
10846
  ...spacingStyle,
10845
- ...style,
10847
+ ...reactNative.StyleSheet.flatten(style),
10846
10848
  };
10847
10849
  // Show loading state
10848
10850
  if (loading) {
@@ -14503,7 +14505,8 @@ const CodeBlock = (props) => {
14503
14505
  if (spoiler) {
14504
14506
  wrappedCodeContent = (jsxRuntime.jsx(Spoiler, { maxHeight: spoilerMaxHeight, children: scrollableCodeContent }));
14505
14507
  }
14506
- const userHasWidth = Boolean(style && (style.width !== undefined || style.flex !== undefined));
14508
+ const flatStyle = reactNative.StyleSheet.flatten(style);
14509
+ const userHasWidth = Boolean(flatStyle && (flatStyle.width !== undefined || flatStyle.flex !== undefined));
14507
14510
  const containerStyle = userHasWidth ? [{ marginBottom: 20 }, style, spacingStyles] : [styles.container, spacingStyles, style];
14508
14511
  const showHeaderBar = fileHeader && fileName && variant !== 'terminal';
14509
14512
  const inlineTitleVisible = variant === 'code' && (title || fileName);
@@ -30976,7 +30979,7 @@ function Avatar({ size = 'md', src, fallback, backgroundColor, textColor = 'whit
30976
30979
  };
30977
30980
  const containerStyle = {
30978
30981
  position: 'relative',
30979
- ...style,
30982
+ ...reactNative.StyleSheet.flatten(style),
30980
30983
  };
30981
30984
  const content = (jsxRuntime.jsxs(reactNative.View, { style: containerStyle, children: [jsxRuntime.jsx(reactNative.View, { style: avatarStyle, children: src ? (jsxRuntime.jsx(reactNative.Image, { source: { uri: src }, style: {
30982
30985
  width: avatarSize,
@@ -30997,7 +31000,7 @@ function AvatarGroup({ children, limit, spacing = -8, style, size, bordered = tr
30997
31000
  const containerStyle = {
30998
31001
  flexDirection: 'row',
30999
31002
  alignItems: 'center',
31000
- ...style,
31003
+ ...reactNative.StyleSheet.flatten(style),
31001
31004
  };
31002
31005
  const avatarWrapperStyle = (index) => ({
31003
31006
  marginLeft: index > 0 ? spacing : 0,
@@ -37183,7 +37186,7 @@ function Image({ src, source, alt, accessibilityLabel, resizeMode = 'cover', siz
37183
37186
  const spacingStyles = getSpacingStyles(spacingProps);
37184
37187
  const containerStyles = {
37185
37188
  ...spacingStyles,
37186
- ...containerStyle,
37189
+ ...reactNative.StyleSheet.flatten(containerStyle),
37187
37190
  };
37188
37191
  const imageStyles = {
37189
37192
  width: finalWidth,
@@ -37192,7 +37195,7 @@ function Image({ src, source, alt, accessibilityLabel, resizeMode = 'cover', siz
37192
37195
  borderWidth,
37193
37196
  borderColor: borderColor || theme.colors.gray[3],
37194
37197
  borderRadius,
37195
- ...imageStyle,
37198
+ ...reactNative.StyleSheet.flatten(imageStyle),
37196
37199
  };
37197
37200
  if (finalWidth !== undefined) {
37198
37201
  containerStyles.width = finalWidth;