@blockbite/tailwind 3.4.4 → 3.4.8

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/lib/colors.js CHANGED
@@ -1,24 +1,24 @@
1
1
  const colors = [
2
- "b_theme",
3
- "black",
4
- "white",
5
- "transparent",
6
- "inherit",
7
- "current",
8
- "gray",
9
- "red",
10
- "yellow",
11
- "green",
12
- "blue",
13
- "indigo",
14
- "purple",
15
- "pink",
2
+ 'b_theme',
3
+ 'black',
4
+ 'white',
5
+ 'transparent',
6
+ 'inherit',
7
+ 'current',
8
+ 'gray',
9
+ 'red',
10
+ 'yellow',
11
+ 'green',
12
+ 'blue',
13
+ 'indigo',
14
+ 'purple',
15
+ 'pink',
16
16
  ];
17
17
 
18
18
  const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
19
19
 
20
20
  export const isSpecialColor = (color) =>
21
- ["black", "white", "transparent", "inherit", "current", "b_theme"].includes(
21
+ ['black', 'white', 'transparent', 'inherit', 'current', 'b_theme'].includes(
22
22
  color
23
23
  );
24
24
 
@@ -45,12 +45,11 @@ export const getColorObject = () => {
45
45
  label: `${color.charAt(0).toUpperCase() + color.slice(1)}`,
46
46
  id: color,
47
47
  };
48
- } else {
49
- return shades.map((shade) => ({
50
- label: `${color.charAt(0).toUpperCase() + color.slice(1)} ${shade}`,
51
- id: `${color}-${shade}`,
52
- }));
53
48
  }
49
+ return shades.map((shade) => ({
50
+ label: `${color.charAt(0).toUpperCase() + color.slice(1)} ${shade}`,
51
+ id: `${color}-${shade}`,
52
+ }));
54
53
  });
55
54
 
56
55
  return colorObjects;
package/lib/container.js CHANGED
@@ -2,9 +2,9 @@ export const getContainer = () => {
2
2
  return {
3
3
  center: true,
4
4
  padding: {
5
- DEFAULT: "var(--b_padding, 1rem)",
6
- sm: "var(--b_padding, 1rem)",
7
- lg: "var(--b_padding, 1rem)",
5
+ DEFAULT: 'var(--b_padding, 1rem)',
6
+ sm: 'var(--b_padding, 1rem)',
7
+ lg: 'var(--b_padding, 1rem)',
8
8
  },
9
9
  };
10
10
  };
package/lib/screens.js CHANGED
@@ -1,13 +1,13 @@
1
1
  export const getScreens = (
2
- prefix = "b_",
3
- minxmax = { min: "768px", max: "1100px", max2xl: "1440px" }
2
+ prefix = 'b_',
3
+ minxmax = { min: '768px', max: '1100px', max2xl: '1440px' }
4
4
  ) => {
5
5
  // max 320px
6
6
  const screens = {};
7
- screens[prefix + "xs"] = { max: minxmax.min };
8
- screens[prefix + "md"] = { min: minxmax.min, max: minxmax.max };
9
- screens[prefix + "xl"] = { min: minxmax.max };
10
- screens[prefix + "sm"] = { max: minxmax.max };
11
- screens[prefix + "2xl"] = { min: minxmax.max2xl };
7
+ screens[prefix + 'xs'] = { max: minxmax.min };
8
+ screens[prefix + 'md'] = { min: minxmax.min, max: minxmax.max };
9
+ screens[prefix + 'xl'] = { min: minxmax.max };
10
+ screens[prefix + 'sm'] = { max: minxmax.max };
11
+ screens[prefix + '2xl'] = { min: minxmax.max2xl };
12
12
  return screens;
13
13
  };
package/lib/spacing.js CHANGED
@@ -1,60 +1,60 @@
1
1
  function createFluidSpacing(prefix) {
2
2
  const fluid = [
3
3
  {
4
- size: "0px",
5
- slug: "0",
6
- name: "0",
4
+ size: '0px',
5
+ slug: '0',
6
+ name: '0',
7
7
  },
8
8
  {
9
- size: "clamp(16px, 1vw, 32px)",
10
- slug: "1",
11
- name: "1",
9
+ size: 'clamp(16px, 1vw, 32px)',
10
+ slug: '1',
11
+ name: '1',
12
12
  },
13
13
  {
14
- size: "clamp(32px, 1vw, 48px)",
15
- slug: "2",
16
- name: "2",
14
+ size: 'clamp(32px, 1vw, 48px)',
15
+ slug: '2',
16
+ name: '2',
17
17
  },
18
18
  {
19
- size: "clamp(40px, 1vw, 50px)",
20
- slug: "3",
21
- name: "3",
19
+ size: 'clamp(40px, 1vw, 50px)',
20
+ slug: '3',
21
+ name: '3',
22
22
  },
23
23
  {
24
- size: "clamp(64px, 1vw, 80px)",
25
- slug: "4",
26
- name: "4",
24
+ size: 'clamp(64px, 1vw, 80px)',
25
+ slug: '4',
26
+ name: '4',
27
27
  },
28
28
  {
29
- size: "clamp(128px, 1vw, 144px)",
30
- slug: "5",
31
- name: "5",
29
+ size: 'clamp(128px, 1vw, 144px)',
30
+ slug: '5',
31
+ name: '5',
32
32
  },
33
33
  {
34
- size: "clamp(144px, 1vw, 164px)",
35
- slug: "6",
36
- name: "6",
34
+ size: 'clamp(144px, 1vw, 164px)',
35
+ slug: '6',
36
+ name: '6',
37
37
  },
38
38
  {
39
- slug: "8",
40
- size: "clamp(16px, 1vw, 32px)",
41
- name: "8",
39
+ slug: '8',
40
+ size: 'clamp(16px, 1vw, 32px)',
41
+ name: '8',
42
42
  },
43
43
  {
44
- slug: "9",
45
- size: "clamp(16px, 1vw, 32px)",
46
- name: "9",
44
+ slug: '9',
45
+ size: 'clamp(16px, 1vw, 32px)',
46
+ name: '9',
47
47
  },
48
48
  {
49
- slug: "10",
50
- size: "clamp(16px, 1vw, 32px)",
51
- name: "10",
49
+ slug: '10',
50
+ size: 'clamp(16px, 1vw, 32px)',
51
+ name: '10',
52
52
  },
53
53
  // can be used to push contain inside grid-container
54
54
  {
55
- slug: "1fr",
56
- size: "var(--b_fr-size, 1rem)",
57
- name: "1FR",
55
+ slug: '1fr',
56
+ size: 'var(--b_fr-size, 1rem)',
57
+ name: '1FR',
58
58
  },
59
59
  ];
60
60
 
@@ -62,56 +62,56 @@ function createFluidSpacing(prefix) {
62
62
  // add clamp spacing for gaps
63
63
  fluid.forEach((size) => {
64
64
  // add to spacing
65
- FluidSizes[prefix + "fluid-" + size.slug] = size.size;
65
+ FluidSizes[prefix + 'fluid-' + size.slug] = size.size;
66
66
  });
67
67
 
68
68
  return FluidSizes;
69
69
  }
70
70
 
71
- function createPercentSpacing(prefix) {
71
+ function createPercentSpacing() {
72
72
  const percentUnits = [
73
- "1/2",
74
- "1/3",
75
- "2/3",
76
- "1/4",
77
- "2/4",
78
- "3/4",
79
- "1/5",
80
- "2/5",
81
- "3/5",
82
- "4/5",
83
- "1/6",
84
- "2/6",
85
- "3/6",
86
- "4/6",
87
- "5/6",
88
- "1/12",
89
- "2/12",
90
- "3/12",
91
- "4/12",
92
- "5/12",
93
- "6/12",
94
- "7/12",
95
- "8/12",
96
- "9/12",
97
- "10/12",
98
- "11/12",
99
- "full",
73
+ '1/2',
74
+ '1/3',
75
+ '2/3',
76
+ '1/4',
77
+ '2/4',
78
+ '3/4',
79
+ '1/5',
80
+ '2/5',
81
+ '3/5',
82
+ '4/5',
83
+ '1/6',
84
+ '2/6',
85
+ '3/6',
86
+ '4/6',
87
+ '5/6',
88
+ '1/12',
89
+ '2/12',
90
+ '3/12',
91
+ '4/12',
92
+ '5/12',
93
+ '6/12',
94
+ '7/12',
95
+ '8/12',
96
+ '9/12',
97
+ '10/12',
98
+ '11/12',
99
+ 'full',
100
100
  ];
101
101
  return percentUnits;
102
102
  }
103
103
  function createScreenSpacing() {
104
104
  const screenSpacing = [
105
- "b_screen-10",
106
- "b_screen-20",
107
- "b_screen-30",
108
- "b_screen-40",
109
- "b_screen-50",
110
- "b_screen-60",
111
- "b_screen-70",
112
- "b_screen-80",
113
- "b_screen-90",
114
- "b_screen-100",
105
+ 'b_screen-10',
106
+ 'b_screen-20',
107
+ 'b_screen-30',
108
+ 'b_screen-40',
109
+ 'b_screen-50',
110
+ 'b_screen-60',
111
+ 'b_screen-70',
112
+ 'b_screen-80',
113
+ 'b_screen-90',
114
+ 'b_screen-100',
115
115
  ];
116
116
 
117
117
  const screenSpacingValues = {};
@@ -127,12 +127,12 @@ function createGridSpacing(prefix) {
127
127
 
128
128
  const minimalValues = [0, 1, 2, 4, 6, 8, 10, 12, 14, 18, 20, 22, 24, 32];
129
129
  for (let i = 0; i < minimalValues.length; i++) {
130
- let minimalValue = minimalValues[i];
131
- gridSpacing[`${prefix}${minimalValue}`] = minimalValue / 16 + "rem";
130
+ const minimalValue = minimalValues[i];
131
+ gridSpacing[`${prefix}${minimalValue}`] = minimalValue / 16 + 'rem';
132
132
  }
133
133
  for (let i = 1; i < 1280 / 16; i++) {
134
134
  const gridsize = i * 16;
135
- gridSpacing[`${prefix}${gridsize}`] = i + "rem";
135
+ gridSpacing[`${prefix}${gridsize}`] = i + 'rem';
136
136
  }
137
137
  return gridSpacing;
138
138
  }
@@ -140,7 +140,7 @@ function createGridSpacing(prefix) {
140
140
  function createNativeSpacing() {
141
141
  const nativeSpacing = [
142
142
  0,
143
- "px",
143
+ 'px',
144
144
  0.5,
145
145
  1,
146
146
  1.5,
@@ -183,13 +183,13 @@ function createSpanSpacing() {
183
183
  return colSpanValues;
184
184
  }
185
185
 
186
- export const gridSpacing = (prefix = "") => {
186
+ export const gridSpacing = (prefix = '') => {
187
187
  // create grid based on 16px
188
188
  const spacingRem = createGridSpacing(prefix);
189
189
  return spacingRem;
190
190
  };
191
191
 
192
- export const fluidSpacing = (prefix = "") => {
192
+ export const fluidSpacing = (prefix = '') => {
193
193
  const spacingFluid = createFluidSpacing(prefix);
194
194
  return spacingFluid;
195
195
  };
@@ -1,17 +1,17 @@
1
1
  /*
2
2
  * This file is used to parse the theme.json file from the theme to generate the tailwind config
3
3
  */
4
- import { fluidSpacing, gridSpacing, nativeSpacing } from "./spacing";
5
- import { getScreens } from "./screens";
6
- import { getAspectRatio } from "./aspect-ratio";
7
- import { getContainer } from "./container";
4
+ import { getAspectRatio } from './aspect-ratio';
5
+ import { getContainer } from './container';
6
+ import { getScreens } from './screens';
7
+ import { fluidSpacing, gridSpacing } from './spacing';
8
8
 
9
9
  export function themeParser(
10
10
  theme,
11
11
  prefixObject = {
12
- prefixScreens: "b_",
13
- prefixAspectRatio: "b_",
14
- prefixSpacing: "b_",
12
+ prefixScreens: 'b_',
13
+ prefixAspectRatio: 'b_',
14
+ prefixSpacing: 'b_',
15
15
  },
16
16
  gridFluidSpacing = true
17
17
  ) {
@@ -25,7 +25,7 @@ export function themeParser(
25
25
  }
26
26
 
27
27
  // add colors
28
- let colors = {};
28
+ const colors = {};
29
29
  if (theme.settings.color && theme.settings.color.palette !== undefined) {
30
30
  theme.settings.color.palette.forEach((color) => {
31
31
  colors[color.slug] = color.color;
@@ -33,14 +33,14 @@ export function themeParser(
33
33
  }
34
34
 
35
35
  // add fonts and fontWeights
36
- let fonts = {};
37
- let fontWeights = {};
36
+ const fonts = {};
37
+ const fontWeights = {};
38
38
  if (
39
39
  theme.settings.typography &&
40
40
  theme.settings.typography.fontFamilies !== undefined
41
41
  ) {
42
42
  theme.settings.typography.fontFamilies.forEach((fam) => {
43
- fonts[fam.slug] = fam.fontFamily.split(",");
43
+ fonts[fam.slug] = fam.fontFamily.split(',');
44
44
  if (fam.fontFace) {
45
45
  // generate fontWeights
46
46
  fam.fontFace.forEach((face) => {
@@ -51,7 +51,7 @@ export function themeParser(
51
51
  }
52
52
 
53
53
  // fontsizes
54
- let fontSizes = {};
54
+ const fontSizes = {};
55
55
  if (
56
56
  theme.settings.typography &&
57
57
  theme.settings.typography.fontSizes !== undefined
@@ -71,13 +71,13 @@ export function themeParser(
71
71
 
72
72
  // export object
73
73
  return {
74
- fonts: fonts,
75
- fontWeights: fontWeights,
76
- colors: colors,
77
- spacing: spacing,
78
- fontSizes: fontSizes,
79
- screens: screens,
80
- aspectRatio: aspectRatio,
81
- container: container,
74
+ fonts,
75
+ fontWeights,
76
+ colors,
77
+ spacing,
78
+ fontSizes,
79
+ screens,
80
+ aspectRatio,
81
+ container,
82
82
  };
83
83
  }
package/motion/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const plugin = require('tailwindcss/plugin');
2
2
 
3
- module.exports = plugin(api => {
3
+ module.exports = plugin(
4
+ (api) => {
4
5
  require('./utilities/delay')(api);
5
6
  require('./utilities/direction')(api);
6
7
  require('./utilities/duration')(api);
@@ -9,6 +10,8 @@ module.exports = plugin(api => {
9
10
  require('./utilities/playState')(api);
10
11
  require('./utilities/timingFunction')(api);
11
12
  require('./utilities/offset')(api);
12
- }, {
13
+ },
14
+ {
13
15
  theme: require('./theme'),
14
- });
16
+ }
17
+ );