@resee-movies/nuxt-ux 0.2.4 → 0.3.0

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@resee-movies/nuxt-ux",
3
3
  "configKey": "ux",
4
- "version": "0.2.4",
4
+ "version": "0.3.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.0"
package/dist/module.mjs CHANGED
@@ -125,6 +125,7 @@ function importModules(nuxt) {
125
125
  "Dialog",
126
126
  "Drawer",
127
127
  "Message",
128
+ "Menu",
128
129
  "ProgressBar",
129
130
  "ProgressSpinner",
130
131
  "Tag",
@@ -1,7 +1,17 @@
1
1
  <template>
2
2
  <Transition name="fade" mode="out-in">
3
- <ProgressSpinner v-if="props.loading" :size="props.size" class="icon" />
4
- <span v-else role="presentation" :class="['icon', props.name, props.size, { 'color-cycle': props.colorCycle }]" />
3
+ <ProgressSpinner
4
+ v-if = "props.loading"
5
+ :size = "props.size"
6
+ class = "icon"
7
+ />
8
+
9
+ <span
10
+ v-else
11
+ v-bind = "attrs"
12
+ role = "presentation"
13
+ :class = "['icon', props.name, props.size, { 'color-cycle': props.colorCycle }]"
14
+ />
5
15
  </Transition>
6
16
  </template>
7
17
 
@@ -10,7 +20,9 @@
10
20
  </script>
11
21
 
12
22
  <script setup>
23
+ import { useAttrs } from "vue";
13
24
  import ProgressSpinner from "./ProgressSpinner.vue";
25
+ const attrs = useAttrs();
14
26
  const props = defineProps({
15
27
  name: { type: String, required: false, default: void 0 },
16
28
  loading: { type: Boolean, required: false, default: false },
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <slot
3
+ name = "control"
4
+ :toggle = "(event) => menu?.toggle(event)"
5
+ :menu-id = "menuId"
6
+ :expanded = "visible"
7
+ />
8
+
9
+ <PrimeMenu
10
+ ref = "menu"
11
+ v-bind = "attrs"
12
+ :model = "props.model"
13
+ :popup = "true"
14
+ :id = "menuId"
15
+ class = "menu"
16
+ :pt = "passthroughProps"
17
+ @show = "visible = true"
18
+ @hide = "visible = false"
19
+ >
20
+ <template v-if="slots.prefix || props.prefixText" #start>
21
+ <slot name="prefix">
22
+ {{ props.prefixText }}
23
+ </slot>
24
+ </template>
25
+
26
+ <template #item="{ item }">
27
+ <slot name="item">
28
+ <IconTextPair
29
+ :text = "isString(item.label) ? item.label : item.label?.()"
30
+ :icon = "item.icon"
31
+ />
32
+ </slot>
33
+ </template>
34
+
35
+ <template v-if="slots.suffix || props.suffixText" #end>
36
+ <slot name="suffix">
37
+ {{ props.suffixText }}
38
+ </slot>
39
+ </template>
40
+ </PrimeMenu>
41
+ </template>
42
+
43
+ <script>
44
+
45
+ </script>
46
+
47
+ <script setup>
48
+ import { isString } from "@resee-movies/utilities/strings/is-string";
49
+ import PrimeMenu, {} from "primevue/menu";
50
+ import { computed, ref, useAttrs, useId, useSlots } from "vue";
51
+ import IconTextPair from "./IconTextPair.vue";
52
+ defineOptions({
53
+ inheritAttrs: false
54
+ });
55
+ const attrs = useAttrs();
56
+ const slots = useSlots();
57
+ const menuId = useId();
58
+ const menu = ref();
59
+ const visible = ref(false);
60
+ const props = defineProps({
61
+ model: { type: Array, required: true },
62
+ prefixText: { type: String, required: false, default: void 0 },
63
+ suffixText: { type: String, required: false, default: void 0 }
64
+ });
65
+ defineExpose({
66
+ toggle: (event) => menu.value?.toggle(event),
67
+ expanded: () => visible.value,
68
+ menuId
69
+ });
70
+ const passthroughProps = computed(() => {
71
+ return {
72
+ start: {
73
+ class: "menu-prefix"
74
+ },
75
+ end: {
76
+ class: "menu-suffix"
77
+ },
78
+ transition: {
79
+ name: "fade"
80
+ }
81
+ };
82
+ });
83
+ </script>
84
+
85
+ <style>
86
+ @reference "tailwindcss";.menu{background-color:var(--color-global-background);border:1px solid var(--color-global-background-accent);border-radius:var(--radius-md);box-shadow:var(--shadow-heavy);margin-block:--spacing(1);max-width:--spacing(80);padding:--spacing(1)}.menu li[role=separator]{border-bottom:1px solid var(--color-global-background-accent);margin-block:--spacing(1)}.menu li[role=none]{font-weight:var(--font-weight-semibold)}.menu li[role=menuitem],.menu li[role=none]{padding:--spacing(1) --spacing(2);-webkit-user-select:none;-moz-user-select:none;user-select:none}.menu li[role=menuitem]{border-radius:var(--radius-md);cursor:pointer;transition:background-color;transition-duration:var(--default-transition-duration)}.menu li[role=menuitem][data-p-focused=true]{background-color:var(--color-background-scale-c)}.menu li[role=menuitem][aria-disabled=true]{color:var(--color-global-foreground-accent);cursor:not-allowed}.menu li[role=menuitem][aria-disabled=true][data-p-focused=true]{background-color:transparent}.menu .menu-prefix{border-bottom:1px solid var(--color-global-background-accent);margin-bottom:--spacing(1);padding:0 --spacing(2) --spacing(1)}.menu .menu-suffix{border-top:1px solid var(--color-global-background-accent);margin-top:--spacing(1);padding:--spacing(1) --spacing(2) 0}
87
+ </style>
@@ -0,0 +1,41 @@
1
+ import type { ComputedGetter } from 'vue';
2
+ export interface MenuProps {
3
+ model: MenuItem[];
4
+ prefixText?: string;
5
+ suffixText?: string;
6
+ }
7
+ export interface MenuItem {
8
+ label?: string;
9
+ icon?: string;
10
+ disabled?: boolean;
11
+ separator?: boolean;
12
+ items?: MenuItem[];
13
+ }
14
+ export interface MenuExposes {
15
+ toggle: (event: Event) => void;
16
+ menuId: string;
17
+ expanded: ComputedGetter<boolean>;
18
+ }
19
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<MenuProps, MenuExposes, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MenuProps> & Readonly<{}>, {
20
+ prefixText: string;
21
+ suffixText: string;
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
23
+ control?: (props: {
24
+ toggle: (event: Event) => void | undefined;
25
+ menuId: string;
26
+ expanded: boolean;
27
+ }) => any;
28
+ } & {
29
+ prefix?: (props: {}) => any;
30
+ } & {
31
+ item?: (props: {}) => any;
32
+ } & {
33
+ suffix?: (props: {}) => any;
34
+ }>;
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
37
+ type __VLS_WithSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resee-movies/nuxt-ux",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "The next-gen user experience library for ReSee Movies - currently in development. ",
5
5
  "repository": {
6
6
  "url": "https://github.com/ReSee-Movies/nuxt-ux.git"