@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.
package/README.md CHANGED
@@ -83,14 +83,17 @@ Breakpoints
83
83
  | ---------- | --------------- |
84
84
  | data-main | justify-content |
85
85
  | data-cross | align-items |
86
-
87
- | Key | Value |
88
- | -------- | :-----------: |
89
- | start | flex-start |
90
- | end | flex-end |
91
- | between | space-between |
92
- | center | center |
93
- | baseline | baseline |
86
+ | data-self | align-items |
87
+
88
+ | Key | Value | Available for data-self |
89
+ | -------- | :-----------: | :---------------------: |
90
+ | start | flex-start | yes |
91
+ | end | flex-end | yes |
92
+ | around | space-around | no |
93
+ | between | space-between | no |
94
+ | evenly | space-evenly | no |
95
+ | center | center | yes |
96
+ | baseline | baseline | yes |
94
97
 
95
98
  ## Positions
96
99
 
@@ -437,3 +440,16 @@ Orange
437
440
  | orange-600 | hsl(25, 88%, 37.5%) |
438
441
  | orange-700 | hsl(25, 88%, 27.5%) |
439
442
  | orange-800 | hsl(25, 88%, 20%) |
443
+
444
+ ## Cursors
445
+
446
+ | Definition | Value |
447
+ | ----------- | ------ |
448
+ | data-cursor | cursor |
449
+
450
+ | Key | Value |
451
+ | ----------- | :---------: |
452
+ | wait | wait |
453
+ | auto | auto |
454
+ | pointer | pointer |
455
+ | not-allowed | not-allowed |
@@ -0,0 +1,7 @@
1
+ import { AbstractGenerator, GeneratorConfigType } from './generator';
2
+ export declare class CursorsGenerator extends AbstractGenerator {
3
+ cursors: GeneratorConfigType['cursors'];
4
+ breakpoints: GeneratorConfigType['breakpoints'];
5
+ constructor(config: GeneratorConfigType);
6
+ generateCss(): string;
7
+ }
@@ -1,6 +1,9 @@
1
1
  'use strict';
2
2
 
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
3
5
  var fs = require('fs');
6
+ var pick = _interopDefault(require('lodash.pick'));
4
7
 
5
8
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
6
9
  try {
@@ -1302,26 +1305,41 @@ var AxisPlacementsGenerator = /*#__PURE__*/function (_AbstractGenerator) {
1302
1305
  _key = _Object$entries2$_i[0],
1303
1306
  _value = _Object$entries2$_i[1];
1304
1307
  output += "*[data-cross='" + _key + "'] {\n align-items: " + _value + ";\n}\n";
1305
- }
1308
+ } // Self placement alongside the cross axis: data-self="*"
1309
+
1306
1310
 
1307
- for (var _i3 = 0, _Object$entries3 = Object.entries(this.breakpoints); _i3 < _Object$entries3.length; _i3++) {
1311
+ for (var _i3 = 0, _Object$entries3 = Object.entries(pick(this.axisPlacements, ['start', 'end', 'center', 'baseline'])); _i3 < _Object$entries3.length; _i3++) {
1308
1312
  var _Object$entries3$_i = _Object$entries3[_i3],
1309
- name = _Object$entries3$_i[0],
1313
+ _key2 = _Object$entries3$_i[0],
1310
1314
  _value2 = _Object$entries3$_i[1];
1311
- output += "@media (max-width: " + _value2 + "px) {\n";
1315
+ output += "*[data-self='" + _key2 + "'] {\n align-self: " + _value2 + ";\n}\n";
1316
+ }
1312
1317
 
1313
- for (var _i4 = 0, _Object$entries4 = Object.entries(this.axisPlacements); _i4 < _Object$entries4.length; _i4++) {
1314
- var _Object$entries4$_i = _Object$entries4[_i4],
1315
- _key2 = _Object$entries4$_i[0],
1316
- _value3 = _Object$entries4$_i[1];
1317
- output += " *[data-" + name + "-main='" + _key2 + "'] {\n justify-content: " + _value3 + ";\n }\n";
1318
- }
1318
+ for (var _i4 = 0, _Object$entries4 = Object.entries(this.breakpoints); _i4 < _Object$entries4.length; _i4++) {
1319
+ var _Object$entries4$_i = _Object$entries4[_i4],
1320
+ name = _Object$entries4$_i[0],
1321
+ _value3 = _Object$entries4$_i[1];
1322
+ output += "@media (max-width: " + _value3 + "px) {\n";
1319
1323
 
1320
1324
  for (var _i5 = 0, _Object$entries5 = Object.entries(this.axisPlacements); _i5 < _Object$entries5.length; _i5++) {
1321
1325
  var _Object$entries5$_i = _Object$entries5[_i5],
1322
1326
  _key3 = _Object$entries5$_i[0],
1323
1327
  _value4 = _Object$entries5$_i[1];
1324
- output += " *[data-" + name + "-cross='" + _key3 + "'] {\n align-items: " + _value4 + ";\n }\n";
1328
+ output += " *[data-" + name + "-main='" + _key3 + "'] {\n justify-content: " + _value4 + ";\n }\n";
1329
+ }
1330
+
1331
+ for (var _i6 = 0, _Object$entries6 = Object.entries(this.axisPlacements); _i6 < _Object$entries6.length; _i6++) {
1332
+ var _Object$entries6$_i = _Object$entries6[_i6],
1333
+ _key4 = _Object$entries6$_i[0],
1334
+ _value5 = _Object$entries6$_i[1];
1335
+ output += " *[data-" + name + "-cross='" + _key4 + "'] {\n align-items: " + _value5 + ";\n }\n";
1336
+ }
1337
+
1338
+ for (var _i7 = 0, _Object$entries7 = Object.entries(pick(this.axisPlacements, ['start', 'end', 'center', 'baseline'])); _i7 < _Object$entries7.length; _i7++) {
1339
+ var _Object$entries7$_i = _Object$entries7[_i7],
1340
+ _key5 = _Object$entries7$_i[0],
1341
+ _value6 = _Object$entries7$_i[1];
1342
+ output += " *[data-" + name + "-self='" + _key5 + "'] {\n align-self: " + _value6 + ";\n }\n";
1325
1343
  }
1326
1344
 
1327
1345
  output += "}\n";
@@ -2179,6 +2197,52 @@ var GapGenerator = /*#__PURE__*/function (_AbstractGenerator) {
2179
2197
  return GapGenerator;
2180
2198
  }(AbstractGenerator);
2181
2199
 
2200
+ var CursorsGenerator = /*#__PURE__*/function (_AbstractGenerator) {
2201
+ _inheritsLoose(CursorsGenerator, _AbstractGenerator);
2202
+
2203
+ function CursorsGenerator(config) {
2204
+ var _this;
2205
+
2206
+ _this = _AbstractGenerator.call(this, 'Cursors') || this;
2207
+ _this.cursors = config.cursors;
2208
+ _this.breakpoints = config.breakpoints;
2209
+ return _this;
2210
+ }
2211
+
2212
+ var _proto = CursorsGenerator.prototype;
2213
+
2214
+ _proto.generateCss = function generateCss() {
2215
+ var output = ''; // Regular display: data-cursor="*"
2216
+
2217
+ for (var _i = 0, _Object$entries = Object.entries(this.cursors); _i < _Object$entries.length; _i++) {
2218
+ var _Object$entries$_i = _Object$entries[_i],
2219
+ key = _Object$entries$_i[0],
2220
+ value = _Object$entries$_i[1];
2221
+ output += "*[data-cursor='" + key + "'] {\n cursor: " + value + ";\n}\n";
2222
+ }
2223
+
2224
+ for (var _i2 = 0, _Object$entries2 = Object.entries(this.breakpoints); _i2 < _Object$entries2.length; _i2++) {
2225
+ var _Object$entries2$_i = _Object$entries2[_i2],
2226
+ name = _Object$entries2$_i[0],
2227
+ _value = _Object$entries2$_i[1];
2228
+ output += "@media (max-width: " + _value + "px) {\n";
2229
+
2230
+ for (var _i3 = 0, _Object$entries3 = Object.entries(this.cursors); _i3 < _Object$entries3.length; _i3++) {
2231
+ var _Object$entries3$_i = _Object$entries3[_i3],
2232
+ _key = _Object$entries3$_i[0],
2233
+ _value2 = _Object$entries3$_i[1];
2234
+ output += " *[data-" + name + "-cursor='" + _key + "'] {\n cursor: " + _value2 + ";\n }\n";
2235
+ }
2236
+
2237
+ output += "}\n";
2238
+ }
2239
+
2240
+ return output;
2241
+ };
2242
+
2243
+ return CursorsGenerator;
2244
+ }(AbstractGenerator);
2245
+
2182
2246
  var Spacing = {
2183
2247
  '0': '0',
2184
2248
  '3': '3px',
@@ -2364,6 +2428,12 @@ var Overflows = {
2364
2428
  scroll: 'scroll',
2365
2429
  hidden: 'hidden'
2366
2430
  };
2431
+ var Cursors = {
2432
+ wait: 'wait',
2433
+ auto: 'auto',
2434
+ pointer: 'pointer',
2435
+ 'not-allowed': 'not-allowed'
2436
+ };
2367
2437
 
2368
2438
  var GeneratorProcessor = /*#__PURE__*/function () {
2369
2439
  function GeneratorProcessor() {}
@@ -2504,10 +2574,11 @@ function _main() {
2504
2574
  maxWidths: MaxWidths,
2505
2575
  transforms: Transforms,
2506
2576
  overflows: Overflows,
2507
- heights: Heights
2577
+ heights: Heights,
2578
+ cursors: Cursors
2508
2579
  };
2509
2580
  _context2.next = 3;
2510
- 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)]);
2581
+ 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)]);
2511
2582
 
2512
2583
  case 3:
2513
2584
  case "end":