@transferwise/components 0.0.0-experimental-7ad2fa6 → 0.0.0-experimental-6f378c9
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/build/accordion/AccordionItem/AccordionItem.js +3 -22
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs +3 -22
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/build/actionButton/ActionButton.js +1 -22
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs +1 -22
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js +2 -24
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs +2 -24
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +6 -22
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +6 -22
- package/build/alert/Alert.mjs.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js +2 -25
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs +2 -25
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
- package/build/avatar/Avatar.js +2 -23
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +2 -23
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +3 -23
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +3 -23
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +2 -23
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +2 -23
- package/build/badge/Badge.mjs.map +1 -1
- package/build/button/Button.js +3 -22
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +3 -22
- package/build/button/Button.mjs.map +1 -1
- package/build/button/classMap.js +0 -24
- package/build/button/classMap.js.map +1 -1
- package/build/button/classMap.mjs +0 -24
- package/build/button/classMap.mjs.map +1 -1
- package/build/button/legacyUtils/legacyUtils.js +2 -24
- package/build/button/legacyUtils/legacyUtils.js.map +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs +2 -24
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
- package/build/card/Card.js +3 -23
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs +3 -23
- package/build/card/Card.mjs.map +1 -1
- package/build/checkbox/Checkbox.js +1 -23
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs +1 -23
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/chevron/Chevron.js +1 -21
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chevron/Chevron.mjs +1 -21
- package/build/chevron/Chevron.mjs.map +1 -1
- package/build/chips/Chip.js +1 -19
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chip.mjs +1 -19
- package/build/chips/Chip.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +4 -23
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +4 -23
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/bottomSheet/BottomSheet.js +2 -3
- package/build/common/bottomSheet/BottomSheet.js.map +1 -1
- package/build/common/bottomSheet/BottomSheet.mjs +2 -3
- package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
- package/build/common/hooks/useHasIntersected/useHasIntersected.js +10 -10
- package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -1
- package/build/common/hooks/useHasIntersected/useHasIntersected.mjs +10 -10
- package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -1
- package/build/common/locale/index.js +0 -24
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs +0 -24
- package/build/common/locale/index.mjs.map +1 -1
- package/build/common/panel/Panel.js +2 -23
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +2 -23
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +3 -27
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +3 -27
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +3 -22
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +3 -22
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js +5 -22
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +5 -22
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +6 -24
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.mjs +6 -24
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js +5 -26
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +5 -26
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.js +3 -19
- package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.mjs +3 -19
- package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
- package/build/decision/Decision.js +3 -24
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs +3 -24
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js +1 -23
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs +1 -23
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +2 -24
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +2 -24
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/display/Display.js +1 -23
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs +1 -23
- package/build/display/Display.mjs.map +1 -1
- package/build/drawer/Drawer.js +4 -23
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs +4 -23
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/field/Field.js +2 -23
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +2 -23
- package/build/field/Field.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js +2 -19
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +2 -19
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js +2 -24
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +2 -24
- package/build/header/Header.mjs.map +1 -1
- package/build/image/Image.js +1 -4
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs +1 -4
- package/build/image/Image.mjs.map +1 -1
- package/build/index.js +62 -69
- package/build/index.js.map +1 -1
- package/build/index.mjs +20 -27
- package/build/index.mjs.map +1 -1
- package/build/info/Info.js +3 -21
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.mjs +3 -21
- package/build/info/Info.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js +3 -24
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs +3 -24
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/inputs/SearchInput.js +2 -23
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs +2 -23
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js +1 -22
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs +1 -22
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/loader/Loader.js +1 -22
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs +1 -22
- package/build/loader/Loader.mjs.map +1 -1
- package/build/markdown/Markdown.js +2 -25
- package/build/markdown/Markdown.js.map +1 -1
- package/build/markdown/Markdown.mjs +2 -25
- package/build/markdown/Markdown.mjs.map +1 -1
- package/build/modal/Modal.js +5 -22
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +5 -22
- package/build/modal/Modal.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.js +3 -22
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +3 -22
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/navigationOption/NavigationOption.js +2 -23
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs +2 -23
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/nudge/Nudge.js +1 -19
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs +1 -19
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js +1 -19
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +1 -19
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +2 -23
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +2 -23
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/popover/Popover.js +4 -24
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +4 -24
- package/build/popover/Popover.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js +1 -22
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs +1 -22
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/progressBar/ProgressBar.js +2 -24
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/progressBar/ProgressBar.mjs +2 -24
- package/build/progressBar/ProgressBar.mjs.map +1 -1
- package/build/promoCard/PromoCard.js +2 -22
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs +2 -22
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js +1 -22
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +1 -22
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
- package/build/provider/Provider.js +2 -25
- package/build/provider/Provider.js.map +1 -1
- package/build/provider/Provider.mjs +2 -25
- package/build/provider/Provider.mjs.map +1 -1
- package/build/radio/Radio.js +2 -24
- package/build/radio/Radio.js.map +1 -1
- package/build/radio/Radio.mjs +2 -24
- package/build/radio/Radio.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js +1 -22
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +1 -22
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/select/Select.js +4 -26
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +4 -26
- package/build/select/Select.mjs.map +1 -1
- package/build/select/option/Option.js +1 -22
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/Option.mjs +1 -22
- package/build/select/option/Option.mjs.map +1 -1
- package/build/selectOption/SelectOption.js +6 -24
- package/build/selectOption/SelectOption.js.map +1 -1
- package/build/selectOption/SelectOption.mjs +6 -24
- package/build/selectOption/SelectOption.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +4 -22
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +4 -22
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js +3 -25
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs +3 -25
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/sticky/Sticky.js +2 -25
- package/build/sticky/Sticky.js.map +1 -1
- package/build/sticky/Sticky.mjs +2 -25
- package/build/sticky/Sticky.mjs.map +1 -1
- package/build/summary/Summary.js +5 -21
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +5 -21
- package/build/summary/Summary.mjs.map +1 -1
- package/build/tabs/Tabs.js +3 -23
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +3 -23
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tile/Tile.js +2 -24
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs +2 -24
- package/build/tile/Tile.mjs.map +1 -1
- package/build/title/Title.js +1 -23
- package/build/title/Title.js.map +1 -1
- package/build/title/Title.mjs +1 -23
- package/build/title/Title.mjs.map +1 -1
- package/build/tooltip/Tooltip.js +1 -22
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs +1 -22
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +4 -22
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +4 -22
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/common/hooks/index.d.ts +4 -4
- package/build/types/common/hooks/index.d.ts.map +1 -1
- package/build/types/common/hooks/useConditionalListener/index.d.ts +1 -1
- package/build/types/common/hooks/useConditionalListener/index.d.ts.map +1 -1
- package/build/types/common/hooks/useDirection/index.d.ts +1 -1
- package/build/types/common/hooks/useDirection/index.d.ts.map +1 -1
- package/build/types/common/hooks/useHasIntersected/index.d.ts +1 -1
- package/build/types/common/hooks/useHasIntersected/index.d.ts.map +1 -1
- package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts +4 -15
- package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts.map +1 -1
- package/build/types/common/index.d.ts +28 -28
- package/build/types/common/index.d.ts.map +1 -1
- package/build/types/common/responsivePanel/index.d.ts +1 -1
- package/build/types/common/responsivePanel/index.d.ts.map +1 -1
- package/build/types/index.d.ts +0 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/navigationOption/NavigationOption.d.ts +0 -1
- package/build/types/navigationOption/NavigationOption.d.ts.map +1 -1
- package/build/types/test-utils/style-mock.d.ts +1 -0
- package/build/types/test-utils/style-mock.d.ts.map +1 -0
- package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts +8 -6
- package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts.map +1 -1
- package/build/types/utilities/deprecatedProperty/index.d.ts +1 -1
- package/build/types/utilities/deprecatedProperty/index.d.ts.map +1 -1
- package/build/types/utilities/index.d.ts +2 -2
- package/build/types/utilities/index.d.ts.map +1 -1
- package/build/types/utilities/logActionRequired.d.ts +2 -2
- package/build/types/utilities/logActionRequired.d.ts.map +1 -1
- package/build/upload/Upload.js +2 -21
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +2 -21
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +3 -25
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +3 -25
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +3 -23
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +3 -23
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +3 -22
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +3 -22
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +2 -21
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +2 -21
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadButton/defaults.js +0 -24
- package/build/uploadInput/uploadButton/defaults.js.map +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs +0 -24
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +4 -21
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +4 -21
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/utilities/logActionRequired.js.map +1 -1
- package/build/utilities/logActionRequired.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +1 -25
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +1 -25
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +3 -3
- package/src/common/{fakeEvents.ts → fakeEvents.js} +1 -1
- package/src/common/hooks/useHasIntersected/{useHasIntersected.ts → useHasIntersected.js} +11 -20
- package/src/common/requirements.js +440 -0
- package/src/index.ts +0 -1
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +78 -0
- package/src/navigationOption/{NavigationOption.story.tsx → NavigationOption.story.js} +5 -23
- package/src/navigationOption/NavigationOption.tsx +1 -1
- package/src/utilities/deprecatedProperty/{deprecatedProperty.spec.js → deprecatedProperty.spec.ts} +7 -13
- package/src/utilities/deprecatedProperty/{deprecatedProperty.js → deprecatedProperty.ts} +23 -4
- package/src/utilities/{logActionRequired.js → logActionRequired.ts} +2 -2
- package/build/types/common/fakeEvents.d.ts +0 -23
- package/build/types/common/fakeEvents.d.ts.map +0 -1
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.js +0 -85
- /package/src/common/hooks/{index.ts → index.js} +0 -0
- /package/src/common/hooks/useConditionalListener/{index.ts → index.js} +0 -0
- /package/src/common/hooks/useDirection/{index.ts → index.js} +0 -0
- /package/src/common/hooks/useHasIntersected/{index.ts → index.js} +0 -0
- /package/src/common/{index.ts → index.js} +0 -0
- /package/src/common/responsivePanel/{index.ts → index.js} +0 -0
- /package/src/test-utils/{style-mock.js → style-mock.ts} +0 -0
- /package/src/utilities/deprecatedProperty/{index.js → index.ts} +0 -0
- /package/src/utilities/{index.js → index.ts} +0 -0
package/build/field/Field.mjs
CHANGED
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { useId } from 'react';
|
|
3
|
-
import '../common/theme.mjs';
|
|
4
|
-
import '../common/direction.mjs';
|
|
5
|
-
import '../common/propsValues/control.mjs';
|
|
6
|
-
import '../common/propsValues/breakpoint.mjs';
|
|
7
|
-
import '../common/propsValues/size.mjs';
|
|
8
|
-
import '../common/propsValues/typography.mjs';
|
|
9
|
-
import '../common/propsValues/width.mjs';
|
|
10
|
-
import '../common/propsValues/type.mjs';
|
|
11
|
-
import '../common/propsValues/dateMode.mjs';
|
|
12
|
-
import '../common/propsValues/monthFormat.mjs';
|
|
13
|
-
import '../common/propsValues/position.mjs';
|
|
14
|
-
import '../common/propsValues/layouts.mjs';
|
|
15
|
-
import '../common/propsValues/status.mjs';
|
|
16
|
-
import { Sentiment } from '../common/propsValues/sentiment.mjs';
|
|
17
|
-
import '../common/propsValues/profileType.mjs';
|
|
18
|
-
import '../common/propsValues/variant.mjs';
|
|
19
|
-
import '../common/propsValues/scroll.mjs';
|
|
20
|
-
import '../common/propsValues/markdownNodeType.mjs';
|
|
21
|
-
import '../common/fileType.mjs';
|
|
22
|
-
import '@transferwise/icons';
|
|
23
|
-
import 'react-intl';
|
|
24
|
-
import '../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
26
3
|
import InlineAlert from '../inlineAlert/InlineAlert.mjs';
|
|
27
4
|
import { FieldLabelIdContextProvider, InputIdContextProvider, InputDescribedByProvider, InputInvalidProvider } from '../inputs/contexts.mjs';
|
|
28
5
|
import { Label } from '../label/Label.mjs';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
import { Sentiment } from '../common/propsValues/sentiment.mjs';
|
|
29
8
|
|
|
30
9
|
const Field = ({
|
|
31
10
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.mjs","sources":["../../src/field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId } from 'react';\n\nimport { Sentiment } from '../common';\nimport InlineAlert from '../inlineAlert/InlineAlert';\nimport {\n FieldLabelIdContextProvider,\n InputDescribedByProvider,\n InputIdContextProvider,\n InputInvalidProvider,\n} from '../inputs/contexts';\nimport { Label } from '../label';\n\nexport type FieldProps = {\n /** `null` disables auto-generating the `id` attribute, falling back to nesting-based label association over setting `htmlFor` explicitly. */\n id?: string | null;\n /** Should be specified unless the wrapped control has its own labeling mechanism, e.g. `Checkbox`. */\n label?: React.ReactNode;\n required?: boolean;\n /** @deprecated use `description` prop instead */\n hint?: React.ReactNode;\n message?: React.ReactNode;\n /**\n * Override for the [InlineAlert icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n description?: React.ReactNode;\n /** @deprecated use `message` and `type={Sentiment.NEGATIVE}` prop instead */\n error?: React.ReactNode;\n sentiment?: `${Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.POSITIVE | Sentiment.WARNING}`;\n className?: string;\n children?: React.ReactNode;\n};\n\nexport const Field = ({\n id,\n label,\n required = true,\n message: propMessage,\n messageIconLabel,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const sentiment = props.error ? Sentiment.NEGATIVE : propType;\n const message = propMessage || props.error;\n const hasError = sentiment === Sentiment.NEGATIVE;\n\n const labelId = useId();\n\n const fallbackInputId = useId();\n const inputId = id !== null ? (id ?? fallbackInputId) : undefined;\n\n const messageId = useId();\n const descriptionId = useId();\n\n /**\n * form control can have multiple messages to describe it,\n * e.g the description underneath the label and inline alert\n */\n function ariaDescribedbyByIds() {\n const messageIds = [];\n if (description) {\n messageIds.push(descriptionId);\n }\n if (message) {\n messageIds.push(messageId);\n }\n return messageIds.length > 0 ? messageIds.join(' ') : undefined;\n }\n\n return (\n <FieldLabelIdContextProvider value={labelId}>\n <InputIdContextProvider value={inputId}>\n <InputDescribedByProvider value={ariaDescribedbyByIds()}>\n <InputInvalidProvider value={hasError}>\n <div\n className={clsx(\n 'np-field form-group d-block',\n {\n 'has-success': sentiment === Sentiment.POSITIVE,\n 'has-warning': sentiment === Sentiment.WARNING,\n 'has-error': hasError,\n 'has-info': sentiment === Sentiment.NEUTRAL,\n },\n className,\n )}\n >\n {label != null ? (\n <>\n <Label id={labelId} htmlFor={inputId}>\n {required ? label : <Label.Optional>{label}</Label.Optional>}\n </Label>\n <Label.Description id={descriptionId}>{description}</Label.Description>\n <div className=\"np-field-control\">{children}</div>\n </>\n ) : (\n children\n )}\n\n {message && (\n <InlineAlert type={sentiment} id={messageId} iconLabel={messageIconLabel}>\n {message}\n </InlineAlert>\n )}\n </div>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelIdContextProvider>\n );\n};\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelIdContextProvider","value","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","_jsxs","clsx","POSITIVE","WARNING","_Fragment","Label","htmlFor","Optional","Description","InlineAlert","type","iconLabel"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Field.mjs","sources":["../../src/field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId } from 'react';\n\nimport { Sentiment } from '../common';\nimport InlineAlert from '../inlineAlert/InlineAlert';\nimport {\n FieldLabelIdContextProvider,\n InputDescribedByProvider,\n InputIdContextProvider,\n InputInvalidProvider,\n} from '../inputs/contexts';\nimport { Label } from '../label';\n\nexport type FieldProps = {\n /** `null` disables auto-generating the `id` attribute, falling back to nesting-based label association over setting `htmlFor` explicitly. */\n id?: string | null;\n /** Should be specified unless the wrapped control has its own labeling mechanism, e.g. `Checkbox`. */\n label?: React.ReactNode;\n required?: boolean;\n /** @deprecated use `description` prop instead */\n hint?: React.ReactNode;\n message?: React.ReactNode;\n /**\n * Override for the [InlineAlert icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n description?: React.ReactNode;\n /** @deprecated use `message` and `type={Sentiment.NEGATIVE}` prop instead */\n error?: React.ReactNode;\n sentiment?: `${Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.POSITIVE | Sentiment.WARNING}`;\n className?: string;\n children?: React.ReactNode;\n};\n\nexport const Field = ({\n id,\n label,\n required = true,\n message: propMessage,\n messageIconLabel,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const sentiment = props.error ? Sentiment.NEGATIVE : propType;\n const message = propMessage || props.error;\n const hasError = sentiment === Sentiment.NEGATIVE;\n\n const labelId = useId();\n\n const fallbackInputId = useId();\n const inputId = id !== null ? (id ?? fallbackInputId) : undefined;\n\n const messageId = useId();\n const descriptionId = useId();\n\n /**\n * form control can have multiple messages to describe it,\n * e.g the description underneath the label and inline alert\n */\n function ariaDescribedbyByIds() {\n const messageIds = [];\n if (description) {\n messageIds.push(descriptionId);\n }\n if (message) {\n messageIds.push(messageId);\n }\n return messageIds.length > 0 ? messageIds.join(' ') : undefined;\n }\n\n return (\n <FieldLabelIdContextProvider value={labelId}>\n <InputIdContextProvider value={inputId}>\n <InputDescribedByProvider value={ariaDescribedbyByIds()}>\n <InputInvalidProvider value={hasError}>\n <div\n className={clsx(\n 'np-field form-group d-block',\n {\n 'has-success': sentiment === Sentiment.POSITIVE,\n 'has-warning': sentiment === Sentiment.WARNING,\n 'has-error': hasError,\n 'has-info': sentiment === Sentiment.NEUTRAL,\n },\n className,\n )}\n >\n {label != null ? (\n <>\n <Label id={labelId} htmlFor={inputId}>\n {required ? label : <Label.Optional>{label}</Label.Optional>}\n </Label>\n <Label.Description id={descriptionId}>{description}</Label.Description>\n <div className=\"np-field-control\">{children}</div>\n </>\n ) : (\n children\n )}\n\n {message && (\n <InlineAlert type={sentiment} id={messageId} iconLabel={messageIconLabel}>\n {message}\n </InlineAlert>\n )}\n </div>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelIdContextProvider>\n );\n};\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelIdContextProvider","value","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","_jsxs","clsx","POSITIVE","WARNING","_Fragment","Label","htmlFor","Optional","Description","InlineAlert","type","iconLabel"],"mappings":";;;;;;;;AAmCO,MAAMA,KAAK,GAAGA,CAAC;EACpBC,EAAE;EACFC,KAAK;AACLC,EAAAA,QAAQ,GAAG,IAAI;AACfC,EAAAA,OAAO,EAAEC,WAAW;EACpBC,gBAAgB;EAChBC,IAAI;AACJC,EAAAA,WAAW,GAAGD,IAAI;AAClBE,EAAAA,SAAS,EAAEC,QAAQ,GAAGC,SAAS,CAACC,OAAO;EACvCC,SAAS;EACTC,QAAQ;EACR,GAAGC,KAAAA;AAAK,CACG,KAAI;EACf,MAAMN,SAAS,GAAGM,KAAK,CAACC,KAAK,GAAGL,SAAS,CAACM,QAAQ,GAAGP,QAAQ,CAAA;AAC7D,EA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6 @@
|
|
|
2
2
|
|
|
3
3
|
var clsx = require('clsx');
|
|
4
4
|
var reactIntl = require('react-intl');
|
|
5
|
-
require('../common/theme.js');
|
|
6
|
-
require('../common/direction.js');
|
|
7
|
-
require('../common/propsValues/control.js');
|
|
8
|
-
var breakpoint = require('../common/propsValues/breakpoint.js');
|
|
9
|
-
require('../common/propsValues/size.js');
|
|
10
|
-
require('../common/propsValues/typography.js');
|
|
11
|
-
require('../common/propsValues/width.js');
|
|
12
|
-
require('../common/propsValues/type.js');
|
|
13
|
-
require('../common/propsValues/dateMode.js');
|
|
14
|
-
require('../common/propsValues/monthFormat.js');
|
|
15
|
-
require('../common/propsValues/position.js');
|
|
16
|
-
var layouts = require('../common/propsValues/layouts.js');
|
|
17
|
-
require('../common/propsValues/status.js');
|
|
18
|
-
require('../common/propsValues/sentiment.js');
|
|
19
|
-
require('../common/propsValues/profileType.js');
|
|
20
|
-
require('../common/propsValues/variant.js');
|
|
21
|
-
require('../common/propsValues/scroll.js');
|
|
22
|
-
require('../common/propsValues/markdownNodeType.js');
|
|
23
|
-
require('../common/fileType.js');
|
|
24
5
|
var CloseButton = require('../common/closeButton/CloseButton.js');
|
|
25
6
|
var FlowHeader = require('../common/flowHeader/FlowHeader.js');
|
|
26
7
|
var Logo = require('../logo/Logo.js');
|
|
@@ -30,6 +11,8 @@ var FlowNavigation_messages = require('./FlowNavigation.messages.js');
|
|
|
30
11
|
var AnimatedLabel = require('./animatedLabel/AnimatedLabel.js');
|
|
31
12
|
var BackButton = require('./backButton/BackButton.js');
|
|
32
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
|
+
var breakpoint = require('../common/propsValues/breakpoint.js');
|
|
15
|
+
var layouts = require('../common/propsValues/layouts.js');
|
|
33
16
|
|
|
34
17
|
const FlowNavigation = ({
|
|
35
18
|
activeStep = 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowNavigation.js","sources":["../../src/flowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Breakpoint, Layout } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader/FlowHeader';\nimport Logo from '../logo';\nimport Stepper, { type Step } from '../stepper/Stepper';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './animatedLabel';\nimport BackButton from './backButton';\n\nexport interface FlowNavigationProps {\n activeStep?: number;\n avatar?: React.ReactNode;\n logo?: React.ReactNode;\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: () => void;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. If you don't need the stepper, please use OverlayHeader instead */\n steps: readonly Step[];\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = <Logo />,\n done = false,\n onClose,\n onGoBack,\n steps,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const newAvatar = done ? null : avatar;\n\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n return (\n <div\n className={clsx('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {\n 'np-flow-navigation--border-bottom': !done,\n })}\n >\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content p-x-3',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <BackButton aria-label={intl.formatMessage(messages.back)} onClick={onGoBack} />\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n )\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n </div>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["FlowNavigation","activeStep","avatar","logo","_jsx","Logo","done","onClose","onGoBack","steps","intl","useIntl","closeButton","CloseButton","size","onClick","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","newAvatar","displayGoBack","className","clsx","children","FlowHeader","leftContent","_jsxs","_Fragment","BackButton","formatMessage","messages","back","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlowNavigation.js","sources":["../../src/flowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Breakpoint, Layout } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader/FlowHeader';\nimport Logo from '../logo';\nimport Stepper, { type Step } from '../stepper/Stepper';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './animatedLabel';\nimport BackButton from './backButton';\n\nexport interface FlowNavigationProps {\n activeStep?: number;\n avatar?: React.ReactNode;\n logo?: React.ReactNode;\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: () => void;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. If you don't need the stepper, please use OverlayHeader instead */\n steps: readonly Step[];\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = <Logo />,\n done = false,\n onClose,\n onGoBack,\n steps,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const newAvatar = done ? null : avatar;\n\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n return (\n <div\n className={clsx('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {\n 'np-flow-navigation--border-bottom': !done,\n })}\n >\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content p-x-3',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <BackButton aria-label={intl.formatMessage(messages.back)} onClick={onGoBack} />\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n )\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n </div>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["FlowNavigation","activeStep","avatar","logo","_jsx","Logo","done","onClose","onGoBack","steps","intl","useIntl","closeButton","CloseButton","size","onClick","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","newAvatar","displayGoBack","className","clsx","children","FlowHeader","leftContent","_jsxs","_Fragment","BackButton","formatMessage","messages","back","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL"],"mappings":";;;;;;;;;;;;;;;;AA2BMA,MAAAA,cAAc,GAAGA,CAAC;AACtBC,EAAAA,UAAU,GAAG,CAAC;EACdC,MAAM;AACNC,EAAAA,IAAI,gBAAGC,cAAA,CAACC,YAAI,IAAG,CAAA;AACfC,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ;AACRC,EAAAA,KAAAA;AAAK,CACe,KAAI;AACxB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;EAEtB,MAAMC,WAAW,GAAGL,OAAO,IAAI,IAAI,iBAAIH,cAAA,CAACS,uBAAW,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAER,OAAAA;AAAQ,IAAG,CAAA;AAElF,EAAA,MAAMS,QAAQ,GAAGC,2BAAa,CAACC,qBAAU,CAACC,KAAK,CAAC,CAAA;AAChD,EAAA,MAAMC,QAAQ,GAAGH,2BAAa,CAACC,qBAAU,CAACG,KAAK,CAAC,CAAA;AAEhD,EAAA,MAAMC,SAAS,GAAGhB,IAAI,GAAG,IAAI,GAAGJ,MAAM,CAAA;EAEtC,MAAMqB,aAAa,GAAGf,QAAQ,IAAI,IAAI,IAAIP,UAAU,GAAG,CAAC,CAAA;AAExD,EAAA,oBACEG,cAAA,CAAA,KAAA,EAAA;AACEoB,IAAAA,SAAS,EAAEC,SAAI,CAAC,2EAA2E,EAAE;AAC3F,MAAA,mCAAmC,EAAE,CAACnB,IAAAA;AACvC,KAAA,CAAE;IAAAoB,QAAA,eAEHtB,cAAA,CAACuB,UAAU,EAAA;MACTH,SAAS,EAAEC,SAAI,CACb,mCAAmC,EACnCT,QAAQ,IAAI,IAAI,GACZ,4BAA4B,GAC5B;QACE,4BAA4B,EAAE,CAACA,QAAQ;AACvC;AACA,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D,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
|
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import '../common/theme.mjs';
|
|
4
|
-
import '../common/direction.mjs';
|
|
5
|
-
import '../common/propsValues/control.mjs';
|
|
6
|
-
import { Breakpoint } from '../common/propsValues/breakpoint.mjs';
|
|
7
|
-
import '../common/propsValues/size.mjs';
|
|
8
|
-
import '../common/propsValues/typography.mjs';
|
|
9
|
-
import '../common/propsValues/width.mjs';
|
|
10
|
-
import '../common/propsValues/type.mjs';
|
|
11
|
-
import '../common/propsValues/dateMode.mjs';
|
|
12
|
-
import '../common/propsValues/monthFormat.mjs';
|
|
13
|
-
import '../common/propsValues/position.mjs';
|
|
14
|
-
import { Layout } from '../common/propsValues/layouts.mjs';
|
|
15
|
-
import '../common/propsValues/status.mjs';
|
|
16
|
-
import '../common/propsValues/sentiment.mjs';
|
|
17
|
-
import '../common/propsValues/profileType.mjs';
|
|
18
|
-
import '../common/propsValues/variant.mjs';
|
|
19
|
-
import '../common/propsValues/scroll.mjs';
|
|
20
|
-
import '../common/propsValues/markdownNodeType.mjs';
|
|
21
|
-
import '../common/fileType.mjs';
|
|
22
3
|
import { CloseButton } from '../common/closeButton/CloseButton.mjs';
|
|
23
4
|
import FlowHeader from '../common/flowHeader/FlowHeader.mjs';
|
|
24
5
|
import Logo from '../logo/Logo.mjs';
|
|
@@ -28,6 +9,8 @@ import messages from './FlowNavigation.messages.mjs';
|
|
|
28
9
|
import AnimatedLabel from './animatedLabel/AnimatedLabel.mjs';
|
|
29
10
|
import BackButton from './backButton/BackButton.mjs';
|
|
30
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
12
|
+
import { Breakpoint } from '../common/propsValues/breakpoint.mjs';
|
|
13
|
+
import { Layout } from '../common/propsValues/layouts.mjs';
|
|
31
14
|
|
|
32
15
|
const FlowNavigation = ({
|
|
33
16
|
activeStep = 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowNavigation.mjs","sources":["../../src/flowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Breakpoint, Layout } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader/FlowHeader';\nimport Logo from '../logo';\nimport Stepper, { type Step } from '../stepper/Stepper';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './animatedLabel';\nimport BackButton from './backButton';\n\nexport interface FlowNavigationProps {\n activeStep?: number;\n avatar?: React.ReactNode;\n logo?: React.ReactNode;\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: () => void;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. If you don't need the stepper, please use OverlayHeader instead */\n steps: readonly Step[];\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = <Logo />,\n done = false,\n onClose,\n onGoBack,\n steps,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const newAvatar = done ? null : avatar;\n\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n return (\n <div\n className={clsx('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {\n 'np-flow-navigation--border-bottom': !done,\n })}\n >\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content p-x-3',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <BackButton aria-label={intl.formatMessage(messages.back)} onClick={onGoBack} />\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n )\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n </div>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["FlowNavigation","activeStep","avatar","logo","_jsx","Logo","done","onClose","onGoBack","steps","intl","useIntl","closeButton","CloseButton","size","onClick","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","newAvatar","displayGoBack","className","clsx","children","FlowHeader","leftContent","_jsxs","_Fragment","BackButton","formatMessage","messages","back","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlowNavigation.mjs","sources":["../../src/flowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Breakpoint, Layout } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader/FlowHeader';\nimport Logo from '../logo';\nimport Stepper, { type Step } from '../stepper/Stepper';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './animatedLabel';\nimport BackButton from './backButton';\n\nexport interface FlowNavigationProps {\n activeStep?: number;\n avatar?: React.ReactNode;\n logo?: React.ReactNode;\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: () => void;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. If you don't need the stepper, please use OverlayHeader instead */\n steps: readonly Step[];\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = <Logo />,\n done = false,\n onClose,\n onGoBack,\n steps,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const newAvatar = done ? null : avatar;\n\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n return (\n <div\n className={clsx('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {\n 'np-flow-navigation--border-bottom': !done,\n })}\n >\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content p-x-3',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <BackButton aria-label={intl.formatMessage(messages.back)} onClick={onGoBack} />\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n )\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n </div>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["FlowNavigation","activeStep","avatar","logo","_jsx","Logo","done","onClose","onGoBack","steps","intl","useIntl","closeButton","CloseButton","size","onClick","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","newAvatar","displayGoBack","className","clsx","children","FlowHeader","leftContent","_jsxs","_Fragment","BackButton","formatMessage","messages","back","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL"],"mappings":";;;;;;;;;;;;;;AA2BMA,MAAAA,cAAc,GAAGA,CAAC;AACtBC,EAAAA,UAAU,GAAG,CAAC;EACdC,MAAM;AACNC,EAAAA,IAAI,gBAAGC,GAAA,CAACC,IAAI,IAAG,CAAA;AACfC,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ;AACRC,EAAAA,KAAAA;AAAK,CACe,KAAI;AACxB,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE,CAAA;EAEtB,MAAMC,WAAW,GAAGL,OAAO,IAAI,IAAI,iBAAIH,GAAA,CAACS,WAAW,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAER,OAAAA;AAAQ,IAAG,CAAA;AAElF,EAAA,MAAMS,QAAQ,GAAGC,aAAa,CAACC,UAAU,CAACC,KAAK,CAAC,CAAA;AAChD,EAAA,MAAMC,QAAQ,GAAGH,aAAa,CAACC,UAAU,CAACG,KAAK,CAAC,CAAA;AAEhD,EAAA,MAAMC,SAAS,GAAGhB,IAAI,GAAG,IAAI,GAAGJ,MAAM,CAAA;EAEtC,MAAMqB,aAAa,GAAGf,QAAQ,IAAI,IAAI,IAAIP,UAAU,GAAG,CAAC,CAAA;AAExD,EAAA,oBACEG,GAAA,CAAA,KAAA,EAAA;AACEoB,IAAAA,SAAS,EAAEC,IAAI,CAAC,2EAA2E,EAAE;AAC3F,MAAA,mCAAmC,EAAE,CAACnB,IAAAA;AACvC,KAAA,CAAE;IAAAoB,QAAA,eAEHtB,GAAA,CAACuB,UAAU,EAAA;MACTH,SAAS,EAA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;AAAE,OAAA,CAGpD;MACDe,MAAM,EAAE,CAACpB,QAAQ,GAAGqB,MAAM,CAACC,QAAQ,GAAGD,MAAM,CAACE,UAAAA;KAEjD,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
|
package/build/header/Header.js
CHANGED
|
@@ -4,32 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var Button = require('../button/Button.js');
|
|
7
|
-
require('../common/theme.js');
|
|
8
|
-
require('../common/direction.js');
|
|
9
|
-
require('../common/propsValues/control.js');
|
|
10
|
-
require('../common/propsValues/breakpoint.js');
|
|
11
|
-
require('../common/propsValues/size.js');
|
|
12
|
-
var typography = require('../common/propsValues/typography.js');
|
|
13
|
-
require('../common/propsValues/width.js');
|
|
14
|
-
require('../common/propsValues/type.js');
|
|
15
|
-
require('../common/propsValues/dateMode.js');
|
|
16
|
-
require('../common/propsValues/monthFormat.js');
|
|
17
|
-
require('../common/propsValues/position.js');
|
|
18
|
-
require('../common/propsValues/layouts.js');
|
|
19
|
-
require('../common/propsValues/status.js');
|
|
20
|
-
require('../common/propsValues/sentiment.js');
|
|
21
|
-
require('../common/propsValues/profileType.js');
|
|
22
|
-
require('../common/propsValues/variant.js');
|
|
23
|
-
require('../common/propsValues/scroll.js');
|
|
24
|
-
require('../common/propsValues/markdownNodeType.js');
|
|
25
|
-
require('../common/fileType.js');
|
|
26
|
-
require('@transferwise/icons');
|
|
27
|
-
require('react');
|
|
28
|
-
require('react-intl');
|
|
29
|
-
require('../common/closeButton/CloseButton.messages.js');
|
|
30
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
31
7
|
var Link = require('../link/Link.js');
|
|
32
8
|
var Title = require('../title/Title.js');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
var typography = require('../common/propsValues/typography.js');
|
|
33
11
|
|
|
34
12
|
const HeaderAction = ({
|
|
35
13
|
action
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { ActionButtonProps } from '../actionButton/ActionButton';\nimport Button from '../button';\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../link';\nimport Title from '../title';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n};\n\ntype ButtonActionProps = ActionProps & ActionButtonProps;\n\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport type HeaderProps = CommonProps & {\n /**\n * When the `href` property is provided to the `action`, we will render a `Link` instead of a `ActionButton`.\n */\n action?: ButtonActionProps | LinkActionProps;\n /**\n * Override the heading element rendered for the title, useful to specify the semantics of your header.\n *\n * @default \"h5\"\n */\n as?: Heading | 'legend';\n title: string;\n};\n\nconst HeaderAction = ({ action }: { action: ButtonActionProps | LinkActionProps }) => {\n const props = {\n 'aria-label': action['aria-label'],\n };\n\n if ('href' in action) {\n return (\n <Link href={action.href} target={action.target} onClick={action.onClick} {...props}>\n {action.text}\n </Link>\n );\n }\n\n return (\n <Button\n className=\"np-header__button\"\n priority=\"tertiary\"\n size=\"sm\"\n onClick={action.onClick}\n {...props}\n >\n {action.text}\n </Button>\n );\n};\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header\n *\n */\nexport const Header = ({ action, as = 'h5', title, className }: HeaderProps) => {\n if (!action) {\n return (\n <Title\n as={as}\n type={Typography.TITLE_GROUP}\n className={clsx('np-header', 'np-header__title', className)}\n >\n {title}\n </Title>\n );\n }\n\n if (as === 'legend') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n\n return (\n <div className={clsx('np-header', className)}>\n <Title as={as} type={Typography.TITLE_GROUP} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n};\n\nexport default Header;\n"],"names":["HeaderAction","action","props","_jsx","Link","href","target","onClick","children","text","Button","className","priority","size","Header","as","title","Title","type","Typography","TITLE_GROUP","clsx","console","warn","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { ActionButtonProps } from '../actionButton/ActionButton';\nimport Button from '../button';\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../link';\nimport Title from '../title';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n};\n\ntype ButtonActionProps = ActionProps & ActionButtonProps;\n\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport type HeaderProps = CommonProps & {\n /**\n * When the `href` property is provided to the `action`, we will render a `Link` instead of a `ActionButton`.\n */\n action?: ButtonActionProps | LinkActionProps;\n /**\n * Override the heading element rendered for the title, useful to specify the semantics of your header.\n *\n * @default \"h5\"\n */\n as?: Heading | 'legend';\n title: string;\n};\n\nconst HeaderAction = ({ action }: { action: ButtonActionProps | LinkActionProps }) => {\n const props = {\n 'aria-label': action['aria-label'],\n };\n\n if ('href' in action) {\n return (\n <Link href={action.href} target={action.target} onClick={action.onClick} {...props}>\n {action.text}\n </Link>\n );\n }\n\n return (\n <Button\n className=\"np-header__button\"\n priority=\"tertiary\"\n size=\"sm\"\n onClick={action.onClick}\n {...props}\n >\n {action.text}\n </Button>\n );\n};\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header\n *\n */\nexport const Header = ({ action, as = 'h5', title, className }: HeaderProps) => {\n if (!action) {\n return (\n <Title\n as={as}\n type={Typography.TITLE_GROUP}\n className={clsx('np-header', 'np-header__title', className)}\n >\n {title}\n </Title>\n );\n }\n\n if (as === 'legend') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n\n return (\n <div className={clsx('np-header', className)}>\n <Title as={as} type={Typography.TITLE_GROUP} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n};\n\nexport default Header;\n"],"names":["HeaderAction","action","props","_jsx","Link","href","target","onClick","children","text","Button","className","priority","size","Header","as","title","Title","type","Typography","TITLE_GROUP","clsx","console","warn","_jsxs"],"mappings":";;;;;;;;;;;AA8BA,MAAMA,YAAY,GAAGA,CAAC;AAAEC,EAAAA,MAAAA;AAAM,CAAmD,KAAI;AACnF,EAAA,MAAMC,KAAK,GAAG;IACZ,YAAY,EAAED,MAAM,CAAC,YAAY,CAAA;GAClC,CAAA;EAED,IAAI,MAAM,IAAIA,MAAM,EAAE;IACpB,oBACEE,cAAA,CAACC,IAAI,EAAA;MAACC,IAAI,EAAEJ,MAAM,CAACI,IAAK;MAACC,MAAM,EAAEL,MAAM,CAACK,MAAO;MAACC,OAAO,EAAEN,MAAM,CAACM,OAAQ;AAAA,MAAA,GAAKL,KAAK;MAAAM,QAAA,EAC/EP,MAAM,CAACQ,IAAAA;AAAI,KACR,CAAC,CAAA;AAEX,GAAA;EAEA,oBACEN,cAAA,CAACO,MAAM,EAAA;AACLC,IAAAA,SAAS,EAAC,mBAAmB;AAC7BC,IAAAA,QAAQ,EAAC,UAAU;AACnBC,IAAAA,IAAI,EAAC,IAAI;IACTN,OAAO,EAAEN,MAAM,CAACM,OAAQ;AAAA,IAAA,GACpBL,KAAK;IAAAM,QAAA,EAERP,MAAM,CAACQ,IAAAA;AAAI,GACN,CAAC,CAAA;AAEb,CAAC,CAAA;AAED;;;;AAIG;AACI,MAAMK,MAAM,GAAGA,CAAC;EAAEb,MAAM;AAAEc,EAAAA,EAAE,GAAG,IAAI;EAAEC,KAAK;AAAEL,EAAAA,SAAAA;AAAS,CAAe,KAAI;EAC7E,IAAI,CAACV,MAAM,EAAE;IACX,oBACEE,cAAA,CAACc,KAAK,EAAA;AACJF,MAAAA,EAAE,EAAEA,EAAG;MACPG,IAAI,EAAEC,qBAAU,CAACC,WAAY;MAC7BT,SAAS,EAAEU,SAAI,CAAC,WAAW,EAAE,kBAAkB,EAAEV,SAAS,CAAE;AAAAH,MAAAA,QAAA,EAE3DQ,KAAAA;AAAK,KACD,CAAC,CAAA;AAEZ,GAAA;EAEA,IAAID,EAAE,KAAK,QAAQ,EAAE;AACnB;AACAO,IAAAA,OAAO,CAACC,IAAI,CACV,oGAAoG,CACrG,CAAA;AACH,GAAA;AAEA,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AAAKb,IAAAA,SAAS,EAAEU,SAAI,CAAC,WAAW,EAAEV,SAAS,CAAE;IAAAH,QAAA,EAAA,cAC3CL,cAAA,CAACc,KAAK,EAAA;AAACF,MAAAA,EAAE,EAAEA,EAAG;MAACG,IAAI,EAAEC,qBAAU,CAACC,WAAY;AAACT,MAAAA,SAAS,EAAC,kBAAkB;AAAAH,MAAAA,QAAA,EACtEQ,KAAAA;AAAK,KACD,CACP,eAAAb,cAAA,CAACH,YAAY,EAAA;AAACC,MAAAA,MAAM,EAAEA,MAAAA;AAAO,KAC/B,CAAA,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;;"}
|
package/build/header/Header.mjs
CHANGED
|
@@ -1,31 +1,9 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import Button from '../button/Button.mjs';
|
|
3
|
-
import '../common/theme.mjs';
|
|
4
|
-
import '../common/direction.mjs';
|
|
5
|
-
import '../common/propsValues/control.mjs';
|
|
6
|
-
import '../common/propsValues/breakpoint.mjs';
|
|
7
|
-
import '../common/propsValues/size.mjs';
|
|
8
|
-
import { Typography } from '../common/propsValues/typography.mjs';
|
|
9
|
-
import '../common/propsValues/width.mjs';
|
|
10
|
-
import '../common/propsValues/type.mjs';
|
|
11
|
-
import '../common/propsValues/dateMode.mjs';
|
|
12
|
-
import '../common/propsValues/monthFormat.mjs';
|
|
13
|
-
import '../common/propsValues/position.mjs';
|
|
14
|
-
import '../common/propsValues/layouts.mjs';
|
|
15
|
-
import '../common/propsValues/status.mjs';
|
|
16
|
-
import '../common/propsValues/sentiment.mjs';
|
|
17
|
-
import '../common/propsValues/profileType.mjs';
|
|
18
|
-
import '../common/propsValues/variant.mjs';
|
|
19
|
-
import '../common/propsValues/scroll.mjs';
|
|
20
|
-
import '../common/propsValues/markdownNodeType.mjs';
|
|
21
|
-
import '../common/fileType.mjs';
|
|
22
|
-
import '@transferwise/icons';
|
|
23
|
-
import 'react';
|
|
24
|
-
import 'react-intl';
|
|
25
|
-
import '../common/closeButton/CloseButton.messages.mjs';
|
|
26
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
27
3
|
import Link from '../link/Link.mjs';
|
|
28
4
|
import Title from '../title/Title.mjs';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
import { Typography } from '../common/propsValues/typography.mjs';
|
|
29
7
|
|
|
30
8
|
const HeaderAction = ({
|
|
31
9
|
action
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.mjs","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { ActionButtonProps } from '../actionButton/ActionButton';\nimport Button from '../button';\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../link';\nimport Title from '../title';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n};\n\ntype ButtonActionProps = ActionProps & ActionButtonProps;\n\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport type HeaderProps = CommonProps & {\n /**\n * When the `href` property is provided to the `action`, we will render a `Link` instead of a `ActionButton`.\n */\n action?: ButtonActionProps | LinkActionProps;\n /**\n * Override the heading element rendered for the title, useful to specify the semantics of your header.\n *\n * @default \"h5\"\n */\n as?: Heading | 'legend';\n title: string;\n};\n\nconst HeaderAction = ({ action }: { action: ButtonActionProps | LinkActionProps }) => {\n const props = {\n 'aria-label': action['aria-label'],\n };\n\n if ('href' in action) {\n return (\n <Link href={action.href} target={action.target} onClick={action.onClick} {...props}>\n {action.text}\n </Link>\n );\n }\n\n return (\n <Button\n className=\"np-header__button\"\n priority=\"tertiary\"\n size=\"sm\"\n onClick={action.onClick}\n {...props}\n >\n {action.text}\n </Button>\n );\n};\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header\n *\n */\nexport const Header = ({ action, as = 'h5', title, className }: HeaderProps) => {\n if (!action) {\n return (\n <Title\n as={as}\n type={Typography.TITLE_GROUP}\n className={clsx('np-header', 'np-header__title', className)}\n >\n {title}\n </Title>\n );\n }\n\n if (as === 'legend') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n\n return (\n <div className={clsx('np-header', className)}>\n <Title as={as} type={Typography.TITLE_GROUP} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n};\n\nexport default Header;\n"],"names":["HeaderAction","action","props","_jsx","Link","href","target","onClick","children","text","Button","className","priority","size","Header","as","title","Title","type","Typography","TITLE_GROUP","clsx","console","warn","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.mjs","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { ActionButtonProps } from '../actionButton/ActionButton';\nimport Button from '../button';\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../link';\nimport Title from '../title';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n};\n\ntype ButtonActionProps = ActionProps & ActionButtonProps;\n\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport type HeaderProps = CommonProps & {\n /**\n * When the `href` property is provided to the `action`, we will render a `Link` instead of a `ActionButton`.\n */\n action?: ButtonActionProps | LinkActionProps;\n /**\n * Override the heading element rendered for the title, useful to specify the semantics of your header.\n *\n * @default \"h5\"\n */\n as?: Heading | 'legend';\n title: string;\n};\n\nconst HeaderAction = ({ action }: { action: ButtonActionProps | LinkActionProps }) => {\n const props = {\n 'aria-label': action['aria-label'],\n };\n\n if ('href' in action) {\n return (\n <Link href={action.href} target={action.target} onClick={action.onClick} {...props}>\n {action.text}\n </Link>\n );\n }\n\n return (\n <Button\n className=\"np-header__button\"\n priority=\"tertiary\"\n size=\"sm\"\n onClick={action.onClick}\n {...props}\n >\n {action.text}\n </Button>\n );\n};\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header\n *\n */\nexport const Header = ({ action, as = 'h5', title, className }: HeaderProps) => {\n if (!action) {\n return (\n <Title\n as={as}\n type={Typography.TITLE_GROUP}\n className={clsx('np-header', 'np-header__title', className)}\n >\n {title}\n </Title>\n );\n }\n\n if (as === 'legend') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n\n return (\n <div className={clsx('np-header', className)}>\n <Title as={as} type={Typography.TITLE_GROUP} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n};\n\nexport default Header;\n"],"names":["HeaderAction","action","props","_jsx","Link","href","target","onClick","children","text","Button","className","priority","size","Header","as","title","Title","type","Typography","TITLE_GROUP","clsx","console","warn","_jsxs"],"mappings":";;;;;;;AA8BA,MAAMA,YAAY,GAAGA,CAAC;AAAEC,EAAAA,MAAAA;AAAM,CAAmD,KAAI;AACnF,EAAA,MAAMC,KAAK,GAAG;IACZ,YAAY,EAAED,MAAM,CAAC,YAAY,CAAA;GAClC,CAAA;EAED,IAAI,MAAM,IAAIA,MAAM,EAAE;IACpB,oBACEE,GAAA,CAACC,IAAI,EAAA;MAACC,IAAI,EAAEJ,MAAM,CAACI,IAAK;MAACC,MAAM,EAAEL,MAAM,CAACK,MAAO;MAACC,OAAO,EAAEN,MAAM,CAACM,OAAQ;AAAA,MAAA,GAAKL,KAAK;MAAAM,QAAA,EAC/EP,MAAM,CAACQ,IAAAA;AAAI,KACR,CAAC,CAAA;AAEX,GAAA;EAEA,oBACEN,GAAA,CAACO,MAAM,EAAA;AACLC,IAAAA,SAAS,EAAC,mBAAmB;AAC7BC,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.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
require('@transferwise/neptune-validation');
|
|
8
|
-
require('../provider/direction/DirectionProvider.js');
|
|
9
|
-
var useHasIntersected = require('../common/hooks/useHasIntersected/useHasIntersected.js');
|
|
10
|
-
require('../common/propsValues/breakpoint.js');
|
|
11
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var useHasIntersected = require('../common/hooks/useHasIntersected/useHasIntersected.js');
|
|
12
9
|
|
|
13
10
|
const EmptyTransparentImage = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
|
|
14
11
|
const Image = ({
|
package/build/image/Image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sources":["../../src/image/Image.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useRef } from 'react';\n\nimport { useHasIntersected } from '../common/hooks';\n\nexport interface ImageProps {\n alt: string;\n src: string;\n id?: string;\n onLoad?: () => void;\n onError?: () => void;\n className?: string;\n loading?: 'lazy' | 'eager';\n stretch?: boolean;\n role?: string;\n shrink?: boolean;\n}\n\nexport const EmptyTransparentImage =\n 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n\nconst Image = ({\n id,\n src,\n alt,\n onLoad,\n onError,\n className,\n loading,\n stretch = true,\n role,\n shrink = true,\n}: ImageProps) => {\n const elementReference = useRef<HTMLImageElement>(null);\n const [hasIntersected] = useHasIntersected({ elRef: elementReference, loading });\n let imageSource = src;\n let imageOnLoad = onLoad;\n\n if (loading === 'lazy' && !hasIntersected) {\n imageSource = EmptyTransparentImage;\n imageOnLoad = undefined;\n }\n\n return (\n <img\n ref={elementReference}\n id={id}\n alt={alt}\n src={imageSource}\n className={clsx([\n 'tw-image',\n {\n 'tw-image__stretch': stretch,\n 'tw-image__shrink': shrink,\n },\n className,\n ])}\n role={role}\n onLoad={imageOnLoad}\n onError={onError}\n />\n );\n};\n\nexport default Image;\n"],"names":["EmptyTransparentImage","Image","id","src","alt","onLoad","onError","className","loading","stretch","role","shrink","elementReference","useRef","hasIntersected","useHasIntersected","elRef","imageSource","imageOnLoad","undefined","_jsx","ref","clsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Image.js","sources":["../../src/image/Image.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useRef } from 'react';\n\nimport { useHasIntersected } from '../common/hooks';\n\nexport interface ImageProps {\n alt: string;\n src: string;\n id?: string;\n onLoad?: () => void;\n onError?: () => void;\n className?: string;\n loading?: 'lazy' | 'eager';\n stretch?: boolean;\n role?: string;\n shrink?: boolean;\n}\n\nexport const EmptyTransparentImage =\n 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n\nconst Image = ({\n id,\n src,\n alt,\n onLoad,\n onError,\n className,\n loading,\n stretch = true,\n role,\n shrink = true,\n}: ImageProps) => {\n const elementReference = useRef<HTMLImageElement>(null);\n const [hasIntersected] = useHasIntersected({ elRef: elementReference, loading });\n let imageSource = src;\n let imageOnLoad = onLoad;\n\n if (loading === 'lazy' && !hasIntersected) {\n imageSource = EmptyTransparentImage;\n imageOnLoad = undefined;\n }\n\n return (\n <img\n ref={elementReference}\n id={id}\n alt={alt}\n src={imageSource}\n className={clsx([\n 'tw-image',\n {\n 'tw-image__stretch': stretch,\n 'tw-image__shrink': shrink,\n },\n className,\n ])}\n role={role}\n onLoad={imageOnLoad}\n onError={onError}\n />\n );\n};\n\nexport default Image;\n"],"names":["EmptyTransparentImage","Image","id","src","alt","onLoad","onError","className","loading","stretch","role","shrink","elementReference","useRef","hasIntersected","useHasIntersected","elRef","imageSource","imageOnLoad","undefined","_jsx","ref","clsx"],"mappings":";;;;;;;;;AAkBO,MAAMA,qBAAqB,GAChC,6EAA4E;AAExE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
import '@transferwise/neptune-validation';
|
|
4
|
-
import '../provider/direction/DirectionProvider.mjs';
|
|
5
|
-
import { useHasIntersected } from '../common/hooks/useHasIntersected/useHasIntersected.mjs';
|
|
6
|
-
import '../common/propsValues/breakpoint.mjs';
|
|
7
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useHasIntersected } from '../common/hooks/useHasIntersected/useHasIntersected.mjs';
|
|
8
5
|
|
|
9
6
|
const EmptyTransparentImage = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
|
|
10
7
|
const Image = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.mjs","sources":["../../src/image/Image.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useRef } from 'react';\n\nimport { useHasIntersected } from '../common/hooks';\n\nexport interface ImageProps {\n alt: string;\n src: string;\n id?: string;\n onLoad?: () => void;\n onError?: () => void;\n className?: string;\n loading?: 'lazy' | 'eager';\n stretch?: boolean;\n role?: string;\n shrink?: boolean;\n}\n\nexport const EmptyTransparentImage =\n 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n\nconst Image = ({\n id,\n src,\n alt,\n onLoad,\n onError,\n className,\n loading,\n stretch = true,\n role,\n shrink = true,\n}: ImageProps) => {\n const elementReference = useRef<HTMLImageElement>(null);\n const [hasIntersected] = useHasIntersected({ elRef: elementReference, loading });\n let imageSource = src;\n let imageOnLoad = onLoad;\n\n if (loading === 'lazy' && !hasIntersected) {\n imageSource = EmptyTransparentImage;\n imageOnLoad = undefined;\n }\n\n return (\n <img\n ref={elementReference}\n id={id}\n alt={alt}\n src={imageSource}\n className={clsx([\n 'tw-image',\n {\n 'tw-image__stretch': stretch,\n 'tw-image__shrink': shrink,\n },\n className,\n ])}\n role={role}\n onLoad={imageOnLoad}\n onError={onError}\n />\n );\n};\n\nexport default Image;\n"],"names":["EmptyTransparentImage","Image","id","src","alt","onLoad","onError","className","loading","stretch","role","shrink","elementReference","useRef","hasIntersected","useHasIntersected","elRef","imageSource","imageOnLoad","undefined","_jsx","ref","clsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Image.mjs","sources":["../../src/image/Image.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useRef } from 'react';\n\nimport { useHasIntersected } from '../common/hooks';\n\nexport interface ImageProps {\n alt: string;\n src: string;\n id?: string;\n onLoad?: () => void;\n onError?: () => void;\n className?: string;\n loading?: 'lazy' | 'eager';\n stretch?: boolean;\n role?: string;\n shrink?: boolean;\n}\n\nexport const EmptyTransparentImage =\n 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n\nconst Image = ({\n id,\n src,\n alt,\n onLoad,\n onError,\n className,\n loading,\n stretch = true,\n role,\n shrink = true,\n}: ImageProps) => {\n const elementReference = useRef<HTMLImageElement>(null);\n const [hasIntersected] = useHasIntersected({ elRef: elementReference, loading });\n let imageSource = src;\n let imageOnLoad = onLoad;\n\n if (loading === 'lazy' && !hasIntersected) {\n imageSource = EmptyTransparentImage;\n imageOnLoad = undefined;\n }\n\n return (\n <img\n ref={elementReference}\n id={id}\n alt={alt}\n src={imageSource}\n className={clsx([\n 'tw-image',\n {\n 'tw-image__stretch': stretch,\n 'tw-image__shrink': shrink,\n },\n className,\n ])}\n role={role}\n onLoad={imageOnLoad}\n onError={onError}\n />\n );\n};\n\nexport default Image;\n"],"names":["EmptyTransparentImage","Image","id","src","alt","onLoad","onError","className","loading","stretch","role","shrink","elementReference","useRef","hasIntersected","useHasIntersected","elRef","imageSource","imageOnLoad","undefined","_jsx","ref","clsx"],"mappings":";;;;;AAkBO,MAAMA,qBAAqB,GAChC,6EAA4E;AAExEC,MAAAA,KAAK,GAAGA,CAAC;EACbC,EAAE;EACFC,GAAG;EACHC,GAAG;EACHC,MAAM;EACNC,OAAO;EACPC,SAAS;EACTC,OAAO;AACPC,EAAAA,OAAO,GAAG,IAAI;EACdC,IAAI;AACJC,EAAAA,MAAM,GAAG,IAAA;AAAI,CACF,KAAI;AACf,EAAA,MAAMC,gBAAgB,GAAGC,MAAM,CAAmB,IAAI,CAAC,CAAA;AACvD,EAAA,MAAM,CAACC,cAAc,CAAC,GAAGC,iBAAiB,CAAC;AAAEC,IAAAA,KAAK,EAAEJ,gBAAgB;AAAEJ,IAAAA,OAAAA;AAAO,GAAE,CAAC,CAAA;EAChF,IAAIS,WAAW,GAAGd,GAAG,CAAA;EACrB,IAAIe,WAAW,GAAGb,MAAM,CAAA;AAExB,EAAA,IAAIG,OAAO,KAAK,MAAM,IAAI,CAACM,cAAc,EAAE;AACzCG,IAAAA,WAAW,GAAGjB,qBAAqB,CAAA;AACnCkB,IAAAA,WAAW,GAAGC,SAAS,CAAA;AACzB,GAAA;AAEA,EAAA,oBACEC,GAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,GAAG,EAAET,gBAAiB;AACtBV,IAAAA,EAAE,EAAEA,EAAG;AACPE,IAAAA,GAAG,EAAEA,GAAI;AACTD,IAAAA,GAAG,EAAEc,WAAY;AACjBV,IAAAA,SAAS,EAAEe,IAAI,CAAC,CACd,UAAU,EACV;AACE,MAAA,mBAAmB,EAAEb,OAAO;AAC5B,MAAA,kBAAkB,EAAEE,MAAAA;KACrB,EACDJ,SAAS,CACV,CAAE;AACHG,IAAAA,IAAI,EAAEA,IAAK;AACXL,IAAAA,MAAM,EAAEa,WAAY;AACpBZ,IAAAA,OAAO,EAAEA,OAAAA;AAAQ,GACjB,CAAA,CAAA;AAEN;;;;"}
|
package/build/index.js
CHANGED
|
@@ -75,7 +75,6 @@ var Provider = require('./provider/Provider.js');
|
|
|
75
75
|
var Radio = require('./radio/Radio.js');
|
|
76
76
|
var RadioGroup = require('./radioGroup/RadioGroup.js');
|
|
77
77
|
var RadioOption = require('./radioOption/RadioOption.js');
|
|
78
|
-
var ResponsivePanel = require('./common/responsivePanel/ResponsivePanel.js');
|
|
79
78
|
var Section = require('./section/Section.js');
|
|
80
79
|
var SegmentedControl = require('./segmentedControl/SegmentedControl.js');
|
|
81
80
|
var Select = require('./select/Select.js');
|
|
@@ -96,41 +95,35 @@ var Tooltip = require('./tooltip/Tooltip.js');
|
|
|
96
95
|
var Typeahead = require('./typeahead/Typeahead.js');
|
|
97
96
|
var Upload = require('./upload/Upload.js');
|
|
98
97
|
var UploadInput = require('./uploadInput/UploadInput.js');
|
|
99
|
-
require('@transferwise/neptune-validation');
|
|
100
|
-
require('react');
|
|
101
|
-
var useDirection = require('./common/hooks/useDirection/useDirection.js');
|
|
102
|
-
var useLayout = require('./common/hooks/useLayout/useLayout.js');
|
|
103
98
|
var useScreenSize = require('./common/hooks/useScreenSize.js');
|
|
104
99
|
var useSnackbar = require('./snackbar/useSnackbar.js');
|
|
105
|
-
var
|
|
106
|
-
var
|
|
107
|
-
var
|
|
108
|
-
var
|
|
100
|
+
var index$1 = require('./i18n/index.js');
|
|
101
|
+
var withId = require('./withId/withId.js');
|
|
102
|
+
var CheckboxButton = require('./checkboxButton/CheckboxButton.js');
|
|
103
|
+
var ResponsivePanel = require('./common/responsivePanel/ResponsivePanel.js');
|
|
104
|
+
var useDirection = require('./common/hooks/useDirection/useDirection.js');
|
|
105
|
+
var useLayout = require('./common/hooks/useLayout/useLayout.js');
|
|
109
106
|
var breakpoint = require('./common/propsValues/breakpoint.js');
|
|
110
|
-
var
|
|
111
|
-
var typography = require('./common/propsValues/typography.js');
|
|
112
|
-
var width = require('./common/propsValues/width.js');
|
|
113
|
-
var type = require('./common/propsValues/type.js');
|
|
107
|
+
var control = require('./common/propsValues/control.js');
|
|
114
108
|
var dateMode = require('./common/propsValues/dateMode.js');
|
|
109
|
+
var direction = require('./common/direction.js');
|
|
110
|
+
var fileType = require('./common/fileType.js');
|
|
111
|
+
var layouts = require('./common/propsValues/layouts.js');
|
|
112
|
+
var markdownNodeType = require('./common/propsValues/markdownNodeType.js');
|
|
115
113
|
var monthFormat = require('./common/propsValues/monthFormat.js');
|
|
116
114
|
var position = require('./common/propsValues/position.js');
|
|
117
|
-
var layouts = require('./common/propsValues/layouts.js');
|
|
118
|
-
var status = require('./common/propsValues/status.js');
|
|
119
|
-
var sentiment = require('./common/propsValues/sentiment.js');
|
|
120
115
|
var profileType = require('./common/propsValues/profileType.js');
|
|
121
|
-
var variant = require('./common/propsValues/variant.js');
|
|
122
116
|
var scroll = require('./common/propsValues/scroll.js');
|
|
123
|
-
var
|
|
124
|
-
var
|
|
117
|
+
var sentiment = require('./common/propsValues/sentiment.js');
|
|
118
|
+
var size = require('./common/propsValues/size.js');
|
|
119
|
+
var status = require('./common/propsValues/status.js');
|
|
120
|
+
var theme = require('./common/theme.js');
|
|
121
|
+
var type = require('./common/propsValues/type.js');
|
|
122
|
+
var typography = require('./common/propsValues/typography.js');
|
|
123
|
+
var variant = require('./common/propsValues/variant.js');
|
|
124
|
+
var width = require('./common/propsValues/width.js');
|
|
125
125
|
var index = require('./common/locale/index.js');
|
|
126
|
-
require('
|
|
127
|
-
require('clsx');
|
|
128
|
-
require('react-intl');
|
|
129
|
-
require('./common/closeButton/CloseButton.messages.js');
|
|
130
|
-
require('react/jsx-runtime');
|
|
131
|
-
var index$1 = require('./i18n/index.js');
|
|
132
|
-
var withId = require('./withId/withId.js');
|
|
133
|
-
var CheckboxButton = require('./checkboxButton/CheckboxButton.js');
|
|
126
|
+
var documentIosClick = require('./common/domHelpers/documentIosClick.js');
|
|
134
127
|
|
|
135
128
|
|
|
136
129
|
|
|
@@ -232,7 +225,6 @@ exports.Provider = Provider;
|
|
|
232
225
|
exports.Radio = Radio;
|
|
233
226
|
exports.RadioGroup = RadioGroup;
|
|
234
227
|
exports.RadioOption = RadioOption;
|
|
235
|
-
exports.ResponsivePanel = ResponsivePanel;
|
|
236
228
|
exports.Section = Section;
|
|
237
229
|
exports.SegmentedControl = SegmentedControl;
|
|
238
230
|
exports.Select = Select;
|
|
@@ -258,19 +250,17 @@ Object.defineProperty(exports, "UploadStep", {
|
|
|
258
250
|
get: function () { return Upload.UploadStep; }
|
|
259
251
|
});
|
|
260
252
|
exports.UploadInput = UploadInput;
|
|
261
|
-
exports.useDirection = useDirection.useDirection;
|
|
262
|
-
exports.useLayout = useLayout.useLayout;
|
|
263
253
|
exports.useScreenSize = useScreenSize.useScreenSize;
|
|
264
254
|
exports.useSnackbar = useSnackbar;
|
|
265
|
-
exports.
|
|
266
|
-
exports.
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
Object.defineProperty(exports, "
|
|
255
|
+
exports.translations = index$1;
|
|
256
|
+
exports.withId = withId;
|
|
257
|
+
exports.CheckboxButton = CheckboxButton;
|
|
258
|
+
exports.ResponsivePanel = ResponsivePanel;
|
|
259
|
+
exports.useDirection = useDirection.useDirection;
|
|
260
|
+
exports.useLayout = useLayout.useLayout;
|
|
261
|
+
Object.defineProperty(exports, "Breakpoint", {
|
|
272
262
|
enumerable: true,
|
|
273
|
-
get: function () { return
|
|
263
|
+
get: function () { return breakpoint.Breakpoint; }
|
|
274
264
|
});
|
|
275
265
|
Object.defineProperty(exports, "ControlType", {
|
|
276
266
|
enumerable: true,
|
|
@@ -280,29 +270,25 @@ Object.defineProperty(exports, "Priority", {
|
|
|
280
270
|
enumerable: true,
|
|
281
271
|
get: function () { return control.Priority; }
|
|
282
272
|
});
|
|
283
|
-
Object.defineProperty(exports, "
|
|
284
|
-
enumerable: true,
|
|
285
|
-
get: function () { return breakpoint.Breakpoint; }
|
|
286
|
-
});
|
|
287
|
-
Object.defineProperty(exports, "Size", {
|
|
273
|
+
Object.defineProperty(exports, "DateMode", {
|
|
288
274
|
enumerable: true,
|
|
289
|
-
get: function () { return
|
|
275
|
+
get: function () { return dateMode.DateMode; }
|
|
290
276
|
});
|
|
291
|
-
Object.defineProperty(exports, "
|
|
277
|
+
Object.defineProperty(exports, "Direction", {
|
|
292
278
|
enumerable: true,
|
|
293
|
-
get: function () { return
|
|
279
|
+
get: function () { return direction.Direction; }
|
|
294
280
|
});
|
|
295
|
-
Object.defineProperty(exports, "
|
|
281
|
+
Object.defineProperty(exports, "FileType", {
|
|
296
282
|
enumerable: true,
|
|
297
|
-
get: function () { return
|
|
283
|
+
get: function () { return fileType.FileType; }
|
|
298
284
|
});
|
|
299
|
-
Object.defineProperty(exports, "
|
|
285
|
+
Object.defineProperty(exports, "Layout", {
|
|
300
286
|
enumerable: true,
|
|
301
|
-
get: function () { return
|
|
287
|
+
get: function () { return layouts.Layout; }
|
|
302
288
|
});
|
|
303
|
-
Object.defineProperty(exports, "
|
|
289
|
+
Object.defineProperty(exports, "MarkdownNodeType", {
|
|
304
290
|
enumerable: true,
|
|
305
|
-
get: function () { return
|
|
291
|
+
get: function () { return markdownNodeType.MarkdownNodeType; }
|
|
306
292
|
});
|
|
307
293
|
Object.defineProperty(exports, "MonthFormat", {
|
|
308
294
|
enumerable: true,
|
|
@@ -312,37 +298,45 @@ Object.defineProperty(exports, "Position", {
|
|
|
312
298
|
enumerable: true,
|
|
313
299
|
get: function () { return position.Position; }
|
|
314
300
|
});
|
|
315
|
-
Object.defineProperty(exports, "
|
|
301
|
+
Object.defineProperty(exports, "ProfileType", {
|
|
316
302
|
enumerable: true,
|
|
317
|
-
get: function () { return
|
|
303
|
+
get: function () { return profileType.ProfileType; }
|
|
318
304
|
});
|
|
319
|
-
Object.defineProperty(exports, "
|
|
305
|
+
Object.defineProperty(exports, "Scroll", {
|
|
320
306
|
enumerable: true,
|
|
321
|
-
get: function () { return
|
|
307
|
+
get: function () { return scroll.Scroll; }
|
|
322
308
|
});
|
|
323
309
|
Object.defineProperty(exports, "Sentiment", {
|
|
324
310
|
enumerable: true,
|
|
325
311
|
get: function () { return sentiment.Sentiment; }
|
|
326
312
|
});
|
|
327
|
-
Object.defineProperty(exports, "
|
|
313
|
+
Object.defineProperty(exports, "Size", {
|
|
328
314
|
enumerable: true,
|
|
329
|
-
get: function () { return
|
|
315
|
+
get: function () { return size.Size; }
|
|
330
316
|
});
|
|
331
|
-
Object.defineProperty(exports, "
|
|
317
|
+
Object.defineProperty(exports, "Status", {
|
|
332
318
|
enumerable: true,
|
|
333
|
-
get: function () { return
|
|
319
|
+
get: function () { return status.Status; }
|
|
334
320
|
});
|
|
335
|
-
Object.defineProperty(exports, "
|
|
321
|
+
Object.defineProperty(exports, "Theme", {
|
|
336
322
|
enumerable: true,
|
|
337
|
-
get: function () { return
|
|
323
|
+
get: function () { return theme.Theme; }
|
|
338
324
|
});
|
|
339
|
-
Object.defineProperty(exports, "
|
|
325
|
+
Object.defineProperty(exports, "Type", {
|
|
340
326
|
enumerable: true,
|
|
341
|
-
get: function () { return
|
|
327
|
+
get: function () { return type.Type; }
|
|
342
328
|
});
|
|
343
|
-
Object.defineProperty(exports, "
|
|
329
|
+
Object.defineProperty(exports, "Typography", {
|
|
344
330
|
enumerable: true,
|
|
345
|
-
get: function () { return
|
|
331
|
+
get: function () { return typography.Typography; }
|
|
332
|
+
});
|
|
333
|
+
Object.defineProperty(exports, "Variant", {
|
|
334
|
+
enumerable: true,
|
|
335
|
+
get: function () { return variant.Variant; }
|
|
336
|
+
});
|
|
337
|
+
Object.defineProperty(exports, "Width", {
|
|
338
|
+
enumerable: true,
|
|
339
|
+
get: function () { return width.Width; }
|
|
346
340
|
});
|
|
347
341
|
exports.DEFAULT_LANG = index.DEFAULT_LANG;
|
|
348
342
|
exports.DEFAULT_LOCALE = index.DEFAULT_LOCALE;
|
|
@@ -352,7 +346,6 @@ exports.adjustLocale = index.adjustLocale;
|
|
|
352
346
|
exports.getCountryFromLocale = index.getCountryFromLocale;
|
|
353
347
|
exports.getDirectionFromLocale = index.getDirectionFromLocale;
|
|
354
348
|
exports.getLangFromLocale = index.getLangFromLocale;
|
|
355
|
-
exports.
|
|
356
|
-
exports.
|
|
357
|
-
exports.CheckboxButton = CheckboxButton;
|
|
349
|
+
exports.isBrowser = documentIosClick.isBrowser;
|
|
350
|
+
exports.isServerSide = documentIosClick.isServerSide;
|
|
358
351
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|