@pega/cosmos-react-core 10.0.0-build.2.5 → 10.0.0-build.2.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.
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +14 -5
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/QRCode/QRCode.d.ts +6 -1
- package/lib/components/QRCode/QRCode.d.ts.map +1 -1
- package/lib/components/QRCode/QRCode.js +15 -9
- package/lib/components/QRCode/QRCode.js.map +1 -1
- package/lib/components/QRCode/index.d.ts +1 -1
- package/lib/components/QRCode/index.d.ts.map +1 -1
- package/lib/components/QRCode/index.js.map +1 -1
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.js +2 -0
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +2 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +2 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +2 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +2 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/theme/theme.d.ts +150 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +87 -0
- package/lib/theme/themeOverrides.schema.json +75 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EAET,GAAG,EAGJ,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EACV,SAAS,EAET,+BAA+B,EAC/B,iBAAiB,EACjB,MAAM,EACP,MAAM,aAAa,CAAC;AAkBrB,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,MAAM;IACpD,sCAAsC;IACtC,QAAQ,EAAE,SAAS,CAA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,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/D;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;CAClD;AAED,KAAK,uBAAuB,GAAG,iBAAiB,CAC9C,WAAW,EACX,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CACrD,CAAC;AAgFF,eAAO,MAAM,YAAY,wQA+OxB,CAAC;AAIF,eAAO,MAAM,gBAAgB,iUA+D3B,CAAC;AAIH,QAAA,MAAM,MAAM,EAAE,+BAA+B,CAAC,WAAW,CA2GvD,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -73,7 +73,7 @@ const getOutlinedButtonStyles = (color, backgroundColor) => {
|
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
export const StyledButton = styled.button.withConfig(omitProps('loading'))(({ variant, icon, loading, compact, theme }) => {
|
|
76
|
-
const { base: { spacing, 'border-radius': baseBorderRadius, palette: { 'primary-background': backgroundColor }, 'hit-area': { 'mouse-min': hitAreaMouse, 'finger-min': hitAreaFinger, 'compact-min': hitAreaCompact }, animation: { speed } }, components: { button: { color, 'foreground-color': foregroundColor, 'secondary-color': secondaryColor, 'secondary-fill-style': fillStyle, padding, 'border-radius': borderRadius, 'border-width': borderWidth, touch: { padding: touchPadding } } } } = theme;
|
|
76
|
+
const { base: { spacing, 'border-radius': baseBorderRadius, palette: { 'primary-background': backgroundColor }, 'hit-area': { 'mouse-min': hitAreaMouse, 'finger-min': hitAreaFinger, 'compact-min': hitAreaCompact }, animation: { speed } }, components: { button: { color, height, 'foreground-color': foregroundColor, 'secondary-color': secondaryColor, 'secondary-fill-style': fillStyle, padding, 'border-radius': borderRadius, 'border-width': borderWidth, touch: { padding: touchPadding } } } } = theme;
|
|
77
77
|
// Base
|
|
78
78
|
const base = baseStyles(theme);
|
|
79
79
|
// Non-text base
|
|
@@ -102,17 +102,26 @@ export const StyledButton = styled.button.withConfig(omitProps('loading'))(({ va
|
|
|
102
102
|
> svg {
|
|
103
103
|
display: block;
|
|
104
104
|
}
|
|
105
|
-
`}
|
|
105
|
+
`}
|
|
106
|
+
|
|
107
|
+
${!icon &&
|
|
108
|
+
!compact &&
|
|
109
|
+
css `
|
|
110
|
+
min-height: ${height};
|
|
111
|
+
`}
|
|
112
|
+
|
|
113
|
+
${compact &&
|
|
106
114
|
css `
|
|
107
115
|
min-height: ${hitAreaCompact};
|
|
108
116
|
min-width: ${hitAreaCompact};
|
|
109
|
-
`}
|
|
110
|
-
|
|
117
|
+
`}
|
|
118
|
+
|
|
119
|
+
@media (pointer: coarse) {
|
|
111
120
|
border-radius: calc(${baseBorderRadius} * ${borderRadius});
|
|
112
121
|
|
|
113
122
|
${!compact &&
|
|
114
123
|
css `
|
|
115
|
-
min-height: ${hitAreaFinger};
|
|
124
|
+
min-height: ${icon ? `${hitAreaFinger}` : `max(${hitAreaFinger}, ${height})`};
|
|
116
125
|
min-width: ${hitAreaFinger};
|
|
117
126
|
`}
|
|
118
127
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/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AAC,aAEA,YAAY,IAAI,KAAC,QAAQ,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAC,QAAQ,GAAG,EAC9D,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAC9B,EAEZ,QAAQ,IAAI,KAAK,IAAI,CACpB,KAAC,OAAO,IAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,EAAC,cAAc,EAAE,KAAK,YAC/E,KAAK,GACE,CACX,IACA,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { useRef, useEffect, forwardRef } from 'react';\nimport type {\n ReactNode,\n PropsWithoutRef,\n Ref,\n MouseEventHandler,\n MouseEvent as ReactMouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { meetsContrastGuidelines, mix } from 'polished';\n\nimport type {\n BaseProps,\n ForwardProps,\n ForwardRefForwardPropsComponent,\n PropsWithDefaults,\n AsProp\n} from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { isPositionWithinRect, tryCatch, createClassName } from '../../utils';\nimport {\n getActiveColors,\n getHoverColors,\n isSolidColor,\n omitProps,\n readableColor,\n readableHue\n} from '../../styles';\nimport { useElement, useConsolidatedRef } from '../../hooks';\nimport Tooltip from '../Tooltip';\nimport Progress, { StyledProgressRing } from '../Progress';\nimport { StyledBackdrop } from '../Backdrop';\nimport { StyledIcon } from '../Icon';\nimport { StyledPopover } from '../Popover';\n\nexport interface ButtonProps extends BaseProps, AsProp {\n /** Text or content for the Button. */\n children: ReactNode;\n /**\n * Determines if the Button will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** A location to navigate to. Passing an href will render an anchor styled as a Button. */\n href?: string;\n /**\n * Controls the styling of the Button.\n * @default 'secondary'\n */\n variant?: 'primary' | 'secondary' | 'simple' | 'link' | 'text';\n /**\n * Controls the behavior of a Button within a Form.\n * @default 'button'\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Set the Icon prop to `true` if you're using just an Icon in your Button. Make sure to pass an Icon as children if `true`.\n * @default false\n */\n icon?: boolean;\n /**\n * Used for a smaller sized button.\n * @default false\n */\n compact?: boolean;\n /** The label text will be used inside a Tooltip. */\n label?: string;\n /** The aria label text will be inserted as the aria-label on the Button. */\n 'aria-label'?: string;\n /**\n * Applies visual disabled styles without disabling the button element itself.\n * @default false\n */\n 'aria-disabled'?: boolean | 'true' | 'false';\n /**\n * Optionally renders an indeterminate progress indicator in a button.\n * @default false\n */\n loading?: boolean;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLButtonElement | HTMLAnchorElement>;\n}\n\ntype ButtonPropsWithDefaults = PropsWithDefaults<\n ButtonProps,\n 'variant' | 'type' | 'disabled' | 'icon' | 'loading'\n>;\n\nconst baseStyles = (theme: DefaultTheme) => {\n const {\n base: {\n spacing,\n animation: {\n speed,\n timing: { ease }\n },\n 'disabled-opacity': disabledOpacity\n },\n components: {\n button: { 'focus-shadow': focusShadow }\n }\n } = theme;\n\n return css`\n text-decoration: none;\n transition-property: background-color, color, border-color, box-shadow, translate;\n transition-duration: calc(0.5 * ${speed});\n transition-timing-function: ${ease};\n cursor: pointer;\n\n @media (forced-colors: none) {\n outline: none;\n }\n\n & + & {\n margin-inline-start: ${spacing};\n }\n\n /* Not able to combine with selector above. Stylis bug? */\n\n & + ${StyledPopover} + & {\n margin-inline-start: ${spacing};\n }\n\n &:disabled,\n &[disabled] {\n opacity: ${disabledOpacity};\n cursor: not-allowed;\n pointer-events: none;\n }\n\n &[aria-disabled='true'] {\n opacity: ${disabledOpacity};\n }\n\n &:not([disabled], [aria-disabled='true']):focus-visible,\n &:enabled:not([aria-disabled='true']):focus-visible {\n box-shadow: ${focusShadow};\n }\n `;\n};\n\n/* If the background color is not provided, the color will be used for the hover and active styles */\nconst getFilledButtonStyles = (color: string, backgroundColor?: string) => ({\n contrastColor: backgroundColor ? color : tryCatch(() => readableColor(color)),\n hoverColors: getHoverColors(backgroundColor || color),\n activeColors: getActiveColors(backgroundColor || color)\n});\n\nconst getOutlinedButtonStyles = (color: string, backgroundColor: string) => {\n // If the background color is not solid, use the readable color for the text\n const fallbackBackground = isSolidColor(backgroundColor) ? backgroundColor : readableColor(color);\n const backgroundUsable = tryCatch(() => meetsContrastGuidelines(color, fallbackBackground).AA);\n const usableColor = backgroundUsable ? color : readableHue(color, backgroundColor);\n const hoverBackgroundColor = tryCatch(() => mix(0.9, backgroundColor, color));\n const activeBackgroundColor = tryCatch(() => mix(0.8, backgroundColor, usableColor));\n\n return {\n textColor: backgroundUsable ? color : readableColor(color),\n hoverBg: hoverBackgroundColor,\n hoverFg: readableHue(color, hoverBackgroundColor ?? 'transparent'),\n activeBg: tryCatch(() => mix(0.8, backgroundColor, usableColor)),\n activeFg: readableHue(usableColor, activeBackgroundColor ?? 'transparent')\n };\n};\n\nexport const StyledButton = styled.button.withConfig(omitProps('loading'))<ButtonPropsWithDefaults>(\n ({ variant, icon, loading, compact, theme }) => {\n const {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'primary-background': backgroundColor },\n 'hit-area': {\n 'mouse-min': hitAreaMouse,\n 'finger-min': hitAreaFinger,\n 'compact-min': hitAreaCompact\n },\n animation: { speed }\n },\n components: {\n button: {\n color,\n 'foreground-color': foregroundColor,\n 'secondary-color': secondaryColor,\n 'secondary-fill-style': fillStyle,\n padding,\n 'border-radius': borderRadius,\n 'border-width': borderWidth,\n touch: { padding: touchPadding }\n }\n }\n } = theme;\n\n // Base\n const base = baseStyles(theme);\n\n // Non-text base\n const nonTextual = css`\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: ${hitAreaMouse};\n min-width: ${hitAreaMouse};\n border: ${borderWidth} solid transparent;\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n -webkit-user-select: none;\n user-select: none;\n white-space: nowrap;\n\n ${!icon &&\n css`\n padding: ${padding};\n `}\n\n ${icon &&\n css`\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n\n > svg {\n display: block;\n }\n `} ${compact &&\n css`\n min-height: ${hitAreaCompact};\n min-width: ${hitAreaCompact};\n `} @media (\n pointer: coarse) {\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n\n ${!compact &&\n css`\n min-height: ${hitAreaFinger};\n min-width: ${hitAreaFinger};\n `}\n\n ${!icon &&\n css`\n padding: ${touchPadding};\n `}\n }\n\n &:active {\n translate: 0 0.0625rem;\n }\n `;\n\n // Primary and Secondary-filled\n /* For primary button, use the foreground color as the text color. If foreground is 'auto', then calculate based on background\n For secondary button, always use the secondary color */\n const { contrastColor, hoverColors, activeColors } =\n variant !== 'primary' || foregroundColor === 'auto'\n ? getFilledButtonStyles(variant === 'primary' ? color : secondaryColor)\n : getFilledButtonStyles(foregroundColor, color);\n\n const solidButtonStyles = css`\n --button-background-color: ${variant === 'primary' ? color : secondaryColor};\n color: ${contrastColor};\n background-color: ${variant === 'primary' ? color : secondaryColor};\n\n @media (hover: hover) {\n &:hover {\n background-color: ${hoverColors.background};\n text-decoration: none;\n }\n }\n\n &:active {\n background-color: ${activeColors.background};\n color: ${activeColors.foreground};\n text-decoration: none;\n }\n `;\n\n // Secondary-outline\n const secondaryOutlineButtonStyles = getOutlinedButtonStyles(secondaryColor, backgroundColor);\n const secondary = css`\n --button-background-color: ${backgroundColor};\n color: ${secondaryOutlineButtonStyles.textColor};\n background-color: ${backgroundColor};\n border-color: ${secondaryColor};\n\n @media (hover: hover) {\n &:hover {\n background-color: ${secondaryOutlineButtonStyles.hoverBg};\n text-decoration: none;\n }\n }\n\n &:active {\n color: ${secondaryOutlineButtonStyles.activeFg};\n background-color: ${secondaryOutlineButtonStyles.activeBg};\n border-color: ${secondaryOutlineButtonStyles.activeFg};\n text-decoration: none;\n }\n `;\n\n // Simple\n const simpleButtonStyles = getOutlinedButtonStyles(\n fillStyle === 'outline' ? secondaryColor : color,\n backgroundColor\n );\n const simple = css`\n --button-background-color: ${icon ? 'transparent' : backgroundColor};\n color: ${icon ? 'currentColor' : simpleButtonStyles.textColor};\n background-color: ${icon ? 'transparent' : backgroundColor};\n\n @media (hover: hover) {\n &:hover {\n ${icon &&\n css`\n &::before {\n content: '';\n position: absolute;\n top: calc(${borderWidth} * -1);\n bottom: calc(${borderWidth} * -1);\n left: calc(${borderWidth} * -1);\n right: calc(${borderWidth} * -1);\n border-radius: inherit;\n background-color: currentColor;\n opacity: 0.1;\n }\n `}\n\n ${!icon &&\n css`\n background-color: ${simpleButtonStyles.hoverBg};\n color: ${simpleButtonStyles.hoverFg};\n border-color: ${simpleButtonStyles.hoverFg};\n text-decoration: none;\n `}\n }\n\n &:active {\n ${icon &&\n css`\n &::before {\n content: '';\n position: absolute;\n top: calc(${borderWidth} * -1);\n bottom: calc(${borderWidth} * -1);\n left: calc(${borderWidth} * -1);\n right: calc(${borderWidth} * -1);\n border-radius: inherit;\n background-color: currentColor;\n opacity: 0.2;\n }\n `}\n\n ${!icon &&\n css`\n background-color: ${simpleButtonStyles.activeBg};\n color: ${simpleButtonStyles.activeFg};\n border-color: ${simpleButtonStyles.activeFg};\n text-decoration: none;\n `}\n }\n }\n `;\n\n return css`\n ${base}\n ${nonTextual}\n ${(variant === 'primary' || (variant === 'secondary' && fillStyle === 'fill')) &&\n solidButtonStyles}\n ${variant === 'secondary' && fillStyle === 'outline' && secondary}\n ${variant === 'simple' && simple}\n ${variant === 'primary' &&\n css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `}\n\n ${loading &&\n css`\n ${StyledBackdrop} {\n background-color: var(--button-background-color);\n border-radius: inherit;\n }\n\n ${StyledProgressRing} {\n width: 1em;\n height: 1em;\n\n ${!icon &&\n css`\n margin-inline-end: calc(${spacing} / 2);\n `}\n circle:nth-child(2) {\n animation-duration: calc(${speed} * 2);\n }\n }\n `}\n `;\n }\n);\n\nStyledButton.defaultProps = defaultThemeProp;\n\nexport const StyledButtonLink = styled.a.withConfig(omitProps('loading'))<\n Pick<ButtonPropsWithDefaults, 'variant' | 'href'> &\n // Needed for omitProps\n Pick<ButtonProps, 'loading'>\n>(({ theme, variant, href }) => {\n const {\n base: {\n palette: { 'foreground-color': textVariantColor }\n },\n components: {\n button: { color: primaryColor, 'secondary-fill-style': fillStyle },\n link: { color: linkColor }\n }\n } = theme;\n\n let linkVariantColor = linkColor;\n if (!href && fillStyle === 'solid') {\n linkVariantColor = primaryColor;\n }\n const { background: activeLinkColor } = getActiveColors(linkVariantColor);\n const { background: activeTextColor } = getActiveColors(textVariantColor);\n\n const base = baseStyles(theme);\n\n const textual = css`\n background-color: transparent;\n display: inline;\n text-align: start;\n border: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n > ${StyledIcon} {\n vertical-align: bottom;\n }\n `;\n\n const link = css`\n color: ${linkVariantColor};\n\n &:active {\n color: ${activeLinkColor};\n }\n `;\n\n const text = css`\n color: ${textVariantColor};\n\n &:active {\n color: ${activeTextColor};\n }\n `;\n\n return css`\n ${base}\n ${textual}\n ${variant === 'link' && link}\n ${variant === 'text' && text}\n `;\n});\n\nStyledButtonLink.defaultProps = defaultThemeProp;\n\nconst Button: ForwardRefForwardPropsComponent<ButtonProps> = forwardRef(function Button(\n {\n variant = 'secondary',\n type = 'button',\n disabled = false,\n icon = false,\n compact = false,\n href,\n as,\n forwardedAs,\n label,\n 'aria-label': ariaLabel,\n 'aria-disabled': ariaDisabled,\n loading = false,\n children,\n className,\n ...restProps\n }: PropsWithoutRef<ButtonProps> & ForwardProps,\n ref: ButtonProps['ref']\n) {\n const [buttonEl, setButtonEl] = useElement<HTMLButtonElement | HTMLAnchorElement>();\n const mouseDownEvent = useRef<ReactMouseEvent>();\n const mouseDownPosition = useRef<DOMRect>();\n const mouseDownTimestamp = useRef<number>();\n const buttonRef = useConsolidatedRef(ref, setButtonEl);\n const isTextual = ['link', 'text'].includes(variant);\n const showProgress = loading && !isTextual;\n const StyledComp: React.ElementType = isTextual ? StyledButtonLink : StyledButton;\n\n const handleClickWithElementShift = (e: MouseEvent) => {\n if (\n buttonRef.current &&\n mouseDownPosition.current &&\n mouseDownTimestamp.current &&\n isPositionWithinRect({ x: e.clientX, y: e.clientY }, mouseDownPosition.current) &&\n Date.now() - mouseDownTimestamp.current < 500\n ) {\n // Only click if the button is still the topmost element at its own position.\n // If something has rendered over the button between mousedown and mouseup,\n // elementFromPoint will return that — not the button — and we should not trigger a click.\n const { x, y, width, height } = buttonRef.current.getBoundingClientRect();\n const elementAtPoint = document.elementFromPoint(x + width / 2, y + height / 2);\n if (buttonRef.current.contains(elementAtPoint) || elementAtPoint === buttonRef.current) {\n buttonRef.current.click();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('mouseup', handleClickWithElementShift);\n\n return () => {\n document.removeEventListener('mouseup', handleClickWithElementShift);\n mouseDownEvent.current = undefined;\n mouseDownPosition.current = undefined;\n mouseDownTimestamp.current = undefined;\n };\n }, []);\n\n return (\n <>\n <StyledComp\n {...restProps}\n ref={buttonRef}\n as={as || (href ? 'a' : 'button')}\n forwardedAs={forwardedAs || (href ? 'a' : 'button')}\n className={createClassName('button', className, { variant, icon, compact, loading })}\n variant={variant}\n icon={icon}\n compact={compact}\n type={href ? undefined : type}\n href={href}\n disabled={disabled && !href}\n aria-disabled={ariaDisabled}\n loading={showProgress}\n aria-label={ariaLabel || label}\n onMouseDown={(e: ReactMouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n (restProps.onMouseDown as MouseEventHandler | undefined)?.(e);\n e.persist();\n mouseDownEvent.current = e;\n mouseDownPosition.current = e.currentTarget.getBoundingClientRect();\n mouseDownTimestamp.current = Date.now();\n }}\n onMouseUp={(e: ReactMouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n const shouldFocus = mouseDownEvent.current && !mouseDownEvent.current.defaultPrevented;\n mouseDownEvent.current = undefined;\n mouseDownPosition.current = undefined;\n mouseDownTimestamp.current = undefined;\n\n if (shouldFocus && buttonRef.current !== document.activeElement) {\n buttonRef.current?.focus();\n }\n\n return (restProps.onMouseUp as MouseEventHandler | undefined)?.(e);\n }}\n >\n {showProgress && <Progress variant='ring' placement='inline' />}\n {!icon || !showProgress ? children : null}\n </StyledComp>\n\n {buttonEl && label && (\n <Tooltip target={buttonEl} showDelay='none' hideDelay='none' describeTarget={false}>\n {label}\n </Tooltip>\n )}\n </>\n );\n});\n\nexport default Button;\n"]}
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAQtD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AASxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EACL,eAAe,EACf,cAAc,EACd,YAAY,EACZ,SAAS,EACT,aAAa,EACb,WAAW,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,QAAQ,EAAE,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAuD3C,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IACzC,MAAM,EACJ,IAAI,EAAE,EACJ,OAAO,EACP,SAAS,EAAE,EAC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AAG,EAAE,CAAC;gBAC1C,CAAC,EACD,SAAS,EAAE,CAAC,CAAyD,EAAE,EAAE;oBACvE,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,gBAAgB,CAAC;oBACvF,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;oBACnC,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC;oBACtC,kBAAkB,CAAC,OAAO,GAAG,SAAS,CAAC;oBAEvC,IAAI,WAAW,IAAI,SAAS,CAAC,OAAO,KAAK,QAAQ,CAAC,aAAa,EAAE,CAAC;wBAChE,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;oBAC7B,CAAC;oBAED,OAAQ,SAAS,CAAC,SAA2C,EAAE,CAAC,CAAC,CAAC,CAAC;gBACrE,CAAC,aAEA,YAAY,IAAI,KAAC,QAAQ,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAC,QAAQ,GAAG,EAC9D,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAC9B,EAEZ,QAAQ,IAAI,KAAK,IAAI,CACpB,KAAC,OAAO,IAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,EAAC,cAAc,EAAE,KAAK,YAC/E,KAAK,GACE,CACX,IACA,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { useRef, useEffect, forwardRef } from 'react';\nimport type {\n ReactNode,\n PropsWithoutRef,\n Ref,\n MouseEventHandler,\n MouseEvent as ReactMouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { meetsContrastGuidelines, mix } from 'polished';\n\nimport type {\n BaseProps,\n ForwardProps,\n ForwardRefForwardPropsComponent,\n PropsWithDefaults,\n AsProp\n} from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { isPositionWithinRect, tryCatch, createClassName } from '../../utils';\nimport {\n getActiveColors,\n getHoverColors,\n isSolidColor,\n omitProps,\n readableColor,\n readableHue\n} from '../../styles';\nimport { useElement, useConsolidatedRef } from '../../hooks';\nimport Tooltip from '../Tooltip';\nimport Progress, { StyledProgressRing } from '../Progress';\nimport { StyledBackdrop } from '../Backdrop';\nimport { StyledIcon } from '../Icon';\nimport { StyledPopover } from '../Popover';\n\nexport interface ButtonProps extends BaseProps, AsProp {\n /** Text or content for the Button. */\n children: ReactNode;\n /**\n * Determines if the Button will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** A location to navigate to. Passing an href will render an anchor styled as a Button. */\n href?: string;\n /**\n * Controls the styling of the Button.\n * @default 'secondary'\n */\n variant?: 'primary' | 'secondary' | 'simple' | 'link' | 'text';\n /**\n * Controls the behavior of a Button within a Form.\n * @default 'button'\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Set the Icon prop to `true` if you're using just an Icon in your Button. Make sure to pass an Icon as children if `true`.\n * @default false\n */\n icon?: boolean;\n /**\n * Used for a smaller sized button.\n * @default false\n */\n compact?: boolean;\n /** The label text will be used inside a Tooltip. */\n label?: string;\n /** The aria label text will be inserted as the aria-label on the Button. */\n 'aria-label'?: string;\n /**\n * Applies visual disabled styles without disabling the button element itself.\n * @default false\n */\n 'aria-disabled'?: boolean | 'true' | 'false';\n /**\n * Optionally renders an indeterminate progress indicator in a button.\n * @default false\n */\n loading?: boolean;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLButtonElement | HTMLAnchorElement>;\n}\n\ntype ButtonPropsWithDefaults = PropsWithDefaults<\n ButtonProps,\n 'variant' | 'type' | 'disabled' | 'icon' | 'loading'\n>;\n\nconst baseStyles = (theme: DefaultTheme) => {\n const {\n base: {\n spacing,\n animation: {\n speed,\n timing: { ease }\n },\n 'disabled-opacity': disabledOpacity\n },\n components: {\n button: { 'focus-shadow': focusShadow }\n }\n } = theme;\n\n return css`\n text-decoration: none;\n transition-property: background-color, color, border-color, box-shadow, translate;\n transition-duration: calc(0.5 * ${speed});\n transition-timing-function: ${ease};\n cursor: pointer;\n\n @media (forced-colors: none) {\n outline: none;\n }\n\n & + & {\n margin-inline-start: ${spacing};\n }\n\n /* Not able to combine with selector above. Stylis bug? */\n\n & + ${StyledPopover} + & {\n margin-inline-start: ${spacing};\n }\n\n &:disabled,\n &[disabled] {\n opacity: ${disabledOpacity};\n cursor: not-allowed;\n pointer-events: none;\n }\n\n &[aria-disabled='true'] {\n opacity: ${disabledOpacity};\n }\n\n &:not([disabled], [aria-disabled='true']):focus-visible,\n &:enabled:not([aria-disabled='true']):focus-visible {\n box-shadow: ${focusShadow};\n }\n `;\n};\n\n/* If the background color is not provided, the color will be used for the hover and active styles */\nconst getFilledButtonStyles = (color: string, backgroundColor?: string) => ({\n contrastColor: backgroundColor ? color : tryCatch(() => readableColor(color)),\n hoverColors: getHoverColors(backgroundColor || color),\n activeColors: getActiveColors(backgroundColor || color)\n});\n\nconst getOutlinedButtonStyles = (color: string, backgroundColor: string) => {\n // If the background color is not solid, use the readable color for the text\n const fallbackBackground = isSolidColor(backgroundColor) ? backgroundColor : readableColor(color);\n const backgroundUsable = tryCatch(() => meetsContrastGuidelines(color, fallbackBackground).AA);\n const usableColor = backgroundUsable ? color : readableHue(color, backgroundColor);\n const hoverBackgroundColor = tryCatch(() => mix(0.9, backgroundColor, color));\n const activeBackgroundColor = tryCatch(() => mix(0.8, backgroundColor, usableColor));\n\n return {\n textColor: backgroundUsable ? color : readableColor(color),\n hoverBg: hoverBackgroundColor,\n hoverFg: readableHue(color, hoverBackgroundColor ?? 'transparent'),\n activeBg: tryCatch(() => mix(0.8, backgroundColor, usableColor)),\n activeFg: readableHue(usableColor, activeBackgroundColor ?? 'transparent')\n };\n};\n\nexport const StyledButton = styled.button.withConfig(omitProps('loading'))<ButtonPropsWithDefaults>(\n ({ variant, icon, loading, compact, theme }) => {\n const {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'primary-background': backgroundColor },\n 'hit-area': {\n 'mouse-min': hitAreaMouse,\n 'finger-min': hitAreaFinger,\n 'compact-min': hitAreaCompact\n },\n animation: { speed }\n },\n components: {\n button: {\n color,\n height,\n 'foreground-color': foregroundColor,\n 'secondary-color': secondaryColor,\n 'secondary-fill-style': fillStyle,\n padding,\n 'border-radius': borderRadius,\n 'border-width': borderWidth,\n touch: { padding: touchPadding }\n }\n }\n } = theme;\n\n // Base\n const base = baseStyles(theme);\n\n // Non-text base\n const nonTextual = css`\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: ${hitAreaMouse};\n min-width: ${hitAreaMouse};\n border: ${borderWidth} solid transparent;\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n -webkit-user-select: none;\n user-select: none;\n white-space: nowrap;\n\n ${!icon &&\n css`\n padding: ${padding};\n `}\n\n ${icon &&\n css`\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n\n > svg {\n display: block;\n }\n `}\n\n ${!icon &&\n !compact &&\n css`\n min-height: ${height};\n `}\n\n ${compact &&\n css`\n min-height: ${hitAreaCompact};\n min-width: ${hitAreaCompact};\n `}\n\n @media (pointer: coarse) {\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n\n ${!compact &&\n css`\n min-height: ${icon ? `${hitAreaFinger}` : `max(${hitAreaFinger}, ${height})`};\n min-width: ${hitAreaFinger};\n `}\n\n ${!icon &&\n css`\n padding: ${touchPadding};\n `}\n }\n\n &:active {\n translate: 0 0.0625rem;\n }\n `;\n\n // Primary and Secondary-filled\n /* For primary button, use the foreground color as the text color. If foreground is 'auto', then calculate based on background\n For secondary button, always use the secondary color */\n const { contrastColor, hoverColors, activeColors } =\n variant !== 'primary' || foregroundColor === 'auto'\n ? getFilledButtonStyles(variant === 'primary' ? color : secondaryColor)\n : getFilledButtonStyles(foregroundColor, color);\n\n const solidButtonStyles = css`\n --button-background-color: ${variant === 'primary' ? color : secondaryColor};\n color: ${contrastColor};\n background-color: ${variant === 'primary' ? color : secondaryColor};\n\n @media (hover: hover) {\n &:hover {\n background-color: ${hoverColors.background};\n text-decoration: none;\n }\n }\n\n &:active {\n background-color: ${activeColors.background};\n color: ${activeColors.foreground};\n text-decoration: none;\n }\n `;\n\n // Secondary-outline\n const secondaryOutlineButtonStyles = getOutlinedButtonStyles(secondaryColor, backgroundColor);\n const secondary = css`\n --button-background-color: ${backgroundColor};\n color: ${secondaryOutlineButtonStyles.textColor};\n background-color: ${backgroundColor};\n border-color: ${secondaryColor};\n\n @media (hover: hover) {\n &:hover {\n background-color: ${secondaryOutlineButtonStyles.hoverBg};\n text-decoration: none;\n }\n }\n\n &:active {\n color: ${secondaryOutlineButtonStyles.activeFg};\n background-color: ${secondaryOutlineButtonStyles.activeBg};\n border-color: ${secondaryOutlineButtonStyles.activeFg};\n text-decoration: none;\n }\n `;\n\n // Simple\n const simpleButtonStyles = getOutlinedButtonStyles(\n fillStyle === 'outline' ? secondaryColor : color,\n backgroundColor\n );\n const simple = css`\n --button-background-color: ${icon ? 'transparent' : backgroundColor};\n color: ${icon ? 'currentColor' : simpleButtonStyles.textColor};\n background-color: ${icon ? 'transparent' : backgroundColor};\n\n @media (hover: hover) {\n &:hover {\n ${icon &&\n css`\n &::before {\n content: '';\n position: absolute;\n top: calc(${borderWidth} * -1);\n bottom: calc(${borderWidth} * -1);\n left: calc(${borderWidth} * -1);\n right: calc(${borderWidth} * -1);\n border-radius: inherit;\n background-color: currentColor;\n opacity: 0.1;\n }\n `}\n\n ${!icon &&\n css`\n background-color: ${simpleButtonStyles.hoverBg};\n color: ${simpleButtonStyles.hoverFg};\n border-color: ${simpleButtonStyles.hoverFg};\n text-decoration: none;\n `}\n }\n\n &:active {\n ${icon &&\n css`\n &::before {\n content: '';\n position: absolute;\n top: calc(${borderWidth} * -1);\n bottom: calc(${borderWidth} * -1);\n left: calc(${borderWidth} * -1);\n right: calc(${borderWidth} * -1);\n border-radius: inherit;\n background-color: currentColor;\n opacity: 0.2;\n }\n `}\n\n ${!icon &&\n css`\n background-color: ${simpleButtonStyles.activeBg};\n color: ${simpleButtonStyles.activeFg};\n border-color: ${simpleButtonStyles.activeFg};\n text-decoration: none;\n `}\n }\n }\n `;\n\n return css`\n ${base}\n ${nonTextual}\n ${(variant === 'primary' || (variant === 'secondary' && fillStyle === 'fill')) &&\n solidButtonStyles}\n ${variant === 'secondary' && fillStyle === 'outline' && secondary}\n ${variant === 'simple' && simple}\n ${variant === 'primary' &&\n css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `}\n\n ${loading &&\n css`\n ${StyledBackdrop} {\n background-color: var(--button-background-color);\n border-radius: inherit;\n }\n\n ${StyledProgressRing} {\n width: 1em;\n height: 1em;\n\n ${!icon &&\n css`\n margin-inline-end: calc(${spacing} / 2);\n `}\n circle:nth-child(2) {\n animation-duration: calc(${speed} * 2);\n }\n }\n `}\n `;\n }\n);\n\nStyledButton.defaultProps = defaultThemeProp;\n\nexport const StyledButtonLink = styled.a.withConfig(omitProps('loading'))<\n Pick<ButtonPropsWithDefaults, 'variant' | 'href'> &\n // Needed for omitProps\n Pick<ButtonProps, 'loading'>\n>(({ theme, variant, href }) => {\n const {\n base: {\n palette: { 'foreground-color': textVariantColor }\n },\n components: {\n button: { color: primaryColor, 'secondary-fill-style': fillStyle },\n link: { color: linkColor }\n }\n } = theme;\n\n let linkVariantColor = linkColor;\n if (!href && fillStyle === 'solid') {\n linkVariantColor = primaryColor;\n }\n const { background: activeLinkColor } = getActiveColors(linkVariantColor);\n const { background: activeTextColor } = getActiveColors(textVariantColor);\n\n const base = baseStyles(theme);\n\n const textual = css`\n background-color: transparent;\n display: inline;\n text-align: start;\n border: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n > ${StyledIcon} {\n vertical-align: bottom;\n }\n `;\n\n const link = css`\n color: ${linkVariantColor};\n\n &:active {\n color: ${activeLinkColor};\n }\n `;\n\n const text = css`\n color: ${textVariantColor};\n\n &:active {\n color: ${activeTextColor};\n }\n `;\n\n return css`\n ${base}\n ${textual}\n ${variant === 'link' && link}\n ${variant === 'text' && text}\n `;\n});\n\nStyledButtonLink.defaultProps = defaultThemeProp;\n\nconst Button: ForwardRefForwardPropsComponent<ButtonProps> = forwardRef(function Button(\n {\n variant = 'secondary',\n type = 'button',\n disabled = false,\n icon = false,\n compact = false,\n href,\n as,\n forwardedAs,\n label,\n 'aria-label': ariaLabel,\n 'aria-disabled': ariaDisabled,\n loading = false,\n children,\n className,\n ...restProps\n }: PropsWithoutRef<ButtonProps> & ForwardProps,\n ref: ButtonProps['ref']\n) {\n const [buttonEl, setButtonEl] = useElement<HTMLButtonElement | HTMLAnchorElement>();\n const mouseDownEvent = useRef<ReactMouseEvent>();\n const mouseDownPosition = useRef<DOMRect>();\n const mouseDownTimestamp = useRef<number>();\n const buttonRef = useConsolidatedRef(ref, setButtonEl);\n const isTextual = ['link', 'text'].includes(variant);\n const showProgress = loading && !isTextual;\n const StyledComp: React.ElementType = isTextual ? StyledButtonLink : StyledButton;\n\n const handleClickWithElementShift = (e: MouseEvent) => {\n if (\n buttonRef.current &&\n mouseDownPosition.current &&\n mouseDownTimestamp.current &&\n isPositionWithinRect({ x: e.clientX, y: e.clientY }, mouseDownPosition.current) &&\n Date.now() - mouseDownTimestamp.current < 500\n ) {\n // Only click if the button is still the topmost element at its own position.\n // If something has rendered over the button between mousedown and mouseup,\n // elementFromPoint will return that — not the button — and we should not trigger a click.\n const { x, y, width, height } = buttonRef.current.getBoundingClientRect();\n const elementAtPoint = document.elementFromPoint(x + width / 2, y + height / 2);\n if (buttonRef.current.contains(elementAtPoint) || elementAtPoint === buttonRef.current) {\n buttonRef.current.click();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('mouseup', handleClickWithElementShift);\n\n return () => {\n document.removeEventListener('mouseup', handleClickWithElementShift);\n mouseDownEvent.current = undefined;\n mouseDownPosition.current = undefined;\n mouseDownTimestamp.current = undefined;\n };\n }, []);\n\n return (\n <>\n <StyledComp\n {...restProps}\n ref={buttonRef}\n as={as || (href ? 'a' : 'button')}\n forwardedAs={forwardedAs || (href ? 'a' : 'button')}\n className={createClassName('button', className, { variant, icon, compact, loading })}\n variant={variant}\n icon={icon}\n compact={compact}\n type={href ? undefined : type}\n href={href}\n disabled={disabled && !href}\n aria-disabled={ariaDisabled}\n loading={showProgress}\n aria-label={ariaLabel || label}\n onMouseDown={(e: ReactMouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n (restProps.onMouseDown as MouseEventHandler | undefined)?.(e);\n e.persist();\n mouseDownEvent.current = e;\n mouseDownPosition.current = e.currentTarget.getBoundingClientRect();\n mouseDownTimestamp.current = Date.now();\n }}\n onMouseUp={(e: ReactMouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n const shouldFocus = mouseDownEvent.current && !mouseDownEvent.current.defaultPrevented;\n mouseDownEvent.current = undefined;\n mouseDownPosition.current = undefined;\n mouseDownTimestamp.current = undefined;\n\n if (shouldFocus && buttonRef.current !== document.activeElement) {\n buttonRef.current?.focus();\n }\n\n return (restProps.onMouseUp as MouseEventHandler | undefined)?.(e);\n }}\n >\n {showProgress && <Progress variant='ring' placement='inline' />}\n {!icon || !showProgress ? children : null}\n </StyledComp>\n\n {buttonEl && label && (\n <Tooltip target={buttonEl} showDelay='none' hideDelay='none' describeTarget={false}>\n {label}\n </Tooltip>\n )}\n </>\n );\n});\n\nexport default Button;\n"]}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { Ref } from 'react';
|
|
2
2
|
import type { BaseProps, ForwardRefForwardPropsComponent } from '../../types';
|
|
3
|
-
export
|
|
3
|
+
export type QRCodeSize = 's' | 'm' | 'l';
|
|
4
|
+
export declare const StyledEmptyQRWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
5
|
+
$qrSize: QRCodeSize;
|
|
6
|
+
}>> & string;
|
|
4
7
|
export interface QRCodeProps extends BaseProps {
|
|
5
8
|
/** Text that need to be encoded into QR code. */
|
|
6
9
|
value: string;
|
|
7
10
|
/** The HTML alt attribute for the image. */
|
|
8
11
|
label?: string;
|
|
12
|
+
/** Size of the QR code. */
|
|
13
|
+
size?: QRCodeSize;
|
|
9
14
|
/** Ref for the wrapping element. */
|
|
10
15
|
ref?: Ref<HTMLImageElement | HTMLDivElement>;
|
|
11
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QRCode.d.ts","sourceRoot":"","sources":["../../../src/components/QRCode/QRCode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAIlD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAO9E,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"QRCode.d.ts","sourceRoot":"","sources":["../../../src/components/QRCode/QRCode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAIlD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAO9E,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAazC,eAAO,MAAM,oBAAoB;aAAyB,UAAU;YASnE,CAAC;AAIF,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;CAC9C;AAED,QAAA,MAAM,MAAM,EAAE,+BAA+B,CAAC,WAAW,CAkDvD,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -7,17 +7,23 @@ import Flex from '../Flex';
|
|
|
7
7
|
import Image from '../Image';
|
|
8
8
|
import { useI18n } from '../../hooks';
|
|
9
9
|
import EmptyState from '../EmptyState';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
height: ${theme.
|
|
13
|
-
width:
|
|
10
|
+
const StyledQRCodeImage = styled(Image)(({ theme, $qrSize }) => css `
|
|
11
|
+
width: ${theme.components['qr-code'].size[$qrSize]};
|
|
12
|
+
height: ${theme.components['qr-code'].size[$qrSize]};
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
max-height: 100%;
|
|
15
|
+
`);
|
|
16
|
+
StyledQRCodeImage.defaultProps = defaultThemeProp;
|
|
17
|
+
export const StyledEmptyQRWrapper = styled.div(({ theme, $qrSize }) => css `
|
|
18
|
+
height: ${theme.components['qr-code'].size[$qrSize]};
|
|
19
|
+
width: ${theme.components['qr-code'].size[$qrSize]};
|
|
20
|
+
max-width: 100%;
|
|
14
21
|
border: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
15
22
|
border-radius: calc(${theme.base['border-radius']} / 2);
|
|
16
23
|
text-align: center;
|
|
17
|
-
|
|
18
|
-
});
|
|
24
|
+
`);
|
|
19
25
|
StyledEmptyQRWrapper.defaultProps = defaultThemeProp;
|
|
20
|
-
const QRCode = forwardRef(function QRCode({ value, label = value, ...restProps }, ref) {
|
|
26
|
+
const QRCode = forwardRef(function QRCode({ value, label = value, size = 'm', ...restProps }, ref) {
|
|
21
27
|
const [dataURL, setDataURL] = useState('');
|
|
22
28
|
const t = useI18n();
|
|
23
29
|
const mounted = useRef(false);
|
|
@@ -37,13 +43,13 @@ const QRCode = forwardRef(function QRCode({ value, label = value, ...restProps }
|
|
|
37
43
|
setDataURL('');
|
|
38
44
|
});
|
|
39
45
|
}, [value]);
|
|
40
|
-
return dataURL ? (_jsx(
|
|
46
|
+
return dataURL ? (_jsx(StyledQRCodeImage, { ...restProps, ref: ref, "$qrSize": size, src: dataURL, alt: label })) : (_jsx(Flex, { ...restProps, ref: ref, container: {
|
|
41
47
|
direction: 'column',
|
|
42
48
|
alignItems: 'center',
|
|
43
49
|
justify: 'center',
|
|
44
50
|
gap: 1,
|
|
45
51
|
pad: 2
|
|
46
|
-
}, as: StyledEmptyQRWrapper, children: _jsx(EmptyState, { message: t('qr_code_not_available') }) }));
|
|
52
|
+
}, as: StyledEmptyQRWrapper, "$qrSize": size, children: _jsx(EmptyState, { message: t('qr_code_not_available') }) }));
|
|
47
53
|
});
|
|
48
54
|
export default QRCode;
|
|
49
55
|
//# sourceMappingURL=QRCode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QRCode.js","sourceRoot":"","sources":["../../../src/components/QRCode/QRCode.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,SAAS,MAAM,QAAQ,CAAC;AACpC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,UAAU,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"QRCode.js","sourceRoot":"","sources":["../../../src/components/QRCode/QRCode.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,SAAS,MAAM,QAAQ,CAAC;AACpC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB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CAAC;IAEpB,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QACvB,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC;aACvB,IAAI,CAAC,OAAO,CAAC,EAAE;YACd,IAAI,OAAO,CAAC,OAAO;gBAAE,UAAU,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,UAAU,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,OAAO,CAAC,CAAC,CAAC,CACf,KAAC,iBAAiB,OACZ,SAAS,EACb,GAAG,EAAE,GAA4B,aACxB,IAAI,EACb,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,KAAK,GACV,CACH,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,OACC,SAAS,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE;YACT,SAAS,EAAE,QAAQ;YACnB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,QAAQ;YACjB,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;SACP,EACD,EAAE,EAAE,oBAAoB,aACf,IAAI,YAEb,KAAC,UAAU,IAAC,OAAO,EAAE,CAAC,CAAC,uBAAuB,CAAC,GAAI,GAC9C,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport * as QRCodeLib from 'qrcode';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardRefForwardPropsComponent } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport Image from '../Image';\nimport { useI18n } from '../../hooks';\nimport EmptyState from '../EmptyState';\n\nexport type QRCodeSize = 's' | 'm' | 'l';\n\nconst StyledQRCodeImage = styled(Image)<{ $qrSize: QRCodeSize }>(\n ({ theme, $qrSize }) => css`\n width: ${theme.components['qr-code'].size[$qrSize]};\n height: ${theme.components['qr-code'].size[$qrSize]};\n max-width: 100%;\n max-height: 100%;\n `\n);\n\nStyledQRCodeImage.defaultProps = defaultThemeProp;\n\nexport const StyledEmptyQRWrapper = styled.div<{ $qrSize: QRCodeSize }>(\n ({ theme, $qrSize }) => css`\n height: ${theme.components['qr-code'].size[$qrSize]};\n width: ${theme.components['qr-code'].size[$qrSize]};\n max-width: 100%;\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(${theme.base['border-radius']} / 2);\n text-align: center;\n `\n);\n\nStyledEmptyQRWrapper.defaultProps = defaultThemeProp;\n\nexport interface QRCodeProps extends BaseProps {\n /** Text that need to be encoded into QR code. */\n value: string;\n /** The HTML alt attribute for the image. */\n label?: string;\n /** Size of the QR code. */\n size?: QRCodeSize;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLImageElement | HTMLDivElement>;\n}\n\nconst QRCode: ForwardRefForwardPropsComponent<QRCodeProps> = forwardRef(function QRCode(\n { value, label = value, size = 'm', ...restProps }: PropsWithoutRef<QRCodeProps>,\n ref: QRCodeProps['ref']\n) {\n const [dataURL, setDataURL] = useState('');\n const t = useI18n();\n\n const mounted = useRef(false);\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n useEffect(() => {\n QRCodeLib.toDataURL(value)\n .then(results => {\n if (mounted.current) setDataURL(results);\n })\n .catch(() => {\n setDataURL('');\n });\n }, [value]);\n\n return dataURL ? (\n <StyledQRCodeImage\n {...restProps}\n ref={ref as Ref<HTMLImageElement>}\n $qrSize={size}\n src={dataURL}\n alt={label}\n />\n ) : (\n <Flex\n {...restProps}\n ref={ref}\n container={{\n direction: 'column',\n alignItems: 'center',\n justify: 'center',\n gap: 1,\n pad: 2\n }}\n as={StyledEmptyQRWrapper}\n $qrSize={size}\n >\n <EmptyState message={t('qr_code_not_available')} />\n </Flex>\n );\n});\n\nexport default QRCode;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QRCode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QRCode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/QRCode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default } from './QRCode';\nexport type { QRCodeProps } from './QRCode';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/QRCode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default } from './QRCode';\nexport type { QRCodeProps, QRCodeSize } from './QRCode';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAmB,MAAM,OAAO,CAAC;AAI7D,OAAO,KA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AM,IAAI,EAAE,+BAA+B,CAAC,SAAS,CAOnD,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -23,6 +23,8 @@ export const StyledText = styled.span(props => {
|
|
|
23
23
|
font-size: ${fontSizes[text[variant]['font-size']]};
|
|
24
24
|
font-weight: ${text[variant]['font-weight']};
|
|
25
25
|
font-family: ${text[variant]['font-family'] || fontFamily};
|
|
26
|
+
text-transform: ${text[variant]['text-transform']};
|
|
27
|
+
letter-spacing: ${text[variant]['letter-spacing']};
|
|
26
28
|
color: ${color};
|
|
27
29
|
`;
|
|
28
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAShC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAmBjD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAwB,KAAK,CAAC,EAAE;IACnE,MAAM,EACJ,OAAO,EACP,MAAM,EACN,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,WAAW,EAAE,QAAQ,EACrB,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,UAAU,EACzB,OAAO,EAAE,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EACvF,YAAY,EAAE,EAAE,eAAe,EAAE,cAAc,EAAE,EAClD,EACD,UAAU,EAAE,EAAE,IAAI,EAAE,EACrB,EACF,GAAG,KAAK,CA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,OAAO,KAAC,UAAU,IAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAM,SAAS,GAAI,CAAC;AAC3E,CAAC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { ReactNode, Ref, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\n\nimport type {\n HeadingTag,\n BaseProps,\n ForwardRefForwardPropsComponent,\n AsProp,\n PropsWithDefaults\n} from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { calculateFontSize } from '../../styles';\nimport type { FontSize } from '../../styles';\n\nexport interface TextProps extends BaseProps, AsProp {\n /** Text content. */\n children: ReactNode;\n /**\n * Typographical sizes and styles.\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | HeadingTag;\n /** Render text with semantic color based on a status. */\n status?: 'error' | 'warning' | 'success';\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLSpanElement | HTMLHeadingElement>;\n}\n\ntype TextPropsWithDefaults = PropsWithDefaults<TextProps, 'variant'>;\n\nexport const StyledText = styled.span<TextPropsWithDefaults>(props => {\n const {\n variant,\n status,\n theme: {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n 'font-family': fontFamily,\n palette: { 'foreground-color': foregroundColor, urgent: error, warn: warning, success },\n transparency: { 'transparent-2': secondaryAlpha }\n },\n components: { text }\n }\n } = props;\n\n let color: string | undefined;\n\n if (status) {\n color = {\n error,\n warning,\n success\n }[status];\n }\n\n if (variant === 'secondary') {\n color = tryCatch(() => rgba(color ?? foregroundColor, secondaryAlpha));\n }\n\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n font-size: ${fontSizes[text[variant]['font-size'] as FontSize]};\n font-weight: ${text[variant]['font-weight']};\n font-family: ${text[variant]['font-family'] || fontFamily};\n text-transform: ${text[variant]['text-transform']};\n letter-spacing: ${text[variant]['letter-spacing']};\n color: ${color};\n `;\n});\n\nStyledText.defaultProps = defaultThemeProp;\n\nconst Text: ForwardRefForwardPropsComponent<TextProps> = forwardRef(function Text(\n { variant = 'primary', as, ...restProps }: PropsWithoutRef<TextProps>,\n ref: TextProps['ref']\n) {\n // If variant is for a heading, and no as is passed, set as to heading tag.\n if (!as && /h\\d/i.test(variant)) as = variant as HeadingTag;\n return <StyledText ref={ref} variant={variant} as={as} {...restProps} />;\n});\n\nexport default Text;\n"]}
|
package/lib/hooks/useI18n.d.ts
CHANGED
|
@@ -468,6 +468,8 @@ declare const useI18n: () => import("../i18n/translate").TranslationFunction<Rea
|
|
|
468
468
|
agent_switcher: string;
|
|
469
469
|
message_pega_gen_ai_coach: string;
|
|
470
470
|
write_message: string;
|
|
471
|
+
ask_anything: string;
|
|
472
|
+
what_can_i_help_you_with: string;
|
|
471
473
|
ai_disclaimer: string;
|
|
472
474
|
suggestions: string;
|
|
473
475
|
you: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../src/hooks/useI18n.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,QAAA,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../src/hooks/useI18n.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/lib/i18n/default.d.ts
CHANGED
|
@@ -464,6 +464,8 @@ declare const _default: {
|
|
|
464
464
|
agent_switcher: string;
|
|
465
465
|
message_pega_gen_ai_coach: string;
|
|
466
466
|
write_message: string;
|
|
467
|
+
ask_anything: string;
|
|
468
|
+
what_can_i_help_you_with: string;
|
|
467
469
|
ai_disclaimer: string;
|
|
468
470
|
suggestions: string;
|
|
469
471
|
you: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/i18n/default.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/i18n/default.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAlsE3C,wBAkvEE"}
|
package/lib/i18n/default.js
CHANGED
|
@@ -510,6 +510,8 @@ export default {
|
|
|
510
510
|
agent_switcher: '{0}, agent switcher',
|
|
511
511
|
message_pega_gen_ai_coach: 'Your message',
|
|
512
512
|
write_message: 'Write a message',
|
|
513
|
+
ask_anything: 'Ask {0} anything',
|
|
514
|
+
what_can_i_help_you_with: 'What can I help you with?',
|
|
513
515
|
ai_disclaimer: 'Verify AI-generated content for accuracy.',
|
|
514
516
|
suggestions: 'Suggestions',
|
|
515
517
|
you: 'You',
|