kiban-design-system 1.1.6-hotfix.0 → 1.1.7-hotfix.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/components/AlphaMultiSelectionPicker/AlphaMultiSelectionPicker.d.ts +4 -0
- package/dist/components/AlphaMultiSelectionPicker/AlphaMultiSelectionPicker.props.d.ts +14 -0
- package/dist/components/AlphaMultiSelectionPicker/components/Picker/Picker.d.ts +5 -0
- package/dist/components/{AlphaTimeSelector/components/TimePicker/TimePicker.props.d.ts → AlphaMultiSelectionPicker/components/Picker/Picker.props.d.ts} +3 -3
- package/dist/components/AlphaMultiSelectionPicker/components/Picker/components/List/List.props.d.ts +6 -0
- package/dist/components/AlphaMultiSelectionPicker/components/Picker/index.d.ts +3 -0
- package/dist/components/AlphaMultiSelectionPicker/components/index.d.ts +1 -0
- package/dist/components/AlphaMultiSelectionPicker/index.d.ts +3 -0
- package/dist/components/AlphaSegmentedControl/AlphaSegmentedControl.d.ts +5 -0
- package/dist/components/AlphaSegmentedControl/AlphaSegmentedControl.props.d.ts +14 -0
- package/dist/components/AlphaSegmentedControl/index.d.ts +3 -0
- package/dist/components/AlphaTimeSelector/TimeSelector.d.ts +1 -1
- package/dist/components/AlphaTimeSelector/TimeSelector.props.d.ts +14 -8
- package/dist/components/AlphaZipCodeInput/AlphaZipCodeInput.d.ts +5 -0
- package/dist/components/AlphaZipCodeInput/AlphaZipCodeInput.props.d.ts +17 -0
- package/dist/components/AlphaZipCodeInput/index.d.ts +3 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +288 -188
- package/dist/index.js.map +1 -1
- package/dist/utils/formatFileSize.d.ts +2 -0
- package/dist/utils/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/components/AlphaTimeSelector/components/TimePicker/TimePicker.d.ts +0 -5
- package/dist/components/AlphaTimeSelector/components/TimePicker/TimePicker.test.d.ts +0 -1
- package/dist/components/AlphaTimeSelector/components/TimePicker/components/List/List.props.d.ts +0 -6
- package/dist/components/AlphaTimeSelector/components/TimePicker/components/List/List.test.d.ts +0 -1
- package/dist/components/AlphaTimeSelector/components/TimePicker/index.d.ts +0 -3
- package/dist/components/AlphaTimeSelector/components/index.d.ts +0 -1
- /package/dist/components/{AlphaTimeSelector/TimeSelector.test.d.ts → AlphaMultiSelectionPicker/AlphaMultiSelectionPicker.test.d.ts} +0 -0
- /package/dist/components/{AlphaTimeSelector/components/TimePicker → AlphaMultiSelectionPicker/components/Picker}/components/List/List.d.ts +0 -0
- /package/dist/components/{AlphaTimeSelector/components/TimePicker → AlphaMultiSelectionPicker/components/Picker}/components/List/index.d.ts +0 -0
- /package/dist/components/{AlphaTimeSelector/components/TimePicker → AlphaMultiSelectionPicker/components/Picker}/components/index.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1032,6 +1032,19 @@ const isComponentTypeOf = (childComponent, parentComponent) => {
|
|
|
1032
1032
|
return Components.some((Component) => typeof type !== 'string' && type === Component);
|
|
1033
1033
|
};
|
|
1034
1034
|
|
|
1035
|
+
function formatFileSize(bytes) {
|
|
1036
|
+
const units = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
1037
|
+
let unitIndex = 0;
|
|
1038
|
+
let size = bytes;
|
|
1039
|
+
while (size >= 1024 && unitIndex < units.length - 1) {
|
|
1040
|
+
size /= 1024;
|
|
1041
|
+
unitIndex += 1;
|
|
1042
|
+
}
|
|
1043
|
+
return `${size.toFixed(2)} ${units[unitIndex]}`;
|
|
1044
|
+
}
|
|
1045
|
+
// eslint-disable-next-line
|
|
1046
|
+
// code end
|
|
1047
|
+
|
|
1035
1048
|
const cssClassName = (mainClass, ...classes) => {
|
|
1036
1049
|
const filteredClasses = classes
|
|
1037
1050
|
.filter(Boolean)
|
|
@@ -1061,10 +1074,10 @@ const PendingIcon = () => (jsxs("svg", Object.assign({ width: '24', height: '24'
|
|
|
1061
1074
|
|
|
1062
1075
|
const WarningIcon = () => (jsxs("svg", Object.assign({ width: '24', height: '24', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' }, { children: [jsx("path", { d: 'M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z' }, void 0), jsx("line", { x1: '12', y1: '9', x2: '12', y2: '13' }, void 0), jsx("line", { x1: '12', y1: '17', x2: '12.01', y2: '17' }, void 0)] }), void 0));
|
|
1063
1076
|
|
|
1064
|
-
const COMPONENT_NAME$
|
|
1077
|
+
const COMPONENT_NAME$B = 'AlphaAttributeInput';
|
|
1065
1078
|
const AlphaAttributeInput = ({ items, divider, label, isRequired, }) => {
|
|
1066
1079
|
const [isFocused, setIsFocused] = useState(false);
|
|
1067
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
1080
|
+
const className = cssClassName(COMPONENT_NAME$B, isFocused && 'isFocused');
|
|
1068
1081
|
const handleBlur = (callback) => {
|
|
1069
1082
|
setIsFocused(false);
|
|
1070
1083
|
if (callback) {
|
|
@@ -1083,25 +1096,25 @@ const AlphaAttributeInput = ({ items, divider, label, isRequired, }) => {
|
|
|
1083
1096
|
item.onChange(event.target.value);
|
|
1084
1097
|
}
|
|
1085
1098
|
};
|
|
1086
|
-
const itemLabelMarkup = item.label ? (jsx("label", Object.assign({ className: `${COMPONENT_NAME$
|
|
1087
|
-
const dividerMarkup = divider && index < items.length - 1 ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
1088
|
-
return (jsxs(Fragment$1, { children: [jsxs("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
1099
|
+
const itemLabelMarkup = item.label ? (jsx("label", Object.assign({ className: `${COMPONENT_NAME$B}__ItemLabelWrapper` }, { children: item.label }), void 0)) : null;
|
|
1100
|
+
const dividerMarkup = divider && index < items.length - 1 ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$B}__Divider` }, { children: divider }), void 0)) : null;
|
|
1101
|
+
return (jsxs(Fragment$1, { children: [jsxs("div", Object.assign({ className: `${COMPONENT_NAME$B}__Item` }, { children: [itemLabelMarkup, jsx("input", { type: item.type, value: item.value, onChange: handleChange, onBlur: () => handleBlur(item.onBlur), onFocus: () => handleFocus(item.onFocus), placeholder: item.placeholder, min: item.min, max: item.max, minLength: item.minLength, maxLength: item.maxLength }, void 0)] }), index), dividerMarkup] }, index));
|
|
1089
1102
|
};
|
|
1090
|
-
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
1091
|
-
const itemsMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
1103
|
+
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$B}__LabelWrapper` }, { children: jsxs("label", Object.assign({ className: `${COMPONENT_NAME$B}__Label` }, { children: [label, isRequired ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$B}__IsRequiredSign` }, { children: "*" }), void 0)) : null] }), void 0) }), void 0)) : null;
|
|
1104
|
+
const itemsMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$B}__ItemsWrapper` }, { children: items.map(renderItem) }), void 0));
|
|
1092
1105
|
return (jsxs("div", Object.assign({ className: className }, { children: [labelMarkup, itemsMarkup] }), void 0));
|
|
1093
1106
|
};
|
|
1094
1107
|
|
|
1095
|
-
const COMPONENT_NAME$
|
|
1108
|
+
const COMPONENT_NAME$A = 'AlphaBadge';
|
|
1096
1109
|
const AlphaBadge = ({ theme: themeProp, children, isSuccess, isWarning, isDanger, isPrimary, }) => {
|
|
1097
1110
|
const { theme } = useTheme();
|
|
1098
1111
|
const THEME_CLASS = `${theme}`;
|
|
1099
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
1100
|
-
const childrenMarkup = children && (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
1112
|
+
const className = cssClassName(COMPONENT_NAME$A, !themeProp && THEME_CLASS, isPrimary && 'isPrimary', isDanger && 'isDanger', isSuccess && 'isSuccess', isWarning && 'isWarning', themeProp && `${themeProp.toUpperCase()}`);
|
|
1113
|
+
const childrenMarkup = children && (jsx("span", Object.assign({ className: `${COMPONENT_NAME$A}__TextWrapper` }, { children: children }), void 0));
|
|
1101
1114
|
return jsx("span", Object.assign({ className: className }, { children: childrenMarkup }), void 0);
|
|
1102
1115
|
};
|
|
1103
1116
|
|
|
1104
|
-
const COMPONENT_NAME$
|
|
1117
|
+
const COMPONENT_NAME$z = 'AlphaIcon';
|
|
1105
1118
|
const ICON_COLOR_VARIANTS = [
|
|
1106
1119
|
'danger',
|
|
1107
1120
|
'darkGray',
|
|
@@ -1128,9 +1141,9 @@ const AlphaIcon = ({ source, size, color, filled, hasBackdrop, outlined, }) => {
|
|
|
1128
1141
|
if (color && !ICON_COLOR_VARIANTS.includes(color)) {
|
|
1129
1142
|
console.warn(`The color ${color} is not supported for the AlphaIcon component when hasBackdrop is true.`);
|
|
1130
1143
|
}
|
|
1131
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
1144
|
+
const className = cssClassName(COMPONENT_NAME$z, color && `is-${color}`, filled && 'isFilled', outlined && 'isOutlined', size && `is-${size}`, hasBackdrop && 'hasBackdrop', source && `source-${sourceType}`);
|
|
1132
1145
|
const Source = source;
|
|
1133
|
-
const StringSource = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
1146
|
+
const StringSource = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$z}__StringSource` }, { children: jsx("span", { children: source }, void 0) }), void 0));
|
|
1134
1147
|
const content = {
|
|
1135
1148
|
function: jsx(Source, {}, void 0),
|
|
1136
1149
|
string: StringSource,
|
|
@@ -1138,9 +1151,9 @@ const AlphaIcon = ({ source, size, color, filled, hasBackdrop, outlined, }) => {
|
|
|
1138
1151
|
return jsx("span", Object.assign({ className: className }, { children: content[sourceType] }), void 0);
|
|
1139
1152
|
};
|
|
1140
1153
|
|
|
1141
|
-
const COMPONENT_NAME$
|
|
1154
|
+
const COMPONENT_NAME$y = 'AlphaSpinner';
|
|
1142
1155
|
const AlphaSpinner = ({ icon, size }) => {
|
|
1143
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
1156
|
+
const className = cssClassName(COMPONENT_NAME$y);
|
|
1144
1157
|
let iconSource;
|
|
1145
1158
|
if (icon) {
|
|
1146
1159
|
if (isValidIcon(icon.icon)) {
|
|
@@ -1150,16 +1163,16 @@ const AlphaSpinner = ({ icon, size }) => {
|
|
|
1150
1163
|
iconSource = icon.icon;
|
|
1151
1164
|
}
|
|
1152
1165
|
}
|
|
1153
|
-
const iconMarkup = icon ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
1166
|
+
const iconMarkup = icon ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$y}__IconWrapper` }, { children: iconSource }), void 0)) : null;
|
|
1154
1167
|
return jsx("div", Object.assign({ className: className }, { children: iconMarkup }), void 0);
|
|
1155
1168
|
};
|
|
1156
1169
|
|
|
1157
|
-
const COMPONENT_NAME$
|
|
1170
|
+
const COMPONENT_NAME$x = 'AlphaButton';
|
|
1158
1171
|
const AlphaButton = ({ ariaLabel, children, icon, spinnerIcon, iconPosition = 'left', id, isDanger, isDisabled, isFullWidth, isLink, isLoading, isPrimary, isSubmit, isTertiary, size = 'medium', textAlign = 'center', isRounded, theme: themeProp, onClick, onFocus, onBlur, onKeyPress, onKeyUp, onKeyDown, onMouseEnter, onMouseLeave, onTouchStart, onTouchEnd, }) => {
|
|
1159
1172
|
const { theme } = useTheme();
|
|
1160
1173
|
const THEME_CLASS = `${theme}`;
|
|
1161
1174
|
const isIconOnly = !children && icon;
|
|
1162
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
1175
|
+
const className = cssClassName(COMPONENT_NAME$x, !themeProp && THEME_CLASS, isPrimary && 'isPrimary', isDanger && 'isDanger', isTertiary && 'isTertiary', isFullWidth && 'isFullWidth', isLink && 'isLink', isDisabled && 'isDisabled', isLoading && 'isLoading', size && `is-${size}`, textAlign && `has-text-${textAlign}`, icon && `has-icon-${iconPosition}`, isIconOnly && 'onlyIcon', isIconOnly && isRounded && 'isRounded', themeProp && `${themeProp.toUpperCase()}`);
|
|
1163
1176
|
const buttonProps = {
|
|
1164
1177
|
id,
|
|
1165
1178
|
type: isSubmit ? 'submit' : 'button',
|
|
@@ -1176,7 +1189,7 @@ const AlphaButton = ({ ariaLabel, children, icon, spinnerIcon, iconPosition = 'l
|
|
|
1176
1189
|
onTouchStart,
|
|
1177
1190
|
onTouchEnd,
|
|
1178
1191
|
};
|
|
1179
|
-
const childrenMarkup = children ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
1192
|
+
const childrenMarkup = children ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$x}__TextWrapper` }, { children: children }), void 0)) : null;
|
|
1180
1193
|
let iconSource;
|
|
1181
1194
|
let spinnerIconSource;
|
|
1182
1195
|
if (icon) {
|
|
@@ -1195,18 +1208,18 @@ const AlphaButton = ({ ariaLabel, children, icon, spinnerIcon, iconPosition = 'l
|
|
|
1195
1208
|
spinnerIconSource = spinnerIcon.icon;
|
|
1196
1209
|
}
|
|
1197
1210
|
}
|
|
1198
|
-
const iconMarkup = icon ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
1199
|
-
const spinnerMarkup = isLoading && (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
1211
|
+
const iconMarkup = icon ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$x}__IconWrapper` }, { children: iconSource }), void 0)) : null;
|
|
1212
|
+
const spinnerMarkup = isLoading && (jsx("span", Object.assign({ className: `${COMPONENT_NAME$x}__SpinnerWrapper` }, { children: spinnerIconSource }), void 0));
|
|
1200
1213
|
return (jsxs("button", Object.assign({ className: className }, buttonProps, { children: [spinnerMarkup, iconMarkup, childrenMarkup] }), void 0));
|
|
1201
1214
|
};
|
|
1202
1215
|
|
|
1203
|
-
const COMPONENT_NAME$
|
|
1216
|
+
const COMPONENT_NAME$w = 'AlphaChip';
|
|
1204
1217
|
const AlphaChip = ({ children, hasError, removeButtonIcon, isDisabled, theme, onRemove, }) => {
|
|
1205
1218
|
const { theme: currentTheme } = useTheme();
|
|
1206
1219
|
const THEME_CLASS = `${currentTheme}`;
|
|
1207
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
1208
|
-
const childrenMarkup = children ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
1209
|
-
const closeButtonMarkup = removeButtonIcon && (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
1220
|
+
const className = cssClassName(COMPONENT_NAME$w, hasError && 'hasError', isDisabled && 'isDisabled', theme && `${theme.toUpperCase()}`, THEME_CLASS);
|
|
1221
|
+
const childrenMarkup = children ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$w}__TextWrapper` }, { children: children }), void 0)) : null;
|
|
1222
|
+
const closeButtonMarkup = removeButtonIcon && (jsx("div", Object.assign({ className: `${COMPONENT_NAME$w}__CloseButtonWrapper` }, { children: jsx(AlphaButton, { onClick: onRemove, icon: removeButtonIcon }, void 0) }), void 0));
|
|
1210
1223
|
return (jsxs("div", Object.assign({ className: className }, { children: [childrenMarkup, closeButtonMarkup] }), void 0));
|
|
1211
1224
|
};
|
|
1212
1225
|
|
|
@@ -1406,10 +1419,10 @@ const Panel$1 = ({ id, children, isHidden }) => {
|
|
|
1406
1419
|
return (jsx("div", Object.assign({ className: className, id: id }, { children: children }), void 0));
|
|
1407
1420
|
};
|
|
1408
1421
|
|
|
1409
|
-
const COMPONENT_NAME$
|
|
1422
|
+
const COMPONENT_NAME$v = 'Tabs';
|
|
1410
1423
|
const Tabs = ({ onSelect, selected, tabs, children, className, areFitted, }) => {
|
|
1411
1424
|
const { theme } = useTheme();
|
|
1412
|
-
const classNames = cssClassName(COMPONENT_NAME$
|
|
1425
|
+
const classNames = cssClassName(COMPONENT_NAME$v, `is${themeClassConverter(theme)}`);
|
|
1413
1426
|
const panelMarkup = children
|
|
1414
1427
|
? tabs.map((tab, index) => selected === index ? (jsx(Panel$1, Object.assign({ id: tab.panelID || `${tab.id}-panel` }, { children: children }), tab.id)) : (jsx(Panel$1, { id: tab.panelID || `${tab.id}-panel`, isHidden: true }, tab.id)))
|
|
1415
1428
|
: null;
|
|
@@ -1567,10 +1580,10 @@ const getPosition = (activator, tooltip, alignment) => {
|
|
|
1567
1580
|
};
|
|
1568
1581
|
};
|
|
1569
1582
|
|
|
1570
|
-
const COMPONENT_NAME$
|
|
1583
|
+
const COMPONENT_NAME$u = 'Alpha__TooltipOverlay';
|
|
1571
1584
|
const Overlay = ({ children, activator, active, zIndexOverride, position = 'bottom', appearance = 'default', width, parentTooltip, theme, onClick, }) => {
|
|
1572
1585
|
const tooltipRef = useRef(null);
|
|
1573
|
-
const overlayClassName = cssClassName(COMPONENT_NAME$
|
|
1586
|
+
const overlayClassName = cssClassName(COMPONENT_NAME$u, position && `is-${position}`, appearance && `is-${appearance}`, theme && appearance === 'default' && `is-${theme}`);
|
|
1574
1587
|
const [positionStyles, setPositionStyles] = useState({
|
|
1575
1588
|
'--tooltip-overlay-top': 0,
|
|
1576
1589
|
'--tooltip-overlay-left': 0,
|
|
@@ -1606,7 +1619,7 @@ const Overlay = ({ children, activator, active, zIndexOverride, position = 'bott
|
|
|
1606
1619
|
return markup;
|
|
1607
1620
|
};
|
|
1608
1621
|
|
|
1609
|
-
const COMPONENT_NAME$
|
|
1622
|
+
const COMPONENT_NAME$t = 'AlphaTooltip';
|
|
1610
1623
|
const AlphaTooltip = ({ content, children, activatorWrapper = 'span', isActive: isActiveProp = false, onClose, onOpen, position, width, parentTooltip, zIndexOverride, appearance, persistence, theme, }) => {
|
|
1611
1624
|
const [activatorNode, setActivatorNode] = useState(null);
|
|
1612
1625
|
const [isActive, setIsActive] = useState(isActiveProp);
|
|
@@ -1614,7 +1627,7 @@ const AlphaTooltip = ({ content, children, activatorWrapper = 'span', isActive:
|
|
|
1614
1627
|
const isMouseOver = useRef(false);
|
|
1615
1628
|
const activatorContainer = useRef(null);
|
|
1616
1629
|
const WrapperComponent = activatorWrapper;
|
|
1617
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
1630
|
+
const className = cssClassName(COMPONENT_NAME$t);
|
|
1618
1631
|
const handleOpen = useCallback(() => {
|
|
1619
1632
|
if (!isActivePersistence) {
|
|
1620
1633
|
setIsActive(true);
|
|
@@ -2193,10 +2206,10 @@ const Popover$1 = ({ activator, children, isActive, onClose, isFullWidth = false
|
|
|
2193
2206
|
};
|
|
2194
2207
|
Popover$1.Pane = Pane$1;
|
|
2195
2208
|
|
|
2196
|
-
const COMPONENT_NAME$
|
|
2209
|
+
const COMPONENT_NAME$s = 'Divider';
|
|
2197
2210
|
const Divider = ({ alignment = 'left', label }) => {
|
|
2198
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
2199
|
-
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
2211
|
+
const className = cssClassName(COMPONENT_NAME$s, alignment, !label && 'no-label');
|
|
2212
|
+
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$s}__LabelWrapper` }, { children: jsx("span", Object.assign({ className: `${COMPONENT_NAME$s}__Label` }, { children: label }), void 0) }), void 0)) : null;
|
|
2200
2213
|
return jsx("div", Object.assign({ className: className }, { children: labelMarkup }), void 0);
|
|
2201
2214
|
};
|
|
2202
2215
|
|
|
@@ -9690,7 +9703,7 @@ function formatDate(date, toISO) {
|
|
|
9690
9703
|
return DateTime.fromJSDate(date).toFormat('dd/MM/yyyy');
|
|
9691
9704
|
}
|
|
9692
9705
|
|
|
9693
|
-
const COMPONENT_NAME$
|
|
9706
|
+
const COMPONENT_NAME$r = 'DateInput';
|
|
9694
9707
|
const AlphaInputDate = ({ ariaLabel, disabled, label, onChange, value, isRequired, placeholder, onBlur, errorMessage, months, weekdays, }) => {
|
|
9695
9708
|
const [isPopoverActive, setIsPopoverActive] = useState(false);
|
|
9696
9709
|
const [{ month, year }, setDate] = useState({
|
|
@@ -9701,7 +9714,7 @@ const AlphaInputDate = ({ ariaLabel, disabled, label, onChange, value, isRequire
|
|
|
9701
9714
|
const [isErrorTooltipActive, setIsErrorTooltipActive] = useState(false);
|
|
9702
9715
|
const [selectedDate, setSelectedDate] = useState();
|
|
9703
9716
|
const inputRef = useRef(null);
|
|
9704
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
9717
|
+
const className = cssClassName(COMPONENT_NAME$r);
|
|
9705
9718
|
const handleMonthChange = (monthValue, yearValue) => {
|
|
9706
9719
|
setDate({ month: monthValue, year: yearValue });
|
|
9707
9720
|
};
|
|
@@ -9823,7 +9836,7 @@ const AlphaInputDate = ({ ariaLabel, disabled, label, onChange, value, isRequire
|
|
|
9823
9836
|
}
|
|
9824
9837
|
}, [selectedDate]);
|
|
9825
9838
|
const datePickerMarkup = (jsx(DatePicker, { weekStartsOn: 1, month: month, year: year, onMonthChange: handleMonthChange, onChange: handleDateChange, selected: selectedDate || undefined, months: months, weekDays: weekdays }, void 0));
|
|
9826
|
-
const inputMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
9839
|
+
const inputMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$r}__InputWrapper`, onClick: () => setIsPopoverActive(true), ref: inputRef }, { children: jsx(AlphaTooltip, Object.assign({ persistence: true, isActive: isErrorTooltipActive, content: errorMessage, appearance: 'error' }, { children: jsx(InputText, { ariaLabel: ariaLabel, disabled: disabled, label: label, onChange: handleInputChange, value: inputValue, maxLength: 10, placeholder: placeholder, onBlur: handleInputBlur, icon: 'Calendar', isRequired: isRequired }, void 0) }), void 0) }), void 0));
|
|
9827
9840
|
const popoverMarkup = (jsx(Popover$1, Object.assign({ activator: inputMarkup, isActive: isPopoverActive, isFullWidth: true, onClose: () => setIsPopoverActive(false) }, { children: datePickerMarkup }), void 0));
|
|
9828
9841
|
return jsx("div", Object.assign({ className: className }, { children: popoverMarkup }), void 0);
|
|
9829
9842
|
};
|
|
@@ -9913,9 +9926,9 @@ const AlphaFilterControl = ({ primaryAction, secondaryActions, sections, title,
|
|
|
9913
9926
|
return (jsxs("div", Object.assign({ className: `${MAIN_CLASS$k}` }, { children: [headerMarkup, bodyMarkup, actionsMarkup] }), void 0));
|
|
9914
9927
|
};
|
|
9915
9928
|
|
|
9916
|
-
const COMPONENT_NAME$
|
|
9929
|
+
const COMPONENT_NAME$q = 'AlphaInlineError';
|
|
9917
9930
|
const AlphaInlineError = ({ icon, children }) => {
|
|
9918
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
9931
|
+
const className = cssClassName(COMPONENT_NAME$q);
|
|
9919
9932
|
let iconSource;
|
|
9920
9933
|
if (icon) {
|
|
9921
9934
|
if (isValidIcon(icon.icon)) {
|
|
@@ -9925,23 +9938,23 @@ const AlphaInlineError = ({ icon, children }) => {
|
|
|
9925
9938
|
iconSource = icon.icon;
|
|
9926
9939
|
}
|
|
9927
9940
|
}
|
|
9928
|
-
const iconMarkup = icon ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
9929
|
-
const messageMarkup = children ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
9941
|
+
const iconMarkup = icon ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$q}__IconWrapper` }, { children: iconSource }), void 0)) : null;
|
|
9942
|
+
const messageMarkup = children ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$q}__MessageWrapper` }, { children: children }), void 0)) : null;
|
|
9930
9943
|
return (jsxs("div", Object.assign({ className: className }, { children: [iconMarkup, messageMarkup] }), void 0));
|
|
9931
9944
|
};
|
|
9932
9945
|
|
|
9933
|
-
const COMPONENT_NAME$
|
|
9934
|
-
const className$1 = cssClassName(COMPONENT_NAME$
|
|
9946
|
+
const COMPONENT_NAME$p = 'AlphaLabel';
|
|
9947
|
+
const className$1 = cssClassName(COMPONENT_NAME$p);
|
|
9935
9948
|
const AlphaLabel = ({ children, isRequired, action, id }) => {
|
|
9936
|
-
const requiredSignMarkup = isRequired ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
9949
|
+
const requiredSignMarkup = isRequired ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$p}__RequiredSign` }, { children: "*" }), void 0)) : null;
|
|
9937
9950
|
const labelMarkup = (jsxs("label", Object.assign({ htmlFor: id }, { children: [children, requiredSignMarkup] }), void 0));
|
|
9938
|
-
const actionMarkup = action ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
9951
|
+
const actionMarkup = action ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$p}__ActionWrapper` }, { children: jsx(AlphaButton, Object.assign({ id: action.id, isDanger: action.isDanger, onMouseEnter: action.onMouseEnter, onTouchStart: action.onTouchStart, isLink: true, onClick: action.onClick, isDisabled: action.isDisabled }, { children: action.content }), void 0) }), void 0)) : null;
|
|
9939
9952
|
return (jsxs("div", Object.assign({ className: className$1 }, { children: [labelMarkup, actionMarkup] }), void 0));
|
|
9940
9953
|
};
|
|
9941
9954
|
|
|
9942
|
-
const COMPONENT_NAME$
|
|
9955
|
+
const COMPONENT_NAME$o = 'AlphaLabelledField__HelpText';
|
|
9943
9956
|
const HelpText = ({ message, icon }) => {
|
|
9944
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
9957
|
+
const className = cssClassName(COMPONENT_NAME$o);
|
|
9945
9958
|
let iconSource;
|
|
9946
9959
|
if (icon) {
|
|
9947
9960
|
if (isValidIcon(icon.icon)) {
|
|
@@ -9951,24 +9964,24 @@ const HelpText = ({ message, icon }) => {
|
|
|
9951
9964
|
iconSource = icon.icon;
|
|
9952
9965
|
}
|
|
9953
9966
|
}
|
|
9954
|
-
const iconMarkup = iconSource ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
9955
|
-
const messageMarkup = message ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
9967
|
+
const iconMarkup = iconSource ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$o}__IconWrapper` }, { children: iconSource }), void 0)) : null;
|
|
9968
|
+
const messageMarkup = message ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$o}__MessageWrapper` }, { children: message }), void 0)) : null;
|
|
9956
9969
|
return (jsxs("div", Object.assign({ className: className }, { children: [iconMarkup, messageMarkup] }), void 0));
|
|
9957
9970
|
};
|
|
9958
9971
|
|
|
9959
|
-
const COMPONENT_NAME$
|
|
9972
|
+
const COMPONENT_NAME$n = 'AlphaLabelledField';
|
|
9960
9973
|
const AlphaLabelledField = ({ label, children, action, error, helpText, id, isRequired, }) => {
|
|
9961
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
9962
|
-
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
9963
|
-
const errorMarkup = error ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
9974
|
+
const className = cssClassName(COMPONENT_NAME$n);
|
|
9975
|
+
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$n}__LabelWrapper` }, { children: jsx(AlphaLabel, Object.assign({ action: action, id: id, isRequired: isRequired }, { children: label }), void 0) }), void 0)) : null;
|
|
9976
|
+
const errorMarkup = error ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$n}__ErrorWrapper` }, { children: jsx(AlphaInlineError, Object.assign({ icon: error.icon }, { children: error.message }), void 0) }), void 0)) : null;
|
|
9964
9977
|
const helpTextMarkup = helpText ? (jsx(HelpText, { message: helpText.message, icon: helpText.icon }, void 0)) : null;
|
|
9965
|
-
const contentMarkup = errorMarkup ? (jsx(AlphaTooltip, Object.assign({ persistence: true, content: errorMarkup, isActive: Boolean(errorMarkup), appearance: 'error' }, { children: jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
9978
|
+
const contentMarkup = errorMarkup ? (jsx(AlphaTooltip, Object.assign({ persistence: true, content: errorMarkup, isActive: Boolean(errorMarkup), appearance: 'error' }, { children: jsx("div", Object.assign({ className: `${COMPONENT_NAME$n}__ContentWrapper` }, { children: children }), void 0) }), void 0)) : (children);
|
|
9966
9979
|
return (jsxs("div", Object.assign({ className: className }, { children: [labelMarkup, contentMarkup, helpTextMarkup] }), void 0));
|
|
9967
9980
|
};
|
|
9968
9981
|
|
|
9969
|
-
const COMPONENT_NAME$
|
|
9982
|
+
const COMPONENT_NAME$m = 'AlphaInputText';
|
|
9970
9983
|
const AlphaInputText = ({ isDisabled, label }) => {
|
|
9971
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
9984
|
+
const className = cssClassName(COMPONENT_NAME$m, isDisabled && 'isDisabled');
|
|
9972
9985
|
return (jsx(AlphaLabelledField, Object.assign({ label: label }, { children: jsx("div", { className: className }, void 0) }), void 0));
|
|
9973
9986
|
};
|
|
9974
9987
|
|
|
@@ -9976,14 +9989,14 @@ const StepDefault = {
|
|
|
9976
9989
|
status: 'incomplete',
|
|
9977
9990
|
};
|
|
9978
9991
|
|
|
9979
|
-
const COMPONENT_NAME$
|
|
9992
|
+
const COMPONENT_NAME$l = 'AlphaStepper__Step';
|
|
9980
9993
|
const Step = ({ iconMarkup, label, isComplete, isInactive, isSuccess, isLastStepComplete, isLastStepInactive, }) => {
|
|
9981
9994
|
const { theme } = useTheme();
|
|
9982
|
-
const itemClassName = cssClassName(`${COMPONENT_NAME$
|
|
9983
|
-
return (jsxs("div", Object.assign({ className: COMPONENT_NAME$
|
|
9995
|
+
const itemClassName = cssClassName(`${COMPONENT_NAME$l}__Item`, isComplete && `is-${theme}-light-after`, isInactive && 'is-inactive-light-after', isSuccess && 'is-success-light-after', isSuccess && 'is-success-light-before', isLastStepComplete && `is-${theme}-light-before`, isLastStepInactive && 'is-inactive-light-before');
|
|
9996
|
+
return (jsxs("div", Object.assign({ className: COMPONENT_NAME$l }, { children: [jsx("div", Object.assign({ className: itemClassName }, { children: iconMarkup }), void 0), jsx("div", Object.assign({ className: `${COMPONENT_NAME$l}__Label` }, { children: label }), void 0)] }), void 0));
|
|
9984
9997
|
};
|
|
9985
9998
|
|
|
9986
|
-
const COMPONENT_NAME$
|
|
9999
|
+
const COMPONENT_NAME$k = 'AlphaStepper';
|
|
9987
10000
|
const getSourceIcon = (icon) => {
|
|
9988
10001
|
if (icon) {
|
|
9989
10002
|
if (isValidIcon(icon.icon)) {
|
|
@@ -9998,7 +10011,7 @@ const AlphaStepper = ({ isSuccess, steps = [], completeIcon, incompleteIcon, err
|
|
|
9998
10011
|
const { theme } = useTheme();
|
|
9999
10012
|
const renderStep = (step = Object.assign({}, StepDefault), index) => {
|
|
10000
10013
|
const lastStepStatus = steps[index - 1] ? steps[index - 1].status : '';
|
|
10001
|
-
const iconClassName = cssClassName(`${COMPONENT_NAME$
|
|
10014
|
+
const iconClassName = cssClassName(`${COMPONENT_NAME$k}__IconWrapper`, (step.status === 'complete' || step.status === 'active') && `is-${theme}`, step.status !== 'complete' && `is-inactive`, step.hasError && errorIcon && 'is-danger', isSuccess && `is-success`);
|
|
10002
10015
|
let iconSource = getSourceIcon(incompleteIcon);
|
|
10003
10016
|
if (step.hasError && errorIcon)
|
|
10004
10017
|
iconSource = getSourceIcon(errorIcon);
|
|
@@ -10009,16 +10022,16 @@ const AlphaStepper = ({ isSuccess, steps = [], completeIcon, incompleteIcon, err
|
|
|
10009
10022
|
const isInactive = step.status === 'incomplete' || step.status === 'active';
|
|
10010
10023
|
const isLastStepComplete = lastStepStatus === 'complete';
|
|
10011
10024
|
const isLastStepInactive = lastStepStatus === 'incomplete' || lastStepStatus === 'active';
|
|
10012
|
-
return (jsx(Step, { iconMarkup: iconMarkup, label: step.label, isComplete: isComplete, isInactive: isInactive, isSuccess: isSuccess, isLastStepComplete: isLastStepComplete, isLastStepInactive: isLastStepInactive }, `${COMPONENT_NAME$
|
|
10025
|
+
return (jsx(Step, { iconMarkup: iconMarkup, label: step.label, isComplete: isComplete, isInactive: isInactive, isSuccess: isSuccess, isLastStepComplete: isLastStepComplete, isLastStepInactive: isLastStepInactive }, `${COMPONENT_NAME$k}-${index}`));
|
|
10013
10026
|
};
|
|
10014
10027
|
const stepsMarkup = steps ? steps.map(renderStep) : null;
|
|
10015
|
-
return jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
10028
|
+
return jsx("div", Object.assign({ className: `${COMPONENT_NAME$k}__Container` }, { children: stepsMarkup }), void 0);
|
|
10016
10029
|
};
|
|
10017
10030
|
|
|
10018
|
-
const COMPONENT_NAME$
|
|
10031
|
+
const COMPONENT_NAME$j = 'AlphaTag';
|
|
10019
10032
|
const AlphaTag = ({ color, children }) => {
|
|
10020
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
10021
|
-
const childrenMarkup = (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
10033
|
+
const className = cssClassName(COMPONENT_NAME$j, color && `is-${color.color}-${color.intensity}`);
|
|
10034
|
+
const childrenMarkup = (jsx("span", Object.assign({ className: `${COMPONENT_NAME$j}__TextWrapper` }, { children: children }), void 0));
|
|
10022
10035
|
return jsx("div", Object.assign({ className: className }, { children: childrenMarkup }), void 0);
|
|
10023
10036
|
};
|
|
10024
10037
|
|
|
@@ -10029,11 +10042,11 @@ const StatusIcon = {
|
|
|
10029
10042
|
Warning: WarningIcon,
|
|
10030
10043
|
};
|
|
10031
10044
|
|
|
10032
|
-
const COMPONENT_NAME$
|
|
10045
|
+
const COMPONENT_NAME$i = 'AlphaTile';
|
|
10033
10046
|
const AlphaTile = ({ isSelected, icon, status, theme: themeProp, title, onClick, }) => {
|
|
10034
10047
|
const { theme } = useTheme();
|
|
10035
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
10036
|
-
const statusWrapperClassName = cssClassName(`${COMPONENT_NAME$
|
|
10048
|
+
const className = cssClassName(COMPONENT_NAME$i, `is${themeClassConverter(themeProp || theme)}`, isSelected && 'isSelected');
|
|
10049
|
+
const statusWrapperClassName = cssClassName(`${COMPONENT_NAME$i}--StatusWrapper`, status && `is${status}`);
|
|
10037
10050
|
let iconSource;
|
|
10038
10051
|
if (icon) {
|
|
10039
10052
|
if (isValidIcon(icon.icon)) {
|
|
@@ -10043,10 +10056,10 @@ const AlphaTile = ({ isSelected, icon, status, theme: themeProp, title, onClick,
|
|
|
10043
10056
|
iconSource = icon.icon;
|
|
10044
10057
|
}
|
|
10045
10058
|
}
|
|
10046
|
-
const iconWrapper = icon ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
10047
|
-
const mediaMarkup = icon ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
10048
|
-
const titleWrapper = title ? (jsx("div", { children: jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
10049
|
-
const HeaderWrapper = (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
10059
|
+
const iconWrapper = icon ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$i}__IconWrapper` }, { children: iconSource }), void 0)) : null;
|
|
10060
|
+
const mediaMarkup = icon ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$i}__MediaWrapper` }, { children: iconWrapper }), void 0)) : null;
|
|
10061
|
+
const titleWrapper = title ? (jsx("div", { children: jsx("div", Object.assign({ className: `${COMPONENT_NAME$i}__TitleWrapper` }, { children: title }), void 0) }, void 0)) : null;
|
|
10062
|
+
const HeaderWrapper = (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$i}__HeaderWrapper` }, { children: [mediaMarkup, titleWrapper] }), void 0));
|
|
10050
10063
|
const statusIcon = status ? StatusIcon[status] : '';
|
|
10051
10064
|
const statusWrapper = status ? (jsx("div", Object.assign({ className: statusWrapperClassName }, { children: jsx(AlphaIcon, { source: statusIcon, size: 'medium', outlined: true }, void 0) }), void 0)) : null;
|
|
10052
10065
|
return (jsxs("div", Object.assign({ className: className, onClick: onClick }, { children: [HeaderWrapper, statusWrapper] }), void 0));
|
|
@@ -16689,9 +16702,9 @@ function getRangeDate(range, date) {
|
|
|
16689
16702
|
};
|
|
16690
16703
|
}
|
|
16691
16704
|
|
|
16692
|
-
const COMPONENT_NAME$
|
|
16705
|
+
const COMPONENT_NAME$h = 'DatePicker__Day';
|
|
16693
16706
|
const Day = memo(function Day({ day, isDisabled, isFirstSelectedDay, isLastSelectedDay, isInRange, isSelected, onClick, theme: themeProp, }) {
|
|
16694
|
-
const emptyDayClassName = cssClassName(COMPONENT_NAME$
|
|
16707
|
+
const emptyDayClassName = cssClassName(COMPONENT_NAME$h, !day && 'isEmpty');
|
|
16695
16708
|
if (!day) {
|
|
16696
16709
|
return jsx("td", { className: emptyDayClassName }, void 0);
|
|
16697
16710
|
}
|
|
@@ -16702,14 +16715,14 @@ const Day = memo(function Day({ day, isDisabled, isFirstSelectedDay, isLastSelec
|
|
|
16702
16715
|
}
|
|
16703
16716
|
};
|
|
16704
16717
|
const today = isToday(new Date(), day);
|
|
16705
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
16718
|
+
const className = cssClassName(COMPONENT_NAME$h, today && 'isToday', `theme-${themeProp || theme}`, isSelected && 'isSelected', isDisabled && 'isDisabled', isInRange && 'isInRange', isFirstSelectedDay && 'isFirstSelectedDay', isLastSelectedDay && 'isLastSelectedDay');
|
|
16706
16719
|
const date = day.getDate();
|
|
16707
16720
|
return (jsx("td", Object.assign({ className: className }, { children: jsx("button", Object.assign({ onClick: handleClick }, { children: date }), void 0) }), void 0));
|
|
16708
16721
|
});
|
|
16709
16722
|
|
|
16710
|
-
const COMPONENT_NAME$
|
|
16723
|
+
const COMPONENT_NAME$g = 'DatePicker__Month';
|
|
16711
16724
|
const Month = ({ month = new Date().getMonth(), year = new Date().getFullYear(), allowRange, disableAfterDate, disableBeforeDate, onChange, selected, weekStartsOn = 0, disableDates, weekDays, }) => {
|
|
16712
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
16725
|
+
const className = cssClassName(COMPONENT_NAME$g);
|
|
16713
16726
|
const weeks = useMemo(() => getWeeksByMonth(month, year, weekStartsOn), [month, year, weekStartsOn]);
|
|
16714
16727
|
const handleDateClick = useCallback((selectedDate) => {
|
|
16715
16728
|
if (onChange) {
|
|
@@ -16734,9 +16747,9 @@ const Month = ({ month = new Date().getMonth(), year = new Date().getFullYear(),
|
|
|
16734
16747
|
return jsx("div", Object.assign({ className: className }, { children: calendarGridMarkup }), void 0);
|
|
16735
16748
|
};
|
|
16736
16749
|
|
|
16737
|
-
const COMPONENT_NAME$
|
|
16750
|
+
const COMPONENT_NAME$f = 'DatePIcker__YearField';
|
|
16738
16751
|
const YearField = ({ onChange, value, min, max, onBlur, onFocus, onKeyDown, onKeyUp, }) => {
|
|
16739
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
16752
|
+
const className = cssClassName(COMPONENT_NAME$f);
|
|
16740
16753
|
const handleChange = (event) => {
|
|
16741
16754
|
if (onChange) {
|
|
16742
16755
|
const value = event.target.value.trim();
|
|
@@ -16780,10 +16793,10 @@ const IconButton = (_a) => {
|
|
|
16780
16793
|
return (jsx("button", Object.assign({ className: className, onClick: onClick, onBlur: onBlur, onFocus: onFocus }, rest, { children: icon && jsx(Icon, { name: icon }, void 0) }), void 0));
|
|
16781
16794
|
};
|
|
16782
16795
|
|
|
16783
|
-
const COMPONENT_NAME$
|
|
16796
|
+
const COMPONENT_NAME$e = 'DatePicker__Header';
|
|
16784
16797
|
const Header$2 = ({ month, year, onChange, months }) => {
|
|
16785
16798
|
const [yearValue, setYearValue] = useState(year);
|
|
16786
|
-
const headerClassName = cssClassName(COMPONENT_NAME$
|
|
16799
|
+
const headerClassName = cssClassName(COMPONENT_NAME$e);
|
|
16787
16800
|
const handleMonthChange = useCallback((month, year) => {
|
|
16788
16801
|
if (onChange) {
|
|
16789
16802
|
onChange(month, year);
|
|
@@ -16813,10 +16826,10 @@ const Header$2 = ({ month, year, onChange, months }) => {
|
|
|
16813
16826
|
const previousYear = getPreviousYear(month, year);
|
|
16814
16827
|
const nextMonth = getNextMonth(month);
|
|
16815
16828
|
const nextYear = getNextYear(month, year);
|
|
16816
|
-
return (jsxs("div", Object.assign({ className: headerClassName }, { children: [jsx(IconButton, { icon: 'ArrowLeft', size: 'small', appearance: 'secondary', onClick: () => handleMonthChange(previousMonth, previousYear) }, void 0), jsxs("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
16829
|
+
return (jsxs("div", Object.assign({ className: headerClassName }, { children: [jsx(IconButton, { icon: 'ArrowLeft', size: 'small', appearance: 'secondary', onClick: () => handleMonthChange(previousMonth, previousYear) }, void 0), jsxs("span", Object.assign({ className: `${COMPONENT_NAME$e}__DateLabel` }, { children: [montName, jsx(YearField, { value: yearValue, onChange: setYearValue, onBlur: handleYearBlur, min: MINIMUM_SELECTABLE_YEAR }, void 0)] }), void 0), jsx(IconButton, { icon: 'ArrowRight', size: 'small', appearance: 'secondary', onClick: () => handleMonthChange(nextMonth, nextYear) }, void 0)] }), void 0));
|
|
16817
16830
|
};
|
|
16818
16831
|
|
|
16819
|
-
const COMPONENT_NAME$
|
|
16832
|
+
const COMPONENT_NAME$d = 'DatePicker';
|
|
16820
16833
|
function getMonthSelectedDate(selected) {
|
|
16821
16834
|
return selected instanceof Date
|
|
16822
16835
|
? {
|
|
@@ -16826,7 +16839,7 @@ function getMonthSelectedDate(selected) {
|
|
|
16826
16839
|
: selected;
|
|
16827
16840
|
}
|
|
16828
16841
|
const DatePicker = ({ allowRange, disableAfterDate, disableBeforeDate, id, month = new Date().getMonth(), year = new Date().getFullYear(), onChange, selected, onMonthChange, weekStartsOn, disableDates, months, weekDays, }) => {
|
|
16829
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
16842
|
+
const className = cssClassName(COMPONENT_NAME$d);
|
|
16830
16843
|
const handleDateChange = useCallback((dateRange) => {
|
|
16831
16844
|
if (onChange) {
|
|
16832
16845
|
onChange(dateRange);
|
|
@@ -16841,19 +16854,19 @@ const TrashIcon = () => (jsxs("svg", Object.assign({ width: '24', height: '24',
|
|
|
16841
16854
|
// eslint-disable-next-line max-len
|
|
16842
16855
|
d: 'M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' }, void 0), jsx("path", { d: 'M10 11V17', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' }, void 0), jsx("path", { d: 'M14 11V17', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' }, void 0)] }), void 0));
|
|
16843
16856
|
|
|
16844
|
-
const COMPONENT_NAME$
|
|
16857
|
+
const COMPONENT_NAME$c = 'DeletableSection';
|
|
16845
16858
|
const DeletableSection = ({ ariaLabel, children, onDelete, iconDeletable, isDeletable, }) => {
|
|
16846
16859
|
const { theme } = useTheme();
|
|
16847
16860
|
const THEME_CLASS = `${theme}`;
|
|
16848
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
16849
|
-
const classNameButton = cssClassName(`${COMPONENT_NAME$
|
|
16861
|
+
const className = cssClassName(COMPONENT_NAME$c);
|
|
16862
|
+
const classNameButton = cssClassName(`${COMPONENT_NAME$c}__DeleteButtonWrapper`, THEME_CLASS);
|
|
16850
16863
|
const icon = iconDeletable || TrashIcon;
|
|
16851
|
-
const deleteButtonMarkup = onDelete && isDeletable ? (jsx("div", Object.assign({ className: classNameButton }, { children: jsx("button", Object.assign({ "aria-label": ariaLabel ? `${ariaLabel}-removeForm` : ariaLabel, className: `${COMPONENT_NAME$
|
|
16852
|
-
const contentMarkup = children ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
16864
|
+
const deleteButtonMarkup = onDelete && isDeletable ? (jsx("div", Object.assign({ className: classNameButton }, { children: jsx("button", Object.assign({ "aria-label": ariaLabel ? `${ariaLabel}-removeForm` : ariaLabel, className: `${COMPONENT_NAME$c}__DeleteButton`, onClick: onDelete }, { children: jsx(AlphaIcon, { source: icon, outlined: true }, void 0) }), void 0) }), void 0)) : null;
|
|
16865
|
+
const contentMarkup = children ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$c}__ContentWrapper` }, { children: children }), void 0)) : null;
|
|
16853
16866
|
return (jsxs("div", Object.assign({ className: className }, { children: [deleteButtonMarkup, contentMarkup] }), void 0));
|
|
16854
16867
|
};
|
|
16855
16868
|
|
|
16856
|
-
const COMPONENT_NAME$
|
|
16869
|
+
const COMPONENT_NAME$b = 'AlphaInputTag';
|
|
16857
16870
|
const InputTag$1 = ({ ariaLabel, id, inputTextPlaceholder, inputTextValue, isRequired, label, onChange, onInputTextChange, addedTags = [], triggerKeys = ['Enter'], onBlur, onFocus, isDisabled, hasError, tagRemoveIcon, helpText, }) => {
|
|
16858
16871
|
const [isFocused, setIsFocused] = useState(false);
|
|
16859
16872
|
const inputRef = useRef(null);
|
|
@@ -16896,10 +16909,10 @@ const InputTag$1 = ({ ariaLabel, id, inputTextPlaceholder, inputTextValue, isReq
|
|
|
16896
16909
|
}
|
|
16897
16910
|
};
|
|
16898
16911
|
const renderTag = (tag, index) => {
|
|
16899
|
-
return (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
16912
|
+
return (jsx("div", Object.assign({ className: `${COMPONENT_NAME$b}__TagWrapper` }, { children: jsx(AlphaChip, Object.assign({ removeButtonIcon: tagRemoveIcon, onRemove: () => handleRemoveTag(index) }, { children: tag }), void 0) }), index));
|
|
16900
16913
|
};
|
|
16901
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
16902
|
-
const inputWrapperClassName = cssClassName(`${COMPONENT_NAME$
|
|
16914
|
+
const className = cssClassName(COMPONENT_NAME$b);
|
|
16915
|
+
const inputWrapperClassName = cssClassName(`${COMPONENT_NAME$b}__InputWrapper`, isFocused && 'isFocused', isDisabled && 'isDisabled', hasError && 'hasError');
|
|
16903
16916
|
const handleInputChange = (event) => {
|
|
16904
16917
|
if (onInputTextChange) {
|
|
16905
16918
|
onInputTextChange(event.target.value);
|
|
@@ -23633,7 +23646,7 @@ var pako = {
|
|
|
23633
23646
|
* @returns {symbol} - Element FileItem
|
|
23634
23647
|
* @param {string} InputTextProps.ariaLabel - Label to use in automatic tests
|
|
23635
23648
|
*/
|
|
23636
|
-
const FileItem = ({ ariaLabel, name, addon, onDelete, size = 0, }) => (jsxs("div", Object.assign({ className: 'File' }, { children: [jsxs("div", Object.assign({ className: 'File__content__left' }, { children: [jsx(Icon, { name: 'Paperclip' }, void 0), jsx("p", Object.assign({ className: ' File__content__nameFile' }, { children: name }), void 0)] }), void 0), jsxs("div", Object.assign({ className: 'File__content__right' }, { children: [jsxs("button", Object.assign({ "aria-label": `${ariaLabel}-delete`, className: 'ButtonDeleteFile', onClick: onDelete }, { children: [jsx(Fragment, { children: addon }, void 0), jsx(Icon, { name: 'Close' }, void 0)] }), void 0),
|
|
23649
|
+
const FileItem = ({ ariaLabel, name, addon, onDelete, size = 0, }) => (jsxs("div", Object.assign({ className: 'File' }, { children: [jsxs("div", Object.assign({ className: 'File__content__left' }, { children: [jsx(Icon, { name: 'Paperclip' }, void 0), jsx("p", Object.assign({ className: ' File__content__nameFile' }, { children: name }), void 0)] }), void 0), jsxs("div", Object.assign({ className: 'File__content__right' }, { children: [jsxs("button", Object.assign({ "aria-label": `${ariaLabel}-delete`, className: 'ButtonDeleteFile', onClick: onDelete }, { children: [jsx(Fragment, { children: addon }, void 0), jsx(Icon, { name: 'Close' }, void 0)] }), void 0), jsx("p", Object.assign({ className: 'File__content__fileSize' }, { children: formatFileSize(size) }), void 0)] }), void 0)] }), void 0));
|
|
23637
23650
|
|
|
23638
23651
|
/**
|
|
23639
23652
|
* FileDrop is a component to upload files in any project
|
|
@@ -24578,7 +24591,7 @@ const SectionForm = ({ ariaLabel, data, fields, fieldsSection, iconDeletable, ic
|
|
|
24578
24591
|
return (jsx(DeletableSection, Object.assign({ ariaLabel: ariaLabel, onDelete: onDelete, iconDeletable: iconDeletable, isDeletable: isDeletable }, { children: gridMarkup }), void 0));
|
|
24579
24592
|
};
|
|
24580
24593
|
|
|
24581
|
-
const COMPONENT_NAME$
|
|
24594
|
+
const COMPONENT_NAME$a = 'DynamicForm';
|
|
24582
24595
|
const DynamicForm = ({ ariaLabel, dataFormArray = [], fields, fieldsSection, iconDeletable, iconHelperText, labelDivider, onChange, onAddForm, tagRemoveIcon, deletableFormArray, extraPropsFieldsArray, }) => {
|
|
24583
24596
|
const { theme } = useTheme();
|
|
24584
24597
|
const handleChange = (contact, id) => {
|
|
@@ -24606,11 +24619,11 @@ const DynamicForm = ({ ariaLabel, dataFormArray = [], fields, fieldsSection, ico
|
|
|
24606
24619
|
: undefined;
|
|
24607
24620
|
return (jsx(SectionForm, { ariaLabel: ariaLabel, data: form, fields: fields, fieldsSection: fieldsSection, iconDeletable: iconDeletable, iconHelperText: iconHelperText, onChange: (formData) => handleChange(formData, form.id || ''), onDelete: () => handleDelete(form.id || ''), tagRemoveIcon: tagRemoveIcon, isDeletable: isDeletable, extraPropsField: extraProps }, `DynamicForm-${form.id}-${index}}`));
|
|
24608
24621
|
};
|
|
24609
|
-
const contactsMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
24622
|
+
const contactsMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$a}__SectionFormWrapper` }, { children: dataFormArray.map(renderForm) }), void 0));
|
|
24610
24623
|
const dividerMarkup = labelDivider && jsx(Divider, { label: labelDivider }, void 0);
|
|
24611
24624
|
const addContactButtonMarkup = onAddForm && (jsx(AlphaButton, Object.assign({ ariaLabel: ariaLabel ? `${ariaLabel}--addNewForm` : ariaLabel, isTertiary: true, onClick: onAddForm.onClick }, { children: onAddForm.label }), void 0));
|
|
24612
24625
|
const THEME_CLASS = `${theme}`;
|
|
24613
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
24626
|
+
const className = cssClassName(COMPONENT_NAME$a, THEME_CLASS);
|
|
24614
24627
|
return (jsxs("div", Object.assign({ className: className }, { children: [dividerMarkup, contactsMarkup, addContactButtonMarkup] }), void 0));
|
|
24615
24628
|
};
|
|
24616
24629
|
|
|
@@ -27806,19 +27819,19 @@ Sortable.mount(Remove, Revert);
|
|
|
27806
27819
|
|
|
27807
27820
|
const Context = createContext({});
|
|
27808
27821
|
|
|
27809
|
-
const COMPONENT_NAME$
|
|
27822
|
+
const COMPONENT_NAME$9 = 'SortableList__Item';
|
|
27810
27823
|
const Item$2 = ({ children }) => {
|
|
27811
27824
|
const { hasHandle } = useContext(Context);
|
|
27812
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
27813
|
-
const handleMarkup = hasHandle ? (jsxs("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
27814
|
-
const contentMarkup = (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
27825
|
+
const className = cssClassName(COMPONENT_NAME$9, !hasHandle && 'no-handle');
|
|
27826
|
+
const handleMarkup = hasHandle ? (jsxs("span", Object.assign({ className: `${COMPONENT_NAME$9}__Handle` }, { children: [jsx(Icon, { name: 'MoreVertical' }, void 0), jsx(Icon, { name: 'MoreVertical' }, void 0)] }), void 0)) : null;
|
|
27827
|
+
const contentMarkup = (jsx("span", Object.assign({ className: `${COMPONENT_NAME$9}__Content` }, { children: children }), void 0));
|
|
27815
27828
|
return (jsxs("li", Object.assign({ className: className }, { children: [handleMarkup, contentMarkup] }), void 0));
|
|
27816
27829
|
};
|
|
27817
27830
|
|
|
27818
|
-
const COMPONENT_NAME$
|
|
27831
|
+
const COMPONENT_NAME$8 = 'SortableList';
|
|
27819
27832
|
const SortableList = function ({ renderItem, items, onSort, hasHandle, }) {
|
|
27820
27833
|
const listRef = useRef(null);
|
|
27821
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
27834
|
+
const className = cssClassName(COMPONENT_NAME$8);
|
|
27822
27835
|
const hasItems = items && items.length > 0;
|
|
27823
27836
|
const handleSortEnd = (event) => {
|
|
27824
27837
|
const { newIndex, oldIndex } = event;
|
|
@@ -27849,7 +27862,7 @@ const SortableList = function ({ renderItem, items, onSort, hasHandle, }) {
|
|
|
27849
27862
|
}
|
|
27850
27863
|
return itemComponent;
|
|
27851
27864
|
};
|
|
27852
|
-
const listClassName = cssClassName(`${COMPONENT_NAME$
|
|
27865
|
+
const listClassName = cssClassName(`${COMPONENT_NAME$8}__List`);
|
|
27853
27866
|
const listMarkup = hasItems ? (jsx("ul", Object.assign({ ref: listRef, className: listClassName }, { children: Children.toArray(items.map(renderItemElement)) }), void 0)) : null;
|
|
27854
27867
|
const contextValue = {
|
|
27855
27868
|
hasHandle,
|
|
@@ -30177,12 +30190,12 @@ const Tile = ({ isSelected, media, onClick, title, value, subtitle = '', mediaSi
|
|
|
30177
30190
|
return (jsxs("div", Object.assign({ className: classes, onClick: handleOnClick }, { children: [jsxs("div", Object.assign({ className: 'Tile__Wrapper' }, { children: [jsxs("div", Object.assign({ className: 'Tile__TitleWrapper' }, { children: [jsx("div", Object.assign({ className: 'Tile__Media' }, { children: jsx(Media, { icon: media, size: mediaSize, appearance: 'info' }, void 0) }), void 0), jsxs("div", { children: [jsx("div", Object.assign({ className: 'Tile__Title' }, { children: title }), void 0), subtitle ? jsx("div", Object.assign({ className: 'Tile__Subtitle' }, { children: subtitle }), void 0) : null] }, void 0)] }), void 0), jsx("div", Object.assign({ className: 'Tile__RightMediaWrapper' }, { children: rightMedia !== null && rightMedia }), void 0)] }), void 0), tagsMarkup] }), void 0));
|
|
30178
30191
|
};
|
|
30179
30192
|
|
|
30180
|
-
const COMPONENT_NAME$
|
|
30193
|
+
const COMPONENT_NAME$7 = 'Totalizer';
|
|
30181
30194
|
const Totalizer = ({ action, direction, icon, isDisabled, isFocused, label, placeholderValue, value, theme: themeProp, }) => {
|
|
30182
30195
|
const { theme } = useTheme();
|
|
30183
30196
|
const themeClass = `has-Theme${themeProp ? themeProp.toUpperCase() : theme.toUpperCase()}`;
|
|
30184
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
30185
|
-
const titleMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30197
|
+
const className = cssClassName(COMPONENT_NAME$7, themeClass, isDisabled && 'isDisabled', isFocused && 'isFocused', direction && `has-${direction}Direction`);
|
|
30198
|
+
const titleMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$7}__TitleWrapper` }, { children: label }), void 0)) : null;
|
|
30186
30199
|
let iconSource;
|
|
30187
30200
|
if (icon) {
|
|
30188
30201
|
if (isValidIcon(icon.icon)) {
|
|
@@ -30192,25 +30205,25 @@ const Totalizer = ({ action, direction, icon, isDisabled, isFocused, label, plac
|
|
|
30192
30205
|
iconSource = icon.icon;
|
|
30193
30206
|
}
|
|
30194
30207
|
}
|
|
30195
|
-
const iconMarkup = icon ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
30196
|
-
const headerMarkup = titleMarkup || iconMarkup ? (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30197
|
-
const valueMarkup = value ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30198
|
-
const placeholderValueMarkup = placeholderValue ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30208
|
+
const iconMarkup = icon ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$7}__IconWrapper` }, { children: iconSource }), void 0)) : null;
|
|
30209
|
+
const headerMarkup = titleMarkup || iconMarkup ? (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$7}__HeaderWrapper` }, { children: [titleMarkup, iconMarkup] }), void 0)) : null;
|
|
30210
|
+
const valueMarkup = value ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$7}__ValueWrapper` }, { children: value }), void 0)) : null;
|
|
30211
|
+
const placeholderValueMarkup = placeholderValue ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$7}__PlaceholderValueWrapper` }, { children: placeholderValue }), void 0)) : null;
|
|
30199
30212
|
const valueContentToRender = (!valueMarkup && placeholderValueMarkup) || valueMarkup;
|
|
30200
|
-
const valueContainerMarkup = valueMarkup || placeholderValueMarkup ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30201
|
-
const actionMarkup = action ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30202
|
-
const contentClassName = cssClassName(`${COMPONENT_NAME$
|
|
30213
|
+
const valueContainerMarkup = valueMarkup || placeholderValueMarkup ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$7}__ValueContainerWrapper` }, { children: valueContentToRender }), void 0)) : null;
|
|
30214
|
+
const actionMarkup = action ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$7}__ActionWrapper` }, { children: jsx(AlphaButton, Object.assign({ id: action.id, onClick: action.onClick, onMouseEnter: action.onMouseEnter, onTouchStart: action.onTouchStart, isDisabled: action.isDisabled || isDisabled, isLoading: action.isLoading, isDanger: action.isDanger, icon: action.icon ? { icon: action.icon } : undefined, isPrimary: true }, { children: action.content }), void 0) }), void 0)) : null;
|
|
30215
|
+
const contentClassName = cssClassName(`${COMPONENT_NAME$7}__ContentWrapper`, action && 'has-Action');
|
|
30203
30216
|
const contentMarkup = valueContainerMarkup || actionMarkup ? (jsxs("div", Object.assign({ className: contentClassName }, { children: [valueContainerMarkup, actionMarkup] }), void 0)) : null;
|
|
30204
30217
|
return (jsxs("div", Object.assign({ className: className }, { children: [headerMarkup, contentMarkup] }), void 0));
|
|
30205
30218
|
};
|
|
30206
30219
|
|
|
30207
|
-
const COMPONENT_NAME$
|
|
30220
|
+
const COMPONENT_NAME$6 = 'AlphaMultiSelectionPicker__Picker__List';
|
|
30208
30221
|
const List = ({ items, selected, onChange }) => {
|
|
30209
30222
|
const listWrapperRef = useRef(null);
|
|
30210
30223
|
const scrollToSelected = () => {
|
|
30211
30224
|
const listWrapper = listWrapperRef.current;
|
|
30212
30225
|
if (listWrapper) {
|
|
30213
|
-
const selectedElement = listWrapper.querySelector(`.${COMPONENT_NAME$
|
|
30226
|
+
const selectedElement = listWrapper.querySelector(`.${COMPONENT_NAME$6}__ListItem--selected`);
|
|
30214
30227
|
if (selectedElement) {
|
|
30215
30228
|
const { top } = selectedElement.getBoundingClientRect();
|
|
30216
30229
|
const { top: listWrapperTop } = listWrapper.getBoundingClientRect();
|
|
@@ -30232,17 +30245,17 @@ const List = ({ items, selected, onChange }) => {
|
|
|
30232
30245
|
const renderItem = (item, index) => {
|
|
30233
30246
|
const { label, value } = item;
|
|
30234
30247
|
const isSelected = Boolean(selected !== null && selected !== undefined && selected === value);
|
|
30235
|
-
const className = cssClassName(`${COMPONENT_NAME$
|
|
30248
|
+
const className = cssClassName(`${COMPONENT_NAME$6}__ListItem`, isSelected && 'selected');
|
|
30236
30249
|
const handleClick = () => handleChange(value);
|
|
30237
|
-
return (jsx("li", Object.assign({ className: className, onClick: handleClick }, { children: label }), `${COMPONENT_NAME$
|
|
30250
|
+
return (jsx("li", Object.assign({ className: className, onClick: handleClick }, { children: label }), `${COMPONENT_NAME$6}__ListItem-${index}`));
|
|
30238
30251
|
};
|
|
30239
30252
|
const itemsMarkup = items ? items.map(renderItem) : null;
|
|
30240
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
30253
|
+
const className = cssClassName(COMPONENT_NAME$6);
|
|
30241
30254
|
return (jsx("div", Object.assign({ className: className, ref: listWrapperRef }, { children: jsx("ul", { children: itemsMarkup }, void 0) }), void 0));
|
|
30242
30255
|
};
|
|
30243
30256
|
|
|
30244
|
-
const COMPONENT_NAME$
|
|
30245
|
-
const
|
|
30257
|
+
const COMPONENT_NAME$5 = 'AlphaMultiSelectionPicker__Picker';
|
|
30258
|
+
const Picker = ({ headers, items, onChange, selected, theme: ThemeProp, }) => {
|
|
30246
30259
|
const { theme: themeValue } = useTheme();
|
|
30247
30260
|
const theme = ThemeProp || themeValue;
|
|
30248
30261
|
if (!theme) {
|
|
@@ -30255,46 +30268,93 @@ const TimePicker = ({ headers, items, onChange, selected, theme: ThemeProp, }) =
|
|
|
30255
30268
|
onChange(selectedValues);
|
|
30256
30269
|
}
|
|
30257
30270
|
};
|
|
30258
|
-
const renderHeader = (header, index) => (jsx("span", Object.assign({ className: `${COMPONENT_NAME$
|
|
30259
|
-
const headersMarkup = headers ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30271
|
+
const renderHeader = (header, index) => (jsx("span", Object.assign({ className: `${COMPONENT_NAME$5}__HeaderItem` }, { children: capitalize(header) }), `${COMPONENT_NAME$5}__HeaderItem-${index}`));
|
|
30272
|
+
const headersMarkup = headers ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$5}__HeadersMarkup` }, { children: headers.map(renderHeader) }), void 0)) : null;
|
|
30260
30273
|
const renderList = (listItems, index) => {
|
|
30261
30274
|
const selectedValue = selected ? selected[index] : undefined;
|
|
30262
|
-
return (jsx(List, { items: listItems, onChange: (value) => handleChange(value, index), selected: selectedValue }, `${COMPONENT_NAME$
|
|
30275
|
+
return (jsx(List, { items: listItems, onChange: (value) => handleChange(value, index), selected: selectedValue }, `${COMPONENT_NAME$5}__List-${index}`));
|
|
30263
30276
|
};
|
|
30264
|
-
const itemsListsMarkup = items ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30265
|
-
const className = cssClassName(COMPONENT_NAME$
|
|
30277
|
+
const itemsListsMarkup = items ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$5}__ItemsListWrapper` }, { children: items.map(renderList) }), void 0)) : null;
|
|
30278
|
+
const className = cssClassName(COMPONENT_NAME$5, theme);
|
|
30266
30279
|
return (jsxs("div", Object.assign({ className: className }, { children: [headersMarkup, itemsListsMarkup] }), void 0));
|
|
30267
30280
|
};
|
|
30268
30281
|
|
|
30269
|
-
const
|
|
30270
|
-
const
|
|
30282
|
+
const AlphaMultiSelectionPicker = ({ items, onChange, theme, }) => {
|
|
30283
|
+
const getLabel = (value) => {
|
|
30284
|
+
return value < 10 ? `0${value}` : `${value}`;
|
|
30285
|
+
};
|
|
30286
|
+
const getListItem = (min, max) => {
|
|
30287
|
+
const numbersArray = Array.from({ length: max - min + 1 }, (_, i) => i + min);
|
|
30288
|
+
return numbersArray.map((number) => ({
|
|
30289
|
+
label: getLabel(number),
|
|
30290
|
+
value: number,
|
|
30291
|
+
}));
|
|
30292
|
+
};
|
|
30293
|
+
const headersPicker = useMemo(() => items.map((item) => item.plural), [items]);
|
|
30294
|
+
const itemsPicker = useMemo(() => items.map((item) => getListItem(item.min, item.max)), [items]);
|
|
30295
|
+
const valuesSelected = useMemo(() => items.map((item) => item.value), [items]);
|
|
30296
|
+
const pickerMarkup = (jsx(Picker, { items: itemsPicker, headers: headersPicker, onChange: onChange, selected: valuesSelected, theme: theme }, void 0));
|
|
30297
|
+
return jsx("div", { children: pickerMarkup }, void 0);
|
|
30298
|
+
};
|
|
30299
|
+
|
|
30300
|
+
const COMPONENT_NAME$4 = 'TimeSelector';
|
|
30301
|
+
const TimeSelector = ({ plurals, singulars, value, disabled, error, helpText, label, onChange, readOnly, placeholderValues, minMaxYears, minMaxMonths, minMaxDays, minMaxHours, minMaxMinutes, minMaxSeconds, theme: themeProp, isRequired, }) => {
|
|
30271
30302
|
const { theme: themeValue } = useTheme();
|
|
30272
30303
|
const theme = themeProp || themeValue;
|
|
30273
30304
|
if (!theme) {
|
|
30274
30305
|
return null;
|
|
30275
30306
|
}
|
|
30307
|
+
const [items, setItems] = useState([]);
|
|
30308
|
+
const [keysValues, setKeysValues] = useState([]);
|
|
30276
30309
|
const fieldRef = useRef(null);
|
|
30277
30310
|
const [isFocused, setIsFocused] = useState(false);
|
|
30278
30311
|
const [isActive, setIsActive] = useState(false);
|
|
30279
30312
|
const toggleTimePicker = () => setIsActive(!isActive);
|
|
30280
30313
|
const hasError = !!error;
|
|
30281
|
-
const
|
|
30282
|
-
|
|
30283
|
-
|
|
30284
|
-
|
|
30314
|
+
const getMaxMins = () => {
|
|
30315
|
+
const maxMins = {
|
|
30316
|
+
years: minMaxYears,
|
|
30317
|
+
months: minMaxMonths,
|
|
30318
|
+
days: minMaxDays,
|
|
30319
|
+
hours: minMaxHours,
|
|
30320
|
+
minutes: minMaxMinutes,
|
|
30321
|
+
seconds: minMaxSeconds,
|
|
30322
|
+
};
|
|
30323
|
+
return maxMins;
|
|
30324
|
+
};
|
|
30325
|
+
const getItemMultiSelectionPicker = (key, minMax) => ({
|
|
30326
|
+
id: key,
|
|
30327
|
+
plural: plurals[key] || '',
|
|
30328
|
+
singular: singulars[key] || '',
|
|
30329
|
+
min: minMax[0],
|
|
30330
|
+
max: minMax[1],
|
|
30331
|
+
value: value ? value[key] : 0,
|
|
30332
|
+
});
|
|
30333
|
+
const getItemsMultiSelectionPicker = () => {
|
|
30334
|
+
const catalogMinMax = getMaxMins();
|
|
30335
|
+
const items = [];
|
|
30336
|
+
const keys = [];
|
|
30337
|
+
Object.keys(catalogMinMax).forEach((key) => {
|
|
30338
|
+
const valueMinMax = catalogMinMax[key];
|
|
30339
|
+
if (valueMinMax) {
|
|
30340
|
+
keys.push(key);
|
|
30341
|
+
items.push(getItemMultiSelectionPicker(key, valueMinMax));
|
|
30342
|
+
}
|
|
30343
|
+
});
|
|
30344
|
+
setKeysValues(keys);
|
|
30345
|
+
return items;
|
|
30346
|
+
};
|
|
30285
30347
|
const handleClosePopover = () => {
|
|
30286
30348
|
if (isActive) {
|
|
30287
30349
|
toggleTimePicker();
|
|
30288
30350
|
}
|
|
30289
30351
|
};
|
|
30290
30352
|
const handleTimePickerChange = (values) => {
|
|
30291
|
-
const
|
|
30292
|
-
|
|
30293
|
-
|
|
30294
|
-
|
|
30295
|
-
|
|
30296
|
-
seconds: seconds || 0,
|
|
30297
|
-
};
|
|
30353
|
+
const newValue = {};
|
|
30354
|
+
keysValues.forEach((key, index) => {
|
|
30355
|
+
const valueByKey = values[index];
|
|
30356
|
+
newValue[key] = valueByKey || 0;
|
|
30357
|
+
});
|
|
30298
30358
|
if (onChange) {
|
|
30299
30359
|
onChange(newValue);
|
|
30300
30360
|
}
|
|
@@ -30335,15 +30395,6 @@ const TimeSelector = ({ plurals, singulars, value, disabled, error, helpText, la
|
|
|
30335
30395
|
fullValue[fieldName] = fieldVal;
|
|
30336
30396
|
return fullValue;
|
|
30337
30397
|
};
|
|
30338
|
-
const getMaxMins = () => {
|
|
30339
|
-
const maxMins = {
|
|
30340
|
-
days: minMaxDays,
|
|
30341
|
-
hours: minMaxHours,
|
|
30342
|
-
minutes: minMaxMinutes,
|
|
30343
|
-
seconds: minMaxSeconds,
|
|
30344
|
-
};
|
|
30345
|
-
return maxMins;
|
|
30346
|
-
};
|
|
30347
30398
|
const renderField = (field, index) => {
|
|
30348
30399
|
const label = !value || (value && value[field] !== 1)
|
|
30349
30400
|
? plurals[field]
|
|
@@ -30355,50 +30406,46 @@ const TimeSelector = ({ plurals, singulars, value, disabled, error, helpText, la
|
|
|
30355
30406
|
? getTimeValue(value[field])
|
|
30356
30407
|
: '';
|
|
30357
30408
|
const separator = index === Object.keys(singulars).length - 1 ? '' : ', ';
|
|
30358
|
-
const
|
|
30359
|
-
|
|
30360
|
-
|
|
30409
|
+
const valuesMaxMin = getMaxMins()[field];
|
|
30410
|
+
let max;
|
|
30411
|
+
let min;
|
|
30412
|
+
if (valuesMaxMin)
|
|
30413
|
+
[min, max] = valuesMaxMin;
|
|
30414
|
+
return (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$4}__InnerField` }, { children: [jsx("input", { type: 'number', value: elValue, placeholder: placeholderValue, onFocus: handleFocusField, onBlur: handleBlurField, disabled: disabled, onChange: handleInputChange, name: field, min: min, max: max }, void 0), jsxs("span", { children: [label, separator] }, void 0)] }), index));
|
|
30361
30415
|
};
|
|
30362
30416
|
const fieldsMarkup = Object.keys(singulars).map(renderField);
|
|
30363
|
-
const fieldClass = cssClassName(`${COMPONENT_NAME$
|
|
30364
|
-
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30417
|
+
const fieldClass = cssClassName(`${COMPONENT_NAME$4}__Field`, (isFocused || isActive) && 'isFocused');
|
|
30418
|
+
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$4}__LabelWrapper` }, { children: jsx(AlphaLabel, Object.assign({ isRequired: isRequired }, { children: label }), void 0) }), void 0)) : null;
|
|
30365
30419
|
const helpTextMarkup = helpText
|
|
30366
|
-
? helpText && (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30420
|
+
? helpText && (jsx("div", Object.assign({ className: `${COMPONENT_NAME$4}__HelpTextWrapper` }, { children: helpText }), void 0))
|
|
30367
30421
|
: null;
|
|
30368
|
-
const fieldMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30369
|
-
const
|
|
30370
|
-
if (value) {
|
|
30371
|
-
const { days, hours, minutes, seconds } = value;
|
|
30372
|
-
return [days, hours, minutes, seconds];
|
|
30373
|
-
}
|
|
30374
|
-
return undefined;
|
|
30375
|
-
}, [value]);
|
|
30376
|
-
const timePickerHeaders = useMemo(() => [plurals.days, plurals.hours, plurals.minutes, plurals.seconds], [plurals]);
|
|
30377
|
-
const timePickerMarkup = (jsx(TimePicker, { items: [daysList, hoursList, minutesList, secondsList], headers: timePickerHeaders, onChange: handleTimePickerChange, selected: timePickerValue, theme: theme }, void 0));
|
|
30422
|
+
const fieldMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$4}__FieldWrapper` }, { children: jsxs(AlphaTooltip, Object.assign({ content: error, appearance: 'error', persistence: true, isActive: hasError }, { children: [labelMarkup, jsx("div", Object.assign({ className: fieldClass, onClick: handleFieldClick, ref: fieldRef }, { children: fieldsMarkup }), void 0)] }), void 0) }), void 0));
|
|
30423
|
+
const timePickerMarkup = (jsx(AlphaMultiSelectionPicker, { items: items, onChange: handleTimePickerChange, theme: themeProp }, void 0));
|
|
30378
30424
|
const popoverMarkup = (jsx(Popover$1, Object.assign({ activator: fieldMarkup, isActive: isActive, isFullWidth: true, onClose: handleClosePopover }, { children: timePickerMarkup }), void 0));
|
|
30379
|
-
|
|
30425
|
+
useEffect(() => {
|
|
30426
|
+
setItems(getItemsMultiSelectionPicker());
|
|
30427
|
+
}, []);
|
|
30428
|
+
useEffect(() => {
|
|
30429
|
+
setItems(getItemsMultiSelectionPicker());
|
|
30430
|
+
}, [value]);
|
|
30431
|
+
const className = cssClassName(COMPONENT_NAME$4, theme, !value && 'isEmpty');
|
|
30380
30432
|
return (jsxs("div", Object.assign({ className: className }, { children: [popoverMarkup, helpTextMarkup] }), void 0));
|
|
30381
30433
|
};
|
|
30382
30434
|
function getTimeValue(value) {
|
|
30435
|
+
if (value === undefined)
|
|
30436
|
+
return '';
|
|
30383
30437
|
return value < 10 ? `0${value}` : `${value}`;
|
|
30384
|
-
}
|
|
30385
|
-
function getTimeList(min, max) {
|
|
30386
|
-
const numbersArray = Array.from({ length: max - min + 1 }, (_, i) => i + min);
|
|
30387
|
-
return numbersArray.map((number) => ({
|
|
30388
|
-
label: getTimeValue(number),
|
|
30389
|
-
value: number,
|
|
30390
|
-
}));
|
|
30391
30438
|
}
|
|
30392
30439
|
|
|
30393
|
-
const COMPONENT_NAME$
|
|
30440
|
+
const COMPONENT_NAME$3 = 'FilterField';
|
|
30394
30441
|
const FilterField = ({ label, isRequired = false, field, onRemove, name, }) => {
|
|
30395
|
-
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30396
|
-
const filterFieldMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30397
|
-
const removeButtonMarkup = onRemove && !isRequired ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30398
|
-
return (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30442
|
+
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$3}__LabelWrapper` }, { children: label }), void 0)) : null;
|
|
30443
|
+
const filterFieldMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$3}__FieldWrapper`, id: name }, { children: field }), void 0));
|
|
30444
|
+
const removeButtonMarkup = onRemove && !isRequired ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$3}__RemoveButtonWrapper` }, { children: jsx("button", Object.assign({ type: 'button', className: `${COMPONENT_NAME$3}__RemoveButton`, onClick: onRemove }, { children: jsx(Icon, { name: 'X' }, void 0) }), void 0) }), void 0)) : null;
|
|
30445
|
+
return (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$3}` }, { children: [labelMarkup, filterFieldMarkup, removeButtonMarkup] }), void 0));
|
|
30399
30446
|
};
|
|
30400
30447
|
|
|
30401
|
-
const COMPONENT_NAME$
|
|
30448
|
+
const COMPONENT_NAME$2 = 'Filters';
|
|
30402
30449
|
const Filters = ({ ariaLabel, filters = [], onApplyFilters, onRemoveFilter, appliedFilters, onCleanFilters, onAddFilter, addFilterButtonIcon, addFilterButtonLabel, clearButtonLabel, searchButtonLabel, extraActions, selectedFilters = [], }) => {
|
|
30403
30450
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
30404
30451
|
const mainContainerRef = useRef(null);
|
|
@@ -30422,8 +30469,8 @@ const Filters = ({ ariaLabel, filters = [], onApplyFilters, onRemoveFilter, appl
|
|
|
30422
30469
|
const extraActionsMarkup = extraActions
|
|
30423
30470
|
? extraActions.map((extraAction, index) => (createElement(AlphaButton, Object.assign({}, extraAction, { key: `extra-action-${index}` }), extraAction.label)))
|
|
30424
30471
|
: null;
|
|
30425
|
-
const secondaryActionsMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30426
|
-
const mainActionsMarkup = (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30472
|
+
const secondaryActionsMarkup = (jsx("div", Object.assign({ className: `${COMPONENT_NAME$2}__SecondaryActionsWrapper` }, { children: availableFiltersPopoverMarkup }), void 0));
|
|
30473
|
+
const mainActionsMarkup = (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$2}__MainActionsWrapper` }, { children: [extraActionsMarkup, jsx(AlphaButton, Object.assign({ ariaLabel: `${ariaLabel}-cleanFilters`, onClick: onCleanFilters, isDisabled: !appliedFilters.length && !selectedFilters.length }, { children: clearButtonLabel }), void 0), jsx(AlphaButton, Object.assign({ ariaLabel: `${ariaLabel}-searchFilters`, isDisabled: !appliedFilters.length && !selectedFilters.length, isPrimary: true, onClick: onApplyFilters }, { children: searchButtonLabel }), void 0)] }), void 0));
|
|
30427
30474
|
const handleRemoveFilter = (filter) => {
|
|
30428
30475
|
onRemoveFilter === null || onRemoveFilter === void 0 ? void 0 : onRemoveFilter(filter);
|
|
30429
30476
|
};
|
|
@@ -30434,17 +30481,17 @@ const Filters = ({ ariaLabel, filters = [], onApplyFilters, onRemoveFilter, appl
|
|
|
30434
30481
|
const handleRemove = () => {
|
|
30435
30482
|
handleRemoveFilter(filter);
|
|
30436
30483
|
};
|
|
30437
|
-
return (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30484
|
+
return (jsx("div", Object.assign({ className: `${COMPONENT_NAME$2}__SelectedFilter` }, { children: jsx(FilterField, { label: foundFilter.label, field: foundFilter.filter, isRequired: foundFilter.isRequired, onRemove: handleRemove, name: filter }, void 0) }), index));
|
|
30438
30485
|
};
|
|
30439
|
-
const selectedFiltersMarkup = selectedFilters.length ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30440
|
-
const actionsContainerMarkup = (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$
|
|
30441
|
-
return (jsxs("div", Object.assign({ className: COMPONENT_NAME$
|
|
30486
|
+
const selectedFiltersMarkup = selectedFilters.length ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$2}__SelectedFiltersWrapper` }, { children: selectedFilters.map(renderSelectedFilter) }), void 0)) : null;
|
|
30487
|
+
const actionsContainerMarkup = (jsxs("div", Object.assign({ className: `${COMPONENT_NAME$2}__ActionsWrapper` }, { children: [secondaryActionsMarkup, mainActionsMarkup] }), void 0));
|
|
30488
|
+
return (jsxs("div", Object.assign({ className: COMPONENT_NAME$2, ref: mainContainerRef }, { children: [selectedFiltersMarkup, actionsContainerMarkup] }), void 0));
|
|
30442
30489
|
};
|
|
30443
30490
|
|
|
30444
|
-
const COMPONENT_NAME = 'Link';
|
|
30491
|
+
const COMPONENT_NAME$1 = 'Link';
|
|
30445
30492
|
const Link = ({ children, className: classNameProp, component, to, target, }) => {
|
|
30446
30493
|
const Component = component;
|
|
30447
|
-
const className = cssClassName(COMPONENT_NAME, classNameProp);
|
|
30494
|
+
const className = cssClassName(COMPONENT_NAME$1, classNameProp);
|
|
30448
30495
|
return (jsx(Component, Object.assign({ className: className, to: to, target: target }, { children: children }), void 0));
|
|
30449
30496
|
};
|
|
30450
30497
|
|
|
@@ -30480,5 +30527,58 @@ const AlphaGraphicCard = ({ data }) => {
|
|
|
30480
30527
|
return jsx("div", Object.assign({ className: MAIN_CLASS }, { children: data.map(renderContainer) }), void 0);
|
|
30481
30528
|
};
|
|
30482
30529
|
|
|
30483
|
-
|
|
30530
|
+
const COMPONENT_NAME = 'AlphaZipCodeInput';
|
|
30531
|
+
const AlphaZipCodeInput = ({ label, isRequired, items, onBlur, onFocus, onChange, value, labelEmpty, }) => {
|
|
30532
|
+
const [isFocusActive, setIsFocusActive] = useState(false);
|
|
30533
|
+
const [showPopover, setShowPopover] = useState(false);
|
|
30534
|
+
const handleOnBlur = () => {
|
|
30535
|
+
setIsFocusActive(false);
|
|
30536
|
+
if (onBlur)
|
|
30537
|
+
onBlur();
|
|
30538
|
+
};
|
|
30539
|
+
const handleOnFocus = () => {
|
|
30540
|
+
setIsFocusActive(true);
|
|
30541
|
+
setShowPopover(Boolean(value && (value === null || value === void 0 ? void 0 : value.length) > 2));
|
|
30542
|
+
if (onFocus)
|
|
30543
|
+
onFocus();
|
|
30544
|
+
};
|
|
30545
|
+
const handleOnChange = (event) => {
|
|
30546
|
+
const isValid = /^[0-9]+$/i.test(event.target.value) || event.target.value === '';
|
|
30547
|
+
if (isValid && onChange) {
|
|
30548
|
+
setShowPopover(event.target.value.length > 2);
|
|
30549
|
+
onChange(event.target.value);
|
|
30550
|
+
}
|
|
30551
|
+
};
|
|
30552
|
+
const labelMarkup = label ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME}__LabelWrapper` }, { children: jsxs("label", Object.assign({ className: `${COMPONENT_NAME}__Label` }, { children: [label, isRequired ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME}__Label--isRequired` }, { children: "*" }), void 0)) : null] }), void 0) }), void 0)) : null;
|
|
30553
|
+
const classesInput = cssClassName(`${COMPONENT_NAME}__InputWrapper`, isFocusActive && 'isFocus');
|
|
30554
|
+
const inputMarkup = (jsx("div", Object.assign({ className: classesInput }, { children: jsx("input", { className: `${COMPONENT_NAME}__InputWrapper--input`, onBlur: handleOnBlur, onFocus: handleOnFocus, onChange: handleOnChange, maxLength: 5, value: value }, void 0) }), void 0));
|
|
30555
|
+
const handleOnSelectItem = (item) => {
|
|
30556
|
+
if (onChange)
|
|
30557
|
+
onChange(item[0]);
|
|
30558
|
+
setShowPopover(false);
|
|
30559
|
+
};
|
|
30560
|
+
const renderLabelItem = (item) => (jsxs("div", Object.assign({ className: `${COMPONENT_NAME}__ItemWrapper` }, { children: [jsx("div", Object.assign({ className: `${COMPONENT_NAME}__Item__Value` }, { children: item.cp }), void 0), jsxs("div", Object.assign({ className: `${COMPONENT_NAME}__Item__Description` }, { children: [item.municipality, ", ", item.city, ", ", item.state] }), void 0)] }), void 0));
|
|
30561
|
+
const itemsOptions = items.map((item) => ({
|
|
30562
|
+
label: renderLabelItem(item),
|
|
30563
|
+
value: item.cp,
|
|
30564
|
+
}));
|
|
30565
|
+
const optionListMarkup = items.length > 0 ? (jsx(OptionList, { items: itemsOptions, selected: [''], onChange: handleOnSelectItem }, void 0)) : null;
|
|
30566
|
+
const emptyItemsMarkup = items.length === 0 ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME}__EmptyItems` }, { children: labelEmpty }), void 0)) : null;
|
|
30567
|
+
const popoverMarkup = useMemo(() => (jsx(Popover$1, Object.assign({ activator: inputMarkup, isActive: showPopover, isFullWidth: true, onClose: () => setShowPopover(false), isFixed: true }, { children: jsxs(Popover$1.Pane, { children: [optionListMarkup, emptyItemsMarkup] }, void 0) }), void 0)), [items, value, showPopover]);
|
|
30568
|
+
return (jsxs("div", Object.assign({ className: `${COMPONENT_NAME}__Wrapper` }, { children: [labelMarkup, popoverMarkup] }), void 0));
|
|
30569
|
+
};
|
|
30570
|
+
|
|
30571
|
+
const MAINCLASS = 'SegmentedControl';
|
|
30572
|
+
const AlphaSegmentedControl = ({ children, title, segments, selected, onSelected, }) => {
|
|
30573
|
+
const renderSegment = (segment, index) => {
|
|
30574
|
+
const classesControl = cssClassName(`${MAINCLASS}__ControlItem`, index === selected && 'isSelected');
|
|
30575
|
+
return (jsx("div", Object.assign({ className: classesControl, id: segment.panelID, "aria-label": segment.ariaLabel, onClick: () => onSelected(index) }, { children: segment.content }), `segmentControl-${index}`));
|
|
30576
|
+
};
|
|
30577
|
+
const controlMarkup = (jsx("div", Object.assign({ className: `${MAINCLASS}__ControlWrapper` }, { children: segments.map(renderSegment) }), void 0));
|
|
30578
|
+
const headerMarkup = (jsxs("div", Object.assign({ className: `${MAINCLASS}__HeaderWrapper` }, { children: [jsx("div", Object.assign({ className: `${MAINCLASS}__Title` }, { children: title }), void 0), controlMarkup] }), void 0));
|
|
30579
|
+
const contentMarkup = children ? (jsx("div", Object.assign({ className: `${MAINCLASS}__ContentWrapper` }, { children: children }), void 0)) : null;
|
|
30580
|
+
return (jsxs("div", Object.assign({ className: `${MAINCLASS}__Container` }, { children: [headerMarkup, contentMarkup] }), void 0));
|
|
30581
|
+
};
|
|
30582
|
+
|
|
30583
|
+
export { ActionList, Alert, AlertProvider, AlphaAttributeInput, AlphaBadge, AlphaButton, AlphaChip, AlphaFilterControl, AlphaGraphicCard, AlphaIcon, AlphaInlineError, AlphaInputDate, InputTag$1 as AlphaInputTag, AlphaInputText, AlphaLabel, AlphaLabelledField, AlphaMultiSelectionPicker, AlphaSegmentedControl, AlphaSpinner, AlphaStepper, AlphaTag, AlphaTile, AlphaTooltip, Totalizer as AlphaTotalizer, AlphaZipCodeInput, AnnotatedSection, Avatar, Badge, Banner, Button, CalendarPicker, Card, Checkbox, ChoiceList, Collapsible, Connector, Container, Cover, DataTable, DatePicker, DeletableSection, Divider, DynamicForm, EmptyState, ErrorIcon, FileDownloader, Filedrop, FilterControl, Filters, Footer, Form, FormField, FormLayout, Frame, Grid, GridItem, Header$1 as Header, Icon, IconButton, IndexList, InlineEdit, InputPhoneNumber, InputTag, InputText, JsonViewer, Label, Link, ListInfo, Loader, Logo, Media, Modal, ModalHeader, Nip, OptionList, Page, PageActions, Pagination, Pane, Panel, PanelFooter, PanelHeader, PendingIcon, Popover$1 as Popover, Progress, RadioButton, SectionForm, Select, SideMenu, SkeletonInput, SkeletonMedia, SkeletonTabs, SkeletonText, SkeletonTitle, SortableList, Spinner, Stack, StepDefault, SuccessIcon, Table, Tabs, Tag, ThemeProvider, ThreadItem, Thumbnail, Tile, TimeSelector, Title, Toggle, Tooltip, WarningIcon, capitalize, cssClassName, formatDate, formatFileSize, isComponentTypeOf, isValidIcon, themeClassConverter, useShowAlert, useTheme };
|
|
30484
30584
|
//# sourceMappingURL=index.js.map
|