baseui 11.0.3 → 11.1.2
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/a11y/index.d.ts +1 -1
- package/accordion/index.d.ts +25 -28
- package/app-nav-bar/app-nav-bar.js +33 -40
- package/app-nav-bar/app-nav-bar.js.flow +46 -62
- package/app-nav-bar/index.d.ts +9 -8
- package/app-nav-bar/styled-components.js +83 -29
- package/app-nav-bar/styled-components.js.flow +59 -9
- package/app-nav-bar/types.js.flow +2 -0
- package/aspect-ratio-box/index.d.ts +2 -4
- package/avatar/index.d.ts +6 -12
- package/badge/badge.js +109 -0
- package/badge/badge.js.flow +91 -0
- package/badge/constants.js +54 -0
- package/badge/constants.js.flow +52 -0
- package/badge/hint-dot.js +96 -0
- package/badge/hint-dot.js.flow +68 -0
- package/badge/index.d.ts +97 -0
- package/badge/index.js +80 -0
- package/badge/index.js.flow +20 -0
- package/badge/notification-circle.js +103 -0
- package/badge/notification-circle.js.flow +81 -0
- package/badge/package.json +4 -0
- package/badge/styled-components.js +242 -0
- package/badge/styled-components.js.flow +325 -0
- package/badge/types.js +11 -0
- package/badge/types.js.flow +59 -0
- package/badge/utils.js +33 -0
- package/badge/utils.js.flow +23 -0
- package/banner/banner.js +283 -0
- package/banner/banner.js.flow +253 -0
- package/banner/constants.js +35 -0
- package/banner/constants.js.flow +33 -0
- package/banner/index.d.ts +75 -0
- package/banner/index.js +44 -0
- package/banner/index.js.flow +16 -0
- package/banner/package.json +4 -0
- package/banner/styled-components.js +131 -0
- package/banner/styled-components.js.flow +119 -0
- package/banner/types.js +11 -0
- package/banner/types.js.flow +66 -0
- package/block/index.d.ts +4 -4
- package/breadcrumbs/breadcrumbs.js +5 -1
- package/breadcrumbs/breadcrumbs.js.flow +2 -2
- package/breadcrumbs/index.d.ts +5 -5
- package/button/button.js +2 -1
- package/button/button.js.flow +1 -0
- package/button/index.d.ts +19 -29
- package/button-group/index.d.ts +18 -24
- package/card/index.d.ts +16 -14
- package/checkbox/index.d.ts +17 -21
- package/combobox/index.d.ts +7 -11
- package/data-table/index.d.ts +7 -10
- package/datepicker/index.d.ts +42 -63
- package/datepicker/utils/date-helpers.js +1 -1
- package/datepicker/utils/date-helpers.js.flow +1 -1
- package/dnd-list/index.d.ts +22 -35
- package/drawer/index.d.ts +22 -27
- package/es/app-nav-bar/app-nav-bar.js +9 -19
- package/es/app-nav-bar/styled-components.js +64 -13
- package/es/badge/badge.js +70 -0
- package/es/badge/constants.js +42 -0
- package/es/badge/hint-dot.js +55 -0
- package/es/badge/index.js +11 -0
- package/es/badge/notification-circle.js +65 -0
- package/es/badge/styled-components.js +296 -0
- package/es/badge/types.js +8 -0
- package/es/badge/utils.js +17 -0
- package/es/banner/banner.js +213 -0
- package/es/banner/constants.js +24 -0
- package/es/banner/index.js +9 -0
- package/es/banner/styled-components.js +122 -0
- package/es/banner/types.js +8 -0
- package/es/breadcrumbs/breadcrumbs.js +5 -1
- package/es/button/button.js +1 -0
- package/es/datepicker/utils/date-helpers.js +1 -1
- package/es/file-uploader/file-uploader.js +8 -5
- package/es/helper/helper-steps.js +3 -1
- package/es/input/base-input.js +18 -11
- package/es/input/input.js +15 -10
- package/es/input/masked-input.js +5 -2
- package/es/input/utils.js +4 -2
- package/es/locale/tr_TR.js +115 -0
- package/es/notification/notification.js +16 -1
- package/es/payment-card/custom-cards.config.js +22 -0
- package/es/payment-card/icons/uatp.js +52 -0
- package/es/payment-card/payment-card.js +8 -3
- package/es/popover/popover.js +2 -1
- package/es/popover/stateful-container.js +2 -0
- package/es/popover/styled-components.js +2 -1
- package/es/progress-steps/numbered-step.js +2 -2
- package/es/select/select-component.js +38 -21
- package/es/table-semantic/styled-components.js +14 -0
- package/es/table-semantic/table-builder.js +12 -5
- package/es/textarea/textarea.js +15 -9
- package/es/themes/dark-theme/color-component-tokens.js +8 -0
- package/es/themes/light-theme/color-component-tokens.js +8 -0
- package/es/tree-view/tree-label.js +9 -1
- package/esm/app-nav-bar/app-nav-bar.js +32 -38
- package/esm/app-nav-bar/styled-components.js +79 -28
- package/esm/badge/badge.js +97 -0
- package/esm/badge/constants.js +42 -0
- package/esm/badge/hint-dot.js +83 -0
- package/esm/badge/index.js +11 -0
- package/esm/badge/notification-circle.js +91 -0
- package/esm/badge/styled-components.js +235 -0
- package/esm/badge/types.js +8 -0
- package/esm/badge/utils.js +17 -0
- package/esm/banner/banner.js +271 -0
- package/esm/banner/constants.js +24 -0
- package/esm/banner/index.js +9 -0
- package/esm/banner/styled-components.js +113 -0
- package/esm/banner/types.js +8 -0
- package/esm/breadcrumbs/breadcrumbs.js +5 -1
- package/esm/button/button.js +2 -1
- package/esm/datepicker/utils/date-helpers.js +1 -1
- package/esm/file-uploader/file-uploader.js +23 -8
- package/esm/helper/helper-steps.js +3 -1
- package/esm/input/base-input.js +18 -11
- package/esm/input/input.js +15 -10
- package/esm/input/masked-input.js +6 -3
- package/esm/input/utils.js +4 -2
- package/esm/locale/tr_TR.js +115 -0
- package/esm/notification/notification.js +17 -1
- package/esm/payment-card/custom-cards.config.js +22 -0
- package/esm/payment-card/icons/uatp.js +53 -0
- package/esm/payment-card/payment-card.js +9 -7
- package/esm/popover/popover.js +2 -1
- package/esm/popover/stateful-container.js +2 -0
- package/esm/popover/styled-components.js +3 -2
- package/esm/progress-steps/numbered-step.js +2 -2
- package/esm/select/select-component.js +75 -57
- package/esm/table-semantic/styled-components.js +31 -18
- package/esm/table-semantic/table-builder.js +34 -23
- package/esm/textarea/textarea.js +15 -9
- package/esm/themes/dark-theme/color-component-tokens.js +8 -0
- package/esm/themes/light-theme/color-component-tokens.js +8 -0
- package/esm/tree-view/tree-label.js +10 -2
- package/file-uploader/file-uploader.js +23 -8
- package/file-uploader/file-uploader.js.flow +18 -5
- package/file-uploader/index.d.ts +11 -11
- package/file-uploader/types.js.flow +3 -0
- package/flex-grid/index.d.ts +3 -3
- package/form-control/index.d.ts +7 -19
- package/header-navigation/index.d.ts +8 -9
- package/heading/index.d.ts +3 -4
- package/helper/helper-steps.js +19 -13
- package/helper/helper-steps.js.flow +3 -1
- package/helper/index.d.ts +7 -7
- package/helpers/base-provider.d.ts +16 -0
- package/helpers/overrides.d.ts +23 -0
- package/icon/index.d.ts +32 -32
- package/index.d.ts +34 -99
- package/input/base-input.js +18 -11
- package/input/base-input.js.flow +18 -6
- package/input/index.d.ts +29 -32
- package/input/input.js +15 -10
- package/input/input.js.flow +10 -5
- package/input/masked-input.js +6 -3
- package/input/masked-input.js.flow +3 -0
- package/input/types.js.flow +4 -0
- package/input/utils.js +4 -2
- package/input/utils.js.flow +2 -1
- package/layer/index.d.ts +6 -11
- package/layout-grid/index.d.ts +25 -7
- package/link/index.d.ts +2 -2
- package/list/index.d.ts +26 -31
- package/{locale.ts → locale/index.d.ts} +8 -0
- package/locale/tr_TR.js +123 -0
- package/locale/tr_TR.js.flow +124 -0
- package/map-marker/index.d.ts +41 -47
- package/menu/index.d.ts +27 -37
- package/modal/index.d.ts +28 -38
- package/notification/index.d.ts +2 -3
- package/notification/notification.js +18 -1
- package/notification/notification.js.flow +15 -1
- package/overrides.ts +2 -22
- package/package.json +26 -17
- package/pagination/index.d.ts +22 -26
- package/payment-card/custom-cards.config.js +30 -0
- package/payment-card/custom-cards.config.js.flow +29 -0
- package/payment-card/icons/uatp.js +67 -0
- package/payment-card/icons/uatp.js.flow +62 -0
- package/payment-card/index.d.ts +8 -8
- package/payment-card/payment-card.js +12 -7
- package/payment-card/payment-card.js.flow +12 -0
- package/phone-input/index.d.ts +261 -269
- package/pin-code/index.d.ts +11 -18
- package/popover/index.d.ts +39 -55
- package/popover/popover.js +2 -1
- package/popover/popover.js.flow +2 -1
- package/popover/stateful-container.js +2 -0
- package/popover/stateful-container.js.flow +2 -0
- package/popover/styled-components.js +3 -2
- package/popover/styled-components.js.flow +2 -1
- package/popover/types.js.flow +1 -0
- package/progress-bar/index.d.ts +11 -12
- package/progress-steps/index.d.ts +16 -16
- package/progress-steps/numbered-step.js.flow +2 -2
- package/radio/index.d.ts +12 -15
- package/rating/index.d.ts +9 -12
- package/select/index.d.ts +33 -36
- package/select/select-component.js +72 -54
- package/select/select-component.js.flow +35 -30
- package/side-navigation/index.d.ts +11 -13
- package/skeleton/index.d.ts +1 -1
- package/slider/index.d.ts +17 -26
- package/snackbar/index.d.ts +8 -8
- package/spinner/index.d.ts +2 -2
- package/styles/index.d.ts +82 -2
- package/table/index.d.ts +16 -16
- package/table-grid/index.d.ts +6 -8
- package/table-semantic/index.d.ts +26 -32
- package/table-semantic/styled-components.js +33 -19
- package/table-semantic/styled-components.js.flow +12 -0
- package/table-semantic/table-builder.js +38 -22
- package/table-semantic/table-builder.js.flow +32 -17
- package/table-semantic/types.js.flow +1 -0
- package/tabs/index.d.ts +20 -23
- package/tabs-motion/index.d.ts +23 -23
- package/tag/index.d.ts +14 -18
- package/textarea/index.d.ts +11 -14
- package/textarea/textarea.js +15 -9
- package/textarea/textarea.js.flow +11 -5
- package/textarea/types.js.flow +1 -0
- package/theme.ts +36 -777
- package/themes/dark-theme/color-component-tokens.js +8 -0
- package/themes/dark-theme/color-component-tokens.js.flow +9 -0
- package/themes/index.d.ts +765 -0
- package/themes/light-theme/color-component-tokens.js +8 -0
- package/themes/light-theme/color-component-tokens.js.flow +9 -0
- package/themes/types.js.flow +9 -0
- package/timepicker/index.d.ts +5 -8
- package/timezonepicker/index.d.ts +5 -8
- package/toast/index.d.ts +26 -40
- package/tokens/index.d.ts +1 -1
- package/tooltip/index.d.ts +7 -9
- package/tree-view/index.d.ts +15 -19
- package/tree-view/tree-label.js +10 -2
- package/tree-view/tree-label.js.flow +4 -4
- package/typography/index.d.ts +37 -37
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledUserProfileInfoContainer = exports.StyledUserProfilePictureContainer = exports.StyledUserProfileTileContainer = exports.StyledUserMenuProfileListItem = exports.StyledUserMenuButton = exports.StyledSecondaryMenuContainer = exports.StyledMainMenuItem = exports.StyledPrimaryMenuContainer = exports.StyledSideMenuButton = exports.StyledAppName = exports.StyledSpacing = exports.StyledSubnavContainer = exports.StyledRoot = void 0;
|
|
6
|
+
exports.StyledDesktopMenu = exports.StyledDesktopMenuContainer = exports.StyledUserProfileInfoContainer = exports.StyledUserProfilePictureContainer = exports.StyledUserProfileTileContainer = exports.StyledUserMenuProfileListItem = exports.StyledUserMenuButton = exports.StyledSecondaryMenuContainer = exports.StyledMainMenuItem = exports.StyledPrimaryMenuContainer = exports.StyledSideMenuButton = exports.StyledAppName = exports.StyledSpacing = exports.StyledSubnavContainer = exports.StyledRoot = void 0;
|
|
7
7
|
|
|
8
8
|
var _index = require("../styles/index.js");
|
|
9
9
|
|
|
10
|
+
var _responsiveHelpers = require("../helpers/responsive-helpers.js");
|
|
11
|
+
|
|
10
12
|
var _index2 = require("../menu/index.js");
|
|
11
13
|
|
|
12
14
|
var _constants = require("./constants.js");
|
|
@@ -50,22 +52,50 @@ var StyledButton = (0, _index.styled)('button', function (_ref) {
|
|
|
50
52
|
StyledButton.displayName = "StyledButton";
|
|
51
53
|
var StyledRoot = (0, _index.styled)('div', function (props) {
|
|
52
54
|
var $theme = props.$theme;
|
|
53
|
-
|
|
55
|
+
var mediaQueries = (0, _responsiveHelpers.getMediaQueries)($theme.breakpoints);
|
|
56
|
+
var breakpoints = Object.values($theme.breakpoints).sort();
|
|
57
|
+
var margins = [];
|
|
58
|
+
|
|
59
|
+
if (Array.isArray($theme.grid.margins)) {
|
|
60
|
+
for (var i = 0; i < breakpoints.length; i++) {
|
|
61
|
+
var margin = $theme.grid.margins[i];
|
|
62
|
+
|
|
63
|
+
if (margin == null) {
|
|
64
|
+
margins.push($theme.grid.margins[$theme.grid.margins.length - 1]);
|
|
65
|
+
} else {
|
|
66
|
+
margins.push(margin);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
for (var _i = 0; _i < breakpoints.length; _i++) {
|
|
71
|
+
margins.push($theme.grid.margins);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var style = _objectSpread(_objectSpread({}, $theme.typography.font300), {}, {
|
|
54
76
|
boxSizing: 'border-box',
|
|
55
77
|
backgroundColor: $theme.colors.backgroundPrimary,
|
|
56
|
-
|
|
57
|
-
|
|
78
|
+
borderBottomWidth: '1px',
|
|
79
|
+
borderBottomStyle: 'solid',
|
|
80
|
+
borderBottomColor: "".concat($theme.colors.borderOpaque),
|
|
81
|
+
paddingInlineStart: margins[0] + 'px',
|
|
82
|
+
paddingInlineEnd: margins[0] + 'px'
|
|
58
83
|
});
|
|
84
|
+
|
|
85
|
+
for (var _i2 = 1; _i2 < mediaQueries.length; _i2++) {
|
|
86
|
+
var _margin = Array.isArray($theme.grid.margins) ? $theme.grid.margins[_i2] : $theme.grid.margins;
|
|
87
|
+
|
|
88
|
+
style[mediaQueries[_i2]] = {
|
|
89
|
+
paddingInlineStart: _margin + 'px',
|
|
90
|
+
paddingInlineEnd: _margin + 'px'
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return style;
|
|
59
95
|
});
|
|
60
96
|
exports.StyledRoot = StyledRoot;
|
|
61
97
|
StyledRoot.displayName = "StyledRoot";
|
|
62
|
-
var StyledSubnavContainer = (0, _index.styled)('div',
|
|
63
|
-
var $theme = _ref2.$theme;
|
|
64
|
-
return {
|
|
65
|
-
boxSizing: 'border-box',
|
|
66
|
-
boxShadow: '0px -1px 0px rgba(0, 0, 0, 0.08)'
|
|
67
|
-
};
|
|
68
|
-
});
|
|
98
|
+
var StyledSubnavContainer = (0, _index.styled)('div', {});
|
|
69
99
|
exports.StyledSubnavContainer = StyledSubnavContainer;
|
|
70
100
|
StyledSubnavContainer.displayName = "StyledSubnavContainer";
|
|
71
101
|
var StyledSpacing = (0, _index.styled)('div', function (props) {
|
|
@@ -84,8 +114,8 @@ var StyledSpacing = (0, _index.styled)('div', function (props) {
|
|
|
84
114
|
});
|
|
85
115
|
exports.StyledSpacing = StyledSpacing;
|
|
86
116
|
StyledSpacing.displayName = "StyledSpacing";
|
|
87
|
-
var StyledAppName = (0, _index.styled)('div', function (
|
|
88
|
-
var $theme =
|
|
117
|
+
var StyledAppName = (0, _index.styled)('div', function (_ref3) {
|
|
118
|
+
var $theme = _ref3.$theme;
|
|
89
119
|
return _objectSpread(_objectSpread({}, $theme.typography.font550), {}, _defineProperty({
|
|
90
120
|
color: $theme.colors.primary,
|
|
91
121
|
textDecoration: 'none'
|
|
@@ -93,8 +123,8 @@ var StyledAppName = (0, _index.styled)('div', function (_ref4) {
|
|
|
93
123
|
});
|
|
94
124
|
exports.StyledAppName = StyledAppName;
|
|
95
125
|
StyledAppName.displayName = "StyledAppName";
|
|
96
|
-
var StyledSideMenuButton = (0, _index.withStyle)(StyledButton, function (
|
|
97
|
-
var $theme =
|
|
126
|
+
var StyledSideMenuButton = (0, _index.withStyle)(StyledButton, function (_ref4) {
|
|
127
|
+
var $theme = _ref4.$theme;
|
|
98
128
|
return _objectSpread(_objectSpread({}, $theme.direction === 'rtl' ? {
|
|
99
129
|
marginLeft: $theme.sizing.scale600
|
|
100
130
|
} : {
|
|
@@ -108,16 +138,18 @@ var StyledSideMenuButton = (0, _index.withStyle)(StyledButton, function (_ref5)
|
|
|
108
138
|
});
|
|
109
139
|
exports.StyledSideMenuButton = StyledSideMenuButton;
|
|
110
140
|
StyledSideMenuButton.displayName = "StyledSideMenuButton";
|
|
111
|
-
var StyledPrimaryMenuContainer = (0, _index.styled)('div', function (
|
|
112
|
-
var $theme =
|
|
141
|
+
var StyledPrimaryMenuContainer = (0, _index.styled)('div', function (_ref5) {
|
|
142
|
+
var $theme = _ref5.$theme;
|
|
113
143
|
return {
|
|
114
144
|
boxSizing: 'border-box',
|
|
115
145
|
height: '100%',
|
|
116
146
|
display: 'flex',
|
|
117
147
|
flexDirection: 'row',
|
|
148
|
+
flexGrow: 1,
|
|
118
149
|
flexWrap: 'nowrap',
|
|
119
150
|
justifyContent: 'flex-end',
|
|
120
|
-
alignItems: 'stretch'
|
|
151
|
+
alignItems: 'stretch',
|
|
152
|
+
paddingInlineEnd: $theme.sizing.scale1000
|
|
121
153
|
};
|
|
122
154
|
});
|
|
123
155
|
exports.StyledPrimaryMenuContainer = StyledPrimaryMenuContainer;
|
|
@@ -163,8 +195,8 @@ var StyledMainMenuItem = (0, _index.styled)('div', function (props) {
|
|
|
163
195
|
});
|
|
164
196
|
exports.StyledMainMenuItem = StyledMainMenuItem;
|
|
165
197
|
StyledMainMenuItem.displayName = "StyledMainMenuItem";
|
|
166
|
-
var StyledSecondaryMenuContainer = (0, _index.styled)('div', function (
|
|
167
|
-
var $theme =
|
|
198
|
+
var StyledSecondaryMenuContainer = (0, _index.styled)('div', function (_ref6) {
|
|
199
|
+
var $theme = _ref6.$theme;
|
|
168
200
|
return {
|
|
169
201
|
boxSizing: 'border-box',
|
|
170
202
|
height: '100%',
|
|
@@ -172,6 +204,8 @@ var StyledSecondaryMenuContainer = (0, _index.styled)('div', function (_ref7) {
|
|
|
172
204
|
flexDirection: 'row',
|
|
173
205
|
flexWrap: 'nowrap',
|
|
174
206
|
justifyContent: 'flex-start',
|
|
207
|
+
margin: 'auto',
|
|
208
|
+
maxWidth: "".concat($theme.grid.maxWidth, "px"),
|
|
175
209
|
alignItems: 'stretch',
|
|
176
210
|
overflow: 'auto'
|
|
177
211
|
};
|
|
@@ -180,8 +214,8 @@ exports.StyledSecondaryMenuContainer = StyledSecondaryMenuContainer;
|
|
|
180
214
|
StyledSecondaryMenuContainer.displayName = "StyledSecondaryMenuContainer";
|
|
181
215
|
var StyledUserMenuButton = StyledButton;
|
|
182
216
|
exports.StyledUserMenuButton = StyledUserMenuButton;
|
|
183
|
-
var StyledUserMenuProfileListItem = (0, _index.withStyle)(_index2.StyledListItem, function (
|
|
184
|
-
var $theme =
|
|
217
|
+
var StyledUserMenuProfileListItem = (0, _index.withStyle)(_index2.StyledListItem, function (_ref7) {
|
|
218
|
+
var $theme = _ref7.$theme;
|
|
185
219
|
return _objectSpread({
|
|
186
220
|
paddingTop: '0',
|
|
187
221
|
paddingBottom: '0'
|
|
@@ -193,8 +227,8 @@ var StyledUserMenuProfileListItem = (0, _index.withStyle)(_index2.StyledListItem
|
|
|
193
227
|
});
|
|
194
228
|
exports.StyledUserMenuProfileListItem = StyledUserMenuProfileListItem;
|
|
195
229
|
StyledUserMenuProfileListItem.displayName = "StyledUserMenuProfileListItem";
|
|
196
|
-
var StyledUserProfileTileContainer = (0, _index.styled)('div', function (
|
|
197
|
-
var $theme =
|
|
230
|
+
var StyledUserProfileTileContainer = (0, _index.styled)('div', function (_ref8) {
|
|
231
|
+
var $theme = _ref8.$theme;
|
|
198
232
|
return {
|
|
199
233
|
boxSizing: 'border-box',
|
|
200
234
|
height: '100%',
|
|
@@ -208,8 +242,8 @@ var StyledUserProfileTileContainer = (0, _index.styled)('div', function (_ref9)
|
|
|
208
242
|
});
|
|
209
243
|
exports.StyledUserProfileTileContainer = StyledUserProfileTileContainer;
|
|
210
244
|
StyledUserProfileTileContainer.displayName = "StyledUserProfileTileContainer";
|
|
211
|
-
var StyledUserProfilePictureContainer = (0, _index.styled)('div', function (
|
|
212
|
-
var $theme =
|
|
245
|
+
var StyledUserProfilePictureContainer = (0, _index.styled)('div', function (_ref9) {
|
|
246
|
+
var $theme = _ref9.$theme;
|
|
213
247
|
return _objectSpread({}, $theme.direction === 'rtl' ? {
|
|
214
248
|
marginLeft: $theme.sizing.scale600
|
|
215
249
|
} : {
|
|
@@ -218,12 +252,32 @@ var StyledUserProfilePictureContainer = (0, _index.styled)('div', function (_ref
|
|
|
218
252
|
});
|
|
219
253
|
exports.StyledUserProfilePictureContainer = StyledUserProfilePictureContainer;
|
|
220
254
|
StyledUserProfilePictureContainer.displayName = "StyledUserProfilePictureContainer";
|
|
221
|
-
var StyledUserProfileInfoContainer = (0, _index.styled)('div', function (
|
|
222
|
-
var $theme =
|
|
255
|
+
var StyledUserProfileInfoContainer = (0, _index.styled)('div', function (_ref10) {
|
|
256
|
+
var $theme = _ref10.$theme;
|
|
223
257
|
return {
|
|
224
258
|
boxSizing: 'border-box',
|
|
225
259
|
alignSelf: 'center'
|
|
226
260
|
};
|
|
227
261
|
});
|
|
228
262
|
exports.StyledUserProfileInfoContainer = StyledUserProfileInfoContainer;
|
|
229
|
-
StyledUserProfileInfoContainer.displayName = "StyledUserProfileInfoContainer";
|
|
263
|
+
StyledUserProfileInfoContainer.displayName = "StyledUserProfileInfoContainer";
|
|
264
|
+
var StyledDesktopMenuContainer = (0, _index.styled)('div', function (_ref11) {
|
|
265
|
+
var $theme = _ref11.$theme;
|
|
266
|
+
return {};
|
|
267
|
+
});
|
|
268
|
+
exports.StyledDesktopMenuContainer = StyledDesktopMenuContainer;
|
|
269
|
+
StyledDesktopMenuContainer.displayName = "StyledDesktopMenuContainer";
|
|
270
|
+
var StyledDesktopMenu = (0, _index.styled)('div', function (_ref12) {
|
|
271
|
+
var $theme = _ref12.$theme;
|
|
272
|
+
return {
|
|
273
|
+
alignItems: 'center',
|
|
274
|
+
display: 'flex',
|
|
275
|
+
justifyContent: 'space-between',
|
|
276
|
+
margin: 'auto',
|
|
277
|
+
maxWidth: "".concat($theme.grid.maxWidth, "px"),
|
|
278
|
+
paddingBlockStart: '18px',
|
|
279
|
+
paddingBlockEnd: '18px'
|
|
280
|
+
};
|
|
281
|
+
});
|
|
282
|
+
exports.StyledDesktopMenu = StyledDesktopMenu;
|
|
283
|
+
StyledDesktopMenu.displayName = "StyledDesktopMenu";
|
|
@@ -7,6 +7,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
7
7
|
// @flow
|
|
8
8
|
|
|
9
9
|
import { styled, withStyle } from '../styles/index.js';
|
|
10
|
+
import { getMediaQueries } from '../helpers/responsive-helpers.js';
|
|
10
11
|
import { StyledListItem } from '../menu/index.js';
|
|
11
12
|
import { KIND } from './constants.js';
|
|
12
13
|
|
|
@@ -42,22 +43,51 @@ const StyledButton = styled<{ $isFocusVisible: boolean }>(
|
|
|
42
43
|
|
|
43
44
|
export const StyledRoot = styled<{}>('div', (props) => {
|
|
44
45
|
const { $theme } = props;
|
|
45
|
-
|
|
46
|
+
const mediaQueries = getMediaQueries($theme.breakpoints);
|
|
47
|
+
const breakpoints = Object.values($theme.breakpoints).sort();
|
|
48
|
+
const margins = [];
|
|
49
|
+
if (Array.isArray($theme.grid.margins)) {
|
|
50
|
+
for (let i = 0; i < breakpoints.length; i++) {
|
|
51
|
+
const margin = $theme.grid.margins[i];
|
|
52
|
+
if (margin == null) {
|
|
53
|
+
margins.push($theme.grid.margins[$theme.grid.margins.length - 1]);
|
|
54
|
+
} else {
|
|
55
|
+
margins.push(margin);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
for (let i = 0; i < breakpoints.length; i++) {
|
|
60
|
+
margins.push($theme.grid.margins);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const style = {
|
|
46
65
|
...$theme.typography.font300,
|
|
47
66
|
boxSizing: 'border-box',
|
|
48
67
|
backgroundColor: $theme.colors.backgroundPrimary,
|
|
49
|
-
|
|
50
|
-
|
|
68
|
+
borderBottomWidth: '1px',
|
|
69
|
+
borderBottomStyle: 'solid',
|
|
70
|
+
borderBottomColor: `${$theme.colors.borderOpaque}`,
|
|
71
|
+
paddingInlineStart: margins[0] + 'px',
|
|
72
|
+
paddingInlineEnd: margins[0] + 'px',
|
|
51
73
|
};
|
|
52
|
-
});
|
|
53
74
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
75
|
+
for (let i = 1; i < mediaQueries.length; i++) {
|
|
76
|
+
const margin = Array.isArray($theme.grid.margins)
|
|
77
|
+
? $theme.grid.margins[i]
|
|
78
|
+
: $theme.grid.margins;
|
|
79
|
+
|
|
80
|
+
style[mediaQueries[i]] = {
|
|
81
|
+
paddingInlineStart: margin + 'px',
|
|
82
|
+
paddingInlineEnd: margin + 'px',
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return style;
|
|
59
87
|
});
|
|
60
88
|
|
|
89
|
+
export const StyledSubnavContainer = styled('div', {});
|
|
90
|
+
|
|
61
91
|
export const StyledSpacing = styled<{}>('div', (props) => {
|
|
62
92
|
const { $theme } = props;
|
|
63
93
|
return {
|
|
@@ -102,9 +132,11 @@ export const StyledPrimaryMenuContainer = styled<{}>('div', ({ $theme }) => {
|
|
|
102
132
|
height: '100%',
|
|
103
133
|
display: 'flex',
|
|
104
134
|
flexDirection: 'row',
|
|
135
|
+
flexGrow: 1,
|
|
105
136
|
flexWrap: 'nowrap',
|
|
106
137
|
justifyContent: 'flex-end',
|
|
107
138
|
alignItems: 'stretch',
|
|
139
|
+
paddingInlineEnd: $theme.sizing.scale1000,
|
|
108
140
|
};
|
|
109
141
|
});
|
|
110
142
|
|
|
@@ -155,6 +187,8 @@ export const StyledSecondaryMenuContainer = styled<{}>('div', ({ $theme }) => {
|
|
|
155
187
|
flexDirection: 'row',
|
|
156
188
|
flexWrap: 'nowrap',
|
|
157
189
|
justifyContent: 'flex-start',
|
|
190
|
+
margin: 'auto',
|
|
191
|
+
maxWidth: `${$theme.grid.maxWidth}px`,
|
|
158
192
|
alignItems: 'stretch',
|
|
159
193
|
overflow: 'auto',
|
|
160
194
|
};
|
|
@@ -199,6 +233,22 @@ export const StyledUserProfileInfoContainer = styled<{}>('div', ({ $theme }) =>
|
|
|
199
233
|
};
|
|
200
234
|
});
|
|
201
235
|
|
|
236
|
+
export const StyledDesktopMenuContainer = styled<{}>('div', ({ $theme }) => {
|
|
237
|
+
return {};
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
export const StyledDesktopMenu = styled<{}>('div', ({ $theme }) => {
|
|
241
|
+
return {
|
|
242
|
+
alignItems: 'center',
|
|
243
|
+
display: 'flex',
|
|
244
|
+
justifyContent: 'space-between',
|
|
245
|
+
margin: 'auto',
|
|
246
|
+
maxWidth: `${$theme.grid.maxWidth}px`,
|
|
247
|
+
paddingBlockStart: '18px',
|
|
248
|
+
paddingBlockEnd: '18px',
|
|
249
|
+
};
|
|
250
|
+
});
|
|
251
|
+
|
|
202
252
|
declare var __DEV__: boolean;
|
|
203
253
|
declare var __NODE__: boolean;
|
|
204
254
|
declare var __BROWSER__: boolean;
|
|
@@ -14,6 +14,8 @@ import type { OverrideT } from '../helpers/overrides.js';
|
|
|
14
14
|
export type OverridesT = {
|
|
15
15
|
Root?: OverrideT,
|
|
16
16
|
AppName?: OverrideT,
|
|
17
|
+
DesktopMenu?: OverrideT,
|
|
18
|
+
DesktopMenuContainer?: OverrideT,
|
|
17
19
|
MainMenuItem?: OverrideT,
|
|
18
20
|
PrimaryMenuContainer?: OverrideT,
|
|
19
21
|
ProfileTileContainer?: OverrideT,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {StyletronComponent} from 'styletron-react';
|
|
3
|
-
import {Override} from '../overrides';
|
|
4
2
|
|
|
5
|
-
import {BlockProps} from '../block';
|
|
3
|
+
import { BlockProps } from '../block';
|
|
6
4
|
|
|
7
5
|
export interface AspectRatioBoxProps extends BlockProps {
|
|
8
6
|
/** Aspect ratio is width divided by height. */
|
|
@@ -10,4 +8,4 @@ export interface AspectRatioBoxProps extends BlockProps {
|
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
export class AspectRatioBox extends React.Component<AspectRatioBoxProps> {}
|
|
13
|
-
export const AspectRatioBoxBody: React.FC<BlockProps>;
|
|
11
|
+
export declare const AspectRatioBoxBody: React.FC<BlockProps>;
|
package/avatar/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {StyletronComponent} from 'styletron-react';
|
|
3
|
-
import {Override} from '../overrides';
|
|
2
|
+
import { StyletronComponent } from 'styletron-react';
|
|
3
|
+
import { Override } from '../overrides';
|
|
4
4
|
|
|
5
5
|
export interface AvatarOverrides<T> {
|
|
6
6
|
Avatar?: Override<T>;
|
|
@@ -20,14 +20,8 @@ export interface AvatarProps {
|
|
|
20
20
|
src?: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export
|
|
24
|
-
noImageAvailable: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class Avatar extends React.Component<AvatarProps, AvatarState> {
|
|
28
|
-
handleError(): void;
|
|
29
|
-
}
|
|
23
|
+
export declare const Avatar: React.FC<AvatarProps>;
|
|
30
24
|
|
|
31
|
-
export const StyledAvatar: StyletronComponent<any>;
|
|
32
|
-
export const StyledInitials: StyletronComponent<any>;
|
|
33
|
-
export const StyledRoot: StyletronComponent<any>;
|
|
25
|
+
export declare const StyledAvatar: StyletronComponent<any>;
|
|
26
|
+
export declare const StyledInitials: StyletronComponent<any>;
|
|
27
|
+
export declare const StyledRoot: StyletronComponent<any>;
|
package/badge/badge.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _overrides = require("../helpers/overrides.js");
|
|
13
|
+
|
|
14
|
+
var _styledComponents = require("./styled-components.js");
|
|
15
|
+
|
|
16
|
+
var _constants = require("./constants.js");
|
|
17
|
+
|
|
18
|
+
var _utils = require("./utils.js");
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
|
|
30
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
+
|
|
32
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
+
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
var Badge = function Badge(_ref) {
|
|
39
|
+
var children = _ref.children,
|
|
40
|
+
content = _ref.content,
|
|
41
|
+
color = _ref.color,
|
|
42
|
+
_ref$shape = _ref.shape,
|
|
43
|
+
shape = _ref$shape === void 0 ? _constants.SHAPE.rectangle : _ref$shape,
|
|
44
|
+
_ref$placement = _ref.placement,
|
|
45
|
+
placement = _ref$placement === void 0 ? _constants.PLACEMENT.topRight : _ref$placement,
|
|
46
|
+
hierarchy = _ref.hierarchy,
|
|
47
|
+
horizontalOffset = _ref.horizontalOffset,
|
|
48
|
+
verticalOffset = _ref.verticalOffset,
|
|
49
|
+
hidden = _ref.hidden,
|
|
50
|
+
_ref$overrides = _ref.overrides,
|
|
51
|
+
overrides = _ref$overrides === void 0 ? {} : _ref$overrides;
|
|
52
|
+
|
|
53
|
+
var _getOverrides = (0, _overrides.getOverrides)(overrides.Badge, _styledComponents.StyledBadge),
|
|
54
|
+
_getOverrides2 = _slicedToArray(_getOverrides, 2),
|
|
55
|
+
Badge = _getOverrides2[0],
|
|
56
|
+
badgeProps = _getOverrides2[1];
|
|
57
|
+
|
|
58
|
+
var _getOverrides3 = (0, _overrides.getOverrides)(overrides.Root, _styledComponents.StyledRoot),
|
|
59
|
+
_getOverrides4 = _slicedToArray(_getOverrides3, 2),
|
|
60
|
+
Root = _getOverrides4[0],
|
|
61
|
+
rootProps = _getOverrides4[1];
|
|
62
|
+
|
|
63
|
+
var _getOverrides5 = (0, _overrides.getOverrides)(overrides.Positioner, _styledComponents.StyledPositioner),
|
|
64
|
+
_getOverrides6 = _slicedToArray(_getOverrides5, 2),
|
|
65
|
+
Positioner = _getOverrides6[0],
|
|
66
|
+
positionerProps = _getOverrides6[1];
|
|
67
|
+
|
|
68
|
+
var anchor = (0, _utils.getAnchorFromChildren)(children);
|
|
69
|
+
var VALID_RECT_PLACEMENTS = [_constants.PLACEMENT.topLeft, _constants.PLACEMENT.topRight, _constants.PLACEMENT.bottomRight, _constants.PLACEMENT.bottomLeft];
|
|
70
|
+
|
|
71
|
+
if (process.env.NODE_ENV !== "production") {
|
|
72
|
+
if (shape === _constants.SHAPE.rectangle && !VALID_RECT_PLACEMENTS.includes(placement)) {
|
|
73
|
+
console.warn('Rectangle badges should only be placed in a corner or used inline');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (shape === _constants.SHAPE.rectangle && hierarchy === _constants.HIERARCHY.secondary && anchor) {
|
|
77
|
+
console.warn('Secondary badges should not be positioned. Use the inline version of this badge instead.');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (shape === _constants.SHAPE.pill && hierarchy === _constants.HIERARCHY.secondary) {
|
|
81
|
+
console.warn('Pill badges should only be used with primary hierarchy');
|
|
82
|
+
}
|
|
83
|
+
} // If there's no anchor, render the badge inline
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
if (!anchor) {
|
|
87
|
+
return /*#__PURE__*/React.createElement(Badge, _extends({
|
|
88
|
+
$hierarchy: hierarchy,
|
|
89
|
+
$shape: shape,
|
|
90
|
+
$color: color,
|
|
91
|
+
$hidden: hidden
|
|
92
|
+
}, badgeProps), content);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return /*#__PURE__*/React.createElement(Root, rootProps, anchor, /*#__PURE__*/React.createElement(Positioner, _extends({
|
|
96
|
+
$horizontalOffset: horizontalOffset,
|
|
97
|
+
$verticalOffset: verticalOffset,
|
|
98
|
+
$placement: placement,
|
|
99
|
+
$role: _constants.ROLE.badge
|
|
100
|
+
}, positionerProps), /*#__PURE__*/React.createElement(Badge, _extends({
|
|
101
|
+
$hierarchy: hierarchy,
|
|
102
|
+
$shape: shape,
|
|
103
|
+
$color: color,
|
|
104
|
+
$hidden: hidden
|
|
105
|
+
}, badgeProps), content)));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var _default = Badge;
|
|
109
|
+
exports.default = _default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) Uber Technologies, Inc.
|
|
3
|
+
|
|
4
|
+
This source code is licensed under the MIT license found in the
|
|
5
|
+
LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
// @flow
|
|
8
|
+
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { getOverrides } from '../helpers/overrides.js';
|
|
11
|
+
import { StyledBadge, StyledRoot, StyledPositioner } from './styled-components.js';
|
|
12
|
+
import type { BadgePropsT } from './types.js';
|
|
13
|
+
import { PLACEMENT, ROLE, SHAPE, HIERARCHY } from './constants.js';
|
|
14
|
+
import { getAnchorFromChildren } from './utils.js';
|
|
15
|
+
|
|
16
|
+
const Badge = ({
|
|
17
|
+
children,
|
|
18
|
+
content,
|
|
19
|
+
color,
|
|
20
|
+
shape = SHAPE.rectangle,
|
|
21
|
+
placement = PLACEMENT.topRight,
|
|
22
|
+
hierarchy,
|
|
23
|
+
horizontalOffset,
|
|
24
|
+
verticalOffset,
|
|
25
|
+
hidden,
|
|
26
|
+
overrides = {},
|
|
27
|
+
}: BadgePropsT) => {
|
|
28
|
+
const [Badge, badgeProps] = getOverrides(overrides.Badge, StyledBadge);
|
|
29
|
+
const [Root, rootProps] = getOverrides(overrides.Root, StyledRoot);
|
|
30
|
+
const [Positioner, positionerProps] = getOverrides(overrides.Positioner, StyledPositioner);
|
|
31
|
+
|
|
32
|
+
const anchor = getAnchorFromChildren(children);
|
|
33
|
+
|
|
34
|
+
const VALID_RECT_PLACEMENTS = [
|
|
35
|
+
PLACEMENT.topLeft,
|
|
36
|
+
PLACEMENT.topRight,
|
|
37
|
+
PLACEMENT.bottomRight,
|
|
38
|
+
PLACEMENT.bottomLeft,
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
if (__DEV__) {
|
|
42
|
+
if (shape === SHAPE.rectangle && !VALID_RECT_PLACEMENTS.includes(placement)) {
|
|
43
|
+
console.warn('Rectangle badges should only be placed in a corner or used inline');
|
|
44
|
+
}
|
|
45
|
+
if (shape === SHAPE.rectangle && hierarchy === HIERARCHY.secondary && anchor) {
|
|
46
|
+
console.warn(
|
|
47
|
+
'Secondary badges should not be positioned. Use the inline version of this badge instead.'
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
if (shape === SHAPE.pill && hierarchy === HIERARCHY.secondary) {
|
|
51
|
+
console.warn('Pill badges should only be used with primary hierarchy');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// If there's no anchor, render the badge inline
|
|
56
|
+
if (!anchor) {
|
|
57
|
+
return (
|
|
58
|
+
<Badge $hierarchy={hierarchy} $shape={shape} $color={color} $hidden={hidden} {...badgeProps}>
|
|
59
|
+
{content}
|
|
60
|
+
</Badge>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Root {...rootProps}>
|
|
66
|
+
{anchor}
|
|
67
|
+
<Positioner
|
|
68
|
+
$horizontalOffset={horizontalOffset}
|
|
69
|
+
$verticalOffset={verticalOffset}
|
|
70
|
+
$placement={placement}
|
|
71
|
+
$role={ROLE.badge}
|
|
72
|
+
{...positionerProps}
|
|
73
|
+
>
|
|
74
|
+
<Badge
|
|
75
|
+
$hierarchy={hierarchy}
|
|
76
|
+
$shape={shape}
|
|
77
|
+
$color={color}
|
|
78
|
+
$hidden={hidden}
|
|
79
|
+
{...badgeProps}
|
|
80
|
+
>
|
|
81
|
+
{content}
|
|
82
|
+
</Badge>
|
|
83
|
+
</Positioner>
|
|
84
|
+
</Root>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
export default Badge;
|
|
88
|
+
|
|
89
|
+
declare var __DEV__: boolean;
|
|
90
|
+
declare var __NODE__: boolean;
|
|
91
|
+
declare var __BROWSER__: boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ROLE = exports.PLACEMENT = exports.COLOR = exports.SHAPE = exports.HIERARCHY = void 0;
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Copyright (c) Uber Technologies, Inc.
|
|
10
|
+
|
|
11
|
+
This source code is licensed under the MIT license found in the
|
|
12
|
+
LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
var HIERARCHY = Object.freeze({
|
|
15
|
+
primary: 'primary',
|
|
16
|
+
secondary: 'secondary'
|
|
17
|
+
});
|
|
18
|
+
exports.HIERARCHY = HIERARCHY;
|
|
19
|
+
var SHAPE = Object.freeze({
|
|
20
|
+
pill: 'pill',
|
|
21
|
+
rectangle: 'rectangle'
|
|
22
|
+
});
|
|
23
|
+
exports.SHAPE = SHAPE;
|
|
24
|
+
var COLOR = Object.freeze({
|
|
25
|
+
accent: 'accent',
|
|
26
|
+
primary: 'primary',
|
|
27
|
+
positive: 'positive',
|
|
28
|
+
negative: 'negative',
|
|
29
|
+
warning: 'warning'
|
|
30
|
+
});
|
|
31
|
+
exports.COLOR = COLOR;
|
|
32
|
+
var PLACEMENT = Object.freeze({
|
|
33
|
+
topLeft: 'topLeft',
|
|
34
|
+
topRight: 'topRight',
|
|
35
|
+
bottomRight: 'bottomRight',
|
|
36
|
+
bottomLeft: 'bottomLeft',
|
|
37
|
+
topLeftEdge: 'topLeftEdge',
|
|
38
|
+
topEdge: 'topEdge',
|
|
39
|
+
topRightEdge: 'topRightEdge',
|
|
40
|
+
bottomRightEdge: 'bottomRightEdge',
|
|
41
|
+
bottomEdge: 'bottomEdge',
|
|
42
|
+
bottomLeftEdge: 'bottomLeftEdge',
|
|
43
|
+
leftTopEdge: 'leftTopEdge',
|
|
44
|
+
rightTopEdge: 'rightTopEdge',
|
|
45
|
+
rightBottomEdge: 'rightBottomEdge',
|
|
46
|
+
leftBottomEdge: 'leftBottomEdge'
|
|
47
|
+
});
|
|
48
|
+
exports.PLACEMENT = PLACEMENT;
|
|
49
|
+
var ROLE = Object.freeze({
|
|
50
|
+
badge: 'badge',
|
|
51
|
+
notificationCircle: 'notificationCircle',
|
|
52
|
+
hintDot: 'hintDot'
|
|
53
|
+
});
|
|
54
|
+
exports.ROLE = ROLE;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) Uber Technologies, Inc.
|
|
3
|
+
|
|
4
|
+
This source code is licensed under the MIT license found in the
|
|
5
|
+
LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
// @flow
|
|
8
|
+
|
|
9
|
+
export const HIERARCHY = Object.freeze({
|
|
10
|
+
primary: 'primary',
|
|
11
|
+
secondary: 'secondary',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const SHAPE = Object.freeze({
|
|
15
|
+
pill: 'pill',
|
|
16
|
+
rectangle: 'rectangle',
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const COLOR = Object.freeze({
|
|
20
|
+
accent: 'accent',
|
|
21
|
+
primary: 'primary',
|
|
22
|
+
positive: 'positive',
|
|
23
|
+
negative: 'negative',
|
|
24
|
+
warning: 'warning',
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const PLACEMENT = Object.freeze({
|
|
28
|
+
topLeft: 'topLeft',
|
|
29
|
+
topRight: 'topRight',
|
|
30
|
+
bottomRight: 'bottomRight',
|
|
31
|
+
bottomLeft: 'bottomLeft',
|
|
32
|
+
topLeftEdge: 'topLeftEdge',
|
|
33
|
+
topEdge: 'topEdge',
|
|
34
|
+
topRightEdge: 'topRightEdge',
|
|
35
|
+
bottomRightEdge: 'bottomRightEdge',
|
|
36
|
+
bottomEdge: 'bottomEdge',
|
|
37
|
+
bottomLeftEdge: 'bottomLeftEdge',
|
|
38
|
+
leftTopEdge: 'leftTopEdge',
|
|
39
|
+
rightTopEdge: 'rightTopEdge',
|
|
40
|
+
rightBottomEdge: 'rightBottomEdge',
|
|
41
|
+
leftBottomEdge: 'leftBottomEdge',
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const ROLE = Object.freeze({
|
|
45
|
+
badge: 'badge',
|
|
46
|
+
notificationCircle: 'notificationCircle',
|
|
47
|
+
hintDot: 'hintDot',
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
declare var __DEV__: boolean;
|
|
51
|
+
declare var __NODE__: boolean;
|
|
52
|
+
declare var __BROWSER__: boolean;
|