lupine.components 1.1.44 → 1.1.46
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/package.json
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { CssProps, RefProps, bindGlobalStyle, getGlobalStylesId } from 'lupine.web';
|
|
2
2
|
import { IconMenuItemProps } from '../../components/mobile-components/icon-menu-item-props';
|
|
3
3
|
|
|
4
|
+
export const FloatingIconSize = {
|
|
5
|
+
SmallSmall: { w: 30, h: 30 },
|
|
6
|
+
Small: { w: 43, h: 50 },
|
|
7
|
+
Medium: { w: 56, h: 56 },
|
|
8
|
+
Large: { w: 69, h: 69 },
|
|
9
|
+
LargeLarge: { w: 85, h: 85 },
|
|
10
|
+
};
|
|
11
|
+
export type FloatingIconSizeProps = {
|
|
12
|
+
w: number;
|
|
13
|
+
h: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
4
16
|
export interface FloatingIconMenuProps {
|
|
17
|
+
size?: FloatingIconSizeProps;
|
|
5
18
|
mainIcon: IconMenuItemProps;
|
|
6
19
|
items: IconMenuItemProps[];
|
|
7
20
|
className?: string;
|
|
@@ -9,16 +22,20 @@ export interface FloatingIconMenuProps {
|
|
|
9
22
|
left?: string;
|
|
10
23
|
right?: string;
|
|
11
24
|
bottom?: string;
|
|
25
|
+
textColor?: string;
|
|
26
|
+
backgroundColor?: string;
|
|
27
|
+
zIndex?: string;
|
|
12
28
|
direction?: 'up' | 'down' | 'left' | 'right';
|
|
13
29
|
}
|
|
14
30
|
|
|
15
31
|
export const FloatingIconMenu = (props: FloatingIconMenuProps) => {
|
|
32
|
+
const size = props.size || FloatingIconSize.Medium;
|
|
16
33
|
const css: CssProps = {
|
|
17
34
|
position: 'fixed',
|
|
18
35
|
display: 'flex',
|
|
19
36
|
alignItems: 'center',
|
|
20
37
|
gap: '16px',
|
|
21
|
-
zIndex: '
|
|
38
|
+
zIndex: props.zIndex || 'var(--layer-header-footer)',
|
|
22
39
|
|
|
23
40
|
'&.dir-up': { flexDirection: 'column-reverse' },
|
|
24
41
|
'&.dir-up .&-children': { flexDirection: 'column-reverse' },
|
|
@@ -33,11 +50,11 @@ export const FloatingIconMenu = (props: FloatingIconMenuProps) => {
|
|
|
33
50
|
'&.dir-right .&-children': { flexDirection: 'row' },
|
|
34
51
|
|
|
35
52
|
'.&-main-btn': {
|
|
36
|
-
width:
|
|
37
|
-
height:
|
|
53
|
+
width: `${size.w}px`,
|
|
54
|
+
height: `${size.h}px`,
|
|
38
55
|
borderRadius: '50%',
|
|
39
|
-
backgroundColor: 'var(--primary-color)',
|
|
40
|
-
color: 'var(--primary-bg-color)',
|
|
56
|
+
backgroundColor: props.backgroundColor || 'var(--primary-color)',
|
|
57
|
+
color: props.textColor || 'var(--primary-bg-color)',
|
|
41
58
|
display: 'flex',
|
|
42
59
|
justifyContent: 'center',
|
|
43
60
|
alignItems: 'center',
|
|
@@ -65,8 +82,8 @@ export const FloatingIconMenu = (props: FloatingIconMenuProps) => {
|
|
|
65
82
|
},
|
|
66
83
|
|
|
67
84
|
'.&-child-item': {
|
|
68
|
-
width:
|
|
69
|
-
height:
|
|
85
|
+
width: `${size.w - 8}px`,
|
|
86
|
+
height: `${size.h - 8}px`,
|
|
70
87
|
borderRadius: '50%',
|
|
71
88
|
backgroundColor: 'var(--primary-bg-color)',
|
|
72
89
|
color: 'var(--primary-color)',
|
|
@@ -206,7 +206,7 @@ export class ActionSheet {
|
|
|
206
206
|
</div>
|
|
207
207
|
);
|
|
208
208
|
base.style.position = 'fixed';
|
|
209
|
-
base.style.zIndex = zIndex || 'var(--layer-
|
|
209
|
+
base.style.zIndex = zIndex || 'var(--layer-notice)';
|
|
210
210
|
document.body.appendChild(base);
|
|
211
211
|
await mountInnerComponent(base, component);
|
|
212
212
|
return handleClose;
|