@jobber/components 8.30.0 → 9.1.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/dist/Autocomplete/Autocomplete.messages.d.ts +10 -0
- package/dist/Autocomplete/index.cjs +2 -0
- package/dist/Autocomplete/index.mjs +2 -0
- package/dist/Autocomplete-cjs.js +17 -4
- package/dist/Autocomplete-es.js +18 -5
- package/dist/ButtonDismiss-cjs.js +1 -1
- package/dist/ButtonDismiss-es.js +1 -1
- package/dist/Card/index.cjs +2 -0
- package/dist/Card/index.mjs +2 -0
- package/dist/Chip/index.cjs +2 -0
- package/dist/Chip/index.mjs +2 -0
- package/dist/Chip-cjs.js +19 -1
- package/dist/Chip-es.js +19 -2
- package/dist/Chips/Chips.messages.d.ts +14 -0
- package/dist/Chips/InternalChipDismissible/index.cjs +2 -0
- package/dist/Chips/InternalChipDismissible/index.mjs +2 -0
- package/dist/Chips/index.cjs +3 -1
- package/dist/Chips/index.mjs +3 -1
- package/dist/DataDump/index.cjs +2 -0
- package/dist/DataDump/index.mjs +2 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +2 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +2 -0
- package/dist/DataList/components/DataListFilters/index.cjs +2 -0
- package/dist/DataList/components/DataListFilters/index.mjs +2 -0
- package/dist/DataList/components/DataListSearch/index.cjs +2 -0
- package/dist/DataList/components/DataListSearch/index.mjs +2 -0
- package/dist/DataList/index.cjs +2 -0
- package/dist/DataList/index.mjs +2 -0
- package/dist/DataListSearch-cjs.js +1 -1
- package/dist/DataListSearch-es.js +1 -1
- package/dist/DataTable/index.cjs +2 -0
- package/dist/DataTable/index.mjs +2 -0
- package/dist/Dialog/dialogComposableShared.d.ts +1 -1
- package/dist/FilterPicker/components/FilterPickerActivator/index.cjs +2 -0
- package/dist/FilterPicker/components/FilterPickerActivator/index.mjs +2 -0
- package/dist/FilterPicker/components/FilterPickerTrigger/index.cjs +2 -0
- package/dist/FilterPicker/components/FilterPickerTrigger/index.mjs +2 -0
- package/dist/FilterPicker/index.cjs +2 -0
- package/dist/FilterPicker/index.mjs +2 -0
- package/dist/FilterPickerContentSearch-cjs.js +1 -1
- package/dist/FilterPickerContentSearch-es.js +1 -1
- package/dist/FormField/components/FormField.messages.d.ts +6 -0
- package/dist/FormField/index.cjs +2 -0
- package/dist/FormField/index.mjs +2 -0
- package/dist/FormFieldWrapper-cjs.js +11 -2
- package/dist/FormFieldWrapper-es.js +11 -2
- package/dist/Icon/Icon.d.ts +1 -0
- package/dist/Icon/index.cjs +9 -1
- package/dist/Icon/index.mjs +1 -1
- package/dist/Icon-cjs.js +9 -23
- package/dist/Icon-es.js +9 -23
- package/dist/InputAvatar/InputAvatar.messages.d.ts +10 -0
- package/dist/InputAvatar/index.cjs +2 -0
- package/dist/InputAvatar/index.mjs +2 -0
- package/dist/InputAvatar-cjs.js +15 -2
- package/dist/InputAvatar-es.js +15 -2
- package/dist/InputDate/index.cjs +1 -0
- package/dist/InputDate/index.mjs +1 -0
- package/dist/InputEmail/index.cjs +2 -0
- package/dist/InputEmail/index.mjs +2 -0
- package/dist/InputPhoneNumber/index.cjs +2 -0
- package/dist/InputPhoneNumber/index.mjs +2 -0
- package/dist/InputText/index.cjs +2 -0
- package/dist/InputText/index.mjs +2 -0
- package/dist/InputTime/index.cjs +2 -0
- package/dist/InputTime/index.mjs +2 -0
- package/dist/InternalChipDismissible-cjs.js +10 -6
- package/dist/InternalChipDismissible-es.js +11 -7
- package/dist/LegacySelect/index.cjs +2 -0
- package/dist/LegacySelect/index.mjs +2 -0
- package/dist/Menu/Menu.messages.d.ts +14 -0
- package/dist/Menu/index.cjs +2 -0
- package/dist/Menu/index.mjs +2 -0
- package/dist/Menu-cjs.js +20 -2
- package/dist/Menu-es.js +21 -3
- package/dist/Modal/index.mjs +1 -1
- package/dist/Page/index.cjs +2 -0
- package/dist/Page/index.mjs +2 -0
- package/dist/dialogReturnFocus-cjs.js +2 -2
- package/dist/dialogReturnFocus-es.js +2 -2
- package/dist/docs/ActivityIndicator/ActivityIndicator.md +11 -11
- package/dist/docs/Dialog/Dialog.md +16 -14
- package/dist/docs/Icon/Icon.md +19 -1
- package/dist/docs/InputNumberExperimental/InputNumberExperimental.md +1 -1
- package/dist/docs/empty-states/empty-states.md +13 -5
- package/dist/floating-ui.react-es.js +1 -1
- package/dist/index.cjs +10 -2
- package/dist/index.mjs +2 -2
- package/dist/showToast-cjs.js +1 -1
- package/dist/showToast-es.js +1 -1
- package/dist/styles.css +1 -2
- package/package.json +3 -3
package/dist/FormField/index.cjs
CHANGED
|
@@ -13,6 +13,8 @@ require('react-router-dom');
|
|
|
13
13
|
require('../Icon-cjs.js');
|
|
14
14
|
require('../Typography-cjs.js');
|
|
15
15
|
require('../Text-cjs.js');
|
|
16
|
+
require('../useAtlantisI18n-cjs.js');
|
|
17
|
+
require('../AtlantisContext-cjs.js');
|
|
16
18
|
require('../useFormFieldFocus-cjs.js');
|
|
17
19
|
require('../InputValidation-cjs.js');
|
|
18
20
|
|
package/dist/FormField/index.mjs
CHANGED
|
@@ -11,5 +11,7 @@ import 'react-router-dom';
|
|
|
11
11
|
import '../Icon-es.js';
|
|
12
12
|
import '../Typography-es.js';
|
|
13
13
|
import '../Text-es.js';
|
|
14
|
+
import '../useAtlantisI18n-es.js';
|
|
15
|
+
import '../AtlantisContext-es.js';
|
|
14
16
|
import '../useFormFieldFocus-es.js';
|
|
15
17
|
import '../InputValidation-es.js';
|
|
@@ -8,6 +8,7 @@ var classnames = require('classnames');
|
|
|
8
8
|
var Button = require('./Button-cjs.js');
|
|
9
9
|
var Icon = require('./Icon-cjs.js');
|
|
10
10
|
var Text = require('./Text-cjs.js');
|
|
11
|
+
var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
|
|
11
12
|
var useFormFieldFocus = require('./useFormFieldFocus-cjs.js');
|
|
12
13
|
var InputValidation = require('./InputValidation-cjs.js');
|
|
13
14
|
|
|
@@ -53,11 +54,19 @@ function FormFieldDescription({ id, description, visible = true, }) {
|
|
|
53
54
|
|
|
54
55
|
var styles = {"clearInput":"YmRTd-KeXv4-","spinning":"B25z9B8I3gs-"};
|
|
55
56
|
|
|
57
|
+
const formFieldMessages = useAtlantisI18n.defineMessages({
|
|
58
|
+
clearInput: {
|
|
59
|
+
en: "Clear input",
|
|
60
|
+
es: "Borrar entrada",
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
56
64
|
function ClearAction({ onClick, visible, }) {
|
|
65
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(formFieldMessages);
|
|
57
66
|
if (!visible)
|
|
58
67
|
return null;
|
|
59
|
-
return (React.createElement("button", { className: styles.clearInput, onClick: onClick, type: "button", "aria-label": "
|
|
60
|
-
React.createElement(Icon.Icon, { name: "
|
|
68
|
+
return (React.createElement("button", { className: styles.clearInput, onClick: onClick, type: "button", "aria-label": t("clearInput"), "data-testid": "ATL-FormField-clearButton" },
|
|
69
|
+
React.createElement(Icon.Icon, { name: "cross", size: "small" })));
|
|
61
70
|
}
|
|
62
71
|
|
|
63
72
|
function useToolbar(props) {
|
|
@@ -6,6 +6,7 @@ import classnames from 'classnames';
|
|
|
6
6
|
import { B as Button } from './Button-es.js';
|
|
7
7
|
import { I as Icon } from './Icon-es.js';
|
|
8
8
|
import { T as Text } from './Text-es.js';
|
|
9
|
+
import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
|
|
9
10
|
import { u as useFormFieldFocus } from './useFormFieldFocus-es.js';
|
|
10
11
|
import { I as InputValidation } from './InputValidation-es.js';
|
|
11
12
|
|
|
@@ -51,11 +52,19 @@ function FormFieldDescription({ id, description, visible = true, }) {
|
|
|
51
52
|
|
|
52
53
|
var styles = {"clearInput":"YmRTd-KeXv4-","spinning":"B25z9B8I3gs-"};
|
|
53
54
|
|
|
55
|
+
const formFieldMessages = defineMessages({
|
|
56
|
+
clearInput: {
|
|
57
|
+
en: "Clear input",
|
|
58
|
+
es: "Borrar entrada",
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
54
62
|
function ClearAction({ onClick, visible, }) {
|
|
63
|
+
const { t } = useAtlantisI18n(formFieldMessages);
|
|
55
64
|
if (!visible)
|
|
56
65
|
return null;
|
|
57
|
-
return (React__default.createElement("button", { className: styles.clearInput, onClick: onClick, type: "button", "aria-label": "
|
|
58
|
-
React__default.createElement(Icon, { name: "
|
|
66
|
+
return (React__default.createElement("button", { className: styles.clearInput, onClick: onClick, type: "button", "aria-label": t("clearInput"), "data-testid": "ATL-FormField-clearButton" },
|
|
67
|
+
React__default.createElement(Icon, { name: "cross", size: "small" })));
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
function useToolbar(props) {
|
package/dist/Icon/Icon.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { CSSProperties } from "react";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type { IconColorNames, IconNames, IconSizes } from "@jobber/design";
|
|
4
4
|
export type { IconColorNames, IconNames } from "@jobber/design";
|
|
5
|
+
export { iconNames, isIconName } from "@jobber/design";
|
|
5
6
|
export interface IconProps {
|
|
6
7
|
/** The icon to show. */
|
|
7
8
|
readonly name: IconNames;
|
package/dist/Icon/index.cjs
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var Icon = require('../Icon-cjs.js');
|
|
4
|
+
var design = require('@jobber/design');
|
|
4
5
|
require('react');
|
|
5
|
-
require('@jobber/design');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
exports.Icon = Icon.Icon;
|
|
10
|
+
Object.defineProperty(exports, "iconNames", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return design.iconNames; }
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "isIconName", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return design.isIconName; }
|
|
17
|
+
});
|
package/dist/Icon/index.mjs
CHANGED
package/dist/Icon-cjs.js
CHANGED
|
@@ -4,35 +4,21 @@ var React = require('react');
|
|
|
4
4
|
var design = require('@jobber/design');
|
|
5
5
|
|
|
6
6
|
function Icon({ name, color, customColor, size = "base", testID, UNSAFE_className, UNSAFE_style, }) {
|
|
7
|
-
let icon;
|
|
8
7
|
const { svgStyle, pathStyle, paths, viewBox } = design.getIcon({
|
|
9
8
|
name,
|
|
10
|
-
color
|
|
9
|
+
color,
|
|
10
|
+
customColor,
|
|
11
11
|
size,
|
|
12
12
|
platform: "web",
|
|
13
13
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
14
|
+
// Paths with their own fill are static artwork; only unfilled paths take
|
|
15
|
+
// the themed color and customColor.
|
|
16
|
+
// getIcon returns undefined paths for an unknown icon name; render nothing rather than crash.
|
|
17
|
+
const icon = (paths !== null && paths !== void 0 ? paths : []).map(path => {
|
|
18
|
+
var _a;
|
|
19
|
+
return (React.createElement("path", { key: path.d, style: Object.assign(Object.assign({}, (path.fill ? {} : pathStyle)), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.path), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.path, d: path.d, fill: (_a = path.fill) !== null && _a !== void 0 ? _a : customColor, fillOpacity: path.fillOpacity, opacity: path.opacity }));
|
|
20
|
+
});
|
|
21
21
|
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: viewBox, style: Object.assign(Object.assign({}, svgStyle), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.svg), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.svg, "data-testid": testID || name }, icon));
|
|
22
22
|
}
|
|
23
|
-
function getIconColor(name, color) {
|
|
24
|
-
if (name === "truck") {
|
|
25
|
-
return color || "green";
|
|
26
|
-
}
|
|
27
|
-
return color;
|
|
28
|
-
}
|
|
29
|
-
function getTruck(pathStyle, customColor) {
|
|
30
|
-
return (React.createElement("g", { transform: "translate(233.000000, 0.000000)", style: Object.assign({}, pathStyle) },
|
|
31
|
-
React.createElement("path", { d: "M31.030303,124.121212 C31.030303,106.983796 44.9231903,93.0909091 62.0606061,93.0909091 L93.0909091,93.0909091 L93.0909091,279.272727 L62.0606061,279.272727 C44.9231903,279.272727 31.030303,265.37984 31.030303,248.242424 L31.030303,124.121212 Z M31.030303,744.727273 C31.030303,727.589236 44.9231903,713.69697 62.0606061,713.69697 L93.0909091,713.69697 L93.0909091,899.878788 L62.0606061,899.878788 C44.9231903,899.878788 31.030303,885.986521 31.030303,868.848485 L31.030303,744.727273 Z M62.0606061,961.939394 L496.484848,961.939394 L496.484848,992.969697 C496.484848,1010.10773 482.592582,1024 465.454545,1024 L93.0909091,1024 C75.9534933,1024 62.0606061,1010.10773 62.0606061,992.969697 L62.0606061,961.939394 Z M494.858861,713.715588 L463.834764,714.258618 L467.083636,900.412509 L498.107733,899.869479 C515.242667,899.571588 528.889794,885.437285 528.591903,868.302352 L526.425988,744.199758 C526.128097,727.064824 511.993794,713.417697 494.858861,713.715588 Z M496.484848,93.0909091 L465.454545,93.0909091 L465.454545,279.272727 L496.484848,279.272727 C513.622885,279.272727 527.515152,265.37984 527.515152,248.242424 L527.515152,124.121212 C527.515152,106.983796 513.622885,93.0909091 496.484848,93.0909091 Z", id: "Shape", fill: "#2B2B2B" }),
|
|
32
|
-
React.createElement("path", { d: "M124.121212,0 C89.8460703,0 62.0606061,27.7854642 62.0606061,62.0606061 L62.0606061,310.30303 L31.030303,310.30303 C13.8927321,310.30303 0,324.195297 0,341.333333 L62.0606061,341.333333 L62.0606061,992.969697 L496.484848,992.969697 L496.484848,341.333333 L558.545455,341.333333 C558.545455,324.195297 544.653188,310.30303 527.515152,310.30303 L496.484848,310.30303 L496.484848,62.0606061 C496.484848,27.7854642 468.700315,0 434.424242,0 L124.121212,0 Z", id: "Path", fill: customColor }),
|
|
33
|
-
React.createElement("path", { d: "M465.454545,589.575758 L93.0909091,589.575758 L93.0909091,713.69697 L124.121212,713.69697 C141.258628,713.69697 155.151515,727.589236 155.151515,744.727273 L155.151515,868.848485 C155.151515,885.986521 141.258628,899.878788 124.121212,899.878788 L93.0909091,899.878788 L93.0909091,961.939394 L465.454545,961.939394 L465.454545,899.878788 L434.424242,899.878788 C417.286206,899.878788 403.393939,885.986521 403.393939,868.848485 L403.393939,744.727273 C403.393939,727.589236 417.286206,713.69697 434.424242,713.69697 L465.454545,713.69697 L465.454545,589.575758 Z", id: "Path", fillOpacity: "0.35", fill: "#000000" }),
|
|
34
|
-
React.createElement("path", { d: "M93.0909091,62.0606061 C93.0909091,44.9231903 106.983796,31.030303 124.121212,31.030303 L434.424242,31.030303 C451.562279,31.030303 465.454545,44.9231903 465.454545,62.0606061 L465.454545,589.575758 L93.0909091,589.575758 L93.0909091,62.0606061 Z M93.0909091,713.69697 L124.121212,713.69697 C141.258628,713.69697 155.151515,727.589236 155.151515,744.727273 L155.151515,868.848485 C155.151515,885.986521 141.258628,899.878788 124.121212,899.878788 L93.0909091,899.878788 L93.0909091,713.69697 Z M434.424242,713.69697 C417.286206,713.69697 403.393939,727.589236 403.393939,744.727273 L403.393939,868.848485 C403.393939,885.986521 417.286206,899.878788 434.424242,899.878788 L465.454545,899.878788 L465.454545,713.69697 L434.424242,713.69697 Z", id: "Shape", fill: "#FFFFFF", opacity: "0.5" }),
|
|
35
|
-
React.createElement("path", { d: "M93.0909091,279.272727 C113.777881,268.929396 192.387879,248.242424 279.272727,248.242424 C366.157576,248.242424 444.766642,268.929396 465.454545,279.272727 L403.393939,372.363636 C393.051539,362.021236 341.333333,341.333333 279.272727,341.333333 C217.212121,341.333333 165.494846,362.021236 155.151515,372.363636 L93.0909091,279.272727 Z M155.151515,512 L155.151515,403.393939 L93.0909091,310.30303 L93.0909091,512 L155.151515,512 Z M403.393939,512 L403.393939,403.393939 L465.454545,310.30303 L465.454545,512 L403.393939,512 Z", id: "Shape", fill: "#2A2A2A" })));
|
|
36
|
-
}
|
|
37
23
|
|
|
38
24
|
exports.Icon = Icon;
|
package/dist/Icon-es.js
CHANGED
|
@@ -2,35 +2,21 @@ import React__default from 'react';
|
|
|
2
2
|
import { getIcon } from '@jobber/design';
|
|
3
3
|
|
|
4
4
|
function Icon({ name, color, customColor, size = "base", testID, UNSAFE_className, UNSAFE_style, }) {
|
|
5
|
-
let icon;
|
|
6
5
|
const { svgStyle, pathStyle, paths, viewBox } = getIcon({
|
|
7
6
|
name,
|
|
8
|
-
color
|
|
7
|
+
color,
|
|
8
|
+
customColor,
|
|
9
9
|
size,
|
|
10
10
|
platform: "web",
|
|
11
11
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
12
|
+
// Paths with their own fill are static artwork; only unfilled paths take
|
|
13
|
+
// the themed color and customColor.
|
|
14
|
+
// getIcon returns undefined paths for an unknown icon name; render nothing rather than crash.
|
|
15
|
+
const icon = (paths !== null && paths !== void 0 ? paths : []).map(path => {
|
|
16
|
+
var _a;
|
|
17
|
+
return (React__default.createElement("path", { key: path.d, style: Object.assign(Object.assign({}, (path.fill ? {} : pathStyle)), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.path), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.path, d: path.d, fill: (_a = path.fill) !== null && _a !== void 0 ? _a : customColor, fillOpacity: path.fillOpacity, opacity: path.opacity }));
|
|
18
|
+
});
|
|
19
19
|
return (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: viewBox, style: Object.assign(Object.assign({}, svgStyle), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.svg), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.svg, "data-testid": testID || name }, icon));
|
|
20
20
|
}
|
|
21
|
-
function getIconColor(name, color) {
|
|
22
|
-
if (name === "truck") {
|
|
23
|
-
return color || "green";
|
|
24
|
-
}
|
|
25
|
-
return color;
|
|
26
|
-
}
|
|
27
|
-
function getTruck(pathStyle, customColor) {
|
|
28
|
-
return (React__default.createElement("g", { transform: "translate(233.000000, 0.000000)", style: Object.assign({}, pathStyle) },
|
|
29
|
-
React__default.createElement("path", { d: "M31.030303,124.121212 C31.030303,106.983796 44.9231903,93.0909091 62.0606061,93.0909091 L93.0909091,93.0909091 L93.0909091,279.272727 L62.0606061,279.272727 C44.9231903,279.272727 31.030303,265.37984 31.030303,248.242424 L31.030303,124.121212 Z M31.030303,744.727273 C31.030303,727.589236 44.9231903,713.69697 62.0606061,713.69697 L93.0909091,713.69697 L93.0909091,899.878788 L62.0606061,899.878788 C44.9231903,899.878788 31.030303,885.986521 31.030303,868.848485 L31.030303,744.727273 Z M62.0606061,961.939394 L496.484848,961.939394 L496.484848,992.969697 C496.484848,1010.10773 482.592582,1024 465.454545,1024 L93.0909091,1024 C75.9534933,1024 62.0606061,1010.10773 62.0606061,992.969697 L62.0606061,961.939394 Z M494.858861,713.715588 L463.834764,714.258618 L467.083636,900.412509 L498.107733,899.869479 C515.242667,899.571588 528.889794,885.437285 528.591903,868.302352 L526.425988,744.199758 C526.128097,727.064824 511.993794,713.417697 494.858861,713.715588 Z M496.484848,93.0909091 L465.454545,93.0909091 L465.454545,279.272727 L496.484848,279.272727 C513.622885,279.272727 527.515152,265.37984 527.515152,248.242424 L527.515152,124.121212 C527.515152,106.983796 513.622885,93.0909091 496.484848,93.0909091 Z", id: "Shape", fill: "#2B2B2B" }),
|
|
30
|
-
React__default.createElement("path", { d: "M124.121212,0 C89.8460703,0 62.0606061,27.7854642 62.0606061,62.0606061 L62.0606061,310.30303 L31.030303,310.30303 C13.8927321,310.30303 0,324.195297 0,341.333333 L62.0606061,341.333333 L62.0606061,992.969697 L496.484848,992.969697 L496.484848,341.333333 L558.545455,341.333333 C558.545455,324.195297 544.653188,310.30303 527.515152,310.30303 L496.484848,310.30303 L496.484848,62.0606061 C496.484848,27.7854642 468.700315,0 434.424242,0 L124.121212,0 Z", id: "Path", fill: customColor }),
|
|
31
|
-
React__default.createElement("path", { d: "M465.454545,589.575758 L93.0909091,589.575758 L93.0909091,713.69697 L124.121212,713.69697 C141.258628,713.69697 155.151515,727.589236 155.151515,744.727273 L155.151515,868.848485 C155.151515,885.986521 141.258628,899.878788 124.121212,899.878788 L93.0909091,899.878788 L93.0909091,961.939394 L465.454545,961.939394 L465.454545,899.878788 L434.424242,899.878788 C417.286206,899.878788 403.393939,885.986521 403.393939,868.848485 L403.393939,744.727273 C403.393939,727.589236 417.286206,713.69697 434.424242,713.69697 L465.454545,713.69697 L465.454545,589.575758 Z", id: "Path", fillOpacity: "0.35", fill: "#000000" }),
|
|
32
|
-
React__default.createElement("path", { d: "M93.0909091,62.0606061 C93.0909091,44.9231903 106.983796,31.030303 124.121212,31.030303 L434.424242,31.030303 C451.562279,31.030303 465.454545,44.9231903 465.454545,62.0606061 L465.454545,589.575758 L93.0909091,589.575758 L93.0909091,62.0606061 Z M93.0909091,713.69697 L124.121212,713.69697 C141.258628,713.69697 155.151515,727.589236 155.151515,744.727273 L155.151515,868.848485 C155.151515,885.986521 141.258628,899.878788 124.121212,899.878788 L93.0909091,899.878788 L93.0909091,713.69697 Z M434.424242,713.69697 C417.286206,713.69697 403.393939,727.589236 403.393939,744.727273 L403.393939,868.848485 C403.393939,885.986521 417.286206,899.878788 434.424242,899.878788 L465.454545,899.878788 L465.454545,713.69697 L434.424242,713.69697 Z", id: "Shape", fill: "#FFFFFF", opacity: "0.5" }),
|
|
33
|
-
React__default.createElement("path", { d: "M93.0909091,279.272727 C113.777881,268.929396 192.387879,248.242424 279.272727,248.242424 C366.157576,248.242424 444.766642,268.929396 465.454545,279.272727 L403.393939,372.363636 C393.051539,362.021236 341.333333,341.333333 279.272727,341.333333 C217.212121,341.333333 165.494846,362.021236 155.151515,372.363636 L93.0909091,279.272727 Z M155.151515,512 L155.151515,403.393939 L93.0909091,310.30303 L93.0909091,512 L155.151515,512 Z M403.393939,512 L403.393939,403.393939 L465.454545,310.30303 L465.454545,512 L403.393939,512 Z", id: "Shape", fill: "#2A2A2A" })));
|
|
34
|
-
}
|
|
35
21
|
|
|
36
22
|
export { Icon as I };
|
package/dist/InputAvatar-cjs.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var tslib_es6 = require('./tslib.es6-cjs.js');
|
|
4
4
|
var React = require('react');
|
|
5
|
+
var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
|
|
5
6
|
var Avatar = require('./Avatar-cjs.js');
|
|
6
7
|
var InputFile = require('./InputFile-cjs.js');
|
|
7
8
|
var ProgressBar = require('./ProgressBar-cjs.js');
|
|
@@ -10,17 +11,29 @@ require('classnames');
|
|
|
10
11
|
|
|
11
12
|
var styles = {"inputAvatar":"CMahTsC0SPE-","preview":"VOVr4KEFeVk-","centered":"HzGL7-Sfok4-","overlay":"Cflv-yL6aVQ-","spinning":"aeMMyPDHQho-"};
|
|
12
13
|
|
|
14
|
+
const inputAvatarMessages = useAtlantisI18n.defineMessages({
|
|
15
|
+
changeImage: {
|
|
16
|
+
en: "Change Image",
|
|
17
|
+
es: "Cambiar imagen",
|
|
18
|
+
},
|
|
19
|
+
remove: {
|
|
20
|
+
en: "Remove",
|
|
21
|
+
es: "Eliminar",
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
13
25
|
function InputAvatar(_a) {
|
|
14
26
|
var { getUploadParams, onUploadComplete, onChange } = _a, avatarProps = tslib_es6.__rest(_a, ["getUploadParams", "onUploadComplete", "onChange"]);
|
|
15
27
|
const [progress, setProgress] = React.useState(1);
|
|
28
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(inputAvatarMessages);
|
|
16
29
|
return (React.createElement("div", { className: styles.inputAvatar },
|
|
17
30
|
React.createElement("div", { className: styles.preview },
|
|
18
31
|
React.createElement(Avatar.Avatar, Object.assign({ size: "large" }, avatarProps)),
|
|
19
32
|
progress < 1 && (React.createElement(Overlay, null,
|
|
20
33
|
React.createElement(Centered, null,
|
|
21
34
|
React.createElement(ProgressBar.ProgressBar, { size: "small", currentStep: progress * 100, totalSteps: 100 }))))),
|
|
22
|
-
React.createElement(InputFile.InputFile, { variation: "button", buttonLabel: avatarProps.imageUrl ? "
|
|
23
|
-
avatarProps.imageUrl != undefined && progress === 1 && (React.createElement(Button.Button, { label: "
|
|
35
|
+
React.createElement(InputFile.InputFile, { variation: "button", buttonLabel: avatarProps.imageUrl ? t("changeImage") : undefined, size: "small", allowedTypes: "images", getUploadParams: getUploadParams, onUploadStart: handleChange, onUploadProgress: handleUpload, onUploadComplete: handleUploadComplete }),
|
|
36
|
+
avatarProps.imageUrl != undefined && progress === 1 && (React.createElement(Button.Button, { label: t("remove"), size: "small", type: "secondary", variation: "destructive", onClick: clearAvatar }))));
|
|
24
37
|
function handleChange(newFile) {
|
|
25
38
|
onChange && onChange(newFile);
|
|
26
39
|
handleUpload(newFile);
|
package/dist/InputAvatar-es.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { _ as __rest, a as __awaiter } from './tslib.es6-es.js';
|
|
2
2
|
import React__default, { useState } from 'react';
|
|
3
|
+
import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
|
|
3
4
|
import { A as Avatar } from './Avatar-es.js';
|
|
4
5
|
import { I as InputFile } from './InputFile-es.js';
|
|
5
6
|
import { P as ProgressBar } from './ProgressBar-es.js';
|
|
@@ -8,17 +9,29 @@ import 'classnames';
|
|
|
8
9
|
|
|
9
10
|
var styles = {"inputAvatar":"CMahTsC0SPE-","preview":"VOVr4KEFeVk-","centered":"HzGL7-Sfok4-","overlay":"Cflv-yL6aVQ-","spinning":"aeMMyPDHQho-"};
|
|
10
11
|
|
|
12
|
+
const inputAvatarMessages = defineMessages({
|
|
13
|
+
changeImage: {
|
|
14
|
+
en: "Change Image",
|
|
15
|
+
es: "Cambiar imagen",
|
|
16
|
+
},
|
|
17
|
+
remove: {
|
|
18
|
+
en: "Remove",
|
|
19
|
+
es: "Eliminar",
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
11
23
|
function InputAvatar(_a) {
|
|
12
24
|
var { getUploadParams, onUploadComplete, onChange } = _a, avatarProps = __rest(_a, ["getUploadParams", "onUploadComplete", "onChange"]);
|
|
13
25
|
const [progress, setProgress] = useState(1);
|
|
26
|
+
const { t } = useAtlantisI18n(inputAvatarMessages);
|
|
14
27
|
return (React__default.createElement("div", { className: styles.inputAvatar },
|
|
15
28
|
React__default.createElement("div", { className: styles.preview },
|
|
16
29
|
React__default.createElement(Avatar, Object.assign({ size: "large" }, avatarProps)),
|
|
17
30
|
progress < 1 && (React__default.createElement(Overlay, null,
|
|
18
31
|
React__default.createElement(Centered, null,
|
|
19
32
|
React__default.createElement(ProgressBar, { size: "small", currentStep: progress * 100, totalSteps: 100 }))))),
|
|
20
|
-
React__default.createElement(InputFile, { variation: "button", buttonLabel: avatarProps.imageUrl ? "
|
|
21
|
-
avatarProps.imageUrl != undefined && progress === 1 && (React__default.createElement(Button, { label: "
|
|
33
|
+
React__default.createElement(InputFile, { variation: "button", buttonLabel: avatarProps.imageUrl ? t("changeImage") : undefined, size: "small", allowedTypes: "images", getUploadParams: getUploadParams, onUploadStart: handleChange, onUploadProgress: handleUpload, onUploadComplete: handleUploadComplete }),
|
|
34
|
+
avatarProps.imageUrl != undefined && progress === 1 && (React__default.createElement(Button, { label: t("remove"), size: "small", type: "secondary", variation: "destructive", onClick: clearAvatar }))));
|
|
22
35
|
function handleChange(newFile) {
|
|
23
36
|
onChange && onChange(newFile);
|
|
24
37
|
handleUpload(newFile);
|
package/dist/InputDate/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ require('../useAtlantisFormFieldName-cjs.js');
|
|
|
35
35
|
require('../FormFieldWrapper-cjs.js');
|
|
36
36
|
require('framer-motion');
|
|
37
37
|
require('../Text-cjs.js');
|
|
38
|
+
require('../useAtlantisI18n-cjs.js');
|
|
38
39
|
require('../useFormFieldFocus-cjs.js');
|
|
39
40
|
require('../InputValidation-cjs.js');
|
|
40
41
|
require('../FormFieldPostFix-cjs.js');
|
package/dist/InputDate/index.mjs
CHANGED
|
@@ -33,6 +33,7 @@ import '../useAtlantisFormFieldName-es.js';
|
|
|
33
33
|
import '../FormFieldWrapper-es.js';
|
|
34
34
|
import 'framer-motion';
|
|
35
35
|
import '../Text-es.js';
|
|
36
|
+
import '../useAtlantisI18n-es.js';
|
|
36
37
|
import '../useFormFieldFocus-es.js';
|
|
37
38
|
import '../InputValidation-es.js';
|
|
38
39
|
import '../FormFieldPostFix-es.js';
|
|
@@ -14,6 +14,8 @@ require('react-router-dom');
|
|
|
14
14
|
require('../Icon-cjs.js');
|
|
15
15
|
require('../Typography-cjs.js');
|
|
16
16
|
require('../Text-cjs.js');
|
|
17
|
+
require('../useAtlantisI18n-cjs.js');
|
|
18
|
+
require('../AtlantisContext-cjs.js');
|
|
17
19
|
require('../useFormFieldFocus-cjs.js');
|
|
18
20
|
require('../InputValidation-cjs.js');
|
|
19
21
|
require('../FormFieldPostFix-cjs.js');
|
|
@@ -12,6 +12,8 @@ import 'react-router-dom';
|
|
|
12
12
|
import '../Icon-es.js';
|
|
13
13
|
import '../Typography-es.js';
|
|
14
14
|
import '../Text-es.js';
|
|
15
|
+
import '../useAtlantisI18n-es.js';
|
|
16
|
+
import '../AtlantisContext-es.js';
|
|
15
17
|
import '../useFormFieldFocus-es.js';
|
|
16
18
|
import '../InputValidation-es.js';
|
|
17
19
|
import '../FormFieldPostFix-es.js';
|
|
@@ -14,6 +14,8 @@ require('react-router-dom');
|
|
|
14
14
|
require('../Icon-cjs.js');
|
|
15
15
|
require('../Typography-cjs.js');
|
|
16
16
|
require('../Text-cjs.js');
|
|
17
|
+
require('../useAtlantisI18n-cjs.js');
|
|
18
|
+
require('../AtlantisContext-cjs.js');
|
|
17
19
|
require('../useFormFieldFocus-cjs.js');
|
|
18
20
|
require('../InputValidation-cjs.js');
|
|
19
21
|
require('../FormFieldPostFix-cjs.js');
|
|
@@ -12,6 +12,8 @@ import 'react-router-dom';
|
|
|
12
12
|
import '../Icon-es.js';
|
|
13
13
|
import '../Typography-es.js';
|
|
14
14
|
import '../Text-es.js';
|
|
15
|
+
import '../useAtlantisI18n-es.js';
|
|
16
|
+
import '../AtlantisContext-es.js';
|
|
15
17
|
import '../useFormFieldFocus-es.js';
|
|
16
18
|
import '../InputValidation-es.js';
|
|
17
19
|
import '../FormFieldPostFix-es.js';
|
package/dist/InputText/index.cjs
CHANGED
|
@@ -14,6 +14,8 @@ require('react-router-dom');
|
|
|
14
14
|
require('../Icon-cjs.js');
|
|
15
15
|
require('../Typography-cjs.js');
|
|
16
16
|
require('../Text-cjs.js');
|
|
17
|
+
require('../useAtlantisI18n-cjs.js');
|
|
18
|
+
require('../AtlantisContext-cjs.js');
|
|
17
19
|
require('../useFormFieldFocus-cjs.js');
|
|
18
20
|
require('../InputValidation-cjs.js');
|
|
19
21
|
require('../FormFieldPostFix-cjs.js');
|
package/dist/InputText/index.mjs
CHANGED
|
@@ -12,6 +12,8 @@ import 'react-router-dom';
|
|
|
12
12
|
import '../Icon-es.js';
|
|
13
13
|
import '../Typography-es.js';
|
|
14
14
|
import '../Text-es.js';
|
|
15
|
+
import '../useAtlantisI18n-es.js';
|
|
16
|
+
import '../AtlantisContext-es.js';
|
|
15
17
|
import '../useFormFieldFocus-es.js';
|
|
16
18
|
import '../InputValidation-es.js';
|
|
17
19
|
import '../FormFieldPostFix-es.js';
|
package/dist/InputTime/index.cjs
CHANGED
|
@@ -17,6 +17,8 @@ require('react-router-dom');
|
|
|
17
17
|
require('../Icon-cjs.js');
|
|
18
18
|
require('../Typography-cjs.js');
|
|
19
19
|
require('../Text-cjs.js');
|
|
20
|
+
require('../useAtlantisI18n-cjs.js');
|
|
21
|
+
require('../AtlantisContext-cjs.js');
|
|
20
22
|
require('../useFormFieldFocus-cjs.js');
|
|
21
23
|
require('../InputValidation-cjs.js');
|
|
22
24
|
require('../mergeRefs-cjs.js');
|
package/dist/InputTime/index.mjs
CHANGED
|
@@ -15,6 +15,8 @@ import 'react-router-dom';
|
|
|
15
15
|
import '../Icon-es.js';
|
|
16
16
|
import '../Typography-es.js';
|
|
17
17
|
import '../Text-es.js';
|
|
18
|
+
import '../useAtlantisI18n-es.js';
|
|
19
|
+
import '../AtlantisContext-es.js';
|
|
18
20
|
import '../useFormFieldFocus-es.js';
|
|
19
21
|
import '../InputValidation-es.js';
|
|
20
22
|
import '../mergeRefs-es.js';
|
|
@@ -10,6 +10,7 @@ var floatingUi_react = require('./floating-ui.react-cjs.js');
|
|
|
10
10
|
var Text = require('./Text-cjs.js');
|
|
11
11
|
var Button = require('./Button-cjs.js');
|
|
12
12
|
var Spinner = require('./Spinner-cjs.js');
|
|
13
|
+
var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
|
|
13
14
|
var Chip = require('./Chip-cjs.js');
|
|
14
15
|
require('./tslib.es6-cjs.js');
|
|
15
16
|
|
|
@@ -21,8 +22,12 @@ function InternalChip({ label, active = false, disabled = false, invalid = false
|
|
|
21
22
|
|
|
22
23
|
var styles = {"wrapper":"XRnU90M2-fs-","input":"Dq-yFHd1zK0-","menu":"F7CpurjKzBI-","menuListOption":"_9SAK31TqNDY-","loadingIndicator":"s5vFJVv0t0Q-","activeOption":"_8d0w-JzgzS4-","spinning":"hDJGLX6kE-U-"};
|
|
23
24
|
|
|
25
|
+
function DefaultAddActivator({ ariaLabel, onClick, }) {
|
|
26
|
+
return (React.createElement(Button.Button, { icon: "add", type: "secondary", ariaLabel: ariaLabel, onClick: onClick }));
|
|
27
|
+
}
|
|
24
28
|
function InternalChipDismissibleInput(props) {
|
|
25
|
-
const {
|
|
29
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(Chip.chipsMessages);
|
|
30
|
+
const { activator, attachTo, isLoadingMore = false, onLoadMore, options, } = props;
|
|
26
31
|
const { activeIndex, allOptions, hasAvailableOptions, inputRef, menuId, menuOpen, searchValue, showInput, generateDescendantId, handleBlur, handleFocus, handleSearchChange, handleCancelBlur, handleEnableBlur, handleSetActiveOnMouseOver, handleKeyDown, handleSelectOption, handleShowInput, handleDebouncedSearch, } = useScrollToActive.useInternalChipDismissibleInput(props);
|
|
27
32
|
const scrollableRef = useScrollToActive.useScrollToActive(activeIndex);
|
|
28
33
|
const { ref: visibleChildRef, isInView } = useScrollToActive.useInView();
|
|
@@ -35,9 +40,8 @@ function InternalChipDismissibleInput(props) {
|
|
|
35
40
|
isInView && onLoadMore && onLoadMore(searchValue);
|
|
36
41
|
}, [isInView]);
|
|
37
42
|
if (!showInput) {
|
|
38
|
-
return React.cloneElement(activator, { onClick: handleShowInput });
|
|
43
|
+
return React.cloneElement(activator !== null && activator !== void 0 ? activator : React.createElement(DefaultAddActivator, { ariaLabel: t("add") }), { onClick: handleShowInput });
|
|
39
44
|
}
|
|
40
|
-
const shouldShowMenu = menuOpen && (hasAvailableOptions || isLoadingMore);
|
|
41
45
|
const menuContent = (React.createElement("div", { ref: node => {
|
|
42
46
|
setFloatingRef(node);
|
|
43
47
|
scrollableRef.current = node;
|
|
@@ -51,14 +55,14 @@ function InternalChipDismissibleInput(props) {
|
|
|
51
55
|
isLoadingMore && (React.createElement("div", { className: styles.loadingIndicator },
|
|
52
56
|
React.createElement(Spinner.Spinner, { size: "small", inline: true })))));
|
|
53
57
|
return (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": "
|
|
55
|
-
|
|
58
|
+
React.createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": t("cycleOptions"), "aria-autocomplete": "list", "aria-owns": menuId, "aria-expanded": menuOpen && (hasAvailableOptions || isLoadingMore), "aria-activedescendant": generateDescendantId(activeIndex), value: searchValue, onChange: handleSearchChange, onKeyDown: handleKeyDown, onBlur: () => setTimeout(handleBlur, 200), onFocus: handleFocus, autoFocus: true }),
|
|
59
|
+
menuOpen && (hasAvailableOptions || isLoadingMore) && (React.createElement(floatingUi_react.FloatingPortal, null, menuContent))));
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
function InternalChipDismissible(props) {
|
|
59
63
|
const { availableChipOptions, ref: wrapperRef, wrapperElement, sortedVisibleChipOptions, handleChipAdd, handleChipClick, handleChipKeyDown, handleChipRemove, handleCustomAdd, handleWrapperKeyDown, } = useScrollToActive.useInternalChipDismissible(props);
|
|
60
64
|
return (React.createElement("div", { ref: wrapperRef, className: styles.wrapper, "data-testid": "dismissible-chips", onKeyDown: handleWrapperKeyDown, role: "listbox" },
|
|
61
|
-
sortedVisibleChipOptions.map(chip => (React.createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.label}. Press delete or backspace to remove ${chip.label}`, tabIndex: 0, suffix: React.createElement(Chip.InternalChipButton, { icon: "
|
|
65
|
+
sortedVisibleChipOptions.map(chip => (React.createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.label}. Press delete or backspace to remove ${chip.label}`, tabIndex: 0, suffix: React.createElement(Chip.InternalChipButton, { icon: "cross", invalid: chip.invalid, disabled: chip.disabled, label: chip.label, onClick: handleChipRemove(chip.value) }) })))),
|
|
62
66
|
React.createElement(InternalChipDismissibleInput, { activator: props.activator, attachTo: wrapperElement, isLoadingMore: props.isLoadingMore, options: availableChipOptions, onOptionSelect: handleChipAdd, onCustomOptionSelect: handleCustomAdd, onSearch: props.onSearch, onLoadMore: props.onLoadMore, onlyShowMenuOnSearch: props.onlyShowMenuOnSearch, autoSelectOnClickOutside: props.autoSelectOnClickOutside })));
|
|
63
67
|
}
|
|
64
68
|
|
|
@@ -8,7 +8,8 @@ import { F as FloatingPortal } from './floating-ui.react-es.js';
|
|
|
8
8
|
import { T as Text } from './Text-es.js';
|
|
9
9
|
import { B as Button } from './Button-es.js';
|
|
10
10
|
import { S as Spinner } from './Spinner-es.js';
|
|
11
|
-
import {
|
|
11
|
+
import { u as useAtlantisI18n } from './useAtlantisI18n-es.js';
|
|
12
|
+
import { C as Chip, c as chipsMessages, I as InternalChipButton } from './Chip-es.js';
|
|
12
13
|
import './tslib.es6-es.js';
|
|
13
14
|
|
|
14
15
|
function InternalChip({ label, active = false, disabled = false, invalid = false, prefix, suffix, tabIndex, ariaLabel, onClick, onKeyDown, }) {
|
|
@@ -19,8 +20,12 @@ function InternalChip({ label, active = false, disabled = false, invalid = false
|
|
|
19
20
|
|
|
20
21
|
var styles = {"wrapper":"XRnU90M2-fs-","input":"Dq-yFHd1zK0-","menu":"F7CpurjKzBI-","menuListOption":"_9SAK31TqNDY-","loadingIndicator":"s5vFJVv0t0Q-","activeOption":"_8d0w-JzgzS4-","spinning":"hDJGLX6kE-U-"};
|
|
21
22
|
|
|
23
|
+
function DefaultAddActivator({ ariaLabel, onClick, }) {
|
|
24
|
+
return (React__default.createElement(Button, { icon: "add", type: "secondary", ariaLabel: ariaLabel, onClick: onClick }));
|
|
25
|
+
}
|
|
22
26
|
function InternalChipDismissibleInput(props) {
|
|
23
|
-
const {
|
|
27
|
+
const { t } = useAtlantisI18n(chipsMessages);
|
|
28
|
+
const { activator, attachTo, isLoadingMore = false, onLoadMore, options, } = props;
|
|
24
29
|
const { activeIndex, allOptions, hasAvailableOptions, inputRef, menuId, menuOpen, searchValue, showInput, generateDescendantId, handleBlur, handleFocus, handleSearchChange, handleCancelBlur, handleEnableBlur, handleSetActiveOnMouseOver, handleKeyDown, handleSelectOption, handleShowInput, handleDebouncedSearch, } = useInternalChipDismissibleInput(props);
|
|
25
30
|
const scrollableRef = useScrollToActive(activeIndex);
|
|
26
31
|
const { ref: visibleChildRef, isInView } = useInView();
|
|
@@ -33,9 +38,8 @@ function InternalChipDismissibleInput(props) {
|
|
|
33
38
|
isInView && onLoadMore && onLoadMore(searchValue);
|
|
34
39
|
}, [isInView]);
|
|
35
40
|
if (!showInput) {
|
|
36
|
-
return React__default.cloneElement(activator, { onClick: handleShowInput });
|
|
41
|
+
return React__default.cloneElement(activator !== null && activator !== void 0 ? activator : React__default.createElement(DefaultAddActivator, { ariaLabel: t("add") }), { onClick: handleShowInput });
|
|
37
42
|
}
|
|
38
|
-
const shouldShowMenu = menuOpen && (hasAvailableOptions || isLoadingMore);
|
|
39
43
|
const menuContent = (React__default.createElement("div", { ref: node => {
|
|
40
44
|
setFloatingRef(node);
|
|
41
45
|
scrollableRef.current = node;
|
|
@@ -49,14 +53,14 @@ function InternalChipDismissibleInput(props) {
|
|
|
49
53
|
isLoadingMore && (React__default.createElement("div", { className: styles.loadingIndicator },
|
|
50
54
|
React__default.createElement(Spinner, { size: "small", inline: true })))));
|
|
51
55
|
return (React__default.createElement(React__default.Fragment, null,
|
|
52
|
-
React__default.createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": "
|
|
53
|
-
|
|
56
|
+
React__default.createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": t("cycleOptions"), "aria-autocomplete": "list", "aria-owns": menuId, "aria-expanded": menuOpen && (hasAvailableOptions || isLoadingMore), "aria-activedescendant": generateDescendantId(activeIndex), value: searchValue, onChange: handleSearchChange, onKeyDown: handleKeyDown, onBlur: () => setTimeout(handleBlur, 200), onFocus: handleFocus, autoFocus: true }),
|
|
57
|
+
menuOpen && (hasAvailableOptions || isLoadingMore) && (React__default.createElement(FloatingPortal, null, menuContent))));
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
function InternalChipDismissible(props) {
|
|
57
61
|
const { availableChipOptions, ref: wrapperRef, wrapperElement, sortedVisibleChipOptions, handleChipAdd, handleChipClick, handleChipKeyDown, handleChipRemove, handleCustomAdd, handleWrapperKeyDown, } = useInternalChipDismissible(props);
|
|
58
62
|
return (React__default.createElement("div", { ref: wrapperRef, className: styles.wrapper, "data-testid": "dismissible-chips", onKeyDown: handleWrapperKeyDown, role: "listbox" },
|
|
59
|
-
sortedVisibleChipOptions.map(chip => (React__default.createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.label}. Press delete or backspace to remove ${chip.label}`, tabIndex: 0, suffix: React__default.createElement(InternalChipButton, { icon: "
|
|
63
|
+
sortedVisibleChipOptions.map(chip => (React__default.createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.label}. Press delete or backspace to remove ${chip.label}`, tabIndex: 0, suffix: React__default.createElement(InternalChipButton, { icon: "cross", invalid: chip.invalid, disabled: chip.disabled, label: chip.label, onClick: handleChipRemove(chip.value) }) })))),
|
|
60
64
|
React__default.createElement(InternalChipDismissibleInput, { activator: props.activator, attachTo: wrapperElement, isLoadingMore: props.isLoadingMore, options: availableChipOptions, onOptionSelect: handleChipAdd, onCustomOptionSelect: handleCustomAdd, onSearch: props.onSearch, onLoadMore: props.onLoadMore, onlyShowMenuOnSearch: props.onlyShowMenuOnSearch, autoSelectOnClickOutside: props.autoSelectOnClickOutside })));
|
|
61
65
|
}
|
|
62
66
|
|
|
@@ -14,6 +14,8 @@ require('react-router-dom');
|
|
|
14
14
|
require('../Icon-cjs.js');
|
|
15
15
|
require('../Typography-cjs.js');
|
|
16
16
|
require('../Text-cjs.js');
|
|
17
|
+
require('../useAtlantisI18n-cjs.js');
|
|
18
|
+
require('../AtlantisContext-cjs.js');
|
|
17
19
|
require('../useFormFieldFocus-cjs.js');
|
|
18
20
|
require('../InputValidation-cjs.js');
|
|
19
21
|
require('../FormFieldPostFix-cjs.js');
|
|
@@ -12,6 +12,8 @@ import 'react-router-dom';
|
|
|
12
12
|
import '../Icon-es.js';
|
|
13
13
|
import '../Typography-es.js';
|
|
14
14
|
import '../Text-es.js';
|
|
15
|
+
import '../useAtlantisI18n-es.js';
|
|
16
|
+
import '../AtlantisContext-es.js';
|
|
15
17
|
import '../useFormFieldFocus-es.js';
|
|
16
18
|
import '../InputValidation-es.js';
|
|
17
19
|
import '../FormFieldPostFix-es.js';
|
package/dist/Menu/index.cjs
CHANGED
|
@@ -11,6 +11,8 @@ require('../floating-ui.utils-cjs.js');
|
|
|
11
11
|
require('react/jsx-runtime');
|
|
12
12
|
require('react-dom');
|
|
13
13
|
require('../floating-ui.react-dom-cjs.js');
|
|
14
|
+
require('../useAtlantisI18n-cjs.js');
|
|
15
|
+
require('../AtlantisContext-cjs.js');
|
|
14
16
|
require('../Button-cjs.js');
|
|
15
17
|
require('../tslib.es6-cjs.js');
|
|
16
18
|
require('react-router-dom');
|
package/dist/Menu/index.mjs
CHANGED
|
@@ -9,6 +9,8 @@ import '../floating-ui.utils-es.js';
|
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import 'react-dom';
|
|
11
11
|
import '../floating-ui.react-dom-es.js';
|
|
12
|
+
import '../useAtlantisI18n-es.js';
|
|
13
|
+
import '../AtlantisContext-es.js';
|
|
12
14
|
import '../Button-es.js';
|
|
13
15
|
import '../tslib.es6-es.js';
|
|
14
16
|
import 'react-router-dom';
|