@metamask-previews/design-system-react 0.7.0-preview.3dc70e1 → 0.11.0-preview.3aca0bd
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/CHANGELOG.md +58 -1
- package/dist/components/BadgeCount/BadgeCount.cjs +2 -2
- package/dist/components/BadgeCount/BadgeCount.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.cjs +5 -5
- package/dist/components/BadgeCount/BadgeCount.constants.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.cts +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.mts +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.mts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.mjs +3 -3
- package/dist/components/BadgeCount/BadgeCount.constants.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.d.mts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.mjs +1 -1
- package/dist/components/BadgeCount/BadgeCount.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.cts +4 -21
- package/dist/components/BadgeCount/BadgeCount.types.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.mts +4 -21
- package/dist/components/BadgeCount/BadgeCount.types.d.mts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.mjs.map +1 -1
- package/dist/components/BadgeCount/index.cjs +2 -2
- package/dist/components/BadgeCount/index.cjs.map +1 -1
- package/dist/components/BadgeCount/index.d.cts +1 -1
- package/dist/components/BadgeCount/index.d.cts.map +1 -1
- package/dist/components/BadgeCount/index.d.mts +1 -1
- package/dist/components/BadgeCount/index.d.mts.map +1 -1
- package/dist/components/BadgeCount/index.mjs +1 -1
- package/dist/components/BadgeCount/index.mjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.cjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.cts +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.cts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.mts +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.mts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.mjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.cjs +43 -0
- package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.cjs +30 -0
- package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts +7 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts +7 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.mjs +27 -0
- package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.d.cts +624 -0
- package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.d.mts +624 -0
- package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.mjs +24 -0
- package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.cjs +3 -0
- package/dist/components/BannerAlert/BannerAlert.types.cjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.cts +10 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.cts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.mts +10 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.mts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.mjs +2 -0
- package/dist/components/BannerAlert/BannerAlert.types.mjs.map +1 -0
- package/dist/components/BannerAlert/index.cjs +8 -0
- package/dist/components/BannerAlert/index.cjs.map +1 -0
- package/dist/components/BannerAlert/index.d.cts +4 -0
- package/dist/components/BannerAlert/index.d.cts.map +1 -0
- package/dist/components/BannerAlert/index.d.mts +4 -0
- package/dist/components/BannerAlert/index.d.mts.map +1 -0
- package/dist/components/BannerAlert/index.mjs +3 -0
- package/dist/components/BannerAlert/index.mjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.cjs +54 -0
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.d.cts +616 -0
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -0
- package/dist/components/BannerBase/BannerBase.d.mts +616 -0
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -0
- package/dist/components/BannerBase/BannerBase.mjs +35 -0
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.cjs +3 -0
- package/dist/components/BannerBase/BannerBase.types.cjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.d.cts +54 -0
- package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.d.mts +54 -0
- package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.mjs +2 -0
- package/dist/components/BannerBase/BannerBase.types.mjs.map +1 -0
- package/dist/components/BannerBase/index.cjs +6 -0
- package/dist/components/BannerBase/index.cjs.map +1 -0
- package/dist/components/BannerBase/index.d.cts +3 -0
- package/dist/components/BannerBase/index.d.cts.map +1 -0
- package/dist/components/BannerBase/index.d.mts +3 -0
- package/dist/components/BannerBase/index.d.mts.map +1 -0
- package/dist/components/BannerBase/index.mjs +2 -0
- package/dist/components/BannerBase/index.mjs.map +1 -0
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs +3 -3
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs +3 -3
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs +3 -3
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs +3 -3
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +3 -3
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs +3 -3
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
- package/dist/components/ButtonFilter/ButtonFilter.cjs +37 -0
- package/dist/components/ButtonFilter/ButtonFilter.cjs.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.cts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.cts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.mts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.mts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.mjs +18 -0
- package/dist/components/ButtonFilter/ButtonFilter.mjs.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.cjs +3 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.cjs.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.cts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.cts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.mts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.mts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.mjs +2 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.mjs.map +1 -0
- package/dist/components/ButtonFilter/index.cjs +6 -0
- package/dist/components/ButtonFilter/index.cjs.map +1 -0
- package/dist/components/ButtonFilter/index.d.cts +3 -0
- package/dist/components/ButtonFilter/index.d.cts.map +1 -0
- package/dist/components/ButtonFilter/index.d.mts +3 -0
- package/dist/components/ButtonFilter/index.d.mts.map +1 -0
- package/dist/components/ButtonFilter/index.mjs +2 -0
- package/dist/components/ButtonFilter/index.mjs.map +1 -0
- package/dist/components/ButtonHero/ButtonHero.cjs +1 -1
- package/dist/components/ButtonHero/ButtonHero.cjs.map +1 -1
- package/dist/components/ButtonHero/ButtonHero.mjs +1 -1
- package/dist/components/ButtonHero/ButtonHero.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.cjs +11 -12
- package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.mjs +12 -13
- package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +4 -10
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +4 -10
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.mjs.map +1 -1
- package/dist/components/ButtonIcon/index.cjs +2 -1
- package/dist/components/ButtonIcon/index.cjs.map +1 -1
- package/dist/components/ButtonIcon/index.d.cts +1 -1
- package/dist/components/ButtonIcon/index.d.cts.map +1 -1
- package/dist/components/ButtonIcon/index.d.mts +1 -1
- package/dist/components/ButtonIcon/index.d.mts.map +1 -1
- package/dist/components/ButtonIcon/index.mjs +1 -1
- package/dist/components/ButtonIcon/index.mjs.map +1 -1
- package/dist/components/Icon/icons/Ai.cjs +1 -1
- package/dist/components/Icon/icons/Ai.cjs.map +1 -1
- package/dist/components/Icon/icons/Ai.mjs +1 -1
- package/dist/components/Icon/icons/Ai.mjs.map +1 -1
- package/dist/components/Icon/icons/CorporateFare.cjs +32 -0
- package/dist/components/Icon/icons/CorporateFare.cjs.map +1 -0
- package/dist/components/Icon/icons/CorporateFare.d.cts +4 -0
- package/dist/components/Icon/icons/CorporateFare.d.cts.map +1 -0
- package/dist/components/Icon/icons/CorporateFare.d.mts +4 -0
- package/dist/components/Icon/icons/CorporateFare.d.mts.map +1 -0
- package/dist/components/Icon/icons/CorporateFare.mjs +7 -0
- package/dist/components/Icon/icons/CorporateFare.mjs.map +1 -0
- package/dist/components/Icon/icons/index.cjs +2 -0
- package/dist/components/Icon/icons/index.cjs.map +1 -1
- package/dist/components/Icon/icons/index.d.cts +1 -0
- package/dist/components/Icon/icons/index.d.cts.map +1 -1
- package/dist/components/Icon/icons/index.d.mts +1 -0
- package/dist/components/Icon/icons/index.d.mts.map +1 -1
- package/dist/components/Icon/icons/index.mjs +2 -0
- package/dist/components/Icon/icons/index.mjs.map +1 -1
- package/dist/components/Input/Input.cjs +36 -0
- package/dist/components/Input/Input.cjs.map +1 -0
- package/dist/components/Input/Input.d.cts +10 -0
- package/dist/components/Input/Input.d.cts.map +1 -0
- package/dist/components/Input/Input.d.mts +10 -0
- package/dist/components/Input/Input.d.mts.map +1 -0
- package/dist/components/Input/Input.mjs +17 -0
- package/dist/components/Input/Input.mjs.map +1 -0
- package/dist/components/Input/Input.types.cjs +3 -0
- package/dist/components/Input/Input.types.cjs.map +1 -0
- package/dist/components/Input/Input.types.d.cts +31 -0
- package/dist/components/Input/Input.types.d.cts.map +1 -0
- package/dist/components/Input/Input.types.d.mts +31 -0
- package/dist/components/Input/Input.types.d.mts.map +1 -0
- package/dist/components/Input/Input.types.mjs +2 -0
- package/dist/components/Input/Input.types.mjs.map +1 -0
- package/dist/components/Input/index.cjs +6 -0
- package/dist/components/Input/index.cjs.map +1 -0
- package/dist/components/Input/index.d.cts +3 -0
- package/dist/components/Input/index.d.cts.map +1 -0
- package/dist/components/Input/index.d.mts +3 -0
- package/dist/components/Input/index.d.mts.map +1 -0
- package/dist/components/Input/index.mjs +2 -0
- package/dist/components/Input/index.mjs.map +1 -0
- package/dist/components/index.cjs +12 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +9 -1
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +9 -1
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +5 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/types/index.cjs +11 -15
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +9 -13
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +9 -13
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +10 -14
- package/dist/types/index.mjs.map +1 -1
- package/package.json +4 -5
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import $React, { forwardRef } from "react";
|
|
8
|
+
const React = $importDefault($React);
|
|
9
|
+
import { BoxAlignItems, BoxBackgroundColor, ButtonIconSize, ButtonSize, FontWeight, BoxFlexDirection, IconName, TextVariant } from "../../types/index.mjs";
|
|
10
|
+
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
11
|
+
import { Box } from "../Box/index.mjs";
|
|
12
|
+
import { Button } from "../Button/index.mjs";
|
|
13
|
+
import { ButtonIcon } from "../ButtonIcon/index.mjs";
|
|
14
|
+
import { Text } from "../Text/index.mjs";
|
|
15
|
+
const isTextContent = (content) => typeof content === 'string' || typeof content === 'number';
|
|
16
|
+
const hasContent = (content) => content !== null && content !== undefined;
|
|
17
|
+
export const BannerBase = forwardRef(({ title, titleProps, description, descriptionProps, children, childrenWrapperProps, actionButtonLabel, actionButtonOnClick, actionButtonProps, startAccessory, onClose, closeButtonProps, className, ...props }, ref) => {
|
|
18
|
+
const resolvedActionButtonProps = actionButtonProps ?? {};
|
|
19
|
+
const { ariaLabel: closeButtonAriaLabel = 'Close banner', onClick: closeButtonPropsOnClick, className: closeButtonClassName, ...resolvedCloseButtonProps } = closeButtonProps ?? {};
|
|
20
|
+
const shouldShowCloseButton = Boolean(onClose || closeButtonProps);
|
|
21
|
+
const shouldShowActionButton = Boolean(actionButtonOnClick);
|
|
22
|
+
return (React.createElement(Box, { ref: ref, flexDirection: BoxFlexDirection.Row, alignItems: BoxAlignItems.Start, gap: 2, backgroundColor: BoxBackgroundColor.BackgroundDefault, padding: 3, className: twMerge('rounded-sm', className), ...props },
|
|
23
|
+
startAccessory,
|
|
24
|
+
React.createElement(Box, { className: "min-w-0 flex-1" },
|
|
25
|
+
hasContent(title) &&
|
|
26
|
+
(isTextContent(title) ? (React.createElement(Text, { variant: TextVariant.BodyMd, fontWeight: FontWeight.Medium, ...titleProps }, title)) : (title)),
|
|
27
|
+
hasContent(description) && (React.createElement(Box, { className: hasContent(title) ? 'mt-1' : undefined }, isTextContent(description) ? (React.createElement(Text, { variant: TextVariant.BodySm, ...descriptionProps }, description)) : (description))),
|
|
28
|
+
hasContent(children) &&
|
|
29
|
+
(isTextContent(children) ? (React.createElement(Text, { variant: TextVariant.BodyMd, ...childrenWrapperProps }, children)) : (children)),
|
|
30
|
+
shouldShowActionButton && (React.createElement(Box, { className: "mt-4" },
|
|
31
|
+
React.createElement(Button, { size: ButtonSize.Md, onClick: actionButtonOnClick, ...resolvedActionButtonProps }, actionButtonLabel)))),
|
|
32
|
+
shouldShowCloseButton && (React.createElement(ButtonIcon, { className: twMerge('ml-3 self-start', closeButtonClassName), iconName: IconName.Close, size: ButtonIconSize.Sm, ariaLabel: closeButtonAriaLabel, onClick: onClose ?? closeButtonPropsOnClick, ...resolvedCloseButtonProps }))));
|
|
33
|
+
});
|
|
34
|
+
BannerBase.displayName = 'BannerBase';
|
|
35
|
+
//# sourceMappingURL=BannerBase.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,8BAAoB;AACrB,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B,MAAM,aAAa,GAAG,CAAC,OAAwB,EAA8B,EAAE,CAC7E,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC;AAE7D,MAAM,UAAU,GAAG,CAAC,OAAwB,EAAE,EAAE,CAC9C,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC;AAE5C,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,KAAK,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,yBAAyB,GAAG,iBAAiB,IAAI,EAAE,CAAC;IAE1D,MAAM,EACJ,SAAS,EAAE,oBAAoB,GAAG,cAAc,EAChD,OAAO,EAAE,uBAAuB,EAChC,SAAS,EAAE,oBAAoB,EAC/B,GAAG,wBAAwB,EAC5B,GAAG,gBAAgB,IAAI,EAAE,CAAC;IAE3B,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC;IACnE,MAAM,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE5D,OAAO,CACL,oBAAC,GAAG,IACF,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,gBAAgB,CAAC,GAAG,EACnC,UAAU,EAAE,aAAa,CAAC,KAAK,EAC/B,GAAG,EAAE,CAAC,EACN,eAAe,EAAE,kBAAkB,CAAC,iBAAiB,EACrD,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,KACvC,KAAK;QAER,cAAc;QAEf,oBAAC,GAAG,IAAC,SAAS,EAAC,gBAAgB;YAC5B,UAAU,CAAC,KAAK,CAAC;gBAChB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,oBAAC,IAAI,IACH,OAAO,EAAE,WAAW,CAAC,MAAM,EAC3B,UAAU,EAAE,UAAU,CAAC,MAAM,KACzB,UAAU,IAEb,KAAK,CACD,CACR,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CAAC;YAEH,UAAU,CAAC,WAAW,CAAC,IAAI,CAC1B,oBAAC,GAAG,IAAC,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,IACnD,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAC5B,oBAAC,IAAI,IAAC,OAAO,EAAE,WAAW,CAAC,MAAM,KAAM,gBAAgB,IACpD,WAAW,CACP,CACR,CAAC,CAAC,CAAC,CACF,WAAW,CACZ,CACG,CACP;YAEA,UAAU,CAAC,QAAQ,CAAC;gBACnB,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACzB,oBAAC,IAAI,IAAC,OAAO,EAAE,WAAW,CAAC,MAAM,KAAM,oBAAoB,IACxD,QAAQ,CACJ,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC;YAEH,sBAAsB,IAAI,CACzB,oBAAC,GAAG,IAAC,SAAS,EAAC,MAAM;gBACnB,oBAAC,MAAM,IACL,IAAI,EAAE,UAAU,CAAC,EAAE,EACnB,OAAO,EAAE,mBAAmB,KACxB,yBAAyB,IAE5B,iBAAiB,CACX,CACL,CACP,CACG;QAEL,qBAAqB,IAAI,CACxB,oBAAC,UAAU,IACT,SAAS,EAAE,OAAO,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,EAC3D,QAAQ,EAAE,QAAQ,CAAC,KAAK,EACxB,IAAI,EAAE,cAAc,CAAC,EAAE,EACvB,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,OAAO,IAAI,uBAAuB,KACvC,wBAAwB,GAC5B,CACH,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n BoxAlignItems,\n BoxBackgroundColor,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n BoxFlexDirection,\n IconName,\n TextVariant,\n} from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase = forwardRef<HTMLDivElement, BannerBaseProps>(\n (\n {\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnClick,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n className,\n ...props\n },\n ref,\n ) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n ariaLabel: closeButtonAriaLabel = 'Close banner',\n onClick: closeButtonPropsOnClick,\n className: closeButtonClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnClick);\n\n return (\n <Box\n ref={ref}\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n className={twMerge('rounded-sm', className)}\n {...props}\n >\n {startAccessory}\n\n <Box className=\"min-w-0 flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box className={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box className=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onClick={actionButtonOnClick}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n className={twMerge('ml-3 self-start', closeButtonClassName)}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n ariaLabel={closeButtonAriaLabel}\n onClick={onClose ?? closeButtonPropsOnClick}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n },\n);\n\nBannerBase.displayName = 'BannerBase';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.types.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask-previews/design-system-shared';\nimport type { MouseEventHandler } from 'react';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onClick' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onClick'\n> & {\n /**\n * Optional test id for the close button element.\n */\n 'data-testid'?: string;\n /**\n * Optional click handler for the close button.\n */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n};\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when the title is a string.\n */\n titleProps?: Partial<TextProps>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Partial<TextProps>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Partial<TextProps>;\n /**\n * Optional click handler for the close button.\n * If provided, a close button is shown.\n */\n onClose?: MouseEventHandler<HTMLButtonElement>;\n /**\n * Optional props for the close `ButtonIcon`.\n * Providing this also shows a close button.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnClick: MouseEventHandler<HTMLButtonElement>;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnClick?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { BannerBasePropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { MouseEventHandler } from "react";
|
|
3
|
+
import type { BoxProps } from "../Box/index.cjs";
|
|
4
|
+
import type { ButtonProps } from "../Button/index.cjs";
|
|
5
|
+
import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
|
|
6
|
+
import type { TextProps } from "../Text/index.cjs";
|
|
7
|
+
type BannerBaseActionButtonProps = Omit<Partial<ButtonProps>, 'children' | 'onClick' | 'variant'>;
|
|
8
|
+
type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onClick'> & {
|
|
9
|
+
/**
|
|
10
|
+
* Optional test id for the close button element.
|
|
11
|
+
*/
|
|
12
|
+
'data-testid'?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional click handler for the close button.
|
|
15
|
+
*/
|
|
16
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
17
|
+
};
|
|
18
|
+
type BannerBasePropsBase = BannerBasePropsShared & Omit<BoxProps, 'children'> & {
|
|
19
|
+
/**
|
|
20
|
+
* Optional props for the title `Text` when the title is a string.
|
|
21
|
+
*/
|
|
22
|
+
titleProps?: Partial<TextProps>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional props for the description `Text` when description is a string.
|
|
25
|
+
*/
|
|
26
|
+
descriptionProps?: Partial<TextProps>;
|
|
27
|
+
/**
|
|
28
|
+
* Optional props for the children wrapper `Text` when children is a string.
|
|
29
|
+
*/
|
|
30
|
+
childrenWrapperProps?: Partial<TextProps>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional click handler for the close button.
|
|
33
|
+
* If provided, a close button is shown.
|
|
34
|
+
*/
|
|
35
|
+
onClose?: MouseEventHandler<HTMLButtonElement>;
|
|
36
|
+
/**
|
|
37
|
+
* Optional props for the close `ButtonIcon`.
|
|
38
|
+
* Providing this also shows a close button.
|
|
39
|
+
*/
|
|
40
|
+
closeButtonProps?: BannerBaseCloseButtonProps;
|
|
41
|
+
};
|
|
42
|
+
type BannerBaseActionPropsWithHandler = {
|
|
43
|
+
actionButtonOnClick: MouseEventHandler<HTMLButtonElement>;
|
|
44
|
+
actionButtonLabel: string;
|
|
45
|
+
actionButtonProps?: BannerBaseActionButtonProps;
|
|
46
|
+
};
|
|
47
|
+
type BannerBaseActionPropsWithoutHandler = {
|
|
48
|
+
actionButtonOnClick?: undefined;
|
|
49
|
+
actionButtonLabel?: string;
|
|
50
|
+
actionButtonProps?: BannerBaseActionButtonProps;
|
|
51
|
+
};
|
|
52
|
+
export type BannerBaseProps = BannerBasePropsBase & (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=BannerBase.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc;AAE/C,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,KAAK,2BAA2B,GAAG,IAAI,CACrC,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,SAAS,GAAG,SAAS,CACnC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACpC,OAAO,CAAC,eAAe,CAAC,EACxB,UAAU,GAAG,SAAS,CACvB,GAAG;IACF;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAChD,CAAC;AAEF,KAAK,mBAAmB,GAAG,qBAAqB,GAC9C,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEJ,KAAK,gCAAgC,GAAG;IACtC,mBAAmB,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC1D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC,gCAAgC,GAAG,mCAAmC,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { BannerBasePropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { MouseEventHandler } from "react";
|
|
3
|
+
import type { BoxProps } from "../Box/index.mjs";
|
|
4
|
+
import type { ButtonProps } from "../Button/index.mjs";
|
|
5
|
+
import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
|
|
6
|
+
import type { TextProps } from "../Text/index.mjs";
|
|
7
|
+
type BannerBaseActionButtonProps = Omit<Partial<ButtonProps>, 'children' | 'onClick' | 'variant'>;
|
|
8
|
+
type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onClick'> & {
|
|
9
|
+
/**
|
|
10
|
+
* Optional test id for the close button element.
|
|
11
|
+
*/
|
|
12
|
+
'data-testid'?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional click handler for the close button.
|
|
15
|
+
*/
|
|
16
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
17
|
+
};
|
|
18
|
+
type BannerBasePropsBase = BannerBasePropsShared & Omit<BoxProps, 'children'> & {
|
|
19
|
+
/**
|
|
20
|
+
* Optional props for the title `Text` when the title is a string.
|
|
21
|
+
*/
|
|
22
|
+
titleProps?: Partial<TextProps>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional props for the description `Text` when description is a string.
|
|
25
|
+
*/
|
|
26
|
+
descriptionProps?: Partial<TextProps>;
|
|
27
|
+
/**
|
|
28
|
+
* Optional props for the children wrapper `Text` when children is a string.
|
|
29
|
+
*/
|
|
30
|
+
childrenWrapperProps?: Partial<TextProps>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional click handler for the close button.
|
|
33
|
+
* If provided, a close button is shown.
|
|
34
|
+
*/
|
|
35
|
+
onClose?: MouseEventHandler<HTMLButtonElement>;
|
|
36
|
+
/**
|
|
37
|
+
* Optional props for the close `ButtonIcon`.
|
|
38
|
+
* Providing this also shows a close button.
|
|
39
|
+
*/
|
|
40
|
+
closeButtonProps?: BannerBaseCloseButtonProps;
|
|
41
|
+
};
|
|
42
|
+
type BannerBaseActionPropsWithHandler = {
|
|
43
|
+
actionButtonOnClick: MouseEventHandler<HTMLButtonElement>;
|
|
44
|
+
actionButtonLabel: string;
|
|
45
|
+
actionButtonProps?: BannerBaseActionButtonProps;
|
|
46
|
+
};
|
|
47
|
+
type BannerBaseActionPropsWithoutHandler = {
|
|
48
|
+
actionButtonOnClick?: undefined;
|
|
49
|
+
actionButtonLabel?: string;
|
|
50
|
+
actionButtonProps?: BannerBaseActionButtonProps;
|
|
51
|
+
};
|
|
52
|
+
export type BannerBaseProps = BannerBasePropsBase & (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=BannerBase.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc;AAE/C,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,KAAK,2BAA2B,GAAG,IAAI,CACrC,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,SAAS,GAAG,SAAS,CACnC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACpC,OAAO,CAAC,eAAe,CAAC,EACxB,UAAU,GAAG,SAAS,CACvB,GAAG;IACF;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAChD,CAAC;AAEF,KAAK,mBAAmB,GAAG,qBAAqB,GAC9C,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEJ,KAAK,gCAAgC,GAAG;IACtC,mBAAmB,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC1D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC,gCAAgC,GAAG,mCAAmC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.types.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask-previews/design-system-shared';\nimport type { MouseEventHandler } from 'react';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onClick' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onClick'\n> & {\n /**\n * Optional test id for the close button element.\n */\n 'data-testid'?: string;\n /**\n * Optional click handler for the close button.\n */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n};\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when the title is a string.\n */\n titleProps?: Partial<TextProps>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Partial<TextProps>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Partial<TextProps>;\n /**\n * Optional click handler for the close button.\n * If provided, a close button is shown.\n */\n onClose?: MouseEventHandler<HTMLButtonElement>;\n /**\n * Optional props for the close `ButtonIcon`.\n * Providing this also shows a close button.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnClick: MouseEventHandler<HTMLButtonElement>;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnClick?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BannerBase = void 0;
|
|
4
|
+
var BannerBase_1 = require("./BannerBase.cjs");
|
|
5
|
+
Object.defineProperty(exports, "BannerBase", { enumerable: true, get: function () { return BannerBase_1.BannerBase; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { BannerBase } from './BannerBase';\nexport type { BannerBaseProps } from './BannerBase.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { BannerBase } from './BannerBase';\nexport type { BannerBaseProps } from './BannerBase.types';\n"]}
|
|
@@ -74,9 +74,9 @@ exports.ButtonPrimary = (0, react_1.forwardRef)(({ className, isDanger, isInvers
|
|
|
74
74
|
!isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],
|
|
75
75
|
isInverse &&
|
|
76
76
|
isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],
|
|
77
|
-
], 'focus-visible:
|
|
78
|
-
? 'focus-visible:outline
|
|
79
|
-
: 'focus-visible:outline
|
|
77
|
+
], 'focus-visible:ring-0', isInverse
|
|
78
|
+
? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'
|
|
79
|
+
: 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',
|
|
80
80
|
// Loading styles
|
|
81
81
|
isLoading && 'cursor-not-allowed',
|
|
82
82
|
// Disabled styles (but not loading)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonPrimary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,6DAAqD;AACrD,8DAAiD;AAIpC,QAAA,aAAa,GAAG,IAAA,kBAAU,EACrC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,yBAAyB;IACzB,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,sCAAsC;QACtC,mCAAmC;QACnC,SAAS,IAAI,yBAAyB;KACvC;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,0BAA0B;KACxC;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,yBAAyB;QACzB,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,+BAA+B;QAC/B,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,CAAC,QAAQ;YACP,CAAC,SAAS,IAAI;YACZ,6BAA6B;YAC7B,gCAAgC;SACjC;QACH,QAAQ;YACN,CAAC,SAAS,IAAI;YACZ,8BAA8B;YAC9B,iCAAiC;SAClC;QACH,SAAS;YACP,CAAC,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;QACtE,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;KACtE,EACD,
|
|
1
|
+
{"version":3,"file":"ButtonPrimary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,6DAAqD;AACrD,8DAAiD;AAIpC,QAAA,aAAa,GAAG,IAAA,kBAAU,EACrC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,yBAAyB;IACzB,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,sCAAsC;QACtC,mCAAmC;QACnC,SAAS,IAAI,yBAAyB;KACvC;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,0BAA0B;KACxC;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,yBAAyB;QACzB,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,+BAA+B;QAC/B,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,CAAC,QAAQ;YACP,CAAC,SAAS,IAAI;YACZ,6BAA6B;YAC7B,gCAAgC;SACjC;QACH,QAAQ;YACN,CAAC,SAAS,IAAI;YACZ,8BAA8B;YAC9B,iCAAiC;SAClC;QACH,SAAS;YACP,CAAC,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;QACtE,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;KACtE,EACD,sBAAsB,EACtB,SAAS;QACP,CAAC,CAAC,iGAAiG;QACnG,CAAC,CAAC,8FAA8F;IAClG,iBAAiB;IACjB,SAAS,IAAI,oBAAoB;IACjC,oCAAoC;IACpC,UAAU,IAAI,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAChE,SAAS,CACV,CAAC;IAEF,OAAO,CACL,8BAAC,uBAAU,IACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../../../utils/tw-merge';\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonPrimaryProps } from './ButtonPrimary.types';\n\nexport const ButtonPrimary = forwardRef<HTMLButtonElement, ButtonPrimaryProps>(\n (\n { className, isDanger, isInverse, isDisabled, isLoading, ...props },\n ref,\n ) => {\n const isInteractive = !(isDisabled ?? isLoading);\n\n const mergedClassName = twMerge(\n // Default primary styles\n !isDanger &&\n !isInverse && [\n 'bg-icon-default text-primary-inverse',\n // Loading state uses pressed color\n isLoading && 'bg-icon-default-pressed',\n ],\n // Danger styles\n isDanger &&\n !isInverse && [\n 'bg-error-default text-error-inverse',\n // Loading state uses pressed color\n isLoading && 'bg-error-default-pressed',\n ],\n // Inverse styles\n isInverse &&\n !isDanger && [\n 'bg-default text-default',\n // Loading state uses pressed color\n isLoading && 'bg-default-pressed',\n ],\n // Inverse danger styles\n isInverse &&\n isDanger && [\n 'bg-default text-error-default',\n // Loading state uses pressed color\n isLoading && 'bg-default-pressed',\n ],\n // Hover/Active states - only applied when interactive\n isInteractive && [\n !isDanger &&\n !isInverse && [\n 'hover:bg-icon-default-hover',\n 'active:bg-icon-default-pressed',\n ],\n isDanger &&\n !isInverse && [\n 'hover:bg-error-default-hover',\n 'active:bg-error-default-pressed',\n ],\n isInverse &&\n !isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],\n isInverse &&\n isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],\n ],\n 'focus-visible:ring-0',\n isInverse\n ? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'\n : 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',\n // Loading styles\n isLoading && 'cursor-not-allowed',\n // Disabled styles (but not loading)\n isDisabled && !isLoading && ['opacity-50', 'cursor-not-allowed'],\n className,\n );\n\n return (\n <ButtonBase\n ref={ref}\n className={mergedClassName}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n );\n },\n);\n\nButtonPrimary.displayName = 'ButtonPrimary';\n"]}
|
|
@@ -55,9 +55,9 @@ export const ButtonPrimary = forwardRef(({ className, isDanger, isInverse, isDis
|
|
|
55
55
|
!isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],
|
|
56
56
|
isInverse &&
|
|
57
57
|
isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],
|
|
58
|
-
], 'focus-visible:
|
|
59
|
-
? 'focus-visible:outline
|
|
60
|
-
: 'focus-visible:outline
|
|
58
|
+
], 'focus-visible:ring-0', isInverse
|
|
59
|
+
? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'
|
|
60
|
+
: 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',
|
|
61
61
|
// Loading styles
|
|
62
62
|
isLoading && 'cursor-not-allowed',
|
|
63
63
|
// Disabled styles (but not loading)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonPrimary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,uCAAmC;AACrD,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CACrC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,OAAO;IAC7B,yBAAyB;IACzB,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,sCAAsC;QACtC,mCAAmC;QACnC,SAAS,IAAI,yBAAyB;KACvC;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,0BAA0B;KACxC;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,yBAAyB;QACzB,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,+BAA+B;QAC/B,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,CAAC,QAAQ;YACP,CAAC,SAAS,IAAI;YACZ,6BAA6B;YAC7B,gCAAgC;SACjC;QACH,QAAQ;YACN,CAAC,SAAS,IAAI;YACZ,8BAA8B;YAC9B,iCAAiC;SAClC;QACH,SAAS;YACP,CAAC,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;QACtE,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;KACtE,EACD,
|
|
1
|
+
{"version":3,"file":"ButtonPrimary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,uCAAmC;AACrD,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CACrC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,OAAO;IAC7B,yBAAyB;IACzB,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,sCAAsC;QACtC,mCAAmC;QACnC,SAAS,IAAI,yBAAyB;KACvC;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,0BAA0B;KACxC;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,yBAAyB;QACzB,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,+BAA+B;QAC/B,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,CAAC,QAAQ;YACP,CAAC,SAAS,IAAI;YACZ,6BAA6B;YAC7B,gCAAgC;SACjC;QACH,QAAQ;YACN,CAAC,SAAS,IAAI;YACZ,8BAA8B;YAC9B,iCAAiC;SAClC;QACH,SAAS;YACP,CAAC,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;QACtE,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;KACtE,EACD,sBAAsB,EACtB,SAAS;QACP,CAAC,CAAC,iGAAiG;QACnG,CAAC,CAAC,8FAA8F;IAClG,iBAAiB;IACjB,SAAS,IAAI,oBAAoB;IACjC,oCAAoC;IACpC,UAAU,IAAI,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAChE,SAAS,CACV,CAAC;IAEF,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../../../utils/tw-merge';\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonPrimaryProps } from './ButtonPrimary.types';\n\nexport const ButtonPrimary = forwardRef<HTMLButtonElement, ButtonPrimaryProps>(\n (\n { className, isDanger, isInverse, isDisabled, isLoading, ...props },\n ref,\n ) => {\n const isInteractive = !(isDisabled ?? isLoading);\n\n const mergedClassName = twMerge(\n // Default primary styles\n !isDanger &&\n !isInverse && [\n 'bg-icon-default text-primary-inverse',\n // Loading state uses pressed color\n isLoading && 'bg-icon-default-pressed',\n ],\n // Danger styles\n isDanger &&\n !isInverse && [\n 'bg-error-default text-error-inverse',\n // Loading state uses pressed color\n isLoading && 'bg-error-default-pressed',\n ],\n // Inverse styles\n isInverse &&\n !isDanger && [\n 'bg-default text-default',\n // Loading state uses pressed color\n isLoading && 'bg-default-pressed',\n ],\n // Inverse danger styles\n isInverse &&\n isDanger && [\n 'bg-default text-error-default',\n // Loading state uses pressed color\n isLoading && 'bg-default-pressed',\n ],\n // Hover/Active states - only applied when interactive\n isInteractive && [\n !isDanger &&\n !isInverse && [\n 'hover:bg-icon-default-hover',\n 'active:bg-icon-default-pressed',\n ],\n isDanger &&\n !isInverse && [\n 'hover:bg-error-default-hover',\n 'active:bg-error-default-pressed',\n ],\n isInverse &&\n !isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],\n isInverse &&\n isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],\n ],\n 'focus-visible:ring-0',\n isInverse\n ? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'\n : 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',\n // Loading styles\n isLoading && 'cursor-not-allowed',\n // Disabled styles (but not loading)\n isDisabled && !isLoading && ['opacity-50', 'cursor-not-allowed'],\n className,\n );\n\n return (\n <ButtonBase\n ref={ref}\n className={mergedClassName}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n );\n },\n);\n\nButtonPrimary.displayName = 'ButtonPrimary';\n"]}
|
|
@@ -67,9 +67,9 @@ exports.ButtonSecondary = (0, react_1.forwardRef)(({ className, isDanger, isInve
|
|
|
67
67
|
isInverse && !isDanger && ['hover:bg-hover', 'active:bg-pressed'],
|
|
68
68
|
isInverse &&
|
|
69
69
|
isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],
|
|
70
|
-
], 'focus-visible:
|
|
71
|
-
? 'focus-visible:outline
|
|
72
|
-
: 'focus-visible:outline
|
|
70
|
+
], 'focus-visible:ring-0', isInverse
|
|
71
|
+
? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'
|
|
72
|
+
: 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',
|
|
73
73
|
// Loading styles
|
|
74
74
|
isLoading && 'cursor-not-allowed',
|
|
75
75
|
// Disabled styles (but not loading)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSecondary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,6DAAqD;AACrD,8DAAiD;AAIpC,QAAA,eAAe,GAAG,IAAA,kBAAU,EAIvC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,2BAA2B;IAC3B,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,uBAAuB;QACvB,mCAAmC;QACnC,SAAS,IAAI,kBAAkB;KAChC;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,6BAA6B;QAC7B,mCAAmC;QACnC,SAAS,IAAI,kBAAkB;KAChC;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,qEAAqE;QACrE,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,wCAAwC;QACxC,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,CAAC,QAAQ;YACP,CAAC,SAAS,IAAI,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;QACnE,QAAQ;YACN,CAAC,SAAS,IAAI,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;QACnE,SAAS,IAAI,CAAC,QAAQ,IAAI,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;QACjE,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;KACtE,EACD,
|
|
1
|
+
{"version":3,"file":"ButtonSecondary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,6DAAqD;AACrD,8DAAiD;AAIpC,QAAA,eAAe,GAAG,IAAA,kBAAU,EAIvC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,2BAA2B;IAC3B,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,uBAAuB;QACvB,mCAAmC;QACnC,SAAS,IAAI,kBAAkB;KAChC;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,6BAA6B;QAC7B,mCAAmC;QACnC,SAAS,IAAI,kBAAkB;KAChC;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,qEAAqE;QACrE,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,wCAAwC;QACxC,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,CAAC,QAAQ;YACP,CAAC,SAAS,IAAI,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;QACnE,QAAQ;YACN,CAAC,SAAS,IAAI,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;QACnE,SAAS,IAAI,CAAC,QAAQ,IAAI,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;QACjE,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;KACtE,EACD,sBAAsB,EACtB,SAAS;QACP,CAAC,CAAC,iGAAiG;QACnG,CAAC,CAAC,8FAA8F;IAClG,iBAAiB;IACjB,SAAS,IAAI,oBAAoB;IACjC,oCAAoC;IACpC,UAAU,IAAI,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAChE,SAAS,CACV,CAAC;IAEF,OAAO,CACL,8BAAC,uBAAU,IACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,uBAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../../../utils/tw-merge';\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonSecondaryProps } from './ButtonSecondary.types';\n\nexport const ButtonSecondary = forwardRef<\n HTMLButtonElement,\n ButtonSecondaryProps\n>(\n (\n { className, isDanger, isInverse, isDisabled, isLoading, ...props },\n ref,\n ) => {\n const isInteractive = !(isDisabled ?? isLoading);\n\n const mergedClassName = twMerge(\n // Default secondary styles\n !isDanger &&\n !isInverse && [\n 'bg-muted text-default',\n // Loading state uses pressed color\n isLoading && 'bg-muted-pressed',\n ],\n // Danger styles\n isDanger &&\n !isInverse && [\n 'bg-muted text-error-default',\n // Loading state uses pressed color\n isLoading && 'bg-muted-pressed',\n ],\n // Inverse styles\n isInverse &&\n !isDanger && [\n 'border-2 border-primary-inverse bg-transparent text-primary-inverse',\n // Loading state uses pressed color\n isLoading && 'bg-pressed',\n ],\n // Inverse danger styles\n isInverse &&\n isDanger && [\n 'border-0 bg-default text-error-default',\n // Loading state uses pressed color\n isLoading && 'bg-default-pressed',\n ],\n // Hover/Active states - only applied when interactive\n isInteractive && [\n !isDanger &&\n !isInverse && ['hover:bg-muted-hover', 'active:bg-muted-pressed'],\n isDanger &&\n !isInverse && ['hover:bg-muted-hover', 'active:bg-muted-pressed'],\n isInverse && !isDanger && ['hover:bg-hover', 'active:bg-pressed'],\n isInverse &&\n isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],\n ],\n 'focus-visible:ring-0',\n isInverse\n ? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'\n : 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',\n // Loading styles\n isLoading && 'cursor-not-allowed',\n // Disabled styles (but not loading)\n isDisabled && !isLoading && ['opacity-50', 'cursor-not-allowed'],\n className,\n );\n\n return (\n <ButtonBase\n ref={ref}\n className={mergedClassName}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n );\n },\n);\n\nButtonSecondary.displayName = 'ButtonSecondary';\n"]}
|
|
@@ -48,9 +48,9 @@ export const ButtonSecondary = forwardRef(({ className, isDanger, isInverse, isD
|
|
|
48
48
|
isInverse && !isDanger && ['hover:bg-hover', 'active:bg-pressed'],
|
|
49
49
|
isInverse &&
|
|
50
50
|
isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],
|
|
51
|
-
], 'focus-visible:
|
|
52
|
-
? 'focus-visible:outline
|
|
53
|
-
: 'focus-visible:outline
|
|
51
|
+
], 'focus-visible:ring-0', isInverse
|
|
52
|
+
? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'
|
|
53
|
+
: 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',
|
|
54
54
|
// Loading styles
|
|
55
55
|
isLoading && 'cursor-not-allowed',
|
|
56
56
|
// Disabled styles (but not loading)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSecondary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,uCAAmC;AACrD,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAIvC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,OAAO;IAC7B,2BAA2B;IAC3B,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,uBAAuB;QACvB,mCAAmC;QACnC,SAAS,IAAI,kBAAkB;KAChC;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,6BAA6B;QAC7B,mCAAmC;QACnC,SAAS,IAAI,kBAAkB;KAChC;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,qEAAqE;QACrE,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,wCAAwC;QACxC,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,CAAC,QAAQ;YACP,CAAC,SAAS,IAAI,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;QACnE,QAAQ;YACN,CAAC,SAAS,IAAI,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;QACnE,SAAS,IAAI,CAAC,QAAQ,IAAI,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;QACjE,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;KACtE,EACD,
|
|
1
|
+
{"version":3,"file":"ButtonSecondary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,uCAAmC;AACrD,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAIvC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,OAAO;IAC7B,2BAA2B;IAC3B,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,uBAAuB;QACvB,mCAAmC;QACnC,SAAS,IAAI,kBAAkB;KAChC;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,6BAA6B;QAC7B,mCAAmC;QACnC,SAAS,IAAI,kBAAkB;KAChC;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,qEAAqE;QACrE,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,wCAAwC;QACxC,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,CAAC,QAAQ;YACP,CAAC,SAAS,IAAI,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;QACnE,QAAQ;YACN,CAAC,SAAS,IAAI,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;QACnE,SAAS,IAAI,CAAC,QAAQ,IAAI,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;QACjE,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;KACtE,EACD,sBAAsB,EACtB,SAAS;QACP,CAAC,CAAC,iGAAiG;QACnG,CAAC,CAAC,8FAA8F;IAClG,iBAAiB;IACjB,SAAS,IAAI,oBAAoB;IACjC,oCAAoC;IACpC,UAAU,IAAI,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAChE,SAAS,CACV,CAAC;IAEF,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../../../utils/tw-merge';\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonSecondaryProps } from './ButtonSecondary.types';\n\nexport const ButtonSecondary = forwardRef<\n HTMLButtonElement,\n ButtonSecondaryProps\n>(\n (\n { className, isDanger, isInverse, isDisabled, isLoading, ...props },\n ref,\n ) => {\n const isInteractive = !(isDisabled ?? isLoading);\n\n const mergedClassName = twMerge(\n // Default secondary styles\n !isDanger &&\n !isInverse && [\n 'bg-muted text-default',\n // Loading state uses pressed color\n isLoading && 'bg-muted-pressed',\n ],\n // Danger styles\n isDanger &&\n !isInverse && [\n 'bg-muted text-error-default',\n // Loading state uses pressed color\n isLoading && 'bg-muted-pressed',\n ],\n // Inverse styles\n isInverse &&\n !isDanger && [\n 'border-2 border-primary-inverse bg-transparent text-primary-inverse',\n // Loading state uses pressed color\n isLoading && 'bg-pressed',\n ],\n // Inverse danger styles\n isInverse &&\n isDanger && [\n 'border-0 bg-default text-error-default',\n // Loading state uses pressed color\n isLoading && 'bg-default-pressed',\n ],\n // Hover/Active states - only applied when interactive\n isInteractive && [\n !isDanger &&\n !isInverse && ['hover:bg-muted-hover', 'active:bg-muted-pressed'],\n isDanger &&\n !isInverse && ['hover:bg-muted-hover', 'active:bg-muted-pressed'],\n isInverse && !isDanger && ['hover:bg-hover', 'active:bg-pressed'],\n isInverse &&\n isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],\n ],\n 'focus-visible:ring-0',\n isInverse\n ? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'\n : 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',\n // Loading styles\n isLoading && 'cursor-not-allowed',\n // Disabled styles (but not loading)\n isDisabled && !isLoading && ['opacity-50', 'cursor-not-allowed'],\n className,\n );\n\n return (\n <ButtonBase\n ref={ref}\n className={mergedClassName}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n );\n },\n);\n\nButtonSecondary.displayName = 'ButtonSecondary';\n"]}
|
|
@@ -69,9 +69,9 @@ exports.ButtonTertiary = (0, react_1.forwardRef)(({ className, isDanger, isInver
|
|
|
69
69
|
'hover:bg-error-muted-hover',
|
|
70
70
|
'active:bg-error-muted-pressed',
|
|
71
71
|
],
|
|
72
|
-
], 'focus-visible:
|
|
73
|
-
? 'focus-visible:outline
|
|
74
|
-
: 'focus-visible:outline
|
|
72
|
+
], 'focus-visible:ring-0', isInverse
|
|
73
|
+
? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'
|
|
74
|
+
: 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',
|
|
75
75
|
// Loading styles
|
|
76
76
|
isLoading && 'cursor-not-allowed',
|
|
77
77
|
// Disabled styles (but not loading)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonTertiary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonTertiary/ButtonTertiary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,6DAAqD;AACrD,8DAAiD;AAIpC,QAAA,cAAc,GAAG,IAAA,kBAAU,EAItC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,0BAA0B;IAC1B,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,mCAAmC;QACnC,+CAA+C;QAC/C,SAAS,IAAI,mDAAmD;KACjE;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,+BAA+B;QAC/B,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,gBAAgB;QAChB,mBAAmB;QACnB,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;QACrE,QAAQ;YACN,CAAC,SAAS,IAAI;YACZ,4BAA4B;YAC5B,+BAA+B;SAChC;KACJ,EACD,
|
|
1
|
+
{"version":3,"file":"ButtonTertiary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonTertiary/ButtonTertiary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,6DAAqD;AACrD,8DAAiD;AAIpC,QAAA,cAAc,GAAG,IAAA,kBAAU,EAItC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,0BAA0B;IAC1B,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,mCAAmC;QACnC,+CAA+C;QAC/C,SAAS,IAAI,mDAAmD;KACjE;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,+BAA+B;QAC/B,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,gBAAgB;QAChB,mBAAmB;QACnB,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;QACrE,QAAQ;YACN,CAAC,SAAS,IAAI;YACZ,4BAA4B;YAC5B,+BAA+B;SAChC;KACJ,EACD,sBAAsB,EACtB,SAAS;QACP,CAAC,CAAC,iGAAiG;QACnG,CAAC,CAAC,8FAA8F;IAClG,iBAAiB;IACjB,SAAS,IAAI,oBAAoB;IACjC,oCAAoC;IACpC,UAAU,IAAI,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAChE,SAAS,CACV,CAAC;IAEF,OAAO,CACL,8BAAC,uBAAU,IACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../../../utils/tw-merge';\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonTertiaryProps } from './ButtonTertiary.types';\n\nexport const ButtonTertiary = forwardRef<\n HTMLButtonElement,\n ButtonTertiaryProps\n>(\n (\n { className, isDanger, isInverse, isDisabled, isLoading, ...props },\n ref,\n ) => {\n const isInteractive = !(isDisabled ?? isLoading);\n\n const mergedClassName = twMerge(\n // Default tertiary styles\n !isDanger &&\n !isInverse && [\n 'bg-transparent text-primary-default',\n // Loading state uses pressed color\n isLoading && 'bg-pressed',\n ],\n // Danger styles\n isDanger &&\n !isInverse && [\n 'bg-transparent text-error-default',\n // Loading state uses error muted pressed color\n isLoading && 'bg-error-muted-pressed text-error-default-pressed',\n ],\n // Inverse styles\n isInverse &&\n !isDanger && [\n 'bg-transparent text-primary-inverse',\n // Loading state uses pressed color\n isLoading && 'bg-pressed',\n ],\n // Inverse danger styles\n isInverse &&\n isDanger && [\n 'bg-default text-error-default',\n // Loading state uses pressed color\n isLoading && 'bg-default-pressed',\n ],\n // Hover/Active states - only applied when interactive\n isInteractive && [\n 'hover:bg-hover',\n 'active:bg-pressed',\n isInverse &&\n isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],\n isDanger &&\n !isInverse && [\n 'hover:bg-error-muted-hover',\n 'active:bg-error-muted-pressed',\n ],\n ],\n 'focus-visible:ring-0',\n isInverse\n ? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'\n : 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',\n // Loading styles\n isLoading && 'cursor-not-allowed',\n // Disabled styles (but not loading)\n isDisabled && !isLoading && ['opacity-50', 'cursor-not-allowed'],\n className,\n );\n\n return (\n <ButtonBase\n ref={ref}\n className={mergedClassName}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n );\n },\n);\n\nButtonTertiary.displayName = 'ButtonTertiary';\n"]}
|
|
@@ -50,9 +50,9 @@ export const ButtonTertiary = forwardRef(({ className, isDanger, isInverse, isDi
|
|
|
50
50
|
'hover:bg-error-muted-hover',
|
|
51
51
|
'active:bg-error-muted-pressed',
|
|
52
52
|
],
|
|
53
|
-
], 'focus-visible:
|
|
54
|
-
? 'focus-visible:outline
|
|
55
|
-
: 'focus-visible:outline
|
|
53
|
+
], 'focus-visible:ring-0', isInverse
|
|
54
|
+
? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'
|
|
55
|
+
: 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',
|
|
56
56
|
// Loading styles
|
|
57
57
|
isLoading && 'cursor-not-allowed',
|
|
58
58
|
// Disabled styles (but not loading)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonTertiary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonTertiary/ButtonTertiary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,uCAAmC;AACrD,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAItC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,OAAO;IAC7B,0BAA0B;IAC1B,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,mCAAmC;QACnC,+CAA+C;QAC/C,SAAS,IAAI,mDAAmD;KACjE;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,+BAA+B;QAC/B,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,gBAAgB;QAChB,mBAAmB;QACnB,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;QACrE,QAAQ;YACN,CAAC,SAAS,IAAI;YACZ,4BAA4B;YAC5B,+BAA+B;SAChC;KACJ,EACD,
|
|
1
|
+
{"version":3,"file":"ButtonTertiary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonTertiary/ButtonTertiary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,uCAAmC;AACrD,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAItC,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACnE,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,OAAO;IAC7B,0BAA0B;IAC1B,CAAC,QAAQ;QACP,CAAC,SAAS,IAAI;QACZ,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,gBAAgB;IAChB,QAAQ;QACN,CAAC,SAAS,IAAI;QACZ,mCAAmC;QACnC,+CAA+C;QAC/C,SAAS,IAAI,mDAAmD;KACjE;IACH,iBAAiB;IACjB,SAAS;QACP,CAAC,QAAQ,IAAI;QACX,qCAAqC;QACrC,mCAAmC;QACnC,SAAS,IAAI,YAAY;KAC1B;IACH,wBAAwB;IACxB,SAAS;QACP,QAAQ,IAAI;QACV,+BAA+B;QAC/B,mCAAmC;QACnC,SAAS,IAAI,oBAAoB;KAClC;IACH,sDAAsD;IACtD,aAAa,IAAI;QACf,gBAAgB;QAChB,mBAAmB;QACnB,SAAS;YACP,QAAQ,IAAI,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;QACrE,QAAQ;YACN,CAAC,SAAS,IAAI;YACZ,4BAA4B;YAC5B,+BAA+B;SAChC;KACJ,EACD,sBAAsB,EACtB,SAAS;QACP,CAAC,CAAC,iGAAiG;QACnG,CAAC,CAAC,8FAA8F;IAClG,iBAAiB;IACjB,SAAS,IAAI,oBAAoB;IACjC,oCAAoC;IACpC,UAAU,IAAI,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAChE,SAAS,CACV,CAAC;IAEF,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../../../utils/tw-merge';\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonTertiaryProps } from './ButtonTertiary.types';\n\nexport const ButtonTertiary = forwardRef<\n HTMLButtonElement,\n ButtonTertiaryProps\n>(\n (\n { className, isDanger, isInverse, isDisabled, isLoading, ...props },\n ref,\n ) => {\n const isInteractive = !(isDisabled ?? isLoading);\n\n const mergedClassName = twMerge(\n // Default tertiary styles\n !isDanger &&\n !isInverse && [\n 'bg-transparent text-primary-default',\n // Loading state uses pressed color\n isLoading && 'bg-pressed',\n ],\n // Danger styles\n isDanger &&\n !isInverse && [\n 'bg-transparent text-error-default',\n // Loading state uses error muted pressed color\n isLoading && 'bg-error-muted-pressed text-error-default-pressed',\n ],\n // Inverse styles\n isInverse &&\n !isDanger && [\n 'bg-transparent text-primary-inverse',\n // Loading state uses pressed color\n isLoading && 'bg-pressed',\n ],\n // Inverse danger styles\n isInverse &&\n isDanger && [\n 'bg-default text-error-default',\n // Loading state uses pressed color\n isLoading && 'bg-default-pressed',\n ],\n // Hover/Active states - only applied when interactive\n isInteractive && [\n 'hover:bg-hover',\n 'active:bg-pressed',\n isInverse &&\n isDanger && ['hover:bg-default-hover', 'active:bg-default-pressed'],\n isDanger &&\n !isInverse && [\n 'hover:bg-error-muted-hover',\n 'active:bg-error-muted-pressed',\n ],\n ],\n 'focus-visible:ring-0',\n isInverse\n ? 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-background-default'\n : 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-default',\n // Loading styles\n isLoading && 'cursor-not-allowed',\n // Disabled styles (but not loading)\n isDisabled && !isLoading && ['opacity-50', 'cursor-not-allowed'],\n className,\n );\n\n return (\n <ButtonBase\n ref={ref}\n className={mergedClassName}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n );\n },\n);\n\nButtonTertiary.displayName = 'ButtonTertiary';\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ButtonFilter = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
29
|
+
const ButtonBase_1 = require("../ButtonBase/index.cjs");
|
|
30
|
+
exports.ButtonFilter = (0, react_1.forwardRef)(({ className, isActive = false, ...props }, ref) => {
|
|
31
|
+
const mergedClassName = (0, tw_merge_1.twMerge)(isActive
|
|
32
|
+
? 'bg-icon-default text-icon-inverse'
|
|
33
|
+
: 'bg-background-muted text-default', className);
|
|
34
|
+
return react_1.default.createElement(ButtonBase_1.ButtonBase, { ref: ref, className: mergedClassName, ...props });
|
|
35
|
+
});
|
|
36
|
+
exports.ButtonFilter.displayName = 'ButtonFilter';
|
|
37
|
+
//# sourceMappingURL=ButtonFilter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,uDAA+C;AAC/C,wDAA2C;AAI9B,QAAA,YAAY,GAAG,IAAA,kBAAU,EACpC,CAAC,EAAE,SAAS,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjD,MAAM,eAAe,GAAG,IAAA,kBAAO,EAC7B,QAAQ;QACN,CAAC,CAAC,mCAAmC;QACrC,CAAC,CAAC,kCAAkC,EACtC,SAAS,CACV,CAAC;IAEF,OAAO,8BAAC,uBAAU,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,KAAM,KAAK,GAAI,CAAC;AACzE,CAAC,CACF,CAAC;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\nexport const ButtonFilter = forwardRef<HTMLButtonElement, ButtonFilterProps>(\n ({ className, isActive = false, ...props }, ref) => {\n const mergedClassName = twMerge(\n isActive\n ? 'bg-icon-default text-icon-inverse'\n : 'bg-background-muted text-default',\n className,\n );\n\n return <ButtonBase ref={ref} className={mergedClassName} {...props} />;\n },\n);\n\nButtonFilter.displayName = 'ButtonFilter';\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ButtonFilterProps } from "./ButtonFilter.types.cjs";
|
|
3
|
+
export declare const ButtonFilter: React.ForwardRefExoticComponent<Omit<ButtonFilterProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
//# sourceMappingURL=ButtonFilter.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAK1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,0GAWxB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ButtonFilterProps } from "./ButtonFilter.types.mjs";
|
|
3
|
+
export declare const ButtonFilter: React.ForwardRefExoticComponent<Omit<ButtonFilterProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
//# sourceMappingURL=ButtonFilter.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAK1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,0GAWxB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import $React, { forwardRef } from "react";
|
|
8
|
+
const React = $importDefault($React);
|
|
9
|
+
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
10
|
+
import { ButtonBase } from "../ButtonBase/index.mjs";
|
|
11
|
+
export const ButtonFilter = forwardRef(({ className, isActive = false, ...props }, ref) => {
|
|
12
|
+
const mergedClassName = twMerge(isActive
|
|
13
|
+
? 'bg-icon-default text-icon-inverse'
|
|
14
|
+
: 'bg-background-muted text-default', className);
|
|
15
|
+
return React.createElement(ButtonBase, { ref: ref, className: mergedClassName, ...props });
|
|
16
|
+
});
|
|
17
|
+
ButtonFilter.displayName = 'ButtonFilter';
|
|
18
|
+
//# sourceMappingURL=ButtonFilter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.mjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,CAAC,EAAE,SAAS,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjD,MAAM,eAAe,GAAG,OAAO,CAC7B,QAAQ;QACN,CAAC,CAAC,mCAAmC;QACrC,CAAC,CAAC,kCAAkC,EACtC,SAAS,CACV,CAAC;IAEF,OAAO,oBAAC,UAAU,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,KAAM,KAAK,GAAI,CAAC;AACzE,CAAC,CACF,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\nexport const ButtonFilter = forwardRef<HTMLButtonElement, ButtonFilterProps>(\n ({ className, isActive = false, ...props }, ref) => {\n const mergedClassName = twMerge(\n isActive\n ? 'bg-icon-default text-icon-inverse'\n : 'bg-background-muted text-default',\n className,\n );\n\n return <ButtonBase ref={ref} className={mergedClassName} {...props} />;\n },\n);\n\nButtonFilter.displayName = 'ButtonFilter';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonFilterPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport type ButtonFilterProps = ButtonBaseProps & ButtonFilterPropsShared;\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ButtonFilterPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ButtonBaseProps } from "../ButtonBase/index.cjs";
|
|
3
|
+
export type ButtonFilterProps = ButtonBaseProps & ButtonFilterPropsShared;
|
|
4
|
+
//# sourceMappingURL=ButtonFilter.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,uBAAuB,CAAC"}
|