@hero-design/rn-work-uikit 1.9.0 → 1.9.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/.cursor/rules/performance-optimization.mdc +64 -0
- package/.cursor/rules/rn-work-uikit-rules.mdc +202 -0
- package/.cursor/rules/testing-rules.mdc +114 -0
- package/CHANGELOG.md +10 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +383 -362
- package/package.json +6 -7
- package/src/components/DatePicker/__tests__/__snapshots__/index.spec.tsx.snap +5 -5
- package/src/components/Select/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +20 -20
- package/.cursorrules +0 -57
- package/src/utils/hooks.ts +0 -10
- package/stats/1.9.0/rn-work-uikit-stats.html +0 -4844
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn-work-uikit",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
8
8
|
"description": "EH Work specific UI components built on top of @hero-design/rn",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"lint": "eslint src",
|
|
10
|
+
"lint": "eslint src --quiet",
|
|
11
11
|
"type-check": "tsc --noEmit",
|
|
12
12
|
"test": "jest --runInBand",
|
|
13
13
|
"test:watch": "jest --runInBand --watch",
|
|
@@ -21,13 +21,12 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@emotion/native": "^11.9.3",
|
|
24
|
-
"@emotion/primitives-core": "11.0.0",
|
|
25
24
|
"@emotion/react": "^11.9.3",
|
|
26
|
-
"@hero-design/rn": "^8.
|
|
25
|
+
"@hero-design/rn": "^8.112.0",
|
|
27
26
|
"hero-editor": "^1.17.0"
|
|
28
27
|
},
|
|
29
28
|
"peerDependencies": {
|
|
30
|
-
"@hero-design/react-native-month-year-picker": "^8.43.
|
|
29
|
+
"@hero-design/react-native-month-year-picker": "^8.43.2",
|
|
31
30
|
"@ptomasroos/react-native-multi-slider": "^2.2.2",
|
|
32
31
|
"@react-native-community/datetimepicker": "^3.5.2 || ^7.6.1",
|
|
33
32
|
"@react-native-community/slider": "^4.5.1",
|
|
@@ -53,8 +52,8 @@
|
|
|
53
52
|
"@eslint/compat": "^1.1.1",
|
|
54
53
|
"@eslint/eslintrc": "^3.1.0",
|
|
55
54
|
"@eslint/js": "^9.8.0",
|
|
56
|
-
"@hero-design/eslint-plugin": "9.2.
|
|
57
|
-
"@hero-design/react-native-month-year-picker": "^8.43.
|
|
55
|
+
"@hero-design/eslint-plugin": "9.2.1",
|
|
56
|
+
"@hero-design/react-native-month-year-picker": "^8.43.2",
|
|
58
57
|
"@ptomasroos/react-native-multi-slider": "^2.2.2",
|
|
59
58
|
"@react-native-community/cli": "15.0.1",
|
|
60
59
|
"@react-native-community/cli-platform-android": "15.0.1",
|
|
@@ -328,7 +328,7 @@ exports[`DatePicker renders correctly (snapshot) 1`] = `
|
|
|
328
328
|
themeIntent="text"
|
|
329
329
|
themeSize="medium"
|
|
330
330
|
>
|
|
331
|
-
|
|
331
|
+
|
|
332
332
|
</Text>
|
|
333
333
|
</View>
|
|
334
334
|
</Pressable>
|
|
@@ -522,7 +522,7 @@ exports[`DatePicker renders correctly (snapshot) 1`] = `
|
|
|
522
522
|
themeIntent="text"
|
|
523
523
|
themeSize="xsmall"
|
|
524
524
|
>
|
|
525
|
-
|
|
525
|
+
|
|
526
526
|
</Text>
|
|
527
527
|
</TouchableOpacity>
|
|
528
528
|
</View>
|
|
@@ -984,7 +984,7 @@ exports[`Dialog renders DatePickerAndroid when OS is android 1`] = `
|
|
|
984
984
|
themeIntent="text"
|
|
985
985
|
themeSize="medium"
|
|
986
986
|
>
|
|
987
|
-
|
|
987
|
+
|
|
988
988
|
</Text>
|
|
989
989
|
</View>
|
|
990
990
|
</Pressable>
|
|
@@ -1320,7 +1320,7 @@ exports[`Dialog renders DatePickerIOS when OS is iOS 1`] = `
|
|
|
1320
1320
|
themeIntent="text"
|
|
1321
1321
|
themeSize="medium"
|
|
1322
1322
|
>
|
|
1323
|
-
|
|
1323
|
+
|
|
1324
1324
|
</Text>
|
|
1325
1325
|
</View>
|
|
1326
1326
|
</Pressable>
|
|
@@ -1514,7 +1514,7 @@ exports[`Dialog renders DatePickerIOS when OS is iOS 1`] = `
|
|
|
1514
1514
|
themeIntent="text"
|
|
1515
1515
|
themeSize="xsmall"
|
|
1516
1516
|
>
|
|
1517
|
-
|
|
1517
|
+
|
|
1518
1518
|
</Text>
|
|
1519
1519
|
</TouchableOpacity>
|
|
1520
1520
|
</View>
|
|
@@ -332,7 +332,7 @@ exports[`MultiSelect renders correctly (snapshot) 1`] = `
|
|
|
332
332
|
themeIntent="text"
|
|
333
333
|
themeSize="medium"
|
|
334
334
|
>
|
|
335
|
-
|
|
335
|
+
|
|
336
336
|
</Text>
|
|
337
337
|
</View>
|
|
338
338
|
</Pressable>
|
|
@@ -530,7 +530,7 @@ exports[`MultiSelect renders correctly (snapshot) 1`] = `
|
|
|
530
530
|
themeIntent="text"
|
|
531
531
|
themeSize="xsmall"
|
|
532
532
|
>
|
|
533
|
-
|
|
533
|
+
|
|
534
534
|
</Text>
|
|
535
535
|
</TouchableOpacity>
|
|
536
536
|
</View>
|
|
@@ -1035,7 +1035,7 @@ exports[`Select renders correctly (snapshot) 1`] = `
|
|
|
1035
1035
|
themeIntent="text"
|
|
1036
1036
|
themeSize="medium"
|
|
1037
1037
|
>
|
|
1038
|
-
|
|
1038
|
+
|
|
1039
1039
|
</Text>
|
|
1040
1040
|
</View>
|
|
1041
1041
|
</Pressable>
|
|
@@ -1233,7 +1233,7 @@ exports[`Select renders correctly (snapshot) 1`] = `
|
|
|
1233
1233
|
themeIntent="text"
|
|
1234
1234
|
themeSize="xsmall"
|
|
1235
1235
|
>
|
|
1236
|
-
|
|
1236
|
+
|
|
1237
1237
|
</Text>
|
|
1238
1238
|
</TouchableOpacity>
|
|
1239
1239
|
</View>
|
|
@@ -212,7 +212,7 @@ exports[`TextInput when user applies custom styling should respect user-provided
|
|
|
212
212
|
themeIntent="text"
|
|
213
213
|
themeSize="xsmall"
|
|
214
214
|
>
|
|
215
|
-
|
|
215
|
+
|
|
216
216
|
</Text>
|
|
217
217
|
</View>
|
|
218
218
|
</View>
|
|
@@ -1162,7 +1162,7 @@ exports[`TextInput when user encounters a read-only field should display content
|
|
|
1162
1162
|
themeIntent="text"
|
|
1163
1163
|
themeSize="xsmall"
|
|
1164
1164
|
>
|
|
1165
|
-
|
|
1165
|
+
|
|
1166
1166
|
</Text>
|
|
1167
1167
|
</View>
|
|
1168
1168
|
</View>
|
|
@@ -1278,7 +1278,7 @@ exports[`TextInput when user encounters a read-only field should display content
|
|
|
1278
1278
|
themeIntent="text"
|
|
1279
1279
|
themeSize="medium"
|
|
1280
1280
|
>
|
|
1281
|
-
|
|
1281
|
+
|
|
1282
1282
|
</Text>
|
|
1283
1283
|
</View>
|
|
1284
1284
|
</Pressable>
|
|
@@ -1526,7 +1526,7 @@ exports[`TextInput when user has entered text should show the input content and
|
|
|
1526
1526
|
themeIntent="text"
|
|
1527
1527
|
themeSize="xsmall"
|
|
1528
1528
|
>
|
|
1529
|
-
|
|
1529
|
+
|
|
1530
1530
|
</Text>
|
|
1531
1531
|
</View>
|
|
1532
1532
|
</View>
|
|
@@ -1642,7 +1642,7 @@ exports[`TextInput when user has entered text should show the input content and
|
|
|
1642
1642
|
themeIntent="text"
|
|
1643
1643
|
themeSize="medium"
|
|
1644
1644
|
>
|
|
1645
|
-
|
|
1645
|
+
|
|
1646
1646
|
</Text>
|
|
1647
1647
|
</View>
|
|
1648
1648
|
</Pressable>
|
|
@@ -1860,7 +1860,7 @@ exports[`TextInput when user interacts with placeholder text starting from empty
|
|
|
1860
1860
|
themeIntent="text"
|
|
1861
1861
|
themeSize="xsmall"
|
|
1862
1862
|
>
|
|
1863
|
-
|
|
1863
|
+
|
|
1864
1864
|
</Text>
|
|
1865
1865
|
</View>
|
|
1866
1866
|
</View>
|
|
@@ -2461,7 +2461,7 @@ exports[`TextInput when user provides default values starting with pre-filled co
|
|
|
2461
2461
|
themeIntent="text"
|
|
2462
2462
|
themeSize="xsmall"
|
|
2463
2463
|
>
|
|
2464
|
-
|
|
2464
|
+
|
|
2465
2465
|
</Text>
|
|
2466
2466
|
</View>
|
|
2467
2467
|
</View>
|
|
@@ -2819,7 +2819,7 @@ exports[`TextInput when user provides default values when both default and contr
|
|
|
2819
2819
|
themeIntent="text"
|
|
2820
2820
|
themeSize="xsmall"
|
|
2821
2821
|
>
|
|
2822
|
-
|
|
2822
|
+
|
|
2823
2823
|
</Text>
|
|
2824
2824
|
</View>
|
|
2825
2825
|
</View>
|
|
@@ -3208,7 +3208,7 @@ exports[`TextInput when user sees a loading state should show loading indicator
|
|
|
3208
3208
|
themeIntent="text"
|
|
3209
3209
|
themeSize="xsmall"
|
|
3210
3210
|
>
|
|
3211
|
-
|
|
3211
|
+
|
|
3212
3212
|
</Text>
|
|
3213
3213
|
</View>
|
|
3214
3214
|
</View>
|
|
@@ -3342,7 +3342,7 @@ exports[`TextInput when user sees a loading state should show loading indicator
|
|
|
3342
3342
|
themeIntent="text"
|
|
3343
3343
|
themeSize="medium"
|
|
3344
3344
|
>
|
|
3345
|
-
|
|
3345
|
+
|
|
3346
3346
|
</Text>
|
|
3347
3347
|
</AnimatedView>
|
|
3348
3348
|
</View>
|
|
@@ -3561,7 +3561,7 @@ exports[`TextInput when user sees a required field should indicate the field is
|
|
|
3561
3561
|
themeIntent="text"
|
|
3562
3562
|
themeSize="xsmall"
|
|
3563
3563
|
>
|
|
3564
|
-
|
|
3564
|
+
|
|
3565
3565
|
</Text>
|
|
3566
3566
|
</View>
|
|
3567
3567
|
</View>
|
|
@@ -3676,7 +3676,7 @@ exports[`TextInput when user sees a required field should indicate the field is
|
|
|
3676
3676
|
themeIntent="text"
|
|
3677
3677
|
themeSize="medium"
|
|
3678
3678
|
>
|
|
3679
|
-
|
|
3679
|
+
|
|
3680
3680
|
</Text>
|
|
3681
3681
|
</View>
|
|
3682
3682
|
</Pressable>
|
|
@@ -3924,7 +3924,7 @@ exports[`TextInput when user sees a textarea with character count should display
|
|
|
3924
3924
|
themeIntent="text"
|
|
3925
3925
|
themeSize="xsmall"
|
|
3926
3926
|
>
|
|
3927
|
-
|
|
3927
|
+
|
|
3928
3928
|
</Text>
|
|
3929
3929
|
</View>
|
|
3930
3930
|
</View>
|
|
@@ -4078,7 +4078,7 @@ exports[`TextInput when user sees a textarea with character count should display
|
|
|
4078
4078
|
themeIntent="text"
|
|
4079
4079
|
themeSize="medium"
|
|
4080
4080
|
>
|
|
4081
|
-
|
|
4081
|
+
|
|
4082
4082
|
</Text>
|
|
4083
4083
|
</View>
|
|
4084
4084
|
</Pressable>
|
|
@@ -4326,7 +4326,7 @@ exports[`TextInput when user sees a textarea with character count should hide ch
|
|
|
4326
4326
|
themeIntent="text"
|
|
4327
4327
|
themeSize="xsmall"
|
|
4328
4328
|
>
|
|
4329
|
-
|
|
4329
|
+
|
|
4330
4330
|
</Text>
|
|
4331
4331
|
</View>
|
|
4332
4332
|
</View>
|
|
@@ -4444,7 +4444,7 @@ exports[`TextInput when user sees a textarea with character count should hide ch
|
|
|
4444
4444
|
themeIntent="text"
|
|
4445
4445
|
themeSize="medium"
|
|
4446
4446
|
>
|
|
4447
|
-
|
|
4447
|
+
|
|
4448
4448
|
</Text>
|
|
4449
4449
|
</View>
|
|
4450
4450
|
</Pressable>
|
|
@@ -4694,7 +4694,7 @@ exports[`TextInput when user sees an empty input field should display label and
|
|
|
4694
4694
|
themeIntent="text"
|
|
4695
4695
|
themeSize="xsmall"
|
|
4696
4696
|
>
|
|
4697
|
-
|
|
4697
|
+
|
|
4698
4698
|
</Text>
|
|
4699
4699
|
</View>
|
|
4700
4700
|
</View>
|
|
@@ -4809,7 +4809,7 @@ exports[`TextInput when user sees an empty input field should display label and
|
|
|
4809
4809
|
themeIntent="text"
|
|
4810
4810
|
themeSize="medium"
|
|
4811
4811
|
>
|
|
4812
|
-
|
|
4812
|
+
|
|
4813
4813
|
</Text>
|
|
4814
4814
|
</View>
|
|
4815
4815
|
</Pressable>
|
|
@@ -5027,7 +5027,7 @@ exports[`TextInput when user sees an error state should display error message to
|
|
|
5027
5027
|
themeIntent="text"
|
|
5028
5028
|
themeSize="xsmall"
|
|
5029
5029
|
>
|
|
5030
|
-
|
|
5030
|
+
|
|
5031
5031
|
</Text>
|
|
5032
5032
|
</View>
|
|
5033
5033
|
</View>
|
|
@@ -5406,7 +5406,7 @@ exports[`TextInput when user sees helper text should display guidance text to as
|
|
|
5406
5406
|
themeIntent="text"
|
|
5407
5407
|
themeSize="xsmall"
|
|
5408
5408
|
>
|
|
5409
|
-
|
|
5409
|
+
|
|
5410
5410
|
</Text>
|
|
5411
5411
|
</View>
|
|
5412
5412
|
</View>
|
package/.cursorrules
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# RN Work UIKit Specific Rules
|
|
2
|
-
|
|
3
|
-
## Package Context
|
|
4
|
-
This is the work-specific React Native component library that extends @hero-design/rn with work-focused components like TextInput, specialized themes, and work-specific patterns.
|
|
5
|
-
|
|
6
|
-
## Testing Rules for RN Work UIKit
|
|
7
|
-
- Write user-behavior focused tests that describe what users see and experience
|
|
8
|
-
- Use descriptive test names like "when user sees an empty input field" instead of "idle state"
|
|
9
|
-
- Group related assertions with explanatory comments about user expectations
|
|
10
|
-
- Focus on user interactions and outcomes rather than implementation details
|
|
11
|
-
- Use `@testing-library/react-native` for all component testing
|
|
12
|
-
- Use `renderWithTheme()` from `../../../../testUtils/renderWithTheme` for components that need theme context
|
|
13
|
-
- Use semantic matchers like `toBeDisabled()`, `toHaveProp()` when available
|
|
14
|
-
- For complex React Native styles, use manual checking when `toHaveStyle()` doesn't work
|
|
15
|
-
- Handle React Native's nested style arrays with `StyleSheet.flatten()` or custom helpers
|
|
16
|
-
- Aim for 100% line coverage on main component files
|
|
17
|
-
- Create dedicated test files for each component (not just integration tests)
|
|
18
|
-
- Test edge cases: undefined props, complex styles, error states
|
|
19
|
-
- Test imperative APIs: ref methods, focus/blur behavior
|
|
20
|
-
- Test accessibility: screen reader support, keyboard navigation
|
|
21
|
-
|
|
22
|
-
## Component Development Rules
|
|
23
|
-
- Import `styled` from `@hero-design/rn` for consistency with base theme
|
|
24
|
-
- Use `useTheme()` hook instead of prop drilling theme
|
|
25
|
-
- Extend base components from `@hero-design/rn` when possible
|
|
26
|
-
- Follow work-specific design patterns and accessibility requirements
|
|
27
|
-
- Use TypeScript strictly - no `any` types without good reason
|
|
28
|
-
- Fix linting errors immediately
|
|
29
|
-
- Use proper React Native components (`Text`, `View`) instead of HTML elements
|
|
30
|
-
|
|
31
|
-
## Documentation Rules
|
|
32
|
-
- Document Props interfaces with JSDoc comments directly on each property: `/** Description */`
|
|
33
|
-
- Use simplified @param comments: `@param props - The component props (see [ComponentName]Props interface for details)`
|
|
34
|
-
- Avoid mentioning implementation details like "memoized component" in JSDoc comments
|
|
35
|
-
- Focus JSDoc comments on what the component does, not how it's implemented
|
|
36
|
-
- Keep type information in the Props interface, not duplicated in @param comments
|
|
37
|
-
|
|
38
|
-
## File Organization
|
|
39
|
-
- Separate large test files by component responsibility
|
|
40
|
-
- Use consistent naming: `ComponentName.spec.tsx`
|
|
41
|
-
- Keep test utilities in `testUtils/` directory at package root
|
|
42
|
-
- Use snapshot testing for visual regression prevention
|
|
43
|
-
- Create README.md files in test directories explaining testing approach
|
|
44
|
-
|
|
45
|
-
## Work-Specific Patterns
|
|
46
|
-
- Components should work with work theme overrides
|
|
47
|
-
- Test with work-specific color palettes and spacing
|
|
48
|
-
- Ensure compatibility with work app requirements
|
|
49
|
-
- Follow work accessibility guidelines
|
|
50
|
-
- Test performance with work-typical data sizes
|
|
51
|
-
|
|
52
|
-
## Quality Gates
|
|
53
|
-
- All tests must pass with 100% coverage on main components
|
|
54
|
-
- No linting errors
|
|
55
|
-
- No TypeScript errors
|
|
56
|
-
- Components must work with both base and work themes
|
|
57
|
-
- Accessibility compliance for work environment
|
package/src/utils/hooks.ts
DELETED