react-responsive-tools 2.1.4 → 2.2.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/README.MD CHANGED
@@ -8,6 +8,14 @@ The package is based on [react-responsive](https://www.npmjs.com/package/react-r
8
8
 
9
9
  To install the project, run the following command:
10
10
 
11
+ ### Установка
12
+
13
+ Пожалуйста, убедитесь, что вы установили следующие зависимости:
14
+
15
+ ```sh
16
+ yarn add react-responsive
17
+ ```
18
+
11
19
  ```sh
12
20
  # Using Yarn
13
21
  yarn add react-responsive-tools
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from './hooks/useBreakpoint';
2
+ export * from './hooks/useVBreakpoint';
3
+ export * from './components/horizontal';
4
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "react-responsive-tools",
3
- "version": "2.1.4",
3
+ "version": "2.2.0",
4
4
  "description": "",
5
- "main": "index.js",
6
- "module": "index.js",
7
- "types": "index.d.ts",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
8
  "type": "module",
9
9
  "scripts": {
10
10
  "dev": "webpack --mode development --watch",
11
+ "start": "webpack serve --config webpack.config.js --env development=true",
11
12
  "tsc": "tsc",
12
13
  "test": "jest",
13
14
  "lint": "eslint \"{**/*,*}.{js,ts,jsx,tsx}\"",
@@ -18,11 +19,7 @@
18
19
  },
19
20
  "files": [
20
21
  "src",
21
- "*.ts",
22
- "*.scss",
23
- "index.js",
24
- "reinit.sh",
25
- "index.d.ts"
22
+ "reinit.sh"
26
23
  ],
27
24
  "keywords": [
28
25
  "react",
@@ -33,6 +30,8 @@
33
30
  "author": "westprophet",
34
31
  "license": "ISC",
35
32
  "peerDependencies": {
33
+ "react": "^18.3.1",
34
+ "react-dom": "^18.3.1",
36
35
  "react-responsive": "^10.0.0"
37
36
  },
38
37
  "devDependencies": {
@@ -45,8 +44,8 @@
45
44
  "@types/jest": "^29.5.12",
46
45
  "@types/node": "^22.5.4",
47
46
  "@types/react-dom": "^18.3.0",
48
- "@typescript-eslint/eslint-plugin": "^8.4.0",
49
- "@typescript-eslint/parser": "^8.4.0",
47
+ "@typescript-eslint/eslint-plugin": "^8.5.0",
48
+ "@typescript-eslint/parser": "^8.5.0",
50
49
  "babel-loader": "^9.1.3",
51
50
  "copy-webpack-plugin": "^12.0.2",
52
51
  "css-loader": "^7.1.2",
@@ -56,10 +55,13 @@
56
55
  "eslint-import-resolver-typescript": "^3.6.3",
57
56
  "eslint-plugin-import": "^2.30.0",
58
57
  "eslint-plugin-jsx-a11y": "^6.10.0",
58
+ "eslint-plugin-react": "^7.35.2",
59
+ "eslint-plugin-react-hooks": "^4.6.2",
59
60
  "eslint-webpack-plugin": "^4.2.0",
60
61
  "file-loader": "^6.2.0",
61
62
  "husky": "^9.1.5",
62
63
  "jest": "^29.7.0",
64
+ "react": "^18.3.1",
63
65
  "react-dom": "^18.3.1",
64
66
  "react-test-renderer": "^18.3.1",
65
67
  "sass": "^1.78.0",
@@ -74,5 +76,8 @@
74
76
  },
75
77
  "bin": {
76
78
  "react-responsive-tools": "bin/react-responsive-tools.mjs"
79
+ },
80
+ "dependencies": {
81
+ "react-responsive": "^10.0.0"
77
82
  }
78
83
  }
package/reinit.sh CHANGED
@@ -1,43 +1,49 @@
1
1
  #!/bin/bash
2
2
 
3
- # Получение директории, в которой расположен текущий скрипт
4
- SCRIPT_DIR=$(dirname "$0")
5
- PACKAGE_DIR=$(cd "$SCRIPT_DIR" && pwd)
3
+ # Путь до каталога dist
4
+ DIST_DIR="./dist"
5
+ SCRIPT_DIR="$DIST_DIR/scripts"
6
+
7
+ # Проверка наличия каталога dist/scripts
8
+ if [ ! -d "$SCRIPT_DIR" ]; then
9
+ echo "Scripts directory $SCRIPT_DIR does not exist."
10
+ exit 1
11
+ fi
6
12
 
7
- # Запуск createConfig.mjs из пакета
13
+ # Запуск createConfig.mjs из dist/scripts
8
14
  echo "Running createConfig.mjs from package..."
9
- node "$PACKAGE_DIR/src/scripts/createConfig.mjs"
15
+ node "$SCRIPT_DIR/createConfig.mjs"
10
16
 
11
17
  if [ $? -ne 0 ]; then
12
- echo "Error occurred while running createConfig.mjs"
13
- exit 1
18
+ echo "Error occurred while running createConfig.mjs"
19
+ exit 1
14
20
  fi
15
21
 
16
- # Запуск generateCustomBreakpointsSCSS.mjs из пакета
22
+ # Запуск generateCustomBreakpointsSCSS.mjs из dist/scripts
17
23
  echo "Running generateCustomBreakpointsSCSS.mjs from package..."
18
- node "$PACKAGE_DIR/src/scripts/generateCustomBreakpointsSCSS.mjs"
24
+ node "$SCRIPT_DIR/generateCustomBreakpointsSCSS.mjs"
19
25
 
20
26
  if [ $? -ne 0 ]; then
21
- echo "Error occurred while running generateCustomBreakpointsSCSS.mjs"
22
- exit 1
27
+ echo "Error occurred while running generateCustomBreakpointsSCSS.mjs"
28
+ exit 1
23
29
  fi
24
30
 
25
- # Запуск generateSCSS.mjs из пакета
31
+ # Запуск generateSCSS.mjs из dist/scripts
26
32
  echo "Running generateSCSS.mjs from package..."
27
- node "$PACKAGE_DIR/src/scripts/generateSCSS.mjs"
33
+ node "$SCRIPT_DIR/generateSCSS.mjs"
28
34
 
29
35
  if [ $? -ne 0 ]; then
30
- echo "Error occurred while running generateSCSS.mjs"
31
- exit 1
36
+ echo "Error occurred while running generateSCSS.mjs"
37
+ exit 1
32
38
  fi
33
39
 
34
- # Запуск generateTBreakpoint.mjs из пакета
40
+ # Запуск generateTBreakpoint.mjs из dist/scripts
35
41
  echo "Running generateTBreakpoint.mjs from package..."
36
- node "$PACKAGE_DIR/src/scripts/generateTBreakpoint.mjs"
42
+ node "$SCRIPT_DIR/generateTBreakpoint.mjs"
37
43
 
38
44
  if [ $? -ne 0 ]; then
39
- echo "Error occurred while running generateTBreakpoint.mjs"
40
- exit 1
45
+ echo "Error occurred while running generateTBreakpoint.mjs"
46
+ exit 1
41
47
  fi
42
48
 
43
49
  echo "All scripts have been executed successfully."
@@ -1,6 +1,6 @@
1
+ // src/breakpoints.config.ts
1
2
 
2
- // breakpoints.config.mjs
3
- const HORIZONTAL_BREAKPOINTS = {
3
+ const HORIZONTAL_BREAKPOINTS: Record<string, string> = {
4
4
  "xs": "320px",
5
5
  "sm": "576px",
6
6
  "md": "768px",
@@ -13,7 +13,7 @@ const HORIZONTAL_BREAKPOINTS = {
13
13
  "qxl": "3840px"
14
14
  };
15
15
 
16
- const VERTICAL_BREAKPOINTS = {
16
+ const VERTICAL_BREAKPOINTS: Record<string, string> = {
17
17
  "xs": "600px",
18
18
  "sm": "800px",
19
19
  "md": "1000px",
@@ -2,11 +2,13 @@
2
2
  * Created by westp on 15.05.2023
3
3
  */
4
4
 
5
+ import React from "react";
6
+
5
7
  import { TBreakpoint } from '../interfaces/TBreakpoint';
6
8
  import { useBreakpointDF, useBreakpointMF } from '../hooks/useBreakpoint';
7
9
 
8
10
  interface Props {
9
- children: any;
11
+ children: React.ReactNode;
10
12
  }
11
13
 
12
14
  interface ForComponentProps extends Props {
@@ -1,4 +1,4 @@
1
- // @ts-ignore
1
+
2
2
  import { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS } from '../breakpoints.config';
3
3
  import { TBreakpoint, TVerticalBreakpoint } from '../interfaces/TBreakpoint';
4
4
 
@@ -3,7 +3,7 @@ import { useMediaQuery } from 'react-responsive';
3
3
  import { TVerticalBreakpoint } from '../interfaces/TBreakpoint';
4
4
  import { TAdaptiveVariant } from '../interfaces/TAdaptiveVariant';
5
5
  import useVariant from './useVariant';
6
- import getBreakpoint, {getVBreakpoint} from "../functions/getBreakpoint";
6
+ import {getVBreakpoint} from "../functions/getBreakpoint";
7
7
 
8
8
  export default function useVBreakpoint(b: TVerticalBreakpoint | number, variant: TAdaptiveVariant = 'MtF') {
9
9
  const _bp = typeof b === 'number' ? b + 'px' : getVBreakpoint(b);
package/src/index.scss ADDED
@@ -0,0 +1,4 @@
1
+ @import "./scss/vertical";
2
+ @import "./scss/horizontal";
3
+ @import "./scss/horizontal-breakpoints";
4
+ @import "./scss/vertical-breakpoints";
@@ -2,7 +2,7 @@
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
4
  import { fileURLToPath } from 'url'; // Импортируем необходимую функцию из 'url'
5
- import { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS } from '../breakpoints.config.mjs';
5
+ import { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS } from '../breakpoints.config.ts';
6
6
 
7
7
  // Определение __filename и __dirname
8
8
  const __filename = fileURLToPath(import.meta.url);
@@ -2,7 +2,7 @@
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
4
  import { fileURLToPath } from 'url';
5
- import { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS } from '../breakpoints.config.mjs';
5
+ import { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS } from '../breakpoints.config.ts';
6
6
 
7
7
  // Определение __filename и __dirname
8
8
  const __filename = fileURLToPath(import.meta.url);
@@ -12,12 +12,12 @@ const __dirname = path.dirname(__filename);
12
12
  const generateHorizontalSCSS = (breakpoints) => {
13
13
  const beforeMixins = Object.keys(breakpoints).map(bp => `
14
14
  /**
15
- * Mixin for applying styles for screens greater than or equal to ${breakpoints[bp]}px.
16
- * Usage:
17
- *
18
- * @include for-${bp} {
15
+ * @mixin for-${bp}
16
+ * @description Mixin for applying styles for screens greater than or equal to ${breakpoints[bp]}px.
17
+ * @example
18
+ * @include for-${bp} {
19
19
  * // your styles here
20
- * }
20
+ * }
21
21
  */
22
22
  @mixin for-${bp}() {
23
23
  @include mob-first(${bp}) {
@@ -27,12 +27,12 @@ const generateHorizontalSCSS = (breakpoints) => {
27
27
 
28
28
  const afterMixins = Object.keys(breakpoints).map(bp => `
29
29
  /**
30
- * Mixin for applying styles for screens less than ${breakpoints[bp]}px.
31
- * Usage:
32
- *
33
- * @include before-${bp} {
30
+ * @mixin before-${bp}
31
+ * @description Mixin for applying styles for screens less than ${breakpoints[bp]}px.
32
+ * @example
33
+ * @include before-${bp} {
34
34
  * // your styles here
35
- * }
35
+ * }
36
36
  */
37
37
  @mixin before-${bp}() {
38
38
  @include desk-first(${bp}) {
@@ -53,12 +53,12 @@ ${afterMixins}
53
53
  const generateVerticalSCSS = (breakpoints) => {
54
54
  const beforeMixins = Object.keys(breakpoints).map(bp => `
55
55
  /**
56
- * Mixin for applying styles for screens with height greater than or equal to ${breakpoints[bp]}px.
57
- * Usage:
58
- *
59
- * @include v-for-${bp} {
56
+ * @mixin v-for-${bp}
57
+ * @description Mixin for applying styles for screens with height greater than or equal to ${breakpoints[bp]}px.
58
+ * @example
59
+ * @include v-for-${bp} {
60
60
  * // your styles here
61
- * }
61
+ * }
62
62
  */
63
63
  @mixin v-for-${bp}() {
64
64
  @include v-mob-first(${bp}) {
@@ -68,12 +68,12 @@ const generateVerticalSCSS = (breakpoints) => {
68
68
 
69
69
  const afterMixins = Object.keys(breakpoints).map(bp => `
70
70
  /**
71
- * Mixin for applying styles for screens with height less than ${breakpoints[bp]}px.
72
- * Usage:
73
- *
74
- * @include v-before-${bp} {
71
+ * @mixin v-before-${bp}
72
+ * @description Mixin for applying styles for screens with height less than ${breakpoints[bp]}px.
73
+ * @example
74
+ * @include v-before-${bp} {
75
75
  * // your styles here
76
- * }
76
+ * }
77
77
  */
78
78
  @mixin v-before-${bp}() {
79
79
  @include v-desk-first(${bp}) {
@@ -2,7 +2,7 @@
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
4
  import { fileURLToPath } from 'url';
5
- import { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS } from '../breakpoints.config.mjs';
5
+ import { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS } from '../breakpoints.config.ts';
6
6
 
7
7
  // Определение __filename и __dirname
8
8
  const __filename = fileURLToPath(import.meta.url);
@@ -3,12 +3,12 @@
3
3
 
4
4
 
5
5
  /**
6
- * Mixin for applying styles for screens greater than or equal to 320pxpx.
7
- * Usage:
8
- *
9
- * @include for-xs {
6
+ * @mixin for-xs
7
+ * @description Mixin for applying styles for screens greater than or equal to 320pxpx.
8
+ * @example
9
+ * @include for-xs {
10
10
  * // your styles here
11
- * }
11
+ * }
12
12
  */
13
13
  @mixin for-xs() {
14
14
  @include mob-first(xs) {
@@ -16,13 +16,14 @@
16
16
  }
17
17
  }
18
18
 
19
+
19
20
  /**
20
- * Mixin for applying styles for screens greater than or equal to 576pxpx.
21
- * Usage:
22
- *
23
- * @include for-sm {
21
+ * @mixin for-sm
22
+ * @description Mixin for applying styles for screens greater than or equal to 576pxpx.
23
+ * @example
24
+ * @include for-sm {
24
25
  * // your styles here
25
- * }
26
+ * }
26
27
  */
27
28
  @mixin for-sm() {
28
29
  @include mob-first(sm) {
@@ -31,12 +32,12 @@
31
32
  }
32
33
 
33
34
  /**
34
- * Mixin for applying styles for screens greater than or equal to 768pxpx.
35
- * Usage:
36
- *
37
- * @include for-md {
35
+ * @mixin for-md
36
+ * @description Mixin for applying styles for screens greater than or equal to 768pxpx.
37
+ * @example
38
+ * @include for-md {
38
39
  * // your styles here
39
- * }
40
+ * }
40
41
  */
41
42
  @mixin for-md() {
42
43
  @include mob-first(md) {
@@ -45,12 +46,12 @@
45
46
  }
46
47
 
47
48
  /**
48
- * Mixin for applying styles for screens greater than or equal to 992pxpx.
49
- * Usage:
50
- *
51
- * @include for-lg {
49
+ * @mixin for-lg
50
+ * @description Mixin for applying styles for screens greater than or equal to 992pxpx.
51
+ * @example
52
+ * @include for-lg {
52
53
  * // your styles here
53
- * }
54
+ * }
54
55
  */
55
56
  @mixin for-lg() {
56
57
  @include mob-first(lg) {
@@ -59,12 +60,12 @@
59
60
  }
60
61
 
61
62
  /**
62
- * Mixin for applying styles for screens greater than or equal to 1024pxpx.
63
- * Usage:
64
- *
65
- * @include for-lt {
63
+ * @mixin for-lt
64
+ * @description Mixin for applying styles for screens greater than or equal to 1024pxpx.
65
+ * @example
66
+ * @include for-lt {
66
67
  * // your styles here
67
- * }
68
+ * }
68
69
  */
69
70
  @mixin for-lt() {
70
71
  @include mob-first(lt) {
@@ -73,12 +74,12 @@
73
74
  }
74
75
 
75
76
  /**
76
- * Mixin for applying styles for screens greater than or equal to 1200pxpx.
77
- * Usage:
78
- *
79
- * @include for-ltm {
77
+ * @mixin for-ltm
78
+ * @description Mixin for applying styles for screens greater than or equal to 1200pxpx.
79
+ * @example
80
+ * @include for-ltm {
80
81
  * // your styles here
81
- * }
82
+ * }
82
83
  */
83
84
  @mixin for-ltm() {
84
85
  @include mob-first(ltm) {
@@ -87,12 +88,12 @@
87
88
  }
88
89
 
89
90
  /**
90
- * Mixin for applying styles for screens greater than or equal to 1440pxpx.
91
- * Usage:
92
- *
93
- * @include for-ltl {
91
+ * @mixin for-ltl
92
+ * @description Mixin for applying styles for screens greater than or equal to 1440pxpx.
93
+ * @example
94
+ * @include for-ltl {
94
95
  * // your styles here
95
- * }
96
+ * }
96
97
  */
97
98
  @mixin for-ltl() {
98
99
  @include mob-first(ltl) {
@@ -101,12 +102,12 @@
101
102
  }
102
103
 
103
104
  /**
104
- * Mixin for applying styles for screens greater than or equal to 1920pxpx.
105
- * Usage:
106
- *
107
- * @include for-xl {
105
+ * @mixin for-xl
106
+ * @description Mixin for applying styles for screens greater than or equal to 1920pxpx.
107
+ * @example
108
+ * @include for-xl {
108
109
  * // your styles here
109
- * }
110
+ * }
110
111
  */
111
112
  @mixin for-xl() {
112
113
  @include mob-first(xl) {
@@ -115,12 +116,12 @@
115
116
  }
116
117
 
117
118
  /**
118
- * Mixin for applying styles for screens greater than or equal to 2560pxpx.
119
- * Usage:
120
- *
121
- * @include for-xxl {
119
+ * @mixin for-xxl
120
+ * @description Mixin for applying styles for screens greater than or equal to 2560pxpx.
121
+ * @example
122
+ * @include for-xxl {
122
123
  * // your styles here
123
- * }
124
+ * }
124
125
  */
125
126
  @mixin for-xxl() {
126
127
  @include mob-first(xxl) {
@@ -129,12 +130,12 @@
129
130
  }
130
131
 
131
132
  /**
132
- * Mixin for applying styles for screens greater than or equal to 3840pxpx.
133
- * Usage:
134
- *
135
- * @include for-qxl {
133
+ * @mixin for-qxl
134
+ * @description Mixin for applying styles for screens greater than or equal to 3840pxpx.
135
+ * @example
136
+ * @include for-qxl {
136
137
  * // your styles here
137
- * }
138
+ * }
138
139
  */
139
140
  @mixin for-qxl() {
140
141
  @include mob-first(qxl) {
@@ -144,12 +145,12 @@
144
145
 
145
146
 
146
147
  /**
147
- * Mixin for applying styles for screens less than 320pxpx.
148
- * Usage:
149
- *
150
- * @include before-xs {
148
+ * @mixin before-xs
149
+ * @description Mixin for applying styles for screens less than 320pxpx.
150
+ * @example
151
+ * @include before-xs {
151
152
  * // your styles here
152
- * }
153
+ * }
153
154
  */
154
155
  @mixin before-xs() {
155
156
  @include desk-first(xs) {
@@ -158,12 +159,12 @@
158
159
  }
159
160
 
160
161
  /**
161
- * Mixin for applying styles for screens less than 576pxpx.
162
- * Usage:
163
- *
164
- * @include before-sm {
162
+ * @mixin before-sm
163
+ * @description Mixin for applying styles for screens less than 576pxpx.
164
+ * @example
165
+ * @include before-sm {
165
166
  * // your styles here
166
- * }
167
+ * }
167
168
  */
168
169
  @mixin before-sm() {
169
170
  @include desk-first(sm) {
@@ -172,12 +173,12 @@
172
173
  }
173
174
 
174
175
  /**
175
- * Mixin for applying styles for screens less than 768pxpx.
176
- * Usage:
177
- *
178
- * @include before-md {
176
+ * @mixin before-md
177
+ * @description Mixin for applying styles for screens less than 768pxpx.
178
+ * @example
179
+ * @include before-md {
179
180
  * // your styles here
180
- * }
181
+ * }
181
182
  */
182
183
  @mixin before-md() {
183
184
  @include desk-first(md) {
@@ -186,12 +187,12 @@
186
187
  }
187
188
 
188
189
  /**
189
- * Mixin for applying styles for screens less than 992pxpx.
190
- * Usage:
191
- *
192
- * @include before-lg {
190
+ * @mixin before-lg
191
+ * @description Mixin for applying styles for screens less than 992pxpx.
192
+ * @example
193
+ * @include before-lg {
193
194
  * // your styles here
194
- * }
195
+ * }
195
196
  */
196
197
  @mixin before-lg() {
197
198
  @include desk-first(lg) {
@@ -200,12 +201,12 @@
200
201
  }
201
202
 
202
203
  /**
203
- * Mixin for applying styles for screens less than 1024pxpx.
204
- * Usage:
205
- *
206
- * @include before-lt {
204
+ * @mixin before-lt
205
+ * @description Mixin for applying styles for screens less than 1024pxpx.
206
+ * @example
207
+ * @include before-lt {
207
208
  * // your styles here
208
- * }
209
+ * }
209
210
  */
210
211
  @mixin before-lt() {
211
212
  @include desk-first(lt) {
@@ -214,12 +215,12 @@
214
215
  }
215
216
 
216
217
  /**
217
- * Mixin for applying styles for screens less than 1200pxpx.
218
- * Usage:
219
- *
220
- * @include before-ltm {
218
+ * @mixin before-ltm
219
+ * @description Mixin for applying styles for screens less than 1200pxpx.
220
+ * @example
221
+ * @include before-ltm {
221
222
  * // your styles here
222
- * }
223
+ * }
223
224
  */
224
225
  @mixin before-ltm() {
225
226
  @include desk-first(ltm) {
@@ -228,12 +229,12 @@
228
229
  }
229
230
 
230
231
  /**
231
- * Mixin for applying styles for screens less than 1440pxpx.
232
- * Usage:
233
- *
234
- * @include before-ltl {
232
+ * @mixin before-ltl
233
+ * @description Mixin for applying styles for screens less than 1440pxpx.
234
+ * @example
235
+ * @include before-ltl {
235
236
  * // your styles here
236
- * }
237
+ * }
237
238
  */
238
239
  @mixin before-ltl() {
239
240
  @include desk-first(ltl) {
@@ -242,12 +243,12 @@
242
243
  }
243
244
 
244
245
  /**
245
- * Mixin for applying styles for screens less than 1920pxpx.
246
- * Usage:
247
- *
248
- * @include before-xl {
246
+ * @mixin before-xl
247
+ * @description Mixin for applying styles for screens less than 1920pxpx.
248
+ * @example
249
+ * @include before-xl {
249
250
  * // your styles here
250
- * }
251
+ * }
251
252
  */
252
253
  @mixin before-xl() {
253
254
  @include desk-first(xl) {
@@ -256,12 +257,12 @@
256
257
  }
257
258
 
258
259
  /**
259
- * Mixin for applying styles for screens less than 2560pxpx.
260
- * Usage:
261
- *
262
- * @include before-xxl {
260
+ * @mixin before-xxl
261
+ * @description Mixin for applying styles for screens less than 2560pxpx.
262
+ * @example
263
+ * @include before-xxl {
263
264
  * // your styles here
264
- * }
265
+ * }
265
266
  */
266
267
  @mixin before-xxl() {
267
268
  @include desk-first(xxl) {
@@ -270,12 +271,12 @@
270
271
  }
271
272
 
272
273
  /**
273
- * Mixin for applying styles for screens less than 3840pxpx.
274
- * Usage:
275
- *
276
- * @include before-qxl {
274
+ * @mixin before-qxl
275
+ * @description Mixin for applying styles for screens less than 3840pxpx.
276
+ * @example
277
+ * @include before-qxl {
277
278
  * // your styles here
278
- * }
279
+ * }
279
280
  */
280
281
  @mixin before-qxl() {
281
282
  @include desk-first(qxl) {
@@ -3,12 +3,12 @@
3
3
 
4
4
 
5
5
  /**
6
- * Mixin for applying styles for screens with height greater than or equal to 600pxpx.
7
- * Usage:
8
- *
9
- * @include v-for-xs {
6
+ * @mixin v-for-xs
7
+ * @description Mixin for applying styles for screens with height greater than or equal to 600pxpx.
8
+ * @example
9
+ * @include v-for-xs {
10
10
  * // your styles here
11
- * }
11
+ * }
12
12
  */
13
13
  @mixin v-for-xs() {
14
14
  @include v-mob-first(xs) {
@@ -17,12 +17,12 @@
17
17
  }
18
18
 
19
19
  /**
20
- * Mixin for applying styles for screens with height greater than or equal to 800pxpx.
21
- * Usage:
22
- *
23
- * @include v-for-sm {
20
+ * @mixin v-for-sm
21
+ * @description Mixin for applying styles for screens with height greater than or equal to 800pxpx.
22
+ * @example
23
+ * @include v-for-sm {
24
24
  * // your styles here
25
- * }
25
+ * }
26
26
  */
27
27
  @mixin v-for-sm() {
28
28
  @include v-mob-first(sm) {
@@ -31,12 +31,12 @@
31
31
  }
32
32
 
33
33
  /**
34
- * Mixin for applying styles for screens with height greater than or equal to 1000pxpx.
35
- * Usage:
36
- *
37
- * @include v-for-md {
34
+ * @mixin v-for-md
35
+ * @description Mixin for applying styles for screens with height greater than or equal to 1000pxpx.
36
+ * @example
37
+ * @include v-for-md {
38
38
  * // your styles here
39
- * }
39
+ * }
40
40
  */
41
41
  @mixin v-for-md() {
42
42
  @include v-mob-first(md) {
@@ -45,12 +45,12 @@
45
45
  }
46
46
 
47
47
  /**
48
- * Mixin for applying styles for screens with height greater than or equal to 1200pxpx.
49
- * Usage:
50
- *
51
- * @include v-for-lg {
48
+ * @mixin v-for-lg
49
+ * @description Mixin for applying styles for screens with height greater than or equal to 1200pxpx.
50
+ * @example
51
+ * @include v-for-lg {
52
52
  * // your styles here
53
- * }
53
+ * }
54
54
  */
55
55
  @mixin v-for-lg() {
56
56
  @include v-mob-first(lg) {
@@ -59,12 +59,12 @@
59
59
  }
60
60
 
61
61
  /**
62
- * Mixin for applying styles for screens with height greater than or equal to 1600pxpx.
63
- * Usage:
64
- *
65
- * @include v-for-xl {
62
+ * @mixin v-for-xl
63
+ * @description Mixin for applying styles for screens with height greater than or equal to 1600pxpx.
64
+ * @example
65
+ * @include v-for-xl {
66
66
  * // your styles here
67
- * }
67
+ * }
68
68
  */
69
69
  @mixin v-for-xl() {
70
70
  @include v-mob-first(xl) {
@@ -73,12 +73,12 @@
73
73
  }
74
74
 
75
75
  /**
76
- * Mixin for applying styles for screens with height greater than or equal to 1601pxpx.
77
- * Usage:
78
- *
79
- * @include v-for-xxl {
76
+ * @mixin v-for-xxl
77
+ * @description Mixin for applying styles for screens with height greater than or equal to 1601pxpx.
78
+ * @example
79
+ * @include v-for-xxl {
80
80
  * // your styles here
81
- * }
81
+ * }
82
82
  */
83
83
  @mixin v-for-xxl() {
84
84
  @include v-mob-first(xxl) {
@@ -88,12 +88,12 @@
88
88
 
89
89
 
90
90
  /**
91
- * Mixin for applying styles for screens with height less than 600pxpx.
92
- * Usage:
93
- *
94
- * @include v-before-xs {
91
+ * @mixin v-before-xs
92
+ * @description Mixin for applying styles for screens with height less than 600pxpx.
93
+ * @example
94
+ * @include v-before-xs {
95
95
  * // your styles here
96
- * }
96
+ * }
97
97
  */
98
98
  @mixin v-before-xs() {
99
99
  @include v-desk-first(xs) {
@@ -102,12 +102,12 @@
102
102
  }
103
103
 
104
104
  /**
105
- * Mixin for applying styles for screens with height less than 800pxpx.
106
- * Usage:
107
- *
108
- * @include v-before-sm {
105
+ * @mixin v-before-sm
106
+ * @description Mixin for applying styles for screens with height less than 800pxpx.
107
+ * @example
108
+ * @include v-before-sm {
109
109
  * // your styles here
110
- * }
110
+ * }
111
111
  */
112
112
  @mixin v-before-sm() {
113
113
  @include v-desk-first(sm) {
@@ -116,12 +116,12 @@
116
116
  }
117
117
 
118
118
  /**
119
- * Mixin for applying styles for screens with height less than 1000pxpx.
120
- * Usage:
121
- *
122
- * @include v-before-md {
119
+ * @mixin v-before-md
120
+ * @description Mixin for applying styles for screens with height less than 1000pxpx.
121
+ * @example
122
+ * @include v-before-md {
123
123
  * // your styles here
124
- * }
124
+ * }
125
125
  */
126
126
  @mixin v-before-md() {
127
127
  @include v-desk-first(md) {
@@ -130,12 +130,12 @@
130
130
  }
131
131
 
132
132
  /**
133
- * Mixin for applying styles for screens with height less than 1200pxpx.
134
- * Usage:
135
- *
136
- * @include v-before-lg {
133
+ * @mixin v-before-lg
134
+ * @description Mixin for applying styles for screens with height less than 1200pxpx.
135
+ * @example
136
+ * @include v-before-lg {
137
137
  * // your styles here
138
- * }
138
+ * }
139
139
  */
140
140
  @mixin v-before-lg() {
141
141
  @include v-desk-first(lg) {
@@ -144,12 +144,12 @@
144
144
  }
145
145
 
146
146
  /**
147
- * Mixin for applying styles for screens with height less than 1600pxpx.
148
- * Usage:
149
- *
150
- * @include v-before-xl {
147
+ * @mixin v-before-xl
148
+ * @description Mixin for applying styles for screens with height less than 1600pxpx.
149
+ * @example
150
+ * @include v-before-xl {
151
151
  * // your styles here
152
- * }
152
+ * }
153
153
  */
154
154
  @mixin v-before-xl() {
155
155
  @include v-desk-first(xl) {
@@ -158,12 +158,12 @@
158
158
  }
159
159
 
160
160
  /**
161
- * Mixin for applying styles for screens with height less than 1601pxpx.
162
- * Usage:
163
- *
164
- * @include v-before-xxl {
161
+ * @mixin v-before-xxl
162
+ * @description Mixin for applying styles for screens with height less than 1601pxpx.
163
+ * @example
164
+ * @include v-before-xxl {
165
165
  * // your styles here
166
- * }
166
+ * }
167
167
  */
168
168
  @mixin v-before-xxl() {
169
169
  @include v-desk-first(xxl) {
package/declarations.d.ts DELETED
@@ -1,5 +0,0 @@
1
- // declaration.d.ts
2
- declare module '*.scss' {
3
- const content: Record<string, string>;
4
- export default content;
5
- }
package/index.scss DELETED
@@ -1,4 +0,0 @@
1
- @import "src/scss/vertical";
2
- @import "src/scss/horizontal";
3
- @import "src/scss/vertical-breakpoints";
4
- @import "src/scss/horizontal-breakpoints";
package/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './src'
package/reset.scss DELETED
@@ -1,99 +0,0 @@
1
- /***
2
- The new CSS reset - version 1.8.4 (last updated 14.2.2023)
3
- GitHub page: https://github.com/elad2412/the-new-css-reset
4
- ***/
5
-
6
- /*
7
- Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property
8
- - The "symbol *" part is to solve Firefox SVG sprite bug
9
- */
10
- *:where(:not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)) {
11
- all: unset;
12
- display: revert;
13
- }
14
-
15
- /* Preferred box-sizing value */
16
- *,
17
- *::before,
18
- *::after {
19
- box-sizing: border-box;
20
- }
21
-
22
- /* Reapply the pointer cursor for anchor tags */
23
- a, button {
24
- cursor: revert;
25
- }
26
-
27
- /* Remove list styles (bullets/numbers) */
28
- ol, ul, menu {
29
- list-style: none;
30
- }
31
-
32
- /* For images to not be able to exceed their container */
33
- img {
34
- max-inline-size: 100%;
35
- max-block-size: 100%;
36
- }
37
-
38
- /* removes spacing between cells in tables */
39
- table {
40
- border-collapse: collapse;
41
- }
42
-
43
- /* Safari - solving issue when using user-select:none on the <body> text input doesn't working */
44
- input, textarea {
45
- -webkit-user-select: auto;
46
- }
47
-
48
- /* revert the 'white-space' property for textarea elements on Safari */
49
- textarea {
50
- white-space: revert;
51
- }
52
-
53
- /* minimum style to allow to style meter element */
54
- meter {
55
- -webkit-appearance: revert;
56
- appearance: revert;
57
- }
58
-
59
- /* preformatted text - use only for this feature */
60
- :where(pre) {
61
- all: revert;
62
- }
63
-
64
- /* reset default text opacity of input placeholder */
65
- ::placeholder {
66
- color: unset;
67
- }
68
-
69
- /* remove default dot (•) sign */
70
- ::marker {
71
- content: initial;
72
- }
73
-
74
- /* fix the feature of 'hidden' attribute.
75
- display:revert; revert to element instead of attribute */
76
- :where([hidden]) {
77
- display: none;
78
- }
79
-
80
- /* revert for bug in Chromium browsers
81
- - fix for the content editable attribute will work properly.
82
- - webkit-user-select: auto; added for Safari in case of using user-select:none on wrapper element*/
83
- :where([contenteditable]:not([contenteditable="false"])) {
84
- -moz-user-modify: read-write;
85
- -webkit-user-modify: read-write;
86
- overflow-wrap: break-word;
87
- -webkit-line-break: after-white-space;
88
- -webkit-user-select: auto;
89
- }
90
-
91
- /* apply back the draggable feature - exist only in Chromium and Safari */
92
- :where([draggable="true"]) {
93
- -webkit-user-drag: element;
94
- }
95
-
96
- /* Revert Modal native behavior */
97
- :where(dialog:modal) {
98
- all: revert;
99
- }
@@ -1,4 +0,0 @@
1
- declare module 'breakpoints.config' {
2
- export const HORIZONTAL_BREAKPOINTS: { [key: string]: string };
3
- export const VERTICAL_BREAKPOINTS: { [key: string]: string };
4
- }
@@ -1,56 +0,0 @@
1
- // src/hooks/__tests__/useBreakpoint.test.tsx
2
- import { renderHook } from '@testing-library/react';
3
- import useBreakpoint, { useBreakpointMF, useBreakpointDF } from './useBreakpoint';
4
- import breakpoints from '../../scss/_horizontal.export.scss';
5
-
6
- jest.mock('react-responsive', () => ({
7
- useMediaQuery: jest.fn(),
8
- }));
9
-
10
- jest.mock('./useVariant', () => jest.fn(() => 'min'));
11
-
12
- describe('useBreakpoint', () => {
13
- it('should return true for the media query that matches the breakpoint', () => {
14
- const mockedUseMediaQuery = require('react-responsive').useMediaQuery as jest.Mock;
15
- mockedUseMediaQuery.mockReturnValue(true);
16
-
17
- const { result } = renderHook(() => useBreakpoint('sm'));
18
-
19
- expect(result.current).toBe(true);
20
- expect(mockedUseMediaQuery).toHaveBeenCalledWith({ query: `(min-width: ${breakpoints.sm}px)` });
21
- });
22
-
23
- it('should return false for the media query that does not match the breakpoint', () => {
24
- const mockedUseMediaQuery = require('react-responsive').useMediaQuery as jest.Mock;
25
- mockedUseMediaQuery.mockReturnValue(false);
26
-
27
- const { result } = renderHook(() => useBreakpoint('sm'));
28
-
29
- expect(result.current).toBe(false);
30
- expect(mockedUseMediaQuery).toHaveBeenCalledWith({ query: `(min-width: ${breakpoints.sm}px)` });
31
- });
32
- });
33
-
34
- describe('useBreakpointMF', () => {
35
- it('should return true for the `MtF` variant', () => {
36
- const mockedUseMediaQuery = require('react-responsive').useMediaQuery as jest.Mock;
37
- mockedUseMediaQuery.mockReturnValue(true);
38
-
39
- const { result } = renderHook(() => useBreakpointMF('md'));
40
-
41
- expect(result.current).toBe(true);
42
- expect(mockedUseMediaQuery).toHaveBeenCalledWith({ query: `(min-width: ${breakpoints.md}px)` });
43
- });
44
- });
45
-
46
- describe('useBreakpointDF', () => {
47
- it('should return true for the `DtF` variant', () => {
48
- const mockedUseMediaQuery = require('react-responsive').useMediaQuery as jest.Mock;
49
- mockedUseMediaQuery.mockReturnValue(true);
50
-
51
- const { result } = renderHook(() => useBreakpointDF('lg'));
52
-
53
- expect(result.current).toBe(true);
54
- expect(mockedUseMediaQuery).toHaveBeenCalledWith({ query: `(min-width: ${breakpoints.lg}px)` });
55
- });
56
- });
@@ -1,5 +0,0 @@
1
- @import "vertical";
2
- @import "horizontal";
3
- @import "horizontal-breakpoints";
4
- @import "vertical-breakpoints";
5
-