@becklyn/next 1.0.1 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@becklyn/next",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "lint": "eslint . --max-warnings 0 && prettier --check \"./**/*.{ts,tsx}\"",
@@ -14,7 +14,7 @@
14
14
  "@popperjs/core": "^2.11.8",
15
15
  "keen-slider": "^6.8.6",
16
16
  "react-popper": "^2.3.0",
17
- "sass": "^1.82.0"
17
+ "sass": "^1.85.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@becklyn/eslint": "*",
@@ -32,16 +32,69 @@
32
32
  "next": "^14.0.0 || ^15.0.0"
33
33
  },
34
34
  "files": [
35
- "./dist"
35
+ "./dist",
36
+ "./scss"
36
37
  ],
37
- "main": "./dist/cjs/index.js",
38
- "module": "./dist/es/index.js",
39
38
  "exports": {
40
- ".": {
41
- "require": "./dist/cjs/index.js",
42
- "import": "./dist/es/index.js",
43
- "default": "./dist/cjs/index.js"
39
+ "./contentful/*": {
40
+ "types": "./dist/cjs/contentful/*.d.ts",
41
+ "require": "./dist/cjs/contentful/*.js",
42
+ "import": "./dist/es/contentful/*.js",
43
+ "default": "./dist/cjs/contentful/*.js"
44
44
  },
45
- "./package.json": "./package.json"
45
+ "./format/*": {
46
+ "types": "./dist/cjs/format/*.d.ts",
47
+ "require": "./dist/cjs/format/*.js",
48
+ "import": "./dist/es/format/*.js",
49
+ "default": "./dist/cjs/format/*.js"
50
+ },
51
+ "./lib/*": {
52
+ "types": "./dist/cjs/lib/*.d.ts",
53
+ "require": "./dist/cjs/lib/*.js",
54
+ "import": "./dist/es/lib/*.js",
55
+ "default": "./dist/cjs/lib/*.js"
56
+ },
57
+ "./mock/*": {
58
+ "types": "./dist/cjs/mock/*.d.ts",
59
+ "require": "./dist/cjs/mock/*.js",
60
+ "import": "./dist/es/mock/*.js",
61
+ "default": "./dist/cjs/mock/*.js"
62
+ },
63
+ "./rte/*": {
64
+ "types": "./dist/cjs/rte/*.d.ts",
65
+ "require": "./dist/cjs/rte/*.js",
66
+ "import": "./dist/es/rte/*.js",
67
+ "default": "./dist/cjs/rte/*.js"
68
+ },
69
+ "./structuredData/*": {
70
+ "types": "./dist/cjs/structuredData/*.d.ts",
71
+ "require": "./dist/cjs/structuredData/*.js",
72
+ "import": "./dist/es/structuredData/*.js",
73
+ "default": "./dist/cjs/structuredData/*.js"
74
+ },
75
+ "./tracking/*": {
76
+ "types": "./dist/cjs/tracking/*.d.ts",
77
+ "require": "./dist/cjs/tracking/*.js",
78
+ "import": "./dist/es/tracking/*.js",
79
+ "default": "./dist/cjs/tracking/*.js"
80
+ },
81
+ "./tracking/cookiebot/*": {
82
+ "types": "./dist/cjs/tracking/cookiebot/*.d.ts",
83
+ "require": "./dist/cjs/tracking/cookiebot/*.js",
84
+ "import": "./dist/es/tracking/cookiebot/*.js",
85
+ "default": "./dist/cjs/tracking/cookiebot/*.js"
86
+ },
87
+ "./tracking/gtm/*": {
88
+ "types": "./dist/cjs/tracking/gtm/*.d.ts",
89
+ "require": "./dist/cjs/tracking/gtm/*.js",
90
+ "import": "./dist/es/tracking/gtm/*.js",
91
+ "default": "./dist/cjs/tracking/gtm/*.js"
92
+ },
93
+ "./types/*": {
94
+ "types": "./dist/cjs/types/*.d.ts",
95
+ "require": "./dist/cjs/types/*.js",
96
+ "import": "./dist/es/types/*.js",
97
+ "default": "./dist/cjs/types/*.js"
98
+ }
46
99
  }
47
100
  }
@@ -0,0 +1,18 @@
1
+ @mixin transition($properties, $duration: 0.15s, $easing: ease-in-out, $will-change: true) {
2
+ @if $will-change {
3
+ will-change: join($properties, (), "comma");
4
+ }
5
+
6
+ @if (1 == length($properties)) {
7
+ transition: #{$duration} #{$easing} #{$properties};
8
+ } @else {
9
+ transition: #{$duration} #{$easing};
10
+ transition-property: join($properties, (), "comma");
11
+ }
12
+ }
13
+
14
+ @mixin reduced {
15
+ @media (prefers-reduced-motion) {
16
+ @content;
17
+ }
18
+ }
@@ -0,0 +1,23 @@
1
+ @mixin tablet {
2
+ @media (min-width: 744px) {
3
+ @content;
4
+ }
5
+ }
6
+
7
+ @mixin large-tablet {
8
+ @media (min-width: 1024px) {
9
+ @content;
10
+ }
11
+ }
12
+
13
+ @mixin desktop {
14
+ @media (min-width: 1440px) {
15
+ @content;
16
+ }
17
+ }
18
+
19
+ @mixin large-desktop {
20
+ @media (min-width: 1920px) {
21
+ @content;
22
+ }
23
+ }
package/scss/fill.scss ADDED
@@ -0,0 +1,15 @@
1
+ @mixin fillParent {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ }
8
+
9
+ @mixin fillWindow {
10
+ position: fixed;
11
+ top: 0;
12
+ right: 0;
13
+ bottom: 0;
14
+ left: 0;
15
+ }
@@ -0,0 +1,55 @@
1
+ @mixin hover {
2
+ @media (hover: hover) {
3
+ &:hover {
4
+ @content;
5
+ }
6
+ }
7
+ }
8
+
9
+ @mixin focus {
10
+ &:focus {
11
+ @content;
12
+ }
13
+ }
14
+
15
+ @mixin focus-visible {
16
+ &:focus-visible {
17
+ @content;
18
+ }
19
+ }
20
+
21
+ @mixin hover-focus {
22
+ @include hover {
23
+ @content;
24
+ }
25
+ @include focus {
26
+ @content;
27
+ }
28
+ }
29
+
30
+ @mixin focus-within {
31
+ &:focus-within {
32
+ @content;
33
+ }
34
+ }
35
+
36
+ @mixin hover-focus-visible {
37
+ @include hover {
38
+ @content;
39
+ }
40
+ @include focus-visible {
41
+ @content;
42
+ }
43
+ }
44
+
45
+ @mixin active {
46
+ &:active {
47
+ @content;
48
+ }
49
+ }
50
+
51
+ @mixin disabled {
52
+ &:disabled {
53
+ @content;
54
+ }
55
+ }
@@ -0,0 +1,6 @@
1
+ @forward "./animation.scss";
2
+ @forward "./breakpoints.scss";
3
+ @forward "./interaction.scss";
4
+ @forward "./sizing.scss";
5
+ @forward "./fill.scss";
6
+ @forward "./support.scss";
@@ -0,0 +1,257 @@
1
+ // This is adapted from normalize.css but specialized for the specific needs of Becklyn Studios
2
+ // http://necolas.github.io/normalize.css/
3
+
4
+ // ---------------------------------------------------------------------------------------------------------
5
+ // Document
6
+ // ---------------------------------------------------------------------------------------------------------
7
+
8
+ html {
9
+ -ms-text-size-adjust: 100%;
10
+ -webkit-text-size-adjust: 100%;
11
+ box-sizing: border-box;
12
+ scroll-behavior: smooth;
13
+ }
14
+
15
+ * {
16
+ margin: 0;
17
+ padding: 0;
18
+ }
19
+
20
+ *,
21
+ ::before,
22
+ ::after {
23
+ box-sizing: inherit;
24
+ }
25
+
26
+ body {
27
+ -moz-osx-font-smoothing: grayscale;
28
+ -webkit-font-smoothing: antialiased;
29
+ text-rendering: optimizeLegibility;
30
+ }
31
+
32
+ html,
33
+ body {
34
+ height: 100%;
35
+ }
36
+
37
+ // ---------------------------------------------------------------------------------------------------------
38
+ // Grouping content
39
+ // ---------------------------------------------------------------------------------------------------------
40
+
41
+ main {
42
+ display: block;
43
+ }
44
+
45
+ h1,
46
+ h2,
47
+ h3,
48
+ h4,
49
+ h5,
50
+ h6 {
51
+ font-style: inherit;
52
+ font-weight: inherit;
53
+ font-size: inherit;
54
+ }
55
+
56
+ // ---------------------------------------------------------------------------------------------------------
57
+ // Text level semantics
58
+ // ---------------------------------------------------------------------------------------------------------
59
+
60
+ b,
61
+ strong {
62
+ font-weight: 700;
63
+ }
64
+
65
+ a {
66
+ background-color: transparent;
67
+ color: inherit;
68
+ text-decoration: none;
69
+ }
70
+
71
+ code,
72
+ kbd {
73
+ font-size: 1em;
74
+ font-family: monospace, monospace;
75
+ }
76
+
77
+ small {
78
+ font-size: 80%;
79
+ }
80
+
81
+ sub,
82
+ sup {
83
+ position: relative;
84
+ vertical-align: baseline;
85
+ font-size: 75%;
86
+ line-height: 0;
87
+ }
88
+
89
+ sub {
90
+ bottom: -0.25em;
91
+ }
92
+
93
+ sup {
94
+ top: -0.5em;
95
+ }
96
+
97
+ // ---------------------------------------------------------------------------------------------------------
98
+ // Embedded content
99
+ // ---------------------------------------------------------------------------------------------------------
100
+
101
+ audio,
102
+ video {
103
+ display: block;
104
+ }
105
+
106
+ audio:not([controls]) {
107
+ display: none;
108
+ height: 0;
109
+ }
110
+
111
+ img {
112
+ border-style: none;
113
+ max-width: 100%;
114
+ }
115
+
116
+ // ---------------------------------------------------------------------------------------------------------
117
+ // Forms
118
+ // ---------------------------------------------------------------------------------------------------------
119
+
120
+ // Don't forget to style the focus state as well!
121
+ button {
122
+ border: 0;
123
+ border-radius: 0;
124
+ color: inherit;
125
+ -webkit-font-smoothing: inherit;
126
+ appearance: button;
127
+ -webkit-appearance: button;
128
+ cursor: pointer;
129
+ outline: 0;
130
+ background: none transparent;
131
+ letter-spacing: inherit;
132
+ }
133
+
134
+ button,
135
+ input {
136
+ overflow: visible;
137
+ }
138
+
139
+ button,
140
+ input,
141
+ textarea {
142
+ font: inherit;
143
+ text-align: inherit;
144
+ }
145
+
146
+ input:disabled,
147
+ textarea:disabled {
148
+ color: inherit;
149
+ }
150
+
151
+ button,
152
+ select {
153
+ text-transform: none;
154
+ }
155
+
156
+ progress {
157
+ vertical-align: baseline;
158
+ }
159
+
160
+ textarea {
161
+ overflow: auto;
162
+ }
163
+
164
+ [type="checkbox"],
165
+ [type="radio"] {
166
+ box-sizing: border-box;
167
+ padding: 0;
168
+ }
169
+
170
+ [type="number"]::-webkit-inner-spin-button,
171
+ [type="number"]::-webkit-outer-spin-button {
172
+ height: auto;
173
+ }
174
+
175
+ [type="search"] {
176
+ appearance: button;
177
+ -webkit-appearance: textfield;
178
+ outline-offset: -2px;
179
+ }
180
+
181
+ :focus {
182
+ outline: 0;
183
+ }
184
+
185
+ ::-moz-focus-inner {
186
+ border: 0;
187
+ padding: 0;
188
+ }
189
+
190
+ ::-webkit-file-upload-button {
191
+ appearance: button;
192
+ -webkit-appearance: button;
193
+ font: inherit;
194
+ }
195
+
196
+ // ---------------------------------------------------------------------------------------------------------
197
+ // Tables
198
+ // ---------------------------------------------------------------------------------------------------------
199
+
200
+ table {
201
+ border-collapse: collapse;
202
+ }
203
+
204
+ th {
205
+ font-weight: inherit;
206
+ text-align: left;
207
+ }
208
+
209
+ // ---------------------------------------------------------------------------------------------------------
210
+ // Interactive
211
+ // ---------------------------------------------------------------------------------------------------------
212
+
213
+ details,
214
+ menu {
215
+ display: block;
216
+ }
217
+
218
+ summary {
219
+ display: list-item;
220
+ }
221
+
222
+ // ---------------------------------------------------------------------------------------------------------
223
+ // Scripting
224
+ // ---------------------------------------------------------------------------------------------------------
225
+
226
+ template {
227
+ display: none;
228
+ }
229
+
230
+ // ---------------------------------------------------------------------------------------------------------
231
+ // Hidden
232
+ // ---------------------------------------------------------------------------------------------------------
233
+
234
+ [hidden] {
235
+ display: none;
236
+ }
237
+
238
+ // ---------------------------------------------------------------------------------------------------------
239
+ // SVG
240
+ // ---------------------------------------------------------------------------------------------------------
241
+
242
+ svg {
243
+ display: inline-block;
244
+ // By default IE11 renders SVGs with overflow enabled, which can caused weird rendering issues
245
+ overflow: hidden;
246
+ }
247
+
248
+ // ---------------------------------------------------------------------------------------------------------
249
+ // Lists
250
+ // ---------------------------------------------------------------------------------------------------------
251
+
252
+ // Disable list styling on lists by default, as the styling should be set
253
+ // explicitly in the \`.content\` class (already done in the \`content()\` mixin.
254
+ ul,
255
+ ol {
256
+ list-style: none;
257
+ }
@@ -0,0 +1,14 @@
1
+ @mixin square($size) {
2
+ width: $size;
3
+ height: $size;
4
+ }
5
+
6
+ @mixin aspect-ratio($value) {
7
+ @if type-of($value) != "number" {
8
+ @error "The value parameter must be of type 'number'.";
9
+ }
10
+
11
+ padding-bottom: #{100 * $value}#{"%"};
12
+ width: 100%;
13
+ height: 0;
14
+ }
@@ -0,0 +1,7 @@
1
+ @mixin support($property, $value, $fallback) {
2
+ #{$property}: $fallback;
3
+
4
+ @supports (#{$property}: $value) {
5
+ #{$property}: $value;
6
+ }
7
+ }
package/scss/text.scss ADDED
@@ -0,0 +1,72 @@
1
+ @use "sass:map";
2
+ @use "sass:list";
3
+
4
+ $text-variants: "headline" !default;
5
+
6
+ $font-sizes: (
7
+ "headline": 52px,
8
+ ) !default;
9
+
10
+ $font-weights: (
11
+ "headline": 700,
12
+ ) !default;
13
+
14
+ // line height is calculated by dividing the line height rem by the font size rem
15
+ $line-height: (
16
+ "headline": 1.11,
17
+ ) !default;
18
+
19
+ $letter-spacings: (
20
+ "headline": -1.04px,
21
+ ) !default;
22
+
23
+ $font-families: (
24
+ "headline": var(--font-family-name),
25
+ ) !default;
26
+
27
+ $default-font-family: var(--font-family-name) !default;
28
+
29
+ @mixin text($variant) {
30
+ @if list.index($text-variants, $variant) == null {
31
+ @error "Invalid text variant #{$variant}";
32
+ }
33
+
34
+ font-weight: map.get($font-weights, $variant);
35
+ font-size: map.get($font-sizes, $variant);
36
+ line-height: map.get($line-height, $variant);
37
+ letter-spacing: map.get($letter-spacings, $variant);
38
+
39
+ @if map.get($font-families, $variant) != $default-font-family {
40
+ font-family: map.get($font-families, $variant);
41
+ }
42
+ }
43
+
44
+ @mixin text-overflow-ellipsis {
45
+ overflow: hidden;
46
+ text-overflow: ellipsis;
47
+ white-space: nowrap;
48
+ }
49
+
50
+ @mixin vertical-line-clamp($lines, $line-height) {
51
+ @if type-of($lines) != "number" {
52
+ @error "The lines parameter must be of type 'number'.";
53
+ }
54
+
55
+ @if type-of($line-height) != "number" {
56
+ @error "The line-height parameter must be of type 'number'.";
57
+ }
58
+
59
+ height: #{$lines * $line-height}em;
60
+ overflow: hidden;
61
+ line-height: $line-height;
62
+
63
+ @supports (display: -webkit-box) {
64
+ display: -webkit-box;
65
+ -webkit-box-orient: vertical;
66
+ -webkit-line-clamp: $lines;
67
+ line-clamp: $lines;
68
+ // Unset properties, which are used to introduce more hacky way of implementing the same feature for IE
69
+ height: inherit;
70
+ line-height: inherit;
71
+ }
72
+ }