@bgord/design 0.27.60 → 0.27.62
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 +30 -3
- package/dist/design.cjs.development.js +112 -5
- package/dist/design.cjs.development.js.map +1 -1
- package/dist/design.cjs.production.min.js +1 -1
- package/dist/design.cjs.production.min.js.map +1 -1
- package/dist/design.esm.js +112 -5
- package/dist/design.esm.js.map +1 -1
- package/dist/generator.d.ts +3 -1
- package/dist/main.css +76 -10
- package/dist/main.min.css +1 -1
- package/dist/main.min.css.br +0 -0
- package/dist/main.min.css.gz +0 -0
- package/dist/object-positions-generator.d.ts +7 -0
- package/dist/rotates-generator.d.ts +7 -0
- package/dist/tokens.d.ts +4 -0
- package/package.json +1 -1
- package/src/generate-css.ts +8 -0
- package/src/generator.ts +4 -0
- package/src/object-fits-generator.ts +3 -3
- package/src/object-positions-generator.ts +35 -0
- package/src/rotates-generator.ts +35 -0
- package/src/tokens.ts +19 -0
package/README.md
CHANGED
|
@@ -478,9 +478,9 @@ Orange
|
|
|
478
478
|
|
|
479
479
|
## Object fits
|
|
480
480
|
|
|
481
|
-
| Definition
|
|
482
|
-
|
|
|
483
|
-
| data-fit
|
|
481
|
+
| Definition | Value |
|
|
482
|
+
| --------------- | ---------- |
|
|
483
|
+
| data-object-fit | object-fit |
|
|
484
484
|
|
|
485
485
|
| Key | Value |
|
|
486
486
|
| ---------- | :--------: |
|
|
@@ -489,3 +489,30 @@ Orange
|
|
|
489
489
|
| fill | fill |
|
|
490
490
|
| scale-down | scale-down |
|
|
491
491
|
| none | none |
|
|
492
|
+
|
|
493
|
+
## Object positions
|
|
494
|
+
|
|
495
|
+
| Definition | Value |
|
|
496
|
+
| -------------------- | --------------- |
|
|
497
|
+
| data-object-position | object-position |
|
|
498
|
+
|
|
499
|
+
| Key | Value |
|
|
500
|
+
| ------ | :----: |
|
|
501
|
+
| top | top |
|
|
502
|
+
| bottom | bottom |
|
|
503
|
+
| left | left |
|
|
504
|
+
| right | right |
|
|
505
|
+
| center | center |
|
|
506
|
+
|
|
507
|
+
## Rotates
|
|
508
|
+
|
|
509
|
+
| Definition | Value |
|
|
510
|
+
| ----------- | ------------------------ |
|
|
511
|
+
| data-rotate | transform: rotate(x deg) |
|
|
512
|
+
|
|
513
|
+
| Key | Value |
|
|
514
|
+
| --- | :---: |
|
|
515
|
+
| 0 | 0 |
|
|
516
|
+
| 90 | 90 |
|
|
517
|
+
| 180 | 180 |
|
|
518
|
+
| 270 | 270 |
|
|
@@ -2411,13 +2411,13 @@ var ObjectFitsGenerator = /*#__PURE__*/function (_AbstractGenerator) {
|
|
|
2411
2411
|
var _proto = ObjectFitsGenerator.prototype;
|
|
2412
2412
|
|
|
2413
2413
|
_proto.generateCss = function generateCss() {
|
|
2414
|
-
var output = ''; // Regular display: data-fit="*"
|
|
2414
|
+
var output = ''; // Regular display: data-object-fit="*"
|
|
2415
2415
|
|
|
2416
2416
|
for (var _i = 0, _Object$entries = Object.entries(this.objectFits); _i < _Object$entries.length; _i++) {
|
|
2417
2417
|
var _Object$entries$_i = _Object$entries[_i],
|
|
2418
2418
|
key = _Object$entries$_i[0],
|
|
2419
2419
|
value = _Object$entries$_i[1];
|
|
2420
|
-
output += "*[data-fit='" + key + "'] {\n object-fit: " + value + ";\n}\n";
|
|
2420
|
+
output += "*[data-object-fit='" + key + "'] {\n object-fit: " + value + ";\n}\n";
|
|
2421
2421
|
}
|
|
2422
2422
|
|
|
2423
2423
|
for (var _i2 = 0, _Object$entries2 = Object.entries(this.breakpoints); _i2 < _Object$entries2.length; _i2++) {
|
|
@@ -2430,7 +2430,7 @@ var ObjectFitsGenerator = /*#__PURE__*/function (_AbstractGenerator) {
|
|
|
2430
2430
|
var _Object$entries3$_i = _Object$entries3[_i3],
|
|
2431
2431
|
_key = _Object$entries3$_i[0],
|
|
2432
2432
|
_value2 = _Object$entries3$_i[1];
|
|
2433
|
-
output += " *[data-" + name + "-fit='" + _key + "'] {\n object-fit: " + _value2 + ";\n }\n";
|
|
2433
|
+
output += " *[data-" + name + "-object-fit='" + _key + "'] {\n object-fit: " + _value2 + ";\n }\n";
|
|
2434
2434
|
}
|
|
2435
2435
|
|
|
2436
2436
|
output += "}\n";
|
|
@@ -2442,6 +2442,98 @@ var ObjectFitsGenerator = /*#__PURE__*/function (_AbstractGenerator) {
|
|
|
2442
2442
|
return ObjectFitsGenerator;
|
|
2443
2443
|
}(AbstractGenerator);
|
|
2444
2444
|
|
|
2445
|
+
var ObjectPositionsGenerator = /*#__PURE__*/function (_AbstractGenerator) {
|
|
2446
|
+
_inheritsLoose(ObjectPositionsGenerator, _AbstractGenerator);
|
|
2447
|
+
|
|
2448
|
+
function ObjectPositionsGenerator(config) {
|
|
2449
|
+
var _this;
|
|
2450
|
+
|
|
2451
|
+
_this = _AbstractGenerator.call(this, 'Object positions') || this;
|
|
2452
|
+
_this.objectPositions = config.objectPositions;
|
|
2453
|
+
_this.breakpoints = config.breakpoints;
|
|
2454
|
+
return _this;
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
var _proto = ObjectPositionsGenerator.prototype;
|
|
2458
|
+
|
|
2459
|
+
_proto.generateCss = function generateCss() {
|
|
2460
|
+
var output = ''; // Regular display: data-object-position="*"
|
|
2461
|
+
|
|
2462
|
+
for (var _i = 0, _Object$entries = Object.entries(this.objectPositions); _i < _Object$entries.length; _i++) {
|
|
2463
|
+
var _Object$entries$_i = _Object$entries[_i],
|
|
2464
|
+
key = _Object$entries$_i[0],
|
|
2465
|
+
value = _Object$entries$_i[1];
|
|
2466
|
+
output += "*[data-object-position='" + key + "'] {\n object-position: " + value + ";\n}\n";
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries(this.breakpoints); _i2 < _Object$entries2.length; _i2++) {
|
|
2470
|
+
var _Object$entries2$_i = _Object$entries2[_i2],
|
|
2471
|
+
name = _Object$entries2$_i[0],
|
|
2472
|
+
_value = _Object$entries2$_i[1];
|
|
2473
|
+
output += "@media (max-width: " + _value + "px) {\n";
|
|
2474
|
+
|
|
2475
|
+
for (var _i3 = 0, _Object$entries3 = Object.entries(this.objectPositions); _i3 < _Object$entries3.length; _i3++) {
|
|
2476
|
+
var _Object$entries3$_i = _Object$entries3[_i3],
|
|
2477
|
+
_key = _Object$entries3$_i[0],
|
|
2478
|
+
_value2 = _Object$entries3$_i[1];
|
|
2479
|
+
output += " *[data-" + name + "-object-position='" + _key + "'] {\n object-position: " + _value2 + ";\n }\n";
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
output += "}\n";
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
return output;
|
|
2486
|
+
};
|
|
2487
|
+
|
|
2488
|
+
return ObjectPositionsGenerator;
|
|
2489
|
+
}(AbstractGenerator);
|
|
2490
|
+
|
|
2491
|
+
var RotatesGenerator = /*#__PURE__*/function (_AbstractGenerator) {
|
|
2492
|
+
_inheritsLoose(RotatesGenerator, _AbstractGenerator);
|
|
2493
|
+
|
|
2494
|
+
function RotatesGenerator(config) {
|
|
2495
|
+
var _this;
|
|
2496
|
+
|
|
2497
|
+
_this = _AbstractGenerator.call(this, 'Rotates') || this;
|
|
2498
|
+
_this.rotates = config.rotates;
|
|
2499
|
+
_this.breakpoints = config.breakpoints;
|
|
2500
|
+
return _this;
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
var _proto = RotatesGenerator.prototype;
|
|
2504
|
+
|
|
2505
|
+
_proto.generateCss = function generateCss() {
|
|
2506
|
+
var output = ''; // Regular display: data-rotate="*"
|
|
2507
|
+
|
|
2508
|
+
for (var _i = 0, _Object$entries = Object.entries(this.rotates); _i < _Object$entries.length; _i++) {
|
|
2509
|
+
var _Object$entries$_i = _Object$entries[_i],
|
|
2510
|
+
key = _Object$entries$_i[0],
|
|
2511
|
+
value = _Object$entries$_i[1];
|
|
2512
|
+
output += "*[data-rotate='" + key + "'] {\n transform: rotate(" + value + "deg);\n}\n";
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries(this.breakpoints); _i2 < _Object$entries2.length; _i2++) {
|
|
2516
|
+
var _Object$entries2$_i = _Object$entries2[_i2],
|
|
2517
|
+
name = _Object$entries2$_i[0],
|
|
2518
|
+
_value = _Object$entries2$_i[1];
|
|
2519
|
+
output += "@media (max-width: " + _value + "px) {\n";
|
|
2520
|
+
|
|
2521
|
+
for (var _i3 = 0, _Object$entries3 = Object.entries(this.rotates); _i3 < _Object$entries3.length; _i3++) {
|
|
2522
|
+
var _Object$entries3$_i = _Object$entries3[_i3],
|
|
2523
|
+
_key = _Object$entries3$_i[0],
|
|
2524
|
+
_value2 = _Object$entries3$_i[1];
|
|
2525
|
+
output += " *[data-" + name + "-rotate='" + _key + "'] {\n transform: rotate(" + _value2 + "deg);\n }\n";
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
output += "}\n";
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
return output;
|
|
2532
|
+
};
|
|
2533
|
+
|
|
2534
|
+
return RotatesGenerator;
|
|
2535
|
+
}(AbstractGenerator);
|
|
2536
|
+
|
|
2445
2537
|
var Spacing = {
|
|
2446
2538
|
'0': '0',
|
|
2447
2539
|
'3': '3px',
|
|
@@ -2467,6 +2559,13 @@ var ObjectFits = {
|
|
|
2467
2559
|
'scale-down': 'scale-down',
|
|
2468
2560
|
none: 'none'
|
|
2469
2561
|
};
|
|
2562
|
+
var ObjectPositions = {
|
|
2563
|
+
top: 'top',
|
|
2564
|
+
bottom: 'bottom',
|
|
2565
|
+
left: 'left',
|
|
2566
|
+
right: 'right',
|
|
2567
|
+
center: 'center'
|
|
2568
|
+
};
|
|
2470
2569
|
var AxisPlacements = {
|
|
2471
2570
|
start: 'flex-start',
|
|
2472
2571
|
end: 'flex-end',
|
|
@@ -2654,6 +2753,12 @@ var Backdrops = {
|
|
|
2654
2753
|
black: 'rgba(0, 0, 0, 0.75)',
|
|
2655
2754
|
none: 'none'
|
|
2656
2755
|
};
|
|
2756
|
+
var Rotates = {
|
|
2757
|
+
'0': '0',
|
|
2758
|
+
'90': '90',
|
|
2759
|
+
'180': '180',
|
|
2760
|
+
'270': '270'
|
|
2761
|
+
};
|
|
2657
2762
|
|
|
2658
2763
|
var GeneratorProcessor = /*#__PURE__*/function () {
|
|
2659
2764
|
function GeneratorProcessor() {}
|
|
@@ -2829,10 +2934,12 @@ function _main() {
|
|
|
2829
2934
|
cursors: Cursors,
|
|
2830
2935
|
pointerEvents: PointerEvents,
|
|
2831
2936
|
backdrops: Backdrops,
|
|
2832
|
-
objectFits: ObjectFits
|
|
2937
|
+
objectFits: ObjectFits,
|
|
2938
|
+
objectPositions: ObjectPositions,
|
|
2939
|
+
rotates: Rotates
|
|
2833
2940
|
};
|
|
2834
2941
|
_context2.next = 3;
|
|
2835
|
-
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 FlexShrinksGenerator(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(config), new HeightsGenerator(config), new CursorsGenerator(config), new PointerEventsGenerator(config), new BackdropsGenerator(config), new ObjectFitsGenerator(config)]);
|
|
2942
|
+
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 FlexShrinksGenerator(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(config), new HeightsGenerator(config), new CursorsGenerator(config), new PointerEventsGenerator(config), new BackdropsGenerator(config), new ObjectFitsGenerator(config), new ObjectPositionsGenerator(config), new RotatesGenerator(config)]);
|
|
2836
2943
|
|
|
2837
2944
|
case 3:
|
|
2838
2945
|
case "end":
|