baseui 0.0.0-next-af43adc → 0.0.0-next-73ffc7a

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.
@@ -7,6 +7,8 @@ exports.StyledDesktopMenu = exports.StyledDesktopMenuContainer = exports.StyledU
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,10 +52,46 @@ 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
- return _objectSpread(_objectSpread({}, $theme.typography.font300), {}, {
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
- backgroundColor: $theme.colors.backgroundPrimary
77
+ backgroundColor: $theme.colors.backgroundPrimary,
78
+ borderBottomWidth: '1px',
79
+ borderBottomStyle: 'solid',
80
+ borderBottomColor: "".concat($theme.colors.borderOpaque),
81
+ paddingInlineStart: margins[0] + 'px',
82
+ paddingInlineEnd: margins[0] + 'px'
56
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;
57
95
  });
58
96
  exports.StyledRoot = StyledRoot;
59
97
  StyledRoot.displayName = "StyledRoot";
@@ -167,7 +205,7 @@ var StyledSecondaryMenuContainer = (0, _index.styled)('div', function (_ref6) {
167
205
  flexWrap: 'nowrap',
168
206
  justifyContent: 'flex-start',
169
207
  margin: 'auto',
170
- maxWidth: "".concat($theme.breakpoints.large, "px"),
208
+ maxWidth: "".concat($theme.grid.maxWidth, "px"),
171
209
  alignItems: 'stretch',
172
210
  overflow: 'auto'
173
211
  };
@@ -225,11 +263,7 @@ exports.StyledUserProfileInfoContainer = StyledUserProfileInfoContainer;
225
263
  StyledUserProfileInfoContainer.displayName = "StyledUserProfileInfoContainer";
226
264
  var StyledDesktopMenuContainer = (0, _index.styled)('div', function (_ref11) {
227
265
  var $theme = _ref11.$theme;
228
- return {
229
- borderBottomWidth: '1px',
230
- borderBottomStyle: 'solid',
231
- borderBottomColor: "".concat($theme.colors.borderOpaque)
232
- };
266
+ return {};
233
267
  });
234
268
  exports.StyledDesktopMenuContainer = StyledDesktopMenuContainer;
235
269
  StyledDesktopMenuContainer.displayName = "StyledDesktopMenuContainer";
@@ -240,7 +274,7 @@ var StyledDesktopMenu = (0, _index.styled)('div', function (_ref12) {
240
274
  display: 'flex',
241
275
  justifyContent: 'space-between',
242
276
  margin: 'auto',
243
- maxWidth: "".concat($theme.breakpoints.large, "px"),
277
+ maxWidth: "".concat($theme.grid.maxWidth, "px"),
244
278
  paddingBlockStart: '18px',
245
279
  paddingBlockEnd: '18px'
246
280
  };
@@ -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,11 +43,47 @@ const StyledButton = styled<{ $isFocusVisible: boolean }>(
42
43
 
43
44
  export const StyledRoot = styled<{}>('div', (props) => {
44
45
  const { $theme } = props;
45
- return {
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,
68
+ borderBottomWidth: '1px',
69
+ borderBottomStyle: 'solid',
70
+ borderBottomColor: `${$theme.colors.borderOpaque}`,
71
+ paddingInlineStart: margins[0] + 'px',
72
+ paddingInlineEnd: margins[0] + 'px',
49
73
  };
74
+
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;
50
87
  });
51
88
 
52
89
  export const StyledSubnavContainer = styled('div', {});
@@ -151,7 +188,7 @@ export const StyledSecondaryMenuContainer = styled<{}>('div', ({ $theme }) => {
151
188
  flexWrap: 'nowrap',
152
189
  justifyContent: 'flex-start',
153
190
  margin: 'auto',
154
- maxWidth: `${$theme.breakpoints.large}px`,
191
+ maxWidth: `${$theme.grid.maxWidth}px`,
155
192
  alignItems: 'stretch',
156
193
  overflow: 'auto',
157
194
  };
@@ -197,11 +234,7 @@ export const StyledUserProfileInfoContainer = styled<{}>('div', ({ $theme }) =>
197
234
  });
198
235
 
199
236
  export const StyledDesktopMenuContainer = styled<{}>('div', ({ $theme }) => {
200
- return {
201
- borderBottomWidth: '1px',
202
- borderBottomStyle: 'solid',
203
- borderBottomColor: `${$theme.colors.borderOpaque}`,
204
- };
237
+ return {};
205
238
  });
206
239
 
207
240
  export const StyledDesktopMenu = styled<{}>('div', ({ $theme }) => {
@@ -210,7 +243,7 @@ export const StyledDesktopMenu = styled<{}>('div', ({ $theme }) => {
210
243
  display: 'flex',
211
244
  justifyContent: 'space-between',
212
245
  margin: 'auto',
213
- maxWidth: `${$theme.breakpoints.large}px`,
246
+ maxWidth: `${$theme.grid.maxWidth}px`,
214
247
  paddingBlockStart: '18px',
215
248
  paddingBlockEnd: '18px',
216
249
  };
@@ -5,6 +5,7 @@ This source code is licensed under the MIT license found in the
5
5
  LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { styled, withStyle } from '../styles/index.js';
8
+ import { getMediaQueries } from '../helpers/responsive-helpers.js';
8
9
  import { StyledListItem } from '../menu/index.js';
9
10
  import { KIND } from './constants.js';
10
11
  const StyledButton = styled('button', ({
@@ -41,10 +42,45 @@ export const StyledRoot = styled('div', props => {
41
42
  const {
42
43
  $theme
43
44
  } = props;
44
- return { ...$theme.typography.font300,
45
+ const mediaQueries = getMediaQueries($theme.breakpoints);
46
+ const breakpoints = Object.values($theme.breakpoints).sort();
47
+ const margins = [];
48
+
49
+ if (Array.isArray($theme.grid.margins)) {
50
+ for (let i = 0; i < breakpoints.length; i++) {
51
+ const margin = $theme.grid.margins[i];
52
+
53
+ if (margin == null) {
54
+ margins.push($theme.grid.margins[$theme.grid.margins.length - 1]);
55
+ } else {
56
+ margins.push(margin);
57
+ }
58
+ }
59
+ } else {
60
+ for (let i = 0; i < breakpoints.length; i++) {
61
+ margins.push($theme.grid.margins);
62
+ }
63
+ }
64
+
65
+ const style = { ...$theme.typography.font300,
45
66
  boxSizing: 'border-box',
46
- backgroundColor: $theme.colors.backgroundPrimary
67
+ backgroundColor: $theme.colors.backgroundPrimary,
68
+ borderBottomWidth: '1px',
69
+ borderBottomStyle: 'solid',
70
+ borderBottomColor: `${$theme.colors.borderOpaque}`,
71
+ paddingInlineStart: margins[0] + 'px',
72
+ paddingInlineEnd: margins[0] + 'px'
47
73
  };
74
+
75
+ for (let i = 1; i < mediaQueries.length; i++) {
76
+ const margin = Array.isArray($theme.grid.margins) ? $theme.grid.margins[i] : $theme.grid.margins;
77
+ style[mediaQueries[i]] = {
78
+ paddingInlineStart: margin + 'px',
79
+ paddingInlineEnd: margin + 'px'
80
+ };
81
+ }
82
+
83
+ return style;
48
84
  });
49
85
  StyledRoot.displayName = "StyledRoot";
50
86
  export const StyledSubnavContainer = styled('div', {});
@@ -161,7 +197,7 @@ export const StyledSecondaryMenuContainer = styled('div', ({
161
197
  flexWrap: 'nowrap',
162
198
  justifyContent: 'flex-start',
163
199
  margin: 'auto',
164
- maxWidth: `${$theme.breakpoints.large}px`,
200
+ maxWidth: `${$theme.grid.maxWidth}px`,
165
201
  alignItems: 'stretch',
166
202
  overflow: 'auto'
167
203
  };
@@ -218,11 +254,7 @@ StyledUserProfileInfoContainer.displayName = "StyledUserProfileInfoContainer";
218
254
  export const StyledDesktopMenuContainer = styled('div', ({
219
255
  $theme
220
256
  }) => {
221
- return {
222
- borderBottomWidth: '1px',
223
- borderBottomStyle: 'solid',
224
- borderBottomColor: `${$theme.colors.borderOpaque}`
225
- };
257
+ return {};
226
258
  });
227
259
  StyledDesktopMenuContainer.displayName = "StyledDesktopMenuContainer";
228
260
  export const StyledDesktopMenu = styled('div', ({
@@ -233,7 +265,7 @@ export const StyledDesktopMenu = styled('div', ({
233
265
  display: 'flex',
234
266
  justifyContent: 'space-between',
235
267
  margin: 'auto',
236
- maxWidth: `${$theme.breakpoints.large}px`,
268
+ maxWidth: `${$theme.grid.maxWidth}px`,
237
269
  paddingBlockStart: '18px',
238
270
  paddingBlockEnd: '18px'
239
271
  };
@@ -11,6 +11,7 @@ This source code is licensed under the MIT license found in the
11
11
  LICENSE file in the root directory of this source tree.
12
12
  */
13
13
  import { styled, withStyle } from '../styles/index.js';
14
+ import { getMediaQueries } from '../helpers/responsive-helpers.js';
14
15
  import { StyledListItem } from '../menu/index.js';
15
16
  import { KIND } from './constants.js';
16
17
  var StyledButton = styled('button', function (_ref) {
@@ -46,10 +47,46 @@ var StyledButton = styled('button', function (_ref) {
46
47
  StyledButton.displayName = "StyledButton";
47
48
  export var StyledRoot = styled('div', function (props) {
48
49
  var $theme = props.$theme;
49
- return _objectSpread(_objectSpread({}, $theme.typography.font300), {}, {
50
+ var mediaQueries = getMediaQueries($theme.breakpoints);
51
+ var breakpoints = Object.values($theme.breakpoints).sort();
52
+ var margins = [];
53
+
54
+ if (Array.isArray($theme.grid.margins)) {
55
+ for (var i = 0; i < breakpoints.length; i++) {
56
+ var margin = $theme.grid.margins[i];
57
+
58
+ if (margin == null) {
59
+ margins.push($theme.grid.margins[$theme.grid.margins.length - 1]);
60
+ } else {
61
+ margins.push(margin);
62
+ }
63
+ }
64
+ } else {
65
+ for (var _i = 0; _i < breakpoints.length; _i++) {
66
+ margins.push($theme.grid.margins);
67
+ }
68
+ }
69
+
70
+ var style = _objectSpread(_objectSpread({}, $theme.typography.font300), {}, {
50
71
  boxSizing: 'border-box',
51
- backgroundColor: $theme.colors.backgroundPrimary
72
+ backgroundColor: $theme.colors.backgroundPrimary,
73
+ borderBottomWidth: '1px',
74
+ borderBottomStyle: 'solid',
75
+ borderBottomColor: "".concat($theme.colors.borderOpaque),
76
+ paddingInlineStart: margins[0] + 'px',
77
+ paddingInlineEnd: margins[0] + 'px'
52
78
  });
79
+
80
+ for (var _i2 = 1; _i2 < mediaQueries.length; _i2++) {
81
+ var _margin = Array.isArray($theme.grid.margins) ? $theme.grid.margins[_i2] : $theme.grid.margins;
82
+
83
+ style[mediaQueries[_i2]] = {
84
+ paddingInlineStart: _margin + 'px',
85
+ paddingInlineEnd: _margin + 'px'
86
+ };
87
+ }
88
+
89
+ return style;
53
90
  });
54
91
  StyledRoot.displayName = "StyledRoot";
55
92
  export var StyledSubnavContainer = styled('div', {});
@@ -156,7 +193,7 @@ export var StyledSecondaryMenuContainer = styled('div', function (_ref6) {
156
193
  flexWrap: 'nowrap',
157
194
  justifyContent: 'flex-start',
158
195
  margin: 'auto',
159
- maxWidth: "".concat($theme.breakpoints.large, "px"),
196
+ maxWidth: "".concat($theme.grid.maxWidth, "px"),
160
197
  alignItems: 'stretch',
161
198
  overflow: 'auto'
162
199
  };
@@ -208,11 +245,7 @@ export var StyledUserProfileInfoContainer = styled('div', function (_ref10) {
208
245
  StyledUserProfileInfoContainer.displayName = "StyledUserProfileInfoContainer";
209
246
  export var StyledDesktopMenuContainer = styled('div', function (_ref11) {
210
247
  var $theme = _ref11.$theme;
211
- return {
212
- borderBottomWidth: '1px',
213
- borderBottomStyle: 'solid',
214
- borderBottomColor: "".concat($theme.colors.borderOpaque)
215
- };
248
+ return {};
216
249
  });
217
250
  StyledDesktopMenuContainer.displayName = "StyledDesktopMenuContainer";
218
251
  export var StyledDesktopMenu = styled('div', function (_ref12) {
@@ -222,7 +255,7 @@ export var StyledDesktopMenu = styled('div', function (_ref12) {
222
255
  display: 'flex',
223
256
  justifyContent: 'space-between',
224
257
  margin: 'auto',
225
- maxWidth: "".concat($theme.breakpoints.large, "px"),
258
+ maxWidth: "".concat($theme.grid.maxWidth, "px"),
226
259
  paddingBlockStart: '18px',
227
260
  paddingBlockEnd: '18px'
228
261
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baseui",
3
- "version": "0.0.0-next-af43adc",
3
+ "version": "0.0.0-next-73ffc7a",
4
4
  "description": "A React Component library implementing the Base design language",
5
5
  "keywords": [
6
6
  "react",