@transferwise/components 46.97.5 → 46.98.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/build/alert/Alert.js +8 -0
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +8 -0
- package/build/alert/Alert.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.js +3 -1
- package/build/common/closeButton/CloseButton.js.map +1 -1
- package/build/common/closeButton/CloseButton.mjs +3 -1
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/i18n/cs.json +3 -0
- package/build/i18n/cs.json.js +3 -0
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +3 -0
- package/build/i18n/cs.json.mjs.map +1 -1
- package/build/i18n/de.json +3 -0
- package/build/i18n/de.json.js +3 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +3 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/en.json +3 -0
- package/build/i18n/en.json.js +3 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +3 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/i18n/es.json +3 -0
- package/build/i18n/es.json.js +3 -0
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +3 -0
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/fr.json +3 -0
- package/build/i18n/fr.json.js +3 -0
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +3 -0
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +3 -0
- package/build/i18n/hu.json.js +3 -0
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +3 -0
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/id.json +3 -0
- package/build/i18n/id.json.js +3 -0
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +3 -0
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/it.json +3 -0
- package/build/i18n/it.json.js +3 -0
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +3 -0
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +3 -0
- package/build/i18n/ja.json.js +3 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +3 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/nl.json +6 -3
- package/build/i18n/pl.json +3 -0
- package/build/i18n/pl.json.js +3 -0
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +3 -0
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +3 -0
- package/build/i18n/pt.json.js +3 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +3 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +3 -0
- package/build/i18n/ro.json.js +3 -0
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +3 -0
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +3 -0
- package/build/i18n/ru.json.js +3 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +3 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/th.json +3 -0
- package/build/i18n/th.json.js +3 -0
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +3 -0
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/i18n/tr.json +3 -0
- package/build/i18n/tr.json.js +3 -0
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +3 -0
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +3 -0
- package/build/i18n/zh-CN.json.js +3 -0
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +3 -0
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +3 -0
- package/build/i18n/zh-HK.json.js +3 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +3 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/image/Image.js +9 -10
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs +11 -11
- package/build/image/Image.mjs.map +1 -1
- package/build/main.css +5 -2
- package/build/moneyInput/MoneyInput.js +2 -6
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.js +3 -0
- package/build/moneyInput/MoneyInput.messages.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.mjs +3 -0
- package/build/moneyInput/MoneyInput.messages.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +2 -6
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +36 -2
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.js +6 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs +6 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +36 -2
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -0
- package/build/styles/dateInput/DateInput.css +2 -1
- package/build/styles/main.css +5 -2
- package/build/styles/uploadInput/uploadItem/UploadItem.css +2 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts +2 -0
- package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
- package/build/types/image/Image.d.ts +0 -1
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.messages.d.ts +5 -0
- package/build/types/moneyInput/MoneyInput.messages.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts +8 -0
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +6 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts +1 -2
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/upload/steps/processingStep/processingStep.d.ts +1 -3
- package/build/types/upload/steps/processingStep/processingStep.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/upload/Upload.js +27 -43
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +27 -43
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -3
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -3
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +55 -6
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +55 -6
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +12 -6
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +12 -6
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +3 -2
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +3 -2
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +6 -9
- package/src/alert/Alert.spec.tsx +11 -0
- package/src/alert/Alert.story.tsx +23 -9
- package/src/alert/Alert.tsx +14 -1
- package/src/circularButton/CircularButton.css +1 -0
- package/src/circularButton/CircularButton.less +1 -0
- package/src/circularButton/CircularButton.tests.story.tsx +23 -0
- package/src/common/closeButton/CloseButton.spec.tsx +13 -1
- package/src/common/closeButton/CloseButton.tsx +3 -0
- package/src/dateInput/DateInput.css +2 -1
- package/src/dateInput/DateInput.less +7 -4
- package/src/i18n/cs.json +3 -0
- package/src/i18n/de.json +3 -0
- package/src/i18n/en.json +3 -0
- package/src/i18n/es.json +3 -0
- package/src/i18n/fr.json +3 -0
- package/src/i18n/hu.json +3 -0
- package/src/i18n/id.json +3 -0
- package/src/i18n/it.json +3 -0
- package/src/i18n/ja.json +3 -0
- package/src/i18n/nl.json +6 -3
- package/src/i18n/pl.json +3 -0
- package/src/i18n/pt.json +3 -0
- package/src/i18n/ro.json +3 -0
- package/src/i18n/ru.json +3 -0
- package/src/i18n/th.json +3 -0
- package/src/i18n/tr.json +3 -0
- package/src/i18n/zh-CN.json +3 -0
- package/src/i18n/zh-HK.json +3 -0
- package/src/image/Image.spec.tsx +3 -3
- package/src/image/Image.tsx +10 -12
- package/src/main.css +5 -2
- package/src/moneyInput/MoneyInput.messages.ts +5 -0
- package/src/moneyInput/MoneyInput.spec.tsx +42 -5
- package/src/moneyInput/MoneyInput.story.tsx +11 -2
- package/src/moneyInput/MoneyInput.tsx +5 -7
- package/src/phoneNumberInput/PhoneNumberInput.messages.ts +8 -0
- package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +77 -43
- package/src/phoneNumberInput/PhoneNumberInput.tsx +34 -2
- package/src/promoCard/__snapshots__/PromoCard.spec.tsx.snap +1 -0
- package/src/promoCard/__snapshots__/PromoCardGroup.spec.tsx.snap +2 -0
- package/src/test-utils/jest.setup.ts +0 -4
- package/src/typeahead/Typeahead.spec.tsx +182 -0
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.tsx +103 -0
- package/src/typeahead/util/highlight.spec.tsx +43 -0
- package/src/upload/Upload.spec.tsx +63 -0
- package/src/upload/Upload.story.tsx +0 -51
- package/src/upload/Upload.tests.story.tsx +93 -0
- package/src/upload/Upload.tsx +28 -49
- package/src/upload/steps/processingStep/processingStep.tsx +2 -7
- package/src/uploadInput/UploadInput.tsx +81 -8
- package/src/uploadInput/uploadItem/UploadItem.css +2 -1
- package/src/uploadInput/uploadItem/UploadItem.less +1 -1
- package/src/uploadInput/uploadItem/UploadItem.tsx +11 -6
- package/src/withDisplayFormat/WithDisplayFormat.spec.js +11 -15
- package/src/withDisplayFormat/WithDisplayFormat.tsx +3 -2
- package/src/typeahead/Typeahead.rtl.spec.tsx +0 -54
- package/src/typeahead/Typeahead.spec.js +0 -404
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.js +0 -74
- package/src/typeahead/typeaheadOption/TypeaheadOption.spec.js +0 -75
- package/src/typeahead/util/highlight.spec.js +0 -34
package/build/alert/Alert.js
CHANGED
|
@@ -103,6 +103,11 @@ function Alert({
|
|
|
103
103
|
}, constants.WDS_LIVE_REGION_DELAY_MS);
|
|
104
104
|
}, []);
|
|
105
105
|
const closeButtonReference = React.useRef(null);
|
|
106
|
+
/**
|
|
107
|
+
* All focusable elements must be disabled until we announce the alert.
|
|
108
|
+
* @see https://dequeuniversity.com/rules/axe/4.10/aria-hidden-focus?application=axeAPI
|
|
109
|
+
*/
|
|
110
|
+
const accessibleTabIndex = shouldAnnounce ? undefined : -1;
|
|
106
111
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
107
112
|
role: resolvedType === sentiment.Sentiment.NEGATIVE ? 'alert' : 'status',
|
|
108
113
|
className: "wds-alert__liveRegion",
|
|
@@ -154,6 +159,7 @@ function Alert({
|
|
|
154
159
|
target: action.target,
|
|
155
160
|
type: typography.Typography.LINK_LARGE,
|
|
156
161
|
className: "alert__action",
|
|
162
|
+
tabIndex: accessibleTabIndex,
|
|
157
163
|
onClick: action.onClick,
|
|
158
164
|
children: action.text
|
|
159
165
|
}) : /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
|
|
@@ -163,6 +169,7 @@ function Alert({
|
|
|
163
169
|
"aria-label": action['aria-label'],
|
|
164
170
|
priority: "secondary-neutral",
|
|
165
171
|
className: "alert__action",
|
|
172
|
+
tabIndex: accessibleTabIndex,
|
|
166
173
|
onClick: action.onClick,
|
|
167
174
|
children: action.text
|
|
168
175
|
}))]
|
|
@@ -172,6 +179,7 @@ function Alert({
|
|
|
172
179
|
children: /*#__PURE__*/jsxRuntime.jsx(CloseButton.CloseButton, {
|
|
173
180
|
ref: closeButtonReference,
|
|
174
181
|
size: "xs",
|
|
182
|
+
tabIndex: accessibleTabIndex,
|
|
175
183
|
onClick: onDismiss
|
|
176
184
|
})
|
|
177
185
|
})]
|
package/build/alert/Alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useState, useRef, useEffect } from 'react';\n\nimport Body from '../body/Body';\nimport {\n CloseButton,\n Sentiment,\n Size,\n Status,\n Typography,\n WDS_LIVE_REGION_DELAY_MS,\n} from '../common';\n\nimport StatusIcon from '../statusIcon';\nimport Title from '../title/Title';\nimport { logActionRequired } from '../utilities';\n\nimport InlineMarkdown from './inlineMarkdown';\nimport Button from '../button';\nimport Link from '../link';\n\nexport type AlertAction = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype AlertTypeDeprecated = `${Sentiment.SUCCESS | Sentiment.INFO | Sentiment.ERROR}`;\ntype AlertTypeResolved = `${\n | Sentiment.POSITIVE\n | Sentiment.NEUTRAL\n | Sentiment.WARNING\n | Sentiment.NEGATIVE\n // remove when all instances of Sentiment.PENDING have been updated to Status.PENDING\n | Sentiment.PENDING\n | Status.PENDING}`;\nexport type AlertType = AlertTypeResolved | AlertTypeDeprecated;\n\nexport enum AlertArrowPosition {\n TOP_LEFT = 'up-left',\n TOP = 'up-center',\n TOP_RIGHT = 'up-right',\n BOTTOM_LEFT = 'down-left',\n BOTTOM = 'down-center',\n BOTTOM_RIGHT = 'down-right',\n}\n\nexport interface AlertProps {\n /** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */\n action?: AlertAction;\n className?: string;\n /** An optional icon. If not provided, we will default the icon to something appropriate for the type */\n icon?: React.ReactNode;\n /**\n * Override for [StatusIcon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n statusIconLabel?: string;\n /** Title for the alert component */\n title?: string;\n /** The main body of the alert. Accepts plain text and bold words specified with **double stars */\n message?: string;\n /** The presence of the onDismiss handler will trigger the visibility of the close button */\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n /** The type dictates which icon and colour will be used */\n type?: AlertType;\n /** @deprecated Use `InlineAlert` instead. */\n arrow?: `${AlertArrowPosition}`;\n /** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */\n children?: React.ReactNode;\n /** @deprecated Use `onDismiss` instead. */\n dismissible?: boolean;\n /** @deprecated Alert component doesn't support `size` anymore, please remove this prop. */\n size?: `${Size}`;\n}\n\nfunction resolveType(type: AlertType): AlertTypeResolved {\n switch (type) {\n case 'success':\n return 'positive';\n case 'info':\n return 'neutral';\n case 'error':\n return 'negative';\n default:\n return type;\n }\n}\n\nexport default function Alert({\n action,\n className,\n icon,\n statusIconLabel,\n onDismiss,\n message,\n title,\n type = 'neutral',\n arrow,\n children,\n size,\n dismissible,\n}: AlertProps) {\n useEffect(() => {\n if (arrow !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'arrow' anymore, use 'InlineAlert' instead.\",\n );\n }\n }, [arrow]);\n\n useEffect(() => {\n if (children !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'children' anymore, use 'message' instead.\",\n );\n }\n }, [children]);\n\n useEffect(() => {\n if (dismissible !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'dismissible' anymore, use 'onDismiss' instead.\",\n );\n }\n }, [dismissible]);\n\n useEffect(() => {\n if (size !== undefined) {\n logActionRequired(\"Alert component doesn't support 'size' anymore, please remove that prop.\");\n }\n }, [size]);\n\n const resolvedType = resolveType(type);\n useEffect(() => {\n if (resolvedType !== type) {\n logActionRequired(\n `Alert component has deprecated '${type}' value for the 'type' prop. Please use '${resolvedType}' instead.`,\n );\n }\n }, [resolvedType, type]);\n\n const [shouldFire, setShouldFire] = useState<boolean>();\n\n const [shouldAnnounce, setShouldAnnounce] = useState<boolean>(false);\n useEffect(() => {\n setTimeout(() => {\n setShouldAnnounce(true);\n }, WDS_LIVE_REGION_DELAY_MS);\n }, []);\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n\n return (\n <div\n role={resolvedType === Sentiment.NEGATIVE ? 'alert' : 'status'}\n className=\"wds-alert__liveRegion\"\n >\n <div\n aria-hidden={shouldAnnounce ? undefined : 'true'}\n className={clsx(\n 'alert d-flex',\n `alert-${resolvedType}`,\n arrow != null && alertArrowClassNames(arrow),\n className,\n )}\n data-testid=\"alert\"\n onTouchStart={() => setShouldFire(true)}\n onTouchEnd={(event) => {\n if (\n shouldFire &&\n action?.href &&\n // Check if current event is triggered from closeButton\n event.target instanceof Node &&\n closeButtonReference.current &&\n !closeButtonReference.current.contains(event.target)\n ) {\n if (action.target === '_blank') {\n window.top?.open(action.href);\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n }}\n onTouchMove={() => setShouldFire(false)}\n >\n <div className=\"alert__icon\">\n {icon || <StatusIcon size={32} sentiment={resolvedType} iconLabel={statusIconLabel} />}\n </div>\n <div className={clsx('alert__content', 'd-flex', 'flex-grow-1')}>\n <div className=\"alert__message\">\n <div>\n {title && (\n <Title className=\"m-b-1\" type={Typography.TITLE_BODY}>\n {title}\n </Title>\n )}\n <Body as=\"span\" className=\"d-block\" type={Typography.BODY_LARGE}>\n {children || <InlineMarkdown>{message}</InlineMarkdown>}\n </Body>\n </div>\n {action &&\n ('href' in action ? (\n <Link\n href={action.href}\n aria-label={action['aria-label']}\n target={action.target}\n type={Typography.LINK_LARGE}\n className=\"alert__action\"\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n ) : (\n <Button\n v2\n size=\"sm\"\n sentiment=\"default\"\n aria-label={action['aria-label']}\n priority=\"secondary-neutral\"\n className=\"alert__action\"\n onClick={action.onClick}\n >\n {action.text}\n </Button>\n ))}\n </div>\n </div>\n {onDismiss && (\n <div className=\"alert__close\">\n <CloseButton ref={closeButtonReference} size=\"xs\" onClick={onDismiss} />\n </div>\n )}\n </div>\n </div>\n );\n}\n\nfunction alertArrowClassNames(arrow: `${AlertArrowPosition}`) {\n switch (arrow) {\n case 'down-center':\n return 'arrow arrow-bottom arrow-center';\n case 'down-left':\n return 'arrow arrow-bottom arrow-left';\n case 'down-right':\n return 'arrow arrow-bottom arrow-right';\n case 'up-center':\n return 'arrow arrow-center';\n case 'up-right':\n return 'arrow arrow-right';\n case 'up-left':\n default:\n return 'arrow';\n }\n}\n"],"names":["AlertArrowPosition","resolveType","type","Alert","action","className","icon","statusIconLabel","onDismiss","message","title","arrow","children","size","dismissible","useEffect","undefined","logActionRequired","resolvedType","shouldFire","setShouldFire","useState","shouldAnnounce","setShouldAnnounce","setTimeout","WDS_LIVE_REGION_DELAY_MS","closeButtonReference","useRef","_jsx","role","Sentiment","NEGATIVE","_jsxs","clsx","alertArrowClassNames","onTouchStart","onTouchEnd","event","href","target","Node","current","contains","window","top","open","location","assign","onTouchMove","StatusIcon","sentiment","iconLabel","Title","Typography","TITLE_BODY","Body","as","BODY_LARGE","InlineMarkdown","Link","LINK_LARGE","onClick","text","Button","v2","priority","CloseButton","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCYA;AAAZ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AM,CAAC0D;AAAI,WACN,CACT,CAAC;SACD;AACP,OAAK,CACL,EAACtD,SAAS,iBACRoB,cAAA,CAAA,KAAA,EAAA;AAAKvB,QAAAA,SAAS,EAAC,cAAc;QAAAO,QAAA,eAC3BgB,cAAA,CAACsC,uBAAW,EAAA;AAACC,UAAAA,GAAG,EAAEzC,oBAAqB;AAACb,UAAAA,IAAI,EAAC,IAAI;AAACgD,UAAAA,OAAO,EAAErD;SAC7D;AAAA,OAAK,CACN;KACE;AACP,GAAK,CAAC;AAEV;AAEA,SAAS0B,oBAAoBA,CAACvB,KAA8B,EAAA;AAC1D,EAAA,QAAQA,KAAK;AACX,IAAA,KAAK,aAAa;AAChB,MAAA,OAAO,iCAAiC;AAC1C,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,+BAA+B;AACxC,IAAA,KAAK,YAAY;AACf,MAAA,OAAO,gCAAgC;AACzC,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,oBAAoB;AAC7B,IAAA,KAAK,UAAU;AACb,MAAA,OAAO,mBAAmB;AAC5B,IAAA,KAAK,SAAS;AACd,IAAA;AACE,MAAA,OAAO,OAAO;AAClB;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useState, useRef, useEffect } from 'react';\n\nimport Body from '../body/Body';\nimport {\n CloseButton,\n Sentiment,\n Size,\n Status,\n Typography,\n WDS_LIVE_REGION_DELAY_MS,\n} from '../common';\n\nimport StatusIcon from '../statusIcon';\nimport Title from '../title/Title';\nimport { logActionRequired } from '../utilities';\n\nimport InlineMarkdown from './inlineMarkdown';\nimport Button from '../button';\nimport Link from '../link';\n\nexport type AlertAction = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype AlertTypeDeprecated = `${Sentiment.SUCCESS | Sentiment.INFO | Sentiment.ERROR}`;\ntype AlertTypeResolved = `${\n | Sentiment.POSITIVE\n | Sentiment.NEUTRAL\n | Sentiment.WARNING\n | Sentiment.NEGATIVE\n // remove when all instances of Sentiment.PENDING have been updated to Status.PENDING\n | Sentiment.PENDING\n | Status.PENDING}`;\nexport type AlertType = AlertTypeResolved | AlertTypeDeprecated;\n\nexport enum AlertArrowPosition {\n TOP_LEFT = 'up-left',\n TOP = 'up-center',\n TOP_RIGHT = 'up-right',\n BOTTOM_LEFT = 'down-left',\n BOTTOM = 'down-center',\n BOTTOM_RIGHT = 'down-right',\n}\n\nexport interface AlertProps {\n /** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */\n action?: AlertAction;\n className?: string;\n /** An optional icon. If not provided, we will default the icon to something appropriate for the type */\n icon?: React.ReactNode;\n /**\n * Override for [StatusIcon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n statusIconLabel?: string;\n /** Title for the alert component */\n title?: string;\n /** The main body of the alert. Accepts plain text and bold words specified with **double stars */\n message?: string;\n /** The presence of the onDismiss handler will trigger the visibility of the close button */\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n /** The type dictates which icon and colour will be used */\n type?: AlertType;\n /** @deprecated Use `InlineAlert` instead. */\n arrow?: `${AlertArrowPosition}`;\n /** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */\n children?: React.ReactNode;\n /** @deprecated Use `onDismiss` instead. */\n dismissible?: boolean;\n /** @deprecated Alert component doesn't support `size` anymore, please remove this prop. */\n size?: `${Size}`;\n}\n\nfunction resolveType(type: AlertType): AlertTypeResolved {\n switch (type) {\n case 'success':\n return 'positive';\n case 'info':\n return 'neutral';\n case 'error':\n return 'negative';\n default:\n return type;\n }\n}\n\nexport default function Alert({\n action,\n className,\n icon,\n statusIconLabel,\n onDismiss,\n message,\n title,\n type = 'neutral',\n arrow,\n children,\n size,\n dismissible,\n}: AlertProps) {\n useEffect(() => {\n if (arrow !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'arrow' anymore, use 'InlineAlert' instead.\",\n );\n }\n }, [arrow]);\n\n useEffect(() => {\n if (children !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'children' anymore, use 'message' instead.\",\n );\n }\n }, [children]);\n\n useEffect(() => {\n if (dismissible !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'dismissible' anymore, use 'onDismiss' instead.\",\n );\n }\n }, [dismissible]);\n\n useEffect(() => {\n if (size !== undefined) {\n logActionRequired(\"Alert component doesn't support 'size' anymore, please remove that prop.\");\n }\n }, [size]);\n\n const resolvedType = resolveType(type);\n useEffect(() => {\n if (resolvedType !== type) {\n logActionRequired(\n `Alert component has deprecated '${type}' value for the 'type' prop. Please use '${resolvedType}' instead.`,\n );\n }\n }, [resolvedType, type]);\n\n const [shouldFire, setShouldFire] = useState<boolean>();\n\n const [shouldAnnounce, setShouldAnnounce] = useState<boolean>(false);\n useEffect(() => {\n setTimeout(() => {\n setShouldAnnounce(true);\n }, WDS_LIVE_REGION_DELAY_MS);\n }, []);\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n\n /**\n * All focusable elements must be disabled until we announce the alert.\n * @see https://dequeuniversity.com/rules/axe/4.10/aria-hidden-focus?application=axeAPI\n */\n const accessibleTabIndex = shouldAnnounce ? undefined : -1;\n\n return (\n <div\n role={resolvedType === Sentiment.NEGATIVE ? 'alert' : 'status'}\n className=\"wds-alert__liveRegion\"\n >\n <div\n aria-hidden={shouldAnnounce ? undefined : 'true'}\n className={clsx(\n 'alert d-flex',\n `alert-${resolvedType}`,\n arrow != null && alertArrowClassNames(arrow),\n className,\n )}\n data-testid=\"alert\"\n onTouchStart={() => setShouldFire(true)}\n onTouchEnd={(event) => {\n if (\n shouldFire &&\n action?.href &&\n // Check if current event is triggered from closeButton\n event.target instanceof Node &&\n closeButtonReference.current &&\n !closeButtonReference.current.contains(event.target)\n ) {\n if (action.target === '_blank') {\n window.top?.open(action.href);\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n }}\n onTouchMove={() => setShouldFire(false)}\n >\n <div className=\"alert__icon\">\n {icon || <StatusIcon size={32} sentiment={resolvedType} iconLabel={statusIconLabel} />}\n </div>\n <div className={clsx('alert__content', 'd-flex', 'flex-grow-1')}>\n <div className=\"alert__message\">\n <div>\n {title && (\n <Title className=\"m-b-1\" type={Typography.TITLE_BODY}>\n {title}\n </Title>\n )}\n <Body as=\"span\" className=\"d-block\" type={Typography.BODY_LARGE}>\n {children || <InlineMarkdown>{message}</InlineMarkdown>}\n </Body>\n </div>\n {action &&\n ('href' in action ? (\n <Link\n href={action.href}\n aria-label={action['aria-label']}\n target={action.target}\n type={Typography.LINK_LARGE}\n className=\"alert__action\"\n tabIndex={accessibleTabIndex}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n ) : (\n <Button\n v2\n size=\"sm\"\n sentiment=\"default\"\n aria-label={action['aria-label']}\n priority=\"secondary-neutral\"\n className=\"alert__action\"\n tabIndex={accessibleTabIndex}\n onClick={action.onClick}\n >\n {action.text}\n </Button>\n ))}\n </div>\n </div>\n {onDismiss && (\n <div className=\"alert__close\">\n <CloseButton\n ref={closeButtonReference}\n size=\"xs\"\n tabIndex={accessibleTabIndex}\n onClick={onDismiss}\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n\nfunction alertArrowClassNames(arrow: `${AlertArrowPosition}`) {\n switch (arrow) {\n case 'down-center':\n return 'arrow arrow-bottom arrow-center';\n case 'down-left':\n return 'arrow arrow-bottom arrow-left';\n case 'down-right':\n return 'arrow arrow-bottom arrow-right';\n case 'up-center':\n return 'arrow arrow-center';\n case 'up-right':\n return 'arrow arrow-right';\n case 'up-left':\n default:\n return 'arrow';\n }\n}\n"],"names":["AlertArrowPosition","resolveType","type","Alert","action","className","icon","statusIconLabel","onDismiss","message","title","arrow","children","size","dismissible","useEffect","undefined","logActionRequired","resolvedType","shouldFire","setShouldFire","useState","shouldAnnounce","setShouldAnnounce","setTimeout","WDS_LIVE_REGION_DELAY_MS","closeButtonReference","useRef","accessibleTabIndex","_jsx","role","Sentiment","NEGATIVE","_jsxs","clsx","alertArrowClassNames","onTouchStart","onTouchEnd","event","href","target","Node","current","contains","window","top","open","location","assign","onTouchMove","StatusIcon","sentiment","iconLabel","Title","Typography","TITLE_BODY","Body","as","BODY_LARGE","InlineMarkdown","Link","LINK_LARGE","tabIndex","onClick","text","Button","v2","priority","CloseButton","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCYA;AAAZ,CAAA,UAAYA,kBAAkB,EAAA;AAC5BA,EAAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,SAAoB;AACpBA,EAAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,WAAiB;AACjBA,EAAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,UAAsB;AACtBA,EAAAA,kBAAA,CAAA,aAAA,CAAA,GAAA,WAAyB;AACzBA,EAAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,aAAsB;AACtBA,EAAAA,kBAAA,CAAA,cAAA,CAAA,GAAA,YAA2B;AAC7B,CAAC,EAPWA,0BAAkB,KAAlBA,0BAAkB,GAO7B,EAAA,CAAA,CAAA;AA+BD,SAASC,WAAWA,CAACC,IAAe,EAAA;AAClC,EAAA,QAAQA,IAAI;AACV,IAAA,KAAK,SAAS;AACZ,MAAA,OAAO,UAAU;AACnB,IAAA,KAAK,MAAM;AACT,MAAA,OAAO,SAAS;AAClB,IAAA,KAAK,OAAO;AACV,MAAA,OAAO,UAAU;AACnB,IAAA;AACE,MAAA,OAAOA,IAAI;AACf;AACF;AAEwB,SAAAC,KAAKA,CAAC;EAC5BC,MAAM;EACNC,SAAS;EACTC,IAAI;EACJC,eAAe;EACfC,SAAS;EACTC,OAAO;EACPC,KAAK;AACLR,EAAAA,IAAI,GAAG,SAAS;EAChBS,KAAK;EACLC,QAAQ;EACRC,IAAI;AACJC,EAAAA;AACW,CAAA,EA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AK,SAAS;AACd,IAAA;AACE,MAAA,OAAO,OAAO;AAClB;AACF;;;;"}
|
package/build/alert/Alert.mjs
CHANGED
|
@@ -99,6 +99,11 @@ function Alert({
|
|
|
99
99
|
}, WDS_LIVE_REGION_DELAY_MS);
|
|
100
100
|
}, []);
|
|
101
101
|
const closeButtonReference = useRef(null);
|
|
102
|
+
/**
|
|
103
|
+
* All focusable elements must be disabled until we announce the alert.
|
|
104
|
+
* @see https://dequeuniversity.com/rules/axe/4.10/aria-hidden-focus?application=axeAPI
|
|
105
|
+
*/
|
|
106
|
+
const accessibleTabIndex = shouldAnnounce ? undefined : -1;
|
|
102
107
|
return /*#__PURE__*/jsx("div", {
|
|
103
108
|
role: resolvedType === Sentiment.NEGATIVE ? 'alert' : 'status',
|
|
104
109
|
className: "wds-alert__liveRegion",
|
|
@@ -150,6 +155,7 @@ function Alert({
|
|
|
150
155
|
target: action.target,
|
|
151
156
|
type: Typography.LINK_LARGE,
|
|
152
157
|
className: "alert__action",
|
|
158
|
+
tabIndex: accessibleTabIndex,
|
|
153
159
|
onClick: action.onClick,
|
|
154
160
|
children: action.text
|
|
155
161
|
}) : /*#__PURE__*/jsx(Button, {
|
|
@@ -159,6 +165,7 @@ function Alert({
|
|
|
159
165
|
"aria-label": action['aria-label'],
|
|
160
166
|
priority: "secondary-neutral",
|
|
161
167
|
className: "alert__action",
|
|
168
|
+
tabIndex: accessibleTabIndex,
|
|
162
169
|
onClick: action.onClick,
|
|
163
170
|
children: action.text
|
|
164
171
|
}))]
|
|
@@ -168,6 +175,7 @@ function Alert({
|
|
|
168
175
|
children: /*#__PURE__*/jsx(CloseButton, {
|
|
169
176
|
ref: closeButtonReference,
|
|
170
177
|
size: "xs",
|
|
178
|
+
tabIndex: accessibleTabIndex,
|
|
171
179
|
onClick: onDismiss
|
|
172
180
|
})
|
|
173
181
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.mjs","sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useState, useRef, useEffect } from 'react';\n\nimport Body from '../body/Body';\nimport {\n CloseButton,\n Sentiment,\n Size,\n Status,\n Typography,\n WDS_LIVE_REGION_DELAY_MS,\n} from '../common';\n\nimport StatusIcon from '../statusIcon';\nimport Title from '../title/Title';\nimport { logActionRequired } from '../utilities';\n\nimport InlineMarkdown from './inlineMarkdown';\nimport Button from '../button';\nimport Link from '../link';\n\nexport type AlertAction = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype AlertTypeDeprecated = `${Sentiment.SUCCESS | Sentiment.INFO | Sentiment.ERROR}`;\ntype AlertTypeResolved = `${\n | Sentiment.POSITIVE\n | Sentiment.NEUTRAL\n | Sentiment.WARNING\n | Sentiment.NEGATIVE\n // remove when all instances of Sentiment.PENDING have been updated to Status.PENDING\n | Sentiment.PENDING\n | Status.PENDING}`;\nexport type AlertType = AlertTypeResolved | AlertTypeDeprecated;\n\nexport enum AlertArrowPosition {\n TOP_LEFT = 'up-left',\n TOP = 'up-center',\n TOP_RIGHT = 'up-right',\n BOTTOM_LEFT = 'down-left',\n BOTTOM = 'down-center',\n BOTTOM_RIGHT = 'down-right',\n}\n\nexport interface AlertProps {\n /** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */\n action?: AlertAction;\n className?: string;\n /** An optional icon. If not provided, we will default the icon to something appropriate for the type */\n icon?: React.ReactNode;\n /**\n * Override for [StatusIcon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n statusIconLabel?: string;\n /** Title for the alert component */\n title?: string;\n /** The main body of the alert. Accepts plain text and bold words specified with **double stars */\n message?: string;\n /** The presence of the onDismiss handler will trigger the visibility of the close button */\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n /** The type dictates which icon and colour will be used */\n type?: AlertType;\n /** @deprecated Use `InlineAlert` instead. */\n arrow?: `${AlertArrowPosition}`;\n /** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */\n children?: React.ReactNode;\n /** @deprecated Use `onDismiss` instead. */\n dismissible?: boolean;\n /** @deprecated Alert component doesn't support `size` anymore, please remove this prop. */\n size?: `${Size}`;\n}\n\nfunction resolveType(type: AlertType): AlertTypeResolved {\n switch (type) {\n case 'success':\n return 'positive';\n case 'info':\n return 'neutral';\n case 'error':\n return 'negative';\n default:\n return type;\n }\n}\n\nexport default function Alert({\n action,\n className,\n icon,\n statusIconLabel,\n onDismiss,\n message,\n title,\n type = 'neutral',\n arrow,\n children,\n size,\n dismissible,\n}: AlertProps) {\n useEffect(() => {\n if (arrow !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'arrow' anymore, use 'InlineAlert' instead.\",\n );\n }\n }, [arrow]);\n\n useEffect(() => {\n if (children !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'children' anymore, use 'message' instead.\",\n );\n }\n }, [children]);\n\n useEffect(() => {\n if (dismissible !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'dismissible' anymore, use 'onDismiss' instead.\",\n );\n }\n }, [dismissible]);\n\n useEffect(() => {\n if (size !== undefined) {\n logActionRequired(\"Alert component doesn't support 'size' anymore, please remove that prop.\");\n }\n }, [size]);\n\n const resolvedType = resolveType(type);\n useEffect(() => {\n if (resolvedType !== type) {\n logActionRequired(\n `Alert component has deprecated '${type}' value for the 'type' prop. Please use '${resolvedType}' instead.`,\n );\n }\n }, [resolvedType, type]);\n\n const [shouldFire, setShouldFire] = useState<boolean>();\n\n const [shouldAnnounce, setShouldAnnounce] = useState<boolean>(false);\n useEffect(() => {\n setTimeout(() => {\n setShouldAnnounce(true);\n }, WDS_LIVE_REGION_DELAY_MS);\n }, []);\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n\n return (\n <div\n role={resolvedType === Sentiment.NEGATIVE ? 'alert' : 'status'}\n className=\"wds-alert__liveRegion\"\n >\n <div\n aria-hidden={shouldAnnounce ? undefined : 'true'}\n className={clsx(\n 'alert d-flex',\n `alert-${resolvedType}`,\n arrow != null && alertArrowClassNames(arrow),\n className,\n )}\n data-testid=\"alert\"\n onTouchStart={() => setShouldFire(true)}\n onTouchEnd={(event) => {\n if (\n shouldFire &&\n action?.href &&\n // Check if current event is triggered from closeButton\n event.target instanceof Node &&\n closeButtonReference.current &&\n !closeButtonReference.current.contains(event.target)\n ) {\n if (action.target === '_blank') {\n window.top?.open(action.href);\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n }}\n onTouchMove={() => setShouldFire(false)}\n >\n <div className=\"alert__icon\">\n {icon || <StatusIcon size={32} sentiment={resolvedType} iconLabel={statusIconLabel} />}\n </div>\n <div className={clsx('alert__content', 'd-flex', 'flex-grow-1')}>\n <div className=\"alert__message\">\n <div>\n {title && (\n <Title className=\"m-b-1\" type={Typography.TITLE_BODY}>\n {title}\n </Title>\n )}\n <Body as=\"span\" className=\"d-block\" type={Typography.BODY_LARGE}>\n {children || <InlineMarkdown>{message}</InlineMarkdown>}\n </Body>\n </div>\n {action &&\n ('href' in action ? (\n <Link\n href={action.href}\n aria-label={action['aria-label']}\n target={action.target}\n type={Typography.LINK_LARGE}\n className=\"alert__action\"\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n ) : (\n <Button\n v2\n size=\"sm\"\n sentiment=\"default\"\n aria-label={action['aria-label']}\n priority=\"secondary-neutral\"\n className=\"alert__action\"\n onClick={action.onClick}\n >\n {action.text}\n </Button>\n ))}\n </div>\n </div>\n {onDismiss && (\n <div className=\"alert__close\">\n <CloseButton ref={closeButtonReference} size=\"xs\" onClick={onDismiss} />\n </div>\n )}\n </div>\n </div>\n );\n}\n\nfunction alertArrowClassNames(arrow: `${AlertArrowPosition}`) {\n switch (arrow) {\n case 'down-center':\n return 'arrow arrow-bottom arrow-center';\n case 'down-left':\n return 'arrow arrow-bottom arrow-left';\n case 'down-right':\n return 'arrow arrow-bottom arrow-right';\n case 'up-center':\n return 'arrow arrow-center';\n case 'up-right':\n return 'arrow arrow-right';\n case 'up-left':\n default:\n return 'arrow';\n }\n}\n"],"names":["AlertArrowPosition","resolveType","type","Alert","action","className","icon","statusIconLabel","onDismiss","message","title","arrow","children","size","dismissible","useEffect","undefined","logActionRequired","resolvedType","shouldFire","setShouldFire","useState","shouldAnnounce","setShouldAnnounce","setTimeout","WDS_LIVE_REGION_DELAY_MS","closeButtonReference","useRef","_jsx","role","Sentiment","NEGATIVE","_jsxs","clsx","alertArrowClassNames","onTouchStart","onTouchEnd","event","href","target","Node","current","contains","window","top","open","location","assign","onTouchMove","StatusIcon","sentiment","iconLabel","Title","Typography","TITLE_BODY","Body","as","BODY_LARGE","InlineMarkdown","Link","LINK_LARGE","onClick","text","Button","v2","priority","CloseButton","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyCYA;AAAZ,CAAA,UAAYA,kBAAkB,EAAA;AAC5BA,EAAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,SAAoB;AACpBA,EAAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,WAAiB;AACjBA,EAAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,UAAsB;AACtBA,EAAAA,kBAAA,CAAA,aAAA,CAAA,GAAA,WAAyB;AACzBA,EAAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,aAAsB;AACtBA,EAAAA,kBAAA,CAAA,cAAA,CAAA,GAAA,YAA2B;AAC7B,CAAC,EAPWA,kBAAkB,KAAlBA,kBAAkB,GAO7B,EAAA,CAAA,CAAA;AA+BD,SAASC,WAAWA,CAACC,IAAe,EAAA;AAClC,EAAA,QAAQA,IAAI;AACV,IAAA,KAAK,SAAS;AACZ,MAAA,OAAO,UAAU;AACnB,IAAA,KAAK,MAAM;AACT,MAAA,OAAO,SAAS;AAClB,IAAA,KAAK,OAAO;AACV,MAAA,OAAO,UAAU;AACnB,IAAA;AACE,MAAA,OAAOA,IAAI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SAAS;AACd,IAAA;AACE,MAAA,OAAO,OAAO;AAClB;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"Alert.mjs","sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useState, useRef, useEffect } from 'react';\n\nimport Body from '../body/Body';\nimport {\n CloseButton,\n Sentiment,\n Size,\n Status,\n Typography,\n WDS_LIVE_REGION_DELAY_MS,\n} from '../common';\n\nimport StatusIcon from '../statusIcon';\nimport Title from '../title/Title';\nimport { logActionRequired } from '../utilities';\n\nimport InlineMarkdown from './inlineMarkdown';\nimport Button from '../button';\nimport Link from '../link';\n\nexport type AlertAction = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype AlertTypeDeprecated = `${Sentiment.SUCCESS | Sentiment.INFO | Sentiment.ERROR}`;\ntype AlertTypeResolved = `${\n | Sentiment.POSITIVE\n | Sentiment.NEUTRAL\n | Sentiment.WARNING\n | Sentiment.NEGATIVE\n // remove when all instances of Sentiment.PENDING have been updated to Status.PENDING\n | Sentiment.PENDING\n | Status.PENDING}`;\nexport type AlertType = AlertTypeResolved | AlertTypeDeprecated;\n\nexport enum AlertArrowPosition {\n TOP_LEFT = 'up-left',\n TOP = 'up-center',\n TOP_RIGHT = 'up-right',\n BOTTOM_LEFT = 'down-left',\n BOTTOM = 'down-center',\n BOTTOM_RIGHT = 'down-right',\n}\n\nexport interface AlertProps {\n /** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */\n action?: AlertAction;\n className?: string;\n /** An optional icon. If not provided, we will default the icon to something appropriate for the type */\n icon?: React.ReactNode;\n /**\n * Override for [StatusIcon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n statusIconLabel?: string;\n /** Title for the alert component */\n title?: string;\n /** The main body of the alert. Accepts plain text and bold words specified with **double stars */\n message?: string;\n /** The presence of the onDismiss handler will trigger the visibility of the close button */\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n /** The type dictates which icon and colour will be used */\n type?: AlertType;\n /** @deprecated Use `InlineAlert` instead. */\n arrow?: `${AlertArrowPosition}`;\n /** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */\n children?: React.ReactNode;\n /** @deprecated Use `onDismiss` instead. */\n dismissible?: boolean;\n /** @deprecated Alert component doesn't support `size` anymore, please remove this prop. */\n size?: `${Size}`;\n}\n\nfunction resolveType(type: AlertType): AlertTypeResolved {\n switch (type) {\n case 'success':\n return 'positive';\n case 'info':\n return 'neutral';\n case 'error':\n return 'negative';\n default:\n return type;\n }\n}\n\nexport default function Alert({\n action,\n className,\n icon,\n statusIconLabel,\n onDismiss,\n message,\n title,\n type = 'neutral',\n arrow,\n children,\n size,\n dismissible,\n}: AlertProps) {\n useEffect(() => {\n if (arrow !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'arrow' anymore, use 'InlineAlert' instead.\",\n );\n }\n }, [arrow]);\n\n useEffect(() => {\n if (children !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'children' anymore, use 'message' instead.\",\n );\n }\n }, [children]);\n\n useEffect(() => {\n if (dismissible !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'dismissible' anymore, use 'onDismiss' instead.\",\n );\n }\n }, [dismissible]);\n\n useEffect(() => {\n if (size !== undefined) {\n logActionRequired(\"Alert component doesn't support 'size' anymore, please remove that prop.\");\n }\n }, [size]);\n\n const resolvedType = resolveType(type);\n useEffect(() => {\n if (resolvedType !== type) {\n logActionRequired(\n `Alert component has deprecated '${type}' value for the 'type' prop. Please use '${resolvedType}' instead.`,\n );\n }\n }, [resolvedType, type]);\n\n const [shouldFire, setShouldFire] = useState<boolean>();\n\n const [shouldAnnounce, setShouldAnnounce] = useState<boolean>(false);\n useEffect(() => {\n setTimeout(() => {\n setShouldAnnounce(true);\n }, WDS_LIVE_REGION_DELAY_MS);\n }, []);\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n\n /**\n * All focusable elements must be disabled until we announce the alert.\n * @see https://dequeuniversity.com/rules/axe/4.10/aria-hidden-focus?application=axeAPI\n */\n const accessibleTabIndex = shouldAnnounce ? undefined : -1;\n\n return (\n <div\n role={resolvedType === Sentiment.NEGATIVE ? 'alert' : 'status'}\n className=\"wds-alert__liveRegion\"\n >\n <div\n aria-hidden={shouldAnnounce ? undefined : 'true'}\n className={clsx(\n 'alert d-flex',\n `alert-${resolvedType}`,\n arrow != null && alertArrowClassNames(arrow),\n className,\n )}\n data-testid=\"alert\"\n onTouchStart={() => setShouldFire(true)}\n onTouchEnd={(event) => {\n if (\n shouldFire &&\n action?.href &&\n // Check if current event is triggered from closeButton\n event.target instanceof Node &&\n closeButtonReference.current &&\n !closeButtonReference.current.contains(event.target)\n ) {\n if (action.target === '_blank') {\n window.top?.open(action.href);\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n }}\n onTouchMove={() => setShouldFire(false)}\n >\n <div className=\"alert__icon\">\n {icon || <StatusIcon size={32} sentiment={resolvedType} iconLabel={statusIconLabel} />}\n </div>\n <div className={clsx('alert__content', 'd-flex', 'flex-grow-1')}>\n <div className=\"alert__message\">\n <div>\n {title && (\n <Title className=\"m-b-1\" type={Typography.TITLE_BODY}>\n {title}\n </Title>\n )}\n <Body as=\"span\" className=\"d-block\" type={Typography.BODY_LARGE}>\n {children || <InlineMarkdown>{message}</InlineMarkdown>}\n </Body>\n </div>\n {action &&\n ('href' in action ? (\n <Link\n href={action.href}\n aria-label={action['aria-label']}\n target={action.target}\n type={Typography.LINK_LARGE}\n className=\"alert__action\"\n tabIndex={accessibleTabIndex}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n ) : (\n <Button\n v2\n size=\"sm\"\n sentiment=\"default\"\n aria-label={action['aria-label']}\n priority=\"secondary-neutral\"\n className=\"alert__action\"\n tabIndex={accessibleTabIndex}\n onClick={action.onClick}\n >\n {action.text}\n </Button>\n ))}\n </div>\n </div>\n {onDismiss && (\n <div className=\"alert__close\">\n <CloseButton\n ref={closeButtonReference}\n size=\"xs\"\n tabIndex={accessibleTabIndex}\n onClick={onDismiss}\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n\nfunction alertArrowClassNames(arrow: `${AlertArrowPosition}`) {\n switch (arrow) {\n case 'down-center':\n return 'arrow arrow-bottom arrow-center';\n case 'down-left':\n return 'arrow arrow-bottom arrow-left';\n case 'down-right':\n return 'arrow arrow-bottom arrow-right';\n case 'up-center':\n return 'arrow arrow-center';\n case 'up-right':\n return 'arrow arrow-right';\n case 'up-left':\n default:\n return 'arrow';\n }\n}\n"],"names":["AlertArrowPosition","resolveType","type","Alert","action","className","icon","statusIconLabel","onDismiss","message","title","arrow","children","size","dismissible","useEffect","undefined","logActionRequired","resolvedType","shouldFire","setShouldFire","useState","shouldAnnounce","setShouldAnnounce","setTimeout","WDS_LIVE_REGION_DELAY_MS","closeButtonReference","useRef","accessibleTabIndex","_jsx","role","Sentiment","NEGATIVE","_jsxs","clsx","alertArrowClassNames","onTouchStart","onTouchEnd","event","href","target","Node","current","contains","window","top","open","location","assign","onTouchMove","StatusIcon","sentiment","iconLabel","Title","Typography","TITLE_BODY","Body","as","BODY_LARGE","InlineMarkdown","Link","LINK_LARGE","tabIndex","onClick","text","Button","v2","priority","CloseButton","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyCYA;AAAZ,CAAA,UAAYA,kBAAkB,EAAA;AAC5BA,EAAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,SAAoB;AACpBA,EAAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,WAAiB;AACjBA,EAAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,UAAsB;AACtBA,EAAAA,kBAAA,CAAA,aAAA,CAAA,GAAA,WAAyB;AACzBA,EAAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,aAAsB;AACtBA,EAAAA,kBAAA,CA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GAAA,CAACuC,WAAW,EAAA;AACVC,UAAAA,GAAG,EAAE3C,oBAAqB;AAC1Bb,UAAAA,IAAI,EAAC,IAAI;AACTiD,UAAAA,QAAQ,EAAElC,kBAAmB;AAC7BmC,UAAAA,OAAO,EAAEvD;SAEb;AAAA,OAAK,CACN;KACE;AACP,GAAK,CAAC;AAEV;AAEA,SAAS2B,oBAAoBA,CAACxB,KAA8B,EAAA;AAC1D,EAAA,QAAQA,KAAK;AACX,IAAA,KAAK,aAAa;AAChB,MAAA,OAAO,iCAAiC;AAC1C,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,+BAA+B;AACxC,IAAA,KAAK,YAAY;AACf,MAAA,OAAO,gCAAgC;AACzC,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,oBAAoB;AAC7B,IAAA,KAAK,UAAU;AACb,MAAA,OAAO,mBAAmB;AAC5B,IAAA,KAAK,SAAS;AACd,IAAA;AACE,MAAA,OAAO,OAAO;AAClB;AACF;;;;"}
|
|
@@ -15,7 +15,8 @@ const CloseButton = /*#__PURE__*/React.forwardRef(function CloseButton({
|
|
|
15
15
|
className,
|
|
16
16
|
onClick,
|
|
17
17
|
isDisabled,
|
|
18
|
-
testId
|
|
18
|
+
testId,
|
|
19
|
+
tabIndex
|
|
19
20
|
}, reference) {
|
|
20
21
|
const intl = reactIntl.useIntl();
|
|
21
22
|
ariaLabel ??= intl.formatMessage(CloseButton_messages.default.ariaLabel);
|
|
@@ -32,6 +33,7 @@ const CloseButton = /*#__PURE__*/React.forwardRef(function CloseButton({
|
|
|
32
33
|
"aria-disabled": isDisabled,
|
|
33
34
|
disabled: isDisabled,
|
|
34
35
|
"data-testid": testId,
|
|
36
|
+
tabIndex: tabIndex,
|
|
35
37
|
onClick: onClick,
|
|
36
38
|
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
37
39
|
size: size$1 === size.Size.SMALL || size$1 === size.Size.EXTRA_SMALL ? 16 : 24
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloseButton.js","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall, SizeExtraSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeExtraSmall | SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--x-small': size === Size.EXTRA_SMALL,\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","EXTRA_SMALL","LARGE","disabled","children","SMALL"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CloseButton.js","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall, SizeExtraSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeExtraSmall | SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n tabIndex?: number;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n tabIndex,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--x-small': size === Size.EXTRA_SMALL,\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n tabIndex={tabIndex}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","tabIndex","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","EXTRA_SMALL","LARGE","disabled","children","SMALL"],"mappings":";;;;;;;;;;MAuBa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13,7 +13,8 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
|
|
|
13
13
|
className,
|
|
14
14
|
onClick,
|
|
15
15
|
isDisabled,
|
|
16
|
-
testId
|
|
16
|
+
testId,
|
|
17
|
+
tabIndex
|
|
17
18
|
}, reference) {
|
|
18
19
|
const intl = useIntl();
|
|
19
20
|
ariaLabel ??= intl.formatMessage(messages.ariaLabel);
|
|
@@ -30,6 +31,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
|
|
|
30
31
|
"aria-disabled": isDisabled,
|
|
31
32
|
disabled: isDisabled,
|
|
32
33
|
"data-testid": testId,
|
|
34
|
+
tabIndex: tabIndex,
|
|
33
35
|
onClick: onClick,
|
|
34
36
|
children: /*#__PURE__*/jsx(Icon, {
|
|
35
37
|
size: size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloseButton.mjs","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall, SizeExtraSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeExtraSmall | SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--x-small': size === Size.EXTRA_SMALL,\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","EXTRA_SMALL","LARGE","disabled","children","SMALL"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"CloseButton.mjs","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall, SizeExtraSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeExtraSmall | SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n tabIndex?: number;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n tabIndex,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--x-small': size === Size.EXTRA_SMALL,\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n tabIndex={tabIndex}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","tabIndex","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","EXTRA_SMALL","LARGE","disabled","children","SMALL"],"mappings":";;;;;;;;MAuBaA,WAAW,gBAAGC,UAAU,CAAC,SAASD,WAAWA,CACxD;AACE,EAAA,YAAY,EAAEE,SAAS;EACvBC,IAAI,GAAGC,IAAI,CAACC,MAAM;AAClBC,EAAAA,MAAM,GAAG,KAAK;EACdC,SAAS;EACTC,OAAO;EACPC,UAAU;EACVC,MAAM;AACNC,EAAAA;AAAQ,CACS,EACnBC,SAAuD,EAAA;AAEvD,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;EACtBZ,SAAS,KAAKW,IAAI,CAACE,aAAa,CAACC,QAAQ,CAACd,SAAS,CAAC;AACpD,EAAA,MAAMe,IAAI,GAAGX,MAAM,GAAGY,eAAe,GAAGC,KAAK;AAE7C,EAAA,oBACEC,GAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,GAAG,EAAET,SAAU;AACfU,IAAAA,IAAI,EAAC,QAAQ;IACbf,SAAS,EAAEgB,IAAI,CACb,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB;AACE,MAAA,0BAA0B,EAAEpB,IAAI,KAAKC,IAAI,CAACoB,WAAW;AACrD,MAAA,wBAAwB,EAAErB,IAAI,KAAKC,IAAI,CAACC,MAAM;AAC9C,MAAA,0BAA0B,EAAEF,IAAI,KAAKC,IAAI,CAACqB;KAC3C,EACDlB,SAAS,CACT;AACF,IAAA,YAAA,EAAYL,SAAU;AACtB,IAAA,eAAA,EAAeO,UAAW;AAC1BiB,IAAAA,QAAQ,EAAEjB,UAAW;AACrB,IAAA,aAAA,EAAaC,MAAO;AACpBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBH,IAAAA,OAAO,EAAEA,OAAQ;IAAAmB,QAAA,eAEjBP,GAAA,CAACH,IAAI,EAAA;AAACd,MAAAA,IAAI,EAAEA,IAAI,KAAKC,IAAI,CAACwB,KAAK,IAAIzB,IAAI,KAAKC,IAAI,CAACoB,WAAW,GAAG,EAAE,GAAG;KACtE;AAAA,GAAQ,CAAC;AAEb,CAAC;;;;"}
|
package/build/i18n/cs.json
CHANGED
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Volitelné)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(otevře se v nové kartě)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Vybrat možnost...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Napište měnu nebo zemi",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Vybrat měnu",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Vybrat možnost...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Kód země",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonní číslo",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Hledat...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Nebyly nalezeny žádné výsledky",
|
|
28
31
|
"neptune.SelectOption.action.label": "Vybrat",
|
package/build/i18n/cs.json.js
CHANGED
|
@@ -25,8 +25,11 @@ var cs = {
|
|
|
25
25
|
"neptune.Label.optional": "(Volitelné)",
|
|
26
26
|
"neptune.Link.opensInNewTab": "(otevře se v nové kartě)",
|
|
27
27
|
"neptune.MoneyInput.Select.placeholder": "Vybrat možnost...",
|
|
28
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Napište měnu nebo zemi",
|
|
28
29
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Vybrat měnu",
|
|
29
30
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Vybrat možnost...",
|
|
31
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Kód země",
|
|
32
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonní číslo",
|
|
30
33
|
"neptune.Select.searchPlaceholder": "Hledat...",
|
|
31
34
|
"neptune.SelectInput.noResultsFound": "Nebyly nalezeny žádné výsledky",
|
|
32
35
|
"neptune.SelectOption.action.label": "Vybrat",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cs.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cs.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/cs.json.mjs
CHANGED
|
@@ -21,8 +21,11 @@ var cs = {
|
|
|
21
21
|
"neptune.Label.optional": "(Volitelné)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(otevře se v nové kartě)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Vybrat možnost...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Napište měnu nebo zemi",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Vybrat měnu",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Vybrat možnost...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Kód země",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonní číslo",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Hledat...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Nebyly nalezeny žádné výsledky",
|
|
28
31
|
"neptune.SelectOption.action.label": "Vybrat",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cs.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cs.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/de.json
CHANGED
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Optional)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(wird in einem neuen Tab geöffnet)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Gib eine Währung oder ein Land ein",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Wähle eine Währung",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wähle eine Option...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Ländercode",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonnummer",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Wird gesucht...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
|
|
28
31
|
"neptune.SelectOption.action.label": "Auswählen",
|
package/build/i18n/de.json.js
CHANGED
|
@@ -25,8 +25,11 @@ var de = {
|
|
|
25
25
|
"neptune.Label.optional": "(Optional)",
|
|
26
26
|
"neptune.Link.opensInNewTab": "(wird in einem neuen Tab geöffnet)",
|
|
27
27
|
"neptune.MoneyInput.Select.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
28
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Gib eine Währung oder ein Land ein",
|
|
28
29
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Wähle eine Währung",
|
|
29
30
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wähle eine Option...",
|
|
31
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Ländercode",
|
|
32
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonnummer",
|
|
30
33
|
"neptune.Select.searchPlaceholder": "Wird gesucht...",
|
|
31
34
|
"neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
|
|
32
35
|
"neptune.SelectOption.action.label": "Auswählen",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"de.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/de.json.mjs
CHANGED
|
@@ -21,8 +21,11 @@ var de = {
|
|
|
21
21
|
"neptune.Label.optional": "(Optional)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(wird in einem neuen Tab geöffnet)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Gib eine Währung oder ein Land ein",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Wähle eine Währung",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wähle eine Option...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Ländercode",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonnummer",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Wird gesucht...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
|
|
28
31
|
"neptune.SelectOption.action.label": "Auswählen",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"de.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/en.json
CHANGED
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Optional)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Select an option...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Type a currency or country",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Select currency",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Select an option...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Country code",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Phone number",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Search...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "No results found",
|
|
28
31
|
"neptune.SelectOption.action.label": "Choose",
|
package/build/i18n/en.json.js
CHANGED
|
@@ -25,8 +25,11 @@ var en = {
|
|
|
25
25
|
"neptune.Label.optional": "(Optional)",
|
|
26
26
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
27
27
|
"neptune.MoneyInput.Select.placeholder": "Select an option...",
|
|
28
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Type a currency or country",
|
|
28
29
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Select currency",
|
|
29
30
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Select an option...",
|
|
31
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Country code",
|
|
32
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Phone number",
|
|
30
33
|
"neptune.Select.searchPlaceholder": "Search...",
|
|
31
34
|
"neptune.SelectInput.noResultsFound": "No results found",
|
|
32
35
|
"neptune.SelectOption.action.label": "Choose",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/en.json.mjs
CHANGED
|
@@ -21,8 +21,11 @@ var en = {
|
|
|
21
21
|
"neptune.Label.optional": "(Optional)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Select an option...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Type a currency or country",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Select currency",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Select an option...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Country code",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Phone number",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Search...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "No results found",
|
|
28
31
|
"neptune.SelectOption.action.label": "Choose",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/es.json
CHANGED
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Opcional)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(se abre en una pestaña nueva)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Selecciona una opción...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Indica una divisa o país",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Selecciona una divisa",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selecciona una opción...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Código de país",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Número de teléfono",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
|
|
28
31
|
"neptune.SelectOption.action.label": "Elegir",
|
package/build/i18n/es.json.js
CHANGED
|
@@ -25,8 +25,11 @@ var es = {
|
|
|
25
25
|
"neptune.Label.optional": "(Opcional)",
|
|
26
26
|
"neptune.Link.opensInNewTab": "(se abre en una pestaña nueva)",
|
|
27
27
|
"neptune.MoneyInput.Select.placeholder": "Selecciona una opción...",
|
|
28
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Indica una divisa o país",
|
|
28
29
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Selecciona una divisa",
|
|
29
30
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selecciona una opción...",
|
|
31
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Código de país",
|
|
32
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Número de teléfono",
|
|
30
33
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
31
34
|
"neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
|
|
32
35
|
"neptune.SelectOption.action.label": "Elegir",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/es.json.mjs
CHANGED
|
@@ -21,8 +21,11 @@ var es = {
|
|
|
21
21
|
"neptune.Label.optional": "(Opcional)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(se abre en una pestaña nueva)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Selecciona una opción...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Indica una divisa o país",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Selecciona una divisa",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selecciona una opción...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Código de país",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Número de teléfono",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
|
|
28
31
|
"neptune.SelectOption.action.label": "Elegir",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"es.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/fr.json
CHANGED
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
"neptune.Label.optional": "(facultatif)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(ouvre dans un nouvel onglet)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Sélectionner une option...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Saisissez une devise ou un pays",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Sélectionnez une devise",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Sélectionnez une option…",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Code pays",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Numéro de téléphone",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Recherche...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
|
|
28
31
|
"neptune.SelectOption.action.label": "Sélectionner",
|
package/build/i18n/fr.json.js
CHANGED
|
@@ -25,8 +25,11 @@ var fr = {
|
|
|
25
25
|
"neptune.Label.optional": "(facultatif)",
|
|
26
26
|
"neptune.Link.opensInNewTab": "(ouvre dans un nouvel onglet)",
|
|
27
27
|
"neptune.MoneyInput.Select.placeholder": "Sélectionner une option...",
|
|
28
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Saisissez une devise ou un pays",
|
|
28
29
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Sélectionnez une devise",
|
|
29
30
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Sélectionnez une option…",
|
|
31
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Code pays",
|
|
32
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Numéro de téléphone",
|
|
30
33
|
"neptune.Select.searchPlaceholder": "Recherche...",
|
|
31
34
|
"neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
|
|
32
35
|
"neptune.SelectOption.action.label": "Sélectionner",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/fr.json.mjs
CHANGED
|
@@ -21,8 +21,11 @@ var fr = {
|
|
|
21
21
|
"neptune.Label.optional": "(facultatif)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(ouvre dans un nouvel onglet)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Sélectionner une option...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Saisissez une devise ou un pays",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Sélectionnez une devise",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Sélectionnez une option…",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Code pays",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Numéro de téléphone",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Recherche...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
|
|
28
31
|
"neptune.SelectOption.action.label": "Sélectionner",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fr.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/hu.json
CHANGED
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Válaszható)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(új lapon nyílik meg)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Válassz ki egy lehetőséget...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Írj be egy pénznemet vagy országot",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Pénznem kiválasztása",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Válassz ki egy lehetőséget...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Országazonosító",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonszám",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Keresés...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Nincs találat",
|
|
28
31
|
"neptune.SelectOption.action.label": "Kiválasztás",
|
package/build/i18n/hu.json.js
CHANGED
|
@@ -25,8 +25,11 @@ var hu = {
|
|
|
25
25
|
"neptune.Label.optional": "(Válaszható)",
|
|
26
26
|
"neptune.Link.opensInNewTab": "(új lapon nyílik meg)",
|
|
27
27
|
"neptune.MoneyInput.Select.placeholder": "Válassz ki egy lehetőséget...",
|
|
28
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Írj be egy pénznemet vagy országot",
|
|
28
29
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Pénznem kiválasztása",
|
|
29
30
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Válassz ki egy lehetőséget...",
|
|
31
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Országazonosító",
|
|
32
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonszám",
|
|
30
33
|
"neptune.Select.searchPlaceholder": "Keresés...",
|
|
31
34
|
"neptune.SelectInput.noResultsFound": "Nincs találat",
|
|
32
35
|
"neptune.SelectOption.action.label": "Kiválasztás",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hu.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hu.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/hu.json.mjs
CHANGED
|
@@ -21,8 +21,11 @@ var hu = {
|
|
|
21
21
|
"neptune.Label.optional": "(Válaszható)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(új lapon nyílik meg)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Válassz ki egy lehetőséget...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Írj be egy pénznemet vagy országot",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Pénznem kiválasztása",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Válassz ki egy lehetőséget...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Országazonosító",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonszám",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Keresés...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Nincs találat",
|
|
28
31
|
"neptune.SelectOption.action.label": "Kiválasztás",
|