@kth/style 0.13.1 → 0.13.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.
@@ -1,2 +1 @@
1
1
  export { MenuPanel } from "./components/MenuPanel";
2
- export { ScrollObserver } from "./components/ScrollObserver";
package/dist/cjs/index.js CHANGED
@@ -124,27 +124,4 @@ class MenuPanel {
124
124
  }
125
125
  }
126
126
 
127
- const DEFAULT_OPTIONS = {
128
- threshold: 32,
129
- className: "collapsed",
130
- };
131
- function toggleClass(element, { threshold, className }) {
132
- if (window.scrollY > threshold) {
133
- element?.classList.add(className);
134
- }
135
- else {
136
- element?.classList.remove(className);
137
- }
138
- }
139
- class ScrollObserver {
140
- /** Sets a class in an element when the window scroll is below a treshold */
141
- static setClass(element, options = DEFAULT_OPTIONS) {
142
- toggleClass(element, options);
143
- window.addEventListener("scroll", () => {
144
- toggleClass(element, options);
145
- });
146
- }
147
- }
148
-
149
127
  exports.MenuPanel = MenuPanel;
150
- exports.ScrollObserver = ScrollObserver;
@@ -1,2 +1 @@
1
1
  export { MenuPanel } from "./components/MenuPanel";
2
- export { ScrollObserver } from "./components/ScrollObserver";
package/dist/esm/index.js CHANGED
@@ -122,26 +122,4 @@ class MenuPanel {
122
122
  }
123
123
  }
124
124
 
125
- const DEFAULT_OPTIONS = {
126
- threshold: 32,
127
- className: "collapsed",
128
- };
129
- function toggleClass(element, { threshold, className }) {
130
- if (window.scrollY > threshold) {
131
- element?.classList.add(className);
132
- }
133
- else {
134
- element?.classList.remove(className);
135
- }
136
- }
137
- class ScrollObserver {
138
- /** Sets a class in an element when the window scroll is below a treshold */
139
- static setClass(element, options = DEFAULT_OPTIONS) {
140
- toggleClass(element, options);
141
- window.addEventListener("scroll", () => {
142
- toggleClass(element, options);
143
- });
144
- }
145
- }
146
-
147
- export { MenuPanel, ScrollObserver };
125
+ export { MenuPanel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kth/style",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "exports": {
@@ -27,8 +27,7 @@
27
27
  color: var(--color-text);
28
28
  background: var(--color-background);
29
29
  padding-block: spacing.$space-16;
30
- width: 100%;
31
- transition: padding-block 500ms cubic-bezier(0.05, 0.7, 0.1, 1);
30
+ position: relative;
32
31
 
33
32
  &__container {
34
33
  @include mixins.container;
@@ -9,6 +9,7 @@
9
9
  inline-size: 4rem;
10
10
  border: none;
11
11
  margin: 0;
12
+ margin-inline-end: spacing.$space-32;
12
13
  padding: 0;
13
14
 
14
15
  // Defensive measurement:
@@ -19,5 +20,10 @@
19
20
  block-size: 100%;
20
21
  inline-size: 100%;
21
22
  }
23
+
24
+ img {
25
+ block-size: 100%;
26
+ inline-size: 100%;
27
+ }
22
28
  }
23
29
  }
@@ -14,6 +14,15 @@
14
14
 
15
15
  &__container {
16
16
  @include mixins.container;
17
+
18
+ &.search {
19
+ display: flex;
20
+ flex-direction: column;
21
+
22
+ .kth-icon-button {
23
+ align-self: end;
24
+ }
25
+ }
17
26
  }
18
27
 
19
28
  &__header {
@@ -1,9 +0,0 @@
1
- interface Options {
2
- threshold: number;
3
- className: string;
4
- }
5
- export declare class ScrollObserver {
6
- /** Sets a class in an element when the window scroll is below a treshold */
7
- static setClass(element: HTMLElement | null, options?: Options): void;
8
- }
9
- export {};
@@ -1,9 +0,0 @@
1
- interface Options {
2
- threshold: number;
3
- className: string;
4
- }
5
- export declare class ScrollObserver {
6
- /** Sets a class in an element when the window scroll is below a treshold */
7
- static setClass(element: HTMLElement | null, options?: Options): void;
8
- }
9
- export {};