@veeqo/ui 14.10.2 → 14.11.0-beta-1
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/Accordion/Accordion.cjs +19 -16
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.js +19 -16
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/Accordion.module.scss.cjs +9 -0
- package/dist/components/Accordion/Accordion.module.scss.cjs.map +1 -0
- package/dist/components/Accordion/Accordion.module.scss.js +7 -0
- package/dist/components/Accordion/Accordion.module.scss.js.map +1 -0
- package/dist/components/Action/Action.d.ts +4 -4
- package/dist/components/Action/styles/button.module.scss.cjs +2 -2
- package/dist/components/Action/styles/button.module.scss.cjs.map +1 -1
- package/dist/components/Action/styles/button.module.scss.js +2 -2
- package/dist/components/Action/styles/button.module.scss.js.map +1 -1
- package/dist/components/Action/styles/link.module.scss.cjs +2 -2
- package/dist/components/Action/styles/link.module.scss.cjs.map +1 -1
- package/dist/components/Action/styles/link.module.scss.js +2 -2
- package/dist/components/Action/styles/link.module.scss.js.map +1 -1
- package/dist/components/Action/utils.cjs +19 -14
- package/dist/components/Action/utils.cjs.map +1 -1
- package/dist/components/Action/utils.js +19 -14
- package/dist/components/Action/utils.js.map +1 -1
- package/dist/components/Button/Button.cjs +37 -37
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.ts +4 -13
- package/dist/components/Button/Button.js +37 -37
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/types.d.ts +7 -16
- package/dist/components/Card/Card.cjs +36 -9
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.d.ts +10 -5
- package/dist/components/Card/Card.js +29 -2
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.module.scss.cjs +9 -0
- package/dist/components/Card/Card.module.scss.cjs.map +1 -0
- package/dist/components/Card/Card.module.scss.js +7 -0
- package/dist/components/Card/Card.module.scss.js.map +1 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/CardHeader/CardHeader.cjs +3 -3
- package/dist/components/CardHeader/CardHeader.cjs.map +1 -1
- package/dist/components/CardHeader/CardHeader.js +3 -3
- package/dist/components/CardHeader/CardHeader.js.map +1 -1
- package/dist/components/CardHeader/CardHeader.module.scss.cjs +9 -0
- package/dist/components/CardHeader/CardHeader.module.scss.cjs.map +1 -0
- package/dist/components/CardHeader/CardHeader.module.scss.js +7 -0
- package/dist/components/CardHeader/CardHeader.module.scss.js.map +1 -0
- package/dist/components/DimensionsInput/DimensionsInput.d.ts +10 -10
- package/dist/components/FilterTag/styled.d.ts +1 -1
- package/dist/components/Flex/FlexCol/FlexCol.d.ts +1 -1
- package/dist/components/Flex/FlexRow/FlexRow.d.ts +1 -1
- package/dist/components/LegacyDataTable/SpecificState/styled.d.ts +2 -2
- package/dist/components/Pagination/styled.d.ts +12 -17
- package/dist/components/PhoneInput/index.d.ts +10 -10
- package/dist/components/Search/Search.d.ts +10 -10
- package/dist/components/SimpleTable/SimpleTable.cjs +20 -7
- package/dist/components/SimpleTable/SimpleTable.cjs.map +1 -1
- package/dist/components/SimpleTable/SimpleTable.d.ts +9 -7
- package/dist/components/SimpleTable/SimpleTable.js +15 -2
- package/dist/components/SimpleTable/SimpleTable.js.map +1 -1
- package/dist/components/SimpleTable/SimpleTable.module.scss.cjs +9 -0
- package/dist/components/SimpleTable/SimpleTable.module.scss.cjs.map +1 -0
- package/dist/components/SimpleTable/SimpleTable.module.scss.js +7 -0
- package/dist/components/SimpleTable/SimpleTable.module.scss.js.map +1 -0
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/TextField/TextField.d.ts +10 -10
- package/dist/components/TextField/index.d.ts +10 -10
- package/dist/components/UploadFile/UploadFile.cjs +7 -2
- package/dist/components/UploadFile/UploadFile.cjs.map +1 -1
- package/dist/components/UploadFile/UploadFile.js +7 -2
- package/dist/components/UploadFile/UploadFile.js.map +1 -1
- package/dist/components/UploadFile/UploadFile.module.scss.cjs +9 -0
- package/dist/components/UploadFile/UploadFile.module.scss.cjs.map +1 -0
- package/dist/components/UploadFile/UploadFile.module.scss.js +7 -0
- package/dist/components/UploadFile/UploadFile.module.scss.js.map +1 -0
- package/dist/components/VideoModal/styled.d.ts +1 -6
- package/dist/components/View/View.cjs +37 -9
- package/dist/components/View/View.cjs.map +1 -1
- package/dist/components/View/View.js +35 -7
- package/dist/components/View/View.js.map +1 -1
- package/dist/components/View/View.module.scss.cjs +9 -0
- package/dist/components/View/View.module.scss.cjs.map +1 -0
- package/dist/components/View/View.module.scss.js +7 -0
- package/dist/components/View/View.module.scss.js.map +1 -0
- package/dist/components/ViewTab/ViewTab.d.ts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/Accordion/styled.cjs +0 -49
- package/dist/components/Accordion/styled.cjs.map +0 -1
- package/dist/components/Accordion/styled.d.ts +0 -26
- package/dist/components/Accordion/styled.js +0 -34
- package/dist/components/Accordion/styled.js.map +0 -1
- package/dist/components/Button/Button.module.scss.cjs +0 -9
- package/dist/components/Button/Button.module.scss.cjs.map +0 -1
- package/dist/components/Button/Button.module.scss.js +0 -7
- package/dist/components/Button/Button.module.scss.js.map +0 -1
- package/dist/components/Card/styled.cjs +0 -50
- package/dist/components/Card/styled.cjs.map +0 -1
- package/dist/components/Card/styled.d.ts +0 -16
- package/dist/components/Card/styled.js +0 -40
- package/dist/components/Card/styled.js.map +0 -1
- package/dist/components/CardHeader/styled.cjs +0 -15
- package/dist/components/CardHeader/styled.cjs.map +0 -1
- package/dist/components/CardHeader/styled.d.ts +0 -2
- package/dist/components/CardHeader/styled.js +0 -8
- package/dist/components/CardHeader/styled.js.map +0 -1
- package/dist/components/SimpleTable/styled.cjs +0 -34
- package/dist/components/SimpleTable/styled.cjs.map +0 -1
- package/dist/components/SimpleTable/styled.d.ts +0 -15
- package/dist/components/SimpleTable/styled.js +0 -23
- package/dist/components/SimpleTable/styled.js.map +0 -1
- package/dist/components/UploadFile/styled.cjs +0 -54
- package/dist/components/UploadFile/styled.cjs.map +0 -1
- package/dist/components/UploadFile/styled.d.ts +0 -4
- package/dist/components/UploadFile/styled.js +0 -48
- package/dist/components/UploadFile/styled.js.map +0 -1
- package/dist/components/View/styled.cjs +0 -53
- package/dist/components/View/styled.cjs.map +0 -1
- package/dist/components/View/styled.d.ts +0 -37
- package/dist/components/View/styled.js +0 -41
- package/dist/components/View/styled.js.map +0 -1
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var Loader = require('../Loader/Loader.cjs');
|
|
5
4
|
var withTokens = require('../../hoc/withTokens/withTokens.cjs');
|
|
5
|
+
var DropdownIcon = require('../../icons/custom/components/DropdownIcon.cjs');
|
|
6
6
|
var buildClassnames = require('../../utils/buildClassnames.cjs');
|
|
7
7
|
require('uid/secure');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
var button_module = require('../Action/styles/button.module.scss.cjs');
|
|
9
|
+
var utils = require('../Action/utils.cjs');
|
|
10
|
+
var Loader = require('../Loader/Loader.cjs');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
13
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
15
|
|
|
16
|
-
/* eslint-disable react/button-has-type */
|
|
17
16
|
/**
|
|
18
|
-
* @deprecated Use the `Action` component instead
|
|
17
|
+
* @deprecated Use the `Action` component instead.
|
|
18
|
+
* Button triggers actions such as submitting forms, opening dialogs, or deleting records.
|
|
19
19
|
*/
|
|
20
|
-
const ButtonBase = React.forwardRef(({ className, children, iconSlot, variant = 'default', size = 'base', dropdown = false, loading = false,
|
|
21
|
-
const Element = as || 'button';
|
|
20
|
+
const ButtonBase = React.forwardRef(({ className, children, iconSlot, variant = 'default', size = 'base', dropdown = false, loading = false, disabled, type = 'button', ...otherProps }, ref) => {
|
|
22
21
|
if (variant === 'unstyled') {
|
|
23
|
-
return (React__default.default.createElement(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const hasIcon = !!iconSlot;
|
|
27
|
-
const iconSize = hasChildren || size === 'sm' ? 'var(--sizes-base)' : 'var(--sizes-md)';
|
|
28
|
-
const mainContentStyle = { ...assignCssVars.assignCssVars({ buttonIconSize: iconSize }), ...contentStyles };
|
|
29
|
-
if (variant === 'link') {
|
|
30
|
-
return (React__default.default.createElement(Element, { ref: ref, className: buildClassnames.buildClassnames([Button_module['link-variant'], hasChildren && Button_module.hasText, className]), ...otherProps },
|
|
31
|
-
(hasChildren || hasIcon) && (React__default.default.createElement("span", { className: buildClassnames.buildClassnames([Button_module.mainContent, loading && Button_module.loading]), style: mainContentStyle },
|
|
32
|
-
iconSlot && iconSlot,
|
|
33
|
-
children !== undefined && children,
|
|
34
|
-
dropdown && React__default.default.createElement(DropdownIcon.DropdownIcon, null))),
|
|
35
|
-
loading && (React__default.default.createElement("div", { className: Button_module.loadingWrapper },
|
|
36
|
-
React__default.default.createElement(Loader.Loader, null)))));
|
|
22
|
+
return (React__default.default.createElement("button", { ...otherProps, ref: ref,
|
|
23
|
+
// eslint-disable-next-line react/button-has-type
|
|
24
|
+
type: type, className: utils.getAppearanceClasses('unstyled', { className }), disabled: disabled || loading, "aria-busy": loading || undefined }, children));
|
|
37
25
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
loading
|
|
52
|
-
|
|
26
|
+
const isLink = variant === 'link';
|
|
27
|
+
const appearance = isLink ? 'link' : 'button';
|
|
28
|
+
const classNames = utils.getAppearanceClasses(appearance, {
|
|
29
|
+
className,
|
|
30
|
+
variant: isLink ? undefined : variant,
|
|
31
|
+
disabled,
|
|
32
|
+
size,
|
|
33
|
+
dropdown,
|
|
34
|
+
iconSlot,
|
|
35
|
+
children,
|
|
36
|
+
});
|
|
37
|
+
return (React__default.default.createElement("button", { ...otherProps, ref: ref,
|
|
38
|
+
// eslint-disable-next-line react/button-has-type
|
|
39
|
+
type: type, className: classNames, disabled: disabled || loading, "aria-busy": loading || undefined }, isLink ? (React__default.default.createElement(React__default.default.Fragment, null,
|
|
40
|
+
iconSlot,
|
|
41
|
+
children,
|
|
42
|
+
dropdown && React__default.default.createElement(DropdownIcon.DropdownIcon, null))) : (React__default.default.createElement(React__default.default.Fragment, null,
|
|
43
|
+
React__default.default.createElement("span", { className: buildClassnames.buildClassnames([
|
|
44
|
+
button_module.content,
|
|
45
|
+
loading && button_module.hideContent,
|
|
46
|
+
]) },
|
|
47
|
+
iconSlot,
|
|
48
|
+
children,
|
|
49
|
+
dropdown && React__default.default.createElement(DropdownIcon.DropdownIcon, null)),
|
|
50
|
+
loading && (React__default.default.createElement("div", { className: button_module.loadingWrapper, role: "status", "aria-label": "Loading" },
|
|
51
|
+
React__default.default.createElement(Loader.Loader, { className: button_module.loader })))))));
|
|
53
52
|
});
|
|
53
|
+
ButtonBase.displayName = 'Button';
|
|
54
54
|
const Button = withTokens.withTokens(ButtonBase);
|
|
55
55
|
|
|
56
56
|
exports.Button = Button;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { forwardRef
|
|
1
|
+
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { withTokens } from '../../hoc/withTokens';\nimport { DropdownIcon } from '../../icons';\nimport { buildClassnames } from '../../utils';\nimport buttonStyles from '../Action/styles/button.module.scss';\nimport { getAppearanceClasses } from '../Action/utils';\nimport { Loader } from '../Loader';\nimport { ButtonProps } from './types';\n\n/**\n * @deprecated Use the `Action` component instead.\n * Button triggers actions such as submitting forms, opening dialogs, or deleting records.\n */\nexport const ButtonBase = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n children,\n iconSlot,\n variant = 'default',\n size = 'base',\n dropdown = false,\n loading = false,\n disabled,\n type = 'button',\n ...otherProps\n }: ButtonProps,\n ref,\n ) => {\n if (variant === 'unstyled') {\n return (\n <button\n {...otherProps}\n ref={ref}\n // eslint-disable-next-line react/button-has-type\n type={type}\n className={getAppearanceClasses('unstyled', { className })}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n >\n {children}\n </button>\n );\n }\n\n const isLink = variant === 'link';\n const appearance = isLink ? 'link' : 'button';\n\n const classNames = getAppearanceClasses(appearance, {\n className,\n variant: isLink ? undefined : variant,\n disabled,\n size,\n dropdown,\n iconSlot,\n children,\n });\n\n return (\n <button\n {...otherProps}\n ref={ref}\n // eslint-disable-next-line react/button-has-type\n type={type}\n className={classNames}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n >\n {isLink ? (\n <>\n {iconSlot}\n {children}\n {dropdown && <DropdownIcon />}\n </>\n ) : (\n <>\n <span\n className={buildClassnames([\n buttonStyles.content,\n loading && buttonStyles.hideContent,\n ])}\n >\n {iconSlot}\n {children}\n {dropdown && <DropdownIcon />}\n </span>\n {loading && (\n <div className={buttonStyles.loadingWrapper} role=\"status\" aria-label=\"Loading\">\n <Loader className={buttonStyles.loader} />\n </div>\n )}\n </>\n )}\n </button>\n );\n },\n);\n\nButtonBase.displayName = 'Button';\n\nexport const Button = withTokens(ButtonBase);\n"],"names":["forwardRef","React","getAppearanceClasses","DropdownIcon","buildClassnames","buttonStyles","Loader","withTokens"],"mappings":";;;;;;;;;;;;;;;AAUA;;;AAGG;AACI,MAAM,UAAU,GAAGA,gBAAU,CAClC,CACE,EACE,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,MAAM,EACb,QA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A,EACE,SAAS,EAAEG,+BAAe,CAAC;AACzB,gBAAAC,aAAY,CAAC,OAAO;gBACpB,OAAO,IAAIA,aAAY,CAAC,WAAW;aACpC,CAAC,EAAA;YAED,QAAQ;YACR,QAAQ;AACR,YAAA,QAAQ,IAAIJ,sBAAA,CAAA,aAAA,CAACE,yBAAY,EAAA,IAAA,CAAG,CACxB;AACN,QAAA,OAAO,KACNF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEI,aAAY,CAAC,cAAc,EAAE,IAAI,EAAC,QAAQ,gBAAY,SAAS,EAAA;AAC7E,YAAAJ,sBAAA,CAAA,aAAA,CAACK,aAAM,EAAA,EAAC,SAAS,EAAED,aAAY,CAAC,MAAM,EAAA,CAAI,CACtC,CACP,CACA,CACJ,CACM;AAEb,CAAC;AAGH,UAAU,CAAC,WAAW,GAAG,QAAQ;MAEpB,MAAM,GAAGE,qBAAU,CAAC,UAAU;;;;;"}
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* @deprecated Use the `Action` component instead
|
|
3
|
+
* @deprecated Use the `Action` component instead.
|
|
4
|
+
* Button triggers actions such as submitting forms, opening dialogs, or deleting records.
|
|
4
5
|
*/
|
|
5
6
|
export declare const ButtonBase: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & import("../../hoc/withTokens").WithTokensProps & {
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
variant?: import("./types").ButtonVariant | undefined;
|
|
8
|
-
size?: "
|
|
9
|
+
size?: import("./types").ButtonSize | undefined;
|
|
9
10
|
iconSlot?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
10
11
|
dropdown?: boolean | undefined;
|
|
11
12
|
loading?: boolean | undefined;
|
|
12
|
-
contentStyles?: React.CSSProperties | undefined;
|
|
13
|
-
as?: React.ElementType | undefined;
|
|
14
|
-
href?: string | undefined;
|
|
15
|
-
target?: string | undefined;
|
|
16
|
-
rel?: string | undefined;
|
|
17
13
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
18
14
|
export declare const Button: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement> & import("../../hoc/withTokens").WithTokensProps & {
|
|
19
15
|
children?: React.ReactNode;
|
|
20
16
|
variant?: import("./types").ButtonVariant | undefined;
|
|
21
|
-
size?: "
|
|
17
|
+
size?: import("./types").ButtonSize | undefined;
|
|
22
18
|
iconSlot?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
23
19
|
dropdown?: boolean | undefined;
|
|
24
20
|
loading?: boolean | undefined;
|
|
25
|
-
contentStyles?: React.CSSProperties | undefined;
|
|
26
|
-
as?: React.ElementType | undefined;
|
|
27
|
-
href?: string | undefined;
|
|
28
|
-
target?: string | undefined;
|
|
29
|
-
rel?: string | undefined;
|
|
30
21
|
} & React.RefAttributes<HTMLButtonElement>, "ref"> & import("../../hoc/withTokens").WithTokensProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import React__default, { forwardRef } from 'react';
|
|
2
|
-
import { Loader } from '../Loader/Loader.js';
|
|
3
2
|
import { withTokens } from '../../hoc/withTokens/withTokens.js';
|
|
3
|
+
import { DropdownIcon } from '../../icons/custom/components/DropdownIcon.js';
|
|
4
4
|
import { buildClassnames } from '../../utils/buildClassnames.js';
|
|
5
5
|
import 'uid/secure';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
6
|
+
import buttonStyles from '../Action/styles/button.module.scss.js';
|
|
7
|
+
import { getAppearanceClasses } from '../Action/utils.js';
|
|
8
|
+
import { Loader } from '../Loader/Loader.js';
|
|
9
9
|
|
|
10
|
-
/* eslint-disable react/button-has-type */
|
|
11
10
|
/**
|
|
12
|
-
* @deprecated Use the `Action` component instead
|
|
11
|
+
* @deprecated Use the `Action` component instead.
|
|
12
|
+
* Button triggers actions such as submitting forms, opening dialogs, or deleting records.
|
|
13
13
|
*/
|
|
14
|
-
const ButtonBase = forwardRef(({ className, children, iconSlot, variant = 'default', size = 'base', dropdown = false, loading = false,
|
|
15
|
-
const Element = as || 'button';
|
|
14
|
+
const ButtonBase = forwardRef(({ className, children, iconSlot, variant = 'default', size = 'base', dropdown = false, loading = false, disabled, type = 'button', ...otherProps }, ref) => {
|
|
16
15
|
if (variant === 'unstyled') {
|
|
17
|
-
return (React__default.createElement(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const hasIcon = !!iconSlot;
|
|
21
|
-
const iconSize = hasChildren || size === 'sm' ? 'var(--sizes-base)' : 'var(--sizes-md)';
|
|
22
|
-
const mainContentStyle = { ...assignCssVars({ buttonIconSize: iconSize }), ...contentStyles };
|
|
23
|
-
if (variant === 'link') {
|
|
24
|
-
return (React__default.createElement(Element, { ref: ref, className: buildClassnames([styles['link-variant'], hasChildren && styles.hasText, className]), ...otherProps },
|
|
25
|
-
(hasChildren || hasIcon) && (React__default.createElement("span", { className: buildClassnames([styles.mainContent, loading && styles.loading]), style: mainContentStyle },
|
|
26
|
-
iconSlot && iconSlot,
|
|
27
|
-
children !== undefined && children,
|
|
28
|
-
dropdown && React__default.createElement(DropdownIcon, null))),
|
|
29
|
-
loading && (React__default.createElement("div", { className: styles.loadingWrapper },
|
|
30
|
-
React__default.createElement(Loader, null)))));
|
|
16
|
+
return (React__default.createElement("button", { ...otherProps, ref: ref,
|
|
17
|
+
// eslint-disable-next-line react/button-has-type
|
|
18
|
+
type: type, className: getAppearanceClasses('unstyled', { className }), disabled: disabled || loading, "aria-busy": loading || undefined }, children));
|
|
31
19
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
loading
|
|
46
|
-
|
|
20
|
+
const isLink = variant === 'link';
|
|
21
|
+
const appearance = isLink ? 'link' : 'button';
|
|
22
|
+
const classNames = getAppearanceClasses(appearance, {
|
|
23
|
+
className,
|
|
24
|
+
variant: isLink ? undefined : variant,
|
|
25
|
+
disabled,
|
|
26
|
+
size,
|
|
27
|
+
dropdown,
|
|
28
|
+
iconSlot,
|
|
29
|
+
children,
|
|
30
|
+
});
|
|
31
|
+
return (React__default.createElement("button", { ...otherProps, ref: ref,
|
|
32
|
+
// eslint-disable-next-line react/button-has-type
|
|
33
|
+
type: type, className: classNames, disabled: disabled || loading, "aria-busy": loading || undefined }, isLink ? (React__default.createElement(React__default.Fragment, null,
|
|
34
|
+
iconSlot,
|
|
35
|
+
children,
|
|
36
|
+
dropdown && React__default.createElement(DropdownIcon, null))) : (React__default.createElement(React__default.Fragment, null,
|
|
37
|
+
React__default.createElement("span", { className: buildClassnames([
|
|
38
|
+
buttonStyles.content,
|
|
39
|
+
loading && buttonStyles.hideContent,
|
|
40
|
+
]) },
|
|
41
|
+
iconSlot,
|
|
42
|
+
children,
|
|
43
|
+
dropdown && React__default.createElement(DropdownIcon, null)),
|
|
44
|
+
loading && (React__default.createElement("div", { className: buttonStyles.loadingWrapper, role: "status", "aria-label": "Loading" },
|
|
45
|
+
React__default.createElement(Loader, { className: buttonStyles.loader })))))));
|
|
47
46
|
});
|
|
47
|
+
ButtonBase.displayName = 'Button';
|
|
48
48
|
const Button = withTokens(ButtonBase);
|
|
49
49
|
|
|
50
50
|
export { Button, ButtonBase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { forwardRef
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { withTokens } from '../../hoc/withTokens';\nimport { DropdownIcon } from '../../icons';\nimport { buildClassnames } from '../../utils';\nimport buttonStyles from '../Action/styles/button.module.scss';\nimport { getAppearanceClasses } from '../Action/utils';\nimport { Loader } from '../Loader';\nimport { ButtonProps } from './types';\n\n/**\n * @deprecated Use the `Action` component instead.\n * Button triggers actions such as submitting forms, opening dialogs, or deleting records.\n */\nexport const ButtonBase = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n children,\n iconSlot,\n variant = 'default',\n size = 'base',\n dropdown = false,\n loading = false,\n disabled,\n type = 'button',\n ...otherProps\n }: ButtonProps,\n ref,\n ) => {\n if (variant === 'unstyled') {\n return (\n <button\n {...otherProps}\n ref={ref}\n // eslint-disable-next-line react/button-has-type\n type={type}\n className={getAppearanceClasses('unstyled', { className })}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n >\n {children}\n </button>\n );\n }\n\n const isLink = variant === 'link';\n const appearance = isLink ? 'link' : 'button';\n\n const classNames = getAppearanceClasses(appearance, {\n className,\n variant: isLink ? undefined : variant,\n disabled,\n size,\n dropdown,\n iconSlot,\n children,\n });\n\n return (\n <button\n {...otherProps}\n ref={ref}\n // eslint-disable-next-line react/button-has-type\n type={type}\n className={classNames}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n >\n {isLink ? (\n <>\n {iconSlot}\n {children}\n {dropdown && <DropdownIcon />}\n </>\n ) : (\n <>\n <span\n className={buildClassnames([\n buttonStyles.content,\n loading && buttonStyles.hideContent,\n ])}\n >\n {iconSlot}\n {children}\n {dropdown && <DropdownIcon />}\n </span>\n {loading && (\n <div className={buttonStyles.loadingWrapper} role=\"status\" aria-label=\"Loading\">\n <Loader className={buttonStyles.loader} />\n </div>\n )}\n </>\n )}\n </button>\n );\n },\n);\n\nButtonBase.displayName = 'Button';\n\nexport const Button = withTokens(ButtonBase);\n"],"names":["React"],"mappings":";;;;;;;;;AAUA;;;AAGG;AACI,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,MAAM,EACb,QAAQ,GAAG,K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e,CAAC;AACzB,gBAAA,YAAY,CAAC,OAAO;gBACpB,OAAO,IAAI,YAAY,CAAC,WAAW;aACpC,CAAC,EAAA;YAED,QAAQ;YACR,QAAQ;AACR,YAAA,QAAQ,IAAIA,cAAA,CAAA,aAAA,CAAC,YAAY,EAAA,IAAA,CAAG,CACxB;AACN,QAAA,OAAO,KACNA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,YAAY,CAAC,cAAc,EAAE,IAAI,EAAC,QAAQ,gBAAY,SAAS,EAAA;AAC7E,YAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAE,YAAY,CAAC,MAAM,EAAA,CAAI,CACtC,CACP,CACA,CACJ,CACM;AAEb,CAAC;AAGH,UAAU,CAAC,WAAW,GAAG,QAAQ;MAEpB,MAAM,GAAG,UAAU,CAAC,UAAU;;;;"}
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonHTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { WithTokensProps } from '../../hoc/withTokens/withTokens';
|
|
3
3
|
export type ButtonVariant = 'default' | 'destructive' | 'primary' | 'primaryDestructive' | 'flat' | 'link' | 'unstyled';
|
|
4
|
+
export type ButtonSize = 'xs' | 'sm' | 'base';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* @deprecated Use `ActionProps` from the `Action` component instead
|
|
6
7
|
*/
|
|
7
8
|
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & WithTokensProps & {
|
|
8
9
|
children?: ReactNode;
|
|
9
10
|
/** Variant styles */
|
|
10
11
|
variant?: ButtonVariant;
|
|
11
12
|
/** Button sizes */
|
|
12
|
-
size?:
|
|
13
|
-
/** Icon */
|
|
13
|
+
size?: ButtonSize;
|
|
14
|
+
/** Icon rendered before children */
|
|
14
15
|
iconSlot?: ReactElement;
|
|
15
|
-
/** Renders a dropdown indicator
|
|
16
|
+
/** Renders a dropdown chevron indicator */
|
|
16
17
|
dropdown?: boolean;
|
|
17
|
-
/**
|
|
18
|
+
/** Shows a loading spinner */
|
|
18
19
|
loading?: boolean;
|
|
19
|
-
/** Additional styles for mainContent */
|
|
20
|
-
contentStyles?: CSSProperties;
|
|
21
|
-
/** Render as a different element type (e.g. 'a' for links) */
|
|
22
|
-
as?: ElementType;
|
|
23
|
-
/** URL when rendered as an anchor (use with as="a") */
|
|
24
|
-
href?: string;
|
|
25
|
-
/** Link target (use with as="a") */
|
|
26
|
-
target?: string;
|
|
27
|
-
/** Link rel attribute (use with as="a") */
|
|
28
|
-
rel?: string;
|
|
29
20
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
4
5
|
var CardHeader = require('../CardHeader/CardHeader.cjs');
|
|
5
|
-
var
|
|
6
|
+
var buildClassnames = require('../../utils/buildClassnames.cjs');
|
|
7
|
+
require('uid/secure');
|
|
8
|
+
var Card_module = require('./Card.module.scss.cjs');
|
|
6
9
|
|
|
7
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
11
|
|
|
@@ -12,6 +15,30 @@ const collapseAnimationVariants = {
|
|
|
12
15
|
expanded: { height: 'auto' },
|
|
13
16
|
collapsed: { height: 0 },
|
|
14
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Stable class used for styled-components selector interpolation.
|
|
20
|
+
* Consumers (e.g. Modal) use `& > ${Card.Surface}` in template literals,
|
|
21
|
+
* which calls `.toString()` and expects a CSS class selector.
|
|
22
|
+
*/
|
|
23
|
+
const SURFACE_STABLE_CLASS = 'veeqo-card-surface';
|
|
24
|
+
const Surface = React__default.default.forwardRef(({ elevation = 1, accent, className, children, ...rest }, ref) => (React__default.default.createElement("div", { ref: ref, className: buildClassnames.buildClassnames([
|
|
25
|
+
SURFACE_STABLE_CLASS,
|
|
26
|
+
Card_module.surface,
|
|
27
|
+
Card_module[`elevation-${elevation}`],
|
|
28
|
+
accent ? Card_module[`accent-${accent}`] : undefined,
|
|
29
|
+
className,
|
|
30
|
+
]), ...rest }, children)));
|
|
31
|
+
Surface.displayName = 'Card.Surface';
|
|
32
|
+
Surface.toString = () => `.${SURFACE_STABLE_CLASS}`;
|
|
33
|
+
const Section = React__default.default.forwardRef(({ className, ...rest }, ref) => (React__default.default.createElement("section", { ref: ref, className: buildClassnames.buildClassnames([Card_module.section, className]), ...rest })));
|
|
34
|
+
Section.displayName = 'Card.Section';
|
|
35
|
+
const FullBleed = React__default.default.forwardRef(({ className, ...rest }, ref) => (React__default.default.createElement("div", { ref: ref, className: buildClassnames.buildClassnames([Card_module.fullBleed, className]), ...rest })));
|
|
36
|
+
FullBleed.displayName = 'Card.FullBleed';
|
|
37
|
+
const FOOTER_STABLE_CLASS = 'veeqo-card-footer';
|
|
38
|
+
const Footer = React__default.default.forwardRef(({ className, ...rest }, ref) => (React__default.default.createElement("footer", { ref: ref, className: buildClassnames.buildClassnames([FOOTER_STABLE_CLASS, Card_module.footer, className]), ...rest })));
|
|
39
|
+
Footer.displayName = 'Card.Footer';
|
|
40
|
+
Footer.toString = () => `.${FOOTER_STABLE_CLASS}`;
|
|
41
|
+
/* --- Main Card component --- */
|
|
15
42
|
const Card = ({ className, style, title, subtitle, headerTitleSlot, headerActionSlot, action, collapsable, elevation, accent, children, onClose, renderFooter, }) => {
|
|
16
43
|
const [isCollapsed, setIsCollapsed] = React.useState(false);
|
|
17
44
|
const toggleCollapsed = () => {
|
|
@@ -20,18 +47,18 @@ const Card = ({ className, style, title, subtitle, headerTitleSlot, headerAction
|
|
|
20
47
|
const showHeader = title || headerTitleSlot !== undefined;
|
|
21
48
|
const headerMarkup = showHeader && (React__default.default.createElement(CardHeader.CardHeader, { title: title, subtitle: subtitle, titleSlot: headerTitleSlot, actionSlot: headerActionSlot, action: action, onClickClose: onClose, isCollapsed: isCollapsed, onClickCollapse: collapsable ? toggleCollapsed : undefined }));
|
|
22
49
|
const showBody = (collapsable && !isCollapsed) || !collapsable;
|
|
23
|
-
const bodyMarkup = (React__default.default.createElement(
|
|
24
|
-
React__default.default.createElement(
|
|
25
|
-
const footerMarkup = renderFooter !== undefined && React__default.default.createElement(
|
|
26
|
-
return (React__default.default.createElement(
|
|
50
|
+
const bodyMarkup = (React__default.default.createElement(framerMotion.motion.div, { className: Card_module.body, animate: showBody ? 'expanded' : 'collapsed', variants: collapseAnimationVariants, transition: { duration: 0.3, ease: 'easeOut' } },
|
|
51
|
+
React__default.default.createElement(Section, null, children)));
|
|
52
|
+
const footerMarkup = renderFooter !== undefined && React__default.default.createElement(Footer, null, renderFooter());
|
|
53
|
+
return (React__default.default.createElement(Surface, { className: className, style: style, elevation: elevation, accent: accent },
|
|
27
54
|
headerMarkup,
|
|
28
55
|
bodyMarkup,
|
|
29
56
|
footerMarkup));
|
|
30
57
|
};
|
|
31
|
-
Card.Surface =
|
|
32
|
-
Card.Section =
|
|
33
|
-
Card.FullBleed =
|
|
34
|
-
Card.Footer =
|
|
58
|
+
Card.Surface = Surface;
|
|
59
|
+
Card.Section = Section;
|
|
60
|
+
Card.FullBleed = FullBleed;
|
|
61
|
+
Card.Footer = Footer;
|
|
35
62
|
|
|
36
63
|
exports.Card = Card;
|
|
37
64
|
//# sourceMappingURL=Card.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.cjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\n\nimport { CardHeader } from '../CardHeader';\nimport {
|
|
1
|
+
{"version":3,"file":"Card.cjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { motion } from 'framer-motion';\n\nimport { CardHeader } from '../CardHeader';\nimport { buildClassnames } from '../../utils';\nimport styles from './Card.module.scss';\n\nexport type CardElevation = 0 | 1 | 2 | 3 | 4;\n\nconst collapseAnimationVariants = {\n expanded: { height: 'auto' },\n collapsed: { height: 0 },\n};\n\ntype CardAction = {\n title: string;\n onClick: () => void;\n};\n\nexport type CardProps = {\n className?: string;\n style?: React.CSSProperties;\n title?: string;\n subtitle?: string;\n headerTitleSlot?: React.ReactNode;\n headerActionSlot?: React.ReactNode;\n action?: CardAction;\n collapsable?: boolean;\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children: ReactNode;\n onClose?: () => void;\n renderFooter?: () => ReactNode;\n};\n\n/* --- Sub-components --- */\n\nexport interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children?: ReactNode;\n}\n\n/**\n * Stable class used for styled-components selector interpolation.\n * Consumers (e.g. Modal) use `& > ${Card.Surface}` in template literals,\n * which calls `.toString()` and expects a CSS class selector.\n */\nconst SURFACE_STABLE_CLASS = 'veeqo-card-surface';\n\nconst Surface = React.forwardRef<HTMLDivElement, SurfaceProps>(\n ({ elevation = 1, accent, className, children, ...rest }, ref) => (\n <div\n ref={ref}\n className={buildClassnames([\n SURFACE_STABLE_CLASS,\n styles.surface,\n styles[`elevation-${elevation}`],\n accent ? styles[`accent-${accent}`] : undefined,\n className,\n ])}\n {...rest}\n >\n {children}\n </div>\n ),\n);\nSurface.displayName = 'Card.Surface';\nSurface.toString = () => `.${SURFACE_STABLE_CLASS}`;\n\nconst Section = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <section ref={ref} className={buildClassnames([styles.section, className])} {...rest} />\n ),\n);\nSection.displayName = 'Card.Section';\n\nconst FullBleed = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...rest }, ref) => (\n <div ref={ref} className={buildClassnames([styles.fullBleed, className])} {...rest} />\n ),\n);\nFullBleed.displayName = 'Card.FullBleed';\n\nconst FOOTER_STABLE_CLASS = 'veeqo-card-footer';\n\nconst Footer = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <footer ref={ref} className={buildClassnames([FOOTER_STABLE_CLASS, styles.footer, className])} {...rest} />\n ),\n);\nFooter.displayName = 'Card.Footer';\nFooter.toString = () => `.${FOOTER_STABLE_CLASS}`;\n\n/* --- Main Card component --- */\n\nexport const Card = ({\n className,\n style,\n title,\n subtitle,\n headerTitleSlot,\n headerActionSlot,\n action,\n collapsable,\n elevation,\n accent,\n children,\n onClose,\n renderFooter,\n}: CardProps) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n\n const toggleCollapsed = () => {\n setIsCollapsed(!isCollapsed);\n };\n\n const showHeader = title || headerTitleSlot !== undefined;\n const headerMarkup = showHeader && (\n <CardHeader\n title={title}\n subtitle={subtitle}\n titleSlot={headerTitleSlot}\n actionSlot={headerActionSlot}\n action={action}\n onClickClose={onClose}\n isCollapsed={isCollapsed}\n onClickCollapse={collapsable ? toggleCollapsed : undefined}\n />\n );\n\n const showBody = (collapsable && !isCollapsed) || !collapsable;\n const bodyMarkup = (\n <motion.div\n className={styles.body}\n animate={showBody ? 'expanded' : 'collapsed'}\n variants={collapseAnimationVariants}\n transition={{ duration: 0.3, ease: 'easeOut' }}\n >\n <Section>{children}</Section>\n </motion.div>\n );\n\n const footerMarkup = renderFooter !== undefined && <Footer>{renderFooter()}</Footer>;\n\n return (\n <Surface className={className} style={style} elevation={elevation} accent={accent}>\n {headerMarkup}\n {bodyMarkup}\n {footerMarkup}\n </Surface>\n );\n};\n\nCard.Surface = Surface;\nCard.Section = Section;\nCard.FullBleed = FullBleed;\nCard.Footer = Footer;\n"],"names":["React","buildClassnames","styles","useState","CardHeader","motion"],"mappings":";;;;;;;;;;;;;AASA,MAAM,yBAAyB,GAAG;AAChC,IAAA,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;AAC5B,IAAA,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;CACzB;AA+BD;;;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ACrB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,WAAW,GAAG,eAAe,GAAG,SAAS,EAAA,CAC1D,CACH;IAED,MAAM,QAAQ,GAAG,CAAC,WAAW,IAAI,CAAC,WAAW,KAAK,CAAC,WAAW;AAC9D,IAAA,MAAM,UAAU,IACdJ,qCAACK,mBAAM,CAAC,GAAG,EAAA,EACT,SAAS,EAAEH,WAAM,CAAC,IAAI,EACtB,OAAO,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,EAC5C,QAAQ,EAAE,yBAAyB,EACnC,UAAU,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,EAAA;AAE9C,QAAAF,sBAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA,EAAE,QAAQ,CAAW,CAClB,CACd;AAED,IAAA,MAAM,YAAY,GAAG,YAAY,KAAK,SAAS,IAAIA,sBAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA,EAAE,YAAY,EAAE,CAAU;AAEpF,IAAA,QACEA,sBAAA,CAAA,aAAA,CAAC,OAAO,IAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAA;QAC9E,YAAY;QACZ,UAAU;QACV,YAAY,CACL;AAEd;AAEA,IAAI,CAAC,OAAO,GAAG,OAAO;AACtB,IAAI,CAAC,OAAO,GAAG,OAAO;AACtB,IAAI,CAAC,SAAS,GAAG,SAAS;AAC1B,IAAI,CAAC,MAAM,GAAG,MAAM;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
export type CardElevation = 0 | 1 | 2 | 3 | 4;
|
|
3
3
|
type CardAction = {
|
|
4
4
|
title: string;
|
|
5
5
|
onClick: () => void;
|
|
@@ -19,11 +19,16 @@ export type CardProps = {
|
|
|
19
19
|
onClose?: () => void;
|
|
20
20
|
renderFooter?: () => ReactNode;
|
|
21
21
|
};
|
|
22
|
+
export interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
elevation?: CardElevation;
|
|
24
|
+
accent?: 'info' | 'success' | 'error';
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
}
|
|
22
27
|
export declare const Card: {
|
|
23
28
|
({ className, style, title, subtitle, headerTitleSlot, headerActionSlot, action, collapsable, elevation, accent, children, onClose, renderFooter, }: CardProps): React.JSX.Element;
|
|
24
|
-
Surface:
|
|
25
|
-
Section:
|
|
26
|
-
FullBleed:
|
|
27
|
-
Footer:
|
|
29
|
+
Surface: React.ForwardRefExoticComponent<SurfaceProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
Section: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
31
|
+
FullBleed: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
Footer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
28
33
|
};
|
|
29
34
|
export {};
|
|
@@ -1,11 +1,38 @@
|
|
|
1
1
|
import React__default, { useState } from 'react';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
2
3
|
import { CardHeader } from '../CardHeader/CardHeader.js';
|
|
3
|
-
import {
|
|
4
|
+
import { buildClassnames } from '../../utils/buildClassnames.js';
|
|
5
|
+
import 'uid/secure';
|
|
6
|
+
import styles from './Card.module.scss.js';
|
|
4
7
|
|
|
5
8
|
const collapseAnimationVariants = {
|
|
6
9
|
expanded: { height: 'auto' },
|
|
7
10
|
collapsed: { height: 0 },
|
|
8
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Stable class used for styled-components selector interpolation.
|
|
14
|
+
* Consumers (e.g. Modal) use `& > ${Card.Surface}` in template literals,
|
|
15
|
+
* which calls `.toString()` and expects a CSS class selector.
|
|
16
|
+
*/
|
|
17
|
+
const SURFACE_STABLE_CLASS = 'veeqo-card-surface';
|
|
18
|
+
const Surface = React__default.forwardRef(({ elevation = 1, accent, className, children, ...rest }, ref) => (React__default.createElement("div", { ref: ref, className: buildClassnames([
|
|
19
|
+
SURFACE_STABLE_CLASS,
|
|
20
|
+
styles.surface,
|
|
21
|
+
styles[`elevation-${elevation}`],
|
|
22
|
+
accent ? styles[`accent-${accent}`] : undefined,
|
|
23
|
+
className,
|
|
24
|
+
]), ...rest }, children)));
|
|
25
|
+
Surface.displayName = 'Card.Surface';
|
|
26
|
+
Surface.toString = () => `.${SURFACE_STABLE_CLASS}`;
|
|
27
|
+
const Section = React__default.forwardRef(({ className, ...rest }, ref) => (React__default.createElement("section", { ref: ref, className: buildClassnames([styles.section, className]), ...rest })));
|
|
28
|
+
Section.displayName = 'Card.Section';
|
|
29
|
+
const FullBleed = React__default.forwardRef(({ className, ...rest }, ref) => (React__default.createElement("div", { ref: ref, className: buildClassnames([styles.fullBleed, className]), ...rest })));
|
|
30
|
+
FullBleed.displayName = 'Card.FullBleed';
|
|
31
|
+
const FOOTER_STABLE_CLASS = 'veeqo-card-footer';
|
|
32
|
+
const Footer = React__default.forwardRef(({ className, ...rest }, ref) => (React__default.createElement("footer", { ref: ref, className: buildClassnames([FOOTER_STABLE_CLASS, styles.footer, className]), ...rest })));
|
|
33
|
+
Footer.displayName = 'Card.Footer';
|
|
34
|
+
Footer.toString = () => `.${FOOTER_STABLE_CLASS}`;
|
|
35
|
+
/* --- Main Card component --- */
|
|
9
36
|
const Card = ({ className, style, title, subtitle, headerTitleSlot, headerActionSlot, action, collapsable, elevation, accent, children, onClose, renderFooter, }) => {
|
|
10
37
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
11
38
|
const toggleCollapsed = () => {
|
|
@@ -14,7 +41,7 @@ const Card = ({ className, style, title, subtitle, headerTitleSlot, headerAction
|
|
|
14
41
|
const showHeader = title || headerTitleSlot !== undefined;
|
|
15
42
|
const headerMarkup = showHeader && (React__default.createElement(CardHeader, { title: title, subtitle: subtitle, titleSlot: headerTitleSlot, actionSlot: headerActionSlot, action: action, onClickClose: onClose, isCollapsed: isCollapsed, onClickCollapse: collapsable ? toggleCollapsed : undefined }));
|
|
16
43
|
const showBody = (collapsable && !isCollapsed) || !collapsable;
|
|
17
|
-
const bodyMarkup = (React__default.createElement(
|
|
44
|
+
const bodyMarkup = (React__default.createElement(motion.div, { className: styles.body, animate: showBody ? 'expanded' : 'collapsed', variants: collapseAnimationVariants, transition: { duration: 0.3, ease: 'easeOut' } },
|
|
18
45
|
React__default.createElement(Section, null, children)));
|
|
19
46
|
const footerMarkup = renderFooter !== undefined && React__default.createElement(Footer, null, renderFooter());
|
|
20
47
|
return (React__default.createElement(Surface, { className: className, style: style, elevation: elevation, accent: accent },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\n\nimport { CardHeader } from '../CardHeader';\nimport {
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { motion } from 'framer-motion';\n\nimport { CardHeader } from '../CardHeader';\nimport { buildClassnames } from '../../utils';\nimport styles from './Card.module.scss';\n\nexport type CardElevation = 0 | 1 | 2 | 3 | 4;\n\nconst collapseAnimationVariants = {\n expanded: { height: 'auto' },\n collapsed: { height: 0 },\n};\n\ntype CardAction = {\n title: string;\n onClick: () => void;\n};\n\nexport type CardProps = {\n className?: string;\n style?: React.CSSProperties;\n title?: string;\n subtitle?: string;\n headerTitleSlot?: React.ReactNode;\n headerActionSlot?: React.ReactNode;\n action?: CardAction;\n collapsable?: boolean;\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children: ReactNode;\n onClose?: () => void;\n renderFooter?: () => ReactNode;\n};\n\n/* --- Sub-components --- */\n\nexport interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {\n elevation?: CardElevation;\n accent?: 'info' | 'success' | 'error';\n children?: ReactNode;\n}\n\n/**\n * Stable class used for styled-components selector interpolation.\n * Consumers (e.g. Modal) use `& > ${Card.Surface}` in template literals,\n * which calls `.toString()` and expects a CSS class selector.\n */\nconst SURFACE_STABLE_CLASS = 'veeqo-card-surface';\n\nconst Surface = React.forwardRef<HTMLDivElement, SurfaceProps>(\n ({ elevation = 1, accent, className, children, ...rest }, ref) => (\n <div\n ref={ref}\n className={buildClassnames([\n SURFACE_STABLE_CLASS,\n styles.surface,\n styles[`elevation-${elevation}`],\n accent ? styles[`accent-${accent}`] : undefined,\n className,\n ])}\n {...rest}\n >\n {children}\n </div>\n ),\n);\nSurface.displayName = 'Card.Surface';\nSurface.toString = () => `.${SURFACE_STABLE_CLASS}`;\n\nconst Section = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <section ref={ref} className={buildClassnames([styles.section, className])} {...rest} />\n ),\n);\nSection.displayName = 'Card.Section';\n\nconst FullBleed = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...rest }, ref) => (\n <div ref={ref} className={buildClassnames([styles.fullBleed, className])} {...rest} />\n ),\n);\nFullBleed.displayName = 'Card.FullBleed';\n\nconst FOOTER_STABLE_CLASS = 'veeqo-card-footer';\n\nconst Footer = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...rest }, ref) => (\n <footer ref={ref} className={buildClassnames([FOOTER_STABLE_CLASS, styles.footer, className])} {...rest} />\n ),\n);\nFooter.displayName = 'Card.Footer';\nFooter.toString = () => `.${FOOTER_STABLE_CLASS}`;\n\n/* --- Main Card component --- */\n\nexport const Card = ({\n className,\n style,\n title,\n subtitle,\n headerTitleSlot,\n headerActionSlot,\n action,\n collapsable,\n elevation,\n accent,\n children,\n onClose,\n renderFooter,\n}: CardProps) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n\n const toggleCollapsed = () => {\n setIsCollapsed(!isCollapsed);\n };\n\n const showHeader = title || headerTitleSlot !== undefined;\n const headerMarkup = showHeader && (\n <CardHeader\n title={title}\n subtitle={subtitle}\n titleSlot={headerTitleSlot}\n actionSlot={headerActionSlot}\n action={action}\n onClickClose={onClose}\n isCollapsed={isCollapsed}\n onClickCollapse={collapsable ? toggleCollapsed : undefined}\n />\n );\n\n const showBody = (collapsable && !isCollapsed) || !collapsable;\n const bodyMarkup = (\n <motion.div\n className={styles.body}\n animate={showBody ? 'expanded' : 'collapsed'}\n variants={collapseAnimationVariants}\n transition={{ duration: 0.3, ease: 'easeOut' }}\n >\n <Section>{children}</Section>\n </motion.div>\n );\n\n const footerMarkup = renderFooter !== undefined && <Footer>{renderFooter()}</Footer>;\n\n return (\n <Surface className={className} style={style} elevation={elevation} accent={accent}>\n {headerMarkup}\n {bodyMarkup}\n {footerMarkup}\n </Surface>\n );\n};\n\nCard.Surface = Surface;\nCard.Section = Section;\nCard.FullBleed = FullBleed;\nCard.Footer = Footer;\n"],"names":["React"],"mappings":";;;;;;;AASA,MAAM,yBAAyB,GAAG;AAChC,IAAA,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;AAC5B,IAAA,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;CACzB;AA+BD;;;;AAIG;AACH,MAAM,oBAAoB,GAAG,oBAAoB;AAEjD,MAAM,OAAO,GAAGA,cAAK,CAAC,UAAU,CAC9B,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,MAC3DA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,CAAC;QACzB,oBAAoB;AACpB,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,CAAA,UAAA,EAAa,SAAS,CAAA,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AE9C,QAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA,EAAE,QAAQ,CAAW,CAClB,CACd;AAED,IAAA,MAAM,YAAY,GAAG,YAAY,KAAK,SAAS,IAAIA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA,EAAE,YAAY,EAAE,CAAU;AAEpF,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,OAAO,IAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAA;QAC9E,YAAY;QACZ,UAAU;QACV,YAAY,CACL;AAEd;AAEA,IAAI,CAAC,OAAO,GAAG,OAAO;AACtB,IAAI,CAAC,OAAO,GAAG,OAAO;AACtB,IAAI,CAAC,SAAS,GAAG,SAAS;AAC1B,IAAI,CAAC,MAAM,GAAG,MAAM;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._surface_1a6rc_1 {\n position: relative;\n width: 100%;\n background-color: white;\n border: var(--sizes-line) solid var(--colors-neutral-grey-base);\n border-radius: var(--radius-md);\n overflow: hidden;\n box-sizing: border-box;\n}\n\n/* Elevation levels */\n._elevation-0_1a6rc_12 {\n box-shadow: none;\n}\n\n._elevation-1_1a6rc_16 {\n box-shadow: var(--shadows-sm);\n}\n\n._elevation-2_1a6rc_20 {\n box-shadow: var(--shadows-base);\n}\n\n._elevation-3_1a6rc_24 {\n box-shadow: var(--shadows-md);\n}\n\n._elevation-4_1a6rc_28 {\n box-shadow: var(--shadows-lg);\n}\n\n/* Accent bar via pseudo-element */\n._accent-info_1a6rc_33::after,\n._accent-success_1a6rc_34::after,\n._accent-error_1a6rc_35::after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: var(--sizes-xs);\n}\n\n._accent-info_1a6rc_33::after {\n background-color: var(--colors-secondary-blue-base);\n}\n\n._accent-success_1a6rc_34::after {\n background-color: var(--colors-secondary-green-base);\n}\n\n._accent-error_1a6rc_35::after {\n background-color: var(--colors-secondary-red-base);\n}\n\n/* Body: motion.div wrapper for collapse */\n._body_1a6rc_57 {\n overflow-y: hidden;\n}\n._body_1a6rc_57:not(:first-child) > ._section_1a6rc_60:first-child {\n margin-top: 0;\n}\n\n/* Section */\n._section_1a6rc_60 {\n padding-right: var(--sizes-md);\n padding-left: var(--sizes-md);\n margin-top: var(--sizes-md);\n margin-bottom: var(--sizes-md);\n font-family: var(--text-body-font-family);\n font-size: var(--text-body-font-size);\n font-weight: var(--text-body-font-weight);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n}\n._section_1a6rc_60 + ._section_1a6rc_60 {\n border-top: var(--sizes-line) solid var(--colors-neutral-grey-base);\n padding-top: var(--sizes-md);\n}\n\n/* FullBleed */\n._fullBleed_1a6rc_82 {\n margin-left: calc(-1 * var(--sizes-md));\n margin-right: calc(-1 * var(--sizes-md));\n}\n\n/* Footer */\n._footer_1a6rc_88 {\n margin-top: var(--sizes-base);\n padding: var(--sizes-md);\n z-index: 2;\n}");
|
|
6
|
+
var styles = {"surface":"_surface_1a6rc_1","elevation-0":"_elevation-0_1a6rc_12","elevation-1":"_elevation-1_1a6rc_16","elevation-2":"_elevation-2_1a6rc_20","elevation-3":"_elevation-3_1a6rc_24","elevation-4":"_elevation-4_1a6rc_28","accent-info":"_accent-info_1a6rc_33","accent-success":"_accent-success_1a6rc_34","accent-error":"_accent-error_1a6rc_35","body":"_body_1a6rc_57","section":"_section_1a6rc_60","fullBleed":"_fullBleed_1a6rc_82","footer":"_footer_1a6rc_88"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=Card.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.module.scss.cjs","sources":["../../../src/components/Card/Card.module.scss"],"sourcesContent":[".surface {\n position: relative;\n width: 100%;\n background-color: white;\n border: var(--sizes-line) solid var(--colors-neutral-grey-base);\n border-radius: var(--radius-md);\n overflow: hidden;\n box-sizing: border-box;\n}\n\n/* Elevation levels */\n.elevation-0 {\n box-shadow: none;\n}\n\n.elevation-1 {\n box-shadow: var(--shadows-sm);\n}\n\n.elevation-2 {\n box-shadow: var(--shadows-base);\n}\n\n.elevation-3 {\n box-shadow: var(--shadows-md);\n}\n\n.elevation-4 {\n box-shadow: var(--shadows-lg);\n}\n\n/* Accent bar via pseudo-element */\n.accent-info::after,\n.accent-success::after,\n.accent-error::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: var(--sizes-xs);\n}\n\n.accent-info::after {\n background-color: var(--colors-secondary-blue-base);\n}\n\n.accent-success::after {\n background-color: var(--colors-secondary-green-base);\n}\n\n.accent-error::after {\n background-color: var(--colors-secondary-red-base);\n}\n\n/* Body: motion.div wrapper for collapse */\n.body {\n overflow-y: hidden;\n\n &:not(:first-child) > .section:first-child {\n margin-top: 0;\n }\n}\n\n/* Section */\n.section {\n padding-right: var(--sizes-md);\n padding-left: var(--sizes-md);\n margin-top: var(--sizes-md);\n margin-bottom: var(--sizes-md);\n\n font-family: var(--text-body-font-family);\n font-size: var(--text-body-font-size);\n font-weight: var(--text-body-font-weight);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n\n & + & {\n border-top: var(--sizes-line) solid var(--colors-neutral-grey-base);\n padding-top: var(--sizes-md);\n }\n}\n\n/* FullBleed */\n.fullBleed {\n margin-left: calc(-1 * var(--sizes-md));\n margin-right: calc(-1 * var(--sizes-md));\n}\n\n/* Footer */\n.footer {\n margin-top: var(--sizes-base);\n padding: var(--sizes-md);\n z-index: 2;\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,8iEAAA;AACA,aAAA,CAAA,SAAA,CAAA,kBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,cAAA,CAAA,wBAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,WAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,kBAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._surface_1a6rc_1 {\n position: relative;\n width: 100%;\n background-color: white;\n border: var(--sizes-line) solid var(--colors-neutral-grey-base);\n border-radius: var(--radius-md);\n overflow: hidden;\n box-sizing: border-box;\n}\n\n/* Elevation levels */\n._elevation-0_1a6rc_12 {\n box-shadow: none;\n}\n\n._elevation-1_1a6rc_16 {\n box-shadow: var(--shadows-sm);\n}\n\n._elevation-2_1a6rc_20 {\n box-shadow: var(--shadows-base);\n}\n\n._elevation-3_1a6rc_24 {\n box-shadow: var(--shadows-md);\n}\n\n._elevation-4_1a6rc_28 {\n box-shadow: var(--shadows-lg);\n}\n\n/* Accent bar via pseudo-element */\n._accent-info_1a6rc_33::after,\n._accent-success_1a6rc_34::after,\n._accent-error_1a6rc_35::after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: var(--sizes-xs);\n}\n\n._accent-info_1a6rc_33::after {\n background-color: var(--colors-secondary-blue-base);\n}\n\n._accent-success_1a6rc_34::after {\n background-color: var(--colors-secondary-green-base);\n}\n\n._accent-error_1a6rc_35::after {\n background-color: var(--colors-secondary-red-base);\n}\n\n/* Body: motion.div wrapper for collapse */\n._body_1a6rc_57 {\n overflow-y: hidden;\n}\n._body_1a6rc_57:not(:first-child) > ._section_1a6rc_60:first-child {\n margin-top: 0;\n}\n\n/* Section */\n._section_1a6rc_60 {\n padding-right: var(--sizes-md);\n padding-left: var(--sizes-md);\n margin-top: var(--sizes-md);\n margin-bottom: var(--sizes-md);\n font-family: var(--text-body-font-family);\n font-size: var(--text-body-font-size);\n font-weight: var(--text-body-font-weight);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n}\n._section_1a6rc_60 + ._section_1a6rc_60 {\n border-top: var(--sizes-line) solid var(--colors-neutral-grey-base);\n padding-top: var(--sizes-md);\n}\n\n/* FullBleed */\n._fullBleed_1a6rc_82 {\n margin-left: calc(-1 * var(--sizes-md));\n margin-right: calc(-1 * var(--sizes-md));\n}\n\n/* Footer */\n._footer_1a6rc_88 {\n margin-top: var(--sizes-base);\n padding: var(--sizes-md);\n z-index: 2;\n}");
|
|
4
|
+
var styles = {"surface":"_surface_1a6rc_1","elevation-0":"_elevation-0_1a6rc_12","elevation-1":"_elevation-1_1a6rc_16","elevation-2":"_elevation-2_1a6rc_20","elevation-3":"_elevation-3_1a6rc_24","elevation-4":"_elevation-4_1a6rc_28","accent-info":"_accent-info_1a6rc_33","accent-success":"_accent-success_1a6rc_34","accent-error":"_accent-error_1a6rc_35","body":"_body_1a6rc_57","section":"_section_1a6rc_60","fullBleed":"_fullBleed_1a6rc_82","footer":"_footer_1a6rc_88"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=Card.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.module.scss.js","sources":["../../../src/components/Card/Card.module.scss"],"sourcesContent":[".surface {\n position: relative;\n width: 100%;\n background-color: white;\n border: var(--sizes-line) solid var(--colors-neutral-grey-base);\n border-radius: var(--radius-md);\n overflow: hidden;\n box-sizing: border-box;\n}\n\n/* Elevation levels */\n.elevation-0 {\n box-shadow: none;\n}\n\n.elevation-1 {\n box-shadow: var(--shadows-sm);\n}\n\n.elevation-2 {\n box-shadow: var(--shadows-base);\n}\n\n.elevation-3 {\n box-shadow: var(--shadows-md);\n}\n\n.elevation-4 {\n box-shadow: var(--shadows-lg);\n}\n\n/* Accent bar via pseudo-element */\n.accent-info::after,\n.accent-success::after,\n.accent-error::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: var(--sizes-xs);\n}\n\n.accent-info::after {\n background-color: var(--colors-secondary-blue-base);\n}\n\n.accent-success::after {\n background-color: var(--colors-secondary-green-base);\n}\n\n.accent-error::after {\n background-color: var(--colors-secondary-red-base);\n}\n\n/* Body: motion.div wrapper for collapse */\n.body {\n overflow-y: hidden;\n\n &:not(:first-child) > .section:first-child {\n margin-top: 0;\n }\n}\n\n/* Section */\n.section {\n padding-right: var(--sizes-md);\n padding-left: var(--sizes-md);\n margin-top: var(--sizes-md);\n margin-bottom: var(--sizes-md);\n\n font-family: var(--text-body-font-family);\n font-size: var(--text-body-font-size);\n font-weight: var(--text-body-font-weight);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n\n & + & {\n border-top: var(--sizes-line) solid var(--colors-neutral-grey-base);\n padding-top: var(--sizes-md);\n }\n}\n\n/* FullBleed */\n.fullBleed {\n margin-left: calc(-1 * var(--sizes-md));\n margin-right: calc(-1 * var(--sizes-md));\n}\n\n/* Footer */\n.footer {\n margin-top: var(--sizes-base);\n padding: var(--sizes-md);\n z-index: 2;\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,8iEAAA;AACA,aAAA,CAAA,SAAA,CAAA,kBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,aAAA,CAAA,uBAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,cAAA,CAAA,wBAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,WAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,kBAAA;;;;"}
|