@elliemae/ds-pills-v2 3.57.0-rc.2 → 3.60.0-next.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.
Files changed (144) hide show
  1. package/dist/cjs/components/Pill.js +3 -3
  2. package/dist/cjs/components/Pill.js.map +2 -2
  3. package/dist/cjs/components/index.js +0 -2
  4. package/dist/cjs/components/index.js.map +2 -2
  5. package/dist/cjs/components/styled.js +29 -10
  6. package/dist/cjs/components/styled.js.map +3 -3
  7. package/dist/cjs/components/types/DropdownPill.js +2 -2
  8. package/dist/cjs/components/types/DropdownPill.js.map +2 -2
  9. package/dist/cjs/components/types/InputPill.js +2 -2
  10. package/dist/cjs/components/types/InputPill.js.map +2 -2
  11. package/dist/cjs/components/types/LabelOnlyPill.js +8 -4
  12. package/dist/cjs/components/types/LabelOnlyPill.js.map +2 -2
  13. package/dist/cjs/components/types/LabelPill.js +8 -4
  14. package/dist/cjs/components/types/LabelPill.js.map +2 -2
  15. package/dist/cjs/components/types/MenuButtonPill.js +60 -57
  16. package/dist/cjs/components/types/MenuButtonPill.js.map +3 -3
  17. package/dist/cjs/components/types/ReadOnlyPill.js +31 -29
  18. package/dist/cjs/components/types/ReadOnlyPill.js.map +2 -2
  19. package/dist/cjs/components/types/RemovablePill.js +78 -76
  20. package/dist/cjs/components/types/RemovablePill.js.map +2 -2
  21. package/dist/cjs/components/types/ValuePill.js +9 -5
  22. package/dist/cjs/components/types/ValuePill.js.map +2 -2
  23. package/dist/cjs/constants/index.js +51 -0
  24. package/dist/cjs/constants/index.js.map +7 -0
  25. package/dist/cjs/index.js +14 -9
  26. package/dist/cjs/index.js.map +2 -2
  27. package/dist/cjs/package.json +4 -1
  28. package/dist/cjs/{components/PillButton.js → parts/DSPillButton/DSPillButton.js} +15 -16
  29. package/dist/cjs/parts/DSPillButton/DSPillButton.js.map +7 -0
  30. package/dist/cjs/parts/DSPillButton/config/usePillButton.js +53 -0
  31. package/dist/cjs/parts/DSPillButton/config/usePillButton.js.map +7 -0
  32. package/dist/cjs/parts/DSPillButton/config/useValidateProps.js +40 -0
  33. package/dist/cjs/parts/DSPillButton/config/useValidateProps.js.map +7 -0
  34. package/dist/cjs/parts/DSPillButton/constants/index.js +48 -0
  35. package/dist/cjs/parts/DSPillButton/constants/index.js.map +7 -0
  36. package/dist/cjs/parts/DSPillButton/index.js +40 -0
  37. package/dist/cjs/parts/DSPillButton/index.js.map +7 -0
  38. package/dist/cjs/parts/DSPillButton/react-desc-prop-types.js +58 -0
  39. package/dist/cjs/parts/DSPillButton/react-desc-prop-types.js.map +7 -0
  40. package/dist/cjs/parts/DSPillGroup/DSPillGroup.js +69 -0
  41. package/dist/cjs/parts/DSPillGroup/DSPillGroup.js.map +7 -0
  42. package/dist/cjs/{DSPillDefinitions.js → parts/DSPillGroup/PillGroupCTX.js} +10 -10
  43. package/dist/cjs/parts/DSPillGroup/PillGroupCTX.js.map +7 -0
  44. package/dist/cjs/{components/PillGroup.js → parts/DSPillGroup/config/usePillGroup.js} +35 -37
  45. package/dist/cjs/parts/DSPillGroup/config/usePillGroup.js.map +7 -0
  46. package/dist/cjs/parts/DSPillGroup/config/useValidateProps.js +40 -0
  47. package/dist/cjs/parts/DSPillGroup/config/useValidateProps.js.map +7 -0
  48. package/dist/cjs/parts/DSPillGroup/constants/index.js +45 -0
  49. package/dist/cjs/parts/DSPillGroup/constants/index.js.map +7 -0
  50. package/dist/cjs/parts/DSPillGroup/index.js +42 -0
  51. package/dist/cjs/parts/DSPillGroup/index.js.map +7 -0
  52. package/dist/cjs/parts/DSPillGroup/react-desc-prop-types.js +52 -0
  53. package/dist/cjs/parts/DSPillGroup/react-desc-prop-types.js.map +7 -0
  54. package/dist/cjs/react-desc-prop-types.js +2 -35
  55. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  56. package/dist/cjs/typescript-testing/typescript-pills-v2-valid.js.map +2 -2
  57. package/dist/esm/components/Pill.js +1 -1
  58. package/dist/esm/components/Pill.js.map +1 -1
  59. package/dist/esm/components/index.js +0 -2
  60. package/dist/esm/components/index.js.map +2 -2
  61. package/dist/esm/components/styled.js +29 -10
  62. package/dist/esm/components/styled.js.map +2 -2
  63. package/dist/esm/components/types/DropdownPill.js +1 -1
  64. package/dist/esm/components/types/DropdownPill.js.map +1 -1
  65. package/dist/esm/components/types/InputPill.js +1 -1
  66. package/dist/esm/components/types/InputPill.js.map +1 -1
  67. package/dist/esm/components/types/LabelOnlyPill.js +8 -4
  68. package/dist/esm/components/types/LabelOnlyPill.js.map +2 -2
  69. package/dist/esm/components/types/LabelPill.js +8 -4
  70. package/dist/esm/components/types/LabelPill.js.map +2 -2
  71. package/dist/esm/components/types/MenuButtonPill.js +60 -57
  72. package/dist/esm/components/types/MenuButtonPill.js.map +2 -2
  73. package/dist/esm/components/types/ReadOnlyPill.js +31 -29
  74. package/dist/esm/components/types/ReadOnlyPill.js.map +2 -2
  75. package/dist/esm/components/types/RemovablePill.js +78 -76
  76. package/dist/esm/components/types/RemovablePill.js.map +2 -2
  77. package/dist/esm/components/types/ValuePill.js +9 -5
  78. package/dist/esm/components/types/ValuePill.js.map +2 -2
  79. package/dist/esm/constants/index.js +21 -0
  80. package/dist/esm/constants/index.js.map +7 -0
  81. package/dist/esm/index.js +8 -10
  82. package/dist/esm/index.js.map +2 -2
  83. package/dist/esm/package.json +4 -1
  84. package/dist/esm/{components/PillButton.js → parts/DSPillButton/DSPillButton.js} +12 -13
  85. package/dist/esm/parts/DSPillButton/DSPillButton.js.map +7 -0
  86. package/dist/esm/parts/DSPillButton/config/usePillButton.js +23 -0
  87. package/dist/esm/parts/DSPillButton/config/usePillButton.js.map +7 -0
  88. package/dist/esm/parts/DSPillButton/config/useValidateProps.js +10 -0
  89. package/dist/esm/parts/DSPillButton/config/useValidateProps.js.map +7 -0
  90. package/dist/esm/parts/DSPillButton/constants/index.js +18 -0
  91. package/dist/esm/parts/DSPillButton/constants/index.js.map +7 -0
  92. package/dist/esm/parts/DSPillButton/index.js +10 -0
  93. package/dist/esm/parts/DSPillButton/index.js.map +7 -0
  94. package/dist/esm/parts/DSPillButton/react-desc-prop-types.js +33 -0
  95. package/dist/esm/parts/DSPillButton/react-desc-prop-types.js.map +7 -0
  96. package/dist/esm/parts/DSPillGroup/DSPillGroup.js +39 -0
  97. package/dist/esm/parts/DSPillGroup/DSPillGroup.js.map +7 -0
  98. package/dist/esm/parts/DSPillGroup/PillGroupCTX.js +10 -0
  99. package/dist/esm/parts/DSPillGroup/PillGroupCTX.js.map +7 -0
  100. package/dist/esm/parts/DSPillGroup/config/usePillGroup.js +74 -0
  101. package/dist/esm/parts/DSPillGroup/config/usePillGroup.js.map +7 -0
  102. package/dist/esm/parts/DSPillGroup/config/useValidateProps.js +10 -0
  103. package/dist/esm/parts/DSPillGroup/config/useValidateProps.js.map +7 -0
  104. package/dist/esm/parts/DSPillGroup/constants/index.js +15 -0
  105. package/dist/esm/parts/DSPillGroup/constants/index.js.map +7 -0
  106. package/dist/esm/parts/DSPillGroup/index.js +12 -0
  107. package/dist/esm/parts/DSPillGroup/index.js.map +7 -0
  108. package/dist/esm/parts/DSPillGroup/react-desc-prop-types.js +27 -0
  109. package/dist/esm/parts/DSPillGroup/react-desc-prop-types.js.map +7 -0
  110. package/dist/esm/react-desc-prop-types.js +8 -36
  111. package/dist/esm/react-desc-prop-types.js.map +2 -2
  112. package/dist/esm/typescript-testing/typescript-pills-v2-valid.js.map +2 -2
  113. package/dist/types/components/index.d.ts +0 -2
  114. package/dist/types/constants/index.d.ts +14 -0
  115. package/dist/types/index.d.ts +4 -2
  116. package/dist/types/{components/PillButton.d.ts → parts/DSPillButton/DSPillButton.d.ts} +3 -3
  117. package/dist/types/parts/DSPillButton/config/usePillButton.d.ts +9 -0
  118. package/dist/types/parts/DSPillButton/config/useValidateProps.d.ts +3 -0
  119. package/dist/types/parts/DSPillButton/constants/index.d.ts +9 -0
  120. package/dist/types/parts/DSPillButton/index.d.ts +2 -0
  121. package/dist/types/parts/DSPillButton/react-desc-prop-types.d.ts +24 -0
  122. package/dist/types/parts/DSPillButton/tests/DSPillButton.test.d.ts +1 -0
  123. package/dist/types/parts/DSPillGroup/DSPillGroup.d.ts +5 -0
  124. package/dist/types/parts/DSPillGroup/PillGroupCTX.d.ts +4 -0
  125. package/dist/types/parts/DSPillGroup/config/usePillGroup.d.ts +386 -0
  126. package/dist/types/parts/DSPillGroup/config/useValidateProps.d.ts +3 -0
  127. package/dist/types/parts/DSPillGroup/constants/index.d.ts +9 -0
  128. package/dist/types/parts/DSPillGroup/index.d.ts +3 -0
  129. package/dist/types/parts/DSPillGroup/react-desc-prop-types.d.ts +21 -0
  130. package/dist/types/parts/DSPillGroup/tests/DSPillGroup.test.d.ts +1 -0
  131. package/dist/types/react-desc-prop-types.d.ts +2 -7
  132. package/dist/types/tests/DSPill.exports.test.d.ts +1 -0
  133. package/dist/types/tests/DSPill.get-owner-props.test.d.ts +1 -0
  134. package/package.json +15 -15
  135. package/dist/cjs/DSPillDefinitions.js.map +0 -7
  136. package/dist/cjs/components/PillButton.js.map +0 -7
  137. package/dist/cjs/components/PillGroup.js.map +0 -7
  138. package/dist/esm/DSPillDefinitions.js +0 -10
  139. package/dist/esm/DSPillDefinitions.js.map +0 -7
  140. package/dist/esm/components/PillButton.js.map +0 -7
  141. package/dist/esm/components/PillGroup.js +0 -76
  142. package/dist/esm/components/PillGroup.js.map +0 -7
  143. package/dist/types/DSPillDefinitions.d.ts +0 -3
  144. package/dist/types/components/PillGroup.d.ts +0 -9
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/types/MenuButtonPill.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable react/prop-types */\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { type DSMenuButtonT } from '@elliemae/ds-menu-button';\nimport React, { useMemo } from 'react';\nimport { uid } from 'uid';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\nimport { DSPillButtonDefaultProps } from '../../react-desc-prop-types.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledDropdownPillWrapper, StyledPillMenuButton } from '../styled.js';\n\n/* ************************************************************************************************************\n* Regarding magic numbers, default width and height and why this is different from \"StyledPillButton\" implementation\n* 1 - StyledPillButton is based on DSButtonV2\n* StyledPillMenuButton is based on DSMenuButton (which is DSButtonV3)\n* DSButtonV2 and DSButtonV3 have different stylings.\n* 2 - as per \"commonPillWrapperCss\" in \"styled.js\" (relevant code at comment writing time is below)\nconst commonPillWrapperCss = css<{ pillSize: 'm' | 's'; disabled?: boolean; applyAriaDisabled?: boolean }>`\n height: ${(props) => (props?.pillSize === 'm' ? '1.846rem' : '1.3846rem')};\n @media (max-width: ${(props) => props.theme.breakpoints?.small}) {\n height: ${(props) => (props?.pillSize === 'm' ? '1.5rem' : '1.125rem')};\n }\n [...]\n`\n* The Wrapper is setting an height to the whole pill based on the prop \"pillSize\" (which corresponds to \"size\" in the component)\n* the \"magic\" values are actually 24px RT for \"m\" and 18px RT for \"s\"\n***************************************************************************************************************\n* Given the above, this iteration of StyledDropdownPillWrapper needs to have different styles/cols/rows to accomodate DSButtonV3\n* and I'm basing the styles on the same assumptions for width/height magic values.\n************************************************************************************************************* */\nconst rowsForDsButtonV3 = (size: 'm' | 's') =>\n size === 'm' ? { small: ['1.5rem'], medium: ['1.846rem'] } : { small: ['1.125rem'], medium: ['1.3846rem'] };\nconst colsForDsButtonV3 = (size: 'm' | 's') =>\n size === 'm'\n ? { small: ['auto', 'minmax(1.5rem, auto)'], medium: ['auto', 'minmax(1.846rem, auto)'] }\n : { small: ['auto', 'minmax(1.125rem, auto)'], medium: ['auto', 'minmax(1.3846rem, auto)'] };\n\nexport const MenuButtonPill = React.memo<DSPillT.InternalProps>(\n ({ label, size, labelTruncated, innerRef, ariaLabel, menuButtonProps }) => {\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n if (!menuButtonProps) {\n // eslint-disable-next-line no-console\n console.log('menuButtonProps', menuButtonProps);\n throw new Error('menuButtonProps was not provided');\n }\n if (Object.keys(menuButtonProps).length === 0) {\n // eslint-disable-next-line no-console\n console.log('menuButtonProps', menuButtonProps);\n throw new Error('menuButtonProps is empty');\n }\n const { width = DSPillButtonDefaultProps.width, height = DSPillButtonDefaultProps.height } = menuButtonProps;\n\n const memoizedRows = useMemo(() => rowsForDsButtonV3(size), [size]);\n const memoizedCols = useMemo(() => colsForDsButtonV3(size), [size]);\n const dsMenubuttonRootProps = useMemo(\n () => ({\n width: `${width}`,\n height: `${height}`,\n }),\n [height, width],\n );\n\n const finalAriaLabel = ariaLabel || label;\n\n return (\n <StyledDropdownPillWrapper\n pillSize={size}\n id={pillUid}\n className=\"ds-pill-wrapper ds-pill-wrapper-dropdown\"\n data-testid=\"ds-pill-wrapper\"\n cols={memoizedCols}\n rows={memoizedRows}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n >\n <TextComponent labelTruncated={labelTruncated} label={label} />\n <StyledPillMenuButton\n innerRef={innerRef as DSMenuButtonT.Props['innerRef']}\n aria-label={finalAriaLabel}\n dsMenubuttonRoot={dsMenubuttonRootProps}\n {...menuButtonProps}\n // the styles that makes the circle visual behave correctly in \"circle\"/\"square\"/\"pill group\"\n // are based on the button having the following props:\n data-testid=\"ds-pill-menu-button-chevron\"\n buttonType=\"raw\"\n className=\"ds-pill-button-right ds-pill-focus-point\"\n type=\"button\"\n width={`${width}`}\n height={`${height}`}\n // end of props for correcr circle/square/pill group visual behavior\n >\n <ChevronSmallDown color={['brand-primary', '800']} />\n </StyledPillMenuButton>\n </StyledDropdownPillWrapper>\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgEjB;AA/DN,sBAAiC;AAEjC,mBAA+B;AAC/B,iBAAoB;AAEpB,mCAAyC;AACzC,2BAA8B;AAC9B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IAAI;AAAA,QACJ,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,QAAO;AAAA,QACP,YAAW;AAAA,QACX,cAAa;AAAA,QAEb;AAAA,sDAAC,sCAAc,gBAAgC,OAAc;AAAA,UAC7D;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,cAAY;AAAA,cACZ,kBAAkB;AAAA,cACjB,GAAG;AAAA,cAGJ,eAAY;AAAA,cACZ,YAAW;AAAA,cACX,WAAU;AAAA,cACV,MAAK;AAAA,cACL,OAAO,GAAG,KAAK;AAAA,cACf,QAAQ,GAAG,MAAM;AAAA,cAGjB,sDAAC,oCAAiB,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,UACrD;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;",
6
- "names": ["React"]
4
+ "sourcesContent": ["/* eslint-disable react/prop-types */\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { type DSMenuButtonT } from '@elliemae/ds-menu-button';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useMemo } from 'react';\nimport { uid } from 'uid';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\nimport { defaultProps as DSPillButtonDefaultProps } from '../../parts/DSPillButton/react-desc-prop-types.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledDropdownPillWrapper, StyledPillMenuButton } from '../styled.js';\n\n/* ************************************************************************************************************\n* Regarding magic numbers, default width and height and why this is different from \"StyledPillButton\" implementation\n* 1 - StyledPillButton is based on DSButtonV2\n* StyledPillMenuButton is based on DSMenuButton (which is DSButtonV3)\n* DSButtonV2 and DSButtonV3 have different stylings.\n* 2 - as per \"commonPillWrapperCss\" in \"styled.js\" (relevant code at comment writing time is below)\nconst commonPillWrapperCss = css<{ pillSize: 'm' | 's'; disabled?: boolean; applyAriaDisabled?: boolean }>`\n height: ${(props) => (props?.pillSize === 'm' ? '1.846rem' : '1.3846rem')};\n @media (max-width: ${(props) => props.theme.breakpoints?.small}) {\n height: ${(props) => (props?.pillSize === 'm' ? '1.5rem' : '1.125rem')};\n }\n [...]\n`\n* The Wrapper is setting an height to the whole pill based on the prop \"pillSize\" (which corresponds to \"size\" in the component)\n* the \"magic\" values are actually 24px RT for \"m\" and 18px RT for \"s\"\n***************************************************************************************************************\n* Given the above, this iteration of StyledDropdownPillWrapper needs to have different styles/cols/rows to accomodate DSButtonV3\n* and I'm basing the styles on the same assumptions for width/height magic values.\n************************************************************************************************************* */\nconst rowsForDsButtonV3 = (size: 'm' | 's') =>\n size === 'm' ? { small: ['1.5rem'], medium: ['1.846rem'] } : { small: ['1.125rem'], medium: ['1.3846rem'] };\nconst colsForDsButtonV3 = (size: 'm' | 's') =>\n size === 'm'\n ? { small: ['auto', 'minmax(1.5rem, auto)'], medium: ['auto', 'minmax(1.846rem, auto)'] }\n : { small: ['auto', 'minmax(1.125rem, auto)'], medium: ['auto', 'minmax(1.3846rem, auto)'] };\n\nexport const MenuButtonPill = React.memo<DSPillT.InternalProps>((props) => {\n const { label, size, labelTruncated, innerRef, ariaLabel, menuButtonProps } = props;\n const ownerProps = useOwnerProps(props);\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n if (!menuButtonProps) {\n // eslint-disable-next-line no-console\n console.log('menuButtonProps', menuButtonProps);\n throw new Error('menuButtonProps was not provided');\n }\n if (Object.keys(menuButtonProps).length === 0) {\n // eslint-disable-next-line no-console\n console.log('menuButtonProps', menuButtonProps);\n throw new Error('menuButtonProps is empty');\n }\n const { width = DSPillButtonDefaultProps.width, height = DSPillButtonDefaultProps.height } = menuButtonProps;\n\n const memoizedRows = useMemo(() => rowsForDsButtonV3(size), [size]);\n const memoizedCols = useMemo(() => colsForDsButtonV3(size), [size]);\n const dsMenubuttonRootProps = useMemo(\n () => ({\n width: `${width}`,\n height: `${height}`,\n }),\n [height, width],\n );\n\n const finalAriaLabel = ariaLabel || label;\n\n return (\n <StyledDropdownPillWrapper\n pillSize={size}\n id={pillUid}\n className=\"ds-pill-wrapper ds-pill-wrapper-dropdown\"\n data-testid=\"ds-pill-wrapper\"\n cols={memoizedCols}\n rows={memoizedRows}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n {...ownerProps}\n >\n <TextComponent labelTruncated={labelTruncated} label={label} />\n <StyledPillMenuButton\n innerRef={innerRef as DSMenuButtonT.Props['innerRef']}\n aria-label={finalAriaLabel}\n dsMenubuttonRoot={dsMenubuttonRootProps}\n {...menuButtonProps}\n // the styles that makes the circle visual behave correctly in \"circle\"/\"square\"/\"pill group\"\n // are based on the button having the following props:\n data-testid=\"ds-pill-menu-button-chevron\"\n buttonType=\"raw\"\n className=\"ds-pill-button-right ds-pill-focus-point\"\n type=\"button\"\n width={`${width}`}\n height={`${height}`}\n // end of props for correcr circle/square/pill group visual behavior\n {...ownerProps}\n >\n <ChevronSmallDown color={['brand-primary', '800']} />\n </StyledPillMenuButton>\n </StyledDropdownPillWrapper>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkEnB;AAjEJ,sBAAiC;AAEjC,8BAA8B;AAC9B,mBAA+B;AAC/B,iBAAoB;AAEpB,mCAAyD;AACzD,2BAA8B;AAC9B,oBAAgE;AAqBhE,MAAM,oBAAoB,CAAC,SACzB,SAAS,MAAM,EAAE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC,WAAW,EAAE;AAC5G,MAAM,oBAAoB,CAAC,SACzB,SAAS,MACL,EAAE,OAAO,CAAC,QAAQ,sBAAsB,GAAG,QAAQ,CAAC,QAAQ,wBAAwB,EAAE,IACtF,EAAE,OAAO,CAAC,QAAQ,wBAAwB,GAAG,QAAQ,CAAC,QAAQ,yBAAyB,EAAE;AAExF,MAAM,i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;AAAA,YACX,WAAU;AAAA,YACV,MAAK;AAAA,YACL,OAAO,GAAG,KAAK;AAAA,YACf,QAAQ,GAAG,MAAM;AAAA,YAEhB,GAAG;AAAA,YAEJ,sDAAC,oCAAiB,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,QACrD;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;",
6
+ "names": ["React", "DSPillButtonDefaultProps"]
7
7
  }
@@ -33,36 +33,38 @@ __export(ReadOnlyPill_exports, {
33
33
  module.exports = __toCommonJS(ReadOnlyPill_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
37
  var import_react = __toESM(require("react"));
37
38
  var import_TextComponent = require("../TextComponent.js");
38
39
  var import_styled = require("../styled.js");
39
- const ReadOnlyPill = import_react.default.memo(
40
- ({ label, size, labelTruncated, iconLeft, iconRight, ariaLabel, IconLeft, IconRight }) => {
41
- const hasIconLeft = iconLeft !== null || iconRight !== null && label === "";
42
- const hasIconRight = iconRight !== null || iconLeft !== null && label === "";
43
- const hasIconLeftNew = IconLeft !== null || IconRight !== null && label === "";
44
- const hasIconRightNew = IconRight !== null || IconLeft !== null && label === "";
45
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
46
- import_styled.StyledReadonlyPillWrapper,
47
- {
48
- pillSize: size,
49
- alignItems: "center",
50
- className: "ds-pill-wrapper ds-pill-wrapper-readonly",
51
- "data-testid": "ds-pill-wrapper",
52
- "data-label": ariaLabel || label,
53
- cols: [(iconLeft || IconLeft) && "min-content", label && "auto", (iconRight || IconRight) && "min-content"].filter(
54
- (notFalse) => notFalse
55
- ),
56
- gutter: "xxxs",
57
- hasIconRight: hasIconRight || hasIconRightNew,
58
- hasIconLeft: hasIconLeft || hasIconLeftNew,
59
- children: [
60
- IconLeft ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconLeft, { label }) : iconLeft,
61
- label ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextComponent.TextComponent, { labelTruncated, label }) : null,
62
- IconRight ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconRight, { label }) : iconRight
63
- ]
64
- }
65
- );
66
- }
67
- );
40
+ const ReadOnlyPill = import_react.default.memo((props) => {
41
+ const { label, size, labelTruncated, iconLeft, iconRight, ariaLabel, IconLeft, IconRight } = props;
42
+ const ownerProps = (0, import_ds_props_helpers.useOwnerProps)(props);
43
+ const hasIconLeft = iconLeft !== null || iconRight !== null && label === "";
44
+ const hasIconRight = iconRight !== null || iconLeft !== null && label === "";
45
+ const hasIconLeftNew = IconLeft !== null || IconRight !== null && label === "";
46
+ const hasIconRightNew = IconRight !== null || IconLeft !== null && label === "";
47
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
48
+ import_styled.StyledReadonlyPillWrapper,
49
+ {
50
+ pillSize: size,
51
+ alignItems: "center",
52
+ className: "ds-pill-wrapper ds-pill-wrapper-readonly",
53
+ "data-testid": "ds-pill-wrapper",
54
+ "data-label": ariaLabel || label,
55
+ cols: [(iconLeft || IconLeft) && "min-content", label && "auto", (iconRight || IconRight) && "min-content"].filter(
56
+ (notFalse) => notFalse
57
+ ),
58
+ gutter: "xxxs",
59
+ hasIconRight: hasIconRight || hasIconRightNew,
60
+ hasIconLeft: hasIconLeft || hasIconLeftNew,
61
+ ...ownerProps,
62
+ children: [
63
+ IconLeft ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconLeft, { label }) : iconLeft,
64
+ label ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextComponent.TextComponent, { labelTruncated, label }) : null,
65
+ IconRight ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconRight, { label }) : iconRight
66
+ ]
67
+ }
68
+ );
69
+ });
68
70
  //# sourceMappingURL=ReadOnlyPill.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/types/ReadOnlyPill.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable complexity */\nimport React from 'react';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledReadonlyPillWrapper } from '../styled.js';\n\nexport const ReadOnlyPill = React.memo<DSPillT.InternalProps>(\n ({ label, size, labelTruncated, iconLeft, iconRight, ariaLabel, IconLeft, IconRight }) => {\n const hasIconLeft = iconLeft !== null || (iconRight !== null && label === '');\n const hasIconRight = iconRight !== null || (iconLeft !== null && label === '');\n\n const hasIconLeftNew = IconLeft !== null || (IconRight !== null && label === '');\n const hasIconRightNew = IconRight !== null || (IconLeft !== null && label === '');\n\n return (\n <StyledReadonlyPillWrapper\n pillSize={size}\n alignItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-readonly\"\n data-testid=\"ds-pill-wrapper\"\n data-label={ariaLabel || label}\n cols={\n [(iconLeft || IconLeft) && 'min-content', label && 'auto', (iconRight || IconRight) && 'min-content'].filter(\n (notFalse) => notFalse,\n ) as string[]\n }\n gutter=\"xxxs\"\n hasIconRight={hasIconRight || hasIconRightNew}\n hasIconLeft={hasIconLeft || hasIconLeftNew}\n >\n {IconLeft ? <IconLeft label={label} /> : iconLeft}\n {label ? <TextComponent labelTruncated={labelTruncated} label={label} /> : null}\n {IconRight ? <IconRight label={label} /> : iconRight}\n </StyledReadonlyPillWrapper>\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADejB;AAdN,mBAAkB;AAElB,2BAA8B;AAC9B,oBAA0C;AAEnC,MAAM,eAAe,aAAAA,QAAM;AAAA,EAChC,CAAC,EAAE,OAAO,MAAM,gBAAgB,UAAU,WAAW,WAAW,UAAU,UAAU,MAAM;AACxF,UAAM,cAAc,aAAa,QAAS,cAAc,QAAQ,UAAU;AAC1E,UAAM,eAAe,cAAc,QAAS,aAAa,QAAQ,UAAU;AAE3E,UAAM,iBAAiB,aAAa,QAAS,cAAc,QAAQ,UAAU;AAC7E,UAAM,kBAAkB,cAAc,QAAS,aAAa,QAAQ,UAAU;AAE9E,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV,YAAW;AAAA,QACX,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,cAAY,aAAa;AAAA,QACzB,MACE,EAAE,YAAY,aAAa,eAAe,SAAS,SAAS,aAAa,cAAc,aAAa,EAAE;AAAA,UACpG,CAAC,aAAa;AAAA,QAChB;AAAA,QAEF,QAAO;AAAA,QACP,cAAc,gBAAgB;AAAA,QAC9B,aAAa,eAAe;AAAA,QAE3B;AAAA,qBAAW,4CAAC,YAAS,OAAc,IAAK;AAAA,UACxC,QAAQ,4CAAC,sCAAc,gBAAgC,OAAc,IAAK;AAAA,UAC1E,YAAY,4CAAC,aAAU,OAAc,IAAK;AAAA;AAAA;AAAA,IAC7C;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["/* eslint-disable complexity */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledReadonlyPillWrapper } from '../styled.js';\n\nexport const ReadOnlyPill = React.memo<DSPillT.InternalProps>((props) => {\n const { label, size, labelTruncated, iconLeft, iconRight, ariaLabel, IconLeft, IconRight } = props;\n const ownerProps = useOwnerProps(props);\n const hasIconLeft = iconLeft !== null || (iconRight !== null && label === '');\n const hasIconRight = iconRight !== null || (iconLeft !== null && label === '');\n\n const hasIconLeftNew = IconLeft !== null || (IconRight !== null && label === '');\n const hasIconRightNew = IconRight !== null || (IconLeft !== null && label === '');\n\n return (\n <StyledReadonlyPillWrapper\n pillSize={size}\n alignItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-readonly\"\n data-testid=\"ds-pill-wrapper\"\n data-label={ariaLabel || label}\n cols={\n [(iconLeft || IconLeft) && 'min-content', label && 'auto', (iconRight || IconRight) && 'min-content'].filter(\n (notFalse) => notFalse,\n ) as string[]\n }\n gutter=\"xxxs\"\n hasIconRight={hasIconRight || hasIconRightNew}\n hasIconLeft={hasIconLeft || hasIconLeftNew}\n {...ownerProps}\n >\n {IconLeft ? <IconLeft label={label} /> : iconLeft}\n {label ? <TextComponent labelTruncated={labelTruncated} label={label} /> : null}\n {IconRight ? <IconRight label={label} /> : iconRight}\n </StyledReadonlyPillWrapper>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiBnB;AAhBJ,8BAA8B;AAC9B,mBAAkB;AAElB,2BAA8B;AAC9B,oBAA0C;AAEnC,MAAM,eAAe,aAAAA,QAAM,KAA4B,CAAC,UAAU;AACvE,QAAM,EAAE,OAAO,MAAM,gBAAgB,UAAU,WAAW,WAAW,UAAU,UAAU,IAAI;AAC7F,QAAM,iBAAa,uCAAc,KAAK;AACtC,QAAM,cAAc,aAAa,QAAS,cAAc,QAAQ,UAAU;AAC1E,QAAM,eAAe,cAAc,QAAS,aAAa,QAAQ,UAAU;AAE3E,QAAM,iBAAiB,aAAa,QAAS,cAAc,QAAQ,UAAU;AAC7E,QAAM,kBAAkB,cAAc,QAAS,aAAa,QAAQ,UAAU;AAE9E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV,YAAW;AAAA,MACX,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,cAAY,aAAa;AAAA,MACzB,MACE,EAAE,YAAY,aAAa,eAAe,SAAS,SAAS,aAAa,cAAc,aAAa,EAAE;AAAA,QACpG,CAAC,aAAa;AAAA,MAChB;AAAA,MAEF,QAAO;AAAA,MACP,cAAc,gBAAgB;AAAA,MAC9B,aAAa,eAAe;AAAA,MAC3B,GAAG;AAAA,MAEH;AAAA,mBAAW,4CAAC,YAAS,OAAc,IAAK;AAAA,QACxC,QAAQ,4CAAC,sCAAc,gBAAgC,OAAc,IAAK;AAAA,QAC1E,YAAY,4CAAC,aAAU,OAAc,IAAK;AAAA;AAAA;AAAA,EAC7C;AAEJ,CAAC;",
6
6
  "names": ["React"]
7
7
  }
@@ -36,84 +36,86 @@ var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_ds_icons = require("@elliemae/ds-icons");
37
37
  var import_react = __toESM(require("react"));
38
38
  var import_uid = require("uid");
39
- var import_PillButton = require("../PillButton.js");
40
- var import_PillGroup = require("../PillGroup.js");
39
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
40
+ var import_DSPillButton = require("../../parts/DSPillButton/DSPillButton.js");
41
+ var import_DSPillGroup = require("../../parts/DSPillGroup/index.js");
41
42
  var import_TextComponent = require("../TextComponent.js");
42
43
  var import_styled = require("../styled.js");
43
- const RemovablePill = import_react.default.memo(
44
- ({ label, size, disabled, labelTruncated, onRemove, innerRef, ariaLabel, tabIndex, applyAriaDisabled }) => {
45
- const { onKeyboardRemove, onKeyboardNavigation } = (0, import_react.useContext)(import_PillGroup.DSPillGroupV2Context);
46
- const pillUid = (0, import_react.useMemo)(() => `ds-pill-${(0, import_uid.uid)()}`, []);
47
- const onKeyDown = (0, import_react.useCallback)(
48
- (e) => {
49
- if (["Enter", "Space"].includes(e.code)) {
50
- if (applyAriaDisabled) return;
51
- e.preventDefault();
52
- if (onKeyboardRemove) onKeyboardRemove(pillUid);
53
- }
54
- if (e.code === "ArrowLeft") {
55
- e.preventDefault();
56
- if (onKeyboardNavigation) onKeyboardNavigation(pillUid, -1, e);
57
- }
58
- if (e.code === "ArrowRight") {
59
- e.preventDefault();
60
- if (onKeyboardNavigation) onKeyboardNavigation(pillUid, 1, e);
61
- }
62
- },
63
- [onKeyboardRemove, onKeyboardNavigation, pillUid, applyAriaDisabled]
64
- );
65
- const handleOnRemove = (0, import_react.useCallback)(
66
- (e) => {
44
+ const RemovablePill = import_react.default.memo((props) => {
45
+ const { label, size, disabled, labelTruncated, onRemove, innerRef, ariaLabel, tabIndex, applyAriaDisabled } = props;
46
+ const { onKeyboardRemove, onKeyboardNavigation } = (0, import_react.useContext)(import_DSPillGroup.DSPillGroupV2Context);
47
+ const pillUid = (0, import_react.useMemo)(() => `ds-pill-${(0, import_uid.uid)()}`, []);
48
+ const ownerProps = (0, import_ds_props_helpers.useOwnerProps)(props);
49
+ const onKeyDown = (0, import_react.useCallback)(
50
+ (e) => {
51
+ if (["Enter", "Space"].includes(e.code)) {
67
52
  if (applyAriaDisabled) return;
68
- if (onRemove) onRemove(e);
69
- },
70
- [onRemove, applyAriaDisabled]
71
- );
72
- const colsConfig = (0, import_react.useMemo)(
73
- () => disabled || applyAriaDisabled ? ["auto"] : ["auto", "minmax(24px, auto)"],
74
- [disabled, applyAriaDisabled]
75
- );
76
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
77
- import_styled.StyledRemovablePillWrapper,
78
- {
79
- pillSize: size,
80
- cols: colsConfig,
81
- disabled,
82
- applyAriaDisabled,
83
- gutter: "2px",
84
- alignItems: "center",
85
- justifyItems: "center",
86
- className: "ds-pill-wrapper ds-pill-wrapper-removable",
87
- "data-testid": "ds-pill-wrapper",
88
- "data-label": ariaLabel || label,
89
- children: [
90
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextComponent.TextComponent, { labelTruncated, label }),
91
- !disabled && !applyAriaDisabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
- import_PillButton.DSPillButton,
93
- {
94
- className: "ds-pill-focus-point",
95
- id: pillUid,
96
- "data-testid": "ds-pill-close-icon",
97
- innerRef,
98
- onClick: handleOnRemove,
99
- onKeyDown,
100
- "aria-label": `Remove ${label}`,
101
- type: "right",
102
- tabIndex,
103
- applyAriaDisabled,
104
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
105
- import_ds_icons.CloseXsmall,
106
- {
107
- width: size === "s" ? 18 : 22.65,
108
- height: size === "s" ? 18 : 22.65,
109
- color: ["brand-primary", "700"]
110
- }
111
- )
112
- }
113
- ) : null
114
- ]
53
+ e.preventDefault();
54
+ if (onKeyboardRemove) onKeyboardRemove(pillUid);
115
55
  }
116
- );
117
- }
118
- );
56
+ if (e.code === "ArrowLeft") {
57
+ e.preventDefault();
58
+ if (onKeyboardNavigation) onKeyboardNavigation(pillUid, -1, e);
59
+ }
60
+ if (e.code === "ArrowRight") {
61
+ e.preventDefault();
62
+ if (onKeyboardNavigation) onKeyboardNavigation(pillUid, 1, e);
63
+ }
64
+ },
65
+ [onKeyboardRemove, onKeyboardNavigation, pillUid, applyAriaDisabled]
66
+ );
67
+ const handleOnRemove = (0, import_react.useCallback)(
68
+ (e) => {
69
+ if (applyAriaDisabled) return;
70
+ if (onRemove) onRemove(e);
71
+ },
72
+ [onRemove, applyAriaDisabled]
73
+ );
74
+ const colsConfig = (0, import_react.useMemo)(
75
+ () => disabled || applyAriaDisabled ? ["auto"] : ["auto", "minmax(24px, auto)"],
76
+ [disabled, applyAriaDisabled]
77
+ );
78
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
79
+ import_styled.StyledRemovablePillWrapper,
80
+ {
81
+ pillSize: size,
82
+ cols: colsConfig,
83
+ disabled,
84
+ applyAriaDisabled,
85
+ gutter: "2px",
86
+ alignItems: "center",
87
+ justifyItems: "center",
88
+ className: "ds-pill-wrapper ds-pill-wrapper-removable",
89
+ "data-testid": "ds-pill-wrapper",
90
+ "data-label": ariaLabel || label,
91
+ ...ownerProps,
92
+ children: [
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextComponent.TextComponent, { labelTruncated, label }),
94
+ !disabled && !applyAriaDisabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
+ import_DSPillButton.DSPillButton,
96
+ {
97
+ className: "ds-pill-focus-point",
98
+ id: pillUid,
99
+ "data-testid": "ds-pill-close-icon",
100
+ innerRef,
101
+ onClick: handleOnRemove,
102
+ onKeyDown,
103
+ "aria-label": `Remove ${label}`,
104
+ type: "right",
105
+ tabIndex,
106
+ applyAriaDisabled,
107
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
+ import_ds_icons.CloseXsmall,
109
+ {
110
+ width: size === "s" ? 18 : 22.65,
111
+ height: size === "s" ? 18 : 22.65,
112
+ color: ["brand-primary", "700"]
113
+ }
114
+ )
115
+ }
116
+ ) : null
117
+ ]
118
+ }
119
+ );
120
+ });
119
121
  //# sourceMappingURL=RemovablePill.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/types/RemovablePill.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { CloseXsmall } from '@elliemae/ds-icons';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { uid } from 'uid';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\nimport { DSPillButton } from '../PillButton.js';\nimport { DSPillGroupV2Context } from '../PillGroup.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledRemovablePillWrapper } from '../styled.js';\n\nexport const RemovablePill = React.memo<DSPillT.InternalProps>(\n ({ label, size, disabled, labelTruncated, onRemove, innerRef, ariaLabel, tabIndex, applyAriaDisabled }) => {\n const { onKeyboardRemove, onKeyboardNavigation } = useContext(DSPillGroupV2Context);\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (['Enter', 'Space'].includes(e.code)) {\n if (applyAriaDisabled) return;\n e.preventDefault();\n if (onKeyboardRemove) onKeyboardRemove(pillUid);\n }\n if (e.code === 'ArrowLeft') {\n e.preventDefault();\n if (onKeyboardNavigation) onKeyboardNavigation(pillUid, -1, e);\n }\n if (e.code === 'ArrowRight') {\n e.preventDefault();\n if (onKeyboardNavigation) onKeyboardNavigation(pillUid, 1, e);\n }\n },\n [onKeyboardRemove, onKeyboardNavigation, pillUid, applyAriaDisabled],\n );\n\n const handleOnRemove = useCallback(\n (e: React.KeyboardEvent | React.MouseEvent) => {\n if (applyAriaDisabled) return;\n if (onRemove) onRemove(e);\n },\n [onRemove, applyAriaDisabled],\n );\n\n const colsConfig = useMemo(\n () => (disabled || applyAriaDisabled ? ['auto'] : ['auto', 'minmax(24px, auto)']),\n [disabled, applyAriaDisabled],\n );\n\n return (\n <StyledRemovablePillWrapper\n pillSize={size}\n cols={colsConfig}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-removable\"\n data-testid=\"ds-pill-wrapper\"\n data-label={ariaLabel || label}\n >\n <TextComponent labelTruncated={labelTruncated} label={label} />\n {!disabled && !applyAriaDisabled ? (\n <DSPillButton\n className=\"ds-pill-focus-point\"\n id={pillUid}\n data-testid=\"ds-pill-close-icon\"\n innerRef={innerRef as TypescriptHelpersT.AnyRef<HTMLButtonElement>}\n onClick={handleOnRemove}\n onKeyDown={onKeyDown}\n aria-label={`Remove ${label}`}\n type=\"right\"\n tabIndex={tabIndex}\n applyAriaDisabled={applyAriaDisabled}\n >\n <CloseXsmall\n width={size === 's' ? 18 : 22.65}\n height={size === 's' ? 18 : 22.65}\n color={['brand-primary', '700']}\n />\n </DSPillButton>\n ) : null}\n </StyledRemovablePillWrapper>\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgDjB;AAhDN,sBAA4B;AAE5B,mBAAwD;AACxD,iBAAoB;AAEpB,wBAA6B;AAC7B,uBAAqC;AACrC,2BAA8B;AAC9B,oBAA2C;AAEpC,MAAM,gBAAgB,aAAAA,QAAM;AAAA,EACjC,CAA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,YAAY,CAAC,oBACb;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,IAAI;AAAA,cACJ,eAAY;AAAA,cACZ;AAAA,cACA,SAAS;AAAA,cACT;AAAA,cACA,cAAY,UAAU,KAAK;AAAA,cAC3B,MAAK;AAAA,cACL;AAAA,cACA;AAAA,cAEA;AAAA,gBAAC;AAAA;AAAA,kBACC,OAAO,SAAS,MAAM,KAAK;AAAA,kBAC3B,QAAQ,SAAS,MAAM,KAAK;AAAA,kBAC5B,OAAO,CAAC,iBAAiB,KAAK;AAAA;AAAA,cAChC;AAAA;AAAA,UACF,IACE;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["import { CloseXsmall } from '@elliemae/ds-icons';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { uid } from 'uid';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSPillButton } from '../../parts/DSPillButton/DSPillButton.js';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\n\nimport { DSPillGroupV2Context } from '../../parts/DSPillGroup/index.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledRemovablePillWrapper } from '../styled.js';\n\nexport const RemovablePill = React.memo<DSPillT.InternalProps>((props) => {\n const { label, size, disabled, labelTruncated, onRemove, innerRef, ariaLabel, tabIndex, applyAriaDisabled } = props;\n const { onKeyboardRemove, onKeyboardNavigation } = useContext(DSPillGroupV2Context);\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n const ownerProps = useOwnerProps(props);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (['Enter', 'Space'].includes(e.code)) {\n if (applyAriaDisabled) return;\n e.preventDefault();\n if (onKeyboardRemove) onKeyboardRemove(pillUid);\n }\n if (e.code === 'ArrowLeft') {\n e.preventDefault();\n if (onKeyboardNavigation) onKeyboardNavigation(pillUid, -1, e);\n }\n if (e.code === 'ArrowRight') {\n e.preventDefault();\n if (onKeyboardNavigation) onKeyboardNavigation(pillUid, 1, e);\n }\n },\n [onKeyboardRemove, onKeyboardNavigation, pillUid, applyAriaDisabled],\n );\n\n const handleOnRemove = useCallback(\n (e: React.KeyboardEvent | React.MouseEvent) => {\n if (applyAriaDisabled) return;\n if (onRemove) onRemove(e);\n },\n [onRemove, applyAriaDisabled],\n );\n\n const colsConfig = useMemo(\n () => (disabled || applyAriaDisabled ? ['auto'] : ['auto', 'minmax(24px, auto)']),\n [disabled, applyAriaDisabled],\n );\n\n return (\n <StyledRemovablePillWrapper\n pillSize={size}\n cols={colsConfig}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-removable\"\n data-testid=\"ds-pill-wrapper\"\n data-label={ariaLabel || label}\n {...ownerProps}\n >\n <TextComponent labelTruncated={labelTruncated} label={label} />\n {!disabled && !applyAriaDisabled ? (\n <DSPillButton\n className=\"ds-pill-focus-point\"\n id={pillUid}\n data-testid=\"ds-pill-close-icon\"\n innerRef={innerRef as TypescriptHelpersT.AnyRef<HTMLButtonElement>}\n onClick={handleOnRemove}\n onKeyDown={onKeyDown}\n aria-label={`Remove ${label}`}\n type=\"right\"\n tabIndex={tabIndex}\n applyAriaDisabled={applyAriaDisabled}\n >\n <CloseXsmall\n width={size === 's' ? 18 : 22.65}\n height={size === 's' ? 18 : 22.65}\n color={['brand-primary', '700']}\n />\n </DSPillButton>\n ) : null}\n </StyledRemovablePillWrapper>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmDnB;AAnDJ,sBAA4B;AAE5B,mBAAwD;AACxD,iBAAoB;AACpB,8BAA8B;AAC9B,0BAA6B;AAG7B,yBAAqC;AACrC,2BAA8B;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WAAU;AAAA,MACV,eAAY;AAAA,MACZ,cAAY,aAAa;AAAA,MACxB,GAAG;AAAA,MAEJ;AAAA,oDAAC,sCAAc,gBAAgC,OAAc;AAAA,QAC5D,CAAC,YAAY,CAAC,oBACb;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,IAAI;AAAA,YACJ,eAAY;AAAA,YACZ;AAAA,YACA,SAAS;AAAA,YACT;AAAA,YACA,cAAY,UAAU,KAAK;AAAA,YAC3B,MAAK;AAAA,YACL;AAAA,YACA;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO,SAAS,MAAM,KAAK;AAAA,gBAC3B,QAAQ,SAAS,MAAM,KAAK;AAAA,gBAC5B,OAAO,CAAC,iBAAiB,KAAK;AAAA;AAAA,YAChC;AAAA;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ,CAAC;",
6
6
  "names": ["React"]
7
7
  }
@@ -33,12 +33,13 @@ __export(ValuePill_exports, {
33
33
  module.exports = __toCommonJS(ValuePill_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
37
  var import_ds_tooltip_v3 = require("@elliemae/ds-tooltip-v3");
37
38
  var import_react = __toESM(require("react"));
38
39
  var import_TextComponent = require("../TextComponent.js");
39
40
  var import_styled = require("../styled.js");
40
- const ValuePill = import_react.default.memo(
41
- ({
41
+ const ValuePill = import_react.default.memo((props) => {
42
+ const {
42
43
  label,
43
44
  size,
44
45
  labelTruncated,
@@ -50,7 +51,9 @@ const ValuePill = import_react.default.memo(
50
51
  readOnly,
51
52
  applyTooltipOverflowWrap,
52
53
  trailingComma
53
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
54
+ } = props;
55
+ const ownerProps = (0, import_ds_props_helpers.useOwnerProps)(props);
56
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
54
57
  import_styled.StyledValuePillWrapper,
55
58
  {
56
59
  disabled,
@@ -64,11 +67,12 @@ const ValuePill = import_react.default.memo(
64
67
  "data-label": ariaLabel || label,
65
68
  applyAriaDisabled,
66
69
  readOnly,
70
+ ...ownerProps,
67
71
  children: [
68
72
  iconLeft,
69
73
  tooltipValue !== "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_tooltip_v3.DSTooltipV3, { text: tooltipValue ?? "", applyTooltipOverflowWrap, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSpanWithTooltip, { className: "ds-pill-tooltip-value", "aria-disabled": applyAriaDisabled, tabIndex: 0, children: label }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextComponent.TextComponent, { labelTruncated, label: `${label}${trailingComma ? "," : ""}` })
70
74
  ]
71
75
  }
72
- )
73
- );
76
+ );
77
+ });
74
78
  //# sourceMappingURL=ValuePill.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/types/ValuePill.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { DSTooltipV3 } from '@elliemae/ds-tooltip-v3';\nimport React from 'react';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledSpanWithTooltip, StyledValuePillWrapper } from '../styled.js';\n\nexport const ValuePill = React.memo<DSPillT.InternalProps>(\n ({\n label,\n size,\n labelTruncated,\n disabled,\n tooltipValue,\n iconLeft,\n ariaLabel,\n applyAriaDisabled,\n readOnly,\n applyTooltipOverflowWrap,\n trailingComma,\n }) => (\n <StyledValuePillWrapper\n disabled={disabled}\n pillSize={size}\n alignItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-value\"\n data-testid=\"ds-pill-wrapper\"\n cols={[iconLeft && 'min-content', 'auto'].filter((notFalse) => notFalse) as string[]}\n gutter=\"xxxs\"\n hasIcon={iconLeft !== null}\n data-label={ariaLabel || label}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n >\n {iconLeft}\n {tooltipValue !== '' ? (\n <DSTooltipV3 text={tooltipValue ?? ''} applyTooltipOverflowWrap={applyTooltipOverflowWrap}>\n <StyledSpanWithTooltip className=\"ds-pill-tooltip-value\" aria-disabled={applyAriaDisabled} tabIndex={0}>\n {label}\n </StyledSpanWithTooltip>\n </DSTooltipV3>\n ) : (\n <TextComponent labelTruncated={labelTruncated} label={`${label}${trailingComma ? ',' : ''}`} />\n )}\n </StyledValuePillWrapper>\n ),\n);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoBnB;AApBJ,2BAA4B;AAC5B,mBAAkB;AAElB,2BAA8B;AAC9B,oBAA8D;AAEvD,MAAM,YAAY,aAAAA,QAAM;AAAA,EAC7B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,UAAU;AAAA,MACV,YAAW;AAAA,MACX,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,MAAM,CAAC,YAAY,eAAe,MAAM,EAAE,OAAO,CAAC,aAAa,QAAQ;AAAA,MACvE,QAAO;AAAA,MACP,SAAS,aAAa;AAAA,MACtB,cAAY,aAAa;AAAA,MACzB;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,QACA,iBAAiB,KAChB,4CAAC,oCAAY,MAAM,gBAAgB,IAAI,0BACrC,sDAAC,uCAAsB,WAAU,yBAAwB,iBAAe,mBAAmB,UAAU,GAClG,iBACH,GACF,IAEA,4CAAC,sCAAc,gBAAgC,OAAO,GAAG,KAAK,GAAG,gBAAgB,MAAM,EAAE,IAAI;AAAA;AAAA;AAAA,EAEjG;AAEJ;",
4
+ "sourcesContent": ["import { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip-v3';\nimport React from 'react';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledSpanWithTooltip, StyledValuePillWrapper } from '../styled.js';\n\nexport const ValuePill = React.memo<DSPillT.InternalProps>((props) => {\n const {\n label,\n size,\n labelTruncated,\n disabled,\n tooltipValue,\n iconLeft,\n ariaLabel,\n applyAriaDisabled,\n readOnly,\n applyTooltipOverflowWrap,\n trailingComma,\n } = props;\n const ownerProps = useOwnerProps(props);\n return (\n <StyledValuePillWrapper\n disabled={disabled}\n pillSize={size}\n alignItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-value\"\n data-testid=\"ds-pill-wrapper\"\n cols={[iconLeft && 'min-content', 'auto'].filter((notFalse) => notFalse) as string[]}\n gutter=\"xxxs\"\n hasIcon={iconLeft !== null}\n data-label={ariaLabel || label}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n {...ownerProps}\n >\n {iconLeft}\n {tooltipValue !== '' ? (\n <DSTooltipV3 text={tooltipValue ?? ''} applyTooltipOverflowWrap={applyTooltipOverflowWrap}>\n <StyledSpanWithTooltip className=\"ds-pill-tooltip-value\" aria-disabled={applyAriaDisabled} tabIndex={0}>\n {label}\n </StyledSpanWithTooltip>\n </DSTooltipV3>\n ) : (\n <TextComponent labelTruncated={labelTruncated} label={`${label}${trailingComma ? ',' : ''}`} />\n )}\n </StyledValuePillWrapper>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuBnB;AAvBJ,8BAA8B;AAC9B,2BAA4B;AAC5B,mBAAkB;AAElB,2BAA8B;AAC9B,oBAA8D;AAEvD,MAAM,YAAY,aAAAA,QAAM,KAA4B,CAAC,UAAU;AACpE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,iBAAa,uCAAc,KAAK;AACtC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,UAAU;AAAA,MACV,YAAW;AAAA,MACX,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,MAAM,CAAC,YAAY,eAAe,MAAM,EAAE,OAAO,CAAC,aAAa,QAAQ;AAAA,MACvE,QAAO;AAAA,MACP,SAAS,aAAa;AAAA,MACtB,cAAY,aAAa;AAAA,MACzB;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,iBAAiB,KAChB,4CAAC,oCAAY,MAAM,gBAAgB,IAAI,0BACrC,sDAAC,uCAAsB,WAAU,yBAAwB,iBAAe,mBAAmB,UAAU,GAClG,iBACH,GACF,IAEA,4CAAC,sCAAc,gBAAgC,OAAO,GAAG,KAAK,GAAG,gBAAgB,MAAM,EAAE,IAAI;AAAA;AAAA;AAAA,EAEjG;AAEJ,CAAC;",
6
6
  "names": ["React"]
7
7
  }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var constants_exports = {};
30
+ __export(constants_exports, {
31
+ DSPillName: () => DSPillName,
32
+ DSPillV2Name: () => DSPillV2Name,
33
+ PILL_V2_DATA_TESTID: () => PILL_V2_DATA_TESTID,
34
+ PILL_V2_SLOTS: () => PILL_V2_SLOTS
35
+ });
36
+ module.exports = __toCommonJS(constants_exports);
37
+ var React = __toESM(require("react"));
38
+ var import_ds_system = require("@elliemae/ds-system");
39
+ const DSPillV2Name = "DSPill";
40
+ const DSPillName = DSPillV2Name;
41
+ const PILL_V2_SLOTS = {
42
+ WRAPPER: "wrapper",
43
+ PILL_GROUP: "pill-group",
44
+ PILL_BUTTON: "pill-button",
45
+ PILL_MENU_BUTTON: "menu-button-chevron"
46
+ };
47
+ const PILL_V2_DATA_TESTID = {
48
+ ...(0, import_ds_system.slotObjectToDataTestIds)(DSPillV2Name, PILL_V2_SLOTS),
49
+ PILL_BUTTON: "ds-button"
50
+ };
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSPillV2Name = 'DSPill';\nexport const DSPillName = DSPillV2Name;\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const PILL_V2_SLOTS = {\n WRAPPER: 'wrapper',\n PILL_GROUP: 'pill-group',\n PILL_BUTTON: 'pill-button',\n PILL_MENU_BUTTON: 'menu-button-chevron',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const PILL_V2_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSPillV2Name, PILL_V2_SLOTS),\n PILL_BUTTON: 'ds-button',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,eAAe;AACrB,MAAM,aAAa;AAGnB,MAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,kBAAkB;AACpB;AAGO,MAAM,sBAAsB;AAAA,EACjC,OAAG,0CAAwB,cAAc,aAAa;AAAA,EACtD,aAAa;AACf;",
6
+ "names": []
7
+ }
package/dist/cjs/index.js CHANGED
@@ -28,18 +28,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var index_exports = {};
30
30
  __export(index_exports, {
31
- DSPillButton: () => import_components.DSPillButton,
32
- DSPillButtonName: () => import_DSPillDefinitions.DSPillButtonName,
33
- DSPillButtonWithSchema: () => import_components.DSPillButtonWithSchema,
34
- DSPillGroupName: () => import_DSPillDefinitions.DSPillGroupName,
35
- DSPillGroupV2: () => import_components.DSPillGroupV2,
36
- DSPillGroupV2WithSchema: () => import_components.DSPillGroupV2WithSchema,
37
- DSPillName: () => import_DSPillDefinitions.DSPillName,
31
+ DSPillButton: () => import_DSPillButton.DSPillButton,
32
+ DSPillButtonName: () => import_DSPillButton.DSPillButtonName,
33
+ DSPillButtonWithSchema: () => import_DSPillButton.DSPillButtonWithSchema,
34
+ DSPillGroupName: () => import_DSPillGroup.DSPillGroupName,
35
+ DSPillGroupV2: () => import_DSPillGroup.DSPillGroupV2,
36
+ DSPillGroupV2WithSchema: () => import_DSPillGroup.DSPillGroupV2WithSchema,
37
+ DSPillName: () => import_constants.DSPillName,
38
38
  DSPillV2: () => import_components.DSPillV2,
39
- DSPillV2WithSchema: () => import_components.DSPillV2WithSchema
39
+ DSPillV2Name: () => import_constants.DSPillV2Name,
40
+ DSPillV2WithSchema: () => import_components.DSPillV2WithSchema,
41
+ PILL_V2_DATA_TESTID: () => import_constants.PILL_V2_DATA_TESTID,
42
+ PILL_V2_SLOTS: () => import_constants.PILL_V2_SLOTS
40
43
  });
41
44
  module.exports = __toCommonJS(index_exports);
42
45
  var React = __toESM(require("react"));
43
46
  var import_components = require("./components/index.js");
44
- var import_DSPillDefinitions = require("./DSPillDefinitions.js");
47
+ var import_DSPillGroup = require("./parts/DSPillGroup/index.js");
48
+ var import_DSPillButton = require("./parts/DSPillButton/index.js");
49
+ var import_constants = require("./constants/index.js");
45
50
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export {\n DSPillV2,\n DSPillButton,\n DSPillButtonWithSchema,\n DSPillGroupV2,\n DSPillGroupV2WithSchema,\n DSPillV2WithSchema,\n} from './components/index.js';\nexport { DSPillButtonName, DSPillGroupName, DSPillName } from './DSPillDefinitions.js';\nexport type { DSPillT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAOO;AACP,+BAA8D;",
4
+ "sourcesContent": ["export { DSPillV2, DSPillV2WithSchema } from './components/index.js';\nexport { DSPillGroupV2, DSPillGroupV2WithSchema, DSPillGroupName } from './parts/DSPillGroup/index.js';\nexport { DSPillButton, DSPillButtonWithSchema, DSPillButtonName } from './parts/DSPillButton/index.js';\nexport { PILL_V2_DATA_TESTID, PILL_V2_SLOTS, DSPillName, DSPillV2Name } from './constants/index.js';\nexport type { DSPillT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA6C;AAC7C,yBAAwE;AACxE,0BAAuE;AACvE,uBAA6E;",
6
6
  "names": []
7
7
  }
@@ -3,5 +3,8 @@
3
3
  "sideEffects": [
4
4
  "*.css",
5
5
  "*.scss"
6
- ]
6
+ ],
7
+ "publishConfig": {
8
+ "access": "public"
9
+ }
7
10
  }
@@ -26,32 +26,30 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var PillButton_exports = {};
30
- __export(PillButton_exports, {
29
+ var DSPillButton_exports = {};
30
+ __export(DSPillButton_exports, {
31
31
  DSPillButton: () => DSPillButton,
32
32
  DSPillButtonWithSchema: () => DSPillButtonWithSchema
33
33
  });
34
- module.exports = __toCommonJS(PillButton_exports);
34
+ module.exports = __toCommonJS(DSPillButton_exports);
35
35
  var React = __toESM(require("react"));
36
36
  var import_jsx_runtime = require("react/jsx-runtime");
37
37
  var import_react = require("react");
38
38
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
- var import_styled = require("./styled.js");
40
- var import_DSPillDefinitions = require("../DSPillDefinitions.js");
41
- var import_react_desc_prop_types = require("../react-desc-prop-types.js");
39
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
40
+ var import_usePillButton = require("./config/usePillButton.js");
41
+ var import_constants = require("./constants/index.js");
42
+ var import_styled = require("../../components/styled.js");
42
43
  const typeToClassName = {
43
44
  only: "ds-pill-button-only",
44
45
  left: "ds-pill-button-left",
45
46
  right: "ds-pill-button-right"
46
47
  };
47
48
  const DSPillButton = (props) => {
48
- const { children, ...restProps } = props;
49
- const propsWithDefaults = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
50
- restProps,
51
- import_react_desc_prop_types.DSPillButtonDefaultProps
52
- );
53
- (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefaults, import_react_desc_prop_types.DSPillButtonPropTypesSchema, import_DSPillDefinitions.DSPillButtonName);
54
- const { type, onClick, applyAriaDisabled, ...rest } = propsWithDefaults;
49
+ const {
50
+ propsWithDefault: { type, onClick, applyAriaDisabled, children, ...rest },
51
+ ownerProps
52
+ } = (0, import_usePillButton.usePillButton)(props);
55
53
  const handleOnClick = (0, import_react.useCallback)(
56
54
  (e) => {
57
55
  if (applyAriaDisabled) return;
@@ -68,11 +66,12 @@ const DSPillButton = (props) => {
68
66
  type: "button",
69
67
  onClick: handleOnClick,
70
68
  "aria-disabled": applyAriaDisabled,
69
+ ...ownerProps,
71
70
  children
72
71
  }
73
72
  );
74
73
  };
75
- DSPillButton.displayName = import_DSPillDefinitions.DSPillButtonName;
76
- const DSPillButtonWithSchema = (0, import_ds_props_helpers.describe)(DSPillButton).description("Pill button");
74
+ DSPillButton.displayName = import_constants.DSPillButtonName;
75
+ const DSPillButtonWithSchema = (0, import_ds_props_helpers.describe)(DSPillButton);
77
76
  DSPillButtonWithSchema.propTypes = import_react_desc_prop_types.DSPillButtonPropTypesSchema;
78
- //# sourceMappingURL=PillButton.js.map
77
+ //# sourceMappingURL=DSPillButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/parts/DSPillButton/DSPillButton.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useCallback } from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSPillButtonT, DSPillButtonPropTypesSchema } from './react-desc-prop-types.js';\nimport { usePillButton } from './config/usePillButton.js';\nimport { DSPillButtonName } from './constants/index.js';\nimport { StyledPillButton } from '../../components/styled.js';\n\nconst typeToClassName = {\n only: 'ds-pill-button-only',\n left: 'ds-pill-button-left',\n right: 'ds-pill-button-right',\n};\n\nconst DSPillButton: React.ComponentType<DSPillButtonT.Props> = (props) => {\n const {\n propsWithDefault: { type, onClick, applyAriaDisabled, children, ...rest },\n ownerProps,\n } = usePillButton(props);\n const handleOnClick = useCallback(\n (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => {\n if (applyAriaDisabled) return;\n if (onClick) onClick(e as React.MouseEvent<HTMLButtonElement>);\n },\n [onClick, applyAriaDisabled],\n );\n\n return (\n <StyledPillButton\n {...rest}\n buttonType=\"raw\"\n className={`${typeToClassName[type]} ${rest.className ?? ''}`}\n type=\"button\"\n onClick={handleOnClick}\n aria-disabled={applyAriaDisabled}\n {...ownerProps}\n >\n {children}\n </StyledPillButton>\n );\n};\n\nDSPillButton.displayName = DSPillButtonName;\nconst DSPillButtonWithSchema = describe(DSPillButton);\nDSPillButtonWithSchema.propTypes = DSPillButtonPropTypesSchema;\n\nexport { DSPillButton, DSPillButtonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2BnB;AA3BJ,mBAAmC;AACnC,8BAAyB;AACzB,mCAAgE;AAChE,2BAA8B;AAC9B,uBAAiC;AACjC,oBAAiC;AAEjC,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,eAAyD,CAAC,UAAU;AACxE,QAAM;AAAA,IACJ,kBAAkB,EAAE,MAAM,SAAS,mBAAmB,UAAU,GAAG,KAAK;AAAA,IACxE;AAAA,EACF,QAAI,oCAAc,KAAK;AACvB,QAAM,oBAAgB;AAAA,IACpB,CAAC,MAAoF;AACnF,UAAI,kBAAmB;AACvB,UAAI,QAAS,SAAQ,CAAwC;AAAA,IAC/D;AAAA,IACA,CAAC,SAAS,iBAAiB;AAAA,EAC7B;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,YAAW;AAAA,MACX,WAAW,GAAG,gBAAgB,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;AAAA,MAC3D,MAAK;AAAA,MACL,SAAS;AAAA,MACT,iBAAe;AAAA,MACd,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,6BAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;",
6
+ "names": []
7
+ }