@turnipxenon/pineapple 3.0.0-alpha.18 → 3.0.0-alpha.19

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.
@@ -15,4 +15,5 @@ export interface PinyaComboboxProps<T extends string> {
15
15
  onValueChange?: (selectedList: ValueChangeDetails<T>) => void;
16
16
  onValueChangeBase?: (selectedList: ValueChangeDetails<T>) => void;
17
17
  contentZIndex?: string;
18
+ disabled?: boolean;
18
19
  }
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
- import { getLocale, localizeHref } from "../../../../paraglide/runtime";
2
+ import { deLocalizeHref, getLocale, localizeHref } from "../../../../paraglide/runtime";
3
3
  import PinyaCombobox from "../../../elements/pinya-combobox/PinyaCombobox.svelte";
4
+ import { appState } from "../../../templates/index";
4
5
 
5
6
  interface ComboxData {
6
7
  label: string;
@@ -23,9 +24,12 @@
23
24
  const data = comboboxData.find((d) => d.value === e.value[0]);
24
25
  if (data) {
25
26
  selectedCountry = [data.value];
26
- location.href = localizeHref("./", { locale: data.value });
27
+ const pathname = deLocalizeHref(location.href);
28
+ location.href = localizeHref(pathname, { locale: data.value });
27
29
  }
28
30
  };
31
+
32
+ let disabled = $derived(!appState.isLanguagePickerAvailable);
29
33
  </script>
30
34
 
31
35
  <PinyaCombobox
@@ -35,4 +39,5 @@
35
39
  label="Select Language"
36
40
  placeholder="Select Language"
37
41
  {onValueChange}
42
+ {disabled}
38
43
  />
@@ -2,6 +2,7 @@ import type { Snippet } from 'svelte';
2
2
  interface AppStore {
3
3
  title: string;
4
4
  lead?: Snippet;
5
+ isLanguagePickerAvailable: boolean;
5
6
  }
6
7
  export declare const appState: AppStore;
7
8
  export {};
@@ -1,3 +1,4 @@
1
1
  export const appState = $state({
2
- title: ''
2
+ title: '',
3
+ isLanguagePickerAvailable: true,
3
4
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@turnipxenon/pineapple",
3
3
  "description": "personal package for base styling for other personal projects",
4
- "version": "3.0.0-alpha.18",
4
+ "version": "3.0.0-alpha.19",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && yarn package",