@doist/reactist 31.3.0 → 33.0.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/CHANGELOG.md +20 -0
- package/dist/reactist.cjs.development.js +279 -228
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/avatar/avatar.js +164 -95
- package/es/avatar/avatar.js.map +1 -1
- package/es/avatar/avatar.module.css.js +1 -1
- package/es/avatar/utils.js +112 -16
- package/es/avatar/utils.js.map +1 -1
- package/es/components/color-picker/color-picker.js +1 -1
- package/es/components/color-picker/color-picker.js.map +1 -1
- package/es/components/{deprecated-button → color-picker/deprecated-button}/deprecated-button.js +1 -1
- package/es/components/color-picker/deprecated-button/deprecated-button.js.map +1 -0
- package/es/components/color-picker/deprecated-button/index.js.map +1 -0
- package/es/components/color-picker/deprecated-dropdown/dropdown.js.map +1 -0
- package/es/components/color-picker/deprecated-dropdown/index.js.map +1 -0
- package/es/index.js +0 -3
- package/es/index.js.map +1 -1
- package/es/utils/polymorphism.js.map +1 -1
- package/lib/avatar/avatar.d.ts +55 -17
- package/lib/avatar/avatar.js +164 -94
- package/lib/avatar/avatar.js.map +1 -1
- package/lib/avatar/avatar.module.css.js +1 -1
- package/lib/avatar/utils.d.ts +35 -3
- package/lib/avatar/utils.js +117 -16
- package/lib/avatar/utils.js.map +1 -1
- package/lib/components/color-picker/color-picker.js +1 -1
- package/lib/components/color-picker/color-picker.js.map +1 -1
- package/lib/components/{deprecated-button → color-picker/deprecated-button}/deprecated-button.js +1 -1
- package/lib/components/color-picker/deprecated-button/deprecated-button.js.map +1 -0
- package/lib/components/color-picker/deprecated-dropdown/dropdown.js.map +1 -0
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -6
- package/lib/index.js.map +1 -1
- package/lib/utils/polymorphism.d.ts +1 -1
- package/lib/utils/polymorphism.js.map +1 -1
- package/package.json +1 -1
- package/styles/avatar.css +1 -1
- package/styles/avatar.module.css.css +1 -1
- package/styles/index.css +2 -4
- package/styles/reactist.css +4 -5
- package/es/components/deprecated-button/deprecated-button.js.map +0 -1
- package/es/components/deprecated-button/index.js.map +0 -1
- package/es/components/deprecated-dropdown/dropdown.js.map +0 -1
- package/es/components/deprecated-dropdown/index.js.map +0 -1
- package/es/components/deprecated-select/index.js +0 -3
- package/es/components/deprecated-select/index.js.map +0 -1
- package/es/components/deprecated-select/select.js +0 -117
- package/es/components/deprecated-select/select.js.map +0 -1
- package/lib/components/deprecated-button/deprecated-button.js.map +0 -1
- package/lib/components/deprecated-dropdown/dropdown.js.map +0 -1
- package/lib/components/deprecated-select/index.d.ts +0 -2
- package/lib/components/deprecated-select/index.js +0 -10
- package/lib/components/deprecated-select/index.js.map +0 -1
- package/lib/components/deprecated-select/select.d.ts +0 -33
- package/lib/components/deprecated-select/select.js +0 -145
- package/lib/components/deprecated-select/select.js.map +0 -1
- /package/es/components/{deprecated-button → color-picker/deprecated-button}/index.js +0 -0
- /package/es/components/{deprecated-dropdown → color-picker/deprecated-dropdown}/dropdown.js +0 -0
- /package/es/components/{deprecated-dropdown → color-picker/deprecated-dropdown}/index.js +0 -0
- /package/lib/components/{deprecated-button → color-picker/deprecated-button}/deprecated-button.d.ts +0 -0
- /package/lib/components/{deprecated-button → color-picker/deprecated-button}/index.d.ts +0 -0
- /package/lib/components/{deprecated-button → color-picker/deprecated-button}/index.js +0 -0
- /package/lib/components/{deprecated-button → color-picker/deprecated-button}/index.js.map +0 -0
- /package/lib/components/{deprecated-dropdown → color-picker/deprecated-dropdown}/dropdown.d.ts +0 -0
- /package/lib/components/{deprecated-dropdown → color-picker/deprecated-dropdown}/dropdown.js +0 -0
- /package/lib/components/{deprecated-dropdown → color-picker/deprecated-dropdown}/index.d.ts +0 -0
- /package/lib/components/{deprecated-dropdown → color-picker/deprecated-dropdown}/index.js +0 -0
- /package/lib/components/{deprecated-dropdown → color-picker/deprecated-dropdown}/index.js.map +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [33.0.0](https://github.com/Doist/reactist/compare/v32.0.0...v33.0.0) (2026-06-03)
|
|
2
|
+
|
|
3
|
+
### ⚠ BREAKING CHANGES
|
|
4
|
+
|
|
5
|
+
- remove deprecated Select, Button, and Dropdown from public API (#1053)
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
- remove deprecated Select, Button, and Dropdown from public API ([#1053](https://github.com/Doist/reactist/issues/1053)) ([7e2f648](https://github.com/Doist/reactist/commit/7e2f648f8c39c46dac15be96477b72ef3e83dabb))
|
|
10
|
+
|
|
11
|
+
## [32.0.0](https://github.com/Doist/reactist/compare/v31.3.0...v32.0.0) (2026-05-28)
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
- Revamped Avatar component (#1048)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- Revamped Avatar component ([#1048](https://github.com/Doist/reactist/issues/1048)) ([fbf1e54](https://github.com/Doist/reactist/commit/fbf1e54f17d965912edac24d6ca049bf4c5d756a))
|
|
20
|
+
|
|
1
21
|
## [31.3.0](https://github.com/Doist/reactist/compare/v31.2.0...v31.3.0) (2026-05-28)
|
|
2
22
|
|
|
3
23
|
### Features
|
|
@@ -2323,7 +2323,7 @@ function useToastsAnimation() {
|
|
|
2323
2323
|
}
|
|
2324
2324
|
positions.set(id, element.getBoundingClientRect().top);
|
|
2325
2325
|
});
|
|
2326
|
-
animations.forEach(_temp$
|
|
2326
|
+
animations.forEach(_temp$1);
|
|
2327
2327
|
};
|
|
2328
2328
|
$[2] = t2;
|
|
2329
2329
|
} else {
|
|
@@ -2373,7 +2373,7 @@ function useToastsAnimation() {
|
|
|
2373
2373
|
}
|
|
2374
2374
|
return t5;
|
|
2375
2375
|
}
|
|
2376
|
-
function _temp$
|
|
2376
|
+
function _temp$1(t0) {
|
|
2377
2377
|
const {
|
|
2378
2378
|
element: element_0,
|
|
2379
2379
|
transforms,
|
|
@@ -3800,7 +3800,7 @@ const PasswordField = /*#__PURE__*/React__namespace.forwardRef(function Password
|
|
|
3800
3800
|
}
|
|
3801
3801
|
let t4;
|
|
3802
3802
|
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
3803
|
-
t4 = () => setPasswordVisible(_temp
|
|
3803
|
+
t4 = () => setPasswordVisible(_temp);
|
|
3804
3804
|
$[6] = t4;
|
|
3805
3805
|
} else {
|
|
3806
3806
|
t4 = $[6];
|
|
@@ -3845,7 +3845,7 @@ const PasswordField = /*#__PURE__*/React__namespace.forwardRef(function Password
|
|
|
3845
3845
|
}
|
|
3846
3846
|
return t7;
|
|
3847
3847
|
});
|
|
3848
|
-
function _temp
|
|
3848
|
+
function _temp(v) {
|
|
3849
3849
|
return !v;
|
|
3850
3850
|
}
|
|
3851
3851
|
|
|
@@ -4483,132 +4483,296 @@ function useAutoExpand(t0) {
|
|
|
4483
4483
|
React__namespace.useEffect(t3, t4);
|
|
4484
4484
|
}
|
|
4485
4485
|
|
|
4486
|
+
/**
|
|
4487
|
+
* Supported avatar sizes, in CSS pixels.
|
|
4488
|
+
*/
|
|
4489
|
+
|
|
4490
|
+
/**
|
|
4491
|
+
* Supported avatar clipping shapes.
|
|
4492
|
+
*/
|
|
4493
|
+
|
|
4494
|
+
/**
|
|
4495
|
+
* Avatar image source.
|
|
4496
|
+
*
|
|
4497
|
+
* Use a string for a single image URL, or a source map keyed by intrinsic image width. Source maps
|
|
4498
|
+
* are converted to native `srcSet` width descriptors.
|
|
4499
|
+
*/
|
|
4500
|
+
|
|
4501
|
+
const AVATAR_META_COLOR_COUNT = 20;
|
|
4502
|
+
const WHITESPACE_REGEXP = new RegExp('\\p{White_Space}+', 'gu');
|
|
4503
|
+
const GRAPHEME_SEGMENTER = typeof Intl !== 'undefined' && 'Segmenter' in Intl ? new Intl.Segmenter('und', {
|
|
4504
|
+
granularity: 'grapheme'
|
|
4505
|
+
}) : undefined;
|
|
4506
|
+
function normalizeAvatarName(name) {
|
|
4507
|
+
return name?.normalize('NFC').trim().replace(WHITESPACE_REGEXP, ' ') ?? '';
|
|
4508
|
+
}
|
|
4509
|
+
function getGraphemeClusters(value) {
|
|
4510
|
+
if (GRAPHEME_SEGMENTER) {
|
|
4511
|
+
return Array.from(GRAPHEME_SEGMENTER.segment(value), ({
|
|
4512
|
+
segment
|
|
4513
|
+
}) => segment);
|
|
4514
|
+
}
|
|
4515
|
+
return Array.from(value);
|
|
4516
|
+
}
|
|
4517
|
+
function getInitialGrapheme(value) {
|
|
4518
|
+
return getGraphemeClusters(value?.toUpperCase() ?? '')[0] ?? '';
|
|
4519
|
+
}
|
|
4486
4520
|
function getInitials(name) {
|
|
4487
|
-
|
|
4521
|
+
const nameParts = normalizeAvatarName(name).split(' ').filter(Boolean);
|
|
4522
|
+
if (nameParts.length === 0) {
|
|
4488
4523
|
return '';
|
|
4489
4524
|
}
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
if (firstInitial != null && lastInitial != null && initials != null &&
|
|
4495
|
-
// Better readable this way.
|
|
4496
|
-
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
|
4497
|
-
firstInitial[0] !== lastInitial[0]) {
|
|
4498
|
-
initials += lastInitial[0];
|
|
4499
|
-
}
|
|
4500
|
-
return initials?.toUpperCase();
|
|
4525
|
+
if (nameParts.length === 1) {
|
|
4526
|
+
return getGraphemeClusters(nameParts[0].toUpperCase()).slice(0, 2).join('');
|
|
4527
|
+
}
|
|
4528
|
+
return `${getInitialGrapheme(nameParts[0])}${getInitialGrapheme(nameParts[nameParts.length - 1])}`;
|
|
4501
4529
|
}
|
|
4502
|
-
function
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4530
|
+
function getSortedImageSources(image) {
|
|
4531
|
+
return Object.entries(image).map(([sourceSize, src]) => ({
|
|
4532
|
+
sourceSize: Number(sourceSize),
|
|
4533
|
+
src
|
|
4534
|
+
})).filter(({
|
|
4535
|
+
sourceSize,
|
|
4536
|
+
src
|
|
4537
|
+
}) => Number.isFinite(sourceSize) && sourceSize > 0 && src).sort((a, b) => a.sourceSize - b.sourceSize);
|
|
4506
4538
|
}
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
const AVATAR_COLORS = ['#fcc652', '#e9952c', '#e16b2d', '#d84b40', '#e8435a', '#e5198a', '#ad3889', '#86389c', '#a8a8a8', '#98be2f', '#5d9d50', '#5f9f85', '#5bbcb6', '#32a3bf', '#2bafeb', '#2d88c3', '#3863cc', '#5e5e5e'];
|
|
4511
|
-
function Avatar(t0) {
|
|
4512
|
-
const $ = reactCompilerRuntime.c(26);
|
|
4513
|
-
let avatarUrl;
|
|
4514
|
-
let className;
|
|
4515
|
-
let exceptionallySetClassName;
|
|
4516
|
-
let props;
|
|
4517
|
-
let t1;
|
|
4518
|
-
let t2;
|
|
4519
|
-
let user;
|
|
4520
|
-
if ($[0] !== t0) {
|
|
4521
|
-
({
|
|
4522
|
-
user,
|
|
4523
|
-
avatarUrl,
|
|
4524
|
-
size: t1,
|
|
4525
|
-
className,
|
|
4526
|
-
colorList: t2,
|
|
4527
|
-
exceptionallySetClassName,
|
|
4528
|
-
...props
|
|
4529
|
-
} = t0);
|
|
4530
|
-
$[0] = t0;
|
|
4531
|
-
$[1] = avatarUrl;
|
|
4532
|
-
$[2] = className;
|
|
4533
|
-
$[3] = exceptionallySetClassName;
|
|
4534
|
-
$[4] = props;
|
|
4535
|
-
$[5] = t1;
|
|
4536
|
-
$[6] = t2;
|
|
4537
|
-
$[7] = user;
|
|
4538
|
-
} else {
|
|
4539
|
-
avatarUrl = $[1];
|
|
4540
|
-
className = $[2];
|
|
4541
|
-
exceptionallySetClassName = $[3];
|
|
4542
|
-
props = $[4];
|
|
4543
|
-
t1 = $[5];
|
|
4544
|
-
t2 = $[6];
|
|
4545
|
-
user = $[7];
|
|
4539
|
+
function getImagePropsFromSources(sources, sizes) {
|
|
4540
|
+
if (sources.length === 0) {
|
|
4541
|
+
return undefined;
|
|
4546
4542
|
}
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
}
|
|
4556
|
-
|
|
4543
|
+
return {
|
|
4544
|
+
src: sources[sources.length - 1].src,
|
|
4545
|
+
srcSet: sources.map(({
|
|
4546
|
+
sourceSize,
|
|
4547
|
+
src
|
|
4548
|
+
}) => `${src} ${sourceSize}w`).join(', '),
|
|
4549
|
+
sizes,
|
|
4550
|
+
sources
|
|
4551
|
+
};
|
|
4552
|
+
}
|
|
4553
|
+
function getSources(image, size) {
|
|
4554
|
+
if (!image) {
|
|
4555
|
+
return undefined;
|
|
4557
4556
|
}
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
if ($[11] !== avatarUrl || $[12] !== colorList || $[13] !== user.email) {
|
|
4562
|
-
t4 = avatarUrl ? {
|
|
4563
|
-
backgroundImage: `url(${avatarUrl})`,
|
|
4564
|
-
textIndent: "-9999px"
|
|
4565
|
-
} : {
|
|
4566
|
-
backgroundColor: colorList[emailToIndex(user.email, colorList.length)]
|
|
4557
|
+
if (typeof image === 'string') {
|
|
4558
|
+
return {
|
|
4559
|
+
src: image
|
|
4567
4560
|
};
|
|
4568
|
-
$[11] = avatarUrl;
|
|
4569
|
-
$[12] = colorList;
|
|
4570
|
-
$[13] = user.email;
|
|
4571
|
-
$[14] = t4;
|
|
4572
|
-
} else {
|
|
4573
|
-
t4 = $[14];
|
|
4574
4561
|
}
|
|
4575
|
-
const
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
} else {
|
|
4582
|
-
t5 = $[16];
|
|
4562
|
+
const sources = getSortedImageSources(image);
|
|
4563
|
+
return getImagePropsFromSources(sources, `${size}px`);
|
|
4564
|
+
}
|
|
4565
|
+
function getAvatarImageIdentityKey(image) {
|
|
4566
|
+
if (!image) {
|
|
4567
|
+
return 'fallback';
|
|
4583
4568
|
}
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4569
|
+
if (typeof image === 'string') {
|
|
4570
|
+
return image;
|
|
4571
|
+
}
|
|
4572
|
+
const sources = getSortedImageSources(image);
|
|
4573
|
+
if (sources.length === 0) {
|
|
4574
|
+
return 'fallback';
|
|
4575
|
+
}
|
|
4576
|
+
return sources.map(({
|
|
4577
|
+
sourceSize,
|
|
4578
|
+
src
|
|
4579
|
+
}) => `${sourceSize}:${src}`).join('|');
|
|
4580
|
+
}
|
|
4581
|
+
function getAvailableImageSources(imageProps, failedSources) {
|
|
4582
|
+
if (!imageProps) {
|
|
4583
|
+
return undefined;
|
|
4584
|
+
}
|
|
4585
|
+
if (failedSources.length === 0) {
|
|
4586
|
+
return imageProps;
|
|
4587
|
+
}
|
|
4588
|
+
if (!imageProps.sources) {
|
|
4589
|
+
return failedSources.includes(imageProps.src) ? undefined : imageProps;
|
|
4590
|
+
}
|
|
4591
|
+
return getImagePropsFromSources(imageProps.sources.filter(({
|
|
4592
|
+
src
|
|
4593
|
+
}) => !failedSources.includes(src)), imageProps.sizes);
|
|
4594
|
+
}
|
|
4595
|
+
function getAvatarMetaColorIndex(name) {
|
|
4596
|
+
const normalizedName = normalizeAvatarName(name);
|
|
4597
|
+
let hash = 0;
|
|
4598
|
+
for (const char of normalizedName) {
|
|
4599
|
+
hash = hash * 31 + (char.codePointAt(0) ?? 0) >>> 0;
|
|
4600
|
+
}
|
|
4601
|
+
return hash % AVATAR_META_COLOR_COUNT;
|
|
4602
|
+
}
|
|
4603
|
+
|
|
4604
|
+
var modules_08f3eeac = {"avatar":"acf9ee3d","size-80":"_5b32f21b","size-72":"_5dd2ceae","size-62":"_0737423f","size-50":"_47744c53","size-40":"_087775aa","size-36":"_02c89bce","size-30":"_3ed61ce0","size-28":"c9fa2651","size-24":"_89506d0e","size-20":"d7ab9fd7","size-18":"_32fef877","size-16":"_8962c0a0","size-12":"a06fa349","initials":"_80b6bfbf","meta-color-0":"_64da0562","meta-color-1":"ee7c29c0","meta-color-2":"_70215fb1","meta-color-3":"_488b23cd","meta-color-4":"f6b3e824","meta-color-5":"_88b828ae","meta-color-6":"f931ad92","meta-color-7":"_504e515a","meta-color-8":"_277cc6cd","meta-color-9":"db85100e","meta-color-10":"c76af5ed","meta-color-11":"ab7368dc","meta-color-12":"c2a85a75","meta-color-13":"_0e942ae0","meta-color-14":"_2f79016f","meta-color-15":"_118f815d","meta-color-16":"_6e5574e6","meta-color-17":"_49d688e7","meta-color-18":"d5233bf3","meta-color-19":"_710699d5","shape-circle":"_2b4e8069","shape-rounded":"_28fdd710","image":"bda7eadb"};
|
|
4605
|
+
|
|
4606
|
+
/**
|
|
4607
|
+
* Props for the `Avatar` component.
|
|
4608
|
+
*/
|
|
4609
|
+
|
|
4610
|
+
/**
|
|
4611
|
+
* Displays an avatar from an image URL, a source map keyed by intrinsic
|
|
4612
|
+
* image width, or initials derived from the provided name (with a background
|
|
4613
|
+
* color).
|
|
4614
|
+
*/
|
|
4615
|
+
const Avatar = polymorphicComponent(function Avatar({
|
|
4616
|
+
as,
|
|
4617
|
+
size,
|
|
4618
|
+
shape = 'circle',
|
|
4619
|
+
name,
|
|
4620
|
+
image,
|
|
4621
|
+
alt,
|
|
4622
|
+
exceptionallySetClassName,
|
|
4623
|
+
'data-testid': testId,
|
|
4624
|
+
'aria-hidden': ariaHidden,
|
|
4625
|
+
'aria-label': ariaLabel,
|
|
4626
|
+
...restProps
|
|
4627
|
+
}, ref) {
|
|
4628
|
+
const label = getAvatarLabel({
|
|
4629
|
+
alt,
|
|
4630
|
+
name,
|
|
4631
|
+
'aria-label': ariaLabel
|
|
4632
|
+
});
|
|
4633
|
+
const isDecorative = Boolean(ariaHidden ?? label === '');
|
|
4634
|
+
return /*#__PURE__*/React__namespace.createElement(Box$1, _extends__default["default"]({
|
|
4635
|
+
as: as,
|
|
4636
|
+
ref: ref,
|
|
4637
|
+
className: classNames__default["default"](modules_08f3eeac.avatar, modules_08f3eeac[`size-${size}`], modules_08f3eeac[`shape-${shape}`], exceptionallySetClassName),
|
|
4638
|
+
"data-testid": testId,
|
|
4639
|
+
display: "inlineFlex",
|
|
4640
|
+
alignItems: "center",
|
|
4641
|
+
justifyContent: "center",
|
|
4642
|
+
flexShrink: 0,
|
|
4643
|
+
overflow: "hidden",
|
|
4644
|
+
textAlign: "center"
|
|
4645
|
+
}, restProps), /*#__PURE__*/React__namespace.createElement(AvatarImage
|
|
4646
|
+
// Allows `AvatarImage` to remount when the image map changes,
|
|
4647
|
+
// which resets error states without replacing the avatar root.
|
|
4648
|
+
, {
|
|
4649
|
+
key: getAvatarImageIdentityKey(image),
|
|
4650
|
+
size: size,
|
|
4651
|
+
name: name,
|
|
4652
|
+
image: image,
|
|
4653
|
+
label: label,
|
|
4654
|
+
"aria-hidden": isDecorative
|
|
4655
|
+
}));
|
|
4656
|
+
});
|
|
4657
|
+
function getAvatarLabel({
|
|
4658
|
+
alt,
|
|
4659
|
+
name,
|
|
4660
|
+
'aria-label': ariaLabel
|
|
4661
|
+
}) {
|
|
4662
|
+
return ariaLabel ?? alt ?? normalizeAvatarName(name);
|
|
4663
|
+
}
|
|
4664
|
+
function AvatarImage(t0) {
|
|
4665
|
+
const $ = reactCompilerRuntime.c(22);
|
|
4666
|
+
const {
|
|
4667
|
+
size,
|
|
4668
|
+
name,
|
|
4669
|
+
image,
|
|
4670
|
+
label,
|
|
4671
|
+
"aria-hidden": ariaHidden
|
|
4672
|
+
} = t0;
|
|
4673
|
+
const imageSources = getSources(image, size);
|
|
4674
|
+
let t1;
|
|
4675
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
4676
|
+
t1 = [];
|
|
4677
|
+
$[0] = t1;
|
|
4592
4678
|
} else {
|
|
4593
|
-
|
|
4679
|
+
t1 = $[0];
|
|
4594
4680
|
}
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
$[
|
|
4602
|
-
$[
|
|
4603
|
-
$[23] = t6;
|
|
4604
|
-
$[24] = userInitials;
|
|
4605
|
-
$[25] = t7;
|
|
4681
|
+
const [failedImageSources, setFailedImageSources] = React__namespace.useState(t1);
|
|
4682
|
+
const availableImageSources = getAvailableImageSources(imageSources, failedImageSources);
|
|
4683
|
+
let t2;
|
|
4684
|
+
if ($[1] !== availableImageSources || $[2] !== name) {
|
|
4685
|
+
t2 = availableImageSources ? "" : getInitials(name);
|
|
4686
|
+
$[1] = availableImageSources;
|
|
4687
|
+
$[2] = name;
|
|
4688
|
+
$[3] = t2;
|
|
4606
4689
|
} else {
|
|
4607
|
-
|
|
4690
|
+
t2 = $[3];
|
|
4691
|
+
}
|
|
4692
|
+
const initials = t2;
|
|
4693
|
+
const hasInitials = initials !== "";
|
|
4694
|
+
if (availableImageSources) {
|
|
4695
|
+
let t3;
|
|
4696
|
+
if ($[4] !== availableImageSources || $[5] !== setFailedImageSources) {
|
|
4697
|
+
t3 = event => {
|
|
4698
|
+
const failedSource = getFailedImageSource(availableImageSources, event.currentTarget);
|
|
4699
|
+
setFailedImageSources(currentFailedSources => currentFailedSources.includes(failedSource) ? currentFailedSources : [...currentFailedSources, failedSource]);
|
|
4700
|
+
};
|
|
4701
|
+
$[4] = availableImageSources;
|
|
4702
|
+
$[5] = setFailedImageSources;
|
|
4703
|
+
$[6] = t3;
|
|
4704
|
+
} else {
|
|
4705
|
+
t3 = $[6];
|
|
4706
|
+
}
|
|
4707
|
+
let t4;
|
|
4708
|
+
if ($[7] !== ariaHidden || $[8] !== availableImageSources.sizes || $[9] !== availableImageSources.src || $[10] !== availableImageSources.srcSet || $[11] !== label || $[12] !== t3) {
|
|
4709
|
+
t4 = /*#__PURE__*/React__namespace.createElement("img", {
|
|
4710
|
+
className: modules_08f3eeac.image,
|
|
4711
|
+
src: availableImageSources.src,
|
|
4712
|
+
srcSet: availableImageSources.srcSet,
|
|
4713
|
+
sizes: availableImageSources.sizes,
|
|
4714
|
+
alt: label,
|
|
4715
|
+
"aria-hidden": ariaHidden,
|
|
4716
|
+
onError: t3
|
|
4717
|
+
});
|
|
4718
|
+
$[7] = ariaHidden;
|
|
4719
|
+
$[8] = availableImageSources.sizes;
|
|
4720
|
+
$[9] = availableImageSources.src;
|
|
4721
|
+
$[10] = availableImageSources.srcSet;
|
|
4722
|
+
$[11] = label;
|
|
4723
|
+
$[12] = t3;
|
|
4724
|
+
$[13] = t4;
|
|
4725
|
+
} else {
|
|
4726
|
+
t4 = $[13];
|
|
4727
|
+
}
|
|
4728
|
+
return t4;
|
|
4729
|
+
}
|
|
4730
|
+
if (hasInitials) {
|
|
4731
|
+
const t3 = modules_08f3eeac[`meta-color-${getAvatarMetaColorIndex(name)}`];
|
|
4732
|
+
let t4;
|
|
4733
|
+
if ($[14] !== t3) {
|
|
4734
|
+
t4 = classNames__default["default"](modules_08f3eeac.initials, t3);
|
|
4735
|
+
$[14] = t3;
|
|
4736
|
+
$[15] = t4;
|
|
4737
|
+
} else {
|
|
4738
|
+
t4 = $[15];
|
|
4739
|
+
}
|
|
4740
|
+
const t5 = label ? "img" : undefined;
|
|
4741
|
+
let t6;
|
|
4742
|
+
if ($[16] !== ariaHidden || $[17] !== initials || $[18] !== label || $[19] !== t4 || $[20] !== t5) {
|
|
4743
|
+
t6 = /*#__PURE__*/React__namespace.createElement("div", {
|
|
4744
|
+
className: t4,
|
|
4745
|
+
role: t5,
|
|
4746
|
+
"aria-label": label,
|
|
4747
|
+
"aria-hidden": ariaHidden
|
|
4748
|
+
}, initials);
|
|
4749
|
+
$[16] = ariaHidden;
|
|
4750
|
+
$[17] = initials;
|
|
4751
|
+
$[18] = label;
|
|
4752
|
+
$[19] = t4;
|
|
4753
|
+
$[20] = t5;
|
|
4754
|
+
$[21] = t6;
|
|
4755
|
+
} else {
|
|
4756
|
+
t6 = $[21];
|
|
4757
|
+
}
|
|
4758
|
+
return t6;
|
|
4759
|
+
}
|
|
4760
|
+
return null;
|
|
4761
|
+
}
|
|
4762
|
+
function getAbsoluteImageSource(src, image) {
|
|
4763
|
+
try {
|
|
4764
|
+
return new URL(src, image.ownerDocument.baseURI).href;
|
|
4765
|
+
} catch {
|
|
4766
|
+
return src;
|
|
4608
4767
|
}
|
|
4609
|
-
return t7;
|
|
4610
4768
|
}
|
|
4611
|
-
|
|
4769
|
+
function getFailedImageSource(imageProps, image) {
|
|
4770
|
+
const failedSrc = image.currentSrc || image.src || imageProps.src;
|
|
4771
|
+
const matchingSource = imageProps.sources?.find(({
|
|
4772
|
+
src
|
|
4773
|
+
}) => src === failedSrc || getAbsoluteImageSource(src, image) === failedSrc);
|
|
4774
|
+
return matchingSource?.src ?? imageProps.src;
|
|
4775
|
+
}
|
|
4612
4776
|
|
|
4613
4777
|
var modules_33c7c985 = {"badge":"_2714fc40","badge-info":"_3397e001","badge-positive":"b7b8944a","badge-promote":"bfc2b0e9","badge-attention":"d45e594f","badge-warning":"_1e30e9b3"};
|
|
4614
4778
|
|
|
@@ -7234,116 +7398,6 @@ Input$1.displayName = 'Input';
|
|
|
7234
7398
|
|
|
7235
7399
|
var Input = Input$1;
|
|
7236
7400
|
|
|
7237
|
-
function Select(t0) {
|
|
7238
|
-
const $ = reactCompilerRuntime.c(25);
|
|
7239
|
-
let defaultValue;
|
|
7240
|
-
let onChange;
|
|
7241
|
-
let otherProps;
|
|
7242
|
-
let t1;
|
|
7243
|
-
let t2;
|
|
7244
|
-
let t3;
|
|
7245
|
-
let value;
|
|
7246
|
-
if ($[0] !== t0) {
|
|
7247
|
-
({
|
|
7248
|
-
value,
|
|
7249
|
-
options: t1,
|
|
7250
|
-
onChange,
|
|
7251
|
-
disabled: t2,
|
|
7252
|
-
className: t3,
|
|
7253
|
-
defaultValue,
|
|
7254
|
-
...otherProps
|
|
7255
|
-
} = t0);
|
|
7256
|
-
$[0] = t0;
|
|
7257
|
-
$[1] = defaultValue;
|
|
7258
|
-
$[2] = onChange;
|
|
7259
|
-
$[3] = otherProps;
|
|
7260
|
-
$[4] = t1;
|
|
7261
|
-
$[5] = t2;
|
|
7262
|
-
$[6] = t3;
|
|
7263
|
-
$[7] = value;
|
|
7264
|
-
} else {
|
|
7265
|
-
defaultValue = $[1];
|
|
7266
|
-
onChange = $[2];
|
|
7267
|
-
otherProps = $[3];
|
|
7268
|
-
t1 = $[4];
|
|
7269
|
-
t2 = $[5];
|
|
7270
|
-
t3 = $[6];
|
|
7271
|
-
value = $[7];
|
|
7272
|
-
}
|
|
7273
|
-
let t4;
|
|
7274
|
-
if ($[8] !== t1) {
|
|
7275
|
-
t4 = t1 === undefined ? [] : t1;
|
|
7276
|
-
$[8] = t1;
|
|
7277
|
-
$[9] = t4;
|
|
7278
|
-
} else {
|
|
7279
|
-
t4 = $[9];
|
|
7280
|
-
}
|
|
7281
|
-
const options = t4;
|
|
7282
|
-
const disabled = t2 === undefined ? true : t2;
|
|
7283
|
-
const className = t3 === undefined ? "" : t3;
|
|
7284
|
-
let t5;
|
|
7285
|
-
if ($[10] !== className || $[11] !== disabled) {
|
|
7286
|
-
t5 = classNames__default["default"]("reactist_select", {
|
|
7287
|
-
disabled
|
|
7288
|
-
}, className);
|
|
7289
|
-
$[10] = className;
|
|
7290
|
-
$[11] = disabled;
|
|
7291
|
-
$[12] = t5;
|
|
7292
|
-
} else {
|
|
7293
|
-
t5 = $[12];
|
|
7294
|
-
}
|
|
7295
|
-
const selectClassName = t5;
|
|
7296
|
-
let t6;
|
|
7297
|
-
if ($[13] !== onChange) {
|
|
7298
|
-
t6 = event => onChange ? onChange(event.target.value) : undefined;
|
|
7299
|
-
$[13] = onChange;
|
|
7300
|
-
$[14] = t6;
|
|
7301
|
-
} else {
|
|
7302
|
-
t6 = $[14];
|
|
7303
|
-
}
|
|
7304
|
-
let t7;
|
|
7305
|
-
if ($[15] !== options) {
|
|
7306
|
-
t7 = options?.map(_temp);
|
|
7307
|
-
$[15] = options;
|
|
7308
|
-
$[16] = t7;
|
|
7309
|
-
} else {
|
|
7310
|
-
t7 = $[16];
|
|
7311
|
-
}
|
|
7312
|
-
let t8;
|
|
7313
|
-
if ($[17] !== defaultValue || $[18] !== disabled || $[19] !== otherProps || $[20] !== selectClassName || $[21] !== t6 || $[22] !== t7 || $[23] !== value) {
|
|
7314
|
-
t8 = /*#__PURE__*/React__namespace.createElement("select", _extends__default["default"]({
|
|
7315
|
-
className: selectClassName,
|
|
7316
|
-
value: value,
|
|
7317
|
-
onChange: t6,
|
|
7318
|
-
disabled: disabled,
|
|
7319
|
-
defaultValue: defaultValue
|
|
7320
|
-
}, otherProps), t7);
|
|
7321
|
-
$[17] = defaultValue;
|
|
7322
|
-
$[18] = disabled;
|
|
7323
|
-
$[19] = otherProps;
|
|
7324
|
-
$[20] = selectClassName;
|
|
7325
|
-
$[21] = t6;
|
|
7326
|
-
$[22] = t7;
|
|
7327
|
-
$[23] = value;
|
|
7328
|
-
$[24] = t8;
|
|
7329
|
-
} else {
|
|
7330
|
-
t8 = $[24];
|
|
7331
|
-
}
|
|
7332
|
-
return t8;
|
|
7333
|
-
}
|
|
7334
|
-
function _temp(option) {
|
|
7335
|
-
return /*#__PURE__*/React__namespace.createElement("option", {
|
|
7336
|
-
key: option.key || option.value,
|
|
7337
|
-
value: option.value,
|
|
7338
|
-
disabled: option.disabled
|
|
7339
|
-
}, option.text);
|
|
7340
|
-
}
|
|
7341
|
-
Select.displayName = 'Select';
|
|
7342
|
-
Select.defaultProps = {
|
|
7343
|
-
options: [],
|
|
7344
|
-
disabled: false
|
|
7345
|
-
};
|
|
7346
|
-
|
|
7347
7401
|
exports.Avatar = Avatar;
|
|
7348
7402
|
exports.Badge = Badge;
|
|
7349
7403
|
exports.Banner = Banner;
|
|
@@ -7355,10 +7409,7 @@ exports.ColorPicker = ColorPicker;
|
|
|
7355
7409
|
exports.Column = Column;
|
|
7356
7410
|
exports.Columns = Columns;
|
|
7357
7411
|
exports.ContextMenuTrigger = ContextMenuTrigger;
|
|
7358
|
-
exports.DeprecatedButton = Button;
|
|
7359
|
-
exports.DeprecatedDropdown = DeprecatedDropdown;
|
|
7360
7412
|
exports.DeprecatedInput = Input;
|
|
7361
|
-
exports.DeprecatedSelect = Select;
|
|
7362
7413
|
exports.Divider = Divider;
|
|
7363
7414
|
exports.Heading = Heading;
|
|
7364
7415
|
exports.Hidden = Hidden;
|