pgo-ui 1.1.12 → 1.1.13

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": "pgo-ui",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "A Vue 3 component library with PGO design system",
5
5
  "private": false,
6
6
  "type": "module",
package/src/App.vue CHANGED
@@ -68,6 +68,13 @@
68
68
 
69
69
  <!-- APPEND -->
70
70
  <template #append>
71
+ <button
72
+ class="p-2 rounded-md hover:bg-black/5 dark:hover:bg-white/10 cursor-pointer"
73
+ :title="isDark ? 'Switch to light mode' : 'Switch to dark mode'"
74
+ @click="toggleThemeVariant"
75
+ >
76
+ <HeroIcon :name="isDark ? 'sun' : 'moon'" size="22" color="text-current" />
77
+ </button>
71
78
  <button class="p-2 rounded-md hover:bg-black/5 dark:hover:bg-white/10 cursor-pointer">
72
79
  <HeroIcon name="arrow-right-start-on-rectangle" size="22" color="text-current" />
73
80
  </button>
@@ -187,6 +194,15 @@
187
194
  // const setRtl = inject('setRtl')
188
195
  const drawerOpen = inject('drawerOpen')
189
196
 
197
+ // Theme variant toggle — reads/writes the global VTS plugin; persistence handled by plugin
198
+ const themePlugin = typeof window !== 'undefined' ? /** @type {any} */ (window).__VTS_PLUGIN__ : null
199
+ const isDark = computed(() => themePlugin?.state?.variant === 'dark')
200
+ function toggleThemeVariant() {
201
+ if (!themePlugin?.setTheme) { return }
202
+ const next = isDark.value ? 'light' : 'dark'
203
+ themePlugin.setTheme(themePlugin.state?.theme ?? 'default', next)
204
+ }
205
+
190
206
  // function onClick() {
191
207
  // alert('Clicked')
192
208
  // }
@@ -351,7 +351,7 @@
351
351
  })
352
352
  function selectLanguage(lang: string) {
353
353
  if (typeof setLanguage === 'function') setLanguage(lang)
354
- window.location.reload()
354
+ // window.location.reload()
355
355
  isLangOpen.value = false
356
356
  }
357
357
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div v-tooltip="{en: 'Copy', dv: 'ކޮޕީ'}" :class="['cursor-pointer hover:text-gray-800 font-normal ', getColumnFont(lang)]" @click="handleChipClick">
2
+ <div v-tooltip="{en: 'Copy', dv: 'ކޮޕީ'}" :class="['cursor-pointer hover:text-gray-800 font-normal font-en',]" @click="handleChipClick">
3
3
  {{ text }}
4
4
  </div>
5
5
  </template>