@platform-blocks/ui 0.2.0 → 0.3.1
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.
- package/README.md +23 -1
- package/lib/cjs/index.js +6915 -4498
- package/lib/cjs/index.js.map +1 -1
- package/lib/components/AutoComplete/types.d.ts +2 -0
- package/lib/components/Avatar/types.d.ts +3 -2
- package/lib/components/Badge/types.d.ts +4 -4
- package/lib/components/Blockquote/styles.d.ts +2 -1
- package/lib/components/Breadcrumbs/types.d.ts +2 -1
- package/lib/components/Calendar/types.d.ts +1 -0
- package/lib/components/Card/types.d.ts +1 -1
- package/lib/components/Carousel/types.d.ts +3 -2
- package/lib/components/Chip/types.d.ts +1 -1
- package/lib/components/ColorPicker/styles.d.ts +15 -1
- package/lib/components/ColorPicker/types.d.ts +4 -1
- package/lib/components/CopyButton/types.d.ts +3 -2
- package/lib/components/Dialog/Dialog.d.ts +1 -1
- package/lib/components/Dialog/types.d.ts +3 -0
- package/lib/components/Input/styles.d.ts +0 -24
- package/lib/components/Input/types.d.ts +2 -0
- package/lib/components/KeyCap/types.d.ts +9 -2
- package/lib/components/KeyboardAwareLayout/KeyboardAwareLayout.d.ts +4 -0
- package/lib/components/KeyboardAwareLayout/index.d.ts +3 -0
- package/lib/components/KeyboardAwareLayout/types.d.ts +26 -0
- package/lib/components/Knob/Knob.d.ts +6 -0
- package/lib/components/Knob/index.d.ts +2 -0
- package/lib/components/Knob/types.d.ts +65 -0
- package/lib/components/ListGroup/types.d.ts +11 -2
- package/lib/components/MenuItemButton/MenuItemButton.d.ts +2 -1
- package/lib/components/MonthPicker/types.d.ts +2 -2
- package/lib/components/NumberInput/types.d.ts +14 -0
- package/lib/components/Pagination/types.d.ts +10 -1
- package/lib/components/PinInput/types.d.ts +2 -0
- package/lib/components/Popover/Popover.d.ts +9 -3
- package/lib/components/Popover/index.d.ts +1 -1
- package/lib/components/Popover/styles.d.ts +1 -0
- package/lib/components/Popover/types.d.ts +2 -0
- package/lib/components/Ring/Ring.d.ts +8 -0
- package/lib/components/Ring/index.d.ts +3 -0
- package/lib/components/Ring/types.d.ts +75 -0
- package/lib/components/SegmentedControl/types.d.ts +8 -2
- package/lib/components/Select/Select.d.ts +0 -1
- package/lib/components/Select/Select.types.d.ts +33 -0
- package/lib/components/Spotlight/DirectSpotlightState.d.ts +1 -1
- package/lib/components/Spotlight/Spotlight.d.ts +1 -1
- package/lib/components/Spotlight/types.d.ts +3 -1
- package/lib/components/Stepper/types.d.ts +10 -2
- package/lib/components/TextArea/styles.d.ts +3 -33
- package/lib/components/TextArea/types.d.ts +2 -1
- package/lib/components/TimePicker/TimePicker.d.ts +1 -3
- package/lib/components/TimePickerInput/TimePickerInput.d.ts +3 -0
- package/lib/components/TimePickerInput/index.d.ts +2 -2
- package/lib/components/TimePickerInput/types.d.ts +3 -0
- package/lib/components/Timeline/types.d.ts +10 -2
- package/lib/components/Tree/types.d.ts +7 -0
- package/lib/components/index.d.ts +7 -1
- package/lib/components/optimized.d.ts +5 -0
- package/lib/components/types.d.ts +3 -0
- package/lib/core/hooks/usePopoverPositioning.d.ts +2 -5
- package/lib/core/keyboard/selection.d.ts +42 -0
- package/lib/core/providers/KeyboardManagerProvider.d.ts +45 -0
- package/lib/core/providers/index.d.ts +3 -1
- package/lib/core/theme/PlatformBlocksProvider.d.ts +14 -1
- package/lib/core/theme/componentSize.d.ts +10 -0
- package/lib/core/theme/index.d.ts +1 -0
- package/lib/core/theme/sizes.d.ts +2 -1
- package/lib/core/theme/types.d.ts +4 -2
- package/lib/esm/index.js +6905 -4496
- package/lib/esm/index.js.map +1 -1
- package/lib/index.d.ts +12 -1
- package/lib/utils/optionalDependencies.d.ts +17 -2
- package/lib/utils/optionalModule.d.ts +16 -0
- package/package.json +9 -8
- 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';
|
|
@@ -47,6 +50,7 @@ export { ToggleButton, ToggleGroup } from './components/Toggle';
|
|
|
47
50
|
export { ToggleBar } from './components/Toggle';
|
|
48
51
|
export { SegmentedControl } from './components/SegmentedControl';
|
|
49
52
|
export { Slider, RangeSlider } from './components/Slider';
|
|
53
|
+
export { Knob } from './components/Knob';
|
|
50
54
|
export { Search } from './components/Search';
|
|
51
55
|
export { Select } from './components/Select';
|
|
52
56
|
export { AutoComplete } from './components/AutoComplete';
|
|
@@ -91,6 +95,7 @@ export { Progress } from './components/Progress';
|
|
|
91
95
|
export { Skeleton } from './components/Skeleton';
|
|
92
96
|
export { Loader } from './components/Loader';
|
|
93
97
|
export { Gauge } from './components/Gauge';
|
|
98
|
+
export { Ring } from './components/Ring';
|
|
94
99
|
export { NavigationProgress, navigationProgress } from './components/NavigationProgress';
|
|
95
100
|
export { Toast, ToastProvider, useToast, useToastApi, toast, onToastsRequested } from './components/Toast';
|
|
96
101
|
export { Dialog, DialogProvider, DialogRenderer, useDialog, useDialogApi, useDialogs, useSimpleDialog, onDialogsRequested } from './components/Dialog';
|
|
@@ -99,7 +104,7 @@ export { Overlay } from './components/Overlay';
|
|
|
99
104
|
export { LoadingOverlay } from './components/LoadingOverlay';
|
|
100
105
|
export { HoverCard } from './components/HoverCard';
|
|
101
106
|
export { ContextMenu } from './components/ContextMenu';
|
|
102
|
-
export { Popover
|
|
107
|
+
export { Popover } from './components/Popover';
|
|
103
108
|
export { Spotlight, SpotlightProvider, useSpotlightStore, spotlight, createSpotlightStore, useSpotlightStoreInstance, useDirectSpotlightState, directSpotlight, onSpotlightRequested } from './components/Spotlight';
|
|
104
109
|
export { FloatingActions } from './components/FloatingActions';
|
|
105
110
|
export { Can, CanWithConditions, Cannot, PermissionGate, withCan, withCannot } from './components/Can';
|
|
@@ -128,6 +133,9 @@ export type { PlatformBlocksTheme, PlatformBlocksThemeOverride } from './core/th
|
|
|
128
133
|
export type { PlatformBlocksProviderProps } from './core/theme/PlatformBlocksProvider';
|
|
129
134
|
export type { ColorScheme } from './core/theme/useColorScheme';
|
|
130
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';
|
|
131
139
|
export type { ResponsiveProp } from './core/theme/breakpoints';
|
|
132
140
|
export type { HotkeyItem, KeyboardModifiers } from './hooks';
|
|
133
141
|
export type { ButtonProps } from './components/Button';
|
|
@@ -141,6 +149,7 @@ export type { HighlightProps } from './components/Highlight';
|
|
|
141
149
|
export type { OverlayProps } from './components/Overlay';
|
|
142
150
|
export type { TitleProps } from './components/Title/types';
|
|
143
151
|
export type { ContainerProps } from './components/Container';
|
|
152
|
+
export type { KeyboardAwareLayoutProps } from './components/KeyboardAwareLayout';
|
|
144
153
|
export type { FlexProps } from './components/Flex';
|
|
145
154
|
export type { GridProps, GridItemProps } from './components/Grid';
|
|
146
155
|
export type { MasonryProps, MasonryItem } from './components/Masonry';
|
|
@@ -154,6 +163,7 @@ export type { ToggleButtonProps, ToggleGroupProps } from './components/Toggle';
|
|
|
154
163
|
export type { ToggleBarProps, ToggleBarOption } from './components/Toggle/ToggleBar';
|
|
155
164
|
export type { SegmentedControlProps, SegmentedControlItem, SegmentedControlData } from './components/SegmentedControl';
|
|
156
165
|
export type { SliderProps, RangeSliderProps } from './components/Slider';
|
|
166
|
+
export type { KnobProps, KnobMark } from './components/Knob';
|
|
157
167
|
export type { SearchProps } from './components/Search';
|
|
158
168
|
export type { SelectProps } from './components/Select';
|
|
159
169
|
export type { AutoCompleteProps } from './components/AutoComplete';
|
|
@@ -193,6 +203,7 @@ export type { SkeletonProps } from './components/Skeleton';
|
|
|
193
203
|
export type { LoaderProps } from './components/Loader';
|
|
194
204
|
export type { LoadingOverlayProps } from './components/LoadingOverlay';
|
|
195
205
|
export type { GaugeProps } from './components/Gauge';
|
|
206
|
+
export type { RingProps, RingColorStop, RingRenderContext } from './components/Ring';
|
|
196
207
|
export type { ToastProps } from './components/Toast';
|
|
197
208
|
export type { DialogProps, DialogConfig, UseSimpleDialogOptions } from './components/Dialog';
|
|
198
209
|
export type { TooltipProps } from './components/Tooltip';
|
|
@@ -1,13 +1,28 @@
|
|
|
1
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
|
+
};
|
|
2
17
|
export declare function resolveLinearGradient(): {
|
|
3
|
-
readonly LinearGradient: React.
|
|
18
|
+
readonly LinearGradient: React.ComponentClass<any, any> | React.FC<LinearGradientProps>;
|
|
4
19
|
readonly hasLinearGradient: boolean;
|
|
5
20
|
};
|
|
6
21
|
type DocumentPickerModule = {
|
|
7
22
|
getDocumentAsync?: (...args: any[]) => Promise<any>;
|
|
8
23
|
};
|
|
9
24
|
export declare function resolveDocumentPicker(): {
|
|
10
|
-
readonly DocumentPicker: DocumentPickerModule | null
|
|
25
|
+
readonly DocumentPicker: DocumentPickerModule | null;
|
|
11
26
|
readonly hasDocumentPicker: boolean;
|
|
12
27
|
};
|
|
13
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platform-blocks/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A React Native UI library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/cjs/index.js",
|
|
@@ -27,23 +27,19 @@
|
|
|
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",
|
|
33
34
|
"test:coverage": "jest --coverage",
|
|
34
35
|
"test:ci": "jest --ci --coverage --maxWorkers=2",
|
|
35
36
|
"test:update": "jest --updateSnapshot",
|
|
36
|
-
"test:timeline": "jest Timeline.test.tsx",
|
|
37
|
-
"test:rating": "jest Rating.test.tsx",
|
|
38
|
-
"test:select": "jest Select.test.tsx",
|
|
39
|
-
"test:avatar": "jest Avatar.test.tsx",
|
|
40
37
|
"test:component": "jest",
|
|
41
38
|
"lint": "eslint src --ext .ts,.tsx --ignore-path .eslintignore",
|
|
42
39
|
"lint:fix": "eslint src --ext .ts,.tsx --fix --ignore-path .eslintignore",
|
|
43
40
|
"lint:check": "eslint src --ext .ts,.tsx --max-warnings 0",
|
|
44
41
|
"format": "eslint src --ext .ts,.tsx --fix && echo 'Code formatted successfully!'",
|
|
45
|
-
"precommit": "npm run lint:check && npm run test"
|
|
46
|
-
"qr:diff": "node ./lib/components/QRCode/dev/compareEngines.js"
|
|
42
|
+
"precommit": "npm run lint:check && npm run test"
|
|
47
43
|
},
|
|
48
44
|
"keywords": [
|
|
49
45
|
"react-native",
|
|
@@ -104,7 +100,7 @@
|
|
|
104
100
|
"react-native-reanimated-carousel": "^4.0.3",
|
|
105
101
|
"react-native-safe-area-context": "~5.6.0",
|
|
106
102
|
"react-native-svg": "^15.12.1",
|
|
107
|
-
"react-syntax-highlighter": "^
|
|
103
|
+
"react-syntax-highlighter": "^16.1.0",
|
|
108
104
|
"react-test-renderer": "19.1.0",
|
|
109
105
|
"rollup": "^4.52.3",
|
|
110
106
|
"rollup-plugin-dts": "^6.2.3",
|
|
@@ -141,5 +137,10 @@
|
|
|
141
137
|
"react-syntax-highlighter": {
|
|
142
138
|
"optional": true
|
|
143
139
|
}
|
|
140
|
+
},
|
|
141
|
+
"optionalDependencies": {
|
|
142
|
+
"lottie-react": "^2.4.1",
|
|
143
|
+
"@lottiefiles/dotlottie-react": "^0.13.5",
|
|
144
|
+
"lottie-react-native": "^7.3.4"
|
|
144
145
|
}
|
|
145
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
|
-
}
|