@lidofinance/lido-app-ui 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -1
- package/dist/README.md +22 -1
- package/dist/cjs/breadcrumbs/Breadcrumbs.cjs +10 -3
- package/dist/cjs/breadcrumbs/Breadcrumbs.cjs.map +1 -1
- package/dist/cjs/button/Button.cjs +7 -7
- package/dist/cjs/button/Button.cjs.map +1 -1
- package/dist/cjs/button/ButtonContent.cjs +0 -2
- package/dist/cjs/button/ButtonContent.cjs.map +1 -1
- package/dist/cjs/button/LinkButton.cjs +6 -35
- package/dist/cjs/button/LinkButton.cjs.map +1 -1
- package/dist/cjs/counter/Counter.module.css.cjs +1 -1
- package/dist/cjs/disclaimer/Disclaimer.cjs +0 -1
- package/dist/cjs/disclaimer/Disclaimer.cjs.map +1 -1
- package/dist/cjs/icon-button/CloseButton.cjs.map +1 -1
- package/dist/cjs/icon-button/IconButton.cjs +7 -7
- package/dist/cjs/icon-button/IconButton.cjs.map +1 -1
- package/dist/cjs/index.cjs +3 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.css +10 -4
- package/dist/cjs/info-tooltip/InfoTooltip.cjs +4 -4
- package/dist/cjs/info-tooltip/InfoTooltip.cjs.map +1 -1
- package/dist/cjs/info-tooltip/InfoTooltip.module.css.cjs +1 -1
- package/dist/cjs/link-provider/Anchor.cjs +19 -6
- package/dist/cjs/link-provider/Anchor.cjs.map +1 -1
- package/dist/cjs/link-provider/LinkProvider.cjs +1 -1
- package/dist/cjs/link-provider/LinkProvider.cjs.map +1 -1
- package/dist/cjs/logo/Logo.cjs.map +1 -1
- package/dist/cjs/nav-link/NavLink.cjs +7 -3
- package/dist/cjs/nav-link/NavLink.cjs.map +1 -1
- package/dist/cjs/rich-input/RichInput.cjs +23 -3
- package/dist/cjs/rich-input/RichInput.cjs.map +1 -1
- package/dist/cjs/rich-input/RichInput.module.css.cjs +1 -1
- package/dist/cjs/sidebar/SidebarToggle.cjs.map +1 -1
- package/dist/cjs/small-card/SmallCard.cjs.map +1 -1
- package/dist/cjs/tag/Tag.cjs.map +1 -1
- package/dist/cjs/tag/Tag.module.css.cjs +1 -1
- package/dist/cjs/text-link/TextLink.cjs +1 -3
- package/dist/cjs/text-link/TextLink.cjs.map +1 -1
- package/dist/cjs/theme-switcher/ThemeSwitcher.cjs.map +1 -1
- package/dist/cjs/typography/Typography.cjs +21 -8
- package/dist/cjs/typography/Typography.cjs.map +1 -1
- package/dist/cjs/typography/Typography.module.css.cjs +1 -1
- package/dist/cjs/utils/ActionElement.cjs +1 -1
- package/dist/cjs/utils/ActionElement.cjs.map +1 -1
- package/dist/cjs/utils/joinAriaLabel.cjs +8 -0
- package/dist/cjs/utils/joinAriaLabel.cjs.map +1 -0
- package/dist/esm/breadcrumbs/Breadcrumbs.mjs +10 -3
- package/dist/esm/breadcrumbs/Breadcrumbs.mjs.map +1 -1
- package/dist/esm/button/Button.mjs +7 -7
- package/dist/esm/button/Button.mjs.map +1 -1
- package/dist/esm/button/ButtonContent.mjs +1 -2
- package/dist/esm/button/ButtonContent.mjs.map +1 -1
- package/dist/esm/button/LinkButton.mjs +6 -35
- package/dist/esm/button/LinkButton.mjs.map +1 -1
- package/dist/esm/counter/Counter.module.css.mjs +1 -1
- package/dist/esm/disclaimer/Disclaimer.mjs +0 -1
- package/dist/esm/disclaimer/Disclaimer.mjs.map +1 -1
- package/dist/esm/icon-button/CloseButton.mjs.map +1 -1
- package/dist/esm/icon-button/IconButton.mjs +7 -7
- package/dist/esm/icon-button/IconButton.mjs.map +1 -1
- package/dist/esm/index.css +10 -4
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/info-tooltip/InfoTooltip.mjs +4 -4
- package/dist/esm/info-tooltip/InfoTooltip.mjs.map +1 -1
- package/dist/esm/info-tooltip/InfoTooltip.module.css.mjs +1 -1
- package/dist/esm/link-provider/Anchor.mjs +19 -7
- package/dist/esm/link-provider/Anchor.mjs.map +1 -1
- package/dist/esm/link-provider/LinkProvider.mjs +1 -1
- package/dist/esm/link-provider/LinkProvider.mjs.map +1 -1
- package/dist/esm/logo/Logo.mjs.map +1 -1
- package/dist/esm/nav-link/NavLink.mjs +8 -4
- package/dist/esm/nav-link/NavLink.mjs.map +1 -1
- package/dist/esm/rich-input/RichInput.mjs +23 -3
- package/dist/esm/rich-input/RichInput.mjs.map +1 -1
- package/dist/esm/rich-input/RichInput.module.css.mjs +1 -1
- package/dist/esm/sidebar/SidebarToggle.mjs.map +1 -1
- package/dist/esm/small-card/SmallCard.mjs.map +1 -1
- package/dist/esm/tag/Tag.mjs.map +1 -1
- package/dist/esm/tag/Tag.module.css.mjs +1 -1
- package/dist/esm/text-link/TextLink.mjs +1 -3
- package/dist/esm/text-link/TextLink.mjs.map +1 -1
- package/dist/esm/theme-switcher/ThemeSwitcher.mjs.map +1 -1
- package/dist/esm/typography/Typography.mjs +19 -9
- package/dist/esm/typography/Typography.mjs.map +1 -1
- package/dist/esm/typography/Typography.module.css.mjs +1 -1
- package/dist/esm/utils/ActionElement.mjs +1 -1
- package/dist/esm/utils/ActionElement.mjs.map +1 -1
- package/dist/esm/utils/joinAriaLabel.mjs +4 -0
- package/dist/esm/utils/joinAriaLabel.mjs.map +1 -0
- package/dist/index.css +10 -4
- package/dist/styles/typography-mixins.css +14 -4
- package/dist/types/breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/types/breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/types/button/Button.d.ts +4 -10
- package/dist/types/button/Button.d.ts.map +1 -1
- package/dist/types/button/ButtonContent.d.ts +0 -1
- package/dist/types/button/ButtonContent.d.ts.map +1 -1
- package/dist/types/button/LinkButton.d.ts +9 -8
- package/dist/types/button/LinkButton.d.ts.map +1 -1
- package/dist/types/button/index.d.ts +1 -1
- package/dist/types/button/index.d.ts.map +1 -1
- package/dist/types/button/types.d.ts +4 -0
- package/dist/types/button/types.d.ts.map +1 -1
- package/dist/types/icon-button/CloseButton.d.ts +3 -3
- package/dist/types/icon-button/CloseButton.d.ts.map +1 -1
- package/dist/types/icon-button/IconButton.d.ts +4 -38
- package/dist/types/icon-button/IconButton.d.ts.map +1 -1
- package/dist/types/icon-button/index.d.ts +1 -1
- package/dist/types/icon-button/index.d.ts.map +1 -1
- package/dist/types/icon-button/types.d.ts +26 -0
- package/dist/types/icon-button/types.d.ts.map +1 -0
- package/dist/types/info-tooltip/InfoTooltip.d.ts +4 -1
- package/dist/types/info-tooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/types/link-provider/Anchor.d.ts +3 -2
- package/dist/types/link-provider/Anchor.d.ts.map +1 -1
- package/dist/types/link-provider/LinkProvider.d.ts +1 -1
- package/dist/types/link-provider/LinkProvider.d.ts.map +1 -1
- package/dist/types/logo/Logo.d.ts +3 -6
- package/dist/types/logo/Logo.d.ts.map +1 -1
- package/dist/types/nav-link/NavLink.d.ts +2 -2
- package/dist/types/nav-link/NavLink.d.ts.map +1 -1
- package/dist/types/rich-input/RichInput.d.ts +7 -2
- package/dist/types/rich-input/RichInput.d.ts.map +1 -1
- package/dist/types/sidebar/SidebarToggle.d.ts +3 -3
- package/dist/types/sidebar/SidebarToggle.d.ts.map +1 -1
- package/dist/types/small-card/SmallCard.d.ts +2 -8
- package/dist/types/small-card/SmallCard.d.ts.map +1 -1
- package/dist/types/tag/Tag.d.ts +3 -1
- package/dist/types/tag/Tag.d.ts.map +1 -1
- package/dist/types/text-link/TextLink.d.ts +3 -9
- package/dist/types/text-link/TextLink.d.ts.map +1 -1
- package/dist/types/theme-switcher/ThemeSwitcher.d.ts +3 -3
- package/dist/types/theme-switcher/ThemeSwitcher.d.ts.map +1 -1
- package/dist/types/typography/Typography.d.ts +15 -6
- package/dist/types/typography/Typography.d.ts.map +1 -1
- package/dist/types/utils/ActionElement.d.ts +11 -1
- package/dist/types/utils/ActionElement.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/joinAriaLabel.d.ts +2 -0
- package/dist/types/utils/joinAriaLabel.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -2,32 +2,39 @@ import cn from 'classnames';
|
|
|
2
2
|
import styles from './Typography.module.css.mjs';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
+
const typographyColors = ['default', 'secondary', 'tertiary', 'neutral', 'active', 'success', 'warning', 'error', 'info', 'inverse', 'disabled'];
|
|
6
|
+
const typographyWeights = ['thin', 'regular', 'medium', 'semibold', 'bold'];
|
|
7
|
+
|
|
8
|
+
/** @deprecated `richInput` → `amount`, `groupName` → `caption` */
|
|
9
|
+
|
|
10
|
+
const resolveVariant = variant => variant === 'richInput' ? 'amount' : variant === 'groupName' ? 'caption' : variant;
|
|
5
11
|
const variantTag = {
|
|
6
12
|
h1: 'h1',
|
|
7
13
|
h2: 'h2',
|
|
8
14
|
h3: 'h3',
|
|
9
|
-
|
|
15
|
+
amount: 'p',
|
|
10
16
|
bodyLarge: 'p',
|
|
11
17
|
body: 'p',
|
|
12
18
|
description: 'p',
|
|
13
|
-
|
|
19
|
+
caption: 'p'
|
|
14
20
|
};
|
|
15
|
-
const isBodyVariant = variant => variant === 'bodyLarge' || variant === 'body' || variant === 'description';
|
|
16
21
|
|
|
17
22
|
/** Typed text in Manrope; use the shortcuts (`H1`, `Body`, ...) in app code and `Typography` when the variant is dynamic. The same styles ship as PostCSS mixins from `@lidofinance/lido-app-ui/styles`. */
|
|
18
23
|
const Typography = _ref => {
|
|
19
24
|
let {
|
|
20
|
-
variant,
|
|
25
|
+
variant = 'body',
|
|
21
26
|
weight,
|
|
27
|
+
color,
|
|
22
28
|
as,
|
|
23
29
|
className,
|
|
24
30
|
children,
|
|
25
31
|
dataTestId,
|
|
26
32
|
...rest
|
|
27
33
|
} = _ref;
|
|
28
|
-
const
|
|
34
|
+
const resolved = resolveVariant(variant);
|
|
35
|
+
const Component = as ?? variantTag[resolved];
|
|
29
36
|
return /*#__PURE__*/jsx(Component, {
|
|
30
|
-
className: cn(styles.root, styles[
|
|
37
|
+
className: cn(styles.root, styles[resolved], color && styles[`color-${color}`], weight && styles[`weight-${weight}`], className),
|
|
31
38
|
"data-testid": dataTestId?.root,
|
|
32
39
|
...rest,
|
|
33
40
|
children: children
|
|
@@ -57,10 +64,13 @@ const Description = props => /*#__PURE__*/jsx(Typography, {
|
|
|
57
64
|
...props,
|
|
58
65
|
variant: "description"
|
|
59
66
|
});
|
|
60
|
-
const
|
|
67
|
+
const Caption = props => /*#__PURE__*/jsx(Typography, {
|
|
61
68
|
...props,
|
|
62
|
-
variant: "
|
|
69
|
+
variant: "caption"
|
|
63
70
|
});
|
|
64
71
|
|
|
65
|
-
|
|
72
|
+
/** @deprecated use Caption */
|
|
73
|
+
const GroupName = Caption;
|
|
74
|
+
|
|
75
|
+
export { Body, BodyLarge, Caption, Description, GroupName, H1, H2, H3, Typography, typographyColors, typographyWeights };
|
|
66
76
|
//# sourceMappingURL=Typography.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.mjs","sources":["../../../src/typography/Typography.tsx"],"sourcesContent":["import type { ElementType, HTMLAttributes } from 'react'\n\nimport cn from 'classnames'\n\nimport styles from './Typography.module.css'\n\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | '
|
|
1
|
+
{"version":3,"file":"Typography.mjs","sources":["../../../src/typography/Typography.tsx"],"sourcesContent":["import type { ElementType, HTMLAttributes } from 'react'\n\nimport cn from 'classnames'\n\nimport styles from './Typography.module.css'\n\nexport const typographyColors = [\n 'default',\n 'secondary',\n 'tertiary',\n 'neutral',\n 'active',\n 'success',\n 'warning',\n 'error',\n 'info',\n 'inverse',\n 'disabled',\n] as const\n\nexport type TypographyColor = (typeof typographyColors)[number]\n\nexport const typographyWeights = [\n 'thin',\n 'regular',\n 'medium',\n 'semibold',\n 'bold',\n] as const\n\nexport type TypographyWeight = (typeof typographyWeights)[number]\n\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'amount'\n | 'bodyLarge'\n | 'body'\n | 'description'\n | 'caption'\n\n/** @deprecated `richInput` → `amount`, `groupName` → `caption` */\ntype DeprecatedTypographyVariant = 'richInput' | 'groupName'\n\nexport type TypographyDataTestId = {\n root?: string\n}\n\nexport type TypographyProps = Omit<HTMLAttributes<HTMLElement>, 'color'> & {\n /** Type style; also decides the default tag. */\n variant?: TypographyVariant | DeprecatedTypographyVariant\n /** Overrides the variant's font weight. */\n weight?: TypographyWeight\n /** Text color token; omit to inherit. */\n color?: TypographyColor\n /** Overrides the rendered tag without changing the style. */\n as?: ElementType\n dataTestId?: TypographyDataTestId\n}\n\nconst resolveVariant = (\n variant: TypographyVariant | DeprecatedTypographyVariant,\n): TypographyVariant =>\n variant === 'richInput'\n ? 'amount'\n : variant === 'groupName'\n ? 'caption'\n : variant\n\nconst variantTag: Record<TypographyVariant, ElementType> = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n amount: 'p',\n bodyLarge: 'p',\n body: 'p',\n description: 'p',\n caption: 'p',\n}\n\n/** Typed text in Manrope; use the shortcuts (`H1`, `Body`, ...) in app code and `Typography` when the variant is dynamic. The same styles ship as PostCSS mixins from `@lidofinance/lido-app-ui/styles`. */\nexport const Typography = ({\n variant = 'body',\n weight,\n color,\n as,\n className,\n children,\n dataTestId,\n ...rest\n}: TypographyProps) => {\n const resolved = resolveVariant(variant)\n const Component = as ?? variantTag[resolved]\n\n return (\n <Component\n className={cn(\n styles.root,\n styles[resolved],\n color && styles[`color-${color}`],\n weight && styles[`weight-${weight}`],\n className,\n )}\n data-testid={dataTestId?.root}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\ntype ShorthandProps = Omit<TypographyProps, 'variant'>\n\nexport const H1 = (props: ShorthandProps) => (\n <Typography {...props} variant='h1' />\n)\n\nexport const H2 = (props: ShorthandProps) => (\n <Typography {...props} variant='h2' />\n)\n\nexport const H3 = (props: ShorthandProps) => (\n <Typography {...props} variant='h3' />\n)\n\nexport const BodyLarge = (props: ShorthandProps) => (\n <Typography {...props} variant='bodyLarge' />\n)\n\nexport const Body = (props: ShorthandProps) => (\n <Typography {...props} variant='body' />\n)\n\nexport const Description = (props: ShorthandProps) => (\n <Typography {...props} variant='description' />\n)\n\nexport const Caption = (props: ShorthandProps) => (\n <Typography {...props} variant='caption' />\n)\n\n/** @deprecated use Caption */\nexport const GroupName = Caption\n"],"names":["typographyColors","typographyWeights","resolveVariant","variant","variantTag","h1","h2","h3","amount","bodyLarge","body","description","caption","Typography","_ref","weight","color","as","className","children","dataTestId","rest","resolved","Component","_jsx","cn","styles","root","H1","props","H2","H3","BodyLarge","Body","Description","Caption","GroupName"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const styles = {"root":"Typography-module_root__2cRgG","h1":"Typography-module_h1__Owx3Q","h2":"Typography-module_h2__PGKur","h3":"Typography-module_h3__SyRpZ","
|
|
1
|
+
const styles = {"root":"Typography-module_root__2cRgG","h1":"Typography-module_h1__Owx3Q","h2":"Typography-module_h2__PGKur","h3":"Typography-module_h3__SyRpZ","amount":"Typography-module_amount__drtq0","bodyLarge":"Typography-module_bodyLarge__ziLsk","body":"Typography-module_body__fowlB","description":"Typography-module_description__5mtlx","caption":"Typography-module_caption__ftWKE","weight-thin":"Typography-module_weight-thin__55oL6","weight-regular":"Typography-module_weight-regular__m5NNo","weight-medium":"Typography-module_weight-medium__CQ2Eb","weight-semibold":"Typography-module_weight-semibold__n7eLX","weight-bold":"Typography-module_weight-bold__CeKLl","color-default":"Typography-module_color-default__7FQuh","color-secondary":"Typography-module_color-secondary__HtGK2","color-tertiary":"Typography-module_color-tertiary__c-6R5","color-neutral":"Typography-module_color-neutral__VDBOX","color-active":"Typography-module_color-active__PcBdi","color-success":"Typography-module_color-success__j7XIf","color-warning":"Typography-module_color-warning__q1VU-","color-error":"Typography-module_color-error__ABRrW","color-info":"Typography-module_color-info__BzlBj","color-inverse":"Typography-module_color-inverse__9urcs","color-disabled":"Typography-module_color-disabled__1XM9m"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
4
4
|
//# sourceMappingURL=Typography.module.css.mjs.map
|
|
@@ -2,7 +2,7 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import { Anchor } from '../link-provider/Anchor.mjs';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
/** Internal, not exported from the package. Renders `Anchor` when `href` is set (see `AnchorProps` for `disabled`
|
|
5
|
+
/** Internal, not exported from the package. Renders `Anchor` when `href` is set (see `AnchorProps` for `disabled`), otherwise `<button type='button'>`. */
|
|
6
6
|
const ActionElement = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
7
|
if (props.href !== undefined) {
|
|
8
8
|
return /*#__PURE__*/jsx(Anchor, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionElement.mjs","sources":["../../../src/utils/ActionElement.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ForwardedRef } from 'react'\n\nimport { Anchor, type AnchorProps } from '../link-provider/Anchor'\n\nexport type ActionElementProps =\n | (AnchorProps & { href: string })\n | (ButtonHTMLAttributes<HTMLButtonElement> & { href?: undefined })\n\n/** Internal, not exported from the package. Renders `Anchor` when `href` is set (see `AnchorProps` for `disabled`
|
|
1
|
+
{"version":3,"file":"ActionElement.mjs","sources":["../../../src/utils/ActionElement.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ForwardedRef } from 'react'\n\nimport { Anchor, type AnchorProps } from '../link-provider/Anchor'\n\nexport type ActionElementProps =\n | (AnchorProps & { href: string })\n | (ButtonHTMLAttributes<HTMLButtonElement> & { href?: undefined })\n\nexport type ActionAsButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n href?: never\n linkProps?: never\n loading?: boolean\n}\n\nexport type ActionAsLinkProps = Omit<AnchorProps, 'href' | 'external'> & {\n href: string\n loading?: never\n type?: never\n}\n\n/** Internal, not exported from the package. Renders `Anchor` when `href` is set (see `AnchorProps` for `disabled`), otherwise `<button type='button'>`. */\nexport const ActionElement = forwardRef<\n HTMLAnchorElement | HTMLButtonElement,\n ActionElementProps\n>((props, ref) => {\n if (props.href !== undefined) {\n return <Anchor ref={ref as ForwardedRef<HTMLAnchorElement>} {...props} />\n }\n\n const { type = 'button', ...rest } = props\n return (\n <button\n ref={ref as ForwardedRef<HTMLButtonElement>}\n type={type}\n {...rest}\n />\n )\n})\n\nActionElement.displayName = 'ActionElement'\n"],"names":["ActionElement","forwardRef","props","ref","href","undefined","_jsx","Anchor","type","rest","displayName"],"mappings":";;;;AAoBA;AACO,MAAMA,aAAa,gBAAGC,UAAU,CAGrC,CAACC,KAAK,EAAEC,GAAG,KAAK;AAChB,EAAA,IAAID,KAAK,CAACE,IAAI,KAAKC,SAAS,EAAE;IAC5B,oBAAOC,GAAA,CAACC,MAAM,EAAA;AAACJ,MAAAA,GAAG,EAAEA,GAAuC;MAAA,GAAKD,KAAAA;AAAK,KAAG,CAAC,CAAA;AAC3E,GAAA;EAEA,MAAM;AAAEM,IAAAA,IAAI,GAAG,QAAQ;IAAE,GAAGC,IAAAA;AAAK,GAAC,GAAGP,KAAK,CAAA;AAC1C,EAAA,oBACEI,GAAA,CAAA,QAAA,EAAA;AACEH,IAAAA,GAAG,EAAEA,GAAuC;AAC5CK,IAAAA,IAAI,EAAEA,IAAK;IAAA,GACPC,IAAAA;AAAI,GACT,CAAC,CAAA;AAEN,CAAC,EAAC;AAEFT,aAAa,CAACU,WAAW,GAAG,eAAe;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joinAriaLabel.mjs","sources":["../../../src/utils/joinAriaLabel.ts"],"sourcesContent":["export const joinAriaLabel = (\n ariaLabel: string | undefined,\n counterLabel: string | undefined,\n) => (ariaLabel && counterLabel ? `${ariaLabel}, ${counterLabel}` : ariaLabel)\n"],"names":["joinAriaLabel","ariaLabel","counterLabel"],"mappings":"MAAaA,aAAa,GAAGA,CAC3BC,SAA6B,EAC7BC,YAAgC,KAC5BD,SAAS,IAAIC,YAAY,GAAG,CAAGD,EAAAA,SAAS,KAAKC,YAAY,CAAA,CAAE,GAAGD;;;;"}
|