@trii/components 2.0.16 → 2.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +50 -674
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +3 -4
- package/dist/cjs/types/components/ContactInfoPopup/components/Header/Header.d.ts +4 -8
- package/dist/cjs/types/components/ContactInfoPopup/components/index.d.ts +0 -3
- package/dist/esm/index.js +52 -676
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +3 -4
- package/dist/esm/types/components/ContactInfoPopup/components/Header/Header.d.ts +4 -8
- package/dist/esm/types/components/ContactInfoPopup/components/index.d.ts +0 -3
- package/dist/index.d.ts +3 -4
- package/package.json +99 -99
- package/readme +71 -71
- package/dist/cjs/types/components/ContactInfoPopup/components/BusinessSection/BusinessSection.d.ts +0 -7
- package/dist/cjs/types/components/ContactInfoPopup/components/BusinessSection/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/LabelsSection/LabelsSection.d.ts +0 -7
- package/dist/cjs/types/components/ContactInfoPopup/components/LabelsSection/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/MemberItem/MemberItem.d.ts +0 -5
- package/dist/cjs/types/components/ContactInfoPopup/components/MemberItem/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/MembersSection.d.ts +0 -7
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/MemberItem.d.ts +0 -4
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/components/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/hooks/useContactInfoPopupTranslation.d.ts +0 -24
- package/dist/cjs/types/components/ContactInfoPopup/types/is-business.typeguard.d.ts +0 -7
- package/dist/cjs/types/components/ContactInfoPopup/types/is-contact.typeguard.d.ts +0 -7
- package/dist/cjs/types/components/LanguageSelector.d.ts +0 -2
- package/dist/cjs/types/contexts/LanguageContext.d.ts +0 -10
- package/dist/cjs/types/i18n.d.ts +0 -2
- package/dist/cjs/types/translations/en.d.ts +0 -31
- package/dist/cjs/types/translations/es.d.ts +0 -31
- package/dist/cjs/types/translations/index.d.ts +0 -2
- package/dist/cjs/types/types/translations.d.ts +0 -25
- package/dist/cjs/types/utils/translation.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/components/BusinessSection/BusinessSection.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/components/BusinessSection/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/LabelsSection/LabelsSection.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/components/LabelsSection/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/MemberItem/MemberItem.d.ts +0 -5
- package/dist/esm/types/components/ContactInfoPopup/components/MemberItem/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/MembersSection.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/MemberItem.d.ts +0 -4
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/components/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/hooks/useContactInfoPopupTranslation.d.ts +0 -24
- package/dist/esm/types/components/ContactInfoPopup/types/is-business.typeguard.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/types/is-contact.typeguard.d.ts +0 -7
- package/dist/esm/types/components/LanguageSelector.d.ts +0 -2
- package/dist/esm/types/contexts/LanguageContext.d.ts +0 -10
- package/dist/esm/types/i18n.d.ts +0 -2
- package/dist/esm/types/translations/en.d.ts +0 -31
- package/dist/esm/types/translations/es.d.ts +0 -31
- package/dist/esm/types/translations/index.d.ts +0 -2
- package/dist/esm/types/types/translations.d.ts +0 -25
- package/dist/esm/types/utils/translation.d.ts +0 -7
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, {
|
|
3
|
-
import { Button, styled as styled$3, Box, IconButton, Avatar, Typography,
|
|
2
|
+
import React__default, { useEffect } from 'react';
|
|
3
|
+
import { Button, styled as styled$3, Box, IconButton, Avatar, Typography, Tooltip, Chip, Popper, ClickAwayListener, CardContent } from '@mui/material';
|
|
4
4
|
import { withEmotionCache, ThemeContext, CacheProvider, Global, css, keyframes } from '@emotion/react';
|
|
5
5
|
|
|
6
6
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -3022,422 +3022,6 @@ var capitalize = /*#__PURE__*/Object.freeze({
|
|
|
3022
3022
|
default: capitalize$1
|
|
3023
3023
|
});
|
|
3024
3024
|
|
|
3025
|
-
/**
|
|
3026
|
-
* Safe chained function.
|
|
3027
|
-
*
|
|
3028
|
-
* Will only create a new function if needed,
|
|
3029
|
-
* otherwise will pass back existing functions or null.
|
|
3030
|
-
*/
|
|
3031
|
-
function createChainedFunction(...funcs) {
|
|
3032
|
-
return funcs.reduce((acc, func) => {
|
|
3033
|
-
if (func == null) {
|
|
3034
|
-
return acc;
|
|
3035
|
-
}
|
|
3036
|
-
return function chainedFunction(...args) {
|
|
3037
|
-
acc.apply(this, args);
|
|
3038
|
-
func.apply(this, args);
|
|
3039
|
-
};
|
|
3040
|
-
}, () => {});
|
|
3041
|
-
}
|
|
3042
|
-
|
|
3043
|
-
// Corresponds to 10 frames at 60 Hz.
|
|
3044
|
-
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
|
|
3045
|
-
function debounce(func, wait = 166) {
|
|
3046
|
-
let timeout;
|
|
3047
|
-
function debounced(...args) {
|
|
3048
|
-
const later = () => {
|
|
3049
|
-
// @ts-ignore
|
|
3050
|
-
func.apply(this, args);
|
|
3051
|
-
};
|
|
3052
|
-
clearTimeout(timeout);
|
|
3053
|
-
timeout = setTimeout(later, wait);
|
|
3054
|
-
}
|
|
3055
|
-
debounced.clear = () => {
|
|
3056
|
-
clearTimeout(timeout);
|
|
3057
|
-
};
|
|
3058
|
-
return debounced;
|
|
3059
|
-
}
|
|
3060
|
-
|
|
3061
|
-
function deprecatedPropType(validator, reason) {
|
|
3062
|
-
if (process.env.NODE_ENV === 'production') {
|
|
3063
|
-
return () => null;
|
|
3064
|
-
}
|
|
3065
|
-
return (props, propName, componentName, location, propFullName) => {
|
|
3066
|
-
const componentNameSafe = componentName || '<<anonymous>>';
|
|
3067
|
-
const propFullNameSafe = propFullName || propName;
|
|
3068
|
-
if (typeof props[propName] !== 'undefined') {
|
|
3069
|
-
return new Error(`The ${location} \`${propFullNameSafe}\` of ` + `\`${componentNameSafe}\` is deprecated. ${reason}`);
|
|
3070
|
-
}
|
|
3071
|
-
return null;
|
|
3072
|
-
};
|
|
3073
|
-
}
|
|
3074
|
-
|
|
3075
|
-
function isMuiElement(element, muiNames) {
|
|
3076
|
-
var _muiName, _element$type;
|
|
3077
|
-
return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName
|
|
3078
|
-
// relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
|
|
3079
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
3080
|
-
(_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;
|
|
3081
|
-
}
|
|
3082
|
-
|
|
3083
|
-
function ownerDocument(node) {
|
|
3084
|
-
return node && node.ownerDocument || document;
|
|
3085
|
-
}
|
|
3086
|
-
|
|
3087
|
-
function ownerWindow(node) {
|
|
3088
|
-
const doc = ownerDocument(node);
|
|
3089
|
-
return doc.defaultView || window;
|
|
3090
|
-
}
|
|
3091
|
-
|
|
3092
|
-
function requirePropFactory(componentNameInError, Component) {
|
|
3093
|
-
if (process.env.NODE_ENV === 'production') {
|
|
3094
|
-
return () => null;
|
|
3095
|
-
}
|
|
3096
|
-
|
|
3097
|
-
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
3098
|
-
const prevPropTypes = Component ? _extends$1({}, Component.propTypes) : null;
|
|
3099
|
-
const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
|
|
3100
|
-
const propFullNameSafe = propFullName || propName;
|
|
3101
|
-
const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];
|
|
3102
|
-
if (defaultTypeChecker) {
|
|
3103
|
-
const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);
|
|
3104
|
-
if (typeCheckerResult) {
|
|
3105
|
-
return typeCheckerResult;
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
|
-
if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {
|
|
3109
|
-
return new Error(`The prop \`${propFullNameSafe}\` of ` + `\`${componentNameInError}\` can only be used together with the \`${requiredProp}\` prop.`);
|
|
3110
|
-
}
|
|
3111
|
-
return null;
|
|
3112
|
-
};
|
|
3113
|
-
return requireProp;
|
|
3114
|
-
}
|
|
3115
|
-
|
|
3116
|
-
/**
|
|
3117
|
-
* TODO v5: consider making it private
|
|
3118
|
-
*
|
|
3119
|
-
* passes {value} to {ref}
|
|
3120
|
-
*
|
|
3121
|
-
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
3122
|
-
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
3123
|
-
* https://github.com/mui/material-ui/issues/13539
|
|
3124
|
-
*
|
|
3125
|
-
* Useful if you want to expose the ref of an inner component to the public API
|
|
3126
|
-
* while still using it inside the component.
|
|
3127
|
-
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
3128
|
-
*/
|
|
3129
|
-
function setRef(ref, value) {
|
|
3130
|
-
if (typeof ref === 'function') {
|
|
3131
|
-
ref(value);
|
|
3132
|
-
} else if (ref) {
|
|
3133
|
-
ref.current = value;
|
|
3134
|
-
}
|
|
3135
|
-
}
|
|
3136
|
-
|
|
3137
|
-
/**
|
|
3138
|
-
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
|
3139
|
-
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
|
3140
|
-
*
|
|
3141
|
-
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
3142
|
-
* and confirm it doesn't apply to your use-case.
|
|
3143
|
-
*/
|
|
3144
|
-
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
3145
|
-
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
3146
|
-
|
|
3147
|
-
let globalId = 0;
|
|
3148
|
-
function useGlobalId(idOverride) {
|
|
3149
|
-
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
3150
|
-
const id = idOverride || defaultId;
|
|
3151
|
-
React.useEffect(() => {
|
|
3152
|
-
if (defaultId == null) {
|
|
3153
|
-
// Fallback to this default id when possible.
|
|
3154
|
-
// Use the incrementing value for client-side rendering only.
|
|
3155
|
-
// We can't use it server-side.
|
|
3156
|
-
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
3157
|
-
globalId += 1;
|
|
3158
|
-
setDefaultId(`mui-${globalId}`);
|
|
3159
|
-
}
|
|
3160
|
-
}, [defaultId]);
|
|
3161
|
-
return id;
|
|
3162
|
-
}
|
|
3163
|
-
|
|
3164
|
-
// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
3165
|
-
const maybeReactUseId = React['useId'.toString()];
|
|
3166
|
-
/**
|
|
3167
|
-
*
|
|
3168
|
-
* @example <div id={useId()} />
|
|
3169
|
-
* @param idOverride
|
|
3170
|
-
* @returns {string}
|
|
3171
|
-
*/
|
|
3172
|
-
function useId(idOverride) {
|
|
3173
|
-
if (maybeReactUseId !== undefined) {
|
|
3174
|
-
const reactId = maybeReactUseId();
|
|
3175
|
-
return idOverride != null ? idOverride : reactId;
|
|
3176
|
-
}
|
|
3177
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
|
|
3178
|
-
return useGlobalId(idOverride);
|
|
3179
|
-
}
|
|
3180
|
-
|
|
3181
|
-
function unsupportedProp(props, propName, componentName, location, propFullName) {
|
|
3182
|
-
if (process.env.NODE_ENV === 'production') {
|
|
3183
|
-
return null;
|
|
3184
|
-
}
|
|
3185
|
-
const propFullNameSafe = propFullName || propName;
|
|
3186
|
-
if (typeof props[propName] !== 'undefined') {
|
|
3187
|
-
return new Error(`The prop \`${propFullNameSafe}\` is not supported. Please remove it.`);
|
|
3188
|
-
}
|
|
3189
|
-
return null;
|
|
3190
|
-
}
|
|
3191
|
-
|
|
3192
|
-
function useControlled({
|
|
3193
|
-
controlled,
|
|
3194
|
-
default: defaultProp,
|
|
3195
|
-
name,
|
|
3196
|
-
state = 'value'
|
|
3197
|
-
}) {
|
|
3198
|
-
// isControlled is ignored in the hook dependency lists as it should never change.
|
|
3199
|
-
const {
|
|
3200
|
-
current: isControlled
|
|
3201
|
-
} = React.useRef(controlled !== undefined);
|
|
3202
|
-
const [valueState, setValue] = React.useState(defaultProp);
|
|
3203
|
-
const value = isControlled ? controlled : valueState;
|
|
3204
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3205
|
-
React.useEffect(() => {
|
|
3206
|
-
if (isControlled !== (controlled !== undefined)) {
|
|
3207
|
-
console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
|
|
3208
|
-
}
|
|
3209
|
-
}, [state, name, controlled]);
|
|
3210
|
-
const {
|
|
3211
|
-
current: defaultValue
|
|
3212
|
-
} = React.useRef(defaultProp);
|
|
3213
|
-
React.useEffect(() => {
|
|
3214
|
-
if (!isControlled && defaultValue !== defaultProp) {
|
|
3215
|
-
console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\n'));
|
|
3216
|
-
}
|
|
3217
|
-
}, [JSON.stringify(defaultProp)]);
|
|
3218
|
-
}
|
|
3219
|
-
const setValueIfUncontrolled = React.useCallback(newValue => {
|
|
3220
|
-
if (!isControlled) {
|
|
3221
|
-
setValue(newValue);
|
|
3222
|
-
}
|
|
3223
|
-
}, []);
|
|
3224
|
-
return [value, setValueIfUncontrolled];
|
|
3225
|
-
}
|
|
3226
|
-
|
|
3227
|
-
/**
|
|
3228
|
-
* Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
3229
|
-
* See RFC in https://github.com/reactjs/rfcs/pull/220
|
|
3230
|
-
*/
|
|
3231
|
-
|
|
3232
|
-
function useEventCallback(fn) {
|
|
3233
|
-
const ref = React.useRef(fn);
|
|
3234
|
-
useEnhancedEffect$1(() => {
|
|
3235
|
-
ref.current = fn;
|
|
3236
|
-
});
|
|
3237
|
-
return React.useRef((...args) =>
|
|
3238
|
-
// @ts-expect-error hide `this`
|
|
3239
|
-
(0, ref.current)(...args)).current;
|
|
3240
|
-
}
|
|
3241
|
-
|
|
3242
|
-
function useForkRef(...refs) {
|
|
3243
|
-
/**
|
|
3244
|
-
* This will create a new function if the refs passed to this hook change and are all defined.
|
|
3245
|
-
* This means react will call the old forkRef with `null` and the new forkRef
|
|
3246
|
-
* with the ref. Cleanup naturally emerges from this behavior.
|
|
3247
|
-
*/
|
|
3248
|
-
return React.useMemo(() => {
|
|
3249
|
-
if (refs.every(ref => ref == null)) {
|
|
3250
|
-
return null;
|
|
3251
|
-
}
|
|
3252
|
-
return instance => {
|
|
3253
|
-
refs.forEach(ref => {
|
|
3254
|
-
setRef(ref, instance);
|
|
3255
|
-
});
|
|
3256
|
-
};
|
|
3257
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3258
|
-
}, refs);
|
|
3259
|
-
}
|
|
3260
|
-
|
|
3261
|
-
class Timeout {
|
|
3262
|
-
constructor() {
|
|
3263
|
-
this.currentId = null;
|
|
3264
|
-
this.clear = () => {
|
|
3265
|
-
if (this.currentId !== null) {
|
|
3266
|
-
clearTimeout(this.currentId);
|
|
3267
|
-
this.currentId = null;
|
|
3268
|
-
}
|
|
3269
|
-
};
|
|
3270
|
-
this.disposeEffect = () => {
|
|
3271
|
-
return this.clear;
|
|
3272
|
-
};
|
|
3273
|
-
}
|
|
3274
|
-
static create() {
|
|
3275
|
-
return new Timeout();
|
|
3276
|
-
}
|
|
3277
|
-
/**
|
|
3278
|
-
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
3279
|
-
*/
|
|
3280
|
-
start(delay, fn) {
|
|
3281
|
-
this.clear();
|
|
3282
|
-
this.currentId = setTimeout(() => {
|
|
3283
|
-
this.currentId = null;
|
|
3284
|
-
fn();
|
|
3285
|
-
}, delay);
|
|
3286
|
-
}
|
|
3287
|
-
}
|
|
3288
|
-
|
|
3289
|
-
let hadKeyboardEvent = true;
|
|
3290
|
-
let hadFocusVisibleRecently = false;
|
|
3291
|
-
const hadFocusVisibleRecentlyTimeout = new Timeout();
|
|
3292
|
-
const inputTypesWhitelist = {
|
|
3293
|
-
text: true,
|
|
3294
|
-
search: true,
|
|
3295
|
-
url: true,
|
|
3296
|
-
tel: true,
|
|
3297
|
-
email: true,
|
|
3298
|
-
password: true,
|
|
3299
|
-
number: true,
|
|
3300
|
-
date: true,
|
|
3301
|
-
month: true,
|
|
3302
|
-
week: true,
|
|
3303
|
-
time: true,
|
|
3304
|
-
datetime: true,
|
|
3305
|
-
'datetime-local': true
|
|
3306
|
-
};
|
|
3307
|
-
|
|
3308
|
-
/**
|
|
3309
|
-
* Computes whether the given element should automatically trigger the
|
|
3310
|
-
* `focus-visible` class being added, i.e. whether it should always match
|
|
3311
|
-
* `:focus-visible` when focused.
|
|
3312
|
-
* @param {Element} node
|
|
3313
|
-
* @returns {boolean}
|
|
3314
|
-
*/
|
|
3315
|
-
function focusTriggersKeyboardModality(node) {
|
|
3316
|
-
const {
|
|
3317
|
-
type,
|
|
3318
|
-
tagName
|
|
3319
|
-
} = node;
|
|
3320
|
-
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
|
|
3321
|
-
return true;
|
|
3322
|
-
}
|
|
3323
|
-
if (tagName === 'TEXTAREA' && !node.readOnly) {
|
|
3324
|
-
return true;
|
|
3325
|
-
}
|
|
3326
|
-
if (node.isContentEditable) {
|
|
3327
|
-
return true;
|
|
3328
|
-
}
|
|
3329
|
-
return false;
|
|
3330
|
-
}
|
|
3331
|
-
|
|
3332
|
-
/**
|
|
3333
|
-
* Keep track of our keyboard modality state with `hadKeyboardEvent`.
|
|
3334
|
-
* If the most recent user interaction was via the keyboard;
|
|
3335
|
-
* and the key press did not include a meta, alt/option, or control key;
|
|
3336
|
-
* then the modality is keyboard. Otherwise, the modality is not keyboard.
|
|
3337
|
-
* @param {KeyboardEvent} event
|
|
3338
|
-
*/
|
|
3339
|
-
function handleKeyDown(event) {
|
|
3340
|
-
if (event.metaKey || event.altKey || event.ctrlKey) {
|
|
3341
|
-
return;
|
|
3342
|
-
}
|
|
3343
|
-
hadKeyboardEvent = true;
|
|
3344
|
-
}
|
|
3345
|
-
|
|
3346
|
-
/**
|
|
3347
|
-
* If at any point a user clicks with a pointing device, ensure that we change
|
|
3348
|
-
* the modality away from keyboard.
|
|
3349
|
-
* This avoids the situation where a user presses a key on an already focused
|
|
3350
|
-
* element, and then clicks on a different element, focusing it with a
|
|
3351
|
-
* pointing device, while we still think we're in keyboard modality.
|
|
3352
|
-
*/
|
|
3353
|
-
function handlePointerDown() {
|
|
3354
|
-
hadKeyboardEvent = false;
|
|
3355
|
-
}
|
|
3356
|
-
function handleVisibilityChange() {
|
|
3357
|
-
if (this.visibilityState === 'hidden') {
|
|
3358
|
-
// If the tab becomes active again, the browser will handle calling focus
|
|
3359
|
-
// on the element (Safari actually calls it twice).
|
|
3360
|
-
// If this tab change caused a blur on an element with focus-visible,
|
|
3361
|
-
// re-apply the class when the user switches back to the tab.
|
|
3362
|
-
if (hadFocusVisibleRecently) {
|
|
3363
|
-
hadKeyboardEvent = true;
|
|
3364
|
-
}
|
|
3365
|
-
}
|
|
3366
|
-
}
|
|
3367
|
-
function prepare(doc) {
|
|
3368
|
-
doc.addEventListener('keydown', handleKeyDown, true);
|
|
3369
|
-
doc.addEventListener('mousedown', handlePointerDown, true);
|
|
3370
|
-
doc.addEventListener('pointerdown', handlePointerDown, true);
|
|
3371
|
-
doc.addEventListener('touchstart', handlePointerDown, true);
|
|
3372
|
-
doc.addEventListener('visibilitychange', handleVisibilityChange, true);
|
|
3373
|
-
}
|
|
3374
|
-
function isFocusVisible(event) {
|
|
3375
|
-
const {
|
|
3376
|
-
target
|
|
3377
|
-
} = event;
|
|
3378
|
-
try {
|
|
3379
|
-
return target.matches(':focus-visible');
|
|
3380
|
-
} catch (error) {
|
|
3381
|
-
// Browsers not implementing :focus-visible will throw a SyntaxError.
|
|
3382
|
-
// We use our own heuristic for those browsers.
|
|
3383
|
-
// Rethrow might be better if it's not the expected error but do we really
|
|
3384
|
-
// want to crash if focus-visible malfunctioned?
|
|
3385
|
-
}
|
|
3386
|
-
|
|
3387
|
-
// No need for validFocusTarget check. The user does that by attaching it to
|
|
3388
|
-
// focusable events only.
|
|
3389
|
-
return hadKeyboardEvent || focusTriggersKeyboardModality(target);
|
|
3390
|
-
}
|
|
3391
|
-
function useIsFocusVisible() {
|
|
3392
|
-
const ref = React.useCallback(node => {
|
|
3393
|
-
if (node != null) {
|
|
3394
|
-
prepare(node.ownerDocument);
|
|
3395
|
-
}
|
|
3396
|
-
}, []);
|
|
3397
|
-
const isFocusVisibleRef = React.useRef(false);
|
|
3398
|
-
|
|
3399
|
-
/**
|
|
3400
|
-
* Should be called if a blur event is fired
|
|
3401
|
-
*/
|
|
3402
|
-
function handleBlurVisible() {
|
|
3403
|
-
// checking against potential state variable does not suffice if we focus and blur synchronously.
|
|
3404
|
-
// React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
|
|
3405
|
-
// Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
|
|
3406
|
-
// This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
|
|
3407
|
-
// TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
|
|
3408
|
-
if (isFocusVisibleRef.current) {
|
|
3409
|
-
// To detect a tab/window switch, we look for a blur event followed
|
|
3410
|
-
// rapidly by a visibility change.
|
|
3411
|
-
// If we don't see a visibility change within 100ms, it's probably a
|
|
3412
|
-
// regular focus change.
|
|
3413
|
-
hadFocusVisibleRecently = true;
|
|
3414
|
-
hadFocusVisibleRecentlyTimeout.start(100, () => {
|
|
3415
|
-
hadFocusVisibleRecently = false;
|
|
3416
|
-
});
|
|
3417
|
-
isFocusVisibleRef.current = false;
|
|
3418
|
-
return true;
|
|
3419
|
-
}
|
|
3420
|
-
return false;
|
|
3421
|
-
}
|
|
3422
|
-
|
|
3423
|
-
/**
|
|
3424
|
-
* Should be called if a blur event is fired
|
|
3425
|
-
*/
|
|
3426
|
-
function handleFocusVisible(event) {
|
|
3427
|
-
if (isFocusVisible(event)) {
|
|
3428
|
-
isFocusVisibleRef.current = true;
|
|
3429
|
-
return true;
|
|
3430
|
-
}
|
|
3431
|
-
return false;
|
|
3432
|
-
}
|
|
3433
|
-
return {
|
|
3434
|
-
isFocusVisibleRef,
|
|
3435
|
-
onFocus: handleFocusVisible,
|
|
3436
|
-
onBlur: handleBlurVisible,
|
|
3437
|
-
ref
|
|
3438
|
-
};
|
|
3439
|
-
}
|
|
3440
|
-
|
|
3441
3025
|
/**
|
|
3442
3026
|
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
3443
3027
|
* @param {object} defaultProps
|
|
@@ -7051,7 +6635,7 @@ var require$$1 = /*@__PURE__*/getAugmentedNamespace(formatMuiErrorMessage);
|
|
|
7051
6635
|
|
|
7052
6636
|
var require$$2 = /*@__PURE__*/getAugmentedNamespace(clamp);
|
|
7053
6637
|
|
|
7054
|
-
var _interopRequireDefault$
|
|
6638
|
+
var _interopRequireDefault$1 = interopRequireDefaultExports;
|
|
7055
6639
|
Object.defineProperty(colorManipulator, "__esModule", {
|
|
7056
6640
|
value: true
|
|
7057
6641
|
});
|
|
@@ -7073,8 +6657,8 @@ colorManipulator.private_safeEmphasize = private_safeEmphasize;
|
|
|
7073
6657
|
colorManipulator.private_safeLighten = private_safeLighten;
|
|
7074
6658
|
colorManipulator.recomposeColor = recomposeColor;
|
|
7075
6659
|
colorManipulator.rgbToHex = rgbToHex;
|
|
7076
|
-
var _formatMuiErrorMessage2 = _interopRequireDefault$
|
|
7077
|
-
var _clamp = _interopRequireDefault$
|
|
6660
|
+
var _formatMuiErrorMessage2 = _interopRequireDefault$1(require$$1);
|
|
6661
|
+
var _clamp = _interopRequireDefault$1(require$$2);
|
|
7078
6662
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
7079
6663
|
|
|
7080
6664
|
/**
|
|
@@ -8196,21 +7780,21 @@ var require$$7 = /*@__PURE__*/getAugmentedNamespace(createTheme$1);
|
|
|
8196
7780
|
|
|
8197
7781
|
var require$$8 = /*@__PURE__*/getAugmentedNamespace(styleFunctionSx);
|
|
8198
7782
|
|
|
8199
|
-
var _interopRequireDefault
|
|
7783
|
+
var _interopRequireDefault = interopRequireDefaultExports;
|
|
8200
7784
|
Object.defineProperty(createStyled$1, "__esModule", {
|
|
8201
7785
|
value: true
|
|
8202
7786
|
});
|
|
8203
7787
|
var _default = createStyled$1.default = createStyled;
|
|
8204
7788
|
createStyled$1.shouldForwardProp = shouldForwardProp;
|
|
8205
7789
|
createStyled$1.systemDefaultTheme = void 0;
|
|
8206
|
-
var _extends2 = _interopRequireDefault
|
|
8207
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault
|
|
7790
|
+
var _extends2 = _interopRequireDefault(require_extends());
|
|
7791
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(requireObjectWithoutPropertiesLoose());
|
|
8208
7792
|
var _styledEngine = _interopRequireWildcard(require$$3);
|
|
8209
7793
|
var _deepmerge = require$$4;
|
|
8210
|
-
var _capitalize = _interopRequireDefault
|
|
8211
|
-
var _getDisplayName = _interopRequireDefault
|
|
8212
|
-
var _createTheme = _interopRequireDefault
|
|
8213
|
-
var _styleFunctionSx = _interopRequireDefault
|
|
7794
|
+
var _capitalize = _interopRequireDefault(require$$5);
|
|
7795
|
+
var _getDisplayName = _interopRequireDefault(require$$6);
|
|
7796
|
+
var _createTheme = _interopRequireDefault(require$$7);
|
|
7797
|
+
var _styleFunctionSx = _interopRequireDefault(require$$8);
|
|
8214
7798
|
const _excluded$1 = ["ownerState"],
|
|
8215
7799
|
_excluded2 = ["variants"],
|
|
8216
7800
|
_excluded3 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
@@ -8640,7 +8224,7 @@ process.env.NODE_ENV !== "production" ? SvgIcon.propTypes /* remove-proptypes */
|
|
|
8640
8224
|
SvgIcon.muiName = 'SvgIcon';
|
|
8641
8225
|
var SvgIcon$1 = SvgIcon;
|
|
8642
8226
|
|
|
8643
|
-
function createSvgIcon
|
|
8227
|
+
function createSvgIcon(path, displayName) {
|
|
8644
8228
|
function Component(props, ref) {
|
|
8645
8229
|
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon$1, _extends$1({
|
|
8646
8230
|
"data-testid": `${displayName}Icon`,
|
|
@@ -8658,127 +8242,45 @@ function createSvgIcon$1(path, displayName) {
|
|
|
8658
8242
|
return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));
|
|
8659
8243
|
}
|
|
8660
8244
|
|
|
8661
|
-
|
|
8662
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8663
|
-
const unstable_ClassNameGenerator = {
|
|
8664
|
-
configure: generator => {
|
|
8665
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
8666
|
-
console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', "You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\n'));
|
|
8667
|
-
}
|
|
8668
|
-
ClassNameGenerator$1.configure(generator);
|
|
8669
|
-
}
|
|
8670
|
-
};
|
|
8671
|
-
|
|
8672
|
-
var utils = /*#__PURE__*/Object.freeze({
|
|
8673
|
-
__proto__: null,
|
|
8674
|
-
capitalize: capitalize$1,
|
|
8675
|
-
createChainedFunction: createChainedFunction,
|
|
8676
|
-
createSvgIcon: createSvgIcon$1,
|
|
8677
|
-
debounce: debounce,
|
|
8678
|
-
deprecatedPropType: deprecatedPropType,
|
|
8679
|
-
isMuiElement: isMuiElement,
|
|
8680
|
-
ownerDocument: ownerDocument,
|
|
8681
|
-
ownerWindow: ownerWindow,
|
|
8682
|
-
requirePropFactory: requirePropFactory,
|
|
8683
|
-
setRef: setRef,
|
|
8684
|
-
unstable_ClassNameGenerator: unstable_ClassNameGenerator,
|
|
8685
|
-
unstable_useEnhancedEffect: useEnhancedEffect$1,
|
|
8686
|
-
unstable_useId: useId,
|
|
8687
|
-
unsupportedProp: unsupportedProp,
|
|
8688
|
-
useControlled: useControlled,
|
|
8689
|
-
useEventCallback: useEventCallback,
|
|
8690
|
-
useForkRef: useForkRef,
|
|
8691
|
-
useIsFocusVisible: useIsFocusVisible
|
|
8692
|
-
});
|
|
8693
|
-
|
|
8694
|
-
var Email = createSvgIcon$1( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8245
|
+
var Email = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8695
8246
|
d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"
|
|
8696
8247
|
}), 'Email');
|
|
8697
8248
|
|
|
8698
|
-
var Facebook = createSvgIcon
|
|
8249
|
+
var Facebook = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8699
8250
|
d: "M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m13 2h-2.5A3.5 3.5 0 0 0 12 8.5V11h-2v3h2v7h3v-7h3v-3h-3V9a1 1 0 0 1 1-1h2V5z"
|
|
8700
8251
|
}), 'Facebook');
|
|
8701
8252
|
|
|
8702
|
-
var Handyman = createSvgIcon
|
|
8253
|
+
var Handyman = createSvgIcon([/*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8703
8254
|
d: "m21.67 18.17-5.3-5.3h-.99l-2.54 2.54v.99l5.3 5.3c.39.39 1.02.39 1.41 0l2.12-2.12c.39-.38.39-1.02 0-1.41"
|
|
8704
8255
|
}, "0"), /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8705
8256
|
d: "m17.34 10.19 1.41-1.41 2.12 2.12c1.17-1.17 1.17-3.07 0-4.24l-3.54-3.54-1.41 1.41V1.71l-.7-.71-3.54 3.54.71.71h2.83l-1.41 1.41 1.06 1.06-2.89 2.89-4.13-4.13V5.06L4.83 2.04 2 4.87 5.03 7.9h1.41l4.13 4.13-.85.85H7.6l-5.3 5.3c-.39.39-.39 1.02 0 1.41l2.12 2.12c.39.39 1.02.39 1.41 0l5.3-5.3v-2.12l5.15-5.15z"
|
|
8706
8257
|
}, "1")], 'Handyman');
|
|
8707
8258
|
|
|
8708
|
-
var Instagram = createSvgIcon
|
|
8259
|
+
var Instagram = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8709
8260
|
d: "M7.8 2h8.4C19.4 2 22 4.6 22 7.8v8.4a5.8 5.8 0 0 1-5.8 5.8H7.8C4.6 22 2 19.4 2 16.2V7.8A5.8 5.8 0 0 1 7.8 2m-.2 2A3.6 3.6 0 0 0 4 7.6v8.8C4 18.39 5.61 20 7.6 20h8.8a3.6 3.6 0 0 0 3.6-3.6V7.6C20 5.61 18.39 4 16.4 4H7.6m9.65 1.5a1.25 1.25 0 0 1 1.25 1.25A1.25 1.25 0 0 1 17.25 8 1.25 1.25 0 0 1 16 6.75a1.25 1.25 0 0 1 1.25-1.25M12 7a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-5-5 5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3z"
|
|
8710
8261
|
}), 'Instagram');
|
|
8711
8262
|
|
|
8712
|
-
var
|
|
8263
|
+
var OpenInNew = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8264
|
+
d: "M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"
|
|
8265
|
+
}), 'OpenInNew');
|
|
8266
|
+
|
|
8267
|
+
var PhoneEnabled = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8713
8268
|
d: "m17.38 10.79-2.2-2.2c-.28-.28-.36-.67-.25-1.02.37-1.12.57-2.32.57-3.57 0-.55.45-1 1-1H20c.55 0 1 .45 1 1 0 9.39-7.61 17-17 17-.55 0-1-.45-1-1v-3.49c0-.55.45-1 1-1 1.24 0 2.45-.2 3.57-.57.35-.12.75-.03 1.02.24l2.2 2.2c2.83-1.45 5.15-3.76 6.59-6.59"
|
|
8714
8269
|
}), 'PhoneEnabled');
|
|
8715
8270
|
|
|
8716
|
-
var ThreeP = createSvgIcon
|
|
8271
|
+
var ThreeP = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8717
8272
|
d: "M20 2H4.01c-1.1 0-2 .9-2 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8 4c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m4 8H8v-.57c0-.81.48-1.53 1.22-1.85.85-.37 1.79-.58 2.78-.58.99 0 1.93.21 2.78.58.74.32 1.22 1.04 1.22 1.85z"
|
|
8718
8273
|
}), 'ThreeP');
|
|
8719
8274
|
|
|
8720
|
-
var WhatsApp = createSvgIcon
|
|
8275
|
+
var WhatsApp = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8721
8276
|
d: "M16.75 13.96c.25.13.41.2.46.3.06.11.04.61-.21 1.18-.2.56-1.24 1.1-1.7 1.12-.46.02-.47.36-2.96-.73-2.49-1.09-3.99-3.75-4.11-3.92-.12-.17-.96-1.38-.92-2.61.05-1.22.69-1.8.95-2.04.24-.26.51-.29.68-.26h.47c.15 0 .36-.06.55.45l.69 1.87c.06.13.1.28.01.44l-.27.41-.39.42c-.12.12-.26.25-.12.5.12.26.62 1.09 1.32 1.78.91.88 1.71 1.17 1.95 1.3.24.14.39.12.54-.04l.81-.94c.19-.25.35-.19.58-.11l1.67.88M12 2a10 10 0 0 1 10 10 10 10 0 0 1-10 10c-1.97 0-3.8-.57-5.35-1.55L2 22l1.55-4.65A9.969 9.969 0 0 1 2 12 10 10 0 0 1 12 2m0 2a8 8 0 0 0-8 8c0 1.72.54 3.31 1.46 4.61L4.5 19.5l2.89-.96A7.95 7.95 0 0 0 12 20a8 8 0 0 0 8-8 8 8 0 0 0-8-8z"
|
|
8722
8277
|
}), 'WhatsApp');
|
|
8723
8278
|
|
|
8724
|
-
var ArrowForward = {};
|
|
8725
|
-
|
|
8726
|
-
var createSvgIcon = {};
|
|
8727
|
-
|
|
8728
|
-
var require$$0 = /*@__PURE__*/getAugmentedNamespace(utils);
|
|
8729
|
-
|
|
8730
|
-
var hasRequiredCreateSvgIcon;
|
|
8731
|
-
|
|
8732
|
-
function requireCreateSvgIcon () {
|
|
8733
|
-
if (hasRequiredCreateSvgIcon) return createSvgIcon;
|
|
8734
|
-
hasRequiredCreateSvgIcon = 1;
|
|
8735
|
-
(function (exports) {
|
|
8736
|
-
'use client';
|
|
8737
|
-
|
|
8738
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8739
|
-
value: true
|
|
8740
|
-
});
|
|
8741
|
-
Object.defineProperty(exports, "default", {
|
|
8742
|
-
enumerable: true,
|
|
8743
|
-
get: function () {
|
|
8744
|
-
return _utils.createSvgIcon;
|
|
8745
|
-
}
|
|
8746
|
-
});
|
|
8747
|
-
var _utils = require$$0;
|
|
8748
|
-
} (createSvgIcon));
|
|
8749
|
-
return createSvgIcon;
|
|
8750
|
-
}
|
|
8751
|
-
|
|
8752
|
-
var _interopRequireDefault$1 = interopRequireDefaultExports;
|
|
8753
|
-
Object.defineProperty(ArrowForward, "__esModule", {
|
|
8754
|
-
value: true
|
|
8755
|
-
});
|
|
8756
|
-
var default_1$1 = ArrowForward.default = void 0;
|
|
8757
|
-
var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon());
|
|
8758
|
-
var _jsxRuntime$1 = jsxRuntimeExports;
|
|
8759
|
-
default_1$1 = ArrowForward.default = (0, _createSvgIcon$1.default)( /*#__PURE__*/(0, _jsxRuntime$1.jsx)("path", {
|
|
8760
|
-
d: "m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"
|
|
8761
|
-
}), 'ArrowForward');
|
|
8762
|
-
|
|
8763
|
-
var Message = {};
|
|
8764
|
-
|
|
8765
|
-
var _interopRequireDefault = interopRequireDefaultExports;
|
|
8766
|
-
Object.defineProperty(Message, "__esModule", {
|
|
8767
|
-
value: true
|
|
8768
|
-
});
|
|
8769
|
-
var default_1 = Message.default = void 0;
|
|
8770
|
-
var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
|
|
8771
|
-
var _jsxRuntime = jsxRuntimeExports;
|
|
8772
|
-
default_1 = Message.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
8773
|
-
d: "M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"
|
|
8774
|
-
}), 'Message');
|
|
8775
|
-
|
|
8776
8279
|
const ButtonsContainer = styled$3(Box)(({ theme }) => ({
|
|
8777
8280
|
position: 'absolute',
|
|
8778
8281
|
top: 8,
|
|
8779
8282
|
right: 8,
|
|
8780
8283
|
display: 'flex',
|
|
8781
|
-
flexDirection: 'column',
|
|
8782
8284
|
gap: 4,
|
|
8783
8285
|
zIndex: 1,
|
|
8784
8286
|
//@ts-ignore
|
|
@@ -8792,7 +8294,6 @@ const HeaderContainer = styled$3(Box)({
|
|
|
8792
8294
|
flexDirection: 'column',
|
|
8793
8295
|
alignItems: 'center',
|
|
8794
8296
|
marginBottom: '16px',
|
|
8795
|
-
position: 'relative',
|
|
8796
8297
|
});
|
|
8797
8298
|
const ContactAvatar = styled$3(Avatar)({
|
|
8798
8299
|
width: 60,
|
|
@@ -8806,57 +8307,14 @@ const ContactName = styled$3(Typography)({
|
|
|
8806
8307
|
maxWidth: 200,
|
|
8807
8308
|
textAlign: 'center',
|
|
8808
8309
|
});
|
|
8809
|
-
const
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
});
|
|
8817
|
-
const Header = ({ imgUrl, name, contactId, navigate, isLoading = false, onError, onClose, }) => {
|
|
8818
|
-
const handleNavigation = useCallback((url) => (event) => {
|
|
8819
|
-
try {
|
|
8820
|
-
event.preventDefault();
|
|
8821
|
-
event.stopPropagation();
|
|
8822
|
-
if (!url) {
|
|
8823
|
-
throw new Error('Navigation URL is required');
|
|
8824
|
-
}
|
|
8825
|
-
const isNewTab = event.ctrlKey || event.metaKey || event.button === 1; // Ctrl+Click, Cmd+Click, Middle Mouse
|
|
8826
|
-
if (isNewTab) {
|
|
8827
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
8828
|
-
}
|
|
8829
|
-
else {
|
|
8830
|
-
navigate(url);
|
|
8831
|
-
}
|
|
8832
|
-
}
|
|
8833
|
-
catch (error) {
|
|
8834
|
-
onError?.(error instanceof Error ? error : new Error('Navigation failed'));
|
|
8835
|
-
}
|
|
8836
|
-
}, [navigate, onError]);
|
|
8837
|
-
const handleNavigateToContacts = handleNavigation(`/a/contacts/contacts/${contactId}`);
|
|
8838
|
-
const handleNavigateToConversations = handleNavigation('/a/conversations/conversations');
|
|
8839
|
-
const displayName = name || 'Unknown Contact';
|
|
8840
|
-
const avatarAlt = `Avatar for ${displayName}`;
|
|
8841
|
-
return (jsxRuntimeExports.jsxs(HeaderContainer, { children: [jsxRuntimeExports.jsxs(ButtonsContainer, { children: [jsxRuntimeExports.jsx(SmallIconButton, { color: "info", size: "small", onClick: (e) => {
|
|
8842
|
-
handleNavigateToContacts(e);
|
|
8843
|
-
onClose();
|
|
8844
|
-
}, onMouseDown: (e) => {
|
|
8845
|
-
if (e.button === 1) {
|
|
8846
|
-
// Middle mouse button
|
|
8847
|
-
handleNavigateToContacts(e);
|
|
8848
|
-
onClose();
|
|
8849
|
-
}
|
|
8850
|
-
}, disabled: !contactId, "aria-label": "View contact details", children: jsxRuntimeExports.jsx(default_1$1, { fontSize: "small" }) }), jsxRuntimeExports.jsx(SmallIconButton, { color: "info", size: "small", onClick: (e) => {
|
|
8851
|
-
handleNavigateToConversations(e);
|
|
8852
|
-
onClose();
|
|
8853
|
-
}, onMouseDown: (e) => {
|
|
8854
|
-
if (e.button === 1) {
|
|
8855
|
-
// Middle mouse button
|
|
8856
|
-
handleNavigateToConversations(e);
|
|
8857
|
-
onClose();
|
|
8858
|
-
}
|
|
8859
|
-
}, "aria-label": "Go to conversations", children: jsxRuntimeExports.jsx(default_1, { fontSize: "small" }) })] }), isLoading ? (jsxRuntimeExports.jsx(LoadingContainer, { children: jsxRuntimeExports.jsx(CircularProgress, { size: 24 }) })) : (jsxRuntimeExports.jsx(ContactAvatar, { src: imgUrl, alt: avatarAlt, onError: () => onError?.(new Error('Failed to load avatar')) })), jsxRuntimeExports.jsx(ContactName, { variant: "h6", title: displayName, children: displayName })] }));
|
|
8310
|
+
const Header = ({ imgUrl, name, contactId, }) => {
|
|
8311
|
+
const handleOpenInNewTab = (event) => {
|
|
8312
|
+
event.preventDefault();
|
|
8313
|
+
event.stopPropagation();
|
|
8314
|
+
const url = `/a/contacts/contacts/${contactId}`;
|
|
8315
|
+
window.open(url, '_blank');
|
|
8316
|
+
};
|
|
8317
|
+
return (jsxRuntimeExports.jsxs(HeaderContainer, { children: [jsxRuntimeExports.jsx(ButtonsContainer, { children: jsxRuntimeExports.jsx(SmallIconButton, { color: "info", size: "small", onClick: handleOpenInNewTab, children: jsxRuntimeExports.jsx(OpenInNew, { fontSize: "small" }) }) }), jsxRuntimeExports.jsx(ContactAvatar, { src: imgUrl, alt: "Contact Avatar" }), jsxRuntimeExports.jsx(ContactName, { variant: "h6", children: name })] }));
|
|
8860
8318
|
};
|
|
8861
8319
|
|
|
8862
8320
|
const Container$1 = styled$3(Box)({
|
|
@@ -14705,7 +14163,7 @@ const Container = styled$3(Box)({
|
|
|
14705
14163
|
alignItems: 'center',
|
|
14706
14164
|
gap: 8,
|
|
14707
14165
|
});
|
|
14708
|
-
const SectionTitle$
|
|
14166
|
+
const SectionTitle$1 = styled$3(Typography)({
|
|
14709
14167
|
borderBottom: `1px solid lightgray`,
|
|
14710
14168
|
width: '100%',
|
|
14711
14169
|
});
|
|
@@ -14763,100 +14221,7 @@ const Properties = ({ properties, title }) => {
|
|
|
14763
14221
|
}
|
|
14764
14222
|
return value;
|
|
14765
14223
|
};
|
|
14766
|
-
return (jsxRuntimeExports.jsxs(Container, { children: [jsxRuntimeExports.jsx(SectionTitle$
|
|
14767
|
-
};
|
|
14768
|
-
|
|
14769
|
-
const SectionTitle$2 = styled$3(Typography)({
|
|
14770
|
-
fontWeight: 'bold',
|
|
14771
|
-
marginBottom: '8px',
|
|
14772
|
-
marginTop: '16px',
|
|
14773
|
-
borderBottom: `1px solid lightgray`,
|
|
14774
|
-
});
|
|
14775
|
-
const TagContainer = styled$3(Box)({
|
|
14776
|
-
marginBottom: 16,
|
|
14777
|
-
});
|
|
14778
|
-
const StyledChip = styled$3(Chip)(({ theme }) => ({
|
|
14779
|
-
marginRight: 8,
|
|
14780
|
-
marginBottom: 8,
|
|
14781
|
-
backgroundColor: `${theme.palette.primary.main}b3`,
|
|
14782
|
-
}));
|
|
14783
|
-
const LabelsSection = ({ contactData, title }) => {
|
|
14784
|
-
if (!contactData)
|
|
14785
|
-
return null;
|
|
14786
|
-
if (!contactData.tags?.length)
|
|
14787
|
-
return null;
|
|
14788
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(SectionTitle$2, { gutterBottom: true, mt: 2, variant: "subtitle1", children: title }), jsxRuntimeExports.jsx(TagContainer, { children: contactData?.tags
|
|
14789
|
-
?.filter((tag) => tag.name?.trim())
|
|
14790
|
-
.map((tag) => (jsxRuntimeExports.jsx(StyledChip, { label: tag.name, color: "primary", size: "small" }, tag.id))) })] }));
|
|
14791
|
-
};
|
|
14792
|
-
|
|
14793
|
-
/**
|
|
14794
|
-
* Type guard to check if an object is an IContact
|
|
14795
|
-
* @param obj The object to check
|
|
14796
|
-
* @returns True if the object is an IContact
|
|
14797
|
-
*/
|
|
14798
|
-
function isContact(obj) {
|
|
14799
|
-
return (obj !== null &&
|
|
14800
|
-
typeof obj === 'object' &&
|
|
14801
|
-
typeof obj.id === 'string' &&
|
|
14802
|
-
typeof obj.spaceId === 'string' &&
|
|
14803
|
-
typeof obj.name === 'string' &&
|
|
14804
|
-
typeof obj.firstName === 'string' &&
|
|
14805
|
-
typeof obj.lastName === 'string' &&
|
|
14806
|
-
Array.isArray(obj.phones) &&
|
|
14807
|
-
Array.isArray(obj.emails) &&
|
|
14808
|
-
'origin' in obj &&
|
|
14809
|
-
typeof obj.isSpam === 'boolean' &&
|
|
14810
|
-
(!obj.businessId || typeof obj.businessId === 'string'));
|
|
14811
|
-
}
|
|
14812
|
-
|
|
14813
|
-
const SectionTitle$1 = styled$3(Typography)({
|
|
14814
|
-
fontWeight: 'bold',
|
|
14815
|
-
marginBottom: '8px',
|
|
14816
|
-
marginTop: '16px',
|
|
14817
|
-
borderBottom: `1px solid lightgray`,
|
|
14818
|
-
});
|
|
14819
|
-
const BusinessSection = ({ contactData, title }) => {
|
|
14820
|
-
if (!contactData || !isContact(contactData))
|
|
14821
|
-
return null;
|
|
14822
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(SectionTitle$1, { gutterBottom: true, mt: 2, variant: "subtitle1", children: title }), jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: contactData?.businessName })] }));
|
|
14823
|
-
};
|
|
14824
|
-
|
|
14825
|
-
/**
|
|
14826
|
-
* Type guard to check if an object is an IBusiness
|
|
14827
|
-
* @param obj The object to check
|
|
14828
|
-
* @returns True if the object is an IBusiness
|
|
14829
|
-
*/
|
|
14830
|
-
function isBusiness(obj) {
|
|
14831
|
-
return (obj !== null &&
|
|
14832
|
-
typeof obj === 'object' &&
|
|
14833
|
-
typeof obj.id === 'string' &&
|
|
14834
|
-
typeof obj.spaceId === 'string' &&
|
|
14835
|
-
typeof obj.name === 'string' &&
|
|
14836
|
-
Array.isArray(obj.membersId) &&
|
|
14837
|
-
Array.isArray(obj.members) &&
|
|
14838
|
-
Array.isArray(obj.phones) &&
|
|
14839
|
-
Array.isArray(obj.emails) &&
|
|
14840
|
-
typeof obj.imageUrl === 'string' &&
|
|
14841
|
-
!('firstName' in obj) &&
|
|
14842
|
-
!('lastName' in obj));
|
|
14843
|
-
}
|
|
14844
|
-
|
|
14845
|
-
// Components
|
|
14846
|
-
const MemberItem = ({ name }) => {
|
|
14847
|
-
return (jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: name }));
|
|
14848
|
-
};
|
|
14849
|
-
|
|
14850
|
-
const SectionTitle = styled$3(Typography)({
|
|
14851
|
-
fontWeight: 'bold',
|
|
14852
|
-
marginBottom: '8px',
|
|
14853
|
-
marginTop: '16px',
|
|
14854
|
-
borderBottom: `1px solid lightgray`,
|
|
14855
|
-
});
|
|
14856
|
-
const MembersSection = ({ contactData, title }) => {
|
|
14857
|
-
if (!contactData || !isBusiness(contactData) || !contactData.members?.length)
|
|
14858
|
-
return null;
|
|
14859
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(SectionTitle, { gutterBottom: true, mt: 2, variant: "subtitle1", children: title }), jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: contactData?.members.map((member) => (jsxRuntimeExports.jsx(MemberItem, { name: member.name }, member.id))) })] }));
|
|
14224
|
+
return (jsxRuntimeExports.jsxs(Container, { children: [jsxRuntimeExports.jsx(SectionTitle$1, { fontWeight: "bold", gutterBottom: true, mt: 2, variant: "subtitle1", children: title }), properties?.map((property, i) => property.value.length > 0 && (jsxRuntimeExports.jsxs(PropertyItem, { children: [jsxRuntimeExports.jsx(PropertyIcon, {}), jsxRuntimeExports.jsxs(PropertyText, { children: [getPropertyTitle(property.nameKey), ":", ' ', formatPropertyValue(property.value, property.type)] })] }, i)))] }));
|
|
14860
14225
|
};
|
|
14861
14226
|
|
|
14862
14227
|
const PopupContainer = styled$3(Box)(({ theme }) => ({
|
|
@@ -14886,17 +14251,28 @@ const PopupContainer = styled$3(Box)(({ theme }) => ({
|
|
|
14886
14251
|
background: '#616161',
|
|
14887
14252
|
},
|
|
14888
14253
|
}));
|
|
14889
|
-
const
|
|
14254
|
+
const SectionTitle = styled$3(Typography)({
|
|
14255
|
+
fontWeight: 'bold',
|
|
14256
|
+
marginBottom: '8px',
|
|
14257
|
+
marginTop: '16px',
|
|
14258
|
+
borderBottom: `1px solid lightgray`,
|
|
14259
|
+
});
|
|
14260
|
+
const TagContainer = styled$3(Box)({
|
|
14261
|
+
marginBottom: 16,
|
|
14262
|
+
});
|
|
14263
|
+
const StyledChip = styled$3(Chip)(({ theme }) => ({
|
|
14264
|
+
marginRight: 8,
|
|
14265
|
+
marginBottom: 8,
|
|
14266
|
+
backgroundColor: `${theme.palette.primary.main}b3`
|
|
14267
|
+
}));
|
|
14268
|
+
const ContactInfoPopup = ({ open, anchorEl, onClose, contactData, avatarImgUrl, t = (key) => ({
|
|
14890
14269
|
labels: 'Etiquetas',
|
|
14891
14270
|
phone: 'Teléfono',
|
|
14892
14271
|
business: 'Empresa',
|
|
14893
|
-
businessMembers: 'Miembros de la empresa',
|
|
14894
14272
|
properties: 'Propiedades',
|
|
14895
14273
|
view: 'Ver',
|
|
14896
|
-
|
|
14274
|
+
'E-mail Address': 'Correo Electrónico'
|
|
14897
14275
|
}[key] || key), }) => {
|
|
14898
|
-
const dataIsBusiness = isBusiness(contactData);
|
|
14899
|
-
const dataIsContact = isContact(contactData);
|
|
14900
14276
|
const contactMethods = [
|
|
14901
14277
|
{
|
|
14902
14278
|
icon: jsxRuntimeExports.jsx(PhoneEnabled, { fontSize: "small" }),
|
|
@@ -14906,7 +14282,7 @@ const ContactInfoPopup = ({ open, anchorEl, onClose, contactData, avatarImgUrl,
|
|
|
14906
14282
|
},
|
|
14907
14283
|
{
|
|
14908
14284
|
icon: jsxRuntimeExports.jsx(Email, { fontSize: "small" }),
|
|
14909
|
-
title: t('
|
|
14285
|
+
title: t('E-mail Address'),
|
|
14910
14286
|
contactList: contactData?.emails || [],
|
|
14911
14287
|
showTitle: true,
|
|
14912
14288
|
},
|
|
@@ -14945,7 +14321,7 @@ const ContactInfoPopup = ({ open, anchorEl, onClose, contactData, avatarImgUrl,
|
|
|
14945
14321
|
window.removeEventListener('keydown', handleKeyDown);
|
|
14946
14322
|
};
|
|
14947
14323
|
}, [open, onClose]);
|
|
14948
|
-
return (jsxRuntimeExports.jsx(Popper, { sx: { zIndex: 1300 }, open: open, anchorEl: anchorEl, placement: "bottom-start", "data-popper-child": "true", children: jsxRuntimeExports.jsx(ClickAwayListener, { onClickAway: onClose, children: jsxRuntimeExports.jsx(PopupContainer, { children: jsxRuntimeExports.jsxs(CardContent, { children: [jsxRuntimeExports.jsx(Header, {
|
|
14324
|
+
return (jsxRuntimeExports.jsx(Popper, { sx: { zIndex: 1300 }, open: open, anchorEl: anchorEl, placement: "bottom-start", "data-popper-child": "true", children: jsxRuntimeExports.jsx(ClickAwayListener, { onClickAway: onClose, children: jsxRuntimeExports.jsx(PopupContainer, { children: jsxRuntimeExports.jsxs(CardContent, { children: [jsxRuntimeExports.jsx(Header, { contactId: contactData?.id, imgUrl: avatarImgUrl, name: contactData?.name }), jsxRuntimeExports.jsx(SectionTitle, { gutterBottom: true, mt: 2, variant: "subtitle1", children: t('labels') }), jsxRuntimeExports.jsx(TagContainer, { children: contactData?.tags?.map((tag) => (jsxRuntimeExports.jsx(StyledChip, { label: tag.name, color: "primary", size: "small" }, tag.id))) }), jsxRuntimeExports.jsx(SectionTitle, { gutterBottom: true, mt: 2, variant: "subtitle1", children: t('business') }), jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: contactData?.businessName }), contactMethods.map((method, index) => (jsxRuntimeExports.jsx(ContactMethod, { icon: method.icon, title: method.title, contactList: method.contactList, showTitle: method.showTitle }, index))), jsxRuntimeExports.jsx(Properties, { properties: contactData?.properties, title: t('properties') })] }) }) }) }));
|
|
14949
14325
|
};
|
|
14950
14326
|
|
|
14951
14327
|
export { ContactInfoPopup, TestBox };
|