@youcan/celeste 0.6.47 → 0.6.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/celeste.css +23 -22
- package/dist/cjs/popover-content.js +10 -9
- package/dist/components/popover/popover-content.d.ts +3 -0
- package/dist/es/popover-content.js +11 -10
- package/package.json +3 -3
- package/src/components/popover/popover-content.vue +9 -8
- package/src/components/popover/stories/popover.stories.ts +16 -1
package/dist/celeste.css
CHANGED
|
@@ -3775,7 +3775,7 @@ to {
|
|
|
3775
3775
|
.celeste-modal-header:has(.description)[data-type=error] .icon[data-v-a655071e] {
|
|
3776
3776
|
background: var(--color-state-error-lighter);
|
|
3777
3777
|
color: var(--color-state-error-base);
|
|
3778
|
-
}[data-v-
|
|
3778
|
+
}[data-v-68656929] .celeste-popover-content-wrapper {
|
|
3779
3779
|
z-index: 50;
|
|
3780
3780
|
min-width: 200px;
|
|
3781
3781
|
max-width: 400px;
|
|
@@ -3788,20 +3788,20 @@ to {
|
|
|
3788
3788
|
box-shadow: var(--shadow-regular-md);
|
|
3789
3789
|
scale: 0.95;
|
|
3790
3790
|
}
|
|
3791
|
-
[data-v-
|
|
3792
|
-
animation-name: open-
|
|
3791
|
+
[data-v-68656929] .celeste-popover-content-wrapper[data-state=open] {
|
|
3792
|
+
animation-name: open-68656929;
|
|
3793
3793
|
}
|
|
3794
|
-
[data-v-
|
|
3795
|
-
animation-name: close-
|
|
3794
|
+
[data-v-68656929] .celeste-popover-content-wrapper[data-state=closed] {
|
|
3795
|
+
animation-name: close-68656929;
|
|
3796
3796
|
}
|
|
3797
|
-
[data-v-
|
|
3797
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-arrow {
|
|
3798
3798
|
display: block;
|
|
3799
3799
|
position: relative;
|
|
3800
3800
|
width: 16px;
|
|
3801
3801
|
height: 8px;
|
|
3802
3802
|
overflow: hidden;
|
|
3803
3803
|
}
|
|
3804
|
-
[data-v-
|
|
3804
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-arrow::after {
|
|
3805
3805
|
content: "";
|
|
3806
3806
|
display: block;
|
|
3807
3807
|
position: absolute;
|
|
@@ -3815,75 +3815,76 @@ to {
|
|
|
3815
3815
|
background-color: var(--color-bg-white-0);
|
|
3816
3816
|
rotate: 45deg;
|
|
3817
3817
|
}
|
|
3818
|
-
[data-v-
|
|
3818
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-close-button {
|
|
3819
3819
|
position: absolute;
|
|
3820
|
+
z-index: 50;
|
|
3820
3821
|
inset-inline-end: var(--spacing-16);
|
|
3821
3822
|
inset-block-start: var(--spacing-16);
|
|
3822
3823
|
}
|
|
3823
|
-
[data-v-
|
|
3824
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content {
|
|
3824
3825
|
display: flex;
|
|
3825
3826
|
flex-direction: column;
|
|
3826
3827
|
gap: var(--spacing-8);
|
|
3827
3828
|
}
|
|
3828
|
-
[data-v-
|
|
3829
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-title,[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-description {
|
|
3829
3830
|
margin: var(--spacing-0);
|
|
3830
3831
|
}
|
|
3831
|
-
[data-v-
|
|
3832
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-title {
|
|
3832
3833
|
color: var(--color-text-strong-950);
|
|
3833
3834
|
font: var(--label-md);
|
|
3834
3835
|
}
|
|
3835
|
-
[data-v-
|
|
3836
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-description {
|
|
3836
3837
|
color: var(--color-text-sub-600);
|
|
3837
3838
|
font: var(--paragraph-sm);
|
|
3838
3839
|
}
|
|
3839
|
-
[data-v-
|
|
3840
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-icon {
|
|
3840
3841
|
box-sizing: border-box;
|
|
3841
3842
|
margin-block-end: var(--spacing-16);
|
|
3842
3843
|
border: 1px solid var(--color-stroke-soft-200);
|
|
3843
3844
|
border-radius: 50%;
|
|
3844
3845
|
color: var(--color-icon-sub-600);
|
|
3845
3846
|
}
|
|
3846
|
-
[data-v-
|
|
3847
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-icon[data-icon-size=sm] {
|
|
3847
3848
|
width: 32px;
|
|
3848
3849
|
height: 32px;
|
|
3849
3850
|
padding: var(--spacing-6);
|
|
3850
3851
|
}
|
|
3851
|
-
[data-v-
|
|
3852
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-icon[data-icon-size=md] {
|
|
3852
3853
|
width: 40px;
|
|
3853
3854
|
height: 40px;
|
|
3854
3855
|
padding: var(--spacing-6);
|
|
3855
3856
|
}
|
|
3856
|
-
[data-v-
|
|
3857
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-icon[data-icon-size=lg] {
|
|
3857
3858
|
width: 48px;
|
|
3858
3859
|
height: 48px;
|
|
3859
3860
|
padding: var(--spacing-12);
|
|
3860
3861
|
}
|
|
3861
|
-
[data-v-
|
|
3862
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-icon[data-icon-size=xl] {
|
|
3862
3863
|
width: 56px;
|
|
3863
3864
|
height: 56px;
|
|
3864
3865
|
padding: var(--spacing-14);
|
|
3865
3866
|
}
|
|
3866
|
-
[data-v-
|
|
3867
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-icon[data-icon-size=xxl] {
|
|
3867
3868
|
width: 64px;
|
|
3868
3869
|
height: 64px;
|
|
3869
3870
|
padding: var(--spacing-16);
|
|
3870
3871
|
}
|
|
3871
|
-
[data-v-
|
|
3872
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-content .celeste-popover-icon i {
|
|
3872
3873
|
width: 100%;
|
|
3873
3874
|
height: 100%;
|
|
3874
3875
|
}
|
|
3875
|
-
[data-v-
|
|
3876
|
+
[data-v-68656929] .celeste-popover-content-wrapper .celeste-popover-footer {
|
|
3876
3877
|
display: flex;
|
|
3877
3878
|
padding: var(--spacing-16);
|
|
3878
3879
|
border-block-start: 1px solid var(--color-stroke-soft-200);
|
|
3879
3880
|
}
|
|
3880
|
-
@keyframes open-
|
|
3881
|
+
@keyframes open-68656929 {
|
|
3881
3882
|
to {
|
|
3882
3883
|
opacity: 1;
|
|
3883
3884
|
scale: 1;
|
|
3884
3885
|
}
|
|
3885
3886
|
}
|
|
3886
|
-
@keyframes close-
|
|
3887
|
+
@keyframes close-68656929 {
|
|
3887
3888
|
from {
|
|
3888
3889
|
opacity: 1;
|
|
3889
3890
|
scale: 1;
|
|
@@ -20,6 +20,9 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
20
20
|
props: {
|
|
21
21
|
class: {},
|
|
22
22
|
side: { default: "bottom" },
|
|
23
|
+
sideOffset: {},
|
|
24
|
+
align: {},
|
|
25
|
+
alignOffset: {},
|
|
23
26
|
title: {},
|
|
24
27
|
description: {},
|
|
25
28
|
showTail: { type: Boolean, default: true },
|
|
@@ -32,20 +35,18 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
32
35
|
const props = __props;
|
|
33
36
|
const emits = __emit;
|
|
34
37
|
const delegatedProps = useDelegatedProps.useDelegatedProps(props, ["class", "title"]);
|
|
38
|
+
const sideOffset = props.showTail ? 0 : props.sideOffset ?? 8;
|
|
35
39
|
const forwarded = index.xe(delegatedProps, emits);
|
|
36
40
|
return (_ctx, _cache) => {
|
|
37
41
|
return Mo.openBlock(), Mo.createBlock(Mo.unref(index.bs), null, {
|
|
38
42
|
default: Mo.withCtx(() => [
|
|
39
43
|
Mo.createVNode(Mo.unref(index.ws), Mo.mergeProps({ ...Mo.unref(forwarded), ..._ctx.$attrs }, {
|
|
40
|
-
"side-offset":
|
|
41
|
-
class:
|
|
42
|
-
"celeste-popover-content-wrapper",
|
|
43
|
-
props.class
|
|
44
|
-
)
|
|
44
|
+
"side-offset": Mo.unref(sideOffset),
|
|
45
|
+
class: "celeste-popover-content-wrapper"
|
|
45
46
|
}), {
|
|
46
47
|
default: Mo.withCtx(() => [
|
|
47
48
|
Mo.createElementVNode("div", {
|
|
48
|
-
class: "celeste-popover-content",
|
|
49
|
+
class: Mo.normalizeClass(Mo.unref(clsx.clsx)("celeste-popover-content", props.class)),
|
|
49
50
|
style: Mo.normalizeStyle({ padding: !_ctx.$slots.default ? "var(--spacing-16)" : "" })
|
|
50
51
|
}, [
|
|
51
52
|
!_ctx.$slots.default ? (Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, { key: 0 }, [
|
|
@@ -61,7 +62,7 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
61
62
|
Mo.createElementVNode("p", _hoisted_2, Mo.toDisplayString(_ctx.title), 1),
|
|
62
63
|
Mo.createElementVNode("p", _hoisted_3, Mo.toDisplayString(_ctx.description), 1)
|
|
63
64
|
], 64)) : Mo.renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true)
|
|
64
|
-
],
|
|
65
|
+
], 6),
|
|
65
66
|
_ctx.showTail ? (Mo.openBlock(), Mo.createBlock(Mo.unref(index._s), {
|
|
66
67
|
key: 0,
|
|
67
68
|
"as-child": "",
|
|
@@ -93,12 +94,12 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
93
94
|
])) : Mo.createCommentVNode("", true)
|
|
94
95
|
]),
|
|
95
96
|
_: 3
|
|
96
|
-
}, 16, ["side-offset"
|
|
97
|
+
}, 16, ["side-offset"])
|
|
97
98
|
]),
|
|
98
99
|
_: 3
|
|
99
100
|
});
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
103
|
});
|
|
103
|
-
const PopoverContent = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
104
|
+
const PopoverContent = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-68656929"]]);
|
|
104
105
|
module.exports = PopoverContent;
|
|
@@ -3,6 +3,9 @@ import { PopoverContentProps as RadixPopoverContentProps } from 'radix-vue';
|
|
|
3
3
|
export interface PopoverContentProps {
|
|
4
4
|
class?: HTMLAttributes['class'];
|
|
5
5
|
side?: RadixPopoverContentProps['side'];
|
|
6
|
+
sideOffset?: RadixPopoverContentProps['sideOffset'];
|
|
7
|
+
align?: RadixPopoverContentProps['align'];
|
|
8
|
+
alignOffset?: RadixPopoverContentProps['alignOffset'];
|
|
6
9
|
title?: string;
|
|
7
10
|
description?: string;
|
|
8
11
|
showTail?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, createElementVNode, normalizeStyle, createElementBlock, Fragment,
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, createElementVNode, normalizeClass, normalizeStyle, createElementBlock, Fragment, createCommentVNode, toDisplayString, renderSlot } from "vue";
|
|
2
2
|
import CompactButton from "./compact-button.js";
|
|
3
3
|
import { useDelegatedProps } from "./use-delegated-props.js";
|
|
4
4
|
import { c as clsx } from "./chunks/clsx.js";
|
|
@@ -19,6 +19,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
props: {
|
|
20
20
|
class: {},
|
|
21
21
|
side: { default: "bottom" },
|
|
22
|
+
sideOffset: {},
|
|
23
|
+
align: {},
|
|
24
|
+
alignOffset: {},
|
|
22
25
|
title: {},
|
|
23
26
|
description: {},
|
|
24
27
|
showTail: { type: Boolean, default: true },
|
|
@@ -31,20 +34,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
31
34
|
const props = __props;
|
|
32
35
|
const emits = __emit;
|
|
33
36
|
const delegatedProps = useDelegatedProps(props, ["class", "title"]);
|
|
37
|
+
const sideOffset = props.showTail ? 0 : props.sideOffset ?? 8;
|
|
34
38
|
const forwarded = xe(delegatedProps, emits);
|
|
35
39
|
return (_ctx, _cache) => {
|
|
36
40
|
return openBlock(), createBlock(unref(bs), null, {
|
|
37
41
|
default: withCtx(() => [
|
|
38
42
|
createVNode(unref(ws), mergeProps({ ...unref(forwarded), ..._ctx.$attrs }, {
|
|
39
|
-
"side-offset":
|
|
40
|
-
class:
|
|
41
|
-
"celeste-popover-content-wrapper",
|
|
42
|
-
props.class
|
|
43
|
-
)
|
|
43
|
+
"side-offset": unref(sideOffset),
|
|
44
|
+
class: "celeste-popover-content-wrapper"
|
|
44
45
|
}), {
|
|
45
46
|
default: withCtx(() => [
|
|
46
47
|
createElementVNode("div", {
|
|
47
|
-
class: "celeste-popover-content",
|
|
48
|
+
class: normalizeClass(unref(clsx)("celeste-popover-content", props.class)),
|
|
48
49
|
style: normalizeStyle({ padding: !_ctx.$slots.default ? "var(--spacing-16)" : "" })
|
|
49
50
|
}, [
|
|
50
51
|
!_ctx.$slots.default ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
@@ -60,7 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
60
61
|
createElementVNode("p", _hoisted_2, toDisplayString(_ctx.title), 1),
|
|
61
62
|
createElementVNode("p", _hoisted_3, toDisplayString(_ctx.description), 1)
|
|
62
63
|
], 64)) : renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true)
|
|
63
|
-
],
|
|
64
|
+
], 6),
|
|
64
65
|
_ctx.showTail ? (openBlock(), createBlock(unref(_s), {
|
|
65
66
|
key: 0,
|
|
66
67
|
"as-child": "",
|
|
@@ -92,14 +93,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
92
93
|
])) : createCommentVNode("", true)
|
|
93
94
|
]),
|
|
94
95
|
_: 3
|
|
95
|
-
}, 16, ["side-offset"
|
|
96
|
+
}, 16, ["side-offset"])
|
|
96
97
|
]),
|
|
97
98
|
_: 3
|
|
98
99
|
});
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
102
|
});
|
|
102
|
-
const PopoverContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
103
|
+
const PopoverContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-68656929"]]);
|
|
103
104
|
export {
|
|
104
105
|
PopoverContent as default
|
|
105
106
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youcan/celeste",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.49",
|
|
5
5
|
"author": "YouCan <tech@youcan.shop>",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"youcan",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"radix-vue": "^1.9.12",
|
|
45
45
|
"tinycolor2": "^1.6.0",
|
|
46
46
|
"vue-sonner": "^2.0.2",
|
|
47
|
-
"@youcan/celeste-
|
|
48
|
-
"@youcan/celeste-
|
|
47
|
+
"@youcan/celeste-icons": "0.6.49",
|
|
48
|
+
"@youcan/celeste-tokens": "0.6.49"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@chromatic-com/storybook": "^4.0.0",
|
|
@@ -30,6 +30,8 @@ const emits = defineEmits<PopoverContentEmits>();
|
|
|
30
30
|
|
|
31
31
|
const delegatedProps = useDelegatedProps(props, ['class', 'title']);
|
|
32
32
|
|
|
33
|
+
const sideOffset = props.showTail ? 0 : props.sideOffset ?? 8;
|
|
34
|
+
|
|
33
35
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
34
36
|
</script>
|
|
35
37
|
|
|
@@ -37,6 +39,9 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
37
39
|
export interface PopoverContentProps {
|
|
38
40
|
class?: HTMLAttributes['class'];
|
|
39
41
|
side?: RadixPopoverContentProps['side'];
|
|
42
|
+
sideOffset?: RadixPopoverContentProps['sideOffset'];
|
|
43
|
+
align?: RadixPopoverContentProps['align'];
|
|
44
|
+
alignOffset?: RadixPopoverContentProps['alignOffset'];
|
|
40
45
|
title?: string;
|
|
41
46
|
description?: string;
|
|
42
47
|
showTail?: boolean;
|
|
@@ -50,16 +55,11 @@ export interface PopoverContentProps {
|
|
|
50
55
|
<PopoverPortal>
|
|
51
56
|
<PopoverContent
|
|
52
57
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
53
|
-
:side-offset="
|
|
54
|
-
|
|
55
|
-
clsx(
|
|
56
|
-
'celeste-popover-content-wrapper',
|
|
57
|
-
props.class,
|
|
58
|
-
)
|
|
59
|
-
"
|
|
58
|
+
:side-offset="sideOffset"
|
|
59
|
+
class="celeste-popover-content-wrapper"
|
|
60
60
|
>
|
|
61
61
|
<div
|
|
62
|
-
class="celeste-popover-content"
|
|
62
|
+
:class="clsx('celeste-popover-content', props.class)"
|
|
63
63
|
:style="{ padding: !$slots.default ? 'var(--spacing-16)' : '' }"
|
|
64
64
|
>
|
|
65
65
|
<template v-if="!$slots.default">
|
|
@@ -180,6 +180,7 @@ $icon-size-map: (
|
|
|
180
180
|
|
|
181
181
|
.celeste-popover-close-button {
|
|
182
182
|
position: absolute;
|
|
183
|
+
z-index: 50;
|
|
183
184
|
inset-inline-end: var(--spacing-16);
|
|
184
185
|
inset-block-start: var(--spacing-16);
|
|
185
186
|
}
|
|
@@ -16,6 +16,19 @@ const meta: Meta<typeof PopoverContent> = {
|
|
|
16
16
|
options: ['top', 'right', 'bottom', 'left'],
|
|
17
17
|
description: 'The preferred side of the trigger to render against when open.',
|
|
18
18
|
},
|
|
19
|
+
sideOffset: {
|
|
20
|
+
control: { type: 'number' },
|
|
21
|
+
description: 'The distance in pixels from the trigger.',
|
|
22
|
+
},
|
|
23
|
+
align: {
|
|
24
|
+
control: { type: 'select' },
|
|
25
|
+
options: ['start', 'center', 'end'],
|
|
26
|
+
description: 'The preferred alignment against the trigger. May change when collisions occur.',
|
|
27
|
+
},
|
|
28
|
+
alignOffset: {
|
|
29
|
+
control: { type: 'number' },
|
|
30
|
+
description: 'An offset in pixels from the start or end alignment options.',
|
|
31
|
+
},
|
|
19
32
|
title: {
|
|
20
33
|
control: { type: 'text' },
|
|
21
34
|
description: 'The title text for the popover',
|
|
@@ -46,6 +59,8 @@ const meta: Meta<typeof PopoverContent> = {
|
|
|
46
59
|
side: 'bottom',
|
|
47
60
|
title: 'Popover Title',
|
|
48
61
|
description: 'This is the popover description text.',
|
|
62
|
+
align: 'center',
|
|
63
|
+
alignOffset: 0,
|
|
49
64
|
showTail: true,
|
|
50
65
|
dismissible: true,
|
|
51
66
|
iconSize: 'lg',
|
|
@@ -279,7 +294,7 @@ export const Positioning: Story = {
|
|
|
279
294
|
return { args };
|
|
280
295
|
},
|
|
281
296
|
template: `
|
|
282
|
-
<div style="display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); grid-column-gap: 0px; grid-gap: var(--spacing-8)">
|
|
297
|
+
<div style="display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; grid-column-gap: 0px; grid-gap: var(--spacing-8)">
|
|
283
298
|
<div />
|
|
284
299
|
<Popover v-bind="args" style="grid-column-start: 2;">
|
|
285
300
|
<PopoverTrigger>
|