react-responsive-tools 2.3.5 → 2.3.6
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/breakpoints.config.js +20 -18
- package/dist/default.config.d.ts +3 -0
- package/dist/default.config.js +23 -0
- package/dist/default.config.js.map +1 -0
- package/dist/interfaces/TBreakpoint.d.ts +20 -2
- package/dist/scripts/createConfig.mjs +1 -1
- package/dist/scripts/generateCustomBreakpointsSCSS.mjs +1 -1
- package/dist/scripts/generateSCSS.mjs +1 -1
- package/dist/scripts/generateTBreakpoint.mjs +1 -1
- package/dist/scss/_horizontal-breakpoints.scss +0 -1
- package/package.json +1 -1
- package/dist/scripts/copyDefaultConfig.js +0 -1
@@ -1,23 +1,25 @@
|
|
1
|
-
|
1
|
+
|
2
|
+
// breakpoints.config.mjs
|
2
3
|
const HORIZONTAL_BREAKPOINTS = {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
"xs": "320px",
|
5
|
+
"sm": "576px",
|
6
|
+
"md": "768px",
|
7
|
+
"lg": "992px",
|
8
|
+
"lt": "1024px",
|
9
|
+
"ltm": "1200px",
|
10
|
+
"ltl": "1440px",
|
11
|
+
"xl": "1920px",
|
12
|
+
"xxl": "2560px",
|
13
|
+
"qxl": "3840px"
|
13
14
|
};
|
15
|
+
|
14
16
|
const VERTICAL_BREAKPOINTS = {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
"xs": "600px",
|
18
|
+
"sm": "800px",
|
19
|
+
"md": "1000px",
|
20
|
+
"lg": "1200px",
|
21
|
+
"xl": "1600px",
|
22
|
+
"xxl": "1601px"
|
21
23
|
};
|
24
|
+
|
22
25
|
export { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS };
|
23
|
-
//# sourceMappingURL=breakpoints.config.js.map
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// breakpointConfig.js
|
2
|
+
const HORIZONTAL_BREAKPOINTS = {
|
3
|
+
xs: '320px',
|
4
|
+
sm: '576px',
|
5
|
+
md: '768px',
|
6
|
+
lg: '992px',
|
7
|
+
lt: '1024px',
|
8
|
+
ltm: '1200px',
|
9
|
+
ltl: '1440px',
|
10
|
+
xl: '1920px',
|
11
|
+
xxl: '2560px',
|
12
|
+
qxl: '3840px',
|
13
|
+
};
|
14
|
+
const VERTICAL_BREAKPOINTS = {
|
15
|
+
xs: '600px',
|
16
|
+
sm: '800px',
|
17
|
+
md: '1000px',
|
18
|
+
lg: '1200px',
|
19
|
+
xl: '1600px',
|
20
|
+
xxl: '1601px',
|
21
|
+
};
|
22
|
+
export { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS };
|
23
|
+
//# sourceMappingURL=default.config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"default.config.js","sourceRoot":"","sources":["../src/default.config.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,MAAM,sBAAsB,GAA4B;IACtD,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,QAAQ;IACZ,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;IACb,EAAE,EAAE,QAAQ;IACZ,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;CACd,CAAC;AAEF,MAAM,oBAAoB,GAA4B;IACpD,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,GAAG,EAAE,QAAQ;CACd,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,CAAC"}
|
@@ -1,2 +1,20 @@
|
|
1
|
-
export type TBreakpoint =
|
2
|
-
|
1
|
+
export type TBreakpoint =
|
2
|
+
| 'xs'
|
3
|
+
| 'sm'
|
4
|
+
| 'md'
|
5
|
+
| 'lg'
|
6
|
+
| 'lt'
|
7
|
+
| 'ltm'
|
8
|
+
| 'ltl'
|
9
|
+
| 'xl'
|
10
|
+
| 'xxl'
|
11
|
+
| 'qxl'
|
12
|
+
|
13
|
+
|
14
|
+
export type TVerticalBreakpoint =
|
15
|
+
| 'xs'
|
16
|
+
| 'sm'
|
17
|
+
| 'md'
|
18
|
+
| 'lg'
|
19
|
+
| 'xl'
|
20
|
+
| 'xxl'
|
@@ -1 +1 @@
|
|
1
|
-
import o from"fs";import n from"path";import{fileURLToPath as e}from"url";import{HORIZONTAL_BREAKPOINTS as r,VERTICAL_BREAKPOINTS as i}from"../default.config.
|
1
|
+
import o from"fs";import n from"path";import{fileURLToPath as e}from"url";import{HORIZONTAL_BREAKPOINTS as r,VERTICAL_BREAKPOINTS as i}from"../default.config.js";const s=e(import.meta.url),l=n.dirname(s),t=n.resolve(l,"../../../../breakpoints.config.js");(async()=>{let e=r,s=i;if(o.existsSync(t))try{console.log(`User config file found at: ${t}`);const o=await import(t);console.log(`Loaded user config: ${JSON.stringify(o,null,2)}`),o.HORIZONTAL_BREAKPOINTS?(e=o.HORIZONTAL_BREAKPOINTS,console.log("Using user provided horizontal breakpoints.")):console.log("Using default horizontal breakpoints."),o.VERTICAL_BREAKPOINTS?(s=o.VERTICAL_BREAKPOINTS,console.log("Using user provided vertical breakpoints.")):console.log("Using default vertical breakpoints.")}catch(o){console.error("Error loading user config:",o)}else console.log(`User config file not found at: ${t}. Using default breakpoints.`);const c=`\n// breakpoints.config.mjs\nconst HORIZONTAL_BREAKPOINTS = ${JSON.stringify(e,null,2)};\n\nconst VERTICAL_BREAKPOINTS = ${JSON.stringify(s,null,2)};\n\nexport { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS };\n`;try{o.writeFileSync(n.resolve(l,"../breakpoints.config.js"),c),console.log("Config file has been generated successfully.")}catch(o){console.error("Error writing merged config file:",o)}})();
|
@@ -1 +1 @@
|
|
1
|
-
import o from"fs";import e from"path";import{fileURLToPath as r}from"url";import{HORIZONTAL_BREAKPOINTS as s,VERTICAL_BREAKPOINTS as
|
1
|
+
import o from"fs";import e from"path";import{fileURLToPath as r}from"url";import{HORIZONTAL_BREAKPOINTS as s,VERTICAL_BREAKPOINTS as n}from"../breakpoints.config.js";const t=r(import.meta.url),i=e.dirname(t),m=(o,e)=>`$${e}-breakpoints: (\n${Object.entries(o).map((([o,e])=>` ${o}: ${e}`)).join(",\n")}\n);`,a=`\n${m(s,"horizontal")}\n${m(n,"vertical")}\n`;o.writeFileSync(e.resolve(i,"../scss/_custom-breakpoints.scss"),a),console.log("SCSS file with breakpoints maps has been generated successfully.");
|
@@ -1 +1 @@
|
|
1
|
-
import n from"fs";import e from"path";import{fileURLToPath as i}from"url";import{HORIZONTAL_BREAKPOINTS as r,VERTICAL_BREAKPOINTS as o}from"../breakpoints.config.
|
1
|
+
import n from"fs";import e from"path";import{fileURLToPath as i}from"url";import{HORIZONTAL_BREAKPOINTS as r,VERTICAL_BREAKPOINTS as o}from"../breakpoints.config.js";const s=i(import.meta.url),t=e.dirname(s),l=(c=r,`\n@import "horizontal";\n\n${Object.keys(c).map((n=>`\n/**\n * @mixin for-${n}\n * @description Mixin for applying styles for screens greater than or equal to ${c[n]}px.\n * @example\n * @include for-${n} {\n * // your styles here\n * }\n */\n@mixin for-${n}() {\n @include mob-first(${n}) {\n @content;\n }\n}`)).join("\n")}\n\n${Object.keys(c).map((n=>`\n/**\n * @mixin before-${n}\n * @description Mixin for applying styles for screens less than ${c[n]}px.\n * @example\n * @include before-${n} {\n * // your styles here\n * }\n */\n@mixin before-${n}() {\n @include desk-first(${n}) {\n @content;\n }\n}`)).join("\n")}\n`);var c;const p=(n=>`\n@import "vertical";\n\n${Object.keys(n).map((e=>`\n/**\n * @mixin v-for-${e}\n * @description Mixin for applying styles for screens with height greater than or equal to ${n[e]}px.\n * @example\n * @include v-for-${e} {\n * // your styles here\n * }\n */\n@mixin v-for-${e}() {\n @include v-mob-first(${e}) {\n @content;\n }\n}`)).join("\n")}\n\n${Object.keys(n).map((e=>`\n/**\n * @mixin v-before-${e}\n * @description Mixin for applying styles for screens with height less than ${n[e]}px.\n * @example\n * @include v-before-${e} {\n * // your styles here\n * }\n */\n@mixin v-before-${e}() {\n @include v-desk-first(${e}) {\n @content;\n }\n}`)).join("\n")}\n`)(o);n.writeFileSync(e.resolve(t,"../scss/_horizontal-breakpoints.scss"),l),n.writeFileSync(e.resolve(t,"../scss/_vertical-breakpoints.scss"),p),console.log("SCSS files have been generated successfully.");
|
@@ -1 +1 @@
|
|
1
|
-
import e from"fs";import r from"path";import{fileURLToPath as t}from"url";import{HORIZONTAL_BREAKPOINTS as o,VERTICAL_BREAKPOINTS as n}from"../breakpoints.config.
|
1
|
+
import e from"fs";import r from"path";import{fileURLToPath as t}from"url";import{HORIZONTAL_BREAKPOINTS as o,VERTICAL_BREAKPOINTS as n}from"../breakpoints.config.js";const i=t(import.meta.url),p=r.dirname(i),s=(e,r)=>`export type ${r} =\n${Object.keys(e).map((e=>` | '${e}'`)).join("\n")}\n`,a=`\n${s(o,"TBreakpoint")}\n\n${s(n,"TVerticalBreakpoint")}\n`;e.writeFileSync(r.resolve(p,"../interfaces/TBreakpoint.d.ts"),a.trim()),console.log("TBreakpoint.ts file has been generated successfully.");
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
import fs from"fs";import path from"path";import{fileURLToPath}from"url";const __filename=fileURLToPath(import.meta.url),__dirname=path.dirname(__filename),defaultConfigPath=path.resolve(__dirname,"../default.config.mjs"),userConfigPath=path.resolve(__dirname,"../../../../breakpoints.config.js");fs.existsSync(userConfigPath)?console.log("User configuration file already exists."):(fs.copyFileSync(defaultConfigPath,userConfigPath),console.log("Default configuration file has been copied to the root of the project as breakpoints.config.js"));
|