@transferwise/components 46.71.5 → 46.71.7

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.
@@ -16,7 +16,7 @@ const ActionButton = /*#__PURE__*/React.forwardRef(({
16
16
  }, reference) => /*#__PURE__*/jsxRuntime.jsx("button", {
17
17
  ref: reference,
18
18
  type: "button",
19
- className: clsx.clsx('np-action-btn', 'np-text-body-default-bold', priority === control.Priority.SECONDARY ? 'btn-priority-2' : 'btn-priority-1', className),
19
+ className: clsx.clsx('np-action-btn', 'np-text-body-default-bold', priority === control.Priority.TERTIARY ? 'btn-priority-3' : priority === control.Priority.SECONDARY ? 'btn-priority-2' : 'btn-priority-1', className),
20
20
  disabled: disabled,
21
21
  onClick: onClick,
22
22
  ...rest,
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButton.js","sources":["../../src/actionButton/ActionButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ButtonHTMLAttributes, forwardRef } from 'react';\n\nimport { Priority, PriorityPrimary, PrioritySecondary } from '../common';\n\nexport type ActionButtonProps = {\n priority?: PriorityPrimary | PrioritySecondary;\n /**\n * @deprecated use `children` instead\n */\n text?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\nconst ActionButton = forwardRef<HTMLButtonElement, ActionButtonProps>(\n (\n {\n disabled = false,\n className = undefined,\n onClick,\n priority = Priority.PRIMARY,\n text,\n children,\n ...rest\n }: ActionButtonProps,\n reference,\n ) => (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-action-btn',\n 'np-text-body-default-bold',\n priority === Priority.SECONDARY ? 'btn-priority-2' : 'btn-priority-1',\n className,\n )}\n disabled={disabled}\n onClick={onClick}\n {...rest}\n >\n {children || text}\n </button>\n ),\n);\n\nexport default ActionButton;\n"],"names":["ActionButton","forwardRef","disabled","className","undefined","onClick","priority","Priority","PRIMARY","text","children","rest","reference","_jsx","ref","type","clsx","SECONDARY"],"mappings":";;;;;;;AAaA,MAAMA,YAAY,gBAAGC,gBAAU,CAC7B,CACE;AACEC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;EACPC,QAAQ,GAAGC,gBAAQ,CAACC,OAAO;EAC3BC,IAAI;EACJC,QAAQ;EACR,GAAGC,IAAAA;AACe,CAAA,EACpBC,SAAS,kBAETC,cAAA,CAAA,QAAA,EAAA;AACEC,EAAAA,GAAG,EAAEF,SAAU;AACfG,EAAAA,IAAI,EAAC,QAAQ;AACbZ,EAAAA,SAAS,EAAEa,SAAI,CACb,eAAe,EACf,2BAA2B,EAC3BV,QAAQ,KAAKC,gBAAQ,CAACU,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,EACrEd,SAAS,CACT;AACFD,EAAAA,QAAQ,EAAEA,QAAS;AACnBG,EAAAA,OAAO,EAAEA,OAAQ;AAAA,EAAA,GACbM,IAAI;EAAAD,QAAA,EAEPA,QAAQ,IAAID,IAAAA;AAAI,CACX,CACT;;;;"}
1
+ {"version":3,"file":"ActionButton.js","sources":["../../src/actionButton/ActionButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ButtonHTMLAttributes, forwardRef } from 'react';\n\nimport { Priority, PriorityPrimary, PrioritySecondary, PriorityTertiary } from '../common';\n\nexport type ActionButtonProps = {\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;\n /**\n * @deprecated use `children` instead\n */\n text?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\nconst ActionButton = forwardRef<HTMLButtonElement, ActionButtonProps>(\n (\n {\n disabled = false,\n className = undefined,\n onClick,\n priority = Priority.PRIMARY,\n text,\n children,\n ...rest\n }: ActionButtonProps,\n reference,\n ) => (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-action-btn',\n 'np-text-body-default-bold',\n priority === Priority.TERTIARY\n ? 'btn-priority-3'\n : priority === Priority.SECONDARY\n ? 'btn-priority-2'\n : 'btn-priority-1',\n className,\n )}\n disabled={disabled}\n onClick={onClick}\n {...rest}\n >\n {children || text}\n </button>\n ),\n);\n\nexport default ActionButton;\n"],"names":["ActionButton","forwardRef","disabled","className","undefined","onClick","priority","Priority","PRIMARY","text","children","rest","reference","_jsx","ref","type","clsx","TERTIARY","SECONDARY"],"mappings":";;;;;;;AAaA,MAAMA,YAAY,gBAAGC,gBAAU,CAC7B,CACE;AACEC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;EACPC,QAAQ,GAAGC,gBAAQ,CAACC,OAAO;EAC3BC,IAAI;EACJC,QAAQ;EACR,GAAGC,IAAAA;AACe,CAAA,EACpBC,SAAS,kBAETC,cAAA,CAAA,QAAA,EAAA;AACEC,EAAAA,GAAG,EAAEF,SAAU;AACfG,EAAAA,IAAI,EAAC,QAAQ;EACbZ,SAAS,EAAEa,SAAI,CACb,eAAe,EACf,2BAA2B,EAC3BV,QAAQ,KAAKC,gBAAQ,CAACU,QAAQ,GAC1B,gBAAgB,GAChBX,QAAQ,KAAKC,gBAAQ,CAACW,SAAS,GAC7B,gBAAgB,GAChB,gBAAgB,EACtBf,SAAS,CACT;AACFD,EAAAA,QAAQ,EAAEA,QAAS;AACnBG,EAAAA,OAAO,EAAEA,OAAQ;AAAA,EAAA,GACbM,IAAI;EAAAD,QAAA,EAEPA,QAAQ,IAAID,IAAAA;AAAI,CACX,CACT;;;;"}
@@ -14,7 +14,7 @@ const ActionButton = /*#__PURE__*/forwardRef(({
14
14
  }, reference) => /*#__PURE__*/jsx("button", {
15
15
  ref: reference,
16
16
  type: "button",
17
- className: clsx('np-action-btn', 'np-text-body-default-bold', priority === Priority.SECONDARY ? 'btn-priority-2' : 'btn-priority-1', className),
17
+ className: clsx('np-action-btn', 'np-text-body-default-bold', priority === Priority.TERTIARY ? 'btn-priority-3' : priority === Priority.SECONDARY ? 'btn-priority-2' : 'btn-priority-1', className),
18
18
  disabled: disabled,
19
19
  onClick: onClick,
20
20
  ...rest,
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButton.mjs","sources":["../../src/actionButton/ActionButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ButtonHTMLAttributes, forwardRef } from 'react';\n\nimport { Priority, PriorityPrimary, PrioritySecondary } from '../common';\n\nexport type ActionButtonProps = {\n priority?: PriorityPrimary | PrioritySecondary;\n /**\n * @deprecated use `children` instead\n */\n text?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\nconst ActionButton = forwardRef<HTMLButtonElement, ActionButtonProps>(\n (\n {\n disabled = false,\n className = undefined,\n onClick,\n priority = Priority.PRIMARY,\n text,\n children,\n ...rest\n }: ActionButtonProps,\n reference,\n ) => (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-action-btn',\n 'np-text-body-default-bold',\n priority === Priority.SECONDARY ? 'btn-priority-2' : 'btn-priority-1',\n className,\n )}\n disabled={disabled}\n onClick={onClick}\n {...rest}\n >\n {children || text}\n </button>\n ),\n);\n\nexport default ActionButton;\n"],"names":["ActionButton","forwardRef","disabled","className","undefined","onClick","priority","Priority","PRIMARY","text","children","rest","reference","_jsx","ref","type","clsx","SECONDARY"],"mappings":";;;;;AAaA,MAAMA,YAAY,gBAAGC,UAAU,CAC7B,CACE;AACEC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;EACPC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,IAAI;EACJC,QAAQ;EACR,GAAGC,IAAAA;AACe,CAAA,EACpBC,SAAS,kBAETC,GAAA,CAAA,QAAA,EAAA;AACEC,EAAAA,GAAG,EAAEF,SAAU;AACfG,EAAAA,IAAI,EAAC,QAAQ;AACbZ,EAAAA,SAAS,EAAEa,IAAI,CACb,eAAe,EACf,2BAA2B,EAC3BV,QAAQ,KAAKC,QAAQ,CAACU,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,EACrEd,SAAS,CACT;AACFD,EAAAA,QAAQ,EAAEA,QAAS;AACnBG,EAAAA,OAAO,EAAEA,OAAQ;AAAA,EAAA,GACbM,IAAI;EAAAD,QAAA,EAEPA,QAAQ,IAAID,IAAAA;AAAI,CACX,CACT;;;;"}
1
+ {"version":3,"file":"ActionButton.mjs","sources":["../../src/actionButton/ActionButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ButtonHTMLAttributes, forwardRef } from 'react';\n\nimport { Priority, PriorityPrimary, PrioritySecondary, PriorityTertiary } from '../common';\n\nexport type ActionButtonProps = {\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;\n /**\n * @deprecated use `children` instead\n */\n text?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\nconst ActionButton = forwardRef<HTMLButtonElement, ActionButtonProps>(\n (\n {\n disabled = false,\n className = undefined,\n onClick,\n priority = Priority.PRIMARY,\n text,\n children,\n ...rest\n }: ActionButtonProps,\n reference,\n ) => (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-action-btn',\n 'np-text-body-default-bold',\n priority === Priority.TERTIARY\n ? 'btn-priority-3'\n : priority === Priority.SECONDARY\n ? 'btn-priority-2'\n : 'btn-priority-1',\n className,\n )}\n disabled={disabled}\n onClick={onClick}\n {...rest}\n >\n {children || text}\n </button>\n ),\n);\n\nexport default ActionButton;\n"],"names":["ActionButton","forwardRef","disabled","className","undefined","onClick","priority","Priority","PRIMARY","text","children","rest","reference","_jsx","ref","type","clsx","TERTIARY","SECONDARY"],"mappings":";;;;;AAaA,MAAMA,YAAY,gBAAGC,UAAU,CAC7B,CACE;AACEC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;EACPC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,IAAI;EACJC,QAAQ;EACR,GAAGC,IAAAA;AACe,CAAA,EACpBC,SAAS,kBAETC,GAAA,CAAA,QAAA,EAAA;AACEC,EAAAA,GAAG,EAAEF,SAAU;AACfG,EAAAA,IAAI,EAAC,QAAQ;EACbZ,SAAS,EAAEa,IAAI,CACb,eAAe,EACf,2BAA2B,EAC3BV,QAAQ,KAAKC,QAAQ,CAACU,QAAQ,GAC1B,gBAAgB,GAChBX,QAAQ,KAAKC,QAAQ,CAACW,SAAS,GAC7B,gBAAgB,GAChB,gBAAgB,EACtBf,SAAS,CACT;AACFD,EAAAA,QAAQ,EAAEA,QAAS;AACnBG,EAAAA,OAAO,EAAEA,OAAQ;AAAA,EAAA,GACbM,IAAI;EAAAD,QAAA,EAEPA,QAAQ,IAAID,IAAAA;AAAI,CACX,CACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionOption.js","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport ActionButton from '../actionButton';\nimport { CommonProps, Priority, PriorityPrimary, PrioritySecondary } from '../common';\nimport Option from '../common/Option';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n action: React.ReactNode;\n priority?: PriorityPrimary | PrioritySecondary;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps;\n\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n const labels: string[] = [];\n\n if (typeof title === 'string') {\n labels.push(title);\n }\n\n if (typeof action === 'string') {\n labels.push(action);\n }\n\n return labels.join(', ') || undefined;\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <ActionButton\n priority={priority}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </ActionButton>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","sharedProps","clsx","getAriaLabel","labels","push","join","undefined","_jsx","Option","button","ActionButton","children"],"mappings":";;;;;;;;AAqBMA,MAAAA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,gBAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,OAAO;EACPC,SAAS;EACTC,mBAAmB;EACnBC,eAAe;EACfC,kBAAkB;AAClBC,EAAAA,EAAAA;AAAE,CACgB,KAAI;AACtB,EAAA,MAAMC,WAAW,GAAG;IAClBT,KAAK;IACLC,KAAK;IACLC,OAAO;IACPC,OAAO;IACPL,QAAQ;IACRO,mBAAmB;IACnBC,eAAe;AACfF,IAAAA,SAAS,EAAEM,SAAI,CAAC,kBAAkB,EAAEN,SAAS,CAAC;IAC9CG,kBAAkB;AAClBC,IAAAA,EAAAA;GACD,CAAA;EAED,MAAMG,YAAY,GAAGA,MAAyB;IAC5C,MAAMC,MAAM,GAAa,EAAE,CAAA;AAE3B,IAAA,IAAI,OAAOX,KAAK,KAAK,QAAQ,EAAE;AAC7BW,MAAAA,MAAM,CAACC,IAAI,CAACZ,KAAK,CAAC,CAAA;AACpB,KAAA;AAEA,IAAA,IAAI,OAAOP,MAAM,KAAK,QAAQ,EAAE;AAC9BkB,MAAAA,MAAM,CAACC,IAAI,CAACnB,MAAM,CAAC,CAAA;AACrB,KAAA;AAEA,IAAA,OAAOkB,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC,IAAIC,SAAS,CAAA;GACtC,CAAA;EAED,oBACEC,cAAA,CAACC,MAAM,EAAA;AAAA,IAAA,GACDR,WAAW;IACfS,MAAM,eACJF,cAAA,CAACG,YAAY,EAAA;AACXxB,MAAAA,QAAQ,EAAEA,QAAS;AACnBG,MAAAA,QAAQ,EAAEA,QAAS;MACnB,YAAYa,EAAAA,YAAY,EAAG;AAC3BZ,MAAAA,OAAO,EAAEA,OAAQ;AAAAqB,MAAAA,QAAA,EAEhB1B,MAAAA;KACW,CAAA;AACf,GAAA,CACD,CAAA;AAEN;;;;"}
1
+ {"version":3,"file":"ActionOption.js","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport ActionButton from '../actionButton';\nimport {\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n action: React.ReactNode;\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps;\n\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n const labels: string[] = [];\n\n if (typeof title === 'string') {\n labels.push(title);\n }\n\n if (typeof action === 'string') {\n labels.push(action);\n }\n\n return labels.join(', ') || undefined;\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <ActionButton\n priority={priority}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </ActionButton>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","sharedProps","clsx","getAriaLabel","labels","push","join","undefined","_jsx","Option","button","ActionButton","children"],"mappings":";;;;;;;;AA2BMA,MAAAA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,gBAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,OAAO;EACPC,SAAS;EACTC,mBAAmB;EACnBC,eAAe;EACfC,kBAAkB;AAClBC,EAAAA,EAAAA;AAAE,CACgB,KAAI;AACtB,EAAA,MAAMC,WAAW,GAAG;IAClBT,KAAK;IACLC,KAAK;IACLC,OAAO;IACPC,OAAO;IACPL,QAAQ;IACRO,mBAAmB;IACnBC,eAAe;AACfF,IAAAA,SAAS,EAAEM,SAAI,CAAC,kBAAkB,EAAEN,SAAS,CAAC;IAC9CG,kBAAkB;AAClBC,IAAAA,EAAAA;GACD,CAAA;EAED,MAAMG,YAAY,GAAGA,MAAyB;IAC5C,MAAMC,MAAM,GAAa,EAAE,CAAA;AAE3B,IAAA,IAAI,OAAOX,KAAK,KAAK,QAAQ,EAAE;AAC7BW,MAAAA,MAAM,CAACC,IAAI,CAACZ,KAAK,CAAC,CAAA;AACpB,KAAA;AAEA,IAAA,IAAI,OAAOP,MAAM,KAAK,QAAQ,EAAE;AAC9BkB,MAAAA,MAAM,CAACC,IAAI,CAACnB,MAAM,CAAC,CAAA;AACrB,KAAA;AAEA,IAAA,OAAOkB,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC,IAAIC,SAAS,CAAA;GACtC,CAAA;EAED,oBACEC,cAAA,CAACC,MAAM,EAAA;AAAA,IAAA,GACDR,WAAW;IACfS,MAAM,eACJF,cAAA,CAACG,YAAY,EAAA;AACXxB,MAAAA,QAAQ,EAAEA,QAAS;AACnBG,MAAAA,QAAQ,EAAEA,QAAS;MACnB,YAAYa,EAAAA,YAAY,EAAG;AAC3BZ,MAAAA,OAAO,EAAEA,OAAQ;AAAAqB,MAAAA,QAAA,EAEhB1B,MAAAA;KACW,CAAA;AACf,GAAA,CACD,CAAA;AAEN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionOption.mjs","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport ActionButton from '../actionButton';\nimport { CommonProps, Priority, PriorityPrimary, PrioritySecondary } from '../common';\nimport Option from '../common/Option';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n action: React.ReactNode;\n priority?: PriorityPrimary | PrioritySecondary;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps;\n\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n const labels: string[] = [];\n\n if (typeof title === 'string') {\n labels.push(title);\n }\n\n if (typeof action === 'string') {\n labels.push(action);\n }\n\n return labels.join(', ') || undefined;\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <ActionButton\n priority={priority}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </ActionButton>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","sharedProps","clsx","getAriaLabel","labels","push","join","undefined","_jsx","Option","button","ActionButton","children"],"mappings":";;;;;;AAqBMA,MAAAA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,OAAO;EACPC,SAAS;EACTC,mBAAmB;EACnBC,eAAe;EACfC,kBAAkB;AAClBC,EAAAA,EAAAA;AAAE,CACgB,KAAI;AACtB,EAAA,MAAMC,WAAW,GAAG;IAClBT,KAAK;IACLC,KAAK;IACLC,OAAO;IACPC,OAAO;IACPL,QAAQ;IACRO,mBAAmB;IACnBC,eAAe;AACfF,IAAAA,SAAS,EAAEM,IAAI,CAAC,kBAAkB,EAAEN,SAAS,CAAC;IAC9CG,kBAAkB;AAClBC,IAAAA,EAAAA;GACD,CAAA;EAED,MAAMG,YAAY,GAAGA,MAAyB;IAC5C,MAAMC,MAAM,GAAa,EAAE,CAAA;AAE3B,IAAA,IAAI,OAAOX,KAAK,KAAK,QAAQ,EAAE;AAC7BW,MAAAA,MAAM,CAACC,IAAI,CAACZ,KAAK,CAAC,CAAA;AACpB,KAAA;AAEA,IAAA,IAAI,OAAOP,MAAM,KAAK,QAAQ,EAAE;AAC9BkB,MAAAA,MAAM,CAACC,IAAI,CAACnB,MAAM,CAAC,CAAA;AACrB,KAAA;AAEA,IAAA,OAAOkB,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC,IAAIC,SAAS,CAAA;GACtC,CAAA;EAED,oBACEC,GAAA,CAACC,MAAM,EAAA;AAAA,IAAA,GACDR,WAAW;IACfS,MAAM,eACJF,GAAA,CAACG,YAAY,EAAA;AACXxB,MAAAA,QAAQ,EAAEA,QAAS;AACnBG,MAAAA,QAAQ,EAAEA,QAAS;MACnB,YAAYa,EAAAA,YAAY,EAAG;AAC3BZ,MAAAA,OAAO,EAAEA,OAAQ;AAAAqB,MAAAA,QAAA,EAEhB1B,MAAAA;KACW,CAAA;AACf,GAAA,CACD,CAAA;AAEN;;;;"}
1
+ {"version":3,"file":"ActionOption.mjs","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport ActionButton from '../actionButton';\nimport {\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n action: React.ReactNode;\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps;\n\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n const labels: string[] = [];\n\n if (typeof title === 'string') {\n labels.push(title);\n }\n\n if (typeof action === 'string') {\n labels.push(action);\n }\n\n return labels.join(', ') || undefined;\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <ActionButton\n priority={priority}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </ActionButton>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","sharedProps","clsx","getAriaLabel","labels","push","join","undefined","_jsx","Option","button","ActionButton","children"],"mappings":";;;;;;AA2BMA,MAAAA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,OAAO;EACPC,SAAS;EACTC,mBAAmB;EACnBC,eAAe;EACfC,kBAAkB;AAClBC,EAAAA,EAAAA;AAAE,CACgB,KAAI;AACtB,EAAA,MAAMC,WAAW,GAAG;IAClBT,KAAK;IACLC,KAAK;IACLC,OAAO;IACPC,OAAO;IACPL,QAAQ;IACRO,mBAAmB;IACnBC,eAAe;AACfF,IAAAA,SAAS,EAAEM,IAAI,CAAC,kBAAkB,EAAEN,SAAS,CAAC;IAC9CG,kBAAkB;AAClBC,IAAAA,EAAAA;GACD,CAAA;EAED,MAAMG,YAAY,GAAGA,MAAyB;IAC5C,MAAMC,MAAM,GAAa,EAAE,CAAA;AAE3B,IAAA,IAAI,OAAOX,KAAK,KAAK,QAAQ,EAAE;AAC7BW,MAAAA,MAAM,CAACC,IAAI,CAACZ,KAAK,CAAC,CAAA;AACpB,KAAA;AAEA,IAAA,IAAI,OAAOP,MAAM,KAAK,QAAQ,EAAE;AAC9BkB,MAAAA,MAAM,CAACC,IAAI,CAACnB,MAAM,CAAC,CAAA;AACrB,KAAA;AAEA,IAAA,OAAOkB,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC,IAAIC,SAAS,CAAA;GACtC,CAAA;EAED,oBACEC,GAAA,CAACC,MAAM,EAAA;AAAA,IAAA,GACDR,WAAW;IACfS,MAAM,eACJF,GAAA,CAACG,YAAY,EAAA;AACXxB,MAAAA,QAAQ,EAAEA,QAAS;AACnBG,MAAAA,QAAQ,EAAEA,QAAS;MACnB,YAAYa,EAAAA,YAAY,EAAG;AAC3BZ,MAAAA,OAAO,EAAEA,OAAQ;AAAAqB,MAAAA,QAAA,EAEhB1B,MAAAA;KACW,CAAA;AACf,GAAA,CACD,CAAA;AAEN;;;;"}
package/build/main.css CHANGED
@@ -186,6 +186,10 @@ div.critical-comms .critical-comms-body {
186
186
  background-color: var(--color-background-neutral);
187
187
  color: var(--color-interactive-primary);
188
188
  }
189
+ .np-action-btn.btn-priority-3 {
190
+ background-color: transparent !important;
191
+ color: var(--color-interactive-primary);
192
+ }
189
193
  .np-action-btn:not(:disabled):hover {
190
194
  background-color: #008fc9;
191
195
  background-color: var(--color-interactive-accent-hover);
@@ -193,6 +197,9 @@ div.critical-comms .critical-comms-body {
193
197
  .np-action-btn:not(:disabled):hover.btn-priority-2 {
194
198
  background-color: var(--color-background-neutral-hover);
195
199
  }
200
+ .np-action-btn:not(:disabled):hover.btn-priority-3 {
201
+ color: var(--color-interactive-primary-hover);
202
+ }
196
203
  .np-action-btn:not(:disabled):active {
197
204
  box-shadow: none;
198
205
  border-color: transparent;
@@ -202,6 +209,10 @@ div.critical-comms .critical-comms-body {
202
209
  .np-action-btn:not(:disabled):active.btn-priority-2 {
203
210
  background-color: var(--color-background-neutral-active);
204
211
  }
212
+ .np-action-btn:not(:disabled):active.btn-priority-3 {
213
+ color: var(--color-interactive-primary-active);
214
+ background-color: var(--color-background-screen-active) !important;
215
+ }
205
216
  .np-action-btn:not(:disabled):focus {
206
217
  box-shadow: none;
207
218
  }
@@ -32,6 +32,10 @@
32
32
  background-color: var(--color-background-neutral);
33
33
  color: var(--color-interactive-primary);
34
34
  }
35
+ .np-action-btn.btn-priority-3 {
36
+ background-color: transparent !important;
37
+ color: var(--color-interactive-primary);
38
+ }
35
39
  .np-action-btn:not(:disabled):hover {
36
40
  background-color: #008fc9;
37
41
  background-color: var(--color-interactive-accent-hover);
@@ -39,6 +43,9 @@
39
43
  .np-action-btn:not(:disabled):hover.btn-priority-2 {
40
44
  background-color: var(--color-background-neutral-hover);
41
45
  }
46
+ .np-action-btn:not(:disabled):hover.btn-priority-3 {
47
+ color: var(--color-interactive-primary-hover);
48
+ }
42
49
  .np-action-btn:not(:disabled):active {
43
50
  box-shadow: none;
44
51
  border-color: transparent;
@@ -48,6 +55,10 @@
48
55
  .np-action-btn:not(:disabled):active.btn-priority-2 {
49
56
  background-color: var(--color-background-neutral-active);
50
57
  }
58
+ .np-action-btn:not(:disabled):active.btn-priority-3 {
59
+ color: var(--color-interactive-primary-active);
60
+ background-color: var(--color-background-screen-active) !important;
61
+ }
51
62
  .np-action-btn:not(:disabled):focus {
52
63
  box-shadow: none;
53
64
  }
@@ -186,6 +186,10 @@ div.critical-comms .critical-comms-body {
186
186
  background-color: var(--color-background-neutral);
187
187
  color: var(--color-interactive-primary);
188
188
  }
189
+ .np-action-btn.btn-priority-3 {
190
+ background-color: transparent !important;
191
+ color: var(--color-interactive-primary);
192
+ }
189
193
  .np-action-btn:not(:disabled):hover {
190
194
  background-color: #008fc9;
191
195
  background-color: var(--color-interactive-accent-hover);
@@ -193,6 +197,9 @@ div.critical-comms .critical-comms-body {
193
197
  .np-action-btn:not(:disabled):hover.btn-priority-2 {
194
198
  background-color: var(--color-background-neutral-hover);
195
199
  }
200
+ .np-action-btn:not(:disabled):hover.btn-priority-3 {
201
+ color: var(--color-interactive-primary-hover);
202
+ }
196
203
  .np-action-btn:not(:disabled):active {
197
204
  box-shadow: none;
198
205
  border-color: transparent;
@@ -202,6 +209,10 @@ div.critical-comms .critical-comms-body {
202
209
  .np-action-btn:not(:disabled):active.btn-priority-2 {
203
210
  background-color: var(--color-background-neutral-active);
204
211
  }
212
+ .np-action-btn:not(:disabled):active.btn-priority-3 {
213
+ color: var(--color-interactive-primary-active);
214
+ background-color: var(--color-background-screen-active) !important;
215
+ }
205
216
  .np-action-btn:not(:disabled):focus {
206
217
  box-shadow: none;
207
218
  }
@@ -6,13 +6,25 @@ function Highlight({
6
6
  className,
7
7
  value,
8
8
  query
9
+ }) {
10
+ const content = /*#__PURE__*/jsxRuntime.jsx(HighlightContent, {
11
+ value: value,
12
+ query: query
13
+ });
14
+ return className ? /*#__PURE__*/jsxRuntime.jsx("span", {
15
+ className: className,
16
+ children: content
17
+ }) : content;
18
+ }
19
+ function HighlightContent({
20
+ value,
21
+ query
9
22
  }) {
10
23
  if (value && query) {
11
24
  const highlightStart = value.toUpperCase().indexOf(query.trim().toUpperCase());
12
25
  const highlightEnd = highlightStart + query.trim().length;
13
26
  if (highlightStart !== -1) {
14
- return /*#__PURE__*/jsxRuntime.jsxs("span", {
15
- className: className,
27
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
16
28
  children: [value.slice(0, Math.max(0, highlightStart)), /*#__PURE__*/jsxRuntime.jsx("strong", {
17
29
  children: value.slice(highlightStart, highlightEnd)
18
30
  }), value.slice(Math.max(0, highlightEnd))]
@@ -1 +1 @@
1
- {"version":3,"file":"highlight.js","sources":["../../../src/typeahead/util/highlight.tsx"],"sourcesContent":["export default function Highlight({\n className,\n value,\n query,\n}: {\n className?: string;\n value: string;\n query: string;\n}) {\n if (value && query) {\n const highlightStart = value.toUpperCase().indexOf(query.trim().toUpperCase());\n const highlightEnd = highlightStart + query.trim().length;\n if (highlightStart !== -1) {\n return (\n <span className={className}>\n {value.slice(0, Math.max(0, highlightStart))}\n <strong>{value.slice(highlightStart, highlightEnd)}</strong>\n {value.slice(Math.max(0, highlightEnd))}\n </span>\n );\n }\n }\n return value;\n}\n"],"names":["Highlight","className","value","query","highlightStart","toUpperCase","indexOf","trim","highlightEnd","length","_jsxs","children","slice","Math","max","_jsx"],"mappings":";;;;AAAc,SAAUA,SAASA,CAAC;EAChCC,SAAS;EACTC,KAAK;AACLC,EAAAA,KAAAA;AAKD,CAAA,EAAA;EACC,IAAID,KAAK,IAAIC,KAAK,EAAE;AAClB,IAAA,MAAMC,cAAc,GAAGF,KAAK,CAACG,WAAW,EAAE,CAACC,OAAO,CAACH,KAAK,CAACI,IAAI,EAAE,CAACF,WAAW,EAAE,CAAC,CAAA;IAC9E,MAAMG,YAAY,GAAGJ,cAAc,GAAGD,KAAK,CAACI,IAAI,EAAE,CAACE,MAAM,CAAA;AACzD,IAAA,IAAIL,cAAc,KAAK,CAAC,CAAC,EAAE;AACzB,MAAA,oBACEM,eAAA,CAAA,MAAA,EAAA;AAAMT,QAAAA,SAAS,EAAEA,SAAU;AAAAU,QAAAA,QAAA,GACxBT,KAAK,CAACU,KAAK,CAAC,CAAC,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEV,cAAc,CAAC,CAAC,eAC5CW,cAAA,CAAA,QAAA,EAAA;AAAAJ,UAAAA,QAAA,EAAST,KAAK,CAACU,KAAK,CAACR,cAAc,EAAEI,YAAY,CAAA;AAAC,SAAS,CAC3D,EAACN,KAAK,CAACU,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEN,YAAY,CAAC,CAAC,CAAA;AAAA,OACnC,CAAC,CAAA;AAEX,KAAA;AACF,GAAA;AACA,EAAA,OAAON,KAAK,CAAA;AACd;;;;"}
1
+ {"version":3,"file":"highlight.js","sources":["../../../src/typeahead/util/highlight.tsx"],"sourcesContent":["export default function Highlight({\n className,\n value,\n query,\n}: {\n className?: string;\n value: string;\n query: string;\n}) {\n const content = <HighlightContent value={value} query={query} />;\n return className ? <span className={className}>{content}</span> : content;\n}\n\nfunction HighlightContent({ value, query }: { value: string; query: string }) {\n if (value && query) {\n const highlightStart = value.toUpperCase().indexOf(query.trim().toUpperCase());\n const highlightEnd = highlightStart + query.trim().length;\n if (highlightStart !== -1) {\n return (\n <>\n {value.slice(0, Math.max(0, highlightStart))}\n <strong>{value.slice(highlightStart, highlightEnd)}</strong>\n {value.slice(Math.max(0, highlightEnd))}\n </>\n );\n }\n }\n return value;\n}\n"],"names":["Highlight","className","value","query","content","_jsx","HighlightContent","children","highlightStart","toUpperCase","indexOf","trim","highlightEnd","length","_jsxs","_Fragment","slice","Math","max"],"mappings":";;;;AAAc,SAAUA,SAASA,CAAC;EAChCC,SAAS;EACTC,KAAK;AACLC,EAAAA,KAAAA;AAKD,CAAA,EAAA;AACC,EAAA,MAAMC,OAAO,gBAAGC,cAAA,CAACC,gBAAgB,EAAA;AAACJ,IAAAA,KAAK,EAAEA,KAAM;AAACC,IAAAA,KAAK,EAAEA,KAAAA;AAAM,IAAG,CAAA;EAChE,OAAOF,SAAS,gBAAGI,cAAA,CAAA,MAAA,EAAA;AAAMJ,IAAAA,SAAS,EAAEA,SAAU;AAAAM,IAAAA,QAAA,EAAEH,OAAAA;GAAc,CAAC,GAAGA,OAAO,CAAA;AAC3E,CAAA;AAEA,SAASE,gBAAgBA,CAAC;EAAEJ,KAAK;AAAEC,EAAAA,KAAAA;AAAyC,CAAA,EAAA;EAC1E,IAAID,KAAK,IAAIC,KAAK,EAAE;AAClB,IAAA,MAAMK,cAAc,GAAGN,KAAK,CAACO,WAAW,EAAE,CAACC,OAAO,CAACP,KAAK,CAACQ,IAAI,EAAE,CAACF,WAAW,EAAE,CAAC,CAAA;IAC9E,MAAMG,YAAY,GAAGJ,cAAc,GAAGL,KAAK,CAACQ,IAAI,EAAE,CAACE,MAAM,CAAA;AACzD,IAAA,IAAIL,cAAc,KAAK,CAAC,CAAC,EAAE;MACzB,oBACEM,eAAA,CAAAC,mBAAA,EAAA;AAAAR,QAAAA,QAAA,GACGL,KAAK,CAACc,KAAK,CAAC,CAAC,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEV,cAAc,CAAC,CAAC,eAC5CH,cAAA,CAAA,QAAA,EAAA;AAAAE,UAAAA,QAAA,EAASL,KAAK,CAACc,KAAK,CAACR,cAAc,EAAEI,YAAY,CAAA;AAAC,SAAS,CAC3D,EAACV,KAAK,CAACc,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEN,YAAY,CAAC,CAAC,CAAA;AAAA,OACzC,CAAG,CAAA;AAEP,KAAA;AACF,GAAA;AACA,EAAA,OAAOV,KAAK,CAAA;AACd;;;;"}
@@ -1,16 +1,28 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
 
3
3
  function Highlight({
4
4
  className,
5
5
  value,
6
6
  query
7
+ }) {
8
+ const content = /*#__PURE__*/jsx(HighlightContent, {
9
+ value: value,
10
+ query: query
11
+ });
12
+ return className ? /*#__PURE__*/jsx("span", {
13
+ className: className,
14
+ children: content
15
+ }) : content;
16
+ }
17
+ function HighlightContent({
18
+ value,
19
+ query
7
20
  }) {
8
21
  if (value && query) {
9
22
  const highlightStart = value.toUpperCase().indexOf(query.trim().toUpperCase());
10
23
  const highlightEnd = highlightStart + query.trim().length;
11
24
  if (highlightStart !== -1) {
12
- return /*#__PURE__*/jsxs("span", {
13
- className: className,
25
+ return /*#__PURE__*/jsxs(Fragment, {
14
26
  children: [value.slice(0, Math.max(0, highlightStart)), /*#__PURE__*/jsx("strong", {
15
27
  children: value.slice(highlightStart, highlightEnd)
16
28
  }), value.slice(Math.max(0, highlightEnd))]
@@ -1 +1 @@
1
- {"version":3,"file":"highlight.mjs","sources":["../../../src/typeahead/util/highlight.tsx"],"sourcesContent":["export default function Highlight({\n className,\n value,\n query,\n}: {\n className?: string;\n value: string;\n query: string;\n}) {\n if (value && query) {\n const highlightStart = value.toUpperCase().indexOf(query.trim().toUpperCase());\n const highlightEnd = highlightStart + query.trim().length;\n if (highlightStart !== -1) {\n return (\n <span className={className}>\n {value.slice(0, Math.max(0, highlightStart))}\n <strong>{value.slice(highlightStart, highlightEnd)}</strong>\n {value.slice(Math.max(0, highlightEnd))}\n </span>\n );\n }\n }\n return value;\n}\n"],"names":["Highlight","className","value","query","highlightStart","toUpperCase","indexOf","trim","highlightEnd","length","_jsxs","children","slice","Math","max","_jsx"],"mappings":";;AAAc,SAAUA,SAASA,CAAC;EAChCC,SAAS;EACTC,KAAK;AACLC,EAAAA,KAAAA;AAKD,CAAA,EAAA;EACC,IAAID,KAAK,IAAIC,KAAK,EAAE;AAClB,IAAA,MAAMC,cAAc,GAAGF,KAAK,CAACG,WAAW,EAAE,CAACC,OAAO,CAACH,KAAK,CAACI,IAAI,EAAE,CAACF,WAAW,EAAE,CAAC,CAAA;IAC9E,MAAMG,YAAY,GAAGJ,cAAc,GAAGD,KAAK,CAACI,IAAI,EAAE,CAACE,MAAM,CAAA;AACzD,IAAA,IAAIL,cAAc,KAAK,CAAC,CAAC,EAAE;AACzB,MAAA,oBACEM,IAAA,CAAA,MAAA,EAAA;AAAMT,QAAAA,SAAS,EAAEA,SAAU;AAAAU,QAAAA,QAAA,GACxBT,KAAK,CAACU,KAAK,CAAC,CAAC,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEV,cAAc,CAAC,CAAC,eAC5CW,GAAA,CAAA,QAAA,EAAA;AAAAJ,UAAAA,QAAA,EAAST,KAAK,CAACU,KAAK,CAACR,cAAc,EAAEI,YAAY,CAAA;AAAC,SAAS,CAC3D,EAACN,KAAK,CAACU,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEN,YAAY,CAAC,CAAC,CAAA;AAAA,OACnC,CAAC,CAAA;AAEX,KAAA;AACF,GAAA;AACA,EAAA,OAAON,KAAK,CAAA;AACd;;;;"}
1
+ {"version":3,"file":"highlight.mjs","sources":["../../../src/typeahead/util/highlight.tsx"],"sourcesContent":["export default function Highlight({\n className,\n value,\n query,\n}: {\n className?: string;\n value: string;\n query: string;\n}) {\n const content = <HighlightContent value={value} query={query} />;\n return className ? <span className={className}>{content}</span> : content;\n}\n\nfunction HighlightContent({ value, query }: { value: string; query: string }) {\n if (value && query) {\n const highlightStart = value.toUpperCase().indexOf(query.trim().toUpperCase());\n const highlightEnd = highlightStart + query.trim().length;\n if (highlightStart !== -1) {\n return (\n <>\n {value.slice(0, Math.max(0, highlightStart))}\n <strong>{value.slice(highlightStart, highlightEnd)}</strong>\n {value.slice(Math.max(0, highlightEnd))}\n </>\n );\n }\n }\n return value;\n}\n"],"names":["Highlight","className","value","query","content","_jsx","HighlightContent","children","highlightStart","toUpperCase","indexOf","trim","highlightEnd","length","_jsxs","_Fragment","slice","Math","max"],"mappings":";;AAAc,SAAUA,SAASA,CAAC;EAChCC,SAAS;EACTC,KAAK;AACLC,EAAAA,KAAAA;AAKD,CAAA,EAAA;AACC,EAAA,MAAMC,OAAO,gBAAGC,GAAA,CAACC,gBAAgB,EAAA;AAACJ,IAAAA,KAAK,EAAEA,KAAM;AAACC,IAAAA,KAAK,EAAEA,KAAAA;AAAM,IAAG,CAAA;EAChE,OAAOF,SAAS,gBAAGI,GAAA,CAAA,MAAA,EAAA;AAAMJ,IAAAA,SAAS,EAAEA,SAAU;AAAAM,IAAAA,QAAA,EAAEH,OAAAA;GAAc,CAAC,GAAGA,OAAO,CAAA;AAC3E,CAAA;AAEA,SAASE,gBAAgBA,CAAC;EAAEJ,KAAK;AAAEC,EAAAA,KAAAA;AAAyC,CAAA,EAAA;EAC1E,IAAID,KAAK,IAAIC,KAAK,EAAE;AAClB,IAAA,MAAMK,cAAc,GAAGN,KAAK,CAACO,WAAW,EAAE,CAACC,OAAO,CAACP,KAAK,CAACQ,IAAI,EAAE,CAACF,WAAW,EAAE,CAAC,CAAA;IAC9E,MAAMG,YAAY,GAAGJ,cAAc,GAAGL,KAAK,CAACQ,IAAI,EAAE,CAACE,MAAM,CAAA;AACzD,IAAA,IAAIL,cAAc,KAAK,CAAC,CAAC,EAAE;MACzB,oBACEM,IAAA,CAAAC,QAAA,EAAA;AAAAR,QAAAA,QAAA,GACGL,KAAK,CAACc,KAAK,CAAC,CAAC,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEV,cAAc,CAAC,CAAC,eAC5CH,GAAA,CAAA,QAAA,EAAA;AAAAE,UAAAA,QAAA,EAASL,KAAK,CAACc,KAAK,CAACR,cAAc,EAAEI,YAAY,CAAA;AAAC,SAAS,CAC3D,EAACV,KAAK,CAACc,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEN,YAAY,CAAC,CAAC,CAAA;AAAA,OACzC,CAAG,CAAA;AAEP,KAAA;AACF,GAAA;AACA,EAAA,OAAOV,KAAK,CAAA;AACd;;;;"}
@@ -1,14 +1,14 @@
1
1
  import { ButtonHTMLAttributes } from 'react';
2
- import { PriorityPrimary, PrioritySecondary } from '../common';
2
+ import { PriorityPrimary, PrioritySecondary, PriorityTertiary } from '../common';
3
3
  export type ActionButtonProps = {
4
- priority?: PriorityPrimary | PrioritySecondary;
4
+ priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;
5
5
  /**
6
6
  * @deprecated use `children` instead
7
7
  */
8
8
  text?: string;
9
9
  } & ButtonHTMLAttributes<HTMLButtonElement>;
10
10
  declare const ActionButton: import("react").ForwardRefExoticComponent<{
11
- priority?: PriorityPrimary | PrioritySecondary;
11
+ priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;
12
12
  /**
13
13
  * @deprecated use `children` instead
14
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/actionButton/ActionButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAc,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAY,eAAe,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEzE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,eAAe,GAAG,iBAAiB,CAAC;IAC/C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C,QAAA,MAAM,YAAY;eAPL,eAAe,GAAG,iBAAiB;IAC9C;;OAEG;WACI,MAAM;+FAgCd,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/actionButton/ActionButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAc,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAY,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE3F,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,eAAe,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;IAClE;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C,QAAA,MAAM,YAAY;eAPL,eAAe,GAAG,iBAAiB,GAAG,gBAAgB;IACjE;;OAEG;WACI,MAAM;+FAoCd,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,4 +1,4 @@
1
- import { CommonProps, PriorityPrimary, PrioritySecondary } from '../common';
1
+ import { CommonProps, PriorityPrimary, PrioritySecondary, PriorityTertiary } from '../common';
2
2
  export type ActionOptionProps = {
3
3
  complex?: boolean;
4
4
  content?: React.ReactNode;
@@ -8,7 +8,7 @@ export type ActionOptionProps = {
8
8
  onClick: () => void;
9
9
  title: React.ReactNode;
10
10
  action: React.ReactNode;
11
- priority?: PriorityPrimary | PrioritySecondary;
11
+ priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;
12
12
  showMediaCircle?: boolean;
13
13
  isContainerAligned?: boolean;
14
14
  as?: React.ElementType;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionOption.d.ts","sourceRoot":"","sources":["../../../src/actionOption/ActionOption.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAY,eAAe,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGtF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,GAAG,iBAAiB,CAAC;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACxB,GAAG,WAAW,CAAC;AAEhB,QAAA,MAAM,YAAY,sJAcf,iBAAiB,gCA2CnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"ActionOption.d.ts","sourceRoot":"","sources":["../../../src/actionOption/ActionOption.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EAEX,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,WAAW,CAAC;AAGnB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACxB,GAAG,WAAW,CAAC;AAEhB,QAAA,MAAM,YAAY,sJAcf,iBAAiB,gCA2CnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -2,5 +2,5 @@ export default function Highlight({ className, value, query, }: {
2
2
  className?: string;
3
3
  value: string;
4
4
  query: string;
5
- }): string | import("react").JSX.Element;
5
+ }): import("react").JSX.Element;
6
6
  //# sourceMappingURL=highlight.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../../src/typeahead/util/highlight.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,SAAS,EACT,KAAK,EACL,KAAK,GACN,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,wCAeA"}
1
+ {"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../../src/typeahead/util/highlight.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,SAAS,EACT,KAAK,EACL,KAAK,GACN,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,+BAGA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "46.71.5",
3
+ "version": "46.71.7",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -32,6 +32,10 @@
32
32
  background-color: var(--color-background-neutral);
33
33
  color: var(--color-interactive-primary);
34
34
  }
35
+ .np-action-btn.btn-priority-3 {
36
+ background-color: transparent !important;
37
+ color: var(--color-interactive-primary);
38
+ }
35
39
  .np-action-btn:not(:disabled):hover {
36
40
  background-color: #008fc9;
37
41
  background-color: var(--color-interactive-accent-hover);
@@ -39,6 +43,9 @@
39
43
  .np-action-btn:not(:disabled):hover.btn-priority-2 {
40
44
  background-color: var(--color-background-neutral-hover);
41
45
  }
46
+ .np-action-btn:not(:disabled):hover.btn-priority-3 {
47
+ color: var(--color-interactive-primary-hover);
48
+ }
42
49
  .np-action-btn:not(:disabled):active {
43
50
  box-shadow: none;
44
51
  border-color: transparent;
@@ -48,6 +55,10 @@
48
55
  .np-action-btn:not(:disabled):active.btn-priority-2 {
49
56
  background-color: var(--color-background-neutral-active);
50
57
  }
58
+ .np-action-btn:not(:disabled):active.btn-priority-3 {
59
+ color: var(--color-interactive-primary-active);
60
+ background-color: var(--color-background-screen-active) !important;
61
+ }
51
62
  .np-action-btn:not(:disabled):focus {
52
63
  box-shadow: none;
53
64
  }
@@ -24,6 +24,11 @@
24
24
  color: var(--color-interactive-primary);
25
25
  }
26
26
 
27
+ &.btn-priority-3 {
28
+ background-color: transparent !important;
29
+ color: var(--color-interactive-primary);
30
+ }
31
+
27
32
  &:not(:disabled) {
28
33
  &:hover {
29
34
  background-color: var(--color-interactive-accent-hover);
@@ -31,6 +36,10 @@
31
36
  &.btn-priority-2 {
32
37
  background-color: var(--color-background-neutral-hover);
33
38
  }
39
+
40
+ &.btn-priority-3 {
41
+ color: var(--color-interactive-primary-hover);
42
+ }
34
43
  }
35
44
 
36
45
  &:active {
@@ -41,6 +50,11 @@
41
50
  &.btn-priority-2 {
42
51
  background-color: var(--color-background-neutral-active);
43
52
  }
53
+
54
+ &.btn-priority-3 {
55
+ color: var(--color-interactive-primary-active);
56
+ background-color: var(--color-background-screen-active) !important;
57
+ }
44
58
  }
45
59
 
46
60
  &:focus {
@@ -16,21 +16,32 @@ type Story = StoryObj<typeof ActionButton>;
16
16
  export const Basic: Story = storyConfig(
17
17
  {
18
18
  render: (args) => (
19
- <div style={{ display: 'flex', gap: '0.4rem', flexWrap: 'wrap' }}>
20
- <ActionButton priority="primary" {...args}>
21
- Primary label
22
- </ActionButton>
23
- <ActionButton priority="secondary" {...args}>
24
- Secondary label
25
- </ActionButton>
26
- <ActionButton priority="primary" {...args} style={{ display: 'flex', gap: '0.4rem' }}>
27
- <Settings />
28
- Primary label
29
- </ActionButton>
30
- <ActionButton priority="secondary" {...args} style={{ display: 'flex', gap: '0.4rem' }}>
31
- <Settings />
32
- Secondary label
33
- </ActionButton>
19
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '0.4rem' }}>
20
+ <div>
21
+ <ActionButton priority="primary" {...args}>
22
+ Primary label
23
+ </ActionButton>
24
+ <ActionButton priority="secondary" {...args}>
25
+ Secondary label
26
+ </ActionButton>
27
+ <ActionButton priority="tertiary" {...args}>
28
+ Tertiary label
29
+ </ActionButton>
30
+ </div>
31
+ <div>
32
+ <ActionButton priority="primary" {...args}>
33
+ <Settings />
34
+ Primary label
35
+ </ActionButton>
36
+ <ActionButton priority="secondary" {...args}>
37
+ <Settings />
38
+ Secondary label
39
+ </ActionButton>
40
+ <ActionButton priority="tertiary" {...args}>
41
+ <Settings />
42
+ Tertiary label
43
+ </ActionButton>
44
+ </div>
34
45
  </div>
35
46
  ),
36
47
  },
@@ -1,10 +1,10 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { ButtonHTMLAttributes, forwardRef } from 'react';
3
3
 
4
- import { Priority, PriorityPrimary, PrioritySecondary } from '../common';
4
+ import { Priority, PriorityPrimary, PrioritySecondary, PriorityTertiary } from '../common';
5
5
 
6
6
  export type ActionButtonProps = {
7
- priority?: PriorityPrimary | PrioritySecondary;
7
+ priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;
8
8
  /**
9
9
  * @deprecated use `children` instead
10
10
  */
@@ -30,7 +30,11 @@ const ActionButton = forwardRef<HTMLButtonElement, ActionButtonProps>(
30
30
  className={clsx(
31
31
  'np-action-btn',
32
32
  'np-text-body-default-bold',
33
- priority === Priority.SECONDARY ? 'btn-priority-2' : 'btn-priority-1',
33
+ priority === Priority.TERTIARY
34
+ ? 'btn-priority-3'
35
+ : priority === Priority.SECONDARY
36
+ ? 'btn-priority-2'
37
+ : 'btn-priority-1',
34
38
  className,
35
39
  )}
36
40
  disabled={disabled}
@@ -25,10 +25,14 @@ export const Basic: Story = {
25
25
  render: (args) => <ActionOption {...args} />,
26
26
  };
27
27
 
28
- export const WithSecondarypriority: Story = {
28
+ export const WithSecondaryPriority: Story = {
29
29
  render: (args) => <ActionOption priority="secondary" {...args} />,
30
30
  };
31
31
 
32
+ export const WithTertiaryPriority: Story = {
33
+ render: (args) => <ActionOption priority="tertiary" {...args} />,
34
+ };
35
+
32
36
  export const WithContainerContent: Story = {
33
37
  render: (args) => (
34
38
  <>
@@ -1,7 +1,13 @@
1
1
  import { clsx } from 'clsx';
2
2
 
3
3
  import ActionButton from '../actionButton';
4
- import { CommonProps, Priority, PriorityPrimary, PrioritySecondary } from '../common';
4
+ import {
5
+ CommonProps,
6
+ Priority,
7
+ PriorityPrimary,
8
+ PrioritySecondary,
9
+ PriorityTertiary,
10
+ } from '../common';
5
11
  import Option from '../common/Option';
6
12
 
7
13
  export type ActionOptionProps = {
@@ -13,7 +19,7 @@ export type ActionOptionProps = {
13
19
  onClick: () => void;
14
20
  title: React.ReactNode;
15
21
  action: React.ReactNode;
16
- priority?: PriorityPrimary | PrioritySecondary;
22
+ priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;
17
23
  showMediaCircle?: boolean;
18
24
  isContainerAligned?: boolean;
19
25
  as?: React.ElementType;
package/src/main.css CHANGED
@@ -186,6 +186,10 @@ div.critical-comms .critical-comms-body {
186
186
  background-color: var(--color-background-neutral);
187
187
  color: var(--color-interactive-primary);
188
188
  }
189
+ .np-action-btn.btn-priority-3 {
190
+ background-color: transparent !important;
191
+ color: var(--color-interactive-primary);
192
+ }
189
193
  .np-action-btn:not(:disabled):hover {
190
194
  background-color: #008fc9;
191
195
  background-color: var(--color-interactive-accent-hover);
@@ -193,6 +197,9 @@ div.critical-comms .critical-comms-body {
193
197
  .np-action-btn:not(:disabled):hover.btn-priority-2 {
194
198
  background-color: var(--color-background-neutral-hover);
195
199
  }
200
+ .np-action-btn:not(:disabled):hover.btn-priority-3 {
201
+ color: var(--color-interactive-primary-hover);
202
+ }
196
203
  .np-action-btn:not(:disabled):active {
197
204
  box-shadow: none;
198
205
  border-color: transparent;
@@ -202,6 +209,10 @@ div.critical-comms .critical-comms-body {
202
209
  .np-action-btn:not(:disabled):active.btn-priority-2 {
203
210
  background-color: var(--color-background-neutral-active);
204
211
  }
212
+ .np-action-btn:not(:disabled):active.btn-priority-3 {
213
+ color: var(--color-interactive-primary-active);
214
+ background-color: var(--color-background-screen-active) !important;
215
+ }
205
216
  .np-action-btn:not(:disabled):focus {
206
217
  box-shadow: none;
207
218
  }
@@ -1,4 +1,4 @@
1
- import { shallow } from 'enzyme';
1
+ import { shallow, mount } from 'enzyme';
2
2
 
3
3
  import { fakeEvent } from '../../common/fakeEvents';
4
4
 
@@ -11,7 +11,7 @@ describe('Typeahead Option', () => {
11
11
 
12
12
  const labelHighlight = () => component.find(Highlight);
13
13
  const noteSpan = () => component.find('.np-text-body-default.m-l-1');
14
- const secondaryTextHighlight = () => component.find('.np-text-body-default.text-ellipsis');
14
+ const secondaryTextHighlight = () => component.find('.np-text-body-default.text-ellipsis > span');
15
15
  const dropdownItem = () => component.find('.dropdown-item');
16
16
 
17
17
  beforeEach(() => {
@@ -21,13 +21,13 @@ describe('Typeahead Option', () => {
21
21
  },
22
22
  };
23
23
 
24
- component = shallow(<TypeaheadOption {...props} />);
24
+ component = mount(<TypeaheadOption {...props} />);
25
25
  });
26
26
 
27
27
  it('renders a label', () => {
28
28
  const label = 'test';
29
29
  component.setProps({ option: { label } });
30
- expect(labelHighlight().dive().text()).toStrictEqual(label);
30
+ expect(labelHighlight().text()).toStrictEqual(label);
31
31
  });
32
32
 
33
33
  it('renders a note', () => {
@@ -41,10 +41,11 @@ describe('Typeahead Option', () => {
41
41
  const label = 'test';
42
42
  const secondary = 'test note';
43
43
  component.setProps({ option: { label, secondary } });
44
- expect(secondaryTextHighlight().dive().text()).toStrictEqual(secondary);
44
+ expect(secondaryTextHighlight().text()).toStrictEqual(secondary);
45
45
  });
46
46
 
47
47
  it('highlights when selected', () => {
48
+ component = shallow(<TypeaheadOption {...props} />);
48
49
  component.setProps({
49
50
  selected: true,
50
51
  });
@@ -53,6 +54,7 @@ describe('Typeahead Option', () => {
53
54
  });
54
55
 
55
56
  it('expect aria-selected to be true', () => {
57
+ component = shallow(<TypeaheadOption {...props} />);
56
58
  component.setProps({
57
59
  selected: true,
58
60
  });
@@ -7,16 +7,21 @@ export default function Highlight({
7
7
  value: string;
8
8
  query: string;
9
9
  }) {
10
+ const content = <HighlightContent value={value} query={query} />;
11
+ return className ? <span className={className}>{content}</span> : content;
12
+ }
13
+
14
+ function HighlightContent({ value, query }: { value: string; query: string }) {
10
15
  if (value && query) {
11
16
  const highlightStart = value.toUpperCase().indexOf(query.trim().toUpperCase());
12
17
  const highlightEnd = highlightStart + query.trim().length;
13
18
  if (highlightStart !== -1) {
14
19
  return (
15
- <span className={className}>
20
+ <>
16
21
  {value.slice(0, Math.max(0, highlightStart))}
17
22
  <strong>{value.slice(highlightStart, highlightEnd)}</strong>
18
23
  {value.slice(Math.max(0, highlightEnd))}
19
- </span>
24
+ </>
20
25
  );
21
26
  }
22
27
  }