@elliemae/ds-form-checkbox 3.80.0-next.77 → 3.80.0-next.79

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/MainInput.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable complexity */\nimport React from 'react';\nimport { omitLockAttributes, useOwnerProps, omitLockedHandlers, isLocked, resolveAriaDisabled } from '@elliemae/ds-props-helpers';\nimport { StyledInput, StyledInputMixed } from '../styles.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\n\nexport const MainInput = () => {\n const {\n propsWithDefault,\n globalProps,\n instanceUid,\n handleOnChange,\n handleMixedCheckboxOnKeyDown,\n handleNativeCheckboxOnKeyDown,\n } = React.useContext(ControlledCheckBoxContext);\n const {\n // label,\n tabIndex,\n innerRef,\n checked,\n visualOnly,\n ariaControls: camelCaseAriaControls,\n withRelatedBlockLabel,\n // ariaLabel: camelCaseAriaLabel,\n // externalLabel,\n hasError,\n applyAriaDisabled,\n } = propsWithDefault;\n // disabled is a global attribute: it is taken out of the spread here, so the mixed-state div never prints it\n // (the native input sets it explicitly below)\n const { disabled, readOnly } = globalProps;\n const restProps = omitLockAttributes(globalProps);\n const locked = isLocked({ disabled, applyAriaDisabled, readOnly });\n const { 'aria-controls': ariaControls } = restProps;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n // if components doesn't define 'aria-controls' it would be \"a11y invalid\" to allow 'mixed' state\n // so\n // if they are NOT provided we use <input type='checkbox' /> that has no 'mixed' state support in html5\n // if they ARE provided we use <input /> (no type checkbox) in which we super-charge the 'mixed' state via css\n // props slightly differ because of this\n // also, because of this, \"onChange\" may be an onClick (or keyboard activation) or the native \"onChange\"\n const canShowMixedState = ariaControls || camelCaseAriaControls;\n // if aria-label is provided we are probably printing a 'label-less' checkbox (like data-table, or mixed parent in a group)\n // in such scenarios having the aria-labelledby may results in 'referencing a non-existing element' error\n const outOfTheBoxAriaLabelledBy = !globalProps['aria-label']\n ? `${instanceUid}_label${withRelatedBlockLabel ? ` ${instanceUid}_block_label` : ''}`\n : undefined;\n\n const mainInputProps = {\n id: instanceUid,\n 'data-testid': 'ds-checkbox',\n 'aria-checked': checked, // if user doesn't provide aria-checked, we make this the same as the actual value\n 'aria-labelledby': outOfTheBoxAriaLabelledBy,\n // if the user provides an aria-labelledby we still do print it anyway, so this should work for both internal scenarios and final integrations\n // any props provided by the user will over-ride ours; while locked the consumer's activation handlers are dropped\n // inversion of control: a consumer-provided aria-readonly passes through in this spread (Dimsum never writes one itself)\n // the mixed-state div has no native change element (its change IS the click / keyboard activation); the native\n // checkbox has one, so its gate is the change\n ...omitLockedHandlers(restProps, locked, canShowMixedState ? 'activation' : 'change'),\n };\n\n if (visualOnly) return null;\n\n if (canShowMixedState)\n return (\n <StyledInputMixed\n {...mainInputProps}\n role=\"checkbox\"\n aria-controls={ariaControls || camelCaseAriaControls}\n // a locked mixed checkbox prints \"true\" whatever the consumer passes, otherwise the consumer's own value passes\n aria-disabled={resolveAriaDisabled({ softLocked: locked, consumerValue: restProps['aria-disabled'] })}\n $disabled={Boolean(disabled)}\n aria-invalid={hasError}\n onClick={locked ? undefined : handleOnChange}\n onKeyDown={handleMixedCheckboxOnKeyDown}\n tabIndex={disabled ? -1 : tabIndex}\n innerRef={innerRef}\n onMouseDown={(e: React.MouseEvent) => {\n if (disabled) e.preventDefault();\n }}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n return (\n <StyledInput\n {...mainInputProps}\n type=\"checkbox\"\n checked={checked as boolean | undefined}\n onChange={handleOnChange}\n onKeyDown={handleNativeCheckboxOnKeyDown}\n disabled={disabled}\n tabIndex={tabIndex}\n innerRef={innerRef}\n aria-invalid={hasError}\n // a soft lock prints \"true\" whatever the consumer passes, a natively disabled checkbox prints none of its own,\n // otherwise the consumer's own aria-disabled passes through (inversion of control)\n aria-disabled={resolveAriaDisabled({\n disabled: disabled,\n softLocked: applyAriaDisabled || readOnly,\n consumerValue: restProps['aria-disabled'],\n })}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmEjB;AAlEN,mBAAkB;AAClB,8BAAqG;AACrG,oBAA8C;AAC9C,mCAA0C;AAEnC,MAAM,YAAY,MAAM;AAC7B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,aAAAA,QAAM,WAAW,sDAAyB;AAC9C,QAAM;AAAA;AAAA,IAEJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,EACF,IAAI;AAGJ,QAAM,EAAE,UAAU,SAAS,IAAI;AAC/B,QAAM,gBAAY,4CAAmB,WAAW;AAChD,QAAM,aAAS,kCAAS,EAAE,UAAU,mBAAmB,SAAS,CAAC;AACjE,QAAM,EAAE,iBAAiB,aAAa,IAAI;AAE1C,QAAM,EAAE,eAAe,uBAAuB,QAAI,uCAAc,gBAAgB;AAQhF,QAAM,oBAAoB,gBAAgB;AAG1C,QAAM,4BAA4B,CAAC,YAAY,YAAY,IACvD,GAAG,WAAW,SAAS,wBAAwB,IAAI,WAAW,iBAAiB,EAAE,KACjF;AAEJ,QAAM,iBAAiB;AAAA,IACrB,IAAI;AAAA,IACJ,eAAe;AAAA,IACf,gBAAgB;AAAA;AAAA,IAChB,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMnB,OAAG,4CAAmB,WAAW,QAAQ,oBAAoB,eAAe,QAAQ;AAAA,EACtF;AAEA,MAAI,WAAY,QAAO;AAEvB,MAAI;AACF,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,MAAK;AAAA,QACL,iBAAe,gBAAgB;AAAA,QAE/B,qBAAe,6CAAoB,EAAE,YAAY,QAAQ,eAAe,UAAU,eAAe,EAAE,CAAC;AAAA,QACpG,WAAW,QAAQ,QAAQ;AAAA,QAC3B,gBAAc;AAAA,QACd,SAAS,SAAS,SAAY;AAAA,QAC9B,WAAW;AAAA,QACX,UAAU,WAAW,KAAK;AAAA,QAC1B;AAAA,QACA,aAAa,CAAC,MAAwB;AACpC,cAAI,SAAU,GAAE,eAAe;AAAA,QACjC;AAAA,QACA,oBAAkB,WAAW,GAAG,WAAW,0BAA0B;AAAA,QACrE;AAAA,QACA;AAAA;AAAA,IACF;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAc;AAAA,MAGd,qBAAe,6CAAoB;AAAA,QACjC;AAAA,QACA,YAAY,qBAAqB;AAAA,QACjC,eAAe,UAAU,eAAe;AAAA,MAC1C,CAAC;AAAA,MACD,oBAAkB,WAAW,GAAG,WAAW,0BAA0B;AAAA,MACrE;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["/* eslint-disable complexity */\nimport React from 'react';\nimport {\n omitLockAttributes,\n useOwnerProps,\n omitLockedHandlers,\n isLocked,\n resolveAriaDisabled,\n} from '@elliemae/ds-props-helpers';\nimport { StyledInput, StyledInputMixed } from '../styles.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\n\nexport const MainInput = () => {\n const {\n propsWithDefault,\n globalProps,\n instanceUid,\n handleOnChange,\n handleMixedCheckboxOnKeyDown,\n handleNativeCheckboxOnKeyDown,\n } = React.useContext(ControlledCheckBoxContext);\n const {\n // label,\n tabIndex,\n innerRef,\n checked,\n visualOnly,\n ariaControls: camelCaseAriaControls,\n withRelatedBlockLabel,\n // ariaLabel: camelCaseAriaLabel,\n // externalLabel,\n hasError,\n applyAriaDisabled,\n } = propsWithDefault;\n // disabled is a global attribute: it is taken out of the spread here, so the mixed-state div never prints it\n // (the native input sets it explicitly below)\n const { disabled, readOnly } = globalProps;\n const restProps = omitLockAttributes(globalProps);\n const locked = isLocked({ disabled, applyAriaDisabled, readOnly });\n const { 'aria-controls': ariaControls } = restProps;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n // if components doesn't define 'aria-controls' it would be \"a11y invalid\" to allow 'mixed' state\n // so\n // if they are NOT provided we use <input type='checkbox' /> that has no 'mixed' state support in html5\n // if they ARE provided we use <input /> (no type checkbox) in which we super-charge the 'mixed' state via css\n // props slightly differ because of this\n // also, because of this, \"onChange\" may be an onClick (or keyboard activation) or the native \"onChange\"\n const canShowMixedState = ariaControls || camelCaseAriaControls;\n // if aria-label is provided we are probably printing a 'label-less' checkbox (like data-table, or mixed parent in a group)\n // in such scenarios having the aria-labelledby may results in 'referencing a non-existing element' error\n const outOfTheBoxAriaLabelledBy = !globalProps['aria-label']\n ? `${instanceUid}_label${withRelatedBlockLabel ? ` ${instanceUid}_block_label` : ''}`\n : undefined;\n\n const mainInputProps = {\n id: instanceUid,\n 'data-testid': 'ds-checkbox',\n 'aria-checked': checked, // if user doesn't provide aria-checked, we make this the same as the actual value\n 'aria-labelledby': outOfTheBoxAriaLabelledBy,\n // if the user provides an aria-labelledby we still do print it anyway, so this should work for both internal scenarios and final integrations\n // any props provided by the user will over-ride ours; while locked the consumer's activation handlers are dropped\n // inversion of control: a consumer-provided aria-readonly passes through in this spread (Dimsum never writes one itself)\n // the mixed-state div has no native change element (its change IS the click / keyboard activation); the native\n // checkbox has one, so its gate is the change\n ...omitLockedHandlers(restProps, locked, canShowMixedState ? 'activation' : 'change'),\n };\n\n if (visualOnly) return null;\n\n if (canShowMixedState)\n return (\n <StyledInputMixed\n {...mainInputProps}\n role=\"checkbox\"\n aria-controls={ariaControls || camelCaseAriaControls}\n // a locked mixed checkbox prints \"true\" whatever the consumer passes, otherwise the consumer's own value passes\n aria-disabled={resolveAriaDisabled({ softLocked: locked, consumerValue: restProps['aria-disabled'] })}\n $disabled={Boolean(disabled)}\n aria-invalid={hasError}\n onClick={locked ? undefined : handleOnChange}\n onKeyDown={handleMixedCheckboxOnKeyDown}\n tabIndex={disabled ? -1 : tabIndex}\n innerRef={innerRef}\n onMouseDown={(e: React.MouseEvent) => {\n if (disabled) e.preventDefault();\n }}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n return (\n <StyledInput\n {...mainInputProps}\n type=\"checkbox\"\n checked={checked as boolean | undefined}\n onChange={handleOnChange}\n onKeyDown={handleNativeCheckboxOnKeyDown}\n disabled={disabled}\n tabIndex={tabIndex}\n innerRef={innerRef}\n aria-invalid={hasError}\n // a soft lock prints \"true\" whatever the consumer passes, a natively disabled checkbox prints none of its own,\n // otherwise the consumer's own aria-disabled passes through (inversion of control)\n aria-disabled={resolveAriaDisabled({\n disabled,\n softLocked: applyAriaDisabled || readOnly,\n consumerValue: restProps['aria-disabled'],\n })}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyEjB;AAxEN,mBAAkB;AAClB,8BAMO;AACP,oBA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A,QACA,aAAa,CAAC,MAAwB;AACpC,cAAI,SAAU,GAAE,eAAe;AAAA,QACjC;AAAA,QACA,oBAAkB,WAAW,GAAG,WAAW,0BAA0B;AAAA,QACrE;AAAA,QACA;AAAA;AAAA,IACF;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAc;AAAA,MAGd,qBAAe,6CAAoB;AAAA,QACjC;AAAA,QACA,YAAY,qBAAqB;AAAA,QACjC,eAAe,UAAU,eAAe;AAAA,MAC1C,CAAC;AAAA,MACD,oBAAkB,WAAW,GAAG,WAAW,0BAA0B;AAAA,MACrE;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,7 +1,13 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import React2 from "react";
4
- import { omitLockAttributes, useOwnerProps, omitLockedHandlers, isLocked, resolveAriaDisabled } from "@elliemae/ds-props-helpers";
4
+ import {
5
+ omitLockAttributes,
6
+ useOwnerProps,
7
+ omitLockedHandlers,
8
+ isLocked,
9
+ resolveAriaDisabled
10
+ } from "@elliemae/ds-props-helpers";
5
11
  import { StyledInput, StyledInputMixed } from "../styles.js";
6
12
  import { ControlledCheckBoxContext } from "../ControlledCheckboxCTX.js";
7
13
  const MainInput = () => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/MainInput.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React from 'react';\nimport { omitLockAttributes, useOwnerProps, omitLockedHandlers, isLocked, resolveAriaDisabled } from '@elliemae/ds-props-helpers';\nimport { StyledInput, StyledInputMixed } from '../styles.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\n\nexport const MainInput = () => {\n const {\n propsWithDefault,\n globalProps,\n instanceUid,\n handleOnChange,\n handleMixedCheckboxOnKeyDown,\n handleNativeCheckboxOnKeyDown,\n } = React.useContext(ControlledCheckBoxContext);\n const {\n // label,\n tabIndex,\n innerRef,\n checked,\n visualOnly,\n ariaControls: camelCaseAriaControls,\n withRelatedBlockLabel,\n // ariaLabel: camelCaseAriaLabel,\n // externalLabel,\n hasError,\n applyAriaDisabled,\n } = propsWithDefault;\n // disabled is a global attribute: it is taken out of the spread here, so the mixed-state div never prints it\n // (the native input sets it explicitly below)\n const { disabled, readOnly } = globalProps;\n const restProps = omitLockAttributes(globalProps);\n const locked = isLocked({ disabled, applyAriaDisabled, readOnly });\n const { 'aria-controls': ariaControls } = restProps;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n // if components doesn't define 'aria-controls' it would be \"a11y invalid\" to allow 'mixed' state\n // so\n // if they are NOT provided we use <input type='checkbox' /> that has no 'mixed' state support in html5\n // if they ARE provided we use <input /> (no type checkbox) in which we super-charge the 'mixed' state via css\n // props slightly differ because of this\n // also, because of this, \"onChange\" may be an onClick (or keyboard activation) or the native \"onChange\"\n const canShowMixedState = ariaControls || camelCaseAriaControls;\n // if aria-label is provided we are probably printing a 'label-less' checkbox (like data-table, or mixed parent in a group)\n // in such scenarios having the aria-labelledby may results in 'referencing a non-existing element' error\n const outOfTheBoxAriaLabelledBy = !globalProps['aria-label']\n ? `${instanceUid}_label${withRelatedBlockLabel ? ` ${instanceUid}_block_label` : ''}`\n : undefined;\n\n const mainInputProps = {\n id: instanceUid,\n 'data-testid': 'ds-checkbox',\n 'aria-checked': checked, // if user doesn't provide aria-checked, we make this the same as the actual value\n 'aria-labelledby': outOfTheBoxAriaLabelledBy,\n // if the user provides an aria-labelledby we still do print it anyway, so this should work for both internal scenarios and final integrations\n // any props provided by the user will over-ride ours; while locked the consumer's activation handlers are dropped\n // inversion of control: a consumer-provided aria-readonly passes through in this spread (Dimsum never writes one itself)\n // the mixed-state div has no native change element (its change IS the click / keyboard activation); the native\n // checkbox has one, so its gate is the change\n ...omitLockedHandlers(restProps, locked, canShowMixedState ? 'activation' : 'change'),\n };\n\n if (visualOnly) return null;\n\n if (canShowMixedState)\n return (\n <StyledInputMixed\n {...mainInputProps}\n role=\"checkbox\"\n aria-controls={ariaControls || camelCaseAriaControls}\n // a locked mixed checkbox prints \"true\" whatever the consumer passes, otherwise the consumer's own value passes\n aria-disabled={resolveAriaDisabled({ softLocked: locked, consumerValue: restProps['aria-disabled'] })}\n $disabled={Boolean(disabled)}\n aria-invalid={hasError}\n onClick={locked ? undefined : handleOnChange}\n onKeyDown={handleMixedCheckboxOnKeyDown}\n tabIndex={disabled ? -1 : tabIndex}\n innerRef={innerRef}\n onMouseDown={(e: React.MouseEvent) => {\n if (disabled) e.preventDefault();\n }}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n return (\n <StyledInput\n {...mainInputProps}\n type=\"checkbox\"\n checked={checked as boolean | undefined}\n onChange={handleOnChange}\n onKeyDown={handleNativeCheckboxOnKeyDown}\n disabled={disabled}\n tabIndex={tabIndex}\n innerRef={innerRef}\n aria-invalid={hasError}\n // a soft lock prints \"true\" whatever the consumer passes, a natively disabled checkbox prints none of its own,\n // otherwise the consumer's own aria-disabled passes through (inversion of control)\n aria-disabled={resolveAriaDisabled({\n disabled: disabled,\n softLocked: applyAriaDisabled || readOnly,\n consumerValue: restProps['aria-disabled'],\n })}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACmEjB;AAlEN,OAAOA,YAAW;AAClB,SAAS,oBAAoB,eAAe,oBAAoB,UAAU,2B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,KAAK;AAAA,QAC1B;AAAA,QACA,aAAa,CAAC,MAAwB;AACpC,cAAI,SAAU,GAAE,eAAe;AAAA,QACjC;AAAA,QACA,oBAAkB,WAAW,GAAG,WAAW,0BAA0B;AAAA,QACrE;AAAA,QACA;AAAA;AAAA,IACF;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAc;AAAA,MAGd,iBAAe,oBAAoB;AAAA,QACjC;AAAA,QACA,YAAY,qBAAqB;AAAA,QACjC,eAAe,UAAU,eAAe;AAAA,MAC1C,CAAC;AAAA,MACD,oBAAkB,WAAW,GAAG,WAAW,0BAA0B;AAAA,MACrE;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React from 'react';\nimport {\n omitLockAttributes,\n useOwnerProps,\n omitLockedHandlers,\n isLocked,\n resolveAriaDisabled,\n} from '@elliemae/ds-props-helpers';\nimport { StyledInput, StyledInputMixed } from '../styles.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\n\nexport const MainInput = () => {\n const {\n propsWithDefault,\n globalProps,\n instanceUid,\n handleOnChange,\n handleMixedCheckboxOnKeyDown,\n handleNativeCheckboxOnKeyDown,\n } = React.useContext(ControlledCheckBoxContext);\n const {\n // label,\n tabIndex,\n innerRef,\n checked,\n visualOnly,\n ariaControls: camelCaseAriaControls,\n withRelatedBlockLabel,\n // ariaLabel: camelCaseAriaLabel,\n // externalLabel,\n hasError,\n applyAriaDisabled,\n } = propsWithDefault;\n // disabled is a global attribute: it is taken out of the spread here, so the mixed-state div never prints it\n // (the native input sets it explicitly below)\n const { disabled, readOnly } = globalProps;\n const restProps = omitLockAttributes(globalProps);\n const locked = isLocked({ disabled, applyAriaDisabled, readOnly });\n const { 'aria-controls': ariaControls } = restProps;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n // if components doesn't define 'aria-controls' it would be \"a11y invalid\" to allow 'mixed' state\n // so\n // if they are NOT provided we use <input type='checkbox' /> that has no 'mixed' state support in html5\n // if they ARE provided we use <input /> (no type checkbox) in which we super-charge the 'mixed' state via css\n // props slightly differ because of this\n // also, because of this, \"onChange\" may be an onClick (or keyboard activation) or the native \"onChange\"\n const canShowMixedState = ariaControls || camelCaseAriaControls;\n // if aria-label is provided we are probably printing a 'label-less' checkbox (like data-table, or mixed parent in a group)\n // in such scenarios having the aria-labelledby may results in 'referencing a non-existing element' error\n const outOfTheBoxAriaLabelledBy = !globalProps['aria-label']\n ? `${instanceUid}_label${withRelatedBlockLabel ? ` ${instanceUid}_block_label` : ''}`\n : undefined;\n\n const mainInputProps = {\n id: instanceUid,\n 'data-testid': 'ds-checkbox',\n 'aria-checked': checked, // if user doesn't provide aria-checked, we make this the same as the actual value\n 'aria-labelledby': outOfTheBoxAriaLabelledBy,\n // if the user provides an aria-labelledby we still do print it anyway, so this should work for both internal scenarios and final integrations\n // any props provided by the user will over-ride ours; while locked the consumer's activation handlers are dropped\n // inversion of control: a consumer-provided aria-readonly passes through in this spread (Dimsum never writes one itself)\n // the mixed-state div has no native change element (its change IS the click / keyboard activation); the native\n // checkbox has one, so its gate is the change\n ...omitLockedHandlers(restProps, locked, canShowMixedState ? 'activation' : 'change'),\n };\n\n if (visualOnly) return null;\n\n if (canShowMixedState)\n return (\n <StyledInputMixed\n {...mainInputProps}\n role=\"checkbox\"\n aria-controls={ariaControls || camelCaseAriaControls}\n // a locked mixed checkbox prints \"true\" whatever the consumer passes, otherwise the consumer's own value passes\n aria-disabled={resolveAriaDisabled({ softLocked: locked, consumerValue: restProps['aria-disabled'] })}\n $disabled={Boolean(disabled)}\n aria-invalid={hasError}\n onClick={locked ? undefined : handleOnChange}\n onKeyDown={handleMixedCheckboxOnKeyDown}\n tabIndex={disabled ? -1 : tabIndex}\n innerRef={innerRef}\n onMouseDown={(e: React.MouseEvent) => {\n if (disabled) e.preventDefault();\n }}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n return (\n <StyledInput\n {...mainInputProps}\n type=\"checkbox\"\n checked={checked as boolean | undefined}\n onChange={handleOnChange}\n onKeyDown={handleNativeCheckboxOnKeyDown}\n disabled={disabled}\n tabIndex={tabIndex}\n innerRef={innerRef}\n aria-invalid={hasError}\n // a soft lock prints \"true\" whatever the consumer passes, a natively disabled checkbox prints none of its own,\n // otherwise the consumer's own aria-disabled passes through (inversion of control)\n aria-disabled={resolveAriaDisabled({\n disabled,\n softLocked: applyAriaDisabled || readOnly,\n consumerValue: restProps['aria-disabled'],\n })}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACyEjB;AAxEN,OAAOA,YAAW;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,wBAAwB;AAC9C,SAAS,iCAAiC;AAEnC,MAAM,YAAY,MAAM;AAC7B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAIA,OAAM,WAAW,yBAAyB;AAC9C,QAAM;AAAA;AAAA,IAEJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,EACF,IAAI;AAGJ,QAAM,EAAE,UAAU,SAAS,IAAI;AAC/B,QAAM,YAAY,mBAAmB,WAAW;AAChD,QAAM,SAAS,SAAS,EAAE,UAAU,mBAAm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AA,MACD,oBAAkB,WAAW,GAAG,WAAW,0BAA0B;AAAA,MACrE;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": ["React"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-form-checkbox",
3
- "version": "3.80.0-next.77",
3
+ "version": "3.80.0-next.79",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Controlled Form Checkbox",
6
6
  "files": [
@@ -36,16 +36,16 @@
36
36
  "indent": 4
37
37
  },
38
38
  "dependencies": {
39
- "@elliemae/ds-floating-context": "3.80.0-next.77",
40
- "@elliemae/ds-props-helpers": "3.80.0-next.77",
41
- "@elliemae/ds-system": "3.80.0-next.77",
42
- "@elliemae/ds-typescript-helpers": "3.80.0-next.77",
43
- "@elliemae/ds-typography": "3.80.0-next.77",
39
+ "@elliemae/ds-floating-context": "3.80.0-next.79",
40
+ "@elliemae/ds-props-helpers": "3.80.0-next.79",
41
+ "@elliemae/ds-system": "3.80.0-next.79",
42
+ "@elliemae/ds-typescript-helpers": "3.80.0-next.79",
43
+ "@elliemae/ds-typography": "3.80.0-next.79",
44
44
  "uid": "^2.0.2"
45
45
  },
46
46
  "devDependencies": {
47
- "@elliemae/ds-monorepo-devops": "3.80.0-next.77",
48
- "@elliemae/ds-test-utils": "3.80.0-next.77",
47
+ "@elliemae/ds-monorepo-devops": "3.80.0-next.79",
48
+ "@elliemae/ds-test-utils": "3.80.0-next.79",
49
49
  "@elliemae/pui-theme": "~2.13.0",
50
50
  "@playwright/experimental-ct-react": "1.61.1",
51
51
  "jest": "^30.0.0",