@nexxtmove/ui 0.1.47 → 0.1.49
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/index.d.ts +65 -20
- package/dist/index.js +959 -859
- package/dist/nuxt.js +16 -14
- package/package.json +1 -1
- package/src/components/TabbedContent/TabbedContent.vue +52 -0
- package/src/components/Tabs/Tabs.vue +79 -0
- package/src/components.json +2 -0
- package/src/index.ts +2 -0
- package/tailwind/nexxtmove.tailwind.components.css +5 -1
- package/tailwind/nexxtmove.tailwind.theme.css +5 -1
package/dist/nuxt.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineNuxtModule as
|
|
2
|
-
const i = "components/AnimatedNumber/AnimatedNumber.vue", x = "components/Avatar/Avatar.vue", m = "components/Button/Button.vue", u = "components/Calendar/Calendar.vue", p = "components/Checkbox/Checkbox.vue", l = "components/Chip/Chip.vue",
|
|
1
|
+
import { defineNuxtModule as s, addComponent as c, addTemplate as a } from "@nuxt/kit";
|
|
2
|
+
const i = "components/AnimatedNumber/AnimatedNumber.vue", x = "components/Avatar/Avatar.vue", m = "components/Button/Button.vue", u = "components/Calendar/Calendar.vue", p = "components/Checkbox/Checkbox.vue", l = "components/Chip/Chip.vue", d = "components/Combobox/Combobox.vue", r = "components/CustomerJourneyTile/CustomerJourneyTile.vue", v = "components/DatePicker/DatePicker.vue", N = "components/DropdownButton/DropdownButton.vue", T = "components/Header/Header.vue", b = "components/Icon/Icon.vue", C = "components/InfoBlock/InfoBlock.vue", S = "components/InputField/InputField.vue", f = "components/Modal/Modal.vue", h = "components/Pagination/Pagination.vue", M = "components/ProgressBar/ProgressBar.vue", P = "components/SocialIcons/SocialIcons.vue", k = "components/SocialMediaCustomTemplate/SocialMediaCustomTemplate.vue", B = "components/SocialMediaTemplate/SocialMediaTemplate.vue", I = "components/SocialMediaType/SocialMediaType.vue", g = "components/StepperHeader/StepperHeader.vue", y = "components/TabbedContent/TabbedContent.vue", A = "components/Table/Table.vue", D = "components/Tabs/Tabs.vue", H = "components/TimelineEvent/TimelineEvent.vue", w = "components/TimelinePhaseblock/TimelinePhaseblock.vue", E = "components/Tooltip/Tooltip.vue", F = {
|
|
3
3
|
NexxtAnimatedNumber: i,
|
|
4
4
|
NexxtAvatar: x,
|
|
5
5
|
NexxtButton: m,
|
|
6
6
|
NexxtCalendar: u,
|
|
7
7
|
NexxtCheckbox: p,
|
|
8
8
|
NexxtChip: l,
|
|
9
|
-
NexxtCombobox:
|
|
10
|
-
NexxtCustomerJourneyTile:
|
|
9
|
+
NexxtCombobox: d,
|
|
10
|
+
NexxtCustomerJourneyTile: r,
|
|
11
11
|
NexxtDatePicker: v,
|
|
12
12
|
NexxtDropdownButton: N,
|
|
13
13
|
NexxtHeader: T,
|
|
14
|
-
NexxtIcon:
|
|
15
|
-
NexxtInfoBlock:
|
|
14
|
+
NexxtIcon: b,
|
|
15
|
+
NexxtInfoBlock: C,
|
|
16
16
|
NexxtInputField: S,
|
|
17
17
|
NexxtModal: f,
|
|
18
18
|
NexxtPagination: h,
|
|
@@ -22,11 +22,13 @@ const i = "components/AnimatedNumber/AnimatedNumber.vue", x = "components/Avatar
|
|
|
22
22
|
NexxtSocialMediaTemplate: B,
|
|
23
23
|
NexxtSocialMediaType: I,
|
|
24
24
|
NexxtStepperHeader: g,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
NexxtTabbedContent: y,
|
|
26
|
+
NexxtTable: A,
|
|
27
|
+
NexxtTabs: D,
|
|
28
|
+
NexxtTimelineEvent: H,
|
|
29
|
+
NexxtTimelinePhaseblock: w,
|
|
30
|
+
NexxtTooltip: E
|
|
31
|
+
}, j = s({
|
|
30
32
|
meta: {
|
|
31
33
|
name: "@nexxtmove/ui",
|
|
32
34
|
configKey: "nexxtmoveUi",
|
|
@@ -38,8 +40,8 @@ const i = "components/AnimatedNumber/AnimatedNumber.vue", x = "components/Avatar
|
|
|
38
40
|
addCSS: !0
|
|
39
41
|
},
|
|
40
42
|
setup(e, o) {
|
|
41
|
-
for (const [t, n] of Object.entries(
|
|
42
|
-
|
|
43
|
+
for (const [t, n] of Object.entries(F))
|
|
44
|
+
c({
|
|
43
45
|
name: t,
|
|
44
46
|
export: "default",
|
|
45
47
|
filePath: `@nexxtmove/ui/${n}`
|
|
@@ -57,5 +59,5 @@ const i = "components/AnimatedNumber/AnimatedNumber.vue", x = "components/Avatar
|
|
|
57
59
|
}
|
|
58
60
|
});
|
|
59
61
|
export {
|
|
60
|
-
|
|
62
|
+
j as default
|
|
61
63
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref, watch, computed } from 'vue'
|
|
3
|
+
import NexxtTabs from '../Tabs/Tabs.vue'
|
|
4
|
+
|
|
5
|
+
interface NexxtTabbedContent {
|
|
6
|
+
tabs: InstanceType<typeof NexxtTabs>['tabs']
|
|
7
|
+
animated?: boolean
|
|
8
|
+
label?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
defineOptions({
|
|
12
|
+
name: 'NexxtTabbedContent',
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const props = defineProps<NexxtTabbedContent>()
|
|
16
|
+
|
|
17
|
+
const selected = ref(props.tabs[0] ?? '')
|
|
18
|
+
const direction = ref<'forward' | 'backward'>('forward')
|
|
19
|
+
|
|
20
|
+
watch(selected, (next, prev) => {
|
|
21
|
+
direction.value = props.tabs.indexOf(next) > props.tabs.indexOf(prev) ? 'forward' : 'backward'
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const toSlotName = (tab: string) => tab.toLowerCase().replace(/\s+/g, '-')
|
|
25
|
+
const toId = (tab: string) => `tab-${toSlotName(tab)}`
|
|
26
|
+
|
|
27
|
+
const transitionProps = computed(() =>
|
|
28
|
+
props.animated
|
|
29
|
+
? {
|
|
30
|
+
enterActiveClass: 'transition-all duration-300 ease-in-out',
|
|
31
|
+
leaveActiveClass: 'transition-all duration-300 ease-in-out absolute inset-0',
|
|
32
|
+
enterFromClass:
|
|
33
|
+
direction.value === 'forward' ? 'translate-x-50 opacity-0' : '-translate-x-10 opacity-0',
|
|
34
|
+
leaveToClass:
|
|
35
|
+
direction.value === 'forward' ? '-translate-x-50 opacity-0' : 'translate-x-10 opacity-0',
|
|
36
|
+
}
|
|
37
|
+
: { mode: 'out-in' as const },
|
|
38
|
+
)
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div class="flex flex-col items-center">
|
|
43
|
+
<NexxtTabs :tabs v-model="selected" :tablist-label="label" class="my-5" />
|
|
44
|
+
<div class="relative w-full overflow-hidden">
|
|
45
|
+
<Transition v-bind="transitionProps">
|
|
46
|
+
<div :key="selected" role="tabpanel" :aria-labelledby="toId(selected)" class="w-full">
|
|
47
|
+
<slot :name="toSlotName(selected)" />
|
|
48
|
+
</div>
|
|
49
|
+
</Transition>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref, watch, onMounted } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface NexxtTabs {
|
|
5
|
+
tabs: string[]
|
|
6
|
+
tablistLabel?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: 'NexxtTabs',
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const props = defineProps<NexxtTabs>()
|
|
14
|
+
|
|
15
|
+
const selected = defineModel({ type: String, default: '' })
|
|
16
|
+
|
|
17
|
+
const buttonRefs = ref<HTMLButtonElement[]>([])
|
|
18
|
+
const sliderStyle = ref({ width: '0px', transform: 'translateX(0px)' })
|
|
19
|
+
|
|
20
|
+
const updateSlider = () => {
|
|
21
|
+
const index = props.tabs.indexOf(selected.value)
|
|
22
|
+
const button = buttonRefs.value[index]
|
|
23
|
+
|
|
24
|
+
if (!button) return
|
|
25
|
+
|
|
26
|
+
sliderStyle.value = {
|
|
27
|
+
width: `${button.offsetWidth}px`,
|
|
28
|
+
transform: `translateX(${button.offsetLeft}px)`,
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const onKeydown = (event: KeyboardEvent, index: number) => {
|
|
33
|
+
let next = index
|
|
34
|
+
if (event.key === 'ArrowRight') next = (index + 1) % props.tabs.length
|
|
35
|
+
else if (event.key === 'ArrowLeft') next = (index - 1 + props.tabs.length) % props.tabs.length
|
|
36
|
+
else if (event.key === 'Home') next = 0
|
|
37
|
+
else if (event.key === 'End') next = props.tabs.length - 1
|
|
38
|
+
else return
|
|
39
|
+
|
|
40
|
+
event.preventDefault()
|
|
41
|
+
selected.value = props.tabs[next]
|
|
42
|
+
buttonRefs.value[next]?.focus()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
watch(selected, () => updateSlider())
|
|
46
|
+
|
|
47
|
+
onMounted(async () => {
|
|
48
|
+
await document.fonts.ready
|
|
49
|
+
updateSlider()
|
|
50
|
+
})
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div
|
|
55
|
+
role="tablist"
|
|
56
|
+
:aria-label="tablistLabel"
|
|
57
|
+
class="relative flex rounded-full border-4 border-white bg-white"
|
|
58
|
+
>
|
|
59
|
+
<div
|
|
60
|
+
aria-hidden="true"
|
|
61
|
+
class="absolute h-9 rounded-full bg-cornflower-blue-500 transition-all duration-300 ease-in-out"
|
|
62
|
+
:style="sliderStyle"
|
|
63
|
+
/>
|
|
64
|
+
<button
|
|
65
|
+
v-for="(tab, index) in tabs"
|
|
66
|
+
:key="tab"
|
|
67
|
+
:ref="(el) => (buttonRefs[index] = el as HTMLButtonElement)"
|
|
68
|
+
role="tab"
|
|
69
|
+
:aria-selected="selected === tab"
|
|
70
|
+
:tabindex="selected === tab ? 0 : -1"
|
|
71
|
+
class="relative z-10 h-9 cursor-pointer rounded-full px-4 transition-colors delay-100 duration-150"
|
|
72
|
+
:class="{ 'text-white': selected === tab }"
|
|
73
|
+
@click="selected = tab"
|
|
74
|
+
@keydown="onKeydown($event, index)"
|
|
75
|
+
>
|
|
76
|
+
{{ tab }}
|
|
77
|
+
</button>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
package/src/components.json
CHANGED
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"NexxtSocialMediaTemplate": "components/SocialMediaTemplate/SocialMediaTemplate.vue",
|
|
22
22
|
"NexxtSocialMediaType": "components/SocialMediaType/SocialMediaType.vue",
|
|
23
23
|
"NexxtStepperHeader": "components/StepperHeader/StepperHeader.vue",
|
|
24
|
+
"NexxtTabbedContent": "components/TabbedContent/TabbedContent.vue",
|
|
24
25
|
"NexxtTable": "components/Table/Table.vue",
|
|
26
|
+
"NexxtTabs": "components/Tabs/Tabs.vue",
|
|
25
27
|
"NexxtTimelineEvent": "components/TimelineEvent/TimelineEvent.vue",
|
|
26
28
|
"NexxtTimelinePhaseblock": "components/TimelinePhaseblock/TimelinePhaseblock.vue",
|
|
27
29
|
"NexxtTooltip": "components/Tooltip/Tooltip.vue"
|
package/src/index.ts
CHANGED
|
@@ -21,7 +21,9 @@ export { default as NexxtSocialMediaCustomTemplate } from './components/SocialMe
|
|
|
21
21
|
export { default as NexxtSocialMediaTemplate } from './components/SocialMediaTemplate/SocialMediaTemplate.vue'
|
|
22
22
|
export { default as NexxtSocialMediaType } from './components/SocialMediaType/SocialMediaType.vue'
|
|
23
23
|
export { default as NexxtStepperHeader } from './components/StepperHeader/StepperHeader.vue'
|
|
24
|
+
export { default as NexxtTabbedContent } from './components/TabbedContent/TabbedContent.vue'
|
|
24
25
|
export { default as NexxtTable } from './components/Table/Table.vue'
|
|
26
|
+
export { default as NexxtTabs } from './components/Tabs/Tabs.vue'
|
|
25
27
|
export { default as NexxtTimelineEvent } from './components/TimelineEvent/TimelineEvent.vue'
|
|
26
28
|
export { default as NexxtTimelinePhaseblock } from './components/TimelinePhaseblock/TimelinePhaseblock.vue'
|
|
27
29
|
export { default as NexxtTooltip } from './components/Tooltip/Tooltip.vue'
|
|
@@ -117,8 +117,12 @@
|
|
|
117
117
|
@apply bg-social-media-template-info-bg;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
.card-content {
|
|
121
|
+
@apply border-card-content-border px-(--card-content-padding-x) py-(--card-content-padding-y) border border-solid;
|
|
122
|
+
}
|
|
123
|
+
|
|
120
124
|
.card {
|
|
121
|
-
@apply
|
|
125
|
+
@apply bg-card-bg;
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
.info-block {
|
|
@@ -159,7 +159,8 @@
|
|
|
159
159
|
--color-progress-bar-border: var(--color-gray-200);
|
|
160
160
|
--color-header-border-bottom: var(--color-gray-200);
|
|
161
161
|
--color-social-media-template-info-bg: var(--color-cornflower-blue-500);
|
|
162
|
-
--color-card-border: var(--color-gray-200);
|
|
162
|
+
--color-card-content-border: var(--color-gray-200);
|
|
163
|
+
--color-card-bg: var(--color-white);
|
|
163
164
|
--text-xs: 0.75rem;
|
|
164
165
|
--text-base: 1rem;
|
|
165
166
|
--text-lg: 1.125rem;
|
|
@@ -228,6 +229,9 @@
|
|
|
228
229
|
--header-gap: var(--spacing-6);
|
|
229
230
|
--info-block-padding: var(--spacing-1);
|
|
230
231
|
--card-border-radius: var(--radius-lg);
|
|
232
|
+
--card-content-padding-x: var(--spacing-5);
|
|
233
|
+
--card-content-padding-y: var(--spacing-4);
|
|
234
|
+
--card-content-border-radius: var(--radius-lg);
|
|
231
235
|
--font-sans: 'Poppins', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
232
236
|
--font-serif: 'Playfair Display', ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
|
|
233
237
|
--font-mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|