@elliemae/ds-form-checkbox 3.29.2-rc.0 → 3.30.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,23 +42,33 @@ const ControlledCheckBoxContent = () => {
42
42
  const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } = import_react.default.useContext(import_ControlledCheckboxCTX.ControlledCheckBoxContext);
43
43
  const { checked, device, label, hasError, wrapLabel, ariaControls: legacyAriaControls } = propsWithDefault;
44
44
  const { disabled, readOnly, "aria-controls": ariaControls, className } = globalProps;
45
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledContainer, { device, "data-testid": "ds-checkbox-container", className, ...xstyledProps, children: [
46
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledCheckBox, { device, checked, hasError, disabled, readOnly, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_MainInput.MainInput, {}) }),
47
- label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
48
- import_styles.StyledLabel,
49
- {
50
- id: `${instanceUid}_label`,
51
- htmlFor: instanceUid,
52
- disabled,
53
- readOnly,
54
- checked,
55
- "data-testid": "ds-checkbox-label",
56
- wrapLabel,
57
- device,
58
- ...!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleOnChange } : {},
59
- children: wrapLabel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledWrapLabel, { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_tooltip_text.SimpleTruncatedTooltipText, { value: label })
60
- }
61
- )
62
- ] });
45
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
46
+ import_styles.StyledContainer,
47
+ {
48
+ wrapLabel,
49
+ device,
50
+ "data-testid": "ds-checkbox-container",
51
+ className,
52
+ ...xstyledProps,
53
+ children: [
54
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledCheckBox, { device, checked, hasError, disabled, readOnly, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_MainInput.MainInput, {}) }),
55
+ label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
+ import_styles.StyledLabel,
57
+ {
58
+ id: `${instanceUid}_label`,
59
+ htmlFor: instanceUid,
60
+ disabled,
61
+ readOnly,
62
+ checked,
63
+ "data-testid": "ds-checkbox-label",
64
+ wrapLabel,
65
+ device,
66
+ ...!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleOnChange } : {},
67
+ children: wrapLabel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledWrapLabel, { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_tooltip_text.SimpleTruncatedTooltipText, { value: label })
68
+ }
69
+ )
70
+ ]
71
+ }
72
+ );
63
73
  };
64
74
  //# sourceMappingURL=ControlledCheckBoxContent.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/ControlledCheckBoxContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledContainer, StyledWrapLabel, StyledLabel, StyledCheckBox } from '../styles.js';\nimport { MainInput } from './MainInput.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\n\nexport const ControlledCheckBoxContent = () => {\n const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } =\n React.useContext(ControlledCheckBoxContext);\n const { checked, device, label, hasError, wrapLabel, ariaControls: legacyAriaControls } = propsWithDefault;\n const { disabled, readOnly, 'aria-controls': ariaControls, className } = globalProps;\n\n return (\n <StyledContainer device={device} data-testid=\"ds-checkbox-container\" className={className} {...xstyledProps}>\n <StyledCheckBox device={device} checked={checked} hasError={hasError} disabled={disabled} readOnly={readOnly}>\n <MainInput />\n </StyledCheckBox>\n {label && (\n <StyledLabel\n id={`${instanceUid}_label`}\n htmlFor={instanceUid}\n disabled={disabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-checkbox-label\"\n wrapLabel={wrapLabel}\n device={device}\n {...(!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleOnChange } : {})}\n >\n {wrapLabel ? <StyledWrapLabel>{label}</StyledWrapLabel> : <SimpleTruncatedTooltipText value={label} />}\n </StyledLabel>\n )}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADanB;AAbJ,mBAAkB;AAClB,uCAA2C;AAC3C,oBAA8E;AAC9E,uBAA0B;AAC1B,mCAA0C;AAEnC,MAAM,4BAA4B,MAAM;AAC7C,QAAM,EAAE,kBAAkB,aAAa,aAAa,cAAc,eAAe,IAC/E,aAAAA,QAAM,WAAW,sDAAyB;AAC5C,QAAM,EAAE,SAAS,QAAQ,OAAO,UAAU,WAAW,cAAc,mBAAmB,IAAI;AAC1F,QAAM,EAAE,UAAU,UAAU,iBAAiB,cAAc,UAAU,IAAI;AAEzE,SACE,6CAAC,iCAAgB,QAAgB,eAAY,yBAAwB,WAAuB,GAAG,cAC7F;AAAA,gDAAC,gCAAe,QAAgB,SAAkB,UAAoB,UAAoB,UACxF,sDAAC,8BAAU,GACb;AAAA,IACC,SACC;AAAA,MAAC;AAAA;AAAA,QACC,IAAI,GAAG;AAAA,QACP,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACC,GAAI,CAAC,aAAa,gBAAgB,sBAAsB,EAAE,SAAS,eAAe,IAAI,CAAC;AAAA,QAEvF,sBAAY,4CAAC,iCAAiB,iBAAM,IAAqB,4CAAC,+DAA2B,OAAO,OAAO;AAAA;AAAA,IACtG;AAAA,KAEJ;AAEJ;",
4
+ "sourcesContent": ["import React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledContainer, StyledWrapLabel, StyledLabel, StyledCheckBox } from '../styles.js';\nimport { MainInput } from './MainInput.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\n\nexport const ControlledCheckBoxContent = () => {\n const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } =\n React.useContext(ControlledCheckBoxContext);\n const { checked, device, label, hasError, wrapLabel, ariaControls: legacyAriaControls } = propsWithDefault;\n const { disabled, readOnly, 'aria-controls': ariaControls, className } = globalProps;\n return (\n <StyledContainer\n wrapLabel={wrapLabel}\n device={device}\n data-testid=\"ds-checkbox-container\"\n className={className}\n {...xstyledProps}\n >\n <StyledCheckBox device={device} checked={checked} hasError={hasError} disabled={disabled} readOnly={readOnly}>\n <MainInput />\n </StyledCheckBox>\n {label && (\n <StyledLabel\n id={`${instanceUid}_label`}\n htmlFor={instanceUid}\n disabled={disabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-checkbox-label\"\n wrapLabel={wrapLabel}\n device={device}\n {...(!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleOnChange } : {})}\n >\n {wrapLabel ? <StyledWrapLabel>{label}</StyledWrapLabel> : <SimpleTruncatedTooltipText value={label} />}\n </StyledLabel>\n )}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADYnB;AAZJ,mBAAkB;AAClB,uCAA2C;AAC3C,oBAA8E;AAC9E,uBAA0B;AAC1B,mCAA0C;AAEnC,MAAM,4BAA4B,MAAM;AAC7C,QAAM,EAAE,kBAAkB,aAAa,aAAa,cAAc,eAAe,IAC/E,aAAAA,QAAM,WAAW,sDAAyB;AAC5C,QAAM,EAAE,SAAS,QAAQ,OAAO,UAAU,WAAW,cAAc,mBAAmB,IAAI;AAC1F,QAAM,EAAE,UAAU,UAAU,iBAAiB,cAAc,UAAU,IAAI;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,eAAY;AAAA,MACZ;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,oDAAC,gCAAe,QAAgB,SAAkB,UAAoB,UAAoB,UACxF,sDAAC,8BAAU,GACb;AAAA,QACC,SACC;AAAA,UAAC;AAAA;AAAA,YACC,IAAI,GAAG;AAAA,YACP,SAAS;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACC,GAAI,CAAC,aAAa,gBAAgB,sBAAsB,EAAE,SAAS,eAAe,IAAI,CAAC;AAAA,YAEvF,sBAAY,4CAAC,iCAAiB,iBAAM,IAAqB,4CAAC,+DAA2B,OAAO,OAAO;AAAA;AAAA,QACtG;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { DEVICE } from './constants/device.js';\n\nexport declare namespace DSControlledCheckboxT {\n type DevicesKeys = keyof typeof DEVICE;\n type Devices = (typeof DEVICE)[DevicesKeys];\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n checked: boolean | 'mixed';\n tabIndex: WCAGTabIndex;\n hasError: boolean;\n wrapLabel: boolean;\n disabled: boolean;\n readOnly: boolean;\n visualOnly: boolean;\n onChange: (\n newVal: boolean,\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLabelElement>\n | React.MouseEvent<HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>,\n ) => void;\n }\n\n export interface OptionalProps {\n onKeyDown?: React.KeyboardEventHandler;\n innerRef?: React.MutableRefObject<HTMLInputElement | null> | React.RefCallback<HTMLInputElement>;\n 'data-testid'?: string;\n device?: Devices;\n }\n\n export interface LegacyAriaProps {\n ariaControls?: string;\n ariaLabel?: string;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof OptionalProps>,\n LegacyAriaProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof OptionalProps>,\n LegacyAriaProps {}\n\n export interface StyledCheckBoxT {\n checked: boolean | 'mixed';\n readOnly?: boolean;\n hasError?: boolean;\n disabled?: boolean;\n device?: Devices;\n }\n\n export interface StyledLabelT {\n disabled?: boolean;\n readOnly?: boolean;\n checked: boolean | 'mixed';\n wrapLabel: boolean;\n device?: Devices;\n }\n}\n\nexport const defaultProps: DSControlledCheckboxT.DefaultProps = {\n wrapLabel: false,\n hasError: false,\n checked: false,\n disabled: false,\n readOnly: false,\n tabIndex: 0,\n onChange: () => {},\n visualOnly: false,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])\n .description('Wheter the checkbox is set as bool or mixed')\n .isRequiredIf((props: DSControlledCheckboxT.Props) => !props.disabled && !props.readOnly)\n .defaultValue(false),\n onChange: PropTypes.func\n .description('function executed when the checkbox changes state')\n .signature('(( newIsChecked: boolean, e: React.SyntheticEvent ) => void )')\n .isRequiredIf((props: DSControlledCheckboxT.Props) => !props.disabled && !props.readOnly),\n 'aria-controls': PropTypes.string\n .description('a11y required attribute when \"mixed\" state is to be supported')\n .isRequiredIf(\n (props: DSControlledCheckboxT.Props) => props.checked === 'mixed' && typeof props.ariaControls !== 'string',\n ),\n ariaControls: PropTypes.string\n .description('deprecated equivalent of \"aria-controls\", please use \"aria-controls\" instead')\n .deprecated({ version: '3.x', message: 'use \"aria-controls\" instead' })\n .isRequiredIf(\n (props: DSControlledCheckboxT.Props) => props.checked === 'mixed' && typeof props['aria-controls'] !== 'string',\n ),\n label: PropTypes.string.description(\n 'Checkbox Label property. This label is also going to be used as an aria-label for screen readers.',\n ),\n hasError: PropTypes.bool.description('Whether the checkbox has error or not.').defaultValue(false),\n disabled: PropTypes.bool.description('Whether the checkbox is disabled or not.').defaultValue(false),\n readOnly: PropTypes.bool.description('Whether the checkbox is readOnly or not.').defaultValue(false),\n wrapLabel: PropTypes.bool.description('Whether to wrap or truncate the label').defaultValue(false),\n device: PropTypes.oneOf(Object.values(DEVICE)).description(\n 'When not provide will scale via css breakpoint media queries, if provided, breakpoint will be ignored in favor of explicit devide declaration',\n ),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Checkbox input ref.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AACvE,oBAAuB;AAmEhB,MAAM,eAAmD;AAAA,EAC9D,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU,MAAM;AAAA,EAAC;AAAA,EACjB,YAAY;AACd;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAC5D,YAAY,6CAA6C,EACzD,aAAa,CAAC,UAAuC,CAAC,MAAM,YAAY,CAAC,MAAM,QAAQ,EACvF,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,KACjB,YAAY,mDAAmD,EAC/D,UAAU,+DAA+D,EACzE,aAAa,CAAC,UAAuC,CAAC,MAAM,YAAY,CAAC,MAAM,QAAQ;AAAA,EAC1F,iBAAiB,kCAAU,OACxB,YAAY,+DAA+D,EAC3E;AAAA,IACC,CAAC,UAAuC,MAAM,YAAY,WAAW,OAAO,MAAM,iBAAiB;AAAA,EACrG;AAAA,EACF,cAAc,kCAAU,OACrB,YAAY,8EAA8E,EAC1F,WAAW,EAAE,SAAS,OAAO,SAAS,8BAA8B,CAAC,EACrE;AAAA,IACC,CAAC,UAAuC,MAAM,YAAY,WAAW,OAAO,MAAM,eAAe,MAAM;AAAA,EACzG;AAAA,EACF,OAAO,kCAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,UAAU,kCAAU,KAAK,YAAY,wCAAwC,EAAE,aAAa,KAAK;AAAA,EACjG,UAAU,kCAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EACnG,UAAU,kCAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EACnG,WAAW,kCAAU,KAAK,YAAY,uCAAuC,EAAE,aAAa,KAAK;AAAA,EACjG,QAAQ,kCAAU,MAAM,OAAO,OAAO,oBAAM,CAAC,EAAE;AAAA,IAC7C;AAAA,EACF;AAAA,EACA,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAAE,YAAY,qBAAqB;AACrG;",
4
+ "sourcesContent": ["import type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DEVICE } from './constants/device.js';\n\nexport declare namespace DSControlledCheckboxT {\n type DevicesKeys = keyof typeof DEVICE;\n type Devices = (typeof DEVICE)[DevicesKeys];\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n checked: boolean | 'mixed';\n tabIndex: TypescriptHelpersT.WCAGTabIndex;\n hasError: boolean;\n wrapLabel: boolean;\n disabled: boolean;\n readOnly: boolean;\n visualOnly: boolean;\n onChange: (\n newVal: boolean,\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLabelElement>\n | React.MouseEvent<HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>,\n ) => void;\n }\n\n export interface OptionalProps {\n onKeyDown?: React.KeyboardEventHandler;\n innerRef?: React.MutableRefObject<HTMLInputElement | null> | React.RefCallback<HTMLInputElement>;\n 'data-testid'?: string;\n device?: Devices;\n }\n\n export interface LegacyAriaProps {\n ariaControls?: string;\n ariaLabel?: string;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof OptionalProps>,\n LegacyAriaProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof OptionalProps>,\n LegacyAriaProps {}\n\n export interface StyledCheckBoxT {\n checked: boolean | 'mixed';\n readOnly?: boolean;\n hasError?: boolean;\n disabled?: boolean;\n device?: Devices;\n }\n\n export interface StyledLabelT {\n disabled?: boolean;\n readOnly?: boolean;\n checked: boolean | 'mixed';\n wrapLabel: boolean;\n device?: Devices;\n }\n}\n\nexport const defaultProps: DSControlledCheckboxT.DefaultProps = {\n wrapLabel: false,\n hasError: false,\n checked: false,\n disabled: false,\n readOnly: false,\n tabIndex: 0,\n onChange: () => {},\n visualOnly: false,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])\n .description('Wheter the checkbox is set as bool or mixed')\n .isRequiredIf((props: DSControlledCheckboxT.Props) => !props.disabled && !props.readOnly)\n .defaultValue(false),\n onChange: PropTypes.func\n .description('function executed when the checkbox changes state')\n .signature('(( newIsChecked: boolean, e: React.SyntheticEvent ) => void )')\n .isRequiredIf((props: DSControlledCheckboxT.Props) => !props.disabled && !props.readOnly),\n 'aria-controls': PropTypes.string\n .description('a11y required attribute when \"mixed\" state is to be supported')\n .isRequiredIf(\n (props: DSControlledCheckboxT.Props) => props.checked === 'mixed' && typeof props.ariaControls !== 'string',\n ),\n ariaControls: PropTypes.string\n .description('deprecated equivalent of \"aria-controls\", please use \"aria-controls\" instead')\n .deprecated({ version: '3.x', message: 'use \"aria-controls\" instead' })\n .isRequiredIf(\n (props: DSControlledCheckboxT.Props) => props.checked === 'mixed' && typeof props['aria-controls'] !== 'string',\n ),\n label: PropTypes.string.description(\n 'Checkbox Label property. This label is also going to be used as an aria-label for screen readers.',\n ),\n hasError: PropTypes.bool.description('Whether the checkbox has error or not.').defaultValue(false),\n disabled: PropTypes.bool.description('Whether the checkbox is disabled or not.').defaultValue(false),\n readOnly: PropTypes.bool.description('Whether the checkbox is readOnly or not.').defaultValue(false),\n wrapLabel: PropTypes.bool.description('Whether to wrap or truncate the label').defaultValue(false),\n device: PropTypes.oneOf(Object.values(DEVICE)).description(\n 'When not provide will scale via css breakpoint media queries, if provided, breakpoint will be ignored in favor of explicit devide declaration',\n ),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Checkbox input ref.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AAEvE,oBAAuB;AAmEhB,MAAM,eAAmD;AAAA,EAC9D,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU,MAAM;AAAA,EAAC;AAAA,EACjB,YAAY;AACd;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAC5D,YAAY,6CAA6C,EACzD,aAAa,CAAC,UAAuC,CAAC,MAAM,YAAY,CAAC,MAAM,QAAQ,EACvF,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,KACjB,YAAY,mDAAmD,EAC/D,UAAU,+DAA+D,EACzE,aAAa,CAAC,UAAuC,CAAC,MAAM,YAAY,CAAC,MAAM,QAAQ;AAAA,EAC1F,iBAAiB,kCAAU,OACxB,YAAY,+DAA+D,EAC3E;AAAA,IACC,CAAC,UAAuC,MAAM,YAAY,WAAW,OAAO,MAAM,iBAAiB;AAAA,EACrG;AAAA,EACF,cAAc,kCAAU,OACrB,YAAY,8EAA8E,EAC1F,WAAW,EAAE,SAAS,OAAO,SAAS,8BAA8B,CAAC,EACrE;AAAA,IACC,CAAC,UAAuC,MAAM,YAAY,WAAW,OAAO,MAAM,eAAe,MAAM;AAAA,EACzG;AAAA,EACF,OAAO,kCAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,UAAU,kCAAU,KAAK,YAAY,wCAAwC,EAAE,aAAa,KAAK;AAAA,EACjG,UAAU,kCAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EACnG,UAAU,kCAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EACnG,WAAW,kCAAU,KAAK,YAAY,uCAAuC,EAAE,aAAa,KAAK;AAAA,EACjG,QAAQ,kCAAU,MAAM,OAAO,OAAO,oBAAM,CAAC,EAAE;AAAA,IAC7C;AAAA,EACF;AAAA,EACA,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAAE,YAAY,qBAAqB;AACrG;",
6
6
  "names": []
7
7
  }
@@ -50,23 +50,31 @@ const StyledCheckBox = (0, import_ds_system.styled)("span", {
50
50
  ${({ device, theme }) => {
51
51
  if (device === "mobile") {
52
52
  return `
53
- width: 24px;
54
- height: 24px;`;
53
+ @media (max-width: ${theme.breakpoints.small}) {
54
+ width: 1.5rem; /* 24px / 16 */
55
+ height: 1.5rem; /* 24px / 16 */
56
+ }
57
+ width: 1.846rem; /* 24px / 13 */
58
+ height: 1.846rem; /* 24px / 13 */`;
55
59
  }
56
60
  if (device === void 0) {
57
61
  return `
58
62
  @media (max-width: ${theme.breakpoints.small}) {
59
- width: 24px;
60
- height: 24px;
63
+ width: 1.5rem; /* 24px / 16 */
64
+ height: 1.5rem; /* 24px / 16 */
61
65
  }
62
- width: ${theme.space.xs};
63
- height: ${theme.space.xs};
66
+ width: 1.2307rem;
67
+ height: 1.2307rem;
64
68
  `;
65
69
  }
66
70
  return `
67
- width: ${theme.space.xs};
68
- height: ${theme.space.xs};
69
- `;
71
+ @media (max-width: ${theme.breakpoints.small}) {
72
+ width: 1rem; /* 16px / 16 */
73
+ height: 1rem; /* 16px / 16 */
74
+ }
75
+ width: 1.2307rem; /* 16px / 13 */
76
+ height: 1.2307rem; /* 16px / 13 */
77
+ `;
70
78
  }}
71
79
 
72
80
  ${({ theme, checked, disabled, readOnly, hasError, device }) => (0, import_styleHelpers.handleCheckmark)(theme, checked, disabled, readOnly, hasError, false, device)}
@@ -81,7 +89,6 @@ const StyledCheckBox = (0, import_ds_system.styled)("span", {
81
89
  left: 0px;
82
90
  border: 1px solid ${({ theme, hasError }) => hasError ? theme.colors.danger[900] : theme.colors.neutral[400]};
83
91
  }
84
-
85
92
  &:hover {
86
93
  background: ${({ theme, disabled }) => !disabled ? theme.colors.brand[200] : void 0};
87
94
 
@@ -89,17 +96,14 @@ const StyledCheckBox = (0, import_ds_system.styled)("span", {
89
96
  border: 1px solid ${({ theme, hasError }) => hasError ? theme.colors.danger[900] : theme.colors.brand[600]};
90
97
  }
91
98
  }
92
-
93
99
  &:focus-within {
94
100
  &:hover {
95
101
  ${({ theme, checked, disabled, readOnly, hasError, device }) => (0, import_styleHelpers.handleCheckmark)(theme, checked, disabled, readOnly, hasError, true, device)}
96
102
  }
97
-
98
103
  &:after {
99
104
  border: 2px solid ${({ theme }) => theme.colors.brand[700]};
100
105
  }
101
106
  }
102
-
103
107
  &:active {
104
108
  &:after {
105
109
  border: 2px solid ${({ theme }) => theme.colors.brand[600]};
@@ -140,44 +144,40 @@ const StyledLabel = (0, import_ds_system.styled)("label", {
140
144
  name: import_exported_related.DSCheckboxName,
141
145
  slot: import_exported_related.DSCheckboxSlots.LABEL
142
146
  })`
143
- margin: 2px 0px -2px 8px;
144
- ${({ wrapLabel, theme }) => wrapLabel ? `
145
- overflow-wrap: break-word;
146
- white-space: pre-wrap;
147
- word-break: break-word;
148
- ` : `margin-left: ${theme.space.xxs}`};
149
-
147
+ ${({ wrapLabel }) => wrapLabel && `
148
+ overflow-wrap: break-word;
149
+ white-space: pre-wrap;
150
+ word-break: break-word;
151
+ `};
152
+ width: fit-content;
150
153
  color: ${({ theme, disabled }) => disabled ? theme.colors.neutral[500] : theme.colors.neutral[800]};
151
- font-size: 13px;
152
-
154
+ line-height: 1.2307rem;
155
+ @media (max-width: ${import_ds_system.th.breakpoint("small")}) {
156
+ line-height: 1rem; /* 13px / 16 */
157
+ }
153
158
  ${({ device, theme }) => {
154
159
  if (device === "mobile") {
155
160
  return `
156
- margin: 5px 0px -5px 8px;
157
- font-size: 16px;
158
- line-height: 1.2;
161
+ @media (max-width: ${theme.breakpoints.small}) {
162
+ font-size: 1rem; /* 16px / 16 */
163
+ }
164
+ font-size: 1.2307rem; /* 16px / 13 */
159
165
  `;
160
166
  }
161
167
  if (device === void 0) {
162
168
  return `
163
- @media (max-width: ${theme.breakpoints.small}) {
164
- margin: 5px 0px -5px 8px;
165
- font-size: 16px;
166
- line-height: 1.2;
167
- }
168
-
169
- font-size: 13px;
170
- line-height: 1.1;
169
+ font-size: 1rem;
171
170
  `;
172
171
  }
173
172
  return `
174
- font-size: 13px;
175
- line-height: 1.1;
176
- `;
177
- }}
173
+ @media (max-width: ${theme.breakpoints.small}) {
174
+ font-size: 0.8125rem; /* 13px / 16 */
175
+ }
178
176
 
177
+ font-size: 1rem; /* 13px / 13 */
178
+ `;
179
+ }}
179
180
  display: inherit;
180
-
181
181
  ${({ disabled }) => disabled ? `&:hover {
182
182
  cursor: not-allowed;
183
183
  }` : `&:hover {
@@ -192,23 +192,31 @@ const StyledContainer = (0, import_ds_system.styled)("div", {
192
192
  ${({ device, theme }) => {
193
193
  if (device === "mobile") {
194
194
  return `
195
- grid-template-columns: 24px auto;`;
195
+ @media (max-width: ${theme.breakpoints.small}) {
196
+ grid-template-columns: 1.5rem auto; /* 24px / 16px */
197
+ }
198
+ grid-template-columns: 1.846rem auto;
199
+ `;
196
200
  }
197
201
  if (device === void 0) {
198
202
  return `
199
203
  @media (max-width: ${theme.breakpoints.small}) {
200
- grid-template-columns: 24px auto;
204
+ grid-template-columns: 1.5rem auto;
201
205
  }
202
- grid-template-columns: ${theme.space.xs} auto;
206
+ grid-template-columns: 1.23rem auto;
203
207
  `;
204
208
  }
205
209
  return `
206
- grid-template-columns: ${theme.space.xs} auto;
210
+ @media (max-width: ${theme.breakpoints.small}) {
211
+ grid-template-columns: 1rem auto; /* 16px / 16px */
212
+ }
213
+ grid-template-columns: 1.2307rem auto; /* 16px / 13 */
214
+
207
215
  `;
208
216
  }}
217
+ column-gap: 8px;
209
218
  display: inline-grid;
210
- grid-template-rows: min-content;
211
- align-items: flex-start;
219
+ align-items: ${({ wrapLabel }) => wrapLabel ? "flex-start" : "center"};
212
220
  ${import_ds_system.xStyledCommonProps}
213
221
  `;
214
222
  //# sourceMappingURL=styles.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { DSControlledCheckboxT } from './react-desc-prop-types.js';\nimport { handleBackgroundColor, handleCheckmark } from './utils/styleHelpers.js';\nimport { DSCheckboxName, DSCheckboxSlots } from './exported-related/index.js';\n\nexport const StyledCheckBox = styled('span', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT_WRAPPER,\n})<DSControlledCheckboxT.StyledCheckBoxT>`\n position: relative;\n background: ${({ theme, disabled }) => handleBackgroundColor(theme, disabled)};\n\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n width: 24px;\n height: 24px;`;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 24px;\n height: 24px;\n }\n width: ${theme.space.xs};\n height: ${theme.space.xs};\n `;\n }\n return `\n width: ${theme.space.xs};\n height: ${theme.space.xs};\n `;\n }}\n\n ${({ theme, checked, disabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled, readOnly, hasError, false, device)}\n\n &:after {\n content: '';\n border-radius: 2px;\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[400])};\n }\n\n &:hover {\n background: ${({ theme, disabled }) => (!disabled ? theme.colors.brand[200] : undefined)};\n\n &:after {\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.brand[600])};\n }\n }\n\n &:focus-within {\n &:hover {\n ${({ theme, checked, disabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled, readOnly, hasError, true, device)}\n }\n\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n\n &:active {\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[600]};\n }\n }\n`;\n\nconst checkboxStyles = css`\n &:hover {\n cursor: pointer;\n }\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n z-index: 1;\n`;\n\nexport const StyledInput = styled('input', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT,\n})`\n ${checkboxStyles}\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const StyledInputMixed = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT,\n})`\n ${checkboxStyles}\n ${({ 'aria-disabled': disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : ''}\n`;\n\nexport const StyledLabel = styled('label', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.LABEL,\n})<DSControlledCheckboxT.StyledLabelT>`\n margin: 2px 0px -2px 8px;\n ${({ wrapLabel, theme }) =>\n wrapLabel\n ? `\n overflow-wrap: break-word;\n white-space: pre-wrap;\n word-break: break-word;\n`\n : `margin-left: ${theme.space.xxs}`};\n\n color: ${({ theme, disabled }) => (disabled ? theme.colors.neutral[500] : theme.colors.neutral[800])};\n font-size: 13px;\n\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return `\n margin: 5px 0px -5px 8px;\n font-size: 16px;\n line-height: 1.2;\n `;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n margin: 5px 0px -5px 8px;\n font-size: 16px;\n line-height: 1.2;\n }\n\n font-size: 13px;\n line-height: 1.1;\n `;\n }\n return `\n font-size: 13px;\n line-height: 1.1;\n `;\n }}\n\n display: inherit;\n\n ${({ disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : `&:hover {\n cursor: pointer;\n }`}\n`;\n\nexport const StyledWrapLabel = styled('span')``;\n\nexport const StyledContainer = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.CONTAINER,\n})<{ device?: 'mobile' | 'desktop' }>`\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n grid-template-columns: 24px auto;`;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 24px auto;\n }\n grid-template-columns: ${theme.space.xs} auto;\n `;\n }\n return `\n grid-template-columns: ${theme.space.xs} auto;\n `;\n }}\n display: inline-grid;\n grid-template-rows: min-content;\n align-items: flex-start;\n ${xStyledCommonProps}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;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CAAC,EAAE,SAAS,MACZ,WACI;AAAA;AAAA,OAGA;AAAA;AAAA;AAAA;AAKD,MAAM,sBAAkB,yBAAO,MAAM;AAErC,MAAM,sBAAkB,yBAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,wCAAgB;AACxB,CAAC;AAAA,IACG,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,WAAW,UAAU;AACvB,WAAO;AAAA;AAAA,EAET;AACA,MAAI,WAAW,QAAW;AACxB,WAAO;AAAA,6BACgB,MAAM,YAAY;AAAA;AAAA;AAAA,iCAGd,MAAM,MAAM;AAAA;AAAA,EAEzC;AACA,SAAO;AAAA,6BACkB,MAAM,MAAM;AAAA;AAEvC;AAAA;AAAA;AAAA;AAAA,IAIE;AAAA;",
4
+ "sourcesContent": ["import { styled, th, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { DSControlledCheckboxT } from './react-desc-prop-types.js';\nimport { handleBackgroundColor, handleCheckmark } from './utils/styleHelpers.js';\nimport { DSCheckboxName, DSCheckboxSlots } from './exported-related/index.js';\n\nexport const StyledCheckBox = styled('span', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT_WRAPPER,\n})<DSControlledCheckboxT.StyledCheckBoxT>`\n position: relative;\n background: ${({ theme, disabled }) => handleBackgroundColor(theme, disabled)};\n\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n @media (max-width: ${theme.breakpoints.small}) {\n width: 1.5rem; /* 24px / 16 */\n height: 1.5rem; /* 24px / 16 */\n }\n width: 1.846rem; /* 24px / 13 */\n height: 1.846rem; /* 24px / 13 */`;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 1.5rem; /* 24px / 16 */\n height: 1.5rem; /* 24px / 16 */\n }\n width: 1.2307rem;\n height: 1.2307rem;\n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 1rem; /* 16px / 16 */\n height: 1rem; /* 16px / 16 */\n }\n width: 1.2307rem; /* 16px / 13 */\n height: 1.2307rem; /* 16px / 13 */\n `;\n }}\n\n ${({ theme, checked, disabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled, readOnly, hasError, false, device)}\n\n &:after {\n content: '';\n border-radius: 2px;\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[400])};\n }\n &:hover {\n background: ${({ theme, disabled }) => (!disabled ? theme.colors.brand[200] : undefined)};\n\n &:after {\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.brand[600])};\n }\n }\n &:focus-within {\n &:hover {\n ${({ theme, checked, disabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled, readOnly, hasError, true, device)}\n }\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n &:active {\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[600]};\n }\n }\n`;\n\nconst checkboxStyles = css`\n &:hover {\n cursor: pointer;\n }\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n z-index: 1;\n`;\n\nexport const StyledInput = styled('input', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT,\n})`\n ${checkboxStyles}\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const StyledInputMixed = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT,\n})`\n ${checkboxStyles}\n ${({ 'aria-disabled': disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : ''}\n`;\n\nexport const StyledLabel = styled('label', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.LABEL,\n})<DSControlledCheckboxT.StyledLabelT>`\n ${({ wrapLabel }) =>\n wrapLabel &&\n `\n overflow-wrap: break-word;\n white-space: pre-wrap;\n word-break: break-word;\n`};\n width: fit-content;\n color: ${({ theme, disabled }) => (disabled ? theme.colors.neutral[500] : theme.colors.neutral[800])};\n line-height: 1.2307rem;\n @media (max-width: ${th.breakpoint('small')}) {\n line-height: 1rem; /* 13px / 16 */\n }\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n font-size: 1rem; /* 16px / 16 */\n }\n font-size: 1.2307rem; /* 16px / 13 */\n `;\n }\n if (device === undefined) {\n return `\n font-size: 1rem; \n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n font-size: 0.8125rem; /* 13px / 16 */\n }\n\n font-size: 1rem; /* 13px / 13 */\n `;\n }}\n display: inherit;\n ${({ disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : `&:hover {\n cursor: pointer;\n }`}\n`;\n\nexport const StyledWrapLabel = styled('span')``;\n\nexport const StyledContainer = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.CONTAINER,\n})<{ device?: 'mobile' | 'desktop'; wrapLabel?: boolean }>`\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1.5rem auto; /* 24px / 16px */\n }\n grid-template-columns: 1.846rem auto;\n `;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1.5rem auto;\n }\n grid-template-columns: 1.23rem auto;\n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1rem auto; /* 16px / 16px */\n }\n grid-template-columns: 1.2307rem auto; /* 16px / 13 */\n\n `;\n }}\n column-gap: 8px;\n display: inline-grid;\n align-items: ${({ wrapLabel }) => (wrapLabel ? 'flex-start' : 'center')};\n ${xStyledCommonProps}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AC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AAM;AAErC,MAAM,sBAAkB,yBAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,wCAAgB;AACxB,CAAC;AAAA,IACG,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,WAAW,UAAU;AACvB,WAAO;AAAA,2BACc,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAKzC;AACA,MAAI,WAAW,QAAW;AACxB,WAAO;AAAA,6BACgB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAK3C;AACA,SAAO;AAAA,yBACc,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAMzC;AAAA;AAAA;AAAA,iBAGe,CAAC,EAAE,UAAU,MAAO,YAAY,eAAe;AAAA,IAC5D;AAAA;",
6
6
  "names": []
7
7
  }
@@ -50,57 +50,91 @@ const handleCheckMarkColor = ({ colors }, checked, isHovering, disabled, readOnl
50
50
  return colors.brand[600];
51
51
  };
52
52
  const handleCheckmark = (theme, checked, disabled, readOnly, hasError, isHovering = false, device = void 0) => {
53
+ const commonStyles = `
54
+ position: absolute;
55
+ content: '';
56
+ border-left: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
57
+ border-bottom: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
58
+ `;
53
59
  const desktopMixedCheckmark = `
54
60
  position: absolute;
55
61
  content: '';
56
- top: 7px;
57
- left: 4px;
62
+ top: 0.538rem; /* 7px / baseFontSize */
63
+ left: 0.308rem; /* 4px / baseFontSize */
58
64
  background: ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
59
- width: ${theme.space.xxs};
60
- height: 2px;
65
+ width: 0.615rem; /* theme.space.xxs / baseFontSize */
66
+ height: 0.154rem; /* 2px / baseFontSize */
67
+ @media (max-width: ${theme.breakpoints.small}) {
68
+ top: 0.4375rem; /* 7px / 16 */
69
+ left: 0.25rem; /* 4px / 16 */
70
+ height: 0.125rem; /* 8px / 16 */
71
+ width: 0.5rem;/* 2px / 16 */
72
+ }
61
73
  `;
62
74
  const normalMixedCheckmark = `
75
+ ${desktopMixedCheckmark}
63
76
  @media (max-width: ${theme.breakpoints.small}) {
64
- top:11px;
65
- left:6px;
66
- height:2px;
67
- width:12px;
77
+ top: 0.6875rem; /* 11px / 16 */
78
+ left: 0.375rem; /* 6px / 16 */
79
+ height: 0.125rem; /* 2px / 16 */
80
+ width: 0.75rem; /* 12px / 16 */
68
81
  }
69
- ${desktopMixedCheckmark}
70
82
  `;
71
83
  const mobileMixedCheckmark = `
72
- ${desktopMixedCheckmark}
73
- top:11px;
74
- left:6px;
75
- height:2px;
76
- width:12px;
84
+ ${commonStyles}
85
+ @media (max-width: ${theme.breakpoints.small}) {
86
+ top: 0.6875rem; /* 11px / 16 */
87
+ left: 0.375rem; /* 6px / 16 */
88
+ height: 0.125rem; /* 2px / 16 */
89
+ width: 0.75rem; /* 12px / 16 */
90
+ }
91
+ top: 0.8461rem; /* 11px / 13 */
92
+ left: 0.4615rem; /* 6px / 13 */
93
+ height: 0.1538rem; /* 2px / 13 */
94
+ width: 0.9231rem; /* 12px / 13 */
95
+
77
96
  `;
78
97
  const desktopCheckmark = `
79
98
  position: absolute;
80
99
  content: '';
81
- top: 4px;
82
- left: 3px;
83
- border-left: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
84
- border-bottom: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
85
- height: 5px;
86
- width: 10px;
100
+ top: 0.308rem; /* 4px / baseFontSize */
101
+ left: 0.231rem; /* 3px / baseFontSize */
102
+ border-left: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
103
+ border-bottom: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
104
+ height: 0.385rem; /* 5px / baseFontSize */
105
+ width: 0.769rem; /* 10px / baseFontSize */
87
106
  transform: rotate(-45deg);
88
- `;
89
- const normalCheckmark = `
107
+
90
108
  @media (max-width: ${theme.breakpoints.small}) {
91
- top: 6px;
92
- left: 4px;
93
- height: 8px;
94
- width: 17px;
109
+ top: 0.25rem; /* 4px / 16 */
110
+ left: 0.1875rem; /* 3px / 16 */
111
+ height: 0.3125rem; /* 5px / 16 */
112
+ width: 0.625rem; /* 10px / 16 */
95
113
  }
96
- ${desktopCheckmark}
114
+ `;
115
+ const normalCheckmark = `
116
+
117
+ ${desktopCheckmark}
118
+ @media (max-width: ${theme.breakpoints.small}) {
119
+ top: 0.375rem; /* 6px / 16 */
120
+ left: 0.25rem; /* 4px / 16 */
121
+ height: 0.5rem; /* 8px / 16 */
122
+ width: 1.0625rem; /* 17px / 16 */
123
+ }
97
124
  `;
98
125
  const mobileCheckmark = `
99
- ${desktopCheckmark}
100
- top: 6px;
101
- left: 4px;
102
- height: 8px;
103
- width: 17px;
126
+ ${commonStyles}
127
+ @media (max-width: ${theme.breakpoints.small}) {
128
+ top: 0.375rem; /* 6px / 16 */
129
+ left: 0.25rem; /* 4px / 16 */
130
+ height: 0.5rem; /* 8px / 16 */
131
+ width: 1.0625rem; /* 17px / 16 */
132
+ }
133
+ top: 0.4615rem; /* 6px / 13 */
134
+ left: 0.3077rem; /* 4px / 13 */
135
+ height: 0.6154rem; /* 8px / 13 */
136
+ width: 1.3077rem; /* 17px / 13 */
137
+ transform: rotate(-45deg);
104
138
  `;
105
139
  if (checked === "mixed") {
106
140
  return `&:before {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/styleHelpers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable indent */\n/* eslint-disable no-nested-ternary */\n/* eslint-disable max-params */\n\nimport type { Theme } from '@elliemae/pui-theme';\nexport const handleCheckMarkColor = (\n { colors }: Theme,\n checked: boolean | 'mixed',\n isHovering: boolean,\n disabled?: boolean,\n readOnly?: boolean,\n hasError?: boolean,\n): string => {\n if (hasError) {\n return colors.danger[900];\n }\n if (readOnly) {\n return colors.neutral[500];\n }\n if (disabled) {\n return colors.neutral[500];\n }\n if (isHovering) {\n return colors.brand[600];\n }\n return colors.brand[600];\n};\n\nexport const handleCheckmark = (\n theme: Theme,\n checked: boolean | 'mixed',\n disabled?: boolean,\n readOnly?: boolean,\n hasError?: boolean,\n isHovering = false,\n device: string | undefined = undefined,\n): string => {\n const desktopMixedCheckmark = `\n position: absolute;\n content: '';\n top: 7px;\n left: 4px;\n background: ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\n width: ${theme.space.xxs};\n height: 2px;\n`;\n\n const normalMixedCheckmark = `\n @media (max-width: ${theme.breakpoints.small}) {\n top:11px;\n left:6px;\n height:2px;\n width:12px;\n }\n ${desktopMixedCheckmark}\n`;\n const mobileMixedCheckmark = `\n ${desktopMixedCheckmark}\n top:11px;\n left:6px;\n height:2px;\n width:12px;\n`;\n const desktopCheckmark = `\nposition: absolute;\ncontent: '';\ntop: 4px;\nleft: 3px;\nborder-left: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\nborder-bottom: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\nheight: 5px;\nwidth: 10px;\ntransform: rotate(-45deg);\n`;\n\n const normalCheckmark = `\n@media (max-width: ${theme.breakpoints.small}) {\n top: 6px;\n left: 4px;\n height: 8px;\n width: 17px;\n}\n${desktopCheckmark}\n`;\n const mobileCheckmark = `\n${desktopCheckmark}\ntop: 6px;\nleft: 4px;\nheight: 8px;\nwidth: 17px;\n`;\n\n if (checked === 'mixed') {\n return `&:before {\n ${device === undefined ? normalMixedCheckmark : device === 'mobile' ? mobileMixedCheckmark : desktopMixedCheckmark}\n}`;\n }\n if (checked) {\n return `&:before {\n ${device === undefined ? normalCheckmark : device === 'mobile' ? mobileCheckmark : desktopCheckmark}\n}`;\n }\n return '';\n};\n\nexport const handleBackgroundColor = ({ colors }: Theme, disabled?: boolean): string => {\n if (disabled) {\n return colors.neutral['080'];\n }\n\n return colors.neutral['000'];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKhB,MAAM,uBAAuB,CAClC,EAAE,OAAO,GACT,SACA,YACA,UACA,UACA,aACW;AACX,MAAI,UAAU;AACZ,WAAO,OAAO,OAAO,GAAG;AAAA,EAC1B;AACA,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,GAAG;AAAA,EAC3B;AACA,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,GAAG;AAAA,EAC3B;AACA,MAAI,YAAY;AACd,WAAO,OAAO,MAAM,GAAG;AAAA,EACzB;AACA,SAAO,OAAO,MAAM,GAAG;AACzB;AAEO,MAAM,kBAAkB,CAC7B,OACA,SACA,UACA,UACA,UACA,aAAa,OACb,SAA6B,WAClB;AACX,QAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKhB,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA,WAClF,MAAM,MAAM;AAAA;AAAA;AAIrB,QAAM,uBAAuB;AAAA,uBACR,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMrC;AAAA;AAEF,QAAM,uBAAuB;AAAA,IAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAMF,QAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,yBAKF,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA,2BAC3E,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA;AAAA;AAAA;AAAA;AAMtG,QAAM,kBAAkB;AAAA,qBACL,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrC;AAAA;AAEA,QAAM,kBAAkB;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,MAAI,YAAY,SAAS;AACvB,WAAO;AAAA,IACP,WAAW,SAAY,uBAAuB,WAAW,WAAW,uBAAuB;AAAA;AAAA,EAE7F;AACA,MAAI,SAAS;AACX,WAAO;AAAA,MACL,WAAW,SAAY,kBAAkB,WAAW,WAAW,kBAAkB;AAAA;AAAA,EAErF;AACA,SAAO;AACT;AAEO,MAAM,wBAAwB,CAAC,EAAE,OAAO,GAAU,aAA+B;AACtF,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,KAAK;AAAA,EAC7B;AAEA,SAAO,OAAO,QAAQ,KAAK;AAC7B;",
4
+ "sourcesContent": ["/* eslint-disable indent */\n/* eslint-disable no-nested-ternary */\n/* eslint-disable max-params */\n\nimport type { Theme } from '@elliemae/pui-theme';\nexport const handleCheckMarkColor = (\n { colors }: Theme,\n checked: boolean | 'mixed',\n isHovering: boolean,\n disabled?: boolean,\n readOnly?: boolean,\n hasError?: boolean,\n): string => {\n if (hasError) {\n return colors.danger[900];\n }\n if (readOnly) {\n return colors.neutral[500];\n }\n if (disabled) {\n return colors.neutral[500];\n }\n if (isHovering) {\n return colors.brand[600];\n }\n return colors.brand[600];\n};\n\nexport const handleCheckmark = (\n theme: Theme,\n checked: boolean | 'mixed',\n disabled?: boolean,\n readOnly?: boolean,\n hasError?: boolean,\n isHovering = false,\n device: string | undefined = undefined,\n): string => {\n const commonStyles = `\n position: absolute;\n content: '';\n border-left: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\n border-bottom: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\n `;\n const desktopMixedCheckmark = `\n position: absolute;\n content: '';\n top: 0.538rem; /* 7px / baseFontSize */\n left: 0.308rem; /* 4px / baseFontSize */\n background: ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\n width: 0.615rem; /* theme.space.xxs / baseFontSize */\n height: 0.154rem; /* 2px / baseFontSize */\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.4375rem; /* 7px / 16 */\n left: 0.25rem; /* 4px / 16 */\n height: 0.125rem; /* 8px / 16 */\n width: 0.5rem;/* 2px / 16 */\n }\n`;\n\n const normalMixedCheckmark = `\n ${desktopMixedCheckmark}\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.6875rem; /* 11px / 16 */\n left: 0.375rem; /* 6px / 16 */\n height: 0.125rem; /* 2px / 16 */\n width: 0.75rem; /* 12px / 16 */\n }\n`;\n const mobileMixedCheckmark = `\n ${commonStyles}\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.6875rem; /* 11px / 16 */\n left: 0.375rem; /* 6px / 16 */\n height: 0.125rem; /* 2px / 16 */\n width: 0.75rem; /* 12px / 16 */\n }\n top: 0.8461rem; /* 11px / 13 */\n left: 0.4615rem; /* 6px / 13 */\n height: 0.1538rem; /* 2px / 13 */\n width: 0.9231rem; /* 12px / 13 */\n\n`;\n const desktopCheckmark = `\nposition: absolute;\ncontent: '';\ntop: 0.308rem; /* 4px / baseFontSize */\nleft: 0.231rem; /* 3px / baseFontSize */\nborder-left: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\nborder-bottom: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\nheight: 0.385rem; /* 5px / baseFontSize */\nwidth: 0.769rem; /* 10px / baseFontSize */\ntransform: rotate(-45deg);\n\n@media (max-width: ${theme.breakpoints.small}) {\n top: 0.25rem; /* 4px / 16 */\n left: 0.1875rem; /* 3px / 16 */\n height: 0.3125rem; /* 5px / 16 */\n width: 0.625rem; /* 10px / 16 */\n}\n`;\n\n const normalCheckmark = `\n\n ${desktopCheckmark}\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.375rem; /* 6px / 16 */\n left: 0.25rem; /* 4px / 16 */\n height: 0.5rem; /* 8px / 16 */\n width: 1.0625rem; /* 17px / 16 */\n }\n`;\n const mobileCheckmark = `\n ${commonStyles}\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.375rem; /* 6px / 16 */\n left: 0.25rem; /* 4px / 16 */\n height: 0.5rem; /* 8px / 16 */\n width: 1.0625rem; /* 17px / 16 */\n }\n top: 0.4615rem; /* 6px / 13 */\n left: 0.3077rem; /* 4px / 13 */\n height: 0.6154rem; /* 8px / 13 */\n width: 1.3077rem; /* 17px / 13 */\n transform: rotate(-45deg);\n`;\n\n if (checked === 'mixed') {\n return `&:before {\n ${device === undefined ? normalMixedCheckmark : device === 'mobile' ? mobileMixedCheckmark : desktopMixedCheckmark}\n}`;\n }\n if (checked) {\n return `&:before {\n ${device === undefined ? normalCheckmark : device === 'mobile' ? mobileCheckmark : desktopCheckmark}\n}`;\n }\n return '';\n};\n\nexport const handleBackgroundColor = ({ colors }: Theme, disabled?: boolean): string => {\n if (disabled) {\n return colors.neutral['080'];\n }\n\n return colors.neutral['000'];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKhB,MAAM,uBAAuB,CAClC,EAAE,OAAO,GACT,SACA,YACA,UACA,UACA,aACW;AACX,MAAI,UAAU;AACZ,WAAO,OAAO,OAAO,GAAG;AAAA,EAC1B;AACA,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,GAAG;AAAA,EAC3B;AACA,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,GAAG;AAAA,EAC3B;AACA,MAAI,YAAY;AACd,WAAO,OAAO,MAAM,GAAG;AAAA,EACzB;AACA,SAAO,OAAO,MAAM,GAAG;AACzB;AAEO,MAAM,kBAAkB,CAC7B,OACA,SACA,UACA,UACA,UACA,aAAa,OACb,SAA6B,WAClB;AACX,QAAM,eAAe;AAAA;AAAA;AAAA,kCAGW,qBAAqB,OAAO,SAAS,YA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AU,aAA+B;AACtF,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,KAAK;AAAA,EAC7B;AAEA,SAAO,OAAO,QAAQ,KAAK;AAC7B;",
6
6
  "names": []
7
7
  }
@@ -9,24 +9,34 @@ const ControlledCheckBoxContent = () => {
9
9
  const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } = React2.useContext(ControlledCheckBoxContext);
10
10
  const { checked, device, label, hasError, wrapLabel, ariaControls: legacyAriaControls } = propsWithDefault;
11
11
  const { disabled, readOnly, "aria-controls": ariaControls, className } = globalProps;
12
- return /* @__PURE__ */ jsxs(StyledContainer, { device, "data-testid": "ds-checkbox-container", className, ...xstyledProps, children: [
13
- /* @__PURE__ */ jsx(StyledCheckBox, { device, checked, hasError, disabled, readOnly, children: /* @__PURE__ */ jsx(MainInput, {}) }),
14
- label && /* @__PURE__ */ jsx(
15
- StyledLabel,
16
- {
17
- id: `${instanceUid}_label`,
18
- htmlFor: instanceUid,
19
- disabled,
20
- readOnly,
21
- checked,
22
- "data-testid": "ds-checkbox-label",
23
- wrapLabel,
24
- device,
25
- ...!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleOnChange } : {},
26
- children: wrapLabel ? /* @__PURE__ */ jsx(StyledWrapLabel, { children: label }) : /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: label })
27
- }
28
- )
29
- ] });
12
+ return /* @__PURE__ */ jsxs(
13
+ StyledContainer,
14
+ {
15
+ wrapLabel,
16
+ device,
17
+ "data-testid": "ds-checkbox-container",
18
+ className,
19
+ ...xstyledProps,
20
+ children: [
21
+ /* @__PURE__ */ jsx(StyledCheckBox, { device, checked, hasError, disabled, readOnly, children: /* @__PURE__ */ jsx(MainInput, {}) }),
22
+ label && /* @__PURE__ */ jsx(
23
+ StyledLabel,
24
+ {
25
+ id: `${instanceUid}_label`,
26
+ htmlFor: instanceUid,
27
+ disabled,
28
+ readOnly,
29
+ checked,
30
+ "data-testid": "ds-checkbox-label",
31
+ wrapLabel,
32
+ device,
33
+ ...!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleOnChange } : {},
34
+ children: wrapLabel ? /* @__PURE__ */ jsx(StyledWrapLabel, { children: label }) : /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: label })
35
+ }
36
+ )
37
+ ]
38
+ }
39
+ );
30
40
  };
31
41
  export {
32
42
  ControlledCheckBoxContent
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ControlledCheckBoxContent.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledContainer, StyledWrapLabel, StyledLabel, StyledCheckBox } from '../styles.js';\nimport { MainInput } from './MainInput.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\n\nexport const ControlledCheckBoxContent = () => {\n const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } =\n React.useContext(ControlledCheckBoxContext);\n const { checked, device, label, hasError, wrapLabel, ariaControls: legacyAriaControls } = propsWithDefault;\n const { disabled, readOnly, 'aria-controls': ariaControls, className } = globalProps;\n\n return (\n <StyledContainer device={device} data-testid=\"ds-checkbox-container\" className={className} {...xstyledProps}>\n <StyledCheckBox device={device} checked={checked} hasError={hasError} disabled={disabled} readOnly={readOnly}>\n <MainInput />\n </StyledCheckBox>\n {label && (\n <StyledLabel\n id={`${instanceUid}_label`}\n htmlFor={instanceUid}\n disabled={disabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-checkbox-label\"\n wrapLabel={wrapLabel}\n device={device}\n {...(!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleOnChange } : {})}\n >\n {wrapLabel ? <StyledWrapLabel>{label}</StyledWrapLabel> : <SimpleTruncatedTooltipText value={label} />}\n </StyledLabel>\n )}\n </StyledContainer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACanB,SAEI,KAFJ;AAbJ,OAAOA,YAAW;AAClB,SAAS,kCAAkC;AAC3C,SAAS,iBAAiB,iBAAiB,aAAa,sBAAsB;AAC9E,SAAS,iBAAiB;AAC1B,SAAS,iCAAiC;AAEnC,MAAM,4BAA4B,MAAM;AAC7C,QAAM,EAAE,kBAAkB,aAAa,aAAa,cAAc,eAAe,IAC/EA,OAAM,WAAW,yBAAyB;AAC5C,QAAM,EAAE,SAAS,QAAQ,OAAO,UAAU,WAAW,cAAc,mBAAmB,IAAI;AAC1F,QAAM,EAAE,UAAU,UAAU,iBAAiB,cAAc,UAAU,IAAI;AAEzE,SACE,qBAAC,mBAAgB,QAAgB,eAAY,yBAAwB,WAAuB,GAAG,cAC7F;AAAA,wBAAC,kBAAe,QAAgB,SAAkB,UAAoB,UAAoB,UACxF,8BAAC,aAAU,GACb;AAAA,IACC,SACC;AAAA,MAAC;AAAA;AAAA,QACC,IAAI,GAAG;AAAA,QACP,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACC,GAAI,CAAC,aAAa,gBAAgB,sBAAsB,EAAE,SAAS,eAAe,IAAI,CAAC;AAAA,QAEvF,sBAAY,oBAAC,mBAAiB,iBAAM,IAAqB,oBAAC,8BAA2B,OAAO,OAAO;AAAA;AAAA,IACtG;AAAA,KAEJ;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledContainer, StyledWrapLabel, StyledLabel, StyledCheckBox } from '../styles.js';\nimport { MainInput } from './MainInput.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\n\nexport const ControlledCheckBoxContent = () => {\n const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } =\n React.useContext(ControlledCheckBoxContext);\n const { checked, device, label, hasError, wrapLabel, ariaControls: legacyAriaControls } = propsWithDefault;\n const { disabled, readOnly, 'aria-controls': ariaControls, className } = globalProps;\n return (\n <StyledContainer\n wrapLabel={wrapLabel}\n device={device}\n data-testid=\"ds-checkbox-container\"\n className={className}\n {...xstyledProps}\n >\n <StyledCheckBox device={device} checked={checked} hasError={hasError} disabled={disabled} readOnly={readOnly}>\n <MainInput />\n </StyledCheckBox>\n {label && (\n <StyledLabel\n id={`${instanceUid}_label`}\n htmlFor={instanceUid}\n disabled={disabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-checkbox-label\"\n wrapLabel={wrapLabel}\n device={device}\n {...(!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleOnChange } : {})}\n >\n {wrapLabel ? <StyledWrapLabel>{label}</StyledWrapLabel> : <SimpleTruncatedTooltipText value={label} />}\n </StyledLabel>\n )}\n </StyledContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACYnB,SAQI,KARJ;AAZJ,OAAOA,YAAW;AAClB,SAAS,kCAAkC;AAC3C,SAAS,iBAAiB,iBAAiB,aAAa,sBAAsB;AAC9E,SAAS,iBAAiB;AAC1B,SAAS,iCAAiC;AAEnC,MAAM,4BAA4B,MAAM;AAC7C,QAAM,EAAE,kBAAkB,aAAa,aAAa,cAAc,eAAe,IAC/EA,OAAM,WAAW,yBAAyB;AAC5C,QAAM,EAAE,SAAS,QAAQ,OAAO,UAAU,WAAW,cAAc,mBAAmB,IAAI;AAC1F,QAAM,EAAE,UAAU,UAAU,iBAAiB,cAAc,UAAU,IAAI;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,eAAY;AAAA,MACZ;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,kBAAe,QAAgB,SAAkB,UAAoB,UAAoB,UACxF,8BAAC,aAAU,GACb;AAAA,QACC,SACC;AAAA,UAAC;AAAA;AAAA,YACC,IAAI,GAAG;AAAA,YACP,SAAS;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACC,GAAI,CAAC,aAAa,gBAAgB,sBAAsB,EAAE,SAAS,eAAe,IAAI,CAAC;AAAA,YAEvF,sBAAY,oBAAC,mBAAiB,iBAAM,IAAqB,oBAAC,8BAA2B,OAAO,OAAO;AAAA;AAAA,QACtG;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { DEVICE } from './constants/device.js';\n\nexport declare namespace DSControlledCheckboxT {\n type DevicesKeys = keyof typeof DEVICE;\n type Devices = (typeof DEVICE)[DevicesKeys];\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n checked: boolean | 'mixed';\n tabIndex: WCAGTabIndex;\n hasError: boolean;\n wrapLabel: boolean;\n disabled: boolean;\n readOnly: boolean;\n visualOnly: boolean;\n onChange: (\n newVal: boolean,\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLabelElement>\n | React.MouseEvent<HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>,\n ) => void;\n }\n\n export interface OptionalProps {\n onKeyDown?: React.KeyboardEventHandler;\n innerRef?: React.MutableRefObject<HTMLInputElement | null> | React.RefCallback<HTMLInputElement>;\n 'data-testid'?: string;\n device?: Devices;\n }\n\n export interface LegacyAriaProps {\n ariaControls?: string;\n ariaLabel?: string;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof OptionalProps>,\n LegacyAriaProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof OptionalProps>,\n LegacyAriaProps {}\n\n export interface StyledCheckBoxT {\n checked: boolean | 'mixed';\n readOnly?: boolean;\n hasError?: boolean;\n disabled?: boolean;\n device?: Devices;\n }\n\n export interface StyledLabelT {\n disabled?: boolean;\n readOnly?: boolean;\n checked: boolean | 'mixed';\n wrapLabel: boolean;\n device?: Devices;\n }\n}\n\nexport const defaultProps: DSControlledCheckboxT.DefaultProps = {\n wrapLabel: false,\n hasError: false,\n checked: false,\n disabled: false,\n readOnly: false,\n tabIndex: 0,\n onChange: () => {},\n visualOnly: false,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])\n .description('Wheter the checkbox is set as bool or mixed')\n .isRequiredIf((props: DSControlledCheckboxT.Props) => !props.disabled && !props.readOnly)\n .defaultValue(false),\n onChange: PropTypes.func\n .description('function executed when the checkbox changes state')\n .signature('(( newIsChecked: boolean, e: React.SyntheticEvent ) => void )')\n .isRequiredIf((props: DSControlledCheckboxT.Props) => !props.disabled && !props.readOnly),\n 'aria-controls': PropTypes.string\n .description('a11y required attribute when \"mixed\" state is to be supported')\n .isRequiredIf(\n (props: DSControlledCheckboxT.Props) => props.checked === 'mixed' && typeof props.ariaControls !== 'string',\n ),\n ariaControls: PropTypes.string\n .description('deprecated equivalent of \"aria-controls\", please use \"aria-controls\" instead')\n .deprecated({ version: '3.x', message: 'use \"aria-controls\" instead' })\n .isRequiredIf(\n (props: DSControlledCheckboxT.Props) => props.checked === 'mixed' && typeof props['aria-controls'] !== 'string',\n ),\n label: PropTypes.string.description(\n 'Checkbox Label property. This label is also going to be used as an aria-label for screen readers.',\n ),\n hasError: PropTypes.bool.description('Whether the checkbox has error or not.').defaultValue(false),\n disabled: PropTypes.bool.description('Whether the checkbox is disabled or not.').defaultValue(false),\n readOnly: PropTypes.bool.description('Whether the checkbox is readOnly or not.').defaultValue(false),\n wrapLabel: PropTypes.bool.description('Whether to wrap or truncate the label').defaultValue(false),\n device: PropTypes.oneOf(Object.values(DEVICE)).description(\n 'When not provide will scale via css breakpoint media queries, if provided, breakpoint will be ignored in favor of explicit devide declaration',\n ),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Checkbox input ref.'),\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE,SAAS,cAAc;AAmEhB,MAAM,eAAmD;AAAA,EAC9D,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU,MAAM;AAAA,EAAC;AAAA,EACjB,YAAY;AACd;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAC5D,YAAY,6CAA6C,EACzD,aAAa,CAAC,UAAuC,CAAC,MAAM,YAAY,CAAC,MAAM,QAAQ,EACvF,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,KACjB,YAAY,mDAAmD,EAC/D,UAAU,+DAA+D,EACzE,aAAa,CAAC,UAAuC,CAAC,MAAM,YAAY,CAAC,MAAM,QAAQ;AAAA,EAC1F,iBAAiB,UAAU,OACxB,YAAY,+DAA+D,EAC3E;AAAA,IACC,CAAC,UAAuC,MAAM,YAAY,WAAW,OAAO,MAAM,iBAAiB;AAAA,EACrG;AAAA,EACF,cAAc,UAAU,OACrB,YAAY,8EAA8E,EAC1F,WAAW,EAAE,SAAS,OAAO,SAAS,8BAA8B,CAAC,EACrE;AAAA,IACC,CAAC,UAAuC,MAAM,YAAY,WAAW,OAAO,MAAM,eAAe,MAAM;AAAA,EACzG;AAAA,EACF,OAAO,UAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,wCAAwC,EAAE,aAAa,KAAK;AAAA,EACjG,UAAU,UAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EACnG,UAAU,UAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EACnG,WAAW,UAAU,KAAK,YAAY,uCAAuC,EAAE,aAAa,KAAK;AAAA,EACjG,QAAQ,UAAU,MAAM,OAAO,OAAO,MAAM,CAAC,EAAE;AAAA,IAC7C;AAAA,EACF;AAAA,EACA,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAAE,YAAY,qBAAqB;AACrG;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DEVICE } from './constants/device.js';\n\nexport declare namespace DSControlledCheckboxT {\n type DevicesKeys = keyof typeof DEVICE;\n type Devices = (typeof DEVICE)[DevicesKeys];\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n checked: boolean | 'mixed';\n tabIndex: TypescriptHelpersT.WCAGTabIndex;\n hasError: boolean;\n wrapLabel: boolean;\n disabled: boolean;\n readOnly: boolean;\n visualOnly: boolean;\n onChange: (\n newVal: boolean,\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLabelElement>\n | React.MouseEvent<HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>,\n ) => void;\n }\n\n export interface OptionalProps {\n onKeyDown?: React.KeyboardEventHandler;\n innerRef?: React.MutableRefObject<HTMLInputElement | null> | React.RefCallback<HTMLInputElement>;\n 'data-testid'?: string;\n device?: Devices;\n }\n\n export interface LegacyAriaProps {\n ariaControls?: string;\n ariaLabel?: string;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof OptionalProps>,\n LegacyAriaProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof OptionalProps>,\n LegacyAriaProps {}\n\n export interface StyledCheckBoxT {\n checked: boolean | 'mixed';\n readOnly?: boolean;\n hasError?: boolean;\n disabled?: boolean;\n device?: Devices;\n }\n\n export interface StyledLabelT {\n disabled?: boolean;\n readOnly?: boolean;\n checked: boolean | 'mixed';\n wrapLabel: boolean;\n device?: Devices;\n }\n}\n\nexport const defaultProps: DSControlledCheckboxT.DefaultProps = {\n wrapLabel: false,\n hasError: false,\n checked: false,\n disabled: false,\n readOnly: false,\n tabIndex: 0,\n onChange: () => {},\n visualOnly: false,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])\n .description('Wheter the checkbox is set as bool or mixed')\n .isRequiredIf((props: DSControlledCheckboxT.Props) => !props.disabled && !props.readOnly)\n .defaultValue(false),\n onChange: PropTypes.func\n .description('function executed when the checkbox changes state')\n .signature('(( newIsChecked: boolean, e: React.SyntheticEvent ) => void )')\n .isRequiredIf((props: DSControlledCheckboxT.Props) => !props.disabled && !props.readOnly),\n 'aria-controls': PropTypes.string\n .description('a11y required attribute when \"mixed\" state is to be supported')\n .isRequiredIf(\n (props: DSControlledCheckboxT.Props) => props.checked === 'mixed' && typeof props.ariaControls !== 'string',\n ),\n ariaControls: PropTypes.string\n .description('deprecated equivalent of \"aria-controls\", please use \"aria-controls\" instead')\n .deprecated({ version: '3.x', message: 'use \"aria-controls\" instead' })\n .isRequiredIf(\n (props: DSControlledCheckboxT.Props) => props.checked === 'mixed' && typeof props['aria-controls'] !== 'string',\n ),\n label: PropTypes.string.description(\n 'Checkbox Label property. This label is also going to be used as an aria-label for screen readers.',\n ),\n hasError: PropTypes.bool.description('Whether the checkbox has error or not.').defaultValue(false),\n disabled: PropTypes.bool.description('Whether the checkbox is disabled or not.').defaultValue(false),\n readOnly: PropTypes.bool.description('Whether the checkbox is readOnly or not.').defaultValue(false),\n wrapLabel: PropTypes.bool.description('Whether to wrap or truncate the label').defaultValue(false),\n device: PropTypes.oneOf(Object.values(DEVICE)).description(\n 'When not provide will scale via css breakpoint media queries, if provided, breakpoint will be ignored in favor of explicit devide declaration',\n ),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Checkbox input ref.'),\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAEvE,SAAS,cAAc;AAmEhB,MAAM,eAAmD;AAAA,EAC9D,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU,MAAM;AAAA,EAAC;AAAA,EACjB,YAAY;AACd;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAC5D,YAAY,6CAA6C,EACzD,aAAa,CAAC,UAAuC,CAAC,MAAM,YAAY,CAAC,MAAM,QAAQ,EACvF,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,KACjB,YAAY,mDAAmD,EAC/D,UAAU,+DAA+D,EACzE,aAAa,CAAC,UAAuC,CAAC,MAAM,YAAY,CAAC,MAAM,QAAQ;AAAA,EAC1F,iBAAiB,UAAU,OACxB,YAAY,+DAA+D,EAC3E;AAAA,IACC,CAAC,UAAuC,MAAM,YAAY,WAAW,OAAO,MAAM,iBAAiB;AAAA,EACrG;AAAA,EACF,cAAc,UAAU,OACrB,YAAY,8EAA8E,EAC1F,WAAW,EAAE,SAAS,OAAO,SAAS,8BAA8B,CAAC,EACrE;AAAA,IACC,CAAC,UAAuC,MAAM,YAAY,WAAW,OAAO,MAAM,eAAe,MAAM;AAAA,EACzG;AAAA,EACF,OAAO,UAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,wCAAwC,EAAE,aAAa,KAAK;AAAA,EACjG,UAAU,UAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EACnG,UAAU,UAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EACnG,WAAW,UAAU,KAAK,YAAY,uCAAuC,EAAE,aAAa,KAAK;AAAA,EACjG,QAAQ,UAAU,MAAM,OAAO,OAAO,MAAM,CAAC,EAAE;AAAA,IAC7C;AAAA,EACF;AAAA,EACA,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAAE,YAAY,qBAAqB;AACrG;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { styled, css, xStyledCommonProps } from "@elliemae/ds-system";
2
+ import { styled, th, css, xStyledCommonProps } from "@elliemae/ds-system";
3
3
  import { handleBackgroundColor, handleCheckmark } from "./utils/styleHelpers.js";
4
4
  import { DSCheckboxName, DSCheckboxSlots } from "./exported-related/index.js";
5
5
  const StyledCheckBox = styled("span", {
@@ -12,23 +12,31 @@ const StyledCheckBox = styled("span", {
12
12
  ${({ device, theme }) => {
13
13
  if (device === "mobile") {
14
14
  return `
15
- width: 24px;
16
- height: 24px;`;
15
+ @media (max-width: ${theme.breakpoints.small}) {
16
+ width: 1.5rem; /* 24px / 16 */
17
+ height: 1.5rem; /* 24px / 16 */
18
+ }
19
+ width: 1.846rem; /* 24px / 13 */
20
+ height: 1.846rem; /* 24px / 13 */`;
17
21
  }
18
22
  if (device === void 0) {
19
23
  return `
20
24
  @media (max-width: ${theme.breakpoints.small}) {
21
- width: 24px;
22
- height: 24px;
25
+ width: 1.5rem; /* 24px / 16 */
26
+ height: 1.5rem; /* 24px / 16 */
23
27
  }
24
- width: ${theme.space.xs};
25
- height: ${theme.space.xs};
28
+ width: 1.2307rem;
29
+ height: 1.2307rem;
26
30
  `;
27
31
  }
28
32
  return `
29
- width: ${theme.space.xs};
30
- height: ${theme.space.xs};
31
- `;
33
+ @media (max-width: ${theme.breakpoints.small}) {
34
+ width: 1rem; /* 16px / 16 */
35
+ height: 1rem; /* 16px / 16 */
36
+ }
37
+ width: 1.2307rem; /* 16px / 13 */
38
+ height: 1.2307rem; /* 16px / 13 */
39
+ `;
32
40
  }}
33
41
 
34
42
  ${({ theme, checked, disabled, readOnly, hasError, device }) => handleCheckmark(theme, checked, disabled, readOnly, hasError, false, device)}
@@ -43,7 +51,6 @@ const StyledCheckBox = styled("span", {
43
51
  left: 0px;
44
52
  border: 1px solid ${({ theme, hasError }) => hasError ? theme.colors.danger[900] : theme.colors.neutral[400]};
45
53
  }
46
-
47
54
  &:hover {
48
55
  background: ${({ theme, disabled }) => !disabled ? theme.colors.brand[200] : void 0};
49
56
 
@@ -51,17 +58,14 @@ const StyledCheckBox = styled("span", {
51
58
  border: 1px solid ${({ theme, hasError }) => hasError ? theme.colors.danger[900] : theme.colors.brand[600]};
52
59
  }
53
60
  }
54
-
55
61
  &:focus-within {
56
62
  &:hover {
57
63
  ${({ theme, checked, disabled, readOnly, hasError, device }) => handleCheckmark(theme, checked, disabled, readOnly, hasError, true, device)}
58
64
  }
59
-
60
65
  &:after {
61
66
  border: 2px solid ${({ theme }) => theme.colors.brand[700]};
62
67
  }
63
68
  }
64
-
65
69
  &:active {
66
70
  &:after {
67
71
  border: 2px solid ${({ theme }) => theme.colors.brand[600]};
@@ -102,44 +106,40 @@ const StyledLabel = styled("label", {
102
106
  name: DSCheckboxName,
103
107
  slot: DSCheckboxSlots.LABEL
104
108
  })`
105
- margin: 2px 0px -2px 8px;
106
- ${({ wrapLabel, theme }) => wrapLabel ? `
107
- overflow-wrap: break-word;
108
- white-space: pre-wrap;
109
- word-break: break-word;
110
- ` : `margin-left: ${theme.space.xxs}`};
111
-
109
+ ${({ wrapLabel }) => wrapLabel && `
110
+ overflow-wrap: break-word;
111
+ white-space: pre-wrap;
112
+ word-break: break-word;
113
+ `};
114
+ width: fit-content;
112
115
  color: ${({ theme, disabled }) => disabled ? theme.colors.neutral[500] : theme.colors.neutral[800]};
113
- font-size: 13px;
114
-
116
+ line-height: 1.2307rem;
117
+ @media (max-width: ${th.breakpoint("small")}) {
118
+ line-height: 1rem; /* 13px / 16 */
119
+ }
115
120
  ${({ device, theme }) => {
116
121
  if (device === "mobile") {
117
122
  return `
118
- margin: 5px 0px -5px 8px;
119
- font-size: 16px;
120
- line-height: 1.2;
123
+ @media (max-width: ${theme.breakpoints.small}) {
124
+ font-size: 1rem; /* 16px / 16 */
125
+ }
126
+ font-size: 1.2307rem; /* 16px / 13 */
121
127
  `;
122
128
  }
123
129
  if (device === void 0) {
124
130
  return `
125
- @media (max-width: ${theme.breakpoints.small}) {
126
- margin: 5px 0px -5px 8px;
127
- font-size: 16px;
128
- line-height: 1.2;
129
- }
130
-
131
- font-size: 13px;
132
- line-height: 1.1;
131
+ font-size: 1rem;
133
132
  `;
134
133
  }
135
134
  return `
136
- font-size: 13px;
137
- line-height: 1.1;
138
- `;
139
- }}
135
+ @media (max-width: ${theme.breakpoints.small}) {
136
+ font-size: 0.8125rem; /* 13px / 16 */
137
+ }
140
138
 
139
+ font-size: 1rem; /* 13px / 13 */
140
+ `;
141
+ }}
141
142
  display: inherit;
142
-
143
143
  ${({ disabled }) => disabled ? `&:hover {
144
144
  cursor: not-allowed;
145
145
  }` : `&:hover {
@@ -154,23 +154,31 @@ const StyledContainer = styled("div", {
154
154
  ${({ device, theme }) => {
155
155
  if (device === "mobile") {
156
156
  return `
157
- grid-template-columns: 24px auto;`;
157
+ @media (max-width: ${theme.breakpoints.small}) {
158
+ grid-template-columns: 1.5rem auto; /* 24px / 16px */
159
+ }
160
+ grid-template-columns: 1.846rem auto;
161
+ `;
158
162
  }
159
163
  if (device === void 0) {
160
164
  return `
161
165
  @media (max-width: ${theme.breakpoints.small}) {
162
- grid-template-columns: 24px auto;
166
+ grid-template-columns: 1.5rem auto;
163
167
  }
164
- grid-template-columns: ${theme.space.xs} auto;
168
+ grid-template-columns: 1.23rem auto;
165
169
  `;
166
170
  }
167
171
  return `
168
- grid-template-columns: ${theme.space.xs} auto;
172
+ @media (max-width: ${theme.breakpoints.small}) {
173
+ grid-template-columns: 1rem auto; /* 16px / 16px */
174
+ }
175
+ grid-template-columns: 1.2307rem auto; /* 16px / 13 */
176
+
169
177
  `;
170
178
  }}
179
+ column-gap: 8px;
171
180
  display: inline-grid;
172
- grid-template-rows: min-content;
173
- align-items: flex-start;
181
+ align-items: ${({ wrapLabel }) => wrapLabel ? "flex-start" : "center"};
174
182
  ${xStyledCommonProps}
175
183
  `;
176
184
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { DSControlledCheckboxT } from './react-desc-prop-types.js';\nimport { handleBackgroundColor, handleCheckmark } from './utils/styleHelpers.js';\nimport { DSCheckboxName, DSCheckboxSlots } from './exported-related/index.js';\n\nexport const StyledCheckBox = styled('span', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT_WRAPPER,\n})<DSControlledCheckboxT.StyledCheckBoxT>`\n position: relative;\n background: ${({ theme, disabled }) => handleBackgroundColor(theme, disabled)};\n\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n width: 24px;\n height: 24px;`;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 24px;\n height: 24px;\n }\n width: ${theme.space.xs};\n height: ${theme.space.xs};\n `;\n }\n return `\n width: ${theme.space.xs};\n height: ${theme.space.xs};\n `;\n }}\n\n ${({ theme, checked, disabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled, readOnly, hasError, false, device)}\n\n &:after {\n content: '';\n border-radius: 2px;\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[400])};\n }\n\n &:hover {\n background: ${({ theme, disabled }) => (!disabled ? theme.colors.brand[200] : undefined)};\n\n &:after {\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.brand[600])};\n }\n }\n\n &:focus-within {\n &:hover {\n ${({ theme, checked, disabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled, readOnly, hasError, true, device)}\n }\n\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n\n &:active {\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[600]};\n }\n }\n`;\n\nconst checkboxStyles = css`\n &:hover {\n cursor: pointer;\n }\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n z-index: 1;\n`;\n\nexport const StyledInput = styled('input', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT,\n})`\n ${checkboxStyles}\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const StyledInputMixed = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT,\n})`\n ${checkboxStyles}\n ${({ 'aria-disabled': disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : ''}\n`;\n\nexport const StyledLabel = styled('label', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.LABEL,\n})<DSControlledCheckboxT.StyledLabelT>`\n margin: 2px 0px -2px 8px;\n ${({ wrapLabel, theme }) =>\n wrapLabel\n ? `\n overflow-wrap: break-word;\n white-space: pre-wrap;\n word-break: break-word;\n`\n : `margin-left: ${theme.space.xxs}`};\n\n color: ${({ theme, disabled }) => (disabled ? theme.colors.neutral[500] : theme.colors.neutral[800])};\n font-size: 13px;\n\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return `\n margin: 5px 0px -5px 8px;\n font-size: 16px;\n line-height: 1.2;\n `;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n margin: 5px 0px -5px 8px;\n font-size: 16px;\n line-height: 1.2;\n }\n\n font-size: 13px;\n line-height: 1.1;\n `;\n }\n return `\n font-size: 13px;\n line-height: 1.1;\n `;\n }}\n\n display: inherit;\n\n ${({ disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : `&:hover {\n cursor: pointer;\n }`}\n`;\n\nexport const StyledWrapLabel = styled('span')``;\n\nexport const StyledContainer = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.CONTAINER,\n})<{ device?: 'mobile' | 'desktop' }>`\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n grid-template-columns: 24px auto;`;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 24px auto;\n }\n grid-template-columns: ${theme.space.xs} auto;\n `;\n }\n return `\n grid-template-columns: ${theme.space.xs} auto;\n `;\n }}\n display: inline-grid;\n grid-template-rows: min-content;\n align-items: flex-start;\n ${xStyledCommonProps}\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,KAAK,0BAA0B;AAEhD,SAAS,uBAAuB,uBAAuB;AACvD,SAAS,gBAAgB,uBAAuB;AAEzC,MAAM,iBAAiB,OAAO,QAAQ;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA,gBAEe,CAAC,EAAE,OAAO,SAAS,MAAM,sBAAsB,OAAO,QAAQ;AAAA;AAAA,IAE1E,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,WAAW,UAAU;AACvB,WAAO;AAAA;AAAA;AAAA,EAGT;AAC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O;AAAA,6BACkB,MAAM,MAAM;AAAA;AAEvC;AAAA;AAAA;AAAA;AAAA,IAIE;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, th, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { DSControlledCheckboxT } from './react-desc-prop-types.js';\nimport { handleBackgroundColor, handleCheckmark } from './utils/styleHelpers.js';\nimport { DSCheckboxName, DSCheckboxSlots } from './exported-related/index.js';\n\nexport const StyledCheckBox = styled('span', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT_WRAPPER,\n})<DSControlledCheckboxT.StyledCheckBoxT>`\n position: relative;\n background: ${({ theme, disabled }) => handleBackgroundColor(theme, disabled)};\n\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n @media (max-width: ${theme.breakpoints.small}) {\n width: 1.5rem; /* 24px / 16 */\n height: 1.5rem; /* 24px / 16 */\n }\n width: 1.846rem; /* 24px / 13 */\n height: 1.846rem; /* 24px / 13 */`;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 1.5rem; /* 24px / 16 */\n height: 1.5rem; /* 24px / 16 */\n }\n width: 1.2307rem;\n height: 1.2307rem;\n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 1rem; /* 16px / 16 */\n height: 1rem; /* 16px / 16 */\n }\n width: 1.2307rem; /* 16px / 13 */\n height: 1.2307rem; /* 16px / 13 */\n `;\n }}\n\n ${({ theme, checked, disabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled, readOnly, hasError, false, device)}\n\n &:after {\n content: '';\n border-radius: 2px;\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[400])};\n }\n &:hover {\n background: ${({ theme, disabled }) => (!disabled ? theme.colors.brand[200] : undefined)};\n\n &:after {\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.brand[600])};\n }\n }\n &:focus-within {\n &:hover {\n ${({ theme, checked, disabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled, readOnly, hasError, true, device)}\n }\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n &:active {\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[600]};\n }\n }\n`;\n\nconst checkboxStyles = css`\n &:hover {\n cursor: pointer;\n }\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n z-index: 1;\n`;\n\nexport const StyledInput = styled('input', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT,\n})`\n ${checkboxStyles}\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const StyledInputMixed = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.INPUT,\n})`\n ${checkboxStyles}\n ${({ 'aria-disabled': disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : ''}\n`;\n\nexport const StyledLabel = styled('label', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.LABEL,\n})<DSControlledCheckboxT.StyledLabelT>`\n ${({ wrapLabel }) =>\n wrapLabel &&\n `\n overflow-wrap: break-word;\n white-space: pre-wrap;\n word-break: break-word;\n`};\n width: fit-content;\n color: ${({ theme, disabled }) => (disabled ? theme.colors.neutral[500] : theme.colors.neutral[800])};\n line-height: 1.2307rem;\n @media (max-width: ${th.breakpoint('small')}) {\n line-height: 1rem; /* 13px / 16 */\n }\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n font-size: 1rem; /* 16px / 16 */\n }\n font-size: 1.2307rem; /* 16px / 13 */\n `;\n }\n if (device === undefined) {\n return `\n font-size: 1rem; \n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n font-size: 0.8125rem; /* 13px / 16 */\n }\n\n font-size: 1rem; /* 13px / 13 */\n `;\n }}\n display: inherit;\n ${({ disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : `&:hover {\n cursor: pointer;\n }`}\n`;\n\nexport const StyledWrapLabel = styled('span')``;\n\nexport const StyledContainer = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.CONTAINER,\n})<{ device?: 'mobile' | 'desktop'; wrapLabel?: boolean }>`\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1.5rem auto; /* 24px / 16px */\n }\n grid-template-columns: 1.846rem auto;\n `;\n }\n if (device === undefined) {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1.5rem auto;\n }\n grid-template-columns: 1.23rem auto;\n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1rem auto; /* 16px / 16px */\n }\n grid-template-columns: 1.2307rem auto; /* 16px / 13 */\n\n `;\n }}\n column-gap: 8px;\n display: inline-grid;\n align-items: ${({ wrapLabel }) => (wrapLabel ? 'flex-start' : 'center')};\n ${xStyledCommonProps}\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,IAAI,KAAK,0BAA0B;AAEpD,SAAS,uBAAuB,uBAAuB;AACvD,SAAS,gBAAgB,uBAAuB;AAEzC,MAAM,iBAAiB,OAAO,QAAQ;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA,gBAEe,CAAC,EAAE,OAAO,SAAS,MAAM,sBAAsB,OAAO,QAAQ;AAAA;AAAA,IAE1E,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,WAAW,UAAU;AACvB,WAAO;AAAA,2BACc,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzC;AACA,MAAI,WAAW,QAAW;AACxB,WAAO;AAAA,6BACgB,MAAM,YAAY;AAAA;AAAA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AAY,eAAe;AAAA,IAC5D;AAAA;",
6
6
  "names": []
7
7
  }
@@ -15,57 +15,91 @@ const handleCheckMarkColor = ({ colors }, checked, isHovering, disabled, readOnl
15
15
  return colors.brand[600];
16
16
  };
17
17
  const handleCheckmark = (theme, checked, disabled, readOnly, hasError, isHovering = false, device = void 0) => {
18
+ const commonStyles = `
19
+ position: absolute;
20
+ content: '';
21
+ border-left: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
22
+ border-bottom: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
23
+ `;
18
24
  const desktopMixedCheckmark = `
19
25
  position: absolute;
20
26
  content: '';
21
- top: 7px;
22
- left: 4px;
27
+ top: 0.538rem; /* 7px / baseFontSize */
28
+ left: 0.308rem; /* 4px / baseFontSize */
23
29
  background: ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
24
- width: ${theme.space.xxs};
25
- height: 2px;
30
+ width: 0.615rem; /* theme.space.xxs / baseFontSize */
31
+ height: 0.154rem; /* 2px / baseFontSize */
32
+ @media (max-width: ${theme.breakpoints.small}) {
33
+ top: 0.4375rem; /* 7px / 16 */
34
+ left: 0.25rem; /* 4px / 16 */
35
+ height: 0.125rem; /* 8px / 16 */
36
+ width: 0.5rem;/* 2px / 16 */
37
+ }
26
38
  `;
27
39
  const normalMixedCheckmark = `
40
+ ${desktopMixedCheckmark}
28
41
  @media (max-width: ${theme.breakpoints.small}) {
29
- top:11px;
30
- left:6px;
31
- height:2px;
32
- width:12px;
42
+ top: 0.6875rem; /* 11px / 16 */
43
+ left: 0.375rem; /* 6px / 16 */
44
+ height: 0.125rem; /* 2px / 16 */
45
+ width: 0.75rem; /* 12px / 16 */
33
46
  }
34
- ${desktopMixedCheckmark}
35
47
  `;
36
48
  const mobileMixedCheckmark = `
37
- ${desktopMixedCheckmark}
38
- top:11px;
39
- left:6px;
40
- height:2px;
41
- width:12px;
49
+ ${commonStyles}
50
+ @media (max-width: ${theme.breakpoints.small}) {
51
+ top: 0.6875rem; /* 11px / 16 */
52
+ left: 0.375rem; /* 6px / 16 */
53
+ height: 0.125rem; /* 2px / 16 */
54
+ width: 0.75rem; /* 12px / 16 */
55
+ }
56
+ top: 0.8461rem; /* 11px / 13 */
57
+ left: 0.4615rem; /* 6px / 13 */
58
+ height: 0.1538rem; /* 2px / 13 */
59
+ width: 0.9231rem; /* 12px / 13 */
60
+
42
61
  `;
43
62
  const desktopCheckmark = `
44
63
  position: absolute;
45
64
  content: '';
46
- top: 4px;
47
- left: 3px;
48
- border-left: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
49
- border-bottom: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
50
- height: 5px;
51
- width: 10px;
65
+ top: 0.308rem; /* 4px / baseFontSize */
66
+ left: 0.231rem; /* 3px / baseFontSize */
67
+ border-left: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
68
+ border-bottom: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
69
+ height: 0.385rem; /* 5px / baseFontSize */
70
+ width: 0.769rem; /* 10px / baseFontSize */
52
71
  transform: rotate(-45deg);
53
- `;
54
- const normalCheckmark = `
72
+
55
73
  @media (max-width: ${theme.breakpoints.small}) {
56
- top: 6px;
57
- left: 4px;
58
- height: 8px;
59
- width: 17px;
74
+ top: 0.25rem; /* 4px / 16 */
75
+ left: 0.1875rem; /* 3px / 16 */
76
+ height: 0.3125rem; /* 5px / 16 */
77
+ width: 0.625rem; /* 10px / 16 */
60
78
  }
61
- ${desktopCheckmark}
79
+ `;
80
+ const normalCheckmark = `
81
+
82
+ ${desktopCheckmark}
83
+ @media (max-width: ${theme.breakpoints.small}) {
84
+ top: 0.375rem; /* 6px / 16 */
85
+ left: 0.25rem; /* 4px / 16 */
86
+ height: 0.5rem; /* 8px / 16 */
87
+ width: 1.0625rem; /* 17px / 16 */
88
+ }
62
89
  `;
63
90
  const mobileCheckmark = `
64
- ${desktopCheckmark}
65
- top: 6px;
66
- left: 4px;
67
- height: 8px;
68
- width: 17px;
91
+ ${commonStyles}
92
+ @media (max-width: ${theme.breakpoints.small}) {
93
+ top: 0.375rem; /* 6px / 16 */
94
+ left: 0.25rem; /* 4px / 16 */
95
+ height: 0.5rem; /* 8px / 16 */
96
+ width: 1.0625rem; /* 17px / 16 */
97
+ }
98
+ top: 0.4615rem; /* 6px / 13 */
99
+ left: 0.3077rem; /* 4px / 13 */
100
+ height: 0.6154rem; /* 8px / 13 */
101
+ width: 1.3077rem; /* 17px / 13 */
102
+ transform: rotate(-45deg);
69
103
  `;
70
104
  if (checked === "mixed") {
71
105
  return `&:before {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/styleHelpers.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable no-nested-ternary */\n/* eslint-disable max-params */\n\nimport type { Theme } from '@elliemae/pui-theme';\nexport const handleCheckMarkColor = (\n { colors }: Theme,\n checked: boolean | 'mixed',\n isHovering: boolean,\n disabled?: boolean,\n readOnly?: boolean,\n hasError?: boolean,\n): string => {\n if (hasError) {\n return colors.danger[900];\n }\n if (readOnly) {\n return colors.neutral[500];\n }\n if (disabled) {\n return colors.neutral[500];\n }\n if (isHovering) {\n return colors.brand[600];\n }\n return colors.brand[600];\n};\n\nexport const handleCheckmark = (\n theme: Theme,\n checked: boolean | 'mixed',\n disabled?: boolean,\n readOnly?: boolean,\n hasError?: boolean,\n isHovering = false,\n device: string | undefined = undefined,\n): string => {\n const desktopMixedCheckmark = `\n position: absolute;\n content: '';\n top: 7px;\n left: 4px;\n background: ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\n width: ${theme.space.xxs};\n height: 2px;\n`;\n\n const normalMixedCheckmark = `\n @media (max-width: ${theme.breakpoints.small}) {\n top:11px;\n left:6px;\n height:2px;\n width:12px;\n }\n ${desktopMixedCheckmark}\n`;\n const mobileMixedCheckmark = `\n ${desktopMixedCheckmark}\n top:11px;\n left:6px;\n height:2px;\n width:12px;\n`;\n const desktopCheckmark = `\nposition: absolute;\ncontent: '';\ntop: 4px;\nleft: 3px;\nborder-left: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\nborder-bottom: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\nheight: 5px;\nwidth: 10px;\ntransform: rotate(-45deg);\n`;\n\n const normalCheckmark = `\n@media (max-width: ${theme.breakpoints.small}) {\n top: 6px;\n left: 4px;\n height: 8px;\n width: 17px;\n}\n${desktopCheckmark}\n`;\n const mobileCheckmark = `\n${desktopCheckmark}\ntop: 6px;\nleft: 4px;\nheight: 8px;\nwidth: 17px;\n`;\n\n if (checked === 'mixed') {\n return `&:before {\n ${device === undefined ? normalMixedCheckmark : device === 'mobile' ? mobileMixedCheckmark : desktopMixedCheckmark}\n}`;\n }\n if (checked) {\n return `&:before {\n ${device === undefined ? normalCheckmark : device === 'mobile' ? mobileCheckmark : desktopCheckmark}\n}`;\n }\n return '';\n};\n\nexport const handleBackgroundColor = ({ colors }: Theme, disabled?: boolean): string => {\n if (disabled) {\n return colors.neutral['080'];\n }\n\n return colors.neutral['000'];\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACKhB,MAAM,uBAAuB,CAClC,EAAE,OAAO,GACT,SACA,YACA,UACA,UACA,aACW;AACX,MAAI,UAAU;AACZ,WAAO,OAAO,OAAO,GAAG;AAAA,EAC1B;AACA,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,GAAG;AAAA,EAC3B;AACA,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,GAAG;AAAA,EAC3B;AACA,MAAI,YAAY;AACd,WAAO,OAAO,MAAM,GAAG;AAAA,EACzB;AACA,SAAO,OAAO,MAAM,GAAG;AACzB;AAEO,MAAM,kBAAkB,CAC7B,OACA,SACA,UACA,UACA,UACA,aAAa,OACb,SAA6B,WAClB;AACX,QAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKhB,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA,WAClF,MAAM,MAAM;AAAA;AAAA;AAIrB,QAAM,uBAAuB;AAAA,uBACR,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMrC;AAAA;AAEF,QAAM,uBAAuB;AAAA,IAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAMF,QAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,yBAKF,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA,2BAC3E,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA;AAAA;AAAA;AAAA;AAMtG,QAAM,kBAAkB;AAAA,qBACL,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrC;AAAA;AAEA,QAAM,kBAAkB;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,MAAI,YAAY,SAAS;AACvB,WAAO;AAAA,IACP,WAAW,SAAY,uBAAuB,WAAW,WAAW,uBAAuB;AAAA;AAAA,EAE7F;AACA,MAAI,SAAS;AACX,WAAO;AAAA,MACL,WAAW,SAAY,kBAAkB,WAAW,WAAW,kBAAkB;AAAA;AAAA,EAErF;AACA,SAAO;AACT;AAEO,MAAM,wBAAwB,CAAC,EAAE,OAAO,GAAU,aAA+B;AACtF,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,KAAK;AAAA,EAC7B;AAEA,SAAO,OAAO,QAAQ,KAAK;AAC7B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable no-nested-ternary */\n/* eslint-disable max-params */\n\nimport type { Theme } from '@elliemae/pui-theme';\nexport const handleCheckMarkColor = (\n { colors }: Theme,\n checked: boolean | 'mixed',\n isHovering: boolean,\n disabled?: boolean,\n readOnly?: boolean,\n hasError?: boolean,\n): string => {\n if (hasError) {\n return colors.danger[900];\n }\n if (readOnly) {\n return colors.neutral[500];\n }\n if (disabled) {\n return colors.neutral[500];\n }\n if (isHovering) {\n return colors.brand[600];\n }\n return colors.brand[600];\n};\n\nexport const handleCheckmark = (\n theme: Theme,\n checked: boolean | 'mixed',\n disabled?: boolean,\n readOnly?: boolean,\n hasError?: boolean,\n isHovering = false,\n device: string | undefined = undefined,\n): string => {\n const commonStyles = `\n position: absolute;\n content: '';\n border-left: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\n border-bottom: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\n `;\n const desktopMixedCheckmark = `\n position: absolute;\n content: '';\n top: 0.538rem; /* 7px / baseFontSize */\n left: 0.308rem; /* 4px / baseFontSize */\n background: ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\n width: 0.615rem; /* theme.space.xxs / baseFontSize */\n height: 0.154rem; /* 2px / baseFontSize */\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.4375rem; /* 7px / 16 */\n left: 0.25rem; /* 4px / 16 */\n height: 0.125rem; /* 8px / 16 */\n width: 0.5rem;/* 2px / 16 */\n }\n`;\n\n const normalMixedCheckmark = `\n ${desktopMixedCheckmark}\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.6875rem; /* 11px / 16 */\n left: 0.375rem; /* 6px / 16 */\n height: 0.125rem; /* 2px / 16 */\n width: 0.75rem; /* 12px / 16 */\n }\n`;\n const mobileMixedCheckmark = `\n ${commonStyles}\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.6875rem; /* 11px / 16 */\n left: 0.375rem; /* 6px / 16 */\n height: 0.125rem; /* 2px / 16 */\n width: 0.75rem; /* 12px / 16 */\n }\n top: 0.8461rem; /* 11px / 13 */\n left: 0.4615rem; /* 6px / 13 */\n height: 0.1538rem; /* 2px / 13 */\n width: 0.9231rem; /* 12px / 13 */\n\n`;\n const desktopCheckmark = `\nposition: absolute;\ncontent: '';\ntop: 0.308rem; /* 4px / baseFontSize */\nleft: 0.231rem; /* 3px / baseFontSize */\nborder-left: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\nborder-bottom: 0.154rem solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};\nheight: 0.385rem; /* 5px / baseFontSize */\nwidth: 0.769rem; /* 10px / baseFontSize */\ntransform: rotate(-45deg);\n\n@media (max-width: ${theme.breakpoints.small}) {\n top: 0.25rem; /* 4px / 16 */\n left: 0.1875rem; /* 3px / 16 */\n height: 0.3125rem; /* 5px / 16 */\n width: 0.625rem; /* 10px / 16 */\n}\n`;\n\n const normalCheckmark = `\n\n ${desktopCheckmark}\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.375rem; /* 6px / 16 */\n left: 0.25rem; /* 4px / 16 */\n height: 0.5rem; /* 8px / 16 */\n width: 1.0625rem; /* 17px / 16 */\n }\n`;\n const mobileCheckmark = `\n ${commonStyles}\n @media (max-width: ${theme.breakpoints.small}) {\n top: 0.375rem; /* 6px / 16 */\n left: 0.25rem; /* 4px / 16 */\n height: 0.5rem; /* 8px / 16 */\n width: 1.0625rem; /* 17px / 16 */\n }\n top: 0.4615rem; /* 6px / 13 */\n left: 0.3077rem; /* 4px / 13 */\n height: 0.6154rem; /* 8px / 13 */\n width: 1.3077rem; /* 17px / 13 */\n transform: rotate(-45deg);\n`;\n\n if (checked === 'mixed') {\n return `&:before {\n ${device === undefined ? normalMixedCheckmark : device === 'mobile' ? mobileMixedCheckmark : desktopMixedCheckmark}\n}`;\n }\n if (checked) {\n return `&:before {\n ${device === undefined ? normalCheckmark : device === 'mobile' ? mobileCheckmark : desktopCheckmark}\n}`;\n }\n return '';\n};\n\nexport const handleBackgroundColor = ({ colors }: Theme, disabled?: boolean): string => {\n if (disabled) {\n return colors.neutral['080'];\n }\n\n return colors.neutral['000'];\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACKhB,MAAM,uBAAuB,CAClC,EAAE,OAAO,GACT,SACA,YACA,UACA,UACA,aACW;AACX,MAAI,UAAU;AACZ,WAAO,OAAO,OAAO,GAAG;AAAA,EAC1B;AACA,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,GAAG;AAAA,EAC3B;AACA,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,GAAG;AAAA,EAC3B;AACA,MAAI,YAAY;AACd,WAAO,OAAO,MAAM,GAAG;AAAA,EACzB;AACA,SAAO,OAAO,MAAM,GAAG;AACzB;AAEO,MAAM,kBAAkB,CAC7B,OACA,SACA,UACA,UACA,UACA,aAAa,OACb,SAA6B,WAClB;AACX,QAAM,eAAe;AAAA;AAAA;AAAA,kCAGW,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA,oCAC3E,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA;AAE/G,QAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKhB,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA;AAAA;AAAA,uBAGtE,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQvC,QAAM,uBAAuB;AAAA,IAC3B;AAAA,uBACmB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvC,QAAM,uBAAuB;AAAA,IAC3B;AAAA,uBACmB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYvC,QAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,8BAKG,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA,gCAC3E,qBAAqB,OAAO,SAAS,YAAY,UAAU,UAAU,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,qBAKxF,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQrC,QAAM,kBAAkB;AAAA;AAAA,IAEtB;AAAA,uBACmB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvC,QAAM,kBAAkB;AAAA,MACpB;AAAA,yBACmB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAazC,MAAI,YAAY,SAAS;AACvB,WAAO;AAAA,IACP,WAAW,SAAY,uBAAuB,WAAW,WAAW,uBAAuB;AAAA;AAAA,EAE7F;AACA,MAAI,SAAS;AACX,WAAO;AAAA,MACL,WAAW,SAAY,kBAAkB,WAAW,WAAW,kBAAkB;AAAA;AAAA,EAErF;AACA,SAAO;AACT;AAEO,MAAM,wBAAwB,CAAC,EAAE,OAAO,GAAU,aAA+B;AACtF,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ,KAAK;AAAA,EAC7B;AAEA,SAAO,OAAO,QAAQ,KAAK;AAC7B;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,6 @@
1
1
  import type React from 'react';
2
2
  import type { GlobalAttributesT } from '@elliemae/ds-props-helpers';
3
+ import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
3
4
  import { DEVICE } from './constants/device.js';
4
5
  export declare namespace DSControlledCheckboxT {
5
6
  type DevicesKeys = keyof typeof DEVICE;
@@ -8,7 +9,7 @@ export declare namespace DSControlledCheckboxT {
8
9
  }
9
10
  interface DefaultProps {
10
11
  checked: boolean | 'mixed';
11
- tabIndex: WCAGTabIndex;
12
+ tabIndex: TypescriptHelpersT.WCAGTabIndex;
12
13
  hasError: boolean;
13
14
  wrapLabel: boolean;
14
15
  disabled: boolean;
@@ -140,6 +141,8 @@ export declare const propTypes: {
140
141
  borderLeftWidth: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
141
142
  borderRadius: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
142
143
  boxShadow: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
144
+ fontWeight: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
145
+ textAlign: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
143
146
  'aria-*': import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
144
147
  'on-*': import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
145
148
  'data-*': import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
@@ -6,4 +6,5 @@ export declare const StyledLabel: import("styled-components").StyledComponent<"l
6
6
  export declare const StyledWrapLabel: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
7
7
  export declare const StyledContainer: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
8
8
  device?: "mobile" | "desktop" | undefined;
9
+ wrapLabel?: boolean | undefined;
9
10
  } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-form-checkbox",
3
- "version": "3.29.2-rc.0",
3
+ "version": "3.30.0-next.0",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Controlled Form Checkbox",
6
6
  "files": [
@@ -36,16 +36,17 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "uid": "~2.0.1",
39
- "@elliemae/ds-props-helpers": "3.29.2-rc.0",
40
- "@elliemae/ds-system": "3.29.2-rc.0",
41
- "@elliemae/ds-truncated-tooltip-text": "3.29.2-rc.0",
42
- "@elliemae/ds-utilities": "3.29.2-rc.0"
39
+ "@elliemae/ds-props-helpers": "3.30.0-next.0",
40
+ "@elliemae/ds-typescript-helpers": "3.30.0-next.0",
41
+ "@elliemae/ds-system": "3.30.0-next.0",
42
+ "@elliemae/ds-utilities": "3.30.0-next.0",
43
+ "@elliemae/ds-truncated-tooltip-text": "3.30.0-next.0"
43
44
  },
44
45
  "devDependencies": {
45
46
  "@elliemae/pui-cli": "~9.0.0-next.31",
46
47
  "@elliemae/pui-theme": "~2.7.0",
47
48
  "styled-components": "~5.3.9",
48
- "@elliemae/ds-monorepo-devops": "3.29.2-rc.0"
49
+ "@elliemae/ds-monorepo-devops": "3.30.0-next.0"
49
50
  },
50
51
  "peerDependencies": {
51
52
  "@elliemae/pui-theme": "~2.7.0",