@hero-design/rn 8.92.3 → 8.93.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 +2 -2
- package/CHANGELOG.md +10 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +152 -83
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +152 -83
- package/package.json +1 -1
- package/src/components/Badge/Count.tsx +60 -0
- package/src/components/Badge/StyledBadge.tsx +33 -2
- package/src/components/Badge/__tests__/Count.spec.tsx +38 -0
- package/src/components/Badge/__tests__/__snapshots__/Count.spec.tsx.snap +310 -0
- package/src/components/Badge/constants.ts +1 -0
- package/src/components/Badge/index.tsx +3 -2
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +1 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +11 -0
- package/src/theme/components/badge.ts +26 -1
- package/types/components/Badge/Count.d.ts +27 -0
- package/types/components/Badge/StyledBadge.d.ts +14 -4
- package/types/components/Badge/constants.d.ts +1 -0
- package/types/components/Badge/index.d.ts +1 -0
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/TextInput/index.d.ts +1 -1
- package/types/theme/components/badge.d.ts +11 -0
package/lib/index.js
CHANGED
|
@@ -2621,7 +2621,8 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
2621
2621
|
warning: theme.colors.onWarningSurface,
|
|
2622
2622
|
archived: theme.colors.onArchivedSurface,
|
|
2623
2623
|
text: theme.colors.onDarkGlobalSurface,
|
|
2624
|
-
border: theme.colors.defaultGlobalSurface
|
|
2624
|
+
border: theme.colors.defaultGlobalSurface,
|
|
2625
|
+
countText: theme.colors.onDarkGlobalSurface
|
|
2625
2626
|
};
|
|
2626
2627
|
var fonts = {
|
|
2627
2628
|
medium: theme.fonts.neutral.regular,
|
|
@@ -2633,11 +2634,20 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
2633
2634
|
icon: {
|
|
2634
2635
|
medium: theme.fontSizes.small,
|
|
2635
2636
|
small: 8
|
|
2636
|
-
}
|
|
2637
|
+
},
|
|
2638
|
+
count: 6
|
|
2637
2639
|
};
|
|
2638
2640
|
var lineHeights = {
|
|
2639
2641
|
medium: theme.lineHeights.small,
|
|
2640
|
-
small: 10
|
|
2642
|
+
small: 10,
|
|
2643
|
+
count: reactNative.Platform.select({
|
|
2644
|
+
android: 11,
|
|
2645
|
+
// vertical alignment
|
|
2646
|
+
"default": 12
|
|
2647
|
+
})
|
|
2648
|
+
};
|
|
2649
|
+
var radii = {
|
|
2650
|
+
count: theme.radii.rounded
|
|
2641
2651
|
};
|
|
2642
2652
|
var sizes = {
|
|
2643
2653
|
medium: {
|
|
@@ -2649,7 +2659,11 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
2649
2659
|
minWidth: theme.sizes.medium
|
|
2650
2660
|
},
|
|
2651
2661
|
statusHeight: theme.sizes.small,
|
|
2652
|
-
statusWidth: theme.sizes.small
|
|
2662
|
+
statusWidth: theme.sizes.small,
|
|
2663
|
+
count: {
|
|
2664
|
+
width: theme.sizes.smallMedium,
|
|
2665
|
+
height: theme.sizes.smallMedium
|
|
2666
|
+
}
|
|
2653
2667
|
};
|
|
2654
2668
|
var borderWidths = {
|
|
2655
2669
|
"default": theme.borderWidths.medium
|
|
@@ -2662,7 +2676,8 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
2662
2676
|
horizontalPadding: theme.space.xsmall
|
|
2663
2677
|
},
|
|
2664
2678
|
statusPositionTop: -theme.space.xxsmall,
|
|
2665
|
-
statusPositionRight: -theme.space.xxsmall
|
|
2679
|
+
statusPositionRight: -theme.space.xxsmall,
|
|
2680
|
+
countPaddingHorizontal: theme.space.xxsmall
|
|
2666
2681
|
};
|
|
2667
2682
|
return {
|
|
2668
2683
|
colors: colors,
|
|
@@ -2671,7 +2686,8 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
2671
2686
|
sizes: sizes,
|
|
2672
2687
|
space: space,
|
|
2673
2688
|
lineHeights: lineHeights,
|
|
2674
|
-
borderWidths: borderWidths
|
|
2689
|
+
borderWidths: borderWidths,
|
|
2690
|
+
radii: radii
|
|
2675
2691
|
};
|
|
2676
2692
|
};
|
|
2677
2693
|
|
|
@@ -7521,7 +7537,7 @@ var StyledText$3 = index$a(reactNative.Text)(function (_ref) {
|
|
|
7521
7537
|
});
|
|
7522
7538
|
});
|
|
7523
7539
|
|
|
7524
|
-
var _excluded$
|
|
7540
|
+
var _excluded$M = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
|
|
7525
7541
|
var Text = function Text(_ref) {
|
|
7526
7542
|
var children = _ref.children,
|
|
7527
7543
|
_ref$fontSize = _ref.fontSize,
|
|
@@ -7534,7 +7550,7 @@ var Text = function Text(_ref) {
|
|
|
7534
7550
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
7535
7551
|
_ref$allowFontScaling = _ref.allowFontScaling,
|
|
7536
7552
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
7537
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7553
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$M);
|
|
7538
7554
|
useDeprecation('Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.');
|
|
7539
7555
|
return /*#__PURE__*/React__namespace.default.createElement(StyledText$3, _extends$1({}, nativeProps, {
|
|
7540
7556
|
themeFontSize: fontSize,
|
|
@@ -7564,7 +7580,7 @@ var StyledCaption = index$a(reactNative.Text)(function (_ref) {
|
|
|
7564
7580
|
};
|
|
7565
7581
|
});
|
|
7566
7582
|
|
|
7567
|
-
var _excluded$
|
|
7583
|
+
var _excluded$L = ["children", "fontWeight", "intent", "allowFontScaling"];
|
|
7568
7584
|
var Caption = function Caption(_ref) {
|
|
7569
7585
|
var children = _ref.children,
|
|
7570
7586
|
_ref$fontWeight = _ref.fontWeight,
|
|
@@ -7573,7 +7589,7 @@ var Caption = function Caption(_ref) {
|
|
|
7573
7589
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
7574
7590
|
_ref$allowFontScaling = _ref.allowFontScaling,
|
|
7575
7591
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
7576
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7592
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$L);
|
|
7577
7593
|
return /*#__PURE__*/React__namespace.default.createElement(StyledCaption, _extends$1({}, nativeProps, {
|
|
7578
7594
|
themeFontWeight: fontWeight,
|
|
7579
7595
|
themeIntent: intent,
|
|
@@ -7592,14 +7608,14 @@ var StyledLabel$1 = index$a(reactNative.Text)(function (_ref) {
|
|
|
7592
7608
|
};
|
|
7593
7609
|
});
|
|
7594
7610
|
|
|
7595
|
-
var _excluded$
|
|
7611
|
+
var _excluded$K = ["children", "intent", "allowFontScaling"];
|
|
7596
7612
|
var Label = function Label(_ref) {
|
|
7597
7613
|
var children = _ref.children,
|
|
7598
7614
|
_ref$intent = _ref.intent,
|
|
7599
7615
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
7600
7616
|
_ref$allowFontScaling = _ref.allowFontScaling,
|
|
7601
7617
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
7602
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7618
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$K);
|
|
7603
7619
|
return /*#__PURE__*/React__namespace.default.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
|
|
7604
7620
|
themeIntent: intent,
|
|
7605
7621
|
allowFontScaling: allowFontScaling
|
|
@@ -7620,7 +7636,7 @@ var StyledTitle$1 = index$a(reactNative.Text)(function (_ref) {
|
|
|
7620
7636
|
};
|
|
7621
7637
|
});
|
|
7622
7638
|
|
|
7623
|
-
var _excluded$
|
|
7639
|
+
var _excluded$J = ["children", "intent", "allowFontScaling", "level", "typeface"];
|
|
7624
7640
|
var Title = function Title(_ref) {
|
|
7625
7641
|
var children = _ref.children,
|
|
7626
7642
|
_ref$intent = _ref.intent,
|
|
@@ -7631,7 +7647,7 @@ var Title = function Title(_ref) {
|
|
|
7631
7647
|
level = _ref$level === void 0 ? 'h1' : _ref$level,
|
|
7632
7648
|
_ref$typeface = _ref.typeface,
|
|
7633
7649
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
7634
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7650
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$J);
|
|
7635
7651
|
return /*#__PURE__*/React__namespace.default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
|
|
7636
7652
|
themeLevel: level,
|
|
7637
7653
|
themeTypeface: typeface,
|
|
@@ -7666,7 +7682,7 @@ var StyledBody$2 = index$a(reactNative.Text)(function (_ref) {
|
|
|
7666
7682
|
};
|
|
7667
7683
|
});
|
|
7668
7684
|
|
|
7669
|
-
var _excluded$
|
|
7685
|
+
var _excluded$I = ["children", "intent", "allowFontScaling", "typeface", "variant"];
|
|
7670
7686
|
var Body = function Body(_ref) {
|
|
7671
7687
|
var children = _ref.children,
|
|
7672
7688
|
_ref$intent = _ref.intent,
|
|
@@ -7677,7 +7693,7 @@ var Body = function Body(_ref) {
|
|
|
7677
7693
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
7678
7694
|
_ref$variant = _ref.variant,
|
|
7679
7695
|
variant = _ref$variant === void 0 ? 'regular' : _ref$variant,
|
|
7680
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7696
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$I);
|
|
7681
7697
|
return /*#__PURE__*/React__namespace.default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
|
|
7682
7698
|
themeTypeface: typeface,
|
|
7683
7699
|
themeIntent: intent,
|
|
@@ -7695,7 +7711,7 @@ var Typography = {
|
|
|
7695
7711
|
};
|
|
7696
7712
|
|
|
7697
7713
|
// 🔴 DO NOT EDIT — This file is generated automatically.
|
|
7698
|
-
var IconList = ['activate', 'add-emoji', 'add-person', 'adjustment', 'alignment', 'antenna', 'archive', 'assignment-warning', 'bank', 'bell', 'billing', 'bolt', 'bookmark-added', 'bookmark-checked', 'bookmark', 'box-check', 'box', 'bpay', 'buildings', 'cake', 'calendar-clock', 'calendar', 'candy-box-menu', 'caret-down-small', 'caret-down', 'caret-left-small', 'caret-left', 'caret-right-small', 'caret-right', 'caret-up-small', 'caret-up', 'check-radio', 'circle-add', 'circle-cancel', 'circle-check', 'circle-down', 'circle-info', 'circle-left', 'circle-ok', 'circle-pencil', 'circle-question', 'circle-remove', 'circle-right', 'circle-up', 'circle-warning', 'clock-3', 'clock', 'cloud-download', 'cloud-upload', 'cog', 'coin', 'contacts', 'credit-card', 'diamond', 'direction-arrows', 'directory', 'document', 'dollar-coin-shine', 'dot', 'double-buildings', 'edit-template', 'envelope', 'exclude', 'expand-content', 'expense', 'explore_nearby', 'eye-circle', 'eye-invisible', 'eye', 'face-meh', 'face-sad', 'face-smiley', 'feed', 'feedbacks', 'file-certified', 'file-clone', 'file-copy', 'file-csv', 'file-dispose', 'file-doc', 'file-excel', 'file-export', 'file-lock', 'file-pdf', 'file-powerpoint', 'file-search', 'file-secured', 'file-sheets', 'file-slide', 'file-verified', 'file-word', 'file', 'filter', 'folder-user', 'folder', 'format-bold', 'format-heading1', 'format-heading2', 'format-italic', 'format-list-bulleted', 'format-list-numbered', 'format-underlined', 'funnel-filter', 'global-dollar', 'globe', 'graduation-cap', 'graph', 'happy-sun', 'health-bag', 'heart', 'hero-points', 'home', 'image', 'import', 'incident-siren', 'instapay-daily', 'instapay-now', 'instapay', 'list', 'loading-2', 'loading', 'location-on', 'location', 'lock', 'looks-one', 'looks-two', 'media-content', 'menu', 'money-notes', 'moneybag', 'moon', 'multiple-stars', 'multiple-users', 'near-me', 'node', 'open-folder', 'paperclip-vertical', 'paperclip', 'payment-summary', 'pencil', 'phone', 'piggy-bank', 'plane-up', 'plane', 'play-arrow', 'play-circle', 'print', 'raising-hands', 'reply-arrow', 'reply', 'reschedule', 'rostering', 'salary-sacrifice', 'save', 'schedule-send', 'schedule', 'search-person', 'search', 'send', 'speaker-active', 'speaker', 'star-award', 'star-badge', 'star-circle', 'star-medal', 'star', 'steps-circle', 'stopwatch', 'suitcase', 'surfing', 'survey', 'swag-pillar-benefit', 'swag-pillar-career', 'swag-pillar-money', 'swag-pillar-work', 'swag', 'swipe-right', 'switch', 'tag', 'target', 'teams', 'thumb-down', 'timesheet', 'touch-id', 'trash-bin', 'unlock', 'user', 'video-1', 'video-2', 'wallet', 'warning', 'accommodation-outlined', 'activate-outlined', 'add-credit-card-outlined', 'add-person-outlined', 'add-section-outlined', 'add-time-outlined', 'add', 'adjustment-outlined', 'afternoon-outlined', 'ai-outlined', 'alignment-2-outlined', 'alignment-outlined', 'all-caps', 'application-outlined', 'arrow-down', 'arrow-downwards', 'arrow-left', 'arrow-leftwards', 'arrow-right', 'arrow-rightwards', 'arrow-up', 'arrow-upwards', 'article-outlined', 'at-sign', 'auto-graph-outlined', 'automotive-outlined', 'bakery-outlined', 'bar-outlined', 'beauty-outlined', 'beer-outlined', 'bell-active-outlined', 'bell-outlined', 'bell-slash-outlined', 'bill-management-outlined', 'billing-outlined', 'body-outlined', 'bold', 'bolt-outlined', 'book-outlined', 'bookmark-added-outlined', 'bookmark-checked-outlined', 'bookmark-outlined', 'box-1-outlined', 'box-check-outlined', 'box-outlined', 'bullet-points', 'cake-outlined', 'calculator-outlined', 'calendar-dates-outlined', 'calendar-star-outlined', 'call-outlined', 'call-split-outlined', 'camera-outlined', 'cancel', 'car-forward-outlined', 'cashback-outlined', 'charging-station-outlined', 'chat-bubble-outlined', 'chat-unread-outlined', 'checkmark', 'circle-add-outlined', 'circle-cancel-outlined', 'circle-down-outlined', 'circle-info-outlined', 'circle-left-outlined', 'circle-ok-outlined', 'circle-question-outlined', 'circle-remove-outlined', 'circle-right-outlined', 'circle-up-outlined', 'circle-warning-outlined', 'clock-2-outlined', 'clock-in-outlined', 'clock-out-outlined', 'clock-outlined', 'cog-outlined', 'coin-outlined', 'coin-super-outlined', 'comment-outlined', 'contacts-outlined', 'contacts-user-outlined', 'credit-card-outlined', 'cultural-site-outlined', 'cup-outlined', 'dentistry-outlined', 'direction-arrows-outlined', 'directory-outlined', 'document-outlined', 'dollar-box-outlined', 'dollar-card-outlined', 'dollar-coin-shine-outlined', 'dollar-credit-card-outlined', 'dollar-sign', 'double-buildings-outlined', 'double-left-arrows', 'double-right-arrows', 'download-box-outlined', 'download-outlined', 'edit-template-outlined', 'electronics-outlined', 'email-outlined', 'end-break-outlined', 'enter-arrow', 'entertainment-outlined', 'envelope-outlined', 'evening-outlined', 'expense-approval-outlined', 'expense-outlined', 'explore-outlined', 'extension-outlined', 'external-link', 'eye-invisible-outlined', 'eye-outlined', 'face-id', 'face-meh-outlined', 'face-open-smiley-outlined', 'face-sad-outlined', 'face-smiley-outlined', 'fastfood-outlined', 'feed-outlined', 'file-certified-outlined', 'file-clone-outlined', 'file-copy-outlined', 'file-dispose-outlined', 'file-dollar-certified-outlined', 'file-dollar-outlined', 'file-download-outlined', 'file-export-outlined', 'file-lock-outlined', 'file-outlined', 'file-search-outlined', 'file-secured-outlined', 'file-statutory-outlined', 'file-verified-outlined', 'filter-outlined', 'fitness-outlined', 'folder-outlined', 'folder-upload-outlined', 'folder-user-outlined', 'form-outlined', 'funnel-filter-outline', 'goal-outlined', 'graph-outlined', 'grocery-outlined', 'hand-holding-user-outlined', 'handshake-outlined', 'happy-sun-outlined', 'health-bag-outlined', 'heart-outlined', 'home-active-outlined', 'home-outlined', 'id-card-outlined', 'image-outlined', 'import-outlined', 'instapay-outlined', 'italic', 'job-search-outlined', 'leave-approval-outlined', 'link-1', 'link-2', 'list-outlined', 'live-help-outlined', 'local_mall_outlined', 'location-on-outlined', 'location-outlined', 'lock-outlined', 'locked-file-outlined', 'log-out', 'mail-outlined', 'map-outlined', 'media-content-outlined', 'menu-close', 'menu-expand', 'menu-fold-outlined', 'menu-unfold-outlined', 'moneybag-outlined', 'moon-outlined', 'more-horizontal', 'more-vertical', 'morning-outlined', 'multiple-folders-outlined', 'multiple-users-outlined', 'near-me-outlined', 'node-outlined', 'number-points', 'number', 'overview-outlined', 'park-outlined', 'payment-summary-outlined', 'payslip-outlined', 'pencil-outlined', 'percentage', 'phone-outlined', 'piggy-bank-outlined', 'plane-outlined', 'play-circle-outlined', 'print-outlined', 'propane-tank-outlined', 'qr-code-outlined', 'qualification-outlined', 're-assign', 'redeem', 'refresh', 'remove', 'reply-outlined', 'restart', 'restaurant-outlined', 'resume-outlined', 'return-arrow', 'rostering-outlined', 'safety-outlined', 'save-outlined', 'schedule-outlined', 'search-outlined', 'search-secured-outlined', 'send-outlined', 'share-1', 'share-2', 'share-outlined-2', 'share-outlined', 'shop-outlined', 'shopping_basket_outlined', 'show-chart-outlined', 'single-down-arrow', 'single-left-arrow', 'single-right-arrow', 'single-up-arrow', 'smart-match-outlined', 'sparkle-outlined', 'speaker-active-outlined', 'speaker-outlined', 'star-circle-outlined', 'star-outlined', 'start-break-outlined', 'stash-outlined', 'stopwatch-outlined', 'strikethrough', 'styler-outlined', 'suitcase-clock-outlined', 'suitcase-outlined', 'survey-outlined', 'switch-outlined', 'sync', 'tag-outlined', 'target-outlined', 'tennis-outlined', 'thumb-down-outlined', 'ticket-outlined', 'timesheet-outlined', 'timesheets-outlined', 'today-outlined', 'transfer', 'transportation-outlined', 'trash-bin-outlined', 'umbrela-outlined', 'unavailability-outlined', 'unavailable', 'underline', 'union-outlined', 'unlock-outlined', 'upload-outlined', 'user-circle-outlined', 'user-gear-outlined', 'user-outlined', 'user-rectangle-outlined', 'video-1-outlined', 'video-2-outlined', 'volunteer-outlined', 'wallet-outlined', 'wellness-outlined'];
|
|
7714
|
+
var IconList = ['activate', 'add-emoji', 'add-person', 'adjustment', 'alignment', 'antenna', 'archive', 'assignment-warning', 'bank', 'bell', 'billing', 'bolt', 'bookmark-added', 'bookmark-checked', 'bookmark', 'box-check', 'box', 'bpay', 'buildings', 'cake', 'calendar-clock', 'calendar', 'candy-box-menu', 'caret-down-small', 'caret-down', 'caret-left-small', 'caret-left', 'caret-right-small', 'caret-right', 'caret-up-small', 'caret-up', 'check-radio', 'circle-add', 'circle-cancel', 'circle-check', 'circle-down', 'circle-info', 'circle-left', 'circle-ok', 'circle-pencil', 'circle-question', 'circle-remove', 'circle-right', 'circle-up', 'circle-warning', 'clock-3', 'clock', 'cloud-download', 'cloud-upload', 'cog', 'coin', 'contacts', 'credit-card', 'diamond', 'direction-arrows', 'directory', 'document', 'dollar-coin-shine', 'dot', 'double-buildings', 'edit-template', 'envelope', 'exclude', 'expand-content', 'expense', 'explore_nearby', 'eye-circle', 'eye-invisible', 'eye', 'face-meh', 'face-sad', 'face-smiley', 'feed', 'feedbacks', 'file-certified', 'file-clone', 'file-copy', 'file-csv', 'file-dispose', 'file-doc', 'file-excel', 'file-export', 'file-lock', 'file-pdf', 'file-powerpoint', 'file-search', 'file-secured', 'file-sheets', 'file-slide', 'file-verified', 'file-word', 'file', 'filter', 'folder-user', 'folder', 'format-bold', 'format-heading1', 'format-heading2', 'format-italic', 'format-list-bulleted', 'format-list-numbered', 'format-underlined', 'funnel-filter', 'global-dollar', 'globe', 'graduation-cap', 'graph', 'happy-sun', 'health-bag', 'heart', 'hero-points', 'home', 'image', 'import', 'incident-siren', 'instapay-daily', 'instapay-now', 'instapay', 'list', 'loading-2', 'loading', 'location-on', 'location', 'lock', 'looks-one', 'looks-two', 'media-content', 'menu', 'money-notes', 'moneybag', 'moon', 'multiple-stars', 'multiple-users', 'near-me', 'node', 'open-folder', 'paperclip-vertical', 'paperclip', 'payment-summary', 'pencil', 'phone', 'piggy-bank', 'plane-up', 'plane', 'play-arrow', 'play-circle', 'print', 'raising-hands', 'reply-arrow', 'reply', 'reschedule', 'rostering', 'salary-sacrifice', 'save', 'schedule-send', 'schedule', 'search-person', 'search', 'send', 'speaker-active', 'speaker', 'star-award', 'star-badge', 'star-circle', 'star-medal', 'star', 'steps-circle', 'stopwatch', 'suitcase', 'surfing', 'survey', 'swag-pillar-benefit', 'swag-pillar-career', 'swag-pillar-money', 'swag-pillar-work', 'swag', 'swipe-right', 'switch', 'tag', 'target', 'teams', 'thumb-down', 'timesheet', 'touch-id', 'trash-bin', 'unlock', 'user', 'video-1', 'video-2', 'wallet', 'warning', 'accommodation-outlined', 'activate-outlined', 'add-credit-card-outlined', 'add-person-outlined', 'add-section-outlined', 'add-time-outlined', 'add', 'adjustment-outlined', 'afternoon-outlined', 'ai-outlined', 'alignment-2-outlined', 'alignment-outlined', 'all-caps', 'application-outlined', 'arrow-down', 'arrow-downwards', 'arrow-left', 'arrow-leftwards', 'arrow-right', 'arrow-rightwards', 'arrow-up', 'arrow-upwards', 'article-outlined', 'at-sign', 'auto-graph-outlined', 'automotive-outlined', 'bakery-outlined', 'bar-outlined', 'beauty-outlined', 'beer-outlined', 'bell-active-outlined', 'bell-outlined', 'bell-slash-outlined', 'bill-management-outlined', 'billing-outlined', 'body-outlined', 'bold', 'bolt-outlined', 'book-outlined', 'bookmark-added-outlined', 'bookmark-checked-outlined', 'bookmark-outlined', 'box-1-outlined', 'box-check-outlined', 'box-outlined', 'bullet-points', 'cake-outlined', 'calculator-outlined', 'calendar-dates-outlined', 'calendar-star-outlined', 'call-outlined', 'call-split-outlined', 'camera-outlined', 'cancel', 'car-forward-outlined', 'cashback-outlined', 'charging-station-outlined', 'chat-bubble-outlined', 'chat-unread-outlined', 'checkmark', 'circle-add-outlined', 'circle-cancel-outlined', 'circle-down-outlined', 'circle-info-outlined', 'circle-left-outlined', 'circle-ok-outlined', 'circle-question-outlined', 'circle-remove-outlined', 'circle-right-outlined', 'circle-up-outlined', 'circle-warning-outlined', 'clock-2-outlined', 'clock-in-outlined', 'clock-out-outlined', 'clock-outlined', 'cog-outlined', 'coin-outlined', 'coin-super-outlined', 'comment-outlined', 'contacts-outlined', 'contacts-user-outlined', 'credit-card-outlined', 'cultural-site-outlined', 'cup-outlined', 'dentistry-outlined', 'direction-arrows-outlined', 'directory-outlined', 'document-outlined', 'dollar-box-outlined', 'dollar-card-outlined', 'dollar-coin-shine-outlined', 'dollar-credit-card-outlined', 'dollar-sign', 'double-buildings-outlined', 'double-left-arrows', 'double-right-arrows', 'download-box-outlined', 'download-outlined', 'edit-template-outlined', 'electronics-outlined', 'email-outlined', 'end-break-outlined', 'enter-arrow', 'entertainment-outlined', 'envelope-outlined', 'evening-outlined', 'expense-approval-outlined', 'expense-outlined', 'explore-outlined', 'extension-outlined', 'external-link', 'eye-invisible-outlined', 'eye-outlined', 'face-id', 'face-meh-outlined', 'face-open-smiley-outlined', 'face-sad-outlined', 'face-smiley-outlined', 'fastfood-outlined', 'feed-outlined', 'file-certified-outlined', 'file-clone-outlined', 'file-copy-outlined', 'file-dispose-outlined', 'file-dollar-certified-outlined', 'file-dollar-outlined', 'file-download-outlined', 'file-export-outlined', 'file-lock-outlined', 'file-outlined', 'file-search-outlined', 'file-secured-outlined', 'file-statutory-outlined', 'file-verified-outlined', 'filter-outlined', 'fitness-outlined', 'folder-outlined', 'folder-upload-outlined', 'folder-user-outlined', 'form-outlined', 'funnel-filter-outline', 'goal-outlined', 'graph-outlined', 'grocery-outlined', 'hand-holding-user-outlined', 'handshake-outlined', 'happy-sun-outlined', 'health-bag-outlined', 'heart-outlined', 'home-active-outlined', 'home-outlined', 'id-card-outlined', 'image-outlined', 'import-outlined', 'instapay-outlined', 'italic', 'job-search-outlined', 'leave-approval-outlined', 'link-1', 'link-2', 'list-outlined', 'live-help-outlined', 'local_mall_outlined', 'location-on-outlined', 'location-outlined', 'lock-outlined', 'locked-file-outlined', 'log-out', 'mail-outlined', 'map-outlined', 'media-content-outlined', 'menu-close', 'menu-expand', 'menu-fold-outlined', 'menu-unfold-outlined', 'moneybag-outlined', 'moon-outlined', 'more-horizontal', 'more-vertical', 'morning-outlined', 'multiple-folders-outlined', 'multiple-users-outlined', 'near-me-outlined', 'node-outlined', 'number-points', 'number', 'overview-outlined', 'park-outlined', 'payment-summary-outlined', 'payslip-outlined', 'pencil-outlined', 'percentage', 'phone-outlined', 'piggy-bank-outlined', 'plane-outlined', 'play-circle-outlined', 'print-outlined', 'propane-tank-outlined', 'qr-code-outlined', 'qualification-outlined', 're-assign', 'redeem', 'refresh', 'remove', 'reply-outlined', 'restart', 'restaurant-outlined', 'resume-outlined', 'return-arrow', 'rostering-outlined', 'safety-outlined', 'save-outlined', 'schedule-outlined', 'search-outlined', 'search-secured-outlined', 'send-outlined', 'share-1', 'share-2', 'share-outlined-2', 'share-outlined', 'shield-check-outlined', 'shop-outlined', 'shopping_basket_outlined', 'show-chart-outlined', 'single-down-arrow', 'single-left-arrow', 'single-right-arrow', 'single-up-arrow', 'smart-match-outlined', 'sparkle-outlined', 'speaker-active-outlined', 'speaker-outlined', 'star-circle-outlined', 'star-outlined', 'start-break-outlined', 'stash-outlined', 'stopwatch-outlined', 'strikethrough', 'styler-outlined', 'suitcase-clock-outlined', 'suitcase-outlined', 'survey-outlined', 'switch-outlined', 'sync', 'tag-outlined', 'target-outlined', 'tennis-outlined', 'thumb-down-outlined', 'ticket-outlined', 'timesheet-outlined', 'timesheets-outlined', 'today-outlined', 'transfer', 'transportation-outlined', 'trash-bin-outlined', 'umbrela-outlined', 'unavailability-outlined', 'unavailable', 'underline', 'union-outlined', 'unlock-outlined', 'upload-outlined', 'user-circle-outlined', 'user-gear-outlined', 'user-outlined', 'user-rectangle-outlined', 'video-1-outlined', 'video-2-outlined', 'volunteer-outlined', 'wallet-outlined', 'wellness-outlined'];
|
|
7699
7715
|
|
|
7700
7716
|
var activate = 59000;
|
|
7701
7717
|
var adjustment = 59003;
|
|
@@ -7783,12 +7799,12 @@ var redeem = 59392;
|
|
|
7783
7799
|
var refresh = 59393;
|
|
7784
7800
|
var remove = 59394;
|
|
7785
7801
|
var restart = 59396;
|
|
7786
|
-
var shopping_basket_outlined =
|
|
7787
|
-
var strikethrough =
|
|
7788
|
-
var sync =
|
|
7789
|
-
var transfer =
|
|
7790
|
-
var unavailable =
|
|
7791
|
-
var underline =
|
|
7802
|
+
var shopping_basket_outlined = 59413;
|
|
7803
|
+
var strikethrough = 59428;
|
|
7804
|
+
var sync = 59434;
|
|
7805
|
+
var transfer = 59443;
|
|
7806
|
+
var unavailable = 59448;
|
|
7807
|
+
var underline = 59449;
|
|
7792
7808
|
var glyphMap = {
|
|
7793
7809
|
activate: activate,
|
|
7794
7810
|
"add-emoji": 59001,
|
|
@@ -8201,56 +8217,57 @@ var glyphMap = {
|
|
|
8201
8217
|
"share-2": 59408,
|
|
8202
8218
|
"share-outlined-2": 59409,
|
|
8203
8219
|
"share-outlined": 59410,
|
|
8204
|
-
"
|
|
8220
|
+
"shield-check-outlined": 59411,
|
|
8221
|
+
"shop-outlined": 59412,
|
|
8205
8222
|
shopping_basket_outlined: shopping_basket_outlined,
|
|
8206
|
-
"show-chart-outlined":
|
|
8207
|
-
"single-down-arrow":
|
|
8208
|
-
"single-left-arrow":
|
|
8209
|
-
"single-right-arrow":
|
|
8210
|
-
"single-up-arrow":
|
|
8211
|
-
"smart-match-outlined":
|
|
8212
|
-
"sparkle-outlined":
|
|
8213
|
-
"speaker-active-outlined":
|
|
8214
|
-
"speaker-outlined":
|
|
8215
|
-
"star-circle-outlined":
|
|
8216
|
-
"star-outlined":
|
|
8217
|
-
"start-break-outlined":
|
|
8218
|
-
"stash-outlined":
|
|
8219
|
-
"stopwatch-outlined":
|
|
8223
|
+
"show-chart-outlined": 59414,
|
|
8224
|
+
"single-down-arrow": 59415,
|
|
8225
|
+
"single-left-arrow": 59416,
|
|
8226
|
+
"single-right-arrow": 59417,
|
|
8227
|
+
"single-up-arrow": 59418,
|
|
8228
|
+
"smart-match-outlined": 59419,
|
|
8229
|
+
"sparkle-outlined": 59420,
|
|
8230
|
+
"speaker-active-outlined": 59421,
|
|
8231
|
+
"speaker-outlined": 59422,
|
|
8232
|
+
"star-circle-outlined": 59423,
|
|
8233
|
+
"star-outlined": 59424,
|
|
8234
|
+
"start-break-outlined": 59425,
|
|
8235
|
+
"stash-outlined": 59426,
|
|
8236
|
+
"stopwatch-outlined": 59427,
|
|
8220
8237
|
strikethrough: strikethrough,
|
|
8221
|
-
"styler-outlined":
|
|
8222
|
-
"suitcase-clock-outlined":
|
|
8223
|
-
"suitcase-outlined":
|
|
8224
|
-
"survey-outlined":
|
|
8225
|
-
"switch-outlined":
|
|
8238
|
+
"styler-outlined": 59429,
|
|
8239
|
+
"suitcase-clock-outlined": 59430,
|
|
8240
|
+
"suitcase-outlined": 59431,
|
|
8241
|
+
"survey-outlined": 59432,
|
|
8242
|
+
"switch-outlined": 59433,
|
|
8226
8243
|
sync: sync,
|
|
8227
|
-
"tag-outlined":
|
|
8228
|
-
"target-outlined":
|
|
8229
|
-
"tennis-outlined":
|
|
8230
|
-
"thumb-down-outlined":
|
|
8231
|
-
"ticket-outlined":
|
|
8232
|
-
"timesheet-outlined":
|
|
8233
|
-
"timesheets-outlined":
|
|
8234
|
-
"today-outlined":
|
|
8244
|
+
"tag-outlined": 59435,
|
|
8245
|
+
"target-outlined": 59436,
|
|
8246
|
+
"tennis-outlined": 59437,
|
|
8247
|
+
"thumb-down-outlined": 59438,
|
|
8248
|
+
"ticket-outlined": 59439,
|
|
8249
|
+
"timesheet-outlined": 59440,
|
|
8250
|
+
"timesheets-outlined": 59441,
|
|
8251
|
+
"today-outlined": 59442,
|
|
8235
8252
|
transfer: transfer,
|
|
8236
|
-
"transportation-outlined":
|
|
8237
|
-
"trash-bin-outlined":
|
|
8238
|
-
"umbrela-outlined":
|
|
8239
|
-
"unavailability-outlined":
|
|
8253
|
+
"transportation-outlined": 59444,
|
|
8254
|
+
"trash-bin-outlined": 59445,
|
|
8255
|
+
"umbrela-outlined": 59446,
|
|
8256
|
+
"unavailability-outlined": 59447,
|
|
8240
8257
|
unavailable: unavailable,
|
|
8241
8258
|
underline: underline,
|
|
8242
|
-
"union-outlined":
|
|
8243
|
-
"unlock-outlined":
|
|
8244
|
-
"upload-outlined":
|
|
8245
|
-
"user-circle-outlined":
|
|
8246
|
-
"user-gear-outlined":
|
|
8247
|
-
"user-outlined":
|
|
8248
|
-
"user-rectangle-outlined":
|
|
8249
|
-
"video-1-outlined":
|
|
8250
|
-
"video-2-outlined":
|
|
8251
|
-
"volunteer-outlined":
|
|
8252
|
-
"wallet-outlined":
|
|
8253
|
-
"wellness-outlined":
|
|
8259
|
+
"union-outlined": 59450,
|
|
8260
|
+
"unlock-outlined": 59451,
|
|
8261
|
+
"upload-outlined": 59452,
|
|
8262
|
+
"user-circle-outlined": 59453,
|
|
8263
|
+
"user-gear-outlined": 59454,
|
|
8264
|
+
"user-outlined": 59455,
|
|
8265
|
+
"user-rectangle-outlined": 59456,
|
|
8266
|
+
"video-1-outlined": 59457,
|
|
8267
|
+
"video-2-outlined": 59458,
|
|
8268
|
+
"volunteer-outlined": 59459,
|
|
8269
|
+
"wallet-outlined": 59460,
|
|
8270
|
+
"wellness-outlined": 59461
|
|
8254
8271
|
};
|
|
8255
8272
|
|
|
8256
8273
|
var HeroIcon = reactNativeVectorIcons.createIconSet(glyphMap, 'hero-icons-mobile', 'hero-icons-mobile.ttf');
|
|
@@ -8276,10 +8293,10 @@ var StyledHeroIcon = index$a(HeroIcon)(function (_ref) {
|
|
|
8276
8293
|
};
|
|
8277
8294
|
});
|
|
8278
8295
|
|
|
8279
|
-
var _excluded$
|
|
8296
|
+
var _excluded$H = ["style"];
|
|
8280
8297
|
var AnimatedIcon = function AnimatedIcon(_ref) {
|
|
8281
8298
|
var style = _ref.style,
|
|
8282
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
8299
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$H);
|
|
8283
8300
|
var rotateAnimation = React.useRef(new reactNative.Animated.Value(0));
|
|
8284
8301
|
React.useEffect(function () {
|
|
8285
8302
|
var animation = reactNative.Animated.loop(reactNative.Animated.timing(rotateAnimation.current, {
|
|
@@ -8384,7 +8401,7 @@ var AccordionItem = function AccordionItem(_ref) {
|
|
|
8384
8401
|
}, content));
|
|
8385
8402
|
};
|
|
8386
8403
|
|
|
8387
|
-
var _excluded$
|
|
8404
|
+
var _excluded$G = ["key"];
|
|
8388
8405
|
var Accordion = function Accordion(_ref) {
|
|
8389
8406
|
var items = _ref.items,
|
|
8390
8407
|
activeItemKey = _ref.activeItemKey,
|
|
@@ -8405,7 +8422,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
8405
8422
|
testID: testID
|
|
8406
8423
|
}, items.map(function (_ref2, index) {
|
|
8407
8424
|
var key = _ref2.key,
|
|
8408
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
8425
|
+
props = _objectWithoutProperties(_ref2, _excluded$G);
|
|
8409
8426
|
var open = _activeItemKey === key;
|
|
8410
8427
|
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, {
|
|
8411
8428
|
key: key
|
|
@@ -9271,7 +9288,7 @@ var borderWidths = {
|
|
|
9271
9288
|
var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
|
|
9272
9289
|
var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
|
|
9273
9290
|
|
|
9274
|
-
var _excluded$
|
|
9291
|
+
var _excluded$F = ["theme"];
|
|
9275
9292
|
var getThemeValue = function getThemeValue(theme, key, props) {
|
|
9276
9293
|
var propConfig = config[key];
|
|
9277
9294
|
var propValue = props[key];
|
|
@@ -9298,18 +9315,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
|
|
|
9298
9315
|
var configKeys = Object.keys(config);
|
|
9299
9316
|
var StyledBox = index$a(reactNative.View)(function (_ref5) {
|
|
9300
9317
|
var theme = _ref5.theme,
|
|
9301
|
-
otherProps = _objectWithoutProperties(_ref5, _excluded$
|
|
9318
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$F);
|
|
9302
9319
|
var styleProps = pick(configKeys, otherProps);
|
|
9303
9320
|
var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
|
|
9304
9321
|
return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
|
|
9305
9322
|
});
|
|
9306
9323
|
|
|
9307
|
-
var _excluded$
|
|
9324
|
+
var _excluded$E = ["children", "style", "testID"];
|
|
9308
9325
|
var Box = function Box(_ref) {
|
|
9309
9326
|
var children = _ref.children,
|
|
9310
9327
|
style = _ref.style,
|
|
9311
9328
|
testID = _ref.testID,
|
|
9312
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
9329
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$E);
|
|
9313
9330
|
return /*#__PURE__*/React__namespace.default.createElement(StyledBox, _extends$1({}, otherProps, {
|
|
9314
9331
|
style: style,
|
|
9315
9332
|
testID: testID
|
|
@@ -9530,16 +9547,44 @@ var StyledStatus = index$a(reactNative.Animated.View)(function (_ref3) {
|
|
|
9530
9547
|
borderRadius: theme.radii.rounded
|
|
9531
9548
|
};
|
|
9532
9549
|
});
|
|
9533
|
-
var
|
|
9534
|
-
var
|
|
9535
|
-
|
|
9550
|
+
var StyledCount = index$a(reactNative.View)(function (_ref4) {
|
|
9551
|
+
var theme = _ref4.theme;
|
|
9552
|
+
return {
|
|
9553
|
+
backgroundColor: theme.__hd__.badge.colors.danger,
|
|
9554
|
+
borderRadius: theme.__hd__.badge.radii.count,
|
|
9555
|
+
minWidth: theme.__hd__.badge.sizes.count.width,
|
|
9556
|
+
height: theme.__hd__.badge.sizes.count.height,
|
|
9557
|
+
alignItems: 'center',
|
|
9558
|
+
justifyContent: 'center',
|
|
9559
|
+
textAlign: 'center',
|
|
9560
|
+
textAlignVertical: 'center',
|
|
9561
|
+
color: theme.__hd__.badge.colors.text,
|
|
9562
|
+
display: 'flex',
|
|
9563
|
+
paddingHorizontal: theme.__hd__.badge.space.countPaddingHorizontal,
|
|
9564
|
+
position: 'absolute',
|
|
9565
|
+
top: theme.__hd__.badge.space.statusPositionTop,
|
|
9566
|
+
right: theme.__hd__.badge.space.statusPositionRight
|
|
9567
|
+
};
|
|
9568
|
+
});
|
|
9569
|
+
var StyledCountText = index$a(Typography.Text)(function (_ref5) {
|
|
9570
|
+
var theme = _ref5.theme;
|
|
9571
|
+
return {
|
|
9572
|
+
height: theme.__hd__.badge.sizes.count.height,
|
|
9573
|
+
lineHeight: theme.__hd__.badge.lineHeights.count,
|
|
9574
|
+
color: theme.__hd__.badge.colors.text,
|
|
9575
|
+
fontSize: theme.__hd__.badge.fontSizes.count
|
|
9576
|
+
};
|
|
9577
|
+
});
|
|
9578
|
+
var StyledIcon$4 = index$a(Icon)(function (_ref6) {
|
|
9579
|
+
var themeSize = _ref6.themeSize,
|
|
9580
|
+
theme = _ref6.theme;
|
|
9536
9581
|
return {
|
|
9537
9582
|
fontSize: theme.__hd__.badge.fontSizes[themeSize]
|
|
9538
9583
|
};
|
|
9539
9584
|
});
|
|
9540
9585
|
|
|
9541
|
-
var _excluded$
|
|
9542
|
-
var Status = function Status(_ref) {
|
|
9586
|
+
var _excluded$D = ["children", "visible", "intent", "style", "testID"];
|
|
9587
|
+
var Status$1 = function Status(_ref) {
|
|
9543
9588
|
var children = _ref.children,
|
|
9544
9589
|
_ref$visible = _ref.visible,
|
|
9545
9590
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
@@ -9547,7 +9592,7 @@ var Status = function Status(_ref) {
|
|
|
9547
9592
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
9548
9593
|
style = _ref.style,
|
|
9549
9594
|
testID = _ref.testID,
|
|
9550
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
9595
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$D);
|
|
9551
9596
|
var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
|
|
9552
9597
|
opacity = _React$useRef.current;
|
|
9553
9598
|
var isFirstRendering = React__namespace.default.useRef(true);
|
|
@@ -9580,8 +9625,31 @@ var Status = function Status(_ref) {
|
|
|
9580
9625
|
}));
|
|
9581
9626
|
};
|
|
9582
9627
|
|
|
9583
|
-
var _excluded$B = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
|
|
9584
9628
|
var DEFAULT_MAX_NUMBER = 99;
|
|
9629
|
+
|
|
9630
|
+
var _excluded$C = ["children", "visible", "style", "max", "testID", "content"];
|
|
9631
|
+
var Status = function Status(_ref) {
|
|
9632
|
+
var children = _ref.children,
|
|
9633
|
+
_ref$visible = _ref.visible,
|
|
9634
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
9635
|
+
style = _ref.style,
|
|
9636
|
+
_ref$max = _ref.max,
|
|
9637
|
+
max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
|
|
9638
|
+
testID = _ref.testID,
|
|
9639
|
+
originalContent = _ref.content,
|
|
9640
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$C);
|
|
9641
|
+
var content = React.useMemo(function () {
|
|
9642
|
+
return originalContent > max ? "".concat(max, "+") : String(originalContent);
|
|
9643
|
+
}, [originalContent, max]);
|
|
9644
|
+
return /*#__PURE__*/React__namespace.default.createElement(reactNative.View, _extends$1({}, nativeProps, {
|
|
9645
|
+
style: style,
|
|
9646
|
+
testID: testID
|
|
9647
|
+
}), children, visible && /*#__PURE__*/React__namespace.default.createElement(StyledCount, {
|
|
9648
|
+
testID: "count-badge"
|
|
9649
|
+
}, /*#__PURE__*/React__namespace.default.createElement(StyledCountText, null, content)));
|
|
9650
|
+
};
|
|
9651
|
+
|
|
9652
|
+
var _excluded$B = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
|
|
9585
9653
|
var getPaddingState = function getPaddingState(content) {
|
|
9586
9654
|
return content.length > 1 ? 'wideContent' : 'narrowContent';
|
|
9587
9655
|
};
|
|
@@ -9647,7 +9715,8 @@ var Badge = function Badge(_ref) {
|
|
|
9647
9715
|
}, content));
|
|
9648
9716
|
};
|
|
9649
9717
|
var Badge$1 = Object.assign(Badge, {
|
|
9650
|
-
Status: Status
|
|
9718
|
+
Status: Status$1,
|
|
9719
|
+
Count: Status
|
|
9651
9720
|
});
|
|
9652
9721
|
|
|
9653
9722
|
var isHeroIcon = function isHeroIcon(x) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
import { StyledCount, StyledCountText } from './StyledBadge';
|
|
6
|
+
import { DEFAULT_MAX_NUMBER } from './constants';
|
|
7
|
+
|
|
8
|
+
export interface CountProps extends ViewProps {
|
|
9
|
+
/*
|
|
10
|
+
* The Status Badge's content.
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the Status Badge is visible.
|
|
15
|
+
*/
|
|
16
|
+
visible?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Additional style.
|
|
19
|
+
*/
|
|
20
|
+
style?: StyleProp<ViewStyle>;
|
|
21
|
+
/**
|
|
22
|
+
* Testing id of the component.
|
|
23
|
+
*/
|
|
24
|
+
testID?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The content will be displayed in the badge.
|
|
27
|
+
*/
|
|
28
|
+
content: number;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum number displayed on the badge. If number exceeds this value, `${max}+` are displayed instead. (Only applied when content is number.)
|
|
31
|
+
*/
|
|
32
|
+
max?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const Status = ({
|
|
36
|
+
children,
|
|
37
|
+
visible = true,
|
|
38
|
+
style,
|
|
39
|
+
max = DEFAULT_MAX_NUMBER,
|
|
40
|
+
testID,
|
|
41
|
+
content: originalContent,
|
|
42
|
+
...nativeProps
|
|
43
|
+
}: CountProps): JSX.Element => {
|
|
44
|
+
const content = useMemo(() => {
|
|
45
|
+
return originalContent > max ? `${max}+` : String(originalContent);
|
|
46
|
+
}, [originalContent, max]);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<View {...nativeProps} style={style} testID={testID}>
|
|
50
|
+
{children}
|
|
51
|
+
{visible && (
|
|
52
|
+
<StyledCount testID="count-badge">
|
|
53
|
+
<StyledCountText>{content}</StyledCountText>
|
|
54
|
+
</StyledCount>
|
|
55
|
+
)}
|
|
56
|
+
</View>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default Status;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Animated } from 'react-native';
|
|
1
|
+
import { Animated, View } from 'react-native';
|
|
2
2
|
import styled from '@emotion/native';
|
|
3
3
|
import Typography from '../Typography';
|
|
4
4
|
import Icon from '../Icon';
|
|
@@ -64,10 +64,41 @@ const StyledStatus = styled(Animated.View)<{
|
|
|
64
64
|
borderRadius: theme.radii.rounded,
|
|
65
65
|
}));
|
|
66
66
|
|
|
67
|
+
const StyledCount = styled(View)(({ theme }) => ({
|
|
68
|
+
backgroundColor: theme.__hd__.badge.colors.danger,
|
|
69
|
+
borderRadius: theme.__hd__.badge.radii.count,
|
|
70
|
+
minWidth: theme.__hd__.badge.sizes.count.width,
|
|
71
|
+
height: theme.__hd__.badge.sizes.count.height,
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
justifyContent: 'center',
|
|
74
|
+
textAlign: 'center',
|
|
75
|
+
textAlignVertical: 'center',
|
|
76
|
+
color: theme.__hd__.badge.colors.text,
|
|
77
|
+
display: 'flex',
|
|
78
|
+
paddingHorizontal: theme.__hd__.badge.space.countPaddingHorizontal,
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
top: theme.__hd__.badge.space.statusPositionTop,
|
|
81
|
+
right: theme.__hd__.badge.space.statusPositionRight,
|
|
82
|
+
}));
|
|
83
|
+
|
|
84
|
+
const StyledCountText = styled(Typography.Text)(({ theme }) => ({
|
|
85
|
+
height: theme.__hd__.badge.sizes.count.height,
|
|
86
|
+
lineHeight: theme.__hd__.badge.lineHeights.count,
|
|
87
|
+
color: theme.__hd__.badge.colors.text,
|
|
88
|
+
fontSize: theme.__hd__.badge.fontSizes.count,
|
|
89
|
+
}));
|
|
90
|
+
|
|
67
91
|
const StyledIcon = styled(Icon)<{
|
|
68
92
|
themeSize: ThemeSize;
|
|
69
93
|
}>(({ themeSize, theme }) => ({
|
|
70
94
|
fontSize: theme.__hd__.badge.fontSizes[themeSize],
|
|
71
95
|
}));
|
|
72
96
|
|
|
73
|
-
export {
|
|
97
|
+
export {
|
|
98
|
+
StyledCountText,
|
|
99
|
+
StyledView,
|
|
100
|
+
StyledText,
|
|
101
|
+
StyledStatus,
|
|
102
|
+
StyledIcon,
|
|
103
|
+
StyledCount,
|
|
104
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
+
import BadgeCount from '../Count';
|
|
4
|
+
import Icon from '../../Icon';
|
|
5
|
+
|
|
6
|
+
describe('BadgeCount', () => {
|
|
7
|
+
it.each`
|
|
8
|
+
content | expectedContent
|
|
9
|
+
${1} | ${'1'}
|
|
10
|
+
${12} | ${'12'}
|
|
11
|
+
${999} | ${'99+'}
|
|
12
|
+
`(
|
|
13
|
+
'displays $expectedContent for content $content',
|
|
14
|
+
({ content, expectedContent }) => {
|
|
15
|
+
const { getByText, getByTestId, toJSON } = renderWithTheme(
|
|
16
|
+
<BadgeCount content={content} testID="wrapper">
|
|
17
|
+
<Icon icon="bell-outlined" size="small" />
|
|
18
|
+
</BadgeCount>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
expect(toJSON()).toMatchSnapshot();
|
|
22
|
+
expect(getByText(expectedContent)).toBeDefined();
|
|
23
|
+
expect(getByTestId('count-badge')).toHaveStyle({
|
|
24
|
+
backgroundColor: '#cb300a',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
it('should hide if visible is false', () => {
|
|
30
|
+
const { queryByTestId } = renderWithTheme(
|
|
31
|
+
<BadgeCount content={1} visible={false} testID="wrapper">
|
|
32
|
+
<Icon icon="bell-outlined" size="small" />
|
|
33
|
+
</BadgeCount>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
expect(queryByTestId('count-badge')).toBeNull();
|
|
37
|
+
});
|
|
38
|
+
});
|