@teammodlr/ui-kit 3.0.0-beta.30 → 3.0.0-beta.33

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.
@@ -1,122 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import { type Placement } from '../../composables/usePopper';
3
- import * as style from './style';
4
- declare const _default: import("vue").DefineComponent<{
5
- open: {
6
- type: BooleanConstructor;
7
- default: boolean;
8
- };
9
- placement: {
10
- type: PropType<Placement>;
11
- default: string;
12
- validator: (value: Placement) => boolean;
13
- };
14
- transfer: {
15
- type: BooleanConstructor;
16
- default: boolean;
17
- };
18
- sideOffset: {
19
- type: NumberConstructor;
20
- default: number;
21
- };
22
- collisionPadding: {
23
- type: PropType<number | {
24
- top?: number;
25
- right?: number;
26
- bottom?: number;
27
- left?: number;
28
- }>;
29
- default: number;
30
- };
31
- arrow: {
32
- type: BooleanConstructor;
33
- default: boolean;
34
- };
35
- variant: {
36
- type: PropType<"light" | "dark">;
37
- default: string;
38
- };
39
- openDelay: {
40
- type: NumberConstructor;
41
- default: number;
42
- };
43
- closeDelay: {
44
- type: NumberConstructor;
45
- default: number;
46
- };
47
- zIndex: {
48
- type: NumberConstructor;
49
- };
50
- }, {
51
- isOpen: import("vue").Ref<boolean>;
52
- zIndex: import("vue").Ref<number>;
53
- showArrow: import("vue").ComputedRef<boolean>;
54
- contentClasses: import("vue").ComputedRef<unknown[]>;
55
- resolvedSide: import("vue").ComputedRef<"bottom" | "left" | "right" | "top" | undefined>;
56
- resolvedAlign: import("vue").ComputedRef<"center" | "end" | "start" | undefined>;
57
- style: typeof style;
58
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
59
- open: {
60
- type: BooleanConstructor;
61
- default: boolean;
62
- };
63
- placement: {
64
- type: PropType<Placement>;
65
- default: string;
66
- validator: (value: Placement) => boolean;
67
- };
68
- transfer: {
69
- type: BooleanConstructor;
70
- default: boolean;
71
- };
72
- sideOffset: {
73
- type: NumberConstructor;
74
- default: number;
75
- };
76
- collisionPadding: {
77
- type: PropType<number | {
78
- top?: number;
79
- right?: number;
80
- bottom?: number;
81
- left?: number;
82
- }>;
83
- default: number;
84
- };
85
- arrow: {
86
- type: BooleanConstructor;
87
- default: boolean;
88
- };
89
- variant: {
90
- type: PropType<"light" | "dark">;
91
- default: string;
92
- };
93
- openDelay: {
94
- type: NumberConstructor;
95
- default: number;
96
- };
97
- closeDelay: {
98
- type: NumberConstructor;
99
- default: number;
100
- };
101
- zIndex: {
102
- type: NumberConstructor;
103
- };
104
- }>> & {
105
- "onUpdate:open"?: ((...args: any[]) => any) | undefined;
106
- }, {
107
- open: boolean;
108
- variant: "dark" | "light";
109
- placement: Placement;
110
- transfer: boolean;
111
- arrow: boolean;
112
- sideOffset: number;
113
- collisionPadding: number | {
114
- top?: number;
115
- right?: number;
116
- bottom?: number;
117
- left?: number;
118
- };
119
- openDelay: number;
120
- closeDelay: number;
121
- }, {}>;
122
- export default _default;
@@ -1,3 +0,0 @@
1
- export declare const content: string;
2
- export declare const arrow: string;
3
- export declare const dark: string;
@@ -1 +0,0 @@
1
- export * from './HoverCard.css';
@@ -1,163 +0,0 @@
1
- <template>
2
- <HoverCardRoot
3
- v-model:open="isOpen"
4
- :open-delay="openDelay"
5
- :close-delay="closeDelay"
6
- >
7
- <HoverCardTrigger as-child>
8
- <slot />
9
- </HoverCardTrigger>
10
- <HoverCardPortal :disabled="!transfer">
11
- <HoverCardContent
12
- :class="contentClasses"
13
- :side="resolvedSide"
14
- :align="resolvedAlign"
15
- :side-offset="sideOffset"
16
- :collision-padding="collisionPadding"
17
- :style="{ zIndex: zIndex }"
18
- >
19
- <slot name="content" />
20
- <HoverCardArrow v-if="showArrow" :class="style.arrow" :width="12" :height="6" />
21
- </HoverCardContent>
22
- </HoverCardPortal>
23
- </HoverCardRoot>
24
- </template>
25
-
26
- <script lang="ts">
27
- import {
28
- HoverCardArrow,
29
- HoverCardContent,
30
- HoverCardPortal,
31
- HoverCardRoot,
32
- HoverCardTrigger,
33
- type HoverCardContentProps
34
- } from 'reka-ui';
35
- import {
36
- computed,
37
- defineComponent,
38
- ref,
39
- useAttrs,
40
- watch,
41
- type PropType
42
- } from 'vue';
43
- import {
44
- type Placement,
45
- placementWhileList
46
- } from '../../composables/usePopper';
47
- import { useZIndex } from '../../composables/useZIndex';
48
- import * as style from './style';
49
-
50
- export default defineComponent({
51
- name: 'MHoverCard',
52
- inheritAttrs: false,
53
- components: {
54
- HoverCardArrow,
55
- HoverCardContent,
56
- HoverCardPortal,
57
- HoverCardRoot,
58
- HoverCardTrigger
59
- },
60
- props: {
61
- open: {
62
- type: Boolean,
63
- default: false
64
- },
65
- placement: {
66
- type: String as PropType<Placement>,
67
- default: 'bottom',
68
- validator: (value: Placement) => placementWhileList.includes(value)
69
- },
70
- transfer: {
71
- type: Boolean,
72
- default: true
73
- },
74
- sideOffset: {
75
- type: Number,
76
- default: 5
77
- },
78
- collisionPadding: {
79
- type: [Number, Object] as PropType<number | { top?: number; right?: number; bottom?: number; left?: number }>,
80
- default: 10
81
- },
82
- arrow: {
83
- type: Boolean,
84
- default: false
85
- },
86
- variant: {
87
- type: String as PropType<'light' | 'dark'>,
88
- default: 'light'
89
- },
90
- openDelay: {
91
- type: Number,
92
- default: 700
93
- },
94
- closeDelay: {
95
- type: Number,
96
- default: 300
97
- },
98
- zIndex: {
99
- type: Number
100
- }
101
- },
102
- emits: ['update:open'],
103
- setup(props, { emit }) {
104
- const attrs = useAttrs();
105
- const { nextZIndex } = useZIndex();
106
- const isOpen = ref(props.open);
107
- const zIndex = ref(props.zIndex ?? nextZIndex());
108
-
109
- const resolvedPlacement = computed(() => {
110
- const [side, align] = props.placement.split('-');
111
-
112
- return {
113
- side: side === 'top' || side === 'right' || side === 'bottom' || side === 'left'
114
- ? side
115
- : undefined,
116
- align: align === 'start' || align === 'center' || align === 'end'
117
- ? align
118
- : undefined
119
- } as {
120
- side?: HoverCardContentProps['side'];
121
- align?: HoverCardContentProps['align'];
122
- };
123
- });
124
-
125
- const showArrow = computed(() => {
126
- const { align } = resolvedPlacement.value;
127
- return props.arrow && (!align || align === 'center');
128
- });
129
-
130
- const contentClasses = computed(() => {
131
- return [
132
- 'm-hover-card-content',
133
- style.content,
134
- {
135
- [style.dark]: props.variant === 'dark'
136
- },
137
- attrs.class
138
- ];
139
- });
140
-
141
- watch(
142
- () => props.open,
143
- value => {
144
- isOpen.value = value;
145
- }
146
- );
147
-
148
- watch(isOpen, value => {
149
- emit('update:open', value);
150
- });
151
-
152
- return {
153
- isOpen,
154
- zIndex,
155
- showArrow,
156
- contentClasses,
157
- resolvedSide: computed(() => resolvedPlacement.value.side),
158
- resolvedAlign: computed(() => resolvedPlacement.value.align),
159
- style
160
- };
161
- }
162
- });
163
- </script>
@@ -1,175 +0,0 @@
1
- import { globalKeyframes, globalStyle, style } from '@vanilla-extract/css';
2
- import { themeVars } from '../../../styles/theme.css';
3
-
4
- const slideFadeOutTopAnimation = 'hover-card-slide-fade-out-top';
5
- globalKeyframes(slideFadeOutTopAnimation, {
6
- from: {
7
- opacity: 1,
8
- transform: 'translateY(0) scale(1)'
9
- },
10
- to: {
11
- opacity: 0,
12
- transform: 'translateY(6px) scale(0.98)'
13
- }
14
- });
15
-
16
- const slideFadeOutBottomAnimation = 'hover-card-slide-fade-out-bottom';
17
- globalKeyframes(slideFadeOutBottomAnimation, {
18
- from: {
19
- opacity: 1,
20
- transform: 'translateY(0) scale(1)'
21
- },
22
- to: {
23
- opacity: 0,
24
- transform: 'translateY(-6px) scale(0.98)'
25
- }
26
- });
27
-
28
- const slideFadeOutLeftAnimation = 'hover-card-slide-fade-out-left';
29
- globalKeyframes(slideFadeOutLeftAnimation, {
30
- from: {
31
- opacity: 1,
32
- transform: 'translateX(0) scale(1)'
33
- },
34
- to: {
35
- opacity: 0,
36
- transform: 'translateX(6px) scale(0.98)'
37
- }
38
- });
39
-
40
- const slideFadeOutRightAnimation = 'hover-card-slide-fade-out-right';
41
- globalKeyframes(slideFadeOutRightAnimation, {
42
- from: {
43
- opacity: 1,
44
- transform: 'translateX(0) scale(1)'
45
- },
46
- to: {
47
- opacity: 0,
48
- transform: 'translateX(-6px) scale(0.98)'
49
- }
50
- });
51
-
52
- const slideFadeTopAnimation = 'hover-card-slide-fade-top';
53
- globalKeyframes(slideFadeTopAnimation, {
54
- from: {
55
- opacity: 0,
56
- transform: 'translateY(6px) scale(0.98)'
57
- },
58
- to: {
59
- opacity: 1,
60
- transform: 'translateY(0) scale(1)'
61
- }
62
- });
63
-
64
- const slideFadeBottomAnimation = 'hover-card-slide-fade-bottom';
65
- globalKeyframes(slideFadeBottomAnimation, {
66
- from: {
67
- opacity: 0,
68
- transform: 'translateY(-6px) scale(0.98)'
69
- },
70
- to: {
71
- opacity: 1,
72
- transform: 'translateY(0) scale(1)'
73
- }
74
- });
75
-
76
- const slideFadeLeftAnimation = 'hover-card-slide-fade-left';
77
- globalKeyframes(slideFadeLeftAnimation, {
78
- from: {
79
- opacity: 0,
80
- transform: 'translateX(6px) scale(0.98)'
81
- },
82
- to: {
83
- opacity: 1,
84
- transform: 'translateX(0) scale(1)'
85
- }
86
- });
87
-
88
- const slideFadeRightAnimation = 'hover-card-slide-fade-right';
89
- globalKeyframes(slideFadeRightAnimation, {
90
- from: {
91
- opacity: 0,
92
- transform: 'translateX(-6px) scale(0.98)'
93
- },
94
- to: {
95
- opacity: 1,
96
- transform: 'translateX(0) scale(1)'
97
- }
98
- });
99
-
100
- export const content = style({
101
- backgroundColor: '#ffffff',
102
- borderRadius: '5px',
103
- padding: '5px',
104
- zIndex: 4000,
105
- boxSizing: 'border-box',
106
- position: 'relative',
107
- minWidth: '130px',
108
- maxWidth: '350px',
109
- border: `1px solid ${themeVars.color.gray[300]}`,
110
- boxShadow: themeVars.shadow.md,
111
- transformOrigin: 'var(--reka-hover-card-content-transform-origin)',
112
- willChange: 'transform, opacity',
113
- outline: 'none',
114
- selectors: {
115
- '&[data-state="open"]': {
116
- animationDuration: '0.16s',
117
- animationTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',
118
- animationFillMode: 'both'
119
- },
120
- '&[data-state="closed"]': {
121
- animationDuration: '0.12s',
122
- animationTimingFunction: 'ease-out',
123
- animationFillMode: 'both'
124
- },
125
- '&[data-state="closed"][data-side="top"]': {
126
- animationName: slideFadeOutTopAnimation
127
- },
128
- '&[data-state="closed"][data-side="bottom"]': {
129
- animationName: slideFadeOutBottomAnimation
130
- },
131
- '&[data-state="closed"][data-side="left"]': {
132
- animationName: slideFadeOutLeftAnimation
133
- },
134
- '&[data-state="closed"][data-side="right"]': {
135
- animationName: slideFadeOutRightAnimation
136
- },
137
- '&[data-state="open"][data-side="top"]': {
138
- animationName: slideFadeTopAnimation
139
- },
140
- '&[data-state="open"][data-side="bottom"]': {
141
- animationName: slideFadeBottomAnimation
142
- },
143
- '&[data-state="open"][data-side="left"]': {
144
- animationName: slideFadeLeftAnimation
145
- },
146
- '&[data-state="open"][data-side="right"]': {
147
- animationName: slideFadeRightAnimation
148
- }
149
- }
150
- });
151
-
152
- export const arrow = style({
153
- fill: '#ffffff'
154
- });
155
-
156
- globalStyle(`${arrow} path`, {
157
- fill: '#ffffff',
158
- stroke: themeVars.color.gray[300],
159
- strokeWidth: '1px'
160
- });
161
-
162
- export const dark = style({
163
- backgroundColor: themeVars.color.gray[900],
164
- border: `1px solid ${themeVars.color.gray[800]}`,
165
- color: themeVars.color.gray[100]
166
- });
167
-
168
- globalStyle(`${dark} ${arrow}`, {
169
- fill: themeVars.color.gray[900]
170
- });
171
-
172
- globalStyle(`${dark} ${arrow} path`, {
173
- fill: themeVars.color.gray[900],
174
- stroke: themeVars.color.gray[800]
175
- });
@@ -1 +0,0 @@
1
- export * from './HoverCard.css';