@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/lib/index.d.ts CHANGED
@@ -10,6 +10,8 @@ export { I18nProvider, useI18n } from './core/i18n';
10
10
  export { OverlayProvider, useOverlay, useOverlayApi, useOverlays } from './core/providers/OverlayProvider';
11
11
  export { DirectionProvider, useDirection, useDirectionSafe } from './core/providers/DirectionProvider';
12
12
  export type { Direction, DirectionContextValue, DirectionProviderProps, StorageController } from './core/providers/DirectionProvider';
13
+ export { KeyboardManagerProvider, useKeyboardManager, useKeyboardManagerOptional } from './core/providers/KeyboardManagerProvider';
14
+ export type { KeyboardManagerProviderProps, KeyboardManagerContextValue } from './core/providers/KeyboardManagerProvider';
13
15
  export { AccessibilityProvider, useAccessibility } from './core/accessibility/context';
14
16
  export { SoundProvider, useSound, useHaptics, getAllSounds, getSoundsByCategory, createSound, DEFAULT_SOUND_IDS } from './core/sound';
15
17
  export type { SoundAsset, SoundOptions, HapticFeedbackOptions } from './core/sound';
@@ -22,6 +24,7 @@ export { resolveSize, getIconSize, getHeight, getSpacing, getLineHeight, COMPONE
22
24
  export { DEFAULT_BREAKPOINTS, resolveResponsiveProp } from './core/theme/breakpoints';
23
25
  export { useHotkeys, useGlobalHotkeys, useEscapeKey, useToggleColorScheme, useSpotlightToggle, globalHotkeys, } from './hooks';
24
26
  export { Container } from './components/Container';
27
+ export { KeyboardAwareLayout } from './components/KeyboardAwareLayout';
25
28
  export { Flex } from './components/Flex';
26
29
  export { Grid, GridItem } from './components/Grid';
27
30
  export { Masonry } from './components/Masonry';
@@ -29,6 +32,7 @@ export { AppShell, useAppShell, useAppShellApi, useAppShellLayout, AppShellHeade
29
32
  export { Row, Column } from './components/Layout';
30
33
  export { Text, H1, H2, H3, H4, H5, H6, P, Small, Strong, Bold, Italic, Emphasis, Underline, Code, Kbd, Mark, Cite, Sub, Sup } from './components/Text';
31
34
  export { ShimmerText } from './components/ShimmerText';
35
+ export { Highlight } from './components/Highlight';
32
36
  export { Title, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6 } from './components/Title';
33
37
  export { Markdown } from './components/Markdown';
34
38
  export { Button } from './components/Button';
@@ -46,6 +50,7 @@ export { ToggleButton, ToggleGroup } from './components/Toggle';
46
50
  export { ToggleBar } from './components/Toggle';
47
51
  export { SegmentedControl } from './components/SegmentedControl';
48
52
  export { Slider, RangeSlider } from './components/Slider';
53
+ export { Knob } from './components/Knob';
49
54
  export { Search } from './components/Search';
50
55
  export { Select } from './components/Select';
51
56
  export { AutoComplete } from './components/AutoComplete';
@@ -90,6 +95,7 @@ export { Progress } from './components/Progress';
90
95
  export { Skeleton } from './components/Skeleton';
91
96
  export { Loader } from './components/Loader';
92
97
  export { Gauge } from './components/Gauge';
98
+ export { Ring } from './components/Ring';
93
99
  export { NavigationProgress, navigationProgress } from './components/NavigationProgress';
94
100
  export { Toast, ToastProvider, useToast, useToastApi, toast, onToastsRequested } from './components/Toast';
95
101
  export { Dialog, DialogProvider, DialogRenderer, useDialog, useDialogApi, useDialogs, useSimpleDialog, onDialogsRequested } from './components/Dialog';
@@ -98,6 +104,7 @@ export { Overlay } from './components/Overlay';
98
104
  export { LoadingOverlay } from './components/LoadingOverlay';
99
105
  export { HoverCard } from './components/HoverCard';
100
106
  export { ContextMenu } from './components/ContextMenu';
107
+ export { Popover } from './components/Popover';
101
108
  export { Spotlight, SpotlightProvider, useSpotlightStore, spotlight, createSpotlightStore, useSpotlightStoreInstance, useDirectSpotlightState, directSpotlight, onSpotlightRequested } from './components/Spotlight';
102
109
  export { FloatingActions } from './components/FloatingActions';
103
110
  export { Can, CanWithConditions, Cannot, PermissionGate, withCan, withCannot } from './components/Can';
@@ -126,6 +133,9 @@ export type { PlatformBlocksTheme, PlatformBlocksThemeOverride } from './core/th
126
133
  export type { PlatformBlocksProviderProps } from './core/theme/PlatformBlocksProvider';
127
134
  export type { ColorScheme } from './core/theme/useColorScheme';
128
135
  export type { SizeValue } from './core/theme/sizes';
136
+ export { COMPONENT_SIZE_ORDER, DEFAULT_COMPONENT_SIZE, clampComponentSize, resolveComponentSize, } from './core/theme/componentSize';
137
+ export type { ComponentSize, ComponentSizeValue, } from './core/theme/componentSize';
138
+ export type { SizeToken } from './core/theme/types';
129
139
  export type { ResponsiveProp } from './core/theme/breakpoints';
130
140
  export type { HotkeyItem, KeyboardModifiers } from './hooks';
131
141
  export type { ButtonProps } from './components/Button';
@@ -135,9 +145,11 @@ export type { AppStoreBadgeProps, AppStoreBadgeSize, SupportedLocale, BadgeConfi
135
145
  export type { TreeProps, TreeNode } from './components/Tree';
136
146
  export type { TextProps } from './components/Text';
137
147
  export type { ShimmerTextProps } from './components/ShimmerText';
148
+ export type { HighlightProps } from './components/Highlight';
138
149
  export type { OverlayProps } from './components/Overlay';
139
150
  export type { TitleProps } from './components/Title/types';
140
151
  export type { ContainerProps } from './components/Container';
152
+ export type { KeyboardAwareLayoutProps } from './components/KeyboardAwareLayout';
141
153
  export type { FlexProps } from './components/Flex';
142
154
  export type { GridProps, GridItemProps } from './components/Grid';
143
155
  export type { MasonryProps, MasonryItem } from './components/Masonry';
@@ -151,6 +163,7 @@ export type { ToggleButtonProps, ToggleGroupProps } from './components/Toggle';
151
163
  export type { ToggleBarProps, ToggleBarOption } from './components/Toggle/ToggleBar';
152
164
  export type { SegmentedControlProps, SegmentedControlItem, SegmentedControlData } from './components/SegmentedControl';
153
165
  export type { SliderProps, RangeSliderProps } from './components/Slider';
166
+ export type { KnobProps, KnobMark } from './components/Knob';
154
167
  export type { SearchProps } from './components/Search';
155
168
  export type { SelectProps } from './components/Select';
156
169
  export type { AutoCompleteProps } from './components/AutoComplete';
@@ -190,11 +203,13 @@ export type { SkeletonProps } from './components/Skeleton';
190
203
  export type { LoaderProps } from './components/Loader';
191
204
  export type { LoadingOverlayProps } from './components/LoadingOverlay';
192
205
  export type { GaugeProps } from './components/Gauge';
206
+ export type { RingProps, RingColorStop, RingRenderContext } from './components/Ring';
193
207
  export type { ToastProps } from './components/Toast';
194
208
  export type { DialogProps, DialogConfig, UseSimpleDialogOptions } from './components/Dialog';
195
209
  export type { TooltipProps } from './components/Tooltip';
196
210
  export type { HoverCardProps } from './components/HoverCard';
197
211
  export type { ContextMenuProps } from './components/ContextMenu';
212
+ export type { PopoverProps, PopoverTargetProps, PopoverDropdownProps } from './components/Popover';
198
213
  export type { SpotlightProps } from './components/Spotlight';
199
214
  export type { Action, Subject, Field, Conditions, PermissionRule, PermissionCheck, Ability, CanProps, CanWithConditionsProps, CannotProps, PermissionGateProps, PermissionContextValue, PermissionProviderProps, UsePermissionsOptions } from './components/Can';
200
215
  export type { BrandIconProps, BrandName } from './components/BrandIcon';
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ type LinearGradientProps = {
3
+ children?: React.ReactNode;
4
+ style?: any;
5
+ colors?: string[];
6
+ locations?: number[];
7
+ start?: {
8
+ x: number;
9
+ y: number;
10
+ } | [number, number];
11
+ end?: {
12
+ x: number;
13
+ y: number;
14
+ } | [number, number];
15
+ [key: string]: any;
16
+ };
17
+ export declare function resolveLinearGradient(): {
18
+ readonly LinearGradient: React.ComponentClass<any, any> | React.FC<LinearGradientProps>;
19
+ readonly hasLinearGradient: boolean;
20
+ };
21
+ type DocumentPickerModule = {
22
+ getDocumentAsync?: (...args: any[]) => Promise<any>;
23
+ };
24
+ export declare function resolveDocumentPicker(): {
25
+ readonly DocumentPicker: DocumentPickerModule | null;
26
+ readonly hasDocumentPicker: boolean;
27
+ };
28
+ export {};
@@ -0,0 +1,16 @@
1
+ interface ResolveOptionalModuleOptions<T> {
2
+ accessor?: (module: any) => T | null | undefined;
3
+ devWarning?: string;
4
+ loader?: () => any;
5
+ }
6
+ /**
7
+ * Attempts to synchronously resolve an optional dependency while caching the result.
8
+ * Returns `null` when the module cannot be loaded. An optional accessor can pull
9
+ * a specific export off the module evaluation.
10
+ */
11
+ export declare function resolveOptionalModule<T = any>(moduleId: string, options?: ResolveOptionalModuleOptions<T>): T | null;
12
+ /**
13
+ * Clears the cached optional module entries. Useful for tests to re-attempt loads.
14
+ */
15
+ export declare function resetOptionalModuleCache(): void;
16
+ export {};
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@platform-blocks/ui",
3
- "version": "0.1.2",
3
+ "version": "0.3.0",
4
4
  "description": "A React Native UI library",
5
5
  "type": "module",
6
6
  "main": "lib/cjs/index.js",
7
7
  "module": "lib/esm/index.js",
8
8
  "types": "lib/index.d.ts",
9
- "react-native": "src/index.ts",
9
+ "react-native": "./lib/esm/index.js",
10
10
  "sideEffects": false,
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./lib/index.d.ts",
14
- "react-native": "./src/index.ts",
14
+ "react-native": "./lib/esm/index.js",
15
15
  "import": "./lib/esm/index.js",
16
16
  "require": "./lib/cjs/index.js",
17
17
  "default": "./lib/esm/index.js"
@@ -27,6 +27,7 @@
27
27
  "build:esm": "tsc -p tsconfig.esm.json",
28
28
  "build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
29
29
  "clean": "rm -rf lib || true",
30
+ "generate:llms": "tsx ../scripts/generate-llms.ts",
30
31
  "prepare": "sh -c 'if [ \"$BUILD_ON_PREPARE\" = \"1\" ]; then npm run build; else echo \"ui: skipping build on prepare (set BUILD_ON_PREPARE=1 to enable)\"; fi'",
31
32
  "test": "jest",
32
33
  "test:watch": "jest --watch",
@@ -62,17 +63,6 @@
62
63
  "url": "https://github.com/joshstovall/platform-blocks/issues"
63
64
  },
64
65
  "homepage": "https://github.com/joshstovall/platform-blocks#readme",
65
- "dependencies": {
66
- "@platform-blocks/charts": "^0.1.1",
67
- "@react-native-masked-view/masked-view": "^0.3.2",
68
- "@shopify/flash-list": "^2.1.0",
69
- "expo-document-picker": "~14.0.7",
70
- "expo-audio": "^1.0.13",
71
- "expo-linear-gradient": "^14.1.5",
72
- "expo-video": "^2.2.2",
73
- "react-native-reanimated-carousel": "^4.0.3",
74
- "react-syntax-highlighter": "^15.5.0"
75
- },
76
66
  "devDependencies": {
77
67
  "@babel/core": "^7.25.2",
78
68
  "@babel/preset-env": "^7.25.0",
@@ -81,10 +71,12 @@
81
71
  "@babel/preset-typescript": "^7.25.0",
82
72
  "@eslint/js": "^8.57.1",
83
73
  "@react-native/babel-preset": "^0.81.4",
74
+ "@react-native-masked-view/masked-view": "^0.3.2",
84
75
  "@rollup/plugin-commonjs": "^28.0.6",
85
76
  "@rollup/plugin-json": "^6.1.0",
86
77
  "@rollup/plugin-node-resolve": "^16.0.1",
87
78
  "@rollup/plugin-typescript": "^12.1.4",
79
+ "@shopify/flash-list": "^2.1.0",
88
80
  "@testing-library/jest-native": "^5.4.3",
89
81
  "@testing-library/react-native": "^12.4.3",
90
82
  "@types/jest": "^29.5.12",
@@ -98,10 +90,22 @@
98
90
  "eslint-plugin-react-hooks": "^4.6.0",
99
91
  "eslint-plugin-react-native": "^4.1.0",
100
92
  "eslint-plugin-unused-imports": "^3.0.0",
93
+ "expo-audio": "^1.0.13",
94
+ "expo-document-picker": "~14.0.7",
95
+ "expo-haptics": "^15.0.0",
96
+ "expo-linear-gradient": "^14.1.5",
97
+ "expo-status-bar": "^1.12.0",
101
98
  "jest": "^29.7.0",
102
99
  "jest-environment-node": "^29.7.0",
103
100
  "jest-expo": "^54.0.12",
104
101
  "metro-react-native-babel-preset": "^0.77.0",
102
+ "react": "^19.1.0",
103
+ "react-native": "0.81.4",
104
+ "react-native-reanimated": "~4.1.1",
105
+ "react-native-reanimated-carousel": "^4.0.3",
106
+ "react-native-safe-area-context": "~5.6.0",
107
+ "react-native-svg": "^15.12.1",
108
+ "react-syntax-highlighter": "^15.5.0",
105
109
  "react-test-renderer": "19.1.0",
106
110
  "rollup": "^4.52.3",
107
111
  "rollup-plugin-dts": "^6.2.3",
@@ -110,39 +114,33 @@
110
114
  "typescript-eslint": "^8.41.0"
111
115
  },
112
116
  "peerDependencies": {
113
- "expo": "^54.0.10",
114
- "expo-haptics": "^15.0.0",
115
- "react": ">=19.0.0",
116
- "react-native": ">=0.81.0",
117
- "react-native-reanimated": ">=4.1.0",
118
- "react-native-safe-area-context": ">=5.0.0",
119
- "react-native-svg": ">=15.0.0",
120
- "react-native-worklets": ">=0.5.1"
117
+ "@react-native-masked-view/masked-view": ">=0.2.9",
118
+ "@shopify/flash-list": ">=1.6.0",
119
+ "expo-document-picker": ">=13.0.0",
120
+ "expo-linear-gradient": ">=12.0.0",
121
+ "expo-audio": ">=1.0.0",
122
+ "expo-haptics": ">=14.0.0",
123
+ "expo-status-bar": ">=1.12.0",
124
+ "react": ">=18.0.0 <20.0.0",
125
+ "react-native": ">=0.73.0",
126
+ "react-native-reanimated": ">=3.4.0",
127
+ "react-native-reanimated-carousel": ">=3.4.0",
128
+ "react-native-safe-area-context": ">=4.5.0",
129
+ "react-native-svg": ">=13.0.0",
130
+ "react-syntax-highlighter": ">=15.0.0"
121
131
  },
122
132
  "peerDependenciesMeta": {
123
- "expo": {
124
- "optional": false
133
+ "expo-audio": {
134
+ "optional": true
125
135
  },
126
136
  "expo-haptics": {
127
137
  "optional": true
128
138
  },
129
- "react": {
130
- "optional": false
131
- },
132
- "react-native": {
133
- "optional": false
134
- },
135
- "react-native-reanimated": {
136
- "optional": false
137
- },
138
- "react-native-safe-area-context": {
139
- "optional": false
140
- },
141
- "react-native-svg": {
142
- "optional": false
139
+ "expo-status-bar": {
140
+ "optional": true
143
141
  },
144
- "react-native-worklets": {
145
- "optional": false
142
+ "react-syntax-highlighter": {
143
+ "optional": true
146
144
  }
147
145
  }
148
146
  }
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import { SizeValue } from '../../core/theme/sizes';
3
- export interface SelectOption<T = any> {
4
- label: string;
5
- value: T;
6
- disabled?: boolean;
7
- }
8
- export interface SelectProps<T = any> {
9
- value?: T;
10
- defaultValue?: T;
11
- onChange?: (value: T, option: SelectOption<T>) => void;
12
- options: SelectOption<T>[];
13
- placeholder?: string;
14
- size?: SizeValue;
15
- radius?: any;
16
- disabled?: boolean;
17
- label?: string;
18
- helperText?: string;
19
- error?: string;
20
- searchable?: boolean;
21
- renderOption?: (opt: SelectOption<T>, active: boolean, selected: boolean) => React.ReactNode;
22
- fullWidth?: boolean;
23
- maxHeight?: number;
24
- closeOnSelect?: boolean;
25
- }