@platform-blocks/ui 0.4.0 → 0.6.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 (34) hide show
  1. package/lib/cjs/index.js +684 -1211
  2. package/lib/cjs/index.js.map +1 -1
  3. package/lib/components/Avatar/Avatar.d.ts +1 -1
  4. package/lib/components/Avatar/types.d.ts +3 -3
  5. package/lib/components/Carousel/types.d.ts +32 -0
  6. package/lib/components/DataTable/DataTable.d.ts +1 -1
  7. package/lib/components/DataTable/types.d.ts +2 -0
  8. package/lib/components/HoverCard/types.d.ts +4 -2
  9. package/lib/components/Popover/types.d.ts +2 -0
  10. package/lib/components/Slider/types.d.ts +29 -1
  11. package/lib/components/Switch/styles.d.ts +1 -1
  12. package/lib/components/TextArea/styles.d.ts +1 -1
  13. package/lib/components/index.d.ts +0 -2
  14. package/lib/core/providers/OverlayProvider.d.ts +1 -1
  15. package/lib/core/theme/PlatformBlocksProvider.d.ts +1 -5
  16. package/lib/esm/index.js +685 -1193
  17. package/lib/esm/index.js.map +1 -1
  18. package/lib/index.d.ts +0 -7
  19. package/package.json +1 -1
  20. package/lib/components/Can/Can.d.ts +0 -30
  21. package/lib/components/Can/PermissionDemo.d.ts +0 -2
  22. package/lib/components/Can/ability.d.ts +0 -89
  23. package/lib/components/Can/builder.d.ts +0 -113
  24. package/lib/components/Can/context.d.ts +0 -25
  25. package/lib/components/Can/index.d.ts +0 -6
  26. package/lib/components/Can/types.d.ts +0 -230
  27. package/lib/components/HoverCard/index.d.ts +0 -2
  28. package/lib/components/NavigationProgress/NavigationProgress.d.ts +0 -4
  29. package/lib/components/NavigationProgress/defaults.d.ts +0 -8
  30. package/lib/components/NavigationProgress/hooks/useNavigationProgressState.d.ts +0 -1
  31. package/lib/components/NavigationProgress/index.d.ts +0 -2
  32. package/lib/components/NavigationProgress/styles/resolver.d.ts +0 -1
  33. package/lib/components/NavigationProgress/tokens.d.ts +0 -4
  34. package/lib/components/NavigationProgress/types.d.ts +0 -30
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { AvatarProps } from './types';
3
- export declare function Avatar({ size, src, fallback, backgroundColor, textColor, online, badgeColor, style, accessibilityLabel, label, description, gap, showText, }: AvatarProps): React.JSX.Element;
3
+ export declare function Avatar({ size, src, fallback, backgroundColor, textColor, online, indicatorColor, style, accessibilityLabel, label, description, gap, showText, }: AvatarProps): React.JSX.Element;
@@ -14,9 +14,9 @@ export interface AvatarProps {
14
14
  textColor?: string;
15
15
  /** Whether to show online status indicator */
16
16
  online?: boolean;
17
- /** Accessibility label for the avatar badge */
18
- badgeColor?: string;
19
- /** Accessibility label for the avatar badge */
17
+ /** Color override for the status indicator */
18
+ indicatorColor?: string;
19
+ /** Style override for the avatar container */
20
20
  style?: ViewStyle;
21
21
  /** Accessibility label for the avatar image */
22
22
  accessibilityLabel?: string;
@@ -4,9 +4,11 @@ import { SpacingProps } from '../../core/utils';
4
4
  import type { ResponsiveSize } from '../AppShell/types';
5
5
  import type { ComponentSizeValue } from '../../core/theme/componentSize';
6
6
  export interface CarouselProps extends SpacingProps {
7
+ /** Array of carousel slide elements */
7
8
  children: React.ReactNode[];
8
9
  /** Orientation of the carousel */
9
10
  orientation?: 'horizontal' | 'vertical';
11
+ /** Show navigation arrow buttons */
10
12
  showArrows?: boolean;
11
13
  /** Show navigation dots */
12
14
  showDots?: boolean;
@@ -20,6 +22,24 @@ export interface CarouselProps extends SpacingProps {
20
22
  loop?: boolean;
21
23
  /** Number of visible items per page */
22
24
  itemsPerPage?: number;
25
+ /** Number of slides to advance per snap (defaults to itemsPerPage for backwards compatibility) */
26
+ slidesToScroll?: number;
27
+ /** Align the visible slides within the viewport when there is extra space */
28
+ align?: 'start' | 'center' | 'end';
29
+ /** Contain leading/trailing space by trimming or keeping snap points */
30
+ containScroll?: false | 'trimSnaps' | 'keepSnaps';
31
+ /** Initial slide index to show on mount */
32
+ startIndex?: number;
33
+ /** Allow momentum scrolling without forced snaps */
34
+ dragFree?: boolean;
35
+ /** Permit gestures to skip over multiple snap points (default true) */
36
+ skipSnaps?: boolean;
37
+ /** Drag distance (in px) required before a swipe is committed */
38
+ dragThreshold?: number;
39
+ /** Duration (ms) for programmatic scroll animations */
40
+ duration?: number;
41
+ /** Embla-style breakpoint overrides applied via media queries */
42
+ breakpoints?: Record<string, Partial<CarouselProps>>;
23
43
  /**
24
44
  * Explicit slide size. Accepts:
25
45
  * - percentage string: e.g. "70%"
@@ -37,16 +57,28 @@ export interface CarouselProps extends SpacingProps {
37
57
  };
38
58
  /** Responsive gap between slides (overrides itemGap). Accepts spacing token string or number or responsive map. */
39
59
  slideGap?: ResponsiveSize;
60
+ /** Gap between slides in pixels */
40
61
  itemGap?: number;
62
+ /** Fixed height of the carousel container */
41
63
  height?: number;
64
+ /** Callback fired when the active slide changes */
42
65
  onSlideChange?: (index: number) => void;
66
+ /** Style override for the carousel container */
43
67
  style?: ViewStyle;
68
+ /** Style override applied to each slide item */
44
69
  itemStyle?: ViewStyle;
70
+ /** Enable snapping to individual items */
45
71
  snapToItem?: boolean;
72
+ /** Position of navigation arrows relative to the carousel */
46
73
  arrowPosition?: 'inside' | 'outside';
74
+ /** Size of the navigation arrow buttons */
47
75
  arrowSize?: ComponentSizeValue;
76
+ /** Size of the navigation dots */
48
77
  dotSize?: ComponentSizeValue;
78
+ /** Enable or disable scroll gestures */
49
79
  scrollEnabled?: boolean;
80
+ /** Disable animated width/color transitions for dots and snapping */
50
81
  reducedMotion?: boolean;
82
+ /** Number of logical pages to render for virtualization */
51
83
  windowSize?: number;
52
84
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { DataTableProps } from './types';
3
3
  export type { DataTableProps, DataTableColumn, DataTableFilter, DataTableSort, DataTablePagination, SortDirection, FilterType, ColumnDataType } from './types';
4
- export declare const DataTable: <T>({ id, data, columns, loading, error, emptyMessage, searchable, searchPlaceholder, searchValue: controlledSearchValue, onSearchChange, sortBy, onSortChange, filters, onFilterChange, pagination, onPaginationChange, selectable, selectedRows, onSelectionChange, getRowId, onRowClick, editMode, onEditModeChange, onCellEdit, bulkActions, variant, density, height, virtual, style, hoverHighlight, enableColumnResizing, rowFeatureToggle, initialHiddenColumns, onColumnVisibilityChange, onColumnSettings, showColumnVisibilityManager, rowsPerPageOptions, showRowsPerPageControl, rowActions, actionsColumnWidth, fullWidth, rowBorderWidth, rowBorderColor, rowBorderStyle, columnBorderWidth, columnBorderColor, columnBorderStyle, showOuterBorder, outerBorderWidth, outerBorderColor, expandableRowRender, initialExpandedRows, expandedRows: controlledExpandedRows, onExpandedRowsChange, allowMultipleExpanded, expandIcon, collapseIcon, ...props }: DataTableProps<T>) => React.JSX.Element;
4
+ export declare const DataTable: <T>({ id, data, columns, loading, error, emptyMessage, searchable, searchPlaceholder, searchValue: controlledSearchValue, onSearchChange, sortBy, onSortChange, filters, onFilterChange, pagination, onPaginationChange, selectable, selectedRows, onSelectionChange, getRowId, onRowClick, editMode, onEditModeChange, onCellEdit, bulkActions, variant, striped: stripedProp, density, height, virtual, style, hoverHighlight, enableColumnResizing, rowFeatureToggle, initialHiddenColumns, onColumnVisibilityChange, onColumnSettings, showColumnVisibilityManager, rowsPerPageOptions, showRowsPerPageControl, rowActions, actionsColumnWidth, fullWidth, rowBorderWidth, rowBorderColor, rowBorderStyle, columnBorderWidth, columnBorderColor, columnBorderStyle, showOuterBorder, outerBorderWidth, outerBorderColor, expandableRowRender, initialExpandedRows, expandedRows: controlledExpandedRows, onExpandedRowsChange, allowMultipleExpanded, expandIcon, collapseIcon, ...props }: DataTableProps<T>) => React.JSX.Element;
5
5
  export default DataTable;
@@ -169,6 +169,8 @@ export interface DataTableProps<T = any> extends SpacingProps {
169
169
  }>;
170
170
  /** Width of the actions column */
171
171
  actionsColumnWidth?: number;
172
+ /** Force striped row backgrounds regardless of variant */
173
+ striped?: boolean;
172
174
  /** Custom header background color */
173
175
  headerBackgroundColor?: string;
174
176
  /** Show enhanced loading skeletons instead of basic loading text */
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ViewStyle, View } from 'react-native';
3
3
  import { SizeValue } from '../../core/theme/sizes';
4
- export type HoverCardPosition = 'top' | 'bottom' | 'left' | 'right';
4
+ export type HoverCardPosition = 'top' | 'bottom' | 'left' | 'right' | 'auto';
5
5
  export type HoverCardShadow = 'none' | 'sm' | 'md' | 'lg';
6
6
  export interface HoverCardProps {
7
7
  /** Floating content */
@@ -22,7 +22,7 @@ export interface HoverCardProps {
22
22
  shadow?: HoverCardShadow;
23
23
  /** Corner radius */
24
24
  radius?: SizeValue;
25
- /** Whether rendered in portal (not yet implemented) */
25
+ /** Whether rendered in portal (deprecated - always uses portal) */
26
26
  withinPortal?: boolean;
27
27
  /** Fixed width */
28
28
  width?: number;
@@ -46,6 +46,8 @@ export interface HoverCardProps {
46
46
  keepMounted?: boolean;
47
47
  /** Trigger mode */
48
48
  trigger?: 'hover' | 'click';
49
+ /** Positioning strategy: 'fixed' for web, 'portal' for native */
50
+ strategy?: 'fixed' | 'portal';
49
51
  }
50
52
  export interface HoverCardFactoryPayload {
51
53
  props: HoverCardProps;
@@ -29,6 +29,8 @@ export interface PopoverProps extends SpacingProps {
29
29
  onClose?: () => void;
30
30
  /** Called when popover is dismissed via outside click or escape */
31
31
  onDismiss?: () => void;
32
+ /** How the popover is triggered: 'click' (default) or 'hover' (mostly useful for devices with a mouse) */
33
+ trigger?: 'click' | 'hover';
32
34
  /** Disable popover entirely */
33
35
  disabled?: boolean;
34
36
  /** Close when clicking outside */
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
+ import { ViewStyle } from 'react-native';
2
3
  import { BaseInputProps } from '../Input/types';
3
- import { ColorValue, SizeValue } from '../../core/theme/types';
4
+ import { ColorValue, SizeValue, PlatformBlocksTheme } from '../../core/theme/types';
5
+ export type SliderColorScheme = keyof PlatformBlocksTheme['colors'] | (string & {});
4
6
  export interface SliderTick {
5
7
  /** Tick value */
6
8
  value: number;
@@ -34,6 +36,18 @@ export interface SliderProps extends Omit<BaseInputProps, 'value' | 'onChangeTex
34
36
  trackSize?: number;
35
37
  /** Thumb size */
36
38
  thumbSize?: number;
39
+ /** Theme color palette or custom color to drive active elements */
40
+ colorScheme?: SliderColorScheme;
41
+ /** Additional styling for the inactive track */
42
+ trackStyle?: ViewStyle;
43
+ /** Additional styling for the active track */
44
+ activeTrackStyle?: ViewStyle;
45
+ /** Additional styling for the thumb */
46
+ thumbStyle?: ViewStyle;
47
+ /** Override inactive tick color */
48
+ tickColor?: ColorValue;
49
+ /** Override active tick color */
50
+ activeTickColor?: ColorValue;
37
51
  /** Input label (above the slider) */
38
52
  label?: React.ReactNode;
39
53
  /** Value label formatter function, set to null to disable value label */
@@ -97,6 +111,12 @@ export interface SliderTrackProps {
97
111
  activeWidth?: number;
98
112
  activeLeft?: number;
99
113
  isRange?: boolean;
114
+ trackColor?: ColorValue;
115
+ activeTrackColor?: ColorValue;
116
+ trackStyle?: ViewStyle;
117
+ activeTrackStyle?: ViewStyle;
118
+ trackHeight?: number;
119
+ thumbSize?: number;
100
120
  }
101
121
  export interface SliderTicksProps {
102
122
  ticks: Array<{
@@ -110,6 +130,10 @@ export interface SliderTicksProps {
110
130
  size: 'sm' | 'md' | 'lg';
111
131
  orientation: 'horizontal' | 'vertical';
112
132
  keyPrefix?: string;
133
+ trackHeight?: number;
134
+ thumbSize?: number;
135
+ activeTickColor?: ColorValue;
136
+ tickColor?: ColorValue;
113
137
  }
114
138
  export interface SliderThumbProps {
115
139
  position: number;
@@ -120,6 +144,9 @@ export interface SliderThumbProps {
120
144
  isDragging: boolean;
121
145
  zIndex?: number;
122
146
  panHandlers?: any;
147
+ thumbColor?: ColorValue;
148
+ thumbStyle?: ViewStyle;
149
+ thumbSize?: number;
123
150
  }
124
151
  export interface SliderLabelProps {
125
152
  label: React.ReactNode;
@@ -130,4 +157,5 @@ export interface SliderValueLabelProps {
130
157
  size: 'sm' | 'md' | 'lg';
131
158
  orientation: 'horizontal' | 'vertical';
132
159
  isCard?: boolean;
160
+ thumbSize?: number;
133
161
  }
@@ -26,7 +26,7 @@ export declare const useSwitchStyles: (props: SwitchStyleProps & {
26
26
  lineHeight: number;
27
27
  };
28
28
  labelContainer: {
29
- flex: number;
29
+ flexShrink: number;
30
30
  justifyContent: "center";
31
31
  };
32
32
  labelDisabled: {
@@ -40,7 +40,7 @@ export declare const useTextAreaStyles: (props: TextAreaProps & {
40
40
  backgroundColor: string;
41
41
  borderColor: string;
42
42
  borderRadius: 8;
43
- borderWidth: 2;
43
+ borderWidth: number;
44
44
  paddingHorizontal: 8;
45
45
  paddingVertical: 4;
46
46
  };
@@ -57,7 +57,6 @@ export { Row, Column } from './Layout';
57
57
  export { ToastProvider, useToast, useToastApi } from './Toast';
58
58
  export { Progress } from './Progress';
59
59
  export { QRCode } from './QRCode';
60
- export { NavigationProgress, navigationProgress } from './NavigationProgress';
61
60
  export { Radio, RadioGroup } from './Radio';
62
61
  export { Rating } from './Rating';
63
62
  export { Collapse } from './Collapse';
@@ -82,7 +81,6 @@ export { ShimmerText } from './ShimmerText';
82
81
  export { Highlight } from './Highlight';
83
82
  export { Title } from './Title/Title';
84
83
  export { TableOfContents } from './TableOfContents/TableOfContents';
85
- export { HoverCard } from './HoverCard/HoverCard';
86
84
  export { ContextMenu } from './ContextMenu';
87
85
  export { Popover } from './Popover';
88
86
  export { Gallery } from './Gallery';
@@ -3,7 +3,7 @@ export interface OverlayConfig {
3
3
  id: string;
4
4
  content: ReactNode;
5
5
  trigger?: 'click' | 'hover' | 'contextmenu' | 'manual';
6
- placement?: 'top' | 'bottom' | 'left' | 'right' | 'auto';
6
+ placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end' | 'auto';
7
7
  offset?: number;
8
8
  anchor?: {
9
9
  x: number;
@@ -3,11 +3,9 @@ import { PlatformBlocksThemeProviderProps } from './ThemeProvider';
3
3
  import type { DirectionProviderProps } from '../providers';
4
4
  import type { HighlightProps as HighlightComponentProps } from '../../components/Highlight';
5
5
  import type { HapticsProviderProps } from '../haptics/HapticsProvider';
6
- import type { PermissionProviderProps } from '../../components/Can';
7
6
  import { ThemeModeConfig } from './ThemeModeProvider';
8
7
  type DirectionProviderConfig = Omit<DirectionProviderProps, 'children'>;
9
8
  type HapticsProviderConfig = Omit<HapticsProviderProps, 'children'>;
10
- type PermissionProviderConfig = Omit<PermissionProviderProps, 'children'>;
11
9
  export interface PlatformBlocksProviderProps extends Omit<PlatformBlocksThemeProviderProps, 'children'> {
12
10
  /** Your application */
13
11
  children: React.ReactNode;
@@ -52,14 +50,12 @@ export interface PlatformBlocksProviderProps extends Omit<PlatformBlocksThemePro
52
50
  direction?: false | DirectionProviderConfig;
53
51
  /** Haptics context configuration (pass false to opt out) */
54
52
  haptics?: false | HapticsProviderConfig;
55
- /** Permission context configuration (pass false to opt out) */
56
- permissions?: false | PermissionProviderConfig;
57
53
  }
58
54
  /**
59
55
  * Main provider component for Platform Blocks library
60
56
  * Provides theme context and injects CSS variables
61
57
  */
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;
58
+ export declare function PlatformBlocksProvider({ children, theme, inherit, withCSSVariables, cssVariablesSelector, colorSchemeMode, withOverlays, withSpotlight, withGlobalCSS, themeModeConfig, spotlightConfig, locale, fallbackLocale, i18nResources, direction, haptics }: PlatformBlocksProviderProps): React.JSX.Element;
63
59
  export declare namespace PlatformBlocksProvider {
64
60
  var displayName: string;
65
61
  }