@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.
- package/README.md +60 -1
- package/lib/cjs/index.js +5970 -2471
- 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/FileInput/types.d.ts +12 -3
- package/lib/components/Highlight/Highlight.d.ts +4 -0
- package/lib/components/Highlight/index.d.ts +3 -0
- package/lib/components/Highlight/types.d.ts +24 -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 +31 -2
- 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 +20 -0
- package/lib/components/Popover/index.d.ts +2 -0
- package/lib/components/Popover/styles.d.ts +67 -0
- package/lib/components/Popover/types.d.ts +131 -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/ShimmerText/ShimmerText.d.ts +1 -0
- package/lib/components/Spotlight/DirectSpotlightState.d.ts +1 -1
- package/lib/components/Spotlight/Spotlight.d.ts +2 -2
- package/lib/components/Spotlight/SpotlightController.d.ts +2 -1
- package/lib/components/Spotlight/types.d.ts +6 -2
- 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/Toast/types.d.ts +2 -0
- package/lib/components/Tree/types.d.ts +7 -0
- package/lib/components/index.d.ts +10 -0
- package/lib/components/optimized.d.ts +5 -0
- package/lib/components/types.d.ts +3 -0
- package/lib/core/factory/factory.d.ts +3 -3
- 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 +16 -2
- 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 +5963 -2475
- package/lib/esm/index.js.map +1 -1
- package/lib/index.d.ts +15 -0
- package/lib/utils/optionalDependencies.d.ts +28 -0
- package/lib/utils/optionalModule.d.ts +16 -0
- package/package.json +38 -40
- package/lib/components/Select/types.d.ts +0 -25
|
@@ -13,6 +13,11 @@ export interface TreeProps {
|
|
|
13
13
|
data: TreeNode[];
|
|
14
14
|
/** Called when a leaf (no children) or any node with href is pressed */
|
|
15
15
|
onNavigate?: (node: TreeNode) => void;
|
|
16
|
+
/** Called when a node row is pressed. Return false to prevent default handling (selection, expand). */
|
|
17
|
+
onNodePress?: (node: TreeNode, context: {
|
|
18
|
+
isBranch: boolean;
|
|
19
|
+
event?: any;
|
|
20
|
+
}) => boolean | void;
|
|
16
21
|
/** Allow collapsing/expanding */
|
|
17
22
|
collapsible?: boolean;
|
|
18
23
|
/** Indent size in px for each depth level */
|
|
@@ -62,4 +67,6 @@ export interface TreeProps {
|
|
|
62
67
|
noResultsFallback?: React.ReactNode;
|
|
63
68
|
/** Custom highlight function for labels (return ReactNode) */
|
|
64
69
|
highlight?: (label: string, query: string) => React.ReactNode;
|
|
70
|
+
/** Apply alternating background stripes to rows */
|
|
71
|
+
striped?: boolean;
|
|
65
72
|
}
|
|
@@ -15,6 +15,7 @@ export { CodeBlock } from './CodeBlock';
|
|
|
15
15
|
export { CopyButton } from './CopyButton/CopyButton';
|
|
16
16
|
export { ColorPicker } from './ColorPicker';
|
|
17
17
|
export { Container } from './Container';
|
|
18
|
+
export { KeyboardAwareLayout } from './KeyboardAwareLayout';
|
|
18
19
|
export { DataTable } from './DataTable';
|
|
19
20
|
export { Disclaimer, ComponentWithDisclaimer, useDisclaimer, withDisclaimer, extractDisclaimerProps } from './Disclaimer';
|
|
20
21
|
export { Dialog, DialogProvider, DialogRenderer, useDialog, useSimpleDialog } from './Dialog';
|
|
@@ -47,6 +48,7 @@ export { YearPickerInput } from './YearPickerInput';
|
|
|
47
48
|
export { Pagination } from './Pagination';
|
|
48
49
|
export { PinInput } from './PinInput';
|
|
49
50
|
export { Slider, RangeSlider } from './Slider';
|
|
51
|
+
export { Knob } from './Knob';
|
|
50
52
|
export { AutoComplete } from './AutoComplete';
|
|
51
53
|
export { FileInput } from './FileInput';
|
|
52
54
|
export { RichTextEditor } from './RichTextEditor';
|
|
@@ -60,6 +62,7 @@ export { NavigationProgress, navigationProgress } from './NavigationProgress';
|
|
|
60
62
|
export { Radio, RadioGroup } from './Radio';
|
|
61
63
|
export { Rating } from './Rating';
|
|
62
64
|
export { Reveal } from './Reveal';
|
|
65
|
+
export { Ring } from './Ring';
|
|
63
66
|
export { Skeleton } from './Skeleton';
|
|
64
67
|
export { Loader } from './Loader';
|
|
65
68
|
export { LoadingOverlay } from './LoadingOverlay';
|
|
@@ -77,10 +80,12 @@ export { Accordion } from './Accordion';
|
|
|
77
80
|
export { Gauge } from './Gauge';
|
|
78
81
|
export { GradientText } from './GradientText';
|
|
79
82
|
export { ShimmerText } from './ShimmerText';
|
|
83
|
+
export { Highlight } from './Highlight';
|
|
80
84
|
export { Title } from './Title/Title';
|
|
81
85
|
export { TableOfContents } from './TableOfContents/TableOfContents';
|
|
82
86
|
export { HoverCard } from './HoverCard/HoverCard';
|
|
83
87
|
export { ContextMenu } from './ContextMenu';
|
|
88
|
+
export { Popover } from './Popover';
|
|
84
89
|
export { Gallery } from './Gallery';
|
|
85
90
|
export type { AlertProps } from './Alert';
|
|
86
91
|
export type { AppShellProps } from './AppShell';
|
|
@@ -99,6 +104,7 @@ export type { CodeBlockProps } from './CodeBlock/types';
|
|
|
99
104
|
export type { CopyButtonProps } from './CopyButton/types';
|
|
100
105
|
export type { ColorPickerProps } from './ColorPicker';
|
|
101
106
|
export type { ContainerProps } from './Container';
|
|
107
|
+
export type { KeyboardAwareLayoutProps } from './KeyboardAwareLayout';
|
|
102
108
|
export type { DialogProps, DialogConfig, UseSimpleDialogOptions } from './Dialog';
|
|
103
109
|
export type { DividerProps } from './Divider';
|
|
104
110
|
export type { SpaceProps } from './Space';
|
|
@@ -106,6 +112,7 @@ export type { FlexProps } from './Flex';
|
|
|
106
112
|
export type { GridProps } from './Grid';
|
|
107
113
|
export type { GradientTextProps } from './GradientText';
|
|
108
114
|
export type { ShimmerTextProps } from './ShimmerText';
|
|
115
|
+
export type { HighlightProps } from './Highlight';
|
|
109
116
|
export type { TreeProps, TreeNode } from './Tree/Tree';
|
|
110
117
|
export type { TimePickerProps, TimePickerValue } from './TimePicker/types';
|
|
111
118
|
export type { IconProps, IconSize, IconVariant, IconDefinition, IconRegistry } from './Icon';
|
|
@@ -127,6 +134,7 @@ export type { TimePickerInputProps } from './TimePickerInput';
|
|
|
127
134
|
export type { PaginationProps } from './Pagination';
|
|
128
135
|
export type { PinInputProps } from './PinInput';
|
|
129
136
|
export type { SliderProps, RangeSliderProps } from './Slider';
|
|
137
|
+
export type { KnobProps, KnobMark } from './Knob';
|
|
130
138
|
export type { AutoCompleteProps, AutoCompleteOption } from './AutoComplete';
|
|
131
139
|
export type { FileInputProps, FileInputFile } from './FileInput';
|
|
132
140
|
export type { RichTextEditorProps, RichTextEditorContent, RichTextEditorFormat, RichTextEditorSelection } from './RichTextEditor';
|
|
@@ -137,6 +145,7 @@ export type { ProgressProps } from './Progress';
|
|
|
137
145
|
export type { QRCodeProps } from './QRCode';
|
|
138
146
|
export type { RadioProps, RadioGroupProps } from './Radio';
|
|
139
147
|
export type { RatingProps } from './Rating';
|
|
148
|
+
export type { RingProps, RingColorStop, RingRenderContext } from './Ring';
|
|
140
149
|
export type { SkeletonProps } from './Skeleton';
|
|
141
150
|
export type { LoaderProps } from './Loader';
|
|
142
151
|
export type { LoadingOverlayProps } from './LoadingOverlay';
|
|
@@ -156,6 +165,7 @@ export type { TableOfContentsProps, TocItem } from './TableOfContents/types';
|
|
|
156
165
|
export type { StepperProps } from './Stepper';
|
|
157
166
|
export type { HoverCardProps } from './HoverCard/types';
|
|
158
167
|
export type { ContextMenuProps, ContextMenuItem } from './ContextMenu/ContextMenu';
|
|
168
|
+
export type { PopoverProps, PopoverTargetProps, PopoverDropdownProps } from './Popover';
|
|
159
169
|
export type { SegmentedControlProps, SegmentedControlItem, SegmentedControlData } from './SegmentedControl';
|
|
160
170
|
export type { GalleryProps, GalleryModalProps, GalleryItem } from './Gallery';
|
|
161
171
|
export * from './Accessibility/AccessibilityHelpers';
|
|
@@ -12,6 +12,7 @@ export type { SwitchProps } from './Switch/types';
|
|
|
12
12
|
export type { NumberInputProps } from './NumberInput/types';
|
|
13
13
|
export type { PinInputProps } from './PinInput/types';
|
|
14
14
|
export type { SliderProps, RangeSliderProps } from './Slider/types';
|
|
15
|
+
export type { KnobProps, KnobMark } from './Knob/types';
|
|
15
16
|
export declare const LazyPasswordInput: React.LazyExoticComponent<React.FC<import("./Input/types").PasswordInputProps>>;
|
|
16
17
|
export declare const LazyNumberInput: React.LazyExoticComponent<import("../core").PlatformBlocksComponent<{
|
|
17
18
|
props: import("./NumberInput/types").NumberInputProps;
|
|
@@ -29,6 +30,10 @@ export declare const LazyRangeSlider: React.LazyExoticComponent<import("../core"
|
|
|
29
30
|
props: import("./Slider/types").RangeSliderProps;
|
|
30
31
|
ref: import("react-native").View;
|
|
31
32
|
}>>;
|
|
33
|
+
export declare const LazyKnob: React.LazyExoticComponent<import("../core").PlatformBlocksComponent<{
|
|
34
|
+
props: import("./Knob/types").KnobProps;
|
|
35
|
+
ref: import("react-native").View;
|
|
36
|
+
}>>;
|
|
32
37
|
export declare const LazyCheckbox: React.LazyExoticComponent<React.ForwardRefExoticComponent<import("./Checkbox/types").CheckboxProps & React.RefAttributes<import("react-native").View>>>;
|
|
33
38
|
export declare const LazyRadio: React.LazyExoticComponent<import("../core").PlatformBlocksComponent<{
|
|
34
39
|
props: import("./Radio/types").RadioProps;
|
|
@@ -11,6 +11,7 @@ export type { CodeBlockProps } from './CodeBlock/types';
|
|
|
11
11
|
export type { CopyButtonProps } from './CopyButton/types';
|
|
12
12
|
export type { ColorPickerProps } from './ColorPicker';
|
|
13
13
|
export type { ContainerProps } from './Container';
|
|
14
|
+
export type { KeyboardAwareLayoutProps } from './KeyboardAwareLayout';
|
|
14
15
|
export type { DialogProps } from './Dialog';
|
|
15
16
|
export type { DividerProps } from './Divider';
|
|
16
17
|
export type { SpaceProps } from './Space';
|
|
@@ -32,6 +33,7 @@ export type { YearPickerInputProps } from './YearPickerInput';
|
|
|
32
33
|
export type { PaginationProps } from './Pagination';
|
|
33
34
|
export type { PinInputProps } from './PinInput';
|
|
34
35
|
export type { SliderProps, RangeSliderProps } from './Slider';
|
|
36
|
+
export type { KnobProps, KnobMark } from './Knob';
|
|
35
37
|
export type { AutoCompleteProps, AutoCompleteOption } from './AutoComplete';
|
|
36
38
|
export type { FileInputProps, FileInputFile } from './FileInput';
|
|
37
39
|
export type { RichTextEditorProps } from './RichTextEditor';
|
|
@@ -41,6 +43,7 @@ export type { ProgressProps } from './Progress';
|
|
|
41
43
|
export type { QRCodeProps } from './QRCode';
|
|
42
44
|
export type { RadioProps, RadioGroupProps } from './Radio';
|
|
43
45
|
export type { RatingProps } from './Rating';
|
|
46
|
+
export type { RingProps, RingColorStop, RingRenderContext } from './Ring';
|
|
44
47
|
export type { SkeletonProps } from './Skeleton';
|
|
45
48
|
export type { LoaderProps } from './Loader';
|
|
46
49
|
export type { SpotlightProps } from './Spotlight';
|
|
@@ -5,10 +5,10 @@ export interface FactoryPayload {
|
|
|
5
5
|
ref: any;
|
|
6
6
|
staticComponents?: Record<string, any>;
|
|
7
7
|
}
|
|
8
|
-
export interface ComponentWithProps<Props = {}> {
|
|
9
|
-
withProps: <T extends Partial<Props>>(fixedProps: T) =>
|
|
8
|
+
export interface ComponentWithProps<Props = {}, RefType = any> {
|
|
9
|
+
withProps: <T extends Partial<Props>>(fixedProps: T) => any;
|
|
10
10
|
}
|
|
11
|
-
export interface PlatformBlocksComponent<Payload extends FactoryPayload> extends React.
|
|
11
|
+
export interface PlatformBlocksComponent<Payload extends FactoryPayload> extends React.ForwardRefExoticComponent<React.PropsWithoutRef<Payload['props']> & React.RefAttributes<Payload['ref']>>, ComponentWithProps<Payload['props'], Payload['ref']> {
|
|
12
12
|
extend: any;
|
|
13
13
|
displayName?: string;
|
|
14
14
|
}
|
|
@@ -4,6 +4,8 @@ export interface UsePopoverPositioningOptions extends PositioningOptions {
|
|
|
4
4
|
autoUpdate?: boolean;
|
|
5
5
|
/** Debounce delay for resize/scroll updates in ms */
|
|
6
6
|
updateDelay?: number;
|
|
7
|
+
/** Adjust viewport height when on-screen keyboard is visible (default: true) */
|
|
8
|
+
keyboardAvoidance?: boolean;
|
|
7
9
|
}
|
|
8
10
|
export interface UsePopoverPositioningReturn {
|
|
9
11
|
/** Current position result */
|
|
@@ -26,8 +28,3 @@ export declare function usePopoverPositioning(isOpen: boolean, options?: UsePopo
|
|
|
26
28
|
* (simplified version with tooltip-specific defaults)
|
|
27
29
|
*/
|
|
28
30
|
export declare function useTooltipPositioning(isOpen: boolean, placement?: PositioningOptions['placement']): UsePopoverPositioningReturn;
|
|
29
|
-
/**
|
|
30
|
-
* Hook for managing dropdown/menu positioning
|
|
31
|
-
* (optimized for dropdown behavior)
|
|
32
|
-
*/
|
|
33
|
-
export declare function useDropdownPositioning(isOpen: boolean, placement?: PositioningOptions['placement']): UsePopoverPositioningReturn;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import type { KeyboardManagerContextValue } from '../providers/KeyboardManagerProvider';
|
|
3
|
+
export type SelectionMode = 'single' | 'multiple';
|
|
4
|
+
export interface SelectionFocusCallbacks {
|
|
5
|
+
focusPrimary?: () => void;
|
|
6
|
+
focusModal?: () => void;
|
|
7
|
+
blurPrimary?: () => void;
|
|
8
|
+
blurModal?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface HandleSelectionCompleteOptions {
|
|
11
|
+
mode: SelectionMode;
|
|
12
|
+
preferRefocus?: boolean;
|
|
13
|
+
useModal?: boolean;
|
|
14
|
+
keyboardManager?: KeyboardManagerContextValue | null;
|
|
15
|
+
focusCallbacks?: SelectionFocusCallbacks;
|
|
16
|
+
onRefocus?: () => void;
|
|
17
|
+
onBlur?: () => void;
|
|
18
|
+
interactionScheduler?: (cb: () => void) => void;
|
|
19
|
+
focusTargetId?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface SelectionCompleteResult {
|
|
22
|
+
refocused: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface SelectionContractConfig extends Omit<HandleSelectionCompleteOptions, 'onRefocus' | 'onBlur' | 'focusCallbacks'> {
|
|
25
|
+
focusCallbacks?: SelectionFocusCallbacks;
|
|
26
|
+
}
|
|
27
|
+
export interface SelectionContractRunOptions {
|
|
28
|
+
focusCallbacks?: SelectionFocusCallbacks;
|
|
29
|
+
onRefocus?: () => void;
|
|
30
|
+
onBlur?: () => void;
|
|
31
|
+
preferRefocus?: boolean;
|
|
32
|
+
focusTargetId?: string;
|
|
33
|
+
keyboardManager?: KeyboardManagerContextValue | null;
|
|
34
|
+
}
|
|
35
|
+
export type SelectionContract = (options?: SelectionContractRunOptions) => SelectionCompleteResult;
|
|
36
|
+
export declare function resolveRefocusBehavior(options: {
|
|
37
|
+
mode: SelectionMode;
|
|
38
|
+
preferRefocus?: boolean;
|
|
39
|
+
platform?: typeof Platform.OS;
|
|
40
|
+
}): boolean;
|
|
41
|
+
export declare function handleSelectionComplete(options: HandleSelectionCompleteOptions): SelectionCompleteResult;
|
|
42
|
+
export declare function createSelectionContract(config: SelectionContractConfig): SelectionContract;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KeyboardEvent } from 'react-native';
|
|
3
|
+
export interface KeyboardManagerProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Optional flag to disable native listeners (primarily for tests).
|
|
7
|
+
*/
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface KeyboardManagerContextValue {
|
|
11
|
+
/** Indicates if the on-screen keyboard is currently visible */
|
|
12
|
+
isKeyboardVisible: boolean;
|
|
13
|
+
/** Height of the keyboard in pixels when visible */
|
|
14
|
+
keyboardHeight: number;
|
|
15
|
+
/** Native end coordinates from the last keyboard event */
|
|
16
|
+
keyboardEndCoordinates?: KeyboardEvent['endCoordinates'];
|
|
17
|
+
/** Reported animation duration (ms) from the native keyboard event */
|
|
18
|
+
keyboardAnimationDuration: number;
|
|
19
|
+
/** Reported animation easing from the native keyboard event */
|
|
20
|
+
keyboardAnimationEasing?: KeyboardEvent['easing'];
|
|
21
|
+
/** Latest focus target requested via `setFocusTarget`; null when none pending */
|
|
22
|
+
pendingFocusTarget: string | null;
|
|
23
|
+
/** Imperative helper for dismissing the keyboard */
|
|
24
|
+
dismissKeyboard: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Sets an optional focus target that can be consumed by an input after the keyboard closes.
|
|
27
|
+
* Passing null clears the stored target.
|
|
28
|
+
*/
|
|
29
|
+
setFocusTarget: (componentId: string | null) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Returns true when the provided component id matches the stored focus target.
|
|
32
|
+
* The focus target is cleared after a successful match.
|
|
33
|
+
*/
|
|
34
|
+
consumeFocusTarget: (componentId: string) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Helper that records a focus target so the next mounted input can restore focus.
|
|
37
|
+
* Consumers can call `dismissKeyboard` separately when they need to drop the keyboard.
|
|
38
|
+
*/
|
|
39
|
+
refocus: (componentId: string, options?: {
|
|
40
|
+
dismiss?: boolean;
|
|
41
|
+
}) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare const KeyboardManagerProvider: React.FC<KeyboardManagerProviderProps>;
|
|
44
|
+
export declare function useKeyboardManager(): KeyboardManagerContextValue;
|
|
45
|
+
export declare function useKeyboardManagerOptional(): KeyboardManagerContextValue | null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { OverlayProvider, useOverlay } from './OverlayProvider';
|
|
1
|
+
export { OverlayProvider, useOverlay, useOverlayApi, useOverlays } from './OverlayProvider';
|
|
2
2
|
export { OverlayRenderer } from './OverlayRenderer';
|
|
3
3
|
export type { OverlayConfig } from './OverlayProvider';
|
|
4
4
|
export { DirectionProvider, useDirection, useDirectionSafe, DirectionContext } from './DirectionProvider';
|
|
5
5
|
export type { Direction, DirectionContextValue, DirectionProviderProps, StorageController } from './DirectionProvider';
|
|
6
|
+
export { KeyboardManagerProvider, useKeyboardManager, useKeyboardManagerOptional, } from './KeyboardManagerProvider';
|
|
7
|
+
export type { KeyboardManagerProviderProps, KeyboardManagerContextValue, } from './KeyboardManagerProvider';
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PlatformBlocksThemeProviderProps } from './ThemeProvider';
|
|
3
|
+
import type { DirectionProviderProps } from '../providers';
|
|
4
|
+
import type { HighlightProps as HighlightComponentProps } from '../../components/Highlight';
|
|
5
|
+
import type { HapticsProviderProps } from '../haptics/HapticsProvider';
|
|
6
|
+
import type { PermissionProviderProps } from '../../components/Can';
|
|
3
7
|
import { ThemeModeConfig } from './ThemeModeProvider';
|
|
8
|
+
type DirectionProviderConfig = Omit<DirectionProviderProps, 'children'>;
|
|
9
|
+
type HapticsProviderConfig = Omit<HapticsProviderProps, 'children'>;
|
|
10
|
+
type PermissionProviderConfig = Omit<PermissionProviderProps, 'children'>;
|
|
4
11
|
export interface PlatformBlocksProviderProps extends Omit<PlatformBlocksThemeProviderProps, 'children'> {
|
|
5
12
|
/** Your application */
|
|
6
13
|
children: React.ReactNode;
|
|
@@ -29,7 +36,7 @@ export interface PlatformBlocksProviderProps extends Omit<PlatformBlocksThemePro
|
|
|
29
36
|
actions?: any[];
|
|
30
37
|
placeholder?: string;
|
|
31
38
|
limit?: number;
|
|
32
|
-
highlightQuery?: boolean;
|
|
39
|
+
highlightQuery?: boolean | HighlightComponentProps['highlight'];
|
|
33
40
|
/** Render Spotlight even when no actions provided (useful to inject later) */
|
|
34
41
|
alwaysMount?: boolean;
|
|
35
42
|
};
|
|
@@ -41,12 +48,19 @@ export interface PlatformBlocksProviderProps extends Omit<PlatformBlocksThemePro
|
|
|
41
48
|
i18nResources?: Record<string, {
|
|
42
49
|
translation: Record<string, any>;
|
|
43
50
|
}>;
|
|
51
|
+
/** Direction context configuration (pass false to opt out) */
|
|
52
|
+
direction?: false | DirectionProviderConfig;
|
|
53
|
+
/** Haptics context configuration (pass false to opt out) */
|
|
54
|
+
haptics?: false | HapticsProviderConfig;
|
|
55
|
+
/** Permission context configuration (pass false to opt out) */
|
|
56
|
+
permissions?: false | PermissionProviderConfig;
|
|
44
57
|
}
|
|
45
58
|
/**
|
|
46
59
|
* Main provider component for Platform Blocks library
|
|
47
60
|
* Provides theme context and injects CSS variables
|
|
48
61
|
*/
|
|
49
|
-
export declare function PlatformBlocksProvider({ children, theme, inherit, withCSSVariables, cssVariablesSelector, colorSchemeMode, withOverlays, withSpotlight, withGlobalCSS, themeModeConfig, spotlightConfig, locale, fallbackLocale, i18nResources }: PlatformBlocksProviderProps): React.JSX.Element;
|
|
62
|
+
export declare function PlatformBlocksProvider({ children, theme, inherit, withCSSVariables, cssVariablesSelector, colorSchemeMode, withOverlays, withSpotlight, withGlobalCSS, themeModeConfig, spotlightConfig, locale, fallbackLocale, i18nResources, direction, haptics, permissions }: PlatformBlocksProviderProps): React.JSX.Element;
|
|
50
63
|
export declare namespace PlatformBlocksProvider {
|
|
51
64
|
var displayName: string;
|
|
52
65
|
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const COMPONENT_SIZE_ORDER: readonly ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
2
|
+
export type ComponentSize = (typeof COMPONENT_SIZE_ORDER)[number];
|
|
3
|
+
export type ComponentSizeValue = ComponentSize | number;
|
|
4
|
+
export declare const DEFAULT_COMPONENT_SIZE: ComponentSize;
|
|
5
|
+
export declare function isComponentSize(value: unknown): value is ComponentSize;
|
|
6
|
+
export declare function clampComponentSize(value: ComponentSizeValue | undefined, allowedSizes?: ReadonlyArray<ComponentSize>, fallback?: ComponentSize): ComponentSizeValue;
|
|
7
|
+
export declare function resolveComponentSize<T>(value: ComponentSizeValue | undefined, scale: Partial<Record<ComponentSize, T>>, options?: {
|
|
8
|
+
fallback?: ComponentSize;
|
|
9
|
+
allowedSizes?: ComponentSize[];
|
|
10
|
+
}): T | number;
|
|
@@ -8,5 +8,6 @@ export { useColorScheme } from './useColorScheme';
|
|
|
8
8
|
export type { ColorScheme } from './useColorScheme';
|
|
9
9
|
export type { PlatformBlocksThemeProviderProps } from './ThemeProvider';
|
|
10
10
|
export * from './sizes';
|
|
11
|
+
export * from './componentSize';
|
|
11
12
|
export * from './radius';
|
|
12
13
|
export * from './shadow';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ComponentSize, ComponentSizeValue } from './componentSize';
|
|
2
|
+
export type SizeToken = ComponentSize;
|
|
3
|
+
export type SizeValue = ComponentSizeValue;
|
|
2
4
|
export type ColorValue = string;
|
|
3
|
-
export type SpacingValue =
|
|
5
|
+
export type SpacingValue = SizeToken | 'auto' | '0' | number;
|
|
4
6
|
import type { DESIGN_TOKENS } from '../design-tokens';
|
|
5
7
|
export interface SpacingProps {
|
|
6
8
|
/** Margin on all sides */
|