@nexxtmove/ui 1.0.14 → 1.0.16
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.
|
@@ -4,10 +4,12 @@ export interface NexxtToggleGroupOption {
|
|
|
4
4
|
icon?: IconName;
|
|
5
5
|
label?: string;
|
|
6
6
|
tooltip?: string;
|
|
7
|
+
activeClass?: string;
|
|
7
8
|
}
|
|
8
9
|
interface NexxtToggleGroupProps {
|
|
9
10
|
options: NexxtToggleGroupOption[];
|
|
10
11
|
label?: string;
|
|
12
|
+
equalWidth?: boolean;
|
|
11
13
|
}
|
|
12
14
|
type __VLS_Props = NexxtToggleGroupProps;
|
|
13
15
|
type __VLS_PublicProps = __VLS_Props & {
|
|
@@ -17,5 +19,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
17
19
|
"update:modelValue": (value: string) => any;
|
|
18
20
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
21
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
20
|
-
}>, {
|
|
22
|
+
}>, {
|
|
23
|
+
equalWidth: boolean;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
25
|
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { Placement } from '@floating-ui/vue';
|
|
1
2
|
export { default as NexxtAnimatedNumber } from './components/AnimatedNumber/AnimatedNumber.vue';
|
|
2
3
|
export { default as NexxtAnnouncement } from './components/Announcement/Announcement.vue';
|
|
3
4
|
export { default as NexxtAvatar } from './components/Avatar/Avatar.vue';
|
package/dist/index.js
CHANGED
|
@@ -8571,7 +8571,11 @@ var Ed = { class: "flex flex-col gap-1" }, Dd = {
|
|
|
8571
8571
|
__name: "ToggleGroup",
|
|
8572
8572
|
props: /*@__PURE__*/ S({
|
|
8573
8573
|
options: {},
|
|
8574
|
-
label: {}
|
|
8574
|
+
label: {},
|
|
8575
|
+
equalWidth: {
|
|
8576
|
+
type: Boolean,
|
|
8577
|
+
default: !0
|
|
8578
|
+
}
|
|
8575
8579
|
}, {
|
|
8576
8580
|
modelValue: { required: !0 },
|
|
8577
8581
|
modelModifiers: {}
|
|
@@ -8596,52 +8600,52 @@ var Ed = { class: "flex flex-col gap-1" }, Dd = {
|
|
|
8596
8600
|
}), (t, p) => (A(), u("div", Ed, [e.label ? (A(), u("label", Dd, L(e.label), 1)) : l("", !0), d("div", {
|
|
8597
8601
|
ref_key: "containerRef",
|
|
8598
8602
|
ref: i,
|
|
8599
|
-
class: "relative isolate flex h-10 gap-1 rounded-xl bg-gray-100 p-1"
|
|
8603
|
+
class: T(["relative isolate flex h-10 gap-1 rounded-xl bg-gray-100 p-1", { "flex-wrap": !e.equalWidth }])
|
|
8600
8604
|
}, [
|
|
8601
8605
|
d("div", {
|
|
8602
8606
|
"aria-hidden": "true",
|
|
8603
8607
|
class: T(["absolute inset-y-1 left-0 rounded-lg bg-white", f.value ? "transition-transform duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]" : ""]),
|
|
8604
8608
|
style: D(o.value)
|
|
8605
8609
|
}, null, 6),
|
|
8606
|
-
(A(!0), u(r, null, N(e.options, (
|
|
8610
|
+
(A(!0), u(r, null, N(e.options, (t, i) => (A(), u(r, { key: t.value }, [t.tooltip ? (A(), c(Fu, {
|
|
8607
8611
|
key: 0,
|
|
8608
8612
|
"disable-closing-trigger": ""
|
|
8609
8613
|
}, {
|
|
8610
|
-
tooltip: H(() => [m(L(
|
|
8614
|
+
tooltip: H(() => [m(L(t.tooltip), 1)]),
|
|
8611
8615
|
default: H(() => [d("button", {
|
|
8612
8616
|
ref_for: !0,
|
|
8613
|
-
ref: (e) => a.value[
|
|
8617
|
+
ref: (e) => a.value[i] = e,
|
|
8614
8618
|
type: "button",
|
|
8615
|
-
class: "relative z-10 flex
|
|
8616
|
-
onClick: (
|
|
8617
|
-
}, [
|
|
8619
|
+
class: T(["relative z-10 flex cursor-pointer items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 whitespace-nowrap text-gray-500 hover:text-gray-700", { "flex-1": e.equalWidth }]),
|
|
8620
|
+
onClick: (e) => n.value = t.value
|
|
8621
|
+
}, [t.icon ? (A(), c(G, {
|
|
8618
8622
|
key: 0,
|
|
8619
|
-
name:
|
|
8620
|
-
}, null, 8, ["name"])) :
|
|
8623
|
+
name: t.icon
|
|
8624
|
+
}, null, 8, ["name"])) : l("", !0), t.label ? (A(), u("span", kd, L(t.label), 1)) : l("", !0)], 10, Od)]),
|
|
8621
8625
|
_: 2
|
|
8622
8626
|
}, 1024)) : (A(), u("button", {
|
|
8623
8627
|
key: 1,
|
|
8624
8628
|
ref_for: !0,
|
|
8625
|
-
ref: (e) => a.value[
|
|
8629
|
+
ref: (e) => a.value[i] = e,
|
|
8626
8630
|
type: "button",
|
|
8627
|
-
class: "relative z-10 flex
|
|
8628
|
-
onClick: (
|
|
8629
|
-
}, [
|
|
8631
|
+
class: T(["relative z-10 flex cursor-pointer items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 whitespace-nowrap text-gray-500 hover:text-gray-700", { "flex-1": e.equalWidth }]),
|
|
8632
|
+
onClick: (e) => n.value = t.value
|
|
8633
|
+
}, [t.icon ? (A(), c(G, {
|
|
8630
8634
|
key: 0,
|
|
8631
|
-
name:
|
|
8632
|
-
}, null, 8, ["name"])) :
|
|
8635
|
+
name: t.icon
|
|
8636
|
+
}, null, 8, ["name"])) : l("", !0), t.label ? (A(), u("span", jd, L(t.label), 1)) : l("", !0)], 10, Ad))], 64))), 128)),
|
|
8633
8637
|
d("div", {
|
|
8634
8638
|
"aria-hidden": "true",
|
|
8635
|
-
class: T(["pointer-events-none absolute inset-0 z-20 flex gap-1 p-1", f.value ? "transition-[clip-path] duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]" : ""]),
|
|
8639
|
+
class: T(["pointer-events-none absolute inset-0 z-20 flex gap-1 p-1", [f.value ? "transition-[clip-path] duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]" : "", { "flex-wrap": !e.equalWidth }]]),
|
|
8636
8640
|
style: D({ clipPath: s.value })
|
|
8637
|
-
}, [(A(!0), u(r, null, N(e.options, (
|
|
8638
|
-
key:
|
|
8639
|
-
class: "flex
|
|
8640
|
-
}, [
|
|
8641
|
+
}, [(A(!0), u(r, null, N(e.options, (t) => (A(), u("span", {
|
|
8642
|
+
key: t.value,
|
|
8643
|
+
class: T(["flex items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 whitespace-nowrap", [{ "flex-1": e.equalWidth }, t.activeClass ?? "text-cornflower-blue-600"]])
|
|
8644
|
+
}, [t.icon ? (A(), c(G, {
|
|
8641
8645
|
key: 0,
|
|
8642
|
-
name:
|
|
8643
|
-
}, null, 8, ["name"])) :
|
|
8644
|
-
],
|
|
8646
|
+
name: t.icon
|
|
8647
|
+
}, null, 8, ["name"])) : l("", !0), t.label ? (A(), u("span", Md, L(t.label), 1)) : l("", !0)], 2))), 128))], 6)
|
|
8648
|
+
], 2)]));
|
|
8645
8649
|
}
|
|
8646
8650
|
}), Pd = [
|
|
8647
8651
|
"src",
|
package/package.json
CHANGED
|
@@ -10,18 +10,22 @@ export interface NexxtToggleGroupOption {
|
|
|
10
10
|
icon?: IconName
|
|
11
11
|
label?: string
|
|
12
12
|
tooltip?: string
|
|
13
|
+
activeClass?: string
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
interface NexxtToggleGroupProps {
|
|
16
17
|
options: NexxtToggleGroupOption[]
|
|
17
18
|
label?: string
|
|
19
|
+
equalWidth?: boolean
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
defineOptions({
|
|
21
23
|
name: 'NexxtToggleGroup',
|
|
22
24
|
})
|
|
23
25
|
|
|
24
|
-
const props = defineProps<NexxtToggleGroupProps>()
|
|
26
|
+
const props = withDefaults(defineProps<NexxtToggleGroupProps>(), {
|
|
27
|
+
equalWidth: true,
|
|
28
|
+
})
|
|
25
29
|
|
|
26
30
|
const model = defineModel<string>({ required: true })
|
|
27
31
|
|
|
@@ -69,7 +73,11 @@ onMounted(async () => {
|
|
|
69
73
|
<label v-if="label" class="text-color-gray-700 justify-start body-normal text-sm">
|
|
70
74
|
{{ label }}
|
|
71
75
|
</label>
|
|
72
|
-
<div
|
|
76
|
+
<div
|
|
77
|
+
ref="containerRef"
|
|
78
|
+
class="relative isolate flex h-10 gap-1 rounded-xl bg-gray-100 p-1"
|
|
79
|
+
:class="{ 'flex-wrap': !equalWidth }"
|
|
80
|
+
>
|
|
73
81
|
<!-- slider pill -->
|
|
74
82
|
<div
|
|
75
83
|
aria-hidden="true"
|
|
@@ -86,11 +94,12 @@ onMounted(async () => {
|
|
|
86
94
|
<button
|
|
87
95
|
:ref="(el) => (buttonRefs[index] = el as HTMLButtonElement)"
|
|
88
96
|
type="button"
|
|
89
|
-
class="relative z-10 flex
|
|
97
|
+
class="relative z-10 flex cursor-pointer items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 whitespace-nowrap text-gray-500 hover:text-gray-700"
|
|
98
|
+
:class="{ 'flex-1': equalWidth }"
|
|
90
99
|
@click="model = option.value"
|
|
91
100
|
>
|
|
92
101
|
<NexxtIcon v-if="option.icon" :name="option.icon" />
|
|
93
|
-
<span v-
|
|
102
|
+
<span v-if="option.label" class="extra-small-semibold">{{ option.label }}</span>
|
|
94
103
|
</button>
|
|
95
104
|
<template #tooltip>{{ option.tooltip }}</template>
|
|
96
105
|
</NexxtTooltip>
|
|
@@ -98,29 +107,32 @@ onMounted(async () => {
|
|
|
98
107
|
v-else
|
|
99
108
|
:ref="(el) => (buttonRefs[index] = el as HTMLButtonElement)"
|
|
100
109
|
type="button"
|
|
101
|
-
class="relative z-10 flex
|
|
110
|
+
class="relative z-10 flex cursor-pointer items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 whitespace-nowrap text-gray-500 hover:text-gray-700"
|
|
111
|
+
:class="{ 'flex-1': equalWidth }"
|
|
102
112
|
@click="model = option.value"
|
|
103
113
|
>
|
|
104
114
|
<NexxtIcon v-if="option.icon" :name="option.icon" />
|
|
105
|
-
<span v-
|
|
115
|
+
<span v-if="option.label" class="extra-small-semibold">{{ option.label }}</span>
|
|
106
116
|
</button>
|
|
107
117
|
</template>
|
|
108
118
|
|
|
109
119
|
<div
|
|
110
120
|
aria-hidden="true"
|
|
111
121
|
class="pointer-events-none absolute inset-0 z-20 flex gap-1 p-1"
|
|
112
|
-
:class="
|
|
113
|
-
ready ? 'transition-[clip-path] duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]' : ''
|
|
114
|
-
|
|
122
|
+
:class="[
|
|
123
|
+
ready ? 'transition-[clip-path] duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]' : '',
|
|
124
|
+
{ 'flex-wrap': !equalWidth },
|
|
125
|
+
]"
|
|
115
126
|
:style="{ clipPath }"
|
|
116
127
|
>
|
|
117
128
|
<span
|
|
118
129
|
v-for="option in options"
|
|
119
130
|
:key="option.value"
|
|
120
|
-
class="flex
|
|
131
|
+
class="flex items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 whitespace-nowrap"
|
|
132
|
+
:class="[{ 'flex-1': equalWidth }, option.activeClass ?? 'text-cornflower-blue-600']"
|
|
121
133
|
>
|
|
122
134
|
<NexxtIcon v-if="option.icon" :name="option.icon" />
|
|
123
|
-
<span v-
|
|
135
|
+
<span v-if="option.label" class="extra-small-semibold">{{ option.label }}</span>
|
|
124
136
|
</span>
|
|
125
137
|
</div>
|
|
126
138
|
</div>
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by scripts/generate-index.ts
|
|
2
|
+
export type { Placement } from '@floating-ui/vue'
|
|
2
3
|
export { default as NexxtAnimatedNumber } from './components/AnimatedNumber/AnimatedNumber.vue'
|
|
3
4
|
export { default as NexxtAnnouncement } from './components/Announcement/Announcement.vue'
|
|
4
5
|
export { default as NexxtAvatar } from './components/Avatar/Avatar.vue'
|