@nexxtmove/ui 0.1.40 → 0.1.42

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/nuxt.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineNuxtModule as c, addComponent as s, addTemplate as a } from "@nuxt/kit";
2
- const i = "components/AnimatedNumber/AnimatedNumber.vue", m = "components/Avatar/Avatar.vue", x = "components/Button/Button.vue", u = "components/Calendar/Calendar.vue", p = "components/Checkbox/Checkbox.vue", l = "components/Chip/Chip.vue", r = "components/CustomerJourneyTile/CustomerJourneyTile.vue", d = "components/DatePicker/DatePicker.vue", v = "components/DropdownButton/DropdownButton.vue", N = "components/Header/Header.vue", T = "components/Icon/Icon.vue", C = "components/InfoBlock/InfoBlock.vue", S = "components/InputField/InputField.vue", b = "components/Pagination/Pagination.vue", f = "components/ProgressBar/ProgressBar.vue", h = "components/SocialIcons/SocialIcons.vue", P = "components/SocialMediaCustomTemplate/SocialMediaCustomTemplate.vue", k = "components/SocialMediaTemplate/SocialMediaTemplate.vue", B = "components/SocialMediaType/SocialMediaType.vue", I = "components/StepperHeader/StepperHeader.vue", M = "components/Table/Table.vue", g = "components/TimelineEvent/TimelineEvent.vue", y = "components/TimelinePhaseblock/TimelinePhaseblock.vue", A = "components/Tooltip/Tooltip.vue", D = {
2
+ const i = "components/AnimatedNumber/AnimatedNumber.vue", m = "components/Avatar/Avatar.vue", x = "components/Button/Button.vue", u = "components/Calendar/Calendar.vue", p = "components/Checkbox/Checkbox.vue", l = "components/Chip/Chip.vue", r = "components/CustomerJourneyTile/CustomerJourneyTile.vue", d = "components/DatePicker/DatePicker.vue", v = "components/DropdownButton/DropdownButton.vue", N = "components/Header/Header.vue", T = "components/Icon/Icon.vue", C = "components/InfoBlock/InfoBlock.vue", S = "components/InputField/InputField.vue", b = "components/Modal/Modal.vue", f = "components/Pagination/Pagination.vue", h = "components/ProgressBar/ProgressBar.vue", M = "components/SocialIcons/SocialIcons.vue", P = "components/SocialMediaCustomTemplate/SocialMediaCustomTemplate.vue", k = "components/SocialMediaTemplate/SocialMediaTemplate.vue", B = "components/SocialMediaType/SocialMediaType.vue", I = "components/StepperHeader/StepperHeader.vue", g = "components/Table/Table.vue", y = "components/TimelineEvent/TimelineEvent.vue", A = "components/TimelinePhaseblock/TimelinePhaseblock.vue", D = "components/Tooltip/Tooltip.vue", H = {
3
3
  NexxtAnimatedNumber: i,
4
4
  NexxtAvatar: m,
5
5
  NexxtButton: x,
@@ -13,18 +13,19 @@ const i = "components/AnimatedNumber/AnimatedNumber.vue", m = "components/Avatar
13
13
  NexxtIcon: T,
14
14
  NexxtInfoBlock: C,
15
15
  NexxtInputField: S,
16
- NexxtPagination: b,
17
- NexxtProgressBar: f,
18
- NexxtSocialIcons: h,
16
+ NexxtModal: b,
17
+ NexxtPagination: f,
18
+ NexxtProgressBar: h,
19
+ NexxtSocialIcons: M,
19
20
  NexxtSocialMediaCustomTemplate: P,
20
21
  NexxtSocialMediaTemplate: k,
21
22
  NexxtSocialMediaType: B,
22
23
  NexxtStepperHeader: I,
23
- NexxtTable: M,
24
- NexxtTimelineEvent: g,
25
- NexxtTimelinePhaseblock: y,
26
- NexxtTooltip: A
27
- }, w = c({
24
+ NexxtTable: g,
25
+ NexxtTimelineEvent: y,
26
+ NexxtTimelinePhaseblock: A,
27
+ NexxtTooltip: D
28
+ }, E = c({
28
29
  meta: {
29
30
  name: "@nexxtmove/ui",
30
31
  configKey: "nexxtmoveUi",
@@ -36,7 +37,7 @@ const i = "components/AnimatedNumber/AnimatedNumber.vue", m = "components/Avatar
36
37
  addCSS: !0
37
38
  },
38
39
  setup(e, o) {
39
- for (const [t, n] of Object.entries(D))
40
+ for (const [t, n] of Object.entries(H))
40
41
  s({
41
42
  name: t,
42
43
  export: "default",
@@ -55,5 +56,5 @@ const i = "components/AnimatedNumber/AnimatedNumber.vue", m = "components/Avatar
55
56
  }
56
57
  });
57
58
  export {
58
- w as default
59
+ E as default
59
60
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexxtmove/ui",
3
3
  "type": "module",
4
- "version": "0.1.40",
4
+ "version": "0.1.42",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -0,0 +1,123 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ DialogClose,
4
+ DialogContent,
5
+ DialogDescription,
6
+ DialogOverlay,
7
+ DialogPortal,
8
+ DialogRoot,
9
+ DialogTitle,
10
+ } from 'reka-ui'
11
+ import { computed } from 'vue'
12
+ import NexxtIcon from '../Icon/Icon.vue'
13
+
14
+ defineOptions({
15
+ name: 'NexxtModal',
16
+ })
17
+
18
+ interface NexxtModalProps {
19
+ title?: string
20
+ description?: string
21
+ size?: 'sm' | 'md' | 'lg'
22
+ dismissible?: boolean
23
+ showClose?: boolean
24
+ beforeClose?: () => boolean | Promise<boolean>
25
+ }
26
+
27
+ const {
28
+ size = 'md',
29
+ dismissible = true,
30
+ showClose = true,
31
+ description: rawDescription,
32
+ beforeClose,
33
+ } = defineProps<NexxtModalProps>()
34
+
35
+ const open = defineModel<boolean>({ default: false })
36
+
37
+ const description = computed(() => rawDescription?.trim() || undefined)
38
+
39
+ const handleOpenChange = async (val: boolean) => {
40
+ if (val) {
41
+ open.value = true
42
+ return
43
+ }
44
+ if (beforeClose && !(await beforeClose())) return
45
+ open.value = false
46
+ }
47
+
48
+ const sizeClass = {
49
+ sm: 'max-w-xl',
50
+ md: 'max-w-3xl',
51
+ lg: 'max-w-5xl',
52
+ }
53
+ </script>
54
+
55
+ <template>
56
+ <DialogRoot :open="open" @update:open="handleOpenChange">
57
+ <DialogPortal>
58
+ <div class="pointer-events-none fixed inset-0 z-50 grid place-items-center px-8">
59
+ <Transition
60
+ enter-active-class="transition-opacity duration-200 ease-out"
61
+ enter-from-class="opacity-0"
62
+ leave-active-class="transition-opacity duration-150 ease-in"
63
+ leave-to-class="opacity-0"
64
+ >
65
+ <DialogOverlay
66
+ v-if="open"
67
+ class="pointer-events-auto absolute inset-0 bg-black/40 backdrop-blur-sm"
68
+ />
69
+ </Transition>
70
+ <Transition
71
+ enter-active-class="transition-[opacity,translate] duration-200 ease-out"
72
+ enter-from-class="opacity-0 translate-y-5"
73
+ leave-active-class="transition-[opacity,translate] duration-150 ease-in"
74
+ leave-to-class="opacity-0 translate-y-5"
75
+ >
76
+ <DialogContent
77
+ v-if="open"
78
+ :class="[
79
+ 'pointer-events-auto relative z-10 flex max-h-[85vh] w-full flex-col overflow-x-auto rounded-3xl bg-white shadow-lg',
80
+ sizeClass[size],
81
+ ]"
82
+ :aria-describedby="description ? undefined : 'undefined'"
83
+ @pointer-down-outside="!dismissible && $event.preventDefault()"
84
+ @interact-outside="!dismissible && $event.preventDefault()"
85
+ @escape-key-down="!dismissible && $event.preventDefault()"
86
+ >
87
+ <div
88
+ v-if="title || description"
89
+ class="flex items-start justify-between border-b border-gray-200 px-6 py-5"
90
+ >
91
+ <div>
92
+ <DialogTitle v-if="title" class="heading-2">{{ title }}</DialogTitle>
93
+ <DialogDescription v-if="description" class="small-normal">
94
+ {{ description }}
95
+ </DialogDescription>
96
+ </div>
97
+ <DialogClose
98
+ v-if="showClose"
99
+ class="ml-4 shrink-0 cursor-pointer rounded p-1 focus-visible:outline-2"
100
+ >
101
+ <NexxtIcon name="xmark" />
102
+ </DialogClose>
103
+ </div>
104
+ <DialogClose
105
+ v-else-if="showClose"
106
+ class="absolute top-3 right-3 cursor-pointer rounded p-1 focus-visible:outline-2"
107
+ >
108
+ <NexxtIcon name="xmark" />
109
+ </DialogClose>
110
+
111
+ <div :class="['overflow-y-auto px-6 pt-5', $slots.footer ? 'pb-5' : 'pb-6']">
112
+ <slot />
113
+ </div>
114
+
115
+ <div v-if="$slots.footer" class="flex justify-end gap-2 px-6 py-5">
116
+ <slot name="footer" />
117
+ </div>
118
+ </DialogContent>
119
+ </Transition>
120
+ </div>
121
+ </DialogPortal>
122
+ </DialogRoot>
123
+ </template>
@@ -64,7 +64,7 @@ const {
64
64
  :key="index"
65
65
  :value="page.value"
66
66
  :disabled="disabled"
67
- class="h-8 w-8 cursor-pointer rounded-lg border border-gray-200 transition hover:bg-cornflower-blue-50 disabled:cursor-not-allowed data-selected:border-cornflower-blue-500 data-selected:bg-cornflower-blue-500 data-selected:text-white data-selected:shadow-sm"
67
+ class="h-9 min-w-9 cursor-pointer rounded-lg border border-gray-200 px-2 transition hover:bg-cornflower-blue-50 disabled:cursor-not-allowed data-selected:border-cornflower-blue-500 data-selected:bg-cornflower-blue-500 data-selected:text-white data-selected:shadow-sm"
68
68
  >
69
69
  {{ page.value }}
70
70
  </PaginationListItem>
@@ -12,6 +12,7 @@
12
12
  "NexxtIcon": "components/Icon/Icon.vue",
13
13
  "NexxtInfoBlock": "components/InfoBlock/InfoBlock.vue",
14
14
  "NexxtInputField": "components/InputField/InputField.vue",
15
+ "NexxtModal": "components/Modal/Modal.vue",
15
16
  "NexxtPagination": "components/Pagination/Pagination.vue",
16
17
  "NexxtProgressBar": "components/ProgressBar/ProgressBar.vue",
17
18
  "NexxtSocialIcons": "components/SocialIcons/SocialIcons.vue",
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ export { default as NexxtHeader } from './components/Header/Header.vue'
12
12
  export { default as NexxtIcon } from './components/Icon/Icon.vue'
13
13
  export { default as NexxtInfoBlock } from './components/InfoBlock/InfoBlock.vue'
14
14
  export { default as NexxtInputField } from './components/InputField/InputField.vue'
15
+ export { default as NexxtModal } from './components/Modal/Modal.vue'
15
16
  export { default as NexxtPagination } from './components/Pagination/Pagination.vue'
16
17
  export { default as NexxtProgressBar } from './components/ProgressBar/ProgressBar.vue'
17
18
  export { default as NexxtSocialIcons } from './components/SocialIcons/SocialIcons.vue'