@teammodlr/ui-kit 3.0.0-beta.5 → 3.0.0-beta.9

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.
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div style="padding: 100px;">
3
+ <MPopover>
4
+ <MButton>Open Popover</MButton>
5
+ <template #content>
6
+ <div style="padding: 8px; min-width: 200px;">
7
+ <h4 style="margin: 0 0 8px; font-weight: 600;">Popover Title</h4>
8
+ <p style="margin: 0; color: #666; font-size: 14px;">
9
+ This is the popover content. You can put anything here.
10
+ </p>
11
+ </div>
12
+ </template>
13
+ </MPopover>
14
+ </div>
15
+ </template>
@@ -0,0 +1,19 @@
1
+ import MPopover from '../Popover.vue';
2
+ import MButton from '../../button/Button.vue';
3
+
4
+ import { MPopoverBasic, MPopoverPlacement, MPopoverArrow, MPopoverVariant } from './index';
5
+ import { createStory, popperPositionArgType } from '../../../__storybook__';
6
+
7
+ export default {
8
+ component: MPopover,
9
+ subcomponents: { MButton },
10
+ title: 'Components/Popover',
11
+ argTypes: {
12
+ ...popperPositionArgType()
13
+ }
14
+ };
15
+
16
+ export const Basic = createStory(MPopoverBasic);
17
+ export const Placement = createStory(MPopoverPlacement);
18
+ export const Arrow = createStory(MPopoverArrow);
19
+ export const Variant = createStory(MPopoverVariant);
@@ -0,0 +1,4 @@
1
+ export { default as MPopoverBasic } from './basic.vue';
2
+ export { default as MPopoverPlacement } from './placement.vue';
3
+ export { default as MPopoverArrow } from './arrow.vue';
4
+ export { default as MPopoverVariant } from './variant.vue';
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <div style="padding: 150px; display: flex; gap: 16px; flex-wrap: wrap;">
3
+ <MPopover placement="top">
4
+ <MButton>Top</MButton>
5
+ <template #content>
6
+ <div style="padding: 8px;">Top</div>
7
+ </template>
8
+ </MPopover>
9
+
10
+ <MPopover placement="top-start">
11
+ <MButton>Top Start</MButton>
12
+ <template #content>
13
+ <div style="padding: 8px;">Top Start</div>
14
+ </template>
15
+ </MPopover>
16
+
17
+ <MPopover placement="top-end">
18
+ <MButton>Top End</MButton>
19
+ <template #content>
20
+ <div style="padding: 8px;">Top End</div>
21
+ </template>
22
+ </MPopover>
23
+
24
+ <MPopover placement="bottom">
25
+ <MButton>Bottom</MButton>
26
+ <template #content>
27
+ <div style="padding: 8px;">Bottom</div>
28
+ </template>
29
+ </MPopover>
30
+
31
+ <MPopover placement="bottom-start">
32
+ <MButton>Bottom Start</MButton>
33
+ <template #content>
34
+ <div style="padding: 8px;">Bottom Start</div>
35
+ </template>
36
+ </MPopover>
37
+
38
+ <MPopover placement="bottom-end">
39
+ <MButton>Bottom End</MButton>
40
+ <template #content>
41
+ <div style="padding: 8px;">Bottom End</div>
42
+ </template>
43
+ </MPopover>
44
+
45
+ <MPopover placement="left">
46
+ <MButton>Left</MButton>
47
+ <template #content>
48
+ <div style="padding: 8px;">Left</div>
49
+ </template>
50
+ </MPopover>
51
+
52
+ <MPopover placement="right">
53
+ <MButton>Right</MButton>
54
+ <template #content>
55
+ <div style="padding: 8px;">Right</div>
56
+ </template>
57
+ </MPopover>
58
+ </div>
59
+ </template>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div style="padding: 100px; display: flex; gap: 16px;">
3
+ <MPopover>
4
+ <MButton>Light (Default)</MButton>
5
+ <template #content>
6
+ <div style="padding: 8px; min-width: 150px;">
7
+ <p style="margin: 0; font-size: 14px;">Light popover content</p>
8
+ </div>
9
+ </template>
10
+ </MPopover>
11
+
12
+ <MPopover variant="dark">
13
+ <MButton variant="dark">Dark</MButton>
14
+ <template #content>
15
+ <div style="padding: 8px; min-width: 150px;">
16
+ <p style="margin: 0; font-size: 14px;">Dark popover content</p>
17
+ </div>
18
+ </template>
19
+ </MPopover>
20
+
21
+ <MPopover variant="dark" arrow placement="bottom">
22
+ <MButton variant="dark">Dark with Arrow</MButton>
23
+ <template #content>
24
+ <div style="padding: 8px; min-width: 150px;">
25
+ <p style="margin: 0; font-size: 14px;">Dark popover with arrow</p>
26
+ </div>
27
+ </template>
28
+ </MPopover>
29
+ </div>
30
+ </template>
@@ -0,0 +1,203 @@
1
+ import { globalKeyframes, globalStyle, style } from '@vanilla-extract/css';
2
+ import { themeVars } from '../../../styles/theme.css';
3
+
4
+ const menuFadeOutAnimation = 'popover-fade-out';
5
+ globalKeyframes(menuFadeOutAnimation, {
6
+ from: {
7
+ opacity: 1
8
+ },
9
+ to: {
10
+ opacity: 0
11
+ }
12
+ });
13
+
14
+ const menuSlideFadeOutTopAnimation = 'popover-slide-fade-out-top';
15
+ globalKeyframes(menuSlideFadeOutTopAnimation, {
16
+ from: {
17
+ opacity: 1,
18
+ transform: 'translateY(0) scale(1)'
19
+ },
20
+ to: {
21
+ opacity: 0,
22
+ transform: 'translateY(6px) scale(0.98)'
23
+ }
24
+ });
25
+
26
+ const menuSlideFadeOutBottomAnimation = 'popover-slide-fade-out-bottom';
27
+ globalKeyframes(menuSlideFadeOutBottomAnimation, {
28
+ from: {
29
+ opacity: 1,
30
+ transform: 'translateY(0) scale(1)'
31
+ },
32
+ to: {
33
+ opacity: 0,
34
+ transform: 'translateY(-6px) scale(0.98)'
35
+ }
36
+ });
37
+
38
+ const menuSlideFadeOutLeftAnimation = 'popover-slide-fade-out-left';
39
+ globalKeyframes(menuSlideFadeOutLeftAnimation, {
40
+ from: {
41
+ opacity: 1,
42
+ transform: 'translateX(0) scale(1)'
43
+ },
44
+ to: {
45
+ opacity: 0,
46
+ transform: 'translateX(6px) scale(0.98)'
47
+ }
48
+ });
49
+
50
+ const menuSlideFadeOutRightAnimation = 'popover-slide-fade-out-right';
51
+ globalKeyframes(menuSlideFadeOutRightAnimation, {
52
+ from: {
53
+ opacity: 1,
54
+ transform: 'translateX(0) scale(1)'
55
+ },
56
+ to: {
57
+ opacity: 0,
58
+ transform: 'translateX(-6px) scale(0.98)'
59
+ }
60
+ });
61
+
62
+ const menuSlideFadeTopAnimation = 'popover-slide-fade-top';
63
+ globalKeyframes(menuSlideFadeTopAnimation, {
64
+ from: {
65
+ opacity: 0,
66
+ transform: 'translateY(6px) scale(0.98)'
67
+ },
68
+ to: {
69
+ opacity: 1,
70
+ transform: 'translateY(0) scale(1)'
71
+ }
72
+ });
73
+
74
+ const menuSlideFadeBottomAnimation = 'popover-slide-fade-bottom';
75
+ globalKeyframes(menuSlideFadeBottomAnimation, {
76
+ from: {
77
+ opacity: 0,
78
+ transform: 'translateY(-6px) scale(0.98)'
79
+ },
80
+ to: {
81
+ opacity: 1,
82
+ transform: 'translateY(0) scale(1)'
83
+ }
84
+ });
85
+
86
+ const menuSlideFadeLeftAnimation = 'popover-slide-fade-left';
87
+ globalKeyframes(menuSlideFadeLeftAnimation, {
88
+ from: {
89
+ opacity: 0,
90
+ transform: 'translateX(6px) scale(0.98)'
91
+ },
92
+ to: {
93
+ opacity: 1,
94
+ transform: 'translateX(0) scale(1)'
95
+ }
96
+ });
97
+
98
+ const menuSlideFadeRightAnimation = 'popover-slide-fade-right';
99
+ globalKeyframes(menuSlideFadeRightAnimation, {
100
+ from: {
101
+ opacity: 0,
102
+ transform: 'translateX(-6px) scale(0.98)'
103
+ },
104
+ to: {
105
+ opacity: 1,
106
+ transform: 'translateX(0) scale(1)'
107
+ }
108
+ });
109
+
110
+ export const content = style({
111
+ backgroundColor: '#ffffff',
112
+ borderRadius: '5px',
113
+ padding: '5px',
114
+ zIndex: 4000,
115
+ boxSizing: 'border-box',
116
+ position: 'relative',
117
+ minWidth: '130px',
118
+ maxWidth: '350px',
119
+ border: `1px solid ${themeVars.color.gray[300]}`,
120
+ boxShadow: themeVars.shadow.md,
121
+ transformOrigin: 'var(--reka-popover-content-transform-origin)',
122
+ willChange: 'transform, opacity',
123
+ outline: 'none',
124
+ selectors: {
125
+ '&[data-state="open"]': {
126
+ animationDuration: '0.16s',
127
+ animationTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',
128
+ animationFillMode: 'both'
129
+ },
130
+ '&[data-state="closed"]': {
131
+ animationDuration: '0.12s',
132
+ animationTimingFunction: 'ease-out',
133
+ animationFillMode: 'both'
134
+ },
135
+ '&[data-state="closed"][data-side="top"]': {
136
+ animationName: menuSlideFadeOutTopAnimation
137
+ },
138
+ '&[data-state="closed"][data-side="bottom"]': {
139
+ animationName: menuSlideFadeOutBottomAnimation
140
+ },
141
+ '&[data-state="closed"][data-side="left"]': {
142
+ animationName: menuSlideFadeOutLeftAnimation
143
+ },
144
+ '&[data-state="closed"][data-side="right"]': {
145
+ animationName: menuSlideFadeOutRightAnimation
146
+ },
147
+ '&[data-state="open"][data-side="top"]': {
148
+ animationName: menuSlideFadeTopAnimation
149
+ },
150
+ '&[data-state="open"][data-side="bottom"]': {
151
+ animationName: menuSlideFadeBottomAnimation
152
+ },
153
+ '&[data-state="open"][data-side="left"]': {
154
+ animationName: menuSlideFadeLeftAnimation
155
+ },
156
+ '&[data-state="open"][data-side="right"]': {
157
+ animationName: menuSlideFadeRightAnimation
158
+ }
159
+ }
160
+ });
161
+
162
+ export const arrow = style({
163
+ fill: '#ffffff'
164
+ });
165
+
166
+ globalStyle(`${arrow} path`, {
167
+ fill: '#ffffff',
168
+ stroke: themeVars.color.gray[300],
169
+ strokeWidth: '1px'
170
+ });
171
+
172
+ export const dark = style({
173
+ backgroundColor: themeVars.color.gray[900],
174
+ border: `1px solid ${themeVars.color.gray[800]}`,
175
+ color: themeVars.color.gray[100]
176
+ });
177
+
178
+ globalStyle(`${dark} ${arrow}`, {
179
+ fill: themeVars.color.gray[900]
180
+ });
181
+
182
+ globalStyle(`${dark} ${arrow} path`, {
183
+ fill: themeVars.color.gray[900],
184
+ stroke: themeVars.color.gray[800]
185
+ });
186
+
187
+ export const close = style({
188
+ position: 'absolute',
189
+ top: themeVars.space[2],
190
+ right: themeVars.space[2],
191
+ display: 'flex',
192
+ alignItems: 'center',
193
+ justifyContent: 'center',
194
+ width: '20px',
195
+ height: '20px',
196
+ borderRadius: themeVars.rounded.default,
197
+ cursor: 'pointer',
198
+ color: themeVars.color.font.muted,
199
+ ':hover': {
200
+ backgroundColor: themeVars.color.gray[100],
201
+ color: themeVars.color.font.text
202
+ }
203
+ });
@@ -0,0 +1 @@
1
+ export * from './Popover.css';