@platform-blocks/ui 0.6.0 → 0.7.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 (74) hide show
  1. package/README.md +0 -24
  2. package/lib/cjs/index.js +476 -720
  3. package/lib/cjs/index.js.map +1 -1
  4. package/lib/components/Accordion/types.d.ts +5 -5
  5. package/lib/components/AutoComplete/types.d.ts +3 -3
  6. package/lib/components/Avatar/types.d.ts +3 -3
  7. package/lib/components/Badge/types.d.ts +3 -3
  8. package/lib/components/Block/types.d.ts +2 -2
  9. package/lib/components/Blockquote/types.d.ts +2 -2
  10. package/lib/components/Breadcrumbs/types.d.ts +4 -4
  11. package/lib/components/Calendar/types.d.ts +2 -2
  12. package/lib/components/Carousel/types.d.ts +3 -3
  13. package/lib/components/Chip/types.d.ts +3 -3
  14. package/lib/components/CodeBlock/types.d.ts +4 -4
  15. package/lib/components/ColorPicker/types.d.ts +4 -4
  16. package/lib/components/CopyButton/types.d.ts +2 -2
  17. package/lib/components/DatePicker/types.d.ts +2 -2
  18. package/lib/components/Dialog/Dialog.d.ts +1 -1
  19. package/lib/components/Dialog/types.d.ts +23 -2
  20. package/lib/components/Divider/types.d.ts +2 -2
  21. package/lib/components/Grid/types.d.ts +3 -3
  22. package/lib/components/HoverCard/types.d.ts +3 -3
  23. package/lib/components/Image/Image.d.ts +1 -1
  24. package/lib/components/Image/types.d.ts +6 -6
  25. package/lib/components/Indicator/types.d.ts +2 -2
  26. package/lib/components/Input/styles.d.ts +1 -12
  27. package/lib/components/Knob/components/SurfaceLayers.d.ts +2 -2
  28. package/lib/components/Knob/components/ThumbLayer.d.ts +1 -1
  29. package/lib/components/Knob/components/TickLayers.d.ts +2 -2
  30. package/lib/components/Knob/types.d.ts +11 -11
  31. package/lib/components/Layout/Layout.d.ts +1 -0
  32. package/lib/components/ListGroup/types.d.ts +4 -4
  33. package/lib/components/Loader/types.d.ts +2 -2
  34. package/lib/components/Masonry/types.d.ts +4 -4
  35. package/lib/components/Menu/types.d.ts +2 -2
  36. package/lib/components/Navigation/types.d.ts +2 -2
  37. package/lib/components/Notice/types.d.ts +2 -2
  38. package/lib/components/Pagination/types.d.ts +6 -6
  39. package/lib/components/Popover/types.d.ts +5 -5
  40. package/lib/components/Progress/types.d.ts +3 -3
  41. package/lib/components/QRCode/types.d.ts +2 -2
  42. package/lib/components/Rating/types.d.ts +2 -2
  43. package/lib/components/Ring/types.d.ts +7 -7
  44. package/lib/components/SegmentedControl/types.d.ts +4 -4
  45. package/lib/components/Select/Select.types.d.ts +1 -1
  46. package/lib/components/Skeleton/types.d.ts +4 -4
  47. package/lib/components/Slider/types.d.ts +7 -7
  48. package/lib/components/Spotlight/types.d.ts +6 -6
  49. package/lib/components/Table/Table.d.ts +4 -4
  50. package/lib/components/Tabs/types.d.ts +5 -5
  51. package/lib/components/TextArea/types.d.ts +2 -2
  52. package/lib/components/Timeline/types.d.ts +20 -0
  53. package/lib/components/Toast/types.d.ts +2 -2
  54. package/lib/components/Tooltip/types.d.ts +2 -2
  55. package/lib/components/Video/NativeVideoPlayer.d.ts +2 -2
  56. package/lib/components/Video/VideoControls.d.ts +2 -2
  57. package/lib/components/Video/YouTubePlayer.d.ts +2 -2
  58. package/lib/components/Video/types.d.ts +6 -6
  59. package/lib/components/Waveform/WaveformSkeleton.d.ts +2 -2
  60. package/lib/components/Waveform/types.d.ts +2 -2
  61. package/lib/components/index.d.ts +0 -2
  62. package/lib/components/types.d.ts +0 -1
  63. package/lib/core/utils/layout.d.ts +13 -16
  64. package/lib/core/utils/positioning-enhanced.d.ts +2 -0
  65. package/lib/esm/index.js +478 -720
  66. package/lib/esm/index.js.map +1 -1
  67. package/lib/index.d.ts +0 -4
  68. package/package.json +67 -57
  69. package/lib/components/Lottie/Lottie.d.ts +0 -30
  70. package/lib/components/Lottie/index.d.ts +0 -2
  71. package/lib/components/RichTextEditor/RichTextEditor.d.ts +0 -3
  72. package/lib/components/RichTextEditor/index.d.ts +0 -2
  73. package/lib/components/RichTextEditor/styles.d.ts +0 -61
  74. package/lib/components/RichTextEditor/types.d.ts +0 -150
package/lib/index.d.ts CHANGED
@@ -66,7 +66,6 @@ export { PhoneInput } from './components/PhoneInput';
66
66
  export { ColorPicker } from './components/ColorPicker';
67
67
  export { ColorSwatch } from './components/ColorSwatch';
68
68
  export { EmojiPicker } from './components/EmojiPicker';
69
- export { RichTextEditor } from './components/RichTextEditor';
70
69
  export { Rating } from './components/Rating';
71
70
  export { Form, useFormContext, useOptionalFormContext } from './components/Form';
72
71
  export { Breadcrumbs } from './components/Breadcrumbs';
@@ -110,7 +109,6 @@ export { Image } from './components/Image';
110
109
  export { BrandIcon } from './components/BrandIcon';
111
110
  export { Carousel } from './components/Carousel';
112
111
  export { Gallery } from './components/Gallery';
113
- export { Lottie } from './components/Lottie';
114
112
  export { Video } from './components/Video';
115
113
  export { Waveform } from './components/Waveform';
116
114
  export { Collapse } from './components/Collapse';
@@ -173,7 +171,6 @@ export type { TimePickerInputProps } from './components/TimePickerInput';
173
171
  export type { PhoneInputProps } from './components/PhoneInput';
174
172
  export type { ColorPickerProps } from './components/ColorPicker';
175
173
  export type { EmojiPickerProps } from './components/EmojiPicker';
176
- export type { RichTextEditorProps, RichTextEditorContent, RichTextEditorFormat, RichTextEditorSelection } from './components/RichTextEditor';
177
174
  export type { RatingProps } from './components/Rating';
178
175
  export type { FormProps } from './components/Form';
179
176
  export type { BreadcrumbsProps } from './components/Breadcrumbs';
@@ -210,7 +207,6 @@ export type { IconButtonProps } from './components/IconButton';
210
207
  export type { CarouselProps } from './components/Carousel';
211
208
  export type { GalleryProps, GalleryItem } from './components/Gallery';
212
209
  export type { ImageProps } from './components/Image';
213
- export type { LottieProps } from './components/Lottie';
214
210
  export type { WaveformProps } from './components/Waveform';
215
211
  export type { DividerProps } from './components/Divider';
216
212
  export type { SpaceProps } from './components/Space';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-blocks/ui",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "A React Native UI library",
5
5
  "type": "module",
6
6
  "main": "lib/cjs/index.js",
@@ -35,10 +35,10 @@
35
35
  "test:ci": "jest --ci --coverage --maxWorkers=2",
36
36
  "test:update": "jest --updateSnapshot",
37
37
  "test:component": "jest",
38
- "lint": "eslint src --ext .ts,.tsx --ignore-path .eslintignore",
39
- "lint:fix": "eslint src --ext .ts,.tsx --fix --ignore-path .eslintignore",
40
- "lint:check": "eslint src --ext .ts,.tsx --max-warnings 0",
41
- "format": "eslint src --ext .ts,.tsx --fix && echo 'Code formatted successfully!'",
38
+ "lint": "eslint src",
39
+ "lint:fix": "eslint src --fix",
40
+ "lint:check": "eslint src --max-warnings 0",
41
+ "format": "eslint src --fix && echo 'Code formatted successfully!'",
42
42
  "precommit": "npm run lint:check && npm run test"
43
43
  },
44
44
  "keywords": [
@@ -59,88 +59,98 @@
59
59
  },
60
60
  "homepage": "https://github.com/joshstovall/platform-blocks#readme",
61
61
  "devDependencies": {
62
- "@babel/core": "^7.25.2",
63
- "@babel/preset-env": "^7.25.0",
64
- "@babel/preset-flow": "^7.27.1",
65
- "@babel/preset-react": "^7.25.0",
66
- "@babel/preset-typescript": "^7.25.0",
67
- "@eslint/js": "^8.57.1",
68
- "@react-native/babel-preset": "^0.81.4",
62
+ "@babel/core": "^7.28.0",
63
+ "@babel/preset-env": "^7.28.0",
64
+ "@babel/preset-flow": "^7.27.0",
65
+ "@babel/preset-react": "^7.28.0",
66
+ "@babel/preset-typescript": "^7.28.0",
67
+ "@react-native/babel-preset": "^0.83.0",
69
68
  "@react-native-masked-view/masked-view": "^0.3.2",
70
- "@rollup/plugin-commonjs": "^28.0.6",
69
+ "@rollup/plugin-commonjs": "^29.0.0",
71
70
  "@rollup/plugin-json": "^6.1.0",
72
- "@rollup/plugin-node-resolve": "^16.0.1",
73
- "@rollup/plugin-typescript": "^12.1.4",
74
- "@shopify/flash-list": "^2.1.0",
75
- "@testing-library/jest-native": "^5.4.3",
76
- "@testing-library/react-native": "^12.4.3",
77
- "@types/jest": "^29.5.12",
78
- "@types/react": "~19.1.10",
79
- "@typescript-eslint/eslint-plugin": "^8.0.0",
80
- "@typescript-eslint/parser": "^8.0.0",
81
- "babel-jest": "^29.7.0",
82
- "eslint": "^8.57.1",
83
- "eslint-plugin-import": "^2.28.1",
84
- "eslint-plugin-react": "^7.37.5",
85
- "eslint-plugin-react-hooks": "^4.6.0",
86
- "eslint-plugin-react-native": "^4.1.0",
87
- "eslint-plugin-unused-imports": "^3.0.0",
88
- "expo-audio": "^1.0.13",
89
- "expo-document-picker": "~14.0.7",
71
+ "@rollup/plugin-node-resolve": "^16.0.0",
72
+ "@rollup/plugin-typescript": "^12.3.0",
73
+ "@shopify/flash-list": "^2.2.0",
74
+ "@testing-library/react-native": "^13.3.0",
75
+ "@types/jest": "^30.0.0",
76
+ "@types/react": "^19.2.0",
77
+ "babel-jest": "^30.2.0",
78
+ "eslint": "^9.0.0",
79
+ "eslint-plugin-import": "^2.32.0",
80
+ "eslint-plugin-react": "^7.37.0",
81
+ "eslint-plugin-react-hooks": "^7.0.0",
82
+ "eslint-plugin-react-native": "^5.0.0",
83
+ "eslint-plugin-unused-imports": "^4.3.0",
84
+ "expo-audio": "^1.1.0",
85
+ "expo-document-picker": "^14.0.0",
90
86
  "expo-haptics": "^15.0.0",
91
- "expo-linear-gradient": "^14.1.5",
92
- "expo-status-bar": "^1.12.0",
93
- "jest": "^29.7.0",
94
- "jest-environment-node": "^29.7.0",
95
- "jest-expo": "^54.0.12",
96
- "metro-react-native-babel-preset": "^0.77.0",
97
- "react": "^19.1.0",
98
- "react-native": "0.81.4",
99
- "react-native-reanimated": "~4.1.1",
100
- "react-native-reanimated-carousel": "^4.0.3",
101
- "react-native-safe-area-context": "~5.6.0",
102
- "react-native-svg": "^15.12.1",
87
+ "expo-linear-gradient": "^15.0.0",
88
+ "expo-status-bar": "^3.0.0",
89
+ "jest": "^30.2.0",
90
+ "jest-environment-node": "^30.2.0",
91
+ "jest-expo": "^54.0.0",
92
+ "react": "19.2.0",
93
+ "react-native": "0.83.1",
94
+ "react-native-reanimated": "~4.2.1",
95
+ "react-native-reanimated-carousel": "^4.0.0",
96
+ "react-native-safe-area-context": "^5.6.0",
97
+ "react-native-svg": "15.15.1",
98
+ "react-native-worklets": "0.7.2",
103
99
  "react-syntax-highlighter": "^16.1.0",
104
- "react-test-renderer": "19.1.0",
105
- "rollup": "^4.52.3",
106
- "rollup-plugin-dts": "^6.2.3",
100
+ "react-test-renderer": "19.2.0",
101
+ "rollup": "^4.57.0",
102
+ "rollup-plugin-dts": "^6.3.0",
107
103
  "rollup-plugin-peer-deps-external": "^2.2.4",
108
- "typescript": "~5.9.2",
109
- "typescript-eslint": "^8.41.0"
104
+ "typescript": "^5.9.0",
105
+ "typescript-eslint": "^8.54.0"
110
106
  },
111
107
  "peerDependencies": {
112
- "@react-native-masked-view/masked-view": ">=0.2.9",
108
+ "@react-native-masked-view/masked-view": ">=0.3.0",
113
109
  "@shopify/flash-list": ">=1.6.0",
114
- "expo-document-picker": ">=13.0.0",
115
- "expo-linear-gradient": ">=12.0.0",
116
110
  "expo-audio": ">=1.0.0",
111
+ "expo-document-picker": ">=13.0.0",
117
112
  "expo-haptics": ">=14.0.0",
113
+ "expo-linear-gradient": ">=12.0.0",
118
114
  "expo-status-bar": ">=1.12.0",
119
- "react": ">=18.0.0 <20.0.0",
115
+ "react": ">=18.0.0",
120
116
  "react-native": ">=0.73.0",
121
117
  "react-native-reanimated": ">=3.4.0",
122
118
  "react-native-reanimated-carousel": ">=3.4.0",
123
119
  "react-native-safe-area-context": ">=4.5.0",
124
120
  "react-native-svg": ">=13.0.0",
121
+ "react-native-worklets": ">=0.5.0",
125
122
  "react-syntax-highlighter": ">=15.0.0"
126
123
  },
127
124
  "peerDependenciesMeta": {
125
+ "@react-native-masked-view/masked-view": {
126
+ "optional": true
127
+ },
128
+ "@shopify/flash-list": {
129
+ "optional": true
130
+ },
128
131
  "expo-audio": {
129
132
  "optional": true
130
133
  },
134
+ "expo-document-picker": {
135
+ "optional": true
136
+ },
131
137
  "expo-haptics": {
132
138
  "optional": true
133
139
  },
140
+ "expo-linear-gradient": {
141
+ "optional": true
142
+ },
134
143
  "expo-status-bar": {
135
144
  "optional": true
136
145
  },
146
+ "react-native-reanimated-carousel": {
147
+ "optional": true
148
+ },
149
+ "react-native-worklets": {
150
+ "optional": true
151
+ },
137
152
  "react-syntax-highlighter": {
138
153
  "optional": true
139
154
  }
140
- },
141
- "optionalDependencies": {
142
- "lottie-react": "^2.4.1",
143
- "@lottiefiles/dotlottie-react": "^0.13.5",
144
- "lottie-react-native": "^7.3.4"
145
155
  }
146
156
  }
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { ViewStyle } from 'react-native';
3
- export type AnimationSource = any;
4
- export interface LottieProps {
5
- /** Required Lottie animation JSON (require or imported object) */
6
- source: any;
7
- /** Auto play animation */
8
- autoPlay?: boolean;
9
- /** Loop animation */
10
- loop?: boolean;
11
- /** Progress prop (0-1) for manual control */
12
- progress?: number;
13
- /** Speed multiplier */
14
- speed?: number;
15
- /** Style for container */
16
- style?: ViewStyle;
17
- /** Test ID */
18
- testID?: string;
19
- /** Pause state */
20
- paused?: boolean;
21
- /** Optional resize mode (cover/contain/center) */
22
- resizeMode?: 'cover' | 'contain' | 'center';
23
- /** Called when animation finishes (loop false) */
24
- onAnimationFinish?: (isCancelled: boolean) => void;
25
- }
26
- /**
27
- * Lottie component with safe fallback when native module not present or on unsupported platforms.
28
- */
29
- export declare const Lottie: React.ForwardRefExoticComponent<LottieProps & React.RefAttributes<any>>;
30
- export default Lottie;
@@ -1,2 +0,0 @@
1
- export { Lottie } from './Lottie';
2
- export type { LottieProps } from './Lottie';
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { RichTextEditorProps } from './types';
3
- export declare const RichTextEditor: React.FC<RichTextEditorProps>;
@@ -1,2 +0,0 @@
1
- export { RichTextEditor } from './RichTextEditor';
2
- export type { RichTextEditorProps, RichTextEditorContent, RichTextEditorFormat, RichTextEditorSelection } from './types';
@@ -1,61 +0,0 @@
1
- export declare function useRichTextEditorStyles(): {
2
- characterCount: {
3
- fontSize: number;
4
- marginTop: number;
5
- textAlign: "right";
6
- };
7
- container: {
8
- width: "100%";
9
- };
10
- disabled: {
11
- opacity: number;
12
- };
13
- editorContainer: {
14
- backgroundColor: string;
15
- borderColor: string;
16
- borderRadius: number;
17
- borderWidth: number;
18
- overflow: "hidden";
19
- };
20
- errorText: {
21
- fontSize: number;
22
- marginTop: number;
23
- };
24
- helperText: {
25
- fontSize: number;
26
- marginTop: number;
27
- };
28
- textInput: {
29
- fontSize: number;
30
- lineHeight: number;
31
- padding: number;
32
- };
33
- toolButton: {
34
- alignItems: "center";
35
- backgroundColor: string;
36
- borderColor: string;
37
- borderRadius: number;
38
- borderWidth: number;
39
- height: number;
40
- justifyContent: "center";
41
- width: number;
42
- };
43
- toolSeparator: {
44
- backgroundColor: string;
45
- height: number;
46
- marginHorizontal: number;
47
- width: number;
48
- };
49
- toolbar: {
50
- backgroundColor: string;
51
- borderBottomColor: string;
52
- borderBottomWidth: number;
53
- };
54
- toolbarContent: {
55
- alignItems: "center";
56
- flexDirection: "row";
57
- gap: number;
58
- paddingHorizontal: number;
59
- paddingVertical: number;
60
- };
61
- };
@@ -1,150 +0,0 @@
1
- import React from 'react';
2
- import { BaseInputProps } from '../Input/types';
3
- export interface RichTextEditorFormat {
4
- /** Bold text */
5
- bold?: boolean;
6
- /** Italic text */
7
- italic?: boolean;
8
- /** Underlined text */
9
- underline?: boolean;
10
- /** Strikethrough text */
11
- strikethrough?: boolean;
12
- /** Text color */
13
- color?: string;
14
- /** Background color */
15
- backgroundColor?: string;
16
- /** Font size */
17
- fontSize?: number;
18
- /** Font family */
19
- fontFamily?: string;
20
- /** Text alignment */
21
- align?: 'left' | 'center' | 'right' | 'justify';
22
- /** List type */
23
- list?: 'ordered' | 'unordered' | null;
24
- /** Heading level */
25
- heading?: 1 | 2 | 3 | 4 | 5 | 6 | null;
26
- /** Link URL */
27
- link?: string | null;
28
- /** Code formatting */
29
- code?: boolean;
30
- /** Quote formatting */
31
- quote?: boolean;
32
- }
33
- export interface RichTextEditorContent {
34
- /** Raw HTML content */
35
- html: string;
36
- /** Plain text content */
37
- text: string;
38
- /** Delta format (for advanced editors) */
39
- delta?: any;
40
- /** Custom format */
41
- json?: any;
42
- }
43
- export interface RichTextEditorSelection {
44
- /** Start index */
45
- index: number;
46
- /** Selection length */
47
- length: number;
48
- /** Current format */
49
- format?: RichTextEditorFormat;
50
- }
51
- export interface RichTextEditorProps extends Omit<BaseInputProps, 'value' | 'onChange'> {
52
- /** Initial content */
53
- defaultValue?: RichTextEditorContent;
54
- /** Current content */
55
- value?: RichTextEditorContent;
56
- /** Content change handler */
57
- onChange?: (content: RichTextEditorContent) => void;
58
- /** Selection change handler */
59
- onSelectionChange?: (selection: RichTextEditorSelection) => void;
60
- /** Focus handler */
61
- onFocus?: () => void;
62
- /** Blur handler */
63
- onBlur?: () => void;
64
- /** Editor placeholder */
65
- placeholder?: string;
66
- /** Whether editor is read-only */
67
- readOnly?: boolean;
68
- /** Toolbar configuration */
69
- toolbar?: {
70
- /** Show toolbar */
71
- enabled?: boolean;
72
- /** Toolbar position */
73
- position?: 'top' | 'bottom' | 'floating';
74
- /** Available tools */
75
- tools?: Array<'bold' | 'italic' | 'underline' | 'strikethrough' | 'color' | 'backgroundColor' | 'fontSize' | 'fontFamily' | 'align' | 'list' | 'heading' | 'link' | 'image' | 'code' | 'quote' | 'separator' | {
76
- type: 'custom';
77
- component: React.ComponentType<any>;
78
- props?: any;
79
- }>;
80
- /** Toolbar groups */
81
- groups?: Array<Array<string>>;
82
- };
83
- /** Format options */
84
- formats?: {
85
- /** Available font families */
86
- fontFamilies?: string[];
87
- /** Available font sizes */
88
- fontSizes?: number[];
89
- /** Available colors */
90
- colors?: string[];
91
- /** Available heading levels */
92
- headings?: Array<1 | 2 | 3 | 4 | 5 | 6>;
93
- };
94
- /** Image handling */
95
- images?: {
96
- /** Allow image uploads */
97
- enabled?: boolean;
98
- /** Upload handler */
99
- onUpload?: (file: File) => Promise<string>;
100
- /** Maximum image size */
101
- maxSize?: number;
102
- /** Allowed image types */
103
- allowedTypes?: string[];
104
- /** Image resize settings */
105
- resize?: {
106
- maxWidth?: number;
107
- maxHeight?: number;
108
- quality?: number;
109
- };
110
- };
111
- /** Link handling */
112
- links?: {
113
- /** Allow links */
114
- enabled?: boolean;
115
- /** Link validation */
116
- validate?: (url: string) => boolean;
117
- /** Open links in new tab */
118
- openInNewTab?: boolean;
119
- };
120
- /** Custom plugins */
121
- plugins?: Array<{
122
- /** Plugin name */
123
- name: string;
124
- /** Plugin component */
125
- component: React.ComponentType<any>;
126
- /** Plugin configuration */
127
- config?: any;
128
- }>;
129
- /** Autosave configuration */
130
- autosave?: {
131
- /** Enable autosave */
132
- enabled?: boolean;
133
- /** Save interval in milliseconds */
134
- interval?: number;
135
- /** Save handler */
136
- onSave?: (content: RichTextEditorContent) => void;
137
- };
138
- /** Spell check */
139
- spellCheck?: boolean;
140
- /** Maximum content length */
141
- maxLength?: number;
142
- /** Minimum editor height */
143
- minHeight?: number;
144
- /** Maximum editor height */
145
- maxHeight?: number;
146
- /** Custom CSS classes */
147
- className?: string;
148
- /** Theme override */
149
- theme?: 'light' | 'dark' | 'auto';
150
- }