@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,247 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { useHostname, booleanClassNames, stringClassNames, moduleClassNames, getDatasetProps, getExternalUrlProps, moduleLocals, mapEdgeKeyToStandard } from "@preply/ds-web-core";
|
|
5
|
-
import { forwardRef, useRef, cloneElement } from "react";
|
|
6
|
-
import { filterAttributesPassedByRadixUIAtRuntime } from "../../../utils/filterAttributesPassedByRadixUIAtRuntime.js";
|
|
7
|
-
import { Spinner } from "../Spinner/Spinner.js";
|
|
8
|
-
import { useMergeRefs } from "../../../utils/useMergeRefs.js";
|
|
9
|
-
import '../../../assets/ButtonBase.css';const ButtonBase$1 = "ButtonBase__lIl-s";
|
|
10
|
-
const styles = {
|
|
11
|
-
"button-width--width-full": "button-width--width-full__nJNYU",
|
|
12
|
-
"button-width--width-auto": "button-width--width-auto__gsqlf",
|
|
13
|
-
"button-width--narrow-l--width-full": "button-width--narrow-l--width-full__y2YjC",
|
|
14
|
-
"button-width--narrow-l--width-auto": "button-width--narrow-l--width-auto__1qVpi",
|
|
15
|
-
"button-width--medium-s--width-full": "button-width--medium-s--width-full__IdW9b",
|
|
16
|
-
"button-width--medium-s--width-auto": "button-width--medium-s--width-auto__hrO4e",
|
|
17
|
-
"button-width--medium-l--width-full": "button-width--medium-l--width-full__Oc0vB",
|
|
18
|
-
"button-width--medium-l--width-auto": "button-width--medium-l--width-auto__RNuIr",
|
|
19
|
-
"button-width--wide-s--width-full": "button-width--wide-s--width-full__-egYf",
|
|
20
|
-
"button-width--wide-s--width-auto": "button-width--wide-s--width-auto__h-tgw",
|
|
21
|
-
"button-width--wide-l--width-full": "button-width--wide-l--width-full__OWgAy",
|
|
22
|
-
"button-width--wide-l--width-auto": "button-width--wide-l--width-auto__orWDN",
|
|
23
|
-
ButtonBase: ButtonBase$1,
|
|
24
|
-
"ButtonBase--content": "ButtonBase--content__F9k22",
|
|
25
|
-
"ButtonBase--is-icon-button": "ButtonBase--is-icon-button__48zlf",
|
|
26
|
-
"ButtonBase--is-icon-button-size-large": "ButtonBase--is-icon-button-size-large__9HVLW",
|
|
27
|
-
"ButtonBase--busy": "ButtonBase--busy__XAkcK",
|
|
28
|
-
"ButtonBase--dsInternalSimulation-focus": "ButtonBase--dsInternalSimulation-focus__8jkWp",
|
|
29
|
-
"ButtonBase--is-busy": "ButtonBase--is-busy__OpmZd",
|
|
30
|
-
"ButtonBase--width-full": "ButtonBase--width-full__rPUpd",
|
|
31
|
-
"ButtonBase--width-auto": "ButtonBase--width-auto__4ebPj",
|
|
32
|
-
"ButtonBase--narrow-l--width-full": "ButtonBase--narrow-l--width-full__Bwysi",
|
|
33
|
-
"ButtonBase--narrow-l--width-auto": "ButtonBase--narrow-l--width-auto__r52SI",
|
|
34
|
-
"ButtonBase--medium-s--width-full": "ButtonBase--medium-s--width-full__nsvpl",
|
|
35
|
-
"ButtonBase--medium-s--width-auto": "ButtonBase--medium-s--width-auto__hcYr9",
|
|
36
|
-
"ButtonBase--medium-l--width-full": "ButtonBase--medium-l--width-full__6AYGL",
|
|
37
|
-
"ButtonBase--medium-l--width-auto": "ButtonBase--medium-l--width-auto__BGHr5",
|
|
38
|
-
"ButtonBase--wide-s--width-full": "ButtonBase--wide-s--width-full__4w-XJ",
|
|
39
|
-
"ButtonBase--wide-s--width-auto": "ButtonBase--wide-s--width-auto__5eGoZ",
|
|
40
|
-
"ButtonBase--wide-l--width-full": "ButtonBase--wide-l--width-full__8LbNM",
|
|
41
|
-
"ButtonBase--wide-l--width-auto": "ButtonBase--wide-l--width-auto__ys3sp",
|
|
42
|
-
"ButtonBase--size-large": "ButtonBase--size-large__mHtSn",
|
|
43
|
-
"ButtonBase--size-medium": "ButtonBase--size-medium__5Qsuj",
|
|
44
|
-
"ButtonBase--is-icon-button-size-medium": "ButtonBase--is-icon-button-size-medium__HRsbM",
|
|
45
|
-
"ButtonBase--size-small": "ButtonBase--size-small__Ajd60",
|
|
46
|
-
"ButtonBase--is-icon-button-size-small": "ButtonBase--is-icon-button-size-small__Me6wm",
|
|
47
|
-
"ButtonBase--narrow-l--size-large": "ButtonBase--narrow-l--size-large__3gfd8",
|
|
48
|
-
"ButtonBase--narrow-l--is-icon-button-size-large": "ButtonBase--narrow-l--is-icon-button-size-large__mWjvJ",
|
|
49
|
-
"ButtonBase--narrow-l--size-medium": "ButtonBase--narrow-l--size-medium__BhXNK",
|
|
50
|
-
"ButtonBase--narrow-l--is-icon-button-size-medium": "ButtonBase--narrow-l--is-icon-button-size-medium__RWwYm",
|
|
51
|
-
"ButtonBase--narrow-l--size-small": "ButtonBase--narrow-l--size-small__Vl2nb",
|
|
52
|
-
"ButtonBase--narrow-l--is-icon-button-size-small": "ButtonBase--narrow-l--is-icon-button-size-small__-dAMj",
|
|
53
|
-
"ButtonBase--medium-s--size-large": "ButtonBase--medium-s--size-large__x6d3B",
|
|
54
|
-
"ButtonBase--medium-s--is-icon-button-size-large": "ButtonBase--medium-s--is-icon-button-size-large__54tXt",
|
|
55
|
-
"ButtonBase--medium-s--size-medium": "ButtonBase--medium-s--size-medium__l27CC",
|
|
56
|
-
"ButtonBase--medium-s--is-icon-button-size-medium": "ButtonBase--medium-s--is-icon-button-size-medium__zUviu",
|
|
57
|
-
"ButtonBase--medium-s--size-small": "ButtonBase--medium-s--size-small__49UoI",
|
|
58
|
-
"ButtonBase--medium-s--is-icon-button-size-small": "ButtonBase--medium-s--is-icon-button-size-small__IvyNG",
|
|
59
|
-
"ButtonBase--medium-l--size-large": "ButtonBase--medium-l--size-large__HywFW",
|
|
60
|
-
"ButtonBase--medium-l--is-icon-button-size-large": "ButtonBase--medium-l--is-icon-button-size-large__7IhZP",
|
|
61
|
-
"ButtonBase--medium-l--size-medium": "ButtonBase--medium-l--size-medium__Tf265",
|
|
62
|
-
"ButtonBase--medium-l--is-icon-button-size-medium": "ButtonBase--medium-l--is-icon-button-size-medium__bwlaM",
|
|
63
|
-
"ButtonBase--medium-l--size-small": "ButtonBase--medium-l--size-small__t2X0A",
|
|
64
|
-
"ButtonBase--medium-l--is-icon-button-size-small": "ButtonBase--medium-l--is-icon-button-size-small__LyC6d",
|
|
65
|
-
"ButtonBase--wide-s--size-large": "ButtonBase--wide-s--size-large__revq4",
|
|
66
|
-
"ButtonBase--wide-s--is-icon-button-size-large": "ButtonBase--wide-s--is-icon-button-size-large__ECs3C",
|
|
67
|
-
"ButtonBase--wide-s--size-medium": "ButtonBase--wide-s--size-medium__LcWNl",
|
|
68
|
-
"ButtonBase--wide-s--is-icon-button-size-medium": "ButtonBase--wide-s--is-icon-button-size-medium__XgG6m",
|
|
69
|
-
"ButtonBase--wide-s--size-small": "ButtonBase--wide-s--size-small__zMihk",
|
|
70
|
-
"ButtonBase--wide-s--is-icon-button-size-small": "ButtonBase--wide-s--is-icon-button-size-small__86pYD",
|
|
71
|
-
"ButtonBase--wide-l--size-large": "ButtonBase--wide-l--size-large__dkSfM",
|
|
72
|
-
"ButtonBase--wide-l--is-icon-button-size-large": "ButtonBase--wide-l--is-icon-button-size-large__Exb49",
|
|
73
|
-
"ButtonBase--wide-l--size-medium": "ButtonBase--wide-l--size-medium__DSTMt",
|
|
74
|
-
"ButtonBase--wide-l--is-icon-button-size-medium": "ButtonBase--wide-l--is-icon-button-size-medium__wftX5",
|
|
75
|
-
"ButtonBase--wide-l--size-small": "ButtonBase--wide-l--size-small__1o3ZA",
|
|
76
|
-
"ButtonBase--wide-l--is-icon-button-size-small": "ButtonBase--wide-l--is-icon-button-size-small__Xqy2p",
|
|
77
|
-
"ButtonBase--variant-primary": "ButtonBase--variant-primary__EgRuu",
|
|
78
|
-
"ButtonBase--variant-primary--dsInternalSimulation-hover": "ButtonBase--variant-primary--dsInternalSimulation-hover__qshA-",
|
|
79
|
-
"ButtonBase--variant-primary--dsInternalSimulation-active": "ButtonBase--variant-primary--dsInternalSimulation-active__RQanZ",
|
|
80
|
-
"ButtonBase--variant-secondary": "ButtonBase--variant-secondary__GphQb",
|
|
81
|
-
"ButtonBase--variant-secondary--dsInternalSimulation-hover": "ButtonBase--variant-secondary--dsInternalSimulation-hover__ndGIz",
|
|
82
|
-
"ButtonBase--variant-secondary--dsInternalSimulation-active": "ButtonBase--variant-secondary--dsInternalSimulation-active__k4I5F",
|
|
83
|
-
"ButtonBase--variant-tertiary": "ButtonBase--variant-tertiary__O9c3W",
|
|
84
|
-
"ButtonBase--variant-tertiary--dsInternalSimulation-hover": "ButtonBase--variant-tertiary--dsInternalSimulation-hover__4-xa1",
|
|
85
|
-
"ButtonBase--variant-tertiary--dsInternalSimulation-active": "ButtonBase--variant-tertiary--dsInternalSimulation-active__-10gZ",
|
|
86
|
-
"ButtonBase--variant-quaternary": "ButtonBase--variant-quaternary__pLeI5",
|
|
87
|
-
"ButtonBase--variant-quaternary--dsInternalSimulation-hover": "ButtonBase--variant-quaternary--dsInternalSimulation-hover__ED-s6",
|
|
88
|
-
"ButtonBase--variant-quaternary--dsInternalSimulation-active": "ButtonBase--variant-quaternary--dsInternalSimulation-active__4fmhU",
|
|
89
|
-
"ButtonBase--variant-ghost": "ButtonBase--variant-ghost__ezCgl",
|
|
90
|
-
"ButtonBase--variant-ghost--dsInternalSimulation-hover": "ButtonBase--variant-ghost--dsInternalSimulation-hover__N-vL2",
|
|
91
|
-
"ButtonBase--variant-ghost--dsInternalSimulation-active": "ButtonBase--variant-ghost--dsInternalSimulation-active__ap8Wb",
|
|
92
|
-
"ButtonBase--variant-ghost--is-selected": "ButtonBase--variant-ghost--is-selected__vHgdy",
|
|
93
|
-
"ButtonBase--variant-critical": "ButtonBase--variant-critical__0FoGb",
|
|
94
|
-
"ButtonBase--variant-critical--dsInternalSimulation-hover": "ButtonBase--variant-critical--dsInternalSimulation-hover__DcuKz",
|
|
95
|
-
"ButtonBase--variant-critical--dsInternalSimulation-active": "ButtonBase--variant-critical--dsInternalSimulation-active__-D3p9",
|
|
96
|
-
"ButtonBase--variant-onColor": "ButtonBase--variant-onColor__gDgiZ",
|
|
97
|
-
"ButtonBase--variant-onColor--dsInternalSimulation-hover": "ButtonBase--variant-onColor--dsInternalSimulation-hover__GtnDL",
|
|
98
|
-
"ButtonBase--variant-onColor--dsInternalSimulation-active": "ButtonBase--variant-onColor--dsInternalSimulation-active__4ca8i",
|
|
99
|
-
"ButtonBase--variant-classroom": "ButtonBase--variant-classroom__HVQMA",
|
|
100
|
-
"ButtonBase--variant-classroom--dsInternalSimulation-hover": "ButtonBase--variant-classroom--dsInternalSimulation-hover__h2nxf",
|
|
101
|
-
"ButtonBase--variant-classroom--dsInternalSimulation-active": "ButtonBase--variant-classroom--dsInternalSimulation-active__3uCrs",
|
|
102
|
-
"ButtonBase--variant-classroom--is-selected": "ButtonBase--variant-classroom--is-selected__o47f2",
|
|
103
|
-
"ButtonBase--variant-primaryB2b": "ButtonBase--variant-primaryB2b__mqIFn",
|
|
104
|
-
"ButtonBase--variant-primaryB2b--dsInternalSimulation-hover": "ButtonBase--variant-primaryB2b--dsInternalSimulation-hover__s-6Io",
|
|
105
|
-
"ButtonBase--variant-primaryB2b--dsInternalSimulation-active": "ButtonBase--variant-primaryB2b--dsInternalSimulation-active__5Zy8P",
|
|
106
|
-
"ButtonBase--variant-primaryTutor": "ButtonBase--variant-primaryTutor__0m-N0",
|
|
107
|
-
"ButtonBase--variant-primaryTutor--dsInternalSimulation-hover": "ButtonBase--variant-primaryTutor--dsInternalSimulation-hover__-St95",
|
|
108
|
-
"ButtonBase--variant-primaryTutor--dsInternalSimulation-active": "ButtonBase--variant-primaryTutor--dsInternalSimulation-active__U8f46",
|
|
109
|
-
"ButtonBase--variant-inverted": "ButtonBase--variant-inverted__espSx",
|
|
110
|
-
"ButtonBase--variant-inverted--dsInternalSimulation-hover": "ButtonBase--variant-inverted--dsInternalSimulation-hover__2QLK5",
|
|
111
|
-
"ButtonBase--variant-inverted--dsInternalSimulation-active": "ButtonBase--variant-inverted--dsInternalSimulation-active__XPR7p",
|
|
112
|
-
"ButtonBase--variant-newFeature": "ButtonBase--variant-newFeature__kiL3X",
|
|
113
|
-
"ButtonBase--variant-newFeature--dsInternalSimulation-hover": "ButtonBase--variant-newFeature--dsInternalSimulation-hover__MJYRN",
|
|
114
|
-
"ButtonBase--variant-newFeature--dsInternalSimulation-active": "ButtonBase--variant-newFeature--dsInternalSimulation-active__eVKIo",
|
|
115
|
-
"ButtonBase--variant-ai": "ButtonBase--variant-ai__QQ5F5",
|
|
116
|
-
"ButtonBase--variant-ai--dsInternalSimulation-hover": "ButtonBase--variant-ai--dsInternalSimulation-hover__sEFmg",
|
|
117
|
-
"ButtonBase--variant-ai--dsInternalSimulation-active": "ButtonBase--variant-ai--dsInternalSimulation-active__wLX6u",
|
|
118
|
-
"ButtonBase--no-wrap": "ButtonBase--no-wrap__U0fYw"
|
|
119
|
-
};
|
|
120
|
-
const BUTTON_BASE = "ButtonBase";
|
|
121
|
-
const isSelectable = (arg) => Object.prototype.hasOwnProperty.call(arg, "selected");
|
|
122
|
-
const renderContent = ({
|
|
123
|
-
children,
|
|
124
|
-
busy
|
|
125
|
-
}) => {
|
|
126
|
-
const contentClassNames = [...moduleLocals(styles, BUTTON_BASE, ["content"])];
|
|
127
|
-
const busyClassNames = [...moduleLocals(styles, BUTTON_BASE, ["busy"])];
|
|
128
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
129
|
-
/* @__PURE__ */ jsx("span", { className: contentClassNames.join(" "), children }),
|
|
130
|
-
busy && /* @__PURE__ */ jsx("span", { className: busyClassNames.join(" "), children: /* @__PURE__ */ jsx(Spinner, {}) })
|
|
131
|
-
] });
|
|
132
|
-
};
|
|
133
|
-
const ButtonBase = forwardRef(function ButtonBaseComponent(props, forwardedRef) {
|
|
134
|
-
const {
|
|
135
|
-
id,
|
|
136
|
-
variant = BUTTON_VARIANT_DEFAULT,
|
|
137
|
-
size = BUTTON_SIZE_DEFAULT,
|
|
138
|
-
fullWidth = false,
|
|
139
|
-
wrap = false,
|
|
140
|
-
href,
|
|
141
|
-
download,
|
|
142
|
-
opensInNewTab,
|
|
143
|
-
nofollow,
|
|
144
|
-
submitsForm,
|
|
145
|
-
assistiveText,
|
|
146
|
-
onClick,
|
|
147
|
-
onKeyDown,
|
|
148
|
-
onKeyUp,
|
|
149
|
-
onMouseDown,
|
|
150
|
-
onMouseUp,
|
|
151
|
-
onMouseEnter,
|
|
152
|
-
onMouseMove,
|
|
153
|
-
onPointerDown,
|
|
154
|
-
onPointerEnter,
|
|
155
|
-
disabled,
|
|
156
|
-
busy,
|
|
157
|
-
isIconButton,
|
|
158
|
-
as,
|
|
159
|
-
url,
|
|
160
|
-
a11yLabel,
|
|
161
|
-
dataset,
|
|
162
|
-
children,
|
|
163
|
-
dsInternalSimulation,
|
|
164
|
-
preplyDsComponent,
|
|
165
|
-
className,
|
|
166
|
-
...restPropsPassedByRadixUI
|
|
167
|
-
} = props;
|
|
168
|
-
const {
|
|
169
|
-
selected
|
|
170
|
-
} = isSelectable(props) ? props : {
|
|
171
|
-
selected: void 0
|
|
172
|
-
};
|
|
173
|
-
const hostname = useHostname();
|
|
174
|
-
const innerRef = useRef(null);
|
|
175
|
-
const ref = useMergeRefs(innerRef, forwardedRef);
|
|
176
|
-
const handleClick = (event) => {
|
|
177
|
-
if (disabled || busy) {
|
|
178
|
-
event.preventDefault();
|
|
179
|
-
}
|
|
180
|
-
onClick == null ? void 0 : onClick(event);
|
|
181
|
-
};
|
|
182
|
-
const handleKeyPress = (event) => {
|
|
183
|
-
var _a;
|
|
184
|
-
const key = mapEdgeKeyToStandard(event.key);
|
|
185
|
-
if (key === " " || key === "Enter") {
|
|
186
|
-
event.preventDefault();
|
|
187
|
-
(_a = innerRef.current) == null ? void 0 : _a.click();
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
const dsInternalSimulationClassname = dsInternalSimulation === "focus" ? (
|
|
191
|
-
// The focus management is centralized in ButtonBase and not variant-dependent
|
|
192
|
-
booleanClassNames(`dsInternalSimulation-focus`, void 0, true)
|
|
193
|
-
) : stringClassNames(`variant-${variant}--dsInternalSimulation`, dsInternalSimulation);
|
|
194
|
-
const classNames = moduleClassNames(styles, BUTTON_BASE, [dsInternalSimulationClassname, stringClassNames("variant", variant), stringClassNames("size", size), isIconButton ? stringClassNames("is-icon-button-size", size) : [], booleanClassNames(void 0, "no-wrap", wrap), booleanClassNames("width-full", "width-auto", fullWidth), booleanClassNames("is-busy", void 0, busy), booleanClassNames("is-icon-button", void 0, isIconButton), booleanClassNames(`variant-${variant}--is-selected`, void 0, selected)]);
|
|
195
|
-
const buttonProps = {
|
|
196
|
-
...filterAttributesPassedByRadixUIAtRuntime(restPropsPassedByRadixUI),
|
|
197
|
-
...getDatasetProps(dataset, {
|
|
198
|
-
preplyDsComponent
|
|
199
|
-
}),
|
|
200
|
-
className: [...classNames, className].join(" "),
|
|
201
|
-
"aria-label": assistiveText || a11yLabel,
|
|
202
|
-
onClick: handleClick,
|
|
203
|
-
disabled,
|
|
204
|
-
"aria-disabled": disabled || busy ? true : void 0,
|
|
205
|
-
ref,
|
|
206
|
-
id,
|
|
207
|
-
onKeyDown,
|
|
208
|
-
onKeyUp,
|
|
209
|
-
onMouseDown,
|
|
210
|
-
onMouseUp,
|
|
211
|
-
onMouseEnter,
|
|
212
|
-
onMouseMove,
|
|
213
|
-
onPointerDown,
|
|
214
|
-
onPointerEnter
|
|
215
|
-
};
|
|
216
|
-
const actualHref = href || url;
|
|
217
|
-
const linkProps = {
|
|
218
|
-
...buttonProps,
|
|
219
|
-
download,
|
|
220
|
-
ref,
|
|
221
|
-
role: "button",
|
|
222
|
-
tabIndex: disabled ? -1 : 0,
|
|
223
|
-
href: actualHref,
|
|
224
|
-
onKeyDown: handleKeyPress
|
|
225
|
-
};
|
|
226
|
-
if (actualHref) {
|
|
227
|
-
return /* @__PURE__ */ jsx("a", { ...linkProps, ...getExternalUrlProps(hostname, actualHref, opensInNewTab, nofollow), children: renderContent({
|
|
228
|
-
children,
|
|
229
|
-
busy
|
|
230
|
-
}) });
|
|
231
|
-
}
|
|
232
|
-
if (as) {
|
|
233
|
-
return cloneElement(as, {
|
|
234
|
-
...linkProps
|
|
235
|
-
}, renderContent({
|
|
236
|
-
children,
|
|
237
|
-
busy
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
return /* @__PURE__ */ jsx("button", { ...buttonProps, type: submitsForm ? "submit" : "button", children: renderContent({
|
|
241
|
-
children,
|
|
242
|
-
busy
|
|
243
|
-
}) });
|
|
244
|
-
});
|
|
245
|
-
export {
|
|
246
|
-
ButtonBase
|
|
247
|
-
};
|
|
1
|
+
import "../../../jsx-runtime-i4KUlhDu.js";
|
|
2
|
+
import { t as ButtonBase } from "../../../ButtonBase-8eUyTWxX.js";
|
|
3
|
+
export { ButtonBase };
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { t as require_jsx_runtime } from "../../../jsx-runtime-i4KUlhDu.js";
|
|
3
|
+
import { n as Input_module_default, t as InputContainer } from "../../../InputContainer-CzzuOe_p.js";
|
|
3
4
|
import { forwardRef } from "react";
|
|
4
|
-
import { I as InputContainer, s as styles } from "../../../InputContainer-oHJlLWIi.js";
|
|
5
5
|
import { getDatasetProps } from "@preply/ds-web-core";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
//#region src/components/private/Input/Input.tsx
|
|
7
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
8
|
+
/**
|
|
9
|
+
* A component to render input with optional icon and button.
|
|
10
|
+
* For internal use only.
|
|
11
|
+
*/
|
|
12
|
+
var Input = forwardRef(function InputComponent({ button, icon, dataset, onChange, onValueChange, ...props }, ref) {
|
|
13
|
+
const datasetProps = getDatasetProps(dataset);
|
|
14
|
+
const handleChange = (e) => {
|
|
15
|
+
onChange === null || onChange === void 0 || onChange(e);
|
|
16
|
+
onValueChange === null || onValueChange === void 0 || onValueChange(e.target.value);
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputContainer, {
|
|
19
|
+
button,
|
|
20
|
+
icon,
|
|
21
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
|
22
|
+
...datasetProps,
|
|
23
|
+
...props,
|
|
24
|
+
ref,
|
|
25
|
+
onChange: handleChange,
|
|
26
|
+
className: Input_module_default.input
|
|
27
|
+
})
|
|
28
|
+
});
|
|
20
29
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { Input };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
I as InputContainer
|
|
5
|
-
};
|
|
1
|
+
import "../../../jsx-runtime-i4KUlhDu.js";
|
|
2
|
+
import { t as InputContainer } from "../../../InputContainer-CzzuOe_p.js";
|
|
3
|
+
export { InputContainer };
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { t as require_jsx_runtime } from "../../../jsx-runtime-i4KUlhDu.js";
|
|
3
|
+
import { n as Input_module_default, t as InputContainer } from "../../../InputContainer-CzzuOe_p.js";
|
|
3
4
|
import { forwardRef } from "react";
|
|
4
|
-
import { I as InputContainer, s as styles } from "../../../InputContainer-oHJlLWIi.js";
|
|
5
5
|
import { getDatasetProps } from "@preply/ds-web-core";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, ref) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
//#region src/components/private/Input/Textarea.tsx
|
|
7
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
8
|
+
/**
|
|
9
|
+
* A component to render a textarea.
|
|
10
|
+
* For internal use only.
|
|
11
|
+
*/
|
|
12
|
+
var Textarea = forwardRef(function TextareaComponent({ dataset, onChange, onValueChange, resize = "vertical", ...props }, ref) {
|
|
13
|
+
const datasetProps = getDatasetProps(dataset);
|
|
14
|
+
const handleChange = (e) => {
|
|
15
|
+
onChange === null || onChange === void 0 || onChange(e);
|
|
16
|
+
onValueChange === null || onValueChange === void 0 || onValueChange(e.target.value);
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", {
|
|
19
|
+
...datasetProps,
|
|
20
|
+
...props,
|
|
21
|
+
onChange: handleChange,
|
|
22
|
+
ref,
|
|
23
|
+
className: Input_module_default.input,
|
|
24
|
+
style: { resize }
|
|
25
|
+
}) });
|
|
21
26
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Textarea };
|
|
@@ -1,52 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { forwardRef } from "react";
|
|
6
|
-
import '../../../assets/Spinner.css';const Spinner$1 = "Spinner__U3f6H";
|
|
7
|
-
const spin = "spin__6opuF";
|
|
8
|
-
const styles = {
|
|
9
|
-
Spinner: Spinner$1,
|
|
10
|
-
"Spinner--size-default": "Spinner--size-default__xo-Jk",
|
|
11
|
-
"Spinner--size-large": "Spinner--size-large__2nk5J",
|
|
12
|
-
"Spinner--narrow-l--size-default": "Spinner--narrow-l--size-default__gRrq1",
|
|
13
|
-
"Spinner--narrow-l--size-large": "Spinner--narrow-l--size-large__6gb70",
|
|
14
|
-
"Spinner--medium-s--size-default": "Spinner--medium-s--size-default__bJg-R",
|
|
15
|
-
"Spinner--medium-s--size-large": "Spinner--medium-s--size-large__HAPhI",
|
|
16
|
-
"Spinner--medium-l--size-default": "Spinner--medium-l--size-default__AuHDV",
|
|
17
|
-
"Spinner--medium-l--size-large": "Spinner--medium-l--size-large__MlfBE",
|
|
18
|
-
"Spinner--wide-s--size-default": "Spinner--wide-s--size-default__3sTOC",
|
|
19
|
-
"Spinner--wide-s--size-large": "Spinner--wide-s--size-large__AkfHJ",
|
|
20
|
-
"Spinner--wide-l--size-default": "Spinner--wide-l--size-default__FDlfA",
|
|
21
|
-
"Spinner--wide-l--size-large": "Spinner--wide-l--size-large__Oyg7h",
|
|
22
|
-
"Spinner--static": "Spinner--static__3-otL",
|
|
23
|
-
"Spinner--animated": "Spinner--animated__K3vs3",
|
|
24
|
-
spin
|
|
25
|
-
};
|
|
26
|
-
const SvgEllipsis = ({
|
|
27
|
-
title,
|
|
28
|
-
titleId,
|
|
29
|
-
...props
|
|
30
|
-
}, ref) => /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ref, "aria-labelledby": titleId, ...props }, title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm9-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z" }));
|
|
31
|
-
const ForwardRef$1 = forwardRef(SvgEllipsis);
|
|
32
|
-
const SvgSpinner = ({
|
|
33
|
-
title,
|
|
34
|
-
titleId,
|
|
35
|
-
...props
|
|
36
|
-
}, ref) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", fill: "none", ref, "aria-labelledby": titleId, ...props }, title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("g", { clipPath: "url(#clip0_1785_4234)" }, /* @__PURE__ */ React.createElement("path", { d: "M30 15.9996C30.0002 18.5815 29.2863 21.1132 27.9373 23.3148C26.5884 25.5163 24.6569 27.302 22.3564 28.4743C20.0559 29.6465 17.476 30.1598 14.902 29.9573C12.328 29.7548 9.86014 28.8444 7.77126 27.3269C5.68238 25.8093 4.05386 23.7436 3.06576 21.3582C2.07765 18.9728 1.76846 16.3606 2.17236 13.8104C2.57627 11.2602 3.67753 8.8714 5.35439 6.90808C7.03126 4.94475 9.2184 3.48339 11.674 2.68557", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { opacity: 0.3, d: "M16 29.9996C23.732 29.9996 30 23.7316 30 15.9996C30 8.26758 23.732 1.99956 16 1.99956C8.26801 1.99956 2 8.26758 2 15.9996C2 23.7316 8.26801 29.9996 16 29.9996Z", strokeWidth: 3, strokeLinejoin: "round" })), /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", { id: "clip0_1785_4234" }, /* @__PURE__ */ React.createElement("rect", { width: 32, height: 32, fill: "white" }))));
|
|
37
|
-
const ForwardRef = forwardRef(SvgSpinner);
|
|
38
|
-
const SPINNER = "Spinner";
|
|
39
|
-
const Spinner = ({
|
|
40
|
-
size = SPINNER_SIZE_DEFAULT
|
|
41
|
-
}) => {
|
|
42
|
-
const classNames = moduleClassNames(styles, SPINNER, [stringClassNames("size", size)]);
|
|
43
|
-
const animatedClassNames = [...moduleLocals(styles, SPINNER, ["animated"])];
|
|
44
|
-
const staticClassNames = [...moduleLocals(styles, SPINNER, ["static"])];
|
|
45
|
-
return /* @__PURE__ */ jsxs("span", { className: classNames.join(" "), children: [
|
|
46
|
-
/* @__PURE__ */ jsx("span", { className: animatedClassNames.join(" "), children: /* @__PURE__ */ jsx(ForwardRef, {}) }),
|
|
47
|
-
/* @__PURE__ */ jsx("span", { className: staticClassNames.join(" "), children: /* @__PURE__ */ jsx(ForwardRef$1, {}) })
|
|
48
|
-
] });
|
|
49
|
-
};
|
|
50
|
-
export {
|
|
51
|
-
Spinner
|
|
52
|
-
};
|
|
1
|
+
import "../../../jsx-runtime-i4KUlhDu.js";
|
|
2
|
+
import { t as Spinner } from "../../../Spinner-Ck8KQA22.js";
|
|
3
|
+
export { Spinner };
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
visuallyHidden
|
|
5
|
-
};
|
|
6
|
-
function VisuallyHidden({
|
|
7
|
-
as = "span",
|
|
8
|
-
children
|
|
9
|
-
}) {
|
|
10
|
-
const Component = as != null ? as : "span";
|
|
11
|
-
return /* @__PURE__ */ jsx(Component, { className: styles.visuallyHidden, children });
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
VisuallyHidden
|
|
15
|
-
};
|
|
1
|
+
import "../../../jsx-runtime-i4KUlhDu.js";
|
|
2
|
+
import { t as VisuallyHidden } from "../../../VisuallyHidden-CtcHcZCK.js";
|
|
3
|
+
export { VisuallyHidden };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as Icon } from "./Icon-CixAeOSd.js";
|
|
3
|
+
import { t as require_jsx_runtime } from "./jsx-runtime-i4KUlhDu.js";
|
|
4
|
+
import { t as Text } from "./Text-CaOF75Z-.js";
|
|
5
|
+
import { t as Button } from "./Button-C35BZJZT.js";
|
|
6
|
+
import { r as AlertBanner_module_default } from "./AlertBannerProvider-Cf7w9AOq.js";
|
|
7
|
+
import { AlertBannerComponentContext, AlertBannerRoot } from "./components/AlertBanner/primitives/AlertBannerRoot.js";
|
|
8
|
+
import { AlertBannerIcon } from "./components/AlertBanner/primitives/AlertBannerIcon.js";
|
|
9
|
+
import { t as VisuallyHidden } from "./VisuallyHidden-CtcHcZCK.js";
|
|
10
|
+
import { t as IconButton } from "./IconButton-BPKpgfep.js";
|
|
11
|
+
import { Children, cloneElement, forwardRef, isValidElement, useContext } from "react";
|
|
12
|
+
import { getDatasetProps, moduleClassNames } from "@preply/ds-web-core";
|
|
13
|
+
import { webComponentNames } from "@preply/ds-visual-coverage-preply-component-names";
|
|
14
|
+
import { usePortalElement as usePortalElement$1 } from "@preply/ds-web-root";
|
|
15
|
+
import { FormattedMessage } from "react-intl";
|
|
16
|
+
import './assets/components.css';//#region src/components/AlertBanner/primitives/AlertBannerText.tsx
|
|
17
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
18
|
+
var alertBannerA11yPrefixMap = {
|
|
19
|
+
critical: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedMessage, {
|
|
20
|
+
id: "preply-ds.alert-banner.critical-prefix",
|
|
21
|
+
defaultMessage: "Alert:",
|
|
22
|
+
description: "Prefix every alert banner shown to the user. It's announced by screen readers as 'Alert: 'the alert message (for instance: 'Alert: We can't renew your subscription.')."
|
|
23
|
+
}),
|
|
24
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedMessage, {
|
|
25
|
+
id: "preply-ds.alert-banner.warning-prefix",
|
|
26
|
+
defaultMessage: "Warning:",
|
|
27
|
+
description: "Prefix every warning banner shown to the user. It's announced by screen readers as 'Warning: 'the alert message (for instance: 'Warning: Your credit card is about to expire.')."
|
|
28
|
+
}),
|
|
29
|
+
positive: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedMessage, {
|
|
30
|
+
id: "preply-ds.alert-banner.positive-prefix",
|
|
31
|
+
defaultMessage: "Update:",
|
|
32
|
+
description: "Prefix every positive banner shown to the user. It's announced by screen readers as 'Warning: 'the alert message (for instance: 'Warning: Your subscription has been renewed successfully.')."
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The AlertBannerText is a container which defaults to displaying a `Text` child with a
|
|
37
|
+
* `default-regular` variant, which can be overridden with the `children` prop. The passed text is
|
|
38
|
+
* also prefixed with a visually hidden text to allow screen reader user to remind of the existence
|
|
39
|
+
* of the region rendered by `AlertBannerProvider`.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* <AlertBannerText>
|
|
43
|
+
* Alert banner message goes here.
|
|
44
|
+
* </AlertBannerText>
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Set `Text` props
|
|
48
|
+
* <AlertBannerText tag="span">
|
|
49
|
+
* Alert banner message goes here.
|
|
50
|
+
* </AlertBannerText>
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Override `Text` `variant` prop
|
|
54
|
+
* <AlertBannerText variant="default-semibold">
|
|
55
|
+
* Alert banner message goes here.
|
|
56
|
+
* </AlertBannerText>
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Override styles via `className` prop
|
|
60
|
+
* <AlertBannerText className={myCustomStyles.text}>
|
|
61
|
+
* Alert banner message goes here.
|
|
62
|
+
* </AlertBannerText>
|
|
63
|
+
*
|
|
64
|
+
* @see AlertBannerProvider
|
|
65
|
+
*/
|
|
66
|
+
var AlertBannerText = forwardRef(function AlertBannerText({ className, children, ...props }, ref) {
|
|
67
|
+
const { variant } = useContext(AlertBannerComponentContext);
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
69
|
+
ref,
|
|
70
|
+
variant: "default-regular",
|
|
71
|
+
accent: "primary",
|
|
72
|
+
className: [AlertBanner_module_default.description, className].filter(Boolean).join(" "),
|
|
73
|
+
...props,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHidden, { children: alertBannerA11yPrefixMap[variant] }),
|
|
76
|
+
" ",
|
|
77
|
+
children
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/components/AlertBanner/primitives/AlertBannerAction.tsx
|
|
83
|
+
var buttonDefaultProps = {
|
|
84
|
+
variant: "secondary",
|
|
85
|
+
size: "small",
|
|
86
|
+
wrap: true,
|
|
87
|
+
fullWidth: {
|
|
88
|
+
_: true,
|
|
89
|
+
"medium-l": false
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* The AlertBannerAction is a container that sets defaults when Button or IconButton are passed.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* <AlertBannerAction className={myCustomStyle}>
|
|
97
|
+
* <Button {...} />
|
|
98
|
+
* </AlertBannerAction>
|
|
99
|
+
*
|
|
100
|
+
* If you want the default action but need to pass your own props to it, you
|
|
101
|
+
* can use the `DefaultAlertBannerAction` component.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* <AlertBannerAction>
|
|
105
|
+
* <Button
|
|
106
|
+
* leadingSvgIcon={MyCustomIcon}
|
|
107
|
+
* >
|
|
108
|
+
* My custom text
|
|
109
|
+
* </Button
|
|
110
|
+
* </AlertBannerAction>
|
|
111
|
+
*
|
|
112
|
+
* @see Button
|
|
113
|
+
* @see IconButton
|
|
114
|
+
*/
|
|
115
|
+
var AlertBannerAction = forwardRef(function AlertBannerAction({ className, children, ...props }, ref) {
|
|
116
|
+
const classNames = [AlertBanner_module_default.action, className].filter(Boolean).join(" ");
|
|
117
|
+
const patchedChildren = Children.map(children, (child) => {
|
|
118
|
+
if (!isDsButton(child)) return child;
|
|
119
|
+
return cloneElement(child, {
|
|
120
|
+
...buttonDefaultProps,
|
|
121
|
+
...child.props,
|
|
122
|
+
ref,
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
127
|
+
className: classNames,
|
|
128
|
+
"data-preply-ds-component": webComponentNames.AlertBannerAction,
|
|
129
|
+
children: patchedChildren
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
function isDsButton(node) {
|
|
133
|
+
if (!isValidElement(node)) return false;
|
|
134
|
+
return node.type === Button || node.type === IconButton;
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/components/AlertBanner/AlertBanner.tsx
|
|
138
|
+
/**
|
|
139
|
+
* The Alert Banner communicates important and time-sensitive messages that require user attention.
|
|
140
|
+
*
|
|
141
|
+
* From an accessibility perspective, the description is prefixed to announce the importance of the
|
|
142
|
+
* banner.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* <AlertBanner
|
|
146
|
+
* variant="alert"
|
|
147
|
+
* description="Failed to renew the subscription."
|
|
148
|
+
* actionLabel="Try again"
|
|
149
|
+
* actionOnClick={retryPayment}
|
|
150
|
+
* />
|
|
151
|
+
*/
|
|
152
|
+
var AlertBanner = (props) => {
|
|
153
|
+
const { variant, description, action, dataset } = props;
|
|
154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertBannerRoot, {
|
|
155
|
+
variant,
|
|
156
|
+
...getDatasetProps(dataset, { preplyDsComponent: webComponentNames.AlertBanner }),
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertBannerIcon, {}),
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertBannerText, { children: description }),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertBannerAction, { children: action })
|
|
161
|
+
]
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
var index_module_default = {
|
|
165
|
+
IconTile: "IconTile__JN1Mo",
|
|
166
|
+
"IconTile--size-small": "IconTile--size-small__8PuLN",
|
|
167
|
+
"IconTile--size-base": "IconTile--size-base__8cobE",
|
|
168
|
+
"IconTile--size-medium": "IconTile--size-medium__AYnun",
|
|
169
|
+
"IconTile--size-large": "IconTile--size-large__R159S",
|
|
170
|
+
"IconTile--tone-neutral": "IconTile--tone-neutral__RakY4",
|
|
171
|
+
"IconTile--tone-info": "IconTile--tone-info__yqu8Y",
|
|
172
|
+
"IconTile--tone-ai": "IconTile--tone-ai__IsgQT",
|
|
173
|
+
"IconTile--tone-positive": "IconTile--tone-positive__5fQ5C",
|
|
174
|
+
"IconTile--tone-warning": "IconTile--tone-warning__wCeLx",
|
|
175
|
+
"IconTile--tone-critical": "IconTile--tone-critical__FeCE3"
|
|
176
|
+
};
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/components/IconTile/IconTile.tsx
|
|
179
|
+
function getIconSize(size) {
|
|
180
|
+
switch (size) {
|
|
181
|
+
case "small": return "16";
|
|
182
|
+
case "medium": return "32";
|
|
183
|
+
case "large": return "48";
|
|
184
|
+
}
|
|
185
|
+
return "24";
|
|
186
|
+
}
|
|
187
|
+
var IconTile = forwardRef(function IconComponent({ size = "base", tone = "neutral", dataset, ...iconProps }, ref) {
|
|
188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
189
|
+
className: moduleClassNames(index_module_default, webComponentNames.IconTile, [`size-${size}`, `tone-${tone}`]).join(" "),
|
|
190
|
+
...getDatasetProps(dataset, { preplyDsComponent: webComponentNames.IconTile }),
|
|
191
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
192
|
+
...iconProps,
|
|
193
|
+
accent: "primary",
|
|
194
|
+
size: getIconSize(size),
|
|
195
|
+
ref
|
|
196
|
+
})
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
//#endregion
|
|
200
|
+
export { AlertBannerText as a, AlertBannerAction as i, IconTile as n, AlertBanner as r, usePortalElement$1 as t };
|