@platform-blocks/ui 0.6.0 → 0.6.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.
Files changed (33) hide show
  1. package/lib/cjs/index.js +458 -705
  2. package/lib/cjs/index.js.map +1 -1
  3. package/lib/components/Dialog/Dialog.d.ts +1 -1
  4. package/lib/components/Dialog/types.d.ts +23 -2
  5. package/lib/components/HoverCard/types.d.ts +1 -1
  6. package/lib/components/Image/Image.d.ts +1 -1
  7. package/lib/components/Image/types.d.ts +3 -3
  8. package/lib/components/Input/styles.d.ts +1 -12
  9. package/lib/components/Layout/Layout.d.ts +1 -0
  10. package/lib/components/Menu/types.d.ts +2 -2
  11. package/lib/components/Popover/types.d.ts +5 -5
  12. package/lib/components/Select/Select.types.d.ts +1 -1
  13. package/lib/components/Skeleton/types.d.ts +2 -2
  14. package/lib/components/Table/Table.d.ts +4 -4
  15. package/lib/components/TextArea/types.d.ts +2 -2
  16. package/lib/components/Timeline/types.d.ts +20 -0
  17. package/lib/components/Video/types.d.ts +2 -2
  18. package/lib/components/Waveform/WaveformSkeleton.d.ts +2 -2
  19. package/lib/components/Waveform/types.d.ts +2 -2
  20. package/lib/components/index.d.ts +0 -2
  21. package/lib/components/types.d.ts +0 -1
  22. package/lib/core/utils/layout.d.ts +13 -16
  23. package/lib/core/utils/positioning-enhanced.d.ts +2 -0
  24. package/lib/esm/index.js +460 -705
  25. package/lib/esm/index.js.map +1 -1
  26. package/lib/index.d.ts +0 -4
  27. package/package.json +67 -57
  28. package/lib/components/Lottie/Lottie.d.ts +0 -30
  29. package/lib/components/Lottie/index.d.ts +0 -2
  30. package/lib/components/RichTextEditor/RichTextEditor.d.ts +0 -3
  31. package/lib/components/RichTextEditor/index.d.ts +0 -2
  32. package/lib/components/RichTextEditor/styles.d.ts +0 -61
  33. package/lib/components/RichTextEditor/types.d.ts +0 -150
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { DialogProps } from './types';
3
- export declare function Dialog({ visible, variant, title, children, closable, backdrop, backdropClosable, shouldClose, onClose, width, height, style, bottomSheetSwipeZone, }: DialogProps): React.JSX.Element | null;
3
+ export declare function Dialog({ visible, variant, title, children, closable, backdrop, backdropClosable, shouldClose, onClose, w, h, radius, style, showHeader, bottomSheetSwipeZone, }: DialogProps): React.JSX.Element | null;
@@ -1,17 +1,33 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface DialogProps {
3
+ /** Controls whether the dialog is visible. */
3
4
  visible: boolean;
5
+ /** Presentation style of the dialog. */
4
6
  variant?: 'modal' | 'bottomsheet' | 'fullscreen';
7
+ /** Optional title text shown in the header area. */
5
8
  title?: string | null;
9
+ /** Dialog body content. */
6
10
  children: ReactNode;
11
+ /** Allows the user to close the dialog via UI controls or escape/back. */
7
12
  closable?: boolean;
13
+ /** Whether to render the dimming backdrop behind the dialog. */
8
14
  backdrop?: boolean;
15
+ /** Whether tapping the backdrop should close the dialog. */
9
16
  backdropClosable?: boolean;
17
+ /** Triggers close animation when set to true. */
10
18
  shouldClose?: boolean;
19
+ /** Called when the dialog requests to close. */
11
20
  onClose?: () => void;
12
- width?: number;
13
- height?: number;
21
+ /** Optional explicit width for the dialog content (modal/bottomsheet). */
22
+ w?: number;
23
+ /** Optional explicit height for the dialog content. */
24
+ h?: number;
25
+ /** Corner radius for the dialog container (bottom sheet rounds top corners only). */
26
+ radius?: number;
27
+ /** Optional style overrides for the dialog container. */
14
28
  style?: object;
29
+ /** Whether to show the styled header area with background and border (default true). */
30
+ showHeader?: boolean;
15
31
  /** Controls which part of the bottom sheet responds to swipe-to-dismiss gestures */
16
32
  bottomSheetSwipeZone?: 'container' | 'handle' | 'none';
17
33
  }
@@ -26,6 +42,11 @@ export interface DialogConfig {
26
42
  backdropClosable?: boolean;
27
43
  isClosing?: boolean;
28
44
  bottomSheetSwipeZone?: 'container' | 'handle' | 'none';
45
+ w?: number;
46
+ h?: number;
47
+ radius?: number;
48
+ style?: object;
49
+ showHeader?: boolean;
29
50
  }
30
51
  export interface DialogContextValue {
31
52
  dialogs: DialogConfig[];
@@ -25,7 +25,7 @@ export interface HoverCardProps {
25
25
  /** Whether rendered in portal (deprecated - always uses portal) */
26
26
  withinPortal?: boolean;
27
27
  /** Fixed width */
28
- width?: number;
28
+ w?: number;
29
29
  /** Show directional arrow */
30
30
  withArrow?: boolean;
31
31
  /** Close on Escape (web) */
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { ImageProps } from './types';
3
- export declare function Image({ src, source, alt, accessibilityLabel, resizeMode, size, width, height, aspectRatio, borderWidth, borderColor, rounded, circle, fallback, loading, onLoad, onError, onLoadStart, onLoadEnd, containerStyle, imageStyle, testID, style, ...rest }: ImageProps): React.JSX.Element | null;
3
+ export declare function Image({ src, source, alt, accessibilityLabel, resizeMode, size, w, h, aspectRatio, borderWidth, borderColor, rounded, circle, fallback, loading, onLoad, onError, onLoadStart, onLoadEnd, containerStyle, imageStyle, testID, style, ...rest }: ImageProps): React.JSX.Element | null;
@@ -9,7 +9,7 @@ export interface BaseComponentProps extends SpacingProps {
9
9
  /** Additional CSS styles */
10
10
  style?: any;
11
11
  }
12
- export interface ImageProps extends BaseComponentProps, Omit<LayoutProps, 'width' | 'height'>, BorderRadiusProps {
12
+ export interface ImageProps extends BaseComponentProps, Omit<LayoutProps, 'w' | 'h'>, BorderRadiusProps {
13
13
  /** Image source URI */
14
14
  src: string;
15
15
  /** Image source object (alternative to src) */
@@ -25,9 +25,9 @@ export interface ImageProps extends BaseComponentProps, Omit<LayoutProps, 'width
25
25
  /** Image size preset */
26
26
  size?: SizeValue | number;
27
27
  /** Custom width */
28
- width?: number | string;
28
+ w?: number | string;
29
29
  /** Custom height */
30
- height?: number | string;
30
+ h?: number | string;
31
31
  /** Aspect ratio */
32
32
  aspectRatio?: number;
33
33
  /** Border width */
@@ -16,18 +16,7 @@ export declare const createInputStyles: (theme: PlatformBlocksTheme, isRTL?: boo
16
16
  fontSize: number;
17
17
  marginTop: number;
18
18
  };
19
- input: {
20
- outlineWidth?: number | undefined;
21
- border?: string | undefined;
22
- backgroundColor?: string | undefined;
23
- flex: number;
24
- fontSize: number;
25
- color: string;
26
- paddingVertical: number;
27
- paddingHorizontal: number;
28
- minHeight: number;
29
- fontFamily: string;
30
- };
19
+ input: any;
31
20
  inputContainer: any;
32
21
  label: {
33
22
  color: string;
@@ -14,5 +14,6 @@ export interface ColumnProps extends Omit<FlexProps, 'direction'> {
14
14
  export declare const Row: React.FC<RowProps>;
15
15
  /**
16
16
  * Column component - alias for Flex with direction="column"
17
+ * Defaults to fullWidth={true} since vertical layouts typically fill available width
17
18
  */
18
19
  export declare const Column: React.FC<ColumnProps>;
@@ -17,9 +17,9 @@ export interface MenuProps extends SpacingProps {
17
17
  /** Callback when menu closes */
18
18
  onClose?: () => void;
19
19
  /** Menu content width */
20
- width?: number | 'target' | 'auto';
20
+ w?: number | 'target' | 'auto';
21
21
  /** Maximum height for scrollable content */
22
- maxHeight?: number;
22
+ maxH?: number;
23
23
  /** Menu content shadow */
24
24
  shadow?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
25
25
  /** Border radius */
@@ -52,15 +52,15 @@ export interface PopoverProps extends SpacingProps {
52
52
  /** Overlay component props */
53
53
  overlayProps?: Record<string, unknown>;
54
54
  /** Dropdown width, number or 'target' to match target width */
55
- width?: number | 'target';
55
+ w?: number | 'target';
56
56
  /** Dropdown max-width */
57
- maxWidth?: number;
57
+ maxW?: number;
58
58
  /** Dropdown max-height */
59
- maxHeight?: number;
59
+ maxH?: number;
60
60
  /** Dropdown min-width */
61
- minWidth?: number;
61
+ minW?: number;
62
62
  /** Dropdown min-height */
63
- minHeight?: number;
63
+ minH?: number;
64
64
  /** Border radius */
65
65
  radius?: RadiusValue | number;
66
66
  /** Box shadow */
@@ -48,7 +48,7 @@ export interface SelectProps<T = any> extends SpacingProps, LayoutProps {
48
48
  /** Stretches the trigger to occupy the full width of its container. */
49
49
  fullWidth?: boolean;
50
50
  /** Maximum height the dropdown may reach before it scrolls. */
51
- maxHeight?: number;
51
+ maxH?: number;
52
52
  /** Whether the dropdown should close immediately after selection. */
53
53
  closeOnSelect?: boolean;
54
54
  /** Allows the user to clear the current selection. */
@@ -6,9 +6,9 @@ export interface SkeletonProps extends SpacingProps {
6
6
  /** Shape of the skeleton placeholder */
7
7
  shape?: SkeletonShape;
8
8
  /** Width of the skeleton component */
9
- width?: DimensionValue;
9
+ w?: DimensionValue;
10
10
  /** Height of the skeleton component */
11
- height?: DimensionValue;
11
+ h?: DimensionValue;
12
12
  /** Size of the skeleton component (overrides width/height) */
13
13
  size?: SizeValue;
14
14
  /** Border radius for rectangle/rounded shapes */
@@ -53,9 +53,9 @@ export interface TableProps extends SpacingProps {
53
53
  export interface TableScrollContainerProps extends SpacingProps {
54
54
  children?: React.ReactNode;
55
55
  /** Minimum width before scrolling kicks in */
56
- minWidth?: number;
56
+ minW?: number;
57
57
  /** Maximum height before vertical scrolling */
58
- maxHeight?: number;
58
+ maxH?: number;
59
59
  /** Scroll type for web */
60
60
  type?: 'native' | 'custom';
61
61
  style?: any;
@@ -84,9 +84,9 @@ export interface TableCellProps extends SpacingProps {
84
84
  /** Text alignment */
85
85
  align?: 'left' | 'center' | 'right';
86
86
  /** Minimum width for auto-sizing */
87
- minWidth?: number;
87
+ minW?: number;
88
88
  /** Maximum width for auto-sizing */
89
- maxWidth?: number;
89
+ maxW?: number;
90
90
  /** Flex grow factor for flexible sizing */
91
91
  flex?: number;
92
92
  /** Width strategy for responsive behavior */
@@ -17,7 +17,7 @@ export interface TextAreaProps extends BaseInputProps {
17
17
  /** Show character counter */
18
18
  showCharCounter?: boolean;
19
19
  /** Fixed height for the TextArea */
20
- height?: number;
20
+ h?: number;
21
21
  /** Resize behavior */
22
22
  resize?: 'none' | 'vertical' | 'horizontal' | 'both';
23
23
  /** Additional TextInput props */
@@ -30,5 +30,5 @@ export interface TextAreaStyleProps {
30
30
  error?: boolean;
31
31
  rows?: number;
32
32
  resize?: 'none' | 'vertical' | 'horizontal' | 'both';
33
- height?: number;
33
+ h?: number;
34
34
  }
@@ -12,6 +12,8 @@ export interface TimelineItemProps extends Omit<ViewProps, 'children'> {
12
12
  children?: ReactNode;
13
13
  /** Item title */
14
14
  title?: string;
15
+ /** Optional timestamp text or node */
16
+ timestamp?: ReactNode;
15
17
  /** Custom bullet content (icon, avatar, etc.) */
16
18
  bullet?: ReactNode;
17
19
  /** Line variant for this item */
@@ -20,6 +22,12 @@ export interface TimelineItemProps extends Omit<ViewProps, 'children'> {
20
22
  color?: string;
21
23
  /** Item color variant token (e.g. primary.5 or primary) used if color not provided */
22
24
  colorVariant?: string;
25
+ /** Override title text color for this item */
26
+ titleColor?: string;
27
+ /** Override description text color for this item */
28
+ descriptionColor?: string;
29
+ /** Override timestamp text color for this item */
30
+ timestampColor?: string;
23
31
  /** Whether this item is active */
24
32
  active?: boolean;
25
33
  /** Override timeline alignment for this specific item */
@@ -34,6 +42,12 @@ export interface TimelineProps extends Omit<ViewProps, 'children'> {
34
42
  color?: string;
35
43
  /** Timeline color variant token (e.g. primary.5) used when color not provided */
36
44
  colorVariant?: string;
45
+ /** Default title color for all items */
46
+ titleColor?: string;
47
+ /** Default description color for all items */
48
+ descriptionColor?: string;
49
+ /** Default timestamp color for all items */
50
+ timestampColor?: string;
37
51
  /** Line width */
38
52
  lineWidth?: number;
39
53
  /** Bullet size */
@@ -58,4 +72,10 @@ export interface TimelineContextValue {
58
72
  metrics: TimelineSizeMetrics;
59
73
  /** Whether layout is split with centered vertical line */
60
74
  centerMode?: boolean;
75
+ /** Default title color for items */
76
+ titleColor?: string;
77
+ /** Default description color for items */
78
+ descriptionColor?: string;
79
+ /** Default timestamp color for items */
80
+ timestampColor?: string;
61
81
  }
@@ -74,8 +74,8 @@ export interface VideoProps extends SpacingProps {
74
74
  /** Video source configuration */
75
75
  source: VideoSource;
76
76
  /** Display and sizing */
77
- width?: number | string;
78
- height?: number | string;
77
+ w?: number | string;
78
+ h?: number | string;
79
79
  aspectRatio?: number;
80
80
  poster?: string;
81
81
  /** Playback configuration */
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  interface WaveformSkeletonProps {
3
- width?: number;
4
- height?: number;
3
+ w?: number;
4
+ h?: number;
5
5
  fullWidth?: boolean;
6
6
  barsCount?: number;
7
7
  }
@@ -4,9 +4,9 @@ export interface WaveformProps extends Omit<ViewProps, 'children'> {
4
4
  /** Array of peak values (normalized between -1 and 1) */
5
5
  peaks: number[];
6
6
  /** Width of the waveform */
7
- width?: number;
7
+ w?: number;
8
8
  /** Height of the waveform */
9
- height?: number;
9
+ h?: number;
10
10
  /** Color of the waveform */
11
11
  color?: string;
12
12
  /** Visual variant of the waveform */
@@ -50,7 +50,6 @@ export { Slider, RangeSlider } from './Slider';
50
50
  export { Knob } from './Knob';
51
51
  export { AutoComplete } from './AutoComplete';
52
52
  export { FileInput } from './FileInput';
53
- export { RichTextEditor } from './RichTextEditor';
54
53
  export { Form } from './Form';
55
54
  export { FormLayout, FormSection, FormGroup, FormField } from './FormLayout';
56
55
  export { Row, Column } from './Layout';
@@ -133,7 +132,6 @@ export type { SliderProps, RangeSliderProps } from './Slider';
133
132
  export type { KnobProps, KnobMark } from './Knob';
134
133
  export type { AutoCompleteProps, AutoCompleteOption } from './AutoComplete';
135
134
  export type { FileInputProps, FileInputFile } from './FileInput';
136
- export type { RichTextEditorProps, RichTextEditorContent, RichTextEditorFormat, RichTextEditorSelection } from './RichTextEditor';
137
135
  export type { FormProps, FormFieldProps, FormInputProps, FormLabelProps, FormErrorProps, FormSubmitProps } from './Form';
138
136
  export type { RowProps, ColumnProps } from './Layout';
139
137
  export type { ToastOptions, ToastPosition } from './Toast';
@@ -35,7 +35,6 @@ export type { SliderProps, RangeSliderProps } from './Slider';
35
35
  export type { KnobProps, KnobMark } from './Knob';
36
36
  export type { AutoCompleteProps, AutoCompleteOption } from './AutoComplete';
37
37
  export type { FileInputProps, FileInputFile } from './FileInput';
38
- export type { RichTextEditorProps } from './RichTextEditor';
39
38
  export type { FormProps } from './Form';
40
39
  export type { RowProps, ColumnProps } from './Layout';
41
40
  export type { ProgressProps } from './Progress';
@@ -2,38 +2,35 @@ import { ViewStyle, DimensionValue } from 'react-native';
2
2
  export interface LayoutProps {
3
3
  /** Makes the component fill the full width of its parent */
4
4
  fullWidth?: boolean;
5
- /** Sets a specific width (shorthand for width) */
6
- w?: DimensionValue;
7
5
  /** Sets a specific width */
8
- width?: DimensionValue;
6
+ w?: DimensionValue;
9
7
  /** Sets a specific height */
10
- height?: DimensionValue;
8
+ h?: DimensionValue;
11
9
  /** Sets the maximum width */
12
- maxWidth?: DimensionValue;
10
+ maxW?: DimensionValue;
13
11
  /** Sets the minimum width */
14
- minWidth?: DimensionValue;
12
+ minW?: DimensionValue;
15
13
  /** Sets the maximum height */
16
- maxHeight?: DimensionValue;
14
+ maxH?: DimensionValue;
17
15
  /** Sets the minimum height */
18
- minHeight?: DimensionValue;
16
+ minH?: DimensionValue;
19
17
  }
20
18
  /**
21
19
  * Generates layout styles based on provided layout properties.
22
20
  *
23
21
  * @param props - The layout properties object
24
22
  * @param props.fullWidth - When true, sets width to 100%
25
- * @param props.w - Shorthand width property (overrides fullWidth)
26
- * @param props.width - Specific width value (overrides fullWidth and w)
27
- * @param props.height - Height value
28
- * @param props.maxWidth - Maximum width constraint
29
- * @param props.minWidth - Minimum width constraint
30
- * @param props.maxHeight - Maximum height constraint
31
- * @param props.minHeight - Minimum height constraint
23
+ * @param props.w - Width property (overrides fullWidth)
24
+ * @param props.h - Height value
25
+ * @param props.maxW - Maximum width constraint
26
+ * @param props.minW - Minimum width constraint
27
+ * @param props.maxH - Maximum height constraint
28
+ * @param props.minH - Minimum height constraint
32
29
  *
33
30
  * @returns A partial ViewStyle object containing the computed layout styles
34
31
  *
35
32
  * @remarks
36
- * Property precedence for width: width > w > fullWidth
33
+ * Property precedence for width: w > fullWidth
37
34
  * The function processes width properties in order of specificity, with more specific
38
35
  * properties overriding more general ones.
39
36
  */
@@ -38,6 +38,8 @@ export interface PositioningOptions {
38
38
  boundary?: number;
39
39
  /** Fallback placements to try if primary placement doesn't fit */
40
40
  fallbackPlacements?: PlacementType[];
41
+ /** Match the anchor element's width (useful for dropdown inputs) */
42
+ matchAnchorWidth?: boolean;
41
43
  }
42
44
  /**
43
45
  * Enhanced overlay positioning that prevents off-screen rendering with intelligent caching