@avenirs-esr/avenirs-dsav 0.1.43 → 0.1.46

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 +1 @@
1
- export { default as AvToggle } from './AvToggle/AvToggle.vue';
1
+ export { default as AvToggle, type AvToggleProps } from './AvToggle/AvToggle.vue';
@@ -1 +1,2 @@
1
+ export * from './use-breakpoint/use-breakpoint';
1
2
  export * from './use-focus-trap/use-focus-trap';
@@ -0,0 +1,54 @@
1
+ import type { ComputedRef } from 'vue';
2
+ import type { BREAKPOINTS } from '@/config';
3
+ /**
4
+ * Result returned by the useBreakpoint composable.
5
+ */
6
+ export interface UseBreakpointReturn {
7
+ /**
8
+ * Returns a computed boolean that is `true` when the viewport width
9
+ * is strictly **below** the given breakpoint (`max-width: bp - 1px`).
10
+ *
11
+ * Equivalent to the Sass mixin: `@include respond-below($breakpoint)`
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const isMobile = respondBelow(BREAKPOINTS.MD) // true if width <= 767px
16
+ * ```
17
+ */
18
+ respondBelow: (bp: BREAKPOINTS) => ComputedRef<boolean>;
19
+ /**
20
+ * Returns a computed boolean that is `true` when the viewport width
21
+ * is **at or above** the given breakpoint (`min-width: bp`).
22
+ *
23
+ * Equivalent to the Sass mixin: `@include respond-to($breakpoint)`
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const isDesktop = respondTo(BREAKPOINTS.LG) // true if width >= 1024px
28
+ * ```
29
+ */
30
+ respondTo: (bp: BREAKPOINTS) => ComputedRef<boolean>;
31
+ }
32
+ /**
33
+ * Vue composable to handle responsive breakpoints based on the current viewport width.
34
+ *
35
+ * This composable provides reactive utilities (`respondBelow` and `respondTo`)
36
+ * that mirror the behavior of the Sass mixins `@include respond-below($breakpoint)`
37
+ * and `@include respond-to($breakpoint)`, allowing you to keep logic and styles
38
+ * perfectly in sync.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const { respondBelow, respondTo } = useBreakpoint()
43
+ *
44
+ * const isMobile = respondBelow(BREAKPOINTS.MD) // true if width < 768px
45
+ * const isDesktop = respondTo(BREAKPOINTS.LG) // true if width >= 1024px
46
+ * ```
47
+ *
48
+ * @returns {UseBreakpointReturn} Object containing:
49
+ * - `respondBelow`: Returns a computed boolean (`true` if width < breakpoint),
50
+ * - `respondTo`: Returns a computed boolean (`true` if width >= breakpoint).
51
+ *
52
+ * @see BREAKPOINTS for the defined responsive thresholds.
53
+ */
54
+ export declare function useBreakpoint(): UseBreakpointReturn;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Breakpoints as defined in src/styles/breakpoints.scss
3
+ * Values are in px to be able to work with window.with
4
+ */
5
+ export declare enum BREAKPOINTS {
6
+ SM = 576,/* 36rem */
7
+ MD = 768,/* 48rem */
8
+ LG = 1024,/* 64rem */
9
+ XL = 1440
10
+ }
@@ -1 +1,2 @@
1
+ export * from './breakpoints';
1
2
  export * from './page-sizes';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@/styles/main.scss';
2
- export * from './components';
2
+ export * from './components/index';
3
3
  export * from './composables';
4
4
  export * from './config';
5
5
  export * from './tests';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@avenirs-esr/avenirs-dsav",
3
3
  "type": "module",
4
- "version": "0.1.43",
4
+ "version": "0.1.46",
5
5
  "main": "dist/avenirs-dsav.umd.js",
6
6
  "module": "dist/avenirs-dsav.es.js",
7
7
  "types": "dist/index.d.ts",