@bgord/design 0.22.0 → 0.24.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/dist/backgrounds-generator.d.ts +1 -1
- package/dist/border-radiuses-generator.d.ts +8 -0
- package/dist/design.cjs.development.js +69 -8
- 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 +69 -8
- package/dist/design.esm.js.map +1 -1
- package/dist/font-colors-generator.d.ts +1 -1
- package/dist/generator.d.ts +5 -2
- package/dist/main.css +131 -14
- 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/normalize.css +19 -3
- package/dist/normalize.min.css +1 -1
- package/dist/normalize.min.css.br +0 -0
- package/dist/normalize.min.css.gz +0 -0
- package/dist/tokens.d.ts +9 -3
- package/package.json +1 -1
- package/src/backgrounds-generator.ts +2 -2
- package/src/border-radiuses-generator.ts +27 -0
- package/src/font-colors-generator.ts +2 -2
- package/src/generate-css.ts +11 -14
- package/src/generator.ts +8 -2
- package/src/normalize.css +19 -3
- package/src/tokens.ts +56 -4
- package/src/ui/input.css +4 -0
- package/src/ui/label.css +4 -0
- package/src/ui/link.css +4 -0
- package/src/ui/select.css +4 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GeneratorInterface, GeneratorConfigType } from './generator';
|
|
2
2
|
export declare class BackgroundsGenerator implements GeneratorInterface {
|
|
3
|
-
colors: GeneratorConfigType['
|
|
3
|
+
colors: GeneratorConfigType['grayscale'];
|
|
4
4
|
constructor(config: GeneratorConfigType);
|
|
5
5
|
generateHeader(): string;
|
|
6
6
|
generateCss(): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GeneratorInterface, GeneratorConfigType } from './generator';
|
|
2
|
+
export declare class BorderRadiusesGenerator implements GeneratorInterface {
|
|
3
|
+
borderRadiuses: GeneratorConfigType['borderRadiuses'];
|
|
4
|
+
constructor(config: GeneratorConfigType);
|
|
5
|
+
generateHeader(): string;
|
|
6
|
+
generateCss(): string;
|
|
7
|
+
generateFooter(): string;
|
|
8
|
+
}
|
|
@@ -1586,7 +1586,7 @@ var FlexDirectionsGenerator = /*#__PURE__*/function () {
|
|
|
1586
1586
|
|
|
1587
1587
|
var BackgroundsGenerator = /*#__PURE__*/function () {
|
|
1588
1588
|
function BackgroundsGenerator(config) {
|
|
1589
|
-
this.colors = config.
|
|
1589
|
+
this.colors = _extends({}, config.grayscale, config.greens, config.reds);
|
|
1590
1590
|
}
|
|
1591
1591
|
|
|
1592
1592
|
var _proto = BackgroundsGenerator.prototype;
|
|
@@ -1617,7 +1617,7 @@ var BackgroundsGenerator = /*#__PURE__*/function () {
|
|
|
1617
1617
|
|
|
1618
1618
|
var FontColorsGenerator = /*#__PURE__*/function () {
|
|
1619
1619
|
function FontColorsGenerator(config) {
|
|
1620
|
-
this.colors = config.
|
|
1620
|
+
this.colors = _extends({}, config.grayscale, config.greens, config.reds);
|
|
1621
1621
|
}
|
|
1622
1622
|
|
|
1623
1623
|
var _proto = FontColorsGenerator.prototype;
|
|
@@ -1854,6 +1854,37 @@ var BorderColorsGenerator = /*#__PURE__*/function () {
|
|
|
1854
1854
|
return BorderColorsGenerator;
|
|
1855
1855
|
}();
|
|
1856
1856
|
|
|
1857
|
+
var BorderRadiusesGenerator = /*#__PURE__*/function () {
|
|
1858
|
+
function BorderRadiusesGenerator(config) {
|
|
1859
|
+
this.borderRadiuses = config.borderRadiuses;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
var _proto = BorderRadiusesGenerator.prototype;
|
|
1863
|
+
|
|
1864
|
+
_proto.generateHeader = function generateHeader() {
|
|
1865
|
+
return '/* Border radiuses */\n\n';
|
|
1866
|
+
};
|
|
1867
|
+
|
|
1868
|
+
_proto.generateCss = function generateCss() {
|
|
1869
|
+
var output = '';
|
|
1870
|
+
|
|
1871
|
+
for (var _i = 0, _Object$entries = Object.entries(this.borderRadiuses); _i < _Object$entries.length; _i++) {
|
|
1872
|
+
var _Object$entries$_i = _Object$entries[_i],
|
|
1873
|
+
key = _Object$entries$_i[0],
|
|
1874
|
+
value = _Object$entries$_i[1];
|
|
1875
|
+
output += "*[data-br='" + key + "'] {\n border-radius: " + value + ";\n}\n";
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
return output;
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
_proto.generateFooter = function generateFooter() {
|
|
1882
|
+
return '/* ===================== */\n\n';
|
|
1883
|
+
};
|
|
1884
|
+
|
|
1885
|
+
return BorderRadiusesGenerator;
|
|
1886
|
+
}();
|
|
1887
|
+
|
|
1857
1888
|
var Spacing = {
|
|
1858
1889
|
'0': '0',
|
|
1859
1890
|
'3': '3px',
|
|
@@ -1936,7 +1967,7 @@ var FlexDirections = {
|
|
|
1936
1967
|
column: 'column',
|
|
1937
1968
|
'column-reverse': 'column-reverse'
|
|
1938
1969
|
};
|
|
1939
|
-
var
|
|
1970
|
+
var Grayscale = {
|
|
1940
1971
|
white: '#F9FAFB',
|
|
1941
1972
|
'gray-100': '#F3F4F6',
|
|
1942
1973
|
'gray-200': '#E5E7EB',
|
|
@@ -1948,6 +1979,26 @@ var Colors = {
|
|
|
1948
1979
|
'gray-800': '#1F2937',
|
|
1949
1980
|
black: '#111827'
|
|
1950
1981
|
};
|
|
1982
|
+
var Greens = {
|
|
1983
|
+
'green-100': 'hsl(112, 50%, 85%)',
|
|
1984
|
+
'green-200': 'hsl(112, 50%, 75%)',
|
|
1985
|
+
'green-300': 'hsl(112, 50%, 65%)',
|
|
1986
|
+
'green-400': 'hsl(112, 50%, 55%)',
|
|
1987
|
+
'green-500': 'hsl(112, 50%, 45%)',
|
|
1988
|
+
'green-600': 'hsl(112, 50%, 35%)',
|
|
1989
|
+
'green-700': 'hsl(112, 50%, 25%)',
|
|
1990
|
+
'green-800': 'hsl(112, 50%, 20%)'
|
|
1991
|
+
};
|
|
1992
|
+
var Reds = {
|
|
1993
|
+
'red-100': 'hsl(5, 80%, 90%)',
|
|
1994
|
+
'red-200': 'hsl(5, 80%, 83%)',
|
|
1995
|
+
'red-300': 'hsl(5, 80%, 72.5%)',
|
|
1996
|
+
'red-400': 'hsl(5, 80%, 62.5%)',
|
|
1997
|
+
'red-500': 'hsl(5, 80%, 52.5%)',
|
|
1998
|
+
'red-600': 'hsl(5, 80%, 42%)',
|
|
1999
|
+
'red-700': 'hsl(5, 80%, 32.5%)',
|
|
2000
|
+
'red-800': 'hsl(5, 80%, 22.5%)'
|
|
2001
|
+
};
|
|
1951
2002
|
var Breakpoints = {
|
|
1952
2003
|
md: 768
|
|
1953
2004
|
};
|
|
@@ -1968,9 +2019,16 @@ var BorderWidths = {
|
|
|
1968
2019
|
'6': 6,
|
|
1969
2020
|
'12': 12
|
|
1970
2021
|
};
|
|
1971
|
-
var BorderColors = /*#__PURE__*/_extends({},
|
|
2022
|
+
var BorderColors = /*#__PURE__*/_extends({}, Grayscale, {
|
|
1972
2023
|
transparent: 'transparent'
|
|
1973
2024
|
});
|
|
2025
|
+
var BorderRadiuses = {
|
|
2026
|
+
'0': '0',
|
|
2027
|
+
'1': '1px',
|
|
2028
|
+
'2': '2px',
|
|
2029
|
+
'4': '4px',
|
|
2030
|
+
'50%': '50%'
|
|
2031
|
+
};
|
|
1974
2032
|
|
|
1975
2033
|
var GeneratorProcessor = /*#__PURE__*/function () {
|
|
1976
2034
|
function GeneratorProcessor() {}
|
|
@@ -1985,7 +2043,7 @@ var GeneratorProcessor = /*#__PURE__*/function () {
|
|
|
1985
2043
|
while (1) {
|
|
1986
2044
|
switch (_context.prev = _context.next) {
|
|
1987
2045
|
case 0:
|
|
1988
|
-
output =
|
|
2046
|
+
output = '';
|
|
1989
2047
|
|
|
1990
2048
|
for (_iterator = _createForOfIteratorHelperLoose(generators); !(_step = _iterator()).done;) {
|
|
1991
2049
|
generator = _step.value;
|
|
@@ -2068,15 +2126,18 @@ function _main() {
|
|
|
2068
2126
|
fontWeights: FontWeights,
|
|
2069
2127
|
lineHeights: LineHeights,
|
|
2070
2128
|
flexDirections: FlexDirections,
|
|
2071
|
-
|
|
2129
|
+
grayscale: Grayscale,
|
|
2130
|
+
greens: Greens,
|
|
2131
|
+
reds: Reds,
|
|
2072
2132
|
breakpoints: Breakpoints,
|
|
2073
2133
|
letterSpacings: LetterSpacings,
|
|
2074
2134
|
flexGrows: FlexGrows,
|
|
2075
2135
|
borderWidths: BorderWidths,
|
|
2076
|
-
borderColors: BorderColors
|
|
2136
|
+
borderColors: BorderColors,
|
|
2137
|
+
borderRadiuses: BorderRadiuses
|
|
2077
2138
|
};
|
|
2078
2139
|
_context2.next = 3;
|
|
2079
|
-
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 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)]);
|
|
2140
|
+
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 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)]);
|
|
2080
2141
|
|
|
2081
2142
|
case 3:
|
|
2082
2143
|
case "end":
|