@hero-design/rn 8.5.0-alpha.0 → 8.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.
- package/.turbo/turbo-build.log +9 -66
- package/.turbo/turbo-publish:npm.log +0 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +641 -719
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +641 -718
- package/package.json +7 -5
- package/rollup.config.js +1 -0
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +1 -0
- package/src/components/Swipeable/StyledSwipeable.tsx +2 -14
- package/src/components/Swipeable/SwipeableAction.tsx +7 -15
- package/src/components/Swipeable/index.tsx +136 -531
- package/src/components/SwipeableV2/StyledSwipeable.tsx +14 -0
- package/src/components/SwipeableV2/__tests__/__snapshots__/index.spec.tsx.snap +161 -0
- package/src/components/SwipeableV2/__tests__/index.spec.tsx +48 -0
- package/src/components/SwipeableV2/index.tsx +364 -0
- package/src/index.ts +2 -0
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/Select/BaseOptionList.d.ts +4 -8
- package/types/components/Select/MultiSelect/OptionList.d.ts +4 -7
- package/types/components/Select/SingleSelect/OptionList.d.ts +4 -4
- package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +1 -1
- package/types/components/Swipeable/StyledSwipeable.d.ts +2 -15
- package/types/components/Swipeable/SwipeableAction.d.ts +6 -10
- package/types/components/Swipeable/index.d.ts +41 -24
- package/types/components/SwipeableV2/StyledSwipeable.d.ts +15 -0
- package/types/components/SwipeableV2/index.d.ts +46 -0
- package/types/components/Toolbar/index.d.ts +3 -2
- package/types/index.d.ts +2 -1
- package/src/components/Swipeable/Buttons.tsx +0 -65
- package/types/components/Swipeable/Buttons.d.ts +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/native": "^11.9.3",
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "8.
|
|
24
|
+
"@hero-design/colors": "8.6.0",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.21"
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"@react-native-community/slider": "4.1.12",
|
|
32
32
|
"react": "18.0.0",
|
|
33
33
|
"react-native": "0.69.7",
|
|
34
|
+
"react-native-gesture-handler": "^1.10.3 | ~2.1.0",
|
|
34
35
|
"react-native-pager-view": "^5.4.25",
|
|
35
36
|
"react-native-safe-area-context": "^4.2.5",
|
|
36
37
|
"react-native-vector-icons": "^9.1.0",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"@babel/preset-typescript": "^7.17.12",
|
|
44
45
|
"@babel/runtime": "^7.18.9",
|
|
45
46
|
"@emotion/jest": "^11.9.3",
|
|
46
|
-
"@hero-design/eslint-plugin": "8.
|
|
47
|
+
"@hero-design/eslint-plugin": "8.6.0",
|
|
47
48
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
48
49
|
"@react-native-community/slider": "4.1.12",
|
|
49
50
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -59,11 +60,12 @@
|
|
|
59
60
|
"@types/react-native": "^0.67.7",
|
|
60
61
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
61
62
|
"babel-plugin-inline-import": "^3.0.0",
|
|
62
|
-
"eslint-config-hd": "8.
|
|
63
|
+
"eslint-config-hd": "8.6.0",
|
|
63
64
|
"jest": "^27.3.1",
|
|
64
|
-
"prettier-config-hd": "8.
|
|
65
|
+
"prettier-config-hd": "8.6.0",
|
|
65
66
|
"react": "18.0.0",
|
|
66
67
|
"react-native": "0.69.7",
|
|
68
|
+
"react-native-gesture-handler": "~2.1.0",
|
|
67
69
|
"react-native-pager-view": "^5.4.25",
|
|
68
70
|
"react-native-safe-area-context": "^4.2.5",
|
|
69
71
|
"react-native-vector-icons": "^9.1.0",
|
package/rollup.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"activate":59000,"add-emoji":59001,"add-person":59002,"adjustment":59003,"alignment":59004,"antenna":59005,"archive":59006,"assignment-warning":59007,"bank":59008,"bell":59009,"billing":59010,"bookmark-added":59011,"bookmark":59012,"box-check":59013,"box":59014,"buildings":59015,"cake":59016,"calendar-clock":59017,"calendar":59018,"candy-box-menu":59019,"caret-down-small":59020,"caret-down":59021,"caret-left-small":59022,"caret-left":59023,"caret-right-small":59024,"caret-right":59025,"caret-up-small":59026,"caret-up":59027,"check-radio":59028,"circle-add":59029,"circle-cancel":59030,"circle-check":59031,"circle-down":59032,"circle-info":59033,"circle-left":59034,"circle-ok":59035,"circle-pencil":59036,"circle-question":59037,"circle-remove":59038,"circle-right":59039,"circle-up":59040,"circle-warning":59041,"clock-3":59042,"clock":59043,"cloud-download":59044,"cloud-upload":59045,"cog":59046,"coin":59047,"contacts":59048,"credit-card":59049,"diamond":59050,"direction-arrows":59051,"directory":59052,"document":59053,"dollar-coin-shine":59054,"double-buildings":59055,"edit-template":59056,"envelope":59057,"expense":59058,"eye-circle":59059,"eye-invisible":59060,"eye":59061,"face-meh":59062,"face-sad":59063,"face-smiley":59064,"feed":59065,"feedbacks":59066,"file-certified":59067,"file-clone":59068,"file-copy":59069,"file-csv":59070,"file-dispose":59071,"file-doc":59072,"file-excel":59073,"file-export":59074,"file-lock":59075,"file-pdf":59076,"file-powerpoint":59077,"file-search":59078,"file-secured":59079,"file-sheets":59080,"file-slide":59081,"file-verified":59082,"file-word":59083,"file":59084,"filter":59085,"folder-user":59086,"folder":59087,"format-bold":59088,"format-heading1":59089,"format-heading2":59090,"format-italic":59091,"format-list-bulleted":59092,"format-list-numbered":59093,"format-underlined":59094,"funnel-filter":59095,"global-dollar":59096,"globe":59097,"graduation-cap":59098,"graph":59099,"happy-sun":59100,"health-bag":59101,"heart":59102,"home":59103,"image":59104,"import":59105,"incident-siren":59106,"instapay":59107,"list":59108,"loading-2":59109,"loading":59110,"location":59111,"lock":59112,"looks-one":59113,"looks-two":59114,"media-content":59115,"menu":59116,"money-notes":59117,"moneybag":59118,"moon":59119,"multiple-stars":59120,"multiple-users":59121,"node":59122,"open-folder":59123,"paperclip":59124,"payment-summary":59125,"pencil":59126,"phone":59127,"piggy-bank":59128,"plane":59129,"play-circle":59130,"print":59131,"raising-hands":59132,"reply-arrow":59133,"reply":59134,"reschedule":59135,"rostering":59136,"save":59137,"schedule-send":59138,"schedule":59139,"search-person":59140,"send":59141,"speaker-active":59142,"speaker":59143,"star-award":59144,"star-badge":59145,"star-circle":59146,"star-medal":59147,"star":59148,"steps-circle":59149,"stopwatch":59150,"suitcase":59151,"survey":59152,"swag":59153,"switch":59154,"tag":59155,"target":59156,"teams":59157,"timesheet":59158,"touch-id":59159,"trash-bin":59160,"unlock":59161,"user":59162,"video-1":59163,"video-2":59164,"wallet":59165,"warning":59166,"activate-outlined":59167,"add-credit-card-outlined":59168,"add-person-outlined":59169,"add-section-outlined":59170,"add-time-outlined":59171,"add":59172,"adjustment-outlined":59173,"alignment-2-outlined":59174,"alignment-outlined":59175,"all-caps":59176,"arrow-down":59177,"arrow-downwards":59178,"arrow-left":59179,"arrow-leftwards":59180,"arrow-right":59181,"arrow-rightwards":59182,"arrow-up":59183,"arrow-upwards":59184,"article-outlined":59185,"at-sign":59186,"auto-graph-outlined":59187,"bell-active-outlined":59188,"bell-outlined":59189,"bell-slash-outlined":59190,"billing-outlined":59191,"body-outlined":59192,"bold":59193,"bookmark-added-outlined":59194,"bookmark-outlined":59195,"box-check-outlined":59196,"box-outlined":59197,"bullet-points":59198,"cake-outlined":59199,"calendar-dates-outlined":59200,"calendar-star-outlined":59201,"camera-outlined":59202,"cancel":59203,"chat-bubble-outlined":59204,"chat-unread-outlined":59205,"checkmark":59206,"circle-add-outlined":59207,"circle-cancel-outlined":59208,"circle-down-outlined":59209,"circle-info-outlined":59210,"circle-left-outlined":59211,"circle-ok-outlined":59212,"circle-question-outlined":59213,"circle-remove-outlined":59214,"circle-right-outlined":59215,"circle-up-outlined":59216,"circle-warning-outlined":59217,"clock-2-outlined":59218,"clock-outlined":59219,"cog-outlined":59220,"coin-outlined":59221,"comment-outlined":59222,"contacts-outlined":59223,"credit-card-outlined":59224,"cup-outlined":59225,"direction-arrows-outlined":59226,"directory-outlined":59227,"document-outlined":59228,"dollar-card-outlined":59229,"dollar-coin-shine-outlined":59230,"dollar-
|
|
1
|
+
{"activate":59000,"add-emoji":59001,"add-person":59002,"adjustment":59003,"alignment":59004,"antenna":59005,"archive":59006,"assignment-warning":59007,"bank":59008,"bell":59009,"billing":59010,"bookmark-added":59011,"bookmark":59012,"box-check":59013,"box":59014,"buildings":59015,"cake":59016,"calendar-clock":59017,"calendar":59018,"candy-box-menu":59019,"caret-down-small":59020,"caret-down":59021,"caret-left-small":59022,"caret-left":59023,"caret-right-small":59024,"caret-right":59025,"caret-up-small":59026,"caret-up":59027,"check-radio":59028,"circle-add":59029,"circle-cancel":59030,"circle-check":59031,"circle-down":59032,"circle-info":59033,"circle-left":59034,"circle-ok":59035,"circle-pencil":59036,"circle-question":59037,"circle-remove":59038,"circle-right":59039,"circle-up":59040,"circle-warning":59041,"clock-3":59042,"clock":59043,"cloud-download":59044,"cloud-upload":59045,"cog":59046,"coin":59047,"contacts":59048,"credit-card":59049,"diamond":59050,"direction-arrows":59051,"directory":59052,"document":59053,"dollar-coin-shine":59054,"double-buildings":59055,"edit-template":59056,"envelope":59057,"expense":59058,"eye-circle":59059,"eye-invisible":59060,"eye":59061,"face-meh":59062,"face-sad":59063,"face-smiley":59064,"feed":59065,"feedbacks":59066,"file-certified":59067,"file-clone":59068,"file-copy":59069,"file-csv":59070,"file-dispose":59071,"file-doc":59072,"file-excel":59073,"file-export":59074,"file-lock":59075,"file-pdf":59076,"file-powerpoint":59077,"file-search":59078,"file-secured":59079,"file-sheets":59080,"file-slide":59081,"file-verified":59082,"file-word":59083,"file":59084,"filter":59085,"folder-user":59086,"folder":59087,"format-bold":59088,"format-heading1":59089,"format-heading2":59090,"format-italic":59091,"format-list-bulleted":59092,"format-list-numbered":59093,"format-underlined":59094,"funnel-filter":59095,"global-dollar":59096,"globe":59097,"graduation-cap":59098,"graph":59099,"happy-sun":59100,"health-bag":59101,"heart":59102,"home":59103,"image":59104,"import":59105,"incident-siren":59106,"instapay":59107,"list":59108,"loading-2":59109,"loading":59110,"location":59111,"lock":59112,"looks-one":59113,"looks-two":59114,"media-content":59115,"menu":59116,"money-notes":59117,"moneybag":59118,"moon":59119,"multiple-stars":59120,"multiple-users":59121,"node":59122,"open-folder":59123,"paperclip":59124,"payment-summary":59125,"pencil":59126,"phone":59127,"piggy-bank":59128,"plane":59129,"play-circle":59130,"print":59131,"raising-hands":59132,"reply-arrow":59133,"reply":59134,"reschedule":59135,"rostering":59136,"save":59137,"schedule-send":59138,"schedule":59139,"search-person":59140,"send":59141,"speaker-active":59142,"speaker":59143,"star-award":59144,"star-badge":59145,"star-circle":59146,"star-medal":59147,"star":59148,"steps-circle":59149,"stopwatch":59150,"suitcase":59151,"survey":59152,"swag":59153,"switch":59154,"tag":59155,"target":59156,"teams":59157,"timesheet":59158,"touch-id":59159,"trash-bin":59160,"unlock":59161,"user":59162,"video-1":59163,"video-2":59164,"wallet":59165,"warning":59166,"activate-outlined":59167,"add-credit-card-outlined":59168,"add-person-outlined":59169,"add-section-outlined":59170,"add-time-outlined":59171,"add":59172,"adjustment-outlined":59173,"alignment-2-outlined":59174,"alignment-outlined":59175,"all-caps":59176,"arrow-down":59177,"arrow-downwards":59178,"arrow-left":59179,"arrow-leftwards":59180,"arrow-right":59181,"arrow-rightwards":59182,"arrow-up":59183,"arrow-upwards":59184,"article-outlined":59185,"at-sign":59186,"auto-graph-outlined":59187,"bell-active-outlined":59188,"bell-outlined":59189,"bell-slash-outlined":59190,"billing-outlined":59191,"body-outlined":59192,"bold":59193,"bookmark-added-outlined":59194,"bookmark-outlined":59195,"box-check-outlined":59196,"box-outlined":59197,"bullet-points":59198,"cake-outlined":59199,"calendar-dates-outlined":59200,"calendar-star-outlined":59201,"camera-outlined":59202,"cancel":59203,"chat-bubble-outlined":59204,"chat-unread-outlined":59205,"checkmark":59206,"circle-add-outlined":59207,"circle-cancel-outlined":59208,"circle-down-outlined":59209,"circle-info-outlined":59210,"circle-left-outlined":59211,"circle-ok-outlined":59212,"circle-question-outlined":59213,"circle-remove-outlined":59214,"circle-right-outlined":59215,"circle-up-outlined":59216,"circle-warning-outlined":59217,"clock-2-outlined":59218,"clock-outlined":59219,"cog-outlined":59220,"coin-outlined":59221,"comment-outlined":59222,"contacts-outlined":59223,"credit-card-outlined":59224,"cup-outlined":59225,"direction-arrows-outlined":59226,"directory-outlined":59227,"document-outlined":59228,"dollar-card-outlined":59229,"dollar-coin-shine-outlined":59230,"dollar-credit-card-outlined":59231,"dollar-sign":59232,"double-buildings-outlined":59233,"double-left-arrows":59234,"double-right-arrows":59235,"download-outlined":59236,"edit-template-outlined":59237,"email-outlined":59238,"enter-arrow":59239,"envelope-outlined":59240,"expense-outlined":59241,"explore-outlined":59242,"external-link":59243,"eye-invisible-outlined":59244,"eye-outlined":59245,"face-id":59246,"face-meh-outlined":59247,"face-open-smiley-outlined":59248,"face-sad-outlined":59249,"face-smiley-outlined":59250,"feed-outlined":59251,"file-certified-outlined":59252,"file-clone-outlined":59253,"file-copy-outlined":59254,"file-dispose-outlined":59255,"file-dollar-outlined":59256,"file-download-outlined":59257,"file-export-outlined":59258,"file-lock-outlined":59259,"file-outlined":59260,"file-search-outlined":59261,"file-secured-outlined":59262,"file-statutory-outlined":59263,"file-verified-outlined":59264,"filter-outlined":59265,"folder-outlined":59266,"folder-user-outlined":59267,"funnel-filter-outline":59268,"graph-outlined":59269,"hand-holding-user-outlined":59270,"happy-sun-outlined":59271,"health-bag-outlined":59272,"heart-outlined":59273,"home-active-outlined":59274,"home-outlined":59275,"id-card-outlined":59276,"image-outlined":59277,"import-outlined":59278,"instapay-outlined":59279,"italic":59280,"link-1":59281,"link-2":59282,"list-outlined":59283,"live-help-outlined":59284,"location-outlined":59285,"lock-outlined":59286,"locked-file-outlined":59287,"log-out":59288,"media-content-outlined":59289,"menu-close":59290,"menu-expand":59291,"menu-fold-outlined":59292,"menu-unfold-outlined":59293,"moneybag-outlined":59294,"moon-outlined":59295,"more-horizontal":59296,"more-vertical":59297,"multiple-folders-outlined":59298,"multiple-users-outlined":59299,"near-me-outlined":59300,"node-outlined":59301,"number-points":59302,"number":59303,"overview-outlined":59304,"payment-summary-outlined":59305,"payslip-outlined":59306,"pencil-outlined":59307,"percentage":59308,"phone-outlined":59309,"piggy-bank-outlined":59310,"plane-outlined":59311,"play-circle-outlined":59312,"print-outlined":59313,"qr-code-outlined":59314,"qualification-outlined":59315,"re-assign":59316,"redeem":59317,"refresh":59318,"remove":59319,"reply-outlined":59320,"restart":59321,"return-arrow":59322,"rostering-outlined":59323,"save-outlined":59324,"schedule-outlined":59325,"search-outlined":59326,"search-secured-outlined":59327,"send-outlined":59328,"share-1":59329,"share-2":59330,"share-outlined":59331,"show-chart-outlined":59332,"single-down-arrow":59333,"single-left-arrow":59334,"single-right-arrow":59335,"single-up-arrow":59336,"speaker-active-outlined":59337,"speaker-outlined":59338,"star-circle-outlined":59339,"star-outlined":59340,"stopwatch-outlined":59341,"strikethrough":59342,"suitcase-clock-outlined":59343,"suitcase-outlined":59344,"survey-outlined":59345,"switch-outlined":59346,"sync":59347,"target-outlined":59348,"timesheet-outlined":59349,"today-outlined":59350,"transfer":59351,"trash-bin-outlined":59352,"umbrela-outlined":59353,"unavailable":59354,"underline":59355,"unlock-outlined":59356,"upload-outlined":59357,"user-circle-outlined":59358,"user-gear-outlined":59359,"user-outlined":59360,"user-rectangle-outlined":59361,"video-1-outlined":59362,"video-2-outlined":59363,"wallet-outlined":59364}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableOpacity } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export type ActionIntent = 'primary' | 'success' | 'danger';
|
|
5
5
|
|
|
6
|
-
const StyledRectButton = styled(TouchableOpacity)<{
|
|
6
|
+
export const StyledRectButton = styled(TouchableOpacity)<{
|
|
7
7
|
themeIntent: ActionIntent;
|
|
8
8
|
}>(({ theme, themeIntent }) => ({
|
|
9
9
|
flex: 1,
|
|
10
10
|
backgroundColor: theme.__hd__.swipeable.colors[themeIntent],
|
|
11
|
-
alignItems: 'center',
|
|
12
|
-
justifyContent: 'center',
|
|
13
11
|
}));
|
|
14
|
-
|
|
15
|
-
const StyledWrapper = styled(View)<{}>(() => ({
|
|
16
|
-
flexDirection: 'row',
|
|
17
|
-
}));
|
|
18
|
-
|
|
19
|
-
const StyledContent = styled(Animated.View)<{}>(() => ({
|
|
20
|
-
flex: 1,
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
export { StyledRectButton, StyledWrapper, StyledContent };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import Icon, { IconName } from '../Icon';
|
|
4
|
-
import Typography from '../Typography';
|
|
5
3
|
import { ActionIntent, StyledRectButton } from './StyledSwipeable';
|
|
6
4
|
|
|
7
5
|
export interface SwipeableActionProps {
|
|
@@ -13,6 +11,10 @@ export interface SwipeableActionProps {
|
|
|
13
11
|
* Callback when the action button is pressed.
|
|
14
12
|
*/
|
|
15
13
|
onPress?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Action button's content
|
|
16
|
+
*/
|
|
17
|
+
children?: ReactNode;
|
|
16
18
|
/**
|
|
17
19
|
* Additional style.
|
|
18
20
|
*/
|
|
@@ -21,23 +23,14 @@ export interface SwipeableActionProps {
|
|
|
21
23
|
* Testing id of the component.
|
|
22
24
|
*/
|
|
23
25
|
testID?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Name of the Icon.
|
|
26
|
-
*/
|
|
27
|
-
icon: IconName;
|
|
28
|
-
/**
|
|
29
|
-
* Action label of the component.
|
|
30
|
-
*/
|
|
31
|
-
label: string;
|
|
32
26
|
}
|
|
33
27
|
|
|
34
28
|
const SwipeableAction = ({
|
|
35
29
|
intent = 'primary',
|
|
36
30
|
onPress,
|
|
37
31
|
style,
|
|
32
|
+
children,
|
|
38
33
|
testID,
|
|
39
|
-
label,
|
|
40
|
-
icon,
|
|
41
34
|
}: SwipeableActionProps) => (
|
|
42
35
|
<StyledRectButton
|
|
43
36
|
onPress={onPress}
|
|
@@ -45,8 +38,7 @@ const SwipeableAction = ({
|
|
|
45
38
|
style={style}
|
|
46
39
|
testID={testID}
|
|
47
40
|
>
|
|
48
|
-
|
|
49
|
-
<Typography.Text fontSize="small">{label}</Typography.Text>
|
|
41
|
+
{children}
|
|
50
42
|
</StyledRectButton>
|
|
51
43
|
);
|
|
52
44
|
|