@platform-blocks/ui 0.1.2 → 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 (81) hide show
  1. package/README.md +60 -1
  2. package/lib/cjs/index.js +5970 -2471
  3. package/lib/cjs/index.js.map +1 -1
  4. package/lib/components/AutoComplete/types.d.ts +2 -0
  5. package/lib/components/Avatar/types.d.ts +3 -2
  6. package/lib/components/Badge/types.d.ts +4 -4
  7. package/lib/components/Blockquote/styles.d.ts +2 -1
  8. package/lib/components/Breadcrumbs/types.d.ts +2 -1
  9. package/lib/components/Calendar/types.d.ts +1 -0
  10. package/lib/components/Card/types.d.ts +1 -1
  11. package/lib/components/Carousel/types.d.ts +3 -2
  12. package/lib/components/Chip/types.d.ts +1 -1
  13. package/lib/components/ColorPicker/styles.d.ts +15 -1
  14. package/lib/components/ColorPicker/types.d.ts +4 -1
  15. package/lib/components/CopyButton/types.d.ts +3 -2
  16. package/lib/components/Dialog/Dialog.d.ts +1 -1
  17. package/lib/components/Dialog/types.d.ts +3 -0
  18. package/lib/components/FileInput/types.d.ts +12 -3
  19. package/lib/components/Highlight/Highlight.d.ts +4 -0
  20. package/lib/components/Highlight/index.d.ts +3 -0
  21. package/lib/components/Highlight/types.d.ts +24 -0
  22. package/lib/components/Input/styles.d.ts +0 -24
  23. package/lib/components/Input/types.d.ts +2 -0
  24. package/lib/components/KeyCap/types.d.ts +9 -2
  25. package/lib/components/KeyboardAwareLayout/KeyboardAwareLayout.d.ts +4 -0
  26. package/lib/components/KeyboardAwareLayout/index.d.ts +3 -0
  27. package/lib/components/KeyboardAwareLayout/types.d.ts +26 -0
  28. package/lib/components/Knob/Knob.d.ts +6 -0
  29. package/lib/components/Knob/index.d.ts +2 -0
  30. package/lib/components/Knob/types.d.ts +65 -0
  31. package/lib/components/ListGroup/types.d.ts +11 -2
  32. package/lib/components/MenuItemButton/MenuItemButton.d.ts +31 -2
  33. package/lib/components/MonthPicker/types.d.ts +2 -2
  34. package/lib/components/NumberInput/types.d.ts +14 -0
  35. package/lib/components/Pagination/types.d.ts +10 -1
  36. package/lib/components/PinInput/types.d.ts +2 -0
  37. package/lib/components/Popover/Popover.d.ts +20 -0
  38. package/lib/components/Popover/index.d.ts +2 -0
  39. package/lib/components/Popover/styles.d.ts +67 -0
  40. package/lib/components/Popover/types.d.ts +131 -0
  41. package/lib/components/Ring/Ring.d.ts +8 -0
  42. package/lib/components/Ring/index.d.ts +3 -0
  43. package/lib/components/Ring/types.d.ts +75 -0
  44. package/lib/components/SegmentedControl/types.d.ts +8 -2
  45. package/lib/components/Select/Select.d.ts +0 -1
  46. package/lib/components/Select/Select.types.d.ts +33 -0
  47. package/lib/components/ShimmerText/ShimmerText.d.ts +1 -0
  48. package/lib/components/Spotlight/DirectSpotlightState.d.ts +1 -1
  49. package/lib/components/Spotlight/Spotlight.d.ts +2 -2
  50. package/lib/components/Spotlight/SpotlightController.d.ts +2 -1
  51. package/lib/components/Spotlight/types.d.ts +6 -2
  52. package/lib/components/Stepper/types.d.ts +10 -2
  53. package/lib/components/TextArea/styles.d.ts +3 -33
  54. package/lib/components/TextArea/types.d.ts +2 -1
  55. package/lib/components/TimePicker/TimePicker.d.ts +1 -3
  56. package/lib/components/TimePickerInput/TimePickerInput.d.ts +3 -0
  57. package/lib/components/TimePickerInput/index.d.ts +2 -2
  58. package/lib/components/TimePickerInput/types.d.ts +3 -0
  59. package/lib/components/Timeline/types.d.ts +10 -2
  60. package/lib/components/Toast/types.d.ts +2 -0
  61. package/lib/components/Tree/types.d.ts +7 -0
  62. package/lib/components/index.d.ts +10 -0
  63. package/lib/components/optimized.d.ts +5 -0
  64. package/lib/components/types.d.ts +3 -0
  65. package/lib/core/factory/factory.d.ts +3 -3
  66. package/lib/core/hooks/usePopoverPositioning.d.ts +2 -5
  67. package/lib/core/keyboard/selection.d.ts +42 -0
  68. package/lib/core/providers/KeyboardManagerProvider.d.ts +45 -0
  69. package/lib/core/providers/index.d.ts +3 -1
  70. package/lib/core/theme/PlatformBlocksProvider.d.ts +16 -2
  71. package/lib/core/theme/componentSize.d.ts +10 -0
  72. package/lib/core/theme/index.d.ts +1 -0
  73. package/lib/core/theme/sizes.d.ts +2 -1
  74. package/lib/core/theme/types.d.ts +4 -2
  75. package/lib/esm/index.js +5963 -2475
  76. package/lib/esm/index.js.map +1 -1
  77. package/lib/index.d.ts +15 -0
  78. package/lib/utils/optionalDependencies.d.ts +28 -0
  79. package/lib/utils/optionalModule.d.ts +16 -0
  80. package/package.json +38 -40
  81. package/lib/components/Select/types.d.ts +0 -25
package/README.md CHANGED
@@ -1 +1,60 @@
1
- Platform Blocks UI Component Library for React Native
1
+ # Platform Blocks UI Component Library for React Native
2
+
3
+ ## Compatibility
4
+
5
+ - `react` `>=18.0.0 <20.0.0`
6
+ - `react-native` `>=0.73.0`
7
+ - `react-native-reanimated` `>=3.4.0`
8
+ - `react-native-safe-area-context` `>=4.5.0`
9
+ - `react-native-svg` `>=13.0.0`
10
+ - Optional integrations: `expo-audio`, `expo-document-picker`, `expo-haptics`, `expo-linear-gradient`, `expo-status-bar`, `react-syntax-highlighter`, `@react-native-masked-view/masked-view`, `@shopify/flash-list`, `react-native-reanimated-carousel`
11
+
12
+ The library lazily requires optional modules, so they only need to be installed when you use features that depend on them.
13
+
14
+ ## Installation
15
+
16
+ Install peer dependencies that match your application runtime, then add the package:
17
+
18
+ ```bash
19
+ npm install @platform-blocks/ui
20
+ ```
21
+
22
+ If you rely on optional integrations, add them with versions compatible with your project’s React Native or Expo SDK.
23
+
24
+ ## Usage
25
+
26
+ ```tsx
27
+ import { PlatformBlocksProvider, Button } from '@platform-blocks/ui';
28
+
29
+ export function App() {
30
+ return (
31
+ <PlatformBlocksProvider>
32
+ <Button label="Hello" />
33
+ </PlatformBlocksProvider>
34
+ );
35
+ }
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).