@transferwise/components 0.0.0-experimental-6f41b35 → 0.0.0-experimental-452dddd
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/field/Field.js +1 -0
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +1 -0
- package/build/field/Field.mjs.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +1 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +1 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/main.css +31 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js +113 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +111 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/styles/main.css +31 -0
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +31 -0
- package/build/typeahead/Typeahead.js +1 -0
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +1 -0
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/index.d.ts +2 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +56 -0
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -0
- package/build/types/prompt/InfoPrompt/index.d.ts +3 -0
- package/build/types/prompt/InfoPrompt/index.d.ts.map +1 -0
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +5 -5
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/build/types/prompt/index.d.ts +2 -0
- package/build/types/prompt/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/main.css +31 -0
- package/src/main.less +2 -1
- package/src/prompt/ActionPrompt/ActionPrompt.less +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +2 -7
- package/src/prompt/InfoPrompt/InfoPrompt.css +31 -0
- package/src/prompt/InfoPrompt/InfoPrompt.less +37 -0
- package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +312 -0
- package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +246 -0
- package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +224 -0
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +148 -0
- package/src/prompt/InfoPrompt/index.ts +2 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +5 -5
- package/src/prompt/index.ts +5 -0
- package/src/ssr.test.tsx +1 -0
package/build/field/Field.js
CHANGED
|
@@ -36,6 +36,7 @@ require('../provider/direction/DirectionProvider.js');
|
|
|
36
36
|
require('../sentimentSurface/SentimentSurface.js');
|
|
37
37
|
require('../primitives/PrimitiveButton/PrimitiveButton.js');
|
|
38
38
|
require('../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
|
|
39
|
+
require('../link/Link.messages.js');
|
|
39
40
|
var contexts = require('../inputs/contexts.js');
|
|
40
41
|
var Label = require('../label/Label.js');
|
|
41
42
|
|
package/build/field/Field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","sources":["../../src/field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId, useRef } from 'react';\n\nimport { Sentiment } from '../common';\nimport { InlinePrompt, type InlinePromptProps } from '../prompt';\nimport {\n FieldLabelContextProvider,\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 [InlinePrompt icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n /**\n * If true, shows a loading spinner in place of the message icon of the InlinePrompt\n */\n messageLoading?: boolean;\n description?: React.ReactNode;\n /** @deprecated use `message` and `type={Sentiment.NEGATIVE}` prop instead */\n error?: React.ReactNode;\n sentiment?: InlinePromptProps['sentiment'];\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 messageLoading,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const labelRef = useRef<HTMLLabelElement>(null);\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 <FieldLabelContextProvider value={{ id: labelId, ref: labelRef }}>\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 ref={labelRef} 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 <InlinePrompt\n sentiment={sentiment}\n id={messageId}\n mediaLabel={messageIconLabel}\n className=\"np-field__prompt\"\n loading={messageLoading}\n width=\"full\"\n >\n {message}\n </InlinePrompt>\n )}\n </div>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelContextProvider>\n );\n};\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","messageLoading","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","labelRef","useRef","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelContextProvider","value","ref","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","_jsxs","clsx","POSITIVE","WARNING","_Fragment","Label","htmlFor","Optional","Description","InlinePrompt","mediaLabel","loading","width"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Field.js","sources":["../../src/field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId, useRef } from 'react';\n\nimport { Sentiment } from '../common';\nimport { InlinePrompt, type InlinePromptProps } from '../prompt';\nimport {\n FieldLabelContextProvider,\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 [InlinePrompt icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n /**\n * If true, shows a loading spinner in place of the message icon of the InlinePrompt\n */\n messageLoading?: boolean;\n description?: React.ReactNode;\n /** @deprecated use `message` and `type={Sentiment.NEGATIVE}` prop instead */\n error?: React.ReactNode;\n sentiment?: InlinePromptProps['sentiment'];\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 messageLoading,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const labelRef = useRef<HTMLLabelElement>(null);\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 <FieldLabelContextProvider value={{ id: labelId, ref: labelRef }}>\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 ref={labelRef} 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 <InlinePrompt\n sentiment={sentiment}\n id={messageId}\n mediaLabel={messageIconLabel}\n className=\"np-field__prompt\"\n loading={messageLoading}\n width=\"full\"\n >\n {message}\n </InlinePrompt>\n )}\n </div>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelContextProvider>\n );\n};\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","messageLoading","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","labelRef","useRef","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelContextProvider","value","ref","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","_jsxs","clsx","POSITIVE","WARNING","_Fragment","Label","htmlFor","Optional","Description","InlinePrompt","mediaLabel","loading","width"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,MAAMA,KAAK,GAAGA,CAAC;EACpBC,EAAE;EACFC,KAAK;AACLC,EAAAA,QAAQ,GAAG,IAAI;AACfC,EAAAA,OAAO,EAAEC,WAAW;EACpBC,gBAAgB;EAChBC,cAAc;EACdC,IAAI;AACJC,EAAAA,WAAW,GAAGD,IAAI;AAClBE,EAAAA,SAAS,EAAEC,QAAQ,GAAGC,mBAAS,CAACC,OAAO;EACvCC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAK,CACG,KAAI;AACf,EAAA,MAAMC,QAAQ,GAAGC,YAAM,CAAmB,IAAI,CAAC;EAC/C,MAAMR,WAAS,GAAGM,KAAK,CAACG,KAAK,GAAGP,mBAAS,CAACQ,QAAQ,GAAGT,QAAQ;AAC7D,EAAA,MAAMP,OAAO,GAAGC,WAAW,IAAIW,KAAK,CAACG,KAAK;AAC1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field.mjs
CHANGED
|
@@ -34,6 +34,7 @@ import '../provider/direction/DirectionProvider.mjs';
|
|
|
34
34
|
import '../sentimentSurface/SentimentSurface.mjs';
|
|
35
35
|
import '../primitives/PrimitiveButton/PrimitiveButton.mjs';
|
|
36
36
|
import '../primitives/PrimitiveAnchor/PrimitiveAnchor.mjs';
|
|
37
|
+
import '../link/Link.messages.mjs';
|
|
37
38
|
import { FieldLabelContextProvider, InputIdContextProvider, InputDescribedByProvider, InputInvalidProvider } from '../inputs/contexts.mjs';
|
|
38
39
|
import { Label as LabelNamespace } from '../label/Label.mjs';
|
|
39
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.mjs","sources":["../../src/field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId, useRef } from 'react';\n\nimport { Sentiment } from '../common';\nimport { InlinePrompt, type InlinePromptProps } from '../prompt';\nimport {\n FieldLabelContextProvider,\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 [InlinePrompt icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n /**\n * If true, shows a loading spinner in place of the message icon of the InlinePrompt\n */\n messageLoading?: boolean;\n description?: React.ReactNode;\n /** @deprecated use `message` and `type={Sentiment.NEGATIVE}` prop instead */\n error?: React.ReactNode;\n sentiment?: InlinePromptProps['sentiment'];\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 messageLoading,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const labelRef = useRef<HTMLLabelElement>(null);\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 <FieldLabelContextProvider value={{ id: labelId, ref: labelRef }}>\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 ref={labelRef} 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 <InlinePrompt\n sentiment={sentiment}\n id={messageId}\n mediaLabel={messageIconLabel}\n className=\"np-field__prompt\"\n loading={messageLoading}\n width=\"full\"\n >\n {message}\n </InlinePrompt>\n )}\n </div>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelContextProvider>\n );\n};\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","messageLoading","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","labelRef","useRef","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelContextProvider","value","ref","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","_jsxs","clsx","POSITIVE","WARNING","_Fragment","Label","htmlFor","Optional","Description","InlinePrompt","mediaLabel","loading","width"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Field.mjs","sources":["../../src/field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId, useRef } from 'react';\n\nimport { Sentiment } from '../common';\nimport { InlinePrompt, type InlinePromptProps } from '../prompt';\nimport {\n FieldLabelContextProvider,\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 [InlinePrompt icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n /**\n * If true, shows a loading spinner in place of the message icon of the InlinePrompt\n */\n messageLoading?: boolean;\n description?: React.ReactNode;\n /** @deprecated use `message` and `type={Sentiment.NEGATIVE}` prop instead */\n error?: React.ReactNode;\n sentiment?: InlinePromptProps['sentiment'];\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 messageLoading,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const labelRef = useRef<HTMLLabelElement>(null);\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 <FieldLabelContextProvider value={{ id: labelId, ref: labelRef }}>\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 ref={labelRef} 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 <InlinePrompt\n sentiment={sentiment}\n id={messageId}\n mediaLabel={messageIconLabel}\n className=\"np-field__prompt\"\n loading={messageLoading}\n width=\"full\"\n >\n {message}\n </InlinePrompt>\n )}\n </div>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelContextProvider>\n );\n};\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","messageLoading","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","labelRef","useRef","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelContextProvider","value","ref","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","_js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C,eACvD,CACP,eAAAgC,GAAA,CAACY,cAAK,CAACG,WAAW,EAAA;AAAChD,gBAAAA,EAAE,EAAE2B,aAAc;AAAAb,gBAAAA,QAAA,EAAEN;eAA+B,CACtE,eAAAyB,GAAA,CAAA,KAAA,EAAA;AAAKpB,gBAAAA,SAAS,EAAC,kBAAkB;AAAAC,gBAAAA,QAAA,EAAEA;AAAQ,eAAM,CACnD;aAAA,CAAG,GAEHA,QACD,EAEAX,OAAO,iBACN8B,GAAA,CAACgB,YAAY,EAAA;AACXxC,cAAAA,SAAS,EAAEA,SAAU;AACrBT,cAAAA,EAAE,EAAE0B,SAAU;AACdwB,cAAAA,UAAU,EAAE7C,gBAAiB;AAC7BQ,cAAAA,SAAS,EAAC,kBAAkB;AAC5BsC,cAAAA,OAAO,EAAE7C,cAAe;AACxB8C,cAAAA,KAAK,EAAC,MAAM;AAAAtC,cAAAA,QAAA,EAEXX;AAAO,aACI,CACf;WACE;SACe;OACE;KACJ;AAC1B,GAA2B,CAAC;AAEhC;;;;"}
|
package/build/index.js
CHANGED
|
@@ -53,6 +53,7 @@ var Info = require('./info/Info.js');
|
|
|
53
53
|
var InlineAlert = require('./inlineAlert/InlineAlert.js');
|
|
54
54
|
var InlinePrompt = require('./prompt/InlinePrompt/InlinePrompt.js');
|
|
55
55
|
var ActionPrompt = require('./prompt/ActionPrompt/ActionPrompt.js');
|
|
56
|
+
var InfoPrompt = require('./prompt/InfoPrompt/InfoPrompt.js');
|
|
56
57
|
var InputWithDisplayFormat = require('./inputWithDisplayFormat/InputWithDisplayFormat.js');
|
|
57
58
|
var Input = require('./inputs/Input.js');
|
|
58
59
|
var InputGroup = require('./inputs/InputGroup.js');
|
|
@@ -213,6 +214,7 @@ exports.Info = Info.default;
|
|
|
213
214
|
exports.InlineAlert = InlineAlert.default;
|
|
214
215
|
exports.InlinePrompt = InlinePrompt.InlinePrompt;
|
|
215
216
|
exports.ActionPrompt = ActionPrompt.ActionPrompt;
|
|
217
|
+
exports.InfoPrompt = InfoPrompt.InfoPrompt;
|
|
216
218
|
exports.InputWithDisplayFormat = InputWithDisplayFormat.default;
|
|
217
219
|
exports.Input = Input.Input;
|
|
218
220
|
exports.InputGroup = InputGroup.InputGroup;
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/index.mjs
CHANGED
|
@@ -51,6 +51,7 @@ export { default as Info } from './info/Info.mjs';
|
|
|
51
51
|
export { default as InlineAlert } from './inlineAlert/InlineAlert.mjs';
|
|
52
52
|
export { InlinePrompt } from './prompt/InlinePrompt/InlinePrompt.mjs';
|
|
53
53
|
export { ActionPrompt } from './prompt/ActionPrompt/ActionPrompt.mjs';
|
|
54
|
+
export { InfoPrompt } from './prompt/InfoPrompt/InfoPrompt.mjs';
|
|
54
55
|
export { default as InputWithDisplayFormat } from './inputWithDisplayFormat/InputWithDisplayFormat.mjs';
|
|
55
56
|
export { Input } from './inputs/Input.mjs';
|
|
56
57
|
export { InputGroup } from './inputs/InputGroup.mjs';
|
package/build/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -39,6 +39,7 @@ require('../../provider/direction/DirectionProvider.js');
|
|
|
39
39
|
require('../../sentimentSurface/SentimentSurface.js');
|
|
40
40
|
require('../../primitives/PrimitiveButton/PrimitiveButton.js');
|
|
41
41
|
require('../../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
|
|
42
|
+
require('../../link/Link.messages.js');
|
|
42
43
|
|
|
43
44
|
const Prompt = ({
|
|
44
45
|
sentiment: sentiment$1 = sentiment.Sentiment.NEUTRAL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemPrompt.js","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { Sentiment } from '../../common';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\nimport { InlinePrompt, type InlinePromptProps } from '../../prompt';\n\nexport type ListItemPromptProps = Pick<InlinePromptProps, 'children' | 'sentiment' | 'mediaLabel'>;\n\n/**\n * This component allows for rendering an Inline Prompt. <br />\n * In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({\n sentiment = Sentiment.NEUTRAL,\n mediaLabel,\n children,\n}: ListItemPromptProps) => {\n const { ids, props } = useContext<ListItemContextData>(ListItemContext);\n const isLongLivedMuted = props.disabled && Boolean(props.disabledPromptMessage);\n\n return (\n <InlinePrompt\n id={ids.prompt}\n sentiment={sentiment}\n mediaLabel={mediaLabel}\n muted={isLongLivedMuted}\n className=\"wds-list-item-prompt\"\n >\n {isLongLivedMuted ? props.disabledPromptMessage : children}\n </InlinePrompt>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","mediaLabel","children","ids","props","useContext","ListItemContext","isLongLivedMuted","disabled","Boolean","disabledPromptMessage","_jsx","InlinePrompt","id","prompt","muted","className","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItemPrompt.js","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { Sentiment } from '../../common';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\nimport { InlinePrompt, type InlinePromptProps } from '../../prompt';\n\nexport type ListItemPromptProps = Pick<InlinePromptProps, 'children' | 'sentiment' | 'mediaLabel'>;\n\n/**\n * This component allows for rendering an Inline Prompt. <br />\n * In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({\n sentiment = Sentiment.NEUTRAL,\n mediaLabel,\n children,\n}: ListItemPromptProps) => {\n const { ids, props } = useContext<ListItemContextData>(ListItemContext);\n const isLongLivedMuted = props.disabled && Boolean(props.disabledPromptMessage);\n\n return (\n <InlinePrompt\n id={ids.prompt}\n sentiment={sentiment}\n mediaLabel={mediaLabel}\n muted={isLongLivedMuted}\n className=\"wds-list-item-prompt\"\n >\n {isLongLivedMuted ? props.disabledPromptMessage : children}\n </InlinePrompt>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","mediaLabel","children","ids","props","useContext","ListItemContext","isLongLivedMuted","disabled","Boolean","disabledPromptMessage","_jsx","InlinePrompt","id","prompt","muted","className","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAMA,MAAM,GAAGA,CAAC;aACrBC,WAAS,GAAGC,mBAAS,CAACC,OAAO;EAC7BC,UAAU;AACVC,EAAAA;AAAQ,CACY,KAAI;EACxB,MAAM;IAAEC,GAAG;AAAEC,IAAAA;AAAK,GAAE,GAAGC,gBAAU,CAAsBC,+BAAe,CAAC;EACvE,MAAMC,gBAAgB,GAAGH,KAAK,CAACI,QAAQ,IAAIC,OAAO,CAACL,KAAK,CAACM,qBAAqB,CAAC;EAE/E,oBACEC,cAAA,CAACC,yBAAY,EAAA;IACXC,EAAE,EAAEV,GAAG,CAACW,MAAO;AACfhB,IAAAA,SAAS,EAAEA,WAAU;AACrBG,IAAAA,UAAU,EAAEA,UAAW;AACvBc,IAAAA,KAAK,EAAER,gBAAiB;AACxBS,IAAAA,SAAS,EAAC,sBAAsB;AAAAd,IAAAA,QAAA,EAE/BK,gBAAgB,GAAGH,KAAK,CAACM,qBAAqB,GAAGR;AAAQ,GAC9C,CAAC;AAEnB;AAEAL,MAAM,CAACoB,WAAW,GAAG,iBAAiB;;;;;"}
|
|
@@ -35,6 +35,7 @@ import '../../provider/direction/DirectionProvider.mjs';
|
|
|
35
35
|
import '../../sentimentSurface/SentimentSurface.mjs';
|
|
36
36
|
import '../../primitives/PrimitiveButton/PrimitiveButton.mjs';
|
|
37
37
|
import '../../primitives/PrimitiveAnchor/PrimitiveAnchor.mjs';
|
|
38
|
+
import '../../link/Link.messages.mjs';
|
|
38
39
|
|
|
39
40
|
const Prompt = ({
|
|
40
41
|
sentiment = Sentiment.NEUTRAL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemPrompt.mjs","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { Sentiment } from '../../common';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\nimport { InlinePrompt, type InlinePromptProps } from '../../prompt';\n\nexport type ListItemPromptProps = Pick<InlinePromptProps, 'children' | 'sentiment' | 'mediaLabel'>;\n\n/**\n * This component allows for rendering an Inline Prompt. <br />\n * In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({\n sentiment = Sentiment.NEUTRAL,\n mediaLabel,\n children,\n}: ListItemPromptProps) => {\n const { ids, props } = useContext<ListItemContextData>(ListItemContext);\n const isLongLivedMuted = props.disabled && Boolean(props.disabledPromptMessage);\n\n return (\n <InlinePrompt\n id={ids.prompt}\n sentiment={sentiment}\n mediaLabel={mediaLabel}\n muted={isLongLivedMuted}\n className=\"wds-list-item-prompt\"\n >\n {isLongLivedMuted ? props.disabledPromptMessage : children}\n </InlinePrompt>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","mediaLabel","children","ids","props","useContext","ListItemContext","isLongLivedMuted","disabled","Boolean","disabledPromptMessage","_jsx","InlinePrompt","id","prompt","muted","className","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItemPrompt.mjs","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { Sentiment } from '../../common';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\nimport { InlinePrompt, type InlinePromptProps } from '../../prompt';\n\nexport type ListItemPromptProps = Pick<InlinePromptProps, 'children' | 'sentiment' | 'mediaLabel'>;\n\n/**\n * This component allows for rendering an Inline Prompt. <br />\n * In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({\n sentiment = Sentiment.NEUTRAL,\n mediaLabel,\n children,\n}: ListItemPromptProps) => {\n const { ids, props } = useContext<ListItemContextData>(ListItemContext);\n const isLongLivedMuted = props.disabled && Boolean(props.disabledPromptMessage);\n\n return (\n <InlinePrompt\n id={ids.prompt}\n sentiment={sentiment}\n mediaLabel={mediaLabel}\n muted={isLongLivedMuted}\n className=\"wds-list-item-prompt\"\n >\n {isLongLivedMuted ? props.disabledPromptMessage : children}\n </InlinePrompt>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","mediaLabel","children","ids","props","useContext","ListItemContext","isLongLivedMuted","disabled","Boolean","disabledPromptMessage","_jsx","InlinePrompt","id","prompt","muted","className","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAMA,MAAM,GAAGA,CAAC;EACrBC,SAAS,GAAGC,SAAS,CAACC,OAAO;EAC7BC,UAAU;AACVC,EAAAA;AAAQ,CACY,KAAI;EACxB,MAAM;IAAEC,GAAG;AAAEC,IAAAA;AAAK,GAAE,GAAGC,UAAU,CAAsBC,eAAe,CAAC;EACvE,MAAMC,gBAAgB,GAAGH,KAAK,CAACI,QAAQ,IAAIC,OAAO,CAACL,KAAK,CAACM,qBAAqB,CAAC;EAE/E,oBACEC,GAAA,CAACC,YAAY,EAAA;IACXC,EAAE,EAAEV,GAAG,CAACW,MAAO;AACfhB,IAAAA,SAAS,EAAEA,SAAU;AACrBG,IAAAA,UAAU,EAAEA,UAAW;AACvBc,IAAAA,KAAK,EAAER,gBAAiB;AACxBS,IAAAA,SAAS,EAAC,sBAAsB;AAAAd,IAAAA,QAAA,EAE/BK,gBAAgB,GAAGH,KAAK,CAACM,qBAAqB,GAAGR;AAAQ,GAC9C,CAAC;AAEnB;AAEAL,MAAM,CAACoB,WAAW,GAAG,iBAAiB;;;;"}
|
package/build/main.css
CHANGED
|
@@ -5441,6 +5441,37 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5441
5441
|
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
5442
5442
|
stroke: currentColor;
|
|
5443
5443
|
}
|
|
5444
|
+
.wds-info-prompt {
|
|
5445
|
+
--Prompt-gap: var(--size-8);
|
|
5446
|
+
--Prompt-padding: 12px;
|
|
5447
|
+
}
|
|
5448
|
+
.wds-info-prompt__content {
|
|
5449
|
+
display: flex;
|
|
5450
|
+
flex-direction: column;
|
|
5451
|
+
justify-content: center;
|
|
5452
|
+
}
|
|
5453
|
+
.wds-info-prompt__content:has(.wds-info-prompt__title) {
|
|
5454
|
+
justify-content: flex-start;
|
|
5455
|
+
/* Top align when title exists */
|
|
5456
|
+
}
|
|
5457
|
+
.wds-info-prompt__title,
|
|
5458
|
+
.wds-info-prompt__description {
|
|
5459
|
+
display: block;
|
|
5460
|
+
color: var(--color-sentiment-primary);
|
|
5461
|
+
}
|
|
5462
|
+
.wds-info-prompt__action {
|
|
5463
|
+
margin-top: var(--Prompt-gap);
|
|
5464
|
+
}
|
|
5465
|
+
.wds-info-prompt__media {
|
|
5466
|
+
display: flex;
|
|
5467
|
+
}
|
|
5468
|
+
.wds-info-prompt__media svg {
|
|
5469
|
+
width: 24px;
|
|
5470
|
+
height: 24px;
|
|
5471
|
+
}
|
|
5472
|
+
.wds-info-prompt .wds-prompt__media-wrapper {
|
|
5473
|
+
padding: 0;
|
|
5474
|
+
}
|
|
5444
5475
|
.wds-radio-group .np-radio:last-child label {
|
|
5445
5476
|
margin-bottom: 0;
|
|
5446
5477
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
require('../../common/theme.js');
|
|
5
|
+
require('../../common/direction.js');
|
|
6
|
+
require('../../common/propsValues/control.js');
|
|
7
|
+
require('../../common/propsValues/breakpoint.js');
|
|
8
|
+
require('../../common/propsValues/size.js');
|
|
9
|
+
var typography = require('../../common/propsValues/typography.js');
|
|
10
|
+
require('../../common/propsValues/width.js');
|
|
11
|
+
require('../../common/propsValues/type.js');
|
|
12
|
+
require('../../common/propsValues/dateMode.js');
|
|
13
|
+
require('../../common/propsValues/monthFormat.js');
|
|
14
|
+
require('../../common/propsValues/position.js');
|
|
15
|
+
require('../../common/propsValues/layouts.js');
|
|
16
|
+
require('../../common/propsValues/status.js');
|
|
17
|
+
var sentiment = require('../../common/propsValues/sentiment.js');
|
|
18
|
+
require('../../common/propsValues/profileType.js');
|
|
19
|
+
require('../../common/propsValues/variant.js');
|
|
20
|
+
require('../../common/propsValues/scroll.js');
|
|
21
|
+
require('../../common/propsValues/markdownNodeType.js');
|
|
22
|
+
require('../../common/fileType.js');
|
|
23
|
+
var icons = require('@transferwise/icons');
|
|
24
|
+
var clsx = require('clsx');
|
|
25
|
+
require('react-intl');
|
|
26
|
+
require('../../common/closeButton/CloseButton.messages.js');
|
|
27
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
28
|
+
var StatusIcon = require('../../statusIcon/StatusIcon.js');
|
|
29
|
+
var Body = require('../../body/Body.js');
|
|
30
|
+
var Link = require('../../link/Link.js');
|
|
31
|
+
var PrimitivePrompt = require('../PrimitivePrompt/PrimitivePrompt.js');
|
|
32
|
+
|
|
33
|
+
const InfoPrompt = ({
|
|
34
|
+
sentiment: sentiment$1 = 'neutral',
|
|
35
|
+
onDismiss,
|
|
36
|
+
media,
|
|
37
|
+
action,
|
|
38
|
+
title,
|
|
39
|
+
description,
|
|
40
|
+
className,
|
|
41
|
+
'data-testid': dataTestId,
|
|
42
|
+
...restProps
|
|
43
|
+
}) => {
|
|
44
|
+
const [shouldFire, setShouldFire] = React.useState();
|
|
45
|
+
const statusIconSentiment = sentiment$1 === 'success' ? sentiment.Sentiment.POSITIVE : sentiment$1;
|
|
46
|
+
const handleTouchStart = () => {
|
|
47
|
+
setShouldFire(true);
|
|
48
|
+
};
|
|
49
|
+
const handleTouchEnd = () => {
|
|
50
|
+
if (shouldFire && action?.href) {
|
|
51
|
+
if (action.target === '_blank') {
|
|
52
|
+
window.top?.open(action.href, '_blank', 'noopener, noreferrer');
|
|
53
|
+
} else {
|
|
54
|
+
window.top?.location.assign(action.href);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
setShouldFire(false);
|
|
58
|
+
};
|
|
59
|
+
const handleTouchMove = () => {
|
|
60
|
+
setShouldFire(false);
|
|
61
|
+
};
|
|
62
|
+
const renderMedia = () => {
|
|
63
|
+
if (media) {
|
|
64
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
65
|
+
className: "wds-info-prompt__media",
|
|
66
|
+
children: media.asset
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (sentiment$1 === 'proposition') {
|
|
70
|
+
return /*#__PURE__*/jsxRuntime.jsx(icons.GiftBox, {
|
|
71
|
+
size: 24
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return /*#__PURE__*/jsxRuntime.jsx(StatusIcon.default, {
|
|
75
|
+
size: 24,
|
|
76
|
+
sentiment: statusIconSentiment
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
return /*#__PURE__*/jsxRuntime.jsx(PrimitivePrompt.PrimitivePrompt, {
|
|
80
|
+
sentiment: sentiment$1,
|
|
81
|
+
media: renderMedia(),
|
|
82
|
+
"data-testid": dataTestId,
|
|
83
|
+
className: clsx.clsx('wds-info-prompt', className),
|
|
84
|
+
...restProps,
|
|
85
|
+
onTouchStart: handleTouchStart,
|
|
86
|
+
onTouchEnd: handleTouchEnd,
|
|
87
|
+
onTouchMove: handleTouchMove,
|
|
88
|
+
onDismiss: onDismiss,
|
|
89
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
90
|
+
className: "wds-info-prompt__content",
|
|
91
|
+
children: [title && /*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
92
|
+
className: "wds-info-prompt__title",
|
|
93
|
+
type: typography.Typography.BODY_LARGE_BOLD,
|
|
94
|
+
as: "span",
|
|
95
|
+
children: title
|
|
96
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
97
|
+
as: "span",
|
|
98
|
+
className: "wds-info-prompt__description",
|
|
99
|
+
children: description
|
|
100
|
+
}), action && /*#__PURE__*/jsxRuntime.jsx(Link.default, {
|
|
101
|
+
href: action.href,
|
|
102
|
+
target: action.target,
|
|
103
|
+
type: typography.Typography.LINK_DEFAULT,
|
|
104
|
+
className: "wds-info-prompt__action",
|
|
105
|
+
onClick: action.onClick,
|
|
106
|
+
children: action.label
|
|
107
|
+
})]
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
exports.InfoPrompt = InfoPrompt;
|
|
113
|
+
//# sourceMappingURL=InfoPrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoPrompt.js","sources":["../../../src/prompt/InfoPrompt/InfoPrompt.tsx"],"sourcesContent":["import { HTMLAttributes, ReactNode, useState } from 'react';\nimport { Sentiment, Typography } from '../../common';\nimport { GiftBox } from '@transferwise/icons';\nimport type { Sentiment as SurfaceSentiment } from '../../sentimentSurface';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport Link, { LinkProps } from '../../link';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nexport type InfoPromptAction = Pick<LinkProps, 'href' | 'target' | 'onClick'> & {\n /**\n * The label text for the action link\n */\n label: string;\n};\n\nexport type InfoPromptMedia = {\n /**\n * The icon/image asset to display.\n * The asset should include its own accessibility attributes (e.g. title, aria-label)\n * if it conveys meaning, or aria-hidden=\"true\" if decorative.\n */\n asset: ReactNode;\n};\n\nexport type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> &\n Pick<PrimitivePromptProps, 'data-testid'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: SurfaceSentiment;\n /**\n * Handler called when the close button is clicked.\n * If not provided, the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Custom media to override the default status icon.\n * Success and proposition sentiments support 2 status variations: standard checkmark & confetti.\n */\n media?: InfoPromptMedia;\n /**\n * Action link to be displayed below the description\n */\n action?: InfoPromptAction;\n /**\n * Title content for the prompt\n */\n title?: string;\n /**\n * Description text for the prompt (required)\n */\n description: string;\n };\n\n/**\n * InfoPrompt displays important contextual messages to users within a screen.\n * It provides a visually distinct way to communicate information, warnings, errors,\n * or positive feedback with optional actions and dismissal capabilities.\n *\n * Use this component to replace the deprecated Alert component.\n */\nexport const InfoPrompt = ({\n sentiment = 'neutral',\n onDismiss,\n media,\n action,\n title,\n description,\n className,\n 'data-testid': dataTestId,\n ...restProps\n}: InfoPromptProps) => {\n const [shouldFire, setShouldFire] = useState<boolean>();\n const statusIconSentiment =\n sentiment === 'success'\n ? Sentiment.POSITIVE\n : (sentiment as Exclude<SurfaceSentiment, 'proposition'>);\n\n const handleTouchStart = () => {\n setShouldFire(true);\n };\n\n const handleTouchEnd = () => {\n if (shouldFire && action?.href) {\n if (action.target === '_blank') {\n window.top?.open(action.href, '_blank', 'noopener, noreferrer');\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n };\n\n const handleTouchMove = () => {\n setShouldFire(false);\n };\n\n const renderMedia = () => {\n if (media) {\n return <span className=\"wds-info-prompt__media\">{media.asset}</span>;\n }\n\n if (sentiment === 'proposition') {\n return <GiftBox size={24} />;\n }\n\n return <StatusIcon size={24} sentiment={statusIconSentiment} />;\n };\n\n return (\n <PrimitivePrompt\n sentiment={sentiment}\n media={renderMedia()}\n data-testid={dataTestId}\n className={clsx('wds-info-prompt', className)}\n {...restProps}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onDismiss={onDismiss}\n >\n <div className=\"wds-info-prompt__content\">\n {title && (\n <Body className=\"wds-info-prompt__title\" type={Typography.BODY_LARGE_BOLD} as=\"span\">\n {title}\n </Body>\n )}\n <Body as=\"span\" className=\"wds-info-prompt__description\">\n {description}\n </Body>\n {action && (\n <Link\n href={action.href}\n target={action.target}\n type={Typography.LINK_DEFAULT}\n className=\"wds-info-prompt__action\"\n onClick={action.onClick}\n >\n {action.label}\n </Link>\n )}\n </div>\n </PrimitivePrompt>\n );\n};\n"],"names":["InfoPrompt","sentiment","onDismiss","media","action","title","description","className","dataTestId","restProps","shouldFire","setShouldFire","useState","statusIconSentiment","Sentiment","POSITIVE","handleTouchStart","handleTouchEnd","href","target","window","top","open","location","assign","handleTouchMove","renderMedia","_jsx","children","asset","GiftBox","size","StatusIcon","PrimitivePrompt","clsx","onTouchStart","onTouchEnd","onTouchMove","_jsxs","Body","type","Typography","BODY_LARGE_BOLD","as","Link","LINK_DEFAULT","onClick","label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEO,MAAMA,UAAU,GAAGA,CAAC;AACzBC,aAAAA,WAAS,GAAG,SAAS;EACrBC,SAAS;EACTC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,WAAW;EACXC,SAAS;AACT,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAS,CACI,KAAI;EACpB,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,cAAQ,EAAW;EACvD,MAAMC,mBAAmB,GACvBZ,WAAS,KAAK,SAAS,GACnBa,mBAAS,CAACC,QAAQ,GACjBd,WAAsD;EAE7D,MAAMe,gBAAgB,GAAGA,MAAK;IAC5BL,aAAa,CAAC,IAAI,CAAC;EACrB,CAAC;EAED,MAAMM,cAAc,GAAGA,MAAK;AAC1B,IAAA,IAAIP,UAAU,IAAIN,MAAM,EAAEc,IAAI,EAAE;AAC9B,MAAA,IAAId,MAAM,CAACe,MAAM,KAAK,QAAQ,EAAE;AAC9BC,QAAAA,MAAM,CAACC,GAAG,EAAEC,IAAI,CAAClB,MAAM,CAACc,IAAI,EAAE,QAAQ,EAAE,sBAAsB,CAAC;AACjE,MAAA,CAAC,MAAM;QACLE,MAAM,CAACC,GAAG,EAAEE,QAAQ,CAACC,MAAM,CAACpB,MAAM,CAACc,IAAI,CAAC;AAC1C,MAAA;AACF,IAAA;IACAP,aAAa,CAAC,KAAK,CAAC;EACtB,CAAC;EAED,MAA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F,CACP,eACDsB,cAAA,CAACY,YAAI,EAAA;AAACI,QAAAA,EAAE,EAAC,MAAM;AAACpC,QAAAA,SAAS,EAAC,8BAA8B;AAAAqB,QAAAA,QAAA,EACrDtB;AAAW,OACR,CACN,EAACF,MAAM,iBACLuB,cAAA,CAACiB,YAAI,EAAA;QACH1B,IAAI,EAAEd,MAAM,CAACc,IAAK;QAClBC,MAAM,EAAEf,MAAM,CAACe,MAAO;QACtBqB,IAAI,EAAEC,qBAAU,CAACI,YAAa;AAC9BtC,QAAAA,SAAS,EAAC,yBAAyB;QACnCuC,OAAO,EAAE1C,MAAM,CAAC0C,OAAQ;QAAAlB,QAAA,EAEvBxB,MAAM,CAAC2C;AAAK,OACT,CACP;KACE;AACP,GAAiB,CAAC;AAEtB;;;;"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import '../../common/theme.mjs';
|
|
3
|
+
import '../../common/direction.mjs';
|
|
4
|
+
import '../../common/propsValues/control.mjs';
|
|
5
|
+
import '../../common/propsValues/breakpoint.mjs';
|
|
6
|
+
import '../../common/propsValues/size.mjs';
|
|
7
|
+
import { Typography } from '../../common/propsValues/typography.mjs';
|
|
8
|
+
import '../../common/propsValues/width.mjs';
|
|
9
|
+
import '../../common/propsValues/type.mjs';
|
|
10
|
+
import '../../common/propsValues/dateMode.mjs';
|
|
11
|
+
import '../../common/propsValues/monthFormat.mjs';
|
|
12
|
+
import '../../common/propsValues/position.mjs';
|
|
13
|
+
import '../../common/propsValues/layouts.mjs';
|
|
14
|
+
import '../../common/propsValues/status.mjs';
|
|
15
|
+
import { Sentiment } from '../../common/propsValues/sentiment.mjs';
|
|
16
|
+
import '../../common/propsValues/profileType.mjs';
|
|
17
|
+
import '../../common/propsValues/variant.mjs';
|
|
18
|
+
import '../../common/propsValues/scroll.mjs';
|
|
19
|
+
import '../../common/propsValues/markdownNodeType.mjs';
|
|
20
|
+
import '../../common/fileType.mjs';
|
|
21
|
+
import { GiftBox } from '@transferwise/icons';
|
|
22
|
+
import { clsx } from 'clsx';
|
|
23
|
+
import 'react-intl';
|
|
24
|
+
import '../../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
26
|
+
import StatusIcon from '../../statusIcon/StatusIcon.mjs';
|
|
27
|
+
import Body from '../../body/Body.mjs';
|
|
28
|
+
import Link from '../../link/Link.mjs';
|
|
29
|
+
import { PrimitivePrompt } from '../PrimitivePrompt/PrimitivePrompt.mjs';
|
|
30
|
+
|
|
31
|
+
const InfoPrompt = ({
|
|
32
|
+
sentiment = 'neutral',
|
|
33
|
+
onDismiss,
|
|
34
|
+
media,
|
|
35
|
+
action,
|
|
36
|
+
title,
|
|
37
|
+
description,
|
|
38
|
+
className,
|
|
39
|
+
'data-testid': dataTestId,
|
|
40
|
+
...restProps
|
|
41
|
+
}) => {
|
|
42
|
+
const [shouldFire, setShouldFire] = useState();
|
|
43
|
+
const statusIconSentiment = sentiment === 'success' ? Sentiment.POSITIVE : sentiment;
|
|
44
|
+
const handleTouchStart = () => {
|
|
45
|
+
setShouldFire(true);
|
|
46
|
+
};
|
|
47
|
+
const handleTouchEnd = () => {
|
|
48
|
+
if (shouldFire && action?.href) {
|
|
49
|
+
if (action.target === '_blank') {
|
|
50
|
+
window.top?.open(action.href, '_blank', 'noopener, noreferrer');
|
|
51
|
+
} else {
|
|
52
|
+
window.top?.location.assign(action.href);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
setShouldFire(false);
|
|
56
|
+
};
|
|
57
|
+
const handleTouchMove = () => {
|
|
58
|
+
setShouldFire(false);
|
|
59
|
+
};
|
|
60
|
+
const renderMedia = () => {
|
|
61
|
+
if (media) {
|
|
62
|
+
return /*#__PURE__*/jsx("span", {
|
|
63
|
+
className: "wds-info-prompt__media",
|
|
64
|
+
children: media.asset
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (sentiment === 'proposition') {
|
|
68
|
+
return /*#__PURE__*/jsx(GiftBox, {
|
|
69
|
+
size: 24
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return /*#__PURE__*/jsx(StatusIcon, {
|
|
73
|
+
size: 24,
|
|
74
|
+
sentiment: statusIconSentiment
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
return /*#__PURE__*/jsx(PrimitivePrompt, {
|
|
78
|
+
sentiment: sentiment,
|
|
79
|
+
media: renderMedia(),
|
|
80
|
+
"data-testid": dataTestId,
|
|
81
|
+
className: clsx('wds-info-prompt', className),
|
|
82
|
+
...restProps,
|
|
83
|
+
onTouchStart: handleTouchStart,
|
|
84
|
+
onTouchEnd: handleTouchEnd,
|
|
85
|
+
onTouchMove: handleTouchMove,
|
|
86
|
+
onDismiss: onDismiss,
|
|
87
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
88
|
+
className: "wds-info-prompt__content",
|
|
89
|
+
children: [title && /*#__PURE__*/jsx(Body, {
|
|
90
|
+
className: "wds-info-prompt__title",
|
|
91
|
+
type: Typography.BODY_LARGE_BOLD,
|
|
92
|
+
as: "span",
|
|
93
|
+
children: title
|
|
94
|
+
}), /*#__PURE__*/jsx(Body, {
|
|
95
|
+
as: "span",
|
|
96
|
+
className: "wds-info-prompt__description",
|
|
97
|
+
children: description
|
|
98
|
+
}), action && /*#__PURE__*/jsx(Link, {
|
|
99
|
+
href: action.href,
|
|
100
|
+
target: action.target,
|
|
101
|
+
type: Typography.LINK_DEFAULT,
|
|
102
|
+
className: "wds-info-prompt__action",
|
|
103
|
+
onClick: action.onClick,
|
|
104
|
+
children: action.label
|
|
105
|
+
})]
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export { InfoPrompt };
|
|
111
|
+
//# sourceMappingURL=InfoPrompt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoPrompt.mjs","sources":["../../../src/prompt/InfoPrompt/InfoPrompt.tsx"],"sourcesContent":["import { HTMLAttributes, ReactNode, useState } from 'react';\nimport { Sentiment, Typography } from '../../common';\nimport { GiftBox } from '@transferwise/icons';\nimport type { Sentiment as SurfaceSentiment } from '../../sentimentSurface';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport Link, { LinkProps } from '../../link';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nexport type InfoPromptAction = Pick<LinkProps, 'href' | 'target' | 'onClick'> & {\n /**\n * The label text for the action link\n */\n label: string;\n};\n\nexport type InfoPromptMedia = {\n /**\n * The icon/image asset to display.\n * The asset should include its own accessibility attributes (e.g. title, aria-label)\n * if it conveys meaning, or aria-hidden=\"true\" if decorative.\n */\n asset: ReactNode;\n};\n\nexport type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> &\n Pick<PrimitivePromptProps, 'data-testid'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: SurfaceSentiment;\n /**\n * Handler called when the close button is clicked.\n * If not provided, the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Custom media to override the default status icon.\n * Success and proposition sentiments support 2 status variations: standard checkmark & confetti.\n */\n media?: InfoPromptMedia;\n /**\n * Action link to be displayed below the description\n */\n action?: InfoPromptAction;\n /**\n * Title content for the prompt\n */\n title?: string;\n /**\n * Description text for the prompt (required)\n */\n description: string;\n };\n\n/**\n * InfoPrompt displays important contextual messages to users within a screen.\n * It provides a visually distinct way to communicate information, warnings, errors,\n * or positive feedback with optional actions and dismissal capabilities.\n *\n * Use this component to replace the deprecated Alert component.\n */\nexport const InfoPrompt = ({\n sentiment = 'neutral',\n onDismiss,\n media,\n action,\n title,\n description,\n className,\n 'data-testid': dataTestId,\n ...restProps\n}: InfoPromptProps) => {\n const [shouldFire, setShouldFire] = useState<boolean>();\n const statusIconSentiment =\n sentiment === 'success'\n ? Sentiment.POSITIVE\n : (sentiment as Exclude<SurfaceSentiment, 'proposition'>);\n\n const handleTouchStart = () => {\n setShouldFire(true);\n };\n\n const handleTouchEnd = () => {\n if (shouldFire && action?.href) {\n if (action.target === '_blank') {\n window.top?.open(action.href, '_blank', 'noopener, noreferrer');\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n };\n\n const handleTouchMove = () => {\n setShouldFire(false);\n };\n\n const renderMedia = () => {\n if (media) {\n return <span className=\"wds-info-prompt__media\">{media.asset}</span>;\n }\n\n if (sentiment === 'proposition') {\n return <GiftBox size={24} />;\n }\n\n return <StatusIcon size={24} sentiment={statusIconSentiment} />;\n };\n\n return (\n <PrimitivePrompt\n sentiment={sentiment}\n media={renderMedia()}\n data-testid={dataTestId}\n className={clsx('wds-info-prompt', className)}\n {...restProps}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onDismiss={onDismiss}\n >\n <div className=\"wds-info-prompt__content\">\n {title && (\n <Body className=\"wds-info-prompt__title\" type={Typography.BODY_LARGE_BOLD} as=\"span\">\n {title}\n </Body>\n )}\n <Body as=\"span\" className=\"wds-info-prompt__description\">\n {description}\n </Body>\n {action && (\n <Link\n href={action.href}\n target={action.target}\n type={Typography.LINK_DEFAULT}\n className=\"wds-info-prompt__action\"\n onClick={action.onClick}\n >\n {action.label}\n </Link>\n )}\n </div>\n </PrimitivePrompt>\n );\n};\n"],"names":["InfoPrompt","sentiment","onDismiss","media","action","title","description","className","dataTestId","restProps","shouldFire","setShouldFire","useState","statusIconSentiment","Sentiment","POSITIVE","handleTouchStart","handleTouchEnd","href","target","window","top","open","location","assign","handleTouchMove","renderMedia","_jsx","children","asset","GiftBox","size","StatusIcon","PrimitivePrompt","clsx","onTouchStart","onTouchEnd","onTouchMove","_jsxs","Body","type","Typography","BODY_LARGE_BOLD","as","Link","LINK_DEFAULT","onClick","label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEO,MAAMA,UAAU,GAAGA,CAAC;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QAAA,EAEvBxB,MAAM,CAAC2C;AAAK,OACT,CACP;KACE;AACP,GAAiB,CAAC;AAEtB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.js","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { ReactNode } from 'react';\n\nexport type PrimitivePromptProps = {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.js","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = ({\n sentiment = 'success',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n}: PrimitivePromptProps) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n sentiment={sentiment}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n};\n"],"names":["PrimitivePrompt","sentiment","media","actions","onDismiss","className","children","restProps","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross"],"mappings":";;;;;;;;;;AAmCO,MAAMA,eAAe,GAAGA,CAAC;AAC9BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACS,KAAI;AACzB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EAEtB,oBACEC,cAAA,CAACC,wBAAgB,EAAA;AACfV,IAAAA,SAAS,EAAEA,SAAU;IACrBI,SAAS,EAAEO,SAAI,CAAC,YAAY,EAAE,eAAeX,SAAS,CAAA,CAAE,EAAEI,SAAS,CAAE;AAAA,IAAA,GACjEE,SAAS;AAAAD,IAAAA,QAAA,eAEbO,eAAA,CAAA,KAAA,EAAA;AACER,MAAAA,SAAS,EAAEO,SAAI,CAAC,6BAA6B,EAAE;QAC7C,2CAA2C,EAAE,CAAC,CAACR;AAChD,OAAA,CAAE;AAAAE,MAAAA,QAAA,gBAEHI,cAAA,CAAA,KAAA,EAAA;AAAKL,QAAAA,SAAS,EAAEO,SAAI,CAAC,2BAA2B,CAAE;AAAAN,QAAAA,QAAA,EAAEJ;OAAW,CAC/D,EAACI,QAAQ,EACRF,SAAS,iBACRM,cAAA,CAACI,kBAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,WAAW;AACpB,QAAA,YAAA,EAAYR,IAAI,CAACS,aAAa,CAACC,4BAAgB,CAACC,SAAS,CAAE;AAC3DC,QAAAA,OAAO,EAAEhB,SAAU;AAAAE,QAAAA,QAAA,eAEnBI,cAAA,CAACW,WAAK,EAAA,EAAA;AACR,OAAY,CACb,EACAlB,OAAO,iBAAIO,cAAA,CAAA,KAAA,EAAA;AAAKL,QAAAA,SAAS,EAAC,6BAA6B;AAAAC,QAAAA,QAAA,EAAEH;AAAO,OAAM,CAAC;KACrE;AACP,GAAkB,CAAC;AAEvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { ReactNode } from 'react';\n\nexport type PrimitivePromptProps = {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = ({\n sentiment = 'success',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n}: PrimitivePromptProps) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n sentiment={sentiment}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n};\n"],"names":["PrimitivePrompt","sentiment","media","actions","onDismiss","className","children","restProps","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconBut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/build/styles/main.css
CHANGED
|
@@ -5441,6 +5441,37 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5441
5441
|
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
5442
5442
|
stroke: currentColor;
|
|
5443
5443
|
}
|
|
5444
|
+
.wds-info-prompt {
|
|
5445
|
+
--Prompt-gap: var(--size-8);
|
|
5446
|
+
--Prompt-padding: 12px;
|
|
5447
|
+
}
|
|
5448
|
+
.wds-info-prompt__content {
|
|
5449
|
+
display: flex;
|
|
5450
|
+
flex-direction: column;
|
|
5451
|
+
justify-content: center;
|
|
5452
|
+
}
|
|
5453
|
+
.wds-info-prompt__content:has(.wds-info-prompt__title) {
|
|
5454
|
+
justify-content: flex-start;
|
|
5455
|
+
/* Top align when title exists */
|
|
5456
|
+
}
|
|
5457
|
+
.wds-info-prompt__title,
|
|
5458
|
+
.wds-info-prompt__description {
|
|
5459
|
+
display: block;
|
|
5460
|
+
color: var(--color-sentiment-primary);
|
|
5461
|
+
}
|
|
5462
|
+
.wds-info-prompt__action {
|
|
5463
|
+
margin-top: var(--Prompt-gap);
|
|
5464
|
+
}
|
|
5465
|
+
.wds-info-prompt__media {
|
|
5466
|
+
display: flex;
|
|
5467
|
+
}
|
|
5468
|
+
.wds-info-prompt__media svg {
|
|
5469
|
+
width: 24px;
|
|
5470
|
+
height: 24px;
|
|
5471
|
+
}
|
|
5472
|
+
.wds-info-prompt .wds-prompt__media-wrapper {
|
|
5473
|
+
padding: 0;
|
|
5474
|
+
}
|
|
5444
5475
|
.wds-radio-group .np-radio:last-child label {
|
|
5445
5476
|
margin-bottom: 0;
|
|
5446
5477
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.wds-info-prompt {
|
|
2
|
+
--Prompt-gap: var(--size-8);
|
|
3
|
+
--Prompt-padding: 12px;
|
|
4
|
+
}
|
|
5
|
+
.wds-info-prompt__content {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
}
|
|
10
|
+
.wds-info-prompt__content:has(.wds-info-prompt__title) {
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
/* Top align when title exists */
|
|
13
|
+
}
|
|
14
|
+
.wds-info-prompt__title,
|
|
15
|
+
.wds-info-prompt__description {
|
|
16
|
+
display: block;
|
|
17
|
+
color: var(--color-sentiment-primary);
|
|
18
|
+
}
|
|
19
|
+
.wds-info-prompt__action {
|
|
20
|
+
margin-top: var(--Prompt-gap);
|
|
21
|
+
}
|
|
22
|
+
.wds-info-prompt__media {
|
|
23
|
+
display: flex;
|
|
24
|
+
}
|
|
25
|
+
.wds-info-prompt__media svg {
|
|
26
|
+
width: 24px;
|
|
27
|
+
height: 24px;
|
|
28
|
+
}
|
|
29
|
+
.wds-info-prompt .wds-prompt__media-wrapper {
|
|
30
|
+
padding: 0;
|
|
31
|
+
}
|
|
@@ -42,6 +42,7 @@ require('../provider/direction/DirectionProvider.js');
|
|
|
42
42
|
require('../sentimentSurface/SentimentSurface.js');
|
|
43
43
|
require('../primitives/PrimitiveButton/PrimitiveButton.js');
|
|
44
44
|
require('../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
|
|
45
|
+
require('../link/Link.messages.js');
|
|
45
46
|
var contexts = require('../inputs/contexts.js');
|
|
46
47
|
var TypeaheadInput = require('./typeaheadInput/TypeaheadInput.js');
|
|
47
48
|
var TypeaheadOption = require('./typeaheadOption/TypeaheadOption.js');
|