@elliemae/ds-form-checkbox 3.70.0-next.34 → 3.70.0-next.35

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.
@@ -39,7 +39,7 @@ var import_ds_system = require("@elliemae/ds-system");
39
39
  var import_ds_typography = require("@elliemae/ds-typography");
40
40
  var import_ds_floating_context = require("@elliemae/ds-floating-context");
41
41
  var import_constants = require("./constants/index.js");
42
- const TruncatedSpan = (0, import_ds_system.styled)("span", {
42
+ const TruncatedSpan = (0, import_ds_system.styled)(import_ds_typography.DSTypography, {
43
43
  name: import_constants.DSCheckboxName,
44
44
  slot: import_constants.DSCheckboxSlots.TRUNCATED_LABEL
45
45
  })`
@@ -71,7 +71,12 @@ const StyledTooltipText = (0, import_ds_system.styled)(import_ds_typography.DSTy
71
71
  name: import_constants.DSCheckboxName,
72
72
  slot: import_constants.DSCheckboxSlots.TOOLTIP_TEXT
73
73
  })``;
74
- const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
74
+ const TruncatedTooltipText = ({
75
+ value = "",
76
+ placement = "top",
77
+ getOwnerProps,
78
+ getOwnerPropsArguments
79
+ }) => {
75
80
  const [showTooltip, setShowTooltip] = (0, import_react.useState)(false);
76
81
  const { refs, floatingStyles, arrowStyles, context } = (0, import_ds_floating_context.useFloatingContext)({
77
82
  placement,
@@ -86,7 +91,20 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
86
91
  setShowTooltip(false);
87
92
  }, []);
88
93
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
89
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TruncatedSpan, { innerRef: refs.setReference, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: value }),
94
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
+ TruncatedSpan,
96
+ {
97
+ component: "span",
98
+ variant: "b2",
99
+ "data-testid": import_constants.DSCheckboxDataTestIds.TRUNCATED_LABEL,
100
+ innerRef: refs.setReference,
101
+ onMouseEnter: handleMouseEnter,
102
+ onMouseLeave: handleMouseLeave,
103
+ getOwnerProps,
104
+ getOwnerPropsArguments,
105
+ children: value
106
+ }
107
+ ),
90
108
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
91
109
  import_ds_floating_context.FloatingWrapper,
92
110
  {
@@ -94,8 +112,17 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
94
112
  isOpen: showTooltip,
95
113
  floatingStyles,
96
114
  context,
97
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipContainer, { children: [
98
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledTooltipText, { component: "span", variant: "b2-light", children: value }),
115
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipContainer, { getOwnerProps, getOwnerPropsArguments, children: [
116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
117
+ StyledTooltipText,
118
+ {
119
+ component: "span",
120
+ variant: "b2-light",
121
+ getOwnerProps,
122
+ getOwnerPropsArguments,
123
+ children: value
124
+ }
125
+ ),
99
126
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_floating_context.PopoverArrow, { ...arrowStyles })
100
127
  ] })
101
128
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/TruncatedTooltipText.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\nimport { DSCheckboxName, DSCheckboxSlots } from './constants/index.js';\n\nconst TruncatedSpan = styled('span', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TRUNCATED_LABEL,\n})`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n// Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency\nconst TooltipContainer = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n overflow-wrap: break-word;\n word-break: break-word;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n pointer-events: none;\n`;\n\nconst StyledTooltipText = styled(DSTypography, {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TOOLTIP_TEXT,\n})``;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n}\n\nconst TruncatedTooltipText = ({ value = '', placement = 'top' }: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <>\n <TruncatedSpan innerRef={refs.setReference} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {value}\n </TruncatedSpan>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer>\n <StyledTooltipText component=\"span\" variant=\"b2-light\">\n {value}\n </StyledTooltipText>\n <PopoverArrow {...arrowStyles} />\n </TooltipContainer>\n </FloatingWrapper>\n </>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\n", "import * as React from 'react';\nexport { React };\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BAAkB,cAAc,kBACvF,iBACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QAEA,uDAAC,oBACC;AAAA,sDAAC,qBAAkB,WAAU,QAAO,SAAQ,YACzC,iBACH;AAAA,UACA,4CAAC,2CAAc,GAAG,aAAa;AAAA,WACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAGA,IAAO,+BAAQ;",
4
+ "sourcesContent": ["import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\nimport { DSCheckboxName, DSCheckboxSlots, DSCheckboxDataTestIds } from './constants/index.js';\n\nconst TruncatedSpan = styled(DSTypography, {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TRUNCATED_LABEL,\n})`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n// Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency\nconst TooltipContainer = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n overflow-wrap: break-word;\n word-break: break-word;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n pointer-events: none;\n`;\n\nconst StyledTooltipText = styled(DSTypography, {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TOOLTIP_TEXT,\n})``;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}\n\nconst TruncatedTooltipText = ({\n value = '',\n placement = 'top',\n getOwnerProps,\n getOwnerPropsArguments,\n}: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <>\n <TruncatedSpan\n component=\"span\"\n variant=\"b2\"\n data-testid={DSCheckboxDataTestIds.TRUNCATED_LABEL}\n innerRef={refs.setReference}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {value}\n </TruncatedSpan>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledTooltipText\n component=\"span\"\n variant=\"b2-light\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {value}\n </StyledTooltipText>\n <PopoverArrow {...arrowStyles} />\n </TooltipContainer>\n </FloatingWrapper>\n </>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8EnB;AA9EJ,mBAA6C;AAC7C,uBAAuB;AACvB,2BAA6B;AAC7B,iCAKO;AACP,uBAAuE;AAEvE,MAAM,oBAAgB,yBAAO,mCAAc;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,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ACA;AAAA,QAEA,uDAAC,oBAAiB,eAA8B,wBAC9C;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,SAAQ;AAAA,cACR;AAAA,cACA;AAAA,cAEC;AAAA;AAAA,UACH;AAAA,UACA,4CAAC,2CAAc,GAAG,aAAa;AAAA,WACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAGA,IAAO,+BAAQ;",
6
6
  "names": []
7
7
  }
@@ -39,6 +39,7 @@ var import_TruncatedTooltipText = require("../TruncatedTooltipText.js");
39
39
  var import_styles = require("../styles.js");
40
40
  var import_MainInput = require("./MainInput.js");
41
41
  var import_ControlledCheckboxCTX = require("../ControlledCheckboxCTX.js");
42
+ var import_constants = require("../constants/index.js");
42
43
  const ControlledCheckBoxContent = () => {
43
44
  const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } = import_react.default.useContext(import_ControlledCheckboxCTX.ControlledCheckBoxContext);
44
45
  const {
@@ -107,19 +108,31 @@ const ControlledCheckBoxContent = () => {
107
108
  ...!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleLabelClick } : {},
108
109
  getOwnerProps,
109
110
  getOwnerPropsArguments,
110
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
111
+ children: wrapLabel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
111
112
  import_styles.StyledLabelTypography,
112
113
  {
113
114
  component: "span",
114
115
  variant: "b2",
115
116
  getOwnerProps,
116
117
  getOwnerPropsArguments,
117
- children: wrapLabel ? label : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TruncatedTooltipText.TruncatedTooltipText, { value: label })
118
+ children: label
119
+ }
120
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
121
+ import_TruncatedTooltipText.TruncatedTooltipText,
122
+ {
123
+ value: label,
124
+ getOwnerProps,
125
+ getOwnerPropsArguments
118
126
  }
119
127
  )
120
128
  }
121
129
  ),
122
- readOnly ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledHiddenP, { id: `${instanceUid}-read-only-helper-msg`, children: "Read only" }) : null
130
+ readOnly ? (
131
+ // READ_ONLY_HELPER is a display:none, SR-only helper — intentionally NOT a getOwnerProps
132
+ // injection point (no consumer use case). The slot/data-testid exist only for naming +
133
+ // QA targeting consistency. Tracked in KNOWN_INTENTIONAL_DEVIATIONS.md.
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledHiddenP, { id: `${instanceUid}-read-only-helper-msg`, "data-testid": import_constants.DSCheckboxDataTestIds.READ_ONLY_HELPER, children: "Read only" })
135
+ ) : null
123
136
  ]
124
137
  }
125
138
  );
@@ -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 { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { TruncatedTooltipText } from '../TruncatedTooltipText.js';\nimport { StyledContainer, StyledLabelTypography, StyledLabel, StyledCheckBox, StyledHiddenP } 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 {\n checked,\n device,\n label,\n hasError,\n wrapLabel,\n ariaControls: legacyAriaControls,\n applyAriaDisabled,\n } = propsWithDefault;\n const { disabled, readOnly, 'aria-controls': ariaControls, className } = globalProps;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n const { ariaControls: camelCaseAriaControls } = propsWithDefault;\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\n const handleLabelClick = React.useCallback(\n (\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLabelElement>\n | React.MouseEvent<HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>,\n ) => {\n handleOnChange(e);\n // if we are in a mixed state, we want to focus the input when the label is clicked\n // this is because the auto-focus work only on the input itself, not a div with role=checkbox\n // so we need to manually focus the input: https://jira.elliemae.io/browse/PUI-15422\n if (canShowMixedState) {\n const input = document.getElementById(instanceUid);\n if (input) {\n input.focus();\n }\n }\n },\n [canShowMixedState, handleOnChange, instanceUid],\n );\n\n return (\n <StyledContainer\n wrapLabel={wrapLabel}\n device={device}\n data-testid=\"ds-checkbox-container\"\n className={className}\n hasLabel={Boolean(label)}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledCheckBox\n device={device}\n checked={checked}\n hasError={hasError}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <MainInput />\n </StyledCheckBox>\n {label && (\n <StyledLabel\n id={`${instanceUid}_label`}\n htmlFor={instanceUid}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-checkbox-label\"\n wrapLabel={wrapLabel}\n device={device}\n {...(!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleLabelClick } : {})}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledLabelTypography\n component=\"span\"\n variant=\"b2\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {wrapLabel ? label : <TruncatedTooltipText value={label} />}\n </StyledLabelTypography>\n </StyledLabel>\n )}\n {readOnly ? <StyledHiddenP id={`${instanceUid}-read-only-helper-msg`}>Read only</StyledHiddenP> : null}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuDnB;AAvDJ,mBAAkB;AAClB,8BAA8B;AAC9B,kCAAqC;AACrC,oBAAmG;AACnG,uBAA0B;AAC1B,mCAA0C;AAEnC,MAAM,4BAA4B,MAAM;AAC7C,QAAM,EAAE,kBAAkB,aAAa,aAAa,cAAc,eAAe,IAC/E,aAAAA,QAAM,WAAW,sDAAyB;AAC5C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,UAAU,UAAU,iBAAiB,cAAc,UAAU,IAAI;AAEzE,QAAM,EAAE,eAAe,uBAAuB,QAAI,uCAAc,gBAAgB;AAEhF,QAAM,EAAE,cAAc,sBAAsB,IAAI;AAOhD,QAAM,oBAAoB,gBAAgB;AAE1C,QAAM,mBAAmB,aAAAA,QAAM;AAAA,IAC7B,CACE,MAKG;AACH,qBAAe,CAAC;AAIhB,UAAI,mBAAmB;AACrB,cAAM,QAAQ,SAAS,eAAe,WAAW;AACjD,YAAI,OAAO;AACT,gBAAM,MAAM;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,gBAAgB,WAAW;AAAA,EACjD;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,eAAY;AAAA,MACZ;AAAA,MACA,UAAU,QAAQ,KAAK;AAAA,MACtB,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YAEA,sDAAC,8BAAU;AAAA;AAAA,QACb;AAAA,QACC,SACC;AAAA,UAAC;AAAA;AAAA,YACC,IAAI,GAAG,WAAW;AAAA,YAClB,SAAS;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACC,GAAI,CAAC,aAAa,gBAAgB,sBAAsB,EAAE,SAAS,iBAAiB,IAAI,CAAC;AAAA,YAC1F;AAAA,YACA;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBACV,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBAEC,sBAAY,QAAQ,4CAAC,oDAAqB,OAAO,OAAO;AAAA;AAAA,YAC3D;AAAA;AAAA,QACF;AAAA,QAED,WAAW,4CAAC,+BAAc,IAAI,GAAG,WAAW,yBAAyB,uBAAS,IAAmB;AAAA;AAAA;AAAA,EACpG;AAEJ;",
4
+ "sourcesContent": ["import React from 'react';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { TruncatedTooltipText } from '../TruncatedTooltipText.js';\nimport { StyledContainer, StyledLabelTypography, StyledLabel, StyledCheckBox, StyledHiddenP } from '../styles.js';\nimport { MainInput } from './MainInput.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\nimport { DSCheckboxDataTestIds } from '../constants/index.js';\n\nexport const ControlledCheckBoxContent = () => {\n const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } =\n React.useContext(ControlledCheckBoxContext);\n const {\n checked,\n device,\n label,\n hasError,\n wrapLabel,\n ariaControls: legacyAriaControls,\n applyAriaDisabled,\n } = propsWithDefault;\n const { disabled, readOnly, 'aria-controls': ariaControls, className } = globalProps;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n const { ariaControls: camelCaseAriaControls } = propsWithDefault;\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\n const handleLabelClick = React.useCallback(\n (\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLabelElement>\n | React.MouseEvent<HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>,\n ) => {\n handleOnChange(e);\n // if we are in a mixed state, we want to focus the input when the label is clicked\n // this is because the auto-focus work only on the input itself, not a div with role=checkbox\n // so we need to manually focus the input: https://jira.elliemae.io/browse/PUI-15422\n if (canShowMixedState) {\n const input = document.getElementById(instanceUid);\n if (input) {\n input.focus();\n }\n }\n },\n [canShowMixedState, handleOnChange, instanceUid],\n );\n\n return (\n <StyledContainer\n wrapLabel={wrapLabel}\n device={device}\n data-testid=\"ds-checkbox-container\"\n className={className}\n hasLabel={Boolean(label)}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledCheckBox\n device={device}\n checked={checked}\n hasError={hasError}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <MainInput />\n </StyledCheckBox>\n {label && (\n <StyledLabel\n id={`${instanceUid}_label`}\n htmlFor={instanceUid}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-checkbox-label\"\n wrapLabel={wrapLabel}\n device={device}\n {...(!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleLabelClick } : {})}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {wrapLabel ? (\n <StyledLabelTypography\n component=\"span\"\n variant=\"b2\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledLabelTypography>\n ) : (\n <TruncatedTooltipText\n value={label}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n )}\n </StyledLabel>\n )}\n {readOnly ? (\n // READ_ONLY_HELPER is a display:none, SR-only helper \u2014 intentionally NOT a getOwnerProps\n // injection point (no consumer use case). The slot/data-testid exist only for naming +\n // QA targeting consistency. Tracked in KNOWN_INTENTIONAL_DEVIATIONS.md.\n <StyledHiddenP id={`${instanceUid}-read-only-helper-msg`} data-testid={DSCheckboxDataTestIds.READ_ONLY_HELPER}>\n Read only\n </StyledHiddenP>\n ) : null}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwDnB;AAxDJ,mBAAkB;AAClB,8BAA8B;AAC9B,kCAAqC;AACrC,oBAAmG;AACnG,uBAA0B;AAC1B,mCAA0C;AAC1C,uBAAsC;AAE/B,MAAM,4BAA4B,MAAM;AAC7C,QAAM,EAAE,kBAAkB,aAAa,aAAa,cAAc,eAAe,IAC/E,aAAAA,QAAM,WAAW,sDAAyB;AAC5C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,UAAU,UAAU,iBAAiB,cAAc,UAAU,IAAI;AAEzE,QAAM,EAAE,eAAe,uBAAuB,QAAI,uCAAc,gBAAgB;AAEhF,QAAM,EAAE,cAAc,sBAAsB,IAAI;AAOhD,QAAM,oBAAoB,gBAAgB;AAE1C,QAAM,mBAAmB,aAAAA,QAAM;AAAA,IAC7B,CACE,MAKG;AACH,qBAAe,CAAC;AAIh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defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ const SlotPropsAsObject = {
26
+ dsCheckboxRoot: { "aria-label": "just a typescript test" },
27
+ dsCheckboxInputWrapper: { "aria-label": "just a typescript test" },
28
+ dsCheckboxInput: { "aria-label": "just a typescript test" },
29
+ dsCheckboxLabel: { "aria-label": "just a typescript test" },
30
+ dsCheckboxLabelTypography: { "aria-label": "just a typescript test" },
31
+ dsCheckboxReadOnlyHelper: { "aria-label": "just a typescript test" },
32
+ dsCheckboxTruncatedLabel: { "aria-label": "just a typescript test" },
33
+ dsCheckboxTooltipContainer: { "aria-label": "just a typescript test" },
34
+ dsCheckboxTooltipText: { "aria-label": "just a typescript test" }
35
+ };
36
+ const SlotPropsAsFunctions = {
37
+ dsCheckboxRoot: () => ({ "aria-label": "just a typescript test" }),
38
+ dsCheckboxInputWrapper: () => ({ "aria-label": "just a typescript test" }),
39
+ dsCheckboxInput: () => ({ "aria-label": "just a typescript test" }),
40
+ dsCheckboxLabel: () => ({ "aria-label": "just a typescript test" }),
41
+ dsCheckboxLabelTypography: () => ({ "aria-label": "just a typescript test" }),
42
+ dsCheckboxReadOnlyHelper: () => ({ "aria-label": "just a typescript test" }),
43
+ dsCheckboxTruncatedLabel: () => ({ "aria-label": "just a typescript test" }),
44
+ dsCheckboxTooltipContainer: () => ({ "aria-label": "just a typescript test" }),
45
+ dsCheckboxTooltipText: () => ({ "aria-label": "just a typescript test" })
46
+ };
47
+ const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
48
+ //# sourceMappingURL=slot-props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSControlledCheckboxT } from '../index.js';\nimport type { DSCheckboxName, DSCheckboxSlots } from '../constants/index.js';\n\n// Exhaustiveness contract over DSCheckboxSlots \u2014 every slot must appear in SlotFunctionArguments.\n// NOTE: dsCheckboxReadOnlyHelper is listed here for TYPE exhaustiveness only; at runtime that slot\n// is intentionally NOT a functional getOwnerProps injection point (display:none SR-only helper) \u2014\n// see KNOWN_INTENTIONAL_DEVIATIONS.md.\n//\n// Slot props can be passed in two forms \u2014 object (static) and function (dynamic).\nconst SlotPropsAsObject: Partial<DSControlledCheckboxT.Props> = {\n dsCheckboxRoot: { 'aria-label': 'just a typescript test' },\n dsCheckboxInputWrapper: { 'aria-label': 'just a typescript test' },\n dsCheckboxInput: { 'aria-label': 'just a typescript test' },\n dsCheckboxLabel: { 'aria-label': 'just a typescript test' },\n dsCheckboxLabelTypography: { 'aria-label': 'just a typescript test' },\n dsCheckboxReadOnlyHelper: { 'aria-label': 'just a typescript test' },\n dsCheckboxTruncatedLabel: { 'aria-label': 'just a typescript test' },\n dsCheckboxTooltipContainer: { 'aria-label': 'just a typescript test' },\n dsCheckboxTooltipText: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSControlledCheckboxT.SlotFunctionArguments = {\n dsCheckboxRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxInputWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxInput: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxLabelTypography: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxReadOnlyHelper: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxTruncatedLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxTooltipContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxTooltipText: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot is missing from SlotFunctionArguments.\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSCheckboxName, typeof DSCheckboxSlots>\n> = SlotPropsAsFunctions;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACWvB,MAAM,oBAA0D;AAAA,EAC9D,gBAAgB,EAAE,cAAc,yBAAyB;AAAA,EACzD,wBAAwB,EAAE,cAAc,yBAAyB;AAAA,EACjE,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,2BAA2B,EAAE,cAAc,yBAAyB;AAAA,EACpE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,4BAA4B,EAAE,cAAc,yBAAyB;AAAA,EACrE,uBAAuB,EAAE,cAAc,yBAAyB;AAClE;AAEA,MAAM,uBAAoE;AAAA,EACxE,gBAAgB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAChE,wBAAwB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACxE,iBAAiB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjE,iBAAiB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjE,2BAA2B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC3E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,4BAA4B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC5E,uBAAuB,OAAO,EAAE,cAAc,yBAAyB;AACzE;AAGA,MAAM,6CAEF;",
6
+ "names": []
7
+ }
@@ -8,8 +8,8 @@ import {
8
8
  FloatingWrapper,
9
9
  PopoverArrow
10
10
  } from "@elliemae/ds-floating-context";
11
- import { DSCheckboxName, DSCheckboxSlots } from "./constants/index.js";
12
- const TruncatedSpan = styled("span", {
11
+ import { DSCheckboxName, DSCheckboxSlots, DSCheckboxDataTestIds } from "./constants/index.js";
12
+ const TruncatedSpan = styled(DSTypography, {
13
13
  name: DSCheckboxName,
14
14
  slot: DSCheckboxSlots.TRUNCATED_LABEL
15
15
  })`
@@ -41,7 +41,12 @@ const StyledTooltipText = styled(DSTypography, {
41
41
  name: DSCheckboxName,
42
42
  slot: DSCheckboxSlots.TOOLTIP_TEXT
43
43
  })``;
44
- const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
44
+ const TruncatedTooltipText = ({
45
+ value = "",
46
+ placement = "top",
47
+ getOwnerProps,
48
+ getOwnerPropsArguments
49
+ }) => {
45
50
  const [showTooltip, setShowTooltip] = useState(false);
46
51
  const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({
47
52
  placement,
@@ -56,7 +61,20 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
56
61
  setShowTooltip(false);
57
62
  }, []);
58
63
  return /* @__PURE__ */ jsxs(Fragment, { children: [
59
- /* @__PURE__ */ jsx(TruncatedSpan, { innerRef: refs.setReference, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: value }),
64
+ /* @__PURE__ */ jsx(
65
+ TruncatedSpan,
66
+ {
67
+ component: "span",
68
+ variant: "b2",
69
+ "data-testid": DSCheckboxDataTestIds.TRUNCATED_LABEL,
70
+ innerRef: refs.setReference,
71
+ onMouseEnter: handleMouseEnter,
72
+ onMouseLeave: handleMouseLeave,
73
+ getOwnerProps,
74
+ getOwnerPropsArguments,
75
+ children: value
76
+ }
77
+ ),
60
78
  /* @__PURE__ */ jsx(
61
79
  FloatingWrapper,
62
80
  {
@@ -64,8 +82,17 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
64
82
  isOpen: showTooltip,
65
83
  floatingStyles,
66
84
  context,
67
- children: /* @__PURE__ */ jsxs(TooltipContainer, { children: [
68
- /* @__PURE__ */ jsx(StyledTooltipText, { component: "span", variant: "b2-light", children: value }),
85
+ children: /* @__PURE__ */ jsxs(TooltipContainer, { getOwnerProps, getOwnerPropsArguments, children: [
86
+ /* @__PURE__ */ jsx(
87
+ StyledTooltipText,
88
+ {
89
+ component: "span",
90
+ variant: "b2-light",
91
+ getOwnerProps,
92
+ getOwnerPropsArguments,
93
+ children: value
94
+ }
95
+ ),
69
96
  /* @__PURE__ */ jsx(PopoverArrow, { ...arrowStyles })
70
97
  ] })
71
98
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/TruncatedTooltipText.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\nimport { DSCheckboxName, DSCheckboxSlots } from './constants/index.js';\n\nconst TruncatedSpan = styled('span', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TRUNCATED_LABEL,\n})`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n// Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency\nconst TooltipContainer = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n overflow-wrap: break-word;\n word-break: break-word;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n pointer-events: none;\n`;\n\nconst StyledTooltipText = styled(DSTypography, {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TOOLTIP_TEXT,\n})``;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n}\n\nconst TruncatedTooltipText = ({ value = '', placement = 'top' }: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <>\n <TruncatedSpan innerRef={refs.setReference} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {value}\n </TruncatedSpan>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer>\n <StyledTooltipText component=\"span\" variant=\"b2-light\">\n {value}\n </StyledTooltipText>\n <PopoverArrow {...arrowStyles} />\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,KAAK;AAAA,EACtB,GAAG,CAAC,CAAC;AAEL,SACE,iCACE;AAAA,wBAAC,iBAAc,UAAU,KAAK,cAAc,cAAc,kBAAkB,cAAc,kBACvF,iBACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QAEA,+BAAC,oBACC;AAAA,8BAAC,qBAAkB,WAAU,QAAO,SAAQ,YACzC,iBACH;AAAA,UACA,oBAAC,gBAAc,GAAG,aAAa;AAAA,WACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAGA,IAAO,+BAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\nimport { DSCheckboxName, DSCheckboxSlots, DSCheckboxDataTestIds } from './constants/index.js';\n\nconst TruncatedSpan = styled(DSTypography, {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TRUNCATED_LABEL,\n})`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n// Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency\nconst TooltipContainer = styled('div', {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n overflow-wrap: break-word;\n word-break: break-word;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n pointer-events: none;\n`;\n\nconst StyledTooltipText = styled(DSTypography, {\n name: DSCheckboxName,\n slot: DSCheckboxSlots.TOOLTIP_TEXT,\n})``;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}\n\nconst TruncatedTooltipText = ({\n value = '',\n placement = 'top',\n getOwnerProps,\n getOwnerPropsArguments,\n}: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <>\n <TruncatedSpan\n component=\"span\"\n variant=\"b2\"\n data-testid={DSCheckboxDataTestIds.TRUNCATED_LABEL}\n innerRef={refs.setReference}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {value}\n </TruncatedSpan>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledTooltipText\n component=\"span\"\n variant=\"b2-light\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {value}\n </StyledTooltipText>\n <PopoverArrow {...arrowStyles} />\n </TooltipContainer>\n </FloatingWrapper>\n </>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC8EnB,mBACE,KAkBE,YAnBJ;AA9EJ,SAAgB,aAAa,gBAAgB;AAC7C,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA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d;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QAEA,+BAAC,oBAAiB,eAA8B,wBAC9C;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,SAAQ;AAAA,cACR;AAAA,cACA;AAAA,cAEC;AAAA;AAAA,UACH;AAAA,UACA,oBAAC,gBAAc,GAAG,aAAa;AAAA,WACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAGA,IAAO,+BAAQ;",
6
6
  "names": []
7
7
  }
@@ -6,6 +6,7 @@ import { TruncatedTooltipText } from "../TruncatedTooltipText.js";
6
6
  import { StyledContainer, StyledLabelTypography, StyledLabel, StyledCheckBox, StyledHiddenP } from "../styles.js";
7
7
  import { MainInput } from "./MainInput.js";
8
8
  import { ControlledCheckBoxContext } from "../ControlledCheckboxCTX.js";
9
+ import { DSCheckboxDataTestIds } from "../constants/index.js";
9
10
  const ControlledCheckBoxContent = () => {
10
11
  const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } = React2.useContext(ControlledCheckBoxContext);
11
12
  const {
@@ -74,19 +75,31 @@ const ControlledCheckBoxContent = () => {
74
75
  ...!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleLabelClick } : {},
75
76
  getOwnerProps,
76
77
  getOwnerPropsArguments,
77
- children: /* @__PURE__ */ jsx(
78
+ children: wrapLabel ? /* @__PURE__ */ jsx(
78
79
  StyledLabelTypography,
79
80
  {
80
81
  component: "span",
81
82
  variant: "b2",
82
83
  getOwnerProps,
83
84
  getOwnerPropsArguments,
84
- children: wrapLabel ? label : /* @__PURE__ */ jsx(TruncatedTooltipText, { value: label })
85
+ children: label
86
+ }
87
+ ) : /* @__PURE__ */ jsx(
88
+ TruncatedTooltipText,
89
+ {
90
+ value: label,
91
+ getOwnerProps,
92
+ getOwnerPropsArguments
85
93
  }
86
94
  )
87
95
  }
88
96
  ),
89
- readOnly ? /* @__PURE__ */ jsx(StyledHiddenP, { id: `${instanceUid}-read-only-helper-msg`, children: "Read only" }) : null
97
+ readOnly ? (
98
+ // READ_ONLY_HELPER is a display:none, SR-only helper — intentionally NOT a getOwnerProps
99
+ // injection point (no consumer use case). The slot/data-testid exist only for naming +
100
+ // QA targeting consistency. Tracked in KNOWN_INTENTIONAL_DEVIATIONS.md.
101
+ /* @__PURE__ */ jsx(StyledHiddenP, { id: `${instanceUid}-read-only-helper-msg`, "data-testid": DSCheckboxDataTestIds.READ_ONLY_HELPER, children: "Read only" })
102
+ ) : null
90
103
  ]
91
104
  }
92
105
  );
@@ -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 { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { TruncatedTooltipText } from '../TruncatedTooltipText.js';\nimport { StyledContainer, StyledLabelTypography, StyledLabel, StyledCheckBox, StyledHiddenP } 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 {\n checked,\n device,\n label,\n hasError,\n wrapLabel,\n ariaControls: legacyAriaControls,\n applyAriaDisabled,\n } = propsWithDefault;\n const { disabled, readOnly, 'aria-controls': ariaControls, className } = globalProps;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n const { ariaControls: camelCaseAriaControls } = propsWithDefault;\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\n const handleLabelClick = React.useCallback(\n (\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLabelElement>\n | React.MouseEvent<HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>,\n ) => {\n handleOnChange(e);\n // if we are in a mixed state, we want to focus the input when the label is clicked\n // this is because the auto-focus work only on the input itself, not a div with role=checkbox\n // so we need to manually focus the input: https://jira.elliemae.io/browse/PUI-15422\n if (canShowMixedState) {\n const input = document.getElementById(instanceUid);\n if (input) {\n input.focus();\n }\n }\n },\n [canShowMixedState, handleOnChange, instanceUid],\n );\n\n return (\n <StyledContainer\n wrapLabel={wrapLabel}\n device={device}\n data-testid=\"ds-checkbox-container\"\n className={className}\n hasLabel={Boolean(label)}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledCheckBox\n device={device}\n checked={checked}\n hasError={hasError}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <MainInput />\n </StyledCheckBox>\n {label && (\n <StyledLabel\n id={`${instanceUid}_label`}\n htmlFor={instanceUid}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-checkbox-label\"\n wrapLabel={wrapLabel}\n device={device}\n {...(!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleLabelClick } : {})}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledLabelTypography\n component=\"span\"\n variant=\"b2\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {wrapLabel ? label : <TruncatedTooltipText value={label} />}\n </StyledLabelTypography>\n </StyledLabel>\n )}\n {readOnly ? <StyledHiddenP id={`${instanceUid}-read-only-helper-msg`}>Read only</StyledHiddenP> : null}\n </StyledContainer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACuDnB,SAoBI,KApBJ;AAvDJ,OAAOA,YAAW;AAClB,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AACrC,SAAS,iBAAiB,uBAAuB,aAAa,gBAAgB,qBAAqB;AACnG,SAAS,iBAAiB;AAC1B,SAAS,iCAAiC;AAEnC,MAAM,4BAA4B,MAAM;AAC7C,QAAM,EAAE,kBAAkB,aAAa,aAAa,cAAc,eAAe,IAC/EA,OAAM,WAAW,yBAAyB;AAC5C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,UAAU,UAAU,iBAAiB,cAAc,UAAU,IAAI;AAEzE,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,gBAAgB;AAEhF,QAAM,EAAE,cAAc,sBAAsB,IAAI;AAOhD,QAAM,oBAAoB,gBAAgB;AAE1C,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,CACE,MAKG;AACH,qBAAe,CAAC;AAIhB,UAAI,mBAAmB;AACrB,cAAM,QAAQ,SAAS,eAAe,WAAW;AACjD,YAAI,OAAO;AACT,gBAAM,MAAM;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,gBAAgB,WAAW;AAAA,EACjD;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,eAAY;AAAA,MACZ;AAAA,MACA,UAAU,QAAQ,KAAK;AAAA,MACtB,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YAEA,8BAAC,aAAU;AAAA;AAAA,QACb;AAAA,QACC,SACC;AAAA,UAAC;AAAA;AAAA,YACC,IAAI,GAAG,WAAW;AAAA,YAClB,SAAS;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACC,GAAI,CAAC,aAAa,gBAAgB,sBAAsB,EAAE,SAAS,iBAAiB,IAAI,CAAC;AAAA,YAC1F;AAAA,YACA;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBACV,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBAEC,sBAAY,QAAQ,oBAAC,wBAAqB,OAAO,OAAO;AAAA;AAAA,YAC3D;AAAA;AAAA,QACF;AAAA,QAED,WAAW,oBAAC,iBAAc,IAAI,GAAG,WAAW,yBAAyB,uBAAS,IAAmB;AAAA;AAAA;AAAA,EACpG;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { TruncatedTooltipText } from '../TruncatedTooltipText.js';\nimport { StyledContainer, StyledLabelTypography, StyledLabel, StyledCheckBox, StyledHiddenP } from '../styles.js';\nimport { MainInput } from './MainInput.js';\nimport { ControlledCheckBoxContext } from '../ControlledCheckboxCTX.js';\nimport { DSCheckboxDataTestIds } from '../constants/index.js';\n\nexport const ControlledCheckBoxContent = () => {\n const { propsWithDefault, globalProps, instanceUid, xstyledProps, handleOnChange } =\n React.useContext(ControlledCheckBoxContext);\n const {\n checked,\n device,\n label,\n hasError,\n wrapLabel,\n ariaControls: legacyAriaControls,\n applyAriaDisabled,\n } = propsWithDefault;\n const { disabled, readOnly, 'aria-controls': ariaControls, className } = globalProps;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n const { ariaControls: camelCaseAriaControls } = propsWithDefault;\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\n const handleLabelClick = React.useCallback(\n (\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLabelElement>\n | React.MouseEvent<HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>,\n ) => {\n handleOnChange(e);\n // if we are in a mixed state, we want to focus the input when the label is clicked\n // this is because the auto-focus work only on the input itself, not a div with role=checkbox\n // so we need to manually focus the input: https://jira.elliemae.io/browse/PUI-15422\n if (canShowMixedState) {\n const input = document.getElementById(instanceUid);\n if (input) {\n input.focus();\n }\n }\n },\n [canShowMixedState, handleOnChange, instanceUid],\n );\n\n return (\n <StyledContainer\n wrapLabel={wrapLabel}\n device={device}\n data-testid=\"ds-checkbox-container\"\n className={className}\n hasLabel={Boolean(label)}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledCheckBox\n device={device}\n checked={checked}\n hasError={hasError}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <MainInput />\n </StyledCheckBox>\n {label && (\n <StyledLabel\n id={`${instanceUid}_label`}\n htmlFor={instanceUid}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-checkbox-label\"\n wrapLabel={wrapLabel}\n device={device}\n {...(!disabled && (ariaControls || legacyAriaControls) ? { onClick: handleLabelClick } : {})}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {wrapLabel ? (\n <StyledLabelTypography\n component=\"span\"\n variant=\"b2\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledLabelTypography>\n ) : (\n <TruncatedTooltipText\n value={label}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n )}\n </StyledLabel>\n )}\n {readOnly ? (\n // READ_ONLY_HELPER is a display:none, SR-only helper \u2014 intentionally NOT a getOwnerProps\n // injection point (no consumer use case). The slot/data-testid exist only for naming +\n // QA targeting consistency. Tracked in KNOWN_INTENTIONAL_DEVIATIONS.md.\n <StyledHiddenP id={`${instanceUid}-read-only-helper-msg`} data-testid={DSCheckboxDataTestIds.READ_ONLY_HELPER}>\n Read only\n </StyledHiddenP>\n ) : null}\n </StyledContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACwDnB,SAoBI,KApBJ;AAxDJ,OAAOA,YAAW;AAClB,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AACrC,SAAS,iBAAiB,uBAAuB,aAAa,gBAAgB,qBAAqB;AACnG,SAAS,iBAAiB;AAC1B,SAAS,iCAAiC;AAC1C,SAAS,6BAA6B;AAE/B,MAAM,4BAA4B,MAAM;AAC7C,QAAM,EAAE,kBAAkB,aAAa,aAAa,cAAc,eAAe,IAC/EA,OAAM,WAAW,yBAAyB;AAC5C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,UAAU,UAAU,iBAAiB,cAAc,UAAU,IAAI;AAEzE,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,gBAAgB;AAEhF,QAAM,EAAE,cAAc,sBAAsB,IAAI;AAOhD,QAAM,oBAAoB,gBAAgB;AAE1C,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,CACE,M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+ const SlotPropsAsObject = {
3
+ dsCheckboxRoot: { "aria-label": "just a typescript test" },
4
+ dsCheckboxInputWrapper: { "aria-label": "just a typescript test" },
5
+ dsCheckboxInput: { "aria-label": "just a typescript test" },
6
+ dsCheckboxLabel: { "aria-label": "just a typescript test" },
7
+ dsCheckboxLabelTypography: { "aria-label": "just a typescript test" },
8
+ dsCheckboxReadOnlyHelper: { "aria-label": "just a typescript test" },
9
+ dsCheckboxTruncatedLabel: { "aria-label": "just a typescript test" },
10
+ dsCheckboxTooltipContainer: { "aria-label": "just a typescript test" },
11
+ dsCheckboxTooltipText: { "aria-label": "just a typescript test" }
12
+ };
13
+ const SlotPropsAsFunctions = {
14
+ dsCheckboxRoot: () => ({ "aria-label": "just a typescript test" }),
15
+ dsCheckboxInputWrapper: () => ({ "aria-label": "just a typescript test" }),
16
+ dsCheckboxInput: () => ({ "aria-label": "just a typescript test" }),
17
+ dsCheckboxLabel: () => ({ "aria-label": "just a typescript test" }),
18
+ dsCheckboxLabelTypography: () => ({ "aria-label": "just a typescript test" }),
19
+ dsCheckboxReadOnlyHelper: () => ({ "aria-label": "just a typescript test" }),
20
+ dsCheckboxTruncatedLabel: () => ({ "aria-label": "just a typescript test" }),
21
+ dsCheckboxTooltipContainer: () => ({ "aria-label": "just a typescript test" }),
22
+ dsCheckboxTooltipText: () => ({ "aria-label": "just a typescript test" })
23
+ };
24
+ const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
25
+ //# sourceMappingURL=slot-props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSControlledCheckboxT } from '../index.js';\nimport type { DSCheckboxName, DSCheckboxSlots } from '../constants/index.js';\n\n// Exhaustiveness contract over DSCheckboxSlots \u2014 every slot must appear in SlotFunctionArguments.\n// NOTE: dsCheckboxReadOnlyHelper is listed here for TYPE exhaustiveness only; at runtime that slot\n// is intentionally NOT a functional getOwnerProps injection point (display:none SR-only helper) \u2014\n// see KNOWN_INTENTIONAL_DEVIATIONS.md.\n//\n// Slot props can be passed in two forms \u2014 object (static) and function (dynamic).\nconst SlotPropsAsObject: Partial<DSControlledCheckboxT.Props> = {\n dsCheckboxRoot: { 'aria-label': 'just a typescript test' },\n dsCheckboxInputWrapper: { 'aria-label': 'just a typescript test' },\n dsCheckboxInput: { 'aria-label': 'just a typescript test' },\n dsCheckboxLabel: { 'aria-label': 'just a typescript test' },\n dsCheckboxLabelTypography: { 'aria-label': 'just a typescript test' },\n dsCheckboxReadOnlyHelper: { 'aria-label': 'just a typescript test' },\n dsCheckboxTruncatedLabel: { 'aria-label': 'just a typescript test' },\n dsCheckboxTooltipContainer: { 'aria-label': 'just a typescript test' },\n dsCheckboxTooltipText: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSControlledCheckboxT.SlotFunctionArguments = {\n dsCheckboxRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxInputWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxInput: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxLabelTypography: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxReadOnlyHelper: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxTruncatedLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxTooltipContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsCheckboxTooltipText: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot is missing from SlotFunctionArguments.\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSCheckboxName, typeof DSCheckboxSlots>\n> = SlotPropsAsFunctions;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACWvB,MAAM,oBAA0D;AAAA,EAC9D,gBAAgB,EAAE,cAAc,yBAAyB;AAAA,EACzD,wBAAwB,EAAE,cAAc,yBAAyB;AAAA,EACjE,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,2BAA2B,EAAE,cAAc,yBAAyB;AAAA,EACpE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,4BAA4B,EAAE,cAAc,yBAAyB;AAAA,EACrE,uBAAuB,EAAE,cAAc,yBAAyB;AAClE;AAEA,MAAM,uBAAoE;AAAA,EACxE,gBAAgB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAChE,wBAAwB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACxE,iBAAiB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjE,iBAAiB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjE,2BAA2B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC3E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,4BAA4B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC5E,uBAAuB,OAAO,EAAE,cAAc,yBAAyB;AACzE;AAGA,MAAM,6CAEF;",
6
+ "names": []
7
+ }
@@ -2,7 +2,9 @@ import { type DSHookFloatingContextT } from '@elliemae/ds-floating-context';
2
2
  interface TruncatedTooltipTextProps {
3
3
  value?: string;
4
4
  placement?: DSHookFloatingContextT.PopperPlacementsT;
5
+ getOwnerProps?: () => object;
6
+ getOwnerPropsArguments?: () => object;
5
7
  }
6
- declare const TruncatedTooltipText: ({ value, placement }: TruncatedTooltipTextProps) => import("react/jsx-runtime.js").JSX.Element;
8
+ declare const TruncatedTooltipText: ({ value, placement, getOwnerProps, getOwnerPropsArguments, }: TruncatedTooltipTextProps) => import("react/jsx-runtime.js").JSX.Element;
7
9
  export { TruncatedTooltipText };
8
10
  export default TruncatedTooltipText;
@@ -0,0 +1,3 @@
1
+ export const LabelHeightRenderer: React.FunctionComponent<React.JSX.IntrinsicAttributes>;
2
+ export const TooltipRenderer: React.FunctionComponent<React.JSX.IntrinsicAttributes>;
3
+ import React from 'react';
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-form-checkbox",
3
- "version": "3.70.0-next.34",
3
+ "version": "3.70.0-next.35",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Controlled Form Checkbox",
6
6
  "files": [
@@ -37,18 +37,19 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "uid": "^2.0.2",
40
- "@elliemae/ds-floating-context": "3.70.0-next.34",
41
- "@elliemae/ds-system": "3.70.0-next.34",
42
- "@elliemae/ds-typescript-helpers": "3.70.0-next.34",
43
- "@elliemae/ds-props-helpers": "3.70.0-next.34",
44
- "@elliemae/ds-typography": "3.70.0-next.34"
40
+ "@elliemae/ds-floating-context": "3.70.0-next.35",
41
+ "@elliemae/ds-system": "3.70.0-next.35",
42
+ "@elliemae/ds-typescript-helpers": "3.70.0-next.35",
43
+ "@elliemae/ds-typography": "3.70.0-next.35",
44
+ "@elliemae/ds-props-helpers": "3.70.0-next.35"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@elliemae/pui-theme": "~2.13.0",
48
+ "@playwright/experimental-ct-react": "^1.60.0",
48
49
  "jest": "^30.0.0",
49
50
  "styled-components": "~5.3.9",
50
- "@elliemae/ds-monorepo-devops": "3.70.0-next.34",
51
- "@elliemae/ds-test-utils": "3.70.0-next.34"
51
+ "@elliemae/ds-monorepo-devops": "3.70.0-next.35",
52
+ "@elliemae/ds-test-utils": "3.70.0-next.35"
52
53
  },
53
54
  "peerDependencies": {
54
55
  "@elliemae/pui-theme": "~2.13.0",