@elliemae/ds-tooltip-v3 3.55.0-next.9 → 3.55.2

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.
@@ -96,11 +96,7 @@ const DSTooltipV3 = (props) => {
96
96
  context,
97
97
  children: [
98
98
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledTooltipContainer, { "data-testid": import_TooltipV3DatatestId.TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER, children: [
99
- Text ? (
100
- // this "as T" is an oversimplification but it's safe due to how js {...undefined} works
101
- // users of the component that want the strict types will define T, others won't, no reason to force it on our end
102
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { ...textProps })
103
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
99
+ Text ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { ...textProps ?? {} }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
104
100
  import_styles.StyledTooltipText,
105
101
  {
106
102
  "data-testid": import_TooltipV3DatatestId.TooltipV3DatatestId.OPINIONATED_TEXT_WRAPPER,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSTooltipV3.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTooltipV3PropTypesSchema } from './react-desc-prop-types.js';\nimport { TooltipV3DatatestId } from './TooltipV3DatatestId.js';\nimport {\n StyledTooltipContainer,\n StyledTooltipText,\n StyledMouseOverDetectionBox,\n StyledTriggerWrapper,\n} from './styles.js';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\nimport { useTooltipV3 } from './config/useTooltipV3.js';\nimport { DSTooltipV3Name } from './constants.js';\n\nconst DSTooltipV3 = <T extends DSTooltipV3T.CustomInterface>(props: DSTooltipV3T.Props<T>) => {\n const { propsWithDefault } = useTooltipV3(props);\n\n const {\n text,\n startPlacementPreference,\n children,\n onOpen,\n onClose,\n id,\n textAlign,\n wrapWords,\n withoutArrow,\n customOffset,\n animationDuration,\n withoutAnimation,\n withoutPortal,\n portalDOMContainer,\n applyTooltipOverflowWrap,\n showPopover,\n Text,\n textProps,\n } = propsWithDefault;\n\n const { handlers, arrowStyles, floatingStyles, isOpen, refs, context } = useFloatingContext({\n placement: startPlacementPreference,\n customOffset,\n onOpen,\n onClose,\n withoutPortal,\n withoutAnimation,\n portalDOMContainer,\n animationDuration,\n externallyControlledIsOpen: showPopover,\n });\n\n const isOpenSourceOfTruth = React.useMemo(() => {\n if (showPopover !== undefined) return showPopover;\n return isOpen;\n }, [showPopover, isOpen]);\n\n return (\n <StyledTriggerWrapper\n {...handlers}\n innerRef={refs.setReference}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isOpenSourceOfTruth}\n floatingStyles={floatingStyles}\n context={context}\n >\n <StyledTooltipContainer data-testid={TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}>\n {Text ? (\n // this \"as T\" is an oversimplification but it's safe due to how js {...undefined} works\n // users of the component that want the strict types will define T, others won't, no reason to force it on our end\n <Text {...(textProps as T)} />\n ) : (\n <StyledTooltipText\n data-testid={TooltipV3DatatestId.OPINIONATED_TEXT_WRAPPER}\n textAlign={textAlign}\n wrapWords={wrapWords}\n $applyTooltipOverflowWrap={applyTooltipOverflowWrap}\n >\n {text}\n </StyledTooltipText>\n )}\n <StyledMouseOverDetectionBox />\n </StyledTooltipContainer>\n {!withoutArrow ? <PopoverArrow {...arrowStyles} /> : null}\n </FloatingWrapper>\n\n {children}\n </StyledTriggerWrapper>\n );\n};\n\nDSTooltipV3.displayName = DSTooltipV3Name;\nconst DSTooltipV3WithSchema = describe(DSTooltipV3);\nDSTooltipV3WithSchema.propTypes = DSTooltipV3PropTypesSchema;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\n\nexport default DSTooltipV3;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqEf;AApER,mBAAkB;AAClB,iCAAkE;AAClE,8BAAyB;AACzB,mCAA2C;AAC3C,iCAAoC;AACpC,oBAKO;AAEP,0BAA6B;AAC7B,uBAAgC;AAEhC,MAAM,cAAc,CAAyC,UAAiC;AAC5F,QAAM,EAAE,iBAAiB,QAAI,kCAAa,KAAK;AAE/C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,EAAE,UAAU,aAAa,gBAAgB,QAAQ,MAAM,QAAQ,QAAI,+CAAmB;AAAA,IAC1F,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,4BAA4B;AAAA,EAC9B,CAAC;AAED,QAAM,sBAAsB,aAAAA,QAAM,QAAQ,MAAM;AAC9C,QAAI,gBAAgB,OAAW,QAAO;AACtC,WAAO;AAAA,EACT,GAAG,CAAC,aAAa,MAAM,CAAC;AAExB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU,KAAK;AAAA,MACf,eAAa,GAAG,+CAAoB,eAAe,GAAG,OAAO,KAAK,IAAI,EAAE,KAAK,EAAE;AAAA,MAE/E;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf,QAAQ;AAAA,YACR;AAAA,YACA;AAAA,YAEA;AAAA,2DAAC,wCAAuB,eAAa,+CAAoB,sBACtD;AAAA;AAAA;AAAA;AAAA,kBAGC,4CAAC,QAAM,GAAI,WAAiB;AAAA,oBAE5B;AAAA,kBAAC;AAAA;AAAA,oBACC,eAAa,+CAAoB;AAAA,oBACjC;AAAA,oBACA;AAAA,oBACA,2BAA2B;AAAA,oBAE1B;AAAA;AAAA,gBACH;AAAA,gBAEF,4CAAC,6CAA4B;AAAA,iBAC/B;AAAA,cACC,CAAC,eAAe,4CAAC,2CAAc,GAAG,aAAa,IAAK;AAAA;AAAA;AAAA,QACvD;AAAA,QAEC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,4BAAwB,kCAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTooltipV3PropTypesSchema } from './react-desc-prop-types.js';\nimport { TooltipV3DatatestId } from './TooltipV3DatatestId.js';\nimport {\n StyledTooltipContainer,\n StyledTooltipText,\n StyledMouseOverDetectionBox,\n StyledTriggerWrapper,\n} from './styles.js';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\nimport { useTooltipV3 } from './config/useTooltipV3.js';\nimport { DSTooltipV3Name } from './constants.js';\n\nconst DSTooltipV3: React.ComponentType<DSTooltipV3T.Props> = (props) => {\n const { propsWithDefault } = useTooltipV3(props);\n\n const {\n text,\n startPlacementPreference,\n children,\n onOpen,\n onClose,\n id,\n textAlign,\n wrapWords,\n withoutArrow,\n customOffset,\n animationDuration,\n withoutAnimation,\n withoutPortal,\n portalDOMContainer,\n applyTooltipOverflowWrap,\n showPopover,\n Text,\n textProps,\n } = propsWithDefault;\n\n const { handlers, arrowStyles, floatingStyles, isOpen, refs, context } = useFloatingContext({\n placement: startPlacementPreference,\n customOffset,\n onOpen,\n onClose,\n withoutPortal,\n withoutAnimation,\n portalDOMContainer,\n animationDuration,\n externallyControlledIsOpen: showPopover,\n });\n\n const isOpenSourceOfTruth = React.useMemo(() => {\n if (showPopover !== undefined) return showPopover;\n return isOpen;\n }, [showPopover, isOpen]);\n\n return (\n <StyledTriggerWrapper\n {...handlers}\n innerRef={refs.setReference}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isOpenSourceOfTruth}\n floatingStyles={floatingStyles}\n context={context}\n >\n <StyledTooltipContainer data-testid={TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}>\n {Text ? (\n <Text {...(textProps ?? {})} />\n ) : (\n <StyledTooltipText\n data-testid={TooltipV3DatatestId.OPINIONATED_TEXT_WRAPPER}\n textAlign={textAlign}\n wrapWords={wrapWords}\n $applyTooltipOverflowWrap={applyTooltipOverflowWrap}\n >\n {text}\n </StyledTooltipText>\n )}\n <StyledMouseOverDetectionBox />\n </StyledTooltipContainer>\n {!withoutArrow ? <PopoverArrow {...arrowStyles} /> : null}\n </FloatingWrapper>\n\n {children}\n </StyledTriggerWrapper>\n );\n};\n\nDSTooltipV3.displayName = DSTooltipV3Name;\nconst DSTooltipV3WithSchema = describe(DSTooltipV3);\nDSTooltipV3WithSchema.propTypes = DSTooltipV3PropTypesSchema;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\n\nexport default DSTooltipV3;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqEf;AApER,mBAAkB;AAClB,iCAAkE;AAClE,8BAAyB;AACzB,mCAA2C;AAC3C,iCAAoC;AACpC,oBAKO;AAEP,0BAA6B;AAC7B,uB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K;AAAA;AAAA;AAAA,QACvD;AAAA,QAEC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,4BAAwB,kCAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/useTooltipV3.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSTooltipV3T, DSTooltipV3PropTypes } from '../react-desc-prop-types.js';\nimport { defaultProps } from '../defaultProps.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface Tooltipv3CTX {\n propsWithDefault: DSTooltipV3T.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useTooltipV3 = <T extends DSTooltipV3T.CustomInterface>(propsFromUser: DSTooltipV3T.Props<T>) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSTooltipV3T.InternalProps<T>>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSTooltipV3PropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const instanceUid = React.useMemo(() => `ds-tooltip-v3-${uid(5)}`, []);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAiE;AACjE,iBAAoB;AACpB,mCAAwD;AACxD,0BAA6B;AAC7B,8BAAiC;AAQ1B,MAAM,eAAe,CAAyC,kBAAyC;AAI5G,QAAM,uBAAmB,sDAA4D,eAAe,gCAAY;AAChH,gDAAiB,kBAAkB,iDAAoB;AAIvD,QAAM,mBAAe,4CAAmB,gBAAgB;AAKxD,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,qBAAiB,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAMrE,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import React from 'react';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSTooltipV3T, DSTooltipV3PropTypes } from '../react-desc-prop-types.js';\nimport { defaultProps } from '../defaultProps.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface Tooltipv3CTX {\n propsWithDefault: DSTooltipV3T.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useTooltipV3 = (propsFromUser: DSTooltipV3T.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSTooltipV3T.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSTooltipV3PropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const instanceUid = React.useMemo(() => `ds-tooltip-v3-${uid(5)}`, []);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAiE;AACjE,iBAAoB;AACpB,mCAAwD;AACxD,0BAA6B;AAC7B,8BAAiC;AAQ1B,MAAM,eAAe,CAAC,kBAAsC;AAIjE,QAAM,uBAAmB,sDAAyD,eAAe,gCAAY;AAC7G,gDAAiB,kBAAkB,iDAAoB;AAIvD,QAAM,mBAAe,4CAAmB,gBAAgB;AAKxD,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,qBAAiB,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAMrE,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSTooltipV3T } from '../react-desc-prop-types.js';\nimport { DSTooltipV3Name } from '../constants.js';\n\nexport const useValidateProps = <T extends DSTooltipV3T.CustomInterface>(\n props: DSTooltipV3T.InternalProps<T>,\n propTypes: ValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSTooltipV3Name);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAAgC;AAEzB,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,gCAAe;AAClE;",
4
+ "sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSTooltipV3T } from '../react-desc-prop-types.js';\nimport { DSTooltipV3Name } from '../constants.js';\n\nexport const useValidateProps = (props: DSTooltipV3T.InternalProps, propTypes: ValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSTooltipV3Name);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAAgC;AAEzB,MAAM,mBAAmB,CAAC,OAAmC,cAA4C;AAE9G,8DAA+B,OAAO,WAAW,gCAAe;AAClE;",
6
6
  "names": []
7
7
  }
@@ -57,7 +57,7 @@ const DSTooltipV3PropTypes = {
57
57
  onClose: import_ds_props_helpers.PropTypes.func.description("Optional callback to be invoked when the tooltip closes").defaultValue("() => {}"),
58
58
  showPopover: import_ds_props_helpers.PropTypes.bool.description("Whether or not the tooltip should be always shown"),
59
59
  Text: import_ds_props_helpers.PropTypes.func.description(
60
- "Custom component to be displayed in the tooltip, will receive textProps as props. If both `text` and `Text` are provided, only `Text` will take precedence."
60
+ "Custom component (HTML/JSX) to be displayed in the tooltip. If both `text` and `Text` are provided, only `Text` will take precedence."
61
61
  ).isRequiredIf((props) => !props.text),
62
62
  textProps: import_ds_props_helpers.PropTypes.object.description(
63
63
  "Props to be passed to the custom Text component, if provided, used mainly to avoiding inline components definition to improve performance"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { PLACEMENT, TEXT_ALIGNMENT } from './constants.js';\n\nexport declare namespace DSTooltipV3T {\n export type CustomInterface<T extends Record<string, unknown> = Record<string, unknown>> = T;\n export type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n export type TextAlignment = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';\n\n export interface DefaultProps {\n onOpen: () => void;\n onClose: () => void;\n id: string;\n textAlign: TextAlignment;\n wrapWords: boolean;\n startPlacementPreference: Placement;\n applyTooltipOverflowWrap: boolean;\n customOffset?: [number, number];\n }\n\n export interface OptionalProps<T extends Record<string, unknown> = Record<string, unknown>> {\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n animationDuration?: number;\n portalDOMContainer?: HTMLElement;\n showPopover?: boolean;\n Text?: React.ComponentType<T>;\n textProps?: T;\n text?: string;\n }\n\n export interface RequiredProps {\n children: React.ReactNode;\n }\n export interface InternalProps<T extends CustomInterface = CustomInterface>\n extends DefaultProps,\n OptionalProps<T>,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface Props<T extends CustomInterface = CustomInterface>\n extends Partial<DefaultProps>,\n OptionalProps<T>,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const DSTooltipV3PropTypes: DSPropTypesSchema<DSTooltipV3T.Props> = {\n text: PropTypes.string\n .description(\n 'Tooltip text to be displayed on hover/focus. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.Text),\n textAlign: PropTypes.oneOf(TEXT_ALIGNMENT as unknown as unknown[])\n .description('Tooltip text alignment')\n .defaultValue('left'),\n applyTooltipOverflowWrap: PropTypes.bool\n .description(\n 'when a tooltip is present, the tooltip text may be too long to fit in the pill. If true, the tooltip will wrap to the next line using overflow-wrap',\n )\n .defaultValue(false),\n wrapWords: PropTypes.bool\n .description('Break words into a new line. Useful when words exceed tooltip max-lenght.')\n .defaultValue(false),\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\n portalDOMContainer: PropTypes.oneOfType([PropTypes.node, PropTypes.oneOf([null])])\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n startPlacementPreference: PropTypes.oneOf(PLACEMENT)\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n showPopover: PropTypes.bool.description('Whether or not the tooltip should be always shown'),\n Text: PropTypes.func\n .description(\n 'Custom component to be displayed in the tooltip, will receive textProps as props. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.text),\n textProps: PropTypes.object.description(\n 'Props to be passed to the custom Text component, if provided, used mainly to avoiding inline components definition to improve performance',\n ),\n};\n\nexport const DSTooltipV3PropTypesSchema = DSTooltipV3PropTypes as unknown as ValidationMap<DSTooltipV3T.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAA0B;AAC1B,uBAA0C;AA4DnC,MAAM,uBAA8D;AAAA,EACzE,MAAM,kCAAU,OACb;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,UAAmC,CAAC,MAAM,IAAI;AAAA,EAC/D,WAAW,kCAAU,MAAM,+BAAsC,EAC9D,YAAY,wBAAwB,EACpC,aAAa,MAAM;AAAA,EACtB,0BAA0B,kCAAU,KACjC;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,WAAW,kCAAU,KAClB,YAAY,2EAA2E,EACvF,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,KAAK,YAAY,sDAAsD,EAAE;AAAA,EAC7F,eAAe,kCAAU,KACtB,YAAY,yEAAyE,EACrF,aAAa,IAAI;AAAA,EACpB,cAAc,kCAAU,KAAK,YAAY,iDAAiD,EAAE,aAAa,KAAK;AAAA,EAC9G,kBAAkB,kCAAU,KACzB,YAAY,2DAA2D,EACvE,aAAa,KAAK;AAAA,EACrB,mBAAmB,kCAAU,OAAO,YAAY,+CAA+C,EAAE,aAAa,GAAG;AAAA,EACjH,oBAAoB,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAC9E,YAAY,gGAAgG,EAC5G,aAAa,MAAS;AAAA,EACzB,0BAA0B,kCAAU,MAAM,0BAAS,EAChD,YAAY,+DAA+D,EAC3E,aAAa,OAAO;AAAA,EACvB,cAAc,kCAAU,QAAQ,kCAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE,aAAa,CAAC,GAAG,EAAE,CAAC;AAAA,EAC5G,IAAI,kCAAU,OAAO,YAAY,qCAAqC,EAAE,aAAa,EAAE;AAAA,EACvF,QAAQ,kCAAU,KAAK,YAAY,wDAAwD,EAAE,aAAa,UAAU;AAAA,EACpH,SAAS,kCAAU,KAChB,YAAY,yDAAyD,EACrE,aAAa,UAAU;AAAA,EAC1B,aAAa,kCAAU,KAAK,YAAY,mDAAmD;AAAA,EAC3F,MAAM,kCAAU,KACb;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,UAAmC,CAAC,MAAM,IAAI;AAAA,EAC/D,WAAW,kCAAU,OAAO;AAAA,IAC1B;AAAA,EACF;AACF;AAEO,MAAM,6BAA6B;",
4
+ "sourcesContent": ["import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { PLACEMENT, TEXT_ALIGNMENT } from './constants.js';\n\nexport declare namespace DSTooltipV3T {\n export type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n export type TextAlignment = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';\n\n export interface DefaultProps {\n onOpen: () => void;\n onClose: () => void;\n id: string;\n textAlign: TextAlignment;\n wrapWords: boolean;\n startPlacementPreference: Placement;\n applyTooltipOverflowWrap: boolean;\n customOffset?: [number, number];\n }\n\n export interface OptionalProps {\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n animationDuration?: number;\n portalDOMContainer?: HTMLElement;\n showPopover?: boolean;\n Text?: React.ComponentType<Record<string, unknown>>;\n textProps?: Record<string, unknown>;\n text?: string;\n }\n\n export interface RequiredProps {\n children: React.ReactNode;\n }\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const DSTooltipV3PropTypes: DSPropTypesSchema<DSTooltipV3T.Props> = {\n text: PropTypes.string\n .description(\n 'Tooltip text to be displayed on hover/focus. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.Text),\n textAlign: PropTypes.oneOf(TEXT_ALIGNMENT as unknown as unknown[])\n .description('Tooltip text alignment')\n .defaultValue('left'),\n applyTooltipOverflowWrap: PropTypes.bool\n .description(\n 'when a tooltip is present, the tooltip text may be too long to fit in the pill. If true, the tooltip will wrap to the next line using overflow-wrap',\n )\n .defaultValue(false),\n wrapWords: PropTypes.bool\n .description('Break words into a new line. Useful when words exceed tooltip max-lenght.')\n .defaultValue(false),\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\n portalDOMContainer: PropTypes.oneOfType([PropTypes.node, PropTypes.oneOf([null])])\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n startPlacementPreference: PropTypes.oneOf(PLACEMENT)\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n showPopover: PropTypes.bool.description('Whether or not the tooltip should be always shown'),\n Text: PropTypes.func\n .description(\n 'Custom component (HTML/JSX) to be displayed in the tooltip. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.text),\n textProps: PropTypes.object.description(\n 'Props to be passed to the custom Text component, if provided, used mainly to avoiding inline components definition to improve performance',\n ),\n};\n\nexport const DSTooltipV3PropTypesSchema = DSTooltipV3PropTypes as unknown as ValidationMap<DSTooltipV3T.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAA0B;AAC1B,uBAA0C;AA2DnC,MAAM,uBAA8D;AAAA,EACzE,MAAM,kCAAU,OACb;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,UAAmC,CAAC,MAAM,IAAI;AAAA,EAC/D,WAAW,kCAAU,MAAM,+BAAsC,EAC9D,YAAY,wBAAwB,EACpC,aAAa,MAAM;AAAA,EACtB,0BAA0B,kCAAU,KACjC;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,WAAW,kCAAU,KAClB,YAAY,2EAA2E,EACvF,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,KAAK,YAAY,sDAAsD,EAAE;AAAA,EAC7F,eAAe,kCAAU,KACtB,YAAY,yEAAyE,EACrF,aAAa,IAAI;AAAA,EACpB,cAAc,kCAAU,KAAK,YAAY,iDAAiD,EAAE,aAAa,KAAK;AAAA,EAC9G,kBAAkB,kCAAU,KACzB,YAAY,2DAA2D,EACvE,aAAa,KAAK;AAAA,EACrB,mBAAmB,kCAAU,OAAO,YAAY,+CAA+C,EAAE,aAAa,GAAG;AAAA,EACjH,oBAAoB,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAC9E,YAAY,gGAAgG,EAC5G,aAAa,MAAS;AAAA,EACzB,0BAA0B,kCAAU,MAAM,0BAAS,EAChD,YAAY,+DAA+D,EAC3E,aAAa,OAAO;AAAA,EACvB,cAAc,kCAAU,QAAQ,kCAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE,aAAa,CAAC,GAAG,EAAE,CAAC;AAAA,EAC5G,IAAI,kCAAU,OAAO,YAAY,qCAAqC,EAAE,aAAa,EAAE;AAAA,EACvF,QAAQ,kCAAU,KAAK,YAAY,wDAAwD,EAAE,aAAa,UAAU;AAAA,EACpH,SAAS,kCAAU,KAChB,YAAY,yDAAyD,EACrE,aAAa,UAAU;AAAA,EAC1B,aAAa,kCAAU,KAAK,YAAY,mDAAmD;AAAA,EAC3F,MAAM,kCAAU,KACb;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,UAAmC,CAAC,MAAM,IAAI;AAAA,EAC/D,WAAW,kCAAU,OAAO;AAAA,IAC1B;AAAA,EACF;AACF;AAEO,MAAM,6BAA6B;",
6
6
  "names": []
7
7
  }
@@ -66,11 +66,7 @@ const DSTooltipV3 = (props) => {
66
66
  context,
67
67
  children: [
68
68
  /* @__PURE__ */ jsxs(StyledTooltipContainer, { "data-testid": TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER, children: [
69
- Text ? (
70
- // this "as T" is an oversimplification but it's safe due to how js {...undefined} works
71
- // users of the component that want the strict types will define T, others won't, no reason to force it on our end
72
- /* @__PURE__ */ jsx(Text, { ...textProps })
73
- ) : /* @__PURE__ */ jsx(
69
+ Text ? /* @__PURE__ */ jsx(Text, { ...textProps ?? {} }) : /* @__PURE__ */ jsx(
74
70
  StyledTooltipText,
75
71
  {
76
72
  "data-testid": TooltipV3DatatestId.OPINIONATED_TEXT_WRAPPER,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSTooltipV3.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTooltipV3PropTypesSchema } from './react-desc-prop-types.js';\nimport { TooltipV3DatatestId } from './TooltipV3DatatestId.js';\nimport {\n StyledTooltipContainer,\n StyledTooltipText,\n StyledMouseOverDetectionBox,\n StyledTriggerWrapper,\n} from './styles.js';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\nimport { useTooltipV3 } from './config/useTooltipV3.js';\nimport { DSTooltipV3Name } from './constants.js';\n\nconst DSTooltipV3 = <T extends DSTooltipV3T.CustomInterface>(props: DSTooltipV3T.Props<T>) => {\n const { propsWithDefault } = useTooltipV3(props);\n\n const {\n text,\n startPlacementPreference,\n children,\n onOpen,\n onClose,\n id,\n textAlign,\n wrapWords,\n withoutArrow,\n customOffset,\n animationDuration,\n withoutAnimation,\n withoutPortal,\n portalDOMContainer,\n applyTooltipOverflowWrap,\n showPopover,\n Text,\n textProps,\n } = propsWithDefault;\n\n const { handlers, arrowStyles, floatingStyles, isOpen, refs, context } = useFloatingContext({\n placement: startPlacementPreference,\n customOffset,\n onOpen,\n onClose,\n withoutPortal,\n withoutAnimation,\n portalDOMContainer,\n animationDuration,\n externallyControlledIsOpen: showPopover,\n });\n\n const isOpenSourceOfTruth = React.useMemo(() => {\n if (showPopover !== undefined) return showPopover;\n return isOpen;\n }, [showPopover, isOpen]);\n\n return (\n <StyledTriggerWrapper\n {...handlers}\n innerRef={refs.setReference}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isOpenSourceOfTruth}\n floatingStyles={floatingStyles}\n context={context}\n >\n <StyledTooltipContainer data-testid={TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}>\n {Text ? (\n // this \"as T\" is an oversimplification but it's safe due to how js {...undefined} works\n // users of the component that want the strict types will define T, others won't, no reason to force it on our end\n <Text {...(textProps as T)} />\n ) : (\n <StyledTooltipText\n data-testid={TooltipV3DatatestId.OPINIONATED_TEXT_WRAPPER}\n textAlign={textAlign}\n wrapWords={wrapWords}\n $applyTooltipOverflowWrap={applyTooltipOverflowWrap}\n >\n {text}\n </StyledTooltipText>\n )}\n <StyledMouseOverDetectionBox />\n </StyledTooltipContainer>\n {!withoutArrow ? <PopoverArrow {...arrowStyles} /> : null}\n </FloatingWrapper>\n\n {children}\n </StyledTriggerWrapper>\n );\n};\n\nDSTooltipV3.displayName = DSTooltipV3Name;\nconst DSTooltipV3WithSchema = describe(DSTooltipV3);\nDSTooltipV3WithSchema.propTypes = DSTooltipV3PropTypesSchema;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\n\nexport default DSTooltipV3;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACqEf,SAII,KAJJ;AApER,OAAOA,YAAW;AAClB,SAAS,oBAAoB,cAAc,uBAAuB;AAClE,SAAS,gBAAgB;AACzB,SAAS,kCAAkC;AAC3C,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAEhC,MAAM,cAAc,CAAyC,UAAiC;A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A,QAEC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTooltipV3PropTypesSchema } from './react-desc-prop-types.js';\nimport { TooltipV3DatatestId } from './TooltipV3DatatestId.js';\nimport {\n StyledTooltipContainer,\n StyledTooltipText,\n StyledMouseOverDetectionBox,\n StyledTriggerWrapper,\n} from './styles.js';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\nimport { useTooltipV3 } from './config/useTooltipV3.js';\nimport { DSTooltipV3Name } from './constants.js';\n\nconst DSTooltipV3: React.ComponentType<DSTooltipV3T.Props> = (props) => {\n const { propsWithDefault } = useTooltipV3(props);\n\n const {\n text,\n startPlacementPreference,\n children,\n onOpen,\n onClose,\n id,\n textAlign,\n wrapWords,\n withoutArrow,\n customOffset,\n animationDuration,\n withoutAnimation,\n withoutPortal,\n portalDOMContainer,\n applyTooltipOverflowWrap,\n showPopover,\n Text,\n textProps,\n } = propsWithDefault;\n\n const { handlers, arrowStyles, floatingStyles, isOpen, refs, context } = useFloatingContext({\n placement: startPlacementPreference,\n customOffset,\n onOpen,\n onClose,\n withoutPortal,\n withoutAnimation,\n portalDOMContainer,\n animationDuration,\n externallyControlledIsOpen: showPopover,\n });\n\n const isOpenSourceOfTruth = React.useMemo(() => {\n if (showPopover !== undefined) return showPopover;\n return isOpen;\n }, [showPopover, isOpen]);\n\n return (\n <StyledTriggerWrapper\n {...handlers}\n innerRef={refs.setReference}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isOpenSourceOfTruth}\n floatingStyles={floatingStyles}\n context={context}\n >\n <StyledTooltipContainer data-testid={TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}>\n {Text ? (\n <Text {...(textProps ?? {})} />\n ) : (\n <StyledTooltipText\n data-testid={TooltipV3DatatestId.OPINIONATED_TEXT_WRAPPER}\n textAlign={textAlign}\n wrapWords={wrapWords}\n $applyTooltipOverflowWrap={applyTooltipOverflowWrap}\n >\n {text}\n </StyledTooltipText>\n )}\n <StyledMouseOverDetectionBox />\n </StyledTooltipContainer>\n {!withoutArrow ? <PopoverArrow {...arrowStyles} /> : null}\n </FloatingWrapper>\n\n {children}\n </StyledTriggerWrapper>\n );\n};\n\nDSTooltipV3.displayName = DSTooltipV3Name;\nconst DSTooltipV3WithSchema = describe(DSTooltipV3);\nDSTooltipV3WithSchema.propTypes = DSTooltipV3PropTypesSchema;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\n\nexport default DSTooltipV3;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACqEf,SAEI,KAFJ;AApER,OAAOA,YAAW;AAClB,SAAS,oBAAoB,cAAc,uBAAuB;AAClE,SAAS,gBAAgB;AACzB,SAAS,kCAAkC;AAC3C,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAEhC,MAAM,cAAuD,CAAC,UAAU;AACtE,QAAM,EAAE,iBAAiB,IAAI,aAAa,KAAK;AAE/C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,EAAE,UAAU,aAAa,gBAAgB,QAAQ,MAAM,QAAQ,IAAI,mBAAmB;AAAA,IAC1F,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,4BAA4B;AAAA,EAC9B,CAAC;AAED,QAAM,sBAAsBA,OAAM,QAAQ,MAAM;AAC9C,QAAI,gBAAgB,OAAW,QAAO;AACtC,WAAO;AAAA,EACT,GAAG,CAAC,aAAa,MAAM,CAAC;AAExB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU,KAAK;AAAA,MACf,eAAa,GAAG,oBAAoB,eAAe,GAAG,OAAO,KAAK,IAAI,EAAE,KAAK,EAAE;AAAA,MAE/E;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf,QAAQ;AAAA,YACR;AAAA,YACA;AAAA,YAEA;AAAA,mCAAC,0BAAuB,eAAa,oBAAoB,sBACtD;AAAA,uBACC,oBAAC,QAAM,GAAI,aAAa,CAAC,GAAI,IAE7B;AAAA,kBAAC;AAAA;AAAA,oBACC,eAAa,oBAAoB;AAAA,oBACjC;AAAA,oBACA;AAAA,oBACA,2BAA2B;AAAA,oBAE1B;AAAA;AAAA,gBACH;AAAA,gBAEF,oBAAC,+BAA4B;AAAA,iBAC/B;AAAA,cACC,CAAC,eAAe,oBAAC,gBAAc,GAAG,aAAa,IAAK;AAAA;AAAA;AAAA,QACvD;AAAA,QAEC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
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/config/useTooltipV3.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSTooltipV3T, DSTooltipV3PropTypes } from '../react-desc-prop-types.js';\nimport { defaultProps } from '../defaultProps.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface Tooltipv3CTX {\n propsWithDefault: DSTooltipV3T.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useTooltipV3 = <T extends DSTooltipV3T.CustomInterface>(propsFromUser: DSTooltipV3T.Props<T>) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSTooltipV3T.InternalProps<T>>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSTooltipV3PropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const instanceUid = React.useMemo(() => `ds-tooltip-v3-${uid(5)}`, []);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,oBAAoB,oCAAoC;AACjE,SAAS,WAAW;AACpB,SAA4B,4BAA4B;AACxD,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAQ1B,MAAM,eAAe,CAAyC,kBAAyC;AAI5G,QAAM,mBAAmB,6BAA4D,eAAe,YAAY;AAChH,mBAAiB,kBAAkB,oBAAoB;AAIvD,QAAM,eAAe,mBAAmB,gBAAgB;AAKxD,QAAM,cAAcA,OAAM,QAAQ,MAAM,iBAAiB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAMrE,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSTooltipV3T, DSTooltipV3PropTypes } from '../react-desc-prop-types.js';\nimport { defaultProps } from '../defaultProps.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface Tooltipv3CTX {\n propsWithDefault: DSTooltipV3T.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useTooltipV3 = (propsFromUser: DSTooltipV3T.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSTooltipV3T.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSTooltipV3PropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const instanceUid = React.useMemo(() => `ds-tooltip-v3-${uid(5)}`, []);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,oBAAoB,oCAAoC;AACjE,SAAS,WAAW;AACpB,SAA4B,4BAA4B;AACxD,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAQ1B,MAAM,eAAe,CAAC,kBAAsC;AAIjE,QAAM,mBAAmB,6BAAyD,eAAe,YAAY;AAC7G,mBAAiB,kBAAkB,oBAAoB;AAIvD,QAAM,eAAe,mBAAmB,gBAAgB;AAKxD,QAAM,cAAcA,OAAM,QAAQ,MAAM,iBAAiB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAMrE,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
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/config/useValidateProps.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSTooltipV3T } from '../react-desc-prop-types.js';\nimport { DSTooltipV3Name } from '../constants.js';\n\nexport const useValidateProps = <T extends DSTooltipV3T.CustomInterface>(\n props: DSTooltipV3T.InternalProps<T>,\n propTypes: ValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSTooltipV3Name);\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,uBAAuB;AAEzB,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,eAAe;AAClE;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSTooltipV3T } from '../react-desc-prop-types.js';\nimport { DSTooltipV3Name } from '../constants.js';\n\nexport const useValidateProps = (props: DSTooltipV3T.InternalProps, propTypes: ValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSTooltipV3Name);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,uBAAuB;AAEzB,MAAM,mBAAmB,CAAC,OAAmC,cAA4C;AAE9G,iCAA+B,OAAO,WAAW,eAAe;AAClE;",
6
6
  "names": []
7
7
  }
@@ -23,7 +23,7 @@ const DSTooltipV3PropTypes = {
23
23
  onClose: PropTypes.func.description("Optional callback to be invoked when the tooltip closes").defaultValue("() => {}"),
24
24
  showPopover: PropTypes.bool.description("Whether or not the tooltip should be always shown"),
25
25
  Text: PropTypes.func.description(
26
- "Custom component to be displayed in the tooltip, will receive textProps as props. If both `text` and `Text` are provided, only `Text` will take precedence."
26
+ "Custom component (HTML/JSX) to be displayed in the tooltip. If both `text` and `Text` are provided, only `Text` will take precedence."
27
27
  ).isRequiredIf((props) => !props.text),
28
28
  textProps: PropTypes.object.description(
29
29
  "Props to be passed to the custom Text component, if provided, used mainly to avoiding inline components definition to improve performance"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { PLACEMENT, TEXT_ALIGNMENT } from './constants.js';\n\nexport declare namespace DSTooltipV3T {\n export type CustomInterface<T extends Record<string, unknown> = Record<string, unknown>> = T;\n export type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n export type TextAlignment = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';\n\n export interface DefaultProps {\n onOpen: () => void;\n onClose: () => void;\n id: string;\n textAlign: TextAlignment;\n wrapWords: boolean;\n startPlacementPreference: Placement;\n applyTooltipOverflowWrap: boolean;\n customOffset?: [number, number];\n }\n\n export interface OptionalProps<T extends Record<string, unknown> = Record<string, unknown>> {\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n animationDuration?: number;\n portalDOMContainer?: HTMLElement;\n showPopover?: boolean;\n Text?: React.ComponentType<T>;\n textProps?: T;\n text?: string;\n }\n\n export interface RequiredProps {\n children: React.ReactNode;\n }\n export interface InternalProps<T extends CustomInterface = CustomInterface>\n extends DefaultProps,\n OptionalProps<T>,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface Props<T extends CustomInterface = CustomInterface>\n extends Partial<DefaultProps>,\n OptionalProps<T>,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const DSTooltipV3PropTypes: DSPropTypesSchema<DSTooltipV3T.Props> = {\n text: PropTypes.string\n .description(\n 'Tooltip text to be displayed on hover/focus. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.Text),\n textAlign: PropTypes.oneOf(TEXT_ALIGNMENT as unknown as unknown[])\n .description('Tooltip text alignment')\n .defaultValue('left'),\n applyTooltipOverflowWrap: PropTypes.bool\n .description(\n 'when a tooltip is present, the tooltip text may be too long to fit in the pill. If true, the tooltip will wrap to the next line using overflow-wrap',\n )\n .defaultValue(false),\n wrapWords: PropTypes.bool\n .description('Break words into a new line. Useful when words exceed tooltip max-lenght.')\n .defaultValue(false),\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\n portalDOMContainer: PropTypes.oneOfType([PropTypes.node, PropTypes.oneOf([null])])\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n startPlacementPreference: PropTypes.oneOf(PLACEMENT)\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n showPopover: PropTypes.bool.description('Whether or not the tooltip should be always shown'),\n Text: PropTypes.func\n .description(\n 'Custom component to be displayed in the tooltip, will receive textProps as props. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.text),\n textProps: PropTypes.object.description(\n 'Props to be passed to the custom Text component, if provided, used mainly to avoiding inline components definition to improve performance',\n ),\n};\n\nexport const DSTooltipV3PropTypesSchema = DSTooltipV3PropTypes as unknown as ValidationMap<DSTooltipV3T.Props>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AAC1B,SAAS,WAAW,sBAAsB;AA4DnC,MAAM,uBAA8D;AAAA,EACzE,MAAM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AAI;AAAA,EAC/D,WAAW,UAAU,OAAO;AAAA,IAC1B;AAAA,EACF;AACF;AAEO,MAAM,6BAA6B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { PLACEMENT, TEXT_ALIGNMENT } from './constants.js';\n\nexport declare namespace DSTooltipV3T {\n export type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n export type TextAlignment = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';\n\n export interface DefaultProps {\n onOpen: () => void;\n onClose: () => void;\n id: string;\n textAlign: TextAlignment;\n wrapWords: boolean;\n startPlacementPreference: Placement;\n applyTooltipOverflowWrap: boolean;\n customOffset?: [number, number];\n }\n\n export interface OptionalProps {\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n animationDuration?: number;\n portalDOMContainer?: HTMLElement;\n showPopover?: boolean;\n Text?: React.ComponentType<Record<string, unknown>>;\n textProps?: Record<string, unknown>;\n text?: string;\n }\n\n export interface RequiredProps {\n children: React.ReactNode;\n }\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const DSTooltipV3PropTypes: DSPropTypesSchema<DSTooltipV3T.Props> = {\n text: PropTypes.string\n .description(\n 'Tooltip text to be displayed on hover/focus. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.Text),\n textAlign: PropTypes.oneOf(TEXT_ALIGNMENT as unknown as unknown[])\n .description('Tooltip text alignment')\n .defaultValue('left'),\n applyTooltipOverflowWrap: PropTypes.bool\n .description(\n 'when a tooltip is present, the tooltip text may be too long to fit in the pill. If true, the tooltip will wrap to the next line using overflow-wrap',\n )\n .defaultValue(false),\n wrapWords: PropTypes.bool\n .description('Break words into a new line. Useful when words exceed tooltip max-lenght.')\n .defaultValue(false),\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\n portalDOMContainer: PropTypes.oneOfType([PropTypes.node, PropTypes.oneOf([null])])\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n startPlacementPreference: PropTypes.oneOf(PLACEMENT)\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n showPopover: PropTypes.bool.description('Whether or not the tooltip should be always shown'),\n Text: PropTypes.func\n .description(\n 'Custom component (HTML/JSX) to be displayed in the tooltip. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.text),\n textProps: PropTypes.object.description(\n 'Props to be passed to the custom Text component, if provided, used mainly to avoiding inline components definition to improve performance',\n ),\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UAAU;AAAA,EACpH,SAAS,UAAU,KAChB,YAAY,yDAAyD,EACrE,aAAa,UAAU;AAAA,EAC1B,aAAa,UAAU,KAAK,YAAY,mDAAmD;AAAA,EAC3F,MAAM,UAAU,KACb;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,UAAmC,CAAC,MAAM,IAAI;AAAA,EAC/D,WAAW,UAAU,OAAO;AAAA,IAC1B;AAAA,EACF;AACF;AAEO,MAAM,6BAA6B;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,6 @@
1
+ import React from 'react';
1
2
  import type { DSTooltipV3T } from './react-desc-prop-types.js';
2
- declare const DSTooltipV3: {
3
- <T extends DSTooltipV3T.CustomInterface>(props: DSTooltipV3T.Props<T>): import("react/jsx-runtime.js").JSX.Element;
4
- displayName: string;
5
- };
6
- declare const DSTooltipV3WithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSTooltipV3T.Props<Record<string, unknown>>>;
3
+ declare const DSTooltipV3: React.ComponentType<DSTooltipV3T.Props>;
4
+ declare const DSTooltipV3WithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSTooltipV3T.Props>;
7
5
  export { DSTooltipV3, DSTooltipV3WithSchema };
8
6
  export default DSTooltipV3;
@@ -5,8 +5,8 @@ export interface Tooltipv3CTX {
5
5
  xstyledProps: ReturnType<typeof useGetXstyledProps>;
6
6
  instanceUid: string;
7
7
  }
8
- export declare const useTooltipV3: <T extends DSTooltipV3T.CustomInterface>(propsFromUser: DSTooltipV3T.Props<T>) => {
9
- propsWithDefault: DSTooltipV3T.InternalProps<T>;
8
+ export declare const useTooltipV3: (propsFromUser: DSTooltipV3T.Props) => {
9
+ propsWithDefault: DSTooltipV3T.InternalProps;
10
10
  xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
11
11
  instanceUid: string;
12
12
  };
@@ -1,3 +1,3 @@
1
1
  import type { ValidationMap } from '@elliemae/ds-props-helpers';
2
2
  import { type DSTooltipV3T } from '../react-desc-prop-types.js';
3
- export declare const useValidateProps: <T extends DSTooltipV3T.CustomInterface>(props: DSTooltipV3T.InternalProps<T>, propTypes: ValidationMap<unknown>) => void;
3
+ export declare const useValidateProps: (props: DSTooltipV3T.InternalProps, propTypes: ValidationMap<unknown>) => void;
@@ -1,6 +1,5 @@
1
1
  import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';
2
2
  export declare namespace DSTooltipV3T {
3
- type CustomInterface<T extends Record<string, unknown> = Record<string, unknown>> = T;
4
3
  type Placement = 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
5
4
  type TextAlignment = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';
6
5
  interface DefaultProps {
@@ -13,23 +12,23 @@ export declare namespace DSTooltipV3T {
13
12
  applyTooltipOverflowWrap: boolean;
14
13
  customOffset?: [number, number];
15
14
  }
16
- interface OptionalProps<T extends Record<string, unknown> = Record<string, unknown>> {
15
+ interface OptionalProps {
17
16
  withoutPortal?: boolean;
18
17
  withoutArrow?: boolean;
19
18
  withoutAnimation?: boolean;
20
19
  animationDuration?: number;
21
20
  portalDOMContainer?: HTMLElement;
22
21
  showPopover?: boolean;
23
- Text?: React.ComponentType<T>;
24
- textProps?: T;
22
+ Text?: React.ComponentType<Record<string, unknown>>;
23
+ textProps?: Record<string, unknown>;
25
24
  text?: string;
26
25
  }
27
26
  interface RequiredProps {
28
27
  children: React.ReactNode;
29
28
  }
30
- interface InternalProps<T extends CustomInterface = CustomInterface> extends DefaultProps, OptionalProps<T>, RequiredProps {
29
+ interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {
31
30
  }
32
- interface Props<T extends CustomInterface = CustomInterface> extends Partial<DefaultProps>, OptionalProps<T>, RequiredProps {
31
+ interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {
33
32
  }
34
33
  }
35
34
  export declare const DSTooltipV3PropTypes: DSPropTypesSchema<DSTooltipV3T.Props>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-tooltip-v3",
3
- "version": "3.55.0-next.9",
3
+ "version": "3.55.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Tooltip V3",
6
6
  "files": [
@@ -36,11 +36,11 @@
36
36
  "indent": 4
37
37
  },
38
38
  "dependencies": {
39
- "@elliemae/ds-button": "3.55.0-next.9",
40
- "@elliemae/ds-floating-context": "3.55.0-next.9",
41
- "@elliemae/ds-shared": "3.55.0-next.9",
42
- "@elliemae/ds-props-helpers": "3.55.0-next.9",
43
- "@elliemae/ds-system": "3.55.0-next.9"
39
+ "@elliemae/ds-button": "3.55.2",
40
+ "@elliemae/ds-floating-context": "3.55.2",
41
+ "@elliemae/ds-props-helpers": "3.55.2",
42
+ "@elliemae/ds-shared": "3.55.2",
43
+ "@elliemae/ds-system": "3.55.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@elliemae/pui-cli": "9.0.0-next.65",
@@ -48,9 +48,9 @@
48
48
  "react": "^18.3.1",
49
49
  "react-dom": "^18.3.1",
50
50
  "styled-components": "~5.3.9",
51
- "@elliemae/ds-grid": "3.55.0-next.9",
52
- "@elliemae/ds-monorepo-devops": "3.55.0-next.9",
53
- "@elliemae/ds-test-utils": "3.55.0-next.9"
51
+ "@elliemae/ds-grid": "3.55.2",
52
+ "@elliemae/ds-test-utils": "3.55.2",
53
+ "@elliemae/ds-monorepo-devops": "3.55.2"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "react": "^18.3.1",