@pingux/astro 2.194.0 → 2.195.0-alpha.0
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/lib/cjs/components/Badge/Badge.styles.d.ts +8 -3
- package/lib/cjs/components/Badge/Badge.styles.js +9 -1
- package/lib/cjs/components/IconWrapper/IconWrapper.js +3 -1
- package/lib/cjs/components/IconWrapper/IconWrapper.stories.js +82 -1
- package/lib/cjs/components/MultivaluesField/BadgeLabelTooltip.js +72 -0
- package/lib/cjs/components/MultivaluesField/DefaultMultivaluesField.js +8 -29
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +30 -1
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +154 -94
- package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +7 -3
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +5 -3
- package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +2 -0
- package/lib/cjs/styles/themes/astro/customProperties/tShirtSizes.d.ts +2 -0
- package/lib/cjs/styles/themes/astro/customProperties/tShirtSizes.js +3 -1
- package/lib/cjs/styles/themes/next-gen/customProperties/index.d.ts +5 -3
- package/lib/cjs/styles/themes/next-gen/customProperties/tShirtSizes.d.ts +5 -3
- package/lib/cjs/styles/themes/next-gen/customProperties/tShirtSizes.js +7 -3
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +27 -3
- package/lib/cjs/styles/themes/next-gen/sizes.d.ts +2 -0
- package/lib/cjs/styles/themes/next-gen/sizes.js +9 -7
- package/lib/cjs/styles/themes/next-gen/variants/iconWrapper.d.ts +25 -3
- package/lib/cjs/styles/themes/next-gen/variants/iconWrapper.js +35 -18
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +25 -3
- package/lib/components/Badge/Badge.styles.js +9 -1
- package/lib/components/IconWrapper/IconWrapper.js +3 -1
- package/lib/components/IconWrapper/IconWrapper.stories.js +82 -1
- package/lib/components/MultivaluesField/BadgeLabelTooltip.js +60 -0
- package/lib/components/MultivaluesField/DefaultMultivaluesField.js +9 -30
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +29 -0
- package/lib/components/MultivaluesField/MultivaluesField.test.js +154 -94
- package/lib/styles/themes/astro/customProperties/tShirtSizes.js +3 -1
- package/lib/styles/themes/next-gen/customProperties/tShirtSizes.js +6 -3
- package/lib/styles/themes/next-gen/sizes.js +9 -7
- package/lib/styles/themes/next-gen/variants/iconWrapper.js +35 -18
- package/package.json +1 -1
|
@@ -3188,6 +3188,7 @@ declare const _default: {
|
|
|
3188
3188
|
};
|
|
3189
3189
|
sizes: {
|
|
3190
3190
|
avatar: {
|
|
3191
|
+
xs: string;
|
|
3191
3192
|
sm: string;
|
|
3192
3193
|
md: string;
|
|
3193
3194
|
xmd: string;
|
|
@@ -3202,6 +3203,7 @@ declare const _default: {
|
|
|
3202
3203
|
xl: string;
|
|
3203
3204
|
};
|
|
3204
3205
|
avatarFontSize: {
|
|
3206
|
+
xs: any;
|
|
3205
3207
|
sm: any;
|
|
3206
3208
|
md: any;
|
|
3207
3209
|
xmd: string;
|
|
@@ -5397,6 +5399,17 @@ declare const _default: {
|
|
|
5397
5399
|
};
|
|
5398
5400
|
};
|
|
5399
5401
|
iconWrapper: {
|
|
5402
|
+
xs: {
|
|
5403
|
+
'&.is-circle': {
|
|
5404
|
+
borderRadius: string;
|
|
5405
|
+
};
|
|
5406
|
+
borderRadius: string;
|
|
5407
|
+
minHeight: string;
|
|
5408
|
+
minWidth: string;
|
|
5409
|
+
height: string;
|
|
5410
|
+
width: string;
|
|
5411
|
+
fontSize: any;
|
|
5412
|
+
};
|
|
5400
5413
|
sm: {
|
|
5401
5414
|
'&.is-circle': {
|
|
5402
5415
|
borderRadius: string;
|
|
@@ -5406,7 +5419,7 @@ declare const _default: {
|
|
|
5406
5419
|
minWidth: string;
|
|
5407
5420
|
height: string;
|
|
5408
5421
|
width: string;
|
|
5409
|
-
|
|
5422
|
+
fontSize: any;
|
|
5410
5423
|
};
|
|
5411
5424
|
md: {
|
|
5412
5425
|
'&.is-circle': {
|
|
@@ -5417,7 +5430,7 @@ declare const _default: {
|
|
|
5417
5430
|
minWidth: string;
|
|
5418
5431
|
height: string;
|
|
5419
5432
|
width: string;
|
|
5420
|
-
|
|
5433
|
+
fontSize: any;
|
|
5421
5434
|
};
|
|
5422
5435
|
lg: {
|
|
5423
5436
|
'&.is-circle': {
|
|
@@ -5428,7 +5441,18 @@ declare const _default: {
|
|
|
5428
5441
|
minWidth: string;
|
|
5429
5442
|
height: string;
|
|
5430
5443
|
width: string;
|
|
5431
|
-
|
|
5444
|
+
fontSize: any;
|
|
5445
|
+
};
|
|
5446
|
+
xl: {
|
|
5447
|
+
'&.is-circle': {
|
|
5448
|
+
borderRadius: string;
|
|
5449
|
+
};
|
|
5450
|
+
borderRadius: string;
|
|
5451
|
+
minHeight: string;
|
|
5452
|
+
minWidth: string;
|
|
5453
|
+
height: string;
|
|
5454
|
+
width: string;
|
|
5455
|
+
fontSize: any;
|
|
5432
5456
|
};
|
|
5433
5457
|
};
|
|
5434
5458
|
listBox: {
|
|
@@ -12,13 +12,6 @@ var sideNav = {
|
|
|
12
12
|
halfWidth: "".concat(halfSidenavWidth, "px")
|
|
13
13
|
};
|
|
14
14
|
var fontSizes = _onyxTokens.astroTokens["default"]['font-size'];
|
|
15
|
-
var avatar = {
|
|
16
|
-
sm: "".concat(_onyxTokens.astroTokens.size.avatar.sm, "px"),
|
|
17
|
-
md: '32px',
|
|
18
|
-
xmd: '44px',
|
|
19
|
-
lg: "".concat(_onyxTokens.astroTokens.size.avatar.lg, "px"),
|
|
20
|
-
xl: "".concat(_onyxTokens.astroTokens.size.avatar.xl, "px")
|
|
21
|
-
};
|
|
22
15
|
var avatarLogo = {
|
|
23
16
|
sm: '14px',
|
|
24
17
|
md: '20px',
|
|
@@ -26,7 +19,16 @@ var avatarLogo = {
|
|
|
26
19
|
lg: '44px',
|
|
27
20
|
xl: '54px'
|
|
28
21
|
};
|
|
22
|
+
var avatar = {
|
|
23
|
+
xs: "".concat(_onyxTokens.astroTokens.size.avatar.xs, "px"),
|
|
24
|
+
sm: "".concat(_onyxTokens.astroTokens.size.avatar.sm, "px"),
|
|
25
|
+
md: "".concat(_onyxTokens.astroTokens.size.avatar.md, "px"),
|
|
26
|
+
xmd: '44px',
|
|
27
|
+
lg: "".concat(_onyxTokens.astroTokens.size.avatar.lg, "px"),
|
|
28
|
+
xl: "".concat(_onyxTokens.astroTokens.size.avatar.xl, "px")
|
|
29
|
+
};
|
|
29
30
|
var avatarFontSize = {
|
|
31
|
+
xs: fontSizes.avatar.xs,
|
|
30
32
|
sm: fontSizes.avatar.sm,
|
|
31
33
|
md: fontSizes.avatar.md,
|
|
32
34
|
xmd: '18px',
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
xs: {
|
|
3
|
+
'&.is-circle': {
|
|
4
|
+
borderRadius: string;
|
|
5
|
+
};
|
|
6
|
+
borderRadius: string;
|
|
7
|
+
minHeight: string;
|
|
8
|
+
minWidth: string;
|
|
9
|
+
height: string;
|
|
10
|
+
width: string;
|
|
11
|
+
fontSize: any;
|
|
12
|
+
};
|
|
2
13
|
sm: {
|
|
3
14
|
'&.is-circle': {
|
|
4
15
|
borderRadius: string;
|
|
@@ -8,7 +19,7 @@ declare const _default: {
|
|
|
8
19
|
minWidth: string;
|
|
9
20
|
height: string;
|
|
10
21
|
width: string;
|
|
11
|
-
|
|
22
|
+
fontSize: any;
|
|
12
23
|
};
|
|
13
24
|
md: {
|
|
14
25
|
'&.is-circle': {
|
|
@@ -19,7 +30,7 @@ declare const _default: {
|
|
|
19
30
|
minWidth: string;
|
|
20
31
|
height: string;
|
|
21
32
|
width: string;
|
|
22
|
-
|
|
33
|
+
fontSize: any;
|
|
23
34
|
};
|
|
24
35
|
lg: {
|
|
25
36
|
'&.is-circle': {
|
|
@@ -30,7 +41,18 @@ declare const _default: {
|
|
|
30
41
|
minWidth: string;
|
|
31
42
|
height: string;
|
|
32
43
|
width: string;
|
|
33
|
-
|
|
44
|
+
fontSize: any;
|
|
45
|
+
};
|
|
46
|
+
xl: {
|
|
47
|
+
'&.is-circle': {
|
|
48
|
+
borderRadius: string;
|
|
49
|
+
};
|
|
50
|
+
borderRadius: string;
|
|
51
|
+
minHeight: string;
|
|
52
|
+
minWidth: string;
|
|
53
|
+
height: string;
|
|
54
|
+
width: string;
|
|
55
|
+
fontSize: any;
|
|
34
56
|
};
|
|
35
57
|
};
|
|
36
58
|
export default _default;
|
|
@@ -14,6 +14,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
14
14
|
});
|
|
15
15
|
exports["default"] = void 0;
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
17
|
+
var _sizes = _interopRequireDefault(require("../sizes"));
|
|
17
18
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
20
|
var circle = {
|
|
@@ -22,29 +23,45 @@ var circle = {
|
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
var iconWrapper = {
|
|
26
|
+
xs: _objectSpread({
|
|
27
|
+
borderRadius: '.25rem',
|
|
28
|
+
minHeight: _sizes["default"].avatar.xs,
|
|
29
|
+
minWidth: _sizes["default"].avatar.xs,
|
|
30
|
+
height: _sizes["default"].avatar.xs,
|
|
31
|
+
width: _sizes["default"].avatar.xs,
|
|
32
|
+
fontSize: _sizes["default"].avatarFontSize.xs
|
|
33
|
+
}, circle),
|
|
25
34
|
sm: _objectSpread({
|
|
26
|
-
borderRadius: '
|
|
27
|
-
minHeight:
|
|
28
|
-
minWidth:
|
|
29
|
-
height:
|
|
30
|
-
width:
|
|
31
|
-
|
|
35
|
+
borderRadius: '.25rem',
|
|
36
|
+
minHeight: _sizes["default"].avatar.sm,
|
|
37
|
+
minWidth: _sizes["default"].avatar.sm,
|
|
38
|
+
height: _sizes["default"].avatar.sm,
|
|
39
|
+
width: _sizes["default"].avatar.sm,
|
|
40
|
+
fontSize: _sizes["default"].avatarFontSize.sm
|
|
32
41
|
}, circle),
|
|
33
42
|
md: _objectSpread({
|
|
34
|
-
borderRadius: '
|
|
35
|
-
minHeight:
|
|
36
|
-
minWidth:
|
|
37
|
-
height:
|
|
38
|
-
width:
|
|
39
|
-
|
|
43
|
+
borderRadius: '.25rem',
|
|
44
|
+
minHeight: _sizes["default"].avatar.md,
|
|
45
|
+
minWidth: _sizes["default"].avatar.md,
|
|
46
|
+
height: _sizes["default"].avatar.md,
|
|
47
|
+
width: _sizes["default"].avatar.md,
|
|
48
|
+
fontSize: _sizes["default"].avatarFontSize.md
|
|
40
49
|
}, circle),
|
|
41
50
|
lg: _objectSpread({
|
|
42
|
-
borderRadius: '
|
|
43
|
-
minHeight:
|
|
44
|
-
minWidth:
|
|
45
|
-
height:
|
|
46
|
-
width:
|
|
47
|
-
|
|
51
|
+
borderRadius: '.25rem',
|
|
52
|
+
minHeight: _sizes["default"].avatar.lg,
|
|
53
|
+
minWidth: _sizes["default"].avatar.lg,
|
|
54
|
+
height: _sizes["default"].avatar.lg,
|
|
55
|
+
width: _sizes["default"].avatar.lg,
|
|
56
|
+
fontSize: _sizes["default"].avatarFontSize.lg
|
|
57
|
+
}, circle),
|
|
58
|
+
xl: _objectSpread({
|
|
59
|
+
borderRadius: '.25rem',
|
|
60
|
+
minHeight: _sizes["default"].avatar.xl,
|
|
61
|
+
minWidth: _sizes["default"].avatar.xl,
|
|
62
|
+
height: _sizes["default"].avatar.xl,
|
|
63
|
+
width: _sizes["default"].avatar.xl,
|
|
64
|
+
fontSize: _sizes["default"].avatarFontSize.xl
|
|
48
65
|
}, circle)
|
|
49
66
|
};
|
|
50
67
|
var _default = exports["default"] = _objectSpread({}, iconWrapper);
|
|
@@ -756,6 +756,17 @@ declare const _default: {
|
|
|
756
756
|
};
|
|
757
757
|
};
|
|
758
758
|
iconWrapper: {
|
|
759
|
+
xs: {
|
|
760
|
+
'&.is-circle': {
|
|
761
|
+
borderRadius: string;
|
|
762
|
+
};
|
|
763
|
+
borderRadius: string;
|
|
764
|
+
minHeight: string;
|
|
765
|
+
minWidth: string;
|
|
766
|
+
height: string;
|
|
767
|
+
width: string;
|
|
768
|
+
fontSize: any;
|
|
769
|
+
};
|
|
759
770
|
sm: {
|
|
760
771
|
'&.is-circle': {
|
|
761
772
|
borderRadius: string;
|
|
@@ -765,7 +776,7 @@ declare const _default: {
|
|
|
765
776
|
minWidth: string;
|
|
766
777
|
height: string;
|
|
767
778
|
width: string;
|
|
768
|
-
|
|
779
|
+
fontSize: any;
|
|
769
780
|
};
|
|
770
781
|
md: {
|
|
771
782
|
'&.is-circle': {
|
|
@@ -776,7 +787,7 @@ declare const _default: {
|
|
|
776
787
|
minWidth: string;
|
|
777
788
|
height: string;
|
|
778
789
|
width: string;
|
|
779
|
-
|
|
790
|
+
fontSize: any;
|
|
780
791
|
};
|
|
781
792
|
lg: {
|
|
782
793
|
'&.is-circle': {
|
|
@@ -787,7 +798,18 @@ declare const _default: {
|
|
|
787
798
|
minWidth: string;
|
|
788
799
|
height: string;
|
|
789
800
|
width: string;
|
|
790
|
-
|
|
801
|
+
fontSize: any;
|
|
802
|
+
};
|
|
803
|
+
xl: {
|
|
804
|
+
'&.is-circle': {
|
|
805
|
+
borderRadius: string;
|
|
806
|
+
};
|
|
807
|
+
borderRadius: string;
|
|
808
|
+
minHeight: string;
|
|
809
|
+
minWidth: string;
|
|
810
|
+
height: string;
|
|
811
|
+
width: string;
|
|
812
|
+
fontSize: any;
|
|
791
813
|
};
|
|
792
814
|
};
|
|
793
815
|
listBox: {
|
|
@@ -54,7 +54,15 @@ var selectedItemBadge = _objectSpread(_objectSpread({}, multivaluesBadge), {}, {
|
|
|
54
54
|
bg: '#4462ED !important',
|
|
55
55
|
py: 3,
|
|
56
56
|
pr: 0,
|
|
57
|
-
my: 3
|
|
57
|
+
my: 3,
|
|
58
|
+
maxWidth: '200px',
|
|
59
|
+
'& span': {
|
|
60
|
+
mr: '5px',
|
|
61
|
+
overflow: 'hidden',
|
|
62
|
+
textOverflow: 'ellipsis',
|
|
63
|
+
whiteSpace: 'nowrap',
|
|
64
|
+
flex: '1 1 0%'
|
|
65
|
+
}
|
|
58
66
|
});
|
|
59
67
|
var readOnlyBadge = _objectSpread(_objectSpread({}, multivaluesBadge), {}, {
|
|
60
68
|
p: 2.54,
|
|
@@ -53,7 +53,9 @@ var IconWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
53
53
|
sx: _objectSpread({
|
|
54
54
|
backgroundColor: "iconWrapper.wrapper.".concat(finalColor)
|
|
55
55
|
}, sx),
|
|
56
|
-
className: classNames
|
|
56
|
+
className: classNames,
|
|
57
|
+
justifyContent: "center",
|
|
58
|
+
alignItems: "center"
|
|
57
59
|
}, wrapperProps), ___EmotionJSX(Icon, _extends({
|
|
58
60
|
icon: icon,
|
|
59
61
|
size: sizeProps.size,
|
|
@@ -12,7 +12,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import DeleteIcon from '@pingux/mdi-react/DeleteIcon';
|
|
14
14
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
15
|
-
import { IconWrapper } from '../../index';
|
|
15
|
+
import { Box, IconWrapper } from '../../index';
|
|
16
16
|
import IconWrapperReadme from './IconWrapper.mdx';
|
|
17
17
|
import { iconWrapperArgTypes } from './iconWrapperAttributes';
|
|
18
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -38,4 +38,85 @@ export default {
|
|
|
38
38
|
};
|
|
39
39
|
export var Default = function Default(args) {
|
|
40
40
|
return ___EmotionJSX(IconWrapper, args);
|
|
41
|
+
};
|
|
42
|
+
export var Sizes = function Sizes() {
|
|
43
|
+
return ___EmotionJSX(Box, {
|
|
44
|
+
gap: "md",
|
|
45
|
+
isRow: true,
|
|
46
|
+
alignItems: "center"
|
|
47
|
+
}, ___EmotionJSX(IconWrapper, {
|
|
48
|
+
icon: DeleteIcon,
|
|
49
|
+
color: "cyan",
|
|
50
|
+
size: "xs",
|
|
51
|
+
title: {
|
|
52
|
+
name: 'extra small'
|
|
53
|
+
}
|
|
54
|
+
}), ___EmotionJSX(IconWrapper, {
|
|
55
|
+
icon: DeleteIcon,
|
|
56
|
+
color: "cyan",
|
|
57
|
+
size: "sm",
|
|
58
|
+
title: {
|
|
59
|
+
name: 'small'
|
|
60
|
+
}
|
|
61
|
+
}), ___EmotionJSX(IconWrapper, {
|
|
62
|
+
icon: DeleteIcon,
|
|
63
|
+
color: "cyan",
|
|
64
|
+
size: "md",
|
|
65
|
+
title: {
|
|
66
|
+
name: 'medium'
|
|
67
|
+
}
|
|
68
|
+
}), ___EmotionJSX(IconWrapper, {
|
|
69
|
+
icon: DeleteIcon,
|
|
70
|
+
color: "cyan",
|
|
71
|
+
size: "lg",
|
|
72
|
+
title: {
|
|
73
|
+
name: 'large'
|
|
74
|
+
}
|
|
75
|
+
}), ___EmotionJSX(IconWrapper, {
|
|
76
|
+
icon: DeleteIcon,
|
|
77
|
+
color: "cyan",
|
|
78
|
+
size: "xl",
|
|
79
|
+
title: {
|
|
80
|
+
name: 'extra large'
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
export var IsCircle = function IsCircle() {
|
|
85
|
+
return ___EmotionJSX(Box, {
|
|
86
|
+
gap: "md",
|
|
87
|
+
isRow: true,
|
|
88
|
+
alignItems: "center"
|
|
89
|
+
}, ___EmotionJSX(IconWrapper, {
|
|
90
|
+
icon: DeleteIcon,
|
|
91
|
+
color: "cyan",
|
|
92
|
+
size: "xs",
|
|
93
|
+
isCircle: true,
|
|
94
|
+
title: {
|
|
95
|
+
name: 'extra small circle'
|
|
96
|
+
}
|
|
97
|
+
}), ___EmotionJSX(IconWrapper, {
|
|
98
|
+
icon: DeleteIcon,
|
|
99
|
+
color: "cyan",
|
|
100
|
+
size: "sm",
|
|
101
|
+
isCircle: true,
|
|
102
|
+
title: {
|
|
103
|
+
name: 'small circle'
|
|
104
|
+
}
|
|
105
|
+
}), ___EmotionJSX(IconWrapper, {
|
|
106
|
+
icon: DeleteIcon,
|
|
107
|
+
color: "cyan",
|
|
108
|
+
size: "md",
|
|
109
|
+
isCircle: true,
|
|
110
|
+
title: {
|
|
111
|
+
name: 'medium circle'
|
|
112
|
+
}
|
|
113
|
+
}), ___EmotionJSX(IconWrapper, {
|
|
114
|
+
icon: DeleteIcon,
|
|
115
|
+
color: "cyan",
|
|
116
|
+
size: "lg",
|
|
117
|
+
isCircle: true,
|
|
118
|
+
title: {
|
|
119
|
+
name: 'large circle'
|
|
120
|
+
}
|
|
121
|
+
}));
|
|
41
122
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import { mergeProps } from 'react-aria';
|
|
4
|
+
import Clear from '@pingux/mdi-react/CloseIcon';
|
|
5
|
+
import { useHover } from '@react-aria/interactions';
|
|
6
|
+
import { Badge, Box, Icon, IconButton } from '../..';
|
|
7
|
+
import TooltipTrigger, { Tooltip } from '../TooltipTrigger';
|
|
8
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
9
|
+
var BADGE_TOOLTIP_CHAR_THRESHOLD = 25;
|
|
10
|
+
var BadgeLabelTooltip = function BadgeLabelTooltip(_ref) {
|
|
11
|
+
var _item$badgeProps;
|
|
12
|
+
var item = _ref.item,
|
|
13
|
+
index = _ref.index,
|
|
14
|
+
deleteItem = _ref.deleteItem,
|
|
15
|
+
closeBadgeRefs = _ref.closeBadgeRefs;
|
|
16
|
+
var isLong = item.name.length > BADGE_TOOLTIP_CHAR_THRESHOLD;
|
|
17
|
+
var _useHover = useHover({}),
|
|
18
|
+
hoverProps = _useHover.hoverProps,
|
|
19
|
+
isHovered = _useHover.isHovered;
|
|
20
|
+
var textProps = mergeProps(((_item$badgeProps = item.badgeProps) === null || _item$badgeProps === void 0 ? void 0 : _item$badgeProps.textProps) || {}, hoverProps);
|
|
21
|
+
var badgeRef = useRef();
|
|
22
|
+
return ___EmotionJSX(Box, {
|
|
23
|
+
as: "li"
|
|
24
|
+
}, ___EmotionJSX(TooltipTrigger, {
|
|
25
|
+
direction: "top",
|
|
26
|
+
isDisabled: !isLong,
|
|
27
|
+
isOpen: isLong && isHovered,
|
|
28
|
+
targetRef: badgeRef
|
|
29
|
+
}, ___EmotionJSX(Badge, _extends({
|
|
30
|
+
ref: badgeRef,
|
|
31
|
+
key: item.key,
|
|
32
|
+
role: "presentation",
|
|
33
|
+
variant: "selectedItemBadge",
|
|
34
|
+
label: item.name,
|
|
35
|
+
slots: item.slots
|
|
36
|
+
}, item.badgeProps, {
|
|
37
|
+
textProps: textProps
|
|
38
|
+
}), ___EmotionJSX(IconButton, _extends({
|
|
39
|
+
"aria-label": "delete ".concat(item.name),
|
|
40
|
+
"data-item": item.name,
|
|
41
|
+
onPress: function onPress(e) {
|
|
42
|
+
return deleteItem(item.key, e);
|
|
43
|
+
},
|
|
44
|
+
ref: function ref(el) {
|
|
45
|
+
return closeBadgeRefs.current[index] = el;
|
|
46
|
+
} // eslint-disable-line
|
|
47
|
+
,
|
|
48
|
+
variant: "badge.deleteButton",
|
|
49
|
+
"aria-describedby": "selectedKeysState"
|
|
50
|
+
}, item.buttonProps), ___EmotionJSX(Icon, {
|
|
51
|
+
icon: Clear,
|
|
52
|
+
size: 14,
|
|
53
|
+
title: {
|
|
54
|
+
name: 'Clear Icon'
|
|
55
|
+
}
|
|
56
|
+
}))), ___EmotionJSX(Tooltip, {
|
|
57
|
+
variant: "variants.tooltip.badgeTooltipContainer"
|
|
58
|
+
}, item.name)));
|
|
59
|
+
};
|
|
60
|
+
export default BadgeLabelTooltip;
|
|
@@ -24,13 +24,12 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
24
24
|
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
|
25
25
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
26
26
|
import { DismissButton, FocusScope, useOverlayPosition } from 'react-aria';
|
|
27
|
-
import Clear from '@pingux/mdi-react/CloseIcon';
|
|
28
27
|
import { useFilter } from '@react-aria/i18n';
|
|
29
28
|
import { useLayoutEffect, useResizeObserver } from '@react-aria/utils';
|
|
30
29
|
import { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
31
30
|
import { useListState } from '@react-stately/list';
|
|
32
31
|
import PropTypes from 'prop-types';
|
|
33
|
-
import { Badge, Box,
|
|
32
|
+
import { Badge, Box, Loader, PopoverContainer, ScrollBox, Text, TextField } from '../..';
|
|
34
33
|
import { MultivaluesContext } from '../../context/MultivaluesContext';
|
|
35
34
|
import { useGetTheme, useInputLoader, usePropWarning } from '../../hooks';
|
|
36
35
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
|
@@ -39,6 +38,7 @@ import { isIterableProp } from '../../utils/devUtils/props/isIterable';
|
|
|
39
38
|
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
|
40
39
|
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
|
41
40
|
import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
|
|
41
|
+
import BadgeLabelTooltip from './BadgeLabelTooltip';
|
|
42
42
|
import ListBox from '../ListBox';
|
|
43
43
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
44
44
|
var DefaultMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -396,34 +396,13 @@ var DefaultMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
396
396
|
return null;
|
|
397
397
|
});
|
|
398
398
|
var multivaluesFieldBadge = function multivaluesFieldBadge(item, index) {
|
|
399
|
-
return ___EmotionJSX(
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
label: item.name,
|
|
407
|
-
slots: item.slots
|
|
408
|
-
}, item.badgeProps), ___EmotionJSX(IconButton, _extends({
|
|
409
|
-
"aria-label": "delete ".concat(item.name),
|
|
410
|
-
"data-item": item.name,
|
|
411
|
-
onPress: function onPress(e) {
|
|
412
|
-
return deleteItem(item.key, e);
|
|
413
|
-
},
|
|
414
|
-
ref: function ref(el) {
|
|
415
|
-
return closeBadgeRefs.current[index] = el;
|
|
416
|
-
} // eslint-disable-line
|
|
417
|
-
,
|
|
418
|
-
variant: "badge.deleteButton",
|
|
419
|
-
"aria-describedby": "selectedKeysState"
|
|
420
|
-
}, item.buttonProps), ___EmotionJSX(Icon, {
|
|
421
|
-
icon: Clear,
|
|
422
|
-
size: 14,
|
|
423
|
-
title: {
|
|
424
|
-
name: 'Clear Icon'
|
|
425
|
-
}
|
|
426
|
-
}))));
|
|
399
|
+
return ___EmotionJSX(BadgeLabelTooltip, {
|
|
400
|
+
key: "tooltip-".concat(item.key),
|
|
401
|
+
item: item,
|
|
402
|
+
index: index,
|
|
403
|
+
deleteItem: deleteItem,
|
|
404
|
+
closeBadgeRefs: closeBadgeRefs
|
|
405
|
+
});
|
|
427
406
|
};
|
|
428
407
|
var selectedItems = ___EmotionJSX(React.Fragment, null, _mapInstanceProperty(_context0 = _Array$from(selectionManager.selectedKeys)).call(_context0, function (key, i) {
|
|
429
408
|
var _context1, _context10;
|
|
@@ -250,6 +250,23 @@ var itemsWithSlots = [{
|
|
|
250
250
|
})
|
|
251
251
|
}
|
|
252
252
|
}];
|
|
253
|
+
var longLabelItems = [{
|
|
254
|
+
id: 1,
|
|
255
|
+
name: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit,',
|
|
256
|
+
key: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit,'
|
|
257
|
+
}, {
|
|
258
|
+
id: 2,
|
|
259
|
+
name: 'Quisque vitae lacinia diam, nec ullamcorper neque.',
|
|
260
|
+
key: 'Quisque vitae lacinia diam, nec ullamcorper neque.'
|
|
261
|
+
}, {
|
|
262
|
+
id: 3,
|
|
263
|
+
name: 'In egestas dui vel dolor tincidunt, sit amet ullamcorper',
|
|
264
|
+
key: 'In egestas dui vel dolor tincidunt, sit amet ullamcorper'
|
|
265
|
+
}, {
|
|
266
|
+
id: 4,
|
|
267
|
+
name: 'Short name',
|
|
268
|
+
key: 'Short name'
|
|
269
|
+
}];
|
|
253
270
|
var setOverlayStyle = function setOverlayStyle(direction, isOpen, mr, ml, mt) {
|
|
254
271
|
return {
|
|
255
272
|
marginRight: direction === 'right' && isOpen ? mr : 0,
|
|
@@ -862,4 +879,16 @@ export var OnLoadPrev = function OnLoadPrev() {
|
|
|
862
879
|
"aria-label": item.name
|
|
863
880
|
}, item.name);
|
|
864
881
|
}));
|
|
882
|
+
};
|
|
883
|
+
export var LongLabels = function LongLabels() {
|
|
884
|
+
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(MultivaluesField, {
|
|
885
|
+
items: longLabelItems,
|
|
886
|
+
label: "Example label",
|
|
887
|
+
defaultSelectedKeys: ['Lorem ipsum dolor sit amet, consectetur adipiscing elit,', 'Quisque vitae lacinia diam, nec ullamcorper neque.', 'In egestas dui vel dolor tincidunt, sit amet ullamcorper']
|
|
888
|
+
}, function (item) {
|
|
889
|
+
return ___EmotionJSX(Item, {
|
|
890
|
+
key: item.key,
|
|
891
|
+
"aria-label": item.name
|
|
892
|
+
}, item.name);
|
|
893
|
+
}));
|
|
865
894
|
};
|