lapikit 0.2.4 → 0.2.5

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.
@@ -4,6 +4,8 @@
4
4
  import { useTheme } from '../../actions/use-theme.js';
5
5
  import { modalOpen, setOpenModal } from '../../stores/components.js';
6
6
 
7
+ import { viewport } from '../../stores/viewport.js';
8
+
7
9
  let {
8
10
  children,
9
11
  themes,
@@ -29,6 +31,21 @@
29
31
  useTheme(colorScheme);
30
32
  }
31
33
  }
34
+
35
+ // Met à jour le store viewport à l'init et sur resize
36
+ function updateViewport() {
37
+ viewport.set({
38
+ innerWidth: window.innerWidth,
39
+ outerWidth: window.outerWidth,
40
+ innerHeight: window.innerHeight,
41
+ outerHeight: window.outerHeight
42
+ });
43
+ }
44
+ updateViewport();
45
+ window.addEventListener('resize', updateViewport);
46
+ return () => {
47
+ window.removeEventListener('resize', updateViewport);
48
+ };
32
49
  });
33
50
  </script>
34
51
 
@@ -11,9 +11,6 @@
11
11
  }
12
12
 
13
13
  /* density */
14
- .kit-toolbar[breakpoint]kit-toolbar--density-default {
15
- border-radius: calc(var(--system-spacing) * 2.25);
16
- }
17
14
  .kit-toolbar[breakpoint]kit-toolbar--density-default:not([class*='toolbar--orientation-vertical']) {
18
15
  height: 3rem;
19
16
  padding-inline: calc(var(--system-spacing) * 1.5);
@@ -24,10 +21,6 @@
24
21
  padding: calc(var(--system-spacing) * 1.5) 0;
25
22
  }
26
23
 
27
- .kit-toolbar[breakpoint]kit-toolbar--density-compact {
28
- border-radius: calc(var(--system-spacing) * 1.75);
29
- }
30
-
31
24
  .kit-toolbar[breakpoint]kit-toolbar--density-compact:not([class*='toolbar--orientation-vertical']) {
32
25
  height: 2.625rem;
33
26
  padding-inline: calc(var(--system-spacing) * 0.75);
@@ -38,10 +31,6 @@
38
31
  padding: calc(var(--system-spacing) * 0.75) 0;
39
32
  }
40
33
 
41
- .kit-toolbar[breakpoint]kit-toolbar--density-comfortable {
42
- border-radius: calc(var(--system-spacing) * 3.5);
43
- }
44
-
45
34
  .kit-toolbar[breakpoint]kit-toolbar--density-comfortable:not(
46
35
  [class*='toolbar--orientation-vertical']
47
36
  ) {
@@ -2,3 +2,4 @@ export * from './breakpoints.js';
2
2
  export * from './devices.js';
3
3
  export * from './themes.js';
4
4
  export * from './components.js';
5
+ export * from './viewport.js';
@@ -2,3 +2,4 @@ export * from './breakpoints.js';
2
2
  export * from './devices.js';
3
3
  export * from './themes.js';
4
4
  export * from './components.js';
5
+ export * from './viewport.js';
@@ -0,0 +1,7 @@
1
+ export type Viewport = {
2
+ innerWidth: number;
3
+ outerWidth: number;
4
+ innerHeight: number;
5
+ outerHeight: number;
6
+ };
7
+ export declare const viewport: import("svelte/store").Writable<Viewport>;
@@ -0,0 +1,7 @@
1
+ import { writable } from 'svelte/store';
2
+ export const viewport = writable({
3
+ innerWidth: 0,
4
+ outerWidth: 0,
5
+ innerHeight: 0,
6
+ outerHeight: 0
7
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lapikit",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"