@bgord/design 0.27.28 → 0.27.32

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
@@ -1,34 +1,242 @@
1
1
  # @bgord/design
2
2
 
3
- Spacing:
3
+ ## Margins
4
4
 
5
- - margins
6
- - paddings
5
+ | Definition | Value |
6
+ | ---------- | ------------------- |
7
+ | data-m | margin |
8
+ | data-mx | margin-{left,right} |
9
+ | data-my | margin-{top,bottom} |
10
+ | data-mt | margin-top |
11
+ | data-mr | margin-right |
12
+ | data-mb | margin-bottom |
13
+ | data-ml | margin-left |
7
14
 
8
- Placement:
15
+ | Key | Value |
16
+ | ----- | :---: |
17
+ | | |
18
+ | 0 | 0 |
19
+ | 3 | 3px |
20
+ | 6 | 6px |
21
+ | 12 | 12px |
22
+ | 24 | 24px |
23
+ | 36 | 36px |
24
+ | 48 | 48px |
25
+ | 72 | 72px |
26
+ | auto | auto |
27
+ | unset | unset |
9
28
 
10
- - displays
11
- - axis-placements
12
- - flex-wraps
13
- - flex-directions
29
+ ## Paddings
14
30
 
15
- Position:
31
+ | Definition | Value |
32
+ | ---------- | ---------------------- |
33
+ | data-p | padding |
34
+ | data-px | padding-{left,padding} |
35
+ | data-py | padding-{top,bottom} |
36
+ | data-pt | padding-top |
37
+ | data-pr | padding-right |
38
+ | data-pb | padding-bottom |
39
+ | data-pl | padding-left |
16
40
 
17
- - postions
18
- - z-index
19
- - widhts
41
+ | Key | Value |
42
+ | ----- | :---: |
43
+ | | |
44
+ | 0 | 0 |
45
+ | 3 | 3px |
46
+ | 6 | 6px |
47
+ | 12 | 12px |
48
+ | 24 | 24px |
49
+ | 36 | 36px |
50
+ | 48 | 48px |
51
+ | 72 | 72px |
52
+ | auto | auto |
53
+ | unset | unset |
20
54
 
21
- Text:
55
+ export const Displays: Record<DisplayType, string> = {
56
+ flex: 'flex',
57
+ block: 'block',
58
+ 'inline-block': 'inline-block',
59
+ none: 'none',
60
+ };
22
61
 
23
- - font-size
24
- - font-weight
25
- - font-color
26
- - line-height
62
+ export const AxisPlacements: Record<AxisPlacementType, string> = {
63
+ start: 'flex-start',
64
+ end: 'flex-end',
65
+ between: 'space-between',
66
+ center: 'center',
67
+ baseline: 'baseline',
68
+ };
27
69
 
28
- Background:
70
+ export const Positions: Record<PositionType, string> = {
71
+ static: 'static',
72
+ relative: 'relative',
73
+ absolute: 'absolute',
74
+ fixed: 'fixed',
75
+ sticky: 'sticky',
76
+ unset: 'unset',
77
+ };
29
78
 
30
- - background-color
79
+ export const FlexWraps: Record<FlexWrapTypes, string> = {
80
+ nowrap: 'nowrap',
81
+ wrap: 'wrap',
82
+ 'wrap-reverse': 'wrap-reverse',
83
+ unset: 'unset',
84
+ };
31
85
 
32
- TODO:
86
+ export const ZIndexes: Record<ZIndexType, string> = {
87
+ '-1': '-1',
88
+ '0': '0',
89
+ '1': '1',
90
+ '2': '2',
91
+ '3': '3',
92
+ };
33
93
 
34
- - letter-spacing (ls)
94
+ export const Widths: Record<WidthType, string> = {
95
+ '100%': '100%',
96
+ auto: 'auto',
97
+ unset: 'unset',
98
+ };
99
+
100
+ export const FontSizes: Record<FontSizeType, string> = {
101
+ 12: '12',
102
+ 14: '14',
103
+ 16: '16',
104
+ 20: '20',
105
+ 24: '24',
106
+ 32: '32',
107
+ 36: '36',
108
+ };
109
+
110
+ export const FontWeights: Record<FontWeightType, string> = {
111
+ '300': '300',
112
+ '400': '400',
113
+ '500': '500',
114
+ '700': '700',
115
+ '900': '900',
116
+ unset: 'unset',
117
+ };
118
+
119
+ export const LineHeights: Record<LineHeightType, string> = {
120
+ '12': '12',
121
+ '16': '16',
122
+ '20': '20',
123
+ '24': '24',
124
+ '32': '32',
125
+ '36': '36',
126
+ unset: 'unset',
127
+ };
128
+
129
+ export const FlexDirections: Record<FlexDirectionType, string> = {
130
+ row: 'row',
131
+ 'row-reverse': 'row-reverse',
132
+ column: 'column',
133
+ 'column-reverse': 'column-reverse',
134
+ };
135
+
136
+ export const Grayscale: Record<GrayscaleType, string> = {
137
+ white: '#F9FAFB',
138
+ 'gray-100': '#F3F4F6',
139
+ 'gray-200': '#E5E7EB',
140
+ 'gray-300': '#D1D5DB',
141
+ 'gray-400': '#9CA3AF',
142
+ 'gray-500': '#6B7280',
143
+ 'gray-600': '#4B5563',
144
+ 'gray-700': '#374151',
145
+ 'gray-800': '#1F2937',
146
+ black: '#111827',
147
+ };
148
+
149
+ export const Greens: Record<GreenType, string> = {
150
+ 'green-100': 'hsl(112, 50%, 85%)',
151
+ 'green-200': 'hsl(112, 50%, 75%)',
152
+ 'green-300': 'hsl(112, 50%, 65%)',
153
+ 'green-400': 'hsl(112, 50%, 55%)',
154
+ 'green-500': 'hsl(112, 50%, 45%)',
155
+ 'green-600': 'hsl(112, 50%, 35%)',
156
+ 'green-700': 'hsl(112, 50%, 25%)',
157
+ 'green-800': 'hsl(112, 50%, 20%)',
158
+ };
159
+
160
+ export const Reds: Record<RedType, string> = {
161
+ 'red-100': 'hsl(5, 80%, 90%)',
162
+ 'red-200': 'hsl(5, 80%, 83%)',
163
+ 'red-300': 'hsl(5, 80%, 72.5%)',
164
+ 'red-400': 'hsl(5, 80%, 62.5%)',
165
+ 'red-500': 'hsl(5, 80%, 52.5%)',
166
+ 'red-600': 'hsl(5, 80%, 42%)',
167
+ 'red-700': 'hsl(5, 80%, 32.5%)',
168
+ 'red-800': 'hsl(5, 80%, 22.5%)',
169
+ };
170
+
171
+ export const Oranges: Record<OrangeType, string> = {
172
+ 'orange-100': 'hsl(25, 88%, 85%)',
173
+ 'orange-200': 'hsl(25, 88%, 75%)',
174
+ 'orange-300': 'hsl(25, 88%, 65%)',
175
+ 'orange-400': 'hsl(25, 88%, 55%)',
176
+ 'orange-500': 'hsl(25, 88%, 45%)',
177
+ 'orange-600': 'hsl(25, 88%, 37.5%)',
178
+ 'orange-700': 'hsl(25, 88%, 27.5%)',
179
+ 'orange-800': 'hsl(25, 88%, 20%)',
180
+ };
181
+
182
+ export const Breakpoints: Record<BreakpointType, number> = {
183
+ md: 768,
184
+ };
185
+
186
+ export const LetterSpacings: Record<LetterSpacingType, number> = {
187
+ '0.5': 0.5,
188
+ '1': 1,
189
+ '1.5': 1.5,
190
+ '2': 2,
191
+ };
192
+
193
+ export const FlexGrows: Record<FlexGrowType, string> = {
194
+ '1': '1',
195
+ unset: 'unset',
196
+ };
197
+
198
+ export const BorderWidths: Record<BorderWidthType, number> = {
199
+ '1': 1,
200
+ '2': 2,
201
+ '4': 4,
202
+ '6': 6,
203
+ '12': 12,
204
+ };
205
+
206
+ export const BorderColors: Record<BorderColorType, string> = {
207
+ ...Grayscale,
208
+ transparent: 'transparent',
209
+ };
210
+
211
+ export const BorderRadiuses: Record<BorderRadiusType, string> = {
212
+ '0': '0',
213
+ '1': '1px',
214
+ '2': '2px',
215
+ '4': '4px',
216
+ '50%': '50%',
217
+ };
218
+
219
+ export const MaxWidths: Record<MaxWidthType, string> = {
220
+ '100%': '100%',
221
+ '1296': '1296px',
222
+ '768': '768px',
223
+ '528': '528px',
224
+ '320': '320px',
225
+ unset: 'unset',
226
+ };
227
+
228
+ export const Transforms: Record<TransformType, string> = {
229
+ uppercase: 'uppercase',
230
+ lowercase: 'lowercase',
231
+ capitalize: 'capitalize',
232
+ 'upper-first': 'upper-first',
233
+ truncate: 'truncate',
234
+ center: 'center',
235
+ none: 'none',
236
+ };
237
+
238
+ export const Overflows: Record<OverflowType, string> = {
239
+ auto: 'auto',
240
+ scroll: 'scroll',
241
+ hidden: 'hidden',
242
+ };
@@ -2065,6 +2065,52 @@ var PositionersGenerator = /*#__PURE__*/function (_AbstractGenerator) {
2065
2065
  return PositionersGenerator;
2066
2066
  }(AbstractGenerator);
2067
2067
 
2068
+ var HeightsGenerator = /*#__PURE__*/function (_AbstractGenerator) {
2069
+ _inheritsLoose(HeightsGenerator, _AbstractGenerator);
2070
+
2071
+ function HeightsGenerator(config) {
2072
+ var _this;
2073
+
2074
+ _this = _AbstractGenerator.call(this, 'Heights') || this;
2075
+ _this.heights = config.heights;
2076
+ _this.breakpoints = config.breakpoints;
2077
+ return _this;
2078
+ }
2079
+
2080
+ var _proto = HeightsGenerator.prototype;
2081
+
2082
+ _proto.generateCss = function generateCss() {
2083
+ var output = ''; // Regular display: data-height="*"
2084
+
2085
+ for (var _i = 0, _Object$entries = Object.entries(this.heights); _i < _Object$entries.length; _i++) {
2086
+ var _Object$entries$_i = _Object$entries[_i],
2087
+ key = _Object$entries$_i[0],
2088
+ value = _Object$entries$_i[1];
2089
+ output += "*[data-height='" + key + "'] {\n height: " + value + ";\n}\n";
2090
+ }
2091
+
2092
+ for (var _i2 = 0, _Object$entries2 = Object.entries(this.breakpoints); _i2 < _Object$entries2.length; _i2++) {
2093
+ var _Object$entries2$_i = _Object$entries2[_i2],
2094
+ name = _Object$entries2$_i[0],
2095
+ _value = _Object$entries2$_i[1];
2096
+ output += "@media (max-height: " + _value + "px) {\n";
2097
+
2098
+ for (var _i3 = 0, _Object$entries3 = Object.entries(this.heights); _i3 < _Object$entries3.length; _i3++) {
2099
+ var _Object$entries3$_i = _Object$entries3[_i3],
2100
+ _key = _Object$entries3$_i[0],
2101
+ _value2 = _Object$entries3$_i[1];
2102
+ output += " *[data-" + name + "-height='" + _key + "'] {\n height: " + _value2 + ";\n }\n";
2103
+ }
2104
+
2105
+ output += "}\n";
2106
+ }
2107
+
2108
+ return output;
2109
+ };
2110
+
2111
+ return HeightsGenerator;
2112
+ }(AbstractGenerator);
2113
+
2068
2114
  var Spacing = {
2069
2115
  '0': '0',
2070
2116
  '3': '3px',
@@ -2086,6 +2132,8 @@ var Displays = {
2086
2132
  var AxisPlacements = {
2087
2133
  start: 'flex-start',
2088
2134
  end: 'flex-end',
2135
+ around: 'space-around',
2136
+ evenly: 'space-evenly',
2089
2137
  between: 'space-between',
2090
2138
  center: 'center',
2091
2139
  baseline: 'baseline'
@@ -2116,6 +2164,11 @@ var Widths = {
2116
2164
  auto: 'auto',
2117
2165
  unset: 'unset'
2118
2166
  };
2167
+ var Heights = {
2168
+ '100%': '100%',
2169
+ auto: 'auto',
2170
+ unset: 'unset'
2171
+ };
2119
2172
  var FontSizes = {
2120
2173
  12: '12',
2121
2174
  14: '14',
@@ -2225,6 +2278,7 @@ var MaxWidths = {
2225
2278
  '1296': '1296px',
2226
2279
  '768': '768px',
2227
2280
  '528': '528px',
2281
+ '320': '320px',
2228
2282
  unset: 'unset'
2229
2283
  };
2230
2284
  var Transforms = {
@@ -2374,10 +2428,11 @@ function _main() {
2374
2428
  borderRadiuses: BorderRadiuses,
2375
2429
  maxWidths: MaxWidths,
2376
2430
  transforms: Transforms,
2377
- overflows: Overflows
2431
+ overflows: Overflows,
2432
+ heights: Heights
2378
2433
  };
2379
2434
  _context2.next = 3;
2380
- 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), new MaxWidthsGenerator(config), new TransformsGenerator(config), new OverflowsGenerator(config), new PositionersGenerator()]);
2435
+ 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), new MaxWidthsGenerator(config), new TransformsGenerator(config), new OverflowsGenerator(config), new PositionersGenerator(), new HeightsGenerator(config)]);
2381
2436
 
2382
2437
  case 3:
2383
2438
  case "end":