@bgord/design 0.27.39 → 0.27.41

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.
@@ -1,4 +1,5 @@
1
1
  import { promises } from 'fs';
2
+ import pick from 'lodash.pick';
2
3
 
3
4
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
4
5
  try {
@@ -1300,26 +1301,41 @@ var AxisPlacementsGenerator = /*#__PURE__*/function (_AbstractGenerator) {
1300
1301
  _key = _Object$entries2$_i[0],
1301
1302
  _value = _Object$entries2$_i[1];
1302
1303
  output += "*[data-cross='" + _key + "'] {\n align-items: " + _value + ";\n}\n";
1303
- }
1304
+ } // Self placement alongside the cross axis: data-self="*"
1305
+
1304
1306
 
1305
- for (var _i3 = 0, _Object$entries3 = Object.entries(this.breakpoints); _i3 < _Object$entries3.length; _i3++) {
1307
+ for (var _i3 = 0, _Object$entries3 = Object.entries(pick(this.axisPlacements, ['start', 'end', 'center', 'baseline'])); _i3 < _Object$entries3.length; _i3++) {
1306
1308
  var _Object$entries3$_i = _Object$entries3[_i3],
1307
- name = _Object$entries3$_i[0],
1309
+ _key2 = _Object$entries3$_i[0],
1308
1310
  _value2 = _Object$entries3$_i[1];
1309
- output += "@media (max-width: " + _value2 + "px) {\n";
1311
+ output += "*[data-self='" + _key2 + "'] {\n align-self: " + _value2 + ";\n}\n";
1312
+ }
1310
1313
 
1311
- for (var _i4 = 0, _Object$entries4 = Object.entries(this.axisPlacements); _i4 < _Object$entries4.length; _i4++) {
1312
- var _Object$entries4$_i = _Object$entries4[_i4],
1313
- _key2 = _Object$entries4$_i[0],
1314
- _value3 = _Object$entries4$_i[1];
1315
- output += " *[data-" + name + "-main='" + _key2 + "'] {\n justify-content: " + _value3 + ";\n }\n";
1316
- }
1314
+ for (var _i4 = 0, _Object$entries4 = Object.entries(this.breakpoints); _i4 < _Object$entries4.length; _i4++) {
1315
+ var _Object$entries4$_i = _Object$entries4[_i4],
1316
+ name = _Object$entries4$_i[0],
1317
+ _value3 = _Object$entries4$_i[1];
1318
+ output += "@media (max-width: " + _value3 + "px) {\n";
1317
1319
 
1318
1320
  for (var _i5 = 0, _Object$entries5 = Object.entries(this.axisPlacements); _i5 < _Object$entries5.length; _i5++) {
1319
1321
  var _Object$entries5$_i = _Object$entries5[_i5],
1320
1322
  _key3 = _Object$entries5$_i[0],
1321
1323
  _value4 = _Object$entries5$_i[1];
1322
- output += " *[data-" + name + "-cross='" + _key3 + "'] {\n align-items: " + _value4 + ";\n }\n";
1324
+ output += " *[data-" + name + "-main='" + _key3 + "'] {\n justify-content: " + _value4 + ";\n }\n";
1325
+ }
1326
+
1327
+ for (var _i6 = 0, _Object$entries6 = Object.entries(this.axisPlacements); _i6 < _Object$entries6.length; _i6++) {
1328
+ var _Object$entries6$_i = _Object$entries6[_i6],
1329
+ _key4 = _Object$entries6$_i[0],
1330
+ _value5 = _Object$entries6$_i[1];
1331
+ output += " *[data-" + name + "-cross='" + _key4 + "'] {\n align-items: " + _value5 + ";\n }\n";
1332
+ }
1333
+
1334
+ for (var _i7 = 0, _Object$entries7 = Object.entries(pick(this.axisPlacements, ['start', 'end', 'center', 'baseline'])); _i7 < _Object$entries7.length; _i7++) {
1335
+ var _Object$entries7$_i = _Object$entries7[_i7],
1336
+ _key5 = _Object$entries7$_i[0],
1337
+ _value6 = _Object$entries7$_i[1];
1338
+ output += " *[data-" + name + "-self='" + _key5 + "'] {\n align-self: " + _value6 + ";\n }\n";
1323
1339
  }
1324
1340
 
1325
1341
  output += "}\n";
@@ -2177,6 +2193,52 @@ var GapGenerator = /*#__PURE__*/function (_AbstractGenerator) {
2177
2193
  return GapGenerator;
2178
2194
  }(AbstractGenerator);
2179
2195
 
2196
+ var CursorsGenerator = /*#__PURE__*/function (_AbstractGenerator) {
2197
+ _inheritsLoose(CursorsGenerator, _AbstractGenerator);
2198
+
2199
+ function CursorsGenerator(config) {
2200
+ var _this;
2201
+
2202
+ _this = _AbstractGenerator.call(this, 'Cursors') || this;
2203
+ _this.cursors = config.cursors;
2204
+ _this.breakpoints = config.breakpoints;
2205
+ return _this;
2206
+ }
2207
+
2208
+ var _proto = CursorsGenerator.prototype;
2209
+
2210
+ _proto.generateCss = function generateCss() {
2211
+ var output = ''; // Regular display: data-cursor="*"
2212
+
2213
+ for (var _i = 0, _Object$entries = Object.entries(this.cursors); _i < _Object$entries.length; _i++) {
2214
+ var _Object$entries$_i = _Object$entries[_i],
2215
+ key = _Object$entries$_i[0],
2216
+ value = _Object$entries$_i[1];
2217
+ output += "*[data-cursor='" + key + "'] {\n cursor: " + value + ";\n}\n";
2218
+ }
2219
+
2220
+ for (var _i2 = 0, _Object$entries2 = Object.entries(this.breakpoints); _i2 < _Object$entries2.length; _i2++) {
2221
+ var _Object$entries2$_i = _Object$entries2[_i2],
2222
+ name = _Object$entries2$_i[0],
2223
+ _value = _Object$entries2$_i[1];
2224
+ output += "@media (max-width: " + _value + "px) {\n";
2225
+
2226
+ for (var _i3 = 0, _Object$entries3 = Object.entries(this.cursors); _i3 < _Object$entries3.length; _i3++) {
2227
+ var _Object$entries3$_i = _Object$entries3[_i3],
2228
+ _key = _Object$entries3$_i[0],
2229
+ _value2 = _Object$entries3$_i[1];
2230
+ output += " *[data-" + name + "-cursor='" + _key + "'] {\n cursor: " + _value2 + ";\n }\n";
2231
+ }
2232
+
2233
+ output += "}\n";
2234
+ }
2235
+
2236
+ return output;
2237
+ };
2238
+
2239
+ return CursorsGenerator;
2240
+ }(AbstractGenerator);
2241
+
2180
2242
  var Spacing = {
2181
2243
  '0': '0',
2182
2244
  '3': '3px',
@@ -2362,6 +2424,12 @@ var Overflows = {
2362
2424
  scroll: 'scroll',
2363
2425
  hidden: 'hidden'
2364
2426
  };
2427
+ var Cursors = {
2428
+ wait: 'wait',
2429
+ auto: 'auto',
2430
+ pointer: 'pointer',
2431
+ 'not-allowed': 'not-allowed'
2432
+ };
2365
2433
 
2366
2434
  var GeneratorProcessor = /*#__PURE__*/function () {
2367
2435
  function GeneratorProcessor() {}
@@ -2502,10 +2570,11 @@ function _main() {
2502
2570
  maxWidths: MaxWidths,
2503
2571
  transforms: Transforms,
2504
2572
  overflows: Overflows,
2505
- heights: Heights
2573
+ heights: Heights,
2574
+ cursors: Cursors
2506
2575
  };
2507
2576
  _context2.next = 3;
2508
- return new GeneratorProcessor().process([new Margins(config), new Paddings(config), new DisplaysGenerator(config), new AxisPlacementsGenerator(config), new FlexWrapGenerator(config), new FlexDirectionsGenerator(config), new FlexGrowsGenerator(config), new GapGenerator(config), new WidthsGenerator(config), new PositionsGenerator(config), new ZIndexGenerator(config), new FontSizeGenerator(config), new FontWeightGenerator(config), new FontColorsGenerator(config), new LineHeightsGenerator(config), new LetterSpacingsGenerator(config), new BackgroundsGenerator(config), new BorderWidthsGenerator(config), new BorderColorsGenerator(config), new BorderRadiusesGenerator(config), new MaxWidthsGenerator(config), new TransformsGenerator(config), new OverflowsGenerator(config), new PositionersGenerator(), new HeightsGenerator(config)]);
2577
+ return new GeneratorProcessor().process([new Margins(config), new Paddings(config), new DisplaysGenerator(config), new AxisPlacementsGenerator(config), new FlexWrapGenerator(config), new FlexDirectionsGenerator(config), new FlexGrowsGenerator(config), new GapGenerator(config), new WidthsGenerator(config), new PositionsGenerator(config), new ZIndexGenerator(config), new FontSizeGenerator(config), new FontWeightGenerator(config), new FontColorsGenerator(config), new LineHeightsGenerator(config), new LetterSpacingsGenerator(config), new BackgroundsGenerator(config), new BorderWidthsGenerator(config), new BorderColorsGenerator(config), new BorderRadiusesGenerator(config), new MaxWidthsGenerator(config), new TransformsGenerator(config), new OverflowsGenerator(config), new PositionersGenerator(), new HeightsGenerator(config), new CursorsGenerator(config)]);
2509
2578
 
2510
2579
  case 3:
2511
2580
  case "end":