@kaizen/components 1.73.8 → 1.73.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.
- package/dist/cjs/AvatarGroup/AvatarGroup.cjs +15 -5
- package/dist/cjs/Tag/Tag.cjs +1 -1
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +1 -1
- package/dist/cjs/TitleBlockZen/TitleBlockZen.cjs +1 -1
- package/dist/esm/AvatarGroup/AvatarGroup.mjs +15 -5
- package/dist/esm/Tag/Tag.mjs +1 -1
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +1 -1
- package/dist/esm/TitleBlockZen/TitleBlockZen.mjs +1 -1
- package/dist/types/SplitButton/subcomponents/BaseButton/BaseButton.d.ts +1 -1
- package/package.json +20 -20
- package/src/AvatarGroup/AvatarGroup.tsx +14 -10
- package/src/SplitButton/subcomponents/BaseButton/BaseButton.tsx +1 -1
- package/src/Tag/Tag.tsx +3 -3
- package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +3 -3
- package/src/TitleBlockZen/TitleBlockZen.tsx +3 -3
|
@@ -12,8 +12,9 @@ function _interopDefault(e) {
|
|
|
12
12
|
}
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
14
|
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
15
|
-
var
|
|
16
|
-
|
|
15
|
+
var Counter = function (_a) {
|
|
16
|
+
var remainingAvatars = _a.remainingAvatars;
|
|
17
|
+
if (remainingAvatars <= 0) return null;
|
|
17
18
|
return React__default.default.createElement("li", {
|
|
18
19
|
"aria-label": "There ".concat(remainingAvatars > 1 ? "are ".concat(remainingAvatars, " other members") : "is ".concat(remainingAvatars, " other member"), " of this group"),
|
|
19
20
|
className: AvatarGroup_module.AvatarGroupItem
|
|
@@ -22,7 +23,10 @@ var renderCounter = function (remainingAvatars) {
|
|
|
22
23
|
"aria-hidden": true
|
|
23
24
|
}, "+".concat(remainingAvatars)));
|
|
24
25
|
};
|
|
25
|
-
var
|
|
26
|
+
var AllAvatars = function (_a) {
|
|
27
|
+
var avatars = _a.avatars,
|
|
28
|
+
maxVisible = _a.maxVisible,
|
|
29
|
+
size = _a.size;
|
|
26
30
|
return React__default.default.createElement(React__default.default.Fragment, null, avatars === null || avatars === void 0 ? void 0 : avatars.map(function (avatarProps, index) {
|
|
27
31
|
return index < maxVisible && React__default.default.createElement("li", {
|
|
28
32
|
key: "avatar-".concat(index),
|
|
@@ -30,7 +34,9 @@ var renderAvatars = function (avatars, maxVisible, size) {
|
|
|
30
34
|
}, React__default.default.createElement(Avatar.Avatar, tslib.__assign({}, avatarProps, {
|
|
31
35
|
size: size
|
|
32
36
|
})));
|
|
33
|
-
}),
|
|
37
|
+
}), React__default.default.createElement(Counter, {
|
|
38
|
+
remainingAvatars: (avatars === null || avatars === void 0 ? void 0 : avatars.length) - maxVisible
|
|
39
|
+
}));
|
|
34
40
|
};
|
|
35
41
|
/**
|
|
36
42
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3065021264/Avatar+Group Guidance} |
|
|
@@ -47,6 +53,10 @@ var AvatarGroup = function (_a) {
|
|
|
47
53
|
return React__default.default.createElement("ul", tslib.__assign({
|
|
48
54
|
className: classnames__default.default(AvatarGroup_module.AvatarGroup, AvatarGroup_module[size], classNameOverride),
|
|
49
55
|
"aria-label": "Avatar Group"
|
|
50
|
-
}, restProps),
|
|
56
|
+
}, restProps), React__default.default.createElement(AllAvatars, {
|
|
57
|
+
avatars: avatars,
|
|
58
|
+
maxVisible: maxVisible,
|
|
59
|
+
size: size
|
|
60
|
+
}));
|
|
51
61
|
};
|
|
52
62
|
exports.AvatarGroup = AvatarGroup;
|
package/dist/cjs/Tag/Tag.cjs
CHANGED
|
@@ -85,7 +85,7 @@ var Tag = function (props) {
|
|
|
85
85
|
className: Tag_module.profile
|
|
86
86
|
}, props.avatar && renderAvatar(props.avatar));
|
|
87
87
|
default:
|
|
88
|
-
return;
|
|
88
|
+
return null;
|
|
89
89
|
}
|
|
90
90
|
}(), React__default.default.createElement("span", {
|
|
91
91
|
className: classnames__default.default(Tag_module.textContent, isTruncated && Tag_module.truncate),
|
|
@@ -102,7 +102,7 @@ var GenericTile = function (_a) {
|
|
|
102
102
|
return informationProp;
|
|
103
103
|
};
|
|
104
104
|
var renderBack = function () {
|
|
105
|
-
if (!information) return;
|
|
105
|
+
if (!information) return null;
|
|
106
106
|
var returnButtonLabel = formatMessage({
|
|
107
107
|
id: 'kzGenericTile.infoButtonReturnLabel',
|
|
108
108
|
defaultMessage: 'Hide information:',
|
|
@@ -26,7 +26,7 @@ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
|
26
26
|
var renderTag = function (surveyStatus) {
|
|
27
27
|
var tagVariant;
|
|
28
28
|
if (tagVariant === 'profile') {
|
|
29
|
-
return;
|
|
29
|
+
return null;
|
|
30
30
|
}
|
|
31
31
|
if (surveyStatus.status === 'draft') {
|
|
32
32
|
tagVariant = 'statusDraft';
|
|
@@ -3,8 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { Avatar } from '../Avatar/Avatar.mjs';
|
|
5
5
|
import styles from './AvatarGroup.module.css.mjs';
|
|
6
|
-
var
|
|
7
|
-
|
|
6
|
+
var Counter = function (_a) {
|
|
7
|
+
var remainingAvatars = _a.remainingAvatars;
|
|
8
|
+
if (remainingAvatars <= 0) return null;
|
|
8
9
|
return /*#__PURE__*/React.createElement("li", {
|
|
9
10
|
"aria-label": "There ".concat(remainingAvatars > 1 ? "are ".concat(remainingAvatars, " other members") : "is ".concat(remainingAvatars, " other member"), " of this group"),
|
|
10
11
|
className: styles.AvatarGroupItem
|
|
@@ -13,7 +14,10 @@ var renderCounter = function (remainingAvatars) {
|
|
|
13
14
|
"aria-hidden": true
|
|
14
15
|
}, "+".concat(remainingAvatars)));
|
|
15
16
|
};
|
|
16
|
-
var
|
|
17
|
+
var AllAvatars = function (_a) {
|
|
18
|
+
var avatars = _a.avatars,
|
|
19
|
+
maxVisible = _a.maxVisible,
|
|
20
|
+
size = _a.size;
|
|
17
21
|
return /*#__PURE__*/React.createElement(React.Fragment, null, avatars === null || avatars === void 0 ? void 0 : avatars.map(function (avatarProps, index) {
|
|
18
22
|
return index < maxVisible && (/*#__PURE__*/React.createElement("li", {
|
|
19
23
|
key: "avatar-".concat(index),
|
|
@@ -21,7 +25,9 @@ var renderAvatars = function (avatars, maxVisible, size) {
|
|
|
21
25
|
}, /*#__PURE__*/React.createElement(Avatar, __assign({}, avatarProps, {
|
|
22
26
|
size: size
|
|
23
27
|
}))));
|
|
24
|
-
}),
|
|
28
|
+
}), /*#__PURE__*/React.createElement(Counter, {
|
|
29
|
+
remainingAvatars: (avatars === null || avatars === void 0 ? void 0 : avatars.length) - maxVisible
|
|
30
|
+
}));
|
|
25
31
|
};
|
|
26
32
|
/**
|
|
27
33
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3065021264/Avatar+Group Guidance} |
|
|
@@ -38,6 +44,10 @@ var AvatarGroup = function (_a) {
|
|
|
38
44
|
return /*#__PURE__*/React.createElement("ul", __assign({
|
|
39
45
|
className: classnames(styles.AvatarGroup, styles[size], classNameOverride),
|
|
40
46
|
"aria-label": "Avatar Group"
|
|
41
|
-
}, restProps),
|
|
47
|
+
}, restProps), /*#__PURE__*/React.createElement(AllAvatars, {
|
|
48
|
+
avatars: avatars,
|
|
49
|
+
maxVisible: maxVisible,
|
|
50
|
+
size: size
|
|
51
|
+
}));
|
|
42
52
|
};
|
|
43
53
|
export { AvatarGroup };
|
package/dist/esm/Tag/Tag.mjs
CHANGED
|
@@ -77,7 +77,7 @@ const Tag = /*#__PURE__*/function () {
|
|
|
77
77
|
className: styles.profile
|
|
78
78
|
}, props.avatar && renderAvatar(props.avatar));
|
|
79
79
|
default:
|
|
80
|
-
return;
|
|
80
|
+
return null;
|
|
81
81
|
}
|
|
82
82
|
}(), /*#__PURE__*/React.createElement("span", {
|
|
83
83
|
className: classnames(styles.textContent, isTruncated && styles.truncate),
|
|
@@ -94,7 +94,7 @@ const GenericTile = /*#__PURE__*/function () {
|
|
|
94
94
|
return informationProp;
|
|
95
95
|
};
|
|
96
96
|
var renderBack = function () {
|
|
97
|
-
if (!information) return;
|
|
97
|
+
if (!information) return null;
|
|
98
98
|
var returnButtonLabel = formatMessage({
|
|
99
99
|
id: 'kzGenericTile.infoButtonReturnLabel',
|
|
100
100
|
defaultMessage: 'Hide information:',
|
|
@@ -5,7 +5,7 @@ type ButtonAttributes = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
|
5
5
|
type AnchorButtonAttributes = AnchorAttributes & ButtonAttributes;
|
|
6
6
|
export type BaseButtonProps = {
|
|
7
7
|
label: string;
|
|
8
|
-
icon?: React.
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
9
|
isReversed?: boolean;
|
|
10
10
|
} & OverrideClassName<AnchorButtonAttributes>;
|
|
11
11
|
export declare const BaseButton: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "1.73.
|
|
3
|
+
"version": "1.73.9",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -104,23 +104,23 @@
|
|
|
104
104
|
"dependencies": {
|
|
105
105
|
"@floating-ui/react-dom": "^2.1.2",
|
|
106
106
|
"@headlessui/react": "<=1.5.0",
|
|
107
|
-
"@internationalized/date": "^3.
|
|
107
|
+
"@internationalized/date": "^3.7.0",
|
|
108
108
|
"@popperjs/core": "^2.11.8",
|
|
109
109
|
"@reach/tabs": "^0.18.0",
|
|
110
|
-
"@react-aria/button": "^3.
|
|
111
|
-
"@react-aria/datepicker": "^3.
|
|
112
|
-
"@react-aria/focus": "^3.
|
|
113
|
-
"@react-aria/i18n": "^3.12.
|
|
114
|
-
"@react-aria/listbox": "^3.
|
|
115
|
-
"@react-aria/menu": "^3.
|
|
116
|
-
"@react-aria/overlays": "^3.
|
|
117
|
-
"@react-aria/select": "^3.15.
|
|
118
|
-
"@react-aria/utils": "^3.
|
|
119
|
-
"@react-stately/collections": "^3.12.
|
|
120
|
-
"@react-stately/datepicker": "^3.
|
|
121
|
-
"@react-stately/list": "^3.
|
|
122
|
-
"@react-stately/menu": "^3.9.
|
|
123
|
-
"@react-stately/select": "^3.6.
|
|
110
|
+
"@react-aria/button": "^3.12.1",
|
|
111
|
+
"@react-aria/datepicker": "^3.14.1",
|
|
112
|
+
"@react-aria/focus": "^3.20.1",
|
|
113
|
+
"@react-aria/i18n": "^3.12.7",
|
|
114
|
+
"@react-aria/listbox": "^3.14.2",
|
|
115
|
+
"@react-aria/menu": "^3.18.1",
|
|
116
|
+
"@react-aria/overlays": "^3.26.1",
|
|
117
|
+
"@react-aria/select": "^3.15.3",
|
|
118
|
+
"@react-aria/utils": "^3.28.1",
|
|
119
|
+
"@react-stately/collections": "^3.12.2",
|
|
120
|
+
"@react-stately/datepicker": "^3.13.0",
|
|
121
|
+
"@react-stately/list": "^3.12.0",
|
|
122
|
+
"@react-stately/menu": "^3.9.2",
|
|
123
|
+
"@react-stately/select": "^3.6.11",
|
|
124
124
|
"@react-types/shared": "^3.26.0",
|
|
125
125
|
"classnames": "^2.5.1",
|
|
126
126
|
"date-fns": "^4.1.0",
|
|
@@ -138,8 +138,8 @@
|
|
|
138
138
|
"prosemirror-utils": "^1.2.2",
|
|
139
139
|
"prosemirror-view": "^1.37.1",
|
|
140
140
|
"react-animate-height": "^3.2.3",
|
|
141
|
-
"react-aria": "^3.
|
|
142
|
-
"react-aria-components": "^1.
|
|
141
|
+
"react-aria": "^3.38.1",
|
|
142
|
+
"react-aria-components": "^1.7.1",
|
|
143
143
|
"react-day-picker": "8.10.1",
|
|
144
144
|
"react-focus-lock": "^2.13.5",
|
|
145
145
|
"react-focus-on": "^3.9.4",
|
|
@@ -185,8 +185,8 @@
|
|
|
185
185
|
"svgo": "^3.3.2",
|
|
186
186
|
"tslib": "^2.8.1",
|
|
187
187
|
"tsx": "^4.19.2",
|
|
188
|
-
"@kaizen/
|
|
189
|
-
"@kaizen/
|
|
188
|
+
"@kaizen/design-tokens": "10.8.9",
|
|
189
|
+
"@kaizen/package-bundler": "2.0.5"
|
|
190
190
|
},
|
|
191
191
|
"devDependenciesComments": {
|
|
192
192
|
"sass": "Prevent deprecation warnings introduced in 1.80 as we plan to move away from sass",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { type HTMLAttributes } from 'react'
|
|
1
|
+
import React, { type HTMLAttributes, type ReactNode } from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
|
3
3
|
import { Avatar, type CompanyAvatarProps, type GenericAvatarProps } from '~components/Avatar'
|
|
4
4
|
import { type OverrideClassName } from '~components/types/OverrideClassName'
|
|
@@ -29,8 +29,8 @@ export type AvatarGroupProps = {
|
|
|
29
29
|
avatars: AvatarList
|
|
30
30
|
} & OverrideClassName<HTMLAttributes<HTMLUListElement>>
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
if (remainingAvatars <= 0) return
|
|
32
|
+
const Counter = ({ remainingAvatars }: { remainingAvatars: number }): ReactNode => {
|
|
33
|
+
if (remainingAvatars <= 0) return null
|
|
34
34
|
return (
|
|
35
35
|
<li
|
|
36
36
|
aria-label={`There ${
|
|
@@ -47,11 +47,15 @@ const renderCounter = (remainingAvatars: number): JSX.Element | void => {
|
|
|
47
47
|
)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
const
|
|
51
|
-
avatars
|
|
52
|
-
maxVisible
|
|
53
|
-
size
|
|
54
|
-
|
|
50
|
+
const AllAvatars = ({
|
|
51
|
+
avatars,
|
|
52
|
+
maxVisible,
|
|
53
|
+
size,
|
|
54
|
+
}: {
|
|
55
|
+
avatars: AvatarList
|
|
56
|
+
maxVisible: number
|
|
57
|
+
size: AvatarGroupSize
|
|
58
|
+
}): ReactNode => (
|
|
55
59
|
<>
|
|
56
60
|
{avatars?.map(
|
|
57
61
|
(avatarProps, index) =>
|
|
@@ -61,7 +65,7 @@ const renderAvatars = (
|
|
|
61
65
|
</li>
|
|
62
66
|
),
|
|
63
67
|
)}
|
|
64
|
-
{
|
|
68
|
+
<Counter remainingAvatars={avatars?.length - maxVisible} />
|
|
65
69
|
</>
|
|
66
70
|
)
|
|
67
71
|
|
|
@@ -81,6 +85,6 @@ export const AvatarGroup = ({
|
|
|
81
85
|
aria-label="Avatar Group"
|
|
82
86
|
{...restProps}
|
|
83
87
|
>
|
|
84
|
-
{
|
|
88
|
+
<AllAvatars avatars={avatars} maxVisible={maxVisible} size={size} />
|
|
85
89
|
</ul>
|
|
86
90
|
)
|
|
@@ -12,7 +12,7 @@ const isAnchor = (attributes: AnchorButtonAttributes): boolean =>
|
|
|
12
12
|
|
|
13
13
|
export type BaseButtonProps = {
|
|
14
14
|
label: string
|
|
15
|
-
icon?: React.
|
|
15
|
+
icon?: React.ReactNode
|
|
16
16
|
isReversed?: boolean
|
|
17
17
|
} & OverrideClassName<AnchorButtonAttributes>
|
|
18
18
|
|
package/src/Tag/Tag.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { type ReactNode } from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
|
3
3
|
import { Avatar, type AvatarProps } from '~components/Avatar'
|
|
4
4
|
import { Icon } from '~components/__next__/Icon'
|
|
@@ -71,7 +71,7 @@ export const Tag = (props: TagProps): JSX.Element => {
|
|
|
71
71
|
<div className={styles.layoutContainer}>
|
|
72
72
|
<>
|
|
73
73
|
{canShowIcon &&
|
|
74
|
-
(():
|
|
74
|
+
((): ReactNode => {
|
|
75
75
|
switch (props.variant) {
|
|
76
76
|
case 'validationPositive':
|
|
77
77
|
return (
|
|
@@ -104,7 +104,7 @@ export const Tag = (props: TagProps): JSX.Element => {
|
|
|
104
104
|
</span>
|
|
105
105
|
)
|
|
106
106
|
default:
|
|
107
|
-
return
|
|
107
|
+
return null
|
|
108
108
|
}
|
|
109
109
|
})()}
|
|
110
110
|
<span
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState, type HTMLAttributes } from 'react'
|
|
1
|
+
import React, { useEffect, useRef, useState, type HTMLAttributes, type ReactNode } from 'react'
|
|
2
2
|
import { useIntl } from '@cultureamp/i18n-react-intl'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { Button, IconButton } from '~components/Button'
|
|
@@ -130,8 +130,8 @@ export const GenericTile = ({
|
|
|
130
130
|
return informationProp
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
const renderBack = ():
|
|
134
|
-
if (!information) return
|
|
133
|
+
const renderBack = (): ReactNode => {
|
|
134
|
+
if (!information) return null
|
|
135
135
|
|
|
136
136
|
const returnButtonLabel = formatMessage({
|
|
137
137
|
id: 'kzGenericTile.infoButtonReturnLabel',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { type ReactNode } from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
|
3
3
|
import { Avatar } from '~components/Avatar'
|
|
4
4
|
import { IconButton } from '~components/Button'
|
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
import { createTabletOverflowMenuItems, isReversed } from './utils'
|
|
22
22
|
import styles from './TitleBlockZen.module.scss'
|
|
23
23
|
|
|
24
|
-
const renderTag = (surveyStatus: SurveyStatus):
|
|
24
|
+
const renderTag = (surveyStatus: SurveyStatus): ReactNode => {
|
|
25
25
|
let tagVariant: React.ComponentPropsWithoutRef<typeof Tag>['variant']
|
|
26
26
|
|
|
27
27
|
if (tagVariant === 'profile') {
|
|
28
|
-
return
|
|
28
|
+
return null
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
if (surveyStatus.status === 'draft') {
|