@andreyshpigunov/x 0.3.89 → 0.4.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.
Files changed (64) hide show
  1. package/README.md +1 -1
  2. package/assets/css/app.css +1 -0
  3. package/assets/img/github-mark-white.png +0 -0
  4. package/assets/img/github-mark.png +0 -0
  5. package/assets/js/app.js +1 -0
  6. package/cheatsheet.html +427 -0
  7. package/dist/x.css +1 -1
  8. package/dist/x.js +1 -3
  9. package/index.html +20 -24
  10. package/package.json +52 -47
  11. package/postcss.config.cjs +0 -2
  12. package/src/components/x/animate.js +39 -45
  13. package/src/components/x/appear.js +19 -26
  14. package/src/components/x/autocomplete.js +22 -10
  15. package/src/components/x/buttons.css +40 -16
  16. package/src/components/x/colors.css +47 -41
  17. package/src/components/x/debug.css +2 -2
  18. package/src/components/x/device.js +39 -33
  19. package/src/components/x/dropdown.css +2 -3
  20. package/src/components/x/dropdown.js +16 -9
  21. package/src/components/x/flex.css +146 -109
  22. package/src/components/x/flow.css +12 -6
  23. package/src/components/x/form.css +3 -3
  24. package/src/components/x/form.js +12 -9
  25. package/src/components/x/grid.css +78 -42
  26. package/src/components/x/helpers.css +601 -438
  27. package/src/components/x/hover.js +20 -9
  28. package/src/components/x/icons.css +12 -12
  29. package/src/components/x/lazyload.js +17 -8
  30. package/src/components/x/lib.js +15 -1
  31. package/src/components/x/links.css +2 -6
  32. package/src/components/x/loadmore.js +17 -5
  33. package/src/components/x/modal.css +4 -22
  34. package/src/components/x/modal.js +14 -5
  35. package/src/components/x/reset.css +1 -15
  36. package/src/components/x/scroll.css +4 -9
  37. package/src/components/x/scroll.js +14 -1
  38. package/src/components/x/sheets.css +0 -3
  39. package/src/components/x/sheets.js +157 -37
  40. package/src/components/x/slider.css +10 -1
  41. package/src/components/x/slider.js +15 -0
  42. package/src/components/x/space.css +22 -2
  43. package/src/components/x/sticky.css +10 -15
  44. package/src/components/x/sticky.js +21 -4
  45. package/src/components/x/typo.css +14 -40
  46. package/src/css/app.css +7 -8
  47. package/src/css/x.css +191 -213
  48. package/src/js/app.js +8 -8
  49. package/src/js/x.js +37 -41
  50. package/assets/github-mark-white.png +0 -0
  51. package/assets/github-mark.png +0 -0
  52. package/assets/logo-inverse.png +0 -0
  53. package/babel.config.cjs +0 -4
  54. package/dist/app.css +0 -1
  55. package/dist/app.js +0 -1
  56. package/dist/index.html +0 -2182
  57. package/dist/logo.png +0 -0
  58. package/jest.config.mjs +0 -7
  59. package/jsdoc.json +0 -11
  60. package/vite.config.js +0 -31
  61. /package/assets/{alpha.png → img/alpha.png} +0 -0
  62. /package/assets/{apple-touch-icon.png → img/apple-touch-icon.png} +0 -0
  63. /package/assets/{logo.png → img/logo.png} +0 -0
  64. /package/assets/{logo.svg → img/logo.svg} +0 -0
package/src/css/app.css CHANGED
@@ -21,7 +21,7 @@ All right reserved.
21
21
  }
22
22
 
23
23
 
24
- @media (--dark) {
24
+ @media (prefers-color-scheme: dark) {
25
25
  :root {
26
26
  /* x */
27
27
  --font-color: #ddd;
@@ -66,7 +66,7 @@ All right reserved.
66
66
  grid-area: copyright;
67
67
  }
68
68
 
69
- @media (--medium) {
69
+ @media (min-width: 768px) {
70
70
  .foot {
71
71
  grid-template-rows: 1fr;
72
72
  grid-template-columns: 140px 1fr 200px;
@@ -82,7 +82,7 @@ All right reserved.
82
82
  height: 100px;
83
83
  will-change: height;
84
84
 
85
- @media (--medium) {
85
+ @media (min-width: 768px) {
86
86
  height: 120px;
87
87
  }
88
88
  }
@@ -103,23 +103,22 @@ All right reserved.
103
103
  max-width: 100px;
104
104
  will-change: transform;
105
105
 
106
- @media (--medium) {
106
+ @media (min-width: 768px) {
107
107
  max-width: 120px;
108
108
  }
109
109
  }
110
110
  }
111
111
  .header-github {
112
-
113
112
  & a {
114
113
  display: block;
115
114
  width: 40px;
116
115
  height: 40px;
117
- background-image: url('../assets/github-mark.png');
118
116
  background-position: center;
119
117
  background-size: cover;
120
-
118
+ background-image: url(/assets/img/github-mark.png);
119
+
121
120
  @media (prefers-color-scheme: dark) {
122
- background-image: url('../assets/github-mark-white.png');
121
+ background-image: url(/assets/img/github-mark-white.png);
123
122
  }
124
123
  }
125
124
  }
package/src/css/x.css CHANGED
@@ -8,10 +8,8 @@ All right reserved.
8
8
 
9
9
 
10
10
  @import "../components/x/reset.css";
11
- @import "../components/x/typo.css";
12
11
  @import "../components/x/space.css";
13
12
  @import "../components/x/links.css";
14
- @import "../components/x/helpers.css";
15
13
  @import "../components/x/grid.css";
16
14
  @import "../components/x/flex.css";
17
15
  @import "../components/x/flow.css";
@@ -22,231 +20,211 @@ All right reserved.
22
20
  @import "../components/x/slider.css";
23
21
  @import "../components/x/sticky.css";
24
22
  @import "../components/x/modal.css";
25
- @import "../components/x/debug.css";
23
+ /* @import "../components/x/debug.css"; */
26
24
  @import "../components/x/scroll.css";
27
25
  @import "../components/x/icons.css";
26
+ @import "../components/x/typo.css";
27
+ @import "../components/x/helpers.css";
28
28
  @import "../components/x/colors.css";
29
29
 
30
-
31
30
  /*
31
+ .button
32
+ .button--label
33
+ .button--primary
34
+ .button--success
35
+ .button--warning
36
+ .button--danger
37
+ .button--white
38
+ .button--black
39
+ .button--clear
40
+ .button--dropdown
41
+ .buttons-group
42
+ */
32
43
 
33
- PostCSS custom media
34
- ====================
35
- @custom-media --small-max (max-width: 599px);
36
- @custom-media --medium-min (min-width: 600px);
37
- @custom-media --medium-max (max-width: 999px);
38
- @custom-media --large-min (min-width: 1000px);
39
- @custom-media --xlarge-min (min-width: 1400px);
40
- @custom-media --small (min-width: 0px);
41
- @custom-media --medium (min-width: 600px);
42
- @custom-media --large (min-width: 1000px);
43
- @custom-media --xlarge (min-width: 1400px);
44
- @custom-media --dark (prefers-color-scheme: dark);
45
-
46
- reset.css
47
- =========
48
- --line-height: 1.5;
49
- --font-color: #000;
50
- --font-size-base: 62.5%;
51
- --font-scale: 1;
52
- --font-size: 1.6rem;
53
- --font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
54
- "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
55
- --font-family-mono: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
56
- --background-color: #fff;
57
-
58
- typo.css
59
- ========
60
- --headers-margin-top: 1em;
61
- --headers-margin-bottom: .5em;
62
- --headers-font-family: var(--font-family);
63
- --headers-font-weight: 700;
64
- --headers-font-color: var(--font-color);
65
-
66
- --h1-font-size: 2.5em;
67
- --h2-font-size: 2.0em;
68
- --h3-font-size: 1.5em;
69
- --h4-font-size: 1.25em;
70
- --h5-font-size: 1.125em;
71
- --h6-font-size: 1.0em;
72
-
73
- --h1-line-height: 1.2;
74
- --h2-line-height: 1.3;
75
- --h3-line-height: 1.4;
76
-
77
- --paragraph-margin: 1em;
78
-
79
- --figure-margin: 2.5em auto 2em;
80
- --figcaption-margin-top: .5em;
81
- --figcaption-font-size: var(--font-size);
82
- --figcaption-color: #999;
83
-
84
- --blockquote-margin: 2em 0;
85
- --blockquote-padding: 1em 2em;
86
- --blockquote-border: solid .2em var(--font-color);
87
-
88
- --table-padding: .5em .75em;
89
- --table-border: 1px solid #e4e4e4;
90
- --table-header-font-weight: 700;
91
-
92
- space.css
93
- =========
94
- --space-0: 0;
95
- --space-1: 0.4rem;
96
- --space-2: 0.8rem;
97
- --space-3: 1.2rem;
98
- --space-4: 1.6rem;
99
- --space-5: 2.4rem;
100
- --space-6: 3.2rem;
101
- --space-7: 4.8rem;
102
- --space-8: 6.4rem;
103
- --space-9: 9.6rem;
104
- --space-10: 12.8rem;
105
-
106
- links.css
107
- =========
108
- --link-color: #0060cc;
109
- --link-decoration-line: underline;
110
- --link-decoration-style: solid;
111
-
112
- Additional variables and their default values:
113
- --link-color-hover: var(--link-color);
114
- --link-color-visited: var(--link-color);
115
- --link-decoration-line-hover: var(--link-decoration-line-hover, var(--link-decoration-line));
116
- --link-decoration-style-hover: var(--link-decoration-style-hover, var(--link-decoration-style));
117
- --link-decoration-thickness: .06em;
118
- --link-decoration-color: color-mix(in srgb, currentcolor, transparent 75%);
119
- --link-decoration-color-hover: currentcolor;
120
- --link-decoration-color-visited: currentcolor;
121
- --link-underline-offset: .25em;
122
- --link-transition: all .1s ease-out;
123
-
124
- helpers.css
125
- ===========
126
- --container-max-width: 160rem;
127
-
128
- --shadow-1: 0 2px 4px #00000018;
129
- --shadow-2: 0 4px 8px #00000018;
130
- --shadow-3: 0 6px 12px #00000018;
131
- --shadow-4: 0 8px 16px #00000018;
132
- --shadow-5: 0 10px 20px #00000018;
133
- --shadow-6: 0 12px 24px #00000018;
134
- --shadow-7: 0 14px 28px #00000018;
135
- --shadow-8: 0 16px 32px #00000018;
136
- --shadow-9: 0 18px 36px #00000018;
137
- --shadow-10: 0 20px 40px #00000018;
138
-
139
- flow.css
140
- ========
141
- .flow
142
- .flow.s[0-10] (m,l,xl) - vertical space
143
-
144
- form.css
145
- ========
146
- --form-width: 40rem;
147
- --form-height-coeff: 2.5;
148
- --form-side-padding: 1rem;
149
-
150
- --form-font-size: var(--font-size);
151
- --form-font-color: #000;
152
- --form-font-color-readonly: #000;
153
- --form-font-color-disabled: #666;
154
- --form-font-color-placeholder: #ccc;
155
-
156
- --form-border-width: 0.1rem;
157
- --form-border-radius: 0.8rem;
158
- --form-border-color: #d4d4d4;
159
- --form-border-color-focused: #8cf;
160
- --form-border-color-error: #f00;
161
- --form-border-color-readonly: #ddd;
162
- --form-border-color-disabled: #ddd;
44
+ /*
45
+ .color-primary
46
+ .color-success
47
+ .color-warning
48
+ .color-danger
49
+ .color-error
50
+ .color-grey
51
+
52
+ .bg-primary
53
+ .bg-success
54
+ .bg-warning
55
+ .bg-danger
56
+ .bg-error
57
+ .bg-grey
58
+ */
163
59
 
164
- --form-background-color: #fff;
165
- --form-background-color-readonly: #fafafa;
166
- --form-background-color-disabled: #f6f6f6;
60
+ /*
61
+ .flex (s,m,l,xl)
62
+
63
+ .flex.fr (s,m,l,xl) - flex row
64
+ .flex.fc (s,m,l,xl) - flex column
65
+ .flex.fw (s,m,l,xl) - flex wrap
66
+ .flex.fnw (s,m,l,xl) - flex nowrap
67
+
68
+ .flex.ais (s,m,l,xl) - stretch
69
+ .flex.aifs (s,m,l,xl) - flex start
70
+ .flex.aic (s,m,l,xl) - center
71
+ .flex.aife (s,m,l,xl) - flex end
72
+
73
+ .flex.jcfs (s,m,l,xl) - flex start
74
+ .flex.jcc (s,m,l,xl) - center
75
+ .flex.jcfe (s,m,l,xl) - flex end
76
+ .flex.jcsb (s,m,l,xl) - space between
77
+ .flex.jcsa (s,m,l,xl) - space around
78
+ .flex.jcse (s,m,l,xl) - space evenly
79
+
80
+ .flex > .c[1-12]/[1-12] (s,m,l,xl) - column width "column/columns"
81
+ */
167
82
 
168
- Additional variables and their default values:
169
- --form-height: 4rem;
83
+ /*
84
+ .flow
85
+ .flow.s[0-10] (s,m,l,xl) - vertical space
86
+ */
170
87
 
171
- buttons.css
172
- ===========
173
- --button-height-coeff: 2.5;
174
- --button-side-padding-coeff: 1.25;
175
- --button-color: var(--color-grey);
176
- --button-font-color: #000;
177
- --button-transition: all .1s ease-out;
178
- --button-font-size: var(--font-size);
179
- --button-transform: scale(1);
180
- --button-transform-hover: none;
181
- --button-transform-active: scale(.99);
182
- --button-transform-origin: center bottom;
183
- --button-box-shadow: none;
184
- --button-box-shadow-hover: none;
185
- --button-box-shadow-active: none;
88
+ /*
89
+ .grid (s,m,l,xl)
90
+ .grid.g[1-12] (s,m,l,xl) - columns limit in grid
91
+ .grid > .c[1-12] (s,m,l,xl) - column width
92
+ .grid > .c[1-12]/[1-12] (s,m,l,xl) - columns range for content
93
+ */
186
94
 
187
- Additional variables and their default values:
188
- --button-height: 4rem;
189
- --button-side-padding: 2rem;
190
- --button-font-family: var(--font-family);
191
- --button-font-weight: 400;
192
- --button-disabled-opacity: .5;
193
- --button-border-radius: calc(var(--button-font-size) * 0.6);
194
- --button-color-hover: auto;
195
- --button-color-active: auto;
196
- --button-font-color-hover: auto;
197
- --button-font-color-active: auto;
95
+ /*
96
+ .antialiased
97
+ .container
98
+ .unselectable
99
+ .unclickable
100
+ .upper
101
+ .lower
102
+ .nowrap
103
+ .hyphens
104
+ .pointer
105
+ .toe - text-overflow: ellipsis
106
+ .lc[1-5] (m,l,xl) — text line clamp
107
+ .oh
108
+ .touch-show
109
+ .touch-hide
110
+ .rel
111
+ .abs
112
+ .ins
113
+ .fit-none (s,m,l,xl)
114
+ .fit-cover (s,m,l,xl)
115
+ .fit-contain (s,m,l,xl)
116
+ .t[0-12][n] (s,m,l,xl)
117
+ .b[0-12][n] (s,m,l,xl)
118
+ .l[0-12][n] (s,m,l,xl)
119
+ .r[0-12][n] (s,m,l,xl)
120
+ .z[0-12] (s,m,l,xl)
121
+ .op[0-10]
122
+ .ratio1x1 (s,m,l,xl)
123
+ .ratio2x1 (s,m,l,xl)
124
+ .ratio3x1 (s,m,l,xl)
125
+ .ratio4x1 (s,m,l,xl)
126
+ .ratio3x2 (s,m,l,xl)
127
+ .ratio4x3 (s,m,l,xl)
128
+ .ratio16x9 (s,m,l,xl)
129
+ .ratio1x2 (s,m,l,xl)
130
+ .ratio1x3 (s,m,l,xl)
131
+ .ratio1x4 (s,m,l,xl)
132
+ .ratio2x3 (s,m,l,xl)
133
+ .ratio3x4 (s,m,l,xl)
134
+ .ratio9x16 (s,m,l,xl)
135
+ .break-word
136
+ .visually-hidden
137
+ .invisible
138
+ .scroll-responsive
139
+ .hidden (s,m,l,xl)
140
+ .hidden-next (s,m,l,xl)
141
+ .block (s,m,l,xl)
142
+ .inline (s,m,l,xl)
143
+ .inline-block (s,m,l,xl)
144
+ .fullscreen
145
+ .max (s,m,l,xl)
146
+ .w[10-190] step 10 (s,m,l,xl)
147
+ .w[200-380] step 20 (s,m,l,xl)
148
+ .w[400-1600] step 100 (s,m,l,xl)
149
+ .max[10-190] step 10 (s,m,l,xl)
150
+ .max[200-380] step 20 (s,m,l,xl)
151
+ .max[400-1600] step 100 (s,m,l,xl)
152
+ .min[10-190] step 10 (s,m,l,xl)
153
+ .min[200-380] step 20 (s,m,l,xl)
154
+ .min[400-1600] step 100 (s,m,l,xl)
155
+ .al (s,m,l,xl)
156
+ .ar (s,m,l,xl)
157
+ .ac (s,m,l,xl)
158
+ .aj (s,m,l,xl)
159
+ .m[0-12][n] (s,m,l,xl)
160
+ .mx[0-12][n] (s,m,l,xl)
161
+ .my[0-12][n] (s,m,l,xl)
162
+ .mt[0-12][n] (s,m,l,xl)
163
+ .mb[0-12][n] (s,m,l,xl)
164
+ .ml[0-12][n] (s,m,l,xl)
165
+ .mr[0-12][n] (s,m,l,xl)
166
+ .ma (s,m,l,xl)
167
+ .mxa (s,m,l,xl)
168
+ .mya (s,m,l,xl)
169
+ .mta (s,m,l,xl)
170
+ .mba (s,m,l,xl)
171
+ .mla (s,m,l,xl)
172
+ .mra (s,m,l,xl)
173
+ .p[0-12] (s,m,l,xl)
174
+ .px[0-12] (s,m,l,xl)
175
+ .py[0-12] (s,m,l,xl)
176
+ .pt[0-12] (s,m,l,xl)
177
+ .pb[0-12] (s,m,l,xl)
178
+ .pl[0-12] (s,m,l,xl)
179
+ .pr[0-12] (s,m,l,xl)
180
+ .gap[0-12] (s,m,l,xl)
181
+ .gapx[0-12] (s,m,l,xl)
182
+ .gapy[0-12] (s,m,l,xl)
183
+ .br[0-12] (s,m,l,xl)
184
+ .br100 (s,m,l,xl)
185
+ .sh[0-10] (s,m,l,xl)
186
+ .o[0-10] (s,m,l,xl)
187
+ .no-print
188
+ */
198
189
 
199
- dropdown.css
200
- ============
201
- --dropdown-border-radius: 1.2rem;
202
- --dropdown-backgroud-color: white;
203
- --dropdown-box-shadow: var(--shadow-4);
204
- --dropdown-padding: .8rem;
205
- --dropdown-item-padding: .6rem 2.4rem .6rem 1.2rem;
206
- --dropdown-item-font-color: black;
207
- --dropdown-item-font-color-hover: black;
208
- --dropdown-item-background-color: white;
209
- --dropdown-item-background-color-hover: var(--color-grey);
210
- --dropdown-divider-color: var(--color-grey);
190
+ /*
191
+ .icon - base icon style
192
+ .icon.s[10-60] step 2 (m,l) - icon size in px
193
+ */
211
194
 
212
- slides.css
213
- ==========
214
- --slides-point-color: #ffffff66;
215
- --slides-point-color-active: #fff;
216
- --slides-point-size: .3rem;
217
- --slides-point-gap: .3rem;
218
- --slides-point-side-padding: 1.6rem;
219
- --slides-point-bottom-padding: 1rem;
195
+ /*
196
+ a
197
+ a.link
198
+ a.hover
199
+ a.active
200
+ a.link--noline
201
+ a.link--underline
202
+ a.link--dashed
203
+ a.link--dotted
204
+ a.link--wavy
205
+ */
220
206
 
221
- modal.css
222
- =========
223
- --modal-margin-x: 3vw;
224
- --modal-margin-y: 3vw;
225
- --modal-padding: clamp(4rem, 4vw, 5rem) clamp(2.5rem, 4vw, 5rem);
226
- --modal-background: #fff;
227
- --modal-box-shadow: 0 1rem 4rem #00000033;
228
- --modal-border-radius: 1.6rem;
229
- --modal-closer-margin: .6rem;
230
- --modal-closer-area: 4rem;
231
- --modal-closer-size: 2.6rem;
232
- --modal-closer-width: .2rem;
233
- --modal-closer-color: #ccc;
234
- --modal-closer-color-hover: #f00;
235
- --modal-overlay-background-color: #00000066;
207
+ /*
208
+ .scroll
209
+ .scroll--contain
210
+ .scroll--x-proximity
211
+ .scroll--x-mandatory
212
+ */
236
213
 
237
- scroll.css
238
- ==========
239
- --scroll-scrollbar-size: 6px;
240
- --scroll-scrollbar-thumb-background: #00000011;
241
- --scroll-scrollbar-thumb-background-hover: #00000022;
214
+ /*
215
+ .space[0-10] (s,m,l,xl) - vertical space
216
+ */
242
217
 
243
- colors.css
244
- ==========
245
- --color-primary: #0088ee;
246
- --color-success: #33c433;
247
- --color-warning: #ff8800;
248
- --color-danger: #ee3333;
249
- --color-error: #ee3333;
250
- --color-grey: #f4f5f6;
218
+ /* .sticky (s,m,l,xl) */
251
219
 
220
+ /*
221
+ .h[1-6]
222
+ .mono
223
+ .italic
224
+ .strike
225
+ .fs[10-19] step 1 (m,l,xl) - size in rem - 1.0, 1.1, 1.2, ..., 1.9
226
+ .fs[20-64] step 2 (m,l,xl) - size in rem - 2.0, 2.2, 2.4, ..., 6.4
227
+ .fw[100-900] step 100 (m,l,xl)
228
+ .ls[0-4] (m,l,xl)
229
+ .lh[0-9] (m,l,xl) - values: 1.0-1.9
252
230
  */
package/src/js/app.js CHANGED
@@ -9,8 +9,8 @@
9
9
 
10
10
  import './x.js';
11
11
  // import Alpine from 'alpinejs'
12
-
13
-
12
+
13
+
14
14
  // window.Alpine = Alpine;
15
15
  // Alpine.start();
16
16
 
@@ -19,29 +19,29 @@ x.init();
19
19
  // Animation global functions
20
20
  window.element1 = (params) => {
21
21
  let rotate = params.progress * -360;
22
- params.element.style.transform = 'rotate(' + rotate + 'deg)';
22
+ params.element.style.transform = 'rotate(' + rotate + 'deg)';
23
23
  }
24
24
  window.element2 = (params) => {
25
25
  let rotate = params.progress * 180;
26
- params.element.style.transform = 'rotate(' + rotate + 'deg)';
26
+ params.element.style.transform = 'rotate(' + rotate + 'deg)';
27
27
  }
28
28
  window.element3 = (params) => {
29
29
  let rotate = params.progress * 120;
30
- params.element.style.transform = 'rotate(' + rotate + 'deg)';
30
+ params.element.style.transform = 'rotate(' + rotate + 'deg)';
31
31
  }
32
32
  window.headerAnimation = (params) => {
33
33
  // console.log(x.device.size.s);
34
- let _height = x.device.size.s ? 100 : 120;
34
+ let _height = 100;
35
35
  // console.log(_height);
36
36
  let header = qs('.header');
37
37
  let headerLogo = qs('.header-logo img');
38
38
  let height = _height - params.progress * _height / 2;
39
39
  let scale = 1 - params.progress * 0.5;
40
40
  header.style.height = height + 'px';
41
- headerLogo.style.transform = 'scale(' + scale + ')';
41
+ headerLogo.style.transform = 'scale(' + scale + ')';
42
42
  x.lib.switchClass(header, 'header_compact', params.progress == 1);
43
43
  }
44
44
 
45
45
  window.onload = () => {
46
46
  x.lib.transitionsOn()
47
- }
47
+ }
package/src/js/x.js CHANGED
@@ -7,45 +7,45 @@
7
7
  //
8
8
 
9
9
 
10
- import { modal } from "../components/x/modal";
11
- import { animate } from "../components/x/animate";
12
- import { appear } from "../components/x/appear";
13
- import { lazyload } from "../components/x/lazyload";
14
- import { loadmore } from "../components/x/loadmore";
15
- import { sheets } from "../components/x/sheets";
16
- import { dropdown } from "../components/x/dropdown";
17
- import { autocomplete } from "../components/x/autocomplete";
18
- import { scroll } from "../components/x/scroll";
19
- import { hover } from "../components/x/hover";
20
- import { device } from "../components/x/device";
21
- import { lib } from "../components/x/lib";
22
- import { form } from "../components/x/form";
23
- import { sticky } from "../components/x/sticky";
24
- import { slider } from "../components/x/slider";
10
+ import { modal } from "../components/x/modal";
11
+ import { animate } from "../components/x/animate";
12
+ import { appear } from "../components/x/appear";
13
+ import { lazyload } from "../components/x/lazyload";
14
+ import { loadmore } from "../components/x/loadmore";
15
+ import { sheets } from "../components/x/sheets";
16
+ import { dropdown } from "../components/x/dropdown";
17
+ import { autocomplete } from "../components/x/autocomplete";
18
+ import { scroll } from "../components/x/scroll";
19
+ import { hover } from "../components/x/hover";
20
+ import { device } from "../components/x/device";
21
+ import { lib } from "../components/x/lib";
22
+ import { form } from "../components/x/form";
23
+ import { sticky } from "../components/x/sticky";
24
+ import { slider } from "../components/x/slider";
25
25
 
26
26
 
27
27
  class X {
28
28
  constructor() {
29
- this.modal = modal;
30
- this.animate = animate;
31
- this.appear = appear;
32
- this.lazyload = lazyload;
33
- this.loadmore = loadmore;
34
- this.sheets = sheets;
35
- this.dropdown = dropdown;
29
+ this.modal = modal;
30
+ this.animate = animate;
31
+ this.appear = appear;
32
+ this.lazyload = lazyload;
33
+ this.loadmore = loadmore;
34
+ this.sheets = sheets;
35
+ this.dropdown = dropdown;
36
36
  this.autocomplete = autocomplete;
37
- this.scroll = scroll;
38
- this.hover = hover;
39
- this.device = device;
40
- this.lib = lib;
41
- this.render = lib.render.bind(lib);
42
- this.form = form;
43
- this.sticky = sticky;
44
- this.slider = slider;
45
-
37
+ this.scroll = scroll;
38
+ this.hover = hover;
39
+ this.device = device;
40
+ this.lib = lib;
41
+ this.render = lib.render.bind(lib);
42
+ this.form = form;
43
+ this.sticky = sticky;
44
+ this.slider = slider;
45
+
46
46
  this.initialized = false;
47
47
  }
48
-
48
+
49
49
  init() {
50
50
  if (!this.initialized) {
51
51
  this.device.init();
@@ -60,7 +60,7 @@ class X {
60
60
  this.sticky.init();
61
61
  this.slider.init();
62
62
  hover.init();
63
-
63
+
64
64
  this.initialized = true;
65
65
  }
66
66
  }
@@ -71,11 +71,7 @@ const x = new X();
71
71
  // Make 'x' as global variable
72
72
  window.x = x;
73
73
 
74
- // Query selectors shorthands
75
- window.qs = x.lib.qs;
76
- window.qsa = x.lib.qsa;
77
-
78
- // New shortcuts for selectors
79
- window.x.id = x.lib.id;
80
- window.x.qs = x.lib.qs;
81
- window.x.qsa = x.lib.qsa;
74
+ // Shortcuts for selectors
75
+ window.x.id = x.lib.id;
76
+ window.x.qs = x.lib.qs;
77
+ window.x.qsa = x.lib.qsa;
Binary file
Binary file
Binary file
package/babel.config.cjs DELETED
@@ -1,4 +0,0 @@
1
- // babel.config.cjs — used by Jest (babel-jest)
2
- module.exports = {
3
- presets: ['@babel/preset-env'],
4
- };