@bgord/design 0.23.0 → 0.25.0
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 +79 -7
- 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 +79 -7
- package/dist/design.esm.js.map +1 -1
- package/dist/font-colors-generator.d.ts +1 -1
- package/dist/generator.d.ts +6 -2
- package/dist/main.css +163 -0
- 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/tokens.d.ts +11 -3
- package/package.json +1 -1
- package/src/backgrounds-generator.ts +7 -2
- package/src/border-radiuses-generator.ts +27 -0
- package/src/font-colors-generator.ts +7 -2
- package/src/generate-css.ts +12 -2
- package/src/generator.ts +10 -2
- package/src/tokens.ts +77 -4
|
@@ -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, config.oranges);
|
|
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, config.oranges);
|
|
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,36 @@ 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
|
+
};
|
|
2002
|
+
var Oranges = {
|
|
2003
|
+
'orange-100': 'hsl(25, 88%, 85%)',
|
|
2004
|
+
'orange-200': 'hsl(25, 88%, 75%)',
|
|
2005
|
+
'orange-300': 'hsl(25, 88%, 65%)',
|
|
2006
|
+
'orange-400': 'hsl(25, 88%, 55%)',
|
|
2007
|
+
'orange-500': 'hsl(25, 88%, 45%)',
|
|
2008
|
+
'orange-600': 'hsl(25, 88%, 37.5%)',
|
|
2009
|
+
'orange-700': 'hsl(25, 88%, 27.5%)',
|
|
2010
|
+
'orange-800': 'hsl(25, 88%, 20%)'
|
|
2011
|
+
};
|
|
1951
2012
|
var Breakpoints = {
|
|
1952
2013
|
md: 768
|
|
1953
2014
|
};
|
|
@@ -1968,9 +2029,16 @@ var BorderWidths = {
|
|
|
1968
2029
|
'6': 6,
|
|
1969
2030
|
'12': 12
|
|
1970
2031
|
};
|
|
1971
|
-
var BorderColors = /*#__PURE__*/_extends({},
|
|
2032
|
+
var BorderColors = /*#__PURE__*/_extends({}, Grayscale, {
|
|
1972
2033
|
transparent: 'transparent'
|
|
1973
2034
|
});
|
|
2035
|
+
var BorderRadiuses = {
|
|
2036
|
+
'0': '0',
|
|
2037
|
+
'1': '1px',
|
|
2038
|
+
'2': '2px',
|
|
2039
|
+
'4': '4px',
|
|
2040
|
+
'50%': '50%'
|
|
2041
|
+
};
|
|
1974
2042
|
|
|
1975
2043
|
var GeneratorProcessor = /*#__PURE__*/function () {
|
|
1976
2044
|
function GeneratorProcessor() {}
|
|
@@ -2068,15 +2136,19 @@ function _main() {
|
|
|
2068
2136
|
fontWeights: FontWeights,
|
|
2069
2137
|
lineHeights: LineHeights,
|
|
2070
2138
|
flexDirections: FlexDirections,
|
|
2071
|
-
|
|
2139
|
+
grayscale: Grayscale,
|
|
2140
|
+
greens: Greens,
|
|
2141
|
+
reds: Reds,
|
|
2142
|
+
oranges: Oranges,
|
|
2072
2143
|
breakpoints: Breakpoints,
|
|
2073
2144
|
letterSpacings: LetterSpacings,
|
|
2074
2145
|
flexGrows: FlexGrows,
|
|
2075
2146
|
borderWidths: BorderWidths,
|
|
2076
|
-
borderColors: BorderColors
|
|
2147
|
+
borderColors: BorderColors,
|
|
2148
|
+
borderRadiuses: BorderRadiuses
|
|
2077
2149
|
};
|
|
2078
2150
|
_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)]);
|
|
2151
|
+
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
2152
|
|
|
2081
2153
|
case 3:
|
|
2082
2154
|
case "end":
|