@pega/cosmos-react-core 9.0.0-build.12.1 → 9.0.0-build.12.3
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/Badges/Count.d.ts.map +1 -1
- package/lib/components/Badges/Count.js +7 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +5 -4
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +2 -2
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +4 -0
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-string-field.icon.js +1 -1
- package/lib/components/Icon/icons/dataviz-string-field.icon.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +16 -0
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +4 -0
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +4 -0
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +7 -4
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js +2 -2
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +13 -5
- package/lib/components/Switch/Switch.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,YAAY,CAAC,SAAS,CAAC,CAAC;AA0BxB,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CACrC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EACJ,UAAU,EAAE,EACV,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,EACvF,EACF,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;;iCAGmB,KAAK;gBACtB,MAAM;;;;mCAIa,UAAU;kBAC3B,WAAW;;;;YAIjB,UAAU;;uCAEiB,KAAK;6BACf,MAAM;4BACP,MAAM;;;yCAGO,UAAU;+BACpB,WAAW;8B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,EAAE,EAAE,aACpE,KAAK,EACL,EAAE,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,IACvB,IACM,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { ChangeEvent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport type { BaseProps, ForwardRefForwardPropsComponent, NoChildrenProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport type { FormControlProps } from '../FormControl';\nimport { useDirection, useUID } from '../../hooks';\nimport Flex from '../Flex';\nimport { getHoverColors, readableColor } from '../../styles';\nimport Icon, { StyledIcon, registerIcon } from '../Icon';\nimport * as checkIcon from '../Icon/icons/check.icon';\nimport { tryCatch } from '../../utils';\n\nregisterIcon(checkIcon);\n\nexport interface SwitchProps extends BaseProps, NoChildrenProp {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /**\n * Disables the control.\n * @default false\n */\n disabled?: FormControlProps['disabled'];\n /**\n * Sets checked prop via onChange.\n * @default false\n */\n on?: boolean;\n /** Callback that is triggered when the Switch is toggled. */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Ref for the input element. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport const SwitchLabel = styled.label(\n ({\n theme: {\n base,\n components: {\n switch: { width, height, 'touch-width': touchWidth, 'touch-height': touchHeight, off }\n }\n }\n }) => {\n return css`\n position: relative;\n cursor: pointer;\n padding-inline-end: calc(${width} + 0.5rem);\n height: ${height};\n width: 100%;\n\n @media (pointer: coarse) {\n padding-inline-end: calc(${touchWidth} + 0.5rem);\n height: ${touchHeight};\n }\n\n /** Checkmark */\n & > ${StyledIcon} {\n position: absolute;\n inset-inline-end: calc(0.5 * ${width} + 0.25rem);\n height: calc(0.5 * ${height});\n width: calc(0.5 * ${height});\n\n @media (pointer: coarse) {\n inset-inline-end: calc(0.5 * ${touchWidth} + 0.25rem);\n height: calc(0.5 * ${touchHeight});\n width: calc(0.5 * ${touchHeight});\n }\n\n /* Use preferred color for icon because track takes opposite of background color */\n @media (forced-colors: active) and (prefers-color-scheme: dark) {\n fill: black;\n }\n\n @media (forced-colors: active) and (prefers-color-scheme: light) {\n fill: white;\n }\n }\n\n /** Track */\n &::before {\n position: absolute;\n content: '';\n inset-inline-end: 0;\n width: ${width};\n border: solid calc(${height} / 2) ${off.color};\n transition: background-color calc(0.5 * ${base.animation.speed})\n ${base.animation.timing.ease};\n border-radius: calc(9999 * ${base['border-radius']});\n\n @media (pointer: coarse) {\n width: ${touchWidth};\n height: ${touchHeight};\n }\n }\n\n /** Switch */\n &::after {\n position: absolute;\n content: '';\n inset-inline-end: calc(${width} - ${height} + 0.0625rem);\n height: calc(${height} - 0.125rem);\n width: calc(${height} - 0.125rem);\n background-color: ${base.palette['primary-background']};\n transition: transform calc(0.5 * ${base.animation.speed}) ${base.animation.timing.ease};\n border-radius: calc(9999 * ${base['border-radius']});\n\n @media (pointer: coarse) {\n inset-inline-end: calc(${touchWidth} - ${touchHeight} + 0.0625rem);\n height: calc(${touchHeight} - 0.125rem);\n width: calc(${touchHeight} - 0.125rem);\n }\n }\n `;\n }\n);\n\nSwitchLabel.defaultProps = defaultThemeProp;\n\nexport const SwitchInput = styled.input(\n ({\n theme: {\n base,\n components: {\n 'form-control': {\n ':focus': { 'box-shadow': shadow }\n },\n switch: { height, width, 'touch-height': touchHeight, 'touch-width': touchWidth, on, off }\n }\n }\n }) => {\n const { ltr } = useDirection();\n\n const checkmarkColor = tryCatch(() => readableColor(on.color));\n\n const onHoverColors = getHoverColors(on.color);\n const offHoverColors = getHoverColors(off.color);\n\n return css`\n ${hideVisually}\n\n & + ${SwitchLabel} {\n min-height: ${base['hit-area']['mouse-min']};\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n }\n\n & + ${SwitchLabel} > ${StyledIcon} {\n color: ${checkmarkColor};\n }\n\n &:checked + ${SwitchLabel}::before {\n border-color: ${on.color};\n }\n\n &:checked + ${SwitchLabel}::after {\n transform: translateX(calc((${width} - ${height}) * ${ltr ? '1' : '-1'}));\n\n @media (pointer: coarse) {\n transform: translateX(calc((${touchWidth} - ${touchHeight}) * ${ltr ? '1' : '-1'}));\n }\n }\n\n &:hover + ${SwitchLabel} > ${StyledIcon} {\n color: ${onHoverColors.foreground};\n }\n\n &:hover:checked + ${SwitchLabel}::before {\n border-color: ${onHoverColors.background};\n }\n\n &:hover + ${SwitchLabel}::before {\n border-color: ${offHoverColors.background};\n }\n\n &:focus + ${SwitchLabel}::before {\n box-shadow: ${shadow};\n }\n\n &:disabled + ${SwitchLabel} {\n opacity: ${base['disabled-opacity']};\n }\n `;\n }\n);\n\nSwitchInput.defaultProps = defaultThemeProp;\n\nexport const StyledSwitch = styled.div``;\n\nconst Switch: ForwardRefForwardPropsComponent<SwitchProps> = forwardRef(function Switch(\n props: PropsWithoutRef<SwitchProps>,\n ref: SwitchProps['ref']\n) {\n const uid = useUID();\n const { id = uid, label, disabled = false, on = false, onChange, ...restProps } = props;\n\n return (\n <StyledSwitch>\n <SwitchInput\n {...restProps}\n id={id}\n type='checkbox'\n role='switch'\n checked={on}\n disabled={disabled}\n onChange={onChange}\n ref={ref}\n />\n <Flex container={{ alignItems: 'center' }} as={SwitchLabel} htmlFor={id}>\n {label}\n {on && <Icon name='check' />}\n </Flex>\n </StyledSwitch>\n );\n});\n\nexport default Switch;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-core",
|
|
3
|
-
"version": "9.0.0-build.12.
|
|
3
|
+
"version": "9.0.0-build.12.3",
|
|
4
4
|
"description": "Cosmos is a visual design system and UI component collection. Its goal is to empower application developers in their pursuit to create engaging and rewarding user experiences.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|