@fiscozen/navbar 0.1.2 → 0.1.4

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 (2) hide show
  1. package/package.json +9 -5
  2. package/src/FzNavbar.vue +6 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiscozen/navbar",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Design System Navbar Component",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -9,7 +9,7 @@
9
9
  "peerDependencies": {
10
10
  "tailwindcss": "^3.4.1",
11
11
  "vue": "^3.4.13",
12
- "@fiscozen/button": "^0.1.7"
12
+ "@fiscozen/button": "^0.1.8"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@rushstack/eslint-patch": "^1.3.3",
@@ -19,19 +19,23 @@
19
19
  "@vitest/coverage-v8": "^1.2.1",
20
20
  "@vue/test-utils": "^2.4.3",
21
21
  "@vue/tsconfig": "^0.5.0",
22
- "vite-plugin-dts": "^3.8.3",
23
22
  "eslint": "^8.49.0",
24
23
  "jsdom": "^23.0.1",
25
24
  "prettier": "^3.0.3",
26
25
  "typescript": "~5.3.0",
27
26
  "vite": "^5.0.10",
27
+ "vite-plugin-dts": "^3.8.3",
28
28
  "vitest": "^1.2.0",
29
29
  "vue-tsc": "^1.8.25",
30
30
  "@fiscozen/tsconfig": "^0.1.0",
31
- "@fiscozen/eslint-config": "^0.1.0",
32
- "@fiscozen/prettier-config": "^0.1.0"
31
+ "@fiscozen/prettier-config": "^0.1.0",
32
+ "@fiscozen/eslint-config": "^0.1.0"
33
33
  },
34
34
  "license": "ISC",
35
+ "dependencies": {
36
+ "@fiscozen/composables": "^0.1.33",
37
+ "@fiscozen/style": "^0.1.3"
38
+ },
35
39
  "scripts": {
36
40
  "coverage": "vitest run --coverage",
37
41
  "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts",
package/src/FzNavbar.vue CHANGED
@@ -2,6 +2,8 @@
2
2
  import { ref, onBeforeMount, onMounted, onUnmounted, computed } from 'vue'
3
3
  import { FzIconButton } from '@fiscozen/button'
4
4
  import { FzNavbarEmits, FzNavbarProps } from './types'
5
+ import {breakpoints} from '@fiscozen/style';
6
+ import {useBreakpoints} from '@fiscozen/composables';
5
7
 
6
8
  const props = withDefaults(defineProps<FzNavbarProps>(), {
7
9
  variant: 'horizontal'
@@ -9,30 +11,16 @@ const props = withDefaults(defineProps<FzNavbarProps>(), {
9
11
 
10
12
  const emit = defineEmits<FzNavbarEmits>()
11
13
 
12
- const width = ref(0)
13
-
14
- const onResize = () => {
15
- width.value = window.innerWidth
16
- }
17
- onBeforeMount(() => {
18
- onResize()
19
- })
20
-
21
- onMounted(() => {
22
- window.addEventListener('resize', onResize)
23
- })
24
- onUnmounted(() => {
25
- window.removeEventListener('resize', onResize)
26
- })
27
-
28
- const isMobile = computed(() => Boolean(width.value <= 1024))
14
+ const {isGreater} = useBreakpoints(breakpoints);
15
+ const isGreaterThanLg = isGreater('lg');
16
+ const isMobile = computed(() => !isGreaterThanLg.value);
29
17
  const isVertical = computed(() => Boolean(props.variant === 'vertical'))
30
18
  const isHorizontal = computed(() => Boolean(props.variant === 'horizontal'))
31
19
  </script>
32
20
 
33
21
  <template>
34
22
  <header
35
- class="flex p-12 shadow"
23
+ class="flex p-12 shadow z-10"
36
24
  :class="{
37
25
  'justify-between': isMobile,
38
26
  'h-full w-56 flex-col': isVertical && !isMobile,