@veeqo/ui 11.4.2 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,40 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
+ var buildClassnames = require('../../utils/buildClassnames.cjs');
5
+ require('uid/secure');
6
+ var assignCssVars = require('../../utils/assignCssVars.cjs');
7
+ var CriticalIcon = require('../../icons/custom/components/CriticalIcon.cjs');
4
8
  var index = require('../../theme/index.cjs');
5
- var styled = require('./styled.cjs');
9
+ var Avatar_module = require('./Avatar.module.scss.cjs');
10
+ var Text = require('../Text/Text.cjs');
11
+ var FlexRow = require('../Flex/FlexRow/FlexRow.cjs');
6
12
 
7
13
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
14
 
9
15
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
16
 
11
- /* eslint-disable react/no-array-index-key */
12
- const Avatar = ({ width = '40px', name = 'Veeqo', bgColor = index.theme.colors.secondary.blue.base, textColor = '#ffffff', }) => {
13
- const userInitials = name.toUpperCase().match(/\b(\w)/g);
14
- return (React__default.default.createElement(styled.AvatarSC, { width: width, bgColor: bgColor, textColor: textColor, className: "avatar" }, userInitials === null || userInitials === undefined ? undefined : userInitials.slice(0, 2).map((initial, i) => React__default.default.createElement("span", { key: `${initial}-${i}` }, initial))));
17
+ const textVariantMapping = {
18
+ md: 'bodySmallBold',
19
+ lg: 'bodySmallBold',
20
+ xl: 'headingSmall',
21
+ xxl: 'headingMedium',
22
+ };
23
+ const Avatar = ({ size = 'lg', name, bgColor, textColor, iconSlot, imageUrl, hasIndicator = false, ariaLabel = `Avatar of ${name}`, }) => {
24
+ var _a;
25
+ const textVariant = textVariantMapping[size];
26
+ return (React__default.default.createElement(FlexRow.FlexRow, { justifyContent: "center", className: buildClassnames.buildClassnames([Avatar_module.avatar, Avatar_module[`${size}-size`]]), style: {
27
+ ...assignCssVars.assignCssVars({
28
+ avatarBgColor: iconSlot ? index.theme.colors.neutral.grey.lightest : bgColor,
29
+ avatarTextColor: textColor,
30
+ }),
31
+ }, "aria-label": ariaLabel },
32
+ hasIndicator && (React__default.default.createElement(CriticalIcon.CriticalIcon, { className: Avatar_module.indicatorIcon, color: index.theme.colors.secondary.red.base, fill: index.theme.colors.neutral.grey.lightest, role: "status", "aria-live": "polite", "aria-label": "Avatar has an error" })),
33
+ imageUrl && React__default.default.createElement("img", { src: imageUrl, alt: name, className: Avatar_module.avatarImage }),
34
+ !!iconSlot && iconSlot,
35
+ !imageUrl && !iconSlot && (React__default.default.createElement(Text.Text, { variant: textVariant, className: Avatar_module.avatarText }, (_a = name
36
+ .toUpperCase()
37
+ .match(/(\b\w|\+)/g)) === null || _a === undefined ? undefined : _a.slice(0, 2)))));
15
38
  };
16
39
 
17
40
  exports.Avatar = Avatar;
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.cjs","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["/* eslint-disable react/no-array-index-key */\n\nimport React from 'react';\nimport { theme } from '../../theme';\nimport { AvatarSC } from './styled';\nimport { AvatarProps } from './types';\n\nexport const Avatar = ({\n width = '40px',\n name = 'Veeqo',\n bgColor = theme.colors.secondary.blue.base,\n textColor = '#ffffff',\n}: AvatarProps) => {\n const userInitials = name.toUpperCase().match(/\\b(\\w)/g);\n\n return (\n <AvatarSC width={width} bgColor={bgColor} textColor={textColor} className=\"avatar\">\n {userInitials\n ?.slice(0, 2)\n .map((initial, i) => <span key={`${initial}-${i}`}>{initial}</span>)}\n </AvatarSC>\n );\n};\n"],"names":["theme","React","AvatarSC"],"mappings":";;;;;;;;;;AAAA;AAOO,MAAM,MAAM,GAAG,CAAC,EACrB,KAAK,GAAG,MAAM,EACd,IAAI,GAAG,OAAO,EACd,OAAO,GAAGA,WAAK,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAC1C,SAAS,GAAG,SAAS,GACT,KAAI;IAChB,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;IAExD,QACEC,sBAAC,CAAA,aAAA,CAAAC,eAAQ,EAAC,EAAA,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAC,QAAQ,EAC/E,EAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,SAAA,GAAA,SAAA,GAAA,YAAY,CACT,KAAK,CAAC,CAAC,EAAE,CAAC,CAAA,CACX,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,KAAKD,sBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,GAAG,EAAE,CAAA,EAAG,OAAO,CAAA,CAAA,EAAI,CAAC,CAAA,CAAE,EAAG,EAAA,OAAO,CAAQ,CAAC,CAC7D;AAEf;;;;"}
1
+ {"version":3,"file":"Avatar.cjs","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React from 'react';\nimport { assignCssVars, buildClassnames } from '../../utils';\nimport { CriticalIcon } from '../../icons/custom/components/CriticalIcon';\nimport { theme } from '../../theme';\nimport styles from './Avatar.module.scss';\nimport { AvatarProps } from './types';\nimport { Text } from '../Text';\nimport { FlexRow } from '../Flex/FlexRow';\n\nconst textVariantMapping: Record<string, any> = {\n md: 'bodySmallBold',\n lg: 'bodySmallBold',\n xl: 'headingSmall',\n xxl: 'headingMedium',\n};\n\nexport const Avatar = ({\n size = 'lg',\n name,\n bgColor,\n textColor,\n iconSlot,\n imageUrl,\n hasIndicator = false,\n ariaLabel = `Avatar of ${name}`,\n}: AvatarProps) => {\n const textVariant = textVariantMapping[size];\n\n return (\n <FlexRow\n justifyContent=\"center\"\n className={buildClassnames([styles.avatar, styles[`${size}-size`]])}\n style={\n {\n ...assignCssVars({\n avatarBgColor: iconSlot ? theme.colors.neutral.grey.lightest : bgColor,\n avatarTextColor: textColor,\n }),\n } as React.CSSProperties\n }\n aria-label={ariaLabel}\n >\n {hasIndicator && (\n <CriticalIcon\n className={styles.indicatorIcon}\n color={theme.colors.secondary.red.base}\n fill={theme.colors.neutral.grey.lightest}\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"Avatar has an error\"\n />\n )}\n {imageUrl && <img src={imageUrl} alt={name} className={styles.avatarImage} />}\n {!!iconSlot && iconSlot}\n {!imageUrl && !iconSlot && (\n <Text variant={textVariant} className={styles.avatarText}>\n {name\n .toUpperCase()\n .match(/(\\b\\w|\\+)/g)\n ?.slice(0, 2)}\n </Text>\n )}\n </FlexRow>\n );\n};\n"],"names":["React","FlexRow","buildClassnames","styles","assignCssVars","theme","CriticalIcon","Text"],"mappings":";;;;;;;;;;;;;;;;AASA,MAAM,kBAAkB,GAAwB;AAC9C,IAAA,EAAE,EAAE,eAAe;AACnB,IAAA,EAAE,EAAE,eAAe;AACnB,IAAA,EAAE,EAAE,cAAc;AAClB,IAAA,GAAG,EAAE,eAAe;CACrB;AAEM,MAAM,MAAM,GAAG,CAAC,EACrB,IAAI,GAAG,IAAI,EACX,IAAI,EACJ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,GAAG,KAAK,EACpB,SAAS,GAAG,CAAa,UAAA,EAAA,IAAI,CAAE,CAAA,GACnB,KAAI;;AAChB,IAAA,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC;IAE5C,QACEA,sBAAC,CAAA,aAAA,CAAAC,eAAO,EACN,EAAA,cAAc,EAAC,QAAQ,EACvB,SAAS,EAAEC,+BAAe,CAAC,CAACC,aAAM,CAAC,MAAM,EAAEA,aAAM,CAAC,CAAG,EAAA,IAAI,CAAO,KAAA,CAAA,CAAC,CAAC,CAAC,EACnE,KAAK,EACH;AACE,YAAA,GAAGC,2BAAa,CAAC;AACf,gBAAA,aAAa,EAAE,QAAQ,GAAGC,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO;AACtE,gBAAA,eAAe,EAAE,SAAS;aAC3B,CAAC;AACoB,SAAA,EAAA,YAAA,EAEd,SAAS,EAAA;AAEpB,QAAA,YAAY,KACXL,sBAAA,CAAA,aAAA,CAACM,yBAAY,EACX,EAAA,SAAS,EAAEH,aAAM,CAAC,aAAa,EAC/B,KAAK,EAAEE,WAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EACtC,IAAI,EAAEA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EACxC,IAAI,EAAC,QAAQ,EAAA,WAAA,EACH,QAAQ,EACP,YAAA,EAAA,qBAAqB,GAChC,CACH;AACA,QAAA,QAAQ,IAAIL,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAEG,aAAM,CAAC,WAAW,EAAI,CAAA;QAC5E,CAAC,CAAC,QAAQ,IAAI,QAAQ;QACtB,CAAC,QAAQ,IAAI,CAAC,QAAQ,KACrBH,sBAAA,CAAA,aAAA,CAACO,SAAI,EAAC,EAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAEJ,aAAM,CAAC,UAAU,EAAA,EACrD,MAAA;AACE,aAAA,WAAW;AACX,aAAA,KAAK,CAAC,YAAY,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAClB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACV,CACR,CACO;AAEd;;;;"}
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { AvatarProps } from './types';
3
- export declare const Avatar: ({ width, name, bgColor, textColor, }: AvatarProps) => React.JSX.Element;
3
+ export declare const Avatar: ({ size, name, bgColor, textColor, iconSlot, imageUrl, hasIndicator, ariaLabel, }: AvatarProps) => React.JSX.Element;
@@ -1,11 +1,34 @@
1
1
  import React__default from 'react';
2
+ import { buildClassnames } from '../../utils/buildClassnames.js';
3
+ import 'uid/secure';
4
+ import { assignCssVars } from '../../utils/assignCssVars.js';
5
+ import { CriticalIcon } from '../../icons/custom/components/CriticalIcon.js';
2
6
  import { theme } from '../../theme/index.js';
3
- import { AvatarSC } from './styled.js';
7
+ import styles from './Avatar.module.scss.js';
8
+ import { Text } from '../Text/Text.js';
9
+ import { FlexRow } from '../Flex/FlexRow/FlexRow.js';
4
10
 
5
- /* eslint-disable react/no-array-index-key */
6
- const Avatar = ({ width = '40px', name = 'Veeqo', bgColor = theme.colors.secondary.blue.base, textColor = '#ffffff', }) => {
7
- const userInitials = name.toUpperCase().match(/\b(\w)/g);
8
- return (React__default.createElement(AvatarSC, { width: width, bgColor: bgColor, textColor: textColor, className: "avatar" }, userInitials === null || userInitials === undefined ? undefined : userInitials.slice(0, 2).map((initial, i) => React__default.createElement("span", { key: `${initial}-${i}` }, initial))));
11
+ const textVariantMapping = {
12
+ md: 'bodySmallBold',
13
+ lg: 'bodySmallBold',
14
+ xl: 'headingSmall',
15
+ xxl: 'headingMedium',
16
+ };
17
+ const Avatar = ({ size = 'lg', name, bgColor, textColor, iconSlot, imageUrl, hasIndicator = false, ariaLabel = `Avatar of ${name}`, }) => {
18
+ var _a;
19
+ const textVariant = textVariantMapping[size];
20
+ return (React__default.createElement(FlexRow, { justifyContent: "center", className: buildClassnames([styles.avatar, styles[`${size}-size`]]), style: {
21
+ ...assignCssVars({
22
+ avatarBgColor: iconSlot ? theme.colors.neutral.grey.lightest : bgColor,
23
+ avatarTextColor: textColor,
24
+ }),
25
+ }, "aria-label": ariaLabel },
26
+ hasIndicator && (React__default.createElement(CriticalIcon, { className: styles.indicatorIcon, color: theme.colors.secondary.red.base, fill: theme.colors.neutral.grey.lightest, role: "status", "aria-live": "polite", "aria-label": "Avatar has an error" })),
27
+ imageUrl && React__default.createElement("img", { src: imageUrl, alt: name, className: styles.avatarImage }),
28
+ !!iconSlot && iconSlot,
29
+ !imageUrl && !iconSlot && (React__default.createElement(Text, { variant: textVariant, className: styles.avatarText }, (_a = name
30
+ .toUpperCase()
31
+ .match(/(\b\w|\+)/g)) === null || _a === undefined ? undefined : _a.slice(0, 2)))));
9
32
  };
10
33
 
11
34
  export { Avatar };
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["/* eslint-disable react/no-array-index-key */\n\nimport React from 'react';\nimport { theme } from '../../theme';\nimport { AvatarSC } from './styled';\nimport { AvatarProps } from './types';\n\nexport const Avatar = ({\n width = '40px',\n name = 'Veeqo',\n bgColor = theme.colors.secondary.blue.base,\n textColor = '#ffffff',\n}: AvatarProps) => {\n const userInitials = name.toUpperCase().match(/\\b(\\w)/g);\n\n return (\n <AvatarSC width={width} bgColor={bgColor} textColor={textColor} className=\"avatar\">\n {userInitials\n ?.slice(0, 2)\n .map((initial, i) => <span key={`${initial}-${i}`}>{initial}</span>)}\n </AvatarSC>\n );\n};\n"],"names":["React"],"mappings":";;;;AAAA;AAOO,MAAM,MAAM,GAAG,CAAC,EACrB,KAAK,GAAG,MAAM,EACd,IAAI,GAAG,OAAO,EACd,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAC1C,SAAS,GAAG,SAAS,GACT,KAAI;IAChB,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;IAExD,QACEA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAC,QAAQ,EAC/E,EAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,SAAA,GAAA,SAAA,GAAA,YAAY,CACT,KAAK,CAAC,CAAC,EAAE,CAAC,CAAA,CACX,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,KAAKA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,GAAG,EAAE,CAAA,EAAG,OAAO,CAAA,CAAA,EAAI,CAAC,CAAA,CAAE,EAAG,EAAA,OAAO,CAAQ,CAAC,CAC7D;AAEf;;;;"}
1
+ {"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React from 'react';\nimport { assignCssVars, buildClassnames } from '../../utils';\nimport { CriticalIcon } from '../../icons/custom/components/CriticalIcon';\nimport { theme } from '../../theme';\nimport styles from './Avatar.module.scss';\nimport { AvatarProps } from './types';\nimport { Text } from '../Text';\nimport { FlexRow } from '../Flex/FlexRow';\n\nconst textVariantMapping: Record<string, any> = {\n md: 'bodySmallBold',\n lg: 'bodySmallBold',\n xl: 'headingSmall',\n xxl: 'headingMedium',\n};\n\nexport const Avatar = ({\n size = 'lg',\n name,\n bgColor,\n textColor,\n iconSlot,\n imageUrl,\n hasIndicator = false,\n ariaLabel = `Avatar of ${name}`,\n}: AvatarProps) => {\n const textVariant = textVariantMapping[size];\n\n return (\n <FlexRow\n justifyContent=\"center\"\n className={buildClassnames([styles.avatar, styles[`${size}-size`]])}\n style={\n {\n ...assignCssVars({\n avatarBgColor: iconSlot ? theme.colors.neutral.grey.lightest : bgColor,\n avatarTextColor: textColor,\n }),\n } as React.CSSProperties\n }\n aria-label={ariaLabel}\n >\n {hasIndicator && (\n <CriticalIcon\n className={styles.indicatorIcon}\n color={theme.colors.secondary.red.base}\n fill={theme.colors.neutral.grey.lightest}\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"Avatar has an error\"\n />\n )}\n {imageUrl && <img src={imageUrl} alt={name} className={styles.avatarImage} />}\n {!!iconSlot && iconSlot}\n {!imageUrl && !iconSlot && (\n <Text variant={textVariant} className={styles.avatarText}>\n {name\n .toUpperCase()\n .match(/(\\b\\w|\\+)/g)\n ?.slice(0, 2)}\n </Text>\n )}\n </FlexRow>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;AASA,MAAM,kBAAkB,GAAwB;AAC9C,IAAA,EAAE,EAAE,eAAe;AACnB,IAAA,EAAE,EAAE,eAAe;AACnB,IAAA,EAAE,EAAE,cAAc;AAClB,IAAA,GAAG,EAAE,eAAe;CACrB;AAEM,MAAM,MAAM,GAAG,CAAC,EACrB,IAAI,GAAG,IAAI,EACX,IAAI,EACJ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,GAAG,KAAK,EACpB,SAAS,GAAG,CAAa,UAAA,EAAA,IAAI,CAAE,CAAA,GACnB,KAAI;;AAChB,IAAA,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC;IAE5C,QACEA,cAAC,CAAA,aAAA,CAAA,OAAO,EACN,EAAA,cAAc,EAAC,QAAQ,EACvB,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAG,EAAA,IAAI,CAAO,KAAA,CAAA,CAAC,CAAC,CAAC,EACnE,KAAK,EACH;AACE,YAAA,GAAG,aAAa,CAAC;AACf,gBAAA,aAAa,EAAE,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO;AACtE,gBAAA,eAAe,EAAE,SAAS;aAC3B,CAAC;AACoB,SAAA,EAAA,YAAA,EAEd,SAAS,EAAA;AAEpB,QAAA,YAAY,KACXA,cAAA,CAAA,aAAA,CAAC,YAAY,EACX,EAAA,SAAS,EAAE,MAAM,CAAC,aAAa,EAC/B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EACtC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EACxC,IAAI,EAAC,QAAQ,EAAA,WAAA,EACH,QAAQ,EACP,YAAA,EAAA,qBAAqB,GAChC,CACH;AACA,QAAA,QAAQ,IAAIA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,EAAI,CAAA;QAC5E,CAAC,CAAC,QAAQ,IAAI,QAAQ;QACtB,CAAC,QAAQ,IAAI,CAAC,QAAQ,KACrBA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,EAAA,EACrD,MAAA;AACE,aAAA,WAAW;AACX,aAAA,KAAK,CAAC,YAAY,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAClB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACV,CACR,CACO;AAEd;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
4
+
5
+ ___$insertStyle("._avatar_1oval_1 {\n border: var(--sizes-line) solid var(--colors-neutral-grey-base);\n border-radius: var(--radius-full);\n background-size: cover;\n background-color: var(--avatar-bg-color, var(--colors-secondary-blue-base));\n position: relative;\n width: var(--avatar-size, var(--sizes-lg));\n height: var(--avatar-size, var(--sizes-lg));\n}\n\n._avatarImage_1oval_11 {\n width: 100%;\n height: 100%;\n border-radius: var(--radius-full);\n object-fit: cover;\n}\n\n._avatarText_1oval_18 {\n color: var(--avatar-text-color, #fff) !important;\n}\n\n._indicatorIcon_1oval_22 {\n position: absolute;\n /* Calculate offset as roughly 30% of icon size, with fallback */\n top: calc(-0.3 * var(--indicator-icon-size, 16px));\n right: calc(-0.3 * var(--indicator-icon-size, 16px));\n width: var(--indicator-icon-size, var(--sizes-lg));\n height: var(--indicator-icon-size, var(--sizes-lg));\n}\n\n._md-size_1oval_31 {\n --avatar-size: var(--sizes-md);\n --indicator-icon-size: var(--sizes-3);\n}\n\n._lg-size_1oval_36 {\n --avatar-size: var(--sizes-lg);\n --indicator-icon-size: var(--sizes-base);\n}\n\n._xl-size_1oval_41 {\n --avatar-size: var(--sizes-xl);\n --indicator-icon-size: var(--sizes-7);\n}\n\n._xxl-size_1oval_46 {\n --avatar-size: var(--sizes-xxl);\n --indicator-icon-size: var(--sizes-lg);\n}");
6
+ var styles = {"avatar":"_avatar_1oval_1","avatarImage":"_avatarImage_1oval_11","avatarText":"_avatarText_1oval_18","indicatorIcon":"_indicatorIcon_1oval_22","md-size":"_md-size_1oval_31","lg-size":"_lg-size_1oval_36","xl-size":"_xl-size_1oval_41","xxl-size":"_xxl-size_1oval_46"};
7
+
8
+ module.exports = styles;
9
+ //# sourceMappingURL=Avatar.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.module.scss.cjs","sources":["../../../src/components/Avatar/Avatar.module.scss"],"sourcesContent":[".avatar {\n border: var(--sizes-line) solid var(--colors-neutral-grey-base);\n border-radius: var(--radius-full);\n background-size: cover;\n background-color: var(--avatar-bg-color, var(--colors-secondary-blue-base));\n position: relative;\n width: var(--avatar-size, var(--sizes-lg));\n height: var(--avatar-size, var(--sizes-lg));\n}\n\n.avatarImage {\n width: 100%;\n height: 100%;\n border-radius: var(--radius-full);\n object-fit: cover;\n}\n\n.avatarText {\n color: var(--avatar-text-color, #fff) !important;\n}\n\n.indicatorIcon {\n position: absolute;\n /* Calculate offset as roughly 30% of icon size, with fallback */\n top: calc(-0.3 * var(--indicator-icon-size, 16px));\n right: calc(-0.3 * var(--indicator-icon-size, 16px));\n width: var(--indicator-icon-size, var(--sizes-lg));\n height: var(--indicator-icon-size, var(--sizes-lg));\n}\n\n.md-size {\n --avatar-size: var(--sizes-md);\n --indicator-icon-size: var(--sizes-3);\n}\n\n.lg-size {\n --avatar-size: var(--sizes-lg);\n --indicator-icon-size: var(--sizes-base);\n}\n\n.xl-size {\n --avatar-size: var(--sizes-xl);\n --indicator-icon-size: var(--sizes-7);\n}\n\n.xxl-size {\n --avatar-size: var(--sizes-xxl);\n --indicator-icon-size: var(--sizes-lg);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,mzCAAA;AACA,aAAA,CAAA,QAAA,CAAA,iBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
@@ -0,0 +1,7 @@
1
+ import insertStyle from '../../_virtual/____insertStyle.js';
2
+
3
+ insertStyle("._avatar_1oval_1 {\n border: var(--sizes-line) solid var(--colors-neutral-grey-base);\n border-radius: var(--radius-full);\n background-size: cover;\n background-color: var(--avatar-bg-color, var(--colors-secondary-blue-base));\n position: relative;\n width: var(--avatar-size, var(--sizes-lg));\n height: var(--avatar-size, var(--sizes-lg));\n}\n\n._avatarImage_1oval_11 {\n width: 100%;\n height: 100%;\n border-radius: var(--radius-full);\n object-fit: cover;\n}\n\n._avatarText_1oval_18 {\n color: var(--avatar-text-color, #fff) !important;\n}\n\n._indicatorIcon_1oval_22 {\n position: absolute;\n /* Calculate offset as roughly 30% of icon size, with fallback */\n top: calc(-0.3 * var(--indicator-icon-size, 16px));\n right: calc(-0.3 * var(--indicator-icon-size, 16px));\n width: var(--indicator-icon-size, var(--sizes-lg));\n height: var(--indicator-icon-size, var(--sizes-lg));\n}\n\n._md-size_1oval_31 {\n --avatar-size: var(--sizes-md);\n --indicator-icon-size: var(--sizes-3);\n}\n\n._lg-size_1oval_36 {\n --avatar-size: var(--sizes-lg);\n --indicator-icon-size: var(--sizes-base);\n}\n\n._xl-size_1oval_41 {\n --avatar-size: var(--sizes-xl);\n --indicator-icon-size: var(--sizes-7);\n}\n\n._xxl-size_1oval_46 {\n --avatar-size: var(--sizes-xxl);\n --indicator-icon-size: var(--sizes-lg);\n}");
4
+ var styles = {"avatar":"_avatar_1oval_1","avatarImage":"_avatarImage_1oval_11","avatarText":"_avatarText_1oval_18","indicatorIcon":"_indicatorIcon_1oval_22","md-size":"_md-size_1oval_31","lg-size":"_lg-size_1oval_36","xl-size":"_xl-size_1oval_41","xxl-size":"_xxl-size_1oval_46"};
5
+
6
+ export { styles as default };
7
+ //# sourceMappingURL=Avatar.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.module.scss.js","sources":["../../../src/components/Avatar/Avatar.module.scss"],"sourcesContent":[".avatar {\n border: var(--sizes-line) solid var(--colors-neutral-grey-base);\n border-radius: var(--radius-full);\n background-size: cover;\n background-color: var(--avatar-bg-color, var(--colors-secondary-blue-base));\n position: relative;\n width: var(--avatar-size, var(--sizes-lg));\n height: var(--avatar-size, var(--sizes-lg));\n}\n\n.avatarImage {\n width: 100%;\n height: 100%;\n border-radius: var(--radius-full);\n object-fit: cover;\n}\n\n.avatarText {\n color: var(--avatar-text-color, #fff) !important;\n}\n\n.indicatorIcon {\n position: absolute;\n /* Calculate offset as roughly 30% of icon size, with fallback */\n top: calc(-0.3 * var(--indicator-icon-size, 16px));\n right: calc(-0.3 * var(--indicator-icon-size, 16px));\n width: var(--indicator-icon-size, var(--sizes-lg));\n height: var(--indicator-icon-size, var(--sizes-lg));\n}\n\n.md-size {\n --avatar-size: var(--sizes-md);\n --indicator-icon-size: var(--sizes-3);\n}\n\n.lg-size {\n --avatar-size: var(--sizes-lg);\n --indicator-icon-size: var(--sizes-base);\n}\n\n.xl-size {\n --avatar-size: var(--sizes-xl);\n --indicator-icon-size: var(--sizes-7);\n}\n\n.xxl-size {\n --avatar-size: var(--sizes-xxl);\n --indicator-icon-size: var(--sizes-lg);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,mzCAAA;AACA,aAAA,CAAA,QAAA,CAAA,iBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
@@ -1,11 +1,17 @@
1
- export interface AvatarProps {
1
+ /// <reference types="react" />
2
+ export declare enum AvatarSize {
3
+ md = "md",
4
+ lg = "lg",
5
+ xl = "xl",
6
+ xxl = "xxl"
7
+ }
8
+ export type AvatarProps = {
2
9
  name: string;
3
- width?: string;
10
+ size?: keyof typeof AvatarSize;
4
11
  bgColor?: string;
5
12
  textColor?: string;
6
- }
7
- export interface AvatarSCProps {
8
- width: string;
9
- bgColor: string;
10
- textColor: string;
11
- }
13
+ iconSlot?: React.ReactNode;
14
+ imageUrl?: string;
15
+ ariaLabel?: string;
16
+ hasIndicator?: boolean;
17
+ };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { AvatarProps } from '../Avatar/types';
3
+ type AvatarGroupProps = {
4
+ avatars: Omit<AvatarProps, 'hasIndicator'>[];
5
+ maxVisible?: number;
6
+ compact?: boolean;
7
+ ariaLabel?: string;
8
+ hasIndicator?: boolean;
9
+ };
10
+ export declare const AvatarGroup: ({ avatars, maxVisible, compact, ariaLabel, hasIndicator, }: AvatarGroupProps) => React.JSX.Element;
11
+ export {};
@@ -0,0 +1 @@
1
+ export { AvatarGroup } from './AvatarGroup';
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
6
+
7
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
8
+
9
+ const CriticalIcon = ({ fill, ...props }) => (React__default.default.createElement("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props },
10
+ React__default.default.createElement("circle", { cx: 8, cy: 8, r: 6, fill: fill }),
11
+ React__default.default.createElement("path", { d: "M8 1.33334C4.32 1.33334 1.33334 4.32001 1.33334 8.00001C1.33334 11.68 4.32 14.6667 8 14.6667C11.68 14.6667 14.6667 11.68 14.6667 8.00001C14.6667 4.32001 11.68 1.33334 8 1.33334ZM8.66667 11.3333H7.33334V10H8.66667V11.3333ZM8.66667 8.66668H7.33334V4.66668H8.66667V8.66668Z", fill: "currentColor" })));
12
+
13
+ exports.CriticalIcon = CriticalIcon;
14
+ //# sourceMappingURL=CriticalIcon.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CriticalIcon.cjs","sources":["../../../../src/icons/custom/components/CriticalIcon.tsx"],"sourcesContent":["import React from 'react';\nimport { IconComponentProps } from 'src/icons/types';\n\nexport const CriticalIcon = ({ fill, ...props }: IconComponentProps) => (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <circle cx={8} cy={8} r={6} fill={fill} />\n <path\n d=\"M8 1.33334C4.32 1.33334 1.33334 4.32001 1.33334 8.00001C1.33334 11.68 4.32 14.6667 8 14.6667C11.68 14.6667 14.6667 11.68 14.6667 8.00001C14.6667 4.32001 11.68 1.33334 8 1.33334ZM8.66667 11.3333H7.33334V10H8.66667V11.3333ZM8.66667 8.66668H7.33334V4.66668H8.66667V8.66668Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n"],"names":["React"],"mappings":";;;;;;;;AAGO,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAsB,MACjEA,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,EAAA,GAAK,KAAK,EAAA;AAC/E,IAAAA,sBAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAI,CAAA;IAC1CA,sBACE,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,CAAC,EAAC,gRAAgR,EAClR,IAAI,EAAC,cAAc,EAAA,CACnB,CACE;;;;"}
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { IconComponentProps } from 'src/icons/types';
3
- export declare const CriticalIcon: (props: IconComponentProps) => React.JSX.Element;
3
+ export declare const CriticalIcon: ({ fill, ...props }: IconComponentProps) => React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React__default from 'react';
2
+
3
+ const CriticalIcon = ({ fill, ...props }) => (React__default.createElement("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props },
4
+ React__default.createElement("circle", { cx: 8, cy: 8, r: 6, fill: fill }),
5
+ React__default.createElement("path", { d: "M8 1.33334C4.32 1.33334 1.33334 4.32001 1.33334 8.00001C1.33334 11.68 4.32 14.6667 8 14.6667C11.68 14.6667 14.6667 11.68 14.6667 8.00001C14.6667 4.32001 11.68 1.33334 8 1.33334ZM8.66667 11.3333H7.33334V10H8.66667V11.3333ZM8.66667 8.66668H7.33334V4.66668H8.66667V8.66668Z", fill: "currentColor" })));
6
+
7
+ export { CriticalIcon };
8
+ //# sourceMappingURL=CriticalIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CriticalIcon.js","sources":["../../../../src/icons/custom/components/CriticalIcon.tsx"],"sourcesContent":["import React from 'react';\nimport { IconComponentProps } from 'src/icons/types';\n\nexport const CriticalIcon = ({ fill, ...props }: IconComponentProps) => (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <circle cx={8} cy={8} r={6} fill={fill} />\n <path\n d=\"M8 1.33334C4.32 1.33334 1.33334 4.32001 1.33334 8.00001C1.33334 11.68 4.32 14.6667 8 14.6667C11.68 14.6667 14.6667 11.68 14.6667 8.00001C14.6667 4.32001 11.68 1.33334 8 1.33334ZM8.66667 11.3333H7.33334V10H8.66667V11.3333ZM8.66667 8.66668H7.33334V4.66668H8.66667V8.66668Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n"],"names":["React"],"mappings":";;AAGO,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAsB,MACjEA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,EAAA,GAAK,KAAK,EAAA;AAC/E,IAAAA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAI,CAAA;IAC1CA,cACE,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,CAAC,EAAC,gRAAgR,EAClR,IAAI,EAAC,cAAc,EAAA,CACnB,CACE;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/ui",
3
- "version": "11.4.2",
3
+ "version": "12.0.0",
4
4
  "description": "New optimised component library for Veeqo.",
5
5
  "author": "Robert Wealthall",
6
6
  "license": "ISC",
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- var styled = require('styled-components');
4
- var index = require('../../theme/index.cjs');
5
-
6
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
7
-
8
- var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
9
-
10
- const AvatarSC = styled__default.default.div.withConfig({ displayName: "vui--AvatarSC", componentId: "vui--1gxc5tv" }) `width:${(props) => props.width};height:${(props) => props.width};border:3px solid ${index.theme.colors.neutral.grey.base};color:${(props) => props.textColor};background-color:${(props) => props.bgColor};cursor:pointer;border-radius:50%;display:flex;justify-content:center;align-items:center;background-size:cover;span{font-family:${index.theme.text.bodySmallBold.fontFamily};font-weight:${index.theme.text.bodySmallBold.fontWeight};font-size:${index.theme.text.bodySmallBold.fontSize};line-height:${index.theme.text.bodySmallBold.lineHeight};}`;
11
-
12
- exports.AvatarSC = AvatarSC;
13
- //# sourceMappingURL=styled.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styled.cjs","sources":["../../../src/components/Avatar/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { theme } from '../../theme';\nimport { AvatarSCProps } from './types';\n\nexport const AvatarSC = styled.div<AvatarSCProps>`\n width: ${(props) => props.width};\n height: ${(props) => props.width};\n border: 3px solid ${theme.colors.neutral.grey.base};\n color: ${(props) => props.textColor};\n background-color: ${(props) => props.bgColor};\n cursor: pointer;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n background-size: cover;\n\n span {\n font-family: ${theme.text.bodySmallBold.fontFamily};\n font-weight: ${theme.text.bodySmallBold.fontWeight};\n font-size: ${theme.text.bodySmallBold.fontSize};\n line-height: ${theme.text.bodySmallBold.lineHeight};\n }\n`;\n"],"names":["styled","theme"],"mappings":";;;;;;;;;AAIa,MAAA,QAAQ,GAAGA,uBAAM,CAAC,GAAG,CACvB,UAAA,CAAA,EAAA,WAAA,EAAA,eAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,MAAA,EAAA,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAA,QAAA,EACrB,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,qBACZC,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CACzC,OAAA,EAAA,CAAC,KAAK,KAAK,KAAK,CAAC,SAAS,CAAA,kBAAA,EACf,CAAC,KAAK,KAAK,KAAK,CAAC,OAAO,CAAA,gIAAA,EAS3BA,WAAK,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAA,aAAA,EACnCA,WAAK,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAA,WAAA,EACrCA,WAAK,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAC/B,aAAA,EAAAA,WAAK,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU;;;;"}
@@ -1,2 +0,0 @@
1
- import { AvatarSCProps } from './types';
2
- export declare const AvatarSC: import("styled-components").StyledComponent<"div", any, AvatarSCProps, never>;
@@ -1,7 +0,0 @@
1
- import styled from 'styled-components';
2
- import { theme } from '../../theme/index.js';
3
-
4
- const AvatarSC = styled.div.withConfig({ displayName: "vui--AvatarSC", componentId: "vui--1gxc5tv" }) `width:${(props) => props.width};height:${(props) => props.width};border:3px solid ${theme.colors.neutral.grey.base};color:${(props) => props.textColor};background-color:${(props) => props.bgColor};cursor:pointer;border-radius:50%;display:flex;justify-content:center;align-items:center;background-size:cover;span{font-family:${theme.text.bodySmallBold.fontFamily};font-weight:${theme.text.bodySmallBold.fontWeight};font-size:${theme.text.bodySmallBold.fontSize};line-height:${theme.text.bodySmallBold.lineHeight};}`;
5
-
6
- export { AvatarSC };
7
- //# sourceMappingURL=styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styled.js","sources":["../../../src/components/Avatar/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { theme } from '../../theme';\nimport { AvatarSCProps } from './types';\n\nexport const AvatarSC = styled.div<AvatarSCProps>`\n width: ${(props) => props.width};\n height: ${(props) => props.width};\n border: 3px solid ${theme.colors.neutral.grey.base};\n color: ${(props) => props.textColor};\n background-color: ${(props) => props.bgColor};\n cursor: pointer;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n background-size: cover;\n\n span {\n font-family: ${theme.text.bodySmallBold.fontFamily};\n font-weight: ${theme.text.bodySmallBold.fontWeight};\n font-size: ${theme.text.bodySmallBold.fontSize};\n line-height: ${theme.text.bodySmallBold.lineHeight};\n }\n`;\n"],"names":[],"mappings":";;;AAIa,MAAA,QAAQ,GAAG,MAAM,CAAC,GAAG,CACvB,UAAA,CAAA,EAAA,WAAA,EAAA,eAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,MAAA,EAAA,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAA,QAAA,EACrB,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,qBACZ,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CACzC,OAAA,EAAA,CAAC,KAAK,KAAK,KAAK,CAAC,SAAS,CAAA,kBAAA,EACf,CAAC,KAAK,KAAK,KAAK,CAAC,OAAO,CAAA,gIAAA,EAS3B,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAA,aAAA,EACnC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAA,WAAA,EACrC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAC/B,aAAA,EAAA,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU;;;;"}