@preply/ds-web-lib 10.0.0 → 11.1.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/dist/Accordion-B0hR-tcI.js +96 -0
- package/dist/AlertBannerProvider-Cf7w9AOq.js +76 -0
- package/dist/AlertDialog-BG-diKBi.js +475 -0
- package/dist/Avatar-B-JdqVyg.js +66 -0
- package/dist/AvatarWithStatus-CD9jEqEB.js +36 -0
- package/dist/Badge-Dd-CLBoW.js +50 -0
- package/dist/Box-BJBE9KNm.js +91 -0
- package/dist/BubbleCounter.module-BU2S0euA.js +16 -0
- package/dist/Button-C35BZJZT.js +91 -0
- package/dist/ButtonBase-8eUyTWxX.js +215 -0
- package/dist/Checkbox-CtolNbxI.js +108 -0
- package/dist/Chips-BRGw7Uup.js +99 -0
- package/dist/ChipsPrimitive-Bezq7ptE.js +1179 -0
- package/dist/CountryFlag-DVDKHmQH.js +43 -0
- package/dist/Dialog.module-Db2BJAn4.js +21 -0
- package/dist/DialogCloseButton-DjDd9Mid.js +98 -0
- package/dist/DialogDescription-8zw9t6pm.js +44 -0
- package/dist/DialogRoot-B67oJduC.js +335 -0
- package/dist/DialogRootContext-Bz8RW-Mq.js +12 -0
- package/dist/DialogTitle-C2Nn2ys-.js +43 -0
- package/dist/Divider-DvwDWB9_.js +17 -0
- package/dist/DropdownMenu.primitives-BrsTBvMk.js +4007 -0
- package/dist/FieldButton-B2slox8P.js +32 -0
- package/dist/FormControl-qnbQL1iF.js +128 -0
- package/dist/Heading-DA9gHfsx.js +71 -0
- package/dist/Icon-CixAeOSd.js +48 -0
- package/dist/IconButton-BPKpgfep.js +31 -0
- package/dist/InputContainer-CzzuOe_p.js +38 -0
- package/dist/LayoutFlex-e9auDvWD.js +86 -0
- package/dist/LayoutFlexItem-D9ziMmHe.js +48 -0
- package/dist/LayoutGridItem-Q8Lnvrri.js +34 -0
- package/dist/Link-CdoJVeER.js +66 -0
- package/dist/Loader-BMOxdJce.js +26 -0
- package/dist/OnboardingTooltip-B47_Yrsj.js +165 -0
- package/dist/OnboardingTour-DUUoI5WE.js +131 -0
- package/dist/PasswordField-Bx5YG62t.js +93 -0
- package/dist/PreplyLogo-abgOre30.js +112 -0
- package/dist/ProgressBar-CEU4GyHn.js +31 -0
- package/dist/ProgressSteps-BSqopxqv.js +45 -0
- package/dist/Select-Bo7PX_8V.js +124 -0
- package/dist/Slider-Crg4DEn_.js +64 -0
- package/dist/Spinner-Ck8KQA22.js +86 -0
- package/dist/Stars-D5QspUBE.js +72 -0
- package/dist/Steps-DbN5vFrP.js +173 -0
- package/dist/Switch-Ck_xB0ID.js +49 -0
- package/dist/Text-CaOF75Z-.js +121 -0
- package/dist/TextHighlighted-Dwq9Clgn.js +34 -0
- package/dist/TextInline-BcA4H2Tk.js +34 -0
- package/dist/Toast-wJAjSLfo.js +1019 -0
- package/dist/TokyoUIChevronDown-DGcVqR1z.js +14 -0
- package/dist/Tooltip-grvKQxTN.js +84 -0
- package/dist/VisuallyHidden-CtcHcZCK.js +29 -0
- package/dist/align-self-VrZUceie.js +42 -0
- package/dist/assets/Accordion.css +2 -2
- package/dist/assets/AlertBannerProvider.css +2 -2
- package/dist/assets/AlertDialog.css +2 -2
- package/dist/assets/Avatar.css +3 -3
- package/dist/assets/AvatarWithStatus.css +2 -2
- package/dist/assets/Badge.css +1 -1
- package/dist/assets/Box.css +3 -3
- package/dist/assets/BubbleCounter.css +1 -1
- package/dist/assets/Button.css +4 -4
- package/dist/assets/ButtonBase.css +40 -46
- package/dist/assets/Checkbox.css +1 -1
- package/dist/assets/Chips.css +2 -2
- package/dist/assets/ChipsPrimitive.css +2 -2
- package/dist/assets/CountryFlag.css +1 -1
- package/dist/assets/Dialog.css +13 -4
- package/dist/assets/Divider.css +1 -1
- package/dist/assets/DropdownMenu.css +2 -2
- package/dist/assets/FieldButton.css +3 -3
- package/dist/assets/FormControl.css +1 -1
- package/dist/assets/Heading.css +3 -3
- package/dist/assets/Icon.css +3 -3
- package/dist/assets/InputContainer.css +2 -2
- package/dist/assets/LayoutFlex.css +1 -1
- package/dist/assets/LayoutFlexItem.css +1 -1
- package/dist/assets/Link.css +3 -3
- package/dist/assets/Loader.css +1 -1
- package/dist/assets/OnboardingTooltip.css +6 -4
- package/dist/assets/OnboardingTour.css +3 -2
- package/dist/assets/PreplyLogo.css +1 -1
- package/dist/assets/ProgressBar.css +1 -1
- package/dist/assets/ProgressSteps.css +1 -1
- package/dist/assets/Select.css +2 -2
- package/dist/assets/Slider.css +1 -1
- package/dist/assets/Spinner.css +3 -3
- package/dist/assets/Stars.css +3 -3
- package/dist/assets/Steps.css +2 -2
- package/dist/assets/Switch.css +1 -1
- package/dist/assets/Text.css +3 -3
- package/dist/assets/TextHighlighted.css +3 -3
- package/dist/assets/TextInline.css +3 -3
- package/dist/assets/Toast.css +2 -2
- package/dist/assets/Tooltip.css +1 -1
- package/dist/assets/align-self.css +1 -1
- package/dist/assets/{IconTile.css → components.css} +9 -1
- package/dist/assets/exp-color.css +2 -2
- package/dist/assets/index.css +1 -1
- package/dist/assets/layout-gap.css +3 -3
- package/dist/assets/layout-grid.css +3 -3
- package/dist/assets/layout-hide.css +1 -1
- package/dist/assets/layout-padding.css +3 -3
- package/dist/assets/layout-relative.css +1 -1
- package/dist/assets/text-accent.css +2 -2
- package/dist/assets/text-centered.css +1 -1
- package/dist/assets/text-weight.css +2 -2
- package/dist/chunk-BVTlhY3a.js +24 -0
- package/dist/components/Accordion/Accordion.js +4 -60
- package/dist/components/Accordion/hooks/useOnOpenChange.js +19 -28
- package/dist/components/AlertBanner/AlertBanner.js +11 -26
- package/dist/components/AlertBanner/AlertBannerProvider.js +3 -8
- package/dist/components/AlertBanner/primitives/AlertBannerAction.js +11 -69
- package/dist/components/AlertBanner/primitives/AlertBannerIcon.js +77 -39
- package/dist/components/AlertBanner/primitives/AlertBannerRoot.js +26 -22
- package/dist/components/AlertBanner/primitives/AlertBannerText.js +11 -70
- package/dist/components/AlertDialog/AlertDialog.d.ts +3 -3
- package/dist/components/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +5 -94
- package/dist/components/Avatar/Avatar.js +3 -71
- package/dist/components/AvatarWithStatus/AvatarWithStatus.js +3 -43
- package/dist/components/Badge/Badge.js +4 -62
- package/dist/components/Box/Box.js +3 -95
- package/dist/components/BubbleCounter/BubbleCounter.js +23 -28
- package/dist/components/Button/Button.js +4 -80
- package/dist/components/CalloutBanner/CalloutBanner.js +61 -12
- package/dist/components/CalloutBanner/primitives/CalloutBannerDismissButton.js +50 -22
- package/dist/components/CalloutBanner/primitives/CalloutBannerIcon.js +86 -45
- package/dist/components/CalloutBanner/primitives/CalloutBannerRoot.js +50 -24
- package/dist/components/CalloutBanner/primitives/CalloutBannerText.js +41 -11
- package/dist/components/Checkbox/Checkbox.js +4 -78
- package/dist/components/Checkbox/hooks/useIndeterminate.js +24 -30
- package/dist/components/Chips/Chips.types.js +0 -1
- package/dist/components/Chips/DismissibleChips.js +117 -86
- package/dist/components/Chips/MultiSelectChips.js +98 -64
- package/dist/components/Chips/SingleSelectChips.js +94 -57
- package/dist/components/Chips/private/ChipsPrimitive.js +4 -17
- package/dist/components/CountryFlag/CountryFlag.js +3 -44
- package/dist/components/Dialog/Dialog.js +56 -31
- package/dist/components/Dialog/DialogSteps.js +40 -29
- package/dist/components/Dialog/primitives/DialogActions.js +26 -19
- package/dist/components/Dialog/primitives/DialogButtonStack.d.ts.map +1 -1
- package/dist/components/Dialog/primitives/DialogButtonStack.js +22 -15
- package/dist/components/Dialog/primitives/DialogCloseButton.d.ts +1 -1
- package/dist/components/Dialog/primitives/DialogCloseButton.d.ts.map +1 -1
- package/dist/components/Dialog/primitives/DialogCloseButton.js +4 -93
- package/dist/components/Dialog/primitives/DialogDescription.js +3 -43
- package/dist/components/Dialog/primitives/DialogFooter.js +37 -34
- package/dist/components/Dialog/primitives/DialogRoot.js +4 -1459
- package/dist/components/Dialog/primitives/DialogTitle.js +3 -42
- package/dist/components/Divider/Divider.js +3 -14
- package/dist/components/DropdownMenu/DropdownMenu.js +253 -188
- package/dist/components/DropdownMenu/primitives/DropdownMenu.primitives.js +5 -34
- package/dist/components/DropdownMenu/primitives/DropdownMenuSelectItem.primitives.js +121 -71
- package/dist/components/FieldButton/FieldButton.js +3 -37
- package/dist/components/FormControl/FormControl.js +3 -105
- package/dist/components/Heading/Heading.js +3 -78
- package/dist/components/Icon/Icon.js +4 -49
- package/dist/components/IconButton/IconButton.d.ts +5 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js +4 -28
- package/dist/components/IconTile/IconTile.js +11 -69
- package/dist/components/IntlFormatted/IntlFormattedAggregatedDateTime.js +16 -32
- package/dist/components/IntlFormatted/IntlFormattedCurrency.js +20 -42
- package/dist/components/IntlFormatted/IntlFormattedDate.js +73 -195
- package/dist/components/IntlFormatted/IntlFormattedTime.js +14 -24
- package/dist/components/IntlFormatted/Wrapper.js +14 -8
- package/dist/components/LayoutFlex/LayoutFlex.js +3 -100
- package/dist/components/LayoutFlex/style/getStyleAttrs.js +71 -143
- package/dist/components/LayoutFlex/tests/AlignItems.js +67 -97
- package/dist/components/LayoutFlex/tests/ColumnReverse.js +63 -100
- package/dist/components/LayoutFlex/tests/DataOverride.js +1498 -1093
- package/dist/components/LayoutFlex/tests/Default.js +19 -20
- package/dist/components/LayoutFlex/tests/Direction.js +65 -88
- package/dist/components/LayoutFlex/tests/Gap.js +115 -197
- package/dist/components/LayoutFlex/tests/HideInline.js +95 -136
- package/dist/components/LayoutFlex/tests/JustifyContent.js +75 -108
- package/dist/components/LayoutFlex/tests/Nowrap.js +35 -42
- package/dist/components/LayoutFlex/tests/Padding.js +207 -263
- package/dist/components/LayoutFlex/tests/Relative.js +49 -64
- package/dist/components/LayoutFlexItem/LayoutFlexItem.js +3 -54
- package/dist/components/LayoutGrid/LayoutGrid.js +26 -34
- package/dist/components/LayoutGridItem/LayoutGridItem.js +3 -41
- package/dist/components/Link/Link.js +3 -72
- package/dist/components/Loader/Loader.js +3 -32
- package/dist/components/NumberField/NumberField.js +33 -35
- package/dist/components/ObserveIntersection/ObserveIntersection.js +41 -42
- package/dist/components/OnboardingTooltip/OnboardingTooltip.js +4 -115
- package/dist/components/OnboardingTour/OnboardingTour.js +4 -114
- package/dist/components/PasswordField/PasswordField.js +3 -78
- package/dist/components/PreplyLogo/PreplyLogo.js +3 -81
- package/dist/components/ProgressBar/ProgressBar.js +3 -27
- package/dist/components/ProgressSteps/ProgressSteps.js +3 -48
- package/dist/components/Rating/Rating.js +29 -20
- package/dist/components/Rating/RatingInput.js +57 -59
- package/dist/components/Rating/Stars.js +4 -8
- package/dist/components/Rating/hooks/useHasError.js +11 -15
- package/dist/components/Rating/hooks/useHoverPercentage.js +37 -45
- package/dist/components/Rating/hooks/useInputState.js +18 -24
- package/dist/components/Rating/hooks/useLocalizations.js +12 -24
- package/dist/components/Rating/utils/roundToHalfDecimal.js +4 -4
- package/dist/components/SelectField/Select.js +5 -112
- package/dist/components/SelectField/SelectField.js +29 -24
- package/dist/components/SelectField/hooks/useBreakpointMatch.js +18 -19
- package/dist/components/ShowOnIntersection/ShowOnIntersection.js +32 -21
- package/dist/components/Slider/RangeSlider.js +62 -52
- package/dist/components/Slider/Slider.js +3 -10
- package/dist/components/Steps/Steps.js +4 -210
- package/dist/components/Switch/Switch.js +3 -51
- package/dist/components/Text/Text.js +3 -128
- package/dist/components/TextField/TextField.js +27 -29
- package/dist/components/TextHighlighted/TextHighlighted.js +3 -41
- package/dist/components/TextInline/TextInline.js +3 -40
- package/dist/components/TextareaField/TextareaField.js +26 -28
- package/dist/components/Toast/Toast.js +4 -1168
- package/dist/components/Tooltip/Tooltip.js +3 -66
- package/dist/components/deprecated/Chips/Chips.js +4 -76
- package/dist/components/deprecated/NativeSelectField/NativeSelect.js +40 -32
- package/dist/components/deprecated/NativeSelectField/NativeSelectField.js +34 -33
- package/dist/components/deprecated/index.js +5 -6
- package/dist/components/index.js +50 -150
- package/dist/components/private/ButtonBase/ButtonBase.d.ts +7 -11
- package/dist/components/private/ButtonBase/ButtonBase.d.ts.map +1 -1
- package/dist/components/private/ButtonBase/ButtonBase.js +3 -247
- package/dist/components/private/Input/Input.js +27 -19
- package/dist/components/private/Input/InputContainer.js +3 -5
- package/dist/components/private/Input/Textarea.js +24 -20
- package/dist/components/private/Input/index.js +2 -4
- package/dist/components/private/Spinner/Spinner.js +3 -52
- package/dist/components/private/VisuallyHidden/VisuallyHidden.js +3 -15
- package/dist/components-BIYP8wHJ.js +200 -0
- package/dist/exp-color-C5mKAN91.js +74 -0
- package/dist/floating-ui.utils.dom-CoeTbDZx.js +215 -0
- package/dist/index.js +50 -150
- package/dist/index.module-1c7ENvxc.js +7 -0
- package/dist/jsx-runtime-i4KUlhDu.js +743 -0
- package/dist/layout-gap.module-DLD8bcR4.js +95 -0
- package/dist/layout-grid.module-CZfhrKrB.js +101 -0
- package/dist/layout-hide.module-B1P0N4i3.js +53 -0
- package/dist/layout-padding-ugY-yd2q.js +389 -0
- package/dist/layout-relative.module-B5xrFD9j.js +6 -0
- package/dist/render-icon-Ch3b2dE0.js +290 -0
- package/dist/shared-styles/align-self/align-self.js +2 -36
- package/dist/shared-styles/exp-color/exp-color.js +2 -68
- package/dist/shared-styles/layout-gap/layout-gap.js +13 -7
- package/dist/shared-styles/layout-grid/layout-grid.js +28 -28
- package/dist/shared-styles/layout-grid-responsive-columns/layout-grid-responsive-columns.js +29 -43
- package/dist/shared-styles/layout-hide/layout-hide.js +8 -8
- package/dist/shared-styles/layout-padding/layout-padding.js +2 -5
- package/dist/shared-styles/layout-relative/layout-relative.js +14 -8
- package/dist/shared-styles/text-accent/text-accent.js +2 -25
- package/dist/shared-styles/text-centered/text-centered.js +2 -24
- package/dist/shared-styles/text-weight/text-weight.js +2 -15
- package/dist/store-sN_eYeZT.js +1064 -0
- package/dist/storybook-utils/consts.js +6 -8
- package/dist/storybook-utils/index.js +1 -5
- package/dist/text-accent-CfUFx-1K.js +30 -0
- package/dist/text-centered-Dwp2_-Yp.js +30 -0
- package/dist/text-weight-CwoqmM4o.js +21 -0
- package/dist/useBaseUiId-CWAD_PSs.js +13 -0
- package/dist/useBreakpointMatch-D9a3CTNK.js +338 -0
- package/dist/useButton-DHTh3Hm7.js +148 -0
- package/dist/useDialogClose-BzFIyWco.js +22 -0
- package/dist/useId-CJsH-2wV.js +34 -0
- package/dist/useOpenInteractionType-D8vA_ZKI.js +4104 -0
- package/dist/useRenderElement-ZBds6eRN.js +341 -0
- package/dist/utils/Orientation/OrientationProvider.js +54 -23
- package/dist/utils/Orientation/index.js +2 -4
- package/dist/utils/RovingTabIndex/RovingTabIndexProvider.js +70 -44
- package/dist/utils/RovingTabIndex/index.js +2 -4
- package/dist/utils/createRequiredContext.js +23 -13
- package/dist/utils/filterAttributesPassedByRadixUIAtRuntime.js +28 -25
- package/dist/utils/render-icon.js +3 -320
- package/dist/utils/shared-strings.js +24 -32
- package/dist/utils/useBreakpointMatch.d.ts.map +1 -1
- package/dist/utils/useBreakpointMatch.js +2 -183
- package/dist/utils/useControllableState/useControllableState.js +31 -25
- package/dist/utils/useMergeRefs.js +29 -14
- package/dist/utils/useStableCallback/useStableCallback.js +28 -13
- package/package.json +17 -22
- package/dist/AlertBannerProvider-DTx2Xp3V.js +0 -50
- package/dist/BubbleCounter.module-QMwXWFIS.js +0 -16
- package/dist/ChipsPrimitive-DzsaOWgY.js +0 -1244
- package/dist/Dialog.module-Ba1X7b3N.js +0 -29
- package/dist/DialogRootContext-BCXmmJAw.js +0 -15
- package/dist/DropdownMenu.primitives-CqJE9k4D.js +0 -5871
- package/dist/IconTile-D1G7MljH.js +0 -172
- package/dist/InputContainer-oHJlLWIi.js +0 -30
- package/dist/Slider-DB4Maswa.js +0 -55
- package/dist/Stars-C_mHop2H.js +0 -67
- package/dist/TokyoUIChevronDown-D_tD1yU8.js +0 -11
- package/dist/floating-ui.utils.dom-BvMNldxo.js +0 -234
- package/dist/index.module-Q9TzIR6B.js +0 -11
- package/dist/layout-gap.module-MKn_un_k.js +0 -97
- package/dist/layout-grid.module-P4B4WVUy.js +0 -103
- package/dist/layout-hide.module-Bpl3Pl-a.js +0 -55
- package/dist/layout-padding-D5I6rRlL.js +0 -373
- package/dist/layout-relative.module-1z75aSwo.js +0 -8
- package/dist/useBaseUiId-DavsGYu9.js +0 -8
- package/dist/useButton-fjQ0ak8m.js +0 -193
- package/dist/useId-BhIOp2JG.js +0 -28
- package/dist/useOpenInteractionType-DNYFqf-a.js +0 -2880
- package/dist/useRenderElement-BSthtPOr.js +0 -350
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { moduleClassNames, booleanClassNames, stringClassNames, moduleLocals, getDatasetProps } from "@preply/ds-web-core";
|
|
5
|
-
import { forwardRef } from "react";
|
|
6
|
-
import { filterAttributesPassedByRadixUIAtRuntime } from "../../utils/filterAttributesPassedByRadixUIAtRuntime.js";
|
|
7
|
-
import { Avatar } from "../Avatar/Avatar.js";
|
|
8
|
-
import '../../assets/AvatarWithStatus.css';const AvatarWithStatus$1 = "AvatarWithStatus__STt5I";
|
|
9
|
-
const styles = {
|
|
10
|
-
AvatarWithStatus: AvatarWithStatus$1,
|
|
11
|
-
"AvatarWithStatus--indicator": "AvatarWithStatus--indicator__FOBwU",
|
|
12
|
-
"AvatarWithStatus--online": "AvatarWithStatus--online__Qpspm",
|
|
13
|
-
"AvatarWithStatus--size-64": "AvatarWithStatus--size-64__gBDkn",
|
|
14
|
-
"AvatarWithStatus--size-96": "AvatarWithStatus--size-96__mLsgd",
|
|
15
|
-
"AvatarWithStatus--size-160": "AvatarWithStatus--size-160__UeQyT"
|
|
16
|
-
};
|
|
17
|
-
const AvatarWithStatus = forwardRef(function AvatarWithStatusComponent({
|
|
18
|
-
online = false,
|
|
19
|
-
size = AVATAR_WITH_STATUS_SIZE_DEFAULT,
|
|
20
|
-
dataset,
|
|
21
|
-
alt,
|
|
22
|
-
crossOrigin,
|
|
23
|
-
src,
|
|
24
|
-
...restPropsPassedByRadixUI
|
|
25
|
-
}, ref) {
|
|
26
|
-
const classNames = moduleClassNames(styles, webComponentNames.AvatarWithStatus, [booleanClassNames("online", void 0, online), stringClassNames("size", size)]);
|
|
27
|
-
const indicatorClassName = [...moduleLocals(styles, webComponentNames.AvatarWithStatus, ["indicator"])];
|
|
28
|
-
const props = {
|
|
29
|
-
...filterAttributesPassedByRadixUIAtRuntime(restPropsPassedByRadixUI),
|
|
30
|
-
ref,
|
|
31
|
-
className: classNames.join(" "),
|
|
32
|
-
...getDatasetProps(dataset, {
|
|
33
|
-
preplyDsComponent: webComponentNames.AvatarWithStatus
|
|
34
|
-
})
|
|
35
|
-
};
|
|
36
|
-
return /* @__PURE__ */ jsxs("div", { ...props, children: [
|
|
37
|
-
/* @__PURE__ */ jsx("span", { className: indicatorClassName.join(" ") }),
|
|
38
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Avatar, { alt, crossOrigin, src, size: size != null ? size : AVATAR_SIZE_DEFAULT }) })
|
|
39
|
-
] });
|
|
40
|
-
});
|
|
41
|
-
export {
|
|
42
|
-
AvatarWithStatus
|
|
43
|
-
};
|
|
1
|
+
import "../../jsx-runtime-i4KUlhDu.js";
|
|
2
|
+
import { t as AvatarWithStatus } from "../../AvatarWithStatus-CD9jEqEB.js";
|
|
3
|
+
export { AvatarWithStatus };
|
|
@@ -1,62 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { filterAttributesPassedByRadixUIAtRuntime } from "../../utils/filterAttributesPassedByRadixUIAtRuntime.js";
|
|
6
|
-
import { Icon } from "../Icon/Icon.js";
|
|
7
|
-
import '../../assets/Badge.css';const badge = "badge__Aj95L";
|
|
8
|
-
const label = "label__F86ML";
|
|
9
|
-
const styles = {
|
|
10
|
-
badge,
|
|
11
|
-
label
|
|
12
|
-
};
|
|
13
|
-
const getActualSize = (size) => {
|
|
14
|
-
switch (size) {
|
|
15
|
-
case "xs":
|
|
16
|
-
return "small";
|
|
17
|
-
case "s":
|
|
18
|
-
return "medium";
|
|
19
|
-
case "m":
|
|
20
|
-
return "large";
|
|
21
|
-
default:
|
|
22
|
-
return size;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const Badge = forwardRef(function BadgeComponent({
|
|
26
|
-
type = "neutral",
|
|
27
|
-
size: sizeProp = "medium",
|
|
28
|
-
leadingSvgIcon,
|
|
29
|
-
dataset: datasetProp,
|
|
30
|
-
children,
|
|
31
|
-
accent,
|
|
32
|
-
inverted,
|
|
33
|
-
hideLabel,
|
|
34
|
-
...restPropsPassedByRadixUI
|
|
35
|
-
}, ref) {
|
|
36
|
-
const size = getActualSize(sizeProp);
|
|
37
|
-
const dataset = {
|
|
38
|
-
...datasetProp,
|
|
39
|
-
size
|
|
40
|
-
};
|
|
41
|
-
if (accent === void 0 && inverted === void 0) {
|
|
42
|
-
dataset.type = type;
|
|
43
|
-
} else {
|
|
44
|
-
dataset.accent = accent || "unset";
|
|
45
|
-
dataset.inverted = !!inverted;
|
|
46
|
-
}
|
|
47
|
-
const props = {
|
|
48
|
-
...filterAttributesPassedByRadixUIAtRuntime(restPropsPassedByRadixUI),
|
|
49
|
-
ref,
|
|
50
|
-
className: styles.badge,
|
|
51
|
-
...getDatasetProps(dataset, {
|
|
52
|
-
preplyDsComponent: webComponentNames.Badge
|
|
53
|
-
})
|
|
54
|
-
};
|
|
55
|
-
return /* @__PURE__ */ jsxs("span", { ...props, children: [
|
|
56
|
-
!!leadingSvgIcon && /* @__PURE__ */ jsx(Icon, { accent: "primary", size: sizeProp === "large" ? "24" : "16", svg: leadingSvgIcon }),
|
|
57
|
-
/* @__PURE__ */ jsx("span", { className: styles.label, "data-hidden": hideLabel, children })
|
|
58
|
-
] });
|
|
59
|
-
});
|
|
60
|
-
export {
|
|
61
|
-
Badge
|
|
62
|
-
};
|
|
1
|
+
import "../../render-icon-Ch3b2dE0.js";
|
|
2
|
+
import "../../jsx-runtime-i4KUlhDu.js";
|
|
3
|
+
import { t as Badge } from "../../Badge-Dd-CLBoW.js";
|
|
4
|
+
export { Badge };
|
|
@@ -1,95 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { forwardRef } from "react";
|
|
5
|
-
import { filterAttributesPassedByRadixUIAtRuntime } from "../../utils/filterAttributesPassedByRadixUIAtRuntime.js";
|
|
6
|
-
import { g as getLayoutPaddingClassnames } from "../../layout-padding-D5I6rRlL.js";
|
|
7
|
-
import { webComponentNames } from "@preply/ds-visual-coverage-preply-component-names";
|
|
8
|
-
import '../../assets/Box.css';const Box$1 = "Box__sKgFi";
|
|
9
|
-
const styles = {
|
|
10
|
-
Box: Box$1,
|
|
11
|
-
"Box--box-radius-0": "Box--box-radius-0__54Jf2",
|
|
12
|
-
"Box--box-radius-2": "Box--box-radius-2__pEI33",
|
|
13
|
-
"Box--box-radius-4": "Box--box-radius-4__z3MJd",
|
|
14
|
-
"Box--box-radius-8": "Box--box-radius-8__iQAzJ",
|
|
15
|
-
"Box--box-radius-16": "Box--box-radius-16__NGCMF",
|
|
16
|
-
"Box--box-radius-300": "Box--box-radius-300__0X-HP",
|
|
17
|
-
"Box--narrow-l--box-radius-0": "Box--narrow-l--box-radius-0__nCUtM",
|
|
18
|
-
"Box--narrow-l--box-radius-2": "Box--narrow-l--box-radius-2__Cze1y",
|
|
19
|
-
"Box--narrow-l--box-radius-4": "Box--narrow-l--box-radius-4__G5JK-",
|
|
20
|
-
"Box--narrow-l--box-radius-8": "Box--narrow-l--box-radius-8__yWuos",
|
|
21
|
-
"Box--narrow-l--box-radius-16": "Box--narrow-l--box-radius-16__Zyr3O",
|
|
22
|
-
"Box--narrow-l--box-radius-300": "Box--narrow-l--box-radius-300__YWYwi",
|
|
23
|
-
"Box--medium-s--box-radius-0": "Box--medium-s--box-radius-0__WKjfo",
|
|
24
|
-
"Box--medium-s--box-radius-2": "Box--medium-s--box-radius-2__aRF-8",
|
|
25
|
-
"Box--medium-s--box-radius-4": "Box--medium-s--box-radius-4__rLRaG",
|
|
26
|
-
"Box--medium-s--box-radius-8": "Box--medium-s--box-radius-8__bfknI",
|
|
27
|
-
"Box--medium-s--box-radius-16": "Box--medium-s--box-radius-16__ph01E",
|
|
28
|
-
"Box--medium-s--box-radius-300": "Box--medium-s--box-radius-300__TK3VE",
|
|
29
|
-
"Box--medium-l--box-radius-0": "Box--medium-l--box-radius-0__lPezW",
|
|
30
|
-
"Box--medium-l--box-radius-2": "Box--medium-l--box-radius-2__bmunw",
|
|
31
|
-
"Box--medium-l--box-radius-4": "Box--medium-l--box-radius-4__IUY2C",
|
|
32
|
-
"Box--medium-l--box-radius-8": "Box--medium-l--box-radius-8__Q67vL",
|
|
33
|
-
"Box--medium-l--box-radius-16": "Box--medium-l--box-radius-16__-vjtO",
|
|
34
|
-
"Box--medium-l--box-radius-300": "Box--medium-l--box-radius-300__RnKpK",
|
|
35
|
-
"Box--wide-s--box-radius-0": "Box--wide-s--box-radius-0__q7wPC",
|
|
36
|
-
"Box--wide-s--box-radius-2": "Box--wide-s--box-radius-2__OXe-M",
|
|
37
|
-
"Box--wide-s--box-radius-4": "Box--wide-s--box-radius-4__sp-lm",
|
|
38
|
-
"Box--wide-s--box-radius-8": "Box--wide-s--box-radius-8__i3loZ",
|
|
39
|
-
"Box--wide-s--box-radius-16": "Box--wide-s--box-radius-16__lkphx",
|
|
40
|
-
"Box--wide-s--box-radius-300": "Box--wide-s--box-radius-300__HNn5b",
|
|
41
|
-
"Box--wide-l--box-radius-0": "Box--wide-l--box-radius-0__yBz-a",
|
|
42
|
-
"Box--wide-l--box-radius-2": "Box--wide-l--box-radius-2__-9J90",
|
|
43
|
-
"Box--wide-l--box-radius-4": "Box--wide-l--box-radius-4__WWouo",
|
|
44
|
-
"Box--wide-l--box-radius-8": "Box--wide-l--box-radius-8__FjMqp",
|
|
45
|
-
"Box--wide-l--box-radius-16": "Box--wide-l--box-radius-16__Nf6SP",
|
|
46
|
-
"Box--wide-l--box-radius-300": "Box--wide-l--box-radius-300__tdPjt",
|
|
47
|
-
"Box--background-primary": "Box--background-primary__iwTv3",
|
|
48
|
-
"Box--background-secondary": "Box--background-secondary__BDhTr",
|
|
49
|
-
"Box--background-tertiary": "Box--background-tertiary__71k6r",
|
|
50
|
-
"Box--background-overlay": "Box--background-overlay__K0eEJ",
|
|
51
|
-
"Box--background-disabled": "Box--background-disabled__5J3YK",
|
|
52
|
-
"Box--background-brand": "Box--background-brand__uZPPV",
|
|
53
|
-
"Box--background-brandB2b": "Box--background-brandB2b__-CJU6",
|
|
54
|
-
"Box--background-accentLight": "Box--background-accentLight__xKZph",
|
|
55
|
-
"Box--background-accentDark": "Box--background-accentDark__Zr7i7",
|
|
56
|
-
"Box--background-positiveLight": "Box--background-positiveLight__dPlfk",
|
|
57
|
-
"Box--background-positiveDark": "Box--background-positiveDark__Z5umI",
|
|
58
|
-
"Box--background-infoLight": "Box--background-infoLight__jOsWt",
|
|
59
|
-
"Box--background-infoDark": "Box--background-infoDark__17bK4",
|
|
60
|
-
"Box--background-warningLight": "Box--background-warningLight__o5wMl",
|
|
61
|
-
"Box--background-warningDark": "Box--background-warningDark__VxpPI",
|
|
62
|
-
"Box--background-criticalLight": "Box--background-criticalLight__h-v7I",
|
|
63
|
-
"Box--background-criticalDark": "Box--background-criticalDark__X4qyY",
|
|
64
|
-
"Box--background-statusOnline": "Box--background-statusOnline__RsqXY",
|
|
65
|
-
"Box--background-statusOffline": "Box--background-statusOffline__n49GJ",
|
|
66
|
-
"Box--background-primaryInverted": "Box--background-primaryInverted__R1bFi",
|
|
67
|
-
"Box--background-secondaryInverted": "Box--background-secondaryInverted__PUg12",
|
|
68
|
-
"Box--background-tertiaryInverted": "Box--background-tertiaryInverted__lwYUb"
|
|
69
|
-
};
|
|
70
|
-
const Box = forwardRef(function BoxComponent({
|
|
71
|
-
children,
|
|
72
|
-
background = "primary",
|
|
73
|
-
radius = BOX_RADIUS_DEFAULT,
|
|
74
|
-
padding = BOX_PADDING_DEFAULT,
|
|
75
|
-
tag,
|
|
76
|
-
dataset,
|
|
77
|
-
...restPropsPassedByRadixUI
|
|
78
|
-
}, ref) {
|
|
79
|
-
const classNames = moduleClassNames(styles, webComponentNames.Box, [stringClassNames("box-radius", radius), stringClassNames("background", background)]);
|
|
80
|
-
const paddingClassNames = getLayoutPaddingClassnames(padding);
|
|
81
|
-
const Tag = tag != null ? tag : LAYOUT_TAG_DEFAULT;
|
|
82
|
-
const allClassNames = [...classNames, ...paddingClassNames];
|
|
83
|
-
const props = {
|
|
84
|
-
...filterAttributesPassedByRadixUIAtRuntime(restPropsPassedByRadixUI),
|
|
85
|
-
ref,
|
|
86
|
-
className: allClassNames.join(" "),
|
|
87
|
-
...getDatasetProps(dataset, {
|
|
88
|
-
preplyDsComponent: webComponentNames.Box
|
|
89
|
-
})
|
|
90
|
-
};
|
|
91
|
-
return /* @__PURE__ */ jsx(Tag, { ...props, children });
|
|
92
|
-
});
|
|
93
|
-
export {
|
|
94
|
-
Box
|
|
95
|
-
};
|
|
1
|
+
import "../../jsx-runtime-i4KUlhDu.js";
|
|
2
|
+
import { t as Box } from "../../Box-BJBE9KNm.js";
|
|
3
|
+
export { Box };
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as require_jsx_runtime } from "../../jsx-runtime-i4KUlhDu.js";
|
|
2
|
+
import { t as BubbleCounter_module_default } from "../../BubbleCounter.module-BU2S0euA.js";
|
|
3
|
+
import "react";
|
|
2
4
|
import { getDatasetProps } from "@preply/ds-web-core";
|
|
3
5
|
import { webComponentNames } from "@preply/ds-visual-coverage-preply-component-names";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return counter;
|
|
23
|
-
}
|
|
24
|
-
return /* @__PURE__ */ jsxs("div", { className: bubbleCounterStyles.childTargetOverlay, children: [
|
|
25
|
-
counter,
|
|
26
|
-
children
|
|
27
|
-
] });
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
BubbleCounter
|
|
6
|
+
//#region src/components/BubbleCounter/BubbleCounter.tsx
|
|
7
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
8
|
+
var BubbleCounter = ({ count, showEmpty = false, limit = 99, size = "large", variant = "dark", children, dataset }) => {
|
|
9
|
+
if (count === void 0 && !showEmpty) return children !== null && children !== void 0 ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
10
|
+
const counter = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
11
|
+
className: [
|
|
12
|
+
BubbleCounter_module_default.bubbleCounter,
|
|
13
|
+
BubbleCounter_module_default[`size-${size}`],
|
|
14
|
+
BubbleCounter_module_default[`variant-${variant}`]
|
|
15
|
+
].join(" "),
|
|
16
|
+
...getDatasetProps(dataset, { preplyDsComponent: webComponentNames.BubbleCounter }),
|
|
17
|
+
children: typeof count === "number" && (count > limit ? `${limit}+` : count)
|
|
18
|
+
});
|
|
19
|
+
if (!children) return counter;
|
|
20
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
21
|
+
className: BubbleCounter_module_default.childTargetOverlay,
|
|
22
|
+
children: [counter, children]
|
|
23
|
+
});
|
|
31
24
|
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { BubbleCounter };
|
|
@@ -1,80 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { forwardRef } from "react";
|
|
6
|
-
import { renderIcon } from "../../utils/render-icon.js";
|
|
7
|
-
import { ButtonBase } from "../private/ButtonBase/ButtonBase.js";
|
|
8
|
-
import '../../assets/Button.css';const Button$1 = "Button__lJRiF";
|
|
9
|
-
const leadingIcon = "leadingIcon__OZj4E";
|
|
10
|
-
const trailingIcon = "trailingIcon__d6fiW";
|
|
11
|
-
const icon = "icon__M1Hs-";
|
|
12
|
-
const styles = {
|
|
13
|
-
Button: Button$1,
|
|
14
|
-
leadingIcon,
|
|
15
|
-
trailingIcon,
|
|
16
|
-
"Button--size-s": "Button--size-s__02RwJ",
|
|
17
|
-
icon,
|
|
18
|
-
"Button--size-m": "Button--size-m__m1kGp",
|
|
19
|
-
"Button--size-small": "Button--size-small__hrJyO",
|
|
20
|
-
"Button--size-medium": "Button--size-medium__ToEik",
|
|
21
|
-
"Button--size-l": "Button--size-l__rHzPz",
|
|
22
|
-
"Button--size-large": "Button--size-large__2ARbP",
|
|
23
|
-
"Button--narrow-l--size-s": "Button--narrow-l--size-s__1iIxT",
|
|
24
|
-
"Button--narrow-l--size-m": "Button--narrow-l--size-m__Hn-71",
|
|
25
|
-
"Button--narrow-l--size-small": "Button--narrow-l--size-small__clOC0",
|
|
26
|
-
"Button--narrow-l--size-medium": "Button--narrow-l--size-medium__4CZXu",
|
|
27
|
-
"Button--narrow-l--size-l": "Button--narrow-l--size-l__VsnrA",
|
|
28
|
-
"Button--narrow-l--size-large": "Button--narrow-l--size-large__NNkfS",
|
|
29
|
-
"Button--medium-s--size-s": "Button--medium-s--size-s__JOAqd",
|
|
30
|
-
"Button--medium-s--size-m": "Button--medium-s--size-m__hQdSS",
|
|
31
|
-
"Button--medium-s--size-small": "Button--medium-s--size-small__EweV7",
|
|
32
|
-
"Button--medium-s--size-medium": "Button--medium-s--size-medium__72Buq",
|
|
33
|
-
"Button--medium-s--size-l": "Button--medium-s--size-l__cRcEp",
|
|
34
|
-
"Button--medium-s--size-large": "Button--medium-s--size-large__PaPLT",
|
|
35
|
-
"Button--medium-l--size-s": "Button--medium-l--size-s__FrGUu",
|
|
36
|
-
"Button--medium-l--size-m": "Button--medium-l--size-m__SWC53",
|
|
37
|
-
"Button--medium-l--size-small": "Button--medium-l--size-small__36CyE",
|
|
38
|
-
"Button--medium-l--size-medium": "Button--medium-l--size-medium__ySDr1",
|
|
39
|
-
"Button--medium-l--size-l": "Button--medium-l--size-l__ImFHA",
|
|
40
|
-
"Button--medium-l--size-large": "Button--medium-l--size-large__o93q-",
|
|
41
|
-
"Button--wide-s--size-s": "Button--wide-s--size-s__fGKJg",
|
|
42
|
-
"Button--wide-s--size-m": "Button--wide-s--size-m__qAksG",
|
|
43
|
-
"Button--wide-s--size-small": "Button--wide-s--size-small__sKZpV",
|
|
44
|
-
"Button--wide-s--size-medium": "Button--wide-s--size-medium__ovQ2U",
|
|
45
|
-
"Button--wide-s--size-l": "Button--wide-s--size-l__MTeN9",
|
|
46
|
-
"Button--wide-s--size-large": "Button--wide-s--size-large__vQ0OS",
|
|
47
|
-
"Button--wide-l--size-s": "Button--wide-l--size-s__ROYdJ",
|
|
48
|
-
"Button--wide-l--size-m": "Button--wide-l--size-m__4cVoF",
|
|
49
|
-
"Button--wide-l--size-small": "Button--wide-l--size-small__RU5x9",
|
|
50
|
-
"Button--wide-l--size-medium": "Button--wide-l--size-medium__Hv0g8",
|
|
51
|
-
"Button--wide-l--size-l": "Button--wide-l--size-l__r0ktJ",
|
|
52
|
-
"Button--wide-l--size-large": "Button--wide-l--size-large__WblYc"
|
|
53
|
-
};
|
|
54
|
-
const Button = forwardRef(function ButtonComponent({
|
|
55
|
-
variant = BUTTON_VARIANT_DEFAULT,
|
|
56
|
-
size = BUTTON_SIZE_DEFAULT,
|
|
57
|
-
url,
|
|
58
|
-
a11yLabel,
|
|
59
|
-
leadingSvgIcon,
|
|
60
|
-
trailingSvgIcon,
|
|
61
|
-
children,
|
|
62
|
-
...props
|
|
63
|
-
}, ref) {
|
|
64
|
-
const hasIcon = !!leadingSvgIcon || !!trailingSvgIcon;
|
|
65
|
-
const classNames = moduleClassNames(styles, webComponentNames.Button, [stringClassNames("size", size)]);
|
|
66
|
-
return /* @__PURE__ */ jsxs(ButtonBase, { ...props, ref, isIconButton: false, variant, size, url, a11yLabel, preplyDsComponent: webComponentNames.Button, className: hasIcon ? classNames.join(" ") : "", children: [
|
|
67
|
-
!!leadingSvgIcon && /* @__PURE__ */ jsx("span", { className: `${styles.icon} ${styles.leadingIcon}`, children: renderIcon(leadingSvgIcon, {
|
|
68
|
-
"aria-hidden": "true",
|
|
69
|
-
focusable: "false"
|
|
70
|
-
}) }),
|
|
71
|
-
children,
|
|
72
|
-
!!trailingSvgIcon && /* @__PURE__ */ jsx("span", { className: `${styles.icon} ${styles.trailingIcon}`, children: renderIcon(trailingSvgIcon, {
|
|
73
|
-
"aria-hidden": "true",
|
|
74
|
-
focusable: "false"
|
|
75
|
-
}) })
|
|
76
|
-
] });
|
|
77
|
-
});
|
|
78
|
-
export {
|
|
79
|
-
Button
|
|
80
|
-
};
|
|
1
|
+
import "../../render-icon-Ch3b2dE0.js";
|
|
2
|
+
import "../../jsx-runtime-i4KUlhDu.js";
|
|
3
|
+
import { t as Button } from "../../Button-C35BZJZT.js";
|
|
4
|
+
export { Button };
|
|
@@ -1,15 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { forwardRef } from "react";
|
|
2
|
+
import { t as require_jsx_runtime } from "../../jsx-runtime-i4KUlhDu.js";
|
|
4
3
|
import { CalloutBannerRoot } from "./primitives/CalloutBannerRoot.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
//#region src/components/CalloutBanner/CalloutBanner.tsx
|
|
6
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
7
|
+
/**
|
|
8
|
+
* The Callout banner is used to share informational, helpful, or promotional
|
|
9
|
+
* messages within a product interface.
|
|
10
|
+
*
|
|
11
|
+
* It appears inline within a page or section, not at the top of the screen.
|
|
12
|
+
* Its goal is to draw gentle attention without overpowering surrounding content.
|
|
13
|
+
*
|
|
14
|
+
* Do not use for urgent or blocking information—use the `<AlertBanner />` instead.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Neutral banner
|
|
18
|
+
* <CalloutBanner>
|
|
19
|
+
* This is a neutral banner.
|
|
20
|
+
* </CalloutBanner>
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Info banner with leading icon
|
|
24
|
+
* <CalloutBanner variant="info">
|
|
25
|
+
* <CalloutBannerIcon />
|
|
26
|
+
* This is an info banner.
|
|
27
|
+
* </CalloutBanner>
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // Dismissible banner with trailing dismiss button
|
|
31
|
+
* {showBanner && (
|
|
32
|
+
* <CalloutBanner>
|
|
33
|
+
* <CalloutBannerText>
|
|
34
|
+
* This is a dismissible banner.
|
|
35
|
+
* </CalloutBannerText>
|
|
36
|
+
* <CalloutBannerDismissButton onClick={() => setShowBanner(false)} />
|
|
37
|
+
* </CalloutBanner>
|
|
38
|
+
* )}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Custom banner using `CalloutBannerRoot` primitive and `className` prop
|
|
42
|
+
* {showBanner && (
|
|
43
|
+
* <CalloutBannerRoot className={myCustomStyles.banner}>
|
|
44
|
+
* <CalloutBannerIcon svg={myCustomIcon} className={myCustomStyles.icon} />
|
|
45
|
+
* <CalloutBannerText className={myCustomStyles.text}>
|
|
46
|
+
* This is a custom banner.
|
|
47
|
+
* </CalloutBannerText>
|
|
48
|
+
* <CalloutBannerDismissButton>
|
|
49
|
+
* <MyCustomButton onClick={() => setShowBanner(false)} />
|
|
50
|
+
* </CalloutBannerDismissButton>
|
|
51
|
+
* </CalloutBannerRoot>
|
|
52
|
+
* )}
|
|
53
|
+
*/
|
|
54
|
+
var CalloutBanner = forwardRef(function CalloutBannerComponent({ variant = "neutral", size = "regular", children, dataset }, ref) {
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CalloutBannerRoot, {
|
|
56
|
+
ref,
|
|
57
|
+
variant,
|
|
58
|
+
size,
|
|
59
|
+
dataset,
|
|
60
|
+
children
|
|
61
|
+
});
|
|
12
62
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { CalloutBanner };
|
|
@@ -1,28 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import "../../../render-icon-Ch3b2dE0.js";
|
|
3
|
+
import { t as require_jsx_runtime } from "../../../jsx-runtime-i4KUlhDu.js";
|
|
4
|
+
import { t as index_module_default } from "../../../index.module-1c7ENvxc.js";
|
|
5
|
+
import { t as IconButton } from "../../../IconButton-BPKpgfep.js";
|
|
6
|
+
import { genericAriaLabels } from "../../../utils/shared-strings.js";
|
|
3
7
|
import { forwardRef } from "react";
|
|
4
8
|
import { useIntl } from "react-intl";
|
|
5
9
|
import CloseSvg from "@preply/ds-media-icons/dist/24/TokyoUIClose.svg";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
//#region src/components/CalloutBanner/primitives/CalloutBannerDismissButton.tsx
|
|
11
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
12
|
+
/**
|
|
13
|
+
* A dismiss button for the callout banner.
|
|
14
|
+
*
|
|
15
|
+
* Note: The root of this component is a `div` element. It renders the default
|
|
16
|
+
* dismiss button by default, but you can override it with the `children` prop.
|
|
17
|
+
* You can also use the `className` prop to override the default styles for the
|
|
18
|
+
* container.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Default dismiss button
|
|
22
|
+
* <CalloutBannerDismissButton onClick={() => setShowBanner(false)} />
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Custom dismiss button
|
|
26
|
+
* <CalloutBannerDismissButton>
|
|
27
|
+
* <MyCustomButton onClick={() => setShowBanner(false)} />
|
|
28
|
+
* </CalloutBannerDismissButton>
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Custom dismiss button with style override class name
|
|
32
|
+
* <CalloutBannerDismissButton className={myCustomStyles.dismissButtonContainer}>
|
|
33
|
+
* <MyCustomButton onClick={() => setShowBanner(false)} />
|
|
34
|
+
* </CalloutBannerDismissButton>
|
|
35
|
+
*/
|
|
36
|
+
var CalloutBannerDismissButton = forwardRef(function CalloutBannerDismissButton({ children, className = "", ...props }, ref) {
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
38
|
+
ref,
|
|
39
|
+
className: [index_module_default.dismissButton, className].join(" "),
|
|
40
|
+
children: children !== null && children !== void 0 ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CalloutBannerDefaultDismissButton, { ...props })
|
|
41
|
+
});
|
|
16
42
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
var CalloutBannerDefaultDismissButton = forwardRef(function CalloutBannerDismissButton({ onClick, dataset }, ref) {
|
|
44
|
+
const { formatMessage } = useIntl();
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconButton, {
|
|
46
|
+
ref,
|
|
47
|
+
onClick,
|
|
48
|
+
svg: CloseSvg,
|
|
49
|
+
size: "small",
|
|
50
|
+
variant: "ghost",
|
|
51
|
+
assistiveText: formatMessage(genericAriaLabels.close),
|
|
52
|
+
dataset
|
|
53
|
+
});
|
|
25
54
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { CalloutBannerDismissButton };
|
|
@@ -1,50 +1,91 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { t as Icon } from "../../../Icon-CixAeOSd.js";
|
|
3
|
+
import "../../../render-icon-Ch3b2dE0.js";
|
|
4
|
+
import { t as require_jsx_runtime } from "../../../jsx-runtime-i4KUlhDu.js";
|
|
5
|
+
import { t as index_module_default } from "../../../index.module-1c7ENvxc.js";
|
|
6
|
+
import { CalloutBannerContext } from "./CalloutBannerRoot.js";
|
|
3
7
|
import { forwardRef, useContext } from "react";
|
|
4
|
-
import TokyoUIInfo from "@preply/ds-media-icons/dist/24/TokyoUIInfo.svg";
|
|
5
|
-
import TokyoUIErrorWarning from "@preply/ds-media-icons/dist/24/TokyoUIErrorWarning.svg";
|
|
6
|
-
import TokyoUIError from "@preply/ds-media-icons/dist/24/TokyoUIError.svg";
|
|
7
8
|
import TokyoUICheck from "@preply/ds-media-icons/dist/24/TokyoUICheck.svg";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
const CalloutBannerIcon = forwardRef(function CalloutBannerIcon2({
|
|
22
|
-
svg,
|
|
23
|
-
children,
|
|
24
|
-
className = ""
|
|
25
|
-
}, ref) {
|
|
26
|
-
const {
|
|
27
|
-
variant
|
|
28
|
-
} = useContext(CalloutBannerContext);
|
|
29
|
-
const classNames = [styles.icon, className].join(" ");
|
|
30
|
-
let icon = null;
|
|
31
|
-
if (children) {
|
|
32
|
-
icon = children;
|
|
33
|
-
} else if (svg) {
|
|
34
|
-
icon = /* @__PURE__ */ jsx(Icon, { svg, size: "24" });
|
|
35
|
-
} else if (variant && variant in calloutBannerIconMap) {
|
|
36
|
-
icon = calloutBannerIconMap[variant]();
|
|
37
|
-
}
|
|
38
|
-
if (!icon) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
return /* @__PURE__ */ jsx("div", { ref, className: classNames, children: icon });
|
|
9
|
+
import TokyoUIError from "@preply/ds-media-icons/dist/24/TokyoUIError.svg";
|
|
10
|
+
import TokyoUIErrorWarning from "@preply/ds-media-icons/dist/24/TokyoUIErrorWarning.svg";
|
|
11
|
+
import TokyoUIInfo from "@preply/ds-media-icons/dist/24/TokyoUIInfo.svg";
|
|
12
|
+
//#region src/components/CalloutBanner/primitives/CalloutBannerIcon.tsx
|
|
13
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
14
|
+
var CalloutBannerInfoIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
15
|
+
svg: TokyoUIInfo,
|
|
16
|
+
size: "24"
|
|
17
|
+
});
|
|
18
|
+
var CalloutBannerPositiveIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
19
|
+
svg: TokyoUICheck,
|
|
20
|
+
size: "24"
|
|
42
21
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
var CalloutBannerWarningIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
23
|
+
svg: TokyoUIErrorWarning,
|
|
24
|
+
size: "24"
|
|
25
|
+
});
|
|
26
|
+
var CalloutBannerCriticalIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
27
|
+
svg: TokyoUIError,
|
|
28
|
+
size: "24"
|
|
29
|
+
});
|
|
30
|
+
var calloutBannerIconMap = {
|
|
31
|
+
info: CalloutBannerInfoIcon,
|
|
32
|
+
positive: CalloutBannerPositiveIcon,
|
|
33
|
+
warning: CalloutBannerWarningIcon,
|
|
34
|
+
critical: CalloutBannerCriticalIcon
|
|
50
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* An icon for the callout banner.
|
|
38
|
+
*
|
|
39
|
+
* This component will render the appropriate icon based on the parent
|
|
40
|
+
* `CalloutBanner` component's `variant` prop — these semantic icons are also
|
|
41
|
+
* exported for the following variants:
|
|
42
|
+
* - `info` -> `<CalloutBannerInfoIcon />`
|
|
43
|
+
* - `positive` -> `<CalloutBannerPositiveIcon />`
|
|
44
|
+
* - `warning` -> `<CalloutBannerWarningIcon />`
|
|
45
|
+
* - `critical` -> `<CalloutBannerCriticalIcon />`
|
|
46
|
+
*
|
|
47
|
+
* The icon can be overridden by passing a custom SVG icon via the `svg` prop.
|
|
48
|
+
*
|
|
49
|
+
* If you want to place any leading element inside of the `CalloutBanner`,
|
|
50
|
+
* with the same spacing as the icon, you can pass it as a child element.
|
|
51
|
+
*
|
|
52
|
+
* Note: The root of this component is a `div` element. You can use the
|
|
53
|
+
* `className` prop to override the default styles for the **container**.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Context-aware icon
|
|
57
|
+
* <CalloutBannerIcon />
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* // Custom SVG icon
|
|
61
|
+
* <CalloutBannerIcon svg={myCustomIcon} />
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // Icon container style override class name
|
|
65
|
+
* <CalloutBannerIcon className={myCustomStyles.icon} />
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* // Custom leading element
|
|
69
|
+
* <CalloutBannerIcon>
|
|
70
|
+
* <Avatar size="24" />
|
|
71
|
+
* </CalloutBannerIcon>
|
|
72
|
+
*/
|
|
73
|
+
var CalloutBannerIcon = forwardRef(function CalloutBannerIcon({ svg, children, className = "" }, ref) {
|
|
74
|
+
const { variant } = useContext(CalloutBannerContext);
|
|
75
|
+
const classNames = [index_module_default.icon, className].join(" ");
|
|
76
|
+
let icon = null;
|
|
77
|
+
if (children) icon = children;
|
|
78
|
+
else if (svg) icon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
79
|
+
svg,
|
|
80
|
+
size: "24"
|
|
81
|
+
});
|
|
82
|
+
else if (variant && variant in calloutBannerIconMap) icon = calloutBannerIconMap[variant]();
|
|
83
|
+
if (!icon) return null;
|
|
84
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
85
|
+
ref,
|
|
86
|
+
className: classNames,
|
|
87
|
+
children: icon
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
//#endregion
|
|
91
|
+
export { CalloutBannerCriticalIcon, CalloutBannerIcon, CalloutBannerInfoIcon, CalloutBannerPositiveIcon, CalloutBannerWarningIcon, calloutBannerIconMap };
|