fluency-v8-components 1.4.6 → 1.4.8

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,4 +1,4 @@
1
- import { c as Da, _ as Va, g as il } from "./index-DwYYvTaG.mjs";
1
+ import { c as Da, _ as Va, g as il } from "./index-CmFd3BaD.mjs";
2
2
  var fn = {}, cn = {}, cr, vn;
3
3
  function Q() {
4
4
  if (vn) return cr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluency-v8-components",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "main": "dist/fluency-v8-components.umd.js",
5
5
  "module": "dist/fluency-v8-components.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <Menu as="div" class="relative inline-block text-left">
3
+ <MenuButton
4
+ :class="[
5
+ `group inline-flex justify-center text-${size} font-medium`
6
+ ]"
7
+ >
8
+ <slot name="btn" />
9
+ </MenuButton>
10
+
11
+ <transition
12
+ enter-active-class="transition ease-out duration-100"
13
+ enter-from-class="transform opacity-0 scale-95"
14
+ enter-to-class="transform opacity-100 scale-100"
15
+ leave-active-class="transition ease-in duration-75"
16
+ leave-from-class="transform opacity-100 scale-100"
17
+ leave-to-class="transform opacity-0 scale-95"
18
+ >
19
+ <MenuItems
20
+ :class="[
21
+ 'std-white input-dropdown w-40 origin-top-right shadow-lg max-h-96',
22
+ direction === 'right' ? 'left-0 ' : 'right-0',
23
+ ]"
24
+ >
25
+ <div class="py-1">
26
+ <MenuItem v-for="option in options" :key="option" v-slot="{ active }">
27
+ <span
28
+ :class="[
29
+ active ? 'outline-hidden white-bg-hover dark:dark-bg-hover' : '',
30
+ { 'white-bg-hover dark:dark-bg-hover': current === option.label },
31
+ `group flex w-full items-center rounded-md px-2 py-2 text-${size} cursor-pointer`,
32
+ ]"
33
+ @click.stop="emits('select', option)"
34
+ >
35
+ {{ option.label }}
36
+ </span>
37
+ </MenuItem>
38
+ </div>
39
+ </MenuItems>
40
+ </transition>
41
+ </Menu>
42
+ </template>
43
+ <script setup>
44
+ import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
45
+
46
+ // props and emits
47
+ const props = defineProps({
48
+ options: {
49
+ type: Array,
50
+ required: true,
51
+ },
52
+ direction: {
53
+ type: String,
54
+ default: "left",
55
+ },
56
+ size: {
57
+ type: String,
58
+ default: "xs",
59
+ },
60
+ current: String,
61
+ });
62
+ const emits = defineEmits(["select"]);
63
+ </script>
@@ -1,48 +1,21 @@
1
1
  <template>
2
- <Menu as="div" class="relative inline-block text-left">
3
- <MenuButton
4
- :class="`group inline-flex justify-center text-${size} font-medium`"
5
- >
2
+ <Select
3
+ :options="options"
4
+ :current="current.label"
5
+ :direction="direction"
6
+ :size="size"
7
+ @select="emits('sort', $event)"
8
+ >
9
+ <template #btn>
6
10
  <Bars3BottomLeftIcon :class="`${iconSize} mr-2`" />
7
11
  Sort By
8
12
  <ChevronDownIcon :class="`${iconSize} ml-2`" />
9
- </MenuButton>
10
-
11
- <transition
12
- enter-active-class="transition ease-out duration-100"
13
- enter-from-class="transform opacity-0 scale-95"
14
- enter-to-class="transform opacity-100 scale-100"
15
- leave-active-class="transition ease-in duration-75"
16
- leave-from-class="transform opacity-100 scale-100"
17
- leave-to-class="transform opacity-0 scale-95"
18
- >
19
- <MenuItems
20
- :class="[
21
- 'std-white input-dropdown w-40 origin-top-right shadow-lg max-h-96',
22
- direction === 'right' ? 'left-0 ' : 'right-0',
23
- ]"
24
- >
25
- <div class="py-1">
26
- <MenuItem v-for="option in options" :key="option" v-slot="{ active }">
27
- <span
28
- :class="[
29
- active ? 'outline-hidden white-bg-hover dark:dark-bg-hover' : '',
30
- { 'white-bg-hover dark:dark-bg-hover': current.label === option.label },
31
- `group flex w-full items-center rounded-md px-2 py-2 text-${size} cursor-pointer`,
32
- ]"
33
- @click.stop="emits('sort', option)"
34
- >
35
- {{ option.label }}
36
- </span>
37
- </MenuItem>
38
- </div>
39
- </MenuItems>
40
- </transition>
41
- </Menu>
13
+ </template>
14
+ </Select>
42
15
  </template>
43
16
  <script setup>
44
17
  import { computed } from "vue";
45
- import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
18
+ import Select from "./Select.vue"
46
19
  import {
47
20
  Bars3BottomLeftIcon,
48
21
  ChevronDownIcon,
@@ -37,7 +37,7 @@
37
37
  <script setup>
38
38
  import { ref, watch } from "vue";
39
39
  import { Dialog, TextButton } from "@/components";
40
- import Stepper from "./wizard/Stepper.vue";
40
+ import Stepper from "../common/Stepper.vue";
41
41
 
42
42
  const props = defineProps({
43
43
  open: Boolean,
@@ -102,9 +102,11 @@ export { default as Feed } from "./common/Feed.vue";
102
102
  export { default as CategoryCard } from "./common/CategoryCard.vue";
103
103
  export { default as EditorHeading } from "./common/EditorHeading.vue";
104
104
  export { default as CodeEditor } from "./common/CodeEditor.vue";
105
+ export { default as Select } from "./common/Select.vue";
105
106
  export { default as Sort } from "./common/Sort.vue";
106
107
  export { default as Flag } from "./common/Flag.vue";
107
108
  export { default as ThreeHomePanel } from "./common/ThreeHomePanel.vue";
109
+ export { default as Stepper } from "./common/Stepper.vue";
108
110
 
109
111
  // charts
110
112
  export { default as AlertChart } from "./charts/AlertChart.vue";